From b66b7fd35f67e1090087241c74ba9ab11976622e Mon Sep 17 00:00:00 2001 From: Dimitrios Eftaxiopoulos Date: Mon, 26 Sep 2011 23:32:14 +0300 Subject: [PATCH] Imported Upstream version 2~rc1 --- CMakeLists.txt | 43 +- COPYRIGHT | 44 - ChangeLog.txt | 639 +- ChangeLog.txt~ | 634 -- FindMathGL.cmake | 80 - Makefile.am | 22 +- Makefile.in | 55 +- MathGL2.cbp | 208 + NEWS | 26 +- README_V2 | 51 + TODO | 10 +- aclocal.m4 | 2081 ++--- autom4te.cache/output.0 | 4950 +++++------ autom4te.cache/output.1 | 4950 +++++------ autom4te.cache/requests | 26 +- autom4te.cache/traces.0 | 647 +- autom4te.cache/traces.1 | 682 +- config/config.guess | 9 +- config/config.sub | 19 +- config/libtool.m4 | 2044 ++--- config/ltmain.sh | 3993 +++------ config/ltoptions.m4 | 13 +- config/ltversion.m4 | 12 +- config/lt~obsolete.m4 | 12 +- config/texinfo.tex | 9291 -------------------- configure | 4792 ++++------ configure.ac | 108 +- debinstall/changelog | 117 - debinstall/compat | 1 - debinstall/control | 261 - debinstall/copyright | 22 - debinstall/docs | 7 - debinstall/libmgl-data.docs | 7 - debinstall/libmgl-data.install | 1 - debinstall/libmgl-dev.docs | 7 - debinstall/libmgl-dev.install | 2 - debinstall/libmgl-fltk-dev.docs | 7 - debinstall/libmgl-fltk-dev.install | 2 - debinstall/libmgl-fltk5.docs | 7 - debinstall/libmgl-fltk5.install | 1 - debinstall/libmgl-glut-dev.docs | 7 - debinstall/libmgl-glut-dev.install | 2 - debinstall/libmgl-glut5.docs | 7 - debinstall/libmgl-glut5.install | 1 - debinstall/libmgl-qt-dev.docs | 7 - debinstall/libmgl-qt-dev.install | 2 - debinstall/libmgl-qt5.docs | 7 - debinstall/libmgl-qt5.install | 1 - debinstall/libmgl-wx-dev.docs | 7 - debinstall/libmgl-wx-dev.install | 2 - debinstall/libmgl-wx5.docs | 7 - debinstall/libmgl-wx5.install | 1 - debinstall/libmgl5.docs | 7 - debinstall/libmgl5.install | 1 - debinstall/mathgl-doc-html.docs | 10 - debinstall/mathgl-doc-info.docs | 7 - debinstall/mathgl-doc-info.install | 1 - debinstall/mathgl-doc-pdf.docs | 8 - debinstall/mathgl.install | 1 - debinstall/octave-mathgl.docs | 7 - debinstall/pycompat | 1 - debinstall/python-mathgl.docs | 7 - debinstall/rules | 21 - emblem.mgl | 39 - examples/CMakeLists.txt | 10 +- examples/Makefile.am | 34 +- examples/Makefile.in | 159 +- examples/fltk_example.cpp | 77 +- examples/full_test.cpp | 3840 ++++---- examples/glut_example.cpp | 38 +- examples/main.cpp | 136 - examples/qt_example.cpp | 69 +- examples/test.mgl | 13 - examples/wnd_samples.cpp | 253 +- examples/wx_example.cpp | 92 +- examples/hotdogs.pts => hotdogs.pts | 0 include/CMakeLists.txt | 17 +- include/Makefile.am | 24 +- include/Makefile.in | 40 +- include/mgl/base.h | 382 + include/mgl/base_cf.h | 117 + include/mgl/canvas.h | 480 + include/mgl/canvas_cf.h | 321 + include/mgl/cont.h | 124 + include/mgl/data.h | 720 ++ include/mgl/{mgl_define.h => define.h} | 388 +- include/mgl/{mgl_eval.h => eval.h} | 106 +- include/mgl/fit.h | 67 + include/mgl/{mgl_fltk.h => fltk.h} | 274 +- include/mgl/{mgl_font.h => font.h} | 82 +- include/mgl/glut.h | 94 + include/mgl/gsl.fs | 1276 --- include/mgl/mathgl.fs | 472 - include/mgl/mgl.h | 2117 ++--- include/mgl/mgl_ab.h | 252 - include/mgl/mgl_addon.h | 73 - include/mgl/mgl_c.h | 672 -- include/mgl/mgl_cf.h | 36 + include/mgl/mgl_data.h | 379 - include/mgl/mgl_eps.h | 98 - include/mgl/mgl_evalc.h | 57 - include/mgl/mgl_f.h | 630 -- include/mgl/mgl_gl.h | 90 - include/mgl/mgl_glut.h | 61 - include/mgl/mgl_idtf.h | 386 - include/mgl/mgl_pas.pas | 1557 ---- include/mgl/mgl_w.h | 1037 --- include/mgl/mgl_wx.h | 180 - include/mgl/mgl_zb.h | 62 - include/mgl/mglplot.fs | 562 -- include/mgl/opengl.h | 68 + include/mgl/other.h | 107 + include/mgl/{mgl_parse.h => parser.h} | 427 +- include/mgl/plot.h | 136 + include/mgl/prim.h | 104 + include/mgl/{mgl_qt.h => qt.h} | 367 +- include/mgl/surf.h | 90 + include/mgl/type.h | 121 + include/mgl/vect.h | 88 + include/mgl/vectors.fs | 161 - include/mgl/volume.h | 79 + include/mgl/window.h | 139 + lang/CMakeLists.txt | 37 +- lang/DESCRIPTION | 4 +- lang/Makefile.am | 8 +- lang/Makefile.in | 19 +- lang/mgl.i | 13 +- lang/numpy.i | 2 +- mathgl-all.workspace | 15 - mathgl.cbp | 108 - mathgl.spec | 107 - mgl-fltk.cbp | 52 - mgl-glut.cbp | 52 - mgl/Makefile.am | 64 - mgl/mgl_1d.cpp | 1888 ---- mgl/mgl_2d.cpp | 1090 --- mgl/mgl_3d.cpp | 1001 --- mgl/mgl_ab.cpp | 980 --- mgl/mgl_addon.cpp | 235 - mgl/mgl_axis.cpp | 1269 --- mgl/mgl_c.cpp | 490 -- mgl/mgl_combi.cpp | 605 -- mgl/mgl_cont.cpp | 1343 --- mgl/mgl_crust.cpp | 636 -- mgl/mgl_data.cpp | 2076 ----- mgl/mgl_data_cf.cpp | 611 -- mgl/mgl_data_io.cpp | 1168 --- mgl/mgl_eps.cpp | 774 -- mgl/mgl_evalc.cpp | 285 - mgl/mgl_exec.cpp | 3723 -------- mgl/mgl_f.cpp | 640 -- mgl/mgl_fit.cpp | 568 -- mgl/mgl_flow.cpp | 946 -- mgl/mgl_gl.cpp | 511 -- mgl/mgl_idtf.cpp | 4333 --------- mgl/mgl_main.cpp | 1227 --- mgl/mgl_pde.cpp | 530 -- mgl/mgl_vect.cpp | 666 -- mgl/mgl_zb.cpp | 987 --- mgl/mgl_zb2.cpp | 790 -- mgl2cpp.cbp | 48 - mgl2eps.cbp | 48 - mgl2gif.cbp | 48 - mgl2png.cbp | 48 - mgl2svg.cbp | 48 - mgl_example.cbp | 50 - mglview.cbp | 52 - sample.csv | 113 + setup.py | 38 - {mgl => src}/CMakeLists.txt | 18 +- src/Makefile.am | 44 + {mgl => src}/Makefile.in | 499 +- src/axis.cpp | 800 ++ src/base.cpp | 841 ++ src/base_cf.cpp | 184 + src/canvas.cpp | 759 ++ src/canvas_cf.cpp | 333 + src/cont.cpp | 1325 +++ src/crust.cpp | 457 + src/data.cpp | 1557 ++++ src/data_io.cpp | 1070 +++ src/data_new.cpp | 1267 +++ src/data_op.cpp | 26 + mgl/mgl_data_png.cpp => src/data_png.cpp | 81 +- mgl/mgl_def_font.cpp => src/def_font.cpp | 3 +- mgl/mgl_eval.cpp => src/eval.cpp | 1404 +-- mgl/mgl_evalp.cpp => src/evalp.cpp | 40 +- src/exec.cpp | 3599 ++++++++ mgl/mgl_export.cpp => src/export.cpp | 287 +- src/export_2d.cpp | 524 ++ src/export_3d.cpp | 146 + src/fit.cpp | 486 + mgl/mgl_font.cpp => src/font.cpp | 271 +- src/opengl.cpp | 257 + src/other.cpp | 468 + mgl/mgl_parse.cpp => src/parser.cpp | 647 +- src/pde.cpp | 525 ++ src/pixel.cpp | 981 +++ src/plot.cpp | 1523 ++++ src/prim.cpp | 580 ++ src/surf.cpp | 917 ++ mgl/mgl_tex_table.cpp => src/tex_table.cpp | 2 +- src/vect.cpp | 1067 +++ src/volume.cpp | 775 ++ test.cpp | 1943 ++++ texinfo/CMakeLists.txt | 46 +- texinfo/Makefile.in | 1056 --- texinfo/class_en.texi | 2 +- texinfo/concept_en.texi | 98 +- texinfo/concept_ru.texi | 74 +- texinfo/core_en.texi | 4339 +++++---- texinfo/core_ru.texi | 2293 ++--- texinfo/data_en.texi | 1229 ++- texinfo/data_ru.texi | 44 +- texinfo/ex_mgl_en.texi | 8 +- texinfo/example_en.texi | 45 +- texinfo/example_ru.texi | 8 +- texinfo/mathgl.texi | 0 texinfo/mathgl_en.texi | 35 +- texinfo/mathgl_ru.texi | 35 +- texinfo/mgl_cmd_en.texi | 1405 +-- texinfo/mgl_cmd_ru.texi | 2 +- texinfo/mgl_en.texi | 32 +- texinfo/mgl_ru.texi | 32 +- texinfo/other_en.texi | 368 +- texinfo/overview_en.texi | 393 +- texinfo/overview_ru.texi | 275 +- texinfo/png/Makefile.in | 471 - texinfo/samples_en.texi | 4182 ++------- texinfo/samples_ru.texi | 111 +- texinfo/widget_en.texi | 371 +- todo.txt | 66 + udav/CMakeLists.txt | 36 + udav/ReadMe | 11 + udav/anim_dlg.cpp | 140 + udav/anim_dlg.h | 57 + udav/args_dlg.cpp | 87 + utils/mgl2png.cpp => udav/args_dlg.h | 106 +- udav/calc_dlg.cpp | 257 + udav/calc_dlg.h | 87 + udav/dat_pnl.cpp | 860 ++ udav/dat_pnl.h | 121 + udav/files_dlg.cpp | 95 + udav/files_dlg.h | 47 + udav/find_dlg.cpp | 75 + utils/mgl2svg.cpp => udav/find_dlg.h | 80 +- udav/help_pnl.cpp | 90 + utils/mgl2eps.cpp => udav/help_pnl.h | 69 +- udav/hint_dlg.cpp | 95 + udav/hint_dlg.h | 46 + udav/info_dlg.cpp | 80 + udav/info_dlg.h | 56 + udav/main.cpp | 135 + udav/mem_pnl.cpp | 181 + udav/mem_pnl.h | 54 + udav/newcmd_dlg.cpp | 356 + udav/newcmd_dlg.h | 74 + udav/open_dlg.cpp | 165 + udav/open_dlg.h | 49 + udav/opt_dlg.cpp | 115 + udav/opt_dlg.h | 47 + udav/plot_pnl.cpp | 471 + udav/plot_pnl.h | 89 + udav/prop_dlg.cpp | 289 + udav/prop_dlg.h | 65 + udav/qmglcanvas.cpp | 458 + udav/qmglcanvas.h | 134 + udav/qmglsyntax.cpp | 101 + udav/qmglsyntax.h | 44 + udav/setup_dlg.cpp | 299 + udav/setup_dlg.h | 57 + udav/src.pro | 68 + udav/style_dlg.cpp | 363 + udav/style_dlg.h | 61 + udav/text_pnl.cpp | 538 ++ udav/text_pnl.h | 110 + udav/textedit.cpp | 143 + udav/textedit.h | 71 + udav/udav.ico | Bin 0 -> 16958 bytes udav/udav.png | Bin 0 -> 4139 bytes udav/udav.qrc | 48 + udav/udav.rc | 1 + udav/udav_ru.qm | Bin 0 -> 71709 bytes udav/udav_ru.ts | 4425 ++++++++++ udav/udav_wnd.cpp | 658 ++ udav/udav_wnd.h | 127 + udav/xpm/accessories-calculator.png | Bin 0 -> 686 bytes udav/xpm/alpha.png | Bin 0 -> 762 bytes udav/xpm/arrow_a.xpm | 21 + udav/xpm/arrow_d.xpm | 21 + udav/xpm/arrow_i.xpm | 21 + udav/xpm/arrow_k.xpm | 21 + udav/xpm/arrow_n.xpm | 21 + udav/xpm/arrow_o.xpm | 21 + udav/xpm/arrow_s.xpm | 21 + udav/xpm/arrow_t.xpm | 21 + udav/xpm/arrow_v.xpm | 21 + udav/xpm/cons.xpm | 23 + udav/xpm/crop.xpm | 21 + udav/xpm/dash_d.xpm | 21 + udav/xpm/dash_e.xpm | 21 + udav/xpm/dash_i.xpm | 21 + udav/xpm/dash_j.xpm | 21 + udav/xpm/dash_l.xpm | 21 + udav/xpm/dash_m.xpm | 21 + udav/xpm/dash_s.xpm | 21 + udav/xpm/dialog-information.png | Bin 0 -> 863 bytes udav/xpm/diff.xpm | 21 + udav/xpm/diff2.xpm | 22 + udav/xpm/document-export.png | Bin 0 -> 1000 bytes udav/xpm/document-import.png | Bin 0 -> 750 bytes udav/xpm/document-new.png | Bin 0 -> 477 bytes udav/xpm/document-open.png | Bin 0 -> 672 bytes udav/xpm/document-print.png | Bin 0 -> 544 bytes udav/xpm/document-properties.png | Bin 0 -> 464 bytes udav/xpm/document-save.png | Bin 0 -> 911 bytes udav/xpm/edit-copy.png | Bin 0 -> 498 bytes udav/xpm/edit-cut.png | Bin 0 -> 807 bytes udav/xpm/edit-delete.png | Bin 0 -> 783 bytes udav/xpm/edit-find.png | Bin 0 -> 617 bytes udav/xpm/edit-paste.png | Bin 0 -> 561 bytes udav/xpm/edit-redo.png | Bin 0 -> 591 bytes udav/xpm/edit-select-all.png | Bin 0 -> 441 bytes udav/xpm/edit-undo.png | Bin 0 -> 650 bytes udav/xpm/film-b.png | Bin 0 -> 637 bytes udav/xpm/folder.png | Bin 0 -> 581 bytes udav/xpm/format-indent-more.png | Bin 0 -> 427 bytes udav/xpm/func.xpm | 21 + udav/xpm/go-down.png | Bin 0 -> 683 bytes udav/xpm/go-first.png | Bin 0 -> 666 bytes udav/xpm/go-last.png | Bin 0 -> 685 bytes udav/xpm/go-next-b.png | Bin 0 -> 655 bytes udav/xpm/go-next.png | Bin 0 -> 676 bytes udav/xpm/go-previous-b.png | Bin 0 -> 645 bytes udav/xpm/go-previous.png | Bin 0 -> 655 bytes udav/xpm/go-up.png | Bin 0 -> 652 bytes udav/xpm/help-contents.png | Bin 0 -> 612 bytes udav/xpm/help-faq.png | Bin 0 -> 744 bytes udav/xpm/insert.xpm | 23 + udav/xpm/integr.xpm | 22 + udav/xpm/mark_.xpm | 21 + udav/xpm/mark_a.xpm | 21 + udav/xpm/mark_cf.xpm | 21 + udav/xpm/mark_d.xpm | 21 + udav/xpm/mark_df.xpm | 21 + udav/xpm/mark_l.xpm | 21 + udav/xpm/mark_lf.xpm | 21 + udav/xpm/mark_n.xpm | 20 + udav/xpm/mark_o.xpm | 21 + udav/xpm/mark_of.xpm | 21 + udav/xpm/mark_p.xpm | 21 + udav/xpm/mark_pf.xpm | 21 + udav/xpm/mark_r.xpm | 21 + udav/xpm/mark_rf.xpm | 21 + udav/xpm/mark_s.xpm | 21 + udav/xpm/mark_sf.xpm | 21 + udav/xpm/mark_t.xpm | 21 + udav/xpm/mark_tf.xpm | 21 + udav/xpm/mark_v.xpm | 21 + udav/xpm/mark_vf.xpm | 21 + udav/xpm/mark_x.xpm | 21 + udav/xpm/mark_y.xpm | 21 + udav/xpm/media-seek-backward.png | Bin 0 -> 764 bytes udav/xpm/media-seek-forward.png | Bin 0 -> 782 bytes udav/xpm/none.xpm | 21 + udav/xpm/object-rotate-right.png | Bin 0 -> 632 bytes udav/xpm/oper.xpm | 21 + udav/xpm/oper_a.xpm | 21 + udav/xpm/oper_d.xpm | 21 + udav/xpm/oper_m.xpm | 22 + udav/xpm/oper_s.xpm | 21 + udav/xpm/option.xpm | 22 + udav/xpm/plot.xpm | 23 + udav/xpm/preferences-system.png | Bin 0 -> 611 bytes udav/xpm/preview.xpm | 193 + udav/xpm/process-stop.png | Bin 0 -> 820 bytes udav/xpm/size.xpm | 21 + udav/xpm/smth.xpm | 22 + udav/xpm/squize.xpm | 22 + udav/xpm/style.xpm | 22 + udav/xpm/sum.xpm | 21 + udav/xpm/swap.xpm | 23 + udav/xpm/system-file-manager.png | Bin 0 -> 378 bytes udav/xpm/table.xpm | 24 + udav/xpm/text-x-generic.png | Bin 0 -> 333 bytes udav/xpm/tran.xpm | 23 + udav/xpm/udav.png | Bin 0 -> 4139 bytes udav/xpm/update.xpm | 21 + udav/xpm/view-refresh.png | Bin 0 -> 912 bytes udav/xpm/weather-clear.png | Bin 0 -> 682 bytes udav/xpm/window.xpm | 29 + udav/xpm/wire.xpm | 21 + udav/xpm/x-office-presentation.png | Bin 0 -> 567 bytes udav/xpm/x-office-spreadsheet.png | Bin 0 -> 704 bytes udav/xpm/zoom-fit-best.png | Bin 0 -> 883 bytes udav/xpm/zoom-in.png | Bin 0 -> 841 bytes udav/xpm/zoom-original.png | Bin 0 -> 842 bytes udav/xpm/zoom-out.png | Bin 0 -> 823 bytes utils/CMakeLists.txt | 50 +- utils/Makefile.am | 26 +- utils/Makefile.in | 100 +- utils/mgl2cpp.cpp | 89 - utils/mgl2gif.cpp | 160 - utils/mglconv.cpp | 101 + utils/mglview.cpp | 77 +- widgets/CMakeLists.txt | 97 +- widgets/Makefile.am | 49 +- widgets/Makefile.in | 187 +- widgets/{mgl_fltk.cpp => fltk.cpp} | 421 +- widgets/{mgl_glut.cpp => glut.cpp} | 91 +- widgets/mgl_wx.cpp | 761 -- widgets/{mgl_qt.cpp => qt.cpp} | 1392 ++- widgets/window.cpp | 168 + 413 files changed, 63226 insertions(+), 83355 deletions(-) delete mode 100644 COPYRIGHT delete mode 100644 ChangeLog.txt~ delete mode 100644 FindMathGL.cmake create mode 100644 MathGL2.cbp create mode 100644 README_V2 delete mode 100644 config/texinfo.tex delete mode 100644 debinstall/changelog delete mode 100644 debinstall/compat delete mode 100644 debinstall/control delete mode 100644 debinstall/copyright delete mode 100644 debinstall/docs delete mode 100644 debinstall/libmgl-data.docs delete mode 100644 debinstall/libmgl-data.install delete mode 100644 debinstall/libmgl-dev.docs delete mode 100644 debinstall/libmgl-dev.install delete mode 100644 debinstall/libmgl-fltk-dev.docs delete mode 100644 debinstall/libmgl-fltk-dev.install delete mode 100644 debinstall/libmgl-fltk5.docs delete mode 100644 debinstall/libmgl-fltk5.install delete mode 100644 debinstall/libmgl-glut-dev.docs delete mode 100644 debinstall/libmgl-glut-dev.install delete mode 100644 debinstall/libmgl-glut5.docs delete mode 100644 debinstall/libmgl-glut5.install delete mode 100644 debinstall/libmgl-qt-dev.docs delete mode 100644 debinstall/libmgl-qt-dev.install delete mode 100644 debinstall/libmgl-qt5.docs delete mode 100644 debinstall/libmgl-qt5.install delete mode 100644 debinstall/libmgl-wx-dev.docs delete mode 100644 debinstall/libmgl-wx-dev.install delete mode 100644 debinstall/libmgl-wx5.docs delete mode 100644 debinstall/libmgl-wx5.install delete mode 100644 debinstall/libmgl5.docs delete mode 100644 debinstall/libmgl5.install delete mode 100644 debinstall/mathgl-doc-html.docs delete mode 100644 debinstall/mathgl-doc-info.docs delete mode 100644 debinstall/mathgl-doc-info.install delete mode 100644 debinstall/mathgl-doc-pdf.docs delete mode 100644 debinstall/mathgl.install delete mode 100644 debinstall/octave-mathgl.docs delete mode 100644 debinstall/pycompat delete mode 100644 debinstall/python-mathgl.docs delete mode 100755 debinstall/rules delete mode 100644 emblem.mgl delete mode 100644 examples/main.cpp delete mode 100644 examples/test.mgl rename examples/hotdogs.pts => hotdogs.pts (100%) create mode 100644 include/mgl/base.h create mode 100644 include/mgl/base_cf.h create mode 100644 include/mgl/canvas.h create mode 100644 include/mgl/canvas_cf.h create mode 100644 include/mgl/cont.h create mode 100644 include/mgl/data.h rename include/mgl/{mgl_define.h => define.h} (58%) rename include/mgl/{mgl_eval.h => eval.h} (76%) create mode 100644 include/mgl/fit.h rename include/mgl/{mgl_fltk.h => fltk.h} (64%) rename include/mgl/{mgl_font.h => font.h} (75%) create mode 100644 include/mgl/glut.h delete mode 100644 include/mgl/gsl.fs delete mode 100644 include/mgl/mathgl.fs delete mode 100644 include/mgl/mgl_ab.h delete mode 100644 include/mgl/mgl_addon.h delete mode 100644 include/mgl/mgl_c.h create mode 100644 include/mgl/mgl_cf.h delete mode 100644 include/mgl/mgl_data.h delete mode 100644 include/mgl/mgl_eps.h delete mode 100644 include/mgl/mgl_evalc.h delete mode 100644 include/mgl/mgl_f.h delete mode 100644 include/mgl/mgl_gl.h delete mode 100644 include/mgl/mgl_glut.h delete mode 100644 include/mgl/mgl_idtf.h delete mode 100644 include/mgl/mgl_pas.pas delete mode 100644 include/mgl/mgl_w.h delete mode 100644 include/mgl/mgl_wx.h delete mode 100644 include/mgl/mgl_zb.h delete mode 100644 include/mgl/mglplot.fs create mode 100644 include/mgl/opengl.h create mode 100644 include/mgl/other.h rename include/mgl/{mgl_parse.h => parser.h} (75%) create mode 100644 include/mgl/plot.h create mode 100644 include/mgl/prim.h rename include/mgl/{mgl_qt.h => qt.h} (72%) create mode 100644 include/mgl/surf.h create mode 100644 include/mgl/type.h create mode 100644 include/mgl/vect.h delete mode 100644 include/mgl/vectors.fs create mode 100644 include/mgl/volume.h create mode 100644 include/mgl/window.h delete mode 100644 mathgl-all.workspace delete mode 100644 mathgl.cbp delete mode 100644 mathgl.spec delete mode 100644 mgl-fltk.cbp delete mode 100644 mgl-glut.cbp delete mode 100644 mgl/Makefile.am delete mode 100644 mgl/mgl_1d.cpp delete mode 100644 mgl/mgl_2d.cpp delete mode 100644 mgl/mgl_3d.cpp delete mode 100644 mgl/mgl_ab.cpp delete mode 100644 mgl/mgl_addon.cpp delete mode 100644 mgl/mgl_axis.cpp delete mode 100644 mgl/mgl_c.cpp delete mode 100644 mgl/mgl_combi.cpp delete mode 100644 mgl/mgl_cont.cpp delete mode 100644 mgl/mgl_crust.cpp delete mode 100644 mgl/mgl_data.cpp delete mode 100644 mgl/mgl_data_cf.cpp delete mode 100644 mgl/mgl_data_io.cpp delete mode 100644 mgl/mgl_eps.cpp delete mode 100644 mgl/mgl_evalc.cpp delete mode 100644 mgl/mgl_exec.cpp delete mode 100644 mgl/mgl_f.cpp delete mode 100644 mgl/mgl_fit.cpp delete mode 100644 mgl/mgl_flow.cpp delete mode 100644 mgl/mgl_gl.cpp delete mode 100644 mgl/mgl_idtf.cpp delete mode 100644 mgl/mgl_main.cpp delete mode 100644 mgl/mgl_pde.cpp delete mode 100644 mgl/mgl_vect.cpp delete mode 100644 mgl/mgl_zb.cpp delete mode 100644 mgl/mgl_zb2.cpp delete mode 100644 mgl2cpp.cbp delete mode 100644 mgl2eps.cbp delete mode 100644 mgl2gif.cbp delete mode 100644 mgl2png.cbp delete mode 100644 mgl2svg.cbp delete mode 100644 mgl_example.cbp delete mode 100644 mglview.cbp create mode 100644 sample.csv delete mode 100644 setup.py rename {mgl => src}/CMakeLists.txt (77%) create mode 100644 src/Makefile.am rename {mgl => src}/Makefile.in (58%) create mode 100644 src/axis.cpp create mode 100644 src/base.cpp create mode 100644 src/base_cf.cpp create mode 100644 src/canvas.cpp create mode 100644 src/canvas_cf.cpp create mode 100644 src/cont.cpp create mode 100644 src/crust.cpp create mode 100644 src/data.cpp create mode 100644 src/data_io.cpp create mode 100644 src/data_new.cpp create mode 100644 src/data_op.cpp rename mgl/mgl_data_png.cpp => src/data_png.cpp (63%) rename mgl/mgl_def_font.cpp => src/def_font.cpp (99%) rename mgl/mgl_eval.cpp => src/eval.cpp (86%) rename mgl/mgl_evalp.cpp => src/evalp.cpp (94%) create mode 100644 src/exec.cpp rename mgl/mgl_export.cpp => src/export.cpp (72%) create mode 100644 src/export_2d.cpp create mode 100644 src/export_3d.cpp create mode 100644 src/fit.cpp rename mgl/mgl_font.cpp => src/font.cpp (82%) create mode 100644 src/opengl.cpp create mode 100644 src/other.cpp rename mgl/mgl_parse.cpp => src/parser.cpp (63%) create mode 100644 src/pde.cpp create mode 100644 src/pixel.cpp create mode 100644 src/plot.cpp create mode 100644 src/prim.cpp create mode 100644 src/surf.cpp rename mgl/mgl_tex_table.cpp => src/tex_table.cpp (99%) create mode 100644 src/vect.cpp create mode 100644 src/volume.cpp create mode 100644 test.cpp delete mode 100644 texinfo/Makefile.in create mode 100644 texinfo/mathgl.texi delete mode 100644 texinfo/png/Makefile.in create mode 100644 todo.txt create mode 100644 udav/CMakeLists.txt create mode 100644 udav/ReadMe create mode 100644 udav/anim_dlg.cpp create mode 100644 udav/anim_dlg.h create mode 100644 udav/args_dlg.cpp rename utils/mgl2png.cpp => udav/args_dlg.h (52%) create mode 100644 udav/calc_dlg.cpp create mode 100644 udav/calc_dlg.h create mode 100644 udav/dat_pnl.cpp create mode 100644 udav/dat_pnl.h create mode 100644 udav/files_dlg.cpp create mode 100644 udav/files_dlg.h create mode 100644 udav/find_dlg.cpp rename utils/mgl2svg.cpp => udav/find_dlg.h (54%) create mode 100644 udav/help_pnl.cpp rename utils/mgl2eps.cpp => udav/help_pnl.h (54%) create mode 100644 udav/hint_dlg.cpp create mode 100644 udav/hint_dlg.h create mode 100644 udav/info_dlg.cpp create mode 100644 udav/info_dlg.h create mode 100644 udav/main.cpp create mode 100644 udav/mem_pnl.cpp create mode 100644 udav/mem_pnl.h create mode 100644 udav/newcmd_dlg.cpp create mode 100644 udav/newcmd_dlg.h create mode 100644 udav/open_dlg.cpp create mode 100644 udav/open_dlg.h create mode 100644 udav/opt_dlg.cpp create mode 100644 udav/opt_dlg.h create mode 100644 udav/plot_pnl.cpp create mode 100644 udav/plot_pnl.h create mode 100644 udav/prop_dlg.cpp create mode 100644 udav/prop_dlg.h create mode 100644 udav/qmglcanvas.cpp create mode 100644 udav/qmglcanvas.h create mode 100644 udav/qmglsyntax.cpp create mode 100644 udav/qmglsyntax.h create mode 100644 udav/setup_dlg.cpp create mode 100644 udav/setup_dlg.h create mode 100644 udav/src.pro create mode 100644 udav/style_dlg.cpp create mode 100644 udav/style_dlg.h create mode 100644 udav/text_pnl.cpp create mode 100644 udav/text_pnl.h create mode 100644 udav/textedit.cpp create mode 100644 udav/textedit.h create mode 100644 udav/udav.ico create mode 100644 udav/udav.png create mode 100644 udav/udav.qrc create mode 100644 udav/udav.rc create mode 100644 udav/udav_ru.qm create mode 100644 udav/udav_ru.ts create mode 100644 udav/udav_wnd.cpp create mode 100644 udav/udav_wnd.h create mode 100644 udav/xpm/accessories-calculator.png create mode 100644 udav/xpm/alpha.png create mode 100644 udav/xpm/arrow_a.xpm create mode 100644 udav/xpm/arrow_d.xpm create mode 100644 udav/xpm/arrow_i.xpm create mode 100644 udav/xpm/arrow_k.xpm create mode 100644 udav/xpm/arrow_n.xpm create mode 100644 udav/xpm/arrow_o.xpm create mode 100644 udav/xpm/arrow_s.xpm create mode 100644 udav/xpm/arrow_t.xpm create mode 100644 udav/xpm/arrow_v.xpm create mode 100644 udav/xpm/cons.xpm create mode 100644 udav/xpm/crop.xpm create mode 100644 udav/xpm/dash_d.xpm create mode 100644 udav/xpm/dash_e.xpm create mode 100644 udav/xpm/dash_i.xpm create mode 100644 udav/xpm/dash_j.xpm create mode 100644 udav/xpm/dash_l.xpm create mode 100644 udav/xpm/dash_m.xpm create mode 100644 udav/xpm/dash_s.xpm create mode 100644 udav/xpm/dialog-information.png create mode 100644 udav/xpm/diff.xpm create mode 100644 udav/xpm/diff2.xpm create mode 100644 udav/xpm/document-export.png create mode 100644 udav/xpm/document-import.png create mode 100644 udav/xpm/document-new.png create mode 100644 udav/xpm/document-open.png create mode 100644 udav/xpm/document-print.png create mode 100644 udav/xpm/document-properties.png create mode 100644 udav/xpm/document-save.png create mode 100644 udav/xpm/edit-copy.png create mode 100644 udav/xpm/edit-cut.png create mode 100644 udav/xpm/edit-delete.png create mode 100644 udav/xpm/edit-find.png create mode 100644 udav/xpm/edit-paste.png create mode 100644 udav/xpm/edit-redo.png create mode 100644 udav/xpm/edit-select-all.png create mode 100644 udav/xpm/edit-undo.png create mode 100644 udav/xpm/film-b.png create mode 100644 udav/xpm/folder.png create mode 100644 udav/xpm/format-indent-more.png create mode 100644 udav/xpm/func.xpm create mode 100644 udav/xpm/go-down.png create mode 100644 udav/xpm/go-first.png create mode 100644 udav/xpm/go-last.png create mode 100644 udav/xpm/go-next-b.png create mode 100644 udav/xpm/go-next.png create mode 100644 udav/xpm/go-previous-b.png create mode 100644 udav/xpm/go-previous.png create mode 100644 udav/xpm/go-up.png create mode 100644 udav/xpm/help-contents.png create mode 100644 udav/xpm/help-faq.png create mode 100644 udav/xpm/insert.xpm create mode 100644 udav/xpm/integr.xpm create mode 100644 udav/xpm/mark_.xpm create mode 100644 udav/xpm/mark_a.xpm create mode 100644 udav/xpm/mark_cf.xpm create mode 100644 udav/xpm/mark_d.xpm create mode 100644 udav/xpm/mark_df.xpm create mode 100644 udav/xpm/mark_l.xpm create mode 100644 udav/xpm/mark_lf.xpm create mode 100644 udav/xpm/mark_n.xpm create mode 100644 udav/xpm/mark_o.xpm create mode 100644 udav/xpm/mark_of.xpm create mode 100644 udav/xpm/mark_p.xpm create mode 100644 udav/xpm/mark_pf.xpm create mode 100644 udav/xpm/mark_r.xpm create mode 100644 udav/xpm/mark_rf.xpm create mode 100644 udav/xpm/mark_s.xpm create mode 100644 udav/xpm/mark_sf.xpm create mode 100644 udav/xpm/mark_t.xpm create mode 100644 udav/xpm/mark_tf.xpm create mode 100644 udav/xpm/mark_v.xpm create mode 100644 udav/xpm/mark_vf.xpm create mode 100644 udav/xpm/mark_x.xpm create mode 100644 udav/xpm/mark_y.xpm create mode 100644 udav/xpm/media-seek-backward.png create mode 100644 udav/xpm/media-seek-forward.png create mode 100644 udav/xpm/none.xpm create mode 100644 udav/xpm/object-rotate-right.png create mode 100644 udav/xpm/oper.xpm create mode 100644 udav/xpm/oper_a.xpm create mode 100644 udav/xpm/oper_d.xpm create mode 100644 udav/xpm/oper_m.xpm create mode 100644 udav/xpm/oper_s.xpm create mode 100644 udav/xpm/option.xpm create mode 100644 udav/xpm/plot.xpm create mode 100644 udav/xpm/preferences-system.png create mode 100644 udav/xpm/preview.xpm create mode 100644 udav/xpm/process-stop.png create mode 100644 udav/xpm/size.xpm create mode 100644 udav/xpm/smth.xpm create mode 100644 udav/xpm/squize.xpm create mode 100644 udav/xpm/style.xpm create mode 100644 udav/xpm/sum.xpm create mode 100644 udav/xpm/swap.xpm create mode 100644 udav/xpm/system-file-manager.png create mode 100644 udav/xpm/table.xpm create mode 100644 udav/xpm/text-x-generic.png create mode 100644 udav/xpm/tran.xpm create mode 100644 udav/xpm/udav.png create mode 100644 udav/xpm/update.xpm create mode 100644 udav/xpm/view-refresh.png create mode 100644 udav/xpm/weather-clear.png create mode 100644 udav/xpm/window.xpm create mode 100644 udav/xpm/wire.xpm create mode 100644 udav/xpm/x-office-presentation.png create mode 100644 udav/xpm/x-office-spreadsheet.png create mode 100644 udav/xpm/zoom-fit-best.png create mode 100644 udav/xpm/zoom-in.png create mode 100644 udav/xpm/zoom-original.png create mode 100644 udav/xpm/zoom-out.png delete mode 100644 utils/mgl2cpp.cpp delete mode 100644 utils/mgl2gif.cpp create mode 100644 utils/mglconv.cpp rename widgets/{mgl_fltk.cpp => fltk.cpp} (58%) rename widgets/{mgl_glut.cpp => glut.cpp} (72%) delete mode 100644 widgets/mgl_wx.cpp rename widgets/{mgl_qt.cpp => qt.cpp} (76%) create mode 100644 widgets/window.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 2eef65b..cbb496e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,15 +144,17 @@ if(NOT GIF_FOUND) endif(use_gif) endif(NOT GIF_FOUND) -find_library(HDF4_LIB df mfhdf) +find_library(HDF4_LIB df) +find_library(HDF4MF_LIB mfhdf) find_path(HDF4_INCLUDE_DIR hdf/mfhdf.h) -if(NOT HDF4_LIB OR NOT HDF4_INCLUDE_DIR) +if(NOT HDF4_LIB OR NOT HDF4MF_LIB OR NOT HDF4_INCLUDE_DIR) if(use_hdf4) message(SEND_ERROR "${HDF4_LIB}") + message(SEND_ERROR "${HDF4MF_LIB}") message(SEND_ERROR "${HDF4_INCLUDE_DIR}") message(SEND_ERROR "Couldn't find HDF4 libraries.") endif(use_hdf4) -endif(NOT HDF4_LIB OR NOT HDF4_INCLUDE_DIR) +endif(NOT HDF4_LIB OR NOT HDF4MF_LIB OR NOT HDF4_INCLUDE_DIR) find_library(HDF5_LIB hdf5) find_path(HDF5_INCLUDE_DIR hdf5.h) @@ -192,40 +194,40 @@ if(NOT QT4_FOUND) endif(use_qt) endif(NOT QT4_FOUND) -include(FindPythonInterp) -if(NOT PYTHONINTERP_FOUND) - if(use_python) - message(SEND_ERROR "Couldn't find python interpreter.") + +FIND_PACKAGE(SWIG) +if(NOT SWIG_FOUND) + if(use_python OR use_octave) + message(SEND_ERROR "Couldn't find swig needed for interfaces compiling.") endif(use_python) -endif(NOT PYTHONINTERP_FOUND) -include(FindPythonLibs) +endif(NOT SWIG_FOUND) + +# include(FindPythonInterp) +# if(NOT PYTHONLIBS_FOUND) +# if(use_python) +# message(SEND_ERROR "Couldn't find python interpreter.") +# endif(use_python) +# endif(NOT PYTHONINTERP_FOUND) +FIND_PACKAGE(PythonLibs) +#include(FindPythonLibs) if(NOT PYTHONLIBS_FOUND) if(use_python) message(SEND_ERROR "Couldn't find python development libraries.") endif(use_python) endif(NOT PYTHONLIBS_FOUND) -include(FindSWIG) -if(NOT SWIG_FOUND) - if(use_python) - message(SEND_ERROR "Couldn't find swig needed for interfaces compiling.") - endif(use_python) -endif(NOT SWIG_FOUND) - find_path(OCTAVE_INCLUDE_DIR octave/oct.h) if(NOT OCTAVE_INCLUDE_DIR) if(use_octave) message(SEND_ERROR "Couldn't find octave/oct.h needed for octave interfaces compiling.") endif(use_octave) endif(NOT OCTAVE_INCLUDE_DIR) - find_program(oct_prog octave) if(NOT oct_prog) if(use_octave) message(SEND_ERROR "Couldn't find octave needed for octave interfaces compiling.") endif(use_octave) endif(NOT oct_prog) - find_program(oct_mk mkoctfile) if(NOT oct_mk) if(use_octave) @@ -275,10 +277,11 @@ install(DIRECTORY fonts/ DESTINATION ${MGL_FONT_PATH} PATTERN "*.vfm") endif(NOT WIN32) -add_subdirectory( mgl ) +add_subdirectory( src ) add_subdirectory( widgets ) add_subdirectory( utils ) add_subdirectory( examples ) add_subdirectory( include ) -add_subdirectory( lang ) +add_subdirectory( udav ) add_subdirectory( texinfo ) +add_subdirectory( lang ) diff --git a/COPYRIGHT b/COPYRIGHT deleted file mode 100644 index 412ecad..0000000 --- a/COPYRIGHT +++ /dev/null @@ -1,44 +0,0 @@ -Generally MathGL is GPL library. - -/*************************************************************************** - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -However, you can use LGPL license for MathGL core if you don't use wrapper -classes (don't use file mgl_w.h and SWIG-based interfaces) and disable -GSL features (by defining NO_GSL or use configure option --disable-gsl). - -/*************************************************************************** - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - diff --git a/ChangeLog.txt b/ChangeLog.txt index 4777a33..ec54935 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,638 +1 @@ -1.11.2 Released 30 May 2011 - - Add Quaternary coordinates - - Bugfixes - -1.11.1 Released 25 March 2011 - - Improve IDTF export - - Minor changes and bugfixes - -1.11.0.1 Released 15 November 2010 - - Bugfix for reading textual data files (mostly under win32). - - Docs update. - -1.11 Released 8 November 2010 - - Add new plot Grad() -- gradient of scalar field by flow threads. - - Add new plot QuadPlot() -- plot of irregular quadrangle mesh (like TriPlot()). - - Add new plot TriCont[V]() -- contour lines for irregular triangle mesh. - - Add gradient filling in Area() and Region() plots if number of specified colors (colors in palette) is equal to 2*number of curves. - - Allow 2 colors diagrams (in Bars(), Barh()) -- one for positive, one for negative. - - Add style 'f' for Bars(), Barh() which draw diagrams like water-fall ones. - - Move argument 'above' of Bars(), Barh() to string (if it contain 'a' symbol). - - Add marks '<', '>', '#<', '#>', '#*', '#x', '#+', '#.' for left/right wire/solid triangles, Y sign, squared + and x signs. - - Add mini-dash for '=' line style symbol. - - Colorbar position can be specified in sch string: '>' - right, '<' - left, '^' - above, '_' - under. If string have 'A' then absolute coordinates is used. - - Add "styled" version of SubPlot() for better fitting of subplot according axis/colorbar/title layouts. - - Legend coordinates set absolute position if font argument contain 'A' symbol. - - Add optional gap for ColumnPlot. - - Axis now can have "arrows" at the end by setting arrow style ("AKDTVISO") for Axis(). - - Add extra text align for axis label if it is located near minimal or maximal axis value. - - Allow defining manual array in MGL command argument as [v1,v2,v3,...]. Array can be multidimensional like [[v1,v2],[v3,v4]]. - - Add functions to MGL by 'func' command. - - Add functions mglData::Hankel(), mglData::SinFFT(), mglData::CosFFT(), mglData::FillSample(). - - Add 's','c','h' symbols for Sine/Cosine/Hankel transforms in functions mglTransform(), mglTransformA(). - - Add mglData::Roll() for "rolling" data along direction. Improve Swap() function. - - Add MGL commands: "insert dat 'dir' [at=0 num=1]", "delete dat 'dir' [at=0 num=1]", "roll Dat 'dir' num". - - Now Plot() and Tens() now "accurately" cut off line segments. - - Add 'int(x)' function to the expression parser (class mglFormula). - - Add \textsc{} for small-caps to TeX parsing. - - Now $N is substituted into the second argument of MGL commands 'define', 'defnum', 'defpal', 'defchr'. - - Add definitions $a...$z used by the same order as arguments $0...$9. - - Add new function SetLegendMarks() to allow multiple marks in Legend() sample. - - Add functions GetWarnCode(), mgl_get_warn_code() for getting code of the last warning. - - Add possibility to read HDF4 files in mglData. - - Now parameter 'cnt' of Flow() and Pipe() is always defined by value of 'num' -- cnt = (num>0)! - - Add C/Fortran interface functions for widget features. - - Allow to read compressed data files (like, *.dat.gz). - - Allow to save compressed files with extensions "eps.gz" and "svgz" as output. - - Font files can be compressed now by 'gzip'. - - Reduce animation delay to 1 sec. - - Add TeX symbol sample in documentation. - - Now MathGL use standard random numbers generator: GSL one or simple rand() if NO_GSL is defined. - - Now curves always start dashing from zero position. - - Restrict usage of original and wrapper classes simultaneously. - - Rename MGL command 'grid' to 'grid2' for case of plain grid drawing for data array(s). - - Rename MGL command 'set_id' to 'idset'. - - Disable color gradient in Vect() by default -- still enabled in VectC(), VectL(). - - Add extra options/comments for animation parameters in mgl2png. - - Update printing in QMathGL. - - mglGraphFLTK::Update() now force window redrawing. - - Bugfix with newline symbol '\n' - - Bugfix with wrong restore previous InPlot() after text with style 'a'. - - Bugfix for label position for log-scale axis. - - Bugfix for mglData::Insert(). - - Bugfix for text and marks drawing in OpenGL mode. - - Bugfix for T-ticks orientation in Ternary plot. - - Bugfix for text position with 'a' option after Rotate(). - - Bugfix for keeping bold/italic text formatting of next symbol. - - Bugfix for Ternary axis with Min.y!=0. - - Bugfix for multi-line labels. - - -1.10.2.1 Released 28 March 2010 - - Add multi-line (i.e. separated by \n) text printing. - - Ticks adjusting now correctly work with log-scaled axis. - - Bug with MGL options including bug with 'legend' option for automatic colors. - - Bug with 'A' option of text style. - -1.10.2 Released 22 March 2010 - - Add MGL command 'loadfont' for in-script font changing. - - Add labelw_ext() and rename Label() to Labelw() for wchar_t argument. - - Python interface now can use 3D NumPy arrays as initialization of mglData() constructor. - - Add C/Fortran/SWIG interface for a number of mglData functions: Find(), Last(), FindAny(), Maximal(), Minimal(), Momentum(). - - Add extra argument for Face() which define variable color for the face (C++ only). - - Bug with font path reconstraction in win32. - - Bug with options parsing for MGL command. - - Bug in mglData::Sum(), Max(), Min() for operation along several direction. - -1.10.1 Released 5 March 2010 - - Add "in-place" commands for arguments in a MGL script (like, "plot {sum dat 'x'}"). - - Add StickPlot() for putting plot in to a cell of sticks - - Add parsing of MGL option arguments. - - Allow marks drawing in Tens() plot. - - If text style contain 'a'/'A' then text in absolute subplot/picture coordinates is drawn. - - Add functions mglGraph::Hist() for converting value from points to grids. - - Add extra argument for 'box' command. - - Add ticks (lines) for Colorbar. - - Add GridPnts for changing number of points in grid lines (for curved coordinates) - - Colorbar factor now placed at top of a plot. - - Dots() now don't change transparence for self. - - Bug with missing ticks tunning in Colorbar is corrected. - - Bug of double glyph drawing in mglGraphPS is corrected. - -1.10 Released 25 December 2009 - - Change license from GPL to LGPL for MathGL core. SWIG-based interfaces still have GPL. - - Add new plot BoxPlot() for plotting data statistic (max, min, median, quartiles). - - Add formula for coloring like formulas for curvilinear coordinates. - - Add C++ wrapper classes for C functions. These classes (mglDataW, mglGraph, mglParse) can be used even in MSVS naturally. - - Add wxMathGL widget for wxWidgets library. - - Sufficiently improve documentation. - - Add speed up compilation (i.e. allow 'make -j3'). - - Add ObjId for determining the object (or line) of picture point. - - Add ticks drawing for inverted axis (i.e. when Min>Max, not for log-scaled!). - - Add drawing of log-scaled axis for case Min1. - - Bug with overriding default palette by manual color specification. - - Bug in SWIG interface with selecting between float/double. - - Memory leaks correction. - - Incompatible changes: - * rename Axis() function to SetFunc() and SetCoor() functions (Python-like) - * rename CloudQ() to Cloud(), and mgl_cloudq*() to mgl_cloud*() - * rename Flow(mglPoint p0,...) to FlowP(mglPoint p0,...) - - -1.9.0.1 Released 8 July 2009 - - Correct minor bug in win32 version (in mglData::Read()). - -1.9 Released 1 July 2009 - - Improve export in EPS and SVG: lines are exported as single object, improve line dashing, text is exported by glyphs now. - - Write new MGL parser which can handle arbitrary expression as argument for data and/or number. - - Function mglGraph*::Window() now can handle NULL-pointer as function (draw built-in bitmap only). The window can be created from Fortran programs too. - - Add new plot Traj() for drawing vectors along the curve. - - Add new plot ContD() for drawing solid contours with manual colors (useful for phase diagrams). - - Add new plot Radar() for drawing radar chart. - - Add new plot Flow(mglPoint p, ...) for drawing the flow thread from a point. - - Functions mglGraph::Vect() now have additional argument for kind of vector plot. Correspondingly mgl_vect_*() functions now have additional argument too! - - Add function mglGraph::Axis() for predefined curvilinear coordinates. - - Add function mglData::SubData() for indirect access to the data elements. - - Add function mglData::Trace() for getting diagonal elements. - - Add function for manual setting of ticks/subticks line style. - - Now you can set colors for multiple curves (palette) directly in function style, i.e. like gr->Plot(y,"rgb;"). - - Improve ticks drawing if RotatedText = false; - - NOTE! Hide TickLen variable and change it to SetTickLen() function. Also add additional argument to mgl_set_tick_len() function. - - You can now select base type for floating point numbers (double or float). - - Legend now is drawn flat (without any rotation). - - Function mglData::Sew() now handle NAN values correctly. - - Add MGL command types for further UDAV developping. - - Line width now don't influence on text printing. - - Bug correction in marker drawing for EPS, SVG. - - Bug with not always defined mglGraph::id. - - Bug correction in configure (older compiler support, wrong glut.h demand). - - Bug in lang/CMakeLists.txt (for making Python interface). - - Better support for isnan() function on different compilers. - -1.8.1 Released 4 March 2009 - - Add GIF animation features via functions StartGIF/NewFrame/EndFrame/CloseGIF. - - Add new plot Tens() for tension plot (curve with variable color). - - Add ColumnPlot function for making column of plots. - - Add AdjustTicks function for automatic ticks adjusting for current axis ranges. - - Add image export to GIF files. - - Add NumPy import for Python interface. - - Improve documentation (add descriptions of new functions; add sections about animation and about utilities). - - Add new functions SetRanges(), SetAutoRanges() for setting axis ranges (Python style) and for setting ranges of automatic variables. - - Add TickLen parameter for setting length of ticks/subticks - - Colorbar now can have arbitrary size and position - - Add mgl_set_[xyzc]ttw() functions into C/Fortran interface. - - Add error message if string is not closed in MGL script. - - Add data export functions from std::vector - - Add new tool mgl2gif for exporting to GIF files (including animated GIF) - - Add option -Lval for setting locale to val. Option is added to mgl2png, mgl2eps, mgl2cpp, mglview. For example, use "mglview fname -Lru_RU.utf8" for file in UTF-8 encoding. - - Extend TriPlot() by adding manual coloring array (like SurfC()). - - Extend Dots() by adding transparency for dots. - - Improve STFA() by adding smoothed mask at the edges. - - Improve tick labels drawing if RotatedText = false. - - Add mglGraphAB::LastMousePos - - Add argument to show window maximazed - - Bug correction in configure script with unsual GSL setup. - - Bug correction in configure script with extra Qt options. - - Bug correction in subticks if ticks origin is specified. - - Bug correction with MGL command 'call'. - - Bug with subticks (having the same size as normal ticks). - - Improve labels for curved coordinates. - -1.8 Released 26 November 2008 - - Create Python and Octave interfaces using SWIG. Generally interfaces for a set of languages (Java, Lisp, Perl, PHP, Tcl, R, Ruby, Modula3, C# and other SWIG supported) can be simply created by the same way. - - MathGL documentation is completely rewritten for v.1.8. Now it is based on TeXinfo files and allows one to compile it in HTML, PDF and other formats. Also the structure of sections is sufficiently updated. New sections for Python, MGL and Samples are written. - - Cmake build system is written. It should work even for Windows progrmas (like VisualStudio and so on). At this moment cmake-based build system is used as secondary one. - - Add Qt interface: - * New class QMathGL is added. This is the Qt widget for drawing MathGL graphics. - * New class mglGraphQt is added for creating Qt window with MathGL plotting. - - Add functions to make FLTK, QT & GLUT windows from Fortran programs. - - Add new plot Barh() for horizontal bars. - - Add new plot Region() for filling the area between 2 curves. - - Add new plot Vect() for vector field by arrows which color and length depend on amplitude. At this old function Vect() (for vector field by hachures) was renamed to VectL(). - - Add Plot(), Surf() functions for plotting a curve or a surface defined by formula(s). - - Add class mglDraw for simplification of setting drawing function for window creation - - Add new functions for data handling: - * Envelop() -- for finding data envelop. - * Sew() -- for sewing data (removing phase jumps). - * Evaluate() -- for producing array interpolated by coordinates from other array(s). - * Put() -- for setting a values (as number or from array) for range of data. - * Fill() -- for filling by formula with coordinates x,y,z in specified range - * Diff() -- for finding derivative of parametrically specified data. - * mglPDE() -- for solving PDE in more or less general case. - * mglRay() -- for ray tracing (for finding trajectory in 3D space). - * mglQO2d() -- for beam tracing in 2D case (PDE solving in accompanied coordinates). - * mglJacobian() -- for evaluating Jacobian of coordinates transformation. - - Add new function ShowImage() for displaying the current picture. - - Color scheme will be without interpolation (color smoothing) if its style contain '|' symbol. - - Color inside string can be changed by TeX-like commands \color? or #? where ? is color id. - - Function Bars() now draw boounding box of the rectangle if its style contain '#' symbol. - - Function Chart() will not draw a peace if its color specification is ' '. - - Add argument for line length in Legend() - - Legend entry with empty style (i.e. "" but not NULL) is printed without indent. - - Default mglGraph::Org value now is mglPoint(NAN,NAN,NAN), i.e. MathGL library try to select optimal axis origin position by default. - - Add some utility functions: - * Title() for printing the title of the plot - * SetPalette() for simplifing palette setting - * SetTicks() for setting the ticks easely. - * SetTicksVal() for manual setting the position and the label of ticks - * Ellipse() for drawing ellipsoid - * Restore() for restoring transformation matrix after last InPlot() - - Information about mouse click position is shown in widgets (if ShowMousePos=true) - - Clean up C/Fortran interface: replace 'bool' to 'int' in C interface; add a lot of new interface functions; change the order of arguments in mgl_data_set_value(). - - Add MGL commands 'fplot', 'fsurf', 'fgets', 'export', 'import', 'write', 'region', 'title', 'sew', 'envelop', 'evaluate', 'put', 'palette', 'combine', 'pde', 'ray', 'qo2d', 'jacobian'. - - Extend MGL commands 'info', 'fill', 'copy', 'diff'. - - Add const modifiers everywhere. - - Add default window functions in mglGraphAB (as base class). - - Class mglFormula and functions for data extraction (like SubData, Hist and so on) now are thread safe. - - Allow mglData::Resize() to have size=1. - - Function mglSTFA() now normalize array on dn (for amplitude independency on value of dn). - - Function mglData::Crop() now use relative second argument if it is <=0. - - Functions [XYZC]Range() now have 3d argument for increase the range by value (Max-Min)*fact. - - Functions mgl_tile_r*() are renamed to mgl_tiles*(). - - Variable mglGraph::TickStr is removed. Use mglGraph::SetTicksVal() instead. - - Function mglGraph::WriteTIFF() is removed. - - Bug with wrong normales at points on bounding box in Surf3*() is corrected. - - Bug with non-visible marks into the legend is corrected. - - Bug of not-drawn quads with the same vertexes is corrected. - - Bug with colors in WriteBMP() is corrected. - - Some other minor bugs are corrected. - -1.7 Released 1 June 2008 - - MGL parser is sufficiently rewritten: - * User now can define its own MGL command (by changing mglParse::Cmd). - * Export MGL script to C++ file for the most of commands (except 'list', 'delete', 'call', 'for|next') is possible. - * New tool 'mgl2cpp' is added for exporting MGL script to C++ file. - * Uniform interface for tools: mgl2png, mgl2eps, mgl2svg, mglview. - * New command: 'define $N sth'. - * New conditional commands: 'if|else|elseif|endif'. - * New for-cycle commands: 'for|next'. Format is: 'for $N var' or 'for $N x1 x2 [dx]'. - * Command [xyz]tick now has additional argument for the start position of ticks. - * A set of MGL commands is extended by adding the new ones: 'mirror', 'face[xyz]', 'perspective', 'fit', 'fits', 'normsl', 'momentum', 'putsfit', 'rearrange', 'arrowsize', '[xyz]label', 'ctick'. - * Unicode support in scripts. - * Commands 'cont3' and 'contf3' now have variants for manual setting of contour level values. - - New class mglGraphIDTF is added for exporting graphics in IDTF format (which can be converted later to U3D pictures for inserting in PDF) - - New function mglGraph::Fit[23S]() is added for nonlinear fitting of data arrays. - - New function mglGraph::PutsFit() is added for printing the fitted formula. - - Color specification in color scheme (not in line style!) now supports "brighted" colors like "b1b2b3...b9". At this, color "b5" is equal to "b". Also, function mglColor::Set now has additional argument for "brightness" of the color. - - Color scheme now may contain up to 32 colors. - - New variable mglGraph::OrgT is added for manual setting of tick position (if OrgT.[xyz]!=NAN). - - Improved algorithm for automatic axis positioning (if Org.[xyz]==NAN). - - Function SubPlot() and MGL command 'subplot' now have arguments for additional relative plot shifting. - - Class mglGraphGL is derived now from mglGraphAB. It slightly decreases its speed but allows to produce more similar plots. - - New function mglData::Mirror() is added for mirroring data in some direction(s). - - New function mglData::Rearrange() is added for rearrange data dimensions. - - Tool 'mglview' now does not display info/error message about availible command-line arguments. - - Centered labels now are drawn at sqrt(Min*Max) if dx (or dy, dz) is zero. - - New functions FaceX(), FaceY(), FaceZ() are added as simplified interface to the Face() function. - - New function mglData::NormSl() for data normalization slice by slice is added. - - New function mglData::Momentum() for getting an array of data momentums along some direction is created. - - New functions mglData::Insert*(), mglData::Delete*() are added for inserting/deleting slices in data arrays. - - Font loading is speeded up and new function mglFont::Restore() is added. - - Default font size is decreased. - - New function mglFormula::CalcD() is added for evaluating the formula derivative over some variable. - - Bounding box now is drawn along isolines in curvilinear coordinates - - Bug/feature with legend option with included "'" is corrected. - - Bug for partly ommitted points with NAN values returned by transformation formulas are corrected. - - Bug with momentum evaluation along x-direction is corrected. - - Bug with mglData::Squeeze() is corrected. - - Added C/Fortran functions: mgl_restore_font(), mgl_subplot_d(), mgl_set_tick_origin(), mgl_data_norm_slice(), mgl_set_plotfactor(), mgl_data_mirror(), mgl_create_graph_idtf(), mgl_data_rearrange(), mgl_fit_*(), mgl_face*(), mgl_curve(), mgl_create_parser(), mgl_delete_parser(), mgl_add_param(), mgl_add_paramw(), mgl_add_var(), mgl_find_var(), mgl_parse(), mgl_parsew(), mgl_restore_once(), mgl_parser_allow_setsize(). - - Updated Pascal interface. - -1.6.2 Released 5 April 2008 - - Add recognition of TeX commands: \frac, \stack, \stackr, \stackl, \overset, \underset. - - Redefine strdup, wcsdup for compatibility with MS Visual Studio. - - MGL command 'ball' now have variant ball x y ['color'] - - MGL command 'curve' now have 2D variant - - Add MGL command 'readmat' for reading data file with sizes specified at beginning - - MGL commands 'readmat', 'readall', 'hist', 'max', 'min', 'sum', 'resize' now create the output array automatically. - - Add C/Fortran functions mgl_tile_r*(), mgl_stfa*(). - - Bug (in v.1.6.1) with log-axis ticks is corrected. - - Bug (in v.1.6.1) with user-defined colors is corrected. - - Bug with mglData::Hist is corrected. - -1.6.1 Released 2 April 2008 - - Support of named columns - * Column names recognition in mglData::Read(). The string with ## supposed to contain the column name (id) -- character from 'a' to 'z'. - * New functions mglData::Column(), mglData::SetColumnId() for named columns handling. - * Column function (like "plot a('t') a('p*b')") in MGL scripts. - - New plot STFA() is added for spectrogram - - New plot TextMark() is added for drawing textual (including LaTeX) symbols at point position. - - Extend plot Tile for drawing tiles with variable sizes - - Extend plot Bars() for drawing bars side-by-side or one-above-one. - - New function mglData::ReadMat() is added for reading data from text file with sizes specified at beginning. - - New function mglFont::Copy() for copying font data from other instance. - - New functions (mgl_copy_font, mgl_textmark_*, mgl_textmarkw_*, mgl_data_column, mgl_data_set_id) for C/Fortran interface are added. - - Improve color Ids so that user may change it (for example, add new color). - - Improve TeX symbol parsing. - - Improve log-axis ticks. - - Improve text in Legend(). - - Improve Window() functions (for FLTK and GLUT) so that argc, argv can be NULL now. - - Add "smoothing" for edges of cutted surfaces. - - Symbol '#' in line style now switch on the filling of markers. - - Add 'marksize' option in MGL scripts for changing MarkSize for single plot only. - - Add 'legend' option in MGL scripts for adding plot annotation. - - New MGL command 'textmark' is added. - - Command 'legend' now have variant for arbitrary position of legend. - - Bug with ctt is corrected. - -1.6 Released 13 March 2008 - - The font parsing and printing codes are completely rewritten - * Unicode supprot is added for all functions which print/draw the text. - * The class mglFont is completely rewritten for handling new format of solid/wire fonts with UTF glyphs. - * The set of recognized TeX symbols and commands is extended. - * It is possible now to use different font typefaces in MathGL. - * Tools for making solid/wire font files from *.otf, *.ttf and so on files are added. - * Function mglFont::Load always sets locale LC_NUMERIC to "C". - * Internal font has limited set of characters and no italic/bold symbols. This font is used as default under MS Windows. - - The structure of library is reorganized - * Header files now are placed in mgl/ subdirectory. - * Classes mglGraphFLTK and mglGraphGLUT are extracted as separate dynamic libraries. You should use linker keys -lmgl-fltk or -lmgl-glut for linking them. - * The linker key -lmgl is self-consistent and does not need any additional libraryes for linking. - * Modules for writing to JPEG or TIFF files are extracted as separate dynamic libraries. - * Classes mglGraph and mglGraphAB are pure classes now. - - New class mglGraphFLTK for making window with bitmap graphics (including frames and animation) is added. Each class instance may have only one window. However, several instances (windows) can be in application. You should call mglFlRun() at the end for starting FLTK message handling cycle. - - New class Fl_MathGL is added. This class is FLTK widget for drawing plots by help of MathGL. - - New tool 'mglview' showing MGL script in FLTK window is added. - - New function Perspective() switching on/off the perspective in the plot is added . - - New function Cone() for the truncated cone drawing is added. - - New functions mglData::ReadAll(), mglData::ReadRange() for data reading from a set of files into one mglData object are done. - - New function STFA() for Short Time Fourier Analysis is added. - - New variables PlotFactor and AutoPlotFactor for picture overall sizing (some analogue of Zoom() function) are added. - - New variable mglGraph::WarnCode contains numerical ID of warnings (in some sence it duplicates mglGraph::Message). - - TuneTicks flag now influences on Colorbar ticks also. - - New variable FactorPos displaying the factor position of axis ticks (0 at Min, 1 at Max, 1.15 is default) is added. - - New variable mglGraph::AutoOrg for shifting Org automatically if it lies outside Min ... Max range is added. - - Origin of axis is automatically shifted for better view if Org.[xyz] = NAN. - - New variable mglGraphGLUT::AutoClf for switching on/off automatic Clf() (picture clearing) between drawing (in GLUT and FLTK windows) is added. - - CloudQ plot now uses interpolated color scheme even if it lies inside the face. - - New functions for data loading from gsl_vector * and gsl_matrix * are added. - - New functions SetFontSizePT(), SetFontSizeCM() and SetFontSizeIN() for setting FontSize in pt, cm and inches are added. - - New variable CirclePnts for setting the number of points in circle drawing (like Tube(), Sphere(), Drop(), Cone()) is added. - - New MGL commands 'cone', 'readhdf', 'savehdf', 'stfa', 'plotfactor' - - New functions mgl_set_draw_face(), mgl_create_graph_fltk(), mgl_fltk_run(), mgl_tune_ticks(), mgl_data_set_value(), mgl_data_get_value(), mgl_set_zoom(). - - Uniform interface for writting in bitmap files (PNG, BMP, JPEG, TIFF) is created. - - Rare bug with alpha channel overflow in mglGraphZB is corrected. - - Bug with Transform() is corrected for multidimensional arrays. - -1.5 Released 8 January 2008 - - User may now set the format for tick labels by templates mglGraph::xtt, mglGraph::ytt, mglGraph::ztt or by user-supplied function mglGraph::TickStr. If one of these variables are not NULL then for that axis flag mglGraph::TuneTicks=false. - - New function Pipe() is added for the drawing of flow pipes for vector fields. - - New functions Sphere() and Drop() are added. - - New function Dew() is added for the drawing of vector fields by drops (like dew-drops under wind). - - Operators for class mglPoint (longitudinal and transverse component, perpendicular vector, vector product) are added. - - New MGL commands (sphere, drop, dew) are added. - - MGL commands [xyz]ticks now may have string as an argument for the setting of template of tick labels. - - MGL command norm has now additional argument for applying changes for slices >= its value. - - MGL command fill has now additional argument for direction of filling. - - Functions NewFrame(), EndFrame() are now defined for class mglGraphGL also. - - Class mglGraphGL (OpenGL mode) has now fog, arrows and curved text features. - - Class mglGraphPS (EPS and SVG files) has now fog feature. - - Bug with Surf3() for extremly irregular data is corrected. - - Bug with undefined Fog variables is corrected. - -1.4.3.1 Released 24 December 2008 - - Bug with mglGraphGLUT (under MS Windows) - - Bug with Fortran subroutines: mgl_label_ext() and mgl_text(). - - Update verson number (inside help string) for mgl2png, mgl2eps, mgl2svg. - - Rename back mglGraph::MessageBuf to mglGraph::Message (for - compatibility with UDAV v.0.2). - - Add file with examples for mglGraphGLUT. - -1.4.3 Released 18 December 2008 - - Fortran interface for most of functions is added. - - New function mglGraph::Ternary() for switching on/off - the drawing of Ternary plot is added. - - New function mglGraph::Fog() for the fog imitation on picture is added. - - New commands "ternary" and "fog" are added to MGL scripts. - - Correct line dashing in EPS and SVG files. - - Capital letters ("XYZ") in Axis() function argument change shift - to -shift for ticks and labels. - - New function mglGraph::CutOff() is added for cutting off arbitrary - region of 3D space, specified by a formula. - - New function mglGraph::WriteBMP() is added. - - Symbol ':' (if present) now terminates the color scheme specification - for all cases. - - The lightning in zoom mode is improved. - - Formulas now give NAN value for points lied out of range of - function definition. - - Orts in mglGraph::Beam() are swapped. - - Some changes for compatability with MacOS and MS Visual Studio are done. - - Variable FILE *mglGraph::Message is changed to char *mglGraph::MessageBuf. - - -1.4.2 Released 21 November 2007 - - The order of arguments in [xyz]range options now set the invert or - not the auto-filled coordinate of plots. - - Speed up drawing (especially with DrawFace=false). - - Command modify now has optional argument vdat and wdat for using in formulas. - - New functions mglData::Modify() are added for using of several data - arrays in formulas (variable names are 'v' and 'w'). - - The library is compatible now with MS Visial Studio. - - New functions mglData::Find() are added for the search of values - satisfying the condition. - - Change mglData::Resize() to keep values at boundaries. - - New command map is added for MGL scripts. - - New command once is added for MGL scripts. The code between once on - and once off is executed only one time. - - Flag DrawFace=false now sets to draw wire surfaces in all cases except - isosurfaces (Axial(), Surf3*()) and Crust(). - - Puts and Label functions now have argument for additional shifting of - text (label). - - Error with marks drawing for dashed lines is corrected. - - Error with tuned ticks along y- and z-direction is corrected. - -1.4.1 Released 14 November 2007 - - If minimal and maximal values of a range are equal then they are - ignored in mglGraph::Axis() function. I.e. it is possible to use - Axis(mglPoint(x1,y1),mglPoint(x2,y2)); to set boundaries of - plain (on X-Y plane) plot. - - Ticks looks better now for small (like, from 0.001 to 0.002) or large - (like, from 1000 to 2000) coordinate values and for narrow range - (like, from 0.999 to 1.000). To disable this feature use - mglGraph::TuneTicks=false. - - Lines, text and marks now are smoothed (if MGL_SIMPLE_LINE is not defined) - - MathGL is now compatible with 64-bit operating systems. - - A numerical value (a number) can be extracted from variables in MGL - scripts with the help of suffix: - * for sizes -- .nx, .ny, .nz - * for maximum position -- .mx, .my, .mz - * for average -- .ax, .ay, .az, .aa - * for widths -- .wx, .wy, .wz, .wa - * for skewness -- .sx, .sy, .sz, .sa - * for kurtosis -- .kx, .ky, .kz, .ka - * for maximum and minimum -- .max, .min - * for sum of all element -- .sum - - The error concerned with the script drawing with [xyz]range options exceeding the - axis range is corrected. - - The look of legend and ticks is improved. - - Log-scaled ticks now is drawn correctly. - - New command info is added in MGL script. - - New variable mglGraph::Message is added for the handle of warnings output (set - to 0 to disable warnings). - - All MathGL drawing functions now tell (by using mglGraph::Message) the matter - why the plot is absent. - - Negative font size values are now equal to |size|*FontSize in all cases. - - The order of rows in GetBits() and GetRGBA() functions are inverted (for - simpler window drawing). - - A short built-in instruction for mgl2png, mgl2eps, mgl2svg programs is added. - -1.4 Released 30 October 2007 - - New function WriteSVG() is added for exporting graphics to SVG files - (actually work only in mglGraphPS class). New interpreter mgl2svg is added. - - All MGL script commands now may have options, which change some general - behavior for particular command (plot). The options are: crange, xrange, - yrange, zrange, alpha (or alphadef), meshnum, cut, fontsize, ambient. - Each option should be delimited from previous text by symbol ';'. - - Argument of script commands can now contain subarrays (like "plot a(:,1)") - - MGL scripts now can have external arguments (string $1, $2, ... $9 in - script). Argument values added by mglParse::AddParam() function. - - Font definition string now may contain color specification after symbol ':'. - - Optional symbol 't' in the string argument of mglGraph::Cont(), - mglGraph::Cont3(), mglGraph::ContA() plots set to draw contour values - near contour line. - - New functions mglGraph::ContFX(), mglGraph::ContFY(), mglGraph::ContFZ(), - mglGraph::ContF(), mglGraph::ContF3(), mglGraph::ContFA() are added for - for plotting solid contours. - - New function mglGraph::Crust() is added for plotting reconstructed - surface (crust) for points (it work but not so fine). - - New function mglGraph::Dots() is added for plotting dots in space. - - New function mglGraph::TriPlot() is added for drawing triangle surface or - mesh (if symbol '#' is specified). - - New function mglGraph::Mark() is added for drawing marks with variable sizes. - - New function mglGraph::Tube() is added for drawing tube with specified - radius along the curve. - - New function mglGraph::Text() is added for printing text along the curve. - - New function mglGraph::Beam() is added for making isosurfaces of beam - amplitude in curvilinear coordinates. - - New function mglGraph::Zoom() is added for zoom in/out a part of picture. - - New flag mglGraph::DrawFace is added for exclude face drawing - (faster plotting during rotation and so on). - - Number of cells in mglGraph::CloudQ() plot and number of hachures in - mglGraph::Vect(), mglGraph::VectC() plots depend now on value - of mglGraph::MeshNum. - - New commands chdir, stop and call are added to MGL scripts. - - MGL commands xrange, yrange, zrange, crange now may have 2 numbers as arguments. - - Points with nan values are not drawn (are ignored) now. - - PNG pictures is saved now with transparent background by default. - - Some errors are corrected. - - Section " is added to chapter " of documentation. - - Current changes concerning new functions are added in the library documentation. - -1.3 Released 8 October 2007 - - New script language MGL is introduced. - - New class mglParse is added for string-by-string parsing and executing - of MGL scripts. - - New function mglGraph::Exec() is added for executing of script commands. - - Logical operators are to textual formula parsing in class mglFormula. - - Function mglData::Transpose() now have textual argument which specify - new order of dimensions after transposing. - - New function mglData::Extend() is added for extending (increasing) the - dimensions of data array. - - A function for EPS export is excluded from mglGraphGLUT class. - - Parameter \textit{dir} of functions mglGraph::Belt() and mglGraph::Fall() - is excluded. Corresponding flag now is included in string argument - of these functions. - - Rotation direction in mglGraph::Torus() and mglGraph::Axial() now can be - specified in string argument. - - Function mglGraph::Bars() does not draw marks of points now. - - Black color is changed to dark gray in color palette for 1d plots. - - The algorithm of equations parsing is changed. - - Some errors are corrected. - - The chapter "Script language MGL" is added to the library documentation. - - Sections about the using of transparency and pure C interface are added - to chapter "Examples" of the library documentation. - - Current changes concerning new functions and so on are added to the - library documentation. - -1.2.2 Released 26 September 2007 - - Add functions mglData::Hist() for creating histogram (distribution) - of data values - - Add function mglGraph::Curve for drawing spline (like Bezier curve). - - Rewritten mglGraph::Line function. - - Add new variable mglGraph::BaseLineWidth for setting base width of lines. - Useful for large bitmap pictures. - - Add arrow styles "AKDTVISO_" in line parameters (see mglGraph::SelectPen, - now not supported in OpenGL mode). - - Add variables CutMin, CutMax for cutting off a point in some area. - Useful for isosurface plots. - - New function mglGraph::Tile is added for drawing surface of horisontal tiles. - - New function mglGraph::Error is added for drawing error boxes of data points. - - New function mglGraph::Chart is added for drawing charts. - - Size of marks now depend on relative size of plot (depend on SubPlot or InPlot calls). - - Add function for switching on/off light source separately. - -1.2.1 Released 14 September 2007 - - Autoconf/automake transition (thanks to D. Kulagin) - -1.2 Released 10 September 2007 - - New variant of library also use dynamic linking - - Autoconf script is written for Linux mode (thanks to D. Kulagin) - - Corrected Colorbar drawing. - - New function mglGraph::Belt is added for drawing 2D plot of belts. - - New functions XRange, YRange, ZRange are added for automatic determining - scales on x-, y-, z-directions on base of data values. - - New variable AxialDir is added for specifing direction of rotation in - Axial and Torus plots. - - Added logaritmic-like ticks drawing on axis if mglGraph::dx, mglGraph::dy - or mglGraph::dz is equal to zero. - - Flag LegendBox is added for switching on/off box drawing in legend. - - Character '_' in string argument of mglGraph::Axis(char *) function - disable tick numbers drawing. - - Add function mglGraph::Ambient for brightness of ambient light (surface color) - - New parameter added to Light function for brightness of light source - - Variable mglGraph::font is renamed to mglGraph::FontDef - - Rewritten mglData::Read function to be compatible with Windows Vista - - Add function for export/import data to bitmap picture (now only in PNG format) - - Rewritten method of automatic tick labels rotation on axis - - Add functions mglData::Momentum() for data momentum (average, width, - skewness and so on) evaluation - - Add functions to find position of data maximal or minimal value, including - its interpolated position - - An "Pure C interface" section is added in documentation. - - An "News" section is added in documentation. - - Some errors are corrected and minor optimization are done. - -1.1 Released 23 May 2007 - - New class mglGraphPS is written for image exporting to vector EPS file. - - New waterfall-like plot is added for 2D data (see mglGraph::Fall). - - New Surf3C plot is added for isosurface coloring by other data. - - New function for distribution (histogram) creation is added - (see mglData::Hist). - - New function for data cropping is added (see mglData::Crop). - - Variable mglGraph::MeshNum is added for setting desired number of - lines in Grid and Mesh plots. - - Surface lightning is smoothed in ZBuffer mode. - - Lightning formula is changed to agree with OpenGL mode. - - Flag '#' is added to surface plots. It draws grid (or mesh) on 2D plots - and switches off face drawing for isosurfaces (set wire drawing). - - Flag 'sum' is added to Area plot. - - Pure C/Fortran interface is written. - - Documentation is sufficiently rewritten and extended. - - Documentation on Russian is added. - - Some errors are corrected. - -1.0 Released 2 April 2007 - - Improved speed of expression parsing. - - The SurfA function for the plotting of surface with transparency - determined by other data is added. - - The Torus function for the plotting of surface which is result of - the curve rotation is added. - - Corrected contour plotting procedure. - - Extended library documentation. - - Slightly improved speed of ZBuffer drawing. - -0.9 Last beta version of the MathGL library. Released 2 March 2007 - - Rewritten low-level primitive drawing in ZBuffer mode. - - Improved surface look in ZBuffer mode. - - Improved speed of drawing and formulas evaluation. - - 2 additional types of transparency: like glasses and like - superposition of light sources (only in ZBuffer mode). - - Corrected Colorbar drawing in OpenGL mode. - -0.8.1 ZBuffer drawing was written. Released 19 Febriary 2007 - - Correct using of the color array under MESA (Linux). - - ZBuffer plotting functions are sufficiently rewritten. - - A text drawing in ZBuffer mode is added. - - A colorbar drawing in ZBuffer mode is added. - - All images for documentation are moved in images/ subdirectory. - - An example section is added in documentation. - - The colorbar description is added in documentation. - -0.8.0 First public release +2.0.b Released 23 August 2011 diff --git a/ChangeLog.txt~ b/ChangeLog.txt~ deleted file mode 100644 index d5c68c7..0000000 --- a/ChangeLog.txt~ +++ /dev/null @@ -1,634 +0,0 @@ -1.11.1 Released 25 March 2011 - - Improve IDTF export - - Minor changes and bugfixes - -1.11.0.1 Released 15 November 2010 - - Bugfix for reading textual data files (mostly under win32). - - Docs update. - -1.11 Released 8 November 2010 - - Add new plot Grad() -- gradient of scalar field by flow threads. - - Add new plot QuadPlot() -- plot of irregular quadrangle mesh (like TriPlot()). - - Add new plot TriCont[V]() -- contour lines for irregular triangle mesh. - - Add gradient filling in Area() and Region() plots if number of specified colors (colors in palette) is equal to 2*number of curves. - - Allow 2 colors diagrams (in Bars(), Barh()) -- one for positive, one for negative. - - Add style 'f' for Bars(), Barh() which draw diagrams like water-fall ones. - - Move argument 'above' of Bars(), Barh() to string (if it contain 'a' symbol). - - Add marks '<', '>', '#<', '#>', '#*', '#x', '#+', '#.' for left/right wire/solid triangles, Y sign, squared + and x signs. - - Add mini-dash for '=' line style symbol. - - Colorbar position can be specified in sch string: '>' - right, '<' - left, '^' - above, '_' - under. If string have 'A' then absolute coordinates is used. - - Add "styled" version of SubPlot() for better fitting of subplot according axis/colorbar/title layouts. - - Legend coordinates set absolute position if font argument contain 'A' symbol. - - Add optional gap for ColumnPlot. - - Axis now can have "arrows" at the end by setting arrow style ("AKDTVISO") for Axis(). - - Add extra text align for axis label if it is located near minimal or maximal axis value. - - Allow defining manual array in MGL command argument as [v1,v2,v3,...]. Array can be multidimensional like [[v1,v2],[v3,v4]]. - - Add functions to MGL by 'func' command. - - Add functions mglData::Hankel(), mglData::SinFFT(), mglData::CosFFT(), mglData::FillSample(). - - Add 's','c','h' symbols for Sine/Cosine/Hankel transforms in functions mglTransform(), mglTransformA(). - - Add mglData::Roll() for "rolling" data along direction. Improve Swap() function. - - Add MGL commands: "insert dat 'dir' [at=0 num=1]", "delete dat 'dir' [at=0 num=1]", "roll Dat 'dir' num". - - Now Plot() and Tens() now "accurately" cut off line segments. - - Add 'int(x)' function to the expression parser (class mglFormula). - - Add \textsc{} for small-caps to TeX parsing. - - Now $N is substituted into the second argument of MGL commands 'define', 'defnum', 'defpal', 'defchr'. - - Add definitions $a...$z used by the same order as arguments $0...$9. - - Add new function SetLegendMarks() to allow multiple marks in Legend() sample. - - Add functions GetWarnCode(), mgl_get_warn_code() for getting code of the last warning. - - Add possibility to read HDF4 files in mglData. - - Now parameter 'cnt' of Flow() and Pipe() is always defined by value of 'num' -- cnt = (num>0)! - - Add C/Fortran interface functions for widget features. - - Allow to read compressed data files (like, *.dat.gz). - - Allow to save compressed files with extensions "eps.gz" and "svgz" as output. - - Font files can be compressed now by 'gzip'. - - Reduce animation delay to 1 sec. - - Add TeX symbol sample in documentation. - - Now MathGL use standard random numbers generator: GSL one or simple rand() if NO_GSL is defined. - - Now curves always start dashing from zero position. - - Restrict usage of original and wrapper classes simultaneously. - - Rename MGL command 'grid' to 'grid2' for case of plain grid drawing for data array(s). - - Rename MGL command 'set_id' to 'idset'. - - Disable color gradient in Vect() by default -- still enabled in VectC(), VectL(). - - Add extra options/comments for animation parameters in mgl2png. - - Update printing in QMathGL. - - mglGraphFLTK::Update() now force window redrawing. - - Bugfix with newline symbol '\n' - - Bugfix with wrong restore previous InPlot() after text with style 'a'. - - Bugfix for label position for log-scale axis. - - Bugfix for mglData::Insert(). - - Bugfix for text and marks drawing in OpenGL mode. - - Bugfix for T-ticks orientation in Ternary plot. - - Bugfix for text position with 'a' option after Rotate(). - - Bugfix for keeping bold/italic text formatting of next symbol. - - Bugfix for Ternary axis with Min.y!=0. - - Bugfix for multi-line labels. - - -1.10.2.1 Released 28 March 2010 - - Add multi-line (i.e. separated by \n) text printing. - - Ticks adjusting now correctly work with log-scaled axis. - - Bug with MGL options including bug with 'legend' option for automatic colors. - - Bug with 'A' option of text style. - -1.10.2 Released 22 March 2010 - - Add MGL command 'loadfont' for in-script font changing. - - Add labelw_ext() and rename Label() to Labelw() for wchar_t argument. - - Python interface now can use 3D NumPy arrays as initialization of mglData() constructor. - - Add C/Fortran/SWIG interface for a number of mglData functions: Find(), Last(), FindAny(), Maximal(), Minimal(), Momentum(). - - Add extra argument for Face() which define variable color for the face (C++ only). - - Bug with font path reconstraction in win32. - - Bug with options parsing for MGL command. - - Bug in mglData::Sum(), Max(), Min() for operation along several direction. - -1.10.1 Released 5 March 2010 - - Add "in-place" commands for arguments in a MGL script (like, "plot {sum dat 'x'}"). - - Add StickPlot() for putting plot in to a cell of sticks - - Add parsing of MGL option arguments. - - Allow marks drawing in Tens() plot. - - If text style contain 'a'/'A' then text in absolute subplot/picture coordinates is drawn. - - Add functions mglGraph::Hist() for converting value from points to grids. - - Add extra argument for 'box' command. - - Add ticks (lines) for Colorbar. - - Add GridPnts for changing number of points in grid lines (for curved coordinates) - - Colorbar factor now placed at top of a plot. - - Dots() now don't change transparence for self. - - Bug with missing ticks tunning in Colorbar is corrected. - - Bug of double glyph drawing in mglGraphPS is corrected. - -1.10 Released 25 December 2009 - - Change license from GPL to LGPL for MathGL core. SWIG-based interfaces still have GPL. - - Add new plot BoxPlot() for plotting data statistic (max, min, median, quartiles). - - Add formula for coloring like formulas for curvilinear coordinates. - - Add C++ wrapper classes for C functions. These classes (mglDataW, mglGraph, mglParse) can be used even in MSVS naturally. - - Add wxMathGL widget for wxWidgets library. - - Sufficiently improve documentation. - - Add speed up compilation (i.e. allow 'make -j3'). - - Add ObjId for determining the object (or line) of picture point. - - Add ticks drawing for inverted axis (i.e. when Min>Max, not for log-scaled!). - - Add drawing of log-scaled axis for case Min1. - - Bug with overriding default palette by manual color specification. - - Bug in SWIG interface with selecting between float/double. - - Memory leaks correction. - - Incompatible changes: - * rename Axis() function to SetFunc() and SetCoor() functions (Python-like) - * rename CloudQ() to Cloud(), and mgl_cloudq*() to mgl_cloud*() - * rename Flow(mglPoint p0,...) to FlowP(mglPoint p0,...) - - -1.9.0.1 Released 8 July 2009 - - Correct minor bug in win32 version (in mglData::Read()). - -1.9 Released 1 July 2009 - - Improve export in EPS and SVG: lines are exported as single object, improve line dashing, text is exported by glyphs now. - - Write new MGL parser which can handle arbitrary expression as argument for data and/or number. - - Function mglGraph*::Window() now can handle NULL-pointer as function (draw built-in bitmap only). The window can be created from Fortran programs too. - - Add new plot Traj() for drawing vectors along the curve. - - Add new plot ContD() for drawing solid contours with manual colors (useful for phase diagrams). - - Add new plot Radar() for drawing radar chart. - - Add new plot Flow(mglPoint p, ...) for drawing the flow thread from a point. - - Functions mglGraph::Vect() now have additional argument for kind of vector plot. Correspondingly mgl_vect_*() functions now have additional argument too! - - Add function mglGraph::Axis() for predefined curvilinear coordinates. - - Add function mglData::SubData() for indirect access to the data elements. - - Add function mglData::Trace() for getting diagonal elements. - - Add function for manual setting of ticks/subticks line style. - - Now you can set colors for multiple curves (palette) directly in function style, i.e. like gr->Plot(y,"rgb;"). - - Improve ticks drawing if RotatedText = false; - - NOTE! Hide TickLen variable and change it to SetTickLen() function. Also add additional argument to mgl_set_tick_len() function. - - You can now select base type for floating point numbers (double or float). - - Legend now is drawn flat (without any rotation). - - Function mglData::Sew() now handle NAN values correctly. - - Add MGL command types for further UDAV developping. - - Line width now don't influence on text printing. - - Bug correction in marker drawing for EPS, SVG. - - Bug with not always defined mglGraph::id. - - Bug correction in configure (older compiler support, wrong glut.h demand). - - Bug in lang/CMakeLists.txt (for making Python interface). - - Better support for isnan() function on different compilers. - -1.8.1 Released 4 March 2009 - - Add GIF animation features via functions StartGIF/NewFrame/EndFrame/CloseGIF. - - Add new plot Tens() for tension plot (curve with variable color). - - Add ColumnPlot function for making column of plots. - - Add AdjustTicks function for automatic ticks adjusting for current axis ranges. - - Add image export to GIF files. - - Add NumPy import for Python interface. - - Improve documentation (add descriptions of new functions; add sections about animation and about utilities). - - Add new functions SetRanges(), SetAutoRanges() for setting axis ranges (Python style) and for setting ranges of automatic variables. - - Add TickLen parameter for setting length of ticks/subticks - - Colorbar now can have arbitrary size and position - - Add mgl_set_[xyzc]ttw() functions into C/Fortran interface. - - Add error message if string is not closed in MGL script. - - Add data export functions from std::vector - - Add new tool mgl2gif for exporting to GIF files (including animated GIF) - - Add option -Lval for setting locale to val. Option is added to mgl2png, mgl2eps, mgl2cpp, mglview. For example, use "mglview fname -Lru_RU.utf8" for file in UTF-8 encoding. - - Extend TriPlot() by adding manual coloring array (like SurfC()). - - Extend Dots() by adding transparency for dots. - - Improve STFA() by adding smoothed mask at the edges. - - Improve tick labels drawing if RotatedText = false. - - Add mglGraphAB::LastMousePos - - Add argument to show window maximazed - - Bug correction in configure script with unsual GSL setup. - - Bug correction in configure script with extra Qt options. - - Bug correction in subticks if ticks origin is specified. - - Bug correction with MGL command 'call'. - - Bug with subticks (having the same size as normal ticks). - - Improve labels for curved coordinates. - -1.8 Released 26 November 2008 - - Create Python and Octave interfaces using SWIG. Generally interfaces for a set of languages (Java, Lisp, Perl, PHP, Tcl, R, Ruby, Modula3, C# and other SWIG supported) can be simply created by the same way. - - MathGL documentation is completely rewritten for v.1.8. Now it is based on TeXinfo files and allows one to compile it in HTML, PDF and other formats. Also the structure of sections is sufficiently updated. New sections for Python, MGL and Samples are written. - - Cmake build system is written. It should work even for Windows progrmas (like VisualStudio and so on). At this moment cmake-based build system is used as secondary one. - - Add Qt interface: - * New class QMathGL is added. This is the Qt widget for drawing MathGL graphics. - * New class mglGraphQt is added for creating Qt window with MathGL plotting. - - Add functions to make FLTK, QT & GLUT windows from Fortran programs. - - Add new plot Barh() for horizontal bars. - - Add new plot Region() for filling the area between 2 curves. - - Add new plot Vect() for vector field by arrows which color and length depend on amplitude. At this old function Vect() (for vector field by hachures) was renamed to VectL(). - - Add Plot(), Surf() functions for plotting a curve or a surface defined by formula(s). - - Add class mglDraw for simplification of setting drawing function for window creation - - Add new functions for data handling: - * Envelop() -- for finding data envelop. - * Sew() -- for sewing data (removing phase jumps). - * Evaluate() -- for producing array interpolated by coordinates from other array(s). - * Put() -- for setting a values (as number or from array) for range of data. - * Fill() -- for filling by formula with coordinates x,y,z in specified range - * Diff() -- for finding derivative of parametrically specified data. - * mglPDE() -- for solving PDE in more or less general case. - * mglRay() -- for ray tracing (for finding trajectory in 3D space). - * mglQO2d() -- for beam tracing in 2D case (PDE solving in accompanied coordinates). - * mglJacobian() -- for evaluating Jacobian of coordinates transformation. - - Add new function ShowImage() for displaying the current picture. - - Color scheme will be without interpolation (color smoothing) if its style contain '|' symbol. - - Color inside string can be changed by TeX-like commands \color? or #? where ? is color id. - - Function Bars() now draw boounding box of the rectangle if its style contain '#' symbol. - - Function Chart() will not draw a peace if its color specification is ' '. - - Add argument for line length in Legend() - - Legend entry with empty style (i.e. "" but not NULL) is printed without indent. - - Default mglGraph::Org value now is mglPoint(NAN,NAN,NAN), i.e. MathGL library try to select optimal axis origin position by default. - - Add some utility functions: - * Title() for printing the title of the plot - * SetPalette() for simplifing palette setting - * SetTicks() for setting the ticks easely. - * SetTicksVal() for manual setting the position and the label of ticks - * Ellipse() for drawing ellipsoid - * Restore() for restoring transformation matrix after last InPlot() - - Information about mouse click position is shown in widgets (if ShowMousePos=true) - - Clean up C/Fortran interface: replace 'bool' to 'int' in C interface; add a lot of new interface functions; change the order of arguments in mgl_data_set_value(). - - Add MGL commands 'fplot', 'fsurf', 'fgets', 'export', 'import', 'write', 'region', 'title', 'sew', 'envelop', 'evaluate', 'put', 'palette', 'combine', 'pde', 'ray', 'qo2d', 'jacobian'. - - Extend MGL commands 'info', 'fill', 'copy', 'diff'. - - Add const modifiers everywhere. - - Add default window functions in mglGraphAB (as base class). - - Class mglFormula and functions for data extraction (like SubData, Hist and so on) now are thread safe. - - Allow mglData::Resize() to have size=1. - - Function mglSTFA() now normalize array on dn (for amplitude independency on value of dn). - - Function mglData::Crop() now use relative second argument if it is <=0. - - Functions [XYZC]Range() now have 3d argument for increase the range by value (Max-Min)*fact. - - Functions mgl_tile_r*() are renamed to mgl_tiles*(). - - Variable mglGraph::TickStr is removed. Use mglGraph::SetTicksVal() instead. - - Function mglGraph::WriteTIFF() is removed. - - Bug with wrong normales at points on bounding box in Surf3*() is corrected. - - Bug with non-visible marks into the legend is corrected. - - Bug of not-drawn quads with the same vertexes is corrected. - - Bug with colors in WriteBMP() is corrected. - - Some other minor bugs are corrected. - -1.7 Released 1 June 2008 - - MGL parser is sufficiently rewritten: - * User now can define its own MGL command (by changing mglParse::Cmd). - * Export MGL script to C++ file for the most of commands (except 'list', 'delete', 'call', 'for|next') is possible. - * New tool 'mgl2cpp' is added for exporting MGL script to C++ file. - * Uniform interface for tools: mgl2png, mgl2eps, mgl2svg, mglview. - * New command: 'define $N sth'. - * New conditional commands: 'if|else|elseif|endif'. - * New for-cycle commands: 'for|next'. Format is: 'for $N var' or 'for $N x1 x2 [dx]'. - * Command [xyz]tick now has additional argument for the start position of ticks. - * A set of MGL commands is extended by adding the new ones: 'mirror', 'face[xyz]', 'perspective', 'fit', 'fits', 'normsl', 'momentum', 'putsfit', 'rearrange', 'arrowsize', '[xyz]label', 'ctick'. - * Unicode support in scripts. - * Commands 'cont3' and 'contf3' now have variants for manual setting of contour level values. - - New class mglGraphIDTF is added for exporting graphics in IDTF format (which can be converted later to U3D pictures for inserting in PDF) - - New function mglGraph::Fit[23S]() is added for nonlinear fitting of data arrays. - - New function mglGraph::PutsFit() is added for printing the fitted formula. - - Color specification in color scheme (not in line style!) now supports "brighted" colors like "b1b2b3...b9". At this, color "b5" is equal to "b". Also, function mglColor::Set now has additional argument for "brightness" of the color. - - Color scheme now may contain up to 32 colors. - - New variable mglGraph::OrgT is added for manual setting of tick position (if OrgT.[xyz]!=NAN). - - Improved algorithm for automatic axis positioning (if Org.[xyz]==NAN). - - Function SubPlot() and MGL command 'subplot' now have arguments for additional relative plot shifting. - - Class mglGraphGL is derived now from mglGraphAB. It slightly decreases its speed but allows to produce more similar plots. - - New function mglData::Mirror() is added for mirroring data in some direction(s). - - New function mglData::Rearrange() is added for rearrange data dimensions. - - Tool 'mglview' now does not display info/error message about availible command-line arguments. - - Centered labels now are drawn at sqrt(Min*Max) if dx (or dy, dz) is zero. - - New functions FaceX(), FaceY(), FaceZ() are added as simplified interface to the Face() function. - - New function mglData::NormSl() for data normalization slice by slice is added. - - New function mglData::Momentum() for getting an array of data momentums along some direction is created. - - New functions mglData::Insert*(), mglData::Delete*() are added for inserting/deleting slices in data arrays. - - Font loading is speeded up and new function mglFont::Restore() is added. - - Default font size is decreased. - - New function mglFormula::CalcD() is added for evaluating the formula derivative over some variable. - - Bounding box now is drawn along isolines in curvilinear coordinates - - Bug/feature with legend option with included "'" is corrected. - - Bug for partly ommitted points with NAN values returned by transformation formulas are corrected. - - Bug with momentum evaluation along x-direction is corrected. - - Bug with mglData::Squeeze() is corrected. - - Added C/Fortran functions: mgl_restore_font(), mgl_subplot_d(), mgl_set_tick_origin(), mgl_data_norm_slice(), mgl_set_plotfactor(), mgl_data_mirror(), mgl_create_graph_idtf(), mgl_data_rearrange(), mgl_fit_*(), mgl_face*(), mgl_curve(), mgl_create_parser(), mgl_delete_parser(), mgl_add_param(), mgl_add_paramw(), mgl_add_var(), mgl_find_var(), mgl_parse(), mgl_parsew(), mgl_restore_once(), mgl_parser_allow_setsize(). - - Updated Pascal interface. - -1.6.2 Released 5 April 2008 - - Add recognition of TeX commands: \frac, \stack, \stackr, \stackl, \overset, \underset. - - Redefine strdup, wcsdup for compatibility with MS Visual Studio. - - MGL command 'ball' now have variant ball x y ['color'] - - MGL command 'curve' now have 2D variant - - Add MGL command 'readmat' for reading data file with sizes specified at beginning - - MGL commands 'readmat', 'readall', 'hist', 'max', 'min', 'sum', 'resize' now create the output array automatically. - - Add C/Fortran functions mgl_tile_r*(), mgl_stfa*(). - - Bug (in v.1.6.1) with log-axis ticks is corrected. - - Bug (in v.1.6.1) with user-defined colors is corrected. - - Bug with mglData::Hist is corrected. - -1.6.1 Released 2 April 2008 - - Support of named columns - * Column names recognition in mglData::Read(). The string with ## supposed to contain the column name (id) -- character from 'a' to 'z'. - * New functions mglData::Column(), mglData::SetColumnId() for named columns handling. - * Column function (like "plot a('t') a('p*b')") in MGL scripts. - - New plot STFA() is added for spectrogram - - New plot TextMark() is added for drawing textual (including LaTeX) symbols at point position. - - Extend plot Tile for drawing tiles with variable sizes - - Extend plot Bars() for drawing bars side-by-side or one-above-one. - - New function mglData::ReadMat() is added for reading data from text file with sizes specified at beginning. - - New function mglFont::Copy() for copying font data from other instance. - - New functions (mgl_copy_font, mgl_textmark_*, mgl_textmarkw_*, mgl_data_column, mgl_data_set_id) for C/Fortran interface are added. - - Improve color Ids so that user may change it (for example, add new color). - - Improve TeX symbol parsing. - - Improve log-axis ticks. - - Improve text in Legend(). - - Improve Window() functions (for FLTK and GLUT) so that argc, argv can be NULL now. - - Add "smoothing" for edges of cutted surfaces. - - Symbol '#' in line style now switch on the filling of markers. - - Add 'marksize' option in MGL scripts for changing MarkSize for single plot only. - - Add 'legend' option in MGL scripts for adding plot annotation. - - New MGL command 'textmark' is added. - - Command 'legend' now have variant for arbitrary position of legend. - - Bug with ctt is corrected. - -1.6 Released 13 March 2008 - - The font parsing and printing codes are completely rewritten - * Unicode supprot is added for all functions which print/draw the text. - * The class mglFont is completely rewritten for handling new format of solid/wire fonts with UTF glyphs. - * The set of recognized TeX symbols and commands is extended. - * It is possible now to use different font typefaces in MathGL. - * Tools for making solid/wire font files from *.otf, *.ttf and so on files are added. - * Function mglFont::Load always sets locale LC_NUMERIC to "C". - * Internal font has limited set of characters and no italic/bold symbols. This font is used as default under MS Windows. - - The structure of library is reorganized - * Header files now are placed in mgl/ subdirectory. - * Classes mglGraphFLTK and mglGraphGLUT are extracted as separate dynamic libraries. You should use linker keys -lmgl-fltk or -lmgl-glut for linking them. - * The linker key -lmgl is self-consistent and does not need any additional libraryes for linking. - * Modules for writing to JPEG or TIFF files are extracted as separate dynamic libraries. - * Classes mglGraph and mglGraphAB are pure classes now. - - New class mglGraphFLTK for making window with bitmap graphics (including frames and animation) is added. Each class instance may have only one window. However, several instances (windows) can be in application. You should call mglFlRun() at the end for starting FLTK message handling cycle. - - New class Fl_MathGL is added. This class is FLTK widget for drawing plots by help of MathGL. - - New tool 'mglview' showing MGL script in FLTK window is added. - - New function Perspective() switching on/off the perspective in the plot is added . - - New function Cone() for the truncated cone drawing is added. - - New functions mglData::ReadAll(), mglData::ReadRange() for data reading from a set of files into one mglData object are done. - - New function STFA() for Short Time Fourier Analysis is added. - - New variables PlotFactor and AutoPlotFactor for picture overall sizing (some analogue of Zoom() function) are added. - - New variable mglGraph::WarnCode contains numerical ID of warnings (in some sence it duplicates mglGraph::Message). - - TuneTicks flag now influences on Colorbar ticks also. - - New variable FactorPos displaying the factor position of axis ticks (0 at Min, 1 at Max, 1.15 is default) is added. - - New variable mglGraph::AutoOrg for shifting Org automatically if it lies outside Min ... Max range is added. - - Origin of axis is automatically shifted for better view if Org.[xyz] = NAN. - - New variable mglGraphGLUT::AutoClf for switching on/off automatic Clf() (picture clearing) between drawing (in GLUT and FLTK windows) is added. - - CloudQ plot now uses interpolated color scheme even if it lies inside the face. - - New functions for data loading from gsl_vector * and gsl_matrix * are added. - - New functions SetFontSizePT(), SetFontSizeCM() and SetFontSizeIN() for setting FontSize in pt, cm and inches are added. - - New variable CirclePnts for setting the number of points in circle drawing (like Tube(), Sphere(), Drop(), Cone()) is added. - - New MGL commands 'cone', 'readhdf', 'savehdf', 'stfa', 'plotfactor' - - New functions mgl_set_draw_face(), mgl_create_graph_fltk(), mgl_fltk_run(), mgl_tune_ticks(), mgl_data_set_value(), mgl_data_get_value(), mgl_set_zoom(). - - Uniform interface for writting in bitmap files (PNG, BMP, JPEG, TIFF) is created. - - Rare bug with alpha channel overflow in mglGraphZB is corrected. - - Bug with Transform() is corrected for multidimensional arrays. - -1.5 Released 8 January 2008 - - User may now set the format for tick labels by templates mglGraph::xtt, mglGraph::ytt, mglGraph::ztt or by user-supplied function mglGraph::TickStr. If one of these variables are not NULL then for that axis flag mglGraph::TuneTicks=false. - - New function Pipe() is added for the drawing of flow pipes for vector fields. - - New functions Sphere() and Drop() are added. - - New function Dew() is added for the drawing of vector fields by drops (like dew-drops under wind). - - Operators for class mglPoint (longitudinal and transverse component, perpendicular vector, vector product) are added. - - New MGL commands (sphere, drop, dew) are added. - - MGL commands [xyz]ticks now may have string as an argument for the setting of template of tick labels. - - MGL command norm has now additional argument for applying changes for slices >= its value. - - MGL command fill has now additional argument for direction of filling. - - Functions NewFrame(), EndFrame() are now defined for class mglGraphGL also. - - Class mglGraphGL (OpenGL mode) has now fog, arrows and curved text features. - - Class mglGraphPS (EPS and SVG files) has now fog feature. - - Bug with Surf3() for extremly irregular data is corrected. - - Bug with undefined Fog variables is corrected. - -1.4.3.1 Released 24 December 2008 - - Bug with mglGraphGLUT (under MS Windows) - - Bug with Fortran subroutines: mgl_label_ext() and mgl_text(). - - Update verson number (inside help string) for mgl2png, mgl2eps, mgl2svg. - - Rename back mglGraph::MessageBuf to mglGraph::Message (for - compatibility with UDAV v.0.2). - - Add file with examples for mglGraphGLUT. - -1.4.3 Released 18 December 2008 - - Fortran interface for most of functions is added. - - New function mglGraph::Ternary() for switching on/off - the drawing of Ternary plot is added. - - New function mglGraph::Fog() for the fog imitation on picture is added. - - New commands "ternary" and "fog" are added to MGL scripts. - - Correct line dashing in EPS and SVG files. - - Capital letters ("XYZ") in Axis() function argument change shift - to -shift for ticks and labels. - - New function mglGraph::CutOff() is added for cutting off arbitrary - region of 3D space, specified by a formula. - - New function mglGraph::WriteBMP() is added. - - Symbol ':' (if present) now terminates the color scheme specification - for all cases. - - The lightning in zoom mode is improved. - - Formulas now give NAN value for points lied out of range of - function definition. - - Orts in mglGraph::Beam() are swapped. - - Some changes for compatability with MacOS and MS Visual Studio are done. - - Variable FILE *mglGraph::Message is changed to char *mglGraph::MessageBuf. - - -1.4.2 Released 21 November 2007 - - The order of arguments in [xyz]range options now set the invert or - not the auto-filled coordinate of plots. - - Speed up drawing (especially with DrawFace=false). - - Command modify now has optional argument vdat and wdat for using in formulas. - - New functions mglData::Modify() are added for using of several data - arrays in formulas (variable names are 'v' and 'w'). - - The library is compatible now with MS Visial Studio. - - New functions mglData::Find() are added for the search of values - satisfying the condition. - - Change mglData::Resize() to keep values at boundaries. - - New command map is added for MGL scripts. - - New command once is added for MGL scripts. The code between once on - and once off is executed only one time. - - Flag DrawFace=false now sets to draw wire surfaces in all cases except - isosurfaces (Axial(), Surf3*()) and Crust(). - - Puts and Label functions now have argument for additional shifting of - text (label). - - Error with marks drawing for dashed lines is corrected. - - Error with tuned ticks along y- and z-direction is corrected. - -1.4.1 Released 14 November 2007 - - If minimal and maximal values of a range are equal then they are - ignored in mglGraph::Axis() function. I.e. it is possible to use - Axis(mglPoint(x1,y1),mglPoint(x2,y2)); to set boundaries of - plain (on X-Y plane) plot. - - Ticks looks better now for small (like, from 0.001 to 0.002) or large - (like, from 1000 to 2000) coordinate values and for narrow range - (like, from 0.999 to 1.000). To disable this feature use - mglGraph::TuneTicks=false. - - Lines, text and marks now are smoothed (if MGL_SIMPLE_LINE is not defined) - - MathGL is now compatible with 64-bit operating systems. - - A numerical value (a number) can be extracted from variables in MGL - scripts with the help of suffix: - * for sizes -- .nx, .ny, .nz - * for maximum position -- .mx, .my, .mz - * for average -- .ax, .ay, .az, .aa - * for widths -- .wx, .wy, .wz, .wa - * for skewness -- .sx, .sy, .sz, .sa - * for kurtosis -- .kx, .ky, .kz, .ka - * for maximum and minimum -- .max, .min - * for sum of all element -- .sum - - The error concerned with the script drawing with [xyz]range options exceeding the - axis range is corrected. - - The look of legend and ticks is improved. - - Log-scaled ticks now is drawn correctly. - - New command info is added in MGL script. - - New variable mglGraph::Message is added for the handle of warnings output (set - to 0 to disable warnings). - - All MathGL drawing functions now tell (by using mglGraph::Message) the matter - why the plot is absent. - - Negative font size values are now equal to |size|*FontSize in all cases. - - The order of rows in GetBits() and GetRGBA() functions are inverted (for - simpler window drawing). - - A short built-in instruction for mgl2png, mgl2eps, mgl2svg programs is added. - -1.4 Released 30 October 2007 - - New function WriteSVG() is added for exporting graphics to SVG files - (actually work only in mglGraphPS class). New interpreter mgl2svg is added. - - All MGL script commands now may have options, which change some general - behavior for particular command (plot). The options are: crange, xrange, - yrange, zrange, alpha (or alphadef), meshnum, cut, fontsize, ambient. - Each option should be delimited from previous text by symbol ';'. - - Argument of script commands can now contain subarrays (like "plot a(:,1)") - - MGL scripts now can have external arguments (string $1, $2, ... $9 in - script). Argument values added by mglParse::AddParam() function. - - Font definition string now may contain color specification after symbol ':'. - - Optional symbol 't' in the string argument of mglGraph::Cont(), - mglGraph::Cont3(), mglGraph::ContA() plots set to draw contour values - near contour line. - - New functions mglGraph::ContFX(), mglGraph::ContFY(), mglGraph::ContFZ(), - mglGraph::ContF(), mglGraph::ContF3(), mglGraph::ContFA() are added for - for plotting solid contours. - - New function mglGraph::Crust() is added for plotting reconstructed - surface (crust) for points (it work but not so fine). - - New function mglGraph::Dots() is added for plotting dots in space. - - New function mglGraph::TriPlot() is added for drawing triangle surface or - mesh (if symbol '#' is specified). - - New function mglGraph::Mark() is added for drawing marks with variable sizes. - - New function mglGraph::Tube() is added for drawing tube with specified - radius along the curve. - - New function mglGraph::Text() is added for printing text along the curve. - - New function mglGraph::Beam() is added for making isosurfaces of beam - amplitude in curvilinear coordinates. - - New function mglGraph::Zoom() is added for zoom in/out a part of picture. - - New flag mglGraph::DrawFace is added for exclude face drawing - (faster plotting during rotation and so on). - - Number of cells in mglGraph::CloudQ() plot and number of hachures in - mglGraph::Vect(), mglGraph::VectC() plots depend now on value - of mglGraph::MeshNum. - - New commands chdir, stop and call are added to MGL scripts. - - MGL commands xrange, yrange, zrange, crange now may have 2 numbers as arguments. - - Points with nan values are not drawn (are ignored) now. - - PNG pictures is saved now with transparent background by default. - - Some errors are corrected. - - Section " is added to chapter " of documentation. - - Current changes concerning new functions are added in the library documentation. - -1.3 Released 8 October 2007 - - New script language MGL is introduced. - - New class mglParse is added for string-by-string parsing and executing - of MGL scripts. - - New function mglGraph::Exec() is added for executing of script commands. - - Logical operators are to textual formula parsing in class mglFormula. - - Function mglData::Transpose() now have textual argument which specify - new order of dimensions after transposing. - - New function mglData::Extend() is added for extending (increasing) the - dimensions of data array. - - A function for EPS export is excluded from mglGraphGLUT class. - - Parameter \textit{dir} of functions mglGraph::Belt() and mglGraph::Fall() - is excluded. Corresponding flag now is included in string argument - of these functions. - - Rotation direction in mglGraph::Torus() and mglGraph::Axial() now can be - specified in string argument. - - Function mglGraph::Bars() does not draw marks of points now. - - Black color is changed to dark gray in color palette for 1d plots. - - The algorithm of equations parsing is changed. - - Some errors are corrected. - - The chapter "Script language MGL" is added to the library documentation. - - Sections about the using of transparency and pure C interface are added - to chapter "Examples" of the library documentation. - - Current changes concerning new functions and so on are added to the - library documentation. - -1.2.2 Released 26 September 2007 - - Add functions mglData::Hist() for creating histogram (distribution) - of data values - - Add function mglGraph::Curve for drawing spline (like Bezier curve). - - Rewritten mglGraph::Line function. - - Add new variable mglGraph::BaseLineWidth for setting base width of lines. - Useful for large bitmap pictures. - - Add arrow styles "AKDTVISO_" in line parameters (see mglGraph::SelectPen, - now not supported in OpenGL mode). - - Add variables CutMin, CutMax for cutting off a point in some area. - Useful for isosurface plots. - - New function mglGraph::Tile is added for drawing surface of horisontal tiles. - - New function mglGraph::Error is added for drawing error boxes of data points. - - New function mglGraph::Chart is added for drawing charts. - - Size of marks now depend on relative size of plot (depend on SubPlot or InPlot calls). - - Add function for switching on/off light source separately. - -1.2.1 Released 14 September 2007 - - Autoconf/automake transition (thanks to D. Kulagin) - -1.2 Released 10 September 2007 - - New variant of library also use dynamic linking - - Autoconf script is written for Linux mode (thanks to D. Kulagin) - - Corrected Colorbar drawing. - - New function mglGraph::Belt is added for drawing 2D plot of belts. - - New functions XRange, YRange, ZRange are added for automatic determining - scales on x-, y-, z-directions on base of data values. - - New variable AxialDir is added for specifing direction of rotation in - Axial and Torus plots. - - Added logaritmic-like ticks drawing on axis if mglGraph::dx, mglGraph::dy - or mglGraph::dz is equal to zero. - - Flag LegendBox is added for switching on/off box drawing in legend. - - Character '_' in string argument of mglGraph::Axis(char *) function - disable tick numbers drawing. - - Add function mglGraph::Ambient for brightness of ambient light (surface color) - - New parameter added to Light function for brightness of light source - - Variable mglGraph::font is renamed to mglGraph::FontDef - - Rewritten mglData::Read function to be compatible with Windows Vista - - Add function for export/import data to bitmap picture (now only in PNG format) - - Rewritten method of automatic tick labels rotation on axis - - Add functions mglData::Momentum() for data momentum (average, width, - skewness and so on) evaluation - - Add functions to find position of data maximal or minimal value, including - its interpolated position - - An "Pure C interface" section is added in documentation. - - An "News" section is added in documentation. - - Some errors are corrected and minor optimization are done. - -1.1 Released 23 May 2007 - - New class mglGraphPS is written for image exporting to vector EPS file. - - New waterfall-like plot is added for 2D data (see mglGraph::Fall). - - New Surf3C plot is added for isosurface coloring by other data. - - New function for distribution (histogram) creation is added - (see mglData::Hist). - - New function for data cropping is added (see mglData::Crop). - - Variable mglGraph::MeshNum is added for setting desired number of - lines in Grid and Mesh plots. - - Surface lightning is smoothed in ZBuffer mode. - - Lightning formula is changed to agree with OpenGL mode. - - Flag '#' is added to surface plots. It draws grid (or mesh) on 2D plots - and switches off face drawing for isosurfaces (set wire drawing). - - Flag 'sum' is added to Area plot. - - Pure C/Fortran interface is written. - - Documentation is sufficiently rewritten and extended. - - Documentation on Russian is added. - - Some errors are corrected. - -1.0 Released 2 April 2007 - - Improved speed of expression parsing. - - The SurfA function for the plotting of surface with transparency - determined by other data is added. - - The Torus function for the plotting of surface which is result of - the curve rotation is added. - - Corrected contour plotting procedure. - - Extended library documentation. - - Slightly improved speed of ZBuffer drawing. - -0.9 Last beta version of the MathGL library. Released 2 March 2007 - - Rewritten low-level primitive drawing in ZBuffer mode. - - Improved surface look in ZBuffer mode. - - Improved speed of drawing and formulas evaluation. - - 2 additional types of transparency: like glasses and like - superposition of light sources (only in ZBuffer mode). - - Corrected Colorbar drawing in OpenGL mode. - -0.8.1 ZBuffer drawing was written. Released 19 Febriary 2007 - - Correct using of the color array under MESA (Linux). - - ZBuffer plotting functions are sufficiently rewritten. - - A text drawing in ZBuffer mode is added. - - A colorbar drawing in ZBuffer mode is added. - - All images for documentation are moved in images/ subdirectory. - - An example section is added in documentation. - - The colorbar description is added in documentation. - -0.8.0 First public release diff --git a/FindMathGL.cmake b/FindMathGL.cmake deleted file mode 100644 index 79479c6..0000000 --- a/FindMathGL.cmake +++ /dev/null @@ -1,80 +0,0 @@ -# FindMathGL.cmake - Check for the presence of MathGL -# -# The following variables are set when MathGL is found: -# HAVE_MATHGL = Set to true, if all components of MathGL have been found. -# MATHGL_INCLUDES = Include path for the header files of MathGL -# MATHGL_LIBRARIES = Link these to use MathGL -# MATHGL_LFLAGS = Linker flags (optional) - -## ----------------------------------------------------------------------------- -## Search locations - -set (include_locations - /usr/include - /usr/local/include) - -set (lib_locations - /usr/local/lib64 - /usr/local/lib - /usr/lib64 - /usr/lib) - -## ----------------------------------------------------------------------------- -## Check for the header files - -find_path (MATHGL_INCLUDES mgl/mgl.h mgl/mgl_data.h - PATHS ${include_locations} - NO_DEFAULT_PATH) - -## ----------------------------------------------------------------------------- -## Check for the various libraries - -set (MATHGL_LIBRARIES "") - -## libmgl - -find_library (HAVE_LIBMGL mgl - PATHS ${lib_locations} - NO_DEFAULT_PATH) -if (HAVE_LIBMGL) - list (APPEND MATHGL_LIBRARIES ${HAVE_LIBMGL}) -endif (HAVE_LIBMGL) - -## ----------------------------------------------------------------------------- -## Actions taken when all components have been found - -if (MATHGL_INCLUDES AND MATHGL_LIBRARIES) - set (HAVE_MATHGL TRUE) -else (MATHGL_INCLUDES AND MATHGL_LIBRARIES) - set (HAVE_MATHGL FALSE) - if (NOT MATHGL_FIND_QUIETLY) - if (NOT MATHGL_INCLUDES) - message (STATUS "Unable to find MATHGL header files!") - endif (NOT MATHGL_INCLUDES) - if (NOT MATHGL_LIBRARIES) - message (STATUS "Unable to find MATHGL library files!") - endif (NOT MATHGL_LIBRARIES) - endif (NOT MATHGL_FIND_QUIETLY) -endif (MATHGL_INCLUDES AND MATHGL_LIBRARIES) - -if (HAVE_MATHGL) - if (NOT MATHGL_FIND_QUIETLY) - message (STATUS "Found components for MATHGL") - message (STATUS "MATHGL_INCLUDES = ${MATHGL_INCLUDES}") - message (STATUS "MATHGL_LIBRARIES = ${MATHGL_LIBRARIES}") - endif (NOT MATHGL_FIND_QUIETLY) -else (HAVE_MATHGL) - if (MATHGL_FIND_REQUIRED) - message (FATAL_ERROR "Could not find MATHGL!") - endif (MATHGL_FIND_REQUIRED) -endif (HAVE_MATHGL) - -## ----------------------------------------------------------------------------- -## Mark advanced variables - -mark_as_advanced ( - MATHGL_INCLUDES - MATHGL_LIBRARIES -) - -# EOF FindMathGL.cmake diff --git a/Makefile.am b/Makefile.am index e951f61..9522f05 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,25 +1,5 @@ ACLOCAL_AMFLAGS = -I config -SUBDIRS = mgl lang widgets utils examples include - -doctargets = - -if USE_DOCS -SUBDIRS += texinfo -#doctargets += install-html install-pdf -doctargets += install-html -endif - -mgldest=$(DESTDIR)$(datadir)/$(PACKAGE)/fonts - -install-data-local: $(doctargets) - mkdir -p $(mgldest) - cp -r $(top_srcdir)/fonts/*.vfm $(mgldest) - -uninstall-local: - rm -rf $(mgldest) +SUBDIRS = src widgets include lang examples utils clean-local: find . -name '*~' -print0 | xargs -0 rm -f - -#all-local: html pdf -all-local: html diff --git a/Makefile.in b/Makefile.in index 7acbdc4..713df49 100644 --- a/Makefile.in +++ b/Makefile.in @@ -33,17 +33,13 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@USE_DOCS_TRUE@am__append_1 = texinfo -#doctargets += install-html install-pdf -@USE_DOCS_TRUE@am__append_2 = install-html subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure \ $(top_srcdir)/include/mgl/config.h.in AUTHORS COPYING \ ChangeLog INSTALL NEWS TODO config/config.guess \ config/config.sub config/depcomp config/install-sh \ - config/ltmain.sh config/missing config/py-compile \ - config/texinfo.tex + config/ltmain.sh config/missing config/py-compile ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/autotroll.m4 \ $(top_srcdir)/configure.ac @@ -71,7 +67,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = mgl lang widgets utils examples include texinfo +DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -140,10 +136,6 @@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLTK_FLAGS = @FLTK_FLAGS@ FLTK_LIBS = @FLTK_LIBS@ -GIF_FLAGS = @GIF_FLAGS@ -GIF_LIBS = @GIF_LIBS@ -GLUT_FLAGS = @GLUT_FLAGS@ -GLUT_LIBS = @GLUT_LIBS@ GL_LIBS = @GL_LIBS@ GREP = @GREP@ GSL_FLAGS = @GSL_FLAGS@ @@ -169,7 +161,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MGL_AGE = @MGL_AGE@ MGL_CURRENT = @MGL_CURRENT@ MGL_RELEASE = @MGL_RELEASE@ @@ -224,13 +215,10 @@ TMPDIR = @TMPDIR@ U3D_LIBS = @U3D_LIBS@ UIC = @UIC@ VERSION = @VERSION@ -WX_FLAGS = @WX_FLAGS@ -WX_LIBS = @WX_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -264,6 +252,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -284,9 +273,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I config -SUBDIRS = mgl lang widgets utils examples include $(am__append_1) -doctargets = $(am__append_2) -mgldest = $(DESTDIR)$(datadir)/$(PACKAGE)/fonts +SUBDIRS = src widgets include lang examples utils all: all-recursive .SUFFIXES: @@ -663,7 +650,7 @@ distcleancheck: distclean exit 1; } >&2 check-am: all-am check: check-recursive -all-am: Makefile all-local +all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive @@ -713,7 +700,7 @@ info: info-recursive info-am: -install-data-am: install-data-local +install-data-am: install-dvi: install-dvi-recursive @@ -759,43 +746,31 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-local +uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am all-local am--refresh check check-am clean \ - clean-generic clean-libtool clean-local ctags ctags-recursive \ - dist dist-all dist-bzip2 dist-gzip dist-lzma dist-shar \ - dist-tarZ dist-xz dist-zip distcheck distclean \ - distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-data-local install-dvi \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool clean-local ctags ctags-recursive dist dist-all \ + dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-local + ps ps-am tags tags-recursive uninstall uninstall-am -install-data-local: $(doctargets) - mkdir -p $(mgldest) - cp -r $(top_srcdir)/fonts/*.vfm $(mgldest) - -uninstall-local: - rm -rf $(mgldest) - clean-local: find . -name '*~' -print0 | xargs -0 rm -f -#all-local: html pdf -all-local: html - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/MathGL2.cbp b/MathGL2.cbp new file mode 100644 index 0000000..860e385 --- /dev/null +++ b/MathGL2.cbp @@ -0,0 +1,208 @@ + + + + + + diff --git a/NEWS b/NEWS index f5197e3..92771aa 100644 --- a/NEWS +++ b/NEWS @@ -1,16 +1,26 @@ -1.8.1 Released ?? February 2009 -1.8 Released 26 November 2008 -1.7 Released 1 June 2008 +2.0.b Released 23 August 2011 + +1.11.2 Released 30 May 2011 +1.11.1 Released 28 March 2011 +1.11 Released 8 November 2010 +1.10.2.1 Released 27 March 2010 +1.10.2 Released 22 March 2010 +1.10.1 Released 8 March 2010 +1.10 Released 28 December 2009 +1.9 Released 8 July 2009 +1.8.1 Released 4 March 2009 +1.8 Released 27 November 2008 +1.7 Released 5 June 2008 1.6.2 Released 5 April 2008 1.6.1 Released 2 April 2008 -1.6 Released 13 March 2008 -1.5 Released 8 January 2008 +1.6 Released 17 March 2008 +1.5 Released 11 January 2008 1.4.3.1 Released 24 December 2008 1.4.3 Released 18 December 2008 -1.4.2 Released 21 November 2007 +1.4.2 Released 27 November 2007 1.4.1 Released 14 November 2007 1.4 Released 30 October 2007 -1.3 Released 8 October 2007 +1.3 Released 15 October 2007 1.2.2 Released 26 September 2007 1.2.1 Released 14 September 2007 1.2 Released 10 September 2007 @@ -18,4 +28,4 @@ 1.0 Released 2 April 2007 0.9 Last beta version of the MathGL library. Released 2 March 2007 0.8.1 Released 19 Febriary 2007 -0.8.0 First public release +0.8.0 First public release (24 January 2007) diff --git a/README_V2 b/README_V2 new file mode 100644 index 0000000..b3ee778 --- /dev/null +++ b/README_V2 @@ -0,0 +1,51 @@ +README for changes from v.1.* + +There are few key changes at end-user level. + +1. The structure of library is changed sufficiently. + There are 4 levels now: + +(a) Developer level (for people who want to improve library) contain + classes for base plotting functions: + +mglBase --> mglCanvas --> mglCanvasW --> mglCanvasQT, mglCanvasFL + | + ---------> mglCanvasGL --> mglCanvasGLUT + +(b) C&Fortran interface for plotting and data handlinng functions + +(c) Unified "inline" classes (mglGraph, mglData, mglWindow, ...), which + contain only inline members, which call C-functions. This make + MathGL completely cross-platform, i.e. the same binary files can be + used in any compiler (MinGW, MSVS, Borland, ...). Moreover it give + the same classes for all interfaces (Python/Octave/...). + +(d) MGL scripts use mglGraph's functions but give some extra + capabilities for axis setup or textual plot editing + +2. There is unified class mglGraph instead of set of mglGraphZB, + mglGraphPS, ... The quality<->speed level of plot is specified by + SetQuality() function. + +3. There is abstract class mglDataA which allow to derive classes with + its own data representation. However, I recommend to use mglData for + usual cases -- it have large set of built in functions. + +4. All plotting functions now have unified interface for arguments: + data objects or numbers; string with style; string with options. + Options (the same as ones in MGL v.1.*) allows one to make fine + tuning of plot. I.e. easily set the range of coordinates, plot + position, font size and so on. + +5. The last big change is style representation. There are differences + for colors and for text style: + +* Colors may have "brighted" version everywhere -- just specify '{cN}' + instead of 'c'. Here 'c' is base color id, 'N' is digit 1,2...9 for + brightness. Also the transparency can be changed by adding '{AN}'. + +* Text styles is reverted now -- to be unified with any other styles. + Color is placed firstly, then separator ':', and after it font styles + (bold, italic, wire, ...). + +Also there are a lot of other (not so general) changes and improvements. diff --git a/TODO b/TODO index b599d10..608d552 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ - MathGL for v.1.11.* or v.2.0 + MathGL for v.2.0 1. Colorbar: print more digits for manual arrays ... but avoid overlapping ??? @@ -41,7 +41,7 @@ ========================= Later - + 1. Plot for isolines of vector fields ??? 2. Named arguments in MGL ??? 3. \dfrac for normal size and centering (sample \big\big{\frac{1}{2}}) ??? @@ -51,7 +51,7 @@ 7. Allow interpolation in MGL if argument is not integer ??? 8. Check if widget functions can be added to mgl_w.h !?! -- use #define ??! 9. Add '[' as separator in string ??? -10. Save id of subplots and axis for getting value of click coordinates arbitrary inplot -- fill only part which is overlapped. Clear it at Clf() + update for any Rotate, Aspect, InPlot, SetRanges, +10. Save id of subplots and axis for getting value of click coordinates arbitrary inplot -- fill only part which is overlapped. Clear it at Clf() + update for any Rotate, Aspect, InPlot, SetRanges, 11. Surface by interpolation for arbitrary points {x,y,z} -- seems to be too complicated :( 12. Rename 'stl'->'style', 'sch'->'scheme' in MGL docs ??? 13. Add option ':[xyzd]' in color scheme for coloring along coordinate (default 'z') ?!? @@ -75,8 +75,8 @@ 3. Add "Howto" section in web site. Web - -1. "Data plotting", "Data plot", "Scientific visualtization", "Surface", "Cloud", + +1. "Data plotting", "Data plot", "Scientific visualtization", "Surface", "Cloud", "Plot", "statistical graphics" 2. Examples of animation 3. Example of inverted axis, minus-log axis diff --git a/aclocal.m4 b/aclocal.m4 index fadf64c..89f4e43 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -13,8 +13,8 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, +[m4_warning([this file was generated for autoconf 2.67. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) @@ -22,8 +22,7 @@ To do so, use the procedure documented by the package, typically `autoreconf'.]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -32,8 +31,7 @@ To do so, use the procedure documented by the package, typically `autoreconf'.]) m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -60,7 +58,7 @@ m4_define([_LT_COPYING], [dnl # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) -# serial 57 LT_INIT +# serial 56 LT_INIT # LT_PREREQ(VERSION) @@ -89,7 +87,6 @@ esac # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl @@ -106,8 +103,6 @@ AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) - dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) @@ -144,7 +139,7 @@ m4_defun([_LT_CC_BASENAME], *) break;; esac done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) @@ -164,9 +159,6 @@ m4_defun([_LT_FILEUTILS_DEFAULTS], m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl - _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -189,13 +181,10 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl -m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our @@ -211,6 +200,7 @@ fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl +_LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) @@ -224,6 +214,23 @@ aix3*) ;; esac +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + # Global variables: ofile=libtool can_build_shared=yes @@ -264,28 +271,6 @@ _LT_CONFIG_COMMANDS ])# _LT_SETUP -# _LT_PREPARE_SED_QUOTE_VARS -# -------------------------- -# Define a few sed substitution that help us do robust quoting. -m4_defun([_LT_PREPARE_SED_QUOTE_VARS], -[# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' -]) - # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' @@ -438,7 +423,7 @@ m4_define([_lt_decl_all_varnames], # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) +[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS @@ -448,7 +433,7 @@ m4_define([_LT_CONFIG_STATUS_DECLARE], # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # -# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) @@ -547,20 +532,12 @@ LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$[]1 -_LTECHO_EOF' -} - # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -571,9 +548,9 @@ done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -581,38 +558,16 @@ for var in lt_decl_all_varnames([[ \ esac done +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\[$]0 --fallback-echo"')dnl " + lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; +esac + _LT_OUTPUT_LIBTOOL_INIT ]) -# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) -# ------------------------------------ -# Generate a child script FILE with all initialization necessary to -# reuse the environment learned by the parent script, and make the -# file executable. If COMMENT is supplied, it is inserted after the -# `#!' sequence but before initialization text begins. After this -# macro, additional text can be appended to FILE to form the body of -# the child script. The macro ends with non-zero status if the -# file could not be fully written (such as if the disk is full). -m4_ifdef([AS_INIT_GENERATED], -[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], -[m4_defun([_LT_GENERATED_FILE_INIT], -[m4_require([AS_PREPARE])]dnl -[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl -[lt_write_fail=0 -cat >$1 <<_ASEOF || lt_write_fail=1 -#! $SHELL -# Generated by $as_me. -$2 -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$1 <<\_ASEOF || lt_write_fail=1 -AS_SHELL_SANITIZE -_AS_PREPARE -exec AS_MESSAGE_FD>&1 -_ASEOF -test $lt_write_fail = 0 && chmod +x $1[]dnl -m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- @@ -622,11 +577,20 @@ m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], -[# Run this file to recreate a libtool stub with the current configuration.]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. -cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 exec AS_MESSAGE_LOG_FD>>config.log { echo @@ -652,7 +616,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -697,13 +661,15 @@ chmod +x "$CONFIG_LT" # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. -lt_cl_success=: -test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" -exec AS_MESSAGE_LOG_FD>/dev/null -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false -exec AS_MESSAGE_LOG_FD>>config.log -$lt_cl_success || AS_EXIT(1) +if test "$no_create" != yes; then + lt_cl_success=: + test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false + exec AS_MESSAGE_LOG_FD>>config.log + $lt_cl_success || AS_EXIT(1) +fi ])# LT_OUTPUT @@ -766,12 +732,15 @@ _LT_EOF # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) - _LT_PROG_REPLACE_SHELLFNS + _LT_PROG_XSI_SHELLFNS - mv -f "$cfgfile" "$ofile" || + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], @@ -877,13 +846,11 @@ AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) -AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) -dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER @@ -988,31 +955,6 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) - AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], - [lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD - echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD - $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -1040,7 +982,7 @@ _LT_EOF else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -1060,11 +1002,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='' - fi + _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in @@ -1072,7 +1010,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -1088,141 +1026,202 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], fi ]) -# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) -# ---------------------------------- +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. -# Store the results from the different compilers for each TAGNAME. -# Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], - [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ - lt_aix_libpath_sed='[ - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }]' - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi],[]) - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" - fi - ]) - aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) -fi +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], -[m4_divert_text([M4SH-INIT], [$1 -])])# _LT_SHELL_INIT - +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- -# Find how we can fake an echo command that does not interpret backslash. -# In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script which will find a shell with a builtin -# printf (which we can use as an echo command). +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], -[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -AC_MSG_CHECKING([how to print strings]) -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' +[_LT_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$[]1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +[$]* +_LT_EOF + exit 0 +fi -case "$ECHO" in - printf*) AC_MSG_RESULT([printf]) ;; - print*) AC_MSG_RESULT([print -r]) ;; - *) AC_MSG_RESULT([cat]) ;; -esac +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi -m4_ifdef([_AS_DETECT_SUGGESTED], -[_AS_DETECT_SUGGESTED([ - test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test "X`printf %s $ECHO`" = "X$ECHO" \ - || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) -])# _LT_PROG_ECHO_BACKSLASH + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: -# _LT_WITH_SYSROOT -# ---------------- -AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) -AC_ARG_WITH([sysroot], -[ --with-sysroot[=DIR] Search for dependent libraries within DIR - (or the compiler's sysroot if not specified).], -[], [with_sysroot=no]) - -dnl lt_sysroot will always be passed unquoted. We quote it here -dnl in case the user passed a directory name. -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - AC_MSG_RESULT([${with_sysroot}]) - AC_MSG_ERROR([The sysroot must be an absolute path.]) - ;; -esac + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(lt_ECHO) +]) +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], + [An echo program that does not interpret backslashes]) +])# _LT_PROG_ECHO_BACKSLASH - AC_MSG_RESULT([${lt_sysroot:-no}]) -_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- @@ -1252,7 +1251,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in @@ -1370,47 +1369,14 @@ need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK -# _LT_PROG_AR -# ----------- -m4_defun([_LT_PROG_AR], -[AC_CHECK_TOOLS(AR, [ar], false) -: ${AR=ar} -: ${AR_FLAGS=cru} -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) - -AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], - [lt_cv_ar_at_file=no - AC_COMPILE_IFELSE([AC_LANG_PROGRAM], - [echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - ]) - ]) - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi -_LT_DECL([], [archiver_list_spec], [1], - [How to feed a file listing to the archiver]) -])# _LT_PROG_AR - - # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], -[_LT_PROG_AR +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: @@ -1437,19 +1403,10 @@ if test -n "$RANLIB"; then esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) -_LT_DECL([], [lock_old_archive_extraction], [0], - [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE @@ -1474,15 +1431,15 @@ AC_CACHE_CHECK([$1], [$2], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1522,7 +1479,7 @@ AC_CACHE_CHECK([$1], [$2], if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1585,11 +1542,6 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -1654,8 +1606,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -1706,7 +1658,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -[#line $LINENO "configure" +[#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -1747,13 +1699,7 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } +void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -1762,11 +1708,7 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else @@ -1942,16 +1884,16 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes @@ -2110,7 +2052,6 @@ m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ @@ -2119,23 +2060,16 @@ if test "$GCC" = yes; then darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -2148,7 +2082,7 @@ if test "$GCC" = yes; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -2168,13 +2102,7 @@ BEGIN {RS=" "; FS="/|\n";} { if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) @@ -2262,7 +2190,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -2293,9 +2221,8 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$cc_basename in - yes,*) - # gcc + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2316,83 +2243,36 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH. + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' ;; *) - # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' ;; esac + dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -2479,19 +2359,6 @@ gnu*) hardcode_into_libs=yes ;; -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -2534,10 +2401,8 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 ;; interix[[3-9]]*) @@ -2604,35 +2469,26 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], - [lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [lt_cv_shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - ]) - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -2644,6 +2500,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -2864,8 +2732,6 @@ _LT_DECL([], [library_names_spec], [1], The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) -_LT_DECL([], [install_override_mode], [1], - [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], @@ -2978,7 +2844,6 @@ AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], @@ -3100,11 +2965,6 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -3113,8 +2973,8 @@ case $host_os in fi ;; esac -_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_TAGDECL([], [reload_cmds], [2])dnl +_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_DECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD @@ -3166,18 +3026,16 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc*) +cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -3207,10 +3065,6 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -3219,11 +3073,11 @@ hpux10.20* | hpux11*) lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -3249,7 +3103,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -3323,21 +3177,6 @@ tpf*) ;; esac ]) - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` - fi - ;; - esac -fi - file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -3345,11 +3184,7 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method = "file_magic"]) -_LT_DECL([], [file_magic_glob], [1], - [How to find potential files when deplibs_check_method = "file_magic"]) -_LT_DECL([], [want_nocaseglob], [1], - [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) + [Command to use when deplibs_check_method == "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD @@ -3406,19 +3241,7 @@ if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi + AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -3431,13 +3254,13 @@ _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -3452,77 +3275,16 @@ dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) -# _LT_CHECK_SHAREDLIB_FROM_LINKLIB -# -------------------------------- -# how to determine the name of the shared library -# associated with a specific link library. -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], -[m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) -m4_require([_LT_DECL_DLLTOOL]) -AC_CACHE_CHECK([how to associate runtime and link libraries], -lt_cv_sharedlib_from_linklib_cmd, -[lt_cv_sharedlib_from_linklib_cmd='unknown' -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac -]) -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - -_LT_DECL([], [sharedlib_from_linklib_cmd], [1], - [Command to associate shared and link libraries]) -])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB - - -# _LT_PATH_MANIFEST_TOOL -# ---------------------- -# locate the manifest tool -m4_defun([_LT_PATH_MANIFEST_TOOL], -[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], - [lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&AS_MESSAGE_LOG_FD - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest*]) -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi -_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl -])# _LT_PATH_MANIFEST_TOOL - - -# LT_LIB_M -# -------- -# check for math library -AC_DEFUN([LT_LIB_M], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") @@ -3549,12 +3311,7 @@ m4_defun([_LT_COMPILER_NO_RTTI], _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; - *) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; - esac + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, @@ -3571,7 +3328,6 @@ _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl @@ -3639,8 +3395,8 @@ esac lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3676,7 +3432,6 @@ for ac_symprfx in "" "_"; do else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -3698,7 +3453,7 @@ _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -3710,18 +3465,6 @@ _LT_EOF if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT@&t@_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT@&t@_DLSYM_CONST -#else -# define LT@&t@_DLSYM_CONST const -#endif - #ifdef __cplusplus extern "C" { #endif @@ -3733,7 +3476,7 @@ _LT_EOF cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -LT@&t@_DLSYM_CONST struct { +const struct { const char *name; void *address; } @@ -3759,15 +3502,15 @@ static const void *lt_preloaded_setup() { _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi @@ -3800,13 +3543,6 @@ else AC_MSG_RESULT(ok) fi -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], @@ -3817,8 +3553,6 @@ _LT_DECL([global_symbol_to_c_name_address], _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) -_LT_DECL([], [nm_file_list_spec], [1], - [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3830,6 +3564,7 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= +AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -3880,11 +3615,6 @@ m4_if([$1], [CXX], [ # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -3934,12 +3664,6 @@ m4_if([$1], [CXX], [ ;; esac ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; dgux*) case $cc_basename in ec++*) @@ -4029,8 +3753,8 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene + xlc* | xlC*) + # IBM XL 8.0 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' @@ -4060,7 +3784,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4092,7 +3816,7 @@ m4_if([$1], [CXX], [ ;; solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' @@ -4196,12 +3920,6 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -4244,13 +3962,6 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' - ;; - esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -4314,13 +4025,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -4332,26 +4037,26 @@ m4_if([$1], [CXX], [ # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; esac ;; esac @@ -4382,7 +4087,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + f77* | f90* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; @@ -4439,11 +4144,9 @@ case $host_os in _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac - -AC_CACHE_CHECK([for $compiler option to produce PIC], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) +AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) # # Check to make sure the PIC flag actually works. @@ -4462,8 +4165,6 @@ fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # @@ -4484,7 +4185,6 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl @@ -4493,35 +4193,30 @@ m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - ;; - esac - ;; + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + linux* | k*bsd*-gnu) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= @@ -4581,36 +4276,13 @@ dnl Note also adjust exclude_expsyms for C++ above. openbsd*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; - *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -4644,12 +4316,11 @@ dnl Note also adjust exclude_expsyms for C++ above. _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.19, is reported +*** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. _LT_EOF fi @@ -4685,12 +4356,10 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -4708,11 +4377,6 @@ _LT_EOF fi ;; - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4738,16 +4402,15 @@ _LT_EOF if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag=' $pic_flag' + tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4758,17 +4421,13 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; - xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -4784,17 +4443,17 @@ _LT_EOF fi case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) + xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4803,13 +4462,13 @@ _LT_EOF fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -4827,8 +4486,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4874,8 +4533,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4915,10 +4574,8 @@ _LT_EOF else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -4980,6 +4637,7 @@ _LT_EOF if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi + _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then @@ -5005,9 +4663,9 @@ _LT_EOF _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -5016,19 +4674,14 @@ _LT_EOF else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -5060,63 +4713,20 @@ _LT_EOF # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) @@ -5154,7 +4764,7 @@ _LT_EOF # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -5162,7 +4772,7 @@ _LT_EOF hpux9*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -5177,8 +4787,8 @@ _LT_EOF ;; hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -5196,16 +4806,16 @@ _LT_EOF ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -5217,14 +4827,7 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - m4_if($1, [], [ - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - _LT_LINKER_OPTION([if $CC understands -b], - _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], - [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi @@ -5252,34 +4855,19 @@ _LT_EOF irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], - [lt_cv_irix_exported_symbol], - [save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE( - [AC_LANG_SOURCE( - [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], - [C++], [[int foo (void) { return 0; }]], - [Fortran 77], [[ - subroutine foo - end]], - [Fortran], [[ - subroutine foo - end]])])], - [lt_cv_irix_exported_symbol=yes], - [lt_cv_irix_exported_symbol=no]) - LDFLAGS="$save_LDFLAGS"]) - if test "$lt_cv_irix_exported_symbol" = yes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + ) + LDFLAGS="$save_LDFLAGS" else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -5288,7 +4876,7 @@ _LT_EOF _LT_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -5341,17 +4929,17 @@ _LT_EOF _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -5361,13 +4949,13 @@ _LT_EOF osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -5380,9 +4968,9 @@ _LT_EOF _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -5558,38 +5146,36 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - AC_CACHE_CHECK([whether -lc should be explicitly linked in], - [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), - [$RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - ]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi @@ -5654,6 +5240,8 @@ _LT_TAGDECL([], [inherit_rpath], [0], to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], @@ -5664,8 +5252,6 @@ _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) -_LT_TAGDECL([], [postlink_cmds], [2], - [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented @@ -5755,15 +5341,14 @@ CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG -# _LT_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a C++ compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_CXX_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl +# _LT_PROG_CXX +# ------------ +# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ +# compiler, we have our own version here. +m4_defun([_LT_PROG_CXX], +[ +pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) +AC_PROG_CXX if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then @@ -5771,6 +5356,22 @@ if test -n "$CXX" && ( test "X$CXX" != "Xno" && else _lt_caught_CXX_error=yes fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_CXX + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_CXX], []) + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[AC_REQUIRE([_LT_PROG_CXX])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no @@ -5792,8 +5393,6 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -5825,7 +5424,6 @@ if test "$_lt_caught_CXX_error" != yes; then # Allow CC to be a program name with arguments. lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -5843,7 +5441,6 @@ if test "$_lt_caught_CXX_error" != yes; then fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -5865,8 +5462,8 @@ if test "$_lt_caught_CXX_error" != yes; then # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5898,7 +5495,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no @@ -6007,10 +5604,10 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. - _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -6019,19 +5616,14 @@ if test "$_lt_caught_CXX_error" != yes; then else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -6061,75 +5653,28 @@ if test "$_lt_caught_CXX_error" != yes; then ;; cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; @@ -6171,11 +5716,6 @@ if test "$_lt_caught_CXX_error" != yes; then gnu*) ;; - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: @@ -6200,11 +5740,11 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -6265,7 +5805,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then @@ -6275,10 +5815,10 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -6308,7 +5848,7 @@ if test "$_lt_caught_CXX_error" != yes; then case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -6319,9 +5859,9 @@ if test "$_lt_caught_CXX_error" != yes; then *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -6350,7 +5890,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -6387,26 +5927,26 @@ if test "$_lt_caught_CXX_error" != yes; then pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 and above use weak symbols + *) # Version 6 will use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -6414,7 +5954,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -6433,9 +5973,9 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; - xl* | mpixl* | bgxl*) + xl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -6455,13 +5995,13 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='func_echo_all' + output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6530,7 +6070,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6565,15 +6105,15 @@ if test "$_lt_caught_CXX_error" != yes; then case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; @@ -6589,17 +6129,17 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -6609,7 +6149,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -6645,7 +6185,7 @@ if test "$_lt_caught_CXX_error" != yes; then solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -6666,7 +6206,7 @@ if test "$_lt_caught_CXX_error" != yes; then esac _LT_TAGVAR(link_all_deplibs, $1)=yes - output_verbose_link_cmd='func_echo_all' + output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6686,14 +6226,14 @@ if test "$_lt_caught_CXX_error" != yes; then if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -6704,7 +6244,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' @@ -6758,10 +6298,6 @@ if test "$_lt_caught_CXX_error" != yes; then CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" - _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -6817,7 +6353,6 @@ if test "$_lt_caught_CXX_error" != yes; then fi # test -n "$compiler" CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -6832,29 +6367,6 @@ AC_LANG_POP ])# _LT_LANG_CXX_CONFIG -# _LT_FUNC_STRIPNAME_CNF -# ---------------------- -# func_stripname_cnf prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# -# This function is identical to the (non-XSI) version of func_stripname, -# except this one can be used by m4 code that may be executed by configure, -# rather than the libtool script. -m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl -AC_REQUIRE([_LT_DECL_SED]) -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) -func_stripname_cnf () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname_cnf -])# _LT_FUNC_STRIPNAME_CNF - # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -6863,7 +6375,6 @@ func_stripname_cnf () # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl -AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= @@ -6914,13 +6425,6 @@ public class foo { }; _LT_EOF ]) - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -esac - dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then @@ -6932,7 +6436,7 @@ if AC_TRY_EVAL(ac_compile); then pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in + case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -6941,22 +6445,13 @@ if AC_TRY_EVAL(ac_compile); then test $p = "-R"; then prev=$p continue + else + prev= fi - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) + case $p in + -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -6976,10 +6471,8 @@ if AC_TRY_EVAL(ac_compile); then _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi - prev= ;; - *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -7015,7 +6508,6 @@ else fi $RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], @@ -7052,7 +6544,7 @@ linux*) solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -7096,16 +6588,32 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1], ])# _LT_SYS_HIDDEN_LIBDEPS +# _LT_PROG_F77 +# ------------ +# Since AC_PROG_F77 is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_F77], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) +AC_PROG_F77 +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_F77 + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_F77], []) + + # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], -[AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi +[AC_REQUIRE([_LT_PROG_F77])dnl +AC_LANG_PUSH(Fortran 77) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -7124,8 +6632,6 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -7165,9 +6671,7 @@ if test "$_lt_disable_F77" != yes; then # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} - CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -7221,24 +6725,38 @@ if test "$_lt_disable_F77" != yes; then GCC=$lt_save_GCC CC="$lt_save_CC" - CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG +# _LT_PROG_FC +# ----------- +# Since AC_PROG_FC is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_FC], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) +AC_PROG_FC +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_FC + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_FC], []) + + # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], -[AC_LANG_PUSH(Fortran) - -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi +[AC_REQUIRE([_LT_PROG_FC])dnl +AC_LANG_PUSH(Fortran) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -7257,8 +6775,6 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -7298,9 +6814,7 @@ if test "$_lt_disable_FC" != yes; then # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} - CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu @@ -7356,8 +6870,7 @@ if test "$_lt_disable_FC" != yes; then fi # test -n "$compiler" GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS + CC="$lt_save_CC" fi # test "$_lt_disable_FC" != yes AC_LANG_POP @@ -7394,12 +6907,10 @@ _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS +lt_save_CC="$CC" lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} -CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" @@ -7409,8 +6920,6 @@ _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) @@ -7426,8 +6935,7 @@ fi AC_LANG_RESTORE GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS +CC="$lt_save_CC" ])# _LT_LANG_GCJ_CONFIG @@ -7462,11 +6970,9 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" -lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} -CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -7479,8 +6985,7 @@ fi GCC=$lt_save_GCC AC_LANG_RESTORE -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS +CC="$lt_save_CC" ])# _LT_LANG_RC_CONFIG @@ -7539,15 +7044,6 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) -# _LT_DECL_DLLTOOL -# ---------------- -# Ensure DLLTOOL variable is set. -m4_defun([_LT_DECL_DLLTOOL], -[AC_CHECK_TOOL(DLLTOOL, dlltool, false) -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) -AC_SUBST([DLLTOOL]) -]) # _LT_DECL_SED # ------------ @@ -7639,8 +7135,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES], # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -7679,177 +7175,222 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES -# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) -# ------------------------------------------------------ -# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and -# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. -m4_defun([_LT_PROG_FUNCTION_REPLACE], -[dnl { -sed -e '/^$1 ()$/,/^} # $1 /c\ -$1 ()\ -{\ -m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) -} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: -]) +# _LT_PROG_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} -# _LT_PROG_REPLACE_SHELLFNS -# ------------------------- -# Replace existing portable implementations of several shell functions with -# equivalent extended shell implementations where those features are available.. -m4_defun([_LT_PROG_REPLACE_SHELLFNS], -[if test x"$xsi_shell" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}"]) +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} - _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"}]) +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} - _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl - func_split_long_opt_name=${1%%=*} - func_split_long_opt_arg=${1#*=}]) +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} - _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $[*] )) +} - _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac]) +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} - _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" - _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} - _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) -fi +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} -if test x"$lt_shell_append" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) +dnl func_dirname_and_basename +dnl A portable version of this function is already defined in general.m4sh +dnl so there is no need for it here. - _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl - func_quote_for_eval "${2}" -dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ - eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' -if test x"$_lt_function_replace_fail" = x":"; then - AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) -fi -]) +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} -# _LT_PATH_CONVERSION_FUNCTIONS -# ----------------------------- -# Determine which file name conversion functions should be used by -# func_to_host_file (and, implicitly, by func_to_host_path). These are needed -# for certain cross-compile configurations and native mingw. -m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_MSG_CHECKING([how to convert $build file names to $host format]) -AC_CACHE_VAL(lt_cv_to_host_file_cmd, -[case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$[@]"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF esac -]) -to_host_file_cmd=$lt_cv_to_host_file_cmd -AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) -_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], - [0], [convert $build file names to $host format])dnl - -AC_MSG_CHECKING([how to convert $build file names to toolchain format]) -AC_CACHE_VAL(lt_cv_to_tool_file_cmd, -[#assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF ;; -esac + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} + +_LT_EOF + ;; + esac ]) -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) -_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], - [0], [convert $build files to toolchain format])dnl -])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 7 ltoptions.m4 +# serial 6 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -7964,7 +7505,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) @@ -7972,13 +7513,13 @@ case $host in esac test -z "$AS" && AS=as -_LT_DECL([], [AS], [1], [Assembler program])dnl +_LT_DECL([], [AS], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl +_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], @@ -8336,31 +7877,31 @@ m4_define([lt_dict_filter], # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# @configure_input@ +# Generated from ltversion.in. -# serial 3293 ltversion.m4 +# serial 3017 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4]) -m4_define([LT_PACKAGE_REVISION], [1.3293]) +m4_define([LT_PACKAGE_VERSION], [2.2.6b]) +m4_define([LT_PACKAGE_REVISION], [1.3017]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4' -macro_revision='1.3293' +[macro_version='2.2.6b' +macro_revision='1.3017' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 5 lt~obsolete.m4 +# serial 4 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # @@ -8430,6 +7971,7 @@ m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) @@ -8442,13 +7984,6 @@ m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) -m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) -m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) -m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) -m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) -m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) -m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # @@ -9206,7 +8741,7 @@ AC_DEFUN([AM_PATH_PYTHON], dnl Find a Python interpreter. Python versions prior to 2.0 are not dnl supported. (2.0 was released on October 16, 2000). m4_define_default([_AM_PYTHON_INTERPRETER_LIST], - [python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 dnl + [python python2 python3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 dnl python2.1 python2.0]) m4_if([$1],[],[ diff --git a/autom4te.cache/output.0 b/autom4te.cache/output.0 index 965332b..2de1609 100644 --- a/autom4te.cache/output.0 +++ b/autom4te.cache/output.0 @@ -1,6 +1,6 @@ @%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. -@%:@ Generated by GNU Autoconf 2.68 for mathgl 1.11.2. +@%:@ Generated by GNU Autoconf 2.67 for mathgl 2.0. @%:@ @%:@ Report bugs to . @%:@ @@ -91,7 +91,6 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -as_myself= case $0 in @%:@(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -174,14 +173,6 @@ test x\$exitcode = x0 || exit 1" as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 - - test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes @@ -225,18 +216,11 @@ IFS=$as_save_IFS # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - case $- in @%:@ (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -544,8 +528,155 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + as_awk_strverscmp=' # Use only awk features that work with 7th edition Unix awk (1978). # My, what an old awk you have, Mr. Solaris! @@ -630,12 +761,12 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='mathgl' PACKAGE_TARNAME='mathgl' -PACKAGE_VERSION='1.11.2' -PACKAGE_STRING='mathgl 1.11.2' +PACKAGE_VERSION='2.0' +PACKAGE_STRING='mathgl 2.0' PACKAGE_BUGREPORT='mathgl.abalakin@gmail.com' PACKAGE_URL='' -ac_unique_file="mgl" +ac_unique_file="src" # Factoring default headers for most tests. ac_includes_default="\ #include @@ -677,10 +808,6 @@ am__EXEEXT_TRUE LTLIBOBJS LIB@&t@OBJS AM_CXXFLAGS -USE_DOCS_FALSE -USE_DOCS_TRUE -USE_TESTIO_FALSE -USE_TESTIO_TRUE USE_OCTAVE_FALSE USE_OCTAVE_TRUE OCTAVE_INCFLAGS @@ -717,10 +844,6 @@ RCC UIC MOC QMAKE -USE_WX_FALSE -USE_WX_TRUE -WX_LIBS -WX_FLAGS USE_FLTK_FALSE USE_FLTK_TRUE FLTK_LIBS @@ -735,10 +858,6 @@ USE_JPEG_TRUE JPEG_LIBS JPEG_FLAGS PNG_LIBS -USE_GIF_FALSE -USE_GIF_TRUE -GIF_LIBS -GIF_FLAGS USE_HDF4_FALSE USE_HDF4_TRUE HDF4_LIBS @@ -749,8 +868,6 @@ HDF5_LIBS HDF5_FLAGS USE_GLUT_FALSE USE_GLUT_TRUE -GLUT_FLAGS -GLUT_LIBS GL_LIBS USE_GSL_FALSE USE_GSL_TRUE @@ -767,9 +884,8 @@ OTOOL LIPO NMEDIT DSYMUTIL -MANIFEST_TOOL +lt_ECHO RANLIB -ac_ct_AR AR LN_S NM @@ -888,29 +1004,23 @@ enable_static with_pic enable_fast_install with_gnu_ld -with_sysroot enable_libtool_lock enable_double enable_all enable_langall enable_pthread enable_gsl -enable_glut enable_hdf5 enable_hdf5_18 enable_hdf4 -enable_gif enable_jpeg enable_u3d enable_pdf enable_fltk -enable_wx enable_qt with_qt enable_python enable_octave -enable_testio -enable_docs ' ac_precious_vars='build_alias host_alias @@ -1330,7 +1440,7 @@ Try \`$0 --help' for more information" $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac @@ -1468,7 +1578,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures mathgl 1.11.2 to adapt to many kinds of systems. +\`configure' configures mathgl 2.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1538,7 +1648,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of mathgl 1.11.2:";; + short | recursive ) echo "Configuration of mathgl 2.0:";; esac cat <<\_ACEOF @@ -1558,21 +1668,16 @@ Optional Features: --enable-langall Turn on all language interfaces --enable-pthread Turn on pthread support in MathGL library --enable-gsl Turn on gsl functions - --enable-glut Turn on glut --enable-hdf5 Turn on hdf5 --enable-hdf5_18 Turn on hdf5 version 1.8 --enable-hdf4 Turn on hdf4 - --enable-gif Turn on gif --enable-jpeg Turn on jpeg --enable-u3d Turn on u3d functions --enable-pdf Turn on u3d and pdf functions --enable-fltk Turn on fltk - --enable-wx Turn on wxWidget --enable-qt Turn on Qt --enable-python Turn on interface to python --enable-octave Turn on interface to octave - --enable-testio Turn on testio - --enable-docs Turn on documentation building Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1580,8 +1685,6 @@ Optional Packages: --with-pic try to use only PIC/non-PIC objects @<:@default=use both@:>@ --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). --with-qt Path to Qt @<:@Look in PATH and /usr/local/Trolltech@:>@ Some influential environment variables: @@ -1664,8 +1767,8 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -mathgl configure 1.11.2 -generated by GNU Autoconf 2.68 +mathgl configure 2.0 +generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1711,7 +1814,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_compile @@ -1749,7 +1852,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } @%:@ ac_fn_cxx_try_compile @@ -1795,7 +1898,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_link @@ -1809,7 +1912,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1827,7 +1930,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } @%:@ ac_fn_c_check_header_compile @@ -1863,7 +1966,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_cpp @@ -1905,7 +2008,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_run @@ -1918,7 +2021,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1973,7 +2076,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } @%:@ ac_fn_c_check_func @@ -2009,7 +2112,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } @%:@ ac_fn_cxx_try_cpp @@ -2055,7 +2158,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } @%:@ ac_fn_cxx_try_link @@ -2068,10 +2171,10 @@ fi ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : + if eval "test \"\${$3+set}\"" = set; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -2138,7 +2241,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -2147,15 +2250,15 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } @%:@ ac_fn_cxx_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by mathgl $as_me 1.11.2, which was -generated by GNU Autoconf 2.68. Invocation command line was +It was created by mathgl $as_me 2.0, which was +generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2413,7 +2516,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;} || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi done @@ -2489,7 +2592,7 @@ if $ac_cache_corrupted; then $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2503,7 +2606,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -MGL_RELEASE=1.11.2 +MGL_RELEASE=2.0 @@ -2524,7 +2627,7 @@ for ac_dir in config "$srcdir"/config; do fi done if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -2553,7 +2656,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # (Interfaces removed: CURRENT++, AGE=0, REVISION=0) # (Interfaces added: CURRENT++, AGE++, REVISION=0) # (No interfaces changed: REVISION++) -MGL_CURRENT=5 +MGL_CURRENT=6 MGL_REVISION=0 MGL_AGE=0 @@ -2579,7 +2682,7 @@ am__api_version='1.11' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : +if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2666,11 +2769,11 @@ am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; esac # Do `set' in a subshell so we don't clobber the current shell's @@ -2693,7 +2796,7 @@ if ( # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 +alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file @@ -2703,7 +2806,7 @@ then : else as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 +Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -2756,7 +2859,7 @@ if test "$cross_compiling" != no; then set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : +if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -2796,7 +2899,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -2849,7 +2952,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : + if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2900,7 +3003,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : +if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -2940,7 +3043,7 @@ done $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2982,7 +3085,7 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi @@ -2998,7 +3101,7 @@ fi # Define the identity of the package. PACKAGE='mathgl' - VERSION='1.11.2' + VERSION='2.0' cat >>confdefs.h <<_ACEOF @@ -3049,7 +3152,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3089,7 +3192,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3142,7 +3245,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3182,7 +3285,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3241,7 +3344,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3285,7 +3388,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3340,7 +3443,7 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3455,7 +3558,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3498,7 +3601,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3557,7 +3660,7 @@ $as_echo "$ac_try_echo"; } >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi @@ -3568,7 +3671,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : +if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3609,7 +3712,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -3619,7 +3722,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : +if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3656,7 +3759,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : +if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -3734,7 +3837,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : +if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -3895,7 +3998,7 @@ depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -4034,7 +4137,7 @@ if test -z "$CXX"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : +if test "${ac_cv_prog_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -4078,7 +4181,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -4156,7 +4259,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4193,7 +4296,7 @@ ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : +if test "${ac_cv_prog_cxx_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag @@ -4279,7 +4382,7 @@ depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CXX_dependencies_compiler_type+:} false; then : +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -4406,27 +4509,27 @@ fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : +if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -4444,14 +4547,14 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : +if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi @@ -4459,7 +4562,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -4478,13 +4581,13 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AS+:} false; then : +if test "${ac_cv_prog_AS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then @@ -4524,7 +4627,7 @@ if test -z "$ac_cv_prog_AS"; then set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AS+:} false; then : +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then @@ -4576,7 +4679,7 @@ fi set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then @@ -4616,7 +4719,7 @@ if test -z "$ac_cv_prog_DLLTOOL"; then set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then @@ -4668,7 +4771,7 @@ fi set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -4708,7 +4811,7 @@ if test -z "$ac_cv_prog_OBJDUMP"; then set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -4790,8 +4893,8 @@ esac -macro_version='2.4' -macro_revision='1.3293' +macro_version='2.2.6b' +macro_revision='1.3017' @@ -4807,78 +4910,9 @@ macro_revision='1.3293' ltmain="$ac_aux_dir/ltmain.sh" -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : +if test "${ac_cv_path_SED+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ @@ -4933,7 +4967,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED @@ -4960,7 +4994,7 @@ Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : +if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -5009,7 +5043,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP @@ -5023,7 +5057,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : +if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -5075,7 +5109,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -5090,7 +5124,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : +if test "${ac_cv_path_FGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 @@ -5142,7 +5176,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP @@ -5221,7 +5255,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : +if test "${lt_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -5258,10 +5292,10 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : +if test "${lt_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -5288,7 +5322,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : +if test "${lt_cv_path_NM+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then @@ -5341,17 +5375,14 @@ if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" + if test -n "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then @@ -5389,13 +5420,13 @@ fi fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" + for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then @@ -5444,15 +5475,6 @@ esac fi fi - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -5467,18 +5489,18 @@ test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : +if test "${lt_cv_nm_interface+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) + (eval echo "\"\$as_me:__oline__: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5502,7 +5524,7 @@ fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : $as_echo_n "(cached) " >&6 else i=0 @@ -5535,11 +5557,6 @@ else lt_cv_sys_max_cmd_len=8192; ;; - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -5604,8 +5621,8 @@ else # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -5647,8 +5664,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -5697,83 +5714,9 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac - -fi - -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac - -fi - -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : +if test "${lt_cv_ld_reload_flag+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' @@ -5787,11 +5730,6 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -5814,7 +5752,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -5854,7 +5792,7 @@ if test -z "$ac_cv_prog_OBJDUMP"; then set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -5910,7 +5848,7 @@ test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : +if test "${lt_cv_deplibs_check_method+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' @@ -5952,18 +5890,16 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc*) +cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -5993,10 +5929,6 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -6005,11 +5937,11 @@ hpux10.20* | hpux11*) lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -6035,7 +5967,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else @@ -6112,21 +6044,6 @@ esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac -fi - file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -6140,28 +6057,18 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - - - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : +if test "${ac_cv_prog_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6170,7 +6077,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6180,10 +6087,10 @@ IFS=$as_save_IFS fi fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6191,17 +6098,17 @@ fi fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6210,7 +6117,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" + ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6220,17 +6127,17 @@ IFS=$as_save_IFS fi fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" + if test "x$ac_ct_AR" = x; then + AR="false" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6238,51 +6145,18 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - DLLTOOL=$ac_ct_DLLTOOL + AR=$ac_ct_AR fi else - DLLTOOL="$ac_cv_prog_DLLTOOL" + AR="$ac_cv_prog_AR" fi -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + @@ -6290,19 +6164,16 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : +if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6311,7 +6182,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6321,179 +6192,10 @@ IFS=$as_save_IFS fi fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -: ${AR=ar} -: ${AR_FLAGS=cru} - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6507,7 +6209,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -6566,7 +6268,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : +if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -6606,7 +6308,7 @@ if test -z "$ac_cv_prog_RANLIB"; then set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -6677,18 +6379,6 @@ if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - @@ -6735,7 +6425,7 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -6796,8 +6486,8 @@ esac lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -6833,7 +6523,6 @@ for ac_symprfx in "" "_"; do else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -6859,8 +6548,8 @@ _LT_EOF test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then @@ -6875,18 +6564,6 @@ _LT_EOF if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT@&t@_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT@&t@_DLSYM_CONST -#else -# define LT@&t@_DLSYM_CONST const -#endif - #ifdef __cplusplus extern "C" { #endif @@ -6898,7 +6575,7 @@ _LT_EOF cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -LT@&t@_DLSYM_CONST struct { +const struct { const char *name; void *address; } @@ -6924,8 +6601,8 @@ static const void *lt_preloaded_setup() { _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 @@ -6935,8 +6612,8 @@ _LT_EOF test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi @@ -6973,13 +6650,6 @@ else $as_echo "ok" >&6; } fi -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - @@ -7000,48 +6670,6 @@ fi - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } - -@%:@ Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; -else - with_sysroot=no -fi - - -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } - - - - @%:@ Check whether --enable-libtool-lock was given. @@ -7075,7 +6703,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext + echo '#line __oline__ "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7169,7 +6797,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : +if test "${lt_cv_cc_needs_belf+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_ext=c @@ -7237,123 +6865,6 @@ esac need_locks="$enable_libtool_lock" -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi - -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi - - - - - case $host_os in rhapsody* | darwin*) @@ -7362,7 +6873,7 @@ fi set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then @@ -7402,7 +6913,7 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then @@ -7454,7 +6965,7 @@ fi set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : +if test "${ac_cv_prog_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then @@ -7494,7 +7005,7 @@ if test -z "$ac_cv_prog_NMEDIT"; then set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then @@ -7546,7 +7057,7 @@ fi set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : +if test "${ac_cv_prog_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then @@ -7586,7 +7097,7 @@ if test -z "$ac_cv_prog_LIPO"; then set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then @@ -7638,7 +7149,7 @@ fi set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : +if test "${ac_cv_prog_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then @@ -7678,7 +7189,7 @@ if test -z "$ac_cv_prog_OTOOL"; then set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then @@ -7730,7 +7241,7 @@ fi set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : +if test "${ac_cv_prog_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then @@ -7770,7 +7281,7 @@ if test -z "$ac_cv_prog_OTOOL64"; then set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then @@ -7845,7 +7356,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no @@ -7874,7 +7385,7 @@ fi $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no @@ -7904,38 +7415,6 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -7963,7 +7442,7 @@ $as_echo "$lt_cv_ld_force_load" >&6; } else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -7983,7 +7462,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : + if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -8099,7 +7578,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c @@ -8111,7 +7590,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : +if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8202,64 +7681,579 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h - + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.i conftest.$ac_ext -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include _ACEOF - +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.i conftest.$ac_ext done - - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_DLFCN_H 1 -_ACEOF - +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +_lt_caught_CXX_error=yes; } fi -done - - +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -func_stripname_cnf () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname_cnf +else + _lt_caught_CXX_error=yes +fi @@ -8390,7 +8384,6 @@ LIBTOOL_DEPS="$ltmain" LIBTOOL='$(SHELL) $(top_builddir)/libtool' - @@ -8435,7 +8428,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : +if test "${lt_cv_objdir+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null @@ -8463,6 +8456,19 @@ _ACEOF + + + + + + + + + + + + + case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some @@ -8475,6 +8481,23 @@ aix3*) ;; esac +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + # Global variables: ofile=libtool can_build_shared=yes @@ -8503,7 +8526,7 @@ for cc_temp in $compiler""; do *) break;; esac done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it @@ -8513,7 +8536,7 @@ file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -8579,7 +8602,7 @@ if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -8712,16 +8735,11 @@ if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac + lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no @@ -8737,15 +8755,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes @@ -8774,6 +8792,8 @@ fi lt_prog_compiler_pic= lt_prog_compiler_static= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -8821,12 +8841,6 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-fno-common' ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -8869,13 +8883,6 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-fPIC' ;; esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - lt_prog_compiler_pic='-Xcompiler -fPIC' - ;; - esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -8938,13 +8945,7 @@ lt_prog_compiler_static= lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' @@ -8956,26 +8957,26 @@ lt_prog_compiler_static= # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; esac ;; esac @@ -9006,7 +9007,7 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; @@ -9063,17 +9064,13 @@ case $host_os in lt_prog_compiler_pic="$lt_prog_compiler_pic@&t@ -DPIC" ;; esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. @@ -9081,7 +9078,7 @@ lt_prog_compiler_pic=$lt_cv_prog_compiler_pic if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no @@ -9097,15 +9094,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes @@ -9134,18 +9131,13 @@ fi - - - - - # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no @@ -9158,7 +9150,7 @@ else if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes @@ -9188,7 +9180,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -9207,16 +9199,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -9243,7 +9235,7 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -9262,16 +9254,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -9381,36 +9373,13 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie openbsd*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu) + link_all_deplibs=no + ;; esac ld_shlibs=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -9444,12 +9413,11 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.19, is reported +*** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. _LT_EOF fi @@ -9485,12 +9453,10 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -9508,11 +9474,6 @@ _LT_EOF fi ;; - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no @@ -9538,16 +9499,15 @@ _LT_EOF if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag=' $pic_flag' + tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -9558,17 +9518,13 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -9584,17 +9540,17 @@ _LT_EOF fi case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) + xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -9603,13 +9559,13 @@ _LT_EOF fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -9627,8 +9583,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9674,8 +9630,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9715,10 +9671,8 @@ _LT_EOF else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -9780,6 +9734,7 @@ _LT_EOF if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi + link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then @@ -9805,13 +9760,7 @@ _LT_EOF allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9824,32 +9773,25 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' @@ -9858,13 +9800,7 @@ fi else # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9877,42 +9813,30 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -9944,63 +9868,20 @@ fi # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) @@ -10010,11 +9891,7 @@ fi hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - whole_archive_flag_spec='' - fi + whole_archive_flag_spec='' link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in @@ -10022,7 +9899,7 @@ fi *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -10065,7 +9942,7 @@ fi # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no @@ -10073,7 +9950,7 @@ fi hpux9*) if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -10088,8 +9965,8 @@ fi ;; hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -10107,16 +9984,16 @@ fi ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -10128,46 +10005,7 @@ fi archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } - -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi @@ -10195,39 +10033,26 @@ fi irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int foo (void) { return 0; } +int foo(void) {} _ACEOF if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi + LDFLAGS="$save_LDFLAGS" else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -10236,7 +10061,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } link_all_deplibs=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -10289,17 +10114,17 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -10309,13 +10134,13 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -10328,9 +10153,9 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -10518,50 +10343,44 @@ x|xyes) # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 +$as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi @@ -10732,23 +10551,16 @@ if test "$GCC" = yes; then darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -10761,7 +10573,7 @@ if test "$GCC" = yes; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -10781,13 +10593,7 @@ BEGIN {RS=" "; FS="/|\n";} { if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi @@ -10875,7 +10681,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -10906,9 +10712,8 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$cc_basename in - yes,*) - # gcc + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -10929,83 +10734,36 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' ;; *) - # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' ;; esac + dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -11092,19 +10850,6 @@ gnu*) hardcode_into_libs=yes ;; -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -11147,10 +10892,8 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 ;; interix[3-9]*) @@ -11217,17 +10960,12 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -11240,31 +10978,23 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -11276,6 +11006,18 @@ fi dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -11560,11 +11302,6 @@ fi - - - - - @@ -11643,7 +11380,7 @@ else # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11677,7 +11414,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -11691,12 +11428,12 @@ fi *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : +if test "x$ac_cv_func_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11730,16 +11467,16 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : +if test "x$ac_cv_func_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11773,12 +11510,12 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11812,12 +11549,12 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11851,7 +11588,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi @@ -11892,7 +11629,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : +if test "${lt_cv_dlopen_self+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -11901,7 +11638,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" +#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11942,13 +11679,7 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } +void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -11957,11 +11688,7 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else @@ -11998,7 +11725,7 @@ $as_echo "$lt_cv_dlopen_self" >&6; } wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : +if test "${lt_cv_dlopen_self_static+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -12007,7 +11734,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" +#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12048,13 +11775,7 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } +void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -12063,11 +11784,7 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else @@ -12224,146 +11941,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC="$lt_save_CC" - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@ifdef __STDC__ -@%:@ include -@%:@else -@%:@ include -@%:@endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@ifdef __STDC__ -@%:@ include -@%:@else -@%:@ include -@%:@endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -else - _lt_caught_CXX_error=yes -fi - + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -12389,8 +11967,6 @@ module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds -reload_flag_CXX=$reload_flag -reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no @@ -12446,7 +12022,6 @@ $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -12464,7 +12039,6 @@ $RM -r conftest* fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do @@ -12475,7 +12049,7 @@ $RM -r conftest* *) break;; esac done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` if test -n "$compiler"; then @@ -12538,7 +12112,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : +if test "${lt_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -12575,10 +12149,10 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : +if test "${lt_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -12604,8 +12178,8 @@ with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -12637,7 +12211,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no @@ -12747,13 +12321,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12766,33 +12334,26 @@ main () _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__CXX -fi +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' @@ -12801,13 +12362,7 @@ fi else # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12820,42 +12375,30 @@ main () _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__CXX -fi +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - fi + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -12885,75 +12428,28 @@ fi ;; cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_CXX=' ' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=yes - file_list_spec_CXX='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' - enable_shared_with_static_runtimes_CXX=yes - # Don't use ranlib - old_postinstall_cmds_CXX='chmod 644 $oldlib' - postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; - esac - ;; + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; darwin* | rhapsody*) @@ -12961,11 +12457,7 @@ fi hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - whole_archive_flag_spec_CXX='' - fi + whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in @@ -12973,7 +12465,7 @@ fi *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -13026,11 +12518,6 @@ fi gnu*) ;; - haiku*) - archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs_CXX=yes - ;; - hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: @@ -13055,11 +12542,11 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -13120,7 +12607,7 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then @@ -13130,10 +12617,10 @@ fi archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -13163,7 +12650,7 @@ fi case $cc_basename in CC*) # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -13174,9 +12661,9 @@ fi *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi link_all_deplibs_CXX=yes @@ -13205,7 +12692,7 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -13242,26 +12729,26 @@ fi pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + *pgCC\ [1-5]* | *pgcpp\ [1-5]*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 and above use weak symbols + *) # Version 6 will use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -13269,7 +12756,7 @@ fi hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -13288,9 +12775,9 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; - xl* | mpixl* | bgxl*) + xl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -13310,13 +12797,13 @@ fi archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='func_echo_all' + output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -13385,7 +12872,7 @@ fi export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo else ld_shlibs_CXX=no fi @@ -13420,15 +12907,15 @@ fi case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; @@ -13444,17 +12931,17 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -13464,7 +12951,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -13500,7 +12987,7 @@ fi solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' @@ -13521,7 +13008,7 @@ fi esac link_all_deplibs_CXX=yes - output_verbose_link_cmd='func_echo_all' + output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -13541,14 +13028,14 @@ fi if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -13559,7 +13046,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' @@ -13613,10 +13100,6 @@ fi CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ - '"$old_archive_cmds_CXX" - reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ - '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -13678,13 +13161,6 @@ private: }; _LT_EOF - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -esac - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -13698,7 +13174,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in + case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -13707,22 +13183,13 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 test $p = "-R"; then prev=$p continue + else + prev= fi - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) + case $p in + -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -13742,10 +13209,8 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi - prev= ;; - *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -13781,7 +13246,6 @@ else fi $RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in @@ -13817,7 +13281,7 @@ linux*) solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -13882,6 +13346,8 @@ fi lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -13931,11 +13397,6 @@ lt_prog_compiler_static_CXX= # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static_CXX= - ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -13985,11 +13446,6 @@ lt_prog_compiler_static_CXX= ;; esac ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; dgux*) case $cc_basename in ec++*) @@ -14079,8 +13535,8 @@ lt_prog_compiler_static_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; - xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene + xlc* | xlC*) + # IBM XL 8.0 on PPC lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' @@ -14110,7 +13566,7 @@ lt_prog_compiler_static_CXX= ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -14142,7 +13598,7 @@ lt_prog_compiler_static_CXX= ;; solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' @@ -14207,17 +13663,10 @@ case $host_os in lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX@&t@ -DPIC" ;; esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_prog_compiler_pic_CXX" >&6; } + -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } -lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. @@ -14225,7 +13674,7 @@ lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } -if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : +if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no @@ -14241,15 +13690,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes @@ -14275,15 +13724,13 @@ fi - - # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : +if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no @@ -14296,7 +13743,7 @@ else if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes @@ -14323,7 +13770,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no @@ -14342,16 +13789,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes @@ -14375,7 +13822,7 @@ $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no @@ -14394,16 +13841,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes @@ -14454,35 +13901,30 @@ fi $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - ;; - esac - ;; + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + linux* | k*bsd*-gnu) + link_all_deplibs_CXX=no + ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } @@ -14514,50 +13956,44 @@ x|xyes) # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc_CXX=no - else - lt_cv_archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } - archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_CXX" >&5 +$as_echo "$archive_cmds_need_lc_CXX" >&6; } ;; esac fi @@ -14714,7 +14150,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -14745,9 +14181,8 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$cc_basename in - yes,*) - # gcc + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -14768,82 +14203,36 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' ;; *) - # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' ;; esac + dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -14929,19 +14318,6 @@ gnu*) hardcode_into_libs=yes ;; -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -14984,10 +14360,8 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 ;; interix[3-9]*) @@ -15054,17 +14428,12 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -15077,31 +14446,23 @@ main () _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -15113,6 +14474,18 @@ fi dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -15349,8 +14722,6 @@ fi - - @@ -15401,7 +14772,6 @@ fi fi # test -n "$compiler" CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -15444,7 +14814,7 @@ if test "${enable_double+set}" = set; then : enableval=$enable_double; case "${enableval}" in yes) double=true ;; no) double=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-double" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-double" "$LINENO" 5 ;; esac else double=false @@ -15466,7 +14836,7 @@ if test "${enable_all+set}" = set; then : enableval=$enable_all; case "${enableval}" in yes) all=true ;; no) all=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-all" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-all" "$LINENO" 5 ;; esac else all=false @@ -15478,7 +14848,7 @@ if test "${enable_langall+set}" = set; then : enableval=$enable_langall; case "${enableval}" in yes) langall=true ;; no) langall=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-langall" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-langall" "$LINENO" 5 ;; esac else langall=false @@ -15490,7 +14860,7 @@ if test "${enable_pthread+set}" = set; then : enableval=$enable_pthread; case "${enableval}" in yes) pthread=true ;; no) pthread=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-pthread" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-pthread" "$LINENO" 5 ;; esac else pthread=true @@ -15498,7 +14868,7 @@ fi ac_fn_cxx_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : +if test "x$ac_cv_header_pthread_h" = x""yes; then : (test x$all = xtrue || test x$pthread = xtrue) && PTHREAD_FLAGS=-DHAVE_PTHREAD else (test x$all = xtrue || test x$pthread = xtrue) && echo "Please install posix threads headers" && exit @@ -15508,7 +14878,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5 $as_echo_n "checking for main in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_main+:} false; then : +if test "${ac_cv_lib_pthread_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15536,7 +14906,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_main" >&5 $as_echo "$ac_cv_lib_pthread_main" >&6; } -if test "x$ac_cv_lib_pthread_main" = xyes; then : +if test "x$ac_cv_lib_pthread_main" = x""yes; then : (test x$all = xtrue || test x$pthread = xtrue) && PTHREAD_LIBS=-lpthread else (test x$all = xtrue || test x$pthread = xtrue) && echo "Please install posix threads library" && exit @@ -15556,7 +14926,7 @@ if test "${enable_gsl+set}" = set; then : enableval=$enable_gsl; case "${enableval}" in yes) gsl=true ;; no) gsl=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-gsl" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-gsl" "$LINENO" 5 ;; esac else gsl=true @@ -15569,7 +14939,7 @@ if (test x$all = xtrue || test x$gsl = xtrue) ;then set dummy $GSL_PROG; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GSL_FLAGS+:} false; then : +if test "${ac_cv_prog_GSL_FLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$GSL_FLAGS"; then @@ -15606,7 +14976,7 @@ fi set dummy $GSL_PROG; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GSL_LIBS+:} false; then : +if test "${ac_cv_prog_GSL_LIBS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$GSL_LIBS"; then @@ -15659,32 +15029,16 @@ else fi -@%:@ Check whether --enable-glut was given. -if test "${enable_glut+set}" = set; then : - enableval=$enable_glut; case "${enableval}" in - yes) glut=true ;; - no) glut=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-glut" "$LINENO" 5 ;; -esac -else - glut=false -fi - - case "${host}" in *darwin*) GL_LIBS="-framework OpenGL" - if (test x$all = xtrue || test x$glut = xtrue) ;then - GLUT_LIBS="-framework GLUT -framework OpenGL" - - fi ;; *w32*) GL_LIBS=opengl32 ac_fn_cxx_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_gl_h" = xyes; then : +if test "x$ac_cv_header_GL_gl_h" = x""yes; then : else echo "Please install OpenGL headers (GL/gl.h)"; exit @@ -15694,7 +15048,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_${GL_LIBS}''_main" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${GL_LIBS}" >&5 $as_echo_n "checking for main in -l${GL_LIBS}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : +if eval "test \"\${$as_ac_Lib+set}\"" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15729,59 +15083,12 @@ else echo "Please install OpenGL library (lib${GL_LIBS}.a)"; exit fi - GLUT_LIBS=glut32 - ac_fn_cxx_check_header_mongrel "$LINENO" "GL/glut.h" "ac_cv_header_GL_glut_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_glut_h" = xyes; then : - (test x$all = xtrue || test x$glut = xtrue) && GLUT_FLAGS=-DHAVE_GLUT -else - (test x$all = xtrue || test x$glut = xtrue) && (echo "Please install FreeGLUT headers (GL/glut.h)" && exit) -fi - - - as_ac_Lib=`$as_echo "ac_cv_lib_${GLUT_LIBS}''_main" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${GLUT_LIBS}" >&5 -$as_echo_n "checking for main in -l${GLUT_LIBS}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l${GLUT_LIBS} $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - (test x$all = xtrue || test x$glut = xtrue) && GLUT_LIBS=-l${GLUT_LIBS} -else - (test x$all = xtrue || test x$glut = xtrue) && echo "Please install FreeGLUT library (lib${GLUT_LIBS}.a)" && exit -fi - ;; *) GL_LIBS=GL ac_fn_cxx_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_gl_h" = xyes; then : +if test "x$ac_cv_header_GL_gl_h" = x""yes; then : else echo "Please install OpenGL headers (GL/gl.h)"; exit @@ -15791,7 +15098,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_${GL_LIBS}''_main" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${GL_LIBS}" >&5 $as_echo_n "checking for main in -l${GL_LIBS}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : +if eval "test \"\${$as_ac_Lib+set}\"" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15826,53 +15133,6 @@ else echo "Please install OpenGL library (lib${GL_LIBS}.a)"; exit fi - GLUT_LIBS=glut - ac_fn_cxx_check_header_mongrel "$LINENO" "GL/glut.h" "ac_cv_header_GL_glut_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_glut_h" = xyes; then : - (test x$all = xtrue || test x$glut = xtrue) && GLUT_FLAGS=-DHAVE_GLUT -else - (test x$all = xtrue || test x$glut = xtrue) && (echo "Please install FreeGLUT headers (GL/glut.h)" && exit) -fi - - - as_ac_Lib=`$as_echo "ac_cv_lib_${GLUT_LIBS}''_main" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${GLUT_LIBS}" >&5 -$as_echo_n "checking for main in -l${GLUT_LIBS}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l${GLUT_LIBS} $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - (test x$all = xtrue || test x$glut = xtrue) && GLUT_LIBS=-l${GLUT_LIBS} -else - (test x$all = xtrue || test x$glut = xtrue) && echo "Please install FreeGLUT library (lib${GLUT_LIBS}.a)" && exit -fi - ;; esac @@ -15899,7 +15159,7 @@ if test "${enable_hdf5+set}" = set; then : enableval=$enable_hdf5; case "${enableval}" in yes) hdf5=true ;; no) hdf5=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-hdf5" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-hdf5" "$LINENO" 5 ;; esac else hdf5=false @@ -15910,7 +15170,7 @@ if test "${enable_hdf5_18+set}" = set; then : enableval=$enable_hdf5_18; case "${enableval}" in yes) hdf5_18=true ;; no) hdf5_18=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-hdf5_18" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-hdf5_18" "$LINENO" 5 ;; esac else hdf5_18=false @@ -15918,7 +15178,7 @@ fi #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_fn_cxx_check_header_mongrel "$LINENO" "hdf5.h" "ac_cv_header_hdf5_h" "$ac_includes_default" -if test "x$ac_cv_header_hdf5_h" = xyes; then : +if test "x$ac_cv_header_hdf5_h" = x""yes; then : (test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && HDF5_FLAGS=-DHAVE_HDF5 else (test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && echo "Please install hdf5 headers" && exit @@ -15931,7 +15191,7 @@ if ((test x$all = xtrue || test x$hdf5 = xtrue) && test x$hdf5_18 = xfalse) ;the fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lhdf5" >&5 $as_echo_n "checking for main in -lhdf5... " >&6; } -if ${ac_cv_lib_hdf5_main+:} false; then : +if test "${ac_cv_lib_hdf5_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15959,7 +15219,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdf5_main" >&5 $as_echo "$ac_cv_lib_hdf5_main" >&6; } -if test "x$ac_cv_lib_hdf5_main" = xyes; then : +if test "x$ac_cv_lib_hdf5_main" = x""yes; then : (test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && HDF5_LIBS=-lhdf5 else (test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && echo "Please install hdf5 library" && exit @@ -15980,14 +15240,14 @@ if test "${enable_hdf4+set}" = set; then : enableval=$enable_hdf4; case "${enableval}" in yes) hdf4=true ;; no) hdf4=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-hdf4" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-hdf4" "$LINENO" 5 ;; esac else hdf4=false fi ac_fn_cxx_check_header_mongrel "$LINENO" "hdf/mfhdf.h" "ac_cv_header_hdf_mfhdf_h" "$ac_includes_default" -if test "x$ac_cv_header_hdf_mfhdf_h" = xyes; then : +if test "x$ac_cv_header_hdf_mfhdf_h" = x""yes; then : (test x$all = xtrue || test x$hdf4 = xtrue) && HDF4_FLAGS=-DHAVE_HDF4 else (test x$all = xtrue || test x$hdf4 = xtrue) && echo "Please install hdf4 headers" && exit @@ -15997,7 +15257,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldf" >&5 $as_echo_n "checking for main in -ldf... " >&6; } -if ${ac_cv_lib_df_main+:} false; then : +if test "${ac_cv_lib_df_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16017,96 +15277,31 @@ _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_df_main=yes else - ac_cv_lib_df_main=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_df_main" >&5 -$as_echo "$ac_cv_lib_df_main" >&6; } -if test "x$ac_cv_lib_df_main" = xyes; then : - (test x$all = xtrue || test x$hdf4 = xtrue) && HDF4_LIBS="-lmfhdf -ldf" -else - (test x$all = xtrue || test x$hdf4 = xtrue) && echo "Please install hdf4 library" && exit -fi - - if (test x$all = xtrue || test x$hdf4 = xtrue); then - USE_HDF4_TRUE= - USE_HDF4_FALSE='#' -else - USE_HDF4_TRUE='#' - USE_HDF4_FALSE= -fi - - -@%:@ Check whether --enable-gif was given. -if test "${enable_gif+set}" = set; then : - enableval=$enable_gif; case "${enableval}" in - yes) gif=true ;; - no) gif=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-gif" "$LINENO" 5 ;; -esac -else - gif=false -fi - -ac_fn_cxx_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default" -if test "x$ac_cv_header_gif_lib_h" = xyes; then : - (test x$all = xtrue || test x$gif = xtrue) && GIF_FLAGS=-DHAVE_GIF -else - (test x$all = xtrue || test x$gif = xtrue) && echo "Please install gif headers" && exit -fi - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgif" >&5 -$as_echo_n "checking for main in -lgif... " >&6; } -if ${ac_cv_lib_gif_main+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgif $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_gif_main=yes -else - ac_cv_lib_gif_main=no + ac_cv_lib_df_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_main" >&5 -$as_echo "$ac_cv_lib_gif_main" >&6; } -if test "x$ac_cv_lib_gif_main" = xyes; then : - (test x$all = xtrue || test x$gif = xtrue) && GIF_LIBS=-lgif +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_df_main" >&5 +$as_echo "$ac_cv_lib_df_main" >&6; } +if test "x$ac_cv_lib_df_main" = x""yes; then : + (test x$all = xtrue || test x$hdf4 = xtrue) && HDF4_LIBS="-lmfhdf -ldf" else - (test x$all = xtrue || test x$gif = xtrue) && echo "Please install gif library" && exit + (test x$all = xtrue || test x$hdf4 = xtrue) && echo "Please install hdf4 library" && exit fi - if (test x$all = xtrue || test x$gif = xtrue); then - USE_GIF_TRUE= - USE_GIF_FALSE='#' + if (test x$all = xtrue || test x$hdf4 = xtrue); then + USE_HDF4_TRUE= + USE_HDF4_FALSE='#' else - USE_GIF_TRUE='#' - USE_GIF_FALSE= + USE_HDF4_TRUE='#' + USE_HDF4_FALSE= fi ac_fn_cxx_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" -if test "x$ac_cv_header_png_h" = xyes; then : +if test "x$ac_cv_header_png_h" = x""yes; then : else echo "Please install png headers" && exit @@ -16116,7 +15311,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpng" >&5 $as_echo_n "checking for main in -lpng... " >&6; } -if ${ac_cv_lib_png_main+:} false; then : +if test "${ac_cv_lib_png_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16144,7 +15339,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_main" >&5 $as_echo "$ac_cv_lib_png_main" >&6; } -if test "x$ac_cv_lib_png_main" = xyes; then : +if test "x$ac_cv_lib_png_main" = x""yes; then : PNG_LIBS=-lpng else echo "Please install png library" && exit @@ -16156,14 +15351,14 @@ if test "${enable_jpeg+set}" = set; then : enableval=$enable_jpeg; case "${enableval}" in yes) jpeg=true ;; no) jpeg=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-jpeg" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-jpeg" "$LINENO" 5 ;; esac else jpeg=false fi ac_fn_cxx_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" -if test "x$ac_cv_header_jpeglib_h" = xyes; then : +if test "x$ac_cv_header_jpeglib_h" = x""yes; then : (test x$all = xtrue || test x$jpeg = xtrue) && JPEG_FLAGS=-DHAVE_JPEG else (test x$all = xtrue || test x$jpeg = xtrue) && echo "Please install jpeg headers" && exit @@ -16173,7 +15368,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ljpeg" >&5 $as_echo_n "checking for main in -ljpeg... " >&6; } -if ${ac_cv_lib_jpeg_main+:} false; then : +if test "${ac_cv_lib_jpeg_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16201,7 +15396,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_main" >&5 $as_echo "$ac_cv_lib_jpeg_main" >&6; } -if test "x$ac_cv_lib_jpeg_main" = xyes; then : +if test "x$ac_cv_lib_jpeg_main" = x""yes; then : (test x$all = xtrue || test x$jpeg = xtrue) && JPEG_LIBS=-ljpeg else (test x$all = xtrue || test x$jpeg = xtrue) && echo "Please install jpeg library" && exit @@ -16221,7 +15416,7 @@ if test "${enable_u3d+set}" = set; then : enableval=$enable_u3d; case "${enableval}" in yes) u3d=true ;; no) u3d=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-u3d" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-u3d" "$LINENO" 5 ;; esac else u3d=false @@ -16232,7 +15427,7 @@ if test "${enable_pdf+set}" = set; then : enableval=$enable_pdf; case "${enableval}" in yes) pdf=true; u3d=true ;; no) pdf=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-pdf" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-pdf" "$LINENO" 5 ;; esac else pdf=false @@ -16241,7 +15436,7 @@ fi if test "x$pdf" == xtrue; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lhpdf" >&5 $as_echo_n "checking for main in -lhpdf... " >&6; } -if ${ac_cv_lib_hpdf_main+:} false; then : +if test "${ac_cv_lib_hpdf_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16269,7 +15464,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hpdf_main" >&5 $as_echo "$ac_cv_lib_hpdf_main" >&6; } -if test "x$ac_cv_lib_hpdf_main" = xyes; then : +if test "x$ac_cv_lib_hpdf_main" = x""yes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBHPDF 1 _ACEOF @@ -16279,8 +15474,8 @@ _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "--enable-pdf was given, but test for libharu or libhpdf failed -See \`config.log' for more details" "$LINENO" 5; } +as_fn_error $? "--enable-pdf was given, but test for libharu failed +See \`config.log' for more details" "$LINENO" 5 ; } fi @@ -16289,7 +15484,7 @@ if test "x$pdf" == xtrue; then : for ac_header in hpdf.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "hpdf.h" "ac_cv_header_hpdf_h" "$ac_includes_default" -if test "x$ac_cv_header_hpdf_h" = xyes; then : +if test "x$ac_cv_header_hpdf_h" = x""yes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_HPDF_H 1 _ACEOF @@ -16297,8 +15492,8 @@ _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "--enable-pdf was given, but test for libharu or libhpdf headers failed -See \`config.log' for more details" "$LINENO" 5; } +as_fn_error $? "--enable-pdf was given, but test for headers failed +See \`config.log' for more details" "$LINENO" 5 ; } fi @@ -16317,7 +15512,7 @@ fi if test "x$u3d" == xtrue; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lIDTF" >&5 $as_echo_n "checking for main in -lIDTF... " >&6; } -if ${ac_cv_lib_IDTF_main+:} false; then : +if test "${ac_cv_lib_IDTF_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16345,7 +15540,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_IDTF_main" >&5 $as_echo "$ac_cv_lib_IDTF_main" >&6; } -if test "x$ac_cv_lib_IDTF_main" = xyes; then : +if test "x$ac_cv_lib_IDTF_main" = x""yes; then : U3D_LIBS="-lIDTF -lm -ldl" @@ -16356,7 +15551,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "--enable-u3d was given, but test for libIDTF failed -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi fi @@ -16364,7 +15559,7 @@ if test "x$u3d" == xtrue; then : for ac_header in u3d/SceneConverterLib.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "u3d/SceneConverterLib.h" "ac_cv_header_u3d_SceneConverterLib_h" "$ac_includes_default" -if test "x$ac_cv_header_u3d_SceneConverterLib_h" = xyes; then : +if test "x$ac_cv_header_u3d_SceneConverterLib_h" = x""yes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_U3D_SCENECONVERTERLIB_H 1 _ACEOF @@ -16373,7 +15568,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "--enable-u3d was given, but test for headers failed -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi @@ -16394,7 +15589,7 @@ if test "${enable_fltk+set}" = set; then : enableval=$enable_fltk; case "${enableval}" in yes) fltk=true ;; no) fltk=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-fltk" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-fltk" "$LINENO" 5 ;; esac else fltk=false @@ -16406,7 +15601,7 @@ if (test x$all = xtrue || test x$fltk = xtrue) ;then set dummy $FLTK_PROG; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_FLTK_FLAGS+:} false; then : +if test "${ac_cv_prog_FLTK_FLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$FLTK_FLAGS"; then @@ -16443,7 +15638,7 @@ fi set dummy $FLTK_PROG; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_FLTK_LIBS+:} false; then : +if test "${ac_cv_prog_FLTK_LIBS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$FLTK_LIBS"; then @@ -16493,117 +15688,12 @@ else fi -@%:@ Check whether --enable-wx was given. -if test "${enable_wx+set}" = set; then : - enableval=$enable_wx; case "${enableval}" in - yes) wx=true ;; - no) wx=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-wx" "$LINENO" 5 ;; -esac -else - wx=false -fi - -if (test x$all = xtrue || test x$wx = xtrue) ;then -#if (test x$wx = xtrue) ;then - WX_PROG=wx-config - # Extract the first word of "$WX_PROG", so it can be a program name with args. -set dummy $WX_PROG; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_WX_FLAGS+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$WX_FLAGS"; then - ac_cv_prog_WX_FLAGS="$WX_FLAGS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_WX_FLAGS="`$WX_PROG --cflags`" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -WX_FLAGS=$ac_cv_prog_WX_FLAGS -if test -n "$WX_FLAGS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WX_FLAGS" >&5 -$as_echo "$WX_FLAGS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - # Extract the first word of "$WX_PROG", so it can be a program name with args. -set dummy $WX_PROG; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_WX_LIBS+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$WX_LIBS"; then - ac_cv_prog_WX_LIBS="$WX_LIBS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_WX_LIBS="`$WX_PROG --libs`" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -WX_LIBS=$ac_cv_prog_WX_LIBS -if test -n "$WX_LIBS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WX_LIBS" >&5 -$as_echo "$WX_LIBS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "$WX_FLAGS" && test "$WX_LIBS" ;then - test_wx=true - else - echo "Please install wxwidget headers and libraries and make sure that \ - path to $WX_PROG exist in your PATH" - exit - fi -fi - if test x$test_wx = xtrue; then - USE_WX_TRUE= - USE_WX_FALSE='#' -else - USE_WX_TRUE='#' - USE_WX_FALSE= -fi - - @%:@ Check whether --enable-qt was given. if test "${enable_qt+set}" = set; then : enableval=$enable_qt; case "${enableval}" in yes) qt=true ;; no) qt=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-qt" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-qt" "$LINENO" 5 ;; esac else qt=false @@ -16639,7 +15729,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_QMAKE+:} false; then : +if test "${ac_cv_path_QMAKE+set}" = set; then : $as_echo_n "(cached) " >&6 else case $QMAKE in @@ -16687,7 +15777,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_QMAKE+:} false; then : +if test "${ac_cv_path_QMAKE+set}" = set; then : $as_echo_n "(cached) " >&6 else case $QMAKE in @@ -16729,7 +15819,7 @@ done test -n "$QMAKE" || QMAKE="missing" if test x"$QMAKE" = xmissing; then - as_fn_error $? "Cannot find qmake in your PATH. Try using --with-qt." "$LINENO" 5 + as_fn_error $? "Cannot find qmake in your PATH. Try using --with-qt." "$LINENO" 5 fi fi @@ -16740,7 +15830,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MOC+:} false; then : +if test "${ac_cv_path_MOC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MOC in @@ -16788,7 +15878,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MOC+:} false; then : +if test "${ac_cv_path_MOC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MOC in @@ -16830,7 +15920,7 @@ done test -n "$MOC" || MOC="missing" if test x"$MOC" = xmissing; then - as_fn_error $? "Cannot find moc (Meta Object Compiler) in your PATH. Try using --with-qt." "$LINENO" 5 + as_fn_error $? "Cannot find moc (Meta Object Compiler) in your PATH. Try using --with-qt." "$LINENO" 5 fi fi @@ -16841,7 +15931,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UIC+:} false; then : +if test "${ac_cv_path_UIC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $UIC in @@ -16889,7 +15979,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UIC+:} false; then : +if test "${ac_cv_path_UIC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $UIC in @@ -16931,7 +16021,7 @@ done test -n "$UIC" || UIC="missing" if test x"$UIC" = xmissing; then - as_fn_error $? "Cannot find uic (User Interface Compiler) in your PATH. Try using --with-qt." "$LINENO" 5 + as_fn_error $? "Cannot find uic (User Interface Compiler) in your PATH. Try using --with-qt." "$LINENO" 5 fi fi @@ -16942,7 +16032,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RCC+:} false; then : +if test "${ac_cv_path_RCC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $RCC in @@ -16990,7 +16080,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RCC+:} false; then : +if test "${ac_cv_path_RCC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $RCC in @@ -17042,7 +16132,7 @@ $as_echo "$as_me: WARNING: Cannot find rcc (Qt Resource Compiler) in your PATH. QT_PATH=`dirname "$QMAKE"` fi if test x"$QT_PATH" = x; then - as_fn_error $? "Cannot find the path to your Qt install. Use --with-qt." "$LINENO" 5 + as_fn_error $? "Cannot find the path to your Qt install. Use --with-qt." "$LINENO" 5 fi @@ -17076,7 +16166,7 @@ $as_echo "$as_me: WARNING: Cannot find rcc (Qt Resource Compiler) in your PATH. then : else - as_fn_error $? "Cannot cd to or write in $my_tmpdir" "$LINENO" 5 + as_fn_error $? "Cannot cd to or write in $my_tmpdir" "$LINENO" 5 fi cat >conftest.h <<_ASEOF #include @@ -17115,14 +16205,14 @@ int main() } _ASEOF if $QMAKE -project; then :; else - as_fn_error $? "Calling $QMAKE -project failed." "$LINENO" 5 + as_fn_error $? "Calling $QMAKE -project failed." "$LINENO" 5 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 - as_fn_error $? "Can't find the .pro file generated by Qmake." "$LINENO" 5 + as_fn_error $? "Can't find the .pro file generated by Qmake." "$LINENO" 5 fi @@ -17135,12 +16225,12 @@ _ASEOF sed 's/^/| /' "$pro_file" >&5 if $QMAKE; then :; else - as_fn_error $? "Calling $QMAKE failed." "$LINENO" 5 + as_fn_error $? "Calling $QMAKE failed." "$LINENO" 5 fi # Try to compile a simple Qt app. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can build a simple Qt app" >&5 $as_echo_n "checking whether we can build a simple Qt app... " >&6; } -if ${at_cv_qt_build+:} false; then : +if test "${at_cv_qt_build+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_qt_build=ko @@ -17201,7 +16291,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $at_cv_qt_build" >&5 $as_echo "$at_cv_qt_build" >&6; } if test x"$at_cv_qt_build" = xko; then - as_fn_error $? "Cannot build a test Qt program" "$LINENO" 5 + as_fn_error $? "Cannot build a test Qt program" "$LINENO" 5 fi QT_VERSION_MAJOR=`echo "$at_cv_qt_build" | sed 's/^^0-9*//'` @@ -17227,13 +16317,13 @@ $as_echo "$at_cv_qt_build" >&6; } fi if test -f $at_mfile; then :; else cd "$my_configure_pwd" - as_fn_error $? "Cannot find the Makefile generated by qmake." "$LINENO" 5 + as_fn_error $? "Cannot find the Makefile generated by qmake." "$LINENO" 5 fi # Find the DEFINES of Qt (should have been named CPPFLAGS). { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the DEFINES to use with Qt" >&5 $as_echo_n "checking for the DEFINES to use with Qt... " >&6; } -if ${at_cv_env_QT_DEFINES+:} false; then : +if test "${at_cv_env_QT_DEFINES+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_DEFINES=`sed "/^DEFINES@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile` @@ -17246,7 +16336,7 @@ $as_echo "$at_cv_env_QT_DEFINES" >&6; } # Find the CFLAGS of Qt (We can use Qt in C?!) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the CFLAGS to use with Qt" >&5 $as_echo_n "checking for the CFLAGS to use with Qt... " >&6; } -if ${at_cv_env_QT_CFLAGS+:} false; then : +if test "${at_cv_env_QT_CFLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_CFLAGS=`sed "/^CFLAGS@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile` @@ -17259,7 +16349,7 @@ $as_echo "$at_cv_env_QT_CFLAGS" >&6; } # Find the CXXFLAGS of Qt. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the CXXFLAGS to use with Qt" >&5 $as_echo_n "checking for the CXXFLAGS to use with Qt... " >&6; } -if ${at_cv_env_QT_CXXFLAGS+:} false; then : +if test "${at_cv_env_QT_CXXFLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_CXXFLAGS=`sed "/^CXXFLAGS@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile` @@ -17272,7 +16362,7 @@ $as_echo "$at_cv_env_QT_CXXFLAGS" >&6; } # Find the INCPATH of Qt. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the INCPATH to use with Qt" >&5 $as_echo_n "checking for the INCPATH to use with Qt... " >&6; } -if ${at_cv_env_QT_INCPATH+:} false; then : +if test "${at_cv_env_QT_INCPATH+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_INCPATH=`sed "/^INCPATH@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile` @@ -17288,7 +16378,7 @@ $as_echo "$at_cv_env_QT_INCPATH" >&6; } # Find the LFLAGS of Qt (Should have been named LDFLAGS) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the LDFLAGS to use with Qt" >&5 $as_echo_n "checking for the LDFLAGS to use with Qt... " >&6; } -if ${at_cv_env_QT_LDFLAGS+:} false; then : +if test "${at_cv_env_QT_LDFLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_LDFLAGS=`sed "/^LDFLAGS@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile` @@ -17314,7 +16404,7 @@ $as_echo "$at_darwin" >&6; } # Find the LIBS of Qt. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the LIBS to use with Qt" >&5 $as_echo_n "checking for the LIBS to use with Qt... " >&6; } -if ${at_cv_env_QT_LIBS+:} false; then : +if test "${at_cv_env_QT_LIBS+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_LIBS=`sed "/^LIBS@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile` @@ -17338,11 +16428,11 @@ $as_echo "$at_cv_env_QT_LIBS" >&6; } if test x"$QMAKE" = x; then as_fn_error $? "\$QMAKE is empty. \ -Did you invoke AT@&t@_WITH_QT before AT@&t@_REQUIRE_QT_VERSION?" "$LINENO" 5 +Did you invoke AT@&t@_WITH_QT before AT@&t@_REQUIRE_QT_VERSION?" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt's version" >&5 $as_echo_n "checking for Qt's version... " >&6; } -if ${at_cv_QT_VERSION+:} false; then : +if test "${at_cv_QT_VERSION+set}" = set; then : $as_echo_n "(cached) " >&6 else echo "$as_me:$LINENO: Running $QMAKE --version:" >&5 @@ -17353,7 +16443,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $at_cv_QT_VERSION" >&5 $as_echo "$at_cv_QT_VERSION" >&6; } if test x"$at_cv_QT_VERSION" = x; then - as_fn_error $? "Cannot detect Qt's version." "$LINENO" 5 + as_fn_error $? "Cannot detect Qt's version." "$LINENO" 5 fi QT_VERSION=$at_cv_QT_VERSION @@ -17362,7 +16452,7 @@ as_arg_v2=4.3 awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null case $? in @%:@( 1) : - as_fn_error $? "This package requires Qt 4.3 or above." "$LINENO" 5 ;; @%:@( + as_fn_error $? "This package requires Qt 4.3 or above." "$LINENO" 5 ;; @%:@( 0) : ;; @%:@( 2) : @@ -17387,7 +16477,7 @@ if test "${enable_python+set}" = set; then : enableval=$enable_python; case "${enableval}" in yes) python=true ;; no) python=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-python" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-python" "$LINENO" 5 ;; esac else python=false @@ -17398,7 +16488,7 @@ if (test x$langall = xtrue || test x$python = xtrue) ;then set dummy python-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PYTHON_HEADERS+:} false; then : +if test "${ac_cv_prog_PYTHON_HEADERS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$PYTHON_HEADERS"; then @@ -17435,7 +16525,7 @@ fi set dummy swig$EXEEXT; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_HAVE_SWIG+:} false; then : +if test "${ac_cv_prog_HAVE_SWIG+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_SWIG"; then @@ -17469,20 +16559,20 @@ fi if (test "$PYTHON_HEADERS" && test "$HAVE_SWIG") ;then - test_python=true - + test_python=true + # Find any Python interpreter. if test -z "$PYTHON"; then - for ac_prog in python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 + for ac_prog in python python2 python3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PYTHON+:} false; then : +if test "${ac_cv_path_PYTHON+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PYTHON in @@ -17527,13 +16617,13 @@ test -n "$PYTHON" || PYTHON=":" if test "$PYTHON" = :; then - as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5 + as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } -if ${am_cv_python_version+:} false; then : +if test "${am_cv_python_version+set}" = set; then : $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` @@ -17552,7 +16642,7 @@ $as_echo "$am_cv_python_version" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } -if ${am_cv_python_platform+:} false; then : +if test "${am_cv_python_platform+set}" = set; then : $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` @@ -17566,7 +16656,7 @@ $as_echo "$am_cv_python_platform" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } -if ${am_cv_python_pythondir+:} false; then : +if test "${am_cv_python_pythondir+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$prefix" = xNONE @@ -17604,7 +16694,7 @@ $as_echo "$am_cv_python_pythondir" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } -if ${am_cv_python_pyexecdir+:} false; then : +if test "${am_cv_python_pyexecdir+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$exec_prefix" = xNONE @@ -17645,8 +16735,8 @@ $as_echo "$am_cv_python_pyexecdir" >&6; } else - echo Please install python-dev and swig packages - exit + echo Please install python-dev and swig packages + exit fi fi if test x$test_python = xtrue ; then @@ -17663,7 +16753,7 @@ if test "${enable_octave+set}" = set; then : enableval=$enable_octave; case "${enableval}" in yes) octave=true ;; no) octave=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-octave" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-octave" "$LINENO" 5 ;; esac else octave=false @@ -17674,7 +16764,7 @@ if (test x$langall = xtrue || test x$octave = xtrue) ;then set dummy octave-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCTAVE+:} false; then : +if test "${ac_cv_prog_OCTAVE+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OCTAVE"; then @@ -17711,8 +16801,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Octave arch" >&5 $as_echo_n "checking for Octave arch... " >&6; } OCTAVE_ARCH=`$OCTAVE -p CANONICAL_HOST_TYPE`-`$OCTAVE -p API_VERSION` - OCTINCLUDEDIR="`$OCTAVE -p OCTINCLUDEDIR`" - OCTAVE_INCFLAGS="-I$OCTINCLUDEDIR -I$OCTINCLUDEDIR/.." + OCTAVE_INCFLAGS="-I`$OCTAVE -p OCTINCLUDEDIR`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCTAVE_ARCH" >&5 $as_echo "$OCTAVE_ARCH" >&6; } OCTAVE_ARCH=$OCTAVE_ARCH @@ -17730,54 +16819,10 @@ else fi -@%:@ Check whether --enable-testio was given. -if test "${enable_testio+set}" = set; then : - enableval=$enable_testio; case "${enableval}" in - yes) testio=true ;; - no) testio=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-testio" "$LINENO" 5 ;; -esac -else - testio=false -fi - - if test x$testio = xtrue ; then - USE_TESTIO_TRUE= - USE_TESTIO_FALSE='#' -else - USE_TESTIO_TRUE='#' - USE_TESTIO_FALSE= -fi - - -@%:@ Check whether --enable-docs was given. -if test "${enable_docs+set}" = set; then : - enableval=$enable_docs; case "${enableval}" in - yes) docs=true ;; - no) docs=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-docs" "$LINENO" 5 ;; -esac -else - docs=false -fi - -if (test x$docs = xtrue || test x$all = xtrue) ;then - ac_config_files="$ac_config_files texinfo/Makefile texinfo/png/Makefile" - -fi - if (test x$docs = xtrue || test x$all = xtrue) ; then - USE_DOCS_TRUE= - USE_DOCS_FALSE='#' -else - USE_DOCS_TRUE='#' - USE_DOCS_FALSE= -fi - - AM_CXXFLAGS="$AM_CXXFLAGS -Wall $GSL_FLAGS" -ac_config_files="$ac_config_files Makefile mgl/Makefile examples/Makefile include/Makefile lang/Makefile utils/Makefile widgets/Makefile" +ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile widgets/Makefile lang/Makefile utils/Makefile examples/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -17843,21 +16888,10 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then + test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi + cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -17898,82 +16932,70 @@ fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_PTHREAD_TRUE}" && test -z "${USE_PTHREAD_FALSE}"; then as_fn_error $? "conditional \"USE_PTHREAD\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_GSL_TRUE}" && test -z "${USE_GSL_FALSE}"; then as_fn_error $? "conditional \"USE_GSL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_GLUT_TRUE}" && test -z "${USE_GLUT_FALSE}"; then as_fn_error $? "conditional \"USE_GLUT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_HDF5_TRUE}" && test -z "${USE_HDF5_FALSE}"; then as_fn_error $? "conditional \"USE_HDF5\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_HDF4_TRUE}" && test -z "${USE_HDF4_FALSE}"; then as_fn_error $? "conditional \"USE_HDF4\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_GIF_TRUE}" && test -z "${USE_GIF_FALSE}"; then - as_fn_error $? "conditional \"USE_GIF\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_JPEG_TRUE}" && test -z "${USE_JPEG_FALSE}"; then as_fn_error $? "conditional \"USE_JPEG\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_PDF_TRUE}" && test -z "${USE_PDF_FALSE}"; then as_fn_error $? "conditional \"USE_PDF\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_U3D_TRUE}" && test -z "${USE_U3D_FALSE}"; then as_fn_error $? "conditional \"USE_U3D\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_FLTK_TRUE}" && test -z "${USE_FLTK_FALSE}"; then as_fn_error $? "conditional \"USE_FLTK\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_WX_TRUE}" && test -z "${USE_WX_FALSE}"; then - as_fn_error $? "conditional \"USE_WX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_QT_TRUE}" && test -z "${USE_QT_FALSE}"; then as_fn_error $? "conditional \"USE_QT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_PYTHON_TRUE}" && test -z "${USE_PYTHON_FALSE}"; then as_fn_error $? "conditional \"USE_PYTHON\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_OCTAVE_TRUE}" && test -z "${USE_OCTAVE_FALSE}"; then as_fn_error $? "conditional \"USE_OCTAVE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_TESTIO_TRUE}" && test -z "${USE_TESTIO_FALSE}"; then - as_fn_error $? "conditional \"USE_TESTIO\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_DOCS_TRUE}" && test -z "${USE_DOCS_FALSE}"; then - as_fn_error $? "conditional \"USE_DOCS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -: "${CONFIG_STATUS=./config.status}" +: ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -18074,7 +17096,6 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -as_myself= case $0 in @%:@(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -18381,8 +17402,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by mathgl $as_me 1.11.2, which was -generated by GNU Autoconf 2.68. Invocation command line was +This file was extended by mathgl $as_me 2.0, which was +generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -18447,8 +17468,8 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -mathgl config.status 1.11.2 -configured by $0, generated by GNU Autoconf 2.68, +mathgl config.status 2.0 +configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. @@ -18576,212 +17597,186 @@ AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' -AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' -SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' -ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' -lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' -file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' -want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' -sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' -AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' -GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' -lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' -objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' -finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' -predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' -postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' -predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' -postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' -LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' -reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' -reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' -compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' -GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' -archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' -module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' -with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' -no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' -inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' -link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' -always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' -exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' -include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' -prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' -postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' -file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' -predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' -postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' -predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' -postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' +LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' +predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' +predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' +postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - # Quote evaled strings. -for var in AS \ -DLLTOOL \ -OBJDUMP \ -SHELL \ -ECHO \ -SED \ +for var in SED \ GREP \ EGREP \ FGREP \ @@ -18793,12 +17788,8 @@ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ -file_magic_glob \ -want_nocaseglob \ -sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ -archiver_list_spec \ STRIP \ RANLIB \ CC \ @@ -18808,14 +17799,14 @@ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -nm_file_list_spec \ +SHELL \ +ECHO \ lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_pic \ lt_prog_compiler_wl \ +lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ -MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ @@ -18831,6 +17822,7 @@ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ +fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ @@ -18838,7 +17830,6 @@ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ -install_override_mode \ finish_eval \ old_striplib \ striplib \ @@ -18849,11 +17840,10 @@ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ -reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ -lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ +lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ @@ -18865,6 +17855,7 @@ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ +fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ @@ -18874,9 +17865,9 @@ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -18898,13 +17889,11 @@ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ -postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ -reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ @@ -18913,11 +17902,10 @@ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ -prelink_cmds_CXX \ -postlink_cmds_CXX; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in +prelink_cmds_CXX; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -18925,6 +17913,12 @@ postlink_cmds_CXX; do esac done +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' @@ -18958,17 +17952,15 @@ do "include/mgl/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/mgl/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "texinfo/Makefile") CONFIG_FILES="$CONFIG_FILES texinfo/Makefile" ;; - "texinfo/png/Makefile") CONFIG_FILES="$CONFIG_FILES texinfo/png/Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "mgl/Makefile") CONFIG_FILES="$CONFIG_FILES mgl/Makefile" ;; - "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "widgets/Makefile") CONFIG_FILES="$CONFIG_FILES widgets/Makefile" ;; "lang/Makefile") CONFIG_FILES="$CONFIG_FILES lang/Makefile" ;; "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; - "widgets/Makefile") CONFIG_FILES="$CONFIG_FILES widgets/Makefile" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done @@ -18991,10 +17983,9 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= ac_tmp= + tmp= trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -19002,13 +17993,12 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" + test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -19030,7 +18020,7 @@ else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF @@ -19039,18 +18029,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -19058,7 +18048,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -19106,7 +18096,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && +cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -19138,8 +18128,8 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), @@ -19172,7 +18162,7 @@ fi # test -n "$CONFIG_FILES" # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || +cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -19184,11 +18174,11 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then break elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -19273,7 +18263,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -19286,7 +18276,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -19305,7 +18295,7 @@ do for ac_f do case $ac_f in - -) ac_f="$ac_tmp/stdin";; + -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -19314,7 +18304,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -19340,8 +18330,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -19477,24 +18467,23 @@ s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$ac_tmp/stdin" + rm -f "$tmp/stdin" case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -19503,21 +18492,21 @@ which seems to be undefined. Please make sure it is defined" >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + mv "$tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" @@ -19678,8 +18667,7 @@ $as_echo X"$file" | # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -19712,13 +18700,13 @@ available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Assembler program. -AS=$lt_AS +AS=$AS # DLL creation program. -DLLTOOL=$lt_DLLTOOL +DLLTOOL=$DLLTOOL # Object dumper program. -OBJDUMP=$lt_OBJDUMP +OBJDUMP=$OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version @@ -19736,12 +18724,6 @@ pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - # The host system. host_alias=$host_alias host=$host @@ -19791,36 +18773,20 @@ SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method = "file_magic". +# Command to use when deplibs_check_method == "file_magic". file_magic_cmd=$lt_file_magic_cmd -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob=$lt_file_magic_glob - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob=$lt_want_nocaseglob - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - # The archiver. AR=$lt_AR - -# Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - # A symbol stripping program. STRIP=$lt_STRIP @@ -19829,9 +18795,6 @@ RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - # A C compiler. LTCC=$lt_CC @@ -19850,24 +18813,21 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix -# Specify filename containing input files for \$NM. -nm_file_list_spec=$lt_nm_file_list_spec - -# The root where to search for dependent libraries,and in which our libraries should be installed. -lt_sysroot=$lt_sysroot - # The name of the directory that contains temporary libtool files. objdir=$objdir +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL @@ -19924,9 +18884,6 @@ library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds @@ -19966,10 +18923,6 @@ striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds @@ -19982,12 +18935,12 @@ with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static @@ -20074,6 +19027,9 @@ inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols @@ -20089,9 +19045,6 @@ include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - # Specify filename containing input files. file_list_spec=$lt_file_list_spec @@ -20138,169 +19091,212 @@ ltmain="$ac_aux_dir/ltmain.sh" # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - if test x"$xsi_shell" = xyes; then - sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ -func_dirname ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_basename ()$/,/^} # func_basename /c\ -func_basename ()\ -{\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ -func_dirname_and_basename ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ -func_stripname ()\ -{\ -\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ -\ # positional parameters, so assign one to ordinary parameter first.\ -\ func_stripname_result=${3}\ -\ func_stripname_result=${func_stripname_result#"${1}"}\ -\ func_stripname_result=${func_stripname_result%"${2}"}\ -} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ -func_split_long_opt ()\ -{\ -\ func_split_long_opt_name=${1%%=*}\ -\ func_split_long_opt_arg=${1#*=}\ -} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ -func_split_short_opt ()\ -{\ -\ func_split_short_opt_arg=${1#??}\ -\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ -} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ -func_lo2o ()\ -{\ -\ case ${1} in\ -\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ -\ *) func_lo2o_result=${1} ;;\ -\ esac\ -} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_xform ()$/,/^} # func_xform /c\ -func_xform ()\ -{\ - func_xform_result=${1%.*}.lo\ -} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_arith ()$/,/^} # func_arith /c\ -func_arith ()\ -{\ - func_arith_result=$(( $* ))\ -} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_len ()$/,/^} # func_len /c\ -func_len ()\ -{\ - func_len_result=${#1}\ -} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - -fi - -if test x"$lt_shell_append" = xyes; then - sed -e '/^func_append ()$/,/^} # func_append /c\ -func_append ()\ -{\ - eval "${1}+=\\${2}"\ -} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ -func_append_quoted ()\ -{\ -\ func_quote_for_eval "${2}"\ -\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ -} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 -$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} -fi - - - mv -f "$cfgfile" "$ofile" || + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} + +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -20312,10 +19308,6 @@ fi # The linker used to build libraries. LD=$lt_LD_CXX -# How to create reloadable object files. -reload_flag=$lt_reload_flag_CXX -reload_cmds=$lt_reload_cmds_CXX - # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX @@ -20328,12 +19320,12 @@ with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX - # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX @@ -20420,6 +19412,9 @@ inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path_CXX + # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX @@ -20435,9 +19430,6 @@ include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds_CXX - # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX @@ -20472,7 +19464,7 @@ _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. diff --git a/autom4te.cache/output.1 b/autom4te.cache/output.1 index 82ae3e4..c502bf6 100644 --- a/autom4te.cache/output.1 +++ b/autom4te.cache/output.1 @@ -1,6 +1,6 @@ @%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. -@%:@ Generated by GNU Autoconf 2.68 for mathgl 1.11.2. +@%:@ Generated by GNU Autoconf 2.67 for mathgl 2.0. @%:@ @%:@ Report bugs to . @%:@ @@ -91,7 +91,6 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -as_myself= case $0 in @%:@(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -174,14 +173,6 @@ test x\$exitcode = x0 || exit 1" as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 - - test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes @@ -225,18 +216,11 @@ IFS=$as_save_IFS # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - case $- in @%:@ (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -544,8 +528,155 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + as_awk_strverscmp=' # Use only awk features that work with 7th edition Unix awk (1978). # My, what an old awk you have, Mr. Solaris! @@ -630,12 +761,12 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='mathgl' PACKAGE_TARNAME='mathgl' -PACKAGE_VERSION='1.11.2' -PACKAGE_STRING='mathgl 1.11.2' +PACKAGE_VERSION='2.0' +PACKAGE_STRING='mathgl 2.0' PACKAGE_BUGREPORT='mathgl.abalakin@gmail.com' PACKAGE_URL='' -ac_unique_file="mgl" +ac_unique_file="src" # Factoring default headers for most tests. ac_includes_default="\ #include @@ -677,10 +808,6 @@ am__EXEEXT_TRUE LTLIBOBJS LIB@&t@OBJS AM_CXXFLAGS -USE_DOCS_FALSE -USE_DOCS_TRUE -USE_TESTIO_FALSE -USE_TESTIO_TRUE USE_OCTAVE_FALSE USE_OCTAVE_TRUE OCTAVE_INCFLAGS @@ -717,10 +844,6 @@ RCC UIC MOC QMAKE -USE_WX_FALSE -USE_WX_TRUE -WX_LIBS -WX_FLAGS USE_FLTK_FALSE USE_FLTK_TRUE FLTK_LIBS @@ -735,10 +858,6 @@ USE_JPEG_TRUE JPEG_LIBS JPEG_FLAGS PNG_LIBS -USE_GIF_FALSE -USE_GIF_TRUE -GIF_LIBS -GIF_FLAGS USE_HDF4_FALSE USE_HDF4_TRUE HDF4_LIBS @@ -749,8 +868,6 @@ HDF5_LIBS HDF5_FLAGS USE_GLUT_FALSE USE_GLUT_TRUE -GLUT_FLAGS -GLUT_LIBS GL_LIBS USE_GSL_FALSE USE_GSL_TRUE @@ -767,9 +884,8 @@ OTOOL LIPO NMEDIT DSYMUTIL -MANIFEST_TOOL +lt_ECHO RANLIB -ac_ct_AR AR LN_S NM @@ -888,29 +1004,23 @@ enable_static with_pic enable_fast_install with_gnu_ld -with_sysroot enable_libtool_lock enable_double enable_all enable_langall enable_pthread enable_gsl -enable_glut enable_hdf5 enable_hdf5_18 enable_hdf4 -enable_gif enable_jpeg enable_u3d enable_pdf enable_fltk -enable_wx enable_qt with_qt enable_python enable_octave -enable_testio -enable_docs ' ac_precious_vars='build_alias host_alias @@ -1330,7 +1440,7 @@ Try \`$0 --help' for more information" $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac @@ -1468,7 +1578,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures mathgl 1.11.2 to adapt to many kinds of systems. +\`configure' configures mathgl 2.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1538,7 +1648,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of mathgl 1.11.2:";; + short | recursive ) echo "Configuration of mathgl 2.0:";; esac cat <<\_ACEOF @@ -1558,21 +1668,16 @@ Optional Features: --enable-langall Turn on all language interfaces --enable-pthread Turn on pthread support in MathGL library --enable-gsl Turn on gsl functions - --enable-glut Turn on glut --enable-hdf5 Turn on hdf5 --enable-hdf5_18 Turn on hdf5 version 1.8 --enable-hdf4 Turn on hdf4 - --enable-gif Turn on gif --enable-jpeg Turn on jpeg --enable-u3d Turn on u3d functions --enable-pdf Turn on u3d and pdf functions --enable-fltk Turn on fltk - --enable-wx Turn on wxWidget --enable-qt Turn on Qt --enable-python Turn on interface to python --enable-octave Turn on interface to octave - --enable-testio Turn on testio - --enable-docs Turn on documentation building Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1580,8 +1685,6 @@ Optional Packages: --with-pic try to use only PIC/non-PIC objects @<:@default=use both@:>@ --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). --with-qt Path to Qt @<:@Look in PATH and /usr/local/Trolltech@:>@ Some influential environment variables: @@ -1664,8 +1767,8 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -mathgl configure 1.11.2 -generated by GNU Autoconf 2.68 +mathgl configure 2.0 +generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1711,7 +1814,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_compile @@ -1749,7 +1852,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } @%:@ ac_fn_cxx_try_compile @@ -1795,7 +1898,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_link @@ -1809,7 +1912,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1827,7 +1930,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } @%:@ ac_fn_c_check_header_compile @@ -1863,7 +1966,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_cpp @@ -1905,7 +2008,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } @%:@ ac_fn_c_try_run @@ -1918,7 +2021,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1973,7 +2076,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } @%:@ ac_fn_c_check_func @@ -2009,7 +2112,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } @%:@ ac_fn_cxx_try_cpp @@ -2055,7 +2158,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } @%:@ ac_fn_cxx_try_link @@ -2068,10 +2171,10 @@ fi ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : + if eval "test \"\${$3+set}\"" = set; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -2138,7 +2241,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -2147,15 +2250,15 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } @%:@ ac_fn_cxx_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by mathgl $as_me 1.11.2, which was -generated by GNU Autoconf 2.68. Invocation command line was +It was created by mathgl $as_me 2.0, which was +generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2413,7 +2516,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;} || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi done @@ -2489,7 +2592,7 @@ if $ac_cache_corrupted; then $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2503,7 +2606,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -MGL_RELEASE=1.11.2 +MGL_RELEASE=2.0 @@ -2524,7 +2627,7 @@ for ac_dir in config "$srcdir"/config; do fi done if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -2553,7 +2656,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # (Interfaces removed: CURRENT++, AGE=0, REVISION=0) # (Interfaces added: CURRENT++, AGE++, REVISION=0) # (No interfaces changed: REVISION++) -MGL_CURRENT=5 +MGL_CURRENT=6 MGL_REVISION=0 MGL_AGE=0 @@ -2579,7 +2682,7 @@ am__api_version='1.11' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : +if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2666,11 +2769,11 @@ am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; esac # Do `set' in a subshell so we don't clobber the current shell's @@ -2693,7 +2796,7 @@ if ( # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 +alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file @@ -2703,7 +2806,7 @@ then : else as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 +Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -2756,7 +2859,7 @@ if test "$cross_compiling" != no; then set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : +if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -2796,7 +2899,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -2849,7 +2952,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : + if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2900,7 +3003,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : +if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -2940,7 +3043,7 @@ done $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2982,7 +3085,7 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi @@ -2998,7 +3101,7 @@ fi # Define the identity of the package. PACKAGE='mathgl' - VERSION='1.11.2' + VERSION='2.0' cat >>confdefs.h <<_ACEOF @@ -3049,7 +3152,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3089,7 +3192,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3142,7 +3245,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3182,7 +3285,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3241,7 +3344,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3285,7 +3388,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3340,7 +3443,7 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3455,7 +3558,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3498,7 +3601,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3557,7 +3660,7 @@ $as_echo "$ac_try_echo"; } >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi @@ -3568,7 +3671,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : +if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3609,7 +3712,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -3619,7 +3722,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : +if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3656,7 +3759,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : +if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -3734,7 +3837,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : +if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -3895,7 +3998,7 @@ depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -4034,7 +4137,7 @@ if test -z "$CXX"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : +if test "${ac_cv_prog_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -4078,7 +4181,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -4156,7 +4259,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4193,7 +4296,7 @@ ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : +if test "${ac_cv_prog_cxx_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag @@ -4279,7 +4382,7 @@ depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CXX_dependencies_compiler_type+:} false; then : +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -4406,27 +4509,27 @@ fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : +if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -4444,14 +4547,14 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : +if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi @@ -4459,7 +4562,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -4478,13 +4581,13 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AS+:} false; then : +if test "${ac_cv_prog_AS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then @@ -4524,7 +4627,7 @@ if test -z "$ac_cv_prog_AS"; then set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AS+:} false; then : +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then @@ -4576,7 +4679,7 @@ fi set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then @@ -4616,7 +4719,7 @@ if test -z "$ac_cv_prog_DLLTOOL"; then set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then @@ -4668,7 +4771,7 @@ fi set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -4708,7 +4811,7 @@ if test -z "$ac_cv_prog_OBJDUMP"; then set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -4790,8 +4893,8 @@ esac -macro_version='2.4' -macro_revision='1.3293' +macro_version='2.2.6b' +macro_revision='1.3017' @@ -4807,78 +4910,9 @@ macro_revision='1.3293' ltmain="$ac_aux_dir/ltmain.sh" -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : +if test "${ac_cv_path_SED+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ @@ -4933,7 +4967,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED @@ -4960,7 +4994,7 @@ Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : +if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -5009,7 +5043,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP @@ -5023,7 +5057,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : +if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -5075,7 +5109,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -5090,7 +5124,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : +if test "${ac_cv_path_FGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 @@ -5142,7 +5176,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP @@ -5221,7 +5255,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : +if test "${lt_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -5258,10 +5292,10 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : +if test "${lt_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -5288,7 +5322,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : +if test "${lt_cv_path_NM+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then @@ -5341,17 +5375,14 @@ if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" + if test -n "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then @@ -5389,13 +5420,13 @@ fi fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" + for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then @@ -5444,15 +5475,6 @@ esac fi fi - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -5467,18 +5489,18 @@ test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : +if test "${lt_cv_nm_interface+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) + (eval echo "\"\$as_me:__oline__: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5502,7 +5524,7 @@ fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : $as_echo_n "(cached) " >&6 else i=0 @@ -5535,11 +5557,6 @@ else lt_cv_sys_max_cmd_len=8192; ;; - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -5604,8 +5621,8 @@ else # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -5647,8 +5664,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -5697,83 +5714,9 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac - -fi - -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac - -fi - -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : +if test "${lt_cv_ld_reload_flag+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' @@ -5787,11 +5730,6 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -5814,7 +5752,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -5854,7 +5792,7 @@ if test -z "$ac_cv_prog_OBJDUMP"; then set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -5910,7 +5848,7 @@ test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : +if test "${lt_cv_deplibs_check_method+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' @@ -5952,18 +5890,16 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc*) +cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -5993,10 +5929,6 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -6005,11 +5937,11 @@ hpux10.20* | hpux11*) lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -6035,7 +5967,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else @@ -6112,21 +6044,6 @@ esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac -fi - file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -6140,28 +6057,18 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - - - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : +if test "${ac_cv_prog_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6170,7 +6077,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6180,10 +6087,10 @@ IFS=$as_save_IFS fi fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6191,17 +6098,17 @@ fi fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6210,7 +6117,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" + ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6220,17 +6127,17 @@ IFS=$as_save_IFS fi fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" + if test "x$ac_ct_AR" = x; then + AR="false" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6238,51 +6145,18 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - DLLTOOL=$ac_ct_DLLTOOL + AR=$ac_ct_AR fi else - DLLTOOL="$ac_cv_prog_DLLTOOL" + AR="$ac_cv_prog_AR" fi -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + @@ -6290,19 +6164,16 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : +if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6311,7 +6182,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6321,179 +6192,10 @@ IFS=$as_save_IFS fi fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -: ${AR=ar} -: ${AR_FLAGS=cru} - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6507,7 +6209,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -6566,7 +6268,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : +if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -6606,7 +6308,7 @@ if test -z "$ac_cv_prog_RANLIB"; then set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -6677,18 +6379,6 @@ if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - @@ -6735,7 +6425,7 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -6796,8 +6486,8 @@ esac lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -6833,7 +6523,6 @@ for ac_symprfx in "" "_"; do else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -6859,8 +6548,8 @@ _LT_EOF test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then @@ -6875,18 +6564,6 @@ _LT_EOF if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT@&t@_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT@&t@_DLSYM_CONST -#else -# define LT@&t@_DLSYM_CONST const -#endif - #ifdef __cplusplus extern "C" { #endif @@ -6898,7 +6575,7 @@ _LT_EOF cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -LT@&t@_DLSYM_CONST struct { +const struct { const char *name; void *address; } @@ -6924,8 +6601,8 @@ static const void *lt_preloaded_setup() { _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 @@ -6935,8 +6612,8 @@ _LT_EOF test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi @@ -6973,13 +6650,6 @@ else $as_echo "ok" >&6; } fi -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - @@ -7000,48 +6670,6 @@ fi - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } - -@%:@ Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; -else - with_sysroot=no -fi - - -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } - - - - @%:@ Check whether --enable-libtool-lock was given. @@ -7075,7 +6703,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext + echo '#line __oline__ "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7169,7 +6797,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : +if test "${lt_cv_cc_needs_belf+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_ext=c @@ -7237,123 +6865,6 @@ esac need_locks="$enable_libtool_lock" -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi - -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi - - - - - case $host_os in rhapsody* | darwin*) @@ -7362,7 +6873,7 @@ fi set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then @@ -7402,7 +6913,7 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then @@ -7454,7 +6965,7 @@ fi set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : +if test "${ac_cv_prog_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then @@ -7494,7 +7005,7 @@ if test -z "$ac_cv_prog_NMEDIT"; then set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then @@ -7546,7 +7057,7 @@ fi set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : +if test "${ac_cv_prog_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then @@ -7586,7 +7097,7 @@ if test -z "$ac_cv_prog_LIPO"; then set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then @@ -7638,7 +7149,7 @@ fi set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : +if test "${ac_cv_prog_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then @@ -7678,7 +7189,7 @@ if test -z "$ac_cv_prog_OTOOL"; then set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then @@ -7730,7 +7241,7 @@ fi set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : +if test "${ac_cv_prog_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then @@ -7770,7 +7281,7 @@ if test -z "$ac_cv_prog_OTOOL64"; then set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then @@ -7845,7 +7356,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no @@ -7874,7 +7385,7 @@ fi $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no @@ -7904,38 +7415,6 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -7963,7 +7442,7 @@ $as_echo "$lt_cv_ld_force_load" >&6; } else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -7983,7 +7462,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : + if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -8099,7 +7578,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c @@ -8111,7 +7590,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : +if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8202,64 +7681,579 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h - + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.i conftest.$ac_ext -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include _ACEOF - +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.i conftest.$ac_ext done - - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_DLFCN_H 1 -_ACEOF - +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +_lt_caught_CXX_error=yes; } fi -done - - +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -func_stripname_cnf () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname_cnf +else + _lt_caught_CXX_error=yes +fi @@ -8390,7 +8384,6 @@ LIBTOOL_DEPS="$ltmain" LIBTOOL='$(SHELL) $(top_builddir)/libtool' - @@ -8435,7 +8428,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : +if test "${lt_cv_objdir+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null @@ -8463,6 +8456,19 @@ _ACEOF + + + + + + + + + + + + + case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some @@ -8475,6 +8481,23 @@ aix3*) ;; esac +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + # Global variables: ofile=libtool can_build_shared=yes @@ -8503,7 +8526,7 @@ for cc_temp in $compiler""; do *) break;; esac done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it @@ -8513,7 +8536,7 @@ file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -8579,7 +8602,7 @@ if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -8708,16 +8731,11 @@ if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac + lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no @@ -8733,15 +8751,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes @@ -8770,6 +8788,8 @@ fi lt_prog_compiler_pic= lt_prog_compiler_static= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -8817,12 +8837,6 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-fno-common' ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -8865,13 +8879,6 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-fPIC' ;; esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - lt_prog_compiler_pic='-Xcompiler -fPIC' - ;; - esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -8934,13 +8941,7 @@ lt_prog_compiler_static= lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' @@ -8952,26 +8953,26 @@ lt_prog_compiler_static= # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; esac ;; esac @@ -9002,7 +9003,7 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; @@ -9059,17 +9060,13 @@ case $host_os in lt_prog_compiler_pic="$lt_prog_compiler_pic@&t@ -DPIC" ;; esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. @@ -9077,7 +9074,7 @@ lt_prog_compiler_pic=$lt_cv_prog_compiler_pic if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no @@ -9093,15 +9090,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes @@ -9130,18 +9127,13 @@ fi - - - - - # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no @@ -9154,7 +9146,7 @@ else if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes @@ -9184,7 +9176,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -9203,16 +9195,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -9239,7 +9231,7 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -9258,16 +9250,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -9377,36 +9369,13 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie openbsd*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu) + link_all_deplibs=no + ;; esac ld_shlibs=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -9440,12 +9409,11 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.19, is reported +*** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. _LT_EOF fi @@ -9481,12 +9449,10 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -9504,11 +9470,6 @@ _LT_EOF fi ;; - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no @@ -9534,16 +9495,15 @@ _LT_EOF if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag=' $pic_flag' + tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -9554,17 +9514,13 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -9580,17 +9536,17 @@ _LT_EOF fi case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) + xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -9599,13 +9555,13 @@ _LT_EOF fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -9623,8 +9579,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9670,8 +9626,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9711,10 +9667,8 @@ _LT_EOF else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -9776,6 +9730,7 @@ _LT_EOF if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi + link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then @@ -9801,13 +9756,7 @@ _LT_EOF allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9820,32 +9769,25 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' @@ -9854,13 +9796,7 @@ fi else # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9873,42 +9809,30 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -9940,63 +9864,20 @@ fi # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) @@ -10006,11 +9887,7 @@ fi hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - whole_archive_flag_spec='' - fi + whole_archive_flag_spec='' link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in @@ -10018,7 +9895,7 @@ fi *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -10061,7 +9938,7 @@ fi # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no @@ -10069,7 +9946,7 @@ fi hpux9*) if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -10084,8 +9961,8 @@ fi ;; hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -10103,16 +9980,16 @@ fi ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -10124,46 +10001,7 @@ fi archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } - -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi @@ -10191,39 +10029,26 @@ fi irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int foo (void) { return 0; } +int foo(void) {} _ACEOF if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi + LDFLAGS="$save_LDFLAGS" else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -10232,7 +10057,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } link_all_deplibs=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -10285,17 +10110,17 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -10305,13 +10130,13 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -10324,9 +10149,9 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -10514,50 +10339,44 @@ x|xyes) # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 +$as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi @@ -10728,23 +10547,16 @@ if test "$GCC" = yes; then darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -10757,7 +10569,7 @@ if test "$GCC" = yes; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -10777,13 +10589,7 @@ BEGIN {RS=" "; FS="/|\n";} { if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi @@ -10871,7 +10677,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -10902,9 +10708,8 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$cc_basename in - yes,*) - # gcc + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -10925,83 +10730,36 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' ;; *) - # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' ;; esac + dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -11088,19 +10846,6 @@ gnu*) hardcode_into_libs=yes ;; -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -11143,10 +10888,8 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 ;; interix[3-9]*) @@ -11213,17 +10956,12 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -11236,31 +10974,23 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -11272,6 +11002,18 @@ fi dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -11556,11 +11298,6 @@ fi - - - - - @@ -11639,7 +11376,7 @@ else # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11673,7 +11410,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -11687,12 +11424,12 @@ fi *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : +if test "x$ac_cv_func_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11726,16 +11463,16 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : +if test "x$ac_cv_func_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11769,12 +11506,12 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11808,12 +11545,12 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11847,7 +11584,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi @@ -11888,7 +11625,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : +if test "${lt_cv_dlopen_self+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -11897,7 +11634,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" +#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11938,13 +11675,7 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } +void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -11953,11 +11684,7 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else @@ -11994,7 +11721,7 @@ $as_echo "$lt_cv_dlopen_self" >&6; } wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : +if test "${lt_cv_dlopen_self_static+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -12003,7 +11730,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" +#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12044,13 +11771,7 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } +void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -12059,11 +11780,7 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else @@ -12220,146 +11937,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC="$lt_save_CC" - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@ifdef __STDC__ -@%:@ include -@%:@else -@%:@ include -@%:@endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@ifdef __STDC__ -@%:@ include -@%:@else -@%:@ include -@%:@endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -else - _lt_caught_CXX_error=yes -fi - + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -12385,8 +11963,6 @@ module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds -reload_flag_CXX=$reload_flag -reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no @@ -12442,7 +12018,6 @@ $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -12460,7 +12035,6 @@ $RM -r conftest* fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do @@ -12471,7 +12045,7 @@ $RM -r conftest* *) break;; esac done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` if test -n "$compiler"; then @@ -12534,7 +12108,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : +if test "${lt_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -12571,10 +12145,10 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : +if test "${lt_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -12600,8 +12174,8 @@ with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -12633,7 +12207,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no @@ -12743,13 +12317,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12762,33 +12330,26 @@ main () _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__CXX -fi +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' @@ -12797,13 +12358,7 @@ fi else # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12816,42 +12371,30 @@ main () _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__CXX -fi +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - fi + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -12881,75 +12424,28 @@ fi ;; cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_CXX=' ' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=yes - file_list_spec_CXX='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' - enable_shared_with_static_runtimes_CXX=yes - # Don't use ranlib - old_postinstall_cmds_CXX='chmod 644 $oldlib' - postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; - esac - ;; + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; darwin* | rhapsody*) @@ -12957,11 +12453,7 @@ fi hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - whole_archive_flag_spec_CXX='' - fi + whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in @@ -12969,7 +12461,7 @@ fi *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -13022,11 +12514,6 @@ fi gnu*) ;; - haiku*) - archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs_CXX=yes - ;; - hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: @@ -13051,11 +12538,11 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -13116,7 +12603,7 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then @@ -13126,10 +12613,10 @@ fi archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -13159,7 +12646,7 @@ fi case $cc_basename in CC*) # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -13170,9 +12657,9 @@ fi *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi link_all_deplibs_CXX=yes @@ -13201,7 +12688,7 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -13238,26 +12725,26 @@ fi pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + *pgCC\ [1-5]* | *pgcpp\ [1-5]*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 and above use weak symbols + *) # Version 6 will use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -13265,7 +12752,7 @@ fi hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -13284,9 +12771,9 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; - xl* | mpixl* | bgxl*) + xl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -13306,13 +12793,13 @@ fi archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='func_echo_all' + output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -13381,7 +12868,7 @@ fi export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo else ld_shlibs_CXX=no fi @@ -13416,15 +12903,15 @@ fi case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; @@ -13440,17 +12927,17 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -13460,7 +12947,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -13496,7 +12983,7 @@ fi solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' @@ -13517,7 +13004,7 @@ fi esac link_all_deplibs_CXX=yes - output_verbose_link_cmd='func_echo_all' + output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -13537,14 +13024,14 @@ fi if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -13555,7 +13042,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' @@ -13609,10 +13096,6 @@ fi CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ - '"$old_archive_cmds_CXX" - reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ - '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -13674,13 +13157,6 @@ private: }; _LT_EOF - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -esac - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -13694,7 +13170,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in + case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -13703,22 +13179,13 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 test $p = "-R"; then prev=$p continue + else + prev= fi - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) + case $p in + -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -13738,10 +13205,8 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi - prev= ;; - *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -13777,7 +13242,6 @@ else fi $RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in @@ -13813,7 +13277,7 @@ linux*) solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -13878,6 +13342,8 @@ fi lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -13927,11 +13393,6 @@ lt_prog_compiler_static_CXX= # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static_CXX= - ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -13981,11 +13442,6 @@ lt_prog_compiler_static_CXX= ;; esac ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; dgux*) case $cc_basename in ec++*) @@ -14075,8 +13531,8 @@ lt_prog_compiler_static_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; - xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene + xlc* | xlC*) + # IBM XL 8.0 on PPC lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' @@ -14106,7 +13562,7 @@ lt_prog_compiler_static_CXX= ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -14138,7 +13594,7 @@ lt_prog_compiler_static_CXX= ;; solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' @@ -14203,17 +13659,10 @@ case $host_os in lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX@&t@ -DPIC" ;; esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_prog_compiler_pic_CXX" >&6; } + -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } -lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. @@ -14221,7 +13670,7 @@ lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } -if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : +if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no @@ -14237,15 +13686,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes @@ -14271,15 +13720,13 @@ fi - - # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : +if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no @@ -14292,7 +13739,7 @@ else if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes @@ -14319,7 +13766,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no @@ -14338,16 +13785,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes @@ -14371,7 +13818,7 @@ $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no @@ -14390,16 +13837,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes @@ -14450,35 +13897,30 @@ fi $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - ;; - esac - ;; + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + linux* | k*bsd*-gnu) + link_all_deplibs_CXX=no + ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } @@ -14510,50 +13952,44 @@ x|xyes) # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc_CXX=no - else - lt_cv_archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } - archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_CXX" >&5 +$as_echo "$archive_cmds_need_lc_CXX" >&6; } ;; esac fi @@ -14710,7 +14146,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -14741,9 +14177,8 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$cc_basename in - yes,*) - # gcc + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -14764,82 +14199,36 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' ;; *) - # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' ;; esac + dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -14925,19 +14314,6 @@ gnu*) hardcode_into_libs=yes ;; -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -14980,10 +14356,8 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 ;; interix[3-9]*) @@ -15050,17 +14424,12 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -15073,31 +14442,23 @@ main () _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -15109,6 +14470,18 @@ fi dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -15345,8 +14718,6 @@ fi - - @@ -15397,7 +14768,6 @@ fi fi # test -n "$compiler" CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -15440,7 +14810,7 @@ if test "${enable_double+set}" = set; then : enableval=$enable_double; case "${enableval}" in yes) double=true ;; no) double=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-double" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-double" "$LINENO" 5 ;; esac else double=false @@ -15462,7 +14832,7 @@ if test "${enable_all+set}" = set; then : enableval=$enable_all; case "${enableval}" in yes) all=true ;; no) all=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-all" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-all" "$LINENO" 5 ;; esac else all=false @@ -15474,7 +14844,7 @@ if test "${enable_langall+set}" = set; then : enableval=$enable_langall; case "${enableval}" in yes) langall=true ;; no) langall=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-langall" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-langall" "$LINENO" 5 ;; esac else langall=false @@ -15486,7 +14856,7 @@ if test "${enable_pthread+set}" = set; then : enableval=$enable_pthread; case "${enableval}" in yes) pthread=true ;; no) pthread=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-pthread" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-pthread" "$LINENO" 5 ;; esac else pthread=true @@ -15494,7 +14864,7 @@ fi ac_fn_cxx_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : +if test "x$ac_cv_header_pthread_h" = x""yes; then : (test x$all = xtrue || test x$pthread = xtrue) && PTHREAD_FLAGS=-DHAVE_PTHREAD else (test x$all = xtrue || test x$pthread = xtrue) && echo "Please install posix threads headers" && exit @@ -15504,7 +14874,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5 $as_echo_n "checking for main in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_main+:} false; then : +if test "${ac_cv_lib_pthread_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15532,7 +14902,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_main" >&5 $as_echo "$ac_cv_lib_pthread_main" >&6; } -if test "x$ac_cv_lib_pthread_main" = xyes; then : +if test "x$ac_cv_lib_pthread_main" = x""yes; then : (test x$all = xtrue || test x$pthread = xtrue) && PTHREAD_LIBS=-lpthread else (test x$all = xtrue || test x$pthread = xtrue) && echo "Please install posix threads library" && exit @@ -15552,7 +14922,7 @@ if test "${enable_gsl+set}" = set; then : enableval=$enable_gsl; case "${enableval}" in yes) gsl=true ;; no) gsl=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-gsl" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-gsl" "$LINENO" 5 ;; esac else gsl=true @@ -15565,7 +14935,7 @@ if (test x$all = xtrue || test x$gsl = xtrue) ;then set dummy $GSL_PROG; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GSL_FLAGS+:} false; then : +if test "${ac_cv_prog_GSL_FLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$GSL_FLAGS"; then @@ -15602,7 +14972,7 @@ fi set dummy $GSL_PROG; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GSL_LIBS+:} false; then : +if test "${ac_cv_prog_GSL_LIBS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$GSL_LIBS"; then @@ -15655,32 +15025,16 @@ else fi -@%:@ Check whether --enable-glut was given. -if test "${enable_glut+set}" = set; then : - enableval=$enable_glut; case "${enableval}" in - yes) glut=true ;; - no) glut=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-glut" "$LINENO" 5 ;; -esac -else - glut=false -fi - - case "${host}" in *darwin*) GL_LIBS="-framework OpenGL" - if (test x$all = xtrue || test x$glut = xtrue) ;then - GLUT_LIBS="-framework GLUT -framework OpenGL" - - fi ;; *w32*) GL_LIBS=opengl32 ac_fn_cxx_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_gl_h" = xyes; then : +if test "x$ac_cv_header_GL_gl_h" = x""yes; then : else echo "Please install OpenGL headers (GL/gl.h)"; exit @@ -15690,7 +15044,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_${GL_LIBS}''_main" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${GL_LIBS}" >&5 $as_echo_n "checking for main in -l${GL_LIBS}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : +if eval "test \"\${$as_ac_Lib+set}\"" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15725,59 +15079,12 @@ else echo "Please install OpenGL library (lib${GL_LIBS}.a)"; exit fi - GLUT_LIBS=glut32 - ac_fn_cxx_check_header_mongrel "$LINENO" "GL/glut.h" "ac_cv_header_GL_glut_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_glut_h" = xyes; then : - (test x$all = xtrue || test x$glut = xtrue) && GLUT_FLAGS=-DHAVE_GLUT -else - (test x$all = xtrue || test x$glut = xtrue) && (echo "Please install FreeGLUT headers (GL/glut.h)" && exit) -fi - - - as_ac_Lib=`$as_echo "ac_cv_lib_${GLUT_LIBS}''_main" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${GLUT_LIBS}" >&5 -$as_echo_n "checking for main in -l${GLUT_LIBS}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l${GLUT_LIBS} $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - (test x$all = xtrue || test x$glut = xtrue) && GLUT_LIBS=-l${GLUT_LIBS} -else - (test x$all = xtrue || test x$glut = xtrue) && echo "Please install FreeGLUT library (lib${GLUT_LIBS}.a)" && exit -fi - ;; *) GL_LIBS=GL ac_fn_cxx_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_gl_h" = xyes; then : +if test "x$ac_cv_header_GL_gl_h" = x""yes; then : else echo "Please install OpenGL headers (GL/gl.h)"; exit @@ -15787,7 +15094,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_${GL_LIBS}''_main" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${GL_LIBS}" >&5 $as_echo_n "checking for main in -l${GL_LIBS}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : +if eval "test \"\${$as_ac_Lib+set}\"" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15822,53 +15129,6 @@ else echo "Please install OpenGL library (lib${GL_LIBS}.a)"; exit fi - GLUT_LIBS=glut - ac_fn_cxx_check_header_mongrel "$LINENO" "GL/glut.h" "ac_cv_header_GL_glut_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_glut_h" = xyes; then : - (test x$all = xtrue || test x$glut = xtrue) && GLUT_FLAGS=-DHAVE_GLUT -else - (test x$all = xtrue || test x$glut = xtrue) && (echo "Please install FreeGLUT headers (GL/glut.h)" && exit) -fi - - - as_ac_Lib=`$as_echo "ac_cv_lib_${GLUT_LIBS}''_main" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${GLUT_LIBS}" >&5 -$as_echo_n "checking for main in -l${GLUT_LIBS}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l${GLUT_LIBS} $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - (test x$all = xtrue || test x$glut = xtrue) && GLUT_LIBS=-l${GLUT_LIBS} -else - (test x$all = xtrue || test x$glut = xtrue) && echo "Please install FreeGLUT library (lib${GLUT_LIBS}.a)" && exit -fi - ;; esac @@ -15895,7 +15155,7 @@ if test "${enable_hdf5+set}" = set; then : enableval=$enable_hdf5; case "${enableval}" in yes) hdf5=true ;; no) hdf5=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-hdf5" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-hdf5" "$LINENO" 5 ;; esac else hdf5=false @@ -15906,7 +15166,7 @@ if test "${enable_hdf5_18+set}" = set; then : enableval=$enable_hdf5_18; case "${enableval}" in yes) hdf5_18=true ;; no) hdf5_18=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-hdf5_18" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-hdf5_18" "$LINENO" 5 ;; esac else hdf5_18=false @@ -15914,7 +15174,7 @@ fi #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_fn_cxx_check_header_mongrel "$LINENO" "hdf5.h" "ac_cv_header_hdf5_h" "$ac_includes_default" -if test "x$ac_cv_header_hdf5_h" = xyes; then : +if test "x$ac_cv_header_hdf5_h" = x""yes; then : (test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && HDF5_FLAGS=-DHAVE_HDF5 else (test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && echo "Please install hdf5 headers" && exit @@ -15927,7 +15187,7 @@ if ((test x$all = xtrue || test x$hdf5 = xtrue) && test x$hdf5_18 = xfalse) ;the fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lhdf5" >&5 $as_echo_n "checking for main in -lhdf5... " >&6; } -if ${ac_cv_lib_hdf5_main+:} false; then : +if test "${ac_cv_lib_hdf5_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15955,7 +15215,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdf5_main" >&5 $as_echo "$ac_cv_lib_hdf5_main" >&6; } -if test "x$ac_cv_lib_hdf5_main" = xyes; then : +if test "x$ac_cv_lib_hdf5_main" = x""yes; then : (test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && HDF5_LIBS=-lhdf5 else (test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && echo "Please install hdf5 library" && exit @@ -15976,14 +15236,14 @@ if test "${enable_hdf4+set}" = set; then : enableval=$enable_hdf4; case "${enableval}" in yes) hdf4=true ;; no) hdf4=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-hdf4" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-hdf4" "$LINENO" 5 ;; esac else hdf4=false fi ac_fn_cxx_check_header_mongrel "$LINENO" "hdf/mfhdf.h" "ac_cv_header_hdf_mfhdf_h" "$ac_includes_default" -if test "x$ac_cv_header_hdf_mfhdf_h" = xyes; then : +if test "x$ac_cv_header_hdf_mfhdf_h" = x""yes; then : (test x$all = xtrue || test x$hdf4 = xtrue) && HDF4_FLAGS=-DHAVE_HDF4 else (test x$all = xtrue || test x$hdf4 = xtrue) && echo "Please install hdf4 headers" && exit @@ -15993,7 +15253,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldf" >&5 $as_echo_n "checking for main in -ldf... " >&6; } -if ${ac_cv_lib_df_main+:} false; then : +if test "${ac_cv_lib_df_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16013,96 +15273,31 @@ _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_df_main=yes else - ac_cv_lib_df_main=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_df_main" >&5 -$as_echo "$ac_cv_lib_df_main" >&6; } -if test "x$ac_cv_lib_df_main" = xyes; then : - (test x$all = xtrue || test x$hdf4 = xtrue) && HDF4_LIBS="-lmfhdf -ldf" -else - (test x$all = xtrue || test x$hdf4 = xtrue) && echo "Please install hdf4 library" && exit -fi - - if (test x$all = xtrue || test x$hdf4 = xtrue); then - USE_HDF4_TRUE= - USE_HDF4_FALSE='#' -else - USE_HDF4_TRUE='#' - USE_HDF4_FALSE= -fi - - -@%:@ Check whether --enable-gif was given. -if test "${enable_gif+set}" = set; then : - enableval=$enable_gif; case "${enableval}" in - yes) gif=true ;; - no) gif=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-gif" "$LINENO" 5 ;; -esac -else - gif=false -fi - -ac_fn_cxx_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default" -if test "x$ac_cv_header_gif_lib_h" = xyes; then : - (test x$all = xtrue || test x$gif = xtrue) && GIF_FLAGS=-DHAVE_GIF -else - (test x$all = xtrue || test x$gif = xtrue) && echo "Please install gif headers" && exit -fi - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgif" >&5 -$as_echo_n "checking for main in -lgif... " >&6; } -if ${ac_cv_lib_gif_main+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgif $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_gif_main=yes -else - ac_cv_lib_gif_main=no + ac_cv_lib_df_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_main" >&5 -$as_echo "$ac_cv_lib_gif_main" >&6; } -if test "x$ac_cv_lib_gif_main" = xyes; then : - (test x$all = xtrue || test x$gif = xtrue) && GIF_LIBS=-lgif +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_df_main" >&5 +$as_echo "$ac_cv_lib_df_main" >&6; } +if test "x$ac_cv_lib_df_main" = x""yes; then : + (test x$all = xtrue || test x$hdf4 = xtrue) && HDF4_LIBS="-lmfhdf -ldf" else - (test x$all = xtrue || test x$gif = xtrue) && echo "Please install gif library" && exit + (test x$all = xtrue || test x$hdf4 = xtrue) && echo "Please install hdf4 library" && exit fi - if (test x$all = xtrue || test x$gif = xtrue); then - USE_GIF_TRUE= - USE_GIF_FALSE='#' + if (test x$all = xtrue || test x$hdf4 = xtrue); then + USE_HDF4_TRUE= + USE_HDF4_FALSE='#' else - USE_GIF_TRUE='#' - USE_GIF_FALSE= + USE_HDF4_TRUE='#' + USE_HDF4_FALSE= fi ac_fn_cxx_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" -if test "x$ac_cv_header_png_h" = xyes; then : +if test "x$ac_cv_header_png_h" = x""yes; then : else echo "Please install png headers" && exit @@ -16112,7 +15307,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpng" >&5 $as_echo_n "checking for main in -lpng... " >&6; } -if ${ac_cv_lib_png_main+:} false; then : +if test "${ac_cv_lib_png_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16140,7 +15335,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_main" >&5 $as_echo "$ac_cv_lib_png_main" >&6; } -if test "x$ac_cv_lib_png_main" = xyes; then : +if test "x$ac_cv_lib_png_main" = x""yes; then : PNG_LIBS=-lpng else echo "Please install png library" && exit @@ -16152,14 +15347,14 @@ if test "${enable_jpeg+set}" = set; then : enableval=$enable_jpeg; case "${enableval}" in yes) jpeg=true ;; no) jpeg=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-jpeg" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-jpeg" "$LINENO" 5 ;; esac else jpeg=false fi ac_fn_cxx_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" -if test "x$ac_cv_header_jpeglib_h" = xyes; then : +if test "x$ac_cv_header_jpeglib_h" = x""yes; then : (test x$all = xtrue || test x$jpeg = xtrue) && JPEG_FLAGS=-DHAVE_JPEG else (test x$all = xtrue || test x$jpeg = xtrue) && echo "Please install jpeg headers" && exit @@ -16169,7 +15364,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ljpeg" >&5 $as_echo_n "checking for main in -ljpeg... " >&6; } -if ${ac_cv_lib_jpeg_main+:} false; then : +if test "${ac_cv_lib_jpeg_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16197,7 +15392,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_main" >&5 $as_echo "$ac_cv_lib_jpeg_main" >&6; } -if test "x$ac_cv_lib_jpeg_main" = xyes; then : +if test "x$ac_cv_lib_jpeg_main" = x""yes; then : (test x$all = xtrue || test x$jpeg = xtrue) && JPEG_LIBS=-ljpeg else (test x$all = xtrue || test x$jpeg = xtrue) && echo "Please install jpeg library" && exit @@ -16217,7 +15412,7 @@ if test "${enable_u3d+set}" = set; then : enableval=$enable_u3d; case "${enableval}" in yes) u3d=true ;; no) u3d=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-u3d" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-u3d" "$LINENO" 5 ;; esac else u3d=false @@ -16228,7 +15423,7 @@ if test "${enable_pdf+set}" = set; then : enableval=$enable_pdf; case "${enableval}" in yes) pdf=true; u3d=true ;; no) pdf=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-pdf" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-pdf" "$LINENO" 5 ;; esac else pdf=false @@ -16237,7 +15432,7 @@ fi if test "x$pdf" == xtrue; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lhpdf" >&5 $as_echo_n "checking for main in -lhpdf... " >&6; } -if ${ac_cv_lib_hpdf_main+:} false; then : +if test "${ac_cv_lib_hpdf_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16265,7 +15460,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hpdf_main" >&5 $as_echo "$ac_cv_lib_hpdf_main" >&6; } -if test "x$ac_cv_lib_hpdf_main" = xyes; then : +if test "x$ac_cv_lib_hpdf_main" = x""yes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBHPDF 1 _ACEOF @@ -16275,8 +15470,8 @@ _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "--enable-pdf was given, but test for libharu or libhpdf failed -See \`config.log' for more details" "$LINENO" 5; } +as_fn_error $? "--enable-pdf was given, but test for libharu failed +See \`config.log' for more details" "$LINENO" 5 ; } fi @@ -16285,7 +15480,7 @@ if test "x$pdf" == xtrue; then : for ac_header in hpdf.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "hpdf.h" "ac_cv_header_hpdf_h" "$ac_includes_default" -if test "x$ac_cv_header_hpdf_h" = xyes; then : +if test "x$ac_cv_header_hpdf_h" = x""yes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_HPDF_H 1 _ACEOF @@ -16293,8 +15488,8 @@ _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "--enable-pdf was given, but test for libharu or libhpdf headers failed -See \`config.log' for more details" "$LINENO" 5; } +as_fn_error $? "--enable-pdf was given, but test for headers failed +See \`config.log' for more details" "$LINENO" 5 ; } fi @@ -16313,7 +15508,7 @@ fi if test "x$u3d" == xtrue; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lIDTF" >&5 $as_echo_n "checking for main in -lIDTF... " >&6; } -if ${ac_cv_lib_IDTF_main+:} false; then : +if test "${ac_cv_lib_IDTF_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16341,7 +15536,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_IDTF_main" >&5 $as_echo "$ac_cv_lib_IDTF_main" >&6; } -if test "x$ac_cv_lib_IDTF_main" = xyes; then : +if test "x$ac_cv_lib_IDTF_main" = x""yes; then : U3D_LIBS="-lIDTF -lm -ldl" @@ -16352,7 +15547,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "--enable-u3d was given, but test for libIDTF failed -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi fi @@ -16360,7 +15555,7 @@ if test "x$u3d" == xtrue; then : for ac_header in u3d/SceneConverterLib.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "u3d/SceneConverterLib.h" "ac_cv_header_u3d_SceneConverterLib_h" "$ac_includes_default" -if test "x$ac_cv_header_u3d_SceneConverterLib_h" = xyes; then : +if test "x$ac_cv_header_u3d_SceneConverterLib_h" = x""yes; then : cat >>confdefs.h <<_ACEOF @%:@define HAVE_U3D_SCENECONVERTERLIB_H 1 _ACEOF @@ -16369,7 +15564,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "--enable-u3d was given, but test for headers failed -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi @@ -16390,7 +15585,7 @@ if test "${enable_fltk+set}" = set; then : enableval=$enable_fltk; case "${enableval}" in yes) fltk=true ;; no) fltk=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-fltk" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-fltk" "$LINENO" 5 ;; esac else fltk=false @@ -16402,7 +15597,7 @@ if (test x$all = xtrue || test x$fltk = xtrue) ;then set dummy $FLTK_PROG; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_FLTK_FLAGS+:} false; then : +if test "${ac_cv_prog_FLTK_FLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$FLTK_FLAGS"; then @@ -16439,7 +15634,7 @@ fi set dummy $FLTK_PROG; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_FLTK_LIBS+:} false; then : +if test "${ac_cv_prog_FLTK_LIBS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$FLTK_LIBS"; then @@ -16489,117 +15684,12 @@ else fi -@%:@ Check whether --enable-wx was given. -if test "${enable_wx+set}" = set; then : - enableval=$enable_wx; case "${enableval}" in - yes) wx=true ;; - no) wx=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-wx" "$LINENO" 5 ;; -esac -else - wx=false -fi - -if (test x$all = xtrue || test x$wx = xtrue) ;then -#if (test x$wx = xtrue) ;then - WX_PROG=wx-config - # Extract the first word of "$WX_PROG", so it can be a program name with args. -set dummy $WX_PROG; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_WX_FLAGS+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$WX_FLAGS"; then - ac_cv_prog_WX_FLAGS="$WX_FLAGS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_WX_FLAGS="`$WX_PROG --cflags`" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -WX_FLAGS=$ac_cv_prog_WX_FLAGS -if test -n "$WX_FLAGS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WX_FLAGS" >&5 -$as_echo "$WX_FLAGS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - # Extract the first word of "$WX_PROG", so it can be a program name with args. -set dummy $WX_PROG; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_WX_LIBS+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$WX_LIBS"; then - ac_cv_prog_WX_LIBS="$WX_LIBS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_WX_LIBS="`$WX_PROG --libs`" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -WX_LIBS=$ac_cv_prog_WX_LIBS -if test -n "$WX_LIBS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WX_LIBS" >&5 -$as_echo "$WX_LIBS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "$WX_FLAGS" && test "$WX_LIBS" ;then - test_wx=true - else - echo "Please install wxwidget headers and libraries and make sure that \ - path to $WX_PROG exist in your PATH" - exit - fi -fi - if test x$test_wx = xtrue; then - USE_WX_TRUE= - USE_WX_FALSE='#' -else - USE_WX_TRUE='#' - USE_WX_FALSE= -fi - - @%:@ Check whether --enable-qt was given. if test "${enable_qt+set}" = set; then : enableval=$enable_qt; case "${enableval}" in yes) qt=true ;; no) qt=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-qt" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-qt" "$LINENO" 5 ;; esac else qt=false @@ -16635,7 +15725,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_QMAKE+:} false; then : +if test "${ac_cv_path_QMAKE+set}" = set; then : $as_echo_n "(cached) " >&6 else case $QMAKE in @@ -16683,7 +15773,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_QMAKE+:} false; then : +if test "${ac_cv_path_QMAKE+set}" = set; then : $as_echo_n "(cached) " >&6 else case $QMAKE in @@ -16725,7 +15815,7 @@ done test -n "$QMAKE" || QMAKE="missing" if test x"$QMAKE" = xmissing; then - as_fn_error $? "Cannot find qmake in your PATH. Try using --with-qt." "$LINENO" 5 + as_fn_error $? "Cannot find qmake in your PATH. Try using --with-qt." "$LINENO" 5 fi fi @@ -16736,7 +15826,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MOC+:} false; then : +if test "${ac_cv_path_MOC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MOC in @@ -16784,7 +15874,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MOC+:} false; then : +if test "${ac_cv_path_MOC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MOC in @@ -16826,7 +15916,7 @@ done test -n "$MOC" || MOC="missing" if test x"$MOC" = xmissing; then - as_fn_error $? "Cannot find moc (Meta Object Compiler) in your PATH. Try using --with-qt." "$LINENO" 5 + as_fn_error $? "Cannot find moc (Meta Object Compiler) in your PATH. Try using --with-qt." "$LINENO" 5 fi fi @@ -16837,7 +15927,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UIC+:} false; then : +if test "${ac_cv_path_UIC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $UIC in @@ -16885,7 +15975,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UIC+:} false; then : +if test "${ac_cv_path_UIC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $UIC in @@ -16927,7 +16017,7 @@ done test -n "$UIC" || UIC="missing" if test x"$UIC" = xmissing; then - as_fn_error $? "Cannot find uic (User Interface Compiler) in your PATH. Try using --with-qt." "$LINENO" 5 + as_fn_error $? "Cannot find uic (User Interface Compiler) in your PATH. Try using --with-qt." "$LINENO" 5 fi fi @@ -16938,7 +16028,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RCC+:} false; then : +if test "${ac_cv_path_RCC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $RCC in @@ -16986,7 +16076,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RCC+:} false; then : +if test "${ac_cv_path_RCC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $RCC in @@ -17038,7 +16128,7 @@ $as_echo "$as_me: WARNING: Cannot find rcc (Qt Resource Compiler) in your PATH. QT_PATH=`dirname "$QMAKE"` fi if test x"$QT_PATH" = x; then - as_fn_error $? "Cannot find the path to your Qt install. Use --with-qt." "$LINENO" 5 + as_fn_error $? "Cannot find the path to your Qt install. Use --with-qt." "$LINENO" 5 fi @@ -17072,7 +16162,7 @@ $as_echo "$as_me: WARNING: Cannot find rcc (Qt Resource Compiler) in your PATH. then : else - as_fn_error $? "Cannot cd to or write in $my_tmpdir" "$LINENO" 5 + as_fn_error $? "Cannot cd to or write in $my_tmpdir" "$LINENO" 5 fi cat >conftest.h <<_ASEOF #include @@ -17111,14 +16201,14 @@ int main() } _ASEOF if $QMAKE -project; then :; else - as_fn_error $? "Calling $QMAKE -project failed." "$LINENO" 5 + as_fn_error $? "Calling $QMAKE -project failed." "$LINENO" 5 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 - as_fn_error $? "Can't find the .pro file generated by Qmake." "$LINENO" 5 + as_fn_error $? "Can't find the .pro file generated by Qmake." "$LINENO" 5 fi @@ -17131,12 +16221,12 @@ _ASEOF sed 's/^/| /' "$pro_file" >&5 if $QMAKE; then :; else - as_fn_error $? "Calling $QMAKE failed." "$LINENO" 5 + as_fn_error $? "Calling $QMAKE failed." "$LINENO" 5 fi # Try to compile a simple Qt app. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can build a simple Qt app" >&5 $as_echo_n "checking whether we can build a simple Qt app... " >&6; } -if ${at_cv_qt_build+:} false; then : +if test "${at_cv_qt_build+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_qt_build=ko @@ -17197,7 +16287,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $at_cv_qt_build" >&5 $as_echo "$at_cv_qt_build" >&6; } if test x"$at_cv_qt_build" = xko; then - as_fn_error $? "Cannot build a test Qt program" "$LINENO" 5 + as_fn_error $? "Cannot build a test Qt program" "$LINENO" 5 fi QT_VERSION_MAJOR=`echo "$at_cv_qt_build" | sed 's/^^0-9*//'` @@ -17223,13 +16313,13 @@ $as_echo "$at_cv_qt_build" >&6; } fi if test -f $at_mfile; then :; else cd "$my_configure_pwd" - as_fn_error $? "Cannot find the Makefile generated by qmake." "$LINENO" 5 + as_fn_error $? "Cannot find the Makefile generated by qmake." "$LINENO" 5 fi # Find the DEFINES of Qt (should have been named CPPFLAGS). { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the DEFINES to use with Qt" >&5 $as_echo_n "checking for the DEFINES to use with Qt... " >&6; } -if ${at_cv_env_QT_DEFINES+:} false; then : +if test "${at_cv_env_QT_DEFINES+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_DEFINES=`sed "/^DEFINES@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile` @@ -17242,7 +16332,7 @@ $as_echo "$at_cv_env_QT_DEFINES" >&6; } # Find the CFLAGS of Qt (We can use Qt in C?!) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the CFLAGS to use with Qt" >&5 $as_echo_n "checking for the CFLAGS to use with Qt... " >&6; } -if ${at_cv_env_QT_CFLAGS+:} false; then : +if test "${at_cv_env_QT_CFLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_CFLAGS=`sed "/^CFLAGS@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile` @@ -17255,7 +16345,7 @@ $as_echo "$at_cv_env_QT_CFLAGS" >&6; } # Find the CXXFLAGS of Qt. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the CXXFLAGS to use with Qt" >&5 $as_echo_n "checking for the CXXFLAGS to use with Qt... " >&6; } -if ${at_cv_env_QT_CXXFLAGS+:} false; then : +if test "${at_cv_env_QT_CXXFLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_CXXFLAGS=`sed "/^CXXFLAGS@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile` @@ -17268,7 +16358,7 @@ $as_echo "$at_cv_env_QT_CXXFLAGS" >&6; } # Find the INCPATH of Qt. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the INCPATH to use with Qt" >&5 $as_echo_n "checking for the INCPATH to use with Qt... " >&6; } -if ${at_cv_env_QT_INCPATH+:} false; then : +if test "${at_cv_env_QT_INCPATH+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_INCPATH=`sed "/^INCPATH@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile` @@ -17284,7 +16374,7 @@ $as_echo "$at_cv_env_QT_INCPATH" >&6; } # Find the LFLAGS of Qt (Should have been named LDFLAGS) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the LDFLAGS to use with Qt" >&5 $as_echo_n "checking for the LDFLAGS to use with Qt... " >&6; } -if ${at_cv_env_QT_LDFLAGS+:} false; then : +if test "${at_cv_env_QT_LDFLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_LDFLAGS=`sed "/^LDFLAGS@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile` @@ -17310,7 +16400,7 @@ $as_echo "$at_darwin" >&6; } # Find the LIBS of Qt. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the LIBS to use with Qt" >&5 $as_echo_n "checking for the LIBS to use with Qt... " >&6; } -if ${at_cv_env_QT_LIBS+:} false; then : +if test "${at_cv_env_QT_LIBS+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_LIBS=`sed "/^LIBS@<:@ @:>@*=/!d;$qt_sed_filter" $at_mfile` @@ -17334,11 +16424,11 @@ $as_echo "$at_cv_env_QT_LIBS" >&6; } if test x"$QMAKE" = x; then as_fn_error $? "\$QMAKE is empty. \ -Did you invoke AT@&t@_WITH_QT before AT@&t@_REQUIRE_QT_VERSION?" "$LINENO" 5 +Did you invoke AT@&t@_WITH_QT before AT@&t@_REQUIRE_QT_VERSION?" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt's version" >&5 $as_echo_n "checking for Qt's version... " >&6; } -if ${at_cv_QT_VERSION+:} false; then : +if test "${at_cv_QT_VERSION+set}" = set; then : $as_echo_n "(cached) " >&6 else echo "$as_me:$LINENO: Running $QMAKE --version:" >&5 @@ -17349,7 +16439,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $at_cv_QT_VERSION" >&5 $as_echo "$at_cv_QT_VERSION" >&6; } if test x"$at_cv_QT_VERSION" = x; then - as_fn_error $? "Cannot detect Qt's version." "$LINENO" 5 + as_fn_error $? "Cannot detect Qt's version." "$LINENO" 5 fi QT_VERSION=$at_cv_QT_VERSION @@ -17358,7 +16448,7 @@ as_arg_v2=4.3 awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null case $? in @%:@( 1) : - as_fn_error $? "This package requires Qt 4.3 or above." "$LINENO" 5 ;; @%:@( + as_fn_error $? "This package requires Qt 4.3 or above." "$LINENO" 5 ;; @%:@( 0) : ;; @%:@( 2) : @@ -17383,7 +16473,7 @@ if test "${enable_python+set}" = set; then : enableval=$enable_python; case "${enableval}" in yes) python=true ;; no) python=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-python" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-python" "$LINENO" 5 ;; esac else python=false @@ -17394,7 +16484,7 @@ if (test x$langall = xtrue || test x$python = xtrue) ;then set dummy python-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PYTHON_HEADERS+:} false; then : +if test "${ac_cv_prog_PYTHON_HEADERS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$PYTHON_HEADERS"; then @@ -17431,7 +16521,7 @@ fi set dummy swig$EXEEXT; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_HAVE_SWIG+:} false; then : +if test "${ac_cv_prog_HAVE_SWIG+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_SWIG"; then @@ -17465,20 +16555,20 @@ fi if (test "$PYTHON_HEADERS" && test "$HAVE_SWIG") ;then - test_python=true - + test_python=true + # Find any Python interpreter. if test -z "$PYTHON"; then - for ac_prog in python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 + for ac_prog in python python2 python3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PYTHON+:} false; then : +if test "${ac_cv_path_PYTHON+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PYTHON in @@ -17523,13 +16613,13 @@ test -n "$PYTHON" || PYTHON=":" if test "$PYTHON" = :; then - as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5 + as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } -if ${am_cv_python_version+:} false; then : +if test "${am_cv_python_version+set}" = set; then : $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` @@ -17548,7 +16638,7 @@ $as_echo "$am_cv_python_version" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } -if ${am_cv_python_platform+:} false; then : +if test "${am_cv_python_platform+set}" = set; then : $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` @@ -17562,7 +16652,7 @@ $as_echo "$am_cv_python_platform" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } -if ${am_cv_python_pythondir+:} false; then : +if test "${am_cv_python_pythondir+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$prefix" = xNONE @@ -17600,7 +16690,7 @@ $as_echo "$am_cv_python_pythondir" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } -if ${am_cv_python_pyexecdir+:} false; then : +if test "${am_cv_python_pyexecdir+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$exec_prefix" = xNONE @@ -17641,8 +16731,8 @@ $as_echo "$am_cv_python_pyexecdir" >&6; } else - echo Please install python-dev and swig packages - exit + echo Please install python-dev and swig packages + exit fi fi if test x$test_python = xtrue ; then @@ -17659,7 +16749,7 @@ if test "${enable_octave+set}" = set; then : enableval=$enable_octave; case "${enableval}" in yes) octave=true ;; no) octave=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-octave" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-octave" "$LINENO" 5 ;; esac else octave=false @@ -17670,7 +16760,7 @@ if (test x$langall = xtrue || test x$octave = xtrue) ;then set dummy octave-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCTAVE+:} false; then : +if test "${ac_cv_prog_OCTAVE+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OCTAVE"; then @@ -17707,8 +16797,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Octave arch" >&5 $as_echo_n "checking for Octave arch... " >&6; } OCTAVE_ARCH=`$OCTAVE -p CANONICAL_HOST_TYPE`-`$OCTAVE -p API_VERSION` - OCTINCLUDEDIR="`$OCTAVE -p OCTINCLUDEDIR`" - OCTAVE_INCFLAGS="-I$OCTINCLUDEDIR -I$OCTINCLUDEDIR/.." + OCTAVE_INCFLAGS="-I`$OCTAVE -p OCTINCLUDEDIR`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCTAVE_ARCH" >&5 $as_echo "$OCTAVE_ARCH" >&6; } OCTAVE_ARCH=$OCTAVE_ARCH @@ -17726,54 +16815,10 @@ else fi -@%:@ Check whether --enable-testio was given. -if test "${enable_testio+set}" = set; then : - enableval=$enable_testio; case "${enableval}" in - yes) testio=true ;; - no) testio=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-testio" "$LINENO" 5 ;; -esac -else - testio=false -fi - - if test x$testio = xtrue ; then - USE_TESTIO_TRUE= - USE_TESTIO_FALSE='#' -else - USE_TESTIO_TRUE='#' - USE_TESTIO_FALSE= -fi - - -@%:@ Check whether --enable-docs was given. -if test "${enable_docs+set}" = set; then : - enableval=$enable_docs; case "${enableval}" in - yes) docs=true ;; - no) docs=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-docs" "$LINENO" 5 ;; -esac -else - docs=false -fi - -if (test x$docs = xtrue || test x$all = xtrue) ;then - ac_config_files="$ac_config_files texinfo/Makefile texinfo/png/Makefile" - -fi - if (test x$docs = xtrue || test x$all = xtrue) ; then - USE_DOCS_TRUE= - USE_DOCS_FALSE='#' -else - USE_DOCS_TRUE='#' - USE_DOCS_FALSE= -fi - - AM_CXXFLAGS="$AM_CXXFLAGS -Wall $GSL_FLAGS" -ac_config_files="$ac_config_files Makefile mgl/Makefile examples/Makefile include/Makefile lang/Makefile utils/Makefile widgets/Makefile" +ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile widgets/Makefile lang/Makefile utils/Makefile examples/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -17839,21 +16884,10 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then + test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi + cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -17894,82 +16928,70 @@ fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_PTHREAD_TRUE}" && test -z "${USE_PTHREAD_FALSE}"; then as_fn_error $? "conditional \"USE_PTHREAD\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_GSL_TRUE}" && test -z "${USE_GSL_FALSE}"; then as_fn_error $? "conditional \"USE_GSL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_GLUT_TRUE}" && test -z "${USE_GLUT_FALSE}"; then as_fn_error $? "conditional \"USE_GLUT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_HDF5_TRUE}" && test -z "${USE_HDF5_FALSE}"; then as_fn_error $? "conditional \"USE_HDF5\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_HDF4_TRUE}" && test -z "${USE_HDF4_FALSE}"; then as_fn_error $? "conditional \"USE_HDF4\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_GIF_TRUE}" && test -z "${USE_GIF_FALSE}"; then - as_fn_error $? "conditional \"USE_GIF\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_JPEG_TRUE}" && test -z "${USE_JPEG_FALSE}"; then as_fn_error $? "conditional \"USE_JPEG\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_PDF_TRUE}" && test -z "${USE_PDF_FALSE}"; then as_fn_error $? "conditional \"USE_PDF\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_U3D_TRUE}" && test -z "${USE_U3D_FALSE}"; then as_fn_error $? "conditional \"USE_U3D\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_FLTK_TRUE}" && test -z "${USE_FLTK_FALSE}"; then as_fn_error $? "conditional \"USE_FLTK\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_WX_TRUE}" && test -z "${USE_WX_FALSE}"; then - as_fn_error $? "conditional \"USE_WX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_QT_TRUE}" && test -z "${USE_QT_FALSE}"; then as_fn_error $? "conditional \"USE_QT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_PYTHON_TRUE}" && test -z "${USE_PYTHON_FALSE}"; then as_fn_error $? "conditional \"USE_PYTHON\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_OCTAVE_TRUE}" && test -z "${USE_OCTAVE_FALSE}"; then as_fn_error $? "conditional \"USE_OCTAVE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_TESTIO_TRUE}" && test -z "${USE_TESTIO_FALSE}"; then - as_fn_error $? "conditional \"USE_TESTIO\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_DOCS_TRUE}" && test -z "${USE_DOCS_FALSE}"; then - as_fn_error $? "conditional \"USE_DOCS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 +Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -: "${CONFIG_STATUS=./config.status}" +: ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -18070,7 +17092,6 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -as_myself= case $0 in @%:@(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -18377,8 +17398,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by mathgl $as_me 1.11.2, which was -generated by GNU Autoconf 2.68. Invocation command line was +This file was extended by mathgl $as_me 2.0, which was +generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -18443,8 +17464,8 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -mathgl config.status 1.11.2 -configured by $0, generated by GNU Autoconf 2.68, +mathgl config.status 2.0 +configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. @@ -18572,212 +17593,186 @@ AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' -AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' -SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' -ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' -lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' -file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' -want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' -sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' -AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' -GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' -lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' -objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' -finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' -predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' -postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' -predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' -postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' -LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' -reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' -reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' -compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' -GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' -archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' -module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' -with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' -no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' -inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' -link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' -always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' -exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' -include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' -prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' -postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' -file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' -predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' -postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' -predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' -postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' +LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' +predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' +predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' +postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - # Quote evaled strings. -for var in AS \ -DLLTOOL \ -OBJDUMP \ -SHELL \ -ECHO \ -SED \ +for var in SED \ GREP \ EGREP \ FGREP \ @@ -18789,12 +17784,8 @@ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ -file_magic_glob \ -want_nocaseglob \ -sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ -archiver_list_spec \ STRIP \ RANLIB \ CC \ @@ -18804,14 +17795,14 @@ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -nm_file_list_spec \ +SHELL \ +ECHO \ lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_pic \ lt_prog_compiler_wl \ +lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ -MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ @@ -18827,6 +17818,7 @@ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ +fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ @@ -18834,7 +17826,6 @@ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ -install_override_mode \ finish_eval \ old_striplib \ striplib \ @@ -18845,11 +17836,10 @@ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ -reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ -lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ +lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ @@ -18861,6 +17851,7 @@ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ +fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ @@ -18870,9 +17861,9 @@ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -18894,13 +17885,11 @@ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ -postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ -reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ @@ -18909,11 +17898,10 @@ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ -prelink_cmds_CXX \ -postlink_cmds_CXX; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in +prelink_cmds_CXX; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -18921,6 +17909,12 @@ postlink_cmds_CXX; do esac done +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' @@ -18954,17 +17948,15 @@ do "include/mgl/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/mgl/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "texinfo/Makefile") CONFIG_FILES="$CONFIG_FILES texinfo/Makefile" ;; - "texinfo/png/Makefile") CONFIG_FILES="$CONFIG_FILES texinfo/png/Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "mgl/Makefile") CONFIG_FILES="$CONFIG_FILES mgl/Makefile" ;; - "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "widgets/Makefile") CONFIG_FILES="$CONFIG_FILES widgets/Makefile" ;; "lang/Makefile") CONFIG_FILES="$CONFIG_FILES lang/Makefile" ;; "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; - "widgets/Makefile") CONFIG_FILES="$CONFIG_FILES widgets/Makefile" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done @@ -18987,10 +17979,9 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= ac_tmp= + tmp= trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -18998,13 +17989,12 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" + test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -19026,7 +18016,7 @@ else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF @@ -19035,18 +18025,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -19054,7 +18044,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -19102,7 +18092,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && +cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -19134,8 +18124,8 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), @@ -19168,7 +18158,7 @@ fi # test -n "$CONFIG_FILES" # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || +cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -19180,11 +18170,11 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then break elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -19269,7 +18259,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -19282,7 +18272,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -19301,7 +18291,7 @@ do for ac_f do case $ac_f in - -) ac_f="$ac_tmp/stdin";; + -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -19310,7 +18300,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -19336,8 +18326,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -19473,24 +18463,23 @@ s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$ac_tmp/stdin" + rm -f "$tmp/stdin" case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -19499,21 +18488,21 @@ which seems to be undefined. Please make sure it is defined" >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + mv "$tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" @@ -19674,8 +18663,7 @@ $as_echo X"$file" | # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -19708,13 +18696,13 @@ available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Assembler program. -AS=$lt_AS +AS=$AS # DLL creation program. -DLLTOOL=$lt_DLLTOOL +DLLTOOL=$DLLTOOL # Object dumper program. -OBJDUMP=$lt_OBJDUMP +OBJDUMP=$OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version @@ -19732,12 +18720,6 @@ pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - # The host system. host_alias=$host_alias host=$host @@ -19787,36 +18769,20 @@ SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method = "file_magic". +# Command to use when deplibs_check_method == "file_magic". file_magic_cmd=$lt_file_magic_cmd -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob=$lt_file_magic_glob - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob=$lt_want_nocaseglob - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - # The archiver. AR=$lt_AR - -# Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - # A symbol stripping program. STRIP=$lt_STRIP @@ -19825,9 +18791,6 @@ RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - # A C compiler. LTCC=$lt_CC @@ -19846,24 +18809,21 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix -# Specify filename containing input files for \$NM. -nm_file_list_spec=$lt_nm_file_list_spec - -# The root where to search for dependent libraries,and in which our libraries should be installed. -lt_sysroot=$lt_sysroot - # The name of the directory that contains temporary libtool files. objdir=$objdir +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL @@ -19920,9 +18880,6 @@ library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds @@ -19962,10 +18919,6 @@ striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds @@ -19978,12 +18931,12 @@ with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static @@ -20070,6 +19023,9 @@ inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols @@ -20085,9 +19041,6 @@ include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - # Specify filename containing input files. file_list_spec=$lt_file_list_spec @@ -20134,169 +19087,212 @@ ltmain="$ac_aux_dir/ltmain.sh" # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - if test x"$xsi_shell" = xyes; then - sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ -func_dirname ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_basename ()$/,/^} # func_basename /c\ -func_basename ()\ -{\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ -func_dirname_and_basename ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ -func_stripname ()\ -{\ -\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ -\ # positional parameters, so assign one to ordinary parameter first.\ -\ func_stripname_result=${3}\ -\ func_stripname_result=${func_stripname_result#"${1}"}\ -\ func_stripname_result=${func_stripname_result%"${2}"}\ -} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ -func_split_long_opt ()\ -{\ -\ func_split_long_opt_name=${1%%=*}\ -\ func_split_long_opt_arg=${1#*=}\ -} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ -func_split_short_opt ()\ -{\ -\ func_split_short_opt_arg=${1#??}\ -\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ -} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ -func_lo2o ()\ -{\ -\ case ${1} in\ -\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ -\ *) func_lo2o_result=${1} ;;\ -\ esac\ -} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_xform ()$/,/^} # func_xform /c\ -func_xform ()\ -{\ - func_xform_result=${1%.*}.lo\ -} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_arith ()$/,/^} # func_arith /c\ -func_arith ()\ -{\ - func_arith_result=$(( $* ))\ -} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_len ()$/,/^} # func_len /c\ -func_len ()\ -{\ - func_len_result=${#1}\ -} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - -fi - -if test x"$lt_shell_append" = xyes; then - sed -e '/^func_append ()$/,/^} # func_append /c\ -func_append ()\ -{\ - eval "${1}+=\\${2}"\ -} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ -func_append_quoted ()\ -{\ -\ func_quote_for_eval "${2}"\ -\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ -} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 -$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} -fi - - - mv -f "$cfgfile" "$ofile" || + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} + +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -20308,10 +19304,6 @@ fi # The linker used to build libraries. LD=$lt_LD_CXX -# How to create reloadable object files. -reload_flag=$lt_reload_flag_CXX -reload_cmds=$lt_reload_cmds_CXX - # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX @@ -20324,12 +19316,12 @@ with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX - # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX @@ -20416,6 +19408,9 @@ inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path_CXX + # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX @@ -20431,9 +19426,6 @@ include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds_CXX - # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX @@ -20468,7 +19460,7 @@ _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. diff --git a/autom4te.cache/requests b/autom4te.cache/requests index 51fb085..25a790d 100644 --- a/autom4te.cache/requests +++ b/autom4te.cache/requests @@ -1,4 +1,4 @@ -# This file was generated. +# This file was generated by Autom4te Thu Aug 5 21:29:16 UTC 2010. # It contains the lists of macros which have been traced. # It can be safely removed. @@ -70,16 +70,14 @@ 'LT_SYS_SYMBOL_USCORE' => 1, '_AM_PROG_TAR' => 1, 'AC_LIBTOOL_GCJ' => 1, - '_LT_WITH_SYSROOT' => 1, - 'LT_FUNC_DLSYM_USCORE' => 1, 'LT_SYS_DLOPEN_DEPLIBS' => 1, - '_LT_AC_LANG_F77' => 1, + 'LT_FUNC_DLSYM_USCORE' => 1, 'AC_LIBTOOL_CONFIG' => 1, + '_LT_AC_LANG_F77' => 1, '_AM_SUBST_NOTMAKE' => 1, 'AC_LTDL_DLLIB' => 1, '_AM_AUTOCONF_VERSION' => 1, 'AM_DISABLE_SHARED' => 1, - '_LT_PROG_ECHO_BACKSLASH' => 1, '_LTDL_SETUP' => 1, '_LT_AC_LANG_CXX' => 1, 'AM_PROG_LIBTOOL' => 1, @@ -97,7 +95,6 @@ '_AM_SET_OPTION' => 1, 'AC_LTDL_PREOPEN' => 1, '_LT_LINKER_BOILERPLATE' => 1, - '_LT_PREPARE_SED_QUOTE_VARS' => 1, 'AC_LIBTOOL_LANG_CXX_CONFIG' => 1, 'AC_LIBTOOL_PROG_CC_C_O' => 1, 'gl_PREREQ_ARGZ' => 1, @@ -124,7 +121,6 @@ '_LT_AC_LANG_GCJ_CONFIG' => 1, 'AC_ENABLE_SHARED' => 1, 'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1, - '_LT_REQUIRED_DARWIN_CHECKS' => 1, 'AC_ENABLE_STATIC' => 1, '_LT_AC_TAGVAR' => 1, 'AC_LIBTOOL_LANG_F77_CONFIG' => 1, @@ -133,8 +129,6 @@ '_AT_TWEAK_PRO_FILE' => 1, 'LTVERSION_VERSION' => 1, 'LTDL_INIT' => 1, - '_LT_PROG_F77' => 1, - '_LT_PROG_CXX' => 1, 'AM_PROG_INSTALL_SH' => 1, 'm4_include' => 1, 'AC_PROG_EGREP' => 1, @@ -170,14 +164,12 @@ 'LT_SYS_DLOPEN_SELF' => 1, 'AM_DISABLE_STATIC' => 1, 'AM_DEP_TRACK' => 1, - '_LT_AC_PROG_CXXCPP' => 1, '_AC_PROG_LIBTOOL' => 1, '_AM_IF_OPTION' => 1, 'AC_PATH_TOOL_PREFIX' => 1, - 'AC_LIBTOOL_F77' => 1, 'm4_pattern_allow' => 1, + 'AC_LIBTOOL_F77' => 1, 'AM_SET_LEADING_DOT' => 1, - '_LT_PROG_FC' => 1, 'LT_AC_PROG_EGREP' => 1, '_AM_DEPENDENCIES' => 1, 'AC_LIBTOOL_LANG_C_CONFIG' => 1, @@ -189,8 +181,8 @@ 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, 'AC_LIBLTDL_INSTALLABLE' => 1, 'AC_LTDL_ENABLE_INSTALL' => 1, - 'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1, 'LT_PROG_GCJ' => 1, + 'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1, 'AM_INIT_AUTOMAKE' => 1, 'AC_DISABLE_STATIC' => 1, 'LT_PATH_NM' => 1, @@ -246,7 +238,6 @@ 'AC_CANONICAL_HOST' => 1, 'AC_PROG_LIBTOOL' => 1, 'AM_INIT_AUTOMAKE' => 1, - 'AM_PATH_GUILE' => 1, 'AC_CONFIG_SUBDIRS' => 1, 'AM_AUTOMAKE_VERSION' => 1, 'LT_CONFIG_LTDL_DIR' => 1, @@ -255,20 +246,15 @@ 'm4_sinclude' => 1, 'LT_SUPPORTED_TAG' => 1, 'AM_MAINTAINER_MODE' => 1, - 'AM_NLS' => 1, 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, - 'AM_MAKEFILE_INCLUDE' => 1, '_m4_warn' => 1, 'AM_PROG_CXX_C_O' => 1, '_AM_COND_ENDIF' => 1, - '_AM_MAKEFILE_INCLUDE' => 1, 'AM_ENABLE_MULTILIB' => 1, 'AM_SILENT_RULES' => 1, - 'AM_PROG_MOC' => 1, 'AC_CONFIG_FILES' => 1, 'include' => 1, 'LT_INIT' => 1, - 'AM_PROG_AR' => 1, 'AM_GNU_GETTEXT' => 1, 'AC_LIBSOURCE' => 1, 'AM_PROG_FC_C_O' => 1, @@ -280,12 +266,10 @@ 'sinclude' => 1, 'AM_PROG_CC_C_O' => 1, 'm4_pattern_allow' => 1, - 'AM_XGETTEXT_OPTION' => 1, 'AC_CANONICAL_SYSTEM' => 1, 'AM_CONDITIONAL' => 1, 'AC_CONFIG_HEADERS' => 1, 'AC_DEFINE_TRACE_LITERAL' => 1, - 'AM_POT_TOOLS' => 1, 'm4_include' => 1, '_AM_COND_ELSE' => 1, 'AC_SUBST_TRACE' => 1 diff --git a/autom4te.cache/traces.0 b/autom4te.cache/traces.0 index 57e798d..8370f32 100644 --- a/autom4te.cache/traces.0 +++ b/autom4te.cache/traces.0 @@ -54,7 +54,7 @@ AS_IF([test -z "$ARGZ_H"], ;; #( *) lt_cv_sys_argz_works=yes ;; esac]]) - AS_IF([test "$lt_cv_sys_argz_works" = yes], + AS_IF([test $lt_cv_sys_argz_works = yes], [AC_DEFINE([HAVE_WORKING_ARGZ], 1, [This value is set to 1 to indicate that the system argz facility works])], [ARGZ_H=argz.h @@ -63,8 +63,7 @@ AS_IF([test -z "$ARGZ_H"], AC_SUBST([ARGZ_H]) ]) m4trace:/usr/share/aclocal/argz.m4:79: -1- AC_DEFUN([gl_PREREQ_ARGZ], [:]) -m4trace:/usr/share/aclocal/libtool.m4:69: -1- AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +m4trace:/usr/share/aclocal/libtool.m4:67: -1- AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl @@ -81,8 +80,6 @@ AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) - dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) @@ -98,21 +95,30 @@ _LT_SETUP # Only expand once: m4_define([LT_INIT]) ]) -m4trace:/usr/share/aclocal/libtool.m4:107: -1- AU_DEFUN([AC_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:107: -1- AC_DEFUN([AC_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:102: -1- AU_DEFUN([AC_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:102: -1- AC_DEFUN([AC_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:108: -1- AU_DEFUN([AM_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:108: -1- AC_DEFUN([AM_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:103: -1- AU_DEFUN([AM_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:103: -1- AC_DEFUN([AM_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:607: -1- AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} +m4trace:/usr/share/aclocal/libtool.m4:562: -1- AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], -[# Run this file to recreate a libtool stub with the current configuration.]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. -cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 exec AS_MESSAGE_LOG_FD>>config.log { echo @@ -138,7 +144,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -183,16 +189,18 @@ chmod +x "$CONFIG_LT" # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. -lt_cl_success=: -test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" -exec AS_MESSAGE_LOG_FD>/dev/null -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false -exec AS_MESSAGE_LOG_FD>>config.log -$lt_cl_success || AS_EXIT(1) +if test "$no_create" != yes; then + lt_cl_success=: + test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false + exec AS_MESSAGE_LOG_FD>>config.log + $lt_cl_success || AS_EXIT(1) +fi ]) -m4trace:/usr/share/aclocal/libtool.m4:788: -1- AC_DEFUN([LT_SUPPORTED_TAG], []) -m4trace:/usr/share/aclocal/libtool.m4:799: -1- AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl +m4trace:/usr/share/aclocal/libtool.m4:757: -1- AC_DEFUN([LT_SUPPORTED_TAG], []) +m4trace:/usr/share/aclocal/libtool.m4:768: -1- AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], @@ -204,56 +212,23 @@ m4_case([$1], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ]) -m4trace:/usr/share/aclocal/libtool.m4:861: -1- AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) -m4trace:/usr/share/aclocal/libtool.m4:861: -1- AC_DEFUN([AC_LIBTOOL_CXX], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_CXX' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:830: -1- AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +m4trace:/usr/share/aclocal/libtool.m4:830: -1- AC_DEFUN([AC_LIBTOOL_CXX], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_CXX' is obsolete. You should run autoupdate.])dnl LT_LANG(C++)]) -m4trace:/usr/share/aclocal/libtool.m4:862: -1- AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) -m4trace:/usr/share/aclocal/libtool.m4:862: -1- AC_DEFUN([AC_LIBTOOL_F77], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_F77' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:831: -1- AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +m4trace:/usr/share/aclocal/libtool.m4:831: -1- AC_DEFUN([AC_LIBTOOL_F77], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_F77' is obsolete. You should run autoupdate.])dnl LT_LANG(Fortran 77)]) -m4trace:/usr/share/aclocal/libtool.m4:863: -1- AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) -m4trace:/usr/share/aclocal/libtool.m4:863: -1- AC_DEFUN([AC_LIBTOOL_FC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_FC' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:832: -1- AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +m4trace:/usr/share/aclocal/libtool.m4:832: -1- AC_DEFUN([AC_LIBTOOL_FC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_FC' is obsolete. You should run autoupdate.])dnl LT_LANG(Fortran)]) -m4trace:/usr/share/aclocal/libtool.m4:864: -1- AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) -m4trace:/usr/share/aclocal/libtool.m4:864: -1- AC_DEFUN([AC_LIBTOOL_GCJ], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_GCJ' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:833: -1- AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +m4trace:/usr/share/aclocal/libtool.m4:833: -1- AC_DEFUN([AC_LIBTOOL_GCJ], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_GCJ' is obsolete. You should run autoupdate.])dnl LT_LANG(Java)]) -m4trace:/usr/share/aclocal/libtool.m4:865: -1- AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) -m4trace:/usr/share/aclocal/libtool.m4:865: -1- AC_DEFUN([AC_LIBTOOL_RC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_RC' is obsolete. -You should run autoupdate.])dnl -LT_LANG(Windows Resource)]) -m4trace:/usr/share/aclocal/libtool.m4:1181: -1- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) -AC_ARG_WITH([sysroot], -[ --with-sysroot[=DIR] Search for dependent libraries within DIR - (or the compiler's sysroot if not specified).], -[], [with_sysroot=no]) - -dnl lt_sysroot will always be passed unquoted. We quote it here -dnl in case the user passed a directory name. -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - AC_MSG_RESULT([${with_sysroot}]) - AC_MSG_ERROR([The sysroot must be an absolute path.]) - ;; -esac - - AC_MSG_RESULT([${lt_sysroot:-no}]) -_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and in which our libraries should be installed.])]) -m4trace:/usr/share/aclocal/libtool.m4:1445: -1- AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4trace:/usr/share/aclocal/libtool.m4:1402: -1- AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no @@ -269,15 +244,15 @@ AC_CACHE_CHECK([$1], [$2], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -292,11 +267,11 @@ else m4_if([$6], , :, [$6]) fi ]) -m4trace:/usr/share/aclocal/libtool.m4:1487: -1- AU_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:1487: -1- AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_COMPILER_OPTION' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:1444: -1- AU_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:1444: -1- AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_COMPILER_OPTION' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:1496: -1- AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4trace:/usr/share/aclocal/libtool.m4:1453: -1- AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no @@ -309,7 +284,7 @@ AC_CACHE_CHECK([$1], [$2], if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -328,11 +303,11 @@ else m4_if([$5], , :, [$5]) fi ]) -m4trace:/usr/share/aclocal/libtool.m4:1531: -1- AU_DEFUN([AC_LIBTOOL_LINKER_OPTION], [m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:1531: -1- AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_LINKER_OPTION' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:1488: -1- AU_DEFUN([AC_LIBTOOL_LINKER_OPTION], [m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:1488: -1- AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_LINKER_OPTION' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:1538: -1- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4trace:/usr/share/aclocal/libtool.m4:1495: -1- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl @@ -366,11 +341,6 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -435,8 +405,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -462,11 +432,11 @@ max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ]) -m4trace:/usr/share/aclocal/libtool.m4:1671: -1- AU_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:1671: -1- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_SYS_MAX_CMD_LEN' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:1623: -1- AU_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:1623: -1- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_SYS_MAX_CMD_LEN' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:1782: -1- AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl +m4trace:/usr/share/aclocal/libtool.m4:1724: -1- AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown @@ -580,11 +550,11 @@ _LT_DECL([dlopen_self], [enable_dlopen_self], [0], _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ]) -m4trace:/usr/share/aclocal/libtool.m4:1899: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:1899: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN_SELF' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:1841: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:1841: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN_SELF' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:2875: -1- AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl +m4trace:/usr/share/aclocal/libtool.m4:2741: -1- AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in @@ -643,16 +613,15 @@ fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ]) -m4trace:/usr/share/aclocal/libtool.m4:2937: -1- AU_DEFUN([AC_PATH_TOOL_PREFIX], [m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:2937: -1- AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_DIAGNOSE([obsolete], [The macro `AC_PATH_TOOL_PREFIX' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:2803: -1- AU_DEFUN([AC_PATH_TOOL_PREFIX], [m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:2803: -1- AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_DIAGNOSE([obsolete], [The macro `AC_PATH_TOOL_PREFIX' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:2960: -1- AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl +m4trace:/usr/share/aclocal/libtool.m4:2826: -1- AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], @@ -733,15 +702,15 @@ AC_SUBST([LD]) _LT_TAGDECL([], [LD], [1], [The linker used to build libraries]) ]) -m4trace:/usr/share/aclocal/libtool.m4:3049: -1- AU_DEFUN([AM_PROG_LD], [m4_if($#, 0, [LT_PATH_LD], [LT_PATH_LD($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:3049: -1- AC_DEFUN([AM_PROG_LD], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_LD' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:2914: -1- AU_DEFUN([AM_PROG_LD], [m4_if($#, 0, [LT_PATH_LD], [LT_PATH_LD($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:2914: -1- AC_DEFUN([AM_PROG_LD], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_LD' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PATH_LD], [LT_PATH_LD($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:3050: -1- AU_DEFUN([AC_PROG_LD], [m4_if($#, 0, [LT_PATH_LD], [LT_PATH_LD($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:3050: -1- AC_DEFUN([AC_PROG_LD], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_LD' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:2915: -1- AU_DEFUN([AC_PROG_LD], [m4_if($#, 0, [LT_PATH_LD], [LT_PATH_LD($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:2915: -1- AC_DEFUN([AC_PROG_LD], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_LD' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PATH_LD], [LT_PATH_LD($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:3344: -1- AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl +m4trace:/usr/share/aclocal/libtool.m4:3179: -1- AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. @@ -790,19 +759,7 @@ if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi + AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -815,31 +772,31 @@ _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ]) -m4trace:/usr/share/aclocal/libtool.m4:3434: -1- AU_DEFUN([AM_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:3434: -1- AC_DEFUN([AM_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_NM' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:3257: -1- AU_DEFUN([AM_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:3257: -1- AC_DEFUN([AM_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_NM' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:3435: -1- AU_DEFUN([AC_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:3435: -1- AC_DEFUN([AC_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_NM' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:3258: -1- AU_DEFUN([AC_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:3258: -1- AC_DEFUN([AC_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_NM' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:3505: -1- AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4trace:/usr/share/aclocal/libtool.m4:3267: -1- AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) @@ -852,28 +809,28 @@ case $host in esac AC_SUBST([LIBM]) ]) -m4trace:/usr/share/aclocal/libtool.m4:3524: -1- AU_DEFUN([AC_CHECK_LIBM], [m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:3524: -1- AC_DEFUN([AC_CHECK_LIBM], [AC_DIAGNOSE([obsolete], [The macro `AC_CHECK_LIBM' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:3286: -1- AU_DEFUN([AC_CHECK_LIBM], [m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:3286: -1- AC_DEFUN([AC_CHECK_LIBM], [AC_DIAGNOSE([obsolete], [The macro `AC_CHECK_LIBM' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:7482: -1- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], +m4trace:/usr/share/aclocal/libtool.m4:6987: -1- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) -m4trace:/usr/share/aclocal/libtool.m4:7491: -1- AU_DEFUN([LT_AC_PROG_GCJ], [m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:7491: -1- AC_DEFUN([LT_AC_PROG_GCJ], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_GCJ' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:6996: -1- AU_DEFUN([LT_AC_PROG_GCJ], [m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:6996: -1- AC_DEFUN([LT_AC_PROG_GCJ], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_GCJ' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:7498: -1- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) +m4trace:/usr/share/aclocal/libtool.m4:7003: -1- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) -m4trace:/usr/share/aclocal/libtool.m4:7503: -1- AU_DEFUN([LT_AC_PROG_RC], [m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:7503: -1- AC_DEFUN([LT_AC_PROG_RC], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_RC' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:7008: -1- AU_DEFUN([LT_AC_PROG_RC], [m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:7008: -1- AC_DEFUN([LT_AC_PROG_RC], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_RC' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:7623: -1- AU_DEFUN([LT_AC_PROG_SED], [m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) -m4trace:/usr/share/aclocal/libtool.m4:7623: -1- AC_DEFUN([LT_AC_PROG_SED], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_SED' is obsolete. +m4trace:/usr/share/aclocal/libtool.m4:7119: -1- AU_DEFUN([LT_AC_PROG_SED], [m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) +m4trace:/usr/share/aclocal/libtool.m4:7119: -1- AC_DEFUN([LT_AC_PROG_SED], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_SED' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) m4trace:/usr/share/aclocal/ltdl.m4:16: -1- AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT]) @@ -1090,19 +1047,13 @@ AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) -m4_pattern_allow([LT_LIBEXT])dnl AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) -name= -eval "lt_libprefix=\"$libname_spec\"" -m4_pattern_allow([LT_LIBPREFIX])dnl -AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix]) - name=ltdl -eval "LTDLOPEN=\"$libname_spec\"" +LTDLOPEN=`eval "\\$ECHO \"$libname_spec\""` AC_SUBST([LTDLOPEN]) ]) -m4trace:/usr/share/aclocal/ltdl.m4:443: -1- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4trace:/usr/share/aclocal/ltdl.m4:437: -1- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether deplibs are loaded by dlopen], [lt_cv_sys_dlopen_deplibs], [# PORTME does your system automatically load deplibs for dlopen? @@ -1154,7 +1105,7 @@ AC_CACHE_CHECK([whether deplibs are loaded by dlopen], # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) @@ -1198,11 +1149,11 @@ if test "$lt_cv_sys_dlopen_deplibs" != yes; then [Define if the OS needs help to load dependent libraries for dlopen().]) fi ]) -m4trace:/usr/share/aclocal/ltdl.m4:542: -1- AU_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [m4_if($#, 0, [LT_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS($@)])]) -m4trace:/usr/share/aclocal/ltdl.m4:542: -1- AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYS_DLOPEN_DEPLIBS' is obsolete. +m4trace:/usr/share/aclocal/ltdl.m4:536: -1- AU_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [m4_if($#, 0, [LT_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:536: -1- AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYS_DLOPEN_DEPLIBS' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS($@)])]) -m4trace:/usr/share/aclocal/ltdl.m4:549: -1- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +m4trace:/usr/share/aclocal/ltdl.m4:543: -1- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([which extension is used for runtime loadable modules], [libltdl_cv_shlibext], [ @@ -1215,11 +1166,11 @@ if test -n "$libltdl_cv_shlibext"; then [Define to the extension used for runtime loadable modules, say, ".so".]) fi ]) -m4trace:/usr/share/aclocal/ltdl.m4:565: -1- AU_DEFUN([AC_LTDL_SHLIBEXT], [m4_if($#, 0, [LT_SYS_MODULE_EXT], [LT_SYS_MODULE_EXT($@)])]) -m4trace:/usr/share/aclocal/ltdl.m4:565: -1- AC_DEFUN([AC_LTDL_SHLIBEXT], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SHLIBEXT' is obsolete. +m4trace:/usr/share/aclocal/ltdl.m4:559: -1- AU_DEFUN([AC_LTDL_SHLIBEXT], [m4_if($#, 0, [LT_SYS_MODULE_EXT], [LT_SYS_MODULE_EXT($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:559: -1- AC_DEFUN([AC_LTDL_SHLIBEXT], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SHLIBEXT' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_MODULE_EXT], [LT_SYS_MODULE_EXT($@)])]) -m4trace:/usr/share/aclocal/ltdl.m4:572: -1- AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +m4trace:/usr/share/aclocal/ltdl.m4:566: -1- AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([which variable specifies run-time module search path], [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"]) if test -n "$lt_cv_module_path_var"; then @@ -1228,11 +1179,11 @@ if test -n "$lt_cv_module_path_var"; then [Define to the name of the environment variable that determines the run-time module search path.]) fi ]) -m4trace:/usr/share/aclocal/ltdl.m4:584: -1- AU_DEFUN([AC_LTDL_SHLIBPATH], [m4_if($#, 0, [LT_SYS_MODULE_PATH], [LT_SYS_MODULE_PATH($@)])]) -m4trace:/usr/share/aclocal/ltdl.m4:584: -1- AC_DEFUN([AC_LTDL_SHLIBPATH], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SHLIBPATH' is obsolete. +m4trace:/usr/share/aclocal/ltdl.m4:578: -1- AU_DEFUN([AC_LTDL_SHLIBPATH], [m4_if($#, 0, [LT_SYS_MODULE_PATH], [LT_SYS_MODULE_PATH($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:578: -1- AC_DEFUN([AC_LTDL_SHLIBPATH], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SHLIBPATH' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_MODULE_PATH], [LT_SYS_MODULE_PATH($@)])]) -m4trace:/usr/share/aclocal/ltdl.m4:591: -1- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl +m4trace:/usr/share/aclocal/ltdl.m4:585: -1- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([for the default library search path], [lt_cv_sys_dlsearch_path], [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"]) @@ -1250,11 +1201,11 @@ if test -n "$lt_cv_sys_dlsearch_path"; then [Define to the system default library search path.]) fi ]) -m4trace:/usr/share/aclocal/ltdl.m4:612: -1- AU_DEFUN([AC_LTDL_SYSSEARCHPATH], [m4_if($#, 0, [LT_SYS_DLSEARCH_PATH], [LT_SYS_DLSEARCH_PATH($@)])]) -m4trace:/usr/share/aclocal/ltdl.m4:612: -1- AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYSSEARCHPATH' is obsolete. +m4trace:/usr/share/aclocal/ltdl.m4:606: -1- AU_DEFUN([AC_LTDL_SYSSEARCHPATH], [m4_if($#, 0, [LT_SYS_DLSEARCH_PATH], [LT_SYS_DLSEARCH_PATH($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:606: -1- AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYSSEARCHPATH' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_DLSEARCH_PATH], [LT_SYS_DLSEARCH_PATH($@)])]) -m4trace:/usr/share/aclocal/ltdl.m4:638: -1- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) +m4trace:/usr/share/aclocal/ltdl.m4:632: -1- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) LT_DLLOADERS= AC_SUBST([LT_DLLOADERS]) @@ -1344,11 +1295,11 @@ AC_SUBST([LIBADD_DL]) AC_LANG_POP ]) -m4trace:/usr/share/aclocal/ltdl.m4:731: -1- AU_DEFUN([AC_LTDL_DLLIB], [m4_if($#, 0, [LT_LIB_DLLOAD], [LT_LIB_DLLOAD($@)])]) -m4trace:/usr/share/aclocal/ltdl.m4:731: -1- AC_DEFUN([AC_LTDL_DLLIB], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_DLLIB' is obsolete. +m4trace:/usr/share/aclocal/ltdl.m4:725: -1- AU_DEFUN([AC_LTDL_DLLIB], [m4_if($#, 0, [LT_LIB_DLLOAD], [LT_LIB_DLLOAD($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:725: -1- AC_DEFUN([AC_LTDL_DLLIB], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_DLLIB' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_LIB_DLLOAD], [LT_LIB_DLLOAD($@)])]) -m4trace:/usr/share/aclocal/ltdl.m4:739: -1- AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4trace:/usr/share/aclocal/ltdl.m4:733: -1- AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([for _ prefix in compiled symbols], [lt_cv_sys_symbol_underscore], [lt_cv_sys_symbol_underscore=no @@ -1382,11 +1333,11 @@ _LT_EOF sys_symbol_underscore=$lt_cv_sys_symbol_underscore AC_SUBST([sys_symbol_underscore]) ]) -m4trace:/usr/share/aclocal/ltdl.m4:776: -1- AU_DEFUN([AC_LTDL_SYMBOL_USCORE], [m4_if($#, 0, [LT_SYS_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE($@)])]) -m4trace:/usr/share/aclocal/ltdl.m4:776: -1- AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYMBOL_USCORE' is obsolete. +m4trace:/usr/share/aclocal/ltdl.m4:770: -1- AU_DEFUN([AC_LTDL_SYMBOL_USCORE], [m4_if($#, 0, [LT_SYS_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:770: -1- AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_SYMBOL_USCORE' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE($@)])]) -m4trace:/usr/share/aclocal/ltdl.m4:783: -1- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl +m4trace:/usr/share/aclocal/ltdl.m4:777: -1- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl if test x"$lt_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then @@ -1408,30 +1359,30 @@ if test x"$libltdl_cv_need_uscore" = xyes; then [Define if dlsym() requires a leading underscore in symbol names.]) fi ]) -m4trace:/usr/share/aclocal/ltdl.m4:808: -1- AU_DEFUN([AC_LTDL_DLSYM_USCORE], [m4_if($#, 0, [LT_FUNC_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE($@)])]) -m4trace:/usr/share/aclocal/ltdl.m4:808: -1- AC_DEFUN([AC_LTDL_DLSYM_USCORE], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_DLSYM_USCORE' is obsolete. +m4trace:/usr/share/aclocal/ltdl.m4:802: -1- AU_DEFUN([AC_LTDL_DLSYM_USCORE], [m4_if($#, 0, [LT_FUNC_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE($@)])]) +m4trace:/usr/share/aclocal/ltdl.m4:802: -1- AC_DEFUN([AC_LTDL_DLSYM_USCORE], [AC_DIAGNOSE([obsolete], [The macro `AC_LTDL_DLSYM_USCORE' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_FUNC_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE($@)])]) -m4trace:/usr/share/aclocal/ltoptions.m4:14: -1- AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) -m4trace:/usr/share/aclocal/ltoptions.m4:111: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) +m4trace:/usr/share/aclocal/ltoptions.m4:13: -1- AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) +m4trace:/usr/share/aclocal/ltoptions.m4:110: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) -m4trace:/usr/share/aclocal/ltoptions.m4:111: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN' is obsolete. +m4trace:/usr/share/aclocal/ltoptions.m4:110: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) -m4trace:/usr/share/aclocal/ltoptions.m4:146: -1- AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4trace:/usr/share/aclocal/ltoptions.m4:145: -1- AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) -m4trace:/usr/share/aclocal/ltoptions.m4:146: -1- AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. +m4trace:/usr/share/aclocal/ltoptions.m4:145: -1- AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. You should run autoupdate.])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) @@ -1439,60 +1390,60 @@ AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) -m4trace:/usr/share/aclocal/ltoptions.m4:195: -1- AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +m4trace:/usr/share/aclocal/ltoptions.m4:194: -1- AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) -m4trace:/usr/share/aclocal/ltoptions.m4:199: -1- AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) +m4trace:/usr/share/aclocal/ltoptions.m4:198: -1- AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) -m4trace:/usr/share/aclocal/ltoptions.m4:203: -1- AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -m4trace:/usr/share/aclocal/ltoptions.m4:203: -1- AC_DEFUN([AM_ENABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_SHARED' is obsolete. +m4trace:/usr/share/aclocal/ltoptions.m4:202: -1- AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +m4trace:/usr/share/aclocal/ltoptions.m4:202: -1- AC_DEFUN([AM_ENABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_SHARED' is obsolete. You should run autoupdate.])dnl AC_ENABLE_SHARED($@)]) -m4trace:/usr/share/aclocal/ltoptions.m4:204: -1- AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -m4trace:/usr/share/aclocal/ltoptions.m4:204: -1- AC_DEFUN([AM_DISABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_SHARED' is obsolete. +m4trace:/usr/share/aclocal/ltoptions.m4:203: -1- AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +m4trace:/usr/share/aclocal/ltoptions.m4:203: -1- AC_DEFUN([AM_DISABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_SHARED' is obsolete. You should run autoupdate.])dnl AC_DISABLE_SHARED($@)]) -m4trace:/usr/share/aclocal/ltoptions.m4:249: -1- AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +m4trace:/usr/share/aclocal/ltoptions.m4:248: -1- AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) -m4trace:/usr/share/aclocal/ltoptions.m4:253: -1- AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) +m4trace:/usr/share/aclocal/ltoptions.m4:252: -1- AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) -m4trace:/usr/share/aclocal/ltoptions.m4:257: -1- AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -m4trace:/usr/share/aclocal/ltoptions.m4:257: -1- AC_DEFUN([AM_ENABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_STATIC' is obsolete. +m4trace:/usr/share/aclocal/ltoptions.m4:256: -1- AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +m4trace:/usr/share/aclocal/ltoptions.m4:256: -1- AC_DEFUN([AM_ENABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_STATIC' is obsolete. You should run autoupdate.])dnl AC_ENABLE_STATIC($@)]) -m4trace:/usr/share/aclocal/ltoptions.m4:258: -1- AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -m4trace:/usr/share/aclocal/ltoptions.m4:258: -1- AC_DEFUN([AM_DISABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_STATIC' is obsolete. +m4trace:/usr/share/aclocal/ltoptions.m4:257: -1- AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +m4trace:/usr/share/aclocal/ltoptions.m4:257: -1- AC_DEFUN([AM_DISABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_STATIC' is obsolete. You should run autoupdate.])dnl AC_DISABLE_STATIC($@)]) -m4trace:/usr/share/aclocal/ltoptions.m4:303: -1- AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +m4trace:/usr/share/aclocal/ltoptions.m4:302: -1- AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) -m4trace:/usr/share/aclocal/ltoptions.m4:303: -1- AC_DEFUN([AC_ENABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_ENABLE_FAST_INSTALL' is obsolete. +m4trace:/usr/share/aclocal/ltoptions.m4:302: -1- AC_DEFUN([AC_ENABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_ENABLE_FAST_INSTALL' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) -m4trace:/usr/share/aclocal/ltoptions.m4:310: -1- AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +m4trace:/usr/share/aclocal/ltoptions.m4:309: -1- AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) -m4trace:/usr/share/aclocal/ltoptions.m4:310: -1- AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_DISABLE_FAST_INSTALL' is obsolete. +m4trace:/usr/share/aclocal/ltoptions.m4:309: -1- AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_DISABLE_FAST_INSTALL' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) -m4trace:/usr/share/aclocal/ltoptions.m4:343: -1- AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) +m4trace:/usr/share/aclocal/ltoptions.m4:342: -1- AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) -m4trace:/usr/share/aclocal/ltoptions.m4:343: -1- AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_PICMODE' is obsolete. +m4trace:/usr/share/aclocal/ltoptions.m4:342: -1- AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_PICMODE' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], @@ -1500,8 +1451,8 @@ AC_DIAGNOSE([obsolete], put the `pic-only' option into LT_INIT's first parameter.]) ]) m4trace:/usr/share/aclocal/ltsugar.m4:13: -1- AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) -m4trace:/usr/share/aclocal/ltversion.m4:18: -1- AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4' -macro_revision='1.3293' +m4trace:/usr/share/aclocal/ltversion.m4:18: -1- AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.6b' +macro_revision='1.3017' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) @@ -1540,22 +1491,19 @@ m4trace:/usr/share/aclocal/lt~obsolete.m4:75: -1- AC_DEFUN([_LT_AC_TAGCONFIG]) m4trace:/usr/share/aclocal/lt~obsolete.m4:77: -1- AC_DEFUN([_LT_AC_LANG_CXX]) m4trace:/usr/share/aclocal/lt~obsolete.m4:78: -1- AC_DEFUN([_LT_AC_LANG_F77]) m4trace:/usr/share/aclocal/lt~obsolete.m4:79: -1- AC_DEFUN([_LT_AC_LANG_GCJ]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:80: -1- AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:81: -1- AC_DEFUN([_LT_AC_LANG_C_CONFIG]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:82: -1- AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:83: -1- AC_DEFUN([_LT_AC_LANG_CXX_CONFIG]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:84: -1- AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:85: -1- AC_DEFUN([_LT_AC_LANG_F77_CONFIG]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:86: -1- AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:87: -1- AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:88: -1- AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:89: -1- AC_DEFUN([_LT_AC_LANG_RC_CONFIG]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:90: -1- AC_DEFUN([AC_LIBTOOL_CONFIG]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:91: -1- AC_DEFUN([_LT_AC_FILE_LTDLL_C]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:93: -1- AC_DEFUN([_LT_AC_PROG_CXXCPP]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:96: -1- AC_DEFUN([_LT_PROG_F77]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:97: -1- AC_DEFUN([_LT_PROG_FC]) -m4trace:/usr/share/aclocal/lt~obsolete.m4:98: -1- AC_DEFUN([_LT_PROG_CXX]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:80: -1- AC_DEFUN([AC_LIBTOOL_RC]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:81: -1- AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:82: -1- AC_DEFUN([_LT_AC_LANG_C_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:83: -1- AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:84: -1- AC_DEFUN([_LT_AC_LANG_CXX_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:85: -1- AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:86: -1- AC_DEFUN([_LT_AC_LANG_F77_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:87: -1- AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:88: -1- AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:89: -1- AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:90: -1- AC_DEFUN([_LT_AC_LANG_RC_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:91: -1- AC_DEFUN([AC_LIBTOOL_CONFIG]) +m4trace:/usr/share/aclocal/lt~obsolete.m4:92: -1- AC_DEFUN([_LT_AC_FILE_LTDLL_C]) m4trace:/usr/share/aclocal-1.11/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. @@ -1984,7 +1932,7 @@ m4trace:/usr/share/aclocal-1.11/python.m4:35: -1- AC_DEFUN([AM_PATH_PYTHON], [ dnl Find a Python interpreter. Python versions prior to 2.0 are not dnl supported. (2.0 was released on October 16, 2000). m4_define_default([_AM_PYTHON_INTERPRETER_LIST], - [python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 dnl + [python python2 python3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 dnl python2.1 python2.0]) m4_if([$1],[],[ @@ -2675,7 +2623,7 @@ m4trace:configure.ac:26: -1- AM_INIT_AUTOMAKE m4trace:configure.ac:26: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) m4trace:configure.ac:26: -1- AM_SET_CURRENT_AUTOMAKE_VERSION m4trace:configure.ac:26: -1- AM_AUTOMAKE_VERSION([1.11.1]) -m4trace:configure.ac:26: -1- _AM_AUTOCONF_VERSION([2.68]) +m4trace:configure.ac:26: -1- _AM_AUTOCONF_VERSION([2.67]) m4trace:configure.ac:26: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) m4trace:configure.ac:26: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) m4trace:configure.ac:26: -1- m4_pattern_allow([^INSTALL_DATA$]) @@ -2794,7 +2742,7 @@ m4trace:configure.ac:29: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) m4trace:configure.ac:29: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) m4trace:configure.ac:32: -1- AC_LIBTOOL_WIN32_DLL m4trace:configure.ac:32: -1- _m4_warn([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. -You should run autoupdate.], [/usr/share/aclocal/ltoptions.m4:146: AC_LIBTOOL_WIN32_DLL is expanded from... +You should run autoupdate.], [/usr/share/aclocal/ltoptions.m4:145: AC_LIBTOOL_WIN32_DLL is expanded from... configure.ac:32: the top level]) m4trace:configure.ac:32: -1- m4_pattern_allow([^build$]) m4trace:configure.ac:32: -1- m4_pattern_allow([^build_cpu$]) @@ -2808,18 +2756,18 @@ m4trace:configure.ac:32: -1- m4_pattern_allow([^AS$]) m4trace:configure.ac:32: -1- m4_pattern_allow([^DLLTOOL$]) m4trace:configure.ac:32: -1- m4_pattern_allow([^OBJDUMP$]) m4trace:configure.ac:32: -1- _m4_warn([obsolete], [AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.], [/usr/share/aclocal/ltoptions.m4:146: AC_LIBTOOL_WIN32_DLL is expanded from... +put the `win32-dll' option into LT_INIT's first parameter.], [/usr/share/aclocal/ltoptions.m4:145: AC_LIBTOOL_WIN32_DLL is expanded from... configure.ac:32: the top level]) m4trace:configure.ac:33: -1- AC_LIBTOOL_DLOPEN m4trace:configure.ac:33: -1- _m4_warn([obsolete], [The macro `AC_LIBTOOL_DLOPEN' is obsolete. -You should run autoupdate.], [/usr/share/aclocal/ltoptions.m4:111: AC_LIBTOOL_DLOPEN is expanded from... +You should run autoupdate.], [/usr/share/aclocal/ltoptions.m4:110: AC_LIBTOOL_DLOPEN is expanded from... configure.ac:33: the top level]) m4trace:configure.ac:33: -1- _m4_warn([obsolete], [AC_LIBTOOL_DLOPEN: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.], [/usr/share/aclocal/ltoptions.m4:111: AC_LIBTOOL_DLOPEN is expanded from... +put the `dlopen' option into LT_INIT's first parameter.], [/usr/share/aclocal/ltoptions.m4:110: AC_LIBTOOL_DLOPEN is expanded from... configure.ac:33: the top level]) m4trace:configure.ac:34: -1- AC_PROG_LIBTOOL m4trace:configure.ac:34: -1- _m4_warn([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. -You should run autoupdate.], [/usr/share/aclocal/libtool.m4:107: AC_PROG_LIBTOOL is expanded from... +You should run autoupdate.], [/usr/share/aclocal/libtool.m4:102: AC_PROG_LIBTOOL is expanded from... configure.ac:34: the top level]) m4trace:configure.ac:34: -1- LT_INIT m4trace:configure.ac:34: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) @@ -2830,8 +2778,6 @@ m4trace:configure.ac:34: -1- LTVERSION_VERSION m4trace:configure.ac:34: -1- LTOBSOLETE_VERSION m4trace:configure.ac:34: -1- _LT_PROG_LTMAIN m4trace:configure.ac:34: -1- m4_pattern_allow([^LIBTOOL$]) -m4trace:configure.ac:34: -1- _LT_PREPARE_SED_QUOTE_VARS -m4trace:configure.ac:34: -1- _LT_PROG_ECHO_BACKSLASH m4trace:configure.ac:34: -1- LT_PATH_LD m4trace:configure.ac:34: -1- m4_pattern_allow([^SED$]) m4trace:configure.ac:34: -1- AC_PROG_EGREP @@ -2849,15 +2795,12 @@ m4trace:configure.ac:34: -1- m4_pattern_allow([^LN_S$]) m4trace:configure.ac:34: -1- LT_CMD_MAX_LEN m4trace:configure.ac:34: -1- m4_pattern_allow([^OBJDUMP$]) m4trace:configure.ac:34: -1- m4_pattern_allow([^OBJDUMP$]) -m4trace:configure.ac:34: -1- m4_pattern_allow([^DLLTOOL$]) -m4trace:configure.ac:34: -1- m4_pattern_allow([^DLLTOOL$]) m4trace:configure.ac:34: -1- m4_pattern_allow([^AR$]) -m4trace:configure.ac:34: -1- m4_pattern_allow([^ac_ct_AR$]) m4trace:configure.ac:34: -1- m4_pattern_allow([^STRIP$]) m4trace:configure.ac:34: -1- m4_pattern_allow([^RANLIB$]) -m4trace:configure.ac:34: -1- _LT_WITH_SYSROOT m4trace:configure.ac:34: -1- m4_pattern_allow([LT_OBJDIR]) m4trace:configure.ac:34: -1- m4_pattern_allow([^LT_OBJDIR$]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^lt_ECHO$]) m4trace:configure.ac:34: -1- _LT_CC_BASENAME([$compiler]) m4trace:configure.ac:34: -1- _LT_PATH_TOOL_PREFIX([${ac_tool_prefix}file], [/usr/bin$PATH_SEPARATOR$PATH]) m4trace:configure.ac:34: -1- _LT_PATH_TOOL_PREFIX([file], [/usr/bin$PATH_SEPARATOR$PATH]) @@ -2871,14 +2814,11 @@ m4trace:configure.ac:34: -1- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAG esac], [_LT_TAGVAR(lt_prog_compiler_pic, )= _LT_TAGVAR(lt_prog_compiler_can_build_shared, )=no]) m4trace:configure.ac:34: -1- _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_cv_prog_compiler_static_works], [$lt_tmp_static_flag], [], [_LT_TAGVAR(lt_prog_compiler_static, )=]) -m4trace:configure.ac:34: -1- m4_pattern_allow([^MANIFEST_TOOL$]) -m4trace:configure.ac:34: -1- _LT_REQUIRED_DARWIN_CHECKS m4trace:configure.ac:34: -1- m4_pattern_allow([^DSYMUTIL$]) m4trace:configure.ac:34: -1- m4_pattern_allow([^NMEDIT$]) m4trace:configure.ac:34: -1- m4_pattern_allow([^LIPO$]) m4trace:configure.ac:34: -1- m4_pattern_allow([^OTOOL$]) m4trace:configure.ac:34: -1- m4_pattern_allow([^OTOOL64$]) -m4trace:configure.ac:34: -1- _LT_LINKER_OPTION([if $CC understands -b], [lt_cv_prog_compiler__b], [-b], [_LT_TAGVAR(archive_cmds, )='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, )='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags']) m4trace:configure.ac:34: -1- LT_SYS_DLOPEN_SELF m4trace:configure.ac:34: -1- m4_pattern_allow([^CPP$]) m4trace:configure.ac:34: -1- m4_pattern_allow([^CPPFLAGS$]) @@ -2887,6 +2827,22 @@ m4trace:configure.ac:34: -1- m4_pattern_allow([^STDC_HEADERS$]) m4trace:configure.ac:34: -1- m4_pattern_allow([^HAVE_DLFCN_H$]) m4trace:configure.ac:34: -1- LT_LANG([CXX]) m4trace:configure.ac:34: -1- LT_SUPPORTED_TAG([CXX]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^CXXFLAGS$]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^ac_ct_CXX$]) +m4trace:configure.ac:34: -1- _AM_DEPENDENCIES([CXX]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^CXXDEPMODE$]) +m4trace:configure.ac:34: -1- AM_CONDITIONAL([am__fastdepCXX], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) +m4trace:configure.ac:34: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) +m4trace:configure.ac:34: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) m4trace:configure.ac:34: -1- m4_pattern_allow([^CXXCPP$]) m4trace:configure.ac:34: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:34: -1- m4_pattern_allow([^CXXCPP$]) @@ -2918,148 +2874,119 @@ m4trace:configure.ac:103: -1- m4_pattern_allow([^USE_GSL_TRUE$]) m4trace:configure.ac:103: -1- m4_pattern_allow([^USE_GSL_FALSE$]) m4trace:configure.ac:103: -1- _AM_SUBST_NOTMAKE([USE_GSL_TRUE]) m4trace:configure.ac:103: -1- _AM_SUBST_NOTMAKE([USE_GSL_FALSE]) -m4trace:configure.ac:116: -1- m4_pattern_allow([^GL_LIBS$]) -m4trace:configure.ac:119: -1- m4_pattern_allow([^GLUT_LIBS$]) -m4trace:configure.ac:126: -1- m4_pattern_allow([^GL_LIBS$]) -m4trace:configure.ac:129: -1- m4_pattern_allow([^GLUT_FLAGS$]) -m4trace:configure.ac:131: -1- m4_pattern_allow([^GLUT_LIBS$]) -m4trace:configure.ac:138: -1- m4_pattern_allow([^GL_LIBS$]) -m4trace:configure.ac:141: -1- m4_pattern_allow([^GLUT_FLAGS$]) -m4trace:configure.ac:143: -1- m4_pattern_allow([^GLUT_LIBS$]) -m4trace:configure.ac:148: -1- AM_CONDITIONAL([USE_GLUT], [(test x$all = xtrue || test x$glut = xtrue)]) -m4trace:configure.ac:148: -1- m4_pattern_allow([^USE_GLUT_TRUE$]) -m4trace:configure.ac:148: -1- m4_pattern_allow([^USE_GLUT_FALSE$]) -m4trace:configure.ac:148: -1- _AM_SUBST_NOTMAKE([USE_GLUT_TRUE]) -m4trace:configure.ac:148: -1- _AM_SUBST_NOTMAKE([USE_GLUT_FALSE]) -m4trace:configure.ac:178: -1- m4_pattern_allow([^HDF5_FLAGS$]) -m4trace:configure.ac:180: -1- m4_pattern_allow([^HDF5_LIBS$]) -m4trace:configure.ac:182: -1- AM_CONDITIONAL([USE_HDF5], [(test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue)]) -m4trace:configure.ac:182: -1- m4_pattern_allow([^USE_HDF5_TRUE$]) -m4trace:configure.ac:182: -1- m4_pattern_allow([^USE_HDF5_FALSE$]) -m4trace:configure.ac:182: -1- _AM_SUBST_NOTMAKE([USE_HDF5_TRUE]) -m4trace:configure.ac:182: -1- _AM_SUBST_NOTMAKE([USE_HDF5_FALSE]) -m4trace:configure.ac:194: -1- m4_pattern_allow([^HDF4_FLAGS$]) -m4trace:configure.ac:195: -1- m4_pattern_allow([^HDF4_LIBS$]) -m4trace:configure.ac:197: -1- AM_CONDITIONAL([USE_HDF4], [(test x$all = xtrue || test x$hdf4 = xtrue)]) -m4trace:configure.ac:197: -1- m4_pattern_allow([^USE_HDF4_TRUE$]) -m4trace:configure.ac:197: -1- m4_pattern_allow([^USE_HDF4_FALSE$]) -m4trace:configure.ac:197: -1- _AM_SUBST_NOTMAKE([USE_HDF4_TRUE]) -m4trace:configure.ac:197: -1- _AM_SUBST_NOTMAKE([USE_HDF4_FALSE]) -m4trace:configure.ac:206: -1- m4_pattern_allow([^GIF_FLAGS$]) -m4trace:configure.ac:209: -1- m4_pattern_allow([^GIF_LIBS$]) -m4trace:configure.ac:211: -1- AM_CONDITIONAL([USE_GIF], [(test x$all = xtrue || test x$gif = xtrue)]) -m4trace:configure.ac:211: -1- m4_pattern_allow([^USE_GIF_TRUE$]) -m4trace:configure.ac:211: -1- m4_pattern_allow([^USE_GIF_FALSE$]) -m4trace:configure.ac:211: -1- _AM_SUBST_NOTMAKE([USE_GIF_TRUE]) -m4trace:configure.ac:211: -1- _AM_SUBST_NOTMAKE([USE_GIF_FALSE]) -m4trace:configure.ac:215: -1- m4_pattern_allow([^PNG_LIBS$]) -m4trace:configure.ac:225: -1- m4_pattern_allow([^JPEG_FLAGS$]) -m4trace:configure.ac:228: -1- m4_pattern_allow([^JPEG_LIBS$]) -m4trace:configure.ac:230: -1- AM_CONDITIONAL([USE_JPEG], [(test x$all = xtrue || test x$jpeg = xtrue)]) -m4trace:configure.ac:230: -1- m4_pattern_allow([^USE_JPEG_TRUE$]) -m4trace:configure.ac:230: -1- m4_pattern_allow([^USE_JPEG_FALSE$]) -m4trace:configure.ac:230: -1- _AM_SUBST_NOTMAKE([USE_JPEG_TRUE]) -m4trace:configure.ac:230: -1- _AM_SUBST_NOTMAKE([USE_JPEG_FALSE]) -m4trace:configure.ac:246: -1- m4_pattern_allow([^HAVE_LIBHPDF$]) -m4trace:configure.ac:252: -1- m4_pattern_allow([^HAVE_HPDF_H$]) -m4trace:configure.ac:257: -1- AM_CONDITIONAL([USE_PDF], [test x$pdf = xtrue]) -m4trace:configure.ac:257: -1- m4_pattern_allow([^USE_PDF_TRUE$]) -m4trace:configure.ac:257: -1- m4_pattern_allow([^USE_PDF_FALSE$]) -m4trace:configure.ac:257: -1- _AM_SUBST_NOTMAKE([USE_PDF_TRUE]) -m4trace:configure.ac:257: -1- _AM_SUBST_NOTMAKE([USE_PDF_FALSE]) -m4trace:configure.ac:259: -1- m4_pattern_allow([^U3D_LIBS$]) -m4trace:configure.ac:259: -1- m4_pattern_allow([^HAVE_U3D$]) -m4trace:configure.ac:268: -1- m4_pattern_allow([^HAVE_U3D_SCENECONVERTERLIB_H$]) -m4trace:configure.ac:273: -1- AM_CONDITIONAL([USE_U3D], [test x$u3d = xtrue]) -m4trace:configure.ac:273: -1- m4_pattern_allow([^USE_U3D_TRUE$]) -m4trace:configure.ac:273: -1- m4_pattern_allow([^USE_U3D_FALSE$]) -m4trace:configure.ac:273: -1- _AM_SUBST_NOTMAKE([USE_U3D_TRUE]) -m4trace:configure.ac:273: -1- _AM_SUBST_NOTMAKE([USE_U3D_FALSE]) -m4trace:configure.ac:284: -1- m4_pattern_allow([^FLTK_FLAGS$]) -m4trace:configure.ac:285: -1- m4_pattern_allow([^FLTK_LIBS$]) -m4trace:configure.ac:294: -1- AM_CONDITIONAL([USE_FLTK], [test x$test_fltk = xtrue]) -m4trace:configure.ac:294: -1- m4_pattern_allow([^USE_FLTK_TRUE$]) -m4trace:configure.ac:294: -1- m4_pattern_allow([^USE_FLTK_FALSE$]) -m4trace:configure.ac:294: -1- _AM_SUBST_NOTMAKE([USE_FLTK_TRUE]) -m4trace:configure.ac:294: -1- _AM_SUBST_NOTMAKE([USE_FLTK_FALSE]) -m4trace:configure.ac:306: -1- m4_pattern_allow([^WX_FLAGS$]) -m4trace:configure.ac:307: -1- m4_pattern_allow([^WX_LIBS$]) -m4trace:configure.ac:316: -1- AM_CONDITIONAL([USE_WX], [test x$test_wx = xtrue]) -m4trace:configure.ac:316: -1- m4_pattern_allow([^USE_WX_TRUE$]) -m4trace:configure.ac:316: -1- m4_pattern_allow([^USE_WX_FALSE$]) -m4trace:configure.ac:316: -1- _AM_SUBST_NOTMAKE([USE_WX_TRUE]) -m4trace:configure.ac:316: -1- _AM_SUBST_NOTMAKE([USE_WX_FALSE]) -m4trace:configure.ac:326: -1- AT_WITH_QT -m4trace:configure.ac:326: -1- m4_pattern_allow([^QMAKE$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QMAKE$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^MOC$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^MOC$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^UIC$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^UIC$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^RCC$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^RCC$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_PATH$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^TMPDIR$]) -m4trace:configure.ac:326: -1- _AT_TWEAK_PRO_FILE([CONFIG], [+release]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_VERSION_MAJOR$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_DEFINES$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_CFLAGS$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_CXXFLAGS$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_INCPATH$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_CPPFLAGS$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_LFLAGS$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_LDFLAGS$]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_LIBS$]) -m4trace:configure.ac:327: -1- AT_REQUIRE_QT_VERSION([4.3]) -m4trace:configure.ac:327: -1- m4_pattern_allow([^QT_VERSION$]) -m4trace:configure.ac:330: -1- AM_CONDITIONAL([USE_QT], [test x$test_qt = xtrue]) -m4trace:configure.ac:330: -1- m4_pattern_allow([^USE_QT_TRUE$]) -m4trace:configure.ac:330: -1- m4_pattern_allow([^USE_QT_FALSE$]) -m4trace:configure.ac:330: -1- _AM_SUBST_NOTMAKE([USE_QT_TRUE]) -m4trace:configure.ac:330: -1- _AM_SUBST_NOTMAKE([USE_QT_FALSE]) -m4trace:configure.ac:340: -1- m4_pattern_allow([^PYTHON_HEADERS$]) -m4trace:configure.ac:341: -1- m4_pattern_allow([^HAVE_SWIG$]) -m4trace:configure.ac:344: -1- AM_PATH_PYTHON([]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^PYTHON$]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^PYTHON_VERSION$]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^PYTHON_PREFIX$]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^PYTHON_EXEC_PREFIX$]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^PYTHON_PLATFORM$]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^pythondir$]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^pkgpythondir$]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^pyexecdir$]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^pkgpyexecdir$]) -m4trace:configure.ac:350: -1- AM_CONDITIONAL([USE_PYTHON], [test x$test_python = xtrue ]) -m4trace:configure.ac:350: -1- m4_pattern_allow([^USE_PYTHON_TRUE$]) -m4trace:configure.ac:350: -1- m4_pattern_allow([^USE_PYTHON_FALSE$]) -m4trace:configure.ac:350: -1- _AM_SUBST_NOTMAKE([USE_PYTHON_TRUE]) -m4trace:configure.ac:350: -1- _AM_SUBST_NOTMAKE([USE_PYTHON_FALSE]) -m4trace:configure.ac:360: -1- m4_pattern_allow([^OCTAVE$]) -m4trace:configure.ac:367: -1- m4_pattern_allow([^OCTAVE_ARCH$]) -m4trace:configure.ac:368: -1- m4_pattern_allow([^OCTAVE_INCFLAGS$]) -m4trace:configure.ac:371: -1- AM_CONDITIONAL([USE_OCTAVE], [test x$test_octave = xtrue ]) -m4trace:configure.ac:371: -1- m4_pattern_allow([^USE_OCTAVE_TRUE$]) -m4trace:configure.ac:371: -1- m4_pattern_allow([^USE_OCTAVE_FALSE$]) -m4trace:configure.ac:371: -1- _AM_SUBST_NOTMAKE([USE_OCTAVE_TRUE]) -m4trace:configure.ac:371: -1- _AM_SUBST_NOTMAKE([USE_OCTAVE_FALSE]) -m4trace:configure.ac:380: -1- AM_CONDITIONAL([USE_TESTIO], [test x$testio = xtrue ]) -m4trace:configure.ac:380: -1- m4_pattern_allow([^USE_TESTIO_TRUE$]) -m4trace:configure.ac:380: -1- m4_pattern_allow([^USE_TESTIO_FALSE$]) -m4trace:configure.ac:380: -1- _AM_SUBST_NOTMAKE([USE_TESTIO_TRUE]) -m4trace:configure.ac:380: -1- _AM_SUBST_NOTMAKE([USE_TESTIO_FALSE]) -m4trace:configure.ac:392: -1- AM_CONDITIONAL([USE_DOCS], [(test x$docs = xtrue || test x$all = xtrue) ]) -m4trace:configure.ac:392: -1- m4_pattern_allow([^USE_DOCS_TRUE$]) -m4trace:configure.ac:392: -1- m4_pattern_allow([^USE_DOCS_FALSE$]) -m4trace:configure.ac:392: -1- _AM_SUBST_NOTMAKE([USE_DOCS_TRUE]) -m4trace:configure.ac:392: -1- _AM_SUBST_NOTMAKE([USE_DOCS_FALSE]) -m4trace:configure.ac:395: -1- m4_pattern_allow([^AM_CXXFLAGS$]) -m4trace:configure.ac:406: -1- m4_pattern_allow([^LIB@&t@OBJS$]) -m4trace:configure.ac:406: -1- m4_pattern_allow([^LTLIBOBJS$]) -m4trace:configure.ac:406: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) -m4trace:configure.ac:406: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) -m4trace:configure.ac:406: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) -m4trace:configure.ac:406: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) -m4trace:configure.ac:406: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) -m4trace:configure.ac:406: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"]) -m4trace:configure.ac:406: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS -m4trace:configure.ac:406: -1- _LT_PROG_LTMAIN +m4trace:configure.ac:108: -1- m4_pattern_allow([^GL_LIBS$]) +m4trace:configure.ac:114: -1- m4_pattern_allow([^GL_LIBS$]) +m4trace:configure.ac:121: -1- m4_pattern_allow([^GL_LIBS$]) +m4trace:configure.ac:126: -1- AM_CONDITIONAL([USE_GLUT], [(test x$all = xtrue || test x$glut = xtrue)]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^USE_GLUT_TRUE$]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^USE_GLUT_FALSE$]) +m4trace:configure.ac:126: -1- _AM_SUBST_NOTMAKE([USE_GLUT_TRUE]) +m4trace:configure.ac:126: -1- _AM_SUBST_NOTMAKE([USE_GLUT_FALSE]) +m4trace:configure.ac:156: -1- m4_pattern_allow([^HDF5_FLAGS$]) +m4trace:configure.ac:158: -1- m4_pattern_allow([^HDF5_LIBS$]) +m4trace:configure.ac:160: -1- AM_CONDITIONAL([USE_HDF5], [(test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue)]) +m4trace:configure.ac:160: -1- m4_pattern_allow([^USE_HDF5_TRUE$]) +m4trace:configure.ac:160: -1- m4_pattern_allow([^USE_HDF5_FALSE$]) +m4trace:configure.ac:160: -1- _AM_SUBST_NOTMAKE([USE_HDF5_TRUE]) +m4trace:configure.ac:160: -1- _AM_SUBST_NOTMAKE([USE_HDF5_FALSE]) +m4trace:configure.ac:172: -1- m4_pattern_allow([^HDF4_FLAGS$]) +m4trace:configure.ac:173: -1- m4_pattern_allow([^HDF4_LIBS$]) +m4trace:configure.ac:175: -1- AM_CONDITIONAL([USE_HDF4], [(test x$all = xtrue || test x$hdf4 = xtrue)]) +m4trace:configure.ac:175: -1- m4_pattern_allow([^USE_HDF4_TRUE$]) +m4trace:configure.ac:175: -1- m4_pattern_allow([^USE_HDF4_FALSE$]) +m4trace:configure.ac:175: -1- _AM_SUBST_NOTMAKE([USE_HDF4_TRUE]) +m4trace:configure.ac:175: -1- _AM_SUBST_NOTMAKE([USE_HDF4_FALSE]) +m4trace:configure.ac:179: -1- m4_pattern_allow([^PNG_LIBS$]) +m4trace:configure.ac:189: -1- m4_pattern_allow([^JPEG_FLAGS$]) +m4trace:configure.ac:192: -1- m4_pattern_allow([^JPEG_LIBS$]) +m4trace:configure.ac:194: -1- AM_CONDITIONAL([USE_JPEG], [(test x$all = xtrue || test x$jpeg = xtrue)]) +m4trace:configure.ac:194: -1- m4_pattern_allow([^USE_JPEG_TRUE$]) +m4trace:configure.ac:194: -1- m4_pattern_allow([^USE_JPEG_FALSE$]) +m4trace:configure.ac:194: -1- _AM_SUBST_NOTMAKE([USE_JPEG_TRUE]) +m4trace:configure.ac:194: -1- _AM_SUBST_NOTMAKE([USE_JPEG_FALSE]) +m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_LIBHPDF$]) +m4trace:configure.ac:216: -1- m4_pattern_allow([^HAVE_HPDF_H$]) +m4trace:configure.ac:221: -1- AM_CONDITIONAL([USE_PDF], [test x$pdf = xtrue]) +m4trace:configure.ac:221: -1- m4_pattern_allow([^USE_PDF_TRUE$]) +m4trace:configure.ac:221: -1- m4_pattern_allow([^USE_PDF_FALSE$]) +m4trace:configure.ac:221: -1- _AM_SUBST_NOTMAKE([USE_PDF_TRUE]) +m4trace:configure.ac:221: -1- _AM_SUBST_NOTMAKE([USE_PDF_FALSE]) +m4trace:configure.ac:223: -1- m4_pattern_allow([^U3D_LIBS$]) +m4trace:configure.ac:223: -1- m4_pattern_allow([^HAVE_U3D$]) +m4trace:configure.ac:232: -1- m4_pattern_allow([^HAVE_U3D_SCENECONVERTERLIB_H$]) +m4trace:configure.ac:237: -1- AM_CONDITIONAL([USE_U3D], [test x$u3d = xtrue]) +m4trace:configure.ac:237: -1- m4_pattern_allow([^USE_U3D_TRUE$]) +m4trace:configure.ac:237: -1- m4_pattern_allow([^USE_U3D_FALSE$]) +m4trace:configure.ac:237: -1- _AM_SUBST_NOTMAKE([USE_U3D_TRUE]) +m4trace:configure.ac:237: -1- _AM_SUBST_NOTMAKE([USE_U3D_FALSE]) +m4trace:configure.ac:248: -1- m4_pattern_allow([^FLTK_FLAGS$]) +m4trace:configure.ac:249: -1- m4_pattern_allow([^FLTK_LIBS$]) +m4trace:configure.ac:258: -1- AM_CONDITIONAL([USE_FLTK], [test x$test_fltk = xtrue]) +m4trace:configure.ac:258: -1- m4_pattern_allow([^USE_FLTK_TRUE$]) +m4trace:configure.ac:258: -1- m4_pattern_allow([^USE_FLTK_FALSE$]) +m4trace:configure.ac:258: -1- _AM_SUBST_NOTMAKE([USE_FLTK_TRUE]) +m4trace:configure.ac:258: -1- _AM_SUBST_NOTMAKE([USE_FLTK_FALSE]) +m4trace:configure.ac:268: -1- AT_WITH_QT +m4trace:configure.ac:268: -1- m4_pattern_allow([^QMAKE$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QMAKE$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^MOC$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^MOC$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^UIC$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^UIC$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^RCC$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^RCC$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_PATH$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^TMPDIR$]) +m4trace:configure.ac:268: -1- _AT_TWEAK_PRO_FILE([CONFIG], [+release]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_VERSION_MAJOR$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_DEFINES$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_CFLAGS$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_CXXFLAGS$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_INCPATH$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_CPPFLAGS$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_LFLAGS$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_LDFLAGS$]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_LIBS$]) +m4trace:configure.ac:269: -1- AT_REQUIRE_QT_VERSION([4.3]) +m4trace:configure.ac:269: -1- m4_pattern_allow([^QT_VERSION$]) +m4trace:configure.ac:272: -1- AM_CONDITIONAL([USE_QT], [test x$test_qt = xtrue]) +m4trace:configure.ac:272: -1- m4_pattern_allow([^USE_QT_TRUE$]) +m4trace:configure.ac:272: -1- m4_pattern_allow([^USE_QT_FALSE$]) +m4trace:configure.ac:272: -1- _AM_SUBST_NOTMAKE([USE_QT_TRUE]) +m4trace:configure.ac:272: -1- _AM_SUBST_NOTMAKE([USE_QT_FALSE]) +m4trace:configure.ac:282: -1- m4_pattern_allow([^PYTHON_HEADERS$]) +m4trace:configure.ac:283: -1- m4_pattern_allow([^HAVE_SWIG$]) +m4trace:configure.ac:286: -1- AM_PATH_PYTHON([]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^PYTHON$]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^PYTHON_VERSION$]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^PYTHON_PREFIX$]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^PYTHON_EXEC_PREFIX$]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^PYTHON_PLATFORM$]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^pythondir$]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^pkgpythondir$]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^pyexecdir$]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^pkgpyexecdir$]) +m4trace:configure.ac:292: -1- AM_CONDITIONAL([USE_PYTHON], [test x$test_python = xtrue ]) +m4trace:configure.ac:292: -1- m4_pattern_allow([^USE_PYTHON_TRUE$]) +m4trace:configure.ac:292: -1- m4_pattern_allow([^USE_PYTHON_FALSE$]) +m4trace:configure.ac:292: -1- _AM_SUBST_NOTMAKE([USE_PYTHON_TRUE]) +m4trace:configure.ac:292: -1- _AM_SUBST_NOTMAKE([USE_PYTHON_FALSE]) +m4trace:configure.ac:302: -1- m4_pattern_allow([^OCTAVE$]) +m4trace:configure.ac:308: -1- m4_pattern_allow([^OCTAVE_ARCH$]) +m4trace:configure.ac:309: -1- m4_pattern_allow([^OCTAVE_INCFLAGS$]) +m4trace:configure.ac:312: -1- AM_CONDITIONAL([USE_OCTAVE], [test x$test_octave = xtrue ]) +m4trace:configure.ac:312: -1- m4_pattern_allow([^USE_OCTAVE_TRUE$]) +m4trace:configure.ac:312: -1- m4_pattern_allow([^USE_OCTAVE_FALSE$]) +m4trace:configure.ac:312: -1- _AM_SUBST_NOTMAKE([USE_OCTAVE_TRUE]) +m4trace:configure.ac:312: -1- _AM_SUBST_NOTMAKE([USE_OCTAVE_FALSE]) +m4trace:configure.ac:315: -1- m4_pattern_allow([^AM_CXXFLAGS$]) +m4trace:configure.ac:326: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:326: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:326: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.ac:326: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.ac:326: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.ac:326: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.ac:326: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.ac:326: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"]) +m4trace:configure.ac:326: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.ac:326: -1- _LT_PROG_LTMAIN diff --git a/autom4te.cache/traces.1 b/autom4te.cache/traces.1 index 9192372..54a752f 100644 --- a/autom4te.cache/traces.1 +++ b/autom4te.cache/traces.1 @@ -1,7 +1,7 @@ -m4trace:aclocal.m4:9588: -1- m4_include([config/autotroll.m4]) +m4trace:aclocal.m4:9123: -1- m4_include([config/autotroll.m4]) m4trace:config/autotroll.m4:70: -1- m4_pattern_forbid([^AT_]) m4trace:config/autotroll.m4:71: -1- m4_pattern_forbid([^_AT_]) -m4trace:configure.ac:1: -1- AC_INIT([mathgl], [1.11.2], [mathgl.abalakin@gmail.com]) +m4trace:configure.ac:1: -1- AC_INIT([mathgl], [2.0], [mathgl.abalakin@gmail.com]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([_AC_]) m4trace:configure.ac:1: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) @@ -355,7 +355,7 @@ m4trace:configure.ac:29: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) m4trace:configure.ac:29: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) m4trace:configure.ac:29: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) m4trace:configure.ac:32: -1- _m4_warn([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. -You should run autoupdate.], [aclocal.m4:7984: AC_LIBTOOL_WIN32_DLL is expanded from... +You should run autoupdate.], [aclocal.m4:7525: AC_LIBTOOL_WIN32_DLL is expanded from... configure.ac:32: the top level]) m4trace:configure.ac:32: -1- AC_CANONICAL_HOST m4trace:configure.ac:32: -1- AC_CANONICAL_BUILD @@ -395,17 +395,17 @@ m4trace:configure.ac:32: -1- AC_SUBST([OBJDUMP]) m4trace:configure.ac:32: -1- AC_SUBST_TRACE([OBJDUMP]) m4trace:configure.ac:32: -1- m4_pattern_allow([^OBJDUMP$]) m4trace:configure.ac:32: -1- _m4_warn([obsolete], [AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.], [aclocal.m4:7984: AC_LIBTOOL_WIN32_DLL is expanded from... +put the `win32-dll' option into LT_INIT's first parameter.], [aclocal.m4:7525: AC_LIBTOOL_WIN32_DLL is expanded from... configure.ac:32: the top level]) m4trace:configure.ac:33: -1- _m4_warn([obsolete], [The macro `AC_LIBTOOL_DLOPEN' is obsolete. -You should run autoupdate.], [aclocal.m4:7949: AC_LIBTOOL_DLOPEN is expanded from... +You should run autoupdate.], [aclocal.m4:7490: AC_LIBTOOL_DLOPEN is expanded from... configure.ac:33: the top level]) m4trace:configure.ac:33: -1- _m4_warn([obsolete], [AC_LIBTOOL_DLOPEN: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.], [aclocal.m4:7949: AC_LIBTOOL_DLOPEN is expanded from... +put the `dlopen' option into LT_INIT's first parameter.], [aclocal.m4:7490: AC_LIBTOOL_DLOPEN is expanded from... configure.ac:33: the top level]) m4trace:configure.ac:34: -1- AC_PROG_LIBTOOL m4trace:configure.ac:34: -1- _m4_warn([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. -You should run autoupdate.], [aclocal.m4:128: AC_PROG_LIBTOOL is expanded from... +You should run autoupdate.], [aclocal.m4:123: AC_PROG_LIBTOOL is expanded from... configure.ac:34: the top level]) m4trace:configure.ac:34: -1- LT_INIT m4trace:configure.ac:34: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) @@ -453,18 +453,9 @@ m4trace:configure.ac:34: -1- m4_pattern_allow([^OBJDUMP$]) m4trace:configure.ac:34: -1- AC_SUBST([OBJDUMP]) m4trace:configure.ac:34: -1- AC_SUBST_TRACE([OBJDUMP]) m4trace:configure.ac:34: -1- m4_pattern_allow([^OBJDUMP$]) -m4trace:configure.ac:34: -1- AC_SUBST([DLLTOOL]) -m4trace:configure.ac:34: -1- AC_SUBST_TRACE([DLLTOOL]) -m4trace:configure.ac:34: -1- m4_pattern_allow([^DLLTOOL$]) -m4trace:configure.ac:34: -1- AC_SUBST([DLLTOOL]) -m4trace:configure.ac:34: -1- AC_SUBST_TRACE([DLLTOOL]) -m4trace:configure.ac:34: -1- m4_pattern_allow([^DLLTOOL$]) m4trace:configure.ac:34: -1- AC_SUBST([AR]) m4trace:configure.ac:34: -1- AC_SUBST_TRACE([AR]) m4trace:configure.ac:34: -1- m4_pattern_allow([^AR$]) -m4trace:configure.ac:34: -1- AC_SUBST([ac_ct_AR]) -m4trace:configure.ac:34: -1- AC_SUBST_TRACE([ac_ct_AR]) -m4trace:configure.ac:34: -1- m4_pattern_allow([^ac_ct_AR$]) m4trace:configure.ac:34: -1- AC_SUBST([STRIP]) m4trace:configure.ac:34: -1- AC_SUBST_TRACE([STRIP]) m4trace:configure.ac:34: -1- m4_pattern_allow([^STRIP$]) @@ -477,10 +468,10 @@ m4trace:configure.ac:34: -1- m4_pattern_allow([^LT_OBJDIR$]) m4trace:configure.ac:34: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory in which libtool stores uninstalled libraries. */ @%:@undef LT_OBJDIR]) +m4trace:configure.ac:34: -1- AC_SUBST([lt_ECHO]) +m4trace:configure.ac:34: -1- AC_SUBST_TRACE([lt_ECHO]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^lt_ECHO$]) m4trace:configure.ac:34: -1- LT_SUPPORTED_TAG([CC]) -m4trace:configure.ac:34: -1- AC_SUBST([MANIFEST_TOOL]) -m4trace:configure.ac:34: -1- AC_SUBST_TRACE([MANIFEST_TOOL]) -m4trace:configure.ac:34: -1- m4_pattern_allow([^MANIFEST_TOOL$]) m4trace:configure.ac:34: -1- AC_SUBST([DSYMUTIL]) m4trace:configure.ac:34: -1- AC_SUBST_TRACE([DSYMUTIL]) m4trace:configure.ac:34: -1- m4_pattern_allow([^DSYMUTIL$]) @@ -532,6 +523,41 @@ m4trace:configure.ac:34: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you h m4trace:configure.ac:34: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H]) m4trace:configure.ac:34: -1- m4_pattern_allow([^HAVE_DLFCN_H$]) m4trace:configure.ac:34: -1- LT_SUPPORTED_TAG([CXX]) +m4trace:configure.ac:34: -1- AC_SUBST([CXX]) +m4trace:configure.ac:34: -1- AC_SUBST_TRACE([CXX]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:34: -1- AC_SUBST([CXXFLAGS]) +m4trace:configure.ac:34: -1- AC_SUBST_TRACE([CXXFLAGS]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^CXXFLAGS$]) +m4trace:configure.ac:34: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.ac:34: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:34: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:34: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:34: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:34: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:34: -1- AC_SUBST([CXX]) +m4trace:configure.ac:34: -1- AC_SUBST_TRACE([CXX]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:34: -1- AC_SUBST([ac_ct_CXX]) +m4trace:configure.ac:34: -1- AC_SUBST_TRACE([ac_ct_CXX]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^ac_ct_CXX$]) +m4trace:configure.ac:34: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type]) +m4trace:configure.ac:34: -1- AC_SUBST_TRACE([CXXDEPMODE]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^CXXDEPMODE$]) +m4trace:configure.ac:34: -1- AM_CONDITIONAL([am__fastdepCXX], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:34: -1- AC_SUBST([am__fastdepCXX_TRUE]) +m4trace:configure.ac:34: -1- AC_SUBST_TRACE([am__fastdepCXX_TRUE]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$]) +m4trace:configure.ac:34: -1- AC_SUBST([am__fastdepCXX_FALSE]) +m4trace:configure.ac:34: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE]) +m4trace:configure.ac:34: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) +m4trace:configure.ac:34: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) +m4trace:configure.ac:34: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) m4trace:configure.ac:34: -1- AC_SUBST([CXXCPP]) m4trace:configure.ac:34: -1- AC_SUBST_TRACE([CXXCPP]) m4trace:configure.ac:34: -1- m4_pattern_allow([^CXXCPP$]) @@ -585,353 +611,289 @@ m4trace:configure.ac:103: -1- AC_SUBST_TRACE([USE_GSL_FALSE]) m4trace:configure.ac:103: -1- m4_pattern_allow([^USE_GSL_FALSE$]) m4trace:configure.ac:103: -1- _AM_SUBST_NOTMAKE([USE_GSL_TRUE]) m4trace:configure.ac:103: -1- _AM_SUBST_NOTMAKE([USE_GSL_FALSE]) -m4trace:configure.ac:116: -1- AC_SUBST([GL_LIBS]) -m4trace:configure.ac:116: -1- AC_SUBST_TRACE([GL_LIBS]) -m4trace:configure.ac:116: -1- m4_pattern_allow([^GL_LIBS$]) -m4trace:configure.ac:119: -1- AC_SUBST([GLUT_LIBS]) -m4trace:configure.ac:119: -1- AC_SUBST_TRACE([GLUT_LIBS]) -m4trace:configure.ac:119: -1- m4_pattern_allow([^GLUT_LIBS$]) -m4trace:configure.ac:126: -1- AC_SUBST([GL_LIBS]) -m4trace:configure.ac:126: -1- AC_SUBST_TRACE([GL_LIBS]) -m4trace:configure.ac:126: -1- m4_pattern_allow([^GL_LIBS$]) -m4trace:configure.ac:129: -1- AC_SUBST([GLUT_FLAGS]) -m4trace:configure.ac:129: -1- AC_SUBST_TRACE([GLUT_FLAGS]) -m4trace:configure.ac:129: -1- m4_pattern_allow([^GLUT_FLAGS$]) -m4trace:configure.ac:131: -1- AC_SUBST([GLUT_LIBS]) -m4trace:configure.ac:131: -1- AC_SUBST_TRACE([GLUT_LIBS]) -m4trace:configure.ac:131: -1- m4_pattern_allow([^GLUT_LIBS$]) -m4trace:configure.ac:138: -1- AC_SUBST([GL_LIBS]) -m4trace:configure.ac:138: -1- AC_SUBST_TRACE([GL_LIBS]) -m4trace:configure.ac:138: -1- m4_pattern_allow([^GL_LIBS$]) -m4trace:configure.ac:141: -1- AC_SUBST([GLUT_FLAGS]) -m4trace:configure.ac:141: -1- AC_SUBST_TRACE([GLUT_FLAGS]) -m4trace:configure.ac:141: -1- m4_pattern_allow([^GLUT_FLAGS$]) -m4trace:configure.ac:143: -1- AC_SUBST([GLUT_LIBS]) -m4trace:configure.ac:143: -1- AC_SUBST_TRACE([GLUT_LIBS]) -m4trace:configure.ac:143: -1- m4_pattern_allow([^GLUT_LIBS$]) -m4trace:configure.ac:148: -1- AM_CONDITIONAL([USE_GLUT], [(test x$all = xtrue || test x$glut = xtrue)]) -m4trace:configure.ac:148: -1- AC_SUBST([USE_GLUT_TRUE]) -m4trace:configure.ac:148: -1- AC_SUBST_TRACE([USE_GLUT_TRUE]) -m4trace:configure.ac:148: -1- m4_pattern_allow([^USE_GLUT_TRUE$]) -m4trace:configure.ac:148: -1- AC_SUBST([USE_GLUT_FALSE]) -m4trace:configure.ac:148: -1- AC_SUBST_TRACE([USE_GLUT_FALSE]) -m4trace:configure.ac:148: -1- m4_pattern_allow([^USE_GLUT_FALSE$]) -m4trace:configure.ac:148: -1- _AM_SUBST_NOTMAKE([USE_GLUT_TRUE]) -m4trace:configure.ac:148: -1- _AM_SUBST_NOTMAKE([USE_GLUT_FALSE]) -m4trace:configure.ac:178: -1- AC_SUBST([HDF5_FLAGS]) -m4trace:configure.ac:178: -1- AC_SUBST_TRACE([HDF5_FLAGS]) -m4trace:configure.ac:178: -1- m4_pattern_allow([^HDF5_FLAGS$]) -m4trace:configure.ac:180: -1- AC_SUBST([HDF5_LIBS]) -m4trace:configure.ac:180: -1- AC_SUBST_TRACE([HDF5_LIBS]) -m4trace:configure.ac:180: -1- m4_pattern_allow([^HDF5_LIBS$]) -m4trace:configure.ac:182: -1- AM_CONDITIONAL([USE_HDF5], [(test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue)]) -m4trace:configure.ac:182: -1- AC_SUBST([USE_HDF5_TRUE]) -m4trace:configure.ac:182: -1- AC_SUBST_TRACE([USE_HDF5_TRUE]) -m4trace:configure.ac:182: -1- m4_pattern_allow([^USE_HDF5_TRUE$]) -m4trace:configure.ac:182: -1- AC_SUBST([USE_HDF5_FALSE]) -m4trace:configure.ac:182: -1- AC_SUBST_TRACE([USE_HDF5_FALSE]) -m4trace:configure.ac:182: -1- m4_pattern_allow([^USE_HDF5_FALSE$]) -m4trace:configure.ac:182: -1- _AM_SUBST_NOTMAKE([USE_HDF5_TRUE]) -m4trace:configure.ac:182: -1- _AM_SUBST_NOTMAKE([USE_HDF5_FALSE]) -m4trace:configure.ac:194: -1- AC_SUBST([HDF4_FLAGS]) -m4trace:configure.ac:194: -1- AC_SUBST_TRACE([HDF4_FLAGS]) -m4trace:configure.ac:194: -1- m4_pattern_allow([^HDF4_FLAGS$]) -m4trace:configure.ac:195: -1- AC_SUBST([HDF4_LIBS]) -m4trace:configure.ac:195: -1- AC_SUBST_TRACE([HDF4_LIBS]) -m4trace:configure.ac:195: -1- m4_pattern_allow([^HDF4_LIBS$]) -m4trace:configure.ac:197: -1- AM_CONDITIONAL([USE_HDF4], [(test x$all = xtrue || test x$hdf4 = xtrue)]) -m4trace:configure.ac:197: -1- AC_SUBST([USE_HDF4_TRUE]) -m4trace:configure.ac:197: -1- AC_SUBST_TRACE([USE_HDF4_TRUE]) -m4trace:configure.ac:197: -1- m4_pattern_allow([^USE_HDF4_TRUE$]) -m4trace:configure.ac:197: -1- AC_SUBST([USE_HDF4_FALSE]) -m4trace:configure.ac:197: -1- AC_SUBST_TRACE([USE_HDF4_FALSE]) -m4trace:configure.ac:197: -1- m4_pattern_allow([^USE_HDF4_FALSE$]) -m4trace:configure.ac:197: -1- _AM_SUBST_NOTMAKE([USE_HDF4_TRUE]) -m4trace:configure.ac:197: -1- _AM_SUBST_NOTMAKE([USE_HDF4_FALSE]) -m4trace:configure.ac:206: -1- AC_SUBST([GIF_FLAGS]) -m4trace:configure.ac:206: -1- AC_SUBST_TRACE([GIF_FLAGS]) -m4trace:configure.ac:206: -1- m4_pattern_allow([^GIF_FLAGS$]) -m4trace:configure.ac:209: -1- AC_SUBST([GIF_LIBS]) -m4trace:configure.ac:209: -1- AC_SUBST_TRACE([GIF_LIBS]) -m4trace:configure.ac:209: -1- m4_pattern_allow([^GIF_LIBS$]) -m4trace:configure.ac:211: -1- AM_CONDITIONAL([USE_GIF], [(test x$all = xtrue || test x$gif = xtrue)]) -m4trace:configure.ac:211: -1- AC_SUBST([USE_GIF_TRUE]) -m4trace:configure.ac:211: -1- AC_SUBST_TRACE([USE_GIF_TRUE]) -m4trace:configure.ac:211: -1- m4_pattern_allow([^USE_GIF_TRUE$]) -m4trace:configure.ac:211: -1- AC_SUBST([USE_GIF_FALSE]) -m4trace:configure.ac:211: -1- AC_SUBST_TRACE([USE_GIF_FALSE]) -m4trace:configure.ac:211: -1- m4_pattern_allow([^USE_GIF_FALSE$]) -m4trace:configure.ac:211: -1- _AM_SUBST_NOTMAKE([USE_GIF_TRUE]) -m4trace:configure.ac:211: -1- _AM_SUBST_NOTMAKE([USE_GIF_FALSE]) -m4trace:configure.ac:215: -1- AC_SUBST([PNG_LIBS]) -m4trace:configure.ac:215: -1- AC_SUBST_TRACE([PNG_LIBS]) -m4trace:configure.ac:215: -1- m4_pattern_allow([^PNG_LIBS$]) -m4trace:configure.ac:225: -1- AC_SUBST([JPEG_FLAGS]) -m4trace:configure.ac:225: -1- AC_SUBST_TRACE([JPEG_FLAGS]) -m4trace:configure.ac:225: -1- m4_pattern_allow([^JPEG_FLAGS$]) -m4trace:configure.ac:228: -1- AC_SUBST([JPEG_LIBS]) -m4trace:configure.ac:228: -1- AC_SUBST_TRACE([JPEG_LIBS]) -m4trace:configure.ac:228: -1- m4_pattern_allow([^JPEG_LIBS$]) -m4trace:configure.ac:230: -1- AM_CONDITIONAL([USE_JPEG], [(test x$all = xtrue || test x$jpeg = xtrue)]) -m4trace:configure.ac:230: -1- AC_SUBST([USE_JPEG_TRUE]) -m4trace:configure.ac:230: -1- AC_SUBST_TRACE([USE_JPEG_TRUE]) -m4trace:configure.ac:230: -1- m4_pattern_allow([^USE_JPEG_TRUE$]) -m4trace:configure.ac:230: -1- AC_SUBST([USE_JPEG_FALSE]) -m4trace:configure.ac:230: -1- AC_SUBST_TRACE([USE_JPEG_FALSE]) -m4trace:configure.ac:230: -1- m4_pattern_allow([^USE_JPEG_FALSE$]) -m4trace:configure.ac:230: -1- _AM_SUBST_NOTMAKE([USE_JPEG_TRUE]) -m4trace:configure.ac:230: -1- _AM_SUBST_NOTMAKE([USE_JPEG_FALSE]) -m4trace:configure.ac:246: -1- AH_OUTPUT([HAVE_LIBHPDF], [/* Define to 1 if you have the `hpdf\' library (-lhpdf). */ +m4trace:configure.ac:108: -1- AC_SUBST([GL_LIBS]) +m4trace:configure.ac:108: -1- AC_SUBST_TRACE([GL_LIBS]) +m4trace:configure.ac:108: -1- m4_pattern_allow([^GL_LIBS$]) +m4trace:configure.ac:114: -1- AC_SUBST([GL_LIBS]) +m4trace:configure.ac:114: -1- AC_SUBST_TRACE([GL_LIBS]) +m4trace:configure.ac:114: -1- m4_pattern_allow([^GL_LIBS$]) +m4trace:configure.ac:121: -1- AC_SUBST([GL_LIBS]) +m4trace:configure.ac:121: -1- AC_SUBST_TRACE([GL_LIBS]) +m4trace:configure.ac:121: -1- m4_pattern_allow([^GL_LIBS$]) +m4trace:configure.ac:126: -1- AM_CONDITIONAL([USE_GLUT], [(test x$all = xtrue || test x$glut = xtrue)]) +m4trace:configure.ac:126: -1- AC_SUBST([USE_GLUT_TRUE]) +m4trace:configure.ac:126: -1- AC_SUBST_TRACE([USE_GLUT_TRUE]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^USE_GLUT_TRUE$]) +m4trace:configure.ac:126: -1- AC_SUBST([USE_GLUT_FALSE]) +m4trace:configure.ac:126: -1- AC_SUBST_TRACE([USE_GLUT_FALSE]) +m4trace:configure.ac:126: -1- m4_pattern_allow([^USE_GLUT_FALSE$]) +m4trace:configure.ac:126: -1- _AM_SUBST_NOTMAKE([USE_GLUT_TRUE]) +m4trace:configure.ac:126: -1- _AM_SUBST_NOTMAKE([USE_GLUT_FALSE]) +m4trace:configure.ac:156: -1- AC_SUBST([HDF5_FLAGS]) +m4trace:configure.ac:156: -1- AC_SUBST_TRACE([HDF5_FLAGS]) +m4trace:configure.ac:156: -1- m4_pattern_allow([^HDF5_FLAGS$]) +m4trace:configure.ac:158: -1- AC_SUBST([HDF5_LIBS]) +m4trace:configure.ac:158: -1- AC_SUBST_TRACE([HDF5_LIBS]) +m4trace:configure.ac:158: -1- m4_pattern_allow([^HDF5_LIBS$]) +m4trace:configure.ac:160: -1- AM_CONDITIONAL([USE_HDF5], [(test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue)]) +m4trace:configure.ac:160: -1- AC_SUBST([USE_HDF5_TRUE]) +m4trace:configure.ac:160: -1- AC_SUBST_TRACE([USE_HDF5_TRUE]) +m4trace:configure.ac:160: -1- m4_pattern_allow([^USE_HDF5_TRUE$]) +m4trace:configure.ac:160: -1- AC_SUBST([USE_HDF5_FALSE]) +m4trace:configure.ac:160: -1- AC_SUBST_TRACE([USE_HDF5_FALSE]) +m4trace:configure.ac:160: -1- m4_pattern_allow([^USE_HDF5_FALSE$]) +m4trace:configure.ac:160: -1- _AM_SUBST_NOTMAKE([USE_HDF5_TRUE]) +m4trace:configure.ac:160: -1- _AM_SUBST_NOTMAKE([USE_HDF5_FALSE]) +m4trace:configure.ac:172: -1- AC_SUBST([HDF4_FLAGS]) +m4trace:configure.ac:172: -1- AC_SUBST_TRACE([HDF4_FLAGS]) +m4trace:configure.ac:172: -1- m4_pattern_allow([^HDF4_FLAGS$]) +m4trace:configure.ac:173: -1- AC_SUBST([HDF4_LIBS]) +m4trace:configure.ac:173: -1- AC_SUBST_TRACE([HDF4_LIBS]) +m4trace:configure.ac:173: -1- m4_pattern_allow([^HDF4_LIBS$]) +m4trace:configure.ac:175: -1- AM_CONDITIONAL([USE_HDF4], [(test x$all = xtrue || test x$hdf4 = xtrue)]) +m4trace:configure.ac:175: -1- AC_SUBST([USE_HDF4_TRUE]) +m4trace:configure.ac:175: -1- AC_SUBST_TRACE([USE_HDF4_TRUE]) +m4trace:configure.ac:175: -1- m4_pattern_allow([^USE_HDF4_TRUE$]) +m4trace:configure.ac:175: -1- AC_SUBST([USE_HDF4_FALSE]) +m4trace:configure.ac:175: -1- AC_SUBST_TRACE([USE_HDF4_FALSE]) +m4trace:configure.ac:175: -1- m4_pattern_allow([^USE_HDF4_FALSE$]) +m4trace:configure.ac:175: -1- _AM_SUBST_NOTMAKE([USE_HDF4_TRUE]) +m4trace:configure.ac:175: -1- _AM_SUBST_NOTMAKE([USE_HDF4_FALSE]) +m4trace:configure.ac:179: -1- AC_SUBST([PNG_LIBS]) +m4trace:configure.ac:179: -1- AC_SUBST_TRACE([PNG_LIBS]) +m4trace:configure.ac:179: -1- m4_pattern_allow([^PNG_LIBS$]) +m4trace:configure.ac:189: -1- AC_SUBST([JPEG_FLAGS]) +m4trace:configure.ac:189: -1- AC_SUBST_TRACE([JPEG_FLAGS]) +m4trace:configure.ac:189: -1- m4_pattern_allow([^JPEG_FLAGS$]) +m4trace:configure.ac:192: -1- AC_SUBST([JPEG_LIBS]) +m4trace:configure.ac:192: -1- AC_SUBST_TRACE([JPEG_LIBS]) +m4trace:configure.ac:192: -1- m4_pattern_allow([^JPEG_LIBS$]) +m4trace:configure.ac:194: -1- AM_CONDITIONAL([USE_JPEG], [(test x$all = xtrue || test x$jpeg = xtrue)]) +m4trace:configure.ac:194: -1- AC_SUBST([USE_JPEG_TRUE]) +m4trace:configure.ac:194: -1- AC_SUBST_TRACE([USE_JPEG_TRUE]) +m4trace:configure.ac:194: -1- m4_pattern_allow([^USE_JPEG_TRUE$]) +m4trace:configure.ac:194: -1- AC_SUBST([USE_JPEG_FALSE]) +m4trace:configure.ac:194: -1- AC_SUBST_TRACE([USE_JPEG_FALSE]) +m4trace:configure.ac:194: -1- m4_pattern_allow([^USE_JPEG_FALSE$]) +m4trace:configure.ac:194: -1- _AM_SUBST_NOTMAKE([USE_JPEG_TRUE]) +m4trace:configure.ac:194: -1- _AM_SUBST_NOTMAKE([USE_JPEG_FALSE]) +m4trace:configure.ac:210: -1- AH_OUTPUT([HAVE_LIBHPDF], [/* Define to 1 if you have the `hpdf\' library (-lhpdf). */ @%:@undef HAVE_LIBHPDF]) -m4trace:configure.ac:246: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBHPDF]) -m4trace:configure.ac:246: -1- m4_pattern_allow([^HAVE_LIBHPDF$]) -m4trace:configure.ac:252: -1- AH_OUTPUT([HAVE_HPDF_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:210: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBHPDF]) +m4trace:configure.ac:210: -1- m4_pattern_allow([^HAVE_LIBHPDF$]) +m4trace:configure.ac:216: -1- AH_OUTPUT([HAVE_HPDF_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_HPDF_H]) -m4trace:configure.ac:252: -1- AC_DEFINE_TRACE_LITERAL([HAVE_HPDF_H]) -m4trace:configure.ac:252: -1- m4_pattern_allow([^HAVE_HPDF_H$]) -m4trace:configure.ac:257: -1- AM_CONDITIONAL([USE_PDF], [test x$pdf = xtrue]) -m4trace:configure.ac:257: -1- AC_SUBST([USE_PDF_TRUE]) -m4trace:configure.ac:257: -1- AC_SUBST_TRACE([USE_PDF_TRUE]) -m4trace:configure.ac:257: -1- m4_pattern_allow([^USE_PDF_TRUE$]) -m4trace:configure.ac:257: -1- AC_SUBST([USE_PDF_FALSE]) -m4trace:configure.ac:257: -1- AC_SUBST_TRACE([USE_PDF_FALSE]) -m4trace:configure.ac:257: -1- m4_pattern_allow([^USE_PDF_FALSE$]) -m4trace:configure.ac:257: -1- _AM_SUBST_NOTMAKE([USE_PDF_TRUE]) -m4trace:configure.ac:257: -1- _AM_SUBST_NOTMAKE([USE_PDF_FALSE]) -m4trace:configure.ac:259: -1- AC_SUBST([U3D_LIBS], ["-lIDTF -lm -ldl"]) -m4trace:configure.ac:259: -1- AC_SUBST_TRACE([U3D_LIBS]) -m4trace:configure.ac:259: -1- m4_pattern_allow([^U3D_LIBS$]) -m4trace:configure.ac:259: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U3D]) -m4trace:configure.ac:259: -1- m4_pattern_allow([^HAVE_U3D$]) -m4trace:configure.ac:259: -1- AH_OUTPUT([HAVE_U3D], [/* Define if you have libIDTF */ +m4trace:configure.ac:216: -1- AC_DEFINE_TRACE_LITERAL([HAVE_HPDF_H]) +m4trace:configure.ac:216: -1- m4_pattern_allow([^HAVE_HPDF_H$]) +m4trace:configure.ac:221: -1- AM_CONDITIONAL([USE_PDF], [test x$pdf = xtrue]) +m4trace:configure.ac:221: -1- AC_SUBST([USE_PDF_TRUE]) +m4trace:configure.ac:221: -1- AC_SUBST_TRACE([USE_PDF_TRUE]) +m4trace:configure.ac:221: -1- m4_pattern_allow([^USE_PDF_TRUE$]) +m4trace:configure.ac:221: -1- AC_SUBST([USE_PDF_FALSE]) +m4trace:configure.ac:221: -1- AC_SUBST_TRACE([USE_PDF_FALSE]) +m4trace:configure.ac:221: -1- m4_pattern_allow([^USE_PDF_FALSE$]) +m4trace:configure.ac:221: -1- _AM_SUBST_NOTMAKE([USE_PDF_TRUE]) +m4trace:configure.ac:221: -1- _AM_SUBST_NOTMAKE([USE_PDF_FALSE]) +m4trace:configure.ac:223: -1- AC_SUBST([U3D_LIBS], ["-lIDTF -lm -ldl"]) +m4trace:configure.ac:223: -1- AC_SUBST_TRACE([U3D_LIBS]) +m4trace:configure.ac:223: -1- m4_pattern_allow([^U3D_LIBS$]) +m4trace:configure.ac:223: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U3D]) +m4trace:configure.ac:223: -1- m4_pattern_allow([^HAVE_U3D$]) +m4trace:configure.ac:223: -1- AH_OUTPUT([HAVE_U3D], [/* Define if you have libIDTF */ @%:@undef HAVE_U3D]) -m4trace:configure.ac:268: -1- AH_OUTPUT([HAVE_U3D_SCENECONVERTERLIB_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:232: -1- AH_OUTPUT([HAVE_U3D_SCENECONVERTERLIB_H], [/* Define to 1 if you have the header file. */ @%:@undef HAVE_U3D_SCENECONVERTERLIB_H]) -m4trace:configure.ac:268: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U3D_SCENECONVERTERLIB_H]) -m4trace:configure.ac:268: -1- m4_pattern_allow([^HAVE_U3D_SCENECONVERTERLIB_H$]) -m4trace:configure.ac:273: -1- AM_CONDITIONAL([USE_U3D], [test x$u3d = xtrue]) -m4trace:configure.ac:273: -1- AC_SUBST([USE_U3D_TRUE]) -m4trace:configure.ac:273: -1- AC_SUBST_TRACE([USE_U3D_TRUE]) -m4trace:configure.ac:273: -1- m4_pattern_allow([^USE_U3D_TRUE$]) -m4trace:configure.ac:273: -1- AC_SUBST([USE_U3D_FALSE]) -m4trace:configure.ac:273: -1- AC_SUBST_TRACE([USE_U3D_FALSE]) -m4trace:configure.ac:273: -1- m4_pattern_allow([^USE_U3D_FALSE$]) -m4trace:configure.ac:273: -1- _AM_SUBST_NOTMAKE([USE_U3D_TRUE]) -m4trace:configure.ac:273: -1- _AM_SUBST_NOTMAKE([USE_U3D_FALSE]) -m4trace:configure.ac:284: -1- AC_SUBST([FLTK_FLAGS]) -m4trace:configure.ac:284: -1- AC_SUBST_TRACE([FLTK_FLAGS]) -m4trace:configure.ac:284: -1- m4_pattern_allow([^FLTK_FLAGS$]) -m4trace:configure.ac:285: -1- AC_SUBST([FLTK_LIBS]) -m4trace:configure.ac:285: -1- AC_SUBST_TRACE([FLTK_LIBS]) -m4trace:configure.ac:285: -1- m4_pattern_allow([^FLTK_LIBS$]) -m4trace:configure.ac:294: -1- AM_CONDITIONAL([USE_FLTK], [test x$test_fltk = xtrue]) -m4trace:configure.ac:294: -1- AC_SUBST([USE_FLTK_TRUE]) -m4trace:configure.ac:294: -1- AC_SUBST_TRACE([USE_FLTK_TRUE]) -m4trace:configure.ac:294: -1- m4_pattern_allow([^USE_FLTK_TRUE$]) -m4trace:configure.ac:294: -1- AC_SUBST([USE_FLTK_FALSE]) -m4trace:configure.ac:294: -1- AC_SUBST_TRACE([USE_FLTK_FALSE]) -m4trace:configure.ac:294: -1- m4_pattern_allow([^USE_FLTK_FALSE$]) -m4trace:configure.ac:294: -1- _AM_SUBST_NOTMAKE([USE_FLTK_TRUE]) -m4trace:configure.ac:294: -1- _AM_SUBST_NOTMAKE([USE_FLTK_FALSE]) -m4trace:configure.ac:306: -1- AC_SUBST([WX_FLAGS]) -m4trace:configure.ac:306: -1- AC_SUBST_TRACE([WX_FLAGS]) -m4trace:configure.ac:306: -1- m4_pattern_allow([^WX_FLAGS$]) -m4trace:configure.ac:307: -1- AC_SUBST([WX_LIBS]) -m4trace:configure.ac:307: -1- AC_SUBST_TRACE([WX_LIBS]) -m4trace:configure.ac:307: -1- m4_pattern_allow([^WX_LIBS$]) -m4trace:configure.ac:316: -1- AM_CONDITIONAL([USE_WX], [test x$test_wx = xtrue]) -m4trace:configure.ac:316: -1- AC_SUBST([USE_WX_TRUE]) -m4trace:configure.ac:316: -1- AC_SUBST_TRACE([USE_WX_TRUE]) -m4trace:configure.ac:316: -1- m4_pattern_allow([^USE_WX_TRUE$]) -m4trace:configure.ac:316: -1- AC_SUBST([USE_WX_FALSE]) -m4trace:configure.ac:316: -1- AC_SUBST_TRACE([USE_WX_FALSE]) -m4trace:configure.ac:316: -1- m4_pattern_allow([^USE_WX_FALSE$]) -m4trace:configure.ac:316: -1- _AM_SUBST_NOTMAKE([USE_WX_TRUE]) -m4trace:configure.ac:316: -1- _AM_SUBST_NOTMAKE([USE_WX_FALSE]) -m4trace:configure.ac:326: -1- AC_SUBST([QMAKE]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([QMAKE]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QMAKE$]) -m4trace:configure.ac:326: -1- AC_SUBST([QMAKE]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([QMAKE]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QMAKE$]) -m4trace:configure.ac:326: -1- AC_SUBST([MOC]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([MOC]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^MOC$]) -m4trace:configure.ac:326: -1- AC_SUBST([MOC]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([MOC]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^MOC$]) -m4trace:configure.ac:326: -1- AC_SUBST([UIC]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([UIC]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^UIC$]) -m4trace:configure.ac:326: -1- AC_SUBST([UIC]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([UIC]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^UIC$]) -m4trace:configure.ac:326: -1- AC_SUBST([RCC]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([RCC]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^RCC$]) -m4trace:configure.ac:326: -1- AC_SUBST([RCC]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([RCC]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^RCC$]) -m4trace:configure.ac:326: -1- AC_SUBST([QT_PATH]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([QT_PATH]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_PATH$]) -m4trace:configure.ac:326: -1- AC_SUBST([TMPDIR]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([TMPDIR]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^TMPDIR$]) -m4trace:configure.ac:326: -1- AC_SUBST([QT_VERSION_MAJOR]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([QT_VERSION_MAJOR]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_VERSION_MAJOR$]) -m4trace:configure.ac:326: -1- AC_SUBST([QT_DEFINES], [$at_cv_env_QT_DEFINES]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([QT_DEFINES]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_DEFINES$]) -m4trace:configure.ac:326: -1- AC_SUBST([QT_CFLAGS], [$at_cv_env_QT_CFLAGS]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([QT_CFLAGS]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_CFLAGS$]) -m4trace:configure.ac:326: -1- AC_SUBST([QT_CXXFLAGS], [$at_cv_env_QT_CXXFLAGS]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([QT_CXXFLAGS]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_CXXFLAGS$]) -m4trace:configure.ac:326: -1- AC_SUBST([QT_INCPATH], [$at_cv_env_QT_INCPATH]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([QT_INCPATH]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_INCPATH$]) -m4trace:configure.ac:326: -1- AC_SUBST([QT_CPPFLAGS], ["$at_cv_env_QT_DEFINES $at_cv_env_QT_INCPATH"]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([QT_CPPFLAGS]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_CPPFLAGS$]) -m4trace:configure.ac:326: -1- AC_SUBST([QT_LFLAGS], [$at_cv_env_QT_LDFLAGS]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([QT_LFLAGS]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_LFLAGS$]) -m4trace:configure.ac:326: -1- AC_SUBST([QT_LDFLAGS], [$at_cv_env_QT_LDFLAGS]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([QT_LDFLAGS]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_LDFLAGS$]) -m4trace:configure.ac:326: -1- AC_SUBST([QT_LIBS], [$at_cv_env_QT_LIBS]) -m4trace:configure.ac:326: -1- AC_SUBST_TRACE([QT_LIBS]) -m4trace:configure.ac:326: -1- m4_pattern_allow([^QT_LIBS$]) -m4trace:configure.ac:327: -1- AC_SUBST([QT_VERSION], [$at_cv_QT_VERSION]) -m4trace:configure.ac:327: -1- AC_SUBST_TRACE([QT_VERSION]) -m4trace:configure.ac:327: -1- m4_pattern_allow([^QT_VERSION$]) -m4trace:configure.ac:330: -1- AM_CONDITIONAL([USE_QT], [test x$test_qt = xtrue]) -m4trace:configure.ac:330: -1- AC_SUBST([USE_QT_TRUE]) -m4trace:configure.ac:330: -1- AC_SUBST_TRACE([USE_QT_TRUE]) -m4trace:configure.ac:330: -1- m4_pattern_allow([^USE_QT_TRUE$]) -m4trace:configure.ac:330: -1- AC_SUBST([USE_QT_FALSE]) -m4trace:configure.ac:330: -1- AC_SUBST_TRACE([USE_QT_FALSE]) -m4trace:configure.ac:330: -1- m4_pattern_allow([^USE_QT_FALSE$]) -m4trace:configure.ac:330: -1- _AM_SUBST_NOTMAKE([USE_QT_TRUE]) -m4trace:configure.ac:330: -1- _AM_SUBST_NOTMAKE([USE_QT_FALSE]) -m4trace:configure.ac:340: -1- AC_SUBST([PYTHON_HEADERS]) -m4trace:configure.ac:340: -1- AC_SUBST_TRACE([PYTHON_HEADERS]) -m4trace:configure.ac:340: -1- m4_pattern_allow([^PYTHON_HEADERS$]) -m4trace:configure.ac:341: -1- AC_SUBST([HAVE_SWIG]) -m4trace:configure.ac:341: -1- AC_SUBST_TRACE([HAVE_SWIG]) -m4trace:configure.ac:341: -1- m4_pattern_allow([^HAVE_SWIG$]) -m4trace:configure.ac:344: -1- AC_SUBST([PYTHON]) -m4trace:configure.ac:344: -1- AC_SUBST_TRACE([PYTHON]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^PYTHON$]) -m4trace:configure.ac:344: -1- AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) -m4trace:configure.ac:344: -1- AC_SUBST_TRACE([PYTHON_VERSION]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^PYTHON_VERSION$]) -m4trace:configure.ac:344: -1- AC_SUBST([PYTHON_PREFIX], ['${prefix}']) -m4trace:configure.ac:344: -1- AC_SUBST_TRACE([PYTHON_PREFIX]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^PYTHON_PREFIX$]) -m4trace:configure.ac:344: -1- AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) -m4trace:configure.ac:344: -1- AC_SUBST_TRACE([PYTHON_EXEC_PREFIX]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^PYTHON_EXEC_PREFIX$]) -m4trace:configure.ac:344: -1- AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) -m4trace:configure.ac:344: -1- AC_SUBST_TRACE([PYTHON_PLATFORM]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^PYTHON_PLATFORM$]) -m4trace:configure.ac:344: -1- AC_SUBST([pythondir], [$am_cv_python_pythondir]) -m4trace:configure.ac:344: -1- AC_SUBST_TRACE([pythondir]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^pythondir$]) -m4trace:configure.ac:344: -1- AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) -m4trace:configure.ac:344: -1- AC_SUBST_TRACE([pkgpythondir]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^pkgpythondir$]) -m4trace:configure.ac:344: -1- AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) -m4trace:configure.ac:344: -1- AC_SUBST_TRACE([pyexecdir]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^pyexecdir$]) -m4trace:configure.ac:344: -1- AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) -m4trace:configure.ac:344: -1- AC_SUBST_TRACE([pkgpyexecdir]) -m4trace:configure.ac:344: -1- m4_pattern_allow([^pkgpyexecdir$]) -m4trace:configure.ac:350: -1- AM_CONDITIONAL([USE_PYTHON], [test x$test_python = xtrue ]) -m4trace:configure.ac:350: -1- AC_SUBST([USE_PYTHON_TRUE]) -m4trace:configure.ac:350: -1- AC_SUBST_TRACE([USE_PYTHON_TRUE]) -m4trace:configure.ac:350: -1- m4_pattern_allow([^USE_PYTHON_TRUE$]) -m4trace:configure.ac:350: -1- AC_SUBST([USE_PYTHON_FALSE]) -m4trace:configure.ac:350: -1- AC_SUBST_TRACE([USE_PYTHON_FALSE]) -m4trace:configure.ac:350: -1- m4_pattern_allow([^USE_PYTHON_FALSE$]) -m4trace:configure.ac:350: -1- _AM_SUBST_NOTMAKE([USE_PYTHON_TRUE]) -m4trace:configure.ac:350: -1- _AM_SUBST_NOTMAKE([USE_PYTHON_FALSE]) -m4trace:configure.ac:360: -1- AC_SUBST([OCTAVE]) -m4trace:configure.ac:360: -1- AC_SUBST_TRACE([OCTAVE]) -m4trace:configure.ac:360: -1- m4_pattern_allow([^OCTAVE$]) -m4trace:configure.ac:367: -1- AC_SUBST([OCTAVE_ARCH], [$OCTAVE_ARCH]) -m4trace:configure.ac:367: -1- AC_SUBST_TRACE([OCTAVE_ARCH]) -m4trace:configure.ac:367: -1- m4_pattern_allow([^OCTAVE_ARCH$]) -m4trace:configure.ac:368: -1- AC_SUBST([OCTAVE_INCFLAGS], [$OCTAVE_INCFLAGS]) -m4trace:configure.ac:368: -1- AC_SUBST_TRACE([OCTAVE_INCFLAGS]) -m4trace:configure.ac:368: -1- m4_pattern_allow([^OCTAVE_INCFLAGS$]) -m4trace:configure.ac:371: -1- AM_CONDITIONAL([USE_OCTAVE], [test x$test_octave = xtrue ]) -m4trace:configure.ac:371: -1- AC_SUBST([USE_OCTAVE_TRUE]) -m4trace:configure.ac:371: -1- AC_SUBST_TRACE([USE_OCTAVE_TRUE]) -m4trace:configure.ac:371: -1- m4_pattern_allow([^USE_OCTAVE_TRUE$]) -m4trace:configure.ac:371: -1- AC_SUBST([USE_OCTAVE_FALSE]) -m4trace:configure.ac:371: -1- AC_SUBST_TRACE([USE_OCTAVE_FALSE]) -m4trace:configure.ac:371: -1- m4_pattern_allow([^USE_OCTAVE_FALSE$]) -m4trace:configure.ac:371: -1- _AM_SUBST_NOTMAKE([USE_OCTAVE_TRUE]) -m4trace:configure.ac:371: -1- _AM_SUBST_NOTMAKE([USE_OCTAVE_FALSE]) -m4trace:configure.ac:380: -1- AM_CONDITIONAL([USE_TESTIO], [test x$testio = xtrue ]) -m4trace:configure.ac:380: -1- AC_SUBST([USE_TESTIO_TRUE]) -m4trace:configure.ac:380: -1- AC_SUBST_TRACE([USE_TESTIO_TRUE]) -m4trace:configure.ac:380: -1- m4_pattern_allow([^USE_TESTIO_TRUE$]) -m4trace:configure.ac:380: -1- AC_SUBST([USE_TESTIO_FALSE]) -m4trace:configure.ac:380: -1- AC_SUBST_TRACE([USE_TESTIO_FALSE]) -m4trace:configure.ac:380: -1- m4_pattern_allow([^USE_TESTIO_FALSE$]) -m4trace:configure.ac:380: -1- _AM_SUBST_NOTMAKE([USE_TESTIO_TRUE]) -m4trace:configure.ac:380: -1- _AM_SUBST_NOTMAKE([USE_TESTIO_FALSE]) -m4trace:configure.ac:390: -1- AC_CONFIG_FILES([texinfo/Makefile texinfo/png/Makefile]) -m4trace:configure.ac:392: -1- AM_CONDITIONAL([USE_DOCS], [(test x$docs = xtrue || test x$all = xtrue) ]) -m4trace:configure.ac:392: -1- AC_SUBST([USE_DOCS_TRUE]) -m4trace:configure.ac:392: -1- AC_SUBST_TRACE([USE_DOCS_TRUE]) -m4trace:configure.ac:392: -1- m4_pattern_allow([^USE_DOCS_TRUE$]) -m4trace:configure.ac:392: -1- AC_SUBST([USE_DOCS_FALSE]) -m4trace:configure.ac:392: -1- AC_SUBST_TRACE([USE_DOCS_FALSE]) -m4trace:configure.ac:392: -1- m4_pattern_allow([^USE_DOCS_FALSE$]) -m4trace:configure.ac:392: -1- _AM_SUBST_NOTMAKE([USE_DOCS_TRUE]) -m4trace:configure.ac:392: -1- _AM_SUBST_NOTMAKE([USE_DOCS_FALSE]) -m4trace:configure.ac:395: -1- AC_SUBST([AM_CXXFLAGS]) -m4trace:configure.ac:395: -1- AC_SUBST_TRACE([AM_CXXFLAGS]) -m4trace:configure.ac:395: -1- m4_pattern_allow([^AM_CXXFLAGS$]) -m4trace:configure.ac:397: -1- AC_CONFIG_FILES([ +m4trace:configure.ac:232: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U3D_SCENECONVERTERLIB_H]) +m4trace:configure.ac:232: -1- m4_pattern_allow([^HAVE_U3D_SCENECONVERTERLIB_H$]) +m4trace:configure.ac:237: -1- AM_CONDITIONAL([USE_U3D], [test x$u3d = xtrue]) +m4trace:configure.ac:237: -1- AC_SUBST([USE_U3D_TRUE]) +m4trace:configure.ac:237: -1- AC_SUBST_TRACE([USE_U3D_TRUE]) +m4trace:configure.ac:237: -1- m4_pattern_allow([^USE_U3D_TRUE$]) +m4trace:configure.ac:237: -1- AC_SUBST([USE_U3D_FALSE]) +m4trace:configure.ac:237: -1- AC_SUBST_TRACE([USE_U3D_FALSE]) +m4trace:configure.ac:237: -1- m4_pattern_allow([^USE_U3D_FALSE$]) +m4trace:configure.ac:237: -1- _AM_SUBST_NOTMAKE([USE_U3D_TRUE]) +m4trace:configure.ac:237: -1- _AM_SUBST_NOTMAKE([USE_U3D_FALSE]) +m4trace:configure.ac:248: -1- AC_SUBST([FLTK_FLAGS]) +m4trace:configure.ac:248: -1- AC_SUBST_TRACE([FLTK_FLAGS]) +m4trace:configure.ac:248: -1- m4_pattern_allow([^FLTK_FLAGS$]) +m4trace:configure.ac:249: -1- AC_SUBST([FLTK_LIBS]) +m4trace:configure.ac:249: -1- AC_SUBST_TRACE([FLTK_LIBS]) +m4trace:configure.ac:249: -1- m4_pattern_allow([^FLTK_LIBS$]) +m4trace:configure.ac:258: -1- AM_CONDITIONAL([USE_FLTK], [test x$test_fltk = xtrue]) +m4trace:configure.ac:258: -1- AC_SUBST([USE_FLTK_TRUE]) +m4trace:configure.ac:258: -1- AC_SUBST_TRACE([USE_FLTK_TRUE]) +m4trace:configure.ac:258: -1- m4_pattern_allow([^USE_FLTK_TRUE$]) +m4trace:configure.ac:258: -1- AC_SUBST([USE_FLTK_FALSE]) +m4trace:configure.ac:258: -1- AC_SUBST_TRACE([USE_FLTK_FALSE]) +m4trace:configure.ac:258: -1- m4_pattern_allow([^USE_FLTK_FALSE$]) +m4trace:configure.ac:258: -1- _AM_SUBST_NOTMAKE([USE_FLTK_TRUE]) +m4trace:configure.ac:258: -1- _AM_SUBST_NOTMAKE([USE_FLTK_FALSE]) +m4trace:configure.ac:268: -1- AC_SUBST([QMAKE]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([QMAKE]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QMAKE$]) +m4trace:configure.ac:268: -1- AC_SUBST([QMAKE]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([QMAKE]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QMAKE$]) +m4trace:configure.ac:268: -1- AC_SUBST([MOC]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([MOC]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^MOC$]) +m4trace:configure.ac:268: -1- AC_SUBST([MOC]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([MOC]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^MOC$]) +m4trace:configure.ac:268: -1- AC_SUBST([UIC]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([UIC]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^UIC$]) +m4trace:configure.ac:268: -1- AC_SUBST([UIC]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([UIC]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^UIC$]) +m4trace:configure.ac:268: -1- AC_SUBST([RCC]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([RCC]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^RCC$]) +m4trace:configure.ac:268: -1- AC_SUBST([RCC]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([RCC]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^RCC$]) +m4trace:configure.ac:268: -1- AC_SUBST([QT_PATH]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([QT_PATH]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_PATH$]) +m4trace:configure.ac:268: -1- AC_SUBST([TMPDIR]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([TMPDIR]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^TMPDIR$]) +m4trace:configure.ac:268: -1- AC_SUBST([QT_VERSION_MAJOR]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([QT_VERSION_MAJOR]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_VERSION_MAJOR$]) +m4trace:configure.ac:268: -1- AC_SUBST([QT_DEFINES], [$at_cv_env_QT_DEFINES]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([QT_DEFINES]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_DEFINES$]) +m4trace:configure.ac:268: -1- AC_SUBST([QT_CFLAGS], [$at_cv_env_QT_CFLAGS]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([QT_CFLAGS]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_CFLAGS$]) +m4trace:configure.ac:268: -1- AC_SUBST([QT_CXXFLAGS], [$at_cv_env_QT_CXXFLAGS]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([QT_CXXFLAGS]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_CXXFLAGS$]) +m4trace:configure.ac:268: -1- AC_SUBST([QT_INCPATH], [$at_cv_env_QT_INCPATH]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([QT_INCPATH]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_INCPATH$]) +m4trace:configure.ac:268: -1- AC_SUBST([QT_CPPFLAGS], ["$at_cv_env_QT_DEFINES $at_cv_env_QT_INCPATH"]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([QT_CPPFLAGS]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_CPPFLAGS$]) +m4trace:configure.ac:268: -1- AC_SUBST([QT_LFLAGS], [$at_cv_env_QT_LDFLAGS]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([QT_LFLAGS]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_LFLAGS$]) +m4trace:configure.ac:268: -1- AC_SUBST([QT_LDFLAGS], [$at_cv_env_QT_LDFLAGS]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([QT_LDFLAGS]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_LDFLAGS$]) +m4trace:configure.ac:268: -1- AC_SUBST([QT_LIBS], [$at_cv_env_QT_LIBS]) +m4trace:configure.ac:268: -1- AC_SUBST_TRACE([QT_LIBS]) +m4trace:configure.ac:268: -1- m4_pattern_allow([^QT_LIBS$]) +m4trace:configure.ac:269: -1- AC_SUBST([QT_VERSION], [$at_cv_QT_VERSION]) +m4trace:configure.ac:269: -1- AC_SUBST_TRACE([QT_VERSION]) +m4trace:configure.ac:269: -1- m4_pattern_allow([^QT_VERSION$]) +m4trace:configure.ac:272: -1- AM_CONDITIONAL([USE_QT], [test x$test_qt = xtrue]) +m4trace:configure.ac:272: -1- AC_SUBST([USE_QT_TRUE]) +m4trace:configure.ac:272: -1- AC_SUBST_TRACE([USE_QT_TRUE]) +m4trace:configure.ac:272: -1- m4_pattern_allow([^USE_QT_TRUE$]) +m4trace:configure.ac:272: -1- AC_SUBST([USE_QT_FALSE]) +m4trace:configure.ac:272: -1- AC_SUBST_TRACE([USE_QT_FALSE]) +m4trace:configure.ac:272: -1- m4_pattern_allow([^USE_QT_FALSE$]) +m4trace:configure.ac:272: -1- _AM_SUBST_NOTMAKE([USE_QT_TRUE]) +m4trace:configure.ac:272: -1- _AM_SUBST_NOTMAKE([USE_QT_FALSE]) +m4trace:configure.ac:282: -1- AC_SUBST([PYTHON_HEADERS]) +m4trace:configure.ac:282: -1- AC_SUBST_TRACE([PYTHON_HEADERS]) +m4trace:configure.ac:282: -1- m4_pattern_allow([^PYTHON_HEADERS$]) +m4trace:configure.ac:283: -1- AC_SUBST([HAVE_SWIG]) +m4trace:configure.ac:283: -1- AC_SUBST_TRACE([HAVE_SWIG]) +m4trace:configure.ac:283: -1- m4_pattern_allow([^HAVE_SWIG$]) +m4trace:configure.ac:286: -1- AC_SUBST([PYTHON]) +m4trace:configure.ac:286: -1- AC_SUBST_TRACE([PYTHON]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^PYTHON$]) +m4trace:configure.ac:286: -1- AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) +m4trace:configure.ac:286: -1- AC_SUBST_TRACE([PYTHON_VERSION]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^PYTHON_VERSION$]) +m4trace:configure.ac:286: -1- AC_SUBST([PYTHON_PREFIX], ['${prefix}']) +m4trace:configure.ac:286: -1- AC_SUBST_TRACE([PYTHON_PREFIX]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^PYTHON_PREFIX$]) +m4trace:configure.ac:286: -1- AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) +m4trace:configure.ac:286: -1- AC_SUBST_TRACE([PYTHON_EXEC_PREFIX]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^PYTHON_EXEC_PREFIX$]) +m4trace:configure.ac:286: -1- AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) +m4trace:configure.ac:286: -1- AC_SUBST_TRACE([PYTHON_PLATFORM]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^PYTHON_PLATFORM$]) +m4trace:configure.ac:286: -1- AC_SUBST([pythondir], [$am_cv_python_pythondir]) +m4trace:configure.ac:286: -1- AC_SUBST_TRACE([pythondir]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^pythondir$]) +m4trace:configure.ac:286: -1- AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) +m4trace:configure.ac:286: -1- AC_SUBST_TRACE([pkgpythondir]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^pkgpythondir$]) +m4trace:configure.ac:286: -1- AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) +m4trace:configure.ac:286: -1- AC_SUBST_TRACE([pyexecdir]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^pyexecdir$]) +m4trace:configure.ac:286: -1- AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) +m4trace:configure.ac:286: -1- AC_SUBST_TRACE([pkgpyexecdir]) +m4trace:configure.ac:286: -1- m4_pattern_allow([^pkgpyexecdir$]) +m4trace:configure.ac:292: -1- AM_CONDITIONAL([USE_PYTHON], [test x$test_python = xtrue ]) +m4trace:configure.ac:292: -1- AC_SUBST([USE_PYTHON_TRUE]) +m4trace:configure.ac:292: -1- AC_SUBST_TRACE([USE_PYTHON_TRUE]) +m4trace:configure.ac:292: -1- m4_pattern_allow([^USE_PYTHON_TRUE$]) +m4trace:configure.ac:292: -1- AC_SUBST([USE_PYTHON_FALSE]) +m4trace:configure.ac:292: -1- AC_SUBST_TRACE([USE_PYTHON_FALSE]) +m4trace:configure.ac:292: -1- m4_pattern_allow([^USE_PYTHON_FALSE$]) +m4trace:configure.ac:292: -1- _AM_SUBST_NOTMAKE([USE_PYTHON_TRUE]) +m4trace:configure.ac:292: -1- _AM_SUBST_NOTMAKE([USE_PYTHON_FALSE]) +m4trace:configure.ac:302: -1- AC_SUBST([OCTAVE]) +m4trace:configure.ac:302: -1- AC_SUBST_TRACE([OCTAVE]) +m4trace:configure.ac:302: -1- m4_pattern_allow([^OCTAVE$]) +m4trace:configure.ac:308: -1- AC_SUBST([OCTAVE_ARCH], [$OCTAVE_ARCH]) +m4trace:configure.ac:308: -1- AC_SUBST_TRACE([OCTAVE_ARCH]) +m4trace:configure.ac:308: -1- m4_pattern_allow([^OCTAVE_ARCH$]) +m4trace:configure.ac:309: -1- AC_SUBST([OCTAVE_INCFLAGS], [$OCTAVE_INCFLAGS]) +m4trace:configure.ac:309: -1- AC_SUBST_TRACE([OCTAVE_INCFLAGS]) +m4trace:configure.ac:309: -1- m4_pattern_allow([^OCTAVE_INCFLAGS$]) +m4trace:configure.ac:312: -1- AM_CONDITIONAL([USE_OCTAVE], [test x$test_octave = xtrue ]) +m4trace:configure.ac:312: -1- AC_SUBST([USE_OCTAVE_TRUE]) +m4trace:configure.ac:312: -1- AC_SUBST_TRACE([USE_OCTAVE_TRUE]) +m4trace:configure.ac:312: -1- m4_pattern_allow([^USE_OCTAVE_TRUE$]) +m4trace:configure.ac:312: -1- AC_SUBST([USE_OCTAVE_FALSE]) +m4trace:configure.ac:312: -1- AC_SUBST_TRACE([USE_OCTAVE_FALSE]) +m4trace:configure.ac:312: -1- m4_pattern_allow([^USE_OCTAVE_FALSE$]) +m4trace:configure.ac:312: -1- _AM_SUBST_NOTMAKE([USE_OCTAVE_TRUE]) +m4trace:configure.ac:312: -1- _AM_SUBST_NOTMAKE([USE_OCTAVE_FALSE]) +m4trace:configure.ac:315: -1- AC_SUBST([AM_CXXFLAGS]) +m4trace:configure.ac:315: -1- AC_SUBST_TRACE([AM_CXXFLAGS]) +m4trace:configure.ac:315: -1- m4_pattern_allow([^AM_CXXFLAGS$]) +m4trace:configure.ac:317: -1- AC_CONFIG_FILES([ Makefile -mgl/Makefile -examples/Makefile +src/Makefile include/Makefile +widgets/Makefile lang/Makefile utils/Makefile -widgets/Makefile +examples/Makefile ]) -m4trace:configure.ac:406: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) -m4trace:configure.ac:406: -1- m4_pattern_allow([^LIB@&t@OBJS$]) -m4trace:configure.ac:406: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([LTLIBOBJS]) -m4trace:configure.ac:406: -1- m4_pattern_allow([^LTLIBOBJS$]) -m4trace:configure.ac:406: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) -m4trace:configure.ac:406: -1- AC_SUBST([am__EXEEXT_TRUE]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE]) -m4trace:configure.ac:406: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) -m4trace:configure.ac:406: -1- AC_SUBST([am__EXEEXT_FALSE]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE]) -m4trace:configure.ac:406: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) -m4trace:configure.ac:406: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) -m4trace:configure.ac:406: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([top_builddir]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([top_build_prefix]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([srcdir]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([abs_srcdir]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([top_srcdir]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([abs_top_srcdir]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([builddir]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([abs_builddir]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([abs_top_builddir]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([INSTALL]) -m4trace:configure.ac:406: -1- AC_SUBST_TRACE([MKDIR_P]) -m4trace:configure.ac:406: -1- AC_REQUIRE_AUX_FILE([ltmain.sh]) +m4trace:configure.ac:326: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.ac:326: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:326: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([LTLIBOBJS]) +m4trace:configure.ac:326: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:326: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.ac:326: -1- AC_SUBST([am__EXEEXT_TRUE]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE]) +m4trace:configure.ac:326: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.ac:326: -1- AC_SUBST([am__EXEEXT_FALSE]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE]) +m4trace:configure.ac:326: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.ac:326: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.ac:326: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([top_builddir]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([top_build_prefix]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([srcdir]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([abs_srcdir]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([top_srcdir]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([abs_top_srcdir]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([builddir]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([abs_builddir]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([abs_top_builddir]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([INSTALL]) +m4trace:configure.ac:326: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.ac:326: -1- AC_REQUIRE_AUX_FILE([ltmain.sh]) diff --git a/config/config.guess b/config/config.guess index dc84c68..c2246a4 100755 --- a/config/config.guess +++ b/config/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2009-11-20' +timestamp='2009-12-30' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -56,8 +56,9 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." diff --git a/config/config.sub b/config/config.sub index 2a55a50..c2d1257 100755 --- a/config/config.sub +++ b/config/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2009-11-20' +timestamp='2010-01-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -75,8 +75,9 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -380,7 +381,8 @@ case $basic_machine in | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ @@ -1085,6 +1087,11 @@ case $basic_machine in basic_machine=tic6x-unknown os=-coff ;; + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu + ;; tile*) basic_machine=tile-unknown os=-linux-gnu @@ -1435,6 +1442,8 @@ case $os in -dicos*) os=-dicos ;; + -nacl*) + ;; -none) ;; *) diff --git a/config/libtool.m4 b/config/libtool.m4 index 88de383..a3fee53 100644 --- a/config/libtool.m4 +++ b/config/libtool.m4 @@ -1,8 +1,7 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -11,8 +10,7 @@ m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -39,7 +37,7 @@ m4_define([_LT_COPYING], [dnl # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) -# serial 57 LT_INIT +# serial 56 LT_INIT # LT_PREREQ(VERSION) @@ -68,7 +66,6 @@ esac # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl @@ -85,8 +82,6 @@ AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) - dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) @@ -123,7 +118,7 @@ m4_defun([_LT_CC_BASENAME], *) break;; esac done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) @@ -143,9 +138,6 @@ m4_defun([_LT_FILEUTILS_DEFAULTS], m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl - _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl @@ -168,13 +160,10 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl -m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our @@ -190,6 +179,7 @@ fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl +_LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) @@ -203,6 +193,23 @@ aix3*) ;; esac +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + # Global variables: ofile=libtool can_build_shared=yes @@ -243,28 +250,6 @@ _LT_CONFIG_COMMANDS ])# _LT_SETUP -# _LT_PREPARE_SED_QUOTE_VARS -# -------------------------- -# Define a few sed substitution that help us do robust quoting. -m4_defun([_LT_PREPARE_SED_QUOTE_VARS], -[# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' -]) - # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' @@ -423,7 +408,7 @@ m4_define([_lt_decl_all_varnames], # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) +[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS @@ -433,7 +418,7 @@ m4_define([_LT_CONFIG_STATUS_DECLARE], # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # -# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +# ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) @@ -532,20 +517,12 @@ LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$[]1 -_LTECHO_EOF' -} - # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -556,9 +533,9 @@ done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -566,38 +543,16 @@ for var in lt_decl_all_varnames([[ \ esac done +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\[$]0 --fallback-echo"')dnl " + lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; +esac + _LT_OUTPUT_LIBTOOL_INIT ]) -# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) -# ------------------------------------ -# Generate a child script FILE with all initialization necessary to -# reuse the environment learned by the parent script, and make the -# file executable. If COMMENT is supplied, it is inserted after the -# `#!' sequence but before initialization text begins. After this -# macro, additional text can be appended to FILE to form the body of -# the child script. The macro ends with non-zero status if the -# file could not be fully written (such as if the disk is full). -m4_ifdef([AS_INIT_GENERATED], -[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], -[m4_defun([_LT_GENERATED_FILE_INIT], -[m4_require([AS_PREPARE])]dnl -[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl -[lt_write_fail=0 -cat >$1 <<_ASEOF || lt_write_fail=1 -#! $SHELL -# Generated by $as_me. -$2 -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$1 <<\_ASEOF || lt_write_fail=1 -AS_SHELL_SANITIZE -_AS_PREPARE -exec AS_MESSAGE_FD>&1 -_ASEOF -test $lt_write_fail = 0 && chmod +x $1[]dnl -m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- @@ -607,11 +562,20 @@ m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], -[# Run this file to recreate a libtool stub with the current configuration.]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. -cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 exec AS_MESSAGE_LOG_FD>>config.log { echo @@ -637,7 +601,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." @@ -682,13 +646,15 @@ chmod +x "$CONFIG_LT" # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. -lt_cl_success=: -test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" -exec AS_MESSAGE_LOG_FD>/dev/null -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false -exec AS_MESSAGE_LOG_FD>>config.log -$lt_cl_success || AS_EXIT(1) +if test "$no_create" != yes; then + lt_cl_success=: + test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false + exec AS_MESSAGE_LOG_FD>>config.log + $lt_cl_success || AS_EXIT(1) +fi ])# LT_OUTPUT @@ -751,12 +717,15 @@ _LT_EOF # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) - _LT_PROG_REPLACE_SHELLFNS + _LT_PROG_XSI_SHELLFNS - mv -f "$cfgfile" "$ofile" || + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], @@ -862,13 +831,11 @@ AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) -AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) -dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER @@ -973,31 +940,6 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) - AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], - [lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD - echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD - $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -1025,7 +967,7 @@ _LT_EOF else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -1045,11 +987,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='' - fi + _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in @@ -1057,7 +995,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -1073,141 +1011,202 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], fi ]) -# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) -# ---------------------------------- +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. -# Store the results from the different compilers for each TAGNAME. -# Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl -if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], - [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ - lt_aix_libpath_sed='[ - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }]' - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi],[]) - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" - fi - ]) - aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) -fi +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], -[m4_divert_text([M4SH-INIT], [$1 -])])# _LT_SHELL_INIT - +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- -# Find how we can fake an echo command that does not interpret backslash. -# In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script which will find a shell with a builtin -# printf (which we can use as an echo command). +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], -[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -AC_MSG_CHECKING([how to print strings]) -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' +[_LT_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$[]1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +[$]* +_LT_EOF + exit 0 +fi -case "$ECHO" in - printf*) AC_MSG_RESULT([printf]) ;; - print*) AC_MSG_RESULT([print -r]) ;; - *) AC_MSG_RESULT([cat]) ;; -esac +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH -m4_ifdef([_AS_DETECT_SUGGESTED], -[_AS_DETECT_SUGGESTED([ - test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test "X`printf %s $ECHO`" = "X$ECHO" \ - || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) -])# _LT_PROG_ECHO_BACKSLASH + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: -# _LT_WITH_SYSROOT -# ---------------- -AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) -AC_ARG_WITH([sysroot], -[ --with-sysroot[=DIR] Search for dependent libraries within DIR - (or the compiler's sysroot if not specified).], -[], [with_sysroot=no]) - -dnl lt_sysroot will always be passed unquoted. We quote it here -dnl in case the user passed a directory name. -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - AC_MSG_RESULT([${with_sysroot}]) - AC_MSG_ERROR([The sysroot must be an absolute path.]) - ;; -esac + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(lt_ECHO) +]) +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], + [An echo program that does not interpret backslashes]) +])# _LT_PROG_ECHO_BACKSLASH - AC_MSG_RESULT([${lt_sysroot:-no}]) -_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- @@ -1237,7 +1236,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in @@ -1355,47 +1354,14 @@ need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK -# _LT_PROG_AR -# ----------- -m4_defun([_LT_PROG_AR], -[AC_CHECK_TOOLS(AR, [ar], false) -: ${AR=ar} -: ${AR_FLAGS=cru} -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) - -AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], - [lt_cv_ar_at_file=no - AC_COMPILE_IFELSE([AC_LANG_PROGRAM], - [echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - AC_TRY_EVAL([lt_ar_try]) - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - ]) - ]) - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi -_LT_DECL([], [archiver_list_spec], [1], - [How to feed a file listing to the archiver]) -])# _LT_PROG_AR - - # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], -[_LT_PROG_AR +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: @@ -1422,19 +1388,10 @@ if test -n "$RANLIB"; then esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) -_LT_DECL([], [lock_old_archive_extraction], [0], - [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE @@ -1459,15 +1416,15 @@ AC_CACHE_CHECK([$1], [$2], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1507,7 +1464,7 @@ AC_CACHE_CHECK([$1], [$2], if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes @@ -1570,11 +1527,6 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -1639,8 +1591,8 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -1691,7 +1643,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -[#line $LINENO "configure" +[#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -1732,13 +1684,7 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } +void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -1747,11 +1693,7 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else @@ -1927,16 +1869,16 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes @@ -2095,7 +2037,6 @@ m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ @@ -2104,23 +2045,16 @@ if test "$GCC" = yes; then darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -2133,7 +2067,7 @@ if test "$GCC" = yes; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -2153,13 +2087,7 @@ BEGIN {RS=" "; FS="/|\n";} { if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) @@ -2247,7 +2175,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -2278,9 +2206,8 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$cc_basename in - yes,*) - # gcc + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -2301,83 +2228,36 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH. + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' ;; *) - # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' ;; esac + dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -2464,19 +2344,6 @@ gnu*) hardcode_into_libs=yes ;; -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -2519,10 +2386,8 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 ;; interix[[3-9]]*) @@ -2589,35 +2454,26 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], - [lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [lt_cv_shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - ]) - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -2629,6 +2485,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -2849,8 +2717,6 @@ _LT_DECL([], [library_names_spec], [1], The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) -_LT_DECL([], [install_override_mode], [1], - [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], @@ -2963,7 +2829,6 @@ AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], @@ -3085,11 +2950,6 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -3098,8 +2958,8 @@ case $host_os in fi ;; esac -_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_TAGDECL([], [reload_cmds], [2])dnl +_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_DECL([], [reload_cmds], [2])dnl ])# _LT_CMD_RELOAD @@ -3151,18 +3011,16 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc*) +cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -3192,10 +3050,6 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -3204,11 +3058,11 @@ hpux10.20* | hpux11*) lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -3234,7 +3088,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -3308,21 +3162,6 @@ tpf*) ;; esac ]) - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` - fi - ;; - esac -fi - file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -3330,11 +3169,7 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method = "file_magic"]) -_LT_DECL([], [file_magic_glob], [1], - [How to find potential files when deplibs_check_method = "file_magic"]) -_LT_DECL([], [want_nocaseglob], [1], - [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) + [Command to use when deplibs_check_method == "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD @@ -3391,19 +3226,7 @@ if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi + AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -3416,13 +3239,13 @@ _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -3437,81 +3260,20 @@ dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) -# _LT_CHECK_SHAREDLIB_FROM_LINKLIB -# -------------------------------- -# how to determine the name of the shared library -# associated with a specific link library. -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], -[m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) -m4_require([_LT_DECL_DLLTOOL]) -AC_CACHE_CHECK([how to associate runtime and link libraries], -lt_cv_sharedlib_from_linklib_cmd, -[lt_cv_sharedlib_from_linklib_cmd='unknown' -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac -]) -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - -_LT_DECL([], [sharedlib_from_linklib_cmd], [1], - [Command to associate shared and link libraries]) -])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB - - -# _LT_PATH_MANIFEST_TOOL -# ---------------------- -# locate the manifest tool -m4_defun([_LT_PATH_MANIFEST_TOOL], -[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], - [lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&AS_MESSAGE_LOG_FD - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest*]) -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi -_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl -])# _LT_PATH_MANIFEST_TOOL - - -# LT_LIB_M -# -------- -# check for math library -AC_DEFUN([LT_LIB_M], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") @@ -3534,12 +3296,7 @@ m4_defun([_LT_COMPILER_NO_RTTI], _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; - *) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; - esac + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, @@ -3556,7 +3313,6 @@ _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl @@ -3624,8 +3380,8 @@ esac lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -3661,7 +3417,6 @@ for ac_symprfx in "" "_"; do else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -3683,7 +3438,7 @@ _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" @@ -3695,18 +3450,6 @@ _LT_EOF if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT@&t@_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT@&t@_DLSYM_CONST -#else -# define LT@&t@_DLSYM_CONST const -#endif - #ifdef __cplusplus extern "C" { #endif @@ -3718,7 +3461,7 @@ _LT_EOF cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -LT@&t@_DLSYM_CONST struct { +const struct { const char *name; void *address; } @@ -3744,15 +3487,15 @@ static const void *lt_preloaded_setup() { _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi @@ -3785,13 +3528,6 @@ else AC_MSG_RESULT(ok) fi -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], @@ -3802,8 +3538,6 @@ _LT_DECL([global_symbol_to_c_name_address], _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) -_LT_DECL([], [nm_file_list_spec], [1], - [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS @@ -3815,6 +3549,7 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= +AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -3865,11 +3600,6 @@ m4_if([$1], [CXX], [ # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -3919,12 +3649,6 @@ m4_if([$1], [CXX], [ ;; esac ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; dgux*) case $cc_basename in ec++*) @@ -4014,8 +3738,8 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene + xlc* | xlC*) + # IBM XL 8.0 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' @@ -4045,7 +3769,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4077,7 +3801,7 @@ m4_if([$1], [CXX], [ ;; solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' @@ -4181,12 +3905,6 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -4229,13 +3947,6 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC' - ;; - esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -4299,13 +4010,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -4317,26 +4022,26 @@ m4_if([$1], [CXX], [ # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; esac ;; esac @@ -4367,7 +4072,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + f77* | f90* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; @@ -4424,11 +4129,9 @@ case $host_os in _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac - -AC_CACHE_CHECK([for $compiler option to produce PIC], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) +AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) # # Check to make sure the PIC flag actually works. @@ -4447,8 +4150,6 @@ fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # @@ -4469,7 +4170,6 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl @@ -4478,35 +4178,30 @@ m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - ;; - esac - ;; + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + linux* | k*bsd*-gnu) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= @@ -4566,36 +4261,13 @@ dnl Note also adjust exclude_expsyms for C++ above. openbsd*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; - *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -4629,12 +4301,11 @@ dnl Note also adjust exclude_expsyms for C++ above. _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.19, is reported +*** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. _LT_EOF fi @@ -4670,12 +4341,10 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -4693,11 +4362,6 @@ _LT_EOF fi ;; - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -4723,16 +4387,15 @@ _LT_EOF if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag=' $pic_flag' + tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -4743,17 +4406,13 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; - xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -4769,17 +4428,17 @@ _LT_EOF fi case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) + xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -4788,13 +4447,13 @@ _LT_EOF fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -4812,8 +4471,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4859,8 +4518,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -4900,10 +4559,8 @@ _LT_EOF else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -4965,6 +4622,7 @@ _LT_EOF if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi + _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then @@ -4990,9 +4648,9 @@ _LT_EOF _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -5001,19 +4659,14 @@ _LT_EOF else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -5045,63 +4698,20 @@ _LT_EOF # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) @@ -5139,7 +4749,7 @@ _LT_EOF # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no @@ -5147,7 +4757,7 @@ _LT_EOF hpux9*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -5162,8 +4772,8 @@ _LT_EOF ;; hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -5181,16 +4791,16 @@ _LT_EOF ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -5202,14 +4812,7 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - m4_if($1, [], [ - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - _LT_LINKER_OPTION([if $CC understands -b], - _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], - [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi @@ -5237,34 +4840,19 @@ _LT_EOF irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], - [lt_cv_irix_exported_symbol], - [save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - AC_LINK_IFELSE( - [AC_LANG_SOURCE( - [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], - [C++], [[int foo (void) { return 0; }]], - [Fortran 77], [[ - subroutine foo - end]], - [Fortran], [[ - subroutine foo - end]])])], - [lt_cv_irix_exported_symbol=yes], - [lt_cv_irix_exported_symbol=no]) - LDFLAGS="$save_LDFLAGS"]) - if test "$lt_cv_irix_exported_symbol" = yes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + ) + LDFLAGS="$save_LDFLAGS" else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -5273,7 +4861,7 @@ _LT_EOF _LT_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -5326,17 +4914,17 @@ _LT_EOF _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' @@ -5346,13 +4934,13 @@ _LT_EOF osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' @@ -5365,9 +4953,9 @@ _LT_EOF _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -5543,38 +5131,36 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - AC_CACHE_CHECK([whether -lc should be explicitly linked in], - [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), - [$RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - ]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi @@ -5639,6 +5225,8 @@ _LT_TAGDECL([], [inherit_rpath], [0], to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], @@ -5649,8 +5237,6 @@ _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) -_LT_TAGDECL([], [postlink_cmds], [2], - [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented @@ -5744,15 +5330,14 @@ CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG -# _LT_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a C++ compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_CXX_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl +# _LT_PROG_CXX +# ------------ +# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ +# compiler, we have our own version here. +m4_defun([_LT_PROG_CXX], +[ +pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) +AC_PROG_CXX if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then @@ -5760,6 +5345,22 @@ if test -n "$CXX" && ( test "X$CXX" != "Xno" && else _lt_caught_CXX_error=yes fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_CXX + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_CXX], []) + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[AC_REQUIRE([_LT_PROG_CXX])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no @@ -5781,8 +5382,6 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -5814,7 +5413,6 @@ if test "$_lt_caught_CXX_error" != yes; then # Allow CC to be a program name with arguments. lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -5832,7 +5430,6 @@ if test "$_lt_caught_CXX_error" != yes; then fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -5854,8 +5451,8 @@ if test "$_lt_caught_CXX_error" != yes; then # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -5887,7 +5484,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no @@ -5996,10 +5593,10 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. - _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' @@ -6008,19 +5605,14 @@ if test "$_lt_caught_CXX_error" != yes; then else # Determine the default libpath from the value encoded in an # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -6050,75 +5642,28 @@ if test "$_lt_caught_CXX_error" != yes; then ;; cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; @@ -6160,11 +5705,6 @@ if test "$_lt_caught_CXX_error" != yes; then gnu*) ;; - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: @@ -6189,11 +5729,11 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no @@ -6254,7 +5794,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then @@ -6264,10 +5804,10 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -6297,7 +5837,7 @@ if test "$_lt_caught_CXX_error" != yes; then case $cc_basename in CC*) # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -6308,9 +5848,9 @@ if test "$_lt_caught_CXX_error" != yes; then *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -6339,7 +5879,7 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -6376,26 +5916,26 @@ if test "$_lt_caught_CXX_error" != yes; then pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 and above use weak symbols + *) # Version 6 will use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -6403,7 +5943,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -6422,9 +5962,9 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; - xl* | mpixl* | bgxl*) + xl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' @@ -6444,13 +5984,13 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='func_echo_all' + output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6519,7 +6059,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo else _LT_TAGVAR(ld_shlibs, $1)=no fi @@ -6554,15 +6094,15 @@ if test "$_lt_caught_CXX_error" != yes; then case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; @@ -6578,17 +6118,17 @@ if test "$_lt_caught_CXX_error" != yes; then # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -6598,7 +6138,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -6634,7 +6174,7 @@ if test "$_lt_caught_CXX_error" != yes; then solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -6655,7 +6195,7 @@ if test "$_lt_caught_CXX_error" != yes; then esac _LT_TAGVAR(link_all_deplibs, $1)=yes - output_verbose_link_cmd='func_echo_all' + output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -6675,14 +6215,14 @@ if test "$_lt_caught_CXX_error" != yes; then if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -6693,7 +6233,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' @@ -6747,10 +6287,6 @@ if test "$_lt_caught_CXX_error" != yes; then CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" - _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -6806,7 +6342,6 @@ if test "$_lt_caught_CXX_error" != yes; then fi # test -n "$compiler" CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -6821,29 +6356,6 @@ AC_LANG_POP ])# _LT_LANG_CXX_CONFIG -# _LT_FUNC_STRIPNAME_CNF -# ---------------------- -# func_stripname_cnf prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# -# This function is identical to the (non-XSI) version of func_stripname, -# except this one can be used by m4 code that may be executed by configure, -# rather than the libtool script. -m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl -AC_REQUIRE([_LT_DECL_SED]) -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) -func_stripname_cnf () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname_cnf -])# _LT_FUNC_STRIPNAME_CNF - # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose @@ -6852,7 +6364,6 @@ func_stripname_cnf () # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl -AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= @@ -6903,13 +6414,6 @@ public class foo { }; _LT_EOF ]) - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -esac - dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then @@ -6921,7 +6425,7 @@ if AC_TRY_EVAL(ac_compile); then pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in + case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -6930,22 +6434,13 @@ if AC_TRY_EVAL(ac_compile); then test $p = "-R"; then prev=$p continue + else + prev= fi - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) + case $p in + -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -6965,10 +6460,8 @@ if AC_TRY_EVAL(ac_compile); then _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi - prev= ;; - *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -7004,7 +6497,6 @@ else fi $RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], @@ -7041,7 +6533,7 @@ linux*) solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -7085,16 +6577,32 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1], ])# _LT_SYS_HIDDEN_LIBDEPS +# _LT_PROG_F77 +# ------------ +# Since AC_PROG_F77 is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_F77], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) +AC_PROG_F77 +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_F77 + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_F77], []) + + # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], -[AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi +[AC_REQUIRE([_LT_PROG_F77])dnl +AC_LANG_PUSH(Fortran 77) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -7113,8 +6621,6 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -7154,9 +6660,7 @@ if test "$_lt_disable_F77" != yes; then # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} - CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -7210,24 +6714,38 @@ if test "$_lt_disable_F77" != yes; then GCC=$lt_save_GCC CC="$lt_save_CC" - CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG +# _LT_PROG_FC +# ----------- +# Since AC_PROG_FC is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_FC], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) +AC_PROG_FC +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_FC + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_FC], []) + + # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], -[AC_LANG_PUSH(Fortran) - -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi +[AC_REQUIRE([_LT_PROG_FC])dnl +AC_LANG_PUSH(Fortran) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= @@ -7246,8 +6764,6 @@ _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no @@ -7287,9 +6803,7 @@ if test "$_lt_disable_FC" != yes; then # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} - CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu @@ -7345,8 +6859,7 @@ if test "$_lt_disable_FC" != yes; then fi # test -n "$compiler" GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS + CC="$lt_save_CC" fi # test "$_lt_disable_FC" != yes AC_LANG_POP @@ -7383,12 +6896,10 @@ _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS +lt_save_CC="$CC" lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} -CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" @@ -7398,8 +6909,6 @@ _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change @@ -7419,8 +6928,7 @@ fi AC_LANG_RESTORE GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS +CC="$lt_save_CC" ])# _LT_LANG_GCJ_CONFIG @@ -7455,11 +6963,9 @@ _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" -lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} -CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) @@ -7472,8 +6978,7 @@ fi GCC=$lt_save_GCC AC_LANG_RESTORE -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS +CC="$lt_save_CC" ])# _LT_LANG_RC_CONFIG @@ -7532,15 +7037,6 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) -# _LT_DECL_DLLTOOL -# ---------------- -# Ensure DLLTOOL variable is set. -m4_defun([_LT_DECL_DLLTOOL], -[AC_CHECK_TOOL(DLLTOOL, dlltool, false) -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) -AC_SUBST([DLLTOOL]) -]) # _LT_DECL_SED # ------------ @@ -7634,8 +7130,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES], # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -7674,162 +7170,208 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES -# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) -# ------------------------------------------------------ -# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and -# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. -m4_defun([_LT_PROG_FUNCTION_REPLACE], -[dnl { -sed -e '/^$1 ()$/,/^} # $1 /c\ -$1 ()\ -{\ -m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) -} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: -]) +# _LT_PROG_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} -# _LT_PROG_REPLACE_SHELLFNS -# ------------------------- -# Replace existing portable implementations of several shell functions with -# equivalent extended shell implementations where those features are available.. -m4_defun([_LT_PROG_REPLACE_SHELLFNS], -[if test x"$xsi_shell" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac]) - - _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl - func_basename_result="${1##*/}"]) - - _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl - case ${1} in - */*) func_dirname_result="${1%/*}${2}" ;; - * ) func_dirname_result="${3}" ;; - esac - func_basename_result="${1##*/}"]) +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} - _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary parameter first. - func_stripname_result=${3} - func_stripname_result=${func_stripname_result#"${1}"} - func_stripname_result=${func_stripname_result%"${2}"}]) +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} - _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl - func_split_long_opt_name=${1%%=*} - func_split_long_opt_arg=${1#*=}]) +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} - _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $[*] )) +} - _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl - case ${1} in - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; - *) func_lo2o_result=${1} ;; - esac]) +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} - _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" - _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} - _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) -fi +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} -if test x"$lt_shell_append" = xyes; then - _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) +dnl func_dirname_and_basename +dnl A portable version of this function is already defined in general.m4sh +dnl so there is no need for it here. - _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl - func_quote_for_eval "${2}" -dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ - eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' -if test x"$_lt_function_replace_fail" = x":"; then - AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) -fi -]) +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} -# _LT_PATH_CONVERSION_FUNCTIONS -# ----------------------------- -# Determine which file name conversion functions should be used by -# func_to_host_file (and, implicitly, by func_to_host_path). These are needed -# for certain cross-compile configurations and native mingw. -m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_MSG_CHECKING([how to convert $build file names to $host format]) -AC_CACHE_VAL(lt_cv_to_host_file_cmd, -[case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$[@]"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF esac -]) -to_host_file_cmd=$lt_cv_to_host_file_cmd -AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) -_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], - [0], [convert $build file names to $host format])dnl - -AC_MSG_CHECKING([how to convert $build file names to toolchain format]) -AC_CACHE_VAL(lt_cv_to_tool_file_cmd, -[#assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF ;; -esac + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} + +_LT_EOF + ;; + esac ]) -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) -_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], - [0], [convert $build files to toolchain format])dnl -])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/config/ltmain.sh b/config/ltmain.sh index aa5624c..fa4b1e1 100755 --- a/config/ltmain.sh +++ b/config/ltmain.sh @@ -1,9 +1,9 @@ +# Generated from ltmain.m4sh. -# libtool (GNU libtool) 2.4 +# ltmain.sh (GNU libtool) 2.2.6b # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -32,56 +32,50 @@ # # Provide generalized library-building support services. # -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print informational messages (default) +# --version print version information +# -h, --help print short or long help message # # MODE must be one of the following: # -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory # -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# MODE-ARGS vary depending on the MODE. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4 -# automake: $automake_version -# autoconf: $autoconf_version +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu3 +# automake: $automake_version +# autoconf: $autoconf_version # # Report bugs to . -# GNU libtool home page: . -# General help using GNU software: . -PROGRAM=libtool +PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=2.4 +VERSION="2.2.6b Debian-2.2.6b-2ubuntu3" TIMESTAMP="" -package_revision=1.3293 +package_revision=1.3017 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -97,15 +91,10 @@ fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - # NLS nuisances: We save the old values to restore during execute mode. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES @@ -118,24 +107,15 @@ do lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL $lt_unset CDPATH -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" : ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${ECHO="echo"} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} @@ -164,27 +144,6 @@ IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} # func_dirname may be replaced by extended shell implementation - - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$basename"` -} # func_basename may be replaced by extended shell implementation - - # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: @@ -199,183 +158,33 @@ func_basename () # those functions but instead duplicate the functionality here. func_dirname_and_basename () { - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` -} # func_dirname_and_basename may be replaced by extended shell implementation - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname may be replaced by extended shell implementation - - -# These SED scripts presuppose an absolute path with a trailing slash. -pathcar='s,^/\([^/]*\).*$,\1,' -pathcdr='s,^/[^/]*,,' -removedotparts=':dotsl - s@/\./@/@g - t dotsl - s,/\.$,/,' -collapseslashes='s@/\{1,\}@/@g' -finalslash='s,/*$,/,' - -# func_normal_abspath PATH -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -# value returned in "$func_normal_abspath_result" -func_normal_abspath () -{ - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` - while :; do - # Processed it all yet? - if test "$func_normal_abspath_tpath" = / ; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result" ; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } -# func_relative_path SRCDIR DSTDIR -# generates a relative path from SRCDIR to DSTDIR, with a trailing -# slash if non-empty, suitable for immediately appending a filename -# without needing to append a separator. -# value returned in "$func_relative_path_result" -func_relative_path () -{ - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=${func_dirname_result} - if test "x$func_relative_path_tlibdir" = x ; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test "x$func_stripname_result" != x ; then - func_relative_path_result=${func_relative_path_result}/${func_stripname_result} - fi +# Generated shell functions inserted here. - # Normalisation. If bindir is libdir, return empty string, - # else relative path ending with a slash; either way, target - # file name can be directly appended. - if test ! -z "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result/" - func_relative_path_result=$func_stripname_result - fi -} +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" # The name of this program: +# In the unlikely event $progname began with a '-', it would play havoc with +# func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result +case $progname in + -*) progname=./$progname ;; +esac # Make sure we have an absolute path for reexecution: case $progpath in @@ -406,15 +215,6 @@ sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' - -# Sed substitution that converts a w32 file name or path -# which contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. @@ -443,7 +243,7 @@ opt_warning=: # name if it has been set yet. func_echo () { - $ECHO "$progname: ${opt_mode+$opt_mode: }$*" + $ECHO "$progname${mode+: }$mode: $*" } # func_verbose arg... @@ -458,25 +258,18 @@ func_verbose () : } -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - # func_error arg... # Echo program name prefixed message to standard error. func_error () { - $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 + $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { - $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 # bash bug again: : @@ -533,9 +326,9 @@ func_mkdir_p () case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do @@ -585,7 +378,7 @@ func_mktempdir () func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi - $ECHO "$my_tmpdir" + $ECHO "X$my_tmpdir" | $Xsed } @@ -599,7 +392,7 @@ func_quote_for_eval () { case $1 in *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac @@ -626,7 +419,7 @@ func_quote_for_expand () { case $1 in *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ + my_arg=`$ECHO "X$1" | $Xsed \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; @@ -695,39 +488,15 @@ func_show_eval_locale () fi } -# func_tr_sh -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac -} + + # func_version # Echo version message to standard output and exit. func_version () { - $opt_debug - - $SED -n '/(C)/!b go - :more - /\./!{ - N - s/\n# / / - b more - } - :go - /^# '$PROGRAM' (GNU /,/# warranty; / { + $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ @@ -740,28 +509,22 @@ func_version () # Echo short help message to standard output and exit. func_usage () { - $opt_debug - - $SED -n '/^# Usage:/,/^# *.*--help/ { + $SED -n '/^# Usage:/,/# -h/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" - echo + $ECHO $ECHO "run \`$progname --help | more' for full usage" exit $? } -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. +# func_help +# Echo long help message to standard output and exit. func_help () { - $opt_debug - $SED -n '/^# Usage:/,/# Report bugs to/ { - :print s/^# // s/^# *$// s*\$progname*'$progname'* @@ -774,15 +537,8 @@ func_help () s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p - d - } - /^# .* home page:/b print - /^# General help using/b print - ' < "$progpath" - ret=$? - if test -z "$1"; then - exit $ret - fi + }' < "$progpath" + exit $? } # func_missing_arg argname @@ -790,106 +546,63 @@ func_help () # exit_cmd. func_missing_arg () { - $opt_debug - - func_error "missing argument for $1." + func_error "missing argument for $1" exit_cmd=exit } +exit_cmd=: -# func_split_short_opt shortopt -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -func_split_short_opt () -{ - my_sed_short_opt='1s/^\(..\).*$/\1/;q' - my_sed_short_rest='1s/^..\(.*\)$/\1/;q' - - func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` - func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` -} # func_split_short_opt may be replaced by extended shell implementation - - -# func_split_long_opt longopt -# Set func_split_long_opt_name and func_split_long_opt_arg shell -# variables after splitting LONGOPT at the `=' sign. -func_split_long_opt () -{ - my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' - my_sed_long_arg='1s/^--[^=]*=//' - - func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` - func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` -} # func_split_long_opt may be replaced by extended shell implementation -exit_cmd=: +# Check that we have a working $ECHO. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell, and then maybe $ECHO will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null || echo $max_cmd_len` -} # func_len may be replaced by extended shell implementation - - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} # func_lo2o may be replaced by extended shell implementation - - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` -} # func_xform may be replaced by extended shell implementation - - # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. @@ -923,16 +636,16 @@ func_config () # Display the features supported by this script. func_features () { - echo "host: $host" + $ECHO "host: $host" if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" + $ECHO "enable shared libraries" else - echo "disable shared libraries" + $ECHO "disable shared libraries" fi if test "$build_old_libs" = yes; then - echo "enable static libraries" + $ECHO "enable static libraries" else - echo "disable static libraries" + $ECHO "disable static libraries" fi exit $? @@ -979,204 +692,117 @@ func_enable_tag () esac } -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () +# Parse options once, thoroughly. This comes as soon as possible in +# the script to make things like `libtool --version' happen quickly. { - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF - fi - - exit $EXIT_MISMATCH - fi -} - - -# Shorthand for --mode=foo, only valid as the first argument -case $1 in -clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; -compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; -execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; -finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; -install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; -link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; -uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; -esac - - - -# Option defaults: -opt_debug=: -opt_dry_run=false -opt_config=false -opt_preserve_dup_deps=false -opt_features=false -opt_finish=false -opt_help=false -opt_help_all=false -opt_silent=: -opt_verbose=: -opt_silent=false -opt_verbose=false + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + esac -# Parse options once, thoroughly. This comes as soon as possible in the -# script to make things like `--version' happen as quickly as we can. -{ - # this just eases exit handling - while test $# -gt 0; do + # Parse non-mode specific arguments: + while test "$#" -gt 0; do opt="$1" shift + case $opt in - --debug|-x) opt_debug='set -x' + --config) func_config ;; + + --debug) preserve_args="$preserve_args $opt" func_echo "enabling shell trace mode" + opt_debug='set -x' $opt_debug ;; - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - --config) - opt_config=: -func_config - ;; - --dlopen|-dlopen) - optarg="$1" - opt_dlopen="${opt_dlopen+$opt_dlopen -}$optarg" + + -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break + execute_dlfiles="$execute_dlfiles $1" shift ;; - --preserve-dup-deps) - opt_preserve_dup_deps=: - ;; - --features) - opt_features=: -func_features - ;; - --finish) - opt_finish=: -set dummy --mode finish ${1+"$@"}; shift - ;; - --help) - opt_help=: - ;; - --help-all) - opt_help_all=: -opt_help=': help-all' - ;; - --mode) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_mode="$optarg" -case $optarg in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; -esac + + --dry-run | -n) opt_dry_run=: ;; + --features) func_features ;; + --finish) mode="finish" ;; + + --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break + case $1 in + # Valid mode arguments: + clean) ;; + compile) ;; + execute) ;; + finish) ;; + install) ;; + link) ;; + relink) ;; + uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; + esac + + mode="$1" shift ;; - --no-silent|--no-quiet) - opt_silent=false -func_append preserve_args " $opt" - ;; - --no-verbose) - opt_verbose=false -func_append preserve_args " $opt" - ;; - --silent|--quiet) + + --preserve-dup-deps) + opt_duplicate_deps=: ;; + + --quiet|--silent) preserve_args="$preserve_args $opt" opt_silent=: -func_append preserve_args " $opt" - opt_verbose=false ;; - --verbose|-v) - opt_verbose=: -func_append preserve_args " $opt" -opt_silent=false + + --verbose| -v) preserve_args="$preserve_args $opt" + opt_silent=false ;; - --tag) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_tag="$optarg" -func_append preserve_args " $opt $optarg" -func_enable_tag "$optarg" + + --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break + preserve_args="$preserve_args $opt $1" + func_enable_tag "$1" # tagname is set here shift ;; - -\?|-h) func_usage ;; - --help) func_help ;; - --version) func_version ;; - # Separate optargs to long options: - --*=*) - func_split_long_opt "$opt" - set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + -dlopen=*|--mode=*|--tag=*) + func_opt_split "$opt" + set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} shift ;; - # Separate non-argument short options: - -\?*|-h*|-n*|-v*) - func_split_short_opt "$opt" - set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; + -\?|-h) func_usage ;; + --help) opt_help=: ;; + --version) func_version ;; - --) break ;; - -*) func_fatal_help "unrecognized option \`$opt'" ;; - *) set dummy "$opt" ${1+"$@"}; shift; break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + + *) nonopt="$opt" + break + ;; esac done - # Validate options: - - # save first non-option argument - if test "$#" -gt 0; then - nonopt="$opt" - shift - fi - - # preserve --debug - test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) @@ -1184,44 +810,82 @@ func_enable_tag "$optarg" opt_duplicate_compiler_generated_deps=: ;; *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + opt_duplicate_compiler_generated_deps=$opt_duplicate_deps ;; esac - $opt_help || { - # Sanity checks first: - func_check_version_match + # Having warned about all mis-specified options, bail out if + # anything was wrong. + $exit_cmd $EXIT_FAILURE +} - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF fi - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" + exit $EXIT_MISMATCH + fi +} - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test "$opt_mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$opt_mode' for more information." - } +## ----------- ## +## Main. ## +## ----------- ## +$opt_help || { + # Sanity checks first: + func_check_version_match - # Bail if the options were screwed - $exit_cmd $EXIT_FAILURE -} + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + test -z "$mode" && func_fatal_error "error: you must specify a MODE." + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$mode' for more information." +} -## ----------- ## -## Main. ## -## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. @@ -1286,9 +950,12 @@ func_ltwrapper_executable_p () # temporary ltwrapper_script. func_ltwrapper_scriptname () { - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + func_ltwrapper_scriptname_result="" + if func_ltwrapper_executable_p "$1"; then + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + fi } # func_ltwrapper_p file @@ -1334,37 +1001,6 @@ func_source () } -# func_resolve_sysroot PATH -# Replace a leading = in PATH with a sysroot. Store the result into -# func_resolve_sysroot_result -func_resolve_sysroot () -{ - func_resolve_sysroot_result=$1 - case $func_resolve_sysroot_result in - =*) - func_stripname '=' '' "$func_resolve_sysroot_result" - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result - ;; - esac -} - -# func_replace_sysroot PATH -# If PATH begins with the sysroot, replace it with = and -# store the result into func_replace_sysroot_result. -func_replace_sysroot () -{ - case "$lt_sysroot:$1" in - ?*:"$lt_sysroot"*) - func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result="=$func_stripname_result" - ;; - *) - # Including no sysroot. - func_replace_sysroot_result=$1 - ;; - esac -} - # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. @@ -1377,15 +1013,13 @@ func_infer_tag () if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do - func_append_quoted CC_quoted "$arg" + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) @@ -1396,13 +1030,11 @@ func_infer_tag () CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. - func_append_quoted CC_quoted "$arg" + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. @@ -1465,486 +1097,6 @@ EOF } } - -################################################## -# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # -################################################## - -# func_convert_core_file_wine_to_w32 ARG -# Helper function used by file name conversion functions when $build is *nix, -# and $host is mingw, cygwin, or some other w32 environment. Relies on a -# correctly configured wine environment available, with the winepath program -# in $build's $PATH. -# -# ARG is the $build file name to be converted to w32 format. -# Result is available in $func_convert_core_file_wine_to_w32_result, and will -# be empty on error (or when ARG is empty) -func_convert_core_file_wine_to_w32 () -{ - $opt_debug - func_convert_core_file_wine_to_w32_result="$1" - if test -n "$1"; then - # Unfortunately, winepath does not exit with a non-zero error code, so we - # are forced to check the contents of stdout. On the other hand, if the - # command is not found, the shell will set an exit code of 127 and print - # *an error message* to stdout. So we must check for both error code of - # zero AND non-empty stdout, which explains the odd construction: - func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` - if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then - func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$lt_sed_naive_backslashify"` - else - func_convert_core_file_wine_to_w32_result= - fi - fi -} -# end: func_convert_core_file_wine_to_w32 - - -# func_convert_core_path_wine_to_w32 ARG -# Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. -# -# ARG is path to be converted from $build format to win32. -# Result is available in $func_convert_core_path_wine_to_w32_result. -# Unconvertible file (directory) names in ARG are skipped; if no directory names -# are convertible, then the result may be empty. -func_convert_core_path_wine_to_w32 () -{ - $opt_debug - # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result="" - if test -n "$1"; then - oldIFS=$IFS - IFS=: - for func_convert_core_path_wine_to_w32_f in $1; do - IFS=$oldIFS - func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result" ; then - if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" - else - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" - fi - fi - done - IFS=$oldIFS - fi -} -# end: func_convert_core_path_wine_to_w32 - - -# func_cygpath ARGS... -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or -# (2), returns the Cygwin file name or path in func_cygpath_result (input -# file name or path is assumed to be in w32 format, as previously converted -# from $build's *nix or MSYS format). In case (3), returns the w32 file name -# or path in func_cygpath_result (input file name or path is assumed to be in -# Cygwin format). Returns an empty string on error. -# -# ARGS are passed to cygpath, with the last one being the file name or path to -# be converted. -# -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH -# environment variable; do not put it in $PATH. -func_cygpath () -{ - $opt_debug - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` - if test "$?" -ne 0; then - # on failure, ensure result is empty - func_cygpath_result= - fi - else - func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" - fi -} -#end: func_cygpath - - -# func_convert_core_msys_to_w32 ARG -# Convert file name or path ARG from MSYS format to w32 format. Return -# result in func_convert_core_msys_to_w32_result. -func_convert_core_msys_to_w32 () -{ - $opt_debug - # awkward: cmd appends spaces to result - func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` -} -#end: func_convert_core_msys_to_w32 - - -# func_convert_file_check ARG1 ARG2 -# Verify that ARG1 (a file name in $build format) was converted to $host -# format in ARG2. Otherwise, emit an error message, but continue (resetting -# func_to_host_file_result to ARG1). -func_convert_file_check () -{ - $opt_debug - if test -z "$2" && test -n "$1" ; then - func_error "Could not determine host file name corresponding to" - func_error " \`$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_file_result="$1" - fi -} -# end func_convert_file_check - - -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH -# Verify that FROM_PATH (a path in $build format) was converted to $host -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting -# func_to_host_file_result to a simplistic fallback value (see below). -func_convert_path_check () -{ - $opt_debug - if test -z "$4" && test -n "$3"; then - func_error "Could not determine the host path corresponding to" - func_error " \`$3'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This is a deliberately simplistic "conversion" and - # should not be "improved". See libtool.info. - if test "x$1" != "x$2"; then - lt_replace_pathsep_chars="s|$1|$2|g" - func_to_host_path_result=`echo "$3" | - $SED -e "$lt_replace_pathsep_chars"` - else - func_to_host_path_result="$3" - fi - fi -} -# end func_convert_path_check - - -# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG -# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT -# and appending REPL if ORIG matches BACKPAT. -func_convert_path_front_back_pathsep () -{ - $opt_debug - case $4 in - $1 ) func_to_host_path_result="$3$func_to_host_path_result" - ;; - esac - case $4 in - $2 ) func_append func_to_host_path_result "$3" - ;; - esac -} -# end func_convert_path_front_back_pathsep - - -################################################## -# $build to $host FILE NAME CONVERSION FUNCTIONS # -################################################## -# invoked via `$to_host_file_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# Result will be available in $func_to_host_file_result. - - -# func_to_host_file ARG -# Converts the file name ARG from $build format to $host format. Return result -# in func_to_host_file_result. -func_to_host_file () -{ - $opt_debug - $to_host_file_cmd "$1" -} -# end func_to_host_file - - -# func_to_tool_file ARG LAZY -# converts the file name ARG from $build format to toolchain format. Return -# result in func_to_tool_file_result. If the conversion in use is listed -# in (the comma separated) LAZY, no conversion takes place. -func_to_tool_file () -{ - $opt_debug - case ,$2, in - *,"$to_tool_file_cmd",*) - func_to_tool_file_result=$1 - ;; - *) - $to_tool_file_cmd "$1" - func_to_tool_file_result=$func_to_host_file_result - ;; - esac -} -# end func_to_tool_file - - -# func_convert_file_noop ARG -# Copy ARG to func_to_host_file_result. -func_convert_file_noop () -{ - func_to_host_file_result="$1" -} -# end func_convert_file_noop - - -# func_convert_file_msys_to_w32 ARG -# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_file_result. -func_convert_file_msys_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_to_host_file_result="$func_convert_core_msys_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_w32 - - -# func_convert_file_cygwin_to_w32 ARG -# Convert file name ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_file_cygwin_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # because $build is cygwin, we call "the" cygpath in $PATH; no need to use - # LT_CYGPATH in this case. - func_to_host_file_result=`cygpath -m "$1"` - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_cygwin_to_w32 - - -# func_convert_file_nix_to_w32 ARG -# Convert file name ARG from *nix to w32 format. Requires a wine environment -# and a working winepath. Returns result in func_to_host_file_result. -func_convert_file_nix_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_w32 - - -# func_convert_file_msys_to_cygwin ARG -# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_file_msys_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_cygwin - - -# func_convert_file_nix_to_cygwin ARG -# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed -# in a wine environment, working winepath, and LT_CYGPATH set. Returns result -# in func_to_host_file_result. -func_convert_file_nix_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. - func_convert_core_file_wine_to_w32 "$1" - func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_cygwin - - -############################################# -# $build to $host PATH CONVERSION FUNCTIONS # -############################################# -# invoked via `$to_host_path_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# The result will be available in $func_to_host_path_result. -# -# Path separators are also converted from $build format to $host format. If -# ARG begins or ends with a path separator character, it is preserved (but -# converted to $host format) on output. -# -# All path conversion functions are named using the following convention: -# file name conversion function : func_convert_file_X_to_Y () -# path conversion function : func_convert_path_X_to_Y () -# where, for any given $build/$host combination the 'X_to_Y' value is the -# same. If conversion functions are added for new $build/$host combinations, -# the two new functions must follow this pattern, or func_init_to_host_path_cmd -# will break. - - -# func_init_to_host_path_cmd -# Ensures that function "pointer" variable $to_host_path_cmd is set to the -# appropriate value, based on the value of $to_host_file_cmd. -to_host_path_cmd= -func_init_to_host_path_cmd () -{ - $opt_debug - if test -z "$to_host_path_cmd"; then - func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd="func_convert_path_${func_stripname_result}" - fi -} - - -# func_to_host_path ARG -# Converts the path ARG from $build format to $host format. Return result -# in func_to_host_path_result. -func_to_host_path () -{ - $opt_debug - func_init_to_host_path_cmd - $to_host_path_cmd "$1" -} -# end func_to_host_path - - -# func_convert_path_noop ARG -# Copy ARG to func_to_host_path_result. -func_convert_path_noop () -{ - func_to_host_path_result="$1" -} -# end func_convert_path_noop - - -# func_convert_path_msys_to_w32 ARG -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_path_result. -func_convert_path_msys_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from ARG. MSYS - # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; - # and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_msys_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_msys_to_w32 - - -# func_convert_path_cygwin_to_w32 ARG -# Convert path ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_path_cygwin_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_cygwin_to_w32 - - -# func_convert_path_nix_to_w32 ARG -# Convert path ARG from *nix to w32 format. Requires a wine environment and -# a working winepath. Returns result in func_to_host_file_result. -func_convert_path_nix_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_nix_to_w32 - - -# func_convert_path_msys_to_cygwin ARG -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_path_msys_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_msys_to_cygwin - - -# func_convert_path_nix_to_cygwin ARG -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in -# func_to_host_file_result. -func_convert_path_nix_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_nix_to_cygwin - - # func_mode_compile arg... func_mode_compile () { @@ -1985,12 +1137,12 @@ func_mode_compile () ;; -pie | -fpie | -fPIE) - func_append pie_flag " $arg" + pie_flag="$pie_flag $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) - func_append later " $arg" + later="$later $arg" continue ;; @@ -2011,14 +1163,15 @@ func_mode_compile () save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" - func_append_quoted lastarg "$arg" + func_quote_for_eval "$arg" + lastarg="$lastarg $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. - func_append base_compile " $lastarg" + base_compile="$base_compile $lastarg" continue ;; @@ -2034,7 +1187,8 @@ func_mode_compile () esac # case $arg_mode # Aesthetically quote the previous argument. - func_append_quoted base_compile "$lastarg" + func_quote_for_eval "$lastarg" + base_compile="$base_compile $func_quote_for_eval_result" done # for arg case $arg_mode in @@ -2059,7 +1213,7 @@ func_mode_compile () *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup) + *.[fF][09]? | *.for | *.java | *.obj | *.sx) func_xform "$libobj" libobj=$func_xform_result ;; @@ -2134,7 +1288,7 @@ func_mode_compile () # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= @@ -2165,16 +1319,17 @@ compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi - func_append removelist " $output_obj" + removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist - func_append removelist " $lockfile" + removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 - srcfile=$func_to_tool_file_result + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result @@ -2194,7 +1349,7 @@ compiler." if test -z "$output_obj"; then # Place PIC objects in $objdir - func_append command " -o $lobj" + command="$command -o $lobj" fi func_show_eval_locale "$command" \ @@ -2241,11 +1396,11 @@ compiler." command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then - func_append command " -o $obj" + command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. - func_append command "$suppress_output" + command="$command$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' @@ -2290,13 +1445,13 @@ compiler." } $opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +test "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. - case $opt_mode in + case $mode in "") # Generic help is extracted from the usage comments # at the start of this file. @@ -2327,11 +1482,10 @@ This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to build PIC objects only - -prefer-non-pic try to build non-PIC objects only + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. @@ -2384,7 +1538,7 @@ either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." @@ -2404,8 +1558,6 @@ The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible - -bindir BINDIR specify path to binaries directory (for systems where - libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) @@ -2434,11 +1586,6 @@ The following components of LINK-COMMAND are treated specially: -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wl,FLAG - -Xlinker FLAG pass linker-specific FLAG directly to the linker - -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. @@ -2472,44 +1619,18 @@ Otherwise, only FILE itself is deleted using RM." ;; *) - func_fatal_help "invalid operation mode \`$opt_mode'" + func_fatal_help "invalid operation mode \`$mode'" ;; esac - echo + $ECHO $ECHO "Try \`$progname --help' for more information about other modes." + + exit $? } -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test "$opt_help" = :; then - func_mode_help - else - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - sed '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi + # Now that we've collected a possible --mode arg, show help if necessary + $opt_help && func_mode_help # func_mode_execute arg... @@ -2522,16 +1643,13 @@ func_mode_execute () func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. - for file in $opt_dlopen; do + for file in $execute_dlfiles; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" @@ -2553,7 +1671,7 @@ func_mode_execute () dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then - func_append dir "/$objdir" + dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" @@ -2594,7 +1712,7 @@ func_mode_execute () for file do case $file in - -* | *.la | *.lo ) ;; + -*) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then @@ -2610,7 +1728,8 @@ func_mode_execute () ;; esac # Quote arguments (to preserve shell metacharacters). - func_append_quoted args "$file" + func_quote_for_eval "$file" + args="$args $func_quote_for_eval_result" done if test "X$opt_dry_run" = Xfalse; then @@ -2635,66 +1754,29 @@ func_mode_execute () # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" + $ECHO "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} +test "$mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug - libs= - libdirs= + libdirs="$nonopt" admincmds= - for opt in "$nonopt" ${1+"$@"} - do - if test -d "$opt"; then - func_append libdirs " $opt" - - elif test -f "$opt"; then - if func_lalib_unsafe_p "$opt"; then - func_append libs " $opt" - else - func_warning "\`$opt' is not a valid libtool archive" - fi - - else - func_fatal_error "invalid argument \`$opt'" - fi - done - - if test -n "$libs"; then - if test -n "$lt_sysroot"; then - sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` - sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" - else - sysroot_cmd= - fi - - # Remove sysroot references - if $opt_dry_run; then - for lib in $libs; do - echo "removing references to $lt_sysroot and \`=' prefixes from $lib" - done - else - tmpdir=`func_mktempdir` - for lib in $libs; do - sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ - > $tmpdir/tmp-la - mv -f $tmpdir/tmp-la $lib - done - ${RM}r "$tmpdir" - fi - fi - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. @@ -2704,64 +1786,62 @@ func_mode_finish () if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || func_append admincmds " + $opt_dry_run || eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo + $opt_silent && exit $EXIT_SUCCESS - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" + $ECHO "X----------------------------------------------------------------------" | $Xsed + $ECHO "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + $ECHO + $ECHO "If you ever happen to want to link against installed libraries" + $ECHO "in a given directory, LIBDIR, you must either use libtool, and" + $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" + $ECHO "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" + $ECHO " during execution" fi + if test -n "$runpath_var"; then + $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" + $ECHO " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + $ECHO + + $ECHO "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" + $ECHO "pages." + ;; + *) + $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + $ECHO "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS } -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} +test "$mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... @@ -2772,7 +1852,7 @@ func_mode_install () # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac; then + $ECHO "X$nonopt" | $GREP shtool >/dev/null; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " @@ -2786,12 +1866,7 @@ func_mode_install () # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac + install_prog="$install_prog$func_quote_for_eval_result" # We need to accept at least all the BSD install flags. dest= @@ -2801,12 +1876,10 @@ func_mode_install () install_type= isdir=no stripme= - no_mode=: for arg do - arg2= if test -n "$dest"; then - func_append files " $dest" + files="$files $dest" dest=$arg continue fi @@ -2814,9 +1887,10 @@ func_mode_install () case $arg in -d) isdir=yes ;; -f) - if $install_cp; then :; else - prev=$arg - fi + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac ;; -g | -m | -o) prev=$arg @@ -2830,10 +1904,6 @@ func_mode_install () *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then - arg2=$install_override_mode - no_mode=false - fi prev= else dest=$arg @@ -2844,11 +1914,7 @@ func_mode_install () # Aesthetically quote the argument. func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" - if test -n "$arg2"; then - func_quote_for_eval "$arg2" - fi - func_append install_shared_prog " $func_quote_for_eval_result" + install_prog="$install_prog $func_quote_for_eval_result" done test -z "$install_prog" && \ @@ -2857,13 +1923,6 @@ func_mode_install () test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" - if test -n "$install_override_mode" && $no_mode; then - if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" - fi - fi - if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" @@ -2918,13 +1977,10 @@ func_mode_install () case $file in *.$libext) # Do the static libraries later. - func_append staticlibs " $file" + staticlibs="$staticlibs $file" ;; *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" @@ -2938,23 +1994,23 @@ func_mode_install () if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; - *) func_append current_libdirs " $libdir" ;; + *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; - *) func_append future_libdirs " $libdir" ;; + *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" - func_append dir "$objdir" + dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that @@ -2967,9 +2023,9 @@ func_mode_install () if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" @@ -2987,7 +2043,7 @@ func_mode_install () test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. - func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in @@ -3027,7 +2083,7 @@ func_mode_install () func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. - test -n "$old_library" && func_append staticlibs " $dir/$old_library" + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) @@ -3127,7 +2183,7 @@ func_mode_install () if test -f "$lib"; then func_source "$lib" fi - libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no @@ -3146,7 +2202,7 @@ func_mode_install () file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" @@ -3165,7 +2221,7 @@ func_mode_install () } else # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi @@ -3224,7 +2280,7 @@ func_mode_install () fi } -test "$opt_mode" = install && func_mode_install ${1+"$@"} +test "$mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p @@ -3267,22 +2323,6 @@ func_generate_dlsyms () extern \"C\" { #endif -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" -#endif - -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - /* External symbol declarations for the compiler. */\ " @@ -3292,11 +2332,10 @@ extern \"C\" { $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for progfile in $progfiles; do - func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" - $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + func_verbose "extracting global C symbols from \`$progfile'" + $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then @@ -3332,7 +2371,7 @@ extern \"C\" { eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; @@ -3345,52 +2384,10 @@ extern \"C\" { func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" - case $host in - *cygwin* | *mingw* | *cegcc* ) - # if an import library, we need to obtain dlname - if func_win32_import_lib_p "$dlprefile"; then - func_tr_sh "$dlprefile" - eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename="" - if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then - # Use subshell, to avoid clobbering current variable values - dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname" ; then - func_basename "$dlprefile_dlname" - dlprefile_dlbasename="$func_basename_result" - else - # no lafile. user explicitly requested -dlpreopen . - $sharedlib_from_linklib_cmd "$dlprefile" - dlprefile_dlbasename=$sharedlib_from_linklib_result - fi - fi - $opt_dry_run || { - if test -n "$dlprefile_dlbasename" ; then - eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' - else - func_warning "Could not compute DLL name from $name" - eval '$ECHO ": $name " >> "$nlist"' - fi - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" - } - else # not an import lib - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - fi - ;; - *) - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - ;; - esac + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } done $opt_dry_run || { @@ -3418,19 +2415,36 @@ extern \"C\" { if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else - echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" fi - echo >> "$output_objdir/$my_dlsyms" "\ + $ECHO >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; -extern LT_DLSYM_CONST lt_dlsymlist +" + case $host in + *cygwin* | *mingw* | *cegcc* ) + $ECHO >> "$output_objdir/$my_dlsyms" "\ +/* DATA imports from DLLs on WIN32 con't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs. */" + lt_dlsym_const= ;; + *osf5*) + echo >> "$output_objdir/$my_dlsyms" "\ +/* This system does not cope well with relocations in const data */" + lt_dlsym_const= ;; + *) + lt_dlsym_const=const ;; + esac + + $ECHO >> "$output_objdir/$my_dlsyms" "\ +extern $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; -LT_DLSYM_CONST lt_dlsymlist +$lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," @@ -3443,7 +2457,7 @@ lt_${my_prefix}_LTX_preloaded_symbols[] = eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac - echo >> "$output_objdir/$my_dlsyms" "\ + $ECHO >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; @@ -3486,7 +2500,7 @@ static const void *lt_preloaded_setup() { for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; - *) func_append symtab_cflags " $arg" ;; + *) symtab_cflags="$symtab_cflags $arg" ;; esac done @@ -3501,16 +2515,16 @@ static const void *lt_preloaded_setup() { case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` fi ;; *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` ;; esac ;; @@ -3524,8 +2538,8 @@ static const void *lt_preloaded_setup() { # really was required. # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi } @@ -3535,7 +2549,6 @@ static const void *lt_preloaded_setup() { # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug @@ -3546,11 +2559,9 @@ func_win32_libid () win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | $SED -n -e ' 1,100{ / I /{ @@ -3579,131 +2590,6 @@ func_win32_libid () $ECHO "$win32_libid_type" } -# func_cygming_dll_for_implib ARG -# -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib () -{ - $opt_debug - sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` -} - -# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs -# -# The is the core of a fallback implementation of a -# platform-specific function to extract the name of the -# DLL associated with the specified import library LIBNAME. -# -# SECTION_NAME is either .idata$6 or .idata$7, depending -# on the platform and compiler that created the implib. -# -# Echos the name of the DLL associated with the -# specified import library. -func_cygming_dll_for_implib_fallback_core () -{ - $opt_debug - match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` - $OBJDUMP -s --section "$1" "$2" 2>/dev/null | - $SED '/^Contents of section '"$match_literal"':/{ - # Place marker at beginning of archive member dllname section - s/.*/====MARK====/ - p - d - } - # These lines can sometimes be longer than 43 characters, but - # are always uninteresting - /:[ ]*file format pe[i]\{,1\}-/d - /^In archive [^:]*:/d - # Ensure marker is printed - /^====MARK====/p - # Remove all lines with less than 43 characters - /^.\{43\}/!d - # From remaining lines, remove first 43 characters - s/^.\{43\}//' | - $SED -n ' - # Join marker and all lines until next marker into a single line - /^====MARK====/ b para - H - $ b para - b - :para - x - s/\n//g - # Remove the marker - s/^====MARK====// - # Remove trailing dots and whitespace - s/[\. \t]*$// - # Print - /./p' | - # we now have a list, one entry per line, of the stringified - # contents of the appropriate section of all members of the - # archive which possess that section. Heuristic: eliminate - # all those which have a first or second character that is - # a '.' (that is, objdump's representation of an unprintable - # character.) This should work for all archives with less than - # 0x302f exports -- but will fail for DLLs whose name actually - # begins with a literal '.' or a single character followed by - # a '.'. - # - # Of those that remain, print the first one. - $SED -e '/^\./d;/^.\./d;q' -} - -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - -# func_cygming_dll_for_implib_fallback ARG -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# -# This fallback implementation is for use when $DLLTOOL -# does not support the --identify-strict option. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib_fallback () -{ - $opt_debug - if func_cygming_gnu_implib_p "$1" ; then - # binutils import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1" ; then - # ms-generated import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` - else - # unknown - sharedlib_from_linklib_result="" - fi -} # func_extract_an_archive dir oldlib @@ -3712,18 +2598,7 @@ func_extract_an_archive () $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" - if test "$lock_old_archive_extraction" = yes; then - lockfile=$f_ex_an_ar_oldlib.lock - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - fi - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ - 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then - $opt_dry_run || rm -f "$lockfile" - fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else @@ -3794,7 +2669,7 @@ func_extract_archives () darwin_file= darwin_files= for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ @@ -3809,30 +2684,25 @@ func_extract_archives () func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. + +# func_emit_wrapper_part1 [arg=no] # -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () +# Emit the first part of a libtool wrapper script on stdout. +# For more information, see the description associated with +# func_emit_wrapper(), below. +func_emit_wrapper_part1 () { - func_emit_wrapper_arg1=${1-no} + func_emit_wrapper_part1_arg1=no + if test -n "$1" ; then + func_emit_wrapper_part1_arg1=$1 + fi $ECHO "\ #! $SHELL @@ -3848,6 +2718,7 @@ func_emit_wrapper () # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible @@ -3878,132 +2749,31 @@ if test \"\$libtool_install_magic\" = \"$magic\"; then else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=\"$qECHO\" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ which is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} + ECHO=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$ECHO works! + : + else + # Restart under the correct shell, and then maybe \$ECHO will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ " - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} + $ECHO "\ # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then @@ -4013,13 +2783,30 @@ func_exec_program () esac fi - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done +" +} +# end: func_emit_wrapper_part1 + +# func_emit_wrapper_part2 [arg=no] +# +# Emit the second part of a libtool wrapper script on stdout. +# For more information, see the description associated with +# func_emit_wrapper(), below. +func_emit_wrapper_part2 () +{ + func_emit_wrapper_part2_arg1=no + if test -n "$1" ; then + func_emit_wrapper_part2_arg1=$1 + fi + + $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then @@ -4027,7 +2814,7 @@ func_exec_program () fi # remove .libs from thisdir case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi @@ -4082,18 +2869,6 @@ func_exec_program () if test -f \"\$progdir/\$program\"; then" - # fixup the dll searchpath if we need to. - # - # Fix the DLL searchpath if we need to. Do this before prepending - # to shlibpath, because on Windows, both are PATH and uninstalled - # libraries must come first. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ @@ -4102,29 +2877,254 @@ func_exec_program () # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. - func_exec_program \${1+\"\$@\"} +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } +# end: func_emit_wrapper_part2 + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=no + if test -n "$1" ; then + func_emit_wrapper_arg1=$1 + fi + + # split this up so that func_emit_cwrapperexe_src + # can call each part independently. + func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" + func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" +} +# func_to_host_path arg +# +# Convert paths to host format when used with build tools. +# Intended for use with "native" mingw (where libtool itself +# is running under the msys shell), or in the following cross- +# build environments: +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# where wine is equipped with the `winepath' executable. +# In the native mingw case, the (msys) shell automatically +# converts paths for any non-msys applications it launches, +# but that facility isn't available from inside the cwrapper. +# Similar accommodations are necessary for $host mingw and +# $build cygwin. Calling this function does no harm for other +# $host/$build combinations not listed above. +# +# ARG is the path (on $build) that should be converted to +# the proper representation for $host. The result is stored +# in $func_to_host_path_result. +func_to_host_path () +{ + func_to_host_path_result="$1" + if test -n "$1" ; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + case $build in + *mingw* ) # actually, msys + # awkward: cmd appends spaces to result + lt_sed_strip_trailing_spaces="s/[ ]*\$//" + func_to_host_path_tmp1=`( cmd //c echo "$1" |\ + $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_path_tmp1=`cygpath -w "$1"` + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # Unfortunately, winepath does not exit with a non-zero + # error code, so we are forced to check the contents of + # stdout. On the other hand, if the command is not + # found, the shell will set an exit code of 127 and print + # *an error message* to stdout. So we must check for both + # error code of zero AND non-empty stdout, which explains + # the odd construction: + func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` + if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ + $SED -e "$lt_sed_naive_backslashify"` + else + # Allow warning below. + func_to_host_path_result="" + fi + ;; + esac + if test -z "$func_to_host_path_result" ; then + func_error "Could not determine host path corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_path_result="$1" + fi + ;; + esac + fi +} +# end: func_to_host_path + +# func_to_host_pathlist arg +# +# Convert pathlists to host format when used with build tools. +# See func_to_host_path(), above. This function supports the +# following $build/$host combinations (but does no harm for +# combinations not listed here): +# $build $host +# mingw (msys) mingw [e.g. native] +# cygwin mingw +# *nix + wine mingw +# +# Path separators are also converted from $build format to +# $host format. If ARG begins or ends with a path separator +# character, it is preserved (but converted to $host format) +# on output. +# +# ARG is a pathlist (on $build) that should be converted to +# the proper representation on $host. The result is stored +# in $func_to_host_pathlist_result. +func_to_host_pathlist () +{ + func_to_host_pathlist_result="$1" + if test -n "$1" ; then + case $host in + *mingw* ) + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_to_host_pathlist_tmp2="$1" + # Once set for this call, this variable should not be + # reassigned. It is used in tha fallback case. + func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e 's|^:*||' -e 's|:*$||'` + case $build in + *mingw* ) # Actually, msys. + # Awkward: cmd appends spaces to result. + lt_sed_strip_trailing_spaces="s/[ ]*\$//" + func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ + $SED -e "$lt_sed_naive_backslashify"` + ;; + * ) + # unfortunately, winepath doesn't convert pathlists + func_to_host_pathlist_result="" + func_to_host_pathlist_oldIFS=$IFS + IFS=: + for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do + IFS=$func_to_host_pathlist_oldIFS + if test -n "$func_to_host_pathlist_f" ; then + func_to_host_path "$func_to_host_pathlist_f" + if test -n "$func_to_host_path_result" ; then + if test -z "$func_to_host_pathlist_result" ; then + func_to_host_pathlist_result="$func_to_host_path_result" + else + func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" + fi + fi + fi + IFS=: + done + IFS=$func_to_host_pathlist_oldIFS + ;; + esac + if test -z "$func_to_host_pathlist_result" ; then + func_error "Could not determine the host path(s) corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This may break if $1 contains DOS-style drive + # specifications. The fix is not to complicate the expression + # below, but for the user to provide a working wine installation + # with winepath so that path translation in the cross-to-mingw + # case works properly. + lt_replace_pathsep_nix_to_dos="s|:|;|g" + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ + $SED -e "$lt_replace_pathsep_nix_to_dos"` + fi + # Now, add the leading and trailing path separators back + case "$1" in + :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" + ;; + esac + case "$1" in + *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" + ;; + esac + ;; + esac + fi +} +# end: func_to_host_pathlist + # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because @@ -4141,71 +3141,41 @@ func_emit_cwrapperexe_src () This wrapper executable should never be moved out of the build directory. If it is, it will not operate correctly. + + Currently, it simply execs the wrapper *script* "$SHELL $output", + but could eventually absorb all of the scripts functionality and + exec $objdir/$outputname directly. */ EOF cat <<"EOF" -#ifdef _MSC_VER -# define _CRT_SECURE_NO_DEPRECATE 1 -#endif #include #include #ifdef _MSC_VER # include # include # include +# define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -/* declarations of non-ANSI functions */ -#if defined(__MINGW32__) -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#elif defined(__CYGWIN__) -# ifdef __STRICT_ANSI__ +# define HAVE_SETENV +# ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); +# endif # endif -/* #elif defined (other platforms) ... */ -#endif - -/* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -# define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif -#elif defined(__MINGW32__) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined(__CYGWIN__) -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ #endif +#include +#include +#include +#include +#include +#include +#include +#include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX @@ -4222,7 +3192,14 @@ int setenv (const char *, const char *, int); # define S_IXGRP 0 #endif -/* path handling portability macros */ +#ifdef _MSC_VER +# define S_IXUSR _S_IEXEC +# define stat _stat +# ifndef _INTPTR_T_DEFINED +# define intptr_t int +# endif +#endif + #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' @@ -4253,6 +3230,10 @@ int setenv (const char *, const char *, int); # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ +#ifdef __CYGWIN__ +# define FOPEN_WB "wb" +#endif + #ifndef FOPEN_WB # define FOPEN_WB "w" #endif @@ -4265,13 +3246,22 @@ int setenv (const char *, const char *, int); if (stale) { free ((void *) stale); stale = 0; } \ } while (0) -#if defined(LT_DEBUGWRAPPER) -static int lt_debug = 1; +#undef LTWRAPPER_DEBUGPRINTF +#if defined DEBUGWRAPPER +# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args +static void +ltwrapper_debugprintf (const char *fmt, ...) +{ + va_list args; + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); +} #else -static int lt_debug = 0; +# define LTWRAPPER_DEBUGPRINTF(args) #endif -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ +const char *program_name = NULL; void *xmalloc (size_t num); char *xstrdup (const char *string); @@ -4281,27 +3271,41 @@ char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); +void lt_fatal (const char *message, ...); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_opt_process_env_set (const char *arg); +void lt_opt_process_env_prepend (const char *arg); +void lt_opt_process_env_append (const char *arg); +int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); + +static const char *script_text_part1 = +EOF + + func_emit_wrapper_part1 yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ "/' -e 's/$/\\n"/' + echo ";" + cat <"))); for (i = 0; i < newargc; i++) { - lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", - i, nonnull (newargz[i])); + LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); } EOF @@ -4517,14 +3560,11 @@ EOF mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ - newargz = prepare_spawn (newargz); rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ - lt_debugprintf (__FILE__, __LINE__, - "(main) failed to launch target \"%s\": %s\n", - lt_argv_zero, nonnull (strerror (errno))); + LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); return 127; } return rval; @@ -4546,7 +3586,7 @@ xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) - lt_fatal (__FILE__, __LINE__, "memory exhausted"); + lt_fatal ("Memory exhausted"); return p; } @@ -4580,8 +3620,8 @@ check_executable (const char *path) { struct stat st; - lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", - nonempty (path)); + LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; @@ -4598,8 +3638,8 @@ make_executable (const char *path) int rval = 0; struct stat st; - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); + LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; @@ -4625,8 +3665,8 @@ find_executable (const char *wrapper) int tmp_len; char *concat_name; - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); + LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", + wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; @@ -4679,8 +3719,7 @@ find_executable (const char *wrapper) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); + lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); @@ -4705,8 +3744,7 @@ find_executable (const char *wrapper) } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); + lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); @@ -4732,9 +3770,8 @@ chase_symlinks (const char *pathspec) int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); + LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", + tmp_pathspec)); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) @@ -4756,9 +3793,8 @@ chase_symlinks (const char *pathspec) } else { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); + char *errstr = strerror (errno); + lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); @@ -4771,8 +3807,7 @@ chase_symlinks (const char *pathspec) tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); + lt_fatal ("Could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif @@ -4798,25 +3833,11 @@ strendzap (char *str, const char *pat) return str; } -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, +lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); @@ -4825,32 +3846,20 @@ lt_error_core (int exit_status, const char *file, } void -lt_fatal (const char *file, int line, const char *message, ...) +lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - void lt_setenv (const char *name, const char *value) { - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); + LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", + (name ? name : ""), + (value ? value : ""))); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ @@ -4895,12 +3904,95 @@ lt_extend_str (const char *orig_value, const char *add, int to_end) return new_value; } +int +lt_split_name_value (const char *arg, char** name, char** value) +{ + const char *p; + int len; + if (!arg || !*arg) + return 1; + + p = strchr (arg, (int)'='); + + if (!p) + return 1; + + *value = xstrdup (++p); + + len = strlen (arg) - strlen (*value); + *name = XMALLOC (char, len); + strncpy (*name, arg, len-1); + (*name)[len - 1] = '\0'; + + return 0; +} + +void +lt_opt_process_env_set (const char *arg) +{ + char *name = NULL; + char *value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); + } + + lt_setenv (name, value); + XFREE (name); + XFREE (value); +} + +void +lt_opt_process_env_prepend (const char *arg) +{ + char *name = NULL; + char *value = NULL; + char *new_value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); + } + + new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + XFREE (name); + XFREE (value); +} + +void +lt_opt_process_env_append (const char *arg) +{ + char *name = NULL; + char *value = NULL; + char *new_value = NULL; + + if (lt_split_name_value (arg, &name, &value) != 0) + { + XFREE (name); + XFREE (value); + lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); + } + + new_value = lt_extend_str (getenv (name), value, 1); + lt_setenv (name, new_value); + XFREE (new_value); + XFREE (name); + XFREE (value); +} + void lt_update_exe_path (const char *name, const char *value) { - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); + LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : ""))); if (name && *name && value && *value) { @@ -4919,9 +4011,9 @@ lt_update_exe_path (const char *name, const char *value) void lt_update_lib_path (const char *name, const char *value) { - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); + LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + (name ? name : ""), + (value ? value : ""))); if (name && *name && value && *value) { @@ -4931,152 +4023,11 @@ lt_update_lib_path (const char *name, const char *value) } } -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; - - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; - - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); - - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; - - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; - - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - - return new_argv; -} -EOF - ;; - esac - - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' - cat <<"EOF" -} EOF } # end: func_emit_cwrapperexe_src -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $opt_debug - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac -} - # func_mode_link arg... func_mode_link () { @@ -5121,7 +4072,6 @@ func_mode_link () new_inherited_linker_flags= avoid_version=no - bindir= dlfiles= dlprefiles= dlself=no @@ -5214,11 +4164,6 @@ func_mode_link () esac case $prev in - bindir) - bindir="$arg" - prev= - continue - ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. @@ -5250,9 +4195,9 @@ func_mode_link () ;; *) if test "$prev" = dlfiles; then - func_append dlfiles " $arg" + dlfiles="$dlfiles $arg" else - func_append dlprefiles " $arg" + dlprefiles="$dlprefiles $arg" fi prev= continue @@ -5276,7 +4221,7 @@ func_mode_link () *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; - *) func_append deplibs " $qarg.ltframework" # this is fixed later + *) deplibs="$deplibs $qarg.ltframework" # this is fixed later ;; esac ;; @@ -5295,7 +4240,7 @@ func_mode_link () moreargs= for fil in `cat "$save_arg"` do -# func_append moreargs " $fil" +# moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. @@ -5324,7 +4269,7 @@ func_mode_link () if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" + dlfiles="$dlfiles $pic_object" prev= continue else @@ -5336,7 +4281,7 @@ func_mode_link () # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. - func_append dlprefiles " $pic_object" + dlprefiles="$dlprefiles $pic_object" prev= fi @@ -5406,12 +4351,12 @@ func_mode_link () if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; - *) func_append rpath " $arg" ;; + *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; - *) func_append xrpath " $arg" ;; + *) xrpath="$xrpath $arg" ;; esac fi prev= @@ -5423,28 +4368,28 @@ func_mode_link () continue ;; weak) - func_append weak_libs " $arg" + weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $qarg" + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) - func_append compiler_flags " $qarg" + compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $wl$qarg" + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" @@ -5480,11 +4425,6 @@ func_mode_link () continue ;; - -bindir) - prev=bindir - continue - ;; - -dlopen) prev=dlfiles continue @@ -5535,16 +4475,15 @@ func_mode_link () ;; -L*) - func_stripname "-L" '' "$arg" - if test -z "$func_stripname_result"; then + func_stripname '-L' '' "$arg" + dir=$func_stripname_result + if test -z "$dir"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; @@ -5556,30 +4495,24 @@ func_mode_link () ;; esac case "$deplibs " in - *" -L$dir "* | *" $arg "*) - # Will only happen for absolute or sysroot arguments - ;; + *" -L$dir "*) ;; *) - # Preserve sysroot, but never include relative directories - case $dir in - [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; - *) func_append deplibs " -L$dir" ;; - esac - func_append lib_search_path " $dir" + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; - *) func_append dllsearchpath ":$dir";; + *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; + *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac @@ -5589,7 +4522,7 @@ func_mode_link () -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) # These systems don't actually have a C or math library (as such) continue ;; @@ -5603,7 +4536,7 @@ func_mode_link () ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework - func_append deplibs " System.ltframework" + deplibs="$deplibs System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -5623,7 +4556,7 @@ func_mode_link () ;; esac fi - func_append deplibs " $arg" + deplibs="$deplibs $arg" continue ;; @@ -5635,8 +4568,8 @@ func_mode_link () # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) - func_append compiler_flags " $arg" + -model|-arch|-isysroot) + compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler @@ -5644,12 +4577,12 @@ func_mode_link () ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) - func_append compiler_flags " $arg" + compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; - * ) func_append new_inherited_linker_flags " $arg" ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; esac continue ;; @@ -5716,17 +4649,13 @@ func_mode_link () # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; - =*) - func_stripname '=' '' "$dir" - dir=$lt_sysroot$func_stripname_result - ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; - *) func_append xrpath " $dir" ;; + *) xrpath="$xrpath $dir" ;; esac continue ;; @@ -5779,8 +4708,8 @@ func_mode_link () for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" @@ -5795,9 +4724,9 @@ func_mode_link () for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" + linker_flags="$linker_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" @@ -5825,27 +4754,23 @@ func_mode_link () arg="$func_quote_for_eval_result" ;; - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - # --sysroot=* for sysroot support - # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -F/path gives path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC + # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" - func_append compiler_flags " $arg" + compiler_flags="$compiler_flags $arg" continue ;; @@ -5857,7 +4782,7 @@ func_mode_link () *.$objext) # A standard object. - func_append objs " $arg" + objs="$objs $arg" ;; *.lo) @@ -5888,7 +4813,7 @@ func_mode_link () if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" + dlfiles="$dlfiles $pic_object" prev= continue else @@ -5900,7 +4825,7 @@ func_mode_link () # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. - func_append dlprefiles " $pic_object" + dlprefiles="$dlprefiles $pic_object" prev= fi @@ -5945,25 +4870,24 @@ func_mode_link () *.$libext) # An archive. - func_append deplibs " $arg" - func_append old_deplibs " $arg" + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. - func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. - func_append dlfiles " $func_resolve_sysroot_result" + dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. - func_append dlprefiles " $func_resolve_sysroot_result" + dlprefiles="$dlprefiles $arg" prev= else - func_append deplibs " $func_resolve_sysroot_result" + deplibs="$deplibs $arg" fi continue ;; @@ -6001,7 +4925,7 @@ func_mode_link () if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi @@ -6010,8 +4934,6 @@ func_mode_link () func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" - func_to_tool_file "$output_objdir/" - tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" @@ -6032,12 +4954,12 @@ func_mode_link () # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do - if $opt_preserve_dup_deps ; then + if $opt_duplicate_deps ; then case "$libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi - func_append libs " $deplib" + libs="$libs $deplib" done if test "$linkmode" = lib; then @@ -6050,9 +4972,9 @@ func_mode_link () if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in - *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac - func_append pre_post_deps " $pre_post_dep" + pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= @@ -6111,7 +5033,10 @@ func_mode_link () case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then @@ -6119,19 +5044,17 @@ func_mode_link () for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= - func_resolve_sysroot "$lib" case $lib in - *.la) func_source "$func_resolve_sysroot_result" ;; + *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do - func_basename "$deplib" - deplib_base=$func_basename_result + deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` case " $weak_libs " in *" $deplib_base "*) ;; - *) func_append deplibs " $deplib" ;; + *) deplibs="$deplibs $deplib" ;; esac done done @@ -6152,11 +5075,11 @@ func_mode_link () compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - func_append compiler_flags " $deplib" + compiler_flags="$compiler_flags $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi @@ -6241,7 +5164,7 @@ func_mode_link () if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi @@ -6254,8 +5177,7 @@ func_mode_link () test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" + newlib_search_path="$newlib_search_path $func_stripname_result" ;; prog) if test "$pass" = conv; then @@ -6269,8 +5191,7 @@ func_mode_link () finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" + newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) func_warning "\`-L' is ignored for archives/objects" @@ -6281,21 +5202,17 @@ func_mode_link () -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result + dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; - *) func_append xrpath " $dir" ;; + *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; - *.la) - func_resolve_sysroot "$deplib" - lib=$func_resolve_sysroot_result - ;; + *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" @@ -6313,7 +5230,7 @@ func_mode_link () match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi @@ -6323,15 +5240,15 @@ func_mode_link () ;; esac if test "$valid_a_lib" != yes; then - echo + $ECHO $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because the file extensions .$libext of this argument makes me believe" + $ECHO "*** that it is just a static archive that I should not use here." else - echo + $ECHO $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" @@ -6358,11 +5275,11 @@ func_mode_link () if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. - func_append newdlprefiles " $deplib" + newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else - func_append newdlfiles " $deplib" + newdlfiles="$newdlfiles $deplib" fi fi continue @@ -6404,20 +5321,20 @@ func_mode_link () # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; - *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && func_append dlfiles " $dlopen" - test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then @@ -6428,36 +5345,30 @@ func_mode_link () func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. - func_append convenience " $ladir/$objdir/$old_library" - func_append old_convenience " $ladir/$objdir/$old_library" + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done continue fi # $pass = conv # Get the name of the library we link against. linklib= - if test -n "$old_library" && - { test "$prefer_static_libs" = yes || - test "$prefer_static_libs,$installed" = "built,no"; }; then - linklib=$old_library - else - for l in $old_library $library_names; do - linklib="$l" - done - fi + for l in $old_library $library_names; do + linklib="$l" + done if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi @@ -6474,9 +5385,9 @@ func_mode_link () # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. - func_append dlprefiles " $lib $dependency_libs" + dlprefiles="$dlprefiles $lib $dependency_libs" else - func_append newdlfiles " $lib" + newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen @@ -6498,14 +5409,14 @@ func_mode_link () # Find the relevant object directory and library name. if test "X$installed" = Xyes; then - if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else - dir="$lt_sysroot$libdir" - absdir="$lt_sysroot$libdir" + dir="$libdir" + absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else @@ -6513,12 +5424,12 @@ func_mode_link () dir="$ladir" absdir="$abs_ladir" # Remove this search path later - func_append notinst_path " $abs_ladir" + notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later - func_append notinst_path " $abs_ladir" + notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" @@ -6529,46 +5440,20 @@ func_mode_link () if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi - case "$host" in - # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) - # Linker will automatically link against shared library if both - # static and shared are present. Therefore, ensure we extract - # symbols from the import library if a shared library is present - # (otherwise, the dlopen module name will be incorrect). We do - # this by putting the import library name into $newdlprefiles. - # We recover the dlopen module name by 'saving' the la file - # name in a special purpose variable, and (later) extracting the - # dlname from the la file. - if test -n "$dlname"; then - func_tr_sh "$dir/$linklib" - eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" - func_append newdlprefiles " $dir/$linklib" - else - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - fi - ;; - * ) - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - func_append newdlprefiles " $dir/$dlname" - else - func_append newdlprefiles " $dir/$linklib" - fi - ;; - esac + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi fi # $pass = dlpreopen if test -z "$libdir"; then @@ -6586,7 +5471,7 @@ func_mode_link () if test "$linkmode" = prog && test "$pass" != link; then - func_append newlib_search_path " $ladir" + newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no @@ -6599,8 +5484,7 @@ func_mode_link () for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" + newlib_search_path="$newlib_search_path $func_stripname_result" ;; esac # Need to link against all dependency_libs? @@ -6611,12 +5495,12 @@ func_mode_link () # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi - if $opt_preserve_dup_deps ; then + if $opt_duplicate_deps ; then case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi - func_append tmp_libs " $deplib" + tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... @@ -6631,7 +5515,7 @@ func_mode_link () # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; + *) temp_rpath="$temp_rpath$absdir:" ;; esac fi @@ -6643,7 +5527,7 @@ func_mode_link () *) case "$compile_rpath " in *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; + *) compile_rpath="$compile_rpath $absdir" esac ;; esac @@ -6652,7 +5536,7 @@ func_mode_link () *) case "$finalize_rpath " in *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; + *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac @@ -6677,12 +5561,12 @@ func_mode_link () case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded - func_append notinst_deplibs " $lib" + notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) if test "$installed" = no; then - func_append notinst_deplibs " $lib" + notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi ;; @@ -6699,7 +5583,7 @@ func_mode_link () fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - echo + $ECHO if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else @@ -6717,7 +5601,7 @@ func_mode_link () *) case "$compile_rpath " in *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; + *) compile_rpath="$compile_rpath $absdir" esac ;; esac @@ -6726,7 +5610,7 @@ func_mode_link () *) case "$finalize_rpath " in *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; + *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac @@ -6780,7 +5664,7 @@ func_mode_link () linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" - if test "$linkmode" = prog || test "$opt_mode" != relink; then + if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= @@ -6802,9 +5686,9 @@ func_mode_link () if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then - echo - echo "*** And there doesn't seem to be a static archive available" - echo "*** The link will probably fail, sorry" + $ECHO + $ECHO "*** And there doesn't seem to be a static archive available" + $ECHO "*** The link will probably fail, sorry" else add="$dir/$old_library" fi @@ -6836,7 +5720,7 @@ func_mode_link () if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" + add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi @@ -6858,7 +5742,7 @@ func_mode_link () if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; - *) func_append compile_shlibpath "$add_shlibpath:" ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then @@ -6872,13 +5756,13 @@ func_mode_link () test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi - if test "$linkmode" = prog || test "$opt_mode" = relink; then + if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= @@ -6892,7 +5776,7 @@ func_mode_link () elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then @@ -6909,7 +5793,7 @@ func_mode_link () if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" + add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi @@ -6944,21 +5828,21 @@ func_mode_link () # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. - echo + $ECHO $ECHO "*** Warning: This system can not link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + $ECHO "*** But as you try to build a module library, libtool will still create " + $ECHO "*** a static module, that should work as long as the dlopening application" + $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." + $ECHO + $ECHO "*** However, this would only work if libtool was able to extract symbol" + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" + $ECHO "*** not find such a program. So, this module is probably useless." + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module @@ -6986,33 +5870,27 @@ func_mode_link () temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; - *) func_append xrpath " $temp_xrpath";; + *) xrpath="$xrpath $temp_xrpath";; esac;; - *) func_append temp_deplibs " $libdir";; + *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi - func_append newlib_search_path " $absdir" + newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result";; - *) func_resolve_sysroot "$deplib" ;; - esac - if $opt_preserve_dup_deps ; then + if $opt_duplicate_deps ; then case "$tmp_libs " in - *" $func_resolve_sysroot_result "*) - func_append specialdeplibs " $func_resolve_sysroot_result" ;; + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi - func_append tmp_libs " $func_resolve_sysroot_result" + tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then @@ -7022,10 +5900,8 @@ func_mode_link () case $deplib in -L*) path="$deplib" ;; *.la) - func_resolve_sysroot "$deplib" - deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." - dir=$func_dirname_result + dir="$func_dirname_result" # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; @@ -7052,8 +5928,8 @@ func_mode_link () if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi - func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi @@ -7086,7 +5962,7 @@ func_mode_link () compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else - compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" @@ -7103,7 +5979,7 @@ func_mode_link () for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; - *) func_append lib_search_path " $dir" ;; + *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= @@ -7161,10 +6037,10 @@ func_mode_link () -L*) case " $tmp_libs " in *" $deplib "*) ;; - *) func_append tmp_libs " $deplib" ;; + *) tmp_libs="$tmp_libs $deplib" ;; esac ;; - *) func_append tmp_libs " $deplib" ;; + *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" @@ -7180,7 +6056,7 @@ func_mode_link () ;; esac if test -n "$i" ; then - func_append tmp_libs " $i" + tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs @@ -7221,7 +6097,7 @@ func_mode_link () # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" - func_append objs "$old_deplibs" + objs="$objs$old_deplibs" ;; lib) @@ -7254,10 +6130,10 @@ func_mode_link () if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else - echo + $ECHO $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" - func_append libobjs " $objs" + libobjs="$libobjs $objs" fi fi @@ -7322,7 +6198,7 @@ func_mode_link () age="$number_minor" revision="$number_revision" ;; - freebsd-aout|freebsd-elf|qnx|sunos) + freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" @@ -7334,6 +6210,9 @@ func_mode_link () revision="$number_minor" lt_irix_increment=no ;; + *) + func_fatal_configuration "$modename: unknown library version type \`$version_type'" + ;; esac ;; no) @@ -7455,7 +6334,7 @@ func_mode_link () done # Make executables depend on our current version. - func_append verstring ":${current}.0" + verstring="$verstring:${current}.0" ;; qnx) @@ -7523,10 +6402,10 @@ func_mode_link () fi func_generate_dlsyms "$libname" "$libname" "yes" - func_append libobjs " $symfileobj" + libobjs="$libobjs $symfileobj" test "X$libobjs" = "X " && libobjs= - if test "$opt_mode" != relink; then + if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= @@ -7542,7 +6421,7 @@ func_mode_link () continue fi fi - func_append removelist " $p" + removelist="$removelist $p" ;; *) ;; esac @@ -7553,28 +6432,27 @@ func_mode_link () # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - func_append oldlibs " $output_objdir/$libname.$libext" + oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` + # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` + # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do - func_replace_sysroot "$libdir" - func_append temp_xrpath " -R$func_replace_sysroot_result" + temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then @@ -7588,7 +6466,7 @@ func_mode_link () for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; - *) func_append dlfiles " $lib" ;; + *) dlfiles="$dlfiles $lib" ;; esac done @@ -7598,19 +6476,19 @@ func_mode_link () for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; - *) func_append dlprefiles " $lib" ;; + *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework - func_append deplibs " System.ltframework" + deplibs="$deplibs System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. @@ -7627,7 +6505,7 @@ func_mode_link () *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then - func_append deplibs " -lc" + deplibs="$deplibs -lc" fi ;; esac @@ -7676,7 +6554,7 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - func_append newdeplibs " $i" + newdeplibs="$newdeplibs $i" i="" ;; esac @@ -7687,21 +6565,21 @@ EOF set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - func_append newdeplibs " $i" + newdeplibs="$newdeplibs $i" else droppeddeps=yes - echo + $ECHO $ECHO "*** Warning: dynamic linker does not accept needed library $i." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which I believe you do not have" - echo "*** because a test_compile did reveal that the linker did not use it for" - echo "*** its dynamic dependency list that programs get resolved with at runtime." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which I believe you do not have" + $ECHO "*** because a test_compile did reveal that the linker did not use it for" + $ECHO "*** its dynamic dependency list that programs get resolved with at runtime." fi fi ;; *) - func_append newdeplibs " $i" + newdeplibs="$newdeplibs $i" ;; esac done @@ -7719,7 +6597,7 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $i "*) - func_append newdeplibs " $i" + newdeplibs="$newdeplibs $i" i="" ;; esac @@ -7730,29 +6608,29 @@ EOF set dummy $deplib_matches; shift deplib_match=$1 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - func_append newdeplibs " $i" + newdeplibs="$newdeplibs $i" else droppeddeps=yes - echo + $ECHO $ECHO "*** Warning: dynamic linker does not accept needed library $i." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because a test_compile did reveal that the linker did not use this one" - echo "*** as a dynamic dependency that programs can get resolved with at runtime." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because a test_compile did reveal that the linker did not use this one" + $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime." fi fi else droppeddeps=yes - echo + $ECHO $ECHO "*** Warning! Library $i is needed by this library but I was not able to" - echo "*** make it link in! You will probably need to install it or some" - echo "*** library that it depends on before this library will be fully" - echo "*** functional. Installing it before continuing would be even better." + $ECHO "*** make it link in! You will probably need to install it or some" + $ECHO "*** library that it depends on before this library will be fully" + $ECHO "*** functional. Installing it before continuing would be even better." fi ;; *) - func_append newdeplibs " $i" + newdeplibs="$newdeplibs $i" ;; esac done @@ -7769,27 +6647,15 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - func_append newdeplibs " $a_deplib" + newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` - if test -n "$file_magic_glob"; then - libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` - else - libnameglob=$libname - fi - test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - if test "$want_nocaseglob" = yes; then - shopt -s nocaseglob - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - $nocaseglob - else - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - fi + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | @@ -7806,13 +6672,13 @@ EOF potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" + newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi @@ -7821,12 +6687,12 @@ EOF fi if test -n "$a_deplib" ; then droppeddeps=yes - echo + $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else @@ -7837,7 +6703,7 @@ EOF ;; *) # Add a -L argument. - func_append newdeplibs " $a_deplib" + newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. @@ -7853,7 +6719,7 @@ EOF if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) - func_append newdeplibs " $a_deplib" + newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac @@ -7864,9 +6730,9 @@ EOF potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" + newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi @@ -7875,12 +6741,12 @@ EOF fi if test -n "$a_deplib" ; then droppeddeps=yes - echo + $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else @@ -7891,32 +6757,32 @@ EOF ;; *) # Add a -L argument. - func_append newdeplibs " $a_deplib" + newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ + -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` done fi - case $tmp_deplibs in - *[!\ \ ]*) - echo + if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | + $GREP . >/dev/null; then + $ECHO if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." + $ECHO "*** Warning: inter-library dependencies are not supported in this platform." else - echo "*** Warning: inter-library dependencies are not known to be supported." + $ECHO "*** Warning: inter-library dependencies are not known to be supported." fi - echo "*** All declared inter-library dependencies are being dropped." + $ECHO "*** All declared inter-library dependencies are being dropped." droppeddeps=yes - ;; - esac + fi ;; esac versuffix=$versuffix_save @@ -7928,23 +6794,23 @@ EOF case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO + $ECHO "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." + $ECHO "*** a static module, that should work as long as the dlopening" + $ECHO "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." + $ECHO + $ECHO "*** However, this would only work if libtool was able to extract symbol" + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" + $ECHO "*** not find such a program. So, this module is probably useless." + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" @@ -7954,16 +6820,16 @@ EOF build_libtool_libs=no fi else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." + $ECHO "*** The inter-library dependencies that have been dropped here will be" + $ECHO "*** automatically added whenever a program is linked with this library" + $ECHO "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." + $ECHO + $ECHO "*** Since this library must not contain undefined symbols," + $ECHO "*** because either the platform does not support them or" + $ECHO "*** it was explicitly requested with -no-undefined," + $ECHO "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module @@ -7980,9 +6846,9 @@ EOF # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -7995,7 +6861,7 @@ EOF *) case " $deplibs " in *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; + new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac @@ -8005,10 +6871,10 @@ EOF -L*) case " $new_libs " in *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; + *) new_libs="$new_libs $deplib" ;; esac ;; - *) func_append new_libs " $deplib" ;; + *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" @@ -8025,12 +6891,10 @@ EOF hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" - test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then - func_replace_sysroot "$libdir" - libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else @@ -8039,18 +6903,18 @@ EOF *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - func_append dep_rpath " $flag" + dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) func_apped perm_rpath " $libdir" ;; + *) perm_rpath="$perm_rpath $libdir" ;; esac fi done @@ -8068,7 +6932,7 @@ EOF # We should set the runpath_var. rpath= for dir in $perm_rpath; do - func_append rpath "$dir:" + rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi @@ -8076,7 +6940,7 @@ EOF fi shlibpath="$finalize_shlibpath" - test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi @@ -8102,18 +6966,18 @@ EOF linknames= for link do - func_append linknames " $link" + linknames="$linknames $link" done # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" - func_append delfiles " $export_symbols" + delfiles="$delfiles $export_symbols" fi orig_export_symbols= @@ -8144,45 +7008,13 @@ EOF $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' - for cmd1 in $cmds; do + for cmd in $cmds; do IFS="$save_ifs" - # Take the normal branch if the nm_file_list_spec branch - # doesn't work or if tool conversion is not needed. - case $nm_file_list_spec~$to_tool_file_cmd in - *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) - try_normal_branch=yes - eval cmd=\"$cmd1\" - func_len " $cmd" - len=$func_len_result - ;; - *) - try_normal_branch=no - ;; - esac - if test "$try_normal_branch" = yes \ - && { test "$len" -lt "$max_cmd_len" \ - || test "$max_cmd_len" -le -1; } - then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - elif test -n "$nm_file_list_spec"; then - func_basename "$output" - output_la=$func_basename_result - save_libobjs=$libobjs - save_output=$output - output=${output_objdir}/${output_la}.nm - func_to_tool_file "$output" - libobjs=$nm_file_list_spec$func_to_tool_file_result - func_append delfiles " $output" - func_verbose "creating $NM input file list: $output" - for obj in $save_libobjs; do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > "$output" - eval cmd=\"$cmd1\" + eval cmd=\"$cmd\" + func_len " $cmd" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' - output=$save_output - libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. @@ -8204,7 +7036,7 @@ EOF if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then @@ -8216,7 +7048,7 @@ EOF # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -8226,7 +7058,7 @@ EOF case " $convenience " in *" $test_deplib "*) ;; *) - func_append tmp_deplibs " $test_deplib" + tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done @@ -8246,21 +7078,21 @@ EOF test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" + generated="$generated $gentop" func_extract_archives $gentop $convenience - func_append libobjs " $func_extract_archives_result" + libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" - func_append linker_flags " $flag" + linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking - if test "$opt_mode" = relink; then + if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi @@ -8305,8 +7137,7 @@ EOF save_libobjs=$libobjs fi save_output=$output - func_basename "$output" - output_la=$func_basename_result + output_la=`$ECHO "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. @@ -8319,16 +7150,13 @@ EOF if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output + $ECHO 'INPUT (' > $output for obj in $save_libobjs do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output + $ECHO "$obj" >> $output done - echo ')' >> $output - func_append delfiles " $output" - func_to_tool_file "$output" - output=$func_to_tool_file_result + $ECHO ')' >> $output + delfiles="$delfiles $output" elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" @@ -8342,12 +7170,10 @@ EOF fi for obj do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output + $ECHO "$obj" >> $output done - func_append delfiles " $output" - func_to_tool_file "$output" - output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + delfiles="$delfiles $output" + output=$firstobj\"$file_list_spec$output\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." @@ -8371,19 +7197,17 @@ EOF # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext - objlist=" $obj" + objlist=$obj func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result @@ -8393,12 +7217,11 @@ EOF # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi - func_append delfiles " $output" + delfiles="$delfiles $output" else output= @@ -8432,7 +7255,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -8453,7 +7276,7 @@ EOF if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then @@ -8465,7 +7288,7 @@ EOF # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi @@ -8506,10 +7329,10 @@ EOF # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" + generated="$generated $gentop" func_extract_archives $gentop $dlprefiles - func_append libobjs " $func_extract_archives_result" + libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi @@ -8525,7 +7348,7 @@ EOF lt_exit=$? # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) @@ -8537,7 +7360,7 @@ EOF IFS="$save_ifs" # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then + if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then @@ -8618,21 +7441,18 @@ EOF if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" - func_append generated " $gentop" + generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi - # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' @@ -8692,8 +7512,8 @@ EOF case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac @@ -8704,14 +7524,14 @@ EOF if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) - func_append compile_command " ${wl}-bind_at_load" - func_append finalize_command " ${wl}-bind_at_load" + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -8725,7 +7545,7 @@ EOF *) case " $compile_deplibs " in *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; + new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac @@ -8735,17 +7555,17 @@ EOF -L*) case " $new_libs " in *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; + *) new_libs="$new_libs $deplib" ;; esac ;; - *) func_append new_libs " $deplib" ;; + *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" - func_append compile_command " $compile_deplibs" - func_append finalize_command " $finalize_deplibs" + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. @@ -8753,7 +7573,7 @@ EOF # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi @@ -8772,18 +7592,18 @@ EOF *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" + rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; + *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in @@ -8792,12 +7612,12 @@ EOF case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; - *) func_append dllsearchpath ":$libdir";; + *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; + *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac @@ -8823,18 +7643,18 @@ EOF *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" + rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; - *) func_append finalize_perm_rpath " $libdir" ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done @@ -8848,8 +7668,8 @@ EOF if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. - compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" @@ -8861,15 +7681,15 @@ EOF wrappers_required=yes case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no - ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; + *cegcc) + # Disable wrappers for cegcc, we are cross compiling anyway. + wrappers_required=no + ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no @@ -8878,19 +7698,13 @@ EOF esac if test "$wrappers_required" = no; then # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' @@ -8913,7 +7727,7 @@ EOF # We should set the runpath_var. rpath= for dir in $perm_rpath; do - func_append rpath "$dir:" + rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -8921,7 +7735,7 @@ EOF # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do - func_append rpath "$dir:" + rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi @@ -8931,18 +7745,11 @@ EOF # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - exit $EXIT_SUCCESS fi @@ -8957,7 +7764,7 @@ EOF if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= @@ -8969,19 +7776,13 @@ EOF fi # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' - if test -n "$postlink_cmds"; then - func_to_tool_file "$output_objdir/$outputname" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - # Now create the wrapper script. func_verbose "creating $output" @@ -8999,7 +7800,18 @@ EOF fi done relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $ECHO for shipping. + if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. @@ -9079,7 +7891,7 @@ EOF else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then - func_append oldobjs " $symfileobj" + oldobjs="$oldobjs $symfileobj" fi fi addlibs="$old_convenience" @@ -9087,10 +7899,10 @@ EOF if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" + generated="$generated $gentop" func_extract_archives $gentop $addlibs - func_append oldobjs " $func_extract_archives_result" + oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. @@ -9101,10 +7913,10 @@ EOF # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" + generated="$generated $gentop" func_extract_archives $gentop $dlprefiles - func_append oldobjs " $func_extract_archives_result" + oldobjs="$oldobjs $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have @@ -9120,9 +7932,9 @@ EOF done | sort | sort -uc >/dev/null 2>&1); then : else - echo "copying selected object files to avoid basename conflicts..." + $ECHO "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" + generated="$generated $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= @@ -9146,9 +7958,9 @@ EOF esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - func_append oldobjs " $gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" ;; - *) func_append oldobjs " $obj" ;; + *) oldobjs="$oldobjs $obj" ;; esac done fi @@ -9158,16 +7970,6 @@ EOF len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds - elif test -n "$archiver_list_spec"; then - func_verbose "using command file archive linking..." - for obj in $oldobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > $output_objdir/$libname.libcmd - func_to_tool_file "$output_objdir/$libname.libcmd" - oldobjs=" $archiver_list_spec$func_to_tool_file_result" - cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." @@ -9241,7 +8043,7 @@ EOF done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi @@ -9264,19 +8066,9 @@ EOF eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" - func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" - ;; - -L*) - func_stripname -L '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -L$func_replace_sysroot_result" + newdependency_libs="$newdependency_libs $libdir/$name" ;; - -R*) - func_stripname -R '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -R$func_replace_sysroot_result" - ;; - *) func_append newdependency_libs " $deplib" ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" @@ -9290,9 +8082,9 @@ EOF eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + newdlfiles="$newdlfiles $libdir/$name" ;; - *) func_append newdlfiles " $lib" ;; + *) newdlfiles="$newdlfiles $lib" ;; esac done dlfiles="$newdlfiles" @@ -9309,7 +8101,7 @@ EOF eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + newdlprefiles="$newdlprefiles $libdir/$name" ;; esac done @@ -9321,7 +8113,7 @@ EOF [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - func_append newdlfiles " $abs" + newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= @@ -9330,33 +8122,15 @@ EOF [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac - func_append newdlprefiles " $abs" + newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) - # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; - then - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $ECHO > $output "\ # $outputname - a libtool library file @@ -9415,7 +8189,7 @@ relink_command=\"$relink_command\"" exit $EXIT_SUCCESS } -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && +{ test "$mode" = link || test "$mode" = relink; } && func_mode_link ${1+"$@"} @@ -9435,9 +8209,9 @@ func_mode_uninstall () for arg do case $arg in - -f) func_append RM " $arg"; rmforce=yes ;; - -*) func_append RM " $arg" ;; - *) func_append files " $arg" ;; + -f) RM="$RM $arg"; rmforce=yes ;; + -*) RM="$RM $arg" ;; + *) files="$files $arg" ;; esac done @@ -9446,23 +8220,24 @@ func_mode_uninstall () rmdirs= + origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then - odir="$objdir" + objdir="$origobjdir" else - odir="$dir/$objdir" + objdir="$dir/$origobjdir" fi func_basename "$file" name="$func_basename_result" - test "$opt_mode" = uninstall && odir="$dir" + test "$mode" = uninstall && objdir="$dir" - # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then case " $rmdirs " in - *" $odir "*) ;; - *) func_append rmdirs " $odir" ;; + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; esac fi @@ -9488,17 +8263,18 @@ func_mode_uninstall () # Delete the libtool libraries and symlinks. for n in $library_names; do - func_append rmfiles " $odir/$n" + rmfiles="$rmfiles $objdir/$n" done - test -n "$old_library" && func_append rmfiles " $odir/$old_library" + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - case "$opt_mode" in + case "$mode" in clean) - case " $library_names " in + case " $library_names " in + # " " in the beginning catches empty $dlname *" $dlname "*) ;; - *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; esac - test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then @@ -9526,19 +8302,19 @@ func_mode_uninstall () # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then - func_append rmfiles " $dir/$pic_object" + rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then - func_append rmfiles " $dir/$non_pic_object" + rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) - if test "$opt_mode" = clean ; then + if test "$mode" = clean ; then noexename=$name case $file in *.exe) @@ -9548,7 +8324,7 @@ func_mode_uninstall () noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe - func_append rmfiles " $file" + rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. @@ -9557,7 +8333,7 @@ func_mode_uninstall () func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result - func_append rmfiles " $func_ltwrapper_scriptname_result" + rmfiles="$rmfiles $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename @@ -9565,12 +8341,12 @@ func_mode_uninstall () # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then - func_append rmfiles " $odir/lt-$name" + rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then - func_append rmfiles " $odir/lt-${noexename}.c" + rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi @@ -9578,6 +8354,7 @@ func_mode_uninstall () esac func_show_eval "$RM $rmfiles" 'exit_status=1' done + objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do @@ -9589,16 +8366,16 @@ func_mode_uninstall () exit $exit_status } -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && +{ test "$mode" = uninstall || test "$mode" = clean; } && func_mode_uninstall ${1+"$@"} -test -z "$opt_mode" && { +test -z "$mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$opt_mode'" + func_fatal_help "invalid operation mode \`$mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" diff --git a/config/ltoptions.m4 b/config/ltoptions.m4 index 17cfd51..34151a3 100644 --- a/config/ltoptions.m4 +++ b/config/ltoptions.m4 @@ -1,14 +1,13 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 7 ltoptions.m4 +# serial 6 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) @@ -126,7 +125,7 @@ LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) @@ -134,13 +133,13 @@ case $host in esac test -z "$AS" && AS=as -_LT_DECL([], [AS], [1], [Assembler program])dnl +_LT_DECL([], [AS], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl +_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], diff --git a/config/ltversion.m4 b/config/ltversion.m4 index 9c7b5d4..f3c5309 100644 --- a/config/ltversion.m4 +++ b/config/ltversion.m4 @@ -7,17 +7,17 @@ # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# @configure_input@ +# Generated from ltversion.in. -# serial 3293 ltversion.m4 +# serial 3017 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4]) -m4_define([LT_PACKAGE_REVISION], [1.3293]) +m4_define([LT_PACKAGE_VERSION], [2.2.6b]) +m4_define([LT_PACKAGE_REVISION], [1.3017]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4' -macro_revision='1.3293' +[macro_version='2.2.6b' +macro_revision='1.3017' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) diff --git a/config/lt~obsolete.m4 b/config/lt~obsolete.m4 index c573da9..637bb20 100644 --- a/config/lt~obsolete.m4 +++ b/config/lt~obsolete.m4 @@ -1,13 +1,13 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 5 lt~obsolete.m4 +# serial 4 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # @@ -77,6 +77,7 @@ m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) @@ -89,10 +90,3 @@ m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) -m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) -m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) -m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) -m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) -m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) -m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/config/texinfo.tex b/config/texinfo.tex deleted file mode 100644 index 9140826..0000000 --- a/config/texinfo.tex +++ /dev/null @@ -1,9291 +0,0 @@ -% texinfo.tex -- TeX macros to handle Texinfo files. -% -% Load plain if necessary, i.e., if running under initex. -\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi -% -\def\texinfoversion{2009-08-14.15} -% -% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, -% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -% 2007, 2008, 2009 Free Software Foundation, Inc. -% -% This texinfo.tex file 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 3 of the -% License, or (at your option) any later version. -% -% This texinfo.tex file 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, see . -% -% As a special exception, when this file is read by TeX when processing -% a Texinfo source document, you may use the result without -% restriction. (This has been our intent since Texinfo was invented.) -% -% Please try the latest version of texinfo.tex before submitting bug -% reports; you can get the latest version from: -% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or -% ftp://tug.org/tex/texinfo.tex -% (and all CTAN mirrors, see http://www.ctan.org). -% The texinfo.tex in any given distribution could well be out -% of date, so if that's what you're using, please check. -% -% Send bug reports to bug-texinfo@gnu.org. Please include including a -% complete document in each bug report with which we can reproduce the -% problem. Patches are, of course, greatly appreciated. -% -% To process a Texinfo manual with TeX, it's most reliable to use the -% texi2dvi shell script that comes with the distribution. For a simple -% manual foo.texi, however, you can get away with this: -% tex foo.texi -% texindex foo.?? -% tex foo.texi -% tex foo.texi -% dvips foo.dvi -o # or whatever; this makes foo.ps. -% The extra TeX runs get the cross-reference information correct. -% Sometimes one run after texindex suffices, and sometimes you need more -% than two; texi2dvi does it as many times as necessary. -% -% It is possible to adapt texinfo.tex for other languages, to some -% extent. You can get the existing language-specific files from the -% full Texinfo distribution. -% -% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. - - -\message{Loading texinfo [version \texinfoversion]:} - -% If in a .fmt file, print the version number -% and turn on active characters that we couldn't do earlier because -% they might have appeared in the input file name. -\everyjob{\message{[Texinfo version \texinfoversion]}% - \catcode`+=\active \catcode`\_=\active} - - -\chardef\other=12 - -% We never want plain's \outer definition of \+ in Texinfo. -% For @tex, we can use \tabalign. -\let\+ = \relax - -% Save some plain tex macros whose names we will redefine. -\let\ptexb=\b -\let\ptexbullet=\bullet -\let\ptexc=\c -\let\ptexcomma=\, -\let\ptexdot=\. -\let\ptexdots=\dots -\let\ptexend=\end -\let\ptexequiv=\equiv -\let\ptexexclam=\! -\let\ptexfootnote=\footnote -\let\ptexgtr=> -\let\ptexhat=^ -\let\ptexi=\i -\let\ptexindent=\indent -\let\ptexinsert=\insert -\let\ptexlbrace=\{ -\let\ptexless=< -\let\ptexnewwrite\newwrite -\let\ptexnoindent=\noindent -\let\ptexplus=+ -\let\ptexrbrace=\} -\let\ptexslash=\/ -\let\ptexstar=\* -\let\ptext=\t -\let\ptextop=\top -{\catcode`\'=\active -\global\let\ptexquoteright'}% Math-mode def from plain.tex. -\let\ptexraggedright=\raggedright - -% If this character appears in an error message or help string, it -% starts a new line in the output. -\newlinechar = `^^J - -% Use TeX 3.0's \inputlineno to get the line number, for better error -% messages, but if we're using an old version of TeX, don't do anything. -% -\ifx\inputlineno\thisisundefined - \let\linenumber = \empty % Pre-3.0. -\else - \def\linenumber{l.\the\inputlineno:\space} -\fi - -% Set up fixed words for English if not already set. -\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi -\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi -\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi -\ifx\putwordin\undefined \gdef\putwordin{in}\fi -\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi -\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi -\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi -\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi -\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi -\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi -\ifx\putwordof\undefined \gdef\putwordof{of}\fi -\ifx\putwordon\undefined \gdef\putwordon{on}\fi -\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi -\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi -\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi -\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi -\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi -\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi -\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi -% -\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi -\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi -\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi -\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi -\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi -\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi -\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi -\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi -\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi -\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi -\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi -\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi -% -\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi -\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi -\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi -\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi -\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi - -% Since the category of space is not known, we have to be careful. -\chardef\spacecat = 10 -\def\spaceisspace{\catcode`\ =\spacecat} - -% sometimes characters are active, so we need control sequences. -\chardef\colonChar = `\: -\chardef\commaChar = `\, -\chardef\dashChar = `\- -\chardef\dotChar = `\. -\chardef\exclamChar= `\! -\chardef\lquoteChar= `\` -\chardef\questChar = `\? -\chardef\rquoteChar= `\' -\chardef\semiChar = `\; -\chardef\underChar = `\_ - -% Ignore a token. -% -\def\gobble#1{} - -% The following is used inside several \edef's. -\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} - -% Hyphenation fixes. -\hyphenation{ - Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script - ap-pen-dix bit-map bit-maps - data-base data-bases eshell fall-ing half-way long-est man-u-script - man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm - par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces - spell-ing spell-ings - stand-alone strong-est time-stamp time-stamps which-ever white-space - wide-spread wrap-around -} - -% Margin to add to right of even pages, to left of odd pages. -\newdimen\bindingoffset -\newdimen\normaloffset -\newdimen\pagewidth \newdimen\pageheight - -% For a final copy, take out the rectangles -% that mark overfull boxes (in case you have decided -% that the text looks ok even though it passes the margin). -% -\def\finalout{\overfullrule=0pt} - -% @| inserts a changebar to the left of the current line. It should -% surround any changed text. This approach does *not* work if the -% change spans more than two lines of output. To handle that, we would -% have adopt a much more difficult approach (putting marks into the main -% vertical list for the beginning and end of each change). -% -\def\|{% - % \vadjust can only be used in horizontal mode. - \leavevmode - % - % Append this vertical mode material after the current line in the output. - \vadjust{% - % We want to insert a rule with the height and depth of the current - % leading; that is exactly what \strutbox is supposed to record. - \vskip-\baselineskip - % - % \vadjust-items are inserted at the left edge of the type. So - % the \llap here moves out into the left-hand margin. - \llap{% - % - % For a thicker or thinner bar, change the `1pt'. - \vrule height\baselineskip width1pt - % - % This is the space between the bar and the text. - \hskip 12pt - }% - }% -} - -% Sometimes it is convenient to have everything in the transcript file -% and nothing on the terminal. We don't just call \tracingall here, -% since that produces some useless output on the terminal. We also make -% some effort to order the tracing commands to reduce output in the log -% file; cf. trace.sty in LaTeX. -% -\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% -\def\loggingall{% - \tracingstats2 - \tracingpages1 - \tracinglostchars2 % 2 gives us more in etex - \tracingparagraphs1 - \tracingoutput1 - \tracingmacros2 - \tracingrestores1 - \showboxbreadth\maxdimen \showboxdepth\maxdimen - \ifx\eTeXversion\undefined\else % etex gives us more logging - \tracingscantokens1 - \tracingifs1 - \tracinggroups1 - \tracingnesting2 - \tracingassigns1 - \fi - \tracingcommands3 % 3 gives us more in etex - \errorcontextlines16 -}% - -% add check for \lastpenalty to plain's definitions. If the last thing -% we did was a \nobreak, we don't want to insert more space. -% -\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount - \removelastskip\penalty-50\smallskip\fi\fi} -\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount - \removelastskip\penalty-100\medskip\fi\fi} -\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount - \removelastskip\penalty-200\bigskip\fi\fi} - -% For @cropmarks command. -% Do @cropmarks to get crop marks. -% -\newif\ifcropmarks -\let\cropmarks = \cropmarkstrue -% -% Dimensions to add cropmarks at corners. -% Added by P. A. MacKay, 12 Nov. 1986 -% -\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines -\newdimen\cornerlong \cornerlong=1pc -\newdimen\cornerthick \cornerthick=.3pt -\newdimen\topandbottommargin \topandbottommargin=.75in - -% Output a mark which sets \thischapter, \thissection and \thiscolor. -% We dump everything together because we only have one kind of mark. -% This works because we only use \botmark / \topmark, not \firstmark. -% -% A mark contains a subexpression of the \ifcase ... \fi construct. -% \get*marks macros below extract the needed part using \ifcase. -% -% Another complication is to let the user choose whether \thischapter -% (\thissection) refers to the chapter (section) in effect at the top -% of a page, or that at the bottom of a page. The solution is -% described on page 260 of The TeXbook. It involves outputting two -% marks for the sectioning macros, one before the section break, and -% one after. I won't pretend I can describe this better than DEK... -\def\domark{% - \toks0=\expandafter{\lastchapterdefs}% - \toks2=\expandafter{\lastsectiondefs}% - \toks4=\expandafter{\prevchapterdefs}% - \toks6=\expandafter{\prevsectiondefs}% - \toks8=\expandafter{\lastcolordefs}% - \mark{% - \the\toks0 \the\toks2 - \noexpand\or \the\toks4 \the\toks6 - \noexpand\else \the\toks8 - }% -} -% \topmark doesn't work for the very first chapter (after the title -% page or the contents), so we use \firstmark there -- this gets us -% the mark with the chapter defs, unless the user sneaks in, e.g., -% @setcolor (or @url, or @link, etc.) between @contents and the very -% first @chapter. -\def\gettopheadingmarks{% - \ifcase0\topmark\fi - \ifx\thischapter\empty \ifcase0\firstmark\fi \fi -} -\def\getbottomheadingmarks{\ifcase1\botmark\fi} -\def\getcolormarks{\ifcase2\topmark\fi} - -% Avoid "undefined control sequence" errors. -\def\lastchapterdefs{} -\def\lastsectiondefs{} -\def\prevchapterdefs{} -\def\prevsectiondefs{} -\def\lastcolordefs{} - -% Main output routine. -\chardef\PAGE = 255 -\output = {\onepageout{\pagecontents\PAGE}} - -\newbox\headlinebox -\newbox\footlinebox - -% \onepageout takes a vbox as an argument. Note that \pagecontents -% does insertions, but you have to call it yourself. -\def\onepageout#1{% - \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi - % - \ifodd\pageno \advance\hoffset by \bindingoffset - \else \advance\hoffset by -\bindingoffset\fi - % - % Do this outside of the \shipout so @code etc. will be expanded in - % the headline as they should be, not taken literally (outputting ''code). - \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi - \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% - \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi - \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% - % - {% - % Have to do this stuff outside the \shipout because we want it to - % take effect in \write's, yet the group defined by the \vbox ends - % before the \shipout runs. - % - \indexdummies % don't expand commands in the output. - \normalturnoffactive % \ in index entries must not stay \, e.g., if - % the page break happens to be in the middle of an example. - % We don't want .vr (or whatever) entries like this: - % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} - % "\acronym" won't work when it's read back in; - % it needs to be - % {\code {{\tt \backslashcurfont }acronym} - \shipout\vbox{% - % Do this early so pdf references go to the beginning of the page. - \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi - % - \ifcropmarks \vbox to \outervsize\bgroup - \hsize = \outerhsize - \vskip-\topandbottommargin - \vtop to0pt{% - \line{\ewtop\hfil\ewtop}% - \nointerlineskip - \line{% - \vbox{\moveleft\cornerthick\nstop}% - \hfill - \vbox{\moveright\cornerthick\nstop}% - }% - \vss}% - \vskip\topandbottommargin - \line\bgroup - \hfil % center the page within the outer (page) hsize. - \ifodd\pageno\hskip\bindingoffset\fi - \vbox\bgroup - \fi - % - \unvbox\headlinebox - \pagebody{#1}% - \ifdim\ht\footlinebox > 0pt - % Only leave this space if the footline is nonempty. - % (We lessened \vsize for it in \oddfootingyyy.) - % The \baselineskip=24pt in plain's \makefootline has no effect. - \vskip 24pt - \unvbox\footlinebox - \fi - % - \ifcropmarks - \egroup % end of \vbox\bgroup - \hfil\egroup % end of (centering) \line\bgroup - \vskip\topandbottommargin plus1fill minus1fill - \boxmaxdepth = \cornerthick - \vbox to0pt{\vss - \line{% - \vbox{\moveleft\cornerthick\nsbot}% - \hfill - \vbox{\moveright\cornerthick\nsbot}% - }% - \nointerlineskip - \line{\ewbot\hfil\ewbot}% - }% - \egroup % \vbox from first cropmarks clause - \fi - }% end of \shipout\vbox - }% end of group with \indexdummies - \advancepageno - \ifnum\outputpenalty>-20000 \else\dosupereject\fi -} - -\newinsert\margin \dimen\margin=\maxdimen - -\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} -{\catcode`\@ =11 -\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi -% marginal hacks, juha@viisa.uucp (Juha Takala) -\ifvoid\margin\else % marginal info is present - \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi -\dimen@=\dp#1\relax \unvbox#1\relax -\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi -\ifr@ggedbottom \kern-\dimen@ \vfil \fi} -} - -% Here are the rules for the cropmarks. Note that they are -% offset so that the space between them is truly \outerhsize or \outervsize -% (P. A. MacKay, 12 November, 1986) -% -\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} -\def\nstop{\vbox - {\hrule height\cornerthick depth\cornerlong width\cornerthick}} -\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} -\def\nsbot{\vbox - {\hrule height\cornerlong depth\cornerthick width\cornerthick}} - -% Parse an argument, then pass it to #1. The argument is the rest of -% the input line (except we remove a trailing comment). #1 should be a -% macro which expects an ordinary undelimited TeX argument. -% -\def\parsearg{\parseargusing{}} -\def\parseargusing#1#2{% - \def\argtorun{#2}% - \begingroup - \obeylines - \spaceisspace - #1% - \parseargline\empty% Insert the \empty token, see \finishparsearg below. -} - -{\obeylines % - \gdef\parseargline#1^^M{% - \endgroup % End of the group started in \parsearg. - \argremovecomment #1\comment\ArgTerm% - }% -} - -% First remove any @comment, then any @c comment. -\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} -\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} - -% Each occurrence of `\^^M' or `\^^M' is replaced by a single space. -% -% \argremovec might leave us with trailing space, e.g., -% @end itemize @c foo -% This space token undergoes the same procedure and is eventually removed -% by \finishparsearg. -% -\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} -\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} -\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% - \def\temp{#3}% - \ifx\temp\empty - % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: - \let\temp\finishparsearg - \else - \let\temp\argcheckspaces - \fi - % Put the space token in: - \temp#1 #3\ArgTerm -} - -% If a _delimited_ argument is enclosed in braces, they get stripped; so -% to get _exactly_ the rest of the line, we had to prevent such situation. -% We prepended an \empty token at the very beginning and we expand it now, -% just before passing the control to \argtorun. -% (Similarly, we have to think about #3 of \argcheckspacesY above: it is -% either the null string, or it ends with \^^M---thus there is no danger -% that a pair of braces would be stripped. -% -% But first, we have to remove the trailing space token. -% -\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} - -% \parseargdef\foo{...} -% is roughly equivalent to -% \def\foo{\parsearg\Xfoo} -% \def\Xfoo#1{...} -% -% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my -% favourite TeX trick. --kasal, 16nov03 - -\def\parseargdef#1{% - \expandafter \doparseargdef \csname\string#1\endcsname #1% -} -\def\doparseargdef#1#2{% - \def#2{\parsearg#1}% - \def#1##1% -} - -% Several utility definitions with active space: -{ - \obeyspaces - \gdef\obeyedspace{ } - - % Make each space character in the input produce a normal interword - % space in the output. Don't allow a line break at this space, as this - % is used only in environments like @example, where each line of input - % should produce a line of output anyway. - % - \gdef\sepspaces{\obeyspaces\let =\tie} - - % If an index command is used in an @example environment, any spaces - % therein should become regular spaces in the raw index file, not the - % expansion of \tie (\leavevmode \penalty \@M \ ). - \gdef\unsepspaces{\let =\space} -} - - -\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} - -% Define the framework for environments in texinfo.tex. It's used like this: -% -% \envdef\foo{...} -% \def\Efoo{...} -% -% It's the responsibility of \envdef to insert \begingroup before the -% actual body; @end closes the group after calling \Efoo. \envdef also -% defines \thisenv, so the current environment is known; @end checks -% whether the environment name matches. The \checkenv macro can also be -% used to check whether the current environment is the one expected. -% -% Non-false conditionals (@iftex, @ifset) don't fit into this, so they -% are not treated as environments; they don't open a group. (The -% implementation of @end takes care not to call \endgroup in this -% special case.) - - -% At run-time, environments start with this: -\def\startenvironment#1{\begingroup\def\thisenv{#1}} -% initialize -\let\thisenv\empty - -% ... but they get defined via ``\envdef\foo{...}'': -\long\def\envdef#1#2{\def#1{\startenvironment#1#2}} -\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} - -% Check whether we're in the right environment: -\def\checkenv#1{% - \def\temp{#1}% - \ifx\thisenv\temp - \else - \badenverr - \fi -} - -% Environment mismatch, #1 expected: -\def\badenverr{% - \errhelp = \EMsimple - \errmessage{This command can appear only \inenvironment\temp, - not \inenvironment\thisenv}% -} -\def\inenvironment#1{% - \ifx#1\empty - out of any environment% - \else - in environment \expandafter\string#1% - \fi -} - -% @end foo executes the definition of \Efoo. -% But first, it executes a specialized version of \checkenv -% -\parseargdef\end{% - \if 1\csname iscond.#1\endcsname - \else - % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03 - \expandafter\checkenv\csname#1\endcsname - \csname E#1\endcsname - \endgroup - \fi -} - -\newhelp\EMsimple{Press RETURN to continue.} - - -%% Simple single-character @ commands - -% @@ prints an @ -% Kludge this until the fonts are right (grr). -\def\@{{\tt\char64}} - -% This is turned off because it was never documented -% and you can use @w{...} around a quote to suppress ligatures. -%% Define @` and @' to be the same as ` and ' -%% but suppressing ligatures. -%\def\`{{`}} -%\def\'{{'}} - -% Used to generate quoted braces. -\def\mylbrace {{\tt\char123}} -\def\myrbrace {{\tt\char125}} -\let\{=\mylbrace -\let\}=\myrbrace -\begingroup - % Definitions to produce \{ and \} commands for indices, - % and @{ and @} for the aux/toc files. - \catcode`\{ = \other \catcode`\} = \other - \catcode`\[ = 1 \catcode`\] = 2 - \catcode`\! = 0 \catcode`\\ = \other - !gdef!lbracecmd[\{]% - !gdef!rbracecmd[\}]% - !gdef!lbraceatcmd[@{]% - !gdef!rbraceatcmd[@}]% -!endgroup - -% @comma{} to avoid , parsing problems. -\let\comma = , - -% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent -% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. -\let\, = \c -\let\dotaccent = \. -\def\ringaccent#1{{\accent23 #1}} -\let\tieaccent = \t -\let\ubaraccent = \b -\let\udotaccent = \d - -% Other special characters: @questiondown @exclamdown @ordf @ordm -% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. -\def\questiondown{?`} -\def\exclamdown{!`} -\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} -\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} - -% Dotless i and dotless j, used for accents. -\def\imacro{i} -\def\jmacro{j} -\def\dotless#1{% - \def\temp{#1}% - \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi - \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi - \else \errmessage{@dotless can be used only with i or j}% - \fi\fi -} - -% The \TeX{} logo, as in plain, but resetting the spacing so that a -% period following counts as ending a sentence. (Idea found in latex.) -% -\edef\TeX{\TeX \spacefactor=1000 } - -% @LaTeX{} logo. Not quite the same results as the definition in -% latex.ltx, since we use a different font for the raised A; it's most -% convenient for us to use an explicitly smaller font, rather than using -% the \scriptstyle font (since we don't reset \scriptstyle and -% \scriptscriptstyle). -% -\def\LaTeX{% - L\kern-.36em - {\setbox0=\hbox{T}% - \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}% - \kern-.15em - \TeX -} - -% Be sure we're in horizontal mode when doing a tie, since we make space -% equivalent to this in @example-like environments. Otherwise, a space -% at the beginning of a line will start with \penalty -- and -% since \penalty is valid in vertical mode, we'd end up putting the -% penalty on the vertical list instead of in the new paragraph. -{\catcode`@ = 11 - % Avoid using \@M directly, because that causes trouble - % if the definition is written into an index file. - \global\let\tiepenalty = \@M - \gdef\tie{\leavevmode\penalty\tiepenalty\ } -} - -% @: forces normal size whitespace following. -\def\:{\spacefactor=1000 } - -% @* forces a line break. -\def\*{\hfil\break\hbox{}\ignorespaces} - -% @/ allows a line break. -\let\/=\allowbreak - -% @. is an end-of-sentence period. -\def\.{.\spacefactor=\endofsentencespacefactor\space} - -% @! is an end-of-sentence bang. -\def\!{!\spacefactor=\endofsentencespacefactor\space} - -% @? is an end-of-sentence query. -\def\?{?\spacefactor=\endofsentencespacefactor\space} - -% @frenchspacing on|off says whether to put extra space after punctuation. -% -\def\onword{on} -\def\offword{off} -% -\parseargdef\frenchspacing{% - \def\temp{#1}% - \ifx\temp\onword \plainfrenchspacing - \else\ifx\temp\offword \plainnonfrenchspacing - \else - \errhelp = \EMsimple - \errmessage{Unknown @frenchspacing option `\temp', must be on/off}% - \fi\fi -} - -% @w prevents a word break. Without the \leavevmode, @w at the -% beginning of a paragraph, when TeX is still in vertical mode, would -% produce a whole line of output instead of starting the paragraph. -\def\w#1{\leavevmode\hbox{#1}} - -% @group ... @end group forces ... to be all on one page, by enclosing -% it in a TeX vbox. We use \vtop instead of \vbox to construct the box -% to keep its height that of a normal line. According to the rules for -% \topskip (p.114 of the TeXbook), the glue inserted is -% max (\topskip - \ht (first item), 0). If that height is large, -% therefore, no glue is inserted, and the space between the headline and -% the text is small, which looks bad. -% -% Another complication is that the group might be very large. This can -% cause the glue on the previous page to be unduly stretched, because it -% does not have much material. In this case, it's better to add an -% explicit \vfill so that the extra space is at the bottom. The -% threshold for doing this is if the group is more than \vfilllimit -% percent of a page (\vfilllimit can be changed inside of @tex). -% -\newbox\groupbox -\def\vfilllimit{0.7} -% -\envdef\group{% - \ifnum\catcode`\^^M=\active \else - \errhelp = \groupinvalidhelp - \errmessage{@group invalid in context where filling is enabled}% - \fi - \startsavinginserts - % - \setbox\groupbox = \vtop\bgroup - % Do @comment since we are called inside an environment such as - % @example, where each end-of-line in the input causes an - % end-of-line in the output. We don't want the end-of-line after - % the `@group' to put extra space in the output. Since @group - % should appear on a line by itself (according to the Texinfo - % manual), we don't worry about eating any user text. - \comment -} -% -% The \vtop produces a box with normal height and large depth; thus, TeX puts -% \baselineskip glue before it, and (when the next line of text is done) -% \lineskip glue after it. Thus, space below is not quite equal to space -% above. But it's pretty close. -\def\Egroup{% - % To get correct interline space between the last line of the group - % and the first line afterwards, we have to propagate \prevdepth. - \endgraf % Not \par, as it may have been set to \lisppar. - \global\dimen1 = \prevdepth - \egroup % End the \vtop. - % \dimen0 is the vertical size of the group's box. - \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox - % \dimen2 is how much space is left on the page (more or less). - \dimen2 = \pageheight \advance\dimen2 by -\pagetotal - % if the group doesn't fit on the current page, and it's a big big - % group, force a page break. - \ifdim \dimen0 > \dimen2 - \ifdim \pagetotal < \vfilllimit\pageheight - \page - \fi - \fi - \box\groupbox - \prevdepth = \dimen1 - \checkinserts -} -% -% TeX puts in an \escapechar (i.e., `@') at the beginning of the help -% message, so this ends up printing `@group can only ...'. -% -\newhelp\groupinvalidhelp{% -group can only be used in environments such as @example,^^J% -where each line of input produces a line of output.} - -% @need space-in-mils -% forces a page break if there is not space-in-mils remaining. - -\newdimen\mil \mil=0.001in - -% Old definition--didn't work. -%\parseargdef\need{\par % -%% This method tries to make TeX break the page naturally -%% if the depth of the box does not fit. -%{\baselineskip=0pt% -%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak -%\prevdepth=-1000pt -%}} - -\parseargdef\need{% - % Ensure vertical mode, so we don't make a big box in the middle of a - % paragraph. - \par - % - % If the @need value is less than one line space, it's useless. - \dimen0 = #1\mil - \dimen2 = \ht\strutbox - \advance\dimen2 by \dp\strutbox - \ifdim\dimen0 > \dimen2 - % - % Do a \strut just to make the height of this box be normal, so the - % normal leading is inserted relative to the preceding line. - % And a page break here is fine. - \vtop to #1\mil{\strut\vfil}% - % - % TeX does not even consider page breaks if a penalty added to the - % main vertical list is 10000 or more. But in order to see if the - % empty box we just added fits on the page, we must make it consider - % page breaks. On the other hand, we don't want to actually break the - % page after the empty box. So we use a penalty of 9999. - % - % There is an extremely small chance that TeX will actually break the - % page at this \penalty, if there are no other feasible breakpoints in - % sight. (If the user is using lots of big @group commands, which - % almost-but-not-quite fill up a page, TeX will have a hard time doing - % good page breaking, for example.) However, I could not construct an - % example where a page broke at this \penalty; if it happens in a real - % document, then we can reconsider our strategy. - \penalty9999 - % - % Back up by the size of the box, whether we did a page break or not. - \kern -#1\mil - % - % Do not allow a page break right after this kern. - \nobreak - \fi -} - -% @br forces paragraph break (and is undocumented). - -\let\br = \par - -% @page forces the start of a new page. -% -\def\page{\par\vfill\supereject} - -% @exdent text.... -% outputs text on separate line in roman font, starting at standard page margin - -% This records the amount of indent in the innermost environment. -% That's how much \exdent should take out. -\newskip\exdentamount - -% This defn is used inside fill environments such as @defun. -\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} - -% This defn is used inside nofill environments such as @example. -\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount - \leftline{\hskip\leftskip{\rm#1}}}} - -% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current -% paragraph. For more general purposes, use the \margin insertion -% class. WHICH is `l' or `r'. -% -\newskip\inmarginspacing \inmarginspacing=1cm -\def\strutdepth{\dp\strutbox} -% -\def\doinmargin#1#2{\strut\vadjust{% - \nobreak - \kern-\strutdepth - \vtop to \strutdepth{% - \baselineskip=\strutdepth - \vss - % if you have multiple lines of stuff to put here, you'll need to - % make the vbox yourself of the appropriate size. - \ifx#1l% - \llap{\ignorespaces #2\hskip\inmarginspacing}% - \else - \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% - \fi - \null - }% -}} -\def\inleftmargin{\doinmargin l} -\def\inrightmargin{\doinmargin r} -% -% @inmargin{TEXT [, RIGHT-TEXT]} -% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; -% else use TEXT for both). -% -\def\inmargin#1{\parseinmargin #1,,\finish} -\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. - \setbox0 = \hbox{\ignorespaces #2}% - \ifdim\wd0 > 0pt - \def\lefttext{#1}% have both texts - \def\righttext{#2}% - \else - \def\lefttext{#1}% have only one text - \def\righttext{#1}% - \fi - % - \ifodd\pageno - \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin - \else - \def\temp{\inleftmargin\lefttext}% - \fi - \temp -} - -% @include FILE -- \input text of FILE. -% -\def\include{\parseargusing\filenamecatcodes\includezzz} -\def\includezzz#1{% - \pushthisfilestack - \def\thisfile{#1}% - {% - \makevalueexpandable % we want to expand any @value in FILE. - \turnoffactive % and allow special characters in the expansion - \indexnofonts % Allow `@@' and other weird things in file names. - \edef\temp{\noexpand\input #1 }% - % - % This trickery is to read FILE outside of a group, in case it makes - % definitions, etc. - \expandafter - }\temp - \popthisfilestack -} -\def\filenamecatcodes{% - \catcode`\\=\other - \catcode`~=\other - \catcode`^=\other - \catcode`_=\other - \catcode`|=\other - \catcode`<=\other - \catcode`>=\other - \catcode`+=\other - \catcode`-=\other - \catcode`\`=\other - \catcode`\'=\other -} - -\def\pushthisfilestack{% - \expandafter\pushthisfilestackX\popthisfilestack\StackTerm -} -\def\pushthisfilestackX{% - \expandafter\pushthisfilestackY\thisfile\StackTerm -} -\def\pushthisfilestackY #1\StackTerm #2\StackTerm {% - \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% -} - -\def\popthisfilestack{\errthisfilestackempty} -\def\errthisfilestackempty{\errmessage{Internal error: - the stack of filenames is empty.}} - -\def\thisfile{} - -% @center line -% outputs that line, centered. -% -\parseargdef\center{% - \ifhmode - \let\next\centerH - \else - \let\next\centerV - \fi - \next{\hfil \ignorespaces#1\unskip \hfil}% -} -\def\centerH#1{% - {% - \hfil\break - \advance\hsize by -\leftskip - \advance\hsize by -\rightskip - \line{#1}% - \break - }% -} -\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}} - -% @sp n outputs n lines of vertical space - -\parseargdef\sp{\vskip #1\baselineskip} - -% @comment ...line which is ignored... -% @c is the same as @comment -% @ignore ... @end ignore is another way to write a comment - -\def\comment{\begingroup \catcode`\^^M=\other% -\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% -\commentxxx} -{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} - -\let\c=\comment - -% @paragraphindent NCHARS -% We'll use ems for NCHARS, close enough. -% NCHARS can also be the word `asis' or `none'. -% We cannot feasibly implement @paragraphindent asis, though. -% -\def\asisword{asis} % no translation, these are keywords -\def\noneword{none} -% -\parseargdef\paragraphindent{% - \def\temp{#1}% - \ifx\temp\asisword - \else - \ifx\temp\noneword - \defaultparindent = 0pt - \else - \defaultparindent = #1em - \fi - \fi - \parindent = \defaultparindent -} - -% @exampleindent NCHARS -% We'll use ems for NCHARS like @paragraphindent. -% It seems @exampleindent asis isn't necessary, but -% I preserve it to make it similar to @paragraphindent. -\parseargdef\exampleindent{% - \def\temp{#1}% - \ifx\temp\asisword - \else - \ifx\temp\noneword - \lispnarrowing = 0pt - \else - \lispnarrowing = #1em - \fi - \fi -} - -% @firstparagraphindent WORD -% If WORD is `none', then suppress indentation of the first paragraph -% after a section heading. If WORD is `insert', then do indent at such -% paragraphs. -% -% The paragraph indentation is suppressed or not by calling -% \suppressfirstparagraphindent, which the sectioning commands do. -% We switch the definition of this back and forth according to WORD. -% By default, we suppress indentation. -% -\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} -\def\insertword{insert} -% -\parseargdef\firstparagraphindent{% - \def\temp{#1}% - \ifx\temp\noneword - \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent - \else\ifx\temp\insertword - \let\suppressfirstparagraphindent = \relax - \else - \errhelp = \EMsimple - \errmessage{Unknown @firstparagraphindent option `\temp'}% - \fi\fi -} - -% Here is how we actually suppress indentation. Redefine \everypar to -% \kern backwards by \parindent, and then reset itself to empty. -% -% We also make \indent itself not actually do anything until the next -% paragraph. -% -\gdef\dosuppressfirstparagraphindent{% - \gdef\indent{% - \restorefirstparagraphindent - \indent - }% - \gdef\noindent{% - \restorefirstparagraphindent - \noindent - }% - \global\everypar = {% - \kern -\parindent - \restorefirstparagraphindent - }% -} - -\gdef\restorefirstparagraphindent{% - \global \let \indent = \ptexindent - \global \let \noindent = \ptexnoindent - \global \everypar = {}% -} - - -% @asis just yields its argument. Used with @table, for example. -% -\def\asis#1{#1} - -% @math outputs its argument in math mode. -% -% One complication: _ usually means subscripts, but it could also mean -% an actual _ character, as in @math{@var{some_variable} + 1}. So make -% _ active, and distinguish by seeing if the current family is \slfam, -% which is what @var uses. -{ - \catcode`\_ = \active - \gdef\mathunderscore{% - \catcode`\_=\active - \def_{\ifnum\fam=\slfam \_\else\sb\fi}% - } -} -% Another complication: we want \\ (and @\) to output a \ character. -% FYI, plain.tex uses \\ as a temporary control sequence (why?), but -% this is not advertised and we don't care. Texinfo does not -% otherwise define @\. -% -% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. -\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} -% -\def\math{% - \tex - \mathunderscore - \let\\ = \mathbackslash - \mathactive - % make the texinfo accent commands work in math mode - \let\"=\ddot - \let\'=\acute - \let\==\bar - \let\^=\hat - \let\`=\grave - \let\u=\breve - \let\v=\check - \let\~=\tilde - \let\dotaccent=\dot - $\finishmath -} -\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. - -% Some active characters (such as <) are spaced differently in math. -% We have to reset their definitions in case the @math was an argument -% to a command which sets the catcodes (such as @item or @section). -% -{ - \catcode`^ = \active - \catcode`< = \active - \catcode`> = \active - \catcode`+ = \active - \catcode`' = \active - \gdef\mathactive{% - \let^ = \ptexhat - \let< = \ptexless - \let> = \ptexgtr - \let+ = \ptexplus - \let' = \ptexquoteright - } -} - -% Some math mode symbols. -\def\bullet{$\ptexbullet$} -\def\geq{\ifmmode \ge\else $\ge$\fi} -\def\leq{\ifmmode \le\else $\le$\fi} -\def\minus{\ifmmode -\else $-$\fi} - -% @dots{} outputs an ellipsis using the current font. -% We do .5em per period so that it has the same spacing in the cm -% typewriter fonts as three actual period characters; on the other hand, -% in other typewriter fonts three periods are wider than 1.5em. So do -% whichever is larger. -% -\def\dots{% - \leavevmode - \setbox0=\hbox{...}% get width of three periods - \ifdim\wd0 > 1.5em - \dimen0 = \wd0 - \else - \dimen0 = 1.5em - \fi - \hbox to \dimen0{% - \hskip 0pt plus.25fil - .\hskip 0pt plus1fil - .\hskip 0pt plus1fil - .\hskip 0pt plus.5fil - }% -} - -% @enddots{} is an end-of-sentence ellipsis. -% -\def\enddots{% - \dots - \spacefactor=\endofsentencespacefactor -} - -% @comma{} is so commas can be inserted into text without messing up -% Texinfo's parsing. -% -\let\comma = , - -% @refill is a no-op. -\let\refill=\relax - -% If working on a large document in chapters, it is convenient to -% be able to disable indexing, cross-referencing, and contents, for test runs. -% This is done with @novalidate (before @setfilename). -% -\newif\iflinks \linkstrue % by default we want the aux files. -\let\novalidate = \linksfalse - -% @setfilename is done at the beginning of every texinfo file. -% So open here the files we need to have open while reading the input. -% This makes it possible to make a .fmt file for texinfo. -\def\setfilename{% - \fixbackslash % Turn off hack to swallow `\input texinfo'. - \iflinks - \tryauxfile - % Open the new aux file. TeX will close it automatically at exit. - \immediate\openout\auxfile=\jobname.aux - \fi % \openindices needs to do some work in any case. - \openindices - \let\setfilename=\comment % Ignore extra @setfilename cmds. - % - % If texinfo.cnf is present on the system, read it. - % Useful for site-wide @afourpaper, etc. - \openin 1 texinfo.cnf - \ifeof 1 \else \input texinfo.cnf \fi - \closein 1 - % - \comment % Ignore the actual filename. -} - -% Called from \setfilename. -% -\def\openindices{% - \newindex{cp}% - \newcodeindex{fn}% - \newcodeindex{vr}% - \newcodeindex{tp}% - \newcodeindex{ky}% - \newcodeindex{pg}% -} - -% @bye. -\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} - - -\message{pdf,} -% adobe `portable' document format -\newcount\tempnum -\newcount\lnkcount -\newtoks\filename -\newcount\filenamelength -\newcount\pgn -\newtoks\toksA -\newtoks\toksB -\newtoks\toksC -\newtoks\toksD -\newbox\boxA -\newcount\countA -\newif\ifpdf -\newif\ifpdfmakepagedest - -% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 -% can be set). So we test for \relax and 0 as well as \undefined, -% borrowed from ifpdf.sty. -\ifx\pdfoutput\undefined -\else - \ifx\pdfoutput\relax - \else - \ifcase\pdfoutput - \else - \pdftrue - \fi - \fi -\fi - -% PDF uses PostScript string constants for the names of xref targets, -% for display in the outlines, and in other places. Thus, we have to -% double any backslashes. Otherwise, a name like "\node" will be -% interpreted as a newline (\n), followed by o, d, e. Not good. -% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html -% (and related messages, the final outcome is that it is up to the TeX -% user to double the backslashes and otherwise make the string valid, so -% that's what we do). - -% double active backslashes. -% -{\catcode`\@=0 \catcode`\\=\active - @gdef@activebackslashdouble{% - @catcode`@\=@active - @let\=@doublebackslash} -} - -% To handle parens, we must adopt a different approach, since parens are -% not active characters. hyperref.dtx (which has the same problem as -% us) handles it with this amazing macro to replace tokens, with minor -% changes for Texinfo. It is included here under the GPL by permission -% from the author, Heiko Oberdiek. -% -% #1 is the tokens to replace. -% #2 is the replacement. -% #3 is the control sequence with the string. -% -\def\HyPsdSubst#1#2#3{% - \def\HyPsdReplace##1#1##2\END{% - ##1% - \ifx\\##2\\% - \else - #2% - \HyReturnAfterFi{% - \HyPsdReplace##2\END - }% - \fi - }% - \xdef#3{\expandafter\HyPsdReplace#3#1\END}% -} -\long\def\HyReturnAfterFi#1\fi{\fi#1} - -% #1 is a control sequence in which to do the replacements. -\def\backslashparens#1{% - \xdef#1{#1}% redefine it as its expansion; the definition is simply - % \lastnode when called from \setref -> \pdfmkdest. - \HyPsdSubst{(}{\realbackslash(}{#1}% - \HyPsdSubst{)}{\realbackslash)}{#1}% -} - -\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images -with PDF output, and none of those formats could be found. (.eps cannot -be supported due to the design of the PDF format; use regular TeX (DVI -output) for that.)} - -\ifpdf - % - % Color manipulation macros based on pdfcolor.tex, - % except using rgb instead of cmyk; the latter is said to render as a - % very dark gray on-screen and a very dark halftone in print, instead - % of actual black. - \def\rgbDarkRed{0.50 0.09 0.12} - \def\rgbBlack{0 0 0} - % - % k sets the color for filling (usual text, etc.); - % K sets the color for stroking (thin rules, e.g., normal _'s). - \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} - % - % Set color, and create a mark which defines \thiscolor accordingly, - % so that \makeheadline knows which color to restore. - \def\setcolor#1{% - \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% - \domark - \pdfsetcolor{#1}% - } - % - \def\maincolor{\rgbBlack} - \pdfsetcolor{\maincolor} - \edef\thiscolor{\maincolor} - \def\lastcolordefs{} - % - \def\makefootline{% - \baselineskip24pt - \line{\pdfsetcolor{\maincolor}\the\footline}% - } - % - \def\makeheadline{% - \vbox to 0pt{% - \vskip-22.5pt - \line{% - \vbox to8.5pt{}% - % Extract \thiscolor definition from the marks. - \getcolormarks - % Typeset the headline with \maincolor, then restore the color. - \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% - }% - \vss - }% - \nointerlineskip - } - % - % - \pdfcatalog{/PageMode /UseOutlines} - % - % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). - \def\dopdfimage#1#2#3{% - \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% - \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% - % - % pdftex (and the PDF format) support .png, .jpg, .pdf (among - % others). Let's try in that order. - \let\pdfimgext=\empty - \begingroup - \openin 1 #1.png \ifeof 1 - \openin 1 #1.jpg \ifeof 1 - \openin 1 #1.jpeg \ifeof 1 - \openin 1 #1.JPG \ifeof 1 - \openin 1 #1.pdf \ifeof 1 - \openin 1 #1.PDF \ifeof 1 - \errhelp = \nopdfimagehelp - \errmessage{Could not find image file #1 for pdf}% - \else \gdef\pdfimgext{PDF}% - \fi - \else \gdef\pdfimgext{pdf}% - \fi - \else \gdef\pdfimgext{JPG}% - \fi - \else \gdef\pdfimgext{jpeg}% - \fi - \else \gdef\pdfimgext{jpg}% - \fi - \else \gdef\pdfimgext{png}% - \fi - \closein 1 - \endgroup - % - % without \immediate, ancient pdftex seg faults when the same image is - % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) - \ifnum\pdftexversion < 14 - \immediate\pdfimage - \else - \immediate\pdfximage - \fi - \ifdim \wd0 >0pt width \imagewidth \fi - \ifdim \wd2 >0pt height \imageheight \fi - \ifnum\pdftexversion<13 - #1.\pdfimgext - \else - {#1.\pdfimgext}% - \fi - \ifnum\pdftexversion < 14 \else - \pdfrefximage \pdflastximage - \fi} - % - \def\pdfmkdest#1{{% - % We have to set dummies so commands such as @code, and characters - % such as \, aren't expanded when present in a section title. - \indexnofonts - \turnoffactive - \activebackslashdouble - \makevalueexpandable - \def\pdfdestname{#1}% - \backslashparens\pdfdestname - \safewhatsit{\pdfdest name{\pdfdestname} xyz}% - }} - % - % used to mark target names; must be expandable. - \def\pdfmkpgn#1{#1} - % - % by default, use a color that is dark enough to print on paper as - % nearly black, but still distinguishable for online viewing. - \def\urlcolor{\rgbDarkRed} - \def\linkcolor{\rgbDarkRed} - \def\endlink{\setcolor{\maincolor}\pdfendlink} - % - % Adding outlines to PDF; macros for calculating structure of outlines - % come from Petr Olsak - \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% - \else \csname#1\endcsname \fi} - \def\advancenumber#1{\tempnum=\expnumber{#1}\relax - \advance\tempnum by 1 - \expandafter\xdef\csname#1\endcsname{\the\tempnum}} - % - % #1 is the section text, which is what will be displayed in the - % outline by the pdf viewer. #2 is the pdf expression for the number - % of subentries (or empty, for subsubsections). #3 is the node text, - % which might be empty if this toc entry had no corresponding node. - % #4 is the page number - % - \def\dopdfoutline#1#2#3#4{% - % Generate a link to the node text if that exists; else, use the - % page number. We could generate a destination for the section - % text in the case where a section has no node, but it doesn't - % seem worth the trouble, since most documents are normally structured. - \def\pdfoutlinedest{#3}% - \ifx\pdfoutlinedest\empty - \def\pdfoutlinedest{#4}% - \else - % Doubled backslashes in the name. - {\activebackslashdouble \xdef\pdfoutlinedest{#3}% - \backslashparens\pdfoutlinedest}% - \fi - % - % Also double the backslashes in the display string. - {\activebackslashdouble \xdef\pdfoutlinetext{#1}% - \backslashparens\pdfoutlinetext}% - % - \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% - } - % - \def\pdfmakeoutlines{% - \begingroup - % Thanh's hack / proper braces in bookmarks - \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace - \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace - % - % Read toc silently, to get counts of subentries for \pdfoutline. - \def\numchapentry##1##2##3##4{% - \def\thischapnum{##2}% - \def\thissecnum{0}% - \def\thissubsecnum{0}% - }% - \def\numsecentry##1##2##3##4{% - \advancenumber{chap\thischapnum}% - \def\thissecnum{##2}% - \def\thissubsecnum{0}% - }% - \def\numsubsecentry##1##2##3##4{% - \advancenumber{sec\thissecnum}% - \def\thissubsecnum{##2}% - }% - \def\numsubsubsecentry##1##2##3##4{% - \advancenumber{subsec\thissubsecnum}% - }% - \def\thischapnum{0}% - \def\thissecnum{0}% - \def\thissubsecnum{0}% - % - % use \def rather than \let here because we redefine \chapentry et - % al. a second time, below. - \def\appentry{\numchapentry}% - \def\appsecentry{\numsecentry}% - \def\appsubsecentry{\numsubsecentry}% - \def\appsubsubsecentry{\numsubsubsecentry}% - \def\unnchapentry{\numchapentry}% - \def\unnsecentry{\numsecentry}% - \def\unnsubsecentry{\numsubsecentry}% - \def\unnsubsubsecentry{\numsubsubsecentry}% - \readdatafile{toc}% - % - % Read toc second time, this time actually producing the outlines. - % The `-' means take the \expnumber as the absolute number of - % subentries, which we calculated on our first read of the .toc above. - % - % We use the node names as the destinations. - \def\numchapentry##1##2##3##4{% - \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% - \def\numsecentry##1##2##3##4{% - \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% - \def\numsubsecentry##1##2##3##4{% - \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% - \def\numsubsubsecentry##1##2##3##4{% count is always zero - \dopdfoutline{##1}{}{##3}{##4}}% - % - % PDF outlines are displayed using system fonts, instead of - % document fonts. Therefore we cannot use special characters, - % since the encoding is unknown. For example, the eogonek from - % Latin 2 (0xea) gets translated to a | character. Info from - % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. - % - % xx to do this right, we have to translate 8-bit characters to - % their "best" equivalent, based on the @documentencoding. Right - % now, I guess we'll just let the pdf reader have its way. - \indexnofonts - \setupdatafile - \catcode`\\=\active \otherbackslash - \input \tocreadfilename - \endgroup - } - % - \def\skipspaces#1{\def\PP{#1}\def\D{|}% - \ifx\PP\D\let\nextsp\relax - \else\let\nextsp\skipspaces - \ifx\p\space\else\addtokens{\filename}{\PP}% - \advance\filenamelength by 1 - \fi - \fi - \nextsp} - \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} - \ifnum\pdftexversion < 14 - \let \startlink \pdfannotlink - \else - \let \startlink \pdfstartlink - \fi - % make a live url in pdf output. - \def\pdfurl#1{% - \begingroup - % it seems we really need yet another set of dummies; have not - % tried to figure out what each command should do in the context - % of @url. for now, just make @/ a no-op, that's the only one - % people have actually reported a problem with. - % - \normalturnoffactive - \def\@{@}% - \let\/=\empty - \makevalueexpandable - % do we want to go so far as to use \indexnofonts instead of just - % special-casing \var here? - \def\var##1{##1}% - % - \leavevmode\setcolor{\urlcolor}% - \startlink attr{/Border [0 0 0]}% - user{/Subtype /Link /A << /S /URI /URI (#1) >>}% - \endgroup} - \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} - \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} - \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} - \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} - \def\maketoks{% - \expandafter\poptoks\the\toksA|ENDTOKS|\relax - \ifx\first0\adn0 - \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 - \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 - \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 - \else - \ifnum0=\countA\else\makelink\fi - \ifx\first.\let\next=\done\else - \let\next=\maketoks - \addtokens{\toksB}{\the\toksD} - \ifx\first,\addtokens{\toksB}{\space}\fi - \fi - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \next} - \def\makelink{\addtokens{\toksB}% - {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} - \def\pdflink#1{% - \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} - \setcolor{\linkcolor}#1\endlink} - \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} -\else - % non-pdf mode - \let\pdfmkdest = \gobble - \let\pdfurl = \gobble - \let\endlink = \relax - \let\setcolor = \gobble - \let\pdfsetcolor = \gobble - \let\pdfmakeoutlines = \relax -\fi % \ifx\pdfoutput - - -\message{fonts,} - -% Change the current font style to #1, remembering it in \curfontstyle. -% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in -% italics, not bold italics. -% -\def\setfontstyle#1{% - \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. - \csname ten#1\endcsname % change the current font -} - -% Select #1 fonts with the current style. -% -\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} - -\def\rm{\fam=0 \setfontstyle{rm}} -\def\it{\fam=\itfam \setfontstyle{it}} -\def\sl{\fam=\slfam \setfontstyle{sl}} -\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} -\def\tt{\fam=\ttfam \setfontstyle{tt}} - -% Unfortunately, we have to override this for titles and the like, since -% in those cases "rm" is bold. Sigh. -\def\rmisbold{\rm\def\curfontstyle{bf}} - -% Texinfo sort of supports the sans serif font style, which plain TeX does not. -% So we set up a \sf. -\newfam\sffam -\def\sf{\fam=\sffam \setfontstyle{sf}} -\let\li = \sf % Sometimes we call it \li, not \sf. - -% We don't need math for this font style. -\def\ttsl{\setfontstyle{ttsl}} - - -% Default leading. -\newdimen\textleading \textleading = 13.2pt - -% Set the baselineskip to #1, and the lineskip and strut size -% correspondingly. There is no deep meaning behind these magic numbers -% used as factors; they just match (closely enough) what Knuth defined. -% -\def\lineskipfactor{.08333} -\def\strutheightpercent{.70833} -\def\strutdepthpercent {.29167} -% -% can get a sort of poor man's double spacing by redefining this. -\def\baselinefactor{1} -% -\def\setleading#1{% - \dimen0 = #1\relax - \normalbaselineskip = \baselinefactor\dimen0 - \normallineskip = \lineskipfactor\normalbaselineskip - \normalbaselines - \setbox\strutbox =\hbox{% - \vrule width0pt height\strutheightpercent\baselineskip - depth \strutdepthpercent \baselineskip - }% -} - -% PDF CMaps. See also LaTeX's t1.cmap. -% -% do nothing with this by default. -\expandafter\let\csname cmapOT1\endcsname\gobble -\expandafter\let\csname cmapOT1IT\endcsname\gobble -\expandafter\let\csname cmapOT1TT\endcsname\gobble - -% if we are producing pdf, and we have \pdffontattr, then define cmaps. -% (\pdffontattr was introduced many years ago, but people still run -% older pdftex's; it's easy to conditionalize, so we do.) -\ifpdf \ifx\pdffontattr\undefined \else - \begingroup - \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. - \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap -%%DocumentNeededResources: ProcSet (CIDInit) -%%IncludeResource: ProcSet (CIDInit) -%%BeginResource: CMap (TeX-OT1-0) -%%Title: (TeX-OT1-0 TeX OT1 0) -%%Version: 1.000 -%%EndComments -/CIDInit /ProcSet findresource begin -12 dict begin -begincmap -/CIDSystemInfo -<< /Registry (TeX) -/Ordering (OT1) -/Supplement 0 ->> def -/CMapName /TeX-OT1-0 def -/CMapType 2 def -1 begincodespacerange -<00> <7F> -endcodespacerange -8 beginbfrange -<00> <01> <0393> -<09> <0A> <03A8> -<23> <26> <0023> -<28> <3B> <0028> -<3F> <5B> <003F> -<5D> <5E> <005D> -<61> <7A> <0061> -<7B> <7C> <2013> -endbfrange -40 beginbfchar -<02> <0398> -<03> <039B> -<04> <039E> -<05> <03A0> -<06> <03A3> -<07> <03D2> -<08> <03A6> -<0B> <00660066> -<0C> <00660069> -<0D> <0066006C> -<0E> <006600660069> -<0F> <00660066006C> -<10> <0131> -<11> <0237> -<12> <0060> -<13> <00B4> -<14> <02C7> -<15> <02D8> -<16> <00AF> -<17> <02DA> -<18> <00B8> -<19> <00DF> -<1A> <00E6> -<1B> <0153> -<1C> <00F8> -<1D> <00C6> -<1E> <0152> -<1F> <00D8> -<21> <0021> -<22> <201D> -<27> <2019> -<3C> <00A1> -<3D> <003D> -<3E> <00BF> -<5C> <201C> -<5F> <02D9> -<60> <2018> -<7D> <02DD> -<7E> <007E> -<7F> <00A8> -endbfchar -endcmap -CMapName currentdict /CMap defineresource pop -end -end -%%EndResource -%%EOF - }\endgroup - \expandafter\edef\csname cmapOT1\endcsname#1{% - \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% - }% -% -% \cmapOT1IT - \begingroup - \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. - \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap -%%DocumentNeededResources: ProcSet (CIDInit) -%%IncludeResource: ProcSet (CIDInit) -%%BeginResource: CMap (TeX-OT1IT-0) -%%Title: (TeX-OT1IT-0 TeX OT1IT 0) -%%Version: 1.000 -%%EndComments -/CIDInit /ProcSet findresource begin -12 dict begin -begincmap -/CIDSystemInfo -<< /Registry (TeX) -/Ordering (OT1IT) -/Supplement 0 ->> def -/CMapName /TeX-OT1IT-0 def -/CMapType 2 def -1 begincodespacerange -<00> <7F> -endcodespacerange -8 beginbfrange -<00> <01> <0393> -<09> <0A> <03A8> -<25> <26> <0025> -<28> <3B> <0028> -<3F> <5B> <003F> -<5D> <5E> <005D> -<61> <7A> <0061> -<7B> <7C> <2013> -endbfrange -42 beginbfchar -<02> <0398> -<03> <039B> -<04> <039E> -<05> <03A0> -<06> <03A3> -<07> <03D2> -<08> <03A6> -<0B> <00660066> -<0C> <00660069> -<0D> <0066006C> -<0E> <006600660069> -<0F> <00660066006C> -<10> <0131> -<11> <0237> -<12> <0060> -<13> <00B4> -<14> <02C7> -<15> <02D8> -<16> <00AF> -<17> <02DA> -<18> <00B8> -<19> <00DF> -<1A> <00E6> -<1B> <0153> -<1C> <00F8> -<1D> <00C6> -<1E> <0152> -<1F> <00D8> -<21> <0021> -<22> <201D> -<23> <0023> -<24> <00A3> -<27> <2019> -<3C> <00A1> -<3D> <003D> -<3E> <00BF> -<5C> <201C> -<5F> <02D9> -<60> <2018> -<7D> <02DD> -<7E> <007E> -<7F> <00A8> -endbfchar -endcmap -CMapName currentdict /CMap defineresource pop -end -end -%%EndResource -%%EOF - }\endgroup - \expandafter\edef\csname cmapOT1IT\endcsname#1{% - \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% - }% -% -% \cmapOT1TT - \begingroup - \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. - \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap -%%DocumentNeededResources: ProcSet (CIDInit) -%%IncludeResource: ProcSet (CIDInit) -%%BeginResource: CMap (TeX-OT1TT-0) -%%Title: (TeX-OT1TT-0 TeX OT1TT 0) -%%Version: 1.000 -%%EndComments -/CIDInit /ProcSet findresource begin -12 dict begin -begincmap -/CIDSystemInfo -<< /Registry (TeX) -/Ordering (OT1TT) -/Supplement 0 ->> def -/CMapName /TeX-OT1TT-0 def -/CMapType 2 def -1 begincodespacerange -<00> <7F> -endcodespacerange -5 beginbfrange -<00> <01> <0393> -<09> <0A> <03A8> -<21> <26> <0021> -<28> <5F> <0028> -<61> <7E> <0061> -endbfrange -32 beginbfchar -<02> <0398> -<03> <039B> -<04> <039E> -<05> <03A0> -<06> <03A3> -<07> <03D2> -<08> <03A6> -<0B> <2191> -<0C> <2193> -<0D> <0027> -<0E> <00A1> -<0F> <00BF> -<10> <0131> -<11> <0237> -<12> <0060> -<13> <00B4> -<14> <02C7> -<15> <02D8> -<16> <00AF> -<17> <02DA> -<18> <00B8> -<19> <00DF> -<1A> <00E6> -<1B> <0153> -<1C> <00F8> -<1D> <00C6> -<1E> <0152> -<1F> <00D8> -<20> <2423> -<27> <2019> -<60> <2018> -<7F> <00A8> -endbfchar -endcmap -CMapName currentdict /CMap defineresource pop -end -end -%%EndResource -%%EOF - }\endgroup - \expandafter\edef\csname cmapOT1TT\endcsname#1{% - \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% - }% -\fi\fi - - -% Set the font macro #1 to the font named #2, adding on the -% specified font prefix (normally `cm'). -% #3 is the font's design size, #4 is a scale factor, #5 is the CMap -% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass -% empty to omit). -\def\setfont#1#2#3#4#5{% - \font#1=\fontprefix#2#3 scaled #4 - \csname cmap#5\endcsname#1% -} -% This is what gets called when #5 of \setfont is empty. -\let\cmap\gobble -% emacs-page end of cmaps - -% Use cm as the default font prefix. -% To specify the font prefix, you must define \fontprefix -% before you read in texinfo.tex. -\ifx\fontprefix\undefined -\def\fontprefix{cm} -\fi -% Support font families that don't use the same naming scheme as CM. -\def\rmshape{r} -\def\rmbshape{bx} %where the normal face is bold -\def\bfshape{b} -\def\bxshape{bx} -\def\ttshape{tt} -\def\ttbshape{tt} -\def\ttslshape{sltt} -\def\itshape{ti} -\def\itbshape{bxti} -\def\slshape{sl} -\def\slbshape{bxsl} -\def\sfshape{ss} -\def\sfbshape{ss} -\def\scshape{csc} -\def\scbshape{csc} - -% Definitions for a main text size of 11pt. This is the default in -% Texinfo. -% -\def\definetextfontsizexi{% -% Text fonts (11.2pt, magstep1). -\def\textnominalsize{11pt} -\edef\mainmagstep{\magstephalf} -\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} -\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} -\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} -\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} -\setfont\textsl\slshape{10}{\mainmagstep}{OT1} -\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} -\setfont\textsc\scshape{10}{\mainmagstep}{OT1} -\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} -\font\texti=cmmi10 scaled \mainmagstep -\font\textsy=cmsy10 scaled \mainmagstep -\def\textecsize{1095} - -% A few fonts for @defun names and args. -\setfont\defbf\bfshape{10}{\magstep1}{OT1} -\setfont\deftt\ttshape{10}{\magstep1}{OT1TT} -\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} -\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} - -% Fonts for indices, footnotes, small examples (9pt). -\def\smallnominalsize{9pt} -\setfont\smallrm\rmshape{9}{1000}{OT1} -\setfont\smalltt\ttshape{9}{1000}{OT1TT} -\setfont\smallbf\bfshape{10}{900}{OT1} -\setfont\smallit\itshape{9}{1000}{OT1IT} -\setfont\smallsl\slshape{9}{1000}{OT1} -\setfont\smallsf\sfshape{9}{1000}{OT1} -\setfont\smallsc\scshape{10}{900}{OT1} -\setfont\smallttsl\ttslshape{10}{900}{OT1TT} -\font\smalli=cmmi9 -\font\smallsy=cmsy9 -\def\smallecsize{0900} - -% Fonts for small examples (8pt). -\def\smallernominalsize{8pt} -\setfont\smallerrm\rmshape{8}{1000}{OT1} -\setfont\smallertt\ttshape{8}{1000}{OT1TT} -\setfont\smallerbf\bfshape{10}{800}{OT1} -\setfont\smallerit\itshape{8}{1000}{OT1IT} -\setfont\smallersl\slshape{8}{1000}{OT1} -\setfont\smallersf\sfshape{8}{1000}{OT1} -\setfont\smallersc\scshape{10}{800}{OT1} -\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} -\font\smalleri=cmmi8 -\font\smallersy=cmsy8 -\def\smallerecsize{0800} - -% Fonts for title page (20.4pt): -\def\titlenominalsize{20pt} -\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} -\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} -\setfont\titlesl\slbshape{10}{\magstep4}{OT1} -\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} -\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} -\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} -\let\titlebf=\titlerm -\setfont\titlesc\scbshape{10}{\magstep4}{OT1} -\font\titlei=cmmi12 scaled \magstep3 -\font\titlesy=cmsy10 scaled \magstep4 -\def\titleecsize{2074} - -% Chapter (and unnumbered) fonts (17.28pt). -\def\chapnominalsize{17pt} -\setfont\chaprm\rmbshape{12}{\magstep2}{OT1} -\setfont\chapit\itbshape{10}{\magstep3}{OT1IT} -\setfont\chapsl\slbshape{10}{\magstep3}{OT1} -\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} -\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} -\setfont\chapsf\sfbshape{17}{1000}{OT1} -\let\chapbf=\chaprm -\setfont\chapsc\scbshape{10}{\magstep3}{OT1} -\font\chapi=cmmi12 scaled \magstep2 -\font\chapsy=cmsy10 scaled \magstep3 -\def\chapecsize{1728} - -% Section fonts (14.4pt). -\def\secnominalsize{14pt} -\setfont\secrm\rmbshape{12}{\magstep1}{OT1} -\setfont\secit\itbshape{10}{\magstep2}{OT1IT} -\setfont\secsl\slbshape{10}{\magstep2}{OT1} -\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} -\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} -\setfont\secsf\sfbshape{12}{\magstep1}{OT1} -\let\secbf\secrm -\setfont\secsc\scbshape{10}{\magstep2}{OT1} -\font\seci=cmmi12 scaled \magstep1 -\font\secsy=cmsy10 scaled \magstep2 -\def\sececsize{1440} - -% Subsection fonts (13.15pt). -\def\ssecnominalsize{13pt} -\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} -\setfont\ssecit\itbshape{10}{1315}{OT1IT} -\setfont\ssecsl\slbshape{10}{1315}{OT1} -\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} -\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} -\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} -\let\ssecbf\ssecrm -\setfont\ssecsc\scbshape{10}{1315}{OT1} -\font\sseci=cmmi12 scaled \magstephalf -\font\ssecsy=cmsy10 scaled 1315 -\def\ssececsize{1200} - -% Reduced fonts for @acro in text (10pt). -\def\reducednominalsize{10pt} -\setfont\reducedrm\rmshape{10}{1000}{OT1} -\setfont\reducedtt\ttshape{10}{1000}{OT1TT} -\setfont\reducedbf\bfshape{10}{1000}{OT1} -\setfont\reducedit\itshape{10}{1000}{OT1IT} -\setfont\reducedsl\slshape{10}{1000}{OT1} -\setfont\reducedsf\sfshape{10}{1000}{OT1} -\setfont\reducedsc\scshape{10}{1000}{OT1} -\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} -\font\reducedi=cmmi10 -\font\reducedsy=cmsy10 -\def\reducedecsize{1000} - -% reset the current fonts -\textfonts -\rm -} % end of 11pt text font size definitions - - -% Definitions to make the main text be 10pt Computer Modern, with -% section, chapter, etc., sizes following suit. This is for the GNU -% Press printing of the Emacs 22 manual. Maybe other manuals in the -% future. Used with @smallbook, which sets the leading to 12pt. -% -\def\definetextfontsizex{% -% Text fonts (10pt). -\def\textnominalsize{10pt} -\edef\mainmagstep{1000} -\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} -\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} -\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} -\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} -\setfont\textsl\slshape{10}{\mainmagstep}{OT1} -\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} -\setfont\textsc\scshape{10}{\mainmagstep}{OT1} -\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} -\font\texti=cmmi10 scaled \mainmagstep -\font\textsy=cmsy10 scaled \mainmagstep -\def\textecsize{1000} - -% A few fonts for @defun names and args. -\setfont\defbf\bfshape{10}{\magstephalf}{OT1} -\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} -\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} -\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} - -% Fonts for indices, footnotes, small examples (9pt). -\def\smallnominalsize{9pt} -\setfont\smallrm\rmshape{9}{1000}{OT1} -\setfont\smalltt\ttshape{9}{1000}{OT1TT} -\setfont\smallbf\bfshape{10}{900}{OT1} -\setfont\smallit\itshape{9}{1000}{OT1IT} -\setfont\smallsl\slshape{9}{1000}{OT1} -\setfont\smallsf\sfshape{9}{1000}{OT1} -\setfont\smallsc\scshape{10}{900}{OT1} -\setfont\smallttsl\ttslshape{10}{900}{OT1TT} -\font\smalli=cmmi9 -\font\smallsy=cmsy9 -\def\smallecsize{0900} - -% Fonts for small examples (8pt). -\def\smallernominalsize{8pt} -\setfont\smallerrm\rmshape{8}{1000}{OT1} -\setfont\smallertt\ttshape{8}{1000}{OT1TT} -\setfont\smallerbf\bfshape{10}{800}{OT1} -\setfont\smallerit\itshape{8}{1000}{OT1IT} -\setfont\smallersl\slshape{8}{1000}{OT1} -\setfont\smallersf\sfshape{8}{1000}{OT1} -\setfont\smallersc\scshape{10}{800}{OT1} -\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} -\font\smalleri=cmmi8 -\font\smallersy=cmsy8 -\def\smallerecsize{0800} - -% Fonts for title page (20.4pt): -\def\titlenominalsize{20pt} -\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} -\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} -\setfont\titlesl\slbshape{10}{\magstep4}{OT1} -\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} -\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} -\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} -\let\titlebf=\titlerm -\setfont\titlesc\scbshape{10}{\magstep4}{OT1} -\font\titlei=cmmi12 scaled \magstep3 -\font\titlesy=cmsy10 scaled \magstep4 -\def\titleecsize{2074} - -% Chapter fonts (14.4pt). -\def\chapnominalsize{14pt} -\setfont\chaprm\rmbshape{12}{\magstep1}{OT1} -\setfont\chapit\itbshape{10}{\magstep2}{OT1IT} -\setfont\chapsl\slbshape{10}{\magstep2}{OT1} -\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} -\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} -\setfont\chapsf\sfbshape{12}{\magstep1}{OT1} -\let\chapbf\chaprm -\setfont\chapsc\scbshape{10}{\magstep2}{OT1} -\font\chapi=cmmi12 scaled \magstep1 -\font\chapsy=cmsy10 scaled \magstep2 -\def\chapecsize{1440} - -% Section fonts (12pt). -\def\secnominalsize{12pt} -\setfont\secrm\rmbshape{12}{1000}{OT1} -\setfont\secit\itbshape{10}{\magstep1}{OT1IT} -\setfont\secsl\slbshape{10}{\magstep1}{OT1} -\setfont\sectt\ttbshape{12}{1000}{OT1TT} -\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} -\setfont\secsf\sfbshape{12}{1000}{OT1} -\let\secbf\secrm -\setfont\secsc\scbshape{10}{\magstep1}{OT1} -\font\seci=cmmi12 -\font\secsy=cmsy10 scaled \magstep1 -\def\sececsize{1200} - -% Subsection fonts (10pt). -\def\ssecnominalsize{10pt} -\setfont\ssecrm\rmbshape{10}{1000}{OT1} -\setfont\ssecit\itbshape{10}{1000}{OT1IT} -\setfont\ssecsl\slbshape{10}{1000}{OT1} -\setfont\ssectt\ttbshape{10}{1000}{OT1TT} -\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} -\setfont\ssecsf\sfbshape{10}{1000}{OT1} -\let\ssecbf\ssecrm -\setfont\ssecsc\scbshape{10}{1000}{OT1} -\font\sseci=cmmi10 -\font\ssecsy=cmsy10 -\def\ssececsize{1000} - -% Reduced fonts for @acro in text (9pt). -\def\reducednominalsize{9pt} -\setfont\reducedrm\rmshape{9}{1000}{OT1} -\setfont\reducedtt\ttshape{9}{1000}{OT1TT} -\setfont\reducedbf\bfshape{10}{900}{OT1} -\setfont\reducedit\itshape{9}{1000}{OT1IT} -\setfont\reducedsl\slshape{9}{1000}{OT1} -\setfont\reducedsf\sfshape{9}{1000}{OT1} -\setfont\reducedsc\scshape{10}{900}{OT1} -\setfont\reducedttsl\ttslshape{10}{900}{OT1TT} -\font\reducedi=cmmi9 -\font\reducedsy=cmsy9 -\def\reducedecsize{0900} - -% reduce space between paragraphs -\divide\parskip by 2 - -% reset the current fonts -\textfonts -\rm -} % end of 10pt text font size definitions - - -% We provide the user-level command -% @fonttextsize 10 -% (or 11) to redefine the text font size. pt is assumed. -% -\def\xword{10} -\def\xiword{11} -% -\parseargdef\fonttextsize{% - \def\textsizearg{#1}% - \wlog{doing @fonttextsize \textsizearg}% - % - % Set \globaldefs so that documents can use this inside @tex, since - % makeinfo 4.8 does not support it, but we need it nonetheless. - % - \begingroup \globaldefs=1 - \ifx\textsizearg\xword \definetextfontsizex - \else \ifx\textsizearg\xiword \definetextfontsizexi - \else - \errhelp=\EMsimple - \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} - \fi\fi - \endgroup -} - - -% In order for the font changes to affect most math symbols and letters, -% we have to define the \textfont of the standard families. Since -% texinfo doesn't allow for producing subscripts and superscripts except -% in the main text, we don't bother to reset \scriptfont and -% \scriptscriptfont (which would also require loading a lot more fonts). -% -\def\resetmathfonts{% - \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy - \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf - \textfont\ttfam=\tentt \textfont\sffam=\tensf -} - -% The font-changing commands redefine the meanings of \tenSTYLE, instead -% of just \STYLE. We do this because \STYLE needs to also set the -% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire -% \tenSTYLE to set the current font. -% -% Each font-changing command also sets the names \lsize (one size lower) -% and \lllsize (three sizes lower). These relative commands are used in -% the LaTeX logo and acronyms. -% -% This all needs generalizing, badly. -% -\def\textfonts{% - \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl - \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc - \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy - \let\tenttsl=\textttsl - \def\curfontsize{text}% - \def\lsize{reduced}\def\lllsize{smaller}% - \resetmathfonts \setleading{\textleading}} -\def\titlefonts{% - \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl - \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc - \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy - \let\tenttsl=\titlettsl - \def\curfontsize{title}% - \def\lsize{chap}\def\lllsize{subsec}% - \resetmathfonts \setleading{25pt}} -\def\titlefont#1{{\titlefonts\rmisbold #1}} -\def\chapfonts{% - \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl - \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc - \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy - \let\tenttsl=\chapttsl - \def\curfontsize{chap}% - \def\lsize{sec}\def\lllsize{text}% - \resetmathfonts \setleading{19pt}} -\def\secfonts{% - \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl - \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc - \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy - \let\tenttsl=\secttsl - \def\curfontsize{sec}% - \def\lsize{subsec}\def\lllsize{reduced}% - \resetmathfonts \setleading{16pt}} -\def\subsecfonts{% - \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl - \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc - \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy - \let\tenttsl=\ssecttsl - \def\curfontsize{ssec}% - \def\lsize{text}\def\lllsize{small}% - \resetmathfonts \setleading{15pt}} -\let\subsubsecfonts = \subsecfonts -\def\reducedfonts{% - \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl - \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc - \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy - \let\tenttsl=\reducedttsl - \def\curfontsize{reduced}% - \def\lsize{small}\def\lllsize{smaller}% - \resetmathfonts \setleading{10.5pt}} -\def\smallfonts{% - \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl - \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc - \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy - \let\tenttsl=\smallttsl - \def\curfontsize{small}% - \def\lsize{smaller}\def\lllsize{smaller}% - \resetmathfonts \setleading{10.5pt}} -\def\smallerfonts{% - \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl - \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc - \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy - \let\tenttsl=\smallerttsl - \def\curfontsize{smaller}% - \def\lsize{smaller}\def\lllsize{smaller}% - \resetmathfonts \setleading{9.5pt}} - -% Fonts for short table of contents. -\setfont\shortcontrm\rmshape{12}{1000}{OT1} -\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 -\setfont\shortcontsl\slshape{12}{1000}{OT1} -\setfont\shortconttt\ttshape{12}{1000}{OT1TT} - -% Define these just so they can be easily changed for other fonts. -\def\angleleft{$\langle$} -\def\angleright{$\rangle$} - -% Set the fonts to use with the @small... environments. -\let\smallexamplefonts = \smallfonts - -% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample -% can fit this many characters: -% 8.5x11=86 smallbook=72 a4=90 a5=69 -% If we use \scriptfonts (8pt), then we can fit this many characters: -% 8.5x11=90+ smallbook=80 a4=90+ a5=77 -% For me, subjectively, the few extra characters that fit aren't worth -% the additional smallness of 8pt. So I'm making the default 9pt. -% -% By the way, for comparison, here's what fits with @example (10pt): -% 8.5x11=71 smallbook=60 a4=75 a5=58 -% --karl, 24jan03. - -% Set up the default fonts, so we can use them for creating boxes. -% -\definetextfontsizexi - - -\message{markup,} - -% Check if we are currently using a typewriter font. Since all the -% Computer Modern typewriter fonts have zero interword stretch (and -% shrink), and it is reasonable to expect all typewriter fonts to have -% this property, we can check that font parameter. -% -\def\ifmonospace{\ifdim\fontdimen3\font=0pt } - -% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will -% define and register \INITMACRO to be called on markup style changes. -% \INITMACRO can check \currentmarkupstyle for the innermost -% style and the set of \ifmarkupSTYLE switches for all styles -% currently in effect. -\newif\ifmarkupvar -\newif\ifmarkupsamp -\newif\ifmarkupkey -%\newif\ifmarkupfile % @file == @samp. -%\newif\ifmarkupoption % @option == @samp. -\newif\ifmarkupcode -\newif\ifmarkupkbd -%\newif\ifmarkupenv % @env == @code. -%\newif\ifmarkupcommand % @command == @code. -\newif\ifmarkuptex % @tex (and part of @math, for now). -\newif\ifmarkupexample -\newif\ifmarkupverb -\newif\ifmarkupverbatim - -\let\currentmarkupstyle\empty - -\def\setupmarkupstyle#1{% - \csname markup#1true\endcsname - \def\currentmarkupstyle{#1}% - \markupstylesetup -} - -\let\markupstylesetup\empty - -\def\defmarkupstylesetup#1{% - \expandafter\def\expandafter\markupstylesetup - \expandafter{\markupstylesetup #1}% - \def#1% -} - -% Markup style setup for left and right quotes. -\defmarkupstylesetup\markupsetuplq{% - \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname - \ifx\temp\relax \markupsetuplqdefault \else \temp \fi -} - -\defmarkupstylesetup\markupsetuprq{% - \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname - \ifx\temp\relax \markupsetuprqdefault \else \temp \fi -} - -{ -\catcode`\'=\active -\catcode`\`=\active - -\gdef\markupsetuplqdefault{\let`\lq} -\gdef\markupsetuprqdefault{\let'\rq} - -\gdef\markupsetcodequoteleft{\let`\codequoteleft} -\gdef\markupsetcodequoteright{\let'\codequoteright} - -\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft} -} - -\let\markupsetuplqcode \markupsetcodequoteleft -\let\markupsetuprqcode \markupsetcodequoteright -\let\markupsetuplqexample \markupsetcodequoteleft -\let\markupsetuprqexample \markupsetcodequoteright -\let\markupsetuplqverb \markupsetcodequoteleft -\let\markupsetuprqverb \markupsetcodequoteright -\let\markupsetuplqverbatim \markupsetcodequoteleft -\let\markupsetuprqverbatim \markupsetcodequoteright - -\let\markupsetuplqsamp \markupsetnoligaturesquoteleft -\let\markupsetuplqkbd \markupsetnoligaturesquoteleft - -% Allow an option to not replace quotes with a regular directed right -% quote/apostrophe (char 0x27), but instead use the undirected quote -% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it -% the default, but it works for pasting with more pdf viewers (at least -% evince), the lilypond developers report. xpdf does work with the -% regular 0x27. -% -\def\codequoteright{% - \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax - \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax - '% - \else \char'15 \fi - \else \char'15 \fi -} -% -% and a similar option for the left quote char vs. a grave accent. -% Modern fonts display ASCII 0x60 as a grave accent, so some people like -% the code environments to do likewise. -% -\def\codequoteleft{% - \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax - \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax - % [Knuth] pp. 380,381,391 - % \relax disables Spanish ligatures ?` and !` of \tt font. - \relax`% - \else \char'22 \fi - \else \char'22 \fi -} - -% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. -\def\noligaturesquoteleft{\relax\lq} - -% Count depth in font-changes, for error checks -\newcount\fontdepth \fontdepth=0 - -%% Add scribe-like font environments, plus @l for inline lisp (usually sans -%% serif) and @ii for TeX italic - -% \smartitalic{ARG} outputs arg in italics, followed by an italic correction -% unless the following character is such as not to need one. -\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else - \ptexslash\fi\fi\fi} -\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} -\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} - -% like \smartslanted except unconditionally uses \ttsl. -% @var is set to this for defun arguments. -\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx} - -% @cite is like \smartslanted except unconditionally use \sl. We never want -% ttsl for book titles, do we? -\def\cite#1{{\sl #1}\futurelet\next\smartitalicx} - -\let\i=\smartitalic -\let\slanted=\smartslanted -\def\var#1{{\setupmarkupstyle{var}\smartslanted{#1}}} -\let\dfn=\smartslanted -\let\emph=\smartitalic - -% Explicit font changes: @r, @sc, undocumented @ii. -\def\r#1{{\rm #1}} % roman font -\def\sc#1{{\smallcaps#1}} % smallcaps font -\def\ii#1{{\it #1}} % italic font - -% @b, explicit bold. Also @strong. -\def\b#1{{\bf #1}} -\let\strong=\b - -% @sansserif, explicit sans. -\def\sansserif#1{{\sf #1}} - -% We can't just use \exhyphenpenalty, because that only has effect at -% the end of a paragraph. Restore normal hyphenation at the end of the -% group within which \nohyphenation is presumably called. -% -\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} -\def\restorehyphenation{\hyphenchar\font = `- } - -% Set sfcode to normal for the chars that usually have another value. -% Can't use plain's \frenchspacing because it uses the `\x notation, and -% sometimes \x has an active definition that messes things up. -% -\catcode`@=11 - \def\plainfrenchspacing{% - \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m - \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m - \def\endofsentencespacefactor{1000}% for @. and friends - } - \def\plainnonfrenchspacing{% - \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 - \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 - \def\endofsentencespacefactor{3000}% for @. and friends - } -\catcode`@=\other -\def\endofsentencespacefactor{3000}% default - -% @t, explicit typewriter. -\def\t#1{% - {\tt \rawbackslash \plainfrenchspacing #1}% - \null -} - -% @samp. -\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} - -% definition of @key that produces a lozenge. Doesn't adjust to text size. -%\setfont\keyrm\rmshape{8}{1000}{OT1} -%\font\keysy=cmsy9 -%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% -% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% -% \vbox{\hrule\kern-0.4pt -% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% -% \kern-0.4pt\hrule}% -% \kern-.06em\raise0.4pt\hbox{\angleright}}}} - -% definition of @key with no lozenge. If the current font is already -% monospace, don't change it; that way, we respect @kbdinputstyle. But -% if it isn't monospace, then use \tt. -% -\def\key#1{{\setupmarkupstyle{key}% - \nohyphenation - \ifmonospace\else\tt\fi - #1}\null} - -% ctrl is no longer a Texinfo command. -\def\ctrl #1{{\tt \rawbackslash \hat}#1} - -% @file, @option are the same as @samp. -\let\file=\samp -\let\option=\samp - -% @code is a modification of @t, -% which makes spaces the same size as normal in the surrounding text. -\def\tclose#1{% - {% - % Change normal interword space to be same as for the current font. - \spaceskip = \fontdimen2\font - % - % Switch to typewriter. - \tt - % - % But `\ ' produces the large typewriter interword space. - \def\ {{\spaceskip = 0pt{} }}% - % - % Turn off hyphenation. - \nohyphenation - % - \rawbackslash - \plainfrenchspacing - #1% - }% - \null -} - -% We *must* turn on hyphenation at `-' and `_' in @code. -% Otherwise, it is too hard to avoid overfull hboxes -% in the Emacs manual, the Library manual, etc. - -% Unfortunately, TeX uses one parameter (\hyphenchar) to control -% both hyphenation at - and hyphenation within words. -% We must therefore turn them both off (\tclose does that) -% and arrange explicitly to hyphenate at a dash. -% -- rms. -{ - \catcode`\-=\active \catcode`\_=\active - \catcode`\'=\active \catcode`\`=\active - \global\let'=\rq \global\let`=\lq % default definitions - % - \global\def\code{\begingroup - \setupmarkupstyle{code}% - % The following should really be moved into \setupmarkupstyle handlers. - \catcode\dashChar=\active \catcode\underChar=\active - \ifallowcodebreaks - \let-\codedash - \let_\codeunder - \else - \let-\realdash - \let_\realunder - \fi - \codex - } -} - -\def\realdash{-} -\def\codedash{-\discretionary{}{}{}} -\def\codeunder{% - % this is all so @math{@code{var_name}+1} can work. In math mode, _ - % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) - % will therefore expand the active definition of _, which is us - % (inside @code that is), therefore an endless loop. - \ifusingtt{\ifmmode - \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. - \else\normalunderscore \fi - \discretionary{}{}{}}% - {\_}% -} -\def\codex #1{\tclose{#1}\endgroup} - -% An additional complication: the above will allow breaks after, e.g., -% each of the four underscores in __typeof__. This is undesirable in -% some manuals, especially if they don't have long identifiers in -% general. @allowcodebreaks provides a way to control this. -% -\newif\ifallowcodebreaks \allowcodebreakstrue - -\def\keywordtrue{true} -\def\keywordfalse{false} - -\parseargdef\allowcodebreaks{% - \def\txiarg{#1}% - \ifx\txiarg\keywordtrue - \allowcodebreakstrue - \else\ifx\txiarg\keywordfalse - \allowcodebreaksfalse - \else - \errhelp = \EMsimple - \errmessage{Unknown @allowcodebreaks option `\txiarg'}% - \fi\fi -} - -% @kbd is like @code, except that if the argument is just one @key command, -% then @kbd has no effect. -\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}} - -% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), -% `example' (@kbd uses ttsl only inside of @example and friends), -% or `code' (@kbd uses normal tty font always). -\parseargdef\kbdinputstyle{% - \def\txiarg{#1}% - \ifx\txiarg\worddistinct - \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% - \else\ifx\txiarg\wordexample - \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% - \else\ifx\txiarg\wordcode - \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% - \else - \errhelp = \EMsimple - \errmessage{Unknown @kbdinputstyle option `\txiarg'}% - \fi\fi\fi -} -\def\worddistinct{distinct} -\def\wordexample{example} -\def\wordcode{code} - -% Default is `distinct'. -\kbdinputstyle distinct - -\def\xkey{\key} -\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% -\ifx\one\xkey\ifx\threex\three \key{#2}% -\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi -\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi} - -% For @indicateurl, @env, @command quotes seem unnecessary, so use \code. -\let\indicateurl=\code -\let\env=\code -\let\command=\code - -% @clicksequence{File @click{} Open ...} -\def\clicksequence#1{\begingroup #1\endgroup} - -% @clickstyle @arrow (by default) -\parseargdef\clickstyle{\def\click{#1}} -\def\click{\arrow} - -% @uref (abbreviation for `urlref') takes an optional (comma-separated) -% second argument specifying the text to display and an optional third -% arg as text to display instead of (rather than in addition to) the url -% itself. First (mandatory) arg is the url. Perhaps eventually put in -% a hypertex \special here. -% -\def\uref#1{\douref #1,,,\finish} -\def\douref#1,#2,#3,#4\finish{\begingroup - \unsepspaces - \pdfurl{#1}% - \setbox0 = \hbox{\ignorespaces #3}% - \ifdim\wd0 > 0pt - \unhbox0 % third arg given, show only that - \else - \setbox0 = \hbox{\ignorespaces #2}% - \ifdim\wd0 > 0pt - \ifpdf - \unhbox0 % PDF: 2nd arg given, show only it - \else - \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url - \fi - \else - \code{#1}% only url given, so show it - \fi - \fi - \endlink -\endgroup} - -% @url synonym for @uref, since that's how everyone uses it. -% -\let\url=\uref - -% rms does not like angle brackets --karl, 17may97. -% So now @email is just like @uref, unless we are pdf. -% -%\def\email#1{\angleleft{\tt #1}\angleright} -\ifpdf - \def\email#1{\doemail#1,,\finish} - \def\doemail#1,#2,#3\finish{\begingroup - \unsepspaces - \pdfurl{mailto:#1}% - \setbox0 = \hbox{\ignorespaces #2}% - \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi - \endlink - \endgroup} -\else - \let\email=\uref -\fi - -% Typeset a dimension, e.g., `in' or `pt'. The only reason for the -% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. -% -\def\dmn#1{\thinspace #1} - -% @l was never documented to mean ``switch to the Lisp font'', -% and it is not used as such in any manual I can find. We need it for -% Polish suppressed-l. --karl, 22sep96. -%\def\l#1{{\li #1}\null} - -% @acronym for "FBI", "NATO", and the like. -% We print this one point size smaller, since it's intended for -% all-uppercase. -% -\def\acronym#1{\doacronym #1,,\finish} -\def\doacronym#1,#2,#3\finish{% - {\selectfonts\lsize #1}% - \def\temp{#2}% - \ifx\temp\empty \else - \space ({\unsepspaces \ignorespaces \temp \unskip})% - \fi -} - -% @abbr for "Comput. J." and the like. -% No font change, but don't do end-of-sentence spacing. -% -\def\abbr#1{\doabbr #1,,\finish} -\def\doabbr#1,#2,#3\finish{% - {\plainfrenchspacing #1}% - \def\temp{#2}% - \ifx\temp\empty \else - \space ({\unsepspaces \ignorespaces \temp \unskip})% - \fi -} - - -\message{glyphs,} - -% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. -% -% Since these characters are used in examples, they should be an even number of -% \tt widths. Each \tt character is 1en, so two makes it 1em. -% -\def\point{$\star$} -\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} -\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} -\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} -\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} -\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} - -% The @error{} command. -% Adapted from the TeXbook's \boxit. -% -\newbox\errorbox -% -{\tentt \global\dimen0 = 3em}% Width of the box. -\dimen2 = .55pt % Thickness of rules -% The text. (`r' is open on the right, `e' somewhat less so on the left.) -\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt} -% -\setbox\errorbox=\hbox to \dimen0{\hfil - \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. - \advance\hsize by -2\dimen2 % Rules. - \vbox{% - \hrule height\dimen2 - \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. - \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. - \kern3pt\vrule width\dimen2}% Space to right. - \hrule height\dimen2} - \hfil} -% -\def\error{\leavevmode\lower.7ex\copy\errorbox} - -% @pounds{} is a sterling sign, which Knuth put in the CM italic font. -% -\def\pounds{{\it\$}} - -% @euro{} comes from a separate font, depending on the current style. -% We use the free feym* fonts from the eurosym package by Henrik -% Theiling, which support regular, slanted, bold and bold slanted (and -% "outlined" (blackboard board, sort of) versions, which we don't need). -% It is available from http://www.ctan.org/tex-archive/fonts/eurosym. -% -% Although only regular is the truly official Euro symbol, we ignore -% that. The Euro is designed to be slightly taller than the regular -% font height. -% -% feymr - regular -% feymo - slanted -% feybr - bold -% feybo - bold slanted -% -% There is no good (free) typewriter version, to my knowledge. -% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. -% Hmm. -% -% Also doesn't work in math. Do we need to do math with euro symbols? -% Hope not. -% -% -\def\euro{{\eurofont e}} -\def\eurofont{% - % We set the font at each command, rather than predefining it in - % \textfonts and the other font-switching commands, so that - % installations which never need the symbol don't have to have the - % font installed. - % - % There is only one designed size (nominal 10pt), so we always scale - % that to the current nominal size. - % - % By the way, simply using "at 1em" works for cmr10 and the like, but - % does not work for cmbx10 and other extended/shrunken fonts. - % - \def\eurosize{\csname\curfontsize nominalsize\endcsname}% - % - \ifx\curfontstyle\bfstylename - % bold: - \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize - \else - % regular: - \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize - \fi - \thiseurofont -} - -% Glyphs from the EC fonts. We don't use \let for the aliases, because -% sometimes we redefine the original macro, and the alias should reflect -% the redefinition. -% -% Use LaTeX names for the Icelandic letters. -\def\DH{{\ecfont \char"D0}} % Eth -\def\dh{{\ecfont \char"F0}} % eth -\def\TH{{\ecfont \char"DE}} % Thorn -\def\th{{\ecfont \char"FE}} % thorn -% -\def\guillemetleft{{\ecfont \char"13}} -\def\guillemotleft{\guillemetleft} -\def\guillemetright{{\ecfont \char"14}} -\def\guillemotright{\guillemetright} -\def\guilsinglleft{{\ecfont \char"0E}} -\def\guilsinglright{{\ecfont \char"0F}} -\def\quotedblbase{{\ecfont \char"12}} -\def\quotesinglbase{{\ecfont \char"0D}} -% -% This positioning is not perfect (see the ogonek LaTeX package), but -% we have the precomposed glyphs for the most common cases. We put the -% tests to use those glyphs in the single \ogonek macro so we have fewer -% dummy definitions to worry about for index entries, etc. -% -% ogonek is also used with other letters in Lithuanian (IOU), but using -% the precomposed glyphs for those is not so easy since they aren't in -% the same EC font. -\def\ogonek#1{{% - \def\temp{#1}% - \ifx\temp\macrocharA\Aogonek - \else\ifx\temp\macrochara\aogonek - \else\ifx\temp\macrocharE\Eogonek - \else\ifx\temp\macrochare\eogonek - \else - \ecfont \setbox0=\hbox{#1}% - \ifdim\ht0=1ex\accent"0C #1% - \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% - \fi - \fi\fi\fi\fi - }% -} -\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} -\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} -\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} -\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} -% -% Use the ec* fonts (cm-super in outline format) for non-CM glyphs. -\def\ecfont{% - % We can't distinguish serif/sans and italic/slanted, but this - % is used for crude hacks anyway (like adding French and German - % quotes to documents typeset with CM, where we lose kerning), so - % hopefully nobody will notice/care. - \edef\ecsize{\csname\curfontsize ecsize\endcsname}% - \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% - \ifx\curfontstyle\bfstylename - % bold: - \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize - \else - % regular: - \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize - \fi - \thisecfont -} - -% @registeredsymbol - R in a circle. The font for the R should really -% be smaller yet, but lllsize is the best we can do for now. -% Adapted from the plain.tex definition of \copyright. -% -\def\registeredsymbol{% - $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% - \hfil\crcr\Orb}}% - }$% -} - -% @textdegree - the normal degrees sign. -% -\def\textdegree{$^\circ$} - -% Laurent Siebenmann reports \Orb undefined with: -% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 -% so we'll define it if necessary. -% -\ifx\Orb\undefined -\def\Orb{\mathhexbox20D} -\fi - -% Quotes. -\chardef\quotedblleft="5C -\chardef\quotedblright=`\" -\chardef\quoteleft=`\` -\chardef\quoteright=`\' - - -\message{page headings,} - -\newskip\titlepagetopglue \titlepagetopglue = 1.5in -\newskip\titlepagebottomglue \titlepagebottomglue = 2pc - -% First the title page. Must do @settitle before @titlepage. -\newif\ifseenauthor -\newif\iffinishedtitlepage - -% Do an implicit @contents or @shortcontents after @end titlepage if the -% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. -% -\newif\ifsetcontentsaftertitlepage - \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue -\newif\ifsetshortcontentsaftertitlepage - \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue - -\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% - \endgroup\page\hbox{}\page} - -\envdef\titlepage{% - % Open one extra group, as we want to close it in the middle of \Etitlepage. - \begingroup - \parindent=0pt \textfonts - % Leave some space at the very top of the page. - \vglue\titlepagetopglue - % No rule at page bottom unless we print one at the top with @title. - \finishedtitlepagetrue - % - % Most title ``pages'' are actually two pages long, with space - % at the top of the second. We don't want the ragged left on the second. - \let\oldpage = \page - \def\page{% - \iffinishedtitlepage\else - \finishtitlepage - \fi - \let\page = \oldpage - \page - \null - }% -} - -\def\Etitlepage{% - \iffinishedtitlepage\else - \finishtitlepage - \fi - % It is important to do the page break before ending the group, - % because the headline and footline are only empty inside the group. - % If we use the new definition of \page, we always get a blank page - % after the title page, which we certainly don't want. - \oldpage - \endgroup - % - % Need this before the \...aftertitlepage checks so that if they are - % in effect the toc pages will come out with page numbers. - \HEADINGSon - % - % If they want short, they certainly want long too. - \ifsetshortcontentsaftertitlepage - \shortcontents - \contents - \global\let\shortcontents = \relax - \global\let\contents = \relax - \fi - % - \ifsetcontentsaftertitlepage - \contents - \global\let\contents = \relax - \global\let\shortcontents = \relax - \fi -} - -\def\finishtitlepage{% - \vskip4pt \hrule height 2pt width \hsize - \vskip\titlepagebottomglue - \finishedtitlepagetrue -} - -%%% Macros to be used within @titlepage: - -\let\subtitlerm=\tenrm -\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} - -\parseargdef\title{% - \checkenv\titlepage - \leftline{\titlefonts\rmisbold #1} - % print a rule at the page bottom also. - \finishedtitlepagefalse - \vskip4pt \hrule height 4pt width \hsize \vskip4pt -} - -\parseargdef\subtitle{% - \checkenv\titlepage - {\subtitlefont \rightline{#1}}% -} - -% @author should come last, but may come many times. -% It can also be used inside @quotation. -% -\parseargdef\author{% - \def\temp{\quotation}% - \ifx\thisenv\temp - \def\quotationauthor{#1}% printed in \Equotation. - \else - \checkenv\titlepage - \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi - {\secfonts\rmisbold \leftline{#1}}% - \fi -} - - -%%% Set up page headings and footings. - -\let\thispage=\folio - -\newtoks\evenheadline % headline on even pages -\newtoks\oddheadline % headline on odd pages -\newtoks\evenfootline % footline on even pages -\newtoks\oddfootline % footline on odd pages - -% Now make TeX use those variables -\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline - \else \the\evenheadline \fi}} -\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline - \else \the\evenfootline \fi}\HEADINGShook} -\let\HEADINGShook=\relax - -% Commands to set those variables. -% For example, this is what @headings on does -% @evenheading @thistitle|@thispage|@thischapter -% @oddheading @thischapter|@thispage|@thistitle -% @evenfooting @thisfile|| -% @oddfooting ||@thisfile - - -\def\evenheading{\parsearg\evenheadingxxx} -\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} -\def\evenheadingyyy #1\|#2\|#3\|#4\finish{% -\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\def\oddheading{\parsearg\oddheadingxxx} -\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} -\def\oddheadingyyy #1\|#2\|#3\|#4\finish{% -\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% - -\def\evenfooting{\parsearg\evenfootingxxx} -\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} -\def\evenfootingyyy #1\|#2\|#3\|#4\finish{% -\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} - -\def\oddfooting{\parsearg\oddfootingxxx} -\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} -\def\oddfootingyyy #1\|#2\|#3\|#4\finish{% - \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% - % - % Leave some space for the footline. Hopefully ok to assume - % @evenfooting will not be used by itself. - \global\advance\pageheight by -12pt - \global\advance\vsize by -12pt -} - -\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} - -% @evenheadingmarks top \thischapter <- chapter at the top of a page -% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page -% -% The same set of arguments for: -% -% @oddheadingmarks -% @evenfootingmarks -% @oddfootingmarks -% @everyheadingmarks -% @everyfootingmarks - -\def\evenheadingmarks{\headingmarks{even}{heading}} -\def\oddheadingmarks{\headingmarks{odd}{heading}} -\def\evenfootingmarks{\headingmarks{even}{footing}} -\def\oddfootingmarks{\headingmarks{odd}{footing}} -\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} - \headingmarks{odd}{heading}{#1} } -\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} - \headingmarks{odd}{footing}{#1} } -% #1 = even/odd, #2 = heading/footing, #3 = top/bottom. -\def\headingmarks#1#2#3 {% - \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname - \global\expandafter\let\csname get#1#2marks\endcsname \temp -} - -\everyheadingmarks bottom -\everyfootingmarks bottom - -% @headings double turns headings on for double-sided printing. -% @headings single turns headings on for single-sided printing. -% @headings off turns them off. -% @headings on same as @headings double, retained for compatibility. -% @headings after turns on double-sided headings after this page. -% @headings doubleafter turns on double-sided headings after this page. -% @headings singleafter turns on single-sided headings after this page. -% By default, they are off at the start of a document, -% and turned `on' after @end titlepage. - -\def\headings #1 {\csname HEADINGS#1\endcsname} - -\def\HEADINGSoff{% -\global\evenheadline={\hfil} \global\evenfootline={\hfil} -\global\oddheadline={\hfil} \global\oddfootline={\hfil}} -\HEADINGSoff -% When we turn headings on, set the page number to 1. -% For double-sided printing, put current file name in lower left corner, -% chapter name on inside top of right hand pages, document -% title on inside top of left hand pages, and page numbers on outside top -% edge of all pages. -\def\HEADINGSdouble{% -\global\pageno=1 -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -\global\let\contentsalignmacro = \chapoddpage -} -\let\contentsalignmacro = \chappager - -% For single-sided printing, chapter title goes across top left of page, -% page number on top right. -\def\HEADINGSsingle{% -\global\pageno=1 -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapter\hfil\folio}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -\global\let\contentsalignmacro = \chappager -} -\def\HEADINGSon{\HEADINGSdouble} - -\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} -\let\HEADINGSdoubleafter=\HEADINGSafter -\def\HEADINGSdoublex{% -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -\global\let\contentsalignmacro = \chapoddpage -} - -\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} -\def\HEADINGSsinglex{% -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapter\hfil\folio}} -\global\oddheadline={\line{\thischapter\hfil\folio}} -\global\let\contentsalignmacro = \chappager -} - -% Subroutines used in generating headings -% This produces Day Month Year style of output. -% Only define if not already defined, in case a txi-??.tex file has set -% up a different format (e.g., txi-cs.tex does this). -\ifx\today\undefined -\def\today{% - \number\day\space - \ifcase\month - \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr - \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug - \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec - \fi - \space\number\year} -\fi - -% @settitle line... specifies the title of the document, for headings. -% It generates no output of its own. -\def\thistitle{\putwordNoTitle} -\def\settitle{\parsearg{\gdef\thistitle}} - - -\message{tables,} -% Tables -- @table, @ftable, @vtable, @item(x). - -% default indentation of table text -\newdimen\tableindent \tableindent=.8in -% default indentation of @itemize and @enumerate text -\newdimen\itemindent \itemindent=.3in -% margin between end of table item and start of table text. -\newdimen\itemmargin \itemmargin=.1in - -% used internally for \itemindent minus \itemmargin -\newdimen\itemmax - -% Note @table, @ftable, and @vtable define @item, @itemx, etc., with -% these defs. -% They also define \itemindex -% to index the item name in whatever manner is desired (perhaps none). - -\newif\ifitemxneedsnegativevskip - -\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} - -\def\internalBitem{\smallbreak \parsearg\itemzzz} -\def\internalBitemx{\itemxpar \parsearg\itemzzz} - -\def\itemzzz #1{\begingroup % - \advance\hsize by -\rightskip - \advance\hsize by -\tableindent - \setbox0=\hbox{\itemindicate{#1}}% - \itemindex{#1}% - \nobreak % This prevents a break before @itemx. - % - % If the item text does not fit in the space we have, put it on a line - % by itself, and do not allow a page break either before or after that - % line. We do not start a paragraph here because then if the next - % command is, e.g., @kindex, the whatsit would get put into the - % horizontal list on a line by itself, resulting in extra blank space. - \ifdim \wd0>\itemmax - % - % Make this a paragraph so we get the \parskip glue and wrapping, - % but leave it ragged-right. - \begingroup - \advance\leftskip by-\tableindent - \advance\hsize by\tableindent - \advance\rightskip by0pt plus1fil - \leavevmode\unhbox0\par - \endgroup - % - % We're going to be starting a paragraph, but we don't want the - % \parskip glue -- logically it's part of the @item we just started. - \nobreak \vskip-\parskip - % - % Stop a page break at the \parskip glue coming up. However, if - % what follows is an environment such as @example, there will be no - % \parskip glue; then the negative vskip we just inserted would - % cause the example and the item to crash together. So we use this - % bizarre value of 10001 as a signal to \aboveenvbreak to insert - % \parskip glue after all. Section titles are handled this way also. - % - \penalty 10001 - \endgroup - \itemxneedsnegativevskipfalse - \else - % The item text fits into the space. Start a paragraph, so that the - % following text (if any) will end up on the same line. - \noindent - % Do this with kerns and \unhbox so that if there is a footnote in - % the item text, it can migrate to the main vertical list and - % eventually be printed. - \nobreak\kern-\tableindent - \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 - \unhbox0 - \nobreak\kern\dimen0 - \endgroup - \itemxneedsnegativevskiptrue - \fi -} - -\def\item{\errmessage{@item while not in a list environment}} -\def\itemx{\errmessage{@itemx while not in a list environment}} - -% @table, @ftable, @vtable. -\envdef\table{% - \let\itemindex\gobble - \tablecheck{table}% -} -\envdef\ftable{% - \def\itemindex ##1{\doind {fn}{\code{##1}}}% - \tablecheck{ftable}% -} -\envdef\vtable{% - \def\itemindex ##1{\doind {vr}{\code{##1}}}% - \tablecheck{vtable}% -} -\def\tablecheck#1{% - \ifnum \the\catcode`\^^M=\active - \endgroup - \errmessage{This command won't work in this context; perhaps the problem is - that we are \inenvironment\thisenv}% - \def\next{\doignore{#1}}% - \else - \let\next\tablex - \fi - \next -} -\def\tablex#1{% - \def\itemindicate{#1}% - \parsearg\tabley -} -\def\tabley#1{% - {% - \makevalueexpandable - \edef\temp{\noexpand\tablez #1\space\space\space}% - \expandafter - }\temp \endtablez -} -\def\tablez #1 #2 #3 #4\endtablez{% - \aboveenvbreak - \ifnum 0#1>0 \advance \leftskip by #1\mil \fi - \ifnum 0#2>0 \tableindent=#2\mil \fi - \ifnum 0#3>0 \advance \rightskip by #3\mil \fi - \itemmax=\tableindent - \advance \itemmax by -\itemmargin - \advance \leftskip by \tableindent - \exdentamount=\tableindent - \parindent = 0pt - \parskip = \smallskipamount - \ifdim \parskip=0pt \parskip=2pt \fi - \let\item = \internalBitem - \let\itemx = \internalBitemx -} -\def\Etable{\endgraf\afterenvbreak} -\let\Eftable\Etable -\let\Evtable\Etable -\let\Eitemize\Etable -\let\Eenumerate\Etable - -% This is the counter used by @enumerate, which is really @itemize - -\newcount \itemno - -\envdef\itemize{\parsearg\doitemize} - -\def\doitemize#1{% - \aboveenvbreak - \itemmax=\itemindent - \advance\itemmax by -\itemmargin - \advance\leftskip by \itemindent - \exdentamount=\itemindent - \parindent=0pt - \parskip=\smallskipamount - \ifdim\parskip=0pt \parskip=2pt \fi - % - % Try typesetting the item mark that if the document erroneously says - % something like @itemize @samp (intending @table), there's an error - % right away at the @itemize. It's not the best error message in the - % world, but it's better than leaving it to the @item. This means if - % the user wants an empty mark, they have to say @w{} not just @w. - \def\itemcontents{#1}% - \setbox0 = \hbox{\itemcontents}% - % - % @itemize with no arg is equivalent to @itemize @bullet. - \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi - % - \let\item=\itemizeitem -} - -% Definition of @item while inside @itemize and @enumerate. -% -\def\itemizeitem{% - \advance\itemno by 1 % for enumerations - {\let\par=\endgraf \smallbreak}% reasonable place to break - {% - % If the document has an @itemize directly after a section title, a - % \nobreak will be last on the list, and \sectionheading will have - % done a \vskip-\parskip. In that case, we don't want to zero - % parskip, or the item text will crash with the heading. On the - % other hand, when there is normal text preceding the item (as there - % usually is), we do want to zero parskip, or there would be too much - % space. In that case, we won't have a \nobreak before. At least - % that's the theory. - \ifnum\lastpenalty<10000 \parskip=0in \fi - \noindent - \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% - % - \vadjust{\penalty 1200}}% not good to break after first line of item. - \flushcr -} - -% \splitoff TOKENS\endmark defines \first to be the first token in -% TOKENS, and \rest to be the remainder. -% -\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% - -% Allow an optional argument of an uppercase letter, lowercase letter, -% or number, to specify the first label in the enumerated list. No -% argument is the same as `1'. -% -\envparseargdef\enumerate{\enumeratey #1 \endenumeratey} -\def\enumeratey #1 #2\endenumeratey{% - % If we were given no argument, pretend we were given `1'. - \def\thearg{#1}% - \ifx\thearg\empty \def\thearg{1}\fi - % - % Detect if the argument is a single token. If so, it might be a - % letter. Otherwise, the only valid thing it can be is a number. - % (We will always have one token, because of the test we just made. - % This is a good thing, since \splitoff doesn't work given nothing at - % all -- the first parameter is undelimited.) - \expandafter\splitoff\thearg\endmark - \ifx\rest\empty - % Only one token in the argument. It could still be anything. - % A ``lowercase letter'' is one whose \lccode is nonzero. - % An ``uppercase letter'' is one whose \lccode is both nonzero, and - % not equal to itself. - % Otherwise, we assume it's a number. - % - % We need the \relax at the end of the \ifnum lines to stop TeX from - % continuing to look for a . - % - \ifnum\lccode\expandafter`\thearg=0\relax - \numericenumerate % a number (we hope) - \else - % It's a letter. - \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax - \lowercaseenumerate % lowercase letter - \else - \uppercaseenumerate % uppercase letter - \fi - \fi - \else - % Multiple tokens in the argument. We hope it's a number. - \numericenumerate - \fi -} - -% An @enumerate whose labels are integers. The starting integer is -% given in \thearg. -% -\def\numericenumerate{% - \itemno = \thearg - \startenumeration{\the\itemno}% -} - -% The starting (lowercase) letter is in \thearg. -\def\lowercaseenumerate{% - \itemno = \expandafter`\thearg - \startenumeration{% - % Be sure we're not beyond the end of the alphabet. - \ifnum\itemno=0 - \errmessage{No more lowercase letters in @enumerate; get a bigger - alphabet}% - \fi - \char\lccode\itemno - }% -} - -% The starting (uppercase) letter is in \thearg. -\def\uppercaseenumerate{% - \itemno = \expandafter`\thearg - \startenumeration{% - % Be sure we're not beyond the end of the alphabet. - \ifnum\itemno=0 - \errmessage{No more uppercase letters in @enumerate; get a bigger - alphabet} - \fi - \char\uccode\itemno - }% -} - -% Call \doitemize, adding a period to the first argument and supplying the -% common last two arguments. Also subtract one from the initial value in -% \itemno, since @item increments \itemno. -% -\def\startenumeration#1{% - \advance\itemno by -1 - \doitemize{#1.}\flushcr -} - -% @alphaenumerate and @capsenumerate are abbreviations for giving an arg -% to @enumerate. -% -\def\alphaenumerate{\enumerate{a}} -\def\capsenumerate{\enumerate{A}} -\def\Ealphaenumerate{\Eenumerate} -\def\Ecapsenumerate{\Eenumerate} - - -% @multitable macros -% Amy Hendrickson, 8/18/94, 3/6/96 -% -% @multitable ... @end multitable will make as many columns as desired. -% Contents of each column will wrap at width given in preamble. Width -% can be specified either with sample text given in a template line, -% or in percent of \hsize, the current width of text on page. - -% Table can continue over pages but will only break between lines. - -% To make preamble: -% -% Either define widths of columns in terms of percent of \hsize: -% @multitable @columnfractions .25 .3 .45 -% @item ... -% -% Numbers following @columnfractions are the percent of the total -% current hsize to be used for each column. You may use as many -% columns as desired. - - -% Or use a template: -% @multitable {Column 1 template} {Column 2 template} {Column 3 template} -% @item ... -% using the widest term desired in each column. - -% Each new table line starts with @item, each subsequent new column -% starts with @tab. Empty columns may be produced by supplying @tab's -% with nothing between them for as many times as empty columns are needed, -% ie, @tab@tab@tab will produce two empty columns. - -% @item, @tab do not need to be on their own lines, but it will not hurt -% if they are. - -% Sample multitable: - -% @multitable {Column 1 template} {Column 2 template} {Column 3 template} -% @item first col stuff @tab second col stuff @tab third col -% @item -% first col stuff -% @tab -% second col stuff -% @tab -% third col -% @item first col stuff @tab second col stuff -% @tab Many paragraphs of text may be used in any column. -% -% They will wrap at the width determined by the template. -% @item@tab@tab This will be in third column. -% @end multitable - -% Default dimensions may be reset by user. -% @multitableparskip is vertical space between paragraphs in table. -% @multitableparindent is paragraph indent in table. -% @multitablecolmargin is horizontal space to be left between columns. -% @multitablelinespace is space to leave between table items, baseline -% to baseline. -% 0pt means it depends on current normal line spacing. -% -\newskip\multitableparskip -\newskip\multitableparindent -\newdimen\multitablecolspace -\newskip\multitablelinespace -\multitableparskip=0pt -\multitableparindent=6pt -\multitablecolspace=12pt -\multitablelinespace=0pt - -% Macros used to set up halign preamble: -% -\let\endsetuptable\relax -\def\xendsetuptable{\endsetuptable} -\let\columnfractions\relax -\def\xcolumnfractions{\columnfractions} -\newif\ifsetpercent - -% #1 is the @columnfraction, usually a decimal number like .5, but might -% be just 1. We just use it, whatever it is. -% -\def\pickupwholefraction#1 {% - \global\advance\colcount by 1 - \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% - \setuptable -} - -\newcount\colcount -\def\setuptable#1{% - \def\firstarg{#1}% - \ifx\firstarg\xendsetuptable - \let\go = \relax - \else - \ifx\firstarg\xcolumnfractions - \global\setpercenttrue - \else - \ifsetpercent - \let\go\pickupwholefraction - \else - \global\advance\colcount by 1 - \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a - % separator; typically that is always in the input, anyway. - \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% - \fi - \fi - \ifx\go\pickupwholefraction - % Put the argument back for the \pickupwholefraction call, so - % we'll always have a period there to be parsed. - \def\go{\pickupwholefraction#1}% - \else - \let\go = \setuptable - \fi% - \fi - \go -} - -% multitable-only commands. -% -% @headitem starts a heading row, which we typeset in bold. -% Assignments have to be global since we are inside the implicit group -% of an alignment entry. \everycr resets \everytab so we don't have to -% undo it ourselves. -\def\headitemfont{\b}% for people to use in the template row; not changeable -\def\headitem{% - \checkenv\multitable - \crcr - \global\everytab={\bf}% can't use \headitemfont since the parsing differs - \the\everytab % for the first item -}% -% -% A \tab used to include \hskip1sp. But then the space in a template -% line is not enough. That is bad. So let's go back to just `&' until -% we again encounter the problem the 1sp was intended to solve. -% --karl, nathan@acm.org, 20apr99. -\def\tab{\checkenv\multitable &\the\everytab}% - -% @multitable ... @end multitable definitions: -% -\newtoks\everytab % insert after every tab. -% -\envdef\multitable{% - \vskip\parskip - \startsavinginserts - % - % @item within a multitable starts a normal row. - % We use \def instead of \let so that if one of the multitable entries - % contains an @itemize, we don't choke on the \item (seen as \crcr aka - % \endtemplate) expanding \doitemize. - \def\item{\crcr}% - % - \tolerance=9500 - \hbadness=9500 - \setmultitablespacing - \parskip=\multitableparskip - \parindent=\multitableparindent - \overfullrule=0pt - \global\colcount=0 - % - \everycr = {% - \noalign{% - \global\everytab={}% - \global\colcount=0 % Reset the column counter. - % Check for saved footnotes, etc. - \checkinserts - % Keeps underfull box messages off when table breaks over pages. - %\filbreak - % Maybe so, but it also creates really weird page breaks when the - % table breaks over pages. Wouldn't \vfil be better? Wait until the - % problem manifests itself, so it can be fixed for real --karl. - }% - }% - % - \parsearg\domultitable -} -\def\domultitable#1{% - % To parse everything between @multitable and @item: - \setuptable#1 \endsetuptable - % - % This preamble sets up a generic column definition, which will - % be used as many times as user calls for columns. - % \vtop will set a single line and will also let text wrap and - % continue for many paragraphs if desired. - \halign\bgroup &% - \global\advance\colcount by 1 - \multistrut - \vtop{% - % Use the current \colcount to find the correct column width: - \hsize=\expandafter\csname col\the\colcount\endcsname - % - % In order to keep entries from bumping into each other - % we will add a \leftskip of \multitablecolspace to all columns after - % the first one. - % - % If a template has been used, we will add \multitablecolspace - % to the width of each template entry. - % - % If the user has set preamble in terms of percent of \hsize we will - % use that dimension as the width of the column, and the \leftskip - % will keep entries from bumping into each other. Table will start at - % left margin and final column will justify at right margin. - % - % Make sure we don't inherit \rightskip from the outer environment. - \rightskip=0pt - \ifnum\colcount=1 - % The first column will be indented with the surrounding text. - \advance\hsize by\leftskip - \else - \ifsetpercent \else - % If user has not set preamble in terms of percent of \hsize - % we will advance \hsize by \multitablecolspace. - \advance\hsize by \multitablecolspace - \fi - % In either case we will make \leftskip=\multitablecolspace: - \leftskip=\multitablecolspace - \fi - % Ignoring space at the beginning and end avoids an occasional spurious - % blank line, when TeX decides to break the line at the space before the - % box from the multistrut, so the strut ends up on a line by itself. - % For example: - % @multitable @columnfractions .11 .89 - % @item @code{#} - % @tab Legal holiday which is valid in major parts of the whole country. - % Is automatically provided with highlighting sequences respectively - % marking characters. - \noindent\ignorespaces##\unskip\multistrut - }\cr -} -\def\Emultitable{% - \crcr - \egroup % end the \halign - \global\setpercentfalse -} - -\def\setmultitablespacing{% - \def\multistrut{\strut}% just use the standard line spacing - % - % Compute \multitablelinespace (if not defined by user) for use in - % \multitableparskip calculation. We used define \multistrut based on - % this, but (ironically) that caused the spacing to be off. - % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. -\ifdim\multitablelinespace=0pt -\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip -\global\advance\multitablelinespace by-\ht0 -\fi -%% Test to see if parskip is larger than space between lines of -%% table. If not, do nothing. -%% If so, set to same dimension as multitablelinespace. -\ifdim\multitableparskip>\multitablelinespace -\global\multitableparskip=\multitablelinespace -\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller - %% than skip between lines in the table. -\fi% -\ifdim\multitableparskip=0pt -\global\multitableparskip=\multitablelinespace -\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller - %% than skip between lines in the table. -\fi} - - -\message{conditionals,} - -% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, -% @ifnotxml always succeed. They currently do nothing; we don't -% attempt to check whether the conditionals are properly nested. But we -% have to remember that they are conditionals, so that @end doesn't -% attempt to close an environment group. -% -\def\makecond#1{% - \expandafter\let\csname #1\endcsname = \relax - \expandafter\let\csname iscond.#1\endcsname = 1 -} -\makecond{iftex} -\makecond{ifnotdocbook} -\makecond{ifnothtml} -\makecond{ifnotinfo} -\makecond{ifnotplaintext} -\makecond{ifnotxml} - -% Ignore @ignore, @ifhtml, @ifinfo, and the like. -% -\def\direntry{\doignore{direntry}} -\def\documentdescription{\doignore{documentdescription}} -\def\docbook{\doignore{docbook}} -\def\html{\doignore{html}} -\def\ifdocbook{\doignore{ifdocbook}} -\def\ifhtml{\doignore{ifhtml}} -\def\ifinfo{\doignore{ifinfo}} -\def\ifnottex{\doignore{ifnottex}} -\def\ifplaintext{\doignore{ifplaintext}} -\def\ifxml{\doignore{ifxml}} -\def\ignore{\doignore{ignore}} -\def\menu{\doignore{menu}} -\def\xml{\doignore{xml}} - -% Ignore text until a line `@end #1', keeping track of nested conditionals. -% -% A count to remember the depth of nesting. -\newcount\doignorecount - -\def\doignore#1{\begingroup - % Scan in ``verbatim'' mode: - \obeylines - \catcode`\@ = \other - \catcode`\{ = \other - \catcode`\} = \other - % - % Make sure that spaces turn into tokens that match what \doignoretext wants. - \spaceisspace - % - % Count number of #1's that we've seen. - \doignorecount = 0 - % - % Swallow text until we reach the matching `@end #1'. - \dodoignore{#1}% -} - -{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. - \obeylines % - % - \gdef\dodoignore#1{% - % #1 contains the command name as a string, e.g., `ifinfo'. - % - % Define a command to find the next `@end #1'. - \long\def\doignoretext##1^^M@end #1{% - \doignoretextyyy##1^^M@#1\_STOP_}% - % - % And this command to find another #1 command, at the beginning of a - % line. (Otherwise, we would consider a line `@c @ifset', for - % example, to count as an @ifset for nesting.) - \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% - % - % And now expand that command. - \doignoretext ^^M% - }% -} - -\def\doignoreyyy#1{% - \def\temp{#1}% - \ifx\temp\empty % Nothing found. - \let\next\doignoretextzzz - \else % Found a nested condition, ... - \advance\doignorecount by 1 - \let\next\doignoretextyyy % ..., look for another. - % If we're here, #1 ends with ^^M\ifinfo (for example). - \fi - \next #1% the token \_STOP_ is present just after this macro. -} - -% We have to swallow the remaining "\_STOP_". -% -\def\doignoretextzzz#1{% - \ifnum\doignorecount = 0 % We have just found the outermost @end. - \let\next\enddoignore - \else % Still inside a nested condition. - \advance\doignorecount by -1 - \let\next\doignoretext % Look for the next @end. - \fi - \next -} - -% Finish off ignored text. -{ \obeylines% - % Ignore anything after the last `@end #1'; this matters in verbatim - % environments, where otherwise the newline after an ignored conditional - % would result in a blank line in the output. - \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% -} - - -% @set VAR sets the variable VAR to an empty value. -% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. -% -% Since we want to separate VAR from REST-OF-LINE (which might be -% empty), we can't just use \parsearg; we have to insert a space of our -% own to delimit the rest of the line, and then take it out again if we -% didn't need it. -% We rely on the fact that \parsearg sets \catcode`\ =10. -% -\parseargdef\set{\setyyy#1 \endsetyyy} -\def\setyyy#1 #2\endsetyyy{% - {% - \makevalueexpandable - \def\temp{#2}% - \edef\next{\gdef\makecsname{SET#1}}% - \ifx\temp\empty - \next{}% - \else - \setzzz#2\endsetzzz - \fi - }% -} -% Remove the trailing space \setxxx inserted. -\def\setzzz#1 \endsetzzz{\next{#1}} - -% @clear VAR clears (i.e., unsets) the variable VAR. -% -\parseargdef\clear{% - {% - \makevalueexpandable - \global\expandafter\let\csname SET#1\endcsname=\relax - }% -} - -% @value{foo} gets the text saved in variable foo. -\def\value{\begingroup\makevalueexpandable\valuexxx} -\def\valuexxx#1{\expandablevalue{#1}\endgroup} -{ - \catcode`\- = \active \catcode`\_ = \active - % - \gdef\makevalueexpandable{% - \let\value = \expandablevalue - % We don't want these characters active, ... - \catcode`\-=\other \catcode`\_=\other - % ..., but we might end up with active ones in the argument if - % we're called from @code, as @code{@value{foo-bar_}}, though. - % So \let them to their normal equivalents. - \let-\realdash \let_\normalunderscore - } -} - -% We have this subroutine so that we can handle at least some @value's -% properly in indexes (we call \makevalueexpandable in \indexdummies). -% The command has to be fully expandable (if the variable is set), since -% the result winds up in the index file. This means that if the -% variable's value contains other Texinfo commands, it's almost certain -% it will fail (although perhaps we could fix that with sufficient work -% to do a one-level expansion on the result, instead of complete). -% -\def\expandablevalue#1{% - \expandafter\ifx\csname SET#1\endcsname\relax - {[No value for ``#1'']}% - \message{Variable `#1', used in @value, is not set.}% - \else - \csname SET#1\endcsname - \fi -} - -% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined -% with @set. -% -% To get special treatment of `@end ifset,' call \makeond and the redefine. -% -\makecond{ifset} -\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} -\def\doifset#1#2{% - {% - \makevalueexpandable - \let\next=\empty - \expandafter\ifx\csname SET#2\endcsname\relax - #1% If not set, redefine \next. - \fi - \expandafter - }\next -} -\def\ifsetfail{\doignore{ifset}} - -% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been -% defined with @set, or has been undefined with @clear. -% -% The `\else' inside the `\doifset' parameter is a trick to reuse the -% above code: if the variable is not set, do nothing, if it is set, -% then redefine \next to \ifclearfail. -% -\makecond{ifclear} -\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} -\def\ifclearfail{\doignore{ifclear}} - -% @dircategory CATEGORY -- specify a category of the dir file -% which this file should belong to. Ignore this in TeX. -\let\dircategory=\comment - -% @defininfoenclose. -\let\definfoenclose=\comment - - -\message{indexing,} -% Index generation facilities - -% Define \newwrite to be identical to plain tex's \newwrite -% except not \outer, so it can be used within macros and \if's. -\edef\newwrite{\makecsname{ptexnewwrite}} - -% \newindex {foo} defines an index named foo. -% It automatically defines \fooindex such that -% \fooindex ...rest of line... puts an entry in the index foo. -% It also defines \fooindfile to be the number of the output channel for -% the file that accumulates this index. The file's extension is foo. -% The name of an index should be no more than 2 characters long -% for the sake of vms. -% -\def\newindex#1{% - \iflinks - \expandafter\newwrite \csname#1indfile\endcsname - \openout \csname#1indfile\endcsname \jobname.#1 % Open the file - \fi - \expandafter\xdef\csname#1index\endcsname{% % Define @#1index - \noexpand\doindex{#1}} -} - -% @defindex foo == \newindex{foo} -% -\def\defindex{\parsearg\newindex} - -% Define @defcodeindex, like @defindex except put all entries in @code. -% -\def\defcodeindex{\parsearg\newcodeindex} -% -\def\newcodeindex#1{% - \iflinks - \expandafter\newwrite \csname#1indfile\endcsname - \openout \csname#1indfile\endcsname \jobname.#1 - \fi - \expandafter\xdef\csname#1index\endcsname{% - \noexpand\docodeindex{#1}}% -} - - -% @synindex foo bar makes index foo feed into index bar. -% Do this instead of @defindex foo if you don't want it as a separate index. -% -% @syncodeindex foo bar similar, but put all entries made for index foo -% inside @code. -% -\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} -\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} - -% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), -% #3 the target index (bar). -\def\dosynindex#1#2#3{% - % Only do \closeout if we haven't already done it, else we'll end up - % closing the target index. - \expandafter \ifx\csname donesynindex#2\endcsname \relax - % The \closeout helps reduce unnecessary open files; the limit on the - % Acorn RISC OS is a mere 16 files. - \expandafter\closeout\csname#2indfile\endcsname - \expandafter\let\csname donesynindex#2\endcsname = 1 - \fi - % redefine \fooindfile: - \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname - \expandafter\let\csname#2indfile\endcsname=\temp - % redefine \fooindex: - \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% -} - -% Define \doindex, the driver for all \fooindex macros. -% Argument #1 is generated by the calling \fooindex macro, -% and it is "foo", the name of the index. - -% \doindex just uses \parsearg; it calls \doind for the actual work. -% This is because \doind is more useful to call from other macros. - -% There is also \dosubind {index}{topic}{subtopic} -% which makes an entry in a two-level index such as the operation index. - -\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} -\def\singleindexer #1{\doind{\indexname}{#1}} - -% like the previous two, but they put @code around the argument. -\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} -\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} - -% Take care of Texinfo commands that can appear in an index entry. -% Since there are some commands we want to expand, and others we don't, -% we have to laboriously prevent expansion for those that we don't. -% -\def\indexdummies{% - \escapechar = `\\ % use backslash in output files. - \def\@{@}% change to @@ when we switch to @ as escape char in index files. - \def\ {\realbackslash\space }% - % - % Need these in case \tex is in effect and \{ is a \delimiter again. - % But can't use \lbracecmd and \rbracecmd because texindex assumes - % braces and backslashes are used only as delimiters. - \let\{ = \mylbrace - \let\} = \myrbrace - % - % I don't entirely understand this, but when an index entry is - % generated from a macro call, the \endinput which \scanmacro inserts - % causes processing to be prematurely terminated. This is, - % apparently, because \indexsorttmp is fully expanded, and \endinput - % is an expandable command. The redefinition below makes \endinput - % disappear altogether for that purpose -- although logging shows that - % processing continues to some further point. On the other hand, it - % seems \endinput does not hurt in the printed index arg, since that - % is still getting written without apparent harm. - % - % Sample source (mac-idx3.tex, reported by Graham Percival to - % help-texinfo, 22may06): - % @macro funindex {WORD} - % @findex xyz - % @end macro - % ... - % @funindex commtest - % - % The above is not enough to reproduce the bug, but it gives the flavor. - % - % Sample whatsit resulting: - % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} - % - % So: - \let\endinput = \empty - % - % Do the redefinitions. - \commondummies -} - -% For the aux and toc files, @ is the escape character. So we want to -% redefine everything using @ as the escape character (instead of -% \realbackslash, still used for index files). When everything uses @, -% this will be simpler. -% -\def\atdummies{% - \def\@{@@}% - \def\ {@ }% - \let\{ = \lbraceatcmd - \let\} = \rbraceatcmd - % - % Do the redefinitions. - \commondummies - \otherbackslash -} - -% Called from \indexdummies and \atdummies. -% -\def\commondummies{% - % - % \definedummyword defines \#1 as \string\#1\space, thus effectively - % preventing its expansion. This is used only for control% words, - % not control letters, because the \space would be incorrect for - % control characters, but is needed to separate the control word - % from whatever follows. - % - % For control letters, we have \definedummyletter, which omits the - % space. - % - % These can be used both for control words that take an argument and - % those that do not. If it is followed by {arg} in the input, then - % that will dutifully get written to the index (or wherever). - % - \def\definedummyword ##1{\def##1{\string##1\space}}% - \def\definedummyletter##1{\def##1{\string##1}}% - \let\definedummyaccent\definedummyletter - % - \commondummiesnofonts - % - \definedummyletter\_% - % - % Non-English letters. - \definedummyword\AA - \definedummyword\AE - \definedummyword\DH - \definedummyword\L - \definedummyword\O - \definedummyword\OE - \definedummyword\TH - \definedummyword\aa - \definedummyword\ae - \definedummyword\dh - \definedummyword\exclamdown - \definedummyword\l - \definedummyword\o - \definedummyword\oe - \definedummyword\ordf - \definedummyword\ordm - \definedummyword\questiondown - \definedummyword\ss - \definedummyword\th - % - % Although these internal commands shouldn't show up, sometimes they do. - \definedummyword\bf - \definedummyword\gtr - \definedummyword\hat - \definedummyword\less - \definedummyword\sf - \definedummyword\sl - \definedummyword\tclose - \definedummyword\tt - % - \definedummyword\LaTeX - \definedummyword\TeX - % - % Assorted special characters. - \definedummyword\bullet - \definedummyword\comma - \definedummyword\copyright - \definedummyword\registeredsymbol - \definedummyword\dots - \definedummyword\enddots - \definedummyword\equiv - \definedummyword\error - \definedummyword\euro - \definedummyword\guillemetleft - \definedummyword\guillemetright - \definedummyword\guilsinglleft - \definedummyword\guilsinglright - \definedummyword\expansion - \definedummyword\minus - \definedummyword\ogonek - \definedummyword\pounds - \definedummyword\point - \definedummyword\print - \definedummyword\quotedblbase - \definedummyword\quotedblleft - \definedummyword\quotedblright - \definedummyword\quoteleft - \definedummyword\quoteright - \definedummyword\quotesinglbase - \definedummyword\result - \definedummyword\textdegree - % - % We want to disable all macros so that they are not expanded by \write. - \macrolist - % - \normalturnoffactive - % - % Handle some cases of @value -- where it does not contain any - % (non-fully-expandable) commands. - \makevalueexpandable -} - -% \commondummiesnofonts: common to \commondummies and \indexnofonts. -% -\def\commondummiesnofonts{% - % Control letters and accents. - \definedummyletter\!% - \definedummyaccent\"% - \definedummyaccent\'% - \definedummyletter\*% - \definedummyaccent\,% - \definedummyletter\.% - \definedummyletter\/% - \definedummyletter\:% - \definedummyaccent\=% - \definedummyletter\?% - \definedummyaccent\^% - \definedummyaccent\`% - \definedummyaccent\~% - \definedummyword\u - \definedummyword\v - \definedummyword\H - \definedummyword\dotaccent - \definedummyword\ogonek - \definedummyword\ringaccent - \definedummyword\tieaccent - \definedummyword\ubaraccent - \definedummyword\udotaccent - \definedummyword\dotless - % - % Texinfo font commands. - \definedummyword\b - \definedummyword\i - \definedummyword\r - \definedummyword\sc - \definedummyword\t - % - % Commands that take arguments. - \definedummyword\acronym - \definedummyword\cite - \definedummyword\code - \definedummyword\command - \definedummyword\dfn - \definedummyword\email - \definedummyword\emph - \definedummyword\env - \definedummyword\file - \definedummyword\kbd - \definedummyword\key - \definedummyword\math - \definedummyword\option - \definedummyword\pxref - \definedummyword\ref - \definedummyword\samp - \definedummyword\strong - \definedummyword\tie - \definedummyword\uref - \definedummyword\url - \definedummyword\var - \definedummyword\verb - \definedummyword\w - \definedummyword\xref -} - -% \indexnofonts is used when outputting the strings to sort the index -% by, and when constructing control sequence names. It eliminates all -% control sequences and just writes whatever the best ASCII sort string -% would be for a given command (usually its argument). -% -\def\indexnofonts{% - % Accent commands should become @asis. - \def\definedummyaccent##1{\let##1\asis}% - % We can just ignore other control letters. - \def\definedummyletter##1{\let##1\empty}% - % Hopefully, all control words can become @asis. - \let\definedummyword\definedummyaccent - % - \commondummiesnofonts - % - % Don't no-op \tt, since it isn't a user-level command - % and is used in the definitions of the active chars like <, >, |, etc. - % Likewise with the other plain tex font commands. - %\let\tt=\asis - % - \def\ { }% - \def\@{@}% - % how to handle braces? - \def\_{\normalunderscore}% - % - % Non-English letters. - \def\AA{AA}% - \def\AE{AE}% - \def\DH{DZZ}% - \def\L{L}% - \def\OE{OE}% - \def\O{O}% - \def\TH{ZZZ}% - \def\aa{aa}% - \def\ae{ae}% - \def\dh{dzz}% - \def\exclamdown{!}% - \def\l{l}% - \def\oe{oe}% - \def\ordf{a}% - \def\ordm{o}% - \def\o{o}% - \def\questiondown{?}% - \def\ss{ss}% - \def\th{zzz}% - % - \def\LaTeX{LaTeX}% - \def\TeX{TeX}% - % - % Assorted special characters. - % (The following {} will end up in the sort string, but that's ok.) - \def\bullet{bullet}% - \def\comma{,}% - \def\copyright{copyright}% - \def\dots{...}% - \def\enddots{...}% - \def\equiv{==}% - \def\error{error}% - \def\euro{euro}% - \def\expansion{==>}% - \def\guillemetleft{<<}% - \def\guillemetright{>>}% - \def\guilsinglleft{<}% - \def\guilsinglright{>}% - \def\minus{-}% - \def\point{.}% - \def\pounds{pounds}% - \def\print{-|}% - \def\quotedblbase{"}% - \def\quotedblleft{"}% - \def\quotedblright{"}% - \def\quoteleft{`}% - \def\quoteright{'}% - \def\quotesinglbase{,}% - \def\registeredsymbol{R}% - \def\result{=>}% - \def\textdegree{o}% - % - % We need to get rid of all macros, leaving only the arguments (if present). - % Of course this is not nearly correct, but it is the best we can do for now. - % makeinfo does not expand macros in the argument to @deffn, which ends up - % writing an index entry, and texindex isn't prepared for an index sort entry - % that starts with \. - % - % Since macro invocations are followed by braces, we can just redefine them - % to take a single TeX argument. The case of a macro invocation that - % goes to end-of-line is not handled. - % - \macrolist -} - -\let\indexbackslash=0 %overridden during \printindex. -\let\SETmarginindex=\relax % put index entries in margin (undocumented)? - -% Most index entries go through here, but \dosubind is the general case. -% #1 is the index name, #2 is the entry text. -\def\doind#1#2{\dosubind{#1}{#2}{}} - -% Workhorse for all \fooindexes. -% #1 is name of index, #2 is stuff to put there, #3 is subentry -- -% empty if called from \doind, as we usually are (the main exception -% is with most defuns, which call us directly). -% -\def\dosubind#1#2#3{% - \iflinks - {% - % Store the main index entry text (including the third arg). - \toks0 = {#2}% - % If third arg is present, precede it with a space. - \def\thirdarg{#3}% - \ifx\thirdarg\empty \else - \toks0 = \expandafter{\the\toks0 \space #3}% - \fi - % - \edef\writeto{\csname#1indfile\endcsname}% - % - \safewhatsit\dosubindwrite - }% - \fi -} - -% Write the entry in \toks0 to the index file: -% -\def\dosubindwrite{% - % Put the index entry in the margin if desired. - \ifx\SETmarginindex\relax\else - \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% - \fi - % - % Remember, we are within a group. - \indexdummies % Must do this here, since \bf, etc expand at this stage - \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now - % so it will be output as is; and it will print as backslash. - % - % Process the index entry with all font commands turned off, to - % get the string to sort by. - {\indexnofonts - \edef\temp{\the\toks0}% need full expansion - \xdef\indexsorttmp{\temp}% - }% - % - % Set up the complete index entry, with both the sort key and - % the original text, including any font commands. We write - % three arguments to \entry to the .?? file (four in the - % subentry case), texindex reduces to two when writing the .??s - % sorted result. - \edef\temp{% - \write\writeto{% - \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% - }% - \temp -} - -% Take care of unwanted page breaks/skips around a whatsit: -% -% If a skip is the last thing on the list now, preserve it -% by backing up by \lastskip, doing the \write, then inserting -% the skip again. Otherwise, the whatsit generated by the -% \write or \pdfdest will make \lastskip zero. The result is that -% sequences like this: -% @end defun -% @tindex whatever -% @defun ... -% will have extra space inserted, because the \medbreak in the -% start of the @defun won't see the skip inserted by the @end of -% the previous defun. -% -% But don't do any of this if we're not in vertical mode. We -% don't want to do a \vskip and prematurely end a paragraph. -% -% Avoid page breaks due to these extra skips, too. -% -% But wait, there is a catch there: -% We'll have to check whether \lastskip is zero skip. \ifdim is not -% sufficient for this purpose, as it ignores stretch and shrink parts -% of the skip. The only way seems to be to check the textual -% representation of the skip. -% -% The following is almost like \def\zeroskipmacro{0.0pt} except that -% the ``p'' and ``t'' characters have catcode \other, not 11 (letter). -% -\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} -% -\newskip\whatsitskip -\newcount\whatsitpenalty -% -% ..., ready, GO: -% -\def\safewhatsit#1{% -\ifhmode - #1% -\else - % \lastskip and \lastpenalty cannot both be nonzero simultaneously. - \whatsitskip = \lastskip - \edef\lastskipmacro{\the\lastskip}% - \whatsitpenalty = \lastpenalty - % - % If \lastskip is nonzero, that means the last item was a - % skip. And since a skip is discardable, that means this - % -\whatsitskip glue we're inserting is preceded by a - % non-discardable item, therefore it is not a potential - % breakpoint, therefore no \nobreak needed. - \ifx\lastskipmacro\zeroskipmacro - \else - \vskip-\whatsitskip - \fi - % - #1% - % - \ifx\lastskipmacro\zeroskipmacro - % If \lastskip was zero, perhaps the last item was a penalty, and - % perhaps it was >=10000, e.g., a \nobreak. In that case, we want - % to re-insert the same penalty (values >10000 are used for various - % signals); since we just inserted a non-discardable item, any - % following glue (such as a \parskip) would be a breakpoint. For example: - % - % @deffn deffn-whatever - % @vindex index-whatever - % Description. - % would allow a break between the index-whatever whatsit - % and the "Description." paragraph. - \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi - \else - % On the other hand, if we had a nonzero \lastskip, - % this make-up glue would be preceded by a non-discardable item - % (the whatsit from the \write), so we must insert a \nobreak. - \nobreak\vskip\whatsitskip - \fi -\fi -} - -% The index entry written in the file actually looks like -% \entry {sortstring}{page}{topic} -% or -% \entry {sortstring}{page}{topic}{subtopic} -% The texindex program reads in these files and writes files -% containing these kinds of lines: -% \initial {c} -% before the first topic whose initial is c -% \entry {topic}{pagelist} -% for a topic that is used without subtopics -% \primary {topic} -% for the beginning of a topic that is used with subtopics -% \secondary {subtopic}{pagelist} -% for each subtopic. - -% Define the user-accessible indexing commands -% @findex, @vindex, @kindex, @cindex. - -\def\findex {\fnindex} -\def\kindex {\kyindex} -\def\cindex {\cpindex} -\def\vindex {\vrindex} -\def\tindex {\tpindex} -\def\pindex {\pgindex} - -\def\cindexsub {\begingroup\obeylines\cindexsub} -{\obeylines % -\gdef\cindexsub "#1" #2^^M{\endgroup % -\dosubind{cp}{#2}{#1}}} - -% Define the macros used in formatting output of the sorted index material. - -% @printindex causes a particular index (the ??s file) to get printed. -% It does not print any chapter heading (usually an @unnumbered). -% -\parseargdef\printindex{\begingroup - \dobreak \chapheadingskip{10000}% - % - \smallfonts \rm - \tolerance = 9500 - \plainfrenchspacing - \everypar = {}% don't want the \kern\-parindent from indentation suppression. - % - % See if the index file exists and is nonempty. - % Change catcode of @ here so that if the index file contains - % \initial {@} - % as its first line, TeX doesn't complain about mismatched braces - % (because it thinks @} is a control sequence). - \catcode`\@ = 11 - \openin 1 \jobname.#1s - \ifeof 1 - % \enddoublecolumns gets confused if there is no text in the index, - % and it loses the chapter title and the aux file entries for the - % index. The easiest way to prevent this problem is to make sure - % there is some text. - \putwordIndexNonexistent - \else - % - % If the index file exists but is empty, then \openin leaves \ifeof - % false. We have to make TeX try to read something from the file, so - % it can discover if there is anything in it. - \read 1 to \temp - \ifeof 1 - \putwordIndexIsEmpty - \else - % Index files are almost Texinfo source, but we use \ as the escape - % character. It would be better to use @, but that's too big a change - % to make right now. - \def\indexbackslash{\backslashcurfont}% - \catcode`\\ = 0 - \escapechar = `\\ - \begindoublecolumns - \input \jobname.#1s - \enddoublecolumns - \fi - \fi - \closein 1 -\endgroup} - -% These macros are used by the sorted index file itself. -% Change them to control the appearance of the index. - -\def\initial#1{{% - % Some minor font changes for the special characters. - \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt - % - % Remove any glue we may have, we'll be inserting our own. - \removelastskip - % - % We like breaks before the index initials, so insert a bonus. - \nobreak - \vskip 0pt plus 3\baselineskip - \penalty 0 - \vskip 0pt plus -3\baselineskip - % - % Typeset the initial. Making this add up to a whole number of - % baselineskips increases the chance of the dots lining up from column - % to column. It still won't often be perfect, because of the stretch - % we need before each entry, but it's better. - % - % No shrink because it confuses \balancecolumns. - \vskip 1.67\baselineskip plus .5\baselineskip - \leftline{\secbf #1}% - % Do our best not to break after the initial. - \nobreak - \vskip .33\baselineskip plus .1\baselineskip -}} - -% \entry typesets a paragraph consisting of the text (#1), dot leaders, and -% then page number (#2) flushed to the right margin. It is used for index -% and table of contents entries. The paragraph is indented by \leftskip. -% -% A straightforward implementation would start like this: -% \def\entry#1#2{... -% But this freezes the catcodes in the argument, and can cause problems to -% @code, which sets - active. This problem was fixed by a kludge--- -% ``-'' was active throughout whole index, but this isn't really right. -% -% The right solution is to prevent \entry from swallowing the whole text. -% --kasal, 21nov03 -\def\entry{% - \begingroup - % - % Start a new paragraph if necessary, so our assignments below can't - % affect previous text. - \par - % - % Do not fill out the last line with white space. - \parfillskip = 0in - % - % No extra space above this paragraph. - \parskip = 0in - % - % Do not prefer a separate line ending with a hyphen to fewer lines. - \finalhyphendemerits = 0 - % - % \hangindent is only relevant when the entry text and page number - % don't both fit on one line. In that case, bob suggests starting the - % dots pretty far over on the line. Unfortunately, a large - % indentation looks wrong when the entry text itself is broken across - % lines. So we use a small indentation and put up with long leaders. - % - % \hangafter is reset to 1 (which is the value we want) at the start - % of each paragraph, so we need not do anything with that. - \hangindent = 2em - % - % When the entry text needs to be broken, just fill out the first line - % with blank space. - \rightskip = 0pt plus1fil - % - % A bit of stretch before each entry for the benefit of balancing - % columns. - \vskip 0pt plus1pt - % - % Swallow the left brace of the text (first parameter): - \afterassignment\doentry - \let\temp = -} -\def\doentry{% - \bgroup % Instead of the swallowed brace. - \noindent - \aftergroup\finishentry - % And now comes the text of the entry. -} -\def\finishentry#1{% - % #1 is the page number. - % - % The following is kludged to not output a line of dots in the index if - % there are no page numbers. The next person who breaks this will be - % cursed by a Unix daemon. - \setbox\boxA = \hbox{#1}% - \ifdim\wd\boxA = 0pt - \ % - \else - % - % If we must, put the page number on a line of its own, and fill out - % this line with blank space. (The \hfil is overwhelmed with the - % fill leaders glue in \indexdotfill if the page number does fit.) - \hfil\penalty50 - \null\nobreak\indexdotfill % Have leaders before the page number. - % - % The `\ ' here is removed by the implicit \unskip that TeX does as - % part of (the primitive) \par. Without it, a spurious underfull - % \hbox ensues. - \ifpdf - \pdfgettoks#1.% - \ \the\toksA - \else - \ #1% - \fi - \fi - \par - \endgroup -} - -% Like plain.tex's \dotfill, except uses up at least 1 em. -\def\indexdotfill{\cleaders - \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} - -\def\primary #1{\line{#1\hfil}} - -\newskip\secondaryindent \secondaryindent=0.5cm -\def\secondary#1#2{{% - \parfillskip=0in - \parskip=0in - \hangindent=1in - \hangafter=1 - \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill - \ifpdf - \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. - \else - #2 - \fi - \par -}} - -% Define two-column mode, which we use to typeset indexes. -% Adapted from the TeXbook, page 416, which is to say, -% the manmac.tex format used to print the TeXbook itself. -\catcode`\@=11 - -\newbox\partialpage -\newdimen\doublecolumnhsize - -\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns - % Grab any single-column material above us. - \output = {% - % - % Here is a possibility not foreseen in manmac: if we accumulate a - % whole lot of material, we might end up calling this \output - % routine twice in a row (see the doublecol-lose test, which is - % essentially a couple of indexes with @setchapternewpage off). In - % that case we just ship out what is in \partialpage with the normal - % output routine. Generally, \partialpage will be empty when this - % runs and this will be a no-op. See the indexspread.tex test case. - \ifvoid\partialpage \else - \onepageout{\pagecontents\partialpage}% - \fi - % - \global\setbox\partialpage = \vbox{% - % Unvbox the main output page. - \unvbox\PAGE - \kern-\topskip \kern\baselineskip - }% - }% - \eject % run that output routine to set \partialpage - % - % Use the double-column output routine for subsequent pages. - \output = {\doublecolumnout}% - % - % Change the page size parameters. We could do this once outside this - % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 - % format, but then we repeat the same computation. Repeating a couple - % of assignments once per index is clearly meaningless for the - % execution time, so we may as well do it in one place. - % - % First we halve the line length, less a little for the gutter between - % the columns. We compute the gutter based on the line length, so it - % changes automatically with the paper format. The magic constant - % below is chosen so that the gutter has the same value (well, +-<1pt) - % as it did when we hard-coded it. - % - % We put the result in a separate register, \doublecolumhsize, so we - % can restore it in \pagesofar, after \hsize itself has (potentially) - % been clobbered. - % - \doublecolumnhsize = \hsize - \advance\doublecolumnhsize by -.04154\hsize - \divide\doublecolumnhsize by 2 - \hsize = \doublecolumnhsize - % - % Double the \vsize as well. (We don't need a separate register here, - % since nobody clobbers \vsize.) - \vsize = 2\vsize -} - -% The double-column output routine for all double-column pages except -% the last. -% -\def\doublecolumnout{% - \splittopskip=\topskip \splitmaxdepth=\maxdepth - % Get the available space for the double columns -- the normal - % (undoubled) page height minus any material left over from the - % previous page. - \dimen@ = \vsize - \divide\dimen@ by 2 - \advance\dimen@ by -\ht\partialpage - % - % box0 will be the left-hand column, box2 the right. - \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ - \onepageout\pagesofar - \unvbox255 - \penalty\outputpenalty -} -% -% Re-output the contents of the output page -- any previous material, -% followed by the two boxes we just split, in box0 and box2. -\def\pagesofar{% - \unvbox\partialpage - % - \hsize = \doublecolumnhsize - \wd0=\hsize \wd2=\hsize - \hbox to\pagewidth{\box0\hfil\box2}% -} -% -% All done with double columns. -\def\enddoublecolumns{% - % The following penalty ensures that the page builder is exercised - % _before_ we change the output routine. This is necessary in the - % following situation: - % - % The last section of the index consists only of a single entry. - % Before this section, \pagetotal is less than \pagegoal, so no - % break occurs before the last section starts. However, the last - % section, consisting of \initial and the single \entry, does not - % fit on the page and has to be broken off. Without the following - % penalty the page builder will not be exercised until \eject - % below, and by that time we'll already have changed the output - % routine to the \balancecolumns version, so the next-to-last - % double-column page will be processed with \balancecolumns, which - % is wrong: The two columns will go to the main vertical list, with - % the broken-off section in the recent contributions. As soon as - % the output routine finishes, TeX starts reconsidering the page - % break. The two columns and the broken-off section both fit on the - % page, because the two columns now take up only half of the page - % goal. When TeX sees \eject from below which follows the final - % section, it invokes the new output routine that we've set after - % \balancecolumns below; \onepageout will try to fit the two columns - % and the final section into the vbox of \pageheight (see - % \pagebody), causing an overfull box. - % - % Note that glue won't work here, because glue does not exercise the - % page builder, unlike penalties (see The TeXbook, pp. 280-281). - \penalty0 - % - \output = {% - % Split the last of the double-column material. Leave it on the - % current page, no automatic page break. - \balancecolumns - % - % If we end up splitting too much material for the current page, - % though, there will be another page break right after this \output - % invocation ends. Having called \balancecolumns once, we do not - % want to call it again. Therefore, reset \output to its normal - % definition right away. (We hope \balancecolumns will never be - % called on to balance too much material, but if it is, this makes - % the output somewhat more palatable.) - \global\output = {\onepageout{\pagecontents\PAGE}}% - }% - \eject - \endgroup % started in \begindoublecolumns - % - % \pagegoal was set to the doubled \vsize above, since we restarted - % the current page. We're now back to normal single-column - % typesetting, so reset \pagegoal to the normal \vsize (after the - % \endgroup where \vsize got restored). - \pagegoal = \vsize -} -% -% Called at the end of the double column material. -\def\balancecolumns{% - \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. - \dimen@ = \ht0 - \advance\dimen@ by \topskip - \advance\dimen@ by-\baselineskip - \divide\dimen@ by 2 % target to split to - %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% - \splittopskip = \topskip - % Loop until we get a decent breakpoint. - {% - \vbadness = 10000 - \loop - \global\setbox3 = \copy0 - \global\setbox1 = \vsplit3 to \dimen@ - \ifdim\ht3>\dimen@ - \global\advance\dimen@ by 1pt - \repeat - }% - %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% - \setbox0=\vbox to\dimen@{\unvbox1}% - \setbox2=\vbox to\dimen@{\unvbox3}% - % - \pagesofar -} -\catcode`\@ = \other - - -\message{sectioning,} -% Chapters, sections, etc. - -% \unnumberedno is an oxymoron, of course. But we count the unnumbered -% sections so that we can refer to them unambiguously in the pdf -% outlines by their "section number". We avoid collisions with chapter -% numbers by starting them at 10000. (If a document ever has 10000 -% chapters, we're in trouble anyway, I'm sure.) -\newcount\unnumberedno \unnumberedno = 10000 -\newcount\chapno -\newcount\secno \secno=0 -\newcount\subsecno \subsecno=0 -\newcount\subsubsecno \subsubsecno=0 - -% This counter is funny since it counts through charcodes of letters A, B, ... -\newcount\appendixno \appendixno = `\@ -% -% \def\appendixletter{\char\the\appendixno} -% We do the following ugly conditional instead of the above simple -% construct for the sake of pdftex, which needs the actual -% letter in the expansion, not just typeset. -% -\def\appendixletter{% - \ifnum\appendixno=`A A% - \else\ifnum\appendixno=`B B% - \else\ifnum\appendixno=`C C% - \else\ifnum\appendixno=`D D% - \else\ifnum\appendixno=`E E% - \else\ifnum\appendixno=`F F% - \else\ifnum\appendixno=`G G% - \else\ifnum\appendixno=`H H% - \else\ifnum\appendixno=`I I% - \else\ifnum\appendixno=`J J% - \else\ifnum\appendixno=`K K% - \else\ifnum\appendixno=`L L% - \else\ifnum\appendixno=`M M% - \else\ifnum\appendixno=`N N% - \else\ifnum\appendixno=`O O% - \else\ifnum\appendixno=`P P% - \else\ifnum\appendixno=`Q Q% - \else\ifnum\appendixno=`R R% - \else\ifnum\appendixno=`S S% - \else\ifnum\appendixno=`T T% - \else\ifnum\appendixno=`U U% - \else\ifnum\appendixno=`V V% - \else\ifnum\appendixno=`W W% - \else\ifnum\appendixno=`X X% - \else\ifnum\appendixno=`Y Y% - \else\ifnum\appendixno=`Z Z% - % The \the is necessary, despite appearances, because \appendixletter is - % expanded while writing the .toc file. \char\appendixno is not - % expandable, thus it is written literally, thus all appendixes come out - % with the same letter (or @) in the toc without it. - \else\char\the\appendixno - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} - -% Each @chapter defines these (using marks) as the number+name, number -% and name of the chapter. Page headings and footings can use -% these. @section does likewise. -\def\thischapter{} -\def\thischapternum{} -\def\thischaptername{} -\def\thissection{} -\def\thissectionnum{} -\def\thissectionname{} - -\newcount\absseclevel % used to calculate proper heading level -\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count - -% @raisesections: treat @section as chapter, @subsection as section, etc. -\def\raisesections{\global\advance\secbase by -1} -\let\up=\raisesections % original BFox name - -% @lowersections: treat @chapter as section, @section as subsection, etc. -\def\lowersections{\global\advance\secbase by 1} -\let\down=\lowersections % original BFox name - -% we only have subsub. -\chardef\maxseclevel = 3 -% -% A numbered section within an unnumbered changes to unnumbered too. -% To achive this, remember the "biggest" unnum. sec. we are currently in: -\chardef\unmlevel = \maxseclevel -% -% Trace whether the current chapter is an appendix or not: -% \chapheadtype is "N" or "A", unnumbered chapters are ignored. -\def\chapheadtype{N} - -% Choose a heading macro -% #1 is heading type -% #2 is heading level -% #3 is text for heading -\def\genhead#1#2#3{% - % Compute the abs. sec. level: - \absseclevel=#2 - \advance\absseclevel by \secbase - % Make sure \absseclevel doesn't fall outside the range: - \ifnum \absseclevel < 0 - \absseclevel = 0 - \else - \ifnum \absseclevel > 3 - \absseclevel = 3 - \fi - \fi - % The heading type: - \def\headtype{#1}% - \if \headtype U% - \ifnum \absseclevel < \unmlevel - \chardef\unmlevel = \absseclevel - \fi - \else - % Check for appendix sections: - \ifnum \absseclevel = 0 - \edef\chapheadtype{\headtype}% - \else - \if \headtype A\if \chapheadtype N% - \errmessage{@appendix... within a non-appendix chapter}% - \fi\fi - \fi - % Check for numbered within unnumbered: - \ifnum \absseclevel > \unmlevel - \def\headtype{U}% - \else - \chardef\unmlevel = 3 - \fi - \fi - % Now print the heading: - \if \headtype U% - \ifcase\absseclevel - \unnumberedzzz{#3}% - \or \unnumberedseczzz{#3}% - \or \unnumberedsubseczzz{#3}% - \or \unnumberedsubsubseczzz{#3}% - \fi - \else - \if \headtype A% - \ifcase\absseclevel - \appendixzzz{#3}% - \or \appendixsectionzzz{#3}% - \or \appendixsubseczzz{#3}% - \or \appendixsubsubseczzz{#3}% - \fi - \else - \ifcase\absseclevel - \chapterzzz{#3}% - \or \seczzz{#3}% - \or \numberedsubseczzz{#3}% - \or \numberedsubsubseczzz{#3}% - \fi - \fi - \fi - \suppressfirstparagraphindent -} - -% an interface: -\def\numhead{\genhead N} -\def\apphead{\genhead A} -\def\unnmhead{\genhead U} - -% @chapter, @appendix, @unnumbered. Increment top-level counter, reset -% all lower-level sectioning counters to zero. -% -% Also set \chaplevelprefix, which we prepend to @float sequence numbers -% (e.g., figures), q.v. By default (before any chapter), that is empty. -\let\chaplevelprefix = \empty -% -\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz -\def\chapterzzz#1{% - % section resetting is \global in case the chapter is in a group, such - % as an @include file. - \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 - \global\advance\chapno by 1 - % - % Used for \float. - \gdef\chaplevelprefix{\the\chapno.}% - \resetallfloatnos - % - % \putwordChapter can contain complex things in translations. - \toks0=\expandafter{\putwordChapter}% - \message{\the\toks0 \space \the\chapno}% - % - % Write the actual heading. - \chapmacro{#1}{Ynumbered}{\the\chapno}% - % - % So @section and the like are numbered underneath this chapter. - \global\let\section = \numberedsec - \global\let\subsection = \numberedsubsec - \global\let\subsubsection = \numberedsubsubsec -} - -\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz -% -\def\appendixzzz#1{% - \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 - \global\advance\appendixno by 1 - \gdef\chaplevelprefix{\appendixletter.}% - \resetallfloatnos - % - % \putwordAppendix can contain complex things in translations. - \toks0=\expandafter{\putwordAppendix}% - \message{\the\toks0 \space \appendixletter}% - % - \chapmacro{#1}{Yappendix}{\appendixletter}% - % - \global\let\section = \appendixsec - \global\let\subsection = \appendixsubsec - \global\let\subsubsection = \appendixsubsubsec -} - -\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz -\def\unnumberedzzz#1{% - \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 - \global\advance\unnumberedno by 1 - % - % Since an unnumbered has no number, no prefix for figures. - \global\let\chaplevelprefix = \empty - \resetallfloatnos - % - % This used to be simply \message{#1}, but TeX fully expands the - % argument to \message. Therefore, if #1 contained @-commands, TeX - % expanded them. For example, in `@unnumbered The @cite{Book}', TeX - % expanded @cite (which turns out to cause errors because \cite is meant - % to be executed, not expanded). - % - % Anyway, we don't want the fully-expanded definition of @cite to appear - % as a result of the \message, we just want `@cite' itself. We use - % \the to achieve this: TeX expands \the only once, - % simply yielding the contents of . (We also do this for - % the toc entries.) - \toks0 = {#1}% - \message{(\the\toks0)}% - % - \chapmacro{#1}{Ynothing}{\the\unnumberedno}% - % - \global\let\section = \unnumberedsec - \global\let\subsection = \unnumberedsubsec - \global\let\subsubsection = \unnumberedsubsubsec -} - -% @centerchap is like @unnumbered, but the heading is centered. -\outer\parseargdef\centerchap{% - % Well, we could do the following in a group, but that would break - % an assumption that \chapmacro is called at the outermost level. - % Thus we are safer this way: --kasal, 24feb04 - \let\centerparametersmaybe = \centerparameters - \unnmhead0{#1}% - \let\centerparametersmaybe = \relax -} - -% @top is like @unnumbered. -\let\top\unnumbered - -% Sections. -\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz -\def\seczzz#1{% - \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 - \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% -} - -\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz -\def\appendixsectionzzz#1{% - \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 - \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% -} -\let\appendixsec\appendixsection - -\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz -\def\unnumberedseczzz#1{% - \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 - \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% -} - -% Subsections. -\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz -\def\numberedsubseczzz#1{% - \global\subsubsecno=0 \global\advance\subsecno by 1 - \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% -} - -\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz -\def\appendixsubseczzz#1{% - \global\subsubsecno=0 \global\advance\subsecno by 1 - \sectionheading{#1}{subsec}{Yappendix}% - {\appendixletter.\the\secno.\the\subsecno}% -} - -\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz -\def\unnumberedsubseczzz#1{% - \global\subsubsecno=0 \global\advance\subsecno by 1 - \sectionheading{#1}{subsec}{Ynothing}% - {\the\unnumberedno.\the\secno.\the\subsecno}% -} - -% Subsubsections. -\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz -\def\numberedsubsubseczzz#1{% - \global\advance\subsubsecno by 1 - \sectionheading{#1}{subsubsec}{Ynumbered}% - {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% -} - -\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz -\def\appendixsubsubseczzz#1{% - \global\advance\subsubsecno by 1 - \sectionheading{#1}{subsubsec}{Yappendix}% - {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% -} - -\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz -\def\unnumberedsubsubseczzz#1{% - \global\advance\subsubsecno by 1 - \sectionheading{#1}{subsubsec}{Ynothing}% - {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% -} - -% These macros control what the section commands do, according -% to what kind of chapter we are in (ordinary, appendix, or unnumbered). -% Define them by default for a numbered chapter. -\let\section = \numberedsec -\let\subsection = \numberedsubsec -\let\subsubsection = \numberedsubsubsec - -% Define @majorheading, @heading and @subheading - -% NOTE on use of \vbox for chapter headings, section headings, and such: -% 1) We use \vbox rather than the earlier \line to permit -% overlong headings to fold. -% 2) \hyphenpenalty is set to 10000 because hyphenation in a -% heading is obnoxious; this forbids it. -% 3) Likewise, headings look best if no \parindent is used, and -% if justification is not attempted. Hence \raggedright. - -\def\majorheading{% - {\advance\chapheadingskip by 10pt \chapbreak }% - \parsearg\chapheadingzzz -} - -\def\chapheading{\chapbreak \parsearg\chapheadingzzz} -\def\chapheadingzzz#1{% - {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\ptexraggedright - \rmisbold #1\hfill}}% - \bigskip \par\penalty 200\relax - \suppressfirstparagraphindent -} - -% @heading, @subheading, @subsubheading. -\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} - \suppressfirstparagraphindent} -\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} - \suppressfirstparagraphindent} -\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} - \suppressfirstparagraphindent} - -% These macros generate a chapter, section, etc. heading only -% (including whitespace, linebreaking, etc. around it), -% given all the information in convenient, parsed form. - -%%% Args are the skip and penalty (usually negative) -\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} - -%%% Define plain chapter starts, and page on/off switching for it -% Parameter controlling skip before chapter headings (if needed) - -\newskip\chapheadingskip - -\def\chapbreak{\dobreak \chapheadingskip {-4000}} -\def\chappager{\par\vfill\supereject} -% Because \domark is called before \chapoddpage, the filler page will -% get the headings for the next chapter, which is wrong. But we don't -% care -- we just disable all headings on the filler page. -\def\chapoddpage{% - \chappager - \ifodd\pageno \else - \begingroup - \evenheadline={\hfil}\evenfootline={\hfil}% - \oddheadline={\hfil}\oddfootline={\hfil}% - \hbox to 0pt{}% - \chappager - \endgroup - \fi -} - -\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} - -\def\CHAPPAGoff{% -\global\let\contentsalignmacro = \chappager -\global\let\pchapsepmacro=\chapbreak -\global\let\pagealignmacro=\chappager} - -\def\CHAPPAGon{% -\global\let\contentsalignmacro = \chappager -\global\let\pchapsepmacro=\chappager -\global\let\pagealignmacro=\chappager -\global\def\HEADINGSon{\HEADINGSsingle}} - -\def\CHAPPAGodd{% -\global\let\contentsalignmacro = \chapoddpage -\global\let\pchapsepmacro=\chapoddpage -\global\let\pagealignmacro=\chapoddpage -\global\def\HEADINGSon{\HEADINGSdouble}} - -\CHAPPAGon - -% Chapter opening. -% -% #1 is the text, #2 is the section type (Ynumbered, Ynothing, -% Yappendix, Yomitfromtoc), #3 the chapter number. -% -% To test against our argument. -\def\Ynothingkeyword{Ynothing} -\def\Yomitfromtockeyword{Yomitfromtoc} -\def\Yappendixkeyword{Yappendix} -% -\def\chapmacro#1#2#3{% - % Insert the first mark before the heading break (see notes for \domark). - \let\prevchapterdefs=\lastchapterdefs - \let\prevsectiondefs=\lastsectiondefs - \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% - \gdef\thissection{}}% - % - \def\temptype{#2}% - \ifx\temptype\Ynothingkeyword - \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% - \gdef\thischapter{\thischaptername}}% - \else\ifx\temptype\Yomitfromtockeyword - \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% - \gdef\thischapter{}}% - \else\ifx\temptype\Yappendixkeyword - \toks0={#1}% - \xdef\lastchapterdefs{% - \gdef\noexpand\thischaptername{\the\toks0}% - \gdef\noexpand\thischapternum{\appendixletter}% - % \noexpand\putwordAppendix avoids expanding indigestible - % commands in some of the translations. - \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} - \noexpand\thischapternum: - \noexpand\thischaptername}% - }% - \else - \toks0={#1}% - \xdef\lastchapterdefs{% - \gdef\noexpand\thischaptername{\the\toks0}% - \gdef\noexpand\thischapternum{\the\chapno}% - % \noexpand\putwordChapter avoids expanding indigestible - % commands in some of the translations. - \gdef\noexpand\thischapter{\noexpand\putwordChapter{} - \noexpand\thischapternum: - \noexpand\thischaptername}% - }% - \fi\fi\fi - % - % Output the mark. Pass it through \safewhatsit, to take care of - % the preceding space. - \safewhatsit\domark - % - % Insert the chapter heading break. - \pchapsepmacro - % - % Now the second mark, after the heading break. No break points - % between here and the heading. - \let\prevchapterdefs=\lastchapterdefs - \let\prevsectiondefs=\lastsectiondefs - \domark - % - {% - \chapfonts \rmisbold - % - % Have to define \lastsection before calling \donoderef, because the - % xref code eventually uses it. On the other hand, it has to be called - % after \pchapsepmacro, or the headline will change too soon. - \gdef\lastsection{#1}% - % - % Only insert the separating space if we have a chapter/appendix - % number, and don't print the unnumbered ``number''. - \ifx\temptype\Ynothingkeyword - \setbox0 = \hbox{}% - \def\toctype{unnchap}% - \else\ifx\temptype\Yomitfromtockeyword - \setbox0 = \hbox{}% contents like unnumbered, but no toc entry - \def\toctype{omit}% - \else\ifx\temptype\Yappendixkeyword - \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% - \def\toctype{app}% - \else - \setbox0 = \hbox{#3\enspace}% - \def\toctype{numchap}% - \fi\fi\fi - % - % Write the toc entry for this chapter. Must come before the - % \donoderef, because we include the current node name in the toc - % entry, and \donoderef resets it to empty. - \writetocentry{\toctype}{#1}{#3}% - % - % For pdftex, we have to write out the node definition (aka, make - % the pdfdest) after any page break, but before the actual text has - % been typeset. If the destination for the pdf outline is after the - % text, then jumping from the outline may wind up with the text not - % being visible, for instance under high magnification. - \donoderef{#2}% - % - % Typeset the actual heading. - \nobreak % Avoid page breaks at the interline glue. - \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright - \hangindent=\wd0 \centerparametersmaybe - \unhbox0 #1\par}% - }% - \nobreak\bigskip % no page break after a chapter title - \nobreak -} - -% @centerchap -- centered and unnumbered. -\let\centerparametersmaybe = \relax -\def\centerparameters{% - \advance\rightskip by 3\rightskip - \leftskip = \rightskip - \parfillskip = 0pt -} - - -% I don't think this chapter style is supported any more, so I'm not -% updating it with the new noderef stuff. We'll see. --karl, 11aug03. -% -\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} -% -\def\unnchfopen #1{% -\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\ptexraggedright - \rmisbold #1\hfill}}\bigskip \par\nobreak -} -\def\chfopen #1#2{\chapoddpage {\chapfonts -\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% -\par\penalty 5000 % -} -\def\centerchfopen #1{% -\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt - \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak -} -\def\CHAPFopen{% - \global\let\chapmacro=\chfopen - \global\let\centerchapmacro=\centerchfopen} - - -% Section titles. These macros combine the section number parts and -% call the generic \sectionheading to do the printing. -% -\newskip\secheadingskip -\def\secheadingbreak{\dobreak \secheadingskip{-1000}} - -% Subsection titles. -\newskip\subsecheadingskip -\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} - -% Subsubsection titles. -\def\subsubsecheadingskip{\subsecheadingskip} -\def\subsubsecheadingbreak{\subsecheadingbreak} - - -% Print any size, any type, section title. -% -% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is -% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the -% section number. -% -\def\seckeyword{sec} -% -\def\sectionheading#1#2#3#4{% - {% - % Switch to the right set of fonts. - \csname #2fonts\endcsname \rmisbold - % - \def\sectionlevel{#2}% - \def\temptype{#3}% - % - % Insert first mark before the heading break (see notes for \domark). - \let\prevsectiondefs=\lastsectiondefs - \ifx\temptype\Ynothingkeyword - \ifx\sectionlevel\seckeyword - \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% - \gdef\thissection{\thissectionname}}% - \fi - \else\ifx\temptype\Yomitfromtockeyword - % Don't redefine \thissection. - \else\ifx\temptype\Yappendixkeyword - \ifx\sectionlevel\seckeyword - \toks0={#1}% - \xdef\lastsectiondefs{% - \gdef\noexpand\thissectionname{\the\toks0}% - \gdef\noexpand\thissectionnum{#4}% - % \noexpand\putwordSection avoids expanding indigestible - % commands in some of the translations. - \gdef\noexpand\thissection{\noexpand\putwordSection{} - \noexpand\thissectionnum: - \noexpand\thissectionname}% - }% - \fi - \else - \ifx\sectionlevel\seckeyword - \toks0={#1}% - \xdef\lastsectiondefs{% - \gdef\noexpand\thissectionname{\the\toks0}% - \gdef\noexpand\thissectionnum{#4}% - % \noexpand\putwordSection avoids expanding indigestible - % commands in some of the translations. - \gdef\noexpand\thissection{\noexpand\putwordSection{} - \noexpand\thissectionnum: - \noexpand\thissectionname}% - }% - \fi - \fi\fi\fi - % - % Go into vertical mode. Usually we'll already be there, but we - % don't want the following whatsit to end up in a preceding paragraph - % if the document didn't happen to have a blank line. - \par - % - % Output the mark. Pass it through \safewhatsit, to take care of - % the preceding space. - \safewhatsit\domark - % - % Insert space above the heading. - \csname #2headingbreak\endcsname - % - % Now the second mark, after the heading break. No break points - % between here and the heading. - \let\prevsectiondefs=\lastsectiondefs - \domark - % - % Only insert the space after the number if we have a section number. - \ifx\temptype\Ynothingkeyword - \setbox0 = \hbox{}% - \def\toctype{unn}% - \gdef\lastsection{#1}% - \else\ifx\temptype\Yomitfromtockeyword - % for @headings -- no section number, don't include in toc, - % and don't redefine \lastsection. - \setbox0 = \hbox{}% - \def\toctype{omit}% - \let\sectionlevel=\empty - \else\ifx\temptype\Yappendixkeyword - \setbox0 = \hbox{#4\enspace}% - \def\toctype{app}% - \gdef\lastsection{#1}% - \else - \setbox0 = \hbox{#4\enspace}% - \def\toctype{num}% - \gdef\lastsection{#1}% - \fi\fi\fi - % - % Write the toc entry (before \donoderef). See comments in \chapmacro. - \writetocentry{\toctype\sectionlevel}{#1}{#4}% - % - % Write the node reference (= pdf destination for pdftex). - % Again, see comments in \chapmacro. - \donoderef{#3}% - % - % Interline glue will be inserted when the vbox is completed. - % That glue will be a valid breakpoint for the page, since it'll be - % preceded by a whatsit (usually from the \donoderef, or from the - % \writetocentry if there was no node). We don't want to allow that - % break, since then the whatsits could end up on page n while the - % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. - \nobreak - % - % Output the actual section heading. - \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright - \hangindent=\wd0 % zero if no section number - \unhbox0 #1}% - }% - % Add extra space after the heading -- half of whatever came above it. - % Don't allow stretch, though. - \kern .5 \csname #2headingskip\endcsname - % - % Do not let the kern be a potential breakpoint, as it would be if it - % was followed by glue. - \nobreak - % - % We'll almost certainly start a paragraph next, so don't let that - % glue accumulate. (Not a breakpoint because it's preceded by a - % discardable item.) - \vskip-\parskip - % - % This is purely so the last item on the list is a known \penalty > - % 10000. This is so \startdefun can avoid allowing breakpoints after - % section headings. Otherwise, it would insert a valid breakpoint between: - % - % @section sec-whatever - % @deffn def-whatever - \penalty 10001 -} - - -\message{toc,} -% Table of contents. -\newwrite\tocfile - -% Write an entry to the toc file, opening it if necessary. -% Called from @chapter, etc. -% -% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} -% We append the current node name (if any) and page number as additional -% arguments for the \{chap,sec,...}entry macros which will eventually -% read this. The node name is used in the pdf outlines as the -% destination to jump to. -% -% We open the .toc file for writing here instead of at @setfilename (or -% any other fixed time) so that @contents can be anywhere in the document. -% But if #1 is `omit', then we don't do anything. This is used for the -% table of contents chapter openings themselves. -% -\newif\iftocfileopened -\def\omitkeyword{omit}% -% -\def\writetocentry#1#2#3{% - \edef\writetoctype{#1}% - \ifx\writetoctype\omitkeyword \else - \iftocfileopened\else - \immediate\openout\tocfile = \jobname.toc - \global\tocfileopenedtrue - \fi - % - \iflinks - {\atdummies - \edef\temp{% - \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% - \temp - }% - \fi - \fi - % - % Tell \shipout to create a pdf destination on each page, if we're - % writing pdf. These are used in the table of contents. We can't - % just write one on every page because the title pages are numbered - % 1 and 2 (the page numbers aren't printed), and so are the first - % two pages of the document. Thus, we'd have two destinations named - % `1', and two named `2'. - \ifpdf \global\pdfmakepagedesttrue \fi -} - - -% These characters do not print properly in the Computer Modern roman -% fonts, so we must take special care. This is more or less redundant -% with the Texinfo input format setup at the end of this file. -% -\def\activecatcodes{% - \catcode`\"=\active - \catcode`\$=\active - \catcode`\<=\active - \catcode`\>=\active - \catcode`\\=\active - \catcode`\^=\active - \catcode`\_=\active - \catcode`\|=\active - \catcode`\~=\active -} - - -% Read the toc file, which is essentially Texinfo input. -\def\readtocfile{% - \setupdatafile - \activecatcodes - \input \tocreadfilename -} - -\newskip\contentsrightmargin \contentsrightmargin=1in -\newcount\savepageno -\newcount\lastnegativepageno \lastnegativepageno = -1 - -% Prepare to read what we've written to \tocfile. -% -\def\startcontents#1{% - % If @setchapternewpage on, and @headings double, the contents should - % start on an odd page, unlike chapters. Thus, we maintain - % \contentsalignmacro in parallel with \pagealignmacro. - % From: Torbjorn Granlund - \contentsalignmacro - \immediate\closeout\tocfile - % - % Don't need to put `Contents' or `Short Contents' in the headline. - % It is abundantly clear what they are. - \chapmacro{#1}{Yomitfromtoc}{}% - % - \savepageno = \pageno - \begingroup % Set up to handle contents files properly. - \raggedbottom % Worry more about breakpoints than the bottom. - \advance\hsize by -\contentsrightmargin % Don't use the full line length. - % - % Roman numerals for page numbers. - \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi -} - -% redefined for the two-volume lispref. We always output on -% \jobname.toc even if this is redefined. -% -\def\tocreadfilename{\jobname.toc} - -% Normal (long) toc. -% -\def\contents{% - \startcontents{\putwordTOC}% - \openin 1 \tocreadfilename\space - \ifeof 1 \else - \readtocfile - \fi - \vfill \eject - \contentsalignmacro % in case @setchapternewpage odd is in effect - \ifeof 1 \else - \pdfmakeoutlines - \fi - \closein 1 - \endgroup - \lastnegativepageno = \pageno - \global\pageno = \savepageno -} - -% And just the chapters. -\def\summarycontents{% - \startcontents{\putwordShortTOC}% - % - \let\numchapentry = \shortchapentry - \let\appentry = \shortchapentry - \let\unnchapentry = \shortunnchapentry - % We want a true roman here for the page numbers. - \secfonts - \let\rm=\shortcontrm \let\bf=\shortcontbf - \let\sl=\shortcontsl \let\tt=\shortconttt - \rm - \hyphenpenalty = 10000 - \advance\baselineskip by 1pt % Open it up a little. - \def\numsecentry##1##2##3##4{} - \let\appsecentry = \numsecentry - \let\unnsecentry = \numsecentry - \let\numsubsecentry = \numsecentry - \let\appsubsecentry = \numsecentry - \let\unnsubsecentry = \numsecentry - \let\numsubsubsecentry = \numsecentry - \let\appsubsubsecentry = \numsecentry - \let\unnsubsubsecentry = \numsecentry - \openin 1 \tocreadfilename\space - \ifeof 1 \else - \readtocfile - \fi - \closein 1 - \vfill \eject - \contentsalignmacro % in case @setchapternewpage odd is in effect - \endgroup - \lastnegativepageno = \pageno - \global\pageno = \savepageno -} -\let\shortcontents = \summarycontents - -% Typeset the label for a chapter or appendix for the short contents. -% The arg is, e.g., `A' for an appendix, or `3' for a chapter. -% -\def\shortchaplabel#1{% - % This space should be enough, since a single number is .5em, and the - % widest letter (M) is 1em, at least in the Computer Modern fonts. - % But use \hss just in case. - % (This space doesn't include the extra space that gets added after - % the label; that gets put in by \shortchapentry above.) - % - % We'd like to right-justify chapter numbers, but that looks strange - % with appendix letters. And right-justifying numbers and - % left-justifying letters looks strange when there is less than 10 - % chapters. Have to read the whole toc once to know how many chapters - % there are before deciding ... - \hbox to 1em{#1\hss}% -} - -% These macros generate individual entries in the table of contents. -% The first argument is the chapter or section name. -% The last argument is the page number. -% The arguments in between are the chapter number, section number, ... - -% Chapters, in the main contents. -\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} -% -% Chapters, in the short toc. -% See comments in \dochapentry re vbox and related settings. -\def\shortchapentry#1#2#3#4{% - \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% -} - -% Appendices, in the main contents. -% Need the word Appendix, and a fixed-size box. -% -\def\appendixbox#1{% - % We use M since it's probably the widest letter. - \setbox0 = \hbox{\putwordAppendix{} M}% - \hbox to \wd0{\putwordAppendix{} #1\hss}} -% -\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} - -% Unnumbered chapters. -\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} -\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} - -% Sections. -\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} -\let\appsecentry=\numsecentry -\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} - -% Subsections. -\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} -\let\appsubsecentry=\numsubsecentry -\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} - -% And subsubsections. -\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} -\let\appsubsubsecentry=\numsubsubsecentry -\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} - -% This parameter controls the indentation of the various levels. -% Same as \defaultparindent. -\newdimen\tocindent \tocindent = 15pt - -% Now for the actual typesetting. In all these, #1 is the text and #2 is the -% page number. -% -% If the toc has to be broken over pages, we want it to be at chapters -% if at all possible; hence the \penalty. -\def\dochapentry#1#2{% - \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip - \begingroup - \chapentryfonts - \tocentry{#1}{\dopageno\bgroup#2\egroup}% - \endgroup - \nobreak\vskip .25\baselineskip plus.1\baselineskip -} - -\def\dosecentry#1#2{\begingroup - \secentryfonts \leftskip=\tocindent - \tocentry{#1}{\dopageno\bgroup#2\egroup}% -\endgroup} - -\def\dosubsecentry#1#2{\begingroup - \subsecentryfonts \leftskip=2\tocindent - \tocentry{#1}{\dopageno\bgroup#2\egroup}% -\endgroup} - -\def\dosubsubsecentry#1#2{\begingroup - \subsubsecentryfonts \leftskip=3\tocindent - \tocentry{#1}{\dopageno\bgroup#2\egroup}% -\endgroup} - -% We use the same \entry macro as for the index entries. -\let\tocentry = \entry - -% Space between chapter (or whatever) number and the title. -\def\labelspace{\hskip1em \relax} - -\def\dopageno#1{{\rm #1}} -\def\doshortpageno#1{{\rm #1}} - -\def\chapentryfonts{\secfonts \rm} -\def\secentryfonts{\textfonts} -\def\subsecentryfonts{\textfonts} -\def\subsubsecentryfonts{\textfonts} - - -\message{environments,} -% @foo ... @end foo. - -% @tex ... @end tex escapes into raw Tex temporarily. -% One exception: @ is still an escape character, so that @end tex works. -% But \@ or @@ will get a plain tex @ character. - -\envdef\tex{% - \setupmarkupstyle{tex}% - \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 - \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 - \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie - \catcode `\%=14 - \catcode `\+=\other - \catcode `\"=\other - \catcode `\|=\other - \catcode `\<=\other - \catcode `\>=\other - \catcode`\`=\other - \catcode`\'=\other - \escapechar=`\\ - % - \let\b=\ptexb - \let\bullet=\ptexbullet - \let\c=\ptexc - \let\,=\ptexcomma - \let\.=\ptexdot - \let\dots=\ptexdots - \let\equiv=\ptexequiv - \let\!=\ptexexclam - \let\i=\ptexi - \let\indent=\ptexindent - \let\noindent=\ptexnoindent - \let\{=\ptexlbrace - \let\+=\tabalign - \let\}=\ptexrbrace - \let\/=\ptexslash - \let\*=\ptexstar - \let\t=\ptext - \expandafter \let\csname top\endcsname=\ptextop % outer - \let\frenchspacing=\plainfrenchspacing - % - \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% - \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% - \def\@{@}% -} -% There is no need to define \Etex. - -% Define @lisp ... @end lisp. -% @lisp environment forms a group so it can rebind things, -% including the definition of @end lisp (which normally is erroneous). - -% Amount to narrow the margins by for @lisp. -\newskip\lispnarrowing \lispnarrowing=0.4in - -% This is the definition that ^^M gets inside @lisp, @example, and other -% such environments. \null is better than a space, since it doesn't -% have any width. -\def\lisppar{\null\endgraf} - -% This space is always present above and below environments. -\newskip\envskipamount \envskipamount = 0pt - -% Make spacing and below environment symmetrical. We use \parskip here -% to help in doing that, since in @example-like environments \parskip -% is reset to zero; thus the \afterenvbreak inserts no space -- but the -% start of the next paragraph will insert \parskip. -% -\def\aboveenvbreak{{% - % =10000 instead of <10000 because of a special case in \itemzzz and - % \sectionheading, q.v. - \ifnum \lastpenalty=10000 \else - \advance\envskipamount by \parskip - \endgraf - \ifdim\lastskip<\envskipamount - \removelastskip - % it's not a good place to break if the last penalty was \nobreak - % or better ... - \ifnum\lastpenalty<10000 \penalty-50 \fi - \vskip\envskipamount - \fi - \fi -}} - -\let\afterenvbreak = \aboveenvbreak - -% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will -% also clear it, so that its embedded environments do the narrowing again. -\let\nonarrowing=\relax - -% @cartouche ... @end cartouche: draw rectangle w/rounded corners around -% environment contents. -\font\circle=lcircle10 -\newdimen\circthick -\newdimen\cartouter\newdimen\cartinner -\newskip\normbskip\newskip\normpskip\newskip\normlskip -\circthick=\fontdimen8\circle -% -\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth -\def\ctr{{\hskip 6pt\circle\char'010}} -\def\cbl{{\circle\char'012\hskip -6pt}} -\def\cbr{{\hskip 6pt\circle\char'011}} -\def\carttop{\hbox to \cartouter{\hskip\lskip - \ctl\leaders\hrule height\circthick\hfil\ctr - \hskip\rskip}} -\def\cartbot{\hbox to \cartouter{\hskip\lskip - \cbl\leaders\hrule height\circthick\hfil\cbr - \hskip\rskip}} -% -\newskip\lskip\newskip\rskip - -\envdef\cartouche{% - \ifhmode\par\fi % can't be in the midst of a paragraph. - \startsavinginserts - \lskip=\leftskip \rskip=\rightskip - \leftskip=0pt\rightskip=0pt % we want these *outside*. - \cartinner=\hsize \advance\cartinner by-\lskip - \advance\cartinner by-\rskip - \cartouter=\hsize - \advance\cartouter by 18.4pt % allow for 3pt kerns on either - % side, and for 6pt waste from - % each corner char, and rule thickness - \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip - % Flag to tell @lisp, etc., not to narrow margin. - \let\nonarrowing = t% - \vbox\bgroup - \baselineskip=0pt\parskip=0pt\lineskip=0pt - \carttop - \hbox\bgroup - \hskip\lskip - \vrule\kern3pt - \vbox\bgroup - \kern3pt - \hsize=\cartinner - \baselineskip=\normbskip - \lineskip=\normlskip - \parskip=\normpskip - \vskip -\parskip - \comment % For explanation, see the end of \def\group. -} -\def\Ecartouche{% - \ifhmode\par\fi - \kern3pt - \egroup - \kern3pt\vrule - \hskip\rskip - \egroup - \cartbot - \egroup - \checkinserts -} - - -% This macro is called at the beginning of all the @example variants, -% inside a group. -\newdimen\nonfillparindent -\def\nonfillstart{% - \aboveenvbreak - \hfuzz = 12pt % Don't be fussy - \sepspaces % Make spaces be word-separators rather than space tokens. - \let\par = \lisppar % don't ignore blank lines - \obeylines % each line of input is a line of output - \parskip = 0pt - % Turn off paragraph indentation but redefine \indent to emulate - % the normal \indent. - \nonfillparindent=\parindent - \parindent = 0pt - \let\indent\nonfillindent - % - \emergencystretch = 0pt % don't try to avoid overfull boxes - \ifx\nonarrowing\relax - \advance \leftskip by \lispnarrowing - \exdentamount=\lispnarrowing - \else - \let\nonarrowing = \relax - \fi - \let\exdent=\nofillexdent -} - -\begingroup -\obeyspaces -% We want to swallow spaces (but not other tokens) after the fake -% @indent in our nonfill-environments, where spaces are normally -% active and set to @tie, resulting in them not being ignored after -% @indent. -\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% -\gdef\nonfillindentcheck{% -\ifx\temp % -\expandafter\nonfillindentgobble% -\else% -\leavevmode\nonfillindentbox% -\fi% -}% -\endgroup -\def\nonfillindentgobble#1{\nonfillindent} -\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} - -% If you want all examples etc. small: @set dispenvsize small. -% If you want even small examples the full size: @set dispenvsize nosmall. -% This affects the following displayed environments: -% @example, @display, @format, @lisp -% -\def\smallword{small} -\def\nosmallword{nosmall} -\let\SETdispenvsize\relax -\def\setnormaldispenv{% - \ifx\SETdispenvsize\smallword - % end paragraph for sake of leading, in case document has no blank - % line. This is redundant with what happens in \aboveenvbreak, but - % we need to do it before changing the fonts, and it's inconvenient - % to change the fonts afterward. - \ifnum \lastpenalty=10000 \else \endgraf \fi - \smallexamplefonts \rm - \fi -} -\def\setsmalldispenv{% - \ifx\SETdispenvsize\nosmallword - \else - \ifnum \lastpenalty=10000 \else \endgraf \fi - \smallexamplefonts \rm - \fi -} - -% We often define two environments, @foo and @smallfoo. -% Let's do it by one command: -\def\makedispenv #1#2{ - \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2} - \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2} - \expandafter\let\csname E#1\endcsname \afterenvbreak - \expandafter\let\csname Esmall#1\endcsname \afterenvbreak -} - -% Define two synonyms: -\def\maketwodispenvs #1#2#3{ - \makedispenv{#1}{#3} - \makedispenv{#2}{#3} -} - -% @lisp: indented, narrowed, typewriter font; @example: same as @lisp. -% -% @smallexample and @smalllisp: use smaller fonts. -% Originally contributed by Pavel@xerox. -% -\maketwodispenvs {lisp}{example}{% - \nonfillstart - \tt\setupmarkupstyle{example}% - \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. - \gobble % eat return -} -% @display/@smalldisplay: same as @lisp except keep current font. -% -\makedispenv {display}{% - \nonfillstart - \gobble -} - -% @format/@smallformat: same as @display except don't narrow margins. -% -\makedispenv{format}{% - \let\nonarrowing = t% - \nonfillstart - \gobble -} - -% @flushleft: same as @format, but doesn't obey \SETdispenvsize. -\envdef\flushleft{% - \let\nonarrowing = t% - \nonfillstart - \gobble -} -\let\Eflushleft = \afterenvbreak - -% @flushright. -% -\envdef\flushright{% - \let\nonarrowing = t% - \nonfillstart - \advance\leftskip by 0pt plus 1fill - \gobble -} -\let\Eflushright = \afterenvbreak - - -% @raggedright does more-or-less normal line breaking but no right -% justification. From plain.tex. -\envdef\raggedright{% - \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax -} -\let\Eraggedright\par - -\envdef\raggedleft{% - \parindent=0pt \leftskip0pt plus2em - \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt - \hbadness=10000 % Last line will usually be underfull, so turn off - % badness reporting. -} -\let\Eraggedleft\par - -\envdef\raggedcenter{% - \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em - \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt - \hbadness=10000 % Last line will usually be underfull, so turn off - % badness reporting. -} -\let\Eraggedcenter\par - - -% @quotation does normal linebreaking (hence we can't use \nonfillstart) -% and narrows the margins. We keep \parskip nonzero in general, since -% we're doing normal filling. So, when using \aboveenvbreak and -% \afterenvbreak, temporarily make \parskip 0. -% -\def\quotationstart{% - {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip - \parindent=0pt - % - % @cartouche defines \nonarrowing to inhibit narrowing at next level down. - \ifx\nonarrowing\relax - \advance\leftskip by \lispnarrowing - \advance\rightskip by \lispnarrowing - \exdentamount = \lispnarrowing - \else - \let\nonarrowing = \relax - \fi - \parsearg\quotationlabel -} - -\envdef\quotation{% - \setnormaldispenv - \quotationstart -} - -\envdef\smallquotation{% - \setsmalldispenv - \quotationstart -} -\let\Esmallquotation = \Equotation - -% We have retained a nonzero parskip for the environment, since we're -% doing normal filling. -% -\def\Equotation{% - \par - \ifx\quotationauthor\undefined\else - % indent a bit. - \leftline{\kern 2\leftskip \sl ---\quotationauthor}% - \fi - {\parskip=0pt \afterenvbreak}% -} - -% If we're given an argument, typeset it in bold with a colon after. -\def\quotationlabel#1{% - \def\temp{#1}% - \ifx\temp\empty \else - {\bf #1: }% - \fi -} - - -% LaTeX-like @verbatim...@end verbatim and @verb{...} -% If we want to allow any as delimiter, -% we need the curly braces so that makeinfo sees the @verb command, eg: -% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org -% -% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. -% -% [Knuth] p.344; only we need to do the other characters Texinfo sets -% active too. Otherwise, they get lost as the first character on a -% verbatim line. -\def\dospecials{% - \do\ \do\\\do\{\do\}\do\$\do\&% - \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% - \do\<\do\>\do\|\do\@\do+\do\"% - % Don't do the quotes -- if we do, @set txicodequoteundirected and - % @set txicodequotebacktick will not have effect on @verb and - % @verbatim, and ?` and !` ligatures won't get disabled. - %\do\`\do\'% -} -% -% [Knuth] p. 380 -\def\uncatcodespecials{% - \def\do##1{\catcode`##1=\other}\dospecials} -% -% Setup for the @verb command. -% -% Eight spaces for a tab -\begingroup - \catcode`\^^I=\active - \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} -\endgroup -% -\def\setupverb{% - \tt % easiest (and conventionally used) font for verbatim - \def\par{\leavevmode\endgraf}% - \setupmarkupstyle{verb}% - \tabeightspaces - % Respect line breaks, - % print special symbols as themselves, and - % make each space count - % must do in this order: - \obeylines \uncatcodespecials \sepspaces -} - -% Setup for the @verbatim environment -% -% Real tab expansion -\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount -% -\def\starttabbox{\setbox0=\hbox\bgroup} -% -\begingroup - \catcode`\^^I=\active - \gdef\tabexpand{% - \catcode`\^^I=\active - \def^^I{\leavevmode\egroup - \dimen0=\wd0 % the width so far, or since the previous tab - \divide\dimen0 by\tabw - \multiply\dimen0 by\tabw % compute previous multiple of \tabw - \advance\dimen0 by\tabw % advance to next multiple of \tabw - \wd0=\dimen0 \box0 \starttabbox - }% - } -\endgroup - -% start the verbatim environment. -\def\setupverbatim{% - \let\nonarrowing = t% - \nonfillstart - % Easiest (and conventionally used) font for verbatim - \tt - \def\par{\leavevmode\egroup\box0\endgraf}% - \tabexpand - \setupmarkupstyle{verbatim}% - % Respect line breaks, - % print special symbols as themselves, and - % make each space count - % must do in this order: - \obeylines \uncatcodespecials \sepspaces - \everypar{\starttabbox}% -} - -% Do the @verb magic: verbatim text is quoted by unique -% delimiter characters. Before first delimiter expect a -% right brace, after last delimiter expect closing brace: -% -% \def\doverb'{'#1'}'{#1} -% -% [Knuth] p. 382; only eat outer {} -\begingroup - \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other - \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] -\endgroup -% -\def\verb{\begingroup\setupverb\doverb} -% -% -% Do the @verbatim magic: define the macro \doverbatim so that -% the (first) argument ends when '@end verbatim' is reached, ie: -% -% \def\doverbatim#1@end verbatim{#1} -% -% For Texinfo it's a lot easier than for LaTeX, -% because texinfo's \verbatim doesn't stop at '\end{verbatim}': -% we need not redefine '\', '{' and '}'. -% -% Inspired by LaTeX's verbatim command set [latex.ltx] -% -\begingroup - \catcode`\ =\active - \obeylines % - % ignore everything up to the first ^^M, that's the newline at the end - % of the @verbatim input line itself. Otherwise we get an extra blank - % line in the output. - \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% - % We really want {...\end verbatim} in the body of the macro, but - % without the active space; thus we have to use \xdef and \gobble. -\endgroup -% -\envdef\verbatim{% - \setupverbatim\doverbatim -} -\let\Everbatim = \afterenvbreak - - -% @verbatiminclude FILE - insert text of file in verbatim environment. -% -\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} -% -\def\doverbatiminclude#1{% - {% - \makevalueexpandable - \setupverbatim - \indexnofonts % Allow `@@' and other weird things in file names. - \input #1 - \afterenvbreak - }% -} - -% @copying ... @end copying. -% Save the text away for @insertcopying later. -% -% We save the uninterpreted tokens, rather than creating a box. -% Saving the text in a box would be much easier, but then all the -% typesetting commands (@smallbook, font changes, etc.) have to be done -% beforehand -- and a) we want @copying to be done first in the source -% file; b) letting users define the frontmatter in as flexible order as -% possible is very desirable. -% -\def\copying{\checkenv{}\begingroup\scanargctxt\docopying} -\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} -% -\def\insertcopying{% - \begingroup - \parindent = 0pt % paragraph indentation looks wrong on title page - \scanexp\copyingtext - \endgroup -} - - -\message{defuns,} -% @defun etc. - -\newskip\defbodyindent \defbodyindent=.4in -\newskip\defargsindent \defargsindent=50pt -\newskip\deflastargmargin \deflastargmargin=18pt -\newcount\defunpenalty - -% Start the processing of @deffn: -\def\startdefun{% - \ifnum\lastpenalty<10000 - \medbreak - \defunpenalty=10003 % Will keep this @deffn together with the - % following @def command, see below. - \else - % If there are two @def commands in a row, we'll have a \nobreak, - % which is there to keep the function description together with its - % header. But if there's nothing but headers, we need to allow a - % break somewhere. Check specifically for penalty 10002, inserted - % by \printdefunline, instead of 10000, since the sectioning - % commands also insert a nobreak penalty, and we don't want to allow - % a break between a section heading and a defun. - % - % As a minor refinement, we avoid "club" headers by signalling - % with penalty of 10003 after the very first @deffn in the - % sequence (see above), and penalty of 10002 after any following - % @def command. - \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi - % - % Similarly, after a section heading, do not allow a break. - % But do insert the glue. - \medskip % preceded by discardable penalty, so not a breakpoint - \fi - % - \parindent=0in - \advance\leftskip by \defbodyindent - \exdentamount=\defbodyindent -} - -\def\dodefunx#1{% - % First, check whether we are in the right environment: - \checkenv#1% - % - % As above, allow line break if we have multiple x headers in a row. - % It's not a great place, though. - \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi - % - % And now, it's time to reuse the body of the original defun: - \expandafter\gobbledefun#1% -} -\def\gobbledefun#1\startdefun{} - -% \printdefunline \deffnheader{text} -% -\def\printdefunline#1#2{% - \begingroup - % call \deffnheader: - #1#2 \endheader - % common ending: - \interlinepenalty = 10000 - \advance\rightskip by 0pt plus 1fil - \endgraf - \nobreak\vskip -\parskip - \penalty\defunpenalty % signal to \startdefun and \dodefunx - % Some of the @defun-type tags do not enable magic parentheses, - % rendering the following check redundant. But we don't optimize. - \checkparencounts - \endgroup -} - -\def\Edefun{\endgraf\medbreak} - -% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; -% the only thing remaining is to define \deffnheader. -% -\def\makedefun#1{% - \expandafter\let\csname E#1\endcsname = \Edefun - \edef\temp{\noexpand\domakedefun - \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% - \temp -} - -% \domakedefun \deffn \deffnx \deffnheader -% -% Define \deffn and \deffnx, without parameters. -% \deffnheader has to be defined explicitly. -% -\def\domakedefun#1#2#3{% - \envdef#1{% - \startdefun - \parseargusing\activeparens{\printdefunline#3}% - }% - \def#2{\dodefunx#1}% - \def#3% -} - -%%% Untyped functions: - -% @deffn category name args -\makedefun{deffn}{\deffngeneral{}} - -% @deffn category class name args -\makedefun{defop}#1 {\defopon{#1\ \putwordon}} - -% \defopon {category on}class name args -\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } - -% \deffngeneral {subind}category name args -% -\def\deffngeneral#1#2 #3 #4\endheader{% - % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. - \dosubind{fn}{\code{#3}}{#1}% - \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% -} - -%%% Typed functions: - -% @deftypefn category type name args -\makedefun{deftypefn}{\deftypefngeneral{}} - -% @deftypeop category class type name args -\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} - -% \deftypeopon {category on}class type name args -\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } - -% \deftypefngeneral {subind}category type name args -% -\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% - \dosubind{fn}{\code{#4}}{#1}% - \defname{#2}{#3}{#4}\defunargs{#5\unskip}% -} - -%%% Typed variables: - -% @deftypevr category type var args -\makedefun{deftypevr}{\deftypecvgeneral{}} - -% @deftypecv category class type var args -\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} - -% \deftypecvof {category of}class type var args -\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } - -% \deftypecvgeneral {subind}category type var args -% -\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% - \dosubind{vr}{\code{#4}}{#1}% - \defname{#2}{#3}{#4}\defunargs{#5\unskip}% -} - -%%% Untyped variables: - -% @defvr category var args -\makedefun{defvr}#1 {\deftypevrheader{#1} {} } - -% @defcv category class var args -\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} - -% \defcvof {category of}class var args -\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } - -%%% Type: -% @deftp category name args -\makedefun{deftp}#1 #2 #3\endheader{% - \doind{tp}{\code{#2}}% - \defname{#1}{}{#2}\defunargs{#3\unskip}% -} - -% Remaining @defun-like shortcuts: -\makedefun{defun}{\deffnheader{\putwordDeffunc} } -\makedefun{defmac}{\deffnheader{\putwordDefmac} } -\makedefun{defspec}{\deffnheader{\putwordDefspec} } -\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } -\makedefun{defvar}{\defvrheader{\putwordDefvar} } -\makedefun{defopt}{\defvrheader{\putwordDefopt} } -\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } -\makedefun{defmethod}{\defopon\putwordMethodon} -\makedefun{deftypemethod}{\deftypeopon\putwordMethodon} -\makedefun{defivar}{\defcvof\putwordInstanceVariableof} -\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} - -% \defname, which formats the name of the @def (not the args). -% #1 is the category, such as "Function". -% #2 is the return type, if any. -% #3 is the function name. -% -% We are followed by (but not passed) the arguments, if any. -% -\def\defname#1#2#3{% - % Get the values of \leftskip and \rightskip as they were outside the @def... - \advance\leftskip by -\defbodyindent - % - % How we'll format the type name. Putting it in brackets helps - % distinguish it from the body text that may end up on the next line - % just below it. - \def\temp{#1}% - \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} - % - % Figure out line sizes for the paragraph shape. - % The first line needs space for \box0; but if \rightskip is nonzero, - % we need only space for the part of \box0 which exceeds it: - \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip - % The continuations: - \dimen2=\hsize \advance\dimen2 by -\defargsindent - % (plain.tex says that \dimen1 should be used only as global.) - \parshape 2 0in \dimen0 \defargsindent \dimen2 - % - % Put the type name to the right margin. - \noindent - \hbox to 0pt{% - \hfil\box0 \kern-\hsize - % \hsize has to be shortened this way: - \kern\leftskip - % Intentionally do not respect \rightskip, since we need the space. - }% - % - % Allow all lines to be underfull without complaint: - \tolerance=10000 \hbadness=10000 - \exdentamount=\defbodyindent - {% - % defun fonts. We use typewriter by default (used to be bold) because: - % . we're printing identifiers, they should be in tt in principle. - % . in languages with many accents, such as Czech or French, it's - % common to leave accents off identifiers. The result looks ok in - % tt, but exceedingly strange in rm. - % . we don't want -- and --- to be treated as ligatures. - % . this still does not fix the ?` and !` ligatures, but so far no - % one has made identifiers using them :). - \df \tt - \def\temp{#2}% return value type - \ifx\temp\empty\else \tclose{\temp} \fi - #3% output function name - }% - {\rm\enskip}% hskip 0.5 em of \tenrm - % - \boldbrax - % arguments will be output next, if any. -} - -% Print arguments in slanted roman (not ttsl), inconsistently with using -% tt for the name. This is because literal text is sometimes needed in -% the argument list (groff manual), and ttsl and tt are not very -% distinguishable. Prevent hyphenation at `-' chars. -% -\def\defunargs#1{% - % use sl by default (not ttsl), - % tt for the names. - \df \sl \hyphenchar\font=0 - % - % On the other hand, if an argument has two dashes (for instance), we - % want a way to get ttsl. Let's try @var for that. - \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% - #1% - \sl\hyphenchar\font=45 -} - -% We want ()&[] to print specially on the defun line. -% -\def\activeparens{% - \catcode`\(=\active \catcode`\)=\active - \catcode`\[=\active \catcode`\]=\active - \catcode`\&=\active -} - -% Make control sequences which act like normal parenthesis chars. -\let\lparen = ( \let\rparen = ) - -% Be sure that we always have a definition for `(', etc. For example, -% if the fn name has parens in it, \boldbrax will not be in effect yet, -% so TeX would otherwise complain about undefined control sequence. -{ - \activeparens - \global\let(=\lparen \global\let)=\rparen - \global\let[=\lbrack \global\let]=\rbrack - \global\let& = \& - - \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} - \gdef\magicamp{\let&=\amprm} -} - -\newcount\parencount - -% If we encounter &foo, then turn on ()-hacking afterwards -\newif\ifampseen -\def\amprm#1 {\ampseentrue{\bf\ }} - -\def\parenfont{% - \ifampseen - % At the first level, print parens in roman, - % otherwise use the default font. - \ifnum \parencount=1 \rm \fi - \else - % The \sf parens (in \boldbrax) actually are a little bolder than - % the contained text. This is especially needed for [ and ] . - \sf - \fi -} -\def\infirstlevel#1{% - \ifampseen - \ifnum\parencount=1 - #1% - \fi - \fi -} -\def\bfafterword#1 {#1 \bf} - -\def\opnr{% - \global\advance\parencount by 1 - {\parenfont(}% - \infirstlevel \bfafterword -} -\def\clnr{% - {\parenfont)}% - \infirstlevel \sl - \global\advance\parencount by -1 -} - -\newcount\brackcount -\def\lbrb{% - \global\advance\brackcount by 1 - {\bf[}% -} -\def\rbrb{% - {\bf]}% - \global\advance\brackcount by -1 -} - -\def\checkparencounts{% - \ifnum\parencount=0 \else \badparencount \fi - \ifnum\brackcount=0 \else \badbrackcount \fi -} -% these should not use \errmessage; the glibc manual, at least, actually -% has such constructs (when documenting function pointers). -\def\badparencount{% - \message{Warning: unbalanced parentheses in @def...}% - \global\parencount=0 -} -\def\badbrackcount{% - \message{Warning: unbalanced square brackets in @def...}% - \global\brackcount=0 -} - - -\message{macros,} -% @macro. - -% To do this right we need a feature of e-TeX, \scantokens, -% which we arrange to emulate with a temporary file in ordinary TeX. -\ifx\eTeXversion\undefined - \newwrite\macscribble - \def\scantokens#1{% - \toks0={#1}% - \immediate\openout\macscribble=\jobname.tmp - \immediate\write\macscribble{\the\toks0}% - \immediate\closeout\macscribble - \input \jobname.tmp - } -\fi - -\def\scanmacro#1{% - \begingroup - \newlinechar`\^^M - \let\xeatspaces\eatspaces - % Undo catcode changes of \startcontents and \doprintindex - % When called from @insertcopying or (short)caption, we need active - % backslash to get it printed correctly. Previously, we had - % \catcode`\\=\other instead. We'll see whether a problem appears - % with macro expansion. --kasal, 19aug04 - \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ - % ... and \example - \spaceisspace - % - % Append \endinput to make sure that TeX does not see the ending newline. - % I've verified that it is necessary both for e-TeX and for ordinary TeX - % --kasal, 29nov03 - \scantokens{#1\endinput}% - \endgroup -} - -\def\scanexp#1{% - \edef\temp{\noexpand\scanmacro{#1}}% - \temp -} - -\newcount\paramno % Count of parameters -\newtoks\macname % Macro name -\newif\ifrecursive % Is it recursive? - -% List of all defined macros in the form -% \definedummyword\macro1\definedummyword\macro2... -% Currently is also contains all @aliases; the list can be split -% if there is a need. -\def\macrolist{} - -% Add the macro to \macrolist -\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} -\def\addtomacrolistxxx#1{% - \toks0 = \expandafter{\macrolist\definedummyword#1}% - \xdef\macrolist{\the\toks0}% -} - -% Utility routines. -% This does \let #1 = #2, with \csnames; that is, -% \let \csname#1\endcsname = \csname#2\endcsname -% (except of course we have to play expansion games). -% -\def\cslet#1#2{% - \expandafter\let - \csname#1\expandafter\endcsname - \csname#2\endcsname -} - -% Trim leading and trailing spaces off a string. -% Concepts from aro-bend problem 15 (see CTAN). -{\catcode`\@=11 -\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} -\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} -\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} -\def\unbrace#1{#1} -\unbrace{\gdef\trim@@@ #1 } #2@{#1} -} - -% Trim a single trailing ^^M off a string. -{\catcode`\^^M=\other \catcode`\Q=3% -\gdef\eatcr #1{\eatcra #1Q^^MQ}% -\gdef\eatcra#1^^MQ{\eatcrb#1Q}% -\gdef\eatcrb#1Q#2Q{#1}% -} - -% Macro bodies are absorbed as an argument in a context where -% all characters are catcode 10, 11 or 12, except \ which is active -% (as in normal texinfo). It is necessary to change the definition of \. - -% Non-ASCII encodings make 8-bit characters active, so un-activate -% them to avoid their expansion. Must do this non-globally, to -% confine the change to the current group. - -% It's necessary to have hard CRs when the macro is executed. This is -% done by making ^^M (\endlinechar) catcode 12 when reading the macro -% body, and then making it the \newlinechar in \scanmacro. - -\def\scanctxt{% - \catcode`\"=\other - \catcode`\+=\other - \catcode`\<=\other - \catcode`\>=\other - \catcode`\@=\other - \catcode`\^=\other - \catcode`\_=\other - \catcode`\|=\other - \catcode`\~=\other - \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi -} - -\def\scanargctxt{% - \scanctxt - \catcode`\\=\other - \catcode`\^^M=\other -} - -\def\macrobodyctxt{% - \scanctxt - \catcode`\{=\other - \catcode`\}=\other - \catcode`\^^M=\other - \usembodybackslash -} - -\def\macroargctxt{% - \scanctxt - \catcode`\\=\other -} - -% \mbodybackslash is the definition of \ in @macro bodies. -% It maps \foo\ => \csname macarg.foo\endcsname => #N -% where N is the macro parameter number. -% We define \csname macarg.\endcsname to be \realbackslash, so -% \\ in macro replacement text gets you a backslash. - -{\catcode`@=0 @catcode`@\=@active - @gdef@usembodybackslash{@let\=@mbodybackslash} - @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} -} -\expandafter\def\csname macarg.\endcsname{\realbackslash} - -\def\macro{\recursivefalse\parsearg\macroxxx} -\def\rmacro{\recursivetrue\parsearg\macroxxx} - -\def\macroxxx#1{% - \getargs{#1}% now \macname is the macname and \argl the arglist - \ifx\argl\empty % no arguments - \paramno=0% - \else - \expandafter\parsemargdef \argl;% - \fi - \if1\csname ismacro.\the\macname\endcsname - \message{Warning: redefining \the\macname}% - \else - \expandafter\ifx\csname \the\macname\endcsname \relax - \else \errmessage{Macro name \the\macname\space already defined}\fi - \global\cslet{macsave.\the\macname}{\the\macname}% - \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% - \addtomacrolist{\the\macname}% - \fi - \begingroup \macrobodyctxt - \ifrecursive \expandafter\parsermacbody - \else \expandafter\parsemacbody - \fi} - -\parseargdef\unmacro{% - \if1\csname ismacro.#1\endcsname - \global\cslet{#1}{macsave.#1}% - \global\expandafter\let \csname ismacro.#1\endcsname=0% - % Remove the macro name from \macrolist: - \begingroup - \expandafter\let\csname#1\endcsname \relax - \let\definedummyword\unmacrodo - \xdef\macrolist{\macrolist}% - \endgroup - \else - \errmessage{Macro #1 not defined}% - \fi -} - -% Called by \do from \dounmacro on each macro. The idea is to omit any -% macro definitions that have been changed to \relax. -% -\def\unmacrodo#1{% - \ifx #1\relax - % remove this - \else - \noexpand\definedummyword \noexpand#1% - \fi -} - -% This makes use of the obscure feature that if the last token of a -% is #, then the preceding argument is delimited by -% an opening brace, and that opening brace is not consumed. -\def\getargs#1{\getargsxxx#1{}} -\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} -\def\getmacname #1 #2\relax{\macname={#1}} -\def\getmacargs#1{\def\argl{#1}} - -% Parse the optional {params} list. Set up \paramno and \paramlist -% so \defmacro knows what to do. Define \macarg.blah for each blah -% in the params list, to be ##N where N is the position in that list. -% That gets used by \mbodybackslash (above). - -% We need to get `macro parameter char #' into several definitions. -% The technique used is stolen from LaTeX: let \hash be something -% unexpandable, insert that wherever you need a #, and then redefine -% it to # just before using the token list produced. -% -% The same technique is used to protect \eatspaces till just before -% the macro is used. - -\def\parsemargdef#1;{\paramno=0\def\paramlist{}% - \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} -\def\parsemargdefxxx#1,{% - \if#1;\let\next=\relax - \else \let\next=\parsemargdefxxx - \advance\paramno by 1% - \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname - {\xeatspaces{\hash\the\paramno}}% - \edef\paramlist{\paramlist\hash\the\paramno,}% - \fi\next} - -% These two commands read recursive and nonrecursive macro bodies. -% (They're different since rec and nonrec macros end differently.) - -\long\def\parsemacbody#1@end macro% -{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% -\long\def\parsermacbody#1@end rmacro% -{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% - -% This defines the macro itself. There are six cases: recursive and -% nonrecursive macros of zero, one, and many arguments. -% Much magic with \expandafter here. -% \xdef is used so that macro definitions will survive the file -% they're defined in; @include reads the file inside a group. -\def\defmacro{% - \let\hash=##% convert placeholders to macro parameter chars - \ifrecursive - \ifcase\paramno - % 0 - \expandafter\xdef\csname\the\macname\endcsname{% - \noexpand\scanmacro{\temp}}% - \or % 1 - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \noexpand\braceorline - \expandafter\noexpand\csname\the\macname xxx\endcsname}% - \expandafter\xdef\csname\the\macname xxx\endcsname##1{% - \egroup\noexpand\scanmacro{\temp}}% - \else % many - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \noexpand\csname\the\macname xx\endcsname}% - \expandafter\xdef\csname\the\macname xx\endcsname##1{% - \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% - \expandafter\expandafter - \expandafter\xdef - \expandafter\expandafter - \csname\the\macname xxx\endcsname - \paramlist{\egroup\noexpand\scanmacro{\temp}}% - \fi - \else - \ifcase\paramno - % 0 - \expandafter\xdef\csname\the\macname\endcsname{% - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% - \or % 1 - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \noexpand\braceorline - \expandafter\noexpand\csname\the\macname xxx\endcsname}% - \expandafter\xdef\csname\the\macname xxx\endcsname##1{% - \egroup - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% - \else % many - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \expandafter\noexpand\csname\the\macname xx\endcsname}% - \expandafter\xdef\csname\the\macname xx\endcsname##1{% - \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% - \expandafter\expandafter - \expandafter\xdef - \expandafter\expandafter - \csname\the\macname xxx\endcsname - \paramlist{% - \egroup - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% - \fi - \fi} - -\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} - -% \braceorline decides whether the next nonwhitespace character is a -% {. If so it reads up to the closing }, if not, it reads the whole -% line. Whatever was read is then fed to the next control sequence -% as an argument (by \parsebrace or \parsearg) -\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} -\def\braceorlinexxx{% - \ifx\nchar\bgroup\else - \expandafter\parsearg - \fi \macnamexxx} - - -% @alias. -% We need some trickery to remove the optional spaces around the equal -% sign. Just make them active and then expand them all to nothing. -\def\alias{\parseargusing\obeyspaces\aliasxxx} -\def\aliasxxx #1{\aliasyyy#1\relax} -\def\aliasyyy #1=#2\relax{% - {% - \expandafter\let\obeyedspace=\empty - \addtomacrolist{#1}% - \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% - }% - \next -} - - -\message{cross references,} - -\newwrite\auxfile -\newif\ifhavexrefs % True if xref values are known. -\newif\ifwarnedxrefs % True if we warned once that they aren't known. - -% @inforef is relatively simple. -\def\inforef #1{\inforefzzz #1,,,,**} -\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, - node \samp{\ignorespaces#1{}}} - -% @node's only job in TeX is to define \lastnode, which is used in -% cross-references. The @node line might or might not have commas, and -% might or might not have spaces before the first comma, like: -% @node foo , bar , ... -% We don't want such trailing spaces in the node name. -% -\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} -% -% also remove a trailing comma, in case of something like this: -% @node Help-Cross, , , Cross-refs -\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} -\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} - -\let\nwnode=\node -\let\lastnode=\empty - -% Write a cross-reference definition for the current node. #1 is the -% type (Ynumbered, Yappendix, Ynothing). -% -\def\donoderef#1{% - \ifx\lastnode\empty\else - \setref{\lastnode}{#1}% - \global\let\lastnode=\empty - \fi -} - -% @anchor{NAME} -- define xref target at arbitrary point. -% -\newcount\savesfregister -% -\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} -\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} -\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} - -% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an -% anchor), which consists of three parts: -% 1) NAME-title - the current sectioning name taken from \lastsection, -% or the anchor name. -% 2) NAME-snt - section number and type, passed as the SNT arg, or -% empty for anchors. -% 3) NAME-pg - the page number. -% -% This is called from \donoderef, \anchor, and \dofloat. In the case of -% floats, there is an additional part, which is not written here: -% 4) NAME-lof - the text as it should appear in a @listoffloats. -% -\def\setref#1#2{% - \pdfmkdest{#1}% - \iflinks - {% - \atdummies % preserve commands, but don't expand them - \edef\writexrdef##1##2{% - \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef - ##1}{##2}}% these are parameters of \writexrdef - }% - \toks0 = \expandafter{\lastsection}% - \immediate \writexrdef{title}{\the\toks0 }% - \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. - \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout - }% - \fi -} - -% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is -% the node name, #2 the name of the Info cross-reference, #3 the printed -% node name, #4 the name of the Info file, #5 the name of the printed -% manual. All but the node name can be omitted. -% -\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} -\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} -\def\ref#1{\xrefX[#1,,,,,,,]} -\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup - \unsepspaces - \def\printedmanual{\ignorespaces #5}% - \def\printedrefname{\ignorespaces #3}% - \setbox1=\hbox{\printedmanual\unskip}% - \setbox0=\hbox{\printedrefname\unskip}% - \ifdim \wd0 = 0pt - % No printed node name was explicitly given. - \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax - % Use the node name inside the square brackets. - \def\printedrefname{\ignorespaces #1}% - \else - % Use the actual chapter/section title appear inside - % the square brackets. Use the real section title if we have it. - \ifdim \wd1 > 0pt - % It is in another manual, so we don't have it. - \def\printedrefname{\ignorespaces #1}% - \else - \ifhavexrefs - % We know the real title if we have the xref values. - \def\printedrefname{\refx{#1-title}{}}% - \else - % Otherwise just copy the Info node name. - \def\printedrefname{\ignorespaces #1}% - \fi% - \fi - \fi - \fi - % - % Make link in pdf output. - \ifpdf - {\indexnofonts - \turnoffactive - % This expands tokens, so do it after making catcode changes, so _ - % etc. don't get their TeX definitions. - \getfilename{#4}% - % - % See comments at \activebackslashdouble. - {\activebackslashdouble \xdef\pdfxrefdest{#1}% - \backslashparens\pdfxrefdest}% - % - \leavevmode - \startlink attr{/Border [0 0 0]}% - \ifnum\filenamelength>0 - goto file{\the\filename.pdf} name{\pdfxrefdest}% - \else - goto name{\pdfmkpgn{\pdfxrefdest}}% - \fi - }% - \setcolor{\linkcolor}% - \fi - % - % Float references are printed completely differently: "Figure 1.2" - % instead of "[somenode], p.3". We distinguish them by the - % LABEL-title being set to a magic string. - {% - % Have to otherify everything special to allow the \csname to - % include an _ in the xref name, etc. - \indexnofonts - \turnoffactive - \expandafter\global\expandafter\let\expandafter\Xthisreftitle - \csname XR#1-title\endcsname - }% - \iffloat\Xthisreftitle - % If the user specified the print name (third arg) to the ref, - % print it instead of our usual "Figure 1.2". - \ifdim\wd0 = 0pt - \refx{#1-snt}{}% - \else - \printedrefname - \fi - % - % if the user also gave the printed manual name (fifth arg), append - % "in MANUALNAME". - \ifdim \wd1 > 0pt - \space \putwordin{} \cite{\printedmanual}% - \fi - \else - % node/anchor (non-float) references. - % - % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not - % insert empty discretionaries after hyphens, which means that it will - % not find a line break at a hyphen in a node names. Since some manuals - % are best written with fairly long node names, containing hyphens, this - % is a loss. Therefore, we give the text of the node name again, so it - % is as if TeX is seeing it for the first time. - \ifdim \wd1 > 0pt - \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% - \else - % _ (for example) has to be the character _ for the purposes of the - % control sequence corresponding to the node, but it has to expand - % into the usual \leavevmode...\vrule stuff for purposes of - % printing. So we \turnoffactive for the \refx-snt, back on for the - % printing, back off for the \refx-pg. - {\turnoffactive - % Only output a following space if the -snt ref is nonempty; for - % @unnumbered and @anchor, it won't be. - \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% - \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi - }% - % output the `[mynode]' via a macro so it can be overridden. - \xrefprintnodename\printedrefname - % - % But we always want a comma and a space: - ,\space - % - % output the `page 3'. - \turnoffactive \putwordpage\tie\refx{#1-pg}{}% - \fi - \fi - \endlink -\endgroup} - -% This macro is called from \xrefX for the `[nodename]' part of xref -% output. It's a separate macro only so it can be changed more easily, -% since square brackets don't work well in some documents. Particularly -% one that Bob is working on :). -% -\def\xrefprintnodename#1{[#1]} - -% Things referred to by \setref. -% -\def\Ynothing{} -\def\Yomitfromtoc{} -\def\Ynumbered{% - \ifnum\secno=0 - \putwordChapter@tie \the\chapno - \else \ifnum\subsecno=0 - \putwordSection@tie \the\chapno.\the\secno - \else \ifnum\subsubsecno=0 - \putwordSection@tie \the\chapno.\the\secno.\the\subsecno - \else - \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno - \fi\fi\fi -} -\def\Yappendix{% - \ifnum\secno=0 - \putwordAppendix@tie @char\the\appendixno{}% - \else \ifnum\subsecno=0 - \putwordSection@tie @char\the\appendixno.\the\secno - \else \ifnum\subsubsecno=0 - \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno - \else - \putwordSection@tie - @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno - \fi\fi\fi -} - -% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. -% If its value is nonempty, SUFFIX is output afterward. -% -\def\refx#1#2{% - {% - \indexnofonts - \otherbackslash - \expandafter\global\expandafter\let\expandafter\thisrefX - \csname XR#1\endcsname - }% - \ifx\thisrefX\relax - % If not defined, say something at least. - \angleleft un\-de\-fined\angleright - \iflinks - \ifhavexrefs - \message{\linenumber Undefined cross reference `#1'.}% - \else - \ifwarnedxrefs\else - \global\warnedxrefstrue - \message{Cross reference values unknown; you must run TeX again.}% - \fi - \fi - \fi - \else - % It's defined, so just use it. - \thisrefX - \fi - #2% Output the suffix in any case. -} - -% This is the macro invoked by entries in the aux file. Usually it's -% just a \def (we prepend XR to the control sequence name to avoid -% collisions). But if this is a float type, we have more work to do. -% -\def\xrdef#1#2{% - {% The node name might contain 8-bit characters, which in our current - % implementation are changed to commands like @'e. Don't let these - % mess up the control sequence name. - \indexnofonts - \turnoffactive - \xdef\safexrefname{#1}% - }% - % - \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref - % - % Was that xref control sequence that we just defined for a float? - \expandafter\iffloat\csname XR\safexrefname\endcsname - % it was a float, and we have the (safe) float type in \iffloattype. - \expandafter\let\expandafter\floatlist - \csname floatlist\iffloattype\endcsname - % - % Is this the first time we've seen this float type? - \expandafter\ifx\floatlist\relax - \toks0 = {\do}% yes, so just \do - \else - % had it before, so preserve previous elements in list. - \toks0 = \expandafter{\floatlist\do}% - \fi - % - % Remember this xref in the control sequence \floatlistFLOATTYPE, - % for later use in \listoffloats. - \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 - {\safexrefname}}% - \fi -} - -% Read the last existing aux file, if any. No error if none exists. -% -\def\tryauxfile{% - \openin 1 \jobname.aux - \ifeof 1 \else - \readdatafile{aux}% - \global\havexrefstrue - \fi - \closein 1 -} - -\def\setupdatafile{% - \catcode`\^^@=\other - \catcode`\^^A=\other - \catcode`\^^B=\other - \catcode`\^^C=\other - \catcode`\^^D=\other - \catcode`\^^E=\other - \catcode`\^^F=\other - \catcode`\^^G=\other - \catcode`\^^H=\other - \catcode`\^^K=\other - \catcode`\^^L=\other - \catcode`\^^N=\other - \catcode`\^^P=\other - \catcode`\^^Q=\other - \catcode`\^^R=\other - \catcode`\^^S=\other - \catcode`\^^T=\other - \catcode`\^^U=\other - \catcode`\^^V=\other - \catcode`\^^W=\other - \catcode`\^^X=\other - \catcode`\^^Z=\other - \catcode`\^^[=\other - \catcode`\^^\=\other - \catcode`\^^]=\other - \catcode`\^^^=\other - \catcode`\^^_=\other - % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. - % in xref tags, i.e., node names. But since ^^e4 notation isn't - % supported in the main text, it doesn't seem desirable. Furthermore, - % that is not enough: for node names that actually contain a ^ - % character, we would end up writing a line like this: 'xrdef {'hat - % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first - % argument, and \hat is not an expandable control sequence. It could - % all be worked out, but why? Either we support ^^ or we don't. - % - % The other change necessary for this was to define \auxhat: - % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter - % and then to call \auxhat in \setq. - % - \catcode`\^=\other - % - % Special characters. Should be turned off anyway, but... - \catcode`\~=\other - \catcode`\[=\other - \catcode`\]=\other - \catcode`\"=\other - \catcode`\_=\other - \catcode`\|=\other - \catcode`\<=\other - \catcode`\>=\other - \catcode`\$=\other - \catcode`\#=\other - \catcode`\&=\other - \catcode`\%=\other - \catcode`+=\other % avoid \+ for paranoia even though we've turned it off - % - % This is to support \ in node names and titles, since the \ - % characters end up in a \csname. It's easier than - % leaving it active and making its active definition an actual \ - % character. What I don't understand is why it works in the *value* - % of the xrdef. Seems like it should be a catcode12 \, and that - % should not typeset properly. But it works, so I'm moving on for - % now. --karl, 15jan04. - \catcode`\\=\other - % - % Make the characters 128-255 be printing characters. - {% - \count1=128 - \def\loop{% - \catcode\count1=\other - \advance\count1 by 1 - \ifnum \count1<256 \loop \fi - }% - }% - % - % @ is our escape character in .aux files, and we need braces. - \catcode`\{=1 - \catcode`\}=2 - \catcode`\@=0 -} - -\def\readdatafile#1{% -\begingroup - \setupdatafile - \input\jobname.#1 -\endgroup} - - -\message{insertions,} -% including footnotes. - -\newcount \footnoteno - -% The trailing space in the following definition for supereject is -% vital for proper filling; pages come out unaligned when you do a -% pagealignmacro call if that space before the closing brace is -% removed. (Generally, numeric constants should always be followed by a -% space to prevent strange expansion errors.) -\def\supereject{\par\penalty -20000\footnoteno =0 } - -% @footnotestyle is meaningful for info output only. -\let\footnotestyle=\comment - -{\catcode `\@=11 -% -% Auto-number footnotes. Otherwise like plain. -\gdef\footnote{% - \let\indent=\ptexindent - \let\noindent=\ptexnoindent - \global\advance\footnoteno by \@ne - \edef\thisfootno{$^{\the\footnoteno}$}% - % - % In case the footnote comes at the end of a sentence, preserve the - % extra spacing after we do the footnote number. - \let\@sf\empty - \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi - % - % Remove inadvertent blank space before typesetting the footnote number. - \unskip - \thisfootno\@sf - \dofootnote -}% - -% Don't bother with the trickery in plain.tex to not require the -% footnote text as a parameter. Our footnotes don't need to be so general. -% -% Oh yes, they do; otherwise, @ifset (and anything else that uses -% \parseargline) fails inside footnotes because the tokens are fixed when -% the footnote is read. --karl, 16nov96. -% -\gdef\dofootnote{% - \insert\footins\bgroup - % We want to typeset this text as a normal paragraph, even if the - % footnote reference occurs in (for example) a display environment. - % So reset some parameters. - \hsize=\pagewidth - \interlinepenalty\interfootnotelinepenalty - \splittopskip\ht\strutbox % top baseline for broken footnotes - \splitmaxdepth\dp\strutbox - \floatingpenalty\@MM - \leftskip\z@skip - \rightskip\z@skip - \spaceskip\z@skip - \xspaceskip\z@skip - \parindent\defaultparindent - % - \smallfonts \rm - % - % Because we use hanging indentation in footnotes, a @noindent appears - % to exdent this text, so make it be a no-op. makeinfo does not use - % hanging indentation so @noindent can still be needed within footnote - % text after an @example or the like (not that this is good style). - \let\noindent = \relax - % - % Hang the footnote text off the number. Use \everypar in case the - % footnote extends for more than one paragraph. - \everypar = {\hang}% - \textindent{\thisfootno}% - % - % Don't crash into the line above the footnote text. Since this - % expands into a box, it must come within the paragraph, lest it - % provide a place where TeX can split the footnote. - \footstrut - \futurelet\next\fo@t -} -}%end \catcode `\@=11 - -% In case a @footnote appears in a vbox, save the footnote text and create -% the real \insert just after the vbox finished. Otherwise, the insertion -% would be lost. -% Similarly, if a @footnote appears inside an alignment, save the footnote -% text to a box and make the \insert when a row of the table is finished. -% And the same can be done for other insert classes. --kasal, 16nov03. - -% Replace the \insert primitive by a cheating macro. -% Deeper inside, just make sure that the saved insertions are not spilled -% out prematurely. -% -\def\startsavinginserts{% - \ifx \insert\ptexinsert - \let\insert\saveinsert - \else - \let\checkinserts\relax - \fi -} - -% This \insert replacement works for both \insert\footins{foo} and -% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. -% -\def\saveinsert#1{% - \edef\next{\noexpand\savetobox \makeSAVEname#1}% - \afterassignment\next - % swallow the left brace - \let\temp = -} -\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} -\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} - -\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} - -\def\placesaveins#1{% - \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname - {\box#1}% -} - -% eat @SAVE -- beware, all of them have catcode \other: -{ - \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) - \gdef\gobblesave @SAVE{} -} - -% initialization: -\def\newsaveins #1{% - \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% - \next -} -\def\newsaveinsX #1{% - \csname newbox\endcsname #1% - \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts - \checksaveins #1}% -} - -% initialize: -\let\checkinserts\empty -\newsaveins\footins -\newsaveins\margin - - -% @image. We use the macros from epsf.tex to support this. -% If epsf.tex is not installed and @image is used, we complain. -% -% Check for and read epsf.tex up front. If we read it only at @image -% time, we might be inside a group, and then its definitions would get -% undone and the next image would fail. -\openin 1 = epsf.tex -\ifeof 1 \else - % Do not bother showing banner with epsf.tex v2.7k (available in - % doc/epsf.tex and on ctan). - \def\epsfannounce{\toks0 = }% - \input epsf.tex -\fi -\closein 1 -% -% We will only complain once about lack of epsf.tex. -\newif\ifwarnednoepsf -\newhelp\noepsfhelp{epsf.tex must be installed for images to - work. It is also included in the Texinfo distribution, or you can get - it from ftp://tug.org/tex/epsf.tex.} -% -\def\image#1{% - \ifx\epsfbox\undefined - \ifwarnednoepsf \else - \errhelp = \noepsfhelp - \errmessage{epsf.tex not found, images will be ignored}% - \global\warnednoepsftrue - \fi - \else - \imagexxx #1,,,,,\finish - \fi -} -% -% Arguments to @image: -% #1 is (mandatory) image filename; we tack on .eps extension. -% #2 is (optional) width, #3 is (optional) height. -% #4 is (ignored optional) html alt text. -% #5 is (ignored optional) extension. -% #6 is just the usual extra ignored arg for parsing this stuff. -\newif\ifimagevmode -\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup - \catcode`\^^M = 5 % in case we're inside an example - \normalturnoffactive % allow _ et al. in names - % If the image is by itself, center it. - \ifvmode - \imagevmodetrue - \nobreak\medskip - % Usually we'll have text after the image which will insert - % \parskip glue, so insert it here too to equalize the space - % above and below. - \nobreak\vskip\parskip - \nobreak - \fi - % - % Leave vertical mode so that indentation from an enclosing - % environment such as @quotation is respected. On the other hand, if - % it's at the top level, we don't want the normal paragraph indentation. - \noindent - % - % Output the image. - \ifpdf - \dopdfimage{#1}{#2}{#3}% - \else - % \epsfbox itself resets \epsf?size at each figure. - \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi - \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi - \epsfbox{#1.eps}% - \fi - % - \ifimagevmode \medskip \fi % space after the standalone image -\endgroup} - - -% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, -% etc. We don't actually implement floating yet, we always include the -% float "here". But it seemed the best name for the future. -% -\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} - -% There may be a space before second and/or third parameter; delete it. -\def\eatcommaspace#1, {#1,} - -% #1 is the optional FLOATTYPE, the text label for this float, typically -% "Figure", "Table", "Example", etc. Can't contain commas. If omitted, -% this float will not be numbered and cannot be referred to. -% -% #2 is the optional xref label. Also must be present for the float to -% be referable. -% -% #3 is the optional positioning argument; for now, it is ignored. It -% will somehow specify the positions allowed to float to (here, top, bottom). -% -% We keep a separate counter for each FLOATTYPE, which we reset at each -% chapter-level command. -\let\resetallfloatnos=\empty -% -\def\dofloat#1,#2,#3,#4\finish{% - \let\thiscaption=\empty - \let\thisshortcaption=\empty - % - % don't lose footnotes inside @float. - % - % BEWARE: when the floats start float, we have to issue warning whenever an - % insert appears inside a float which could possibly float. --kasal, 26may04 - % - \startsavinginserts - % - % We can't be used inside a paragraph. - \par - % - \vtop\bgroup - \def\floattype{#1}% - \def\floatlabel{#2}% - \def\floatloc{#3}% we do nothing with this yet. - % - \ifx\floattype\empty - \let\safefloattype=\empty - \else - {% - % the floattype might have accents or other special characters, - % but we need to use it in a control sequence name. - \indexnofonts - \turnoffactive - \xdef\safefloattype{\floattype}% - }% - \fi - % - % If label is given but no type, we handle that as the empty type. - \ifx\floatlabel\empty \else - % We want each FLOATTYPE to be numbered separately (Figure 1, - % Table 1, Figure 2, ...). (And if no label, no number.) - % - \expandafter\getfloatno\csname\safefloattype floatno\endcsname - \global\advance\floatno by 1 - % - {% - % This magic value for \lastsection is output by \setref as the - % XREFLABEL-title value. \xrefX uses it to distinguish float - % labels (which have a completely different output format) from - % node and anchor labels. And \xrdef uses it to construct the - % lists of floats. - % - \edef\lastsection{\floatmagic=\safefloattype}% - \setref{\floatlabel}{Yfloat}% - }% - \fi - % - % start with \parskip glue, I guess. - \vskip\parskip - % - % Don't suppress indentation if a float happens to start a section. - \restorefirstparagraphindent -} - -% we have these possibilities: -% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap -% @float Foo,lbl & no caption: Foo 1.1 -% @float Foo & @caption{Cap}: Foo: Cap -% @float Foo & no caption: Foo -% @float ,lbl & Caption{Cap}: 1.1: Cap -% @float ,lbl & no caption: 1.1 -% @float & @caption{Cap}: Cap -% @float & no caption: -% -\def\Efloat{% - \let\floatident = \empty - % - % In all cases, if we have a float type, it comes first. - \ifx\floattype\empty \else \def\floatident{\floattype}\fi - % - % If we have an xref label, the number comes next. - \ifx\floatlabel\empty \else - \ifx\floattype\empty \else % if also had float type, need tie first. - \appendtomacro\floatident{\tie}% - \fi - % the number. - \appendtomacro\floatident{\chaplevelprefix\the\floatno}% - \fi - % - % Start the printed caption with what we've constructed in - % \floatident, but keep it separate; we need \floatident again. - \let\captionline = \floatident - % - \ifx\thiscaption\empty \else - \ifx\floatident\empty \else - \appendtomacro\captionline{: }% had ident, so need a colon between - \fi - % - % caption text. - \appendtomacro\captionline{\scanexp\thiscaption}% - \fi - % - % If we have anything to print, print it, with space before. - % Eventually this needs to become an \insert. - \ifx\captionline\empty \else - \vskip.5\parskip - \captionline - % - % Space below caption. - \vskip\parskip - \fi - % - % If have an xref label, write the list of floats info. Do this - % after the caption, to avoid chance of it being a breakpoint. - \ifx\floatlabel\empty \else - % Write the text that goes in the lof to the aux file as - % \floatlabel-lof. Besides \floatident, we include the short - % caption if specified, else the full caption if specified, else nothing. - {% - \atdummies - % - % since we read the caption text in the macro world, where ^^M - % is turned into a normal character, we have to scan it back, so - % we don't write the literal three characters "^^M" into the aux file. - \scanexp{% - \xdef\noexpand\gtemp{% - \ifx\thisshortcaption\empty - \thiscaption - \else - \thisshortcaption - \fi - }% - }% - \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident - \ifx\gtemp\empty \else : \gtemp \fi}}% - }% - \fi - \egroup % end of \vtop - % - % place the captured inserts - % - % BEWARE: when the floats start floating, we have to issue warning - % whenever an insert appears inside a float which could possibly - % float. --kasal, 26may04 - % - \checkinserts -} - -% Append the tokens #2 to the definition of macro #1, not expanding either. -% -\def\appendtomacro#1#2{% - \expandafter\def\expandafter#1\expandafter{#1#2}% -} - -% @caption, @shortcaption -% -\def\caption{\docaption\thiscaption} -\def\shortcaption{\docaption\thisshortcaption} -\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} -\def\defcaption#1#2{\egroup \def#1{#2}} - -% The parameter is the control sequence identifying the counter we are -% going to use. Create it if it doesn't exist and assign it to \floatno. -\def\getfloatno#1{% - \ifx#1\relax - % Haven't seen this figure type before. - \csname newcount\endcsname #1% - % - % Remember to reset this floatno at the next chap. - \expandafter\gdef\expandafter\resetallfloatnos - \expandafter{\resetallfloatnos #1=0 }% - \fi - \let\floatno#1% -} - -% \setref calls this to get the XREFLABEL-snt value. We want an @xref -% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we -% first read the @float command. -% -\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% - -% Magic string used for the XREFLABEL-title value, so \xrefX can -% distinguish floats from other xref types. -\def\floatmagic{!!float!!} - -% #1 is the control sequence we are passed; we expand into a conditional -% which is true if #1 represents a float ref. That is, the magic -% \lastsection value which we \setref above. -% -\def\iffloat#1{\expandafter\doiffloat#1==\finish} -% -% #1 is (maybe) the \floatmagic string. If so, #2 will be the -% (safe) float type for this float. We set \iffloattype to #2. -% -\def\doiffloat#1=#2=#3\finish{% - \def\temp{#1}% - \def\iffloattype{#2}% - \ifx\temp\floatmagic -} - -% @listoffloats FLOATTYPE - print a list of floats like a table of contents. -% -\parseargdef\listoffloats{% - \def\floattype{#1}% floattype - {% - % the floattype might have accents or other special characters, - % but we need to use it in a control sequence name. - \indexnofonts - \turnoffactive - \xdef\safefloattype{\floattype}% - }% - % - % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. - \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax - \ifhavexrefs - % if the user said @listoffloats foo but never @float foo. - \message{\linenumber No `\safefloattype' floats to list.}% - \fi - \else - \begingroup - \leftskip=\tocindent % indent these entries like a toc - \let\do=\listoffloatsdo - \csname floatlist\safefloattype\endcsname - \endgroup - \fi -} - -% This is called on each entry in a list of floats. We're passed the -% xref label, in the form LABEL-title, which is how we save it in the -% aux file. We strip off the -title and look up \XRLABEL-lof, which -% has the text we're supposed to typeset here. -% -% Figures without xref labels will not be included in the list (since -% they won't appear in the aux file). -% -\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} -\def\listoffloatsdoentry#1-title\finish{{% - % Can't fully expand XR#1-lof because it can contain anything. Just - % pass the control sequence. On the other hand, XR#1-pg is just the - % page number, and we want to fully expand that so we can get a link - % in pdf output. - \toksA = \expandafter{\csname XR#1-lof\endcsname}% - % - % use the same \entry macro we use to generate the TOC and index. - \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% - \writeentry -}} - - -\message{localization,} - -% For single-language documents, @documentlanguage is usually given very -% early, just after @documentencoding. Single argument is the language -% (de) or locale (de_DE) abbreviation. -% -{ - \catcode`\_ = \active - \globaldefs=1 -\parseargdef\documentlanguage{\begingroup - \let_=\normalunderscore % normal _ character for filenames - \tex % read txi-??.tex file in plain TeX. - % Read the file by the name they passed if it exists. - \openin 1 txi-#1.tex - \ifeof 1 - \documentlanguagetrywithoutunderscore{#1_\finish}% - \else - \globaldefs = 1 % everything in the txi-LL files needs to persist - \input txi-#1.tex - \fi - \closein 1 - \endgroup % end raw TeX -\endgroup} -% -% If they passed de_DE, and txi-de_DE.tex doesn't exist, -% try txi-de.tex. -% -\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% - \openin 1 txi-#1.tex - \ifeof 1 - \errhelp = \nolanghelp - \errmessage{Cannot read language file txi-#1.tex}% - \else - \globaldefs = 1 % everything in the txi-LL files needs to persist - \input txi-#1.tex - \fi - \closein 1 -} -}% end of special _ catcode -% -\newhelp\nolanghelp{The given language definition file cannot be found or -is empty. Maybe you need to install it? Putting it in the current -directory should work if nowhere else does.} - -% This macro is called from txi-??.tex files; the first argument is the -% \language name to set (without the "\lang@" prefix), the second and -% third args are \{left,right}hyphenmin. -% -% The language names to pass are determined when the format is built. -% See the etex.log file created at that time, e.g., -% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. -% -% With TeX Live 2008, etex now includes hyphenation patterns for all -% available languages. This means we can support hyphenation in -% Texinfo, at least to some extent. (This still doesn't solve the -% accented characters problem.) -% -\catcode`@=11 -\def\txisetlanguage#1#2#3{% - % do not set the language if the name is undefined in the current TeX. - \expandafter\ifx\csname lang@#1\endcsname \relax - \message{no patterns for #1}% - \else - \global\language = \csname lang@#1\endcsname - \fi - % but there is no harm in adjusting the hyphenmin values regardless. - \global\lefthyphenmin = #2\relax - \global\righthyphenmin = #3\relax -} - -% Helpers for encodings. -% Set the catcode of characters 128 through 255 to the specified number. -% -\def\setnonasciicharscatcode#1{% - \count255=128 - \loop\ifnum\count255<256 - \global\catcode\count255=#1\relax - \advance\count255 by 1 - \repeat -} - -\def\setnonasciicharscatcodenonglobal#1{% - \count255=128 - \loop\ifnum\count255<256 - \catcode\count255=#1\relax - \advance\count255 by 1 - \repeat -} - -% @documentencoding sets the definition of non-ASCII characters -% according to the specified encoding. -% -\parseargdef\documentencoding{% - % Encoding being declared for the document. - \def\declaredencoding{\csname #1.enc\endcsname}% - % - % Supported encodings: names converted to tokens in order to be able - % to compare them with \ifx. - \def\ascii{\csname US-ASCII.enc\endcsname}% - \def\latnine{\csname ISO-8859-15.enc\endcsname}% - \def\latone{\csname ISO-8859-1.enc\endcsname}% - \def\lattwo{\csname ISO-8859-2.enc\endcsname}% - \def\utfeight{\csname UTF-8.enc\endcsname}% - % - \ifx \declaredencoding \ascii - \asciichardefs - % - \else \ifx \declaredencoding \lattwo - \setnonasciicharscatcode\active - \lattwochardefs - % - \else \ifx \declaredencoding \latone - \setnonasciicharscatcode\active - \latonechardefs - % - \else \ifx \declaredencoding \latnine - \setnonasciicharscatcode\active - \latninechardefs - % - \else \ifx \declaredencoding \utfeight - \setnonasciicharscatcode\active - \utfeightchardefs - % - \else - \message{Unknown document encoding #1, ignoring.}% - % - \fi % utfeight - \fi % latnine - \fi % latone - \fi % lattwo - \fi % ascii -} - -% A message to be logged when using a character that isn't available -% the default font encoding (OT1). -% -\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} - -% Take account of \c (plain) vs. \, (Texinfo) difference. -\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} - -% First, make active non-ASCII characters in order for them to be -% correctly categorized when TeX reads the replacement text of -% macros containing the character definitions. -\setnonasciicharscatcode\active -% -% Latin1 (ISO-8859-1) character definitions. -\def\latonechardefs{% - \gdef^^a0{~} - \gdef^^a1{\exclamdown} - \gdef^^a2{\missingcharmsg{CENT SIGN}} - \gdef^^a3{{\pounds}} - \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} - \gdef^^a5{\missingcharmsg{YEN SIGN}} - \gdef^^a6{\missingcharmsg{BROKEN BAR}} - \gdef^^a7{\S} - \gdef^^a8{\"{}} - \gdef^^a9{\copyright} - \gdef^^aa{\ordf} - \gdef^^ab{\guillemetleft} - \gdef^^ac{$\lnot$} - \gdef^^ad{\-} - \gdef^^ae{\registeredsymbol} - \gdef^^af{\={}} - % - \gdef^^b0{\textdegree} - \gdef^^b1{$\pm$} - \gdef^^b2{$^2$} - \gdef^^b3{$^3$} - \gdef^^b4{\'{}} - \gdef^^b5{$\mu$} - \gdef^^b6{\P} - % - \gdef^^b7{$^.$} - \gdef^^b8{\cedilla\ } - \gdef^^b9{$^1$} - \gdef^^ba{\ordm} - % - \gdef^^bb{\guilletright} - \gdef^^bc{$1\over4$} - \gdef^^bd{$1\over2$} - \gdef^^be{$3\over4$} - \gdef^^bf{\questiondown} - % - \gdef^^c0{\`A} - \gdef^^c1{\'A} - \gdef^^c2{\^A} - \gdef^^c3{\~A} - \gdef^^c4{\"A} - \gdef^^c5{\ringaccent A} - \gdef^^c6{\AE} - \gdef^^c7{\cedilla C} - \gdef^^c8{\`E} - \gdef^^c9{\'E} - \gdef^^ca{\^E} - \gdef^^cb{\"E} - \gdef^^cc{\`I} - \gdef^^cd{\'I} - \gdef^^ce{\^I} - \gdef^^cf{\"I} - % - \gdef^^d0{\DH} - \gdef^^d1{\~N} - \gdef^^d2{\`O} - \gdef^^d3{\'O} - \gdef^^d4{\^O} - \gdef^^d5{\~O} - \gdef^^d6{\"O} - \gdef^^d7{$\times$} - \gdef^^d8{\O} - \gdef^^d9{\`U} - \gdef^^da{\'U} - \gdef^^db{\^U} - \gdef^^dc{\"U} - \gdef^^dd{\'Y} - \gdef^^de{\TH} - \gdef^^df{\ss} - % - \gdef^^e0{\`a} - \gdef^^e1{\'a} - \gdef^^e2{\^a} - \gdef^^e3{\~a} - \gdef^^e4{\"a} - \gdef^^e5{\ringaccent a} - \gdef^^e6{\ae} - \gdef^^e7{\cedilla c} - \gdef^^e8{\`e} - \gdef^^e9{\'e} - \gdef^^ea{\^e} - \gdef^^eb{\"e} - \gdef^^ec{\`{\dotless i}} - \gdef^^ed{\'{\dotless i}} - \gdef^^ee{\^{\dotless i}} - \gdef^^ef{\"{\dotless i}} - % - \gdef^^f0{\dh} - \gdef^^f1{\~n} - \gdef^^f2{\`o} - \gdef^^f3{\'o} - \gdef^^f4{\^o} - \gdef^^f5{\~o} - \gdef^^f6{\"o} - \gdef^^f7{$\div$} - \gdef^^f8{\o} - \gdef^^f9{\`u} - \gdef^^fa{\'u} - \gdef^^fb{\^u} - \gdef^^fc{\"u} - \gdef^^fd{\'y} - \gdef^^fe{\th} - \gdef^^ff{\"y} -} - -% Latin9 (ISO-8859-15) encoding character definitions. -\def\latninechardefs{% - % Encoding is almost identical to Latin1. - \latonechardefs - % - \gdef^^a4{\euro} - \gdef^^a6{\v S} - \gdef^^a8{\v s} - \gdef^^b4{\v Z} - \gdef^^b8{\v z} - \gdef^^bc{\OE} - \gdef^^bd{\oe} - \gdef^^be{\"Y} -} - -% Latin2 (ISO-8859-2) character definitions. -\def\lattwochardefs{% - \gdef^^a0{~} - \gdef^^a1{\ogonek{A}} - \gdef^^a2{\u{}} - \gdef^^a3{\L} - \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} - \gdef^^a5{\v L} - \gdef^^a6{\'S} - \gdef^^a7{\S} - \gdef^^a8{\"{}} - \gdef^^a9{\v S} - \gdef^^aa{\cedilla S} - \gdef^^ab{\v T} - \gdef^^ac{\'Z} - \gdef^^ad{\-} - \gdef^^ae{\v Z} - \gdef^^af{\dotaccent Z} - % - \gdef^^b0{\textdegree} - \gdef^^b1{\ogonek{a}} - \gdef^^b2{\ogonek{ }} - \gdef^^b3{\l} - \gdef^^b4{\'{}} - \gdef^^b5{\v l} - \gdef^^b6{\'s} - \gdef^^b7{\v{}} - \gdef^^b8{\cedilla\ } - \gdef^^b9{\v s} - \gdef^^ba{\cedilla s} - \gdef^^bb{\v t} - \gdef^^bc{\'z} - \gdef^^bd{\H{}} - \gdef^^be{\v z} - \gdef^^bf{\dotaccent z} - % - \gdef^^c0{\'R} - \gdef^^c1{\'A} - \gdef^^c2{\^A} - \gdef^^c3{\u A} - \gdef^^c4{\"A} - \gdef^^c5{\'L} - \gdef^^c6{\'C} - \gdef^^c7{\cedilla C} - \gdef^^c8{\v C} - \gdef^^c9{\'E} - \gdef^^ca{\ogonek{E}} - \gdef^^cb{\"E} - \gdef^^cc{\v E} - \gdef^^cd{\'I} - \gdef^^ce{\^I} - \gdef^^cf{\v D} - % - \gdef^^d0{\DH} - \gdef^^d1{\'N} - \gdef^^d2{\v N} - \gdef^^d3{\'O} - \gdef^^d4{\^O} - \gdef^^d5{\H O} - \gdef^^d6{\"O} - \gdef^^d7{$\times$} - \gdef^^d8{\v R} - \gdef^^d9{\ringaccent U} - \gdef^^da{\'U} - \gdef^^db{\H U} - \gdef^^dc{\"U} - \gdef^^dd{\'Y} - \gdef^^de{\cedilla T} - \gdef^^df{\ss} - % - \gdef^^e0{\'r} - \gdef^^e1{\'a} - \gdef^^e2{\^a} - \gdef^^e3{\u a} - \gdef^^e4{\"a} - \gdef^^e5{\'l} - \gdef^^e6{\'c} - \gdef^^e7{\cedilla c} - \gdef^^e8{\v c} - \gdef^^e9{\'e} - \gdef^^ea{\ogonek{e}} - \gdef^^eb{\"e} - \gdef^^ec{\v e} - \gdef^^ed{\'\i} - \gdef^^ee{\^\i} - \gdef^^ef{\v d} - % - \gdef^^f0{\dh} - \gdef^^f1{\'n} - \gdef^^f2{\v n} - \gdef^^f3{\'o} - \gdef^^f4{\^o} - \gdef^^f5{\H o} - \gdef^^f6{\"o} - \gdef^^f7{$\div$} - \gdef^^f8{\v r} - \gdef^^f9{\ringaccent u} - \gdef^^fa{\'u} - \gdef^^fb{\H u} - \gdef^^fc{\"u} - \gdef^^fd{\'y} - \gdef^^fe{\cedilla t} - \gdef^^ff{\dotaccent{}} -} - -% UTF-8 character definitions. -% -% This code to support UTF-8 is based on LaTeX's utf8.def, with some -% changes for Texinfo conventions. It is included here under the GPL by -% permission from Frank Mittelbach and the LaTeX team. -% -\newcount\countUTFx -\newcount\countUTFy -\newcount\countUTFz - -\gdef\UTFviiiTwoOctets#1#2{\expandafter - \UTFviiiDefined\csname u8:#1\string #2\endcsname} -% -\gdef\UTFviiiThreeOctets#1#2#3{\expandafter - \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} -% -\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter - \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} - -\gdef\UTFviiiDefined#1{% - \ifx #1\relax - \message{\linenumber Unicode char \string #1 not defined for Texinfo}% - \else - \expandafter #1% - \fi -} - -\begingroup - \catcode`\~13 - \catcode`\"12 - - \def\UTFviiiLoop{% - \global\catcode\countUTFx\active - \uccode`\~\countUTFx - \uppercase\expandafter{\UTFviiiTmp}% - \advance\countUTFx by 1 - \ifnum\countUTFx < \countUTFy - \expandafter\UTFviiiLoop - \fi} - - \countUTFx = "C2 - \countUTFy = "E0 - \def\UTFviiiTmp{% - \xdef~{\noexpand\UTFviiiTwoOctets\string~}} - \UTFviiiLoop - - \countUTFx = "E0 - \countUTFy = "F0 - \def\UTFviiiTmp{% - \xdef~{\noexpand\UTFviiiThreeOctets\string~}} - \UTFviiiLoop - - \countUTFx = "F0 - \countUTFy = "F4 - \def\UTFviiiTmp{% - \xdef~{\noexpand\UTFviiiFourOctets\string~}} - \UTFviiiLoop -\endgroup - -\begingroup - \catcode`\"=12 - \catcode`\<=12 - \catcode`\.=12 - \catcode`\,=12 - \catcode`\;=12 - \catcode`\!=12 - \catcode`\~=13 - - \gdef\DeclareUnicodeCharacter#1#2{% - \countUTFz = "#1\relax - \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% - \begingroup - \parseXMLCharref - \def\UTFviiiTwoOctets##1##2{% - \csname u8:##1\string ##2\endcsname}% - \def\UTFviiiThreeOctets##1##2##3{% - \csname u8:##1\string ##2\string ##3\endcsname}% - \def\UTFviiiFourOctets##1##2##3##4{% - \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% - \expandafter\expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter - \gdef\UTFviiiTmp{#2}% - \endgroup} - - \gdef\parseXMLCharref{% - \ifnum\countUTFz < "A0\relax - \errhelp = \EMsimple - \errmessage{Cannot define Unicode char value < 00A0}% - \else\ifnum\countUTFz < "800\relax - \parseUTFviiiA,% - \parseUTFviiiB C\UTFviiiTwoOctets.,% - \else\ifnum\countUTFz < "10000\relax - \parseUTFviiiA;% - \parseUTFviiiA,% - \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% - \else - \parseUTFviiiA;% - \parseUTFviiiA,% - \parseUTFviiiA!% - \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% - \fi\fi\fi - } - - \gdef\parseUTFviiiA#1{% - \countUTFx = \countUTFz - \divide\countUTFz by 64 - \countUTFy = \countUTFz - \multiply\countUTFz by 64 - \advance\countUTFx by -\countUTFz - \advance\countUTFx by 128 - \uccode `#1\countUTFx - \countUTFz = \countUTFy} - - \gdef\parseUTFviiiB#1#2#3#4{% - \advance\countUTFz by "#10\relax - \uccode `#3\countUTFz - \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} -\endgroup - -\def\utfeightchardefs{% - \DeclareUnicodeCharacter{00A0}{\tie} - \DeclareUnicodeCharacter{00A1}{\exclamdown} - \DeclareUnicodeCharacter{00A3}{\pounds} - \DeclareUnicodeCharacter{00A8}{\"{ }} - \DeclareUnicodeCharacter{00A9}{\copyright} - \DeclareUnicodeCharacter{00AA}{\ordf} - \DeclareUnicodeCharacter{00AB}{\guillemetleft} - \DeclareUnicodeCharacter{00AD}{\-} - \DeclareUnicodeCharacter{00AE}{\registeredsymbol} - \DeclareUnicodeCharacter{00AF}{\={ }} - - \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} - \DeclareUnicodeCharacter{00B4}{\'{ }} - \DeclareUnicodeCharacter{00B8}{\cedilla{ }} - \DeclareUnicodeCharacter{00BA}{\ordm} - \DeclareUnicodeCharacter{00BB}{\guillemetright} - \DeclareUnicodeCharacter{00BF}{\questiondown} - - \DeclareUnicodeCharacter{00C0}{\`A} - \DeclareUnicodeCharacter{00C1}{\'A} - \DeclareUnicodeCharacter{00C2}{\^A} - \DeclareUnicodeCharacter{00C3}{\~A} - \DeclareUnicodeCharacter{00C4}{\"A} - \DeclareUnicodeCharacter{00C5}{\AA} - \DeclareUnicodeCharacter{00C6}{\AE} - \DeclareUnicodeCharacter{00C7}{\cedilla{C}} - \DeclareUnicodeCharacter{00C8}{\`E} - \DeclareUnicodeCharacter{00C9}{\'E} - \DeclareUnicodeCharacter{00CA}{\^E} - \DeclareUnicodeCharacter{00CB}{\"E} - \DeclareUnicodeCharacter{00CC}{\`I} - \DeclareUnicodeCharacter{00CD}{\'I} - \DeclareUnicodeCharacter{00CE}{\^I} - \DeclareUnicodeCharacter{00CF}{\"I} - - \DeclareUnicodeCharacter{00D0}{\DH} - \DeclareUnicodeCharacter{00D1}{\~N} - \DeclareUnicodeCharacter{00D2}{\`O} - \DeclareUnicodeCharacter{00D3}{\'O} - \DeclareUnicodeCharacter{00D4}{\^O} - \DeclareUnicodeCharacter{00D5}{\~O} - \DeclareUnicodeCharacter{00D6}{\"O} - \DeclareUnicodeCharacter{00D8}{\O} - \DeclareUnicodeCharacter{00D9}{\`U} - \DeclareUnicodeCharacter{00DA}{\'U} - \DeclareUnicodeCharacter{00DB}{\^U} - \DeclareUnicodeCharacter{00DC}{\"U} - \DeclareUnicodeCharacter{00DD}{\'Y} - \DeclareUnicodeCharacter{00DE}{\TH} - \DeclareUnicodeCharacter{00DF}{\ss} - - \DeclareUnicodeCharacter{00E0}{\`a} - \DeclareUnicodeCharacter{00E1}{\'a} - \DeclareUnicodeCharacter{00E2}{\^a} - \DeclareUnicodeCharacter{00E3}{\~a} - \DeclareUnicodeCharacter{00E4}{\"a} - \DeclareUnicodeCharacter{00E5}{\aa} - \DeclareUnicodeCharacter{00E6}{\ae} - \DeclareUnicodeCharacter{00E7}{\cedilla{c}} - \DeclareUnicodeCharacter{00E8}{\`e} - \DeclareUnicodeCharacter{00E9}{\'e} - \DeclareUnicodeCharacter{00EA}{\^e} - \DeclareUnicodeCharacter{00EB}{\"e} - \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} - \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} - \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} - \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} - - \DeclareUnicodeCharacter{00F0}{\dh} - \DeclareUnicodeCharacter{00F1}{\~n} - \DeclareUnicodeCharacter{00F2}{\`o} - \DeclareUnicodeCharacter{00F3}{\'o} - \DeclareUnicodeCharacter{00F4}{\^o} - \DeclareUnicodeCharacter{00F5}{\~o} - \DeclareUnicodeCharacter{00F6}{\"o} - \DeclareUnicodeCharacter{00F8}{\o} - \DeclareUnicodeCharacter{00F9}{\`u} - \DeclareUnicodeCharacter{00FA}{\'u} - \DeclareUnicodeCharacter{00FB}{\^u} - \DeclareUnicodeCharacter{00FC}{\"u} - \DeclareUnicodeCharacter{00FD}{\'y} - \DeclareUnicodeCharacter{00FE}{\th} - \DeclareUnicodeCharacter{00FF}{\"y} - - \DeclareUnicodeCharacter{0100}{\=A} - \DeclareUnicodeCharacter{0101}{\=a} - \DeclareUnicodeCharacter{0102}{\u{A}} - \DeclareUnicodeCharacter{0103}{\u{a}} - \DeclareUnicodeCharacter{0104}{\ogonek{A}} - \DeclareUnicodeCharacter{0105}{\ogonek{a}} - \DeclareUnicodeCharacter{0106}{\'C} - \DeclareUnicodeCharacter{0107}{\'c} - \DeclareUnicodeCharacter{0108}{\^C} - \DeclareUnicodeCharacter{0109}{\^c} - \DeclareUnicodeCharacter{0118}{\ogonek{E}} - \DeclareUnicodeCharacter{0119}{\ogonek{e}} - \DeclareUnicodeCharacter{010A}{\dotaccent{C}} - \DeclareUnicodeCharacter{010B}{\dotaccent{c}} - \DeclareUnicodeCharacter{010C}{\v{C}} - \DeclareUnicodeCharacter{010D}{\v{c}} - \DeclareUnicodeCharacter{010E}{\v{D}} - - \DeclareUnicodeCharacter{0112}{\=E} - \DeclareUnicodeCharacter{0113}{\=e} - \DeclareUnicodeCharacter{0114}{\u{E}} - \DeclareUnicodeCharacter{0115}{\u{e}} - \DeclareUnicodeCharacter{0116}{\dotaccent{E}} - \DeclareUnicodeCharacter{0117}{\dotaccent{e}} - \DeclareUnicodeCharacter{011A}{\v{E}} - \DeclareUnicodeCharacter{011B}{\v{e}} - \DeclareUnicodeCharacter{011C}{\^G} - \DeclareUnicodeCharacter{011D}{\^g} - \DeclareUnicodeCharacter{011E}{\u{G}} - \DeclareUnicodeCharacter{011F}{\u{g}} - - \DeclareUnicodeCharacter{0120}{\dotaccent{G}} - \DeclareUnicodeCharacter{0121}{\dotaccent{g}} - \DeclareUnicodeCharacter{0124}{\^H} - \DeclareUnicodeCharacter{0125}{\^h} - \DeclareUnicodeCharacter{0128}{\~I} - \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} - \DeclareUnicodeCharacter{012A}{\=I} - \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} - \DeclareUnicodeCharacter{012C}{\u{I}} - \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} - - \DeclareUnicodeCharacter{0130}{\dotaccent{I}} - \DeclareUnicodeCharacter{0131}{\dotless{i}} - \DeclareUnicodeCharacter{0132}{IJ} - \DeclareUnicodeCharacter{0133}{ij} - \DeclareUnicodeCharacter{0134}{\^J} - \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} - \DeclareUnicodeCharacter{0139}{\'L} - \DeclareUnicodeCharacter{013A}{\'l} - - \DeclareUnicodeCharacter{0141}{\L} - \DeclareUnicodeCharacter{0142}{\l} - \DeclareUnicodeCharacter{0143}{\'N} - \DeclareUnicodeCharacter{0144}{\'n} - \DeclareUnicodeCharacter{0147}{\v{N}} - \DeclareUnicodeCharacter{0148}{\v{n}} - \DeclareUnicodeCharacter{014C}{\=O} - \DeclareUnicodeCharacter{014D}{\=o} - \DeclareUnicodeCharacter{014E}{\u{O}} - \DeclareUnicodeCharacter{014F}{\u{o}} - - \DeclareUnicodeCharacter{0150}{\H{O}} - \DeclareUnicodeCharacter{0151}{\H{o}} - \DeclareUnicodeCharacter{0152}{\OE} - \DeclareUnicodeCharacter{0153}{\oe} - \DeclareUnicodeCharacter{0154}{\'R} - \DeclareUnicodeCharacter{0155}{\'r} - \DeclareUnicodeCharacter{0158}{\v{R}} - \DeclareUnicodeCharacter{0159}{\v{r}} - \DeclareUnicodeCharacter{015A}{\'S} - \DeclareUnicodeCharacter{015B}{\'s} - \DeclareUnicodeCharacter{015C}{\^S} - \DeclareUnicodeCharacter{015D}{\^s} - \DeclareUnicodeCharacter{015E}{\cedilla{S}} - \DeclareUnicodeCharacter{015F}{\cedilla{s}} - - \DeclareUnicodeCharacter{0160}{\v{S}} - \DeclareUnicodeCharacter{0161}{\v{s}} - \DeclareUnicodeCharacter{0162}{\cedilla{t}} - \DeclareUnicodeCharacter{0163}{\cedilla{T}} - \DeclareUnicodeCharacter{0164}{\v{T}} - - \DeclareUnicodeCharacter{0168}{\~U} - \DeclareUnicodeCharacter{0169}{\~u} - \DeclareUnicodeCharacter{016A}{\=U} - \DeclareUnicodeCharacter{016B}{\=u} - \DeclareUnicodeCharacter{016C}{\u{U}} - \DeclareUnicodeCharacter{016D}{\u{u}} - \DeclareUnicodeCharacter{016E}{\ringaccent{U}} - \DeclareUnicodeCharacter{016F}{\ringaccent{u}} - - \DeclareUnicodeCharacter{0170}{\H{U}} - \DeclareUnicodeCharacter{0171}{\H{u}} - \DeclareUnicodeCharacter{0174}{\^W} - \DeclareUnicodeCharacter{0175}{\^w} - \DeclareUnicodeCharacter{0176}{\^Y} - \DeclareUnicodeCharacter{0177}{\^y} - \DeclareUnicodeCharacter{0178}{\"Y} - \DeclareUnicodeCharacter{0179}{\'Z} - \DeclareUnicodeCharacter{017A}{\'z} - \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} - \DeclareUnicodeCharacter{017C}{\dotaccent{z}} - \DeclareUnicodeCharacter{017D}{\v{Z}} - \DeclareUnicodeCharacter{017E}{\v{z}} - - \DeclareUnicodeCharacter{01C4}{D\v{Z}} - \DeclareUnicodeCharacter{01C5}{D\v{z}} - \DeclareUnicodeCharacter{01C6}{d\v{z}} - \DeclareUnicodeCharacter{01C7}{LJ} - \DeclareUnicodeCharacter{01C8}{Lj} - \DeclareUnicodeCharacter{01C9}{lj} - \DeclareUnicodeCharacter{01CA}{NJ} - \DeclareUnicodeCharacter{01CB}{Nj} - \DeclareUnicodeCharacter{01CC}{nj} - \DeclareUnicodeCharacter{01CD}{\v{A}} - \DeclareUnicodeCharacter{01CE}{\v{a}} - \DeclareUnicodeCharacter{01CF}{\v{I}} - - \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} - \DeclareUnicodeCharacter{01D1}{\v{O}} - \DeclareUnicodeCharacter{01D2}{\v{o}} - \DeclareUnicodeCharacter{01D3}{\v{U}} - \DeclareUnicodeCharacter{01D4}{\v{u}} - - \DeclareUnicodeCharacter{01E2}{\={\AE}} - \DeclareUnicodeCharacter{01E3}{\={\ae}} - \DeclareUnicodeCharacter{01E6}{\v{G}} - \DeclareUnicodeCharacter{01E7}{\v{g}} - \DeclareUnicodeCharacter{01E8}{\v{K}} - \DeclareUnicodeCharacter{01E9}{\v{k}} - - \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} - \DeclareUnicodeCharacter{01F1}{DZ} - \DeclareUnicodeCharacter{01F2}{Dz} - \DeclareUnicodeCharacter{01F3}{dz} - \DeclareUnicodeCharacter{01F4}{\'G} - \DeclareUnicodeCharacter{01F5}{\'g} - \DeclareUnicodeCharacter{01F8}{\`N} - \DeclareUnicodeCharacter{01F9}{\`n} - \DeclareUnicodeCharacter{01FC}{\'{\AE}} - \DeclareUnicodeCharacter{01FD}{\'{\ae}} - \DeclareUnicodeCharacter{01FE}{\'{\O}} - \DeclareUnicodeCharacter{01FF}{\'{\o}} - - \DeclareUnicodeCharacter{021E}{\v{H}} - \DeclareUnicodeCharacter{021F}{\v{h}} - - \DeclareUnicodeCharacter{0226}{\dotaccent{A}} - \DeclareUnicodeCharacter{0227}{\dotaccent{a}} - \DeclareUnicodeCharacter{0228}{\cedilla{E}} - \DeclareUnicodeCharacter{0229}{\cedilla{e}} - \DeclareUnicodeCharacter{022E}{\dotaccent{O}} - \DeclareUnicodeCharacter{022F}{\dotaccent{o}} - - \DeclareUnicodeCharacter{0232}{\=Y} - \DeclareUnicodeCharacter{0233}{\=y} - \DeclareUnicodeCharacter{0237}{\dotless{j}} - - \DeclareUnicodeCharacter{02DB}{\ogonek{ }} - - \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} - \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} - \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} - \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} - \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} - \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} - \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} - \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} - \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} - \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} - \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} - \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} - - \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} - \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} - - \DeclareUnicodeCharacter{1E20}{\=G} - \DeclareUnicodeCharacter{1E21}{\=g} - \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} - \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} - \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} - \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} - \DeclareUnicodeCharacter{1E26}{\"H} - \DeclareUnicodeCharacter{1E27}{\"h} - - \DeclareUnicodeCharacter{1E30}{\'K} - \DeclareUnicodeCharacter{1E31}{\'k} - \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} - \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} - \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} - \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} - \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} - \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} - \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} - \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} - \DeclareUnicodeCharacter{1E3E}{\'M} - \DeclareUnicodeCharacter{1E3F}{\'m} - - \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} - \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} - \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} - \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} - \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} - \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} - \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} - \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} - \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} - \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} - - \DeclareUnicodeCharacter{1E54}{\'P} - \DeclareUnicodeCharacter{1E55}{\'p} - \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} - \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} - \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} - \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} - \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} - \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} - \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} - \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} - - \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} - \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} - \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} - \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} - \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} - \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} - \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} - \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} - \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} - \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} - - \DeclareUnicodeCharacter{1E7C}{\~V} - \DeclareUnicodeCharacter{1E7D}{\~v} - \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} - \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} - - \DeclareUnicodeCharacter{1E80}{\`W} - \DeclareUnicodeCharacter{1E81}{\`w} - \DeclareUnicodeCharacter{1E82}{\'W} - \DeclareUnicodeCharacter{1E83}{\'w} - \DeclareUnicodeCharacter{1E84}{\"W} - \DeclareUnicodeCharacter{1E85}{\"w} - \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} - \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} - \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} - \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} - \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} - \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} - \DeclareUnicodeCharacter{1E8C}{\"X} - \DeclareUnicodeCharacter{1E8D}{\"x} - \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} - \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} - - \DeclareUnicodeCharacter{1E90}{\^Z} - \DeclareUnicodeCharacter{1E91}{\^z} - \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} - \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} - \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} - \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} - \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} - \DeclareUnicodeCharacter{1E97}{\"t} - \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} - \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} - - \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} - \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} - - \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} - \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} - \DeclareUnicodeCharacter{1EBC}{\~E} - \DeclareUnicodeCharacter{1EBD}{\~e} - - \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} - \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} - \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} - \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} - - \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} - \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} - - \DeclareUnicodeCharacter{1EF2}{\`Y} - \DeclareUnicodeCharacter{1EF3}{\`y} - \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} - - \DeclareUnicodeCharacter{1EF8}{\~Y} - \DeclareUnicodeCharacter{1EF9}{\~y} - - \DeclareUnicodeCharacter{2013}{--} - \DeclareUnicodeCharacter{2014}{---} - \DeclareUnicodeCharacter{2018}{\quoteleft} - \DeclareUnicodeCharacter{2019}{\quoteright} - \DeclareUnicodeCharacter{201A}{\quotesinglbase} - \DeclareUnicodeCharacter{201C}{\quotedblleft} - \DeclareUnicodeCharacter{201D}{\quotedblright} - \DeclareUnicodeCharacter{201E}{\quotedblbase} - \DeclareUnicodeCharacter{2022}{\bullet} - \DeclareUnicodeCharacter{2026}{\dots} - \DeclareUnicodeCharacter{2039}{\guilsinglleft} - \DeclareUnicodeCharacter{203A}{\guilsinglright} - \DeclareUnicodeCharacter{20AC}{\euro} - - \DeclareUnicodeCharacter{2192}{\expansion} - \DeclareUnicodeCharacter{21D2}{\result} - - \DeclareUnicodeCharacter{2212}{\minus} - \DeclareUnicodeCharacter{2217}{\point} - \DeclareUnicodeCharacter{2261}{\equiv} -}% end of \utfeightchardefs - - -% US-ASCII character definitions. -\def\asciichardefs{% nothing need be done - \relax -} - -% Make non-ASCII characters printable again for compatibility with -% existing Texinfo documents that may use them, even without declaring a -% document encoding. -% -\setnonasciicharscatcode \other - - -\message{formatting,} - -\newdimen\defaultparindent \defaultparindent = 15pt - -\chapheadingskip = 15pt plus 4pt minus 2pt -\secheadingskip = 12pt plus 3pt minus 2pt -\subsecheadingskip = 9pt plus 2pt minus 2pt - -% Prevent underfull vbox error messages. -\vbadness = 10000 - -% Don't be so finicky about underfull hboxes, either. -\hbadness = 2000 - -% Following George Bush, get rid of widows and orphans. -\widowpenalty=10000 -\clubpenalty=10000 - -% Use TeX 3.0's \emergencystretch to help line breaking, but if we're -% using an old version of TeX, don't do anything. We want the amount of -% stretch added to depend on the line length, hence the dependence on -% \hsize. We call this whenever the paper size is set. -% -\def\setemergencystretch{% - \ifx\emergencystretch\thisisundefined - % Allow us to assign to \emergencystretch anyway. - \def\emergencystretch{\dimen0}% - \else - \emergencystretch = .15\hsize - \fi -} - -% Parameters in order: 1) textheight; 2) textwidth; -% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; -% 7) physical page height; 8) physical page width. -% -% We also call \setleading{\textleading}, so the caller should define -% \textleading. The caller should also set \parskip. -% -\def\internalpagesizes#1#2#3#4#5#6#7#8{% - \voffset = #3\relax - \topskip = #6\relax - \splittopskip = \topskip - % - \vsize = #1\relax - \advance\vsize by \topskip - \outervsize = \vsize - \advance\outervsize by 2\topandbottommargin - \pageheight = \vsize - % - \hsize = #2\relax - \outerhsize = \hsize - \advance\outerhsize by 0.5in - \pagewidth = \hsize - % - \normaloffset = #4\relax - \bindingoffset = #5\relax - % - \ifpdf - \pdfpageheight #7\relax - \pdfpagewidth #8\relax - % if we don't reset these, they will remain at "1 true in" of - % whatever layout pdftex was dumped with. - \pdfhorigin = 1 true in - \pdfvorigin = 1 true in - \fi - % - \setleading{\textleading} - % - \parindent = \defaultparindent - \setemergencystretch -} - -% @letterpaper (the default). -\def\letterpaper{{\globaldefs = 1 - \parskip = 3pt plus 2pt minus 1pt - \textleading = 13.2pt - % - % If page is nothing but text, make it come out even. - \internalpagesizes{607.2pt}{6in}% that's 46 lines - {\voffset}{.25in}% - {\bindingoffset}{36pt}% - {11in}{8.5in}% -}} - -% Use @smallbook to reset parameters for 7x9.25 trim size. -\def\smallbook{{\globaldefs = 1 - \parskip = 2pt plus 1pt - \textleading = 12pt - % - \internalpagesizes{7.5in}{5in}% - {-.2in}{0in}% - {\bindingoffset}{16pt}% - {9.25in}{7in}% - % - \lispnarrowing = 0.3in - \tolerance = 700 - \hfuzz = 1pt - \contentsrightmargin = 0pt - \defbodyindent = .5cm -}} - -% Use @smallerbook to reset parameters for 6x9 trim size. -% (Just testing, parameters still in flux.) -\def\smallerbook{{\globaldefs = 1 - \parskip = 1.5pt plus 1pt - \textleading = 12pt - % - \internalpagesizes{7.4in}{4.8in}% - {-.2in}{-.4in}% - {0pt}{14pt}% - {9in}{6in}% - % - \lispnarrowing = 0.25in - \tolerance = 700 - \hfuzz = 1pt - \contentsrightmargin = 0pt - \defbodyindent = .4cm -}} - -% Use @afourpaper to print on European A4 paper. -\def\afourpaper{{\globaldefs = 1 - \parskip = 3pt plus 2pt minus 1pt - \textleading = 13.2pt - % - % Double-side printing via postscript on Laserjet 4050 - % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. - % To change the settings for a different printer or situation, adjust - % \normaloffset until the front-side and back-side texts align. Then - % do the same for \bindingoffset. You can set these for testing in - % your texinfo source file like this: - % @tex - % \global\normaloffset = -6mm - % \global\bindingoffset = 10mm - % @end tex - \internalpagesizes{673.2pt}{160mm}% that's 51 lines - {\voffset}{\hoffset}% - {\bindingoffset}{44pt}% - {297mm}{210mm}% - % - \tolerance = 700 - \hfuzz = 1pt - \contentsrightmargin = 0pt - \defbodyindent = 5mm -}} - -% Use @afivepaper to print on European A5 paper. -% From romildo@urano.iceb.ufop.br, 2 July 2000. -% He also recommends making @example and @lisp be small. -\def\afivepaper{{\globaldefs = 1 - \parskip = 2pt plus 1pt minus 0.1pt - \textleading = 12.5pt - % - \internalpagesizes{160mm}{120mm}% - {\voffset}{\hoffset}% - {\bindingoffset}{8pt}% - {210mm}{148mm}% - % - \lispnarrowing = 0.2in - \tolerance = 800 - \hfuzz = 1.2pt - \contentsrightmargin = 0pt - \defbodyindent = 2mm - \tableindent = 12mm -}} - -% A specific text layout, 24x15cm overall, intended for A4 paper. -\def\afourlatex{{\globaldefs = 1 - \afourpaper - \internalpagesizes{237mm}{150mm}% - {\voffset}{4.6mm}% - {\bindingoffset}{7mm}% - {297mm}{210mm}% - % - % Must explicitly reset to 0 because we call \afourpaper. - \globaldefs = 0 -}} - -% Use @afourwide to print on A4 paper in landscape format. -\def\afourwide{{\globaldefs = 1 - \afourpaper - \internalpagesizes{241mm}{165mm}% - {\voffset}{-2.95mm}% - {\bindingoffset}{7mm}% - {297mm}{210mm}% - \globaldefs = 0 -}} - -% @pagesizes TEXTHEIGHT[,TEXTWIDTH] -% Perhaps we should allow setting the margins, \topskip, \parskip, -% and/or leading, also. Or perhaps we should compute them somehow. -% -\parseargdef\pagesizes{\pagesizesyyy #1,,\finish} -\def\pagesizesyyy#1,#2,#3\finish{{% - \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi - \globaldefs = 1 - % - \parskip = 3pt plus 2pt minus 1pt - \setleading{\textleading}% - % - \dimen0 = #1\relax - \advance\dimen0 by \voffset - % - \dimen2 = \hsize - \advance\dimen2 by \normaloffset - % - \internalpagesizes{#1}{\hsize}% - {\voffset}{\normaloffset}% - {\bindingoffset}{44pt}% - {\dimen0}{\dimen2}% -}} - -% Set default to letter. -% -\letterpaper - - -\message{and turning on texinfo input format.} - -% DEL is a comment character, in case @c does not suffice. -\catcode`\^^? = 14 - -% Define macros to output various characters with catcode for normal text. -\catcode`\"=\other -\catcode`\~=\other -\catcode`\^=\other -\catcode`\_=\other -\catcode`\|=\other -\catcode`\<=\other -\catcode`\>=\other -\catcode`\+=\other -\catcode`\$=\other -\def\normaldoublequote{"} -\def\normaltilde{~} -\def\normalcaret{^} -\def\normalunderscore{_} -\def\normalverticalbar{|} -\def\normalless{<} -\def\normalgreater{>} -\def\normalplus{+} -\def\normaldollar{$}%$ font-lock fix - -% This macro is used to make a character print one way in \tt -% (where it can probably be output as-is), and another way in other fonts, -% where something hairier probably needs to be done. -% -% #1 is what to print if we are indeed using \tt; #2 is what to print -% otherwise. Since all the Computer Modern typewriter fonts have zero -% interword stretch (and shrink), and it is reasonable to expect all -% typewriter fonts to have this, we can check that font parameter. -% -\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} - -% Same as above, but check for italic font. Actually this also catches -% non-italic slanted fonts since it is impossible to distinguish them from -% italic fonts. But since this is only used by $ and it uses \sl anyway -% this is not a problem. -\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} - -% Turn off all special characters except @ -% (and those which the user can use as if they were ordinary). -% Most of these we simply print from the \tt font, but for some, we can -% use math or other variants that look better in normal text. - -\catcode`\"=\active -\def\activedoublequote{{\tt\char34}} -\let"=\activedoublequote -\catcode`\~=\active -\def~{{\tt\char126}} -\chardef\hat=`\^ -\catcode`\^=\active -\def^{{\tt \hat}} - -\catcode`\_=\active -\def_{\ifusingtt\normalunderscore\_} -\let\realunder=_ -% Subroutine for the previous macro. -\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } - -\catcode`\|=\active -\def|{{\tt\char124}} -\chardef \less=`\< -\catcode`\<=\active -\def<{{\tt \less}} -\chardef \gtr=`\> -\catcode`\>=\active -\def>{{\tt \gtr}} -\catcode`\+=\active -\def+{{\tt \char 43}} -\catcode`\$=\active -\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix - -% If a .fmt file is being used, characters that might appear in a file -% name cannot be active until we have parsed the command line. -% So turn them off again, and have \everyjob (or @setfilename) turn them on. -% \otherifyactive is called near the end of this file. -\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} - -% Used sometimes to turn off (effectively) the active characters even after -% parsing them. -\def\turnoffactive{% - \normalturnoffactive - \otherbackslash -} - -\catcode`\@=0 - -% \backslashcurfont outputs one backslash character in current font, -% as in \char`\\. -\global\chardef\backslashcurfont=`\\ -\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work - -% \realbackslash is an actual character `\' with catcode other, and -% \doublebackslash is two of them (for the pdf outlines). -{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} - -% In texinfo, backslash is an active character; it prints the backslash -% in fixed width font. -\catcode`\\=\active -@def@normalbackslash{{@tt@backslashcurfont}} -% On startup, @fixbackslash assigns: -% @let \ = @normalbackslash - -% \rawbackslash defines an active \ to do \backslashcurfont. -% \otherbackslash defines an active \ to be a literal `\' character with -% catcode other. -@gdef@rawbackslash{@let\=@backslashcurfont} -@gdef@otherbackslash{@let\=@realbackslash} - -% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of -% the literal character `\'. -% -@def@normalturnoffactive{% - @let\=@normalbackslash - @let"=@normaldoublequote - @let~=@normaltilde - @let^=@normalcaret - @let_=@normalunderscore - @let|=@normalverticalbar - @let<=@normalless - @let>=@normalgreater - @let+=@normalplus - @let$=@normaldollar %$ font-lock fix - @markupsetuplqdefault - @markupsetuprqdefault - @unsepspaces -} - -% Make _ and + \other characters, temporarily. -% This is canceled by @fixbackslash. -@otherifyactive - -% If a .fmt file is being used, we don't want the `\input texinfo' to show up. -% That is what \eatinput is for; after that, the `\' should revert to printing -% a backslash. -% -@gdef@eatinput input texinfo{@fixbackslash} -@global@let\ = @eatinput - -% On the other hand, perhaps the file did not have a `\input texinfo'. Then -% the first `\' in the file would cause an error. This macro tries to fix -% that, assuming it is called before the first `\' could plausibly occur. -% Also turn back on active characters that might appear in the input -% file name, in case not using a pre-dumped format. -% -@gdef@fixbackslash{% - @ifx\@eatinput @let\ = @normalbackslash @fi - @catcode`+=@active - @catcode`@_=@active -} - -% Say @foo, not \foo, in error messages. -@escapechar = `@@ - -% These look ok in all fonts, so just make them not special. -@catcode`@& = @other -@catcode`@# = @other -@catcode`@% = @other - -@c Finally, make ` and ' active, so that txicodequoteundirected and -@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we -@c don't make ` and ' active, @code will not get them as active chars. -@c Do this last of all since we use ` in the previous @catcode assignments. -@catcode`@'=@active -@catcode`@`=@active -@markupsetuplqdefault -@markupsetuprqdefault - -@c Local variables: -@c eval: (add-hook 'write-file-hooks 'time-stamp) -@c page-delimiter: "^\\\\message" -@c time-stamp-start: "def\\\\texinfoversion{" -@c time-stamp-format: "%:y-%02m-%02d.%02H" -@c time-stamp-end: "}" -@c End: - -@c vim:sw=2: - -@ignore - arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 -@end ignore diff --git a/configure b/configure index 6501967..aa6ef33 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for mathgl 1.11.2. +# Generated by GNU Autoconf 2.67 for mathgl 2.0. # # Report bugs to . # @@ -91,7 +91,6 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -174,14 +173,6 @@ test x\$exitcode = x0 || exit 1" as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 - - test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes @@ -225,18 +216,11 @@ IFS=$as_save_IFS # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -544,8 +528,155 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + as_awk_strverscmp=' # Use only awk features that work with 7th edition Unix awk (1978). # My, what an old awk you have, Mr. Solaris! @@ -630,12 +761,12 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='mathgl' PACKAGE_TARNAME='mathgl' -PACKAGE_VERSION='1.11.2' -PACKAGE_STRING='mathgl 1.11.2' +PACKAGE_VERSION='2.0' +PACKAGE_STRING='mathgl 2.0' PACKAGE_BUGREPORT='mathgl.abalakin@gmail.com' PACKAGE_URL='' -ac_unique_file="mgl" +ac_unique_file="src" # Factoring default headers for most tests. ac_includes_default="\ #include @@ -677,10 +808,6 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS AM_CXXFLAGS -USE_DOCS_FALSE -USE_DOCS_TRUE -USE_TESTIO_FALSE -USE_TESTIO_TRUE USE_OCTAVE_FALSE USE_OCTAVE_TRUE OCTAVE_INCFLAGS @@ -717,10 +844,6 @@ RCC UIC MOC QMAKE -USE_WX_FALSE -USE_WX_TRUE -WX_LIBS -WX_FLAGS USE_FLTK_FALSE USE_FLTK_TRUE FLTK_LIBS @@ -735,10 +858,6 @@ USE_JPEG_TRUE JPEG_LIBS JPEG_FLAGS PNG_LIBS -USE_GIF_FALSE -USE_GIF_TRUE -GIF_LIBS -GIF_FLAGS USE_HDF4_FALSE USE_HDF4_TRUE HDF4_LIBS @@ -749,8 +868,6 @@ HDF5_LIBS HDF5_FLAGS USE_GLUT_FALSE USE_GLUT_TRUE -GLUT_FLAGS -GLUT_LIBS GL_LIBS USE_GSL_FALSE USE_GSL_TRUE @@ -767,9 +884,8 @@ OTOOL LIPO NMEDIT DSYMUTIL -MANIFEST_TOOL +lt_ECHO RANLIB -ac_ct_AR AR LN_S NM @@ -888,29 +1004,23 @@ enable_static with_pic enable_fast_install with_gnu_ld -with_sysroot enable_libtool_lock enable_double enable_all enable_langall enable_pthread enable_gsl -enable_glut enable_hdf5 enable_hdf5_18 enable_hdf4 -enable_gif enable_jpeg enable_u3d enable_pdf enable_fltk -enable_wx enable_qt with_qt enable_python enable_octave -enable_testio -enable_docs ' ac_precious_vars='build_alias host_alias @@ -1330,7 +1440,7 @@ Try \`$0 --help' for more information" $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac @@ -1468,7 +1578,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures mathgl 1.11.2 to adapt to many kinds of systems. +\`configure' configures mathgl 2.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1538,7 +1648,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of mathgl 1.11.2:";; + short | recursive ) echo "Configuration of mathgl 2.0:";; esac cat <<\_ACEOF @@ -1558,21 +1668,16 @@ Optional Features: --enable-langall Turn on all language interfaces --enable-pthread Turn on pthread support in MathGL library --enable-gsl Turn on gsl functions - --enable-glut Turn on glut --enable-hdf5 Turn on hdf5 --enable-hdf5_18 Turn on hdf5 version 1.8 --enable-hdf4 Turn on hdf4 - --enable-gif Turn on gif --enable-jpeg Turn on jpeg --enable-u3d Turn on u3d functions --enable-pdf Turn on u3d and pdf functions --enable-fltk Turn on fltk - --enable-wx Turn on wxWidget --enable-qt Turn on Qt --enable-python Turn on interface to python --enable-octave Turn on interface to octave - --enable-testio Turn on testio - --enable-docs Turn on documentation building Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1580,8 +1685,6 @@ Optional Packages: --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). --with-qt Path to Qt [Look in PATH and /usr/local/Trolltech] Some influential environment variables: @@ -1664,8 +1767,8 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -mathgl configure 1.11.2 -generated by GNU Autoconf 2.68 +mathgl configure 2.0 +generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1711,7 +1814,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1749,7 +1852,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile @@ -1795,7 +1898,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -1809,7 +1912,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1827,7 +1930,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_compile @@ -1863,7 +1966,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1905,7 +2008,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1918,7 +2021,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1973,7 +2076,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_func @@ -2009,7 +2112,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp @@ -2055,7 +2158,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_link @@ -2068,10 +2171,10 @@ fi ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : + if eval "test \"\${$3+set}\"" = set; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -2138,7 +2241,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -2147,15 +2250,15 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_cxx_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by mathgl $as_me 1.11.2, which was -generated by GNU Autoconf 2.68. Invocation command line was +It was created by mathgl $as_me 2.0, which was +generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2413,7 +2516,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;} || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi done @@ -2503,7 +2606,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -MGL_RELEASE=1.11.2 +MGL_RELEASE=2.0 @@ -2553,7 +2656,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # (Interfaces removed: CURRENT++, AGE=0, REVISION=0) # (Interfaces added: CURRENT++, AGE++, REVISION=0) # (No interfaces changed: REVISION++) -MGL_CURRENT=5 +MGL_CURRENT=6 MGL_REVISION=0 MGL_AGE=0 @@ -2579,7 +2682,7 @@ am__api_version='1.11' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : +if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2666,11 +2769,11 @@ am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; esac # Do `set' in a subshell so we don't clobber the current shell's @@ -2756,7 +2859,7 @@ if test "$cross_compiling" != no; then set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : +if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then @@ -2796,7 +2899,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -2849,7 +2952,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : + if test "${ac_cv_path_mkdir+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2900,7 +3003,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : +if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -2940,7 +3043,7 @@ done $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -2998,7 +3101,7 @@ fi # Define the identity of the package. PACKAGE='mathgl' - VERSION='1.11.2' + VERSION='2.0' cat >>confdefs.h <<_ACEOF @@ -3049,7 +3152,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3089,7 +3192,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3142,7 +3245,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3182,7 +3285,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3241,7 +3344,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3285,7 +3388,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3340,7 +3443,7 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3455,7 +3558,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3498,7 +3601,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3557,7 +3660,7 @@ $as_echo "$ac_try_echo"; } >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi @@ -3568,7 +3671,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : +if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3609,7 +3712,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -3619,7 +3722,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : +if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3656,7 +3759,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : +if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -3734,7 +3837,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : +if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -3895,7 +3998,7 @@ depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -4034,7 +4137,7 @@ if test -z "$CXX"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : +if test "${ac_cv_prog_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -4078,7 +4181,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -4156,7 +4259,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4193,7 +4296,7 @@ ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : +if test "${ac_cv_prog_cxx_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag @@ -4279,7 +4382,7 @@ depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CXX_dependencies_compiler_type+:} false; then : +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then @@ -4410,7 +4513,7 @@ $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : +if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias @@ -4426,7 +4529,7 @@ fi $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -4444,7 +4547,7 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : +if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then @@ -4459,7 +4562,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -4478,13 +4581,13 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AS+:} false; then : +if test "${ac_cv_prog_AS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then @@ -4524,7 +4627,7 @@ if test -z "$ac_cv_prog_AS"; then set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AS+:} false; then : +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then @@ -4576,7 +4679,7 @@ fi set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : +if test "${ac_cv_prog_DLLTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then @@ -4616,7 +4719,7 @@ if test -z "$ac_cv_prog_DLLTOOL"; then set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then @@ -4668,7 +4771,7 @@ fi set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -4708,7 +4811,7 @@ if test -z "$ac_cv_prog_OBJDUMP"; then set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -4790,8 +4893,8 @@ esac -macro_version='2.4' -macro_revision='1.3293' +macro_version='2.2.6b' +macro_revision='1.3017' @@ -4807,78 +4910,9 @@ macro_revision='1.3293' ltmain="$ac_aux_dir/ltmain.sh" -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : +if test "${ac_cv_path_SED+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ @@ -4960,7 +4994,7 @@ Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : +if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -5023,7 +5057,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : +if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -5090,7 +5124,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : +if test "${ac_cv_path_FGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 @@ -5221,7 +5255,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : +if test "${lt_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -5261,7 +5295,7 @@ fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : +if test "${lt_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -5288,7 +5322,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : +if test "${lt_cv_path_NM+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then @@ -5341,17 +5375,14 @@ if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" + if test -n "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : +if test "${ac_cv_prog_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then @@ -5389,13 +5420,13 @@ fi fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" + for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then @@ -5444,15 +5475,6 @@ esac fi fi - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -5467,18 +5489,18 @@ test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : +if test "${lt_cv_nm_interface+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval echo "\"\$as_me:5497: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:5500: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) + (eval echo "\"\$as_me:5503: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5502,7 +5524,7 @@ fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : +if test "${lt_cv_sys_max_cmd_len+set}" = set; then : $as_echo_n "(cached) " >&6 else i=0 @@ -5535,11 +5557,6 @@ else lt_cv_sys_max_cmd_len=8192; ;; - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. @@ -5604,8 +5621,8 @@ else # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. - while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && + while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` @@ -5647,8 +5664,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes @@ -5697,83 +5714,9 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac - -fi - -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac - -fi - -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : +if test "${lt_cv_ld_reload_flag+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' @@ -5787,11 +5730,6 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' @@ -5814,7 +5752,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : +if test "${ac_cv_prog_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then @@ -5854,7 +5792,7 @@ if test -z "$ac_cv_prog_OBJDUMP"; then set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then @@ -5910,7 +5848,7 @@ test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : +if test "${lt_cv_deplibs_check_method+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' @@ -5952,18 +5890,16 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc*) +cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' @@ -5993,10 +5929,6 @@ gnu*) lt_cv_deplibs_check_method=pass_all ;; -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in @@ -6005,11 +5937,11 @@ hpux10.20* | hpux11*) lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac @@ -6035,7 +5967,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd*) +netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else @@ -6112,21 +6044,6 @@ esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac -fi - file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -6140,28 +6057,18 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - - - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : +if test "${ac_cv_prog_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6170,7 +6077,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6180,10 +6087,10 @@ IFS=$as_save_IFS fi fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6191,17 +6098,17 @@ fi fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6210,7 +6117,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" + ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6220,17 +6127,17 @@ IFS=$as_save_IFS fi fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" + if test "x$ac_ct_AR" = x; then + AR="false" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6238,51 +6145,17 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - DLLTOOL=$ac_ct_DLLTOOL + AR=$ac_ct_AR fi else - DLLTOOL="$ac_cv_prog_DLLTOOL" + AR="$ac_cv_prog_AR" fi -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -6292,17 +6165,15 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : +if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -6311,7 +6182,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6321,179 +6192,10 @@ IFS=$as_save_IFS fi fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -: ${AR=ar} -: ${AR_FLAGS=cru} - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -6507,7 +6209,7 @@ if test -z "$ac_cv_prog_STRIP"; then set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then @@ -6566,7 +6268,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : +if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -6606,7 +6308,7 @@ if test -z "$ac_cv_prog_RANLIB"; then set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -6677,18 +6379,6 @@ if test -n "$RANLIB"; then old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - @@ -6735,7 +6425,7 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -6796,8 +6486,8 @@ esac lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= @@ -6833,7 +6523,6 @@ for ac_symprfx in "" "_"; do else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -6859,8 +6548,8 @@ _LT_EOF test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then @@ -6875,18 +6564,6 @@ _LT_EOF if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - #ifdef __cplusplus extern "C" { #endif @@ -6898,7 +6575,7 @@ _LT_EOF cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { +const struct { const char *name; void *address; } @@ -6924,8 +6601,8 @@ static const void *lt_preloaded_setup() { _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 @@ -6935,8 +6612,8 @@ _LT_EOF test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi @@ -6973,27 +6650,6 @@ else $as_echo "ok" >&6; } fi -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - - - - - - - - - - - - - - - @@ -7006,38 +6662,10 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; -else - with_sysroot=no -fi -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } @@ -7075,7 +6703,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext + echo '#line 6706 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7169,7 +6797,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : +if test "${lt_cv_cc_needs_belf+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_ext=c @@ -7237,123 +6865,6 @@ esac need_locks="$enable_libtool_lock" -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi - -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi - - - - - case $host_os in rhapsody* | darwin*) @@ -7362,7 +6873,7 @@ fi set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then @@ -7402,7 +6913,7 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then @@ -7454,7 +6965,7 @@ fi set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : +if test "${ac_cv_prog_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then @@ -7494,7 +7005,7 @@ if test -z "$ac_cv_prog_NMEDIT"; then set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then @@ -7546,7 +7057,7 @@ fi set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : +if test "${ac_cv_prog_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then @@ -7586,7 +7097,7 @@ if test -z "$ac_cv_prog_LIPO"; then set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : +if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then @@ -7638,7 +7149,7 @@ fi set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : +if test "${ac_cv_prog_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then @@ -7678,7 +7189,7 @@ if test -z "$ac_cv_prog_OTOOL"; then set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : +if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then @@ -7730,7 +7241,7 @@ fi set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : +if test "${ac_cv_prog_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then @@ -7770,7 +7281,7 @@ if test -z "$ac_cv_prog_OTOOL64"; then set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : +if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then @@ -7845,7 +7356,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : +if test "${lt_cv_apple_cc_single_mod+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no @@ -7874,7 +7385,7 @@ fi $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no @@ -7904,38 +7415,6 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; @@ -7963,7 +7442,7 @@ $as_echo "$lt_cv_ld_force_load" >&6; } else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= @@ -7983,7 +7462,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : + if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -8099,7 +7578,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c @@ -8111,7 +7590,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : +if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8212,54 +7691,569 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi -$as_echo "#define STDC_HEADERS 1" >>confdefs.h + done + ac_cv_prog_CXXCPP=$CXXCPP fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error _ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : +else + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.i conftest.$ac_ext -done - - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include _ACEOF - +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.i conftest.$ac_ext done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +_lt_caught_CXX_error=yes; } +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -func_stripname_cnf () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname_cnf +else + _lt_caught_CXX_error=yes +fi @@ -8411,7 +8405,6 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' - test -z "$LN_S" && LN_S="ln -s" @@ -8435,7 +8428,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : +if test "${lt_cv_objdir+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null @@ -8463,6 +8456,19 @@ _ACEOF + + + + + + + + + + + + + case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some @@ -8475,6 +8481,23 @@ aix3*) ;; esac +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + # Global variables: ofile=libtool can_build_shared=yes @@ -8503,7 +8526,7 @@ for cc_temp in $compiler""; do *) break;; esac done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it @@ -8513,7 +8536,7 @@ file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -8579,7 +8602,7 @@ if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in @@ -8708,16 +8731,11 @@ if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac + lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no @@ -8733,15 +8751,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8754: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:8758: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes @@ -8770,6 +8788,8 @@ fi lt_prog_compiler_pic= lt_prog_compiler_static= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' @@ -8817,12 +8837,6 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-fno-common' ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag @@ -8865,13 +8879,6 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-fPIC' ;; esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - lt_prog_compiler_pic='-Xcompiler -fPIC' - ;; - esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in @@ -8934,13 +8941,7 @@ lt_prog_compiler_static= lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' @@ -8952,26 +8953,26 @@ lt_prog_compiler_static= # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; esac ;; esac @@ -9002,7 +9003,7 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; @@ -9059,17 +9060,13 @@ case $host_os in lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 +$as_echo "$lt_prog_compiler_pic" >&6; } + + + + -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. @@ -9077,7 +9074,7 @@ lt_prog_compiler_pic=$lt_cv_prog_compiler_pic if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no @@ -9093,15 +9090,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9093: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:9097: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes @@ -9130,18 +9127,13 @@ fi - - - - - # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : +if test "${lt_cv_prog_compiler_static_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no @@ -9154,7 +9146,7 @@ else if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes @@ -9184,7 +9176,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -9203,16 +9195,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9198: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:9202: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -9239,7 +9231,7 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : +if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no @@ -9258,16 +9250,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9253: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:9257: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes @@ -9377,36 +9369,13 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie openbsd*) with_gnu_ld=no ;; + linux* | k*bsd*-gnu) + link_all_deplibs=no + ;; esac ld_shlibs=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' @@ -9440,12 +9409,11 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie ld_shlibs=no cat <<_LT_EOF 1>&2 -*** Warning: the GNU linker, at least up to release 2.19, is reported +*** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. _LT_EOF fi @@ -9481,12 +9449,10 @@ _LT_EOF # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -9504,11 +9470,6 @@ _LT_EOF fi ;; - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no @@ -9534,16 +9495,15 @@ _LT_EOF if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then - tmp_addflag=' $pic_flag' + tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; @@ -9554,17 +9514,13 @@ _LT_EOF lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 @@ -9580,17 +9536,17 @@ _LT_EOF fi case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) + xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac @@ -9599,13 +9555,13 @@ _LT_EOF fi ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; @@ -9623,8 +9579,8 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9670,8 +9626,8 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi @@ -9711,10 +9667,8 @@ _LT_EOF else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi @@ -9776,6 +9730,7 @@ _LT_EOF if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi + link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then @@ -9801,13 +9756,7 @@ _LT_EOF allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9820,32 +9769,25 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' @@ -9854,13 +9796,7 @@ fi else # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9873,42 +9809,30 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' @@ -9940,63 +9864,20 @@ fi # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) @@ -10006,11 +9887,7 @@ fi hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - whole_archive_flag_spec='' - fi + whole_archive_flag_spec='' link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in @@ -10018,7 +9895,7 @@ fi *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -10061,7 +9938,7 @@ fi # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no @@ -10069,7 +9946,7 @@ fi hpux9*) if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi @@ -10084,8 +9961,8 @@ fi ;; hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi @@ -10103,16 +9980,16 @@ fi ;; hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then + if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else @@ -10124,46 +10001,7 @@ fi archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } - -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi @@ -10191,39 +10029,26 @@ fi irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int foo (void) { return 0; } +int foo(void) {} _ACEOF if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi + LDFLAGS="$save_LDFLAGS" else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -10232,7 +10057,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } link_all_deplibs=yes ;; - netbsd*) + netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -10285,17 +10110,17 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' @@ -10305,13 +10130,13 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' @@ -10324,9 +10149,9 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) @@ -10514,50 +10339,44 @@ x|xyes) # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 +$as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi @@ -10728,23 +10547,16 @@ if test "$GCC" = yes; then darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= @@ -10757,7 +10569,7 @@ if test "$GCC" = yes; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' + lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; @@ -10777,13 +10589,7 @@ BEGIN {RS=" "; FS="/|\n";} { if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi @@ -10871,7 +10677,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -10902,9 +10708,8 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$cc_basename in - yes,*) - # gcc + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -10925,83 +10730,36 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' ;; *) - # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' ;; esac + dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -11088,19 +10846,6 @@ gnu*) hardcode_into_libs=yes ;; -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -11143,10 +10888,8 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 ;; interix[3-9]*) @@ -11213,17 +10956,12 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -11236,31 +10974,23 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -11272,6 +11002,18 @@ fi dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -11556,11 +11298,6 @@ fi - - - - - @@ -11639,7 +11376,7 @@ else # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11673,7 +11410,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else @@ -11687,12 +11424,12 @@ fi *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : +if test "x$ac_cv_func_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : +if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11726,16 +11463,16 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : +if test "x$ac_cv_func_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : +if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11769,12 +11506,12 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : +if test "${ac_cv_lib_svld_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11808,12 +11545,12 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : +if test "${ac_cv_lib_dld_dld_link+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -11847,7 +11584,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : +if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi @@ -11888,7 +11625,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : +if test "${lt_cv_dlopen_self+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -11897,7 +11634,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" +#line 11637 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11938,13 +11675,7 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } +void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -11953,11 +11684,7 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else @@ -11994,7 +11721,7 @@ $as_echo "$lt_cv_dlopen_self" >&6; } wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : +if test "${lt_cv_dlopen_self_static+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -12003,7 +11730,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" +#line 11733 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12044,13 +11771,7 @@ else # endif #endif -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } +void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -12059,11 +11780,7 @@ int main () if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else @@ -12220,145 +11937,6 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC="$lt_save_CC" - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CXXCPP=$CXXCPP - -fi - CXXCPP=$ac_cv_prog_CXXCPP -else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -else - _lt_caught_CXX_error=yes -fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -12385,8 +11963,6 @@ module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds -reload_flag_CXX=$reload_flag -reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no @@ -12442,7 +12018,6 @@ $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX @@ -12460,7 +12035,6 @@ $RM -r conftest* fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do @@ -12471,7 +12045,7 @@ $RM -r conftest* *) break;; esac done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` if test -n "$compiler"; then @@ -12534,7 +12108,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : +if test "${lt_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then @@ -12574,7 +12148,7 @@ fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : +if test "${lt_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. @@ -12600,8 +12174,8 @@ with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -12633,7 +12207,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no @@ -12743,13 +12317,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12762,33 +12330,26 @@ main () _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath__CXX -fi +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' @@ -12797,13 +12358,7 @@ fi else # Determine the default libpath from the value encoded in an # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12816,42 +12371,30 @@ main () _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath__CXX"; then - lt_cv_aix_libpath__CXX="/usr/lib:/lib" - fi - +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi - - aix_libpath=$lt_cv_aix_libpath__CXX fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - fi + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. @@ -12881,75 +12424,28 @@ fi ;; cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_CXX=' ' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=yes - file_list_spec_CXX='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' - enable_shared_with_static_runtimes_CXX=yes - # Don't use ranlib - old_postinstall_cmds_CXX='chmod 644 $oldlib' - postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; - esac - ;; + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; darwin* | rhapsody*) @@ -12957,11 +12453,7 @@ fi hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - whole_archive_flag_spec_CXX='' - fi + whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in @@ -12969,7 +12461,7 @@ fi *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" @@ -13022,11 +12514,6 @@ fi gnu*) ;; - haiku*) - archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs_CXX=yes - ;; - hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: @@ -13051,11 +12538,11 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then - archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no @@ -13116,7 +12603,7 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then @@ -13126,10 +12613,10 @@ fi archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) - archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi @@ -13159,7 +12646,7 @@ fi case $cc_basename in CC*) # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is @@ -13170,9 +12657,9 @@ fi *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi link_all_deplibs_CXX=yes @@ -13201,7 +12688,7 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -13238,26 +12725,26 @@ fi pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in - *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + *pgCC\ [1-5]* | *pgcpp\ [1-5]*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; - *) # Version 6 and above use weak symbols + *) # Version 6 will use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; @@ -13265,7 +12752,7 @@ fi hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ @@ -13284,9 +12771,9 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; - xl* | mpixl* | bgxl*) + xl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' @@ -13306,13 +12793,13 @@ fi archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' - whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. - output_verbose_link_cmd='func_echo_all' + output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -13381,7 +12868,7 @@ fi export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi - output_verbose_link_cmd=func_echo_all + output_verbose_link_cmd=echo else ld_shlibs_CXX=no fi @@ -13416,15 +12903,15 @@ fi case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; @@ -13440,17 +12927,17 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac @@ -13460,7 +12947,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support @@ -13496,7 +12983,7 @@ fi solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' @@ -13517,7 +13004,7 @@ fi esac link_all_deplibs_CXX=yes - output_verbose_link_cmd='func_echo_all' + output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is @@ -13537,14 +13024,14 @@ fi if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. @@ -13555,7 +13042,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' @@ -13609,10 +13096,6 @@ fi CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ - '"$old_archive_cmds_CXX" - reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ - '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' @@ -13674,13 +13157,6 @@ private: }; _LT_EOF - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -esac - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -13694,7 +13170,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do - case ${prev}${p} in + case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. @@ -13703,22 +13179,13 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 test $p = "-R"; then prev=$p continue + else + prev= fi - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac if test "$pre_test_object_deps_done" = no; then - case ${prev} in - -L | -R) + case $p in + -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. @@ -13738,10 +13205,8 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi - prev= ;; - *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. @@ -13777,7 +13242,6 @@ else fi $RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in @@ -13813,7 +13277,7 @@ linux*) solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as @@ -13878,6 +13342,8 @@ fi lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then @@ -13927,11 +13393,6 @@ lt_prog_compiler_static_CXX= # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static_CXX= - ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. @@ -13981,11 +13442,6 @@ lt_prog_compiler_static_CXX= ;; esac ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; dgux*) case $cc_basename in ec++*) @@ -14075,8 +13531,8 @@ lt_prog_compiler_static_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; - xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene + xlc* | xlC*) + # IBM XL 8.0 on PPC lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' @@ -14106,7 +13562,7 @@ lt_prog_compiler_static_CXX= ;; esac ;; - netbsd*) + netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -14138,7 +13594,7 @@ lt_prog_compiler_static_CXX= ;; solaris*) case $cc_basename in - CC* | sunCC*) + CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' @@ -14203,17 +13659,10 @@ case $host_os in lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_prog_compiler_pic_CXX" >&6; } + -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } -lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. @@ -14221,7 +13670,7 @@ lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } -if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : +if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no @@ -14237,15 +13686,15 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13689: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:13693: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes @@ -14271,15 +13720,13 @@ fi - - # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : +if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no @@ -14292,7 +13739,7 @@ else if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes @@ -14319,7 +13766,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no @@ -14338,16 +13785,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13788: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:13792: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes @@ -14371,7 +13818,7 @@ $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no @@ -14390,16 +13837,16 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13840: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:13844: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes @@ -14450,35 +13897,30 @@ fi $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" - ;; + ;; cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - ;; - esac - ;; + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + linux* | k*bsd*-gnu) + link_all_deplibs_CXX=no + ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; + ;; esac + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } @@ -14510,50 +13952,44 @@ x|xyes) # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc_CXX=no - else - lt_cv_archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } - archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_CXX" >&5 +$as_echo "$archive_cmds_need_lc_CXX" >&6; } ;; esac fi @@ -14710,7 +14146,7 @@ amigaos*) m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; @@ -14741,9 +14177,8 @@ cygwin* | mingw* | pw32* | cegcc*) need_version=no need_lib_prefix=no - case $GCC,$cc_basename in - yes,*) - # gcc + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ @@ -14764,82 +14199,36 @@ cygwin* | mingw* | pw32* | cegcc*) cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' ;; *) - # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' ;; esac + dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; @@ -14925,19 +14314,6 @@ gnu*) hardcode_into_libs=yes ;; -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. @@ -14980,10 +14356,8 @@ hpux9* | hpux10* | hpux11*) soname_spec='${libname}${release}${shared_ext}$major' ;; esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 ;; interix[3-9]*) @@ -15050,17 +14424,12 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu) finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -15073,31 +14442,23 @@ main () _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes + shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -15109,6 +14470,18 @@ fi dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no @@ -15345,8 +14718,6 @@ fi - - @@ -15397,7 +14768,6 @@ fi fi # test -n "$compiler" CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC @@ -15440,7 +14810,7 @@ if test "${enable_double+set}" = set; then : enableval=$enable_double; case "${enableval}" in yes) double=true ;; no) double=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-double" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-double" "$LINENO" 5 ;; esac else double=false @@ -15462,7 +14832,7 @@ if test "${enable_all+set}" = set; then : enableval=$enable_all; case "${enableval}" in yes) all=true ;; no) all=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-all" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-all" "$LINENO" 5 ;; esac else all=false @@ -15474,7 +14844,7 @@ if test "${enable_langall+set}" = set; then : enableval=$enable_langall; case "${enableval}" in yes) langall=true ;; no) langall=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-langall" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-langall" "$LINENO" 5 ;; esac else langall=false @@ -15486,7 +14856,7 @@ if test "${enable_pthread+set}" = set; then : enableval=$enable_pthread; case "${enableval}" in yes) pthread=true ;; no) pthread=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-pthread" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-pthread" "$LINENO" 5 ;; esac else pthread=true @@ -15494,7 +14864,7 @@ fi ac_fn_cxx_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : +if test "x$ac_cv_header_pthread_h" = x""yes; then : (test x$all = xtrue || test x$pthread = xtrue) && PTHREAD_FLAGS=-DHAVE_PTHREAD else (test x$all = xtrue || test x$pthread = xtrue) && echo "Please install posix threads headers" && exit @@ -15504,7 +14874,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5 $as_echo_n "checking for main in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_main+:} false; then : +if test "${ac_cv_lib_pthread_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15532,7 +14902,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_main" >&5 $as_echo "$ac_cv_lib_pthread_main" >&6; } -if test "x$ac_cv_lib_pthread_main" = xyes; then : +if test "x$ac_cv_lib_pthread_main" = x""yes; then : (test x$all = xtrue || test x$pthread = xtrue) && PTHREAD_LIBS=-lpthread else (test x$all = xtrue || test x$pthread = xtrue) && echo "Please install posix threads library" && exit @@ -15552,7 +14922,7 @@ if test "${enable_gsl+set}" = set; then : enableval=$enable_gsl; case "${enableval}" in yes) gsl=true ;; no) gsl=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-gsl" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-gsl" "$LINENO" 5 ;; esac else gsl=true @@ -15565,7 +14935,7 @@ if (test x$all = xtrue || test x$gsl = xtrue) ;then set dummy $GSL_PROG; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GSL_FLAGS+:} false; then : +if test "${ac_cv_prog_GSL_FLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$GSL_FLAGS"; then @@ -15602,7 +14972,7 @@ fi set dummy $GSL_PROG; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_GSL_LIBS+:} false; then : +if test "${ac_cv_prog_GSL_LIBS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$GSL_LIBS"; then @@ -15655,32 +15025,16 @@ else fi -# Check whether --enable-glut was given. -if test "${enable_glut+set}" = set; then : - enableval=$enable_glut; case "${enableval}" in - yes) glut=true ;; - no) glut=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-glut" "$LINENO" 5 ;; -esac -else - glut=false -fi - - case "${host}" in *darwin*) GL_LIBS="-framework OpenGL" - if (test x$all = xtrue || test x$glut = xtrue) ;then - GLUT_LIBS="-framework GLUT -framework OpenGL" - - fi ;; *w32*) GL_LIBS=opengl32 ac_fn_cxx_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_gl_h" = xyes; then : +if test "x$ac_cv_header_GL_gl_h" = x""yes; then : else echo "Please install OpenGL headers (GL/gl.h)"; exit @@ -15690,7 +15044,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_${GL_LIBS}''_main" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${GL_LIBS}" >&5 $as_echo_n "checking for main in -l${GL_LIBS}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : +if eval "test \"\${$as_ac_Lib+set}\"" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15725,59 +15079,12 @@ else echo "Please install OpenGL library (lib${GL_LIBS}.a)"; exit fi - GLUT_LIBS=glut32 - ac_fn_cxx_check_header_mongrel "$LINENO" "GL/glut.h" "ac_cv_header_GL_glut_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_glut_h" = xyes; then : - (test x$all = xtrue || test x$glut = xtrue) && GLUT_FLAGS=-DHAVE_GLUT -else - (test x$all = xtrue || test x$glut = xtrue) && (echo "Please install FreeGLUT headers (GL/glut.h)" && exit) -fi - - - as_ac_Lib=`$as_echo "ac_cv_lib_${GLUT_LIBS}''_main" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${GLUT_LIBS}" >&5 -$as_echo_n "checking for main in -l${GLUT_LIBS}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l${GLUT_LIBS} $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - (test x$all = xtrue || test x$glut = xtrue) && GLUT_LIBS=-l${GLUT_LIBS} -else - (test x$all = xtrue || test x$glut = xtrue) && echo "Please install FreeGLUT library (lib${GLUT_LIBS}.a)" && exit -fi - ;; *) GL_LIBS=GL ac_fn_cxx_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_gl_h" = xyes; then : +if test "x$ac_cv_header_GL_gl_h" = x""yes; then : else echo "Please install OpenGL headers (GL/gl.h)"; exit @@ -15787,7 +15094,7 @@ fi as_ac_Lib=`$as_echo "ac_cv_lib_${GL_LIBS}''_main" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${GL_LIBS}" >&5 $as_echo_n "checking for main in -l${GL_LIBS}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : +if eval "test \"\${$as_ac_Lib+set}\"" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15822,53 +15129,6 @@ else echo "Please install OpenGL library (lib${GL_LIBS}.a)"; exit fi - GLUT_LIBS=glut - ac_fn_cxx_check_header_mongrel "$LINENO" "GL/glut.h" "ac_cv_header_GL_glut_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_glut_h" = xyes; then : - (test x$all = xtrue || test x$glut = xtrue) && GLUT_FLAGS=-DHAVE_GLUT -else - (test x$all = xtrue || test x$glut = xtrue) && (echo "Please install FreeGLUT headers (GL/glut.h)" && exit) -fi - - - as_ac_Lib=`$as_echo "ac_cv_lib_${GLUT_LIBS}''_main" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l${GLUT_LIBS}" >&5 -$as_echo_n "checking for main in -l${GLUT_LIBS}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l${GLUT_LIBS} $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - (test x$all = xtrue || test x$glut = xtrue) && GLUT_LIBS=-l${GLUT_LIBS} -else - (test x$all = xtrue || test x$glut = xtrue) && echo "Please install FreeGLUT library (lib${GLUT_LIBS}.a)" && exit -fi - ;; esac @@ -15895,7 +15155,7 @@ if test "${enable_hdf5+set}" = set; then : enableval=$enable_hdf5; case "${enableval}" in yes) hdf5=true ;; no) hdf5=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-hdf5" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-hdf5" "$LINENO" 5 ;; esac else hdf5=false @@ -15906,7 +15166,7 @@ if test "${enable_hdf5_18+set}" = set; then : enableval=$enable_hdf5_18; case "${enableval}" in yes) hdf5_18=true ;; no) hdf5_18=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-hdf5_18" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-hdf5_18" "$LINENO" 5 ;; esac else hdf5_18=false @@ -15914,7 +15174,7 @@ fi #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_fn_cxx_check_header_mongrel "$LINENO" "hdf5.h" "ac_cv_header_hdf5_h" "$ac_includes_default" -if test "x$ac_cv_header_hdf5_h" = xyes; then : +if test "x$ac_cv_header_hdf5_h" = x""yes; then : (test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && HDF5_FLAGS=-DHAVE_HDF5 else (test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && echo "Please install hdf5 headers" && exit @@ -15927,7 +15187,7 @@ if ((test x$all = xtrue || test x$hdf5 = xtrue) && test x$hdf5_18 = xfalse) ;the fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lhdf5" >&5 $as_echo_n "checking for main in -lhdf5... " >&6; } -if ${ac_cv_lib_hdf5_main+:} false; then : +if test "${ac_cv_lib_hdf5_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -15955,7 +15215,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdf5_main" >&5 $as_echo "$ac_cv_lib_hdf5_main" >&6; } -if test "x$ac_cv_lib_hdf5_main" = xyes; then : +if test "x$ac_cv_lib_hdf5_main" = x""yes; then : (test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && HDF5_LIBS=-lhdf5 else (test x$all = xtrue || test x$hdf5 = xtrue || test x$hdf5_18 = xtrue) && echo "Please install hdf5 library" && exit @@ -15976,14 +15236,14 @@ if test "${enable_hdf4+set}" = set; then : enableval=$enable_hdf4; case "${enableval}" in yes) hdf4=true ;; no) hdf4=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-hdf4" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-hdf4" "$LINENO" 5 ;; esac else hdf4=false fi ac_fn_cxx_check_header_mongrel "$LINENO" "hdf/mfhdf.h" "ac_cv_header_hdf_mfhdf_h" "$ac_includes_default" -if test "x$ac_cv_header_hdf_mfhdf_h" = xyes; then : +if test "x$ac_cv_header_hdf_mfhdf_h" = x""yes; then : (test x$all = xtrue || test x$hdf4 = xtrue) && HDF4_FLAGS=-DHAVE_HDF4 else (test x$all = xtrue || test x$hdf4 = xtrue) && echo "Please install hdf4 headers" && exit @@ -15993,7 +15253,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldf" >&5 $as_echo_n "checking for main in -ldf... " >&6; } -if ${ac_cv_lib_df_main+:} false; then : +if test "${ac_cv_lib_df_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16021,88 +15281,23 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_df_main" >&5 $as_echo "$ac_cv_lib_df_main" >&6; } -if test "x$ac_cv_lib_df_main" = xyes; then : +if test "x$ac_cv_lib_df_main" = x""yes; then : (test x$all = xtrue || test x$hdf4 = xtrue) && HDF4_LIBS="-lmfhdf -ldf" else - (test x$all = xtrue || test x$hdf4 = xtrue) && echo "Please install hdf4 library" && exit -fi - - if (test x$all = xtrue || test x$hdf4 = xtrue); then - USE_HDF4_TRUE= - USE_HDF4_FALSE='#' -else - USE_HDF4_TRUE='#' - USE_HDF4_FALSE= -fi - - -# Check whether --enable-gif was given. -if test "${enable_gif+set}" = set; then : - enableval=$enable_gif; case "${enableval}" in - yes) gif=true ;; - no) gif=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-gif" "$LINENO" 5 ;; -esac -else - gif=false -fi - -ac_fn_cxx_check_header_mongrel "$LINENO" "gif_lib.h" "ac_cv_header_gif_lib_h" "$ac_includes_default" -if test "x$ac_cv_header_gif_lib_h" = xyes; then : - (test x$all = xtrue || test x$gif = xtrue) && GIF_FLAGS=-DHAVE_GIF -else - (test x$all = xtrue || test x$gif = xtrue) && echo "Please install gif headers" && exit -fi - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgif" >&5 -$as_echo_n "checking for main in -lgif... " >&6; } -if ${ac_cv_lib_gif_main+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgif $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_gif_main=yes -else - ac_cv_lib_gif_main=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_main" >&5 -$as_echo "$ac_cv_lib_gif_main" >&6; } -if test "x$ac_cv_lib_gif_main" = xyes; then : - (test x$all = xtrue || test x$gif = xtrue) && GIF_LIBS=-lgif -else - (test x$all = xtrue || test x$gif = xtrue) && echo "Please install gif library" && exit + (test x$all = xtrue || test x$hdf4 = xtrue) && echo "Please install hdf4 library" && exit fi - if (test x$all = xtrue || test x$gif = xtrue); then - USE_GIF_TRUE= - USE_GIF_FALSE='#' + if (test x$all = xtrue || test x$hdf4 = xtrue); then + USE_HDF4_TRUE= + USE_HDF4_FALSE='#' else - USE_GIF_TRUE='#' - USE_GIF_FALSE= + USE_HDF4_TRUE='#' + USE_HDF4_FALSE= fi ac_fn_cxx_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" -if test "x$ac_cv_header_png_h" = xyes; then : +if test "x$ac_cv_header_png_h" = x""yes; then : else echo "Please install png headers" && exit @@ -16112,7 +15307,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpng" >&5 $as_echo_n "checking for main in -lpng... " >&6; } -if ${ac_cv_lib_png_main+:} false; then : +if test "${ac_cv_lib_png_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16140,7 +15335,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_main" >&5 $as_echo "$ac_cv_lib_png_main" >&6; } -if test "x$ac_cv_lib_png_main" = xyes; then : +if test "x$ac_cv_lib_png_main" = x""yes; then : PNG_LIBS=-lpng else echo "Please install png library" && exit @@ -16152,14 +15347,14 @@ if test "${enable_jpeg+set}" = set; then : enableval=$enable_jpeg; case "${enableval}" in yes) jpeg=true ;; no) jpeg=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-jpeg" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-jpeg" "$LINENO" 5 ;; esac else jpeg=false fi ac_fn_cxx_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" -if test "x$ac_cv_header_jpeglib_h" = xyes; then : +if test "x$ac_cv_header_jpeglib_h" = x""yes; then : (test x$all = xtrue || test x$jpeg = xtrue) && JPEG_FLAGS=-DHAVE_JPEG else (test x$all = xtrue || test x$jpeg = xtrue) && echo "Please install jpeg headers" && exit @@ -16169,7 +15364,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ljpeg" >&5 $as_echo_n "checking for main in -ljpeg... " >&6; } -if ${ac_cv_lib_jpeg_main+:} false; then : +if test "${ac_cv_lib_jpeg_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16197,7 +15392,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_main" >&5 $as_echo "$ac_cv_lib_jpeg_main" >&6; } -if test "x$ac_cv_lib_jpeg_main" = xyes; then : +if test "x$ac_cv_lib_jpeg_main" = x""yes; then : (test x$all = xtrue || test x$jpeg = xtrue) && JPEG_LIBS=-ljpeg else (test x$all = xtrue || test x$jpeg = xtrue) && echo "Please install jpeg library" && exit @@ -16217,7 +15412,7 @@ if test "${enable_u3d+set}" = set; then : enableval=$enable_u3d; case "${enableval}" in yes) u3d=true ;; no) u3d=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-u3d" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-u3d" "$LINENO" 5 ;; esac else u3d=false @@ -16228,7 +15423,7 @@ if test "${enable_pdf+set}" = set; then : enableval=$enable_pdf; case "${enableval}" in yes) pdf=true; u3d=true ;; no) pdf=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-pdf" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-pdf" "$LINENO" 5 ;; esac else pdf=false @@ -16237,7 +15432,7 @@ fi if test "x$pdf" == xtrue; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lhpdf" >&5 $as_echo_n "checking for main in -lhpdf... " >&6; } -if ${ac_cv_lib_hpdf_main+:} false; then : +if test "${ac_cv_lib_hpdf_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16265,7 +15460,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hpdf_main" >&5 $as_echo "$ac_cv_lib_hpdf_main" >&6; } -if test "x$ac_cv_lib_hpdf_main" = xyes; then : +if test "x$ac_cv_lib_hpdf_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBHPDF 1 _ACEOF @@ -16275,8 +15470,8 @@ _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "--enable-pdf was given, but test for libharu or libhpdf failed -See \`config.log' for more details" "$LINENO" 5; } +as_fn_error $? "--enable-pdf was given, but test for libharu failed +See \`config.log' for more details" "$LINENO" 5 ; } fi @@ -16285,7 +15480,7 @@ if test "x$pdf" == xtrue; then : for ac_header in hpdf.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "hpdf.h" "ac_cv_header_hpdf_h" "$ac_includes_default" -if test "x$ac_cv_header_hpdf_h" = xyes; then : +if test "x$ac_cv_header_hpdf_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_HPDF_H 1 _ACEOF @@ -16293,8 +15488,8 @@ _ACEOF else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "--enable-pdf was given, but test for libharu or libhpdf headers failed -See \`config.log' for more details" "$LINENO" 5; } +as_fn_error $? "--enable-pdf was given, but test for headers failed +See \`config.log' for more details" "$LINENO" 5 ; } fi @@ -16313,7 +15508,7 @@ fi if test "x$u3d" == xtrue; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lIDTF" >&5 $as_echo_n "checking for main in -lIDTF... " >&6; } -if ${ac_cv_lib_IDTF_main+:} false; then : +if test "${ac_cv_lib_IDTF_main+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -16341,7 +15536,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_IDTF_main" >&5 $as_echo "$ac_cv_lib_IDTF_main" >&6; } -if test "x$ac_cv_lib_IDTF_main" = xyes; then : +if test "x$ac_cv_lib_IDTF_main" = x""yes; then : U3D_LIBS="-lIDTF -lm -ldl" @@ -16352,7 +15547,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "--enable-u3d was given, but test for libIDTF failed -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi fi @@ -16360,7 +15555,7 @@ if test "x$u3d" == xtrue; then : for ac_header in u3d/SceneConverterLib.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "u3d/SceneConverterLib.h" "ac_cv_header_u3d_SceneConverterLib_h" "$ac_includes_default" -if test "x$ac_cv_header_u3d_SceneConverterLib_h" = xyes; then : +if test "x$ac_cv_header_u3d_SceneConverterLib_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_U3D_SCENECONVERTERLIB_H 1 _ACEOF @@ -16369,7 +15564,7 @@ else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "--enable-u3d was given, but test for headers failed -See \`config.log' for more details" "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi @@ -16390,7 +15585,7 @@ if test "${enable_fltk+set}" = set; then : enableval=$enable_fltk; case "${enableval}" in yes) fltk=true ;; no) fltk=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-fltk" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-fltk" "$LINENO" 5 ;; esac else fltk=false @@ -16402,7 +15597,7 @@ if (test x$all = xtrue || test x$fltk = xtrue) ;then set dummy $FLTK_PROG; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_FLTK_FLAGS+:} false; then : +if test "${ac_cv_prog_FLTK_FLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$FLTK_FLAGS"; then @@ -16439,7 +15634,7 @@ fi set dummy $FLTK_PROG; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_FLTK_LIBS+:} false; then : +if test "${ac_cv_prog_FLTK_LIBS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$FLTK_LIBS"; then @@ -16489,117 +15684,12 @@ else fi -# Check whether --enable-wx was given. -if test "${enable_wx+set}" = set; then : - enableval=$enable_wx; case "${enableval}" in - yes) wx=true ;; - no) wx=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-wx" "$LINENO" 5 ;; -esac -else - wx=false -fi - -if (test x$all = xtrue || test x$wx = xtrue) ;then -#if (test x$wx = xtrue) ;then - WX_PROG=wx-config - # Extract the first word of "$WX_PROG", so it can be a program name with args. -set dummy $WX_PROG; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_WX_FLAGS+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$WX_FLAGS"; then - ac_cv_prog_WX_FLAGS="$WX_FLAGS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_WX_FLAGS="`$WX_PROG --cflags`" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -WX_FLAGS=$ac_cv_prog_WX_FLAGS -if test -n "$WX_FLAGS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WX_FLAGS" >&5 -$as_echo "$WX_FLAGS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - # Extract the first word of "$WX_PROG", so it can be a program name with args. -set dummy $WX_PROG; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_WX_LIBS+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$WX_LIBS"; then - ac_cv_prog_WX_LIBS="$WX_LIBS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_WX_LIBS="`$WX_PROG --libs`" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -WX_LIBS=$ac_cv_prog_WX_LIBS -if test -n "$WX_LIBS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WX_LIBS" >&5 -$as_echo "$WX_LIBS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "$WX_FLAGS" && test "$WX_LIBS" ;then - test_wx=true - else - echo "Please install wxwidget headers and libraries and make sure that \ - path to $WX_PROG exist in your PATH" - exit - fi -fi - if test x$test_wx = xtrue; then - USE_WX_TRUE= - USE_WX_FALSE='#' -else - USE_WX_TRUE='#' - USE_WX_FALSE= -fi - - # Check whether --enable-qt was given. if test "${enable_qt+set}" = set; then : enableval=$enable_qt; case "${enableval}" in yes) qt=true ;; no) qt=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-qt" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-qt" "$LINENO" 5 ;; esac else qt=false @@ -16635,7 +15725,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_QMAKE+:} false; then : +if test "${ac_cv_path_QMAKE+set}" = set; then : $as_echo_n "(cached) " >&6 else case $QMAKE in @@ -16683,7 +15773,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_QMAKE+:} false; then : +if test "${ac_cv_path_QMAKE+set}" = set; then : $as_echo_n "(cached) " >&6 else case $QMAKE in @@ -16736,7 +15826,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MOC+:} false; then : +if test "${ac_cv_path_MOC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MOC in @@ -16784,7 +15874,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MOC+:} false; then : +if test "${ac_cv_path_MOC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MOC in @@ -16837,7 +15927,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UIC+:} false; then : +if test "${ac_cv_path_UIC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $UIC in @@ -16885,7 +15975,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_UIC+:} false; then : +if test "${ac_cv_path_UIC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $UIC in @@ -16938,7 +16028,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RCC+:} false; then : +if test "${ac_cv_path_RCC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $RCC in @@ -16986,7 +16076,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RCC+:} false; then : +if test "${ac_cv_path_RCC+set}" = set; then : $as_echo_n "(cached) " >&6 else case $RCC in @@ -17136,7 +16226,7 @@ _ASEOF # Try to compile a simple Qt app. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can build a simple Qt app" >&5 $as_echo_n "checking whether we can build a simple Qt app... " >&6; } -if ${at_cv_qt_build+:} false; then : +if test "${at_cv_qt_build+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_qt_build=ko @@ -17229,7 +16319,7 @@ $as_echo "$at_cv_qt_build" >&6; } # Find the DEFINES of Qt (should have been named CPPFLAGS). { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the DEFINES to use with Qt" >&5 $as_echo_n "checking for the DEFINES to use with Qt... " >&6; } -if ${at_cv_env_QT_DEFINES+:} false; then : +if test "${at_cv_env_QT_DEFINES+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_DEFINES=`sed "/^DEFINES[ ]*=/!d;$qt_sed_filter" $at_mfile` @@ -17242,7 +16332,7 @@ $as_echo "$at_cv_env_QT_DEFINES" >&6; } # Find the CFLAGS of Qt (We can use Qt in C?!) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the CFLAGS to use with Qt" >&5 $as_echo_n "checking for the CFLAGS to use with Qt... " >&6; } -if ${at_cv_env_QT_CFLAGS+:} false; then : +if test "${at_cv_env_QT_CFLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_CFLAGS=`sed "/^CFLAGS[ ]*=/!d;$qt_sed_filter" $at_mfile` @@ -17255,7 +16345,7 @@ $as_echo "$at_cv_env_QT_CFLAGS" >&6; } # Find the CXXFLAGS of Qt. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the CXXFLAGS to use with Qt" >&5 $as_echo_n "checking for the CXXFLAGS to use with Qt... " >&6; } -if ${at_cv_env_QT_CXXFLAGS+:} false; then : +if test "${at_cv_env_QT_CXXFLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_CXXFLAGS=`sed "/^CXXFLAGS[ ]*=/!d;$qt_sed_filter" $at_mfile` @@ -17268,7 +16358,7 @@ $as_echo "$at_cv_env_QT_CXXFLAGS" >&6; } # Find the INCPATH of Qt. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the INCPATH to use with Qt" >&5 $as_echo_n "checking for the INCPATH to use with Qt... " >&6; } -if ${at_cv_env_QT_INCPATH+:} false; then : +if test "${at_cv_env_QT_INCPATH+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_INCPATH=`sed "/^INCPATH[ ]*=/!d;$qt_sed_filter" $at_mfile` @@ -17284,7 +16374,7 @@ $as_echo "$at_cv_env_QT_INCPATH" >&6; } # Find the LFLAGS of Qt (Should have been named LDFLAGS) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the LDFLAGS to use with Qt" >&5 $as_echo_n "checking for the LDFLAGS to use with Qt... " >&6; } -if ${at_cv_env_QT_LDFLAGS+:} false; then : +if test "${at_cv_env_QT_LDFLAGS+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_LDFLAGS=`sed "/^LDFLAGS[ ]*=/!d;$qt_sed_filter" $at_mfile` @@ -17310,7 +16400,7 @@ $as_echo "$at_darwin" >&6; } # Find the LIBS of Qt. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the LIBS to use with Qt" >&5 $as_echo_n "checking for the LIBS to use with Qt... " >&6; } -if ${at_cv_env_QT_LIBS+:} false; then : +if test "${at_cv_env_QT_LIBS+set}" = set; then : $as_echo_n "(cached) " >&6 else at_cv_env_QT_LIBS=`sed "/^LIBS[ ]*=/!d;$qt_sed_filter" $at_mfile` @@ -17338,7 +16428,7 @@ Did you invoke AT_WITH_QT before AT_REQUIRE_QT_VERSION?" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt's version" >&5 $as_echo_n "checking for Qt's version... " >&6; } -if ${at_cv_QT_VERSION+:} false; then : +if test "${at_cv_QT_VERSION+set}" = set; then : $as_echo_n "(cached) " >&6 else echo "$as_me:$LINENO: Running $QMAKE --version:" >&5 @@ -17358,7 +16448,7 @@ as_arg_v2=4.3 awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null case $? in #( 1) : - as_fn_error $? "This package requires Qt 4.3 or above." "$LINENO" 5 ;; #( + as_fn_error $? "This package requires Qt 4.3 or above." "$LINENO" 5 ;; #( 0) : ;; #( 2) : @@ -17383,7 +16473,7 @@ if test "${enable_python+set}" = set; then : enableval=$enable_python; case "${enableval}" in yes) python=true ;; no) python=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-python" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-python" "$LINENO" 5 ;; esac else python=false @@ -17394,7 +16484,7 @@ if (test x$langall = xtrue || test x$python = xtrue) ;then set dummy python-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PYTHON_HEADERS+:} false; then : +if test "${ac_cv_prog_PYTHON_HEADERS+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$PYTHON_HEADERS"; then @@ -17431,7 +16521,7 @@ fi set dummy swig$EXEEXT; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_HAVE_SWIG+:} false; then : +if test "${ac_cv_prog_HAVE_SWIG+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_SWIG"; then @@ -17465,20 +16555,20 @@ fi if (test "$PYTHON_HEADERS" && test "$HAVE_SWIG") ;then - test_python=true + test_python=true # Find any Python interpreter. if test -z "$PYTHON"; then - for ac_prog in python python2 python3 python3.0 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 + for ac_prog in python python2 python3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PYTHON+:} false; then : +if test "${ac_cv_path_PYTHON+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PYTHON in @@ -17529,7 +16619,7 @@ test -n "$PYTHON" || PYTHON=":" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } -if ${am_cv_python_version+:} false; then : +if test "${am_cv_python_version+set}" = set; then : $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` @@ -17548,7 +16638,7 @@ $as_echo "$am_cv_python_version" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } -if ${am_cv_python_platform+:} false; then : +if test "${am_cv_python_platform+set}" = set; then : $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` @@ -17562,7 +16652,7 @@ $as_echo "$am_cv_python_platform" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } -if ${am_cv_python_pythondir+:} false; then : +if test "${am_cv_python_pythondir+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$prefix" = xNONE @@ -17600,7 +16690,7 @@ $as_echo "$am_cv_python_pythondir" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } -if ${am_cv_python_pyexecdir+:} false; then : +if test "${am_cv_python_pyexecdir+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$exec_prefix" = xNONE @@ -17641,8 +16731,8 @@ $as_echo "$am_cv_python_pyexecdir" >&6; } else - echo Please install python-dev and swig packages - exit + echo Please install python-dev and swig packages + exit fi fi if test x$test_python = xtrue ; then @@ -17659,7 +16749,7 @@ if test "${enable_octave+set}" = set; then : enableval=$enable_octave; case "${enableval}" in yes) octave=true ;; no) octave=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-octave" "$LINENO" 5 ;; + *) as_fn_error $? "bad value ${enableval} for --enable-octave" "$LINENO" 5 ;; esac else octave=false @@ -17670,7 +16760,7 @@ if (test x$langall = xtrue || test x$octave = xtrue) ;then set dummy octave-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCTAVE+:} false; then : +if test "${ac_cv_prog_OCTAVE+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$OCTAVE"; then @@ -17707,8 +16797,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Octave arch" >&5 $as_echo_n "checking for Octave arch... " >&6; } OCTAVE_ARCH=`$OCTAVE -p CANONICAL_HOST_TYPE`-`$OCTAVE -p API_VERSION` - OCTINCLUDEDIR="`$OCTAVE -p OCTINCLUDEDIR`" - OCTAVE_INCFLAGS="-I$OCTINCLUDEDIR -I$OCTINCLUDEDIR/.." + OCTAVE_INCFLAGS="-I`$OCTAVE -p OCTINCLUDEDIR`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCTAVE_ARCH" >&5 $as_echo "$OCTAVE_ARCH" >&6; } OCTAVE_ARCH=$OCTAVE_ARCH @@ -17726,54 +16815,10 @@ else fi -# Check whether --enable-testio was given. -if test "${enable_testio+set}" = set; then : - enableval=$enable_testio; case "${enableval}" in - yes) testio=true ;; - no) testio=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-testio" "$LINENO" 5 ;; -esac -else - testio=false -fi - - if test x$testio = xtrue ; then - USE_TESTIO_TRUE= - USE_TESTIO_FALSE='#' -else - USE_TESTIO_TRUE='#' - USE_TESTIO_FALSE= -fi - - -# Check whether --enable-docs was given. -if test "${enable_docs+set}" = set; then : - enableval=$enable_docs; case "${enableval}" in - yes) docs=true ;; - no) docs=false ;; - *) as_fn_error $? "bad value ${enableval} for --enable-docs" "$LINENO" 5 ;; -esac -else - docs=false -fi - -if (test x$docs = xtrue || test x$all = xtrue) ;then - ac_config_files="$ac_config_files texinfo/Makefile texinfo/png/Makefile" - -fi - if (test x$docs = xtrue || test x$all = xtrue) ; then - USE_DOCS_TRUE= - USE_DOCS_FALSE='#' -else - USE_DOCS_TRUE='#' - USE_DOCS_FALSE= -fi - - AM_CXXFLAGS="$AM_CXXFLAGS -Wall $GSL_FLAGS" -ac_config_files="$ac_config_files Makefile mgl/Makefile examples/Makefile include/Makefile lang/Makefile utils/Makefile widgets/Makefile" +ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile widgets/Makefile lang/Makefile utils/Makefile examples/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -17839,21 +16884,10 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then + test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi + cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -17904,6 +16938,10 @@ if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${USE_PTHREAD_TRUE}" && test -z "${USE_PTHREAD_FALSE}"; then as_fn_error $? "conditional \"USE_PTHREAD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -17924,10 +16962,6 @@ if test -z "${USE_HDF4_TRUE}" && test -z "${USE_HDF4_FALSE}"; then as_fn_error $? "conditional \"USE_HDF4\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_GIF_TRUE}" && test -z "${USE_GIF_FALSE}"; then - as_fn_error $? "conditional \"USE_GIF\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${USE_JPEG_TRUE}" && test -z "${USE_JPEG_FALSE}"; then as_fn_error $? "conditional \"USE_JPEG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -17944,10 +16978,6 @@ if test -z "${USE_FLTK_TRUE}" && test -z "${USE_FLTK_FALSE}"; then as_fn_error $? "conditional \"USE_FLTK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_WX_TRUE}" && test -z "${USE_WX_FALSE}"; then - as_fn_error $? "conditional \"USE_WX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${USE_QT_TRUE}" && test -z "${USE_QT_FALSE}"; then as_fn_error $? "conditional \"USE_QT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -17960,16 +16990,8 @@ if test -z "${USE_OCTAVE_TRUE}" && test -z "${USE_OCTAVE_FALSE}"; then as_fn_error $? "conditional \"USE_OCTAVE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_TESTIO_TRUE}" && test -z "${USE_TESTIO_FALSE}"; then - as_fn_error $? "conditional \"USE_TESTIO\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_DOCS_TRUE}" && test -z "${USE_DOCS_FALSE}"; then - as_fn_error $? "conditional \"USE_DOCS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -: "${CONFIG_STATUS=./config.status}" +: ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -18070,7 +17092,6 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -18377,8 +17398,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by mathgl $as_me 1.11.2, which was -generated by GNU Autoconf 2.68. Invocation command line was +This file was extended by mathgl $as_me 2.0, which was +generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -18443,8 +17464,8 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -mathgl config.status 1.11.2 -configured by $0, generated by GNU Autoconf 2.68, +mathgl config.status 2.0 +configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. @@ -18572,212 +17593,186 @@ AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' -AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' -SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' -ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' -lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' -file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' -want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' -sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' -AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' -GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' -lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' -objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' -finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' -predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' -postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' -predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' -postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' -LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' -reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' -reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' -compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' -GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' -archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' -module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' -with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' -no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' -inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' -link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' -always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' -exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' -include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' -prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' -postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' -file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' -hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' -predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' -postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' -predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' -postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' -compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' +LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' +predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' +predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' +postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - # Quote evaled strings. -for var in AS \ -DLLTOOL \ -OBJDUMP \ -SHELL \ -ECHO \ -SED \ +for var in SED \ GREP \ EGREP \ FGREP \ @@ -18789,12 +17784,8 @@ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ -file_magic_glob \ -want_nocaseglob \ -sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ -archiver_list_spec \ STRIP \ RANLIB \ CC \ @@ -18804,14 +17795,14 @@ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -nm_file_list_spec \ +SHELL \ +ECHO \ lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_pic \ lt_prog_compiler_wl \ +lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ -MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ @@ -18827,6 +17818,7 @@ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ +fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ @@ -18834,7 +17826,6 @@ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ -install_override_mode \ finish_eval \ old_striplib \ striplib \ @@ -18845,11 +17836,10 @@ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ -reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ -lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ +lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ @@ -18861,6 +17851,7 @@ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ +fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ @@ -18870,9 +17861,9 @@ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -18894,13 +17885,11 @@ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ -postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ -reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ @@ -18909,11 +17898,10 @@ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ -prelink_cmds_CXX \ -postlink_cmds_CXX; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in +prelink_cmds_CXX; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" @@ -18921,6 +17909,12 @@ postlink_cmds_CXX; do esac done +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' @@ -18954,17 +17948,15 @@ do "include/mgl/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/mgl/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "texinfo/Makefile") CONFIG_FILES="$CONFIG_FILES texinfo/Makefile" ;; - "texinfo/png/Makefile") CONFIG_FILES="$CONFIG_FILES texinfo/png/Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "mgl/Makefile") CONFIG_FILES="$CONFIG_FILES mgl/Makefile" ;; - "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "widgets/Makefile") CONFIG_FILES="$CONFIG_FILES widgets/Makefile" ;; "lang/Makefile") CONFIG_FILES="$CONFIG_FILES lang/Makefile" ;; "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; - "widgets/Makefile") CONFIG_FILES="$CONFIG_FILES widgets/Makefile" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done @@ -18987,10 +17979,9 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= ac_tmp= + tmp= trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -18998,13 +17989,12 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" + test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -19026,7 +18016,7 @@ else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF @@ -19054,7 +18044,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -19102,7 +18092,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && +cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -19134,7 +18124,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF @@ -19168,7 +18158,7 @@ fi # test -n "$CONFIG_FILES" # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || +cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -19180,8 +18170,8 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 @@ -19282,7 +18272,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -19301,7 +18291,7 @@ do for ac_f do case $ac_f in - -) ac_f="$ac_tmp/stdin";; + -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -19310,7 +18300,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -19336,8 +18326,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -19473,22 +18463,21 @@ s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$ac_tmp/stdin" + rm -f "$tmp/stdin" case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; @@ -19499,20 +18488,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ + mv "$tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. @@ -19674,8 +18663,7 @@ $as_echo X"$file" | # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. +# 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. @@ -19708,13 +18696,13 @@ available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Assembler program. -AS=$lt_AS +AS=$AS # DLL creation program. -DLLTOOL=$lt_DLLTOOL +DLLTOOL=$DLLTOOL # Object dumper program. -OBJDUMP=$lt_OBJDUMP +OBJDUMP=$OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version @@ -19732,12 +18720,6 @@ pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - # The host system. host_alias=$host_alias host=$host @@ -19787,36 +18769,20 @@ SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method = "file_magic". +# Command to use when deplibs_check_method == "file_magic". file_magic_cmd=$lt_file_magic_cmd -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob=$lt_file_magic_glob - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob=$lt_want_nocaseglob - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - # The archiver. AR=$lt_AR - -# Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - # A symbol stripping program. STRIP=$lt_STRIP @@ -19825,9 +18791,6 @@ RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - # A C compiler. LTCC=$lt_CC @@ -19846,24 +18809,21 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix -# Specify filename containing input files for \$NM. -nm_file_list_spec=$lt_nm_file_list_spec - -# The root where to search for dependent libraries,and in which our libraries should be installed. -lt_sysroot=$lt_sysroot - # The name of the directory that contains temporary libtool files. objdir=$objdir +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL @@ -19920,9 +18880,6 @@ library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds @@ -19962,10 +18919,6 @@ striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds @@ -19978,12 +18931,12 @@ with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static @@ -20070,6 +19023,9 @@ inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols @@ -20085,9 +19041,6 @@ include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - # Specify filename containing input files. file_list_spec=$lt_file_list_spec @@ -20134,169 +19087,212 @@ ltmain="$ac_aux_dir/ltmain.sh" # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - if test x"$xsi_shell" = xyes; then - sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ -func_dirname ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_basename ()$/,/^} # func_basename /c\ -func_basename ()\ -{\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ -func_dirname_and_basename ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ -func_stripname ()\ -{\ -\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ -\ # positional parameters, so assign one to ordinary parameter first.\ -\ func_stripname_result=${3}\ -\ func_stripname_result=${func_stripname_result#"${1}"}\ -\ func_stripname_result=${func_stripname_result%"${2}"}\ -} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ -func_split_long_opt ()\ -{\ -\ func_split_long_opt_name=${1%%=*}\ -\ func_split_long_opt_arg=${1#*=}\ -} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ -func_split_short_opt ()\ -{\ -\ func_split_short_opt_arg=${1#??}\ -\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ -} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ -func_lo2o ()\ -{\ -\ case ${1} in\ -\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ -\ *) func_lo2o_result=${1} ;;\ -\ esac\ -} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_xform ()$/,/^} # func_xform /c\ -func_xform ()\ -{\ - func_xform_result=${1%.*}.lo\ -} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_arith ()$/,/^} # func_arith /c\ -func_arith ()\ -{\ - func_arith_result=$(( $* ))\ -} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_len ()$/,/^} # func_len /c\ -func_len ()\ -{\ - func_len_result=${#1}\ -} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - -fi - -if test x"$lt_shell_append" = xyes; then - sed -e '/^func_append ()$/,/^} # func_append /c\ -func_append ()\ -{\ - eval "${1}+=\\${2}"\ -} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ -func_append_quoted ()\ -{\ -\ func_quote_for_eval "${2}"\ -\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ -} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 -$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} -fi - - - mv -f "$cfgfile" "$ofile" || + sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +func_stripname () +{ + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=${1%.*}.lo +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=$(( $* )) +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=${#1} +} + +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` +} + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "$@"` +} + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` +} + +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} + +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" @@ -20308,10 +19304,6 @@ fi # The linker used to build libraries. LD=$lt_LD_CXX -# How to create reloadable object files. -reload_flag=$lt_reload_flag_CXX -reload_cmds=$lt_reload_cmds_CXX - # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX @@ -20324,12 +19316,12 @@ with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX - # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX @@ -20416,6 +19408,9 @@ inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path_CXX + # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX @@ -20431,9 +19426,6 @@ include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds_CXX - # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX diff --git a/configure.ac b/configure.ac index 8a35e82..e1c27fe 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT([mathgl], [1.11.2], [mathgl.abalakin@gmail.com]) +AC_INIT([mathgl], [2.0], [mathgl.abalakin@gmail.com]) -MGL_RELEASE=1.11.2 +MGL_RELEASE=2.0 AC_SUBST(MGL_RELEASE) AC_CONFIG_MACRO_DIR([config]) AC_CONFIG_AUX_DIR(config) -AC_CONFIG_SRCDIR(mgl) +AC_CONFIG_SRCDIR(src) AC_CONFIG_HEADER(include/mgl/config.h) AC_LANG([C++]) @@ -16,7 +16,7 @@ AC_LANG([C++]) # (Interfaces removed: CURRENT++, AGE=0, REVISION=0) # (Interfaces added: CURRENT++, AGE++, REVISION=0) # (No interfaces changed: REVISION++) -MGL_CURRENT=5 +MGL_CURRENT=6 MGL_REVISION=0 MGL_AGE=0 AC_SUBST(MGL_CURRENT) @@ -102,22 +102,10 @@ else fi AM_CONDITIONAL(USE_GSL, test x$test_gsl = xtrue) -AC_ARG_ENABLE(glut, -[ --enable-glut Turn on glut], -[case "${enableval}" in - yes) glut=true ;; - no) glut=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-glut) ;; -esac],[glut=false]) - case "${host}" in *darwin*) GL_LIBS="-framework OpenGL" AC_SUBST(GL_LIBS) - if (test x$all = xtrue || test x$glut = xtrue) ;then - GLUT_LIBS="-framework GLUT -framework OpenGL" - AC_SUBST(GLUT_LIBS) - fi ;; *w32*) @@ -125,11 +113,6 @@ case "${host}" in 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]) - GLUT_LIBS=glut32 - AC_CHECK_HEADER([GL/glut.h],[(test x$all = xtrue || test x$glut = xtrue) && GLUT_FLAGS=-DHAVE_GLUT AC_SUBST(GLUT_FLAGS)], - [(test x$all = xtrue || test x$glut = xtrue) && (echo "Please install FreeGLUT headers (GL/glut.h)" && exit)]) - AC_CHECK_LIB([${GLUT_LIBS}], [main], [(test x$all = xtrue || test x$glut = xtrue) && GLUT_LIBS=-l${GLUT_LIBS} AC_SUBST(GLUT_LIBS)], - [(test x$all = xtrue || test x$glut = xtrue) && echo "Please install FreeGLUT library (lib${GLUT_LIBS}.a)" && exit]) ;; *) @@ -137,11 +120,6 @@ case "${host}" in 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]) - GLUT_LIBS=glut - AC_CHECK_HEADER(GL/glut.h,[(test x$all = xtrue || test x$glut = xtrue) && GLUT_FLAGS=-DHAVE_GLUT AC_SUBST(GLUT_FLAGS)], - [(test x$all = xtrue || test x$glut = xtrue) && (echo "Please install FreeGLUT headers (GL/glut.h)" && exit)]) - AC_CHECK_LIB([${GLUT_LIBS}], [main], [(test x$all = xtrue || test x$glut = xtrue) && GLUT_LIBS=-l${GLUT_LIBS} AC_SUBST(GLUT_LIBS)], - [(test x$all = xtrue || test x$glut = xtrue) && echo "Please install FreeGLUT library (lib${GLUT_LIBS}.a)" && exit]) ;; esac @@ -196,20 +174,6 @@ AC_CHECK_LIB([df], [main], [(test x$all = xtrue || test x$hdf4 = xtrue) && HDF4_ [(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_ARG_ENABLE(gif, -[ --enable-gif Turn on gif], -[case "${enableval}" in - yes) gif=true ;; - no) gif=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-gif) ;; -esac],[gif=false]) -AC_CHECK_HEADER(gif_lib.h,[(test x$all = xtrue || test x$gif = xtrue) && GIF_FLAGS=-DHAVE_GIF AC_SUBST(GIF_FLAGS)], - [(test x$all = xtrue || test x$gif = xtrue) && echo "Please install gif headers" && exit]) - -AC_CHECK_LIB([gif], [main], [(test x$all = xtrue || test x$gif = xtrue) && GIF_LIBS=-lgif AC_SUBST(GIF_LIBS)], - [(test x$all = xtrue || test x$gif = xtrue) && echo "Please install gif library" && exit]) -AM_CONDITIONAL(USE_GIF, (test x$all = xtrue || test x$gif = xtrue)) - AC_CHECK_HEADER(png.h,,[echo "Please install png headers" && exit]) AC_CHECK_LIB([png], [main], [PNG_LIBS=-lpng AC_SUBST(PNG_LIBS)], @@ -247,12 +211,12 @@ AS_IF([test "x$pdf" == xtrue], [AC_CHECK_LIB([hpdf], [main], [], [AC_MSG_FAILURE( - [--enable-pdf was given, but test for libharu or libhpdf failed])] + [--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 libharu or libhpdf headers failed])] + [--enable-pdf was given, but test for headers failed])] )]) AM_CONDITIONAL(USE_PDF, test x$pdf = xtrue) @@ -293,28 +257,6 @@ if (test x$all = xtrue || test x$fltk = xtrue) ;then fi AM_CONDITIONAL(USE_FLTK, test x$test_fltk = xtrue) -AC_ARG_ENABLE(wx, -[ --enable-wx Turn on wxWidget], -[case "${enableval}" in - yes) wx=true ;; - no) wx=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-wx) ;; -esac],[wx=false]) -if (test x$all = xtrue || test x$wx = xtrue) ;then -#if (test x$wx = xtrue) ;then - WX_PROG=wx-config - AC_CHECK_PROG(WX_FLAGS,$WX_PROG,`$WX_PROG --cflags`) - AC_CHECK_PROG(WX_LIBS,$WX_PROG,`$WX_PROG --libs`) - if test "$WX_FLAGS" && test "$WX_LIBS" ;then - test_wx=true - else - echo "Please install wxwidget headers and libraries and make sure that \ - path to $WX_PROG exist in your PATH" - exit - fi -fi -AM_CONDITIONAL(USE_WX, test x$test_wx = xtrue) - AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt], [case "${enableval}" in @@ -340,11 +282,11 @@ 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() + test_python=true + AM_PATH_PYTHON() else - echo Please install python-dev and swig packages - exit + echo Please install python-dev and swig packages + exit fi fi AM_CONDITIONAL(USE_PYTHON, test x$test_python = xtrue ) @@ -361,8 +303,7 @@ if (test x$langall = xtrue || test x$octave = xtrue) ;then # find Octave arch AC_MSG_CHECKING([for Octave arch]) OCTAVE_ARCH=`$OCTAVE -p CANONICAL_HOST_TYPE`-`$OCTAVE -p API_VERSION` - OCTINCLUDEDIR="`$OCTAVE -p OCTINCLUDEDIR`" - OCTAVE_INCFLAGS="-I$OCTINCLUDEDIR -I$OCTINCLUDEDIR/.." + OCTAVE_INCFLAGS="-I`$OCTAVE -p OCTINCLUDEDIR`" AC_MSG_RESULT([$OCTAVE_ARCH]) AC_SUBST(OCTAVE_ARCH,[$OCTAVE_ARCH]) AC_SUBST(OCTAVE_INCFLAGS,[$OCTAVE_INCFLAGS]) @@ -370,38 +311,17 @@ if (test x$langall = xtrue || test x$octave = xtrue) ;then fi AM_CONDITIONAL(USE_OCTAVE, test x$test_octave = xtrue ) -AC_ARG_ENABLE(testio, -[ --enable-testio Turn on testio], -[case "${enableval}" in - yes) testio=true ;; - no) testio=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-testio) ;; -esac],[testio=false]) -AM_CONDITIONAL(USE_TESTIO, test x$testio = xtrue ) - -AC_ARG_ENABLE(docs, -[ --enable-docs Turn on documentation building], -[case "${enableval}" in - yes) docs=true ;; - no) docs=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-docs) ;; -esac],[docs=false]) -if (test x$docs = xtrue || test x$all = xtrue) ;then - AC_CONFIG_FILES([texinfo/Makefile texinfo/png/Makefile]) -fi -AM_CONDITIONAL(USE_DOCS, (test x$docs = xtrue || test x$all = xtrue) ) - AM_CXXFLAGS="$AM_CXXFLAGS -Wall $GSL_FLAGS" AC_SUBST(AM_CXXFLAGS) AC_CONFIG_FILES([ Makefile -mgl/Makefile -examples/Makefile +src/Makefile include/Makefile +widgets/Makefile lang/Makefile utils/Makefile -widgets/Makefile +examples/Makefile ]) AC_OUTPUT diff --git a/debinstall/changelog b/debinstall/changelog deleted file mode 100644 index e59af4a..0000000 --- a/debinstall/changelog +++ /dev/null @@ -1,117 +0,0 @@ -mathgl (1.9ufp-1) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Thu, 11 Jun 2009 16:25:00 +0300 - -mathgl (1.8.1ufp-1) unstable; urgency=low - - * Upstream update - * Some changes to control, made packaging more like in Debian - - -- Dmitry I. Kulagin Tue, 09 Jun 2009 16:22:00 +0300 - -mathgl (1.8.1ufp) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Fri, 17 Apr 2009 16:15:00 +0300 - -mathgl (1.8.1) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Wed, 04 Mar 2009 14:09:00 +0300 - -mathgl (1.8) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Thu, 27 Nov 2008 8:24:00 +0300 - -mathgl (1.7) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Wed, 28 May 2008 14:45:28 +0300 - -mathgl (1.6.2.1) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Wed, 11 Apr 2008 18:10:16 +0300 - -mathgl (1.6.1) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Wed, 02 Apr 2008 21:15:05 +0300 - -mathgl (1.6) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Wed, 12 Mar 2008 20:55:45 +0300 - -mathgl (1.6~pre1) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Mon, 28 Jan 2008 15:45:16 +0300 - -mathgl (1.5.0.1) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Wed, 09 Jan 2008 17:10:16 +0300 - -mathgl (1.5) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Tue, 08 Jan 2008 17:42:16 +0300 - -mathgl (1.4.4~pre1) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Mon, 28 Dec 2007 17:13:16 +0300 - -mathgl (1.4.3~pre1) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Mon, 26 Nov 2007 15:13:16 +0300 - -mathgl (1.4.2) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Mon, 26 Nov 2007 15:13:16 +0300 - -mathgl (1.4.1) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Wed, 10 Oct 2007 20:00:16 +0400 - -mathgl (1.4.0.1) unstable; urgency=low - - * Sync up with real 1.4 upstream version - * The removal of the docs as the author requested. - For the any docs please go to http://mathgl.sf.net - - -- Dmitry I. Kulagin Wed, 10 Oct 2007 20:00:16 +0400 - -mathgl (1.4) unstable; urgency=low - - * Upstream update - - -- Dmitry I. Kulagin Wed, 10 Oct 2007 20:00:16 +0400 - -mathgl (1.3.1-pre1) unstable; urgency=low - - * Initial release - - -- Dmitry I. Kulagin Wed, 10 Oct 2007 20:00:16 +0400 - diff --git a/debinstall/compat b/debinstall/compat deleted file mode 100644 index 1e8b314..0000000 --- a/debinstall/compat +++ /dev/null @@ -1 +0,0 @@ -6 diff --git a/debinstall/control b/debinstall/control deleted file mode 100644 index 4934795..0000000 --- a/debinstall/control +++ /dev/null @@ -1,261 +0,0 @@ -Source: mathgl -Section: libs -Priority: extra -Maintainer: Dmitry I. Kulagin -Build-Depends: cdbs, debhelper (>= 5), autotools-dev, libtool, autoconf, automake, libgsl0-dev, freeglut3-dev, libgl-dev, libpng-dev, libhdf5-dev, libjpeg-dev, libtiff-dev, libfltk-dev, g++, libqt4-dev, libwxbase2.6-dev, python-all-dev, swig, texinfo, texi2html, libgif-dev -Standards-Version: 3.7.2 - -Package: mathgl -Architecture: any -Section: libs -Priority: extra -Depends: ${shlibs:Depends}, libmgl5 (= ${binary:Version}) -Suggests: libmgl-dev -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - MathGL utilities and examples. - -Package: mathgl-doc-html -Architecture: all -Section: doc -Priority: extra -Suggests: libmgl5 -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - MathGL HTML documentation - -Package: mathgl-doc-pdf -Architecture: all -Section: doc -Priority: extra -Suggests: libmgl5 -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - MathGL PDF documentation - -Package: mathgl-doc-info -Architecture: all -Section: doc -Priority: extra -Suggests: libmgl5 -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - MathGL INFO documentation - -Package: libmgl5 -Architecture: any -Section: libs -Priority: extra -Suggests: libmgl-dev, mathgl -Depends: ${shlibs:Depends}, libmgl-data (= ${binary:Version}) -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - Main library. - -Package: libmgl-data -Architecture: any -Section: libs -Priority: extra -Suggests: libmgl-dev, mathgl -Depends: libmgl5 (= ${binary:Version}) -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - Fonts and data. - -Package: libmgl-dev -Architecture: any -Section: libdevel -Priority: extra -Depends: libmgl5 (= ${binary:Version}), libgsl0-dev, libgl-dev, libpng-dev -Suggests: mathgl -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - MathGL development files. - -Package: libmgl-fltk5 -Architecture: any -Section: libs -Priority: extra -Suggests: libmgl-dev, mathgl -Depends: ${shlibs:Depends}, libmgl5 (= ${binary:Version}) -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - FLTK frontend. - -Package: libmgl-fltk-dev -Architecture: any -Section: libdevel -Priority: extra -Depends: libmgl5 (= ${binary:Version}), libmgl-fltk5 (= ${binary:Version}), libfltk-dev, libmgl-dev -Suggests: mathgl -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - MathGL FLTK development files. - -Package: libmgl-qt5 -Architecture: any -Section: libs -Priority: extra -Suggests: libmgl-dev, mathgl -Depends: ${shlibs:Depends}, libmgl5 (= ${binary:Version}) -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - QT4 frontend. - -Package: libmgl-qt-dev -Architecture: any -Section: libdevel -Priority: extra -Depends: libmgl5 (= ${binary:Version}), libmgl-qt5 (= ${binary:Version}), libqt4-dev, libmgl-dev -Suggests: mathgl -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - MathGL QT4 development files. - -Package: libmgl-wx5 -Architecture: any -Section: libs -Priority: extra -Suggests: libmgl-dev, mathgl -Depends: ${shlibs:Depends}, libmgl5 (= ${binary:Version}) -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - wxWidgets frontend. - -Package: libmgl-wx-dev -Architecture: any -Section: libdevel -Priority: extra -Depends: libmgl5 (= ${binary:Version}), libmgl-wx5 (= ${binary:Version}) -Suggests: mathgl -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - MathGL wxWidgets development files. - -Package: libmgl-glut5 -Architecture: any -Section: libs -Priority: extra -Suggests: libmgl-dev, mathgl -Depends: ${shlibs:Depends}, libmgl5 (= ${binary:Version}) -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - GLUT frontend. - -Package: libmgl-glut-dev -Architecture: any -Section: libdevel -Priority: extra -Depends: libmgl5 (= ${binary:Version}), libmgl-glut5 (= ${binary:Version}), freeglut3-dev, libmgl-dev -Suggests: mathgl -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - MathGL GLUT development files. - -Package: python-mathgl -Architecture: any -Section: python -Priority: extra -Depends: ${python:Depends}, ${shlibs:Depends}, libmgl5 (= ${binary:Version}) -Provides: ${python:Provides} -Suggests: libmgl-dev, mathgl -Description: MathGL is a library for the plotting of the data - MathGL is a free library of fast C++ routines for the plotting - of the data varied in one or more dimensions. It uses OpenGL - (www.opengl.org) for the plotting. Also there is a simple window - interface based on GLUT. This provides high compatibility with - any operating system (really any which has OpenGL-like libraries). - . - Python language interface - -#Package: octave-mathgl -#Architecture: any -#Section: math -#Priority: extra -#Depends: ${octave:Depends}, ${shlibs:Depends}, libmgl5 (= ${binary:Version}) -#Provides: ${octave:Provides} -#Suggests: libmgl-dev, mathgl -#Description: MathGL is a library for the plotting of the data -# MathGL is a free library of fast C++ routines for the plotting -# of the data varied in one or more dimensions. It uses OpenGL -# (www.opengl.org) for the plotting. Also there is a simple window -# interface based on GLUT. This provides high compatibility with -# any operating system (really any which has OpenGL-like libraries). -# . -# Octave language interface - diff --git a/debinstall/copyright b/debinstall/copyright deleted file mode 100644 index e5ef5d6..0000000 --- a/debinstall/copyright +++ /dev/null @@ -1,22 +0,0 @@ -This package was debianized by Dmitry I. Kulagin on -Wed, 10 Oct 2007 20:00:16 +0400. - -It was downloaded from http://mathgl.sourceforge.net/ - -Upstream Author(s): - - Alexey Balakin - -Copyright: - - Copyright (C) 2007 Alexey Balakin - -License: - - GPLv2 - -The Debian packaging is (C) 2007, Dmitry I. Kulagin and -is licensed under the GPL, see `/usr/share/common-licenses/GPL'. - -# Please also look if there are files or directories which have a -# different copyright/license attached and list them here. diff --git a/debinstall/docs b/debinstall/docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/libmgl-data.docs b/debinstall/libmgl-data.docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/libmgl-data.docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/libmgl-data.install b/debinstall/libmgl-data.install deleted file mode 100644 index 5ffc115..0000000 --- a/debinstall/libmgl-data.install +++ /dev/null @@ -1 +0,0 @@ -debian/tmp/usr/share/mathgl/* diff --git a/debinstall/libmgl-dev.docs b/debinstall/libmgl-dev.docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/libmgl-dev.docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/libmgl-dev.install b/debinstall/libmgl-dev.install deleted file mode 100644 index f69bef9..0000000 --- a/debinstall/libmgl-dev.install +++ /dev/null @@ -1,2 +0,0 @@ -debian/tmp/usr/include/mgl/* -debian/tmp/usr/lib/libmgl.{a,la,so} diff --git a/debinstall/libmgl-fltk-dev.docs b/debinstall/libmgl-fltk-dev.docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/libmgl-fltk-dev.docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/libmgl-fltk-dev.install b/debinstall/libmgl-fltk-dev.install deleted file mode 100644 index a70e380..0000000 --- a/debinstall/libmgl-fltk-dev.install +++ /dev/null @@ -1,2 +0,0 @@ -debian/tmp/usr/include/mgl/mgl_fltk.h -debian/tmp/usr/lib/libmgl-fltk.{a,la,so} diff --git a/debinstall/libmgl-fltk5.docs b/debinstall/libmgl-fltk5.docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/libmgl-fltk5.docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/libmgl-fltk5.install b/debinstall/libmgl-fltk5.install deleted file mode 100644 index 3c1e027..0000000 --- a/debinstall/libmgl-fltk5.install +++ /dev/null @@ -1 +0,0 @@ -debian/tmp/usr/lib/libmgl-fltk.so.* diff --git a/debinstall/libmgl-glut-dev.docs b/debinstall/libmgl-glut-dev.docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/libmgl-glut-dev.docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/libmgl-glut-dev.install b/debinstall/libmgl-glut-dev.install deleted file mode 100644 index 6fa95f1..0000000 --- a/debinstall/libmgl-glut-dev.install +++ /dev/null @@ -1,2 +0,0 @@ -debian/tmp/usr/include/mgl/mgl_glut.h -debian/tmp/usr/lib/libmgl-glut.{a,la,so} diff --git a/debinstall/libmgl-glut5.docs b/debinstall/libmgl-glut5.docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/libmgl-glut5.docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/libmgl-glut5.install b/debinstall/libmgl-glut5.install deleted file mode 100644 index c74bf1b..0000000 --- a/debinstall/libmgl-glut5.install +++ /dev/null @@ -1 +0,0 @@ -debian/tmp/usr/lib/libmgl-glut.so.* diff --git a/debinstall/libmgl-qt-dev.docs b/debinstall/libmgl-qt-dev.docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/libmgl-qt-dev.docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/libmgl-qt-dev.install b/debinstall/libmgl-qt-dev.install deleted file mode 100644 index f930036..0000000 --- a/debinstall/libmgl-qt-dev.install +++ /dev/null @@ -1,2 +0,0 @@ -debian/tmp/usr/include/mgl/mgl_qt.h -debian/tmp/usr/lib/libmgl-qt.{a,la,so} diff --git a/debinstall/libmgl-qt5.docs b/debinstall/libmgl-qt5.docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/libmgl-qt5.docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/libmgl-qt5.install b/debinstall/libmgl-qt5.install deleted file mode 100644 index 8352183..0000000 --- a/debinstall/libmgl-qt5.install +++ /dev/null @@ -1 +0,0 @@ -debian/tmp/usr/lib/libmgl-qt.so.* diff --git a/debinstall/libmgl-wx-dev.docs b/debinstall/libmgl-wx-dev.docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/libmgl-wx-dev.docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/libmgl-wx-dev.install b/debinstall/libmgl-wx-dev.install deleted file mode 100644 index fd213b2..0000000 --- a/debinstall/libmgl-wx-dev.install +++ /dev/null @@ -1,2 +0,0 @@ -debian/tmp/usr/include/mgl/mgl_wx.h -debian/tmp/usr/lib/libmgl-wx.{a,la,so} diff --git a/debinstall/libmgl-wx5.docs b/debinstall/libmgl-wx5.docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/libmgl-wx5.docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/libmgl-wx5.install b/debinstall/libmgl-wx5.install deleted file mode 100644 index d78c1d8..0000000 --- a/debinstall/libmgl-wx5.install +++ /dev/null @@ -1 +0,0 @@ -debian/tmp/usr/lib/libmgl-wx.so.* diff --git a/debinstall/libmgl5.docs b/debinstall/libmgl5.docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/libmgl5.docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/libmgl5.install b/debinstall/libmgl5.install deleted file mode 100644 index ce4b0fd..0000000 --- a/debinstall/libmgl5.install +++ /dev/null @@ -1 +0,0 @@ -debian/tmp/usr/lib/libmgl.so.* diff --git a/debinstall/mathgl-doc-html.docs b/debinstall/mathgl-doc-html.docs deleted file mode 100644 index f027f4d..0000000 --- a/debinstall/mathgl-doc-html.docs +++ /dev/null @@ -1,10 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL -texinfo/mathgl.html/ -texinfo/png/ -texinfo/png_static/ diff --git a/debinstall/mathgl-doc-info.docs b/debinstall/mathgl-doc-info.docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/mathgl-doc-info.docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/mathgl-doc-info.install b/debinstall/mathgl-doc-info.install deleted file mode 100644 index 96d8aed..0000000 --- a/debinstall/mathgl-doc-info.install +++ /dev/null @@ -1 +0,0 @@ -debian/tmp/usr/share/info/* diff --git a/debinstall/mathgl-doc-pdf.docs b/debinstall/mathgl-doc-pdf.docs deleted file mode 100644 index fbd6cf4..0000000 --- a/debinstall/mathgl-doc-pdf.docs +++ /dev/null @@ -1,8 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL -texinfo/mathgl.pdf diff --git a/debinstall/mathgl.install b/debinstall/mathgl.install deleted file mode 100644 index 8ffdce8..0000000 --- a/debinstall/mathgl.install +++ /dev/null @@ -1 +0,0 @@ -debian/tmp/usr/bin/* diff --git a/debinstall/octave-mathgl.docs b/debinstall/octave-mathgl.docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/octave-mathgl.docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/pycompat b/debinstall/pycompat deleted file mode 100644 index 0cfbf08..0000000 --- a/debinstall/pycompat +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/debinstall/python-mathgl.docs b/debinstall/python-mathgl.docs deleted file mode 100644 index d3036ac..0000000 --- a/debinstall/python-mathgl.docs +++ /dev/null @@ -1,7 +0,0 @@ -NEWS -README -AUTHORS -ChangeLog.txt -COPYING -COPYRIGHT -INSTALL diff --git a/debinstall/rules b/debinstall/rules deleted file mode 100755 index d978bbc..0000000 --- a/debinstall/rules +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/make -f - -DEB_PYTHON_SYSTEM=pysupport - -include /usr/share/cdbs/1/rules/debhelper.mk -include /usr/share/cdbs/1/class/autotools.mk -#include /usr/share/cdbs/1/class/octave-pkg.mk -#include /usr/share/cdbs/1/class/cmake.mk -include /usr/share/cdbs/1/class/python-distutils.mk - -# Add here any variable or target overrides you need. -DEB_CONFIGURE_EXTRA_FLAGS = --enable-all --enable-langall CXXFLAGS="-O2" CFLAGS="-O2" -#DEB_CMAKE_EXTRA_FLAGS = -Denable-all=true -Denable-langall=true - -DEB_PYTHON_CLEAN_ARGS = --all -DEB_PYTHON_INSTALL_ARGS_ALL = --no-compile --force --root=debian/python-mathgl/ -binary-install/libmgl-dev:: - rm -f debian/libmgl-dev/usr/include/mgl/mgl_fltk.h - rm -f debian/libmgl-dev/usr/include/mgl/mgl_glut.h - rm -f debian/libmgl-dev/usr/include/mgl/mgl_qt.h - rm -f debian/libmgl-dev/usr/include/mgl/mgl_wx.h diff --git a/emblem.mgl b/emblem.mgl deleted file mode 100644 index dcc45ad..0000000 --- a/emblem.mgl +++ /dev/null @@ -1,39 +0,0 @@ -setsize 1000 500 -text 0.75 0.8 'MathGL' 'ia' -5 -text 0.05 0.15 'library\n for scientific graphics' 'Lia' -3 -#rect 0.05 0.9 2 1.5 1.34 2 'w' -xtick -3:ytick -3:ztick -3 - -stickplot 3 0 60 20:box -new y 50: fill y '-cos(pi*x-pi/4)' -new x 50: fill x '-sin(pi*x-pi/4)' -new z 50: fill z '2*x^2-1' - -area x y z 'lG' -plot x y z 'B2s' - -stickplot 3 1 60 20:box - -new aa 50 40 -modify aa '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))' -mirror aa 'y' -light on :alpha on -surf aa 'BbcyrR';alpha 0.8 -cont aa 'y' - -stickplot 3 2 60 20:box -rotate 0 20 - -new a 61 51 40 -modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)' - -alpha on:light off -cloud a 'wyrRk' - -stop -cut 0 -1 -1 1 0 1.1 -surf3 a -1 'BbcyrR' -contf3 a 'x' -1 -contf3 a 'y' -1 -contf3 a 'z' 0 -contf3 a 'z' 39 diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index cc0e548..74a36cf 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -15,9 +15,7 @@ install( if(use_fltk) add_executable(mgl_fltk_example wnd_samples.cpp fltk_example.cpp) - target_link_libraries(mgl_fltk_example mgl-fltk) - add_executable(test main.cpp) - target_link_libraries(test mgl-fltk) + target_link_libraries(mgl_fltk_example mgl-wnd) install( TARGETS mgl_fltk_example RUNTIME DESTINATION bin @@ -36,7 +34,7 @@ endif(use_glut) if(use_wx) include(${wxWidgets_USE_FILE}) add_executable(mgl_wx_example wnd_samples.cpp wx_example.cpp) - target_link_libraries(mgl_wx_example ${wxWidgets_LIBRARIES} mgl-wx) + target_link_libraries(mgl_wx_example ${wxWidgets_LIBRARIES} mgl-wnd) install( TARGETS mgl_wx_example RUNTIME DESTINATION bin @@ -45,9 +43,9 @@ endif(use_wx) if(use_qt) include(${QT_USE_FILE}) - qt_wrap_cpp(mgl_qt_example MGL_MOC_EX_FILES ../include/mgl/mgl_qt.h) + qt_wrap_cpp(mgl_qt_example MGL_MOC_EX_FILES ../include/mgl/qt.h) add_executable(mgl_qt_example wnd_samples.cpp qt_example.cpp ${MGL_MOC_EX_FILES}) - target_link_libraries(mgl_qt_example ${QT_LIBRARIES} mgl-qt) + target_link_libraries(mgl_qt_example ${QT_LIBRARIES} mgl-wnd) install( TARGETS mgl_qt_example RUNTIME DESTINATION bin diff --git a/examples/Makefile.am b/examples/Makefile.am index 1385c30..9d1485e 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -3,44 +3,44 @@ 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)/mgl/libmgl.la +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-fltk.la $(top_builddir)/mgl/libmgl.la +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-fltk.la $(top_builddir)/mgl/libmgl.la +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-glut.la $(top_builddir)/mgl/libmgl.la -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-wx.la $(top_builddir)/mgl/libmgl.la -mgl_wx_example_CXXFLAGS = $(WX_FLAGS) $(AM_CXXFLAGS) -mgl_wx_example_SOURCES = wnd_samples.cpp wx_example.cpp -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/mgl_qt.moc.cpp $(top_srcdir)/include/mgl/mgl_qt.h qt_example.cpp -mgl_qt_example_LDADD = $(QT_LIBS) $(top_builddir)/widgets/libmgl-qt.la $(top_builddir)/mgl/libmgl.la +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/mgl_qt.moc.cpp +BUILT_SOURCES = $(top_builddir)/include/mgl/qt.moc.cpp CLEANFILES = $(BUILT_SOURCES) endif diff --git a/examples/Makefile.in b/examples/Makefile.in index 72e3be3..e4406b9 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -53,16 +53,13 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -check_PROGRAMS = $(am__EXEEXT_5) -bin_PROGRAMS = mgl_example$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \ - $(am__EXEEXT_3) $(am__EXEEXT_4) +check_PROGRAMS = $(am__EXEEXT_3) +bin_PROGRAMS = mgl_example$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) @USE_FLTK_TRUE@am__append_1 = mgl_fltk_example @USE_FLTK_TRUE@am__append_2 = test -@USE_GLUT_TRUE@am__append_3 = mgl_glut_example -@USE_WX_TRUE@am__append_4 = mgl_wx_example DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/autotroll.mk -@USE_QT_TRUE@am__append_5 = mgl_qt_example +@USE_QT_TRUE@am__append_3 = mgl_qt_example subdir = examples ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/autotroll.m4 \ @@ -74,15 +71,13 @@ CONFIG_HEADER = $(top_builddir)/include/mgl/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @USE_FLTK_TRUE@am__EXEEXT_1 = mgl_fltk_example$(EXEEXT) -@USE_GLUT_TRUE@am__EXEEXT_2 = mgl_glut_example$(EXEEXT) -@USE_WX_TRUE@am__EXEEXT_3 = mgl_wx_example$(EXEEXT) -@USE_QT_TRUE@am__EXEEXT_4 = mgl_qt_example$(EXEEXT) +@USE_QT_TRUE@am__EXEEXT_2 = mgl_qt_example$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" -@USE_FLTK_TRUE@am__EXEEXT_5 = test$(EXEEXT) +@USE_FLTK_TRUE@am__EXEEXT_3 = test$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_mgl_example_OBJECTS = wnd_samples.$(OBJEXT) full_test.$(OBJEXT) mgl_example_OBJECTS = $(am_mgl_example_OBJECTS) -mgl_example_DEPENDENCIES = $(top_builddir)/mgl/libmgl.la +mgl_example_DEPENDENCIES = $(top_builddir)/src/libmgl.la am__mgl_fltk_example_SOURCES_DIST = wnd_samples.cpp fltk_example.cpp @USE_FLTK_TRUE@am_mgl_fltk_example_OBJECTS = \ @USE_FLTK_TRUE@ mgl_fltk_example-wnd_samples.$(OBJEXT) \ @@ -90,53 +85,34 @@ am__mgl_fltk_example_SOURCES_DIST = wnd_samples.cpp fltk_example.cpp mgl_fltk_example_OBJECTS = $(am_mgl_fltk_example_OBJECTS) am__DEPENDENCIES_1 = @USE_FLTK_TRUE@mgl_fltk_example_DEPENDENCIES = $(am__DEPENDENCIES_1) \ -@USE_FLTK_TRUE@ $(top_builddir)/widgets/libmgl-fltk.la \ -@USE_FLTK_TRUE@ $(top_builddir)/mgl/libmgl.la +@USE_FLTK_TRUE@ $(top_builddir)/widgets/libmgl-wnd.la \ +@USE_FLTK_TRUE@ $(top_builddir)/src/libmgl.la mgl_fltk_example_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(mgl_fltk_example_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -am__mgl_glut_example_SOURCES_DIST = wnd_samples.cpp glut_example.cpp -@USE_GLUT_TRUE@am_mgl_glut_example_OBJECTS = wnd_samples.$(OBJEXT) \ -@USE_GLUT_TRUE@ glut_example.$(OBJEXT) -mgl_glut_example_OBJECTS = $(am_mgl_glut_example_OBJECTS) -@USE_GLUT_TRUE@mgl_glut_example_DEPENDENCIES = \ -@USE_GLUT_TRUE@ $(top_builddir)/widgets/libmgl-glut.la \ -@USE_GLUT_TRUE@ $(top_builddir)/mgl/libmgl.la am__mgl_qt_example_SOURCES_DIST = wnd_samples.cpp \ - $(top_builddir)/include/mgl/mgl_qt.moc.cpp \ - $(top_srcdir)/include/mgl/mgl_qt.h qt_example.cpp + $(top_builddir)/include/mgl/qt.moc.cpp \ + $(top_srcdir)/include/mgl/qt.h qt_example.cpp @USE_QT_TRUE@am_mgl_qt_example_OBJECTS = \ @USE_QT_TRUE@ mgl_qt_example-wnd_samples.$(OBJEXT) \ -@USE_QT_TRUE@ mgl_qt_example-mgl_qt.moc.$(OBJEXT) \ +@USE_QT_TRUE@ mgl_qt_example-qt.moc.$(OBJEXT) \ @USE_QT_TRUE@ mgl_qt_example-qt_example.$(OBJEXT) mgl_qt_example_OBJECTS = $(am_mgl_qt_example_OBJECTS) @USE_QT_TRUE@mgl_qt_example_DEPENDENCIES = $(am__DEPENDENCIES_1) \ -@USE_QT_TRUE@ $(top_builddir)/widgets/libmgl-qt.la \ -@USE_QT_TRUE@ $(top_builddir)/mgl/libmgl.la +@USE_QT_TRUE@ $(top_builddir)/widgets/libmgl-wnd.la \ +@USE_QT_TRUE@ $(top_builddir)/src/libmgl.la mgl_qt_example_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(mgl_qt_example_CXXFLAGS) $(CXXFLAGS) \ $(mgl_qt_example_LDFLAGS) $(LDFLAGS) -o $@ -am__mgl_wx_example_SOURCES_DIST = wnd_samples.cpp wx_example.cpp -@USE_WX_TRUE@am_mgl_wx_example_OBJECTS = \ -@USE_WX_TRUE@ mgl_wx_example-wnd_samples.$(OBJEXT) \ -@USE_WX_TRUE@ mgl_wx_example-wx_example.$(OBJEXT) -mgl_wx_example_OBJECTS = $(am_mgl_wx_example_OBJECTS) -@USE_WX_TRUE@mgl_wx_example_DEPENDENCIES = $(am__DEPENDENCIES_1) \ -@USE_WX_TRUE@ $(top_builddir)/widgets/libmgl-wx.la \ -@USE_WX_TRUE@ $(top_builddir)/mgl/libmgl.la -mgl_wx_example_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ - $(mgl_wx_example_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ am__test_SOURCES_DIST = wnd_samples.cpp main.cpp @USE_FLTK_TRUE@am_test_OBJECTS = test-wnd_samples.$(OBJEXT) \ @USE_FLTK_TRUE@ test-main.$(OBJEXT) test_OBJECTS = $(am_test_OBJECTS) @USE_FLTK_TRUE@test_DEPENDENCIES = $(am__DEPENDENCIES_1) \ -@USE_FLTK_TRUE@ $(top_builddir)/widgets/libmgl-fltk.la \ -@USE_FLTK_TRUE@ $(top_builddir)/mgl/libmgl.la +@USE_FLTK_TRUE@ $(top_builddir)/widgets/libmgl-wnd.la \ +@USE_FLTK_TRUE@ $(top_builddir)/src/libmgl.la test_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(test_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ @@ -163,13 +139,10 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(mgl_example_SOURCES) $(mgl_fltk_example_SOURCES) \ - $(mgl_glut_example_SOURCES) $(mgl_qt_example_SOURCES) \ - $(mgl_wx_example_SOURCES) $(test_SOURCES) + $(mgl_qt_example_SOURCES) $(test_SOURCES) DIST_SOURCES = $(mgl_example_SOURCES) \ $(am__mgl_fltk_example_SOURCES_DIST) \ - $(am__mgl_glut_example_SOURCES_DIST) \ - $(am__mgl_qt_example_SOURCES_DIST) \ - $(am__mgl_wx_example_SOURCES_DIST) $(am__test_SOURCES_DIST) + $(am__mgl_qt_example_SOURCES_DIST) $(am__test_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -206,10 +179,6 @@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLTK_FLAGS = @FLTK_FLAGS@ FLTK_LIBS = @FLTK_LIBS@ -GIF_FLAGS = @GIF_FLAGS@ -GIF_LIBS = @GIF_LIBS@ -GLUT_FLAGS = @GLUT_FLAGS@ -GLUT_LIBS = @GLUT_LIBS@ GL_LIBS = @GL_LIBS@ GREP = @GREP@ GSL_FLAGS = @GSL_FLAGS@ @@ -235,7 +204,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MGL_AGE = @MGL_AGE@ MGL_CURRENT = @MGL_CURRENT@ MGL_RELEASE = @MGL_RELEASE@ @@ -290,13 +258,10 @@ TMPDIR = @TMPDIR@ U3D_LIBS = @U3D_LIBS@ UIC = @UIC@ VERSION = @VERSION@ -WX_FLAGS = @WX_FLAGS@ -WX_LIBS = @WX_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -330,6 +295,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -350,18 +316,13 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ mgl_example_SOURCES = wnd_samples.cpp full_test.cpp -mgl_example_LDADD = $(top_builddir)/mgl/libmgl.la +mgl_example_LDADD = $(top_builddir)/src/libmgl.la @USE_FLTK_TRUE@mgl_fltk_example_SOURCES = wnd_samples.cpp fltk_example.cpp -@USE_FLTK_TRUE@mgl_fltk_example_LDADD = $(FLTK_LIBS) $(top_builddir)/widgets/libmgl-fltk.la $(top_builddir)/mgl/libmgl.la +@USE_FLTK_TRUE@mgl_fltk_example_LDADD = $(FLTK_LIBS) $(top_builddir)/widgets/libmgl-wnd.la $(top_builddir)/src/libmgl.la @USE_FLTK_TRUE@mgl_fltk_example_CXXFLAGS = $(FLTK_FLAGS) $(AM_CXXFLAGS) @USE_FLTK_TRUE@test_SOURCES = wnd_samples.cpp main.cpp -@USE_FLTK_TRUE@test_LDADD = $(FLTK_LIBS) $(top_builddir)/widgets/libmgl-fltk.la $(top_builddir)/mgl/libmgl.la +@USE_FLTK_TRUE@test_LDADD = $(FLTK_LIBS) $(top_builddir)/widgets/libmgl-wnd.la $(top_builddir)/src/libmgl.la @USE_FLTK_TRUE@test_CXXFLAGS = $(FLTK_FLAGS) $(AM_CXXFLAGS) -@USE_GLUT_TRUE@mgl_glut_example_SOURCES = wnd_samples.cpp glut_example.cpp -@USE_GLUT_TRUE@mgl_glut_example_LDADD = $(top_builddir)/widgets/libmgl-glut.la $(top_builddir)/mgl/libmgl.la -@USE_WX_TRUE@mgl_wx_example_LDADD = $(WX_LIBS) $(top_builddir)/widgets/libmgl-wx.la $(top_builddir)/mgl/libmgl.la -@USE_WX_TRUE@mgl_wx_example_CXXFLAGS = $(WX_FLAGS) $(AM_CXXFLAGS) -@USE_WX_TRUE@mgl_wx_example_SOURCES = wnd_samples.cpp wx_example.cpp # See autotroll.m4 :) @USE_QT_TRUE@SUFFIXES = .moc.cpp .moc.cc .moc.cxx .moc.C .h .hh \ @@ -369,13 +330,26 @@ mgl_example_LDADD = $(top_builddir)/mgl/libmgl.la @USE_QT_TRUE@ .qrc .qrc.cpp .qrc.cc .qrc.cxx .qrc.C @USE_QT_TRUE@DISTCLEANFILES = $(BUILT_SOURCES) + +#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 @USE_QT_TRUE@ACLOCAL_AMFLAGS = -I $(top_srcdir)/config/ -@USE_QT_TRUE@mgl_qt_example_SOURCES = wnd_samples.cpp $(top_builddir)/include/mgl/mgl_qt.moc.cpp $(top_srcdir)/include/mgl/mgl_qt.h qt_example.cpp -@USE_QT_TRUE@mgl_qt_example_LDADD = $(QT_LIBS) $(top_builddir)/widgets/libmgl-qt.la $(top_builddir)/mgl/libmgl.la +@USE_QT_TRUE@mgl_qt_example_SOURCES = wnd_samples.cpp $(top_builddir)/include/mgl/qt.moc.cpp $(top_srcdir)/include/mgl/qt.h qt_example.cpp +@USE_QT_TRUE@mgl_qt_example_LDADD = $(QT_LIBS) $(top_builddir)/widgets/libmgl-wnd.la $(top_builddir)/src/libmgl.la @USE_QT_TRUE@mgl_qt_example_LDFLAGS = $(QT_LDFLAGS) @USE_QT_TRUE@mgl_qt_example_CPPFLAGS = $(QT_CPPFLAGS) $(AM_CPPFLAGS) @USE_QT_TRUE@mgl_qt_example_CXXFLAGS = $(QT_CXXFLAGS) $(AM_CXXFLAGS) -@USE_QT_TRUE@BUILT_SOURCES = $(top_builddir)/include/mgl/mgl_qt.moc.cpp +@USE_QT_TRUE@BUILT_SOURCES = $(top_builddir)/include/mgl/qt.moc.cpp @USE_QT_TRUE@CLEANFILES = $(BUILT_SOURCES) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am @@ -470,15 +444,9 @@ mgl_example$(EXEEXT): $(mgl_example_OBJECTS) $(mgl_example_DEPENDENCIES) mgl_fltk_example$(EXEEXT): $(mgl_fltk_example_OBJECTS) $(mgl_fltk_example_DEPENDENCIES) @rm -f mgl_fltk_example$(EXEEXT) $(mgl_fltk_example_LINK) $(mgl_fltk_example_OBJECTS) $(mgl_fltk_example_LDADD) $(LIBS) -mgl_glut_example$(EXEEXT): $(mgl_glut_example_OBJECTS) $(mgl_glut_example_DEPENDENCIES) - @rm -f mgl_glut_example$(EXEEXT) - $(CXXLINK) $(mgl_glut_example_OBJECTS) $(mgl_glut_example_LDADD) $(LIBS) mgl_qt_example$(EXEEXT): $(mgl_qt_example_OBJECTS) $(mgl_qt_example_DEPENDENCIES) @rm -f mgl_qt_example$(EXEEXT) $(mgl_qt_example_LINK) $(mgl_qt_example_OBJECTS) $(mgl_qt_example_LDADD) $(LIBS) -mgl_wx_example$(EXEEXT): $(mgl_wx_example_OBJECTS) $(mgl_wx_example_DEPENDENCIES) - @rm -f mgl_wx_example$(EXEEXT) - $(mgl_wx_example_LINK) $(mgl_wx_example_OBJECTS) $(mgl_wx_example_LDADD) $(LIBS) test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) @rm -f test$(EXEEXT) $(test_LINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) @@ -490,14 +458,11 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/full_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glut_example.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mgl_fltk_example-fltk_example.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mgl_fltk_example-wnd_samples.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mgl_qt_example-mgl_qt.moc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mgl_qt_example-qt.moc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mgl_qt_example-qt_example.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mgl_qt_example-wnd_samples.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mgl_wx_example-wnd_samples.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mgl_wx_example-wx_example.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wnd_samples.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wnd_samples.Po@am__quote@ @@ -565,19 +530,19 @@ mgl_qt_example-wnd_samples.obj: wnd_samples.cpp @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mgl_qt_example_CPPFLAGS) $(CPPFLAGS) $(mgl_qt_example_CXXFLAGS) $(CXXFLAGS) -c -o mgl_qt_example-wnd_samples.obj `if test -f 'wnd_samples.cpp'; then $(CYGPATH_W) 'wnd_samples.cpp'; else $(CYGPATH_W) '$(srcdir)/wnd_samples.cpp'; fi` -mgl_qt_example-mgl_qt.moc.o: $(top_builddir)/include/mgl/mgl_qt.moc.cpp -@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mgl_qt_example_CPPFLAGS) $(CPPFLAGS) $(mgl_qt_example_CXXFLAGS) $(CXXFLAGS) -MT mgl_qt_example-mgl_qt.moc.o -MD -MP -MF $(DEPDIR)/mgl_qt_example-mgl_qt.moc.Tpo -c -o mgl_qt_example-mgl_qt.moc.o `test -f '$(top_builddir)/include/mgl/mgl_qt.moc.cpp' || echo '$(srcdir)/'`$(top_builddir)/include/mgl/mgl_qt.moc.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/mgl_qt_example-mgl_qt.moc.Tpo $(DEPDIR)/mgl_qt_example-mgl_qt.moc.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(top_builddir)/include/mgl/mgl_qt.moc.cpp' object='mgl_qt_example-mgl_qt.moc.o' libtool=no @AMDEPBACKSLASH@ +mgl_qt_example-qt.moc.o: $(top_builddir)/include/mgl/qt.moc.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mgl_qt_example_CPPFLAGS) $(CPPFLAGS) $(mgl_qt_example_CXXFLAGS) $(CXXFLAGS) -MT mgl_qt_example-qt.moc.o -MD -MP -MF $(DEPDIR)/mgl_qt_example-qt.moc.Tpo -c -o mgl_qt_example-qt.moc.o `test -f '$(top_builddir)/include/mgl/qt.moc.cpp' || echo '$(srcdir)/'`$(top_builddir)/include/mgl/qt.moc.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/mgl_qt_example-qt.moc.Tpo $(DEPDIR)/mgl_qt_example-qt.moc.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(top_builddir)/include/mgl/qt.moc.cpp' object='mgl_qt_example-qt.moc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mgl_qt_example_CPPFLAGS) $(CPPFLAGS) $(mgl_qt_example_CXXFLAGS) $(CXXFLAGS) -c -o mgl_qt_example-mgl_qt.moc.o `test -f '$(top_builddir)/include/mgl/mgl_qt.moc.cpp' || echo '$(srcdir)/'`$(top_builddir)/include/mgl/mgl_qt.moc.cpp +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mgl_qt_example_CPPFLAGS) $(CPPFLAGS) $(mgl_qt_example_CXXFLAGS) $(CXXFLAGS) -c -o mgl_qt_example-qt.moc.o `test -f '$(top_builddir)/include/mgl/qt.moc.cpp' || echo '$(srcdir)/'`$(top_builddir)/include/mgl/qt.moc.cpp -mgl_qt_example-mgl_qt.moc.obj: $(top_builddir)/include/mgl/mgl_qt.moc.cpp -@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mgl_qt_example_CPPFLAGS) $(CPPFLAGS) $(mgl_qt_example_CXXFLAGS) $(CXXFLAGS) -MT mgl_qt_example-mgl_qt.moc.obj -MD -MP -MF $(DEPDIR)/mgl_qt_example-mgl_qt.moc.Tpo -c -o mgl_qt_example-mgl_qt.moc.obj `if test -f '$(top_builddir)/include/mgl/mgl_qt.moc.cpp'; then $(CYGPATH_W) '$(top_builddir)/include/mgl/mgl_qt.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/include/mgl/mgl_qt.moc.cpp'; fi` -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/mgl_qt_example-mgl_qt.moc.Tpo $(DEPDIR)/mgl_qt_example-mgl_qt.moc.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(top_builddir)/include/mgl/mgl_qt.moc.cpp' object='mgl_qt_example-mgl_qt.moc.obj' libtool=no @AMDEPBACKSLASH@ +mgl_qt_example-qt.moc.obj: $(top_builddir)/include/mgl/qt.moc.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mgl_qt_example_CPPFLAGS) $(CPPFLAGS) $(mgl_qt_example_CXXFLAGS) $(CXXFLAGS) -MT mgl_qt_example-qt.moc.obj -MD -MP -MF $(DEPDIR)/mgl_qt_example-qt.moc.Tpo -c -o mgl_qt_example-qt.moc.obj `if test -f '$(top_builddir)/include/mgl/qt.moc.cpp'; then $(CYGPATH_W) '$(top_builddir)/include/mgl/qt.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/include/mgl/qt.moc.cpp'; fi` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/mgl_qt_example-qt.moc.Tpo $(DEPDIR)/mgl_qt_example-qt.moc.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(top_builddir)/include/mgl/qt.moc.cpp' object='mgl_qt_example-qt.moc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mgl_qt_example_CPPFLAGS) $(CPPFLAGS) $(mgl_qt_example_CXXFLAGS) $(CXXFLAGS) -c -o mgl_qt_example-mgl_qt.moc.obj `if test -f '$(top_builddir)/include/mgl/mgl_qt.moc.cpp'; then $(CYGPATH_W) '$(top_builddir)/include/mgl/mgl_qt.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/include/mgl/mgl_qt.moc.cpp'; fi` +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mgl_qt_example_CPPFLAGS) $(CPPFLAGS) $(mgl_qt_example_CXXFLAGS) $(CXXFLAGS) -c -o mgl_qt_example-qt.moc.obj `if test -f '$(top_builddir)/include/mgl/qt.moc.cpp'; then $(CYGPATH_W) '$(top_builddir)/include/mgl/qt.moc.cpp'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/include/mgl/qt.moc.cpp'; fi` mgl_qt_example-qt_example.o: qt_example.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mgl_qt_example_CPPFLAGS) $(CPPFLAGS) $(mgl_qt_example_CXXFLAGS) $(CXXFLAGS) -MT mgl_qt_example-qt_example.o -MD -MP -MF $(DEPDIR)/mgl_qt_example-qt_example.Tpo -c -o mgl_qt_example-qt_example.o `test -f 'qt_example.cpp' || echo '$(srcdir)/'`qt_example.cpp @@ -593,34 +558,6 @@ mgl_qt_example-qt_example.obj: qt_example.cpp @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mgl_qt_example_CPPFLAGS) $(CPPFLAGS) $(mgl_qt_example_CXXFLAGS) $(CXXFLAGS) -c -o mgl_qt_example-qt_example.obj `if test -f 'qt_example.cpp'; then $(CYGPATH_W) 'qt_example.cpp'; else $(CYGPATH_W) '$(srcdir)/qt_example.cpp'; fi` -mgl_wx_example-wnd_samples.o: wnd_samples.cpp -@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mgl_wx_example_CXXFLAGS) $(CXXFLAGS) -MT mgl_wx_example-wnd_samples.o -MD -MP -MF $(DEPDIR)/mgl_wx_example-wnd_samples.Tpo -c -o mgl_wx_example-wnd_samples.o `test -f 'wnd_samples.cpp' || echo '$(srcdir)/'`wnd_samples.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/mgl_wx_example-wnd_samples.Tpo $(DEPDIR)/mgl_wx_example-wnd_samples.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='wnd_samples.cpp' object='mgl_wx_example-wnd_samples.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mgl_wx_example_CXXFLAGS) $(CXXFLAGS) -c -o mgl_wx_example-wnd_samples.o `test -f 'wnd_samples.cpp' || echo '$(srcdir)/'`wnd_samples.cpp - -mgl_wx_example-wnd_samples.obj: wnd_samples.cpp -@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mgl_wx_example_CXXFLAGS) $(CXXFLAGS) -MT mgl_wx_example-wnd_samples.obj -MD -MP -MF $(DEPDIR)/mgl_wx_example-wnd_samples.Tpo -c -o mgl_wx_example-wnd_samples.obj `if test -f 'wnd_samples.cpp'; then $(CYGPATH_W) 'wnd_samples.cpp'; else $(CYGPATH_W) '$(srcdir)/wnd_samples.cpp'; fi` -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/mgl_wx_example-wnd_samples.Tpo $(DEPDIR)/mgl_wx_example-wnd_samples.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='wnd_samples.cpp' object='mgl_wx_example-wnd_samples.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mgl_wx_example_CXXFLAGS) $(CXXFLAGS) -c -o mgl_wx_example-wnd_samples.obj `if test -f 'wnd_samples.cpp'; then $(CYGPATH_W) 'wnd_samples.cpp'; else $(CYGPATH_W) '$(srcdir)/wnd_samples.cpp'; fi` - -mgl_wx_example-wx_example.o: wx_example.cpp -@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mgl_wx_example_CXXFLAGS) $(CXXFLAGS) -MT mgl_wx_example-wx_example.o -MD -MP -MF $(DEPDIR)/mgl_wx_example-wx_example.Tpo -c -o mgl_wx_example-wx_example.o `test -f 'wx_example.cpp' || echo '$(srcdir)/'`wx_example.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/mgl_wx_example-wx_example.Tpo $(DEPDIR)/mgl_wx_example-wx_example.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='wx_example.cpp' object='mgl_wx_example-wx_example.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mgl_wx_example_CXXFLAGS) $(CXXFLAGS) -c -o mgl_wx_example-wx_example.o `test -f 'wx_example.cpp' || echo '$(srcdir)/'`wx_example.cpp - -mgl_wx_example-wx_example.obj: wx_example.cpp -@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mgl_wx_example_CXXFLAGS) $(CXXFLAGS) -MT mgl_wx_example-wx_example.obj -MD -MP -MF $(DEPDIR)/mgl_wx_example-wx_example.Tpo -c -o mgl_wx_example-wx_example.obj `if test -f 'wx_example.cpp'; then $(CYGPATH_W) 'wx_example.cpp'; else $(CYGPATH_W) '$(srcdir)/wx_example.cpp'; fi` -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/mgl_wx_example-wx_example.Tpo $(DEPDIR)/mgl_wx_example-wx_example.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='wx_example.cpp' object='mgl_wx_example-wx_example.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mgl_wx_example_CXXFLAGS) $(CXXFLAGS) -c -o mgl_wx_example-wx_example.obj `if test -f 'wx_example.cpp'; then $(CYGPATH_W) 'wx_example.cpp'; else $(CYGPATH_W) '$(srcdir)/wx_example.cpp'; fi` - test-wnd_samples.o: wnd_samples.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CXXFLAGS) $(CXXFLAGS) -MT test-wnd_samples.o -MD -MP -MF $(DEPDIR)/test-wnd_samples.Tpo -c -o test-wnd_samples.o `test -f 'wnd_samples.cpp' || echo '$(srcdir)/'`wnd_samples.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/test-wnd_samples.Tpo $(DEPDIR)/test-wnd_samples.Po diff --git a/examples/fltk_example.cpp b/examples/fltk_example.cpp index 9a54ac7..ce3930d 100644 --- a/examples/fltk_example.cpp +++ b/examples/fltk_example.cpp @@ -18,55 +18,56 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include -#include -//----------------------------------------------------------------------------- -int test(mglGraph *gr, void *); -int sample(mglGraph *gr, void *); -int sample_1(mglGraph *gr, void *); -int sample_2(mglGraph *gr, void *); -int sample_3(mglGraph *gr, void *); -int sample_d(mglGraph *gr, void *); -//----------------------------------------------------------------------------- -#include -#include -mglPoint pnt; // some global variable for changable data -void *mgl_fltk_tmp(void *) { mglFlRun(); return 0; } -//----------------------------------------------------------------------------- +#include "mgl/mgl.h" +#include "mgl/fltk.h" +//----------------------------------------------------------------------------- +int test_wnd(mglGraph *gr); +int sample(mglGraph *gr); +int sample_1(mglGraph *gr); +int sample_2(mglGraph *gr); +int sample_3(mglGraph *gr); +int sample_d(mglGraph *gr); +//----------------------------------------------------------------------------- +#include +mglPoint pnt; // some global variable for changable data +void *mgl_fltk_tmp(void *) { mgl_fltk_run(); return 0; } +//----------------------------------------------------------------------------- int main(int argc,char **argv) -{ +{ #ifdef PTHREAD_SAMPLE - mglGraphFLTK gr; - gr.Window(argc,argv,NULL,"test",0,0); // create window - gr.ClfOnUpdate = false; - static pthread_t tmp; - pthread_create(&tmp, 0, mgl_fltk_tmp, 0); - pthread_detach(tmp); // run window handling in the separate thread - for(int i=0;i<10;i++) // do calculation - { - sleep(2); // which can be very long - pnt = mglPoint(2*mgl_rnd()-1,2*mgl_rnd()-1); - gr.Clf(); // make new drawing - gr.Line(mglPoint(),pnt,"Ar2"); - char str[10] = "i=0"; str[3] = '0'+i; - gr.Text(mglPoint(),""); - gr.Update(); // update window - } - return 0; // finish calculations and close the window*/ -#else mglGraphFLTK gr; + gr.Window(argc,argv,NULL,"test",0,0); // create window + gr.ClfOnUpdate = false; + static pthread_t tmp; + pthread_create(&tmp, 0, mgl_fltk_tmp, 0); + pthread_detach(tmp); // run window handling in the separate thread + for(int i=0;i<10;i++) // do calculation + { + sleep(2); // which can be very long + pnt = mglPoint(2*mgl_rnd()-1,2*mgl_rnd()-1); + gr.Clf(); // make new drawing + gr.Line(mglPoint(),pnt,"Ar2"); + char str[10] = "i=0"; str[3] = '0'+i; + gr.Text(mglPoint(),""); + gr.Update(); // update window + } + return 0; // finish calculations and close the window*/ +#else char key = 0; - if(argc>1 && argv[1][0]!='-') key = argv[1][0]; - else printf("You may specify argument '1', '2', '3' or 'd' for viewing examples of 1d, 2d, 3d or dual plotting\n"); + if(argc>1) key = (argv[1][0]!='-') ? argv[1][0] : argv[1][1]; + if(!key) printf("You may specify argument '1', '2', '3' or 'd' for viewing examples of 1d, 2d, 3d or dual plotting\n"); + mglCanvasFL gr; switch(key) { case '1': gr.Window(argc,argv,sample_1,"1D plots"); break; case '2': gr.Window(argc,argv,sample_2,"2D plots"); break; case '3': gr.Window(argc,argv,sample_3,"3D plots"); break; case 'd': gr.Window(argc,argv,sample_d,"Dual plots"); break; - case 't': gr.Window(argc,argv,test,"Testing"); break; + case 't': gr.Window(argc,argv,test_wnd,"Testing"); break; default: gr.Window(argc,argv,sample,"Example of molecules"); break; } - return mglFlRun(); + mgl_fltk_run(); + return 0; #endif } -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- diff --git a/examples/full_test.cpp b/examples/full_test.cpp index df40b81..9b5e26d 100644 --- a/examples/full_test.cpp +++ b/examples/full_test.cpp @@ -1,74 +1,61 @@ -/*************************************************************************** - * full_test.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -//#include -//----------------------------------------------------------------------------- -#include "mgl/mgl_parse.h" -extern mglTeXsymb mgl_tex_symb[]; -int test(mglGraphAB *gr) -{ -mglTestMode=true; - mreal a[100]; // let a_i = sin(4*pi*x), x=0...1 - for(int i=0;i<100;i++)a[i]=sin(4*M_PI*i/99); - mglParse *parser = new mglParse; - mglData &d =(parser->AddVar("dat"))->d; - d.Set(a,100); // set data to variable - parser->Execute(gr, "plot dat; xrange 0 1\nbox\naxis"); - // you may break script at any line do something - // and continue after that - parser->Execute(gr, "xlabel 'x'\nylabel 'y'\nbox"); - // also you may use cycles or conditions in script - parser->Execute(gr, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext"); - delete parser; - return 0; - - mglParse par; - par.AllowSetSize = true; - FILE *fp=fopen("test.mgl","rt"); - par.Execute(gr,fp,true); - fclose(fp); -/* gr->SetDrawReg(2,2,1); - gr->Rotate(40,60); - gr->Surf("sin(x*y)"); - gr->SubPlot(2,2,1); gr->Box();*/ - -// gr->Box(); -// gr->ShowImage("",true); - return 0; -} -//============================================================================= -struct mglSample /// Structure for list of samples -{ - const char *name; - void (*func)(mglGraph*); -}; -//----------------------------------------------------------------------------- +/*************************************************************************** + * full_test.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include "mgl/mgl.h" +//#include +#include "mgl/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); +void mgls_prepare3d(mglData *a, mglData *b=0); +void mgls_prepare2v(mglData *a, mglData *b); +void mgls_prepare3v(mglData *ex, mglData *ey, mglData *ez); +//----------------------------------------------------------------------------- +int test(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->Box(); gr->Plot(y.SubData(-1,0)); + gr->Text(y,"This is very very long string drawn along a curve",":k"); +// gr->Text(y,"Another string drawn above a curve","T:r"); + return 0; + + mglParse par(true); + FILE *fp=fopen("test.mgl","rt"); + par.Execute(gr,fp,true); + fclose(fp); + gr->ShowImage("",true); + return 0; +} +//============================================================================= +struct mglSample /// Structure for list of samples +{ + const char *name; + void (*func)(mglGraph*); +}; +//----------------------------------------------------------------------------- int mgl_cmd_smp(const void *a, const void *b) { const mglSample *aa = (const mglSample *)a; @@ -76,1911 +63,1810 @@ int mgl_cmd_smp(const void *a, const void *b) return strcmp(aa->name, bb->name); } //----------------------------------------------------------------------------- -extern mglSample samp[]; -int type = 0; -int dotest = 0; -int width = 600; -int height = 400; -int mini = 0; -int big = 0; -int srnd = 0; -mglData s; -//----------------------------------------------------------------------------- -static struct option longopts[] = -{ - { "test", no_argument, &dotest, 1 }, - { "srnd", no_argument, &srnd, 1 }, - { "width", required_argument, NULL, 'w' }, - { "height", required_argument, NULL, 'h' }, - { "list", no_argument, NULL, 'l' }, - { "kind", required_argument, NULL, 'k' }, - { "thread", required_argument, NULL, 't' }, - { "mini", no_argument, &mini, 1 }, - { "big", no_argument, &big, 1 }, - { "png", no_argument, &type, 0 }, - { "eps", no_argument, &type, 1 }, - { "svg", no_argument, &type, 2 }, - { "solid", no_argument, &type, 3 }, - { "jpeg", no_argument, &type, 4 }, - { "idtf", no_argument, &type, 5 }, - { "gif", no_argument, &type, 6 }, - { "none", no_argument, &type, 7 }, - { "bps", no_argument, &type, 8 }, - { "u3d", no_argument, &type, 9 }, - { "pdf", no_argument, &type, 10 }, - { "help", no_argument, NULL, '?' }, - { NULL, 0, NULL, 0 } -}; -//----------------------------------------------------------------------------- -void usage() -{ - puts ( \ - "-png - output png\n" \ - "-width=num - png picture width\n" \ - "-height=num - png picture height\n" \ - "-mini - png picture is 200x133\n" \ - "-big - png picture is 1200x800\n" \ - "-idtf - output idtf\n" \ - "-u3d - output u3d\n" \ - "-pdf - output pdf\n" \ - "-eps - output EPS\n" \ - "-jpeg - output JPEG\n" \ - "-solid - output solid PNG\n" \ - "-svg - output SVG\n" \ - "-none - none output\n" \ - "-srnd - use the same random numbers in any run\n" \ - "-kind=name - produce only this picture" \ - "-thread=num - number of threads used" \ - "-test - perform test\n" - ); -// exit(0); -}; -//----------------------------------------------------------------------------- -void save(mglGraph *gr,const char *name,const char *suf="") -{ -// return; - char buf[128]; - printf("%s ",name); fflush(stdout); - switch(type) - { - case 1: // EPS - sprintf(buf,"%s%s.eps",name,suf); - gr->WriteEPS(buf); - break; - case 2: // SVG - sprintf(buf,"%s%s.svg",name,suf); - gr->WriteSVG(buf); break; - case 3: // PNG - sprintf(buf,"%s%s.png",name,suf); - gr->WritePNG(buf,0,true); break; - case 4: // JPEG - sprintf(buf,"%s%s.jpg",name,suf); - gr->WriteJPEG(buf); break; - case 5: // IDTF - sprintf(buf,"%s%s.idtf",name,suf); - gr->WriteIDTF(buf); break; - case 6: // GIF - sprintf(buf,"%s%s.gif",name,suf); - gr->WriteGIF(buf); break; - case 7: // none - break; - case 8: // EPS to PNG - sprintf(buf,"%s%s.png",name,suf); - gr->WritePNG(buf,0,false); - break; - case 9: // U3D - sprintf(buf,"%s%s.u3d",name,suf); - gr->WriteU3D(buf); break; - case 10: // PDF - sprintf(buf,"%s%s.pdf",name,suf); - gr->WritePDF(buf); break; - default:// PNG (no alpha) - sprintf(buf,"%s%s.png",name,suf); - gr->WritePNG(buf,0,false); break; - } -} -//----------------------------------------------------------------------------- -// Sample functions -//----------------------------------------------------------------------------- -void smgl_tval(mglGraph *gr) // ticks features -{ - gr->Axis(mglPoint(-M_PI, 0), mglPoint(M_PI, 2)); - gr->SetTicksVal('x', 6, -M_PI, "-\\pi", -M_PI/2, "-\\pi/2", 0., "0", - 0.886, "x^*", M_PI/2, "\\pi/2", M_PI, "\\pi"); - gr->Axis(); gr->Grid(); - gr->Plot("2*cos(x^2)^2", "r2", NAN, 300); -} -//----------------------------------------------------------------------------- -void smgl_fonts(mglGraph *gr) // ticks features -{ - float h=1.1, d=0.25; - gr->LoadFont("STIX"); gr->Puts(mglPoint(0,h), "default font (STIX)"); - gr->LoadFont("adventor"); gr->Puts(mglPoint(0,h-d), "adventor font"); - gr->LoadFont("bonum"); gr->Puts(mglPoint(0,h-2*d), "bonum font"); - gr->LoadFont("chorus"); gr->Puts(mglPoint(0,h-3*d), "chorus font"); - gr->LoadFont("cursor"); gr->Puts(mglPoint(0,h-4*d), "cursor font"); - gr->LoadFont("heros"); gr->Puts(mglPoint(0,h-5*d), "heros font"); - gr->LoadFont("heroscn"); gr->Puts(mglPoint(0,h-6*d), "heroscn font"); - gr->LoadFont("pagella"); gr->Puts(mglPoint(0,h-7*d), "pagella font"); - gr->LoadFont("schola"); gr->Puts(mglPoint(0,h-8*d), "schola font"); - gr->LoadFont("termes"); gr->Puts(mglPoint(0,h-9*d), "termes font"); - gr->LoadFont("STIX"); -} -//----------------------------------------------------------------------------- -void smgl_stick(mglGraph *gr) // column plot -{ - if(type==5 || type==9 || type==10) - gr->Puts(mglPoint(0,0),"Does not work in 3D\\n for reasons I do not care to investigate till 2.0"); - - gr->SetRanges(-1, 1, -1, 1, 0, 1); gr->Light(true); - gr->StickPlot(3, 0, 40, 30); gr->Axis("xyz_"); - gr->Surf("exp(-10*y^2-6*x^2)"); - gr->Text(mglPoint(0.2, 0, 1.2), "z=0", "", -2); - gr->StickPlot(3, 1, 40, 30); gr->Axis("xyz_"); - gr->Surf("exp(-10*y^2/2-6*x^2)/sqrt(2)"); - gr->Text(mglPoint(0.2, 0, 1.2), "z=1", "", -2); - gr->StickPlot(3, 2, 40, 30); gr->Axis("xyz_"); - gr->Surf("exp(-10*y^2/5-6*x^2)/sqrt(5)"); - gr->Text(mglPoint(0.2, 0, 1.2), "z=2", "", -2); - gr->Label('x',"\\tau", 0); gr->Label('y', "\\rho"); -} -//----------------------------------------------------------------------------- -void smgl_column(mglGraph *gr) // column plot -{ - char str[32]; - for(int i=0;i<4;i++) - { - gr->ColumnPlot(4,i); - gr->Box(); - sprintf(str,"Plot %d of 4",i); - gr->Text(mglPoint(-0.5,0.5),str); - sprintf(str,"sin(pi*x+pi*%d/2)",i); - gr->Plot(str); - } -} -//----------------------------------------------------------------------------- -void smgl_map(mglGraph *gr) // example of mapping -{ - mglData a(50, 40), b(50, 40); - gr->Puts(mglPoint(0, 0), "\\to", "C", -1.4); - gr->Axis(mglPoint(-1,-1,-2),mglPoint(1,1,2)); - - gr->SubPlot(2, 1, 0); - a.Fill("x", gr->Min, gr->Max); b.Fill("y", gr->Min, gr->Max); - gr->Puts(mglPoint(0, 1.1), "\\{x, y\\}", "C", -2); gr->Box(); - gr->Map(a, b, "brgk", 0, false); - - gr->SubPlot(2, 1, 1); - a.Fill("(x^3+y^3)/2", gr->Min, gr->Max); - b.Fill("(x-y)/2", gr->Min, gr->Max); - gr->Puts(mglPoint(0, 1.1), "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", "C", -2); - gr->Box(); - gr->Map(a, b, "brgk", 0, false); -} -//----------------------------------------------------------------------------- -void smgl_color_schemes(mglGraph *gr) // Color table -{ - mglData a(256,2); a.Fill(-1,1); - gr->SubPlot(2,10,0,0.2); gr->Dens(a,"kw"); - gr->Puts(mglPoint(-1.4, -0.3), "kw", "C", -8); - gr->SubPlot(2,10,1,0.2); gr->Dens(a,"wk"); - gr->Puts(mglPoint(-1.4, -0.3), "wk", "C", -8); - gr->SubPlot(2,10,2,0.2); gr->Dens(a,"kHCcw"); - gr->Puts(mglPoint(-1.4, -0.3), "kHCcw", "C", -8); - gr->SubPlot(2,10,3,0.2); gr->Dens(a,"kBbcw"); - gr->Puts(mglPoint(-1.4, -0.3), "kBbcw", "C", -8); - gr->SubPlot(2,10,4,0.2); gr->Dens(a,"kRryw"); - gr->Puts(mglPoint(-1.4, -0.3), "kRryw", "C", -8); - gr->SubPlot(2,10,5,0.2); gr->Dens(a,"kGgew"); - gr->Puts(mglPoint(-1.4, -0.3), "kGgew", "C", -8); - gr->SubPlot(2,10,6,0.2); gr->Dens(a,"BbwrR"); - gr->Puts(mglPoint(-1.4, -0.3), "BbwrR", "C", -8); - gr->SubPlot(2,10,7,0.2); gr->Dens(a,"BbwgG"); - gr->Puts(mglPoint(-1.4, -0.3), "BbwgG", "C", -8); - gr->SubPlot(2,10,8,0.2); gr->Dens(a,"GgwmM"); - gr->Puts(mglPoint(-1.4, -0.3), "GgwmM", "C", -8); - gr->SubPlot(2,10,9,0.2); gr->Dens(a,"UuwqR"); - gr->Puts(mglPoint(-1.4, -0.3), "UuwqR", "C", -8); - gr->SubPlot(2,10,10,0.2); gr->Dens(a,"QqwcC"); - gr->Puts(mglPoint(-1.4, -0.3), "QqwcC", "C", -8); - gr->SubPlot(2,10,11,0.2); gr->Dens(a,"CcwyY"); - gr->Puts(mglPoint(-1.4, -0.3), "CcwyY", "C", -8); - gr->SubPlot(2,10,12,0.2); gr->Dens(a,"bcwyr"); - gr->Puts(mglPoint(-1.4, -0.3), "bcwyr", "C", -8); - gr->SubPlot(2,10,13,0.2); gr->Dens(a,"bwr"); - gr->Puts(mglPoint(-1.4, -0.3), "bwr", "C", -8); - gr->SubPlot(2,10,14,0.2); gr->Dens(a,"BbcyrR"); - gr->Puts(mglPoint(-1.4, -0.3), "BbcyrR", "C", -8); - gr->SubPlot(2,10,15,0.2); gr->Dens(a,"UbcyqR"); - gr->Puts(mglPoint(-1.4, -0.3), "UbcyqR", "C", -8); - gr->SubPlot(2,10,16,0.2); gr->Dens(a,"BbcwyrR"); - gr->Puts(mglPoint(-1.4, -0.3), "BbcwyrR", "C", -8); - gr->SubPlot(2,10,17,0.2); gr->Dens(a,"bcyr"); - gr->Puts(mglPoint(-1.4, -0.3), "bcyr", "C", -8); - gr->SubPlot(2,10,18,0.2); gr->Dens(a,"BbcyrR|"); - gr->Puts(mglPoint(-1.4, -0.3), "BbcyrR|", "C", -8); - gr->SubPlot(2,10,19,0.2); gr->Dens(a,"bgr"); - gr->Puts(mglPoint(-1.4, -0.3), "bgr", "C", -8); -} -//----------------------------------------------------------------------------- -void smgl_colors(mglGraph *gr) // Color table -{ - //#LENUQ - gr->FaceZ(-1, -1, 0, 0.4, 0.3, "L#"); gr->Puts(mglPoint(-0.8,-0.9), "L", "C:w", -1.4); - gr->FaceZ(-0.6, -1, 0, 0.4, 0.3, "E#"); gr->Puts(mglPoint(-0.4,-0.9), "E", "C:w", -1.4); - gr->FaceZ(-0.2, -1, 0, 0.4, 0.3, "N#"); gr->Puts(mglPoint(0, -0.9), "N", "C:w", -1.4); - gr->FaceZ(0.2, -1, 0, 0.4, 0.3, "U#"); gr->Puts(mglPoint(0.4,-0.9), "U", "C:w", -1.4); - gr->FaceZ(0.6, -1, 0, 0.4, 0.3, "Q#"); gr->Puts(mglPoint(0.8,-0.9), "Q", "C:w", -1.4); - //#lenuq - gr->FaceZ(-1, -0.7, 0, 0.4, 0.3, "l#"); gr->Puts(mglPoint(-0.8,-0.6), "l", "C:k", -1.4); - gr->FaceZ(-0.6, -0.7, 0, 0.4, 0.3, "e#"); gr->Puts(mglPoint(-0.4,-0.6), "e", "C:k", -1.4); - gr->FaceZ(-0.2, -0.7, 0, 0.4, 0.3, "n#"); gr->Puts(mglPoint(0, -0.6), "n", "C:k", -1.4); - gr->FaceZ(0.2, -0.7, 0, 0.4, 0.3, "u#"); gr->Puts(mglPoint(0.4,-0.6), "u", "C:k", -1.4); - gr->FaceZ(0.6, -0.7, 0, 0.4, 0.3, "q#"); gr->Puts(mglPoint(0.8,-0.6), "q", "C:k", -1.4); - //#CMYkP - gr->FaceZ(-1, -0.4, 0, 0.4, 0.3, "C#"); gr->Puts(mglPoint(-0.8,-0.3), "C", "C:w", -1.4); - gr->FaceZ(-0.6, -0.4, 0, 0.4, 0.3, "M#"); gr->Puts(mglPoint(-0.4,-0.3), "M", "C:w", -1.4); - gr->FaceZ(-0.2, -0.4, 0, 0.4, 0.3, "Y#"); gr->Puts(mglPoint(0, -0.3), "Y", "C:w", -1.4); - gr->FaceZ(0.2, -0.4, 0, 0.4, 0.3, "k#"); gr->Puts(mglPoint(0.4,-0.3), "k", "C:w", -1.4); - gr->FaceZ(0.6, -0.4, 0, 0.4, 0.3, "P#"); gr->Puts(mglPoint(0.8,-0.3), "P", "C:w", -1.4); - //#cmywp - gr->FaceZ(-1, -0.1, 0, 0.4, 0.3, "c#"); gr->Puts(mglPoint(-0.8, 0), "c", "C:k", -1.4); - gr->FaceZ(-0.6, -0.1, 0, 0.4, 0.3, "m#"); gr->Puts(mglPoint(-0.4, 0), "m", "C:k", -1.4); - gr->FaceZ(-0.2, -0.1, 0, 0.4, 0.3, "y#"); gr->Puts(mglPoint(0, 0), "y", "C:k", -1.4); - gr->FaceZ(0.2, -0.1, 0, 0.4, 0.3, "w#"); gr->Puts(mglPoint(0.4, 0), "w", "C:k", -1.4); - gr->FaceZ(0.6, -0.1, 0, 0.4, 0.3, "p#"); gr->Puts(mglPoint(0.8, 0), "p", "C:k", -1.4); - //#BGRHW - gr->FaceZ(-1, 0.2, 0, 0.4, 0.3, "B#"); gr->Puts(mglPoint(-0.8, 0.3), "B", "C:w", -1.4); - gr->FaceZ(-0.6, 0.2, 0, 0.4, 0.3, "G#"); gr->Puts(mglPoint(-0.4, 0.3), "G", "C:w", -1.4); - gr->FaceZ(-0.2, 0.2, 0, 0.4, 0.3, "R#"); gr->Puts(mglPoint(0, 0.3), "R", "C:w", -1.4); - gr->FaceZ(0.2, 0.2, 0, 0.4, 0.3, "H#"); gr->Puts(mglPoint(0.4, 0.3), "H", "C:w", -1.4); - gr->FaceZ(0.6, 0.2, 0, 0.4, 0.3, "W#"); gr->Puts(mglPoint(0.8, 0.3), "W", "C:w", -1.4); - //#bgrhw - gr->FaceZ(-1, 0.5, 0, 0.4, 0.3, "b#"); gr->Puts(mglPoint(-0.8, 0.6), "b", "C:k", -1.4); - gr->FaceZ(-0.6, 0.5, 0, 0.4, 0.3, "g#"); gr->Puts(mglPoint(-0.4, 0.6), "g", "C:k", -1.4); - gr->FaceZ(-0.2, 0.5, 0, 0.4, 0.3, "r#"); gr->Puts(mglPoint(0, 0.6), "r", "C:k", -1.4); - gr->FaceZ(0.2, 0.5, 0, 0.4, 0.3, "h#"); gr->Puts(mglPoint(0.4, 0.6), "h", "C:k", -1.4); - gr->FaceZ(0.6, 0.5, 0, 0.4, 0.3, "w#"); gr->Puts(mglPoint(0.8, 0.6), "w", "C:k", -1.4); - //#brighted - gr->FaceZ(-1, 0.8, 0, 0.4, 0.3, "r1#"); gr->Puts(mglPoint(-0.8, 0.9), "r1", "C:w", -1.4); - gr->FaceZ(-0.6, 0.8, 0, 0.4, 0.3, "r3#"); gr->Puts(mglPoint(-0.4, 0.9), "r3", "C:w", -1.4); - gr->FaceZ(-0.2, 0.8, 0, 0.4, 0.3, "r5#"); gr->Puts(mglPoint(0, 0.9), "r5", "C:k", -1.4); - gr->FaceZ(0.2, 0.8, 0, 0.4, 0.3, "r7#"); gr->Puts(mglPoint(0.4, 0.9), "r7", "C:k", -1.4); - gr->FaceZ(0.6, 0.8, 0, 0.4, 0.3, "r9#"); gr->Puts(mglPoint(0.8, 0.9), "r9", "C:k", -1.4); -} -//----------------------------------------------------------------------------- -void smgl_qo2d(mglGraph *gr) -{ - gr->Compression(true); // try to save space - mglData r, xx, yy, a, im(128), re(128); - const char *ham = "p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)"; - r = mglRay(ham, mglPoint(-0.7, -1), mglPoint(0, 0.5), 0.02, 2); - gr->Plot(r.SubData(0), r.SubData(1), "k"); - gr->Axis(); gr->Label('x', "\\i x"); gr->Label('y', "\\i z"); - // now start beam tracing - re.Fill("exp(-48*x^2)", gr->Min, gr->Max); - a = mglQO2d(ham, re, im, r, 1, 30, &xx, &yy); - gr->CAxis(0, 1); - gr->Dens(xx, yy, a, "wyrRk"); - gr->Plot("-x", "k|"); - gr->Puts(mglPoint(0, 0.85), "absorption: (x+y)/2 for x+y>0"); - gr->Puts(mglPoint(0.7, -0.05), "central ray"); - gr->Title("Beam and ray tracing", "C", -1.5); - gr->Compression(false); //put setting back -} -//----------------------------------------------------------------------------- -void smgl_pde(mglGraph *gr) // PDE and Ray sample -{ - gr->Compression(true); // try to save space - mglData a,re(128),im(128); - gr->Axis(); - gr->Label('x', "\\i x"); - gr->Label('y', "\\i z"); - - re.Fill("exp(-48*(x+0.7)^2)", gr->Min, gr->Max); - a = mglPDE("p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)", re, im, - gr->Min, gr->Max, 0.01, 30); - a.Transpose("yxz"); - gr->CAxis(0, 1); - gr->Dens(a,"wyrRk"); - gr->Plot("-x", "k|", (type==5 || type==9 || type==10)?0.01:NAN); - gr->Puts(mglPoint(0, 0.85), "absorption: (x+z)/2 for x+z>0"); - gr->Title("Equation: ik_0\\partial_zu + \\Delta u + x\\cdot u + i \\frac{x+z}{2}\\cdot u = 0", "C", -float(width)/height); - gr->Compression(false); //put setting back -} -//----------------------------------------------------------------------------- -void smgl_stfa(mglGraph *gr) // STFA sample -{ - mglData a(2000), b(2000); - a.Fill("cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+\ - cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)", - gr->Min, gr->Max); - gr->SubPlot(1, 2, 0); - gr->Plot(a); - gr->Axis(); - gr->Label('x', "\\i t"); - - gr->SubPlot(1, 2, 1); - gr->STFA(a, b, 64, "BbcyrR"); - gr->Axis(); - gr->Label('x', "\\i t"); - gr->Label('y', "\\omega", 0); -} -//----------------------------------------------------------------------------- -void smgl_envelop(mglGraph *gr) // Envelop reconstruction -{ - mglData a(1000); - a.Fill("exp(-8*x^2)*sin(10*pi*x)", gr->Min, gr->Max); - gr->Plot(a, "b"); - a.Envelop('x'); - gr->Plot(a, "r"); - gr->Axis(); -} -//----------------------------------------------------------------------------- -void smgl_sew(mglGraph *gr) // Phase reconstruction -{ - gr->VertexColor(false); - mglData a(100, 100); - a.Modify("mod((y^2-(1-x)^2)/2,0.1)"); - gr->Rotate(40, 60); - gr->Light(true); - gr->Alpha(true); - gr->Surf(a, "b"); - a.Sew("xy", 0.1); - gr->Surf(a, "r"); - gr->Box(); -} -//----------------------------------------------------------------------------- -void smgl_samplee(mglGraph *gr) // TeX sample -{ - gr->Puts(mglPoint(0), "\\sqrt{\\frac{\\alpha^{\\gamma^2}+\\overset 1{\\big\\infty}}{\\sqrt3{2+b}}}", 0, -4); -} -//----------------------------------------------------------------------------- -void smgl_sampled(mglGraph *gr) // arrow styles -{ - mreal a=0.1,b=0.4,c=0.5; - gr->Line(mglPoint(a,1),mglPoint(b,1),"k-A"); gr->Puts(mglPoint(c,1),"Style 'A' or 'A\\_'","rL"); - gr->Line(mglPoint(a,0.8),mglPoint(b,0.8),"k-V"); gr->Puts(mglPoint(c,0.8),"Style 'V' or 'V\\_'","rL"); - gr->Line(mglPoint(a,0.6),mglPoint(b,0.6),"k-K"); gr->Puts(mglPoint(c,0.6),"Style 'K' or 'K\\_'","rL"); - gr->Line(mglPoint(a,0.4),mglPoint(b,0.4),"k-I"); gr->Puts(mglPoint(c,0.4),"Style 'I' or 'I\\_'","rL"); - gr->Line(mglPoint(a,0.2),mglPoint(b,0.2),"k-D"); gr->Puts(mglPoint(c,0.2),"Style 'D' or 'D\\_'","rL"); - gr->Line(mglPoint(a,0),mglPoint(b,0),"k-S"); gr->Puts(mglPoint(c,0),"Style 'S' or 'S\\_'","rL"); - gr->Line(mglPoint(a,-0.2),mglPoint(b,-0.2),"k-O"); gr->Puts(mglPoint(c,-0.2),"Style 'O' or 'O\\_'","rL"); - gr->Line(mglPoint(a,-0.4),mglPoint(b,-0.4),"k-T"); gr->Puts(mglPoint(c,-0.4),"Style 'T' or 'T\\_'","rL"); - gr->Line(mglPoint(a,-0.6),mglPoint(b,-0.6),"k-_"); gr->Puts(mglPoint(c,-0.6),"Style '\\_' or none","rL"); - gr->Line(mglPoint(a,-0.8),mglPoint(b,-0.8),"k-AS"); gr->Puts(mglPoint(c,-0.8),"Style 'AS'","rL"); - gr->Line(mglPoint(a,-1),mglPoint(b,-1),"k-_A"); gr->Puts(mglPoint(c,-1),"Style '\\_A'","rL"); - - a=-1; b=-0.7; c=-0.6; - gr->Line(mglPoint(a,1),mglPoint(b,1),"kAA"); gr->Puts(mglPoint(c,1),"Style 'AA'","rL"); - gr->Line(mglPoint(a,0.8),mglPoint(b,0.8),"kVV"); gr->Puts(mglPoint(c,0.8),"Style 'VV'","rL"); - gr->Line(mglPoint(a,0.6),mglPoint(b,0.6),"kKK"); gr->Puts(mglPoint(c,0.6),"Style 'KK'","rL"); - gr->Line(mglPoint(a,0.4),mglPoint(b,0.4),"kII"); gr->Puts(mglPoint(c,0.4),"Style 'II'","rL"); - gr->Line(mglPoint(a,0.2),mglPoint(b,0.2),"kDD"); gr->Puts(mglPoint(c,0.2),"Style 'DD'","rL"); - gr->Line(mglPoint(a,0),mglPoint(b,0),"kSS"); gr->Puts(mglPoint(c,0),"Style 'SS'","rL"); - gr->Line(mglPoint(a,-0.2),mglPoint(b,-0.2),"kOO"); gr->Puts(mglPoint(c,-0.2),"Style 'OO'","rL"); - gr->Line(mglPoint(a,-0.4),mglPoint(b,-0.4),"kTT"); gr->Puts(mglPoint(c,-0.4),"Style 'TT'","rL"); - gr->Line(mglPoint(a,-0.6),mglPoint(b,-0.6),"k-__"); gr->Puts(mglPoint(c,-0.6),"Style '\\_\\_'","rL"); - gr->Line(mglPoint(a,-0.8),mglPoint(b,-0.8),"k-VA"); gr->Puts(mglPoint(c,-0.8),"Style 'VA'","rL"); - gr->Line(mglPoint(a,-1),mglPoint(b,-1),"k-AV"); gr->Puts(mglPoint(c,-1),"Style 'AV'","rL"); -} -//----------------------------------------------------------------------------- -void smgl_samplec(mglGraph *gr) // error boxes -{ - mglData x(10), y(10), ex(10), ey(10), y0(50); - x.Modify("2*x-1 + 0.2*rnd-0.1"); - y.Modify("(2*x-1)^2 + 0.2*rnd-0.1"); - y0.Modify("(2*x-1)^2"); - ex.Modify("0.2"); - ey.Modify("0.1"); - - gr->Clf(); - gr->SubPlot(2,2,0); - gr->Error(y,ey,"ko"); - gr->Plot(y0,"r"); - gr->Axis(); - gr->Text(mglPoint(0,1.2,0),"Random \\i{y}"); - gr->SubPlot(2,2,1); - gr->Error(x,y,ex,"ko"); - gr->Plot(y0,"r"); - gr->Axis(); - gr->Text(mglPoint(0,1.2,0),"Random \\i{x, y}"); - gr->SubPlot(2,2,2); - gr->Error(x,y,ey,ey,"ko"); - gr->Plot(y0,"r"); - gr->Axis(); - gr->Text(mglPoint(0,1.2,0),"Random \\i{x, y} and 2d boxes"); - gr->SubPlot(2,2,3); - gr->Text(mglPoint(0,1.2,0),"Random point in 3d space"); - gr->Rotate(40,60); - for(int i=0;i<10;i++) - gr->Error(mglPoint(mgl_rnd()-0.5,mgl_rnd()-0.5,mgl_rnd()-0.5), mglPoint(0.1,0.1,0.1),"bo"); - gr->Axis(); - gr->Rotate(0,0); // for unrotate in IDTF -} -//----------------------------------------------------------------------------- -void smgl_sampleb(mglGraph *gr) // Gaussian beam -{ - gr->Alpha(true); gr->Light(true); gr->Light(0,mglPoint(0,0,1)); - mglData a(30,30,30), b(30,30,30); - a.Modify("exp(-16*((z-0.5)^2+(y-0.5)^2)/(1+4*x^2))"); - b.Modify("16*((z-0.5)^2+(y-0.5)^2)*(x)/(1+4*x^2)"); - gr->CAxis(0,1); - - gr->SubPlot(2,2,0); gr->Rotate(40,60); - gr->VertexColor(false); - // since we have one-color trasparent surfaces - disable (per-vertex) coloring - gr->Surf3(a,"wgk"); gr->Box(); - gr->SubPlot(2,2,1); gr->Rotate(40,60); - gr->DensA(a); gr->Box(); gr->Axis(); - gr->SubPlot(2,2,2); gr->Rotate(40,60); - gr->Cloud(a); gr->Box(); - gr->SubPlot(2,2,3); gr->Rotate(40,60); - gr->VertexColor(false); - // for variable transparency the only way is to disable smooth (per-vertex) coloring - gr->Surf3A(b,a,"q"); gr->Box(); -} -//----------------------------------------------------------------------------- -void smgl_samplea(mglGraph *gr) // flag # -{ - gr->Alpha(true); gr->Light(true); gr->Light(0,mglPoint(0,0,1)); - mglData a(30,20); - a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); - - gr->SubPlot(2,2,0); gr->Rotate(40,60); - gr->Surf(a,"BbcyrR#"); gr->Box(); - gr->SubPlot(2,2,1); gr->Rotate(40,60); - gr->Dens(a,"BbcyrR#"); gr->Box(); - gr->SubPlot(2,2,2); gr->Rotate(40,60); - gr->Cont(a,"BbcyrR#"); gr->Box(); - gr->SubPlot(2,2,3); gr->Rotate(40,60); - gr->Axial(a,"BbcyrR#"); gr->Box(); -} -//----------------------------------------------------------------------------- -void smgl_sample9(mglGraph *gr) // 2d plot -{ - gr->Light(true); gr->Light(0,mglPoint(0,0,1)); - - mglData a0(50,40); - a0.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); - gr->SubPlot(2,2,0); gr->Rotate(60,40); - gr->Surf(a0); gr->Box(); - - mglData x(50,40),y(50,40),z(50,40); - x.Modify("0.8*sin(2*pi*x)*sin(pi*y)"); - y.Modify("0.8*cos(2*pi*x)*sin(pi*y)"); - z.Modify("0.8*cos(pi*y)"); - gr->SubPlot(2,2,1); gr->Rotate(60,40); - gr->Surf(x,y,z,"BbwrR"); gr->Box(); - - mglData a1(50,40,3); - a1.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); - a1.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*sin(3*pi*(x*y))",1); - a1.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",2); - gr->SubPlot(2,2,2); gr->Rotate(60,40); - gr->Alpha(true); - gr->Surf(a1); gr->Box(); - - gr->SubPlot(2,2,3); gr->Rotate(60,40); - gr->Dens(a1); gr->Box(); -} -//----------------------------------------------------------------------------- -void smgl_sample8(mglGraph *gr) // 1d plot -{ - mglData y0(50); y0.Modify("sin(pi*(2*x-1))"); - gr->SubPlot(2,2,0); - gr->Plot(y0); gr->Box(); - - gr->SubPlot(2,2,1); - mglData y1(50,2); - y1.Modify("sin(pi*2*x-pi)"); y1.Modify("cos(pi*2*x-pi)/2",1); - gr->Plot(y1); gr->Box(); - - mglData x(50); x.Modify("cos(pi*2*x-pi)"); - gr->Plot(x,y0,"Y+"); - - gr->Plot(y1.SubData(-1,0),y1.SubData(-1,1),"q|"); - - gr->SubPlot(2,2,2); gr->Rotate(60,40); - mglData z(50); z.Modify("2*x-1"); - gr->Plot(x,y0,z); gr->Box(); - - mglData y2(10,3); y2.Modify("cos(pi*(2*x-1-y))"); - y2.Modify("2*x-1",2); - gr->Plot(y2.SubData(-1,0),y2.SubData(-1,1),y2.SubData(-1,2),"bo "); - - gr->SubPlot(2,2,3); gr->Rotate(60,40); - gr->Bars(x,y0,z,"ri"); gr->Box(); - - gr->Rotate(0,0); // for unrotate in IDTF -} -//----------------------------------------------------------------------------- -void smgl_sample7(mglGraph *gr) // smoothing -{ - mglData y0(30),y1,y2,y3; - y0.Modify("0.4*sin(2*pi*x) + 0.3*cos(3*pi*x) - 0.4*sin(4*pi*x)+0.2*rnd"); - - y1=y0; y1.Smooth(SMOOTH_LINE_3); - y2=y0; y2.Smooth(SMOOTH_LINE_5); - y3=y0; y3.Smooth(SMOOTH_QUAD_5); - - gr->Plot(y0,"k"); gr->AddLegend("NONE","k"); - gr->Plot(y1,"r"); gr->AddLegend("LINE\\_3","r"); - gr->Plot(y2,"g"); gr->AddLegend("LINE\\_5","g"); - gr->Plot(y3,"b"); gr->AddLegend("QUAD\\_5","b"); - gr->Legend(); gr->Box(); - gr->ClearLegend(); // clear legend strings -} -//----------------------------------------------------------------------------- -void smgl_sample6(mglGraph *gr) // differentiate -{ - mglData a(30,40); a.Modify("x*y"); - gr->Axis(mglPoint(0,0,0),mglPoint(1,1,1)); - gr->SubPlot(2,2,0); gr->Rotate(60,40); - gr->Surf(a); gr->Box(); - gr->Text(mglPoint(0.7,1,1.2),"a(x,y)"); - gr->SubPlot(2,2,1); gr->Rotate(60,40); - a.Diff("x"); gr->Surf(a); gr->Box(); - gr->Text(mglPoint(0.7,1,1.2),"da/dx"); - gr->SubPlot(2,2,2); gr->Rotate(60,40); - a.Integral("xy"); gr->Surf(a); gr->Box(); - gr->Text(mglPoint(0.7,1,1.2),"\\int da/dx dxdy"); - gr->SubPlot(2,2,3); gr->Rotate(60,40); - a.Diff2("y"); gr->Surf(a); gr->Box(); - gr->Text(mglPoint(0.7,1,1.2),"\\int {d^2}a/dxdy dx"); -} -//----------------------------------------------------------------------------- -void smgl_sample5(mglGraph *gr) // pen styles -{ - if(type==5 || type==9 || type==10) gr->Puts(mglPoint(0,1.2),"line styles not supported","rL"); - mreal d,x1,x2,x0,y=0.95; - d=0.3, x0=0.2, x1=0.5, x2=0.6; - gr->Line(mglPoint(x0,1-0*d),mglPoint(x1,1-0*d),"k-"); gr->Puts(mglPoint(x2,y-0*d),"Solid '-'","rL"); - gr->Line(mglPoint(x0,1-1*d),mglPoint(x1,1-1*d),"k|"); gr->Puts(mglPoint(x2,y-1*d),"Long Dash '|'","rL"); - gr->Line(mglPoint(x0,1-2*d),mglPoint(x1,1-2*d),"k;"); gr->Puts(mglPoint(x2,y-2*d),"Dash ';'","rL"); - gr->Line(mglPoint(x0,1-3*d),mglPoint(x1,1-3*d),"k="); gr->Puts(mglPoint(x2,y-3*d),"Small dash '='","rL"); - gr->Line(mglPoint(x0,1-4*d),mglPoint(x1,1-4*d),"kj"); gr->Puts(mglPoint(x2,y-4*d),"Dash-dot 'j'","rL"); - gr->Line(mglPoint(x0,1-5*d),mglPoint(x1,1-5*d),"ki"); gr->Puts(mglPoint(x2,y-5*d),"Small dash-dot 'i'","rL"); - gr->Line(mglPoint(x0,1-6*d),mglPoint(x1,1-6*d),"k:"); gr->Puts(mglPoint(x2,y-6*d),"Dots ':'","rL"); - gr->Line(mglPoint(x0,1-7*d),mglPoint(x1,1-7*d),"k "); gr->Puts(mglPoint(x2,y-7*d),"None ' '","rL"); - - d=0.25; x1=-1; x0=-0.8; y = -0.05; - gr->Mark(mglPoint(x1,5*d),'.'); gr->Puts(mglPoint(x0,y+5*d),"'.'","rL"); - gr->Mark(mglPoint(x1,4*d),'+'); gr->Puts(mglPoint(x0,y+4*d),"'+'","rL"); - gr->Mark(mglPoint(x1,3*d),'x'); gr->Puts(mglPoint(x0,y+3*d),"'x'","rL"); - gr->Mark(mglPoint(x1,2*d),'*'); gr->Puts(mglPoint(x0,y+2*d),"'*'","rL"); - gr->Mark(mglPoint(x1,d),'s'); gr->Puts(mglPoint(x0,y+d),"'s'","rL"); - gr->Mark(mglPoint(x1,0),'d'); gr->Puts(mglPoint(x0,y),"'d'","rL"); - gr->Mark(mglPoint(x1,-d,0),'o'); gr->Puts(mglPoint(x0,y-d),"'o'","rL"); - gr->Mark(mglPoint(x1,-2*d,0),'^'); gr->Puts(mglPoint(x0,y-2*d),"'\\^'","rL"); - gr->Mark(mglPoint(x1,-3*d,0),'v'); gr->Puts(mglPoint(x0,y-3*d),"'v'","rL"); - gr->Mark(mglPoint(x1,-4*d,0),'<'); gr->Puts(mglPoint(x0,y-4*d),"'<'","rL"); - gr->Mark(mglPoint(x1,-5*d,0),'>'); gr->Puts(mglPoint(x0,y-5*d),"'>'","rL"); - - d=0.25; x1=-0.5; x0=-0.3; y = -0.05; - gr->Mark(mglPoint(x1,5*d),'C'); gr->Puts(mglPoint(x0,y+5*d),"'\\#.'","rL"); - gr->Mark(mglPoint(x1,4*d),'P'); gr->Puts(mglPoint(x0,y+4*d),"'\\#+'","rL"); - gr->Mark(mglPoint(x1,3*d),'X'); gr->Puts(mglPoint(x0,y+3*d),"'\\#x'","rL"); - gr->Mark(mglPoint(x1,2*d),'Y'); gr->Puts(mglPoint(x0,y+2*d),"'\\#*'","rL"); - gr->Mark(mglPoint(x1,d),'S'); gr->Puts(mglPoint(x0,y+d),"'\\#s'","rL"); - gr->Mark(mglPoint(x1,0),'D'); gr->Puts(mglPoint(x0,y),"'\\#d'","rL"); - gr->Mark(mglPoint(x1,-d,0),'O'); gr->Puts(mglPoint(x0,y-d),"'\\#o'","rL"); - gr->Mark(mglPoint(x1,-2*d,0),'T'); gr->Puts(mglPoint(x0,y-2*d),"'\\#\\^'","rL"); - gr->Mark(mglPoint(x1,-3*d,0),'V'); gr->Puts(mglPoint(x0,y-3*d),"'\\#v'","rL"); - gr->Mark(mglPoint(x1,-4*d,0),'L'); gr->Puts(mglPoint(x0,y-4*d),"'\\#<'","rL"); - gr->Mark(mglPoint(x1,-5*d,0),'R'); gr->Puts(mglPoint(x0,y-5*d),"'\\#>'","rL"); -} -//----------------------------------------------------------------------------- -void smgl_sample4(mglGraph *gr) // font features -{ -// setlocale(LC_CTYPE, "ru_RU.cp1251"); -// gr->Putsw(mglPoint(0,1),L"Text can be in english è â Þíèêîäå"); - gr->Putsw(mglPoint(0,1),L"Text can be in ASCII and in Unicode"); - gr->Puts(mglPoint(0,0.6),"It can be \\wire{wire}, \\big{big} or #r{colored}"); - gr->Puts(mglPoint(0,0.2),"One can change style in string: " - "\\b{bold}, \\i{italic, \\b{both}}"); - gr->Puts(mglPoint(0,-0.2),"Easy to \\a{overline} or " - "\\u{underline}"); - gr->Puts(mglPoint(0,-0.6),"Easy to change indexes ^{up} _{down} @{center}"); - gr->Puts(mglPoint(0,-1),"It parse TeX: \\int \\alpha \\cdot " - "\\sqrt3{sin(\\pi x)^2 + \\gamma_{i_k}} dx"); -} -//----------------------------------------------------------------------------- -void smgl_sample3(mglGraph *gr) // curvilinear coordinates -{ - mglData x(50),y(50),z(50); - y.Fill(0.5,0.5); - x.Fill(-1,1); // create data arrays - - gr->Axis(mglPoint(-1,-1,-1),mglPoint(1,1,1),mglPoint(-1,1,-1)); - gr->SetTicks('z', 0.5); // set tick step to 0.5 - - gr->SubPlot(2,2,0); - gr->Rotate(60,40); - gr->Plot(x,y,z,"r2"); - gr->Axis(); gr->Grid(); - gr->Text(mglPoint(0,1.3,1),"Cartesian"); - - gr->SubPlot(2,2,1); - gr->SetFunc("y*sin(pi*x)","y*cos(pi*x)",0); - gr->Rotate(60,40); - gr->Plot(x,y,z,"r2"); - gr->Axis(); gr->Grid(); - gr->Text(mglPoint(0,1.3,1),"Cylindrical"); - - gr->SubPlot(2,2,2); - gr->Rotate(60,40); - gr->SetFunc("2*y*x","y*y - x*x",0); - gr->Plot(x,y,z,"r2"); - gr->Axis(); gr->Grid(); - gr->Text(mglPoint(0,1.3,1),"Parabolic"); - - gr->SubPlot(2,2,3); - gr->Rotate(60,40); - gr->SetFunc("y*sin(pi*x)","y*cos(pi*x)","x+z"); - gr->Plot(x,y,z,"r2"); - gr->Axis(); gr->Grid(); - gr->Text(mglPoint(0,1.3,1),"Spiral"); - gr->Axis(0,0,0); // set to default Cartesian -} -//----------------------------------------------------------------------------- -void smgl_sample2(mglGraph *gr) // axis and grid -{ - gr->SubPlot(2,2,0); - gr->SetTicks('x', 0.4, 3); // sets tick step to 0.4 - gr->SetTicks('y', 0.4, 3); // and draws 3 subticks - gr->Box(); // should be after the ticks change - gr->Axis("xy"); - gr->Grid(); - gr->Puts(mglPoint(0,1.3,1),"Axis and grid"); - - gr->SetTicks('x'); gr->SetTicks('y'); // restore back - gr->Axis(mglPoint(-1,-1,-1),mglPoint(1,1,1),mglPoint(0,0,0)); - - gr->SubPlot(2,2,1); - gr->Rotate(60,40); - gr->Axis(); - gr->Label('x',"x"); - gr->Label('y',"y"); - gr->Label('z',"z"); - gr->Puts(mglPoint(0,0,1.5),"Axis and labels"); - - gr->SubPlot(2,2,2); - gr->Rotate(60,40); - gr->SetTicks('x', 0.2); gr->SetTicks('y', 0.2); - gr->SetTicks('z', 0.2); // too low step of ticks - gr->Axis(mglPoint(-1,-1,-1),mglPoint(1,1,1),mglPoint(-1,-1,-1)); - gr->Axis(); - gr->Grid(); - gr->Puts(mglPoint(0,0,1.5),"Shift origin and add grid"); - gr->Puts(mglPoint(0,0,1.2),"(note, too many ticks)"); - - gr->SubPlot(2,2,3); - gr->Rotate(60,40); - gr->SetTicks('x', -6); // decrease the number of ticks - gr->SetTicks('y', -6); - gr->Axis("yz"); - gr->Label('y',"Y axis",0); - gr->Label('z',"Z axis",0); - gr->Puts(mglPoint(0,0,1.5),"Remove X axis, and"); - gr->Puts(mglPoint(0,0,1.2),"decrease number of ticks"); - - gr->Rotate(0,0); // for unrotate in IDTF -} -//----------------------------------------------------------------------------- -void smgl_sample1(mglGraph *gr) // transformation -{ - gr->SubPlot(2,2,0); // just new axis without rotation and aspects - gr->Box(); - gr->Text(mglPoint(-1,1.1,1),"Just box","rL"); - gr->InPlot(0.2,0.5,0.7,1,false); - gr->Box(); - gr->Text(mglPoint(0,1.2,1),"InPlot example"); - gr->SubPlot(2,2,1); // new axis with aspect and rotation - gr->Rotate(60,40); - gr->Aspect(1,1,1); - gr->Box(); - gr->Text(mglPoint(1,1,1.5),"Rotate only","rR"); - gr->SubPlot(2,2,2); // aspect in other direction - gr->Rotate(60,40); - gr->Aspect(1,1,2); - gr->Box(); - gr->Text(mglPoint(0,0,2),"Aspect and Rotate"); - gr->SubPlot(2,2,3); // rotation before aspect. INCORRECT !!! - gr->Rotate(60,40); - gr->Aspect(1,2,2); - gr->Box(); - gr->Text(mglPoint(0,0,1.5),"Aspect in other direction"); - gr->Rotate(0,0); // for unrotate in IDTF -} -//----------------------------------------------------------------------------- -void mgls_prepare1d(mglData *y, mglData *y1=0, mglData *y2=0, mglData *x1=0, mglData *x2=0) -{ - register long i,n=50; - if(y) y->Create(n,3); - if(x1) x1->Create(n); if(x2) x2->Create(n); - if(y1) y1->Create(n); if(y2) y2->Create(n); - mreal xx; - for(i=0;ia[i] = 0.7*sin(2*M_PI*xx) + 0.5*cos(3*M_PI*xx) + 0.2*sin(M_PI*xx); - y->a[i+n] = sin(2*M_PI*xx); - y->a[i+2*n] = cos(2*M_PI*xx); - } - if(y1) y1->a[i] = 0.5+0.3*cos(2*M_PI*xx); - if(y2) y2->a[i] = 0.3*sin(2*M_PI*xx); - if(x1) x1->a[i] = xx*2-1; - if(x2) x2->a[i] = 0.05+0.03*cos(2*M_PI*xx); - } -} -//----------------------------------------------------------------------------- -void smgl_plot(mglGraph *gr) -{ - mglData y; mgls_prepare1d(&y); - gr->Box(); gr->Plot(y); -} -//----------------------------------------------------------------------------- -void smgl_area(mglGraph *gr) -{ - mglData y; mgls_prepare1d(&y); - gr->Org=mglPoint(); gr->Box(); gr->Area(y); -} -//----------------------------------------------------------------------------- -void smgl_area_2(mglGraph *gr) -{ - mglData y; mgls_prepare1d(&y); - gr->Org=mglPoint(); gr->Box(); gr->Area(y,"cbgGyr"); -} -//----------------------------------------------------------------------------- -void smgl_stem(mglGraph *gr) -{ - mglData y; mgls_prepare1d(&y); - gr->Org=mglPoint(); gr->Box(); gr->Stem(y,"o"); -} -//----------------------------------------------------------------------------- -void smgl_step(mglGraph *gr) -{ - mglData y; mgls_prepare1d(&y); - gr->Box(); gr->Step(y); -} -//----------------------------------------------------------------------------- -void smgl_bars_2(mglGraph *gr) -{ - mglData ys(10,3); ys.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); - gr->Org=mglPoint(); gr->Box(); gr->Bars(ys,"cbgGyr"); -} -//----------------------------------------------------------------------------- -void smgl_bars_a(mglGraph *gr) -{ - mglData ys(10,3); ys.Modify("0.3*sin(pi*(2*x+y/2))+0.1*rnd"); - gr->Org=mglPoint(); gr->Box(); gr->Bars(ys,"a"); -} -//----------------------------------------------------------------------------- -void smgl_bars_f(mglGraph *gr) -{ - mglData ys(10,2); ys.Modify("0.24*sin(pi*(2*x+y/2))+0.06*rnd"); - gr->Org=mglPoint(); gr->Box(); gr->Bars(ys,"f"); -} -//----------------------------------------------------------------------------- -void smgl_bars(mglGraph *gr) -{ - mglData ys(10,3); ys.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); - gr->Org=mglPoint(); gr->Box(); gr->Bars(ys); -} -//----------------------------------------------------------------------------- -void smgl_barh(mglGraph *gr) -{ - mglData ys(10,3); ys.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); - gr->Org=mglPoint(); gr->Box(); gr->Barh(ys); -} -//----------------------------------------------------------------------------- -void smgl_tens(mglGraph *gr) -{ - mglData y; mgls_prepare1d(&y); - gr->Box(); gr->Tens(y.SubData(-1,0), y.SubData(-1,1)); -} -//----------------------------------------------------------------------------- -void smgl_text(mglGraph *gr) -{ - mglData y; mgls_prepare1d(&y); - gr->Box(); gr->Plot(y.SubData(-1,0)); - gr->Text(y,"This is very very long string drawn along a curve",":k"); - gr->Text(y,"Another string drawn above a curve","T:r"); -} -//----------------------------------------------------------------------------- -void smgl_region(mglGraph *gr) -{ - mglData y1,y2; mgls_prepare1d(0, &y1, &y2); - gr->Box(); gr->Region(y2,y1,"r"); - gr->Plot(y1,"k2"); gr->Plot(y2,"k2"); -} -//----------------------------------------------------------------------------- -void smgl_region_2(mglGraph *gr) -{ - mglData y1,y2; mgls_prepare1d(0, &y1, &y2); - gr->Box(); gr->Region(y2,y1,"yr"); - gr->Plot(y1,"k2"); gr->Plot(y2,"k2"); -} -//----------------------------------------------------------------------------- -void smgl_mark(mglGraph *gr) -{ - mglData y,y1; mgls_prepare1d(&y,&y1); - gr->Box(); gr->Mark(y,y1,"bs"); -} -//----------------------------------------------------------------------------- -void smgl_traj(mglGraph *gr) -{ - mglData x,y,y1,y2; mgls_prepare1d(&y,&y1,&y2,&x); - gr->Box(); gr->Plot(x,y); gr->Traj(x,y,y1,y2); -} -//----------------------------------------------------------------------------- -void smgl_textmark(mglGraph *gr) -{ - mglData y,y1; mgls_prepare1d(&y,&y1); - gr->Box(); gr->TextMark(y,y1,"\\gamma"); -} -//----------------------------------------------------------------------------- -void smgl_torus(mglGraph *gr) -{ - mglData y1,y2; mgls_prepare1d(0,&y1,&y2); - gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); - gr->Box(); gr->Torus(y1,y2,"pz"); -} -//----------------------------------------------------------------------------- -void smgl_tube(mglGraph *gr) -{ - mglData y,y1; mgls_prepare1d(&y,&y1); - gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); - gr->Box(); gr->Tube(y,0.05); -} -//----------------------------------------------------------------------------- -void smgl_tube_3d(mglGraph *gr) -{ - mglData y,y1,y2,x1,x2; mgls_prepare1d(&y,&y1,&y2,&x1,&x2); - gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); - gr->Box(); gr->Tube(y,0.05); gr->Tube(y1,x1,y2,x2); -} -//----------------------------------------------------------------------------- -void smgl_radar(mglGraph *gr) -{ - mglData yr(10,3); yr.Modify("0.4*sin(pi*(2*x+y/2))+0.1*rnd"); - gr->Box(); gr->Radar(yr,"#"); -} -//----------------------------------------------------------------------------- -void smgl_error(mglGraph *gr) -{ - mglData y; mgls_prepare1d(&y); - mglData x0(10), y0(10), ex0(10), ey0(10); - mreal x; - for(int i=0;i<10;i++) - { - x = i/9.; - x0.a[i] = 2*x-1 + 0.1*mgl_rnd()-0.05; - y0.a[i] = 0.7*sin(2*M_PI*x)+0.5*cos(3*M_PI*x)+0.2*sin(M_PI*x)+0.2*mgl_rnd()-0.1; - ey0.a[i]=0.2; ex0.a[i]=0.1; - } - gr->Box(); gr->Plot(y.SubData(-1,0)); - gr->Error(x0,y0,ex0,ey0,"ko"); -} -//----------------------------------------------------------------------------- -void smgl_chart(mglGraph *gr) -{ - mglData ch(7,2); for(int i=0;i<7*2;i++) ch.a[i]=mgl_rnd()+0.1; - gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); - gr->Box(); gr->Chart(ch,"#"); -} -//----------------------------------------------------------------------------- -void smgl_ring_chart(mglGraph *gr) -{ - mglData ch(7,2); for(int i=0;i<7*2;i++) ch.a[i]=mgl_rnd()+0.1; - gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); - gr->SetFunc("(y+2)/3*cos(pi*x)","(y+2)/3*sin(pi*x)",""); - gr->Box(); gr->Chart(ch,"bgr cmy#"); -} -//----------------------------------------------------------------------------- -void smgl_pie_chart(mglGraph *gr) -{ - mglData ch(7,2); for(int i=0;i<7*2;i++) ch.a[i]=mgl_rnd()+0.1; - gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); - gr->SetFunc("(y+1)/2*cos(pi*x)","(y+1)/2*sin(pi*x)",""); - gr->Box(); gr->Chart(ch,"bgr cmy#"); -} -//----------------------------------------------------------------------------- -void mgls_prepare2d(mglData *a, mglData *b=0, mglData *v=0) -{ - register long i,j,n=50,m=40,i0; - if(a) a->Create(n,m); if(b) b->Create(n,m); - if(v) { v->Create(9); v->Fill(-1,1); } - mreal x,y; - for(i=0;ia[i0] = 0.6*sin(2*M_PI*x)*sin(3*M_PI*y)+0.4*cos(3*M_PI*x*y); - if(b) b->a[i0] = 0.6*cos(2*M_PI*x)*cos(3*M_PI*y)+0.4*cos(3*M_PI*x*y); - } -} -//----------------------------------------------------------------------------- -void smgl_grad(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Box(); gr->Grad(a); - gr->Alpha(true); gr->Dens(a); -} -//----------------------------------------------------------------------------- -void smgl_contt(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Box(); gr->Cont(a,"t"); -} -//----------------------------------------------------------------------------- -void smgl_tiles(mglGraph *gr) -{ - mglData a,b; mgls_prepare2d(&a,&b); - gr->Box(); gr->TileS(a,b); -} -//----------------------------------------------------------------------------- -void smgl_contd(mglGraph *gr) -{ - mglData a,v; mgls_prepare2d(&a,0,&v); - gr->Box(); gr->ContD(v,a); gr->Colorbar(v); -} -//----------------------------------------------------------------------------- -void smgl_dens(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Box(); gr->Dens(a); gr->Colorbar(); -} -//----------------------------------------------------------------------------- -void smgl_surf_sl(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Light(true); gr->Rotate(40,60); - gr->Box(); gr->Surf(a,"|"); -} -//----------------------------------------------------------------------------- -void smgl_surf(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Light(true); gr->Rotate(40,60); - gr->Box(); gr->Surf(a); -} -//----------------------------------------------------------------------------- -void smgl_stereo(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Light(true); - gr->SubPlot(2,1,0); gr->Rotate(40,60+3); - gr->Box(); gr->Surf(a); - gr->SubPlot(2,1,1); gr->Rotate(40,60-3); - gr->Box(); gr->Surf(a); - gr->Rotate(0,0); // for unrotate in IDTF -} -//----------------------------------------------------------------------------- -void smgl_tile(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Light(true); gr->Rotate(40,60); - gr->Box(); gr->Tile(a); -} -//----------------------------------------------------------------------------- -void smgl_belt(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Light(true); gr->Rotate(40,60); - gr->Box(); gr->Belt(a); -} -//----------------------------------------------------------------------------- -void smgl_mesh(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Light(true); gr->Rotate(40,60); - gr->Box(); gr->Mesh(a); -} -//----------------------------------------------------------------------------- -void smgl_fall(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Light(true); gr->Rotate(40,60); - gr->Box(); gr->Fall(a); -} -//----------------------------------------------------------------------------- -void smgl_contf(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Light(true); gr->Rotate(40,60); - gr->Box(); gr->ContF(a); -} -//----------------------------------------------------------------------------- -void smgl_cont(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Rotate(40,60); - gr->Box(); gr->Cont(a); -} -//----------------------------------------------------------------------------- -void smgl_surfc(mglGraph *gr) -{ - mglData a,b; mgls_prepare2d(&a,&b); - gr->Light(true); gr->Rotate(40,60); - gr->Box(); gr->SurfC(a,b); -} -//----------------------------------------------------------------------------- -void smgl_boxs(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Org = mglPoint(); gr->Light(true); gr->Rotate(40,60); - gr->Box(); gr->Boxs(a); -} -//----------------------------------------------------------------------------- -void smgl_surf_fog(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Light(true); gr->Rotate(40,60); gr->Fog(1); gr->Box(); - (type==5 || type==9 || type==10)?gr->Text(mglPoint(),"Fog not supported") : gr->Surf(a); - gr->Fog(0); -} -//----------------------------------------------------------------------------- -void smgl_surf_alpha(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Light(true); gr->Rotate(40,60); gr->Alpha(true); - gr->Box(); gr->Surf(a); -} -//----------------------------------------------------------------------------- -void smgl_axial(mglGraph *gr) -{ - mglData a; mgls_prepare2d(&a); - gr->Light(true); gr->Rotate(40,60); - gr->Alpha(true); gr->VertexColor(false); - gr->Box(); gr->Axial(a); -} -//----------------------------------------------------------------------------- -void smgl_surfa(mglGraph *gr) -{ - mglData a,b; mgls_prepare2d(&a,&b); - gr->Light(true); gr->Rotate(40,60); - gr->Alpha(true); gr->VertexColor(false); - gr->Box(); gr->SurfA(a,b); -} -//----------------------------------------------------------------------------- -void mgls_prepare3d(mglData *a, mglData *b=0) -{ - register long i,j,k,n=60,m=50,l=40,i0; - if(a) a->Create(n,m,l); if(b) b->Create(n,m,l); - mreal x,y,z; - for(i=0;ia[i0] = -2*(x*x + y*y + z*z*z*z - z*z - 0.1); - if(b) b->a[i0] = 1-2*tanh((x+y)*(x+y)); - } -} -//----------------------------------------------------------------------------- -void smgl_surf3_rgbd(mglGraph *gr) -{ - mglData c; mgls_prepare3d(&c); - gr->Rotate(40,60); gr->VertexColor(true); - gr->Box(); gr->Surf3(c,"bgrd"); -} -//----------------------------------------------------------------------------- -void smgl_conta(mglGraph *gr) -{ - mglData c; mgls_prepare3d(&c); - gr->Rotate(40,60); gr->VertexColor(false); - gr->Box(); gr->ContA(c); -} -//----------------------------------------------------------------------------- -void smgl_dens_xyz(mglGraph *gr) -{ - mglData c; mgls_prepare3d(&c); - gr->Rotate(40,60); gr->VertexColor(false); - gr->Box(); gr->DensX(c.Sum("x"),0,-1); - gr->DensY(c.Sum("y"),0,1); gr->DensZ(c.Sum("z"),0,-1); -} -//----------------------------------------------------------------------------- -void smgl_cont_xyz(mglGraph *gr) -{ - mglData c; mgls_prepare3d(&c); - gr->Rotate(40,60); gr->VertexColor(false); - gr->Box(); gr->ContX(c.Sum("x"),"",-1); - gr->ContY(c.Sum("y"),"",1); - gr->ContZ(c.Sum("z"),"",-1); -} -//----------------------------------------------------------------------------- -void smgl_contfa(mglGraph *gr) -{ - mglData c; mgls_prepare3d(&c); - gr->Rotate(40,60); gr->Light(true); gr->VertexColor(false); - gr->Box(); gr->ContFA(c); -} -//----------------------------------------------------------------------------- -void smgl_surf3(mglGraph *gr) -{ - mglData c; mgls_prepare3d(&c); - gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); - gr->VertexColor(false); - gr->Box(); gr->Surf3(c); -} -//----------------------------------------------------------------------------- -void smgl_surf3a(mglGraph *gr) -{ - mglData c,d; mgls_prepare3d(&c,&d); - gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); - gr->VertexColor(false); - gr->Box(); gr->Surf3A(c,d); -} -//----------------------------------------------------------------------------- -void smgl_surf3c(mglGraph *gr) -{ - mglData c,d; mgls_prepare3d(&c,&d); - gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); - gr->VertexColor(false); - gr->Box(); gr->Surf3C(c,d); -} -//----------------------------------------------------------------------------- -void smgl_densa(mglGraph *gr) -{ - mglData c; mgls_prepare3d(&c); - gr->Rotate(40,60); gr->Alpha(true); gr->VertexColor(false); - gr->Org=mglPoint(); gr->Axis(); - gr->Box(); gr->DensA(c); -} -//----------------------------------------------------------------------------- -void smgl_cloud(mglGraph *gr) -{ - mglData c; mgls_prepare3d(&c); - gr->Rotate(40,60); gr->Alpha(true); gr->VertexColor(false); - gr->Box(); gr->Cloud(c,"wyrRk"); -} -//----------------------------------------------------------------------------- -void smgl_cloudp(mglGraph *gr) -{ - mglData c; mgls_prepare3d(&c); - gr->Rotate(40,60); gr->Alpha(true); gr->VertexColor(false); - gr->Box(); - if(type==5 || type==9 || type==10) gr->Text(mglPoint(0,0,0),"Point clouds not supported"); - else gr->CloudP(c,"wyrRk"); -} -//----------------------------------------------------------------------------- -void mgls_prepare2v(mglData *a, mglData *b) -{ - register long i,j,n=20,m=30,i0; - if(a) a->Create(n,m); if(b) b->Create(n,m); - mreal x,y; - for(i=0;ia[i0] = 0.6*sin(2*M_PI*x)*sin(3*M_PI*y)+0.4*cos(3*M_PI*x*y); - if(b) b->a[i0] = 0.6*cos(2*M_PI*x)*cos(3*M_PI*y)+0.4*cos(3*M_PI*x*y); - } -} -//----------------------------------------------------------------------------- -void smgl_vect(mglGraph *gr) -{ - mglData a,b; mgls_prepare2v(&a,&b); - gr->Box(); gr->Vect(a,b); -} -//----------------------------------------------------------------------------- -void smgl_vectl(mglGraph *gr) -{ - mglData a,b; mgls_prepare2v(&a,&b); - gr->Box(); gr->VectL(a,b); -} -//----------------------------------------------------------------------------- -void smgl_vectc(mglGraph *gr) -{ - mglData a,b; mgls_prepare2v(&a,&b); - gr->Box(); gr->VectC(a,b); -} -//----------------------------------------------------------------------------- -void smgl_flow(mglGraph *gr) -{ - mglData a,b; mgls_prepare2v(&a,&b); - gr->Box(); gr->Flow(a,b); -} -//----------------------------------------------------------------------------- -void smgl_pipe2(mglGraph *gr) -{ - mglData a,b; mgls_prepare2v(&a,&b); - gr->Box(); gr->Pipe(a,b); -} -//----------------------------------------------------------------------------- -void smgl_pipe(mglGraph *gr) -{ - mglData a,b; mgls_prepare2v(&a,&b); - gr->Light(true); gr->Compression(true); // try to save space - gr->Box(); gr->Pipe(a,b); - gr->Compression(false); //put setting back -} -//----------------------------------------------------------------------------- -void smgl_dew(mglGraph *gr) -{ - mglData a,b; mgls_prepare2v(&a,&b); - gr->Light(true); gr->Compression(true); // try to save space - gr->DoubleSided(false); // try to improve performance - gr->Box(); gr->MeshNum=20; gr->Dew(a,b); - gr->DoubleSided(true); - gr->Compression(false); //put setting back -} -//----------------------------------------------------------------------------- -void smgl_dew2(mglGraph *gr) -{ - mglData a,b; mgls_prepare2v(&a,&b); - gr->Rotate(40,60); gr->Light(true); gr->Compression(true); // try to save space - gr->DoubleSided(false); // try to improve performance - gr->Box(); gr->MeshNum=10; gr->Dew(a,b); - gr->DoubleSided(true); - gr->Compression(false); //put setting back -} -//----------------------------------------------------------------------------- -void mgls_prepare3v(mglData *ex, mglData *ey, mglData *ez) -{ - register long i,j,k,n=10,i0; - if(!ex || !ey || !ez) return; - ex->Create(n,n,n); ey->Create(n,n,n); ez->Create(n,n,n); - mreal x,y,z, r1,r2; - for(i=0;ia[i0]=0.2*x/r1 - 0.2*x/r2; - ey->a[i0]=0.2*y/r1 - 0.2*y/r2; - ez->a[i0]=0.2*(z-0.3)/r1 - 0.2*(z+0.3)/r2; - } -} -//----------------------------------------------------------------------------- -void smgl_flow3(mglGraph *gr) -{ - mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); - gr->Rotate(40,60); - gr->Box(); gr->Box(); gr->Flow(ex,ey,ez,"bwr"); -} -//----------------------------------------------------------------------------- -void smgl_vect3(mglGraph *gr) -{ - mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); - gr->Rotate(40,60); - gr->Box(); gr->Box(); gr->Vect(ex,ey,ez,"bwr"); -} -//----------------------------------------------------------------------------- -void smgl_vectl3(mglGraph *gr) -{ - mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); - gr->Rotate(40,60); - gr->Box(); gr->Box(); gr->VectL(ex,ey,ez,"bwr"); -} -//----------------------------------------------------------------------------- -void smgl_vectc3(mglGraph *gr) -{ - mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); - gr->Rotate(40,60); - gr->Box(); gr->Box(); gr->VectC(ex,ey,ez,"bwr"); -} -//----------------------------------------------------------------------------- -void smgl_pipe3(mglGraph *gr) -{ - mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); - gr->Rotate(40,60); gr->Light(true); - gr->Compression(true); // try to save space - gr->Clf(); gr->Box(); gr->Pipe(ex,ey,ez); - gr->Compression(false); // put setting back -} -//----------------------------------------------------------------------------- -void smgl_crust(mglGraph *gr) -{ - mglData pnts("hotdogs.pts"); pnts.Norm(-1,1,true); - gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); - gr->Clf(); gr->Box(); gr->Crust(pnts); -} -//----------------------------------------------------------------------------- -void smgl_dots(mglGraph *gr) -{ - mglData pnts("hotdogs.pts"); pnts.Norm(-1,1,true); - gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); - gr->Clf(); gr->Box(); gr->Dots(pnts); -} -//----------------------------------------------------------------------------- -void smgl_legend(mglGraph *gr) -{ - mglData f(50,3); - mreal x; - for(int i=0;i<50;i++) - { - x=i/49.; - f.a[i]=sin(2*M_PI*x*x); - f.a[i+50]=sin(2*M_PI*x); - f.a[i+100]=sin(2*M_PI*sqrt(x)); - } - gr->Axis(mglPoint(0), mglPoint(1)); - gr->Box(); gr->Plot(f); gr->Axis("xy"); - if(type==5 || type==9 || type==10) gr->LegendBox = false; - gr->AddLegend("sin(\\pi {x^2})","b"); gr->AddLegend("sin(\\pi x)","g*"); - gr->AddLegend("sin(\\pi \\sqrt{x})","r+"); gr->Legend(); -} -//----------------------------------------------------------------------------- -void smgl_type0(mglGraph *gr) // TranspType = 0 -{ - if(type==5 || type==9 || type==10) return; - gr->Alpha(true); gr->Light(true); gr->Light(0,mglPoint(0,0,1)); - mglData a; mgls_prepare2d(&a); - gr->TranspType = 0; gr->Clf(); - gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box(); - gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box(); - gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box(); - gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box(); -} -//----------------------------------------------------------------------------- -void smgl_type1(mglGraph *gr) // TranspType = 1 -{ - if(type==5 || type==9 || type==10) return; - gr->Alpha(true); gr->Light(true); gr->Light(0,mglPoint(0,0,1)); - mglData a; mgls_prepare2d(&a); - gr->TranspType = 1; gr->Clf(); - gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box(); - gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box(); - gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box(); - gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box(); -} -//----------------------------------------------------------------------------- -void smgl_type2(mglGraph *gr) // TranspType = 2 -{ - if(type==5 || type==9 || type==10) return; - gr->Alpha(true); gr->Light(true); gr->Light(0,mglPoint(0,0,1)); - mglData a; mgls_prepare2d(&a); - gr->TranspType = 2; gr->Clf(); - gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box(); - gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box(); - gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box(); - gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box(); -} -//----------------------------------------------------------------------------- -void smgl_molecule(mglGraph *gr) // example of moleculas -{ - gr->VertexColor(false); gr->Compression(false); // per-vertex colors and compression are detrimental to transparency - gr->DoubleSided(false); // we do not get into atoms, while rendering internal surface has negative impact on trasparency - gr->Alpha(true); gr->Light(true); - - gr->SubPlot(2,2,0); - gr->StartGroup("Methane"); - gr->StartGroup("MetaneLabel"); - gr->Puts(mglPoint(0,1.2),"Methane, CH_4",0,-2); - gr->EndGroup(); - gr->Rotate(60,120); - gr->Sphere(mglPoint(0,0,0),0.25,"k"); - gr->Drop(mglPoint(0,0,0),mglPoint(0,0,1),0.35,"h",1,2); - gr->Sphere(mglPoint(0,0,0.7),0.25,"g"); - gr->Drop(mglPoint(0,0,0),mglPoint(-0.94,0,-0.33),0.35,"h",1,2); - gr->Sphere(mglPoint(-0.66,0,-0.23),0.25,"g"); - gr->Drop(mglPoint(0,0,0),mglPoint(0.47,0.82,-0.33),0.35,"h",1,2); - gr->Sphere(mglPoint(0.33,0.57,-0.23),0.25,"g"); - gr->Drop(mglPoint(0,0,0),mglPoint(0.47,-0.82,-0.33),0.35,"h",1,2); - gr->Sphere(mglPoint(0.33,-0.57,-0.23),0.25,"g"); - gr->EndGroup(); - - gr->SubPlot(2,2,1); - gr->StartGroup("Water"); - gr->StartGroup("WaterLabel"); - gr->Puts(mglPoint(0,1.2),"Water, H_{2}O",0,-2); - gr->EndGroup(); - gr->Rotate(60,100); - gr->StartGroup("Water_O"); - gr->Sphere(mglPoint(0,0,0),0.25,"r"); - gr->EndGroup(); - gr->StartGroup("Water_Bond_1"); - gr->Drop(mglPoint(0,0,0),mglPoint(0.3,0.5,0),0.3,"m",1,2); - gr->EndGroup(); - gr->StartGroup("Water_H_1"); - gr->Sphere(mglPoint(0.3,0.5,0),0.25,"g"); - gr->EndGroup(); - gr->StartGroup("Water_Bond_2"); - gr->Drop(mglPoint(0,0,0),mglPoint(0.3,-0.5,0),0.3,"m",1,2); - gr->EndGroup(); - gr->StartGroup("Water_H_2"); - gr->Sphere(mglPoint(0.3,-0.5,0),0.25,"g"); - gr->EndGroup(); - gr->EndGroup(); - - gr->SubPlot(2,2,2); - gr->StartGroup("Oxygen"); - gr->StartGroup("OxygenLabel"); - gr->Puts(mglPoint(0,1.2),"Oxygen, O_2",0,-2); - gr->EndGroup(); - gr->Rotate(60,120); - gr->Drop(mglPoint(0,0.5,0),mglPoint(0,-0.3,0),0.3,"m",1,2); - gr->Sphere(mglPoint(0,0.5,0),0.25,"r"); - gr->Drop(mglPoint(0,-0.5,0),mglPoint(0,0.3,0),0.3,"m",1,2); - gr->Sphere(mglPoint(0,-0.5,0),0.25,"r"); - gr->EndGroup(); - - gr->SubPlot(2,2,3); - gr->StartGroup("Ammonia"); - gr->StartGroup("AmmoniaLabel"); - gr->Puts(mglPoint(0,1.2),"Ammonia, NH_3",0,-2); - gr->EndGroup(); - gr->Rotate(60,120); - gr->Sphere(mglPoint(0,0,0),0.25,"b"); - gr->Drop(mglPoint(0,0,0),mglPoint(0.33,0.57,0),0.32,"n",1,2); - gr->Sphere(mglPoint(0.33,0.57,0),0.25,"g"); - gr->Drop(mglPoint(0,0,0),mglPoint(0.33,-0.57,0),0.32,"n",1,2); - gr->Sphere(mglPoint(0.33,-0.57,0),0.25,"g"); - gr->Drop(mglPoint(0,0,0),mglPoint(-0.65,0,0),0.32,"n",1,2); - gr->Sphere(mglPoint(-0.65,0,0),0.25,"g"); - gr->EndGroup(); - gr->DoubleSided( true ); // put back -} -//----------------------------------------------------------------------------- -void smgl_ternary(mglGraph *gr) // flag # -{ - mglData x(50),y(50),rx(10),ry(10), a(20,30); - a.Modify("4*x*y"); - x.Modify("0.25*(1+cos(2*pi*x))"); - y.Modify("0.25*(1+sin(2*pi*x))"); - rx.Modify("rnd"); ry.Modify("(1-v)*rnd",rx); - - gr->Text(mglPoint(-0.8,1.3), "Ternary plot (x+y+t=1)"); - gr->Ternary(1); - gr->Plot(x,y,"r2"); - gr->Plot(rx,ry,"q^ "); - gr->Cont(a,"BbcyrR"); - gr->Line(mglPoint(0.5,0), mglPoint(0,0.75), "g2"); - gr->Axis(); gr->Grid("xyz","B;"); - gr->Label('x',"x comp."); - gr->Label('y',"y comp."); - gr->Label('t',"t comp."); - gr->Ternary(0); -} -//----------------------------------------------------------------------------- -void smgl_quaternary(mglGraph *gr) // flag # -{ - mglData x(50),y(50),z(50),rx(10),ry(10), a(20,30); - a.Modify("x*y*(1-x-y)^2*30"); - x.Modify("0.25*(1-x)*(1+cos(2*pi*x))"); - y.Modify("0.25*(1-x)*(1+sin(2*pi*x))"); - z.Modify("x"); - - gr->Text(mglPoint(0,1.3), "Quaternary plot (x+y+z+t=1)"); - gr->Rotate(60,70); gr->Light(true); - gr->Ternary(2); gr->SetCut(true); - gr->Plot(x,y,z,"r2"); gr->Surf(a,"BbcyrR#"); - gr->Axis(); gr->Grid(); gr->Box(); - gr->SetRotatedText(false); - gr->Label('t',"A",1); gr->Label('x',"B",1); - gr->Label('y',"C",1); gr->Label('z',"D",1); - gr->Ternary(0); -} -//----------------------------------------------------------------------------- -void smgl_drops(mglGraph *gr) // flag # -{ - gr->VertexColor(false); // not strictly required, but looks better imho - gr->Light(true); gr->Alpha(false); - gr->Text(mglPoint(-1,1.2),"sh=0"); - gr->Drop(mglPoint(-1,0),mglPoint(0,1),0.5,"r",0); - gr->Text(mglPoint(-0.33,1.2),"sh=0.33"); - gr->Drop(mglPoint(-0.33,0),mglPoint(0,1),0.5,"r",0.33); - gr->Text(mglPoint(0.33,1.2),"sh=0.67"); - gr->Drop(mglPoint(0.33,0),mglPoint(0,1),0.5,"r",0.67); - gr->Text(mglPoint(1,1.2),"sh=1"); - gr->Drop(mglPoint(1,0),mglPoint(0,1),0.5,"r",1); - gr->Ball(mglPoint(-1,0,1),'k'); - gr->Ball(mglPoint(-0.33,0,1),'k'); - gr->Ball(mglPoint(0.33,0,1),'k'); - gr->Ball(mglPoint(1,0,1),'k'); - gr->Line(mglPoint(-1,0,1),mglPoint(1,0,1),"b"); -} -//----------------------------------------------------------------------------- -void smgl_fish(mglGraph *gr) // flag # -{ - gr->VertexColor(false); // the model is big even without information on point colors - gr->Compression(true); // fishes are important, not their scales - gr->DoubleSided(false); // we do not get into drops, while rendering internal surfaces may have negative impact on performace - gr->Light(true); gr->Alpha(false); - mglData a(10,10), b(10,10), x(10,10), y(10,10); - a.Modify("0.3*x+rnd"); x.Modify("x+0.1*rnd"); - b.Modify("0.3*y+rnd"); y.Modify("y+0.1*rnd"); - - gr->Clf(); - gr->Axis(mglPoint(0,0),mglPoint(1.1,1.1)); - gr->Light(true); - gr->Dew(x,y,a,b,"BbcyrR"); - gr->Compression(false); gr->DoubleSided(true); -} -//----------------------------------------------------------------------------- -void smgl_mirror(mglGraph *gr) // flag # -{ - gr->VertexColor(true); gr->TextureColor(false); // Let us use pre-lighting for this example - mglData a(30,40),x(30),y1(40),y2(40); - a.Modify("pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)"); - x.Fill(-1,1); y1.Fill(0,1); y2.Fill(0,-1); - - gr->Alpha(false); gr->Rotate(40,60); - gr->Light(true); gr->Box(); - gr->Surf(x,y1,a,"r"); gr->Surf(x,y2,a,"b"); - gr->VertexColor(false); gr->TextureColor(true); // set settings back -} -//----------------------------------------------------------------------------- -void smgl_semilog(mglGraph *gr) // semi-log axis -{ - mglData x(2000), y(2000); - x.Modify("0.01/(x+10^(-5))"); y.Modify("sin(1/v)",x); - - gr->Axis(mglPoint(0.01,-1),mglPoint(1000,1)); - gr->SetFunc("lg(x)",0,0); gr->SetTicks('x', 0); gr->Box(); - gr->Plot(x,y,"b2"); - gr->Axis(); gr->Grid("xy","g"); - gr->Label('x',"x",0); gr->Label('y', "y = sin 1/x",0); -} -//----------------------------------------------------------------------------- -void smgl_loglog(mglGraph *gr) // log-log axis -{ - mglData x(2000), y(2000); - x.Modify("pow(10,6*x-3)"); y.Modify("sqrt(1+v^2)",x); - - gr->Axis(mglPoint(0.001,0.1),mglPoint(1000,1000)); - gr->SetFunc("lg(x)","lg(y)",0); - gr->SetTicks('x', 0); - gr->SetTicks('y', 0); - gr->Box(); gr->Axis(); gr->Grid("xy","g;"); - gr->Plot(x,y,"b2"); - gr->Label('x',"x",0); gr->Label('y', "y=\\sqrt{1+x^2}",0); -} -//----------------------------------------------------------------------------- -void smgl_fit(mglGraph *gr) // nonlinear fitting -{ - mglData rnd(100), in(100), res; - rnd.Fill("0.4*rnd+0.1+sin(2*pi*x)", gr->Min, gr->Max); - in.Fill("0.3+sin(2*pi*x)", gr->Min, gr->Max); - - gr->Axis(mglPoint(-1,-2), mglPoint(1,2)); - gr->Plot(rnd, ". "); - gr->Box(); - - mreal ini[3] = {1,1,3}; - gr->Fit(res, rnd, "a+b*sin(c*x)", "abc", ini); - gr->Plot(res, "r"); - gr->Plot(in, "b"); - gr->Text(mglPoint(-1, -1.3), "fitted:", "L:r", -1); - gr->PutsFit(mglPoint(0, -1.8), "y = ", "C:r", -1); - gr->Text(mglPoint(0, 2.2), "initial: y = 0.3+sin(2\\pi x)", "C:b", -1); - gr->Axis(mglPoint(-1,-1,-1),mglPoint(1,1,1),mglPoint(0,0,0)); -} -//----------------------------------------------------------------------------- -#include -void smgl_parser(mglGraph *gr) // example of MGL parsing -{ - mreal a[100]; // let a_i = sin(4*pi*x), x=0...1 - for(int i=0;i<100;i++)a[i]=sin(4*M_PI*i/99); - mglParse *parser = new mglParse; - mglData &d =(parser->AddVar("dat"))->d; - d.Set(a,100); // set data to variable - parser->Execute(gr, "plot dat; xrange 0 1\nbox\naxis"); - // you may break script at any line do something - // and continue after that - parser->Execute(gr, "xlabel 'x'\nylabel 'y'\nbox"); - // also you may use cycles or conditions in script - parser->Execute(gr, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext"); - delete parser; -} -//----------------------------------------------------------------------------- -void smgl_2_axis(mglGraph *gr) // 2 axis -{ - mglData y1,y2; mgls_prepare1d(0,&y2,&y1); - gr->Axis(mglPoint(-1,-1,-1),mglPoint(1,1,1),mglPoint(-1,-1,-1)); - gr->Axis(); gr->Label('y',"axis 1",0); gr->Plot(y1,"b"); - // set up second axis - gr->Axis(mglPoint(0,0,0),mglPoint(1,1,1),mglPoint(1,1,1)); - gr->Axis(); gr->Label('y',"axis 2",0); gr->Stem(y2,"r"); -} -//----------------------------------------------------------------------------- -void smgl_flow_dens(mglGraph *gr) // flow threads and density plot -{ - mglData a,b,d; mgls_prepare2v(&a,&b); d = a; - for(int i=0;iFlow(a,b,"br",5,true,(type==5 || type==9 || type==10)?-0.99:NAN); - gr->Dens(d,"BbcyrR"); gr->Box(); -} -//----------------------------------------------------------------------------- -void smgl_surf_cont(mglGraph *gr) // contour lines over surface -{ - mglData a; mgls_prepare2d(&a); - gr->Rotate(40,60); - gr->Box(); gr->Surf(a,"kw"); - gr->CAxis(-1,0); gr->Cont(a,"w"); - gr->CAxis( 0,1); gr->Cont(a,"k"); -} -//----------------------------------------------------------------------------- -void smgl_mesh_cont(mglGraph *gr) // contours under mesh -{ - mglData a; mgls_prepare2d(&a); - gr->Rotate(40,60); - gr->Box(); gr->Mesh(a); gr->Cont(a, 0, 7, -1); -} -//----------------------------------------------------------------------------- -void smgl_surf_cont_y(mglGraph *gr) // contours on the surface -{ - mglData a; mgls_prepare2d(&a); - gr->Rotate(40,60); gr->Light(true); - gr->Box(); gr->Surf(a); gr->Cont(a,"y"); -} -//----------------------------------------------------------------------------- -void smgl_surf_cont_fog(mglGraph *gr) // contours on the surface in fog -{ - mglData a; mgls_prepare2d(&a); - gr->Rotate(40,60); gr->Light(true); gr->Fog(1,0.1); - gr->Box(); gr->Surf(a); gr->Cont(a,"y"); -} -//----------------------------------------------------------------------------- -void smgl_surf_caxis(mglGraph *gr) // caxis and the surface -{ - mglData a; mgls_prepare2d(&a); - gr->Rotate(40,60); gr->Light(true); - gr->CAxis(0,1); gr->Box(); gr->Surf(a); -} -//----------------------------------------------------------------------------- -void smgl_surf_cut(mglGraph *gr) // cutting -{ - mglData a; mgls_prepare2d(&a); - gr->Rotate(40,60); gr->Light(true); - gr->Axis(mglPoint(-1,-1,0),mglPoint(1,1,1)); gr->Cut=false; - gr->Box(); gr->Surf(a); -} -//----------------------------------------------------------------------------- -void smgl_several_light(mglGraph *gr) // several light sources -{ - mglData a; mgls_prepare2d(&a); - gr->Rotate(40,60); gr->Light(true); - gr->Light(1,mglPoint(0,1,0),'c'); gr->Light(2,mglPoint(1,0,0),'y'); - gr->Light(3,mglPoint(0,-1,0),'m'); - gr->Box(); gr->Surf(a,"h"); - gr->Light(1,false); gr->Light(2,false); gr->Light(3,false); -} -//----------------------------------------------------------------------------- -void mgls_preparecc(mglData *c) -{ - register long i,j,k,n=61,m=51,l=40,i0; - if(!c) return; c->Create(n,m,l); - mreal x,y,z; - for(i=0;ia[i0] = -2*(x*x + y*y + z*z*z*z - z*z - 0.1); - } -} -//----------------------------------------------------------------------------- -void smgl_cutminmax2(mglGraph *gr) // CutMin CutMax example -{ - mglData c; mgls_preparecc(&c); - mglData v(10); v.Fill(-0.5,1); - gr->Rotate(40,60); gr->Light(true); - gr->VertexColor(false); gr->Compression(false); - gr->CutMin = mglPoint(0,-1,-1); gr->CutMax = mglPoint(1,0,1.1); - gr->Box(); gr->Surf3(-0.5,c); - gr->ContF3(v,c,'x',-1); gr->ContF3(v,c,'y',-1); - gr->ContF3(v,c,'z',0); gr->ContF3(v,c,'z',39); -} -//----------------------------------------------------------------------------- -void smgl_cutminmax(mglGraph *gr) // CutMin CutMax example -{ - mglData c; mgls_preparecc(&c); - gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); - gr->VertexColor(false); gr->Compression(false); - gr->CutMin = mglPoint(0,-1,-1); gr->CutMax = mglPoint(1,0,1.1); - gr->Box(); gr->Surf3(c); -} -//----------------------------------------------------------------------------- -void smgl_surf3_cutoff(mglGraph *gr) // CutMin CutMax example -{ - mglData c; mgls_preparecc(&c); - gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); - gr->VertexColor(false); gr->Compression(false); - gr->CutOff("(z>(x+0.5*y-1)^2-1) & (z>(x-0.5*y-1)^2-1)"); - gr->Box(); gr->Surf3(c); -} -//----------------------------------------------------------------------------- -void smgl_boxplot(mglGraph *gr) // flow threads and density plot -{ - mglData a(10,7); a.Modify("(2*rnd-1)^3/2"); - gr->Box(); gr->BoxPlot(a); gr->Plot(a," ko"); -} -//----------------------------------------------------------------------------- -int main(int argc,char **argv) -{ - const char *suf = ""; - char name[256]=""; - int ch; - mglGraphIDTF u3d; - mglGraphZB zb; - mglGraphPS ps; - mglGraphAB *gr = NULL; - mglSample *s=samp; - while(( ch = getopt_long_only(argc, argv, "", longopts, NULL)) != -1) - switch(ch) - { - case 0: break; - case 'w': width =atoi(optarg); break; - case 'h': height=atoi(optarg); break; - case 'k': strcpy(name, optarg); break; - case 't': mglNumThr=atoi(optarg); break; - case 'l': - while(s->name[0]) { printf("%s ",s->name); s++; } - printf("\n"); return 0; - case '?': - default: usage(); return 0; - } - - if(type==5 || type==9 || type==10) - { - u3d.unrotate_flag = true; - gr = &u3d; - } - else - { - if(type==1 || type==2 || type==8) gr = &ps; - else gr = &zb; - } - - if(mini) { gr->SetSize(200,133); suf = "_sm"; } - else if(big) - { gr->SetSize(1200,800); suf = "_lg"; gr->BaseLineWidth = 2; } - else gr->SetSize(width,height); - - if(dotest) - { - mglTestMode=true; test(gr); - gr->WriteEPS("test.eps"); gr->WritePNG("test.png","",false); - return 0; - } - - if(srnd) mgl_srnd(1); - gr->VertexColor(false); gr->TextureColor(true); gr->Compression(false); - if(name[0]==0) while(s->name[0]) // all samples - { - gr->DefaultPlotParam(); gr->Clf(); - s->func(gr); save(gr, s->name, suf); - fflush(stdout); s++; - } - else // manual sample - { - mglSample tst; tst.name=name; - int i=0; +extern mglSample samp[]; +int type = 0; +int dotest = 0; +int width = 600; +int height = 400; +int mini = 0; +int big = 0; +int srnd = 0; +mglData sdat; +//----------------------------------------------------------------------------- +static struct option longopts[] = +{ + { "test", no_argument, &dotest, 1 }, + { "srnd", no_argument, &srnd, 1 }, + { "width", required_argument, NULL, 'w' }, + { "height", required_argument, NULL, 'h' }, + { "list", no_argument, NULL, 'l' }, + { "kind", required_argument, NULL, 'k' }, + { "thread", required_argument, NULL, 't' }, + { "mini", no_argument, &mini, 1 }, + { "big", no_argument, &big, 1 }, + { "png", no_argument, &type, 0 }, + { "eps", no_argument, &type, 1 }, + { "svg", no_argument, &type, 2 }, + { "solid", no_argument, &type, 3 }, + { "jpeg", no_argument, &type, 4 }, + { "idtf", no_argument, &type, 5 }, + { "gif", no_argument, &type, 6 }, + { "none", no_argument, &type, 7 }, + { "bps", no_argument, &type, 8 }, + { "u3d", no_argument, &type, 9 }, + { "pdf", no_argument, &type, 10 }, + { "help", no_argument, NULL, '?' }, + { NULL, 0, NULL, 0 } +}; +//----------------------------------------------------------------------------- +void usage() +{ + puts ( \ + "-png - output png\n" \ + "-width=num - png picture width\n" \ + "-height=num - png picture height\n" \ + "-mini - png picture is 200x133\n" \ + "-big - png picture is 1200x800\n" \ + "-idtf - output idtf\n" \ + "-u3d - output u3d\n" \ + "-pdf - output pdf\n" \ + "-eps - output EPS\n" \ + "-jpeg - output JPEG\n" \ + "-solid - output solid PNG\n" \ + "-svg - output SVG\n" \ + "-none - none output\n" \ + "-srnd - use the same random numbers in any run\n" \ + "-kind=name - produce only this picture" \ + "-thread=num - number of threads used" \ + "-test - perform test\n" + ); +// exit(0); +}; +//----------------------------------------------------------------------------- +void save(mglGraph *gr,const char *name,const char *suf="") +{ +// return; + char buf[128]; + printf("%s ",name); fflush(stdout); + switch(type) + { + case 1: // EPS + sprintf(buf,"%s%s.eps",name,suf); + gr->WriteEPS(buf); + break; + case 2: // SVG + sprintf(buf,"%s%s.svg",name,suf); + gr->WriteSVG(buf); break; + case 3: // PNG + sprintf(buf,"%s%s.png",name,suf); + gr->WritePNG(buf,0,true); break; + case 4: // JPEG + sprintf(buf,"%s%s.jpg",name,suf); + gr->WriteJPEG(buf); break; + case 5: // IDTF + sprintf(buf,"%s%s.idtf",name,suf); + gr->WriteIDTF(buf); break; + case 6: // GIF + sprintf(buf,"%s%s.gif",name,suf); + gr->WriteGIF(buf); break; + case 7: // none + break; + case 8: // EPS to PNG + sprintf(buf,"%s%s.png",name,suf); + gr->WritePNG(buf,0,false); + break; + case 9: // U3D + sprintf(buf,"%s%s.u3d",name,suf); +// gr->WriteU3D(buf); break; // TODO: Add IDTF support + case 10: // PDF + sprintf(buf,"%s%s.pdf",name,suf); +// gr->WritePDF(buf); break; // TODO: Add IDTF support + default:// PNG (no alpha) + sprintf(buf,"%s%s.png",name,suf); + gr->WritePNG(buf,0,false); break; + } +} +//----------------------------------------------------------------------------- +// Sample functions +//----------------------------------------------------------------------------- +void smgl_tval(mglGraph *gr) // ticks features +{ + gr->SetRanges(-M_PI,M_PI, 0, 2); + float val[]={-M_PI, -M_PI/2, 0, 0.886, M_PI/2, M_PI}; + mglData xt(6,val); + gr->SetTicksVal('x', xt, "-\\pi\n-\\pi/2\n\n0\nx^*\n\\pi/2\n\\pi"); + gr->Axis(); gr->Grid(); + gr->FPlot("2*cos(x^2)^2", "r2"); +} +//----------------------------------------------------------------------------- +void smgl_fonts(mglGraph *gr) // ticks features +{ + float h=1.1, d=0.25; + gr->LoadFont("STIX"); gr->Puts(mglPoint(0,h), "default font (STIX)"); + gr->LoadFont("adventor"); gr->Puts(mglPoint(0,h-d), "adventor font"); + gr->LoadFont("bonum"); gr->Puts(mglPoint(0,h-2*d), "bonum font"); + gr->LoadFont("chorus"); gr->Puts(mglPoint(0,h-3*d), "chorus font"); + gr->LoadFont("cursor"); gr->Puts(mglPoint(0,h-4*d), "cursor font"); + gr->LoadFont("heros"); gr->Puts(mglPoint(0,h-5*d), "heros font"); + gr->LoadFont("heroscn"); gr->Puts(mglPoint(0,h-6*d), "heroscn font"); + gr->LoadFont("pagella"); gr->Puts(mglPoint(0,h-7*d), "pagella font"); + gr->LoadFont("schola"); gr->Puts(mglPoint(0,h-8*d), "schola font"); + gr->LoadFont("termes"); gr->Puts(mglPoint(0,h-9*d), "termes font"); + gr->LoadFont("STIX"); +} +//----------------------------------------------------------------------------- +void smgl_stick(mglGraph *gr) // column plot +{ + if(type==5 || type==9 || type==10) + gr->Puts(mglPoint(0,0),"Does not work in 3D\\n for reasons I do not care to investigate till 2.0"); + + gr->SetRanges(-1, 1, -1, 1, 0, 1); gr->Light(true); + gr->StickPlot(3, 0, 40, 30); gr->Axis("xyz_"); + gr->FSurf("exp(-10*y^2-6*x^2)"); + gr->Puts(mglPoint(0.2, 0, 1.2), "z=0", "", -2); + gr->StickPlot(3, 1, 40, 30); gr->Axis("xyz_"); + gr->FSurf("exp(-10*y^2/2-6*x^2)/sqrt(2)"); + gr->Puts(mglPoint(0.2, 0, 1.2), "z=1", "", -2); + gr->StickPlot(3, 2, 40, 30); gr->Axis("xyz_"); + gr->FSurf("exp(-10*y^2/5-6*x^2)/sqrt(5)"); + gr->Puts(mglPoint(0.2, 0, 1.2), "z=2", "", -2); + gr->Label('x',"\\tau", 0); gr->Label('y', "\\rho"); +} +//----------------------------------------------------------------------------- +void smgl_column(mglGraph *gr) // column plot +{ + char str[32]; + for(int i=0;i<4;i++) + { + gr->ColumnPlot(4,i); + gr->Box(); + sprintf(str,"Plot %d of 4",i); + gr->Puts(mglPoint(-0.5,0.5),str,"",-2); + sprintf(str,"sin(pi*x+pi*%d/2)",i); + gr->FPlot(str); + } +} +//----------------------------------------------------------------------------- +void smgl_map(mglGraph *gr) // example of mapping +{ + mglData a(50, 40), b(50, 40); + gr->Puts(mglPoint(0, 0), "\\to", ":C", -1.4); + gr->SetRanges(-1,1,-1,1,-2,2); + + gr->SubPlot(2, 1, 0); + gr->Fill(a,"x"); gr->Fill(b,"y"); + gr->Puts(mglPoint(0, 1.1), "\\{x, y\\}", ":C", -2); gr->Box(); + gr->Map(a, b, "brgk"); + + gr->SubPlot(2, 1, 1); + gr->Fill(a,"(x^3+y^3)/2"); gr->Fill(b,"(x-y)/2"); + gr->Puts(mglPoint(0, 1.1), "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", ":C", -2); + gr->Box(); + gr->Map(a, b, "brgk"); +} +//----------------------------------------------------------------------------- +void smgl_color_schemes(mglGraph *gr) // Color table +{ + mglData a(256,2); a.Fill(-1,1); + gr->SubPlot(2,10,0,0.2); gr->Dens(a,"kw"); + gr->Puts(mglPoint(-1.4, -0.3), "kw", ":C", -8); + gr->SubPlot(2,10,1,0.2); gr->Dens(a,"wk"); + gr->Puts(mglPoint(-1.4, -0.3), "wk", ":C", -8); + gr->SubPlot(2,10,2,0.2); gr->Dens(a,"kHCcw"); + gr->Puts(mglPoint(-1.4, -0.3), "kHCcw", ":C", -8); + gr->SubPlot(2,10,3,0.2); gr->Dens(a,"kBbcw"); + gr->Puts(mglPoint(-1.4, -0.3), "kBbcw", ":C", -8); + gr->SubPlot(2,10,4,0.2); gr->Dens(a,"kRryw"); + gr->Puts(mglPoint(-1.4, -0.3), "kRryw", ":C", -8); + gr->SubPlot(2,10,5,0.2); gr->Dens(a,"kGgew"); + gr->Puts(mglPoint(-1.4, -0.3), "kGgew", ":C", -8); + gr->SubPlot(2,10,6,0.2); gr->Dens(a,"BbwrR"); + gr->Puts(mglPoint(-1.4, -0.3), "BbwrR", ":C", -8); + gr->SubPlot(2,10,7,0.2); gr->Dens(a,"BbwgG"); + gr->Puts(mglPoint(-1.4, -0.3), "BbwgG", ":C", -8); + gr->SubPlot(2,10,8,0.2); gr->Dens(a,"GgwmM"); + gr->Puts(mglPoint(-1.4, -0.3), "GgwmM", ":C", -8); + gr->SubPlot(2,10,9,0.2); gr->Dens(a,"UuwqR"); + gr->Puts(mglPoint(-1.4, -0.3), "UuwqR", ":C", -8); + gr->SubPlot(2,10,10,0.2); gr->Dens(a,"QqwcC"); + gr->Puts(mglPoint(-1.4, -0.3), "QqwcC", ":C", -8); + gr->SubPlot(2,10,11,0.2); gr->Dens(a,"CcwyY"); + gr->Puts(mglPoint(-1.4, -0.3), "CcwyY", ":C", -8); + gr->SubPlot(2,10,12,0.2); gr->Dens(a,"bcwyr"); + gr->Puts(mglPoint(-1.4, -0.3), "bcwyr", ":C", -8); + gr->SubPlot(2,10,13,0.2); gr->Dens(a,"bwr"); + gr->Puts(mglPoint(-1.4, -0.3), "bwr", ":C", -8); + gr->SubPlot(2,10,14,0.2); gr->Dens(a,"BbcyrR"); + gr->Puts(mglPoint(-1.4, -0.3), "BbcyrR", ":C", -8); + gr->SubPlot(2,10,15,0.2); gr->Dens(a,"UbcyqR"); + gr->Puts(mglPoint(-1.4, -0.3), "UbcyqR", ":C", -8); + gr->SubPlot(2,10,16,0.2); gr->Dens(a,"BbcwyrR"); + gr->Puts(mglPoint(-1.4, -0.3), "BbcwyrR", ":C", -8); + gr->SubPlot(2,10,17,0.2); gr->Dens(a,"bcyr"); + gr->Puts(mglPoint(-1.4, -0.3), "bcyr", ":C", -8); + gr->SubPlot(2,10,18,0.2); gr->Dens(a,"BbcyrR|"); + gr->Puts(mglPoint(-1.4, -0.3), "BbcyrR|", ":C", -8); + gr->SubPlot(2,10,19,0.2); gr->Dens(a,"bgr"); + gr->Puts(mglPoint(-1.4, -0.3), "bgr", ":C", -8); +} +//----------------------------------------------------------------------------- +void smgl_colors(mglGraph *gr) // Color table +{ + //#LENUQ + gr->FaceZ(mglPoint(-1, -1), 0.4, 0.3, "L#"); gr->Puts(mglPoint(-0.8,-0.9), "L", "w:C", -1.4); + gr->FaceZ(mglPoint(-0.6,-1), 0.4, 0.3, "E#"); gr->Puts(mglPoint(-0.4,-0.9), "E", "w:C", -1.4); + gr->FaceZ(mglPoint(-0.2,-1), 0.4, 0.3, "N#"); gr->Puts(mglPoint(0, -0.9), "N", "w:C", -1.4); + gr->FaceZ(mglPoint(0.2, -1), 0.4, 0.3, "U#"); gr->Puts(mglPoint(0.4,-0.9), "U", "w:C", -1.4); + gr->FaceZ(mglPoint(0.6, -1), 0.4, 0.3, "Q#"); gr->Puts(mglPoint(0.8,-0.9), "Q", "w:C", -1.4); + //#lenuq + gr->FaceZ(mglPoint(-1, -0.7), 0.4, 0.3, "l#"); gr->Puts(mglPoint(-0.8,-0.6), "l", "k:C", -1.4); + gr->FaceZ(mglPoint(-0.6,-0.7), 0.4, 0.3, "e#"); gr->Puts(mglPoint(-0.4,-0.6), "e", "k:C", -1.4); + gr->FaceZ(mglPoint(-0.2,-0.7), 0.4, 0.3, "n#"); gr->Puts(mglPoint(0, -0.6), "n", "k:C", -1.4); + gr->FaceZ(mglPoint(0.2, -0.7), 0.4, 0.3, "u#"); gr->Puts(mglPoint(0.4,-0.6), "u", "k:C", -1.4); + gr->FaceZ(mglPoint(0.6, -0.7), 0.4, 0.3, "q#"); gr->Puts(mglPoint(0.8,-0.6), "q", "k:C", -1.4); + //#CMYkP + gr->FaceZ(mglPoint(-1, -0.4), 0.4, 0.3, "C#"); gr->Puts(mglPoint(-0.8,-0.3), "C", "w:C", -1.4); + gr->FaceZ(mglPoint(-0.6,-0.4), 0.4, 0.3, "M#"); gr->Puts(mglPoint(-0.4,-0.3), "M", "w:C", -1.4); + gr->FaceZ(mglPoint(-0.2,-0.4), 0.4, 0.3, "Y#"); gr->Puts(mglPoint(0, -0.3), "Y", "w:C", -1.4); + gr->FaceZ(mglPoint(0.2, -0.4), 0.4, 0.3, "k#"); gr->Puts(mglPoint(0.4,-0.3), "k", "w:C", -1.4); + gr->FaceZ(mglPoint(0.6, -0.4), 0.4, 0.3, "P#"); gr->Puts(mglPoint(0.8,-0.3), "P", "w:C", -1.4); + //#cmywp + gr->FaceZ(mglPoint(-1, -0.1), 0.4, 0.3, "c#"); gr->Puts(mglPoint(-0.8, 0), "c", "k:C", -1.4); + gr->FaceZ(mglPoint(-0.6,-0.1), 0.4, 0.3, "m#"); gr->Puts(mglPoint(-0.4, 0), "m", "k:C", -1.4); + gr->FaceZ(mglPoint(-0.2,-0.1), 0.4, 0.3, "y#"); gr->Puts(mglPoint(0, 0), "y", "k:C", -1.4); + gr->FaceZ(mglPoint(0.2, -0.1), 0.4, 0.3, "w#"); gr->Puts(mglPoint(0.4, 0), "w", "k:C", -1.4); + gr->FaceZ(mglPoint(0.6, -0.1), 0.4, 0.3, "p#"); gr->Puts(mglPoint(0.8, 0), "p", "k:C", -1.4); + //#BGRHW + gr->FaceZ(mglPoint(-1, 0.2), 0.4, 0.3, "B#"); gr->Puts(mglPoint(-0.8, 0.3), "B", "w:C", -1.4); + gr->FaceZ(mglPoint(-0.6,0.2), 0.4, 0.3, "G#"); gr->Puts(mglPoint(-0.4, 0.3), "G", "w:C", -1.4); + gr->FaceZ(mglPoint(-0.2,0.2), 0.4, 0.3, "R#"); gr->Puts(mglPoint(0, 0.3), "R", "w:C", -1.4); + gr->FaceZ(mglPoint(0.2, 0.2), 0.4, 0.3, "H#"); gr->Puts(mglPoint(0.4, 0.3), "H", "w:C", -1.4); + gr->FaceZ(mglPoint(0.6, 0.2), 0.4, 0.3, "W#"); gr->Puts(mglPoint(0.8, 0.3), "W", "w:C", -1.4); + //#bgrhw + gr->FaceZ(mglPoint(-1, 0.5), 0.4, 0.3, "b#"); gr->Puts(mglPoint(-0.8, 0.6), "b", "k:C", -1.4); + gr->FaceZ(mglPoint(-0.6,0.5), 0.4, 0.3, "g#"); gr->Puts(mglPoint(-0.4, 0.6), "g", "k:C", -1.4); + gr->FaceZ(mglPoint(-0.2,0.5), 0.4, 0.3, "r#"); gr->Puts(mglPoint(0, 0.6), "r", "k:C", -1.4); + gr->FaceZ(mglPoint(0.2, 0.5), 0.4, 0.3, "h#"); gr->Puts(mglPoint(0.4, 0.6), "h", "k:C", -1.4); + gr->FaceZ(mglPoint(0.6, 0.5), 0.4, 0.3, "w#"); gr->Puts(mglPoint(0.8, 0.6), "w", "k:C", -1.4); + //#brighted + gr->FaceZ(mglPoint(-1, 0.8), 0.4, 0.3, "{r1}#"); gr->Puts(mglPoint(-0.8, 0.9), "\\{r1\\}", "w:C", -1.4); + gr->FaceZ(mglPoint(-0.6,0.8), 0.4, 0.3, "{r3}#"); gr->Puts(mglPoint(-0.4, 0.9), "\\{r3\\}", "w:C", -1.4); + gr->FaceZ(mglPoint(-0.2,0.8), 0.4, 0.3, "{r5}#"); gr->Puts(mglPoint(0, 0.9), "\\{r5\\}", "k:C", -1.4); + gr->FaceZ(mglPoint(0.2, 0.8), 0.4, 0.3, "{r7}#"); gr->Puts(mglPoint(0.4, 0.9), "\\{r7\\}", "k:C", -1.4); + gr->FaceZ(mglPoint(0.6, 0.8), 0.4, 0.3, "{r9}#"); gr->Puts(mglPoint(0.8, 0.9), "\\{r9\\}", "k:C", -1.4); +} +//----------------------------------------------------------------------------- +void smgl_qo2d(mglGraph *gr) +{ + gr->Compression(true); // try to save space + mglData r, xx, yy, a, im(128), re(128); + const char *ham = "p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)"; + r = mglRay(ham, mglPoint(-0.7, -1), mglPoint(0, 0.5), 0.02, 2); + gr->Plot(r.SubData(0), r.SubData(1), "k"); + gr->Axis(); gr->Label('x', "\\i x"); gr->Label('y', "\\i z"); + // now start beam tracing + gr->Fill(re,"exp(-48*x^2)"); + a = mglQO2d(ham, re, im, r, xx, yy, 1, 30); + gr->SetRange('c',0, 1); + gr->Dens(xx, yy, a, "wyrRk"); + gr->FPlot("-x", "k|"); + gr->Puts(mglPoint(0, 0.85), "absorption: (x+y)/2 for x+y>0"); + gr->Puts(mglPoint(0.7, -0.05), "central ray"); + gr->Puts(mglPoint(0,1.1),"Beam and ray tracing"); + gr->Compression(false); //put setting back +} +//----------------------------------------------------------------------------- +void smgl_pde(mglGraph *gr) // PDE and Ray sample +{ + gr->Compression(true); // try to save space + mglData a,re(128),im(128); + gr->Axis(); + gr->Label('x', "\\i x"); + gr->Label('y', "\\i z"); + + gr->Fill(re,"exp(-48*(x+0.7)^2)"); + a = gr->PDE("p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)", re, im, 0.01, 30); + a.Transpose("yxz"); + gr->SetRange('c',0, 1); + gr->Dens(a,"wyrRk"); + gr->FPlot("-x", "k|"); + gr->Puts(mglPoint(0, 0.85), "absorption: (x+z)/2 for x+z>0"); + gr->Puts(mglPoint(0,1.1),"Equation: ik_0\\partial_zu + \\Delta u + x\\cdot u + i \\frac{x+z}{2}\\cdot u = 0"); + gr->Compression(false); //put setting back +} +//----------------------------------------------------------------------------- +void smgl_stfa(mglGraph *gr) // STFA sample +{ + mglData a(2000), b(2000); + gr->Fill(a,"cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+\ + cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)"); + gr->SubPlot(1, 2, 0); + gr->Plot(a); + gr->Axis(); + gr->Label('x', "\\i t"); + + gr->SubPlot(1, 2, 1); + gr->STFA(a, b, 64, "BbcyrR"); + gr->Axis(); + gr->Label('x', "\\i t"); + gr->Label('y', "\\omega", 0); +} +//----------------------------------------------------------------------------- +void smgl_envelop(mglGraph *gr) // Envelop reconstruction +{ + mglData a(1000); + gr->Fill(a,"exp(-8*x^2)*sin(10*pi*x)"); + gr->Plot(a, "b"); + a.Envelop('x'); + gr->Plot(a, "r"); + gr->Axis(); +} +//----------------------------------------------------------------------------- +void smgl_sew(mglGraph *gr) // Phase reconstruction +{ + gr->VertexColor(false); + mglData a(100, 100); + a.Modify("mod((y^2-(1-x)^2)/2,0.1)"); + gr->Rotate(40, 60); + gr->Light(true); + gr->Alpha(true); + gr->Surf(a, "b"); + a.Sew("xy", 0.1); + gr->Surf(a, "r"); + gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_samplee(mglGraph *gr) // TeX sample +{ + gr->Puts(mglPoint(0), "\\sqrt{\\frac{\\alpha^{\\gamma^2}+\\overset 1{\\big\\infty}}{\\sqrt3{2+b}}}", 0, -4); +} +//----------------------------------------------------------------------------- +void smgl_sampled(mglGraph *gr) // arrow styles +{ + float a=0.1,b=0.4,c=0.5; + gr->Line(mglPoint(a,1),mglPoint(b,1),"k-A"); gr->Puts(mglPoint(c,1),"Style 'A' or 'A\\_'",":rL"); + gr->Line(mglPoint(a,0.8),mglPoint(b,0.8),"k-V"); gr->Puts(mglPoint(c,0.8),"Style 'V' or 'V\\_'",":rL"); + gr->Line(mglPoint(a,0.6),mglPoint(b,0.6),"k-K"); gr->Puts(mglPoint(c,0.6),"Style 'K' or 'K\\_'",":rL"); + gr->Line(mglPoint(a,0.4),mglPoint(b,0.4),"k-I"); gr->Puts(mglPoint(c,0.4),"Style 'I' or 'I\\_'",":rL"); + gr->Line(mglPoint(a,0.2),mglPoint(b,0.2),"k-D"); gr->Puts(mglPoint(c,0.2),"Style 'D' or 'D\\_'",":rL"); + gr->Line(mglPoint(a,0),mglPoint(b,0),"k-S"); gr->Puts(mglPoint(c,0),"Style 'S' or 'S\\_'",":rL"); + gr->Line(mglPoint(a,-0.2),mglPoint(b,-0.2),"k-O"); gr->Puts(mglPoint(c,-0.2),"Style 'O' or 'O\\_'",":rL"); + gr->Line(mglPoint(a,-0.4),mglPoint(b,-0.4),"k-T"); gr->Puts(mglPoint(c,-0.4),"Style 'T' or 'T\\_'",":rL"); + gr->Line(mglPoint(a,-0.6),mglPoint(b,-0.6),"k-_"); gr->Puts(mglPoint(c,-0.6),"Style '\\_' or none",":rL"); + gr->Line(mglPoint(a,-0.8),mglPoint(b,-0.8),"k-AS"); gr->Puts(mglPoint(c,-0.8),"Style 'AS'",":rL"); + gr->Line(mglPoint(a,-1),mglPoint(b,-1),"k-_A"); gr->Puts(mglPoint(c,-1),"Style '\\_A'",":rL"); + + a=-1; b=-0.7; c=-0.6; + gr->Line(mglPoint(a,1),mglPoint(b,1),"kAA"); gr->Puts(mglPoint(c,1),"Style 'AA'",":rL"); + gr->Line(mglPoint(a,0.8),mglPoint(b,0.8),"kVV"); gr->Puts(mglPoint(c,0.8),"Style 'VV'",":rL"); + gr->Line(mglPoint(a,0.6),mglPoint(b,0.6),"kKK"); gr->Puts(mglPoint(c,0.6),"Style 'KK'",":rL"); + gr->Line(mglPoint(a,0.4),mglPoint(b,0.4),"kII"); gr->Puts(mglPoint(c,0.4),"Style 'II'",":rL"); + gr->Line(mglPoint(a,0.2),mglPoint(b,0.2),"kDD"); gr->Puts(mglPoint(c,0.2),"Style 'DD'",":rL"); + gr->Line(mglPoint(a,0),mglPoint(b,0),"kSS"); gr->Puts(mglPoint(c,0),"Style 'SS'",":rL"); + gr->Line(mglPoint(a,-0.2),mglPoint(b,-0.2),"kOO"); gr->Puts(mglPoint(c,-0.2),"Style 'OO'",":rL"); + gr->Line(mglPoint(a,-0.4),mglPoint(b,-0.4),"kTT"); gr->Puts(mglPoint(c,-0.4),"Style 'TT'",":rL"); + gr->Line(mglPoint(a,-0.6),mglPoint(b,-0.6),"k-__"); gr->Puts(mglPoint(c,-0.6),"Style '\\_\\_'",":rL"); + gr->Line(mglPoint(a,-0.8),mglPoint(b,-0.8),"k-VA"); gr->Puts(mglPoint(c,-0.8),"Style 'VA'",":rL"); + gr->Line(mglPoint(a,-1),mglPoint(b,-1),"k-AV"); gr->Puts(mglPoint(c,-1),"Style 'AV'",":rL"); +} +//----------------------------------------------------------------------------- +void smgl_samplec(mglGraph *gr) // error boxes +{ + mglData x(10), y(10), ex(10), ey(10), y0(50); + x.Modify("2*x-1 + 0.2*rnd-0.1"); + y.Modify("(2*x-1)^2 + 0.2*rnd-0.1"); + y0.Modify("(2*x-1)^2"); + ex.Modify("0.2"); + ey.Modify("0.1"); + + gr->Clf(); + gr->SubPlot(2,2,0); + gr->Error(y,ey,"ko"); + gr->Plot(y0,"r"); + gr->Axis(); + gr->Puts(mglPoint(0,1.2,0),"Random \\i{y}"); + gr->SubPlot(2,2,1); + gr->Error(x,y,ex,"ko"); + gr->Plot(y0,"r"); + gr->Axis(); + gr->Puts(mglPoint(0,1.2,0),"Random \\i{x, y}"); + gr->SubPlot(2,2,2); + gr->Error(x,y,ey,ey,"ko"); + gr->Plot(y0,"r"); + gr->Axis(); + gr->Puts(mglPoint(0,1.2,0),"Random \\i{x, y} and 2d boxes"); + gr->SubPlot(2,2,3); + gr->Puts(mglPoint(0,1.2,0),"Random point in 3d space"); + gr->Rotate(40,60); + for(int i=0;i<10;i++) + gr->Error(mglPoint(mgl_rnd()-0.5,mgl_rnd()-0.5,mgl_rnd()-0.5), mglPoint(0.1,0.1,0.1),"bo"); + gr->Axis(); + gr->Rotate(0,0); // for unrotate in IDTF +} +//----------------------------------------------------------------------------- +void smgl_sampleb(mglGraph *gr) // Gaussian beam +{ + gr->Alpha(true); gr->Light(true); gr->AddLight(0,mglPoint(0,0,1)); + mglData a(30,30,30), b(30,30,30); + a.Modify("exp(-16*((z-0.5)^2+(y-0.5)^2)/(1+4*x^2))"); + b.Modify("16*((z-0.5)^2+(y-0.5)^2)*(x)/(1+4*x^2)"); + gr->SetRange('c',0,1); + + gr->SubPlot(2,2,0); gr->Rotate(40,60); + gr->VertexColor(false); + // since we have one-color trasparent surfaces - disable (per-vertex) coloring + gr->Surf3(a,"wgk"); gr->Box(); + gr->SubPlot(2,2,1); gr->Rotate(40,60); + gr->Dens3(a,'x'); gr->Dens3(a,'y'); gr->Dens3(a,'z'); + gr->Box(); gr->Axis(); + gr->SubPlot(2,2,2); gr->Rotate(40,60); + gr->Cloud(a); gr->Box(); + gr->SubPlot(2,2,3); gr->Rotate(40,60); + gr->VertexColor(false); + // for variable transparency the only way is to disable smooth (per-vertex) coloring + gr->Surf3A(b,a,"q"); gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_samplea(mglGraph *gr) // flag # +{ + gr->Alpha(true); gr->Light(true); gr->AddLight(0,mglPoint(0,0,1)); + mglData a(30,20); + a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); + + gr->SubPlot(2,2,0); gr->Rotate(40,60); + gr->Surf(a,"BbcyrR#"); gr->Box(); + gr->SubPlot(2,2,1); gr->Rotate(40,60); + gr->Dens(a,"BbcyrR#"); gr->Box(); + gr->SubPlot(2,2,2); gr->Rotate(40,60); + gr->Cont(a,"BbcyrR#"); gr->Box(); + gr->SubPlot(2,2,3); gr->Rotate(40,60); + gr->Axial(a,"BbcyrR#"); gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_sample9(mglGraph *gr) // 2d plot +{ + gr->Light(true); gr->AddLight(0,mglPoint(0,0,1)); + + mglData a0(50,40); + a0.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); + gr->SubPlot(2,2,0); gr->Rotate(60,40); + gr->Surf(a0); gr->Box(); + + mglData x(50,40),y(50,40),z(50,40); + x.Modify("0.8*sin(2*pi*x)*sin(pi*y)"); + y.Modify("0.8*cos(2*pi*x)*sin(pi*y)"); + z.Modify("0.8*cos(pi*y)"); + gr->SubPlot(2,2,1); gr->Rotate(60,40); + gr->Surf(x,y,z,"BbwrR"); gr->Box(); + + mglData a1(50,40,3); + a1.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); + a1.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*sin(3*pi*(x*y))",1); + a1.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",2); + gr->SubPlot(2,2,2); gr->Rotate(60,40); + gr->Alpha(true); + gr->Surf(a1); gr->Box(); + + gr->SubPlot(2,2,3); gr->Rotate(60,40); + gr->Dens(a1); gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_sample8(mglGraph *gr) // 1d plot +{ + mglData y0(50); y0.Modify("sin(pi*(2*x-1))"); + gr->SubPlot(2,2,0); + gr->Plot(y0); gr->Box(); + + gr->SubPlot(2,2,1); + mglData y1(50,2); + y1.Modify("sin(pi*2*x-pi)"); y1.Modify("cos(pi*2*x-pi)/2",1); + gr->Plot(y1); gr->Box(); + + mglData x(50); x.Modify("cos(pi*2*x-pi)"); + gr->Plot(x,y0,"Y+"); + + gr->Plot(y1.SubData(-1,0),y1.SubData(-1,1),"q|"); + + gr->SubPlot(2,2,2); gr->Rotate(60,40); + mglData z(50); z.Modify("2*x-1"); + gr->Plot(x,y0,z); gr->Box(); + + mglData y2(10,3); y2.Modify("cos(pi*(2*x-1-y))"); + y2.Modify("2*x-1",2); + gr->Plot(y2.SubData(-1,0),y2.SubData(-1,1),y2.SubData(-1,2),"bo "); + + gr->SubPlot(2,2,3); gr->Rotate(60,40); + gr->Bars(x,y0,z,"ri"); gr->Box(); + + gr->Rotate(0,0); // for unrotate in IDTF +} +//----------------------------------------------------------------------------- +void smgl_sample7(mglGraph *gr) // smoothing +{ + mglData y0(30),y1,y2,y3; + y0.Modify("0.4*sin(2*pi*x) + 0.3*cos(3*pi*x) - 0.4*sin(4*pi*x)+0.4*rnd"); + + y1=y0; y1.Smooth("x3"); + y2=y0; y2.Smooth("x5"); + y3=y0; y3.Smooth("x"); + + gr->Plot(y0,"k"); gr->AddLegend("NONE","k"); + gr->Plot(y1,"r"); gr->AddLegend("LINE\\_3","r"); + gr->Plot(y2,"g"); gr->AddLegend("LINE\\_5","g"); + gr->Plot(y3,"b"); gr->AddLegend("QUAD\\_5","b"); + gr->Legend(); gr->Box(); + gr->ClearLegend(); // clear legend strings +} +//----------------------------------------------------------------------------- +void smgl_sample6(mglGraph *gr) // differentiate +{ + mglData a(30,40); a.Modify("x*y"); + gr->SetRanges(0,1,0,1,0,1); + gr->SubPlot(2,2,0); gr->Rotate(60,40); + gr->Surf(a); gr->Box(); + gr->Puts(mglPoint(0.7,1,1.2),"a(x,y)"); + gr->SubPlot(2,2,1); gr->Rotate(60,40); + a.Diff("x"); gr->Surf(a); gr->Box(); + gr->Puts(mglPoint(0.7,1,1.2),"da/dx"); + gr->SubPlot(2,2,2); gr->Rotate(60,40); + a.Integral("xy"); gr->Surf(a); gr->Box(); + gr->Puts(mglPoint(0.7,1,1.2),"\\int da/dx dxdy"); + gr->SubPlot(2,2,3); gr->Rotate(60,40); + a.Diff2("y"); gr->Surf(a); gr->Box(); + gr->Puts(mglPoint(0.7,1,1.2),"\\int {d^2}a/dxdy dx"); +} +//----------------------------------------------------------------------------- +void smgl_sample5(mglGraph *gr) // pen styles +{ + if(type==5 || type==9 || type==10) gr->Puts(mglPoint(0,1.2),"line styles not supported",":rL"); + float d,x1,x2,x0,y=0.95; + d=0.3, x0=0.2, x1=0.5, x2=0.6; + gr->Line(mglPoint(x0,1-0*d),mglPoint(x1,1-0*d),"k-"); gr->Puts(mglPoint(x2,y-0*d),"Solid '-'",":rL"); + gr->Line(mglPoint(x0,1-1*d),mglPoint(x1,1-1*d),"k|"); gr->Puts(mglPoint(x2,y-1*d),"Long Dash '|'",":rL"); + gr->Line(mglPoint(x0,1-2*d),mglPoint(x1,1-2*d),"k;"); gr->Puts(mglPoint(x2,y-2*d),"Dash ';'",":rL"); + gr->Line(mglPoint(x0,1-3*d),mglPoint(x1,1-3*d),"k="); gr->Puts(mglPoint(x2,y-3*d),"Small dash '='",":rL"); + gr->Line(mglPoint(x0,1-4*d),mglPoint(x1,1-4*d),"kj"); gr->Puts(mglPoint(x2,y-4*d),"Dash-dot 'j'",":rL"); + gr->Line(mglPoint(x0,1-5*d),mglPoint(x1,1-5*d),"ki"); gr->Puts(mglPoint(x2,y-5*d),"Small dash-dot 'i'",":rL"); + gr->Line(mglPoint(x0,1-6*d),mglPoint(x1,1-6*d),"k:"); gr->Puts(mglPoint(x2,y-6*d),"Dots ':'",":rL"); + gr->Line(mglPoint(x0,1-7*d),mglPoint(x1,1-7*d),"k "); gr->Puts(mglPoint(x2,y-7*d),"None ' '",":rL"); + + d=0.25; x1=-1; x0=-0.8; y = -0.05; + gr->Mark(mglPoint(x1,5*d),"."); gr->Puts(mglPoint(x0,y+5*d),"'.'",":rL"); + gr->Mark(mglPoint(x1,4*d),"+"); gr->Puts(mglPoint(x0,y+4*d),"'+'",":rL"); + gr->Mark(mglPoint(x1,3*d),"x"); gr->Puts(mglPoint(x0,y+3*d),"'x'",":rL"); + gr->Mark(mglPoint(x1,2*d),"*"); gr->Puts(mglPoint(x0,y+2*d),"'*'",":rL"); + gr->Mark(mglPoint(x1,d),"s"); gr->Puts(mglPoint(x0,y+d),"'s'",":rL"); + gr->Mark(mglPoint(x1,0),"d"); gr->Puts(mglPoint(x0,y),"'d'",":rL"); + gr->Mark(mglPoint(x1,-d,0),"o"); gr->Puts(mglPoint(x0,y-d),"'o'",":rL"); + gr->Mark(mglPoint(x1,-2*d,0),"^"); gr->Puts(mglPoint(x0,y-2*d),"'\\^'",":rL"); + gr->Mark(mglPoint(x1,-3*d,0),"v"); gr->Puts(mglPoint(x0,y-3*d),"'v'",":rL"); + gr->Mark(mglPoint(x1,-4*d,0),"<"); gr->Puts(mglPoint(x0,y-4*d),"'<'",":rL"); + gr->Mark(mglPoint(x1,-5*d,0),">"); gr->Puts(mglPoint(x0,y-5*d),"'>'",":rL"); + + d=0.25; x1=-0.5; x0=-0.3; y = -0.05; + gr->Mark(mglPoint(x1,5*d),"#."); gr->Puts(mglPoint(x0,y+5*d),"'\\#.'",":rL"); + gr->Mark(mglPoint(x1,4*d),"#+"); gr->Puts(mglPoint(x0,y+4*d),"'\\#+'",":rL"); + gr->Mark(mglPoint(x1,3*d),"#x"); gr->Puts(mglPoint(x0,y+3*d),"'\\#x'",":rL"); + gr->Mark(mglPoint(x1,2*d),"#*"); gr->Puts(mglPoint(x0,y+2*d),"'\\#*'",":rL"); + gr->Mark(mglPoint(x1,d),"#s"); gr->Puts(mglPoint(x0,y+d),"'\\#s'",":rL"); + gr->Mark(mglPoint(x1,0),"#d"); gr->Puts(mglPoint(x0,y),"'\\#d'",":rL"); + gr->Mark(mglPoint(x1,-d,0),"#o"); gr->Puts(mglPoint(x0,y-d),"'\\#o'",":rL"); + gr->Mark(mglPoint(x1,-2*d,0),"#^"); gr->Puts(mglPoint(x0,y-2*d),"'\\#\\^'",":rL"); + gr->Mark(mglPoint(x1,-3*d,0),"#v"); gr->Puts(mglPoint(x0,y-3*d),"'\\#v'",":rL"); + gr->Mark(mglPoint(x1,-4*d,0),"#<"); gr->Puts(mglPoint(x0,y-4*d),"'\\#<'",":rL"); + gr->Mark(mglPoint(x1,-5*d,0),"#>"); gr->Puts(mglPoint(x0,y-5*d),"'\\#>'",":rL"); +} +//----------------------------------------------------------------------------- +void smgl_sample4(mglGraph *gr) // font features +{ +// setlocale(LC_CTYPE, "ru_RU.cp1251"); +// gr->Putsw(mglPoint(0,1),L"Text can be in english è â Þíèêîäå"); + gr->Putsw(mglPoint(0,1),L"Text can be in ASCII and in Unicode"); + gr->Puts(mglPoint(0,0.6),"It can be \\wire{wire}, \\big{big} or #r{colored}"); + gr->Puts(mglPoint(0,0.2),"One can change style in string: " + "\\b{bold}, \\i{italic, \\b{both}}"); + gr->Puts(mglPoint(0,-0.2),"Easy to \\a{overline} or " + "\\u{underline}"); + gr->Puts(mglPoint(0,-0.6),"Easy to change indexes ^{up} _{down} @{center}"); + gr->Puts(mglPoint(0,-1),"It parse TeX: \\int \\alpha \\cdot " + "\\sqrt3{sin(\\pi x)^2 + \\gamma_{i_k}} dx"); +} +//----------------------------------------------------------------------------- +void smgl_sample3(mglGraph *gr) // curvilinear coordinates +{ + mglData x(50),y(50),z(50); + y.Fill(0.5,0.5); + x.Fill(-1,1); // create data arrays + + gr->SetRanges(mglPoint(-1,-1,-1),mglPoint(1,1,1)); + gr->SetOrigin(-1,1,-1); gr->SetTicks('z', 0.5); // set tick step to 0.5 + + gr->SubPlot(2,2,0); + gr->Rotate(60,40); + gr->Plot(x,y,z,"r2"); + gr->Axis(); gr->Grid(); + gr->Puts(mglPoint(0,1.3,1),"Cartesian"); + + gr->SubPlot(2,2,1); + gr->SetFunc("y*sin(pi*x)","y*cos(pi*x)",0); + gr->Rotate(60,40); + gr->Plot(x,y,z,"r2"); + gr->Axis(); gr->Grid(); + gr->Puts(mglPoint(0,1.3,1),"Cylindrical"); + + gr->SubPlot(2,2,2); + gr->Rotate(60,40); + gr->SetFunc("2*y*x","y*y - x*x",0); + gr->Plot(x,y,z,"r2"); + gr->Axis(); gr->Grid(); + gr->Puts(mglPoint(0,1.3,1),"Parabolic"); + + gr->SubPlot(2,2,3); + gr->Rotate(60,40); + gr->SetFunc("y*sin(pi*x)","y*cos(pi*x)","x+z"); + gr->Plot(x,y,z,"r2"); + gr->Axis(); gr->Grid(); + gr->Puts(mglPoint(0,1.3,1),"Spiral"); + gr->SetFunc(0,0,0); // set to default Cartesian +} +//----------------------------------------------------------------------------- +void smgl_sample2(mglGraph *gr) // axis and grid +{ + gr->SubPlot(2,2,0); + gr->SetTicks('x', 0.4, 3); // sets tick step to 0.4 + gr->SetTicks('y', 0.4, 3); // and draws 3 subticks + gr->Box(); // should be after the ticks change + gr->Axis("xy"); + gr->Grid(); + gr->Puts(mglPoint(0,1.3,1),"Axis and grid"); + + gr->SetTicks('x'); gr->SetTicks('y'); // restore back + gr->SetRanges(mglPoint(-1,-1,-1),mglPoint(1,1,1)); gr->SetOrigin(0,0,0); + + gr->SubPlot(2,2,1); + gr->Rotate(60,40); + gr->Axis(); + gr->Label('x',"x"); + gr->Label('y',"y"); + gr->Label('z',"z"); + gr->Puts(mglPoint(0,0,1.5),"Axis and labels"); + + gr->SubPlot(2,2,2); + gr->Rotate(60,40); + gr->SetTicks('x', 0.2); gr->SetTicks('y', 0.2); + gr->SetTicks('z', 0.2); // too low step of ticks + gr->SetRanges(mglPoint(-1,-1,-1),mglPoint(1,1,1)); gr->SetOrigin(-1,-1,-1); + gr->Axis(); + gr->Grid(); + gr->Puts(mglPoint(0,0,1.5),"Shift origin and add grid"); + gr->Puts(mglPoint(0,0,1.2),"(note, too many ticks)"); + + gr->SubPlot(2,2,3); + gr->Rotate(60,40); + gr->SetTicks('x', -6); // decrease the number of ticks + gr->SetTicks('y', -6); + gr->Axis("yz"); + gr->Label('y',"Y axis",0); + gr->Label('z',"Z axis",0); + gr->Puts(mglPoint(0,0,1.5),"Remove X axis, and"); + gr->Puts(mglPoint(0,0,1.2),"decrease number of ticks"); + + gr->Rotate(0,0); // for unrotate in IDTF +} +//----------------------------------------------------------------------------- +void smgl_sample1(mglGraph *gr) // transformation +{ + gr->SubPlot(2,2,0); // just new axis without rotation and aspects + gr->Box(); + gr->Puts(mglPoint(-1,1.1,1),"Just box",":rL"); + gr->InPlot(0.2,0.5,0.7,1,false); + gr->Box(); + gr->Puts(mglPoint(0,1.2,1),"InPlot example"); + gr->SubPlot(2,2,1); // new axis with aspect and rotation + gr->Rotate(60,40); + gr->Aspect(1,1,1); + gr->Box(); + gr->Puts(mglPoint(1,1,1.5),"Rotate only",":rR"); + gr->SubPlot(2,2,2); // aspect in other direction + gr->Rotate(60,40); + gr->Aspect(1,1,2); + gr->Box(); + gr->Puts(mglPoint(0,0,2),"Aspect and Rotate"); + gr->SubPlot(2,2,3); // rotation before aspect. INCORRECT !!! + gr->Rotate(60,40); + gr->Aspect(1,2,2); + gr->Box(); + gr->Puts(mglPoint(0,0,1.5),"Aspect in other direction"); + gr->Rotate(0,0); // for unrotate in IDTF +} +//----------------------------------------------------------------------------- +void smgl_candle(mglGraph *gr) +{ + mglData y(50); gr->Fill(y,"sin(2*pi*x)^2"); + mglData y1(50); gr->Fill(y1,"v/2",y); + mglData y2(50); gr->Fill(y2,"(1+v)/2",y); + gr->SetRange('y',0,1); gr->Box(); + gr->Candle(y,y1,y2); +} +//----------------------------------------------------------------------------- +void smgl_plot(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->Box(); gr->Plot(y); +} +//----------------------------------------------------------------------------- +void smgl_area(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->SetOrigin(0,0,0); gr->Box(); gr->Area(y); +} +//----------------------------------------------------------------------------- +void smgl_area_2(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->SetOrigin(0,0,0); gr->Box(); gr->Area(y,"cbgGyr"); +} +//----------------------------------------------------------------------------- +void smgl_stem(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->SetOrigin(0,0,0); gr->Box(); gr->Stem(y,"o"); +} +//----------------------------------------------------------------------------- +void smgl_step(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->Box(); gr->Step(y); +} +//----------------------------------------------------------------------------- +void smgl_bars_2(mglGraph *gr) +{ + mglData ys(10,3); ys.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); + gr->SetOrigin(0,0,0); gr->Box(); gr->Bars(ys,"cbgGyr"); +} +//----------------------------------------------------------------------------- +void smgl_bars_a(mglGraph *gr) +{ + mglData ys(10,3); ys.Modify("0.3*sin(pi*(2*x+y/2))+0.1*rnd"); + gr->SetOrigin(0,0,0); gr->Box(); gr->Bars(ys,"a"); +} +//----------------------------------------------------------------------------- +void smgl_bars_f(mglGraph *gr) +{ + mglData ys(10,2); ys.Modify("0.24*sin(pi*(2*x+y/2))+0.06*rnd"); + gr->SetOrigin(0,0,0); gr->Box(); gr->Bars(ys,"f"); +} +//----------------------------------------------------------------------------- +void smgl_bars(mglGraph *gr) +{ + mglData ys(10,3); ys.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); + gr->SetOrigin(0,0,0); gr->Box(); gr->Bars(ys); +} +//----------------------------------------------------------------------------- +void smgl_barh(mglGraph *gr) +{ + mglData ys(10,3); ys.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); + gr->SetOrigin(0,0,0); gr->Box(); gr->Barh(ys); +} +//----------------------------------------------------------------------------- +void smgl_tens(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->Box(); gr->Tens(y.SubData(-1,0), y.SubData(-1,1)); +} +//----------------------------------------------------------------------------- +void smgl_text(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->Box(); gr->Plot(y.SubData(-1,0)); + gr->Text(y,"This is very very long string drawn along a curve",":k"); + gr->Text(y,"Another string drawn above a curve","T:r"); +} +//----------------------------------------------------------------------------- +void smgl_region(mglGraph *gr) +{ + mglData y1,y2; mgls_prepare1d(0, &y1, &y2); + gr->Box(); gr->Region(y2,y1,"r"); + gr->Plot(y1,"k2"); gr->Plot(y2,"k2"); +} +//----------------------------------------------------------------------------- +void smgl_region_2(mglGraph *gr) +{ + mglData y1,y2; mgls_prepare1d(0, &y1, &y2); + gr->Box(); gr->Region(y2,y1,"yr"); + gr->Plot(y1,"k2"); gr->Plot(y2,"k2"); +} +//----------------------------------------------------------------------------- +void smgl_mark(mglGraph *gr) +{ + mglData y,y1; mgls_prepare1d(&y,&y1); + gr->Box(); gr->Mark(y,y1,"bs"); +} +//----------------------------------------------------------------------------- +void smgl_traj(mglGraph *gr) +{ + mglData x,y,y1,y2; mgls_prepare1d(&y,&y1,&y2,&x); + gr->Box(); gr->Plot(x,y); gr->Traj(x,y,y1,y2); +} +//----------------------------------------------------------------------------- +void smgl_textmark(mglGraph *gr) +{ + mglData y,y1; mgls_prepare1d(&y,&y1); + gr->Box(); gr->TextMark(y,y1,"\\gamma"); +} +//----------------------------------------------------------------------------- +void smgl_torus(mglGraph *gr) +{ + mglData y1,y2; mgls_prepare1d(0,&y1,&y2); + gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); + gr->Box(); gr->Torus(y1,y2,"pz"); +} +//----------------------------------------------------------------------------- +void smgl_tube(mglGraph *gr) +{ + mglData y,y1; mgls_prepare1d(&y,&y1); + gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); + gr->Box(); gr->Tube(y,0.05); +} +//----------------------------------------------------------------------------- +void smgl_tube_3d(mglGraph *gr) +{ + mglData y,y1,y2,x1,x2; mgls_prepare1d(&y,&y1,&y2,&x1,&x2); + gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); + gr->Box(); gr->Tube(y,0.05); gr->Tube(y1,x1,y2,x2); +} +//----------------------------------------------------------------------------- +void smgl_radar(mglGraph *gr) +{ + mglData yr(10,3); yr.Modify("0.4*sin(pi*(2*x+y/2))+0.1*rnd"); + gr->Box(); gr->Radar(yr,"#"); +} +//----------------------------------------------------------------------------- +void smgl_error(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + mglData x0(10), y0(10), ex0(10), ey0(10); + float x; + for(int i=0;i<10;i++) + { + x = i/9.; + x0.a[i] = 2*x-1 + 0.1*mgl_rnd()-0.05; + y0.a[i] = 0.7*sin(2*M_PI*x)+0.5*cos(3*M_PI*x)+0.2*sin(M_PI*x)+0.2*mgl_rnd()-0.1; + ey0.a[i]=0.2; ex0.a[i]=0.1; + } + gr->Box(); gr->Plot(y.SubData(-1,0)); + gr->Error(x0,y0,ex0,ey0,"ko"); +} +//----------------------------------------------------------------------------- +void smgl_chart(mglGraph *gr) +{ + mglData ch(7,2); for(int i=0;i<7*2;i++) ch.a[i]=mgl_rnd()+0.1; + gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); + gr->Box(); gr->Chart(ch,"#"); +} +//----------------------------------------------------------------------------- +void smgl_ring_chart(mglGraph *gr) +{ + mglData ch(7,2); for(int i=0;i<7*2;i++) ch.a[i]=mgl_rnd()+0.1; + gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); + gr->SetFunc("(y+2)/3*cos(pi*x)","(y+2)/3*sin(pi*x)",""); + gr->Box(); gr->Chart(ch,"bgr cmy#"); +} +//----------------------------------------------------------------------------- +void smgl_pie_chart(mglGraph *gr) +{ + mglData ch(7,2); for(int i=0;i<7*2;i++) ch.a[i]=mgl_rnd()+0.1; + gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); + gr->SetFunc("(y+1)/2*cos(pi*x)","(y+1)/2*sin(pi*x)",""); + gr->Box(); gr->Chart(ch,"bgr cmy#"); +} +//----------------------------------------------------------------------------- +void smgl_grad(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Box(); gr->Grad(a); + gr->Alpha(true); gr->Dens(a); +} +//----------------------------------------------------------------------------- +void smgl_contt(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Box(); gr->Cont(a,"t"); +} +//----------------------------------------------------------------------------- +void smgl_tiles(mglGraph *gr) +{ + mglData a,b; mgls_prepare2d(&a,&b); + gr->Box(); gr->TileS(a,b); +} +//----------------------------------------------------------------------------- +void smgl_contd(mglGraph *gr) +{ + mglData a,v; mgls_prepare2d(&a,0,&v); + gr->Box(); gr->ContD(v,a); gr->Colorbar(v); +} +//----------------------------------------------------------------------------- +void smgl_dens(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Box(); gr->Dens(a); gr->Colorbar(); +} +//----------------------------------------------------------------------------- +void smgl_surf_sl(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->Surf(a,"|"); +} +//----------------------------------------------------------------------------- +void smgl_surf(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->Surf(a); +} +//----------------------------------------------------------------------------- +void smgl_stereo(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); + gr->SubPlot(2,1,0); gr->Rotate(40,60+3); + gr->Box(); gr->Surf(a); + gr->SubPlot(2,1,1); gr->Rotate(40,60-3); + gr->Box(); gr->Surf(a); + gr->Rotate(0,0); // for unrotate in IDTF +} +//----------------------------------------------------------------------------- +void smgl_tile(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->Tile(a); +} +//----------------------------------------------------------------------------- +void smgl_belt(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->Belt(a); +} +//----------------------------------------------------------------------------- +void smgl_mesh(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->Mesh(a); +} +//----------------------------------------------------------------------------- +void smgl_fall(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->Fall(a); +} +//----------------------------------------------------------------------------- +void smgl_contf(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->ContF(a); +} +//----------------------------------------------------------------------------- +void smgl_cont(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); + gr->Box(); gr->Cont(a); +} +//----------------------------------------------------------------------------- +void smgl_surfc(mglGraph *gr) +{ + mglData a,b; mgls_prepare2d(&a,&b); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->SurfC(a,b); +} +//----------------------------------------------------------------------------- +void smgl_boxs(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->SetOrigin(0,0,0); gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->Boxs(a); +} +//----------------------------------------------------------------------------- +void smgl_surf_fog(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); gr->Fog(1); gr->Box(); + (type==5 || type==9 || type==10)?gr->Puts(mglPoint(),"Fog not supported") : gr->Surf(a); + gr->Fog(0); +} +//----------------------------------------------------------------------------- +void smgl_surf_alpha(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); gr->Alpha(true); + gr->Box(); gr->Surf(a); +} +//----------------------------------------------------------------------------- +void smgl_axial(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Alpha(true); gr->VertexColor(false); + gr->Box(); gr->Axial(a); +} +//----------------------------------------------------------------------------- +void smgl_surfa(mglGraph *gr) +{ + mglData a,b; mgls_prepare2d(&a,&b); + gr->Light(true); gr->Rotate(40,60); + gr->Alpha(true); gr->VertexColor(false); + gr->Box(); gr->SurfA(a,b); +} +//----------------------------------------------------------------------------- +/*void smgl_surf3_rgbd(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->VertexColor(true); + gr->Box(); gr->Surf3(c,"bgrd"); +}*/ +//----------------------------------------------------------------------------- +void smgl_conta(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->VertexColor(false); + gr->Box(); gr->Cont3(c,'x'); gr->Cont3(c,'y'); gr->Cont3(c,'z'); +} +//----------------------------------------------------------------------------- +void smgl_dens_xyz(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->VertexColor(false); + gr->Box(); gr->DensX(c.Sum("x"),0,-1); + gr->DensY(c.Sum("y"),0,1); gr->DensZ(c.Sum("z"),0,-1); +} +//----------------------------------------------------------------------------- +void smgl_cont_xyz(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->VertexColor(false); + gr->Box(); gr->ContX(c.Sum("x"),"",-1); + gr->ContY(c.Sum("y"),"",1); + gr->ContZ(c.Sum("z"),"",-1); +} +//----------------------------------------------------------------------------- +void smgl_contfa(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->Light(true); gr->VertexColor(false); + gr->Box(); gr->ContF3(c,'x'); gr->ContF3(c,'y'); gr->ContF3(c,'z'); +} +//----------------------------------------------------------------------------- +void smgl_surf3(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); + gr->VertexColor(false); + gr->Box(); gr->Surf3(c); +} +//----------------------------------------------------------------------------- +void smgl_surf3a(mglGraph *gr) +{ + mglData c,d; mgls_prepare3d(&c,&d); + gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); + gr->VertexColor(false); + gr->Box(); gr->Surf3A(c,d); +} +//----------------------------------------------------------------------------- +void smgl_surf3c(mglGraph *gr) +{ + mglData c,d; mgls_prepare3d(&c,&d); + gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); + gr->VertexColor(false); + gr->Box(); gr->Surf3C(c,d); +} +//----------------------------------------------------------------------------- +void smgl_densa(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->Alpha(true); gr->VertexColor(false); + gr->SetOrigin(0,0,0); gr->Axis(); + gr->Box(); gr->Dens3(c,'x'); gr->Dens3(c,'y'); gr->Dens3(c,'z'); +} +//----------------------------------------------------------------------------- +void smgl_cloud(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->Alpha(true); gr->VertexColor(false); + gr->Box(); gr->Cloud(c,"wyrRk"); +} +//----------------------------------------------------------------------------- +void smgl_vect(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Box(); gr->Vect(a,b); +} +//----------------------------------------------------------------------------- +void smgl_vectl(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Box(); gr->Vect(a,b,"","value 49"); +} +//----------------------------------------------------------------------------- +void smgl_vectc(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Box(); gr->Vect(a,b,"","value 50"); +} +//----------------------------------------------------------------------------- +void smgl_flow(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Box(); gr->Flow(a,b); +} +//----------------------------------------------------------------------------- +void smgl_pipe2(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Box(); gr->Pipe(a,b); +} +//----------------------------------------------------------------------------- +void smgl_pipe(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Light(true); gr->Compression(true); // try to save space + gr->Box(); gr->Pipe(a,b); + gr->Compression(false); //put setting back +} +//----------------------------------------------------------------------------- +void smgl_dew(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Light(true); gr->Compression(true); // try to save space + gr->DoubleSided(false); // try to improve performance + gr->Box(); gr->SetMeshNum(20); gr->Dew(a,b); + gr->DoubleSided(true); + gr->Compression(false); //put setting back +} +//----------------------------------------------------------------------------- +void smgl_dew2(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Rotate(40,60); gr->Light(true); gr->Compression(true); // try to save space + gr->DoubleSided(false); // try to improve performance + gr->Box(); gr->SetMeshNum(10); gr->Dew(a,b); + gr->DoubleSided(true); + gr->Compression(false); //put setting back +} +//----------------------------------------------------------------------------- +void smgl_flow3(mglGraph *gr) +{ + mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); + gr->Rotate(40,60); + gr->Box(); gr->Box(); gr->Flow(ex,ey,ez,"bwr"); +} +//----------------------------------------------------------------------------- +void smgl_vect3(mglGraph *gr) +{ + mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); + gr->Rotate(40,60); + gr->Box(); gr->Box(); gr->Vect(ex,ey,ez,"bwr"); +} +//----------------------------------------------------------------------------- +void smgl_vectl3(mglGraph *gr) +{ + mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); + gr->Rotate(40,60); + gr->Box(); gr->Box(); gr->Vect(ex,ey,ez,"bwr","value 49"); +} +//----------------------------------------------------------------------------- +void smgl_vectc3(mglGraph *gr) +{ + mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); + gr->Rotate(40,60); + gr->Box(); gr->Box(); gr->Vect(ex,ey,ez,"bwr","value 50"); +} +//----------------------------------------------------------------------------- +void smgl_pipe3(mglGraph *gr) +{ + mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); + gr->Rotate(40,60); gr->Light(true); + gr->Compression(true); // try to save space + gr->Clf(); gr->Box(); gr->Pipe(ex,ey,ez); + gr->Compression(false); // put setting back +} +//----------------------------------------------------------------------------- +void smgl_crust(mglGraph *gr) +{ + mglData pnts("hotdogs.pts"); pnts.Norm(-1,1,true); + gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); + gr->Clf(); gr->Box(); gr->Crust(pnts.SubData(0),pnts.SubData(1),pnts.SubData(2)); +} +//----------------------------------------------------------------------------- +void smgl_dots(mglGraph *gr) +{ + mglData pnts("hotdogs.pts"); pnts.Norm(-1,1,true); + gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); + gr->Clf(); gr->Box(); gr->Dots(pnts.SubData(0),pnts.SubData(1),pnts.SubData(2)); +} +//----------------------------------------------------------------------------- +void smgl_legend(mglGraph *gr) +{ + mglData f(50,3); + float x; + for(int i=0;i<50;i++) + { + x=i/49.; + f.a[i]=sin(2*M_PI*x*x); + f.a[i+50]=sin(2*M_PI*x); + f.a[i+100]=sin(2*M_PI*sqrt(x)); + } + gr->SetRanges(mglPoint(0), mglPoint(1)); + gr->Box(); gr->Plot(f); gr->Axis("xy"); + gr->AddLegend("sin(\\pi {x^2})","b"); gr->AddLegend("sin(\\pi x)","g*"); + gr->AddLegend("sin(\\pi \\sqrt{x})","r+"); gr->Legend(); +} +//----------------------------------------------------------------------------- +void smgl_type0(mglGraph *gr) // TranspType = 0 +{ + if(type==5 || type==9 || type==10) return; + gr->Alpha(true); gr->Light(true); gr->AddLight(0,mglPoint(0,0,1)); + mglData a; mgls_prepare2d(&a); + gr->SetTranspType(0); gr->Clf(); + gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box(); + gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box(); + gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box(); + gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_type1(mglGraph *gr) // TranspType = 1 +{ + if(type==5 || type==9 || type==10) return; + gr->Alpha(true); gr->Light(true); gr->AddLight(0,mglPoint(0,0,1)); + mglData a; mgls_prepare2d(&a); + gr->SetTranspType(1); gr->Clf(); + gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box(); + gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box(); + gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box(); + gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_type2(mglGraph *gr) // TranspType = 2 +{ + if(type==5 || type==9 || type==10) return; + gr->Alpha(true); gr->Light(true); gr->AddLight(0,mglPoint(0,0,1)); + mglData a; mgls_prepare2d(&a); + gr->SetTranspType(2); gr->Clf(); + gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box(); + gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box(); + gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box(); + gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_molecule(mglGraph *gr) // example of moleculas +{ + gr->VertexColor(false); gr->Compression(false); // per-vertex colors and compression are detrimental to transparency + gr->DoubleSided(false); // we do not get into atoms, while rendering internal surface has negative impact on trasparency + gr->Alpha(true); gr->Light(true); + + gr->SubPlot(2,2,0); + gr->StartGroup("Methane"); + gr->StartGroup("MetaneLabel"); + gr->Puts(mglPoint(0,1.2),"Methane, CH_4",0,-2); + gr->EndGroup(); + gr->Rotate(60,120); + gr->Sphere(mglPoint(0,0,0),0.25,"k"); + gr->Drop(mglPoint(0,0,0),mglPoint(0,0,1),0.35,"h",1,2); + gr->Sphere(mglPoint(0,0,0.7),0.25,"g"); + gr->Drop(mglPoint(0,0,0),mglPoint(-0.94,0,-0.33),0.35,"h",1,2); + gr->Sphere(mglPoint(-0.66,0,-0.23),0.25,"g"); + gr->Drop(mglPoint(0,0,0),mglPoint(0.47,0.82,-0.33),0.35,"h",1,2); + gr->Sphere(mglPoint(0.33,0.57,-0.23),0.25,"g"); + gr->Drop(mglPoint(0,0,0),mglPoint(0.47,-0.82,-0.33),0.35,"h",1,2); + gr->Sphere(mglPoint(0.33,-0.57,-0.23),0.25,"g"); + gr->EndGroup(); + + gr->SubPlot(2,2,1); + gr->StartGroup("Water"); + gr->StartGroup("WaterLabel"); + gr->Puts(mglPoint(0,1.2),"Water, H_{2}O",0,-2); + gr->EndGroup(); + gr->Rotate(60,100); + gr->StartGroup("Water_O"); + gr->Sphere(mglPoint(0,0,0),0.25,"r"); + gr->EndGroup(); + gr->StartGroup("Water_Bond_1"); + gr->Drop(mglPoint(0,0,0),mglPoint(0.3,0.5,0),0.3,"m",1,2); + gr->EndGroup(); + gr->StartGroup("Water_H_1"); + gr->Sphere(mglPoint(0.3,0.5,0),0.25,"g"); + gr->EndGroup(); + gr->StartGroup("Water_Bond_2"); + gr->Drop(mglPoint(0,0,0),mglPoint(0.3,-0.5,0),0.3,"m",1,2); + gr->EndGroup(); + gr->StartGroup("Water_H_2"); + gr->Sphere(mglPoint(0.3,-0.5,0),0.25,"g"); + gr->EndGroup(); + gr->EndGroup(); + + gr->SubPlot(2,2,2); + gr->StartGroup("Oxygen"); + gr->StartGroup("OxygenLabel"); + gr->Puts(mglPoint(0,1.2),"Oxygen, O_2",0,-2); + gr->EndGroup(); + gr->Rotate(60,120); + gr->Drop(mglPoint(0,0.5,0),mglPoint(0,-0.3,0),0.3,"m",1,2); + gr->Sphere(mglPoint(0,0.5,0),0.25,"r"); + gr->Drop(mglPoint(0,-0.5,0),mglPoint(0,0.3,0),0.3,"m",1,2); + gr->Sphere(mglPoint(0,-0.5,0),0.25,"r"); + gr->EndGroup(); + + gr->SubPlot(2,2,3); + gr->StartGroup("Ammonia"); + gr->StartGroup("AmmoniaLabel"); + gr->Puts(mglPoint(0,1.2),"Ammonia, NH_3",0,-2); + gr->EndGroup(); + gr->Rotate(60,120); + gr->Sphere(mglPoint(0,0,0),0.25,"b"); + gr->Drop(mglPoint(0,0,0),mglPoint(0.33,0.57,0),0.32,"n",1,2); + gr->Sphere(mglPoint(0.33,0.57,0),0.25,"g"); + gr->Drop(mglPoint(0,0,0),mglPoint(0.33,-0.57,0),0.32,"n",1,2); + gr->Sphere(mglPoint(0.33,-0.57,0),0.25,"g"); + gr->Drop(mglPoint(0,0,0),mglPoint(-0.65,0,0),0.32,"n",1,2); + gr->Sphere(mglPoint(-0.65,0,0),0.25,"g"); + gr->EndGroup(); + gr->DoubleSided( true ); // put back +} +//----------------------------------------------------------------------------- +void smgl_quaternary(mglGraph *gr) // flag # +{ + mglData x(50),y(50),z(50),rx(10),ry(10), a(20,30); + a.Modify("x*y*(1-x-y)^2*30"); + x.Modify("0.25*(1-x)*(1+cos(2*pi*x))"); + y.Modify("0.25*(1-x)*(1+sin(2*pi*x))"); + z.Modify("x"); + + gr->Puts(mglPoint(0,1.3), "Quaternary plot (x+y+z+t=1)"); + gr->Rotate(60,70); gr->Light(true); + gr->Ternary(2); gr->SetCut(true); + gr->Plot(x,y,z,"r2"); gr->Surf(a,"BbcyrR#"); + gr->Axis(); gr->Grid(); gr->Box(); + gr->SetRotatedText(false); + gr->Label('t',"A",1); gr->Label('x',"B",1); + gr->Label('y',"C",1); gr->Label('z',"D",1); + gr->Ternary(0); +} +//----------------------------------------------------------------------------- +void smgl_ternary(mglGraph *gr) // flag # +{ + mglData x(50),y(50),rx(10),ry(10), a(20,30); + a.Modify("4*x*y"); + x.Modify("0.25*(1+cos(2*pi*x))"); + y.Modify("0.25*(1+sin(2*pi*x))"); + rx.Modify("rnd"); ry.Modify("(1-v)*rnd",rx); + + gr->Puts(mglPoint(-0.8,1.3), "Ternary plot (x+y+t=1)"); + gr->Ternary(true); + gr->Plot(x,y,"r2"); + gr->Plot(rx,ry,"q^ "); + gr->Cont(a,"BbcyrR"); + gr->Line(mglPoint(0.5,0), mglPoint(0,0.75), "g2"); + gr->Axis(); gr->Grid("xyz","B;"); + gr->Label('x',"x comp."); + gr->Label('y',"y comp."); + gr->Label('t',"t comp."); + gr->Ternary(false); +} +//----------------------------------------------------------------------------- +void smgl_drops(mglGraph *gr) // flag # +{ + gr->VertexColor(false); // not strictly required, but looks better imho + gr->Light(true); gr->Alpha(false); + gr->Puts(mglPoint(-1,1.2),"sh=0"); + gr->Drop(mglPoint(-1,0),mglPoint(0,1),0.5,"r",0); + gr->Puts(mglPoint(-0.33,1.2),"sh=0.33"); + gr->Drop(mglPoint(-0.33,0),mglPoint(0,1),0.5,"r",0.33); + gr->Puts(mglPoint(0.33,1.2),"sh=0.67"); + gr->Drop(mglPoint(0.33,0),mglPoint(0,1),0.5,"r",0.67); + gr->Puts(mglPoint(1,1.2),"sh=1"); + gr->Drop(mglPoint(1,0),mglPoint(0,1),0.5,"r",1); + gr->Ball(mglPoint(-1,0,1),'k'); + gr->Ball(mglPoint(-0.33,0,1),'k'); + gr->Ball(mglPoint(0.33,0,1),'k'); + gr->Ball(mglPoint(1,0,1),'k'); + gr->Line(mglPoint(-1,0,1),mglPoint(1,0,1),"b"); +} +//----------------------------------------------------------------------------- +void smgl_fish(mglGraph *gr) // flag # +{ + gr->VertexColor(false); // the model is big even without information on point colors + gr->Compression(true); // fishes are important, not their scales + gr->DoubleSided(false); // we do not get into drops, while rendering internal surfaces may have negative impact on performace + gr->Light(true); gr->Alpha(false); + mglData a(10,10), b(10,10), x(10,10), y(10,10); + a.Modify("0.3*x+rnd"); x.Modify("x+0.1*rnd"); + b.Modify("0.3*y+rnd"); y.Modify("y+0.1*rnd"); + + gr->Clf(); + gr->SetRanges(mglPoint(0,0),mglPoint(1.1,1.1)); + gr->Light(true); + gr->Dew(x,y,a,b,"BbcyrR"); + gr->Compression(false); gr->DoubleSided(true); +} +//----------------------------------------------------------------------------- +void smgl_mirror(mglGraph *gr) // flag # +{ + gr->VertexColor(true); gr->TextureColor(false); // Let us use pre-lighting for this example + mglData a(30,40),x(30),y1(40),y2(40); + a.Modify("pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)"); + x.Fill(-1,1); y1.Fill(0,1); y2.Fill(0,-1); + + gr->Alpha(false); gr->Rotate(40,60); + gr->Light(true); gr->Box(); + gr->Surf(x,y1,a,"r"); gr->Surf(x,y2,a,"b"); + gr->VertexColor(false); gr->TextureColor(true); // set settings back +} +//----------------------------------------------------------------------------- +void smgl_semilog(mglGraph *gr) // semi-log axis +{ + mglData x(2000), y(2000); + x.Modify("0.01/(x+10^(-5))"); y.Modify("sin(1/v)",x); + + gr->SetRanges(mglPoint(0.01,-1),mglPoint(1000,1)); + gr->SetFunc("lg(x)",0,0); gr->SetTicks('x', 0); gr->Box(); + gr->Plot(x,y,"b2"); + gr->Axis(); gr->Grid("xy","g"); + gr->Label('x',"x",0); gr->Label('y', "y = sin 1/x",0); +} +//----------------------------------------------------------------------------- +void smgl_loglog(mglGraph *gr) // log-log axis +{ + mglData x(2000), y(2000); + x.Modify("pow(10,6*x-3)"); y.Modify("sqrt(1+v^2)",x); + + gr->SetRanges(mglPoint(0.001,0.1),mglPoint(1000,1000)); + gr->SetFunc("lg(x)","lg(y)",0); + gr->SetTicks('x', 0); + gr->SetTicks('y', 0); + gr->Box(); gr->Axis(); gr->Grid("xy","g;"); + gr->Plot(x,y,"b2"); + gr->Label('x',"x",0); gr->Label('y', "y=\\sqrt{1+x^2}",0); +} +//----------------------------------------------------------------------------- +void smgl_fit(mglGraph *gr) // nonlinear fitting +{ + mglData rnd(100), in(100), res; + gr->Fill(rnd,"0.4*rnd+0.1+sin(2*pi*x)"); + gr->Fill(in,"0.3+sin(2*pi*x)"); + + gr->SetRanges(mglPoint(-1,-2), mglPoint(1,2)); + gr->Plot(rnd, ". "); + gr->Box(); + + float ini[3] = {1,1,3}; + mglData Ini(3,ini); + gr->Fit(res, rnd, "a+b*sin(c*x)", "abc", Ini); + gr->Plot(res, "r"); + gr->Plot(in, "b"); + gr->Puts(mglPoint(-1, -1.3), "fitted:", "r:L", -1); + gr->PutsFit(mglPoint(0, -1.8), "y = ", "r:C", -1); + gr->Puts(mglPoint(0, 2.2), "initial: y = 0.3+sin(2\\pi x)", "b:C", -1); + gr->SetRanges(mglPoint(-1,-1,-1),mglPoint(1,1,1)); gr->SetOrigin(0,0,0); +} +//----------------------------------------------------------------------------- +#include "mgl/parser.h" +void smgl_parser(mglGraph *gr) // example of MGL parsing +{ + float a[100]; // let a_i = sin(4*pi*x), x=0...1 + for(int i=0;i<100;i++)a[i]=sin(4*M_PI*i/99); + mglParse *parser = new mglParse; + mglData d = parser->AddVar("dat"); + d.Set(a,100); // set data to variable + parser->Execute(gr, "plot dat; xrange 0 1\nbox\naxis"); + // you may break script at any line do something + // and continue after that + parser->Execute(gr, "xlabel 'x'\nylabel 'y'\nbox"); + // also you may use cycles or conditions in script + parser->Execute(gr, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext"); + delete parser; +} +//----------------------------------------------------------------------------- +void smgl_2_axis(mglGraph *gr) // 2 axis +{ + mglData y1,y2; mgls_prepare1d(0,&y2,&y1); + gr->SetRanges(mglPoint(-1,-1,-1),mglPoint(1,1,1)); gr->SetOrigin(-1,-1,-1); + gr->Axis(); gr->Label('y',"axis 1",0); gr->Plot(y1,"b"); + // set up second axis + gr->SetRanges(mglPoint(0,0,0),mglPoint(1,1,1)); gr->SetOrigin(1,1,1); + gr->Axis(); gr->Label('y',"axis 2",0); gr->Stem(y2,"r"); +} +//----------------------------------------------------------------------------- +void smgl_flow_dens(mglGraph *gr) // flow threads and density plot +{ + mglData a,b,d; mgls_prepare2v(&a,&b); d = a; + for(int i=0;iFlow(a,b,"br"); gr->Dens(d,"BbcyrR"); gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_surf_cont(mglGraph *gr) // contour lines over surface +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); + gr->Box(); gr->Surf(a,"kw"); + gr->SetRange('c',-1,0); gr->Cont(a,"w"); + gr->SetRange('c', 0,1); gr->Cont(a,"k"); +} +//----------------------------------------------------------------------------- +void smgl_mesh_cont(mglGraph *gr) // contours under mesh +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); + gr->Box(); gr->Mesh(a); gr->Cont(a, "_"); +// gr->Cont(a, 0, "zrange -1 -1"); // Also possible variant +} +//----------------------------------------------------------------------------- +void smgl_surf_cont_y(mglGraph *gr) // contours on the surface +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); gr->Light(true); + gr->Box(); gr->Surf(a); gr->Cont(a,"y"); +} +//----------------------------------------------------------------------------- +void smgl_surf_cont_fog(mglGraph *gr) // contours on the surface in fog +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); gr->Light(true); gr->Fog(1,0.1); + gr->Box(); gr->Surf(a); gr->Cont(a,"y"); +} +//----------------------------------------------------------------------------- +void smgl_surf_caxis(mglGraph *gr) // caxis and the surface +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); gr->Light(true); + gr->SetRange('c',0,1); gr->Box(); gr->Surf(a); +} +//----------------------------------------------------------------------------- +void smgl_surf_cut(mglGraph *gr) // cutting +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); gr->Light(true); + gr->SetRanges(mglPoint(-1,-1,0),mglPoint(1,1,1)); gr->SetCut(false); + gr->Box(); gr->Surf(a); +} +//----------------------------------------------------------------------------- +void smgl_several_light(mglGraph *gr) // several light sources +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); gr->Light(true); + gr->AddLight(1,mglPoint(0,1,0),'c'); gr->AddLight(2,mglPoint(1,0,0),'y'); + gr->AddLight(3,mglPoint(0,-1,0),'m'); + gr->Box(); gr->Surf(a,"h"); +// gr->Light(1,false); gr->Light(2,false); gr->Light(3,false); +} +//----------------------------------------------------------------------------- +void smgl_cutminmax2(mglGraph *gr) // CutMin CutMax example +{ + mglData c; mgls_prepare3d(&c); + mglData v(10); v.Fill(-0.5,1); + gr->Rotate(40,60); gr->Light(true); + gr->VertexColor(false); gr->Compression(false); + gr->SetCutBox(mglPoint(0,-1,-1), mglPoint(1,0,1.1)); + gr->Box(); gr->Surf3(-0.5,c); + gr->ContF3(v,c,'x',-1); gr->ContF3(v,c,'y',-1); + gr->ContF3(v,c,'z',0); gr->ContF3(v,c,'z',39); +} +//----------------------------------------------------------------------------- +void smgl_cutminmax(mglGraph *gr) // CutMin CutMax example +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); + gr->VertexColor(false); gr->Compression(false); + gr->SetCutBox(mglPoint(0,-1,-1), mglPoint(1,0,1.1)); + gr->Box(); gr->Surf3(c); +} +//----------------------------------------------------------------------------- +void smgl_surf3_cutoff(mglGraph *gr) // CutMin CutMax example +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); + gr->VertexColor(false); gr->Compression(false); + gr->CutOff("(z>(x+0.5*y-1)^2-1) & (z>(x-0.5*y-1)^2-1)"); + gr->Box(); gr->Surf3(c); +} +//----------------------------------------------------------------------------- +void smgl_boxplot(mglGraph *gr) // flow threads and density plot +{ + mglData a(10,7); a.Modify("(2*rnd-1)^3/2"); + gr->Box(); gr->BoxPlot(a); gr->Plot(a," ko"); +} +//----------------------------------------------------------------------------- +int main(int argc,char **argv) +{ + const char *suf = ""; + char name[256]=""; + int ch; +// mglGraphIDTF u3d; + mglGraph *gr = NULL; + mglSample *s=samp; + while(( ch = getopt_long_only(argc, argv, "", longopts, NULL)) != -1) + switch(ch) + { + case 0: break; + case 'w': width =atoi(optarg); break; + case 'h': height=atoi(optarg); break; + case 'k': strcpy(name, optarg); break; + case 't': mglNumThr=atoi(optarg); break; + case 'l': + while(s->name[0]) { printf("%s ",s->name); s++; } + printf("\n"); return 0; + case '?': + default: usage(); return 0; + } + + gr = new mglGraph; +// if(type==5 || type==9 || type==10) { u3d.unrotate_flag = true; gr = &u3d; } + + if(mini) { gr->SetSize(200,133); suf = "_sm"; } + else if(big) + { gr->SetSize(1200,800); suf = "_lg"; } + else gr->SetSize(width,height); + + if(dotest) + { +// gr->SetSize(600,600); + mgl_set_test_mode(true); test(gr); + gr->WritePNG("test.png","",false); + gr->WriteEPS("test.eps"); + delete gr; return 0; + } + + if(srnd) mgl_srnd(1); + gr->VertexColor(false); gr->TextureColor(true); gr->Compression(false); + if(name[0]==0) while(s->name[0]) // all samples + { + gr->DefaultPlotParam(); gr->Clf(); + s->func(gr); save(gr, s->name, suf); + fflush(stdout); s++; + } + else // manual sample + { + mglSample tst; tst.name=name; + int i=0; for(i=0;samp[i].name[0];i++); // determine the number of samples s = (mglSample *) bsearch(&tst, samp, i, sizeof(mglSample), mgl_cmd_smp); - if(s) - { - gr->DefaultPlotParam(); gr->Clf(); - s->func(gr); save(gr, s->name, suf); - } - else printf("no sample %s\n",name); - } - printf("\n"); return 0; -} -//----------------------------------------------------------------------------- -mglSample samp[] = { - {"2_axis", smgl_2_axis}, - {"area", smgl_area}, - {"area_2", smgl_area_2}, - {"axial", smgl_axial}, - {"barh", smgl_barh}, - {"bars", smgl_bars}, - {"bars_2", smgl_bars_2}, - {"bars_a", smgl_bars_a}, - {"bars_f", smgl_bars_f}, - {"belt", smgl_belt}, - {"boxplot", smgl_boxplot}, - {"boxs", smgl_boxs}, - {"chart", smgl_chart}, - {"cloud", smgl_cloud}, - {"cloudp", smgl_cloudp}, - {"color_schemes", smgl_color_schemes}, - {"colors", smgl_colors}, - {"column", smgl_column}, - {"cont", smgl_cont}, - {"cont_xyz", smgl_cont_xyz}, - {"conta", smgl_conta}, - {"contd", smgl_contd}, - {"contf", smgl_contf}, - {"contfa", smgl_contfa}, - {"contt", smgl_contt}, - {"crust", smgl_crust}, - {"cutminmax", smgl_cutminmax}, - {"cutminmax2", smgl_cutminmax2}, - {"dens", smgl_dens}, - {"dens_xyz", smgl_dens_xyz}, - {"densa", smgl_densa}, - {"dew", smgl_dew}, - {"dew2", smgl_dew2}, - {"dots", smgl_dots}, - {"drops", smgl_drops}, - {"envelop", smgl_envelop}, - {"error", smgl_error}, - {"fall", smgl_fall}, - {"fish", smgl_fish}, - {"fit", smgl_fit}, - {"flow", smgl_flow}, - {"flow3", smgl_flow3}, - {"flow_dens", smgl_flow_dens}, - {"fonts", smgl_fonts}, - {"grad", smgl_grad}, - {"legend", smgl_legend}, - {"loglog", smgl_loglog}, - {"map", smgl_map}, - {"mark", smgl_mark}, - {"mesh", smgl_mesh}, - {"mesh_cont", smgl_mesh_cont}, - {"mirror", smgl_mirror}, - {"molecule", smgl_molecule}, - {"parser", smgl_parser}, - {"pde", smgl_pde}, - {"pie_chart", smgl_pie_chart}, - {"pipe", smgl_pipe}, - {"pipe2", smgl_pipe2}, - {"pipe3", smgl_pipe3}, - {"plot", smgl_plot}, - {"qo2d", smgl_qo2d}, - {"quaternary", smgl_quaternary}, - {"radar", smgl_radar}, - {"region", smgl_region}, - {"region_2", smgl_region_2}, - {"ring_chart", smgl_ring_chart}, - {"sample1", smgl_sample1}, - {"sample2", smgl_sample2}, - {"sample3", smgl_sample3}, - {"sample4", smgl_sample4}, - {"sample5", smgl_sample5}, - {"sample6", smgl_sample6}, - {"sample7", smgl_sample7}, - {"sample8", smgl_sample8}, - {"sample9", smgl_sample9}, - {"samplea", smgl_samplea}, - {"sampleb", smgl_sampleb}, - {"samplec", smgl_samplec}, - {"sampled", smgl_sampled}, - {"samplee", smgl_samplee}, - {"semilog", smgl_semilog}, - {"several_light", smgl_several_light}, - {"sew", smgl_sew}, - {"stem", smgl_stem}, - {"step", smgl_step}, - {"stereo", smgl_stereo}, - {"stfa", smgl_stfa}, - {"stick", smgl_stick}, - {"surf", smgl_surf}, - {"surf3", smgl_surf3}, - {"surf3_cutoff", smgl_surf3_cutoff}, - {"surf3_rgbd", smgl_surf3_rgbd}, - {"surf3a", smgl_surf3a}, - {"surf3c", smgl_surf3c}, - {"surf_alpha", smgl_surf_alpha}, - {"surf_caxis", smgl_surf_caxis}, - {"surf_cont", smgl_surf_cont}, - {"surf_cont_fog", smgl_surf_cont_fog}, - {"surf_cont_y", smgl_surf_cont_y}, - {"surf_cut", smgl_surf_cut}, - {"surf_fog", smgl_surf_fog}, - {"surf_sl", smgl_surf_sl}, - {"surfa", smgl_surfa}, - {"surfc", smgl_surfc}, - {"tens", smgl_tens}, - {"ternary", smgl_ternary}, - {"text", smgl_text}, - {"textmark", smgl_textmark}, - {"tile", smgl_tile}, - {"tiles", smgl_tiles}, - {"torus", smgl_torus}, - {"traj", smgl_traj}, - {"tube", smgl_tube}, - {"tube_3d", smgl_tube_3d}, - {"tval", smgl_tval}, - {"type0", smgl_type0}, - {"type1", smgl_type1}, - {"type2", smgl_type2}, - {"vect", smgl_vect}, - {"vect3", smgl_vect3}, - {"vectc", smgl_vectc}, - {"vectc3", smgl_vectc3}, - {"vectl", smgl_vectl}, - {"vectl3", smgl_vectl3}, - {"", NULL}}; + if(s) + { + gr->DefaultPlotParam(); gr->Clf(); + s->func(gr); save(gr, s->name, suf); + } + else printf("no sample %s\n",name); + } + printf("\n"); + delete gr; return 0; +} +//----------------------------------------------------------------------------- +mglSample samp[] = { + {"2_axis", smgl_2_axis}, + {"area", smgl_area}, + {"area_2", smgl_area_2}, + {"axial", smgl_axial}, + {"barh", smgl_barh}, + {"bars", smgl_bars}, + {"bars_2", smgl_bars_2}, + {"bars_a", smgl_bars_a}, + {"bars_f", smgl_bars_f}, + {"belt", smgl_belt}, + {"boxplot", smgl_boxplot}, + {"boxs", smgl_boxs}, + {"candle", smgl_candle}, + {"chart", smgl_chart}, + {"cloud", smgl_cloud}, + {"color_schemes", smgl_color_schemes}, + {"colors", smgl_colors}, + {"column", smgl_column}, + {"cont", smgl_cont}, + {"cont_xyz", smgl_cont_xyz}, + {"conta", smgl_conta}, + {"contd", smgl_contd}, + {"contf", smgl_contf}, + {"contfa", smgl_contfa}, + {"contt", smgl_contt}, +// {"crust", smgl_crust}, // TODO: open after triangulation + {"cutminmax", smgl_cutminmax}, + {"cutminmax2", smgl_cutminmax2}, + {"dens", smgl_dens}, + {"dens_xyz", smgl_dens_xyz}, + {"densa", smgl_densa}, + {"dew", smgl_dew}, + {"dew2", smgl_dew2}, + {"dots", smgl_dots}, + {"drops", smgl_drops}, + {"envelop", smgl_envelop}, + {"error", smgl_error}, + {"fall", smgl_fall}, + {"fish", smgl_fish}, + {"fit", smgl_fit}, + {"flow", smgl_flow}, + {"flow3", smgl_flow3}, + {"flow_dens", smgl_flow_dens}, + {"fonts", smgl_fonts}, + {"grad", smgl_grad}, + {"legend", smgl_legend}, + {"loglog", smgl_loglog}, + {"map", smgl_map}, + {"mark", smgl_mark}, + {"mesh", smgl_mesh}, + {"mesh_cont", smgl_mesh_cont}, + {"mirror", smgl_mirror}, + {"molecule", smgl_molecule}, + {"parser", smgl_parser}, // TODO: enable later + {"pde", smgl_pde}, + {"pie_chart", smgl_pie_chart}, + {"pipe", smgl_pipe}, + {"pipe2", smgl_pipe2}, + {"pipe3", smgl_pipe3}, + {"plot", smgl_plot}, + {"quaternary", smgl_quaternary}, + {"qo2d", smgl_qo2d}, + {"radar", smgl_radar}, + {"region", smgl_region}, + {"region_2", smgl_region_2}, + {"ring_chart", smgl_ring_chart}, + {"sample1", smgl_sample1}, + {"sample2", smgl_sample2}, + {"sample3", smgl_sample3}, + {"sample4", smgl_sample4}, + {"sample5", smgl_sample5}, + {"sample6", smgl_sample6}, + {"sample7", smgl_sample7}, + {"sample8", smgl_sample8}, + {"sample9", smgl_sample9}, + {"samplea", smgl_samplea}, + {"sampleb", smgl_sampleb}, + {"samplec", smgl_samplec}, + {"sampled", smgl_sampled}, + {"samplee", smgl_samplee}, + {"semilog", smgl_semilog}, + {"several_light", smgl_several_light}, + {"sew", smgl_sew}, + {"stem", smgl_stem}, + {"step", smgl_step}, + {"stereo", smgl_stereo}, + {"stfa", smgl_stfa}, + {"stick", smgl_stick}, + {"surf", smgl_surf}, + {"surf3", smgl_surf3}, + {"surf3_cutoff", smgl_surf3_cutoff}, + {"surf3a", smgl_surf3a}, + {"surf3c", smgl_surf3c}, + {"surf_alpha", smgl_surf_alpha}, + {"surf_caxis", smgl_surf_caxis}, + {"surf_cont", smgl_surf_cont}, + {"surf_cont_fog", smgl_surf_cont_fog}, + {"surf_cont_y", smgl_surf_cont_y}, + {"surf_cut", smgl_surf_cut}, + {"surf_fog", smgl_surf_fog}, + {"surf_sl", smgl_surf_sl}, + {"surfa", smgl_surfa}, + {"surfc", smgl_surfc}, + {"tens", smgl_tens}, + {"ternary", smgl_ternary}, + {"text", smgl_text}, + {"textmark", smgl_textmark}, + {"tile", smgl_tile}, + {"tiles", smgl_tiles}, + {"torus", smgl_torus}, + {"traj", smgl_traj}, + {"tube", smgl_tube}, + {"tube_3d", smgl_tube_3d}, + {"tval", smgl_tval}, + {"type0", smgl_type0}, + {"type1", smgl_type1}, + {"type2", smgl_type2}, + {"vect", smgl_vect}, + {"vect3", smgl_vect3}, + {"vectc", smgl_vectc}, + {"vectc3", smgl_vectc3}, + {"vectl", smgl_vectl}, + {"vectl3", smgl_vectl3}, + {"", NULL}}; diff --git a/examples/glut_example.cpp b/examples/glut_example.cpp index 171c4c6..24ccd3d 100644 --- a/examples/glut_example.cpp +++ b/examples/glut_example.cpp @@ -18,29 +18,33 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include -#include -//----------------------------------------------------------------------------- -int test(mglGraph *gr, void *); -int sample(mglGraph *gr, void *); -int sample_1(mglGraph *gr, void *); -int sample_2(mglGraph *gr, void *); -int sample_3(mglGraph *gr, void *); -int sample_d(mglGraph *gr, void *); -//----------------------------------------------------------------------------- +#include "mgl/glut.h" +//----------------------------------------------------------------------------- +int test_wnd(mglGraph *gr); +int sample(mglGraph *gr); +int sample_1(mglGraph *gr); +int sample_2(mglGraph *gr); +int sample_3(mglGraph *gr); +int sample_d(mglGraph *gr); +//----------------------------------------------------------------------------- int main(int argc,char **argv) { - mglGraphGLUT gr; char key = 0; - if(argc>1 && argv[1][0]!='-') key = argv[1][0]; + if(argc>1) key = argv[1][0]!='-' ? argv[1][0] : argv[1][1]; else printf("You may specify argument '1', '2', '3' or 'd' for viewing examples of 1d, 2d, 3d or dual plotting"); + + const char *desc; + draw_func func; switch(key) { - case '1': gr.Window(0,0,sample_1,"1D plots"); break; - case '2': gr.Window(0,0,sample_2,"2D plots"); break; - case '3': gr.Window(0,0,sample_3,"3D plots"); break; - case 'd': gr.Window(0,0,sample_d,"Dual plots"); break; - default: gr.Window(0,0,sample,"Example of molecules"); break; + case '1': func = sample_1; desc = "1D plots"; break; + case '2': func = sample_2; desc = "2D plots"; break; + case '3': func = sample_3; desc = "3D plots"; break; + case 'd': func = sample_d; desc = "Dual plots"; break; + case 't': func = test_wnd; desc = "Testing"; break; + default: func = sample; desc = "Example of molecules"; break; } + mglGLUT gr(func,desc); return 0; } -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- diff --git a/examples/main.cpp b/examples/main.cpp deleted file mode 100644 index ff10b32..0000000 --- a/examples/main.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/*************************************************************************** - * main.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "mgl/mgl_parse.h" -#include "mgl/mgl_idtf.h" -#include "mgl/mgl_fltk.h" -#include "mgl/mgl_eps.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_eval.h" -#include -#include - -int sample_font(mglGraph *gr, void *) -{ - mglData y(50), a(50,50); - y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); - a.Modify("2*rnd-1"); - //gr->PlotFactor = 1.6; // SERGEY !!! HERE !!! -// gr->BaseLineWidth = 5; - - -// gr->SubPlot(2,2,3); -// gr->Rotate(40,60); -// gr->Alpha(true); -// gr->Aspect(2,1,1); -// gr->Tile(a); -// gr->Colorbar(); -// setlocale(LC_ALL, "ru_RU.cp1251"); -// gr->Puts(mglPoint(0,1.2,1),"ïðèâåò, ýòî òåñò"); - -// gr->Perspective(0.3); - gr->Org = mglPoint(-1,-1,-1); - gr->Box(); gr->Grid(); -// gr->Text(y,"This is very long string drawn along a curve",":k"); - gr->Text(y,"Another string drawn above a curve","T:r"); - gr->Plot(y); - -/* gr->Axis(); - gr->Label('x',"\\xi label",0); - gr->Label('y',"y label",0); - gr->Label('z',"z label",0); - gr->AddLegend("Test 1_2","r"); - gr->AddLegend("\\sqrt{\\alpha^2}","g"); - gr->AddLegend("a_{ij}","b"); - gr->AddLegend("\\beta^{2^{3^{4}}}","ro"); - gr->Legend(3);*/ - return 0; -} -int sample_transp(mglGraph *gr, void *) // flag # -{ - gr->Alpha(true); gr->Light(true); gr->Light(0,mglPoint(0,0,1)); - mglData a(30,20); - a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); - - gr->TranspType = 0; gr->Clf(); - gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box(); - gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box(); - gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box(); - gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box(); - return 0; -} -//----------------------------------------------------------------------------- -int sample(mglGraph *gr, void *) -{ - mglParse par; - mglData a(10); a.Modify("rnd"); -// gr->Barh(a,"#"); - gr->Axis(mglPoint(-10,0), mglPoint(10,7)); - //gr->Plot("1/sqrt(1+x^2)"); - par.Parse(gr,"fplot '1/sqrt(1+x^2)' 'r'"); - return 0; -} - -//----------------------------------------------------------------------------- -extern mglTeXsymb mgl_tex_symb[]; -int tex_sort(const void *a, const void *b) -{ - const mglTeXsymb *aa = (mglTeXsymb *)a; - const mglTeXsymb *bb = (mglTeXsymb *)b; - return wcscmp(aa->tex, bb->tex); -} -int mgl_cmd_cmp(const void *a, const void *b); -int main(int argc,char **argv) -{ -// mglData a; -// a.ReadRange("/home/balakin/data/Balakin/s_% -/* long k,i; - for(k=0;mgl_tex_symb[k].kod;k++); - qsort(mgl_tex_symb, k, sizeof(mglTeXsymb), tex_sort); - FILE *fp = fopen("tex.txt","w"); - for(i=0;i -#include -//----------------------------------------------------------------------------- -int test(mglGraph *gr, void *); -int sample(mglGraph *gr, void *); -int sample_1(mglGraph *gr, void *); -int sample_2(mglGraph *gr, void *); -int sample_3(mglGraph *gr, void *); -int sample_d(mglGraph *gr, void *); -//----------------------------------------------------------------------------- -#include -#include -mglPoint pnt; // some global variable for changable data -void *mgl_qt_tmp(void *) { mglQtRun(); return 0; } -//----------------------------------------------------------------------------- +#include "mgl/mgl.h" +#include "mgl/qt.h" +//----------------------------------------------------------------------------- +int test_wnd(mglGraph *gr); +int sample(mglGraph *gr); +int sample_1(mglGraph *gr); +int sample_2(mglGraph *gr); +int sample_3(mglGraph *gr); +int sample_d(mglGraph *gr); +//----------------------------------------------------------------------------- +#include +#include +mglPoint pnt; // some global variable for changable data +void *mgl_qt_tmp(void *); +//----------------------------------------------------------------------------- int main(int argc,char **argv) { #ifdef PTHREAD_SAMPLE - mglGraphQT gr; - gr.Window(argc,argv,NULL,"test",0,0); // create window - gr.ClfOnUpdate = false; - static pthread_t tmp; - pthread_create(&tmp, 0, mgl_qt_tmp, 0); - pthread_detach(tmp); // run window handling in the separate thread - for(int i=0;i<10;i++) // do calculation - { - sleep(2); // which can be very long - pnt = mglPoint(2*mgl_rnd()-1,2*mgl_rnd()-1); - gr.Clf(); // make new drawing - gr.Line(mglPoint(),pnt,"Ar2"); - char str[10] = "i=0"; str[3] = '0'+i; - gr.Text(mglPoint(),""); - gr.Update(); // update window - } - return 0; // finish calculations and close the window -#else mglGraphQT gr; + gr.Window(argc,argv,NULL,"test",0,0); // create window + gr.ClfOnUpdate = false; + static pthread_t tmp; + pthread_create(&tmp, 0, mgl_qt_tmp, 0); + pthread_detach(tmp); // run window handling in the separate thread + for(int i=0;i<10;i++) // do calculation + { + sleep(2); // which can be very long + pnt = mglPoint(2*mgl_rnd()-1,2*mgl_rnd()-1); + gr.Clf(); // make new drawing + gr.Line(mglPoint(),pnt,"Ar2"); + char str[10] = "i=0"; str[3] = '0'+i; + gr.Text(mglPoint(),""); + gr.Update(); // update window + } + return 0; // finish calculations and close the window +#else + mglCanvasQT gr; char key = 0; if(argc>1 && argv[1][0]!='-') key = argv[1][0]; else printf("You may specify argument '1', '2', '3' or 'd' for viewing examples of 1d, 2d, 3d or dual plotting\n"); @@ -63,10 +64,10 @@ int main(int argc,char **argv) case '2': gr.Window(argc,argv,sample_2,"2D plots"); break; case '3': gr.Window(argc,argv,sample_3,"3D plots"); break; case 'd': gr.Window(argc,argv,sample_d,"Dual plots"); break; - case 't': gr.Window(argc,argv,test,"Testing"); break; + case 't': gr.Window(argc,argv,test_wnd,"Testing"); break; default: gr.Window(argc,argv,sample,"Example of molecules"); break; } - return mglQtRun(); + mgl_qt_run(); return 0; #endif } //----------------------------------------------------------------------------- diff --git a/examples/test.mgl b/examples/test.mgl deleted file mode 100644 index 95e57f1..0000000 --- a/examples/test.mgl +++ /dev/null @@ -1,13 +0,0 @@ -read a 'sample.csv' -copy x a(0) -copy y a(1) -copy z a(2) -triangulate n x y - -xrange x -yrange y -zrange z -crange z -#triplot n x y z -triplot n x y z '#' -tricont n x y z 'k' \ No newline at end of file diff --git a/examples/wnd_samples.cpp b/examples/wnd_samples.cpp index ff0971c..95d5b22 100644 --- a/examples/wnd_samples.cpp +++ b/examples/wnd_samples.cpp @@ -21,26 +21,53 @@ #include #include #include -#include -//----------------------------------------------------------------------------- -#include "mgl/mgl_parse.h" -int test(mglGraph *gr, void *) -{ - mglParse par; - par.AllowSetSize = true; - FILE *fp=fopen("test.mgl","rt"); - par.Execute(gr,fp); - fclose(fp); - return 0; -} -//----------------------------------------------------------------------------- -int sample(mglGraph *gr, void *) +//----------------------------------------------------------------------------- +#include "mgl/mgl.h" +#include "mgl/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); +void mgls_prepare3d(mglData *a, mglData *b=0); +void mgls_prepare2v(mglData *a, mglData *b); +void mgls_prepare3v(mglData *ex, mglData *ey, mglData *ez); +//----------------------------------------------------------------------------- +int test_wnd(mglGraph *gr) +{ +mgl_set_test_mode(true); + + gr->SubPlot(2,2,0); + gr->Rotate(60,70); gr->Ternary(2); + gr->Axis(); + gr->Box(); +// gr->SetRotatedText(false); + gr->Label('t',"A",1); gr->Label('x',"B",1); + gr->Label('y',"C",1); gr->Label('z',"D",1); + + gr->SubPlot(2,2,1); + gr->Rotate(60,70); gr->Ternary(1); + gr->Axis(); + gr->Box(); + gr->Label('x',"x comp."); + gr->Label('y',"y comp."); + gr->Label('t',"t comp."); + + gr->SubPlot(2,2,3); + gr->Rotate(60,70); gr->Ternary(0); + gr->Axis(); + gr->Box(); +// gr->SetRotatedText(false); + gr->Label('t',"A",1); gr->Label('x',"X",1); + gr->Label('y',"Y",1); gr->Label('z',"Z",1); + return 0; +} +//----------------------------------------------------------------------------- +int sample(mglGraph *gr) { // gr->Rotate(0,0); gr->Axis(); gr->Box(); return 0; // gr->Alpha(true); gr->Light(true); gr->SubPlot(2,2,0); - gr->Text(mglPoint(0,1.1),"Methane, CH_4",0,-2); gr->Rotate(60,120); + gr->Puts(mglPoint(0,1.1),"Methane, CH_4",0,-2); gr->Rotate(60,120); gr->Sphere(mglPoint(0,0,0),0.25,"k"); gr->Drop(mglPoint(0,0,0),mglPoint(0,0,1),0.35,"h",1,2); gr->Sphere(mglPoint(0,0,0.7),0.25,"g"); @@ -52,7 +79,7 @@ int sample(mglGraph *gr, void *) gr->Sphere(mglPoint(0.33,-0.57,-0.23),0.25,"g"); gr->SubPlot(2,2,1); - gr->Text(mglPoint(0,1.1),"Water, H{_2}O",0,-2); gr->Rotate(60,100); + gr->Puts(mglPoint(0,1.1),"Water, H{_2}O",0,-2); gr->Rotate(60,100); gr->Sphere(mglPoint(0,0,0),0.25,"r"); gr->Drop(mglPoint(0,0,0),mglPoint(0.3,0.5,0),0.3,"m",1,2); gr->Sphere(mglPoint(0.3,0.5,0),0.25,"g"); @@ -60,14 +87,14 @@ int sample(mglGraph *gr, void *) gr->Sphere(mglPoint(0.3,-0.5,0),0.25,"g"); gr->SubPlot(2,2,2); - gr->Text(mglPoint(0,1.1),"Oxygen, O_2",0,-2); gr->Rotate(60,120); + gr->Puts(mglPoint(0,1.1),"Oxygen, O_2",0,-2); gr->Rotate(60,120); gr->Drop(mglPoint(0,0.5,0),mglPoint(0,-0.3,0),0.3,"m",1,2); gr->Sphere(mglPoint(0,0.5,0),0.25,"r"); gr->Drop(mglPoint(0,-0.5,0),mglPoint(0,0.3,0),0.3,"m",1,2); gr->Sphere(mglPoint(0,-0.5,0),0.25,"r"); gr->SubPlot(2,2,3); - gr->Text(mglPoint(0,1.1),"Ammonia, NH_3",0,-2); gr->Rotate(60,120); + gr->Puts(mglPoint(0,1.1),"Ammonia, NH_3",0,-2); gr->Rotate(60,120); gr->Sphere(mglPoint(0,0,0),0.25,"b"); gr->Drop(mglPoint(0,0,0),mglPoint(0.33,0.57,0),0.32,"n",1,2); gr->Sphere(mglPoint(0.33,0.57,0),0.25,"g"); @@ -77,8 +104,8 @@ int sample(mglGraph *gr, void *) gr->Sphere(mglPoint(-0.65,0,0),0.25,"g"); return 0; } -//----------------------------------------------------------------------------- -int sample_1(mglGraph *gr, void *) +//----------------------------------------------------------------------------- +int sample_1(mglGraph *gr) { mglData a(50,15),d(50),d1(50),d2(50); d.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)"); @@ -88,13 +115,13 @@ int sample_1(mglGraph *gr, void *) gr->NewFrame(); gr->Box(); gr->Axis("xy"); gr->Label('x',"x"); gr->Label('y',"y"); - gr->Text(mglPoint(0,1.2,1),"Simple plot of one curve"); + gr->Puts(mglPoint(0,1.2,1),"Simple plot of one curve"); gr->Plot(d); gr->EndFrame(); gr->NewFrame(); gr->Box(); gr->Axis("xy"); gr->Label('x',"x"); gr->Label('y',"y"); - gr->Text(mglPoint(0,1.2,1),"Three curves with manual styles"); + gr->Puts(mglPoint(0,1.2,1),"Three curves with manual styles"); gr->Plot(d,"b"); gr->Plot(d1,"ri"); gr->Plot(d2,"m|^"); @@ -103,7 +130,7 @@ int sample_1(mglGraph *gr, void *) gr->NewFrame(); gr->Box(); gr->Axis("xy"); gr->Label('x',"x"); gr->Label('y',"y"); - gr->Text(mglPoint(0,1.2,1),"Three curves with automatic styles"); + gr->Puts(mglPoint(0,1.2,1),"Three curves with automatic styles"); gr->Plot(d); gr->Plot(d1); gr->Plot(d2); @@ -111,19 +138,19 @@ int sample_1(mglGraph *gr, void *) gr->NewFrame(); gr->Box(); gr->Axis("xy"); gr->Label('x',"x"); gr->Label('y',"y"); - gr->Text(mglPoint(0,1.2,1),"Curves from matrix"); + gr->Puts(mglPoint(0,1.2,1),"Curves from matrix"); gr->Plot(a); gr->EndFrame(); gr->NewFrame(); gr->Box(); gr->Axis("xy"); gr->Label('x',"x"); gr->Label('y',"y"); - gr->Text(mglPoint(0,1.2,1),"Parametrical curves in 2D"); + gr->Puts(mglPoint(0,1.2,1),"Parametrical curves in 2D"); gr->Plot(d1,d2,"b"); gr->Plot(d1,d,"ri"); gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Parametrical curves in 3D"); + gr->Puts(mglPoint(0,1.2,1),"Parametrical curves in 3D"); gr->Rotate(60,40); gr->Box(); gr->Axis(); gr->Label('x',"x"); gr->Label('y',"y"); gr->Label('z',"z"); gr->Plot(d1,d2,d,"b"); @@ -132,48 +159,48 @@ int sample_1(mglGraph *gr, void *) gr->NewFrame(); gr->SubPlot(2,2,0); gr->Box(); gr->Axis("xy"); gr->Label('x',"x"); gr->Label('y',"y"); - gr->Text(mglPoint(0,1.2,1),"Area plot"); + gr->Puts(mglPoint(0,1.2,1),"Area plot"); gr->Area(d); gr->SubPlot(2,2,1); gr->Box(); gr->Axis("xy"); gr->Label('x',"x"); gr->Label('y',"y"); - gr->Text(mglPoint(0,1.2,1),"Step plot"); + gr->Puts(mglPoint(0,1.2,1),"Step plot"); gr->Step(d); gr->SubPlot(2,2,2); gr->Box(); gr->Axis("xy"); gr->Label('x',"x"); gr->Label('y',"y"); - gr->Text(mglPoint(0,1.2,1),"Stem plot"); + gr->Puts(mglPoint(0,1.2,1),"Stem plot"); gr->Stem(d); gr->SubPlot(2,2,3); gr->Box(); gr->Axis("xy"); gr->Label('x',"x"); gr->Label('y',"y"); - gr->Text(mglPoint(0,1.2,1),"Bars plot"); + gr->Puts(mglPoint(0,1.2,1),"Bars plot"); gr->Bars(d); gr->EndFrame(); gr->NewFrame(); gr->SubPlot(2,2,0); - gr->Text(mglPoint(0,1.2,1),"Area plot in 3D"); + gr->Puts(mglPoint(0,1.2,1),"Area plot in 3D"); gr->Rotate(60,40); gr->Box(); gr->Axis(); gr->Label('x',"x"); gr->Label('y',"y"); gr->Area(d1,d2,d); gr->SubPlot(2,2,1); - gr->Text(mglPoint(0,1.2,1),"Step plot in 3D"); + gr->Puts(mglPoint(0,1.2,1),"Step plot in 3D"); gr->Rotate(60,40); gr->Box(); gr->Axis(); gr->Label('x',"x"); gr->Label('y',"y"); gr->Step(d1,d2,d); gr->SubPlot(2,2,2); - gr->Text(mglPoint(0,1.2,1),"Stem plot in 3D"); + gr->Puts(mglPoint(0,1.2,1),"Stem plot in 3D"); gr->Rotate(60,40); gr->Box(); gr->Axis(); gr->Label('x',"x"); gr->Label('y',"y"); gr->Stem(d1,d2,d); gr->SubPlot(2,2,3); - gr->Text(mglPoint(0,1.2,1),"Bars plot in 3D"); + gr->Puts(mglPoint(0,1.2,1),"Bars plot in 3D"); gr->Rotate(60,40); gr->Box(); gr->Axis(); gr->Label('x',"x"); gr->Label('y',"y"); gr->Bars(d1,d2,d); gr->EndFrame(); return gr->GetNumFrame(); } -//----------------------------------------------------------------------------- -int sample_2(mglGraph *gr, void *) +//----------------------------------------------------------------------------- +int sample_2(mglGraph *gr) { mglData a(50,50),b(50,50),c(50,50),d(50,50),m(50,50),c1(50,50,7), d1(50),d2(50); @@ -186,7 +213,7 @@ int sample_2(mglGraph *gr, void *) c1.Modify("(2-z)*(2*x-1)^2 + (z+1)*(2*y-1)^2"); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Simple surface"); + gr->Puts(mglPoint(0,1.2,1),"Simple surface"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Surf(a,"BbcyrR"); @@ -195,22 +222,22 @@ int sample_2(mglGraph *gr, void *) gr->NewFrame(); gr->SubPlot(2,2,0); - gr->Text(mglPoint(0,1.2,1),"Gray color scheme 'kw'"); + gr->Puts(mglPoint(0,1.2,1),"Gray color scheme 'kw'"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Surf(a,"kw"); gr->SubPlot(2,2,1); - gr->Text(mglPoint(0,1.2,1),"Hot color scheme 'wyrRk'"); + gr->Puts(mglPoint(0,1.2,1),"Hot color scheme 'wyrRk'"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Surf(a,"wyrRk"); gr->SubPlot(2,2,2); - gr->Text(mglPoint(0,1.2,1),"Along coordiantes 'rgbd'"); + gr->Puts(mglPoint(0,1.2,1),"Along coordiantes 'rgbd'"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Surf(a,"rgbd"); gr->SubPlot(2,2,3); - gr->Text(mglPoint(0,1.2,1),"Bicolor scheme 'BbwrR'"); + gr->Puts(mglPoint(0,1.2,1),"Bicolor scheme 'BbwrR'"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Surf(a,"BbwrR"); @@ -218,44 +245,44 @@ int sample_2(mglGraph *gr, void *) gr->NewFrame(); gr->Box(); gr->Axis(); - gr->Text(mglPoint(0,1.2,1),"Density plot"); + gr->Puts(mglPoint(0,1.2,1),"Density plot"); gr->Dens(a,"BbcyrR"); gr->InPlot(0.6,1,0.6,1,false); // new axis in upper right corner gr->Box(); gr->Axis(); - gr->Text(mglPoint(0,1.2,1),"... with bicolor"); + gr->Puts(mglPoint(0,1.2,1),"... with bicolor"); gr->Dens(a,"BbwrR"); gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Mesh lines (previous scheme by default)"); + gr->Puts(mglPoint(0,1.2,1),"Mesh lines (previous scheme by default)"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Mesh(a); gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Surface of boxes"); + gr->Puts(mglPoint(0,1.2,1),"Surface of boxes"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Boxs(a,"BbcyrR"); gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Contour plot"); + gr->Puts(mglPoint(0,1.2,1),"Contour plot"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Cont(a); gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Contour isosurface y-rotation"); + gr->Puts(mglPoint(0,1.2,1),"Contour isosurface y-rotation"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Axial(a,":y"); gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Contour isosurface x-rotation"); + gr->Puts(mglPoint(0,1.2,1),"Contour isosurface x-rotation"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Axial(a,"x"); @@ -263,44 +290,44 @@ int sample_2(mglGraph *gr, void *) gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Surface and contours"); + gr->Puts(mglPoint(0,1.2,1),"Surface and contours"); gr->Rotate(40,60); gr->Box(); gr->Axis(); - gr->Cont(a,"BbcyrR",7,gr->Min.z); + gr->Cont(a,"BbcyrR_"); gr->Surf(a); gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Parametrical surface (1)"); + gr->Puts(mglPoint(0,1.2,1),"Parametrical surface (1)"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Mesh(d1,d2,b); gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Parametrical surface (vase)"); + gr->Puts(mglPoint(0,1.2,1),"Parametrical surface (vase)"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Surf(b,c,m); gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Parametrical surface (torus)"); + gr->Puts(mglPoint(0,1.2,1),"Parametrical surface (torus)"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Surf(b,c,d); gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Contours for 3-tensor"); + gr->Puts(mglPoint(0,1.2,1),"Contours for 3-tensor"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Cont(c1); gr->EndFrame(); return gr->GetNumFrame(); } -//----------------------------------------------------------------------------- -int sample_3(mglGraph *gr, void *) +//----------------------------------------------------------------------------- +int sample_3(mglGraph *gr) { mglData a(50,50,50),b(50,50,50), c(50,50,50),d(50,50,50), d1(50),d2(50),d3(50); d1.Modify("cos(2*pi*x)"); @@ -313,49 +340,49 @@ int sample_3(mglGraph *gr, void *) // c.Modify("0.5*sin(2*pi*x)*sin(3*pi*y)*sin(3*pi*z) + 0.5*cos(4*pi*(x*y*z-(x*y+y*z+z*x)/2))"); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Isosurface (try lightning!)"); + gr->Puts(mglPoint(0,1.2,1),"Isosurface (try lightning!)"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Surf3(a); gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Isosurface with 'rgbd' scheme"); + gr->Puts(mglPoint(0,1.2,1),"Isosurface with 'rgbd' scheme"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Surf3(a,"rgbd"); gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Cloud plot (switch alpha !!!)"); + gr->Puts(mglPoint(0,1.2,1),"Cloud plot (switch alpha !!!)"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Cloud(a,"BbcyrR"); gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Density at central slices"); + gr->Puts(mglPoint(0,1.2,1),"Density at central slices"); gr->Rotate(40,60); gr->Box(); gr->Axis(); - gr->DensA(a); + gr->Dens3(a,'x'); gr->Dens3(a,'y'); gr->Dens3(a,'z'); gr->EndFrame(); gr->NewFrame(); - gr->Text(mglPoint(0,1.2,1),"Contours at central slices"); + gr->Puts(mglPoint(0,1.2,1),"Contours at central slices"); gr->Rotate(40,60); gr->Box(); gr->Axis(); - gr->ContA(a); + gr->Cont3(a,'x'); gr->Cont3(a,'y'); gr->Cont3(a,'z'); gr->EndFrame(); gr->NewFrame(); gr->SubPlot(2,1,0); - gr->Text(mglPoint(0,1.2,1),"Gauss difraction"); + gr->Puts(mglPoint(0,1.2,1),"Gauss difraction"); gr->Rotate(40,60); gr->Box(); gr->Axis(); - gr->CAxis(0,1); + gr->SetRange('c',0,1); gr->Surf3(0.5,c,"g"); gr->SubPlot(2,1,1); - gr->Text(mglPoint(0,1.2,1),"and its phase"); + gr->Puts(mglPoint(0,1.2,1),"and its phase"); gr->Rotate(40,60); gr->Box(); gr->Axis(); gr->Surf3A(sin(M_PI/4),d,c,"q"); @@ -364,8 +391,8 @@ int sample_3(mglGraph *gr, void *) return gr->GetNumFrame(); } -//----------------------------------------------------------------------------- -int sample_d(mglGraph *gr, void *) +//----------------------------------------------------------------------------- +int sample_d(mglGraph *gr) { mglData a(50,50),b(50,50); mglData cx(50,50,50),cy(50,50,50),cz(50,50,50); @@ -377,22 +404,102 @@ int sample_d(mglGraph *gr, void *) gr->NewFrame(); gr->Box(); gr->Axis("xy"); - gr->Text(mglPoint(0,1.2,1),"Vector field (color ~ \\sqrt{a^2})","rC",8); - gr->VectC(a,b); + gr->Puts(mglPoint(0,1.2,1),"Vector field (color ~ \\sqrt{a^2})","rC",8); + gr->Vect(a,b,"","value 50"); gr->EndFrame(); gr->NewFrame(); gr->Box(); gr->Axis("xy"); - gr->Text(mglPoint(0,1.2,1),"Vector field (length ~ \\sqrt{a^2})","rC",8); + gr->Puts(mglPoint(0,1.2,1),"Vector field (length ~ \\sqrt{a^2})","rC",8); gr->Vect(a,b); gr->EndFrame(); gr->NewFrame(); gr->Box(); gr->Axis("xy"); - gr->Text(mglPoint(0,1.2,1),"Flow chart (blue - source)","rC",8); + gr->Puts(mglPoint(0,1.2,1),"Flow chart (blue - source)","rC",8); gr->Flow(a,b); gr->EndFrame(); return gr->GetNumFrame(); } -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void mgls_prepare1d(mglData *y, mglData *y1, mglData *y2, mglData *x1, mglData *x2) +{ + register long i,n=50; + if(y) y->Create(n,3); + if(x1) x1->Create(n); if(x2) x2->Create(n); + if(y1) y1->Create(n); if(y2) y2->Create(n); + float xx; + for(i=0;ia[i] = 0.7*sin(2*M_PI*xx) + 0.5*cos(3*M_PI*xx) + 0.2*sin(M_PI*xx); + y->a[i+n] = sin(2*M_PI*xx); + y->a[i+2*n] = cos(2*M_PI*xx); + } + if(y1) y1->a[i] = 0.5+0.3*cos(2*M_PI*xx); + if(y2) y2->a[i] = 0.3*sin(2*M_PI*xx); + if(x1) x1->a[i] = xx*2-1; + if(x2) x2->a[i] = 0.05+0.03*cos(2*M_PI*xx); + } +} +//----------------------------------------------------------------------------- +void mgls_prepare2d(mglData *a, mglData *b, mglData *v) +{ + register long i,j,n=50,m=40,i0; + if(a) a->Create(n,m); if(b) b->Create(n,m); + if(v) { v->Create(9); v->Fill(-1,1); } + float x,y; + for(i=0;ia[i0] = 0.6*sin(2*M_PI*x)*sin(3*M_PI*y)+0.4*cos(3*M_PI*x*y); + if(b) b->a[i0] = 0.6*cos(2*M_PI*x)*cos(3*M_PI*y)+0.4*cos(3*M_PI*x*y); + } +} +//----------------------------------------------------------------------------- +void mgls_prepare3d(mglData *a, mglData *b) +{ + register long i,j,k,n=60,m=50,l=40,i0; + if(a) a->Create(n,m,l); if(b) b->Create(n,m,l); + float x,y,z; + for(i=0;ia[i0] = -2*(x*x + y*y + z*z*z*z - z*z - 0.1); + if(b) b->a[i0] = 1-2*tanh((x+y)*(x+y)); + } +} +//----------------------------------------------------------------------------- +void mgls_prepare2v(mglData *a, mglData *b) +{ + register long i,j,n=20,m=30,i0; + if(a) a->Create(n,m); if(b) b->Create(n,m); + float x,y; + for(i=0;ia[i0] = 0.6*sin(2*M_PI*x)*sin(3*M_PI*y)+0.4*cos(3*M_PI*x*y); + if(b) b->a[i0] = 0.6*cos(2*M_PI*x)*cos(3*M_PI*y)+0.4*cos(3*M_PI*x*y); + } +} +//----------------------------------------------------------------------------- +void mgls_prepare3v(mglData *ex, mglData *ey, mglData *ez) +{ + register long i,j,k,n=10,i0; + if(!ex || !ey || !ez) return; + ex->Create(n,n,n); ey->Create(n,n,n); ez->Create(n,n,n); + float x,y,z, r1,r2; + for(i=0;ia[i0]=0.2*x/r1 - 0.2*x/r2; + ey->a[i0]=0.2*y/r1 - 0.2*y/r2; + ez->a[i0]=0.2*(z-0.3)/r1 - 0.2*(z+0.3)/r2; + } +} +//----------------------------------------------------------------------------- diff --git a/examples/wx_example.cpp b/examples/wx_example.cpp index 393366f..59ded2c 100644 --- a/examples/wx_example.cpp +++ b/examples/wx_example.cpp @@ -1,58 +1,58 @@ -/*************************************************************************** - * wx_example.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ +/*************************************************************************** + * wx_example.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ #include -#include -//----------------------------------------------------------------------------- +#include "mgl/wx.h" +//----------------------------------------------------------------------------- #ifdef ENABLE_MGLGRAPHWX -int test(mglGraph *gr, void *); +int test(mglGraph *gr, void *); int sample(mglGraph *gr, void *); int sample_1(mglGraph *gr, void *); int sample_2(mglGraph *gr, void *); int sample_3(mglGraph *gr, void *); int sample_d(mglGraph *gr, void *); -//----------------------------------------------------------------------------- -#include -#include -mglPoint pnt; // some global variable for changable data -void *mgl_wx_tmp(void *) { mglWxRun(); return 0; } -//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +#include +#include +mglPoint pnt; // some global variable for changable data +void *mgl_wx_tmp(void *) { mglWxRun(); return 0; } +//----------------------------------------------------------------------------- int main(int argc,char **argv) { #ifdef PTHREAD_SAMPLE - mglGraphWX gr; - gr.Window(argc,argv,NULL,"test",0,0); // create window - gr.ClfOnUpdate = false; - static pthread_t tmp; - pthread_create(&tmp, 0, mgl_qt_tmp, 0); - pthread_detach(tmp); // run window handling in the separate thread - for(int i=0;i<10;i++) // do calculation - { - sleep(2); // which can be very long - pnt = mglPoint(2*mgl_rnd()-1,2*mgl_rnd()-1); - gr.Clf(); // make new drawing - gr.Line(mglPoint(),pnt,"Ar2"); - char str[10] = "i=0"; str[3] = '0'+i; - gr.Text(mglPoint(),""); - gr.Update(); // update window - } - return 0; // finish calculations and close the window + mglGraphWX gr; + gr.Window(argc,argv,NULL,"test",0,0); // create window + gr.ClfOnUpdate = false; + static pthread_t tmp; + pthread_create(&tmp, 0, mgl_qt_tmp, 0); + pthread_detach(tmp); // run window handling in the separate thread + for(int i=0;i<10;i++) // do calculation + { + sleep(2); // which can be very long + pnt = mglPoint(2*mgl_rnd()-1,2*mgl_rnd()-1); + gr.Clf(); // make new drawing + gr.Line(mglPoint(),pnt,"Ar2"); + char str[10] = "i=0"; str[3] = '0'+i; + gr.Text(mglPoint(),""); + gr.Update(); // update window + } + return 0; // finish calculations and close the window #else mglGraphWX gr; char key = 0; @@ -71,6 +71,6 @@ int main(int argc,char **argv) #endif } //----------------------------------------------------------------------------- -#else +#else int main(int argc,char **argv) { return 0; } #endif \ No newline at end of file diff --git a/examples/hotdogs.pts b/hotdogs.pts similarity index 100% rename from examples/hotdogs.pts rename to hotdogs.pts diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index a62dfa3..13e9724 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -9,23 +9,24 @@ configure_file(${CMAKE_SOURCE_DIR}/include/config.h.in ${CMAKE_SOURCE_DIR}/inclu set(MGL_INCLUDE_PATH "${CMAKE_INSTALL_PREFIX}/include/mgl") install(DIRECTORY mgl/ DESTINATION ${MGL_INCLUDE_PATH} PATTERN ".svn" EXCLUDE - PATTERN "mgl_fltk.h" EXCLUDE - PATTERN "mgl_glut.h" EXCLUDE - PATTERN "mgl_wx.h" EXCLUDE - PATTERN "mgl_qt.h" EXCLUDE + PATTERN "fltk.h" EXCLUDE + PATTERN "glut.h" EXCLUDE + PATTERN "wx.h" EXCLUDE + PATTERN "qt.h" EXCLUDE + PATTERN "*~" EXCLUDE PATTERN "*.fs" PATTERN "*.pas" PATTERN "*.h") if(use_fltk) - install(FILES mgl/mgl_fltk.h DESTINATION ${MGL_INCLUDE_PATH}) + install(FILES mgl/fltk.h DESTINATION ${MGL_INCLUDE_PATH}) endif(use_fltk) if(use_glut) - install(FILES mgl/mgl_glut.h DESTINATION ${MGL_INCLUDE_PATH}) + install(FILES mgl/glut.h DESTINATION ${MGL_INCLUDE_PATH}) endif(use_glut) if(use_wx) - install(FILES mgl/mgl_wx.h DESTINATION ${MGL_INCLUDE_PATH}) + install(FILES mgl/wx.h DESTINATION ${MGL_INCLUDE_PATH}) endif(use_wx) if(use_qt) - install(FILES mgl/mgl_qt.h DESTINATION ${MGL_INCLUDE_PATH}) + install(FILES mgl/qt.h DESTINATION ${MGL_INCLUDE_PATH}) endif(use_qt) diff --git a/include/Makefile.am b/include/Makefile.am index 79e83b2..0d232e0 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,20 +1,14 @@ if USE_FLTK -FLTK_INC = mgl/mgl_fltk.h +FLTK_INC = mgl/fltk.h endif -if USE_GLUT -GLUT_INC = mgl/mgl_glut.h -endif - -if USE_WX -WX_INC = mgl/mgl_wx.h -endif - if USE_QT -QT_INC = mgl/mgl_qt.h +QT_INC = mgl/qt.h endif -nobase_include_HEADERS = $(FLTK_INC) $(GLUT_INC) $(WX_INC) $(QT_INC) \ -mgl/mgl_ab.h mgl/mgl_data.h mgl/mgl_eval.h mgl/mgl_gl.h mgl/mgl.h mgl/mgl_parse.h \ -mgl/mgl_c.h mgl/mgl_eps.h mgl/mgl_f.h mgl/mgl_font.h mgl/mgl_idtf.h mgl/mgl_zb.h \ -mgl/mgl_addon.h mgl/mgl_evalc.h mgl/mgl_define.h mgl/config.h mgl/mgl_pas.pas \ -mgl/mgl_w.h mgl/gsl.fs mgl/mathgl.fs mgl/mglplot.fs mgl/vectors.fs +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/Makefile.in b/include/Makefile.in index 2e75913..d3bd7ac 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -48,13 +48,12 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = -am__nobase_include_HEADERS_DIST = mgl/mgl_fltk.h mgl/mgl_glut.h \ - mgl/mgl_wx.h mgl/mgl_qt.h mgl/mgl_ab.h mgl/mgl_data.h \ - mgl/mgl_eval.h mgl/mgl_gl.h mgl/mgl.h mgl/mgl_parse.h \ - mgl/mgl_c.h mgl/mgl_eps.h mgl/mgl_f.h mgl/mgl_font.h \ - mgl/mgl_idtf.h mgl/mgl_zb.h mgl/mgl_addon.h mgl/mgl_evalc.h \ - mgl/mgl_define.h mgl/config.h mgl/mgl_pas.pas mgl/mgl_w.h \ - mgl/gsl.fs mgl/mathgl.fs mgl/mglplot.fs mgl/vectors.fs +am__nobase_include_HEADERS_DIST = mgl/fltk.h mgl/qt.h 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 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -113,10 +112,6 @@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLTK_FLAGS = @FLTK_FLAGS@ FLTK_LIBS = @FLTK_LIBS@ -GIF_FLAGS = @GIF_FLAGS@ -GIF_LIBS = @GIF_LIBS@ -GLUT_FLAGS = @GLUT_FLAGS@ -GLUT_LIBS = @GLUT_LIBS@ GL_LIBS = @GL_LIBS@ GREP = @GREP@ GSL_FLAGS = @GSL_FLAGS@ @@ -142,7 +137,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MGL_AGE = @MGL_AGE@ MGL_CURRENT = @MGL_CURRENT@ MGL_RELEASE = @MGL_RELEASE@ @@ -197,13 +191,10 @@ TMPDIR = @TMPDIR@ U3D_LIBS = @U3D_LIBS@ UIC = @UIC@ VERSION = @VERSION@ -WX_FLAGS = @WX_FLAGS@ -WX_LIBS = @WX_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -237,6 +228,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -256,15 +248,15 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@USE_FLTK_TRUE@FLTK_INC = mgl/mgl_fltk.h -@USE_GLUT_TRUE@GLUT_INC = mgl/mgl_glut.h -@USE_WX_TRUE@WX_INC = mgl/mgl_wx.h -@USE_QT_TRUE@QT_INC = mgl/mgl_qt.h -nobase_include_HEADERS = $(FLTK_INC) $(GLUT_INC) $(WX_INC) $(QT_INC) \ -mgl/mgl_ab.h mgl/mgl_data.h mgl/mgl_eval.h mgl/mgl_gl.h mgl/mgl.h mgl/mgl_parse.h \ -mgl/mgl_c.h mgl/mgl_eps.h mgl/mgl_f.h mgl/mgl_font.h mgl/mgl_idtf.h mgl/mgl_zb.h \ -mgl/mgl_addon.h mgl/mgl_evalc.h mgl/mgl_define.h mgl/config.h mgl/mgl_pas.pas \ -mgl/mgl_w.h mgl/gsl.fs mgl/mathgl.fs mgl/mglplot.fs mgl/vectors.fs +@USE_FLTK_TRUE@FLTK_INC = mgl/fltk.h +@USE_QT_TRUE@QT_INC = mgl/qt.h +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 all: all-am diff --git a/include/mgl/base.h b/include/mgl/base.h new file mode 100644 index 0000000..96b7cfd --- /dev/null +++ b/include/mgl/base.h @@ -0,0 +1,382 @@ +/*************************************************************************** + * base.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef _MGL_BASE_H_ +#define _MGL_BASE_H_ +#include +#include +#include +#include +#ifndef _MSC_VER +#include +#endif +#include "mgl/define.h" +/*****************************************************************************/ +#ifdef __cplusplus +#include +#include +#include "mgl/type.h" +#include "mgl/eval.h" +#include "mgl/font.h" +//----------------------------------------------------------------------------- +/// Abstract class for data array +class mglDataA +{ +public: + virtual float v(long i,long j=0,long k=0) const = 0; + virtual float vthr(long i) const = 0; + virtual long GetNx() const = 0; + virtual long GetNy() const = 0; + virtual long GetNz() const = 0; + inline long GetNN() const { return GetNx()*GetNy()*GetNz(); } + virtual float Maximal() const = 0; + virtual float Minimal() const = 0; + virtual float dvx(long i,long j=0,long k=0) const = 0; +// { return i>0 ? (i0 ? (j0 ? (kRestore(); } + /// Load font from file + inline void LoadFont (const char *name, const char *path=NULL) + { fnt->Load(name,path); }; + /// Copy font from another mglGraph instance + inline void CopyFont(mglBase *gr) { fnt->Copy(gr->GetFont()); } + /// Set default font size + inline void SetFontSize(float val) { FontSize=val>0 ? val:FontSize*val; } + inline float GetFontSize() { return FontSize; }; + inline float TextWidth(const wchar_t *text, const char *font, float size) + { return (size<0?-size*FontSize:size)*font_factor*fnt->Width(text,(font&&*font)?font:FontDef)/8; } + inline float TextHeight(const char *font, float size) + { return (size<0?-size*FontSize:size)*font_factor*fnt->Height(font?font:FontDef)/8; } + inline float FontFactor() { return font_factor; } + virtual float GetRatio(); + /// Set to use or not text rotation + inline void SetRotatedText(bool val) { set(val,MGL_ENABLE_RTEXT); } + /// Set default font style and color + inline void SetFontDef(const char *font) { strncpy(FontDef, font, 31); } + /// Set to use or not text rotation + inline void SetTickRotate(bool val) { set(val,MGL_TICKS_ROTATE); } + /// Set to use or not text rotation + inline void SetTickSkip(bool val) { set(val,MGL_TICKS_SKIP); } + + /// Set plot quality + virtual void SetQuality(int qual=MGL_DRAW_NORM) { Quality=qual; } + inline int GetQuality() { return Quality; } + + // ~~~~~~~~~~~~~~~~~~~~~~ Developer functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // NOTE! Following 3 functions are NOT thread-safe!!! + /// Add point to the pntN and return its position + long AddPnt(mglPoint p, float c=-1, mglPoint n=mglPoint(NAN), float a=-1, int scl=1); + long CopyNtoC(long k, float c); + long CopyProj(long from, mglPoint p, mglPoint n); // NOTE: this is not-thread-safe!!! + virtual void Reserve(long n); ///< Allocate n-cells for pntC and return current position + +// inline long GetPos() { return Pnt.size()-1; } + inline mglPoint GetPnt(long i) + { const mglPnt &p=Pnt[i]; return mglPoint(p.x,p.y,p.z); } + inline float GetClrC(long i) { return Pnt[i].c; } + inline long GetPntNum() { return Pnt.size(); } + /// Scale coordinates and cut off some points + virtual bool ScalePoint(mglPoint &p, mglPoint &n, bool use_nan=true); + + virtual float GetOrgX(char dir)=0; ///< Get Org.x (parse NAN value) + virtual float GetOrgY(char dir)=0; ///< Get Org.y (parse NAN value) + virtual float GetOrgZ(char dir)=0; ///< Get Org.z (parse NAN value) + + /// Get color depending on single variable z, which should be scaled if scale=true + inline float GetC(long s,float z,bool scale = true) + { return s+(scale?GetA(z):z); } + /// Get alpha value depending on single variable \a a + float GetA(float a); + /// Set pen/palette + char SetPenPal(const char *stl, long *id=0); + /// Add texture (like color scheme) and return the position of first color + long AddTexture(const char *cols, int smooth=0); +// inline float AddTexture(char col) { return AddTexture(mglColor(col)); }; + float AddTexture(mglColor col); + inline void DefColor(mglColor col) { CDef = AddTexture(col); } + /// Set next color from palette + float NextColor(long &id); + + virtual void mark_plot(long p, char type, float size=1)=0; + virtual void arrow_plot(long p1, long p2, char st)=0; + virtual void line_plot(long p1, long p2)=0; + virtual void trig_plot(long p1, long p2, long p3)=0; + virtual void quad_plot(long p1, long p2, long p3, long p4)=0; + virtual void Glyph(float x, float y, float f, int style, long icode, float col)=0; + virtual float text_plot(long p,const wchar_t *text,const char *fnt,float size=-1,float sh=0,float col=-('k'))=0; + void vect_plot(long p1, long p2, float s=1); + +protected: + mglPoint FMin; ///< Actual lower edge after transformation formulas. + mglPoint FMax; ///< Actual upper edge after transformation formulas. + mglPoint Org; ///< Center of axis cross section. + int WarnCode; ///< Warning code + std::vector Pnt; ///< Internal points +#ifdef HAVE_PTHREAD + pthread_mutex_t mutexPnt, mutexTxt; +#endif + + int TernAxis; ///< Flag that Ternary axis is used + unsigned PDef; ///< Pen bit mask + float pPos; ///< Current position in pen mask + float PenWidth; ///< Pen width for further line plotting (must be >0 !!!) + std::vector Txt; ///< Pointer to textures +// long numT; ///< Number of textures + float AmbBr; ///< Default ambient light brightness + + mglFont *fnt; ///< Class for printing vector text + float FontSize; ///< The size of font for tick and axis labels + char FontDef[32]; ///< Font specification (see mglGraph::Puts). Default is Roman with align at center. + int Quality; ///< Quality of plot (0x0-pure, 0x1-fast; 0x2-fine; 0x4 - low memory) + + mglFormula *fx; ///< Transformation formula for x direction. + mglFormula *fy; ///< Transformation formula for y direction. + mglFormula *fz; ///< Transformation formula for z direction. + mglFormula *fa; ///< Transformation formula for coloring. + mglFormula *fc; ///< Cutting off condition (formula). + + long CurrPal; ///< Current palette index + float MarkSize; ///< The size of marks for 1D plots. + float ArrowSize; ///< The size of arrows. + char last_style[64];///< Last pen style + float font_factor; ///< Font scaling factor + + virtual void LightScale()=0; ///< Scale positions of light sources + +private: + mglPoint MinS; ///< Saved lower edge of bounding box for graphics. + mglPoint MaxS; ///< Saved upper edge of bounding box for graphics. + float MSS, ASS, FSS, ADS, MNS, CSS, LSS; ///< Saved state + bool saved; ///< State is saved + float prev_val; ///< previous value or zero (if no one) + + mglPoint CutMin; ///< Lower edge of bounding box for cut off. + mglPoint CutMax; ///< Upper edge of bounding box for cut off. + + void RecalcCRange(); ///< Recalculate internal parameter for correct coloring. + void RecalcBorder(); ///< Recalculate internal parameter for correct transformation rules. + void SetFBord(float x,float y,float z); ///< Set internal boundng box depending on transformation formula + void ClearEq(); ///< Clear the used variables for axis transformation +}; +//----------------------------------------------------------------------------- +#define _Da_(d) (*((const mglDataA *)(d))) +#define _DA_(a) ((const mglDataA *)*(a)) +#define _GR_ ((mglBase *)(*gr)) +//----------------------------------------------------------------------------- +//#define _D_(d) *((mglData *)*(d)) +#define _DM_(a) ((mglData *)*(a)) +#define _DT_ ((mglData *)*d) +//----------------------------------------------------------------------------- +class mglData; +class mglParser; +typedef mglBase* HMGL; +typedef mglData* HMDT; +typedef mglParser* HMPR; +typedef const mglDataA* HCDT; +#else +typedef void *HMGL; +typedef void *HMDT; +typedef void *HMPR; +typedef const void *HCDT; +#endif +/*****************************************************************************/ +#endif diff --git a/include/mgl/base_cf.h b/include/mgl/base_cf.h new file mode 100644 index 0000000..31d525a --- /dev/null +++ b/include/mgl/base_cf.h @@ -0,0 +1,117 @@ +/*************************************************************************** + * base_cf.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef _MGL_BASE_CF_H_ +#define _MGL_BASE_CF_H_ +#include "mgl/base.h" +/*****************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif +/*****************************************************************************/ +int mgl_get_warn(HMGL gr); +void mgl_set_warn(HMGL gr, int code, const char *text); +void mgl_buf_warn(HMGL gr, char *buf); +long mgl_use_graph(HMGL gr, int inc); +void mgl_start_group(HMGL gr, const char *); +void mgl_end_group(HMGL gr); + +void mgl_set_palette(HMGL gr, const char *colors); +void mgl_set_alpha_default(HMGL graph, float alpha); +void mgl_set_bar_width(HMGL graph, float width); +void mgl_set_meshnum(HMGL graph, int num); +void mgl_set_ambbr(HMGL gr, float i); + +void mgl_set_cut(HMGL graph, int cut); +void mgl_set_cut_box(HMGL gr, float x1,float y1,float z1,float x2,float y2,float z2); +void mgl_set_ranges(HMGL graph, float x1, float x2, float y1, float y2, float z1, float z2); +void mgl_set_range_val(HMGL gr, char dir, float v1,float v2); +void mgl_set_range_dat(HMGL gr, char dir, HCDT a, int add); + +void mgl_set_origin(HMGL graph, float x0, float y0, float z0); +void mgl_set_func(HMGL graph, const char *EqX,const char *EqY,const char *EqZ,const char *EqA); +void mgl_set_coor(HMGL gr, int how); +void mgl_set_ternary(HMGL gr, int enable); +void mgl_set_cutoff(HMGL graph, const char *EqC); + +void mgl_set_tick_rotate(HMGL graph, int enable); +void mgl_set_tick_skip(HMGL graph, int enable); + +float mgl_data_get_value(HCDT d, long i, long j, long k); +long mgl_data_get_nx(HCDT d); +long mgl_data_get_ny(HCDT d); +long mgl_data_get_nz(HCDT d); + +void mgl_set_mark_size(HMGL graph, float size); +void mgl_set_arrow_size(HMGL graph, float size); +void mgl_set_font_size(HMGL graph, float size); +void mgl_set_font_def(HMGL graph, const char *fnt); +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); +/*****************************************************************************/ +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); +void mgl_start_group_(uintptr_t *gr, const char *,int); +void mgl_end_group_(uintptr_t *gr); + +void mgl_set_palette_(uintptr_t *gr, const char *colors, int); +void mgl_set_pal_color_(uintptr_t *graph, int *n, float *r, float *g, float *b); +void mgl_set_pal_num_(uintptr_t *graph, int *num); +void mgl_set_alpha_default_(uintptr_t *graph, float *alpha); +void mgl_set_bar_width_(uintptr_t *graph, float *width); +void mgl_set_meshnum_(uintptr_t *graph, int *num); +void mgl_set_ambbr_(uintptr_t *gr, float *i); + +void mgl_set_cut_(uintptr_t *graph, int *cut); +void mgl_set_cut_box_(uintptr_t *gr, float *x1,float *y1,float *z1,float *x2,float *y2,float *z2); +void mgl_set_ranges_(uintptr_t *graph, float *x1, float *x2, float *y1, float *y2, float *z1, float *z2); +void mgl_set_range_val_(uintptr_t *gr, const char *dir, float *v1,float *v2,int); +void mgl_set_range_dat_(uintptr_t *gr, const char *dir, uintptr_t *a, int *add,int); + +void mgl_set_origin_(uintptr_t *gr, float *x0, float *y0, float *z0); +void mgl_set_func_(uintptr_t *graph, const char *EqX, const char *EqY, const char *EqZ, const char *EqA, int, int, int, int); +void mgl_set_coor_(uintptr_t *gr, int *how); +void mgl_set_ternary_(uintptr_t *graph, int *enable); +void mgl_set_cutoff_(uintptr_t *graph, const char *EqC, int); + +void mgl_set_tick_rotate_(uintptr_t *graph, int *enable); +void mgl_set_tick_skip_(uintptr_t *graph, int *enable); + +float mgl_data_get_value_(uintptr_t *d, int *i, int *j, int *k); +long mgl_data_get_nx_(uintptr_t *d); +long mgl_data_get_ny_(uintptr_t *d); +long mgl_data_get_nz_(uintptr_t *d); + +void mgl_set_mark_size_(uintptr_t *graph, float *size); +void mgl_set_arrow_size_(uintptr_t *graph, float *size); +void mgl_set_font_size_(uintptr_t *graph, float *size); +void mgl_set_font_def_(uintptr_t *graph, const char *fnt, int); +void mgl_set_rotated_text_(uintptr_t *graph, int *enable); +void mgl_load_font_(uintptr_t *gr, char *name, char *path, int l, int n); +void mgl_copy_font_(uintptr_t *gr, uintptr_t *gr_from); +void mgl_restore_font_(uintptr_t *gr); +/*****************************************************************************/ +#ifdef __cplusplus +} +#endif +/*****************************************************************************/ +#endif diff --git a/include/mgl/canvas.h b/include/mgl/canvas.h new file mode 100644 index 0000000..c6e83f3 --- /dev/null +++ b/include/mgl/canvas.h @@ -0,0 +1,480 @@ +/*************************************************************************** + * canvas.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef MGL_CANVAS_H +#define MGL_CANVAS_H +#include "mgl/base.h" +//----------------------------------------------------------------------------- +#ifndef MGL_STACK_ENTRY +#define MGL_STACK_ENTRY 10 +#endif +//----------------------------------------------------------------------------- +#ifdef HAVE_GIF +#include +#else +struct GifFileType; +#endif +//----------------------------------------------------------------------------- +/// Structure for simplest primitives +struct mglPrim +{ + // NOTE: n4 is used as mark; n3 -- as pen style for type=0,1,4 + // NOTE: n3 is used as position of txt,font in Ptxt for type=6 + long n1,n2,n3,n4; ///< coordinates of corners + int type; ///< primitive type (0-point, 1-line, 2-trig, 3-quad, 4-glyph, 5-arrow, 6-text) + int id; ///< object id + float z; ///< z-position + float s; ///< size (if applicable) or fscl + float w; ///< width (if applicable) or ftet + float p; + + mglPrim(int t=0) { n1=n2=n3=n4=id=0; z=s=w=p=0; type = t; } +}; +bool operator<(const mglPrim &a,const mglPrim &b); +bool operator>(const mglPrim &a,const mglPrim &b); +//----------------------------------------------------------------------------- +/// Structure for transformation matrix +struct mglMatrix +{ + float b[9]; + float x,y,z,pf; + mglMatrix() { clear(); } + inline void clear() { x=y=z=pf=0; memset(b,0,9*sizeof(float)); } +}; +//----------------------------------------------------------------------------- +/// Structure for group of primitives +struct mglGroup +{ + std::vector p;///< list of primitives (not filled!!!) + int Id; ///< Current list of primitives + std::string Lbl; ///< Group label + mglGroup(const char *lbl="", int id=0) { Lbl=lbl; Id=id; } +}; +//----------------------------------------------------------------------------- +/// Structure for text label +struct mglText +{ + std::wstring text; + std::string stl; + float val; + mglText(const wchar_t *txt=0, const char *fnt=0, float v=0) { text=txt; stl=fnt; val=v; } + mglText(const std::wstring &txt, float v=0) { text=txt; val=v; } +}; +//----------------------------------------------------------------------------- +/// Structure for drawing axis and ticks +struct mglAxis +{ + mglAxis() { dv=ds=d=v0=v1=v2=o=0; ns=f=ch=*t=0; } + mglAxis(const mglAxis &aa) + { dv=aa.dv; ds=aa.ds; d=aa.d; dir=aa.dir; + v0=aa.v0; v1=aa.v1; v2=aa.v2; o=aa.o; + a = aa.a; b = aa.b; org=aa.org; txt=aa.txt; + ns=aa.ns; f=aa.f; ch=aa.ch; wcscpy(t,aa.t); } + inline void AddLabel(const wchar_t *lbl, float v) + { txt.push_back(mglText(lbl,"",v)); } + inline void AddLabel(const std::wstring &lbl, float v) + { txt.push_back(mglText(lbl,v)); } + + float dv,ds; ///< Actual step for ticks and subticks. + float d; ///< Step for axis ticks (if positive) or its number (if negative). + int ns; ///< Number of axis subticks. + wchar_t t[256]; ///< Tick template (set NULL to use default one ("%.2g" in simplest case)) + mglPoint dir; ///< Axis direction + mglPoint a,b; ///< Directions of over axis + mglPoint org; + float v0,v1,v2; ///< Center of axis cross section and its range. + float o; ///< Point of starting ticks numbering (if NAN then Org is used). + int f; ///< Flag 0x1 - time, 0x2 - manual, 0x4 - fixed dv + std::vector txt; ///< Axis labels + char ch; ///< Character of axis (like 'x','y','z','c') +}; +//----------------------------------------------------------------------------- +/// Structure for light source +struct mglLight +{ + mglLight() { n=i=false; a=b=0; } + bool n; ///< Availability of light sources + bool i; ///< Infinity/local position of light sources + mglPoint r; ///< Position of light sources + mglPoint p; ///< Actual position of light sources (filled by LightScale() function) + float a; ///< Aperture of light sources + float b; ///< Brightness of light sources + mglColor c; ///< Color of light sources +}; +//----------------------------------------------------------------------------- +/// Structure for light source +class mglCanvas; +struct mglDrawReg +{ + int x1,x2,y1,y2; + void set(mglCanvas *gr, int nx, int ny, int m); +}; +//----------------------------------------------------------------------------- +/// Class contains all functionality for creating different mathematical plots +class mglCanvas : public mglBase +{ +friend struct mglPrim; +public: + mglPoint LastMousePos; ///< Last mouse position + std::string PlotId; ///< Id of plot for saving filename (in GLUT window for example) + + mglCanvas(int w=800, int h=600); + virtual ~mglCanvas(); + + /// Set default parameter for plotting + void DefaultPlotParam(); + /// Set angle of view indepently from mglCanvas::Rotate(). + virtual void View(float tetx,float tetz,float tety=0); + /// Clear transformation matrix. + inline void Identity(bool rel=false) { InPlot(0,1,0,1,rel); } + /// Push transformation matrix into stack + inline void Push() { stack.push_back(B); } + /// Set PlotFactor + inline void SetPlotFactor(float val) + { if(val<=0) {B.pf=1.55; set(MGL_AUTO_FACTOR);} else {B.pf=val; clr(MGL_AUTO_FACTOR);} } + /// Pop transformation matrix from stack + inline void Pop() { B = stack.back(); stack.pop_back(); } + /// Clear up the frame + virtual void Clf(mglColor back=WC); + + /// Put further plotting in some region of whole frame surface. + void SubPlot(int nx, int ny, int m, float dx=0, float dy=0); + void SubPlot(int nx, int ny, int m, const char *style); + /// Like SubPlot bot "join" several cells + void MultiPlot(int nx,int ny,int m, int dx, int dy, const char *style); + /// Put further plotting in column cell of previous subplot + void ColumnPlot(int num, int i, float d=0); + /// Put further plotting in cell of stick rotated on angles tet, phi + void StickPlot(int num, int i, float tet, float phi); + /// Put further plotting in some region of whole frame surface. + void InPlot(float x1,float x2,float y1,float y2,bool rel=true); + /// Add title for current subplot/inplot + void Title(const char *title,const char *stl="#",float size=-2); + void Title(const wchar_t *title,const char *stl="#",float size=-2); + /// Set aspect ratio for further plotting. + void Aspect(float Ax,float Ay,float Az); + /// Rotate a further plotting. + void Rotate(float TetX,float TetZ,float TetY=0); + /// Rotate a further plotting around vector {x,y,z}. + void RotateN(float Tet,float x,float y,float z); + /// Set perspective (in range [0,1)) for plot. Set to zero for switching off. + void Perspective(float a); + + /// Set size of frame in pixels. Normally this function is called internaly. + virtual void SetSize(int w,int h); + /// Get ratio (float width)/(float height). + float GetRatio(); + /// Get RGB bitmap of current state image. + const unsigned char *GetBits(); + /// Get RGBA bitmap of current state image. + const unsigned char *GetRGBA(); + /// Get width of the image + int GetWidth() { return Width; }; + /// Get height of the image + int GetHeight() { return Height; }; + /// Combine plots from 2 canvases. Result will be saved into this. + void Combine(const mglCanvas *gr); + /// Send graphical information to node id using MPI + void MPI_Send(int /*id*/) {} // TODO: add later + /// Receive graphical information from node id using MPI + void MPI_Recv(int /*id*/) {} // TODO: add later + + /// Calculate 3D coordinate {x,y,z} for screen point {xs,ys} + mglPoint CalcXYZ(int xs, int ys); + /// Calculate screen point {xs,ys} for 3D coordinate {x,y,z} + void CalcScr(mglPoint p, int *xs, int *ys); + mglPoint CalcScr(mglPoint p); + /// Set object/subplot id + inline void SetObjId(long id) { ObjId = id; } + /// Get object id + inline int GetObjId(long x,long y) { return OI[x+Width*y]; } + /// Get subplot id + int GetSplId(long x,long y); + + /// Write the frame in file using JPEG format + void WriteJPEG(const char *fname,const char *descr=0); + /// Write the frame in file using BMP format + void WriteBMP(const char *fname,const char *descr=0); + /// Write the frame in file using PNG format with transparency + void WritePNG(const char *fname,const char *descr=0); + /// Write the frame in file using PNG format no transparency + void WritePNGs(const char *fname,const char *descr=0); + /// Write the frame in file using PostScript format as bitmap + void WriteBPS(const char *fname,const char *descr=0); + /// Write the frame in file using PostScript format + void WriteEPS(const char *fname,const char *descr=0); + /// Write the frame in file using SVG format + void WriteSVG(const char *fname,const char *descr=0); + /// Write the frame in file using IDTF format + void WriteIDTF(const char *fname,const char *descr=0); + /// Write the frame in file using GIF format (only for current frame!) + void WriteGIF(const char *fname,const char *descr=0); + /// Write the frame in file (depending extension, write current frame if fname is empty) + void WriteFrame(const char *fname=0, const char *descr=0); + /// Show currently produced image by Qt or FLTK library + void ShowImage(const char *viewer=0, bool keep=false); + + /// Write the frame in file using TeX (pgf/tikz) format + void WriteTeX(const char *fname,const char *descr=0); + /// Write the frame in file using WebGL (javascript) format + void WriteWGL(const char *fname,const char *descr=0); + /// Write the frame in file using OBJ/MTL format + void WriteOBJ(const char *fname,const char *descr=0); + /// Write the frame in file using TGA format + void WriteTGA(const char *fname,const char *descr=0); + + + /// Create new frame. + virtual int NewFrame(); + /// Finish frame drawing + virtual void EndFrame(); + /// Get the number of created frames + inline int GetNumFrame() { return CurFrameId; } + /// Reset frames counter (start it from zero) + inline void ResetFrames() { CurFrameId=0; } + /// Start write frames to cinema using GIF format + void StartGIF(const char *fname, int ms=100); + /// Stop writing cinema using GIF format + void CloseGIF(); + /// Finish plotting. Normally this function is called internaly. + virtual void Finish(); + + /// Set the transparency on/off. + virtual bool Alpha(bool enable); + /// Set the transparency type + inline void SetTranspType(int val) + { Flag=(Flag&(~3)) + (val&3); SetAxisStl(val==2?"w-":"k-"); } + /// Set the fog distance or switch it off (if d=0). + virtual void Fog(float d, float dz=0.25); + /// Set the using of light on/off. + virtual bool Light(bool enable); + /// Switch on/off the specified light source. + virtual void Light(int n, bool enable); + /// Add a light source. + virtual void AddLight(int n,mglPoint p, char c='w', float bright=0.5, bool infty=true, float ap=0); + + /// Set ticks position and text (\n separated). Use n=0 to disable this feature. + void SetTicksVal(char dir, const char *lbl, bool add=false); + void SetTicksVal(char dir, HCDT v, const char *lbl, bool add=false); + void SetTicksVal(char dir, HCDT v, const char **lbl, bool add=false); + void SetTicksVal(char dir, const wchar_t *lbl, bool add=false); + void SetTicksVal(char dir, HCDT v, const wchar_t *lbl, bool add=false); + void SetTicksVal(char dir, HCDT v, const wchar_t **lbl, bool add=false); + /// Set templates for ticks + void SetTickTempl(char dir, const wchar_t *t); + void SetTickTempl(char dir, const char *t); + /// Set time templates for ticks + void SetTickTime(char dir, float d, const char *t=""); + /// Set the ticks parameters + void SetTicks(char dir, float d=0, int ns=0, float org=NAN); + /// Auto adjust ticks + void AdjustTicks(const char *dir="xyzc", bool force=false); + /// Tune ticks + inline void SetTuneTicks(int tune, float pos=1.15) + { TuneTicks = tune; FactorPos = pos; }; + /// Set ticks styles + void SetAxisStl(const char *stl="k", const char *tck=0, const char *sub=0); + /// Set ticks length + void SetTickLen(float tlen, float stt=1.); + + /// Draws bounding box outside the plotting volume with color \a c. + void Box(const char *col=0, bool ticks=true); + /// Draw axises with ticks in directions determined by string parameter \a dir. + void Axis(const char *dir="xyzt", bool adjust=false); + /// Draw grid lines perpendicular to direction determined by string parameter \a dir. + void Grid(const char *dir="xyzt",const char *pen="B-"); + /// Print the label \a text for axis \a dir. + void Label(char dir, const char *text, float pos=0, float shift=0); + void Labelw(char dir, const wchar_t *text, float pos=0, float shift=0); + + /// Print the \a text at arbitrary position of the picture \a x, \a y in range [0,1]x[0,1]. + void Label(float x, float y, const char *text, const char *fnt=0, bool rel=false); + void Labelw(float x, float y, const wchar_t *text, const char *fnt=0, bool rel=false); +// /// Print the title text for the picture +// void Title(const wchar_t *text,const char *font=0); +// void Title(const char *text,const char *font=0); + + /// Draw colorbar at edge of axis + void Colorbar(const char *sch=0,int where=0); + void inline Colorbar(const char *sch, int where, float x, float y, float w, float h) + { Colorbar(where,x,y,w,h,AddTexture(sch)); }; + /// Draw colorbar at edge of axis for manual colors + void Colorbar(HCDT v, const char *sch=0,int where=0); + void Colorbar(HCDT v, const char *sch, int where, float x, float y, float w, float h); + + /// Add string to legend + void AddLegend(const char *text,const char *style); + void AddLegend(const wchar_t *text,const char *style); + /// Clear saved legend string + inline void ClearLegend() { Leg.clear(); } + /// Draw legend of accumulated strings at position (x, y) by \a font with \a size + inline void Legend(float x, float y, const char *font="#", float size=-0.8, float llen=0.1) + { Legend(Leg,x,y,font,size,llen); } + /// Draw legend of accumulated strings by \a font with \a size + inline void Legend(int where=0x3, const char *font="#", float size=-0.8, float llen=0.1) + { Legend(Leg,(where&1)?1:0,(where&2)?1:0,font,size,llen); } + /// Draw legend of accumulated strings by \a font with \a size + inline void Legend(const std::vector &leg, int where=3, const char *font="#", float size=-0.8, float llen=0) + { Legend(leg,(where&1)?1:0,(where&2)?1:0,font,size,llen); } + /// Draw legend strings \a text at position (x, y) by \a font with \a size + void Legend(const std::vector &leg, float x, float y, const char *font="#", float size=-0.8, float llen=0); + /// Number of marks in legend sample + inline void SetLegendMarks(int num=1) { LegendMarks = num>0?num:1; }; + + void StartAutoGroup (const char *); + void EndGroup(); + +protected: + float *Z; ///< Height for given level in Z-direction + unsigned char *C; ///< Picture for given level in Z-direction + int *OI; ///< ObjId arrays + unsigned char *G4; ///< Final picture in RGBA format. Prepared in Finish(). + unsigned char *G; ///< Final picture in RGB format. Prepared in Finish(). + + std::vector Sub; ///< InPlot regions {n1=x1,n2=x2,n3=y1,n4=y2,id} + std::vector Prm; ///< Primitives (lines, triangles and so on) + std::vector Ptx; ///< Text labels for mglPrim + std::vector Leg; ///< Text labels for legend + std::vector Grp; ///< List of groups with names +#ifdef HAVE_PTHREAD + pthread_mutex_t mutexSub, mutexPrm, mutexPtx, mutexLeg, mutexStk, mutexGrp; +#endif + + int LegendMarks; ///< Number of marks in the Legend + unsigned char BDef[4]; ///< Background color + mglAxis ax,ay,az,ac;///< Axis parameters + + int TuneTicks; ///< Draw tuned ticks with extracted common component + float FactorPos; ///< Position of axis ticks factor (0 at Min, 1 at Max, 1.1 is default) + float TickLen; ///< Length of tiks (subticks length is sqrt(1+st_t)=1.41... times smaller) + char AxisStl[32]; ///< Axis line style. Default is "k" + char TickStl[32]; ///< Tick line style. Default is "k" + char SubTStl[32]; ///< Subtick line style. Default is "k" + float st_t; ///< Subtick-to-tick ratio (ls=lt/sqrt(1+st_t)). Default is 1. + + int CurFrameId; ///< Number of automaticle created frames + float Persp; ///< Perspective factor (=0 is perspective off) + int Width; ///< Width of the image + int Height; ///< Height of the image + int Depth; ///< Depth of the image + mglMatrix B; ///< Transformation matrix + mglMatrix B1; ///< Transformation matrix for colorbar + float inW, inH; ///< Width and height of last InPlot + mglLight light[10]; ///< Light sources + float FogDist; ///< Inverse fog distance (fog ~ exp(-FogDist*Z)) + float FogDz; ///< Relative shift of fog + + /// Draw colorbar at edge of axis + void Colorbar(int where, float x, float y, float w, float h, long s=0); + /// Auto adjust ticks + void AdjustTicks(mglAxis &aa, bool ff); + /// Prepare labels for ticks + void LabelTicks(mglAxis &aa); + /// Draw axis + void DrawAxis(mglAxis &aa, bool text=true, char arr=0); + /// Draw axis grid lines + void DrawGrid(mglAxis &aa); + /// Update axis ranges + inline void UpdateAxis() + { ax.v0=Org.x; ay.v0=Org.y; az.v0=Org.z; ac.v0=Org.c; + ax.v1=Min.x; ay.v1=Min.y; az.v1=Min.z; ac.v1=Min.c; + ax.v2=Max.x; ay.v2=Max.y; az.v2=Max.z; ac.v2=Max.c; } + /// Scale coordinates and cut off some points + bool ScalePoint(mglPoint &p, mglPoint &n, bool use_nan=true); + void LightScale(); ///< Additionally scale positions of light sources + + float GetOrgX(char dir); ///< Get Org.x (parse NAN value) + float GetOrgY(char dir); ///< Get Org.y (parse NAN value) + float GetOrgZ(char dir); ///< Get Org.z (parse NAN value) + + void mark_plot(long p, char type, float size=1); // position in pntC + void arrow_plot(long p1, long p2, char st); // position in pntC + void line_plot(long p1, long p2); // position in pntC + void trig_plot(long p1, long p2, long p3); // position in pntN + void quad_plot(long p1, long p2, long p3, long p4); // position in pntN + void Glyph(float x, float y, float f, int style, long icode, float col); + float text_plot(long p,const wchar_t *text,const char *fnt,float size=-1,float sh=0,float col=-('k')); // position in pntN + + void add_prim(mglPrim &a); ///< add primitive to list + void mark_draw(long p, char type, float size, mglDrawReg *d); + void arrow_draw(long p1, long p2, char st, float size, mglDrawReg *d); + virtual void line_draw(long p1, long p2, mglDrawReg *d); + virtual void trig_draw(long p1, long p2, long p3, bool anorm, mglDrawReg *d); + virtual void quad_draw(long p1, long p2, long p3, long p4, mglDrawReg *d); + virtual void pnt_draw(long p, mglDrawReg *d); + void glyph_draw(const mglPrim *P, mglDrawReg *d); + virtual unsigned char **GetRGBLines(long &w, long &h, unsigned char *&f, bool alpha=false); + bool IsSame(const mglPrim &pr,float wp,mglColor cp,int st); + +private: + float _tetx,_tety,_tetz; // extra angles + std::vector stack; ///< stack for transformation matrixes + int dr_nx1, dr_nx2, dr_ny1, dr_ny2; // Allowed drawing region + GifFileType *gif; + float fscl,ftet; ///< last scale and rotation for glyphs + + /// Draw generic colorbar + void colorbar(HCDT v, const float *s, int where, float x, float y, float w, float h); + /// Draw labels for ticks + void DrawLabels(mglAxis &aa); + /// Draw tick + void tick_draw(mglPoint o, mglPoint d1, mglPoint d2, int f); + /// Plot point \a p with color \a c + void pnt_plot(long x,long y,float z,const unsigned char c[4]); + float FindOptOrg(char dir, int ind); + /// Transform float color and alpha to bits format + unsigned char* col2int(const mglPnt &p, unsigned char *r); + /// Combine colors in 2 plane. + void combine(unsigned char *c1,unsigned char *c2); + /// Fast drawing of line between 2 points + void fast_draw(long p1, long p2, mglDrawReg *d); + + /// Additionally scale points \a p for positioning in image + void PostScale(mglPoint &p); + /// Scale points \a p for projection to the face number \a nface in image + long ProjScale(int nface, long p); + inline void PostScale(mglPoint *p,long n) { for(long i=0;i * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef MGL_CANVAS_CF_H +#define MGL_CANVAS_CF_H +#include "mgl/base.h" +/*****************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif +/*****************************************************************************/ +HMGL mgl_create_graph(int width, int height); +void mgl_delete_graph(HMGL graph); +void mgl_set_size(HMGL gr, int width, int height); +void mgl_set_def_param(HMGL gr); +void mgl_set_quality(HMGL gr, int qual); +void mgl_combine_gr(HMGL gr, HMGL in); + +void mgl_set_tick_len(HMGL gr, float len, float stt); +void mgl_set_axis_stl(HMGL gr, const char *stl, const char *tck, const char *sub); +void mgl_adjust_ticks(HMGL gr, const char *dir); +void mgl_set_ticks(HMGL gr, char dir, float d, int ns, float org); +void mgl_set_ticks_str(HMGL gr, char dir, const char *lbl, int add); +void mgl_set_ticks_wcs(HMGL gr, char dir, const wchar_t *lbl, int add); +void mgl_set_ticks_val(HMGL gr, char dir, HCDT val, const char *lbl, int add); +void mgl_set_ticks_valw(HMGL gr, char dir, HCDT val, const wchar_t *lbl, int add); +void mgl_tune_ticks(HMGL gr, int tune, float fact_pos); +void mgl_set_tick_templ(HMGL gr, char dir, const char *templ); +void mgl_set_tick_templw(HMGL gr, char dir, const wchar_t *templ); +void mgl_set_tick_time(HMGL gr, char dir, float d, const char *t); + +void mgl_box(HMGL graph); +void mgl_box_str(HMGL gr, const char *col, int ticks); +void mgl_axis(HMGL gr, const char *dir, int adj); +void mgl_axis_grid(HMGL gr, const char *dir,const char *pen); +void mgl_label(HMGL gr, char dir, const char *text); +void mgl_label_ext(HMGL gr, char dir, const char *text, float pos, float shift); +void mgl_labelw_ext(HMGL gr, char dir, const wchar_t *text, float pos, float shift); +void mgl_label_xy(HMGL gr, float x, float y, const char *text, const char *fnt); +void mgl_labelw_xy(HMGL gr, float x, float y, const wchar_t *text, const char *fnt); + +void mgl_colorbar(HMGL gr, const char *sch,int where); +void mgl_colorbar_ext(HMGL gr, const char *sch, int where, float x, float y, float w, float h); +void mgl_colorbar_val(HMGL gr, HCDT dat, const char *sch,int where); +void mgl_colorbar_val_ext(HMGL gr, HCDT dat, const char *sch,int where,float x, float y, float w, float h); + +void mgl_add_legend(HMGL gr, const char *text,const char *style); +void mgl_add_legendw(HMGL gr, const wchar_t *text,const char *style); +void mgl_clear_legend(HMGL graph); +void mgl_legend_xy(HMGL gr, float x, float y, const char *font, float size, float llen); +void mgl_legend(HMGL gr, int where, const char *font, float size, float llen); +void mgl_set_legend_marks(HMGL gr, int num); + + +void mgl_show_image(HMGL gr, const char *viewer, int keep); +void mgl_write_frame(HMGL gr, const char *fname,const char *descr); +void mgl_write_tga(HMGL gr, const char *fname,const char *descr); +void mgl_write_bmp(HMGL gr, const char *fname,const char *descr); +void mgl_write_jpg(HMGL gr, const char *fname,const char *descr); +void mgl_write_png(HMGL gr, const char *fname,const char *descr); +void mgl_write_png_solid(HMGL gr, const char *fname,const char *descr); +void mgl_write_bps(HMGL gr, const char *fname,const char *descr); +void mgl_write_eps(HMGL gr, const char *fname,const char *descr); +void mgl_write_svg(HMGL gr, const char *fname,const char *descr); +void mgl_write_tex(HMGL gr, const char *fname,const char *descr); +void mgl_write_obj(HMGL gr, const char *fname,const char *descr); +void mgl_write_wgl(HMGL gr, const char *fname,const char *descr); +void mgl_write_idtf(HMGL gr, const char *fname,const char *descr); +void mgl_write_gif(HMGL gr, const char *fname,const char *descr); +void mgl_start_gif(HMGL gr, const char *fname,int ms); +void mgl_close_gif(HMGL graph); +void mgl_set_plotid(HMGL gr, const char *id); + +const unsigned char *mgl_get_rgb(HMGL graph); +const unsigned char *mgl_get_rgba(HMGL graph); +void mgl_set_obj_id(HMGL gr, int id); +int mgl_get_obj_id(HMGL gr, long x, long y); +int mgl_get_spl_id(HMGL gr, long x, long y); +int mgl_get_width(HMGL graph); +int mgl_get_height(HMGL graph); +void mgl_calc_xyz(HMGL gr, int xs, int ys, float *x, float *y, float *z); +void mgl_calc_scr(HMGL gr, float x, float y, float z, int *xs, int *ys); + +int mgl_new_frame(HMGL graph); +void mgl_end_frame(HMGL graph); +int mgl_get_num_frame(HMGL graph); +void mgl_reset_frames(HMGL graph); + +void mgl_set_transp_type(HMGL gr, int type); +void mgl_set_alpha(HMGL gr, int enable); +void mgl_set_fog(HMGL gr, float d, float dz); +void mgl_set_light(HMGL gr, int enable); +void mgl_set_light_n(HMGL gr, int n, int enable); + +void mgl_mat_pop(HMGL gr); +void mgl_mat_push(HMGL gr); +void mgl_clf(HMGL graph); +void mgl_clf_rgb(HMGL gr, float r, float g, float b); + +void mgl_subplot(HMGL gr, int nx,int ny,int m); +void mgl_subplot_d(HMGL gr, int nx,int ny,int m, float dx, float dy); +void mgl_subplot_s(HMGL gr, int nx,int ny,int m,const char *style); +void mgl_multiplot(HMGL gr, int nx,int ny,int m,int dx,int dy,const char *style); +void mgl_inplot(HMGL gr, float x1,float x2,float y1,float y2); +void mgl_relplot(HMGL gr, float x1,float x2,float y1,float y2); +void mgl_columnplot(HMGL gr, int num, int ind); +void mgl_columnplot_d(HMGL gr, int num, int ind, float d); +void mgl_stickplot(HMGL gr, int num, int ind, float tet, float phi); +void mgl_title(HMGL gr, const char *title, const char *stl, float size); +void mgl_titlew(HMGL gr, const wchar_t *title, const char *stl, float size); + +void mgl_aspect(HMGL gr, float Ax,float Ay,float Az); +void mgl_rotate(HMGL gr, float TetX,float TetZ,float TetY); +void mgl_view(HMGL gr, float TetX,float TetZ,float TetY); +void mgl_rotate_vector(HMGL gr, float Tet,float x,float y,float z); +void mgl_perspective(HMGL gr, float val); + +/*****************************************************************************/ +uintptr_t mgl_create_graph_(int *width, int *height); +void mgl_delete_graph_(uintptr_t *graph); +void mgl_set_size_(uintptr_t *graph, int *width, int *height); +void mgl_set_def_param_(uintptr_t *gr); +void mgl_set_quality_(uintptr_t *gr, int *qual); +void mgl_combine_gr_(uintptr_t *gr, uintptr_t *in); + +void mgl_set_tick_len_(uintptr_t *graph, float *len, float *stt); +void mgl_set_axis_stl_(uintptr_t *graph, const char *stl, const char *tck, const char *sub, int,int,int); + +void mgl_adjust_ticks_(uintptr_t *gr, const char *dir, int l); +void mgl_set_ticks_(uintptr_t *gr, char *dir, float *d, int *ns, float *org, int); +void mgl_set_ticks_str_(uintptr_t *gr, const char *dir, const char *lbl, int *add,int,int l); +void mgl_set_ticks_val_(uintptr_t *gr, const char *dir, uintptr_t *val, const char *lbl, int *add,int,int l); +void mgl_tune_ticks_(uintptr_t *gr, int *tune, float *fact_pos); +void mgl_set_tick_templ_(uintptr_t *gr, const char *dir, const char *templ,int,int l); +void mgl_set_tick_time_(uintptr_t *gr, const char *dir, float *d, const char *t,int,int l); +void mgl_box_(uintptr_t *gr); +void mgl_box_str_(uintptr_t *gr, const char *col, int *ticks, int l); +void mgl_axis_(uintptr_t *gr, const char *dir, int *adj,int l); +void mgl_axis_grid_(uintptr_t *gr, const char *dir,const char *pen,int l,int n); +void mgl_label_(uintptr_t *gr, const char *dir, const char *text,int,int l); +void mgl_label_ext_(uintptr_t *gr, const char *dir, const char *text, float *pos, float *shift,int,int l); +void mgl_label_xy_(uintptr_t *gr, float *x, float *y, const char *txt, const char *fnt,int l,int n); +/*****************************************************************************/ +void mgl_colorbar_(uintptr_t *gr, const char *sch,int *where,int l); +void mgl_colorbar_ext_(uintptr_t *gr, const char *sch,int *where, float *x, float *y, float *w, float *h, int l); +void mgl_colorbar_val_(uintptr_t *gr, uintptr_t *dat, const char *sch,int *where,int l); +void mgl_colorbar_val_ext_(uintptr_t *gr, uintptr_t *dat, const char *sch,int *where, float *x, float *y, float *w, float *h, int l); + +void mgl_add_legend_(uintptr_t *gr, const char *text,const char *style,int l,int n); +void mgl_clear_legend_(uintptr_t *gr); +void mgl_legend_xy_(uintptr_t *gr, float *x, float *y, const char *font, float *size, float *llen,int l); +void mgl_legend_(uintptr_t *gr, int *where, const char *font, float *size, float *llen,int l); +void mgl_set_legend_marks_(uintptr_t *gr, int *num); + + +void mgl_show_image_(uintptr_t *graph, const char *viewer, int *keep, int); +void mgl_write_frame_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); +void mgl_write_tga_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); +void mgl_write_bmp_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); +void mgl_write_jpg_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); +void mgl_write_png_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); +void mgl_write_png_solid_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); +void mgl_write_eps_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); +void mgl_write_svg_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); +void mgl_write_idtf_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); +void mgl_write_gif_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); +void mgl_start_gif_(uintptr_t *graph, const char *fname,int *ms,int l); +void mgl_close_gif_(uintptr_t *graph); +void mgl_write_tga_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); +void mgl_write_obj_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); +void mgl_write_tex_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); +void mgl_write_wgl_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); +void mgl_set_plotid_(uintptr_t *gr, const char *id,int l); + +const unsigned char *mgl_get_rgb_(uintptr_t *graph); +const unsigned char *mgl_get_rgba_(uintptr_t *graph); +void mgl_set_obj_id_(uintptr_t *graph, int *id); +int mgl_get_obj_id_(uintptr_t *graph, int *x, int *y); +int mgl_get_spl_id_(uintptr_t *graph, int *x, int *y); +int mgl_get_width_(uintptr_t *graph); +int mgl_get_height_(uintptr_t *graph); +void mgl_calc_xyz_(uintptr_t *gr, int *xs, int *ys, float *x, float *y, float *z); +void mgl_calc_scr_(uintptr_t *gr, float *x, float *y, float *z, int *xs, int *ys); + +int mgl_new_frame_(uintptr_t *graph); +void mgl_end_frame_(uintptr_t *graph); +int mgl_get_num_frame_(uintptr_t *graph); +void mgl_reset_frames_(uintptr_t *graph); + +void mgl_set_transp_type_(uintptr_t *graph, int *type); +void mgl_set_alpha_(uintptr_t *graph, int *enable); +void mgl_set_fog_(uintptr_t *graph, float *dist, float *dz); +void mgl_set_light_(uintptr_t *graph, int *enable); +void mgl_set_light_n_(uintptr_t *gr, int *n, int *enable); +void mgl_add_light_(uintptr_t *graph, int *n, float *x, float *y, float *z, char *c, int); +void mgl_add_light(HMGL gr, int n, float x, float y, float z, char c); +void mgl_add_light_ext_(uintptr_t *graph, int *n, float *x, float *y, float *z, char *c, float *br, int *inf, float *ap, int); +void mgl_add_light_ext(HMGL gr, int n, float x, float y, float z, char c, float br, int inf, float ap); + +void mgl_mat_push_(uintptr_t *gr); +void mgl_mat_pop_(uintptr_t *gr); +void mgl_clf_(uintptr_t *graph); +void mgl_clf_rgb_(uintptr_t *graph, float *r, float *g, float *b); + +void mgl_subplot_(uintptr_t *graph, int *nx,int *ny,int *m); +void mgl_subplot_d_(uintptr_t *graph, int *nx,int *ny,int *m,float *dx,float *dy); +void mgl_subplot_s_(uintptr_t *graph, int *nx,int *ny,int *m, const char *s,int); +void mgl_multiplot_(uintptr_t *graph, int *nx,int *ny,int *m,int *dx,int *dy, const char *s,int); +void mgl_inplot_(uintptr_t *graph, float *x1,float *x2,float *y1,float *y2); +void mgl_relplot_(uintptr_t *graph, float *x1,float *x2,float *y1,float *y2); +void mgl_columnplot_(uintptr_t *graph, int *num, int *i); +void mgl_columnplot_d_(uintptr_t *graph, int *num, int *i, float *d); +void mgl_stickplot_(uintptr_t *graph, int *num, int *i, float *tet, float *phi); + +void mgl_title_(uintptr_t *gr, const char *title, const char *stl, float *size, int,int); +void mgl_aspect_(uintptr_t *graph, float *Ax,float *Ay,float *Az); +void mgl_rotate_(uintptr_t *graph, float *TetX,float *TetZ,float *TetY); +void mgl_view_(uintptr_t *graph, float *TetX,float *TetZ,float *TetY); +void mgl_rotate_vector_(uintptr_t *graph, float *Tet,float *x,float *y,float *z); +void mgl_perspective_(uintptr_t *graph, float val); +/*****************************************************************************/ +int mgl_fortran_func(HMGL gr, void *); +HMGL mgl_create_graph_qt(int (*draw)(HMGL gr, void *p), const char *title, void *par); +HMGL mgl_create_graph_fltk(int (*draw)(HMGL gr, void *p), const char *title, void *par); +void mgl_fltk_run(); +void mgl_qt_run(); +/*****************************************************************************/ +uintptr_t mgl_create_graph_qt_(const char *title, int); +uintptr_t mgl_create_graph_fltk_(const char *title, int); +void mgl_fltk_run_(); +void mgl_qt_run_(); +/*****************************************************************************/ +void mgl_wnd_set_delay(HMGL gr, float dt); +void mgl_setup_window(HMGL gr, int autoclf, int showpos, int clf_upd); +void mgl_wnd_toggle_alpha(HMGL gr); +void mgl_wnd_toggle_light(HMGL gr); +//void mgl_wnd_toggle_zoom(HMGL gr); +void mgl_wnd_toggle_rotate(HMGL gr); +void mgl_wnd_toggle_no(HMGL gr); +void mgl_wnd_update(HMGL gr); +void mgl_wnd_reload(HMGL gr); +void mgl_wnd_adjust(HMGL gr); +void mgl_wnd_next_frame(HMGL gr); +void mgl_wnd_prev_frame(HMGL gr); +void mgl_wnd_animation(HMGL gr); +void mgl_get_last_mouse_pos(HMGL gr, float *x, float *y, float *z); +/*****************************************************************************/ +void mgl_get_last_mouse_pos_(uintptr_t *gr, float *x, float *y, float *z); +void mgl_wnd_set_delay_(uintptr_t *gr, float *dt); +void mgl_setup_window_(uintptr_t *gr, int *autoclf, int *showpos, int *clf_upd); +void mgl_wnd_toggle_alpha_(uintptr_t *gr); +void mgl_wnd_toggle_light_(uintptr_t *gr); +//void mgl_wnd_toggle_zoom_(uintptr_t *gr); +void mgl_wnd_toggle_rotate_(uintptr_t *gr); +void mgl_wnd_toggle_no_(uintptr_t *gr); +void mgl_wnd_update_(uintptr_t *gr); +void mgl_wnd_reload_(uintptr_t *gr); +void mgl_wnd_adjust_(uintptr_t *gr); +void mgl_wnd_next_frame_(uintptr_t *gr); +void mgl_wnd_prev_frame_(uintptr_t *gr); +void mgl_wnd_animation_(uintptr_t *gr); +/*****************************************************************************/ +void mgl_mpi_send(HMGL gr, int id); +void mgl_mpi_recv(HMGL gr, int id); +void mgl_mpi_send_(uintptr_t *gr, int *id); +void mgl_mpi_recv_(uintptr_t *gr, int *id); +/*****************************************************************************/ +HMPR mgl_create_parser(); +void mgl_delete_parser(HMPR p); +void mgl_add_param(HMPR p, int id, const char *str); +void mgl_add_paramw(HMPR p, int id, const wchar_t *str); +/*===!!! NOTE !!! You must not delete obtained data arrays !!!===============*/ +HMDT mgl_add_var(HMPR p, const char *name); +/*===!!! NOTE !!! You must not delete obtained data arrays !!!===============*/ +HMDT mgl_find_var(HMPR p, const char *name); +void mgl_del_var(HMPR p, const char *name); +int mgl_parse(HMGL gr, HMPR p, const char *str, int pos); +int mgl_parsew(HMGL gr, HMPR p, const wchar_t *str, int pos); +void mgl_parse_file(HMGL gr, HMPR p, FILE *fp, int print); +void mgl_parse_text(HMGL gr, HMPR p, const char *str, void (*error)(int line, int kind, char *mes)); +void mgl_parsew_text(HMGL gr, HMPR p, const wchar_t *str, void (*error)(int line, int kind, char *mes)); +void mgl_restore_once(HMPR p); +void mgl_parser_allow_setsize(HMPR p, int a); +void mgl_parser_stop(HMPR p); +/*****************************************************************************/ +uintptr_t mgl_create_parser_(); +void mgl_delete_parser_(uintptr_t* p); +void mgl_add_param_(uintptr_t* p, int *id, const char *str, int l); +/*===!!! NOTE !!! You must not delete obtained data arrays !!!===============*/ +uintptr_t mgl_add_var_(uintptr_t* p, const char *name, int l); +/*===!!! NOTE !!! You must not delete obtained data arrays !!!===============*/ +uintptr_t mgl_find_var_(uintptr_t* p, const char *name, int l); +void mgl_del_var_(uintptr_t* p, const char *name, int l); +int mgl_parse_(uintptr_t* gr, uintptr_t* p, const char *str, int *pos, int l); +void mgl_parse_text_(uintptr_t* gr, uintptr_t* p, const char *str, int l); +void mgl_restore_once_(uintptr_t* p); +void mgl_parser_allow_setsize_(uintptr_t* p, int *a); +void mgl_parser_stop_(uintptr_t* p); +/*****************************************************************************/ +#ifdef __cplusplus +} +#endif +/*****************************************************************************/ +#endif + diff --git a/include/mgl/cont.h b/include/mgl/cont.h new file mode 100644 index 0000000..d0b4138 --- /dev/null +++ b/include/mgl/cont.h @@ -0,0 +1,124 @@ +/*************************************************************************** + * cont.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef _MGL_CONT_H_ +#define _MGL_CONT_H_ +#include "mgl/base.h" +/*****************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif +/*****************************************************************************/ +void mgl_textw_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const wchar_t *text, const char *font, const char *opt); +void mgl_textw_xy(HMGL gr, HCDT x, HCDT y, const wchar_t *text, const char *font, const char *opt); +void mgl_textw_y(HMGL gr, HCDT y, const wchar_t *text, const char *font, const char *opt); +void mgl_text_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *text, const char *font, const char *opt); +void mgl_text_xy(HMGL gr, HCDT x, HCDT y, const char *text, const char *font, const char *opt); +void mgl_text_y(HMGL gr, HCDT y, const char *text, const char *font, const char *opt); + +void mgl_cont_gen(HMGL gr, float val, HCDT a, HCDT x, HCDT y, HCDT z, const char *stl); +void mgl_contf_gen(HMGL gr, float v1, float v2, HCDT a, HCDT x, HCDT y, HCDT z, const char *stl); + +void mgl_cont_xy_val(HMGL graph, HCDT v, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_cont_val(HMGL graph, HCDT v, HCDT z, const char *sch, const char *opt); +void mgl_cont_xy(HMGL graph, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_cont(HMGL graph, HCDT z, const char *sch, const char *opt); + +void mgl_contf_xy_val(HMGL graph, HCDT v, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_contf_val(HMGL graph, HCDT v, HCDT z, const char *sch, const char *opt); +void mgl_contf_xy(HMGL graph, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_contf(HMGL graph, HCDT z, const char *sch, const char *opt); + +void mgl_contd_xy_val(HMGL graph, HCDT v, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_contd_val(HMGL graph, HCDT v, HCDT z, const char *sch, const char *opt); +void mgl_contd_xy(HMGL graph, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_contd(HMGL graph, HCDT z, const char *sch, const char *opt); + +void mgl_axial_xy_val(HMGL graph, HCDT v, HCDT x, HCDT y, HCDT a, const char *sch, const char *opt); +void mgl_axial_val(HMGL graph, HCDT v, HCDT a, const char *sch, const char *opt); +void mgl_axial_xy(HMGL graph, HCDT x, HCDT y, HCDT a, const char *sch, const char *opt); +void mgl_axial(HMGL graph, HCDT a, const char *sch, const char *opt); + +void mgl_torus(HMGL graph, HCDT r, HCDT z, const char *col, const char *opt); + +void mgl_grid3_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT a, char dir, float sVal, const char *stl, const char *opt); +void mgl_grid3(HMGL graph, HCDT a, char dir, float sVal, const char *stl, const char *opt); + +void mgl_dens3_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT a, char dir, float sVal, const char *stl, const char *opt); +void mgl_dens3(HMGL graph, HCDT a, char dir, float sVal, const char *stl, const char *opt); + +void mgl_cont3_xyz_val(HMGL graph, HCDT v, HCDT x, HCDT y, HCDT z, HCDT a, char dir, float sVal, const char *sch, const char *opt); +void mgl_cont3_val(HMGL graph, HCDT v, HCDT a, char dir, float sVal, const char *sch, const char *opt); +void mgl_cont3_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT a, char dir, float sVal, const char *sch, const char *opt); +void mgl_cont3(HMGL graph, HCDT a, char dir, float sVal, const char *sch, const char *opt); + +void mgl_contf3_xyz_val(HMGL graph, HCDT v, HCDT x, HCDT y, HCDT z, HCDT a, char dir, float sVal, const char *sch, const char *opt); +void mgl_contf3_val(HMGL graph, HCDT v, HCDT a, char dir, float sVal, const char *sch, const char *opt); +void mgl_contf3_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT a, char dir, float sVal, const char *sch, const char *opt); +void mgl_contf3(HMGL graph, HCDT a, char dir, float sVal, const char *sch, const char *opt); + +/*****************************************************************************/ +void mgl_text_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z,const char *text,const char *font, const char *opt,int,int l,int n); +void mgl_text_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *text, const char *font, const char *opt,int, int l,int n); +void mgl_text_y_(uintptr_t *gr, uintptr_t *y, const char *text, const char *font, const char *opt,int, int l,int n); + +void mgl_cont_xy_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_cont_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_cont_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_cont_(uintptr_t *graph, uintptr_t *z, const char *sch, const char *opt,int,int); + +void mgl_contf_xy_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_contf_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_contf_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_contf_(uintptr_t *graph, uintptr_t *z, const char *sch, const char *opt,int,int); + +void mgl_contd_xy_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_contd_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_contd_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_contd_(uintptr_t *graph, uintptr_t *z, const char *sch, const char *opt,int,int); + +void mgl_axial_xy_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int,int); +void mgl_axial_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *sch, const char *opt,int,int); +void mgl_axial_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int,int); +void mgl_axial_(uintptr_t *graph, uintptr_t *a, const char *sch, const char *opt,int,int); + +void mgl_torus_(uintptr_t *graph, uintptr_t *r, uintptr_t *z, const char *pen, const char *opt,int,int); + +void mgl_grid3_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, float *sVal, const char *stl, const char *opt,int,int,int); +void mgl_grid3_(uintptr_t *graph, uintptr_t *a, const char *dir, float *sVal, const char *stl, const char *opt,int,int,int); + +void mgl_dens3_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, float *sVal, const char *stl, const char *opt,int,int,int); +void mgl_dens3_(uintptr_t *graph, uintptr_t *a, const char *dir, float *sVal, const char *stl, const char *opt,int,int,int); + +void mgl_cont3_xyz_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int,int); +void mgl_cont3_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int,int); +void mgl_cont3_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int,int); +void mgl_cont3_(uintptr_t *graph, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int,int); + +void mgl_contf3_xyz_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int,int); +void mgl_contf3_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int,int); +void mgl_contf3_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int,int); +void mgl_contf3_(uintptr_t *graph, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int,int); + +/*****************************************************************************/ +#ifdef __cplusplus +} +#endif +/*****************************************************************************/ +#endif diff --git a/include/mgl/data.h b/include/mgl/data.h new file mode 100644 index 0000000..0a64a71 --- /dev/null +++ b/include/mgl/data.h @@ -0,0 +1,720 @@ +/*************************************************************************** + * data.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef _MGL_DATA_H_ +#define _MGL_DATA_H_ +/*****************************************************************************/ +#include "mgl/base.h" +/*****************************************************************************/ +#ifndef NO_GSL +#include +#include +#else +struct gsl_vector; +struct gsl_matrix; +#endif +/*****************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif +/*****************************************************************************/ +void mgl_srnd(long seed); +double mgl_rnd(); +double mgl_ipow(double x,int n); +/*****************************************************************************/ +HMDT mgl_create_data(); +HMDT mgl_create_data_size(long nx, long ny, long nz); +HMDT mgl_create_data_file(const char *fname); +void mgl_delete_data(HMDT dat); +const char *mgl_data_info(HCDT dat); +/*****************************************************************************/ +uintptr_t mgl_create_data_(); +uintptr_t mgl_create_data_size_(int *nx, int *ny, int *nz); +uintptr_t mgl_create_data_file_(const char *fname, int len); +void mgl_delete_data_(uintptr_t *dat); +/*****************************************************************************/ +/* Data creation functions */ +/*****************************************************************************/ +void mgl_data_rearrange(HMDT dat, long mx,long my,long mz); +void mgl_data_link(HMDT dat, float *A,long mx,long my,long mz); +void mgl_data_set_float(HMDT dat, const float *A,long mx,long my,long mz); +void mgl_data_set_double(HMDT dat, const double *A,long mx,long my,long mz); +void mgl_data_set_float2(HMDT d, const float **A,long N1,long N2); +void mgl_data_set_double2(HMDT d, const double **A,long N1,long N2); +void mgl_data_set_float3(HMDT d, const float ***A,long N1,long N2,long N3); +void mgl_data_set_double3(HMDT d, const double ***A,long N1,long N2,long N3); +void mgl_data_set(HMDT dat, HCDT a); +void mgl_data_set_vector(HMDT dat, gsl_vector *v); +void mgl_data_set_matrix(HMDT dat, gsl_matrix *m); +void mgl_data_set_value(HMDT dat, float v, long i, long j, long k); +float mgl_data_get_value(HCDT dat, long i, long j, long k); +void mgl_data_set_values(HMDT dat, const char *val, long nx, long ny, long nz); + +int mgl_data_read_hdf(HMDT d,const char *fname,const char *data); +void mgl_data_save_hdf(HCDT d,const char *fname,const char *data,int rewrite); +int mgl_datas_hdf(const char *fname, char *buf, long size); +int mgl_data_read(HMDT dat, const char *fname); +int mgl_data_read_mat(HMDT dat, const char *fname, long dim); +int mgl_data_read_dim(HMDT dat, const char *fname,long mx,long my,long mz); +int mgl_data_read_range(HMDT d, const char *templ, double from, double to, double step, int as_slice); +int mgl_data_read_all(HMDT dat, const char *templ, int as_slice); +void mgl_data_save(HCDT dat, const char *fname,long ns); +void mgl_data_export(HCDT dat, const char *fname, const char *scheme,float v1,float v2,long ns); +void mgl_data_import(HMDT dat, const char *fname, const char *scheme,float v1,float v2); + +void mgl_data_create(HMDT dat, long nx,long ny,long nz); +void mgl_data_transpose(HMDT dat, const char *dim); +void mgl_data_norm(HMDT dat, float v1,float v2,long sym,long dim); +void mgl_data_norm_slice(HMDT dat, float v1,float v2,char dir,long keep_en,long sym); +HMDT mgl_data_subdata(HCDT dat, long xx,long yy,long zz); +HMDT mgl_data_subdata_ext(HCDT dat, HCDT xx, HCDT yy, HCDT zz); +HMDT mgl_data_column(HCDT dat, const char *eq); +void mgl_data_set_id(HMDT d, const char *id); +void mgl_data_fill(HMDT dat, float x1,float x2,char dir); +void mgl_data_fill_eq(HMGL gr, HMDT dat, const char *eq, HCDT vdat, HCDT wdat,const char *opt); +void mgl_data_put_val(HMDT dat, mreal val, long i, long j, long k); +void mgl_data_put_dat(HMDT dat, HCDT val, long i, long j, long k); +void mgl_data_modify(HMDT dat, const char *eq,long dim); +void mgl_data_modify_vw(HMDT dat, const char *eq,HCDT vdat,HCDT wdat); +void mgl_data_squeeze(HMDT dat, long rx,long ry,long rz,long smooth); +mreal mgl_data_max(HCDT dat); +mreal mgl_data_min(HCDT dat); +float *mgl_data_value(HMDT dat, long i,long j,long k); +const float *mgl_data_data(HCDT dat); + +float mgl_data_first(HCDT dat, const char *cond, long *i, long *j, long *k); +float mgl_data_last(HCDT dat, const char *cond, long *i, long *j, long *k); +long mgl_data_find(HCDT dat, const char *cond, char dir, long i, long j, long k); +int mgl_data_find_any(HCDT dat, const char *cond); +mreal mgl_data_max_int(HCDT dat, long *i, long *j, long *k); +mreal mgl_data_max_real(HCDT dat, mreal *x, mreal *y, mreal *z); +mreal mgl_data_min_int(HCDT dat, long *i, long *j, long *k); +mreal mgl_data_min_real(HCDT dat, mreal *x, mreal *y, mreal *z); +mreal mgl_data_momentum_val(HCDT d, char dir, mreal *m, mreal *w, mreal *s, mreal *k); + +HMDT mgl_data_combine(HCDT dat1, HCDT dat2); +void mgl_data_extend(HMDT dat, long n1, long n2); +void mgl_data_insert(HMDT dat, char dir, long at, long num); +void mgl_data_delete(HMDT dat, char dir, long at, long num); +/*****************************************************************************/ +/* Data manipulation functions */ +/*****************************************************************************/ +void mgl_data_smooth(HMDT d, const char *dirs, float delta); +HMDT mgl_data_sum(HCDT dat, const char *dir); +HMDT mgl_data_max_dir(HCDT dat, const char *dir); +HMDT mgl_data_min_dir(HCDT dat, const char *dir); +void mgl_data_cumsum(HMDT dat, const char *dir); +void mgl_data_integral(HMDT dat, const char *dir); +void mgl_data_diff(HMDT dat, const char *dir); +void mgl_data_diff_par(HMDT dat, HCDT v1, HCDT v2, HCDT v3); +void mgl_data_diff2(HMDT dat, const char *dir); +void mgl_data_swap(HMDT dat, const char *dir); +void mgl_data_roll(HMDT dat, char dir, long num); +void mgl_data_mirror(HMDT dat, const char *dir); + +void mgl_data_hankel(HMDT dat, const char *dir); +void mgl_data_sinfft(HMDT dat, const char *dir); +void mgl_data_cosfft(HMDT dat, const char *dir); +void mgl_data_fill_sample(HMDT dat, long num, const char *how); + +float mgl_data_spline(HCDT dat, float x,float y,float z); +float mgl_data_linear(HCDT dat, float x,float y,float z); +HMDT mgl_data_trace(HCDT d); +HMDT mgl_data_resize(HCDT dat, long mx,long my,long mz); +HMDT mgl_data_resize_box(HCDT dat, long mx,long my,long mz,float x1,float x2,float y1,float y2,float z1,float z2); +HMDT mgl_data_hist(HCDT dat, long n, float v1, float v2, long nsub); +HMDT mgl_data_hist_w(HCDT dat, HCDT weight, long n, float v1, float v2, long nsub); +HMDT mgl_data_momentum(HCDT dat, char dir, const char *how); +HMDT mgl_data_evaluate(HCDT dat, HCDT idat, HCDT jdat, HCDT kdat, int norm); +void mgl_data_envelop(HMDT dat, char dir); +void mgl_data_sew(HMDT dat, const char *dirs, float da); +void mgl_data_crop(HMDT dat, long n1, long n2, char dir); +/*****************************************************************************/ +/* Data operations */ +/*****************************************************************************/ +void mgl_data_mul_dat(HMDT dat, HCDT d); +void mgl_data_div_dat(HMDT dat, HCDT d); +void mgl_data_add_dat(HMDT dat, HCDT d); +void mgl_data_sub_dat(HMDT dat, HCDT d); +void mgl_data_mul_num(HMDT dat, float d); +void mgl_data_div_num(HMDT dat, float d); +void mgl_data_add_num(HMDT dat, float d); +void mgl_data_sub_num(HMDT dat, float d); +/*****************************************************************************/ +HMDT mgl_pde_solve(HMGL gr, const char *ham, HCDT ini_re, HCDT ini_im, float dz, float k0,const char *opt); +HMDT mgl_qo2d_solve(const char *ham, HCDT ini_re, HCDT ini_im, HCDT ray, float r, float k0, HMDT xx, HMDT yy); +HMDT mgl_ray_trace(const char *ham, float x0, float y0, float z0, float px, float py, float pz, float dt, float tmax); +HMDT mgl_jacobian_2d(HCDT x, HCDT y); +HMDT mgl_jacobian_3d(HCDT x, HCDT y, HCDT z); +HMDT mgl_transform_a(HCDT am, HCDT ph, const char *tr); +HMDT mgl_transform(HCDT re, HCDT im, const char *tr); +void mgl_data_fourier(HMDT re, HMDT im, const char *dir); +HMDT mgl_data_stfa(HCDT re, HCDT im, long dn, char dir); + +HMDT mgl_triangulation_3d(HCDT x, HCDT y, HCDT z, float er); +HMDT mgl_triangulation_2d(HCDT x, HCDT y, float er); +/*****************************************************************************/ +/* Data creation functions */ +/*****************************************************************************/ +void mgl_data_rearrange_(uintptr_t *dat, int *mx, int *my, int *mz); +void mgl_data_set_float_(uintptr_t *dat, const float *A,int *NX,int *NY,int *NZ); +void mgl_data_set_double_(uintptr_t *dat, const double *A,int *NX,int *NY,int *NZ); +void mgl_data_set_float1_(uintptr_t *d, const float *A,int *N1); +void mgl_data_set_double1_(uintptr_t *d, const double *A,int *N1); +void mgl_data_set_float2_(uintptr_t *d, const float *A,int *N1,int *N2); +void mgl_data_set_double2_(uintptr_t *d, const double *A,int *N1,int *N2); +void mgl_data_set_float3_(uintptr_t *d, const float *A,int *N1,int *N2,int *N3); +void mgl_data_set_double3_(uintptr_t *d, const double *A,int *N1,int *N2,int *N3); +void mgl_data_set_(uintptr_t *dat, uintptr_t *a); + +void mgl_data_set_value_(uintptr_t *d, float *v, int *i, int *j, int *k); +void mgl_data_set_values_(uintptr_t *d, const char *val, int *nx, int *ny, int *nz, int l); +float mgl_data_get_value_(uintptr_t *d, int *i, int *j, int *k); +int mgl_data_read_(uintptr_t *d, const char *fname,int l); +int mgl_data_read_mat_(uintptr_t *dat, const char *fname, int *dim, int); +int mgl_data_read_dim_(uintptr_t *dat, const char *fname,int *mx,int *my,int *mz,int); +void mgl_data_save_(uintptr_t *dat, const char *fname,int *ns,int); +void mgl_data_export_(uintptr_t *dat, const char *fname, const char *scheme,float *v1,float *v2,int *ns,int,int); +void mgl_data_import_(uintptr_t *dat, const char *fname, const char *scheme,float *v1,float *v2,int,int); +void mgl_data_create_(uintptr_t *dat, int *nx,int *ny,int *nz); +void mgl_data_transpose_(uintptr_t *dat, const char *dim,int); +void mgl_data_norm_(uintptr_t *dat, float *v1,float *v2,int *sym,int *dim); +void mgl_data_norm_slice_(uintptr_t *dat, float *v1,float *v2,char *dir,int *keep_en,int *sym,int l); +uintptr_t mgl_data_subdata_(uintptr_t *dat, int *xx,int *yy,int *zz); +uintptr_t mgl_data_subdata_ext_(uintptr_t *dat, uintptr_t *xx,uintptr_t *yy,uintptr_t *zz); +uintptr_t mgl_data_column_(uintptr_t *dat, const char *eq,int l); +void mgl_data_set_id_(uintptr_t *dat, const char *id,int l); +void mgl_data_fill_(uintptr_t *dat, float *x1,float *x2,const char *dir,int); +void mgl_data_fill_eq_(uintptr_t *gr, uintptr_t *dat, const char *eq, uintptr_t *vdat, uintptr_t *wdat,const char *opt, int, int); +void mgl_data_put_val_(uintptr_t *dat, float *val, int *i, int *j, int *k); +void mgl_data_put_dat_(uintptr_t *dat, uintptr_t *val, int *i, int *j, int *k); +void mgl_data_modify_(uintptr_t *dat, const char *eq,int *dim,int); +void mgl_data_modify_vw_(uintptr_t *dat, const char *eq, uintptr_t *vdat, uintptr_t *wdat,int); +void mgl_data_squeeze_(uintptr_t *dat, int *rx,int *ry,int *rz,int *smooth); +float mgl_data_max_(uintptr_t *dat); +float mgl_data_min_(uintptr_t *dat); +const float *mgl_data_data_(uintptr_t *dat); + +float mgl_data_first_(uintptr_t *dat, const char *cond, int *i, int *j, int *k, int); +float mgl_data_last_(uintptr_t *dat, const char *cond, int *i, int *j, int *k, int); +int mgl_data_find_(uintptr_t *dat, const char *cond, char *dir, int *i, int *j, int *k, int,int); +int mgl_data_find_any_(uintptr_t *dat, const char *cond, int); +float mgl_data_max_int_(uintptr_t *dat, int *i, int *j, int *k); +float mgl_data_max_real_(uintptr_t *dat, float *x, float *y, float *z); +float mgl_data_min_int_(uintptr_t *dat, int *i, int *j, int *k); +float mgl_data_min_real_(uintptr_t *dat, float *x, float *y, float *z); +float mgl_data_momentum_val_(uintptr_t *dat, char *dir, float *m, float *w, float *s, float *k,int); + +uintptr_t mgl_data_combine_(uintptr_t *dat1, uintptr_t *dat2); +void mgl_data_extend_(uintptr_t *dat, int *n1, int *n2); +void mgl_data_insert_(uintptr_t *dat, const char *dir, int *at, int *num, int); +void mgl_data_delete_(uintptr_t *dat, const char *dir, int *at, int *num, int); +/*****************************************************************************/ +/* Data manipulation functions */ +/*****************************************************************************/ +void mgl_data_smooth_(uintptr_t *dat, const char *dirs, float *delta,int); +uintptr_t mgl_data_sum_(uintptr_t *dat, const char *dir,int); +uintptr_t mgl_data_max_dir_(uintptr_t *dat, const char *dir,int); +uintptr_t mgl_data_min_dir_(uintptr_t *dat, const char *dir,int); +void mgl_data_cumsum_(uintptr_t *dat, const char *dir,int); +void mgl_data_integral_(uintptr_t *dat, const char *dir,int); +void mgl_data_diff_(uintptr_t *dat, const char *dir,int); +void mgl_data_diff_par_(uintptr_t *dat, uintptr_t *v1, uintptr_t *v2, uintptr_t *v3); +void mgl_data_diff2_(uintptr_t *dat, const char *dir,int); +void mgl_data_swap_(uintptr_t *dat, const char *dir,int); +void mgl_data_roll_(uintptr_t *dat, const char *dir, int *num, int); +void mgl_data_mirror_(uintptr_t *dat, const char *dir,int); + +void mgl_data_hankel_(uintptr_t *dat, const char *dir,int); +void mgl_data_sinfft_(uintptr_t *dat, const char *dir,int); +void mgl_data_cosfft_(uintptr_t *dat, const char *dir,int); +void mgl_data_fill_sample_(uintptr_t *dat, int *num, const char *how,int); + +float mgl_data_spline_(uintptr_t *dat, float *x,float *y,float *z); +float mgl_data_linear_(uintptr_t *dat, float *x,float *y,float *z); +uintptr_t mgl_data_trace_(uintptr_t *d); +uintptr_t mgl_data_resize_(uintptr_t *dat, int *mx,int *my,int *mz); +uintptr_t mgl_data_resize_box_(uintptr_t *dat, int *mx,int *my,int *mz,float *x1,float *x2,float *y1,float *y2,float *z1,float *z2); +uintptr_t mgl_data_momentum_(uintptr_t *dat, char *dir, const char *how, int,int); +uintptr_t mgl_data_hist_(uintptr_t *dat, int *n, float *v1, float *v2, int *nsub); +uintptr_t mgl_data_hist_w_(uintptr_t *dat, uintptr_t *weight, int *n, float *v1, float *v2, int *nsub); +uintptr_t mgl_data_evaluate_(uintptr_t *dat, uintptr_t *idat, uintptr_t *jdat, uintptr_t *kdat, int *norm); +void mgl_data_envelop_(uintptr_t *dat, const char *dir, int); +void mgl_data_sew_(uintptr_t *dat, const char *dirs, float *da, int); +void mgl_data_crop_(uintptr_t *dat, int *n1, int *n2, const char *dir,int); +/*****************************************************************************/ +/* Data operations */ +/*****************************************************************************/ +void mgl_data_mul_dat_(uintptr_t *dat, uintptr_t *d); +void mgl_data_div_dat_(uintptr_t *dat, uintptr_t *d); +void mgl_data_add_dat_(uintptr_t *dat, uintptr_t *d); +void mgl_data_sub_dat_(uintptr_t *dat, uintptr_t *d); +void mgl_data_mul_num_(uintptr_t *dat, float *d); +void mgl_data_div_num_(uintptr_t *dat, float *d); +void mgl_data_add_num_(uintptr_t *dat, float *d); +void mgl_data_sub_num_(uintptr_t *dat, float *d); +/*****************************************************************************/ +/* Nonlinear fitting */ +/*****************************************************************************/ +uintptr_t mgl_pde_solve_(uintptr_t* gr, const char *ham, uintptr_t* ini_re, uintptr_t* ini_im, float *dz, float *k0,const char *opt,int,int); +uintptr_t mgl_qo2d_solve_(const char *ham, uintptr_t* ini_re, uintptr_t* ini_im, uintptr_t* ray, float *r, float *k0, uintptr_t* xx, uintptr_t* yy, int); +uintptr_t mgl_ray_trace_(const char *ham, float *x0, float *y0, float *z0, float *px, float *py, float *pz, float *dt, float *tmax,int); +uintptr_t mgl_jacobian_2d_(uintptr_t* x, uintptr_t* y); +uintptr_t mgl_jacobian_3d_(uintptr_t* x, uintptr_t* y, uintptr_t* z); + +uintptr_t mgl_transform_a_(uintptr_t *am, uintptr_t *ph, const char *tr, int); +uintptr_t mgl_transform_(uintptr_t *re, uintptr_t *im, const char *tr, int); +void mgl_data_fourier_(uintptr_t *re, uintptr_t *im, const char *dir, int l); +uintptr_t mgl_data_stfa_(uintptr_t *re, uintptr_t *im, int *dn, char *dir, int); + +uintptr_t mgl_triangulation_3d_(uintptr_t *x, uintptr_t *y, uintptr_t *z, float *er); +uintptr_t mgl_triangulation_2d_(uintptr_t *x, uintptr_t *y, float *er); +/*****************************************************************************/ +int mgl_data_read_hdf_(uintptr_t *d, const char *fname, const char *data,int l,int n); +void mgl_data_link_(uintptr_t *d, float *A, int *nx,int *ny,int *nz); +void mgl_data_save_hdf_(uintptr_t *d, const char *fname, const char *data, int *rewrite,int l,int n); +int mgl_data_read_range_(uintptr_t *d, const char *fname, double *from, double *to, double *step, int *as_slice,int l); +int mgl_data_read_all_(uintptr_t *d, const char *fname, int *as_slice,int l); + +/*****************************************************************************/ +#ifdef __cplusplus +} +//----------------------------------------------------------------------------- +#include +//----------------------------------------------------------------------------- +/// Class for working with data array +class mglData : public mglDataA +{ +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) + mreal *a; ///< data array + char *id; ///< column (or slice) names + bool link; ///< use external data (i.e. don't free it) + + /// Initiate by other mglData variable + inline mglData(const mglData &d) { a=0; mgl_data_set(this,&d); } + inline mglData(const mglDataA *d) { a=0; mgl_data_set(this, d); } + inline mglData(bool, mglData *d) // NOTE: Variable d will be deleted!!! + { memcpy(this,d,sizeof(mglData)); d->id=0; d->link=true; delete d; } + /// Initiate by flat array + inline mglData(int size, const float *d) { a=0; Set(d,size); } + inline mglData(int rows, int cols, const float *d) { a=0; Set(d,cols,rows); } + inline mglData(int size, const double *d) { a=0; Set(d,size); } + inline mglData(int rows, int cols, const double *d) { a=0; Set(d,cols,rows); } + inline mglData(const double *d, int size) { a=0; Set(d,size); } + inline mglData(const double *d, int rows, int cols) { a=0; Set(d,cols,rows); } + /// Read data from file + inline mglData(const char *fname) { a=0; Read(fname); } + /// Allocate the memory for data array and initialize it zero + inline mglData(long xx=1,long yy=1,long zz=1) { a=0; Create(xx,yy,zz); } + /// Delete the array + virtual ~mglData() { if(id && a) delete []id; if(!link && a) delete []a; } + /// Get sizes + inline mreal GetVal(long i) { return a[i];} + inline void SetVal(mreal f, long i) { a[i]=f; } + inline long GetNx() const { return nx; } + inline long GetNy() const { return ny; } + inline long GetNz() const { return nz; } + /// Get the value in given cell of the data without border checking + inline mreal v(long i,long j=0,long k=0) const + { return a[i+nx*(j+ny*k)]; } + inline mreal vthr(long i) const { return a[i]; } + // add for speeding up !!! + inline float dvx(long i,long j=0,long k=0) const + { register long i0=i+nx*(j+ny*k); + return i>0? (i0? (j0? (ka,d->nx,d->ny,d->nz); } + /// Allocate memory and copy the data from the gsl_vector + inline void Set(gsl_vector *m) { mgl_data_set_vector(this,m); } + /// Allocate memory and copy the data from the gsl_matrix + inline void Set(gsl_matrix *m) { mgl_data_set_matrix(this,m); } + + /// Allocate memory and copy the data from the (float *) array + inline void Set(const float *A,long NX,long NY=1,long NZ=1) + { mgl_data_set_float(this,A,NX,NY,NZ); } + /// Allocate memory and copy the data from the (double *) array + inline void Set(const double *A,long NX,long NY=1,long NZ=1) + { mgl_data_set_double(this,A,NX,NY,NZ); } + /// Allocate memory and copy the data from the (float **) array + inline void Set(const float **A,long N1,long N2) + { mgl_data_set_float2(this,A,N1,N2); } + /// Allocate memory and copy the data from the (double **) array + inline void Set(const double **A,long N1,long N2) + { mgl_data_set_double2(this,A,N1,N2); } + /// Allocate memory and copy the data from the (float ***) array + inline void Set(const float ***A,long N1,long N2,long N3) + { mgl_data_set_float3(this,A,N1,N2,N3); } + /// Allocate memory and copy the data from the (double ***) array + inline void Set(const double ***A,long N1,long N2,long N3) + { mgl_data_set_double3(this,A,N1,N2,N3); } + /// Allocate memory and scanf the data from the string + inline void Set(const char *str,long NX,long NY=1,long NZ=1) + { mgl_data_set_values(this,str,NX,NY,NZ); } + /// Import data from abstract type + inline void Set(HCDT dat) { mgl_data_set(this, dat); } + inline void Set(const mglData &dat) { mgl_data_set(this, &dat); } + /// Allocate memory and copy data from std::vector + inline void Set(const std::vector &d) + { if(d.size()<1) return; + Create(d.size()); for(long i=0;i &d) + { if(d.size()<1) return; + Create(d.size()); for(long i=0;i &d) + { if(d.size()<1) return; + Create(d.size()); for(long i=0;i=7 - x,y,z,px,py,pz,tau or nx=5 - x,y,px,py,tau) +inline mglData mglQO2d(const char *ham, const mglData &ini_re, const mglData &ini_im, const mglData &ray, mreal r=1, mreal k0=100) +{ return mglData(true, mgl_qo2d_solve(ham, &ini_re, &ini_im, &ray, r, k0, 0, 0)); } +inline mglData mglQO2d(const char *ham, const mglData &ini_re, const mglData &ini_im, const mglData &ray, mglData &xx, mglData &yy, mreal r=1, mreal k0=100) +{ return mglData(true, mgl_qo2d_solve(ham, &ini_re, &ini_im, &ray, r, k0, &xx, &yy)); } +/// Prepares ray data for mglQO_PDE with starting point \a r0, \a p0 +inline mglData mglRay(const char *ham, mglPoint r0, mglPoint p0, mreal dt=0.1, mreal tmax=10) +{ return mglData(true, mgl_ray_trace(ham, r0.x, r0.y, r0.z, p0.x, p0.y, p0.z, dt, tmax)); } +/// Calculate Jacobian determinant for D{x(u,v), y(u,v)} = dx/du*dy/dv-dx/dv*dy/du +inline mglData mglJacobian(const mglData &x, const mglData &y) +{ return mglData(true, mgl_jacobian_2d(&x, &y)); } +/// Calculate Jacobian determinant for D{x(u,v,w), y(u,v,w), z(u,v,w)} +inline mglData mglJacobian(const mglData &x, const mglData &y, const mglData &z) +{ return mglData(true, mgl_jacobian_3d(&x, &y, &z)); } +/// Do something like Delone triangulation +inline mglData mglTriangulation(const mglData &x, const mglData &y, const mglData &z, float er=0) +{ return mglData(true,mgl_triangulation_3d(&x,&y,&z,er)); } +inline mglData mglTriangulation(const mglData &x, const mglData &y, float er=0) +{ return mglData(true,mgl_triangulation_2d(&x,&y,er)); } +//----------------------------------------------------------------------------- +#endif +#endif diff --git a/include/mgl/mgl_define.h b/include/mgl/define.h similarity index 58% rename from include/mgl/mgl_define.h rename to include/mgl/define.h index c94f495..bdb11a1 100644 --- a/include/mgl/mgl_define.h +++ b/include/mgl/define.h @@ -1,172 +1,234 @@ -/*************************************************************************** - * mgl_define.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -//----------------------------------------------------------------------------- -#ifndef _MGL_DEFINE_H_ -#define _MGL_DEFINE_H_ -//----------------------------------------------------------------------------- -#ifdef WIN32 //_MSC_VER needs this before math.h -#define _USE_MATH_DEFINES -#endif - -#include +/*************************************************************************** + * define.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +//----------------------------------------------------------------------------- +#ifndef _MGL_DEFINE_H_ +#define _MGL_DEFINE_H_ +//----------------------------------------------------------------------------- +#ifdef WIN32 //_MSC_VER needs this before math.h +#define _USE_MATH_DEFINES +#endif + +#include +#include +#include -#define MGL_VERSION 11.2 - -//#ifdef WIN32 -#ifdef _MSC_VER -#define chdir _chdir // BORLAND has chdir -#include -const unsigned long mgl_nan[2] = {0xffffffff, 0x7fffffff}; -#define NANd (*(double*)mgl_nan) -#define NANf (*(float*)&(mgl_nan[1])) -#if(MGL_USE_DOUBLE==1) -#define NAN NANd -#else -#define NAN NANd -#endif -#endif - -#ifndef M_PI -#define M_PI 3.14159265358979323846 /* pi */ -#endif -//----------------------------------------------------------------------------- -#ifdef WIN32 -#define mglprintf _snwprintf -#else -#define mglprintf swprintf -#endif -//----------------------------------------------------------------------------- -#ifndef isnan -#define isnan(a) ((a)!=(a)) -#endif -//----------------------------------------------------------------------------- -#include -//----------------------------------------------------------------------------- -#if(MGL_USE_DOUBLE==1) -typedef double mreal; -#else -typedef float mreal; -#endif -//----------------------------------------------------------------------------- +#define MGL_VER2 0.0 + +//#ifdef WIN32 +#ifdef _MSC_VER +#define hypot _hypot +#define getcwd _getcwd +#define isfinite _finite +#define chdir _chdir // BORLAND has chdir +#include + +extern mglData s;const unsigned long mgl_nan[2] = {0xffffffff, 0x7fffffff}; +#define NANd (*(double*)mgl_nan) +#define NANf (*(float*)&(mgl_nan[1])) +#if (MGL_USE_DOUBLE==1) +#define NAN NANd +#else +#define NAN NANd +#endif +#endif + +#ifndef M_PI +#define M_PI 3.14159265358979323846 /* pi */ +#endif +//----------------------------------------------------------------------------- +#ifdef WIN32 +#define mglprintf _snwprintf +#else +#define mglprintf swprintf +#endif +//#define FLT_EPS 1.1920928955078125e-07 +#define MGL_FLT_EPS (1.+1e-06) +//----------------------------------------------------------------------------- +#ifndef isnan +#define isnan(a) ((a)!=(a)) +#endif +//----------------------------------------------------------------------------- +#include +//----------------------------------------------------------------------------- +#if (MGL_USE_DOUBLE==1) +typedef double mreal; +#else +typedef float mreal; +#endif +//----------------------------------------------------------------------------- #ifndef MGL_CMAP_COLOR #define MGL_CMAP_COLOR 32 #endif -//----------------------------------------------------------------------------- -#ifndef MGL_DEF_VIEWER -#define MGL_DEF_VIEWER "evince" -#endif -//----------------------------------------------------------------------------- -#define mgl_min(a,b) (((a)>(b)) ? (b) : (a)) -#define mgl_max(a,b) (((a)>(b)) ? (a) : (b)) -//----------------------------------------------------------------------------- -#define SMOOTH_NONE 0 -#define SMOOTH_LINE_3 1 -#define SMOOTH_LINE_5 2 -#define SMOOTH_QUAD_5 3 -//----------------------------------------------------------------------------- -#define MGL_HIST_IN 0 -#define MGL_HIST_SUM 1 -#define MGL_HIST_UP 2 -#define MGL_HIST_DOWN 3 -//----------------------------------------------------------------------------- -enum{ // types of predefined curvelinear coordinate systems - mglCartesian = 0, // no transformation - mglPolar, - mglSpherical, - mglParabolic, - mglParaboloidal, - mglOblate, - mglProlate, - mglElliptic, - mglToroidal, - mglBispherical, - mglBipolar -}; -//----------------------------------------------------------------------------- -// types of vector plot -#define MGL_VEC_COL 1 // use 2 colors only -#define MGL_VEC_LEN 2 // use fixed length -#define MGL_VEC_END 4 // draw vector to point -#define MGL_VEC_MID 8 // draw vector with point at center -#define MGL_VEC_DOT 16 // draw dot instead of vector -#define MGL_VEC_GRD 32 // enable color gradient along vector/dash -//----------------------------------------------------------------------------- -enum{ // Codes for warnings/messages - mglWarnNone = 0,// Everything OK - mglWarnDim, // Data dimension(s) is incompatible - mglWarnLow, // Data dimension(s) is too small - mglWarnNeg, // Minimal data value is negative - mglWarnFile, // No file or wrong data dimensions - mglWarnMem, // Not enough memory - mglWarnZero, // Data values are zero - mglWarnLegA, // Too many legend entries - mglWarnLeg, // No legend entries - mglWarnSlc, // Slice value is out of range - mglWarnCnt, // Number of contours is zero or negative - mglWarnOpen, // Couldn't open file - mglWarnLId, // Light: ID is out of range - mglWarnSize, // Setsize: size(s) is zero or negative - mglWarnFmt, // Format is not supported for that build - mglWarnTern, // Axis ranges are incompatible - mglWarnEnd // Maximal number of warnings (must be last) -}; -//----------------------------------------------------------------------------- -#ifndef MGL_DEF_PAL -#define MGL_DEF_PAL "bgrcmyhlnqeupH" // default palette -#endif -//----------------------------------------------------------------------------- -struct mglThread -{ - mreal *z; // float* array with parameters - long *p; // long* array with parameters - void *v; // pointer to data/grapher - int id; // thread id - int n; // total number of iteration -// unsigned char r[4]; // default color - mreal res; // result of operation - mglThread(); - virtual ~mglThread(); -}; -/// Start several thread for the task -mreal mglStartThread(void *(*func)(void *), mreal (*fres)(mreal,mreal), int n, mreal *z, long *p, void *v); -/// write testing messages -extern bool mglTestMode; -void mglTest(const char *str, ...); -#ifndef MGL_NTH_DEF -#define MGL_NTH_DEF 2 -#endif -#ifndef HAVE_PTHREAD -#undef MGL_NTH_DEF -#define MGL_NTH_DEF 1 -#endif -extern int mglNumThr; ///< Number of thread for plotting and data handling -//----------------------------------------------------------------------------- -/// Class for drawing in windows (like, mglGraphFLTK, mglGraphQT and so on) -/// Make inherited class and redefine Draw() function if you don't want to use function pointers. +//----------------------------------------------------------------------------- +#ifndef MGL_STACK_ENTRY +#define MGL_STACK_ENTRY 10 +#endif +//----------------------------------------------------------------------------- +#ifndef MGL_DEF_VIEWER +#define MGL_DEF_VIEWER "evince" +#endif +//----------------------------------------------------------------------------- +#ifndef MGL_FONT_PATH +#ifdef WIN32 +#define MGL_FONT_PATH "." // path to fonts +#else +#define MGL_FONT_PATH "/usr/local/share/mathgl/fonts" // path to fonts +#endif +#endif +//----------------------------------------------------------------------------- +#define mgl_min(a,b) (((a)>(b)) ? (b) : (a)) +#define mgl_max(a,b) (((a)>(b)) ? (a) : (b)) +//----------------------------------------------------------------------------- +#define SMOOTH_NONE 0 +#define SMOOTH_LINE_3 1 +#define SMOOTH_LINE_5 2 +#define SMOOTH_QUAD_5 3 +//----------------------------------------------------------------------------- +#define MGL_HIST_IN 0 +#define MGL_HIST_SUM 1 +#define MGL_HIST_UP 2 +#define MGL_HIST_DOWN 3 +//----------------------------------------------------------------------------- +enum{ // types of predefined curvelinear coordinate systems + mglCartesian = 0, // no transformation + mglPolar, + mglSpherical, + mglParabolic, + mglParaboloidal, + mglOblate, + mglProlate, + mglElliptic, + mglToroidal, + mglBispherical, + mglBipolar, + mglLogLog, + mglLogX, + mglLogY +}; +//----------------------------------------------------------------------------- +// types of drawing +#define MGL_DRAW_WIRE 0 // fastest, no faces +#define MGL_DRAW_FAST 1 // fast, no color interpolation +#define MGL_DRAW_NORM 2 // high quality, slower +#define MGL_DRAW_LMEM 4 // low memory usage (direct to pixel) +//----------------------------------------------------------------------------- +// types of vector plot +#define MGL_VEC_COL 1 // use 2 colors only +#define MGL_VEC_LEN 2 // use fixed length +#define MGL_VEC_END 4 // draw vector to point +#define MGL_VEC_MID 8 // draw vector with point at center +#define MGL_VEC_DOT 16 // draw dot instead of vector +#define MGL_VEC_GRD 32 // enable color gradient along vector/dash +#define MGL_VECTC MGL_VEC_LEN|MGL_VEC_DOT|MGL_VEC_GRD +#define MGL_VECTL MGL_VEC_COL|MGL_VEC_DOT|MGL_VEC_GRD +//----------------------------------------------------------------------------- +enum{ // Codes for warnings/messages + mglWarnNone = 0,// Everything OK + mglWarnDim, // Data dimension(s) is incompatible + mglWarnLow, // Data dimension(s) is too small + mglWarnNeg, // Minimal data value is negative + mglWarnFile, // No file or wrong data dimensions + mglWarnMem, // Not enough memory + mglWarnZero, // Data values are zero + mglWarnLeg, // No legend entries + mglWarnSlc, // Slice value is out of range + mglWarnCnt, // Number of contours is zero or negative + mglWarnOpen, // Couldn't open file + mglWarnLId, // Light: ID is out of range + mglWarnSize, // Setsize: size(s) is zero or negative + mglWarnFmt, // Format is not supported for that build + mglWarnTern, // Axis ranges are incompatible + mglWarnNull, // Pointer is NULL + mglWarnSpc, // Not enough space for plot + mglWarnEnd // Maximal number of warnings (must be last) +}; +//----------------------------------------------------------------------------- +#ifndef MGL_DEF_PAL +#define MGL_DEF_PAL "bgrcmyhlnqeupH" // default palette +#endif +//----------------------------------------------------------------------------- +#define MGL_TRANSP_NORM 0x0000 +#define MGL_TRANSP_GLASS 0x0001 +#define MGL_TRANSP_LAMP 0x0002 +#define MGL_ENABLE_CUT 0x0004 ///< Flag which determines how points outside bounding box are drown. +#define MGL_ENABLE_RTEXT 0x0008 ///< Use text rotation along axis +#define MGL_AUTO_FACTOR 0x0010 ///< Enable autochange PlotFactor +#define MGL_ENABLE_ALPHA 0x0020 ///< Flag that Alpha is used +#define MGL_ENABLE_LIGHT 0x0040 ///< Flag of using lightning +#define MGL_TICKS_ROTATE 0x0080 ///< Allow ticks rotation +#define MGL_TICKS_SKIP 0x0100 ///< Allow ticks rotation +// flags for internal use only +#define MGL_DISABLE_SCALE 0x0200 ///< Temporary flag for disable scaling (used for axis) +#define MGL_FINISHED 0x0400 ///< Flag that final picture \a mglCanvas::G is ready +#define MGL_AUTO_CLF 0x0800 ///< Clear canvas between drawing +#define MGL_SHOW_POS 0x1000 ///< Switch to show or not mouse click position +#define MGL_CLF_ON_UPD 0x2000 ///< Clear plot before Update() +//----------------------------------------------------------------------------- +//#define mgl_realloc(T,o,no,nn) {T *_tmp = new T[nn]; memcpy(_tmp,o,(no)*sizeof(T)); delete []o; o=_tmp;} +//----------------------------------------------------------------------------- +#ifdef __cplusplus +//----------------------------------------------------------------------------- +struct mglThreadD +{ + mreal *a; // float* array with parameters or results + const mreal *b,*c,*d,*e; // float* arrays with parameters + const long *p; // long* array with parameters + void *v; // pointer to data/grapher + int id; // thread id + long n; // total number of iteration + char *s; +}; +/// Start several thread for the task +void mglStartThread(void *(*func)(void *), void (*post)(mglThreadD *,mreal *), long n, + mreal *a=0, const mreal *b=0, const mreal *c=0, const long *p=0, + void *v=0, const mreal *d=0, const mreal *e=0, char *s=0); +void mglSetNumThr(int n=0); ///< Set number of thread for plotting and data handling +extern int mglNumThr; ///< Number of thread for plotting and data handling +//----------------------------------------------------------------------------- class mglGraph; +class mglBase; +/// 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. struct mglDraw { virtual int Draw(mglGraph *) { return 0; }; - virtual void Reload(int) {}; - virtual ~mglDraw() {}; + virtual void Reload() {}; }; -//----------------------------------------------------------------------------- -#endif -//----------------------------------------------------------------------------- +int mgl_draw_class(mglBase *gr, void *p); +void mgl_reload_class(void *p); +typedef int (*draw_func)(mglGraph *gr); +int mgl_draw_graph(mglBase *gr, void *p); +//----------------------------------------------------------------------------- +extern "C" { +#endif +void mgl_test_txt(const char *str, ...); +void mgl_set_test_mode(int enable); +#ifdef __cplusplus +} +#endif +#ifdef HAVE_PTHREAD +#include +#define MGL_PUSH(a,v,m) {pthread_mutex_lock(&m); a.push_back(v); pthread_mutex_unlock(&m);} +#else +#define MGL_PUSH(a,v,m) a.push_back(v); +#endif +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/include/mgl/mgl_eval.h b/include/mgl/eval.h similarity index 76% rename from include/mgl/mgl_eval.h rename to include/mgl/eval.h index a330c9a..cc829eb 100644 --- a/include/mgl/mgl_eval.h +++ b/include/mgl/eval.h @@ -1,7 +1,7 @@ -/*************************************************************************** - * mgl_eval.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * +/*************************************************************************** + * eval.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 3 of the * @@ -17,50 +17,56 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -//--------------------------------------------------------------------------- -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" +//--------------------------------------------------------------------------- +#ifdef _MGL_W_H_ +#warning "MathGL wrapper was enabled. So disable original MathGL classes" #else -#ifndef _MGL_EVAL_H_ -#define _MGL_EVAL_H_ -//--------------------------------------------------------------------------- -#include -#include "mgl/mgl_define.h" -/// types of errors -#define MGL_ERR_LOG 1 -#define MGL_ERR_ARC 2 -#define MGL_ERR_SQRT 3 -/// size of \a var array -const int MGL_VS = 'z'-'a'+1; -//--------------------------------------------------------------------------- -/// Class for evaluating formula specified by the string -class mglFormula // îáúåêò äëÿ ââîäà è âû÷èñëåíèÿ ôîðìóë -{ -public: - /// Evaluates the formula for 'x','r'=\a x, 'y','n'=\a y, 'z','t'=\a z, 'u'=\a u - mreal Calc(mreal x,mreal y=0,mreal z=0,mreal u=0) const; - /// Evaluates the formula for 'x, y, z, u, v, w' - mreal Calc(mreal x,mreal y,mreal z,mreal u,mreal v,mreal w) const; - /// Evaluates the formula for variables \a var - mreal Calc(const mreal var[MGL_VS]) const; - /// Evaluates the derivates of the formula for variables \a var respect to variable \a diff - mreal CalcD(const mreal var[MGL_VS], char diff) const; - /// Return error code - int GetError() const; - /// Parse the formula \a str and create formula-tree - mglFormula(const char *str); - /// Clean up formula-tree - virtual ~mglFormula(); -protected: - mreal CalcIn(const mreal *a1) const; - mreal CalcDIn(int id, const mreal *a1) const; - mglFormula *Left,*Right; // first and second argument of the function - int Kod; // the function ID - mreal Res; // the number or the variable ID - static int Error; -}; -//--------------------------------------------------------------------------- -char *mgl_strdup(const char *s); -//----------------------------------------------------------------------------- -#endif -#endif +#ifndef _MGL_EVAL_H_ +#define _MGL_EVAL_H_ +//--------------------------------------------------------------------------- +#include +#include "mgl/define.h" +/// types of errors +#define MGL_ERR_LOG 1 +#define MGL_ERR_ARC 2 +#define MGL_ERR_SQRT 3 +/// size of \a var array +const int MGL_VS = 'z'-'a'+1; +//--------------------------------------------------------------------------- +/// Class for evaluating formula specified by the string +class mglFormula // îáúåêò äëÿ ââîäà è âû÷èñëåíèÿ ôîðìóë +{ +public: + /// Evaluates the formula for 'x','r'=\a x, 'y','n'=\a y, 'z','t'=\a z, 'u'=\a u + float Calc(float x,float y=0,float z=0,float u=0) const; + /// Evaluates the formula for 'x, y, z, u, v, w' + float Calc(float x,float y,float z,float u,float v,float w) const; + /// Evaluates the formula for variables \a var + float Calc(const float var[MGL_VS]) const; + /// Evaluates the formula for 'x','r'=\a x, 'y','n'=\a y, 'z','t'=\a z, 'u'=\a u + float CalcD(char diff, float x,float y=0,float z=0,float u=0) const; + /// Evaluates the formula for 'x, y, z, u, v, w' + float CalcD(char diff, float x,float y,float z,float u,float v,float w) const; + /// Evaluates the derivates of the formula for variables \a var respect to variable \a diff + float CalcD(const float var[MGL_VS], char diff) const; + /// Return error code + int GetError() const; + /// Parse the formula \a str and create formula-tree + mglFormula(const char *str); + /// Clean up formula-tree + ~mglFormula(); +protected: + float CalcIn(const float *a1) const; + float CalcDIn(int id, const float *a1) const; + mglFormula *Left,*Right; // first and second argument of the function + int Kod; // the function ID + float Res; // the number or the variable ID + static int Error; +}; +//--------------------------------------------------------------------------- +char *mgl_strdup(const char *s); +void mgl_strtrim(char *str); +void mgl_strlwr(char *str); +//----------------------------------------------------------------------------- +#endif +#endif diff --git a/include/mgl/fit.h b/include/mgl/fit.h new file mode 100644 index 0000000..1c7ba89 --- /dev/null +++ b/include/mgl/fit.h @@ -0,0 +1,67 @@ +/*************************************************************************** + * fit.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef _MGL_FIT_H_ +#define _MGL_FIT_H_ +#include "mgl/base.h" +/*****************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif +/*****************************************************************************/ +extern int mglFitPnts; ///< Number of output points in fitting +extern char mglFitRes[1024]; ///< Last fitted formula +HMDT mgl_fit_1(HMGL gr, HCDT y, const char *eq, const char *var, HMDT ini, const char *opt); +HMDT mgl_fit_2(HMGL gr, HCDT z, const char *eq, const char *var, HMDT ini, const char *opt); +HMDT mgl_fit_3(HMGL gr, HCDT a, const char *eq, const char *var, HMDT ini, const char *opt); +HMDT mgl_fit_xy(HMGL gr, HCDT x, HCDT y, const char *eq, const char *var, HMDT ini, const char *opt); +HMDT mgl_fit_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *eq, const char *var, HMDT ini, const char *opt); +HMDT mgl_fit_xyza(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, const char *eq, const char *var, HMDT ini, const char *opt); +HMDT mgl_fit_ys(HMGL gr, HCDT y, HCDT s, const char *eq, const char *var, HMDT ini, const char *opt); +HMDT mgl_fit_xys(HMGL gr, HCDT x, HCDT y, HCDT s, const char *eq, const char *var, HMDT ini, const char *opt); +HMDT mgl_fit_xyzs(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT s, const char *eq, const char *var, HMDT ini, const char *opt); +HMDT mgl_fit_xyzas(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, HCDT s, const char *eq, const char *var, HMDT ini, const char *opt); + +const char *mgl_get_fit(HMGL gr); + +HMDT mgl_hist_x(HMGL gr, HCDT x, HCDT a, const char *opt); +HMDT mgl_hist_xy(HMGL gr, HCDT x, HCDT y, HCDT a, const char *opt); +HMDT mgl_hist_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, const char *opt); + +/*****************************************************************************/ +uintptr_t mgl_fit_1_(uintptr_t* gr, uintptr_t* y, const char *eq, const char *var, uintptr_t *ini, const char *opt,int, int l, int n); +uintptr_t mgl_fit_2_(uintptr_t* gr, uintptr_t* z, const char *eq, const char *var, uintptr_t *ini, const char *opt,int, int l, int n); +uintptr_t mgl_fit_3_(uintptr_t* gr, uintptr_t* a, const char *eq, const char *var, uintptr_t *ini, const char *opt,int, int l, int n); +uintptr_t mgl_fit_xy_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, const char *eq, const char *var, uintptr_t *ini, const char *opt,int, int l, int n); +uintptr_t mgl_fit_xyz_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, uintptr_t* z, const char *eq, const char *var, uintptr_t *ini, const char *opt,int, int l, int n); +uintptr_t mgl_fit_xyza_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* a, const char *eq, const char *var, uintptr_t *ini, const char *opt,int, int l, int n); +uintptr_t mgl_fit_ys_(uintptr_t* gr, uintptr_t* y, uintptr_t* ss, const char *eq, const char *var, uintptr_t *ini, const char *opt,int, int l, int n); +uintptr_t mgl_fit_xys_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, uintptr_t* ss, const char *eq, const char *var, uintptr_t *ini, const char *opt,int, int l, int n); +uintptr_t mgl_fit_xyzs_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* ss, const char *eq, const char *var, uintptr_t *ini, const char *opt,int, int l, int n); +uintptr_t mgl_fit_xyzas_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* a, uintptr_t* ss, const char *eq, const char *var, uintptr_t *ini, const char *opt,int, int l, int n); + +uintptr_t mgl_hist_x_(uintptr_t* gr, uintptr_t* x, uintptr_t* a, const char *opt,int); +uintptr_t mgl_hist_xy_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, uintptr_t* a, const char *opt,int); +uintptr_t mgl_hist_xyz_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* a, const char *opt,int); +/*****************************************************************************/ +#ifdef __cplusplus +} +#endif +/*****************************************************************************/ +#endif diff --git a/include/mgl/mgl_fltk.h b/include/mgl/fltk.h similarity index 64% rename from include/mgl/mgl_fltk.h rename to include/mgl/fltk.h index 4ff3612..21bf669 100644 --- a/include/mgl/mgl_fltk.h +++ b/include/mgl/fltk.h @@ -1,145 +1,131 @@ -/*************************************************************************** - * mgl_fltk.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -//----------------------------------------------------------------------------- -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" -#else -#ifndef _MGL_FLTK_H_ -#define _MGL_FLTK_H_ -//----------------------------------------------------------------------------- -#ifdef __MWERKS__ -# define FL_DLL -#endif - -#include -#include -#include -#include -#include -#include "mgl/mgl_zb.h" -//----------------------------------------------------------------------------- -class Fl_MathGL; -int mglFlRun(); -//----------------------------------------------------------------------------- -/// Class allows the window creation for displaying plot bitmap with the help of FLTK library -/** ATTENTION!!! All frames are saved in memory. So animation with many frames require a lot memory and CPU time (for example, for mouse rotation).*/ -class mglGraphFLTK : public mglGraphZB -{ -friend class Fl_MathGL; -public: -using mglGraphAB::Window; - int sshow; ///< Current state of animation switch (toggle button) - Fl_MathGL *FMGL;///< Control which draw graphics - int CurFig; ///< Current figure in the list. - Fl_Window *Wnd; ///< Pointer to window - - mglGraphFLTK(); - virtual ~mglGraphFLTK(); - - void SetSize(int w,int h); - void EndFrame(); - const unsigned char *GetBits(); - void Clf(mglColor Back=NC); - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ñëóæåáíûå ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /// Create a window for plotting. Now implemeted only for GLUT. - void Window(int argc, char **argv, int (*draw)(mglGraph *gr, void *p), - const char *title,void *par=NULL, - void (*reload)(int next, void *p)=NULL, bool maximize=false); - /// Switch on/off transparency (do not overwrite switches in user drawing function) - void ToggleAlpha(); - /// Switch on/off lighting (do not overwrite switches in user drawing function) - void ToggleLight(); - void ToggleZoom(); ///< Switch on/off zooming by mouse - void ToggleRotate();///< Switch on/off rotation by mouse - void ToggleNo(); ///< Switch off all zooming and rotation - void Update(); ///< Update picture by calling user drawing function - void ReLoad(bool o);///< Reload user data and update picture - void Adjust(); ///< Adjust size of bitmap to window size - void NextFrame(); ///< Show next frame (if one) - void PrevFrame(); ///< Show previous frame (if one) - void Animation(); ///< Run slideshow (animation) of frames - -protected: - unsigned char *GG; ///< images for all frames (may be too LARGE !!!) - - Fl_Button *alpha_bt, *light_bt, *rotate_bt, *zoom_bt, *anim_bt; - Fl_Counter *tet, *phi; - Fl_Scroll *scroll; - Fl_Menu_Bar *menu; - - int alpha; ///< Current state of alpha switch (toggle button) - int light; ///< Current state of light switch (toggle button) - bool zoom, rotate; -}; -//----------------------------------------------------------------------------- -/// Class is FLTK widget which display MathGL graphics -class Fl_MathGL : public Fl_Widget -{ -public: - Fl_Valuator *tet_val; ///< pointer to external tet-angle validator - Fl_Valuator *phi_val; ///< pointer to external phi-angle validator - mglGraphAB *graph; ///< pointer to grapher - void *draw_par; ///< Parameters for drawing function mglGraph::DrawFunc. - /// Drawing function for window procedure. It should return the number of frames. - int (*draw_func)(mglGraph *gr, void *par); - - Fl_MathGL(int x, int y, int w, int h, char *label=0); - virtual ~Fl_MathGL(); - - /// Update (redraw) plot - void update(mglGraph *gr=0); - /// Set drawing functions from the class - void set_draw(mglDraw *dr); - /// Set angles for additional plot rotation - inline void set_angle(mreal t, mreal p){ tet = t; phi = p; }; - /// Set bitwise flags for general state (1-Alpha, 2-Light) - inline void set_state(int f) { flag = f; }; - /// Set flags for handling mouse - void set_state(bool z, bool r) { zoom = z; rotate = r; }; - /// Set zoom in/out region - inline void set_zoom(mreal X1, mreal Y1, mreal X2, mreal Y2) - { x1 = X1; x2 = X2; y1 = Y1; y2 = Y2; }; - /// Get zoom region - inline void get_zoom(mreal *X1, mreal *Y1, mreal *X2, mreal *Y2) - { *X1 = x1; *X2 = x2; *Y1 = y1; *Y2 = y2; }; - /// Get pointer to grapher - inline mglGraph *get_graph() { return graph; }; - /// Set popup menu pointer - inline void set_popup(const Fl_Menu_Item *pmenu, Fl_Widget *w, void *v) - { popup = pmenu; wpar = w; vpar = v; } -protected: - const Fl_Menu_Item *popup; ///< pointer to popup menu items - Fl_Widget *wpar; ///< widget for popup menu - void *vpar; ///< parameter for popup menu - mreal tet,phi; ///< rotation angles - mreal x1,x2,y1,y2; ///< zoom in region - bool zoom, rotate; ///< flag for handle mouse - int flag; ///< bitwise flag for general state (1-Alpha, 2-Light) - int x0,y0,xe,ye; ///< mouse position - char pos[128]; - - void draw(); ///< quick drawing function - int handle(int code); ///< handle mouse events - void resize(int x, int y, int w, int h); ///< resize control -}; -//----------------------------------------------------------------------------- -#endif +/*************************************************************************** + * window.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +//----------------------------------------------------------------------------- +#ifndef _MGL_FLTK_H_ +#define _MGL_FLTK_H_ +/*****************************************************************************/ +#ifdef __cplusplus +#include "mgl/window.h" +//----------------------------------------------------------------------------- +#ifdef __MWERKS__ +# define FL_DLL +#endif + +#include +#include +#include +#include +#include +//----------------------------------------------------------------------------- +/// Class is FLTK widget which display MathGL graphics +class Fl_MathGL : public Fl_Widget +{ +public: + Fl_Valuator *tet_val; ///< pointer to external tet-angle validator + Fl_Valuator *phi_val; ///< pointer to external phi-angle validator + + Fl_MathGL(int x, int y, int w, int h, char *label=0); + ~Fl_MathGL(); + + /// Update (redraw) plot + void update(mglCanvas *gr=0); + /// Set angles for additional plot rotation + inline void set_angle(float t, float p){ tet = t; phi = p; } + /// Set bitwise flags for general state (1-Alpha, 2-Light) + inline void set_flag(int f) { flag = f; } + /// Set flags for handling mouse + void set_graph(mglCanvas *gr); ///< Set grapher object + inline void set_graph(mglGraph *gr) + { set_graph(dynamic_cast(gr->Self())); } + /// Get pointer to grapher + inline HMGL get_graph() { return graph; } + /// Set drawing functions and its parameter + inline void set_draw(int (*func)(mglBase *gr, void *par), void *par=0) + { draw_func = func; draw_par = par; } + inline void set_draw(mglDraw *dr) + { set_draw(mgl_draw_class,(void*)dr); } + inline void set_draw(int (*dr)(mglGraph *gr)) + { set_draw(mgl_draw_graph,(void*)dr); } + void set_state(bool r) { rotate = r; } + /// Set popup menu pointer + inline void set_popup(const Fl_Menu_Item *pmenu, Fl_Widget *wdg, void *v) + { popup = pmenu; wpar = wdg; vpar = v; } +protected: + mglCanvas *graph; ///< pointer to grapher + void *draw_par; ///< Parameters for drawing function mglCanvasW::DrawFunc. + /// Drawing function for window procedure. It should return the number of frames. + int (*draw_func)(mglBase *gr, void *par); + + const Fl_Menu_Item *popup; ///< pointer to popup menu items + Fl_Widget *wpar; ///< widget for popup menu + void *vpar; ///< parameter for popup menu + float tet,phi; ///< rotation angles + bool rotate; ///< flag for handle mouse + int flag; ///< bitwise flag for general state (1-Alpha, 2-Light) + int x0,y0,xe,ye; ///< mouse position + char pos[128]; + + void draw(); ///< quick drawing function + int handle(int code); ///< handle mouse events + void resize(int x, int y, int w, int h); ///< resize control +}; +//----------------------------------------------------------------------------- +/// Class allows the window creation for displaying plot bitmap with the help of FLTK library +/** NOTE!!! All frames are saved in memory. So animation with many frames require a lot memory and CPU time (for example, for mouse rotation).*/ +class mglCanvasFL : public mglCanvasW +{ +public: +using mglCanvasW::Window; + int sshow; ///< Current state of animation switch (toggle button) + Fl_MathGL *FMGL;///< Control which draw graphics + Fl_Window *Wnd; ///< Pointer to window + + mglCanvasFL(); + ~mglCanvasFL(); + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ñëóæåáíûå ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /// 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, void (*reload)(void *p)=NULL, bool maximize=false); + /// Switch on/off transparency (do not overwrite switches in user drawing function) + void ToggleAlpha(); + /// Switch on/off lighting (do not overwrite switches in user drawing function) + void ToggleLight(); + void ToggleRotate();///< Switch on/off rotation by mouse + void ToggleNo(); ///< Switch off all zooming and rotation + void Update(); ///< Update picture by calling user drawing function + void Adjust(); ///< Adjust size of bitmap to window size + void NextFrame(); ///< Show next frame (if one) + void PrevFrame(); ///< Show previous frame (if one) + void Animation(); ///< Run slideshow (animation) of frames + +protected: + Fl_Button *alpha_bt, *light_bt, *rotate_bt, *anim_bt; + Fl_Counter *tet, *phi; + Fl_Scroll *scroll; + Fl_Menu_Bar *menu; + + int alpha; ///< Current state of alpha switch (toggle button) + int light; ///< Current state of light switch (toggle button) + bool rotate; +}; +//----------------------------------------------------------------------------- +#endif #endif -//----------------------------------------------------------------------------- diff --git a/include/mgl/mgl_font.h b/include/mgl/font.h similarity index 75% rename from include/mgl/mgl_font.h rename to include/mgl/font.h index d1784d5..7ad612a 100644 --- a/include/mgl/mgl_font.h +++ b/include/mgl/font.h @@ -1,5 +1,5 @@ /*************************************************************************** - * mgl_font.h is part of Math Graphic Library + * font.h is part of Math Graphic Library * Copyright (C) 2007 Alexey Balakin * * * * This program is free software; you can redistribute it and/or modify * @@ -18,14 +18,11 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ //----------------------------------------------------------------------------- -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" -#else #ifndef _MGL_FONT_H_ #define _MGL_FONT_H_ #include -#include +#include "mgl/define.h" //----------------------------------------------------------------------------- #define MGL_FONT_BOLD 0x01000000 // This value is used binary #define MGL_FONT_ITAL 0x02000000 // This value is used binary @@ -47,57 +44,52 @@ #define MGL_DEF_FONT_NAME "STIX" #endif //----------------------------------------------------------------------------- -struct mglTeXsymb { unsigned kod; const wchar_t *tex; }; -class mglGraph; +struct mglTeXsymb { unsigned kod; const wchar_t *tex; }; +/// Get font color, style and align for internal parser +char mglGetStyle(const char *how, int *font, int *align=0); +class mglBase; //----------------------------------------------------------------------------- /// Class for incapsulating font plotting procedures class mglFont { public: - mglGraph *gr; ///< mglGraph class used for drawing characters + mglBase *gr; ///< mglBase class used for drawing characters mglFont(const char *name=0, const char *path=0); - virtual ~mglFont(); + ~mglFont(); bool parse; ///< Parse LaTeX symbols /// Load font data to memory. Normally used by constructor. bool Load(const char *base, const char *path=0); /// Free memory - void Clear(); + void Clear(); + /// Copy data from other font + void Copy(mglFont *); + /// Restore default font + void Restore(); + /// Return true if font is loaded + inline bool Ready() { return numg!=0; }; + /// Get height of text - mreal Height(int font); + float Height(int font); /// Get height of text - mreal Height(const char *how); + float Height(const char *how); /// Print text string for font specified by string - mreal Puts(const char *str,const char *how, char col); + float Puts(const char *str,const char *how,float col); /// Get width of text string for font specified by string - mreal Width(const char *str,const char *how); - /// Print text string for font specified by integer constant - mreal Puts(const char *str,int font=0,int align=0, char col='k'); - /// Get width of text string for font specified by integer constant - mreal Width(const char *str,int font=0); - + float Width(const char *str,const char *how); /// Print text string for font specified by string - mreal Puts(const wchar_t *str,const char *how, char col); + float Puts(const wchar_t *str,const char *how,float col); /// Get width of text string for font specified by string - mreal Width(const wchar_t *str,const char *how); - /// Print text string for font specified by integer constant - mreal Puts(const wchar_t *str,int font=0,int align=0, char col='k'); - /// Get width of text string for font specified by integer constant - mreal Width(const wchar_t *str,int font=0); + float Width(const wchar_t *str,const char *how); + /// Return number of glyphs inline unsigned GetNumGlyph() { return numg; }; - /// Copy data from other font - void Copy(mglFont *); - /// Restore default font - void Restore(); - /// Return true if font is loaded - inline bool Ready() { return numg!=0; }; /// Return some of pointers - inline const short *GetTr(int s, long j) { return buf+tr[s][j]; }; - inline const short *GetLn(int s, long j) { return buf+ln[s][j]; }; + inline const short *GetTr(int s, long j) { return Buf+tr[s][j]; }; + inline const short *GetLn(int s, long j) { return Buf+ln[s][j]; }; inline int GetNt(int s, long j) { return numt[s][j]; }; inline int GetNl(int s, long j) { return numl[s][j]; }; - inline mreal GetFact(int s) { return fact[s]; }; + inline float GetFact(int s) { return fact[s]; }; protected: wchar_t *id; ///< Unicode ID for glyph unsigned *tr[4]; ///< Shift of glyph description by triangles (for solid font) @@ -107,33 +99,35 @@ protected: short *width[4]; ///< Width of glyph for wire font float fact[4]; ///< Divider for width of glyph unsigned numg; ///< Number of glyphs - short *buf; ///< Buffer for glyph descriptions + short *Buf; ///< Buffer for glyph descriptions long numb; ///< Buffer size - - /// Draw string recursively - /* x,y - position, f - factor, style: 0x1 - italic, 0x2 - bold, 0x4 - overline, 0x8 - underline, 0x10 - empty (not draw) */ - mreal Puts(const unsigned *str, mreal x,mreal y,mreal f,int style,char col); + + /// Print text string for font specified by integer constant + float Puts(const wchar_t *str,int font,int align, float col); + /// Get width of text string for font specified by integer constant + float Width(const wchar_t *str,int font=0); /// Replace TeX symbols by its UTF code and add font styles void Convert(const wchar_t *str, unsigned *res); + + /// Draw string recursively + /* x,y - position, f - factor, style: 0x1 - italic, 0x2 - bold, 0x4 - overline, 0x8 - underline, 0x10 - empty (not draw) */ + float Puts(const unsigned *str, float x,float y,float f,int style,float col); /// Parse LaTeX command unsigned Parse(const wchar_t *s); /// Get internal code for symbol long Internal(unsigned s); - /// Convert string to internal kod, also recognize TeX command - void Convert(const wchar_t *str,unsigned *kod,int font); /// Get symbol for character \a ch with given \a font style unsigned Symbol(char ch); private: - mreal get_ptr(long &i,unsigned *str, unsigned **b1, unsigned **b2,mreal &w1,mreal &w2, mreal f1, mreal f2, int st); + float get_ptr(long &i,unsigned *str, unsigned **b1, unsigned **b2,float &w1,float &w2, float f1, float f2, int st); bool read_data(const char *fname, float *ff, short *wdt, short *numl, unsigned *posl, short *numt, unsigned *post, unsigned &cur); void main_copy(); bool read_main(const char *fname, unsigned &cur); void mem_alloc(); bool read_def(unsigned &cur); - void draw_ouline(mglGraph *gr, int st, mreal x, mreal y, mreal f, mreal g, mreal ww, char ccol); + void draw_ouline(int st, float x, float y, float f, float g, float ww, float ccol); }; //----------------------------------------------------------------------------- #endif -#endif //----------------------------------------------------------------------------- diff --git a/include/mgl/glut.h b/include/mgl/glut.h new file mode 100644 index 0000000..5adb631 --- /dev/null +++ b/include/mgl/glut.h @@ -0,0 +1,94 @@ +/*************************************************************************** + * mgl_glut.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +//----------------------------------------------------------------------------- +#ifndef _MGL_GLUT_H_ +#define _MGL_GLUT_H_ +#ifdef __cplusplus +#include "mgl/opengl.h" +#include "mgl/mgl.h" +//----------------------------------------------------------------------------- +extern "C" { +#endif +/*****************************************************************************/ +void _mgl_key_up(unsigned char ch,int ,int ); +HMGL mgl_create_graph_glut(int (*draw)(HMGL gr, void *p), const char *title, void *par); +/*int mgl_fortran_func(HMGL gr, void *); +uintptr_t mgl_create_graph_glut_(const char *title, int);*/ +/*****************************************************************************/ +#ifdef __cplusplus +} +/// Class allows the window creation under OpenGL with the help of GLUT library +class mglCanvasGLUT : public mglCanvasGL +{ +friend void _mgl_display(); +friend void _mgl_key_up(unsigned char ch,int ,int ); +friend void _mgl_timer(int); +public: + float Delay; ///< Delay for animation in seconds + bool AutoClf; ///< Clear canvas between drawing + + mglCanvasGLUT(); + 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, + void (*reload)(void *p)=NULL, bool maximize=false); + void Window(int argc, char **argv, int (*draw)(mglGraph *gr), + const char *title, bool maximize=false) + { Window(argc,argv,mgl_draw_graph,title,(void*)draw,0,maximize); } + /// Create a window for plotting based on class mglDraw. + void Window(int argc, char **argv, const char *title, mglDraw *draw, bool maximize=false) + { Window(argc, argv, mgl_draw_class, title, draw, mgl_reload_class, maximize); } + /// Switch on/off transparency (do not overwrite switches in user drawing function) + void ToggleAlpha() { _mgl_key_up('r',0,0); } + /// Switch on/off lighting (do not overwrite switches in user drawing function) + void ToggleLight() { _mgl_key_up('f',0,0); } + void ToggleNo() { _mgl_key_up('n',0,0); } ///< Switch off all zooming and rotation + void Update() { _mgl_key_up(' ',0,0); } ///< Update picture by calling user drawing function + void ReLoad(bool o) { _mgl_key_up(o?']':'[',0,0); } ///< Reload user data and update picture + void NextFrame() { _mgl_key_up('.',0,0); } ///< Show next frame (if one) + void PrevFrame() { _mgl_key_up(',',0,0); } ///< Show previous frame (if one) + void Animation() { _mgl_key_up('m',0,0); } ///< Run slideshow (animation) of frames +private: + void (*LoadFunc)(void *par); + void *FuncPar; ///< Parameters for drawing function mglCanvas::DrawFunc. + /// Drawing function for window procedure. It should return the number of frames. + int (*DrawFunc)(mglBase *gr, void *par); + int NumFig; ///< Number of figures in the list. If 0 then no list and mglCanvas::DrawFunc will called for each drawing. + int curr_fig; ///< Current figure in the list. + int tt; ///< Temporal variable +}; +//----------------------------------------------------------------------------- +class mglGLUT: public mglGraph +{ +public: + mglGLUT(int (*draw)(HMGL gr, void *p), const char *title="MathGL", void *par=NULL) : mglGraph(-1) + { gr = mgl_create_graph_glut(draw,title,par); } + mglGLUT(int (*draw)(mglGraph *gr), const char *title="MathGL") : mglGraph(-1) + { gr = mgl_create_graph_glut(mgl_draw_graph,title,(void*)draw); } + mglGLUT(mglDraw *dr=NULL, const char *title="MathGL") : mglGraph(-1) + { mgl_create_graph_glut(mgl_draw_class,title,dr); } +}; +//----------------------------------------------------------------------------- +#endif +#endif diff --git a/include/mgl/gsl.fs b/include/mgl/gsl.fs deleted file mode 100644 index 5681829..0000000 --- a/include/mgl/gsl.fs +++ /dev/null @@ -1,1276 +0,0 @@ -\ GNU Scientific Library interface Mon Sep 12 14:40:15 MDT 2005 -\ Copyright (C) 2007, Sergey Plis -\ -\ This program is free software; you can redistribute it and/or modify -\ it under the terms of the GNU General Public License as published by -\ the Free Software Foundation; either version 2 of the License, or -\ (at your option) any later version. -\ -\ This program is distributed in the hope that it will be useful, -\ but WITHOUT ANY WARRANTY; without even the implied warranty of -\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -\ GNU General Public License for more details. - -\needs float import float -warning off -\needs locals| include locals.fs -warning on -\needs atlas include atlas.fs -\needs callback include callback.fs -\needs vectors include vectors.fs -\needs complex include complex.fb - -Module GSL - -\ stole the hash function from hash.fs of bigforth -| &14 Value Hashbits -| 1 Hashbits << Value Hashlen - -Label (hash ( SI:string -- AX:key ) :R DX push - .b lods $1F # AX and AX CX mov DX DX xor CX 1 # shr - b IF SI ) AH mov SI inc THEN CX dec - 0>= IF BEGIN .w SI ) DX mov 2 # SI add CX dec - DX AX *2 I) AX lea 0< UNTIL THEN - & Hashbits A#) CX mov AX DX mov AX shr DX AX add - & Hashlen A#) CX mov CX dec CX AX and DX pop ret -| Code Hash ( string -- key ) - R: SI push AX SI mov (hash rel) call SI pop - Next end-code - -also dos also complex also float also atlas also vectors - -s" libptcblas.so" getlib 0<> -[IF] - library libblas libptcblas.so depends libatlas -[ELSE] - library libblas libcblas.so depends libatlas -[THEN] - -library libgsl libgsl.so.0 depends libblas - -legacy off - -\ some functions -libgsl gsl_log1p df (fp) gsl_log1p ( df -- df ) -libgsl gsl_acosh df (fp) gsl_acosh ( df -- df ) - -\ error handling Wed Sep 21 23:04:06 MDT 2005 -libgsl gsl_set_error_handler ptr (int) gsl_set_error_handler -( function -- function ) -libgsl gsl_strerror int (ptr) gsl_strerror - -callback 4:0 (void) int int int int callback; -: cstr-fstr ( addr -- addr len ) - 0 - begin 2dup + c@ 0 = not while - 1+ - repeat ; - -| : .bold-red ." " ; -| : .red ." " ; -| : .reset ." " ; -| : cb-test - cr - \ .bold-red - ." GSL ERROR: " cr - \ .reset cr - 10 spaces gsl_strerror cstr-fstr type cr - drop \ ." at line: " . cr - drop \ ." of file: " cstr-fstr type cr - 10 spaces cstr-fstr type cr - \ .red - -1 abort" failed at" ; -' cb-test 4:0 c_plus - -\ 1 2 c_plus 2:1call . -| variable old_handler -c_plus gsl_set_error_handler old_handler ! - -0 Constant GSL_SUCCESS - -\ random number generation Mon Sep 12 22:06:01 MDT 2005 - -libgsl gsl_rng_types_setup (ptr) gsl_rng_types_setup ( -- *gsl_rng_type) -libgsl gsl_rng_env_setup (ptr) gsl_rng_env_setup ( -- *gsl_rng) -libgsl gsl_rng_alloc int (int) gsl_rng_alloc ( *gsl_rng_type -- *gsl_rng ) -libgsl gsl_rng_name int (int) gsl_rng_name ( *gsl_rng -- string ) -libgsl gsl_rng_set int int (void) gsl_rng_set ( *gsl_rng int -- ) -libgsl gsl_rng_uniform int (fp) gsl_rng_uniform ( *gsl_rng -- df ) -libgsl gsl_rng_uniform_pos int (fp) gsl_rng_uniform_pos ( *gsl_rng -- df ) -libgsl gsl_rng_uniform_int int int (int) gsl_rng_uniform_int ( *gsl_rng n --n ) -libgsl gsl_rng_get int (int) gsl_rng_get ( *gsl_rng -- int ) -libgsl gsl_rng_max int (int) gsl_rng_max ( *gsl_rng -- int ) -libgsl gsl_rng_min int (int) gsl_rng_min ( *gsl_rng -- int ) -libgsl gsl_rng_clone int (int) gsl_rng_clone ( *gsl_rng -- *gsl_rng ) -libgsl gsl_rng_free int (int) gsl_rng_free ( *gsl_rng -- ) - - - -\ random number distributions Tue Sep 13 00:44:35 MDT 2005 -\ Gaussian -libgsl gsl_ran_gaussian df int (fp) gsl_ran_gaussian ( *gsl_rng df -- df ) -libgsl gsl_ran_gaussian_ratio_method df int (fp) gsl_ran_gaussian_ratio_method ( *gsl_rng df -- df ) -libgsl gsl_ran_gaussian_pdf df df (fp) gsl_ran_gaussian_pdf ( df df -- df ) -\ sigma = 1 -libgsl gsl_ran_ugaussian int (fp) gsl_ran_ugaussian ( *gsl_rng -- df ) -libgsl gsl_ran_ugaussian_ratio_method int (fp) gsl_ran_ugaussian_ratio_method ( *gsl_rng -- df ) -libgsl gsl_ran_ugaussian_pdf df (fp) gsl_ran_ugaussian_pdf ( df df -- df ) -libgsl gsl_ran_discrete_preproc int int (int) gsl_ran_discrete_preproc ( int int -- int ) -libgsl gsl_ran_discrete int int (int) gsl_ran_discrete -libgsl gsl_ran_discrete_free int (void) gsl_ran_discrete_free -libgsl gsl_ran_shuffle int int ptr ptr (void) gsl_ran_shuffle -\ cdf P(x) = \int_{-\infty}^{x} p(x)dx Q(x) = \int_{x}^{\infty} p(x)dx -libgsl gsl_cdf_gaussian_P df df (fp) gsl_cdf_gaussian_P ( df df -- df ) -libgsl gsl_cdf_gaussian_Q df df (fp) gsl_cdf_gaussian_Q ( df df -- df ) -libgsl gsl_cdf_gaussian_Pinv df df (fp) gsl_cdf_gaussian_Pinv ( df df -- df ) -libgsl gsl_cdf_gaussian_Qinv df df (fp) gsl_cdf_gaussian_Qinv ( df df -- df ) -\ sigma = 1 cdf -libgsl gsl_cdf_ugaussian_P df (fp) gsl_cdf_ugaussian_P ( df -- df ) -libgsl gsl_cdf_ugaussian_Q df (fp) gsl_cdf_ugaussian_Q ( df -- df ) -libgsl gsl_cdf_ugaussian_Pinv df (fp) gsl_cdf_ugaussian_Pinv ( df -- df ) -libgsl gsl_cdf_ugaussian_Qinv df (fp) gsl_cdf_ugaussian_Qinv ( df -- df ) - - -\ statistics Tue Sep 13 01:17:35 MDT 2005 -libgsl gsl_stats_mean int int int (fp) gsl_stats_mean ( array{ step size -- df ) -libgsl gsl_stats_variance int int int (fp) gsl_stats_variance ( array{ step size -- df ) -libgsl gsl_stats_variance_m df int int int (fp) gsl_stats_variance_m ( df array{ step size -- df ) -libgsl gsl_stats_sd int int int (fp) gsl_stats_sd ( array{ step size -- df ) -libgsl gsl_stats_sd_m df int int int (fp) gsl_stats_sd_m ( df array{ step size -- df ) -libgsl gsl_stats_skew int int int (fp) gsl_stats_skew ( array{ step size -- df ) -libgsl gsl_stats_kurtosis int int int (fp) gsl_stats_kurtosis ( array{ step size -- df ) -libgsl gsl_stats_lag1_autocorrelation int int int (fp) gsl_stats_lag1_autocorrelation -( array{ step size -- df ) -libgsl gsl_stats_max int int int (fp) gsl_stats_max ( array{ step size -- df ) -libgsl gsl_stats_min int int int (fp) gsl_stats_min ( array{ step size -- df ) -libgsl gsl_stats_max_index int int int (int) gsl_stats_max_index ( array{ step size -- n ) -libgsl gsl_stats_min_index int int int (int) gsl_stats_min_index ( array{ step size -- n ) - -\ vectors and matrices Wed Sep 14 00:15:36 MDT 2005 - -\ Vectors -libgsl gsl_block_alloc int (int) gsl_block_alloc ( n -- addr ) -libgsl gsl_block_calloc int (int) gsl_block_calloc ( n -- addr ) -libgsl gsl_block_free int (int) gsl_block_free ( n -- addr ) - -libgsl gsl_vector_alloc int (int) gsl_vector_alloc ( n -- addr ) -libgsl gsl_vector_calloc int (int) gsl_vector_calloc ( n -- addr ) -libgsl gsl_vector_alloc_from_vector int int int ptr (int) gsl_vector_alloc_from_vector -libgsl gsl_vector_free int (void) gsl_vector_free ( addr -- ) -libgsl gsl_vector_get int int (fp) gsl_vector_get ( addr i -- df ) -libgsl gsl_vector_set df int int (void/fp) gsl_vector_set ( df addr i -- ) -libgsl gsl_vector_set_all df int (void) gsl_vector_set_all ( df addr -- ) -libgsl gsl_vector_set_zero int (void) gsl_vector_set_zero ( addr -- ) -libgsl gsl_vector_memcpy int int (int) gsl_vector_memcpy ( dest_addr src_addr -- n ) - -libgsl gsl_vector_add int int (int) gsl_vector_add ( addr addr -- n ) -libgsl gsl_vector_sub int int (int) gsl_vector_sub ( addr addr -- n ) -libgsl gsl_vector_mul int int (int) gsl_vector_mul ( addr addr -- n ) -libgsl gsl_vector_div int int (int) gsl_vector_div ( addr addr -- n ) -libgsl gsl_vector_scale df int (int) gsl_vector_scale ( df addr -- n ) -libgsl gsl_vector_add_constant df int (int) gsl_vector_add_constant ( df addr -- n ) -libgsl gsl_vector_max int (fp) gsl_vector_max ( addr -- df ) -libgsl gsl_vector_min int (fp) gsl_vector_min ( addr -- df ) -libgsl gsl_vector_max_index int (fp) gsl_vector_max_index ( addr -- df ) -libgsl gsl_vector_min_index int (fp) gsl_vector_min_index ( addr -- df ) -libgsl gsl_vector_subvector int int int (int) gsl_vector_subvector -\ Vector properties -libgsl gsl_vector_isnull ptr (int) gsl_vector_isnull -libgsl gsl_vector_ispos ptr (int) gsl_vector_ispos -libgsl gsl_vector_isneg ptr (int) gsl_vector_isneg - -\ permutations -libgsl gsl_permutation_alloc int (int) gsl_permutation_alloc ( n -- *gsl_prm) -libgsl gsl_permutation_calloc int (int) gsl_permutation_calloc ( n -- *gsl_prm) -libgsl gsl_permutation_init int (void) gsl_permutation_init ( *gsl_prm -- ) -libgsl gsl_permutation_free int (void) gsl_permutation_free ( *gsl_prm -- ) -libgsl gsl_permutation_get int int (int) gsl_permutation_get ( *gsl_prm i -- n) - -\ Matrices -\ Allocation -libgsl gsl_matrix_alloc int int (int) gsl_matrix_alloc -libgsl gsl_matrix_calloc int int (int) gsl_matrix_calloc -libgsl gsl_matrix_alloc_from_block [ 5 ] ints (int) gsl_matrix_alloc_from_block -libgsl gsl_matrix_alloc_from_matrix [ 5 ] ints (int) gsl_matrix_alloc_from_matrix -libgsl gsl_matrix_free ( *gsl_matrix -- ) int (void) gsl_matrix_free -\ Accessing matrix elements -libgsl gsl_matrix_get int int int (fp) gsl_matrix_get ( *m i j -- df ) -libgsl gsl_matrix_set df int int int (void) gsl_matrix_set ( df *m i j -- ) -libgsl gsl_matrix_ptr int int int (int) gsl_matrix_ptr ( *m i j -- *[i,j] ) -\ Initializing matrix elements -libgsl gsl_matrix_set_all df int (void) gsl_matrix_set_all ( *m df -- n ) -libgsl gsl_matrix_set_zero df int (void) gsl_matrix_set_zero ( *m df -- n ) -libgsl gsl_matrix_set_identity df int (void) gsl_matrix_set_identity ( *m df -- n ) -\ Reading and writing matrices -libgsl gsl_matrix_fwrite ptr ptr (int) gsl_matrix_fwrite -libgsl gsl_matrix_fread ptr ptr (int) gsl_matrix_fread -libgsl gsl_matrix_fprintf ptr ptr ptr (int) gsl_matrix_fprintf -libgsl gsl_matrix_fscanf ptr ptr (int) gsl_matrix_fscanf -\ Copying matrices -libgsl gsl_matrix_memcpy int int (int) gsl_matrix_memcpy ( *m *m -- n ) -libgsl gsl_matrix_swap int int (int) gsl_matrix_swap ( *m *m -- n ) -\ Copying Rows and columns -libgsl gsl_matrix_get_row int int int (int) gsl_matrix_get_row -libgsl gsl_matrix_set_row int int int (int) gsl_matrix_set_row -libgsl gsl_matrix_get_col int int int (int) gsl_matrix_get_col -libgsl gsl_matrix_set_col int int int (int) gsl_matrix_set_col -\ Exchanging rows and columns -libgsl gsl_matrix_swap_rows int int ptr (int) gsl_matrix_swap_rows -libgsl gsl_matrix_swap_columns int int ptr (int) gsl_matrix_swap_columns -libgsl gsl_matrix_swap_rowcol int int ptr (int) gsl_matrix_swap_rowcol -libgsl gsl_matrix_transpose_memcpy int int (int) gsl_matrix_transpose_memcpy -libgsl gsl_matrix_transpose int (int) gsl_matrix_transpose -\ Matrix operations -libgsl gsl_matrix_add int int (int) gsl_matrix_add -libgsl gsl_matrix_sub int int (int) gsl_matrix_sub -libgsl gsl_matrix_mul_elements int int (int) gsl_matrix_mul_elements -libgsl gsl_matrix_div_elements int int (int) gsl_matrix_div_elements -libgsl gsl_matrix_scale df int (int) gsl_matrix_scale -libgsl gsl_matrix_add_constant df int (int) gsl_matrix_add_constant -\ Finding maximum and minimum elements of matrices -libgsl gsl_matrix_max ptr (fp) gsl_matrix_max -libgsl gsl_matrix_min ptr (fp) gsl_matrix_min -libgsl gsl_matrix_minmax ptr ptr ptr (void) gsl_matrix_minmax -libgsl gsl_matrix_min_index ptr ptr ptr (void) gsl_matrix_min_index -libgsl gsl_matrix_max_index ptr ptr ptr (void) gsl_matrix_max_index -libgsl gsl_matrix_minmax_index ptr ptr ptr ptr ptr (void) gsl_matrix_minmax_index -\ Matrix properties -libgsl gsl_matrix_isnull ptr (int) gsl_matrix_isnull -libgsl gsl_matrix_ispos ptr (int) gsl_matrix_ispos -libgsl gsl_matrix_isneg ptr (int) gsl_matrix_isneg -\ libgsl gsl_matrix_isnonneg ptr (int) gsl_matrix_isnonneg - - -libgsl gsl_matrix_submatrix int int int int int (int) gsl_matrix_submatrix ( *gsl_matrix k1 k2 n1 n2 -- n ) -libgsl gsl_matrix_row int int (int) gsl_matrix_row ( *gsl_matrix idx -- *gsl_vector ) -libgsl gsl_matrix_column int int (int) gsl_matrix_column ( *gsl_matrix idx -- *gsl_vector ) -libgsl gsl_matrix_diagonal int (int) gsl_matrix_diagonal ( *gsl_matrix -- *gsl_vector ) - - -\ BLAS Wed Sep 14 16:10:34 MDT 2005 -\ libblas cblas_dgemm int int df int int int -\ int df int int int int int int (void/fp) cblas_dgemm -libblas cblas_dgemv int int int int df int -int df int int int int (void/fp) cblas_dgemv -libgsl gsl_blas_ddot int int int (int) gsl_blas_ddot -( *gsl_vector *gsl_vector df -- n ) -libgsl gsl_blas_dgemm int df int int df int int (int/fp) gsl_blas_dgemm -libgsl gsl_blas_dger int int int df (int/fp) gsl_blas_dger -( alpha *gsl_vector *gsl_vector *gsl_matrix -- n ) ( A=\alpha x y^T+A ) -libgsl gsl_blas_dgemv int df int int df int (int/fp) gsl_blas_dgemv -( n alpha *gsl_matrix *gsl_vector beta *gsl_vector -- n ) - -\ Linear ALgebra Wed Sep 14 13:39:22 MDT 2005 - -libgsl gsl_linalg_LU_decomp int int int (int) gsl_linalg_LU_decomp -( *gsl_matrix *gsl_permutation *variable -- n ) -libgsl gsl_linalg_LU_invert int int int (int) gsl_linalg_LU_invert -( *gsl_matrix *gsl_permutation *gsl_matrix -- n ) -libgsl gsl_linalg_SV_decomp int int int int (int) gsl_linalg_SV_decomp -( *gsl_matrix *gsl_matrix *gsl_vector *gsl_vector -- n ) -libgsl gsl_linalg_SV_decomp_mod int int int int int (int) gsl_linalg_SV_decomp_mod -( *gsl_matrix *gsl_matrix *gsl_matrix *gsl_vector *gsl_vector -- n ) - -\ ----------------------------------------------------------------------------- -\ *** Ordinary Differential Equations *** -\ --- ODE system -struct{ - cell func \ (* function) - \ (double t, const double y[], double dydt[], void * params); - cell jac \ (* jacobian) - \ (double t, const double y[], double * dfdy, double dfdt[], - \ void * params); - cell dim \ dimension; - cell params \ * params; -} gsl_odeiv_system -\ constants related to ODE - 1 constant GSL_ODEIV_HADJ_INC - 0 constant GSL_ODEIV_HADJ_NIL --1 constant GSL_ODEIV_HADJ_DEC - -callback gsl_odeiv_func4:1 (int) df int int int callback; -callback gsl_odeiv_jac5:1 (int) df int int int int callback; - -\ --- Stepping Functions -libgsl gsl_odeiv_step_alloc ptr int (ptr) gsl_odeiv_step_alloc -( *step_type int -- *step ) -libgsl gsl_odeiv_step_reset ptr (int) gsl_odeiv_step_reset ( *step -- r ) -libgsl gsl_odeiv_step_free ptr (void) gsl_odeiv_step_free ( *step -- ) -libgsl gsl_odeiv_step_name ptr (ptr) gsl_odeiv_step_name ( *step -- *str0 ) -libgsl gsl_odeiv_step_order ptr (int) gsl_odeiv_step_order ( *step -- order) -libgsl gsl_odeiv_step_apply int int int int int df df int (int) gsl_odeiv_step_apply -( -- ) -\ --- Available algorithms -libgsl _gsl_odeiv_step_rk2 (int) gsl_odeiv_step_rk2 -libgsl _gsl_odeiv_step_rk4 (int) gsl_odeiv_step_rk4 -libgsl _gsl_odeiv_step_rkf45 (int) gsl_odeiv_step_rkf45 -libgsl _gsl_odeiv_step_rkck (int) gsl_odeiv_step_rkck -libgsl _gsl_odeiv_step_rk8pd (int) gsl_odeiv_step_rk8pd -libgsl _gsl_odeiv_step_rk2imp (int) gsl_odeiv_step_rk2imp -libgsl _gsl_odeiv_step_rk4imp (int) gsl_odeiv_step_rk4imp -libgsl _gsl_odeiv_step_bsimp (int) gsl_odeiv_step_bsimp -libgsl _gsl_odeiv_step_gear1 (int) gsl_odeiv_step_gear1 -libgsl _gsl_odeiv_step_gear2 (int) gsl_odeiv_step_gear2 - -: gsl_odeiv_step_rk2 [func'] _gsl_odeiv_step_rk2 @ ; -: gsl_odeiv_step_rk4 [func'] _gsl_odeiv_step_rk4 @ ; -: gsl_odeiv_step_rkf45 [func'] _gsl_odeiv_step_rkf45 @ ; -: gsl_odeiv_step_rkck [func'] _gsl_odeiv_step_rkck @ ; -: gsl_odeiv_step_rk8pd [func'] _gsl_odeiv_step_rk8pd @ ; -: gsl_odeiv_step_rk2imp [func'] _gsl_odeiv_step_rk2imp @ ; -: gsl_odeiv_step_rk4imp [func'] _gsl_odeiv_step_rk4imp @ ; -: gsl_odeiv_step_bsimp [func'] _gsl_odeiv_step_bsimp @ ; -: gsl_odeiv_step_gear1 [func'] _gsl_odeiv_step_gear1 @ ; -: gsl_odeiv_step_gear2 [func'] _gsl_odeiv_step_gear2 @ ; - -\ --- Adaptive Step-size Control -libgsl gsl_odeiv_control_standard_new df df df df (ptr) gsl_odeiv_control_standard_new ( a_dydt a_y eps_rel eps_abs -- *control ) -libgsl gsl_odeiv_control_y_new df df (int) gsl_odeiv_control_y_new -( eps_abs eps_rel -- *control ) -libgsl gsl_odeiv_control_yp_new df df (ptr) gsl_odeiv_control_yp_new -( eps_abs eps_rel -- *control ) -libgsl gsl_odeiv_control_free ptr (void) gsl_odeiv_control_free ( *control -- ) -libgsl gsl_odeiv_control_name ptr (ptr) gsl_odeiv_control_name ( *c -- *str0 ) - -\ --- Evolution -libgsl gsl_odeiv_evolve_alloc int (int) gsl_odeiv_evolve_alloc -( #dimensions -- evolution_func ) -libgsl gsl_odeiv_evolve_apply int int df int int int int int (int) gsl_odeiv_evolve_apply -( -- ) -libgsl gsl_odeiv_evolve_reset ptr (int) gsl_odeiv_evolve_reset ( *e -- r ) -libgsl gsl_odeiv_evolve_free ptr (void) gsl_odeiv_evolve_free ( *e -- ) -\ ----------------------------------------------------------------------------- -\ *** Fast Fourier Transform *** -\ -- real -libgsl gsl_fft_real_wavetable_alloc int (ptr) gsl_fft_real_wavetable_alloc -libgsl gsl_fft_real_wavetable_free ptr (void) gsl_fft_real_wavetable_free -libgsl gsl_fft_real_workspace_alloc int (ptr) gsl_fft_real_workspace_alloc -libgsl gsl_fft_real_workspace_free ptr (void) gsl_fft_real_workspace_free -\ in-place -libgsl gsl_fft_real_transform ptr int int ptr ptr (int) gsl_fft_real_transform -libgsl gsl_fft_real_unpack ptr ptr int int (int) gsl_fft_real_unpack - -\ -- halfcomplex -\ - mixed radix -libgsl gsl_fft_hc_wtbl_alloc int (ptr) gsl_fft_halfcomplex_wavetable_alloc -libgsl gsl_fft_hc_wtbl_free ptr (void) gsl_fft_halfcomplex_wavetable_free -libgsl gsl_fft_hc_backward ptr int int ptr ptr (int) gsl_fft_halfcomplex_backward -libgsl gsl_fft_hc_inverse ptr int int ptr ptr (int) gsl_fft_halfcomplex_inverse -libgsl gsl_fft_hc_transform ptr int int ptr ptr (int) gsl_fft_halfcomplex_transform -libgsl gsl_fft_hc_unpack ptr ptr int int (int) gsl_fft_halfcomplex_unpack -\ - radix2 -libgsl gsl_fft_hc_r2_unpack ptr ptr int int (int) gsl_fft_halfcomplex_radix2_unpack -libgsl gsl_fft_hc_r2_backward ptr int int (int) gsl_fft_halfcomplex_radix2_backward -libgsl gsl_fft_hc_r2_inverse ptr int int (int) gsl_fft_halfcomplex_radix2_inverse -libgsl gsl_fft_hc_r2_transform ptr int int (int) gsl_fft_halfcomplex_radix2_transform - - -| hashlen 32 vector fftpre( -struct{ - cell next - cell size - cell workspace - cell r_wavetable - cell hc_wavetable -} gsl_fft_precomputes -| create $buf 255 allot -| : 2str dup >r abs s>d <# #s r> sign #> $buf 0place ; -| : s>hash ( n -- key ) 2str $buf hash ; -| : (cache-fft) ( n -- addr ) - sizeof gsl_fft_precomputes allocate throw >r - 0 r@ gsl_fft_precomputes next ! - dup r@ gsl_fft_precomputes size ! - dup gsl_fft_real_workspace_alloc r@ gsl_fft_precomputes workspace ! - dup gsl_fft_real_wavetable_alloc r@ gsl_fft_precomputes r_wavetable ! - gsl_fft_hc_wtbl_alloc r@ gsl_fft_precomputes hc_wavetable ! - r> ; -| : cache-fft ( size -- addr ) - dup s>hash - fftpre( over )@ 0= if - swap (cache-fft) - fftpre( rot dup >r )! - fftpre( r> )@ - else - swap (cache-fft) - swap fftpre( over )@ - over gsl_fft_precomputes next ! - fftpre( rot dup >r )! - fftpre( r> )@ - then ; -\ in case not found addr is just the size -| : find-fft-cache ( n -- addr 0/1 ) - dup s>hash fftpre( swap )@ dup - begin while - 2dup gsl_fft_precomputes size @ = - if nip true exit then - gsl_fft_precomputes next @ dup - repeat ; - -legacy on - -\ Structures - -struct{ - cell name - cell max - cell min - cell size - cell set - cell get - cell get_double -} gsl_rng_type - -struct{ - cell type - cell state -} gsl_rng - -struct{ - cell size - cell data -} gsl_block - -struct{ - cell size - cell stride - cell data - cell block - cell owner -} gsl_vector - -' gsl_block alias gsl_permutation - -struct{ - cell size1 - cell size2 - cell tda - cell data - cell block - cell owner -} gsl_matrix - -\ random number generation functions -: 0-len dup 1- 0 begin 1+ 2dup + c@ 0= until nip ; -: )gsl-rng ( addr i -- *gsl_rng_type ) - cells + @ ; - -\ setting up all available random number generators -gsl_rng_types_setup value gsl_rng_array( -0 value gsl_rng_default -: gsl-free ( -- ) - gsl_rng_default gsl_rng_free ; - -: borosh13 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 0 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: cmrg ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 1 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: coveyou ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 2 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: fishman18 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 3 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: fishman20 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 4 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: fishman2x ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 5 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: gfsr4 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 6 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: knuthran ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 7 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: knuthran2 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 8 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: lecuyer21 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 9 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: minstd ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 10 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: mrg ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 11 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: mt19937 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 12 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: mt19937_1999 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 13 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: mt19937_1998 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 14 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: r250 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 15 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: ran0 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 16 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: ran1 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 17 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: ran2 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 18 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: ran3 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 19 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: rand ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 20 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: rand48 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 21 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random128-bsd ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 22 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random128-glibc2 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 23 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random128-libc5 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 24 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random256-bsd ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 25 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random256-glibc2 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 26 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random256-libc5 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 27 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random32-bsd ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 28 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random32-glibc2 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 29 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random32-libc5 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 30 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random64-bsd ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 31 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random64-glibc2 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 32 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random64-libc5 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 33 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random8-bsd ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 34 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random8-glibc2 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 35 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random8-libc5 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 36 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random-bsd ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 37 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random-glibc2 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 38 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: random-libc5 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 39 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: randu ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 40 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: ranf ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 41 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: ranlux ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 42 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: ranlux389 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 43 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: ranlxd1 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 44 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: ranlxd2 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 45 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: ranlxs0 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 46 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: ranlxs1 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 47 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: ranlxs2 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 48 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: ranmar ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 49 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: slatec ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 50 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: taus ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 51 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: taus2 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 52 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: taus113 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 53 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: transputer ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 54 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: tt800 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 55 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: uni ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 56 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: uni32 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 57 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: vax ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 58 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: waterman14 ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 59 )gsl-rng gsl_rng_alloc to gsl_rng_default ; -: zuf ( -- *gsl_rng ) gsl_rng_default 0<> if gsl-free then - gsl_rng_array( 60 )gsl-rng gsl_rng_alloc to gsl_rng_default ; - -\ words for actual generation of random numbers -: gsl-randomg ( -- n ) - gsl_rng_default gsl_rng_get ; -: gsl-randomu /* -- f \in [0,1) */ - gsl_rng_default gsl_rng_uniform ; -: gsl-randomu+ /* -- f \in (0,1) */ - gsl_rng_default gsl_rng_uniform_pos ; -: gsl-random-up ( n -- f \in [0,n] ) - gsl_rng_default swap gsl_rng_uniform_int ; -: gsl-set-seed ( n -- ) - gsl_rng_default swap gsl_rng_set ; -: gsl-clone ( -- *gsl_rng ) - gsl_rng_default gsl_rng_clone ; -: gsl-gaussian ( -- df ) - gsl_rng_default !1 gsl_ran_gaussian ; -: gsl-discrete ( *gsl_ran_discrete -- n ) - gsl_rng_default swap gsl_ran_discrete ; - -\ vectors and matrices -0 constant GSL_VECTOR_TYPE -1 constant GSL_MATRIX_TYPE -: gsltypeof ' >body cell + @ ; - -: fvector ( n -- | -- id addr ) - create - gsl_vector_calloc , - GSL_VECTOR_TYPE , - does> @ ; - -\ allocate a nameless vector -: :] ( # -- addr ) gsl_vector_calloc ; -\ allocate a nameless matrix -: :]] ( # # -- addr ) gsl_matrix_calloc ; - -: ]@ ( addr i -- df ) gsl_vector_get ; -: ]! ( df addr i -- ) gsl_vector_set ; -: ]data ( addr -- *data ) gsl_vector data @ ; -: ]stride ( addr -- *data ) gsl_vector stride @ ; -: ]fill ( df addr -- ) gsl_vector_set_all ; -: ]erase ( addr -- ) gsl_vector_set_zero ; -: ]+ ( *gsl_vector *gsl_vector -- ) gsl_vector_add drop ; -: ]- ( *gsl_vector *gsl_vector -- ) gsl_vector_sub drop ; -: ]e*! ( *gsl_vector *gsl_vector -- ) gsl_vector_mul drop ; -: ]size ( *gsl_vector -- n ) gsl_vector size @ ; -: ]outer* ( *gsl_vector *gsl_vector -- *gsl_matrix ) - over ]size over ]size gsl_matrix_calloc dup >r !1 - gsl_blas_dger drop r> ; -\ no control for divizion by zero (I get segfaults) -: ]/ ( *gsl_vector *gsl_vector -- ) gsl_vector_div throw ; -: ]clone ( *gsl_vector -- *gsl_vector ) - dup gsl_vector size @ gsl_vector_alloc - dup -rot swap gsl_vector_memcpy drop ; - -: ]add ( *gsl_vector *gsl_vector -- *gsl_vector ) - ]clone dup -rot swap ]+ ; -: ]sub ( *gsl_vector *gsl_vector -- *gsl_vector ) - swap ]clone dup -rot swap ]- ; -: ]mul ( *gsl_vector *gsl_vector -- *gsl_vector ) - swap ]clone dup -rot swap ]e*! ; -: ]div ( *gsl_vector *gsl_vector -- *gsl_vector ) - swap ]clone dup -rot swap ]/ ; - -: ]*c ( df *gsl_vector -- ) gsl_vector_scale drop ; -: ]+c ( df *gsl_vector -- ) gsl_vector_add_constant drop ; -: ]max ( *gsl_vector -- ) gsl_vector_max ; -: ]min ( *gsl_vector -- ) gsl_vector_min ; -: ]imax ( *gsl_vector -- ) gsl_vector_max_index ; -: ]imin ( *gsl_vector -- ) gsl_vector_min_index ; -: ]copy] ( *gsl_vector_dest *gsl_vector_src -- ) gsl_vector_memcpy drop ; -: ]negate !-1.0 ]*c ; -: ]ones ( n -- *gsl_vector ) :] dup 1e ]fill ; - -: ]]slice ( *gsl_matrix x y n m -- *gsl_matrix ) - gsl_matrix_alloc_from_matrix ; -: ]slice ( *gsl_vector offset length stride -- *gsl_vector ) - gsl_vector_alloc_from_vector ; - -: ]null? ( *gsl_vector -- 0/-1 ) gsl_vector_isnull negate ; -: ]pos? ( *gsl_vector -- 0/-1 ) gsl_vector_ispos negate ; -: ]neg? ( *gsl_vector -- 0/-1 ) gsl_vector_isneg negate ; - -\ FFT 19jan08sp -: ]fft! ( *gsl_vector -- ) - dup ]size >r dup ]stride >r ]data r> r> - dup find-fft-cache if - dup gsl_fft_precomputes r_wavetable @ - swap gsl_fft_precomputes workspace @ - else - drop - dup cache-fft - dup gsl_fft_precomputes r_wavetable @ - swap gsl_fft_precomputes workspace @ - then - gsl_fft_real_transform throw ; -: ]fft ( *gsl_vector -- *gsl_vector ) - ]clone dup ]fft! ; -: ]ifft! ( *gsl_vector -- ) - dup ]size >r dup ]stride >r ]data r> r> - dup find-fft-cache if - dup gsl_fft_precomputes hc_wavetable @ - swap gsl_fft_precomputes workspace @ - else - drop - dup cache-fft - dup gsl_fft_precomputes hc_wavetable @ - swap gsl_fft_precomputes workspace @ - then - gsl_fft_hc_inverse throw ; -: ]ifft ( *gsl_vector -- *gsl_vector ) - ]clone dup ]ifft! ; -\ multiply two half complex vectors -\ store result in the first -: ]hc*! ( *gsl_vector *gsl_vector -- ) - 2dup 0 ]@ 0 ]@ f* over 0 ]! - dup ]size dup %1 and not + 1 do - 2dup - dup i ]@ i 1+ ]@ - dup i ]@ i 1+ ]@ z* - over dup i 1+ ]! i ]! - 2 +loop - dup ]size %1 and not if - 2dup - dup ]size 1- dup >r ]@ dup r@ ]@ f* r> ]! - then - 2drop ; - -\ pseudomatrices and vectors -: pvector ( *data n -- *gsl_vector ) - sizeof gsl_vector allocate throw - dup >r dup 1 swap gsl_vector stride ! - gsl_vector size ! r@ - gsl_vector data ! r@ - 0 swap gsl_vector owner ! r> ; - -: pmatrix! ( *data tda n m *pmatrix -- *gsl_matrix ) - dup >r gsl_matrix size2 ! - r@ gsl_matrix size1 ! - r@ gsl_matrix tda ! - r@ gsl_matrix data ! - 0 r@ gsl_matrix owner ! - r> ; - -: pmatrix ( *data tda n m -- *gsl_matrix ) - sizeof gsl_matrix allocate throw - dup 0 swap gsl_matrix owner ! - pmatrix! ; - -\ permutations - -: fpermutation ( n -- | -- id addr ) - create - gsl_permutation_calloc , - does> @ ; -: }@ ( *gsl_permutation i -- n ) gsl_permutation_get ; -: }data ( *gsl_permutation -- *data ) gsl_block data @ ; -: }size ( *gsl_permutation -- *data ) gsl_block size @ ; -: }free ( *gsl_permutation -- ) gsl_permutation_free ; -: }sign ( *gsl_permutation -- 1/-1 ) - 1 over dup }size 0 do - dup i }@ i <> if swap negate swap then - loop drop ; - -\ matrices - -: fmatrix ( n m -- | -- id addr ) - create - gsl_matrix_calloc , - GSL_MATRIX_TYPE , - does> @ ; - -: free_pseudomatrix ( pmatrix/pvector -- ) free throw ; - -create free_matrix ' free_pseudomatrix , ' gsl_matrix_free , -create free_vector ' free_pseudomatrix , ' gsl_vector_free , - -: ]]free ( *gsl_matrix -- ) - dup gsl_matrix owner @ - cells free_matrix + @ execute ; -: ]free ( addr -- ) - dup gsl_vector owner @ - cells free_vector + @ execute ; -: ]]@ ( *gsl_matrix i j -- df ) gsl_matrix_get ; -: ]]*@ ( *gsl_matrix i j -- *[i,j] ) gsl_matrix_ptr ; -: ]]! ( *gsl_matrix i j df -- ) gsl_matrix_set ; -: ]]fill ( addr df -- ) gsl_matrix_set_all ; -: ]]size1 gsl_matrix size1 @ ; -: ]]size2 gsl_matrix size2 @ ; -: ]]dim ( *gsl_matrix -- m n ) dup ]]size1 swap ]]size2 ; -: ]]dim. ( *gsl_matrix -- ) ]]dim swap . ." x" . cr ; -: ]]data ( *gsl_matrix -- addr) gsl_matrix data @ ; -: ]]tda gsl_matrix tda @ ; -: ]]block gsl_matrix block @ ; -: ]]owner gsl_matrix owner @ ; -: ]]copy]] ( *gsl_matrix_dest *gsl_matrix_src -- ) gsl_matrix_memcpy drop ; -: ]]'copy]] ( *gsl_matrix_dest *gsl_matrix_src -- ) gsl_matrix_transpose_memcpy drop ; -\ : ]]row ( *gsl_matrix idx -- *gsl_vector ) gsl_matrix_row ; -\ : ]]col ( *gsl_matrix idx -- *gsl_vector ) gsl_matrix_column ; -: ]]>] ( *gsl_vector *gsl_matrix i -- ) gsl_matrix_get_col drop ; -: ]]>]' ( *gsl_vector *gsl_matrix i -- ) gsl_matrix_get_row drop ; -: ]>]] ( *gsl_matrix *gsl_vector i -- ) swap gsl_matrix_set_col drop ; -: ]'>]] ( *gsl_matrix *gsl_vector i -- ) swap gsl_matrix_set_row drop ; - -: ]]max gsl_matrix_max ; -: ]]min gsl_matrix_min ; -: ]]add! ( *gsl_matrix *gsl_matrix -- ) - gsl_matrix_add drop ; -: ]]sub! ( *gsl_matrix *gsl_matrix -- ) - gsl_matrix_sub drop ; -: ]]e*! ( *gsl_matrix *gsl_matrix -- ) - gsl_matrix_mul_elements drop ; -: ]]*c ( *gsl_matrix df -- ) - gsl_matrix_scale drop ; -: ]]+c ( df *gsl_matrix -- ) gsl_matrix_add_constant drop ; -: ]]clone ( *gsl_matrix -- *gsl_matrix ) - dup dup gsl_matrix size1 @ swap gsl_matrix size2 @ - gsl_matrix_alloc - dup -rot swap gsl_matrix_memcpy drop ; -: ]]negate !-1.0 ]]*c ; - -: ]]+ ( *gsl_matrix *gsl_matrix -- *gsl_matrix ) - ]]clone dup -rot swap ]]add! ; - -: ]]- ( *gsl_matrix *gsl_matrix -- *gsl_matrix ) - swap ]]clone dup -rot swap ]]sub! ; -: ]]null? ( *gsl_matrix -- 0/-1 ) gsl_matrix_isnull negate ; -: ]]pos? ( *gsl_matrix -- 0/-1 ) gsl_matrix_ispos negate ; -: ]]neg? ( *gsl_matrix -- 0/-1 ) gsl_matrix_isneg negate ; - -\ blas - -\ constants -101 Constant CblasRowMajor -102 Constant CblasColMajor -111 Constant CblasNoTrans -112 Constant CblasTrans -113 Constant CblasConjTrans -121 Constant CblasUpper -122 Constant CblasLower -131 Constant CblasNonUnit -132 Constant CblasUnit -141 Constant CblasLeft -142 Constant CblasRight - -: action? ( *gsl_matrix *gsl_matrix n n n -- ) - dup 0= if - drop - 2swap 2dup - ]]size2 swap ]]size1 swap - exit - then - dup 1 = if - drop - 2swap 2dup - ]]size2 swap ]]size2 swap - exit - then - 2 = if - 2swap 2dup - ]]size1 swap ]]size1 swap - exit - then - 3 = if - 2swap 2dup - ]]size1 swap ]]size2 swap - exit - then ; - -create samemattable ' noop , ' ]]clone , -: samemat ( *gsl_matrix *gsl_matrix -- 1/0 *gsl_matrix ) - dup -rot = abs dup -rot cells samemattable + @ execute ; macro - -: ]]mul ( *gsl_matrix *gsl_matrix n n n -- *gsl_matrix ) - !1 !0 action? - gsl_matrix_alloc dup >r - gsl_blas_dgemm drop r> ; -: ]]* ( *gsl_matrix *gsl_matrix -- *gsl_matrix ) - 2dup samemat dup rot 2>r nip - CblasNoTrans CblasNoTrans 0 ]]mul - 2r> if ]]free else drop then ; -: ]]'* ( *gsl_matrix *gsl_matrix -- *gsl_matrix ) - 2dup samemat dup rot 2>r nip - CblasTrans CblasNoTrans 1 ]]mul - 2r> if ]]free else drop then ; -: ]]*' ( *gsl_matrix *gsl_matrix -- *gsl_matrix ) - 2dup samemat dup rot 2>r nip - CblasNoTrans CblasTrans 2 ]]mul - 2r> if ]]free else drop then ; -: ]]'*' ( *gsl_matrix *gsl_matrix -- *gsl_matrix ) - 2dup samemat dup rot 2>r nip - CblasTrans CblasTrans 3 ]]mul - 2r> if ]]free else drop then ; - -: ]]mul! ( n n *gsl_matrix *gsl_matrix *gsl_matrix -- ) - !1 !0 gsl_blas_dgemm drop ; -: ]]*! ( *gsl_matrix *gsl_matrix *gsl_matrix -- ) - >r CblasNoTrans CblasNoTrans 2swap r> ]]mul! ; -: ]]'*! ( *gsl_matrix *gsl_matrix *gsl_matrix -- ) - >r CblasTrans CblasNoTrans 2swap r> ]]mul! ; -: ]]*'! ( *gsl_matrix *gsl_matrix *gsl_matrix -- ) - >r CblasNoTrans CblasTrans 2swap r> ]]mul! ; - - -: ]]*] ( *gsl_matrix *gsl_vector -- *gsl_vector ) - over ]]size1 gsl_vector_alloc >r - CblasNoTrans -rot r@ !1 !0 gsl_blas_dgemv drop r> ; -: ]]'*] ( *gsl_matrix *gsl_vector -- *gsl_vector ) - over ]]size1 gsl_vector_alloc >r - CblasTrans -rot r@ !1 !0 gsl_blas_dgemv drop r> ; - -: ]]i ( *gsl_matrix -- ) - dup dup ]]size1 swap ]]size2 <> if - abort" ERROR: Not a square matrix!" - then - dup ]]size1 0 do - dup i i !1 ]]! - loop drop ; -: identity ( n -- *gsl_matrix ) - dup gsl_matrix_calloc dup ]]i ; -: min-identity ( *gsl_matrix -- *gsl_matrix ) - dup ]]size1 swap ]]size2 min identity ; -: left/right' ( *gsl_matrix *gsl_matrix -- *gsl_matrix ) - over ]]size1 over ]]size1 > if - swap ]]*' exit - else - ]]'* exit - then ; - -\ original matrix remains intact -: ]]' ( *gsl_matrix -- *gsl_matrix ) - dup min-identity dup >r - left/right' - r> ]]free ; -: ]]T! ( *gsl_matrix -- ) - gsl_matrix_transpose drop ; - -: ]]T ( *gsl_matrix -- *gsl_matrix ) - dup ]]dim swap gsl_matrix_alloc dup rot gsl_matrix_transpose_memcpy drop ; - -: ]]2T ( *gsl_matr *gsl_matrix -- ) - gsl_matrix_transpose_memcpy drop ; - -: ]]+! ( *gsl_matrix i j df -- ) >r 2dup r@ ]]@ f+ r> ]]! ; -: ]]scale! ( *gsl_matrix i j df -- ) >r 2dup r@ ]]@ f* r> ]]! ; -: ]]data_ij ( *gsl_matrix i j -- addr) - rot >r swap r@ ]]tda dfloats * swap dfloats + r> ]]data + ; -\ Cross product can be either calculated through determinant: -: ]x ( *gsl_vector *gsl_vector -- *gsl_vector ) - 3 gsl_vector_alloc - { x1[ x2[ x3[ | - x1[ 2 ]@ fnegate x2[ 1 ]@ f* x1[ 1 ]@ x2[ 2 ]@ f* f+ x3[ 0 ]! - x1[ 2 ]@ x2[ 0 ]@ f* x1[ 0 ]@ fnegate x2[ 2 ]@ f* f+ x3[ 1 ]! - x1[ 1 ]@ fnegate x2[ 0 ]@ f* x1[ 0 ]@ x2[ 1 ]@ f* f+ x3[ 2 ]! - x3[ } ; -\ or using algebraic form when first vector in the product is -\ rewritten in a matrix form: -\ a x b = [C_a] b -\ [ 0 -a[2] a[1] ] -\ [C_a] = [ a[2] 0 -a[0] ] -\ [-a[1] a[0] 0 ] -\ a function to convert a vector into such matrix: -: ]>[x] ( ] -- ]] ) - [IFDEF] debug - dup ]size 3 <> abort" Not a 3D vector!" - [THEN] - 3 3 :]] dup >r - swap 2dup 2 ]@ fdup dup fnegate 0 1 ]]! 1 0 ]]! - 2dup 1 ]@ fdup dup fnegate 2 0 ]]! 0 2 ]]! - 0 ]@ fdup dup fnegate 1 2 ]]! 2 1 ]]! r> ; -: ]. ( *gsl_vector *gsl_vector -- f:dot_product ) - { x1[ x2[ | - 0 0 sp@ x1[ x2[ rot gsl_blas_ddot drop fd>f } ; -: ]total ( *gsl_vector -- f:sum ) - dup ]size gsl_vector_alloc dup !1 ]fill dup rot ]. ]free ; -\ probability normalize - assures sum is unity -: ]pnormalize ( *gsl_vector - ) - dup ]total 1/f ]*c ; -: |]| ( *gsl_vector -- f:norm ) dup ]. fsqrt ; -\ assures vector norm is unity -: ]normalize ( *gsl_vector - ) - dup |]| 1/f ]*c ; -: ]distance ( *gsl-vector *gsl-vector -- f ) - ]sub dup |]| ]free ; -: ]+! ( *gsl_vector i df -- ) - 2dup ]@ f+ ]! ; -: ]*! ( *gsl_vector i df -- ) - 2dup ]@ f* ]! ; - -: ]]*]m ( *gsl_matrix *gsl_vector -- *gsl_vector ) - over ]]size1 gsl_vector_calloc - { m[[ x[ y[ | - m[[ ]]size1 0 do - m[[ ]]size2 0 do - m[[ j i ]]@ x[ i ]@ f* y[ j ]+! - loop - loop y[ } ; - -: >#rows ( -- ) - swap ]]size1 >= abort" number of rows is bigger than available!" ; -: >#cols ( -- ) - swap ]]size2 >= abort" number of columns is bigger than available!" ; - -: ]]row ( *gsl_matrix n -- *gsl_vector ) - 2dup >#rows - sizeof gsl_vector allocate throw - dup 1 swap gsl_vector stride ! >r - over ]]size2 r@ gsl_vector size ! - 0 ]]data_ij r@ gsl_vector data ! - 0 r@ gsl_vector owner ! r> ; -\ assumes all dimensions are set correctly -: ]]row! ( *gsl_vector *gsl_matrix n -- ) - rot >r 2dup >#rows 0 ]]data_ij r> gsl_vector data ! ; -: ]]col ( *gsl_matrix n -- *gsl_vector ) - 2dup >#cols - sizeof gsl_vector allocate throw >r - over ]]tda r@ gsl_vector stride ! - over ]]size1 r@ gsl_vector size ! - over ]]block r@ gsl_vector block ! - 0 swap ]]data_ij r@ gsl_vector data ! - 0 r@ gsl_vector owner ! r> ; -: ]]rfill ( f:n *gsl_matrix i -- ) ]]row dup ]fill ]free ; -: ]]cfill ( f:n *gsl_matrix i -- ) ]]col dup ]fill ]free ; - - -: ]]submat ( *gsl_matrix n1 n2 m1 m2 -- *gsl_matrix ) - { m[[ n1 n2 m1 m2 | - sizeof gsl_matrix allocate throw >r - n2 n1 - 1+ r@ gsl_matrix size1 ! - m2 m1 - 1+ r@ gsl_matrix size2 ! - m[[ n1 m1 ]]data_ij r@ gsl_matrix data ! - m[[ ]]tda r@ gsl_matrix tda ! - 0 r@ gsl_matrix owner ! r> } ; - -: ?square ( *gsl_matrix -- ) - dup ]]size1 swap ]]size2 <> abort" ERROR: Not a square matrix!" ; -: ]]diag ( *gsl_matrix n1 n2 -- *gsl_vector ) - rot dup ?square -rot - sizeof gsl_vector allocate throw { d[ | - over - d[ gsl_vector size ! - 2dup dup ]]data_ij d[ gsl_vector data ! drop - dup ]]tda d[ gsl_vector stride ! - ]]block d[ gsl_vector block ! - 0 d[ gsl_vector owner ! - d[ } ; - -\ with input matrix replaced by the result -: ]]gsl-svd ( *gsl_matrix -- *gsl_matrix *gsl_vector ) - dup ]]size2 dup dup gsl_matrix_calloc - swap dup gsl_vector_calloc swap - gsl_vector_calloc - { mV vS vW | - mV vS vW gsl_linalg_SV_decomp drop - vW ]free - mV vS } ; -\ seems to be 30% faster -: ]]gsl-svdm ( *gsl_matrix -- *gsl_matrix *gsl_vector ) - dup ]]size2 dup ( a n n -- ) - dup dup gsl_matrix_calloc swap ( a n a n -- ) - dup gsl_matrix_calloc rot dup ( a a a n n -- ) - gsl_vector_calloc swap - gsl_vector_calloc - { mX mV vS vW | - mX mV vS vW gsl_linalg_SV_decomp_mod drop - vW ]free mX ]]free - mV vS } ; - - -: ]]alu ( *gsl_matrix -- *gsl_permutation ) ( matrix replaced with its lu ) - { a[[ | - CblasRowMajor a[[ ]]size1 a[[ ]]size2 a[[ ]]data a[[ ]]size1 dup - gsl_permutation_alloc dup >r }data - clapack_dgetrf throw r> } ; -: ]]ainv ( *gsl_matrix *gsl_permutation -- ) - \ LU of a matrix replaced with its inverse - { a[[ t{ | - CblasRowMajor a[[ ]]size2 a[[ ]]data a[[ ]]size1 t{ }data - clapack_dgetri throw } ; -: ]]ainvert ( *gsl_matrix -- *gsl_matrix ) - [IFDEF] отладка - dup ?square - [THEN] - ]]clone dup dup >r ]]alu dup >r ]]ainv r> }free r> ; -: ]]det ( *gsl_matrix -- f:determinant ) - [IFDEF] отладка - dup ?square - [THEN] - ]]clone dup ]]alu >r 1e0 - dup ]]size1 0 do dup i dup ]]@ f* loop ]]free - \ compute permutation sign - r> }sign s>f f* }free ; -\ calculates the work needed for dgesvd_ ( see man dgesvd ) -: lwork ( m n -- c ) - 2dup max -rot min 3 * over + swap 5 * max ; -\ this svd returns U MxM so eats a lot of memory -: ]]asvda ( *gsl_matrix -- *gsl_matrix *gsl_matrix *gsl_vector ) - ]]clone { A[[ | - A[[ ]]size1 dup gsl_matrix_alloc - A[[ ]]size2 dup gsl_matrix_alloc - A[[ ]]size1 A[[ ]]size2 min gsl_vector_alloc - 8 cells allocate throw - { U[[ V[[ W[ p[ | - ascii A p[ 0 cells + ! p[ 0 cells + - ascii A p[ 1 cells + ! p[ 1 cells + - A[[ ]]size1 p[ 2 cells + ! p[ 2 cells + - A[[ ]]size2 p[ 3 cells + ! p[ 3 cells + - A[[ ]]data - p[ 2 cells + - W[ ]data - U[[ ]]data - U[[ ]]size1 p[ 4 cells + ! p[ 4 cells + - V[[ ]]data - V[[ ]]size1 p[ 5 cells + ! p[ 5 cells + - A[[ ]]size1 A[[ ]]size2 lwork - dup gsl_vector_alloc dup >r - ]data swap p[ 6 cells + ! p[ 6 cells + - p[ 7 cells + - dgesvd_ - r> ]free p[ free throw A[[ ]]free - U[[ V[[ W[ } } ; - -\ performs A=U*S*V^T -\ A = MxN, where M>N, pass it A^T -\ returns U^T (MxN), V(NxN) and vector of N eigenvalues -: ]]asvdO ( *gsl_matrix -- *gsl_matrix *gsl_matrix *gsl_vector ) - { A[[ | - A[[ ]]size2 A[[ ]]size1 min dup gsl_matrix_alloc - A[[ ]]size1 A[[ ]]size2 min gsl_vector_alloc - 8 cells allocate throw - { V[[ W[ p[ | - ascii O p[ 0 cells + ! p[ 0 cells + - ascii S p[ 1 cells + ! p[ 1 cells + - A[[ ]]size2 p[ 2 cells + ! p[ 2 cells + - A[[ ]]size1 p[ 3 cells + ! p[ 3 cells + - A[[ ]]data - p[ 2 cells + - W[ ]data - 0 - p[ 2 cells + - V[[ ]]data - V[[ ]]size2 p[ 5 cells + ! p[ 5 cells + - A[[ ]]size2 A[[ ]]size1 lwork - dup gsl_vector_alloc dup >r - ]data swap p[ 6 cells + ! p[ 6 cells + - p[ 7 cells + - dgesvd_ - r> ]free p[ free throw - A[[ V[[ W[ } } ; - - -: ]diag[[ ( *gsl_vector -- *gsl_matrix ) - dup ]size dup dup gsl_matrix_calloc swap - 0 do - 2dup swap i ]@ i i ]]! - loop nip ; - -: ]print\ ( *gsl_vector -- ) - dup ]size 0 do dup i ]@ fx. loop drop ; -: ]print ( *gsl_vector -- ) ]print\ cr ; -: ]]print ( *gsl_matrix -- ) - cr precision swap - 5 set-precision - dup ]]size1 0 do - \ i . ." : " - dup ]]size2 0 do - dup - j i ]]@ fs. - loop - cr - loop - drop set-precision ; -: ]]row-print ( *gsl_matrix i -- ) - cr - over gsl_matrix size2 @ 0 do - 2dup - i ]]@ f. - loop - cr 2drop ; - -: ]]col-print ( *gsl_matrix i -- ) - cr - over gsl_matrix size1 @ 0 do - 2dup - i swap ]]@ f. - loop - cr 2drop ; - -: ]]nthrow ( *gsl_matrix n -- addr ) - over ]]tda * dfloats swap ]]data + ; - -: ]]randomize ( *gsl_matrix -- ) - dup dup ]]size1 swap ]]size2 * 0 do - dup - gsl-randomu - ]]data i dfloats + df! - loop drop ; -: ]randomize ( *gsl_vector -- ) - dup ]size 0 do - dup - gsl-randomu - i ]! - loop drop ; -: ]mean ( *gsl_vector -- f ) - dup ]stride swap dup ]size swap ]data - rot rot gsl_stats_mean ; - -: ]variance ( *gsl_vector -- f ) - dup ]stride swap dup ]size swap ]data - rot rot gsl_stats_variance ; - -: ]sd ( *gsl_vector -- f ) - dup ]stride swap dup ]size swap ]data - rot rot gsl_stats_sd ; - -: ]skew ( *gsl_vector -- f ) - dup ]stride swap dup ]size swap ]data - rot rot gsl_stats_skew ; - -: ]kurtosis ( *gsl_vector -- f ) - dup ]stride swap dup ]size swap ]data - rot rot gsl_stats_kurtosis ; - -: ]]gsl-lu ( *gsl_matrix -- *gsl_matrix *gsl_permutation ) - 1 sp@ rot ]]clone dup >r dup ]]size1 gsl_permutation_calloc dup >r rot - gsl_linalg_LU_decomp drop r> r> swap rot drop ; - -: ]]gsl-invert ( *gsl_matrix -- *gsl_matrix ) - ]]clone dup dup ]]gsl-lu 2dup >r >r rot - gsl_linalg_LU_invert drop r> ]]free r> }free ; - -' ]]ainvert alias ]]invert -' ]]asvdO alias ]]svd - -: ]]save ( *gsl_matrix *gsl_matrix_cfa fid -- ) - -rot { m[[ name[[ | - >r - name[[ >name count 1+ nip 0 m[[ ]]size2 m[[ ]]size1 0 - sp@ 5 cells r@ write-file throw - 2drop 2drop drop - name[[ >name count 1+ r@ write-file throw - m[[ ]]size1 m[[ ]]size2 * dfloats m[[ ]]T dup s>f ]]data swap - r> write-file throw f>s ]]free } ; - -\ these words do not work with float matrices but are needed for -\ scientific calculations, that's why they are in this module - -: _hmatrix ( n m size -- addr ) - rot over * 2 pick * [ 2 cells ] literal + - allocate throw dup [ 2 cells ] literal + >r - rot over ! [ 1 cells ] literal + ! r> ; -: hmatrix ( n m size -- ) - create - rot over * 2 pick * [ 2 cells ] literal + allocate throw dup , - rot over ! [ 1 cells ] literal + ! - does> @ [ 2 cells ] literal + ; -: }}row-size ( hmatrix -- ) [ 2 cells ] literal - @ ; -: freeHmatrix ( hmatrix -- ) [ 2 cells ] literal - free throw ; -: }} ( addr i j -- addr[i][j] ) \ word to fetch 2-D array addresses - >R >R \ indices to return stack temporarily - DUP CELL- CELL- 2@ \ &a[0][0] size m - R> * R> + * - + - ALIGNED ; -: h->[[ ( hmatrix -- gsl_matrix ) - dup }}row-size 3 swap gsl_matrix_alloc - dup ]]size2 0 do - 3 0 do - 2dup swap i j }} w@ s>f i j ]]! - loop - loop nip ; - -\ some sequencing code -: arange ( f:start f:end f:step -- x[ ) - f-rot - fswap fdup f>r f- fover f/ f>s :] fr> - dup ]size 0 do - dup fover i s>f f* fover f+ i ]! - loop ; -: product ( x[ -- f:P ) - !1 dup ]size 0 do - dup i ]@ f* - loop drop ; - -\ initializing random number generator to some value in order to have -\ it available upon loading of gsl -mt19937 -: )randperm ( *v( -- ) - gsl_rng_default swap - dup )size over )type 8 / gsl_ran_shuffle ; - -previous previous previous previous previous - -Module; diff --git a/include/mgl/mathgl.fs b/include/mgl/mathgl.fs deleted file mode 100644 index bbc3fd8..0000000 --- a/include/mgl/mathgl.fs +++ /dev/null @@ -1,472 +0,0 @@ -Module mathgl -also dos - -library libmgl libmgl.so -library libmgl-glut libmgl-glut.so -library libmgl-fltk libmgl-fltk.so -library libmgl-qt libmgl-qt.so -library libmgl-wx libmgl-wx.so - -legacy off - -libmgl mgl_create_graph_gl (ptr) mgl_create_graph_gl -libmgl mgl_create_graph_zb int int (ptr) mgl_create_graph_zb -libmgl mgl_create_graph_ps int int (ptr) mgl_create_graph_ps -libmgl mgl_fortran_func ptr ptr (int) mgl_fortran_func -libmgl-glut mgl_create_graph_glut ptr ptr ptr (ptr) mgl_create_graph_glut -libmgl-fltk mgl_create_graph_fltk ptr ptr ptr (ptr) mgl_create_graph_fltk -libmgl-qt mgl_create_graph_qt ptr ptr ptr (ptr) mgl_create_graph_qt -\ libmgl-glut mgl_create_graph_glut_dr ptr ptr (ptr) mgl_create_graph_glut_dr -\ libmgl-fltk mgl_create_graph_fltk_dr ptr ptr (ptr) mgl_create_graph_fltk_dr -\ libmgl-qt mgl_create_graph_qt_dr ptr ptr (ptr) mgl_create_graph_qt_dr -libmgl mgl_create_graph_idtf (ptr) mgl_create_graph_idtf -libmgl-fltk mgl_fltk_run (void) mgl_fltk_run -libmgl-qt mgl_qt_run (void) mgl_qt_run -libmgl mgl_set_show_mouse_pos int ptr (void) mgl_set_show_mouse_pos -libmgl mgl_get_last_mouse_pos sf sf sf ptr (void) mgl_get_last_mouse_pos -libmgl mgl_update ptr (void) mgl_update -libmgl mgl_delete_graph ptr (void) mgl_delete_graph -libmgl mgl_create_data (ptr) mgl_create_data -libmgl mgl_create_data_size int int int (ptr) mgl_create_data_size -libmgl mgl_create_data_file ptr (ptr) mgl_create_data_file -libmgl mgl_delete_data ptr (void) mgl_delete_data -libmgl mgl_create_parser (ptr) mgl_create_parser -libmgl mgl_delete_parser ptr (void) mgl_delete_parser -libmgl mgl_add_param ptr int ptr (void) mgl_add_param -libmgl mgl_add_paramw ptr int ptr (void) mgl_add_paramw -libmgl mgl_add_var ptr ptr (ptr) mgl_add_var -libmgl mgl_find_var ptr ptr (ptr) mgl_find_var -libmgl mgl_parse int ptr ptr ptr (int) mgl_parse -libmgl mgl_parsew int ptr ptr ptr (int) mgl_parsew -libmgl mgl_parse_text ptr ptr ptr (void) mgl_parse_text -libmgl mgl_parsew_text ptr ptr ptr (void) mgl_parsew_text -libmgl mgl_restore_once ptr (void) mgl_restore_once -libmgl mgl_parser_allow_setsize int ptr (void) mgl_parser_allow_setsize -libmgl mgl_set_def_param ptr (void) mgl_set_def_param -libmgl mgl_set_palette ptr ptr (void) mgl_set_palette -libmgl mgl_set_pal_color sf sf sf int ptr (void) mgl_set_pal_color -libmgl mgl_set_pal_num int ptr (void) mgl_set_pal_num -libmgl mgl_set_rotated_text int ptr (void) mgl_set_rotated_text -libmgl mgl_set_cut int ptr (void) mgl_set_cut -libmgl mgl_set_cut_box sf sf sf sf sf sf ptr (void) mgl_set_cut_box -libmgl mgl_set_tick_len sf ptr (void) mgl_set_tick_len -libmgl mgl_set_bar_width sf ptr (void) mgl_set_bar_width -libmgl mgl_set_base_line_width sf ptr (void) mgl_set_base_line_width -libmgl mgl_set_mark_size sf ptr (void) mgl_set_mark_size -libmgl mgl_set_arrow_size sf ptr (void) mgl_set_arrow_size -libmgl mgl_set_font_size sf ptr (void) mgl_set_font_size -libmgl mgl_set_font_def ptr ptr (void) mgl_set_font_def -libmgl mgl_set_alpha_default sf ptr (void) mgl_set_alpha_default -libmgl mgl_set_size int int ptr (void) mgl_set_size -libmgl mgl_set_axial_dir ptr ptr (void) mgl_set_axial_dir -libmgl mgl_set_meshnum int ptr (void) mgl_set_meshnum -libmgl mgl_set_zoom sf sf sf sf ptr (void) mgl_set_zoom -libmgl mgl_set_plotfactor sf ptr (void) mgl_set_plotfactor -libmgl mgl_set_draw_face int ptr (void) mgl_set_draw_face -libmgl mgl_set_scheme ptr ptr (void) mgl_set_scheme -libmgl mgl_load_font ptr ptr ptr (void) mgl_load_font -libmgl mgl_copy_font ptr ptr (void) mgl_copy_font -libmgl mgl_restore_font ptr (void) mgl_restore_font -libmgl mgl_show_image int ptr ptr (void) mgl_show_image -libmgl mgl_write_frame ptr ptr ptr (void) mgl_write_frame -libmgl mgl_write_bmp ptr ptr ptr (void) mgl_write_bmp -libmgl mgl_write_jpg ptr ptr ptr (void) mgl_write_jpg -libmgl mgl_write_png ptr ptr ptr (void) mgl_write_png -libmgl mgl_write_png_solid ptr ptr ptr (void) mgl_write_png_solid -libmgl mgl_write_eps ptr ptr ptr (void) mgl_write_eps -libmgl mgl_write_svg ptr ptr ptr (void) mgl_write_svg -libmgl mgl_write_idtf ptr ptr ptr (void) mgl_write_idtf -libmgl mgl_write_gif ptr ptr ptr (void) mgl_write_gif -libmgl mgl_start_gif int ptr ptr (void) mgl_start_gif -libmgl mgl_close_gif ptr (void) mgl_close_gif -libmgl mgl_get_rgb ptr (ptr) mgl_get_rgb -libmgl mgl_get_rgba ptr (ptr) mgl_get_rgba -libmgl mgl_get_width ptr (int) mgl_get_width -libmgl mgl_get_height ptr (int) mgl_get_height -libmgl mgl_new_frame ptr (int) mgl_new_frame -libmgl mgl_end_frame ptr (void) mgl_end_frame -libmgl mgl_get_num_frame ptr (int) mgl_get_num_frame -libmgl mgl_reset_frames ptr (void) mgl_reset_frames -libmgl mgl_set_transp_type int ptr (void) mgl_set_transp_type -libmgl mgl_set_transp int ptr (void) mgl_set_transp -libmgl mgl_set_alpha int ptr (void) mgl_set_alpha -libmgl mgl_set_fog sf sf ptr (void) mgl_set_fog -libmgl mgl_set_light int ptr (void) mgl_set_light -libmgl mgl_set_light_n int int ptr (void) mgl_set_light_n -libmgl mgl_add_light ptr sf sf sf int ptr (void) mgl_add_light -libmgl mgl_add_light_rgb sf sf sf sf int sf sf sf int ptr (void) mgl_add_light_rgb -libmgl mgl_set_ambbr sf ptr (void) mgl_set_ambbr -libmgl mgl_identity ptr (void) mgl_identity -libmgl mgl_clf ptr (void) mgl_clf -libmgl mgl_flush ptr (void) mgl_flush -libmgl mgl_clf_rgb sf sf sf ptr (void) mgl_clf_rgb -libmgl mgl_subplot int int int ptr (void) mgl_subplot -libmgl mgl_subplot_d sf sf int int int ptr (void) mgl_subplot_d -libmgl mgl_inplot sf sf sf sf ptr (void) mgl_inplot -libmgl mgl_relplot sf sf sf sf ptr (void) mgl_relplot -libmgl mgl_columnplot int int ptr (void) mgl_columnplot -libmgl mgl_aspect sf sf sf ptr (void) mgl_aspect -libmgl mgl_rotate sf sf sf ptr (void) mgl_rotate -libmgl mgl_rotate_vector sf sf sf sf ptr (void) mgl_rotate_vector -libmgl mgl_perspective sf ptr (void) mgl_perspective -libmgl mgl_set_ticks sf sf sf ptr (void) mgl_set_ticks -libmgl mgl_set_subticks int int int ptr (void) mgl_set_subticks -libmgl mgl_set_ticks_dir sf int sf ptr ptr (void) mgl_set_ticks_dir -\ libmgl mgl_set_ticks_val ... ptr double val int ptr ptr (void) mgl_set_ticks_val -libmgl mgl_set_ticks_vals ptr sf int ptr ptr (void) mgl_set_ticks_vals -libmgl mgl_set_caxis sf sf ptr (void) mgl_set_caxis -libmgl mgl_set_axis sf sf sf sf sf sf sf sf sf ptr (void) mgl_set_axis -libmgl mgl_set_axis_3d sf sf sf sf sf sf ptr (void) mgl_set_axis_3d -libmgl mgl_set_axis_2d sf sf sf sf ptr (void) mgl_set_axis_2d -libmgl mgl_set_origin sf sf sf ptr (void) mgl_set_origin -libmgl mgl_set_tick_origin sf sf sf ptr (void) mgl_set_tick_origin -libmgl mgl_set_crange int ptr ptr (void) mgl_set_crange -libmgl mgl_set_xrange int ptr ptr (void) mgl_set_xrange -libmgl mgl_set_yrange int ptr ptr (void) mgl_set_yrange -libmgl mgl_set_zrange int ptr ptr (void) mgl_set_zrange -libmgl mgl_set_auto sf sf sf sf sf sf ptr (void) mgl_set_auto -libmgl mgl_set_func ptr ptr ptr ptr (void) mgl_set_func -libmgl mgl_set_ternary int ptr (void) mgl_set_ternary -libmgl mgl_set_cutoff ptr ptr (void) mgl_set_cutoff -libmgl mgl_box int ptr (void) mgl_box -libmgl mgl_box_str int ptr ptr (void) mgl_box_str -libmgl mgl_box_rgb int sf sf sf ptr (void) mgl_box_rgb -libmgl mgl_axis ptr ptr (void) mgl_axis -libmgl mgl_axis_grid ptr ptr ptr (void) mgl_axis_grid -libmgl mgl_label ptr ptr ptr (void) mgl_label -libmgl mgl_label_ext sf sf int ptr ptr ptr (void) mgl_label_ext -libmgl mgl_tune_ticks sf int ptr (void) mgl_tune_ticks -libmgl mgl_set_xttw ptr ptr (void) mgl_set_xttw -libmgl mgl_set_yttw ptr ptr (void) mgl_set_yttw -libmgl mgl_set_zttw ptr ptr (void) mgl_set_zttw -libmgl mgl_set_cttw ptr ptr (void) mgl_set_cttw -libmgl mgl_set_xtt ptr ptr (void) mgl_set_xtt -libmgl mgl_set_ytt ptr ptr (void) mgl_set_ytt -libmgl mgl_set_ztt ptr ptr (void) mgl_set_ztt -libmgl mgl_set_ctt ptr ptr (void) mgl_set_ctt -libmgl mgl_ball sf sf sf ptr (void) mgl_ball -libmgl mgl_ball_rgb sf sf sf sf sf sf sf ptr (void) mgl_ball_rgb -libmgl mgl_ball_str ptr sf sf sf ptr (void) mgl_ball_str -libmgl mgl_line int ptr sf sf sf sf sf sf ptr (void) mgl_line -libmgl mgl_facex sf sf ptr sf sf sf sf sf ptr (void) mgl_facex -libmgl mgl_facey sf sf ptr sf sf sf sf sf ptr (void) mgl_facey -libmgl mgl_facez sf sf ptr sf sf sf sf sf ptr (void) mgl_facez -libmgl mgl_curve int ptr sf sf sf sf sf sf sf sf sf sf sf sf ptr (void) mgl_curve -libmgl mgl_puts ptr sf sf sf ptr (void) mgl_puts -libmgl mgl_putsw ptr sf sf sf ptr (void) mgl_putsw -libmgl mgl_puts_dir sf ptr sf sf sf sf sf sf ptr (void) mgl_puts_dir -libmgl mgl_putsw_dir sf ptr sf sf sf sf sf sf ptr (void) mgl_putsw_dir -libmgl mgl_text ptr sf sf sf ptr (void) mgl_text -libmgl mgl_title sf ptr ptr ptr (void) mgl_title -libmgl mgl_titlew sf ptr ptr ptr (void) mgl_titlew -libmgl mgl_putsw_ext ptr sf ptr ptr sf sf sf ptr (void) mgl_putsw_ext -libmgl mgl_puts_ext ptr sf ptr ptr sf sf sf ptr (void) mgl_puts_ext -libmgl mgl_text_ext ptr sf ptr ptr sf sf sf ptr (void) mgl_text_ext -libmgl mgl_colorbar int ptr ptr (void) mgl_colorbar -libmgl mgl_colorbar_ext sf sf sf sf int ptr ptr (void) mgl_colorbar_ext -libmgl mgl_simple_plot ptr int ptr ptr (void) mgl_simple_plot -libmgl mgl_add_legend ptr ptr ptr (void) mgl_add_legend -libmgl mgl_add_legendw ptr ptr ptr (void) mgl_add_legendw -libmgl mgl_clear_legend ptr (void) mgl_clear_legend -libmgl mgl_legend_xy sf sf ptr sf sf ptr (void) mgl_legend_xy -libmgl mgl_legend sf sf ptr int ptr (void) mgl_legend -libmgl mgl_set_legend_box int ptr (void) mgl_set_legend_box -libmgl mgl_fplot int ptr ptr ptr (void) mgl_fplot -libmgl mgl_fplot_xyz int ptr ptr ptr ptr ptr (void) mgl_fplot_xyz -libmgl mgl_plot_xyz ptr ptr ptr ptr ptr (void) mgl_plot_xyz -libmgl mgl_plot_xy ptr ptr ptr ptr (void) mgl_plot_xy -libmgl mgl_plot ptr ptr ptr (void) mgl_plot -libmgl mgl_plot_2 ptr ptr ptr (void) mgl_plot_2 -libmgl mgl_plot_3 ptr ptr ptr (void) mgl_plot_3 -libmgl mgl_tens_xyz ptr ptr ptr ptr ptr ptr (void) mgl_tens_xyz -libmgl mgl_tens_xy ptr ptr ptr ptr ptr (void) mgl_tens_xy -libmgl mgl_tens ptr ptr ptr ptr (void) mgl_tens -libmgl mgl_area_xyz ptr ptr ptr ptr ptr (void) mgl_area_xyz -libmgl mgl_area_xy ptr ptr ptr ptr (void) mgl_area_xy -libmgl mgl_area_xys ptr ptr ptr ptr (void) mgl_area_xys -libmgl mgl_area ptr ptr ptr (void) mgl_area -libmgl mgl_area_2 ptr ptr ptr (void) mgl_area_2 -libmgl mgl_area_3 ptr ptr ptr (void) mgl_area_3 -libmgl mgl_region_xy int ptr ptr ptr ptr ptr (void) mgl_region_xy -libmgl mgl_region int ptr ptr ptr ptr (void) mgl_region -libmgl mgl_mark ptr sf sf sf ptr (void) mgl_mark -libmgl mgl_stem_xyz ptr ptr ptr ptr ptr (void) mgl_stem_xyz -libmgl mgl_stem_xy ptr ptr ptr ptr (void) mgl_stem_xy -libmgl mgl_stem ptr ptr ptr (void) mgl_stem -libmgl mgl_stem_2 ptr ptr ptr (void) mgl_stem_2 -libmgl mgl_stem_3 ptr ptr ptr (void) mgl_stem_3 -libmgl mgl_step_xyz ptr ptr ptr ptr ptr (void) mgl_step_xyz -libmgl mgl_step_xy ptr ptr ptr ptr (void) mgl_step_xy -libmgl mgl_step ptr ptr ptr (void) mgl_step -libmgl mgl_step_2 ptr ptr ptr (void) mgl_step_2 -libmgl mgl_step_3 ptr ptr ptr (void) mgl_step_3 -libmgl mgl_bars_xyz ptr ptr ptr ptr ptr (void) mgl_bars_xyz -libmgl mgl_bars_xy ptr ptr ptr ptr (void) mgl_bars_xy -libmgl mgl_bars ptr ptr ptr (void) mgl_bars -libmgl mgl_bars_2 ptr ptr ptr (void) mgl_bars_2 -libmgl mgl_bars_3 ptr ptr ptr (void) mgl_bars_3 -libmgl mgl_barh_yx ptr ptr ptr ptr (void) mgl_barh_yx -libmgl mgl_barh ptr ptr ptr (void) mgl_barh -libmgl mgl_torus ptr ptr ptr ptr (void) mgl_torus -libmgl mgl_torus_2 ptr ptr ptr (void) mgl_torus_2 -libmgl mgl_text_xyz sf ptr ptr ptr ptr ptr ptr (void) mgl_text_xyz -libmgl mgl_text_xy sf ptr ptr ptr ptr ptr (void) mgl_text_xy -libmgl mgl_text_y sf ptr ptr ptr ptr (void) mgl_text_y -libmgl mgl_chart ptr ptr ptr (void) mgl_chart -libmgl mgl_error ptr ptr ptr ptr (void) mgl_error -libmgl mgl_error_xy ptr ptr ptr ptr ptr (void) mgl_error_xy -libmgl mgl_error_exy ptr ptr ptr ptr ptr ptr (void) mgl_error_exy -libmgl mgl_mark_xyz ptr ptr ptr ptr ptr ptr (void) mgl_mark_xyz -libmgl mgl_mark_xy ptr ptr ptr ptr ptr (void) mgl_mark_xy -libmgl mgl_mark_y ptr ptr ptr ptr (void) mgl_mark_y -libmgl mgl_tube_xyzr ptr ptr ptr ptr ptr ptr (void) mgl_tube_xyzr -libmgl mgl_tube_xyr ptr ptr ptr ptr ptr (void) mgl_tube_xyr -libmgl mgl_tube_r ptr ptr ptr ptr (void) mgl_tube_r -libmgl mgl_tube_xyz ptr sf ptr ptr ptr ptr (void) mgl_tube_xyz -libmgl mgl_tube_xy ptr sf ptr ptr ptr (void) mgl_tube_xy -libmgl mgl_tube ptr sf ptr ptr (void) mgl_tube -libmgl mgl_textmark_xyzr ptr ptr ptr ptr ptr ptr ptr (void) mgl_textmark_xyzr -libmgl mgl_textmark_xyr ptr ptr ptr ptr ptr ptr (void) mgl_textmark_xyr -libmgl mgl_textmark_yr ptr ptr ptr ptr ptr (void) mgl_textmark_yr -libmgl mgl_textmark ptr ptr ptr ptr (void) mgl_textmark -libmgl mgl_textmarkw_xyzr ptr ptr ptr ptr ptr ptr ptr (void) mgl_textmarkw_xyzr -libmgl mgl_textmarkw_xyr ptr ptr ptr ptr ptr ptr (void) mgl_textmarkw_xyr -libmgl mgl_textmarkw_yr ptr ptr ptr ptr ptr (void) mgl_textmarkw_yr -libmgl mgl_textmarkw ptr ptr ptr ptr (void) mgl_textmarkw -libmgl mgl_fsurf int ptr ptr ptr (void) mgl_fsurf -libmgl mgl_fsurf_xyz int ptr ptr ptr ptr ptr (void) mgl_fsurf_xyz -libmgl mgl_grid_xy sf ptr ptr ptr ptr ptr (void) mgl_grid_xy -libmgl mgl_grid sf ptr ptr ptr (void) mgl_grid -libmgl mgl_mesh_xy ptr ptr ptr ptr ptr (void) mgl_mesh_xy -libmgl mgl_mesh ptr ptr ptr (void) mgl_mesh -libmgl mgl_fall_xy ptr ptr ptr ptr ptr (void) mgl_fall_xy -libmgl mgl_fall ptr ptr ptr (void) mgl_fall -libmgl mgl_belt_xy ptr ptr ptr ptr ptr (void) mgl_belt_xy -libmgl mgl_belt ptr ptr ptr (void) mgl_belt -libmgl mgl_surf_xy ptr ptr ptr ptr ptr (void) mgl_surf_xy -libmgl mgl_surf ptr ptr ptr (void) mgl_surf -libmgl mgl_dens_xy sf ptr ptr ptr ptr ptr (void) mgl_dens_xy -libmgl mgl_dens sf ptr ptr ptr (void) mgl_dens -libmgl mgl_boxs_xy sf ptr ptr ptr ptr ptr (void) mgl_boxs_xy -libmgl mgl_boxs sf ptr ptr ptr (void) mgl_boxs -libmgl mgl_tile_xy ptr ptr ptr ptr ptr (void) mgl_tile_xy -libmgl mgl_tile ptr ptr ptr (void) mgl_tile -libmgl mgl_tiles_xy ptr ptr ptr ptr ptr ptr (void) mgl_tiles_xy -libmgl mgl_tiles ptr ptr ptr ptr (void) mgl_tiles -libmgl mgl_cont_xy_val sf ptr ptr ptr ptr ptr ptr (void) mgl_cont_xy_val -libmgl mgl_cont_val sf ptr ptr ptr ptr (void) mgl_cont_val -libmgl mgl_cont_xy sf int ptr ptr ptr ptr ptr (void) mgl_cont_xy -libmgl mgl_cont sf int ptr ptr ptr (void) mgl_cont -libmgl mgl_contf_xy_val sf ptr ptr ptr ptr ptr ptr (void) mgl_contf_xy_val -libmgl mgl_contf_val sf ptr ptr ptr ptr (void) mgl_contf_val -libmgl mgl_contf_xy sf int ptr ptr ptr ptr ptr (void) mgl_contf_xy -libmgl mgl_contf sf int ptr ptr ptr (void) mgl_contf -libmgl mgl_axial_xy_val ptr ptr ptr ptr ptr ptr (void) mgl_axial_xy_val -libmgl mgl_axial_val ptr ptr ptr ptr (void) mgl_axial_val -libmgl mgl_axial_xy int ptr ptr ptr ptr ptr (void) mgl_axial_xy -libmgl mgl_axial int ptr ptr ptr (void) mgl_axial -libmgl mgl_surfc_xy ptr ptr ptr ptr ptr ptr (void) mgl_surfc_xy -libmgl mgl_surfc ptr ptr ptr ptr (void) mgl_surfc -libmgl mgl_surfa_xy ptr ptr ptr ptr ptr ptr (void) mgl_surfa_xy -libmgl mgl_surfa ptr ptr ptr ptr (void) mgl_surfa -libmgl mgl_stfa_xy sf ptr int ptr ptr ptr ptr ptr (void) mgl_stfa_xy -libmgl mgl_stfa sf ptr int ptr ptr ptr (void) mgl_stfa -libmgl mgl_vect_xy sf ptr ptr ptr ptr ptr ptr (void) mgl_vect_xy -libmgl mgl_vect_2d sf ptr ptr ptr ptr (void) mgl_vect_2d -libmgl mgl_vectl_xy sf ptr ptr ptr ptr ptr ptr (void) mgl_vectl_xy -libmgl mgl_vectl_2d sf ptr ptr ptr ptr (void) mgl_vectl_2d -libmgl mgl_vectc_xy sf ptr ptr ptr ptr ptr ptr (void) mgl_vectc_xy -libmgl mgl_vectc_2d sf ptr ptr ptr ptr (void) mgl_vectc_2d -libmgl mgl_vect_xyz ptr ptr ptr ptr ptr ptr ptr ptr (void) mgl_vect_xyz -libmgl mgl_vect_3d ptr ptr ptr ptr ptr (void) mgl_vect_3d -libmgl mgl_vectl_xyz ptr ptr ptr ptr ptr ptr ptr ptr (void) mgl_vectl_xyz -libmgl mgl_vectl_3d ptr ptr ptr ptr ptr (void) mgl_vectl_3d -libmgl mgl_vectc_xyz ptr ptr ptr ptr ptr ptr ptr ptr (void) mgl_vectc_xyz -libmgl mgl_vectc_3d ptr ptr ptr ptr ptr (void) mgl_vectc_3d -libmgl mgl_map_xy int int ptr ptr ptr ptr ptr ptr (void) mgl_map_xy -libmgl mgl_map int int ptr ptr ptr ptr (void) mgl_map -libmgl mgl_surf3a_xyz_val ptr ptr ptr ptr ptr ptr sf ptr (void) mgl_surf3a_xyz_val -libmgl mgl_surf3a_val ptr ptr ptr sf ptr (void) mgl_surf3a_val -libmgl mgl_surf3a_xyz int ptr ptr ptr ptr ptr ptr ptr (void) mgl_surf3a_xyz -libmgl mgl_surf3a int ptr ptr ptr ptr (void) mgl_surf3a -libmgl mgl_surf3c_xyz_val ptr ptr ptr ptr ptr ptr sf ptr (void) mgl_surf3c_xyz_val -libmgl mgl_surf3c_val ptr ptr ptr sf ptr (void) mgl_surf3c_val -libmgl mgl_surf3c_xyz (void) mgl_surf3c_xyz -libmgl mgl_surf3c int ptr ptr ptr ptr (void) mgl_surf3c -libmgl mgl_flow_xy sf int int ptr ptr ptr ptr ptr ptr (void) mgl_flow_xy -libmgl mgl_flow_2d sf int int ptr ptr ptr ptr (void) mgl_flow_2d -libmgl mgl_flow_xyz int int ptr ptr ptr ptr ptr ptr ptr ptr (void) mgl_flow_xyz -libmgl mgl_flow_3d int int ptr ptr ptr ptr ptr (void) mgl_flow_3d -libmgl mgl_pipe_xy sf int int sf ptr ptr ptr ptr ptr ptr (void) mgl_pipe_xy -libmgl mgl_pipe_2d sf int int sf ptr ptr ptr ptr (void) mgl_pipe_2d -libmgl mgl_pipe_xyz int int sf ptr ptr ptr ptr ptr ptr ptr ptr (void) mgl_pipe_xyz -libmgl mgl_pipe_3d int int sf ptr ptr ptr ptr ptr (void) mgl_pipe_3d -libmgl mgl_dew_xy sf ptr ptr ptr ptr ptr ptr (void) mgl_dew_xy -libmgl mgl_dew_2d sf ptr ptr ptr ptr (void) mgl_dew_2d -libmgl mgl_grid3_xyz ptr int ptr ptr ptr ptr ptr ptr (void) mgl_grid3_xyz -libmgl mgl_grid3 ptr int ptr ptr ptr (void) mgl_grid3 -libmgl mgl_grid3_all_xyz ptr ptr ptr ptr ptr ptr (void) mgl_grid3_all_xyz -libmgl mgl_grid3_all ptr ptr ptr (void) mgl_grid3_all -libmgl mgl_dens3_xyz ptr int ptr ptr ptr ptr ptr ptr (void) mgl_dens3_xyz -libmgl mgl_dens3 ptr int ptr ptr ptr (void) mgl_dens3 -libmgl mgl_dens3_all_xyz ptr ptr ptr ptr ptr ptr (void) mgl_dens3_all_xyz -libmgl mgl_dens3_all ptr ptr ptr (void) mgl_dens3_all -libmgl mgl_surf3_xyz_val ptr ptr ptr ptr ptr sf ptr (void) mgl_surf3_xyz_val -libmgl mgl_surf3_val ptr ptr sf ptr (void) mgl_surf3_val -libmgl mgl_surf3_xyz int ptr ptr ptr ptr ptr ptr (void) mgl_surf3_xyz -libmgl mgl_surf3 int ptr ptr ptr (void) mgl_surf3 -libmgl mgl_cont3_xyz_val ptr int ptr ptr ptr ptr ptr ptr ptr (void) mgl_cont3_xyz_val -libmgl mgl_cont3_val ptr int ptr ptr ptr ptr (void) mgl_cont3_val -libmgl mgl_cont3_xyz int ptr int ptr ptr ptr ptr ptr ptr (void) mgl_cont3_xyz -libmgl mgl_cont3 int ptr int ptr ptr ptr (void) mgl_cont3 -libmgl mgl_cont_all_xyz int ptr ptr ptr ptr ptr ptr (void) mgl_cont_all_xyz -libmgl mgl_cont_all int ptr ptr ptr (void) mgl_cont_all -libmgl mgl_cloudp_xyz sf ptr ptr ptr ptr ptr ptr (void) mgl_cloudp_xyz -libmgl mgl_cloudp sf ptr ptr ptr (void) mgl_cloudp -libmgl mgl_cloud_xyz sf ptr ptr ptr ptr ptr ptr (void) mgl_cloud_xyz -libmgl mgl_cloud sf ptr ptr ptr (void) mgl_cloud -libmgl mgl_contf3_xyz_val ptr int ptr ptr ptr ptr ptr ptr ptr (void) mgl_contf3_xyz_val -libmgl mgl_contf3_val ptr int ptr ptr ptr ptr (void) mgl_contf3_val -libmgl mgl_contf3_xyz int ptr int ptr ptr ptr ptr ptr ptr (void) mgl_contf3_xyz -libmgl mgl_contf3 int ptr int ptr ptr ptr (void) mgl_contf3 -libmgl mgl_contf_all_xyz int ptr ptr ptr ptr ptr ptr (void) mgl_contf_all_xyz -libmgl mgl_contf_all int ptr ptr ptr (void) mgl_contf_all -libmgl mgl_beam_val int ptr sf ptr ptr ptr ptr sf ptr (void) mgl_beam_val -libmgl mgl_beam int int ptr sf ptr ptr ptr ptr ptr (void) mgl_beam -libmgl mgl_triplot_xyzc ptr ptr ptr ptr ptr ptr ptr (void) mgl_triplot_xyzc -libmgl mgl_triplot_xyz ptr ptr ptr ptr ptr ptr (void) mgl_triplot_xyz -libmgl mgl_triplot_xy sf ptr ptr ptr ptr ptr (void) mgl_triplot_xy -libmgl mgl_dots ptr ptr ptr ptr ptr (void) mgl_dots -libmgl mgl_dots_tr ptr ptr ptr (void) mgl_dots_tr -libmgl mgl_crust sf ptr ptr ptr ptr ptr (void) mgl_crust -libmgl mgl_crust_tr sf ptr ptr ptr (void) mgl_crust_tr -libmgl mgl_dens_x sf ptr ptr ptr (void) mgl_dens_x -libmgl mgl_dens_y sf ptr ptr ptr (void) mgl_dens_y -libmgl mgl_dens_z sf ptr ptr ptr (void) mgl_dens_z -libmgl mgl_cont_x int sf ptr ptr ptr (void) mgl_cont_x -libmgl mgl_cont_y int sf ptr ptr ptr (void) mgl_cont_y -libmgl mgl_cont_z int sf ptr ptr ptr (void) mgl_cont_z -libmgl mgl_cont_x_val sf ptr ptr ptr ptr (void) mgl_cont_x_val -libmgl mgl_cont_y_val sf ptr ptr ptr ptr (void) mgl_cont_y_val -libmgl mgl_cont_z_val sf ptr ptr ptr ptr (void) mgl_cont_z_val -libmgl mgl_contf_x int sf ptr ptr ptr (void) mgl_contf_x -libmgl mgl_contf_y int sf ptr ptr ptr (void) mgl_contf_y -libmgl mgl_contf_z int sf ptr ptr ptr (void) mgl_contf_z -libmgl mgl_contf_x_val sf ptr ptr ptr ptr (void) mgl_contf_x_val -libmgl mgl_contf_y_val sf ptr ptr ptr ptr (void) mgl_contf_y_val -libmgl mgl_contf_z_val sf ptr ptr ptr ptr (void) mgl_contf_z_val -libmgl mgl_data_rearrange int int int ptr (void) mgl_data_rearrange -libmgl mgl_data_set_float int int int sf ptr (void) mgl_data_set_float -libmgl mgl_data_set_double int int int df ptr (void) mgl_data_set_double -libmgl mgl_data_set_float2 int int sf ptr (void) mgl_data_set_float2 -libmgl mgl_data_set_double2 int int df ptr (void) mgl_data_set_double2 -libmgl mgl_data_set_float3 int int int sf ptr (void) mgl_data_set_float3 -libmgl mgl_data_set_double3 int int int ptr ptr (void) mgl_data_set_double3 -libmgl mgl_data_set ptr ptr (void) mgl_data_set -libmgl mgl_data_set_vector ptr ptr (void) mgl_data_set_vector -libmgl mgl_data_set_matrix ptr ptr (void) mgl_data_set_matrix -libmgl mgl_data_get_value int int int ptr (fp) mgl_data_get_value -libmgl mgl_data_get_nx ptr (int) mgl_data_get_nx -libmgl mgl_data_get_ny ptr (int) mgl_data_get_ny -libmgl mgl_data_get_nz ptr (int) mgl_data_get_nz -libmgl mgl_data_set_value int int int sf ptr (void) mgl_data_set_value -libmgl mgl_data_set_values int int int ptr ptr (void) mgl_data_set_values -libmgl mgl_data_read ptr ptr (int) mgl_data_read -libmgl mgl_data_read_mat int ptr ptr (int) mgl_data_read_mat -libmgl mgl_data_read_dim int int int ptr ptr (int) mgl_data_read_dim -libmgl mgl_data_save int ptr ptr (void) mgl_data_save -libmgl mgl_data_export int sf sf ptr ptr ptr (void) mgl_data_export -libmgl mgl_data_import sf sf ptr ptr ptr (void) mgl_data_import -libmgl mgl_data_create int int int ptr (void) mgl_data_create -libmgl mgl_data_transpose ptr ptr (void) mgl_data_transpose -libmgl mgl_data_norm int int sf sf ptr (void) mgl_data_norm -libmgl mgl_data_norm_slice int int ptr sf sf ptr (void) mgl_data_norm_slice -libmgl mgl_data_subdata int int int ptr (ptr) mgl_data_subdata -libmgl mgl_data_column ptr ptr (ptr) mgl_data_column -libmgl mgl_data_set_id ptr ptr (void) mgl_data_set_id -libmgl mgl_data_fill ptr sf sf ptr (void) mgl_data_fill -libmgl mgl_data_fill_eq ptr ptr ptr ptr ptr (void) mgl_data_fill_eq -libmgl mgl_data_put_val int int int sf ptr (void) mgl_data_put_val -libmgl mgl_data_put_dat int int int ptr ptr (void) mgl_data_put_dat -libmgl mgl_data_modify int ptr ptr (void) mgl_data_modify -libmgl mgl_data_modify_vw ptr ptr ptr ptr (void) mgl_data_modify_vw -libmgl mgl_data_squeeze int int int int ptr (void) mgl_data_squeeze -libmgl mgl_data_max ptr (fp) mgl_data_max -libmgl mgl_data_min ptr (fp) mgl_data_min -libmgl mgl_data_value int int int ptr (fp) mgl_data_value -libmgl mgl_data_combine ptr ptr (ptr) mgl_data_combine -libmgl mgl_data_extend int int ptr (void) mgl_data_extend -libmgl mgl_data_insert int int ptr ptr (void) mgl_data_insert -libmgl mgl_data_delete int int ptr ptr (void) mgl_data_delete -libmgl mgl_data_smooth ptr sf int ptr (void) mgl_data_smooth -libmgl mgl_data_sum ptr ptr (ptr) mgl_data_sum -libmgl mgl_data_max_dir ptr ptr (ptr) mgl_data_max_dir -libmgl mgl_data_min_dir ptr ptr (ptr) mgl_data_min_dir -libmgl mgl_data_cumsum ptr ptr (void) mgl_data_cumsum -libmgl mgl_data_integral ptr ptr (void) mgl_data_integral -libmgl mgl_data_diff ptr ptr (void) mgl_data_diff -libmgl mgl_data_diff_par ptr ptr ptr ptr (void) mgl_data_diff_par -libmgl mgl_data_diff2 ptr ptr (void) mgl_data_diff2 -libmgl mgl_data_swap ptr ptr (void) mgl_data_swap -libmgl mgl_data_mirror ptr ptr (void) mgl_data_mirror -libmgl mgl_data_spline sf sf sf ptr (fp) mgl_data_spline -libmgl mgl_data_spline1 sf sf sf ptr (fp) mgl_data_spline1 -libmgl mgl_data_linear sf sf sf ptr (fp) mgl_data_linear -libmgl mgl_data_linear1 sf sf sf ptr (fp) mgl_data_linear1 -libmgl mgl_data_resize int int int ptr (ptr) mgl_data_resize -libmgl mgl_data_resize_box (ptr) mgl_data_resize_box -libmgl mgl_data_hist int sf sf int ptr (ptr) mgl_data_hist -libmgl mgl_data_hist_w int sf sf int ptr ptr (ptr) mgl_data_hist_w -libmgl mgl_data_momentum ptr ptr ptr (ptr) mgl_data_momentum -libmgl mgl_data_evaluate_i int ptr ptr (ptr) mgl_data_evaluate_i -libmgl mgl_data_evaluate_ij int ptr ptr ptr (ptr) mgl_data_evaluate_ij -libmgl mgl_data_evaluate_ijk int ptr ptr ptr ptr (ptr) mgl_data_evaluate_ijk -libmgl mgl_data_envelop ptr ptr (void) mgl_data_envelop -libmgl mgl_data_sew sf ptr ptr (void) mgl_data_sew -libmgl mgl_data_crop ptr int int ptr (void) mgl_data_crop -libmgl mgl_data_mul_dat ptr ptr (void) mgl_data_mul_dat -libmgl mgl_data_div_dat ptr ptr (void) mgl_data_div_dat -libmgl mgl_data_add_dat ptr ptr (void) mgl_data_add_dat -libmgl mgl_data_sub_dat ptr ptr (void) mgl_data_sub_dat -libmgl mgl_data_mul_num sf ptr (void) mgl_data_mul_num -libmgl mgl_data_div_num sf ptr (void) mgl_data_div_num -libmgl mgl_data_add_num sf ptr (void) mgl_data_add_num -libmgl mgl_data_sub_num sf ptr (void) mgl_data_sub_num -libmgl mgl_fit_1 sf ptr ptr ptr ptr ptr (fp) mgl_fit_1 -libmgl mgl_fit_2 sf ptr ptr ptr ptr ptr (fp) mgl_fit_2 -libmgl mgl_fit_3 sf ptr ptr ptr ptr ptr (fp) mgl_fit_3 -libmgl mgl_fit_xy sf ptr ptr ptr ptr ptr ptr (fp) mgl_fit_xy -libmgl mgl_fit_xyz sf ptr ptr ptr ptr ptr ptr ptr (fp) mgl_fit_xyz -libmgl mgl_fit_xyza sf ptr ptr ptr ptr ptr ptr ptr ptr (fp) mgl_fit_xyza -libmgl mgl_fit_ys sf ptr ptr ptr ptr ptr ptr (fp) mgl_fit_ys -libmgl mgl_fit_xys sf ptr ptr ptr ptr ptr ptr ptr (fp) mgl_fit_xys -libmgl mgl_fit_xyzs sf ptr ptr ptr ptr ptr ptr ptr ptr (fp) mgl_fit_xyzs -libmgl mgl_fit_xyzas sf ptr ptr ptr ptr ptr ptr ptr ptr ptr (fp) mgl_fit_xyzas -libmgl mgl_fit_1_d ptr ptr ptr ptr ptr ptr (fp) mgl_fit_1_d -libmgl mgl_fit_2_d ptr ptr ptr ptr ptr ptr (fp) mgl_fit_2_d -libmgl mgl_fit_3_d ptr ptr ptr ptr ptr ptr (fp) mgl_fit_3_d -libmgl mgl_fit_xy_d ptr ptr ptr ptr ptr ptr ptr (fp) mgl_fit_xy_d -libmgl mgl_fit_xyz_d ptr ptr ptr ptr ptr ptr ptr ptr (fp) mgl_fit_xyz_d -libmgl mgl_fit_xyza_d ptr ptr ptr ptr ptr ptr ptr ptr ptr (fp) mgl_fit_xyza_d -libmgl mgl_fit_ys_d ptr ptr ptr ptr ptr ptr ptr (fp) mgl_fit_ys_d -libmgl mgl_fit_xys_d ptr ptr ptr ptr ptr ptr ptr ptr (fp) mgl_fit_xys_d -libmgl mgl_fit_xyzs_d ptr ptr ptr ptr ptr ptr ptr ptr ptr (fp) mgl_fit_xyzs_d -libmgl mgl_fit_xyzas_d ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr (fp) mgl_fit_xyzas_d -libmgl mgl_puts_fit sf ptr ptr sf sf sf ptr (void) mgl_puts_fit -libmgl mgl_sphere ptr sf sf sf sf ptr (void) mgl_sphere -libmgl mgl_drop sf sf ptr sf sf sf sf sf sf sf ptr (void) mgl_drop -libmgl mgl_cone int ptr sf sf sf sf sf sf sf sf ptr (void) mgl_cone -libmgl mgl_pde_solve sf sf ptr ptr ptr ptr (ptr) mgl_pde_solve -libmgl mgl_qo2d_solve ptr ptr sf sf ptr ptr ptr ptr (ptr) mgl_qo2d_solve -libmgl mgl_af2d_solve ptr ptr sf sf ptr ptr ptr ptr (ptr) mgl_af2d_solve -libmgl mgl_ray_trace sf sf sf sf sf sf sf sf ptr (ptr) mgl_ray_trace -libmgl mgl_jacobian_2d ptr ptr (ptr) mgl_jacobian_2d -libmgl mgl_jacobian_3d ptr ptr ptr (ptr) mgl_jacobian_3d -libmgl mgl_transform_a ptr ptr ptr (ptr) mgl_transform_a -libmgl mgl_transform ptr ptr ptr (ptr) mgl_transform -libmgl mgl_data_stfa ptr int ptr ptr (ptr) mgl_data_stfa - -legacy on - -previous -Module; diff --git a/include/mgl/mgl.h b/include/mgl/mgl.h index d90b714..4cb87fd 100644 --- a/include/mgl/mgl.h +++ b/include/mgl/mgl.h @@ -3,1258 +3,1045 @@ * Copyright (C) 2007 Alexey Balakin * * * * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 of the * - * License, or (at your option) any later version. * + * 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 Library General Public * - * License along with this program; if not, write to the * + * 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., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" -#else #ifndef _MGL_H_ #define _MGL_H_ -#include -#include -#include "mgl/mgl_data.h" -#include "mgl/mgl_font.h" +#include "mgl/mgl_cf.h" +#include "mgl/data.h" //----------------------------------------------------------------------------- -class mglGraph; -class mglFormula; -#ifdef HAVE_GIF -#include -#else -struct GifFileType; -#endif -//----------------------------------------------------------------------------- -/// Class for incapsulating color -struct mglColor -{ - mreal r; ///< Red component of color - mreal g; ///< Green component of color - mreal b; ///< Blue component of color - - /// Constructor for RGB components manualy - mglColor(mreal R,mreal G,mreal B){ r=R; g=G; b=B; }; - /// Constructor set color from character id - mglColor(char c='k'){ Set(c); }; - /// Set color as Red, Green, Blue values - void Set(mreal R,mreal G,mreal B) {r=R; g=G; b=B;}; - /// Set color as Red, Green, Blue values - void Set(mglColor c, mreal bright=1); - /// Check if color is valid - inline bool Valid() - { return (r>=0 && r<=1 && g>=0 && g<=1 && b>=0 && b<=1); }; - /// Get maximal spectral component - inline mreal Norm() - { return r>g ? r : (g>b ? g : b); }; - /// Set color from symbolic id - void Set(char p, mreal bright=1); - /// Copy color from other one - bool operator==(const mglColor &c) - { return (r==c.r && g==c.g && b==c.b); }; -}; -inline mglColor operator+(const mglColor &a, const mglColor &b) -{ return mglColor(a.r+b.r, a.g+b.g, a.b+b.b); }; -inline mglColor operator-(const mglColor &a, const mglColor &b) -{ return mglColor(a.r-b.r, a.g-b.g, a.b-b.b); }; -inline mglColor operator*(const mglColor &a, mreal b) -{ return mglColor(a.r*b, a.g*b, a.b*b); }; -inline mglColor operator*(mreal b, const mglColor &a) -{ return mglColor(a.r*b, a.g*b, a.b*b); }; -inline mglColor operator/(const mglColor &a, mreal b) -{ return mglColor(a.r/b, a.g/b, a.b/b); }; -inline mglColor operator!(const mglColor &a) -{ return mglColor(1-a.r, 1-a.g, 1-a.b); } -//----------------------------------------------------------------------------- -const mglColor NC(-1,-1,-1); -const mglColor BC( 0, 0, 0); -const mglColor WC( 1, 1, 1); -const mglColor RC( 1, 0, 0); -//----------------------------------------------------------------------------- -/// Structure for color ID -struct mglColorID -{ - char id; - mglColor col; -}; -extern mglColorID mglColorIds[]; -//----------------------------------------------------------------------------- -mreal GetX(const mglData &x, int i, int j, int k); -mreal GetY(const mglData &y, int i, int j, int k); -mreal GetZ(const mglData &z, int i, int j, int k); +const float NaN = NAN; //----------------------------------------------------------------------------- -/// Class contains base functionality for creating different mathematical plots +/// Wrapper class for all graphics class mglGraph { -friend class mglFont; -friend class mglParse; +protected: + HMGL gr; public: - mglPoint Min; ///< Lower edge of bounding box for graphics. - mglPoint Max; ///< Upper edge of bounding box for graphics. - mreal Cmin; ///< Minimal value for data coloring. - mreal Cmax; ///< Maximal value for data coloring. - mglPoint Org; ///< Center of axis cross section. - mglPoint OrgT; ///< Point of starting ticks numbering (if NAN then Org is used). - mreal OrgC; ///< Starting point for colorbar ticks - bool AutoOrg; ///< Shift Org automatically if it lye outside Min ... Max range - mglColor Pal[101]; ///< Color palette for 1D plotting. - int NumPal; ///< Number of colors in palette. - char FontDef[32]; ///< Font specification (see mglGraph::Puts). Default is Roman with align at center. - bool RotatedText; ///< Use text rotation along axis - const char *PlotId; ///< Id of plot for saving filename (in GLUT window for example) - int MeshNum; ///< Set approximate number of lines in mglGraph::Mesh and mglGraph::Grid. By default (=0) it draw all lines. - - mreal dx; ///< Step for axis mark (if positive) or its number (if negative) in x direction. - mreal dy; ///< Step for axis mark (if positive) or its number (if negative) in y direction. - mreal dz; ///< Step for axis mark (if positive) or its number (if negative) in z direction. - mreal dc; ///< Step for colorbar mark (if positive) or its number (if negative). - mreal NSx; ///< Number of axis submarks in x direction - mreal NSy; ///< Number of axis submarks in y direction - mreal NSz; ///< Number of axis submarks in z direction. - mglFormula *fx; ///< Transformation formula for x direction. - mglFormula *fy; ///< Transformation formula for y direction. - mglFormula *fz; ///< Transformation formula for z direction. - mglFormula *fa; ///< Transformation formula for coloring. - mglFormula *fc; ///< Cutting off condition (formula). - mreal PlotFactor; ///< Factor for sizing overall plot (should be >1.5, default is =1.55) - bool AutoPlotFactor;///< Enable autochange PlotFactor - - /// Flag which determines how points outside bounding box are drown. - bool Cut; - mglPoint CutMin; ///< Lower edge of bounding box for cut off. - mglPoint CutMax; ///< Upper edge of bounding box for cut off. - /// Type of transparency (no full support in OpenGL mode). - int TranspType; - bool Transparent; ///< Flag which temporaly switch on/off transparency for plot - mreal BarWidth; ///< Relative width of rectangles in mglGraph::Bars(). - mreal MarkSize; ///< The size of marks for 1D plots. - mreal ArrowSize; ///< The size of arrows. - mreal BaseLineWidth; ///< Base line width (as factor). Useful for LARGE bitmap plots. + inline mglGraph(int kind=0, int width=600, int height=400) + { + if(kind==1) gr=mgl_create_graph_gl(); + else if(kind==-1) gr=NULL; +// else if(kind==2) gr=mgl_create_graph_idtf(); + else gr=mgl_create_graph(width, height); + } + inline mglGraph(const mglGraph &graph) + { gr = graph.gr; mgl_use_graph(gr,1); } + inline mglGraph(HMGL graph) + { gr = graph; mgl_use_graph(gr,1); } + virtual ~mglGraph() + { if(mgl_use_graph(gr,-1)<1) mgl_delete_graph(gr); } + /// Get pointer to internal mglCanvas object + inline HMGL Self() { return gr; } + /// Set default parameter for plotting + inline void DefaultPlotParam() { mgl_set_def_param(gr); } + /// Set name of plot for saving filename + inline void SetPlotId(const char *id) { mgl_set_plotid(gr,id); } - mreal FontSize; ///< The size of font for tick and axis labels - bool LegendBox; ///< Set on/off drawing legend box. - char AxialDir; ///< Direction of rotation for Axial() and Torus(). - bool DrawFace; ///< Switch on/off face drawing (for faster plot rotation, redrawing and so on) - mreal AlphaDef; ///< Default value of alpha channel (transparency) for all plotting functions. - char *Message; ///< Buffer for receiving messages - int WarnCode; ///< Warning code - int TuneTicks; ///< Draw tuned ticks with extracted common component - mreal FactorPos; ///< Position of axis ticks factor (0 at Min, 1 at Max, 1.1 is default) - int CirclePnts; ///< Number of points for a circle drawing (used in Tube(), Drop(), Sphere(), Cone()) - int FitPnts; ///< Number of output points in fitting - int GridPnts; ///< Number of points for grid lines - - mglGraph(); ///< Set default parameter for plotting - virtual ~mglGraph();///< Clear the used variables - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name Export functions - * These functions export current view to a graphic file. - * The filename \a fname should have apropriate extension. - * Parameter \a descr gives the short description of the plot. - * Just now the compression of TIFF files and transparency in - * EPS files are not supported. - */ - //@{ - /// Write the frame in file using JPEG format - virtual void WriteJPEG(const char *fname,const char *descr=0); - /// Write the frame in file using BMP format - virtual void WriteBMP(const char *fname,const char *descr=0); - /// Write the frame in file using PNG format - virtual void WritePNG(const char *fname,const char *descr=0,bool alpha=true); - /// Write the frame in file using PostScript format - virtual void WriteEPS(const char *fname,const char *descr=0); - /// Write the frame in file using SVG format - virtual void WriteSVG(const char *fname,const char *descr=0); - /// Write the frame in file using IDTF format - virtual void WriteIDTF(const char *fname,const char *descr=0); - /// Write the frame in file using U3D format - virtual void WriteU3D(const char *fname,const char *descr=0); - /// Write the frame in file using PDF format - virtual void WritePDF(const char *fname,const char *descr=0); - /// Write the frame in file using GIF format (only for current frame!) - virtual void WriteGIF(const char *fname,const char *descr=0); - /// Write the frame in file (depending extension, write current frame if fname is empty) - void WriteFrame(const char *fname=0, const char *descr=0); - /// Show currently produced image by Qt or FLTK library - void ShowImage(const char *viewer, bool keep=false); - //@} - /// Create new frame. - virtual int NewFrame(); - /// Finish frame drawing - virtual void EndFrame(); - /// Get the number of created frames - int GetNumFrame() { return CurFrameId; }; - /// Reset frames counter (start it from zero) - void ResetFrames() { CurFrameId=0; }; - /// Start write frames to cinema using GIF format - void StartGIF(const char *fname, int ms=100); - /// Stop writing cinema using GIF format - void CloseGIF(); - /// Flush the plotting commands to frame. - virtual void Flush(); - /// Finish plotting. Normally this function is called internaly. - virtual void Finish(); /// Set the transparency on/off. - virtual bool Alpha(bool enable)=0; + inline void Alpha(bool enable) { mgl_set_alpha(gr, enable); } /// Set default value of alpha-channel - inline void SetAlphaDef(float val) { AlphaDef=val; }; - /// Temporary switches transparency on/off - inline void SetTransparent(bool val) { Transparent=val; }; - /// Set the transparency type - inline void SetTranspType(int val) { TranspType=val; }; - /// Set the fog distance or switch it off (if d=0). - virtual void Fog(mreal d, mreal dz=0.25); + inline void SetAlphaDef(float alpha) { mgl_set_alpha_default(gr, alpha); } + /// Set the transparency type (0 - usual, 1 - glass, 2 - lamp) + inline void SetTranspType(int type) { mgl_set_transp_type(gr, type);} + /// Set the using of light on/off. - virtual bool Light(bool enable)=0; + inline void Light(bool enable) { mgl_set_light(gr, enable); } /// Switch on/off the specified light source. - virtual void Light(int n, bool enable); //=0 - /// Add a light source. - void Light(int n,mglPoint p, char c='w', mreal bright=0.5, bool infty=true, mreal ap=0); - inline void AddLight(int n, mreal x, mreal y, mreal z, char col='w') - { Light(n, mglPoint(x,y,z), col); }; + inline void Light(int n,bool enable) { mgl_set_light_n(gr, n, enable); } /// Add a light source. - virtual void Light(int n,mglPoint p, mglColor c, mreal bright=0.5, bool infty=true, mreal ap=0); //=0 + inline void AddLight(int n, mglPoint p, char col='w', float bright=0.5, bool infty=true, float ap=0) + { mgl_add_light_ext(gr, n, p.x, p.y, p.z, col, bright, infty, ap); } /// Set ambient light brightness - virtual void Ambient(mreal bright=0.5); + inline void SetAmbient(float i) { mgl_set_ambbr(gr, i); } + /// Set the fog distance or switch it off (if d=0). + inline void Fog(float d, float dz=0.25) { mgl_set_fog(gr, d, dz); } + /// Set relative width of rectangles in Bars, Barh, BoxPlot - inline void SetBarWidth(mreal val) { BarWidth=val; }; + inline void SetBarWidth(float width) { mgl_set_bar_width(gr, width); } /// Set size of marks - inline void SetMarkSize(mreal val) { MarkSize=val; }; + inline void SetMarkSize(float size) { mgl_set_mark_size(gr, size); } /// Set size of arrows - inline void SetArrowkSize(mreal val) { ArrowSize=val; }; - /// Set PlotFactor - inline void SetPlotFactor(mreal val) - { PlotFactor = val>0?val:1.55; AutoPlotFactor=(val<=0); }; + inline void SetArrowSize(float size) { mgl_set_arrow_size(gr, size); } + /// Set number of mesh lines + inline void SetMeshNum(int num) { mgl_set_meshnum(gr, num); } + /// Set cutting for points outside of bounding box - inline void SetCut(bool val) { Cut=val; }; + inline void SetCut(bool cut) { mgl_set_cut(gr, cut); } /// Set additional cutting box - inline void SetCutBox (float x1, float y1, float z1, float x2, float y2, float z2) - { CutMin=mglPoint(x1,y1,z1); CutMax=mglPoint(x2,y2,z2); }; - /// Set base width for all lines - inline void SetBaseLineWidth(mreal val) { BaseLineWidth=val; }; - /// Sets color for individual palette entry - inline void SetPalColor (int n, float r, float g, float b) - { if(n<100) Pal[n] = mglColor(r,g,b); }; - /// Set number of colors in palette - inline void SetPalNum(int num) { if(num<100 && num>0) NumPal = num; }; - /// Set palette - inline void SetPalette(const char *colors) - { strcpy(DefPal, colors?colors:MGL_DEF_PAL); SetPal(colors); } - /// Set colormap scheme for surfaces (usualy called internaly) - void SetScheme(const char *sch, bool face=true); - /// Set the parameter of line (usualy called internaly) - char SelectPen(const char *pen); + inline void SetCutBox(mglPoint p1, mglPoint p2) + { mgl_set_cut_box(gr, p1.x, p1.y, p1.z, p2.x, p2.y, p2.z); } + /// Set the cutting off condition (formula) + inline void CutOff(const char *EqC) { mgl_set_cutoff(gr, EqC); } + + /// Set default font size + inline void SetFontSize(float size) { mgl_set_font_size(gr, size); } + /// Set default font style and color + inline void SetFontDef(const char *fnt) { mgl_set_font_def(gr, fnt); } + /// Set FontSize by size in pt and picture DPI (default is 16 pt for dpi=72) + virtual void SetFontSizePT(float pt, int dpi=72){ SetFontSize(pt*27.f/dpi); } + /// Set FontSize by size in centimeters and picture DPI (default is 0.56 cm = 16 pt) + inline void SetFontSizeCM(float cm, int dpi=72) { SetFontSizePT(cm*28.45f,dpi); } + /// Set FontSize by size in inch and picture DPI (default is 0.22 in = 16 pt) + inline void SetFontSizeIN(float in, int dpi=72) { SetFontSizePT(in*72.27f,dpi); } + /// Load font from file + inline void LoadFont(const char *name, const char *path=NULL) + { mgl_load_font(gr, name, path); } + /// Copy font from another mglGraph instance + inline void CopyFont(mglGraph *GR) { mgl_copy_font(gr, GR->Self());} + /// Restore font + inline void RestoreFont() { mgl_restore_font(gr); } + /// Set to use or not text rotation + inline void SetRotatedText(bool rotated) { mgl_set_rotated_text(gr, rotated); } + + /// Set default palette + inline void SetPalette(const char *colors) { mgl_set_palette(gr, colors); } + + /// Get last warning code + inline int GetWarn() { return mgl_get_warn(gr);} + /// Set warning code ant fill message + inline void SetWarn(int code, const char *info="") { mgl_set_warn(gr,code,info); } + /// Set buffer for warning messages + inline void Message(char *buf) { mgl_buf_warn(gr, buf); } + + /// Set range in direction dir as [v1, v2] + inline void SetRange(char dir, float v1, float v2) + { mgl_set_range_val(gr, dir, v1, v2); } + /// Set range in direction dir as minimal and maximal values of data a + inline void SetRange(char dir, const mglDataA &dat, bool add=false) + { mgl_set_range_dat(gr, dir, &dat, add); } + /// Set values of mglGraph::Min and mglGraph::Max as minimal and maximal values of datas + inline void SetRanges(const mglData &xx, const mglData &yy, const mglData &zz, const mglData &cc) + { mgl_set_range_dat(gr,'x',&xx,0); mgl_set_range_dat(gr,'y',&yy,0); + mgl_set_range_dat(gr,'z',&zz,0); mgl_set_range_dat(gr,'c',&cc,0); } + /// Set values of mglGraph::Min and mglGraph::Max as minimal and maximal values of datas + inline void SetRanges(const mglData &xx, const mglData &yy, const mglData &zz) + { mgl_set_range_dat(gr,'x',&xx,0); mgl_set_range_dat(gr,'y',&yy,0); + mgl_set_range_dat(gr,'z',&zz,0); mgl_set_range_dat(gr,'c',&zz,0); } + /// Set values of mglGraph::Min and mglGraph::Max as minimal and maximal values of datas + inline void SetRanges(const mglData &xx, const mglData &yy) + { mgl_set_range_dat(gr,'x',&xx,0); mgl_set_range_dat(gr,'y',&yy,0); } + /// Set values of mglGraph::Min and mglGraph::Max + inline void SetRanges(float x1, float x2, float y1, float y2, float z1=0, float z2=0) + { mgl_set_ranges(gr, x1, x2, y1, y2, z1, z2); } + /// Set values of mglGraph::Min and mglGraph::Max + inline void SetRanges(mglPoint p1, mglPoint p2) + { mgl_set_ranges(gr, p1.x, p2.x, p1.y, p2.y, p1.z, p2.z); } + /// Set axis origin + inline void SetOrigin(mglPoint p) + { mgl_set_origin(gr, p.x, p.y, p.z); } + inline void SetOrigin(float x0, float y0, float z0=NaN) + { mgl_set_origin(gr, x0, y0, z0); } + + /// Set the transformation formulas for coordinate + inline void SetFunc(const char *EqX, const char *EqY, const char *EqZ=NULL, const char *EqA=NULL) + { mgl_set_func(gr, EqX, EqY, EqZ, EqA); } + /// Set one of predefined transformation rule + inline void SetCoor(int how) { mgl_set_coor(gr, how); } + /// Set to draw Ternary axis (triangle like axis, grid and so on) + inline void Ternary(int val) { mgl_set_ternary(gr, val); } + + /// Set to use or not tick labels rotation + inline void SetTickRotate(bool val) { mgl_set_tick_rotate(gr,val); } + /// Set to use or not tick labels skipping + inline void SetTickSkip(bool val) { mgl_set_tick_skip(gr,val); } + /// Set tick length + inline void SetTickLen(float len, float stt=1) + { mgl_set_tick_len(gr, len, stt); } + /// Set axis and ticks style + inline void SetAxisStl(const char *stl="k", const char *tck=0, const char *sub=0) + { mgl_set_axis_stl(gr, stl, tck, sub); } + + /// Set time templates for ticks + inline void SetTickTime(char dir, float d, const char *t="") + { mgl_set_tick_time(gr,dir,d,t); } + /// Set ticks text (\n separated). Use "" to disable this feature. + inline void SetTicksVal(char dir, const char *lbl, bool add=false) + { mgl_set_ticks_str(gr,dir,lbl,add); } + inline void SetTicksVal(char dir, const wchar_t *lbl, bool add=false) + { mgl_set_ticks_wcs(gr,dir,lbl,add); } + /// Set ticks position and text (\n separated). Use "" to disable this feature. + inline void SetTicksVal(char dir, const mglDataA &v, const char *lbl, bool add=false) + { mgl_set_ticks_val(gr,dir,&v,lbl,add); } + inline void SetTicksVal(char dir, const mglDataA &v, const wchar_t *lbl, bool add=false) + { mgl_set_ticks_valw(gr,dir,&v,lbl,add); } /// Set the ticks parameters - void SetTicks(char dir, mreal d=-5, int ns=0, mreal org=NAN); - /// Set ticks position and text (use n=0 to disable this feature) - void SetTicksVal(char dir, int n, mreal *val, const char **lbl); - void SetTicksVal(char dir, int n, mreal *val, const wchar_t **lbl); - void SetTicksVal(char dir, int n, double val, const char *lbl, ...); - /// Set templates for ticks - inline void SetXTT(const wchar_t *t) { wcscpy(xtt,t); }; - inline void SetYTT(const wchar_t *t) { wcscpy(ytt,t); }; - inline void SetZTT(const wchar_t *t) { wcscpy(ztt,t); }; - inline void SetCTT(const wchar_t *t) { wcscpy(ctt,t); }; - inline void SetXTT(const char *t) { mbstowcs(xtt,t,strlen(t)+1); }; - inline void SetYTT(const char *t) { mbstowcs(ytt,t,strlen(t)+1); }; - inline void SetZTT(const char *t) { mbstowcs(ztt,t,strlen(t)+1); }; - inline void SetCTT(const char *t) { mbstowcs(ctt,t,strlen(t)+1); }; + inline void SetTicks(char dir, float d=0, int ns=0, float org=NaN) + { mgl_set_ticks(gr, dir, d, ns, org); } /// Auto adjust ticks - void AdjustTicks(const char *dir="xyzc"); + inline void Adjust(const char *dir="xyzc") + { mgl_adjust_ticks(gr, dir); } + /// Set templates for ticks + inline void SetTickTempl(char dir, const char *t) + { mgl_set_tick_templ(gr,dir,t); } + inline void SetTickTempl(char dir, const wchar_t *t) + { mgl_set_tick_templw(gr,dir,t); } /// Tune ticks - inline void SetTuneTicks(int tune, mreal pos=1.15) - { TuneTicks = tune; FactorPos = pos; }; - /// Set ticks styles - void SetTickStl(const char *stl, const char *sub=0); - /// Set ticks length - void SetTickLen(mreal tlen, mreal stt=1.); - /// Set warning code ant fill Message - void SetWarn(int code, const char *who=""); - /// Set number of mesh lines - inline void SetMeshNum(int val) { MeshNum=val; }; - /// Set default axial direction - inline void SetAxialDir(char val) { AxialDir=val; }; - /// Enable/disable face drawing (for speeding up) - inline void SetDrawFace(bool val) { DrawFace=val; }; - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name Plot positioning functions - * These functions control how and where further plotting will be placed. - * There are a curtain order of these functions calls for - * the better plot view. First one is mglGraph::SubPlot or mglGraph::InPlot - * for specifing the place. After it a mglGraph::Aspect and mglGraph::Rotate. - * And finally any other plotting functions may be called. The function mglGraph::View - * can be used in any place. */ - //@{ - /// Set angle of view indepently from mglGraph::Rotate(). - virtual void View(mreal tetx,mreal tetz,mreal tety=0); - inline int GetWarn() { return WarnCode; }; - virtual void DefaultPlotParam(); ///< Set default parameter for plotting - /// Zoom in or zoom out (if Zoom(0, 0, 1, 1)) a part of picture - void Zoom(mreal x1, mreal y1, mreal x2, mreal y2); - /// Clear transformation matrix. - void Identity(bool rel=false); - /// Push transformation matrix into stack - virtual void Push()=0; - /// Pop transformation matrix from stack - virtual void Pop()=0; - /// Clear up the frame - virtual void Clf(mglColor Back=WC); //=0 + inline void SetTuneTicks(int tune, float fact_pos=1.15) + { mgl_tune_ticks(gr, tune, fact_pos); } + + /// Put further plotting in some region of whole frame surface. + inline void SubPlot(int nx,int ny,int m, float dx=0, float dy=0) + { mgl_subplot_d(gr, nx, ny, m, dx, dy); } + /// Put further plotting in some region of whole frame surface (adjust size according reservations). + inline void SubPlot(int nx,int ny,int m, const char *style) + { mgl_subplot_s(gr, nx, ny, m, style); } + /// Like SubPlot bot "join" several cells + inline void MultiPlot(int nx,int ny,int m, int dx, int dy, const char *style="<>_^") + { mgl_multiplot(gr, nx, ny, m, dx, dy, style); } /// Put further plotting in some region of whole frame surface. - void SubPlot(int nx,int ny,int m, mreal dx=0, mreal dy=0); - void SubPlot(int nx,int ny,int m, const char *style); + inline void InPlot(float x1,float x2,float y1,float y2, bool rel=true) + { if(rel) mgl_inplot(gr, x1, x2, y1, y2); + else mgl_relplot(gr, x1, x2, y1, y2); } /// Put further plotting in column cell of previous subplot - void ColumnPlot(int num, int i, mreal d=0); + inline void ColumnPlot(int num, int ind, float d=0) + { mgl_columnplot_d(gr,num,ind,d); } /// Put further plotting in cell of stick rotated on angles tet, phi - virtual void StickPlot(int num, int i, mreal tet, mreal phi)=0; - /// Put further plotting in some region of whole frame surface. - virtual void InPlot(mreal x1,mreal x2,mreal y1,mreal y2,bool rel=true); //=0 + inline void StickPlot(int num, int i, float tet, float phi) + { mgl_stickplot(gr,num,i,tet,phi); } + + /// Add title for current subplot/inplot + inline void Title(const char *title,const char *stl="#",float size=-2) + { mgl_title(gr,title,stl,size); } + inline void Title(const wchar_t *title,const char *stl="#",float size=-2) + { mgl_titlew(gr,title,stl,size); } /// Set aspect ratio for further plotting. - virtual void Aspect(mreal Ax,mreal Ay,mreal Az)=0; + inline void Aspect(float Ax,float Ay,float Az) + { mgl_aspect(gr, Ax, Ay, Az); } /// Rotate a further plotting. - virtual void Rotate(mreal TetX,mreal TetZ,mreal TetY=0); + inline void Rotate(float TetX,float TetZ=0,float TetY=0) + { mgl_rotate(gr, TetX, TetZ, TetY); } /// Rotate a further plotting around vector {x,y,z}. - virtual void RotateN(mreal Tet,mreal x,mreal y,mreal z)=0; + inline void RotateN(float Tet,float x,float y,float z) + { mgl_rotate_vector(gr, Tet, x, y, z); } /// Set perspective (in range [0,1)) for plot. Set to zero for switching off. - virtual void Perspective(mreal a)=0; + inline void Perspective(float val) + { mgl_perspective(gr, val); } + /// Set angle of view independently from Rotate(). + inline void View(float TetX,float TetZ=0,float TetY=0) + { mgl_view(gr, TetX, TetZ, TetY); } + /// Set size of frame in pixels. Normally this function is called internaly. - virtual void SetSize(int w,int h); - //@} - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name Axis functions - * Axis functions control and draw the axes. There is twofold axis - * representation in MathGL. First the coordinates of data point are - * normalized in box mglGraph::Min X mglGraph::Max. If mglGraph::Cut is true - * then point is omitted otherwise it is projected to bounding box. - * After it transformation formulas mglGraph::fx, mglGraph::fy, mglGraph::fz - * are applied to the data point. Finally, the data point is plotted by - * one of function. There is possibility to set members mglGraph::Max, - * mglGraph::Min, mglGraph::fx, mglGraph::fy, mglGraph::fz directly. But one - * should call mglGraph::RecalcBorder function to setup plotting routines. - * The more safe way is to set these values by calling mglGraph::Axis functions. - * In this case the function mglGraph::RecalcBorder is called automaticly. */ - //@{ - /// Draws bounding box outside the plotting volume. - void Box(mglColor pen, bool ticks=true); - /// Draws bounding box outside the plotting volume with color \a c. - void Box(const char *col=0, bool ticks=true); + inline void SetSize(int width, int height) { mgl_set_size(gr, width, height); } + /// Set plot quality + inline void SetQuality(int qual=MGL_DRAW_NORM) { mgl_set_quality(gr, qual); } + /// Start group of objects + inline void StartGroup(const char *name){ mgl_start_group(gr, name); } + /// End group of objects + inline void EndGroup() { mgl_end_group(gr); } + + /// Show currently produced image + inline void ShowImage(const char *viewer, bool keep=0) + { mgl_show_image(gr, viewer, keep); } + /// Write the frame in file (depending extension, write current frame if fname is empty) + inline void WriteFrame(const char *fname=0,const char *descr="") + { mgl_write_frame(gr, fname, descr); } + /// Write the frame in file using IDTF format + inline void WriteIDTF(const char *fname,const char *descr="") + { mgl_write_idtf(gr, fname, descr); } + /// Write the frame in file using JPEG format + inline void WriteJPEG(const char *fname,const char *descr="") + { mgl_write_jpg(gr, fname, descr); } + /// Write the frame in file using PNG format with transparency + inline void WritePNG(const char *fname,const char *descr="", bool alpha=true) + { if(alpha) mgl_write_png(gr, fname, descr); + else mgl_write_png_solid(gr, fname, descr); } + /// Write the frame in file using BMP format + inline void WriteBMP(const char *fname,const char *descr="") + { mgl_write_bmp(gr, fname, descr); } + /// Write the frame in file using BMP format + inline void WriteTGA(const char *fname,const char *descr="") + { mgl_write_tga(gr, fname, descr); } + /// Write the frame in file using PostScript format + inline void WriteEPS(const char *fname,const char *descr="") + { mgl_write_eps(gr, fname, descr); } + /// Write the frame in file using PostScript format as bitmap + void WriteBPS(const char *fname,const char *descr="") + { mgl_write_bps(gr, fname, descr); } + /// Write the frame in file using SVG format + inline void WriteSVG(const char *fname,const char *descr="") + { mgl_write_svg(gr, fname, descr); } + /// Write the frame in file using GIF format (only for current frame!) + inline void WriteGIF(const char *fname,const char *descr="") + { mgl_write_gif(gr, fname, descr); } + + /// Create new frame. + inline void NewFrame() { mgl_new_frame(gr); } + /// Finish frame drawing + inline void EndFrame() { mgl_end_frame(gr); } + /// Get the number of created frames + inline int GetNumFrame() { return mgl_get_num_frame(gr); } + /// Reset frames counter (start it from zero) + inline void ResetFrames() { mgl_reset_frames(gr); } + /// Start write frames to cinema using GIF format + inline void StartGIF(const char *fname, int ms=100) + { mgl_start_gif(gr, fname,ms); } + /// Stop writing cinema using GIF format + inline void CloseGIF() { mgl_close_gif(gr); } - /// Safety set values of mglGraph::Cmin and mglGraph::Cmax as minimal and maximal values of data a - void CRange(const mglData &a, bool add = false, mreal fact=0); - /// Safety set values of mglGraph::Min.x and mglGraph::Max.x as minimal and maximal values of data a - void XRange(const mglData &a, bool add = false, mreal fact=0); - /// Safety set values of mglGraph::Min.x and mglGraph::Max.x as minimal and maximal values of data a - void YRange(const mglData &a, bool add = false, mreal fact=0); - /// Safety set values of mglGraph::Min.x and mglGraph::Max.x as minimal and maximal values of data a - void ZRange(const mglData &a, bool add = false, mreal fact=0); - /// Safetely set values of mglGraph::Min and mglGraph::Max - void inline SetRanges(mreal x1, mreal x2, mreal y1, mreal y2, mreal z1=0, mreal z2=0) { Axis(mglPoint(x1,y1,z1),mglPoint(x2,y2,z2)); }; - /// Set ranges for automatic variables - void SetAutoRanges(mreal x1, mreal x2, mreal y1=0, mreal y2=0, mreal z1=0, mreal z2=0); + /// Copy RGB values into array which is allocated by user + inline void GetRGB(char *imgdata, int imglen) + { + int w=mgl_get_width(gr); + int h=mgl_get_height(gr); + if(imglen>=3*w*h) memcpy(imgdata, mgl_get_rgb(gr),3*w*h); + } + /// Copy RGBA values into array which is allocated by user + inline void GetRGBA(char *imgdata, int imglen) + { + int w=mgl_get_width(gr); + int h=mgl_get_height(gr); + if(imglen>=4*w*h) memcpy(imgdata, mgl_get_rgba(gr),4*w*h); + } + /// Copy BGRN values into array which is allocated by user + inline void GetBGRN(unsigned char *imgdata, int imglen) + { + int w,h,i; + w=mgl_get_width(gr); + h=mgl_get_height(gr); + const unsigned char *buf=mgl_get_rgb(gr); + if(imglen>=4*w*h) for(i=0;igr); } + /// Send graphical information to node id using MPI + inline void MPI_Send(int id) { mgl_mpi_send(gr,id); } + /// Receive graphical information from node id using MPI + inline void MPI_Recv(int id) { mgl_mpi_recv(gr,id); } + + /// Clear up the frame + inline void Clf(float r, float g, float b) { mgl_clf_rgb(gr, r, g, b); } + inline void Clf() { mgl_clf(gr); } + /// Draws the point (ball) at position {x,y,z} with color c + inline void Ball(mglPoint p, char c) + { char s[3]={'.',c,0}; mgl_mark(gr, p.x, p.y, p.z, s); } + /// Draws the mark at position p + inline void Mark(mglPoint p, const char *mark) + { mgl_mark(gr, p.x, p.y, p.z, mark); } + /// Draws the line between points by specified pen + inline void Line(mglPoint p1, mglPoint p2, const char *pen="B",int n=2) + { mgl_line(gr, p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, pen, n); } + /// Draws the spline curve between points by specified pen + inline void Curve(mglPoint p1, mglPoint d1, mglPoint p2, mglPoint d2, const char *pen="B", int n=100) + { mgl_curve(gr, p1.x, p1.y, p1.z, d1.x, d1.y, d1.z, p2.x, p2.y, p2.z, d2.x, d2.y, d2.z, pen, n); } + /// Draws the 3d error box e for point p + inline void Error(mglPoint p, mglPoint e, const char *pen="k") + { mgl_error_box(gr, p.x, p.y, p.z, e.x, e.y, e.z, pen); } + + /// Draws the face between points with color stl (include interpolation up to 4 colors). + inline void Face(mglPoint p1, mglPoint p2, mglPoint p3, mglPoint p4, const char *stl="r") + { mgl_face(gr, p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, p3.x, p3.y, p3.z, p4.x, p4.y, p4.z, stl); } + /// Draws the face in y-z plane at point p with color stl (include interpolation up to 4 colors). + inline void FaceX(mglPoint p, float wy, float wz, const char *stl="w", float dx=0, float dy=0) + { mgl_facex(gr, p.x, p.y, p.z, wy, wz, stl, dx, dy); } + /// Draws the face in x-z plane at point p with color stl (include interpolation up to 4 colors). + inline void FaceY(mglPoint p, float wx, float wz, const char *stl="w", float dx=0, float dy=0) + { mgl_facey(gr, p.x, p.y, p.z, wx, wz, stl, dx, dy); } + /// Draws the face in x-y plane at point p with color stl (include interpolation up to 4 colors). + inline void FaceZ(mglPoint p, float wx, float wy, const char *stl="w", float dx=0, float dy=0) + { mgl_facez(gr, p.x, p.y, p.z, wx, wy, stl, dx, dy); } + /// Draws the drop at point p in direction d with color col and radius r + inline void Drop(mglPoint p, mglPoint d, float r, const char *col="r", float shift=1, float ap=1) + { mgl_drop(gr, p.x, p.y, p.z, d.x, d.y, d.z, r, col, shift, ap); } + /// Draws the sphere at point p with color col and radius r + inline void Sphere(mglPoint p, float r, const char *col="r") + { mgl_sphere(gr, p.x, p.y, p.z, r, col); } + /// Draws the cone between points p1,p2 with radius r1,r2 with style stl + inline void Cone(mglPoint p1, mglPoint p2, float r1, float r2=-1, const char *stl="B", bool edge=false) + { mgl_cone(gr, p1.x, p1.y, p1.z, p2.x, p2.y, p2.z,r1,r2,stl,edge); } + /// Draws the ellipse between points p1,p2 with color stl and width r + inline void Ellipse(mglPoint p1, mglPoint p2, float r, const char *stl="r") + { mgl_ellipse(gr, p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, r,stl); } + /// Draws the circle at point p with color stl and radius r + inline void Circle(mglPoint p, float r, const char *stl="r") + { mgl_ellipse(gr, p.x, p.y, p.z, p.x, p.y, p.z, r,stl); } + /// Draws the rhomb between points p1,p2 with color stl and width r + inline void Rhomb(mglPoint p1, mglPoint p2, float r, const char *stl="r") + { mgl_rhomb(gr, p1.x, p1.y, p1.z, p2.x, p2.y, p2.z, r,stl); } + + /// Print text in position p with specified font + inline void Putsw(mglPoint p,const wchar_t *text,const char *font=":C",float size=-1) + { mgl_putsw(gr, p.x, p.y, p.z, text, font, size); } + inline void Puts(mglPoint p,const char *text,const char *font=":C",float size=-1) + { mgl_puts(gr, p.x, p.y, p.z, text, font, size); } + /// Print text in position p along direction d with specified font + inline void Putsw(mglPoint p, mglPoint d, const wchar_t *text, const char *font=":L", float size=-1) + { mgl_putsw_dir(gr, p.x, p.y, p.z, d.x, d.y, d.z, text, font, size); } + inline void Puts(mglPoint p, mglPoint d, const char *text, const char *font=":L", float size=-1) + { mgl_puts_dir(gr, p.x, p.y, p.z, d.x, d.y, d.z, text, font, size); } + /// Print the label \a text at arbitrary position {x,y} of plot. + void Label(double x, double y, const char *text, const char *fnt=0) + { mgl_label_xy(gr,x,y,text,fnt); } + void Label(double x, double y, const wchar_t *text, const char *fnt=0) + { mgl_labelw_xy(gr,x,y,text,fnt); } + + /// Print text along the curve + inline void Text(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *text, const char *font="", const char *opt="") + { mgl_text_xyz(gr, &x, &y, &z, text, font, opt); } + inline void Text(const mglDataA &x, const mglDataA &y, const char *text, const char *font="", const char *opt="") + { mgl_text_xy(gr, &x, &y, text, font, opt); } + inline void Text(const mglDataA &y, const char *text, const char *font="", const char *opt="") + { mgl_text_y(gr, &y, text, font, opt); } + inline void Text(const mglDataA &x, const mglDataA &y, const mglDataA &z, const wchar_t *text, const char *font="", const char *opt="") + { mgl_textw_xyz(gr, &x, &y, &z, text, font, opt); } + inline void Text(const mglDataA &x, const mglDataA &y, const wchar_t *text, const char *font="", const char *opt="") + { mgl_textw_xy(gr, &x, &y, text, font, opt); } + inline void Text(const mglDataA &y, const wchar_t *text, const char *font="", const char *opt="") + { mgl_textw_y(gr, &y, text, font, opt); } + + /// Draws bounding box outside the plotting volume with color \a c. + inline void Box(const char *col="k", bool ticks=true) + { mgl_box_str(gr, col, ticks); } /// Draw axises with ticks in directions determined by string parameter \a dir. - void Axis(const char *dir="xyzt", bool adjust=false); + inline void Axis(const char *dir="xyzt", bool adjust=false) + { mgl_axis(gr, dir,adjust); } /// Draw grid lines perpendicular to direction determined by string parameter \a dir. - void Grid(const char *dir="xyzt",const char *pen="B-"); + inline void Grid(const char *dir="xyzt",const char *pen="B") + { mgl_axis_grid(gr, dir, pen); } /// Print the label \a text for axis \a dir. - void Label(char dir, const char *text, mreal pos=0, mreal size=-1.4, mreal shift=0); - void Labelw(char dir, const wchar_t *text, mreal pos=0, mreal size=-1.4, mreal shift=0); - /// Print the \a text at arbitrary position of the picture \a x, \a y in range [0,1]x[0,1]. - void Label(mreal x, mreal y, const char *text, const char *fnt=0, mreal size=-1.4, bool rel=false); - void Labelw(mreal x, mreal y, const wchar_t *text, const char *fnt=0, mreal size=-1.4, bool rel=false); - /// Draw colorbar at edge of axis - void Colorbar(const char *sch=0,int where=0); - void inline Colorbar(const char *sch, int where, mreal x, mreal y, mreal w, mreal h) { SetScheme(sch); Colorbar(where,x,y,w,h); }; - void Colorbar(int where, mreal x, mreal y, mreal w, mreal h); + inline void Label(char dir, const char *text, float pos=+1, float shift=0) + { mgl_label_ext(gr, dir, text, pos, shift); } + inline void Label(char dir, const wchar_t *text, float pos=+1, float shift=0) + { mgl_labelw_ext(gr, dir, text, pos, shift); } + /// Draw colorbar at edge of axis - void Colorbar(const mglData &v, const char *sch=0,int where=0); - void Colorbar(const mglData &v, const char *sch, int where, mreal x, mreal y, mreal w, mreal h); - //@} - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name Primitive functions - * These functions draw the simplest primitives, like line, point, sphere, drop, cone and so on. */ - //@{ - /// Draws the point (ball) at position \a {x,y,z} with color \a col. - virtual void Ball(mreal x,mreal y,mreal z,mglColor col=RC,mreal alpha=1)=0; - /// Draws the point (ball) at position \a p with color \a col. - inline void Ball(mglPoint p, char col='r') { Ball(p.x,p.y,p.z,mglColor(col)); }; - /// Draws the 3d error box e for point p - void Error(mglPoint p, mglPoint e, const char *pen=0); - /// Draws the line between points with style \a stl. - void Line(mglPoint p1, mglPoint p2, const char *stl="B", int num=2); - /// Draws the spline curve between points with style \a stl. - void Curve(mglPoint p1, mglPoint d1, mglPoint p2, mglPoint d2, const char *stl="B",int num=100); - /// Draws the face between points with color \a stl (include interpolation up to 4 colors). - void Face(mglPoint p1, mglPoint p2, mglPoint p3, mglPoint p4, const char *stl="w", int num=2, mreal val=NAN); - void FaceX(mreal x0, mreal y0, mreal z0, mreal wy, mreal wz, const char *stl="w", mreal dx=0, mreal dy=0); - void FaceY(mreal x0, mreal y0, mreal z0, mreal wx, mreal wz, const char *stl="w", mreal dx=0, mreal dy=0); - void FaceZ(mreal x0, mreal y0, mreal z0, mreal wx, mreal wy, const char *stl="w", mreal dx=0, mreal dy=0); - /// Draws the sphere at point \a p with color \a stl and radius \a r. - void Sphere(mglPoint p, mreal r, const char *stl="r"); - /// Draws the ellipsoid at point \a p with color \a stl and radiuses \a r. - void Ellipse(mglPoint p, mglPoint r, const char *stl="r"); - /// Draws the drop at point \a p in direction \a q with color \a stl and radius \a r. - void Drop(mglPoint p, mglPoint q, mreal r, const char *stl="r", mreal shift=1, mreal ap=1); - /// Draws the drop at point \a p in direction \a q with color \a stl and radius \a r. - void Drop(mglPoint p, mglPoint q, mreal r, mglColor c, mreal shift=1, mreal ap=1); - /// Draws the line between points with style \a stl. - void Cone(mglPoint p1, mglPoint p2, mreal r1, mreal r2=-1, const char *stl="B", bool edge=false); - /// draw mark with different type at position {x,y,z} (no scaling) - void Mark(mglPoint p,char mark='.'); - /// Draw a set of triangles (or lines if trig==NULL) for glyph from point (0,0). Normally this function is used internally. - virtual void Glyph(mreal x, mreal y, mreal f, int style, long icode, char col)=0; - //@} - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name Histogram functions - * These functions make histogram (distribution) of data. This functions do not draw obtained curve itself.*/ - //@{ - void Hist(mglData &res, const mglData &x, const mglData &a); - void Hist(mglData &res, const mglData &x, const mglData &y, const mglData &a); - void Hist(mglData &res, const mglData &x, const mglData &y, const mglData &z, const mglData &a); - //@} - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name Fitting functions - * These functions fit data to formula (find formula parameters for best fitting the data points). This functions do not draw obtained curve itself.*/ - //@{ - /// Fit data along x-direction for each data row. Data 'fit' will contain values for found formula. - mreal Fit(mglData &fit, const mglData &y, const char *eq, const char *var, mreal *ini=0, bool print=false); - mreal Fit(mglData &fit, const mglData &y, const char *eq, const char *var, mglData &ini, bool print=false); - /// Fit data along x-,y-directions for each data slice. Data 'fit' will contain values for found formula. - mreal Fit2(mglData &fit, const mglData &z, const char *eq, const char *var, mreal *ini=0, bool print=false); - mreal Fit2(mglData &fit, const mglData &z, const char *eq, const char *var, mglData &ini, bool print=false); - /// Fit data along all directions. Data 'fit' will contain values for found formula. - mreal Fit3(mglData &fit, const mglData &a, const char *eq, const char *var, mreal *ini=0, bool print=false); - mreal Fit3(mglData &fit, const mglData &a, const char *eq, const char *var, mglData &ini, bool print=false); - /// Fit data along x-direction for each data row. Data 'fit' will contain values for found formula. - mreal Fit(mglData &fit, const mglData &x, const mglData &y, const char *eq, const char *var, mreal *ini=0, bool print=false); - mreal Fit(mglData &fit, const mglData &x, const mglData &y, const char *eq, const char *var, mglData &ini, bool print=false); - /// Fit data along x-,y-directions for each data slice. Data 'fit' will contain values for found formula. - mreal Fit(mglData &fit, const mglData &x, const mglData &y, const mglData &z, const char *eq, const char *var, mreal *ini=0, bool print=false); - mreal Fit(mglData &fit, const mglData &x, const mglData &y, const mglData &z, const char *eq, const char *var, mglData &ini, bool print=false); - /// Fit data along all directions. Data 'fit' will contain values for found formula. - mreal Fit(mglData &fit, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *eq, const char *var, mreal *ini=0, bool print=false); - mreal Fit(mglData &fit, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *eq, const char *var, mglData &ini, bool print=false); - /// Fit data with dispersion s along x-direction for each data row. Data 'fit' will contain values for found formula. - mreal FitS(mglData &fit, const mglData &y, const mglData &s, const char *eq, const char *var, mreal *ini=0, bool print=false); - mreal FitS(mglData &fit, const mglData &y, const mglData &s, const char *eq, const char *var, mglData &ini, bool print=false); - /// Fit data with dispersion s along x-direction for each data row. Data 'fit' will contain values for found formula. - mreal FitS(mglData &fit, const mglData &x, const mglData &y, const mglData &s, const char *eq, const char *var, mreal *ini=0, bool print=false); - mreal FitS(mglData &fit, const mglData &x, const mglData &y, const mglData &s, const char *eq, const char *var, mglData &ini, bool print=false); - /// Fit data with dispersion s along x-,y-directions for each data slice. Data 'fit' will contain values for found formula. - mreal FitS(mglData &fit, const mglData &x, const mglData &y, const mglData &z, const mglData &s, const char *eq, const char *var, mreal *ini=0, bool print=false); - mreal FitS(mglData &fit, const mglData &x, const mglData &y, const mglData &z, const mglData &s, const char *eq, const char *var, mglData &ini, bool print=false); - /// Fit data with dispersion s along all directions. Data 'fit' will contain values for found formula. - mreal FitS(mglData &fit, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &s, const char *eq, const char *var, mreal *ini=0, bool print=false); - mreal FitS(mglData &fit, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &s, const char *eq, const char *var, mglData &ini, bool print=false); - /// Print fitted last formula (with coefficients) - void PutsFit(mglPoint p, const char *prefix=0, const char *font=0, mreal size=-1); - /// Get last fitted formula - inline const char *GetFit() { return fit_res; }; - //@} - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name Text functions - * Text functions draw the text. There is a function for drawing text in arbitrary place, in arbitrary direction and along arbitrary curve. The font style for text is specified by string argument. The size argument control the size of text: if positive it give the value if negative it give the value relative to FontSize. The font type (STIX, arial, courier, times and so on) can be selected by function SetFont(), GetFont().*/ - //@{ - /// Set FontSize by size in pt and picture DPI (default is 16 pt for dpi=72) - virtual void SetFontSizePT(mreal pt, int dpi=72); - /// Set FontSize by size in centimeters and picture DPI (default is 0.56 cm = 16 pt) - inline void SetFontSizeCM(mreal cm, int dpi=72) - { SetFontSizePT(cm*28.45f,dpi); }; - /// Set FontSize by size in inch and picture DPI (default is 0.22 in = 16 pt) - inline void SetFontSizeIN(mreal in, int dpi=72) - { SetFontSizePT(in*72.27f,dpi); }; - /// Set font typeface. Note that each mglFont instance can be used with ONLY ONE mglGraph instance at a moment of time! - void SetFont(mglFont *f); - /// Get current typeface. Note that this variable can be deleted at next SetFont() call! - inline mglFont *GetFont() { return fnt; }; - /// Restore font - inline void RestoreFont() { fnt->Restore(); }; - /// Load font from file - inline void LoadFont (const char *name, const char *path=NULL) - { fnt->Load(name,path); }; - /// Copy font from another mglGraph instance - inline void CopyFont(mglGraph *gr) { fnt->Copy(gr->GetFont()); }; - /// Set default font size - inline void SetFontSize(mreal val) { FontSize=val; }; - /// Set to use or not text rotation - inline void SetRotatedText(bool val) { RotatedText=val; }; - /// Set default font style and color - inline void SetFontDef(const char *fnt) { strncpy(FontDef, fnt, 31); }; - /// Get ratio (mreal width)/(mreal height). - virtual mreal GetRatio(); - /// Print string \a str in position \a p with font size \a size. - void Puts(mglPoint p,const char *text,const char *font=0,mreal size=-1,char dir=0,mreal shift=0); - /// Print string \a str in position \a p with font size \a size. - virtual void Putsw(mglPoint p,const wchar_t *text,const char *font=0,mreal size=-1,char dir=0,mreal shift=0)=0; - /// Print string \a str with font size \a size in position \a p along direction \a l. - mreal Puts(mglPoint p,mglPoint l,const char *text,char font='t',mreal size=-1); - /// Print string \a str with font size \a size in position \a p along direction \a l. - virtual mreal Putsw(mglPoint p,mglPoint l,const wchar_t *text,char font='t',mreal size=-1)=0; - /// Print unrotated string \a str in position \a p with font size \a size. - void Text(mglPoint p,const char *text,const char *font=0,mreal size=-1.4,char dir=0); - /// Print unrotated string \a str in position \a p with font size \a size. - void Text(mglPoint p,const wchar_t *text,const char *font=0,mreal size=-1.4,char dir=0); - /// Print the title text for the picture - void Title(const wchar_t *text,const char *font=0,mreal size=-2); - void Title(const char *text,const char *font=0,mreal size=-2); - /// Print formated output in position \a p. - void Printf(mglPoint p,const char *arg,...); - /// Print string \a str along curve with font size \a size. - void Text(const mglData &y,const char *text,const char *font=0,mreal size=-1,mreal zVal=NAN); - /// Print string \a str along parametrical curve with font size \a size. - void Text(const mglData &x,const mglData &y,const char *text,const char *font=0,mreal size=-1,mreal zVal=NAN); - /// Print string \a str along curve in 3D with font size \a size. - void Text(const mglData &x,const mglData &y,const mglData &z,const char *text,const char *font=0,mreal size=-1); - /// Print string \a str along curve with font size \a size. - void Text(const mglData &y,const wchar_t *text,const char *font=0,mreal size=-1,mreal zVal=NAN); - /// Print string \a str along parametrical curve with font size \a size. - void Text(const mglData &x,const mglData &y,const wchar_t *text,const char *font=0,mreal size=-1,mreal zVal=NAN); - /// Print string \a str along curve in 3D with font size \a size. - void Text(const mglData &x,const mglData &y,const mglData &z,const wchar_t *text,const char *font=0,mreal size=-1); + inline void Colorbar(const char *sch="",int where=0) + { mgl_colorbar(gr, sch, where); } + inline void Colorbar(const char *sch,int where,float x,float y,float w,float h) + { mgl_colorbar_ext(gr, sch, where,x,y,w,h); } + inline void Colorbar(int where,float x,float y,float w,float h) + { mgl_colorbar_ext(gr, 0, where,x,y,w,h); } + /// Draw colorbar with manual colors at edge of axis + inline void Colorbar(const mglDataA &val, const char *sch="",int where=0) + { mgl_colorbar_val(gr, &val, sch, where); } + inline void Colorbar(const mglDataA &val, const char *sch,int where,float x,float y,float w,float h) + { mgl_colorbar_val_ext(gr, &val, sch, where, x,y,w,h); } - //@} - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name Legend functions - * Legend functions accumulate and draw legend strings. There is twofold legend representation in MathGL. First the string array can be drawn directly. Second the string can be accumulated in internal array (by AddLegend() function) and later drawn. The position of legend can be specified manually or by corner of plot (default is right-top). */ - //@{ - /// Add string to legend - void AddLegend(const char *text,const char *style); /// Add string to legend - void AddLegend(const wchar_t *text,const char *style); + inline void AddLegend(const char *text,const char *style) + { mgl_add_legend(gr, text, style); } + inline void AddLegend(const wchar_t *text,const char *style) + { mgl_add_legendw(gr, text, style); } /// Clear saved legend string - void ClearLegend(); - /// Draw legend of accumulated strings at position (x, y) by \a font with \a size - void Legend(mreal x, mreal y, const char *font="rL", mreal size=-0.8, mreal llen=0.1); - /// Draw legend of accumulated strings by \a font with \a size - void Legend(int where=0x3, const char *font="rL", mreal size=-0.8, mreal llen=0.1); - /// Draw legend strings \a text at position (x, y) by \a font with \a size - virtual void Legend(int n, wchar_t **text, char **style, mreal x, mreal y, const char *font="rL", mreal size=-0.8, mreal llen=0.1)=0; - /// Draw legend of accumulated strings by \a font with \a size - void Legend(int n, wchar_t **text, char **style, int where=0x3, const char *font="rL", mreal size=-0.8, mreal llen=0.1); - /// Switch on/off box around legend - inline void SetLegendBox(bool val) { LegendBox=val; }; - /// Number of marks in legend sample - inline void SetLegendMarks(int num=1) { LegendMarks = num>0?num:1; }; - //@} - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ������� ~~~~~~~~~~~~~~~~~~~~~~~~ - /// Plot data depending on its dimensions and \a type parameter - void SimplePlot(const mglData &a, int type=0, const char *stl=0); - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name 1D plotting functions - * These functions perform plotting of 1D data. 1D means that data - * depended from only 1 parameter like parametric \b curve {x(i),y(i),z(i)}, - * i=1...n. There are 5 generally different types of data representations: - * simple line plot (\c Plot), line plot with filling under it (\c Area), - * stairs plot (\c Step), bar plot (\c Bars,\c Barh) and vertical lines (\c Stem). - * Each type of plotting has similar interface. There are 3D version and - * two 2D versions. One of last requires only one array. - * The parameters of line and marks are specified by the string argument - * (see mglGraph::SelectPen). If the string parameter is NULL - * then solid line with color from palette is used. */ - //@{ - /// Draw curve for formula with x in range [Min.x, Max.x] - void Plot(const char *eqY, const char *pen=0, mreal zVal=NAN, int n=0); - /// Draw curve for formulas parametrically depended on t in range [0,1] - void Plot(const char *eqX, const char *eqY, const char *eqZ, const char *pen=0, int n=0); - - /// Draw line plot for points in arrays \a x, \a y, \a z. - void Plot(const mglData &x, const mglData &y, const mglData &z, const char *pen=0); - /// Draw line plot for points in arrays \a x, \a y. - void Plot(const mglData &x, const mglData &y, const char *pen=0,mreal zVal=NAN); - /// Draw line plot for points in arrays \a y. - void Plot(const mglData &y, const char *pen=0,mreal zVal=NAN); + inline void ClearLegend() + { mgl_clear_legend(gr); } + /// Draw legend of accumulated strings at position {x,y} + inline void Legend(float x, float y, const char *font="#", float size=-0.8, float llen=0) + { mgl_legend_xy(gr, x, y, font, size, llen); } + /// Draw legend of accumulated strings + inline void Legend(int where=3, const char *font="#", float size=-0.8, float llen=0) + { mgl_legend(gr, where, font, size, llen); } + /// Set number of marks in legend sample + inline void SetLegendMarks(int num) { mgl_set_legend_marks(gr, num); } + /// Draw usual curve {x,y,z} + inline void Plot(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *pen="", const char *opt="") + { mgl_plot_xyz(gr, &x, &y, &z, pen, opt); } + inline void Plot(const mglDataA &x, const mglDataA &y, const char *pen="", const char *opt="") + { mgl_plot_xy(gr, &x, &y, pen,opt); } + inline void Plot(const mglDataA &y, const char *pen="", const char *opt="") + { mgl_plot(gr, &y, pen,opt); } /// Draw radar chart (plot in curved coordinates) - void Radar(const mglData &a, const char *stl=0, mreal r=-1); - - void BoxPlot(const mglData &x, const mglData &a, const char *stl=0, mreal zVal=NAN); - void BoxPlot(const mglData &a, const char *stl=0, mreal zVal=NAN); - - /// Draw line plot for points in arrays \a x, \a y, \a z which is colored by \a c (like tension plot). Parameter \a pen set color scheme and line styles (dashing and width). - void Tens(const mglData &x, const mglData &y, const mglData &z, const mglData &c, const char *pen=0); - /// Draw line plot for points in arrays \a x, \a y. - void Tens(const mglData &x, const mglData &y, const mglData &c, const char *pen=0,mreal zVal=NAN); - /// Draw line plot for points in arrays \a y. - void Tens(const mglData &y, const mglData &c, const char *pen=0,mreal zVal=NAN); + inline void Radar(const mglDataA &a, const char *pen="", const char *opt="") + { mgl_radar(gr, &a, pen, opt); } + /// Draw stairs for points in arrays {x,y,z} + inline void Step(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *pen="", const char *opt="") + { mgl_step_xyz(gr, &x, &y, &z, pen, opt); } + inline void Step(const mglDataA &x, const mglDataA &y, const char *pen="", const char *opt="") + { mgl_step_xy(gr, &x, &y, pen, opt); } + inline void Step(const mglDataA &y, const char *pen="", const char *opt="") + { mgl_step(gr, &y, pen, opt); } + /// Draw curve {x,y,z} which is colored by c (like tension plot) + inline void Tens(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &c, const char *pen="", const char *opt="") + { mgl_tens_xyz(gr, &x, &y, &z, &c, pen, opt); } + inline void Tens(const mglDataA &x, const mglDataA &y, const mglDataA &c, const char *pen="", const char *opt="") + { mgl_tens_xy(gr, &x, &y, &c, pen, opt); } + inline void Tens(const mglDataA &y, const mglDataA &c, const char *pen="", const char *opt="") + { mgl_tens(gr, &y, &c, pen, opt); } + /// Fill area between curve {x,y,z} and axis plane + inline void Area(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *pen="", const char *opt="") + { mgl_area_xyz(gr, &x, &y, &z, pen, opt); } + inline void Area(const mglDataA &x, const mglDataA &y, const char *pen="", const char *opt="") + { mgl_area_xy(gr, &x, &y, pen, opt); } + inline void Area(const mglDataA &y, const char *pen="", const char *opt="") + { mgl_area(gr, &y, pen, opt); } + /// Fill area between curves y1 and y2 specified parametrically + inline void Region(const mglDataA &y1, const mglDataA &y2, const char *pen="", const char *opt="") + { mgl_region(gr, &y1, &y2, pen, opt); } + inline void Region(const mglDataA &x, const mglDataA &y1, const mglDataA &y2, const char *pen="", const char *opt="") + { mgl_region_xy(gr, &x, &y1, &y2, pen, opt); } + /// Draw vertical lines from points {x,y,z} to axis plane + inline void Stem(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *pen="", const char *opt="") + { mgl_stem_xyz(gr, &x, &y, &z, pen, opt); } + inline void Stem(const mglDataA &x, const mglDataA &y, const char *pen="", const char *opt="") + { mgl_stem_xy(gr, &x, &y, pen, opt); } + inline void Stem(const mglDataA &y, const char *pen="", const char *opt="") + { mgl_stem(gr, &y, pen, opt); } - /// Fill area between curves y1 and y2 (if inside=false) or area for y1<=y<=y2 (if inside=true). - void Region(const mglData &y1, const mglData &y2, const char *pen=0, mreal zVal=NAN, bool inside=true); - /// Fill area between curves y1 and y2 (if inside=false) or area for y1<=y<=y2 (if inside=true) for parametrically specified points. - void Region(const mglData &x, const mglData &y1, const mglData &y2, const char *pen=0, mreal zVal=NAN, bool inside=true); + /// Draw vertical bars from points {x,y,z} to axis plane + inline void Bars(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *pen="", const char *opt="") + { mgl_bars_xyz(gr, &x, &y, &z, pen, opt); } + inline void Bars(const mglDataA &x, const mglDataA &y, const char *pen="", const char *opt="") + { mgl_bars_xy(gr, &x, &y, pen, opt); } + inline void Bars(const mglDataA &y, const char *pen="", const char *opt="") + { mgl_bars(gr, &y, pen, opt); } + /// Draw horizontal bars from points {x,y} to axis plane + inline void Barh(const mglDataA &y, const mglDataA &v, const char *pen="", const char *opt="") + { mgl_barh_yx(gr, &y, &v, pen, opt); } + inline void Barh(const mglDataA &v, const char *pen="", const char *opt="") + { mgl_barh(gr, &v, pen, opt); } + /// Draw chart for data a + inline void Chart(const mglDataA &a, const char *colors="", const char *opt="") + { mgl_chart(gr, &a, colors,opt); } + /// Draw box-plot (special 5-value plot used in statistic) + inline void BoxPlot(const mglDataA &x, const mglDataA &y, const char *pen="", const char *opt="") + { mgl_boxplot_xy(gr, &x, &y, pen,opt); } + inline void BoxPlot(const mglDataA &y, const char *pen="", const char *opt="") + { mgl_boxplot(gr, &y, pen,opt); } + /// Draw candle plot + inline void Candle(const mglDataA &x, const mglDataA &v1, const mglDataA &v2, const mglDataA &y1, const mglDataA &y2, const char *pen="", const char *opt="") + { mgl_candle_xyv(gr, &x, &v1, &v2, &y1, &y2, pen, opt); } + inline void Candle(const mglDataA &v1, const mglDataA &v2, const mglDataA &y1, const mglDataA &y2, const char *pen="", const char *opt="") + { mgl_candle_yv(gr, &v1, &v2, &y1, &y2, pen, opt); } + inline void Candle(const mglDataA &v1, const mglDataA &v2, const char *pen="", const char *opt="") + { mgl_candle_yv(gr, &v1, &v2, NULL, NULL, pen, opt); } + inline void Candle(const mglDataA &y, const mglDataA &y1, const mglDataA &y2, const char *pen="", const char *opt="") + { mgl_candle(gr, &y, &y1, &y2, pen, opt); } + inline void Candle(const mglDataA &y, const char *pen="", const char *opt="") + { mgl_candle(gr, &y, NULL, NULL, pen, opt); } - /// Draw area plot for points in arrays \a x, \a y, \a z. - void Area(const mglData &x, const mglData &y, const mglData &z, const char *pen=0); - /// Draw area plot for points in arrays \a x, \a y. - void Area(const mglData &x, const mglData &y, const char *pen=0, mreal zVal=NAN); - /// Draw area plot for points in arrays \a y. - void Area(const mglData &y, const char *pen=0, mreal zVal=NAN); + /// Draw error boxes {ex,ey} at points {x,y} + inline void Error(const mglDataA &y, const mglDataA &ey, const char *pen="", const char *opt="") + { mgl_error(gr, &y, &ey, pen, opt); } + inline void Error(const mglDataA &x, const mglDataA &y, const mglDataA &ey, const char *pen="", const char *opt="") + { mgl_error_xy(gr, &x, &y, &ey, pen, opt); } + inline void Error(const mglDataA &x, const mglDataA &y, const mglDataA &ex, const mglDataA &ey, const char *pen="", const char *opt="") + { mgl_error_exy(gr, &x, &y, &ex, &ey, pen, opt); } + /// Draw marks with size r at points {x,y,z} + inline void Mark(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &r, const char *pen, const char *opt="") + { mgl_mark_xyz(gr, &x, &y, &z, &r, pen, opt); } + inline void Mark(const mglDataA &x, const mglDataA &y, const mglDataA &r, const char *pen, const char *opt="") + { mgl_mark_xy(gr, &x, &y, &r, pen, opt); } + inline void Mark(const mglDataA &y, const mglDataA &r, const char *pen, const char *opt="") + { mgl_mark_y(gr, &y, &r, pen, opt); } + /// Draw textual marks with size r at points {x,y,z} + inline void TextMark(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &r, const char *text, const char *fnt="", const char *opt="") + { mgl_textmark_xyzr(gr, &x, &y, &z, &r, text, fnt, opt); } + inline void TextMark(const mglDataA &x, const mglDataA &y, const mglDataA &r, const char *text, const char *fnt="", const char *opt="") + { mgl_textmark_xyr(gr, &x, &y, &r, text, fnt, opt); } + inline void TextMark(const mglDataA &y, const mglDataA &r, const char *text, const char *fnt="", const char *opt="") + { mgl_textmark_yr(gr, &y, &r, text, fnt, opt); } + inline void TextMark(const mglDataA &y, const char *text, const char *fnt="", const char *opt="") + { mgl_textmark(gr, &y, text, fnt, opt); } + inline void TextMark(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &r, const wchar_t *text, const char *fnt="", const char *opt="") + { mgl_textmarkw_xyzr(gr, &x, &y, &z, &r, text, fnt, opt); } + inline void TextMark(const mglDataA &x, const mglDataA &y, const mglDataA &r, const wchar_t *text, const char *fnt="", const char *opt="") + { mgl_textmarkw_xyr(gr, &x, &y, &r, text, fnt, opt); } + inline void TextMark(const mglDataA &y, const mglDataA &r, const wchar_t *text, const char *fnt="", const char *opt="") + { mgl_textmarkw_yr(gr, &y, &r, text, fnt, opt); } + inline void TextMark(const mglDataA &y, const wchar_t *text, const char *fnt="", const char *opt="") + { mgl_textmarkw(gr, &y, text, fnt, opt); } - /// Draw vertical lines from points in arrays \a x, \a y, \a z to mglGraph::Org. - void Stem(const mglData &x, const mglData &y, const mglData &z, const char *pen=0); - /// Draw vertical lines from points in arrays \a x, \a y to mglGraph::Org. - void Stem(const mglData &x, const mglData &y, const char *pen=0,mreal zVal=NAN); - /// Draw vertical lines from points in arrays \a y to mglGraph::Org. - void Stem(const mglData &y, const char *pen=0,mreal zVal=NAN); + /// Draw tube with radius r for points in arrays {x,y,z} + inline void Tube(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &r, const char *pen="", const char *opt="") + { mgl_tube_xyzr(gr, &x, &y, &z, &r, pen, opt); } + inline void Tube(const mglDataA &x, const mglDataA &y, const mglDataA &z, float r, const char *pen="", const char *opt="") + { mgl_tube_xyz(gr, &x, &y, &z, r, pen, opt); } + inline void Tube(const mglDataA &x, const mglDataA &y, const mglDataA &r, const char *pen="", const char *opt="") + { mgl_tube_xyr(gr, &x, &y, &r, pen, opt); } + inline void Tube(const mglDataA &x, const mglDataA &y, float r, const char *pen="", const char *opt="") + { mgl_tube_xy(gr, &x, &y, r, pen, opt); } + inline void Tube(const mglDataA &y, const mglDataA &r, const char *pen="", const char *opt="") + { mgl_tube_r(gr, &y, &r, pen, opt); } + inline void Tube(const mglDataA &y, float r, const char *pen="", const char *opt="") + { mgl_tube(gr, &y, r, pen, opt); } + /// Draw surface of curve {r,z} rotatation around axis + inline void Torus(const mglDataA &r, const mglDataA &z, const char *pen="", const char *opt="") + { mgl_torus(gr, &r, &z, pen,opt); } - /// Draw stairs for points in arrays \a x, \a y, \a z. - void Step(const mglData &x, const mglData &y, const mglData &z, const char *pen=0); - /// Draw stairs for points in arrays \a x, \a y. - void Step(const mglData &x, const mglData &y, const char *pen=0,mreal zVal=NAN); - /// Draw line plot for points in arrays \a y. - void Step(const mglData &y, const char *pen=0,mreal zVal=NAN); + /// Draw mesh lines for 2d data specified parametrically + inline void Mesh(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *stl="", const char *opt="") + { mgl_mesh_xy(gr, &x, &y, &z, stl, opt); } + inline void Mesh(const mglDataA &z, const char *stl="", const char *opt="") + { mgl_mesh(gr, &z, stl, opt); } + /// Draw mesh lines for 2d data specified parametrically + inline void Fall(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *stl="", const char *opt="") + { mgl_fall_xy(gr, &x, &y, &z, stl, opt); } + inline void Fall(const mglDataA &z, const char *stl="", const char *opt="") + { mgl_fall(gr, &z, stl, opt); } + /// Draw belts for 2d data specified parametrically + inline void Belt(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *stl="", const char *opt="") + { mgl_belt_xy(gr, &x, &y, &z, stl, opt); } + inline void Belt(const mglDataA &z, const char *stl="", const char *opt="") + { mgl_belt(gr, &z, stl, opt); } + /// Draw surface for 2d data specified parametrically with color proportional to z + inline void Surf(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *stl="", const char *opt="") + { mgl_surf_xy(gr, &x, &y, &z, stl, opt); } + inline void Surf(const mglDataA &z, const char *stl="", const char *opt="") + { mgl_surf(gr, &z, stl, opt); } + /// Draw grid lines for density plot of 2d data specified parametrically + inline void Grid(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *stl="", const char *opt="") + { mgl_grid_xy(gr, &x, &y, &z, stl, opt); } + inline void Grid(const mglDataA &z, const char *stl="", const char *opt="") + { mgl_grid(gr, &z, stl, opt); } + /// Draw vertical tiles for 2d data specified parametrically + inline void Tile(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *stl="", const char *opt="") + { mgl_tile_xy(gr, &x, &y, &z, stl, opt); } + inline void Tile(const mglDataA &z, const char *stl="", const char *opt="") + { mgl_tile(gr, &z, stl, opt); } + /// Draw density plot for 2d data specified parametrically + inline void Dens(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *stl="", const char *opt="") + { mgl_dens_xy(gr, &x, &y, &z, stl, opt); } + inline void Dens(const mglDataA &z, const char *stl="", const char *opt="") + { mgl_dens(gr, &z, stl, opt); } + /// Draw vertical boxes for 2d data specified parametrically + inline void Boxs(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *stl="", const char *opt="") + { mgl_boxs_xy(gr, &x, &y, &z, stl, opt); } + inline void Boxs(const mglDataA &z, const char *stl="", const char *opt="") + { mgl_boxs(gr, &z, stl, opt); } - /// Draw vertical bars from points in arrays \a x, \a y, \a z to mglGraph::Org. - void Bars(const mglData &x, const mglData &y, const mglData &z, const char *pen=0); - /// Draw vertical bars from points in arrays \a x, \a y to mglGraph::Org. - void Bars(const mglData &x, const mglData &y, const char *pen=0,mreal zVal=NAN); - /// Draw vertical bars from points in arrays \a y to mglGraph::Org. - void Bars(const mglData &y, const char *pen=0,mreal zVal=NAN); + /// Draw contour lines for 2d data specified parametrically + inline void Cont(const mglDataA &v, const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_cont_xy_val(gr, &v, &x, &y, &z, sch, opt); } + inline void Cont(const mglDataA &v, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_cont_val(gr, &v, &z, sch, opt); } + inline void Cont(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_cont_xy(gr, &x, &y, &z, sch, opt); } + inline void Cont(const mglDataA &z, const char *sch="", const char *opt="") + { mgl_cont(gr, &z, sch, opt); } + /// Draw solid contours for 2d data specified parametrically + inline void ContF(const mglDataA &v, const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_contf_xy_val(gr, &v, &x, &y, &z, sch, opt); } + inline void ContF(const mglDataA &v, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_contf_val(gr, &v, &z, sch, opt); } + inline void ContF(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_contf_xy(gr, &x, &y, &z, sch, opt); } + inline void ContF(const mglDataA &z, const char *sch="", const char *opt="") + { mgl_contf(gr, &z, sch, opt); } + /// Draw solid contours for 2d data specified parametrically with manual colors + inline void ContD(const mglDataA &v, const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_contd_xy_val(gr, &v, &x, &y, &z, sch, opt); } + inline void ContD(const mglDataA &v, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_contd_val(gr, &v, &z, sch, opt); } + inline void ContD(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_contd_xy(gr, &x, &y, &z, sch, opt); } + inline void ContD(const mglDataA &z, const char *sch="", const char *opt="") + { mgl_contd(gr, &z, sch, opt); } + /// Draw axial-symmetric isosurfaces for 2d data specified parametrically + inline void Axial(const mglDataA &v, const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_axial_xy_val(gr, &v, &x, &y, &z, sch,opt); } + inline void Axial(const mglDataA &v, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_axial_val(gr, &v, &z, sch, opt); } + inline void Axial(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_axial_xy(gr, &x, &y, &z, sch, opt); } + inline void Axial(const mglDataA &z, const char *sch="", const char *opt="") + { mgl_axial(gr, &z, sch, opt); } - /// Draw vertical bars from points in arrays \a x, \a y to mglGraph::Org. - void Barh(const mglData &y, const mglData &v, const char *pen=0,mreal zVal=NAN); - /// Draw vertical bars from points in arrays \a y to mglGraph::Org. - void Barh(const mglData &v, const char *pen=0,mreal zVal=NAN); + /// Draw grid lines for density plot at slice for 3d data specified parametrically + inline void Grid3(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, char dir, float sVal=-1, const char *stl="", const char *opt="") + { mgl_grid3_xyz(gr, &x, &y, &z, &a, dir, sVal, stl, opt); } + inline void Grid3(const mglDataA &a, char dir, float sVal=-1, const char *stl="", const char *opt="") + { mgl_grid3(gr, &a, dir, sVal, stl, opt); } + /// Draw density plot at slice for 3d data specified parametrically + inline void Dens3(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, char dir, float sVal=-1, const char *stl="", const char *opt="") + { mgl_dens3_xyz(gr, &x, &y, &z, &a, dir, sVal, stl, opt); } + inline void Dens3(const mglDataA &a, char dir, float sVal=-1, const char *stl="", const char *opt="") + { mgl_dens3(gr, &a, dir, sVal, stl, opt); } - /// Draw surface of curve {\a r,\a z} rotatation around Z axis - void Torus(const mglData &r, const mglData &z, const char *pen=0); - /// Draw surface of curve rotatation around Z axis - void Torus(const mglData &z, const char *pen=0); + /// Draw isosurface(s) for 3d data specified parametrically + inline void Surf3(float Val, const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const char *stl="", const char *opt="") + { mgl_surf3_xyz_val(gr, Val, &x, &y, &z, &a, stl, opt); } + inline void Surf3(float Val, const mglDataA &a, const char *stl="", const char *opt="") + { mgl_surf3_val(gr, Val, &a, stl, opt); } + inline void Surf3(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const char *stl="", const char *opt="") + { mgl_surf3_xyz(gr, &x, &y, &z, &a, stl, opt); } + inline void Surf3(const mglDataA &a, const char *stl="", const char *opt="") + { mgl_surf3(gr, &a, stl, opt); } - /// Draw chart for data a - void Chart(const mglData &a, const char *col=0); + /// Draw a semi-transparent cloud for 3d data + inline void Cloud(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const char *stl="", const char *opt="") + { mgl_cloud_xyz(gr, &x, &y, &z, &a, stl, opt); } + inline void Cloud(const mglDataA &a, const char *stl="", const char *opt="") + { mgl_cloud(gr, &a, stl, opt); } - /// Draw error boxes ey for data y - void Error(const mglData &y, const mglData &ey, const char *pen=0,mreal zVal=NAN); - /// Draw error boxes ey for data {x,y} - void Error(const mglData &x, const mglData &y, const mglData &ey, const char *pen=0,mreal zVal=NAN); - /// Draw error boxes {ex,ey} for data {x,y} - void Error(const mglData &x, const mglData &y, const mglData &ex, const mglData &ey, const char *pen=0,mreal zVal=NAN); + /// Draw contour lines at slice for 3d data specified parametrically + inline void Cont3(const mglDataA &v, const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, char dir, float sVal=-1, const char *sch="", const char *opt="") + { mgl_cont3_xyz_val(gr, &v, &x, &y, &z, &a, dir, sVal, sch, opt); } + inline void Cont3(const mglDataA &v, const mglDataA &a, char dir, float sVal=-1, const char *sch="", const char *opt="") + { mgl_cont3_val(gr, &v, &a, dir, sVal, sch, opt); } + inline void Cont3(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, char dir, float sVal=-1, const char *sch="", const char *opt="") + { mgl_cont3_xyz(gr, &x, &y, &z, &a, dir, sVal, sch, opt); } + inline void Cont3(const mglDataA &a, char dir, float sVal=-1, const char *sch="", const char *opt="") + { mgl_cont3(gr, &a, dir, sVal, sch, opt); } - /// Draw marks with diffenernt sizes \a r for points in arrays \a x, \a y, \a z. - void Mark(const mglData &x, const mglData &y, const mglData &z, const mglData &r, const char *pen=0); - /// Draw marks with diffenernt sizes \a r for points in arrays \a x, \a y. - void Mark(const mglData &x, const mglData &y, const mglData &r, const char *pen=0,mreal zVal=NAN); - /// Draw marks with diffenernt sizes \a r for points in arrays \a y. - void Mark(const mglData &y, const mglData &r, const char *pen=0,mreal zVal=NAN); + /// Draw solid contours at slice for 3d data specified parametrically + inline void ContF3(const mglDataA &v, const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, char dir, float sVal=-1, const char *sch="", const char *opt="") + { mgl_contf3_xyz_val(gr, &v, &x, &y, &z, &a, dir, sVal, sch, opt); } + inline void ContF3(const mglDataA &v, const mglDataA &a, char dir, float sVal=-1, const char *sch="", const char *opt="") + { mgl_contf3_val(gr, &v, &a, dir, sVal, sch, opt); } + inline void ContF3(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, char dir, float sVal=-1, const char *sch="", const char *opt="") + { mgl_contf3_xyz(gr, &x, &y, &z, &a, dir, sVal, sch, opt); } + inline void ContF3(const mglDataA &a, char dir, float sVal=-1, const char *sch="", const char *opt="") + { mgl_contf3(gr, &a, dir, sVal, sch, opt); } - /// Draw textual marks with diffenernt sizes \a r for points in arrays \a x, \a y, \a z. - void TextMark(const mglData &x, const mglData &y, const mglData &z, const mglData &r, const char *text, const char *fnt=0); - /// Draw textual marks with diffenernt sizes \a r for points in arrays \a x, \a y. - void TextMark(const mglData &x, const mglData &y, const mglData &r, const char *text, const char *fnt=0,mreal zVal=NAN); - /// Draw textual marks with diffenernt sizes \a r for points in arrays \a y. - void TextMark(const mglData &y, const mglData &r, const char *text, const char *fnt=0,mreal zVal=NAN); - /// Draw textual marks with diffenernt sizes \a r for points in arrays \a x, \a y, \a z. - void TextMark(const mglData &x, const mglData &y, const mglData &z, const mglData &r, const wchar_t *text, const char *fnt=0); - /// Draw textual marks with diffenernt sizes \a r for points in arrays \a x, \a y. - void TextMark(const mglData &x, const mglData &y, const mglData &r, const wchar_t *text, const char *fnt=0,mreal zVal=NAN); - /// Draw textual marks with diffenernt sizes \a r for points in arrays \a y. - void TextMark(const mglData &y, const mglData &r, const wchar_t *text, const char *fnt=0,mreal zVal=NAN); - /// Draw textual marks with diffenernt sizes \a r for points in arrays \a y. - void TextMark(const mglData &y, const char *text, const char *fnt=0,mreal zVal=NAN); - /// Draw textual marks with diffenernt sizes \a r for points in arrays \a y. - void TextMark(const mglData &y, const wchar_t *text, const char *fnt=0,mreal zVal=NAN); + /// Draw several isosurfaces for 3d beam in curvilinear coordinates + inline void Beam(const mglDataA &tr, const mglDataA &g1, const mglDataA &g2, const mglDataA &a, float r, const char *stl=0, int flag=0, int num=3) + { mgl_beam(gr, &tr,&g1,&g2,&a,r,stl,flag,num); } + inline void Beam(float val, const mglDataA &tr, const mglDataA &g1, const mglDataA &g2, const mglDataA &a, float r, const char *stl=NULL, int flag=0) + { mgl_beam_val(gr,val,&tr,&g1,&g2,&a,r,stl,flag); } - /// Draw tube with radial sizes \a r for points in arrays \a x, \a y, \a z. - void Tube(const mglData &x, const mglData &y, const mglData &z, const mglData &r, const char *pen=0); - /// Draw tube with radial sizes \a r for points in arrays \a x, \a y. - void Tube(const mglData &x, const mglData &y, const mglData &r, const char *pen=0,mreal zVal=NAN); - /// Draw tube with radial sizes \a r for points in arrays \a y. - void Tube(const mglData &y, const mglData &r, const char *pen=0,mreal zVal=NAN); - /// Draw tube with constant radial sizes \a r for points in arrays \a x, \a y, \a z. - void Tube(const mglData &x, const mglData &y, const mglData &z, mreal r, const char *pen=0); - /// Draw tube with constant radial sizes \a r for points in arrays \a x, \a y. - void Tube(const mglData &x, const mglData &y, mreal r, const char *pen=0,mreal zVal=NAN); - /// Draw tube with constant radial sizes \a r for points in arrays \a y. - void Tube(const mglData &y, mreal r, const char *pen=0,mreal zVal=NAN); + /// Draw vertical tiles with variable size for 2d data specified parametrically + inline void TileS(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &r, const char *stl="", const char *opt="") + { mgl_tiles_xy(gr, &x, &y, &z, &r, stl, opt); } + inline void TileS(const mglDataA &z, const mglDataA &r, const char *stl="", const char *opt="") + { mgl_tiles(gr, &z, &r, stl, opt); } + /// Draw surface for 2d data specified parametrically with color proportional to c + inline void SurfC(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &c, const char *sch="", const char *opt="") + { mgl_surfc_xy(gr, &x, &y, &z, &c, sch,opt); } + inline void SurfC(const mglDataA &z, const mglDataA &c, const char *sch="", const char *opt="") + { mgl_surfc(gr, &z, &c, sch,opt); } + /// Draw surface for 2d data specified parametrically with alpha proportional to c + inline void SurfA(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &c, const char *sch="", const char *opt="") + { mgl_surfa_xy(gr, &x, &y, &z, &c, sch,opt); } + inline void SurfA(const mglDataA &z, const mglDataA &c, const char *sch="", const char *opt="") + { mgl_surfa(gr, &z, &c, sch,opt); } + /// Color map of matrix a to matrix b, both matrix can parametrically depend on coordinates + inline void Map(const mglDataA &x, const mglDataA &y, const mglDataA &a, const mglDataA &b, const char *sch="", const char *opt="") + { mgl_map_xy(gr, &x, &y, &a, &b, sch, opt); } + inline void Map(const mglDataA &a, const mglDataA &b, const char *sch="", const char *opt="") + { mgl_map(gr, &a, &b, sch, opt); } + /// Draw density plot for spectra-gramm specified parametrically + inline void STFA(const mglDataA &x, const mglDataA &y, const mglDataA &re, const mglDataA &im, int dn, const char *sch="", const char *opt="") + { mgl_stfa_xy(gr, &x, &y, &re, &im, dn, sch, opt); } + inline void STFA(const mglDataA &re, const mglDataA &im, int dn, const char *sch="", const char *opt="") + { mgl_stfa(gr, &re, &im, dn, sch, opt); } - //@} - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name 2D plotting functions - * These functions perform plotting of 2D data. 2D means that - * data depend from 2 independent parameters like \b matrix f(x_i,y_j), - * i=1...n, j=1...m. There are 6 generally different types of data - * representations: simple mesh lines plot (\c Mesh), surface plot - * (\c Surf), surface plot by boxes (\c Boxs), density plot - * (\c Dens), contour lines plot (\c Cont, \c ContF, \c ContD) and its rotational figure (\c Axial). - * \c Cont, \c ContF, \c ContD and \c Axial functions have variants for automatic and manual - * selection of level values for contours. Also there are - * functions for plotting data grid lines according to the data format - * (\c Grid) for enhancing density or contour plots. Each type - * of plotting has similar interface. There are 2 kind of versions which handle - * the arrays of data and coordinates or only single data array. - * Parameters of colouring are specified by the string argument - * (see mglGraph::SetScheme). */ - //@{ - /// Draw curve for formula with x,y in range [Min, Max] - void Surf(const char *eqZ, const char *sch=0, int n=0); - /// Draw curve for formulas parametrically depended on u,v in range [0,1] - void Surf(const char *eqX, const char *eqY, const char *eqZ, const char *sch=0, int n=0); + /// Draw isosurface(s) for 3d data specified parametrically with alpha proportional to b + inline void Surf3A(float Val, const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const mglDataA &b, const char *stl="", const char *opt="") + { mgl_surf3a_xyz_val(gr, Val, &x, &y, &z, &a, &b, stl, opt); } + inline void Surf3A(float Val, const mglDataA &a, const mglDataA &b, const char *stl="", const char *opt="") + { mgl_surf3a_val(gr, Val, &a, &b, stl, opt); } + inline void Surf3A(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const mglDataA &b, const char *stl="", const char *opt="") + { mgl_surf3a_xyz(gr, &x, &y, &z, &a, &b, stl, opt); } + inline void Surf3A(const mglDataA &a, const mglDataA &b, const char *stl="", const char *opt="") + { mgl_surf3a(gr, &a, &b, stl, opt); } + /// Draw isosurface(s) for 3d data specified parametrically with color proportional to b + inline void Surf3C(float Val, const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const mglDataA &b, const char *stl="", const char *opt="") + { mgl_surf3c_xyz_val(gr, Val, &x, &y, &z, &a, &b, stl,opt); } + inline void Surf3C(float Val, const mglDataA &a, const mglDataA &b, const char *stl="", const char *opt="") + { mgl_surf3c_val(gr, Val, &a, &b, stl, opt); } + inline void Surf3C(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const mglDataA &b, const char *stl="", const char *opt="") + { mgl_surf3c_xyz(gr, &x, &y, &z, &a, &b, stl, opt); } + inline void Surf3C(const mglDataA &a, const mglDataA &b, const char *stl="", const char *opt="") + { mgl_surf3c(gr, &a, &b, stl, opt); } - /// Draw power crust for points in arrays \a x, \a y, \a z. - void Crust(const mglData &x, const mglData &y, const mglData &z, const char *sch=0,mreal er=0); - /// Draw power crust for points in arrays \a tr. - void Crust(const mglData &tr, const char *sch=0,mreal er=0); - /// Draw dots in points \a x, \a y, \a z. - void Dots(const mglData &x, const mglData &y, const mglData &z, const char *sch=0); - /// Draw half-transparent dots in points \a x, \a y, \a z. - void Dots(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *sch=0, mreal alpha=1); - /// Draw dots in points \a tr. - void Dots(const mglData &tr, const char *sch=0); + /// Plot dew drops for vector field {ax,ay} parametrically depended on coordinate {x,y} + inline void Dew(const mglDataA &x, const mglDataA &y, const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") + { mgl_dew_xy(gr, &x, &y, &ax, &ay, sch, opt); } + inline void Dew(const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") + { mgl_dew_2d(gr, &ax, &ay, sch, opt); } + /// Plot vectors at position {x,y,z} along {ax,ay,az} with length/color proportional to |a| + inline void Traj(const mglDataA &x, const mglDataA &y, const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") + { mgl_traj_xy(gr, &x, &y, &ax, &ay, sch, opt); } + inline void Traj(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", const char *opt="") + { mgl_traj_xyz(gr, &x, &y, &z, &ax, &ay, &az, sch, opt); } + /// Plot vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with length/color proportional to |a| + inline void Vect(const mglDataA &x, const mglDataA &y, const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") + { mgl_vect_xy(gr, &x, &y, &ax, &ay, sch, opt); } + inline void Vect(const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") + { mgl_vect_2d(gr, &ax, &ay, sch, opt); } + inline void Vect(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", const char *opt="") + { mgl_vect_xyz(gr, &x, &y, &z, &ax, &ay, &az, sch, opt); } + inline void Vect(const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", const char *opt="") + { mgl_vect_3d(gr, &ax, &ay, &az, sch, opt); } - /// Draw triangle mesh for points in arrays \a x, \a y, \a z with specified color \a c. - void TriPlot(const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const mglData &c, const char *sch=0); - /// Draw triangle mesh for points in arrays \a x, \a y, \a z. - void TriPlot(const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const char *sch=0); - /// Draw triangle mesh for points in arrays \a x, \a y. - void TriPlot(const mglData &nums, const mglData &x, const mglData &y, const char *sch=0, mreal zVal=NAN); - /// Draw quad mesh for points in arrays \a x, \a y, \a z with specified color \a c. - void QuadPlot(const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const mglData &c, const char *sch=0); - /// Draw quad mesh for points in arrays \a x, \a y, \a z. - void QuadPlot(const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const char *sch=0); - /// Draw quad mesh for points in arrays \a x, \a y. - void QuadPlot(const mglData &nums, const mglData &x, const mglData &y, const char *sch=0, mreal zVal=NAN); - /// Draw contour lines for triangle mesh for points in arrays \a x, \a y, \a z. - void TriCont(const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const char *sch=0,int num=7,mreal zVal=NAN); - void TriContV(const mglData &v, const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const char *sch=0,mreal zVal=NAN); - void TriCont(const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *sch=0,int num=7,mreal zVal=NAN); - void TriContV(const mglData &v, const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *sch=0,mreal zVal=NAN); + /// Plot flows for vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to |a| + inline void Flow(const mglDataA &x, const mglDataA &y, const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") + { mgl_flow_xy(gr, &x, &y, &ax, &ay, sch, opt); } + inline void Flow(const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") + { mgl_flow_2d(gr, &ax, &ay, sch, opt); } + inline void Flow(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", const char *opt="") + { mgl_flow_xyz(gr, &x, &y, &z, &ax, &ay, &az, sch, opt); } + inline void Flow(const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", const char *opt="") + { mgl_flow_3d(gr, &ax, &ay, &az, sch, opt); } + /// Plot flow from point p for vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to |a| + inline void FlowP(mglPoint p, const mglDataA &x, const mglDataA &y, const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") + { mgl_flowp_xy(gr, p.x, p.y, p.z, &x, &y, &ax, &ay, sch, opt); } + inline void FlowP(mglPoint p, const mglDataA &ax, const mglDataA &ay, const char *sch="", const char *opt="") + { mgl_flowp_2d(gr, p.x, p.y, p.z, &ax, &ay, sch, opt); } + inline void FlowP(mglPoint p, const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", const char *opt="") + { mgl_flowp_xyz(gr, p.x, p.y, p.z, &x, &y, &z, &ax, &ay, &az, sch, opt); } + inline void FlowP(mglPoint p, const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", const char *opt="") + { mgl_flowp_3d(gr, p.x, p.y, p.z, &ax, &ay, &az, sch, opt); } - /// Draw grid lines for density plot of 2d data specified parametrically - void Grid(const mglData &x, const mglData &y, const mglData &z, const char *stl=0,mreal zVal=NAN); - /// Draw grid lines for density plot of 2d data - void Grid(const mglData &a,const char *stl=0,mreal zVal=NAN); - /// Draw mesh lines for 2d data specified parametrically - void Mesh(const mglData &x, const mglData &y, const mglData &z, const char *sch=0); - /// Draw mesh lines for 2d data - void Mesh(const mglData &z, const char *sch=0); - /// Draw mesh lines for 2d data specified parametrically - void Fall(const mglData &x, const mglData &y, const mglData &z, const char *sch=0); - /// Draw mesh lines for 2d data - void Fall(const mglData &z, const char *sch=0); - /// Draw belts for 2d data specified parametrically - void Belt(const mglData &x, const mglData &y, const mglData &z, const char *sch=0); - /// Draw belts for 2d data - void Belt(const mglData &z, const char *sch=0); - /// Draw surface for 2d data specified parametrically - void Surf(const mglData &x, const mglData &y, const mglData &z, const char *sch=0); - /// Draw surface for 2d data - void Surf(const mglData &z, const char *sch=0); - /// Draw density plot for surface specified parametrically - void Dens(const mglData &x, const mglData &y, const mglData &z, const char *sch=0,mreal zVal=NAN); - /// Draw density plot for 2d data - void Dens(const mglData &z, const char *sch=0,mreal zVal=NAN); - /// Draw density plot for spectra-gramm specified parametrically - void STFA(const mglData &x, const mglData &y, const mglData &re, const mglData &im, int dn, const char *sch=0,mreal zVal=NAN); - /// Draw density plot for spectra-gramm - void STFA(const mglData &re, const mglData &im, int dn, const char *sch=0,mreal zVal=NAN); - /// Draw vertical boxes for 2d data specified parametrically - void Boxs(const mglData &x, const mglData &y, const mglData &z, const char *sch=0,mreal zVal=NAN); - /// Draw vertical boxes for 2d data - void Boxs(const mglData &z, const char *sch=0,mreal zVal=NAN); - /// Draw vertical tiles for 2d data specified parametrically - void Tile(const mglData &x, const mglData &y, const mglData &z, const char *sch=0); - /// Draw vertical tiles for 2d data - void Tile(const mglData &z, const char *sch=0); - /// Draw contour lines for 2d data specified parametrically - void Cont(const mglData &v, const mglData &x, const mglData &y, const mglData &z, const char *sch=0, mreal zVal=NAN); - /// Draw contour lines for 2d data - void Cont(const mglData &v, const mglData &z, const char *sch=0,mreal zVal=NAN); - /// Draw several contour lines for 2d data specified parametrically - void Cont(const mglData &x, const mglData &y, const mglData &z, const char *sch=0, int Num=7, mreal zVal=NAN); - /// Draw several contour lines for 2d data - void Cont(const mglData &z, const char *sch=0, int Num=7, mreal zVal=NAN); - /// Draw axial-symmetric isosurfaces for 2d data specified parametrically - void Axial(const mglData &v, const mglData &x, const mglData &y, const mglData &a, const char *sch=0); - /// Draw axial-symmetric isosurfaces for 2d data - void Axial(const mglData &v, const mglData &a, const char *sch=0); - /// Draw several axial-symmetric isosurfaces for 2d data specified parametrically - void Axial(const mglData &x, const mglData &y, const mglData &a, const char *sch=0, int Num=3); - /// Draw several axial-symmetric isosurfaces for 2d data - void Axial(const mglData &a, const char *sch=0, int Num=3); - /// Draw solid contours for 2d data specified parametrically - void ContF(const mglData &v, const mglData &x, const mglData &y, const mglData &z, const char *sch=0, mreal zVal=NAN); - /// Draw solid contours for 2d data - void ContF(const mglData &v, const mglData &z, const char *sch=0,mreal zVal=NAN); - /// Draw several solid contours for 2d data specified parametrically - void ContF(const mglData &x, const mglData &y, const mglData &z, const char *sch=0, int Num=7, mreal zVal=NAN); - /// Draw several solid contours for 2d data - void ContF(const mglData &z, const char *sch=0, int Num=7, mreal zVal=NAN); - - /// Draw solid contours for 2d data specified parametrically with manual colors - void ContD(const mglData &v, const mglData &x, const mglData &y, const mglData &z, const char *sch=0, mreal zVal=NAN); - /// Draw solid contours for 2d data with manual colors - void ContD(const mglData &v, const mglData &z, const char *sch=0,mreal zVal=NAN); - /// Draw several solid contours for 2d data specified parametrically with manual colors - void ContD(const mglData &x, const mglData &y, const mglData &z, const char *sch=0, int Num=7, mreal zVal=NAN); - /// Draw several solid contours for 2d data with manual colors - void ContD(const mglData &z, const char *sch=0, int Num=7, mreal zVal=NAN); - //@} - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name Dual plotting functions - * These plotting functions draw a \b two (\b or \b three) \b matrix simultaneously - * in different forms (as coloring, vector field, flow chart or mapping). - * The color scheme is specified by the string parameter - * (see mglGraph::SetScheme). The array \a x and \a y can be vectors or - * matrices with the same size as main matrix. Also there is case when - * matrix is plotted along all square \a X*Y specified by corners - * mglGraph::Min -- mglGraph::Max. - */ - //@{ + /// Plot flows for gradient of scalar field phi parametrically depended on coordinate {x,y,z} + inline void Grad(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &phi, const char *sch="", const char *opt="") + { mgl_grad_xyz(gr,&x,&y,&z,&phi,sch,opt); } + inline void Grad(const mglDataA &x, const mglDataA &y, const mglDataA &phi, const char *sch="", const char *opt="") + { mgl_grad_xy(gr,&x,&y,&phi,sch,opt); } + inline void Grad(const mglDataA &phi, const char *sch="", const char *opt="") + { mgl_grad(gr,&phi,sch,opt); } - /// Plot dew drops for vector field {ax,ay} parametrically depended on coordinate {x,y} - void Dew(const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0,mreal zVal=NAN); - /// Plot dew drops for vector field {ax,ay} - void Dew(const mglData &ax, const mglData &ay, const char *sch=0,mreal zVal=NAN); - /// Draw surface specified parametrically with coloring by other matrix - void SurfC(const mglData &x, const mglData &y, const mglData &z, const mglData &c, const char *sch=0); - /// Draw surface specified by matrix with coloring by other matrix - void SurfC(const mglData &z, const mglData &c, const char *sch=0); - /// Draw surface specified parametrically which transparency is determined by other matrix - void SurfA(const mglData &x, const mglData &y, const mglData &z, const mglData &c, const char *sch=0); - /// Draw surface specified by matrix which transparency is determined by other matrix - void SurfA(const mglData &z, const mglData &c, const char *sch=0); - /// Draw vertical tiles with variable size for 2d data specified parametrically - void TileS(const mglData &x, const mglData &y, const mglData &z, const mglData &r, const char *sch=0); - /// Draw vertical tiles with variable size for 2d data - void TileS(const mglData &z, const mglData &r, const char *sch=0); - /// Plot arrows at position {x,y} along {ax,ay} with length \a len and color proportional to value |a| - void Traj(const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0, mreal zVal=NAN, mreal len=0); - /// Plot arrows at position {x,y,z} along {ax,ay,az} with length \a len and color proportional to value |a| - void Traj(const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0, mreal len=0); - /// Plot vector field {ax,ay} parametrically depended on coordinate {x,y} with length and color proportional to value |a| - void Vect(const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0,mreal zVal=NAN, int flag=0); - /// Plot vector field {ax,ay} with length and color proportional to value |a| - void Vect(const mglData &ax, const mglData &ay, const char *sch=0,mreal zVal=NAN, int flag=0); - /// Plot vector field {ax,ay} parametrically depended on coordinate {x,y} with length proportional to value |a| - void VectL(const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0,mreal zVal=NAN); - /// Plot vector field {ax,ay} with length proportional to value |a| - void VectL(const mglData &ax, const mglData &ay, const char *sch=0,mreal zVal=NAN); - /// Plot vector field {ax,ay} parametrically depended on coordinate {x,y} with color proportional to value |a| - void VectC(const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0,mreal zVal=NAN); - /// Plot vector field {ax,ay} with color proportional to value |a| - void VectC(const mglData &ax, const mglData &ay, const char *sch=0,mreal zVal=NAN); - /// Plot 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with length and color proportional to value |a| - void Vect(const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0, int flag=0); - /// Plot 3d vector field {ax,ay,ay} with length and color proportional to value |a| - void Vect(const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0, int flag=0); - /// Plot 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with length proportional to value |a| - void VectL(const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0); - /// Plot 3d vector field {ax,ay,ay} with length proportional to value |a| - void VectL(const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0); - /// Plot 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to value |a| - void VectC(const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0); - /// Plot 3d vector field {ax,ay,ay} with color proportional to value |a| - void VectC(const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0); - /// Color map of matrix a to matrix b, both matrix parametrically depend on coordinates - void Map(const mglData &x, const mglData &y, const mglData &a, const mglData &b, const char *sch=0, int ks=0, bool pnts=true); - /// Color map of matrix a to matrix b - void Map(const mglData &a, const mglData &b, const char *sch=0, int ks=0, bool pnts=true); - /// Draw isosurface for 3d data \a a specified parametrically with alpha proportional to \a b - void Surf3A(mreal Val, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &b, - const char *stl=0); - /// Draw isosurface for 3d data \a a with alpha proportional to \a b - void Surf3A(mreal Val, const mglData &a, const mglData &b, const char *stl=0); - /// Draw several isosurface for 3d data \a a specified parametrically with alpha proportional to \a b - void Surf3A(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &b, - const char *stl=0, int num=3); - /// Draw several isosurface for 3d data \a a with alpha proportional to \a b - void Surf3A(const mglData &a, const mglData &b, const char *stl=0, int num=3); - /// Draw isosurface for 3d data \a a specified parametrically with color proportional to \a b - void Surf3C(mreal Val, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &b, const char *stl=0); - /// Draw isosurface for 3d data \a a with color proportional to \a b - void Surf3C(mreal Val, const mglData &a, const mglData &b, const char *stl=0); - /// Draw several isosurface for 3d data \a a specified parametrically with color proportional to \a b - void Surf3C(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &b, const char *stl=0, int num=3); - /// Draw several isosurface for 3d data \a a with color proportional to \a b - void Surf3C(const mglData &a, const mglData &b, const char *stl=0, int num=3); + /// Plot flow pipes for vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to |a| + inline void Pipe(const mglDataA &x, const mglDataA &y, const mglDataA &ax, const mglDataA &ay, const char *sch="", float r0=0.05, const char *opt="") + { mgl_pipe_xy(gr, &x, &y, &ax, &ay, sch, r0, opt); } + inline void Pipe(const mglDataA &ax, const mglDataA &ay, const char *sch="", float r0=0.05, const char *opt="") + { mgl_pipe_2d(gr, &ax, &ay, sch, r0, opt); } + inline void Pipe(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", float r0=0.05, const char *opt="") + { mgl_pipe_xyz(gr, &x, &y, &z, &ax, &ay, &az, sch, r0, opt); } + inline void Pipe(const mglDataA &ax, const mglDataA &ay, const mglDataA &az, const char *sch="", float r0=0.05, const char *opt="") + { mgl_pipe_3d(gr, &ax, &ay, &az, sch, r0, opt); } - /// Plot flows for vector field {ax,ay} parametrically depended on coordinate {x,y} with color proportional to value |a| - void Flow(const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0, int num=5, bool central=true, mreal zVal=NAN); - /// Plot flows for vector field {ax,ay} with color proportional to value |a| - void Flow(const mglData &ax, const mglData &ay, const char *sch=0, int num=5, bool central=true, mreal zVal=NAN); - /// Plot flows for 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to value |a| - void Flow(const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0, int num=3, bool central=true); - /// Plot flows for 3d vector field {ax,ay,ay} with color proportional to value |a| - void Flow(const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0, int num=3, bool central=true); - /// Draw flow from point p - void FlowP(mglPoint p0, const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0); - void FlowP(mglPoint p0, const mglData &ax, const mglData &ay, const char *sch=0); - void FlowP(mglPoint p0, const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0); - void FlowP(mglPoint p0, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0); + /// Draw density plot for data at x = sVal + inline void DensX(const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_dens_x(gr, &a, stl, sVal, opt); } + /// Draw density plot for data at y = sVal + inline void DensY(const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_dens_y(gr, &a, stl, sVal, opt); } + /// Draw density plot for data at z = sVal + inline void DensZ(const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_dens_z(gr, &a, stl, sVal, opt); } + /// Draw contour plots for data at x = sVal + inline void ContX(const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_cont_x(gr, &a, stl, sVal, opt); } + inline void ContX(const mglDataA &v, const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_cont_x_val(gr, &v, &a, stl, sVal, opt); } + /// Draw contour plots for data at y = sVal + inline void ContY(const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_cont_y(gr, &a, stl, sVal, opt); } + inline void ContY(const mglDataA &v, const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_cont_y_val(gr, &v, &a, stl, sVal, opt); } + /// Draw contour plots for data at z = sVal + inline void ContZ(const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_cont_z(gr, &a, stl, sVal, opt); } + inline void ContZ(const mglDataA &v, const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_cont_z_val(gr, &v, &a, stl, sVal, opt); } + /// Draw solid contour plots for data at x = sVal + inline void ContFX(const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_contf_x(gr, &a, stl, sVal, opt); } + inline void ContFX(const mglDataA &v, const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_contf_x_val(gr, &v, &a, stl, sVal, opt); } + /// Draw solid contour plots for data at y = sVal + inline void ContFY(const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_contf_y(gr, &a, stl, sVal, opt); } + inline void ContFY(const mglDataA &v, const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_contf_y_val(gr, &v, &a, stl, sVal, opt); } + /// Draw solid contour plots for data at z = sVal + inline void ContFZ(const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_contf_z(gr, &a, stl, sVal, opt); } + inline void ContFZ(const mglDataA &v, const mglDataA &a, const char *stl="", float sVal=NaN, const char *opt="") + { mgl_contf_z_val(gr, &v, &a, stl, sVal, opt); } - void Grad(const mglData &x, const mglData &y, const mglData &z, const mglData &phi, const char *sch=0, int num=5); - void Grad(const mglData &x, const mglData &y, const mglData &phi, const char *sch=0, int num=5, mreal zVal=NAN); - void Grad(const mglData &phi, const char *sch=0, int num=5, mreal zVal=NAN); + /// Draw curve for formula with x in range [Min.x, Max.x] + inline void FPlot(const char *fy, const char *stl="", const char *opt="") + { mgl_fplot(gr, fy, stl, opt); } + /// Draw curve for formulas parametrically depended on t in range [0,1] + inline void FPlot(const char *fx, const char *fy, const char *fz, const char *stl, const char *opt="") + { mgl_fplot_xyz(gr, fx, fy, fz, stl, opt); } + /// Draw surface by formula with x,y in range [Min, Max] + inline void FSurf(const char *fz, const char *stl="", const char *opt="") + { mgl_fsurf(gr, fz, stl, opt); } + /// Draw surface by formulas parametrically depended on u,v in range [0,1] + inline void FSurf(const char *fx, const char *fy, const char *fz, const char *stl, const char *opt="") + { mgl_fsurf_xyz(gr, fx, fy, fz, stl, opt); } - /// Plot flow pipes for vector field {ax,ay} parametrically depended on coordinate {x,y} with color proportional to value |a| - void Pipe(const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch=0, mreal r0=0.05, int num=5, bool central=true, mreal zVal=NAN); - /// Plot flow pipes for vector field {ax,ay} with color proportional to value |a| - void Pipe(const mglData &ax, const mglData &ay, const char *sch=0, mreal r0=0.05, int num=5, bool central=true, mreal zVal=NAN); - /// Plot flow pipes for 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to value |a| - void Pipe(const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0, mreal r0=0.05, int num=3, bool central=true); - /// Plot flow pipes for 3d vector field {ax,ay,ay} with color proportional to value |a| - void Pipe(const mglData &ax, const mglData &ay, const mglData &az, const char *sch=0, mreal r0=0.05, int num=3, bool central=true); - //@} - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name 3D plotting functions - * 3D plotting functions draw a 3-ranged \b tensor in different forms. - * There are the using of slices, isosurfaces (surfaces of constant - * amplitude) or volume intransparency like clouds. - * The color scheme is specified by the string parameter - * (see mglGraph::SetScheme). The array \a x, \a y and \a z can be vectors or - * matrixes with the same size as main matrix. Also there is case when - * matrix is plotted along all square \a X*Y*Z specified by corners - * mglGraph::Min -- mglGraph::Max. - */ - //@{ - /// Draw grid lines for density plot at slice for 3d data specified parametrically - void Grid3(const mglData &x, const mglData &y, const mglData &z, const mglData &a, char dir, int sVal=-1, const char *stl=0); - /// Draw grid lines for density plot at slice for 3d data - void Grid3(const mglData &a, char dir, int sVal=-1, const char *stl=0); - /// Draw grid lines for density plot at central slices for 3d data specified parametrically - void GridA(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *stl=0); - /// Draw grid lines for density plot at central slices for 3d data - void GridA(const mglData &a, const char *stl=0); - /// Draw density plot at slice for 3d data specified parametrically - void Dens3(const mglData &x, const mglData &y, const mglData &z, const mglData &a, char dir, int sVal=-1, const char *stl=0); - /// Draw density plot at slice for 3d data - void Dens3(const mglData &a, char dir, int sVal=-1, const char *stl=0); - /// Draw density plot at central slices for 3d data specified parametrically - void DensA(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *stl=0); - /// Draw density plot at central slices for 3d data - void DensA(const mglData &a, const char *stl=0); - /// Draw isosurface for 3d data specified parametrically - void Surf3(mreal Val, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *stl=0); - /// Draw isosurface for 3d data - void Surf3(mreal Val, const mglData &a, const char *stl=0); - /// Draw several isosurfaces for 3d data specified parametrically - void Surf3(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *stl=0, int num=3); - /// Draw several isosurfaces for 3d beam in curvilinear coordinates - void Beam(const mglData &tr, const mglData &g1, const mglData &g2, const mglData &a, mreal r, const char *stl=0, int flag=0, int num=3); - /// Draw isosurface for 3d beam in curvilinear coordinates - void Beam(mreal val,const mglData &tr, const mglData &g1, const mglData &g2, const mglData &a, mreal r, const char *stl=0, int flag=0); - /// Draw several isosurface for 3d data - void Surf3(const mglData &a, const char *stl=0, int num=3); - /// Draw contour lines at slice for 3d data specified parametrically - void Cont3(const mglData &v, const mglData &x, const mglData &y, const mglData &z, const mglData &a, char dir, int sVal=-1, const char *sch=0); - /// Draw contour lines at slice for 3d data - void Cont3(const mglData &v, const mglData &a, char dir, int sVal=-1, const char *sch=0); - /// Draw several contour lines at slice for 3d data specified parametrically - void Cont3(const mglData &x, const mglData &y, const mglData &z, const mglData &a, char dir, int sVal=-1, const char *sch=0, int Num=7); - /// Draw several contour lines at slice for 3d data - void Cont3(const mglData &a, char dir, int sVal=-1, const char *sch=0, int Num=7); - /// Draw contour lines at central slices for 3d data specified parametrically - void ContA(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *sch=0, int Num=7); - /// Draw contour lines at central slices for 3d data - void ContA(const mglData &a, const char *sch=0, int Num=7); - /// Draw solid contours at slice for 3d data specified parametrically - void ContF3(const mglData &v, const mglData &x, const mglData &y, const mglData &z, const mglData &a, char dir, int sVal=-1, const char *sch=0); - /// Draw solid contours at slice for 3d data - void ContF3(const mglData &v, const mglData &a, char dir, int sVal=-1, const char *sch=0); - /// Draw several solid contours at slice for 3d data specified parametrically - void ContF3(const mglData &x, const mglData &y, const mglData &z, const mglData &a, char dir, int sVal=-1, const char *sch=0, int Num=7); - /// Draw several solid contours at slice for 3d data - void ContF3(const mglData &a, char dir, int sVal=-1, const char *sch=0, int Num=7); - /// Draw solid contours at central slices for 3d data specified parametrically - void ContFA(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *sch=0, int Num=7); - /// Draw solid contours at central slices for 3d data - void ContFA(const mglData &a, const char *sch=0, int Num=7); - /// Draw a cloud of points for 3d data specified parametrically - void CloudP(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *stl=0, mreal alpha=1, bool rnd=true); - /// Draw a cloud of points for 3d data - void CloudP(const mglData &a, const char *stl=0, mreal alpha=1, bool rnd=true); - /// Draw a semi-transparent cloud for 3d data specified parametrically - void Cloud(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *stl=0, mreal alpha=1); - /// Draw a semi-transparent cloud for 3d data - void Cloud(const mglData &a, const char *stl=0, mreal alpha=1); - //@} - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name Combined plotting functions - * These plotting functions draw density plot or contour lines in x, y, or z plain. - * If \a a is a tensor (3-dimensional data) then interpolation to a given - * sVal is performed. */ - //@{ - /// Draw density plot for data a at x = sVal - void DensX(const mglData &a, const char *stl=0, mreal sVal=NAN); - /// Draw density plot for data a at y = sVal - void DensY(const mglData &a, const char *stl=0, mreal sVal=NAN); - /// Draw density plot for data a at z = sVal - void DensZ(const mglData &a, const char *stl=0, mreal sVal=NAN); - /// Draw several contour plots for data a at x = sVal - void ContX(const mglData &a, const char *stl=0, mreal sVal=NAN, int Num=7); - /// Draw several contour plots for data a at y = sVal - void ContY(const mglData &a, const char *stl=0, mreal sVal=NAN, int Num=7); - /// Draw several contour plots for data a at z = sVal - void ContZ(const mglData &a, const char *stl=0, mreal sVal=NAN, int Num=7); - /// Draw contour plots for data a at x = sVal - void ContX(const mglData &v, const mglData &a, const char *stl=0, mreal sVal=NAN); - /// Draw contour plots for data a at y = sVal - void ContY(const mglData &v, const mglData &a, const char *stl=0, mreal sVal=NAN); - /// Draw contour plots for data a at z = sVal - void ContZ(const mglData &v, const mglData &a, const char *stl=0, mreal sVal=NAN); - /// Draw several contour plots for data a at x = sVal - void ContFX(const mglData &a, const char *stl=0, mreal sVal=NAN, int Num=7); - /// Draw several contour plots for data a at y = sVal - void ContFY(const mglData &a, const char *stl=0, mreal sVal=NAN, int Num=7); - /// Draw several contour plots for data a at z = sVal - void ContFZ(const mglData &a, const char *stl=0, mreal sVal=NAN, int Num=7); - /// Draw contour plots for data a at x = sVal - void ContFX(const mglData &v, const mglData &a, const char *stl=0, mreal sVal=NAN); - /// Draw contour plots for data a at y = sVal - void ContFY(const mglData &v, const mglData &a, const char *stl=0, mreal sVal=NAN); - /// Draw contour plots for data a at z = sVal - void ContFZ(const mglData &v, const mglData &a, const char *stl=0, mreal sVal=NAN); - //@} - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name IDTF specific functions - * These functions are useful only in IDTF mode - * VertexColor enables smooth color change. - * Compression gives smaller files, but quality degrades. - * Unrotate reverses the current space transform before saving, - * in an attempt to make MathGl axes similar to Adobe Reader axes - * It makes positioning cameras and crossections easier - * Groups contain objects and other groups, they are used to select a part of a model to - * zoom to / make invizible / make transparent / etc. - * */ - //@{ - virtual void DoubleSided(bool enable); - virtual void VertexColor(bool enable); - virtual void TextureColor(bool enable); - virtual void Compression(bool enable); - virtual void Unrotate(bool enable); - virtual void BallIsPoint(bool enable); - virtual void StartGroup (const char *name); - virtual void StartAutoGroup (const char *name); - void StartGroup(const char *name, int id); - virtual void EndGroup(); - //@} - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -protected: - int TernAxis; /// Flag that Ternary axis is used - mreal FogDist; /// Inverse fog distance (fog ~ exp(-FogDist*Z)) - mreal FogDz; /// Relative shift of fog - int _sx,_sy,_sz,_st; // sign in shift of axis ticks and labels - char Arrow1, Arrow2; // Style of arrows at end and at start of curve - mreal AmbBr; ///< Default ambient light brightness - mglFont *fnt; ///< Class for printing vector text - mreal font_factor; - bool UseAlpha; ///< Flag that Alpha is used - mglColor cmap[MGL_CMAP_COLOR]; ///< Colors for color scheme - char PalNames[101]; ///< IDs of colors in the palette - char DefPal[101]; ///< Default palette - int CurrPal; ///< Current index of palette mglGraph::Pal - int NumCol; ///< Actual number of colors in color scheme mglGraph::cmap - mreal CloudFactor; ///< Factor of transparency in mglGraph::CloudP and mglGraph::CloudQ - bool ScalePuts; ///< Enable/disable point positions scaling in puts - bool SmoothColorbar; ///< Use color interpolation in colorbar (default is true) - int LegendMarks; ///< Number of marks in the Legend + /// Draw triangle mesh for points in arrays {x,y,z} with specified color c. + inline void TriPlot(const mglDataA &nums, const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &c, const char *sch="", const char *opt="") + { mgl_triplot_xyzc(gr, &nums, &x, &y, &z, &c, sch, opt); } + inline void TriPlot(const mglDataA &nums, const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_triplot_xyz(gr, &nums, &x, &y, &z, sch, opt); } + inline void TriPlot(const mglDataA &nums, const mglDataA &x, const mglDataA &y, const char *sch="", const char *opt="") + { mgl_triplot_xy(gr, &nums, &x, &y, sch, opt); } + /// Draw quad mesh for points in arrays {x,y,z} with specified color c. + inline void QuadPlot(const mglDataA &nums, const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &c, const char *sch="", const char *opt="") + { mgl_quadplot_xyzc(gr, &nums, &x, &y, &z, &c, sch, opt); } + inline void QuadPlot(const mglDataA &nums, const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_quadplot_xyz(gr, &nums, &x, &y, &z, sch, opt); } + inline void QuadPlot(const mglDataA &nums, const mglDataA &x, const mglDataA &y, const char *sch="", const char *opt="") + { mgl_quadplot_xy(gr, &nums, &x, &y, sch, opt); } + /// Draw contour lines for triangle mesh for points in arrays {x,y,z}. + inline void TriCont(const mglDataA &nums, const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_tricont_xyc(gr, &nums, &x, &y, &z, sch, opt); } + inline void TriContV(const mglDataA &v, const mglDataA &nums, const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_tricont_xycv(gr, &v, &nums, &x, &y, &z, sch, opt); } + inline void TriCont(const mglDataA &nums, const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const char *sch="", const char *opt="") + { mgl_tricont_xyzc(gr, &nums, &x, &y, &z, &a, sch, opt); } + inline void TriContV(const mglDataA &v, const mglDataA &nums, const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const char *sch="", const char *opt="") + { mgl_tricont_xyzcv(gr, &v, &nums, &x, &y, &z, &a, sch, opt); } - wchar_t xtt[256]; ///< X-tick template (set NULL to use default one ("%.2g" in simplest case)) - wchar_t ytt[256]; ///< Y-tick template (set NULL to use default one ("%.2g" in simplest case)) - wchar_t ztt[256]; ///< Z-tick template (set NULL to use default one ("%.2g" in simplest case)) - wchar_t ctt[256]; ///< Colorbar-tick template (set NULL to use default one ("%.2g" in simplest case)) + /// Draw dots in points {x,y,z}. + inline void Dots(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_dots(gr, &x, &y, &z, sch, opt); } + /// Draw semitransparent dots in points {x,y,z}. + inline void Dots(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const char *sch="", const char *opt="") + { mgl_dots_a(gr, &x, &y, &z, &a, sch, opt); } + /// Draw surface reconstructed for points in arrays {x,y,z}. + inline void Crust(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *sch="", const char *opt="") + { mgl_crust(gr, &x, &y, &z, sch, opt); } - int NumLeg; ///< Number of used positions in LegStr and LegStl arrays - wchar_t *LegStr[100]; ///< String array with legend text (see mglGraph::AddLegend) - char *LegStl[100]; ///< String array with legend style (see mglGraph::AddLegend) - mreal zoomx1, zoomy1, zoomx2, zoomy2; + /// Fit data along x-direction for each data row. Return array with values for found formula. + inline mglData Fit(const mglDataA &y, const char *eq, const char *var, const char *opt="") + { return mglData(true,mgl_fit_1(gr, &y, eq,var,0, opt)); } + inline mglData Fit(const mglDataA &y, const char *eq, const char *var, mglData &ini, const char *opt="") + { return mglData(true,mgl_fit_1(gr, &y, eq, var, &ini, opt)); } + /// Fit data along x-, y-directions for each data slice. Return array with values for found formula. + inline mglData Fit2(const mglDataA &z, const char *eq, const char *var, const char *opt="") + { return mglData(true,mgl_fit_2(gr, &z, eq, var,0, opt)); } + inline mglData Fit2(const mglDataA &z, const char *eq, const char *var, mglData &ini, const char *opt="") + { return mglData(true,mgl_fit_2(gr, &z, eq, var, &ini, opt)); } + /// Fit data along along all directions. Return array with values for found formula. + inline mglData Fit3(const mglDataA &a, const char *eq, const char *var, const char *opt="") + { return mglData(true,mgl_fit_3(gr, &a, eq, var,0, opt)); } + inline mglData Fit3(const mglDataA &a, const char *eq, const char *var, mglData &ini, const char *opt="") + { return mglData(true,mgl_fit_3(gr, &a, eq, var, &ini, opt)); } + /// Fit data along x-direction for each data row. Return array with values for found formula. + inline mglData Fit(const mglDataA &x, const mglDataA &y, const char *eq, const char *var, const char *opt="") + { return mglData(true,mgl_fit_xy(gr, &x, &y, eq, var,0, opt)); } + inline mglData Fit(const mglDataA &x, const mglDataA &y, const char *eq, const char *var, mglData &ini, const char *opt="") + { return mglData(true,mgl_fit_xy(gr, &x, &y, eq, var, &ini, opt)); } + /// Fit data along x-, y-directions for each data slice. Return array with values for found formula. + inline mglData Fit(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *eq, const char *var, const char *opt="") + { return mglData(true,mgl_fit_xyz(gr, &x, &y, &z, eq, var,0, opt)); } + inline mglData Fit(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *eq, const char *var, mglData &ini, const char *opt="") + { return mglData(true,mgl_fit_xyz(gr, &x, &y, &z, eq, var, &ini, opt)); } + /// Fit data along along all directions. Return array with values for found formula. + inline mglData Fit(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const char *eq, const char *var, const char *opt="") + { return mglData(true,mgl_fit_xyza(gr, &x, &y, &z, &a, eq, var,0, opt)); } + inline mglData Fit(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const char *eq, const char *var, mglData &ini, const char *opt="") + { return mglData(true,mgl_fit_xyza(gr, &x, &y, &z, &a, eq,var, &ini, opt)); } + /// Fit data with dispersion s along x-direction for each data row. Return array with values for found formula. + inline mglData FitS(const mglDataA &y, const mglDataA &s, const char *eq, const char *var, const char *opt="") + { return mglData(true,mgl_fit_ys(gr, &y, &s, eq, var,0, opt)); } + inline mglData FitS(const mglDataA &y, const mglDataA &s, const char *eq, const char *var, mglData &ini, const char *opt="") + { return mglData(true,mgl_fit_ys(gr, &y, &s, eq, var, &ini, opt)); } + inline mglData FitS(const mglDataA &x, const mglDataA &y, const mglDataA &s, const char *eq, const char *var, const char *opt="") + { return mglData(true,mgl_fit_xys(gr, &x, &y, &s, eq, var,0, opt)); } + inline mglData FitS(const mglDataA &x, const mglDataA &y, const mglDataA &s, const char *eq, const char *var, mglData &ini, const char *opt="") + { return mglData(true,mgl_fit_xys(gr, &x, &y, &s, eq, var, &ini, opt)); } + /// Fit data with dispersion s along x-, y-directions for each data slice. Return array with values for found formula. + inline mglData FitS(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &s, const char *eq, const char *var, const char *opt="") + { return mglData(true,mgl_fit_xyzs(gr, &x, &y, &z, &s, eq, var,0, opt)); } + inline mglData FitS(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &s, const char *eq, const char *var, mglData &ini, const char *opt="") + { return mglData(true,mgl_fit_xyzs(gr, &x, &y, &z, &s, eq, var, &ini, opt)); } + /// Fit data with dispersion s along all directions. Return array with values for found formula. + inline mglData FitS(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const mglDataA &s, const char *eq, const char *var, const char *opt="") + { return mglData(true,mgl_fit_xyzas(gr, &x, &y, &z, &a, &s, eq, var,0, opt)); } + inline mglData FitS(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const mglDataA &s, const char *eq, const char *var, mglData &ini, const char *opt="") + { return mglData(true,mgl_fit_xyzas(gr, &x, &y, &z, &a, &s, eq, var, &ini, opt)); } + /// Print fitted last formula (with coefficients) + inline void PutsFit(mglPoint p, const char *prefix=0, const char *font=0, float size=-1) + { mgl_puts_fit(gr, p.x, p.y, p.z, prefix, font, size); } + /// Get last fitted formula + inline const char *GetFit() + { return mgl_get_fit(gr); } - /// Flag which allow to use color scheme along axis - bool OnCoord; - int CurFrameId; ///< Number of automaticle created frames - mreal TickLen; ///< Length of tiks (subticks length is sqrt(1+st_t)=1.41... times smaller) - char TickStl[32]; ///< Tick line style. Default is "k" - char SubTStl[32]; ///< Subtick line style. Default is "k" - mreal st_t; ///< Subtick-to-tick ratio (ls=lt/sqrt(1+st_t)). Default is 1. - /// Get RGB(A) lines for saving in file - virtual unsigned char **GetRGBLines(long &width, long &height, unsigned char *&f, bool alpha=false); - /// Set Pal & NumPal - void SetPal(const char *colors); - mglColor GetPal(); - /// Get Org.x (parse NAN value) - virtual mreal GetOrgX(char dir); - /// Get Org.y (parse NAN value) - virtual mreal GetOrgY(char dir); - /// Get Org.z (parse NAN value) - virtual mreal GetOrgZ(char dir); - /// Set the parameter lines directly (internaly used by mglGraph::SelectPen) - virtual void Pen(mglColor col, char style,mreal width); //=0 - /// Set the default color - virtual void DefColor(mglColor c, mreal alpha=-1)=0; - /// draw mark with different type at position {x,y,z} (no scaling) - virtual void Mark(mreal x,mreal y,mreal z,char mark='.')=0; - void InPlot(mreal x1,mreal x2,mreal y1,mreal y2, const char *style); - /// Draw generic colorbar - virtual void colorbar(const mglData &v, const mglColor *s, int where, mreal x, mreal y, mreal w, mreal h)=0; - /// Draws the point (ball) at position \a p with color \a c. - virtual void ball(mreal *p,mreal *c); - /// Plot tube between consequently connected lines with color and radius varing - virtual void tube_plot(long n,mreal *pp,mreal *cc,mreal *rr); - /// Plot series of consequently connected lines - virtual void curv_plot(long n,mreal *pp,bool *tt)=0; - /// Plot series of consequently connected lines with color varing - virtual void curv_plot(long n,mreal *pp,mreal *cc,bool *tt)=0; - /// Plot series of arbitrary connected lines. - virtual void curv_plot(long n,mreal *pp,bool *tt,long *nn)=0; - /// Mesh plot depending on positions and colors of vertexes on grid - virtual void mesh_plot(long n,long m,mreal *pp,mreal *cc,bool *tt, int how)=0; - /// Surface plot depending on positions and colors of vertexes on grid - virtual void surf_plot(long n,long m,mreal *pp,mreal *cc,bool *tt)=0; - /// Axial-symmetric isosurface based on contour line - virtual void axial_plot(long n,mreal *pp,long *nn,long np,bool wire)=0; - /// Cloud plot depending on positions and alpha of vertexes on 3D grid - virtual void cloud_plot(long nx,long ny,long nz,mreal *pp,mreal *a,mreal alpha)=0; - /// Boxs plot depending on positions and colors of vertexes on grid - virtual void boxs_plot(long n, long m, mreal *pp, mglColor *cc, bool *tt, - mreal Alpha, bool line)=0; - /// Plot isosurface depending on positions and colors of vertexes on 3D grid - virtual void surf3_plot(long n,long m,long *kx1,long *kx2,long *ky1,long *ky2,long *kz, - mreal *pp,mreal *cc,mreal *kk,mreal *nn,bool wire)=0; - /// Plot quads depending on positions and colors of vertexes on grid - virtual void quads_plot(long n, mreal *pp, mreal *cc, bool *tt)=0; - /// Plot independent triangles - virtual void trigs_plot(long n, long *nn, long m, mreal *pp, mreal *cc, bool *tt,bool wire, bool bytrig=false)=0; - /// Plot independent quads - virtual void quads_plot(long n, long *nn, long m, mreal *pp, mreal *cc, bool *tt,bool wire, bool byquad)=0; - /// Plot series of unconnected lines. - virtual void lines_plot(long n, mreal *pp, mreal *cc, bool *tt, bool ball, bool grad)=0; - /// Plot series of unconnected arrows. - virtual void vects_plot(long n, mreal *pp, mreal *cc, bool *tt, bool grad)=0; - /// Draw line between points \a p1,\a p2 with color \a c1, \a c2 at edges - virtual void line_plot(mreal *p1,mreal *p2,mreal *c1,mreal *c2,bool all=false)=0; - /// Draw glyph by peaces - virtual void glyph_line(mreal x,mreal y, mreal f, mreal *c, bool solid)=0; - virtual void glyph_fill(mreal x,mreal y, mreal f, int nt, const short *trig, mreal *c)=0; - virtual void glyph_wire(mreal x,mreal y, mreal f, int nl, const short *line, mreal *c)=0; - /// Scale coordinates of point for faster plotting also cut off some points - virtual bool ScalePoint(mreal &x,mreal &y,mreal &z); - /// fast linear interpolation - inline mreal _d(mreal v,mreal v1,mreal v2) { return v2!=v1?(v-v1)/(v2-v1):NAN; }; + /// Solve PDE with x,y,z in range [Min, Max] + inline mglData PDE(const char *ham, const mglDataA &ini_re, const mglDataA &ini_im, float dz=0.1, float k0=100, const char *opt="") + { return mglData(true,mgl_pde_solve(gr,ham,&ini_re,&ini_im,dz,k0, opt)); } + /// Fill data by formula with x,y,z in range [Min, Max] + inline void Fill(mglData &u, const char *eq, const char *opt="") + { mgl_data_fill_eq(gr, &u, eq, 0, 0, opt); } + inline void Fill(mglData &u, const char *eq, const mglDataA &v, const char *opt="") + { mgl_data_fill_eq(gr, &u, eq, &v, 0, opt); } + inline void Fill(mglData &u, const char *eq, const mglDataA &v, const mglDataA &w, const char *opt="") + { mgl_data_fill_eq(gr, &u, eq, &v, &w, opt); } - /// Get color depending on single variable \a z, which should be scaled if \a scale=true - mglColor GetC(mreal z,bool scale = true); - /// Get alpha value depending on single variable \a a - mreal GetA(mreal a); - /// Get color depending on three coordinates \a x,\a y,\a z - mglColor GetC(mreal x,mreal y,mreal z,bool simple=false); - /// add point to contour line chain - long add_cpoint(long &pc,mreal **p,mreal **k,bool **t,mreal x,mreal y,mreal z, - mreal k1,mreal k2,bool scale); - /// Draw tick - virtual void DrawTick(mreal *pp,bool sub); + /// Make histogram (distribution) of data. This function do not plot data. + inline mglData Hist(const mglDataA &x, const mglDataA &a, const char *opt="") + { return mglData(true, mgl_hist_x(gr, &x, &a, opt)); } + inline mglData Hist(const mglDataA &x, const mglDataA &y, const mglDataA &a, const char *opt="") + { return mglData(true, mgl_hist_xy(gr, &x, &y, &a, opt)); } + inline mglData Hist(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const char *opt="") + { return mglData(true, mgl_hist_xyz(gr, &x, &y, &z, &a, opt)); } -private: - GifFileType *gif; - char last_style[64]; - mreal _tetx,_tety,_tetz; - /// Actual lower edge of bounding box after applying transformation formulas. - mglPoint FMin; - /// Actual upper edge of bounding box after applying transformation formulas. - mglPoint FMax; - char *fit_res; ///< Last fitted formula - wchar_t *xbuf, *xstr[50], *ybuf, *ystr[50], *zbuf, *zstr[50]; - mreal xval[50], yval[50], zval[50]; - int xnum,ynum,znum; - void ClearEq(); ///< Clear the used variables for axis transformation - mglColor GetC2(mreal x,mreal y); - /// Prepare fitted formula - void PrepareFitEq(mreal chi, const char *eq, const char *var, mreal *par, bool print); - void tricont_line(mreal val, long i, long k0, long k1, long k2, const mglData &x, const mglData &y, const mglData &z, const mglData &a, mreal zVal); - /// Print curved text - void font_curve(long n,mreal *pp,bool *tt,long *nn,const wchar_t *text, - int pos,mreal size); - void string_curve(long f,long n,mreal *pp,long *nn,const wchar_t *text, - mreal size, int pos); + inline void Compression(bool){} // NOTE: Add later -- IDTF + inline void VertexColor(bool){} // NOTE: Add later -- IDTF + inline void DoubleSided(bool){} // NOTE: Add later -- IDTF + inline void TextureColor(bool){} // NOTE: Add later -- IDTF +}; +//----------------------------------------------------------------------------- +class mglParse +{ + HMPR pr; +public: + mglParse(bool setsize=false) + { pr=mgl_create_parser(); mgl_parser_allow_setsize(pr, setsize); } + ~mglParse() { mgl_delete_parser(pr); } + inline int Parse(mglGraph *gr, const char *str, int pos) + { return mgl_parse(gr->Self(), pr, str, pos); } + inline int Parse(mglGraph *gr, const wchar_t *str, int pos) + { return mgl_parsew(gr->Self(), pr, str, pos); } + inline void Execute(mglGraph *gr, const char *str, void (*error)(int line, int kind, char *mes)=NULL) + { mgl_parse_text(gr->Self(), pr, str, error); } + inline void Execute(mglGraph *gr, const wchar_t *str, void (*error)(int line, int kind, char *mes)=NULL) + { mgl_parsew_text(gr->Self(), pr, str, error); } + inline void Execute(mglGraph *gr, FILE *fp, bool print=false) + { mgl_parse_file(gr->Self(), pr, fp, print); } - /// Contour plot depending on positions and colors of vertexes on grid - void cont_plot(mreal val,long n,long m,mreal *a,mreal *x,mreal *y,mreal *z, - mreal zdef,bool axial,bool wire,int text); - /// Contour plot depending on positions and colors of vertexes on grid - void contf_plot(mreal v1,mreal v2,long n,long m,mreal *a,mreal *x,mreal *y,mreal *z, - mreal zdef); - /// make single flow thread for 2D case - void flow(bool simple, mreal zVal, mreal u, mreal v, - const mglData &x, const mglData &y, const mglData &ax, const mglData &ay); - /// make single flow thread for 3D case - void flow(bool simple, mreal u, mreal v, mreal w, - const mglData &x, const mglData &y, const mglData &z, - const mglData &ax, const mglData &ay, const mglData &az); - /// make single flow tube for 2D case - void flowr(bool simple, mreal zVal, mreal u, mreal v, - const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, mreal r0); - /// make single flow tube for 3D case - void flowr(bool simple, mreal u, mreal v, mreal w, - const mglData &x, const mglData &y, const mglData &z, - const mglData &ax, const mglData &ay, const mglData &az, mreal r0); - /// Put alpha valued point for Cloud like plot - void AVertex(mreal x,mreal y,mreal z, mreal a,mreal alpha); - /// add point to isosurface chain - long add_spoint(long &pc,mreal **p,mreal **k,mreal **c,mreal **n, - mreal x,mreal y,mreal z,mreal nx,mreal ny,mreal nz, - mreal k1,mreal k2,mreal k3,mreal a); + inline void AddParam(int id, const char *str) { mgl_add_param(pr, id, str); } + inline void AddParam(int id, const wchar_t *str){ mgl_add_paramw(pr, id, str); } + inline void RestoreOnce() { mgl_restore_once(pr); } + inline void AllowSetSize(bool allow) { mgl_parser_allow_setsize(pr, allow); } - /// Set internal boundng box depending on transformation formula - void SetFBord(mreal x,mreal y,mreal z); - /// Set color depending on it value - void Color(mreal a,mreal a1=0,mreal a2=0); // ���� ����� - /// Draw x axis - void AxisX(bool text, const char *stl); - /// Draw y axis - void AxisY(bool text, const char *stl); - /// Draw z axis - void AxisZ(bool text, const char *stl); - /// Draw y,t-axis for Ternary plot - void AxisT(bool text, const char *stl); - /// Draw ticks on box - void TickBox(); - /// Draw X,Y,Z grid line - void DrawXGridLine(mreal t, mreal y0, mreal z0); - void DrawYGridLine(mreal t, mreal x0, mreal z0); - void DrawZGridLine(mreal t, mreal x0, mreal y0); - void DrawTGridLine(mreal t, mreal z0); - /// Draw X,Y,Z tick - void DrawXTick(mreal t, mreal y0, mreal z0, mreal dy, mreal dz, int fact=0); - void DrawYTick(mreal t, mreal x0, mreal z0, mreal dx, mreal dz, int fact=0); - void DrawZTick(mreal t, mreal x0, mreal y0, mreal dx, mreal dy, int fact=0); - void DrawTTick(mreal t, mreal x0, mreal z0, mreal dx, mreal dz, int fact=0); - void adjust(char dir, mreal dv); + /*===!!! NOTE !!! You must not delete obtained data arrays !!!===============*/ + inline mglData *AddVar(const char *name) { return mgl_add_var(pr, name); } + /*===!!! NOTE !!! You must not delete obtained data arrays !!!===============*/ + inline mglData *FindVar(const char *name) { return mgl_find_var(pr, name); } + inline void DeleteVar(const char *name) { mgl_del_var(pr, name); } + inline void Stop() { mgl_parser_stop(pr); } }; //----------------------------------------------------------------------------- #endif -#endif -//----------------------------------------------------------------------------- diff --git a/include/mgl/mgl_ab.h b/include/mgl/mgl_ab.h deleted file mode 100644 index 5c21a65..0000000 --- a/include/mgl/mgl_ab.h +++ /dev/null @@ -1,252 +0,0 @@ -/*************************************************************************** - * mgl_ab.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -//----------------------------------------------------------------------------- -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" -#else -#ifndef _MGL_AB_H_ -#define _MGL_AB_H_ -#include "mgl/mgl.h" -#ifndef MGL_STACK_ENTRY -#define MGL_STACK_ENTRY 10 -#endif -//----------------------------------------------------------------------------- -/// Class implement the creation of different mathematical plots using Z-ordering -class mglGraphAB : public mglGraph -{ -public: -using mglGraph::Mark; -using mglGraph::Ball; -//using mglGraph::Colorbar; -using mglGraph::Legend; - int *OI; ///< ObjId arrays - int ObjId; ///< object id for mglPrim - - /// Initialize ZBuffer drawing and allocate the memory for image with size [Width x Height]. - mglGraphAB(int w=600, int h=400); - virtual ~mglGraphAB(); - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ��������� ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// virtual void WriteEPS(const char *fname,const char *descr=0); - virtual void WriteSVG(const char *fname,const char *descr=0); - virtual int NewFrame(); -// virtual void EndFrame(); - - void SetFontSizePT(mreal pt, int dpi=72); - bool Alpha(bool enable); - bool Light(bool enable); - void Light(int n, bool enable); - void Light(int n,mglPoint p, mglColor c=WC, mreal br=0.5, bool infty=true, mreal ap=0); - - virtual void InPlot(mreal x1,mreal x2,mreal y1,mreal y2, bool rel=false); - virtual void DefaultPlotParam(); ///< Set default parameter for plotting - virtual void Rotate(mreal TetX,mreal TetZ,mreal TetY=0); - void StickPlot(int num, int i, mreal tet, mreal phi); - void Aspect(mreal Ax,mreal Ay,mreal Az); - void RotateN(mreal Tet,mreal x,mreal y,mreal z); - void Perspective(mreal a); - - virtual void SetSize(int w,int h); - - void Mark(mreal x,mreal y,mreal z,char mark='.'); - void Ball(mreal x,mreal y,mreal z,mglColor col=RC,mreal alpha=1); - void Glyph(mreal x, mreal y, mreal f, int style, long icode, char col); - mreal GetRatio() { return B1[0]/B1[4]; }; - void Putsw(mglPoint p,const wchar_t *text,const char *font=0,mreal size=-1,char dir=0,mreal shift=0); - mreal Putsw(mglPoint p,mglPoint l,const wchar_t *text,char font='t',mreal size=-1); - void Pen(mglColor col, char style,mreal width); - void Legend(int n, wchar_t **text, char **style, mreal x, mreal y, const char *font="rL", mreal size=-0.8, mreal llen=0.1); - -// void Colorbar(int where, mreal x, mreal y, mreal w, mreal h); -// void Colorbar(const mglData &v, const char *sch, int where, mreal x, mreal y, mreal w, mreal h); - /// Get RGB bitmap of current state image. - virtual const unsigned char *GetBits(); - /// Get RGBA bitmap of current state image. - const unsigned char *GetRGBA(); - /// Get width of the image - int GetWidth() { return Width; }; - /// Get height of the image - int GetHeight() { return Height; }; - /// Set allowed drawing region (for multithreading, like subplots) - void SetDrawReg(int m, int n, int k); - /// Put drawing from other mglGraphZB (for multithreading, like subplots) - virtual void PutDrawReg(int m, int n, int k, mglGraphAB *gr); - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /** @name Widget functions - * These functions control window behaviar in classes mglGraphFLTK, mglGraphQT - * and so on. They do nothing in "non-visual" classes like mglGraphZB, - * mglGraphPS, mglGraphGL, mglGraphIDTF. */ - //@{ - bool AutoClf; ///< Clear canvas between drawing - mreal Delay; ///< Delay for animation in seconds - bool ShowMousePos; ///< Switch to show or not mouse click position - mglPoint LastMousePos; ///< Last mouse position - bool ClfOnUpdate; ///< Clear plot before Update() - /// Calculate 3D coordinate {x,y,z} for screen point {xs,ys} - mglPoint CalcXYZ(int xs, int ys); - /// Calculate screen point {xs,ys} for 3D coordinate {x,y,z} - void CalcScr(mglPoint p, int *xs, int *ys); - mglPoint CalcScr(mglPoint p); - /// Switch on/off transparency (do not overwrite switches in user drawing function) - virtual void ToggleAlpha(); - /// Switch on/off lighting (do not overwrite switches in user drawing function) - virtual void ToggleLight(); - virtual void ToggleZoom(); ///< Switch on/off zooming by mouse - virtual void ToggleRotate();///< Switch on/off rotation by mouse - virtual void ToggleNo(); ///< Switch off all zooming and rotation - virtual void Update(); ///< Update picture by calling user drawing function - virtual void ReLoad(bool o);///< Reload user data and update picture - virtual void Adjust(); ///< Adjust size of bitmap to window size - virtual void NextFrame(); ///< Show next frame (if one) - virtual void PrevFrame(); ///< Show previous frame (if one) - virtual void Animation(); ///< Run slideshow (animation) of frames - /// Create a window for plotting based on callback function (can be NULL). - virtual void Window(int argc, char **argv, int (*draw)(mglGraph *gr, void *p), - const char *title, void *par=NULL, - void (*reload)(int next, void *p)=NULL, bool maximize=false); - /// Create a window for plotting based on class mglDraw. - void Window(int argc, char **argv, const char *title, mglDraw *draw, bool maximize=false); - /// Push transformation matrix into stack - virtual void Push(); - /// Pop transformation matrix from stack - virtual void Pop(); - /// Set diagonal matrix and its shift - void SetPosScale(mreal xp, mreal yp, mreal zp, mreal scl=1); - //@} -protected: - unsigned char *G4; ///< Final picture in RGBA format. Prepared after calling mglGraphZB::Finish(). - unsigned char *G; ///< Final picture in RGB format. Prepared after calling mglGraphZB::Finish(). - mreal CDef[4]; ///< Default color - unsigned char BDef[4]; ///< Background color - mreal Persp; ///< Perspective factor (=0 is perspective off) - mreal xPos; ///< Shifting plot in X-direction (used by PostScale() function) - mreal yPos; ///< Shifting plot in Y-direction (used by PostScale() function) - mreal zPos; ///< Shifting plot in depth (used by PostScale() function) - int Width; ///< Width of the image - int Height; ///< Height of the image - int Depth; ///< Depth of the image - mreal B[9]; ///< Transformation matrix (used by PostScale() function) - mreal B1[12]; ///< Transformation matrix for colorbar - mreal inW, inH; ///< Relative width and height of last InPlot - unsigned PDef; ///< Pen bit mask - mreal pPos; ///< Current position in pen mask - bool UseLight; ///< Flag of using lightning - bool nLight[10]; ///< Availability of light sources - bool iLight[10]; ///< Infinity/local position of light sources - mreal rLight[30]; ///< Position of light sources - mreal pLight[30]; ///< Actual position of light sources (filled by LightScale() function) - mreal aLight[10]; ///< Aperture of light sources - mreal bLight[10]; ///< Brightness of light sources - mreal cLight[30]; ///< Color of light sources - bool Finished; ///< Flag that final picture \a mglGraphZB::G is ready - mreal PenWidth; ///< Pen width for further line plotting (must be >0 !!!) - bool NoAutoFactor; ///< Temporary variable - mreal f_size; ///< font size for glyph lines - mreal fscl,ftet; ///< last scale and rotation for glyphs - int nx1, nx2, ny1, ny2; // Allowed drawing region - - int NumFig; ///< Number of figures in the list. If 0 then no list and mglGraph::DrawFunc will called for each drawing. - void (*LoadFunc)(int next, void *par); - void *FuncPar; ///< Parameters for drawing function mglGraph::DrawFunc. - /// Drawing function for window procedure. It should return the number of frames. - int (*DrawFunc)(mglGraph *gr, void *par); - - unsigned char **GetRGBLines(long &w, long &h, unsigned char *&f, bool solid=true); - /// Additionally scale points \a p (array with length 3*n) for positioning in image - void PostScale(mreal *p,long n); - /// Additionally scale positions of light sources - virtual void LightScale(); - /// Additionally scale normals \a s (array with length 3*n) - void NormScale(mreal *s,long n); - /// Set default color - void DefColor(mglColor c, mreal alpha=-1); - void colorbar(const mglData &v, const mglColor *s, int where, mreal x, mreal y, mreal w, mreal h); - - /// Plot point \a p with color \a c - virtual void pnt_plot(long x,long y,mreal z,unsigned char c[4]); - /// Transform mglColor and alpha value to bits format - unsigned char* col2int(mglColor c, mreal alpha,unsigned char *r); // mglColor -> int - /// Transform mreal color and alpha to bits format - unsigned char* col2int(mreal *c,mreal *n,unsigned char *r); - /// Draw line between points \a p1,\a p2 with color \a c1, \a c2 at edges - virtual void line_plot(mreal *p1,mreal *p2,mreal *c1,mreal *c2,bool all=false); - virtual void line_draw(mreal *p1,mreal *p2,mreal *c1,mreal *c2,bool all=false); - /// Draws the point (ball) at position \a p with color \a c. - virtual void ball(mreal *p,mreal *c); - - /// Draw triangle between points \a p0,\a p1,\a p2 with color \a c0, \a c1, \a c2 at edges - virtual void trig_plot(mreal *p0,mreal *p1,mreal *p2, - mreal *c0,mreal *c1,mreal *c2); - virtual void trig_draw(mreal *p0,mreal *p1,mreal *p2, - mreal *c0,mreal *c1,mreal *c2); - /// Draw triangle between points \a p0,\a p1,\a p2 with color \a c0, \a c1, \a c2 at edges - virtual void trig_plot_n(mreal *p0,mreal *p1,mreal *p2, - mreal *c0,mreal *c1,mreal *c2, - mreal *n0,mreal *n1,mreal *n2); - /// Draw face of points \a p0,\a p1,\a p2,\a p3 with color \a c0, \a c1, \a c2, \a c3 at edges - virtual void quad_plot(mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal *c0,mreal *c1,mreal *c2,mreal *c3); - virtual void quad_draw(mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal *c0,mreal *c1,mreal *c2,mreal *c3); - /// Draw face of points \a p0,\a p1,\a p2,\a p3 with values \a a0, \a a1, \a a2, \a a3 at edges - virtual void quad_plot_a(mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal a0,mreal a1,mreal a2,mreal a3,mreal alpha); - /// Draw face of points \a p0,\a p1,\a p2,\a p3 with color \a c0, \a c1, \a c2, \a c3 at edges - virtual void quad_plot_n(mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal *c0,mreal *c1,mreal *c2,mreal *c3, - mreal *n0,mreal *n1,mreal *n2,mreal *n3); - /// Draw mark at position \a pp with style \a type - virtual void mark_plot(mreal *pp, char type); - /// Combine colors in 2 plane. - void combine(unsigned char *c1,unsigned char *c2); // �������� ������ - virtual void cloud_plot(long nx,long ny,long nz,mreal *pp,mreal *a,mreal alpha); - // ��������� ���������� ��� mglGraph - virtual void arrow_plot(mreal *p1,mreal *p2,char st); - void curv_plot(long n,mreal *pp,bool *tt); - void curv_plot(long n,mreal *pp,bool *tt,long *nn); - void curv_plot(long n,mreal *pp,mreal *cc,bool *tt); - void mesh_plot(long n,long m,mreal *pp,mreal *cc,bool *tt,int how); - void wire_plot(long n,long m,mreal *pp,mreal *cc,bool *tt); - void surf_plot(long n,long m,mreal *pp,mreal *cc,bool *tt); - void axial_plot(long n,mreal *pp,long *nn,long np, bool wire); - void boxs_plot(long n, long m, mreal *pp, mglColor *cc, - bool *tt,mreal Alpha, bool line); - void surf3_plot(long n,long m,long *kx1,long *kx2,long *ky1,long *ky2,long *kz, - mreal *pp,mreal *cc,mreal *kk,mreal *nn,bool wire); - void trigs_plot(long n, long *nn, long m, mreal *pp, mreal *cc, bool *tt,bool wire, bool bytrig=false); - void quads_plot(long n, long *nn, long m, mreal *pp, mreal *cc, bool *tt,bool wire, bool byquad); - void quads_plot(long n, mreal *pp, mreal *cc, bool *tt); - void lines_plot(long n, mreal *pp, mreal *cc, bool *tt, bool ball, bool grad); - void vects_plot(long n, mreal *pp, mreal *cc, bool *tt, bool grad); - void glyph_fill(mreal x,mreal y, mreal f, int nt, const short *trig, mreal *c); - void glyph_wire(mreal x,mreal y, mreal f, int nl, const short *line, mreal *c); - void glyph_line(mreal x,mreal y, mreal f, mreal *c, bool solid); - void FindOptOrg(mreal ax[3], mreal ay[3], mreal az[3]); - mreal GetOrgX(char dir); - mreal GetOrgY(char dir); - mreal GetOrgZ(char dir); - void DrawTick(mreal *pp,bool sub); -private: - mreal stack[MGL_STACK_ENTRY*13]; // stack for transformation matrixes - int st_pos; -}; -//----------------------------------------------------------------------------- -#endif -#endif -//----------------------------------------------------------------------------- diff --git a/include/mgl/mgl_addon.h b/include/mgl/mgl_addon.h deleted file mode 100644 index bd5224c..0000000 --- a/include/mgl/mgl_addon.h +++ /dev/null @@ -1,73 +0,0 @@ -/*************************************************************************** - * mgl_addon.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -//--------------------------------------------------------------------------- -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" -#else -#ifndef _MGL_ADDON_H_ -#define _MGL_ADDON_H_ -//--------------------------------------------------------------------------- -#include -#include -//--------------------------------------------------------------------------- -/// Integer power of the \a x -double mgl_ipow(double x,int n); -/// Integer power of the \a x -dual mgl_ipowc(dual x,int n); -void mgl_srnd(long seed); -double mgl_rnd(); -double mgl_gauss_rnd(); -dual expi(dual a); -dual expi(double a); -void mgl_fft_freq(double *freq,unsigned nn); -//--------------------------------------------------------------------------- -/// Duplicate string (returned pointer must be free() after usage) -char *mgl_strdup(const char *s); -wchar_t *mgl_wcsdup(const wchar_t *s); -/// Remove spaces at begining and at the end of the string -void mgl_strtrim(char *str); -void mgl_wcstrim(wchar_t *str); -/// Change register to lowercase (only for ANSI symbols) -void mgl_strlwr(char *str); -/// Remove double spaces from the string -void mgl_strcls(char *str); -/// Get position of substring or return -1 if not found -int mgl_strpos(const char *str,char *fnd); -/// Get position of symbol or return -1 if not found -int mgl_strpos(const char *str,char fnd); -//--------------------------------------------------------------------------- -/// Get uncommented string from file (NOTE: it is not thread safe!!!) -char *mgl_fgetstr(FILE *fp); -/// Check if symbol denote true -bool mgl_istrue(char ch); -/// Print test message -void mgl_test(const char *str, ...); -/// Print info message -void mgl_info(const char *str, ...); -/// Locate next data block (block started by -----) -FILE *mgl_next_data(const char *fname,int p); -//--------------------------------------------------------------------------- -/// Explicit scheme for 1 step of axial diffraction -bool mglDifrAxial(dual *a, int n, dual q, int Border,dual *b, dual *d, int kk, double di); -/// Explicit scheme for 1 step of plane diffraction -bool mglDifrGrid(dual *a,int n,dual q,int Border,dual *b,dual *d,int kk); -//--------------------------------------------------------------------------- -#endif -#endif diff --git a/include/mgl/mgl_c.h b/include/mgl/mgl_c.h deleted file mode 100644 index ca8f9ea..0000000 --- a/include/mgl/mgl_c.h +++ /dev/null @@ -1,672 +0,0 @@ -/*************************************************************************** - * mgl_c.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef _MGL_C_H_ -#define _MGL_C_H_ - -#include - -#if(MGL_USE_DOUBLE==1) -typedef double mreal; -#else -typedef float mreal; -#endif -//#include - -#ifdef __cplusplus -extern "C" { -#endif -/*****************************************************************************/ -//#ifdef _MGL_DATA_H_ -#ifdef __cplusplus -class mglDraw; -typedef mglDraw* HMDR; -class mglGraph; -typedef mglGraph* HMGL; -class mglData; -typedef mglData* HMDT; -class mglParse; -typedef mglParse* HMPR; -#else -typedef void* HMDR; -typedef void* HMGL; -typedef void* HMDT; -typedef void* HMPR; -#endif -#ifndef NO_GSL -#include -#include -#else -struct gsl_vector; -struct gsl_matrix; -#endif -/*****************************************************************************/ -HMGL mgl_create_graph_gl(); -HMGL mgl_create_graph_zb(int width, int height); -HMGL mgl_create_graph_ps(int width, int height); -HMGL mgl_create_graph_idtf(); -#ifndef MGL_NO_WIDGET -int mgl_fortran_func(HMGL gr, void *); -HMGL mgl_create_graph_glut(int (*draw)(HMGL gr, void *p), const char *title, void *par); -HMGL mgl_create_graph_fltk(int (*draw)(HMGL gr, void *p), const char *title, void *par); -HMGL mgl_create_graph_qt(int (*draw)(HMGL gr, void *p), const char *title, void *par); -HMGL mgl_create_graph_glut_dr(HMDR dr, const char *title); -HMGL mgl_create_graph_fltk_dr(HMDR dr, const char *title); -HMGL mgl_create_graph_qt_dr(HMDR dr, const char *title); -void mgl_fltk_run(); -void mgl_qt_run(); - -void mgl_wnd_set_delay(HMGL gr, mreal dt); -void mgl_wnd_set_auto_clf(HMGL gr, int val); -void mgl_wnd_set_show_mouse_pos(HMGL gr, int val); -void mgl_wnd_set_clf_update(HMGL gr, int val); -void mgl_wnd_toggle_alpha(HMGL gr); -void mgl_wnd_toggle_light(HMGL gr); -void mgl_wnd_toggle_zoom(HMGL gr); -void mgl_wnd_toggle_rotate(HMGL gr); -void mgl_wnd_toggle_no(HMGL gr); -void mgl_wnd_update(HMGL gr); -void mgl_wnd_reload(HMGL gr, int o); -void mgl_wnd_adjust(HMGL gr); -void mgl_wnd_next_frame(HMGL gr); -void mgl_wnd_prev_frame(HMGL gr); -void mgl_wnd_animation(HMGL gr); -#endif -void mgl_set_show_mouse_pos(HMGL gr, int enable); -void mgl_get_last_mouse_pos(HMGL gr, mreal *x, mreal *y, mreal *z); -void mgl_calc_xyz(HMGL gr, int xs, int ys, mreal *x, mreal *y, mreal *z); -void mgl_calc_scr(HMGL gr, mreal x, mreal y, mreal z, int *xs, int *ys); -//void mgl_fltk_thread(); -//void mgl_qt_thread(); -void mgl_update(HMGL graph); -void mgl_delete_graph(HMGL graph); -/*****************************************************************************/ -HMDT mgl_create_data(); -HMDT mgl_create_data_size(int nx, int ny, int nz); -HMDT mgl_create_data_file(const char *fname); -void mgl_delete_data(HMDT dat); -/*****************************************************************************/ -HMPR mgl_create_parser(); -void mgl_delete_parser(HMPR p); -void mgl_scan_func(HMPR p, const wchar_t *line); -void mgl_add_param(HMPR p, int id, const char *str); -void mgl_add_paramw(HMPR p, int id, const wchar_t *str); -/*===!!! NOTE !!! You must not delete obtained data arrays !!!===============*/ -HMDT mgl_add_var(HMPR, const char *name); -/*===!!! NOTE !!! You must not delete obtained data arrays !!!===============*/ -HMDT mgl_find_var(HMPR, const char *name); -int mgl_parse(HMGL gr, HMPR p, const char *str, int pos); -int mgl_parsew(HMGL gr, HMPR p, const wchar_t *str, int pos); -void mgl_parse_text(HMGL gr, HMPR p, const char *str); -void mgl_parsew_text(HMGL gr, HMPR p, const wchar_t *str); -void mgl_restore_once(HMPR p); -void mgl_parser_allow_setsize(HMPR p, int a); -/*****************************************************************************/ -/* Setup mglGraph */ -/*****************************************************************************/ -void mgl_set_def_param(HMGL gr); -void mgl_set_palette(HMGL gr, const char *colors); -void mgl_set_pal_color(HMGL graph, int n, mreal r, mreal g, mreal b); -void mgl_set_pal_num(HMGL graph, int num); -void mgl_set_rotated_text(HMGL graph, int rotated); -void mgl_set_cut(HMGL graph, int cut); -void mgl_set_cut_box(HMGL gr, mreal x1,mreal y1,mreal z1,mreal x2,mreal y2,mreal z2); -void mgl_set_tick_len(HMGL graph, mreal len, mreal stt); -void mgl_set_tick_stl(HMGL gr, const char *stl, const char *sub); -void mgl_set_bar_width(HMGL graph, mreal width); -void mgl_set_base_line_width(HMGL gr, mreal size); -void mgl_set_mark_size(HMGL graph, mreal size); -void mgl_set_arrow_size(HMGL graph, mreal size); -void mgl_set_font_size(HMGL graph, mreal size); -void mgl_set_font_def(HMGL graph, const char *fnt); -void mgl_set_alpha_default(HMGL graph, mreal alpha); -void mgl_set_size(HMGL graph, int width, int height); -void mgl_set_axial_dir(HMGL graph, char dir); -void mgl_set_meshnum(HMGL graph, int num); -void mgl_set_zoom(HMGL gr, mreal x1, mreal y1, mreal x2, mreal y2); -void mgl_set_plotfactor(HMGL gr, mreal val); -void mgl_set_draw_face(HMGL gr, int enable); -void mgl_set_scheme(HMGL gr, const char *sch); -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); -int mgl_get_warn(HMGL gr); -/*****************************************************************************/ -/* Export to file or to memory */ -/*****************************************************************************/ -void mgl_show_image(HMGL graph, const char *viewer, int keep); -void mgl_write_frame(HMGL graph, const char *fname,const char *descr); -void mgl_write_bmp(HMGL graph, const char *fname,const char *descr); -void mgl_write_jpg(HMGL graph, const char *fname,const char *descr); -void mgl_write_png(HMGL graph, const char *fname,const char *descr); -void mgl_write_png_solid(HMGL graph, const char *fname,const char *descr); -void mgl_write_eps(HMGL graph, const char *fname,const char *descr); -void mgl_write_svg(HMGL graph, const char *fname,const char *descr); -void mgl_write_idtf(HMGL graph, const char *fname,const char *descr); -void mgl_write_gif(HMGL graph, const char *fname,const char *descr); -void mgl_start_gif(HMGL graph, const char *fname,int ms); -void mgl_close_gif(HMGL graph); -const unsigned char *mgl_get_rgb(HMGL graph); -const unsigned char *mgl_get_rgba(HMGL graph); -int mgl_get_width(HMGL graph); -int mgl_get_height(HMGL graph); -/*****************************************************************************/ -/* Setup frames transparency (alpha) and lightning */ -/*****************************************************************************/ -int mgl_new_frame(HMGL graph); -void mgl_end_frame(HMGL graph); -int mgl_get_num_frame(HMGL graph); -void mgl_reset_frames(HMGL graph); -void mgl_set_transp_type(HMGL graph, int type); -void mgl_set_transp(HMGL graph, int enable); -void mgl_set_alpha(HMGL graph, int enable); -void mgl_set_fog(HMGL graph, mreal d, mreal dz); -void mgl_set_light(HMGL graph, int enable); -void mgl_set_light_n(HMGL gr, int n, int enable); -void mgl_add_light(HMGL graph, int n, mreal x, mreal y, mreal z, char c); -void mgl_add_light_rgb(HMGL graph, int n, mreal x, mreal y, mreal z, int infty, mreal r, mreal g, mreal b, mreal i); -void mgl_set_ambbr(HMGL gr, mreal i); -/*****************************************************************************/ -/* Scale and rotate */ -/*****************************************************************************/ -void mgl_mat_pop(HMGL gr); -void mgl_mat_push(HMGL gr); -void mgl_identity(HMGL graph, int rel); -void mgl_clf(HMGL graph); -void mgl_flush(HMGL gr); -void mgl_clf_rgb(HMGL graph, mreal r, mreal g, mreal b); -void mgl_subplot(HMGL graph, int nx,int ny,int m); -void mgl_subplot_d(HMGL graph, int nx,int ny,int m, mreal dx, mreal dy); -void mgl_subplot_s(HMGL graph, int nx,int ny,int m,const char *style); -void mgl_inplot(HMGL graph, mreal x1,mreal x2,mreal y1,mreal y2); -void mgl_relplot(HMGL graph, mreal x1,mreal x2,mreal y1,mreal y2); -void mgl_columnplot(HMGL graph, int num, int ind); -void mgl_columnplot_d(HMGL graph, int num, int ind, mreal d); -void mgl_stickplot(HMGL graph, int num, int ind, mreal tet, mreal phi); -void mgl_aspect(HMGL graph, mreal Ax,mreal Ay,mreal Az); -void mgl_rotate(HMGL graph, mreal TetX,mreal TetZ,mreal TetY); -void mgl_rotate_vector(HMGL graph, mreal Tet,mreal x,mreal y,mreal z); -void mgl_perspective(HMGL graph, mreal val); -/*****************************************************************************/ -/* Axis functions */ -/*****************************************************************************/ -void mgl_adjust_ticks(HMGL graph, const char *dir); -void mgl_set_ticks(HMGL graph, mreal DX, mreal DY, mreal DZ); -void mgl_set_subticks(HMGL graph, int NX, int NY, int NZ); -void mgl_set_ticks_dir(HMGL graph, char dir, mreal d, int ns, mreal org); -void mgl_set_ticks_val(HMGL graph, char dir, int n, double val, const char *lbl, ...); -void mgl_set_ticks_vals(HMGL graph, char dir, int n, mreal *val, const char **lbl); -void mgl_set_caxis(HMGL graph, mreal C1,mreal C2); -void mgl_set_axis(HMGL graph, mreal x1, mreal y1, mreal z1, mreal x2, mreal y2, mreal z2, mreal x0, mreal y0, mreal z0); -void mgl_set_axis_3d(HMGL graph, mreal x1, mreal y1, mreal z1, mreal x2, mreal y2, mreal z2); -void mgl_set_axis_2d(HMGL graph, mreal x1, mreal y1, mreal x2, mreal y2); -inline void mgl_set_ranges(HMGL graph, mreal x1, mreal x2, mreal y1, mreal y2, mreal z1, mreal z2) -{ mgl_set_axis_3d(graph, x1,y1,z1,x2,y2,z2); }; -void mgl_set_origin(HMGL graph, mreal x0, mreal y0, mreal z0); -void mgl_set_tick_origin(HMGL graph, mreal x0, mreal y0, mreal z0); -void mgl_set_crange(HMGL graph, const HMDT a, int add); -void mgl_set_xrange(HMGL graph, const HMDT a, int add); -void mgl_set_yrange(HMGL graph, const HMDT a, int add); -void mgl_set_zrange(HMGL graph, const HMDT a, int add); -void mgl_set_auto(HMGL graph, mreal x1, mreal x2, mreal y1, mreal y2, mreal z1, mreal z2); -void mgl_set_func(HMGL graph, const char *EqX,const char *EqY,const char *EqZ); -void mgl_set_func_ext(HMGL graph, const char *EqX,const char *EqY,const char *EqZ,const char *EqA); -void mgl_set_coor(HMGL gr, int how); -void mgl_set_ternary(HMGL gr, int enable); -void mgl_set_cutoff(HMGL graph, const char *EqC); -void mgl_box(HMGL graph, int ticks); -void mgl_box_str(HMGL graph, const char *col, int ticks); -void mgl_box_rgb(HMGL graph, mreal r, mreal g, mreal b, int ticks); -void mgl_axis(HMGL graph, const char *dir); -void mgl_axis_grid(HMGL graph, const char *dir,const char *pen); -void mgl_label(HMGL graph, char dir, const char *text); -void mgl_label_ext(HMGL graph, char dir, const char *text, mreal pos, mreal size, mreal shift); -void mgl_labelw_ext(HMGL graph, char dir, const wchar_t *text, mreal pos, mreal size, mreal shift); -void mgl_label_xy(HMGL graph, mreal x, mreal y, const char *text, const char *fnt, mreal size); -void mgl_labelw_xy(HMGL graph, mreal x, mreal y, const wchar_t *text, const char *fnt, mreal size); -void mgl_tune_ticks(HMGL graph, int tune, mreal fact_pos); -void mgl_set_xttw(HMGL graph, const wchar_t *templ); -void mgl_set_yttw(HMGL graph, const wchar_t *templ); -void mgl_set_zttw(HMGL graph, const wchar_t *templ); -void mgl_set_cttw(HMGL graph, const wchar_t *templ); -void mgl_set_xtt(HMGL graph, const char *templ); -void mgl_set_ytt(HMGL graph, const char *templ); -void mgl_set_ztt(HMGL graph, const char *templ); -void mgl_set_ctt(HMGL graph, const char *templ); -/*****************************************************************************/ -/* Simple drawing */ -/*****************************************************************************/ -void mgl_ball(HMGL graph, mreal x,mreal y,mreal z); -void mgl_ball_rgb(HMGL graph, mreal x, mreal y, mreal z, mreal r, mreal g, mreal b, mreal alpha); -void mgl_ball_str(HMGL graph, mreal x, mreal y, mreal z, char col); -void mgl_line(HMGL graph, mreal x1, mreal y1, mreal z1, mreal x2, mreal y2, mreal z2, const char *pen,int n); -void mgl_facex(HMGL graph, mreal x0, mreal y0, mreal z0, mreal wy, mreal wz, const char *stl, mreal dx, mreal dy); -void mgl_facey(HMGL graph, mreal x0, mreal y0, mreal z0, mreal wx, mreal wz, const char *stl, mreal dx, mreal dy); -void mgl_facez(HMGL graph, mreal x0, mreal y0, mreal z0, mreal wx, mreal wy, const char *stl, mreal dx, mreal dy); -void mgl_curve(HMGL graph, mreal x1, mreal y1, mreal z1, mreal dx1, mreal dy1, mreal dz1, mreal x2, mreal y2, mreal z2, mreal dx2, mreal dy2, mreal dz2, const char *pen,int n); - -void mgl_puts(HMGL graph, mreal x, mreal y, mreal z,const char *text); -void mgl_putsw(HMGL graph, mreal x, mreal y, mreal z,const wchar_t *text); -void mgl_puts_dir(HMGL graph, mreal x, mreal y, mreal z, mreal dx, mreal dy, mreal dz, const char *text, mreal size); -void mgl_putsw_dir(HMGL graph, mreal x, mreal y, mreal z, mreal dx, mreal dy, mreal dz, const wchar_t *text, mreal size); -void mgl_text(HMGL graph, mreal x, mreal y, mreal z,const char *text); -void mgl_title(HMGL graph, const char *text, const char *fnt, mreal size); -void mgl_titlew(HMGL graph, const wchar_t *text, const char *fnt, mreal size); -void mgl_putsw_ext(HMGL graph, mreal x, mreal y, mreal z,const wchar_t *text,const char *font,mreal size,char dir); -void mgl_puts_ext(HMGL graph, mreal x, mreal y, mreal z,const char *text,const char *font,mreal size,char dir); -void mgl_text_ext(HMGL graph, mreal x, mreal y, mreal z,const char *text,const char *font,mreal size,char dir); -void mgl_colorbar(HMGL graph, const char *sch,int where); -void mgl_colorbar_ext(HMGL graph, const char *sch, int where, mreal x, mreal y, mreal w, mreal h); -void mgl_colorbar_val(HMGL graph, const HMDT dat, const char *sch,int where); -void mgl_simple_plot(HMGL graph, const HMDT a, int type, const char *stl); -void mgl_add_legend(HMGL graph, const char *text,const char *style); -void mgl_add_legendw(HMGL graph, const wchar_t *text,const char *style); -void mgl_clear_legend(HMGL graph); -void mgl_legend_xy(HMGL graph, mreal x, mreal y, const char *font, mreal size, mreal llen); -void mgl_legend(HMGL graph, int where, const char *font, mreal size, mreal llen); -void mgl_set_legend_box(HMGL gr, int enable); -void mgl_set_legend_marks(HMGL gr, int num); -/*****************************************************************************/ -/* 1D plotting functions */ -/*****************************************************************************/ -void mgl_fplot(HMGL graph, const char *fy, const char *stl, int n); -void mgl_fplot_xyz(HMGL graph, const char *fx, const char *fy, const char *fz, const char *stl, int n); -void mgl_plot_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *pen); -void mgl_plot_xy(HMGL graph, const HMDT x, const HMDT y, const char *pen); -void mgl_plot(HMGL graph, const HMDT y, const char *pen); -void mgl_radar(HMGL graph, const HMDT a, const char *pen, mreal r); -void mgl_boxplot_xy(HMGL graph, const HMDT x, const HMDT a, const char *pen); -void mgl_boxplot(HMGL graph, const HMDT a, const char *pen); -void mgl_tens_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *pen); -void mgl_tens_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT c, const char *pen); -void mgl_tens(HMGL graph, const HMDT y, const HMDT c, const char *pen); -void mgl_area_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *pen); -void mgl_area_xy(HMGL graph, const HMDT x, const HMDT y, const char *pen); -void mgl_area_xys(HMGL graph, const HMDT x, const HMDT y, const char *pen); -void mgl_area_s(HMGL graph, const HMDT y, const char *pen); -void mgl_area(HMGL graph, const HMDT y, const char *pen); -void mgl_region_xy(HMGL graph, const HMDT x, const HMDT y1, const HMDT y2, const char *pen, int inside); -void mgl_region(HMGL graph, const HMDT y1, const HMDT y2, const char *pen, int inside); -void mgl_mark(HMGL graph, mreal x,mreal y,mreal z,char mark); -void mgl_stem_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *pen); -void mgl_stem_xy(HMGL graph, const HMDT x, const HMDT y, const char *pen); -void mgl_stem(HMGL graph, const HMDT y, const char *pen); -void mgl_step_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *pen); -void mgl_step_xy(HMGL graph, const HMDT x, const HMDT y, const char *pen); -void mgl_step(HMGL graph, const HMDT y, const char *pen); -void mgl_bars_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *pen); -void mgl_bars_xy(HMGL graph, const HMDT x, const HMDT y, const char *pen); -void mgl_bars(HMGL graph, const HMDT y, const char *pen); -void mgl_barh_yx(HMGL graph, const HMDT y, const HMDT v, const char *pen); -void mgl_barh(HMGL graph, const HMDT v, const char *pen); -/*****************************************************************************/ -/* Advanced 1D plotting functions */ -/*****************************************************************************/ -void mgl_torus(HMGL graph, const HMDT r, const HMDT z, const char *pen); -void mgl_text_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z,const char *text, const char *font, mreal size); -void mgl_text_xy(HMGL graph, const HMDT x, const HMDT y, const char *text, const char *font, mreal size); -void mgl_text_y(HMGL graph, const HMDT y, const char *text, const char *font, mreal size); -void mgl_chart(HMGL graph, const HMDT a, const char *col); -void mgl_error(HMGL graph, const HMDT y, const HMDT ey, const char *pen); -void mgl_error_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT ey, const char *pen); -void mgl_error_exy(HMGL graph, const HMDT x, const HMDT y, const HMDT ex, const HMDT ey, const char *pen); -void mgl_mark_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT r, const char *pen); -void mgl_mark_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT r, const char *pen); -void mgl_mark_y(HMGL graph, const HMDT y, const HMDT r, const char *pen); -void mgl_tube_xyzr(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT r, const char *pen); -void mgl_tube_xyr(HMGL graph, const HMDT x, const HMDT y, const HMDT r, const char *pen); -void mgl_tube_r(HMGL graph, const HMDT y, const HMDT r, const char *pen); -void mgl_tube_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, mreal r, const char *pen); -void mgl_tube_xy(HMGL graph, const HMDT x, const HMDT y, mreal r, const char *penl); -void mgl_tube(HMGL graph, const HMDT y, mreal r, const char *pen); - -void mgl_textmark_xyzr(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT r, const char *text, const char *fnt); -void mgl_textmark_xyr(HMGL graph, const HMDT x, const HMDT y, const HMDT r, const char *text, const char *fnt); -void mgl_textmark_yr(HMGL graph, const HMDT y, const HMDT r, const char *text, const char *fnt); -void mgl_textmark(HMGL graph, const HMDT y, const char *text, const char *fnt); -void mgl_textmarkw_xyzr(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT r, const wchar_t *text, const char *fnt); -void mgl_textmarkw_xyr(HMGL graph, const HMDT x, const HMDT y, const HMDT r, const wchar_t *text, const char *fnt); -void mgl_textmarkw_yr(HMGL graph, const HMDT y, const HMDT r, const wchar_t *text, const char *fnt); -void mgl_textmarkw(HMGL graph, const HMDT y, const wchar_t *text, const char *fnt); -/*****************************************************************************/ -/* 2D plotting functions */ -/*****************************************************************************/ -void mgl_fsurf(HMGL graph, const char *fz, const char *stl, int n); -void mgl_fsurf_xyz(HMGL graph, const char *fx, const char *fy, const char *fz, const char *stl, int n); -void mgl_grid_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *stl,mreal zVal); -void mgl_grid(HMGL graph, const HMDT a,const char *stl,mreal zVal); -void mgl_mesh_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch); -void mgl_mesh(HMGL graph, const HMDT z, const char *sch); -void mgl_fall_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch); -void mgl_fall(HMGL graph, const HMDT z, const char *sch); -void mgl_belt_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch); -void mgl_belt(HMGL graph, const HMDT z, const char *sch); -void mgl_surf_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch); -void mgl_surf(HMGL graph, const HMDT z, const char *sch); -void mgl_dens_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch,mreal zVal); -void mgl_dens(HMGL graph, const HMDT z, const char *sch,mreal zVal); -void mgl_boxs_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch,mreal zVal); -void mgl_boxs(HMGL graph, const HMDT z, const char *sch,mreal zVal); -void mgl_tile_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch); -void mgl_tile(HMGL graph, const HMDT z, const char *sch); -void mgl_tiles_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT r, const char *sch); -void mgl_tiles(HMGL graph, const HMDT z, const HMDT r, const char *sch); -void mgl_cont_xy_val(HMGL graph, const HMDT v, const HMDT x, const HMDT y, const HMDT z, const char *sch, mreal zVal); -void mgl_cont_val(HMGL graph, const HMDT v, const HMDT z, const char *sch,mreal zVal); -void mgl_cont_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch, int Num, mreal zVal); -void mgl_cont(HMGL graph, const HMDT z, const char *sch, int Num, mreal zVal); - -void mgl_contf_xy_val(HMGL graph, const HMDT v, const HMDT x, const HMDT y, const HMDT z, const char *sch, mreal zVal); -void mgl_contf_val(HMGL graph, const HMDT v, const HMDT z, const char *sch,mreal zVal); -void mgl_contf_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch, int Num, mreal zVal); -void mgl_contf(HMGL graph, const HMDT z, const char *sch, int Num, mreal zVal); - -void mgl_contd_xy_val(HMGL graph, const HMDT v, const HMDT x, const HMDT y, const HMDT z, const char *sch, mreal zVal); -void mgl_contd_val(HMGL graph, const HMDT v, const HMDT z, const char *sch,mreal zVal); -void mgl_contd_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch, int Num, mreal zVal); -void mgl_contd(HMGL graph, const HMDT z, const char *sch, int Num, mreal zVal); - -void mgl_axial_xy_val(HMGL graph, const HMDT v, const HMDT x, const HMDT y, const HMDT a, const char *sch); -void mgl_axial_val(HMGL graph, const HMDT v, const HMDT a, const char *sch); -void mgl_axial_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT a, const char *sch, int Num); -void mgl_axial(HMGL graph, const HMDT a, const char *sch, int Num); -/*****************************************************************************/ -/* Dual plotting functions */ -/*****************************************************************************/ -void mgl_surfc_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *sch); -void mgl_surfc(HMGL graph, const HMDT z, const HMDT c, const char *sch); -void mgl_surfa_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *sch); -void mgl_surfa(HMGL graph, const HMDT z, const HMDT c, const char *sch); -void mgl_stfa_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT re, const HMDT im, int dn, const char *sch, mreal zVal); -void mgl_stfa(HMGL graph, const HMDT re, const HMDT im, int dn, const char *sch, mreal zVal); -void mgl_traj_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch,mreal zVal,mreal len); -void mgl_traj_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch,mreal len); -void mgl_vect_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch,mreal zVal,int flag); -void mgl_vect_2d(HMGL graph, const HMDT ax, const HMDT ay, const char *sch,mreal zVal,int flag); -void mgl_vectl_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch,mreal zVal); -void mgl_vectl_2d(HMGL graph, const HMDT ax, const HMDT ay, const char *sch,mreal zVal); -void mgl_vectc_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch,mreal zVal); -void mgl_vectc_2d(HMGL graph, const HMDT ax, const HMDT ay, const char *sch,mreal zVal); -void mgl_vect_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch,int flag); -void mgl_vect_3d(HMGL graph, const HMDT ax, const HMDT ay, const HMDT az, const char *sch,int flag); -void mgl_vectl_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch); -void mgl_vectl_3d(HMGL graph, const HMDT ax, const HMDT ay, const HMDT az, const char *sch); -void mgl_vectc_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch); -void mgl_vectc_3d(HMGL graph, const HMDT ax, const HMDT ay, const HMDT az, const char *sch); -void mgl_map_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT a, const HMDT b, const char *sch, int ks, int pnts); -void mgl_map(HMGL graph, const HMDT a, const HMDT b, const char *sch, int ks, int pnts); -void mgl_surf3a_xyz_val(HMGL graph, mreal Val, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT b, const char *stl); -void mgl_surf3a_val(HMGL graph, mreal Val, const HMDT a, const HMDT b, const char *stl); -void mgl_surf3a_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT b, const char *stl, int num); -void mgl_surf3a(HMGL graph, const HMDT a, const HMDT b, const char *stl, int num); -void mgl_surf3c_xyz_val(HMGL graph, mreal Val, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT b, const char *stl); -void mgl_surf3c_val(HMGL graph, mreal Val, const HMDT a, const HMDT b, const char *stl); -void mgl_surf3c_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT b, - const char *stl, int num); -void mgl_surf3c(HMGL graph, const HMDT a, const HMDT b, const char *stl, int num); -void mgl_flow_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch, int num, int central, mreal zVal); -void mgl_flow_2d(HMGL graph, const HMDT ax, const HMDT ay, const char *sch, int num, int central, mreal zVal); -void mgl_flow_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch, int num, int central); -void mgl_flow_3d(HMGL graph, const HMDT ax, const HMDT ay, const HMDT az, const char *sch, int num, int central); - -void mgl_flowp_xy(HMGL graph, mreal x0, mreal y0, mreal z0, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch); -void mgl_flowp_2d(HMGL graph, mreal x0, mreal y0, mreal z0, const HMDT ax, const HMDT ay, const char *sch); -void mgl_flowp_xyz(HMGL graph, mreal x0, mreal y0, mreal z0, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch); -void mgl_flowp_3d(HMGL graph, mreal x0, mreal y0, mreal z0, const HMDT ax, const HMDT ay, const HMDT az, const char *sch); - -void mgl_pipe_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch, mreal r0, int num, int central, mreal zVal); -void mgl_pipe_2d(HMGL graph, const HMDT ax, const HMDT ay, const char *sch, mreal r0, int num, int central, mreal zVal); -void mgl_pipe_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch, mreal r0, int num, int central); -void mgl_pipe_3d(HMGL graph, const HMDT ax, const HMDT ay, const HMDT az, const char *sch, mreal r0, int num, int central); -void mgl_dew_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch,mreal zVal); -void mgl_dew_2d(HMGL gr, const HMDT ax, const HMDT ay, const char *sch,mreal zVal); - -void mgl_grad_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT ph, const char *sch, int num); -void mgl_grad_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT ph, const char *sch, int num, mreal zVal); -void mgl_grad(HMGL graph, const HMDT ph, const char *sch, int num, mreal zVal); -/*****************************************************************************/ -/* 3D plotting functions */ -/*****************************************************************************/ -void mgl_grid3_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *stl); -void mgl_grid3(HMGL graph, const HMDT a, char dir, int sVal, const char *stl); -void mgl_grid3_all_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *stl); -void mgl_grid3_all(HMGL graph, const HMDT a, const char *stl); -void mgl_dens3_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *stl); -void mgl_dens3(HMGL graph, const HMDT a, char dir, int sVal, const char *stl); -void mgl_dens3_all_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *stl); -void mgl_dens3_all(HMGL graph, const HMDT a, const char *stl); -void mgl_surf3_xyz_val(HMGL graph, mreal Val, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *stl); -void mgl_surf3_val(HMGL graph, mreal Val, const HMDT a, const char *stl); -void mgl_surf3_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *stl, int num); -void mgl_surf3(HMGL graph, const HMDT a, const char *stl, int num); -void mgl_cont3_xyz_val(HMGL graph, const HMDT v, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *sch); -void mgl_cont3_val(HMGL graph, const HMDT v, const HMDT a, char dir, int sVal, const char *sch); -void mgl_cont3_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *sch, int Num); -void mgl_cont3(HMGL graph, const HMDT a, char dir, int sVal, const char *sch, int Num); -void mgl_cont_all_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *sch, int Num); -void mgl_cont_all(HMGL graph, const HMDT a, const char *sch, int Num); -void mgl_cloudp_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *stl, mreal alpha); -void mgl_cloudp(HMGL graph, const HMDT a, const char *stl, mreal alpha); -void mgl_cloud_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *stl, mreal alpha); -void mgl_cloud(HMGL graph, const HMDT a, const char *stl, mreal alpha); -void mgl_contf3_xyz_val(HMGL graph, const HMDT v, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *sch); -void mgl_contf3_val(HMGL graph, const HMDT v, const HMDT a, char dir, int sVal, const char *sch); -void mgl_contf3_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *sch, int Num); -void mgl_contf3(HMGL graph, const HMDT a, char dir, int sVal, const char *sch, int Num); -void mgl_contf_all_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *sch, int Num); -void mgl_contf_all(HMGL graph, const HMDT a, const char *sch, int Num); -void mgl_beam_val(HMGL graph, mreal Val, const HMDT tr, const HMDT g1, const HMDT g2, const HMDT a, mreal r, const char *stl, int norm); -void mgl_beam(HMGL graph, const HMDT tr, const HMDT g1, const HMDT g2, const HMDT a, mreal r, const char *stl, int norm, int num); -/*****************************************************************************/ -/* Triangular plotting functions */ -/*****************************************************************************/ -void mgl_triplot_xyzc(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *sch); -void mgl_triplot_xyz(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const char *sch); -void mgl_triplot_xy(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const char *sch, mreal zVal); -void mgl_quadplot_xyzc(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *sch); -void mgl_quadplot_xyz(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const char *sch); -void mgl_quadplot_xy(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const char *sch, mreal zVal); -void mgl_tricont_xyzcv(HMGL gr, const HMDT v, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *sch, mreal zVal); -void mgl_tricont_xyzv(HMGL gr, const HMDT v, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const char *sch, mreal zVal); -void mgl_tricont_xyzc(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *sch, int n, mreal zVal); -void mgl_tricont_xyz(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const char *sch, int n, mreal zVal); -void mgl_dots(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const char *sch); -void mgl_dots_a(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *sch); -void mgl_dots_tr(HMGL gr, const HMDT tr, const char *sch); -void mgl_crust(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const char *sch, mreal er); -void mgl_crust_tr(HMGL gr, const HMDT tr, const char *sch, mreal er); -/*****************************************************************************/ -/* Combined plotting functions */ -/*****************************************************************************/ -void mgl_dens_x(HMGL graph, const HMDT a, const char *stl, mreal sVal); -void mgl_dens_y(HMGL graph, const HMDT a, const char *stl, mreal sVal); -void mgl_dens_z(HMGL graph, const HMDT a, const char *stl, mreal sVal); -void mgl_cont_x(HMGL graph, const HMDT a, const char *stl, mreal sVal, int Num); -void mgl_cont_y(HMGL graph, const HMDT a, const char *stl, mreal sVal, int Num); -void mgl_cont_z(HMGL graph, const HMDT a, const char *stl, mreal sVal, int Num); -void mgl_cont_x_val(HMGL graph, const HMDT v, const HMDT a, const char *stl, mreal sVal); -void mgl_cont_y_val(HMGL graph, const HMDT v, const HMDT a, const char *stl, mreal sVal); -void mgl_cont_z_val(HMGL graph, const HMDT v, const HMDT a, const char *stl, mreal sVal); -void mgl_contf_x(HMGL graph, const HMDT a, const char *stl, mreal sVal, int Num); -void mgl_contf_y(HMGL graph, const HMDT a, const char *stl, mreal sVal, int Num); -void mgl_contf_z(HMGL graph, const HMDT a, const char *stl, mreal sVal, int Num); -void mgl_contf_x_val(HMGL graph, const HMDT v, const HMDT a, const char *stl, mreal sVal); -void mgl_contf_y_val(HMGL graph, const HMDT v, const HMDT a, const char *stl, mreal sVal); -void mgl_contf_z_val(HMGL graph, const HMDT v, const HMDT a, const char *stl, mreal sVal); -/*****************************************************************************/ -/* Data creation functions */ -/*****************************************************************************/ -void mgl_data_rearrange(HMDT dat, int mx, int my, int mz); -void mgl_data_set_float(HMDT dat, const float *A,int NX,int NY,int NZ); -void mgl_data_set_double(HMDT dat, const double *A,int NX,int NY,int NZ); -void mgl_data_set_float2(HMDT d, const float **A,int N1,int N2); -void mgl_data_set_double2(HMDT d, const double **A,int N1,int N2); -void mgl_data_set_float3(HMDT d, const float ***A,int N1,int N2,int N3); -void mgl_data_set_double3(HMDT d, const double ***A,int N1,int N2,int N3); -void mgl_data_set(HMDT dat, const HMDT a); -void mgl_data_set_vector(HMDT dat, gsl_vector *v); -void mgl_data_set_matrix(HMDT dat, gsl_matrix *m); - -mreal mgl_data_get_value(const HMDT dat, int i, int j, int k); -int mgl_data_get_nx(const HMDT dat); -int mgl_data_get_ny(const HMDT dat); -int mgl_data_get_nz(const HMDT dat); -void mgl_data_set_value(HMDT dat, mreal v, int i, int j, int k); -void mgl_data_set_values(HMDT dat, const char *val, int nx, int ny, int nz); -int mgl_data_read(HMDT dat, const char *fname); -int mgl_data_read_mat(HMDT dat, const char *fname, int dim); -int mgl_data_read_dim(HMDT dat, const char *fname,int mx,int my,int mz); -void mgl_data_save(HMDT dat, const char *fname,int ns); -void mgl_data_export(HMDT dat, const char *fname, const char *scheme,mreal v1,mreal v2,int ns); -void mgl_data_import(HMDT dat, const char *fname, const char *scheme,mreal v1,mreal v2); -void mgl_data_create(HMDT dat, int nx,int ny,int nz); -void mgl_data_transpose(HMDT dat, const char *dim); -void mgl_data_norm(HMDT dat, mreal v1,mreal v2,int sym,int dim); -void mgl_data_norm_slice(HMDT dat, mreal v1,mreal v2,char dir,int keep_en,int sym); -HMDT mgl_data_subdata(const HMDT dat, int xx,int yy,int zz); -HMDT mgl_data_subdata_ext(const HMDT dat, const HMDT xx, const HMDT yy, const HMDT zz); -HMDT mgl_data_column(const HMDT dat, const char *eq); -void mgl_data_set_id(HMDT d, const char *id); -void mgl_data_fill(HMDT dat, mreal x1,mreal x2,char dir); -void mgl_data_fill_eq(HMGL gr, HMDT dat, const char *eq, const HMDT vdat, const HMDT wdat); -void mgl_data_put_val(HMDT dat, mreal val, int i, int j, int k); -void mgl_data_put_dat(HMDT dat, const HMDT val, int i, int j, int k); -void mgl_data_modify(HMDT dat, const char *eq,int dim); -void mgl_data_modify_vw(HMDT dat, const char *eq,const HMDT vdat,const HMDT wdat); -void mgl_data_squeeze(HMDT dat, int rx,int ry,int rz,int smooth); -mreal mgl_data_max(const HMDT dat); -mreal mgl_data_min(const HMDT dat); -mreal *mgl_data_value(HMDT dat, int i,int j,int k); -const mreal *mgl_data_data(const HMDT dat); - -mreal mgl_data_first(const HMDT dat, const char *cond, int *i, int *j, int *k); -mreal mgl_data_last(const HMDT dat, const char *cond, int *i, int *j, int *k); -int mgl_data_find(const HMDT dat, const char *cond, char dir, int i, int j, int k); -int mgl_data_find_any(const HMDT dat, const char *cond); -mreal mgl_data_max_int(const HMDT dat, int *i, int *j, int *k); -mreal mgl_data_max_real(const HMDT dat, mreal *x, mreal *y, mreal *z); -mreal mgl_data_min_int(const HMDT dat, int *i, int *j, int *k); -mreal mgl_data_min_real(const HMDT dat, mreal *x, mreal *y, mreal *z); -mreal mgl_data_momentum_mw(const HMDT dat, char dir, mreal *m, mreal *w); - -HMDT mgl_data_combine(const HMDT dat1, const HMDT dat2); -void mgl_data_extend(HMDT dat, int n1, int n2); -void mgl_data_insert(HMDT dat, char dir, int at, int num); -void mgl_data_delete(HMDT dat, char dir, int at, int num); -/*****************************************************************************/ -/* Data manipulation functions */ -/*****************************************************************************/ -void mgl_data_smooth(HMDT dat, int Type,mreal delta,const char *dirs); -HMDT mgl_data_sum(const HMDT dat, const char *dir); -HMDT mgl_data_max_dir(const HMDT dat, const char *dir); -HMDT mgl_data_min_dir(const HMDT dat, const char *dir); -void mgl_data_cumsum(HMDT dat, const char *dir); -void mgl_data_integral(HMDT dat, const char *dir); -void mgl_data_diff(HMDT dat, const char *dir); -void mgl_data_diff_par(HMDT dat, const HMDT v1, const HMDT v2, const HMDT v3); -void mgl_data_diff2(HMDT dat, const char *dir); -void mgl_data_swap(HMDT dat, const char *dir); -void mgl_data_roll(HMDT dat, char dir, int num); -void mgl_data_mirror(HMDT dat, const char *dir); - -void mgl_data_hankel(HMDT dat, const char *dir); -void mgl_data_sinfft(HMDT dat, const char *dir); -void mgl_data_cosfft(HMDT dat, const char *dir); -void mgl_data_fill_sample(HMDT dat, int num, const char *how); - -mreal mgl_data_spline(const HMDT dat, mreal x,mreal y,mreal z); -mreal mgl_data_spline1(const HMDT dat, mreal x,mreal y,mreal z); -mreal mgl_data_linear(const HMDT dat, mreal x,mreal y,mreal z); -mreal mgl_data_linear1(const HMDT dat, mreal x,mreal y,mreal z); -HMDT mgl_data_resize(const HMDT dat, int mx,int my,int mz); -HMDT mgl_data_resize_box(const HMDT dat, int mx,int my,int mz,mreal x1,mreal x2, - mreal y1,mreal y2,mreal z1,mreal z2); -HMDT mgl_data_hist(const HMDT dat, int n, mreal v1, mreal v2, int nsub); -HMDT mgl_data_hist_w(const HMDT dat, const HMDT weight, int n, mreal v1, mreal v2, int nsub); -HMDT mgl_data_momentum(const HMDT dat, char dir, const char *how); -HMDT mgl_data_evaluate_i(const HMDT dat, const HMDT idat, int norm); -HMDT mgl_data_evaluate_ij(const HMDT dat, const HMDT idat, const HMDT jdat, int norm); -HMDT mgl_data_evaluate_ijk(const HMDT dat, const HMDT idat, const HMDT jdat, const HMDT kdat, int norm); -void mgl_data_envelop(HMDT dat, char dir); -void mgl_data_sew(HMDT dat, const char *dirs, mreal da); -void mgl_data_crop(HMDT dat, int n1, int n2, char dir); -/*****************************************************************************/ -/* Data operations */ -/*****************************************************************************/ -void mgl_data_mul_dat(HMDT dat, const HMDT d); -void mgl_data_div_dat(HMDT dat, const HMDT d); -void mgl_data_add_dat(HMDT dat, const HMDT d); -void mgl_data_sub_dat(HMDT dat, const HMDT d); -void mgl_data_mul_num(HMDT dat, mreal d); -void mgl_data_div_num(HMDT dat, mreal d); -void mgl_data_add_num(HMDT dat, mreal d); -void mgl_data_sub_num(HMDT dat, mreal d); -/*****************************************************************************/ -/* Nonlinear fitting */ -/*****************************************************************************/ -void mgl_hist_x(HMGL gr, HMDT res, const HMDT x, const HMDT a); -void mgl_hist_xy(HMGL gr, HMDT res, const HMDT x, const HMDT y, const HMDT a); -void mgl_hist_xyz(HMGL gr, HMDT res, const HMDT x, const HMDT y, const HMDT z, const HMDT a); -/*****************************************************************************/ -/* Nonlinear fitting */ -/*****************************************************************************/ -mreal mgl_fit_1(HMGL gr, HMDT fit, const HMDT y, const char *eq, const char *var, mreal *ini); -mreal mgl_fit_2(HMGL gr, HMDT fit, const HMDT z, const char *eq, const char *var, mreal *ini); -mreal mgl_fit_3(HMGL gr, HMDT fit, const HMDT a, const char *eq, const char *var, mreal *ini); -mreal mgl_fit_xy(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const char *eq, const char *var, mreal *ini); -mreal mgl_fit_xyz(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const char *eq, const char *var, mreal *ini); -mreal mgl_fit_xyza(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *eq, const char *var, mreal *ini); -mreal mgl_fit_ys(HMGL gr, HMDT fit, const HMDT y, const HMDT s, const char *eq, const char *var, mreal *ini); -mreal mgl_fit_xys(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT s, const char *eq, const char *var, mreal *ini); -mreal mgl_fit_xyzs(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT s, const char *eq, const char *var, mreal *ini); -mreal mgl_fit_xyzas(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT s, const char *eq, const char *var, mreal *ini); - -mreal mgl_fit_1_d(HMGL gr, HMDT fit, const HMDT y, const char *eq, const char *var, HMDT ini); -mreal mgl_fit_2_d(HMGL gr, HMDT fit, const HMDT z, const char *eq, const char *var, HMDT ini); -mreal mgl_fit_3_d(HMGL gr, HMDT fit, const HMDT a, const char *eq, const char *var, HMDT ini); -mreal mgl_fit_xy_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const char *eq, const char *var, HMDT ini); -mreal mgl_fit_xyz_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const char *eq, const char *var, HMDT ini); -mreal mgl_fit_xyza_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *eq, const char *var, HMDT ini); -mreal mgl_fit_ys_d(HMGL gr, HMDT fit, const HMDT y, const HMDT s, const char *eq, const char *var, HMDT ini); -mreal mgl_fit_xys_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT s, const char *eq, const char *var, HMDT ini); -mreal mgl_fit_xyzs_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT s, const char *eq, const char *var, HMDT ini); -mreal mgl_fit_xyzas_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT s, const char *eq, const char *var, HMDT ini); - -void mgl_puts_fit(HMGL gr, mreal x, mreal y, mreal z, const char *prefix, const char *font, mreal size); -const char *mgl_get_fit(HMGL gr); -/*****************************************************************************/ -void mgl_sphere(HMGL graph, mreal x, mreal y, mreal z, mreal r, const char *stl); -void mgl_drop(HMGL graph, mreal x1, mreal y1, mreal z1, mreal x2, mreal y2, mreal z2, mreal r, const char *stl, mreal shift, mreal ap); -void mgl_cone(HMGL graph, mreal x1, mreal y1, mreal z1, mreal x2, mreal y2, mreal z2, mreal r1, mreal r2, const char *stl, int edge); - -HMDT mgl_pde_solve(HMGL gr, const char *ham, const HMDT ini_re, const HMDT ini_im, mreal dz, mreal k0); -HMDT mgl_qo2d_solve(const char *ham, const HMDT ini_re, const HMDT ini_im, const HMDT ray, mreal r, mreal k0, HMDT xx, HMDT yy); -HMDT mgl_af2d_solve(const char *ham, const HMDT ini_re, const HMDT ini_im, const HMDT ray, mreal r, mreal k0, HMDT xx, HMDT yy); -HMDT mgl_ray_trace(const char *ham, mreal x0, mreal y0, mreal z0, mreal px, mreal py, mreal pz, mreal dt, mreal tmax); -HMDT mgl_jacobian_2d(const HMDT x, const HMDT y); -HMDT mgl_jacobian_3d(const HMDT x, const HMDT y, const HMDT z); -HMDT mgl_transform_a(const HMDT am, const HMDT ph, const char *tr); -HMDT mgl_transform(const HMDT re, const HMDT im, const char *tr); -HMDT mgl_data_stfa(const HMDT re, const HMDT im, int dn, char dir); - -#ifdef __cplusplus -} -#endif - -#endif /* _mgl_c_h_ */ diff --git a/include/mgl/mgl_cf.h b/include/mgl/mgl_cf.h new file mode 100644 index 0000000..21f4e9e --- /dev/null +++ b/include/mgl/mgl_cf.h @@ -0,0 +1,36 @@ +/*************************************************************************** + * mgl_cf.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef _MGL_CF_H_ +#define _MGL_CF_H_ +/*****************************************************************************/ +#include "mgl/base_cf.h" +#include "mgl/data.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/opengl.h" +/*****************************************************************************/ +#endif diff --git a/include/mgl/mgl_data.h b/include/mgl/mgl_data.h deleted file mode 100644 index 2dd3ecb..0000000 --- a/include/mgl/mgl_data.h +++ /dev/null @@ -1,379 +0,0 @@ -/*************************************************************************** - * mgl_data.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" -#else -#ifndef _MGL_DATA_H_ -#define _MGL_DATA_H_ -//----------------------------------------------------------------------------- -#include -#include -#include -#include -//----------------------------------------------------------------------------- -#ifndef NO_GSL -#include -#include -#else -struct gsl_vector; -struct gsl_matrix; -#endif -#include "mgl/mgl_define.h" -//----------------------------------------------------------------------------- -/// Class for incapsulating point in space -struct mglPoint -{ - mreal x,y,z; - mglPoint(mreal X=0,mreal Y=0,mreal Z=0){x=X;y=Y;z=Z;}; -}; -inline mglPoint operator+(const mglPoint &a, const mglPoint &b) -{ return mglPoint(a.x+b.x, a.y+b.y, a.z+b.z); }; -inline mglPoint operator-(const mglPoint &a, const mglPoint &b) -{ return mglPoint(a.x-b.x, a.y-b.y, a.z-b.z); }; -inline mglPoint operator*(mreal b, const mglPoint &a) -{ return mglPoint(a.x*b, a.y*b, a.z*b); }; -inline mglPoint operator*(const mglPoint &a, mreal b) -{ return mglPoint(a.x*b, a.y*b, a.z*b); }; -inline mglPoint operator/(const mglPoint &a, mreal b) -{ return mglPoint(a.x/b, a.y/b, a.z/b); }; -inline mreal operator*(const mglPoint &a, const mglPoint &b) -{ return a.x*b.x+a.y*b.y+a.z*b.z; }; -inline mglPoint operator&(const mglPoint &a, const mglPoint &b) -{ return a - b*((a*b)/(b*b)); }; -inline mglPoint operator|(const mglPoint &a, const mglPoint &b) -{ return b*((a*b)/(b*b)); }; -inline mglPoint operator^(const mglPoint &a, const mglPoint &b) -{ return mglPoint(a.y*b.z-a.z*b.y, a.z*b.x-a.x*b.z, a.x*b.y-a.y*b.x); }; -inline mglPoint operator!(const mglPoint &a) -{ return (a.x==0 && a.y==0)?mglPoint(1,0,0):mglPoint(-a.y/hypot(a.x,a.y), a.x/hypot(a.x,a.y), 0); }; -inline bool operator==(const mglPoint &a, const mglPoint &b) -{ return !memcmp(&a, &b, sizeof(mglPoint)); } -inline bool operator!=(const mglPoint &a, const mglPoint &b) -{ return memcmp(&a, &b, sizeof(mglPoint)); } -inline mreal Norm(const mglPoint &p) -{ return sqrt(p.x*p.x+p.y*p.y+p.z*p.z); }; -//----------------------------------------------------------------------------- -/// Class for working with data array -class mglData -{ -protected: - /// Read data array from HDF4 file - void ReadHDF4(const char *fname,const char *data); -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) - mreal *a; ///< data array - char *id; ///< column (or slice) names - - /// Initiate by other mglData variable - mglData(const mglData &d) { a=0; Set(d); }; - /// Initiate by flat array - mglData(int size, const float *d) { a=0; Set(d,size); }; - mglData(int rows, int cols, const float *d) { a=0; Set(d,cols,rows); }; - mglData(int size, const double *d) { a=0; Set(d,size); }; - mglData(int rows, int cols, const double *d) { a=0; Set(d,cols,rows); }; - mglData(const double *d, int size) { a=0; Set(d,size); }; - mglData(const double *d, int rows, int cols) { a=0; Set(d,cols,rows); }; - /// Read data from file - mglData(const char *fname) { a=0; Read(fname); } - /// Allocate the memory for data array and initialize it zero - mglData(int xx=1,int yy=1,int zz=1) { a=0; Create(xx,yy,zz); }; - /// Delete the array - virtual ~mglData() { if(a) { delete []a; delete []id; } }; - // ~~~~~~~~~~~~~~~~~~~~ îïåðàöèè ~~~~~~~~~~~~~~~~~~~~ - // Get sizes - inline long GetNx() { return nx; }; - inline long GetNy() { return ny; }; - inline long GetNz() { return nz; }; - - /// Allocate memory and copy the data from the gsl_vector - void Set(gsl_vector *v); - /// Allocate memory and copy the data from the gsl_matrix - void Set(gsl_matrix *m); - /// Allocate memory and copy the data from the (float *) array - void Set(const float *A,int NX,int NY=1,int NZ=1); - /// Allocate memory and copy the data from the (double *) array - void Set(const double *A,int NX,int NY=1,int NZ=1); - /// Allocate memory and copy the data from the (float **) array - void Set(const float **A,int N1,int N2); - /// Allocate memory and copy the data from the (double **) array - void Set(const double **A,int N1,int N2); - /// Allocate memory and copy the data from the (float ***) array - void Set(const float ***A,int N1,int N2,int N3); - /// Allocate memory and copy the data from the (double ***) array - void Set(const double ***A,int N1,int N2,int N3); - /// Allocate memory and scanf the data from the string - void Set(const char *str,int NX,int NY=1,int NZ=1); - /// Allocate memory and copy data from std::vector - void Set(const std::vector &d); - void Set(const std::vector &d); - void Set(const std::vector &d); - /// Copy the data from other mglData variable - inline void Set(const mglData &dat) { Set(dat.a,dat.nx,dat.ny,dat.nz); }; - /// Rearange data dimensions - void Rearrange(int mx, int my=0, int mz=0); - - /// Read data array from HDF file (parse HDF4 and HDF5 files) - void ReadHDF(const char *fname,const char *data); - /// Save data to HDF file - void SaveHDF(const char *fname,const char *data,bool rewrite=false) const; - /// Put HDF data names into buf as '\t' separated. - int DatasHDF(const char *fname, char *buf, long size); - /// Read data from tab-separated text file with auto determining size - bool Read(const char *fname); - /// Read data from text file with specifeid size - bool Read(const char *fname,int mx,int my=1,int mz=1); - /// Save whole data array (for ns=-1) or only ns-th slice to text file - void Save(const char *fname,int ns=-1) const; - /// Export data array (for ns=-1) or only ns-th slice to PNG file according color scheme - void Export(const char *fname,const char *scheme,mreal v1=0,mreal v2=0,int ns=-1) const; - /// Import data array from PNG file according color scheme - void Import(const char *fname,const char *scheme,mreal v1=0,mreal v2=1); - /// Read data from tab-separated text files with auto determining size which filenames are result of sprintf(fname,templ,t) where t=from:step:to - bool ReadRange(const char *templ, mreal from, mreal to, mreal step=1.f, bool as_slice=false); - /// Read data from tab-separated text files with auto determining size which filenames are satisfied to template (like "t_*.dat") - bool ReadAll(const char *templ, bool as_slice=false); - /// Read data from text file with size specified at beginning of the file - bool ReadMat(const char *fname, int dim=2); - - /// Create or recreate the array with specified size and fill it by zero - void Create(int nx,int ny=1,int nz=1); - /// Extend data dimensions - void Extend(int n1, int n2=0); - /// Transpose dimensions of the data (generalization of Transpose) - void Transpose(const char *dim="yx"); - /// Normalize the data to range [v1,v2] - void Norm(mreal v1=0,mreal v2=1,bool sym=false,int dim=0); - /// Normalize the data to range [v1,v2] slice by slice - void NormSl(mreal v1=0,mreal v2=1,char dir='z',bool keep_en=true,bool sym=false); - /// Put value to data element(s) - void Put(mreal val, int i=-1, int j=-1, int k=-1); - /// Put array to data element(s) - void Put(const mglData &val, int i=-1, int j=-1, int k=-1); - /// Modify the data by specified formula - void Modify(const char *eq,int dim=0); - /// Modify the data by specified formula - void Modify(const char *eq,const mglData &v, const mglData &w); - /// Modify the data by specified formula - void Modify(const char *eq,const mglData &v); - /// Modify the data by specified formula assuming x,y,z in range [r1,r2] - void Fill(const char *eq, mglPoint r1, mglPoint r2, const mglData *v=0, const mglData *w=0); - /// Eqidistantly fill the data to range [x1,x2] in direction \a dir - void Fill(mreal x1,mreal x2,char dir='x'); - /// Fill data by 'x'/'k' samples for Hankel ('h') or Fourier ('f') transform - void FillSample(int n, const char *how); - /// Get column (or slice) of the data filled by formulas of other named columns - mglData Column(const char *eq); - /// Set names for columns (slices) - void SetColumnId(const char *ids); - /// Make new id - void NewId(); - /// Reduce size of the data - void Squeeze(int rx,int ry=1,int rz=1,bool smooth=false); - /// Crop the data - void Crop(int n1, int n2,char dir='x'); - - /// Get maximal value of the data - mreal Maximal() const; - /// Get minimal value of the data - mreal Minimal() const; - /// Get maximal value of the data and its position - mreal Maximal(int &i,int &j,int &k) const; - /// Get minimal value of the data and its position - mreal Minimal(int &i,int &j,int &k) const; - /// Get maximal value of the data and its approximated position - mreal Maximal(mreal &x,mreal &y,mreal &z) const; - /// Get minimal value of the data and its approximated position - mreal Minimal(mreal &x,mreal &y,mreal &z) const; - /// Get "energy" and find first (median) and second (width) momentums of data - mreal Momentum(char dir,mreal &m,mreal &w) const; - /// Get "energy and find 4 momentums of data: median, width, skewness, kurtosis - mreal Momentum(char dir,mreal &m,mreal &w,mreal &s,mreal &k) const; - /// Get momentum (1D-array) of data along direction 'dir'. String looks like "x1" for median in x-direction, "x2" for width in x-dir and so on. - mglData Momentum(char dir, const char *how) const; - /// Print information about the data (sizes and momentum) to string - void PrintInfo(char *buf, bool all=false) const; - /// Print information about the data (sizes and momentum) to FILE (for example, stdout) - void PrintInfo(FILE *fp) const; - /// Find position (after specified in i,j,k) of first nonzero value of formula - mreal Find(const char *cond, int &i, int &j, int &k) const; - /// Find position (before specified in i,j,k) of last nonzero value of formula - mreal Last(const char *cond, int &i, int &j, int &k) const; - /// Find position of first in direction 'dir' nonzero value of formula - int Find(const char *cond, char dir, int i=0, int j=0, int k=0) const; - /// Find if any nonzero value of formula - bool FindAny(const char *cond) const; - - /// Smooth the data on specified direction or directions - void Smooth(int Type,const char *dirs="xyz",mreal delta=0); - /// Set as the data envelop - void Envelop(char dir='x'); - /// Remove phase jump - void Sew(const char *dirs="xyz", mreal da=2*M_PI); - /// Smooth the data on specified direction or directions - void Smooth(const char *dirs="xyz"); - /// Get sub-array of the data with given fixed indexes - mglData SubData(int xx,int yy=-1,int zz=-1) const; - mglData SubData(const mglData &xx, const mglData &yy, const mglData &zz) const; - /// Get trace of the data array - mglData Trace() const; - /// Create n-th points distribution of this data values in range [v1, v2] - mglData Hist(int n,mreal v1=0,mreal v2=1, int nsub=0) const; - /// Create n-th points distribution of this data values in range [v1, v2] with weight \a w - mglData Hist(const mglData &w, int n,mreal v1=0,mreal v2=1, int nsub=0) const; - /// Get array which is result of summation in given direction or directions - mglData Sum(const char *dir) const; - /// Get array which is result of maximal values in given direction or directions - mglData Max(const char *dir) const; - /// Get array which is result of minimal values in given direction or directions - mglData Min(const char *dir) const; - /// Resize the data to new size of box [x1,x2]*[y1,y2]*[z1,z2] - mglData Resize(int mx,int my=1,int mz=1,mreal x1=0,mreal x2=1, - mreal y1=0,mreal y2=1,mreal z1=0,mreal z2=1) const; - /// Get the data which is direct multiplication (like, d[i,j] = this[i]*a[j] and so on) - mglData Combine(const mglData &a) const; - /// Get array which values is result of interpolation this for coordinates from other arrays - mglData Evaluate(const mglData &idat, bool norm=true) const; - mglData Evaluate(const mglData &idat, const mglData &jdat, bool norm=true) const; - mglData Evaluate(const mglData &idat, const mglData &jdat, const mglData &kdat, bool norm=true) const; - - /// Cumulative summation the data in given direction or directions - void CumSum(const char *dir); - /// Integrate (cumulative summation) the data in given direction or directions - void Integral(const char *dir); - /// Differentiate the data in given direction or directions - void Diff(const char *dir); - /// Differentiate the parametrically specified data along direction v1 with v2=const - void Diff(const mglData &v1, const mglData &v2); - /// Differentiate the parametrically specified data along direction v1 with v2,v3=const - void Diff(const mglData &v1, const mglData &v2, const mglData &v3); - /// Double-differentiate (like laplace operator) the data in given direction - void Diff2(const char *dir); - /// Swap left and right part of the data in given direction (useful for fourier spectrums) - void Swap(const char *dir); - /// Roll data along direction \a dir by \a num slices - void Roll(char dir, int num); - /// Mirror the data in given direction (useful for fourier spectrums) - void Mirror(const char *dir); - - /// Hankel transform - void Hankel(const char *dir); - /// Sin-Fourier transform - void SinFFT(const char *dir); - /// Cos-Fourier transform - void CosFFT(const char *dir); - - /// Interpolate by 5-th order splain the data to given point \a x,\a y,\a z which normalized in range [0, 1] and evaluate its derivatives - mreal Spline5(mreal x,mreal y,mreal z,mreal &dx,mreal &dy,mreal &dz) const; - /// Interpolate by qubic splain the data to given point x=[0...nx-1], y=[0...ny-1], z=[0...nz-1] - mreal Spline(mreal x,mreal y=0,mreal z=0) const; - mreal Spline3(mreal x,mreal y,mreal z,mreal &dx,mreal &dy,mreal &dz) const; - /// Interpolate by qubic splain the data to given point \a x,\a y,\a z which normalized in range [0, 1] - inline mreal Spline1(mreal x,mreal y=0,mreal z=0) const - { return Spline(x*(nx-1),y*(ny-1),z*(nz-1)); }; - /// Interpolate by linear function the data to given point x=[0...nx-1], y=[0...ny-1], z=[0...nz-1] - mreal Linear(mreal x,mreal y=0,mreal z=0) const; - /// Interpolate by line the data to given point \a x,\a y,\a z which normalized in range [0, 1] - inline mreal Linear1(mreal x,mreal y=0,mreal z=0) const - { return Linear(x*(nx-1),y*(ny-1),z*(nz-1)); }; - - /// Insert \a num rows after \a at and fill it by formula \a eq - void InsertRows(int at, int num=1, const char *eq=0); - /// Insert \a num columns after \a at and fill it by formula \a eq - void InsertColumns(int at, int num=1, const char *eq=0); - /// Insert \a num slices after \a at and fill it by formula \a eq - void InsertSlices(int at, int num=1, const char *eq=0); - /// Delete \a num rows starting from \a at - void DeleteRows(int at, int num=1); - /// Delete \a num rows starting from \a at - void DeleteColumns(int at, int num=1); - /// Delete \a num rows starting from \a at - void DeleteSlices(int at, int num=1); - /// Insert data - void Insert(char dir, int at=0, int num=1); - /// Delete data - void Delete(char dir, int at=0, int num=1); - - /// Get the value in given cell of the data with border checking - mreal v(int i,int j=0,int k=0) const; - /// Copy data from other mglData variable - void operator=(const mglData &d) { Set(d.a,d.nx,d.ny,d.nz); }; - void operator=(mreal v); - /// Multiplicate the data by other one for each element - void operator*=(const mglData &d); - /// Divide the data by other one for each element - void operator/=(const mglData &d); - /// Add the other data - void operator+=(const mglData &d); - /// Substract the other data - void operator-=(const mglData &d); - /// Multiplicate each element by the number - void operator*=(mreal d); - /// Divide each element by the number - void operator/=(mreal d); - /// Add the number - void operator+=(mreal d); - /// Substract the number - void operator-=(mreal d); -}; -//----------------------------------------------------------------------------- -mglData operator*(const mglData &b, const mglData &d); -mglData operator*(mreal b, const mglData &d); -mglData operator*(const mglData &d, mreal b); -mglData operator-(const mglData &b, const mglData &d); -mglData operator-(mreal b, const mglData &d); -mglData operator-(const mglData &d, mreal b); -mglData operator+(const mglData &b, const mglData &d); -mglData operator+(mreal b, const mglData &d); -mglData operator+(const mglData &d, mreal b); -mglData operator/(const mglData &b, const mglData &d); -mglData operator/(const mglData &d, mreal b); -//----------------------------------------------------------------------------- -void mgl_srnd(long seed); -double mgl_rnd(); -double mgl_ipow(double x,int n); -/// Integral data transformation (like Fourier 'f' or 'i', Hankel 'h' or None 'n') for amplitude and phase -mglData mglTransformA(const mglData &am, const mglData &ph, const char *tr); -/// Integral data transformation (like Fourier 'f' or 'i', Hankel 'h' or None 'n') for mreal and imaginary parts -mglData mglTransform(const mglData &re, const mglData &im, const char *tr); -/// Apply Fourier transform for the data and save result into it -void mglFourier(mglData &re, mglData &im, const char *dir); -/// Short time fourier analysis for mreal and imaginary parts. Output is amplitude of partial fourier (result will have size {dn, floor(nx/dn), ny} for dir='x' -mglData mglSTFA(const mglData &re, const mglData &im, int dn, char dir='x'); -/// Saves result of PDE solving (|u|^2) for "Hamiltonian" \a ham with initial conditions \a ini -mglData mglPDE(const char *ham, const mglData &ini_re, const mglData &ini_im, mglPoint Min, mglPoint Max, mreal dz=0.1, mreal k0=100); -/// Saves result of PDE solving for "Hamiltonian" \a ham with initial conditions \a ini along a curve \a ray (must have nx>=7 - x,y,z,px,py,pz,tau or nx=5 - x,y,px,py,tau) -mglData mglQO2d(const char *ham, const mglData &ini_re, const mglData &ini_im, const mglData &ray, mreal r=1, mreal k0=100, mglData *xx=0, mglData *yy=0, bool UseR=true); -/// Saves result of PDE solving in aberration-free approxiamtion for "Hamiltonian" \a ham with initial conditions \a ini along a curve \a ray (must have nx>=7 - x,y,z,px,py,pz,tau or nx=5 - x,y,px,py,tau) -mglData mglAF2d(const char *ham, const mglData &ini_re, const mglData &ini_im, const mglData &ray, mreal r=1, mreal k0=100, mglData *xx=0, mglData *yy=0, bool UseR=true); -/// Prepares ray data for mglQO_PDE with starting point \a r0, \a p0 -mglData mglRay(const char *ham, mglPoint r0, mglPoint p0, mreal dt=0.1, mreal tmax=10); -/// Calculate Jacobian determinant for D{x(u,v), y(u,v)} = dx/du*dy/dv-dx/dv*dy/du -mglData mglJacobian(const mglData &x, const mglData &y); -/// Calculate Jacobian determinant for D{x(u,v,w), y(u,v,w), z(u,v,w)} -mglData mglJacobian(const mglData &x, const mglData &y, const mglData &z); -// Do something like Delone triangulation -mglData mglTriangulation(const mglData &x, const mglData &y, const mglData &z, mreal er); -mglData mglTriangulation(const mglData &x, const mglData &y, mreal er); -//----------------------------------------------------------------------------- -#endif -#endif diff --git a/include/mgl/mgl_eps.h b/include/mgl/mgl_eps.h deleted file mode 100644 index 4bab8e4..0000000 --- a/include/mgl/mgl_eps.h +++ /dev/null @@ -1,98 +0,0 @@ -/*************************************************************************** - * mgl_eps.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -//----------------------------------------------------------------------------- -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" -#else -#ifndef _MGL_PS_H_ -#define _MGL_PS_H_ -#include "mgl/mgl_ab.h" -//----------------------------------------------------------------------------- -struct mglGraphPS; -struct mglPrim -{ - mreal x[4], y[4], zz[4]; ///< coordinates of corners - mreal z; ///< z-position - mreal s; ///< size (if applicable) or fscl - mreal w; ///< width (if applicable) or ftet - mreal c[4]; ///< color (RGBA) - wchar_t m; ///< mark or symbol id (if applicable) - int type; ///< type of primitive (0 - point, 1 - line, 2 - trig, 3 - quad, 4 - glyph) - int style; ///< style of pen -// unsigned short dash;///< mreal pen dashing - int id; ///< object id - int sid; ///< subplot id - - void Draw(mglGraphPS *gr); - void DrawGL(); - bool IsSame(mreal wp,mreal *cp,int st); - mglPrim(int t=0) { memset(this,0,sizeof(mglPrim)); type = t; c[3]=1; }; -// ~mglPrim() { if(raw) delete []raw; }; - inline void operator=(mglPrim &a) { memcpy(this,&a,sizeof(mglPrim)); }; -}; -//----------------------------------------------------------------------------- -/// Class implement the creation of different mathematical plots for exporting in PostScript format -class mglGraphPS : public mglGraphAB -{ -friend struct mglPrim; -public: - mglGraphPS(int w=600, int h=400); - virtual ~mglGraphPS(); - void WriteEPS(const char *fname,const char *descr=0); - void WriteSVG(const char *fname,const char *descr=0); - virtual void Finish(); - void Clf(mglColor Back=WC); - void Ball(mreal x,mreal y,mreal z,mglColor col=RC,mreal alpha=1); - void Glyph(mreal x, mreal y, mreal f, int s, long j, char col); - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -protected: - mglPrim *P; ///< Primitives (lines, triangles and so on) - long pNum; ///< Actual number of primitives - long pMax; ///< Maximal number of primitives - - void ball(mreal *p,mreal *c); - void line_plot(mreal *p1,mreal *p2,mreal *c1,mreal *c2,bool all=false); - void trig_plot(mreal *p0,mreal *p1,mreal *p2, - mreal *c0,mreal *c1,mreal *c2); - void trig_plot_n(mreal *p0,mreal *p1,mreal *p2, - mreal *c0,mreal *c1,mreal *c2, - mreal *n0,mreal *n1,mreal *n2); - void quad_plot(mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal *c0,mreal *c1,mreal *c2,mreal *c3); - void quad_plot_a(mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal a0,mreal a1,mreal a2,mreal a3,mreal alpha); - void quad_plot_n(mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal *c0,mreal *c1,mreal *c2,mreal *c3, - mreal *n0,mreal *n1,mreal *n2,mreal *n3); - void mark_plot(mreal *pp, char type); - /// add primitive to list - void add_prim(mglPrim &a); - /// add lightning to color - void add_light(mreal *c, mreal n1,mreal n2, mreal n3); - void pnt_plot(long x,long y,mreal z,unsigned char c[4]); -private: - void put_line(void *fp, bool gz, long i, mreal wp,mreal *cp,int st, const char *ifmt, const char *nfmt, bool neg); - void put_desc(void *fp, bool gz, const char *pre, const char *ln1, const char *ln2, const char *ln3, const char *suf); - void draw_prim(mglPrim *pr, mreal *pp, mreal *c); -}; -//----------------------------------------------------------------------------- -#endif -#endif -//----------------------------------------------------------------------------- diff --git a/include/mgl/mgl_evalc.h b/include/mgl/mgl_evalc.h deleted file mode 100644 index 40f4f3e..0000000 --- a/include/mgl/mgl_evalc.h +++ /dev/null @@ -1,57 +0,0 @@ -/*************************************************************************** - * mgl_evalc.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -//--------------------------------------------------------------------------- -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" -#else -#ifndef _MGL_EVALC_H_ -#define _MGL_EVALC_H_ -//--------------------------------------------------------------------------- -#include -/// short name of complex numbers -#define dual std::complex -#include -//--------------------------------------------------------------------------- -/// Class for evaluating formula specified by the string -class mglFormulaC // îáúåêò äëÿ ââîäà è âû÷èñëåíèÿ ôîðìóë -{ -public: - /// Evaluates the formula for 'x','r'=\a x, 'y','n'=\a y, 'z','t'=\a z, 'u'=\a u - dual Calc(dual x,dual y=0,dual z=0,dual u=0) const; - /// Evaluates the formula for 'x, y, z, u, v, w' - dual Calc(dual x,dual y,dual z,dual u,dual v,dual w) const; - /// Evaluates the formula for variables \a var - dual Calc(const dual var[MGL_VS]) const; - /// Return error code - int GetError() const; - /// Parse the formula \a str and create formula-tree - mglFormulaC(const char *str); - /// Clean up formula-tree - virtual ~mglFormulaC(); -protected: - dual CalcIn(const dual *a1) const; - mglFormulaC *Left,*Right; // first and second argument of the function - int Kod; // the function ID - dual Res; // the number or the variable ID - static int Error; -}; -//--------------------------------------------------------------------------- -#endif -#endif diff --git a/include/mgl/mgl_f.h b/include/mgl/mgl_f.h deleted file mode 100644 index 94c85c4..0000000 --- a/include/mgl/mgl_f.h +++ /dev/null @@ -1,630 +0,0 @@ -/*************************************************************************** - * mgl_f.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef _MGL_F_H_ -#define _MGL_F_H_ - -#include - -#include - -#if(MGL_USE_DOUBLE==1) -typedef double mreal; -#else -typedef float mreal; -#endif - -#ifdef __cplusplus -extern "C" { -#endif -#define _GR_ ((mglGraph *)(*gr)) -#define _PR_ ((mglParse *)(*p)) -#define _DT_ ((mglData *)*d) -#define _D_(d) *((const mglData *)*(d)) -#define _DM_(d) *((mglData *)*(d)) -/*****************************************************************************/ -uintptr_t mgl_create_graph_gl_(); -uintptr_t mgl_create_graph_idtf_(); -/*uintptr_t mgl_create_graph_glut_(int argc, char **argv, int _(*draw)_(mglGraph *gr, const void *p), const char *title, void _(*reload)_(int *next), const void *par); -uintptr_t mgl_create_graph_fltk_(int argc, char **argv, int _(*draw)_(mglGraph *gr, const void *p), const char *title, void _(*reload)_(int *next), const void *par);*/ -uintptr_t mgl_create_graph_zb_(int *width, int *height); -uintptr_t mgl_create_graph_ps_(int *width, int *height); -void mgl_delete_graph_(uintptr_t *graph); - -uintptr_t mgl_create_graph_fltk_(const char *title, int); -uintptr_t mgl_create_graph_qt_(const char *title, int); -void mgl_fltk_run_(); -void mgl_qt_run_(); -void mgl_set_show_mouse_pos_(uintptr_t *gr, int *enable); -void mgl_get_last_mouse_pos_(uintptr_t *gr, mreal *x, mreal *y, mreal *z); -void mgl_calc_xyz_(uintptr_t *gr, int *xs, int *ys, mreal *x, mreal *y, mreal *z); -void mgl_calc_scr_(uintptr_t *gr, mreal *x, mreal *y, mreal *z, int *xs, int *ys); -//void mgl_fltk_thread_(); -//void mgl_qt_thread_(); - -void mgl_wnd_set_delay_(uintptr_t *gr, mreal *dt); -void mgl_wnd_set_auto_clf_(uintptr_t *gr, int *val); -void mgl_wnd_set_show_mouse_pos_(uintptr_t *gr, int *val); -void mgl_wnd_set_clf_update_(uintptr_t *gr, int *val); -void mgl_wnd_toggle_alpha_(uintptr_t *gr); -void mgl_wnd_toggle_light_(uintptr_t *gr); -void mgl_wnd_toggle_zoom_(uintptr_t *gr); -void mgl_wnd_toggle_rotate_(uintptr_t *gr); -void mgl_wnd_toggle_no_(uintptr_t *gr); -void mgl_wnd_update_(uintptr_t *gr); -void mgl_wnd_reload_(uintptr_t *gr, int *o); -void mgl_wnd_adjust_(uintptr_t *gr); -void mgl_wnd_next_frame_(uintptr_t *gr); -void mgl_wnd_prev_frame_(uintptr_t *gr); -void mgl_wnd_animation_(uintptr_t *gr); -/*****************************************************************************/ -uintptr_t mgl_create_data_(); -uintptr_t mgl_create_data_size_(int *nx, int *ny, int *nz); -uintptr_t mgl_create_data_file_(const char *fname, int len); -void mgl_delete_data_(uintptr_t *dat); -/*****************************************************************************/ -/* Setup mglGraph */ -/*****************************************************************************/ -void mgl_set_def_param_(uintptr_t *gr); -void mgl_set_palette_(uintptr_t *gr, const char *colors, int); -void mgl_set_pal_color_(uintptr_t *graph, int *n, mreal *r, mreal *g, mreal *b); -void mgl_set_pal_num_(uintptr_t *graph, int *num); -void mgl_set_rotated_text_(uintptr_t *graph, int *rotated); -void mgl_set_cut_(uintptr_t *graph, int *cut); -void mgl_set_cut_box_(uintptr_t *gr, mreal *x1,mreal *y1,mreal *z1,mreal *x2,mreal *y2,mreal *z2); -void mgl_set_tick_len_(uintptr_t *graph, mreal *len, mreal *stt); -void mgl_set_tick_stl_(uintptr_t *graph, const char *stl, const char *sub, int,int); -void mgl_set_bar_width_(uintptr_t *graph, mreal *width); -void mgl_set_base_line_width_(uintptr_t *gr, mreal *size); -void mgl_set_mark_size_(uintptr_t *graph, mreal *size); -void mgl_set_arrow_size_(uintptr_t *graph, mreal *size); -void mgl_set_font_size_(uintptr_t *graph, mreal *size); -void mgl_set_font_def_(uintptr_t *graph, const char *fnt, int); -void mgl_set_alpha_default_(uintptr_t *graph, mreal *alpha); -void mgl_set_size_(uintptr_t *graph, int *width, int *height); -void mgl_set_axial_dir_(uintptr_t *graph, const char *dir,int); -void mgl_set_meshnum_(uintptr_t *graph, int *num); -void mgl_set_zoom_(uintptr_t *gr, mreal *x1, mreal *y1, mreal *x2, mreal *y2); -void mgl_set_plotfactor_(uintptr_t *gr, mreal *val); -void mgl_set_draw_face_(uintptr_t *gr, int *enable); -void mgl_set_scheme_(uintptr_t *gr, char *sch, int); -void mgl_load_font_(uintptr_t *gr, char *name, char *path, int l, int n); -void mgl_copy_font_(uintptr_t *gr, uintptr_t *gr_from); -void mgl_restore_font_(uintptr_t *gr); -int mgl_get_warn_(uintptr_t *gr); -/*****************************************************************************/ -/* Export to file or to memory */ -/*****************************************************************************/ -void mgl_show_image_(uintptr_t *graph, const char *viewer, int *keep, int); -void mgl_write_frame_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); -void mgl_write_bmp_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); -void mgl_write_jpg_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); -void mgl_write_png_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); -void mgl_write_png_solid_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); -void mgl_write_eps_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); -void mgl_write_svg_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); -void mgl_write_idtf_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); -void mgl_write_gif_(uintptr_t *graph, const char *fname,const char *descr,int lf,int ld); -void mgl_start_gif_(uintptr_t *graph, const char *fname,int *ms,int l); -void mgl_close_gif_(uintptr_t *graph); -const unsigned char *mgl_get_rgb_(uintptr_t *graph); -const unsigned char *mgl_get_rgba_(uintptr_t *graph); -int mgl_get_width_(uintptr_t *graph); -int mgl_get_height_(uintptr_t *graph); -/*****************************************************************************/ -/* Setup frames transparency _(alpha) and lightning */ -/*****************************************************************************/ -int mgl_new_frame_(uintptr_t *graph); -void mgl_end_frame_(uintptr_t *graph); -int mgl_get_num_frame_(uintptr_t *graph); -void mgl_reset_frames_(uintptr_t *graph); -void mgl_set_transp_type_(uintptr_t *graph, int *type); -void mgl_set_transp_(uintptr_t *graph, int *enable); -void mgl_set_alpha_(uintptr_t *graph, int *enable); -void mgl_set_fog_(uintptr_t *graph, mreal *dist, mreal *dz); -void mgl_set_light_(uintptr_t *graph, int *enable); -void mgl_set_light_n_(uintptr_t *gr, int *n, int *enable); -void mgl_add_light_(uintptr_t *graph, int *n, mreal *x, mreal *y, mreal *z, char *c, int); -void mgl_add_light_rgb_(uintptr_t *graph, int *n, mreal *x, mreal *y, mreal *z, int *infty, - mreal *r, mreal *g, mreal *b, mreal *i); -void mgl_set_ambbr_(uintptr_t *gr, mreal *i); -/*****************************************************************************/ -/* Scale and rotate */ -/*****************************************************************************/ -void mgl_mat_push_(uintptr_t *gr); -void mgl_mat_pop_(uintptr_t *gr); -void mgl_identity_(uintptr_t *graph, int *rel); -void mgl_clf_(uintptr_t *graph); -void mgl_flush_(uintptr_t *gr); -void mgl_clf_rgb_(uintptr_t *graph, mreal *r, mreal *g, mreal *b); -void mgl_subplot_(uintptr_t *graph, int *nx,int *ny,int *m); -void mgl_subplot_d_(uintptr_t *graph, int *nx,int *ny,int *m,mreal *dx,mreal *dy); -void mgl_subplot_s_(uintptr_t *graph, int *nx,int *ny,int *m, const char *s,int); -void mgl_inplot_(uintptr_t *graph, mreal *x1,mreal *x2,mreal *y1,mreal *y2); -void mgl_relplot_(uintptr_t *graph, mreal *x1,mreal *x2,mreal *y1,mreal *y2); -void mgl_columnplot_(uintptr_t *graph, int *num, int *i); -void mgl_columnplot_d_(uintptr_t *graph, int *num, int *i, mreal *d); -void mgl_stickplot_(uintptr_t *graph, int *num, int *i, mreal *tet, mreal *phi); -void mgl_aspect_(uintptr_t *graph, mreal *Ax,mreal *Ay,mreal *Az); -void mgl_rotate_(uintptr_t *graph, mreal *TetX,mreal *TetZ,mreal *TetY); -void mgl_rotate_vector_(uintptr_t *graph, mreal *Tet,mreal *x,mreal *y,mreal *z); -void mgl_perspective_(uintptr_t *graph, mreal val); -/*****************************************************************************/ -/* Axis functions */ -/*****************************************************************************/ -void mgl_tune_ticks_(uintptr_t *gr, int *tune, mreal *fact_pos); -void mgl_adjust_ticks_(uintptr_t *gr, const char *dir, int l); -void mgl_set_ticks_dir_(uintptr_t *gr, char *dir, mreal *d, int *ns, mreal *org, int); -void mgl_set_ticks_(uintptr_t *graph, mreal *DX, mreal *DY, mreal *DZ); -void mgl_set_subticks_(uintptr_t *graph, int *NX, int *NY, int *NZ); -void mgl_set_caxis_(uintptr_t *graph, mreal *C1,mreal *C2); -void mgl_set_axis_(uintptr_t *graph, mreal *x1, mreal *y1, mreal *z1, mreal *x2, mreal *y2, mreal *z2, mreal *x0, mreal *y0, mreal *z0); -void mgl_set_axis_3d_(uintptr_t *graph, mreal *x1, mreal *y1, mreal *z1, mreal *x2, mreal *y2, mreal *z2); -void mgl_set_axis_2d_(uintptr_t *graph, mreal *x1, mreal *y1, mreal *x2, mreal *y2); -inline void mgl_set_ranges_(uintptr_t *graph, mreal *x1, mreal *x2, mreal *y1, mreal *y2, mreal *z1, mreal *z2) -{ mgl_set_axis_3d_(graph, x1,y1,z1,x2,y2,z2); }; -void mgl_set_origin_(uintptr_t *graph, mreal *x0, mreal *y0, mreal *z0); -void mgl_set_tick_origin_(uintptr_t *graph, mreal *x0, mreal *y0, mreal *z0); -void mgl_set_crange_(uintptr_t *graph, uintptr_t *a, int *add); -void mgl_set_xrange_(uintptr_t *graph, uintptr_t *a, int *add); -void mgl_set_yrange_(uintptr_t *graph, uintptr_t *a, int *add); -void mgl_set_zrange_(uintptr_t *graph, uintptr_t *a, int *add); -void mgl_set_auto_(uintptr_t *graph, mreal *x1, mreal *x2, mreal *y1, mreal *y2, mreal *z1, mreal *z2); -void mgl_set_func_(uintptr_t *graph, const char *EqX, const char *EqY, const char *EqZ, int, int, int); -void mgl_set_func_ext_(uintptr_t *graph, const char *EqX, const char *EqY, const char *EqZ, const char *EqA, int, int, int, int); -void mgl_set_coor_(uintptr_t *gr, int *how); -void mgl_set_ternary_(uintptr_t *graph, int *enable); -void mgl_set_cutoff_(uintptr_t *graph, const char *EqC, int); -void mgl_box_(uintptr_t *graph, int *ticks); -void mgl_box_str_(uintptr_t *graph, const char *col, int *ticks, int); -void mgl_box_rgb_(uintptr_t *graph, mreal *r, mreal *g, mreal *b, int *ticks); -void mgl_axis_(uintptr_t *graph, const char *dir,int); -void mgl_axis_grid_(uintptr_t *graph, const char *dir,const char *pen,int,int); -void mgl_label_(uintptr_t *graph, const char *dir, const char *text,int,int); -void mgl_label_ext_(uintptr_t *graph, const char *dir, const char *text, mreal *pos, mreal *size, mreal *shift,int,int); -void mgl_label_xy_(uintptr_t *graph, mreal *x, mreal *y, const char *text, const char *fnt, mreal *size,int,int); -void mgl_set_xtt_(uintptr_t * graph, const char *templ,int); -void mgl_set_ytt_(uintptr_t * graph, const char *templ,int); -void mgl_set_ztt_(uintptr_t * graph, const char *templ,int); -void mgl_set_ctt_(uintptr_t * graph, const char *templ,int); -/*****************************************************************************/ -/* Simple drawing */ -/*****************************************************************************/ -void mgl_ball_(uintptr_t *graph, mreal *x,mreal *y,mreal *z); -void mgl_ball_rgb_(uintptr_t *graph, mreal *x, mreal *y, mreal *z, mreal *r, mreal *g, mreal *b, mreal *alpha); -void mgl_ball_str_(uintptr_t *graph, mreal *x, mreal *y, mreal *z, const char *col,int); -void mgl_line_(uintptr_t *graph, mreal *x1, mreal *y1, mreal *z1, mreal *x2, mreal *y2, mreal *z2, const char *pen,int *n,int); - -void mgl_facex_(uintptr_t* graph, mreal *x0, mreal *y0, mreal *z0, mreal *wy, mreal *wz, const char *stl, mreal *dx, mreal *dy, int l); -void mgl_facey_(uintptr_t* graph, mreal *x0, mreal *y0, mreal *z0, mreal *wx, mreal *wz, const char *stl, mreal *dx, mreal *dy, int l); -void mgl_facez_(uintptr_t* graph, mreal *x0, mreal *y0, mreal *z0, mreal *wx, mreal *wy, const char *stl, mreal *dx, mreal *dy, int l); -void mgl_curve_(uintptr_t* graph, mreal *x1, mreal *y1, mreal *z1, mreal *dx1, mreal *dy1, mreal *dz1, mreal *x2, mreal *y2, mreal *z2, mreal *dx2, mreal *dy2, mreal *dz2, const char *pen,int *n, int l); - -void mgl_puts_(uintptr_t *graph, mreal *x, mreal *y, mreal *z,const char *text,int); -void mgl_puts_dir_(uintptr_t *graph, mreal *x, mreal *y, mreal *z, mreal *dx, mreal *dy, mreal *dz, const char *text, mreal size, int); -void mgl_text_(uintptr_t *graph, mreal *x, mreal *y, mreal *z,const char *text,int); -void mgl_title_(uintptr_t *graph, const char *text, const char *fnt, mreal *size, int,int); -void mgl_puts_ext_(uintptr_t *graph, mreal *x, mreal *y, mreal *z,const char *text,const char *font,mreal *size,const char *dir,int,int,int); -void mgl_text_ext_(uintptr_t *graph, mreal *x, mreal *y, mreal *z,const char *text,const char *font,mreal *size,const char *dir,int,int,int); -void mgl_colorbar_(uintptr_t *graph, const char *sch,int *where,int); -void mgl_colorbar_ext_(uintptr_t *graph, const char *sch,int *where, mreal *x, mreal *y, mreal *w, mreal *h, int); -void mgl_colorbar_val_(uintptr_t *graph, uintptr_t *dat, const char *sch,int *where,int); -void mgl_simple_plot_(uintptr_t *graph, uintptr_t *a, int *type, const char *stl,int); -void mgl_add_legend_(uintptr_t *graph, const char *text,const char *style,int,int); -void mgl_clear_legend_(uintptr_t *graph); -void mgl_legend_xy_(uintptr_t *graph, mreal *x, mreal *y, const char *font, mreal *size, mreal *llen,int); -void mgl_legend_(uintptr_t *graph, int *where, const char *font, mreal *size, mreal *llen,int); -void mgl_set_legend_box_(uintptr_t *gr, int *enable); -void mgl_set_legend_marks_(uintptr_t *gr, int *num); -/*****************************************************************************/ -/* 1D plotting functions */ -/*****************************************************************************/ -void mgl_fplot_(uintptr_t *graph, const char *fy, const char *stl, int *n, int ly, int ls); -void mgl_fplot_xyz_(uintptr_t *graph, const char *fx, const char *fy, const char *fz, const char *stl, int *n, int lx, int ly, int lz, int ls); -void mgl_plot_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen,int); -void mgl_plot_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, const char *pen,int); -void mgl_plot_(uintptr_t *graph, uintptr_t *y, const char *pen,int); -void mgl_radar_(uintptr_t *graph, uintptr_t *a, const char *pen, mreal *r, int); -void mgl_boxplot_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, const char *pen,int); -void mgl_boxplot_(uintptr_t *graph, uintptr_t *y, const char *pen,int); -void mgl_tens_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *pen,int); -void mgl_tens_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *c, const char *pen,int); -void mgl_tens_(uintptr_t *graph, uintptr_t *y, uintptr_t *c, const char *pen,int); -void mgl_area_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen,int); -void mgl_area_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, const char *pen,int); -void mgl_area_s_(uintptr_t *graph, uintptr_t *y, const char *pen,int); -void mgl_area_(uintptr_t *graph, uintptr_t *y, const char *pen,int); -void mgl_region_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y1, uintptr_t *y2, const char *pen, int *inside, int); -void mgl_region_(uintptr_t *graph, uintptr_t *y1, uintptr_t *y2, const char *pen, int *inside, int); -void mgl_mark_(uintptr_t *graph, mreal *x,mreal *y,mreal *z,const char *mark,int); -void mgl_stem_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen,int); -void mgl_stem_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, const char *pen,int); -void mgl_stem_(uintptr_t *graph, uintptr_t *y, const char *pen,int); -void mgl_step_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen,int); -void mgl_step_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, const char *pen,int); -void mgl_step_(uintptr_t *graph, uintptr_t *y, const char *pen,int); -void mgl_bars_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen,int); -void mgl_bars_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, const char *pen,int); -void mgl_bars_(uintptr_t *graph, uintptr_t *y, const char *pen,int); -void mgl_barh_yx_(uintptr_t *graph, uintptr_t *y, uintptr_t *v, const char *pen,int); -void mgl_barh_(uintptr_t *graph, uintptr_t *v, const char *pen,int); -/*****************************************************************************/ -/* Advanced 1D plotting functions */ -/*****************************************************************************/ -void mgl_torus_(uintptr_t *graph, uintptr_t *r, uintptr_t *z, const char *pen,int); -void mgl_text_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z,const char *text, const char *font, mreal *size,int,int); -void mgl_text_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, const char *text, const char *font, mreal *size,int,int); -void mgl_text_y_(uintptr_t *graph, uintptr_t *y, const char *text, const char *font, mreal *size,int,int); -void mgl_chart_(uintptr_t *graph, uintptr_t *a, const char *col,int); -void mgl_error_(uintptr_t *graph, uintptr_t *y, uintptr_t *ey, const char *pen,int); -void mgl_error_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *ey, const char *pen,int); -void mgl_error_exy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *ex, uintptr_t *ey, const char *pen,int); -void mgl_mark_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *r, const char *pen,int); -void mgl_mark_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *r, const char *pen,int); -void mgl_mark_y_(uintptr_t *graph, uintptr_t *y, uintptr_t *r, const char *pen,int); -void mgl_tube_xyzr_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *r, const char *pen,int); -void mgl_tube_xyr_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *r, const char *pen,int); -void mgl_tube_r_(uintptr_t *graph, uintptr_t *y, uintptr_t *r, const char *pen,int); -void mgl_tube_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, mreal *r, const char *pen,int); -void mgl_tube_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, mreal *r, const char *pen,int); -void mgl_tube_(uintptr_t *graph, uintptr_t *y, mreal *r, const char *pen,int); - -void mgl_textmark_xyzr_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *r, const char *text, const char *fnt,int,int); -void mgl_textmark_xyr_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *r, const char *text, const char *fnt,int,int); -void mgl_textmark_yr_(uintptr_t *graph, uintptr_t *y, uintptr_t *r, const char *text, const char *fnt,int,int); -void mgl_textmark_(uintptr_t *graph, uintptr_t *y, const char *text, const char *fnt,int,int); -/*****************************************************************************/ -/* 2D plotting functions */ -/*****************************************************************************/ -void mgl_fsurf_(uintptr_t *graph, const char *fz, const char *stl, int *n, int lz, int ls); -void mgl_fsurf_xyz_(uintptr_t *graph, const char *fx, const char *fy, const char *fz, const char *stl, int *n, int lx, int ly, int lz, int ls); -void mgl_grid_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *stl,mreal *zVal,int); -void mgl_grid_(uintptr_t *graph, uintptr_t *a,const char *stl,mreal *zVal,int); -void mgl_mesh_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch,int); -void mgl_mesh_(uintptr_t *graph, uintptr_t *z, const char *sch,int); -void mgl_fall_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch,int); -void mgl_fall_(uintptr_t *graph, uintptr_t *z, const char *sch,int); -void mgl_belt_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch,int); -void mgl_belt_(uintptr_t *graph, uintptr_t *z, const char *sch,int); -void mgl_surf_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch,int); -void mgl_surf_(uintptr_t *graph, uintptr_t *z, const char *sch,int); -void mgl_dens_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch,mreal *zVal,int); -void mgl_dens_(uintptr_t *graph, uintptr_t *z, const char *sch,mreal *zVal,int); -void mgl_boxs_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch,mreal *zVal,int); -void mgl_boxs_(uintptr_t *graph, uintptr_t *z, const char *sch,mreal *zVal,int); -void mgl_tile_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch,int); -void mgl_tile_(uintptr_t *graph, uintptr_t *z, const char *sch,int); -void mgl_tiles_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *r, const char *sch,int); -void mgl_tiles_(uintptr_t *graph, uintptr_t *z, uintptr_t *r, const char *sch,int); -void mgl_cont_xy_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, mreal *zVal,int); -void mgl_cont_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *z, const char *sch,mreal *zVal,int); -void mgl_cont_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, int *Num, mreal *zVal,int); -void mgl_cont_(uintptr_t *graph, uintptr_t *z, const char *sch, int *Num, mreal *zVal,int); - -void mgl_contf_xy_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, mreal *zVal,int); -void mgl_contf_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *z, const char *sch,mreal *zVal,int); -void mgl_contf_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, int *Num, mreal *zVal,int); -void mgl_contf_(uintptr_t *graph, uintptr_t *z, const char *sch, int *Num, mreal *zVal,int); - -void mgl_contd_xy_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, mreal *zVal,int); -void mgl_contd_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *z, const char *sch,mreal *zVal,int); -void mgl_contd_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, int *Num, mreal *zVal,int); -void mgl_contd_(uintptr_t *graph, uintptr_t *z, const char *sch, int *Num, mreal *zVal,int); - -void mgl_axial_xy_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch,int); -void mgl_axial_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *sch,int); -void mgl_axial_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, int *Num,int); -void mgl_axial_(uintptr_t *graph, uintptr_t *a, const char *sch, int *Num,int); -/*****************************************************************************/ -/* Dual plotting functions */ -/*****************************************************************************/ -void mgl_surfc_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch,int); -void mgl_surfc_(uintptr_t *graph, uintptr_t *z, uintptr_t *c, const char *sch,int); -void mgl_surfa_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch,int); -void mgl_surfa_(uintptr_t *graph, uintptr_t *z, uintptr_t *c, const char *sch,int); -void mgl_stfa_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *re, uintptr_t *im, int *dn, const char *sch, mreal *zVal, int); -void mgl_stfa_(uintptr_t *graph, uintptr_t *re, uintptr_t *im, int *dn, const char *sch, mreal *zVal, int); -void mgl_traj_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch,mreal *zVal,mreal *len,int); -void mgl_traj_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch,mreal *len,int); -void mgl_vect_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch,mreal *zVal,int *flag,int); -void mgl_vect_2d_(uintptr_t *graph, uintptr_t *ax, uintptr_t *ay, const char *sch,mreal *zVal,int *flag,int); -void mgl_vectl_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch,mreal *zVal,int); -void mgl_vectl_2d_(uintptr_t *graph, uintptr_t *ax, uintptr_t *ay, const char *sch,mreal *zVal,int); -void mgl_vectc_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch,mreal *zVal,int); -void mgl_vectc_2d_(uintptr_t *graph, uintptr_t *ax, uintptr_t *ay, const char *sch,mreal *zVal,int); -void mgl_vect_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch,int *flag,int); -void mgl_vect_3d_(uintptr_t *graph, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch,int *flag,int); -void mgl_vectl_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch,int); -void mgl_vectl_3d_(uintptr_t *graph, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch,int); -void mgl_vectc_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch,int); -void mgl_vectc_3d_(uintptr_t *graph, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch,int); -void mgl_map_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *a, uintptr_t *b, const char *sch, int *ks, int *pnts,int); -void mgl_map_(uintptr_t *graph, uintptr_t *a, uintptr_t *b, const char *sch, int *ks, int *pnts,int); -void mgl_surf3a_xyz_val_(uintptr_t *graph, mreal *Val, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, - const char *stl,int); -void mgl_surf3a_val_(uintptr_t *graph, mreal *Val, uintptr_t *a, uintptr_t *b, const char *stl,int); -void mgl_surf3a_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, - const char *stl, int *num,int); -void mgl_surf3a_(uintptr_t *graph, uintptr_t *a, uintptr_t *b, const char *stl, int *num,int); -void mgl_surf3c_xyz_val_(uintptr_t *graph, mreal *Val, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, - const char *stl,int); -void mgl_surf3c_val_(uintptr_t *graph, mreal *Val, uintptr_t *a, uintptr_t *b, const char *stl,int); -void mgl_surf3c_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, - const char *stl, int *num,int); -void mgl_surf3c_(uintptr_t *graph, uintptr_t *a, uintptr_t *b, const char *stl, int *num,int); -void mgl_flow_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, int *num, int *central, mreal *zVal,int); -void mgl_flow_2d_(uintptr_t *graph, uintptr_t *ax, uintptr_t *ay, const char *sch, int *num, int *central, mreal *zVal,int); -void mgl_flow_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, int *num, int *central,int); -void mgl_flow_3d_(uintptr_t *graph, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, int *num, int *central,int); - -void mgl_flowp_xy_(uintptr_t *graph, mreal *x0, mreal *y0, mreal *z0, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, int); -void mgl_flowp_2d_(uintptr_t *graph, mreal *x0, mreal *y0, mreal *z0, uintptr_t *ax, uintptr_t *ay, const char *sch, int); -void mgl_flowp_xyz_(uintptr_t *graph, mreal *x0, mreal *y0, mreal *z0, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, int); -void mgl_flowp_3d_(uintptr_t *graph, mreal *x0, mreal *y0, mreal *z0, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch,int); - -void mgl_pipe_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, mreal *r0, int *num, int *central, mreal *zVal,int); -void mgl_pipe_2d_(uintptr_t *graph, uintptr_t *ax, uintptr_t *ay, const char *sch, mreal *r0, int *num, int *central, mreal *zVal,int); -void mgl_pipe_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, mreal *r0, int *num, int *central,int); -void mgl_pipe_3d_(uintptr_t *graph, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, mreal *r0, int *num, int *central,int); -void mgl_dew_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, mreal *zVal,int l); -void mgl_dew_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch, mreal *zVal,int l); - -void mgl_grad_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ph, const char *sch, int *num, int); -void mgl_grad_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *ph, const char *sch, int *num, mreal *zVal,int); -void mgl_grad_(uintptr_t *graph, uintptr_t *ph, const char *sch, int *num, mreal *zVal,int); -/*****************************************************************************/ -/* 3D plotting functions */ -/*****************************************************************************/ -void mgl_grid3_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, int *sVal, const char *stl,int,int); -void mgl_grid3_(uintptr_t *graph, uintptr_t *a, const char *dir, int *sVal, const char *stl,int,int); -void mgl_grid3_all_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *stl,int); -void mgl_grid3_all_(uintptr_t *graph, uintptr_t *a, const char *stl,int); -void mgl_dens3_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, int *sVal, const char *stl,int,int); -void mgl_dens3_(uintptr_t *graph, uintptr_t *a, const char *dir, int *sVal, const char *stl,int,int); -void mgl_dens3_all_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *stl,int); -void mgl_dens3_all_(uintptr_t *graph, uintptr_t *a, const char *stl,int); -void mgl_surf3_xyz_val_(uintptr_t *graph, mreal *Val, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *stl,int); -void mgl_surf3_val_(uintptr_t *graph, mreal *Val, uintptr_t *a, const char *stl,int); -void mgl_surf3_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *stl, int *num,int); -void mgl_surf3_(uintptr_t *graph, uintptr_t *a, const char *stl, int *num,int); -void mgl_cont3_xyz_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, - const char *dir, int *sVal, const char *sch,int,int); -void mgl_cont3_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *dir, int *sVal, const char *sch,int,int); -void mgl_cont3_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, - const char *dir, int *sVal, const char *sch, int *Num,int,int); -void mgl_cont3_(uintptr_t *graph, uintptr_t *a, const char *dir, int *sVal, const char *sch, int *Num,int,int); -void mgl_cont_all_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, - const char *sch, int *Num,int); -void mgl_cont_all_(uintptr_t *graph, uintptr_t *a, const char *sch, int *Num,int); -void mgl_cloudp_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, - const char *stl, mreal *alpha,int); -void mgl_cloudp_(uintptr_t *graph, uintptr_t *a, const char *stl, mreal *alpha,int); -void mgl_cloud_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, - const char *stl, mreal *alpha,int); -void mgl_cloud_(uintptr_t *graph, uintptr_t *a, const char *stl, mreal *alpha,int); -void mgl_contf3_xyz_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, - const char *dir, int *sVal, const char *sch,int,int); -void mgl_contf3_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *dir, int *sVal, const char *sch,int,int); -void mgl_contf3_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, - const char *dir, int *sVal, const char *sch, int *Num,int,int); -void mgl_contf3_(uintptr_t *graph, uintptr_t *a, const char *dir, int *sVal, const char *sch, int *Num,int,int); -void mgl_contf_all_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, - const char *sch, int *Num,int); -void mgl_contf_all_(uintptr_t *graph, uintptr_t *a, const char *sch, int *Num,int); -void mgl_beam_val_(uintptr_t *gr, mreal *val, uintptr_t *tr, uintptr_t *g1, uintptr_t *g2, uintptr_t *a, - mreal *r, const char *sch, int *norm,int l); -void mgl_beam_(uintptr_t *gr, uintptr_t *tr, uintptr_t *g1, uintptr_t *g2, uintptr_t *a, mreal *r, - const char *sch, int *norm, int *num,int l); -/*****************************************************************************/ -/* Triangular plotting functions */ -/*****************************************************************************/ -void mgl_triplot_xyzc_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch,int); -void mgl_triplot_xyz_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch,int); -void mgl_triplot_xy_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, const char *sch, mreal *zVal,int); -void mgl_quadplot_xyzc_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch,int); -void mgl_quadplot_xyz_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch,int); -void mgl_quadplot_xy_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, const char *sch, mreal *zVal,int); - -void mgl_tricont_xyzcv_(uintptr_t *gr, uintptr_t *v, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, mreal *zVal,int); -void mgl_tricont_xyzv_(uintptr_t *gr, uintptr_t *v, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, mreal *zVal,int); -void mgl_tricont_xyzc_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, int *n, mreal *zVal, int); -void mgl_tricont_xyz_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, int *n, mreal *zVal, int); - -void mgl_dots_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch,int); -void mgl_dots_a_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch,int); -void mgl_dots_tr_(uintptr_t *gr, uintptr_t *tr, const char *sch,int); -void mgl_crust_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, mreal *er,int); -void mgl_crust_tr_(uintptr_t *gr, uintptr_t *tr, const char *sch, mreal *er,int); -/*****************************************************************************/ -/* Combined plotting functions */ -/*****************************************************************************/ -void mgl_dens_x_(uintptr_t *graph, uintptr_t *a, const char *stl, mreal *sVal,int); -void mgl_dens_y_(uintptr_t *graph, uintptr_t *a, const char *stl, mreal *sVal,int); -void mgl_dens_z_(uintptr_t *graph, uintptr_t *a, const char *stl, mreal *sVal,int); -void mgl_cont_x_(uintptr_t *graph, uintptr_t *a, const char *stl, mreal *sVal, int *Num,int); -void mgl_cont_y_(uintptr_t *graph, uintptr_t *a, const char *stl, mreal *sVal, int *Num,int); -void mgl_cont_z_(uintptr_t *graph, uintptr_t *a, const char *stl, mreal *sVal, int *Num,int); -void mgl_cont_x_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *stl, mreal *sVal,int); -void mgl_cont_y_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *stl, mreal *sVal,int); -void mgl_cont_z_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *stl, mreal *sVal,int); -void mgl_contf_x_(uintptr_t *graph, uintptr_t *a, const char *stl, mreal *sVal, int *Num,int); -void mgl_contf_y_(uintptr_t *graph, uintptr_t *a, const char *stl, mreal *sVal, int *Num,int); -void mgl_contf_z_(uintptr_t *graph, uintptr_t *a, const char *stl, mreal *sVal, int *Num,int); -void mgl_contf_x_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *stl, mreal *sVal,int); -void mgl_contf_y_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *stl, mreal *sVal,int); -void mgl_contf_z_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *stl, mreal *sVal,int); -/*****************************************************************************/ -/* Data creation functions */ -/*****************************************************************************/ -void mgl_data_rearrange_(uintptr_t *dat, int *mx, int *my, int *mz); -void mgl_data_set_float_(uintptr_t *dat, const float *A,int *NX,int *NY,int *NZ); -void mgl_data_set_double_(uintptr_t *dat, const double *A,int *NX,int *NY,int *NZ); -void mgl_data_set_float1_(uintptr_t *d, const float *A,int *N1); -void mgl_data_set_double1_(uintptr_t *d, const double *A,int *N1); -void mgl_data_set_float2_(uintptr_t *d, const float *A,int *N1,int *N2); -void mgl_data_set_double2_(uintptr_t *d, const double *A,int *N1,int *N2); -void mgl_data_set_float3_(uintptr_t *d, const float *A,int *N1,int *N2,int *N3); -void mgl_data_set_double3_(uintptr_t *d, const double *A,int *N1,int *N2,int *N3); -void mgl_data_set_(uintptr_t *dat, uintptr_t *a); -mreal mgl_data_get_value_(uintptr_t *d, int *i, int *j, int *k); -int mgl_data_get_nx_(uintptr_t *d); -int mgl_data_get_ny_(uintptr_t *d); -int mgl_data_get_nz_(uintptr_t *d); -void mgl_data_set_value_(uintptr_t *d, mreal *v, int *i, int *j, int *k); -void mgl_data_set_values_(uintptr_t *d, const char *val, int *nx, int *ny, int *nz, int l); -int mgl_data_read_(uintptr_t *d, const char *fname,int l); -int mgl_data_read_mat_(uintptr_t *dat, const char *fname, int *dim, int); -int mgl_data_read_dim_(uintptr_t *dat, const char *fname,int *mx,int *my,int *mz,int); -void mgl_data_save_(uintptr_t *dat, const char *fname,int *ns,int); -void mgl_data_export_(uintptr_t *dat, const char *fname, const char *scheme,mreal *v1,mreal *v2,int *ns,int,int); -void mgl_data_import_(uintptr_t *dat, const char *fname, const char *scheme,mreal *v1,mreal *v2,int,int); -void mgl_data_create_(uintptr_t *dat, int *nx,int *ny,int *nz); -void mgl_data_transpose_(uintptr_t *dat, const char *dim,int); -void mgl_data_norm_(uintptr_t *dat, mreal *v1,mreal *v2,int *sym,int *dim); -void mgl_data_norm_slice_(uintptr_t *dat, mreal *v1,mreal *v2,char *dir,int *keep_en,int *sym,int l); -uintptr_t mgl_data_subdata_(uintptr_t *dat, int *xx,int *yy,int *zz); -uintptr_t mgl_data_subdata_ext_(uintptr_t *dat, uintptr_t *xx,uintptr_t *yy,uintptr_t *zz); -uintptr_t mgl_data_column_(uintptr_t *dat, const char *eq,int l); -void mgl_data_set_id_(uintptr_t *dat, const char *id,int l); -void mgl_data_fill_(uintptr_t *dat, mreal *x1,mreal *x2,const char *dir,int); -void mgl_data_fill_eq_(uintptr_t *gr, uintptr_t *dat, const char *eq, uintptr_t *vdat, uintptr_t *wdat, int); -void mgl_data_put_val_(uintptr_t *dat, mreal *val, int *i, int *j, int *k); -void mgl_data_put_dat_(uintptr_t *dat, uintptr_t *val, int *i, int *j, int *k); -void mgl_data_modify_(uintptr_t *dat, const char *eq,int *dim,int); -void mgl_data_modify_vw_(uintptr_t *dat, const char *eq, uintptr_t *vdat, uintptr_t *wdat,int); -void mgl_data_squeeze_(uintptr_t *dat, int *rx,int *ry,int *rz,int *smooth); -mreal mgl_data_max_(uintptr_t *dat); -mreal mgl_data_min_(uintptr_t *dat); -const mreal *mgl_data_data_(uintptr_t *dat); - -mreal mgl_data_first_(uintptr_t *dat, const char *cond, int *i, int *j, int *k, int); -mreal mgl_data_last_(uintptr_t *dat, const char *cond, int *i, int *j, int *k, int); -int mgl_data_find_(uintptr_t *dat, const char *cond, char *dir, int *i, int *j, int *k, int,int); -int mgl_data_find_any_(uintptr_t *dat, const char *cond, int); -mreal mgl_data_max_int_(uintptr_t *dat, int *i, int *j, int *k); -mreal mgl_data_max_real_(uintptr_t *dat, mreal *x, mreal *y, mreal *z); -mreal mgl_data_min_int_(uintptr_t *dat, int *i, int *j, int *k); -mreal mgl_data_min_real_(uintptr_t *dat, mreal *x, mreal *y, mreal *z); -mreal mgl_data_momentum_mw_(uintptr_t *dat, char *dir, mreal *m, mreal *w,int); - -uintptr_t mgl_data_combine_(uintptr_t *dat1, uintptr_t *dat2); -void mgl_data_extend_(uintptr_t *dat, int *n1, int *n2); -void mgl_data_insert_(uintptr_t *dat, const char *dir, int *at, int *num, int); -void mgl_data_delete_(uintptr_t *dat, const char *dir, int *at, int *num, int); -/*****************************************************************************/ -/* Data manipulation functions */ -/*****************************************************************************/ -void mgl_data_smooth_(uintptr_t *dat, int *Type,mreal *delta,const char *dirs,int); -uintptr_t mgl_data_sum_(uintptr_t *dat, const char *dir,int); -uintptr_t mgl_data_max_dir_(uintptr_t *dat, const char *dir,int); -uintptr_t mgl_data_min_dir_(uintptr_t *dat, const char *dir,int); -void mgl_data_cumsum_(uintptr_t *dat, const char *dir,int); -void mgl_data_integral_(uintptr_t *dat, const char *dir,int); -void mgl_data_diff_(uintptr_t *dat, const char *dir,int); -void mgl_data_diff_par_(uintptr_t *dat, uintptr_t *v1, uintptr_t *v2, uintptr_t *v3); -void mgl_data_diff2_(uintptr_t *dat, const char *dir,int); -void mgl_data_swap_(uintptr_t *dat, const char *dir,int); -void mgl_data_roll_(uintptr_t *dat, const char *dir, int *num, int); -void mgl_data_mirror_(uintptr_t *dat, const char *dir,int); - -void mgl_data_hankel_(uintptr_t *dat, const char *dir,int); -void mgl_data_sinfft_(uintptr_t *dat, const char *dir,int); -void mgl_data_cosfft_(uintptr_t *dat, const char *dir,int); -void mgl_data_fill_sample_(uintptr_t *dat, int num, const char *how,int); - -mreal mgl_data_spline_(uintptr_t *dat, mreal *x,mreal *y,mreal *z); -mreal mgl_data_spline1_(uintptr_t *dat, mreal *x,mreal *y,mreal *z); -mreal mgl_data_linear_(uintptr_t *dat, mreal *x,mreal *y,mreal *z); -mreal mgl_data_linear1_(uintptr_t *dat, mreal *x,mreal *y,mreal *z); -uintptr_t mgl_data_resize_(uintptr_t *dat, int *mx,int *my,int *mz); -uintptr_t mgl_data_resize_box_(uintptr_t *dat, int *mx,int *my,int *mz,mreal *x1,mreal *x2,mreal *y1,mreal *y2,mreal *z1,mreal *z2); -uintptr_t mgl_data_momentum_(uintptr_t *dat, char *dir, const char *how, int,int); -uintptr_t mgl_data_hist_(uintptr_t *dat, int *n, mreal *v1, mreal *v2, int *nsub); -uintptr_t mgl_data_hist_w_(uintptr_t *dat, uintptr_t *weight, int *n, mreal *v1, mreal *v2, int *nsub); -uintptr_t mgl_data_evaluate_i_(uintptr_t *dat, uintptr_t *idat, int *norm); -uintptr_t mgl_data_evaluate_ij_(uintptr_t *dat, uintptr_t *idat, uintptr_t *jdat, int *norm); -uintptr_t mgl_data_evaluate_ijk_(uintptr_t *dat, uintptr_t *idat, uintptr_t *jdat, uintptr_t *kdat, int *norm); -void mgl_data_envelop_(uintptr_t *dat, const char *dir, int); -void mgl_data_sew_(uintptr_t *dat, const char *dirs, mreal *da, int); -void mgl_data_crop_(uintptr_t *dat, int *n1, int *n2, const char *dir,int); -/*****************************************************************************/ -/* Data operations */ -/*****************************************************************************/ -void mgl_data_mul_dat_(uintptr_t *dat, uintptr_t *d); -void mgl_data_div_dat_(uintptr_t *dat, uintptr_t *d); -void mgl_data_add_dat_(uintptr_t *dat, uintptr_t *d); -void mgl_data_sub_dat_(uintptr_t *dat, uintptr_t *d); -void mgl_data_mul_num_(uintptr_t *dat, mreal *d); -void mgl_data_div_num_(uintptr_t *dat, mreal *d); -void mgl_data_add_num_(uintptr_t *dat, mreal *d); -void mgl_data_sub_num_(uintptr_t *dat, mreal *d); -/*****************************************************************************/ -/* Nonlinear fitting */ -/*****************************************************************************/ -void mgl_hist_x_(uintptr_t* gr, uintptr_t* res, uintptr_t* x, uintptr_t* a); -void mgl_hist_xy_(uintptr_t* gr, uintptr_t* res, uintptr_t* x, uintptr_t* y, uintptr_t* a); -void mgl_hist_xyz_(uintptr_t* gr, uintptr_t* res, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* a); -/*****************************************************************************/ -/* Nonlinear fitting */ -/*****************************************************************************/ -mreal mgl_fit_1_(uintptr_t* gr, uintptr_t* fit, uintptr_t* y, const char *eq, const char *var, mreal *ini, int l, int n); -mreal mgl_fit_2_(uintptr_t* gr, uintptr_t* fit, uintptr_t* z, const char *eq, const char *var, mreal *ini, int l, int n); -mreal mgl_fit_3_(uintptr_t* gr, uintptr_t* fit, uintptr_t* a, const char *eq, const char *var, mreal *ini, int l, int n); -mreal mgl_fit_xy_(uintptr_t* gr, uintptr_t* fit, uintptr_t* x, uintptr_t* y, const char *eq, const char *var, mreal *ini, int l, int n); -mreal mgl_fit_xyz_(uintptr_t* gr, uintptr_t* fit, uintptr_t* x, uintptr_t* y, uintptr_t* z, const char *eq, const char *var, mreal *ini, int l, int n); -mreal mgl_fit_xyza_(uintptr_t* gr, uintptr_t* fit, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* a, const char *eq, const char *var, mreal *ini, int l, int n); -mreal mgl_fit_ys_(uintptr_t* gr, uintptr_t* fit, uintptr_t* y, uintptr_t* ss, const char *eq, const char *var, mreal *ini, int l, int n); -mreal mgl_fit_xys_(uintptr_t* gr, uintptr_t* fit, uintptr_t* x, uintptr_t* y, uintptr_t* ss, const char *eq, const char *var, mreal *ini, int l, int n); -mreal mgl_fit_xyzs_(uintptr_t* gr, uintptr_t* fit, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* ss, const char *eq, const char *var, mreal *ini, int l, int n); -mreal mgl_fit_xyzas_(uintptr_t* gr, uintptr_t* fit, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* a, uintptr_t* ss, const char *eq, const char *var, mreal *ini, int l, int n); -void mgl_puts_fit_(uintptr_t* gr, mreal *x, mreal *y, mreal *z, const char *prefix, const char *font, mreal *size, int l, int n); -/*****************************************************************************/ -uintptr_t mgl_create_parser_(); -void mgl_delete_parser_(uintptr_t* p); -void mgl_add_param_(uintptr_t* p, int *id, const char *str, int l); -/*===!!! NOTE !!! You must not delete obtained data arrays !!!===============*/ -uintptr_t mgl_add_var_(uintptr_t* p, const char *name, int l); -/*===!!! NOTE !!! You must not delete obtained data arrays !!!===============*/ -uintptr_t mgl_find_var_(uintptr_t* p, const char *name, int l); -int mgl_parse_(uintptr_t* gr, uintptr_t* p, const char *str, int *pos, int l); -void mgl_parse_text_(uintptr_t* gr, uintptr_t* p, const char *str, int l); -void mgl_restore_once_(uintptr_t* p); -void mgl_parser_allow_setsize_(uintptr_t* p, int *a); -/*****************************************************************************/ -void mgl_sphere_(uintptr_t* graph, mreal *x, mreal *y, mreal *z, mreal *r, const char *stl, int); -void mgl_drop_(uintptr_t* graph, mreal *x1, mreal *y1, mreal *z1, mreal *x2, mreal *y2, mreal *z2, mreal *r, const char *stl, mreal *shift, mreal *ap, int); -void mgl_cone_(uintptr_t* graph, mreal *x1, mreal *y1, mreal *z1, mreal *x2, mreal *y2, mreal *z2, mreal *r1, mreal *r2, const char *stl, int *edge, int); - -uintptr_t mgl_pde_solve_(uintptr_t* gr, const char *ham, uintptr_t* ini_re, uintptr_t* ini_im, mreal *dz, mreal *k0,int); -uintptr_t mgl_qo2d_solve_(const char *ham, uintptr_t* ini_re, uintptr_t* ini_im, uintptr_t* ray, mreal *r, mreal *k0, uintptr_t* xx, uintptr_t* yy, int); -uintptr_t mgl_af2d_solve_(const char *ham, uintptr_t* ini_re, uintptr_t* ini_im, uintptr_t* ray, mreal *r, mreal *k0, uintptr_t* xx, uintptr_t* yy, int); -uintptr_t mgl_ray_trace_(const char *ham, mreal *x0, mreal *y0, mreal *z0, mreal *px, mreal *py, mreal *pz, mreal *dt, mreal *tmax,int); -void mgl_data_fill_eq_(uintptr_t* gr, uintptr_t* res, const char *eq, uintptr_t* vdat, uintptr_t* wdat,int); -uintptr_t mgl_jacobian_2d_(uintptr_t* x, uintptr_t* y); -uintptr_t mgl_jacobian_3d_(uintptr_t* x, uintptr_t* y, uintptr_t* z); - -uintptr_t mgl_transform_a_(uintptr_t *am, uintptr_t *ph, const char *tr, int); -uintptr_t mgl_transform_(uintptr_t *re, uintptr_t *im, const char *tr, int); -uintptr_t mgl_data_stfa_(uintptr_t *re, uintptr_t *im, int *dn, char *dir, int); - -#ifdef __cplusplus -} -#endif - -#endif /* _mgl_f_h_ */ diff --git a/include/mgl/mgl_gl.h b/include/mgl/mgl_gl.h deleted file mode 100644 index c68c419..0000000 --- a/include/mgl/mgl_gl.h +++ /dev/null @@ -1,90 +0,0 @@ -/*************************************************************************** - * mgl_gl.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -//----------------------------------------------------------------------------- -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" -#else -#ifndef _MGL_GL_H_ -#define _MGL_GL_H_ -#ifdef WIN32 -#include -#endif -#ifdef __APPLE__ -#include -#else -#include -#endif -#include "mgl/mgl_ab.h" -//----------------------------------------------------------------------------- -/// Class implements the creation of different mathematical plots under OpenGL -class mglGraphGL : public mglGraphAB -{ -public: - mglGraphGL(); - virtual ~mglGraphGL(); - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - void Flush() {glFlush();}; - void Finish(){glFinish();}; - bool Alpha(bool enable); - bool Light(bool enable); - void Light(int n, bool enable); - void Fog(mreal d, mreal dz=0.25); - void Light(int n,mglPoint p, mglColor c=NC, mreal br=0.5, bool infty=true); - void View(mreal tetX,mreal tetY,mreal tetZ); - void Clf(mglColor Back=NC); - int NewFrame(); - void EndFrame(); - void InPlot(mreal x1,mreal x2,mreal y1,mreal y2,bool rel=false); - void SetSize(int ,int ){}; - - void Ball(mreal x,mreal y,mreal z,mglColor col=RC,mreal alpha=1); - void Glyph(mreal x, mreal y, mreal f, int style, long icode, char col); -// void Glyph(mreal x,mreal y, mreal f, int nt, const short *trig, int nl, const short *line); -protected: - mglColor def_col; - -// void DefColor(mglColor c, mreal alpha=-1); - void Pen(mglColor col, char style,mreal width); - unsigned char **GetRGBLines(long &w, long &h, unsigned char *&f, bool solid=true); - - void ball(mreal *p,mreal *c); - - void LightScale(); - void line_plot(mreal *p1,mreal *p2,mreal *c1,mreal *c2,bool all=false); - void line_plot_s(mreal *p1,mreal *p2,mreal *c1,mreal *c2,bool all=false); - void trig_plot(mreal *p0,mreal *p1,mreal *p2, - mreal *c0,mreal *c1,mreal *c2); - void trig_plot_n(mreal *p0,mreal *p1,mreal *p2, - mreal *c0,mreal *c1,mreal *c2, - mreal *n0,mreal *n1,mreal *n2); - void quad_plot(mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal *c0,mreal *c1,mreal *c2,mreal *c3); - void quad_plot_a(mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal a0,mreal a1,mreal a2,mreal a3,mreal alpha); - void quad_plot_n(mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal *c0,mreal *c1,mreal *c2,mreal *c3, - mreal *n0,mreal *n1,mreal *n2,mreal *n3); - void mark_plot(mreal *pp, char type); - void font_line(mreal *p, unsigned char *r,bool thin=true); -}; -//----------------------------------------------------------------------------- -#endif -#endif -//----------------------------------------------------------------------------- diff --git a/include/mgl/mgl_glut.h b/include/mgl/mgl_glut.h deleted file mode 100644 index 7ec2eba..0000000 --- a/include/mgl/mgl_glut.h +++ /dev/null @@ -1,61 +0,0 @@ -/*************************************************************************** - * mgl_glut.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -//----------------------------------------------------------------------------- -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" -#else -#ifndef _MGL_GLUT_H_ -#define _MGL_GLUT_H_ -#include "mgl/mgl_gl.h" -//----------------------------------------------------------------------------- -/// Class allows the window creation under OpenGL with the help of GLUT library -class mglGraphGLUT : public mglGraphGL -{ -friend void _mgl_display(); -friend void _mgl_key_up(unsigned char ch,int ,int ); -friend void _mgl_timer(int); -public: -using mglGraphAB::Window; - mglGraphGLUT(); - virtual ~mglGraphGLUT(); - //void WriteEPS(const char *fname,const char *descr=0); // ýêñïîðò â EPS - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ñëóæåáíûå ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /// Create a window for plotting. Now implemeted only for GLUT. - void Window(int argc, char **argv, int (*draw)(mglGraph *gr, void *p), - const char *title,void *par=NULL, - void (*reload)(int next, void *p)=NULL, bool maximize=false); - /// Switch on/off transparency (do not overwrite switches in user drawing function) - void ToggleAlpha(); - /// Switch on/off lighting (do not overwrite switches in user drawing function) - void ToggleLight(); - void ToggleNo(); ///< Switch off all zooming and rotation - void Update(); ///< Update picture by calling user drawing function - void ReLoad(bool o);///< Reload user data and update picture - void NextFrame(); ///< Show next frame (if one) - void PrevFrame(); ///< Show previous frame (if one) - void Animation(); ///< Run slideshow (animation) of frames -private: - int curr_fig; ///< Current figure in the list. - int tt; ///< Temporal variable -}; -//----------------------------------------------------------------------------- -#endif -#endif -//----------------------------------------------------------------------------- diff --git a/include/mgl/mgl_idtf.h b/include/mgl/mgl_idtf.h deleted file mode 100644 index 703a1be..0000000 --- a/include/mgl/mgl_idtf.h +++ /dev/null @@ -1,386 +0,0 @@ -/*************************************************************************** - * mgl_idtf.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -//----------------------------------------------------------------------------- -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" -#else -#ifndef _MGL_IDTF_H_ -#define _MGL_IDTF_H_ - -#define __STDC_LIMIT_MACROS -#include -# include -# include -# include -# include -# include -# include -# include - -#ifdef WIN32 -#include -#endif -#ifndef SIZE_MAX -#define SIZE_MAX size_t(-1) -#endif -#include "mgl/mgl_ab.h" -//----------------------------------------------------------------------------- -/// basic u3d classes and data structures -class mglGraphIDTF; -//----------------------------------------------------------------------------- -struct u3dNode -{ - mreal position[4][4]; - std::string parent; - std::string resource; - bool both_visible; - std::string type; - std::string name; - u3dNode() : both_visible ( true ) {}; - void print ( std::ofstream& ostr ); -}; -//----------------------------------------------------------------------------- -struct u3dLight -{ - std::string type; - mglColor color; - mreal position[4][4]; - mreal intensity; - mreal attenuation; - std::string name; - void print_light_resource ( std::ofstream& ostr ); - void print_node ( std::ofstream& ostr ); -}; -typedef std::list u3dLight_list; -//----------------------------------------------------------------------------- -/// Class contain color description and opacity. The color is used as diffuse and specular color (unlike other parts of MathGL, where specular color is assumed to be white). Ambient color is set to be 0.5 of the color in description. If emissive flag is set - the emissive color of material is set to the described color, otherwise to 1/8 of it. A flag controls if the vertexes can have colors assigned to them. -class u3dMaterial -{ -public: - mglColor diffuse; - mglColor specular; - mglColor emissive; - mreal reflectivity; - mreal opacity; - bool vertex_color; - std::string name; - std::string texture; - bool textumrealpha; - - u3dMaterial() : diffuse(BC), specular(BC), emissive(BC), reflectivity(0.25f), opacity(1.0f), vertex_color(false) {}; - bool operator== ( const u3dMaterial& Material ) - { - return( this->diffuse == Material.diffuse && - this->specular == Material.specular && - this->emissive == Material.emissive && - this->opacity == Material.opacity && - this->reflectivity == Material.reflectivity && - this->vertex_color == Material.vertex_color && - this->texture.empty() && Material.texture.empty() ); - } - void print_material ( std::ofstream& ostr ); - void print_shader ( std::ofstream& ostr ); -}; -typedef std::deque u3dMaterial_list; -//----------------------------------------------------------------------------- -/// This class is used for manipulation with TGA images. -class TGAImageMin -{ -public: - TGAImageMin(); - ~TGAImageMin(); - - bool Initialize( uint32_t width, uint32_t height, uint32_t channels ); - void Deallocate(); - - bool Write( const char* pFileName ) const; - - uint32_t Width, Height; - uint32_t Channels; - uint8_t* RGBPixels; // RGBA -}; -class u3dTexture -{ -public: - std::string name; - TGAImageMin image; - void print_texture ( const char *fname, std::ofstream& ostrtmp ); -}; -typedef std::list u3dTexture_list; -//----------------------------------------------------------------------------- -struct u3dGroup -{ - std::string name; - u3dGroup* parent; - size_t NumberOfChildren; - bool isauto; - u3dGroup(): parent ( NULL ), NumberOfChildren ( 0 ), isauto ( false ) {}; -}; -typedef std::list u3dGroup_list; -//----------------------------------------------------------------------------- -typedef std::vector mglPoint_list; -typedef std::vector mglColor_list; -typedef std::vector ModelMaterial_list; -/// Class describe an object in the scene. Base class for PointSet, LineSet, Mesh. Keeps a vector of vertexes used, colors assigned to them (if any), names of materials used in the model. Has a name and may belong to group of objects (have a parent). -class u3dModel -{ -public: - mglPoint_list Points; - mglColor_list Colors; - mreal position[4][4]; - mreal invpos[4][4]; - - bool vertex_color; - ModelMaterial_list ModelMaterials; - bool both_visible; - mglGraphIDTF *Graph; - std::string name; - u3dGroup* parent; - u3dModel ( const std::string name, mglGraphIDTF *Graph, const bool& vertex_color ); - void print_node ( std::ofstream& ostr ); - void print_shading_modifier ( std::ofstream& ostr ); - size_t AddModelMaterial ( const mreal *c, bool emissive, bool vertex_color ); - size_t AddPoint ( const mreal *p ); - size_t AddPoint ( const mglPoint& p ); - size_t AddColor ( const mreal *c ); - size_t AddColor ( const mglColor& c ); -}; -//----------------------------------------------------------------------------- -typedef std::list u3dModel_list; -//----------------------------------------------------------------------------- -class u3dBall -{ -public: - mglPoint center; - mreal radius; - size_t material; - - mglGraphIDTF *Graph; - std::string name; - u3dGroup* parent; - void print_node ( std::ofstream& ostr ); - void print_shading_modifier ( std::ofstream& ostr ); -}; -typedef std::vector u3dBall_list; -//----------------------------------------------------------------------------- -struct u3dLine -{ - size_t pid1; - size_t pid2; - size_t mid; -}; -typedef std::vector u3dLine_list; -//----------------------------------------------------------------------------- -/// Class for any line segment indexes of both end points and index of used material are stored. Per-vertes colors not supported. Line patterns not supported. -class u3dLineSet : public u3dModel -{ -public: - u3dLineSet ( const std::string& name, mglGraphIDTF *Graph ) : - u3dModel ( name, Graph, false ) - { - this->both_visible = false; - } - u3dLine_list Lines; - void line_plot ( mreal *p1, mreal *p2, mreal *c1, mreal *c2 ); - void print_model_resource ( std::ofstream& ostrtmp ); - void AddLine ( size_t pid1, size_t pid2, size_t mid ); -}; -//----------------------------------------------------------------------------- -typedef std::list u3dLineSet_list; -//----------------------------------------------------------------------------- -/// Class does not extend u3dModel in any way, since in Adobe products points are always colored black. -class u3dPointSet : public u3dModel -{ -public: -// std::vector pointShaders; -// std::vector pointColors; does not work due to Adobe bug - u3dPointSet ( const std::string& name, mglGraphIDTF *Graph ); - void point_plot ( const mglPoint& p, const mglColor& c ); - void print_model_resource ( std::ofstream& ostrtmp ); -}; -//----------------------------------------------------------------------------- -typedef std::list u3dPointSet_list; -//----------------------------------------------------------------------------- -struct size_t3 -{ - size_t a; - size_t b; - size_t c; -}; -struct TexCoord2D -{ - mreal U; - mreal V; - TexCoord2D ( ) { } - TexCoord2D ( mreal u, mreal v ) { U = u; V = v; } -}; -typedef std::vector TexCoord2D_list; -/// Class contain meshes which are presented as a set of triangles. Indexes of vertexes, index of material, indexes of vertex colors are stored for each triangle. But mreally there are two modes, with and without per-vertex colors. If vertex colors are used, colors change smoothly along the surface, but transparency and lighting are disabled. If there are no vertex colors, the appearance is affected by materials, transparency and lighting are possible, but a large number of different materials results in slowly displayed models. Boolean parameter vertex_color_flag controls the mode. If you are drawing something in a small set of colors, it is advised to set it to false in order to get lighting for your model. (If exacly one color is used the per-vertex coloring is disabled automatically). -class u3dMesh : public u3dModel -{ -public: - TexCoord2D_list textureCoords; - std::vector Triangles; - std::vector faceShaders; - std::vector faceColors; - bool disable_compression; - size_t textureDimension; - u3dMesh ( const std::string& name, mglGraphIDTF *Graph, - const bool& vertex_color, const bool& disable_compression ) : u3dModel ( name, Graph, vertex_color ) - { - this->disable_compression = disable_compression; - this->textureDimension = 0; - } - void quad_plot ( mreal *pp0,mreal *pp1,mreal *pp2,mreal *pp3, - mreal *cc0,mreal *cc1,mreal *cc2,mreal *cc3 ); - void quad_plot_n ( mreal *pp0,mreal *pp1,mreal *pp2,mreal *pp3, - mreal *cc0,mreal *cc1,mreal *cc2,mreal *cc3, - mreal *nn0,mreal *nn1,mreal *nn2,mreal *nn3 ); - void trig_plot ( mreal *pp0,mreal *pp1,mreal *pp2, - mreal *cc0,mreal *cc1,mreal *cc2 ); - void trig_plot_n ( mreal *pp0,mreal *pp1,mreal *pp2, - mreal *cc0,mreal *cc1,mreal *cc2, - mreal *nn0,mreal *nn1,mreal *nn2 ); - void print_model_resource ( std::ofstream& ostrtmp ); - void AddTriangle ( size_t pid0, size_t pid1, size_t pid2, - size_t cid0, size_t cid1, size_t cid2); - void AddTriangle ( size_t pid0, size_t pid1, size_t pid2, size_t mid); -}; -//----------------------------------------------------------------------------- -typedef std::list u3dMesh_list; -//----------------------------------------------------------------------------- -/// Class implements the creation of different mathematical plots under OpenGL -class mglGraphIDTF : public mglGraphAB -{ -public: - mglGraphIDTF(); - virtual ~mglGraphIDTF(); - using mglGraph::Mark; - using mglGraph::Ball; - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - void DoubleSided(bool enable) { double_sided_flag = enable ; } - void VertexColor(bool enable) { vertex_color_flag = enable ; } - void TextureColor(bool enable) { textures_flag = enable ; } - void Compression(bool enable) { disable_compression_flag = !enable ; } - void Unrotate(bool enable) { unrotate_flag = enable ; } - void BallIsPoint(bool enable) { ball_is_point_flag = enable ; } - /// Flush() finishes current PointSet, LineSet and Mesh. Use Flush() to separate unnamed objects in the scene. The named objects or object groups are separeted by StartGroup/EndGroup - void Flush() { points_finished = lines_finished = mesh_finished = true; }; - void Light ( int n,mglPoint p, mglColor c=NC, mreal br=0.5, bool infty=true ); - void InPlot ( mreal x1,mreal x2,mreal y1,mreal y2, bool rel=false ); - void DefaultPlotParam(); ///< Set default parameter for plotting - void Rotate(mreal TetX,mreal TetZ,mreal TetY=0); - void SetSize(int ,int ) {}; - void Clf ( mglColor Back=NC ); - /// Print string \a str in position \a p with font size \a size. - void Putsw(mglPoint p,const wchar_t *text,const char *font=0,mreal size=-1,char dir=0,mreal shift=0); - /// Print string \a str with font size \a size in position \a p along direction \a l. - mreal Putsw(mglPoint p,mglPoint l,const wchar_t *text,char font='t',mreal size=-1); - - void Ball ( mreal x,mreal y,mreal z,mglColor col=RC,mreal alpha=1 ); - void WriteIDTF ( const char *fname,const char *descr=0 ); - void WriteU3D ( const char *fname,const char *descr=0 ); - void WritePDF ( const char *fname,const char *descr=0 ); - friend class u3dModel; - friend class u3dMesh; - friend class u3dBall; - float diff_int; ///< diffuse color intensity - float spec_int; ///< specular color intensity - float emis_int; ///< emissive color intensity - bool double_sided_flag; ///< show both sides in meshes - bool vertex_color_flag; ///< use per-vertex color in meshes - bool textures_flag; ///< use textures on surfaces - bool disable_compression_flag; ///< disable mesh compression (normally is true). One don't need the number of polygons reduced automatically to save space, but you may have to unset it if you use unpatched (unfixed) U3D library. - bool unrotate_flag; ///< do not rotate the scene as a whole, in this case you have to set camera position externally. - bool ball_is_point_flag; - /// Objects can belong to groups. StartGroup() and EndGroup() do what the names imply. - void StartGroup ( const char *name ); - void StartAutoGroup ( const char *name ); - void EndGroup(); - u3dGroup* GetCurrentGroup(); -protected: - mglColor def_col; - - void ball ( mreal *p,mreal *c ); - void UnitBall (); - - void point_plot ( const mglPoint& p, const mglColor& c ); - void line_plot ( const mglPoint& p0, const mglPoint& p1 ); - void trig_plot ( const mglPoint& p0, const mglPoint& p1, const mglPoint& p2 ); - void quad_plot ( const mglPoint& p0, const mglPoint& p1, const mglPoint& p2, const mglPoint& p3 ); - void line_plot ( mreal *p1,mreal *p2,mreal *c1,mreal *c2,bool all=false ); - void line_plot_s ( mreal *p1,mreal *p2,mreal *c1,mreal *c2,bool all=false ); - void trig_plot ( mreal *p0,mreal *p1,mreal *p2, - mreal *c0,mreal *c1,mreal *c2 ); - void trig_plot_n ( mreal *p0,mreal *p1,mreal *p2, - mreal *c0,mreal *c1,mreal *c2, - mreal *n0,mreal *n1,mreal *n2 ); - void quad_plot ( mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal *c0,mreal *c1,mreal *c2,mreal *c3 ); - void quad_plot_a ( mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal a0,mreal a1,mreal a2,mreal a3,mreal alpha ); - void quad_plot_n ( mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal *c0,mreal *c1,mreal *c2,mreal *c3, - mreal *n0,mreal *n1,mreal *n2,mreal *n3 ); - void mark_plot ( mreal *pp, char type ); - void font_line ( mreal *p, unsigned char *r,bool thin=true ); - - void surf_plot ( long n,long m,mreal *pp,mreal *cc,bool *tt ); - void cloud_plot( long nx, long ny, long nz, mreal *pp, mreal *a, mreal alpha ); - void arrow_plot ( mreal *p1,mreal *p2,char st ); - void quads_plot(long n, mreal *pp, mreal *cc, bool *tt); - - bool points_finished; ///< do not add any more to the current point set - bool lines_finished; ///< do not add any more to the current line set - bool mesh_finished; ///< do not add any more to the current mesh - - inline mreal fixalpha ( mreal alpha ) { return UseAlpha ? (alpha<0?-alpha:alpha) : 1.0f; }; - - u3dMaterial_list Materials; ///< global list of all materials used in all models. - size_t AddMaterial ( const u3dMaterial& Material ); - - u3dTexture_list Textures; ///< global list of all textures - u3dTexture& AddTexture(); - - u3dPointSet_list PointSets; ///< global list of u3dPointSets - u3dPointSet& GetPointSet(); - u3dLineSet_list LineSets; ///< global list of u3dLineSets - u3dLineSet& GetLineSet(); - u3dMesh_list Meshes; ///< global list of u3Meshes - u3dMesh& GetMesh(); - - u3dBall_list Balls; ///< global list of u3Balls - - u3dLight_list Lights; - void SetAmbientLight ( mglColor c=WC, mreal br=-1.0 ); - void AddLight ( mglPoint p, mglColor color=WC, mreal br=0.5, bool infty=true ); - - u3dGroup* CurrentGroup; - u3dGroup_list Groups; - - mreal* col2col ( const mreal *c, const mreal *n, mreal *r ); - void MakeTransformMatrix( mreal position[4][4], mreal invpos[4][4] ); - - mreal rotX, rotY, rotZ; -}; -//----------------------------------------------------------------------------- -#endif -#endif -//----------------------------------------------------------------------------- diff --git a/include/mgl/mgl_pas.pas b/include/mgl/mgl_pas.pas deleted file mode 100644 index c5c12db..0000000 --- a/include/mgl/mgl_pas.pas +++ /dev/null @@ -1,1557 +0,0 @@ -//************************************************************************** -// mgl_pas.pas is part of Math Graphic Library * -// Copyright (C) 2008 Mikhail Barg * -// * -// This program is free software; you can redistribute it and/or modify * -// it under the terms of the GNU Library 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 Library General Public * -// License along with this program; if not, write to the * -// Free Software Foundation, Inc., * -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * -//************************************************************************** - -unit mgl_pas; - -interface - -uses Windows, Math, Graphics; - -const MGL_VERSION = 8.1; - -const -{$IFDEF MSWINDOWS} - //win - .dll - libmgl = 'mgl.dll'; - libmglglut = 'libmgl-glut.dll'; - libmglfltk = 'libmgl-fltk.dll'; - libmglqt = 'libmgl-qt.dll'; -{$ELSE} -{$IFDEF LINUX} - //linux - .so - libmgl = 'mgl.so'; - libmglglut = 'libmgl-glut.so'; - libmglfltk = 'libmgl-fltk.so'; - libmglqt = 'libmgl-qt.so'; -{$ELSE} - // other platforms? - -{$ENDIF} -{$ENDIF} - - - -type TMGLGraph = record - end; - -type TMGLData = record - end; -type TMGLParse = record - end; - -type HMGL = ^TMGLGraph; -type HMDT = ^TMGLData; -type HMPR = ^TMGLParse; - -//*****************************************************************************/ -//HMGL mgl_create_graph_gl(); -function mgl_create_graph_gl(): HMGL; cdecl; external libmgl; - -//HMGL mgl_create_graph_zb(int width, int height); -function mgl_create_graph_zb(width, height: integer): HMGL; cdecl; external libmgl; - -//HMGL mgl_create_graph_ps(int width, int height); -function mgl_create_graph_ps(width, height: integer): HMGL; cdecl; external libmgl; - -//HMGL mgl_create_graph_glut(int (*draw)(HMGL gr, void *p), const char *title, void *par); -type TGLUTDrawFunction = function (gr: HMGL; p: pointer): integer; cdecl; -type PPChar = ^PChar; -function mgl_create_graph_glut(draw: TGLUTDrawFunction; const title: PChar; par: pointer): HMGL; cdecl; external libmglglut; - -//HMGL mgl_create_graph_fltk(int (*draw)(HMGL gr, void *p), const char *title, void *par); -function mgl_create_graph_fltk(draw: TGLUTDrawFunction; const title: PChar; par: pointer): HMGL; cdecl; external libmglfltk; - -//HMGL mgl_create_graph_qt(int (*draw)(HMGL gr, void *p), const char *title, void *par); -function mgl_create_graph_qt(draw: TGLUTDrawFunction; const title: PChar; par: pointer): HMGL; cdecl; external libmglqt; - -//HMGL mgl_create_graph_idtf(); -function mgl_create_graph_idtf(): HMGL; cdecl; external libmgl; - -//void mgl_fltk_run(); -procedure mgl_fltk_run(); cdecl; external libmglfltk; - -//void mgl_qt_run(); -procedure mgl_qt_run(); cdecl; external libmglqt; - -//void mgl_set_show_mouse_pos(HMGL gr, int enable); -procedure mgl_set_show_mouse_pos(graph: HMGL; enable: integer); cdecl; external libmgl; - -//void mgl_get_last_mouse_pos(HMGL gr, float *x, float *y, float *z); -procedure mgl_get_last_mouse_pos(gr: HMGL; x: PSingle; y: PSingle; z: PSingle); cdecl; external libmgl; - -//void mgl_update(HMGL graph); -procedure mgl_update(graph: HMGL); cdecl; external libmgl; - -//void mgl_delete_graph(HMGL graph); -procedure mgl_delete_graph(graph: HMGL); cdecl; external libmgl; - -//*****************************************************************************/ -//HMDT mgl_create_data(); -function mgl_create_data(): HMDT; cdecl; external libmgl; - -//HMDT mgl_create_data_size(int nx, int ny, int nz); -function mgl_create_data_size(nx, ny, nz: integer): HMDT; cdecl; external libmgl; - -//HMDT mgl_create_data_file(const char *fname); -function mgl_create_data_file(const fname: PChar): HMDT; cdecl; external libmgl; - -//void mgl_delete_data(HMDT dat); -procedure mgl_delete_data(dat: HMDT); cdecl; external libmgl; - -//*****************************************************************************/ -//HMPR mgl_create_parser(); -function mgl_create_parser(): HMPR; cdecl; external libmgl; - -//void mgl_delete_parser(HMPR p); -procedure mgl_delete_parser(p: HMPR); cdecl; external libmgl; - -//void mgl_add_param(HMPR p, int id, const char *str); -procedure mgl_add_param(p: HMPR; id: integer; const str: PChar); cdecl; external libmgl; - -//void mgl_add_paramw(HMPR p, int id, const wchar_t *str); -procedure mgl_add_paramw(p: HMPR; id: integer; const str: PWideChar); cdecl; external libmgl; - -//*===!!! NOTE !!! You must not delete obtained data arrays !!!===============*/ -//HMDT mgl_add_var(HMPR, const char *name); -function mgl_add_var(p: HMPR; const name: PChar): HMDT; cdecl; external libmgl; - -//*===!!! NOTE !!! You must not delete obtained data arrays !!!===============*/ -//HMDT mgl_find_var(HMPR, const char *name); -function mgl_find_var(p: HMPR; const name: PChar): HMDT; cdecl; external libmgl; - -//int mgl_parse(HMGL gr, HMPR p, const char *str, int pos); -function mgl_parse(gr: HMGL; p: HMPR; const str: PChar; pos: integer): integer; cdecl; external libmgl; - -//int mgl_parsew(HMGL gr, HMPR p, const wchar_t *str, int pos); -function mgl_parsew(gr: HMGL; p: HMPR; const str: PWideChar; pos: integer): integer; cdecl; external libmgl; - -//void mgl_parse_text(HMGL gr, HMPR p, const char *str); -procedure mgl_parse_text(gr: HMGL; p: HMPR; const str: PChar); cdecl; external libmgl; - -//void mgl_parsew_text(HMGL gr, HMPR p, const wchar_t *str); -procedure mgl_parsew_text(gr: HMGL; p: HMPR; const str: PWideChar); cdecl; external libmgl; - -//void mgl_restore_once(HMPR p); -procedure mgl_restore_once(p: HMPR); cdecl; external libmgl; - -//void mgl_parser_allow_setsize(HMPR p, int a); -procedure mgl_parser_allow_setsize(p: HMPR; a: integer); cdecl; external libmgl; - - -//*****************************************************************************/ -//* Setup mglGraph */ -//*****************************************************************************/ -//void mgl_set_def_param(HMGL gr); -procedure mgl_set_def_param(graph: HMGL); cdecl; external libmgl; - -//void mgl_set_palette(HMGL gr, const char *colors); -procedure mgl_set_palette(graph: HMGL; colors: PChar); cdecl; external libmgl; - -//void mgl_set_pal_color(HMGL graph, int n, float r, float g, float b); -procedure mgl_set_pal_color(graph: HMGL; n: integer; r, g, b: single); cdecl; external libmgl; - -//void mgl_set_pal_num(HMGL graph, int num); -procedure mgl_set_pal_num(graph: HMGL; num: integer); cdecl; external libmgl; - -//void mgl_set_rotated_text(HMGL graph, int rotated); -procedure mgl_set_rotated_text(graph: HMGL; rotated: integer); cdecl; external libmgl; - -//void mgl_set_cut(HMGL graph, int cut); -procedure mgl_set_cut(graph: HMGL; cut: integer); cdecl; external libmgl; - -//void mgl_set_cut_box(HMGL gr, float x1,float y1,float z1,float x2,float y2,float z2); -procedure mgl_set_cut_box(gr: HMGL; x1, y1, z1, x2, y2, z2: single); cdecl; external libmgl; - -//void mgl_set_tick_len(HMGL graph, float len); -procedure mgl_set_tick_len(graph: HMGL; len: single); cdecl; external libmgl; - -//void mgl_set_bar_width(HMGL graph, float width); -procedure mgl_set_bar_width(graph: HMGL; width: single); cdecl; external libmgl; - -//void mgl_set_base_line_width(HMGL gr, float size); -procedure mgl_set_base_line_width(gr: HMGL; size: single); cdecl; external libmgl; - -//void mgl_set_mark_size(HMGL graph, float size); -procedure mgl_set_mark_size(graph: HMGL; size: single); cdecl; external libmgl; - -//void mgl_set_arrow_size(HMGL graph, float size); -procedure mgl_set_arrow_size(graph: HMGL; size: single); cdecl; external libmgl; - -//void mgl_set_font_size(HMGL graph, float size); -procedure mgl_set_font_size(graph: HMGL; size: single); cdecl; external libmgl; - -//void mgl_set_font_def(HMGL graph, const char *fnt); -procedure mgl_set_font_def(graph: HMGL; fnt: PChar); cdecl; external libmgl; - -//void mgl_set_alpha_default(HMGL graph, float alpha); -procedure mgl_set_alpha_default(graph: HMGL; alpha: single); cdecl; external libmgl; - -//void mgl_set_size(HMGL graph, int width, int height); -procedure mgl_set_size(graph: HMGL; width, height: integer); cdecl; external libmgl; - -//void mgl_set_axial_dir(HMGL graph, char dir); -procedure mgl_set_axial_dir(graph: HMGL; dir: char); cdecl; external libmgl; - -//void mgl_set_meshnum(HMGL graph, int num); -procedure mgl_set_meshnum(graph: HMGL; num: integer); cdecl; external libmgl; - -//void mgl_set_zoom(HMGL gr, float x1, float y1, float x2, float y2); -procedure mgl_set_zoom(gr: HMGL; x1, y1, x2, y2: single); cdecl; external libmgl; - -//void mgl_set_plotfactor(HMGL gr, float val); -procedure mgl_set_plotfactor(gr: HMGL; val: single); cdecl; external libmgl; - -//void mgl_set_draw_face(HMGL gr, int enable); -procedure mgl_set_draw_face(gr: HMGL; enable: integer); cdecl; external libmgl; - -//void mgl_set_scheme(HMGL gr, const char *sch); -procedure mgl_set_scheme(gr: HMGL; const sch: PChar); cdecl; external libmgl; - -//void mgl_load_font(HMGL gr, const char *name, const char *path); -procedure mgl_load_font(gr: HMGL; const name: PChar; const path: char); cdecl; external libmgl; - -//void mgl_copy_font(HMGL gr, HMGL gr_from); -procedure mgl_copy_font(gr, gr_from: HMGL); cdecl; external libmgl; - -//void mgl_restore_font(HMGL gr); -procedure mgl_restore_font(gr: HMGL); cdecl; external libmgl; - -//*****************************************************************************/ -//* Export to file or to memory */ -//*****************************************************************************/ -//void mgl_show_image(HMGL graph, const char *viewer, int keep); -procedure mgl_show_image(graph: HMGL; const viewer: PChar; keep: integer); cdecl; external libmgl; - -//void mgl_write_frame(HMGL graph, const char *fname,const char *descr); -procedure mgl_write_frame(graph: HMGL; const fname: PChar; const descr: PChar); cdecl; external libmgl; - -//void mgl_write_bmp(HMGL graph, const char *fname,const char *descr); -procedure mgl_write_bmp(graph: HMGL; const fname: PChar; const descr: PChar); cdecl; external libmgl; - -//void mgl_write_jpg(HMGL graph, const char *fname,const char *descr); -procedure mgl_write_jpg(graph: HMGL; const fname: PChar; const descr: PChar); cdecl; external libmgl; - -//void mgl_write_png(HMGL graph, const char *fname,const char *descr); -procedure mgl_write_png(graph: HMGL; const fname: PChar; const descr: PChar); cdecl; external libmgl; - -//void mgl_write_png_solid(HMGL graph, const char *fname,const char *descr); -procedure mgl_write_png_solid(graph: HMGL; const fname: PChar; const descr: PChar); cdecl; external libmgl; - -//void mgl_write_eps(HMGL graph, const char *fname,const char *descr); -procedure mgl_write_eps(graph: HMGL; const fname: PChar; const descr: PChar); cdecl; external libmgl; - -//void mgl_write_svg(HMGL graph, const char *fname,const char *descr); -procedure mgl_write_svg(graph: HMGL; const fname: PChar; const descr: PChar); cdecl; external libmgl; - -//void mgl_write_idtf(HMGL graph, const char *fname,const char *descr); -procedure mgl_write_idtf(graph: HMGL; const fname: PChar; const descr: PChar); cdecl; external libmgl; - -//void mgl_write_gif(HMGL graph, const char *fname,const char *descr); -procedure mgl_write_gif(graph: HMGL; const fname: PChar; const descr: PChar); cdecl; external libmgl; - -//void mgl_start_gif(HMGL graph, const char *fname,int ms); -procedure mgl_start_gif(graph: HMGL; const fname: PChar; ms: integer); cdecl; external libmgl; - -//void mgl_close_gif(HMGL graph); -procedure mgl_close_gif(graph: HMGL); cdecl; external libmgl; - -//const unsigned char *mgl_get_rgb(HMGL graph); -function mgl_get_rgb(graph: HMGL): PByte; cdecl; external libmgl; - -//const unsigned char *mgl_get_rgba(HMGL graph); -function mgl_get_rgba(graph: HMGL): PByte; cdecl; external libmgl; - -//int mgl_get_width(HMGL graph); -function mgl_get_width(graph: HMGL): integer; cdecl; external libmgl; - -//int mgl_get_height(HMGL graph); -function mgl_get_height(graph: HMGL): integer; cdecl; external libmgl; - -//*****************************************************************************/ -//* Setup frames transparency (alpha) and lightning */ -//*****************************************************************************/ -//int mgl_new_frame(HMGL graph); -function mgl_new_frame(graph: HMGL): integer; cdecl; external libmgl; - -//void mgl_end_frame(HMGL graph); -procedure mgl_end_frame(graph: HMGL); cdecl; external libmgl; - -//int mgl_get_num_frame(HMGL graph); -function mgl_get_num_frame(graph: HMGL): integer; cdecl; external libmgl; - -//void mgl_reset_frames(HMGL graph); -procedure mgl_reset_frames(graph: HMGL); cdecl; external libmgl; - -//void mgl_set_transp_type(HMGL graph, int type); -procedure mgl_set_transp_type(graph: HMGL; ttype: integer); cdecl; external libmgl; - -//void mgl_set_transp(HMGL graph, int enable); -procedure mgl_set_transp(graph: HMGL; enable: integer); cdecl; external libmgl; - -//void mgl_set_alpha(HMGL graph, int enable); -procedure mgl_set_alpha(graph: HMGL; enable: integer); cdecl; external libmgl; - -//void mgl_set_fog(HMGL graph, float d, float dz); -procedure mgl_set_fog(graph: HMGL; d, dz: single); cdecl; external libmgl; - -//void mgl_set_light(HMGL graph, int enable); -procedure mgl_set_light(graph: HMGL; enable: integer); cdecl; external libmgl; - -//void mgl_set_light_n(HMGL gr, int n, int enable); -procedure mgl_set_light_n(graph: HMGL; n: integer; enable: integer); cdecl; external libmgl; - -//void mgl_add_light(HMGL graph, int n, float x, float y, float z, char c); -procedure mgl_add_light(graph: HMGL; n: integer; x, y, z: single; c: char); cdecl; external libmgl; - -//void mgl_add_light_rgb(HMGL graph, int n, float x, float y, float z, int infty, float r, float g, float b, float i); -procedure mgl_add_light_rgb(graph: HMGL; n: integer; x, y, z: single; infty: integer; r, g, b, i: single); cdecl; external libmgl; - -//void mgl_set_ambbr(HMGL gr, float i); -procedure mgl_set_ambbr(graph: HMGL; i: single); cdecl; external libmgl; - -//*****************************************************************************/ -//* Scale and rotate */ -//*****************************************************************************/ -//void mgl_identity(HMGL graph); -procedure mgl_identity(graph: HMGL); cdecl; external libmgl; - -//void mgl_clf(HMGL graph); -procedure mgl_clf(graph: HMGL); cdecl; external libmgl; - -//void mgl_flush(HMGL gr); -procedure mgl_flush(gr: HMGL); cdecl; external libmgl; - -//void mgl_clf_rgb(HMGL graph, float r, float g, float b); -procedure mgl_clf_rgb(graph: HMGL; r, g, b: single); cdecl; external libmgl; - -//void mgl_subplot(HMGL graph, int nx,int ny,int m); -procedure mgl_subplot(graph: HMGL; nx, ny, m: integer); cdecl; external libmgl; - -//void mgl_subplot_d(HMGL graph, int nx,int ny,int m, float dx, float dy); -procedure mgl_subplot_d(graph: HMGL; nx, ny, m: integer; dx, dy: single); cdecl; external libmgl; - -//void mgl_inplot(HMGL graph, float x1,float x2,float y1,float y2); -procedure mgl_inplot(graph: HMGL; x1, x2, y1, y2: single); cdecl; external libmgl; - -//void mgl_relplot(HMGL graph, float x1,float x2,float y1,float y2); -procedure mgl_relplot(graph: HMGL; x1, x2, y1, y2: single); cdecl; external libmgl; - -//void mgl_columnplot(HMGL graph, int num, int ind); -procedure mgl_columnplot(graph: HMGL; num, ind: integer); cdecl; external libmgl; - -//void mgl_aspect(HMGL graph, float Ax,float Ay,float Az); -procedure mgl_aspect(graph: HMGL; Ax, Ay, Az: single); cdecl; external libmgl; - -//void mgl_rotate(HMGL graph, float TetX,float TetZ,float TetY); -procedure mgl_rotate(graph: HMGL; TetX, TetZ, TetY: single); cdecl; external libmgl; - -//void mgl_rotate_vector(HMGL graph, float Tet,float x,float y,float z); -procedure mgl_rotate_vector(graph: HMGL; Tet, x, y, z: single); cdecl; external libmgl; - -//void mgl_perspective(HMGL graph, float val); -procedure mgl_perspective(graph: HMGL; val: single); cdecl; external libmgl; - -//*****************************************************************************/ -//* Axis functions */ -//*****************************************************************************/ -//void mgl_set_ticks(HMGL graph, float DX, float DY, float DZ); -procedure mgl_set_ticks(graph: HMGL; DX, DY, DZ: single); cdecl; external libmgl; - -//void mgl_set_subticks(HMGL graph, int NX, int NY, int NZ); -procedure mgl_set_subticks(graph: HMGL; NX, NY, NZ: integer); cdecl; external libmgl; - -//void mgl_set_ticks_dir(HMGL graph, char dir, float d, int ns, float org); -procedure mgl_set_ticks_dir(graph: HMGL; dir: char; d: single; ns: integer; org:single); cdecl; external libmgl; - -//void mgl_set_ticks_val(HMGL graph, char dir, int n, double val, const char *lbl, ...); -// oops.. variadic paramerers functions are not supported - -//void mgl_set_ticks_vals(HMGL graph, char dir, int n, float *val, const char **lbl); -procedure mgl_set_ticks_vals(graph: HMGL; dir: char; n: integer; val: PSingle; lbl: PChar); cdecl; external libmgl; - -//void mgl_set_caxis(HMGL graph, float C1,float C2); -procedure mgl_set_caxis(graph: HMGL; C1, C2: single); cdecl; external libmgl; - -//void mgl_set_axis(HMGL graph, float x1, float y1, float z1, float x2, float y2, float z2, float x0, float y0, float z0); -procedure mgl_set_axis(graph: HMGL; x1, y1, z1, x2, y2, z2, x0, y0, z0: single); cdecl; external libmgl; - -//void mgl_set_axis_3d(HMGL graph, float x1, float y1, float z1, float x2, float y2, float z2); -procedure mgl_set_axis_3d(graph: HMGL; x1, y1, z1, x2, y2, z2: single); cdecl; external libmgl; - -//void mgl_set_axis_2d(HMGL graph, float x1, float y1, float x2, float y2); -procedure mgl_set_axis_2d(graph: HMGL; x1, y1, x2, y2: single); cdecl; external libmgl; - -//void mgl_set_origin(HMGL graph, float x0, float y0, float z0); -procedure mgl_set_origin(graph: HMGL; x0, y0, z0: single); cdecl; external libmgl; - -//void mgl_set_tick_origin(HMGL graph, float x0, float y0, float z0); -procedure mgl_set_tick_origin(graph: HMGL; x0, y0, z0: single); cdecl; external libmgl; - -//void mgl_set_crange(HMGL graph, const HMDT a, int add); -procedure mgl_set_crange(graph: HMGL; const a: HMDT; add: integer); cdecl; external libmgl; - -//void mgl_set_xrange(HMGL graph, const HMDT a, int add); -procedure mgl_set_xrange(graph: HMGL; const a: HMDT; add: integer); cdecl; external libmgl; - -//void mgl_set_yrange(HMGL graph, const HMDT a, int add); -procedure mgl_set_yrange(graph: HMGL; const a: HMDT; add: integer); cdecl; external libmgl; - -//void mgl_set_zrange(HMGL graph, const HMDT a, int add); -procedure mgl_set_zrange(graph: HMGL; const a: HMDT; add: integer); cdecl; external libmgl; - -//void mgl_set_auto(HMGL graph, float x1, float x2, float y1, float y2, float z1, float z2); -procedure mgl_set_auto(graph: HMGL; x1, x2, y1, y2, z1, z2: single); cdecl; external libmgl; - -//void mgl_set_func(HMGL graph, const char *EqX,const char *EqY,const char *EqZ); -procedure mgl_set_func(graph: HMGL; const EqX: PChar; const EqY: PChar; const EqZ: PChar); cdecl; external libmgl; - -//void mgl_set_ternary(HMGL gr, int enable); -procedure mgl_set_ternary(graph: HMGL; enable: integer); cdecl; external libmgl; - -//void mgl_set_cutoff(HMGL graph, const char *EqC); -procedure mgl_set_cutoff(graph: HMGL; const EqC: PChar); cdecl; external libmgl; - -//void mgl_box(HMGL graph, int ticks); -procedure mgl_box(graph: HMGL; ticks: integer); cdecl; external libmgl; - -//void mgl_box_str(HMGL graph, const char *col, int ticks); -procedure mgl_box_str(graph: HMGL; const col: PChar; ticks: integer); cdecl; external libmgl; - -//void mgl_box_rgb(HMGL graph, float r, float g, float b, int ticks); -procedure mgl_box_rgb(graph: HMGL; r, g, b: single; ticks: integer); cdecl; external libmgl; - -//void mgl_axis(HMGL graph, const char *dir); -procedure mgl_axis(graph: HMGL; const dir: PChar); cdecl; external libmgl; - -//void mgl_axis_grid(HMGL graph, const char *dir,const char *pen); -procedure mgl_axis_grid(graph: HMGL; const dir: PChar; const pen: PChar); cdecl; external libmgl; - -//void mgl_label(HMGL graph, char dir, const char *text); -procedure mgl_label(graph: HMGL; dir: char; const text: PChar); cdecl; external libmgl; - -//void mgl_label_ext(HMGL graph, char dir, const char *text, int pos, float size, float shift); -procedure mgl_label_ext(graph: HMGL; dir: char; const text: PChar; pos: integer; size: single; shift: single); cdecl; external libmgl; - -//void mgl_tune_ticks(HMGL graph, int tune, float fact_pos); -procedure mgl_tune_ticks(graph: HMGL; tune: integer; fact_pos: single); cdecl; external libmgl; - -//void mgl_set_xttw(HMGL graph, const wchar_t *templ); -procedure mgl_set_xttw(graph: HMGL; const templ: PWideChar); cdecl; external libmgl; - -//void mgl_set_yttw(HMGL graph, const wchar_t *templ); -procedure mgl_set_yttw(graph: HMGL; const templ: PWideChar); cdecl; external libmgl; - -//void mgl_set_zttw(HMGL graph, const wchar_t *templ); -procedure mgl_set_zttw(graph: HMGL; const templ: PWideChar); cdecl; external libmgl; - -//void mgl_set_cttw(HMGL graph, const wchar_t *templ); -procedure mgl_set_cttw(graph: HMGL; const templ: PWideChar); cdecl; external libmgl; - -//void mgl_set_xtt(HMGL graph, const char *templ); -procedure mgl_set_xtt(graph: HMGL; const templ: PChar); cdecl; external libmgl; - -//void mgl_set_ytt(HMGL graph, const char *templ); -procedure mgl_set_ytt(graph: HMGL; const templ: PChar); cdecl; external libmgl; - -//void mgl_set_ztt(HMGL graph, const char *templ); -procedure mgl_set_ztt(graph: HMGL; const templ: PChar); cdecl; external libmgl; - -//void mgl_set_ctt(HMGL graph, const char *templ); -procedure mgl_set_ctt(graph: HMGL; const templ: PChar); cdecl; external libmgl; - -//*****************************************************************************/ -//* Simple drawing */ -//*****************************************************************************/ -//void mgl_ball(HMGL graph, float x,float y,float z); -procedure mgl_ball(graph: HMGL; x, y, z: single); cdecl; external libmgl; - -//void mgl_ball_rgb(HMGL graph, float x, float y, float z, float r, float g, float b, float alpha); -procedure mgl_ball_rgb(graph: HMGL; x, y, z, r, g, b, alpha: single); cdecl; external libmgl; - -//void mgl_ball_str(HMGL graph, float x, float y, float z, const char *col); -procedure mgl_ball_str(graph: HMGL; x, y, z: single; const col: PChar); cdecl; external libmgl; - -//void mgl_line(HMGL graph, float x1, float y1, float z1, float x2, float y2, float z2, const char *pen,int n); -procedure mgl_line(graph: HMGL; x1, y1, z1, x2, y2, z2: single; const pen: PChar; n: integer); cdecl; external libmgl; - -//void mgl_facex(HMGL graph, float x0, float y0, float z0, float wy, float wz, const char *stl, float dx, float dy); -procedure mgl_facex(graph: HMGL; x0, y0, z0, wy, wz: single; const stl: PChar; dx, dy: single); cdecl; external libmgl; - -//void mgl_facey(HMGL graph, float x0, float y0, float z0, float wx, float wz, const char *stl, float dx, float dy); -procedure mgl_facey(graph: HMGL; x0, y0, z0, wx, wz: single; const stl: PChar; dx, dy: single); cdecl; external libmgl; - -//void mgl_facez(HMGL graph, float x0, float y0, float z0, float wx, float wy, const char *stl, float dx, float dy); -procedure mgl_facez(graph: HMGL; x0, y0, z0, wx, wy: single; const stl: PChar; dx, dy: single); cdecl; external libmgl; - -//void mgl_curve(HMGL graph, float x1, float y1, float z1, float dx1, float dy1, float dz1, float x2, float y2, float z2, float dx2, float dy2, float dz2, const char *pen,int n); -procedure mgl_curve(graph: HMGL; x1, y1, z1, dx1, dy1, dz1, x2, y2, z2, dx2, dy2, dz2: single; const pen: PChar; n: integer); cdecl; external libmgl; - -//void mgl_puts(HMGL graph, float x, float y, float z,const char *text); -procedure mgl_puts(graph: HMGL; x, y, z: single; const text: PChar); cdecl; external libmgl; - -//void mgl_putsw(HMGL graph, float x, float y, float z,const wchar_t *text); -procedure mgl_putsw(graph: HMGL; x, y, z: single; const text: PWideChar); cdecl; external libmgl; - -//void mgl_puts_dir(HMGL graph, float x, float y, float z, float dx, float dy, float dz, const char *text, float size); -procedure mgl_puts_dir(graph: HMGL; x, y, z, dx, dy, dz: single; const text: PChar; size: single); cdecl; external libmgl; - -//void mgl_putsw_dir(HMGL graph, float x, float y, float z, float dx, float dy, float dz, const wchar_t *text, float size); -procedure mgl_putsw_dir(graph: HMGL; x, y, z, dx, dy, dz: single; const text: PWideChar; size: single); cdecl; external libmgl; - -//void mgl_text(HMGL graph, float x, float y, float z,const char *text); -procedure mgl_text(graph: HMGL; x, y, z: single; const text: PChar); cdecl; external libmgl; - -//void mgl_title(HMGL graph, const char *text, const char *fnt, float size); -procedure mgl_title(graph: HMGL; const text: PChar; const fnt: PChar; size: single); cdecl; external libmgl; - -//void mgl_titlew(HMGL graph, const wchar_t *text, const char *fnt, float size); -procedure mgl_titlew(graph: HMGL; const text: PWideChar; const fnt: PChar; size: single); cdecl; external libmgl; - -//void mgl_putsw_ext(HMGL graph, float x, float y, float z,const wchar_t *text,const char *font,float size,char dir); -procedure mgl_putsw_ext(graph: HMGL; x, y, z: single; const text: PWideChar; const font: PChar; size: single; dir: char); cdecl; external libmgl; - -//void mgl_puts_ext(HMGL graph, float x, float y, float z,const char *text,const char *font,float size,char dir); -procedure mgl_puts_ext(graph: HMGL; x, y, z: single; const text: PChar; const font: PChar; size: single; dir: char); cdecl; external libmgl; - -//void mgl_text_ext(HMGL graph, float x, float y, float z,const char *text,const char *font,float size,char dir); -procedure mgl_text_ext(graph: HMGL; x, y, z: single; const text: PChar; const font: PChar; size: single; dir: char); cdecl; external libmgl; - -//void mgl_colorbar(HMGL graph, const char *sch,int where); -procedure mgl_colorbar(graph: HMGL; const sch: PCHar; where: integer); cdecl; external libmgl; - -//void mgl_colorbar_ext(HMGL graph, const char *sch, int where, float x, float y, float w, float h); -procedure mgl_colorbar_ext(graph: HMGL; const sch: PCHar; where: integer; x, y, w, h: single); cdecl; external libmgl; - -//void mgl_simple_plot(HMGL graph, const HMDT a, int type, const char *stl); -procedure mgl_simple_plot(graph: HMGL; const a: HMDT; ttype: integer; stl: PChar); cdecl; external libmgl; - -//void mgl_add_legend(HMGL graph, const char *text,const char *style); -procedure mgl_add_legend(graph: HMGL; const text: PChar; const style: PChar); cdecl; external libmgl; - -//void mgl_add_legendw(HMGL graph, const wchar_t *text,const char *style); -procedure mgl_add_legendw(graph: HMGL; const text: PWideChar; const style: PChar); cdecl; external libmgl; - -//void mgl_clear_legend(HMGL graph); -procedure mgl_clear_legend(graph: HMGL); cdecl; external libmgl; - -//void mgl_legend_xy(HMGL graph, float x, float y, const char *font, float size, float llen); -procedure mgl_legend_xy(graph: HMGL; x, y: single; const font: PChar; size: single; llen: single); cdecl; external libmgl; - -//void mgl_legend(HMGL graph, int where, const char *font, float size, float llen); -procedure mgl_legend(graph: HMGL; where: integer; const font: PChar; size: single; llen: single); cdecl; external libmgl; - -//void mgl_set_legend_box(HMGL gr, int enable); -procedure mgl_set_legend_box(graph: HMGL; enable: integer); cdecl; external libmgl; - -//*****************************************************************************/ -//* 1D plotting functions */ -//*****************************************************************************/ -//void mgl_fplot(HMGL graph, const char *fy, const char *stl, int n); -procedure mgl_fplot(graph: HMGL; const fy: PChar; const pen: PChar; n: integer); cdecl; external libmgl; - -//void mgl_fplot_xyz(HMGL graph, const char *fx, const char *fy, const char *fz, const char *stl, int n); -procedure mgl_fplot_xyz(graph: HMGL; const fx: PChar; const fy: PChar; const fz: PChar; const pen: PChar; n: integer); cdecl; external libmgl; - -//void mgl_plot_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *pen); -procedure mgl_plot_xyz(graph: HMGL; const x, y, z: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_plot_xy(HMGL graph, const HMDT x, const HMDT y, const char *pen); -procedure mgl_plot_xy(graph: HMGL; const x, y: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_plot(HMGL graph, const HMDT y, const char *pen); -procedure mgl_plot(graph: HMGL; const y: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_plot_2(HMGL graph, const HMDT a, const char *pen); -procedure mgl_plot_2(graph: HMGL; const a: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_plot_3(HMGL graph, const HMDT a, const char *pen); -procedure mgl_plot_3(graph: HMGL; const a: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_tens_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *pen); -procedure mgl_tens_xyz(graph: HMGL; const x, y, z, c: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_tens_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT c, const char *pen); -procedure mgl_tens_xy(graph: HMGL; const x, y, c: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_tens(HMGL graph, const HMDT y, const HMDT c, const char *pen); -procedure mgl_tens(graph: HMGL; const y, c: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_area_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *pen); -procedure mgl_area_xyz(graph: HMGL; const x, y, z: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_area_xy(HMGL graph, const HMDT x, const HMDT y, const char *pen); -procedure mgl_area_xy(graph: HMGL; const x, y: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_area_xys(HMGL graph, const HMDT x, const HMDT y, const char *pen); -procedure mgl_area_xys(graph: HMGL; const x, y: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_area(HMGL graph, const HMDT y, const char *pen); -procedure mgl_area(graph: HMGL; const y: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_area_2(HMGL graph, const HMDT a, const char *pen); -procedure mgl_area_2(graph: HMGL; const a: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_area_3(HMGL graph, const HMDT a, const char *pen); -procedure mgl_area_3(graph: HMGL; const a: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_region_xy(HMGL graph, const HMDT x, const HMDT y1, const HMDT y2, const char *pen, int inside); -procedure mgl_region_xy(graph: HMGL; x, y1, y2: HMDT; const pen: PChar; inside: integer); cdecl; external libmgl; - -//void mgl_region(HMGL graph, const HMDT y1, const HMDT y2, const char *pen, int inside); -procedure mgl_region(graph: HMGL; y1, y2: HMDT; const pen: PChar; inside: integer); cdecl; external libmgl; - -//void mgl_mark(HMGL graph, float x,float y,float z,char mark); -procedure mgl_mark(graph: HMGL; x, y, z: single; mark: char); cdecl; external libmgl; - -//void mgl_stem_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *pen); -procedure mgl_stem_xyz(graph: HMGL; const x, y, z: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_stem_xy(HMGL graph, const HMDT x, const HMDT y, const char *pen); -procedure mgl_stem_xy(graph: HMGL; const x, y: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_stem(HMGL graph, const HMDT y, const char *pen); -procedure mgl_stem(graph: HMGL; const y: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_stem_2(HMGL graph, const HMDT a, const char *pen); -procedure mgl_stem_2(graph: HMGL; const a: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_stem_3(HMGL graph, const HMDT a, const char *pen); -procedure mgl_stem_3(graph: HMGL; const a: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_step_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *pen); -procedure mgl_step_xyz(graph: HMGL; const x, y, z: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_step_xy(HMGL graph, const HMDT x, const HMDT y, const char *pen); -procedure mgl_step_xy(graph: HMGL; const x, y: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_step(HMGL graph, const HMDT y, const char *pen); -procedure mgl_step(graph: HMGL; const y: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_step_2(HMGL graph, const HMDT a, const char *pen); -procedure mgl_step_2(graph: HMGL; const a: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_step_3(HMGL graph, const HMDT a, const char *pen); -procedure mgl_step_3(graph: HMGL; const a: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_bars_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *pen); -procedure mgl_bars_xyz(graph: HMGL; const x, y, z: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_bars_xy(HMGL graph, const HMDT x, const HMDT y, const char *pen); -procedure mgl_bars_xy(graph: HMGL; const x, y: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_bars(HMGL graph, const HMDT y, const char *pen); -procedure mgl_bars(graph: HMGL; const y: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_bars_2(HMGL graph, const HMDT a, const char *pen); -procedure mgl_bars_2(graph: HMGL; const a: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_bars_3(HMGL graph, const HMDT a, const char *pen); -procedure mgl_bars_3(graph: HMGL; const a: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_barh_xy(HMGL graph, const HMDT x, const HMDT y, const char *pen); -procedure mgl_barh_xy(graph: HMGL; const x, y: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_barh_yx(HMGL graph, const HMDT y, const HMDT v, const char *pen); -procedure mgl_barh_yx(graph: HMGL; const y, v: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_barh(HMGL graph, const HMDT v, const char *pen); -procedure mgl_barh(graph: HMGL; const v: HMDT; const pen: PChar); cdecl; external libmgl; - -//*****************************************************************************/ -//* Advanced 1D plotting functions */ -//*****************************************************************************/ -//void mgl_torus(HMGL graph, const HMDT r, const HMDT z, const char *pen); -procedure mgl_torus(graph: HMGL; const r, z: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_torus_2(HMGL graph, const HMDT a, const char *pen); -procedure mgl_torus_2(graph: HMGL; const a: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_text_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z,const char *text, const char *font, float size); -procedure mgl_text_xyz(graph: HMGL; const x, y, z: HMDT; const text: PChar; const font: PChar; size: single); cdecl; external libmgl; - -//void mgl_text_xy(HMGL graph, const HMDT x, const HMDT y, const char *text, const char *font, float size); -procedure mgl_text_xy(graph: HMGL; const x, y: HMDT; const text: PChar; const font: PChar; size: single); cdecl; external libmgl; - -//void mgl_text_y(HMGL graph, const HMDT y, const char *text, const char *font, float size); -procedure mgl_text_y(graph: HMGL; const y: HMDT; const text: PChar; const font: PChar; size: single); cdecl; external libmgl; - -//void mgl_chart(HMGL graph, const HMDT a, const char *col); -procedure mgl_chart(graph: HMGL; const a: HMDT; const col: PChar); cdecl; external libmgl; - -//void mgl_error(HMGL graph, const HMDT y, const HMDT ey, const char *pen); -procedure mgl_error(graph: HMGL; const y, ey: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_error_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT ey, const char *pen); -procedure mgl_error_xy(graph: HMGL; const x, y, ey: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_error_exy(HMGL graph, const HMDT x, const HMDT y, const HMDT ex, const HMDT ey, const char *pen); -procedure mgl_error_exy(graph: HMGL; const x, y, ex, ey: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_mark_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT r, const char *pen); -procedure mgl_mark_xyz(graph: HMGL; const x, y, z, r: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_mark_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT r, const char *pen); -procedure mgl_mark_xy(graph: HMGL; const x, y, z: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_mark_y(HMGL graph, const HMDT y, const HMDT r, const char *pen); -procedure mgl_mark_y(graph: HMGL; const y, r: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_tube_xyzr(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT r, const char *pen); -procedure mgl_tube_xyzr(graph: HMGL; const x, y, z, r: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_tube_xyr(HMGL graph, const HMDT x, const HMDT y, const HMDT r, const char *pen); -procedure mgl_tube_xyr(graph: HMGL; const x, y, r: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_tube_r(HMGL graph, const HMDT y, const HMDT r, const char *pen); -procedure mgl_tube_r(graph: HMGL; const y, r: HMDT; const pen: PChar); cdecl; external libmgl; - -//void mgl_tube_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, float r, const char *pen); -procedure mgl_tube_xyz(graph: HMGL; const x, y, z: HMDT; r: single; const pen: PChar); cdecl; external libmgl; - -//void mgl_tube_xy(HMGL graph, const HMDT x, const HMDT y, float r, const char *penl); -procedure mgl_tube_xy(graph: HMGL; const x, y: HMDT; r: single; const penl: PChar); cdecl; external libmgl; - -//void mgl_tube(HMGL graph, const HMDT y, float r, const char *pen); -procedure mgl_tube(graph: HMGL; const y: HMDT; r: single; const pen: PChar); cdecl; external libmgl; - - -//void mgl_textmark_xyzr(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT r, const char *text, const char *fnt); -procedure mgl_textmark_xyzr(graph: HMGL; const x, y, z, r: HMDT; const text: PChar; const fnt: PChar); cdecl; external libmgl; - -//void mgl_textmark_xyr(HMGL graph, const HMDT x, const HMDT y, const HMDT r, const char *text, const char *fnt); -procedure mgl_textmark_xyr(graph: HMGL; const x, y, r: HMDT; const text: PChar; const fnt: PChar); cdecl; external libmgl; - -//void mgl_textmark_yr(HMGL graph, const HMDT y, const HMDT r, const char *text, const char *fnt); -procedure mgl_textmark_yr(graph: HMGL; const y, r: HMDT; const text: PChar; const fnt: PChar); cdecl; external libmgl; - -//void mgl_textmark(HMGL graph, const HMDT y, const char *text, const char *fnt); -procedure mgl_textmark(graph: HMGL; const y: HMDT; const text: PChar; const fnt: PChar); cdecl; external libmgl; - -//void mgl_textmarkw_xyzr(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT r, const wchar_t *text, const char *fnt); -procedure mgl_textmarkw_xyzr(graph: HMGL; const x, y, z, r: HMDT; const text: PWideChar; const fnt: PChar); cdecl; external libmgl; - -//void mgl_textmarkw_xyr(HMGL graph, const HMDT x, const HMDT y, const HMDT r, const wchar_t *text, const char *fnt); -procedure mgl_textmarkw_xyr(graph: HMGL; const x, y, r: HMDT; const text: PWideChar; const fnt: PChar); cdecl; external libmgl; - -//void mgl_textmarkw_yr(HMGL graph, const HMDT y, const HMDT r, const wchar_t *text, const char *fnt); -procedure mgl_textmarkw_yr(graph: HMGL; const y, r: HMDT; const text: PWideChar; const fnt: PChar); cdecl; external libmgl; - -//void mgl_textmarkw(HMGL graph, const HMDT y, const wchar_t *text, const char *fnt); -procedure mgl_textmarkw(graph: HMGL; const y: HMDT; const text: PWideChar; const fnt: PChar); cdecl; external libmgl; - -//*****************************************************************************/ -//* 2D plotting functions */ -//*****************************************************************************/ -//void mgl_fsurf(HMGL graph, const char *fz, const char *stl, int n); -procedure mgl_fsurf(graph: HMGL; const fz: PChar; const stl: PChar; n: integer); cdecl; external libmgl; - -//void mgl_fsurf_xyz(HMGL graph, const char *fx, const char *fy, const char *fz, const char *stl, int n); -procedure mgl_fsurf_xyz(graph: HMGL; const fx: PChar; const fy: PChar; const fz: PChar; const stl: PChar; n: integer); cdecl; external libmgl; - -//void mgl_grid_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *stl,float zVal); -procedure mgl_grid_xy(graph: HMGL; const x, y, z: HMDT; const stl: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_grid(HMGL graph, const HMDT a,const char *stl,float zVal); -procedure mgl_grid(const graph: HMGL; a: HMDT; const stl: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_mesh_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch); -procedure mgl_mesh_xy(graph: HMGL; const x, y, z: HMDT; const stl: PChar); cdecl; external libmgl; - -//void mgl_mesh(HMGL graph, const HMDT z, const char *sch); -procedure mgl_mesh(graph: HMGL; const z: HMDT; const stl: PChar); cdecl; external libmgl; - -//void mgl_fall_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch); -procedure mgl_fall_xy(graph: HMGL; const x, y, z: HMDT; const stl: PChar); cdecl; external libmgl; - -//void mgl_fall(HMGL graph, const HMDT z, const char *sch); -procedure mgl_fall(graph: HMGL; const z: HMDT; const stl: PChar); cdecl; external libmgl; - -//void mgl_belt_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch); -procedure mgl_belt_xy(graph: HMGL; const x, y, z: HMDT; const stl: PChar); cdecl; external libmgl; - -//void mgl_belt(HMGL graph, const HMDT z, const char *sch); -procedure mgl_belt(graph: HMGL; const z: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_surf_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch); -procedure mgl_surf_xy(graph: HMGL; const x, y, z: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_surf(HMGL graph, const HMDT z, const char *sch); -procedure mgl_surf(graph: HMGL; const z: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_dens_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch,float zVal); -procedure mgl_dens_xy(graph: HMGL; const x, y, z: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_dens(HMGL graph, const HMDT z, const char *sch,float zVal); -procedure mgl_dens(graph: HMGL; const z: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_boxs_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch,float zVal); -procedure mgl_boxs_xy(graph: HMGL; const x, y, z: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_boxs(HMGL graph, const HMDT z, const char *sch,float zVal); -procedure mgl_boxs(graph: HMGL; const z: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_tile_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch); -procedure mgl_tile_xy(graph: HMGL; const x, y, z: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_tile(HMGL graph, const HMDT z, const char *sch); -procedure mgl_tile(graph: HMGL; const z: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_tiles_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT r, const char *sch); -procedure mgl_tiles_xy(graph: HMGL; const x, y, z, r: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_tiles(HMGL graph, const HMDT z, const HMDT r, const char *sch); -procedure mgl_tiles(graph: HMGL; const z, r: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_cont_xy_val(HMGL graph, const HMDT v, const HMDT x, const HMDT y, const HMDT z, const char *sch, float zVal); -procedure mgl_cont_xy_val(graph: HMGL; const v, x, y, z: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_cont_val(HMGL graph, const HMDT v, const HMDT z, const char *sch,float zVal); -procedure mgl_cont_val(graph: HMGL; const v, z: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_cont_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch, int Num, float zVal); -procedure mgl_cont_xy(graph: HMGL; const x, y, z: HMDT; const sch: PChar; Num: integer; zVal: single); cdecl; external libmgl; - -//void mgl_cont(HMGL graph, const HMDT z, const char *sch, int Num, float zVal); -procedure mgl_cont(graph: HMGL; const z: HMDT; const sch: PChar; Num: integer; zVal: single); cdecl; external libmgl; - -//void mgl_contf_xy_val(HMGL graph, const HMDT v, const HMDT x, const HMDT y, const HMDT z, const char *sch, float zVal); -procedure mgl_contf_xy_val(graph: HMGL; const v, x, y, z: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_contf_val(HMGL graph, const HMDT v, const HMDT z, const char *sch,float zVal); -procedure mgl_contf_val(graph: HMGL; const v, z: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_contf_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const char *sch, int Num, float zVal); -procedure mgl_contf_xy(graph: HMGL; const x, y, z: HMDT; const sch: PChar; Num: integer; zVal: single); cdecl; external libmgl; - -//void mgl_contf(HMGL graph, const HMDT z, const char *sch, int Num, float zVal); -procedure mgl_contf(graph: HMGL; const z: HMDT; const sch: PChar; Num: integer; zVal: single); cdecl; external libmgl; - -//void mgl_axial_xy_val(HMGL graph, const HMDT v, const HMDT x, const HMDT y, const HMDT a, const char *sch); -procedure mgl_axial_xy_val(graph: HMGL; const v, x, y, a: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_axial_val(HMGL graph, const HMDT v, const HMDT a, const char *sch); -procedure mgl_axial_val(graph: HMGL; const v, a: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_axial_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT a, const char *sch, int Num); -procedure mgl_axial_xy(graph: HMGL; const x, y, a: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_axial(HMGL graph, const HMDT a, const char *sch, int Num); -procedure mgl_axial(graph: HMGL; const a: HMDT; const sch: PChar; Num: integer); cdecl; external libmgl; - -//*****************************************************************************/ -//* Dual plotting functions */ -//*****************************************************************************/ -//void mgl_surfc_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *sch); -procedure mgl_surfc_xy(graph: HMGL; const x, y, z, c: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_surfc(HMGL graph, const HMDT z, const HMDT c, const char *sch); -procedure mgl_surfc(graph: HMGL; const z, c: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_surfa_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *sch); -procedure mgl_surfa_xy(graph: HMGL; const x, y, z, c: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_surfa(HMGL graph, const HMDT z, const HMDT c, const char *sch); -procedure mgl_surfa(graph: HMGL; const z, c: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_stfa_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT re, const HMDT im, int dn, const char *sch, float zVal); -procedure mgl_stfa_xy(graph: HMGL; const x, y, re, im: HMDT; dn: integer; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_stfa(HMGL graph, const HMDT re, const HMDT im, int dn, const char *sch, float zVal); -procedure mgl_stfa(graph: HMGL; const re, im: HMDT; dn: integer; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_vect_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch,float zVal); -procedure mgl_vect_xy(graph: HMGL; const x, y, z, ax, ay: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_vect_2d(HMGL graph, const HMDT ax, const HMDT ay, const char *sch,float zVal); -procedure mgl_vect_2d(graph: HMGL; const ax, ay: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_vectl_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch,float zVal); -procedure mgl_vectl_xy(graph: HMGL; const x, y, z, ax, ay: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_vectl_2d(HMGL graph, const HMDT ax, const HMDT ay, const char *sch,float zVal); -procedure mgl_vectl_2d(graph: HMGL; const ax, ay: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_vectc_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch,float zVal); -procedure mgl_vectc_xy(graph: HMGL; const x, y, ax, ay: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_vectc_2d(HMGL graph, const HMDT ax, const HMDT ay, const char *sch,float zVal); -procedure mgl_vectc_2d(graph: HMGL; const ax, ay: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_vect_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch); -procedure mgl_vect_xyz(graph: HMGL; const x, y, z, ax, ay, az: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_vect_3d(HMGL graph, const HMDT ax, const HMDT ay, const HMDT az, const char *sch); -procedure mgl_vect_3d(graph: HMGL; const ax, ay, az: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_vectl_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch); -procedure mgl_vectl_xyz(graph: HMGL; const x, y, z, ax, ay, az: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_vectl_3d(HMGL graph, const HMDT ax, const HMDT ay, const HMDT az, const char *sch); -procedure mgl_vectl_3d(graph: HMGL; const ax, ay, az: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_vectc_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch); -procedure mgl_vectc_xyz(graph: HMGL; const x, y, z, ax, ay, az: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_vectc_3d(HMGL graph, const HMDT ax, const HMDT ay, const HMDT az, const char *sch); -procedure mgl_vectc_3d(graph: HMGL; const ax, ay, az: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_map_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT a, const HMDT b, const char *sch, int ks, int pnts); -procedure mgl_map_xy(graph: HMGL; const x, y, a, b: HMDT; const sch: PChar; ks: integer; pnts: integer); cdecl; external libmgl; - -//void mgl_map(HMGL graph, const HMDT a, const HMDT b, const char *sch, int ks, int pnts); -procedure mgl_map(graph: HMGL; const a, b: HMDT; const sch: PChar; ks: integer; pnts: integer); cdecl; external libmgl; - -//void mgl_surf3a_xyz_val(HMGL graph, float Val, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT b, const char *stl); -procedure mgl_surf3a_xyz_val(graph: HMGL; Val: single; const x, y, z, a, b: HMDT; const stla: PChar); cdecl; external libmgl; - -//void mgl_surf3a_val(HMGL graph, float Val, const HMDT a, const HMDT b, const char *stl); -procedure mgl_surf3a_val(graph: HMGL; Val: single; const a, b: HMDT; const stl: PChar); cdecl; external libmgl; - -//void mgl_surf3a_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT b, const char *stl, int num); -procedure mgl_surf3a_xyz(graph: HMGL; const x, y, z, a, b: HMDT; const stl: PChar; num: integer); cdecl; external libmgl; - -//void mgl_surf3a(HMGL graph, const HMDT a, const HMDT b, const char *stl, int num); -procedure mgl_surf3a(graph: HMGL; const a, b: HMDT; const stl: PChar; num: integer); cdecl; external libmgl; - -//void mgl_surf3c_xyz_val(HMGL graph, float Val, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT b, const char *stl); -procedure mgl_surf3c_xyz_val(graph: HMGL; Val: single; const x, y, z, a, b: HMDT; const stl: PChar); cdecl; external libmgl; - -//void mgl_surf3c_val(HMGL graph, float Val, const HMDT a, const HMDT b, const char *stl); -procedure mgl_surf3c_val(graph: HMGL; Val: single; const a, b: HMDT; const stl: PChar); cdecl; external libmgl; - -//void mgl_surf3c_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT b, -// const char *stl, int num); -procedure mgl_surf3c_xyz(graph: HMGL; const x, y, z, a, b: HMDT; const stl: PChar; num: integer); cdecl; external libmgl; - -//void mgl_surf3c(HMGL graph, const HMDT a, const HMDT b, const char *stl, int num); -procedure mgl_surf3c(graph: HMGL; const a, b: HMDT; const stl: PChar; num: integer); cdecl; external libmgl; - -//void mgl_flow_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch, int num, int central, float zVal); -procedure mgl_flow_xy(graph: HMGL; const x, y, ax, ay: HMDT; const sch: PChar; num: integer; central: integer; zVal: single); cdecl; external libmgl; - -//void mgl_flow_2d(HMGL graph, const HMDT ax, const HMDT ay, const char *sch, int num, int central, float zVal); -procedure mgl_flow_2d(graph: HMGL; const ax, ay: HMDT; const sch: PChar; num: integer; central: integer; zVal: single); cdecl; external libmgl; - -//void mgl_flow_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch, int num, int central); -procedure mgl_flow_xyz(graph: HMGL; const x, y, z, ax, ay, az: HMDT; const sch: PChar; num: integer; central: integer); cdecl; external libmgl; - -//void mgl_flow_3d(HMGL graph, const HMDT ax, const HMDT ay, const HMDT az, const char *sch, int num, int central); -procedure mgl_flow_3d(graph: HMGL; const ax, ay, az: HMDT; const sch: PChar; num: integer; central: integer); cdecl; external libmgl; - -//void mgl_pipe_xy(HMGL graph, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch, float r0, int num, int central, float zVal); -procedure mgl_pipe_xy(graph: HMGL; const x, y, ax, ay: HMDT; const sch: PChar; r0: single; num: integer; central: integer; zVal: single); cdecl; external libmgl; - -//void mgl_pipe_2d(HMGL graph, const HMDT ax, const HMDT ay, const char *sch, float r0, int num, int central, float zVal); -procedure mgl_pipe_2d(graph: HMGL; const ax, ay: HMDT; const sch: PChar; r0: single; num: integer; central: integer; zVal: single); cdecl; external libmgl; - -//void mgl_pipe_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch, float r0, int num, int central); -procedure mgl_pipe_xyz(graph: HMGL; const x, y, z, ax, ay, az: HMDT; const sch: PChar; r0: single; num: integer; central: integer); cdecl; external libmgl; - -//void mgl_pipe_3d(HMGL graph, const HMDT ax, const HMDT ay, const HMDT az, const char *sch, float r0, int num, int central); -procedure mgl_pipe_3d(graph: HMGL; const ax, ay, az: HMDT; const sch: PChar; r0: single; num: integer; central: integer); cdecl; external libmgl; - -//void mgl_dew_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch,float zVal); -procedure mgl_dew_xy(gr: HMGL; const x, y, z, ax, ay: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_dew_2d(HMGL gr, const HMDT ax, const HMDT ay, const char *sch,float zVal); -procedure mgl_dew_2d(gr: HMGL; const ax, ay: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//*****************************************************************************/ -//* 3D plotting functions */ -//*****************************************************************************/ -//void mgl_grid3_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *stl); -procedure mgl_grid3_xyz(graph: HMGL; const x, y, z, a: HMDT; dir: char; sVal: integer; const stl: PChar); cdecl; external libmgl; - -//void mgl_grid3(HMGL graph, const HMDT a, char dir, int sVal, const char *stl); -procedure mgl_grid3(graph: HMGL; const a: HMDT; dir: char; sVal: integer; const stl: PChar); cdecl; external libmgl; - -//void mgl_grid3_all_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *stl); -procedure mgl_grid3_all_xyz(graph: HMGL; const x, y, z, a: HMDT; const stl: PChar); cdecl; external libmgl; - -//void mgl_grid3_all(HMGL graph, const HMDT a, const char *stl); -procedure mgl_grid3_all(graph: HMGL; const a: HMDT; const stl: PChar); cdecl; external libmgl; - -//void mgl_dens3_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *stl); -procedure mgl_dens3_xyz(graph: HMGL; const x, y, z, a: HMDT; dir: char; sVal: integer; const stl: PChar); cdecl; external libmgl; - -//void mgl_dens3(HMGL graph, const HMDT a, char dir, int sVal, const char *stl); -procedure mgl_dens3(graph: HMGL; const a: HMDT; dir: char; sVal: integer; const stl: PChar); cdecl; external libmgl; - -//void mgl_dens3_all_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *stl); -procedure mgl_dens3_all_xyz(graph: HMGL; const x, y, z, a: HMDT; const stl: PChar); cdecl; external libmgl; - -//void mgl_dens3_all(HMGL graph, const HMDT a, const char *stl); -procedure mgl_dens3_all(graph: HMGL; const a: HMDT; const stl: PChar); cdecl; external libmgl; - -//void mgl_surf3_xyz_val(HMGL graph, float Val, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *stl); -procedure mgl_surf3_xyz_val(graph: HMGL; Val: single; const x, y, z, a: HMDT; const stl: PChar); cdecl; external libmgl; - -//void mgl_surf3_val(HMGL graph, float Val, const HMDT a, const char *stl); -procedure mgl_surf3_val(graph: HMGL; Val: single; const a: HMDT; const stl: PChar); cdecl; external libmgl; - -//void mgl_surf3_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *stl, int num); -procedure mgl_surf3_xyz(graph: HMGL; const x, y, z, a: HMDT; const stl: PChar; num: integer); cdecl; external libmgl; - -//void mgl_surf3(HMGL graph, const HMDT a, const char *stl, int num); -procedure mgl_surf3(graph: HMGL; const a: HMDT; const stl: PChar; num: integer); cdecl; external libmgl; - -//void mgl_cont3_xyz_val(HMGL graph, const HMDT v, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *sch); -procedure mgl_cont3_xyz_val(graph: HMGL; const v, x, y, z, a: HMDT; dir: char; sVal: integer; const sch: PChar); cdecl; external libmgl; - -//void mgl_cont3_val(HMGL graph, const HMDT v, const HMDT a, char dir, int sVal, const char *sch); -procedure mgl_cont3_val(graph: HMGL; const v, a: HMDT; dir: char; sVal: integer; const sch: PChar); cdecl; external libmgl; - -//void mgl_cont3_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *sch, int Num); -procedure mgl_cont3_xyz(graph: HMGL; const x, y, z, a: HMDT; dir: char; sVal: integer; const sch: PChar; Num: integer); cdecl; external libmgl; - -//void mgl_cont3(HMGL graph, const HMDT a, char dir, int sVal, const char *sch, int Num); -procedure mgl_cont3(graph: HMGL; const a: HMDT; dir: char; sVal: integer; const stl: PChar; Num: integer); cdecl; external libmgl; - -//void mgl_cont_all_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *sch, int Num); -procedure mgl_cont_all_xyz(graph: HMGL; const x, y, z, a: HMDT; const sch: PChar; Num: integer); cdecl; external libmgl; - -//void mgl_cont_all(HMGL graph, const HMDT a, const char *sch, int Num); -procedure mgl_cont_all(graph: HMGL; const a: HMDT; const sch: PChar; Num: integer); cdecl; external libmgl; - -//void mgl_cloudp_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *stl, float alpha); -procedure mgl_cloudp_xyz(graph: HMGL; x, y, z, a: HMDT; const stl: PChar; alpha: single); cdecl; external libmgl; - -//void mgl_cloudp(HMGL graph, const HMDT a, const char *stl, float alpha); -procedure mgl_cloudp(graph: HMGL; const a: HMDT; const stl: PChar; alpha: single); cdecl; external libmgl; - -//void mgl_cloud_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *stl, float alpha); -procedure mgl_cloud_xyz(graph: HMGL; const x, y, z, a: HMDT; const stl: PChar; alpha: single); cdecl; external libmgl; - -//void mgl_cloud(HMGL graph, const HMDT a, const char *stl, float alpha); -procedure mgl_cloud(graph: HMGL; const a: HMDT; const stl: PChar; alpha: single); cdecl; external libmgl; - -//void mgl_contf3_xyz_val(HMGL graph, const HMDT v, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *sch); -procedure mgl_contf3_xyz_val(graph: HMGL; const v, x, y, z, a: HMDT; dir: char; sVal: integer; const sch: PChar); cdecl; external libmgl; - -//void mgl_contf3_val(HMGL graph, const HMDT v, const HMDT a, char dir, int sVal, const char *sch); -procedure mgl_contf3_val(graph: HMGL; const v, a: HMDT; dir: char; sVal: integer; const stl: PChar); cdecl; external libmgl; - -//void mgl_contf3_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *sch, int Num); -procedure mgl_contf3_xyz(graph: HMGL; const x, y, z, a: HMDT; dir: char; sVal: integer; const sch: PChar; Num: integer); cdecl; external libmgl; - -//void mgl_contf3(HMGL graph, const HMDT a, char dir, int sVal, const char *sch, int Num); -procedure mgl_contf3(graph: HMGL; const a: HMDT; dir: char; sVal: integer; const sch: PChar; Num: integer); cdecl; external libmgl; - -//void mgl_contf_all_xyz(HMGL graph, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *sch, int Num); -procedure mgl_contf_all_xyz(graph: HMGL; const x, y, z, a: HMDT; const sch: PChar; Num: integer); cdecl; external libmgl; - -//void mgl_contf_all(HMGL graph, const HMDT a, const char *sch, int Num); -procedure mgl_contf_all(graph: HMGL; const a: HMDT; const sch: PChar; Num: integer); cdecl; external libmgl; - -//void mgl_beam_val(HMGL graph, float Val, const HMDT tr, const HMDT g1, const HMDT g2, const HMDT a, float r, const char *stl, int norm); -procedure mgl_beam_val(graph: HMGL; Val: single; const tr, g1, g2, a: HMDT; r: single; const stl: PChar; norm: integer); cdecl; external libmgl; - -//void mgl_beam(HMGL graph, const HMDT tr, const HMDT g1, const HMDT g2, const HMDT a, float r, const char *stl, int norm, int num); -procedure mgl_beam(graph: HMGL; const tr, g1, g2, a: HMDT; r: single; const stl: PChar; norm, num: integer); cdecl; external libmgl; - -//*****************************************************************************/ -//* Triangular plotting functions */ -//*****************************************************************************/ -//void mgl_triplot_xyzc(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *sch); -procedure mgl_triplot_xyzc(graph: HMGL; const nums, x, y, z, c: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_triplot_xyz(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const char *sch); -procedure mgl_triplot_xyz(graph: HMGL; const nums, x, y, z: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_triplot_xy(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const char *sch, float zVal); -procedure mgl_triplot_xy(graph: HMGL; const nums, x, y: HMDT; const sch: PChar; zVal: single); cdecl; external libmgl; - -//void mgl_dots(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const char *sch); -procedure mgl_dots(graph: HMGL; const x, y, z: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_dots_tr(HMGL gr, const HMDT tr, const char *sch); -procedure mgl_dots_tr(graph: HMGL; const tr: HMDT; const sch: PChar); cdecl; external libmgl; - -//void mgl_crust(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const char *sch, float er); -procedure mgl_crust(graph: HMGL; const x, y, z: HMDT; const sch: PChar; er: single); cdecl; external libmgl; - -//void mgl_crust_tr(HMGL gr, const HMDT tr, const char *sch, float er); -procedure mgl_crust_tr(graph: HMGL; const tr: HMDT; const sch: PChar; er: single); cdecl; external libmgl; - -//*****************************************************************************/ -//* Combined plotting functions */ -//*****************************************************************************/ -//void mgl_dens_x(HMGL graph, const HMDT a, const char *stl, float sVal); -procedure mgl_dens_x(graph: HMGL; const a: HMDT; const stl: PChar; sVal: single); cdecl; external libmgl; - -//void mgl_dens_y(HMGL graph, const HMDT a, const char *stl, float sVal); -procedure mgl_dens_y(graph: HMGL; const a: HMDT; const stl: PChar; sVal: single); cdecl; external libmgl; - -//void mgl_dens_z(HMGL graph, const HMDT a, const char *stl, float sVal); -procedure mgl_dens_z(graph: HMGL; const a: HMDT; const stl: PChar; sVal: single); cdecl; external libmgl; - -//void mgl_cont_x(HMGL graph, const HMDT a, const char *stl, float sVal, int Num); -procedure mgl_cont_x(graph: HMGL; const a: HMDT; const stl: PChar; sVal: single; Num: integer); cdecl; external libmgl; - -//void mgl_cont_y(HMGL graph, const HMDT a, const char *stl, float sVal, int Num); -procedure mgl_cont_y(graph: HMGL; const a: HMDT; const stl: PChar; sVal: single; Num: integer); cdecl; external libmgl; - -//void mgl_cont_z(HMGL graph, const HMDT a, const char *stl, float sVal, int Num); -procedure mgl_cont_z(graph: HMGL; const a: HMDT; const stl: PChar; sVal: single; Num: integer); cdecl; external libmgl; - -//void mgl_cont_x_val(HMGL graph, const HMDT v, const HMDT a, const char *stl, float sVal); -procedure mgl_cont_x_val(graph: HMGL; const v, a: HMDT; const stl: PChar; sVal: single); cdecl; external libmgl; - -//void mgl_cont_y_val(HMGL graph, const HMDT v, const HMDT a, const char *stl, float sVal); -procedure mgl_cont_y_val(graph: HMGL; const v, a: HMDT; const stl: PChar; sVal: single); cdecl; external libmgl; - -//void mgl_cont_z_val(HMGL graph, const HMDT v, const HMDT a, const char *stl, float sVal); -procedure mgl_cont_z_val(graph: HMGL; const v, a: HMDT; const stl: PChar; sVal: single); cdecl; external libmgl; - -//void mgl_contf_x(HMGL graph, const HMDT a, const char *stl, float sVal, int Num); -procedure mgl_contf_x(graph: HMGL; const a: HMDT; const stl: PChar; sVal: single; Num: integer); cdecl; external libmgl; - -//void mgl_contf_y(HMGL graph, const HMDT a, const char *stl, float sVal, int Num); -procedure mgl_contf_y(graph: HMGL; const a: HMDT; const stl: PChar; sVal: single; Num: integer); cdecl; external libmgl; - -//void mgl_contf_z(HMGL graph, const HMDT a, const char *stl, float sVal, int Num); -procedure mgl_contf_z(graph: HMGL; const a: HMDT; const stl: PChar; sVal: single; Num: integer); cdecl; external libmgl; - -//void mgl_contf_x_val(HMGL graph, const HMDT v, const HMDT a, const char *stl, float sVal); -procedure mgl_contf_x_val(graph: HMGL; const v, a: HMDT; const stl: PChar; sVal: single); cdecl; external libmgl; - -//void mgl_contf_y_val(HMGL graph, const HMDT v, const HMDT a, const char *stl, float sVal); -procedure mgl_contf_y_val(graph: HMGL; const v, a: HMDT; const stl: PChar; sVal: single); cdecl; external libmgl; - -//void mgl_contf_z_val(HMGL graph, const HMDT v, const HMDT a, const char *stl, float sVal); -procedure mgl_contf_z_val(graph: HMGL; const v, a: HMDT; const stl: PChar; sVal: single); cdecl; external libmgl; - -//*****************************************************************************/ -//* Data creation functions */ -//*****************************************************************************/ -//void mgl_data_rearrange(HMDT dat, int mx, int my, int mz); -procedure mgl_data_rearrange(dat: HMDT; mx, my, mz: integer); cdecl; external libmgl; - -//void mgl_data_set_float(HMDT dat, const float *A,int NX,int NY,int NZ); -procedure mgl_data_set_float(dat: HMDT; const A: PSingle; NX, NY, NZ: integer); cdecl; external libmgl; - -//void mgl_data_set_double(HMDT dat, const double *A,int NX,int NY,int NZ); -procedure mgl_data_set_double(dat: HMDT; const A: PDouble; NX, NY, NZ: integer); cdecl; external libmgl; - -//void mgl_data_set_float2(HMDT d, const float **A,int N1,int N2); -type PPSingle = ^PSingle; -procedure mgl_data_set_float2(d: HMDT; const A: PPSingle; N1, N2: integer); cdecl; external libmgl; - -//void mgl_data_set_double2(HMDT d, const double **A,int N1,int N2); -type PPDouble = ^PDouble; -procedure mgl_data_set_double2(d: HMDT; const A: PPDouble; N1, N2: integer); cdecl; external libmgl; - -//void mgl_data_set_float3(HMDT d, const float ***A,int N1,int N2,int N3); -type PPPSingle = ^PPSingle; -procedure mgl_data_set_float3(d: HMDT; const A: PPPSingle; N1, N2, N3: integer); cdecl; external libmgl; - -//void mgl_data_set_double3(HMDT d, const double ***A,int N1,int N2,int N3); -type PPPDouble = ^PPDouble; -procedure mgl_data_set_double3(d: HMDT; const A: PPPDouble; N1, N2: integer); cdecl; external libmgl; - -//void mgl_data_set(HMDT dat, const HMDT a); -procedure mgl_data_set(dat: HMDT; const a: HMDT); cdecl; external libmgl; - - -type TGSLVector = record - end; - -type TGSLMatrix = record - end; - -type PGSLVector = ^TGSLVector; -type PGSLMatrix = ^TGSLMatrix; - -//void mgl_data_set_vector(HMDT dat, gsl_vector *v); -procedure mgl_data_set_vector(dat: HMDT; v: PGSLVector); cdecl; external libmgl; - -//void mgl_data_set_matrix(HMDT dat, gsl_matrix *m); -procedure mgl_data_set_matrix(dat: HMDT; m: PGSLMatrix); cdecl; external libmgl; - -//float mgl_data_get_value(const HMDT dat, int i, int j, int k); -function mgl_data_get_value(const dat: HMDT; i, j, k: integer): single; cdecl; external libmgl; - -//int mgl_data_get_nx(const HMDT dat); -function mgl_data_get_nx(const dat: HMDT): integer; cdecl; external libmgl; - -//int mgl_data_get_ny(const HMDT dat); -function mgl_data_get_ny(const dat: HMDT): integer; cdecl; external libmgl; - -//int mgl_data_get_nz(const HMDT dat); -function mgl_data_get_nz(const dat: HMDT): integer; cdecl; external libmgl; - -//void mgl_data_set_value(HMDT dat, float v, int i, int j, int k); -procedure mgl_data_set_value(dat: HMDT; v: single; i, j, k: integer); cdecl; external libmgl; - -//void mgl_data_set_values(HMDT dat, const char *val, int nx, int ny, int nz); -procedure mgl_data_set_values(dat: HMDT; const val: PChar; nx, ny, nz: integer); cdecl; external libmgl; - -//int mgl_data_read(HMDT dat, const char *fname); -function mgl_data_read(dat: HMDT; const fname: PChar): integer; cdecl; external libmgl; - -//int mgl_data_read_mat(HMDT dat, const char *fname, int dim); -function mgl_data_read_mat(dat: HMDT; const fname: PChar; dim: integer): integer; cdecl; external libmgl; - -//int mgl_data_read_dim(HMDT dat, const char *fname,int mx,int my,int mz); -function mgl_data_read_dim(dat: HMDT; const fname: PChar; mx, my, mz: integer): integer; cdecl; external libmgl; - -//void mgl_data_save(HMDT dat, const char *fname,int ns); -procedure mgl_data_save(dat: HMDT; const fname: PChar; ns: integer); cdecl; external libmgl; - -//void mgl_data_export(HMDT dat, const char *fname, const char *scheme,float v1,float v2,int ns); -procedure mgl_data_export(dat: HMDT; const fname: PChar; const scheme: PChar; v1, v2: single; ns: integer); cdecl; external libmgl; - -//void mgl_data_import(HMDT dat, const char *fname, const char *scheme,float v1,float v2); -procedure mgl_data_import(dat: HMDT; const fname: PChar; const scheme: PChar; v1, v2: single); cdecl; external libmgl; - -//void mgl_data_create(HMDT dat, int nx,int ny,int nz); -procedure mgl_data_create(dat: HMDT; nx, ny, nz: integer); cdecl; external libmgl; - -//void mgl_data_transpose(HMDT dat, const char *dim); -procedure mgl_data_transpose(dat: HMDT; const dim: PChar); cdecl; external libmgl; - -//void mgl_data_norm(HMDT dat, float v1,float v2,int sym,int dim); -procedure mgl_data_norm(dat: HMDT; v1, v2: single; sym: integer; dim: integer); cdecl; external libmgl; - -//void mgl_data_norm_slice(HMDT dat, float v1,float v2,char dir,int keep_en,int sym); -procedure mgl_data_norm_slice(dat: HMDT; v1, v2: single; dir: char; keep_en, sym: integer); cdecl; external libmgl; - -//HMDT mgl_data_subdata(const HMDT dat, int xx,int yy,int zz); -function mgl_data_subdata(const dat: HMDT; xx, yy, zz: integer): HMDT; cdecl; external libmgl; - -//HMDT mgl_data_column(const HMDT dat, const char *eq); -function mgl_data_column(const dat: HMDT; const eq: PChar): HMDT; cdecl; external libmgl; - -//void mgl_data_set_id(HMDT d, const char *id); -procedure mgl_data_set_id(d: HMDT; const id: PChar); cdecl; external libmgl; - -//void mgl_data_fill(HMDT dat, float x1,float x2,char dir); -procedure mgl_data_fill(dat: HMDT; x1, x2: single; dir: char); cdecl; external libmgl; - -//void mgl_data_fill_eq(HMGL gr, HMDT dat, const char *eq, const HMDT vdat, const HMDT wdat); -procedure mgl_data_fill_eq(graph: HMGL; dat: HMDT; const eq: PChar; vdat, wdat: HMDT); cdecl; external libmgl; - -//void mgl_data_put_val(HMDT dat, float val, int i, int j, int k); -procedure mgl_data_put_val(dat: HMDT; val: single; i, j, k: integer); cdecl; external libmgl; - -//void mgl_data_put_dat(HMDT dat, const HMDT val, int i, int j, int k); -procedure mgl_data_put_dat(dat: HMDT; const val: HMDT; i, j, k: integer); cdecl; external libmgl; - -//void mgl_data_modify(HMDT dat, const char *eq,int dim); -procedure mgl_data_modify(dat: HMDT; const eq: PChar; dim: integer); cdecl; external libmgl; - -//void mgl_data_modify_vw(HMDT dat, const char *eq,const HMDT vdat,const HMDT wdat); -procedure mgl_data_modify_vw(dat: HMDT; const eq: PChar; const vdat, wdat: HMDT); cdecl; external libmgl; - -//void mgl_data_squeeze(HMDT dat, int rx,int ry,int rz,int smooth); -procedure mgl_data_squeeze(dat: HMDT; rx, ry, rz, smooth: integer); cdecl; external libmgl; - -//float mgl_data_max(const HMDT dat); -function mgl_data_max(const dat: HMDT): single; cdecl; external libmgl; - -//float mgl_data_min(const HMDT dat); -function mgl_data_min(const dat: HMDT): single; cdecl; external libmgl; - -//float *mgl_data_value(HMDT dat, int i,int j,int k); -function mgl_data_value(dat: HMDT; i, j, k: integer): PSingle; cdecl; external libmgl; - -//const float *mgl_data_data(const HMDT dat); -function mgl_data_data(const dat: HMDT): PSingle; cdecl; external libmgl; - -//HMDT mgl_data_combine(const HMDT dat1, const HMDT dat2); -function mgl_data_combine(const dat1, dat2: HMDT): HMDT; cdecl; external libmgl; - -//void mgl_data_extend(HMDT dat, int n1, int n2); -procedure mgl_data_extend(dat: HMDT; n1, n2: integer); cdecl; external libmgl; - -//void mgl_data_insert(HMDT dat, char dir, int at, int num); -procedure mgl_data_insert(dat: HMDT; dir: char; pos, num: integer); cdecl; external libmgl; - -//void mgl_data_delete(HMDT dat, char dir, int at, int num); -procedure mgl_data_delete(dat: HMDT; dir: char; pos, num: integer); cdecl; external libmgl; - -//*****************************************************************************/ -//* Data manipulation functions */ -//*****************************************************************************/ -//void mgl_data_smooth(HMDT dat, int Type,float delta,const char *dirs); -procedure mgl_data_smooth(dat: HMDT; tType: integer; delpa: single; const dirs: PChar); cdecl; external libmgl; - -//HMDT mgl_data_sum(const HMDT dat, const char *dir); -function mgl_data_sum(const dat: HMDT; const dir: PChar): HMDT; cdecl; external libmgl; - -//HMDT mgl_data_max_dir(const HMDT dat, const char *dir); -function mgl_data_max_dir(const dat: HMDT; const dir: PChar): HMDT; cdecl; external libmgl; - -//HMDT mgl_data_min_dir(const HMDT dat, const char *dir); -function mgl_data_min_dir(const dat: HMDT; const dir: PChar): HMDT; cdecl; external libmgl; - -//void mgl_data_cumsum(HMDT dat, const char *dir); -procedure mgl_data_cumsum(dat: HMDT; const dir: PChar); cdecl; external libmgl; - -//void mgl_data_integral(HMDT dat, const char *dir); -procedure mgl_data_integral(dat: HMDT; const dir: PChar); cdecl; external libmgl; - -//void mgl_data_diff(HMDT dat, const char *dir); -procedure mgl_data_diff(dat: HMDT; const dir: PChar); cdecl; external libmgl; - -//void mgl_data_diff_par(HMDT dat, const HMDT v1, const HMDT v2, const HMDT v3); -procedure mgl_data_diff_par(dat, v1, v2, v3: HMDT); cdecl; external libmgl; - -//void mgl_data_diff2(HMDT dat, const char *dir); -procedure mgl_data_diff2(dat: HMDT; const dir: PChar); cdecl; external libmgl; - -//void mgl_data_swap(HMDT dat, const char *dir); -procedure mgl_data_swap(dat: HMDT; const dir: PChar); cdecl; external libmgl; - -//void mgl_data_mirror(HMDT dat, const char *dir); -procedure mgl_data_mirror(dat: HMDT; const dir: PChar); cdecl; external libmgl; - -//float mgl_data_spline(const HMDT dat, float x,float y,float z); -function mgl_data_spline(const dat: HMDT; x, y, z: single): single; cdecl; external libmgl; - -//float mgl_data_spline1(const HMDT dat, float x,float y,float z); -function mgl_data_spline1(const dat: HMDT; x, y, z: single): single; cdecl; external libmgl; - -//float mgl_data_linear(const HMDT dat, float x,float y,float z); -function mgl_data_linear(const dat: HMDT; x, y, z: single): single; cdecl; external libmgl; - -//float mgl_data_linear1(const HMDT dat, float x,float y,float z); -function mgl_data_linear1(const dat: HMDT; x, y, z: single): single; cdecl; external libmgl; - -//HMDT mgl_data_resize(const HMDT dat, int mx,int my,int mz); -function mgl_data_resize(const dat: HMDT; mx, my, mz: integer): HMDT; cdecl; external libmgl; - -//HMDT mgl_data_resize_box(const HMDT dat, int mx,int my,int mz,float x1,float x2, -// float y1,float y2,float z1,float z2); -function mgl_data_resize_box(const dat: HMDT; mx, my, mz: integer; x1, x2, y1, y2, z1, z2: single): HMDT; cdecl; external libmgl; - -//HMDT mgl_data_hist(const HMDT dat, int n, float v1, float v2, int nsub); -function mgl_data_hist(const dat: HMDT; n: integer; v1, v2: single; nsub: integer): HMDT; cdecl; external libmgl; - -//HMDT mgl_data_hist_w(const HMDT dat, const HMDT weight, int n, float v1, float v2, int nsub); -function mgl_data_hist_w(const dat, weight: HMDT; n: integer; v1, v2: single; nsub: integer): HMDT; cdecl; external libmgl; - -//HMDT mgl_data_momentum(const HMDT dat, char dir, const char *how); -function mgl_data_momentum(dat: HMDT; dir: char; const how: PChar): HMDT; cdecl; external libmgl; - -//HMDT mgl_data_evaluate_i(const HMDT dat, const HMDT idat, int norm); -function mgl_data_evaluate_i(dat, idat: HMDT; norm: char): HMDT; cdecl; external libmgl; - -//HMDT mgl_data_evaluate_ij(const HMDT dat, const HMDT idat, const HMDT jdat, int norm); -function mgl_data_evaluate_ij(dat, idat, jdat: HMDT; norm: char): HMDT; cdecl; external libmgl; - -//HMDT mgl_data_evaluate_ijk(const HMDT dat, const HMDT idat, const HMDT jdat, const HMDT kdat, int norm); -function mgl_data_evaluate_ijk(dat, idat, jdat, kdat: HMDT; norm: char): HMDT; cdecl; external libmgl; - -//void mgl_data_envelop(HMDT dat, char dir); -procedure mgl_data_envelop(dat: HMDT; dir: char); cdecl; external libmgl; - -//void mgl_data_sew(HMDT dat, const char *dirs, float da); -procedure mgl_data_sew(dat: HMDT; dirs: PChar; da: single); cdecl; external libmgl; - -//void mgl_data_crop(HMDT dat, int n1, int n2, char dir); -procedure mgl_data_crop(dat: HMDT; n1, n2: integer; dir: char); cdecl; external libmgl; - -//*****************************************************************************/ -//* Data operations */ -//*****************************************************************************/ -//void mgl_data_mul_dat(HMDT dat, const HMDT d); -procedure mgl_data_mul_dat(dat: HMDT; const d: HMDT); cdecl; external libmgl; - -//void mgl_data_div_dat(HMDT dat, const HMDT d); -procedure mgl_data_div_dat(dat: HMDT; const d: HMDT); cdecl; external libmgl; - -//void mgl_data_add_dat(HMDT dat, const HMDT d); -procedure mgl_data_add_dat(dat: HMDT; const d: HMDT); cdecl; external libmgl; - -//void mgl_data_sub_dat(HMDT dat, const HMDT d); -procedure mgl_data_sub_dat(dat: HMDT; const d: HMDT); cdecl; external libmgl; - -//void mgl_data_mul_num(HMDT dat, float d); -procedure mgl_data_mul_num(dat: HMDT; d: single); cdecl; external libmgl; - -//void mgl_data_div_num(HMDT dat, float d); -procedure mgl_data_div_num(dat: HMDT; d: single); cdecl; external libmgl; - -//void mgl_data_add_num(HMDT dat, float d); -procedure mgl_data_add_num(dat: HMDT; d: single); cdecl; external libmgl; - -//void mgl_data_sub_num(HMDT dat, float d); -procedure mgl_data_sub_num(dat: HMDT; d: single); cdecl; external libmgl; - -//*****************************************************************************/ -//* Nonlinear fitting */ -//*****************************************************************************/ -//float mgl_fit_1(HMGL gr, HMDT fit, const HMDT y, const char *eq, const char *var, float *ini); -function mgl_fit_1(gr: HMGL; fit: HMDT; const y: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_2(HMGL gr, HMDT fit, const HMDT z, const char *eq, const char *var, float *ini); -function mgl_fit_2(gr: HMGL; fit: HMDT; const z: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_3(HMGL gr, HMDT fit, const HMDT a, const char *eq, const char *var, float *ini); -function mgl_fit_3(gr: HMGL; fit: HMDT; const a: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_xy(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const char *eq, const char *var, float *ini); -function mgl_fit_xy(gr: HMGL; fit: HMDT; const x, y: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_xyz(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const char *eq, const char *var, float *ini); -function mgl_fit_xyz(gr: HMGL; fit: HMDT; const x, y, z: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_xyza(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *eq, const char *var, float *ini); -function mgl_fit_xyza(gr: HMGL; fit: HMDT; const x, y, z, a: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_ys(HMGL gr, HMDT fit, const HMDT y, const HMDT s, const char *eq, const char *var, float *ini); -function mgl_fit_ys(gr: HMGL; fit: HMDT; const y, s: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_xys(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT s, const char *eq, const char *var, float *ini); -function mgl_fit_xys(gr: HMGL; fit: HMDT; const x, y, s: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_xyzs(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT s, const char *eq, const char *var, float *ini); -function mgl_fit_xyzs(gr: HMGL; fit: HMDT; const x, y, z, s: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_xyzas(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT s, const char *eq, const char *var, float *ini); -function mgl_fit_xyzas(gr: HMGL; fit: HMDT; const x, y, z, a, s: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_1_d(HMGL gr, HMDT fit, const HMDT y, const char *eq, const char *var, HMDT ini); -function mgl_fit_1_d(gr: HMGL; fit: HMDT; const y: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_2_d(HMGL gr, HMDT fit, const HMDT z, const char *eq, const char *var, HMDT ini); -function mgl_fit_2_d(gr: HMGL; fit: HMDT; const z: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_3_d(HMGL gr, HMDT fit, const HMDT a, const char *eq, const char *var, HMDT ini); -function mgl_fit_3_d(gr: HMGL; fit: HMDT; const a: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_xy_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const char *eq, const char *var, HMDT ini); -function mgl_fit_xy_d(gr: HMGL; fit: HMDT; const x, y: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_xyz_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const char *eq, const char *var, HMDT ini); -function mgl_fit_xyz_d(gr: HMGL; fit: HMDT; const x, y, z: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_xyza_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *eq, const char *var, HMDT ini); -function mgl_fit_xyza_d(gr: HMGL; fit: HMDT; const x, y, z, a: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_ys_d(HMGL gr, HMDT fit, const HMDT y, const HMDT s, const char *eq, const char *var, HMDT ini); -function mgl_fit_ys_d(gr: HMGL; fit: HMDT; const y, s: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_xys_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT s, const char *eq, const char *var, HMDT ini); -function mgl_fit_xys_d(gr: HMGL; fit: HMDT; const x, y, s: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_xyzs_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT s, const char *eq, const char *var, HMDT ini); -function mgl_fit_xyzs_d(gr: HMGL; fit: HMDT; const x, y, z, s: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//float mgl_fit_xyzas_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT s, const char *eq, const char *var, HMDT ini); -function mgl_fit_xyzas_d(gr: HMGL; fit: HMDT; const x, y, z, a, s: HMDT; const eq: PChar; const vvar: PChar; ini: PSingle): single; cdecl; external libmgl; - -//void mgl_puts_fit(HMGL gr, float x, float y, float z, const char *prefix, const char *font, float size); -procedure mgl_puts_fit(gr: HMGL; x, y, z: single; const prefix: PChar; const font: PChar; size: single); cdecl; external libmgl; - -//*****************************************************************************/ -//void mgl_sphere(HMGL graph, float x, float y, float z, float r, const char *stl); -procedure mgl_sphere(gr: HMGL; x, y, z, r: single; const stl: PChar); cdecl; external libmgl; -//void mgl_drop(HMGL graph, float x1, float y1, float z1, float x2, float y2, float z2, float r, const char *stl, float shift, float ap); -procedure mgl_drop(gr: HMGL; x1, y1, z1, x2, y2, z2, r: single; const stl: PChar; shift, ap: single); cdecl; external libmgl; -//void mgl_cone(HMGL graph, float x1, float y1, float z1, float x2, float y2, float z2, float r1, float r2, const char *stl, int edge); -procedure mgl_cone(gr: HMGL; x1, y1, z1, x2, y2, z2, r1, r2: single; const stl: PChar; edge: integer); cdecl; external libmgl; - -//HMDT mgl_pde_solve(HMGL gr, const char *ham, const HMDT ini_re, const HMDT ini_im, float dz, float k0); -function mgl_pde_solve(gr: HMGL; const ham: PChar; ini_re, ini_im: HMDT; dz, k0: single): HMDT; cdecl; external libmgl; -//HMDT mgl_qo2d_solve(const char *ham, const HMDT ini_re, const HMDT ini_im, const HMDT ray, float r, float k0, HMDT xx, HMDT yy); -function mgl_qo2d_solve(const ham: PChar; ini_re, ini_im, ray: HMDT; r, k0: single; xx, yy: HMDT): HMDT; cdecl; external libmgl; -//HMDT mgl_af2d_solve(const char *ham, const HMDT ini_re, const HMDT ini_im, const HMDT ray, float r, float k0, HMDT xx, HMDT yy); -function mgl_af2d_solve(const ham: PChar; ini_re, ini_im, ray: HMDT; r, k0: single; xx, yy: HMDT): HMDT; cdecl; external libmgl; -//HMDT mgl_ray_trace(const char *ham, float x0, float y0, float z0, float px, float py, float pz, float dt, float tmax); -function mgl_ray_trace(const ham: PChar; x0, y0, z0, px, py, pz, dt, tmax: single): HMDT; cdecl; external libmgl; -//HMDT mgl_jacobian_2d(const HMDT x, const HMDT y); -function mgl_jacobian_2d(x, y: HMDT): HMDT; cdecl; external libmgl; -//HMDT mgl_jacobian_3d(const HMDT x, const HMDT y, const HMDT z); -function mgl_jacobian_3d(x, y, z: HMDT): HMDT; cdecl; external libmgl; -//HMDT mgl_transform_a(const HMDT am, const HMDT ph, const char *tr); -function mgl_transform_a(am, ph: HMDT; tr: PChar): HMDT; cdecl; external libmgl; -//HMDT mgl_transform(const HMDT re, const HMDT im, const char *tr); -function mgl_transform(re, im: HMDT; tr: PChar): HMDT; cdecl; external libmgl; -//HMDT mgl_data_stfa(const HMDT re, const HMDT im, int dn, char dir); -function mgl_data_stfa(re, im: HMDT; dn: integer; dir: char): HMDT; cdecl; external libmgl; - -//*****************************************************************************/ - - -{$IFDEF MSWINDOWS} -//*****************************************************************************/ -// Delphi - specific -//*****************************************************************************/ -procedure mgl_begin(); -procedure mgl_end(); - -procedure mgl_draw_on_canvas(gr: HMGL; width, height: integer; canvas: TCanvas; switchXY: boolean = false); - -implementation - -var _FPUCW: word; - -procedure mgl_begin(); - begin - _FPUCW := Get8087CW(); // backup current FPU CW - Set8087CW(_FPUCW or $3F); // masking all FPU exceptions - end; - -procedure mgl_end(); - begin - Set8087CW(_FPUCW); // restore old FPU CW - end; - - -procedure mgl_draw_on_canvas(gr: HMGL; width, height: integer; canvas: TCanvas; switchXY: boolean = false); - var i, j: integer; - bytes: PByte; - col: TColor; - begin - bytes := mgl_get_rgb(gr); - - if (not switchXY) then - for j := 0 to height - 1 do - for i := 0 to width - 1 do - begin - col := 0; - col := col or (bytes^); - inc(bytes); - col := col or (bytes^) shl 8; - inc(bytes); - col := col or (bytes^) shl 16; - inc(bytes); - canvas.Pixels[i, j] := col; - end - else - for j := height - 1 downto 0 do - for i := 0 to width - 1 do - begin - col := 0; - col := col or (bytes^); - inc(bytes); - col := col or (bytes^) shl 8; - inc(bytes); - col := col or (bytes^) shl 16; - inc(bytes); - canvas.Pixels[j, i] := col; - end; - end; - -{$ENDIF} -end. - diff --git a/include/mgl/mgl_w.h b/include/mgl/mgl_w.h deleted file mode 100644 index d645a8a..0000000 --- a/include/mgl/mgl_w.h +++ /dev/null @@ -1,1037 +0,0 @@ -/*************************************************************************** - * mgl_w.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifdef _MGL_DATA_H_ -#warning "MathGL wrapper is disabled due to using original MathGL classes" -#else -#ifndef _MGL_W_H_ -#define _MGL_W_H_ - -#ifndef NO_GSL -#include -#include -#else -struct gsl_vector; -struct gsl_matrix; -#endif -#include "mgl/mgl_define.h" -#include "mgl/mgl_c.h" -//----------------------------------------------------------------------------- -const float NaN = NAN; -const float pi = M_PI; -//----------------------------------------------------------------------------- -/// Class for incapsulating point in space -struct mglPoint -{ - double x,y,z; - mglPoint(double X=0,double Y=0,double Z=0){x=X;y=Y;z=Z;}; -}; -#ifndef SWIG -inline mglPoint operator+(const mglPoint &a, const mglPoint &b) -{ return mglPoint(a.x+b.x, a.y+b.y, a.z+b.z); }; -inline mglPoint operator-(const mglPoint &a, const mglPoint &b) -{ return mglPoint(a.x-b.x, a.y-b.y, a.z-b.z); }; -inline mglPoint operator*(double b, const mglPoint &a) -{ return mglPoint(a.x*b, a.y*b, a.z*b); }; -inline mglPoint operator*(const mglPoint &a, double b) -{ return mglPoint(a.x*b, a.y*b, a.z*b); }; -inline mglPoint operator/(const mglPoint &a, double b) -{ return mglPoint(a.x/b, a.y/b, a.z/b); }; -inline double operator*(const mglPoint &a, const mglPoint &b) -{ return a.x*b.x+a.y*b.y+a.z*b.z; }; -inline mglPoint operator&(const mglPoint &a, const mglPoint &b) -{ return a - b*((a*b)/(b*b)); }; -inline mglPoint operator|(const mglPoint &a, const mglPoint &b) -{ return b*((a*b)/(b*b)); }; -inline mglPoint operator^(const mglPoint &a, const mglPoint &b) -{ return mglPoint(a.y*b.z-a.z*b.y, a.z*b.x-a.x*b.z, a.x*b.y-a.y*b.x); }; -inline mglPoint operator!(const mglPoint &a) -{ return (a.x==0 && a.y==0)?mglPoint(1,0,0):mglPoint(-a.y/hypot(a.x,a.y), a.x/hypot(a.x,a.y), 0); }; -inline bool operator==(const mglPoint &a, const mglPoint &b) -{ return !memcmp(&a, &b, sizeof(mglPoint)); } -inline bool operator!=(const mglPoint &a, const mglPoint &b) -{ return memcmp(&a, &b, sizeof(mglPoint)); } -inline double Norm(const mglPoint &p) -{ return sqrt(p.x*p.x+p.y*p.y+p.z*p.z); }; -#endif -//----------------------------------------------------------------------------- -/// Wrapper class for mglData -class mglData -{ -//friend class mglData; -friend class mglGraph; - HMDT a; - bool del; -public: - mglData(int xx=1,int yy=1,int zz=1) { a=mgl_create_data_size(xx,yy,zz); del=true; }; - mglData(const HMDT aa, bool copy=true) - { if(copy) { a=mgl_create_data(); if(aa) mgl_data_set(a,aa); } else a=aa; del=copy; }; - mglData(const char *fname) { a=mgl_create_data_file(fname); del=true; } - virtual ~mglData() { if(a && del) mgl_delete_data(a); }; - mglData(const mglData &d) { a=mgl_create_data(); mgl_data_set(a,d.a); del=true; }; - - mglData(int size, const float *d) - { a=mgl_create_data(); mgl_data_set_float(a,d,size,1,1); del=true; }; - mglData(int rows, int cols, const float *d) - { a=mgl_create_data(); mgl_data_set_float(a,d,cols,rows,1); del=true; }; - mglData(int rows, int cols, int slc, const float *d) - { a=mgl_create_data(); mgl_data_set_float(a,d,cols,rows,slc); del=true; }; - mglData(int size, const double *d) - { a=mgl_create_data(); mgl_data_set_double(a,d,size,1,1); del=true; }; - mglData(int rows, int cols, const double *d) - { a=mgl_create_data(); mgl_data_set_double(a,d,cols,rows,1); del=true; }; - mglData(int rows, int cols, int slc, const double *d) - { a=mgl_create_data(); mgl_data_set_double(a,d,cols,rows,slc); del=true; }; - - mglData(const float *d, int size) - { a=mgl_create_data(); mgl_data_set_float(a,d,size,1,1); del=true; }; - mglData(const float *d, int rows, int cols) - { a=mgl_create_data(); mgl_data_set_float(a,d,cols,rows,1); del=true; }; - mglData(const float *d, int rows, int cols, int slc) - { a=mgl_create_data(); mgl_data_set_float(a,d,cols,rows,slc); del=true; }; - mglData(const double *d, int size) - { a=mgl_create_data(); mgl_data_set_double(a,d,size,1,1); del=true; }; - mglData(const double *d, int rows, int cols) - { a=mgl_create_data(); mgl_data_set_double(a,d,cols,rows,1); del=true; }; - mglData(const double *d, int rows, int cols, int slc) - { a=mgl_create_data(); mgl_data_set_double(a,d,cols,rows,slc); del=true; }; - - inline HMDT Self() { return a; }; - - inline void Set(gsl_vector *v) { mgl_data_set_vector(a,v); }; - inline void Set(gsl_matrix *m) { mgl_data_set_matrix(a,m); }; - inline void Set(const mglData &dat) { mgl_data_set(a,dat.a); }; - inline void Set(const float *A,int NX,int NY=1,int NZ=1) { mgl_data_set_float(a,A,NX,NY,NZ); }; - inline void Set(const double *A,int NX,int NY=1,int NZ=1) { mgl_data_set_double(a,A,NX,NY,NZ); }; - inline void Set(const float **A,int N1,int N2) { mgl_data_set_float2(a,A,N1,N2); }; - inline void Set(const double **A,int N1,int N2) { mgl_data_set_double2(a,A,N1,N2); }; - inline void Set(const float ***A,int N1,int N2,int N3) { mgl_data_set_float3(a,A,N1,N2,N3); }; - inline void Set(const double ***A,int N1,int N2,int N3) { mgl_data_set_double3(a,A,N1,N2,N3); }; - inline void Rearrange(int mx, int my=0, int mz=0) { mgl_data_rearrange(a,mx,my,mz); }; - inline void Set(const char *str,int NX,int NY=1,int NZ=1) { mgl_data_set_values(a,str,NX,NY,NZ); }; - - inline bool Read(const char *fname) { return mgl_data_read(a,fname); }; - inline bool Read(const char *fname,int mx,int my=1,int mz=1) - { return mgl_data_read_dim(a,fname,mx,my,mz); }; - inline void Save(const char *fname,int ns=-1) { mgl_data_save(a,fname,ns); }; - inline void Export(const char *fname,const char *scheme,double v1=0,double v2=0,int ns=-1) - { mgl_data_export(a,fname,scheme,v1,v2,ns); }; - inline void Import(const char *fname,const char *scheme,double v1=0,double v2=1) - { mgl_data_import(a,fname,scheme,v1,v2); }; - inline bool ReadMat(const char *fname, int dim=2) - { return mgl_data_read_mat(a,fname,dim); }; - - inline void Create(int nx,int ny=1,int nz=1) { mgl_data_create(a,nx,ny,nz); }; - inline void Extend(int n1, int n2=0) { mgl_data_extend(a,n1,n2); }; - inline void Transpose(const char *dim="yx") { mgl_data_transpose(a,dim); }; - inline void Norm(double v1=0,double v2=1,bool sym=false,int dim=0) - { mgl_data_norm(a,v1,v2,sym,dim); }; - inline void NormSl(double v1=0,double v2=1,char dir='z',bool keep_en=true,bool sym=false) - { mgl_data_norm_slice(a,v1,v2,dir,keep_en,sym); }; - inline void Put(double val, int i=-1, int j=-1, int k=-1) - { mgl_data_put_val(a, val, i, j, k); }; - inline void Put(mglData &val, int i=-1, int j=-1, int k=-1) - { mgl_data_put_dat(a, val.a, i,j,k); }; - inline void Modify(const char *eq,int dim=0) { mgl_data_modify(a,eq,dim); }; - inline void Modify(const char *eq, mglData &v, mglData &w) - { mgl_data_modify_vw(a,eq,v.a, w.a); }; - inline void Modify(const char *eq,const mglData &v){ mgl_data_modify_vw(a,eq,v.a, NULL); }; - inline void Fill(double x1,double x2,char dir='x') { mgl_data_fill(a,x1,x2,dir); }; - inline void FillSample(int n, const char *how) { mgl_data_fill_sample(a,n,how); }; - inline mglData Column(const char *eq) { return mglData(mgl_data_column(a,eq)); }; - inline void SetColumnId(const char *ids) { mgl_data_set_id(a,ids); }; - inline void Squeeze(int rx,int ry=1,int rz=1,bool smooth=false) - { mgl_data_squeeze(a,rx,ry,rz,smooth); }; - inline void Crop(int n1, int n2,char dir='x') { mgl_data_crop(a,n1,n2,dir); } - - inline double Maximal() { return mgl_data_max(a); }; - inline double Minimal() { return mgl_data_min(a); }; - inline mglData Momentum(char dir, const char *how) - { return mglData(mgl_data_momentum(a, dir, how)); } - - inline void Smooth(int Type,const char *dirs="xyz",double delta=0) - { mgl_data_smooth(a,Type,delta,dirs); }; - inline void Envelop(char dir='x') { mgl_data_envelop(a,dir); }; - inline void Sew(const char *dirs="xyz", double da=2*pi) - { mgl_data_sew(a,dirs,da); }; - inline void Smooth(const char *dirs="xyz") - { - int type = SMOOTH_QUAD_5; - if(strchr(dirs,'0') || strchr(dirs,'1')) return; - if(strchr(dirs,'3')) type = SMOOTH_LINE_3; - if(strchr(dirs,'5')) type = SMOOTH_LINE_5; - mgl_data_smooth(a,type,0,dirs); - } - inline mglData SubData(int xx,int yy=-1,int zz=-1) - { return mglData(mgl_data_subdata(a,xx,yy,zz)); }; - inline mglData SubData(const mglData &xx, const mglData &yy, const mglData &zz) - { return mglData(mgl_data_subdata_ext(a,xx.a,yy.a,zz.a)); }; - inline mglData Hist(int n,double v1=0,double v2=1, int nsub=0) - { return mglData(mgl_data_hist(a,n,v1,v2,nsub)); }; - inline mglData Hist(const mglData &w, int n,double v1=0,double v2=1, int nsub=0) - { return mglData(mgl_data_hist_w(a,w.a,n,v1,v2,nsub)); }; - inline mglData Sum(const char *dir) - { return mglData(mgl_data_sum(a,dir)); }; - inline mglData Max(const char *dir) - { return mglData(mgl_data_max_dir(a,dir)); }; - inline mglData Min(const char *dir) - { return mglData(mgl_data_min_dir(a,dir)); }; - inline mglData Resize(int mx,int my=1,int mz=1,double x1=0,double x2=1, - double y1=0,double y2=1,double z1=0,double z2=1) - { return mglData(mgl_data_resize_box(a, mx, my, mz, x1, x2, y1, y2, z1, z2)); }; - inline mglData Combine(const mglData &d) - { return mglData(mgl_data_combine(a,d.a)); }; - inline mglData Evaluate(const mglData &idat, bool norm=true) - { return mglData(mgl_data_evaluate_i(a, idat.a, norm)); }; - inline mglData Evaluate(const mglData &idat, const mglData &jdat, bool norm=true) - { return mglData(mgl_data_evaluate_ij(a, idat.a, jdat.a, norm)); }; - inline mglData Evaluate(const mglData &idat, const mglData &jdat, const mglData &kdat, bool norm=true) - { return mglData(mgl_data_evaluate_ijk(a, idat.a, jdat.a, kdat.a, norm)); }; - - inline void CumSum(const char *dir) { mgl_data_cumsum(a,dir); }; - inline void Integral(const char *dir) { mgl_data_integral(a,dir); }; - inline void Diff(const char *dir) { mgl_data_diff(a,dir); }; - inline void Diff(const mglData &v1, const mglData &v2) - { mgl_data_diff_par(a,v1.a,v2.a,NULL); }; - inline void Diff(const mglData &v1, const mglData &v2, const mglData &v3) - { mgl_data_diff_par(a,v1.a,v2.a,v3.a); }; - inline void Diff2(const char *dir) { mgl_data_diff2(a,dir); }; - inline void Swap(const char *dir) { mgl_data_swap(a,dir); }; - inline void Roll(char dir, int num) { mgl_data_roll(a,dir,num); }; - inline void Mirror(const char *dir) { mgl_data_mirror(a,dir); }; - - inline void Hankel(const char *dir) { mgl_data_hankel(a,dir); }; - inline void SinFFT(const char *dir) { mgl_data_sinfft(a,dir); }; - inline void CosFFT(const char *dir) { mgl_data_cosfft(a,dir); }; - - inline double Spline(double x,double y=0,double z=0) - { return mgl_data_spline(a,x,y,z); }; - inline double Spline1(double x,double y=0,double z=0) - { return mgl_data_spline1(a,x,y,z); }; - inline double Linear(double x,double y=0,double z=0) - { return mgl_data_linear(a,x,y,z); }; - inline double Linear1(double x,double y=0,double z=0) - { return mgl_data_linear1(a,x,y,z); }; - - inline void Insert(char dir, int at=0, int num=1) { mgl_data_insert(a,dir,at,num); }; - inline void Delete(char dir, int at=0, int num=1) { mgl_data_delete(a,dir,at,num); }; - - inline mreal Find(const char *cond, int &i, int &j, int &k) - { return mgl_data_first(a, cond, &i, &j, &k); }; - inline mreal Last(const char *cond, int &i, int &j, int &k) - { return mgl_data_last(a, cond, &i, &j, &k); }; - inline int Find(const char *cond, char dir, int i=0, int j=0, int k=0) - { return mgl_data_find(a, cond, dir, i, j, k); }; - inline bool FindAny(const char *cond) - { return mgl_data_find_any(a, cond); }; - float Maximal(int &i,int &j,int &k) - { return mgl_data_max_int(a, &i, &j, &k); }; - float Minimal(int &i,int &j,int &k) - { return mgl_data_min_int(a, &i, &j, &k); }; - float Maximal(float &x,float &y,float &z) - { - mreal i=x,j=y,k=z,r=mgl_data_max_real(a, &i, &j, &k); - x=i; y=j; z=k; return r; - }; - float Minimal(float &x,float &y,float &z) - { - mreal i=x,j=y,k=z,r=mgl_data_min_real(a, &i, &j, &k); - x=i; y=j; z=k; return r; - }; - float Momentum(char dir,float &m,float &w) - { - mreal i=0,j=0,r=mgl_data_momentum_mw(a, dir, &i, &j); - m=i; w=j; return r; - }; - - inline double v(int i,int j=0,int k=0) { return mgl_data_get_value(a,i,j,k); }; - inline double GetVal(int i, int j=0, int k=0) { return mgl_data_get_value(a,i,j,k); }; - inline void SetVal(double v, int i, int j=0, int k=0) { mgl_data_set_value(a,v,i,j,k); }; - inline long GetNx() { return mgl_data_get_nx(a); }; - inline long GetNy() { return mgl_data_get_ny(a); }; - inline long GetNz() { return mgl_data_get_nz(a); }; - inline const mreal *GetData() { return mgl_data_data(a); }; - inline void operator=(const mglData &d) { mgl_data_set(a,d.a); }; - inline void operator*=(const mglData &d) { mgl_data_mul_dat(a,d.a);}; - inline void operator/=(const mglData &d) { mgl_data_div_dat(a,d.a);}; - inline void operator+=(const mglData &d) { mgl_data_add_dat(a,d.a);}; - inline void operator-=(const mglData &d) { mgl_data_sub_dat(a,d.a);}; - inline void operator*=(double d) { mgl_data_mul_num(a,d); }; - inline void operator/=(double d) { mgl_data_div_num(a,d); }; - inline void operator+=(double d) { mgl_data_add_num(a,d); }; - inline void operator-=(double d) { mgl_data_sub_num(a,d); }; -}; -//----------------------------------------------------------------------------- -/// Wrapper class for mglGraph* -class mglGraph -{ - HMGL self; -public: - mglGraph(int kind=0, int width=600, int height=400) - { - if(kind==1) self=mgl_create_graph_ps(width, height); - else if(kind==2) self=mgl_create_graph_gl(); - else if(kind==3) self=mgl_create_graph_idtf(); - else self=mgl_create_graph_zb(width, height); - }; - virtual ~mglGraph() { mgl_delete_graph(self); }; - inline HMGL Self() { return self; }; - - inline int GetWarn() { return mgl_get_warn(self); }; - inline void DefaultPlotParam() { mgl_set_def_param(self); }; - inline void SetPalColor(int n, float r, float g, float b) - { if(n>=0 && n<100) mgl_set_pal_color(self, n, r, g, b); }; - inline void SetPalNum(int n) { if(n>=0 && n<100) mgl_set_pal_num(self, n); }; - inline void SetPalette(const char *colors) { mgl_set_palette(self, colors); }; - inline void SetScheme(const char *colors) { mgl_set_scheme(self, colors); }; - inline void SetRotatedText(bool rotated) { mgl_set_rotated_text(self, rotated); }; - inline void SetCut(bool cut) { mgl_set_cut(self, cut); }; - inline void SetCutBox(float x1,float y1,float z1,float x2,float y2,float z2) - { mgl_set_cut_box(self, x1, y1, z1, x2, y2, z2); }; - inline void SetTickLen(float len, float stt=1) - { mgl_set_tick_len(self, len, stt); }; - inline void SetTickStl(const char *stl, const char *sub=0) - { mgl_set_tick_stl(self, stl, sub); }; - inline void SetBaseLineWidth(float width) { mgl_set_base_line_width(self, width); }; - inline void SetSize(int width, int height) { mgl_set_size(self, width, height); }; - inline void SetBarWidth(float width) { mgl_set_bar_width(self, width); }; - inline void SetMarkSize(float size) { mgl_set_mark_size(self, size); }; - inline void SetArrowSize(float size) { mgl_set_arrow_size(self, size); }; - inline void SetFontSize(float size) { mgl_set_font_size(self, size); }; - inline void SetFontDef(char *fnt) { mgl_set_font_def(self, fnt); }; - inline void SetAlphaDef(float alpha) { mgl_set_alpha_default(self, alpha); }; - inline void SetAxialDir(char dir) { mgl_set_axial_dir(self, dir); }; - inline void SetMeshNum(int num) { mgl_set_meshnum(self, num); }; - inline void Zoom(float x1, float y1, float x2, float y2) - { mgl_set_zoom(self, x1, y1, x2, y2); }; - inline void SetPlotFactor(float val) { mgl_set_plotfactor(self, val); }; - inline void SetDrawFace(bool enable) { mgl_set_draw_face(self, enable);}; - inline void SetLegendBox(bool enable) { mgl_set_legend_box(self, enable); }; - inline void SetLegendMarks(int num) { mgl_set_legend_marks(self, num); }; - inline void LoadFont(const char *name, const char *path=NULL) - { mgl_load_font(self, name, path); }; - inline void CopyFont(mglGraph *gr) { mgl_copy_font(self, gr->Self());}; - inline void RestoreFont() { mgl_restore_font(self); }; - - inline void ShowImage(const char *viewer, bool keep=0) - { mgl_show_image(self, viewer, keep); }; - inline void WriteFrame(const char *fname,const char *descr="") - { mgl_write_frame(self, fname, descr); }; - inline void WriteIDTF(const char *fname,const char *descr="") - { mgl_write_idtf(self, fname, descr); }; - inline void WriteJPEG(const char *fname,const char *descr="") - { mgl_write_jpg(self, fname, descr); }; - inline void WritePNG(const char *fname,const char *descr="", bool alpha=true) - { if(alpha) mgl_write_png(self, fname, descr); - else mgl_write_png_solid(self, fname, descr); }; - inline void WriteEPS(const char *fname,const char *descr="") - { mgl_write_eps(self, fname, descr); }; - inline void WriteSVG(const char *fname,const char *descr="") - { mgl_write_svg(self, fname, descr); }; - inline void WriteGIF(const char *fname,const char *descr="") - { mgl_write_gif(self, fname, descr); }; - inline void StartGIF(const char *fname, int ms=100) - { mgl_start_gif(self, fname,ms); }; - inline void CloseGIF() { mgl_close_gif(self); }; - inline void NewFrame() { mgl_new_frame(self); }; - inline void EndFrame() { mgl_end_frame(self); }; - inline int GetNumFrame() { return mgl_get_num_frame(self); }; - inline void ResetFrames() { mgl_reset_frames(self); }; - inline void Flush() { mgl_flush(self); }; - - inline void GetRGB(char *imgdata, int imglen) - { - int w=mgl_get_width(self); - int h=mgl_get_height(self); - if(imglen>=3*w*h) - { - imglen=3*w*h; - memcpy(imgdata, mgl_get_rgb(self),imglen); - } - }; - inline void GetRGBA(char *imgdata, int imglen) - { - int w=mgl_get_width(self); - int h=mgl_get_height(self); - if(imglen>=4*w*h) - { - imglen=4*w*h; - memcpy(imgdata, mgl_get_rgba(self),imglen); - } - }; - inline void GetBGRN(char *imgdata, int imglen) - { - int w,h,i; - w=mgl_get_width(self); - h=mgl_get_height(self); - const char *buf=(const char *)mgl_get_rgb(self); - if(imglen>=4*w*h) - { - imglen=4*w*h; - for(i=0;iSelf(), self, str, pos); }; - inline int Parse(mglGraph *gr, const wchar_t *str, int pos) - { return mgl_parsew(gr->Self(), self, str, pos); }; - inline void ScanFunc(const wchar_t *line){ mgl_scan_func(self, line); }; - inline void Execute(mglGraph *gr, const char *str) - { mgl_parse_text(gr->Self(), self, str); }; - inline void Execute(mglGraph *gr, const wchar_t *str) - { mgl_parsew_text(gr->Self(), self, str); }; - inline void RestoreOnce() { mgl_restore_once(self); }; - inline void AllowSetSize(bool allow) { mgl_parser_allow_setsize(self, allow); }; -}; -//----------------------------------------------------------------------------- -#endif -#endif diff --git a/include/mgl/mgl_wx.h b/include/mgl/mgl_wx.h deleted file mode 100644 index 1acc3e1..0000000 --- a/include/mgl/mgl_wx.h +++ /dev/null @@ -1,180 +0,0 @@ -/*************************************************************************** - * mgl_wx.h.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef MGL_WX_H -#define MGL_WX_H -//----------------------------------------------------------------------------- -#include -#include -#include -#include -#include -//----------------------------------------------------------------------------- -/// Class is Wx widget which display MathGL graphics -class wxMathGL : public wxWindow -{ -public: - wxString appName; ///< Application name for message boxes - bool AutoResize; ///< Allow auto resizing (default is false) - int AnimDelay; ///< Animation delay in ms - - wxMathGL(wxWindow *parent, wxWindowID id=-1, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=0, const wxString& name=wxPanelNameStr); - virtual ~wxMathGL(); - double GetRatio() { return double(graph->GetWidth())/graph->GetHeight(); }; - void SetPopup(wxMenu *p) { popup = p; }; ///< Set popup menu pointer - void SetSize(int w, int h); ///< Set window/picture sizes - void SetGraph(mglGraphAB *gr); ///< Set grapher object - /// Set drawing functions and its parameter - void SetDraw(int (*func)(mglGraph *gr, void *par), void *par=0); - void SetDraw(mglDraw *dr); ///< Set drawing functions from mglDraw class - - int GetPer() {return per;}; ///< Get perspective value - int GetPhi() {return phi;}; ///< Get Phi-angle value - int GetTet() {return tet;}; ///< Get Theta-angle value - bool GetAlpha() {return alpha;}; ///< Get transparency state - bool GetLight() {return light;}; ///< Get lightning state - bool GetZoom() {return zoom;}; ///< Get mouse zooming state - bool GetRotate(){return rotate;}; ///< Get mouse rotation state - - void Repaint(); - void Update(mglGraph *gr=0); ///< Update picture - void Copy(); ///< copy graphics to clipboard - void Print(); ///< Print plot -// void Stop(); ///< Stop execution - void SetPer(int p); ///< Set perspective value - void SetPhi(int p); ///< Set Phi-angle value - void SetTet(int t); ///< Set Theta-angle value - void SetAlpha(bool a); ///< Switch on/off transparency - void SetLight(bool l); ///< Switch on/off lightning - void SetZoom(bool z); ///< Switch on/off mouse zooming - void SetRotate(bool r); ///< Switch on/off mouse rotation - void ZoomIn(); ///< Zoom in graphics - void ZoomOut(); ///< Zoom out graphics - void Restore(); ///< Restore zoom and rotation to default values -// void Reload(); ///< Reload data and execute script - void ShiftLeft(); ///< Shift graphics to left direction - void ShiftRight(); ///< Shift graphics to right direction - void ShiftUp(); ///< Shift graphics to up direction - void ShiftDown(); ///< Shift graphics to down direction - void ExportPNG(wxString fname=L""); ///< export to PNG file - void ExportPNGs(wxString fname=L""); ///< export to PNG file (no transparency) - void ExportJPG(wxString fname=L""); ///< export to JPEG file - void ExportBPS(wxString fname=L""); ///< export to bitmap EPS file - void ExportEPS(wxString fname=L""); ///< export to vector EPS file - void ExportSVG(wxString fname=L""); ///< export to SVG file - void ExportIDTF(wxString fname=L""); ///< export to IDTF file - void SetMGLFont(wxString path); ///< restore/load font for graphics - //----These functions are executed only if graph is mglGraphQT instance---- - void Adjust(); ///< Adjust plot size to fill entire window - void NextSlide(); ///< Show next slide - void PrevSlide(); ///< Show previous slide - void Animation(bool st=true); ///< Start animation - void About(); ///< Show about information - void AboutQt(); ///< Show information about Qt version - -protected: - void OnPaint(wxPaintEvent& event); - void OnSize(wxSizeEvent& event); - void OnNextSlide(wxTimerEvent& evt); ///< Show next slide - void OnMouseLeftDown(wxMouseEvent &ev); - void OnMouseDown(wxMouseEvent &ev); - void OnMouseLeftUp(wxMouseEvent &ev); - void OnMouseRightUp(wxMouseEvent &ev); - void OnMouseMove(wxMouseEvent &ev); -// void MousePressEvent(QMouseEvent *); -// void MouseReleaseEvent(QMouseEvent *); -// void MouseMoveEvent(QMouseEvent *); - - mglGraphAB *graph; ///< Built-in mglGraph-er instance (used by default) - void *draw_par; ///< Parameters for drawing function mglGraph::DrawFunc. - /// Drawing function for window procedure. It should return the number of frames. - int (*draw_func)(mglGraph *gr, void *par); - wxString MousePos; ///< Last mouse position - wxBitmap pic; ///< Pixmap for drawing (changed by update) - double tet, phi; ///< Rotation angles - double per; ///< Value of perspective ( must be in [0,1) ) - bool alpha; ///< Transparency state - bool light; ///< Lightning state - bool zoom; ///< Mouse zoom state - bool rotate; ///< Mouse rotation state - mreal x1,x2,y1,y2; ///< Zoom in region - bool showMessage; ///< Flag for showing messages (enabled by each execute()) - wxMenu *popup; ///< Pointer to pop-up menu - wxTimer *timer; ///< Timer for animation - DECLARE_EVENT_TABLE() -private: - int x0, y0, xe, ye; ///< Temporary variables for mouse - unsigned char *grBuf; -}; -//----------------------------------------------------------------------------- -#ifdef ENABLE_MGLGRAPHWX -#include -class wxSpinCtrl; -class wxMenu; -int mglWxRun(); -//----------------------------------------------------------------------------- -class mglGraphWX : public mglGraphZB -{ -friend class wxMathGL; -public: -using mglGraphAB::Window; - int sshow; ///< Current state of animation switch (toggle button) - wxMathGL *WMGL; ///< Control which draw graphics - int CurFig; ///< Current figure in the list. - wxWindow *Wnd; ///< Pointer to window - - mglGraphWX(); - virtual ~mglGraphWX(); - - void EndFrame(); - void SetSize(int w,int h); - const unsigned char *GetBits(); - void Clf(mglColor Back=NC); - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ñëóæåáíûå ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /// Create a window for plotting. Now implemeted only for GLUT. - void Window(int argc, char **argv, int (*draw)(mglGraph *gr, void *p), - const char *title,void *par=NULL, - void (*reload)(int next, void *p)=NULL, bool maximize=false); - /// Switch on/off transparency (do not overwrite switches in user drawing function) - void ToggleAlpha(); - /// Switch on/off lighting (do not overwrite switches in user drawing function) - void ToggleLight(); - void ToggleZoom(); ///< Switch on/off zooming by mouse - void ToggleRotate();///< Switch on/off rotation by mouse - void ToggleNo(); ///< Switch off all zooming and rotation - void Update(); ///< Update picture by calling user drawing function - void ReLoad(bool o);///< Reload user data and update picture - void Adjust(); ///< Adjust size of bitmap to window size - void NextFrame(); ///< Show next frame (if one) - void PrevFrame(); ///< Show previous frame (if one) - void Animation(); ///< Run slideshow (animation) of frames - -protected: - unsigned char *GG; ///< images for all frames (may be too LARGE !!!) - wxScrolledWindow *scroll; ///< Scrolling area - wxMenu *popup; ///< Popup menu - wxSpinCtrl *tet, *phi; ///< Spin box for angles -// QAction *anim; - - void MakeMenu(); ///< Create menu, toolbar and popup menu -}; -#endif -//----------------------------------------------------------------------------- -#endif -//----------------------------------------------------------------------------- diff --git a/include/mgl/mgl_zb.h b/include/mgl/mgl_zb.h deleted file mode 100644 index 0711531..0000000 --- a/include/mgl/mgl_zb.h +++ /dev/null @@ -1,62 +0,0 @@ -/*************************************************************************** - * mgl_zb.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -//----------------------------------------------------------------------------- -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" -#else -#ifndef _MGL_ZB_H_ -#define _MGL_ZB_H_ -#include "mgl/mgl_ab.h" -//----------------------------------------------------------------------------- -/// Class implement the creation of different mathematical plots using Z-Buffer -class mglGraphZB : public mglGraphAB -{ -friend void *mgl_thr_ball(void *p); -friend void *mgl_thr_dfin(void *p); -friend void *mgl_thr_ffin(void *p); -friend void *mgl_thr_quad(void *p); -friend void *mgl_thr_quaa(void *p); -friend void *mgl_thr_trig(void *p); -friend void *mgl_thr_trin(void *p); - -public: - /// Initialize ZBuffer drawing and allocate the memory for image with size [Width x Height]. - mglGraphZB(int w=600, int h=400); - virtual ~mglGraphZB(); - /// write n-th slice (for testing) - void WriteSlice(int n); - void Finish(); - virtual void Clf(mglColor Back=NC); - virtual void SetSize(int w,int h); - void Glyph(mreal x, mreal y, mreal f, int style, long icode, char col); - void PutDrawReg(int m, int n, int k, mglGraphAB *gr); - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - bool FastNoFace; /// Use fastest (but less accurate) scheme for drawing (without faces) -protected: - mreal *Z; ///< Height for given level in Z-direction - unsigned char *C; ///< Picture for given level in Z-direction - - /// Plot point \a p with color \a c - void pnt_plot(long x,long y,mreal z,unsigned char c[4]); -}; -//----------------------------------------------------------------------------- -#endif -#endif -//----------------------------------------------------------------------------- diff --git a/include/mgl/mglplot.fs b/include/mgl/mglplot.fs deleted file mode 100644 index 76de339..0000000 --- a/include/mgl/mglplot.fs +++ /dev/null @@ -1,562 +0,0 @@ -\ Mathgl library wrapper Thu Feb 21 12:33:02 MST 2008 -\ Copyright (C) 2008, Sergey Plis -\ -\ This program is free software; you can redistribute it and/or modify -\ it under the terms of the GNU General Public License as published by -\ the Free Software Foundation; either version 2 of the License, or -\ (at your option) any later version. -\ -\ This program is distributed in the hope that it will be useful, -\ but WITHOUT ANY WARRANTY; without even the implied warranty of -\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -\ GNU General Public License for more details. - -\needs gsl include gsl.fs -\needs mathgl include mathgl.fs -\needs vectors include vectors.fs -\needs $! include string.fs - -Module mglplot - -also minos also vectors also gsl also mathgl also float - -\ ------------------------------------------------------------------------ -\ structures -\ ------------------------------------------------------------------------ -struct{ - cell transp? - cell transp_type - cell alpha? - cell light - cell box - cell grid - double ambient - cell axis? - cell axis_str - cell rotation[ - cell aspect[ - cell colorbar - double linewidth - double fontsize - cell labelx$ - cell labely$ - cell labelz$ - cell textrotate -} mgl-params - -struct{ - cell next \ next plot in the list of current figure - cell prev - cell xrange \ - cell yrange \ - cell zrange \ - cell hmdtlist \ vector of all data objects used in the plot - cell params \ vector of parameters to the plotting function - cell ops \ vector of xt's of operations to place params - \ list on the stack so the plotting function can - \ be executed - cell plotfunc \ the plotting function -} a_plot - -struct{ - cell next \ next figure in the figure structure - cell # - cell active? \ True/False - cell figure \ plot object -} a_figure - -: dispose-hmdtlist ( v( -- ) - dup )size 0 do - dup i )@ - mgl_delete_data - loop drop ; - -: dispose-a-plot ( *a_plot -- ) - dup a_plot hmdtlist @ dispose-hmdtlist - dup a_plot params @ )free - dup a_plot ops @ )free - dup a_plot xrange @ ]free - dup a_plot yrange @ ]free - dup a_plot zrange @ ]free - free throw ; - -: dispose-all-plots ( *a_plot -- ) - dup begin while - dup a_plot next @ - swap dispose-a-plot - dup - repeat drop ; - -\ simple aux words -| : ]@s ( x[ -- f: x[0] .. x[n] ) - dup ]size 0 do dup i ]@ loop drop ; -| : ]!s ( x[ f: x[0] .. x[n] -- ) - dup ]size 0 do dup i ]! loop drop ; -| create axis-param 0 c, 0 c, 0 c, 0 c, 0 c, -| create mglstrbuff $FF allot -: default-rotation ( -- r[ ) 3 :] dup 0e 0e 0e ]!s ; -: clear-axis-param - axis-param dup 'x swap c! 1+ dup 'y swap c! 1+ 'z swap c! ; - -: NAN ( -- f: NAN) $7FC00000 sp@ sf@ drop ; -\ ------------------------------------------------------------------------ -\ GUI -\ ------------------------------------------------------------------------ - -component class mathplot - private: - method fill-pixmap - method mgl_settings_reset - cell var mhold - public: - early open - early dialog - early open-app - - method generate-plot - method addplot - method clear-pixmap - method #plots - method clf - method mgl-rotation! - method mgl-colorbar - - method mgl-hold - method mgl-holdoff - method mgl-holdon - method hold@ - method hold! - method mgl-grid - method fontsize - - method mgl-xlabel - method mgl-ylabel - method mgl-zlabel - - canvas ptr mCanvas - ( [varstart] ) - \ memory-pixmap ptr pxmap \ the pixmap on the canvas - cell var pxmap - cell var graph \ the graph to display - cell var plotlist \ list of plots to display - cell var parameters \ parameter structure - ( [varend] ) - how: - : params DF[ 0 ]DF s" figure" ; - : hold@ mhold @ ; - : hold! mhold ! ; - : mgl-hold mhold @ not mhold ! ; - : mgl-holdoff mhold off ; - : mgl-holdon mhold on ; - - : open self DF[ 0 ]DF s" bigforth Plot" open-component ; - : dialog new DF[ 0 ]DF s" bigforth Plot" open-dialog ; - : open-app new DF[ 0 ]DF s" bigforth Plot" open-application ; - : clear-pixmap pxmap @ if pxmap @ >o dispose o> 0 pxmap ! then ; - : #plots ( -- ) - 0 - plotlist @ begin dup while - swap 1+ swap - a_plot next @ - repeat - drop ; - - : assign - &600 &400 mgl_create_graph_zb graph ! - sizeof mgl-params allocate throw parameters ! - parameters @ sizeof mgl-params erase - mgl_settings_reset - - \ 0 0 - parameters @ mgl-params labelx$ dup @ if $off else drop then - \ 0 0 - parameters @ mgl-params labely$ dup @ if $off else drop then - \ 0 0 - parameters @ mgl-params labelz$ dup @ if $off else drop then - - 0 pxmap ! - 0 plotlist ! - mhold off ; - - : fontsize ( f: size -- ) parameters @ mgl-params fontsize sf! ; - - : mgl-set-params ( -- ) - graph @ - dup parameters @ mgl-params rotation[ @ ]@s mgl_rotate - dup parameters @ mgl-params ambient sf@ mgl_set_ambbr - dup parameters @ mgl-params fontsize sf@ mgl_set_font_size - dup parameters @ mgl-params linewidth sf@ mgl_set_base_line_width - dup parameters @ mgl-params aspect[ @ ]@s mgl_aspect - dup parameters @ mgl-params transp? @ mgl_set_transp - dup parameters @ mgl-params transp_type @ mgl_set_transp_type - dup parameters @ mgl-params alpha? @ mgl_set_alpha - dup parameters @ mgl-params light @ mgl_set_light - dup parameters @ mgl-params textrotate @ mgl_set_rotated_text - dup parameters @ mgl-params box @ mgl_box - parameters @ mgl-params grid @ if - dup 0" xyz" 0 mgl_axis_grid - then - drop ; - : mgl-post-params ( -- ) - graph @ 1 mgl_set_rotated_text - parameters @ mgl-params labelx$ @ if - parameters @ mgl-params labelx$ $@ mglstrbuff 0place - parameters @ mgl-params fontsize sf@ 0e0 - graph @ 'x mglstrbuff 0 mgl_label_ext - then - parameters @ mgl-params labely$ @ if - parameters @ mgl-params labely$ $@ mglstrbuff 0place - parameters @ mgl-params fontsize sf@ 0e0 - graph @ 'y mglstrbuff 0 mgl_label_ext - then - parameters @ mgl-params labelz$ @ drop 0 if - parameters @ mgl-params labelz$ $@ mglstrbuff 0place - parameters @ mgl-params fontsize sf@ 0e0 - graph @ 'z mglstrbuff 0 mgl_label_ext - then - parameters @ mgl-params colorbar @ drop 0 if - dup 0 0 mgl_colorbar - then ; - : mgl_settings_reset - 1 parameters @ mgl-params transp? ! - 1 parameters @ mgl-params transp_type ! - 0 parameters @ mgl-params alpha? ! - 0 parameters @ mgl-params box ! - 0 parameters @ mgl-params colorbar ! - 0 parameters @ mgl-params light ! - 1 parameters @ mgl-params axis? ! - axis-param parameters @ mgl-params axis_str ! - clear-axis-param - parameters @ mgl-params labelx$ dup @ if $off else drop then - parameters @ mgl-params labely$ dup @ if $off else drop then - parameters @ mgl-params labelz$ dup @ if $off else drop then - \ parameters @ mgl-params textrotate off - !0.9 parameters @ mgl-params ambient sf! - !2.5 parameters @ mgl-params fontsize sf! - !1.2 parameters @ mgl-params linewidth sf! - parameters @ mgl-params rotation[ @ dup if ]free else drop then - default-rotation parameters @ mgl-params rotation[ ! - parameters @ mgl-params aspect[ @ dup if ]free else drop then - 3 :] parameters @ mgl-params aspect[ ! - ; - - : mgl_settings_free - parameters @ mgl-params labelx$ dup @ if $off else drop then - parameters @ mgl-params labely$ dup @ if $off else drop then - parameters @ mgl-params labelz$ dup @ if $off else drop then - parameters @ mgl-params rotation[ @ dup if ]free else drop then - parameters @ mgl-params aspect[ @ dup if ]free else drop then - ; - - : addplot ( *a_plot -- ) - mhold @ if - >r plotlist @ r@ a_plot next ! r> - plotlist @ if - dup plotlist @ a_plot prev ! - then - else - plotlist @ dispose-all-plots - then - plotlist ! - generate-plot - mcanvas draw ; - : display_a_plot ( *a_plot -- ) - >r graph @ - r@ a_plot ops @ - r@ a_plot params @ - dup )size 0 do - i -rot - 2>r - 2r@ rot dup >r *) swap r> )@ F execute - 2r> - loop 2drop - r> a_plot plotfunc @ - F execute ; - : xmin ( -- f: xmin ) - 1e20 plotlist @ begin dup while - dup a_plot xrange @ ]min fmin - a_plot next @ - repeat - drop ; - : xmax ( -- f: xmax ) - -1e20 plotlist @ begin dup while - dup a_plot xrange @ ]max fmax - a_plot next @ - repeat - drop ; - : ymin ( -- f: ymin ) - 1e20 plotlist @ begin dup while - dup a_plot yrange @ ]min fmin - a_plot next @ - repeat - drop ; - : ymax ( -- f: ymax ) - -1e20 plotlist @ begin dup while - dup a_plot yrange @ ]max fmax - a_plot next @ - repeat - drop ; - - : zmin ( -- f: zmin ) - 1e20 plotlist @ begin dup while - dup a_plot zrange @ ]min fmin - a_plot next @ - repeat - drop ; - : zmax ( -- f: ymax ) - -1e20 plotlist @ begin dup while - dup a_plot zrange @ ]max fmax - a_plot next @ - repeat - drop ; - - : display_plots ( -- ) - 0 plotlist @ begin dup while - nip dup a_plot next @ - repeat - drop - begin dup while - dup display_a_plot - a_plot prev @ - repeat drop ; - - : create-figure ( -- ) - graph @ mgl_identity - graph @ mgl_clf - graph @ mCanvas with w @ h @ endwith mgl_set_size - -\ parameters @ mgl-params rotation[ @ ]null? if -\ graph @ -\ [ 1e 3e fsqrt f/ 1e fswap f- 2e f/ 0.7e f* ] fliteral -\ fdup -\ fdup fdup 1e fswap f- fswap 1e fswap f- -\ mgl_set_zoom -\ else - graph @ 0e 0e 0e 0e mgl_set_zoom -\ parameters @ mgl-params fontsize sf@ -\ 1.2e f* parameters @ mgl-params fontsize sf! -\ then - graph @ xmin ymin zmin xmax ymax zmax mgl_set_axis_3d -\ graph @ xmin ymin zmin mgl_set_origin - graph @ NAN NAN NAN mgl_set_origin - mgl-set-params - mgl-post-params - display_plots - ; - : fill-pixmap - clear-pixmap - graph @ mgl_get_rgb - mCanvas with w @ h @ endwith * 4 * dup allocate throw - dup >r - swap 4 / 3 * move r@ - mCanvas with w @ h @ endwith memory-pixmap new pxmap ! - r> free throw ; - : generate-plot ( -- ) - create-figure - fill-pixmap ; - - : freeplots plotlist @ dispose-all-plots 0 plotlist ! ; - - : clf freeplots clear-pixmap draw ; - - : mgl-rotation! ( f: x y z ) - fswap frot parameters @ mgl-params rotation[ @ ]!s - generate-plot - mcanvas draw ; - : mgl-rotation@ ( -- f: x y z ) - parameters @ mgl-params rotation[ @ ]@s ; - : mgl-colorbar ( -- ) - parameters @ mgl-params colorbar @ - not - parameters @ mgl-params colorbar ! - generate-plot mcanvas draw ; - : mgl-grid parameters @ mgl-params grid dup @ not swap ! - generate-plot mcanvas draw ; - : mgl-xlabel ( addr u -- ) - parameters @ mgl-params labelx$ dup @ - if dup $off $! else $! then - generate-plot mcanvas draw ; - : mgl-ylabel ( addr u -- ) - parameters @ mgl-params labely$ dup @ - if dup $off $! else $! then - generate-plot mcanvas draw ; - : mgl-zlabel ( addr u -- ) - parameters @ mgl-params labelz$ dup @ - if dup $off $! else $! then - generate-plot mcanvas draw ; - - : dispose - clear-pixmap - plotlist @ dispose-all-plots - graph @ mgl_delete_graph - mgl_settings_free - parameters @ sizeof mgl-params erase - parameters @ free throw - super dispose ; - : widget - CV[ - outer with pxmap @ endwith 0<> if - outer with pxmap @ endwith icon - then - ]CV - ^^ CK[ 2drop 2drop ]CK - $258 $1 *hfil $190 $1 *vfil canvas new ^^bind mCanvas - $10 $1 *hfill *hglue new - ^^ S[ s" not done" mCanvas text ]S X" Save " button new - ^^ S[ close ]S X" Close " button new - &3 habox new vfixbox panel - &2 vabox new ; -class; - -sizeof a_figure allocate throw constant current-figure - -current-figure sizeof a_figure erase - -actor class clear-pointer - how: - : dispose - current-figure a_figure active? off - current-figure sizeof a_figure erase - super dispose ; -class; - -: init-plot - current-figure a_figure active? @ not if - screen self mathplot new - current-figure a_figure figure ! - current-figure a_figure active? on - clear-pointer new - current-figure a_figure figure @ - mathplot with >callback open endwith - then ; - -: s>range[] ( fmin fmax -- :] ) 2 :] dup 1 ]! dup 0 ]! ; - -: []plot ( x[ str0 xt -- *a_plot ) - >r >r dup >r - mgl_create_data dup rot mgl_data_set_vector - sizeof a_plot allocate throw - dup r@ dup ]min ]max s>range[] swap a_plot yrange ! - dup r> ]size 0e s>f s>range[] swap a_plot xrange ! - dup 0e 0e s>range[] swap a_plot zrange ! - dup 0 swap a_plot next ! - dup 0 swap a_plot prev ! - over 1 ivector* over a_plot hmdtlist ! - over r> 2 ivector* over a_plot params ! - ['] @ ['] @ 2 ivector* over a_plot ops ! - nip r> over a_plot plotfunc ! ; -: addplot ( *a_plot -- ) - init-plot - current-figure a_figure figure @ - mathplot with addplot endwith ; -: ]plot ( *gsl_vector 0"" -- ) ['] mgl_plot []plot addplot ; -: ]stem ( *gsl_vector 0"" -- ) ['] mgl_stem []plot addplot ; -: ]bars ( *gsl_vector 0"" -- ) ['] mgl_bars []plot addplot ; -: ]step ( *gsl_vector 0"" -- ) ['] mgl_step []plot addplot ; -: ]area ( *gsl_vector 0"" -- ) ['] mgl_area []plot addplot ; - -: [[]]plot ( x[[ str0 xt -- *a_plot ) - >r >r dup >r - mgl_create_data dup rot mgl_data_set_matrix - sizeof a_plot allocate throw - dup r@ dup ]]min ]]max s>range[] swap a_plot zrange ! - dup r@ ]]size1 0e s>f s>range[] swap a_plot xrange ! - dup r> ]]size2 0e s>f s>range[] swap a_plot yrange ! - dup 0 swap a_plot next ! - dup 0 swap a_plot prev ! - over 1 ivector* over a_plot hmdtlist ! - over r> 2 ivector* over a_plot params ! - ['] @ ['] @ 2 ivector* over a_plot ops ! - nip r> over a_plot plotfunc ! ; -: ]]surf ( *gsl_matrix 0"" -- ) ['] mgl_surf [[]]plot addplot ; -: ]]tile ( *gsl_matrix 0"" -- ) ['] mgl_tile [[]]plot addplot ; -: ]]belt ( *gsl_matrix 0"" -- ) ['] mgl_belt [[]]plot addplot ; -: ]]fall ( *gsl_matrix 0"" -- ) ['] mgl_fall [[]]plot addplot ; -: ]]mesh ( *gsl_matrix 0"" -- ) ['] mgl_mesh [[]]plot addplot ; -: ]]msurf ( *gsl_matrix 0"" -- ) - init-plot - 2dup ]]surf - current-figure a_figure figure @ - mathplot with hold@ mgl-holdon endwith - >r - ]]mesh - r> - current-figure a_figure figure @ - mathplot with hold! endwith ; - -: [[]]plotf ( f:v x[[ str0 xt -- *a_plot ) - >r >r dup >r - mgl_create_data dup rot mgl_data_set_matrix - sizeof a_plot allocate throw - dup r@ dup ]]min ]]max s>range[] swap a_plot zrange ! - dup r@ ]]size1 0e s>f s>range[] swap a_plot xrange ! - dup r> ]]size2 0e s>f s>range[] swap a_plot yrange ! - dup 0 swap a_plot next ! - dup 0 swap a_plot prev ! - over 1 ivector* over a_plot hmdtlist ! - over r> f>fs 3 ivector* over a_plot params ! - ['] @ ['] @ ['] sf@ 3 ivector* over a_plot ops ! - nip r> over a_plot plotfunc ! ; -: ]]boxs ( f:v *gsl_matrix 0"" -- ) ['] mgl_boxs [[]]plotf addplot ; - -: clf current-figure a_figure active? @ if - current-figure a_figure figure @ >o mathplot clf o> - then ; - -: fontsize! ( f:size -- ) current-figure a_figure active? @ if - current-figure a_figure figure @ >o mathplot fontsize o> - then ; - -: rotation ( F: x y z -- ) - current-figure a_figure active? @ if - current-figure a_figure figure @ >o mathplot mgl-rotation! o> - else - fdrop fdrop fdrop - then ; -: colorbar current-figure a_figure active? @ if - current-figure a_figure figure @ - >o mathplot mgl-colorbar o> - then ; - - -: mglhold current-figure a_figure active? @ if - current-figure a_figure figure @ - >o mathplot mgl-hold o> - then ; - -: mglholdon current-figure a_figure active? @ if - current-figure a_figure figure @ - >o mathplot mgl-holdon o> - then ; -: mglholdoff current-figure a_figure active? @ if - current-figure a_figure figure @ - >o mathplot mgl-holdoff o> - then ; - -: mglgrid current-figure a_figure active? @ if - current-figure a_figure figure @ - >o mathplot mgl-grid o> - then ; - -: xlabel ( addr u -- ) current-figure a_figure active? @ if - current-figure a_figure figure @ - >o mathplot mgl-xlabel o> - then ; -: ylabel ( addr u -- ) current-figure a_figure active? @ if - current-figure a_figure figure @ - >o mathplot mgl-ylabel o> - then ; -: zlabel ( addr u -- ) current-figure a_figure active? @ if - current-figure a_figure figure @ - >o mathplot mgl-zlabel o> - then ; - - -clear -previous previous previous previous previous -Module; - -\\\ -also mglplot also minos also gsl -100 fvector x[ x[ ]randomize -x[ 0 ]plot diff --git a/include/mgl/opengl.h b/include/mgl/opengl.h new file mode 100644 index 0000000..bb123cf --- /dev/null +++ b/include/mgl/opengl.h @@ -0,0 +1,68 @@ +/*************************************************************************** + * opengl.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef MGL_CANVAS_GL_H +#define MGL_CANVAS_GL_H +/*****************************************************************************/ +#ifdef __cplusplus +#include "mgl/canvas.h" + +class mglCanvasGL : public mglCanvas +{ +public: + mglCanvasGL(); + ~mglCanvasGL(); + + void SetQuality(int =0) { Quality=2; } + void Finish(); + void SetSize(int ,int ) {} + void View(float tetX,float tetY,float tetZ); + int NewFrame(); + void EndFrame(); + + bool Alpha(bool enable); + void Fog(float d, float dz=0.25); + bool Light(bool enable); + void Light(int n, bool enable); + void AddLight(int n,mglPoint p, char c='w', float bright=0.5, bool infty=true, float ap=0); + void Clf(mglColor Back=WC); + +protected: + void line_draw(long p1, long p2, mglDrawReg *d); + void trig_draw(long p1, long p2, long p3, bool anorm, mglDrawReg *d); + void quad_draw(long p1, long p2, long p3, long p4, mglDrawReg *d); + void pnt_draw(long p, mglDrawReg *d); + + unsigned char **GetRGBLines(long &w, long &h, unsigned char *&f, bool solid=true); + void LightScale(); + void set_pen(unsigned style,float width); +}; +extern "C" { +#endif +/*****************************************************************************/ +HMGL mgl_create_graph_gl(); +/*****************************************************************************/ +uintptr_t mgl_create_graph_gl_(); +/*****************************************************************************/ +#ifdef __cplusplus +} +#endif +/*****************************************************************************/ +#endif + diff --git a/include/mgl/other.h b/include/mgl/other.h new file mode 100644 index 0000000..1024609 --- /dev/null +++ b/include/mgl/other.h @@ -0,0 +1,107 @@ +/*************************************************************************** + * other.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef _MGL_OTHER_H_ +#define _MGL_OTHER_H_ +#include "mgl/base.h" +/*****************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif +/*****************************************************************************/ +void mgl_triplot_xyzc(HMGL gr, HCDT nums, HCDT x, HCDT y, HCDT z, HCDT c, const char *sch, const char *opt); +void mgl_triplot_xyz(HMGL gr, HCDT nums, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_triplot_xy(HMGL gr, HCDT nums, HCDT x, HCDT y, const char *sch, const char *opt); + +void mgl_quadplot_xyzc(HMGL gr, HCDT nums, HCDT x, HCDT y, HCDT z, HCDT c, const char *sch, const char *opt); +void mgl_quadplot_xyz(HMGL gr, HCDT nums, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_quadplot_xy(HMGL gr, HCDT nums, HCDT x, HCDT y, const char *sch, const char *opt); + +void mgl_tricont_xyzcv(HMGL gr, HCDT v, HCDT nums, HCDT x, HCDT y, HCDT z, HCDT c, const char *sch, const char *opt); +void mgl_tricont_xycv(HMGL gr, HCDT v, HCDT nums, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_tricont_xyzc(HMGL gr, HCDT nums, HCDT x, HCDT y, HCDT z, HCDT c, const char *sch, const char *opt); +void mgl_tricont_xyc(HMGL gr, HCDT nums, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); + +void mgl_dots(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_dots_a(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, const char *sch, const char *opt); + +void mgl_crust(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); + +void mgl_dens_x(HMGL graph, HCDT a, const char *stl, float sVal, const char *opt); +void mgl_dens_y(HMGL graph, HCDT a, const char *stl, float sVal, const char *opt); +void mgl_dens_z(HMGL graph, HCDT a, const char *stl, float sVal, const char *opt); + +void mgl_cont_x(HMGL graph, HCDT a, const char *stl, float sVal, const char *opt); +void mgl_cont_y(HMGL graph, HCDT a, const char *stl, float sVal, const char *opt); +void mgl_cont_z(HMGL graph, HCDT a, const char *stl, float sVal, const char *opt); + +void mgl_cont_x_val(HMGL graph, HCDT v, HCDT a, const char *stl, float sVal, const char *opt); +void mgl_cont_y_val(HMGL graph, HCDT v, HCDT a, const char *stl, float sVal, const char *opt); +void mgl_cont_z_val(HMGL graph, HCDT v, HCDT a, const char *stl, float sVal, const char *opt); + +void mgl_contf_x(HMGL graph, HCDT a, const char *stl, float sVal, const char *opt); +void mgl_contf_y(HMGL graph, HCDT a, const char *stl, float sVal, const char *opt); +void mgl_contf_z(HMGL graph, HCDT a, const char *stl, float sVal, const char *opt); + +void mgl_contf_x_val(HMGL graph, HCDT v, HCDT a, const char *stl, float sVal, const char *opt); +void mgl_contf_y_val(HMGL graph, HCDT v, HCDT a, const char *stl, float sVal, const char *opt); +void mgl_contf_z_val(HMGL graph, HCDT v, HCDT a, const char *stl, float sVal, const char *opt); + +/*****************************************************************************/ + +void mgl_triplot_xyzc_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, const char *opt,int,int); +void mgl_triplot_xyz_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_triplot_xy_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, const char *sch, const char *opt,int,int); +void mgl_quadplot_xyzc_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, const char *opt,int,int); +void mgl_quadplot_xyz_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_quadplot_xy_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, const char *sch, const char *opt,int,int); + +void mgl_tricont_xyzcv_(uintptr_t *gr, uintptr_t *v, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, const char *opt,int,int); +void mgl_tricont_xycv_(uintptr_t *gr, uintptr_t *v, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_tricont_xyzc_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, const char *opt,int, int); +void mgl_tricont_xyc_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int, int); + +void mgl_dots_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_dots_a_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch, const char *opt,int,int); +void mgl_dots_tr_(uintptr_t *gr, uintptr_t *tr, const char *sch, const char *opt,int,int); +void mgl_crust_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_crust_tr_(uintptr_t *gr, uintptr_t *tr, const char *sch, const char *opt,int,int); + +void mgl_dens_x_(uintptr_t *graph, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); +void mgl_dens_y_(uintptr_t *graph, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); +void mgl_dens_z_(uintptr_t *graph, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); +void mgl_cont_x_(uintptr_t *graph, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); +void mgl_cont_y_(uintptr_t *graph, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); +void mgl_cont_z_(uintptr_t *graph, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); +void mgl_cont_x_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); +void mgl_cont_y_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); +void mgl_cont_z_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); +void mgl_contf_x_(uintptr_t *graph, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); +void mgl_contf_y_(uintptr_t *graph, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); +void mgl_contf_z_(uintptr_t *graph, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); +void mgl_contf_x_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); +void mgl_contf_y_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); +void mgl_contf_z_val_(uintptr_t *graph, uintptr_t *v, uintptr_t *a, const char *stl, float *sVal, const char *opt,int,int); + +/*****************************************************************************/ +#ifdef __cplusplus +} +#endif +/*****************************************************************************/ +#endif diff --git a/include/mgl/mgl_parse.h b/include/mgl/parser.h similarity index 75% rename from include/mgl/mgl_parse.h rename to include/mgl/parser.h index 6a4ecfa..bfffe05 100644 --- a/include/mgl/mgl_parse.h +++ b/include/mgl/parser.h @@ -1,211 +1,218 @@ -/*************************************************************************** - * mgl_parse.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -//----------------------------------------------------------------------------- -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" -#else -#ifndef _MGL_PARSE_H_ -#define _MGL_PARSE_H_ -#include "mgl/mgl.h" -//----------------------------------------------------------------------------- -/// Structure for the command argument. -struct mglArg -{ - int type; ///< Type of argument {0-data,1-string,2-number} - mglData *d; ///< Pointer to data (used if type==0) - wchar_t w[2048];///< String with parameters - char s[2048]; ///< String with parameters - mreal v; ///< Numerical value (used if type==2) - mglArg() { type=-1; d=0; v=0; s[0]=0; w[0]=0; }; -}; -//----------------------------------------------------------------------------- -/// Structure for MGL command -struct mglCommand -{ - const wchar_t *name; ///< Name of command - const wchar_t *desc; ///< Short command description (can be NULL) - const wchar_t *form; ///< Format of command arguments (can be NULL) - /// Function for executing (plotting) - int (*exec)(mglGraph *gr, long n, mglArg *a, int k[10]); - /// Function for exporting in C++ (can be NULL) - void (*save)(wchar_t out[1024], long n, mglArg *a, int k[10]); - bool create; ///< Should parser create 1st the array automatically - int type; ///< Type of command: 0 - data plot, 1 - other plot, - /// 2 - setup, 3 - data handle, 4 - subplot, 5 - program -}; -extern mglCommand mgls_base_cmd[]; -//----------------------------------------------------------------------------- -/// Structure for the mglData handling (see mglParse class). -struct mglVar -{ - mglData d; ///< Data itself - wchar_t s[256]; ///< Data name - void *o; ///< Pointer to external object - mglVar *next; ///< Pointer to next instance in list - mglVar *prev; ///< Pointer to prev instance in list - bool temp; ///< This temporar variable - void (*func)(void *); ///< Callback function for destroying - - mglVar() { o=0; s[0]=0; next=prev=0; func=0; temp=false; }; - virtual ~mglVar(); - /// Move variable after \a var and copy \a func from \a var (if \a func is 0) - void MoveAfter(mglVar *var); -}; -//----------------------------------------------------------------------------- -/// Structure for the number handling (see mglParse class). -struct mglNum -{ - mreal d; ///< Number itself - wchar_t s[256]; ///< Number name - mglNum *next; ///< Pointer to next instance in list - mglNum *prev; ///< Pointer to prev instance in list - mglNum() { d=0; s[0]=0; next=prev=0; }; - virtual ~mglNum(); - /// Move variable after \a var and copy \a func from \a var (if \a func is 0) - void MoveAfter(mglNum *var); -}; -//----------------------------------------------------------------------------- -/// Structure for function name and position. -struct mglFunc -{ - long pos; - int narg; - wchar_t func[32]; - mglFunc *next; - mglFunc(long p, const wchar_t *f, mglFunc *prev=0); - ~mglFunc() { if(next) delete next; }; -}; -//----------------------------------------------------------------------------- -/// Structure for stack of functions and its arguments. -struct mglFnStack -{ - long pos; - wchar_t *par[9]; -}; -//----------------------------------------------------------------------------- -/// Structure for the command argument (see mglGraph::Exec()). -class mglParse -{ -friend void mgl_export(wchar_t *out, const wchar_t *in, int type); -public: - static mglCommand Prg[]; ///< List of program flow commands (parsed by itself) - mglVar *DataList; ///< List with data and its names - mglNum *NumList; ///< List with numbers and its names - bool AllowSetSize; ///< Allow using setsize command - bool Stop; ///< Stop command was. Flag prevent further execution - mglCommand *Cmd; ///< Table of recognizable MGL commands (can be changed by user). It MUST be sorted by 'name' field !!! - wchar_t *op1, *op2; ///< Buffer for options (are used if out!=NULL) - - mglParse(bool setsize=false); - ~mglParse(); ///< NOTE: virtual destructor here give SegFault under GCC 4.5.2 - /// Find the command by the keyword name - mglCommand *FindCommand(const wchar_t *name, bool prog=false); - /// Parse and execute the string of MGL script - int Parse(mglGraph *gr, const char *str, long pos=0); - /// Parse and execute the unicode string of MGL script - int Parse(mglGraph *gr, const wchar_t *str, long pos=0); - /// Parse, execute and export it in C++ code the string of MGL script - int Export(wchar_t cpp_out[1024], mglGraph *gr, const wchar_t *str); - /// Execute MGL script file \a fname - void Execute(mglGraph *gr, FILE *fp, bool print=false); - /// Execute MGL script from array of lines - void Execute(mglGraph *gr, int num, const wchar_t **text, void (*error)(int line, int kind, mglGraph *gr)=NULL); - /// Execute MGL script text with '\n' separated lines - void Execute(mglGraph *gr, const wchar_t *text, void (*error)(int line, int kind, mglGraph *gr)=NULL); - /// Execute MGL script text with '\n' separated lines - void Execute(mglGraph *gr, const char *text, void (*error)(int line, int kind, mglGraph *gr)=NULL); - /// Scan for functions (use NULL for reset) - void ScanFunc(const wchar_t *line); - /// Check if name is function and return its address (or 0 if no) - long IsFunc(const wchar_t *name, int *narg=0); - /// Find variable or return 0 if absent - mglVar *FindVar(const char *name); - /// Find variable or return 0 if absent - mglVar *FindVar(const wchar_t *name); - /// Find variable or create it if absent - mglVar *AddVar(const char *name); - /// Find variable or create it if absent - mglVar *AddVar(const wchar_t *name); - /// Find number or return 0 if absent - mglNum *FindNum(const char *name); - /// Find number or return 0 if absent - mglNum *FindNum(const wchar_t *name); - /// Find number or create it if absent - mglNum *AddNum(const char *name); - /// Find number or create it if absent - mglNum *AddNum(const wchar_t *name); - /// Add string for parameter $1, ..., $9 - bool AddParam(int n, const char *str, bool isstr=true); - /// Add unicode string for parameter $1, ..., $9 - bool AddParam(int n, const wchar_t *str, bool isstr=true); - /// Add new MGL command(s) (last command MUST HAVE name[0]=0 !!!) - void AddCommand(mglCommand *cmd, int num=0); - /// Restore Once flag - inline void RestoreOnce() { Once = true; }; - /// Delete variable - void DeleteVar(mglVar *v); - /// Delete variable by its name - void DeleteVar(const char *name); - /// Delete variable by its name - void DeleteVar(const wchar_t *name); -private: - long parlen; ///< Length of parameter strings - wchar_t *par[40]; ///< Parameter for substituting instead of $1, ..., $9 - wchar_t *out; ///< Buffer for writing C++ code (if not NULL) - wchar_t leg[128]; ///< Buffer for legend - bool opt[16]; ///< Set on/off optional parameters for command argument - mreal val[20]; ///< Values for optional parameters - bool Once; ///< Flag for command which should be executed only once - bool Skip; ///< Flag that commands should be skiped (inside 'once' block) - int if_stack[40]; ///< Stack for if-else-endif commands - int if_pos; ///< position in if_stack - mglFunc *func; ///< function names and position - mglFnStack *fn_stack; ///< function calls stack - int fn_pos; ///< position in function stack - int fn_num; ///< size of function stack - int if_for[40]; ///< position in if_stack for for-cycle start - mglData *fval; ///< Values for for-cycle. Note that nx - number of elements, ny - next element, nz - address (or string number) of first cycle command - int for_stack[40]; ///< The order of for-variables - int for_addr; ///< Flag for saving address in variable (for_addr-1) - bool for_br; ///< Break is switched on (skip all comands until 'next') - - /// Parse command - int Exec(mglGraph *gr, const wchar_t *com, long n, mglArg *a, const wchar_t *var); - /// Fill arguments \a a from strings - void FillArg(mglGraph *gr, int n, wchar_t **arg, mglArg *a); - /// PreExecute stage -- parse some commands and create variables - int PreExec(mglGraph *gr, long n, wchar_t **arg, mglArg *a); - /// Process optional arguments - void ProcOpt(mglGraph *gr, wchar_t *str); - /// Execute program-flow control commands - int FlowExec(mglGraph *gr, const wchar_t *com, long n, mglArg *a); - /// Parse and execute the unicode string of MGL script - int ParseDat(mglGraph *gr, const wchar_t *str, mglData &res); - /// Parse $N arguments - void PutArg(const wchar_t *string, wchar_t *str, bool def); - /// In skip mode - bool inline ifskip() { return (if_pos>0 && !(if_stack[if_pos-1]&1)); }; - bool inline skip() { return (Skip || ifskip() || for_br); }; -}; -//----------------------------------------------------------------------------- -#endif +/*************************************************************************** + * parser.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef _MGL_PARSER_H_ +#define _MGL_PARSER_H_ + +#ifdef __cplusplus +#include "mgl/mgl.h" +#include +//----------------------------------------------------------------------------- +/// Structure for the command argument. +struct mglArg +{ + int type; ///< Type of argument {0-data,1-string,2-number} + mglData *d; ///< Pointer to data (used if type==0) + std::wstring w; ///< String with parameters + std::string s; ///< String with parameters + mreal v; ///< Numerical value (used if type==2) + mglArg() { type=-1; d=0; v=0; s[0]=0; w[0]=0; }; +}; +//----------------------------------------------------------------------------- +/// Structure for MGL command +struct mglCommand +{ + const wchar_t *name; ///< Name of command + const wchar_t *desc; ///< Short command description (can be NULL) + const wchar_t *form; ///< Format of command arguments (can be NULL) + /// Function for executing (plotting) + int (*exec)(mglGraph *gr, long n, mglArg *a, int k[10], const char *opt); + /// Function for exporting in C++ (can be NULL) + void (*save)(wchar_t out[1024], long n, mglArg *a, int k[10], const char *opt); + bool create; ///< Should parser create 1st the array automatically + int type; ///< Type of command: 0 - data plot, 1 - other plot, + /// 2 - setup, 3 - data handle, 4 - subplot, 5 - program +}; +extern mglCommand mgls_base_cmd[]; +//----------------------------------------------------------------------------- +/// Structure for the mglData handling (see mglParse class). +struct mglVar +{ + mglData d; ///< Data itself + std::wstring s; ///< Data name + void *o; ///< Pointer to external object + mglVar *next; ///< Pointer to next instance in list + mglVar *prev; ///< Pointer to prev instance in list + bool temp; ///< This temporar variable + void (*func)(void *); ///< Callback function for destroying + + mglVar() { o=0; next=prev=0; func=0; temp=false; }; + ~mglVar(); + /// Move variable after \a var and copy \a func from \a var (if \a func is 0) + void MoveAfter(mglVar *var); +}; +//----------------------------------------------------------------------------- +/// Structure for the number handling (see mglParse class). +struct mglNum +{ + mreal d; ///< Number itself + std::wstring s; ///< Number name + mglNum *next; ///< Pointer to next instance in list + mglNum *prev; ///< Pointer to prev instance in list + mglNum() { d=0; next=prev=0; }; + ~mglNum(); + /// Move variable after \a var and copy \a func from \a var (if \a func is 0) + void MoveAfter(mglNum *var); +}; +//----------------------------------------------------------------------------- +/// Structure for function name and position. +struct mglFunc +{ + long pos; + int narg; + std::wstring func; + mglFunc *next; + mglFunc(long p, const wchar_t *f, mglFunc *prev=0); + ~mglFunc() { if(next) delete next; }; +}; +//----------------------------------------------------------------------------- +/// Structure for stack of functions and its arguments. +struct mglFnStack +{ + long pos; + wchar_t *par[9]; +}; +//----------------------------------------------------------------------------- +/// Structure for the command argument (see mglGraph::Exec()). +class mglParser +{ +friend void mgl_export(wchar_t *out, const wchar_t *in, int type); +public: + static mglCommand Prg[]; ///< List of program flow commands (parsed by itself) + mglVar *DataList; ///< List with data and its names + mglNum *NumList; ///< List with numbers and its names + bool AllowSetSize; ///< Allow using setsize command + bool Stop; ///< Stop command was. Flag prevent further execution + mglCommand *Cmd; ///< Table of recognizable MGL commands (can be changed by user). It MUST be sorted by 'name' field !!! + wchar_t *op1, *op2; ///< Buffer for options (are used if out!=NULL) + + mglParser(bool setsize=false); + ~mglParser(); + /// Find the command by the keyword name + mglCommand *FindCommand(const wchar_t *name, bool prog=false); + /// Parse and execute the string of MGL script + inline int Parse(HMGL gr, const char *str, long pos=0) + { mglGraph GR(gr); return Parse(&GR,str,pos); } + int Parse(mglGraph *gr, const char *str, long pos=0); + /// Parse and execute the unicode string of MGL script + inline int Parse(HMGL gr, const wchar_t *str, long pos=0) + { mglGraph GR(gr); return Parse(&GR,str,pos); } + int Parse(mglGraph *gr, const wchar_t *str, long pos=0); + /// Parse, execute and export it in C++ code the string of MGL script + inline int Export(wchar_t cpp_out[1024], HMGL gr, const wchar_t *str) + { mglGraph GR(gr); return Export(cpp_out,&GR,str); } + int Export(wchar_t cpp_out[1024], mglGraph *gr, const wchar_t *str); + /// Execute MGL script file \a fname + inline void Execute(HMGL gr, FILE *fp, bool print=false) + { mglGraph GR(gr); Execute(&GR,fp,print); } + void Execute(mglGraph *gr, FILE *fp, bool print=false); + /// Execute MGL script from array of lines + inline void Execute(HMGL gr, int num, const wchar_t **text, void (*error)(int line, int kind, char *mes)=NULL) + { mglGraph GR(gr); Execute(&GR,num,text,error); } + void Execute(mglGraph *gr, int num, const wchar_t **text, void (*error)(int line, int kind, char *mes)=NULL); + /// Execute MGL script text with '\n' separated lines + inline void Execute(HMGL gr, const wchar_t *text, void (*error)(int line, int kind, char *mes)=NULL) + { mglGraph GR(gr); Execute(&GR,text,error); } + void Execute(mglGraph *gr, const wchar_t *text, void (*error)(int line, int kind, char *mes)=NULL); + /// Execute MGL script text with '\n' separated lines + inline void Execute(HMGL gr, const char *text, void (*error)(int line, int kind, char *mes)=NULL) + { mglGraph GR(gr); Execute(&GR,text,error); } + void Execute(mglGraph *gr, const char *text, void (*error)(int line, int kind, char *mes)=NULL); + /// Scan for functions (use NULL for reset) + void ScanFunc(const wchar_t *line); + /// Check if name is function and return its address (or 0 if no) + long IsFunc(const wchar_t *name, int *narg=0); + /// Find variable or return 0 if absent + mglVar *FindVar(const char *name); + /// Find variable or return 0 if absent + mglVar *FindVar(const wchar_t *name); + /// Find variable or create it if absent + mglVar *AddVar(const char *name); + /// Find variable or create it if absent + mglVar *AddVar(const wchar_t *name); + /// Find number or return 0 if absent + mglNum *FindNum(const char *name); + /// Find number or return 0 if absent + mglNum *FindNum(const wchar_t *name); + /// Find number or create it if absent + mglNum *AddNum(const char *name); + /// Find number or create it if absent + mglNum *AddNum(const wchar_t *name); + /// Add string for parameter $1, ..., $9 + bool AddParam(int n, const char *str, bool isstr=true); + /// Add unicode string for parameter $1, ..., $9 + bool AddParam(int n, const wchar_t *str, bool isstr=true); + /// Add new MGL command(s) (last command MUST HAVE name[0]=0 !!!) + void AddCommand(mglCommand *cmd, int num=0); + /// Restore Once flag + inline void RestoreOnce() { Once = true; }; + /// Delete variable + void DeleteVar(mglVar *v); + /// Delete variable by its name + void DeleteVar(const char *name); + /// Delete variable by its name + void DeleteVar(const wchar_t *name); +private: + long parlen; ///< Length of parameter strings + wchar_t *par[40]; ///< Parameter for substituting instead of $1, ..., $9 + wchar_t *out; ///< Buffer for writing C++ code (if not NULL) + wchar_t leg[128]; ///< Buffer for legend + bool Once; ///< Flag for command which should be executed only once + bool Skip; ///< Flag that commands should be skiped (inside 'once' block) + int if_stack[40]; ///< Stack for if-else-endif commands + int if_pos; ///< position in if_stack + mglFunc *func; ///< function names and position + mglFnStack *fn_stack; ///< function calls stack + int fn_pos; ///< position in function stack + int fn_num; ///< size of function stack + int if_for[40]; ///< position in if_stack for for-cycle start + mglData *fval; ///< Values for for-cycle. Note that nx - number of elements, ny - next element, nz - address (or string number) of first cycle command + int for_stack[40]; ///< The order of for-variables + int for_addr; ///< Flag for saving address in variable (for_addr-1) + bool for_br; ///< Break is switched on (skip all comands until 'next') + + /// Parse command + int Exec(mglGraph *gr, const wchar_t *com, long n, mglArg *a, const wchar_t *var, const wchar_t *opt); + /// Fill arguments \a a from strings + void FillArg(mglGraph *gr, int n, wchar_t **arg, mglArg *a); + /// PreExecute stage -- parse some commands and create variables + int PreExec(mglGraph *gr, long n, wchar_t **arg, mglArg *a); + /// Execute program-flow control commands + int FlowExec(mglGraph *gr, const wchar_t *com, long n, mglArg *a); + /// Parse and execute the unicode string of MGL script + int ParseDat(mglGraph *gr, const wchar_t *str, mglData &res); + /// Parse $N arguments + void PutArg(const wchar_t *string, wchar_t *str, bool def); + /// In skip mode + bool inline ifskip() { return (if_pos>0 && !(if_stack[if_pos-1]&1)); }; + bool inline skip() { return (Skip || ifskip() || for_br); }; +}; +//----------------------------------------------------------------------------- +#endif #endif -//----------------------------------------------------------------------------- - diff --git a/include/mgl/plot.h b/include/mgl/plot.h new file mode 100644 index 0000000..10e8ea1 --- /dev/null +++ b/include/mgl/plot.h @@ -0,0 +1,136 @@ +/*************************************************************************** + * plot.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef _MGL_1D_H_ +#define _MGL_1D_H_ +#include "mgl/base.h" +/*****************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif +/*****************************************************************************/ +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); +void mgl_fplot_(uintptr_t *gr, const char *fy, const char *stl, const char *opt, int ly, int ls, int lo); +void mgl_fplot_xyz_(uintptr_t *gr, const char *fx, const char *fy, const char *fz, const char *stl, const char *opt, int lx, int ly, int lz, int ls, int lo); +/*****************************************************************************/ +void mgl_radar(HMGL graph, HCDT a, const char *pen, const char *opt); +void mgl_radar_(uintptr_t *gr, uintptr_t *a, const char *pen, const char *opt, int l,int lo); +/*****************************************************************************/ +void mgl_plot_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, const char *pen, const char *opt); +void mgl_plot_xy(HMGL graph, HCDT x, HCDT y, const char *pen, const char *opt); +void mgl_plot(HMGL graph, HCDT y, const char *pen, const char *opt); +void mgl_plot_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen, const char *opt,int,int); +void mgl_plot_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, const char *pen, const char *opt,int,int); +void mgl_plot_(uintptr_t *graph, uintptr_t *y, const char *pen, const char *opt,int,int); +/*****************************************************************************/ +void mgl_tens_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT c, const char *pen, const char *opt); +void mgl_tens_xy(HMGL graph, HCDT x, HCDT y, HCDT c, const char *pen, const char *opt); +void mgl_tens(HMGL graph, HCDT y, HCDT c, const char *pen, const char *opt); +void mgl_tens_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *pen, const char *opt,int,int); +void mgl_tens_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *c, const char *pen, const char *opt,int,int); +void mgl_tens_(uintptr_t *graph, uintptr_t *y, uintptr_t *c, const char *pen, const char *opt,int,int); +/*****************************************************************************/ +void mgl_boxplot_xy(HMGL graph, HCDT x, HCDT a, const char *pen, const char *opt); +void mgl_boxplot(HMGL graph, HCDT a, const char *pen, const char *opt); +/*****************************************************************************/ +void mgl_area_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, const char *pen, const char *opt); +void mgl_area_xy(HMGL graph, HCDT x, HCDT y, const char *pen, const char *opt); +void mgl_area(HMGL graph, HCDT y, const char *pen, const char *opt); +/*****************************************************************************/ +void mgl_region_xy(HMGL graph, HCDT x, HCDT y1, HCDT y2, const char *pen, const char *opt); +void mgl_region(HMGL graph, HCDT y1, HCDT y2, const char *pen, const char *opt); +/*****************************************************************************/ +void mgl_stem_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, const char *pen, const char *opt); +void mgl_stem_xy(HMGL graph, HCDT x, HCDT y, const char *pen, const char *opt); +void mgl_stem(HMGL graph, HCDT y, const char *pen, const char *opt); +/*****************************************************************************/ +void mgl_step_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, const char *pen, const char *opt); +void mgl_step_xy(HMGL graph, HCDT x, HCDT y, const char *pen, const char *opt); +void mgl_step(HMGL graph, HCDT y, const char *pen, const char *opt); +/*****************************************************************************/ +void mgl_bars_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, const char *pen, const char *opt); +void mgl_bars_xy(HMGL graph, HCDT x, HCDT y, const char *pen, const char *opt); +void mgl_bars(HMGL graph, HCDT y, const char *pen, const char *opt); +/*****************************************************************************/ +void mgl_barh_yx(HMGL graph, HCDT y, HCDT v, const char *pen, const char *opt); +void mgl_barh(HMGL graph, HCDT v, const char *pen, const char *opt); +/*****************************************************************************/ +void mgl_chart(HMGL graph, HCDT a, const char *col, const char *opt); +/*****************************************************************************/ +void mgl_error_exy(HMGL graph, HCDT x, HCDT y, HCDT ex, HCDT ey, const char *pen, const char *opt); +void mgl_error_xy(HMGL graph, HCDT x, HCDT y, HCDT ey, const char *pen, const char *opt); +void mgl_error(HMGL graph, HCDT y, HCDT ey, const char *pen, const char *opt); +/*****************************************************************************/ +void mgl_mark_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT r, const char *pen, const char *opt); +void mgl_mark_xy(HMGL graph, HCDT x, HCDT y, HCDT r, const char *pen, const char *opt); +void mgl_mark_y(HMGL graph, HCDT y, HCDT r, const char *pen, const char *opt); +/*****************************************************************************/ +void mgl_tube_xyzr(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT r, const char *pen, const char *opt); +void mgl_tube_xyr(HMGL graph, HCDT x, HCDT y, HCDT r, const char *pen, const char *opt); +void mgl_tube_r(HMGL graph, HCDT y, HCDT r, const char *pen, const char *opt); +void mgl_tube_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, float r, const char *pen, const char *opt); +void mgl_tube_xy(HMGL graph, HCDT x, HCDT y, float r, const char *penl, const char *opt); +void mgl_tube(HMGL graph, HCDT y, float r, const char *pen, const char *opt); +/*****************************************************************************/ +void mgl_candle_xyv(HMGL gr, HCDT x, HCDT v1, HCDT v2, HCDT y1, HCDT y2, const char *pen, const char *opt); +void mgl_candle_yv(HMGL gr, HCDT v1, HCDT v2, HCDT y1, HCDT y2, const char *pen, const char *opt); +void mgl_candle(HMGL gr, HCDT v, HCDT y1, HCDT y2, const char *pen, const char *opt); +/*****************************************************************************/ +void mgl_boxplot_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, const char *pen, const char *opt,int,int); +void mgl_boxplot_(uintptr_t *graph, uintptr_t *y, const char *pen, const char *opt,int,int); +void mgl_area_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen, const char *opt,int,int); +void mgl_area_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, const char *pen, const char *opt,int,int); +void mgl_area_s_(uintptr_t *graph, uintptr_t *y, const char *pen, const char *opt,int,int); +void mgl_area_(uintptr_t *graph, uintptr_t *y, const char *pen, const char *opt,int,int); +void mgl_region_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y1, uintptr_t *y2, const char *pen, const char *opt,int, int); +void mgl_region_(uintptr_t *graph, uintptr_t *y1, uintptr_t *y2, const char *pen, const char *opt,int, int); +void mgl_stem_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen, const char *opt,int,int); +void mgl_stem_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, const char *pen, const char *opt,int,int); +void mgl_stem_(uintptr_t *graph, uintptr_t *y, const char *pen, const char *opt,int,int); +void mgl_step_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen, const char *opt,int,int); +void mgl_step_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, const char *pen, const char *opt,int,int); +void mgl_step_(uintptr_t *graph, uintptr_t *y, const char *pen, const char *opt,int,int); +void mgl_bars_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen, const char *opt,int,int); +void mgl_bars_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, const char *pen, const char *opt,int,int); +void mgl_bars_(uintptr_t *graph, uintptr_t *y, const char *pen, const char *opt,int,int); +void mgl_barh_yx_(uintptr_t *graph, uintptr_t *y, uintptr_t *v, const char *pen, const char *opt,int,int); +void mgl_barh_(uintptr_t *graph, uintptr_t *v, const char *pen, const char *opt,int,int); +void mgl_chart_(uintptr_t *graph, uintptr_t *a, const char *col, const char *opt,int,int); +void mgl_error_(uintptr_t *graph, uintptr_t *y, uintptr_t *ey, const char *pen, const char *opt,int,int); +void mgl_error_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *ey, const char *pen, const char *opt,int,int); +void mgl_error_exy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *ex, uintptr_t *ey, const char *pen, const char *opt,int,int); +void mgl_mark_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *r, const char *pen, const char *opt,int,int); +void mgl_mark_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *r, const char *pen, const char *opt,int,int); +void mgl_mark_y_(uintptr_t *graph, uintptr_t *y, uintptr_t *r, const char *pen, const char *opt,int,int); +void mgl_tube_xyzr_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *r, const char *pen, const char *opt,int,int); +void mgl_tube_xyr_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *r, const char *pen, const char *opt,int,int); +void mgl_tube_r_(uintptr_t *graph, uintptr_t *y, uintptr_t *r, const char *pen, const char *opt,int,int); +void mgl_tube_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, float *r, const char *pen, const char *opt,int,int); +void mgl_tube_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, float *r, const char *pen, const char *opt,int,int); +void mgl_tube_(uintptr_t *graph, uintptr_t *y, float *r, const char *pen, const char *opt,int,int); +void mgl_candle_xyv_(uintptr_t *gr, uintptr_t *x, uintptr_t *v1, uintptr_t *v2, uintptr_t *y1, uintptr_t *y2, const char *pen, const char *opt,int,int); +void mgl_candle_yv_(uintptr_t *gr, uintptr_t *v1, uintptr_t *v2, uintptr_t *y1, uintptr_t *y2, const char *pen, const char *opt,int,int); +void mgl_candle_(uintptr_t *gr, uintptr_t *y, uintptr_t *y1, uintptr_t *y2, const char *pen, const char *opt,int,int); +/*****************************************************************************/ +#ifdef __cplusplus +} +#endif +/*****************************************************************************/ +#endif diff --git a/include/mgl/prim.h b/include/mgl/prim.h new file mode 100644 index 0000000..c2453ac --- /dev/null +++ b/include/mgl/prim.h @@ -0,0 +1,104 @@ +/*************************************************************************** + * prim.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef _MGL_PRIM_H_ +#define _MGL_PRIM_H_ +#include "mgl/base.h" +/*****************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif +/*****************************************************************************/ +void mgl_mark(HMGL gr, float x,float y,float z,const char *mark); +void mgl_ball(HMGL gr, float x,float y,float z); + +void mgl_line(HMGL gr, float x1, float y1, float z1, float x2, float y2, float z2, const char *pen,int n); +void mgl_curve(HMGL gr, float x1, float y1, float z1, float dx1, float dy1, float dz1, float x2, float y2, float z2, float dx2, float dy2, float dz2, const char *pen,int n); + +void mgl_error_box(HMGL gr, float x, float y, float z, float ex, float ey, float ez, const char *pen); + +void mgl_face(HMGL gr, float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, const char *stl); +void mgl_facex(HMGL gr, float x0, float y0, float z0, float wy, float wz, const char *stl, float dx, float dy); +void mgl_facey(HMGL gr, float x0, float y0, float z0, float wx, float wz, const char *stl, float dx, float dy); +void mgl_facez(HMGL gr, float x0, float y0, float z0, float wx, float wy, const char *stl, float dx, float dy); + +void mgl_sphere(HMGL gr, float x, float y, float z, float r, const char *stl); +void mgl_drop(HMGL gr, float x1, float y1, float z1, float x2, float y2, float z2, float r, const char *stl, float shift, float ap); +void mgl_cone(HMGL gr, float x1, float y1, float z1, float x2, float y2, float z2, float r1, float r2, const char *stl, int edge); +void mgl_ellipse(HMGL gr, float x1, float y1, float z1, float x2, float y2, float z2, float r, const char *stl); +void mgl_rhomb(HMGL gr, float x1, float y1, float z1, float x2, float y2, float z2, float r, const char *stl); + +void mgl_dew_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt); +void mgl_dew_2d(HMGL gr, HCDT ax, HCDT ay, const char *sch, const char *optl); + +void mgl_puts(HMGL graph, float x, float y, float z,const char *text, const char *font, float size); +void mgl_putsw(HMGL graph, float x, float y, float z,const wchar_t *text, const char *font, float size); + +void mgl_puts_dir(HMGL graph, float x, float y, float z, float dx, float dy, float dz, const char *text, const char *font, float size); +void mgl_putsw_dir(HMGL graph, float x, float y, float z, float dx, float dy, float dz, const wchar_t *text, const char *font, float size); + +void mgl_textmark_xyzr(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT r, const char *text, const char *fnt, const char *opt); +void mgl_textmark_xyr(HMGL graph, HCDT x, HCDT y, HCDT r, const char *text, const char *fnt, const char *opt); +void mgl_textmark_yr(HMGL graph, HCDT y, HCDT r, const char *text, const char *fnt, const char *opt); +void mgl_textmark(HMGL graph, HCDT y, const char *text, const char *fnt, const char *opt); +void mgl_textmarkw_xyzr(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT r, const wchar_t *text, const char *fnt, const char *opt); +void mgl_textmarkw_xyr(HMGL graph, HCDT x, HCDT y, HCDT r, const wchar_t *text, const char *fnt, const char *opt); +void mgl_textmarkw_yr(HMGL graph, HCDT y, HCDT r, const wchar_t *text, const char *fnt, const char *opt); +void mgl_textmarkw(HMGL graph, HCDT y, const wchar_t *text, const char *fnt, const char *opt); + +void mgl_puts_fit(HMGL gr, float x, float y, float z, const char *prefix, const char *font, float size); + +/*****************************************************************************/ +void mgl_mark_(uintptr_t *gr, float *x,float *y,float *z,const char *mark,int); +void mgl_ball_(uintptr_t *gr, float *x,float *y,float *z); + +void mgl_line_(uintptr_t *gr, float *x1, float *y1, float *z1, float *x2, float *y2, float *z2, const char *pen,int *n,int); +void mgl_curve_(uintptr_t* gr, float *x1, float *y1, float *z1, float *dx1, float *dy1, float *dz1, float *x2, float *y2, float *z2, float *dx2, float *dy2, float *dz2, const char *pen,int *n, int l); + +void mgl_error_box_(uintptr_t* gr, float *x, float *y, float *z, float *ex, float *ey, float *ez, const char *pen, int); + +void mgl_face_(uintptr_t* gr, float *x0, float *y0, float *z0, float *x1, float *y1, float *z1, float *x2, float *y2, float *z2, float *x3, float *y3, float *z3, const char *stl, int); +void mgl_facex_(uintptr_t* gr, float *x0, float *y0, float *z0, float *wy, float *wz, const char *stl, float *dx, float *dy, int l); +void mgl_facey_(uintptr_t* gr, float *x0, float *y0, float *z0, float *wx, float *wz, const char *stl, float *dx, float *dy, int l); +void mgl_facez_(uintptr_t* gr, float *x0, float *y0, float *z0, float *wx, float *wy, const char *stl, float *dx, float *dy, int l); + +void mgl_sphere_(uintptr_t* gr, float *x, float *y, float *z, float *r, const char *stl, int); +void mgl_drop_(uintptr_t* gr, float *x1, float *y1, float *z1, float *x2, float *y2, float *z2, float *r, const char *stl, float *shift, float *ap, int); +void mgl_cone_(uintptr_t* gr, float *x1, float *y1, float *z1, float *x2, float *y2, float *z2, float *r1, float *r2, const char *stl, int *edge, int); +void mgl_ellipse_(uintptr_t* gr, float *x1, float *y1, float *z1, float *x2, float *y2, float *z2, float *r, const char *stl, int); +void mgl_rhomb_(uintptr_t* gr, float *x1, float *y1, float *z1, float *x2, float *y2, float *z2, float *r, const char *stl, int); + +void mgl_puts_(uintptr_t *graph, float *x, float *y, float *z,const char *text, const char *font, float *size, int, int); +void mgl_puts_dir_(uintptr_t *graph, float *x, float *y, float *z, float *dx, float *dy, float *dz, const char *text, const char *font, float *size, int, int); + +void mgl_textmark_xyzr_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *r, const char *text, const char *fnt, const char *opt,int,int,int); +void mgl_textmark_xyr_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *r, const char *text, const char *fnt, const char *opt,int,int,int); +void mgl_textmark_yr_(uintptr_t *graph, uintptr_t *y, uintptr_t *r, const char *text, const char *fnt, const char *opt,int,int,int); +void mgl_textmark_(uintptr_t *graph, uintptr_t *y, const char *text, const char *fnt, const char *opt,int,int,int); + +void mgl_puts_fit_(uintptr_t* gr, float *x, float *y, float *z, const char *prefix, const char *font, float *size, int l, int n); + +void mgl_dew_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int,int); +void mgl_dew_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int,int l); +/*****************************************************************************/ +#ifdef __cplusplus +} +#endif +/*****************************************************************************/ +#endif diff --git a/include/mgl/mgl_qt.h b/include/mgl/qt.h similarity index 72% rename from include/mgl/mgl_qt.h rename to include/mgl/qt.h index 52e2379..09f3a82 100644 --- a/include/mgl/mgl_qt.h +++ b/include/mgl/qt.h @@ -1,192 +1,177 @@ -/*************************************************************************** - * mgl_qt.h is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -//----------------------------------------------------------------------------- -#ifdef _MGL_W_H_ -#warning "MathGL wrapper was enabled. So disable original MathGL classes" -#else -#ifndef MGL_QT_H -#define MGL_QT_H -//----------------------------------------------------------------------------- -#include -#include -#include -//----------------------------------------------------------------------------- -class QTextEdit; -class QMenu; -class QMainWindow; -class QMathGL; -class QScrollArea; -class QSpinBox; -class QTimer; -int mglQtRun(); -//----------------------------------------------------------------------------- -class mglGraphQT : public mglGraphZB -{ -friend class QMathGL; -public: -using mglGraphAB::Window; - int sshow; ///< Current state of animation switch (toggle button) - QMathGL *QMGL; ///< Control which draw graphics - int CurFig; ///< Current figure in the list. - QMainWindow *Wnd; ///< Pointer to window - - mglGraphQT(); - virtual ~mglGraphQT(); - - void SetSize(int w,int h); - void EndFrame(); - const unsigned char *GetBits(); - void Clf(mglColor Back=NC); - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ñëóæåáíûå ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /// Create a window for plotting. Now implemeted only for GLUT. - void Window(int argc, char **argv, int (*draw)(mglGraph *gr, void *p), - const char *title,void *par=NULL, - void (*reload)(int next, void *p)=NULL, bool maximize=false); - /// Switch on/off transparency (do not overwrite switches in user drawing function) - void ToggleAlpha(); - /// Switch on/off lighting (do not overwrite switches in user drawing function) - void ToggleLight(); - void ToggleZoom(); ///< Switch on/off zooming by mouse - void ToggleRotate();///< Switch on/off rotation by mouse - void ToggleNo(); ///< Switch off all zooming and rotation - void Update(); ///< Update picture by calling user drawing function - void ReLoad(bool o);///< Reload user data and update picture - void Adjust(); ///< Adjust size of bitmap to window size - void NextFrame(); ///< Show next frame (if one) - void PrevFrame(); ///< Show previous frame (if one) - void Animation(); ///< Run slideshow (animation) of frames - -protected: - unsigned char *GG; ///< images for all frames (may be too LARGE !!!) - QScrollArea *scroll; ///< Scrolling area - QMenu *popup; ///< Popup menu - QSpinBox *tet, *phi; ///< Spin box for angles - QAction *anim; - - void makeMenu(); ///< Create menu, toolbar and popup menu -}; -//----------------------------------------------------------------------------- -/// Class is Qt widget which display MathGL graphics -class QMathGL : public QWidget -{ -Q_OBJECT -public: - QString appName; ///< Application name for message boxes - bool autoResize; ///< Allow auto resizing (default is false) - int animDelay; ///< Animation delay in ms - - QMathGL(QWidget *parent = 0, Qt::WindowFlags f = 0); - virtual ~QMathGL(); - double getRatio() { return double(graph->GetWidth())/graph->GetHeight(); }; - void setPopup(QMenu *p) { popup = p; }; ///< Set popup menu pointer - void setSize(int w, int h); ///< Set window/picture sizes - void setGraph(mglGraphAB *gr); ///< Set grapher object - /// Set drawing functions and its parameter - void setDraw(int (*func)(mglGraph *gr, void *par), void *par=0); - void setDraw(mglDraw *dr); ///< Set drawing functions from mglDraw class - - - int getPer() {return int(per);}; ///< Get perspective value - int getPhi() {return int(phi);}; ///< Get Phi-angle value - int getTet() {return int(tet);}; ///< Get Theta-angle value - bool getAlpha() {return alpha;}; ///< Get transparency state - bool getLight() {return light;}; ///< Get lightning state - bool getZoom() {return zoom;}; ///< Get mouse zooming state - bool getRotate(){return rotate;}; ///< Get mouse rotation state - -public slots: - void refresh(); - void update(mglGraph *gr=0); ///< Update picture - void copy(); ///< copy graphics to clipboard - void print(); ///< Print plot -// void stop(); ///< Stop execution - void setPer(int p); ///< Set perspective value - void setPhi(int p); ///< Set Phi-angle value - void setTet(int t); ///< Set Theta-angle value - void setAlpha(bool a); ///< Switch on/off transparency - void setLight(bool l); ///< Switch on/off lightning - void setZoom(bool z); ///< Switch on/off mouse zooming - void setRotate(bool r); ///< Switch on/off mouse rotation - void zoomIn(); ///< Zoom in graphics - void zoomOut(); ///< Zoom out graphics - void restore(); ///< Restore zoom and rotation to default values -// void reload(); ///< Reload data and execute script - void shiftLeft(); ///< Shift graphics to left direction - void shiftRight(); ///< Shift graphics to right direction - void shiftUp(); ///< Shift graphics to up direction - void shiftDown(); ///< Shift graphics to down direction - void exportPNG(QString fname=""); ///< export to PNG file - void exportPNGs(QString fname=""); ///< export to PNG file (no transparency) - void exportJPG(QString fname=""); ///< export to JPEG file - void exportBPS(QString fname=""); ///< export to bitmap EPS file - void exportEPS(QString fname=""); ///< export to vector EPS file - void exportSVG(QString fname=""); ///< export to SVG file - void exportIDTF(QString fname=""); ///< export to IDTF file - void setMGLFont(QString path); ///< restore/load font for graphics - //----These functions are executed only if graph is mglGraphQT instance---- - void adjust(); ///< Adjust plot size to fill entire window - void nextSlide(); ///< Show next slide - void prevSlide(); ///< Show previous slide - void animation(bool st=true); ///< Start animation - void about(); ///< Show about information - void aboutQt(); ///< Show information about Qt version -signals: - void phiChanged(int); ///< Phi angle changed (by mouse or by toolbar) - void tetChanged(int); ///< Tet angle changed (by mouse or by toolbar) - void perChanged(int); ///< Perspective changed (by mouse or by toolbar) - void alphaChanged(bool); ///< Transparency changed (by toolbar) - void lightChanged(bool); ///< Lighting changed (by toolbar) - void zoomChanged(bool); ///< Zooming changed (by toolbar) - void rotateChanged(bool); ///< Rotation changed (by toolbar) - void mouseClick(float,float,float); ///< Position of mouse click -protected: - void paintEvent(QPaintEvent *); - void resizeEvent(QResizeEvent *); - void mousePressEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - - mglGraphAB *graph; ///< Built-in mglGraph-er instance (used by default) - void *draw_par; ///< Parameters for drawing function mglGraph::DrawFunc. - /// Drawing function for window procedure. It should return the number of frames. - int (*draw_func)(mglGraph *gr, void *par); - QString mousePos; ///< Last mouse position - QPixmap pic; ///< Pixmap for drawing (changed by update) - double tet, phi; ///< Rotation angles - double per; ///< Value of perspective ( must be in [0,1) ) - bool alpha; ///< Transparency state - bool light; ///< Lightning state - bool zoom; ///< Mouse zoom state - bool rotate; ///< Mouse rotation state - mreal x1,x2,y1,y2; ///< Zoom in region - bool showMessage; ///< Flag for showing messages (enabled by each execute()) - QMenu *popup; ///< Pointer to pop-up menu - QTimer *timer; ///< Timer for animation -private: - int x0, y0, xe, ye; ///< Temporary variables for mouse - uchar *grBuf; -}; -//----------------------------------------------------------------------------- -/// Convert bitmap from mglGraphAB to QPixmap -void convertFromGraph(QPixmap &pic, mglGraphAB *gr, uchar **buf); -//----------------------------------------------------------------------------- -#endif +/*************************************************************************** + * window.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +//----------------------------------------------------------------------------- +#ifndef _MGL_QT_H_ +#define _MGL_QT_H_ +/*****************************************************************************/ +#ifdef __cplusplus +//----------------------------------------------------------------------------- +#include "mgl/window.h" +#include +#include +//----------------------------------------------------------------------------- +class QTextEdit; +class QMenu; +class QMainWindow; +class QScrollArea; +class QSpinBox; +class QTimer; +//----------------------------------------------------------------------------- +/// Class is Qt widget which display MathGL graphics +class QMathGL : public QWidget +{ + Q_OBJECT +public: + QString appName; ///< Application name for message boxes + bool autoResize; ///< Allow auto resizing (default is false) + + QMathGL(QWidget *parent = 0, Qt::WindowFlags f = 0); + ~QMathGL(); + double getRatio() { return double(graph->GetWidth())/graph->GetHeight(); }; + void setPopup(QMenu *p) { popup = p; }; ///< Set popup menu pointer + void setSize(int w, int h); ///< Set window/picture sizes + void setGraph(mglCanvas *gr); ///< Set grapher object + inline void setGraph(mglGraph *gr) + { setGraph(dynamic_cast(gr->Self())); } + inline HMGL getGraph() { return graph; } + /// Set drawing functions and its parameter + inline void setDraw(int (*func)(mglBase *gr, void *par), void *par=0) + { draw_func = func; draw_par = par; } + inline void setDraw(mglDraw *dr) + { setDraw(mgl_draw_class,(void*)dr); } + inline void setDraw(int (*draw)(mglGraph *gr)) + { setDraw(mgl_draw_graph,(void*)draw); } + + + int getPer() {return int(per);}; ///< Get perspective value + int getPhi() {return int(phi);}; ///< Get Phi-angle value + int getTet() {return int(tet);}; ///< Get Theta-angle value + bool getAlpha() {return alpha;}; ///< Get transparency state + bool getLight() {return light;}; ///< Get lightning state + bool getZoom() {return zoom;}; ///< Get mouse zooming state + bool getRotate(){return rotate;}; ///< Get mouse rotation state + +public slots: + void refresh(); + void update(mglCanvas *gr=0); ///< Update picture + void copy(); ///< copy graphics to clipboard + void print(); ///< Print plot +// void stop(); ///< Stop execution + void setPer(int p); ///< Set perspective value + void setPhi(int p); ///< Set Phi-angle value + void setTet(int t); ///< Set Theta-angle value + void setAlpha(bool a); ///< Switch on/off transparency + void setLight(bool l); ///< Switch on/off lightning + void setRotate(bool r); ///< Switch on/off mouse rotation + void restore(); ///< Restore zoom and rotation to default values + // void reload(); ///< Reload data and execute script + void exportPNG(QString fname=""); ///< export to PNG file + void exportPNGs(QString fname=""); ///< export to PNG file (no transparency) + void exportJPG(QString fname=""); ///< export to JPEG file + void exportBPS(QString fname=""); ///< export to bitmap EPS file + void exportEPS(QString fname=""); ///< export to vector EPS file + void exportSVG(QString fname=""); ///< export to SVG file + void exportIDTF(QString fname=""); ///< export to IDTF file + void setMGLFont(QString path); ///< restore/load font for graphics + /* //----These functions are executed only if graph is mglCanvasQT instance---- + * void adjust(); ///< Adjust plot size to fill entire window + * void nextSlide(); ///< Show next slide + * void prevSlide(); ///< Show previous slide + * void animation(bool st=true); ///< Start animation*/ + void about(); ///< Show about information + void aboutQt(); ///< Show information about Qt version +signals: + void phiChanged(int); ///< Phi angle changed (by mouse or by toolbar) + void tetChanged(int); ///< Tet angle changed (by mouse or by toolbar) + void perChanged(int); ///< Perspective changed (by mouse or by toolbar) + void alphaChanged(bool); ///< Transparency changed (by toolbar) + void lightChanged(bool); ///< Lighting changed (by toolbar) + void rotateChanged(bool); ///< Rotation changed (by toolbar) + void mouseClick(float,float,float); ///< Position of mouse click +protected: + void paintEvent(QPaintEvent *); + void resizeEvent(QResizeEvent *); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + + mglCanvas *graph; ///< Built-in mglCanvasQT-er instance (used by default) + void *draw_par; ///< Parameters for drawing function mglCanvasW::DrawFunc. + /// Drawing function for window procedure. It should return the number of frames. + int (*draw_func)(mglBase *gr, void *par); + QString mousePos; ///< Last mouse position + QPixmap pic; ///< Pixmap for drawing (changed by update) + double tet, phi; ///< Rotation angles + double per; ///< Value of perspective ( must be in [0,1) ) + bool alpha; ///< Transparency state + bool light; ///< Lightning state + bool zoom; ///< Mouse zoom state + bool rotate; ///< Mouse rotation state + float x1,x2,y1,y2; ///< Zoom in region + bool showMessage; ///< Flag for showing messages (enabled by each execute()) + QMenu *popup; ///< Pointer to pop-up menu + QTimer *timer; ///< Timer for animation +private: + int x0, y0, xe, ye; ///< Temporary variables for mouse + uchar *grBuf; +}; +//----------------------------------------------------------------------------- +/// Base class for windows containing MathGL graphics +class mglCanvasQT : public mglCanvasW +{ +public: +using mglCanvasW::Window; + int sshow; ///< Current state of animation switch (toggle button) + QMathGL *QMGL; ///< Control which draw graphics + QMainWindow *Wnd; ///< Pointer to window + + mglCanvasQT(); + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ñëóæåáíûå ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /// 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, void (*reload)(void *p)=NULL, bool maximize=false); + /// Switch on/off transparency (do not overwrite switches in user drawing function) + void ToggleAlpha(); + /// Switch on/off lighting (do not overwrite switches in user drawing function) + void ToggleLight(); + void ToggleRotate();///< Switch on/off rotation by mouse + void ToggleNo(); ///< Switch off all zooming and rotation + void Update(); ///< Update picture by calling user drawing function + void Adjust(); ///< Adjust size of bitmap to window size + void NextFrame(); ///< Show next frame (if one) + void PrevFrame(); ///< Show previous frame (if one) + void Animation(); ///< Run slideshow (animation) of frames + +protected: + QScrollArea *scroll; ///< Scrolling area + QMenu *popup; ///< Popup menu + QSpinBox *tet, *phi; ///< Spin box for angles + QAction *anim; + QTimer *timer; + + void makeMenu(); ///< Create menu, toolbar and popup menu +}; +//----------------------------------------------------------------------------- +/// Convert bitmap from mglCanvasW to QPixmap +void convertFromGraph(QPixmap &pic, mglCanvas *gr, uchar **buf); +//----------------------------------------------------------------------------- +#endif #endif -//----------------------------------------------------------------------------- diff --git a/include/mgl/surf.h b/include/mgl/surf.h new file mode 100644 index 0000000..e810964 --- /dev/null +++ b/include/mgl/surf.h @@ -0,0 +1,90 @@ +/*************************************************************************** + * surf.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef _MGL_SURF_H_ +#define _MGL_SURF_H_ +#include "mgl/base.h" +/*****************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif +/*****************************************************************************/ +void mgl_fsurf(HMGL graph, const char *fz, const char *stl, const char *opt); +void mgl_fsurf_xyz(HMGL graph, const char *fx, const char *fy, const char *fz, const char *stl, const char *opt); +void mgl_grid_xy(HMGL graph, HCDT x, HCDT y, HCDT z, const char *stl, const char *opt); +void mgl_grid(HMGL graph, HCDT a,const char *stl, const char *opt); +void mgl_mesh_xy(HMGL graph, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_mesh(HMGL graph, HCDT z, const char *sch, const char *opt); +void mgl_fall_xy(HMGL graph, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_fall(HMGL graph, HCDT z, const char *sch, const char *opt); +void mgl_belt_xy(HMGL graph, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_belt(HMGL graph, HCDT z, const char *sch, const char *opt); +void mgl_surf_xy(HMGL graph, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_surf(HMGL graph, HCDT z, const char *sch, const char *opt); +void mgl_dens_xy(HMGL graph, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_dens(HMGL graph, HCDT z, const char *sch, const char *opt); +void mgl_boxs_xy(HMGL graph, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_boxs(HMGL graph, HCDT z, const char *sch, const char *opt); +void mgl_tile_xy(HMGL graph, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt); +void mgl_tile(HMGL graph, HCDT z, const char *sch, const char *opt); +void mgl_tiles_xy(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT r, const char *sch, const char *opt); +void mgl_tiles(HMGL graph, HCDT z, HCDT r, const char *sch, const char *opt); +void mgl_surfc_xy(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT c, const char *sch, const char *opt); +void mgl_surfc(HMGL graph, HCDT z, HCDT c, const char *sch, const char *opt); +void mgl_surfa_xy(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT c, const char *sch, const char *opt); +void mgl_surfa(HMGL graph, HCDT z, HCDT c, const char *sch, const char *opt); +void mgl_stfa_xy(HMGL graph, HCDT x, HCDT y, HCDT re, HCDT im, int dn, const char *sch, const char *opt); +void mgl_stfa(HMGL graph, HCDT re, HCDT im, int dn, const char *sch, const char *opt); +void mgl_map_xy(HMGL graph, HCDT x, HCDT y, HCDT a, HCDT b, const char *sch, const char *opt); +void mgl_map(HMGL graph, HCDT a, HCDT b, const char *sch, const char *opt); +/*****************************************************************************/ +void mgl_fsurf_(uintptr_t *graph, const char *fz, const char *stl, const char *opt,int,int,int); +void mgl_fsurf_xyz_(uintptr_t *graph, const char *fx, const char *fy, const char *fz, const char *stl, const char *opt, int, int, int, int, int); +void mgl_grid_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *stl, const char *opt,int,int); +void mgl_grid_(uintptr_t *graph, uintptr_t *a,const char *stl, const char *opt,int,int); +void mgl_mesh_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_mesh_(uintptr_t *graph, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_fall_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_fall_(uintptr_t *graph, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_belt_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_belt_(uintptr_t *graph, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_surf_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_surf_(uintptr_t *graph, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_dens_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_dens_(uintptr_t *graph, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_boxs_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_boxs_(uintptr_t *graph, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_tile_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int,int); +void mgl_tile_(uintptr_t *graph, uintptr_t *z, const char *sch, const char *opt,int,int); +void mgl_tiles_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, const char *opt,int,int); +void mgl_tiles_(uintptr_t *graph, uintptr_t *z, uintptr_t *r, const char *sch, const char *opt,int,int); +void mgl_surfc_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, const char *opt,int,int); +void mgl_surfc_(uintptr_t *graph, uintptr_t *z, uintptr_t *c, const char *sch, const char *opt,int,int); +void mgl_surfa_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, const char *opt,int,int); +void mgl_surfa_(uintptr_t *graph, uintptr_t *z, uintptr_t *c, const char *sch, const char *opt,int,int); +void mgl_stfa_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *re, uintptr_t *im, int *dn, const char *sch, const char *opt,int, int); +void mgl_stfa_(uintptr_t *graph, uintptr_t *re, uintptr_t *im, int *dn, const char *sch, const char *opt,int, int); +void mgl_map_xy_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int,int); +void mgl_map_(uintptr_t *graph, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int,int); +/*****************************************************************************/ +#ifdef __cplusplus +} +#endif +/*****************************************************************************/ +#endif diff --git a/include/mgl/type.h b/include/mgl/type.h new file mode 100644 index 0000000..e68006a --- /dev/null +++ b/include/mgl/type.h @@ -0,0 +1,121 @@ +/*************************************************************************** + * type.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef _MGL_TYPE_H_ +#define _MGL_TYPE_H_ +#include +#ifndef _MSC_VER +#include +#endif +#include "mgl/define.h" +//----------------------------------------------------------------------------- +/// Class for incapsulating point in space +struct mglPoint +{ + float x,y,z,c; + mglPoint(float X=0,float Y=0,float Z=0,float C=0){x=X;y=Y;z=Z;c=C;} + inline bool IsNAN() { return (x!=x || y!=y || z!=z || c!=c); } + inline float val(int i) { return (i<2 ? (i==0 ? x:y) : (i==2 ? z:c)); } + inline float norm() { return sqrt(x*x+y*y+z*z); } + inline void Normalize() { float v=norm(); x/=v; y/=v; z/=v; } + + inline void operator+=(const mglPoint &a) { x+=a.x; y+=a.y; z+=a.z; c+=a.c; } + inline void operator-=(const mglPoint &a) { x-=a.x; y-=a.y; z-=a.z; c-=a.c; } + inline void operator+=(float a) { x+=a; y+=a; z+=a; } + inline void operator-=(float a) { x-=a; y-=a; z-=a; } + inline void operator*=(float a) { x*=a; y*=a; z*=a; } + inline void operator/=(float a) { x/=a; y/=a; z/=a; } +}; +inline mglPoint operator+(const mglPoint &a, const mglPoint &b) +{ return mglPoint(a.x+b.x, a.y+b.y, a.z+b.z, a.c+b.c); } +inline mglPoint operator-(const mglPoint &a, const mglPoint &b) +{ return mglPoint(a.x-b.x, a.y-b.y, a.z-b.z, a.c-b.c); } +inline mglPoint operator*(float b, const mglPoint &a) +{ return mglPoint(a.x*b, a.y*b, a.z*b); } +inline mglPoint operator*(const mglPoint &a, float b) +{ return mglPoint(a.x*b, a.y*b, a.z*b); } +inline mglPoint operator/(const mglPoint &a, float b) +{ return mglPoint(a.x/b, a.y/b, a.z/b); } +inline float operator*(const mglPoint &a, const mglPoint &b) +{ return a.x*b.x+a.y*b.y+a.z*b.z; } +inline mglPoint operator/(const mglPoint &a, const mglPoint &b) +{ return mglPoint(a.x*b.x, a.y*b.y, a.z*b.z); } +inline mglPoint operator&(const mglPoint &a, const mglPoint &b) +{ return a - b*((a*b)/(b*b)); } +inline mglPoint operator|(const mglPoint &a, const mglPoint &b) +{ return b*((a*b)/(b*b)); } +inline mglPoint operator^(const mglPoint &a, const mglPoint &b) +{ return mglPoint(a.y*b.z-a.z*b.y, a.z*b.x-a.x*b.z, a.x*b.y-a.y*b.x); } +inline mglPoint operator!(const mglPoint &a) +{ float f=hypot(a.x,a.y); return f==0?mglPoint(0,1,0):mglPoint(-a.y/f, a.x/f, 0); } +inline bool operator==(const mglPoint &a, const mglPoint &b) +{ return !memcmp(&a, &b, sizeof(mglPoint)); } +inline bool operator!=(const mglPoint &a, const mglPoint &b) +{ return memcmp(&a, &b, sizeof(mglPoint)); } +inline float mgl_norm(const mglPoint &p) +{ return sqrt(p.x*p.x+p.y*p.y+p.z*p.z); } +//----------------------------------------------------------------------------- +/// Class for incapsulating color +struct mglColor +{ + float r; ///< Red component of color + float g; ///< Green component of color + float b; ///< Blue component of color + float a; ///< Alpha component of color + + /// Constructor for RGB components manualy + mglColor(float R,float G,float B, float A=1){ r=R; g=G; b=B; a=A; } + /// Constructor set color from character id + mglColor(char c='k', float bright=1) { Set(c,bright); } + /// Set color as Red, Green, Blue values + void Set(float R,float G,float B,float A=1) { r=R; g=G; b=B; a=A; } + /// Set color as Red, Green, Blue values + void Set(mglColor c, float bright=1); + /// Check if color is valid + inline bool Valid() + { return (r>=0 && r<=1 && g>=0 && g<=1 && b>=0 && b<=1 && a>=0 && a<=1); } + /// Get maximal spectral component + inline float Norm() + { return r>g ? r : (g>b ? g : b); } + /// Set color from symbolic id + void Set(char p, float bright=1); + /// Copy color from other one + inline bool operator==(const mglColor &c) + { return (r==c.r && g==c.g && b==c.b && a==c.a); } + inline bool operator!=(const mglColor &c) + { return (r!=c.r || g!=c.g || b!=c.b || a!=c.a); } + // transparency still the same + inline void operator*=(float v) { r*=v; g*=v; b*=v; } + inline void operator+=(const mglColor &c) { r+=c.r; g+=c.g; b+=c.b; } + inline void operator-=(const mglColor &c) { r-=c.r; g-=c.g; b-=c.b; } +}; +inline mglColor operator+(const mglColor &a, const mglColor &b) +{ return mglColor(a.r+b.r, a.g+b.g, a.b+b.b, a.a+b.a); } +inline mglColor operator-(const mglColor &a, const mglColor &b) +{ return mglColor(a.r-b.r, a.g-b.g, a.b-b.b, a.a-b.a); } +inline mglColor operator*(const mglColor &a, float b) +{ return mglColor(a.r*b, a.g*b, a.b*b, a.a*b); } +inline mglColor operator*(float b, const mglColor &a) +{ return mglColor(a.r*b, a.g*b, a.b*b, a.a*b); } +inline mglColor operator/(const mglColor &a, float b) +{ return mglColor(a.r/b, a.g/b, a.b/b, a.a/b); } +inline mglColor operator!(const mglColor &a) +{ return mglColor(1-a.r, 1-a.g, 1-a.b, a.a); } +//----------------------------------------------------------------------------- +#endif \ No newline at end of file diff --git a/include/mgl/vect.h b/include/mgl/vect.h new file mode 100644 index 0000000..878d75c --- /dev/null +++ b/include/mgl/vect.h @@ -0,0 +1,88 @@ +/*************************************************************************** + * vect.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef _MGL_VECT_H_ +#define _MGL_VECT_H_ +#include "mgl/base.h" +/*****************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif +/*****************************************************************************/ +void mgl_traj_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt); +void mgl_traj_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt); + +void mgl_vect_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt); +void mgl_vect_2d(HMGL gr, HCDT ax, HCDT ay, const char *sch, const char *opt); +void mgl_vect_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt); +void mgl_vect_3d(HMGL gr, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt); + +void mgl_flow_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt); +void mgl_flow_2d(HMGL gr, HCDT ax, HCDT ay, const char *sch, const char *opt); +void mgl_flow_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt); +void mgl_flow_3d(HMGL gr, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt); + +void mgl_flowp_xy(HMGL gr, float x0, float y0, float z0, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt); +void mgl_flowp_2d(HMGL gr, float x0, float y0, float z0, HCDT ax, HCDT ay, const char *sch, const char *opt); +void mgl_flowp_xyz(HMGL gr, float x0, float y0, float z0, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt); +void mgl_flowp_3d(HMGL gr, float x0, float y0, float z0, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt); + +void mgl_pipe_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, float r0, const char *opt); +void mgl_pipe_2d(HMGL gr, HCDT ax, HCDT ay, const char *sch, float r0, const char *opt); +void mgl_pipe_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, float r0, const char *opt); +void mgl_pipe_3d(HMGL gr, HCDT ax, HCDT ay, HCDT az, const char *sch, float r0, const char *opt); + +void mgl_grad_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ph, const char *sch, const char *opt); +void mgl_grad_xy(HMGL gr, HCDT x, HCDT y, HCDT ph, const char *sch, const char *opt); +void mgl_grad(HMGL gr, HCDT ph, const char *sch, const char *opt); + +/*****************************************************************************/ +void mgl_traj_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int,int); +void mgl_traj_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, const char *opt,int,int); + +void mgl_vect_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int,int); +void mgl_vect_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int,int); +void mgl_vect_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, const char *opt,int,int); +void mgl_vect_3d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, const char *opt,int,int); + +void mgl_flow_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int,int); +void mgl_flow_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int,int); +void mgl_flow_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, const char *opt,int,int); +void mgl_flow_3d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, const char *opt,int,int); + +void mgl_flowp_xy_(uintptr_t *gr, float *x0, float *y0, float *z0, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int, int); +void mgl_flowp_2d_(uintptr_t *gr, float *x0, float *y0, float *z0, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int, int); +void mgl_flowp_xyz_(uintptr_t *gr, float *x0, float *y0, float *z0, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, const char *opt,int, int); +void mgl_flowp_3d_(uintptr_t *gr, float *x0, float *y0, float *z0, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, const char *opt,int,int); + +void mgl_pipe_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, float *r0, const char *opt,int,int); +void mgl_pipe_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch, float *r0, const char *opt,int,int); +void mgl_pipe_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, float *r0, const char *opt,int,int); +void mgl_pipe_3d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, float *r0, const char *opt,int,int); + +void mgl_grad_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ph, const char *sch, const char *opt,int, int); +void mgl_grad_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ph, const char *sch, const char *opt,int,int); +void mgl_grad_(uintptr_t *gr, uintptr_t *ph, const char *sch, const char *opt,int,int); + +/*****************************************************************************/ +#ifdef __cplusplus +} +#endif +/*****************************************************************************/ +#endif diff --git a/include/mgl/vectors.fs b/include/mgl/vectors.fs deleted file mode 100644 index b3eb672..0000000 --- a/include/mgl/vectors.fs +++ /dev/null @@ -1,161 +0,0 @@ -\ Integer vectors library Thu Feb 21 12:46:01 MST 2008 -\ Copyright (C) 2008, Sergey Plis -\ -\ This program is free software; you can redistribute it and/or modify -\ it under the terms of the GNU General Public License as published by -\ the Free Software Foundation; either version 2 of the License, or -\ (at your option) any later version. -\ -\ This program is distributed in the hope that it will be useful, -\ but WITHOUT ANY WARRANTY; without even the implied warranty of -\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -\ GNU General Public License for more details. - -\needs float import float - -\ vector variables better have names ending with "(" for readability -Module vectors -also float - -\ fetches -| create fetch_operations ' c@ , ' w@ , ' @ , 0 , ' 2@ , ' f@ , - -\ stores -| create store_operations ' c! , ' w! , ' ! , 0 , ' 2! , ' f! , -| : type-idx ( cell_size -- idx ) 4 >> ; macro -| : f-op ( cell-size -- cfa ) type-idx cells fetch_operations + @ ; -| : s-op ( cell-size -- cfa ) type-idx cells store_operations + @ ; - -: ^)! ( *vector -- addr ) [ 3 cells ] literal - @ ; -: ^)@ ( *vector -- addr ) [ 4 cells ] literal - @ ; - -\ number of elements -: )size ( *vector -- size ) [ 1 cells ] literal - @ ; - -\ set number of elements - useful for temporal size adjustments in -\ datastructures such as heaps -: )size! ( sz *vector -- ) [ 1 cells ] literal - ! ; - -\ size of an element in bytes -: )type ( *vector -- size ) [ 2 cells ] literal - @ ; - -: )free ( *vector -- ) [ 4 cells ] literal - free throw ; - -\ header | fetch_cfa | store_cfa | el_size | #els | -\ cell-size in bits -\ unnamed vector -: _vector ( n cell-size -- addr ) - 2dup * [ 4 cells ] literal + allocate throw - dup >r over f-op swap ! - r@ cell+ over s-op swap ! - r@ [ 2 cells ] literal + ! \ cell size store - r@ [ 3 cells ] literal + ! \ #els store - r> [ 4 cells ] literal + ; - -\ named vector -: vector ( n cell-size -- ) - create - 2dup * [ 4 cells ] literal + allocate throw dup , - dup >r over f-op swap ! - r@ cell+ over s-op swap ! - r@ [ 2 cells ] literal + ! \ cell size store - r@ [ 3 cells ] literal + ! \ #els store - r> dup - \ erasing the content - [ 2 cells ] literal + @ over [ 3 cells ] literal + @ * - swap [ 4 cells ] literal + swap erase - does> @ [ 4 cells ] literal + ; - -\ vector of pointers -: vector* ( # -- *vector ) cell 8 * _vector ; - -| : ?idx-in-range ( *vector idx -- 1/0 ) dup rot )size < swap 0>= and ; -| : check-range ( *vector idx -- *vector idx | fail ) - 2dup ?idx-in-range not abort" Index is out of range! " ; - -\ addr of ith element of the vector -: *) ( *vector i -- addr ) over )type 3 >> * + ; -: )@ ( *vector index -- ) - [IFDEF] отладка - check-range - [THEN] - over dup ^)@ >r )type 3 >> * + r> execute ; -: )! ( value *vector index -- ) - [IFDEF] отладка - check-range - [THEN] - over dup ^)! >r )type 3 >> * + r> execute ; -\ : test! cell * + ! ; -| create print-funcs ' . , ' . , ' . , 0 , ' d. , ' f. , -: )print ( *v -- cfa ) )type type-idx cells print-funcs + @ execute ; -: )map ( *v xt -- ) swap dup )size 0 do 2dup i )@ swap execute loop 2drop ; -: map ( *v -- ) ( word-to-map ) ' swap dup )size 0 do 2dup i )@ swap execute loop 2drop ; -: )initperm ( v( -- ) - dup )size 0 do - dup - i swap over )! - loop drop ; -: ). ( *vector -- ) dup )size 0 do dup i )@ over )print loop drop ; -\ does arbitrary vector contain this element ? -: )in? ( *v value -- 1/0 ) - swap dup )size 0 do - 2dup i )@ = if 2drop True unloop exit then - loop 2drop False ; -: )find ( *v value -- i True/False ) - swap dup )size 0 do - 2dup i )@ = if 2drop i True unloop exit then - loop 2drop False ; -: vector->stack ( *v -- n1 n2 .. n# # ) - dup )size 0 do dup i )@ swap loop )size ; -\ initialized cell vector -\ preserve order -: ivector* ( n1 n2 .. n# # -- *vector ) - dup vector* swap 1- 0 swap do - swap over i )! - -1 +loop ; -\ reversed order -: irvector* ( n1 n2 .. n# # -- *vector ) - dup vector* swap 0 do - swap over i )! - loop ; -\ does not take care of duplicate elements -| : overlap ( v1( v2( -- n1 .. n2 # / 0 ) depth 2- >r - dup )size 0 do - 2dup i )@ )in? if - dup i )@ -rot - then - loop 2drop depth r> - ; -| : notoverlap ( v1( v2( -- n1 .. n2 # ) - depth 2- >r - dup )size 0 do - 2dup i )@ )in? not if - dup i )@ -rot - then - loop 2drop depth r> - ; -: )union ( *v1( *v2( -- *v3( ) - over >r - notoverlap - r> swap >r vector->stack r> + - dup 0= abort" empty union!" - ivector* ; -: )intersection ( *v1( *v2( -- *v3(/0 ) - overlap dup 0<> if ivector* then ; -\ elementwise comparison of two vectors -: )= ( *v1( *v2( -- 1/0 ) dup )size >r over )size r> - <> if 2drop 0 exit then - dup )size 0 do - 2dup i )@ swap i )@ <> if - 2drop unloop 0 exit - then - loop 2drop -1 ; -: subset? ( *v( *s( -- 1/0 ) - 2dup )intersection dup 0= if -rot 2drop exit then - dup >r )= swap drop r> )free ; -: )clone ( *v -- *cv ) - vector->stack ivector* ; -: )erase ( *v -- ) dup )size over )type 3 >> * erase ; -: _last ( *v -- *v idx-of-last-element ) dup )size 1- ; - -clear -previous -Module; \ No newline at end of file diff --git a/include/mgl/volume.h b/include/mgl/volume.h new file mode 100644 index 0000000..6f69ac3 --- /dev/null +++ b/include/mgl/volume.h @@ -0,0 +1,79 @@ +/*************************************************************************** + * volume.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef _MGL_VOL_H_ +#define _MGL_VOL_H_ +#include "mgl/base.h" +/*****************************************************************************/ +#ifdef __cplusplus +extern "C" { +#endif +/*****************************************************************************/ +void mgl_surf3_xyz_val(HMGL graph, float Val, HCDT x, HCDT y, HCDT z, HCDT a, const char *stl, const char *opt); +void mgl_surf3_val(HMGL graph, float Val, HCDT a, const char *stl, const char *opt); +void mgl_surf3_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT a, const char *stl, const char *opt); +void mgl_surf3(HMGL graph, HCDT a, const char *stl, const char *opt); + +void mgl_surf3a_xyz_val(HMGL graph, float Val, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *stl, const char *opt); +void mgl_surf3a_val(HMGL graph, float Val, HCDT a, HCDT b, const char *stl, const char *opt); +void mgl_surf3a_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *stl, const char *opt); +void mgl_surf3a(HMGL graph, HCDT a, HCDT b, const char *stl, const char *opt); + +void mgl_surf3c_xyz_val(HMGL graph, float Val, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *stl, const char *opt); +void mgl_surf3c_val(HMGL graph, float Val, HCDT a, HCDT b, const char *stl, const char *opt); +void mgl_surf3c_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *stl, const char *opt); +void mgl_surf3c(HMGL graph, HCDT a, HCDT b, const char *stl, const char *opt); + +// NOTE: now style '.' draws dots instead of faces +void mgl_cloud_xyz(HMGL graph, HCDT x, HCDT y, HCDT z, HCDT a, const char *stl, const char *opt); +void mgl_cloud(HMGL graph, HCDT a, const char *stl, const char *opt); + +void mgl_beam_val(HMGL graph, float Val, HCDT tr, HCDT g1, HCDT g2, HCDT a, float r, const char *stl, int norm); +void mgl_beam(HMGL graph, HCDT tr, HCDT g1, HCDT g2, HCDT a, float r, const char *stl, int norm, int num); + +/*****************************************************************************/ +void mgl_surf3_xyz_val_(uintptr_t *graph, float *Val, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *stl, const char *opt,int,int); +void mgl_surf3_val_(uintptr_t *graph, float *Val, uintptr_t *a, const char *stl, const char *opt,int,int); +void mgl_surf3_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *stl, const char *opt,int,int); +void mgl_surf3_(uintptr_t *graph, uintptr_t *a, const char *stl, const char *opt,int,int); + +void mgl_surf3a_xyz_val_(uintptr_t *graph, float *Val, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, const char *stl, const char *opt,int,int); +void mgl_surf3a_val_(uintptr_t *graph, float *Val, uintptr_t *a, uintptr_t *b, const char *stl, const char *opt,int,int); +void mgl_surf3a_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, const char *stl, const char *opt,int,int); +void mgl_surf3a_(uintptr_t *graph, uintptr_t *a, uintptr_t *b, const char *stl, const char *opt,int,int); + +void mgl_surf3c_xyz_val_(uintptr_t *graph, float *Val, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, const char *stl, const char *opt,int,int); +void mgl_surf3c_val_(uintptr_t *graph, float *Val, uintptr_t *a, uintptr_t *b, const char *stl, const char *opt,int,int); +void mgl_surf3c_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, const char *stl, const char *opt,int,int); +void mgl_surf3c_(uintptr_t *graph, uintptr_t *a, uintptr_t *b, const char *stl, const char *opt,int,int); + +void mgl_cloudp_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *stl, const char *opt,int,int); +void mgl_cloudp_(uintptr_t *graph, uintptr_t *a, const char *stl, const char *opt,int,int); +void mgl_cloud_xyz_(uintptr_t *graph, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *stl, const char *opt,int,int); +void mgl_cloud_(uintptr_t *graph, uintptr_t *a, const char *stl, const char *opt,int,int); + +void mgl_beam_val_(uintptr_t *gr, float *val, uintptr_t *tr, uintptr_t *g1, uintptr_t *g2, uintptr_t *a, float *r, const char *sch, int *norm,int l); +void mgl_beam_(uintptr_t *gr, uintptr_t *tr, uintptr_t *g1, uintptr_t *g2, uintptr_t *a, float *r, const char *sch, int *norm, int *num,int l); + +/*****************************************************************************/ +#ifdef __cplusplus +} +#endif +/*****************************************************************************/ +#endif diff --git a/include/mgl/window.h b/include/mgl/window.h new file mode 100644 index 0000000..44eff28 --- /dev/null +++ b/include/mgl/window.h @@ -0,0 +1,139 @@ +/*************************************************************************** + * window.h is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +//----------------------------------------------------------------------------- +#ifndef _MGL_WINDOW_H_ +#define _MGL_WINDOW_H_ +/*****************************************************************************/ +#include "mgl/mgl.h" +//----------------------------------------------------------------------------- +class mglWindow : public mglGraph +{ +protected: + int wnd; ///< Type of window +public: + mglWindow(int kind=0, int (*draw)(HMGL gr, void *p)=NULL, const char *title="MathGL", void *par=NULL) : mglGraph(-1) + { + wnd=kind; + if(wnd==1) gr = mgl_create_graph_qt(draw,title,par); + else gr = mgl_create_graph_fltk(draw,title,par); + } + mglWindow(int kind, int (*draw)(mglGraph *gr), const char *title="MathGL") : mglGraph(-1) + { + wnd=kind; + if(wnd==1) gr = mgl_create_graph_qt(mgl_draw_graph,title,(void*)draw); + else gr = mgl_create_graph_fltk(mgl_draw_graph,title,(void*)draw); + } + mglWindow(int kind=0, mglDraw *dr=NULL, const char *title="MathGL") : mglGraph(-1) + { + wnd=kind; + if(wnd==1) gr = mgl_create_graph_qt(mgl_draw_class,title,dr); + else gr = mgl_create_graph_fltk(mgl_draw_class,title,dr); + } + inline void Run() ///< Run main loop for event handling + { if(wnd==1) mgl_qt_run(); else mgl_fltk_run(); } + + inline void ToggleAlpha() ///< Switch on/off transparency (do not overwrite user settings) + { mgl_wnd_toggle_alpha(gr); } + inline void ToggleLight() ///< Switch on/off lighting (do not overwrite user settings) + { mgl_wnd_toggle_light(gr); } +// inline void ToggleZoom() ///< Switch on/off zooming by mouse +// { mgl_wnd_toggle_zoom(gr); } + inline void ToggleRotate() ///< Switch on/off rotation by mouse + { mgl_wnd_toggle_rotate(gr); } + inline void ToggleNo() ///< Switch off all zooming and rotation + { mgl_wnd_toggle_no(gr); } + inline void Update() ///< Update picture by calling user drawing function + { mgl_wnd_update(gr); } + inline void ReLoad() ///< Reload user data and update picture + { mgl_wnd_reload(gr); } + inline void Adjust() ///< Adjust size of bitmap to window size + { mgl_wnd_adjust(gr); } + inline void NextFrame() ///< Show next frame (if one) + { mgl_wnd_next_frame(gr); } + inline void PrevFrame() ///< Show previous frame (if one) + { mgl_wnd_prev_frame(gr); } + inline void Animation() ///< Run slideshow (animation) of frames + { mgl_wnd_animation(gr); } + + inline void SetDelay(float dt) ///< Delay for animation in seconds + { mgl_wnd_set_delay(gr, dt); } + inline void Setup(bool autoclf, bool showpos, bool clf_upd) + { mgl_setup_window(gr, autoclf, showpos, clf_upd); } + inline mglPoint LastMousePos() ///< Last mouse position + { mglPoint p; mgl_get_last_mouse_pos(gr,&p.x,&p.y,&p.z); return p; } +}; +//----------------------------------------------------------------------------- +/// Base class for windows containing MathGL graphics +class mglCanvasW : public mglCanvas +{ +public: + mglCanvasW(); + virtual ~mglCanvasW(); + + void SetSize(int w,int h); + void EndFrame(); + const unsigned char *GetBits(); + void Clf(mglColor Back=NC); + inline int GetNumFig() { return NumFig; } + inline int GetCurFig() { return CurFig; } + inline void SetCurFig(int c) { CurFig=c; } // stupid thing to pass G++ bug + inline float GetDelay() { return Delay; } + inline void SetDelay(float d) { Delay=d; } + inline mglPoint GetMousePos() { return LastMousePos;} // stupid thing to pass G++ bug + inline void SetMousePos(mglPoint p) { LastMousePos=p; } + inline void Setup(bool autoclf, bool showpos, bool clf_upd) + { set(autoclf,MGL_AUTO_CLF); set(showpos,MGL_SHOW_POS); set(clf_upd,MGL_CLF_ON_UPD); } + + virtual void ToggleAlpha()=0; ///< Switch on/off transparency (do not overwrite user settings) + virtual void ToggleLight()=0; ///< Switch on/off lighting (do not overwrite user settings) + // virtual void ToggleZoom()=0; ///< Switch on/off zooming by mouse + virtual void ToggleRotate()=0; ///< Switch on/off rotation by mouse + virtual void ToggleNo()=0; ///< Switch off all zooming and rotation + virtual void Update()=0; ///< Update picture by calling user drawing function + virtual void Adjust()=0; ///< Adjust size of bitmap to window size + virtual void NextFrame()=0; ///< Show next frame (if one) + virtual void PrevFrame()=0; ///< Show previous frame (if one) + virtual void Animation()=0; ///< Run slideshow (animation) of frames + void ReLoad(); ///< Reload user data and update picture + /// Create a window for plotting based on callback function (can be NULL). + virtual void Window(int argc, char **argv, int (*draw)(mglBase *gr, void *p), + const char *title, void *par=NULL, + void (*reload)(void *p)=NULL, bool maximize=false)=0; + void Window(int argc, char **argv, int (*draw)(mglGraph *gr), const char *title, bool maximize=false) + { Window(argc,argv,mgl_draw_graph,title,(void*)draw,0,maximize); } + /// Create a window for plotting based on class mglDraw. + void Window(int argc, char **argv, const char *title, mglDraw *draw, bool maximize=false) + { Window(argc, argv, mgl_draw_class, title, draw, mgl_reload_class, maximize); } + void SetDrawFunc(int (*draw)(mglBase *gr, void *p), void *par=NULL, void (*reload)(void *p)=NULL); + +private: + float Delay; ///< Delay for animation in seconds + mglPoint LastMousePos; ///< Last mouse position + int CurFig; ///< Current figure in the list. + + unsigned char *GG; ///< images for all frames (may be too LARGE !!!) + int NumFig; ///< Number of figures in the list. If 0 then no list and mglCanvas::DrawFunc will called for each drawing. + void (*LoadFunc)(void *par); + void *FuncPar; ///< Parameters for drawing function mglCanvas::DrawFunc. + /// Drawing function for window procedure. It should return the number of frames. + int (*DrawFunc)(mglBase *gr, void *par); +}; +//----------------------------------------------------------------------------- +#endif diff --git a/lang/CMakeLists.txt b/lang/CMakeLists.txt index 0dccfb2..d0b6988 100644 --- a/lang/CMakeLists.txt +++ b/lang/CMakeLists.txt @@ -1,14 +1,27 @@ if(use_python) - 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/mgl_c.h ../include/mgl/mgl_data.h -# WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/lang - ) - add_custom_target(_mathgl.so ALL - COMMAND CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/setup.py build - DEPENDS ${CMAKE_BINARY_DIR}/lang/mathgl.py ${CMAKE_BINARY_DIR}/lang/mgl_python.cpp - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - ) - install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/setup.py install --prefix=${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} )") + INCLUDE(${SWIG_USE_FILE}) + INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) + SET(CMAKE_SWIG_FLAGS "") + + SET_SOURCE_FILES_PROPERTIES(mgl.i PROPERTIES CPLUSPLUS ON) +# SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES SWIG_FLAGS "-includeall") + 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}) + +# INSTALL_FILES(/lib/python2.7/dist-packages/ mathgl) + +# 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/data.h ../include/mgl/mgl.h +# # WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/lang +# ) +# add_custom_target(_mathgl.so ALL +# COMMAND CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/setup.py build +# # COMMAND CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} ${PYTHON_EXECUTABLE} +# DEPENDS ${CMAKE_BINARY_DIR}/lang/mathgl.py ${CMAKE_BINARY_DIR}/lang/mgl_python.cpp +# WORKING_DIRECTORY ${CMAKE_BINARY_DIR} +# ) +# install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/setup.py install --prefix=${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${CMAKE_BINARY_DIR} )") endif(use_python) diff --git a/lang/DESCRIPTION b/lang/DESCRIPTION index 5fa9966..b7398da 100644 --- a/lang/DESCRIPTION +++ b/lang/DESCRIPTION @@ -1,6 +1,6 @@ Name: mathgl -Version: 1.9 -Date: 2009-03-02 +Version: 2.0 +Date: 2011-08-23 Author: Alexey Balakin Maintainer: Dmitry Kulagin Title: MathGL diff --git a/lang/Makefile.am b/lang/Makefile.am index b0597a1..bc4461e 100644 --- a/lang/Makefile.am +++ b/lang/Makefile.am @@ -8,14 +8,14 @@ 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)/mgl/libmgl.la +_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/mgl_c.h $(top_srcdir)/include/mgl/mgl_w.h +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 @@ -42,9 +42,9 @@ mathgl.tar.gz: $(PKG_OCT_FILES) $(PKG_OTHER_FILES) MY_MKOCTFILE=$(CXX) -O0 -g -shared $(OCTAVE_INCFLAGS) -mgl_octave.cpp: $(srcdir)/mgl.i $(top_srcdir)/include/mgl/mgl_c.h $(top_srcdir)/include/mgl/mgl_w.h +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)/mgl/.libs/ -lmgl + $(MY_MKOCTFILE) -o $@ $^ -fPIC -I$(top_srcdir)/include -I$(top_builddir)/include -L$(top_builddir)/src/.libs/ -lmgl endif diff --git a/lang/Makefile.in b/lang/Makefile.in index 9ba6a6b..7b7e4f4 100644 --- a/lang/Makefile.in +++ b/lang/Makefile.in @@ -77,7 +77,7 @@ am__installdirs = "$(DESTDIR)$(pyexecdir)" "$(DESTDIR)$(pythondir)" \ "$(DESTDIR)$(octavedir)" LTLIBRARIES = $(pyexec_LTLIBRARIES) @USE_PYTHON_TRUE@_mathgl_la_DEPENDENCIES = \ -@USE_PYTHON_TRUE@ $(top_builddir)/mgl/libmgl.la +@USE_PYTHON_TRUE@ $(top_builddir)/src/libmgl.la am___mathgl_la_SOURCES_DIST = mgl_python.cpp @USE_PYTHON_TRUE@am__mathgl_la_OBJECTS = _mathgl_la-mgl_python.lo _mathgl_la_OBJECTS = $(am__mathgl_la_OBJECTS) @@ -140,10 +140,6 @@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLTK_FLAGS = @FLTK_FLAGS@ FLTK_LIBS = @FLTK_LIBS@ -GIF_FLAGS = @GIF_FLAGS@ -GIF_LIBS = @GIF_LIBS@ -GLUT_FLAGS = @GLUT_FLAGS@ -GLUT_LIBS = @GLUT_LIBS@ GL_LIBS = @GL_LIBS@ GREP = @GREP@ GSL_FLAGS = @GSL_FLAGS@ @@ -169,7 +165,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MGL_AGE = @MGL_AGE@ MGL_CURRENT = @MGL_CURRENT@ MGL_RELEASE = @MGL_RELEASE@ @@ -224,13 +219,10 @@ TMPDIR = @TMPDIR@ U3D_LIBS = @U3D_LIBS@ UIC = @UIC@ VERSION = @VERSION@ -WX_FLAGS = @WX_FLAGS@ -WX_LIBS = @WX_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -264,6 +256,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -289,7 +282,7 @@ BUILT_SOURCES = $(am__append_2) @USE_PYTHON_TRUE@pyexec_LTLIBRARIES = _mathgl.la @USE_PYTHON_TRUE@_mathgl_la_SOURCES = mgl_python.cpp @USE_PYTHON_TRUE@_mathgl_la_CXXFLAGS = $(PYTHON_HEADERS) $(AM_CXXFLAGS) -@USE_PYTHON_TRUE@_mathgl_la_LIBADD = $(top_builddir)/mgl/libmgl.la +@USE_PYTHON_TRUE@_mathgl_la_LIBADD = $(top_builddir)/src/libmgl.la #_mathgl_la_LIBADD = $(top_builddir)/widgets/libmgl-qt.la @USE_PYTHON_TRUE@_mathgl_la_LDFLAGS = -avoid-version -module @USE_OCTAVE_TRUE@PKG_NAME = mathgl @@ -676,7 +669,7 @@ uninstall-am: uninstall-dist_octaveDATA uninstall-pyexecLTLIBRARIES \ uninstall-pyexecLTLIBRARIES uninstall-pythonPYTHON -@USE_PYTHON_TRUE@mgl_python.cpp mathgl.py: $(srcdir)/mgl.i $(top_srcdir)/include/mgl/mgl_c.h $(top_srcdir)/include/mgl/mgl_w.h +@USE_PYTHON_TRUE@mgl_python.cpp mathgl.py: $(srcdir)/mgl.i $(top_srcdir)/include/mgl/data.h $(top_srcdir)/include/mgl/mgl.h @USE_PYTHON_TRUE@ swig -python -c++ -I$(top_srcdir)/include -I$(top_builddir)/include -o mgl_python.cpp $(srcdir)/mgl.i @USE_OCTAVE_TRUE@mathgl.tar.gz: $(PKG_OCT_FILES) $(PKG_OTHER_FILES) @USE_OCTAVE_TRUE@ mkdir -p $(PKG_NAME) @@ -687,10 +680,10 @@ uninstall-am: uninstall-dist_octaveDATA uninstall-pyexecLTLIBRARIES \ @USE_OCTAVE_TRUE@ tar cpzvf $@ $(PKG_NAME) @USE_OCTAVE_TRUE@ rm -rf $(PKG_NAME) -@USE_OCTAVE_TRUE@mgl_octave.cpp: $(srcdir)/mgl.i $(top_srcdir)/include/mgl/mgl_c.h $(top_srcdir)/include/mgl/mgl_w.h +@USE_OCTAVE_TRUE@mgl_octave.cpp: $(srcdir)/mgl.i $(top_srcdir)/include/mgl/data.h $(top_srcdir)/include/mgl/mgl.h @USE_OCTAVE_TRUE@ swig -octave -c++ -I$(top_srcdir)/include -I$(top_builddir)/include -o mgl_octave.cpp $(srcdir)/mgl.i @USE_OCTAVE_TRUE@mathgl.oct: mgl_octave.cpp -@USE_OCTAVE_TRUE@ $(MY_MKOCTFILE) -o $@ $^ -fPIC -I$(top_srcdir)/include -I$(top_builddir)/include -L$(top_builddir)/mgl/.libs/ -lmgl +@USE_OCTAVE_TRUE@ $(MY_MKOCTFILE) -o $@ $^ -fPIC -I$(top_srcdir)/include -I$(top_builddir)/include -L$(top_builddir)/src/.libs/ -lmgl # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/lang/mgl.i b/lang/mgl.i index 715c5df..dd4c5d2 100644 --- a/lang/mgl.i +++ b/lang/mgl.i @@ -1,7 +1,7 @@ /*************************************************************************** * mgl.i is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin , - * Xavier Delacour , + * Copyright (C) 2007 Alexey Balakin , + * Xavier Delacour , * Alexander Filov * * * * This program is free software; you can redistribute it and/or modify * @@ -36,8 +36,9 @@ %{ #define SWIG_FILE_WITH_INIT -//#include "mgl/mgl_c.h" -#include "mgl/mgl_w.h" +#include "mgl/type.h" +#include "mgl/data.h" +#include "mgl/mgl.h" %} #ifdef SWIGOCTAVE @@ -78,7 +79,9 @@ import_array(); %apply (int DIM1, int DIM2, int DIM3, double* IN_ARRAY3) {(int rows, int cols, int slc, const double* d)}; #endif -%include "mgl/mgl_w.h" +%include "mgl/type.h" +%include "mgl/data.h" +%include "mgl/mgl.h" %extend mglData { float __getitem__( int i) { return self->GetVal(i); }; diff --git a/lang/numpy.i b/lang/numpy.i index 72fc4f9..25d1f1a 100644 --- a/lang/numpy.i +++ b/lang/numpy.i @@ -111,7 +111,7 @@ if (PyModule_Check( py_obj)) return "module" ; if (PyInstance_Check(py_obj)) return "instance" ; - return "unkown type"; + return "unknow type"; } /* Given a NumPy typecode, return a string describing the type. diff --git a/mathgl-all.workspace b/mathgl-all.workspace deleted file mode 100644 index 2bbf8ea..0000000 --- a/mathgl-all.workspace +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/mathgl.cbp b/mathgl.cbp deleted file mode 100644 index d473c6b..0000000 --- a/mathgl.cbp +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - diff --git a/mathgl.spec b/mathgl.spec deleted file mode 100644 index 716a4dd..0000000 --- a/mathgl.spec +++ /dev/null @@ -1,107 +0,0 @@ -Name: mathgl -Version: 1.8.1 -Release: 1%{?dist} -Summary: MathGL is a library for making high-quality scientific graphics -Summary(ru): MathGL - это библиотека для осуществления высококачественной визуализации данных -License: GPL -Group: System Environment/Libraries -Url: http://mathgl.sourceforge.net -Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz -# mandatory packages -BuildRequires: libpng-devel -Requires: libpng -# optional packages -BuildRequires: freeglut-devel hdf5-devel libjpeg-devel libtiff-devel -Requires: freeglut hdf5 libjpeg libtiff -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -%description -* a library for making high-quality scientific graphics under Linux and Windows; -* a library for the fast data plotting and handling of large data arrays; -* a library for working in window and console modes and for easy embedding into other programs; -* a library with large and growing set of graphics. - -%package devel -Summary: Static libraries and header files for mathgl library -License: GPL -Group: System Environment/Libraries -Requires: %{name} = %{version}-%{release} - -%description devel -The %{name}-devel package contains libraries and header files for -developing applications that use %{name}. - -%description devel -l ru -Пакет %{name}-devel содержит библиотеки и файлы заголовков необходимые -для разработки приложений с использованием %{name}. - -%prep -%setup -q - -%build -#%configure --enable-all -CPPFLAGS=-I/usr/lib/python2.5/site-packages/numpy/core/include ./configure --disable-gsl --enable-glut --disable-gif --disable-wx --disable-qt --without-qt --enable-python --prefix=/usr - -#make %{?_smp_mflags} - -%install -rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/fonts -cp fonts/*.vfm $RPM_BUILD_ROOT%{_datadir}/%{name}/fonts - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -%doc AUTHORS ChangeLog* NEWS README -%{_libdir}/*.so.* -%{_libdir}/python2.5/site-packages/*.so -%{_libdir}/python2.5/site-packages/*.pyo -%{_bindir}/mgl* -#%{_datadir}/%{name}/bigforth/*.fs -%{_datadir}/%{name}/fonts/*.vfm - -%files devel -%defattr(-,root,root) -%{_includedir}/mgl/* -%{_libdir}/*.so -%{_libdir}/*.la -%{_libdir}/*.a -%{_libdir}/python2.5/site-packages/*.a -%{_libdir}/python2.5/site-packages/*.la -%{_libdir}/python2.5/site-packages/mathgl.pyc -%{_libdir}/python2.5/site-packages/mathgl.py - -%post -/sbin/ldconfig - -%changelog -* Wed Jun 4 2008 Nik -- disabled hdf5 support according to developer request - -* Tue Jun 3 2008 Nik -- updated to version 1.7.1 - -* Sun Jun 2 2008 Nik -- updated to version 1.7 - -* Sat Apr 5 2008 Nik -- updated to version 1.6.2 - -* Thu Mar 13 2008 Nik -- updated to version 1.6 -- added fltk(-devel) to requres list - -* Tue Mar 11 2008 Nik -- tiff bug fixed -- enable-all option added - -* Sat Mar 1 2008 Nik -- spec cleanup -- --enable(jpeg, tiff, hdf5) features added -- enable-tiff leads to make error, submitted to author. Feature disabled. - -* Fri Feb 29 2008 Nik -- initial build of version 1.5 diff --git a/mgl-fltk.cbp b/mgl-fltk.cbp deleted file mode 100644 index 0b74fdf..0000000 --- a/mgl-fltk.cbp +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - diff --git a/mgl-glut.cbp b/mgl-glut.cbp deleted file mode 100644 index 8092dac..0000000 --- a/mgl-glut.cbp +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - diff --git a/mgl/Makefile.am b/mgl/Makefile.am deleted file mode 100644 index 9af0194..0000000 --- a/mgl/Makefile.am +++ /dev/null @@ -1,64 +0,0 @@ -AM_CXXFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include - -lib_LTLIBRARIES = libmgl.la - -WIDGETS = -if USE_QT -WIDGETS += -DWITH_QT -endif -if USE_WX -WIDGETS += -DWITH_WX -endif -if USE_FLTK -WIDGETS += -DWITH_FLTK -endif -if USE_GLUT -WIDGETS += -DWITH_GLUT -endif - -libmgl_la_LIBADD = $(PNG_LIBS) $(GL_LIBS) $(LOPENMP) -libmgl_la_LDFLAGS = -no-undefined -version-info $(MGL_CURRENT):$(MGL_REVISION):$(MGL_AGE) - -libmgl_la_CXXFLAGS = $(WIDGETS) -DMGL_FONT_PATH=\"$(datadir)/$(PACKAGE)/fonts/\" \ - -DMOD_LIB_DIR=\"$(libdir)/mgl/\" $(HDF5_FLAGS) $(HDF4_FLAGS) $(GIF_FLAGS) $(JPEG_FLAGS) \ - $(TIFF_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_GIF -libmgl_la_LIBADD += $(GIF_LIBS) -endif - -if USE_JPEG -libmgl_la_LIBADD += $(JPEG_LIBS) -endif - -if USE_U3D -libmgl_la_LIBADD += $(U3D_LIBS) -endif - -libmgl_la_SOURCES = \ -mgl_data_cf.cpp mgl_axis.cpp mgl_data_png.cpp mgl_zb2.cpp \ -mgl_c.cpp mgl_eps.cpp mgl_font.cpp mgl_zb.cpp \ -mgl_combi.cpp mgl_eval.cpp mgl_gl.cpp mgl_def_font.cpp\ -mgl_1d.cpp mgl_cont.cpp mgl_exec.cpp mgl_tex_table.cpp\ -mgl_2d.cpp mgl_crust.cpp mgl_export.cpp mgl_main.cpp \ -mgl_3d.cpp mgl_data.cpp mgl_f.cpp mgl_idtf.cpp \ -mgl_ab.cpp mgl_data_io.cpp mgl_flow.cpp mgl_vect.cpp \ -mgl_parse.cpp mgl_fit.cpp mgl_pde.cpp mgl_evalc.cpp \ -mgl_addon.cpp mgl_evalp.cpp diff --git a/mgl/mgl_1d.cpp b/mgl/mgl_1d.cpp deleted file mode 100644 index 8806b12..0000000 --- a/mgl/mgl_1d.cpp +++ /dev/null @@ -1,1888 +0,0 @@ -/*************************************************************************** - * mgl_1d.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "mgl/mgl.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -#include "mgl/mgl_eval.h" -//----------------------------------------------------------------------------- -// -// Primitives -// -//----------------------------------------------------------------------------- -void mglGraph::Cone(mglPoint p1, mglPoint p2, mreal r1, mreal r2, const char *stl, bool edge) -{ - if(r2<0) r2 = r1; - if(r1==0 && r2==0) return; // zero radius is invisible - int n = edge ? 4:2; - mglData x(n), y(n), z(n), r(n); - if(edge) - { - mreal d; - d = (p2.x-p1.x)/1e3; x.a[0] = p1.x-d; x.a[1] = p1.x; x.a[2] = p2.x; x.a[3] = p2.x+d; - d = (p2.y-p1.y)/1e3; y.a[0] = p1.y-d; y.a[1] = p1.y; y.a[2] = p2.y; y.a[3] = p2.y+d; - d = (p2.z-p1.z)/1e3; z.a[0] = p1.z-d; z.a[1] = p1.z; z.a[2] = p2.z; z.a[3] = p2.z+d; - r.a[0] = 0; r.a[1] = r1; r.a[2] = r2; r.a[3] = 0; - } - else - { - x.a[0] = p1.x; x.a[1] = p2.x; - y.a[0] = p1.y; y.a[1] = p2.y; - z.a[0] = p1.z; z.a[1] = p2.z; - r.a[0] = r1; r.a[1] = r2; - } - Tube(x,y,z,r,stl); -} -//----------------------------------------------------------------------------- -void mglGraph::Curve(mglPoint p1, mglPoint d1, mglPoint p2, mglPoint d2, const char *stl, int n) -{ - static int cgid=1; StartGroup("Curve",cgid++); - register long i; - n = (n<2) ? 2 : n; - mreal *pp = new mreal[3*n],a[3],b[3],s; - bool cut = Cut; Cut = true; - SelectPen(stl); - a[0] = 3*(p2.x-p1.x) - (d2.x+2*d1.x); b[0] = d1.x+d2.x - 2*(p2.x-p1.x); - a[1] = 3*(p2.y-p1.y) - (d2.y+2*d1.y); b[1] = d1.y+d2.y - 2*(p2.y-p1.y); - a[2] = 3*(p2.z-p1.z) - (d2.z+2*d1.z); b[2] = d1.z+d2.z - 2*(p2.z-p1.z); - - for(i=0;iCalc(x[i]); } - - for(i=0;iCalc(xs); - if(fabs(yr-ys)>ym) // bad approximation here - { - x = (mreal *)realloc(x,(n+1)*sizeof(mreal)); - y = (mreal *)realloc(y,(n+1)*sizeof(mreal)); - memmove(x+i+2,x+i+1,(n-i-1)*sizeof(mreal)); - memmove(y+i+2,y+i+1,(n-i-1)*sizeof(mreal)); - x[i+1] = xs; y[i+1] = yr; n++; - } - else i++; - } - - delete eq; - mglData yy,xx; - xx.Set(x,n); free(x); - yy.Set(y,n); free(y); - Plot(xx,yy,pen, zVal); -} -//----------------------------------------------------------------------------- -void mglGraph::Plot(const char *eqX, const char *eqY, const char *eqZ, const char *pen, int n) -{ - if(n<=0) n=100; - mreal *x = (mreal *)malloc(n*sizeof(mreal)); - mreal *y = (mreal *)malloc(n*sizeof(mreal)); - mreal *z = (mreal *)malloc(n*sizeof(mreal)); - mreal *t = (mreal *)malloc(n*sizeof(mreal)); - mglFormula *ex, *ey, *ez; - ex = new mglFormula(eqX ? eqX : "0"); - ey = new mglFormula(eqY ? eqY : "0"); - ez = new mglFormula(eqZ ? eqZ : "0"); - register int i; - mreal ts, xs, ys, zs, xr, yr, zr, xm=fabs(Max.x - Min.x)/1000, ym=fabs(Max.y - Min.y)/1000, zm=fabs(Max.z - Min.z)/1000; - for(i=0;iCalc(0,0,t[i]); - y[i] = ey->Calc(0,0,t[i]); - z[i] = ez->Calc(0,0,t[i]); - } - - for(i=0;iCalc(0,0,ts); - ys=(y[i]+y[i+1])/2; yr=ey->Calc(0,0,ts); - zs=(z[i]+z[i+1])/2; zr=ez->Calc(0,0,ts); - if(fabs(xr-xs)>xm || fabs(yr-ys)>ym || fabs(zr-zs)>zm) // bad approximation here - { - z = (mreal *)realloc(z,(n+1)*sizeof(mreal)); - t = (mreal *)realloc(t,(n+1)*sizeof(mreal)); - x = (mreal *)realloc(x,(n+1)*sizeof(mreal)); - y = (mreal *)realloc(y,(n+1)*sizeof(mreal)); - memmove(x+i+2,x+i+1,(n-i-1)*sizeof(mreal)); - memmove(y+i+2,y+i+1,(n-i-1)*sizeof(mreal)); - memmove(z+i+2,z+i+1,(n-i-1)*sizeof(mreal)); - memmove(t+i+2,t+i+1,(n-i-1)*sizeof(mreal)); - t[i+1]=ts; x[i+1]=xr; y[i+1]=yr; z[i+1]=zr; n++; - } - else i++; - } - delete ex; delete ey; delete ez; - - mglData xx,yy,zz; - xx.Set(x,n); yy.Set(y,n); zz.Set(z,n); - free(x); free(y); free(z); free(t); - Plot(xx,yy,zz,pen); -} -//----------------------------------------------------------------------------- -// -// Radar series -// -//----------------------------------------------------------------------------- -void mglGraph::Radar(const mglData &a, const char *pen, mreal r) -{ - long n = a.nx; - if(n<2) { SetWarn(mglWarnLow,"Radar"); return; } - mglData x(n+1,a.ny), y(n+1,a.ny); - mreal m=a.Minimal(); - if(r<0) r = m<0 ? -m:0; - register long i,j; - for(j=0;j0) - { - x.Create(101); y.Create(101); - for(i=0;i<101;i++) - { x.a[i]=r*cos(2*i*M_PI/100); y.a[i]=r*sin(2*i*M_PI/100); } - Plot(x,y,"k"); SetPal(0); - } - } -} -//----------------------------------------------------------------------------- -// -// Plot series -// -//----------------------------------------------------------------------------- -void mglGraph::Plot(const mglData &x, const mglData &y, const mglData &z, const char *pen) -{ - long j,m,mx,my,mz,n=y.nx; - Arrow1 = Arrow2 = '_'; - char mk=0; - if(x.nx!=n || z.nx!=n) { SetWarn(mglWarnDim,"Plot"); return; } - if(n<2) { SetWarn(mglWarnLow,"Plot"); return; } - static int cgid=1; StartGroup("Plot",cgid++); - m = x.ny > y.ny ? x.ny : y.ny; m = z.ny > m ? z.ny : m; - mreal *pp = new mreal[6*n]; - bool *tt = new bool[2*n],inan,onan; - if(pen && *pen) mk=SelectPen(pen); else Pen(NC, '-', BaseLineWidth); - SetPal(pen); - for(j=0;j0) onan = isnan(pp[k-3]) || isnan(pp[k-2]) || isnan(pp[k-1]); - tt[jj] = ScalePoint(pp[k],pp[k+1],pp[k+2]); - if(mk && tt[jj]) Mark(pp[k],pp[k+1],pp[k+2],mk); - if(jj>0 && ((tt[jj] && !tt[jj-1] && !onan) || (tt[jj-1] && !tt[jj] && !inan))) // do smoothing - { - float i1=0, i2=1, ii; - pp[k+3] = pp[k+0]; pp[k+4] = pp[k+1]; // copy current - pp[k+5] = pp[k+2]; tt[jj+1] = tt[jj]; - do { - ii = (i1+i2)/2; - pp[k+0] = x.a[i+mx*n]*ii+x.a[i-1+mx*n]*(1-ii); - pp[k+1] = y.a[i+my*n]*ii+y.a[i-1+my*n]*(1-ii); - pp[k+2] = z.a[i+mz*n]*ii+z.a[i-1+mz*n]*(1-ii); - tt[jj] = ScalePoint(pp[k],pp[k+1],pp[k+2]); - if((tt[jj] && tt[jj+1]) || (tt[jj-1] && !tt[jj])) i2 = ii; - else i1 = ii; - } while(fabs(i2-i1)>1e-3); - tt[jj] = true; jj++; - } - } - curv_plot(jj,pp,tt); - } - SetPal(0); EndGroup(); - delete []tt; delete []pp; -} -//----------------------------------------------------------------------------- -void mglGraph::Plot(const mglData &x, const mglData &y, const char *pen,mreal zVal) -{ - mglData z(y.nx); - if(isnan(zVal)) zVal = Min.z; - z.Fill(zVal,zVal); - Plot(x,y,z,pen); -} -//----------------------------------------------------------------------------- -void mglGraph::Plot(const mglData &y, const char *pen,mreal zVal) -{ - if(y.nx<2) { SetWarn(mglWarnLow,"Plot"); return; } - mglData x(y.nx); - x.Fill(Min.x,Max.x); - Plot(x,y,pen,zVal); -} -//----------------------------------------------------------------------------- -// -// Plot series -// -//----------------------------------------------------------------------------- -void mglGraph::Tens(const mglData &x, const mglData &y, const mglData &z, const mglData &c, const char *pen) -{ - long j,m,mx,my,mz,mc,n=y.nx; - Arrow1 = Arrow2 = '_'; - char mk=0; - if(x.nx!=n || z.nx!=n || c.nx!=n) - { SetWarn(mglWarnDim,"Tens"); return; } - if(n<2) { SetWarn(mglWarnLow,"Tens"); return; } - static int cgid=1; StartGroup("Tens",cgid++); - m = x.ny > y.ny ? x.ny : y.ny; m = z.ny > m ? z.ny : m; - mreal *pp = new mreal[6*n], *cc = new mreal[2*n]; - bool *tt = new bool[2*n]; - if(pen && *pen) { SetScheme(pen,false); mk=SelectPen(pen); } - for(j=0;j0 && ((tt[jj] && !tt[jj-1]) || (tt[jj-1] && !tt[jj]))) // do smoothing - { - float i1=0, i2=1, ii; - pp[k+3] = pp[k+0]; pp[k+4] = pp[k+1]; // copy current - pp[k+5] = pp[k+2]; tt[jj+1] = tt[jj]; - do { - ii = (i1+i2)/2; - pp[k+0] = x.a[i+mx*n]*ii+x.a[i-1+mx*n]*(1-ii); - pp[k+1] = y.a[i+my*n]*ii+y.a[i-1+my*n]*(1-ii); - pp[k+2] = z.a[i+mz*n]*ii+z.a[i-1+mz*n]*(1-ii); - tt[jj] = ScalePoint(pp[k],pp[k+1],pp[k+2]); - if((tt[jj] && tt[jj+1]) || (tt[jj-1] && !tt[jj])) i2 = ii; - else i1 = ii; - } while(fabs(i2-i1)>1e-3); - tt[jj] = true; jj++; - } - } - curv_plot(jj,pp,cc,tt); - } - EndGroup(); - delete []tt; delete []pp; delete []cc; -} -//----------------------------------------------------------------------------- -void mglGraph::Tens(const mglData &x, const mglData &y, const mglData &c, const char *pen,mreal zVal) -{ - mglData z(y.nx); - if(isnan(zVal)) zVal = Min.z; - z.Fill(zVal,zVal); - Tens(x,y,z,c,pen); -} -//----------------------------------------------------------------------------- -void mglGraph::Tens(const mglData &y, const mglData &c, const char *pen,mreal zVal) -{ - if(y.nx<2) { SetWarn(mglWarnLow,"Tens"); return; } - mglData x(y.nx); - x.Fill(Min.x,Max.x); - Tens(x,y,c,pen,zVal); -} -//----------------------------------------------------------------------------- -// -// Area series -// -//----------------------------------------------------------------------------- -void mglGraph::Area(const mglData &x, const mglData &y, const mglData &z, const char *pen) -{ - long i,j,n=y.nx,m,mx,my,mz; - if(x.nx!=n || z.nx!=n) { SetWarn(mglWarnDim,"Area"); return; } - if(n<2) { SetWarn(mglWarnLow,"Area"); return; } - static int cgid=1; StartGroup("Area3",cgid++); - m = x.ny > y.ny ? x.ny : y.ny; m = z.ny > m ? z.ny : m; - mreal *pp = new mreal[6*n], *cc = new mreal[8*n], z0=GetOrgZ('x'); - bool *tt = new bool[2*n]; - mglColor c1,c2; - SetPal(pen); - for(j=0;j0 ? f.a[i+j*n-n] : y0; - pp[6*i+5] = znan ? Min.z + (m-1-j)*(Max.z-Min.z)/m : zVal; - tt[2*i+1] = ScalePoint(pp[6*i+3],pp[6*i+4],pp[6*i+5]); - } - surf_plot(2,n,pp,cc,tt); - } - SetPal(0); EndGroup(); - delete []pp; delete []tt; delete []cc; -} -//----------------------------------------------------------------------------- -void mglGraph::Area(const mglData &y, const char *pen, mreal zVal) -{ - if(y.nx<2) { SetWarn(mglWarnLow,"Area"); return; } - mglData x(y.nx); - x.Fill(Min.x,Max.x); - Area(x,y,pen,zVal); -} -//----------------------------------------------------------------------------- -// -// Region series -// -//----------------------------------------------------------------------------- -void mglGraph::Region(const mglData &x, const mglData &y1, const mglData &y2, const char *pen, mreal zVal, bool inside) -{ - long i,j, n=y1.nx, m=y1.ny, mx; - if(x.nx!=n || y2.nx!=n || y2.ny!=m) - { SetWarn(mglWarnDim,"Region"); return; } - if(n<2) { SetWarn(mglWarnLow,"Region"); return; } - static int cgid=1; StartGroup("Region",cgid++); - mreal *pp = new mreal[6*n], *cc = new mreal[8*n], f1,f2; - bool *tt = new bool[2*n]; - if(isnan(zVal)) zVal = Min.z; - - mglColor c1,c2; - SetPal(pen); - for(j=0;jf2 && inside) { tt[2*i] = tt[2*i+1] = false; } - } - surf_plot(2,n,pp,cc,tt); - } - SetPal(0); EndGroup(); - delete []pp; delete []tt; delete []cc; -} -//----------------------------------------------------------------------------- -void mglGraph::Region(const mglData &y1, const mglData &y2, const char *pen, mreal zVal, bool inside) -{ - mglData x(y1.nx); - x.Fill(Min.z, Max.z); - Region(x,y1,y2,pen,zVal,inside); -} -//----------------------------------------------------------------------------- -// -// Step series -// -//----------------------------------------------------------------------------- -void mglGraph::Step(const mglData &x, const mglData &y, const mglData &z, const char *pen) -{ - long i,j,m,mx,my,mz,n=y.nx; - char mk=0; - Arrow1 = Arrow2 = '_'; - if(x.nx!=n || z.nx!=n) { SetWarn(mglWarnDim,"Step"); return; } - if(n<2) { SetWarn(mglWarnLow,"Step"); return; } - static int cgid=1; StartGroup("Step3",cgid++); - m = x.ny > y.ny ? x.ny : y.ny; m = z.ny > m ? z.ny : m; - mreal *pp = new mreal[6*n]; - bool *tt = new bool[2*n]; - if(pen && *pen) mk=SelectPen(pen); else Pen(NC, '-', BaseLineWidth); - SetPal(pen); - for(j=0;j y.ny ? x.ny : y.ny; - mreal *pp = new mreal[6*n]; - bool *tt = new bool[2*n]; - if(isnan(zVal)) zVal = Min.z; - - if(pen && *pen) mk=SelectPen(pen); else Pen(NC, '-', BaseLineWidth); - SetPal(pen); - for(j=0;j y.ny ? x.ny : y.ny; m = z.ny > m ? z.ny : m; - mreal *pp = new mreal[6*n],z0=GetOrgZ('x'); - long *nn = new long[2*n]; - bool *tt = new bool[2*n]; - if(pen && *pen) mk=SelectPen(pen); else Pen(NC, '-', BaseLineWidth); - SetPal(pen); - for(j=0;j y.ny ? x.ny : y.ny; - mreal *pp = new mreal[6*n],y0=GetOrgY('x'); - long *nn = new long[2*n]; - bool *tt = new bool[2*n]; - if(isnan(zVal)) zVal = Min.z; - - if(pen && *pen) mk=SelectPen(pen); else Pen(NC, '-', BaseLineWidth); - SetPal(pen); - for(j=0;j y.ny ? x.ny : y.ny; m = z.ny > m ? z.ny : m; - mreal *pp = new mreal[12*n],*cc = new mreal[16*n],x1,x2,y1,y2,z0,zz,zp; - bool *tt = new bool[4*n], wire = pen && strchr(pen,'#'); - bool above = pen && strchr(pen,'a')!=0, fall = pen && strchr(pen,'f')!=0; - if(above) fall = false; - mglData dd(above ? n : 1); - - mglColor c1,c2,c; - SetPal(pen); - for(j=0;j0) - { - x1 = x.a[i+n*mx] - BarWidth*(x.a[i+n*mx]-x.a[i-1+n*mx])/2; - y1 = y.a[i+n*my] - BarWidth*(y.a[i+n*my]-y.a[i-1+n*my])/2; - } - else { x1 = x.a[i+n*mx]; y1 = y.a[i+n*my]; } - zz = z.a[i+n*mz]; - if(!above) - { - x2 = (x2-x1)/m; x1 += j*x2; x2 += x1; - y2 = (y2-y1)/m; y1 += j*y2; y2 += y1; - } - else - { z0 = GetOrgZ('x') + dd.a[i]; dd.a[i] += zz; zz += z0; } - if(fall) { z0 = zp; zz += z0; zp = zz; } - - c = (z.a[i+n*mz]<0) ? c1 : c2; - cc[16*i] = cc[16*i+4] = cc[16*i+8] = cc[16*i+12] = c.r; - cc[16*i+1] = cc[16*i+5] = cc[16*i+9] = cc[16*i+13] = c.g; - cc[16*i+2] = cc[16*i+6] = cc[16*i+10]= cc[16*i+14] = c.b; - cc[16*i+3] = cc[16*i+7] = cc[16*i+11]= cc[16*i+15] = AlphaDef; - - pp[12*i+0] = x1; pp[12*i+1] = y1; pp[12*i+2] = zz; - pp[12*i+3] = x1; pp[12*i+4] = y1; pp[12*i+5] = z0; - pp[12*i+6] = x2; pp[12*i+7] = y2; pp[12*i+8] = z0; - pp[12*i+9] = x2; pp[12*i+10]= y2; pp[12*i+11]= zz; - tt[4*i] = ScalePoint(pp[12*i+0],pp[12*i+1],pp[12*i+2]); - tt[4*i+1] = ScalePoint(pp[12*i+3],pp[12*i+4],pp[12*i+5]); - tt[4*i+2] = ScalePoint(pp[12*i+6],pp[12*i+7],pp[12*i+8]); - tt[4*i+3] = ScalePoint(pp[12*i+9],pp[12*i+10],pp[12*i+11]); - } - quads_plot(n,pp,cc,tt); - if(wire) for(i=0;i y.ny ? x.ny : y.ny; - mreal *pp = new mreal[12*n],*cc = new mreal[16*n],x1,x2,yy,y0,yp; - bool *tt = new bool[4*n], wire = pen && strchr(pen,'#'); - if(isnan(zVal)) zVal = Min.z; - bool above = pen && strchr(pen,'a')!=0, fall = pen && strchr(pen,'f')!=0; - if(above) fall = false; - mglData dd(above ? n : 1); - - mglColor c1,c2,c; - SetPal(pen); - for(j=0;j0) x1 = x.a[i+n*mx] - BarWidth*(x.a[i+n*mx]-x.a[i-1+n*mx])/2; - else x1 = x.a[i+n*mx]; - yy = y.a[i+n*my]; - if(!above) - { x2 = (x2-x1)/m; x1 += j*x2; x2 += x1; } - else - { y0 = GetOrgY('x') + dd.a[i]; dd.a[i] += yy; yy += y0; } - if(fall) { y0 = yp; yy += y0; yp = yy; } - - c = (y.a[i+n*my]<0) ? c1 : c2; - cc[16*i] = cc[16*i+4] = cc[16*i+8] = cc[16*i+12] = c.r; - cc[16*i+1] = cc[16*i+5] = cc[16*i+9] = cc[16*i+13] = c.g; - cc[16*i+2] = cc[16*i+6] = cc[16*i+10]= cc[16*i+14] = c.b; - cc[16*i+3] = cc[16*i+7] = cc[16*i+11]= cc[16*i+15] = AlphaDef; - - pp[12*i+0] = x1; pp[12*i+1] = yy; pp[12*i+2] = zVal; - pp[12*i+3] = x1; pp[12*i+4] = y0; pp[12*i+5] = zVal; - pp[12*i+6] = x2; pp[12*i+7] = y0; pp[12*i+8] = zVal; - pp[12*i+9] = x2; pp[12*i+10]= yy; pp[12*i+11]= zVal; - tt[4*i] = ScalePoint(pp[12*i+0],pp[12*i+1],pp[12*i+2]); - tt[4*i+1] = ScalePoint(pp[12*i+3],pp[12*i+4],pp[12*i+5]); - tt[4*i+2] = ScalePoint(pp[12*i+6],pp[12*i+7],pp[12*i+8]); - tt[4*i+3] = ScalePoint(pp[12*i+9],pp[12*i+10],pp[12*i+11]); - } - quads_plot(n,pp,cc,tt); - if(wire) for(i=0;i v.ny ? y.ny : v.ny; - mreal *pp = new mreal[12*n],*cc = new mreal[16*n],y1,y2,xx,x0,xp; - bool *tt = new bool[4*n], wire = pen && strchr(pen,'#'); - if(isnan(zVal)) zVal = Min.z; - bool above = pen && strchr(pen,'a')!=0, fall = pen && strchr(pen,'f')!=0; - if(above) fall = false; - mglData dd(above ? n : 1); - - mglColor c1,c2,c; - SetPal(pen); - for(j=0;j0) y1 = y.a[i+n*my] - BarWidth*(y.a[i+n*my]-y.a[i-1+n*my])/2; - else y1 = y.a[i+n*my]; - xx = v.a[i+n*mx]; - if(!above) - { y2 = (y2-y1)/m; y1 += j*y2; y2 += y1; } - else - { x0 = GetOrgX('y') + dd.a[i]; dd.a[i] += xx; xx += x0; } - if(fall) { x0 = xp; xx += x0; xp = xx; } - - c = (v.a[i+n*mx]<0) ? c1 : c2; - cc[16*i] = cc[16*i+4] = cc[16*i+8] = cc[16*i+12] = c.r; - cc[16*i+1] = cc[16*i+5] = cc[16*i+9] = cc[16*i+13] = c.g; - cc[16*i+2] = cc[16*i+6] = cc[16*i+10]= cc[16*i+14] = c.b; - cc[16*i+3] = cc[16*i+7] = cc[16*i+11]= cc[16*i+15] = AlphaDef; - - pp[12*i+0] = xx; pp[12*i+1] = y1; pp[12*i+2] = zVal; - pp[12*i+3] = xx; pp[12*i+4] = y2; pp[12*i+5] = zVal; - pp[12*i+6] = x0; pp[12*i+7] = y2; pp[12*i+8] = zVal; - pp[12*i+9] = x0; pp[12*i+10]= y1; pp[12*i+11]= zVal; - tt[4*i] = ScalePoint(pp[12*i+0],pp[12*i+1],pp[12*i+2]); - tt[4*i+1] = ScalePoint(pp[12*i+3],pp[12*i+4],pp[12*i+5]); - tt[4*i+2] = ScalePoint(pp[12*i+6],pp[12*i+7],pp[12*i+8]); - tt[4*i+3] = ScalePoint(pp[12*i+9],pp[12*i+10],pp[12*i+11]); - } - quads_plot(n,pp,cc,tt); - if(wire) for(i=0;i0) x1 = x.a[i] - BarWidth*(x.a[i]-x.a[i-1])/2; - else x1 = x.a[i]; - // x-coordinates of lines - pp[i0] = pp[i0+12]=pp[i0+18]=pp[i0+24]=pp[i0+30]=pp[i0+33]=pp[i0+48]=x1; - pp[i0+3]=pp[i0+15]=pp[i0+21]=pp[i0+27]=pp[i0+36]=pp[i0+39]=pp[i0+51]=x2; - pp[i0+6]=pp[i0+9] =pp[i0+42]=pp[i0+45]=x.a[i]; - // y-coordinates of lines - pp[i0+1] = pp[i0+4] = pp[i0+7] = b[i]; - pp[i0+49] = pp[i0+52] = pp[i0+46] = b[i+4*n]; - pp[i0+19] = pp[i0+22] = b[i+2*n]; - pp[i0+10] = pp[i0+13] = pp[i0+16] = pp[i0+31] = pp[i0+37] = b[i+n]; - pp[i0+25] = pp[i0+28] = pp[i0+34] = pp[i0+40] = pp[i0+43] = b[i+3*n]; - if(isnan(b[i]) || isnan(b[i+n]) || isnan(b[i+2*n]) || isnan(b[i+3*n]) || isnan(b[i+4*n])) - for(j=0;j<18;j++) tt[j+18*i] = false; - else for(j=0;j<18;j++) - { - i0 = j+18*i; - tt[i0] = ScalePoint(pp[3*i0],pp[3*i0+1],pp[3*i0+2]); - } - } - lines_plot(9*n,pp,0,tt,false,false); - cmap[0]=c1; cmap[1]=c2; SetPal(0); EndGroup(); - delete []b; delete []tt; delete []pp; -} -//----------------------------------------------------------------------------- -void mglGraph::BoxPlot(const mglData &y, const char *pen,mreal zVal) -{ - if(y.nx<2) { SetWarn(mglWarnLow,"BoxPlot"); return; } - mglData x(y.nx); - x.Fill(Min.x,Max.x); - BoxPlot(x,y,pen,zVal); -} -//----------------------------------------------------------------------------- -// -// Torus series -// -//----------------------------------------------------------------------------- -void mglGraph::Torus(const mglData &r, const mglData &z, const char *sch) -{ - long i,j,n=r.nx; - if(r.nx*r.ny!=z.nx*z.ny){ SetWarn(mglWarnDim,"Torus"); return; } - if(n<2) { SetWarn(mglWarnLow,"Torus"); return; } - static int cgid=1; StartGroup("Torus",cgid++); - mreal *pp = new mreal[3*n]; - long *nn = new long[n]; - SetScheme(sch); - if(sch) - { - if(strchr(sch,'x')) AxialDir = 'x'; -// if(strchr(sch,'y')) AxialDir = 'y'; - else if(strchr(sch,'z')) AxialDir = 'z'; - else AxialDir = 'y'; - } - - Color(Cmin); - memset(pp,0,3*n*sizeof(mreal)); - for(j=0;j y.ny ? x.ny : y.ny; m = z.ny > m ? z.ny : m; - mreal ms = MarkSize, xx,yy,zz; - bool tt; - - if(pen && *pen) mk=SelectPen(pen); else mk='o'; - if(mk==0) return; - SetPal(pen); - for(j=0;j y.ny ? x.ny : y.ny; m = z.ny > m ? z.ny : m; - - for(j=0;j0) - { lx = xx-q[i*3-3]; ly = yy-q[i*3-2]; lz = zz-q[i*3-1]; } - else - { lx = q[i*3+3]-xx; ly = q[i*3+4]-yy; lz = q[i*3+5]-zz; } - len = sqrt(lx*lx+ly*ly+lz*lz); - if(len==0) { m--; continue; } else j++; - lx /= len; ly /= len; lz /= len; - if(i>0) - { - len = gx*lx+gy*ly+gz*lz; - gx -= lx*len; gy -= ly*len; gz -= lz*len; - len = sqrt(gx*gx+gy*gy+gz*gz); - gx /= len; gy /= len; gz /= len; - } - else - { - if(lx==0 && ly==0) - { gx = -lz/hypot(lx,lz); gz = lx/hypot(lx,lz); gy=0; } - else - { gx = ly/hypot(lx,ly); gy = -lx/hypot(lx,ly); gz=0; } - } - hx = ly*gz-lz*gy; hy = lz*gx-lx*gz; hz = lx*gy-ly*gx; - for(k=0;k y.ny ? x.ny : y.ny; m = z.ny > m ? z.ny : m; m = r.ny > m ? r.ny : m; - mreal *pp = new mreal[3*n], *rr = new mreal[n]; - - SelectPen(pen); SetPal(pen); - for(j=0;jPlot(*x,*y,*z,pen); } -/// Draw line plot for points in arrays \a x, \a y. -void mgl_plot_xy(HMGL gr, const HMDT x, const HMDT y, const char *pen) -{ if(gr && x && y) gr->Plot(*x,*y,pen); } -/// Draw line plot for points in arrays \a y. -void mgl_plot(HMGL gr, const HMDT y, const char *pen) -{ if(gr && y) gr->Plot(*y,pen); } -/// Draw boxplot for points in arrays \a x, \a y. -void mgl_boxplot_xy(HMGL gr, const HMDT x, const HMDT y, const char *pen) -{ if(gr && x && y) gr->BoxPlot(*x,*y,pen); } -/// Draw bozplot for points in arrays \a y. -void mgl_boxplot(HMGL gr, const HMDT y, const char *pen) -{ if(gr && y) gr->BoxPlot(*y,pen); } -/// Draw radar plot for points in arrays \a y. -void mgl_radar(HMGL gr, const HMDT a, const char *pen, mreal r) -{ if(gr && a) gr->Radar(*a,pen,r); } -/// Draw line plot for points in arrays \a x, \a y, \a z. -void mgl_tens_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *pen) -{ if(gr && x && y && z) gr->Tens(*x,*y,*z,*c,pen); } -/// Draw line plot for points in arrays \a x, \a y. -void mgl_tens_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT c, const char *pen) -{ if(gr && x && y) gr->Tens(*x,*y,*c,pen); } -/// Draw line plot for points in arrays \a y. -void mgl_tens(HMGL gr, const HMDT y, const HMDT c, const char *pen) -{ if(gr && y) gr->Tens(*y,*c,pen); } -/// Draw area plot for points in arrays \a x, \a y, \a z. -void mgl_area_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const char *pen) -{ if(gr && x && y && z) gr->Area(*x,*y,*z,pen); } -/// Draw area plot for points in arrays \a x, \a y. -void mgl_area_xy(HMGL gr, const HMDT x, const HMDT y, const char *pen) -{ if(gr && x && y) gr->Area(*x,*y,pen); } -/// Draw area plot for points in arrays \a y. -void mgl_area(HMGL gr, const HMDT y, const char *pen) -{ if(gr && y) gr->Area(*y,pen); } -/// Fill area between curves \a y1, \a y2 parametrically dependent on \a x. -void mgl_region_xy(HMGL gr, const HMDT x, const HMDT y1, const HMDT y2, const char *pen, int inside) -{ if(gr && x && y1 && y2) gr->Region(*x,*y1,*y2,pen,NAN,inside); } -/// Fill area between curves \a y1, \a y2. -void mgl_region(HMGL gr, const HMDT y1, const HMDT y2, const char *pen, int inside) -{ if(gr && y1 && y2) gr->Region(*y1,*y2,pen,NAN,inside); } -/// draw mark with different type at position {x,y,z} -void mgl_mark(HMGL gr, mreal x,mreal y,mreal z,char mark) -{ gr->Mark(mglPoint(x,y,z),mark); } -/// Draw vertical lines from points in arrays \a x, \a y, \a z to mglGraph::Org. -void mgl_stem_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const char *pen) -{ if(gr && x && y && z) gr->Stem(*x,*y,*z,pen); } -/// Draw vertical lines from points in arrays \a x, \a y to mglGraph::Org. -void mgl_stem_xy(HMGL gr, const HMDT x, const HMDT y, const char *pen) -{ if(gr && x && y) gr->Stem(*x,*y,pen); } -/// Draw vertical lines from points in arrays \a y to mglGraph::Org. -void mgl_stem(HMGL gr, const HMDT y, const char *pen) -{ if(gr && y) gr->Stem(*y,pen); } -/// Draw stairs for points in arrays \a x, \a y, \a z. -void mgl_step_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const char *pen) -{ if(gr && x && y && z) gr->Step(*x,*y,*z,pen); } -/// Draw stairs for points in arrays \a x, \a y. -void mgl_step_xy(HMGL gr, const HMDT x, const HMDT y, const char *pen) -{ if(gr && x && y) gr->Step(*x,*y,pen); } -/// Draw line plot for points in arrays \a y. -void mgl_step(HMGL gr, const HMDT y, const char *pen) -{ if(gr && y) gr->Step(*y,pen); } -/// Draw vertical bars from points in arrays \a x, \a y, \a z to mglGraph::Org. -void mgl_bars_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const char *pen) -{ if(gr && x && y && z) gr->Bars(*x,*y,*z,pen); } -/// Draw vertical bars from points in arrays \a x, \a y to mglGraph::Org. -void mgl_bars_xy(HMGL gr, const HMDT x, const HMDT y, const char *pen) -{ if(gr && x && y) gr->Bars(*x,*y,pen); } -/// Draw vertical bars from points in arrays \a y to mglGraph::Org. -void mgl_bars(HMGL gr, const HMDT y, const char *pen) -{ if(gr && y) gr->Bars(*y,pen); } -/// Draw vertical bars from points in arrays \a x, \a y to mglGraph::Org. -void mgl_barh_yx(HMGL gr, const HMDT y, const HMDT v, const char *pen) -{ if(gr && v && y) gr->Barh(*y,*v,pen); } -/// Draw vertical bars from points in arrays \a y to mglGraph::Org. -void mgl_barh(HMGL gr, const HMDT v, const char *pen) -{ if(gr && v) gr->Barh(*v,pen); } -/// Draw surface of curve {\a r,\a z} rotatation around Z axis -void mgl_torus(HMGL gr, const HMDT r, const HMDT z, const char *pen) -{ if(gr && r && z) gr->Torus(*r, *z, pen); } -//----------------------------------------------------------------------------- -/// Draw chart for data a -void mgl_chart(HMGL gr, const HMDT a, const char *col) -{ if(gr&&a) gr->Chart(*a, col); } -/// Draw error boxes ey for data y -void mgl_error(HMGL gr, const HMDT y, const HMDT ey, const char *pen) -{ if(gr&&y&&ey) gr->Error(*y,*ey,pen); } -/// Draw error boxes ey for data {x,y} -void mgl_error_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT ey, const char *pen) -{ if(gr&&x&&y&&ey) gr->Error(*x,*y,*ey,pen); } -/// Draw error boxes {ex,ey} for data {x,y} -void mgl_error_exy(HMGL gr, const HMDT x, const HMDT y, const HMDT ex, const HMDT ey, const char *pen) -{ if(gr&&x&&ex&&y&&ey) gr->Error(*x,*y,*ex,*ey,pen); } -/// Draw marks with diffenernt sizes \a r for points in arrays \a x, \a y, \a z. -void mgl_mark_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT r, const char *pen) -{ if(gr&&x&&y&&z&&r) gr->Mark(*x,*y,*z,*r,pen); } -/// Draw marks with diffenernt sizes \a r for points in arrays \a x, \a y. -void mgl_mark_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT r, const char *pen) -{ if(gr&&x&&y&&r) gr->Mark(*x,*y,*r,pen); } -/// Draw marks with diffenernt sizes \a r for points in arrays \a y. -void mgl_mark_y(HMGL gr, const HMDT y, const HMDT r, const char *pen) -{ if(gr&&y&&r) gr->Mark(*y,*r,pen); } -/// Draw tube with radial sizes \a r for points in arrays \a x, \a y, \a z. -void mgl_tube_xyzr(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT r, const char *pen) -{ if(gr&&x&&y&&z&&r) gr->Tube(*x,*y,*z,*r,pen); } -/// Draw tube with radial sizes \a r for points in arrays \a x, \a y. -void mgl_tube_xyr(HMGL gr, const HMDT x, const HMDT y, const HMDT r, const char *pen) -{ if(gr&&x&&y&&r) gr->Tube(*x,*y,*r,pen); } -/// Draw tube with radial sizes \a r for points in arrays \a y. -void mgl_tube_r(HMGL gr, const HMDT y, const HMDT r, const char *pen) -{ if(gr&&y&&r) gr->Tube(*y,*r,pen); } -/// Draw tube with constant radial sizes \a r for points in arrays \a x, \a y, \a z. -void mgl_tube_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, mreal r, const char *pen) -{ if(gr&&x&&y&&z) gr->Tube(*x,*y,*z,r,pen); } -/// Draw tube with constant radial sizes \a r for points in arrays \a x, \a y. -void mgl_tube_xy(HMGL gr, const HMDT x, const HMDT y, mreal r, const char *pen) -{ if(gr&&x&&y) gr->Tube(*x,*y,r,pen); } -/// Draw tube with constant radial sizes \a r for points in arrays \a y. -void mgl_tube(HMGL gr, const HMDT y, mreal r, const char *pen) -{ if(gr&&y) gr->Tube(*y,r,pen); } -//----------------------------------------------------------------------------- -// 1D plotting functions (Fortran) -//----------------------------------------------------------------------------- -/// Draw line plot for points in arrays \a x, \a y, \a z. -void mgl_plot_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && x && y && z) _GR_->Plot(_D_(x),_D_(y),_D_(z),s); - delete []s; -} -/// Draw line plot for points in arrays \a x, \a y. -void mgl_plot_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && x && y) _GR_->Plot(_D_(x),_D_(y),s); - delete []s; -} -/// Draw line plot for points in arrays \a y. -void mgl_plot_(uintptr_t *gr, uintptr_t *y, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && y) _GR_->Plot(_D_(y),s); - delete []s; -} -/// Draw boxplot for points in arrays \a x, \a y. -void mgl_boxplot_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && x && y) _GR_->BoxPlot(_D_(x),_D_(y),s); - delete []s; -} -/// Draw boxplot for points in arrays \a y. -void mgl_boxplot_(uintptr_t *gr, uintptr_t *y, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && y) _GR_->BoxPlot(_D_(y),s); - delete []s; -} -/// Draw radar plot for points in arrays \a y. -void mgl_radar_(uintptr_t *gr, uintptr_t *a, const char *pen, mreal *r, int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && a) _GR_->Radar(_D_(a),s,*r); - delete []s; -} -/// Draw line plot for points in arrays \a x, \a y, \a z. -void mgl_tens_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && x && y && z) _GR_->Tens(_D_(x),_D_(y),_D_(z),_D_(c),s); - delete []s; -} -/// Draw line plot for points in arrays \a x, \a y. -void mgl_tens_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *c, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && x && y) _GR_->Tens(_D_(x),_D_(y),_D_(c),s); - delete []s; -} -/// Draw line plot for points in arrays \a y. -void mgl_tens_(uintptr_t *gr, uintptr_t *y, uintptr_t *c, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && y) _GR_->Tens(_D_(y),_D_(c),s); - delete []s; -} - -/// Draw area plot for points in arrays \a x, \a y, \a z. -void mgl_area_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && x && y && z) _GR_->Area(_D_(x),_D_(y),_D_(z),s); - delete []s; -} -/// Draw area plot for points in arrays \a x, \a y. -void mgl_area_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && x && y) _GR_->Area(_D_(x),_D_(y),s); - delete []s; -} -/// Draw area plot for points in arrays \a y. -void mgl_area_(uintptr_t *gr, uintptr_t *y, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && y) _GR_->Area(_D_(y),s); - delete []s; -} -/// Fill area between the curves \a y1, \a y2 parametrically dependent on \a x. -void mgl_region_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y1, uintptr_t *y2, const char *pen, int *inside, int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && x && y1 && y2) _GR_->Region(_D_(x),_D_(y1),_D_(y2),s,NAN,*inside); - delete []s; -} -/// Fill area between the curves \a y1, \a y2. -void mgl_region_(uintptr_t *gr, uintptr_t *y1, uintptr_t *y2, const char *pen, int *inside, int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && y1 && y2) _GR_->Region(_D_(y1),_D_(y2),s,NAN,*inside); - delete []s; -} -/// draw mark with different type at position {x,y,z} -void mgl_mark_(uintptr_t *gr, mreal *x,mreal *y,mreal *z,const char *mark,int) -{ _GR_->Mark(mglPoint(*x,*y,*z),*mark); } -/// Draw vertical lines from points in arrays \a x, \a y, \a z to mglGraph::Org. -void mgl_stem_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && x && y && z) _GR_->Stem(_D_(x),_D_(y),_D_(z),s); - delete []s; -} -/// Draw vertical lines from points in arrays \a x, \a y to mglGraph::Org. -void mgl_stem_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && x && y) _GR_->Stem(_D_(x),_D_(y),s); - delete []s; -} -/// Draw vertical lines from points in arrays \a y to mglGraph::Org. -void mgl_stem_(uintptr_t *gr, uintptr_t *y, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && y) _GR_->Stem(_D_(y),s); - delete []s; -} -/// Draw stairs for points in arrays \a x, \a y, \a z. -void mgl_step_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && x && y && z) _GR_->Step(_D_(x),_D_(y),_D_(z),s); - delete []s; -} -/// Draw stairs for points in arrays \a x, \a y. -void mgl_step_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && x && y) _GR_->Step(_D_(x),_D_(y),s); - delete []s; -} -/// Draw line plot for points in arrays \a y. -void mgl_step_(uintptr_t *gr, uintptr_t *y, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && y) _GR_->Step(_D_(y),s); - delete []s; -} -/// Draw vertical bars from points in arrays \a x, \a y, \a z to mglGraph::Org. -void mgl_bars_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && x && y && z) _GR_->Bars(_D_(x),_D_(y),_D_(z),s); - delete []s; -} -/// Draw vertical bars from points in arrays \a x, \a y to mglGraph::Org. -void mgl_bars_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && x && y) _GR_->Bars(_D_(x),_D_(y),s); - delete []s; -} -/// Draw vertical bars from points in arrays \a y to mglGraph::Org. -void mgl_bars_(uintptr_t *gr, uintptr_t *y, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && y) _GR_->Bars(_D_(y),s); - delete []s; -} -/// Draw vertical bars from points in arrays \a x, \a y to mglGraph::Org. -void mgl_barh_yx_(uintptr_t *gr, uintptr_t *y, uintptr_t *v, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && v && y) _GR_->Barh(_D_(y),_D_(v),s); - delete []s; -} -/// Draw vertical bars from points in arrays \a y to mglGraph::Org. -void mgl_barh_(uintptr_t *gr, uintptr_t *v, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && v) _GR_->Barh(_D_(v),s); - delete []s; -} -/// Draw surface of curve {\a r,\a z} rotatation around Z axis -void mgl_torus_(uintptr_t *gr, uintptr_t *r, uintptr_t *z, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr && r && z) _GR_->Torus(_D_(r), _D_(z), s); - delete []s; -} -//----------------------------------------------------------------------------- -/// Draw chart for data a -void mgl_chart_(uintptr_t *gr, uintptr_t *a, const char *col,int l) -{ - char *s=new char[l+1]; memcpy(s,col,l); s[l]=0; - if(gr&&a) _GR_->Chart(_D_(a), s); - delete []s; -} -/// Draw error boxes ey for data y -void mgl_error_(uintptr_t *gr, uintptr_t *y, uintptr_t *ey, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr&&y&&ey) _GR_->Error(_D_(y),_D_(ey),s); - delete []s; -} -/// Draw error boxes ey for data {x,y} -void mgl_error_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ey, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr&&x&&y&&ey) _GR_->Error(_D_(x),_D_(y),_D_(ey),s); - delete []s; -} -/// Draw error boxes {ex,ey} for data {x,y} -void mgl_error_exy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ex, uintptr_t *ey, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr&&x&&ex&&y&&ey) _GR_->Error(_D_(x),_D_(y),_D_(ex),_D_(ey),s); - delete []s; -} -/// Draw marks with diffenernt sizes \a r for points in arrays \a x, \a y, \a z. -void mgl_mark_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *r, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr&&x&&y&&z&&r) _GR_->Mark(_D_(x),_D_(y),_D_(z), _D_(r),s); - delete []s; -} -/// Draw marks with diffenernt sizes \a r for points in arrays \a x, \a y. -void mgl_mark_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *r, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr&&x&&y&&r) _GR_->Mark(_D_(x), _D_(y), _D_(r),s); - delete []s; -} -/// Draw marks with diffenernt sizes \a r for points in arrays \a y. -void mgl_mark_y_(uintptr_t *gr, uintptr_t *y, uintptr_t *r, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr&&y&&r) _GR_->Mark(_D_(y),_D_(r),s); - delete []s; -} -/// Draw tube with radial sizes \a r for points in arrays \a x, \a y, \a z. -void mgl_tube_xyzr_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *r, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr&&x&&y&&z&&r) _GR_->Tube(_D_(x),_D_(y),_D_(z), _D_(r),s); - delete []s; -} -/// Draw tube with radial sizes \a r for points in arrays \a x, \a y. -void mgl_tube_xyr_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *r, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr&&x&&y&&r) _GR_->Tube(_D_(x),_D_(y),_D_(r),s); - delete []s; -} -/// Draw tube with radial sizes \a r for points in arrays \a y. -void mgl_tube_r_(uintptr_t *gr, uintptr_t *y, uintptr_t *r, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr&&y&&r) _GR_->Tube(_D_(y),_D_(r),s); - delete []s; -} -/// Draw tube with constant radial sizes \a r for points in arrays \a x, \a y, \a z. -void mgl_tube_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, mreal *r, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr&&x&&y&&z) _GR_->Tube(_D_(x),_D_(y),_D_(z),*r,s); - delete []s; -} -/// Draw tube with constant radial sizes \a r for points in arrays \a x, \a y. -void mgl_tube_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, mreal *r, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr&&x&&y) _GR_->Tube(_D_(x),_D_(y),*r,s); - delete []s; -} -/// Draw tube with constant radial sizes \a r for points in arrays \a y. -void mgl_tube_(uintptr_t *gr, uintptr_t *y, mreal *r, const char *pen,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - if(gr&&y) _GR_->Tube(_D_(y),*r,s); - delete []s; -} -//----------------------------------------------------------------------------- -void mgl_textmark_xyzr(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT r, const char *text, const char *fnt) -{ if(gr&&z&&x&&y&&r&&text) gr->TextMark(*x,*y,*z,*r,text,fnt); } -void mgl_textmark_xyr(HMGL gr, const HMDT x, const HMDT y, const HMDT r, const char *text, const char *fnt) -{ if(gr&&x&&y&&r&&text) gr->TextMark(*x,*y,*r,text,fnt); } -void mgl_textmark_yr(HMGL gr, const HMDT y, const HMDT r, const char *text, const char *fnt) -{ if(gr&&y&&r&&text) gr->TextMark(*y,*r,text,fnt); } -void mgl_textmark(HMGL gr, const HMDT y, const char *text, const char *fnt) -{ if(gr&&y&&text) gr->TextMark(*y,text,fnt); } -void mgl_textmarkw_xyzr(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT r, const wchar_t *text, const char *fnt) -{ if(gr&&z&&x&&y&&r&&text) gr->TextMark(*x,*y,*z,*r,text,fnt); } -void mgl_textmarkw_xyr(HMGL gr, const HMDT x, const HMDT y, const HMDT r, const wchar_t *text, const char *fnt) -{ if(gr&&x&&y&&r&&text) gr->TextMark(*x,*y,*r,text,fnt); } -void mgl_textmarkw_yr(HMGL gr, const HMDT y, const HMDT r, const wchar_t *text, const char *fnt) -{ if(gr&&y&&r&&text) gr->TextMark(*y,*r,text,fnt); } -void mgl_textmarkw(HMGL gr, const HMDT y, const wchar_t *text, const char *fnt) -{ if(gr&&y&&text) gr->TextMark(*y,text,fnt); } -//----------------------------------------------------------------------------- -void mgl_textmark_xyzr_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *r, const char *text, const char *fnt, int l,int n) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - char *f=new char[n+1]; memcpy(s,fnt,n); f[n]=0; - if(gr&&y&&x&&z&&r) _GR_->TextMark(_D_(x),_D_(y),_D_(z),_D_(r),s,f); - delete []s; delete []f; -} -void mgl_textmark_xyr_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *r, const char *text, const char *fnt, int l,int n) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - char *f=new char[n+1]; memcpy(s,fnt,n); f[n]=0; - if(gr&&y&&x&&r) _GR_->TextMark(_D_(x),_D_(y),_D_(r),s,f); - delete []s; delete []f; -} -void mgl_textmark_yr_(uintptr_t *gr, uintptr_t *y, uintptr_t *r, const char *text, const char *fnt, int l,int n) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - char *f=new char[n+1]; memcpy(s,fnt,n); f[n]=0; - if(gr&&y&&r) _GR_->TextMark(_D_(y),_D_(r),s,f); - delete []s; delete []f; -} -void mgl_textmark_(uintptr_t *gr, uintptr_t *y, const char *text, const char *fnt, int l,int n) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - char *f=new char[n+1]; memcpy(s,fnt,n); f[n]=0; - if(gr&&y) _GR_->TextMark(_D_(y),s,f); - delete []s; delete []f; -} -//----------------------------------------------------------------------------- -void mgl_fplot(HMGL gr, const char *fy, const char *stl, int n) -{ if(gr) gr->Plot(fy, stl, NAN, n); } -void mgl_fplot_xyz(HMGL gr, const char *fx, const char *fy, const char *fz, const char *stl, int n) -{ if(gr) gr->Plot(fx,fy,fz,stl,n); } -//----------------------------------------------------------------------------- -void mgl_fplot_(uintptr_t *gr, const char *fy, const char *stl, int *n, int ly, int ls) -{ - char *s=new char[ly+1]; memcpy(s,fy,ly); s[ly]=0; - char *p=new char[ls+1]; memcpy(p,stl,ls); p[ls]=0; - if(gr) _GR_->Plot(s, p, NAN, *n); - delete []s; delete []p; -} -void mgl_fplot_xyz_(uintptr_t *gr, const char *fx, const char *fy, const char *fz, const char *stl, int *n, int lx, int ly, int lz, int ls) -{ - char *sx=new char[lx+1]; memcpy(sx,fx,lx); sx[lx]=0; - char *sy=new char[ly+1]; memcpy(sy,fy,ly); sy[ly]=0; - char *sz=new char[lz+1]; memcpy(sz,fz,lz); sz[lz]=0; - char *p=new char[ls+1]; memcpy(p,stl,ls); p[ls]=0; - if(gr) _GR_->Plot(sx, sy, sz, p, *n); - delete []sx; delete []sy; delete []sz; delete []p; -} -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_2d.cpp b/mgl/mgl_2d.cpp deleted file mode 100644 index f95664e..0000000 --- a/mgl/mgl_2d.cpp +++ /dev/null @@ -1,1090 +0,0 @@ -/*************************************************************************** - * mgl_2d.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "mgl/mgl.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -#include "mgl/mgl_eval.h" -//----------------------------------------------------------------------------- -// -// Plot by formulas series -// -//----------------------------------------------------------------------------- -void mglGraph::Surf(const char *eqZ, const char *sch, int n) -{ - // TODO Add strong function variation analisys ??? - if(eqZ==0 || eqZ[0]==0) return; // nothing to plot - if(n<=0) n=100; - mglData z(n,n); - mglFormula *eq = new mglFormula(eqZ); - register int i,j; - mreal dx = (Max.x - Min.x)/(n-1.), dy = (Max.y - Min.y)/(n-1.); - for(i=0;iCalc(Min.x+i*dx, Min.y+j*dy); - Surf(z, sch); - delete eq; -} -//----------------------------------------------------------------------------- -void mglGraph::Surf(const char *eqX, const char *eqY, const char *eqZ, const char *sch, int n) -{ - // TODO Add strong function variation analisys ??? - mglData x(n,n), y(n,n), z(n,n); - if(n<=0) n=100; - mglFormula *ex, *ey, *ez; - ex = new mglFormula(eqX ? eqX : "u"); - ey = new mglFormula(eqY ? eqY : "v"); - ez = new mglFormula(eqZ ? eqZ : "0"); - register int i,j; - register mreal u,v; - for(i=0;iCalc(0,v,0,u); - y.a[i+n*j] = ey->Calc(0,v,0,u); - z.a[i+n*j] = ez->Calc(0,v,0,u); - } - Surf(x,y,z,sch); - delete ex; delete ey; delete ez; -} -//----------------------------------------------------------------------------- -// -// Primitives -// -//----------------------------------------------------------------------------- -void mglGraph::Face(mglPoint p1, mglPoint p2, mglPoint p3, mglPoint p4, const char *stl, int n,mreal val) -{ - static int cgid=1; StartGroup("Face",cgid++); - register long i,j,i0; - n = (n<2) ? 2 : n; - mglColor c1('w'),c2,c3,c4; - mreal *pp = new mreal[3*n*n],u; - mreal *cc = new mreal[4*n*n],v; - bool cut = Cut; Cut = true; - - SetScheme(stl); - if(stl && *stl && NumCol) c1 = cmap[0]; - bool all = stl && strlen(stl)>4 && NumCol>4; - if(all) { c2=cmap[1]; c3=cmap[2]; c4=cmap[3]; } - else if(!isnan(val)) c1 = GetC(val); - - for(i=0;im?n:m)], *cc = new mreal[8*(n>m?n:m)]; - bool *tt = new bool[2*(n>m?n:m)]; - for(k=0;k0) - { - pp[6*j+0] = (GetX(x,i,j,k)+GetX(x,i-1,j,k))/2; - pp[6*j+1] = (GetY(y,i,j,k)+GetY(y,i-1,j,k))/2; - } - else - { - pp[6*j+0] = GetX(x,i,j,k); - pp[6*j+1] = GetY(y,i,j,k); - } - if(i0) - { - pp[6*i+0] = (GetX(x,i,j,k)+GetX(x,i,j-1,k))/2; - pp[6*i+1] = (GetY(y,i,j,k)+GetY(y,i,j-1,k))/2; - } - else - { - pp[6*i+0] = GetX(x,i,j,k); - pp[6*i+1] = GetY(y,i,j,k); - } - if(j1) zVal = Min.z+(Max.z-Min.z)*mreal(k)/(z.nz-1); - for(i=0;i1) zVal = Min.z+(Max.z-Min.z)*mreal(k)/(z.nz-1); - for(i=0;iGrid(*x, *y, *a, sch, zVal); } -/// Draw grid lines for density plot of 2d data -void mgl_grid(HMGL gr, const HMDT a,const char *sch,mreal zVal) -{ if(gr && a) gr->Grid(*a, sch, zVal); } -/// Draw mesh lines for 2d data specified parametrically -void mgl_mesh_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT a, const char *sch) -{ if(gr && a && x && y) gr->Mesh(*x, *y, *a, sch); } -/// Draw mesh lines for 2d data -void mgl_mesh(HMGL gr, const HMDT a, const char *sch) -{ if(gr && a) gr->Mesh(*a, sch); } -/// Draw fall lines for 2d data specified parametrically -void mgl_fall_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT a, const char *sch) -{ if(gr && a && x && y) gr->Fall(*x, *y, *a, sch); } -/// Draw fall lines for 2d data -void mgl_fall(HMGL gr, const HMDT a, const char *sch) -{ if(gr && a) gr->Fall(*a, sch); } -/// Draw belt lines for 2d data specified parametrically -void mgl_belt_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT a, const char *sch) -{ if(gr && a && x && y) gr->Belt(*x, *y, *a, sch); } -/// Draw belt lines for 2d data -void mgl_belt(HMGL gr, const HMDT a, const char *sch) -{ if(gr && a) gr->Belt(*a, sch); } -/// Draw surface for 2d data specified parametrically -void mgl_surf_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT a, const char *sch) -{ if(gr && a && x && y) gr->Surf(*x, *y, *a, sch); } -/// Draw surface for 2d data -void mgl_surf(HMGL gr, const HMDT a, const char *sch) -{ if(gr && a) gr->Surf(*a, sch); } -/// Draw density plot for surface specified parametrically -void mgl_dens_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT a, const char *sch,mreal zVal) -{ if(gr && a && x && y) gr->Dens(*x, *y, *a, sch, zVal); } -/// Draw density plot for 2d data -void mgl_dens(HMGL gr, const HMDT a, const char *sch,mreal zVal) -{ if(gr && a) gr->Dens(*a, sch, zVal); } -/// Draw vertical boxes for 2d data specified parametrically -void mgl_boxs_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT a, const char *sch,mreal zVal) -{ if(gr && a && x && y) gr->Boxs(*x, *y, *a, sch,zVal); } -/// Draw vertical boxes for 2d data -void mgl_boxs(HMGL gr, const HMDT a, const char *sch,mreal zVal) -{ if(gr && a) gr->Boxs(*a, sch,zVal); } -/// Draw tiles for 2d data specified parametrically -void mgl_tile_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT a, const char *sch) -{ if(gr && a && x && y) gr->Tile(*x, *y, *a, sch); } -/// Draw mesh lines for 2d data -void mgl_tile(HMGL gr, const HMDT a, const char *sch) -{ if(gr && a) gr->Tile(*a, sch); } -/// Draw variable-size tiles for 2d data specified parametrically -void mgl_tiles_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT a, const HMDT r, const char *sch) -{ if(gr && a && x && y && r) gr->TileS(*x, *y, *a, *r, sch); } -/// Draw variable-size mesh lines for 2d data -void mgl_tiles(HMGL gr, const HMDT a, const HMDT r, const char *sch) -{ if(gr && a && r) gr->TileS(*a, *r, sch); } -//----------------------------------------------------------------------------- -/// Draw surface specified parametrically with coloring by other matrix -void mgl_surfc_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *sch) -{ if(gr && a && z && x && y) gr->SurfC(*x, *y, *z, *a, sch); } -/// Draw surface specified by matrix with coloring by other matrix -void mgl_surfc(HMGL gr, const HMDT z, const HMDT a, const char *sch) -{ if(gr && a && z) gr->SurfC(*z, *a, sch); } -/// Draw surface specified parametrically which transparency is determined by other matrix -void mgl_surfa_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *sch) -{ if(gr && a && z && x && y) gr->SurfA(*x, *y, *z, *a, sch); } -/// Draw surface specified by matrix which transparency is determined by other matrix -void mgl_surfa(HMGL gr, const HMDT z, const HMDT a, const char *sch) -{ if(gr && a && z) gr->SurfA(*z, *a, sch); } -/// Draw spectrogram for data specified parametrically which transparency is determined by other matrix -void mgl_stfa_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT re, const HMDT im, int dn, const char *sch, mreal zval) -{ if(gr && re && im && x && y) gr->STFA(*x, *y, *re, *im, dn, sch, zval); } -/// Draw spectrogram for data specified by matrix which transparency is determined by other matrix -void mgl_stfa(HMGL gr, const HMDT re, const HMDT im, int dn, const char *sch, mreal zval) -{ if(gr && re && im) gr->STFA(*re, *im, dn, sch, zval); } -//----------------------------------------------------------------------------- -// 2D plotting functions (Fortran) -//----------------------------------------------------------------------------- -/// Draw grid lines for density plot of 2d data specified parametrically -void mgl_grid_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch,mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y) _GR_->Grid(_D_(x), _D_(y), _D_(a), s, *zVal); - delete []s; -} -/// Draw grid lines for density plot of 2d data -void mgl_grid_(uintptr_t *gr, uintptr_t *a,const char *sch,mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Grid(_D_(a), s, *zVal); - delete []s; -} -/// Draw mesh lines for 2d data specified parametrically -void mgl_mesh_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y) _GR_->Mesh(_D_(x), _D_(y), _D_(a), s); - delete []s; -} -/// Draw mesh lines for 2d data -void mgl_mesh_(uintptr_t *gr, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Mesh(_D_(a), s); - delete []s; -} -/// Draw fall lines for 2d data specified parametrically -void mgl_fall_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y) _GR_->Fall(_D_(x), _D_(y), _D_(a), s); - delete []s; -} -/// Draw fall lines for 2d data -void mgl_fall_(uintptr_t *gr, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Fall(_D_(a), s); - delete []s; -} -/// Draw belt lines for 2d data specified parametrically -void mgl_belt_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y) _GR_->Belt(_D_(x), _D_(y), _D_(a), s); - delete []s; -} -/// Draw belt lines for 2d data -void mgl_belt_(uintptr_t *gr, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Belt(_D_(a), s); - delete []s; -} -/// Draw surface for 2d data specified parametrically -void mgl_surf_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y) _GR_->Surf(_D_(x), _D_(y), _D_(a), s); - delete []s; -} -/// Draw surface for 2d data -void mgl_surf_(uintptr_t *gr, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Surf(_D_(a), s); - delete []s; -} -/// Draw density plot for surface specified parametrically -void mgl_dens_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch,mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y) _GR_->Dens(_D_(x), _D_(y), _D_(a), s, *zVal); - delete []s; -} -/// Draw density plot for 2d data -void mgl_dens_(uintptr_t *gr, uintptr_t *a, const char *sch,mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Dens(_D_(a), s, *zVal); - delete []s; -} -/// Draw vertical boxes for 2d data specified parametrically -void mgl_boxs_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch,mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y) _GR_->Boxs(_D_(x), _D_(y), _D_(a), s,*zVal); - delete []s; -} -/// Draw vertical boxes for 2d data -void mgl_boxs_(uintptr_t *gr, uintptr_t *a, const char *sch,mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Boxs(_D_(a), s,*zVal); - delete []s; -} -/// Draw tiles for 2d data specified parametrically -void mgl_tile_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y) _GR_->Tile(_D_(x), _D_(y), _D_(a), s); - delete []s; -} -/// Draw mesh lines for 2d data -void mgl_tile_(uintptr_t *gr, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Tile(_D_(a), s); - delete []s; -} -/// Draw tiles for 2d data specified parametrically -void mgl_tiles_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, uintptr_t *r, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && r) - _GR_->TileS(_D_(x), _D_(y), _D_(a), _D_(r), s); - delete []s; -} -/// Draw mesh lines for 2d data -void mgl_tiles_(uintptr_t *gr, uintptr_t *a, uintptr_t *r, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && r) _GR_->TileS(_D_(a), _D_(r), s); - delete []s; -} -//----------------------------------------------------------------------------- -/// Draw surface specified parametrically with coloring by other matrix -void mgl_surfc_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && z && x && y) _GR_->SurfC(_D_(x), _D_(y), _D_(z), _D_(a), s); - delete []s; -} -/// Draw surface specified by matrix with coloring by other matrix -void mgl_surfc_(uintptr_t *gr, uintptr_t *z, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && z) _GR_->SurfC(_D_(z), _D_(a), s); - delete []s; -} -/// Draw surface specified parametrically which transparency is determined by other matrix -void mgl_surfa_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && z && x && y) _GR_->SurfA(_D_(x), _D_(y), _D_(z), _D_(a), s); - delete []s; -} -/// Draw surface specified by matrix which transparency is determined by other matrix -void mgl_surfa_(uintptr_t *gr, uintptr_t *z, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && z) _GR_->SurfA(_D_(z), _D_(a), s); - delete []s; -} -/// Draw spectrogram for data specified parametrically which transparency is determined by other matrix -void mgl_stfa_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *re, uintptr_t *im, int *dn, const char *sch, mreal *zVal, int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && re && im && x && y) - _GR_->STFA(_D_(x), _D_(y), _D_(re), _D_(im), *dn, s, *zVal); - delete []s; -} -/// Draw spectrogram for data specified by matrix which transparency is determined by other matrix -void mgl_stfa_(uintptr_t *gr, uintptr_t *re, uintptr_t *im, int *dn, const char *sch, mreal *zVal, int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && re && im) _GR_->STFA(_D_(re), _D_(im), *dn, s, *zVal); - delete []s; -} -//----------------------------------------------------------------------------- -void mgl_fsurf(HMGL gr, const char *fy, const char *stl, int n) -{ if(gr) gr->Surf(fy, stl, n); } -void mgl_fsurf_xyz(HMGL gr, const char *fx, const char *fy, const char *fz, const char *stl, int n) -{ if(gr) gr->Surf(fx,fy,fz,stl,n); } -//----------------------------------------------------------------------------- -void mgl_fsurf_(uintptr_t *gr, const char *fy, const char *stl, int *n, int ly, int ls) -{ - char *s=new char[ly+1]; memcpy(s,fy,ly); s[ly]=0; - char *p=new char[ls+1]; memcpy(p,stl,ls); p[ls]=0; - if(gr) _GR_->Surf(s, p, *n); - delete []s; delete []p; -} -void mgl_fsurf_xyz_(uintptr_t *gr, const char *fx, const char *fy, const char *fz, const char *stl, int *n, int lx, int ly, int lz, int ls) -{ - char *sx=new char[lx+1]; memcpy(sx,fx,lx); sx[lx]=0; - char *sy=new char[ly+1]; memcpy(sy,fy,ly); sy[ly]=0; - char *sz=new char[lz+1]; memcpy(sz,fz,lz); sz[lz]=0; - char *p=new char[ls+1]; memcpy(p,stl,ls); p[ls]=0; - if(gr) _GR_->Plot(sx, sy, sz, p, *n); - delete []sx; delete []sy; delete []sz; delete []p; -} -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_3d.cpp b/mgl/mgl_3d.cpp deleted file mode 100644 index 32c9816..0000000 --- a/mgl/mgl_3d.cpp +++ /dev/null @@ -1,1001 +0,0 @@ -/*************************************************************************** - * mgl_3d.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 "mgl/mgl.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -//----------------------------------------------------------------------------- -// -// CloudQ series -// -//----------------------------------------------------------------------------- -void mglGraph::Cloud(const mglData &x, const mglData &y, const mglData &z, const mglData &a, - const char *sch, mreal alpha) -{ - long i,j,k,n=a.nx,m=a.ny,l=a.nz; - register int i0,i1; - if(n<2 || m<2 || l<2) { SetWarn(mglWarnLow,"CloudQ"); return; } - bool both = x.nx*x.ny*x.nz==n*m*l && y.nx*y.ny*y.nz==n*m*l && z.nx*z.ny*z.nz==n*m*l; - if(!(both || (x.nx==n && y.nx==m && z.nx==l))) - { SetWarn(mglWarnDim); return; } - static int cgid=1; StartGroup("CloudQ",cgid++); - - int tx=1,ty=1,tz=1; - if(MeshNum>1) - { tx=(n-1)/(MeshNum-1); ty=(m-1)/(MeshNum-1); tz=(l-1)/(MeshNum-1);} - if(tx<1) tx=1; if(ty<1) ty=1; if(tz<1) tz=1; - - if(alpha<0) alpha = AlphaDef; - if(sch && strchr(sch,'-')) alpha = -alpha; - alpha /= pow(n/tx*m/ty*l/tz,1./3)/CloudFactor/5; - if(alpha>1) alpha = 1; - SetScheme(sch); - mreal *pp = new mreal[3*n*m*l]; - if(!pp) { SetWarn(mglWarnMem); return; } - mreal *aa = new mreal[n*m*l]; - - // x, y -- ìàòðèöû êàê è z - if(both) for(i=0;i=pMax) - { - pMax += 100; - *p = (mreal *)realloc(*p,3*pMax*sizeof(mreal)); - *n = (mreal *)realloc(*n,3*pMax*sizeof(mreal)); - *k = (mreal *)realloc(*k,3*pMax*sizeof(mreal)); - *b = (mreal *)realloc(*b,4*pMax*sizeof(mreal)); - } - return pc-1; -} -//----------------------------------------------------------------------------- -void normal_3d(const mglData &a,mreal x,mreal y,mreal z,mreal *nx,mreal *ny, - mreal *nz,bool inv) -{ - long n=a.nx, m=a.ny, l=a.nz, o=n*m; - register long i,j,k,i0; -// i=x=n-2) *nx = a.a[i] - a.a[i-1]; - else *nx = ((a.a[i+1] - a.a[i-1])*(i+1-x) + (a.a[i+2] - a.a[i])*(x-i))/2; - if(!inv) *nx = -*nx; - if(*nx==0) *nx=1; -} -//----------------------------------------------------------------------------- -void mglGraph::Surf3(mreal val, const mglData &x, const mglData &y, const mglData &z, const mglData &a, - const char *sch) -{ - long i,j,k,i0,i1,n=a.nx,m=a.ny,l=a.nz; - long *kx1,*kx2,*ky1,*ky2,*kz,pc; - bool both, wire = sch && strchr(sch,'#'); - mreal *pp=0,*cc=0,*kk=0,*nn=0; - mreal d,xx,yy,zz,nx,ny,nz,dx,dy,dz,tx,ty,tz; - if(n<2 || m<2 || l<2) { SetWarn(mglWarnLow,"Surf3"); return; } - both = x.nx*x.ny*x.nz==n*m*l && y.nx*y.ny*y.nz==n*m*l && z.nx*z.ny*z.nz==n*m*l; - if(!(both || (x.nx==n && y.nx==m && z.nx==l))) - { SetWarn(mglWarnDim,"Surf3"); return; } - static int cgid=1; StartGroup("Surf3",cgid++); - - bool inv = (sch && strchr(sch,'-')); - SetScheme(sch); - kx1 = new long[n*m]; kx2 = new long[n*m]; - ky1 = new long[n*m]; ky2 = new long[n*m]; - kz = new long[n*m]; - Pal[100]=GetC(val); -// DefColor(c,AlphaDef); - - for(k=0;k=0 && d<1) - { - xx = both ? x.a[i0]*(1.-d)+x.a[i0+1]*d : x.a[i]*(1.-d)+x.a[i+1]*d; - yy = both ? y.a[i0]*(1.-d)+y.a[i0+1]*d : y.a[j]; - zz = both ? z.a[i0]*(1.-d)+z.a[i0+1]*d : z.a[k]; - normal_3d(a,i+d,j,k,&dx,&dy,&dz,inv); - if(both) - { - normal_3d(x,i+d,j,k,&tx,&ty,&tz,true); - nx = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(y,i+d,j,k,&tx,&ty,&tz,true); - ny = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(z,i+d,j,k,&tx,&ty,&tz,true); - nz = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - } - else - { - normal_1d(x,i+d,&tx,true); nx = dx/tx; - normal_1d(y,j,&ty,true); ny = dy/ty; - normal_1d(z,k,&tz,true); nz = dz/tz; - } - kx2[i1] = add_spoint(pc,&pp,&kk,&cc,&nn,xx,yy,zz,nx,ny,nz, - i+d,j,k,Transparent ? AlphaDef : 1); - } - } - if(j=0 && d<1) - { - xx = both ? x.a[i0]*(1.-d)+x.a[i0+n]*d : x.a[i]; - yy = both ? y.a[i0]*(1.-d)+y.a[i0+n]*d : y.a[j]*(1.-d)+y.a[j+1]*d; - zz = both ? z.a[i0]*(1.-d)+z.a[i0+n]*d : z.a[k]; - normal_3d(a,i,j+d,k,&dx,&dy,&dz,inv); - if(both) - { - normal_3d(x,i,j+d,k,&tx,&ty,&tz,true); - nx = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(y,i,j+d,k,&tx,&ty,&tz,true); - ny = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(z,i,j+d,k,&tx,&ty,&tz,true); - nz = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - } - else - { - normal_1d(x,i,&tx,true); nx = dx/tx; - normal_1d(y,j+d,&ty,true); ny = dy/ty; - normal_1d(z,k,&tz,true); nz = dz/tz; - } - ky2[i1] = add_spoint(pc,&pp,&kk,&cc,&nn,xx,yy,zz,nx,ny,nz, - i,j+d,k,Transparent ? AlphaDef : 1); - } - } - if(k>0) - { - d = _d(val,a.a[i0-n*m],a.a[i0]); - if(d>=0 && d<1) - { - xx = both ? x.a[i0-n*m]*(1.-d)+x.a[i0]*d : x.a[i]; - yy = both ? y.a[i0-n*m]*(1.-d)+y.a[i0]*d : y.a[j]; - zz = both ? z.a[i0-n*m]*(1.-d)+z.a[i0]*d : z.a[k-1]*(1.-d)+z.a[k]*d; - normal_3d(a,i,j,k+d-1,&dx,&dy,&dz,inv); - if(both) - { - normal_3d(x,i,j,k+d-1,&tx,&ty,&tz,true); - nx = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(y,i,j,k+d-1,&tx,&ty,&tz,true); - ny = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(z,i,j,k+d-1,&tx,&ty,&tz,true); - nz = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - } - else - { - normal_1d(x,i,&tx,true); nx = dx/tx; - normal_1d(y,j,&ty,true); ny = dy/ty; - normal_1d(z,k+d-1,&tz,true); nz = dz/tz; - } - kz[i1] = add_spoint(pc,&pp,&kk,&cc,&nn,xx,yy,zz,nx,ny,nz, - i,j,k+d-1,Transparent ? AlphaDef : 1); - } - } - } - if(k>0) surf3_plot(n,m,kx1,kx2,ky1,ky2,kz,pp,cc,kk,nn,wire); - } - EndGroup(); - delete []kx1; delete []kx2; delete []ky1; delete []ky2; delete []kz; - if(pp) { free(pp); free(kk); free(cc); free(nn); } -} -//----------------------------------------------------------------------------- -void mglGraph::Surf3(mreal val, const mglData &a, const char *sch) -{ - if(a.nx<2 || a.ny<2 || a.nz<2) { SetWarn(mglWarnLow,"Surf3"); return; } - mglData x(a.nx), y(a.ny),z(a.nz); - x.Fill(Min.x,Max.x); - y.Fill(Min.y,Max.y); - z.Fill(Min.z,Max.z); - Surf3(val,x,y,z,a,sch); -} -//----------------------------------------------------------------------------- -void mglGraph::Surf3(const mglData &x, const mglData &y, const mglData &z, const mglData &a, - const char *stl, int num) -{ - mreal v; - num = num<=0 ? 1 : num; - for(long i=0;i=0 && d<1) - { - xx = both ? x.a[i0]*(1.-d)+x.a[i0+1]*d : x.a[i]*(1.-d)+x.a[i+1]*d; - yy = both ? y.a[i0]*(1.-d)+y.a[i0+1]*d : y.a[j]; - zz = both ? z.a[i0]*(1.-d)+z.a[i0+1]*d : z.a[k]; - alpha = b.a[i0]*(1.-d)+b.a[i0+1]*d; - normal_3d(a,i+d,j,k,&dx,&dy,&dz,inv); - if(both) - { - normal_3d(x,i+d,j,k,&tx,&ty,&tz,true); - nx = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(y,i+d,j,k,&tx,&ty,&tz,true); - ny = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(z,i+d,j,k,&tx,&ty,&tz,true); - nz = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - } - else - { - normal_1d(x,i+d,&tx,true); nx = dx/tx; - normal_1d(y,j,&ty,true); ny = dy/ty; - normal_1d(z,k,&tz,true); nz = dz/tz; - } - kx2[i1] = add_spoint(pc,&pp,&kk,&cc,&nn,xx,yy,zz,nx,ny,nz, - i+d,j,k,(GetA(alpha)+1)*(GetA(alpha)+1)/4); - } - } - if(j=0 && d<1) - { - xx = both ? x.a[i0]*(1.-d)+x.a[i0+n]*d : x.a[i]; - yy = both ? y.a[i0]*(1.-d)+y.a[i0+n]*d : y.a[j]*(1.-d)+y.a[j+1]*d; - zz = both ? z.a[i0]*(1.-d)+z.a[i0+n]*d : z.a[k]; - alpha = b.a[i0]*(1.-d)+b.a[i0+n]*d; - normal_3d(a,i,j+d,k,&dx,&dy,&dz,inv); - if(both) - { - normal_3d(x,i,j+d,k,&tx,&ty,&tz,true); - nx = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(y,i,j+d,k,&tx,&ty,&tz,true); - ny = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(z,i,j+d,k,&tx,&ty,&tz,true); - nz = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - } - else - { - normal_1d(x,i,&tx,true); nx = dx/tx; - normal_1d(y,j+d,&ty,true); ny = dy/ty; - normal_1d(z,k,&tz,true); nz = dz/tz; - } - ky2[i1] = add_spoint(pc,&pp,&kk,&cc,&nn,xx,yy,zz,nx,ny,nz, - i,j+d,k,(GetA(alpha)+1)*(GetA(alpha)+1)/4); - } - } - if(k>0) - { - d = _d(val,a.a[i0-n*m],a.a[i0]); - if(d>=0 && d<1) - { - xx = both ? x.a[i0-n*m]*(1.-d)+x.a[i0]*d : x.a[i]; - yy = both ? y.a[i0-n*m]*(1.-d)+y.a[i0]*d : y.a[j]; - zz = both ? z.a[i0-n*m]*(1.-d)+z.a[i0]*d : z.a[k-1]*(1.-d)+z.a[k]*d; - alpha = b.a[i0-n*m]*(1.-d)+b.a[i0]*d; - normal_3d(a,i,j,k+d-1,&dx,&dy,&dz,inv); - if(both) - { - normal_3d(x,i,j,k+d-1,&tx,&ty,&tz,true); - nx = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(y,i,j,k+d-1,&tx,&ty,&tz,true); - ny = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(z,i,j,k+d-1,&tx,&ty,&tz,true); - nz = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - } - else - { - normal_1d(x,i,&tx,true); nx = dx/tx; - normal_1d(y,j,&ty,true); ny = dy/ty; - normal_1d(z,k+d-1,&tz,true); nz = dz/tz; - } - kz[i1] = add_spoint(pc,&pp,&kk,&cc,&nn,xx,yy,zz,nx,ny,nz, - i,j,k+d-1,(GetA(alpha)+1)*(GetA(alpha)+1)/4); - } - } - } - if(k>0) surf3_plot(n,m,kx1,kx2,ky1,ky2,kz,pp,cc,kk,nn,wire); - } - EndGroup(); - delete []kx1; delete []kx2; delete []ky1; delete []ky2; delete []kz; - if(pp) { free(pp); free(kk); free(cc); free(nn); } -} -//----------------------------------------------------------------------------- -void mglGraph::Surf3A(mreal val, const mglData &a, const mglData &b, const char *sch) -{ - if(a.nx<2 || a.ny<2 || a.nz<2) { SetWarn(mglWarnLow,"Surf3A"); return; } - mglData x(a.nx), y(a.ny),z(a.nz); - x.Fill(Min.x,Max.x); - y.Fill(Min.y,Max.y); - z.Fill(Min.z,Max.z); - Surf3A(val,x,y,z,a,b,sch); -} -//----------------------------------------------------------------------------- -void mglGraph::Surf3A(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &b, - const char *stl, int num) -{ - mreal v; - num = num<=0 ? 1 : num; - for(long i=0;i=0 && d<1) - { - xx = both ? x.a[i0]*(1.-d)+x.a[i0+1]*d : x.a[i]*(1.-d)+x.a[i+1]*d; - yy = both ? y.a[i0]*(1.-d)+y.a[i0+1]*d : y.a[j]; - zz = both ? z.a[i0]*(1.-d)+z.a[i0+1]*d : z.a[k]; - alpha = b.a[i0]*(1.-d)+b.a[i0+1]*d; - normal_3d(a,i+d,j,k,&dx,&dy,&dz,inv); - if(both) - { - normal_3d(x,i+d,j,k,&tx,&ty,&tz,true); - nx = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(y,i+d,j,k,&tx,&ty,&tz,true); - ny = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(z,i+d,j,k,&tx,&ty,&tz,true); - nz = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - } - else - { - normal_1d(x,i+d,&tx,true); nx = dx/tx; - normal_1d(y,j,&ty,true); ny = dy/ty; - normal_1d(z,k,&tz,true); nz = dz/tz; - } - Pal[100]=GetC(alpha); - kx2[i1] = add_spoint(pc,&pp,&kk,&cc,&nn,xx,yy,zz,nx,ny,nz, - i+d,j,k,Transparent ? AlphaDef : 1); - } - } - if(j=0 && d<1) - { - xx = both ? x.a[i0]*(1.-d)+x.a[i0+n]*d : x.a[i]; - yy = both ? y.a[i0]*(1.-d)+y.a[i0+n]*d : y.a[j]*(1.-d)+y.a[j+1]*d; - zz = both ? z.a[i0]*(1.-d)+z.a[i0+n]*d : z.a[k]; - alpha = b.a[i0]*(1.-d)+b.a[i0+n]*d; - normal_3d(a,i,j+d,k,&dx,&dy,&dz,inv); - if(both) - { - normal_3d(x,i,j+d,k,&tx,&ty,&tz,true); - nx = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(y,i,j+d,k,&tx,&ty,&tz,true); - ny = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(z,i,j+d,k,&tx,&ty,&tz,true); - nz = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - } - else - { - normal_1d(x,i,&tx,true); nx = dx/tx; - normal_1d(y,j+d,&ty,true); ny = dy/ty; - normal_1d(z,k,&tz,true); nz = dz/tz; - } - Pal[100]=GetC(alpha); - ky2[i1] = add_spoint(pc,&pp,&kk,&cc,&nn,xx,yy,zz,nx,ny,nz, - i,j+d,k,Transparent ? AlphaDef : 1); - } - } - if(k>0) - { - d = _d(val,a.a[i0-n*m],a.a[i0]); - if(d>=0 && d<1) - { - xx = both ? x.a[i0-n*m]*(1.-d)+x.a[i0]*d : x.a[i]; - yy = both ? y.a[i0-n*m]*(1.-d)+y.a[i0]*d : y.a[j]; - zz = both ? z.a[i0-n*m]*(1.-d)+z.a[i0]*d : z.a[k-1]*(1.-d)+z.a[k]*d; - alpha = b.a[i0-n*m]*(1.-d)+b.a[i0]*d; - normal_3d(a,i,j,k+d-1,&dx,&dy,&dz,inv); - if(both) - { - normal_3d(x,i,j,k+d-1,&tx,&ty,&tz,true); - nx = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(y,i,j,k+d-1,&tx,&ty,&tz,true); - ny = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - normal_3d(z,i,j,k+d-1,&tx,&ty,&tz,true); - nz = (dx*tx+dy*ty+dz*tz)/(tx*tx+ty*ty+tz*tz); - } - else - { - normal_1d(x,i,&tx,true); nx = dx/tx; - normal_1d(y,j,&ty,true); ny = dy/ty; - normal_1d(z,k+d-1,&tz,true); nz = dz/tz; - } - Pal[100]=GetC(alpha); - kz[i1] = add_spoint(pc,&pp,&kk,&cc,&nn,xx,yy,zz,nx,ny,nz, - i,j,k+d-1,Transparent ? AlphaDef : 1); - } - } - } - if(k>0) surf3_plot(n,m,kx1,kx2,ky1,ky2,kz,pp,cc,kk,nn,wire); - } - EndGroup(); - delete []kx1; delete []kx2; delete []ky1; delete []ky2; delete []kz; - if(pp) { free(pp); free(kk); free(cc); free(nn); } -} -//----------------------------------------------------------------------------- -void mglGraph::Surf3C(mreal val, const mglData &a, const mglData &b, const char *sch) -{ - if(a.nx<2 || a.ny<2 || a.nz<2) { SetWarn(mglWarnLow,"Surf3C"); return; } - mglData x(a.nx), y(a.ny),z(a.nz); - x.Fill(Min.x,Max.x); - y.Fill(Min.y,Max.y); - z.Fill(Min.z,Max.z); - Surf3C(val,x,y,z,a,b,sch); -} -//----------------------------------------------------------------------------- -void mglGraph::Surf3C(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &b, - const char *stl, int num) -{ - mreal v; - num = num<=0 ? 1 : num; - for(long i=0;ia.a[j+m*l*i] ? amax : a.a[j+m*l*i]; - } - if(amax==0) { asum=0; amax=1; } - for(j=0;j0 ? (a+1)*(a+1)/4 : -(a-1)*(a-1)/4; -// a = alpha>0 ? (a+1)/2 : (a-1)/2; - if(a) Ball(x,y,z,c,-alpha*a); -} -//----------------------------------------------------------------------------- -void mglGraph::CloudP(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *sch, mreal alpha, bool rnd) -{ - register long i,j,k,n=a.nx,m=a.ny,l=a.nz; - if(n<2 || m<2 || l<2) { SetWarn(mglWarnLow,"CloudP"); return; } - bool both = x.nx*x.ny*x.nz==n*m*l && y.nx*y.ny*y.nz==n*m*l && z.nx*z.ny*z.nz==n*m*l; - if(!(both || (x.nx==n && y.nx==m && z.nx==l))) - { SetWarn(mglWarnDim,"CloudP"); return; } - static int cgid=1; StartGroup("CloudP",cgid++); - - if(alpha<0) alpha = AlphaDef; - if(sch && strchr(sch,'-')) alpha = -alpha; - SetScheme(sch); - alpha /= pow(n*m*l,1./3)/CloudFactor/15; - if(alpha>1) alpha = 1; - - // x, y -- ìàòðèöû êàê è z - bool al=Alpha(true); - register mreal xx,yy,zz,aa; - if(both) - { - for(i=0;iSurf3(Val, *x, *y, *z, *a, sch); } -/// Draw isosurface for 3d data -void mgl_surf3_val(HMGL gr, mreal Val, const HMDT a, const char *sch) -{ if(gr && a) gr->Surf3(Val, *a, sch); } -/// Draw several isosurface for 3d data specified parametrically -void mgl_surf3_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *sch, int num) -{ if(gr && a && x && y && z) gr->Surf3(*x, *y, *z, *a, sch, num); } -/// Draw several isosurface for 3d data -void mgl_surf3(HMGL gr, const HMDT a, const char *sch, int num) -{ if(gr && a) gr->Surf3(*a, sch, num); } -/// Draw a cloud of points for 3d data specified parametrically -void mgl_cloudp_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, - const char *sch, mreal alpha) -{ if(gr && a && x && y && z) gr->CloudP(*x, *y, *z, *a, sch, alpha); } -/// Draw a cloud of points for 3d data -void mgl_cloudp(HMGL gr, const HMDT a, const char *sch, mreal alpha) -{ if(gr && a) gr->CloudP(*a, sch, alpha); } -/// Draw a semi-transparent cloud for 3d data specified parametrically -void mgl_cloud_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, - const char *sch, mreal alpha) -{ if(gr && a && x && y && z) gr->Cloud(*x, *y, *z, *a, sch, alpha); } -/// Draw a semi-transparent cloud for 3d data -void mgl_cloud(HMGL gr, const HMDT a, const char *sch, mreal alpha) -{ if(gr && a) gr->Cloud(*a, sch, alpha); } -//----------------------------------------------------------------------------- -/// Draw isosurface for 3d data \a a specified parametrically with alpha proportional to \a b -void mgl_surf3a_xyz_val(HMGL gr, mreal Val, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT b, const char *sch) -{ if(gr && a && b && z && x && y) gr->Surf3A(Val, *x, *y, *z, *a, *b, sch); } -/// Draw isosurface for 3d data \a a with alpha proportional to \a b -void mgl_surf3a_val(HMGL gr, mreal Val, const HMDT a, const HMDT b, const char *sch) -{ if(gr && a && b) gr->Surf3A(Val, *a, *b, sch); } -/// Draw several isosurface for 3d data \a a specified parametrically with alpha proportional to \a b -void mgl_surf3a_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT b, const char *sch, int num) -{ if(gr && a && b && z && x && y) gr->Surf3A(*x, *y, *z, *a, *b, sch, num); } -/// Draw several isosurface for 3d data \a a with alpha proportional to \a b -void mgl_surf3a(HMGL gr, const HMDT a, const HMDT b, const char *sch, int num) -{ if(gr && a && b) gr->Surf3A(*a, *b, sch, num); } -/// Draw isosurface for 3d data \a a specified parametrically with color proportional to \a b -void mgl_surf3c_xyz_val(HMGL gr, mreal Val, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT b, const char *sch) -{ if(gr && a && b && z && x && y) gr->Surf3C(Val, *x, *y, *z, *a, *b, sch); } -/// Draw isosurface for 3d data \a a with color proportional to \a b -void mgl_surf3c_val(HMGL gr, mreal Val, const HMDT a, const HMDT b, const char *sch) -{ if(gr && a && b) gr->Surf3C(Val, *a, *b, sch); } -/// Draw several isosurface for 3d data \a a specified parametrically with color proportional to \a b -void mgl_surf3c_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT b, const char *sch, int num) -{ if(gr && a && b && z && x && y) gr->Surf3C(*x, *y, *z, *a, *b, sch, num); } -/// Draw several isosurface for 3d data \a a with color proportional to \a b -void mgl_surf3c(HMGL gr, const HMDT a, const HMDT b, const char *sch, int num) -{ if(gr && a && b) gr->Surf3C(*a, *b, sch, num); } -/// Draw isosurface for 3d beam in curvilinear coordinates -void mgl_beam_val(HMGL gr, mreal val, const HMDT tr, const HMDT g1, const HMDT g2, const HMDT a, mreal r, const char *stl, int norm) -{ if(gr && tr && g1 && g2 && a) gr->Beam(val,*tr,*g1,*g2,*a,r,stl,norm); } -/// Draw several isosurfaces for 3d beam in curvilinear coordinates -void mgl_beam(HMGL gr, const HMDT tr, const HMDT g1, const HMDT g2, const HMDT a, mreal r, - const char *stl, int norm, int num) -{ if(gr && tr && g1 && g2 && a) gr->Beam(*tr,*g1,*g2,*a,r,stl,norm,num); } -//----------------------------------------------------------------------------- -// 3D plotting functions (Fortran) -//----------------------------------------------------------------------------- -/// Draw isosurface for 3d data specified parametrically -void mgl_surf3_xyz_val_(uintptr_t *gr, mreal *Val, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && z) _GR_->Surf3(*Val, _D_(x), _D_(y), _D_(z), _D_(a), s); - delete []s; -} -/// Draw isosurface for 3d data -void mgl_surf3_val_(uintptr_t *gr, mreal *Val, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Surf3(*Val, _D_(a), s); - delete []s; -} -/// Draw several isosurface for 3d data specified parametrically -void mgl_surf3_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch, int *num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && z) _GR_->Surf3(_D_(x), _D_(y), _D_(z), _D_(a), s, *num); - delete []s; -} -/// Draw several isosurface for 3d data -void mgl_surf3_(uintptr_t *gr, uintptr_t *a, const char *sch, int *num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Surf3(_D_(a), s, *num); - delete []s; -} -/// Draw a cloud of points for 3d data specified parametrically -void mgl_cloudp_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, - const char *sch, mreal *alpha,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && z) _GR_->CloudP(_D_(x), _D_(y), _D_(z), _D_(a), s, *alpha); - delete []s; -} -/// Draw a cloud of points for 3d data -void mgl_cloudp_(uintptr_t *gr, uintptr_t *a, const char *sch, mreal *alpha,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->CloudP(_D_(a), s, *alpha); - delete []s; -} -/// Draw a semi-transparent cloud for 3d data specified parametrically -void mgl_cloud_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, - const char *sch, mreal *alpha,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && z) _GR_->Cloud(_D_(x), _D_(y), _D_(z), _D_(a), s, *alpha); - delete []s; -} -/// Draw a semi-transparent cloud for 3d data -void mgl_cloud_(uintptr_t *gr, uintptr_t *a, const char *sch, mreal *alpha,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Cloud(_D_(a), s, *alpha); - delete []s; -} -//----------------------------------------------------------------------------- -/// Draw isosurface for 3d data \a a specified parametrically with alpha proportional to \a b -void mgl_surf3a_xyz_val_(uintptr_t *gr, mreal *Val, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, - const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && b && z && x && y) _GR_->Surf3A(*Val, _D_(x), _D_(y), _D_(z), _D_(a), _D_(b), s); - delete []s; -} -/// Draw isosurface for 3d data \a a with alpha proportional to \a b -void mgl_surf3a_val_(uintptr_t *gr, mreal *Val, uintptr_t *a, uintptr_t *b, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && b) _GR_->Surf3A(*Val, _D_(a), _D_(b), s); - delete []s; -} -/// Draw several isosurface for 3d data \a a specified parametrically with alpha proportional to \a b -void mgl_surf3a_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, - const char *sch, int *num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && b && z && x && y) _GR_->Surf3A(_D_(x), _D_(y), _D_(z), _D_(a), _D_(b), s, *num); - delete []s; -} -/// Draw several isosurface for 3d data \a a with alpha proportional to \a b -void mgl_surf3a_(uintptr_t *gr, uintptr_t *a, uintptr_t *b, const char *sch, int *num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && b) _GR_->Surf3A(_D_(a), _D_(b), s, *num); - delete []s; -} -/// Draw isosurface for 3d data \a a specified parametrically with color proportional to \a b -void mgl_surf3c_xyz_val_(uintptr_t *gr, mreal *Val, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, - const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && b && z && x && y) _GR_->Surf3C(*Val, _D_(x), _D_(y), _D_(z), _D_(a), _D_(b), s); - delete []s; -} -/// Draw isosurface for 3d data \a a with color proportional to \a b -void mgl_surf3c_val_(uintptr_t *gr, mreal *Val, uintptr_t *a, uintptr_t *b, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && b) _GR_->Surf3C(*Val, _D_(a), _D_(b), s); - delete []s; -} -/// Draw several isosurface for 3d data \a a specified parametrically with color proportional to \a b -void mgl_surf3c_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, - const char *sch, int *num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && b && z && x && y) _GR_->Surf3C(_D_(x), _D_(y), _D_(z), _D_(a), _D_(b), s, *num); - delete []s; -} -/// Draw several isosurface for 3d data \a a with color proportional to \a b -void mgl_surf3c_(uintptr_t *gr, uintptr_t *a, uintptr_t *b, const char *sch, int *num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && b) _GR_->Surf3C(_D_(a), _D_(b), s, *num); - delete []s; -} -/// Draw isosurface for 3d beam in curvilinear coordinates -void mgl_beam_val_(uintptr_t *gr, mreal *val, uintptr_t *tr, uintptr_t *g1, uintptr_t *g2, uintptr_t *a, - mreal *r, const char *sch, int *norm,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && tr && g1 && g2 && a) _GR_->Beam(*val,_D_(tr),_D_(g1),_D_(g2),_D_(a),*r,s,*norm); - delete []s; -} -/// Draw several isosurfaces for 3d beam in curvilinear coordinates -void mgl_beam_(uintptr_t *gr, uintptr_t *tr, uintptr_t *g1, uintptr_t *g2, uintptr_t *a, mreal *r, - const char *sch, int *norm, int *num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && tr && g1 && g2 && a) _GR_->Beam(_D_(tr), _D_(g1), _D_(g2), _D_(a), *r,s,*norm,*num); - delete []s; -} -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_ab.cpp b/mgl/mgl_ab.cpp deleted file mode 100644 index 5ae6e91..0000000 --- a/mgl/mgl_ab.cpp +++ /dev/null @@ -1,980 +0,0 @@ -/*************************************************************************** - * mgl_ab.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 -#include - -#include "mgl/mgl_ab.h" -#define imax(a,b) (a)>(b) ? (a) : (b) -#define imin(a,b) (a)<(b) ? (a) : (b) -int mglNumThr; -char *mgl_strdup(const char *s); -//----------------------------------------------------------------------------- -void strtrim_mgl(char *str); -void wcstrim_mgl(wchar_t *str); -int _mgl_tick_ext(mreal a, mreal b, wchar_t s[32], mreal &v); -void _mgl_tick_text(mreal z, mreal z0, mreal d, mreal v, int kind, wchar_t str[64]); -//----------------------------------------------------------------------------- -mglGraphAB::mglGraphAB(int w,int h) : mglGraph() -{ - G = 0; UseLight = false; st_pos=-1; - memset(stack,0,MGL_STACK_ENTRY*13*sizeof(mreal)); - SetSize(w,h); ClfOnUpdate = true; SetDrawReg(1,1,0); - AutoClf=true; Delay = 1; ObjId=0; pPos=0; - NoAutoFactor = false; ShowMousePos = true; - BDef[0] = BDef[1] = BDef[2] = BDef[3] = 255; - DefaultPlotParam(); -} -//----------------------------------------------------------------------------- -mglGraphAB::~mglGraphAB() -{ if(G) { delete []G; delete []G4; delete []OI; } } -//----------------------------------------------------------------------------- -void mglGraphAB::DefaultPlotParam() -{ - mglGraph::DefaultPlotParam(); -} -//----------------------------------------------------------------------------- -void mglGraphAB::Rotate(mreal TetX,mreal TetZ,mreal TetY) -{ - mglGraph::Rotate( TetX,TetZ,TetY ); -} -//----------------------------------------------------------------------------- -void mglGraphAB::Pop() -{ - if(st_pos<0) return; - mreal *c=stack+13*st_pos; - xPos=c[0]; yPos=c[1]; zPos=c[2]; Persp=c[3]; - memcpy(B,c+4,9*sizeof(mreal)); - st_pos--; -} -//----------------------------------------------------------------------------- -void mglGraphAB::Push() -{ - st_pos = st_pos<9 ? st_pos+1:9; - if(st_pos<0) st_pos=0; - mreal *c=stack+13*st_pos; - c[0]=xPos; c[1]=yPos; c[2]=zPos; c[3]=Persp; - memcpy(c+4,B,9*sizeof(mreal)); -} -//----------------------------------------------------------------------------- -void mglGraphAB::SetPosScale(mreal xp, mreal yp, mreal zp, mreal scl) -{ - memset(B,0,9*sizeof(mreal)); - B[0] = B[4] = B[8] = scl; - xPos=xp; yPos=yp; zPos=zp; -} -//----------------------------------------------------------------------------- -const unsigned char *mglGraphAB::GetBits() -{ if(!Finished) Finish(); return G; } -//----------------------------------------------------------------------------- -const unsigned char *mglGraphAB::GetRGBA() -{ if(!Finished) Finish(); return G4; } -//----------------------------------------------------------------------------- -void mglGraphAB::DefColor(mglColor c, mreal alpha) -{ - if(alpha<0 || alpha>1) alpha = AlphaDef; - CDef[3] = Transparent ? alpha : 1; - if(c.Valid()) - { CDef[0] = c.r; CDef[1] = c.g; CDef[2] = c.b; } -} -//----------------------------------------------------------------------------- -void mglGraphAB::Pen(mglColor col, char style,mreal width) -{ - if(col.Valid()) DefColor(col,1); - if(style==0) return; - switch(style) - { - case '-': PDef = 0xffff; break; - case '|': PDef = 0x00ff; break; - case ';': PDef = 0x0f0f; break; - case '=': PDef = 0x3333; break; - case ':': PDef = 0x1111; break; - case 'j': PDef = 0x087f; break; - case 'i': PDef = 0x2727; break; - case ' ': PDef = 0x0000; break; -// case 0: PDef = 0x0000; break; -// default: PDef = 0xffff; - } - PenWidth = width; -} -//----------------------------------------------------------------------------- -void mglGraphAB::RotateN(mreal Tet,mreal x,mreal y,mreal z) -{ - mreal R[9],C[9],c=cos(Tet*M_PI/180),s=-sin(Tet*M_PI/180),r=1-c,n=sqrt(x*x+y*y+z*z); - x/=n; y/=n; z/=n; - C[0] = x*x*r+c; C[1] = x*y*r-z*s; C[2] = x*z*r+y*s; - C[3] = x*y*r+z*s; C[4] = y*y*r+c; C[5] = y*z*r-x*s; - C[6] = x*z*r-y*s; C[7] = y*z*r+x*s; C[8] = z*z*r+c; - memcpy(R,B,9*sizeof(mreal)); - B[0] = C[0]*R[0] + C[3]*R[1] + C[6]*R[2]; - B[1] = C[1]*R[0] + C[4]*R[1] + C[7]*R[2]; - B[2] = C[2]*R[0] + C[5]*R[1] + C[8]*R[2]; - B[3] = C[0]*R[3] + C[3]*R[4] + C[6]*R[5]; - B[4] = C[1]*R[3] + C[4]*R[4] + C[7]*R[5]; - B[5] = C[2]*R[3] + C[5]*R[4] + C[8]*R[5]; - B[6] = C[0]*R[6] + C[3]*R[7] + C[6]*R[8]; - B[7] = C[1]*R[6] + C[4]*R[7] + C[7]*R[8]; - B[8] = C[2]*R[6] + C[5]*R[7] + C[8]*R[8]; - if(AutoPlotFactor && !NoAutoFactor) - { - mreal m=(fabs(B[3])+fabs(B[4])+fabs(B[5]))/inH; - mreal n=(fabs(B[0])+fabs(B[1])+fabs(B[2]))/inW; - PlotFactor = 1.55+0.6147*(m fabs(Ay) ? fabs(Ax) : fabs(Ay); - a = a > fabs(Az) ? a : fabs(Az); - if(a==0) { SetWarn(mglWarnZero,"Aspect"); return; } - Ax/=a; Ay/=a; Az/=a; - B[0] *= Ax; B[3] *= Ax; B[6] *= Ax; - B[1] *= Ay; B[4] *= Ay; B[7] *= Ay; - B[2] *= Az; B[5] *= Az; B[8] *= Az; -} -//----------------------------------------------------------------------------- -void mglGraphAB::StickPlot(int num, int id, mreal tet, mreal phi) -{ - mreal dx,dy,w0,h0, p[6]={-1,0,0,1,0,0}; - InPlot(0,1,0,1,true); Rotate(tet, phi); PostScale(p,2); - w0=1/(1+(num-1)*fabs(p[3]-p[0])/inW); dx=(p[3]-p[0])*w0/inW; - h0=1/(1+(num-1)*fabs(p[4]-p[1])/inH); dy=(p[4]-p[1])*h0/inH; - - p[0]=-1; p[3]=1; p[1]=p[2]=p[4]=p[5]=0; // extra widening - InPlot(dx>0?0:1-w0, dx>0?w0:1, dy>0?0:1-h0, dy>0?h0:1, true); - Rotate(tet,phi); PostScale(p,2); - w0=1/(1+(num-1)*fabs(p[3]-p[0])/inW); dx=(p[3]-p[0])*w0/inW; - h0=1/(1+(num-1)*fabs(p[4]-p[1])/inH); dy=(p[4]-p[1])*h0/inH; - - mreal x1=dx>0?dx*id:1-w0+dx*id, x2=dx>0?w0+dx*id:1+dx*id; - mreal y1=dy>0?dy*id:1-h0+dy*id, y2=dy>0?h0+dy*id:1+dy*id; - InPlot(x1, x2, y1, y2, true); Rotate(tet,phi); -} -//----------------------------------------------------------------------------- -void mglGraphAB::NormScale(mreal *p,long n) -{ - register long i; - mreal x[3], *y; - for(i=0;i fabs(d2) && fabs(d1) > fabs(d3)) // x-y plane - { - z = 0; - x = s3*(B[4]*xx-B[1]*yy)/d1; - y = s3*(B[0]*yy-B[3]*xx)/d1; - } - else if(fabs(d2) > fabs(d3)) // y-z - { - x = 0; - y = s3*(B[5]*xx-B[2]*yy)/d2; - z = s3*(B[1]*yy-B[4]*xx)/d2; - } - else // x-z - { - y = 0; - x = s3*(B[5]*xx-B[2]*yy)/d3; - z = s3*(B[0]*yy-B[3]*xx)/d3; - } - LastMousePos = mglPoint(Min.x + (Max.x-Min.x)*(x+1)/2, - Min.y + (Max.y-Min.y)*(y+1)/2, - Min.z + (Max.z-Min.z)*(z+1)/2); - return LastMousePos; -} -//----------------------------------------------------------------------------- -void mglGraphAB::CalcScr(mglPoint p, int *xs, int *ys) -{ - mreal pp[3]={p.x,p.y,p.z}; - ScalePoint(pp[0],pp[1],pp[2]); - PostScale (pp,1); - if(xs) *xs=int(pp[0]); - if(ys) *ys=int(pp[1]); -} -//----------------------------------------------------------------------------- -mglPoint mglGraphAB::CalcScr(mglPoint p) -{ int x,y; CalcScr(p,&x,&y); return mglPoint(x,y); } -//----------------------------------------------------------------------------- -void mglGraphAB::LightScale() -{ - mreal *x; - register mreal nn; - register long i,j; - for(i=0;i<10;i++) - { - if(!nLight[i]) continue; - j=3*i; x = rLight+j; - pLight[j] = (x[0]*B[0] + x[1]*B[1] + x[2]*B[2])/zoomx2; - pLight[j+1] = (x[0]*B[3] + x[1]*B[4] + x[2]*B[5])/zoomy2; - pLight[j+2] = (x[0]*B[6] + x[1]*B[7] + x[2]*B[8])/sqrt(zoomx2*zoomy2); - nn=sqrt(pLight[j]*pLight[j]+pLight[j+1]*pLight[j+1]+pLight[j+2]*pLight[j+2]); - pLight[j] /= nn; pLight[j+1] /= nn; pLight[j+2] /= nn; - } -} -//----------------------------------------------------------------------------- -void mglGraphAB::Light(int n, bool enable) -{ - if(n<0 || n>9) { SetWarn(mglWarnLId); return; } - nLight[n] = enable; -} -//----------------------------------------------------------------------------- -void mglGraphAB::Light(int n, mglPoint p, mglColor c, mreal br, bool inf, mreal ap) -{ - if(n<0 || n>9) { SetWarn(mglWarnLId); return; } - nLight[n] = true; aLight[n] = ap>0?ap*ap:3; - bLight[n] = br; iLight[n] = inf; - rLight[3*n] = p.x; rLight[3*n+1] = p.y; rLight[3*n+2] = p.z; - cLight[3*n] = c.r; cLight[3*n+1] = c.g; cLight[3*n+2] = c.b; -} -//----------------------------------------------------------------------------- -int mglGraphAB::NewFrame() -{ - Clf(); - Identity(); - CurFrameId++; - return CurFrameId-1; -} -//----------------------------------------------------------------------------- -mreal mglGraphAB::Putsw(mglPoint p,mglPoint n,const wchar_t *str,char font,mreal size) -{ - static int cgid=1; StartGroup("PutswL",cgid++); - mreal pp[6] = {p.x,p.y,p.z,p.x+n.x,p.y+n.y,p.z+n.z}; - Arrow1 = Arrow2 = '_'; - - if(size<0) size = -size*FontSize; - f_size = size; Push(); - mreal shift = 0.07, fsize=size/8.*font_factor; - mreal x1=zoomx1, x2=zoomx2, y1=zoomy1, y2=zoomy2; - if(font=='t') shift = -0.07; - - shift *= fsize/2; - if(ScalePuts) - { - bool tt = Cut; Cut = true; - ScalePoint(pp[0],pp[1],pp[2]); - ScalePoint(pp[3],pp[4],pp[5]); - Cut = tt; - } - zoomx1=zoomy1=0; zoomx2=zoomy2=1; - PostScale(pp,2); - zoomx1=x1; zoomx2=x2; zoomy1=y1; zoomy2=y2; Persp=0; - - mreal ll=(pp[3]-pp[0])*(pp[3]-pp[0])+(pp[4]-pp[1])*(pp[4]-pp[1]); - if(ll==0) { Pop(); EndGroup(); return 0; } - mreal tet = 180*atan2(pp[4]-pp[1],pp[3]-pp[0])/M_PI; -// if(fabs(tet)>90) tet+=180; - memset(B,0,9*sizeof(mreal)); - B[0] = B[4] = B[8] = fsize; - fscl = fsize; ftet = -tet; - NoAutoFactor=true; RotateN(-tet,0,0,1); NoAutoFactor=false; - xPos = pp[0]+shift*(pp[4]-pp[1])/sqrt(ll) - B[1]*0.02f; - yPos = pp[1]-shift*(pp[3]-pp[0])/sqrt(ll) - B[4]*0.02f; - zPos = pp[2]; - - fsize = fnt->Puts(str,"rL",0)*size/8.; - Pop(); EndGroup(); - return fsize; -} -//----------------------------------------------------------------------------- -void mglGraphAB::Putsw(mglPoint p, const wchar_t *wcs, const char *font, mreal size, char dir, mreal sh) -{ - static int nl_shift = 0; - static int cgid=1; StartGroup("Putsw",cgid++); - if(font && strchr(font, 'A')) { Labelw(p.x, p.y, wcs,font,size,false); return; } - if(font && strchr(font, 'a')) { Labelw(p.x, p.y, wcs,font,size,true); return; } - - wchar_t *wcl; - unsigned wn=0; - const wchar_t *wnl=0; - for(wn=0;wn0) wnl++; - nl_shift++; Putsw(p, wnl, font, size, dir, sh); nl_shift--; - return; - } - - bool upside = ( (((_sx==-1) ^ (Org.y==Max.y || Org.z==Max.z)) && (dir=='x' || dir=='X')) || - (((_sy==-1) ^ (Org.x==Max.x || Org.z==Max.z)) && (dir=='y' || dir=='Y')) || - (((_st==1)) && (dir=='t' || dir=='T')) || - (((_sz==-1) ^ (Org.y==Max.y || Org.x==Max.x)) && (dir=='z' || dir=='Z')) ); - mreal pp[6] = {p.x,p.y,p.z,p.x,p.y,p.z}; - Arrow1 = Arrow2 = '_'; - char *f, *font1; - if(font) { font1=new char[strlen(font)+2]; strcpy(font1,font); } - else { font1=new char[strlen(FontDef)+2]; strcpy(font1,FontDef); } - char col=TranspType!=2 ? 'k':'w'; - f = strchr(font1,':'); if(f) { f[0]=0; col=f[1]; } -// stl[1] = col; SelectPen(stl); - - if(size<0) size = -size*FontSize; - f_size = size; Push(); - mreal shift = (sh/10+0.2)*2/PlotFactor, fsize=size/8.*font_factor; - mreal x1=zoomx1, x2=zoomx2, y1=zoomy1, y2=zoomy2; - zoomx1=zoomy1=0; zoomx2=zoomy2=1; - - if(strchr("xyzt",dir)) shift = (sh/10+0.1)*2/PlotFactor; -// shift *= size/7; - switch(dir) - { - case 'x': - case 'X': -// pp[3] += pp[3] ? fabs(pp[3])*.001 :(Max.x - Min.x)/100; break; - pp[3] += (Max.x - Min.x)/1000; break; - case 'y': - case 'Y': - if(TernAxis) upside = !upside; -// pp[4] += pp[4] ? fabs(pp[4])*.001 : (Max.y - Min.y)/10; break; - pp[4] += (Max.y - Min.y)/1000; break; - case 'z': - case 'Z': - if(TernAxis) upside = !upside; -// pp[4] -= 0; pp[5] += pp[5] ? fabs(pp[5])*.001 :(Max.z - Min.z)/100; break; - pp[5] += (Max.z - Min.z)/1000; break; - case 't': - case 'T': - pp[3] += (Max.x - Min.x)/1000; pp[4] -= (Max.y - Min.y)/1000; break; - } - if(upside) shift = -shift; - shift *= fsize/2; - - if(ScalePuts) - { - bool tt = Cut; Cut = true; - ScalePoint(pp[0],pp[1],pp[2]); - ScalePoint(pp[3],pp[4],pp[5]); - Cut = tt; - } - PostScale(pp,2); Persp=0; - - if(dir==0) - { - xPos = pp[0]; yPos = pp[1]; zPos = pp[2]; - memset(B,0,9*sizeof(mreal)); - B[0] = B[4] = B[8] = fsize; - fscl = fsize; ftet = 0; - } - else if(RotatedText) - { - if(pp[4]==pp[1] && pp[3]==pp[0]) - { zoomx1=x1; zoomx2=x2; zoomy1=y1; zoomy2=y2; - delete []font1; Pop(); EndGroup(); return; } - mreal ll=(pp[3]-pp[0])*(pp[3]-pp[0])+(pp[4]-pp[1])*(pp[4]-pp[1]); - mreal tet = 180*atan2(pp[4]-pp[1],pp[3]-pp[0])/M_PI; - if(fabs(tet)>90) tet+=180; - memset(B,0,9*sizeof(mreal)); - B[0] = B[4] = B[8] = fsize; - fscl = fsize; ftet = -tet; - NoAutoFactor=true; RotateN(-tet,0,0,1); NoAutoFactor=false; - mreal ss = (pp[3]>pp[0] || tet==-90) ? 1 : -1; - xPos = pp[0]+shift*ss*(pp[4]-pp[1])/sqrt(ll) - B[1]*0.02f; - yPos = pp[1]-shift*ss*(pp[3]-pp[0])/sqrt(ll) - B[4]*0.02f; - zPos = pp[2]; - } - else - { - if(pp[4]==pp[1] && pp[3]==pp[0]) - { zoomx1=x1; zoomx2=x2; zoomy1=y1; zoomy2=y2; - delete []font1; Pop(); EndGroup(); return; } - mreal ll=(pp[3]-pp[0])*(pp[3]-pp[0])+(pp[4]-pp[1])*(pp[4]-pp[1]); - mreal tet = atan2(pp[4]-pp[1],pp[3]-pp[0]); -// if(fabs(tet)>90) tet+=180; - memset(B,0,9*sizeof(mreal)); B[0] = B[4] = B[8] = fsize; - mreal ss = (pp[3]>pp[0] || tet==-M_PI/2) ? 1 : -1; - fscl = fsize; ftet = 0; - xPos = pp[0]+shift*ss*(pp[4]-pp[1])/sqrt(ll) - B[1]*0.02f; - yPos = pp[1]-shift*ss*(pp[3]-pp[0])/sqrt(ll) - B[4]*0.02f; - zPos = pp[2]; - - if(!strchr(font1,'R') && !strchr(font1,'C') && !strchr(font1,'L')) - { - char ch[2]="C"; -// if((pp[4]-pp[1])*(pp[3]-pp[0])>0) ch[0]=upside?'R':'L'; else ch[0]=upside?'L':'R'; - if(fabs(sin(tet))>0.1) ch[0] = shift*ss*sin(tet)>0 ? 'L':'R'; - strcat(font1,ch); - } - } - zoomx1=x1; zoomx2=x2; zoomy1=y1; zoomy2=y2; - yPos -= nl_shift*0.11/PlotFactor*fsize; - fnt->Puts(wcs,font1,col); - Pop(); delete []font1; EndGroup(); -} -//----------------------------------------------------------------------------- -void mglGraphAB::Legend(int n, wchar_t **text,char **style, mreal x, mreal y, - const char *font, mreal size, mreal llen) -{ - if(n<1) { SetWarn(mglWarnLeg); return; } - x = 2*x-1; y = 2*y-1; - if(isnan(llen)) llen=0.1; - static int cgid=1; StartGroup("Legend",cgid++); - mreal pp[15], r=GetRatio(), rh, rw, s3=PlotFactor; - if(size<=0) size = -size*FontSize; - if(!font || !(*font)) font="L"; - char *pA, *ff = new char[strlen(font)+1]; strcpy(ff,font); - llen *= 1.5; - - rh=(r<1?r:1.)*size/6.; rw=(r>1?1./r:1.)*size/8.; -// rh=size/6.; rw=size/24.; - mreal w=0, h=fnt->Height(font)*rh, j; - register long i; - for(i=0;iWidth(text[i],font)*rw; - if(style[i][0]==0) j -= llen; - w = w>j ? w:j; - } - w = (w + llen*1.1f); // add space for lines - - bool rel = true; - if((pA=strchr(ff,'A'))) - { - *pA = 'L'; - rel = false; - } - Push(); Identity(rel); // memcpy(B,B1,9*sizeof(mreal)); - if(LegendBox) // draw bounding box - { - pp[2] = pp[5] = pp[8] = pp[11] = pp[14] = s3-0.01; - pp[0] = pp[9] = pp[12] = x; pp[3] = pp[6] = x+w; - pp[1] = pp[4] = pp[13] = y-0.*h; pp[7] = pp[10] = y+h*n; -// for(i=0;i<5;i++) ScalePoint(pp[3*i],pp[3*i+1],pp[3*i+2]); - SelectPen(TranspType!=2 ? "k-1":"w-1"); - curv_plot(5,pp,0); // bounding rectangle - pp[2] = pp[5] = pp[8] = pp[11] = s3-0.01; - pp[0] = pp[6] = x; pp[3] = pp[9] = x+w; - pp[1] = pp[4] = y-0.*h; pp[7] = pp[10] = y+h*n; - DefColor(mglColor(1,1,1),1); -// for(i=0;i<4;i++) ScalePoint(pp[3*i],pp[3*i+1],pp[3*i+2]); - surf_plot(2,2,pp,0,0); // white rectangle below it - } - ScalePuts = false; - for(i=0;i20) // adjust ticks - { - float d = fabs(vv.Maximal()-v1); - d = floor(d*pow(10,-floor(log10(d)))); - if(d<4) m = 1+int(2*d+0.5); - else m = 1+int(d+0.5); - if(m<5) m = 5; - }*/ - if(dc<0) m=int(0.5-dc); - if(dc>0) m=int(0.5+(Cmax-Cmin)/dc); - if(dc==0 && Cmax*Cmin>0) m = 1+int(0.5+fabs(log10(Cmax/Cmin))); - if(m<2) m=2; - if(m>n) m=n; - - mreal dv=(vv.Maximal()-v1)/m; - for(i=0;i\n"); - fprintf(fp,"\n"); - fprintf(fp,"\n",Width,Height); - - fprintf(fp,"\n"); - fprintf(fp,"\n\n\n",descr?descr:fname,ctime(&now)); - fprintf(fp,"\n"); - - fprintf(fp,"\n", Width, Height, pname); - - fprintf(fp,""); - delete []pname; -} -//----------------------------------------------------------------------------- -void mglGraphAB::arrow_plot(mreal *p1,mreal *p2,char st) -{ - if(!strchr("AVKSDTIO",st)) return; - mreal lx=p1[0]-p2[0], ly=p1[1]-p2[1], ll, kx,ky; - mreal pp[12]; - ll = hypot(lx,ly)/(ArrowSize*0.35*font_factor); if(ll==0) return; - lx /= ll; ly /= ll; kx = ly; ky = -lx; - pp[2] = pp[5] = pp[8] = pp[11] = p1[2]; - - bool ul = UseLight; UseLight = false; - switch(st) - { - case 'I': - pp[0] = p1[0]+kx; pp[1] = p1[1]+ky; - pp[3] = p1[0]-kx; pp[4] = p1[1]-ky; - line_plot(pp,pp+3,CDef,CDef); break; - case 'D': - pp[0] = p1[0]+kx; pp[1] = p1[1]+ky; - pp[3] = p1[0]+lx; pp[4] = p1[1]+ly; - pp[6] = p1[0]-kx; pp[7] = p1[1]-ky; - pp[9] = p1[0]-lx; pp[10] = p1[1]-ly; - quad_plot(pp,pp+3,pp+9,pp+6,CDef,CDef,CDef,CDef); break; - case 'S': - pp[0] = p1[0]+kx-lx; pp[1] = p1[1]+ky-ly; - pp[3] = p1[0]-kx-lx; pp[4] = p1[1]-ky-ly; - pp[6] = p1[0]-kx+lx; pp[7] = p1[1]-ky+ly; - pp[9] = p1[0]+kx+lx; pp[10] = p1[1]+ky+ly; - quad_plot(pp,pp+3,pp+9,pp+6,CDef,CDef,CDef,CDef); break; - case 'T': - pp[0] = p1[0]-kx-lx; pp[1] = p1[1]-ky-ly; - pp[3] = p1[0]+kx-lx; pp[4] = p1[1]+ky-ly; - pp[6] = p1[0]+lx; pp[7] = p1[1]+ly; - trig_plot(pp,pp+3,pp+6,CDef,CDef,CDef); break; - case 'A': - pp[0] = p1[0]; pp[1] = p1[1]; - pp[3] = p1[0]-kx-2*lx; pp[4] = p1[1]-ky-2*ly; - pp[6] = p1[0]-1.5*lx; pp[7] = p1[1]-1.5*ly; - pp[9] = p1[0]+kx-2*lx; pp[10] = p1[1]+ky-2*ly; - quad_plot(pp,pp+3,pp+9,pp+6,CDef,CDef,CDef,CDef); break; - case 'K': - pp[0] = p1[0]; pp[1] = p1[1]; - pp[3] = p1[0]-kx-2*lx; pp[4] = p1[1]-ky-2*ly; - pp[6] = p1[0]-1.5*lx; pp[7] = p1[1]-1.5*ly; - pp[9] = p1[0]+kx-2*lx; pp[10] = p1[1]+ky-2*ly; - quad_plot(pp,pp+3,pp+9,pp+6,CDef,CDef,CDef,CDef); - pp[0] = p1[0]+kx; pp[1] = p1[1]+ky; - pp[3] = p1[0]-kx; pp[4] = p1[1]-ky; - line_plot(pp,pp+3,CDef,CDef); break; - case 'V': - pp[0] = p1[0]; pp[1] = p1[1]; - pp[3] = p1[0]-kx+2*lx; pp[4] = p1[1]-ky+2*ly; - pp[6] = p1[0]+1.5*lx; pp[7] = p1[1]+1.5*ly; - pp[9] = p1[0]+kx+2*lx; pp[10] = p1[1]+ky+2*ly; - quad_plot(pp,pp+3,pp+9,pp+6,CDef,CDef,CDef,CDef); break; - case 'O': - { - pp[0] = p1[0]; pp[1] = p1[1]; - double t; - for(int i=0;i<16;i++) - { - t = M_PI*i/8.; - pp[3] = p1[0] + kx*sin(t) + lx*cos(t); - pp[4] = p1[1] + ky*sin(t) + ly*cos(t); - t = M_PI*(i+1)/8.; - pp[6] = p1[0] + kx*sin(t) + lx*cos(t); - pp[7] = p1[1] + ky*sin(t) + ly*cos(t); - trig_plot(pp,pp+3,pp+6,CDef,CDef,CDef); - } - break; - } -/* mreal ss = MarkSize; MarkSize = ArrowSize; - mark_plot(p1,'O'); - MarkSize = ss;*/ - } - UseLight = ul; -} -//----------------------------------------------------------------------------- -unsigned char **mglGraphAB::GetRGBLines(long &w, long &h, unsigned char *&f, bool alpha) -{ - long d = alpha ? 4:3; - unsigned char **p; - if(!Finished) Finish(); - p = (unsigned char **)malloc(Height * sizeof(unsigned char *)); - for(long i=0;i 26pt */ -void mglGraphAB::SetFontSizePT(mreal pt, int dpi) -{ FontSize = 16.6154*pt/dpi; } -//----------------------------------------------------------------------------- -void mglGraphAB::FindOptOrg(mreal ax[3], mreal ay[3], mreal az[3]) -{ - static mreal px[3]={0,0,0}, py[3]={0,0,0}, pz[3]={0,0,0}, - bb[9]={1e30,0,0, 0,0,0, 0,0,0}; - static mglPoint m1, m2; - mreal nn[24]={0,0,0, 0,0,1, 0,1,0, 0,1,1, 1,0,0, 1,0,1, 1,1,0, 1,1,1}; - mreal pp[24]; - memcpy(pp, nn, 24*sizeof(mreal)); - // do nothing if transformation matrix the same - if(memcmp(B,bb,9*sizeof(mreal)) || m1!=Min || m2!=Max) - { - m1 = Min; m2 = Max; - memcpy(bb,B,9*sizeof(mreal)); PostScale(pp,8); - // find point with minimal y - register long i,j; - for(i=j=1;i<24;i+=3) if(pp[i]1-x - px[0] = Min.x + (Max.x-Min.x)*px[0]; - px[1] = Min.y + (Max.y-Min.y)*px[1]; - px[2] = Min.z + (Max.z-Min.z)*px[2]; - py[0] = Min.x + (Max.x-Min.x)*py[0]; - py[1] = Min.y + (Max.y-Min.y)*py[1]; - py[2] = Min.z + (Max.z-Min.z)*py[2]; - pz[0] = Min.x + (Max.x-Min.x)*pz[0]; - pz[1] = Min.y + (Max.y-Min.y)*pz[1]; - pz[2] = Min.z + (Max.z-Min.z)*pz[2]; - } - // just copy saved values - memcpy(ax,px,3*sizeof(mreal)); - memcpy(ay,py,3*sizeof(mreal)); - memcpy(az,pz,3*sizeof(mreal)); -} -//----------------------------------------------------------------------------- -mreal mglGraphAB::GetOrgX(char dir) -{ - mreal res = Org.x; - if(isnan(res)) - { - mreal ax[3], ay[3], az[3]; - FindOptOrg(ax,ay,az); - if(dir=='x') res = ax[0]; - else if(dir=='y') res = ay[0]; - else if(dir=='z') res = az[0]; - else if(dir=='t') res = Min.x; - else res = B[6]>0 ? Max.x:Min.x; - } - return res; -} -//----------------------------------------------------------------------------- -mreal mglGraphAB::GetOrgY(char dir) -{ - mreal res = Org.y; - if(isnan(res)) - { - mreal ax[3], ay[3], az[3]; - FindOptOrg(ax,ay,az); - if(dir=='x') res = ax[1]; - else if(dir=='y') res = ay[1]; - else if(dir=='z') res = az[1]; - else if(dir=='t') res = Min.y; - else res = B[7]>0 ? Max.y:Min.y; - } - return res; -} -//----------------------------------------------------------------------------- -mreal mglGraphAB::GetOrgZ(char dir) -{ - mreal res = Org.z; - if(isnan(res)) - { - mreal ax[3], ay[3], az[3]; - FindOptOrg(ax,ay,az); - if(dir=='x') res = ax[2]; - else if(dir=='y') res = ay[2]; - else if(dir=='z') res = az[2]; - else if(dir=='t') res = Min.z; - else res = B[8]>0 ? Max.z:Min.z; - } - return res; -} -//----------------------------------------------------------------------------- -void mglGraphAB::DrawTick(mreal *pp,bool sub) -{ - ScalePoint(pp[0],pp[1],pp[2]); - ScalePoint(pp[3],pp[4],pp[5]); - ScalePoint(pp[6],pp[7],pp[8]); - PostScale(pp,3); - double dx,dy,dz,dd,ll=TickLen*(B1[0]Draw(gr) : 0; } -void mgl_reload_class(int next, void *p) -{ if(p) ((mglDraw *)p)->Reload(next); } -void mglGraphAB::Window(int argc, char **argv, const char *title, mglDraw *draw, bool maximize) -{ - Window(argc, argv, mgl_draw_class, title, draw, mgl_reload_class, maximize); -} -//----------------------------------------------------------------------------- - diff --git a/mgl/mgl_addon.cpp b/mgl/mgl_addon.cpp deleted file mode 100644 index bf8e29c..0000000 --- a/mgl/mgl_addon.cpp +++ /dev/null @@ -1,235 +0,0 @@ -/*************************************************************************** - * mgl_addon.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#ifdef WIN32 -#include -#include -#else -#include -#endif -#include -#include "mgl/mgl_addon.h" -//--------------------------------------------------------------------------- -void mgl_strcls(char *str) -{ - unsigned len = strlen(str),i,n; - char *tmp = new char[len]; - for(i=0;i0;i--) if(tmp[i]!=' ') break; - tmp[i+1]=0; strcpy(str,&(tmp[n])); - delete []tmp; -} -//--------------------------------------------------------------------------- -int mgl_strpos(const char *str,char *fnd) -{ - const char *p=strstr(str,fnd); - int res; - if(p) res = p-str; - else res = -1; - return res; -} -//--------------------------------------------------------------------------- -int mgl_strpos(const char *str,char ch) -{ - const char *p=strchr(str,ch); - int res; - if(p) res = p-str; - else res = -1; - return res; -} -//--------------------------------------------------------------------------- -char *mgl_fgetstr(FILE *fp) -{ - static char s[256]; - do - { - if(!fgets(s,256,fp)) break; - mgl_strtrim(s); -// strlwr(s); - } while(!feof(fp) && (s[0]==0 || s[0]=='%' || s[0]=='#')); - return s; -} -//--------------------------------------------------------------------------- -bool mgl_istrue(char ch) -{ return (ch=='1' || ch=='t' || ch=='+' || ch=='v'); } -//--------------------------------------------------------------------------- -void mgl_test(const char *str, ...) -{ - char buf[256]; - va_list lst; - va_start(lst,str); - vsprintf(buf,str,lst); - va_end(lst); - printf("TEST: %s\n",buf); - fflush(stdout); -} -//--------------------------------------------------------------------------- -void mgl_info(const char *str, ...) -{ - char buf[256]; - va_list lst; - va_start(lst,str); - vsprintf(buf,str,lst); - va_end(lst); - printf("%s",buf); - FILE *fp = fopen("info.txt","at"); - fprintf(fp,"%s",buf); - fclose(fp); -} -//--------------------------------------------------------------------------- -FILE *mgl_next_data(const char *fname,int p) -{ - char *s; - int len; - static int pos=0; - static char path[256]; - - if(p>0) pos = p; - if(fname==NULL) return NULL; - if(pos==0) { if(!getcwd(path,256)) return 0; } // remember ini dyrectory - else { if(chdir(path)==-1) return 0; } - - // read the initial (common) date from "mbrs.ini" - FILE *fp=fopen(fname,"rt"); - if(fp==NULL) return NULL; - fseek(fp,0,SEEK_END); - len = ftell(fp); - if(pos>=len) // no more data - { fclose(fp); return NULL; } - fseek(fp,pos,SEEK_SET); - //printf("pos 1 = %d\t",pos); - do - { - s = mgl_fgetstr(fp); - fflush(stdout); - if(s[0]=='$' || s[1]=='$' || s[3]=='$') - { fclose(fp); return NULL; } - } while(!feof(fp) && (s[0]!='-' || s[1]!='-' || s[3]!='-')); - if(feof(fp)) // no more data - { fclose(fp); return NULL; } - return fp; -} -//--------------------------------------------------------------------------- -bool mglDifrGrid(dual *a,int n,dual q,int Border,dual *b,dual *d,int kk) -{ - register int i,k; -// if(n<=0 || q>=0.5) return false; - dual adt = dual(0.,1.)*q; - - memcpy(b,a,n*sizeof(dual)); - for(k=kk;k>0;k--) // 3 iterations - { - for(i=1;i0;k--) // kk iterations - { - d[ii] = a[ii] + adt*(b[ii+1]-b[ii])*(ff/k); - for(i=ii+1;i0) freq[nn-i] = -(double)(i); - } -} -//---------------------------------------------------------------------------- diff --git a/mgl/mgl_axis.cpp b/mgl/mgl_axis.cpp deleted file mode 100644 index d9bc107..0000000 --- a/mgl/mgl_axis.cpp +++ /dev/null @@ -1,1269 +0,0 @@ -/*************************************************************************** - * mgl_axis.cpp is part of Math Graphic Library * - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 -#include -#include - -#include "mgl/mgl.h" -#include "mgl/mgl_eval.h" -#include "mgl/mgl_c.h" -#define FLT_EPS (1.+1.2e-07) -//----------------------------------------------------------------------------- -wchar_t *mgl_wcsdup(const wchar_t *s) -{ - wchar_t *r = (wchar_t *)malloc((wcslen(s)+1)*sizeof(wchar_t)); - memcpy(r,s,(wcslen(s)+1)*sizeof(wchar_t)); - return r; -} -//----------------------------------------------------------------------------- -char *mgl_strdup(const char *s) -{ - char *r = (char *)malloc((strlen(s)+1)*sizeof(char)); - memcpy(r,s,(strlen(s)+1)*sizeof(char)); - return r; -} -//----------------------------------------------------------------------------- -void wcstrim_mgl(wchar_t *str) -{ - wchar_t *c = mgl_wcsdup(str); - unsigned long n=wcslen(str); - long k; - for(k=0;k=0;k--) if(!isspace(c[k])) break; - c[k+1] = 0; - wcscpy(str,c); free(c); -} -//----------------------------------------------------------------------------- -/// Round the number to k digits. For example, x = 0.01234 -> r = 0.0123 for k=3. -mreal mgl_okrugl(mreal x,int k) -{ - if(x<=0) return 0; - mreal r; - long n = long(log10(x)); - r = floor(x*pow(10.,k-n))/pow(10.,k-n); - return r; -} -//----------------------------------------------------------------------------- -void mglGraph::DrawXGridLine(mreal t, mreal y0, mreal z0) -{ - register int i; - mreal *pp = new mreal[3*GridPnts+3],dd; - bool *tt = new bool[GridPnts+1]; - dd = (Max.z-Min.z - (TernAxis&2 ? t:0))/GridPnts; - for(i=0;i=0 ? dx : mgl_okrugl(-fabs(Min.x-Max.x)/(dx+1),3); - ddy = dy>=0 ? dy : mgl_okrugl(-fabs(Min.y-Max.y)/(dy+1),3); - ddz = dz>=0 ? dz : mgl_okrugl(-fabs(Min.z-Max.z)/(dz+1),3); - if(strchr(dir,'x')) - { - x0 = GetOrgX('x'); y0 = GetOrgY('x'); z0 = GetOrgZ('x'); - x0 = isnan(OrgT.x) ? x0 : OrgT.x; - x0 = x0 - ddx*floor((x0-(Max.x>Min.x?Min.x:Max.x))/ddx); - if(xnum) for(int i=0;i0) - { - x0 = exp(M_LN10*floor(0.1+log10(Min.x))); - for(t=x0;t<=Max.x*FLT_EPS;t*=10) DrawXGridLine(t,y0,z0); - } - else if(Max.x<0) - { - x0 = -exp(M_LN10*floor(0.1+log10(-Min.x))); - for(t=x0;t>=Min.x*FLT_EPS;t*=10) DrawXGridLine(t,y0,z0); - } - } - if(strchr(dir,'y')) - { - x0 = GetOrgX('y'); y0 = GetOrgY('y'); z0 = GetOrgZ('y'); - y0 = isnan(OrgT.y) ? y0 : OrgT.y; - y0 = y0 - ddy*floor((y0-(Max.y>Min.y?Min.y:Max.y))/ddy); - if(ynum) for(int i=0;iMin.y?Max.y:Min.y);t+=ddy) - DrawYGridLine(t,x0,z0); - else if(Min.y>0) - { - y0 = exp(M_LN10*floor(0.1+log10(Min.y))); - for(t=y0;t<=Max.y*FLT_EPS;t*=10) DrawYGridLine(t,x0,z0); - } - else if(Max.y<0) - { - y0 = -exp(M_LN10*floor(0.1+log10(-Max.y))); - for(t=y0;t>=Min.y*FLT_EPS;t*=10) DrawYGridLine(t,x0,z0); - } - } - if(strchr(dir,'z')) - { - x0 = GetOrgX('z'); y0 = GetOrgY('z'); z0 = GetOrgZ('z'); - z0 = isnan(OrgT.z) ? z0 : OrgT.z; - z0 = z0 - ddz*floor((z0-(Max.z>Min.z?Min.z:Max.z))/ddz); - if(znum) for(int i=0;iMin.z?Max.z:Min.z);t+=ddz) - DrawZGridLine(t,x0,y0); - else if(Min.z>0) - { - z0 = exp(M_LN10*floor(0.1+log10(Min.z))); - for(t=z0;t<=Max.z*FLT_EPS;t*=10) DrawZGridLine(t,x0,y0); - } - else if(Max.z<0) - { - z0 = -exp(M_LN10*floor(0.1+log10(-Max.z))); - for(t=z0;t>=Min.z*FLT_EPS;t*=10) DrawZGridLine(t,x0,y0); - } - } - if(strchr(dir,'t') && TernAxis) - { - z0 = isnan(OrgT.z) ? GetOrgZ('z') : OrgT.z; - z0 = z0 - ddz*floor((z0-Min.z)/ddz); - if(xnum) for(int i=0;i0.2) font[0]='R'; - strcat(font,FontDef); - x0 = GetOrgX(dir); y0 = GetOrgY(dir); z0 = GetOrgZ(dir); - if(size<=0) size = -size*FontSize; - if(dir=='x') - { - if(dx) t = (Min.x+Max.x+pos*(Max.x-Min.x))/2; - else t = Min.x*pow(Max.x/Min.x, (pos+1)/2); - Putsw(mglPoint(t,y0,z0),text,font,size,'X',shift); - } - if(dir=='y') - { - if(TernAxis) - { - t = (Min.y+Max.y+pos*(Max.y-Min.y))/2; - Putsw(mglPoint(Max.x+Min.y-t,t,z0),text,font,size,'T',shift); - } - else - { - if(dy) t = (Min.y+Max.y+pos*(Max.y-Min.y))/2; - else t = Min.y*pow(Max.y/Min.y, (pos+1)/2); - Putsw(mglPoint(x0,t,z0),text,font,size,'Y',shift); - } - } - if(dir=='z') - { - if(dz) t = (Min.z+Max.z+pos*(Max.z-Min.z))/2; - else t = Min.z*pow(Max.z/Min.z, (pos+1)/2); - Putsw(mglPoint(x0,y0,t),text,font,size,'Z',shift); - } - if(dir=='t' && TernAxis) - { - t = (Min.y+Max.y-pos*(Max.y-Min.y))/2; - Putsw(mglPoint(Min.x,t,Min.z),text,font,size,'Y',shift); - } -} -//----------------------------------------------------------------------------- -int _mgl_tick_ext(mreal a, mreal b, wchar_t s[32], mreal &v) -{ - int kind = 0; - if(fabs(a-b)<0.01*fabs(a)) - { - kind = 1; - v = fabs(a-b); - if(v>100.f) - { - int k=int(log10(v)-0.01); - kind=3; v=mgl_ipow(10,k); - mglprintf(s, 32, L"(@{\\times{}10^{%d}})", k); - } - if(v<1e-2f) - { - int k=int(log10(v)-0.01)-1; - kind=3; v=mgl_ipow(10,k); - mglprintf(s, 32, L"(@{\\times{}10^{%d}})", k); - } - } - else - { - v = fabs(b)>fabs(a)?fabs(b):fabs(a); - if(v>100.f) - { - kind = 2; - int k=int(log10(v)-0.01); - v=mgl_ipow(10,k); - mglprintf(s, 32, L"\\times 10^{%d}", k); - } - if(v<1e-2f) - { - kind = 2; - int k=int(log10(v)-0.01)-1; - v=mgl_ipow(10,k); - mglprintf(s, 32, L"\\times 10^{%d}", k); - } - } - return kind; -} -//----------------------------------------------------------------------------- -void _mgl_tick_text(mreal z, mreal z0, mreal d, mreal v, int kind, wchar_t str[64]) -{ - mreal u = fabs(z)z0) u = fabs(z-z0)z0)) u /= v; - if((kind&1) && z>z0) - { - int n1,n2; - mglprintf(str, 64, fabs(u)<1 ? L"@{(+%.2g)}" : L"@{(+%.3g)}",u); - n1=wcslen(str); mglprintf(str, 64, L"@{(+%g)}",u); n2=wcslen(str); - if(n1=0 ? dx : mgl_okrugl(-fabs(Min.x-Max.x)/(dx+1),3); - ddy = dy>=0 ? dy : mgl_okrugl(-fabs(Min.y-Max.y)/(dy+1),3); - ddz = dz>=0 ? dz : mgl_okrugl(-fabs(Min.z-Max.z)/(dz+1),3); - if(ddy==0) ddy=y0*10>fabs(Max.y-Min.y) ? 0.3*fabs(Max.y-Min.y) : y0*3; - if(ddz==0) ddz=z0*10>fabs(Max.z-Min.z) ? 0.3*fabs(Max.z-Min.z) : z0*3; - if(y0>(Max.y+Min.y)/2) ddy = -ddy; - if(z0>(Max.z+Min.z)/2) ddz = -ddz; - SelectPen(stl); - for(i=0;i<31;i++) // draw axis line - { - pp[3*i+1]=y0; pp[3*i+2]=z0; - pp[3*i]=Min.x+(Max.x-Min.x)*i/30.; - ScalePoint(pp[3*i],pp[3*i+1],pp[3*i+2]); - } - if(stl[3]) - { - pp[3*31+1]=y0; pp[3*31+2]=z0; - pp[3*31]=Min.x+(Max.x-Min.x)*1.05; - ScalePoint(pp[3*31],pp[3*31+1],pp[3*31+2]); - curv_plot(32,pp,0); - } - else curv_plot(31,pp,0); - - if(xnum) for(int i=0;iMin.x) - x0 = x0 - ddx*floor((x0-Min.x)/ddx+1e-3); - else - { - x1 = Min.x-(Max.x-Min.x)*1e-6; - x0 = x0 - ddx*floor((x0-Max.x)/ddx+1e-3); - } - for(x=x0;x<=x1;x+=ddx) - { - DrawXTick(x,y0,z0,ddy,ddz); - if(text) - { - if(xtt[0]) mglprintf(str, 64, xtt, fabs(x)0) - { - ddx /= (NSx+1); // subticks drawing - x0 = GetOrgX('x'); x0 = isnan(OrgT.x) ? x0 : OrgT.x; - if(Max.x>Min.x) - { x1=Max.x; x0 = x0 - ddx*floor((x0-Min.x)/ddx+1e-3); } - else - { x1=Min.x; x0 = x0 - ddx*floor((x0-Max.x)/ddx+1e-3); } - for(x=x0;x<=x1;x+=ddx) DrawXTick(x,y0,z0,ddy,ddz,1); - } - } - else if(Min.x>0) - { - int k=1+int(log10(Max.x/Min.x)/5), cur=0; - x0 = exp(M_LN10*floor(0.1+log10(Min.x))); - for(x=x0;x<=Max.x*FLT_EPS;x*=10.f) - { - if(x*FLT_EPS>=Min.x && x<=Max.x*FLT_EPS) - { - DrawXTick(x,y0,z0,ddy,ddz); - mglprintf(str,64,L"10^{%d}",int(floor(0.1+log10(x)))); - if(text && cur%k==0) Putsw(mglPoint(x,y0,z0),str,FontDef,-1,'x'); - cur++; - } - // subticks drawing - for(v=x;v<10*x;v+=x) if(v>Min.x && v=Min.x*FLT_EPS;x*=10) - { - if(x*FLT_EPS<=Max.x && x>=Min.x*FLT_EPS) - { - DrawXTick(x,y0,z0,ddy,ddz); - mglprintf(str,64,L"-10^{%d}",int(floor(0.1+log10(-x)))); - if(text && cur%k==0) Putsw(mglPoint(x,y0,z0),str,FontDef,-1,'x'); - cur++; - } - // subticks drawing - for(v=x;v>10*x;v+=x) if(vMin.x) DrawXTick(v,y0,z0,ddy,ddz,1); - } - } -} -//----------------------------------------------------------------------------- -void mglGraph::DrawYTick(mreal y, mreal x0, mreal z0, mreal dx, mreal dz, int f) -{ - mreal pp[9],ff=TickLen/sqrt(1.+f*st_t); - if(TernAxis) - { pp[0]=x0+dx*ff; pp[1]=y-dx*ff; pp[2]=z0; } - else - { pp[0]=x0+dx*ff; pp[1]=y; pp[2]=z0; } - pp[3]=x0; pp[4]=y; pp[5]=z0; - pp[6]=x0; pp[7]=y; pp[8]=z0+dz*ff; - if(*TickStl && !f) SelectPen(TickStl); - if(*SubTStl && f) SelectPen(SubTStl); - DrawTick(pp,f!=0); -} -void mglGraph::AxisY(bool text, const char *stl) -{ - mreal pp[3*32]; - wchar_t str[64]; - long i; - mreal x0,y0,z0,y,ddx,ddy,ddz,v=0; - x0 = GetOrgX('y'); y0 = GetOrgY('y'); z0 = GetOrgZ('y'); - ddx = dx>=0 ? dx : mgl_okrugl(-fabs(Min.x-Max.x)/(dx+1),3); - ddy = dy>=0 ? dy : mgl_okrugl(-fabs(Min.y-Max.y)/(dy+1),3); - ddz = dz>=0 ? dz : mgl_okrugl(-fabs(Min.z-Max.z)/(dz+1),3); - if(ddx==0) ddx=x0*10>fabs(Max.x-Min.x) ? 0.3*fabs(Max.x-Min.x) : x0*3; - if(ddz==0) ddz=z0*10>fabs(Max.z-Min.z) ? 0.3*fabs(Max.z-Min.z) : z0*3; - if(x0>(Max.x+Min.x)/2) ddx = -ddx; - if(z0>(Max.z+Min.z)/2) ddz = -ddz; - SelectPen(stl); - for(i=0;i<31;i++) // ñàìà îñü - { - pp[3*i]=x0; pp[3*i+2]=z0; - pp[3*i+1]=Min.y+(Max.y-Min.y)*i/30.; - ScalePoint(pp[3*i],pp[3*i+1],pp[3*i+2]); - } - if(stl[3]) - { - pp[3*31]=x0; pp[3*31+2]=z0; - pp[3*31+1]=Min.y+(Max.y-Min.y)*1.05; - ScalePoint(pp[3*31],pp[3*31+1],pp[3*31+2]); - curv_plot(32,pp,0); - } - else curv_plot(31,pp,0); - - if(ynum) for(int i=0;iMin.y) - y0 = y0 - ddy*floor((y0-Min.y)/ddy+1e-3); - else - { - y1 = Min.y-(Max.y-Min.y)*1e-6; - y0 = y0 - ddy*floor((y0-Max.y)/ddy+1e-3); - } - for(y=y0;y<=y1;y+=ddy) - { - DrawYTick(y,x0,z0,ddx,ddz); - if(text) - { - if(ytt[0]) mglprintf(str, 64, ytt, fabs(y)0) - { - ddy /= (NSy+1); // subticks drawing - y0 = GetOrgY('y'); y0 = isnan(OrgT.y) ? y0 : OrgT.y; - if(Max.y>Min.y) - { y1=Max.y; y0 = y0 - ddy*floor((y0-Min.y)/ddy+1e-3); } - else - { y1=Min.y; y0 = y0 - ddy*floor((y0-Max.y)/ddy+1e-3); } - for(y=y0;y<=y1;y+=ddy) DrawYTick(y,x0,z0,ddx,ddz,1); - } - } - else if(Min.y>0) - { - int k=1+int(log10(Max.y/Min.y)/5), cur=0; - y0 = exp(M_LN10*floor(0.1+log10(Min.y))); - for(y=y0;y<=Max.y*FLT_EPS;y*=10) - { - if(y*FLT_EPS>=Min.y && y<=Max.y*FLT_EPS) - { - DrawYTick(y,x0,z0,ddx,ddz); - mglprintf(str,64,L"10^{%d}",int(floor(0.1+log10(y)))); - if(text && cur%k==0) Putsw(mglPoint(x0,y,z0),str,FontDef,-1,'y'); - cur++; - } - // subticks drawing - for(v=y;v<10*y;v+=y) if(v>Min.y && v=Min.y*FLT_EPS;y*=10) - { - if(y*FLT_EPS<=Max.y && y>=Min.y*FLT_EPS) - { - DrawYTick(y,x0,z0,ddx,ddz); - mglprintf(str,64,L"-10^{%d}",int(floor(0.1+log10(-y)))); - if(text && cur%k==0) Putsw(mglPoint(x0,y,z0),str,FontDef,-1,'y'); - cur++; - } - // subticks drawing - for(v=y;v>10*y;v+=y) if(vMin.y) DrawYTick(v,x0,z0,ddx,ddz,1); - } - } -} -//----------------------------------------------------------------------------- -void mglGraph::DrawZTick(mreal z, mreal x0, mreal y0, mreal dx, mreal dy, int f) -{ - mreal pp[9],ff=TickLen/sqrt(1.+f*st_t); - pp[0]=x0; pp[1]=y0+dy*ff; pp[2]=z; - pp[3]=x0; pp[4]=y0; pp[5]=z; - pp[6]=x0+dx*ff; pp[7]=y0; pp[8]=z; - if(*TickStl && !f) SelectPen(TickStl); - if(*SubTStl && f) SelectPen(SubTStl); - DrawTick(pp,f!=0); -} -void mglGraph::AxisZ(bool text, const char *stl) -{ - mreal pp[3*32]; - wchar_t str[64]; - long i; - mreal x0,y0,z0,z,ddx,ddy,ddz,v=0; - x0 = GetOrgX('z'); y0 = GetOrgY('z'); z0 = GetOrgZ('z'); - ddx = dx>=0 ? dx : mgl_okrugl(-fabs(Min.x-Max.x)/(dx+1),3); - ddy = dy>=0 ? dy : mgl_okrugl(-fabs(Min.y-Max.y)/(dy+1),3); - ddz = dz>=0 ? dz : mgl_okrugl(-fabs(Min.z-Max.z)/(dz+1),3); - if(ddx==0) ddx=x0*10>fabs(Max.x-Min.x) ? 0.3*fabs(Max.x-Min.x) : x0*3; - if(ddy==0) ddy=y0*10>fabs(Max.y-Min.y) ? 0.3*fabs(Max.y-Min.y) : y0*3; - if(x0>(Max.x+Min.x)/2) ddx = -ddx; - if(y0>(Max.y+Min.y)/2) ddy = -ddy; - SelectPen(stl); - for(i=0;i<31;i++) // ñàìà îñü - { - pp[3*i]=x0; pp[3*i+1]=y0; - pp[3*i+2]=Min.z+(Max.z-Min.z)*i/30.; - ScalePoint(pp[3*i],pp[3*i+1],pp[3*i+2]); - } - if(stl[3]) - { - pp[3*31]=x0; pp[3*31+1]=y0; - pp[3*31+2]=Min.z+(Max.z-Min.z)*1.05; - ScalePoint(pp[3*31],pp[3*31+1],pp[3*31+2]); - curv_plot(32,pp,0); - } - else curv_plot(31,pp,0); - - if(znum) for(int i=0;iMin.z) z0 = z0 - ddz*floor((z0-Min.z)/ddz+1e-3); - else - { - z1 = Min.z-(Max.z-Min.z)*1e-6; - z0 = z0 - ddz*floor((z0-Max.z)/ddz+1e-3); - } - for(z=z0;z<=z1;z+=ddz) - { - DrawZTick(z,x0,y0,ddx,ddy); - if(text) - { - if(ztt[0]) mglprintf(str,64,ztt,fabs(z)0) - { - ddz /= (NSz+1); // subticks drawing - z0 = GetOrgZ('z'); z0 = isnan(OrgT.z) ? z0 : OrgT.z; - if(Max.z>Min.z) - { z1=Max.z; z0 = z0 - ddz*floor((z0-Min.z)/ddz+1e-3); } - else - { z1=Min.z; z0 = z0 - ddz*floor((z0-Max.z)/ddz+1e-3); } - for(z=z0;z<=z1;z+=ddz) DrawZTick(z,x0,y0,ddx,ddy,1); - } - } - else if(Min.z>0) - { - int k=1+int(log10(Max.z/Min.z)/5), cur=0; - z0 = exp(M_LN10*floor(0.1+log10(Min.z))); - for(z=z0;z<=Max.z*FLT_EPS;z*=10) - { - if(z*FLT_EPS>=Min.z && z<=Max.z*FLT_EPS) - { - DrawZTick(z,x0,y0,ddx,ddy); - mglprintf(str,64,L"10^{%d}",int(floor(0.1+log10(z)))); - if(text && cur%k==0) Putsw(mglPoint(x0,y0,z),str,FontDef,-1,'z'); - cur++; - } - // subticks drawing - for(v=z;v<10*z;v+=z) if(v>Min.z && v=Min.z*FLT_EPS;z*=10) - { - if(z*FLT_EPS<=Max.z && z>=Min.z*FLT_EPS) - { - DrawZTick(z,x0,y0,ddx,ddy); - mglprintf(str,64,L"-10^{%d}",int(floor(0.1+log10(-z)))); - if(text && cur%k==0) Putsw(mglPoint(x0,y0,z),str,FontDef,-1,'z'); - cur++; - } - // subticks drawing - for(v=z;v>10*z;v+=z) if(vMin.z) DrawZTick(v,x0,y0,ddx,ddy,1); - } - } -} -//----------------------------------------------------------------------------- -void mglGraph::Axis(const char *dir, bool adjust) -{ - if(adjust) AdjustTicks(dir); - static int cgid=1; StartGroup("Axis",cgid++); - bool text = strchr(dir,'_')==NULL; - const char *arr = "AKDTVISO"; - char stl[5]={TranspType!=2?'k':'w', '-', '1', 0, 0}; - for(unsigned i=0;i=0 ? dx : mgl_okrugl(-fabs(Min.x-Max.x)/(dx+1),3); - ddy = dy>=0 ? dy : mgl_okrugl(-fabs(Min.y-Max.y)/(dy+1),3); - ddz = dz>=0 ? dz : mgl_okrugl(-fabs(Min.z-Max.z)/(dz+1),3); - d_x=(ddx!=0); d_y=(ddy!=0); d_z=(ddz!=0); - if(!d_x) ddx=x0*10>fabs(Max.x-Min.x) ? 0.3*fabs(Max.x-Min.x) : x0*3; - if(!d_y) ddy=y0*10>fabs(Max.y-Min.y) ? 0.3*fabs(Max.y-Min.y) : y0*3; - if(!d_z) ddz=z0*10>fabs(Max.z-Min.z) ? 0.3*fabs(Max.z-Min.z) : z0*3; - - if(xnum) for(int i=0;iMin.x?Min.x:Max.x))/ddx); - for(x=x0;x<(Max.x>Min.x?Max.x:Min.x);x+=ddx) - { - DrawXTick(x,Min.y,Min.z,ddy,ddz); - DrawXTick(x,Min.y,Max.z,ddy,-ddz); - DrawXTick(x,Max.y,Min.z,-ddy,ddz); - DrawXTick(x,Max.y,Max.z,-ddy,-ddz); - } - } - else if(Min.x>0) - { - x0 = exp(M_LN10*floor(0.1+log10(Min.x))); - for(x=x0;xMin.x;x*=10) - { - if(x>Max.x) continue; - DrawXTick(x,Min.y,Min.z,ddy,ddz); - DrawXTick(x,Min.y,Max.z,ddy,-ddz); - DrawXTick(x,Max.y,Min.z,-ddy,ddz); - DrawXTick(x,Max.y,Max.z,-ddy,-ddz); - } - } - x0 = GetOrgX(0); - if(ynum) for(int i=0;iMin.y?Min.y:Max.y))/ddy); - for(y=y0;y<(Max.y>Min.y?Max.y:Min.y);y+=ddy) - { - DrawYTick(y,Min.x,Min.z,ddx,ddz); - DrawYTick(y,Min.x,Max.z,ddx,-ddz); - DrawYTick(y,Max.x,Min.z,-ddx,ddz); - DrawYTick(y,Max.x,Max.z,-ddx,-ddz); - } - } - else if(Min.y>0) - { - y0 = exp(M_LN10*floor(0.1+log10(Min.y))); - for(y=y0;yMin.y;y*=10) - { - if(y>Max.y) continue; - DrawYTick(y,Min.x,Min.z,ddx,ddz); - DrawYTick(y,Min.x,Max.z,ddx,-ddz); - DrawYTick(y,Max.x,Min.z,-ddx,ddz); - DrawYTick(y,Max.x,Max.z,-ddx,-ddz); - } - } - y0 = GetOrgY(0); - if(znum) for(int i=0;iMin.z?Min.z:Max.z))/ddz); - for(z=z0;z<(Max.z>Min.z?Max.z:Min.z);z+=ddz) - { - DrawZTick(z,Min.x,Min.y,ddx,ddy); - DrawZTick(z,Min.x,Max.y,ddx,-ddy); - DrawZTick(z,Max.x,Min.y,-ddx,ddy); - DrawZTick(z,Max.x,Max.y,-ddx,-ddy); - } - } - else if(Min.z>0) - { - z0 = exp(M_LN10*floor(0.1+log10(Min.z))); - for(z=z0;zMin.z;z*=10) - { - if(z>Max.z) continue; - DrawZTick(z,Min.x,Min.y,ddx,ddy); - DrawZTick(z,Min.x,Max.y,ddx,-ddy); - DrawZTick(z,Max.x,Min.y,-ddx,ddy); - DrawZTick(z,Max.x,Max.y,-ddx,-ddy); - } - } -} -//----------------------------------------------------------------------------- -void mglGraph::Box(const char *col,bool ticks) -{ - mglColor c(NC); - if(col && col[0]) c.Set(col[0]); - Box(c,ticks); -} -//----------------------------------------------------------------------------- -void mglGraph::Box(mglColor p,bool ticks) -{ - static int cgid=1; StartGroup("Box",cgid++); - mreal x1=Min.x,x2=Max.x,y1=Min.y,y2=Max.y,z1=Min.z,z2=Max.z; - Arrow1 = Arrow2 = '_'; - if(p.Valid()) Pen(p,'-',BaseLineWidth); - else Pen(TranspType!=2 ? BC:WC,'-',BaseLineWidth); - mglFormula *tt = fc; fc = 0; - if((TernAxis&3)==1) // usual ternary axis - { - Line(mglPoint(x1,y1,z1), mglPoint(x1,y1,z2), 0, 100); - Line(mglPoint(x1,y2,z1), mglPoint(x1,y2,z2), 0, 100); - Line(mglPoint(x2,y1,z1), mglPoint(x2,y1,z2), 0, 100); - - Line(mglPoint(x1,y1,z1), mglPoint(x1,y2,z1), 0, 100); - Line(mglPoint(x1,y1,z1), mglPoint(x2,y1,z1), 0, 100); - Line(mglPoint(x1,y2,z1), mglPoint(x2,y1,z1), 0, 100); - - Line(mglPoint(x1,y1,z2), mglPoint(x1,y2,z2), 0, 100); - Line(mglPoint(x1,y1,z2), mglPoint(x2,y1,z2), 0, 100); - Line(mglPoint(x1,y2,z2), mglPoint(x2,y1,z2), 0, 100); - } - else if((TernAxis&3)==2) // quaternary axis - { - Line(mglPoint(x1,y1,z1), mglPoint(x1,y2,z1), 0, 100); - Line(mglPoint(x1,y1,z1), mglPoint(x2,y1,z1), 0, 100); - Line(mglPoint(x1,y2,z1), mglPoint(x2,y1,z1), 0, 100); - - Line(mglPoint(x1,y1,z1), mglPoint(x1,y1,z2), 0, 100); - Line(mglPoint(x1,y2,z1), mglPoint(x1,y1,z2), 0, 100); - Line(mglPoint(x2,y1,z1), mglPoint(x1,y1,z2), 0, 100); - } - else - { - Line(mglPoint(x1,y1,z1), mglPoint(x1,y1,z2), 0, 100); - Line(mglPoint(x1,y2,z1), mglPoint(x1,y2,z2), 0, 100); - Line(mglPoint(x2,y1,z1), mglPoint(x2,y1,z2), 0, 100); - Line(mglPoint(x2,y2,z1), mglPoint(x2,y2,z2), 0, 100); - - Line(mglPoint(x1,y1,z1), mglPoint(x1,y2,z1), 0, 100); - Line(mglPoint(x1,y1,z1), mglPoint(x2,y1,z1), 0, 100); - Line(mglPoint(x1,y2,z1), mglPoint(x2,y2,z1), 0, 100); - Line(mglPoint(x2,y1,z1), mglPoint(x2,y2,z1), 0, 100); - - Line(mglPoint(x1,y1,z2), mglPoint(x1,y2,z2), 0, 100); - Line(mglPoint(x1,y1,z2), mglPoint(x2,y1,z2), 0, 100); - Line(mglPoint(x1,y2,z2), mglPoint(x2,y2,z2), 0, 100); - Line(mglPoint(x2,y1,z2), mglPoint(x2,y2,z2), 0, 100); - } - if(ticks && !TernAxis) TickBox(); - fc = tt; - EndGroup(); -} -//----------------------------------------------------------------------------- -void mglGraph::AddLegend(const wchar_t *text,const char *style) -{ - if(!text) return; - if(NumLeg>=100) { SetWarn(mglWarnLegA); return; } - LegStr[NumLeg] = mgl_wcsdup(text); - if(style) LegStl[NumLeg] = mgl_strdup(style); - else LegStl[NumLeg] = mgl_strdup(last_style); - NumLeg++; -} -//----------------------------------------------------------------------------- -void mglGraph::Legend(mreal x, mreal y, const char *font, mreal size, mreal llen) -{ Legend(NumLeg,LegStr,LegStl,x,y,font,size,llen); } -//----------------------------------------------------------------------------- -void mglGraph::Legend(int where, const char *font, mreal size, mreal llen) -{ Legend(NumLeg,LegStr,LegStl,where,font,size,llen); } -//----------------------------------------------------------------------------- -void mglGraph::ClearLegend() -{ - for(long i=0;i1?1./r:1.)*size/8.; - mreal h=fnt->Height(font)*rh, x, y, dx = 0.06, dy = 0.06; - for(long i=0;iWidth(text[i],font)*rw; - if(style[i][0]==0) x -= llen; - w = w>x ? w:x; - } - w = (w + 1.1f*llen*1.5); // add space for lines - - switch(where) - { - case 0: x = dx-1; y = dy-1; break; - case 1: x = 1-w-dx; y = dy-1; break; - case 2: x = dx-1; y = 1-h*n-dy; break; - default: x = 1-w-dx; y = 1-h*n-dy; break; - } - Legend(n,text,style,(x+1)/2,(y+1)/2,font,size,llen); -} -//----------------------------------------------------------------------------- -void mglGraph::Ternary(int t) -{ - static mglPoint x1(-1,-1,-1),x2(1,1,1),o(NAN,NAN,NAN); - static bool c = true; - TernAxis = t; - if(t) - { - x1 = Min; x2 = Max; o = Org; c = Cut; - Cut = false; OrgT = mglPoint(NAN,NAN,NAN); - Axis(mglPoint(0,0,0),mglPoint(1,1,t==2?1:0),mglPoint(0,0,0)); - } - else { Axis(x1,x2,o); Cut = c; } -} -//----------------------------------------------------------------------------- -void mglGraph::DrawTTick(mreal y, mreal x0, mreal z0, mreal dx, mreal dz, int f) -{ - mreal pp[9],ff=TickLen/sqrt(1.+f*st_t); - pp[0]=x0-y+Min.y-dx*ff; pp[1]=y; pp[2]=z0; - pp[3]=x0-y+Min.y; pp[4]=y; pp[5]=z0; - pp[6]=x0-y+Min.y; pp[7]=y; pp[8]=z0+dz*ff; - if(*TickStl && !f) SelectPen(TickStl); - if(*SubTStl && f) SelectPen(SubTStl); - DrawTick(pp,f!=0); -} -void mglGraph::AxisT(bool text, const char *stl) -{ - mreal pp[3*32]; - wchar_t str[64]; - long i; - mreal z0=GetOrgZ('z'), y, ddx, ddy, ddz; - ddx = dx>=0 ? dx : mgl_okrugl((Min.x-Max.x)/(dx+1),3); - ddy = dy>=0 ? dy : mgl_okrugl((Min.y-Max.y)/(dy+1),3); - ddz = dz>=0 ? dz : mgl_okrugl((Min.z-Max.z)/(dz+1),3); - if(ddx==0) ddx=(Max.x-Min.x)/2; - if(ddy==0) ddy=(Max.y-Min.y)/2; - if(ddz==0) ddz=(Max.z-Min.z)/2; - SelectPen(stl); - - for(i=0;i<31;i++) // ñàìà îñü - { - pp[3*i]=Max.x+(Min.x-Max.x)*i/30.; - pp[3*i+2]=z0; - pp[3*i+1]=Min.y+(Max.y-Min.y)*i/30.; - ScalePoint(pp[3*i],pp[3*i+1],pp[3*i+2]); - } - if(stl[3]) - { - pp[3*31]=Max.x+(Min.x-Max.x)*1.05; - pp[3*31+1]=Min.y+(Max.y-Min.y)*1.05; - pp[3*31+2]=z0; - ScalePoint(pp[3*31],pp[3*31+1],pp[3*31+2]); - curv_plot(32,pp,0); - } - else curv_plot(31,pp,0); - for(i=0;i<31;i++) // ñàìà îñü - { - pp[3*i]=Min.x; - pp[3*i+1]=Max.y+(Min.y-Max.y)*i/30.; - pp[3*i+2]=z0; - ScalePoint(pp[3*i],pp[3*i+1],pp[3*i+2]); - } - if(stl[3]) - { - pp[3*31]=Min.x; pp[3*31+2]=z0; - pp[3*31+1]=Max.y+(Min.y-Max.y)*1.05; - ScalePoint(pp[3*31],pp[3*31+1],pp[3*31+2]); - curv_plot(32,pp,0); - } - else curv_plot(31,pp,0); - - NSy = NSy<0 ? 0 : NSy; - for(y=Min.y;y<=Max.y+(Max.y-Min.y)*1e-6;y+=ddy) - { - if(y>Min.y && yMin.y && y0) - { - ddy /= (NSy+1); // subticks drawing - for(y=Min.y;y<=Max.y;y+=ddy) - { - DrawTTick(y,Max.x,z0,ddx,ddz,1); - DrawYTick(Max.y+Min.y-y,Min.x,z0,ddx,ddz,1); - } - } -} -//----------------------------------------------------------------------------- -void mglGraph::SetTicks(char dir, mreal d, int ns, mreal org) -{ - if(dir=='x') - { dx = d; NSx = ns; OrgT.x = org; if(xnum) delete []xbuf; xnum=0; } - else if(dir=='y') - { dy = d; NSy = ns; OrgT.y = org; if(ynum) delete []ybuf; ynum=0; } - else if(dir=='z') - { dz = d; NSz = ns; OrgT.z = org; if(znum) delete []zbuf; znum=0; } - else if(dir=='c' || dir=='a') { dc = d; OrgC = org; } -} -//----------------------------------------------------------------------------- -void mglGraph::SetTicksVal(char dir, int n, mreal *val, const wchar_t **lbl) -{ - long len=0; - register int i; - if(dir=='x') - { - if(xnum) delete []xbuf; - if(n<1 || !val || !lbl) { xnum=0; return; } - if(n>50) n=50; - for(i=0;i50) n=50; - for(i=0;i50) n=50; - for(i=0;i50) n=50; - for(i=0;i50) n=50; - for(i=0;i50) n=50; - for(i=0;iSetTicksVal(dir,n,v,l); - va_end(ap); - delete []v; free(l); -} -//----------------------------------------------------------------------------- -void mglGraph::adjust(char dir, mreal d) -{ - mreal n; - d = fabs(d); n = floor(log10(d)); d = floor(d*pow(10,-n)); - if(d<4) SetTicks(dir,0.5*pow(10,n),4,0); - else if(d<7)SetTicks(dir,pow(10,n),4,0); - else SetTicks(dir,2*pow(10,n),3,0); -} -bool mgl_islog(mreal a, mreal b) -{ return (a>0 && b>10*a) || (b<0 && a<10*b); } -void mglGraph::AdjustTicks(const char *dir) -{ - if(strchr(dir,'x') || strchr(dir,'X')) - { if(fx && mgl_islog(Min.x,Max.x)) SetTicks ('x',0); else adjust('x',Max.x-Min.x); } - if(strchr(dir,'y') || strchr(dir,'Y')) - { if(fy && mgl_islog(Min.y,Max.y)) SetTicks ('y',0); else adjust('y',Max.y-Min.y); } - if(strchr(dir,'z') || strchr(dir,'Z')) - { if(fz && mgl_islog(Min.z,Max.z)) SetTicks ('z',0); else adjust('z',Max.z-Min.z); } - if(strchr(dir,'c') || strchr(dir,'C') || strchr(dir,'a') || strchr(dir,'A')) - { if(fa && mgl_islog(Cmin,Cmax)) SetTicks ('c',0); else adjust('c',Cmax-Cmin); } - TuneTicks = true; -} -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_c.cpp b/mgl/mgl_c.cpp deleted file mode 100644 index 902c7b0..0000000 --- a/mgl/mgl_c.cpp +++ /dev/null @@ -1,490 +0,0 @@ -/*************************************************************************** - * mgl_c.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 "mgl/mgl_ab.h" -#include "mgl/mgl_c.h" -//----------------------------------------------------------------------------- -/// Delete mglGraph object. MUST be called for each mgl_create_* call. -void mgl_delete_graph(HMGL gr) -{ if(gr) delete gr; } -//----------------------------------------------------------------------------- -/// Create mglData object. -HMDT mgl_create_data() -{ return new mglData(); }; -/// Create mglData object with specified sizes. -HMDT mgl_create_data_size(int nx, int ny, int nz) -{ return new mglData(nx,ny,nz); }; -/// Create mglData object from data file. -HMDT mgl_create_data_file(const char *fname) -{ return new mglData(fname); }; -/// Delete mglData object. MUST be called for each mgl_create_data_* call. -void mgl_delete_data(HMDT dat) -{ if(dat) delete dat; }; -//----------------------------------------------------------------------------- -// Setup mglGraph -//----------------------------------------------------------------------------- -/// Set color in mglGraph::Pal array at index \a n. -void mgl_set_palette(HMGL gr, const char *colors) -{ if(gr) gr->SetPalette(colors); } -/// Set color in mglGraph::Pal array at index \a n. -void mgl_set_pal_color(HMGL gr, int n, mreal r, mreal g, mreal b) -{ if(gr && n<100) gr->Pal[n] = mglColor(r,g,b); } -/// Set number of colors in mglGraph::Pal array. -void mgl_set_pal_num(HMGL gr, int num) -{ if(gr && num<100) gr->NumPal = num; } -/// Set mglGraph::RotatedText. -void mgl_set_rotated_text(HMGL gr, int rotated) -{ gr->RotatedText = rotated; } -/// Set mglGraph::Cut. -void mgl_set_cut(HMGL gr, int cut) -{ gr->Cut = cut; } -/// Set mglGraph::CutMin, mglGraph::CutMax. -void mgl_set_cut_box(HMGL gr, mreal x1,mreal y1,mreal z1,mreal x2,mreal y2,mreal z2) -{ gr->CutMin = mglPoint(x1,y1,z1); gr->CutMax = mglPoint(x2,y2,z2); } -/// Set type of transparency mglGraph::TranspType. -void mgl_set_transp_type(HMGL gr, int type) -{ gr->TranspType = type; } -/// Switch on/off transparency mglGraph::Transparent. -void mgl_set_transp(HMGL gr, int enable) -{ gr->Transparent = enable; } -/// Set width of rectangles in mglGraph::Bars(). -void mgl_set_bar_width(HMGL gr, mreal width) -{ gr->BarWidth = width; } -/// Set size of marks mglGraph::BaseLineWidth. -void mgl_set_base_line_width(HMGL gr, mreal size) -{ gr->BaseLineWidth = size; } -/// Set size of marks mglGraph::MarkSize. -void mgl_set_mark_size(HMGL gr, mreal size) -{ gr->MarkSize = size; } -/// Set size of arrows mglGraph::ArrowSize. -void mgl_set_arrow_size(HMGL gr, mreal size) -{ gr->ArrowSize = size; } -/// Set default font size mglGraph::FontSize. -void mgl_set_font_size(HMGL gr, mreal size) -{ gr->FontSize = size; } -/// Set default alpha value mglGraph::AlphaDef. -void mgl_set_alpha_default(HMGL gr, mreal alpha) -{ gr->AlphaDef = alpha; } -/// Set size of frame in pixels. Normally this function is called internaly. -void mgl_set_size(HMGL gr, int width, int height) -{ gr->SetSize(width,height); } -/// Set rotation direction -void mgl_set_axial_dir(HMGL gr, char dir) -{ gr->AxialDir = dir; } -/// Set number of lines in mesh -void mgl_set_meshnum(HMGL gr, int num) -{ gr->MeshNum = num; } -/// Switch on/off face drawing -void mgl_set_draw_face(HMGL gr, int enable) -{ gr->DrawFace = enable; } -/// Set color scheme -void mgl_set_scheme(HMGL gr, const char *sch) -{ gr->SetScheme((sch && sch[0]) ? sch : "BbcyrR"); } -/// Set font facename -void mgl_load_font(HMGL gr, const char *name, const char *path) -{ gr->GetFont()->Load(name,path); } -/// Copy font data from another HMGL object -void mgl_copy_font(HMGL gr, HMGL gr_from) -{ gr->GetFont()->Copy(gr_from->GetFont()); } -/// Restore font data -void mgl_restore_font(HMGL gr) -{ gr->GetFont()->Restore(); } -//----------------------------------------------------------------------------- -// Export to file -//----------------------------------------------------------------------------- -/// Write the frame in file using PostScript format -void mgl_write_eps(HMGL gr, const char *fname,const char *descr) -{ gr->WriteEPS(fname,descr); } -/// Write the frame in file using ScalableVectorGraphics format -void mgl_write_svg(HMGL gr, const char *fname,const char *descr) -{ gr->WriteSVG(fname,descr); } -void mgl_show_image(HMGL gr, const char *viewer, int keep) -{ gr->ShowImage(viewer,keep); } -//----------------------------------------------------------------------------- -// Setup frames transparency (alpha) and lightning -//----------------------------------------------------------------------------- -/// Create new frame. -int mgl_new_frame(HMGL gr) -{ return gr->NewFrame(); } -/// Finish frame drawing -void mgl_end_frame(HMGL gr) -{ gr->EndFrame(); } -/// Get the number of created frames -int mgl_get_num_frame(HMGL gr) -{ return gr->GetNumFrame(); } -/// Reset frames counter -void mgl_reset_frames(HMGL gr) -{ gr->ResetFrames(); } -/// Set the transparency on/off. -void mgl_set_alpha(HMGL gr, int enable) -{ gr->Alpha(enable); } -/// Set the fog distance. -void mgl_set_fog(HMGL gr, mreal d, mreal dz) -{ gr->Fog(d,dz); } -/// Set the using of light on/off. -void mgl_set_light(HMGL gr, int enable) -{ gr->Light(enable); } -/// Set the using of n-th light on/off. -void mgl_set_light_n(HMGL gr, int n, int enable) -{ gr->Light(n, enable); } -/// Add white light source. -void mgl_add_light(HMGL gr, int n, mreal x, mreal y, mreal z, char c) -{ gr->Light(n,mglPoint(x,y,z),c,0.5); } -/// Add a light source with color {r,g,b}. -void mgl_add_light_rgb(HMGL gr, int n, mreal x, mreal y, mreal z, int infty, - mreal r, mreal g, mreal b,mreal i) -{ gr->Light(n,mglPoint(x,y,z),mglColor(r,g,b),i,infty); } -// Set ambient light brightness -void mgl_set_ambbr(HMGL gr, mreal i) -{ gr->Ambient(i); } -//----------------------------------------------------------------------------- -// Scale and rotate -//----------------------------------------------------------------------------- -/// Push transformation matrix into stack. -void mgl_mat_push(HMGL gr) { gr->Push(); } -/// Pop transformation matrix into stack. -void mgl_mat_pop(HMGL gr) { gr->Pop(); } -/// Clear transformation matrix. -void mgl_identity(HMGL gr, int rel) { gr->Identity(rel); } -/// Clear up the frame -void mgl_clf(HMGL gr) { gr->Clf(); } -/// Clear up the frame -void mgl_clf_rgb(HMGL gr, mreal r, mreal g, mreal b){ gr->Clf(mglColor(r,g,b)); } -/// Put further plotting in some region of whole frame surface. -void mgl_subplot(HMGL gr, int nx,int ny,int m) { gr->SubPlot(nx,ny,m); } -void mgl_subplot_d(HMGL gr, int nx,int ny,int m,mreal dx,mreal dy) -{ gr->SubPlot(nx,ny,m,dx,dy); } -void mgl_subplot_s(HMGL gr, int nx,int ny,int m,const char *style) -{ gr->SubPlot(nx,ny,m,style); } -/// Put further plotting in some region of whole frame surface. -void mgl_inplot(HMGL gr, mreal x1,mreal x2,mreal y1,mreal y2) -{ gr->InPlot(x1,x2,y1,y2,false); } -void mgl_relplot(HMGL gr, mreal x1,mreal x2,mreal y1,mreal y2) -{ gr->InPlot(x1,x2,y1,y2,true); } -void mgl_columnplot(HMGL gr, int num, int i) -{ gr->ColumnPlot(num,i); } -void mgl_columnplot_d(HMGL gr, int num, int i, mreal d) -{ gr->ColumnPlot(num,i,d); } -void mgl_stickplot(HMGL gr, int num, int i, mreal tet, mreal phi) -{ gr->StickPlot(num, i, tet, phi); } -/// Set aspect ratio for further plotting. -void mgl_aspect(HMGL gr, mreal Ax,mreal Ay,mreal Az) -{ gr->Aspect(Ax,Ay,Az); } -/// Rotate a further plotting. -void mgl_rotate(HMGL gr, mreal TetX,mreal TetZ,mreal TetY) -{ gr->Rotate(TetX,TetZ,TetY); } -/// Rotate a further plotting around vector {x,y,z}. -void mgl_rotate_vector(HMGL gr, mreal Tet,mreal x,mreal y,mreal z) -{ gr->RotateN(Tet,x,y,z); } -void mgl_perspective(HMGL gr, mreal val) -{ gr->Perspective(val); } -//----------------------------------------------------------------------------- -// Axis functions -//----------------------------------------------------------------------------- -/// Auto adjust ticks -void mgl_adjust_ticks(HMGL gr, const char *dir) -{ gr->AdjustTicks(dir); } -/// Switch on/off ticks tunning and set factor position for tunned ticks. -void mgl_tune_ticks(HMGL gr, int tune, mreal fact_pos) -{ gr->TuneTicks = tune; gr->FactorPos = fact_pos; } -void mgl_set_ticks_dir(HMGL gr, char dir, mreal d, int ns, mreal org) -{ gr->SetTicks(dir, d, ns, org); } -/// Set ticks interval mglGraph::dx, mglGraph::dy, mglGraph::dz. -void mgl_set_ticks(HMGL gr, mreal DX, mreal DY, mreal DZ) -{ gr->dx=DX; gr->dy=DY; gr->dz=DZ; } -/// Set number of subticks mglGraph::NSx, mglGraph::NSy, mglGraph::NSz. -void mgl_set_subticks(HMGL gr, int NX, int NY, int NZ) -{ gr->NSx=NX; gr->NSy=NY; gr->NSz=NZ; } -/// Set the values of mglGraph::Cmin and mglGraph::Cmax -void mgl_set_caxis(HMGL gr, mreal C1,mreal C2) -{ gr->CAxis(C1,C2); } -void mgl_set_crange(HMGL gr, const HMDT a, int add) { gr->CRange(*a,add); } -void mgl_set_xrange(HMGL gr, const HMDT a, int add) { gr->XRange(*a,add); } -void mgl_set_yrange(HMGL gr, const HMDT a, int add) { gr->YRange(*a,add); } -void mgl_set_zrange(HMGL gr, const HMDT a, int add) { gr->ZRange(*a,add); } -/// Safetly set the value for mglGraph::Min, mglGraph::Max and mglGraph::Org members of the class. -void mgl_set_axis(HMGL gr, mreal x1, mreal y1, mreal z1, mreal x2, mreal y2, mreal z2, mreal x0, mreal y0, mreal z0) -{ gr->Axis(mglPoint(x1,y1,z1),mglPoint(x2,y2,z2),mglPoint(x0,y0,z0)); } -/// Safetly set the transformation formulas for coordinate. -void mgl_set_func(HMGL gr, const char *EqX,const char *EqY,const char *EqZ) -{ gr->SetFunc(EqX,EqY,EqZ); } -void mgl_set_func_ext(HMGL gr, const char *EqX,const char *EqY,const char *EqZ,const char *EqA) -{ gr->SetFunc(EqX,EqY,EqZ,EqA); } -/// Set predefined coordinate system -void mgl_set_coor(HMGL gr, int how) { gr->SetCoor(how); } -void mgl_set_cutoff(HMGL gr, const char *EqC) { gr->CutOff(EqC); } -/// Draws bounding box outside the plotting volume by default color. -void mgl_box(HMGL gr, int ticks) -{ gr->Box(NC,ticks); } -/// Draws bounding box outside the plotting volume with color \a c. -void mgl_box_str(HMGL gr, const char *col, int ticks) -{ gr->Box(col,ticks); } -/// Draws bounding box outside the plotting volume. -void mgl_box_rgb(HMGL gr, mreal r, mreal g, mreal b, int ticks) -{ gr->Box(mglColor(r,g,b),ticks); } -/// Draw axises with ticks in directions determined by string parameter \a dir. -void mgl_axis(HMGL gr, const char *dir) -{ gr->Axis(dir); } -/// Draw grid lines perpendicular to direction determined by string parameter \a dir. -void mgl_axis_grid(HMGL gr, const char *dir,const char *pen) -{ gr->Grid(dir,pen); } -/// Print the label \a text for axis \a dir. -void mgl_label(HMGL gr, char dir, const char *text) -{ gr->Label(dir, text); } -/// Print the label \a text for axis \a dir. -void mgl_label_ext(HMGL gr, char dir, const char *text, mreal pos, mreal size, mreal shift) -{ gr->Label(dir, text, pos, size, shift); } -void mgl_labelw_ext(HMGL gr, char dir, const wchar_t *text, mreal pos, mreal size, mreal shift) -{ gr->Labelw(dir, text, pos, size, shift); } -void mgl_label_xy(HMGL gr, mreal x, mreal y, const char *text, const char *fnt, mreal size) -{ gr->Label(x,y,text,fnt,size); } -void mgl_labelw_xy(HMGL gr, mreal x, mreal y, const wchar_t *text, const char *fnt, mreal size) -{ gr->Labelw(x,y,text,fnt,size); } -void mgl_set_xttw(HMGL gr, const wchar_t *templ) {gr->SetXTT(templ);} -void mgl_set_yttw(HMGL gr, const wchar_t *templ) {gr->SetYTT(templ);} -void mgl_set_zttw(HMGL gr, const wchar_t *templ) {gr->SetZTT(templ);} -void mgl_set_cttw(HMGL gr, const wchar_t *templ) {gr->SetCTT(templ);} -void mgl_set_xtt(HMGL gr, const char *templ) {gr->SetXTT(templ);} -void mgl_set_ytt(HMGL gr, const char *templ) {gr->SetYTT(templ);} -void mgl_set_ztt(HMGL gr, const char *templ) {gr->SetZTT(templ);} -void mgl_set_ctt(HMGL gr, const char *templ) {gr->SetCTT(templ);} -//----------------------------------------------------------------------------- -// Simple drawing -//----------------------------------------------------------------------------- -/// Draws the red point (ball) at position \a {x,y,z}. -void mgl_ball(HMGL gr, mreal x,mreal y,mreal z) -{ gr->Ball(mglPoint(x,y,z)); } -/// Draws the point (ball) at position \a {x,y,z} with color {r,g,b}. -void mgl_ball_rgb(HMGL gr, mreal x, mreal y, mreal z, mreal r, mreal g, mreal b, mreal alpha) -{ gr->Ball(x,y,z,mglColor(r,g,b),alpha); } -/// Draws the point (ball) at position \a p with color \a col. -void mgl_ball_str(HMGL gr, mreal x, mreal y, mreal z, char col) -{ gr->Ball(mglPoint(x,y,z),col); } -/// Draws the line between points with style \a sch. -void mgl_line(HMGL gr, mreal x1, mreal y1, mreal z1, mreal x2, mreal y2, mreal z2, const char *pen,int n) -{ gr->Line(mglPoint(x1,y1,z1),mglPoint(x2,y2,z2),pen,n); } - -void mgl_facex(HMGL gr, mreal x0, mreal y0, mreal z0, mreal wy, mreal wz, const char *stl, mreal dx, mreal dy) -{ gr->FaceX(x0,y0,z0,wy,wz,stl,dx,dy); } -void mgl_facey(HMGL gr, mreal x0, mreal y0, mreal z0, mreal wx, mreal wz, const char *stl, mreal dx, mreal dy) -{ gr->FaceY(x0,y0,z0,wx,wz,stl,dx,dy); } -void mgl_facez(HMGL gr, mreal x0, mreal y0, mreal z0, mreal wx, mreal wy, const char *stl, mreal dx, mreal dy) -{ gr->FaceZ(x0,y0,z0,wx,wy,stl,dx,dy); } -void mgl_curve(HMGL gr, mreal x1, mreal y1, mreal z1, mreal dx1, mreal dy1, mreal dz1, mreal x2, mreal y2, mreal z2, mreal dx2, mreal dy2, mreal dz2, const char *pen,int n) -{ gr->Curve(mglPoint(x1,y1,z1), mglPoint(dx1,dy1,dz1), mglPoint(x2,y2,z2), mglPoint(dx2,dy2,dz2), pen, n); } - -/// Print string \a str in position \a p with font size \a size. -void mgl_puts(HMGL gr, mreal x, mreal y, mreal z,const char *text) -{ gr->Puts(mglPoint(x,y,z),text); } -/// Print string \a str in position \a p with font size \a size. -void mgl_putsw(HMGL gr, mreal x, mreal y, mreal z,const wchar_t *text) -{ gr->Putsw(mglPoint(x,y,z),text); } -/// Print string \a str in position \a p along direction \a d with font size \a size. -void mgl_puts_dir(HMGL gr, mreal x, mreal y, mreal z, mreal dx, mreal dy, mreal dz, const char *text, mreal size) -{ gr->Puts(mglPoint(x,y,z), mglPoint(dx,dy,dz), text, 't', size); } -/// Print string \a str in position \a p along direction \a d with font size \a size. -void mgl_putsw_dir(HMGL gr, mreal x, mreal y, mreal z, mreal dx, mreal dy, mreal dz, const wchar_t *text, mreal size) -{ gr->Putsw(mglPoint(x,y,z), mglPoint(dx,dy,dz), text, 't', size); } -/// Print unrotated string \a str in position \a p with font size \a size. -void mgl_text(HMGL gr, mreal x, mreal y, mreal z,const char *text) -{ gr->Text(mglPoint(x,y,z),text); } -/// Print string \a str in position \a p with font size \a size. -void mgl_puts_ext(HMGL gr, mreal x, mreal y, mreal z,const char *text,const char *font,mreal size,char dir) -{ gr->Puts(mglPoint(x,y,z),text,font,size,dir); } -/// Print string \a str in position \a p with font size \a size. -void mgl_putsw_ext(HMGL gr, mreal x, mreal y, mreal z,const wchar_t *text,const char *font,mreal size,char dir) -{ gr->Putsw(mglPoint(x,y,z),text,font,size,dir); } -/// Print unrotated string \a str in position \a p with font size \a size. -void mgl_text_ext(HMGL gr, mreal x, mreal y, mreal z,const char *text,const char *font,mreal size,char dir) -{ gr->Text(mglPoint(x,y,z),text,font,size,dir); } -/// Draw colorbar at edge of axis -void mgl_colorbar(HMGL gr, const char *sch,int where) -{ gr->Colorbar(sch,where); } -void mgl_colorbar_ext(HMGL gr, const char *sch,int where, mreal x, mreal y, mreal w, mreal h) -{ gr->Colorbar(sch,where,x,y,w,h); } -void mgl_colorbar_val(HMGL gr, const HMDT val, const char *sch,int where) -{ gr->Colorbar(*val,sch,where); } -/// Plot data depending on its dimensions and \a type parameter -void mgl_simple_plot(HMGL gr, const HMDT a, int type, const char *sch) -{ if(gr && a) gr->SimplePlot(*a,type,sch); } -//----------------------------------------------------------------------------- -// Plot legend drawing -//----------------------------------------------------------------------------- -/// Add string to legend -void mgl_add_legend(HMGL gr, const char *text,const char *style) -{ if(gr) gr->AddLegend(text,style); } -/// Add string to legend -void mgl_add_legendw(HMGL gr, const wchar_t *text,const char *style) -{ if(gr) gr->AddLegend(text,style); } -/// Clear saved legend string -void mgl_clear_legend(HMGL gr) -{ if(gr) gr->ClearLegend(); } -/// Draw legend of accumulated strings at position (x, y) by \a font with \a size -void mgl_legend_xy(HMGL gr, mreal x, mreal y, const char *font, mreal size, mreal llen) -{ if(gr) gr->Legend(x, y, font, size, llen); } -/// Draw legend of accumulated strings by \a font with \a size -void mgl_legend(HMGL gr, int where, const char *font, mreal size, mreal llen) -{ if(gr) gr->Legend(where, font, size, llen); } -void mgl_set_legend_box(HMGL gr, int enable) -{ gr->LegendBox = enable; } -void mgl_set_legend_marks(HMGL gr, int num) -{ gr->SetLegendMarks(num); } -//----------------------------------------------------------------------------- -const unsigned char *mgl_get_rgb(HMGL graph) -{ - mglGraphAB *g = dynamic_cast(graph); - return g ? g->GetBits():0; -} -const unsigned char *mgl_get_rgba(HMGL graph) -{ - mglGraphAB *g = dynamic_cast(graph); - return g ? g->GetRGBA():0; -} -int mgl_get_width(HMGL graph) -{ - mglGraphAB *g = dynamic_cast(graph); - return g ? g->GetWidth():0; -} -int mgl_get_height(HMGL graph) -{ - mglGraphAB *g = dynamic_cast(graph); - return g ? g->GetHeight():0; -} -void mgl_update(HMGL graph) -{ - mglGraphAB *g = dynamic_cast(graph); - if(g) g->Update(); -} -void mgl_set_show_mouse_pos(HMGL gr, int enable) -{ - mglGraphAB *g = dynamic_cast(gr); - if(g) g->ShowMousePos=enable; -} -void mgl_get_last_mouse_pos(HMGL gr, mreal *x, mreal *y, mreal *z) -{ - mglGraphAB *g = dynamic_cast(gr); - if(g) - { *x=g->LastMousePos.x; *y=g->LastMousePos.y; *z=g->LastMousePos.z;} -} -void mgl_calc_xyz(HMGL gr, int xs, int ys, mreal *x, mreal *y, mreal *z) -{ - mglGraphAB *g = dynamic_cast(gr); - if(g && x && y && z) - { - mglPoint p = g->CalcXYZ(xs,ys); - *x = p.x; *y = p.y; *z = p.z; - } -} -void mgl_calc_scr(HMGL gr, mreal x, mreal y, mreal z, int *xs, int *ys) -{ - mglGraphAB *g = dynamic_cast(gr); - if(g && xs && ys) g->CalcScr(mglPoint(x,y,z),xs,ys); -} -//----------------------------------------------------------------------------- -void mgl_wnd_set_delay(HMGL gr, mreal dt) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->Delay = dt; } -void mgl_wnd_set_auto_clf(HMGL gr, int val) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->AutoClf = val; } -void mgl_wnd_set_show_mouse_pos(HMGL gr, int val) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->ShowMousePos = val; } -void mgl_wnd_set_clf_update(HMGL gr, int val) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->ClfOnUpdate = val; } -void mgl_wnd_toggle_alpha(HMGL gr) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->ToggleAlpha(); } -void mgl_wnd_toggle_light(HMGL gr) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->ToggleLight(); } -void mgl_wnd_toggle_zoom(HMGL gr) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->ToggleZoom(); } -void mgl_wnd_toggle_rotate(HMGL gr) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->ToggleRotate(); } -void mgl_wnd_toggle_no(HMGL gr) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->ToggleNo(); } -void mgl_wnd_update(HMGL gr) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->Update(); } -void mgl_wnd_reload(HMGL gr, int o) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->ReLoad(o); } -void mgl_wnd_adjust(HMGL gr) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->Adjust(); } -void mgl_wnd_next_frame(HMGL gr) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->NextFrame(); } -void mgl_wnd_prev_frame(HMGL gr) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->PrevFrame(); } -void mgl_wnd_animation(HMGL gr) -{ mglGraphAB *g = dynamic_cast(gr); if(g) g->Animation(); } -//----------------------------------------------------------------------------- -mreal mgl_data_get_value(const HMDT d, int i, int j, int k) -{ return d->a[i+d->nx*(j+d->ny*k)]; } -void mgl_data_set_value(HMDT d, mreal v, int i, int j, int k) -{ d->a[i+d->nx*(j+d->ny*k)] = v; } -//----------------------------------------------------------------------------- -/// Zoom in/out a part of picture -void mgl_set_zoom(HMGL gr, mreal x1, mreal y1, mreal x2, mreal y2) -{ gr->Zoom(x1,y1,x2,y2); } -void mgl_set_plotfactor(HMGL gr, mreal val) -{ gr->SetPlotFactor(val); } -void mgl_set_axis_3d(HMGL gr, mreal x1, mreal y1, mreal z1, mreal x2, mreal y2, mreal z2) -{ gr->Axis(mglPoint(x1,y1,z1),mglPoint(x2,y2,z2)); } -void mgl_set_axis_2d(HMGL gr, mreal x1, mreal y1, mreal x2, mreal y2) -{ gr->Axis(mglPoint(x1,y1),mglPoint(x2,y2)); } -void mgl_set_origin(HMGL gr, mreal x0, mreal y0, mreal z0) -{ gr->Org = mglPoint(x0,y0,z0); } -void mgl_set_tick_origin(HMGL gr, mreal x0, mreal y0, mreal z0) -{ gr->OrgT = mglPoint(x0,y0,z0); } -//----------------------------------------------------------------------------- -void mgl_title(HMGL gr, const char *text, const char *fnt, mreal size) -{ gr->Title(text, fnt,size); } -void mgl_titlew(HMGL gr, const wchar_t *text, const char *fnt, mreal size) -{ gr->Title(text, fnt,size); } -//----------------------------------------------------------------------------- -void mgl_set_ternary(HMGL gr, int enable) -{ gr->Ternary(enable); } -void mgl_sphere(HMGL gr, mreal x, mreal y, mreal z, mreal r, const char *stl) -{ gr->Sphere(mglPoint(x,y,z),r,stl); } -void mgl_drop(HMGL gr, mreal x1, mreal y1, mreal z1, mreal x2, mreal y2, mreal z2, mreal r, const char *stl, mreal shift, mreal ap) -{ gr->Drop(mglPoint(x1,y1,z1),mglPoint(x2,y2,z2),r,stl,shift,ap); } -void mgl_cone(HMGL gr, mreal x1, mreal y1, mreal z1, mreal x2, mreal y2, mreal z2, mreal r1, mreal r2, const char *stl, int edge) -{ gr->Cone(mglPoint(x1,y1,z1),mglPoint(x2,y2,z2),r1,r2,stl,edge); } -void mgl_set_def_param(HMGL gr) { gr->DefaultPlotParam(); } -void mgl_set_font_def(HMGL gr, const char *fnt) -{ strncpy(gr->FontDef, fnt, 31); } -void mgl_flush(HMGL gr) { gr->Flush(); } -void mgl_data_fill_eq(HMGL gr, HMDT dat, const char *eq, const HMDT vdat, const HMDT wdat) -{ dat->Fill(eq, gr->Min, gr->Max, vdat, wdat); } -void mgl_set_ticks_vals(HMGL gr, char dir, int n, mreal *val, const char **lbl) -{ gr->SetTicksVal(dir,n,val,lbl); } -//----------------------------------------------------------------------------- -#include -int mgl_fortran_func(HMGL gr, void *f) -{ - typedef int (*func_draw)(uintptr_t *gr); - func_draw draw = func_draw(f); - static uintptr_t p = uintptr_t(gr); - int res = draw(&p); - return res; -} -//----------------------------------------------------------------------------- -void mgl_set_auto(HMGL gr, mreal x1, mreal x2, mreal y1, mreal y2, mreal z1, mreal z2) -{ gr->SetAutoRanges(x1,x2,y1,y2,z1,z2); } -void mgl_set_tick_len(HMGL gr, mreal len, mreal stt) -{ gr->SetTickLen(len,stt); } -void mgl_set_tick_stl(HMGL gr, const char *stl, const char *sub) -{ gr->SetTickStl(stl,sub); } -int mgl_get_warn(HMGL gr) { return gr->WarnCode; } -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_combi.cpp b/mgl/mgl_combi.cpp deleted file mode 100644 index 2a90561..0000000 --- a/mgl/mgl_combi.cpp +++ /dev/null @@ -1,605 +0,0 @@ -/*************************************************************************** - * mgl_combi.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "mgl/mgl.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -//----------------------------------------------------------------------------- -// -// DensX, DensY, DensZ series -// -//----------------------------------------------------------------------------- -void mglGraph::DensX(const mglData &a, const char *sch,mreal sVal) -{ - register long i,j,i0,k,n=a.nx,m=a.ny; - mglColor col; - if(isnan(sVal)) sVal = GetOrgX('x'); - if(a.nx<2 || a.ny<2) { SetWarn(mglWarnLow,"DensX"); return; } - if(sValMax.x){ SetWarn(mglWarnSlc,"DensX"); return; } - static int cgid=1; StartGroup("DensX",cgid++); - SetScheme(sch); - mreal *b = a.a, d; - bool bb = false; - if(a.nz>1) - { - bb = true; - n = a.nz; - d = (a.nx-1)*(sVal - Min.x)/(Max.x - Min.x); - k = long(d); d = d - k; - b = new mreal[n*m]; - if(d>0) for(i=0;i1) delete []b; - delete []pp; delete []cc; if(bb) delete []b; -} -//----------------------------------------------------------------------------- -void mglGraph::DensY(const mglData &a, const char *sch,mreal sVal) -{ - register long i,j,i0,k,n=a.nx,m=a.ny; - mglColor col; - if(isnan(sVal)) sVal = GetOrgY('y'); - if(a.nx<2 || a.ny<2) { SetWarn(mglWarnLow,"DensY"); return; } - if(sValMax.y){ SetWarn(mglWarnSlc,"DensY"); return; } - static int cgid=1; StartGroup("DensY",cgid++); - SetScheme(sch); - mreal *b = a.a, d; - bool bb = false; - if(a.nz>1) - { - bb = true; - m = a.nz; - d = (a.ny-1)*(sVal - Min.y)/(Max.y - Min.y); - k = long(d); d = d - k; - b = new mreal[n*m]; - if(d>0) for(i=0;i1) delete []b; - delete []pp; delete []cc; if(bb) delete []b; -} -//----------------------------------------------------------------------------- -void mglGraph::DensZ(const mglData &a, const char *sch,mreal sVal) -{ - register long i,j,i0,k,n=a.nx,m=a.ny; - mglColor col; - if(isnan(sVal)) sVal = GetOrgZ('z'); - if(a.nx<2 || a.ny<2) { SetWarn(mglWarnLow,"DensZ"); return; } - if(sValMax.z){ SetWarn(mglWarnSlc,"DensZ"); return; } - static int cgid=1; StartGroup("DensZ",cgid++); - SetScheme(sch); - mreal *b = a.a, d; - bool bb = false; - if(a.nz>1) - { - bb = true; - d = (a.nz-1)*(sVal - Min.z)/(Max.y - Min.z); - k = long(d); d = d - k; - b = new mreal[n*m]; - if(d>0) for(i=0;i1) delete []b; - delete []pp; delete []cc; if(bb) delete []b; -} -//----------------------------------------------------------------------------- -// -// ContX, ContY, ContZ series -// -//----------------------------------------------------------------------------- -void mglGraph::ContX(const mglData &z, const char *sch, mreal zVal, int Num) -{ - if(Num<1) { SetWarn(mglWarnCnt,"ContX"); return; } - mglData v(Num); - for(long i=0;iMax.x){ SetWarn(mglWarnSlc,"ContX"); return; } - static int cgid=1; StartGroup("ContX",cgid++); - long text=0; - if(sch && strchr(sch,'t')) text=-1; - if(sch && strchr(sch,'T')) text=+1; - SetScheme(sch); - mreal *b = a.a, d; - bool bb = false; - if(a.nz>1) - { - bb = true; - n = a.nz; - d = (a.ny-1)*(sVal - Min.x)/(Max.x - Min.x); - k = long(d); d = d - k; - b = new mreal[n*m]; - if(d>0) for(j=0;j1) delete []b; - delete []xx; delete []yy; delete []zz; if(bb) delete []b; -} -//----------------------------------------------------------------------------- -void mglGraph::ContY(const mglData &v, const mglData &a, const char *sch, mreal sVal) -{ - register long i,j,k,n=a.nx,m=a.ny; - mglColor col; - if(isnan(sVal)) sVal = GetOrgY('y'); - if(a.nx<2 || a.ny<2) { SetWarn(mglWarnLow,"ContY"); return; } - if(sValMax.y){ SetWarn(mglWarnSlc,"ContY"); return; } - static int cgid=1; StartGroup("ContY",cgid++); - long text=0; - if(sch && strchr(sch,'t')) text=-1; - if(sch && strchr(sch,'T')) text=+1; - SetScheme(sch); - mreal *b = a.a, d; - bool bb = false; - if(a.nz>1) - { - bb = true; - m = a.nz; - d = (a.ny-1)*(sVal - Min.y)/(Max.y - Min.y); - k = long(d); d = d - k; - b = new mreal[n*m]; - if(d>0) for(i=0;i1) delete []b; - delete []xx; delete []yy; delete []zz; if(bb) delete []b; -} -//----------------------------------------------------------------------------- -void mglGraph::ContZ(const mglData &v, const mglData &a, const char *sch, mreal sVal) -{ - register long i,j,k,n=a.nx,m=a.ny; - mglColor col; - if(isnan(sVal)) sVal = GetOrgZ('z'); - if(a.nx<2 || a.ny<2) { SetWarn(mglWarnLow,"ContZ"); return; } - if(sValMax.z){ SetWarn(mglWarnSlc,"ContZ"); return; } - static int cgid=1; StartGroup("ContZ",cgid++); - long text=0; - if(sch && strchr(sch,'t')) text=-1; - if(sch && strchr(sch,'T')) text=+1; - SetScheme(sch); - mreal *b = a.a, d; - bool bb = false; - if(a.nz>1) - { - bb = true; - d = (a.nz-1)*(sVal - Min.z)/(Max.y - Min.z); - k = long(d); d = d - k; - b = new mreal[n*m]; - if(d>0) for(i=0;i1) delete []b; - delete []xx; delete []yy; delete []zz; if(bb) delete []b; -} -//----------------------------------------------------------------------------- -// -// ContFX, ContFY, ContFZ series -// -//----------------------------------------------------------------------------- -void mglGraph::ContFX(const mglData &z, const char *sch, mreal zVal, int Num) -{ - if(Num<1) { SetWarn(mglWarnCnt,"ContFX"); return; } - mglData v(Num); - for(long i=0;iMax.x){ SetWarn(mglWarnSlc,"ContFX"); return; } - static int cgid=1; StartGroup("ContFX",cgid++); - SetScheme(sch); - mreal *b = a.a, d; - bool bb = false; - if(a.nz>1) - { - bb = true; - n = a.nz; - d = (a.ny-1)*(sVal - Min.x)/(Max.x - Min.x); - k = long(d); d = d - k; - b = new mreal[n*m]; - if(d>0) for(j=0;j1) delete []b; - delete []xx; delete []yy; delete []zz; if(bb) delete []b; -} -//----------------------------------------------------------------------------- -void mglGraph::ContFY(const mglData &v, const mglData &a, const char *sch, mreal sVal) -{ - register long i,j,k,n=a.nx,m=a.ny; - mglColor col; - if(isnan(sVal)) sVal = GetOrgY('y'); - if(a.nx<2 || a.ny<2) { SetWarn(mglWarnLow,"ContFY"); return; } - if(sValMax.y){ SetWarn(mglWarnSlc,"ContFY"); return; } - static int cgid=1; StartGroup("ContFY",cgid++); - SetScheme(sch); - mreal *b = a.a, d; - bool bb = false; - if(a.nz>1) - { - bb = true; - m = a.nz; - d = (a.ny-1)*(sVal - Min.y)/(Max.y - Min.y); - k = long(d); d = d - k; - b = new mreal[n*m]; - if(d>0) for(i=0;i1) delete []b; - delete []xx; delete []yy; delete []zz; if(bb) delete []b; -} -//----------------------------------------------------------------------------- -void mglGraph::ContFZ(const mglData &v, const mglData &a, const char *sch, mreal sVal) -{ - register long i,j,k,n=a.nx,m=a.ny; - mglColor col; - if(isnan(sVal)) sVal = GetOrgZ('z'); - if(a.nx<2 || a.ny<2) { SetWarn(mglWarnLow,"ContFZ"); return; } - if(sValMax.z){ SetWarn(mglWarnSlc,"ContFZ"); return; } - static int cgid=1; StartGroup("ContFZ",cgid++); - SetScheme(sch); - mreal *b = a.a, d; - bool bb = false; - if(a.nz>1) - { - bb = true; - d = (a.nz-1)*(sVal - Min.z)/(Max.y - Min.z); - k = long(d); d = d - k; - b = new mreal[n*m]; - if(d>0) for(i=0;i1) delete []b; - delete []xx; delete []yy; delete []zz; if(bb) delete []b; -} -//----------------------------------------------------------------------------- -// Combined plotting functions -//----------------------------------------------------------------------------- -/// Draw density plot for data a at x = sVal -void mgl_dens_x(HMGL gr, const HMDT a, const char *sch, mreal sVal) -{ if(gr && a) gr->DensX(*a, sch, sVal); } -/// Draw density plot for data a at y = sVal -void mgl_dens_y(HMGL gr, const HMDT a, const char *sch, mreal sVal) -{ if(gr && a) gr->DensY(*a, sch, sVal); } -/// Draw density plot for data a at z = sVal -void mgl_dens_z(HMGL gr, const HMDT a, const char *sch, mreal sVal) -{ if(gr && a) gr->DensZ(*a, sch, sVal); } -/// Draw several contour plots for data a at x = sVal -void mgl_cont_x(HMGL gr, const HMDT a, const char *sch, mreal sVal, int Num) -{ if(gr && a) gr->ContX(*a, sch, sVal, Num); } -/// Draw several contour plots for data a at y = sVal -void mgl_cont_y(HMGL gr, const HMDT a, const char *sch, mreal sVal, int Num) -{ if(gr && a) gr->ContY(*a, sch, sVal, Num); } -/// Draw several contour plots for data a at z = sVal -void mgl_cont_z(HMGL gr, const HMDT a, const char *sch, mreal sVal, int Num) -{ if(gr && a) gr->ContZ(*a, sch, sVal, Num); } -/// Draw contour plots for data a at x = sVal -void mgl_cont_x_val(HMGL gr, const HMDT v, const HMDT a, const char *sch, mreal sVal) -{ if(gr && a && v) gr->ContX(*v, *a, sch, sVal); } -/// Draw contour plots for data a at y = sVal -void mgl_cont_y_val(HMGL gr, const HMDT v, const HMDT a, const char *sch, mreal sVal) -{ if(gr && a && v) gr->ContY(*v, *a, sch, sVal); } -/// Draw contour plots for data a at z = sVal -void mgl_cont_z_val(HMGL gr, const HMDT v, const HMDT a, const char *sch, mreal sVal) -{ if(gr && a && v) gr->ContZ(*v, *a, sch, sVal); } -/// Draw several contour plots for data a at x = sVal -void mgl_contf_x(HMGL gr, const HMDT a, const char *sch, mreal sVal, int Num) -{ if(gr && a) gr->ContFX(*a, sch, sVal, Num); } -/// Draw several contour plots for data a at y = sVal -void mgl_contf_y(HMGL gr, const HMDT a, const char *sch, mreal sVal, int Num) -{ if(gr && a) gr->ContFY(*a, sch, sVal, Num); } -/// Draw several contour plots for data a at z = sVal -void mgl_contf_z(HMGL gr, const HMDT a, const char *sch, mreal sVal, int Num) -{ if(gr && a) gr->ContFZ(*a, sch, sVal, Num); } -/// Draw contour plots for data a at x = sVal -void mgl_contf_x_val(HMGL gr, const HMDT v, const HMDT a, const char *sch, mreal sVal) -{ if(gr && a && v) gr->ContFX(*v, *a, sch, sVal); } -/// Draw contour plots for data a at y = sVal -void mgl_contf_y_val(HMGL gr, const HMDT v, const HMDT a, const char *sch, mreal sVal) -{ if(gr && a && v) gr->ContFY(*v, *a, sch, sVal); } -/// Draw contour plots for data a at z = sVal -void mgl_contf_z_val(HMGL gr, const HMDT v, const HMDT a, const char *sch, mreal sVal) -{ if(gr && a && v) gr->ContFZ(*v, *a, sch, sVal); } -//----------------------------------------------------------------------------- -// Combined plotting functions (Fortran) -//----------------------------------------------------------------------------- -/// Draw density plot for data a at x = *sVal -void mgl_dens_x_(uintptr_t *gr, uintptr_t *a, const char *sch, mreal *sVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->DensX(_D_(a), s, *sVal); - delete []s; -} -/// Draw density plot for data a at y = *sVal -void mgl_dens_y_(uintptr_t *gr, uintptr_t *a, const char *sch, mreal *sVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->DensY(_D_(a), s, *sVal); - delete []s; -} -/// Draw density plot for data a at z = *sVal -void mgl_dens_z_(uintptr_t *gr, uintptr_t *a, const char *sch, mreal *sVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->DensZ(_D_(a), s, *sVal); - delete []s; -} -/// Draw several contour plots for data a at x = *sVal -void mgl_cont_x_(uintptr_t *gr, uintptr_t *a, const char *sch, mreal *sVal, int *Num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->ContX(_D_(a), s, *sVal, *Num); - delete []s; -} -/// Draw several contour plots for data a at y = *sVal -void mgl_cont_y_(uintptr_t *gr, uintptr_t *a, const char *sch, mreal *sVal, int *Num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->ContY(_D_(a), s, *sVal, *Num); - delete []s; -} -/// Draw several contour plots for data a at z = *sVal -void mgl_cont_z_(uintptr_t *gr, uintptr_t *a, const char *sch, mreal *sVal, int *Num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->ContZ(_D_(a), s, *sVal, *Num); - delete []s; -} -/// Draw contour plots for data a at x = *sVal -void mgl_cont_x_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, mreal *sVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && v) _GR_->ContX(_D_(v), _D_(a), s, *sVal); - delete []s; -} -/// Draw contour plots for data a at y = *sVal -void mgl_cont_y_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, mreal *sVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && v) _GR_->ContY(_D_(v), _D_(a), s, *sVal); - delete []s; -} -/// Draw contour plots for data a at z = *sVal -void mgl_cont_z_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, mreal *sVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && v) _GR_->ContZ(_D_(v), _D_(a), s, *sVal); - delete []s; -} -/// Draw several contour plots for data a at x = *sVal -void mgl_contf_x_(uintptr_t *gr, uintptr_t *a, const char *sch, mreal *sVal, int *Num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->ContFX(_D_(a), s, *sVal, *Num); - delete []s; -} -/// Draw several contour plots for data a at y = *sVal -void mgl_contf_y_(uintptr_t *gr, uintptr_t *a, const char *sch, mreal *sVal, int *Num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->ContFY(_D_(a), s, *sVal, *Num); - delete []s; -} -/// Draw several contour plots for data a at z = *sVal -void mgl_contf_z_(uintptr_t *gr, uintptr_t *a, const char *sch, mreal *sVal, int *Num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->ContFZ(_D_(a), s, *sVal, *Num); - delete []s; -} -/// Draw contour plots for data a at x = *sVal -void mgl_contf_x_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, mreal *sVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && v) _GR_->ContFX(_D_(v), _D_(a), s, *sVal); - delete []s; -} -/// Draw contour plots for data a at y = *sVal -void mgl_contf_y_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, mreal *sVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && v) _GR_->ContFY(_D_(v), _D_(a), s, *sVal); - delete []s; -} -/// Draw contour plots for data a at z = *sVal -void mgl_contf_z_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, mreal *sVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && v) _GR_->ContFZ(_D_(v), _D_(a), s, *sVal); - delete []s; -} -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_cont.cpp b/mgl/mgl_cont.cpp deleted file mode 100644 index 23ff742..0000000 --- a/mgl/mgl_cont.cpp +++ /dev/null @@ -1,1343 +0,0 @@ -/*************************************************************************** - * mgl_cont.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 - -#include "mgl/mgl.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -//----------------------------------------------------------------------------- -struct _mgl_slice -{ - mreal *x,*y,*z,*a; - long nx,ny; - _mgl_slice() { x=y=z=a=NULL; nx=ny=0; }; - ~_mgl_slice() - { if(a) { delete []x; delete []y; delete []z; delete []a; } }; -}; -//----------------------------------------------------------------------------- -// -// Cont series -// -//----------------------------------------------------------------------------- -long mglGraph::add_cpoint(long &pc,mreal **p,mreal **k,bool **t, - mreal x,mreal y,mreal z,mreal k1,mreal k2,bool scale) -{ - static long pMax=0; - if(*p==NULL) - { - pMax = 100; pc = 0; - *p = (mreal *)malloc(3*pMax*sizeof(mreal)); - *k = (mreal *)malloc(2*pMax*sizeof(mreal)); - *t = (bool *)malloc(pMax*sizeof(bool)); - } - if(scale) t[0][pc] = ScalePoint(x,y,z); - p[0][3*pc] = x; p[0][3*pc+1] = y; p[0][3*pc+2] = z; - k[0][2*pc] = k1; k[0][2*pc+1] = k2; - pc++; - if(pc>=pMax) - { - pMax += 100; - *p = (mreal *)realloc(*p,3*pMax*sizeof(mreal)); - *k = (mreal *)realloc(*k,2*pMax*sizeof(mreal)); - *t = (bool *)realloc(*t,pMax*sizeof(bool)); - } - return pc; -} -//----------------------------------------------------------------------------- -void mglGraph::cont_plot(mreal val,long n,long m,mreal *a, - mreal *x,mreal *y,mreal *z,mreal zdef,bool axial,bool wire,int text) -{ - mreal *pp=NULL,*kk=NULL,xx,yy,zz,d,kx,ky; - bool *tt=NULL; - long pc=0; - long *nn,*ff; - register long i,j,k,i0; - - if(a==NULL || n<2 || m<2) return; - if(isnan(zdef)) zdef = Min.z; - // add intersection point of isoline and Y axis - for(i=0;i=0 && d<1) - { - kx = i+d; ky = j; - xx = x[i0]+(x[i0+1]-x[i0])*d; - yy = y[i0]+(y[i0+1]-y[i0])*d; - zz = z ? z[i0]+(z[i0+1]-z[i0])*d : zdef; - add_cpoint(pc,&pp,&kk,&tt,xx,yy,zz,kx,ky,!axial); - } - } - // add intersection point of isoline and X axis - for(i=0;i0 && d<1) - { - kx = i; ky = j+d; - xx = x[i0]+(x[i0+n]-x[i0])*d; - yy = y[i0]+(y[i0+n]-y[i0])*d; - zz = z ? z[i0]+(z[i0+n]-z[i0])*d : zdef; - add_cpoint(pc,&pp,&kk,&tt,xx,yy,zz,kx,ky,!axial); - } - } - // deallocate arrays and finish if no point - if(pc==0) { free(kk); free(pp); free(tt); return; } - // allocate arrays for curve - nn = new long[pc]; ff = new long[pc]; - for(i=0;i=0) - { - kx = kk[2*j]; ky = kk[2*j+1]; i = -1; - i11 = long(kx); i12 = long(kx-1e-10); - j11 = long(ky); j12 = long(ky-1e-10); - for(k=0;k=0); - - if(text) - { - wchar_t wcs[64]; - mglprintf(wcs,64,L"%4.3g",val); - font_curve(pc,pp,tt,nn,wcs,text,-0.5); - } - if(axial) axial_plot(pc,pp,nn,64,wire); - else curv_plot(pc,pp,tt,nn); - Flush(); free(kk); free(pp); free(tt); - delete []nn; delete []ff; -} -//----------------------------------------------------------------------------- -void mglGraph::Cont(const mglData &v, const mglData &x, const mglData &y, const mglData &z, const char *sch, mreal zVal) -{ - register long i,j,n=z.nx,m=z.ny; - if(x.nx!=z.nx) { SetWarn(mglWarnDim,"Cont"); return; } - if(z.nx<2 || z.ny<2){ SetWarn(mglWarnLow,"Cont"); return; } - if(y.nx!=z.ny && (x.ny!=z.ny || y.nx!=z.nx || y.ny!=z.ny)) - { SetWarn(mglWarnDim, "Cont"); return; } - static int cgid=1; StartGroup("Cont",cgid++); - - long text=0; - if(sch && strchr(sch,'t')) text=-1; - if(sch && strchr(sch,'T')) text=+1; - SelectPen(sch); - SetScheme(sch); - // x, y -- ìàòðèöû êàê è z - if(x.nx*x.ny==m*n && y.nx*y.ny==m*n) - { - for(i=0;i1) - zVal = Min.z+(Max.z-Min.z)*mreal(j)/(z.nz-1); - Color(v.a[i]); - cont_plot(v.a[i],n,m,z.a+j*m*n,x.a+j*m*n,y.a+j*m*n, - NULL,isnan(zVal) ? v.a[i] : zVal,false,false,text); - } - } - // x, y -- âåêòîðà - else - { - mreal *xx,*yy; - xx = new mreal[n*m]; yy = new mreal[n*m]; - for(i=0;i1) - zVal = Min.z+(Max.z-Min.z)*mreal(j)/(z.nz-1); - Color(v.a[i]); - cont_plot(v.a[i],n,m,z.a+j*m*n,xx,yy,NULL, - isnan(zVal) ? v.a[i] : zVal,false,false,text); - } - delete []xx; delete []yy; - } - EndGroup(); - if(sch && strchr(sch,'#')) - { - if(!isnan(zVal)) Grid(x,y,z,"k",zVal); - else Mesh(x,y,z); - } - SetScheme(sch); -} -//----------------------------------------------------------------------------- -void mglGraph::Cont(const mglData &v, const mglData &z, const char *sch, mreal zVal) -{ - if(z.nx<2 || z.ny<2) { SetWarn(mglWarnLow,"Cont"); return; } - mglData x(z.nx), y(z.ny); - x.Fill(Min.x,Max.x); - y.Fill(Min.y,Max.y); - Cont(v,x,y,z,sch,zVal); -} -//----------------------------------------------------------------------------- -void mglGraph::Cont(const mglData &x, const mglData &y, const mglData &z, const char *sch, int Num, mreal zVal) -{ - if(Num<1) { SetWarn(mglWarnCnt,"Cont"); return; } - mglData v(Num); - for(long i=0;i=Max) - { - Max += 256; - *p = (mreal *)realloc(*p,Max*12*sizeof(mreal)); - } - memcpy((*p) + 12*Cur, pq, 12*sizeof(mreal)); - Cur++; - return Cur; -} -//----------------------------------------------------------------------------- -mreal mgl_get(long i0,long n,mreal *x,mreal px,mreal py) -{ - return x[i0]*(1+py*px-py-px)+x[i0+n]*py*(1-px)+x[i0+1]*px*(1-py)+x[i0+n+1]*py*px; -// return x[i0] + px*py*(x[i0]-x[i0+1]+x[i0+n+1]-x[i0+n]) + px*(x[i0+1]-x[i0]) + py*(x[i0+n]-x[i0]); -} -//----------------------------------------------------------------------------- -void mglGraph::contf_plot(mreal v1, mreal v2,long n,long m,mreal *a, - mreal *x,mreal *y,mreal *z,mreal zdef) -{ - mreal *pp=NULL,ps[18],px[12],py[12],d; - bool *tt; - register long i,j,k,i0,l,h=0; - for(i=0;i= v1 && a[i0]<=v2) { px[k]=0; py[k]=0; k++; } - d = _d(v1,a[i0],a[i0+1]); if(d>=0 && d<1) { px[k]=d; py[k]=0; k++; } - d = _d(v2,a[i0],a[i0+1]); if(d>=0 && d<1) { px[k]=d; py[k]=0; k++; } - if(a[i0+1]>= v1 && a[i0+1]<=v2) { px[k]=1; py[k]=0; k++; } - d = _d(v1,a[i0+1],a[i0+1+n]); if(d>=0 && d<1) { px[k]=1; py[k]=d; k++; } - d = _d(v2,a[i0+1],a[i0+1+n]); if(d>=0 && d<1) { px[k]=1; py[k]=d; k++; } - if(a[i0+1+n]>= v1 && a[i0+1+n]<=v2) { px[k]=1; py[k]=1; k++; } - d = _d(v1,a[i0+n],a[i0+1+n]); if(d>=0 && d<1) { px[k]=d; py[k]=1; k++; } - d = _d(v2,a[i0+n],a[i0+1+n]); if(d>=0 && d<1) { px[k]=d; py[k]=1; k++; } - if(a[i0+n]>= v1 && a[i0+n]<=v2) { px[k]=0; py[k]=1; k++; } - d = _d(v1,a[i0],a[i0+n]); if(d>=0 && d<1) { px[k]=0; py[k]=d; k++; } - d = _d(v2,a[i0],a[i0+n]); if(d>=0 && d<1) { px[k]=0; py[k]=d; k++; } - for(l=0;l<6;l++) - { - ps[3*l] = mgl_get(i0,n,x,px[l],py[l]); - ps[3*l+1] = mgl_get(i0,n,y,px[l],py[l]); - ps[3*l+2] = z!=0?mgl_get(i0,n,z,px[l],py[l]):zdef; - } - switch(k) - { - case 3: - memcpy(ps+9,ps+6,3*sizeof(mreal)); -// ps[9] *= 1+1e-4; - h=mgl_add_quad(&pp,ps); break; - case 4: - h=mgl_add_quad(&pp,ps); break; - case 5: - h=mgl_add_quad(&pp,ps); - memcpy(ps+3,ps,3*sizeof(mreal)); - memcpy(ps+6,ps,3*sizeof(mreal)); -// ps[3] = ps[3]*(1+1e-5); - h=mgl_add_quad(&pp,ps+3); - break; - case 6: - h=mgl_add_quad(&pp,ps); - memcpy(ps+6,ps,3*sizeof(mreal)); - h=mgl_add_quad(&pp,ps+6); break; - } - } - if(h<1) return; - tt = new bool[4*h]; - for(i=0;i1) - zVal = Min.z+(Max.z-Min.z)*mreal(j)/(z.nz-1); - Color(v.a[i]); - contf_plot(v.a[i],v.a[i+1],n,m,z.a+j*m*n,x.a+j*m*n,y.a+j*m*n, - NULL,isnan(zVal) ? v.a[i] : zVal); - } - } - // x, y -- âåêòîðà - else - { - mreal *xx,*yy; - xx = new mreal[n*m]; yy = new mreal[n*m]; - for(i=0;i1) - zVal = Min.z+(Max.z-Min.z)*mreal(j)/(z.nz-1); - Color(v.a[i]); - contf_plot(v.a[i],v.a[i+1],n,m,z.a+j*m*n,xx,yy,NULL, - isnan(zVal) ? v.a[i] : zVal); - } - delete []xx; delete []yy; - } - EndGroup(); -} -//----------------------------------------------------------------------------- -void mglGraph::ContF(const mglData &v, const mglData &z, const char *sch, mreal zVal) -{ - if(z.nx<2 || z.ny<2) { SetWarn(mglWarnLow,"ContF"); return; } - mglData x(z.nx), y(z.ny); - x.Fill(Min.x,Max.x); - y.Fill(Min.y,Max.y); - ContF(v,x,y,z,sch,zVal); -} -//----------------------------------------------------------------------------- -void mglGraph::ContF(const mglData &x, const mglData &y, const mglData &z, const char *sch, - int Num, mreal zVal) -{ - if(Num<1) { SetWarn(mglWarnCnt,"ContF"); return; } - mglData v(Num+2); - for(long i=0;i=0;i--) for(k=0;k=0;i--) for(k=0;k=0) x.Fill(Min.x,Max.x); - else x.Fill(0,Max.x); - y.Fill(Min.y,Max.y); - Axial(v,x,y,z,sch); -} -//----------------------------------------------------------------------------- -void mglGraph::Axial(const mglData &x, const mglData &y, const mglData &z, const char *sch, int Num) -{ - if(Num<1) { SetWarn(mglWarnCnt,"Axial"); return; } - mglData v(Num); - for(long i=0;i15 && s.ny>15) - { - for(i=0;i<10;i++) for(j=0;j<10;j++) // ñîçäàåì ìàññèâ òî÷åê - { - i0 = ((s.nx-1)*i/9)+s.nx*((s.ny-1)*j/9); - i1 = i+10*j; - pp[3*i1+0] = s.x[i0]; - pp[3*i1+1] = s.y[i0]; - pp[3*i1+2] = s.z[i0]; - tt[i1] = ScalePoint(pp[3*i1+0],pp[3*i1+1],pp[3*i1+2]); - } - s.nx = s.ny = 10; - } - else - { - for(i=0;iCont3(*v, *x, *y, *z, *a, dir, sVal, sch); } -/// Draw contour lines at slice for 3d data -void mgl_cont3_val(HMGL gr, const HMDT v, const HMDT a, char dir, int sVal, const char *sch) -{ if(gr && a && v) gr->Cont3(*v, *a, dir, sVal, sch); } -/// Draw several contour lines at slice for 3d data specified parametrically -void mgl_cont3_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *sch, int Num) -{ if(gr && a && x && y && z) gr->Cont3(*x, *y, *z, *a, dir, sVal, sch, Num); } -/// Draw several contour lines at slice for 3d data -void mgl_cont3(HMGL gr, const HMDT a, char dir, int sVal, const char *sch, int Num) -{ if(gr && a) gr->Cont3(*a, dir, sVal, sch, Num); } -/// Draw contour lines at central slices for 3d data specified parametrically -void mgl_cont_all_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *sch, int Num) -{ if(gr && a && x && y && z) gr->ContA(*x, *y, *z, *a, sch, Num); } -/// Draw contour lines at central slices for 3d data -void mgl_cont_all(HMGL gr, const HMDT a, const char *sch, int Num) -{ if(gr && a) gr->ContA(*a, sch, Num); } -//----------------------------------------------------------------------------- -/// Draw contour lines for 2d data specified parametrically -void mgl_cont_xy_val(HMGL gr, const HMDT v, const HMDT x, const HMDT y, const HMDT a, const char *sch, mreal zVal) -{ if(gr && a && x && y && v) gr->Cont(*v, *x, *y, *a, sch, zVal); } -/// Draw contour lines for 2d data -void mgl_cont_val(HMGL gr, const HMDT v, const HMDT a, const char *sch,mreal zVal) -{ if(gr && a && v) gr->Cont(*v, *a, sch, zVal); } -/// Draw several contour lines for 2d data specified parametrically -void mgl_cont_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT a, const char *sch, int Num, mreal zVal) -{ if(gr && a && x && y) gr->Cont(*x, *y, *a, sch, Num, zVal); } -/// Draw several contour lines for 2d data -void mgl_cont(HMGL gr, const HMDT a, const char *sch, int Num, mreal zVal) -{ if(gr && a) gr->Cont(*a, sch, Num, zVal); } -//----------------------------------------------------------------------------- -/// Draw grid lines for density plot at slice for 3d data specified parametrically -void mgl_grid3_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *sch) -{ if(gr && a && x && y && z) gr->Grid3(*x, *y, *z, *a, dir, sVal, sch); } -/// Draw grid lines for density plot at slice for 3d data -void mgl_grid3(HMGL gr, const HMDT a, char dir, int sVal, const char *sch) -{ if(gr && a) gr->Grid3(*a, dir, sVal, sch); } -/// Draw grid lines for density plot at central slices for 3d data specified parametrically -void mgl_grid3_all_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *sch) -{ if(gr && a && x && y && z) gr->GridA(*x, *y, *z, *a, sch); } -/// Draw grid lines for density plot at central slices for 3d data -void mgl_grid3_all(HMGL gr, const HMDT a, const char *sch) -{ if(gr && a) gr->GridA(*a, sch); } -//----------------------------------------------------------------------------- -/// Draw density plot at slice for 3d data specified parametrically -void mgl_dens3_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *sch) -{ if(gr && a && x && y && z) gr->Dens3(*x, *y, *z, *a, dir, sVal, sch); } -/// Draw density plot at slice for 3d data -void mgl_dens3(HMGL gr, const HMDT a, char dir, int sVal, const char *sch) -{ if(gr && a) gr->Dens3(*a, dir, sVal, sch); } -/// Draw density plot at central slices for 3d data specified parametrically -void mgl_dens3_all_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *sch) -{ if(gr && a && x && y && z) gr->DensA(*x, *y, *z, *a, sch); } -/// Draw density plot at central slices for 3d data -void mgl_dens3_all(HMGL gr, const HMDT a, const char *sch) -{ if(gr && a) gr->DensA(*a, sch); } -//----------------------------------------------------------------------------- -/// Draw axial-symmetric isosurfaces for 2d data specified parametrically -void mgl_axial_xy_val(HMGL gr, const HMDT v, const HMDT x, const HMDT y, const HMDT a, const char *sch) -{ if(gr && a && x && y && v) gr->Axial(*v, *x, *y, *a, sch); } -/// Draw axial-symmetric isosurfaces for 2d data -void mgl_axial_val(HMGL gr, const HMDT v, const HMDT a, const char *sch) -{ if(gr && a && v) gr->Axial(*v, *a, sch); } -/// Draw several axial-symmetric isosurfaces for 2d data specified parametrically -void mgl_axial_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT a, const char *sch, int Num) -{ if(gr && a && x && y) gr->Axial(*x, *y, *a, sch, Num); } -/// Draw several axial-symmetric isosurfaces for 2d data -void mgl_axial(HMGL gr, const HMDT a, const char *sch, int Num) -{ if(gr && a) gr->Axial(*a, sch, Num); } -//----------------------------------------------------------------------------- -/// Draw solid contours at slice for 3d data specified parametrically -void mgl_contf3_xyz_val(HMGL gr, const HMDT v, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *sch) -{ if(gr && a && x && y && z && v) gr->ContF3(*v, *x, *y, *z, *a, dir, sVal, sch); } -/// Draw solid contours at slice for 3d data -void mgl_contf3_val(HMGL gr, const HMDT v, const HMDT a, char dir, int sVal, const char *sch) -{ if(gr && a && v) gr->ContF3(*v, *a, dir, sVal, sch); } -/// Draw several solid contours at slice for 3d data specified parametrically -void mgl_contf3_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, char dir, int sVal, const char *sch, int Num) -{ if(gr && a && x && y && z) gr->ContF3(*x, *y, *z, *a, dir, sVal, sch, Num); } -/// Draw several solid contours at slice for 3d data -void mgl_contf3(HMGL gr, const HMDT a, char dir, int sVal, const char *sch, int Num) -{ if(gr && a) gr->ContF3(*a, dir, sVal, sch, Num); } -/// Draw solid contours at central slices for 3d data specified parametrically -void mgl_contf_all_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, - const char *sch, int Num) -{ if(gr && a && x && y && z) gr->ContFA(*x, *y, *z, *a, sch, Num); } -/// Draw solid contours at central slices for 3d data -void mgl_contf_all(HMGL gr, const HMDT a, const char *sch, int Num) -{ if(gr && a) gr->ContFA(*a, sch, Num); } -//----------------------------------------------------------------------------- -/// Draw solid contours for 2d data specified parametrically -void mgl_contf_xy_val(HMGL gr, const HMDT v, const HMDT x, const HMDT y, const HMDT a, const char *sch, mreal zVal) -{ if(gr && a && x && y && v) gr->ContF(*v, *x, *y, *a, sch, zVal); } -/// Draw solid contours for 2d data -void mgl_contf_val(HMGL gr, const HMDT v, const HMDT a, const char *sch,mreal zVal) -{ if(gr && a && v) gr->ContF(*v, *a, sch, zVal); } -/// Draw several solid contours for 2d data specified parametrically -void mgl_contf_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT a, const char *sch, int Num, mreal zVal) -{ if(gr && a && x && y) gr->ContF(*x, *y, *a, sch, Num, zVal); } -/// Draw several solid contours for 2d data -void mgl_contf(HMGL gr, const HMDT a, const char *sch, int Num, mreal zVal) -{ if(gr && a) gr->ContF(*a, sch, Num, zVal); } -//----------------------------------------------------------------------------- -/// Draw solid contours for 2d data specified parametrically -void mgl_contd_xy_val(HMGL gr, const HMDT v, const HMDT x, const HMDT y, const HMDT a, const char *sch, mreal zVal) -{ if(gr && a && x && y && v) gr->ContD(*v, *x, *y, *a, sch, zVal); } -/// Draw solid contours for 2d data -void mgl_contd_val(HMGL gr, const HMDT v, const HMDT a, const char *sch,mreal zVal) -{ if(gr && a && v) gr->ContD(*v, *a, sch, zVal); } -/// Draw several solid contours for 2d data specified parametrically -void mgl_contd_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT a, const char *sch, int Num, mreal zVal) -{ if(gr && a && x && y) gr->ContD(*x, *y, *a, sch, Num, zVal); } -/// Draw several solid contours for 2d data -void mgl_contd(HMGL gr, const HMDT a, const char *sch, int Num, mreal zVal) -{ if(gr && a) gr->ContD(*a, sch, Num, zVal); } -//----------------------------------------------------------------------------- -/// Print string \a text auintptr_t curve in 3D with font size \a size. -void mgl_text_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z,const char *text, - const char *font, mreal size) -{ if(gr && x && y && z) gr->Text(*x,*y,*z,text,font,size); } -/// Print string \a text auintptr_t parametrical curve with font size \a size. -void mgl_text_xy(HMGL gr, const HMDT x, const HMDT y, const char *text, const char *font, mreal size) -{ if(gr && x && y) gr->Text(*x,*y,text,font,size); } -/// Print string \a text auintptr_t curve with font size \a size. -void mgl_text_y(HMGL gr, const HMDT y, const char *text, const char *font, mreal size) -{ if(gr && y) gr->Text(*y,text,font,size); } -//----------------------------------------------------------------------------- -// Fortran interface -//----------------------------------------------------------------------------- -/// Draw contour lines at slice for 3d data specified parametrically -void mgl_cont3_xyz_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, - int *sVal, const char *sch,int,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && z && v) _GR_->Cont3(_D_(v), _D_(x), _D_(y), _D_(z), _D_(a), *dir, *sVal, s); - delete []s; -} -/// Draw contour lines at slice for 3d data -void mgl_cont3_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *dir, int *sVal, const char *sch,int,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && v) _GR_->Cont3(_D_(v), _D_(a), *dir, *sVal, s); - delete []s; -} -/// Draw several contour lines at slice for 3d data specified parametrically -void mgl_cont3_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, int *sVal, - const char *sch, int *Num,int,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && z) _GR_->Cont3(_D_(x), _D_(y), _D_(z), _D_(a), *dir, *sVal, s, *Num); - delete []s; -} -/// Draw several contour lines at slice for 3d data -void mgl_cont3_(uintptr_t *gr, uintptr_t *a, const char *dir, int *sVal, const char *sch, int *Num,int,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Cont3(_D_(a), *dir, *sVal, s, *Num); - delete []s; -} -/// Draw contour lines at central slices for 3d data specified parametrically -void mgl_cont_all_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch, int *Num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && z) _GR_->ContA(_D_(x), _D_(y), _D_(z), _D_(a), s, *Num); - delete []s; -} -/// Draw contour lines at central slices for 3d data -void mgl_cont_all_(uintptr_t *gr, uintptr_t *a, const char *sch, int *Num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->ContA(_D_(a), s, *Num); - delete []s; -} -//----------------------------------------------------------------------------- -/// Draw contour lines for 2d data specified parametrically -void mgl_cont_xy_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && v) _GR_->Cont(_D_(v), _D_(x), _D_(y), _D_(a), s, *zVal); - delete []s; -} -/// Draw contour lines for 2d data -void mgl_cont_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch,mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && v) _GR_->Cont(_D_(v), _D_(a), s, *zVal); - delete []s; -} -/// Draw several contour lines for 2d data specified parametrically -void mgl_cont_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, int *Num, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y) _GR_->Cont(_D_(x), _D_(y), _D_(a), s, *Num, *zVal); - delete []s; -} -/// Draw several contour lines for 2d data -void mgl_cont_(uintptr_t *gr, uintptr_t *a, const char *sch, int *Num, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Cont(_D_(a), s, *Num, *zVal); - delete []s; -} -//----------------------------------------------------------------------------- -/// Draw grid lines for density plot at slice for 3d data specified parametrically -void mgl_grid3_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, int *sVal, const char *sch,int,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && z) _GR_->Grid3(_D_(x), _D_(y), _D_(z), _D_(a), *dir, *sVal, s); - delete []s; -} -/// Draw grid lines for density plot at slice for 3d data -void mgl_grid3_(uintptr_t *gr, uintptr_t *a, const char *dir, int *sVal, const char *sch,int,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Grid3(_D_(a), *dir, *sVal, s); - delete []s; -} -/// Draw grid lines for density plot at central slices for 3d data specified parametrically -void mgl_grid3_all_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && z) _GR_->GridA(_D_(x), _D_(y), _D_(z), _D_(a), s); - delete []s; -} -/// Draw grid lines for density plot at central slices for 3d data -void mgl_grid3_all_(uintptr_t *gr, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->GridA(_D_(a), s); - delete []s; -} -//----------------------------------------------------------------------------- -/// Draw density plot at slice for 3d data specified parametrically -void mgl_dens3_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, int *sVal, const char *sch,int,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && z) _GR_->Dens3(_D_(x), _D_(y), _D_(z), _D_(a), *dir, *sVal, s); - delete []s; -} -/// Draw density plot at slice for 3d data -void mgl_dens3_(uintptr_t *gr, uintptr_t *a, const char *dir, int *sVal, const char *sch,int,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Dens3(_D_(a), *dir, *sVal, s); - delete []s; -} -/// Draw density plot at central slices for 3d data specified parametrically -void mgl_dens3_all_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && z) _GR_->DensA(_D_(x), _D_(y), _D_(z), _D_(a), s); - delete []s; -} -/// Draw density plot at central slices for 3d data -void mgl_dens3_all_(uintptr_t *gr, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->DensA(_D_(a), s); - delete []s; -} -//----------------------------------------------------------------------------- -/// Draw axial-symmetric isosurfaces for 2d data specified parametrically -void mgl_axial_xy_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && v) _GR_->Axial(_D_(v), _D_(x), _D_(y), _D_(a), s); - delete []s; -} -/// Draw axial-symmetric isosurfaces for 2d data -void mgl_axial_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && v) _GR_->Axial(_D_(v), _D_(a), s); - delete []s; -} -/// Draw several axial-symmetric isosurfaces for 2d data specified parametrically -void mgl_axial_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, int *Num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y) _GR_->Axial(_D_(x), _D_(y), _D_(a), s, *Num); - delete []s; -} -/// Draw several axial-symmetric isosurfaces for 2d data -void mgl_axial_(uintptr_t *gr, uintptr_t *a, const char *sch, int *Num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->Axial(_D_(a), s, *Num); - delete []s; -} -//----------------------------------------------------------------------------- -/// Draw solid contours at slice for 3d data specified parametrically -void mgl_contf3_xyz_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, - const char *dir, int *sVal, const char *sch,int,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && z && v) _GR_->ContF3(_D_(v), _D_(x), _D_(y), _D_(z), _D_(a), *dir, *sVal, s); - delete []s; -} -/// Draw solid contours at slice for 3d data -void mgl_contf3_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *dir, int *sVal, const char *sch,int,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && v) _GR_->ContF3(_D_(v), _D_(a), *dir, *sVal, s); - delete []s; -} -/// Draw several solid contours at slice for 3d data specified parametrically -void mgl_contf3_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, - const char *dir, int *sVal, const char *sch, int *Num,int,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && z) _GR_->ContF3(_D_(x), _D_(y), _D_(z), _D_(a), *dir, *sVal, s, *Num); - delete []s; -} -/// Draw several solid contours at slice for 3d data -void mgl_contf3_(uintptr_t *gr, uintptr_t *a, const char *dir, int *sVal, const char *sch, int *Num,int,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->ContF3(_D_(a), *dir, *sVal, s, *Num); - delete []s; -} -/// Draw solid contours at central slices for 3d data specified parametrically -void mgl_contf_all_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, - const char *sch, int *Num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && z) _GR_->ContFA(_D_(x), _D_(y), _D_(z), _D_(a), s, *Num); - delete []s; -} -/// Draw solid contours at central slices for 3d data -void mgl_contf_all_(uintptr_t *gr, uintptr_t *a, const char *sch, int *Num,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->ContFA(_D_(a), s, *Num); - delete []s; -} -//----------------------------------------------------------------------------- -/// Draw solid contours for 2d data specified parametrically -void mgl_contf_xy_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && v) _GR_->ContF(_D_(v), _D_(x), _D_(y), _D_(a), s, *zVal); - delete []s; -} -/// Draw solid contours for 2d data -void mgl_contf_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch,mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && v) _GR_->ContF(_D_(v), _D_(a), s, *zVal); - delete []s; -} -/// Draw several solid contours for 2d data specified parametrically -void mgl_contf_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, int *Num, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y) _GR_->ContF(_D_(x), _D_(y), _D_(a), s, *Num, *zVal); - delete []s; -} -/// Draw several solid contours for 2d data -void mgl_contf_(uintptr_t *gr, uintptr_t *a, const char *sch, int *Num, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->ContF(_D_(a), s, *Num, *zVal); - delete []s; -} -//----------------------------------------------------------------------------- -/// Draw solid contours for 2d data specified parametrically -void mgl_contd_xy_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y && v) _GR_->ContD(_D_(v), _D_(x), _D_(y), _D_(a), s, *zVal); - delete []s; -} -/// Draw solid contours for 2d data -void mgl_contd_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch,mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && v) _GR_->ContD(_D_(v), _D_(a), s, *zVal); - delete []s; -} -/// Draw several solid contours for 2d data specified parametrically -void mgl_contd_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, int *Num, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && x && y) _GR_->ContD(_D_(x), _D_(y), _D_(a), s, *Num, *zVal); - delete []s; -} -/// Draw several solid contours for 2d data -void mgl_contd_(uintptr_t *gr, uintptr_t *a, const char *sch, int *Num, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->ContD(_D_(a), s, *Num, *zVal); - delete []s; -} -//----------------------------------------------------------------------------- -/// Print string \a text auintptr_t curve in 3D with font size \a size. -void mgl_text_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z,const char *text, - const char *font, mreal *size,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - char *f=new char[n+1]; memcpy(f,font,n); f[n]=0; - if(gr && x && y && z) _GR_->Text(_D_(x),_D_(y), _D_(z), s, f, *size); - delete []s; delete []f; -} -/// Print string \a text auintptr_t parametrical curve with font size \a size. -void mgl_text_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *text, const char *font, mreal *size, int l,int n) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - char *f=new char[n+1]; memcpy(f,font,n); f[n]=0; - if(gr && x && y) _GR_->Text(_D_(x),_D_(y),s,f,*size); - delete []s; delete []f; -} -/// Print string \a text auintptr_t curve with font size \a size. -void mgl_text_y_(uintptr_t *gr, uintptr_t *y, const char *text, const char *font, mreal *size, int l,int n) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - char *f=new char[n+1]; memcpy(f,font,n); f[n]=0; - if(gr && y) _GR_->Text(_D_(y),s,f,*size); - delete []s; delete []f; -} -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_crust.cpp b/mgl/mgl_crust.cpp deleted file mode 100644 index 895d3b3..0000000 --- a/mgl/mgl_crust.cpp +++ /dev/null @@ -1,636 +0,0 @@ -/*************************************************************************** - * mgl_crust.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 -#include "mgl/mgl.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -//----------------------------------------------------------------------------- -// -// TriPlot series -// -//----------------------------------------------------------------------------- -void mglGraph::TriPlot(const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *sch) -{ - long n = x.nx, m = nums.ny; - if(y.nx!=n || z.nx!=n || nums.nx<3) { SetWarn(mglWarnLow,"TriPlot"); return; } - if(a.nx!=m && a.nx!=n) { SetWarn(mglWarnLow,"TriPlot"); return; } - SetScheme(sch); - static int cgid=1; StartGroup("TriPlot",cgid++); - mreal *pp = new mreal[3*n], *cc = new mreal[4*(n>m ? n:m)]; - bool *tt = new bool[n]; - long *nn = new long[3*m]; - mglColor c; - register long i,j,k1,k2,k3; - for(i=0;i=n) continue; - k2 = long(nums.a[3*i+1]+0.1); if(k2<0 || k2>=n) continue; - k3 = long(nums.a[3*i+2]+0.1); if(k3<0 || k3>=n) continue; - nn[3*j]=k1; nn[3*j+1]=k2; nn[3*j+2]=k3; j++; - } - trigs_plot(j,nn,n,pp,cc,tt,sch && strchr(sch,'#'), a.nx==m); - EndGroup(); - delete []pp; delete []tt; delete []cc; delete []nn; -} -//----------------------------------------------------------------------------- -void mglGraph::TriPlot(const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const char *sch) -{ - TriPlot(nums,x,y,z,z,sch); -} -//----------------------------------------------------------------------------- -void mglGraph::TriPlot(const mglData &nums, const mglData &x, const mglData &y, const char *sch, mreal zVal) -{ - if(isnan(zVal)) zVal = Min.z; - mglData z(x.nx); - z.Fill(zVal,zVal); - TriPlot(nums,x,y,z,z,sch); -} -//----------------------------------------------------------------------------- -// -// TriCont series -// -//----------------------------------------------------------------------------- -void mglGraph::tricont_line(mreal val, long i, long k1, long k2, long k3, const mglData &x, const mglData &y, const mglData &z, const mglData &a, mreal zVal) -{ - mreal d1,d2,pp[6]; - mglColor q1,q2,q3; - d1 = _d(val,a.a[k1],a.a[k2]); - d2 = _d(val,a.a[k1],a.a[k3]); - if(d1<0 || d1>1 || d2<0 || d2>1) return; - if(isnan(zVal)) - { - pp[2] = z.a[k1]*(1-d1)+z.a[k2]*d1; - pp[5] = z.a[k1]*(1-d2)+z.a[k3]*d2; - } - else pp[2] = pp[5] = zVal; - - pp[0] = x.a[k1]*(1-d1)+x.a[k2]*d1; - pp[1] = y.a[k1]*(1-d1)+y.a[k2]*d1; - if(!ScalePoint(pp[0],pp[1],pp[2])) return; - pp[3] = x.a[k1]*(1-d2)+x.a[k3]*d2; - pp[4] = y.a[k1]*(1-d2)+y.a[k3]*d2; - if(!ScalePoint(pp[3],pp[4],pp[5])) return; - curv_plot(2,pp,0); -} -//----------------------------------------------------------------------------- -void mglGraph::TriContV(const mglData &v, const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *sch,mreal zVal) -{ - long n = x.nx, m = nums.ny; - if(y.nx!=n || z.nx!=n || nums.nx<3) { SetWarn(mglWarnLow,"TriCont"); return; } - if(a.nx!=m && a.nx!=n) { SetWarn(mglWarnLow,"TriCont"); return; } - SetScheme(sch); - static int cgid=1; StartGroup("TriCont",cgid++); - register long i,k; - long k1,k2,k3; - for(k=0;k=n) continue; - k2 = long(nums.a[3*i+1]+0.1); if(k2<0 || k2>=n) continue; - k3 = long(nums.a[3*i+2]+0.1); if(k3<0 || k3>=n) continue; -// val = isnan(zVal) ? v.a[k] : zVal; - DefColor(GetC(v.a[k])); - tricont_line(v.a[k], i,k1,k2,k3,x,y,z,a,zVal); - tricont_line(v.a[k], i,k2,k1,k3,x,y,z,a,zVal); - tricont_line(v.a[k], i,k3,k2,k1,x,y,z,a,zVal); - } -} -//----------------------------------------------------------------------------- -void mglGraph::TriCont(const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *sch, int Num, mreal zVal) -{ - if(Num<1) { SetWarn(mglWarnCnt,"Cont"); return; } - mglData v(Num); - for(long i=0;i=n) continue; - k2 = long(nums.a[4*i+1]+0.1); if(k2<0 || k2>=n) continue; - k3 = long(nums.a[4*i+2]+0.1); if(k3<0 || k3>=n) continue; - k4 = long(nums.a[4*i+3]+0.1); if(k4<0 || k4>=n) continue; - nn[4*j]=k1; nn[4*j+1]=k2; nn[4*j+2]=k3; nn[4*j+4]=k4; j++; - } - quads_plot(j,nn,n,pp,cc,tt,sch && strchr(sch,'#'), a.nx==m); - EndGroup(); - delete []pp; delete []tt; delete []cc; delete []nn; -} -//----------------------------------------------------------------------------- -void mglGraph::QuadPlot(const mglData &nums, const mglData &x, const mglData &y, const mglData &z, const char *sch) -{ - QuadPlot(nums,x,y,z,z,sch); -} -//----------------------------------------------------------------------------- -void mglGraph::QuadPlot(const mglData &nums, const mglData &x, const mglData &y, const char *sch, mreal zVal) -{ - if(isnan(zVal)) zVal = Min.z; - mglData z(x.nx); - z.Fill(zVal,zVal); - QuadPlot(nums,x,y,z,z,sch); -} -//----------------------------------------------------------------------------- -// -// Dots series -// -//----------------------------------------------------------------------------- -void mglGraph::Dots(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *sch, mreal alpha) -{ - long n = x.nx; - if(y.nx!=n || z.nx!=n || a.nx!=n) { SetWarn(mglWarnDim,"Dots"); return; } - static int cgid=1; StartGroup("Dots",cgid++); - if(alpha<0) alpha = AlphaDef; - if(sch && strchr(sch,'-')) alpha = -alpha; - SetScheme(sch); - alpha /= pow(n,1./3)/CloudFactor/15; - if(alpha>1) alpha = 1; - mglColor c; - -// bool al=Alpha(true); - for(long i=0;i0) - { - nums.Create(3,m); - for(i=0;i<3*m;i++) nums.a[i]=nn[i]; - } - delete []pp; free(nn); return nums; -} -//----------------------------------------------------------------------------- -mglData mglTriangulation(const mglData &x, const mglData &y, mreal er) -{ - mglData z(x.nx); - return mglTriangulation(x,y,z,er); -} -//----------------------------------------------------------------------------- -// -// Crust series -// -//----------------------------------------------------------------------------- -void mglGraph::Crust(const mglData &x, const mglData &y, const mglData &z, const char *sch,mreal er) -{ - if(y.nx!=x.nx || z.nx!=x.nx) { SetWarn(mglWarnDim,"Crust"); return; } - mglData nums=mglTriangulation(x,y,z,er); - TriPlot(nums,x,y,z,sch); -} -//----------------------------------------------------------------------------- -void mglGraph::Crust(const mglData &tr, const char *sch,mreal er) -{ - if(tr.nx<3) { SetWarn(mglWarnLow,"Crust"); return; } - Crust(tr.SubData(0), tr.SubData(1), tr.SubData(2),sch,er); -} -//----------------------------------------------------------------------------- -mreal mgl_dist(const mreal *p1, const mreal *p2) -{ - return (p1[0]-p2[0])*(p1[0]-p2[0])+(p1[1]-p2[1])*(p1[1]-p2[1])+(p1[2]-p2[2])*(p1[2]-p2[2]); -} -mreal mgl_mult(const mreal *p1, const mreal *p2, const mreal *p0) -{ - return (p1[0]-p0[0])*(p2[0]-p0[0])+(p1[1]-p0[1])*(p2[1]-p0[1])+(p1[2]-p0[2])*(p2[2]-p0[2]); -} -//----------------------------------------------------------------------------- -long mgl_insert_trig(long i1,long i2,long i3,long **n) -{ - static long Cur=0,Max=0; - if(i1<0 || i2<0 || i3<0) return Cur; - if(*n==0) - { - Max = 1024; Cur = 0; - *n = (long *)malloc(Max*3*sizeof(long)); - } - if(Cur>=Max) - { - Max += 1024; - *n = (long *)realloc(*n,Max*3*sizeof(long)); - } - long *nn = *n; - register long i,k; - for(k=0;k0) continue; - r = mgl_dist(qq+3*i, qq+3*k1); - if(rr) rm = r; - } - rs += sqrt(rm); - } - rs *= ff/n; rs = rs*rs; - long ind[100], set[100], ii; // indexes of "close" points, flag that it was added and its number - mreal qq[300]; // normalized point coordinates - long k1,k2,k3,m=0; - for(i=0;i0) - { - set[k1]=1; - m = mgl_insert_trig(i,ind[k1],ind[k2],nn); - k1 = k2; - } - m = mgl_insert_trig(i,ind[k1],ind[0],nn); - } - return m; -} -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -#define sqr(a) (a)*(a) -void mgl_add_trig(long i1,long i2,long n,const mreal *pp,long **nn,long *c,long *m,mreal ff,char *tt) -{ - register long i,im=-1,ii=-1; - register mreal cm=2,c2=2,co,fm,f,g=0; - const mreal *p1=pp+3*i1,*p2=pp+3*i2,*pi; - fm =(sqr(p2[0]-p1[0])+sqr(p2[1]-p1[1])+sqr(p2[2]-p1[2])); fm*=4*fm*ff; - for(i=0;i1 || i==i1 || i==i2) continue; // this is other surface - pi = pp+3*i; - co=(pi[0]-p1[0])*(pi[0]-p2[0])+(pi[1]-p1[1])*(pi[1]-p2[1])+(pi[2]-p1[2])*(pi[2]-p2[2]); - f = (sqr(pi[0]-p1[0])+sqr(pi[1]-p1[1])+sqr(pi[2]-p1[2])) * - (sqr(pi[0]-p2[0])+sqr(pi[1]-p2[1])+sqr(pi[2]-p2[2])); - co /= sqrt(f); - if(co0); // try best variant - long k[3]={i1,i2,im}; - if(i20); - long k[3]={i1,i2,im}; - if(i2=*m) // trig is OK -- add it - { - *m+=n; - *nn=(long*)realloc(*nn,(*m)*sizeof(long)); - } - memcpy(nn+3*(*c),k,3*sizeof(long)); *c+=1; tt[im]=1; -printf("Add %ld,%ld,%ld -- %ld of %ld\n",i1,i2,im,*c,n); - mgl_add_trig(i1,im,n,pp,nn,c,m,ff,tt); // parse bound - mgl_add_trig(i2,im,n,pp,nn,c,m,ff,tt); // NOTE: it may require HUGE stack!!! -} -long mgl_crust_new(long n,const mreal *pp,long **nn,mreal ff) -{ - register long i,j,k=0; - register mreal r,rm; - if(ff==0) ff=1; - char *tt=new char[n],ok=1; memset(tt,0,n*sizeof(char)); - long c=0,m=n; - *nn = (long*)malloc(m*sizeof(long)); - - while(ok) - { - j=-1; - for(rm=FLT_MAX,i=0;ir && !tt[i] && i!=k) { j=i; rm = r; } - } -printf("closest -- %ld-%ld of %g\n",k,j,rm); - if(j>0) - { - tt[0]=tt[j]=1; - mgl_add_trig(k,j,n,pp,nn,&c,&m,ff,tt); - } -printf("first iteration done -- %ld of %ld\n",m,n); - ok = 0; - for(i=0;iTriPlot(*nums, *x, *y, *z, *c, sch); } -/// Draw triangle mesh for points in arrays \a x, \a y, \a z. -void mgl_triplot_xyz(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const char *sch) -{ if(gr&&nums&&x&&y&&z) gr->TriPlot(*nums, *x, *y, *z, sch); } -/// Draw triangle mesh for points in arrays \a x, \a y. -void mgl_triplot_xy(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const char *sch, mreal zVal) -{ if(gr&&nums&&x&&y) gr->TriPlot(*nums, *x, *y, sch, zVal); } -/// Draw quad mesh for points in arrays \a x, \a y, \a z. -void mgl_quadplot_xyzc(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *sch) -{ if(gr&&nums&&x&&y&&z&&c) gr->QuadPlot(*nums, *x, *y, *z, *c, sch); } -/// Draw quad mesh for points in arrays \a x, \a y, \a z. -void mgl_quadplot_xyz(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const char *sch) -{ if(gr&&nums&&x&&y&&z) gr->QuadPlot(*nums, *x, *y, *z, sch); } -/// Draw quad mesh for points in arrays \a x, \a y. -void mgl_quadplot_xy(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const char *sch, mreal zVal) -{ if(gr&&nums&&x&&y) gr->QuadPlot(*nums, *x, *y, sch, zVal); } - -/// Draw contours for triangle mesh for points in arrays \a x, \a y, \a z. -void mgl_tricont_xyzcv(HMGL gr, const HMDT v, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *sch, mreal zVal) -{ if(gr&&nums&&x&&y&&z&&c) gr->TriContV(*v, *nums, *x, *y, *z, *c, sch, zVal); } -void mgl_tricont_xyzc(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const HMDT c, const char *sch, int n, mreal zVal) -{ if(gr&&nums&&x&&y&&z&&c) gr->TriCont(*nums, *x, *y, *z, *c, sch, n, zVal); } -/// Draw contours for triangle mesh for points in arrays \a x, \a y, \a z. -void mgl_tricont_xyzv(HMGL gr, const HMDT v, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const char *sch, mreal zVal) -{ if(gr&&nums&&x&&y&&z) gr->TriContV(*v, *nums, *x, *y, *z, sch, zVal); } -void mgl_tricont_xyz(HMGL gr, const HMDT nums, const HMDT x, const HMDT y, const HMDT z, const char *sch, int n, mreal zVal) -{ if(gr&&nums&&x&&y&&z) gr->TriCont(*nums, *x, *y, *z, sch, n, zVal); } - -/// Draw dots in points \a x, \a y, \a z. -void mgl_dots(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const char *sch) -{ if(gr&&x&&y&&z) gr->Dots(*x,*y,*z,sch); } -/// Draw half-transparent dots in points \a x, \a y, \a z. -void mgl_dots_a(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *sch) -{ if(gr&&x&&y&&z) gr->Dots(*x,*y,*z,*a,sch); } -/// Draw dots in points \a tr. -void mgl_dots_tr(HMGL gr, const HMDT tr, const char *sch) -{ if(gr&&tr) gr->Dots(*tr,sch); } -/// Draw power crust for points in arrays \a x, \a y, \a z. -void mgl_crust(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const char *sch, mreal er) -{ if(gr&&x&&y&&z) gr->Crust(*x,*y,*z,sch,er); } -/// Draw power crust for points in arrays \a tr. -void mgl_crust_tr(HMGL gr, const HMDT tr, const char *sch, mreal er) -{ if(gr&&tr) gr->Crust(*tr,sch,er); } -//----------------------------------------------------------------------------- -// Fortran interface -//----------------------------------------------------------------------------- -/// Draw triangle mesh for points in arrays \a x, \a y, \a z and color it by \a c. -void mgl_triplot_xyzc_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && nums && x && y && z && c) - _GR_->TriPlot(_D_(nums), _D_(x), _D_(y), _D_(z), _D_(c), s); - delete []s; -} -/// Draw triangle mesh for points in arrays \a x, \a y, \a z. -void mgl_triplot_xyz_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && nums && x && y && z) _GR_->TriPlot(_D_(nums), _D_(x), _D_(y), _D_(z), s); - delete []s; -} -/// Draw triangle mesh for points in arrays \a x, \a y. -void mgl_triplot_xy_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, const char *sch, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr&&nums&&x&&y) _GR_->TriPlot(_D_(nums), _D_(x), _D_(y), s, *zVal); - delete []s; -} -/// Draw triangle mesh for points in arrays \a x, \a y, \a z and color it by \a c. -void mgl_quadplot_xyzc_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && nums && x && y && z && c) - _GR_->QuadPlot(_D_(nums), _D_(x), _D_(y), _D_(z), _D_(c), s); - delete []s; -} -/// Draw triangle mesh for points in arrays \a x, \a y, \a z. -void mgl_quadplot_xyz_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && nums && x && y && z) _GR_->QuadPlot(_D_(nums), _D_(x), _D_(y), _D_(z), s); - delete []s; -} -/// Draw triangle mesh for points in arrays \a x, \a y. -void mgl_quadplot_xy_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, const char *sch, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr&&nums&&x&&y) _GR_->QuadPlot(_D_(nums), _D_(x), _D_(y), s, *zVal); - delete []s; -} - -/// Draw triangle mesh for points in arrays \a x, \a y, \a z and color it by \a c. -void mgl_tricont_xyzcv_(uintptr_t *gr, uintptr_t *v, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && nums && x && y && z && c) - _GR_->TriContV(_D_(v), _D_(nums), _D_(x), _D_(y), _D_(z), _D_(c), s, *zVal); - delete []s; -} -/// Draw triangle mesh for points in arrays \a x, \a y, \a z. -void mgl_tricont_xyzv_(uintptr_t *gr, uintptr_t *v, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && nums && x && y && z) _GR_->TriContV(_D_(v), _D_(nums), _D_(x), _D_(y), _D_(z), s, *zVal); - delete []s; -} -/// Draw triangle mesh for points in arrays \a x, \a y, \a z and color it by \a c. -void mgl_tricont_xyzc_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, int *n, mreal *zVal, int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && nums && x && y && z && c) - _GR_->TriCont( _D_(nums), _D_(x), _D_(y), _D_(z), _D_(c), s, *n, *zVal); - delete []s; -} -/// Draw triangle mesh for points in arrays \a x, \a y, \a z. -void mgl_tricont_xyz_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, int *n, mreal *zVal, int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && nums && x && y && z) _GR_->TriCont(_D_(nums), _D_(x), _D_(y), _D_(z), s, *n, *zVal); - delete []s; -} - -/// Draw dots in points \a x, \a y, \a z. -void mgl_dots_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && x && y && z) _GR_->Dots(_D_(x),_D_(y),_D_(z),s); - delete []s; -} -/// Draw dots in points \a x, \a y, \a z. -void mgl_dots_a_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && x && y && z) _GR_->Dots(_D_(x),_D_(y),_D_(z),_D_(a),s); - delete []s; -} -/// Draw dots in points \a tr. -void mgl_dots_tr_(uintptr_t *gr, uintptr_t *tr, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && tr) _GR_->Dots(_D_(tr),s); - delete []s; -} -/// Draw power crust for points in arrays \a x, \a y, \a z. -void mgl_crust_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, mreal *er,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && x && y && z) _GR_->Crust(_D_(x),_D_(y),_D_(z),s,*er); - delete []s; -} -/// Draw power crust for points in arrays \a tr. -void mgl_crust_tr_(uintptr_t *gr, uintptr_t *tr, const char *sch, mreal *er,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && tr) _GR_->Crust(_D_(tr),s,*er); - delete []s; -} -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_data.cpp b/mgl/mgl_data.cpp deleted file mode 100644 index 71279e4..0000000 --- a/mgl/mgl_data.cpp +++ /dev/null @@ -1,2076 +0,0 @@ -/*************************************************************************** - * mgl_data.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 -#include "mgl/mgl_data.h" -#include "mgl/mgl_eval.h" - -#ifndef NO_GSL -#include -#include -#include -#endif - -void mglFillP(int x,int y, const mreal *a,int nx,int ny,mreal _p[4][4]); -void mglFillP(int x, const mreal *a,int nx,mreal _p[4]); -void mglFillP5(int x,int y, const mreal *a,int nx,int ny,mreal _p[6][6]); -void mglFillP5(int x, const mreal *a,int nx,mreal _p[6]); -//----------------------------------------------------------------------------- -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; - t = mgl_ipow(x,n/2); t = t*t; - if(n%2==1) t *= x; - return t; -} -//----------------------------------------------------------------------------- -void mglData::Smooth(const char *dirs) -{ - int type = SMOOTH_QUAD_5; - if(strchr(dirs,'0') || strchr(dirs,'1')) return; - if(strchr(dirs,'3')) type = SMOOTH_LINE_3; - if(strchr(dirs,'5')) type = SMOOTH_LINE_5; - Smooth(type, dirs, 0); -} -//----------------------------------------------------------------------------- -void mglData::Smooth(int Type,const char *dirs,mreal delta) -{ - if(Type == SMOOTH_NONE) return; - long i,j,k,i0,nn=nx*ny,d3,d5; - mreal y5,y3,x2y; - mreal *b = new mreal[nx*ny*nz]; - // ����������� �� x - memset(b,0,nx*ny*nz*sizeof(mreal)); - if(nx>4 && strchr(dirs,'x')) - { - for(i=0;i0) b[i0] = mgl_max(a[i0]-delta,mgl_min(a[i0]+delta,b[i0])); - } - memcpy(a,b,nx*ny*nz*sizeof(mreal)); memset(b,0,nx*ny*nz*sizeof(mreal)); - } - if(ny>4 && strchr(dirs,'y')) - { - for(i=0;i0) b[i0] = mgl_max(a[i0]-delta,mgl_min(a[i0]+delta,b[i0])); - } - memcpy(a,b,nx*ny*nz*sizeof(mreal)); memset(b,0,nx*ny*nz*sizeof(mreal)); - } - if(nz>4 && strchr(dirs,'z')) - { - for(i=0;i0) b[i0] = mgl_max(a[i0]-delta,mgl_min(a[i0]+delta,b[i0])); - } - memcpy(a,b,nx*ny*nz*sizeof(mreal)); - } - delete []b; -} -//----------------------------------------------------------------------------- -void mglData::CumSum(const char *dir) -{ - register long i,j,k,i0; - //mglData d; - mreal *b = new mreal[nx*ny*nz]; - memcpy(b,a,nx*ny*nz*sizeof(mreal)); - if(strchr(dir,'z') && nz>1) - { - for(i=0;i1) - { - for(i=0;i1) - { - for(j=0;j1) - { - for(i=0;i1) - { - for(i=0;i1) - { - for(j=0;j1) - { - for(i=0;i1) - { - for(i=0;i1) - { - for(j=0;j1) - { - for(i=0;i1) - { - for(i=0;i1) - { - for(j=0;jnx-1 || y>ny-1 || z>nz-1) - return 0; - if(nz>1 && z!=long(z)) // 3d interpolation - { - kx=long(x); ky=long(y); kz=long(z); - dx = x-kx; dy = y-ky; dz = z-kz; - - i0 = kx+nx*(ky+ny*kz); - b0 = a[i0]*(1-dx-dy+dx*dy) + dx*(1-dy)*a[i0+1] + - dy*(1-dx)*a[i0+nx] + dx*dy*a[i0+nx+1]; - i0 = kx+nx*(ky+ny*(kz+1)); - b1 = a[i0]*(1-dx-dy+dx*dy) + dx*(1-dy)*a[i0+1] + - dy*(1-dx)*a[i0+nx] + dx*dy*a[i0+nx+1]; - b = b0 + dz*(b1-b0); - } - else if(ny>1 && y!=long(y)) // 2d interpolation - { - kx=long(x); ky=long(y); - dx = x-kx; dy=y-ky; - i0 = kx+nx*ky; - b = a[i0]*(1-dx-dy+dx*dy) + dx*(1-dy)*a[i0+1] + - dy*(1-dx)*a[i0+nx] + dx*dy*a[i0+nx+1]; - } - else if(nx>1 && x!=long(x)) // 1d interpolation - { - kx = long(x); - b = a[kx] + (x-kx)*(a[kx+1]-a[kx]); - } - else // no interpolation - { - b = a[long(x+nx*(y+ny*z))]; - } - return b; -} -//----------------------------------------------------------------------------- -mreal mglData::Spline(mreal x,mreal y,mreal z) const -{ - mreal dx,dy,dz; - return Spline3(x,y,z,dx,dy,dz); -} -//----------------------------------------------------------------------------- -mreal mglData::Spline3(mreal x,mreal y,mreal z,mreal &dx,mreal &dy,mreal &dz) const -{ - mreal _p[4][4]; - register long i,j; - register mreal fx=1, fy=1; - long kx=long(x),ky=long(y),kz=long(z); - mreal b=0; - if(x<0 || y<0 || z<0 || x>nx-1 || y>ny-1 || z>nz-1) - return 0; - dx=dy=dz=0; - if(nz>1 && z!=kz) // 3d interpolation - { // TODO: add dx,dy,dz evaluation - mreal b1[4]={0,0,0,0}; - if(kx>nx-2) kx = nx-2; - if(ky>ny-2) ky = ny-2; - if(kz>nz-2) kz = nz-2; - - long kk=1; - if(kz==0) { kk=0; } - else if(nz>3 && kz==nz-2) { kk=2; } - for(long k=0;k<4;k++) - { - mglFillP(kx, ky, a+(kz+k-kk)*nx*ny, nx, ny, _p); - for(i=0,fx=1;i<4;i++) - { - for(j=0,fy=1;j<4;j++) - { b1[k] += fy*fx*_p[i][j]; fy *= y-ky; } - fx *= x-kx; - } - } - mglFillP(kk, b1, nz>3 ? 4:3, _p[0]); - for(i=0,fx=1,b=0;i<4;i++) - { b += fx*_p[0][i]; fx *= z-kz; } - } - else if(ny>1 && y!=ky) // 2d interpolation - { - if(kx>nx-2) kx = nx-2; - if(ky>ny-2) ky = ny-2; - mglFillP(kx, ky, a+kz*nx*ny, nx, ny, _p); - fx = 1; b = 0; - for(i=0;i<4;i++) - { - fy = 1; - for(j=0;j<4;j++) - { - b += fy*fx*_p[i][j]; - dx+= i*fy*fx*_p[i][j]; - dy+= j*fy*fx*_p[i][j]; - fy *= y-ky; - } - fx *= x-kx; - } - dx /= x-kx; dy /= y-ky; - } - else if(nx>1 && x!=kx) // 1d interpolation - { - if(kx>nx-2) kx = nx-2; - mglFillP(kx, a+(ky+ny*kz)*nx, nx, _p[0]); - for(i=0,fx=1,b=0;i<4;i++) - { b += fx*_p[0][i]; dx+= i*fx*_p[0][i]; fx *= x-kx; } - dx /= x-kx; - } - else // no interpolation - b = a[kx+nx*(ky+ny*kz)]; - return b; -} -//----------------------------------------------------------------------------- -void mglFillP(int x,int y, const mreal *a,int nx,int ny,mreal _p[4][4]) -{ - mreal sx[4]={0,0,0,0},sy[4]={0,0,0,0},f[4]={0,0,0,0},d[4]={0,0,0,0}; - if(x<0 || y<0 || x>nx-2 || y>ny-2) - { - memset(_p[0],0,4*sizeof(mreal)); - memset(_p[1],0,4*sizeof(mreal)); - memset(_p[2],0,4*sizeof(mreal)); - memset(_p[3],0,4*sizeof(mreal)); - return; - } - // �������� ������� - f[0]=a[x+nx*y]; f[1]=a[x+nx*(y+1)]; - if(nx>1) { f[2]=a[x+1+nx*y]; f[3]=a[x+1+nx*(y+1)]; } - else { f[2] = f[0]; f[3] = f[1]; } - // ����������� �� x - if(nx>1) - { - if(x==0) - { - sx[0]=a[x+1+y*nx]-a[x+nx*y]; - sx[1]=a[x+1+nx*(y+1)]-a[x+nx*(y+1)]; - } - else - { - sx[0]=(a[x+1+nx*y]-a[x-1+nx*y])/2; - sx[1]=(a[x+1+nx*(y+1)]-a[x-1+nx*(y+1)])/2; - } - } - if(x==nx-2) - { - sx[2]=a[x+1+nx*y]-a[x+nx*y]; - sx[3]=a[x+1+nx*(y+1)]-a[x+nx*(y+1)]; - } - else - { - sx[2]=(a[x+2+nx*y]-a[x+nx*y])/2; - sx[3]=(a[x+2+nx*(y+1)]-a[x+nx*(y+1)])/2; - } - // ����������� �� y - if(y==0) - { - sy[0]=a[x+nx*(y+1)]-a[x+nx*y]; - sy[2]=a[x+1+nx*(y+1)]-a[x+1+nx*y]; - } - else - { - sy[0]=(a[x+nx*(y+1)]-a[x+nx*(y-1)])/2; - sy[2]=(a[x+1+nx*(y+1)]-a[x+1+nx*(y-1)])/2; - } - if(y==ny-2) - { - sy[1]=a[x+nx*(y+1)]-a[x+nx*y]; - sy[3]=a[x+1+nx*(y+1)]-a[x+1+nx*y]; - } - else - { - sy[1]=(a[x+nx*(y+2)]-a[x+nx*y])/2; - sy[3]=(a[x+1+nx*(y+2)]-a[x+1+nx*y])/2; - } - // ������������ ����������� - if(nx>1) - { - // ������ d[0] - if(y==0 && x==0) - d[0]=(a[x+1+nx*(y+1)]-a[x+nx*(y+1)]-a[x+1+nx*y]+a[x+nx*y]); - else if(y==0) - d[0]=(a[x+1+nx*(y+1)]-a[x-1+nx*(y+1)]-a[x+1+nx*y]+a[x-1+nx*y])/2; - else if(x==0) - d[0]=(a[x+1+nx*(y+1)]-a[x+nx*(y+1)]-a[x+1+nx*(y-1)]+a[x+nx*(y-1)])/2; - else - d[0]=(a[x+1+nx*(y+1)]-a[x-1+nx*(y+1)]-a[x+1+nx*(y-1)]+a[x-1+nx*(y-1)])/4; - // ������ d[1] - if(y==ny-2 && x==0) - d[1]=(a[x+1+nx*(y+1)]-a[x+nx*(y+1)]-a[x+1+nx*y]+a[x+nx*y]); - else if(y==ny-2) - d[1]=(a[x+1+nx*(y+1)]-a[x-1+nx*(y+1)]-a[x+1+nx*y]+a[x-1+nx*y])/2; - else if(x==0) - d[1]=(a[x+1+nx*(y+2)]-a[x+nx*(y+2)]-a[x+1+nx*y]+a[x+nx*y])/2; - else - d[1]=(a[x+1+nx*(y+2)]-a[x-1+nx*(y+2)]-a[x+1+nx*y]+a[x-1+nx*y])/4; - // ������ d[2] - if(y==0 && x==nx-2) - d[2]=(a[x+1+nx*(y+1)]-a[x+nx*(y+1)]-a[x+1+nx*y]+a[x+nx*y]); - else if(y==0) - d[2]=(a[x+2+nx*(y+1)]-a[x+nx*(y+1)]-a[x+2+nx*y]+a[x+nx*y])/2; - else if(x==nx-2) - d[2]=(a[x+1+nx*(y+1)]-a[x+nx*(y+1)]-a[x+1+nx*(y-1)]+a[x+nx*(y-1)])/2; - else - d[2]=(a[x+2+nx*(y+1)]-a[x+nx*(y+1)]-a[x+2+nx*(y-1)]+a[x+nx*(y-1)])/4; - // ������ d[3] - if(y==ny-2 && x==nx-2) - d[3]=(a[x+1+nx*(y+1)]-a[x+nx*(y+1)]-a[x+1+nx*y]+a[x+nx*y]); - else if(y==ny-2) - d[3]=(a[x+2+nx*(y+1)]-a[x+nx*(y+1)]-a[x+2+nx*y]+a[x+nx*y])/2; - else if(x==nx-2) - d[3]=(a[x+1+nx*(y+2)]-a[x+nx*(y+2)]-a[x+1+nx*y]+a[x+nx*y])/2; - else - d[3]=(a[x+2+nx*(y+2)]-a[x+nx*(y+2)]-a[x+2+nx*y]+a[x+nx*y])/4; - } - // ��������� ������������ �������� - _p[0][0]=f[0]; _p[1][0]=sx[0]; - _p[2][0]=3*(f[2]-f[0])-2*sx[0]-sx[2]; - _p[3][0]=sx[0]+sx[2]+2*(f[0]-f[2]); - _p[0][1]=sy[0]; _p[1][1]=d[0]; - _p[2][1]=3*(sy[2]-sy[0])-2*d[0]-d[2]; - _p[3][1]=d[0]+d[2]+2*(sy[0]-sy[2]); - _p[0][2]=3*(f[1]-f[0])-2*sy[0]-sy[1]; - _p[1][2]=3*(sx[1]-sx[0])-2*d[0]-d[1]; - _p[2][2]=9*(f[0]-f[1]-f[2]+f[3])+6*(sy[0]-sy[2]+sx[0]-sx[1])+ - 3*(sx[2]-sx[3]+sy[1]-sy[3])+2*(d[1]+d[2])+4*d[0]+d[3]; - _p[3][2]=6*(f[1]+f[2]-f[0]-f[3])+3*(sx[1]-sx[0]+sx[3]-sx[2])+ - 4*(sy[2]-sy[0])+2*(sy[3]-sy[1]-d[0]-d[2])-d[1]-d[3]; - _p[0][3]=2*(f[0]-f[1])+sy[0]+sy[1]; - _p[1][3]=2*(sx[0]-sx[1])+d[0]+d[1]; - _p[2][3]=6*(f[1]+f[2]-f[0]-f[3])+3*(sy[2]-sy[1]+sy[3]-sy[0])+ - 4*(sx[1]-sx[0])+2*(sx[3]-sx[2]-d[0]-d[1])-d[2]-d[3]; - _p[3][3]=d[0]+d[1]+d[2]+d[3]+4*(f[0]-f[1]-f[2]+f[3])+ - 2*(sx[0]-sx[1]+sx[2]-sx[3]+sy[0]-sy[2]+sy[1]-sy[3]); -} -//----------------------------------------------------------------------------- -void mglFillP(int x, const mreal *a,int nx,mreal _p[4]) -{ - if(x<0 || x>nx-2) - { - memset(_p,0,4*sizeof(mreal)); - return; - } - mreal s[2],f[2]; - // �������� ������� - f[0]=a[x]; f[1]=a[x+1]; - // ����������� �� x - if(x==0) s[0]=a[x+1]-a[x]; - else s[0]=(a[x+1]-a[x-1])/2; - if(x==nx-2) s[1]=a[x+1]-a[x]; - else s[1]=(a[x+2]-a[x])/2; - // ��������� ������������ �������� - _p[0]=f[0]; _p[1]=s[0]; - _p[2]=3*(f[1]-f[0])-2*s[0]-s[1]; - _p[3]=s[0]+s[1]+2*(f[0]-f[1]); -} -//----------------------------------------------------------------------------- -void mglData::Crop(int n1,int n2,char dir) -{ - long nn; - register long i,k; - mreal *b; - if(n1<0) n1=0; - switch(dir) - { - case 'x': - n2 = n2>0 ? n2 : nx+n2; - if(n2<0 || n2>=nx || n20 ? n2 : ny+n2; - if(n2<0 || n2>=ny || n20 ? n2 : nz+n2; - if(n2<0 || n2>=nz || n2=0 && k0; - for(x=0;x=0 && k=0 && k0; - for(x=0;x=0 && k1) - { - for(i=0;i1) - { - for(i=0;i1) - { - for(j=0;j1) - { - for(i=0;i c[i+kx*ky*j] ? b[i] : c[i+kx*ky*j]; - } - memcpy(c,b,nx*ny*nz*sizeof(mreal)); kz = 1; - } - if(strchr(dir,'y') && ky>1) - { - for(i=0;i c[i0+kx*j] ? b[i+kx*k] : c[i0+kx*j]; - } - memcpy(c,b,nx*ny*nz*sizeof(mreal)); ky = kz; kz = 1; - } - if(strchr(dir,'x') && kx>1) - { - for(j=0;j c[i+kx*j] ? b[j] : c[i+kx*j]; - } - kx = ky; ky = kz; kz = 1; - } - d.Set(b,kx,ky,kz); - delete []b; delete []c; return d; -} -//----------------------------------------------------------------------------- -mglData mglData::Min(const char *dir) const -{ - register long i,j,k,i0; - long kx=nx,ky=ny,kz=nz; - mreal *b = new mreal[nx*ny*nz]; - mreal *c = new mreal[nx*ny*nz]; - mglData d; - memcpy(c,a,nx*ny*nz*sizeof(mreal)); - if(strchr(dir,'z') && kz>1) - { - for(i=0;i1) - { - for(i=0;i1) - { - for(j=0;j=nx) i=nx; - if(j<0 || j>=ny) j=ny-1; - if(k<0 || k>=nz) k=nz-1; - long i0 = i+nx*(j+ny*k)-1; - mreal x,y,z,dx=nx>1?1/(nx-1.):0,dy=ny>1?1/(ny-1.):0,dz=nz>1?1/(nz-1.):0; - for(;i0>=0;i0--) - { - x = dx*(i0%nx); y = dy*((i0/nx)%ny); z = dz*(i0/(nx*ny)); - if(eq.Calc(x,y,z,a[i0])) break; - } - i = i0%nx; j = (i0/nx)%ny; k = i0/(nx*ny); - return i0=nx) i=-1; - if(j<0 || j>=ny) j=0; - if(k<0 || k>=nz) k=0; - long i0 = i+nx*(j+ny*k)+1; - mreal x,y,z,dx=nx>1?1/(nx-1.):0,dy=ny>1?1/(ny-1.):0,dz=nz>1?1/(nz-1.):0; - for(;i01) - { - for(m=i;m1) - { - for(m=j;m1) - { - for(m=k;m1) - { - gsl_fft_complex_wavetable *wt = gsl_fft_complex_wavetable_alloc(nx); - gsl_fft_complex_workspace *ws = gsl_fft_complex_workspace_alloc(nx); - for(i=0;i1) - { - gsl_fft_complex_wavetable *wt = gsl_fft_complex_wavetable_alloc(ny); - gsl_fft_complex_workspace *ws = gsl_fft_complex_workspace_alloc(ny); - for(i=0;i1) - { - gsl_fft_complex_wavetable *wt = gsl_fft_complex_wavetable_alloc(nz); - gsl_fft_complex_workspace *ws = gsl_fft_complex_workspace_alloc(nz); - for(i=0;i=ny) i0=ny-1; - i0 = i+nx*i0; ff = 1; - if(k=dn+dd) - { ff = 0.5*(k-3.5*dd)/dd; ff=0.5-ff*(3-ff*ff); } - a[2*k] = re.a[i0]*ff; a[2*k+1] = im.a[i0]*ff; - } - gsl_fft_complex_forward(a, 1, 2*dn, wt, ws); - for(k=0;k=nx) i0=nx-1; - i0 += nx*j; ff = 1; - if(k=3*dd) - { ff = 0.5*(k-3.5*dd)/dd; ff=0.5-ff*(3-ff*ff); } - a[2*k] = re.a[i0]*ff; a[2*k+1] = im.a[i0]*ff; - } - gsl_fft_complex_forward(a, 1, 2*dn, wt, ws); - for(k=0;k1) - { - ai = new double[nx]; af = new double[nx]; - dht = gsl_dht_new(nx,0,1); - mm = gsl_sf_bessel_zero_J0(nx+1); - for(i=0;i1) - { - ai = new double[ny]; af = new double[ny]; - dht = gsl_dht_new(ny,0,1); - mm = gsl_sf_bessel_zero_J0(ny+1); - for(i=0;i1) - { - ai = new double[nz]; af = new double[nz]; - dht = gsl_dht_new(nz,0,1); - mm = gsl_sf_bessel_zero_J0(nz+1); - k = nx*ny; for(i=0;i1) - { - wt = gsl_fft_complex_wavetable_alloc(2*nx); - ws = gsl_fft_complex_workspace_alloc(2*nx); - b = new double[4*nx]; - for(i=0;i1) - { - wt = gsl_fft_complex_wavetable_alloc(2*ny); - ws = gsl_fft_complex_workspace_alloc(2*ny); - b = new double[4*ny]; - for(i=0;i1) - { - wt = gsl_fft_complex_wavetable_alloc(2*nz); - ws = gsl_fft_complex_workspace_alloc(2*nz); - b = new double[4*nz]; k = nx*ny; - for(i=0;i1) - { - wt = gsl_fft_complex_wavetable_alloc(2*nx); - ws = gsl_fft_complex_workspace_alloc(2*nx); - b = new double[4*nx]; - for(i=0;i1) - { - wt = gsl_fft_complex_wavetable_alloc(2*ny); - ws = gsl_fft_complex_workspace_alloc(2*ny); - b = new double[4*ny]; - for(i=0;i1) - { - wt = gsl_fft_complex_wavetable_alloc(2*nz); - ws = gsl_fft_complex_workspace_alloc(2*nz); - b = new double[4*nz]; k = nx*ny; - for(i=0;i1) Roll('z',nz/2); - if(strchr(dir,'y') && ny>1) Roll('y',ny/2); - if(strchr(dir,'x') && nx>1) Roll('x',nx/2); -} -//----------------------------------------------------------------------------- -void mglData::Roll(char dir, int num) -{ - register long i,d; - mreal *b; - if(dir=='z' && nz>1) - { - d = num>0 ? num%nz : (num+nz*(1+num/nz))%nz; - if(d==0) return; // nothing to do - b = new mreal[nx*ny*nz]; - memcpy(b,a+nx*ny*d,nx*ny*(nz-d)*sizeof(mreal)); - memcpy(b+nx*ny*(nz-d),a,nx*ny*d*sizeof(mreal)); - delete []a; a=b; - } - if(dir=='y' && ny>1) - { - d = num>0 ? num%ny : (num+ny*(1+num/ny))%ny; - if(d==0) return; // nothing to do - b = new mreal[nx*ny*nz]; - memcpy(b,a+nx*d,(nx*ny*nz-nx*d)*sizeof(mreal)); - for(i=0;i1) - { - d = num>0 ? num%nx : (num+nx*(1+num/nx))%nx; - if(d==0) return; // nothing to do - b = new mreal[nx*ny*nz]; - memcpy(b,a+d,(nx*ny*nz-d)*sizeof(mreal)); - for(i=0;i1) - { - for(i=0;i1) - { - for(i=0;i1) - { - for(j=0;jx*x*i0 ? sqrt(i2/i0 - x*x) : 0; - return i0; -} -//----------------------------------------------------------------------------- -mreal mglData::Momentum(char dir,mreal &x,mreal &w,mreal &s,mreal &k) const -{ - mreal i0=0,i1=0,i2=0,d,t; - register long i; - i0 = Momentum(dir,x,w); - if(i0==0 || w==0) return 0; - switch(dir) - { - case 'x': - for(i=0;iv2 ? -v1:v2; v1 = -v2; } - if(dir=='z' && nz>1) - { - for(k=0;kaa ? m2 : aa; - e += aa*aa; - } - if(m1==m2) m2+=1; - if(sym) { m2 = -m1>m2 ? -m1:m2; m1 = -m2; } - if(keep_en && k) e = sqrt(e/e0); - else { e0 = e; e=1; } - for(i=0;i1) - { - register long j; - for(j=0;jaa ? m2 : aa; - e += aa*aa; - } - if(m1==m2) m2+=1; - if(sym) { m2 = -m1>m2 ? -m1:m2; m1 = -m2; } - if(keep_en && j) e = sqrt(e/e0); - else { e0 = e; e=1; } - for(i=0;i1) - { - for(i=0;iaa ? m2 : aa; - e += aa*aa; - } - if(m1==m2) m2+=1; - if(sym) { m2 = -m1>m2 ? -m1:m2; m1 = -m2; } - if(keep_en && i) e = sqrt(e/e0); - else { e0 = e; e=1; } - for(k=0;k0 ? i1/i0 : 0; - } - break; - case 'y': - b.Create(ny); - for(j=0;j0 ? i1/i0 : 0; - } - break; - case 'z': - b.Create(nz); - for(k=0;k0 ? i1/i0 : 0; - } - break; - } - return b; -} -//----------------------------------------------------------------------------- -void mglData::PrintInfo(FILE *fp) const -{ - if(fp==0) return; - char *buf = new char[512]; - PrintInfo(buf); - fprintf(fp,"%s",buf); fflush(fp); - delete []buf; -} -//----------------------------------------------------------------------------- -void mglData::PrintInfo(char *buf, bool all) const -{ - if(buf==0) return; - char s[128]; - buf[0]=0; - sprintf(s,"nx = %ld\tny = %ld\tnz = %ld\n",nx,ny,nz); strcat(buf,s); - - int i=0,j=0,k=0; - mreal b = Maximal(i,j,k); - sprintf(s,"Maximum is %g\t at coordinates x = %d\ty = %d\tz = %d\n", b,i,j,k); strcat(buf,s); - b = Minimal(i,j,k); - sprintf(s,"Minimum is %g\t at coordinates x = %d\ty = %d\tz = %d\n", b,i,j,k); strcat(buf,s); - if(all) - { - mreal A=0,Wa=0,X=0,Y=0,Z=0,Wx=0,Wy=0,Wz=0; - Momentum('x',X,Wx); Momentum('y',Y,Wy); - Momentum('z',Z,Wz); Momentum(0,A,Wa); - sprintf(s,"Averages are:\n = %g\t = %g\t = %g\t = %g\n", A,X,Y,Z); strcat(buf,s); - sprintf(s,"Widths (dispersions) are:\nWa = %g\tWx = %g\tWy = %g\tWz = %g\n", - Wa,Wx,Wy,Wz); strcat(buf,s); - } -} -//----------------------------------------------------------------------------- -void mglData::Rearrange(int mx, int my, int mz) -{ - if(mx<1) return; // wrong mx - if(my<1) { my = nx*ny*nz/mx; mz = 1; } - else if(mz<1) mz = (nx*ny*nz)/(mx*my); - long m = mx*my*mz; - if(m==0 || m>nx*ny*nz) return; // too high desired dimensions - nx = mx; ny = my; nz = mz; NewId(); -} -//----------------------------------------------------------------------------- -void mglData::InsertColumns(int at, int num, const char *eq) -{ - if(num<1) return; - if(at<0) at=0; if(at>nx) at=nx; - register long i,j,k,nn=nx+num; - mglData b(nn,ny,nz); - for(i=0;inx) at=nx; - register long i,j,k,nn=num+ny; - mglData b(nx,nn,nz); - for(i=0;inx) at=nx; - register long i,j,k; - mglData b(nx,ny,nz+num); - for(i=0;i=nx) return; - mglData b(nx-num,ny,nz); - register long i,j,k; - for(i=0;i=ny) return; - mglData b(nx,ny-num,nz); - register long i,j,k; - for(i=0;i=nz) return; - mglData b(nx,ny,nz-num); - register long i,j,k; - for(i=0;i1 ? 2:n, n2 = n1 ? 2:n, n2 = n1 ? 2:m, m2 = m1) - { - gsl_fft_complex_wavetable *wt = gsl_fft_complex_wavetable_alloc(nx); - gsl_fft_complex_workspace *ws = gsl_fft_complex_workspace_alloc(nx); - for(i=0;i1) - { - gsl_fft_complex_wavetable *wt = gsl_fft_complex_wavetable_alloc(ny); - gsl_fft_complex_workspace *ws = gsl_fft_complex_workspace_alloc(ny); - for(i=0;i1) - { - gsl_fft_complex_wavetable *wt = gsl_fft_complex_wavetable_alloc(nz); - gsl_fft_complex_workspace *ws = gsl_fft_complex_workspace_alloc(nz); - for(i=0;i0?int((x)/(y)+0.5):int((x)/(y)-0.5)) -void mgl_omod(mreal *a, mreal da, int nx, int n) -{ - register long i,ii; - bool qq=true; - register mreal q; - for(i=1;i1) for(j=0;j1) for(j=0;j1) for(j=0;j=nx || yy>=ny || zz>=nz) return; - register long i,j; - if(xx<0 && yy<0 && zz<0) // ��� ������ - for(i=0;i=nx || yy>=ny || zz>=nz) return; - register long i,j,k; - if(xx<0 && yy<0 && zz<0) // ��� ������ - { - if(val.nx>=nx && val.ny>=ny && val.nz>=nz) - for(i=0;i=nx && val.ny>=ny) - for(i=0;i=nx) - for(i=0;i=nx && val.ny>=ny) - for(i=0;i=nx) - for(i=0;i=ny && val.ny>=nz) - for(i=0;i=ny) - for(i=0;i=nx && val.ny>=nz) - for(i=0;i=nx) - for(i=0;i=nx) for(i=0;i=ny) for(i=0;i=nz) for(i=0;i * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 "mgl/mgl_data.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" - -//----------------------------------------------------------------------------- -// Data operations -//----------------------------------------------------------------------------- -/// Multiplicate the data by other one for each element -void mgl_data_mul_dat(HMDT d, HMDT b){ *d *= *b; } -/// Divide the data by other one for each element -void mgl_data_div_dat(HMDT d, HMDT b) { *d /= *b; } -/// Add the other data -void mgl_data_add_dat(HMDT d, HMDT b) { *d += *b; } -/// Substract the other data -void mgl_data_sub_dat(HMDT d, HMDT b) { *d -= *b; } -/// Multiplicate each element by the number -void mgl_data_mul_num(HMDT d, mreal b) { *d *= b; } -/// Divide each element by the number -void mgl_data_div_num(HMDT d, mreal b) { *d /= b; } -/// Add the number -void mgl_data_add_num(HMDT d, mreal b) { *d += b; } -/// Substract the number -void mgl_data_sub_num(HMDT d, mreal b) { *d -= b; } -//----------------------------------------------------------------------------- -/// Rearrange data dimensions -void mgl_data_rearrange(HMDT d, int mx, int my, int mz) -{ d->Rearrange(mx,my,mz); } -/// Resize the data to new size of box [x1,x2]*[y1,y2]*[z1,z2] -HMDT mgl_data_resize(const HMDT d, int mx,int my,int mz) -{ return new mglData(d->Resize(mx,my,mz)); } -HMDT mgl_data_resize_box(const HMDT d, int mx,int my,int mz,mreal x1,mreal x2, - mreal y1,mreal y2,mreal z1,mreal z2) -{ return new mglData(d->Resize(mx,my,mz,x1,x2,y1,y2,z1,z2)); } -/// Get sub-array of the data with given fixed indexes -HMDT mgl_data_subdata(const HMDT d, int xx,int yy,int zz) -{ return new mglData(d->SubData(xx,yy,zz)); } -HMDT mgl_data_subdata_ext(const HMDT d, const HMDT xx, const HMDT yy, const HMDT zz) -{ return new mglData(d->SubData(*xx,*yy,*zz)); } -/// Get column (or slice) of the data filled by formulas of other named columns -HMDT mgl_data_column(const HMDT d, const char *eq) -{ return new mglData(d->Column(eq)); } -/// Set names for columns (slices) -void mgl_data_set_id(HMDT d, const char *id) -{ d->SetColumnId(id); } -/// Eqidistantly fill the data to range [x1,x2] in direction \a dir -void mgl_data_fill(HMDT d, mreal x1,mreal x2,char dir) -{ d->Fill(x1,x2,dir); } -/// Modify the data by specified formula -void mgl_data_modify(HMDT d, const char *eq,int dim) -{ d->Modify(eq,dim); } -/// Modify the data by specified formula -void mgl_data_modify_vw(HMDT d, const char *eq, HMDT v, HMDT w) -{ if(d) - { if(v&&w) d->Modify(eq,*v,*w); else if(v) d->Modify(eq,*v); else d->Modify(eq); } -} -/// Create or recreate the array with specified size and fill it by zero -void mgl_data_create(HMDT d, int nx,int ny,int nz) -{ d->Create(nx,ny,nz); } -/// Transpose the x<->y dimensions of the data -void mgl_data_transpose(HMDT d, const char *dim) { d->Transpose(dim); } -/// Normalize the data to range [v1,v2] -void mgl_data_norm(HMDT d, mreal v1,mreal v2,int sym,int dim) -{ d->Norm(v1,v2,sym,dim); } -/// Normalize the data to range [v1,v2] slice by slice -void mgl_data_norm_slice(HMDT d, mreal v1,mreal v2,char dir,int keep_en,int sym) -{ d->NormSl(v1,v2,dir,keep_en,sym); } -/// Reduce size of the data -void mgl_data_squeeze(HMDT d, int rx,int ry,int rz,int smooth) -{ d->Squeeze(rx,ry,rz,smooth); } -/// Get maximal value of the data -mreal mgl_data_max(const HMDT d) { return d->Maximal(); } -/// Get minimal value of the data -mreal mgl_data_min(const HMDT d) { return d->Minimal(); } -/// Get the value in given cell of the data -mreal *mgl_data_value(HMDT d, int i,int j,int k) -{ return d->a+i+d->nx*(j+d->ny*k); } -/// Swap left and right part of the data in given direction (useful for fourier spectrums) -void mgl_data_swap(HMDT d, const char *dir) { d->Swap(dir); } -/// Swap left and right part of the data in given direction (useful for fourier spectrums) -void mgl_data_roll(HMDT d, char dir, int num) { d->Roll(dir,num); } -/// Mirror the data in given direction -void mgl_data_mirror(HMDT d, const char *dir) { d->Mirror(dir); } -void mgl_data_fill_sample(HMDT d, int num, const char *how) { d->FillSample(num,how); } -void mgl_data_insert(HMDT d, char dir, int at, int num){ d->Insert(dir,at,num); } -void mgl_data_delete(HMDT d, char dir, int at, int num){ d->Delete(dir,at,num); } -void mgl_data_hankel(HMDT d, const char *dir) { d->Hankel(dir); } -void mgl_data_sinfft(HMDT d, const char *dir) { d->SinFFT(dir); } -void mgl_data_cosfft(HMDT d, const char *dir) { d->CosFFT(dir); } -//----------------------------------------------------------------------------- -/// Allocate memory and copy the data from the (mreal *) array -void mgl_data_set_float(HMDT d, const float *A,int NX,int NY,int NZ) -{ d->Set(A,NX,NY,NZ); } -/// Allocate memory and copy the data from the (mreal *) array -void mgl_data_set_double(HMDT d, const double *A,int NX,int NY,int NZ) -{ d->Set(A,NX,NY,NZ); } -/// Allocate memory and copy the data from the (mreal **) array -void mgl_data_set_float2(HMDT d, const float **A,int N1,int N2) -{ d->Set(A,N1,N2); } -/// Allocate memory and copy the data from the (mreal **) array -void mgl_data_set_double2(HMDT d, const double **A,int N1,int N2) -{ d->Set(A,N1,N2); } -/// Allocate memory and copy the data from the (mreal ***) array -void mgl_data_set_float3(HMDT d, const float ***A,int N1,int N2,int N3) -{ d->Set(A,N1,N2,N3); } -/// Allocate memory and copy the data from the (mreal ***) array -void mgl_data_set_double3(HMDT d, const double ***A,int N1,int N2,int N3) -{ d->Set(A,N1,N2,N3); } -/// Copy the data from other mglData variable -void mgl_data_set(HMDT d, HMDT a) { d->Set(*a); } -/// Read data from tab-separated text file with auto determining size -int mgl_data_read(HMDT d, const char *fname) { return d->Read(fname); } -/// Read data from tab-separated text file with built-in sizes -int mgl_data_read_mat(HMDT d, const char *fname, int dim) -{ return d->ReadMat(fname,dim); } -/// Read data from text file with specifeid size -int mgl_data_read_dim(HMDT d, const char *fname,int mx,int my,int mz) -{ return d->Read(fname,mx,my,mz); } -/// Save whole data array (for ns=-1) or only ns-th slice to text file -void mgl_data_save(HMDT d, const char *fname,int ns) -{ d->Save(fname,ns); } -const mreal *mgl_data_data(const HMDT d) -{ return d->a; } -/// Get the data which is tensor multiplication (d[i,j] = a[i]*b[j] and so on) -HMDT mgl_data_combine(HMDT a, HMDT b) -{ return new mglData(a->Combine(*b)); } -/// Extend data dimensions -void mgl_data_extend(HMDT dat, int n1, int n2) -{ dat->Extend(n1,n2); } -//----------------------------------------------------------------------------- -void mgl_data_set_vector(HMDT dat, gsl_vector *v) -{ dat->Set(v); } -void mgl_data_set_matrix(HMDT dat, gsl_matrix *m) -{ dat->Set(m); } -//----------------------------------------------------------------------------- -// Data operations (Fortran) -//----------------------------------------------------------------------------- -/// Multiplicate the data by other one for each element -void mgl_data_mul_dat_(uintptr_t *d, uintptr_t *b){ _DM_(d) *= _D_(b); } -/// Divide the data by other one for each element -void mgl_data_div_dat_(uintptr_t *d, uintptr_t *b) { _DM_(d) /= _D_(b); } -/// Add the other data -void mgl_data_add_dat_(uintptr_t *d, uintptr_t *b) { _DM_(d) += _D_(b); } -/// Substract the other data -void mgl_data_sub_dat_(uintptr_t *d, uintptr_t *b) { _DM_(d) -= _D_(b); } -/// Multiplicate each element by the number -void mgl_data_mul_num_(uintptr_t *d, mreal *b) { _DM_(d) *= *b; } -/// Divide each element by the number -void mgl_data_div_num_(uintptr_t *d, mreal *b) { _DM_(d) /= *b; } -/// Add the number -void mgl_data_add_num_(uintptr_t *d, mreal *b) { _DM_(d) += *b; } -/// Substract the number -void mgl_data_sub_num_(uintptr_t *d, mreal *b) { _DM_(d) -= *b; } -//----------------------------------------------------------------------------- -/// Rearrange data dimensions -void mgl_data_rearrange_(uintptr_t *d, int *mx, int *my, int *mz) -{ _DT_->Rearrange(*mx,*my,*mz); } -/// Resize the data to new size of box [x1,x2]*[y1,y2]*[z1,z2] -uintptr_t mgl_data_resize_(uintptr_t *d, int *mx,int *my,int *mz) -{ return uintptr_t(new mglData(_DT_->Resize(*mx,*my,*mz))); } -uintptr_t mgl_data_resize_box_(uintptr_t *d, int *mx,int *my,int *mz,mreal *x1,mreal *x2, - mreal *y1,mreal *y2,mreal *z1,mreal *z2) -{ return uintptr_t(new mglData(_DT_->Resize(*mx,*my,*mz,*x1,*x2,*y1,*y2,*z1,*z2))); } -/// Get sub-array of the data with given fixed indexes -uintptr_t mgl_data_subdata_(uintptr_t *d, int *xx,int *yy,int *zz) -{ return uintptr_t(new mglData(_DT_->SubData(*xx,*yy,*zz))); } -uintptr_t mgl_data_subdata_ext_(uintptr_t *d, uintptr_t *xx, uintptr_t *yy, uintptr_t *zz) -{ return uintptr_t(new mglData(_DT_->SubData(_D_(xx),_D_(yy),_D_(zz)))); } -/// Get column (or slice) of the data filled by formulas of other named columns -uintptr_t mgl_data_column_(uintptr_t *d, const char *eq,int l) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - uintptr_t r = uintptr_t(new mglData(_DT_->Column(s))); - delete []s; return r; -} -/// Set names for columns (slices) -void mgl_data_set_id_(uintptr_t *d, const char *eq,int l) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - _DT_->SetColumnId(s); delete []s; -} -/// Eqidistantly fill the data to range [x1,x2] in direction \a dir -void mgl_data_fill_(uintptr_t *d, mreal *x1,mreal *x2,const char *dir,int) -{ _DT_->Fill(*x1,*x2,*dir); } -/// Modify the data by specified formula -void mgl_data_modify_(uintptr_t *d, const char *eq,int *dim,int l) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - _DT_->Modify(s,*dim); delete []s; -} -/// Modify the data by specified formula -void mgl_data_modify_vw_(uintptr_t *d, const char *eq, uintptr_t *v, uintptr_t *w,int l) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - if(d&&v&&w) _DT_->Modify(s,_D_(v),_D_(w)); - else if(d&&v) _DT_->Modify(s,_D_(v)); - else if(d) _DT_->Modify(s); - delete []s; -} -/// Create or recreate the array with specified size and fill it by zero -void mgl_data_create_(uintptr_t *d, int *nx,int *ny,int *nz) -{ _DT_->Create(*nx,*ny,*nz); } -/// Transpose the x<->y dimensions of the data -void mgl_data_transpose_(uintptr_t *d, const char *dim,int l) -{ - char *s=new char[l+1]; memcpy(s,dim,l); s[l]=0; - _DT_->Transpose(s); - delete []s; -} -/// Normalize the data to range [v1,v2] -void mgl_data_norm_(uintptr_t *d, mreal *v1,mreal *v2,int *sym,int *dim) -{ _DT_->Norm(*v1,*v2,*sym,*dim); } -/// Normalize the data to range [v1,v2] -void mgl_data_norm_slice_(uintptr_t *d, mreal *v1,mreal *v2,char *dir,int *keep_en,int *sym,int ) -{ _DT_->NormSl(*v1,*v2,*dir,*keep_en,*sym); } -/// Reduce size of the data -void mgl_data_squeeze_(uintptr_t *d, int *rx,int *ry,int *rz,int *smooth) -{ _DT_->Squeeze(*rx,*ry,*rz,*smooth); } -/// Get maximal value of the data -mreal mgl_data_max_(uintptr_t *d) { return _DT_->Maximal(); } -/// Get minimal value of the data -mreal mgl_data_min_(uintptr_t *d) { return _DT_->Minimal(); } -/// Get the value in given cell of the data with border checking -//mreal mgl_data_value_(uintptr_t *d, int *i,int *j,int *k) { return d->a[*i+d->nx*(*j+d->ny**k)]; } -/// Swap left and right part of the data in given direction (useful for fourier spectrums) -void mgl_data_swap_(uintptr_t *d, const char *dir,int l) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - _DT_->Swap(s); - delete []s; -} -void mgl_data_roll_(uintptr_t *d, const char *dir, int *num, int) -{ _DT_->Roll(*dir, *num); } -/// Mirror the data in given direction -void mgl_data_mirror_(uintptr_t *d, const char *dir,int l) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - _DT_->Mirror(s); - delete []s; -} -void mgl_data_fill_sample_(uintptr_t *d, int num, const char *how,int l) -{ - char *s=new char[l+1]; memcpy(s,how,l); s[l]=0; - _DT_->FillSample(num,s); - delete []s; -} -void mgl_data_insert_(uintptr_t *d, const char *dir, int *at, int *num, int) -{ _DT_->Insert(*dir,*at,*num); } -void mgl_data_delete_(uintptr_t *d, const char *dir, int *at, int *num, int) -{ _DT_->Delete(*dir,*at,*num); } -void mgl_data_hankel_(uintptr_t *d, const char *dir,int l) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - _DT_->Hankel(s); delete []s; -} -void mgl_data_sinfft_(uintptr_t *d, const char *dir,int l) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - _DT_->SinFFT(s); delete []s; -} -void mgl_data_cosfft_(uintptr_t *d, const char *dir,int l) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - _DT_->CosFFT(s); delete []s; -} -//----------------------------------------------------------------------------- -/// Allocate memory and copy the data from the (mreal *) array -void mgl_data_set_float1_(uintptr_t *d, const float *A,int *NX) -{ _DT_->Set(A,*NX); } -/// Allocate memory and copy the data from the (mreal *) array -void mgl_data_set_double1_(uintptr_t *d, const double *A,int *NX) -{ _DT_->Set(A,*NX); } -/// Allocate memory and copy the data from the (mreal *) array -void mgl_data_set_float_(uintptr_t *d, const float *A,int *NX,int *NY,int *NZ) -{ _DT_->Set(A,*NX,*NY,*NZ); } -/// Allocate memory and copy the data from the (mreal *) array -void mgl_data_set_double_(uintptr_t *d, const double *A,int *NX,int *NY,int *NZ) -{ _DT_->Set(A,*NX,*NY,*NZ); } -/// Allocate memory and copy the data from the (mreal **) array -void mgl_data_set_float2_(uintptr_t *d, const float *A,int *N1,int *N2) -{ _DT_->Set(A,*N1,*N2); } -/// Allocate memory and copy the data from the (mreal **) array -void mgl_data_set_double2_(uintptr_t *d, const double *A,int *N1,int *N2) -{ _DT_->Set(A,*N1,*N2); } -/// Allocate memory and copy the data from the (mreal ***) array -void mgl_data_set_float3_(uintptr_t *d, const float *A,int *N1,int *N2,int *N3) -{ _DT_->Set(A,*N1,*N2,*N3); } -/// Allocate memory and copy the data from the (mreal ***) array -void mgl_data_set_double3_(uintptr_t *d, const double *A,int *N1,int *N2,int *N3) -{ _DT_->Set(A,*N1,*N2,*N3); } -/// Copy the data from other mglData variable -void mgl_data_set_(uintptr_t *d, uintptr_t *a) { _DT_->Set(_D_(a)); } -/// Read data from tab-separated text file with auto determining size -int mgl_data_read_(uintptr_t *d, const char *fname,int l) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; - int r = _DT_->Read(s); delete []s; return r; -} -/// Read data from tab-separated text file with buit-in sizes -int mgl_data_read_mat_(uintptr_t *d, const char *fname,int *dim,int l) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; - int r = _DT_->Read(s,*dim); delete []s; return r; -} -/// Read data from text file with specifeid size -int mgl_data_read_dim_(uintptr_t *d, const char *fname,int *mx,int *my,int *mz,int l) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; - int r = _DT_->Read(s,*mx,*my,*mz); - delete []s; return r; -} -/// Save whole data array (for ns=-1) or only ns-th slice to text file -void mgl_data_save_(uintptr_t *d, const char *fname,int *ns,int l) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; - _DT_->Save(s,*ns); delete []s; -} -const mreal *mgl_data_data_(uintptr_t *d) -{ return _DT_->a; } -/// Get the data which is tensor multiplication (d[i,j] = a[i]*b[j] and so on) -uintptr_t mgl_data_combine_(uintptr_t *a, uintptr_t *b) -{ return uintptr_t(new mglData(((mglData *)*a)->Combine(_D_(b)))); } -/// Extend data dimensions -void mgl_data_extend_(uintptr_t *d, int *n1, int *n2) -{ _DT_->Extend(*n1,*n2); } -//----------------------------------------------------------------------------- -// Data manipulation functions -//----------------------------------------------------------------------------- -/// Smooth the data on specified direction or directions -void mgl_data_smooth(HMDT d, int Type,mreal delta,const char *dirs) -{ d->Smooth(Type,dirs,delta); } -/// Get array which is result of summation in given direction or directions -HMDT mgl_data_sum(const HMDT d, const char *dir) -{ return new mglData(d->Sum(dir)); } -/// Integrate (cumulative summation) the data in given direction or directions -void mgl_data_integral(HMDT d, const char *dir) -{ d->Integral(dir); } -/// Differentiate the data in given direction or directions -void mgl_data_diff(HMDT d, const char *dir) -{ d->Diff(dir); } -/// Double-differentiate (like laplace operator) the data in given direction -void mgl_data_diff2(HMDT d, const char *dir) -{ d->Diff2(dir); } -/// Interpolate by qubic splain the data to given point x=[0...nx-1], y=[0...ny-1], z=[0...nz-1] -mreal mgl_data_spline(const HMDT d, mreal x,mreal y,mreal z) -{ return d->Spline(x,y,z); } -/// Interpolate by qubic splain the data to given point \a x,\a y,\a z which normalized in range [0, 1] -mreal mgl_data_spline1(const HMDT d, mreal x,mreal y,mreal z) -{ return d->Spline1(x,y,z); } -/// Interpolate by linear function the data to given point x=[0...nx-1], y=[0...ny-1], z=[0...nz-1] -mreal mgl_data_linear(const HMDT d, mreal x,mreal y,mreal z) -{ return d->Linear(x,y,z); } -/// Interpolate by line the data to given point \a x,\a y,\a z which normalized in range [0, 1] -mreal mgl_data_linear1(const HMDT d, mreal x,mreal y,mreal z) -{ return d->Linear1(x,y,z); } -HMDT mgl_data_momentum(const HMDT d, char dir, const char *how) -{ return new mglData(d->Momentum(dir,how)); } -/// Create n-th points distribution of this data values in range [v1, v2] -HMDT mgl_data_hist(const HMDT d, int n, mreal v1, mreal v2, int nsub) -{ return new mglData(d->Hist(n,v1,v2,nsub)); } -/// Create n-th points distribution of this data values in range [v1, v2] with weight \a w -HMDT mgl_data_hist_w(const HMDT d, HMDT w, int n, mreal v1, mreal v2, int nsub) -{ return new mglData(d->Hist(*w,n,v1,v2,nsub)); } -/// Cumulative summation the data in given direction or directions -void mgl_data_cumsum(HMDT d, const char *dir) -{ d->CumSum(dir); } -/// Crop the data (cut off data edges) -void mgl_data_crop(HMDT d, int n1, int n2, char dir) -{ d->Crop(n1,n2,dir); } -/// Get array which is result of maximal values in given direction or directions -HMDT mgl_data_max_dir(const HMDT d, const char *dir) -{ return new mglData(d->Max(dir)); } -/// Get array which is result of minimal values in given direction or directions -HMDT mgl_data_min_dir(const HMDT d, const char *dir) -{ return new mglData(d->Min(dir)); } -//----------------------------------------------------------------------------- -// Data manipulation functions (Fortran) -//----------------------------------------------------------------------------- -/// Smooth the data on specified direction or directions -void mgl_data_smooth_(uintptr_t *d, int *Type,mreal *delta,const char *dir,int l) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - _DT_->Smooth(*Type,s,*delta); delete []s; -} -/// Get array which is result of summation in given direction or directions -uintptr_t mgl_data_sum_(uintptr_t *d, const char *dir,int l) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - uintptr_t r=uintptr_t(new mglData(_DT_->Sum(s))); delete []s; - return r; -} -/// Integrate (cumulative summation) the data in given direction or directions -void mgl_data_integral_(uintptr_t *d, const char *dir,int l) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - _DT_->Integral(s); delete []s; -} -/// Differentiate the data in given direction or directions -void mgl_data_diff_(uintptr_t *d, const char *dir,int l) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - _DT_->Diff(s); delete []s; -} -/// Double-differentiate (like laplace operator) the data in given direction -void mgl_data_diff2_(uintptr_t *d, const char *dir,int l) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - _DT_->Diff2(s); delete []s; -} -/// Interpolate by qubic splain the data to given point x=[0...nx-1], y=[0...ny-1], z=[0...nz-1] -mreal mgl_data_spline_(uintptr_t *d, mreal *x,mreal *y,mreal *z) -{ return _DT_->Spline(*x,*y,*z); } -/// Interpolate by qubic splain the data to given point \a x,\a y,\a z which normalized in range [0, 1] -mreal mgl_data_spline1_(uintptr_t *d, mreal *x,mreal *y,mreal *z) -{ return _DT_->Spline1(*x,*y,*z); } -/// Interpolate by linear function the data to given point x=[0...nx-1], y=[0...ny-1], z=[0...nz-1] -mreal mgl_data_linear_(uintptr_t *d, mreal *x,mreal *y,mreal *z) -{ return _DT_->Linear(*x,*y,*z); } -/// Interpolate by line the data to given point \a x,\a y,\a z which normalized in range [0, 1] -mreal mgl_data_linear1_(uintptr_t *d, mreal *x,mreal *y,mreal *z) -{ return _DT_->Linear1(*x,*y,*z); } -uintptr_t mgl_data_momentum_(uintptr_t *d, char *dir, const char *how, int,int l) -{ - char *s=new char[l+1]; memcpy(s,how,l); s[l]=0; - uintptr_t r=uintptr_t(new mglData(_DT_->Momentum(*dir, s))); - delete []s; return r; -} -/// Create n-th points distribution of this data values in range [v1, v2] -uintptr_t mgl_data_hist_(uintptr_t *d, int *n, mreal *v1, mreal *v2, int *nsub) -{ return uintptr_t(new mglData(_DT_->Hist(*n,*v1,*v2,*nsub))); } -/// Create n-th points distribution of this data values in range [v1, v2] with weight \a w -uintptr_t mgl_data_hist_w_(uintptr_t *d, uintptr_t *w, int *n, mreal *v1, mreal *v2, int *nsub) -{ return uintptr_t(new mglData(_DT_->Hist(*((mglData *)*w),*n,*v1,*v2,*nsub))); } -/// Cumulative summation the data in given direction or directions -void mgl_data_cumsum_(uintptr_t *d, const char *dir,int l) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - _DT_->CumSum(s); delete []s; -} -/// Crop the data (cut off data edges) -void mgl_data_crop_(uintptr_t *d, int *n1, int *n2, const char *dir,int) -{ _DT_->Crop(*n1,*n2,*dir); } -/// Get array which is result of maximal values in given direction or directions -uintptr_t mgl_data_max_dir_(uintptr_t *d, const char *dir,int l) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - uintptr_t r = uintptr_t(new mglData(_DT_->Max(s))); delete []s; - return r; -} -/// Get array which is result of minimal values in given direction or directions -uintptr_t mgl_data_min_dir_(uintptr_t *d, const char *dir,int l) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - uintptr_t r = uintptr_t(new mglData(_DT_->Min(s))); delete []s; - return r; -} -//----------------------------------------------------------------------------- -/// Set array values from the string -void mgl_data_set_values(HMDT d, const char *val, int nx, int ny, int nz) -{ - d->Set(val,nx,ny,nz); -} -void mgl_data_set_values_(uintptr_t *d, const char *val, int *nx, int *ny, int *nz, int l) -{ - char *s=new char[l+1]; memcpy(s,val,l); s[l]=0; - _DT_->Set(s,*nx,*ny,*nz); delete []s; -} -//----------------------------------------------------------------------------- -HMDT mgl_data_evaluate_i(const HMDT dat, const HMDT idat, int norm) -{ return new mglData(dat->Evaluate(*idat,norm)); } -HMDT mgl_data_evaluate_ij(const HMDT dat, const HMDT idat, const HMDT jdat, int norm) -{ return new mglData(dat->Evaluate(*idat,*jdat,norm)); } -HMDT mgl_data_evaluate_ijk(const HMDT dat, const HMDT idat, const HMDT jdat, const HMDT kdat, int norm) -{ return new mglData(dat->Evaluate(*idat,*jdat,*kdat,norm)); } -void mgl_data_envelop(HMDT dat, char dir) { dat->Envelop(dir); } -void mgl_data_sew(HMDT dat, const char *dirs, mreal da) -{ dat->Sew(dirs,da); } -//----------------------------------------------------------------------------- -uintptr_t mgl_data_evaluate_i_(uintptr_t *d, uintptr_t *idat, int *norm) -{ return uintptr_t(new mglData(_DT_->Evaluate(_D_(idat),*norm))); } -uintptr_t mgl_data_evaluate_ij_(uintptr_t *d, uintptr_t *idat, uintptr_t *jdat, int *norm) -{ return uintptr_t(new mglData(_DT_->Evaluate(_D_(idat),_D_(jdat),*norm))); } -uintptr_t mgl_data_evaluate_ijk_(uintptr_t *d, uintptr_t *idat, uintptr_t *jdat, uintptr_t *kdat, int *norm) -{ return uintptr_t(new mglData(_DT_->Evaluate(_D_(idat),_D_(jdat),_D_(kdat),*norm))); } -void mgl_data_envelop_(uintptr_t *d, const char *dir, int) -{ _DT_->Envelop(*dir); } -void mgl_data_sew_(uintptr_t *d, const char *dirs, mreal *da, int l) -{ - char *s=new char[l+1]; memcpy(s,dirs,l); s[l]=0; - _DT_->Sew(s,*da); delete []s; -} -//----------------------------------------------------------------------------- -void mgl_data_put_val(HMDT dat, mreal val, int i, int j, int k) -{ dat->Put(val, i,j,k); } -void mgl_data_put_dat(HMDT dat, const HMDT val, int i, int j, int k) -{ dat->Put(*val, i,j,k); } -void mgl_data_put_val_(uintptr_t *d, mreal *val, int *i, int *j, int *k) -{ _DT_->Put(*val, *i,*j,*k); } -void mgl_data_put_dat_(uintptr_t *d, uintptr_t *val, int *i, int *j, int *k) -{ _DT_->Put(_D_(val), *i,*j,*k); } -//----------------------------------------------------------------------------- -int mgl_data_get_nx(const HMDT dat) { return dat->nx; } -int mgl_data_get_ny(const HMDT dat) { return dat->ny; } -int mgl_data_get_nz(const HMDT dat) { return dat->nz; } -int mgl_data_get_nx_(uintptr_t *d) { return _DT_->nx; } -int mgl_data_get_ny_(uintptr_t *d) { return _DT_->ny; } -int mgl_data_get_nz_(uintptr_t *d) { return _DT_->nz; } -//----------------------------------------------------------------------------- -HMDT mgl_transform_a(const HMDT am, const HMDT ph, const char *tr) -{ return new mglData(mglTransformA(*am,*ph,tr)); } -HMDT mgl_transform(const HMDT re, const HMDT im, const char *tr) -{ return new mglData(mglTransform(*re,*im,tr)); } -HMDT mgl_data_stfa(const HMDT re, const HMDT im, int dn, char dir) -{ return new mglData(mglSTFA(*re,*im,dn,dir)); } -uintptr_t mgl_transform_a_(uintptr_t *am, uintptr_t *ph, const char *tr, int l) -{ - char *s=new char[l+1]; memcpy(s,tr,l); s[l]=0; - uintptr_t res = uintptr_t(new mglData(mglTransformA(_D_(am),_D_(ph),s))); - delete []s; return res; -} -uintptr_t mgl_transform_(uintptr_t *re, uintptr_t *im, const char *tr, int l) -{ - char *s=new char[l+1]; memcpy(s,tr,l); s[l]=0; - uintptr_t res = uintptr_t(new mglData(mglTransform(_D_(re),_D_(im),s))); - delete []s; return res; -} -uintptr_t mgl_data_stfa_(uintptr_t *re, uintptr_t *im, int *dn, char *dir, int) -{ return uintptr_t(new mglData(mglSTFA(*re,*im,*dn,*dir))); } -//----------------------------------------------------------------------------- -void mgl_data_diff_par(HMDT d, const HMDT v1, const HMDT v2, const HMDT v3) -{ if(v3) d->Diff(*v1,*v2,*v3); else d->Diff(*v1,*v2); } -void mgl_data_diff_par_(uintptr_t *d, uintptr_t *v1, uintptr_t *v2, uintptr_t *v3) -{ - if(v3) _DT_->Diff(_D_(v1),_D_(v2),_D_(v3)); - else _DT_->Diff(_D_(v1),_D_(v2)); -} -//----------------------------------------------------------------------------- -mreal mgl_data_first(const HMDT d, const char *cond, int *i, int *j, int *k) -{ return d->Find(cond,*i,*j,*k); } -mreal mgl_data_last(const HMDT d, const char *cond, int *i, int *j, int *k) -{ return d->Last(cond,*i,*j,*k); } -int mgl_data_find(const HMDT d, const char *cond, char dir, int i, int j, int k) -{ return d->Find(cond,dir,i,j,k); } -int mgl_data_find_any(const HMDT d, const char *cond) -{ return d->FindAny(cond); } -mreal mgl_data_first_(uintptr_t *d, const char *cond, int *i, int *j, int *k, int l) -{ - char *s=new char[l+1]; memcpy(s,cond,l); s[l]=0; - mreal res = _DT_->Find(s,*i,*j,*k); - delete []s; return res; -} -mreal mgl_data_last_(uintptr_t *d, const char *cond, int *i, int *j, int *k, int l) -{ - char *s=new char[l+1]; memcpy(s,cond,l); s[l]=0; - mreal res = _DT_->Last(s,*i,*j,*k); - delete []s; return res; -} -int mgl_data_find_(uintptr_t *d, const char *cond, char *dir, int *i, int *j, int *k, int l, int) -{ - char *s=new char[l+1]; memcpy(s,cond,l); s[l]=0; - int res = _DT_->Find(s,*dir,*i,*j,*k); - delete []s; return res; -} -int mgl_data_find_any_(uintptr_t *d, const char *cond, int l) -{ - char *s=new char[l+1]; memcpy(s,cond,l); s[l]=0; - int res = _DT_->FindAny(s); - delete []s; return res; -} -//----------------------------------------------------------------------------- -mreal mgl_data_max_int(const HMDT d, int *i, int *j, int *k) -{ return d->Maximal(*i,*j,*k); } -mreal mgl_data_max_real(const HMDT d, mreal *i, mreal *j, mreal *k) -{ return d->Maximal(*i,*j,*k); } -mreal mgl_data_min_int(const HMDT d, int *i, int *j, int *k) -{ return d->Minimal(*i,*j,*k); } -mreal mgl_data_min_real(const HMDT d, mreal *i, mreal *j, mreal *k) -{ return d->Minimal(*i,*j,*k); } -mreal mgl_data_momentum_mw(const HMDT d, char dir, mreal *m, mreal *w) -{ return d->Momentum(dir,*m,*w); } -mreal mgl_data_max_int_(uintptr_t *d, int *i, int *j, int *k) -{ return _DT_->Maximal(*i,*j,*k); } -mreal mgl_data_max_real_(uintptr_t *d, mreal *i, mreal *j, mreal *k) -{ return _DT_->Maximal(*i,*j,*k); } -mreal mgl_data_min_int_(uintptr_t *d, int *i, int *j, int *k) -{ return _DT_->Minimal(*i,*j,*k); } -mreal mgl_data_min_real_(uintptr_t *d, mreal *i, mreal *j, mreal *k) -{ return _DT_->Minimal(*i,*j,*k); } -mreal mgl_data_momentum_mw_(uintptr_t *d, char *dir, mreal *m, mreal *w,int) -{ return _DT_->Momentum(*dir,*m,*w); } -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_data_io.cpp b/mgl/mgl_data_io.cpp deleted file mode 100644 index 90dc713..0000000 --- a/mgl/mgl_data_io.cpp +++ /dev/null @@ -1,1168 +0,0 @@ -/*************************************************************************** - * mgl_data_io.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 -#include -#include -#include -#ifdef HAVE_HDF5 -#include -#endif -#ifdef HAVE_HDF4 -#define intf hdf4_intf -#include -#undef intf -#endif - -#ifndef WIN32 -#include -#endif - -#include "mgl/mgl_eval.h" -#include "mgl/mgl_data.h" - -//#define isn(ch) ((ch)<' ' && (ch)!='\t') -#define isn(ch) ((ch)=='\n') -//----------------------------------------------------------------------------- -void mglData::Set(const char *v,int NX,int NY,int NZ) -{ - if(NX<1 || NY <1 || NZ<1) return; - register int i,j=0,m=NX*NY*NZ; - mreal *b = new mreal[m]; memset(b,0,m*sizeof(mreal)); - for(i=0;isize<1) return; - Create(v->size); - for(long i=0;idata[i*v->stride]; -#endif -} -//----------------------------------------------------------------------------- -void mglData::Set(gsl_matrix *m) -{ -#ifndef NO_GSL - if(!m || m->size1<1 || m->size2<1) return; - Create(m->size1,m->size2); - register long i,j; - for(i=0;idata[i * m->tda + j]; -#endif -} -//----------------------------------------------------------------------------- -void mglData::Set(const float *A,int NX,int NY,int NZ) -{ - if(NX<=0 || NY<=0 || NZ<=0) return; - Create(NX,NY,NZ); -#if(MGL_USE_DOUBLE==1) - for(long i=0;i=nx && nz>=nx) for(i=0;i=nx) for(i=0;i1) // 3d data - { - n = xx.nx; m = xx.ny; l = xx.nz; - j = yy.nx*yy.ny*yy.nz; if(j>1 && j!=n*m*l) return d; // wrong sizes - k = zz.nx*zz.ny*zz.nz; if(k>1 && k!=n*m*l) return d; // wrong sizes - ix = true; iy = j>1; iz = k>1; - } - else if(yy.nz>1) - { - n = yy.nx; m = yy.ny; l = yy.nz; - j = xx.nx*xx.ny*xx.nz; if(j>1 && j!=n*m*l) return d; // wrong sizes - k = zz.nx*zz.ny*zz.nz; if(k>1 && k!=n*m*l) return d; // wrong sizes - iy = true; ix = j>1; iz = k>1; - } - else if(zz.nz>1) - { - n = zz.nx; m = zz.ny; l = zz.nz; - j = yy.nx*yy.ny*yy.nz; if(j>1 && j!=n*m*l) return d; // wrong sizes - k = xx.nx*xx.ny*xx.nz; if(k>1 && k!=n*m*l) return d; // wrong sizes - iz = true; iy = j>1; ix = k>1; - } - else if(xx.ny>1) // 2d data - { - n = xx.nx; m = xx.ny; l = 1; - j = yy.nx*yy.ny; if(j>1 && j!=n*m) return d; // wrong sizes - k = zz.nx*zz.ny; if(k>1 && k!=n*m) return d; // wrong sizes - ix = true; iy = j>1; iz = k>1; - } - else if(yy.ny>1) - { - n = yy.nx; m = yy.ny; l = 1; - j = xx.nx*xx.ny; if(j>1 && j!=n*m) return d; // wrong sizes - k = zz.nx*zz.ny; if(k>1 && k!=n*m) return d; // wrong sizes - iy = true; ix = j>1; iz = k>1; - } - else if(zz.ny>1) - { - n = zz.nx; m = zz.ny; l = 1; - j = yy.nx*yy.ny; if(j>1 && j!=n*m) return d; // wrong sizes - k = xx.nx*xx.ny; if(k>1 && k!=n*m) return d; // wrong sizes - iz = true; iy = j>1; ix = k>1; - } - if(n*m*l>1) // this is 2d or 3d data - { - d.Create(n,m,l); - for(i0=0;i0=nx)i=nx-1; - j = int((iy?yy.a[i0]:yy.a[0])+0.5); if(j<0)j=0; if(j>=ny)j=ny-1; - k = int((iz?zz.a[i0]:zz.a[0])+0.5); if(k<0)k=0; if(k>=nz)k=nz-1; - d.a[i0] = a[i+nx*(j+ny*k)]; - } - return d; - } - // this is 1d data -> try as normal SubData() - if(xx.nx>1 || xx.a[0]>=0) { n=xx.nx; ix=true; } - else { n=nx; ix=false; } - if(yy.nx>1 || yy.a[0]>=0) { m=yy.nx; iy=true; } - else { m=ny; iy=false; } - if(zz.nx>1 || zz.a[0]>=0) { l=zz.nx; iz=true; } - else { l=nz; iz=false; } - d.Create(n,m,l); - for(i=0;i=nx)x=nx-1; - y = iy?int(yy.a[j]+0.5):j; if(y<0)y=0; if(y>=ny)y=ny-1; - z = iz?int(zz.a[k]+0.5):k; if(z<0)z=0; if(z>=nz)z=nz-1; - d.a[i+n*(j+m*k)] = a[x+nx*(y+ny*z)]; - } - if(m==1) { d.ny=d.nz; d.nz=1; }// "squeeze" dimensions - if(n==1) { d.nx=d.ny; d.ny=d.nz; d.nz=1; d.NewId();} - return d; -} -//----------------------------------------------------------------------------- -mglData mglData::SubData(int xx,int yy,int zz) const -{ - mglData x,y,z; - x.a[0]=xx; y.a[0]=yy; z.a[0]=zz; - return SubData(x,y,z); -} -//----------------------------------------------------------------------------- -mglData mglData::Column(const char *eq) -{ - mglFormula f(eq); - mglData d; - d.Create(ny,nz); - mreal var[MGL_VS]; - memset(var,0,('z'-'a')*sizeof(mreal)); - register long i,j; - for(i=0;i='a' && id[j]<='z') - var[id[j]-'a'] = a[j+nx*i]; - d.a[i] = f.Calc(var); - } - return d; -} -//----------------------------------------------------------------------------- -void mglData::SetColumnId(const char *ids) -{ - NewId(); // clearing + be sure about correct length - if(ids) for(long i=0;i=nz && nz>1)) for(long k=0;k1) // äëÿ 3D -- ïëîñêîñòü - { - for(long i=0;i0) - { - if(m=0;i--) if(buf[i]>' ') break; - buf[i+1]=0; nb = i; // remove tailing spaces - for(i=0;i' ' && !first) first=true; - if(first && (ch==' ' || ch=='\t') && buf[i+1]>' ') k++; - } - first = false; - for(i=0;i0 ? mx:1; ny = my>0 ? my:1; nz = mz>0 ? mz:1; - if(a) { delete []a; delete []id; } - a = new mreal[nx*ny*nz]; - id = new char[nx]; - memset(a,0,nx*ny*nz*sizeof(mreal)); - memset(id,0,nx*sizeof(char)); -} -//----------------------------------------------------------------------------- -bool mglData::Read(const char *fname,int mx,int my,int mz) -{ - if(mx<=0 || my<=0 || mz<=0) return false; - gzFile fp = gzopen(fname,"r"); - if(!fp) return false; - Create(mx,my,mz); - char *buf = mgl_read_gz(fp); - long nb = strlen(buf); gzclose(fp); - - register long i=0, j=0, k=0; - while(j0 || buf[j+1]!='#') // this is columns id - while(!isn(buf[j]) && j='a' && buf[j]<='z') - id[k++] = buf[j]; - j++; - } - } -// while(buf[j]!='\n' && j' ' && j=nx*ny*nz) break; - } - free(buf); - return true; -} -//----------------------------------------------------------------------------- -bool mglData::ReadMat(const char *fname,int dim) -{ - if(dim<=0 || dim>3) return false; - gzFile fp = gzopen(fname,"r"); - if(!fp) return false; - nx = ny = nz = 1; NewId(); - char *buf = mgl_read_gz(fp); - long nb = strlen(buf); gzclose(fp); - - register long i=0,j=0; - while(j' ') j++; - } - else if(dim==2) - { - sscanf(buf+j,"%ld%ld",&nx,&ny); - while(buf[j]>' ' && j' ' && j' ' && j' ' && j' ' && j=nx*ny*nz) break; - while(buf[j]>' ' && j=nx || j<0 || j>=ny || k<0 || k>=nz; - if(not_ok) return 0; - return a[i+nx*(j+ny*k)]; -} -//----------------------------------------------------------------------------- -mglData mglData::Resize(int mx, int my, int mz, mreal x1, mreal x2, - mreal y1, mreal y2, mreal z1, mreal z2) const -{ - register long i,j,k; - mglData d; - mx = mx<1 ? 1:mx; my = my<1 ? 1:my; mz = mz<1 ? 1:mz; - d.Create(mx,my,mz); - mreal dx, dy, dz; - dx = mx>1 ? (x2-x1)/(mx-1):0; - dy = my>1 ? (y2-y1)/(my-1):0; - dz = mz>1 ? (z2-z1)/(mz-1):0; - for(i=0;ia[i] ? m : a[i]; - return m; -} -//----------------------------------------------------------------------------- -mreal mglData::Minimal() const -{ - register mreal m=1e10; - for(long i=0;ia[i]) - { m=a[i]; im=i%nx; jm=(i/nx)%ny; km=i/(nx*ny); } - return m; -} -//----------------------------------------------------------------------------- -mreal mglData::Maximal(mreal &x,mreal &y,mreal &z) const -{ - int im=-1,jm=-1,km=-1; - register long tm,i; - mreal m=Maximal(im,jm,km); - x=im; y=jm; z=km; - - if(nx>2) - { - if(im==0) im=1; - if(im==nx-1)im=nx-2; - x = (a[im+1]+a[im-1]-2*a[im])==0 ? im : im+(a[im+1]-a[im-1])/(a[im+1]+a[im-1]-2*a[im])/2; - } - if(ny>2) - { - if(jm==0) jm=1; - if(jm==ny-1)jm=ny-2; - i=nx; tm = jm*nx; - y = (a[tm+i]+a[tm-i]-2*a[tm])==0? jm : jm+(a[tm+i]-a[tm-i])/(a[tm+i]+a[tm-i]-2*a[tm])/2; - } - if(nz>2) - { - if(km==0) km=1; - if(km==nz-1)km=nz-2; - i=nx*ny; tm = km*i; - z = (a[tm+i]+a[tm-i]-2*a[tm])==0? km : km+(a[tm+i]-a[tm-i])/(a[tm+i]+a[tm-i]-2*a[tm])/2; - } - return m; -} -//----------------------------------------------------------------------------- -mreal mglData::Minimal(mreal &x,mreal &y,mreal &z) const -{ - int im=-1,jm=-1,km=-1; - register long tm,i; - mreal m=Minimal(im,jm,km); - x=im; y=jm; z=km; - if(nx>2) - { - if(im==0) im=1; - if(im==nx-1)im=nx-2; - x = im+(a[im+1]-a[im-1])/(a[im+1]+a[im-1]-2*a[im])/2; - } - if(ny>2) - { - if(jm==0) jm=1; - if(jm==ny-1)jm=ny-2; - i=nx; tm = jm*nx; - y = jm+(a[tm+i]-a[tm-i])/(a[tm+i]+a[tm-i]-2*a[tm])/2; - } - if(nz>2) - { - if(km==0) km=1; - if(km==nz-1)km=nz-2; - i=nx*ny; tm = km*i; - z = km+(a[tm+i]-a[tm-i])/(a[tm+i]+a[tm-i]-2*a[tm])/2; - } - return m; -} -//----------------------------------------------------------------------------- -void mglData::Modify(const char *eq,int dim) -{ - long i,j,k; - mreal y,z,dx=nx>1?1/(nx-1.):0,dy=ny>1?1/(ny-1.):0, *aa; - mglFormula eqs(eq); - if(dim<0) dim=0; - if(nz>1) // 3D array - { - for(k=dim;kdim+1) ? (k-dim)/(nz-dim-1.) : 0; - aa = a+nx*ny*k; -//#pragma omp parallel for - for(i=0;idim+1 ? 1/(ny-dim-1.) : 0; - for(j=dim;j'z') dir='x'; - for(k=0;k1 ? i/(nx-1.):0; - if(dir=='y') x = ny>1 ? j/(ny-1.):0; - if(dir=='z') x = nz>1 ? k/(nz-1.):0; - a[i+nx*(j+ny*k)] = x1+(x2-x1)*x; - } -} -//----------------------------------------------------------------------------- -void mglData::Norm(mreal v1,mreal v2,bool sym,int dim) -{ - long i,s,nn=nx*ny*nz; - mreal a1=1e20,a2=-1e20,v; - if(nz>1) s = dim*nx*ny; - else s = dim*ny; - for(i=s;ia[i] ? a2 : a[i]); - } - if(a1==a2) { if(a1!=0) a1=0.; else a2=1; } - if(v1>v2) { v=v1; v1=v2; v2=v; } // swap if uncorrect - if(sym) // use symmetric - { - v2 = -v1>v2 ? -v1:v2; v1 = -v2; - a2 = -a1>a2 ? -a1:a2; a1 = -a2; - } - for(i=s;i=nx) rx=nx-1; if(rx<1) rx=1; - if(ry>=ny) ry=ny-1; if(ry<1) ry=1; - if(rz>=nz) rz=nz-1; if(rz<1) rz=1; - // new sizes - kx = 1+(nx-1)/rx; ky = 1+(ny-1)/ry; kz = 1+(nz-1)/rz; - b = new mreal[kx*ky*kz]; - if(!smooth) for(i=0;i1 || (ny>1 && b.ny>1) || b.nz>1) return d; - long n1=ny,n2=b.nx; - bool dim2=true; - if(ny==1) { n1 = b.nx; n2 = b.ny; dim2 = false; } - d.Create(nx,n1,n2); - register long i,j; - if(dim2) n1=nx*ny; else { n1=nx; n2=b.nx*b.ny; } - for(i=0;i2 || n1==0) return; - long mx,my,mz; - mreal *b=0; - register long i,j; - if(n1>0) // extend to higher dimension(s) - { - n2 = n2>0 ? n2:1; - mx = nx; my = ny>1?ny:n1; mz = ny>1 ? n1 : n2; - b = new mreal[mx*my*mz]; - if(ny>1) for(i=0;i0 && ny==1) mz = n2; - b = new mreal[mx*my*mz]; - if(n2<0) for(i=0;i0 && ny==1) for(i=0;i1?1/(nx-1.):0,dy=ny>1?1/(ny-1.):0,dz=nz>1?1/(nz-1.):0; - mglFormula eqs(eq); - for(k=0;k1?1/(nx-1.):0,dy=ny>1?1/(ny-1.):0,dz=nz>1?1/(nz-1.):0; - mglFormula eqs(eq); - for(k=0;knx*v->ny*v->nz!=nx*ny*nz) return; - if(w && w->nx*w->ny*w->nz!=nx*ny*nz) return; - long i,j,k,i0; - mreal x,y,z,dx=nx>1?(r2.x-r1.x)/(nx-1.):0; - mreal dy=ny>1?(r2.y-r1.y)/(ny-1.):0; - mreal dz=nz>1?(r2.z-r1.z)/(nz-1.):0; - mglFormula eqs(eq); - for(k=0;ka[i0]:0, w?w->a[i0]:0); - } -} -//----------------------------------------------------------------------------- -void mglData::ReadHDF4(const char *fname,const char *data) -{ -#ifdef HAVE_HDF4 - int32 sd = SDstart(fname,DFACC_READ), nn, i; - if(sd==-1) return; // is not a HDF4 file - char name[64]; - SDfileinfo(sd,&nn,&i); - for(i=0;i0 && !rewrite) hf = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); - else hf = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - if(hf<0) return; - if(nz==1 && ny == 1) { rank = 1; dims[0] = nx; } - else if(nz==1) { rank = 2; dims[0] = ny; dims[1] = nx; } - else { rank = 3; dims[0] = nz; dims[1] = ny; dims[2] = nx; } - hs = H5Screate_simple(rank, dims, 0); -#if(MGL_USE_DOUBLE==1) -#ifndef H5_USE_16_API - hd = H5Dcreate(hf, data, H5T_NATIVE_DOUBLE, hs, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); -#else /* ! HAVE_HDF5_18 */ - hd = H5Dcreate(hf, data, H5T_NATIVE_DOUBLE, hs, H5P_DEFAULT); -#endif /* HAVE_HDF5_18 */ - H5Dwrite(hd, H5T_NATIVE_DOUBLE, hs, hs, H5P_DEFAULT, a); -#else -#ifndef H5_USE_16_API - hd = H5Dcreate(hf, data, H5T_NATIVE_FLOAT, hs, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); -#else /* ! HAVE_HDF5_18 */ - hd = H5Dcreate(hf, data, H5T_NATIVE_FLOAT, hs, H5P_DEFAULT); -#endif /* HAVE_HDF5_18 */ - H5Dwrite(hd, H5T_NATIVE_FLOAT, hs, hs, H5P_DEFAULT, a); -#endif - H5Dclose(hd); H5Sclose(hs); H5Fclose(hf); -} -//----------------------------------------------------------------------------- -void mglData::ReadHDF(const char *fname,const char *data) -{ - hid_t hf,hd,hs; - hsize_t dims[3]; - long rank, res = H5Fis_hdf5(fname); - if(res<=0) { ReadHDF4(fname,data); return; } - hf = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); if(hf<0) return; -#ifndef H5_USE_16_API - hd = H5Dopen(hf,data,H5P_DEFAULT); -#else - hd = H5Dopen(hf,data); -#endif - if(hd<0) return; - hs = H5Dget_space(hd); - rank = H5Sget_simple_extent_ndims(hs); - if(rank>0 && rank<=3) - { - H5Sget_simple_extent_dims(hs,dims,0); - nx = ny = nz = 1; - switch(rank) - { - case 1: nx = dims[0]; break; - case 2: nx = dims[1]; ny = dims[0]; break; - case 3: nx = dims[2]; ny = dims[1]; nz = dims[0]; break; - } - delete []a; a = new mreal[nx*ny*nz]; NewId(); -#if(MGL_USE_DOUBLE==1) - H5Dread(hd, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, a); -#else - H5Dread(hd, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, a); -#endif - } - H5Dclose(hd); H5Sclose(hs); H5Fclose(hf); -} -#else -void mglData::SaveHDF(const char *,const char *,bool ) const {} -void mglData::ReadHDF(const char *,const char *) {} -#endif -//----------------------------------------------------------------------------- -bool mgl_add_file(long &kx,long &ky, long &kz, mreal *&b, mglData &d,bool as_slice) -{ - if(as_slice && d.nz==1) - { - if(kx==d.nx && d.ny==1) - { - b = (mreal *)realloc(b,kx*(ky+1)*sizeof(mreal)); - memcpy(b+kx*ky,d.a,kx*sizeof(mreal)); ky++; - } - else if(kx==d.nx && ky==d.ny) - { - b = (mreal *)realloc(b,kx*ky*(kz+1)*sizeof(mreal)); - memcpy(b+kx*ky*kz,d.a,kx*ky*sizeof(mreal)); kz++; - } - else return false; - } - else - { - if(d.ny*d.nz==1 && ky*kz==1) - { - b = (mreal *)realloc(b,(kx+d.nx)*sizeof(mreal)); - memcpy(b+kx,d.a,d.nx*sizeof(mreal)); kx+=d.nx; - } - else if(kx==d.nx && kz==1 && d.nz==1) - { - b = (mreal *)realloc(b,kx*(ky+d.ny)*sizeof(mreal)); - memcpy(b+kx*ky,d.a,kx*d.ny*sizeof(mreal)); ky+=d.ny; - } - else if(kx==d.nx && ky==d.ny) - { - b = (mreal *)realloc(b,kx*kx*(kz+d.nz)*sizeof(mreal)); - memcpy(b+kx*ky*kz,d.a,kx*ky*d.nz*sizeof(mreal)); kz+=d.nz; - } - else return false; - } - return true; -} -//----------------------------------------------------------------------------- -bool mglData::ReadRange(const char *templ, mreal from, mreal to, mreal step, bool as_slice) -{ - mglData d; - mreal t = from, *b; - long kx,ky,kz; - char *fname = new char[strlen(templ)+20]; - - //read first file - do{ sprintf(fname,templ,t); t+= step; } while(!d.Read(fname) && t<=to); - - if(t>to) return false; - kx = d.nx; ky = d.ny; kz = d.nz; - b = (mreal *)malloc(kx*ky*kz*sizeof(mreal)); - memcpy(b,d.a,kx*ky*kz*sizeof(mreal)); - - // read other files - for(;t<=to;t+=step) - { - sprintf(fname,templ,t); - if(d.Read(fname)) - if(!mgl_add_file(kx,ky,kz,b,d,as_slice)) - return false; - } - Set(b,kx,ky,kz); - delete []fname; free(b); - return true; -} -//----------------------------------------------------------------------------- -bool mglData::ReadAll(const char *templ, bool as_slice) -{ -#ifndef WIN32 - mglData d; - glob_t res; - unsigned long i; - mreal *b; - long kx,ky,kz; - char *fname = new char[256]; - glob (templ, GLOB_TILDE, NULL, &res); - - //read first file - for(i=0;i=res.gl_pathc) { delete []fname; return false; } - kx = d.nx; ky = d.ny; kz = d.nz; - b = (mreal *)malloc(kx*ky*kz*sizeof(mreal)); - memcpy(b,d.a,kx*ky*kz*sizeof(mreal)); - - for(;i &d) -{ if(d.size()<1) return; - Create(d.size()); for(long i=0;i &d) -{ if(d.size()<1) return; - Create(d.size()); for(long i=0;i &d) -{ if(d.size()<1) return; - Create(d.size()); for(long i=0;i * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 -#include -#include "mgl/mgl_eps.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -void mgl_printf(void *fp, bool gz, const char *str, ...); -//----------------------------------------------------------------------------- -int mgl_compare_prim(const void *p1, const void *p2) -{ - mglPrim *a1=(mglPrim *)p1, *a2=(mglPrim *)p2; - if( a1->z < a2->z-0.5 ) return -1; - if( a1->z > a2->z+0.5 ) return 1; - if( a1->w < a2->w ) return -1; - if( a1->w > a2->w ) return 1; - if( a1->style < a2->style ) return -1; - if( a1->style > a2->style ) return 1; - if( a2->type != a1->type ) return a2->type - a1->type; - if( a1->type==1 && (a1->x[0]!=a2->x[0]) ) - return (a2->x[0]x[0]) ? 1 : -1; - if( a1->type==1 ) return (a2->y[0]y[0]) ? 1 : -1; - return 0; -} -//----------------------------------------------------------------------------- -mglGraphPS::mglGraphPS(int w,int h) : mglGraphAB(w,h) -{ P = 0; pMax = pNum = 0; } -//----------------------------------------------------------------------------- -mglGraphPS::~mglGraphPS() { if(P) delete []P; } -//----------------------------------------------------------------------------- -void mglGraphPS::Ball(mreal x,mreal y,mreal z,mglColor col,mreal alpha) -{ - if(alpha==0) return; - if(alpha<0) { alpha = -alpha; } - else { if(!ScalePoint(x,y,z)) return; } - if(!col.Valid()) col = mglColor(1.,0.,0.); - mreal p[3] = {x,y,z}; PostScale(p,1); - mglPrim a; a.m = '.'; - a.x[0] = p[0]; a.y[0] = p[1]; a.z = a.zz[0]=p[2]; - a.c[0] = col.r; a.c[1] = col.g; a.c[2] = col.b; - add_prim(a); -} -//----------------------------------------------------------------------------- -void mglGraphPS::ball(mreal *p,mreal *c) -{ - mglPrim a; PostScale(p,1); a.m = '.'; - a.x[0] = p[0]; a.y[0] = p[1]; a.z = a.zz[0]=p[2]; - memcpy(a.c,c,3*sizeof(mreal)); - add_prim(a); -} -//----------------------------------------------------------------------------- -void mglGraphPS::mark_plot(mreal *p, char type) -{ - mglPrim a; a.m = type; a.s = MarkSize;//*175*font_factor; - a.x[0] = p[0]; a.y[0] = p[1]; a.z = a.zz[0]=p[2]; - memcpy(a.c,CDef,3*sizeof(mreal)); - add_prim(a); -} -//----------------------------------------------------------------------------- -void mglGraphPS::line_plot(mreal *p1,mreal *p2,mreal *c1,mreal *c2,bool all) -{ - if((PDef==0 && !all) || (fabs(p1[0]-p2[0])<0.01 && fabs(p1[1]-p2[1])<0.01)) return; - mglPrim a(1); - mreal pw = fabs(PenWidth); - a.z = (p1[2]+p2[2])/2; a.w = pw; - if(pw>1) a.z += pw-1; - a.x[0]=p1[0]; a.y[0]=p1[1]; a.x[1]=p2[0]; a.y[1]=p2[1]; - a.zz[0]=p1[2]; a.zz[1]=p2[2]; - a.c[0]=(c1[0]+c2[0])/2; a.c[1]=(c1[1]+c2[1])/2; a.c[2]=(c1[2]+c2[2])/2; -// a.c[0]=c1[0]; a.c[1]=c1[1]; a.c[2]=c1[2]; - a.style=all? 0xffff:PDef; a.s = pPos; - add_prim(a); - pPos = fmod(pPos+hypot(p2[0]-p1[0], p2[1]-p1[1])/pw/1.5, 16); -} -//----------------------------------------------------------------------------- -void mglGraphPS::trig_plot(mreal *p3,mreal *p1,mreal *p2,mreal *c3,mreal *c1,mreal *c2) -{ - bool pnt = fabs(p1[0]-p2[0])<0.01 && fabs(p1[1]-p2[1])<0.01 && - fabs(p1[0]-p3[0])<0.01 && fabs(p1[1]-p3[1])<0.01; - if(pnt) return; - mglPrim a(2); - a.z = (p1[2]+p2[2]+p3[2])/3; - a.x[0]=p1[0]; a.y[0]=p1[1]; a.zz[0]=p1[2]; - a.x[1]=p2[0]; a.y[1]=p2[1]; a.zz[1]=p2[2]; - a.x[2]=p3[0]; a.y[2]=p3[1]; a.zz[2]=p3[2]; - - mreal d1[3],d2[3]; - d1[0] = p1[0]-p3[0]; d2[0] = p2[0]-p3[0]; d1[1] = p1[1]-p3[1]; - d2[1] = p2[1]-p3[1]; d1[2] = p1[2]-p3[2]; d2[2] = p2[2]-p3[2]; - a.c[0]=(c1[0]+c2[0]+c3[0])/3; a.c[1]=(c1[1]+c2[1]+c3[1])/3; - a.c[2]=(c1[2]+c2[2]+c3[2])/3; a.c[3]=(c1[3]+c2[3]+c3[3])/3; - add_light(a.c, d2[2]*d1[1]-d2[1]*d1[2], d2[0]*d1[2]-d2[2]*d1[0], d2[1]*d1[0]-d2[0]*d1[1]); - add_prim(a); -} -//----------------------------------------------------------------------------- -void mglGraphPS::trig_plot_n(mreal *p3,mreal *p1,mreal *p2, - mreal *c3,mreal *c1,mreal *c2,mreal *n3,mreal *n1,mreal *n2) -{ - bool pnt = fabs(p1[0]-p2[0])<0.01 && fabs(p1[1]-p2[1])<0.01 && - fabs(p1[0]-p3[0])<0.01 && fabs(p1[1]-p3[1])<0.01; - if(pnt) return; - mglPrim a(2); - a.z = (p1[2]+p2[2]+p3[2])/3; - a.x[0]=p1[0]; a.y[0]=p1[1]; a.zz[0]=p1[2]; - a.x[1]=p2[0]; a.y[1]=p2[1]; a.zz[1]=p2[2]; - a.x[2]=p3[0]; a.y[2]=p3[1]; a.zz[2]=p3[2]; - a.c[0]=(c1[0]+c2[0]+c3[0])/3; a.c[1]=(c1[1]+c2[1]+c3[1])/3; - a.c[2]=(c1[2]+c2[2]+c3[2])/3; a.c[3]=(c1[3]+c2[3]+c3[3])/3; - add_light(a.c, (n1[0]+n2[0]+n3[0])/3, (n1[1]+n2[1]+n3[1])/3, (n1[2]+n2[2]+n3[2])/3); - add_prim(a); -} -//----------------------------------------------------------------------------- -void mglGraphPS::quad_plot(mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal *c0,mreal *c1,mreal *c2,mreal *c3) -{ - bool pnt = fabs(p1[0]-p2[0])<0.01 && fabs(p1[1]-p2[1])<0.01 && - fabs(p1[0]-p3[0])<0.01 && fabs(p1[1]-p3[1])<0.01 && - fabs(p1[0]-p0[0])<0.01 && fabs(p1[1]-p0[1])<0.01; - if(pnt) return; - mglPrim a(3); - a.z = (p1[2]+p2[2]+p3[2]+p0[2])/4; - a.x[0]=p0[0]; a.y[0]=p0[1]; a.zz[0]=p0[2]; - a.x[1]=p1[0]; a.y[1]=p1[1]; a.zz[1]=p1[2]; - a.x[2]=p2[0]; a.y[2]=p2[1]; a.zz[2]=p2[2]; - a.x[3]=p3[0]; a.y[3]=p3[1]; a.zz[3]=p3[2]; - mreal d1[3]; - d1[0]=-p0[2]*p1[1]+p0[1]*p1[2]+p0[2]*p2[1]-p0[1]*p2[2]-p1[2]*p3[1]+ - p2[2]*p3[1]+p1[1]*p3[2]-p2[1]*p3[2]; - d1[1]= p0[2]*p1[0]-p0[0]*p1[2]-p0[2]*p2[0]+p0[0]*p2[2]+ - p1[2]*p3[0]-p2[2]*p3[0]-p1[0]*p3[2]+p2[0]*p3[2]; - d1[2]=-p0[1]*p1[0]+p0[0]*p1[1]+p0[1]*p2[0]-p0[0]*p2[1]-p1[1]*p3[0]+ - p2[1]*p3[0]+p1[0]*p3[1]-p2[0]*p3[1]; - a.c[0]=(c1[0]+c2[0]+c3[0]+c0[0])/4; a.c[1]=(c1[1]+c2[1]+c3[1]+c0[1])/4; - a.c[2]=(c1[2]+c2[2]+c3[2]+c0[2])/4; a.c[3]=(c1[3]+c2[3]+c3[3]+c0[3])/4; - add_light(a.c, d1[0], d1[1], d1[2]); - add_prim(a); -} -//----------------------------------------------------------------------------- -void mglGraphPS::quad_plot_n(mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal *c0,mreal *c1,mreal *c2,mreal *c3,mreal *n0,mreal *n1,mreal *n2,mreal *n3) -{ - bool pnt = fabs(p1[0]-p2[0])<0.01 && fabs(p1[1]-p2[1])<0.01 && - fabs(p1[0]-p3[0])<0.01 && fabs(p1[1]-p3[1])<0.01 && - fabs(p1[0]-p0[0])<0.01 && fabs(p1[1]-p0[1])<0.01; - if(pnt) return; - mglPrim a(3); - a.z = (p1[2]+p2[2]+p3[2]+p0[2])/4; - a.x[0]=p0[0]; a.y[0]=p0[1]; a.zz[0]=p0[2]; - a.x[1]=p1[0]; a.y[1]=p1[1]; a.zz[1]=p1[2]; - a.x[2]=p2[0]; a.y[2]=p2[1]; a.zz[2]=p2[2]; - a.x[3]=p3[0]; a.y[3]=p3[1]; a.zz[3]=p3[2]; - a.c[0]=(c1[0]+c2[0]+c3[0]+c0[0])/4; a.c[1]=(c1[1]+c2[1]+c3[1]+c0[1])/4; - a.c[2]=(c1[2]+c2[2]+c3[2]+c0[2])/4; a.c[3]=(c1[3]+c2[3]+c3[3]+c0[3])/4; - add_light(a.c, n1[0]+n2[0]+n3[0]+n0[0], n1[1]+n2[1]+n3[1]+n0[1], n1[2]+n2[2]+n3[2]+n0[2]); - add_prim(a); -} -//----------------------------------------------------------------------------- -void mglGraphPS::quad_plot_a(mreal *p0,mreal *p1,mreal *p2,mreal *p3, - mreal a0,mreal a1,mreal a2,mreal a3, mreal alpha) -{ -/* bool pnt = fabs(p1[0]-p2[0])<0.01 && fabs(p1[1]-p2[1])<0.01 && - fabs(p1[0]-p3[0])<0.01 && fabs(p1[1]-p3[1])<0.01 && - fabs(p1[0]-p0[0])<0.01 && fabs(p1[1]-p0[1])<0.01; - if(pnt) return;*/ - mglPrim a(3); - a.z = (p1[2]+p2[2]+p3[2]+p0[2])/4; - a.x[0]=p0[0]; a.y[0]=p0[1]; a.zz[0]=p0[2]; - a.x[1]=p1[0]; a.y[1]=p1[1]; a.zz[1]=p1[2]; - a.x[2]=p2[0]; a.y[2]=p2[1]; a.zz[2]=p2[2]; - a.x[3]=p3[0]; a.y[3]=p3[1]; a.zz[3]=p3[2]; - mreal v = (a0+a1+a2+a3)/4; - mglColor c(GetC(v,false)); - a.c[0]=c.r; a.c[1]=c.g; a.c[2]=c.b; - a.c[3]=alpha>0 ? alpha*(v+1)*(v+1) : -alpha*(v-1)*(v-1); - add_prim(a); -} -//----------------------------------------------------------------------------- -void mglGraphPS::Glyph(mreal x, mreal y, mreal f, int s, long j, char col) -{ - mglPrim a(4); - a.s = fscl/PlotFactor; a.w = ftet; - a.x[0] = (xPos - zoomx1*Width) /zoomx2; - a.y[0] = (yPos - zoomy1*Height)/zoomy2; - a.x[1] = x; a.y[1] = y; - a.zz[1] = f/fnt->GetFact(s&3); - a.style = s; a.m = j; - a.z = a.zz[0] = zPos; - mglColor cc = mglColor(col); - if(!cc.Valid()) cc = mglColor(CDef[0],CDef[1],CDef[2]); - a.c[0] = cc.r; a.c[1] = cc.g; a.c[2] = cc.b; a.c[3] = CDef[3]; - add_prim(a); -} -//----------------------------------------------------------------------------- -void mglGraphPS::Clf(mglColor Back) -{ - Fog(0); - pNum=0; - pPos = 0; CurrPal = -1; PDef = 0xffff; - memset(G,0,3*Width*Height); - memset(G4,0,4*Width*Height); - if(Back.Valid()) - { - BDef[0] = (unsigned char)(255*Back.r); - BDef[1] = (unsigned char)(255*Back.g); - BDef[2] = (unsigned char)(255*Back.b); - if(TranspType==2) Back = mglColor(0,0,0); - } -} -//----------------------------------------------------------------------------- -void mglGraphPS::add_prim(mglPrim &a) -{ - if(!P) - { - pMax = 1000; - P = (mglPrim *)malloc(pMax*sizeof(mglPrim)); - } - else if(pNum+1>pMax) - { - pMax += 1000; - P = (mglPrim *)realloc(P, pMax*sizeof(mglPrim)); - } - // fog - mreal zz = FogDist*(a.z/Depth-0.5-FogDz); - if(zz<0) - { - mreal d = 1-exp(5*zz); - if(255*d>=254) return; // not visible under fog - mreal cb[3] = {BDef[0]/255., BDef[1]/255., BDef[2]/255.}, b = 1-d; - a.c[0] = a.c[0]*b + cb[0]*d; a.c[1] = a.c[1]*b + cb[1]*d; - a.c[2] = a.c[2]*b + cb[2]*d; a.c[3] = a.c[3]*b + d; - } - - a.c[0] = int(a.c[0]*100)*0.01; a.c[1] = int(a.c[1]*100)*0.01; - a.c[2] = int(a.c[2]*100)*0.01; a.c[3] = UseAlpha ? int(a.c[3]*500)*0.002 : 1; -// i(a->c[3]<0) a->c[3] = 0; if(a->c[3]>1) a->c[3] = 1; - a.x[0] = int(a.x[0]*100)*0.01; a.x[1] = int(a.x[1]*100)*0.01; - a.x[2] = int(a.x[2]*100)*0.01; a.x[3] = int(a.x[3]*100)*0.01; - a.y[0] = int(a.y[0]*100)*0.01; a.y[1] = int(a.y[1]*100)*0.01; - a.y[2] = int(a.y[2]*100)*0.01; a.y[3] = int(a.y[3]*100)*0.01; - a.id = ObjId; P[pNum]=a; - pNum++; Finished = false; -} -//----------------------------------------------------------------------------- -void mglGraphPS::add_light(mreal *b, mreal n0,mreal n1, mreal n2) -{ - mreal n[3]={n0,n1,n2}; - unsigned char r[4]; - col2int(b,n,r); - b[0]=r[0]/255.; b[1]=r[1]/255.; b[2]=r[2]/255.; b[3]=r[3]/255.; -} -//----------------------------------------------------------------------------- -char *mgl_get_dash(unsigned short d, mreal w) -{ - static char s[64],b[4]; - if(d==0xffff) { strcpy(s,""); return s; } - int f=0, p=d&1, n=p?0:1, i, j; - strcpy(s, p ? "" : "0"); - for(i=0;i<16;i++) - { - j = i;//15-i; - if(((d>>j)&1) == p) f++; - else - { - sprintf(b," %g",f*w); strcat(s,b); - p = (d>>j)&1; f = 1; n++; - } - } - sprintf(b," %g",f*w); strcat(s,b); - strcat(s,n%2 ? "" : " 0"); - return s; -} -//----------------------------------------------------------------------------- -bool mglPrim::IsSame(mreal wp,mreal *cp,int st) -{ - if(abs(type)!=1) return false; - if(w>=1 && wp!=w) return false; - if(w<1 && wp!=1) return false; - if(st!=style) return false; - return (cp[0]==c[0] && cp[1]==c[1] && cp[2]==c[2]); -} -//----------------------------------------------------------------------------- -void mglGraphPS::WriteEPS(const char *fname,const char *descr) -{ - if(!P) return; - if(!Finished) Finish(); - time_t now; - time(&now); - - bool gz = fname[strlen(fname)-1]=='z'; - void *fp = gz ? gzopen(fname,"wt") : fopen(fname,"wt"); - if(!fp) { SetWarn(mglWarnOpen,fname); return; } - mgl_printf(fp, gz, "%%!PS-Adobe-3.0 EPSF-3.0\n%%%%BoundingBox: 0 0 %d %d\n",Width,Height); - mgl_printf(fp, gz, "%%%%Creator: MathGL library\n%%%%Title: %s\n",descr ? descr : fname); - mgl_printf(fp, gz, "%%%%CreationDate: %s\n",ctime(&now)); - mgl_printf(fp, gz, "/lw {setlinewidth} def\n/rgb {setrgbcolor} def\n"); - mgl_printf(fp, gz, "/np {newpath} def\n/cp {closepath} def\n"); - mgl_printf(fp, gz, "/ll {lineto} def\n/mt {moveto} def\n"); - mgl_printf(fp, gz, "/rl {rlineto} def\n/rm {rmoveto} def\n/dr {stroke} def\n"); - mgl_printf(fp, gz, "/ss {%g} def\n",MarkSize*0.4*font_factor);// remove *font_factor); ??? - mgl_printf(fp, gz, "/s2 {%g} def\n",MarkSize*0.8*font_factor);// remove *font_factor); ??? - mgl_printf(fp, gz, "/sm {-%g} def\n",MarkSize*0.4*font_factor);//remove *font_factor); ??? - mgl_printf(fp, gz, "/m_c {ss 0.3 mul 0 360 arc} def\n"); - mgl_printf(fp, gz, "/d0 {[] 0 setdash} def\n/sd {setdash} def\n"); - - bool m_p=false,m_x=false,m_d=false,m_v=false,m_t=false, - m_s=false,m_a=false,m_o=false,m_T=false, - m_V=false,m_S=false,m_D=false,m_Y=false,m_l=false, - m_L=false,m_r=false,m_R=false,m_X=false,m_P=false; - register long i; - // add mark definition if present - for(i=0;i0) continue; if(P[i].m=='+') m_p = true; - if(P[i].m=='x') m_x = true; if(P[i].m=='s') m_s = true; - if(P[i].m=='d') m_d = true; if(P[i].m=='v') m_v = true; - if(P[i].m=='^') m_t = true; if(P[i].m=='*') m_a = true; - if(P[i].m=='o' || P[i].m=='O' || P[i].m=='C') m_o = true; - if(P[i].m=='S') m_S = true; if(P[i].m=='D') m_D = true; - if(P[i].m=='V') m_V = true; if(P[i].m=='T') m_T = true; - if(P[i].m=='<') m_l = true; if(P[i].m=='L') m_L = true; - if(P[i].m=='>') m_r = true; if(P[i].m=='R') m_R = true; - if(P[i].m=='Y') m_Y = true; - if(P[i].m=='P') m_P = true; if(P[i].m=='X') m_X = true; - } - if(m_P) { m_p=true; m_s=true; } - if(m_X) { m_x=true; m_s=true; } - if(m_p) mgl_printf(fp, gz, "/m_p {sm 0 rm s2 0 rl sm sm rm 0 s2 rl d0} def\n"); - if(m_x) mgl_printf(fp, gz, "/m_x {sm sm rm s2 s2 rl 0 sm 2 mul rm sm 2 mul s2 rl d0} def\n"); - if(m_s) mgl_printf(fp, gz, "/m_s {sm sm rm 0 s2 rl s2 0 rl 0 sm 2 mul rl cp d0} def\n"); - if(m_d) mgl_printf(fp, gz, "/m_d {sm 0 rm ss ss rl ss sm rl sm sm rl cp d0} def\n"); - if(m_v) mgl_printf(fp, gz, "/m_v {sm ss 2 div rm s2 0 rl sm sm 1.5 mul rl d0 cp} def\n"); - if(m_t) mgl_printf(fp, gz, "/m_t {sm sm 2 div rm s2 0 rl sm ss 1.5 mul rl d0 cp} def\n"); - if(m_a) mgl_printf(fp, gz, "/m_a {sm 0 rm s2 0 rl sm 1.6 mul sm 0.8 mul rm ss 1.2 mul ss 1.6 mul rl 0 sm 1.6 mul rm sm 1.2 mul ss 1.6 mul rl d0} def\n"); - if(m_o) mgl_printf(fp, gz, "/m_o {ss 0 360 d0 arc} def\n"); - if(m_S) mgl_printf(fp, gz, "/m_S {sm sm rm 0 s2 rl s2 0 rl 0 sm 2 mul rl cp} def\n"); - if(m_D) mgl_printf(fp, gz, "/m_D {sm 0 rm ss ss rl ss sm rl sm sm rl cp} def\n"); - if(m_V) mgl_printf(fp, gz, "/m_V {sm ss 2 div rm s2 0 rl sm sm 1.5 mul rl cp} def\n"); - if(m_T) mgl_printf(fp, gz, "/m_T {sm sm 2 div rm s2 0 rl sm ss 1.5 mul rl cp} def\n"); - if(m_Y) mgl_printf(fp, gz, "/m_Y {0 sm rm 0 ss rl sm ss rl s2 0 rm sm sm rl d0} def\n"); - if(m_r) mgl_printf(fp, gz, "/m_r {sm 2 div sm rm 0 s2 rl ss 1.5 mul sm rl d0 cp} def\n"); - if(m_l) mgl_printf(fp, gz, "/m_l {ss 2 div sm rm 0 s2 rl sm 1.5 mul sm rl d0 cp} def\n"); - if(m_R) mgl_printf(fp, gz, "/m_R {sm 2 div sm rm 0 s2 rl ss 1.5 mul sm rl cp} def\n"); - if(m_L) mgl_printf(fp, gz, "/m_L {ss 2 div sm rm 0 s2 rl sm 1.5 mul sm rl cp} def\n"); - if(m_P) mgl_printf(fp, gz, "/m_P {m_p 0 sm rm m_s} def\n"); - if(m_X) mgl_printf(fp, gz, "/m_X {m_x ss sm rm m_s} def\n"); -// if(m_C) mgl_printf(fp, gz, "/m_C {m_c m_o} def\n"); - mgl_printf(fp, gz, "\n"); - - // write definition for all glyphs - put_desc(fp,gz,"/%c%c_%04x { np\n", "\t%d %d mt ", "%d %d ll ", "cp\n", "} def\n"); - // write primitives - mreal cp[3]={-1,-1,-1},wp=-1; - int st=0; - char str[256]=""; - for(i=0;i1) sprintf(str,"%.2g %.2g %.2g rgb ", P[i].c[0],P[i].c[1],P[i].c[2]); - - if(P[i].type==0) // mark - { - sprintf(str,"1 lw %.2g %.2g %.2g rgb ", P[i].c[0],P[i].c[1],P[i].c[2]); - wp=1; - if(P[i].s!=MarkSize) - { - mgl_printf(fp, gz, "/ss {%g} def\n",P[i].s*0.4*font_factor); - mgl_printf(fp, gz, "/s2 {%g} def\n",P[i].s*0.8*font_factor); - mgl_printf(fp, gz, "/sm {-%g} def\n",P[i].s*0.4*font_factor); - } - switch(P[i].m) - { - case '+': mgl_printf(fp, gz, "np %g %g mt m_p %sdr\n",P[i].x[0],P[i].y[0],str); break; - case 'x': mgl_printf(fp, gz, "np %g %g mt m_x %sdr\n",P[i].x[0],P[i].y[0],str); break; - case 's': mgl_printf(fp, gz, "np %g %g mt m_s %sdr\n",P[i].x[0],P[i].y[0],str); break; - case 'd': mgl_printf(fp, gz, "np %g %g mt m_d %sdr\n",P[i].x[0],P[i].y[0],str); break; - case '*': mgl_printf(fp, gz, "np %g %g mt m_a %sdr\n",P[i].x[0],P[i].y[0],str); break; - case 'v': mgl_printf(fp, gz, "np %g %g mt m_v %sdr\n",P[i].x[0],P[i].y[0],str); break; - case '^': mgl_printf(fp, gz, "np %g %g mt m_t %sdr\n",P[i].x[0],P[i].y[0],str); break; - case 'S': mgl_printf(fp, gz, "np %g %g mt m_S %sfill\n",P[i].x[0],P[i].y[0],str); break; - case 'D': mgl_printf(fp, gz, "np %g %g mt m_D %sfill\n",P[i].x[0],P[i].y[0],str); break; - case 'V': mgl_printf(fp, gz, "np %g %g mt m_V %sfill\n",P[i].x[0],P[i].y[0],str); break; - case 'T': mgl_printf(fp, gz, "np %g %g mt m_T %sfill\n",P[i].x[0],P[i].y[0],str); break; - case 'o': mgl_printf(fp, gz, "%g %g m_o %sdr\n",P[i].x[0],P[i].y[0],str);break; - case 'O': mgl_printf(fp, gz, "%g %g m_o %sfill\n",P[i].x[0],P[i].y[0],str);break; - case 'Y': mgl_printf(fp, gz, "np %g %g mt m_Y %sdr\n",P[i].x[0],P[i].y[0],str); break; - case '<': mgl_printf(fp, gz, "np %g %g mt m_l %sdr\n",P[i].x[0],P[i].y[0],str); break; - case '>': mgl_printf(fp, gz, "np %g %g mt m_r %sdr\n",P[i].x[0],P[i].y[0],str); break; - case 'L': mgl_printf(fp, gz, "np %g %g mt m_L %sfill\n",P[i].x[0],P[i].y[0],str); break; - case 'R': mgl_printf(fp, gz, "np %g %g mt m_R %sfill\n",P[i].x[0],P[i].y[0],str); break; - case 'P': mgl_printf(fp, gz, "np %g %g mt m_P %sdr\n",P[i].x[0],P[i].y[0],str); break; - case 'X': mgl_printf(fp, gz, "np %g %g mt m_X %sdr\n",P[i].x[0],P[i].y[0],str); break; - case 'C': mgl_printf(fp, gz, "%g %g m_o %g %g m_c %sdr\n",P[i].x[0],P[i].y[0],P[i].x[0],P[i].y[0],str); break; - default: mgl_printf(fp, gz, "%g %g m_c %sfill\n",P[i].x[0],P[i].y[0],str); - } - if(P[i].s!=MarkSize) - { - mgl_printf(fp, gz, "/ss {%g} def\n",MarkSize*0.4*font_factor); - mgl_printf(fp, gz, "/s2 {%g} def\n",MarkSize*0.8*font_factor); - mgl_printf(fp, gz, "/sm {-%g} def\n",MarkSize*0.4*font_factor); - } - } - else if(P[i].type==2) // quad - mgl_printf(fp, gz, "np %g %g mt %g %g ll %g %g ll cp %sfill\n",P[i].x[0],P[i].y[0],P[i].x[1],P[i].y[1],P[i].x[2],P[i].y[2],str); - else if(P[i].type==3) // trig - mgl_printf(fp, gz, "np %g %g mt %g %g ll %g %g ll %g %g ll cp %sfill\n",P[i].x[0],P[i].y[0],P[i].x[1],P[i].y[1],P[i].x[3],P[i].y[3],P[i].x[2],P[i].y[2],str); - else if(P[i].type==1) // line - { - sprintf(str,"%.2g lw %.2g %.2g %.2g rgb ", P[i].w>1 ? P[i].w:1., P[i].c[0],P[i].c[1],P[i].c[2]); - wp = P[i].w>1 ? P[i].w:1; st = P[i].style; - put_line(fp,gz,i,wp,cp,st, "np %g %g mt ", "%g %g ll ", false); - const char *sd = mgl_get_dash(P[i].style,P[i].w); - if(sd && sd[0]) mgl_printf(fp, gz, "%s [%s] %g sd dr\n",str,sd,P[i].w*P[i].s); - else mgl_printf(fp, gz, "%s d0 dr\n",str); - } - else if(P[i].type==4) // glyph - { - mreal ss = P[i].s/2, xx = P[i].x[1], yy = P[i].y[1]; - mgl_printf(fp, gz, "gsave\t%g %g translate %g %g scale %g rotate %s\n", - P[i].x[0], P[i].y[0], ss, ss, -P[i].w, str); - if(P[i].style&8) // this is "line" - { - mreal dy = 0.004,f=fabs(P[i].zz[1]); - mgl_printf(fp, gz, "np %g %g mt %g %g ll %g %g ll %g %g ll cp ", - xx,yy+dy, xx+f,yy+dy, xx+f,yy-dy, xx,yy-dy); - } - else - mgl_printf(fp, gz, "%.3g %.3g translate %g %g scale %c%c_%04x ", - xx, yy, P[i].zz[1], P[i].zz[1], P[i].style&1?'b':'n', - P[i].style&2?'i':'n', P[i].m); - if(P[i].style&4) mgl_printf(fp, gz, "dr"); - else mgl_printf(fp, gz, "eofill"); - mgl_printf(fp, gz, " grestore\n"); - } - } - for(i=0;i\n"); - mgl_printf(fp, gz, "\n"); - mgl_printf(fp, gz, "\n",Width,Height); - - mgl_printf(fp, gz, "\n"); - mgl_printf(fp, gz, "\n\n\n",descr?descr:fname,ctime(&now)); - - // write definition for all glyphs - put_desc(fp,gz,"\n"); - // currentColor -> inherit ??? - mgl_printf(fp, gz, "\n"); - // write primitives - mreal cp[3]={-1,-1,-1},wp=-1; - register long i; - int st=0; - - for(i=0;i\n", - int(255*P[i].c[0]),int(255*P[i].c[1]),int(255*P[i].c[2])); - else - mgl_printf(fp, gz, "\n", - int(255*P[i].c[0]),int(255*P[i].c[1]),int(255*P[i].c[2])); - switch(P[i].m) - { - case 'P': - mgl_printf(fp, gz, "\n", - x-s,y,x+s,y,x,y-s,x,y+s, x-s,y-s,x+s,y-s,x+s,y+s,x-s,y+s,x-s,y-s); break; - case '+': - mgl_printf(fp, gz, "\n", - x-s,y,x+s,y,x,y-s,x,y+s); break; - case 'X': - mgl_printf(fp, gz, "\n", - x-s,y-s,x+s,y+s,x+s,y-s,x-s,y+s, x-s,y-s,x+s,y-s,x+s,y+s,x-s,y+s,x-s,y-s); break; - case 'x': - mgl_printf(fp, gz, "\n", - x-s,y-s,x+s,y+s,x+s,y-s,x-s,y+s); break; - case 's': - case 'S': - mgl_printf(fp, gz, "\n", - x-s,y-s,x+s,y-s,x+s,y+s,x-s,y+s); break; - case 'd': - case 'D': - mgl_printf(fp, gz, "\n", - x-s,y,x,y-s,x+s,y,x,y+s); break; - case '^': - case 'T': - mgl_printf(fp, gz, "\n", - x-s,y+s/2,x+s,y+s/2,x,y-s); break; - case 'v': - case 'V': - mgl_printf(fp, gz, "\n", - x-s,y-s/2,x+s,y-s/2,x,y+s); break; - case '<': - case 'L': - mgl_printf(fp, gz, "\n", - x+s/2,y+s,x+s/2,y-s,x-s,y); break; - case '>': - case 'R': - mgl_printf(fp, gz, "\n", - x-s/2,y+s,x-s/2,y-s,x+s,y); break; - case 'Y': - mgl_printf(fp, gz, "\n", - x,y+s, x,y, x+s,y-s, x,y, x-s,y-s); break; - case 'C': - mgl_printf(fp, gz, "\n\n", - int(255*P[i].c[0]),int(255*P[i].c[1]),int(255*P[i].c[2]),x,y,x,y,s); break; - case 'o': - mgl_printf(fp, gz, "\n", - x,y,s); break; - case 'O': - mgl_printf(fp, gz, "\n", - int(255*P[i].c[0]),int(255*P[i].c[1]),int(255*P[i].c[2]),x,y,s); break; - case '*': - mgl_printf(fp, gz, "\n", - x-s,y,x+s,y,x-0.8*s,y-1.6*s,x+0.8*s,y+1.6*s,x+0.8*s,y-1.6*s,x-0.8*s,y+1.6*s); break; - default: - mgl_printf(fp, gz, "\n", - int(255*P[i].c[0]),int(255*P[i].c[1]),int(255*P[i].c[2]),x,y); break; - } - mgl_printf(fp, gz, "\n"); - } - else if(P[i].type==2 && P[i].c[3]>0) - { - mgl_printf(fp, gz, "\n", - int(255*P[i].c[0]),int(255*P[i].c[1]),int(255*P[i].c[2]),P[i].c[3]); - mgl_printf(fp, gz, " \n", - P[i].x[0],Height-P[i].y[0],P[i].x[1],Height-P[i].y[1], - P[i].x[2],Height-P[i].y[2]); - } - else if(P[i].type==3 && P[i].c[3]>0) - { - mgl_printf(fp, gz, "\n", - int(255*P[i].c[0]),int(255*P[i].c[1]),int(255*P[i].c[2]),P[i].c[3]); - mgl_printf(fp, gz, " \n", - P[i].x[0],Height-P[i].y[0],P[i].x[1],Height-P[i].y[1], - P[i].x[3],Height-P[i].y[3],P[i].x[2],Height-P[i].y[2]); - } - else if(P[i].type==1) - { -// const char *dash[]={"", "8 8","4 4","1 3","7 4 1 4","3 2 1 2"}; - mgl_printf(fp, gz, "1) mgl_printf(fp, gz, " stroke-width=\"%g\"", P[i].w); - memcpy(cp,P[i].c,3*sizeof(mreal)); - wp = P[i].w>1 ? P[i].w:1; st = P[i].style; - put_line(fp,gz,i,wp,cp,st, "> \n"); - } - else if(P[i].type==4) - { - mreal ss = P[i].s/2, xx = P[i].x[1], yy = P[i].y[1]; - if(P[i].style&8) // this is "line" - { - mgl_printf(fp, gz, "", int(255*P[i].c[0]),int(255*P[i].c[1]),int(255*P[i].c[2])); - else - mgl_printf(fp, gz, " fill=\"#%02x%02x%02x\">", int(255*P[i].c[0]),int(255*P[i].c[1]),int(255*P[i].c[2])); - mreal dy = 0.004,f=fabs(P[i].zz[1]); - mgl_printf(fp, gz, "\n", - xx,yy+dy, xx+f,yy+dy, xx+f,yy-dy, xx,yy-dy); - } - else - { - ss *= P[i].zz[1]; - mgl_printf(fp, gz, "", int(255*P[i].c[0]),int(255*P[i].c[1]),int(255*P[i].c[2])); - else - mgl_printf(fp, gz, " fill=\"#%02x%02x%02x\">", int(255*P[i].c[0]),int(255*P[i].c[1]),int(255*P[i].c[2])); - mgl_printf(fp, gz, "\n", - xx/P[i].zz[1], yy/P[i].zz[1], P[i].style&1?'b':'n', - P[i].style&2?'i':'n', P[i].m); - } - } - } - - for(i=0;i"); - if(gz) gzclose(fp); else fclose((FILE *)fp); -} -//----------------------------------------------------------------------------- -void mglGraphPS::Finish() -{ - register long i; - if(P && pNum>0) - { - qsort(P,pNum,sizeof(mglPrim),mgl_compare_prim); - for(i=0;i(b) ? (a) : (b) -#define imin(a,b) (a)<(b) ? (a) : (b) -void mglPrim::Draw(mglGraphPS *gr) -{ - mreal pp[12]={x[0],y[0],z, x[1],y[1],z, x[2],y[2],z, x[3],y[3],z}; - gr->draw_prim(this, pp, c); -} -//----------------------------------------------------------------------------- -void mglGraphPS::draw_prim(mglPrim *pr, mreal *pp, mreal *c) -{ - ObjId = pr->id; memcpy(CDef,c,4*sizeof(mreal)); - bool ul=UseLight; UseLight=false; - int m = pr->m, s = pr->style; - switch(pr->type) - { - case 0: mglGraphAB::mark_plot(pp,pr->m); break; - case 1: PDef = pr->style; pPos = pr->s; - mglGraphAB::line_plot(pp,pp+3,c,c); break; - case 2: mglGraphAB::trig_plot(pp,pp+3,pp+6,c,c,c); break; - case 3: mglGraphAB::quad_plot(pp,pp+3,pp+6,pp+9,c,c,c,c); break; - case 4: - mreal pf=PlotFactor; Push(); - SetPosScale(pp[0],pp[1],pp[2],pr->s*PlotFactor); RotateN(pr->w,0,0,1); - mglGraphAB::Glyph(pr->x[1],pr->y[1],pr->zz[1]*fnt->GetFact(s&3),s,m,0); - Pop(); PlotFactor=pf; - break; - } - UseLight=ul; -} -//----------------------------------------------------------------------------- -void mglGraphPS::pnt_plot(long x,long y, mreal, unsigned char c[4]) -{ - long i0=x+Width*(Height-1-y); - if(x<0 || x>=Width || y<0 || y>=Height) return; - combine(G4+4*i0,c); OI[i0]=ObjId; -} -//----------------------------------------------------------------------------- -void mglGraphPS::put_line(void *fp, bool gz, long i, mreal wp, mreal *cp,int st, const char *ifmt, const char *nfmt, bool neg) -{ - long k = i,j; // first point - mreal x0=P[i].x[0], y0=P[i].y[0]; - bool ok=true; - while(ok) - { - for(ok=false,j=i+1;j10) { m=0; mgl_printf(fp, gz, "\n"); } - ok=true; m++; - } - else if(P[j].x[1]==x0 && P[j].y[1]==y0) - { - k=j; P[k].type = -1; - x0 = P[k].x[0]; y0=P[k].y[0]; - mgl_printf(fp, gz, nfmt,x0,neg?Height-y0:y0); - if(m>10) { m=0; mgl_printf(fp, gz, "\n"); } - ok=true; m++; - } - } - } -} -//----------------------------------------------------------------------------- -//put_desc(fp,"%c%c%c_%04x {", "np %d %d mt %d %d ll %d %d ll cp fill\n", -//"np %d %d mt ", "%d %d ll ", "cp dr\n", "} def") -void mglGraphPS::put_desc(void *fp, bool gz, const char *pre, const char *ln1, const char *ln2, const char *ln3, const char *suf) -{ - register long i,j,n; - wchar_t *g; - int *s; - for(n=i=0;iGetNl(P[i].style&3,P[i].m); - const short *ln=fnt->GetLn(P[i].style&3,P[i].m); - bool np=true; - if(ln && nl>0) for(ik=0;ik * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 -#include -#include -#include "mgl/mgl_evalc.h" -#include "mgl/mgl_addon.h" -#include "mgl/mgl_define.h" -#ifndef NO_GSL -#include -#endif -//----------------------------------------------------------------------------- -// êîíñòàíòû äëÿ ðàñïîçíîâàíèÿ âûðàæåíèÿ -enum{ -EQ_NUM=0, // a variable substitution -EQ_RND, // random number -EQ_A, // numeric constant -// äâóìåñòíûå ôóíêöèè -EQ_ADD, // addition x+y -EQ_SUB, // substraction x-y -EQ_MUL, // multiplication x*y -EQ_DIV, // division x/y -EQ_IPOW, // power x^n for integer n -EQ_POW, // power x^y -EQ_LOG, // logarithm of x on base a, log_a(x) = ln(x)/ln(a) -// îäíîìåñòíûå ôóíêöèè -EQ_SIN, // sine function \sin(x). !!! MUST BE FIRST 1-PLACE FUNCTION -EQ_COS, // cosine function \cos(x). -EQ_TAN, // tangent function \tan(x). -EQ_ASIN, // inverse sine function \asin(x). -EQ_ACOS, // inverse cosine function \acos(x). -EQ_ATAN, // inverse tangent function \atan(x). -EQ_SINH, // hyperbolic sine function \sinh(x). -EQ_COSH, // hyperbolic cosine function \cosh(x). -EQ_TANH, // hyperbolic tangent function \tanh(x). -EQ_ASINH, // inverse hyperbolic sine function \asinh(x). -EQ_ACOSH, // inverse hyperbolic cosine function \acosh(x). -EQ_ATANH, // inverse hyperbolic tangent function \atanh(x). -EQ_SQRT, // square root function \sqrt(x) -EQ_EXP, // exponential function \exp(x) -EQ_EXPI, // exponential function \exp(i*x) -EQ_LN, // logarithm of x, ln(x) -EQ_LG, // decimal logarithm of x, lg(x) = ln(x)/ln(10) -EQ_ABS // absolute value -}; -//----------------------------------------------------------------------------- -int mglFormulaC::Error=0; -bool mglCheck(char *str,int n); -int mglFindInText(char *str,const char *lst); -//----------------------------------------------------------------------------- -// äåñòðóêòîð ôîðìóëû -mglFormulaC::~mglFormulaC() -{ - if(Left) delete Left; - if(Right) delete Right; -} -//----------------------------------------------------------------------------- -// êîíñòðóêòîð ôîðìóëû (àâòîìàòè÷åñêè ðàñïîçíàåò è "êîìïèëèðóåò" ôîðìóëó) -mglFormulaC::mglFormulaC(const char *string) -{ - Error=0; - Left=Right=0; - Res=0; Kod=0; - if(!string) { Kod = EQ_NUM; Res = 0; return; } -//printf("%s\n",string); fflush(stdout); - char *str = new char[strlen(string)+1]; - strcpy(str,string); - static char Buf[2048]; - long n,len; - mgl_strtrim(str); - mgl_strlwr(str); - len=strlen(str); - if(str[0]==0) { delete []str; return; } - if(str[0]=='(' && mglCheck(&(str[1]),len-2)) // åñëè âñå âûðàæåíèå â ñêîáàõ, òî óáèðàåì èõ - { - strcpy(Buf,str+1); - len-=2; Buf[len]=0; - strcpy(str,Buf); - } - len=strlen(str); - n=mglFindInText(str,"+-"); // ìåíüøèé ïðèîðèòåò - ñëîæåíèå, âû÷èòàíèå - if(n>=0) - { - if(str[n]=='+') Kod=EQ_ADD; else Kod=EQ_SUB; - strcpy(Buf,str); Buf[n]=0; - Left=new mglFormulaC(Buf); - Right=new mglFormulaC(Buf+n+1); - delete []str; - return; - } - n=mglFindInText(str,"*/"); // ñðåäíèé ïðèîðèòåò - óìíîæåíèå, äåëåíèå - if(n>=0) - { - if(str[n]=='*') Kod=EQ_MUL; else Kod=EQ_DIV; - strcpy(Buf,str); Buf[n]=0; - Left=new mglFormulaC(Buf); - Right=new mglFormulaC(Buf+n+1); - delete []str; - return; - } - n=mglFindInText(str,"^"); // âûñîêèé ïðèîðèòåò - âîçâåäåíèå â ñòåïåíü - if(n>=0) - { - Kod=EQ_IPOW; - strcpy(Buf,str); Buf[n]=0; - Left=new mglFormulaC(Buf); - Right=new mglFormulaC(Buf+n+1); - delete []str; - return; - } - - for(n=0;n=len) // ýòî ÷èñëî èëè ïåðåìåííàÿ - { - Kod = EQ_NUM; -// Left = Right = 0; - if(str[1]==0 && str[0]>='a' && str[0]<='z') // äîñòóïíûå ïåðåìííûå - { Kod=EQ_A; Res = str[0]-'a'; } - else if(!strcmp(str,"rnd")) Kod=EQ_RND; - else if(!strcmp(str,"pi")) Res=M_PI; - else if(str[0]=='i') Res = dual(0,atof(str+1)); - else Res=atof(str); // ýòî ÷èñëî - } - else - { - char name[128]; - strcpy(name,str); -// strcpy(Buf,str); - name[n]=0; -// len-=n; - memcpy(Buf,&(str[n+1]),len-n); - len=strlen(Buf); - Buf[--len]=0; - if(!strcmp(name,"sin")) Kod=EQ_SIN; - else if(!strcmp(name,"cos")) Kod=EQ_COS; - else if(!strcmp(name,"tg")) Kod=EQ_TAN; - else if(!strcmp(name,"tan")) Kod=EQ_TAN; - else if(!strcmp(name,"asin")) Kod=EQ_ASIN; - else if(!strcmp(name,"acos")) Kod=EQ_ACOS; - else if(!strcmp(name,"atan")) Kod=EQ_ATAN; - else if(!strcmp(name,"sinh")) Kod=EQ_SINH; - else if(!strcmp(name,"cosh")) Kod=EQ_COSH; - else if(!strcmp(name,"tanh")) Kod=EQ_TANH; - else if(!strcmp(name,"sh")) Kod=EQ_SINH; - else if(!strcmp(name,"ch")) Kod=EQ_COSH; - else if(!strcmp(name,"th")) Kod=EQ_TANH; - else if(!strcmp(name,"sqrt")) Kod=EQ_SQRT; - else if(!strcmp(name,"log")) Kod=EQ_LOG; - else if(!strcmp(name,"pow")) Kod=EQ_POW; - else if(!strcmp(name,"exp")) Kod=EQ_EXP; - else if(!strcmp(name,"lg")) Kod=EQ_LG; - else if(!strcmp(name,"ln")) Kod=EQ_LN; - else if(!strcmp(name,"abs")) Kod=EQ_ABS; - else { delete []str; return; } // unknown function - n=mglFindInText(Buf,","); - if(n>=0) - { - Buf[n]=0; - Left=new mglFormulaC(Buf); - Right=new mglFormulaC(&(Buf[n+1])); - } - else - Left=new mglFormulaC(Buf); - } - delete []str; -} -//----------------------------------------------------------------------------- -// evaluate formula for 'x'='r', 'y'='n'='v', 't'='z', 'u'='a' variables -dual mglFormulaC::Calc(dual x,dual y,dual t,dual u) const -{ - Error=0; - dual a1[MGL_VS]; memset(a1,0,MGL_VS*sizeof(dual)); - a1['a'-'a'] = a1['u'-'a'] = u; - a1['x'-'a'] = a1['r'-'a'] = x; - a1['y'-'a'] = a1['n'-'a'] = a1['v'-'a'] = y; - a1['z'-'a'] = a1['t'-'a'] = t; - return CalcIn(a1); -} -//----------------------------------------------------------------------------- -// evaluate formula for 'x'='r', 'y'='n', 't'='z', 'u'='a', 'v'='b', 'w'='c' variables -dual mglFormulaC::Calc(dual x,dual y,dual t,dual u,dual v,dual w) const -{ - Error=0; - dual a1[MGL_VS]; memset(a1,0,MGL_VS*sizeof(dual)); - a1['c'-'a'] = a1['w'-'a'] = w; - a1['b'-'a'] = a1['v'-'a'] = v; - a1['a'-'a'] = a1['u'-'a'] = u; - a1['x'-'a'] = a1['r'-'a'] = x; - a1['y'-'a'] = a1['n'-'a'] = y; - a1['z'-'a'] = a1['t'-'a'] = t; - return CalcIn(a1); -} -//----------------------------------------------------------------------------- -// evaluate formula for arbitrary set of variables -dual mglFormulaC::Calc(const dual var[MGL_VS]) const -{ - Error=0; - return CalcIn(var); -} -//----------------------------------------------------------------------------- -dual addc(dual a,dual b) {return a+b;} -dual subc(dual a,dual b) {return a-b;} -dual mulc(dual a,dual b) {return a*b;} -dual divc(dual a,dual b) {return a/b;} -dual ipwc(dual a,dual b) {return mgl_ipowc(a,int(b.real()));} -dual powc(dual a,dual b) {return exp(b*log(a)); } -dual llgc(dual a,dual b) {return log(a)/log(b); } -dual expi(dual a) { return exp(dual(0,1)*a); } -dual expi(double a) { return dual(cos(a),sin(a)); } -//----------------------------------------------------------------------------- -dual ic = dual(0,1); -dual asinhc(dual x) { return log(x+sqrt(x*x+1.)); } -dual acoshc(dual x) { return log(x+sqrt(x*x-1.)); } -dual atanhc(dual x) { return log((1.+x)/(1.-x))/2.; } -dual sinc(dual x) { return sin(x); } -dual cosc(dual x) { return cos(x); } -dual tanc(dual x) { return tan(x); } -dual sinhc(dual x) { return sinh(x); } -dual coshc(dual x) { return cosh(x); } -dual tanhc(dual x) { return tanh(x); } -dual asinc(dual x) { return log(ic*x+sqrt(1.-x*x))/ic; } -dual acosc(dual x) { return log(x+sqrt(x*x-1.))/ic; } -dual atanc(dual x) { return log((ic-x)/(ic+x))/(2.*ic); } -dual expc(dual x) { return exp(x); } -dual sqrtc(dual x) { return sqrt(x); } -dual logc(dual x) { return log(x); } -dual absc(dual x) { return abs(x); } -dual lgc(dual x) { return log10(x);} -//----------------------------------------------------------------------------- -typedef dual (*func_1)(dual); -typedef dual (*func_2)(dual, dual); -// evaluation of embedded (included) expressions -dual mglFormulaC::CalcIn(const dual *a1) const -{ - func_2 f2[7] = {addc,subc,mulc,divc,ipwc,powc,llgc}; - func_1 f1[18] = {sinc,cosc,tanc,asinc,acosc,atanc,sinhc,coshc,tanhc, - asinhc,acoshc,atanhc,sqrtc,expc,expi,logc,lgc,absc}; -// if(Error) return 0; - if(Kod==EQ_A) return a1[(int)Res.real()]; - if(Kod==EQ_RND) return mgl_rnd(); - if(Kod==EQ_NUM) return Res; - - dual a = Left->CalcIn(a1); - if(isnan(a.real()) || isnan(a.imag())) return NAN; - - if(KodCalcIn(a1); - if(isnan(b.real()) || isnan(b.imag())) return NAN; - return f2[Kod-EQ_ADD](a,b); - } - else return f1[Kod-EQ_SIN](a); - return Res; -} -//----------------------------------------------------------------------------- -dual mgl_ipowc(dual x,int n) -{ - dual t; - if(n==2) return x*x; - if(n==1) return x; - if(n<0) return 1./mgl_ipowc(x,-n); - if(n==0) return 1.; - t = mgl_ipowc(x,n/2); t = t*t; - if(n%2==1) t *= x; - return t; -} -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_exec.cpp b/mgl/mgl_exec.cpp deleted file mode 100644 index d5717ee..0000000 --- a/mgl/mgl_exec.cpp +++ /dev/null @@ -1,3723 +0,0 @@ -/*************************************************************************** - * mgl_exec.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#ifdef WIN32 -#include -#include -#else -#include -#endif - -#include "mgl/mgl_parse.h" -#define iint(x) floor((x)+0.5) -char *mgl_strdup(const char *s); -wchar_t *mgl_str_copy(const char *s); -//----------------------------------------------------------------------------- -int mgls_addlegend(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2 && k[1]==2) gr->AddLegend(a[0].w,a[1].s); - else return 1; - return 0; -} -void mglc_addlegend(wchar_t out[1024], long , mglArg *a, int k[10]) -{ if(k[0]==2 && k[1]==2) mglprintf(out,1024,L"gr->AddLegend(\"%s\", \"%s\");",a[0].s,a[1].s); } -//----------------------------------------------------------------------------- -int mgls_addto(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) *(a[0].d) += *(a[1].d); - else if(k[0]==1 && k[1]==3) *(a[0].d) += a[1].v; - else return 1; - return 0; -} -void mglc_addto(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) mglprintf(out,1024,L"%s += %s;",a[0].s, a[1].s); - else if(k[0]==1 && k[1]==3) mglprintf(out,1024,L"%s += %g;",a[0].s, a[1].v); -} -//----------------------------------------------------------------------------- -int mgls_alpha(mglGraph *gr, long , mglArg *a, int k[10]) -{ - gr->Alpha(k[0]==3 ? a[0].v!=0 : true); return 0; -} -void mglc_alpha(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - mglprintf(out,1024,L"gr->Alpha(%s);",(k[0]==3&&a[0].v!=0)?"true":"false"); -} -//----------------------------------------------------------------------------- -int mgls_alphadef(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->AlphaDef = a[0].v; - else return 1; - return 0; -} -void mglc_alphadef(wchar_t out[1024], long , mglArg *a, int k[10]) -{ if(k[0]==3) mglprintf(out,1024,L"gr->AlphaDef = %g;",a[0].v); } -//----------------------------------------------------------------------------- -int mgls_ambient(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->Ambient(a[0].v); - else return 1; - return 0; -} -void mglc_ambient(wchar_t out[1024], long , mglArg *a, int k[10]) -{ if(k[0]==3) mglprintf(out,1024,L"gr->Ambient(%g);",a[0].v); } -//----------------------------------------------------------------------------- -int mgls_area(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Area(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3 ? a[2].v : NAN); - else if(k[2]!=1) gr->Area(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0,k[3]==3 ? a[3].v : NAN); - else gr->Area(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0); - return 0; -} -void mglc_area(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Area(%s, \"%s\", %g);",a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN); - else if(k[2]!=1) - mglprintf(out,1024,L"gr->Area(%s, %s, \"%s\", %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); - else mglprintf(out,1024,L"gr->Area(%s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:""); -} -//----------------------------------------------------------------------------- -int mgls_aspect(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3) gr->Aspect(a[0].v, a[1].v, k[2]==3?a[2].v:1); - else return 1; - return 0; -} -void mglc_aspect(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3) - mglprintf(out,1024,L"gr->Aspect(%g, %g, %g);", a[0].v, a[1].v, k[2]==3?a[2].v:1); -} -//----------------------------------------------------------------------------- -int mgls_axial(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Axial(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3 ? iint(a[2].v) : 3); - else if(k[1]==1 && k[2]==1) - gr->Axial(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0,k[4]==3 ? iint(a[4].v) : 3); - else return 1; - return 0; -} -void mglc_axial(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Axial(%s, \"%s\", %d);", a[0].s,k[1]==2?a[1].s:"",k[2]==3 ? iint(a[2].v) : 3); - else if(k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->Axial(%s, %s, %s, \"%s\", %d);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?iint(a[4].v):3); -} -//----------------------------------------------------------------------------- -int mgls_axialdir(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2) gr->AxialDir = a[0].s[0]; else return 1; - return 0; -} -void mglc_axialdir(wchar_t out[1024], long , mglArg *a, int k[10]) -{ if(k[0]==2) mglprintf(out,1024,L"gr->AxialDir = '%c';", a[0].s[0]); } -//----------------------------------------------------------------------------- -int mgls_axis(mglGraph *gr, long n, mglArg *a, int k[10]) -{ - register int i; - if(k[0]==2 && k[1]==2) gr->SetFunc(a[0].s,a[1].s,k[2]==2?a[2].s:"",k[3]==2?a[3].s:""); - else if(n==6) - { - bool ok=true; - for(i=0;i<6;i++) if(k[i]!=3) ok = false; - if(ok) gr->Axis(mglPoint(a[0].v,a[1].v,a[2].v), mglPoint(a[3].v,a[4].v,a[5].v)); - else return 1; - } - else if(n==4) - { - bool ok=true; - for(i=0;i<4;i++) if(k[i]!=3) ok = false; - if(ok) gr->Axis(mglPoint(a[0].v,a[1].v), mglPoint(a[2].v,a[3].v)); - else return 1; - } - else if(k[0]==2) gr->Axis(a[0].s, k[1]==3 && a[1].v!=0); - else if(k[0]==3) gr->SetCoor(iint(a[0].v)); - else if(k[0]==0) gr->Axis("xyz"); - else return 1; - return 0; -} -void mglc_axis(wchar_t out[1024], long n, mglArg *a, int k[10]) -{ - register int i; - if(k[0]==2 && k[1]==2 && k[2]==2) - mglprintf(out,1024,L"gr->SetFunc(\"%s\", \"%s\", \"%s\", \"%s\");", a[0].s,a[1].s,a[2].s,k[2]==2?a[2].s:"",k[3]==2?a[3].s:""); - else if(n==6) - { - bool ok=true; - for(i=0;i<6;i++) if(k[i]!=3) ok = false; - if(ok) mglprintf(out,1024,L"gr->Axis(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g));", a[0].v,a[1].v,a[2].v,a[3].v,a[4].v,a[5].v); - } - else if(n==4) - { - bool ok=true; - for(i=0;i<4;i++) if(k[i]!=3) ok = false; - if(ok) mglprintf(out,1024,L"gr->Axis(mglPoint(%g, %g), mglPoint(%g, %g));", a[0].v,a[1].v,a[2].v,a[3].v); - } - else if(k[0]==2) mglprintf(out,1024,L"gr->Axis(\"%s\");", a[0].s); - else if(k[0]==3) mglprintf(out,1024,L"gr->SetCoor(\"%d\");", iint(a[0].v)); - else if(k[0]==0) mglprintf(out,1024,L"gr->Axis(\"xyz\");"); -} -//----------------------------------------------------------------------------- -int mgls_ball(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3) - gr->Ball(mglPoint(a[0].v,a[1].v,a[2].v),k[3]==2 ? a[3].s[0]:'r'); - else if(k[0]==3 && k[1]==3) - gr->Ball(mglPoint(a[0].v,a[1].v),k[2]==2 ? a[2].s[0]:'r'); - else return 1; - return 0; -} -void mglc_ball(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3) - mglprintf(out,1024,L"gr->Ball(mglPoint(%g, %g, %g), '%c');", a[0].v,a[1].v,a[2].v,k[3]==2 ? a[3].s[0]:'r'); - else if(k[0]==3 && k[1]==3) - mglprintf(out,1024,L"gr->Ball(mglPoint(%g, %g), '%c');", a[0].v, a[1].v, k[2]==2 ? a[2].s[0]:'r'); -} -//----------------------------------------------------------------------------- -int mgls_box(mglGraph *gr, long , mglArg *a, int k[10]) -{ - gr->Box(k[0]==2 ? a[0].s : (gr->TranspType!=2 ?"k-":"w-"), k[1]!=3 || a[1].v); - return 0; -} -void mglc_box(wchar_t out[1024], long , mglArg *a, int k[10]) -{ mglprintf(out,1024,L"gr->Box(\"%s\", %s);", k[0]==2 ? a[0].s : "", k[1]!=3 || a[1].v ? "true":"false"); } -//----------------------------------------------------------------------------- -int mgls_bars(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Bars(*(a[0].d), k[1]==2?a[1].s:0, k[2]==3?a[2].v:NAN); - else if(k[2]!=1) gr->Bars(*(a[0].d), *(a[1].d), k[2]==2?a[2].s:0, k[3]==3?a[3].v:NAN); - else gr->Bars(*(a[0].d), *(a[1].d), *(a[2].d), k[3]==2?a[3].s:0); - return 0; -} -void mglc_bars(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Bars(%s, \"%s\", %g);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN); - else if(k[2]!=1) - mglprintf(out,1024,L"gr->Bars(%s, %s, \"%s\", %g);",a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); - else - mglprintf(out,1024,L"gr->Bars(%s, %s, %s, \"%s\");",a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:""); -} -//----------------------------------------------------------------------------- -int mgls_barh(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) - gr->Barh(*(a[0].d), k[1]==2?a[1].s:0, k[2]==3?a[2].v:NAN); - else - gr->Barh(*(a[0].d), *(a[1].d), k[2]==2?a[2].s:0, k[3]==3?a[3].v:NAN); - return 0; -} -void mglc_barh(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Barh(%s, \"%s\", %g);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN); - else - mglprintf(out,1024,L"gr->Barh(%s, %s, \"%s\", %g);",a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_belt(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Belt(*(a[0].d),k[1]==2?a[1].s:0); - else if(k[1]==1 && k[2]==1) gr->Belt(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0); - else return 1; - return 0; -} -void mglc_belt(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Belt(%s, \"%s\");", a[0].s,k[1]==2?a[1].s:""); - else if(k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->Belt(%s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:""); -} -//----------------------------------------------------------------------------- -int mgls_boxs(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Boxs(*(a[0].d),k[1]==2?a[1].s:0); - else if(k[1]==1 && k[2]==1) gr->Boxs(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0); - else return 1; - return 0; -} -void mglc_boxs(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Boxs(%s, \"%s\");", a[0].s,k[1]==2?a[1].s:""); - else if(k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->Boxs(%s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:""); -} -//----------------------------------------------------------------------------- -int mgls_beam(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==3) - gr->Beam(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),a[4].v, - k[5]==2? a[5].s:0,k[6]==3?iint(a[6].v):0, iint(k[7]==3?a[7].v:3)); - else return 1; - return 0; -} -void mglc_beam(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==3) - mglprintf(out,1024,L"gr->Beam(%s, %s, %s, %s, %g, \"%s\", %d, %d);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].v, k[5]==2? a[5].s:"",k[6]==3?iint(a[6].v):0, iint(k[7]==3?a[7].v:3)); -} -//----------------------------------------------------------------------------- -int mgls_caxis(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3) gr->CAxis(a[0].v,a[1].v); - else return 1; - return 0; -} -void mglc_caxis(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3) mglprintf(out,1024,L"gr->CAxis(%g, %g);", a[0].v,a[1].v); -} -//----------------------------------------------------------------------------- -int mgls_clearlegend(mglGraph *gr, long , mglArg *, int [10]) -{ gr->ClearLegend(); return 0; } -void mglc_clearlegend(wchar_t out[1024], long , mglArg *, int [10]) -{ mglprintf(out,1024,L"gr->ClearLegend();"); } -//----------------------------------------------------------------------------- -int mgls_clf(mglGraph *gr, long , mglArg *, int [10]) -{ gr->Clf(); return 0; } -void mglc_clf(wchar_t out[1024], long , mglArg *, int [10]) -{ mglprintf(out,1024,L"gr->Clf();"); } -//----------------------------------------------------------------------------- -int mgls_chart(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->Chart(*(a[0].d), k[1]==2?a[1].s:0); - else return 1; - return 0; -} -void mglc_chart(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3) mglprintf(out,1024,L"gr->Chart(%s, \"%s\");", a[0].s, k[1]==2?a[1].s:""); -} -//----------------------------------------------------------------------------- -int mgls_cloud(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Cloud(*(a[0].d),k[1]==2?a[1].s:0); - else if(k[1]==1 && k[2]==1 && k[3]==1) - gr->Cloud(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0); - return 0; -} -void mglc_cloud(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Cloud(%s,\"%s\");",a[0].s, k[1]==2?a[1].s:""); - else if(k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->Cloud(%s, %s, %s, %s, \"%s\");", a[0].s,a[1].s,a[2].s,a[3].s,k[4]==2?a[4].s:""); -} -//----------------------------------------------------------------------------- -int mgls_crange(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->CRange(*(a[0].d),k[1]==3?(a[1].v!=0):false,k[2]==3?a[2].v:0); - else if(k[0]==3 && k[1]==3) { gr->Cmin = a[0].v; gr->Cmax = a[1].v; } - else return 1; - return 0; -} -void mglc_crange(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) - mglprintf(out,1024,L"gr->CRange(%s, %s, %g);",a[0].s, (k[1]==3 && a[1].v!=0)?"true":"false", k[2]==3?a[2].v:0); - else if(k[0]==3 && k[1]==3) - mglprintf(out,1024,L"gr->CAxis(%g, %g);", a[0].v, a[1].v); -} -//----------------------------------------------------------------------------- -int mgls_crop(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3 && k[2]==3 && k[3]==2) - a[0].d->Crop(iint(a[1].v),iint(a[2].v),a[3].s[0]); - else return 1; - return 0; -} -void mglc_crop(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3 && k[2]==3 && k[3]==2) - mglprintf(out,1024,L"%s.Crop(%d, %d, '%c');",a[0].s, iint(a[1].v), iint(a[2].v), a[3].s[0]); -} -//----------------------------------------------------------------------------- -int mgls_cumsum(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) a[0].d->CumSum(a[1].s); - else return 1; - return 0; -} -void mglc_cumsum(wchar_t out[1024], long , mglArg *a, int k[10]) -{ if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.CumSum(\"%s\");",a[0].s, a[1].s); } -//----------------------------------------------------------------------------- -int mgls_curve(mglGraph *gr, long n, mglArg *a, int [10]) -{ - register long i; - for(i=0;i<12;i++) if(i>=n || a[i].type!=2) break; - if(i==12) - gr->Curve(mglPoint(a[0].v,a[1].v,a[2].v), - mglPoint(a[3].v,a[4].v,a[5].v), - mglPoint(a[6].v,a[7].v,a[8].v), - mglPoint(a[9].v,a[10].v,a[11].v), - (n>12 && a[12].type==1) ? a[12].s : 0); - else if(i==8) - gr->Curve(mglPoint(a[0].v,a[1].v), - mglPoint(a[2].v,a[3].v), - mglPoint(a[4].v,a[5].v), - mglPoint(a[6].v,a[7].v), - (n>8 && a[8].type==1) ? a[8].s : 0); - return 0; -} -void mglc_curve(wchar_t out[1024], long n, mglArg *a, int [10]) -{ - register long i; - for(i=0;i<12;i++) if(i>=n || a[i].type!=2) break; - if(i==12) - mglprintf(out,1024,L"gr->Curve(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), \"%s\");", a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, a[5].v, a[6].v, a[7].v, a[8].v, a[9].v, a[10].v, a[11].v, (n>12 && a[12].type==1) ? a[12].s : ""); - else if(i==8) - mglprintf(out,1024,L"gr->Curve(mglPoint(%g, %g), mglPoint(%g, %g), mglPoint(%g, %g), mglPoint(%g, %g), \"%s\");", a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, a[5].v, a[6].v, a[7].v, (n>8 && a[8].type==1) ? a[8].s : ""); -} -//----------------------------------------------------------------------------- -int mgls_cut(mglGraph *gr, long n, mglArg *a, int k[10]) -{ - if(k[0]==3 && n == 1) gr->Cut = (a[0].v != 0); - else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3) - { - gr->CutMin = mglPoint(a[0].v,a[1].v,a[2].v); - gr->CutMax = mglPoint(a[3].v,a[4].v,a[5].v); - } - else if(k[0]==2 && n == 1) gr->CutOff(a[0].s); - else return 1; - return 0; -} -void mglc_cut(wchar_t out[1024], long n, mglArg *a, int k[10]) -{ - if(k[0]==3 && n == 1) mglprintf(out,1024,L"gr->Cut = %s;",(a[0].v != 0)?"true":"false"); - else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3) - mglprintf(out,1024,L"gr->CutMin = mglPoint(%g, %g, %g);\tgr->CutMax = mglPoint(%g, %g, %g);", a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, a[5].v); - else if(k[0]==2 && n == 1) - mglprintf(out,1024,L"gr->CutOff(\"%s\");", a[0].s); -} -//----------------------------------------------------------------------------- -int mgls_crust(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1) - gr->Crust(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0); - else if(k[0]==1) - gr->Crust(*(a[0].d),k[1]==2?a[1].s:0); - else return 1; - return 0; -} -void mglc_crust(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->Crust(%s, %s, %s, \"%s\");",a[0].s,a[1].s,a[2].s,k[3]==2?a[3].s:""); - else if(k[0]==1) - mglprintf(out,1024,L"gr->Crust(%s, \"%s\");",a[0].s, k[1]==2?a[1].s:""); -} -//----------------------------------------------------------------------------- -int mgls_colorbar(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3) - gr->Colorbar(a[0].s, iint(a[1].v), a[2].v, a[3].v, a[4].v, a[5].v); - else if(k[0]==1) gr->Colorbar(*(a[0].d), k[1]==2 ? a[1].s:0, k[2]==3 ? iint(a[2].v):0); - else gr->Colorbar(k[0]==2 ? a[0].s:0, k[1]==3 ? iint(a[1].v):0); - return 0; -} -void mglc_colorbar(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==2 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3) - mglprintf(out,1024,L"gr->Colorbar(\"%s\", %d, %g, %g, %g, %g);",a[0].s, iint(a[1].v), a[2].v, a[3].v, a[4].v, a[5].v); - else if(k[0]==1) - mglprintf(out,1024,L"gr->Colorbar(%s, \"%s\", %d);",a[0].s, k[1]==2 ? a[1].s:"", k[2]==3 ? iint(a[2].v):0); - else - mglprintf(out,1024,L"gr->Colorbar(\"%s\", %d);",k[0]==2 ? a[0].s:"", k[1]==3 ? iint(a[1].v):0); -} -//----------------------------------------------------------------------------- -int mgls_copy(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) - { - a[0].d->Set(*(a[1].d)); - if(k[2]==2 && (k[3]!=3 || a[3].v!=0)) - a[0].d->Fill(a[2].s, gr->Min, gr->Max); - else if(k[2]==2) a[0].d->Modify(a[2].s); - } - else if(k[0]==1 && k[1]==2) - { - a[0].d->Create(1,1,1); - a[0].d->a[0] = a[1].v; - } - else return 1; - return 0; -} -void mglc_copy(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==2 && (k[3]!=3 || a[3].v!=0)) - mglprintf(out,1024,L"%s.Set(%s);\t%s.Fill(\"%s\", gr->Min, gr->Max);", a[0].s, a[1].s, a[2].s); - else if(k[0]==1 && k[1]==1 && k[2]==2) - mglprintf(out,1024,L"%s.Set(%s);\t%s.Modify(\"%s\");", a[0].s, a[1].s, a[2].s); - else if(k[0]==1 && k[1]==1) - mglprintf(out,1024,L"%s.Set(%s);", a[0].s, a[1].s); - else if(k[0]==1 && k[1]==2) - mglprintf(out,1024,L"%s.Create();\t%s.a[0]=%g;", a[0].s, a[0].s, a[1].v); -} -//----------------------------------------------------------------------------- -int mgls_cont(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Cont(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?iint(a[2].v):7,k[3]==3?a[3].v:NAN); - else if(k[1]==1 && k[2]!=1) - gr->Cont(*(a[0].d), *(a[1].d), k[2]==2?a[2].s:0,k[3]==3?a[3].v:NAN); - else if(k[1]==1 && k[2]==1 && k[3]!=1) - gr->Cont(*(a[0].d), *(a[1].d), *(a[2].d), k[3]==2?a[3].s:0, - k[4]==3?iint(a[4].v):7, k[5]==3?a[5].v:NAN); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]!=1) - gr->Cont(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), k[4]==2?a[4].s:0, - k[5]==3?a[5].v:NAN); - else return 1; - return 0; -} -void mglc_cont(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Cont(%s, \"%s\", %d, %g);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?iint(a[2].v):7, k[3]==3?a[3].v:NAN); - else if(k[1]==1 && k[2]!=1) - mglprintf(out,1024,L"gr->Cont(%s, %s, \"%s\", %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); - else if(k[1]==1 && k[2]==1 && k[3]!=1) - mglprintf(out,1024,L"gr->Cont(%s, %s, %s, \"%s\", %d, %g);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?iint(a[4].v):7, k[5]==3?a[5].v:NAN); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]!=1) - mglprintf(out,1024,L"gr->Cont(%s, %s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?a[5].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_contf(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) - gr->ContF(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?iint(a[2].v):7,k[3]==3?a[3].v:NAN); - else if(k[1]==1 && k[2]!=1) - gr->ContF(*(a[0].d), *(a[1].d), k[2]==2?a[2].s:0,k[3]==3?a[3].v:NAN); - else if(k[1]==1 && k[2]==1 && k[3]!=1) - gr->ContF(*(a[0].d), *(a[1].d), *(a[2].d), k[3]==2?a[3].s:0, - k[4]==3?iint(a[4].v):7, k[5]==3?a[5].v:NAN); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]!=1) - gr->ContF(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), k[4]==2?a[4].s:0, - k[5]==3?a[5].v:NAN); - else return 1; - return 0; -} -void mglc_contf(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->ContF(%s, \"%s\", %d, %g);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?iint(a[2].v):7, k[3]==3?a[3].v:NAN); - else if(k[1]==1 && k[2]!=1) - mglprintf(out,1024,L"gr->ContF(%s, %s, \"%s\", %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); - else if(k[1]==1 && k[2]==1 && k[3]!=1) - mglprintf(out,1024,L"gr->ContF(%s, %s, %s, \"%s\", %d, %g);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?iint(a[4].v):7, k[5]==3?a[5].v:NAN); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]!=1) - mglprintf(out,1024,L"gr->ContF(%s, %s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?a[5].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_contd(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) - gr->ContD(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?iint(a[2].v):7,k[3]==3?a[3].v:NAN); - else if(k[1]==1 && k[2]!=1) - gr->ContD(*(a[0].d), *(a[1].d), k[2]==2?a[2].s:0,k[3]==3?a[3].v:NAN); - else if(k[1]==1 && k[2]==1 && k[3]!=1) - gr->ContD(*(a[0].d), *(a[1].d), *(a[2].d), k[3]==2?a[3].s:0, - k[4]==3?iint(a[4].v):7, k[5]==3?a[5].v:NAN); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]!=1) - gr->ContD(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), k[4]==2?a[4].s:0, - k[5]==3?a[5].v:NAN); - else return 1; - return 0; -} -void mglc_contd(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->ContD(%s, \"%s\", %d, %g);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?iint(a[2].v):7, k[3]==3?a[3].v:NAN); - else if(k[1]==1 && k[2]!=1) - mglprintf(out,1024,L"gr->ContD(%s, %s, \"%s\", %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); - else if(k[1]==1 && k[2]==1 && k[3]!=1) - mglprintf(out,1024,L"gr->ContD(%s, %s, %s, \"%s\", %d, %g);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?iint(a[4].v):7, k[5]==3?a[5].v:NAN); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]!=1) - mglprintf(out,1024,L"gr->ContD(%s, %s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?a[5].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_cont3(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]==2) - gr->Cont3(*(a[0].d), a[1].s[0], k[2]==3?iint(a[2].v):-1, k[3]==2?a[3].s:0, k[4]==3?iint(a[4].v):7); - else if(k[1]==1 && k[2]==2) - gr->Cont3(*(a[0].d), *(a[1].d), a[2].s[0], k[3]==3?iint(a[3].v):-1, k[4]==2?a[4].s:0); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) - gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s[0], k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s:0, k[7]==3?iint(a[7].v):7); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2) - gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s[0], k[6]==3?iint(a[6].v):-1, k[7]==2?a[7].s:0); - else return 1; - return 0; -} -void mglc_cont3(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]==2) - mglprintf(out,1024,L"gr->Cont3(%s, '%c', %d, \"%s\", %d);", a[0].s, a[1].s[0], k[2]==3?iint(a[2].v):-1, k[3]==2?a[3].s:"", k[4]==3?iint(a[4].v):7); - else if(k[1]==1 && k[2]==2) - mglprintf(out,1024,L"gr->Cont3(%s, %s, '%c', %d, \"%s\");", a[0].s, a[1].s, a[2].s[0], k[3]==3?iint(a[3].v):-1, k[4]==2?a[4].s:""); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) - mglprintf(out,1024,L"gr->Cont3(%s, %s, %s, %s, '%c', %d, \"%s\", %d);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s[0], k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s:0, k[7]==3?iint(a[7].v):7); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2) - mglprintf(out,1024,L"gr->Cont3(%s, %s, %s, %s, %s, '%c', %d, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s[0], k[6]==3?iint(a[6].v):-1, k[7]==2?a[7].s:0); -} -//----------------------------------------------------------------------------- -int mgls_contf3(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]==2) - gr->ContF3(*(a[0].d), a[1].s[0], k[2]==3?iint(a[2].v):-1, k[3]==2?a[3].s:0, k[4]==3?iint(a[4].v):7); - else if(k[1]==1 && k[2]==2) - gr->ContF3(*(a[0].d), *(a[1].d), a[2].s[0], k[3]==3?iint(a[3].v):-1, k[4]==2?a[4].s:0); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) - gr->ContF3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s[0], k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s:0, k[7]==3?iint(a[7].v):7); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2) - gr->ContF3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s[0], k[6]==3?iint(a[6].v):-1, k[7]==2?a[7].s:0); - else return 1; - return 0; -} -void mglc_contf3(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]==2) - mglprintf(out,1024,L"gr->ContF3(%s, '%c', %d, \"%s\", %d);", a[0].s, a[1].s[0], k[2]==3?iint(a[2].v):-1, k[3]==2?a[3].s:"", k[4]==3?iint(a[4].v):7); - else if(k[1]==1 && k[2]==2) - mglprintf(out,1024,L"gr->ContF3(%s, %s, '%c', %d, \"%s\");", a[0].s, a[1].s, a[2].s[0], k[3]==3?iint(a[3].v):-1, k[4]==2?a[4].s:""); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) - mglprintf(out,1024,L"gr->ContF3(%s, %s, %s, %s, '%c', %d, \"%s\", %d);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s[0], k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s:0, k[7]==3?iint(a[7].v):7); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2) - mglprintf(out,1024,L"gr->ContF3(%s, %s, %s, %s, %s, '%c', %d, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s[0], k[6]==3?iint(a[6].v):-1, k[7]==2?a[7].s:0); -} -//----------------------------------------------------------------------------- -int mgls_conta(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]==1 && k[2]==1 && k[3]==1) - gr->ContA(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), k[4]==2?a[4].s:0, k[5]==3?iint(a[5].v):7); - else gr->ContA(*(a[0].d), k[1]==2?a[1].s:0, k[2]==3?iint(a[2].v):7); - return 0; -} -void mglc_conta(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->ContA(%s, %s, %s, %s, \"%s\", %d);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?iint(a[5].v):7); - else - mglprintf(out,1024,L"gr->ContA(%s, \"%s\", %d);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?iint(a[2].v):7); -} -//----------------------------------------------------------------------------- -int mgls_contfa(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]==1 && k[2]==1 && k[3]==1) - gr->ContFA(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0, - k[5]==3?iint(a[5].v):7); - else gr->ContFA(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?iint(a[2].v):7); - return 0; -} -void mglc_contfa(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->ContFA(%s, %s, %s, %s, \"%s\", %d);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?iint(a[5].v):7); - else - mglprintf(out,1024,L"gr->ContFA(%s, \"%s\", %d);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?iint(a[2].v):7); -} -//----------------------------------------------------------------------------- -int mgls_contx(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->ContX(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?a[2].v:NAN,k[3]==3?iint(a[3].v):7); - else return 1; - return 0; -} -void mglc_contx(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) - mglprintf(out,1024,L"gr->ContX(%s, \"%s\", %g, %d);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN, k[3]==3?iint(a[3].v):7); -} -//----------------------------------------------------------------------------- -int mgls_contfx(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->ContFX(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?a[2].v:NAN,k[3]==3?iint(a[3].v):7); - else return 1; - return 0; -} -void mglc_contfx(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) - mglprintf(out,1024,L"gr->ContFX(%s, \"%s\", %g, %d);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN, k[3]==3?iint(a[3].v):7); -} -//----------------------------------------------------------------------------- -int mgls_conty(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->ContY(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?a[2].v:NAN,k[3]==3?iint(a[3].v):7); - else return 1; - return 0; -} -void mglc_conty(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) - mglprintf(out,1024,L"gr->ContY(%s, \"%s\", %g, %d);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN, k[3]==3?iint(a[3].v):7); -} -//----------------------------------------------------------------------------- -int mgls_contfy(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->ContFY(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?a[2].v:NAN,k[3]==3?iint(a[3].v):7); - else return 1; - return 0; -} -void mglc_contfy(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) - mglprintf(out,1024,L"gr->ContFY(%s, \"%s\", %g, %d);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN, k[3]==3?iint(a[3].v):7); -} -//----------------------------------------------------------------------------- -int mgls_contz(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->ContZ(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?a[2].v:NAN,k[3]==3?iint(a[3].v):7); - else return 1; - return 0; -} -void mglc_contz(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) - mglprintf(out,1024,L"gr->ContZ(%s, \"%s\", %g, %d);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN, k[3]==3?iint(a[3].v):7); -} -//----------------------------------------------------------------------------- -int mgls_contfz(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->ContFZ(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?a[2].v:NAN,k[3]==3?iint(a[3].v):7); - else return 1; - return 0; -} -void mglc_contfz(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) - mglprintf(out,1024,L"gr->ContFZ(%s, \"%s\", %g, %d);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN, k[3]==3?iint(a[3].v):7); -} -//----------------------------------------------------------------------------- -int mgls_cone(mglGraph *gr, long , mglArg *a, int [10]) -{ - bool ok=true; - for(int i=0;i<7;i++) if(a[i].type!=2) ok=false; - if(ok) - { - if(a[7].type==2) - gr->Cone(mglPoint(a[0].v,a[1].v,a[2].v), mglPoint(a[3].v,a[4].v,a[5].v), - a[6].v, a[7].v, (a[8].type==1) ? a[8].s : 0, (a[9].type==2) ? a[9].v!=0 : false); - else - gr->Cone(mglPoint(a[0].v,a[1].v,a[2].v), mglPoint(a[3].v,a[4].v,a[5].v), - a[6].v, -1, (a[7].type==1) ? a[7].s : 0, (a[8].type==2) ? a[8].v!=0 : false); - } - else return 1; - return 0; -} -void mglc_cone(wchar_t out[1024], long , mglArg *a, int [10]) -{ - bool ok=true; - for(int i=0;i<7;i++) if(a[i].type!=2) ok=false; - if(ok) - { - if(a[7].type==2) - mglprintf(out,1024,L"gr->Cone(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), %g, %g, \"%s\", %s);", a[0].v,a[1].v,a[2].v, a[3].v,a[4].v,a[5].v, a[6].v, a[7].v, (a[8].type==1) ? a[8].s : "", (a[9].type==2 && a[9].v!=0) ? "true" : "false"); - else - mglprintf(out,1024,L"gr->Cone(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), %g, -1, \"%s\", %s);", a[0].v,a[1].v,a[2].v, a[3].v,a[4].v,a[5].v, a[6].v, (a[7].type==1) ? a[7].s : "", (a[8].type==2 && a[8].v!=0)? "true" : "false"); - } -} -//----------------------------------------------------------------------------- -int mgls_dens(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Dens(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?a[2].v:NAN); - else if(k[1]==1 && k[2]==1 && k[3]!=1) - gr->Dens(*(a[0].d), *(a[1].d), *(a[2].d), k[3]==2?a[3].s:0, k[4]==3?a[4].v:NAN); - else return 1; - return 0; -} -void mglc_dens(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Dens(%s,\"%s\", %g);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN); - else if(k[1]==1 && k[2]==1 && k[3]!=1) - mglprintf(out,1024,L"gr->Dens(%s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?a[4].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_dens3(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]==2) - gr->Dens3(*(a[0].d),a[1].s[0],k[2]==3?iint(a[2].v):-1, - k[3]==2?a[3].s:0); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) - gr->Dens3(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),a[4].s[0], - k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s:0); - else return 1; - return 0; -} -void mglc_dens3(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]==2) - mglprintf(out,1024,L"gr->Dens3(%s, '%c', %d, \"%s\");", a[0].s, a[1].s[0], k[2]==3?iint(a[2].v):-1, k[3]==2?a[3].s:""); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) - mglprintf(out,1024,L"gr->Dens3(%s, %s, %s, %s, '%c', %d, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s[0], k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s:0); -} -//----------------------------------------------------------------------------- -int mgls_densa(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]==1 && k[2]==1 && k[3]==1) - gr->DensA(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0); - else gr->DensA(*(a[0].d),k[1]==2?a[1].s:0); - return 0; -} -void mglc_densa(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->DensA(%s, %s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:""); - else - mglprintf(out,1024,L"gr->DensA(%s, \"%s\");", a[0].s, k[1]==2?a[1].s:""); -} -//----------------------------------------------------------------------------- -int mgls_densx(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->DensX(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?a[2].v:NAN); - else return 1; - return 0; -} -void mglc_densx(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) mglprintf(out,1024,L"gr->DensX(%s, \"%s\", %g);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_densy(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->DensY(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?a[2].v:NAN); - else return 1; - return 0; -} -void mglc_densy(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) mglprintf(out,1024,L"gr->DensY(%s, \"%s\", %g);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_densz(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->DensZ(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?a[2].v:NAN); - else return 1; - return 0; -} -void mglc_densz(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) mglprintf(out,1024,L"gr->DensZ(%s, \"%s\", %g);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_divto(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) *(a[0].d) /= *(a[1].d); - else if(k[0]==1 && k[1]==3) *(a[0].d) /= a[1].v; - else return 1; - return 0; -} -void mglc_divto(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) mglprintf(out,1024,L"%s /= %s;",a[0].s, a[1].s); - else if(k[0]==1 && k[1]==3) mglprintf(out,1024,L"%s /= %g;",a[0].s, a[1].v); -} -//----------------------------------------------------------------------------- -int mgls_multo(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) *(a[0].d) *= *(a[1].d); - else if(k[0]==1 && k[1]==3) *(a[0].d) *= a[1].v; - else return 1; - return 0; -} -void mglc_multo(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) mglprintf(out,1024,L"%s *= %s;",a[0].s, a[1].s); - else if(k[0]==1 && k[1]==3) mglprintf(out,1024,L"%s *= %g;",a[0].s, a[1].v); -} -//----------------------------------------------------------------------------- -int mgls_subto(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) *(a[0].d) -= *(a[1].d); - else if(k[0]==1 && k[1]==3) *(a[0].d) -= a[1].v; - else return 1; - return 0; -} -void mglc_subto(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) mglprintf(out,1024,L"%s -= %s;",a[0].s, a[1].s); - else if(k[0]==1 && k[1]==3) mglprintf(out,1024,L"%s -= %g;",a[0].s, a[1].v); -} -//----------------------------------------------------------------------------- -int mgls_dots(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - gr->Dots(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0); - else if(k[0]==1 && k[1]==1 && k[2]==1) - gr->Dots(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0); - else if(k[0]==1) - gr->Dots(*(a[0].d),k[1]==2?a[1].s:0); - else return 1; - return 0; -} -void mglc_dots(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->Dots(%s, %s, %s, \"%s\");",a[0].s,a[1].s,a[2].s,k[3]==2?a[3].s:""); - else if(k[0]==1) - mglprintf(out,1024,L"gr->Dots(%s, \"%s\");",a[0].s, k[1]==2?a[1].s:""); -} -//----------------------------------------------------------------------------- -int mgls_diff(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) a[0].d->Diff(a[1].s); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - a[0].d->Diff(*(a[1].d), *(a[2].d), *(a[3].d)); - else if(k[0]==1 && k[1]==1 && k[2]==1) - a[0].d->Diff(*(a[1].d), *(a[2].d)); - else return 1; - return 0; -} -void mglc_diff(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Diff(\"%s\");", a[0].s, a[1].s); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"%s.Diff(%s, %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s); - else if(k[0]==1 && k[1]==1 && k[2]==1) - mglprintf(out,1024,L"%s.Diff(%s, %s);", a[0].s, a[1].s, a[2].s); -} -//----------------------------------------------------------------------------- -int mgls_diff2(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) a[0].d->Diff2(a[1].s); - else return 1; - return 0; -} -void mglc_diff2(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Diff2(\"%s\");", a[0].s, a[1].s); -} -//----------------------------------------------------------------------------- -int mgls_drop(mglGraph *gr, long n, mglArg *a, int k[10]) -{ - register int i; - for(i=0;i<7;i++) if(k[i]!=3) break; - if(i==7) - gr->Drop(mglPoint(a[0].v,a[1].v,a[2].v), mglPoint(a[3].v,a[4].v,a[5].v), a[6].v, - k[7]==2 ? a[7].s:"b", k[8]==3 ? a[8].v:1., (n>9 && a[9].type==2) ? a[9].v:1.); - else if(i==5) - gr->Drop(mglPoint(a[0].v,a[1].v), mglPoint(a[2].v,a[3].v), a[4].v, - k[5]==2 ? a[5].s:"b", k[6]==3 ? a[6].v:1., k[7]==3 ? a[7].v:1.); - else return 1; - return 0; -} -void mglc_drop(wchar_t out[1024], long n, mglArg *a, int k[10]) -{ - register int i; - for(i=0;i<7;i++) if(k[i]!=3) break; - if(i==7) - mglprintf(out,1024,L"gr->Drop(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), %g, \"%s\", %g, %g);", a[0].v,a[1].v,a[2].v, a[3].v,a[4].v,a[5].v, a[6].v, k[7]==2 ? a[7].s:"b", k[8]==3 ? a[8].v:1., (n>9 && a[9].type==2) ? a[9].v:1.); - else if(i==5) - mglprintf(out,1024,L"gr->Drop(mglPoint(%g, %g), mglPoint(%g, %g), %g, \"%s\", %g, %g);", a[0].v,a[1].v, a[2].v,a[3].v, a[4].v, k[5]==2 ? a[5].s:"b", k[6]==3 ? a[6].v:1., k[7]==3 ? a[7].v:1.); -} -//----------------------------------------------------------------------------- -int mgls_dew(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - gr->Dew(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0,k[5]==3?a[5].v:NAN); - else if(k[0]==1 && k[1]==1) gr->Dew(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0,k[3]==3?a[3].v:NAN); - else return 1; - return 0; -} -void mglc_dew(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->Dew(%s, %s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?a[5].v:NAN); - else if(k[0]==1 && k[1]==1) - mglprintf(out,1024,L"gr->Dew(%s, %s, \"%s\", %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_fall(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Fall(*(a[0].d),k[1]==2?a[1].s:0); - else if(k[1]==1 && k[2]==1) gr->Fall(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0); - else return 1; - return 0; -} -void mglc_fall(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Fall(%s, \"%s\");", a[0].s,k[1]==2?a[1].s:""); - else if(k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->Fall(%s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:""); -} -//----------------------------------------------------------------------------- -int mgls_mesh(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Mesh(*(a[0].d),k[1]==2?a[1].s:0); - else if(k[1]==1 && k[2]==1) gr->Mesh(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0); - else return 1; - return 0; -} -void mglc_mesh(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Mesh(%s, \"%s\");", a[0].s,k[1]==2?a[1].s:""); - else if(k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->Mesh(%s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:""); -} -//----------------------------------------------------------------------------- -int mgls_surf(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Surf(*(a[0].d),k[1]==2?a[1].s:0); - else if(k[1]==1 && k[2]==1) gr->Surf(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0); - else return 1; - return 0; -} -void mglc_surf(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Surf(%s, \"%s\");", a[0].s,k[1]==2?a[1].s:""); - else if(k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->Surf(%s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:""); -} -//----------------------------------------------------------------------------- -int mgls_surfc(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=1) return 1; - else if(k[2]!=1) gr->SurfC(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0); - else if(k[2]==1 && k[3]==1) gr->SurfC(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0); - else return 1; - return 0; -} -void mglc_surfc(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=1) return; - else if(k[2]!=1) - mglprintf(out,1024,L"gr->SurfC(%s, %s, \"%s\");", a[0].s,a[1].s,k[2]==2?a[2].s:""); - else if(k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->SurfC(%s, %s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:""); -} -//----------------------------------------------------------------------------- -int mgls_surfa(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=1) return 1; - else if(k[2]!=1) gr->SurfA(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0); - else if(k[2]==1 && k[3]==1) gr->SurfA(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0); - else return 1; - return 0; -} -void mglc_surfa(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=1) return; - else if(k[2]!=1) - mglprintf(out,1024,L"gr->SurfA(%s, %s, \"%s\");", a[0].s,a[1].s,k[2]==2?a[2].s:""); - else if(k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->SurfA(%s, %s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:""); -} -//----------------------------------------------------------------------------- -int mgls_flow(mglGraph *gr, long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=1) break; - if(i==2) - gr->Flow(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0,k[3]==3?iint(a[3].v):5, - true,k[4]==3?a[4].v:NAN); - else if(i==4) - gr->Flow(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0, - k[5]==3?iint(a[5].v):5,true,k[6]==3?a[6].v:NAN); - else if(i==3) - gr->Flow(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0,k[4]==3?iint(a[4].v):3); - else if(i==6) - gr->Flow(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d), - k[6]==2?a[6].s:0,k[7]==3?iint(a[7].v):3); - else if(k[0]==3 && k[1]==3 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1) - gr->FlowP(mglPoint(a[0].v,a[1].v,k[7]==3?a[7].v:NAN), - *(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),k[6]==2?a[6].s:0); - else if(k[0]==3 && k[1]==3 && k[2]==1 && k[3]==1) - gr->FlowP(mglPoint(a[0].v,a[1].v,k[5]==3?a[5].v:NAN), - *(a[2].d),*(a[3].d),k[4]==2?a[4].s:0); - else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==1 && k[4]==1 && k[5]==1 && k[6]==1 && k[7]==1 && k[8]==1) - gr->FlowP(mglPoint(a[0].v,a[1].v,a[2].v), - *(a[3].d),*(a[4].d),*(a[5].d),*(a[6].d),*(a[7].d),*(a[8].d),k[9]==2?a[9].s:0); - else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==1 && k[4]==1 && k[5]==1) - gr->FlowP(mglPoint(a[0].v,a[1].v,a[2].v), - *(a[3].d),*(a[4].d),*(a[5].d),k[6]==2?a[6].s:0); - else return 1; - return 0; -} -void mglc_flow(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=1) break; - if(i==2) - mglprintf(out,1024,L"gr->Flow(%s, %s, \"%s\", %d, true, %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?iint(a[3].v):5, k[4]==3?a[4].v:NAN); - else if(i==4) - mglprintf(out,1024,L"gr->Flow(%s, %s, %s, %s, \"%s\", %d, true, %g);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?iint(a[5].v):5, k[6]==3?a[6].v:NAN); - else if(i==3) - mglprintf(out,1024,L"gr->Flow(%s, %s, %s, \"%s\", %d);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:0, k[4]==3?iint(a[4].v):3); - else if(i==6) - mglprintf(out,1024,L"gr->Flow(%s, %s, %s, %s, %s, %s, \"%s\", %d);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, k[6]==2?a[6].s:0, k[7]==3?iint(a[7].v):3); - else if(k[0]==3 && k[1]==3 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1) - mglprintf(out,1024,L"gr->FlowP(mglPoint(%g,%g,%g), %s, %s, %s, %s, \"%s\");", - a[0].v,a[1].v,k[7]==3?a[7].v:NAN,a[2].s,a[3].s,a[4].s,a[5].s,k[6]==2?a[6].s:""); - else if(k[0]==3 && k[1]==3 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->FlowP(mglPoint(%g,%g,%g), %s, %s, \"%s\");", - a[0].v,a[1].v,k[5]==3?a[5].v:NAN,a[2].s,a[3].s,k[4]==2?a[4].s:""); - else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==1 && k[4]==1 && k[5]==1 && k[6]==1 && k[7]==1 && k[8]==1) - mglprintf(out,1024,L"gr->FlowP(mglPoint(%g,%g,%g), %s, %s, %s, %s, %s, %s, \"%s\");", - a[0].v,a[1].v,a[2].v,a[3].s,a[4].s,a[5].s,a[6].s,a[7].s,a[8].s,k[9]==2?a[9].s:""); - else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==1 && k[4]==1 && k[5]==1) - mglprintf(out,1024,L"gr->FlowP(mglPoint(%g,%g,%g), %s, %s, %s, \"%s\");", - a[0].v,a[1].v,a[2].v,a[3].s,a[4].s,a[5].s,k[6]==2?a[6].s:""); -} -//----------------------------------------------------------------------------- -int mgls_grad(mglGraph *gr, long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=1) break; - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - gr->Grad(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d), k[4]==2?a[4].s:0, k[5]==3?iint(a[5].v):5); - else if(k[0]==1 && k[1]==1 && k[2]==1) - gr->Grad(*(a[0].d),*(a[1].d),*(a[2].d), k[3]==2?a[3].s:0, k[4]==3?iint(a[4].v):5, k[5]==3?a[5].v:NAN); - else if(k[0]==1) - gr->Grad(*(a[0].d), k[1]==2?a[1].s:0, k[2]==3?iint(a[2].v):5, k[3]==3?a[3].v:NAN); - else return 1; - return 0; -} -void mglc_grad(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->Grad(%s, %s, %s, %s, \"%s\", %d, %g);", - a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?iint(a[5].v):5); - else if(k[0]==1 && k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->Grad(%s, %s, %s, \"%s\", %d, %g);", - a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?iint(a[4].v):5, k[5]==3?a[5].v:NAN); - else if(k[0]==1) - mglprintf(out,1024,L"gr->Grad(%s, \"%s\", %d, %g);", - a[0].s, k[1]==2?a[1].s:"", k[2]==3?iint(a[2].v):5, k[3]==3?a[3].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_fill(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) - a[0].d->Fill(a[1].s, gr->Min, gr->Max, k[2]==1?a[2].d:0, k[3]==1?a[3].d:0); - else if(k[0]==1 && k[1]==3 && k[2]==3) - a[0].d->Fill(a[1].v,a[2].v,k[3]==2?a[3].s[0]:'x'); - else return 1; - return 0; -} -void mglc_fill(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) - mglprintf(out,1024,L"%s.Fill(\"%s\", gr->Min, gr->Max, %s, %s);", a[0].s, a[1].s, k[2]==1?a[2].s:"NULL", k[3]==1?a[3].s:"NULL"); - else if(k[0]==1 && k[1]==3 && k[2]==3) - mglprintf(out,1024,L"%s.Fill(%g, %g, '%c');", a[0].s, a[1].v,a[2].v, k[3]==2?a[3].s[0]:'x'); -} -//----------------------------------------------------------------------------- -int mgls_fillsample(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3 && k[2]==2) a[0].d->FillSample(iint(a[1].v), a[2].s); - else return 1; - return 0; -} -void mglc_fillsample(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3 && k[2]==2) - mglprintf(out,1024,L"%s.FillSample(%d, \"%s\");", a[0].s, iint(a[1].v), a[2].s); -} -//----------------------------------------------------------------------------- -int mgls_fog(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->Fog(a[0].v,k[1]==3?a[1].v:0.25); - else return 1; - return 0; -} -void mglc_fog(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3) mglprintf(out,1024,L"gr->Fog(%g, %g);", a[0].v,k[1]==3?a[1].v:0.25); -} -//----------------------------------------------------------------------------- -int mgls_font(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2) - { strcpy(gr->FontDef,a[0].s); if(k[1]==3) gr->FontSize = a[1].v; } - else return 1; - return 0; -} -void mglc_font(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==2 && k[1]==3) - mglprintf(out,1024,L"strcpy(gr->FontDef,\"%s\");\tgr->FontSize = %g;", a[0].s, a[1].v); - else if(k[0]==2) - mglprintf(out,1024,L"strcpy(gr->FontDef,\"%s\");",a[0].s); -} -//----------------------------------------------------------------------------- -int mgls_loadfont(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2 && a[0].s[0]) gr->GetFont()->Load(a[0].s); - else gr->GetFont()->Restore(); - return 0; -} -void mglc_loadfont(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==2 && a[0].s[0]) - mglprintf(out,1024,L"gr->GetFont()->Load(\"%s\");", a[0].s); - else - mglprintf(out,1024,L"gr->GetFont()->Restore();"); -} -//----------------------------------------------------------------------------- -int mgls_grid(mglGraph *gr, long , mglArg *a, int k[10]) -{ - gr->Grid(k[0]==2?a[0].s:"xyzt", k[1]==2?a[1].s:"B-"); - return 0; -} -void mglc_grid(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - mglprintf(out,1024,L"gr->Grid(\"%s\", \"%s\");", k[0]==2?a[0].s:"xyz", k[1]==2?a[1].s:"B-"); -} -//----------------------------------------------------------------------------- -int mgls_grid2(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]!=1) - gr->Grid(*(a[0].d), *(a[1].d), *(a[2].d), k[3]==2?a[3].s:0, k[4]==3?a[4].v:NAN); - else if(k[0]==1) gr->Grid(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3?a[2].v:NAN); - else return 1; - return 0; -} -void mglc_grid2(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]!=1) - mglprintf(out,1024,L"gr->Grid(%s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?a[4].v:NAN); - else if(k[0]==1) - mglprintf(out,1024,L"gr->Grid(%s,\"%s\", %g);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_grid3(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]==2) - gr->Grid3(*(a[0].d),a[1].s[0],k[2]==3?iint(a[2].v):-1, - k[3]==2?a[3].s:0); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) - gr->Grid3(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),a[4].s[0], - k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s:0); - else return 1; - return 0; -} -void mglc_grid3(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]==2) - mglprintf(out,1024,L"gr->Grid3(%s, '%c', %d, \"%s\");", a[0].s, a[1].s[0], k[2]==3?iint(a[2].v):-1, k[3]==2?a[3].s:""); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) - mglprintf(out,1024,L"gr->Grid3(%s, %s, %s, %s, '%c', %d, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s[0], k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s:0); -} -//----------------------------------------------------------------------------- -int mgls_grida(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]==1 && k[2]==1 && k[3]==1) - gr->GridA(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0); - else gr->GridA(*(a[0].d),k[1]==2?a[1].s:0); - return 0; -} -void mglc_grida(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->GridA(%s, %s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:""); - else - mglprintf(out,1024,L"gr->GridA(%s, \"%s\");", a[0].s, k[1]==2?a[1].s:""); -} -//----------------------------------------------------------------------------- -int mgls_light(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==0) gr->Light(true); - else if(k[0]!=3) return 1; - else if(k[1]!=3) gr->Light(a[0].v!=0); - else if(k[2]==3 && k[3]==3) - gr->Light(iint(a[0].v),mglPoint(a[1].v,a[2].v,a[3].v), - k[4]==2?a[4].s[0]:'w',k[5]==3?a[5].v:0.5,true,k[6]==3?a[6].v:0); - else gr->Light(iint(a[0].v),a[1].v!=0); - return 0; -} -void mglc_light(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==0) mglprintf(out,1024,L"gr->Light(true);"); - else if(k[0]!=3) return; - else if(k[1]!=3) mglprintf(out,1024,L"gr->Light(%s);", a[0].v!=0 ? "true":"false"); - else if(k[2]==3 && k[3]==3) - mglprintf(out,1024,L"gr->Light(%d, mglPoint(%g, %g, %g), '%c', %g, true, %g);", - iint(a[0].v), a[1].v, a[2].v, a[3].v, k[4]==2?a[4].s[0]:'w', k[5]==3?a[5].v:0.5, k[6]==3?a[6].v:0); - else mglprintf(out,1024,L"gr->Light(%d, %s);", iint(a[0].v), a[1].v!=0 ? "true":"false"); -} -//----------------------------------------------------------------------------- -int mgls_line(mglGraph *gr, long n, mglArg *a, int [10]) -{ - int i; - if(n>5) - { - bool ok=true; - for(i=0;i<6;i++) if(a[i].type!=2) ok=false; - if(ok) - gr->Line(mglPoint(a[0].v,a[1].v,a[2].v), - mglPoint(a[3].v,a[4].v,a[5].v), - (n==7 && a[6].type==1) ? a[6].s : 0, 100); - else return 1; - } - else if(n>3) - { - bool ok=true; - for(i=0;i<4;i++) if(a[i].type!=2) ok=false; - if(ok) - gr->Line(mglPoint(a[0].v,a[1].v,gr->Min.z), mglPoint(a[2].v,a[3].v,gr->Min.z), - (n==5 && a[4].type==1) ? a[4].s : 0, 100); - else return 1; - } - else return 1; - return 0; -} -void mglc_line(wchar_t out[1024], long n, mglArg *a, int [10]) -{ - int i; - if(n>5) - { - bool ok=true; - for(i=0;i<6;i++) if(a[i].type!=2) ok=false; - if(ok) - mglprintf(out,1024,L"gr->Line(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), \"%s\", 100);", a[0].v,a[1].v,a[2].v, a[3].v,a[4].v,a[5].v, (n==7 && a[6].type==1) ? a[6].s : ""); - } - else if(n>3) - { - bool ok=true; - for(i=0;i<4;i++) if(a[i].type!=2) ok=false; - if(ok) - mglprintf(out,1024,L"gr->Line(mglPoint(%g, %g, gr->Min.z), mglPoint(%g, %g, gr->Min.z), \"%s\", 100);", a[0].v,a[1].v,a[2].v, a[3].v, (n==5 && a[4].type==1) ? a[4].s : ""); - } -} -//----------------------------------------------------------------------------- -int mgls_legend(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3) - gr->Legend(a[0].v, a[1].v, k[2]==2?a[2].s:"rL", k[3]==3?a[3].v:-1, k[4]==3?a[4].v:0.1); - else - gr->Legend(k[0]==3?iint(a[0].v):3, k[1]==2?a[1].s:"rL", k[2]==3?a[2].v:-1, k[3]==3?a[3].v:0.1); - return 0; -} -void mglc_legend(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3) - mglprintf(out,1024,L"gr->Legend(%g, %g, \"%s\", %g, %g);", a[0].v, a[1].v, k[2]==2?a[2].s:"rL", k[3]==3?a[3].v:-1, k[4]==3?a[4].v:0.1); - else - mglprintf(out,1024,L"gr->Legend(%d, \"%s\", %g, %g);", k[0]==3?iint(a[0].v):3, k[1]==2?a[1].s:"rL", k[2]==3?a[2].v:-1, k[4]==3?a[4].v:0.1); -} -//----------------------------------------------------------------------------- -int mgls_linewidth(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && a[0].v>=1) gr->BaseLineWidth = a[0].v; - else return 1; - return 0; -} -void mglc_linewidth(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && a[0].v>=1) mglprintf(out,1024,L"gr->BaseLineWidth = %g;", a[0].v); -} -//----------------------------------------------------------------------------- -int mgls_barwidth(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->SetBarWidth(a[0].v); - else return 1; - return 0; -} -void mglc_barwidth(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3) mglprintf(out,1024,L"gr->SetBarWidth(%g);", a[0].v); -} -//----------------------------------------------------------------------------- -int mgls_legendbox(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->SetLegendBox(a[0].v!=0); - else return 1; - return 0; -} -void mglc_legendbox(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3) mglprintf(out,1024,L"gr->SetLegendBox(%s);", (a[0].v!=0)?"true":"false"); -} -//----------------------------------------------------------------------------- -int mgls_legendmarks(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->SetLegendMarks(iint(a[0].v)); - else return 1; - return 0; -} -void mglc_legendmarks(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3) mglprintf(out,1024,L"gr->SetLegendMarks(%d);", iint(a[0].v)); -} -//----------------------------------------------------------------------------- -int mgls_modify(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) - a[0].d->Modify(a[1].s,*(a[2].d),*(a[3].d)); - else if(k[0]==1 && k[1]==2 && k[2]==1) - a[0].d->Modify(a[1].s,*(a[2].d)); - else if(k[0]==1 && k[1]==2) - a[0].d->Modify(a[1].s, k[2]==3 ? iint(a[2].v):0); - else return 1; - return 0; -} -void mglc_modify(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"%s.Modify(\"%s\", %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s); - else if(k[0]==1 && k[1]==2 && k[2]==1) - mglprintf(out,1024,L"%s.Modify(\"%s\", %s);", a[0].s, a[1].s, a[2].s); - else if(k[0]==1 && k[1]==2) - mglprintf(out,1024,L"%s.Modify(\"%s\", %d);", a[0].s, a[1].s, k[2]==3 ? iint(a[2].v):0); -} -//----------------------------------------------------------------------------- -int mgls_max(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==2) *(a[0].d) = a[1].d->Max(a[2].s); - else return 1; - return 0; -} -void mglc_max(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==2) - mglprintf(out,1024,L"%s = %s.Max(\"%s\");", a[0].s, a[1].s, a[2].s); -} -//----------------------------------------------------------------------------- -int mgls_min(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==2) *(a[0].d) = a[1].d->Min(a[2].s); - else return 1; - return 0; -} -void mglc_min(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==2) - mglprintf(out,1024,L"%s = %s.Min(\"%s\");", a[0].s, a[1].s, a[2].s); -} -//----------------------------------------------------------------------------- -int mgls_sum(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==2) *(a[0].d) = a[1].d->Sum(a[2].s); - else return 1; - return 0; -} -void mglc_sum(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==2) - mglprintf(out,1024,L"%s = %s.Sum(\"%s\");", a[0].s, a[1].s, a[2].s); -} -//----------------------------------------------------------------------------- -int mgls_meshnum(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->MeshNum = iint(a[0].v); - else return 1; - return 0; -} -void mglc_meshnum(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3) mglprintf(out,1024,L"gr->MeshNum = %d;", iint(a[0].v)); -} -//----------------------------------------------------------------------------- -int mgls_marksize(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->MarkSize = a[0].v/50; - else return 1; - return 0; -} -void mglc_marksize(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3) mglprintf(out,1024,L"gr->MarkSize = %g;", a[0].v/50); -} -//----------------------------------------------------------------------------- -int mgls_mark(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=1) return 1; - else if(k[2]!=1) gr->Mark(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0,k[3]==3?a[3].v:NAN); - else if(k[3]!=1) gr->Mark(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0,k[4]==3?a[4].v:NAN); - else gr->Mark(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0); - return 0; -} -void mglc_mark(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=1) return; - else if(k[2]!=1) - mglprintf(out,1024,L"gr->Mark(%s, %s, \"%s\", %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); - else if(k[3]!=1) - mglprintf(out,1024,L"gr->Mark(%s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?a[4].v:NAN); - else - mglprintf(out,1024,L"gr->Mark(%s, %s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:""); -} -//----------------------------------------------------------------------------- -int mgls_map(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - gr->Map(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0, 0,k[5]==3?(a[5].v!=0):true); - else if(k[0]==1 && k[1]==1) - gr->Map(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0,0,k[3]==3?(a[3].v!=0):true); - else return 1; - return 0; -} -void mglc_map(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->Map(%s, %s, %s, %s, \"%s\", 0, %s);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", (k[5]!=3 || a[5].v!=0)?"true":"false"); - else if(k[0]==1 && k[1]==1) - mglprintf(out,1024,L"gr->Map(%s, %s, \"%s\", 0, %s);", a[0].s, a[1].s, k[2]==2?a[2].s:"", (k[3]!=3 || a[3].v!=0)?"true":"false"); -} -//----------------------------------------------------------------------------- -int mgls_read(mglGraph *gr, long n, mglArg *a, int k[10]) -{ - bool rr=true; - if(k[0]!=1 || k[1]!=2) return 1; - else if(n==2) rr=a[0].d->Read(a[1].s); - else rr=a[0].d->Read(a[1].s, k[2]==3?iint(a[2].v):1, - k[3]==3?iint(a[3].v):1, k[4]==3?iint(a[4].v):1); - if(!rr) gr->SetWarn(mglWarnFile); - return 0; -} -void mglc_read(wchar_t out[1024], long n, mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=2) return; - else if(n==2) mglprintf(out,1024,L"%s.Read(\"%s\");", a[0].s, a[1].s); - else - mglprintf(out,1024,L"%s.Read(\"%s\", %d, %d, %d);", a[0].s, a[1].s, k[2]==3?iint(a[2].v):1, k[3]==3?iint(a[3].v):1, k[4]==3?iint(a[4].v):1); -} -//----------------------------------------------------------------------------- -int mgls_readmat(mglGraph *gr, long , mglArg *a, int k[10]) -{ - bool rr=true; - if(k[0]!=1 || k[1]!=2) return 1; - else rr=a[0].d->ReadMat(a[1].s, k[2]==3?iint(a[2].v):2); - if(!rr) gr->SetWarn(mglWarnFile); - return 0; -} -void mglc_readmat(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) - mglprintf(out,1024,L"%s.ReadMat(\"%s\", %d);", a[0].s, a[1].s, k[2]==3?iint(a[2].v):2); -} -//----------------------------------------------------------------------------- -int mgls_readall(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=2) return 1; - else if(k[2]==3 && k[3]==3) - a[0].d->ReadRange(a[1].s, a[2].v, a[3].v, k[4]==3?a[4].v:1.f, k[5]==3?(a[5].v!=0) : false); - else a[0].d->ReadAll(a[1].s, k[2]==3?(a[2].v!=0) : false); - return 0; -} -void mglc_readall(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=2) return; - else if(k[2]==3 && k[3]==3) - mglprintf(out,1024,L"%s.ReadRange(\"%s\", %g, %g, %g, %s);", a[0].s, a[1].s, a[2].v, a[3].v, k[4]==3?a[4].v:1.f, (k[5]==3&&a[5].v!=0)?"true":"false"); - else - mglprintf(out,1024,L"%s.ReadAll(\"%s\", %s);", a[0].s, a[1].s, (k[2]==3&&a[2].v!=0)?"true":"false"); -} -//----------------------------------------------------------------------------- -int mgls_readhdf(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==2) a[0].d->ReadHDF(a[1].s, a[2].s); - else return 1; - return 0; -} -void mglc_readhdf(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==2) mglprintf(out,1024,L"%s.ReadHDF(\"%s\", \"%s\");", a[0].s, a[1].s, a[2].s); -} -//----------------------------------------------------------------------------- -int mgls_savehdf(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==2) a[0].d->SaveHDF(a[1].s, a[2].s); - else return 1; - return 0; -} -void mglc_savehdf(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==2) - mglprintf(out,1024,L"%s.SaveHDF(\"%s\", \"%s\");", a[0].s, a[1].s, a[2].s); -} -//----------------------------------------------------------------------------- -int mgls_rect(mglGraph *gr, long n, mglArg *a, int [10]) -{ - long i; - if(n>5) - { - bool ok=true; - for(i=0;i<6;i++) if(a[i].type!=2) ok=false; - if(ok) - { - if(a[0].v==a[3].v) gr->Face(mglPoint(a[0].v,a[1].v,a[2].v), - mglPoint(a[0].v,a[4].v,a[2].v), - mglPoint(a[3].v,a[1].v,a[5].v), - mglPoint(a[3].v,a[4].v,a[5].v), - (n==7 && a[6].type==1) ? a[6].s : 0, 2); - else gr->Face(mglPoint(a[0].v,a[1].v,a[2].v), - mglPoint(a[0].v,a[4].v,a[5].v), - mglPoint(a[3].v,a[1].v,a[2].v), - mglPoint(a[3].v,a[4].v,a[5].v), - (n==7 && a[6].type==1) ? a[6].s : 0, 2); - } - else return 1; - } - else if(n>3) - { - bool ok=true; - mreal p = (gr->Min.z+gr->Max.z)/2; - for(i=0;i<4;i++) if(a[i].type!=2) ok=false; - if(ok) - gr->Face(mglPoint(a[0].v,a[1].v,p), mglPoint(a[0].v,a[3].v,p), - mglPoint(a[2].v,a[1].v,p), mglPoint(a[2].v,a[3].v,p), - (n==5 && a[4].type==1) ? a[4].s : 0, 2); - else return 1; - } - else return 1; - return 0; -} -void mglc_rect(wchar_t out[1024], long n, mglArg *a, int [10]) -{ - long i; - if(n>5) - { - bool ok=true; - for(i=0;i<6;i++) if(a[i].type!=2) ok=false; - if(ok) - { - if(a[0].v==a[3].v) - mglprintf(out,1024,L"gr->Face(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), \"%s\", 2);", a[0].v,a[1].v,a[2].v, a[0].v,a[4].v,a[2].v, a[3].v,a[1].v,a[5].v, a[3].v,a[4].v,a[5].v, (n==7 && a[6].type==1) ? a[6].s : ""); - else - mglprintf(out,1024,L"gr->Face(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), \"%s\", 2);", a[0].v,a[1].v,a[2].v, a[0].v,a[4].v,a[5].v, a[3].v,a[1].v,a[2].v, a[3].v,a[4].v,a[5].v, (n==7 && a[6].type==1) ? a[6].s : ""); - } - } - else if(n>3) - { - bool ok=true; - for(i=0;i<4;i++) if(a[i].type!=2) ok=false; - if(ok) - mglprintf(out,1024,L"gr->Face(mglPoint(%g, %g, (gr->Min.z+gr->Max.z)/2), mglPoint(%g, %g, (gr->Min.z+gr->Max.z)/2), mglPoint(%g, %g, (gr->Min.z+gr->Max.z)/2), mglPoint(%g, %g, (gr->Min.z+gr->Max.z)/2), \"%s\", 2);", a[0].v,a[1].v, a[0].v,a[3].v, a[2].v,a[1].v, a[2].v,a[3].v, (n==5 && a[4].type==1) ? a[4].s : ""); - } -} -//----------------------------------------------------------------------------- -int mgls_resize(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) - *(a[0].d) = a[1].d->Resize(k[2]==3?iint(a[2].v):1, - k[3]==3?iint(a[3].v):1, k[4]==3?iint(a[4].v):1); - else return 1; - return 0; -} -void mglc_resize(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) - mglprintf(out,1024,L"%s = %s.Resize(%d, %d, %d);", a[0].s, a[1].s, k[2]==3?iint(a[2].v):1, k[3]==3?iint(a[3].v):1, k[4]==3?iint(a[4].v):1); -} -//----------------------------------------------------------------------------- -int mgls_rotate(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) - gr->RotateN(a[0].v, a[1].v, a[2].v, a[3].v); - else if(k[0]==3 && k[1]==3) - gr->Rotate(a[0].v, a[1].v, k[2]==3?a[2].v:0); - else return 1; - return 0; -} -void mglc_rotate(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) - mglprintf(out,1024,L"gr->RotateN(%g, %g, %g, %g);", a[0].v, a[1].v, a[2].v, a[3].v); - else if(k[0]==3 && k[1]==3) - mglprintf(out,1024,L"gr->Rotate(%g, %g, %g);", a[0].v, a[1].v, k[2]==3?a[2].v:0); -} -//----------------------------------------------------------------------------- -int mgls_rotatetext(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->RotatedText = (a[0].v!=0); - else return 1; - return 0; -} -void mglc_rotatetext(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3) mglprintf(out,1024,L"gr->RotatedText = %s;", (a[0].v!=0)?"true":"false"); -} -//----------------------------------------------------------------------------- -int mgls_save(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) a[0].d->Save(a[1].s); - else return 1; - return 0; -} -void mglc_save(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Save(\"%s\");", a[0].s, a[1].s); -} -//----------------------------------------------------------------------------- -int mgls_smooth(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1) a[0].d->Smooth(k[1]==3?iint(a[1].v):2,k[2]==2?a[2].s:"xyz"); - else return 1; - return 0; -} -void mglc_smooth(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) - mglprintf(out,1024,L"%s.Smooth(%d, \"%s\");", a[0].s, k[1]==3?iint(a[1].v):2, k[2]==2?a[2].s:"xyz"); -} -//----------------------------------------------------------------------------- -int mgls_swap(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) a[0].d->Swap(a[1].s); - else return 1; - return 0; -} -void mglc_swap(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Swap(\"%s\");", a[0].s, a[1].s); -} -//----------------------------------------------------------------------------- -int mgls_idset(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) a[0].d->SetColumnId(a[1].s); - else return 1; - return 0; -} -void mglc_idset(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.SetColumnId(\"%s\");", a[0].s, a[1].s); -} -//----------------------------------------------------------------------------- -int mgls_stem(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Stem(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3 ? a[2].v : NAN); - else if(k[2]!=1) gr->Stem(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0,k[3]==3 ? a[3].v : NAN); - else gr->Stem(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0); - return 0; -} -void mglc_stem(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Stem(%s, \"%s\", %g);",a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN); - else if(k[2]!=1) - mglprintf(out,1024,L"gr->Stem(%s, %s, \"%s\", %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); - else mglprintf(out,1024,L"gr->Stem(%s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:""); -} -//----------------------------------------------------------------------------- -int mgls_step(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Step(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3 ? a[2].v : NAN); - else if(k[2]!=1) gr->Step(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0,k[3]==3 ? a[3].v : NAN); - else gr->Step(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0); - return 0; -} -void mglc_step(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Step(%s, \"%s\", %g);",a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN); - else if(k[2]!=1) - mglprintf(out,1024,L"gr->Step(%s, %s, \"%s\", %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); - else mglprintf(out,1024,L"gr->Step(%s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:""); -} -//----------------------------------------------------------------------------- -int mgls_plot(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Plot(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3 ? a[2].v : NAN); - else if(k[2]!=1) gr->Plot(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0,k[3]==3 ? a[3].v : NAN); - else gr->Plot(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0); - return 0; -} -void mglc_plot(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Plot(%s, \"%s\", %g);",a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN); - else if(k[2]!=1) - mglprintf(out,1024,L"gr->Plot(%s, %s, \"%s\", %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); - else mglprintf(out,1024,L"gr->Plot(%s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:""); -} -//----------------------------------------------------------------------------- -int mgls_boxplot(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->BoxPlot(*(a[0].d),k[1]==2?a[1].s:0,k[2]==3 ? a[2].v : NAN); - else if(k[2]!=1) gr->BoxPlot(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0,k[3]==3 ? a[3].v : NAN); - return 0; -} -void mglc_boxplot(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->BoxPlot(%s, \"%s\", %g);",a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN); - else if(k[2]!=1) - mglprintf(out,1024,L"gr->BoxPlot(%s, %s, \"%s\", %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_radar(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->Radar(*(a[0].d), k[1]==2?a[1].s:0, k[2]==3?a[2].v:-1); - else return 1; - return 0; -} -void mglc_radar(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) - mglprintf(out,1024,L"gr->Radar(%s, \"%s\", %g);",a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:-1); -} -//----------------------------------------------------------------------------- -int mgls_squeeze(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3) - a[0].d->Squeeze(iint(a[1].v), k[2]==3?iint(a[2].v):1, k[3]==3?iint(a[3].v):1, k[4]==3 && a[4].v>0); - else return 1; - return 0; -} -void mglc_squeeze(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3) - mglprintf(out,1024,L"%s.Squeeze(%d, %d, %d, %s);", a[0].s, iint(a[1].v), - k[2]==3?iint(a[2].v):1, k[3]==3?iint(a[3].v):1, k[4]==3 && a[4].v>0 ? "true":"false"); -} -//----------------------------------------------------------------------------- -int mgls_stfad(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==3) - *(a[0].d) = mglSTFA(*(a[1].d),*(a[2].d), iint(a[3].v), k[4]==2?a[4].s[0]:'x'); - else return 1; - return 0; -} -void mglc_stfad(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==3) - mglprintf(out,1024,L"%s = mglSTFA(%s, %s, %d, '%c');", a[0].s, a[1].s, a[2].s, iint(a[3].v), k[4]==2?a[4].s[0]:'x'); -} -//----------------------------------------------------------------------------- -int mgls_setsize(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && a[1].v>1 && a[0].v>1) - gr->SetSize(iint(a[0].v), iint(a[1].v)); - else return 1; - return 0; -} -void mglc_setsize(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && a[1].v>1 && a[0].v>1) - mglprintf(out,1024,L"gr->SetSize(%d, %d);", iint(a[0].v), iint(a[1].v)); -} -//----------------------------------------------------------------------------- -int mgls_sphere(mglGraph *gr, long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=3) break; - if(i==4) - gr->Sphere(mglPoint(a[0].v,a[1].v,a[2].v), a[3].v, k[4]==2 ? a[4].s:"r"); - else if(i==3) - gr->Sphere(mglPoint(a[0].v,a[1].v), a[2].v, k[3]==2 ? a[3].s:"r"); - else return 1; - return 0; -} -void mglc_sphere(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=3) break; - if(i==4) - mglprintf(out,1024,L"gr->Sphere(mglPoint(%g, %g, %g), %g, \"%s\");", a[0].v,a[1].v,a[2].v, a[3].v, k[4]==2 ? a[4].s:"r"); - else if(i==3) - mglprintf(out,1024,L"gr->Sphere(mglPoint(%g, %g), %g, \"%s\");", a[0].v,a[1].v, a[2].v, k[3]==2 ? a[3].s:"r"); -} -//----------------------------------------------------------------------------- -int mgls_stfa(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==3) - gr->STFA(*(a[0].d),*(a[1].d), iint(a[2].v), k[3]==2?a[3].s:""); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==3) - gr->STFA(*(a[0].d),*(a[1].d), *(a[2].d),*(a[3].d), iint(a[4].v), k[5]==2?a[5].s:""); - else return 1; - return 0; -} -void mglc_stfa(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==3) - mglprintf(out,1024,L"gr->STFA(%s, %s, %d, \"%s\");", a[0].s, a[1].s, iint(a[2].v), k[3]==2?a[3].s:""); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==3) - mglprintf(out,1024,L"gr->STFA(%s, %s, %s, %s, %d, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, iint(a[4].v), k[5]==2?a[5].s:""); -} -//----------------------------------------------------------------------------- -int mgls_surf3(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]==0) gr->Surf3(*(a[0].d)); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==3) - gr->Surf3(a[4].v,*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d), - k[5]==2? a[5].s:0); - else if(k[1]==3) gr->Surf3(a[1].v,*(a[0].d),k[2]==2? a[2].s:0); - else if(k[1]==2) gr->Surf3(*(a[0].d),a[1].s,iint(k[2]==3?a[2].v:3)); - else if(k[1]==1 && k[2]==1 && k[3]==1) - gr->Surf3(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d), - k[4]==2? a[4].s:0,iint(k[5]==3?a[5].v:3)); - else return 1; - return 0; -} -void mglc_surf3(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]==0) mglprintf(out,1024,L"gr->Surf3(%s);", a[0].s); - else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==3) - mglprintf(out,1024,L"gr->Surf3(%g, %s, %s, %s, %s, \"%s\");", a[4].v, a[0].s, a[1].s, a[2].s, a[3].s, k[5]==2?a[5].s:""); - else if(k[1]==3) - mglprintf(out,1024,L"gr->Surf3(%g, %s, \"%s\");", a[1].v, a[0].s, k[2]==2? a[2].s:""); - else if(k[1]==2) - mglprintf(out,1024,L"gr->Surf3(%s, \"%s\", %d);", a[0].s, a[1].s, iint(k[2]==3?a[2].v:3)); - else if(k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->Surf3(%s, %s, %s, %s, \"%s\", %d);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", iint(k[5]==3?a[5].v:3)); -} -//----------------------------------------------------------------------------- -int mgls_surf3c(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=1) return 1; - else if(k[2]==0) gr->Surf3C(*(a[0].d),*(a[1].d)); - else if(k[2]==1 && k[3]==1 && k[4]==1 && k[5]==3) - gr->Surf3C(a[5].v,*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d), - k[6]==2? a[6].s:0); - else if(k[2]==3) gr->Surf3C(a[2].v,*(a[0].d),*(a[1].d),k[3]==2? a[3].s:0); - else if(k[2]==2) gr->Surf3C(*(a[0].d),*(a[1].d),a[2].s,iint(k[3]==3?a[3].v:3)); - else if(k[2]==1 && k[3]==1 && k[4]==1) - gr->Surf3C(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d), - k[5]==2? a[5].s:0,iint(k[6]==3?a[6].v:3)); - else return 1; - return 0; -} -void mglc_surf3c(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=1) return; - else if(k[2]==0) mglprintf(out,1024,L"gr->Surf3C(%s, %s);", a[0].s, a[1].s); - else if(k[2]==1 && k[3]==1 && k[4]==1 && k[5]==3) - mglprintf(out,1024,L"gr->Surf3C(%g, %s, %s, %s, %s, %s, \"%s\");", a[5].v, a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, k[6]==2? a[6].s:""); - else if(k[2]==3) - mglprintf(out,1024,L"gr->Surf3C(%g, %s, %s, \"%s\");", a[2].v, a[0].s, a[1].s, k[3]==2?a[3].s:0); - else if(k[2]==2) - mglprintf(out,1024,L"gr->Surf3C(%s, %s, \"%s\", %d);", a[0].s, a[1].s, a[2].s, iint(k[3]==3?a[3].v:3)); - else if(k[2]==1 && k[3]==1 && k[4]==1) - mglprintf(out,1024,L"gr->Surf3C(%s, %s, %s, %s, %s, \"%s\", %d);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, k[5]==2?a[5].s:"", iint(k[6]==3?a[6].v:3)); -} -//----------------------------------------------------------------------------- -int mgls_surf3a(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=1) return 1; - else if(k[2]==0) gr->Surf3A(*(a[0].d),*(a[1].d)); - else if(k[2]==1 && k[3]==1 && k[4]==1 && k[5]==3) - gr->Surf3A(a[5].v,*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d), - k[6]==2? a[6].s:0); - else if(k[2]==3) gr->Surf3A(a[2].v,*(a[0].d),*(a[1].d),k[3]==2? a[3].s:0); - else if(k[2]==2) gr->Surf3A(*(a[0].d),*(a[1].d),a[2].s,iint(k[3]==3?a[3].v:3)); - else if(k[2]==1 && k[3]==1 && k[4]==1) - gr->Surf3A(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d), - k[5]==2? a[5].s:0,iint(k[6]==3?a[6].v:3)); - else return 1; - return 0; -} -void mglc_surf3a(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=1) return; - else if(k[2]==0) mglprintf(out,1024,L"gr->Surf3A(%s, %s);", a[0].s, a[1].s); - else if(k[2]==1 && k[3]==1 && k[4]==1 && k[5]==3) - mglprintf(out,1024,L"gr->Surf3A(%g, %s, %s, %s, %s, %s, \"%s\");", a[5].v, a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, k[6]==2? a[6].s:""); - else if(k[2]==3) - mglprintf(out,1024,L"gr->Surf3A(%g, %s, %s, \"%s\");", a[2].v, a[0].s, a[1].s, k[3]==2?a[3].s:0); - else if(k[2]==2) - mglprintf(out,1024,L"gr->Surf3A(%s, %s, \"%s\", %d);", a[0].s, a[1].s, a[2].s, iint(k[3]==3?a[3].v:3)); - else if(k[2]==1 && k[3]==1 && k[4]==1) - mglprintf(out,1024,L"gr->Surf3A(%s, %s, %s, %s, %s, \"%s\", %d);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, k[5]==2?a[5].s:"", iint(k[6]==3?a[6].v:3)); -} -//----------------------------------------------------------------------------- -int mgls_subplot(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==2) - gr->SubPlot(iint(a[0].v), iint(a[1].v), iint(a[2].v), a[3].s); - else if(k[0]==3 && k[1]==3 && k[2]==3) - gr->SubPlot(iint(a[0].v), iint(a[1].v), iint(a[2].v), k[3]==3?a[3].v:0, k[4]==3?a[4].v:0); - else return 1; - return 0; -} -void mglc_subplot(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==2) - mglprintf(out,1024,L"gr->SubPlot(%d, %d, %d, \"%s\");", iint(a[0].v), iint(a[1].v), iint(a[2].v), a[3].s); - else if(k[0]==3 && k[1]==3 && k[2]==3) - mglprintf(out,1024,L"gr->SubPlot(%d, %d, %d, %g, %g);", iint(a[0].v), iint(a[1].v), iint(a[2].v), k[3]==3?a[3].v:0, k[4]==3?a[4].v:0); -} -//----------------------------------------------------------------------------- -int mgls_subdata(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==3) - *(a[0].d) = a[1].d->SubData(iint(a[2].v), k[3]==3?iint(a[3].v):-1, k[4]==3?iint(a[4].v):-1); - else return 1; - return 0; -} -void mglc_subdata(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==3) - mglprintf(out,1024,L"%s = %s.SubData(%d, %d, %d);", a[0].s, a[1].s, iint(a[2].v), k[3]==3?iint(a[3].v):-1, k[4]==3?iint(a[4].v):-1); -} -//----------------------------------------------------------------------------- -int mgls_trace(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) *(a[0].d) = a[1].d->Trace(); - else return 1; - return 0; -} -void mglc_trace(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) mglprintf(out,1024,L"%s = %s.Trace();", a[0].s, a[1].s); -} -//----------------------------------------------------------------------------- -int mgls_tile(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]!=1) gr->Tile(*(a[0].d), k[1]==2? a[1].s:0); - else if(k[1]==1 && k[2]==1) - gr->Tile(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2? a[3].s:0); - else return 1; - return 0; -} -void mglc_tile(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]!=1) - mglprintf(out,1024,L"gr->Tile(%s, \"%s\");", a[0].s, k[1]==2?a[1].s:""); - else if(k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->Tile(%s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:""); -} -//----------------------------------------------------------------------------- -int mgls_tiles(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return 1; - else if(k[1]==1 && k[2]!=1) - gr->TileS(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0); - else if(k[1]==1 && k[2]==1 && k[3]==1) - gr->TileS(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2? a[4].s:0); - else return 1; - return 0; -} -void mglc_tiles(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1) return; - else if(k[1]==1 && k[2]!=1) - mglprintf(out,1024,L"gr->TileS(%s, %s, \"%s\");", a[0].s, a[1].s, k[2]==2?a[2].s:""); - else if(k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->TileS(%s, %s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:""); -} -//----------------------------------------------------------------------------- -int mgls_text(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==2) - gr->Putsw(mglPoint(a[0].v,a[1].v,a[2].v),a[3].w, - (k[4]==2 && a[4].s[0]!=0)?a[4].s:gr->FontDef,k[5]==3?a[5].v:-1.4); - else if(k[0]==3 && k[1]==3 && k[2]==2) - gr->Putsw(mglPoint(a[0].v,a[1].v),a[2].w, - (k[3]==2 && a[3].s[0]!=0)?a[3].s:gr->FontDef,k[4]==3?a[4].v:-1.4); - else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3 && k[6]==2) - gr->Putsw(mglPoint(a[0].v,a[1].v,a[2].v), mglPoint(a[3].v,a[4].v,a[5].v), a[6].w, 't', k[8]==3?a[8].v:-1.4); - else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==2) - gr->Putsw(mglPoint(a[0].v,a[1].v), mglPoint(a[2].v,a[3].v), a[4].w, 't', k[6]==3?a[6].v:-1.4); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2) - gr->Text(*(a[0].d),*(a[1].d),*(a[2].d),a[3].w,k[4]==2?a[4].s:0,k[5]==3?a[5].v:-1); - else if(k[0]==1 && k[1]==1 && k[2]==2) - gr->Text(*(a[0].d),*(a[1].d),a[2].w,k[3]==2?a[3].s:0, - k[4]==3?a[4].v:-1,k[5]==3?a[5].v:NAN); - else if(k[0]==1 && k[1]==2) - gr->Text(*(a[0].d),a[1].w,k[2]==2?a[2].s:0,k[3]==3?a[3].v:-1,k[4]==3?a[4].v:NAN); - else return 1; - return 0; -} -void mglc_text(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==2) - mglprintf(out,1024,L"gr->Puts(mglPoint(%g, %g, %g), L\"%ls\", \"%s\", %g);", a[0].v, a[1].v, a[2].v, a[3].w, (k[4]==2 && a[4].s[0]!=0)?a[4].s:"C", k[5]==3?a[5].v:-1.4); - else if(k[0]==3 && k[1]==3 && k[2]==2) - mglprintf(out,1024,L"gr->Puts(mglPoint(%g, %g), L\"%ls\", \"%s\", %g);", a[0].v, a[1].v, a[2].w, (k[3]==2 && a[3].s[0]!=0)?a[3].s:"C", k[4]==3?a[4].v:-1.4); - else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3 && k[6]==2) - mglprintf(out,1024,L"gr->Puts(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), L\"%ls\", 't', %g);", a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, a[5].v, a[6].w, k[8]==3?a[8].v:-1.4); - else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==2) - mglprintf(out,1024,L"gr->Puts(mglPoint(%g, %g), mglPoint(%g, %g), L\"%ls\", 't', %g);", a[0].v, a[1].v, a[2].v, a[3].v, a[4].w, k[6]==3?a[6].v:-1.4); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2) - mglprintf(out,1024,L"gr->Text(%s, %s, %s, L\"%ls\", \"%s\", %g);", a[0].s, a[1].s, a[2].s, a[3].w, k[4]==2?a[4].s:"", k[5]==3?a[5].v:-1); - else if(k[0]==1 && k[1]==1 && k[2]==2) - mglprintf(out,1024,L"gr->Text(%s, %s, L\"%ls\", \"%s\", %g, %g);", a[0].s, a[1].s, a[2].w, k[3]==2?a[3].s:"", k[4]==3?a[4].v:-1, k[5]==3?a[5].v:NAN); - else if(k[0]==1 && k[1]==2) - mglprintf(out,1024,L"gr->Text(%s, L\"%ls\", \"%s\", %g, %g);", a[0].s, a[1].w, k[2]==2?a[2].s:"", k[3]==3?a[3].v:-1, k[4]==3?a[4].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_torus(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) gr->Torus(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0); - else if(k[0]==1) gr->Torus(*(a[0].d),k[1]==2?a[1].s:0); - else return 1; - return 0; -} -void mglc_torus(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1) mglprintf(out,1024,L"gr->Torus(%s, %s, \"%s\");", a[0].s, a[1].s, k[2]==2?a[2].s:""); - else if(k[0]==1) mglprintf(out,1024,L"gr->Torus(%s, \"%s\");", a[0].s, k[1]==2?a[1].s:""); -} -//----------------------------------------------------------------------------- -int mgls_transparent(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->Transparent = (a[0].v!=0); - else return 1; - return 0; -} -void mglc_transparent(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3) mglprintf(out,1024,L"gr->Transparent = %s;", (a[0].v!=0)?"true":"false"); -} -//----------------------------------------------------------------------------- -int mgls_transptype(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->TranspType = iint(a[0].v); - else return 1; - return 0; -} -void mglc_transptype(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3) mglprintf(out,1024,L"gr->TranspType = %d;", iint(a[0].v)); -} -//----------------------------------------------------------------------------- -int mgls_transform(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) - *(a[0].d) = mglTransform(*(a[2].d),*(a[3].d),a[1].s); - else return 1; - return 0; -} -void mglc_transform(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"%s = mglTransform(%s, %s, \"%s\");",a[0].s, a[2].s, a[3].s, a[1].s); -} -//----------------------------------------------------------------------------- -int mgls_transforma(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) - *(a[0].d) = mglTransformA(*(a[2].d),*(a[3].d),a[1].s); - else return 1; - return 0; -} -void mglc_transforma(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"%s = mglTransformA(%s, %s, \"%s\");",a[0].s, a[2].s, a[3].s, a[1].s); -} -//----------------------------------------------------------------------------- -int mgls_tube(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - gr->Tube(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==3) - gr->Tube(*(a[0].d),*(a[1].d),*(a[2].d),a[3].v,k[4]==2?a[4].s:0); - else if(k[0]==1 && k[1]==1 && k[2]==1) - gr->Tube(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0,k[4]==3?a[4].v:NAN); - else if(k[0]==1 && k[1]==1 && k[2]==3) - gr->Tube(*(a[0].d),*(a[1].d),a[2].v,k[3]==2?a[3].s:0,k[4]==3?a[4].v:NAN); - else if(k[0]==1 && k[1]==1) - gr->Tube(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0,k[3]==3?a[3].v:NAN); - else if(k[0]==1 && k[1]==3) - gr->Tube(*(a[0].d),a[1].v,k[2]==2?a[2].s:0,k[3]==3?a[3].v:NAN); - else return 1; - return 0; -} -void mglc_tube(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->Tube(%s, %s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:""); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==3) - mglprintf(out,1024,L"gr->Tube(%s, %s, %s, %g, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].v, k[4]==2?a[4].s:""); - else if(k[0]==1 && k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->Tube(%s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?a[4].v:NAN); - else if(k[0]==1 && k[1]==1 && k[2]==3) - mglprintf(out,1024,L"gr->Tube(%s, %s, %g, \"%s\", %g);", a[0].s, a[1].s, a[2].v, k[3]==2?a[3].s:"", k[4]==3?a[4].v:NAN); - else if(k[0]==1 && k[1]==1) - mglprintf(out,1024,L"gr->Tube(%s, %s, \"%s\", %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); - else if(k[0]==1 && k[1]==3) - mglprintf(out,1024,L"gr->Tube(%s, %g, \"%s\", %g);", a[0].s, a[1].v, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_textmark(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) - gr->TextMark(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),a[4].w,k[5]==2?a[5].s:0); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2) - gr->TextMark(*(a[0].d),*(a[1].d),*(a[2].d),a[3].w,k[4]==2?a[4].s:0,k[5]==3?a[5].v:NAN); - else if(k[0]==1 && k[1]==1 && k[2]==2) - gr->TextMark(*(a[0].d),*(a[1].d),a[2].w,k[3]==2?a[3].s:0,k[4]==3?a[4].v:NAN); - else if(k[0]==1 && k[1]==2) - gr->TextMark(*(a[0].d),a[1].w,k[2]==2?a[2].s:0,k[3]==3?a[3].v:NAN); - else return 1; - return 0; -} -void mglc_textmark(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) - mglprintf(out,1024,L"gr->TextMark(%s, %s, %s, %s, L\"%ls\", \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, a[4].w, k[5]==2?a[5].s:""); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2) - mglprintf(out,1024,L"gr->TextMark(%s, %s, %s, L\"%ls\", \"%s\", %g);", a[0].s, a[1].s, a[2].s, a[3].w, k[4]==2?a[4].s:"", k[5]==3?a[5].v:NAN); - else if(k[0]==1 && k[1]==1 && k[2]==2) - mglprintf(out,1024,L"gr->TextMark(%s, %s, L\"%ls\", \"%s\", %g);", a[0].s, a[1].s, a[2].w, k[3]==2?a[3].s:"", k[4]==3?a[4].v:NAN); - else if(k[0]==1 && k[1]==2) - mglprintf(out,1024,L"gr->TextMark(%s, L\"%ls\", \"%s\", %g);", a[0].s, a[1].w, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_triplot(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) - gr->TriPlot(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),k[5]==2?a[5].s:0); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - gr->TriPlot(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0); - else if(k[0]==1 && k[1]==1 && k[2]==1) - gr->TriPlot(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0,k[4]==3?a[4].v:NAN); - else return 1; - return 0; -} -void mglc_triplot(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) - mglprintf(out,1024,L"gr->TriPlot(%s, %s, %s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, k[5]==2?a[5].s:""); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->TriPlot(%s, %s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:""); - else if(k[0]==1 && k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->TriPlot(%s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?a[4].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_quadplot(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) - gr->QuadPlot(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),k[5]==2?a[5].s:0); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - gr->QuadPlot(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0); - else if(k[0]==1 && k[1]==1 && k[2]==1) - gr->QuadPlot(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0,k[4]==3?a[4].v:NAN); - else return 1; - return 0; -} -void mglc_quadplot(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) - mglprintf(out,1024,L"gr->QuadPlot(%s, %s, %s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, k[5]==2?a[5].s:""); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->QuadPlot(%s, %s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:""); - else if(k[0]==1 && k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->QuadPlot(%s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?a[4].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_tricont(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1) - gr->TriContV(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),k[6]==2?a[6].s:0,k[7]==3?a[7].v:NAN); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) - gr->TriContV(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),k[5]==2?a[5].s:0,k[6]==3?a[6].v:NAN); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - gr->TriCont(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0,7,k[5]==3?a[5].v:NAN); - else return 1; - return 0; -} -void mglc_tricont(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1) - mglprintf(out,1024,L"gr->TriContV(%s, %s, %s, %s, %s, %s, \"%s\", %g);", - a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, k[6]==2?a[6].s:"",k[7]==3?a[7].v:NAN); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) - mglprintf(out,1024,L"gr->TriContV(%s, %s, %s, %s, %s, \"%s\", %g);", - a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, k[5]==2?a[5].s:"",k[6]==3?a[6].v:NAN); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->TriCont(%s, %s, %s, %s, \"%s\", 7, %g);", - a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?a[5].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_ternary(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->Ternary(int(a[0].v)); - else return 1; - return 0; -} -void mglc_ternary(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3) mglprintf(out,1024,L"gr->Ternary(%d);", int(a[0].v)); -} -//----------------------------------------------------------------------------- -int mgls_transpose(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1) a[0].d->Transpose(k[1]==2?a[1].s:"yxz"); - else return 1; - return 0; -} -void mglc_transpose(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) mglprintf(out,1024,L"%s.Transpose(\"%s\");", a[0].s, k[1]==2?a[1].s:"yxz"); -} -//----------------------------------------------------------------------------- -int mgls_vectc(mglGraph *gr, long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=1) break; - if(i==2) - gr->VectC(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0,k[3]==3?a[3].v:NAN); - else if(i==4) - gr->VectC(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0,k[5]==3?a[5].v:NAN); - else if(i==3) - gr->VectC(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0); - else if(i==6) - gr->VectC(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),k[6]==2?a[6].s:0); - else return 1; - return 0; -} -void mglc_vectc(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=1) break; - if(i==2) - mglprintf(out,1024,L"gr->VectC(%s, %s, \"%s\", %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); - else if(i==4) - mglprintf(out,1024,L"gr->VectC(%s, %s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?a[5].v:NAN); - else if(i==3) - mglprintf(out,1024,L"gr->VectC(%s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:0); - else if(i==6) - mglprintf(out,1024,L"gr->VectC(%s, %s, %s, %s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, k[6]==2?a[6].s:""); -} -//----------------------------------------------------------------------------- -int mgls_vect(mglGraph *gr, long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=1) break; - if(i==2) - gr->Vect(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0, k[3]==3?a[3].v:NAN, k[4]==3?iint(a[4].v):0); - else if(i==4) - gr->Vect(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0, k[5]==3?a[5].v:NAN, k[6]==3?iint(a[6].v):0); - else if(i==3) - gr->Vect(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0, k[4]==3?iint(a[4].v):0); - else if(i==6) - gr->Vect(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),k[6]==2?a[6].s:0, k[7]==3?iint(a[7].v):0); - else return 1; - return 0; -} -void mglc_vect(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=1) break; - if(i==2) - mglprintf(out,1024,L"gr->Vect(%s, %s, \"%s\", %g, %d);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN,k[4]==3?iint(a[4].v):0); - else if(i==4) - mglprintf(out,1024,L"gr->Vect(%s, %s, %s, %s, \"%s\", %g, %d);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?a[5].v:NAN,k[6]==3?iint(a[6].v):0); - else if(i==3) - mglprintf(out,1024,L"gr->Vect(%s, %s, %s, \"%s\", %d);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:0,k[4]==3?iint(a[4].v):0); - else if(i==6) - mglprintf(out,1024,L"gr->Vect(%s, %s, %s, %s, %s, %s, \"%s\", %d);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, k[6]==2?a[6].s:"",k[7]==3?iint(a[7].v):0); -} -//----------------------------------------------------------------------------- -int mgls_vectl(mglGraph *gr, long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=1) break; - if(i==2) - gr->VectL(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0,k[3]==3?a[3].v:NAN); - else if(i==4) - gr->VectL(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0,k[5]==3?a[5].v:NAN); - else if(i==3) - gr->VectL(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0); - else if(i==6) - gr->VectL(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),k[6]==2?a[6].s:0); - else return 1; - return 0; -} -void mglc_vectl(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=1) break; - if(i==2) - mglprintf(out,1024,L"gr->VectL(%s, %s, \"%s\", %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); - else if(i==4) - mglprintf(out,1024,L"gr->VectL(%s, %s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?a[5].v:NAN); - else if(i==3) - mglprintf(out,1024,L"gr->VectL(%s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:0); - else if(i==6) - mglprintf(out,1024,L"gr->VectL(%s, %s, %s, %s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, k[6]==2?a[6].s:""); -} -//----------------------------------------------------------------------------- -int mgls_traj(mglGraph *gr, long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=1) break; - if(i==4) - gr->Traj(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0, k[5]==3?a[5].v:NAN, k[6]==3?a[6].v:0); - else if(i==6) - gr->Traj(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),k[6]==2?a[6].s:0, k[7]==3?a[7].v:0); - else return 1; - return 0; -} -void mglc_traj(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=1) break; - if(i==4) - mglprintf(out,1024,L"gr->Traj(%s, %s, %s, %s, \"%s\", %g, %g);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?a[5].v:NAN,k[6]==3?a[6].v:0); - else if(i==6) - mglprintf(out,1024,L"gr->Traj(%s, %s, %s, %s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, k[6]==2?a[6].s:"",k[7]==3?a[7].v:0); -} -//----------------------------------------------------------------------------- -int mgls_xlabel(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2) gr->Labelw('x', a[0].w, k[1]==3?a[1].v:0, k[2]==3?a[2].v:-1.4, k[3]==3?a[3].v:0); - else return 1; - return 0; -} -void mglc_xlabel(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==2) mglprintf(out,1024,L"gr->Label('x', L\"%ls\", %g, %g, %g);", a[0].w, k[1]==3?a[1].v:1, k[2]==3?a[2].v:-1.4, k[3]==3?a[3].v:0); -} -//----------------------------------------------------------------------------- -int mgls_ylabel(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2) gr->Labelw('y', a[0].w, k[1]==3?a[1].v:0, k[2]==3?a[2].v:-1.4, k[3]==3?a[3].v:0); - else return 1; - return 0; -} -void mglc_ylabel(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==2) mglprintf(out,1024,L"gr->Label('y', L\"%ls\", %g, %g, %g);", a[0].w, k[1]==3?a[1].v:1, k[2]==3?a[2].v:-1.4, k[3]==3?a[3].v:0); -} -//----------------------------------------------------------------------------- -int mgls_zlabel(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2) gr->Labelw('z', a[0].w, k[1]==3?a[1].v:0, k[2]==3?a[2].v:-1.4, k[3]==3?a[3].v:0); - else return 1; - return 0; -} -void mglc_zlabel(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==2) mglprintf(out,1024,L"gr->Label('z', L\"%ls\", %g, %g, %g);", a[0].w, k[1]==3?a[1].v:1, k[2]==3?a[2].v:-1.4, k[3]==3?a[3].v:0); -} -//----------------------------------------------------------------------------- -int mgls_tlabel(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2) gr->Labelw('t', a[0].w, k[1]==3?a[1].v:0, k[2]==3?a[2].v:-1.4, k[3]==3?a[3].v:0); - else return 1; - return 0; -} -void mglc_tlabel(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==2) mglprintf(out,1024,L"gr->Label('t', L\"%ls\", %g, %g, %g);", a[0].w, k[1]==3?a[1].v:1, k[2]==3?a[2].v:-1.4, k[3]==3?a[3].v:0); -} -//----------------------------------------------------------------------------- -int mgls_label(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==2) - gr->Labelw(a[0].v, a[1].v, a[2].w, k[3]==2?a[3].s:0, k[4]==3?a[2].v:-1.4); - else return 1; - return 0; -} -void mglc_label(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==2) - mglprintf(out,1024,L"gr->Label(%g, %g, \"%s\", \"%s\", %g);", a[0].v, a[1].v, a[2].w, k[3]==2?a[3].s:0, k[4]==3?a[2].v:-1.4); -} -//----------------------------------------------------------------------------- -int mgls_xrange(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->XRange(*(a[0].d),k[1]==3?(a[1].v!=0):false,k[2]==3?a[2].v:0); - else if(k[0]==3 && k[1]==3) - { gr->Min.x = a[0].v; gr->Max.x = a[1].v; gr->RecalcBorder(); } - else return 1; - return 0; -} -void mglc_xrange(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) - mglprintf(out,1024,L"gr->XRange(%s, %s, %g);", a[0].s, (k[1]==3&&a[1].v!=0)?"true":"false", k[2]==3?a[2].v:0); - else if(k[0]==3 && k[1]==3) - mglprintf(out,1024,L"gr->Axis(mglPoint(%g), mglPoint(%g));", a[0].v, a[1].v); -} -//----------------------------------------------------------------------------- -int mgls_yrange(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->YRange(*(a[0].d),k[1]==3?(a[1].v!=0):false,k[2]==3?a[2].v:0); - else if(k[0]==3 && k[1]==3) - { gr->Min.y = a[0].v; gr->Max.y = a[1].v; gr->RecalcBorder(); } - else return 1; - return 0; -} -void mglc_yrange(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) - mglprintf(out,1024,L"gr->YRange(%s, %s, %g);", a[0].s, (k[1]==3&&a[1].v!=0)?"true":"false", k[2]==3?a[2].v:0); - else if(k[0]==3 && k[1]==3) - mglprintf(out,1024,L"gr->Axis(mglPoint(0,%g), mglPoint(0,%g));", a[0].v, a[1].v); -} -//----------------------------------------------------------------------------- -int mgls_zrange(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) gr->ZRange(*(a[0].d),k[1]==3?(a[1].v!=0):false,k[2]==3?a[2].v:0); - else if(k[0]==3 && k[1]==3) - { gr->Min.z = a[0].v; gr->Max.z = a[1].v; gr->RecalcBorder(); } - else return 1; - return 0; -} -void mglc_zrange(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) - mglprintf(out,1024,L"gr->ZRange(%s, %s, %g);", a[0].s, (k[1]==3&&a[1].v!=0)?"true":"false", k[2]==3?a[2].v:0); - else if(k[0]==3 && k[1]==3) - mglprintf(out,1024,L"gr->Axis(mglPoint(0,0,%g), mglPoint(0,0,%g));", a[0].v, a[1].v); -} -//----------------------------------------------------------------------------- -int mgls_xtick(mglGraph *gr, long n, mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==2) - { - mreal v[50]; const wchar_t *s[50]; int i; - for(i=0;i<50 && iSetTicksVal('x',i,v,s); - } - else if(k[0]==3) - gr->SetTicks('x', a[0].v, k[1]==3?iint(a[1].v):0, k[2]==3?a[2].v:NAN); - else if(k[0]==2) gr->SetXTT(a[0].w); - else return 1; - return 0; -} -void mglc_xtick(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3) - mglprintf(out,1024,L"gr->SetTicks('x', %g, %d, %g);", a[0].v, iint(a[1].v),a[2].v); - else if(k[0]==3 && k[1]==3) - mglprintf(out,1024,L"gr->SetTicks('x', %g, %d);", a[0].v, iint(a[1].v)); - else if(k[0]==3 && k[1]==2) - mglprintf(out,1024,L"gr->SetTicksVal('x', %g, \"%s\");", a[0].v, a[1].s); - else if(k[0]==3) mglprintf(out,1024,L"gr->SetTicks('x', %g);", a[0].v); - else if(k[0]==2) - mglprintf(out,1024,L"gr->SetXTT(L\"%ls\");", a[0].w); -} -//----------------------------------------------------------------------------- -int mgls_ytick(mglGraph *gr, long n, mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==2) - { - mreal v[50]; const wchar_t *s[50]; int i; - for(i=0;i<50 && iSetTicksVal('y',i,v,s); - } - else if(k[0]==3) - gr->SetTicks('y', a[0].v, k[1]==3?iint(a[1].v):0, k[2]==3?a[2].v:NAN); - else if(k[0]==2) gr->SetYTT(a[0].w); - else return 1; - return 0; -} -void mglc_ytick(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3) - mglprintf(out,1024,L"gr->SetTicks('y', %g, %d, %g);", a[0].v, iint(a[1].v),a[2].v); - else if(k[0]==3 && k[1]==3) - mglprintf(out,1024,L"gr->SetTicks('y', %g, %d);", a[0].v, iint(a[1].v)); - else if(k[0]==3 && k[1]==2) - mglprintf(out,1024,L"gr->SetTicksVal('y', %g, \"%s\");", a[0].v, a[1].s); - else if(k[0]==3) mglprintf(out,1024,L"gr->SetTicks('y', %g);", a[0].v); - else if(k[0]==2) mglprintf(out,1024,L"gr->SetYTT(L\"%ls\");", a[0].w); -} -//----------------------------------------------------------------------------- -int mgls_ztick(mglGraph *gr, long n, mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==2) - { - mreal v[50]; const wchar_t *s[50]; int i; - for(i=0;i<50 && iSetTicksVal('z',i,v,s); - } - else if(k[0]==3) - gr->SetTicks('z', a[0].v, k[1]==3?iint(a[1].v):0, k[2]==3?a[2].v:NAN); - else if(k[0]==2) gr->SetZTT(a[0].w); - else return 1; - return 0; -} -void mglc_ztick(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3) - mglprintf(out,1024,L"gr->SetTicks('z', %g, %d, %g);", a[0].v, iint(a[1].v),a[2].v); - else if(k[0]==3 && k[1]==3) - mglprintf(out,1024,L"gr->SetTicks('z', %g, %d);", a[0].v, iint(a[1].v)); - else if(k[0]==3 && k[1]==2) - mglprintf(out,1024,L"gr->SetTicksVal('z', %g, \"%s\");", a[0].v, a[1].s); - else if(k[0]==3) mglprintf(out,1024,L"gr->SetTicks('z', %g);", a[0].v); - else if(k[0]==2) mglprintf(out,1024,L"gr->SetZTT(L\"%ls\");", a[0].s); -} -//----------------------------------------------------------------------------- -int mgls_zoom(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) - gr->Zoom(a[0].v, a[1].v, a[2].v, a[3].v); - else return 1; - return 0; -} -void mglc_zoom(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) - mglprintf(out,1024,L"gr->Zoom(%g, %g, %g, %g);", a[0].v, a[1].v, a[2].v, a[3].v); -} -//----------------------------------------------------------------------------- -int mgls_error(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - gr->Error(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d), - k[4]==2?a[4].s:0, k[5]==3?a[5].v:NAN); - else if(k[0]==1 && k[1]==1 && k[2]==1) - gr->Error(*(a[0].d),*(a[1].d),*(a[2].d), k[3]==2?a[3].s:0, k[4]==3?a[4].v:NAN); - else if(k[0]==1 && k[1]==1) - gr->Error(*(a[0].d),*(a[1].d), k[2]==2?a[2].s:0, k[3]==3?a[3].v:NAN); - else return 1; - return 0; -} -void mglc_error(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->Error(%s, %s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?a[5].v:NAN); - else if(k[0]==1 && k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->Error(%s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?a[4].v:NAN); - else if(k[0]==1 && k[1]==1) - mglprintf(out,1024,L"gr->Error(%s, %s, \"%s\", %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_extend(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3) a[0].d->Extend(iint(a[1].v),k[2]==3?iint(a[2].v):0); - else return 1; - return 0; -} -void mglc_extend(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3) - mglprintf(out,1024,L"%s.Extend(%d, %d);", a[0].s, iint(a[1].v), k[2]==3?iint(a[2].v):0); -} -//----------------------------------------------------------------------------- -int mgls_info(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1) a[0].d->PrintInfo(gr->Message, k[1]==3 && a[1].v!=0); - else if(k[0]==2) sprintf(gr->Message, "%ls",a[0].w); - else return 1; - return 0; -} -void mglc_info(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) mglprintf(out,1024,L"%s.PrintInfo(gr->Message, %s);", a[0].s, k[1]==3 && a[1].v!=0 ? "true" : "false"); - if(k[0]==2) mglprintf(out,1024,L"sprintf(gr->Message, L\"%ls\");",a[0].w); -} -//----------------------------------------------------------------------------- -int mgls_integrate(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) a[0].d->Integral(a[1].s); - else return 1; - return 0; -} -void mglc_integrate(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Integral(\"%s\");", a[0].s, a[1].s); -} -//----------------------------------------------------------------------------- -int mgls_inplot(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) - gr->InPlot(a[0].v, a[1].v, a[2].v, a[3].v, k[4]==3&&a[4].v!=0); - else return 1; - return 0; -} -void mglc_inplot(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) - mglprintf(out,1024,L"gr->InPlot(%g, %g, %g, %g, %s);", a[0].v, a[1].v, a[2].v, a[3].v, k[4]==3&&a[4].v!=0 ? "true":"false"); -} -//----------------------------------------------------------------------------- -int mgls_columnplot(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3) gr->ColumnPlot(iint(a[0].v), iint(a[1].v), k[2]==3?a[2].v:0); - else return 1; - return 0; -} -void mglc_columnplot(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3) - mglprintf(out,1024,L"gr->ColumnPlot(%d, %d, %g);", iint(a[0].v), iint(a[1].v), k[2]==3?a[2].v:0); -} -//----------------------------------------------------------------------------- -int mgls_stickplot(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) - gr->StickPlot(iint(a[0].v), iint(a[1].v), a[2].v, a[3].v); - else return 1; - return 0; -} -void mglc_stickplot(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) - mglprintf(out,1024,L"gr->StickPlot(%d, %d, %g, %g);", - iint(a[0].v), iint(a[1].v), a[2].v, a[3].v); -} -//----------------------------------------------------------------------------- -int mgls_pipe(mglGraph *gr, long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=1) break; - if(i==2) - gr->Pipe(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0,k[3]==3?a[3].v:0.05,k[4]==3?iint(a[4].v):5, - true,k[5]==3?a[5].v:NAN); - else if(i==4) - gr->Pipe(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s:0,k[5]==3?a[5].v:0.05, - k[6]==3?iint(a[6].v):5,true,k[7]==3?a[7].v:NAN); - else if(i==3) - gr->Pipe(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0,k[4]==3?a[4].v:0.05,k[5]==3?iint(a[5].v):3); - else if(i==6) - gr->Pipe(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d), - k[6]==2?a[6].s:0,k[7]==3?a[7].v:0.05,k[8]==3?iint(a[8].v):3); - else return 1; - return 0; -} -void mglc_pipe(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - int i; - for(i=0;i<7;i++) if(k[i]!=1) break; - if(i==2) - mglprintf(out,1024,L"gr->Pipe(%s, %s, \"%s\", %g, %d, true, %g);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:0.05, k[4]==3?iint(a[4].v):5, k[5]==3?a[5].v:NAN); - else if(i==4) - mglprintf(out,1024,L"gr->Pipe(%s, %s, %s, %s, \"%s\", %g, %d, true, %g);", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:"", k[5]==3?a[5].v:0.05, k[6]==3?iint(a[6].v):5, k[7]==3?a[7].v:NAN); - else if(i==3) - mglprintf(out,1024,L"gr->Pipe(%s, %s, %s, \"%s\", %g, %d);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?a[4].v:0.05, k[5]==3?iint(a[5].v):3); - else if(i==6) - mglprintf(out,1024,L"gr->Pipe(%s, %s, %s, %s, %s, %s, \"%s\", %g, %d);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, k[6]==2?a[6].s:"", k[7]==3?a[7].v:0.05, k[8]==3?iint(a[8].v):3); -} -//----------------------------------------------------------------------------- -int mgls_origin(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3) gr->Org = mglPoint(a[0].v,a[1].v,k[2]==3?a[2].v:NAN); - else return 1; - return 0; -} -void mglc_origin(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3) - mglprintf(out,1024,L"gr->Org = mglPoint(%g, %g, %g);", a[0].v, a[1].v, k[2]==3?a[2].v:0); -} -//----------------------------------------------------------------------------- -int mgls_plotfactor(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) - { - if(a[0].v>0) { gr->PlotFactor=a[0].v; gr->AutoPlotFactor=false; } - else { gr->PlotFactor=1.55f; gr->AutoPlotFactor=false; } - } - else return 1; - return 0; -} -void mglc_plotfactor(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3) mglprintf(out,1024,L"if(%g>0) gr->PlotFactor = %g;\tgr->AutoPlotFactor = !(%g>0);", a[0].v, a[0].v, a[0].v); -} -//----------------------------------------------------------------------------- -int mgls_norm(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3 && k[2]==3) - a[0].d->Norm(a[1].v,a[2].v,k[3]==3?a[3].v!=0:false,k[4]==3?iint(a[4].v):0); - else return 1; - return 0; -} -void mglc_norm(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3 && k[2]==3) - mglprintf(out,1024,L"%s.Norm(%g, %g, %s, %d);", a[0].s, a[1].v, a[2].v, (k[3]==3&&a[3].v!=0)?"true":"false", k[4]==3?iint(a[4].v):0); -} -//----------------------------------------------------------------------------- -int mgls_hist(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==3 && k[4]==3 && k[5]==3) - *(a[0].d) = a[1].d->Hist(*(a[2].d), iint(a[3].v), a[4].v, a[5].v, k[6]==3?iint(a[6].v):0); - else if(k[0]==1 && k[1]==1 && k[2]==3 && k[3]==3 && k[4]==3) - *(a[0].d) = a[1].d->Hist(iint(a[2].v), a[3].v, a[4].v, k[5]==3?iint(a[5].v):0); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) - gr->Hist(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d)); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - gr->Hist(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d)); - else if(k[0]==1 && k[1]==1 && k[2]==1) - gr->Hist(*(a[0].d), *(a[1].d), *(a[2].d)); - else return 1; - return 0; -} -void mglc_hist(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==3 && k[4]==3 && k[5]==3) - mglprintf(out,1024,L"%s = %s.Hist(%s, %d, %g, %g, %d);", a[0].s, a[1].s, a[2].s, iint(a[3].v), a[4].v, a[5].v, k[6]==3?iint(a[6].v):0); - else if(k[0]==1 && k[1]==1 && k[2]==3 && k[3]==3 && k[4]==3) - mglprintf(out,1024,L"%s = %s.Hist(%d, %g, %g, %d);", a[0].s, a[1].s, iint(a[2].v), a[3].v, a[4].v, k[5]==3?iint(a[5].v):0); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) - mglprintf(out,1024,L"gr->Hist(%s, %s, %s, %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"gr->Hist(%s, %s, %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s); - else if(k[0]==1 && k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->Hist(%s, %s, %s);", a[0].s, a[1].s, a[2].s); -} -//----------------------------------------------------------------------------- -int mgls_mirror(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) a[0].d->Mirror(a[1].s); - else return 1; - return 0; -} -void mglc_mirror(wchar_t out[1024], long , mglArg *a, int k[10]) -{ if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Mirror(\"%s\");", a[0].s, a[1].s); } -//----------------------------------------------------------------------------- -int mgls_hankel(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) a[0].d->Hankel(a[1].s); else return 1; - return 0; -} -void mglc_hankel(wchar_t out[1024], long , mglArg *a, int k[10]) -{ if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Hankel('%s');", a[0].s, a[1].s); } -//----------------------------------------------------------------------------- -int mgls_sinfft(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) a[0].d->SinFFT(a[1].s); else return 1; - return 0; -} -void mglc_sinfft(wchar_t out[1024], long , mglArg *a, int k[10]) -{ if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.SinFFT('%s');", a[0].s, a[1].s); } -//----------------------------------------------------------------------------- -int mgls_cosfft(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) a[0].d->CosFFT(a[1].s); else return 1; - return 0; -} -void mglc_cosfft(wchar_t out[1024], long , mglArg *a, int k[10]) -{ if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.CosFFT('%s');", a[0].s, a[1].s); } -//----------------------------------------------------------------------------- -int mgls_new(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1) a[0].d->Create(k[1]==3?iint(a[1].v):1, k[2]==3?iint(a[2].v):1, k[3]==3?iint(a[3].v):1); - else return 1; - return 0; -} -void mglc_new(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) - mglprintf(out,1024,L"%s.Create(%d, %d, %d);", a[0].s, k[1]==3?iint(a[1].v):1, k[2]==3?iint(a[2].v):1, k[3]==3?iint(a[3].v):1); -} -//----------------------------------------------------------------------------- -int mgls_var(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3 && k[2]==3) - { a[0].d->Create(iint(a[1].v)); a[0].d->Fill(a[2].v, k[3]==3?a[3].v:NAN); } - else return 1; - return 0; -} -void mglc_var(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3 && k[2]==3) - mglprintf(out,1024,L"%s.Create(%d);\t%s.Fill(%g,%g);",a[0].s, iint(a[1].v), a[0].s, a[2].v, k[3]==3?a[3].v:NAN); -} -//----------------------------------------------------------------------------- -int mgls_chdir(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2) - { int r=chdir(a[0].s); if(r) gr->SetWarn(mglWarnFile, "chdir"); } - else return 1; - return 0; -} -void mglc_chdir(wchar_t out[1024], long , mglArg *a, int k[10]) -{ if(k[0]==2) mglprintf(out,1024,L"chdir(\"%s\");", a[0].s); } -//----------------------------------------------------------------------------- -int mgls_perspective(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->Perspective(a[0].v); - else return 1; - return 0; -} -void mglc_perspective(wchar_t out[1024], long , mglArg *a, int k[10]) -{ if(k[0]==3) mglprintf(out,1024,L"gr->Perspective(%g);", a[0].v); } -//----------------------------------------------------------------------------- -int mgls_facex(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3) - gr->FaceX(a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, k[5]==2?a[5].s:0, k[6]==3?a[6].v:0, k[7]==3?a[7].v:0); - else return 1; - return 0; -} -void mglc_facex(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3) - mglprintf(out,1024,L"gr->FaceX(%g, %g, %g, %g, %g, \"%s\", %g, %g);", a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, k[5]==2?a[5].s:"", k[6]==3?a[6].v:0, k[7]==3?a[7].v:0); -} -//----------------------------------------------------------------------------- -int mgls_facey(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3) - gr->FaceY(a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, k[5]==2?a[5].s:0, k[6]==3?a[6].v:0, k[7]==3?a[7].v:0); - else return 1; - return 0; -} -void mglc_facey(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3) - mglprintf(out,1024,L"gr->FaceY(%g, %g, %g, %g, %g, \"%s\", %g, %g);", a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, k[5]==2?a[5].s:"", k[6]==3?a[6].v:0, k[7]==3?a[7].v:0); -} -//----------------------------------------------------------------------------- -int mgls_facez(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3) - gr->FaceZ(a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, k[5]==2?a[5].s:0, k[6]==3?a[6].v:0, k[7]==3?a[7].v:0); - else return 1; - return 0; -} -void mglc_facez(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3) - mglprintf(out,1024,L"gr->FaceZ(%g, %g, %g, %g, %g, \"%s\", %g, %g);", a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, k[5]==2?a[5].s:"", k[6]==3?a[6].v:0, k[7]==3?a[7].v:0); -} -//----------------------------------------------------------------------------- -int mgls_normsl(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3 && k[2]==3) - a[0].d->NormSl(a[1].v, a[2].v, k[3]==2?a[3].s[0]:'z', k[4]==3?a[4].v!=0:true, k[5]==3?a[5].v!=0:false); - else return 1; - return 0; -} -void mglc_normsl(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3 && k[2]==3) - mglprintf(out,1024,L"%s.NormSl(%g, %g, '%c', %s, %s);", a[0].s, a[1].v, a[2].v, k[3]==2?a[3].s[0]:'z', (k[4]!=3||a[4].v!=0)?"true":"false", (k[5]==3&&a[5].v!=0)?"true":"false"); -} -//----------------------------------------------------------------------------- -int mgls_momentum(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==2) - *(a[0].d) = a[1].d->Momentum(k[3]==2?a[3].s[0]:'z', a[2].s); - else return 1; - return 0; -} -void mglc_momentum(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==2) - mglprintf(out,1024,L"%s = %s.Momentum('%c', \"%s\");", a[0].s, a[1].s, k[3]==2?a[3].s[0]:'z', a[2].s); -} -//----------------------------------------------------------------------------- -int mgls_fit(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1&& k[5]==2 && k[6]==2) - gr->Fit(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s, a[6].s, (k[7]==1 && a[7].d->nx>=long(strlen(a[6].s)))?a[7].d->a:0, k[8]==3?a[8].v!=0:false); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2 && k[5]==2) - gr->Fit(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s, a[5].s, (k[6]==1 && a[6].d->nx>=long(strlen(a[5].s)))?a[6].d->a:0, k[7]==3?a[7].v!=0:false); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2 && k[4]==2) - gr->Fit(*(a[0].d), *(a[1].d), *(a[2].d), a[3].s, a[4].s, (k[5]==1 && a[5].d->nx>=long(strlen(a[4].s)))?a[5].d->a:0, k[6]==3?a[6].v!=0:false); - else if(k[0]==1 && k[1]==1 && k[2]==2 && k[3]==2) - gr->Fit(*(a[0].d), *(a[1].d), a[2].s, a[3].s, (k[4]==1 && a[4].d->nx>=long(strlen(a[3].s)))?a[4].d->a:0, k[5]==3?a[5].v!=0:false); - else return 1; - return 0; -} -void mglc_fit(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1&& k[5]==2 && k[6]==2) - mglprintf(out,1024,L"gr->Fit(%s, %s, %s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, a[6].s, (k[7]==1 && a[7].d->nx>=long(strlen(a[6].s)))?a[7].s:"NULL", (k[8]==3&&a[8].v!=0)?"true":"false"); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2 && k[5]==2) - mglprintf(out,1024,L"gr->Fit(%s, %s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, (k[6]==1 && a[6].d->nx>=long(strlen(a[5].s)))?a[6].s:"NULL", (k[7]==3&&a[7].v!=0)?"true":"false"); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2 && k[4]==2) - mglprintf(out,1024,L"gr->Fit(%s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, (k[5]==1 && a[5].d->nx>=long(strlen(a[4].s)))?a[5].s:"NULL", (k[6]==3&&a[6].v!=0)?"true":"false"); - else if(k[0]==1 && k[1]==1 && k[2]==2 && k[3]==2) - mglprintf(out,1024,L"gr->Fit(%s, %s, \"%s\", \"%s\", %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s, (k[5]==1 && a[5].d->nx>=long(strlen(a[4].s)))?a[5].s:"NULL", (k[6]==3&&a[6].v!=0)?"true":"false"); -} -//----------------------------------------------------------------------------- -int mgls_fits(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1 && k[6]==2 && k[7]==2) - gr->FitS(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), *(a[5].d), a[6].s, a[7].s, (k[8]==1 && a[8].d->nx>=long(strlen(a[7].s)))?a[8].d->a:0, k[9]==3?a[9].v!=0:false); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2 && k[6]==2) - gr->FitS(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s, a[6].s, (k[7]==1 && a[7].d->nx>=long(strlen(a[6].s)))?a[7].d->a:0, k[8]==3?a[8].v!=0:false); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2 && k[5]==2) - gr->FitS(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s, a[5].s, (k[6]==1 && a[6].d->nx>=long(strlen(a[5].s)))?a[6].d->a:0, k[7]==3?a[7].v!=0:false); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2 && k[4]==2) - gr->FitS(*(a[0].d), *(a[1].d), *(a[2].d), a[3].s, a[4].s, (k[5]==1 && a[5].d->nx>=long(strlen(a[4].s)))?a[5].d->a:0, k[6]==3?a[6].v!=0:false); - else return 1; - return 0; -} -void mglc_fits(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1 && k[6]==2 && k[7]==2) - mglprintf(out,1024,L"gr->FitS(%s, %s, %s, %s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, a[6].s, a[7].s, (k[8]==1 && a[8].d->nx>=long(strlen(a[7].s)))?a[8].s:"NULL", (k[9]==3&&a[9].v!=0)?"true":"false"); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2 && k[6]==2) - mglprintf(out,1024,L"gr->FitS(%s, %s, %s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, a[6].s, (k[7]==1 && a[7].d->nx>=long(strlen(a[6].s)))?a[7].s:"NULL", (k[8]==3&&a[8].v!=0)?"true":"false"); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2 && k[5]==2) - mglprintf(out,1024,L"gr->FitS(%s, %s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, (k[6]==1 && a[6].d->nx>=long(strlen(a[5].s)))?a[6].s:"NULL", (k[7]==3&&a[7].v!=0)?"true":"false"); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2 && k[4]==2) - mglprintf(out,1024,L"gr->FitS(%s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, (k[5]==1 && a[5].d->nx>=long(strlen(a[4].s)))?a[5].s:"NULL", (k[6]==3&&a[6].v!=0)?"true":"false"); -} -//----------------------------------------------------------------------------- -int mgls_putsfit(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3) - gr->PutsFit(mglPoint(a[0].v,a[1].v,a[2].v), k[3]==2?a[3].s:0, k[4]==2?a[4].s:0, k[5]==3?a[5].v:-1); - else if(k[0]==3 && k[1]==3) - gr->PutsFit(mglPoint(a[0].v,a[1].v), k[2]==2?a[2].s:0, k[3]==2?a[3].s:0, k[4]==3?a[4].v:-1); - else return 1; - return 0; -} -void mglc_putsfit(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3 && k[1]==3 && k[2]==3) - mglprintf(out,1024,L"gr->PutsFit(mglPoint(%g, %g, %g), \"%s\", \"%s\", %g);", a[0].v,a[1].v,a[2].v, k[3]==2?a[3].s:"", k[4]==2?a[4].s:"", k[5]==3?a[5].v:-1); - else if(k[0]==3 && k[1]==3) - mglprintf(out,1024,L"gr->PutsFit(mglPoint(%g, %g), \"%s\", \"%s\", %g);", a[0].v,a[1].v, k[2]==2?a[2].s:"", k[3]==2?a[3].s:"", k[4]==3?a[4].v:-1); - - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1 && k[6]==2 && k[7]==2) - mglprintf(out,1024,L"gr->FitS(%s, %s, %s, %s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, a[6].s, a[7].s, (k[8]==1 && a[8].d->nx>=long(strlen(a[7].s)))?a[8].s:"NULL", (k[9]==3&&a[9].v!=0)?"true":"false"); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2 && k[6]==2) - mglprintf(out,1024,L"gr->FitS(%s, %s, %s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, a[6].s, (k[7]==1 && a[7].d->nx>=long(strlen(a[6].s)))?a[7].s:"NULL", (k[8]==3&&a[8].v!=0)?"true":"false"); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2 && k[5]==2) - mglprintf(out,1024,L"gr->FitS(%s, %s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, a[5].s, (k[6]==1 && a[6].d->nx>=long(strlen(a[5].s)))?a[6].s:"NULL", (k[7]==3&&a[7].v!=0)?"true":"false"); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2 && k[4]==2) - mglprintf(out,1024,L"gr->FitS(%s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, (k[5]==1 && a[5].d->nx>=long(strlen(a[4].s)))?a[5].s:"NULL", (k[6]==3&&a[6].v!=0)?"true":"false"); -} -//----------------------------------------------------------------------------- -int mgls_arrowsize(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->ArrowSize = a[0].v/50; - else return 1; - return 0; -} -void mglc_arrowsize(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==3) mglprintf(out,1024,L"gr->ArrowSize = %g;", a[0].v/50); -} -//----------------------------------------------------------------------------- -int mgls_rearrange(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3) - a[0].d->Rearrange(iint(a[1].v), k[2]==3?iint(a[2].v):0, k[3]==3?iint(a[3].v):0); - else return 1; - return 0; -} -void mglc_rearrange(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3) - mglprintf(out,1024,L"%s.Rearrange(%d, %d, %d);",a[0].s, iint(a[1].v), k[2]==3?iint(a[2].v):0, k[3]==3?iint(a[3].v):0); -} -//----------------------------------------------------------------------------- -int mgls_ctick(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2) gr->SetCTT(a[0].w); - else if(k[0]==3) gr->SetTicks('c',a[0].v); - else return 1; - return 0; -} -void mglc_ctick(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==2) mglprintf(out,1024,L"gr->SetCTT(L\"%ls\");", a[0].w); - else if(k[0]==3) mglprintf(out,1024,L"gr->SetTicks('c',%g);", a[0].v); -} -//----------------------------------------------------------------------------- -int mgls_fplot(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2 && k[1]==2 && k[2]==2) gr->Plot(a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:0, k[4]==3?iint(a[4].v):100); - else if(k[0]==2) gr->Plot(a[0].s, k[1]==2?a[1].s:0, k[2]==3?a[2].v:NAN, k[3]==3?iint(a[3].v):100); - else return 1; - return 0; -} -void mglc_fplot(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==2 && k[1]==2 && k[2]==2) - mglprintf(out,1024,L"gr->Plot(\"%s\", \"%s\", \"%s\", \"%s\", %d);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?iint(a[4].v):100); - else if(k[0]==2) - mglprintf(out,1024,L"gr->Plot(\"%s\", \"%s\", %g, %d);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:NAN, k[3]==3?iint(a[3].v):100); -} -//----------------------------------------------------------------------------- -int mgls_fsurf(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2 && k[1]==2 && k[2]==2) gr->Surf(a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:0, k[4]==3?iint(a[4].v):100); - else if(k[0]==2) gr->Surf(a[0].s, k[1]==2?a[1].s:0, k[2]==3?iint(a[2].v):100); - else return 1; - return 0; -} -void mglc_fsurf(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==2 && k[1]==2 && k[2]==2) - mglprintf(out,1024,L"gr->Surf(\"%s\", \"%s\", \"%s\", \"%s\", %d);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?iint(a[4].v):100); - else if(k[0]==2) - mglprintf(out,1024,L"gr->Surf(\"%s\", \"%s\", %d);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?iint(a[2].v):100); -} -//----------------------------------------------------------------------------- -int mgls_fgets(mglGraph *gr, long , mglArg *a, int k[10]) -{ - const long size=1024; - char buf[size]; - FILE *fp; - if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==2) - { - int i, n = (k[4]==3?iint(a[4].v):0); - fp = fopen(a[3].s,"rt"); - if(!fp) - { - if(gr->Message) sprintf(gr->Message,"Wrong file %s",a[3].s); - return 0; - } - for(i=0;iMessage) sprintf(gr->Message,"Couldn't read %d-th string of file %s",n,a[3].s); - fclose(fp); return 0; - } - fclose(fp); - gr->Text(mglPoint(a[0].v,a[1].v,a[2].v),buf, (k[5]==2 && a[5].s[0]!=0)?a[5].s:gr->FontDef, k[6]==3?a[6].v:-1.4); - } - else if(k[0]==3 && k[1]==3 && k[2]==2) - { - int i, n = k[3]==3?iint(a[3].v):0; - fp = fopen(a[2].s,"rt"); - if(!fp) - { - if(gr->Message) sprintf(gr->Message,"Wrong file %s",a[2].s); - return 0; - } - for(i=0;iMessage) sprintf(gr->Message,"Couldn't read %d-th string of file %s",n,a[3].s); - fclose(fp); return 0; - } - fclose(fp); - gr->Text(mglPoint(a[0].v,a[1].v,gr->Min.z),buf, (k[4]==2 && a[4].s[0]!=0)?a[4].s:gr->FontDef, k[5]==3?a[5].v:-1.4); - } - else return 1; - return 0; -} -void mglc_fgets(wchar_t [1024], long , mglArg *, int [10]) {} -//----------------------------------------------------------------------------- -int mgls_import(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==2) - a[0].d->Import(a[1].s, a[2].s, k[3]==3?a[3].v:0, k[4]==3?a[4].v:1); - else return 1; - return 0; -} -void mglc_import(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==2) - mglprintf(out,1024,L"%s->Import(%s, %s, %g, %g);", a[0].s, a[1].s, a[2].s, k[3]==3?a[3].v:0, k[4]==3?a[4].v:1); -} -//----------------------------------------------------------------------------- -int mgls_export(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==2) - a[0].d->Export(a[1].s, a[2].s, k[3]==3?a[3].v:0, k[4]==3?a[4].v:1); - else return 1; - return 0; -} -void mglc_export(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==2) - mglprintf(out,1024,L"%s->Export(%s, %s, %g, %g);", a[0].s, a[1].s, a[2].s, k[3]==3?a[3].v:0, k[4]==3?a[4].v:1); -} -//----------------------------------------------------------------------------- -int mgls_write(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2) gr->WriteFrame(a[0].s, "MathGL"); - else return 1; - return 0; -} -void mglc_write(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==2) - mglprintf(out,1024,L"gr->WriteFrame(\"%s\", \"MathGL\");", a[0].s); -} -//----------------------------------------------------------------------------- -int mgls_region(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1) - gr->Region(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s:0, NAN, k[4]!=3 || a[4].v!=0); - else if(k[0]==1 && k[1]==1) - gr->Region(*(a[0].d),*(a[1].d),k[2]==2?a[2].s:0, NAN, k[3]!=3 || a[3].v!=0); - else return 1; - return 0; -} -void mglc_region(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1) - mglprintf(out,1024,L"gr->Region(%s, %s, %s, \"%s\", NAN, %s);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]!=3 || a[4].v!=0 ? "true" : "false"); - else if(k[0]==1 && k[1]==1) - mglprintf(out,1024,L"gr->Region(%s, %s, \"%s\", NAN, %s);", a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]!=3 || a[3].v!=0 ? "true" : "false"); -} -//----------------------------------------------------------------------------- -int mgls_title(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2) gr->Title(a[0].s, k[1]==2?a[1].s:0, k[2]==3?a[2].v:-2); - else return 1; - return 0; -} -void mglc_title(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==2) mglprintf(out,1024,L"gr->Title(\"%s\", \"%s\", %g);", a[0].s, k[1]==2?a[1].s:"", k[2]==3?a[2].v:-2); -} -//----------------------------------------------------------------------------- -int mgls_envelop(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1) a[0].d->Envelop(k[1]==2 ? a[1].s[0] : 'x'); - else return 1; - return 0; -} -void mglc_envelop(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) mglprintf(out,1024,L"%s.Envelop('%c');",a[0].s, k[1]==2?a[1].s[0]:'x'); -} -//----------------------------------------------------------------------------- -int mgls_sew(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1) a[0].d->Sew(k[1]==2?a[1].s:"xyz", k[2]==3 ? a[2].v : 2*M_PI); - else return 1; - return 0; -} -void mglc_sew(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) mglprintf(out,1024,L"%s.Sew(\"%s\", %g);", a[0].s, k[1]==2?a[1].s:"xyz", k[2]==3 ? a[2].v : 2*M_PI); -} -//----------------------------------------------------------------------------- -int mgls_evaluate(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) - *(a[0].d) = a[1].d->Evaluate(*(a[2].d), *(a[3].d), *(a[4].d), k[5]!=3 || a[5].v!=0); - else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - *(a[0].d) = a[1].d->Evaluate(*(a[2].d), *(a[3].d), k[4]!=3 || a[4].v!=0); - else if(k[0]==1 && k[1]==1 && k[2]==1) - *(a[0].d) = a[1].d->Evaluate(*(a[2].d), k[3]!=3 || a[3].v!=0); - else return 1; - return 0; -} -void mglc_evaluate(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1) mglprintf(out,1024,L"%s.Sew(\"%s\", %g);", a[0].s, k[1]==2?a[1].s:"xyz", k[2]==3 ? a[2].v : 2*M_PI); -} -//----------------------------------------------------------------------------- -int mgls_put(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[1]==3 && k[0]==1) - a[0].d->Put(a[1].v, k[2]==3?iint(a[2].v):-1, k[3]==3?iint(a[3].v):-1, k[4]==3?iint(a[4].v):-1); - else if(k[0]==1 && k[1]==1) - a[0].d->Put(*(a[1].d), k[2]==3?iint(a[2].v):-1, k[3]==3?iint(a[3].v):-1, k[4]==3?iint(a[4].v):-1); - else return 1; - return 0; -} -void mglc_put(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==3) - mglprintf(out,1024,L"%s.Put(%g, %d, %d, %d);", a[0].s, a[1].v, k[2]==3?iint(a[2].v):-1, k[3]==3?iint(a[3].v):-1, k[4]==3?iint(a[4].v):-1); - else if(k[0]==1 && k[1]==1) - mglprintf(out,1024,L"%s.Put(%s, %d, %d, %d);", a[0].s, a[1].s, k[2]==3?iint(a[2].v):-1, k[3]==3?iint(a[3].v):-1, k[4]==3?iint(a[4].v):-1); -} -//----------------------------------------------------------------------------- -int mgls_palette(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2) gr->SetPalette(a[0].s); - else return 1; - return 0; -} -void mglc_palette(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==2) mglprintf(out,1024,L"gr->SetPalette(\"%s\");", a[0].s); -} -//----------------------------------------------------------------------------- -int mgls_combine(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1) - *(a[0].d) = a[1].d->Combine(*(a[2].d)); - else return 1; - return 0; -} -void mglc_combine(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1) - mglprintf(out,1024,L"%s = %s.Combine(%s);",a[0].s, a[1].s, a[2].s); -} -//----------------------------------------------------------------------------- -int mgls_pde(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) - *(a[0].d) = mglPDE(a[1].s, *(a[2].d), *(a[3].d), gr->Min, gr->Max, k[4]==3?a[4].v:0.1, k[5]==3?a[5].v:100); - else return 1; - return 0; -} -void mglc_pde(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"%s = mglPDE(\"%s\", %s, %s, gr->Min, gr->Max, %g, %g);",a[0].s, a[1].s, a[2].s, a[3].s, k[4]==3?a[4].v:0.1, k[5]==3?a[5].v:100); -} -//----------------------------------------------------------------------------- -int mgls_qo2d(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1 && k[4]==1) - *(a[0].d) = mglQO2d(a[1].s, *(a[2].d), *(a[3].d), *(a[4].d), k[5]==3?a[5].v:1, k[6]==3?a[6].v:100, k[7]==1?a[7].d:0, k[8]==1?a[8].d:0); - else return 1; - return 0; -} -void mglc_qo2d(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"%s = mglQO2d(\"%s\", %s, %s, %s, %g, %g, %s, %s);",a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, k[5]==3?a[5].v:1, k[6]==3?a[6].v:100, k[7]==1?a[7].s:"NULL", k[8]==1?a[8].s:"NULL"); -} -//----------------------------------------------------------------------------- -int mgls_af2d(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1 && k[4]==1) - *(a[0].d) = mglAF2d(a[1].s, *(a[2].d), *(a[3].d), *(a[4].d), k[5]==3?a[5].v:1, k[6]==3?a[6].v:100, k[7]==1?a[7].d:0, k[8]==1?a[8].d:0); - else return 1; - return 0; -} -void mglc_af2d(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"%s = mglAF2d(\"%s\", %s, %s, %s, %g, %g, %s, %s);",a[0].s, a[1].s, a[2].s, a[3].s, a[4].s, k[5]==3?a[5].v:1, k[6]==3?a[6].v:100, k[7]==1?a[7].s:"NULL", k[8]==1?a[8].s:"NULL"); -} -//----------------------------------------------------------------------------- -int mgls_ray(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3 && k[6]==3 && k[7]==3) - *(a[0].d) = mglRay(a[1].s, mglPoint(a[2].v, a[3].v, a[4].v), mglPoint(a[5].v, a[6].v, a[7].v), k[8]==3?a[8].v:0.1, k[9]==3?a[9].v:10); - else return 1; - return 0; -} -void mglc_ray(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3 && k[6]==3 && k[7]==3) - mglprintf(out,1024,L"%s = mglRay(\"%s\", mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), %g, %g);",a[0].s, a[1].s, a[2].v, a[3].v, a[4].v, a[5].v, a[6].v, a[7].v, k[8]==3?a[8].v:0.1, k[9]==3?a[9].v:10); -} -//----------------------------------------------------------------------------- -int mgls_jacobian(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - *(a[0].d) = mglJacobian(*(a[1].d), *(a[2].d), *(a[3].d)); - else if(k[0]==1 && k[1]==1 && k[2]==1) - *(a[0].d) = mglJacobian(*(a[1].d), *(a[2].d)); - else return 1; - return 0; -} -void mglc_jacobian(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"%s = mglJacobian(%s, %s, %s);", a[0].s, a[1].s, a[2].s, a[3].s); - else if(k[0]==1 && k[1]==1 && k[2]==1) - mglprintf(out,1024,L"%s = mglJacobian(%s, %s);", a[0].s, a[1].s, a[2].s); -} -//----------------------------------------------------------------------------- -int mgls_tens(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=1) return 1; - else if(k[2]!=1) gr->Tens(*(a[0].d),*(a[1].d), k[2]==2?a[2].s:0, k[3]==3 ? a[3].v : NAN); - else if(k[3]!=1) gr->Tens(*(a[0].d),*(a[1].d),*(a[2].d), k[3]==2?a[3].s:0, k[4]==3 ? a[4].v : NAN); - else gr->Tens(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d), k[4]==2?a[4].s:0); - return 0; -} -void mglc_tens(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]!=1 || k[1]!=1) return; - else if(k[2]!=1) - mglprintf(out,1024,L"gr->Tens(%s, %s, \"%s\", %g);",a[0].s, a[1].s, k[2]==2?a[2].s:"", k[3]==3?a[3].v:NAN); - else if(k[3]!=1) - mglprintf(out,1024,L"gr->Tens(%s, %s, %s, \"%s\", %g);", a[0].s, a[1].s, a[2].s, k[3]==2?a[3].s:"", k[4]==3?a[4].v:NAN); - else mglprintf(out,1024,L"gr->Plot(%s, %s, %s, %s, \"%s\");", a[0].s, a[1].s, a[2].s, a[3].s, k[4]==2?a[4].s:""); -} -//----------------------------------------------------------------------------- -int mgls_ticklen(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==3) gr->SetTickLen(a[0].v, k[1]==3?a[1].v:1); - else return 1; - return 0; -} -void mglc_ticklen(wchar_t out[1024], long , mglArg *a, int k[10]) -{ if(k[0]==3) mglprintf(out,1024,L"gr->SetTickLen(%g,%g);", a[0].v, k[1]==3?a[1].v:1); } -//----------------------------------------------------------------------------- -int mgls_tickstl(mglGraph *gr, long , mglArg *a, int k[10]) -{ - if(k[0]==2) gr->SetTickStl(a[0].s, k[1]==2?a[1].s:""); - else return 1; - return 0; -} -void mglc_tickstl(wchar_t out[1024], long , mglArg *a, int k[10]) -{ if(k[0]==2) mglprintf(out,1024,L"gr->SetTickStl(\"%s\",\"%s\");", a[0].s, k[1]==2?a[1].s:""); } -//----------------------------------------------------------------------------- -int mgls_ranges(mglGraph *gr, long n, mglArg *a, int k[10]) -{ - register int i; - if(n==6) - { - bool ok=true; - for(i=0;i<6;i++) if(k[i]!=3) ok = false; - if(ok) gr->SetRanges(a[0].v,a[1].v,a[2].v, a[3].v,a[4].v,a[5].v); - else return 1; - } - else if(n==4) - { - bool ok=true; - for(i=0;i<4;i++) if(k[i]!=3) ok = false; - if(ok) gr->SetRanges(a[0].v,a[1].v, a[2].v,a[3].v); - else return 1; - } - else return 1; - return 0; -} -void mglc_ranges(wchar_t out[1024], long n, mglArg *a, int k[10]) -{ - register int i; - if(n==6) - { - bool ok=true; - for(i=0;i<6;i++) if(k[i]!=3) ok = false; - if(ok) mglprintf(out,1024,L"gr->SetRanges(%g, %g, %g, %g, %g, %g);", a[0].v,a[1].v,a[2].v,a[3].v,a[4].v,a[5].v); - } - else if(n==4) - { - bool ok=true; - for(i=0;i<4;i++) if(k[i]!=3) ok = false; - if(ok) mglprintf(out,1024,L"gr->SetRanges(%g, %g, %g, %g);", a[0].v,a[1].v,a[2].v,a[3].v); - } -} -//----------------------------------------------------------------------------- -int mgls_adjust(mglGraph *gr, long , mglArg *a, int k[10]) -{ gr->AdjustTicks(k[0]==2?a[0].s:"xyzc"); return 0; } -void mglc_adjust(wchar_t out[1024], long , mglArg *a, int k[10]) -{ mglprintf(out,1024,L"gr->AdjustTicks(\"%s\");",k[0]==2?a[0].s:"xyzc"); } -//----------------------------------------------------------------------------- -int mgls_insert(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) a[0].d->Insert(a[1].s[0], k[2]==3 ? iint(a[2].v):0, k[3]==3 ? iint(a[3].v):1); - else return 1; - return 0; -} -void mglc_insert(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Insert('%c', %d, %d);", - a[0].s, a[1].s[0], k[2]==3 ? iint(a[2].v):0, k[3]==3 ? iint(a[3].v):1); -} -//----------------------------------------------------------------------------- -int mgls_delete(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) a[0].d->Delete(a[1].s[0], k[2]==3 ? iint(a[2].v):0, k[3]==3 ? iint(a[3].v):1); - else return 1; - return 0; -} -void mglc_delete(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Delete('%c', %d, %d);", - a[0].s, a[1].s[0], k[2]==3 ? iint(a[2].v):0, k[3]==3 ? iint(a[3].v):1); -} -//----------------------------------------------------------------------------- -int mgls_roll(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==3) a[0].d->Roll(a[1].s[0], iint(a[2].v)); - else return 1; - return 0; -} -void mglc_roll(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==2 && k[2]==3) mglprintf(out,1024,L"%s.Roll('%c', %d);", - a[0].s, a[1].s[0], iint(a[2].v)); -} -//----------------------------------------------------------------------------- -int mgls_triangulate(mglGraph *, long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - *(a[0].d) = mglTriangulation(*(a[1].d), *(a[2].d), *(a[3].d), k[4]==3?a[4].v:0); - else if(k[0]==1 && k[1]==1 && k[2]==1) - *(a[0].d) = mglTriangulation(*(a[1].d), *(a[2].d), k[3]==3?a[3].v:0); - else return 1; - return 0; -} -void mglc_triangulate(wchar_t out[1024], long , mglArg *a, int k[10]) -{ - if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) - mglprintf(out,1024,L"%s = mglTriangulation(%s, %s, %s, %g);",a[0].s, a[1].s, a[2].s, a[3].s, k[4]==3?a[4].v:0); - else if(k[0]==1 && k[1]==1 && k[2]==1) - mglprintf(out,1024,L"%s = mglTriangulation(%s, %s, %g);",a[0].s, a[1].s, a[2].s, k[3]==3?a[3].v:0); -} -//----------------------------------------------------------------------------- -mglCommand mgls_base_cmd[] = { - {L"addlegend",L"Add legend entry",L"addlegend 'txt' 'fmt'", mgls_addlegend, mglc_addlegend, false, 2}, - {L"addto",L"Add data or number",L"addto Var Dat|Var num", mgls_addto, mglc_addto, false, 3}, - {L"adjust",L"Adjust ticks for best view",L"adjust ['dir']", mgls_adjust, mglc_adjust, false, 2}, - {L"af2d",L"Solve PDE in accompanied coordinates",L"af2d Res 'ham' IniRe IniIm Ray [r k0 Xout Yout]", mgls_af2d, mglc_af2d, true, 3}, - {L"alpha",L"Switch on/off transparency",L"alpha [val]", mgls_alpha, mglc_alpha, false, 2}, - {L"alphadef",L"Set default transparency",L"alphadef val", mgls_alphadef, mglc_alphadef, false, 2}, - {L"ambient",L"Set ambient light brightness",L"ambient val", mgls_ambient, mglc_ambient, false, 2}, - {L"area",L"Draw area plot for 1D data",L"area Ydat ['fmt' zval]|Xdat Ydat ['fmt' zval]|Xdat Ydat Zdat ['fmt']", mgls_area, mglc_area, false, 0}, - {L"arrowsize",L"Set size of arrows",L"arrowsize val", mgls_arrowsize, mglc_arrowsize, false, 2}, - {L"aspect",L"Set aspect ration",L"aspect valx valy [valz]", mgls_aspect, mglc_aspect, false, 4}, - {L"axial",L"Draw surfaces of contour lines rotation",L"axial Zdat ['fmt' num]|Xdat Ydat Zdat ['fmt' num]", mgls_axial, mglc_axial, false, 0}, - {L"axialdir",L"Set axis of rotation",L"axialdir 'dir'", mgls_axialdir, mglc_axialdir, false, 2}, - {L"axis",L"Setup or draw axis",L"axis ['dir' adjust]|'fx' 'fy' ['fz' 'fc']|how", mgls_axis, mglc_axis, false, 1}, - {L"ball",L"Draw point (ball)",L"ball posx posy ['fmt']|posx posy posz ['fmt']", mgls_ball, mglc_ball, false, 1}, - {L"barh",L"Draw horizontal bars for 1D data", L"barh Ydat ['fmt' zval above]|Xdat Ydat ['fmt' zval above]", mgls_barh, mglc_barh, false, 0}, - {L"bars",L"Draw bars for 1D data",L"bars Ydat ['fmt' zval above]|Xdat Ydat ['fmt' zval above]|Xdat Ydat Zdat ['fmt' above]", mgls_bars, mglc_bars, false, 0}, - {L"barwidth",L"Set default bars width",L"barwidth val", mgls_barwidth, mglc_barwidth}, - {L"beam",L"Draw quasioptical beam",L"beam Tr G1 G2 Adat r ['sch' flag num] ", mgls_beam, mglc_beam, false, 0}, - {L"belt",L"Draw belts",L"belt Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_belt, mglc_belt, false, 0}, - {L"box",L"Draw bounding box",L"box ['fmt' ticks]", mgls_box, mglc_box, false, 1}, - {L"boxplot",L"Draw boxplot for 2D data",L"boxplot Ydat ['fmt']|Xdat Ydat ['fmt']", mgls_boxplot, mglc_boxplot}, - {L"boxs",L"Draw boxes",L"boxs Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_boxs, mglc_boxs, false, 0}, - {L"caxis",L"Set color range",L"caxis c1 c2", mgls_caxis, mglc_caxis, false, 2}, - {L"chart",L"Draw chart",L"chart Dat ['fmt']", mgls_chart, mglc_chart, false, 0}, - {L"chdir",L"Change current directory",L"chdir 'dir'", mgls_chdir, mglc_chdir, false, 5}, - {L"clearlegend",L"Clear legend antries",L"clearlegend", mgls_clearlegend, mglc_clearlegend, false, 2}, - {L"clf",L"Clear picture",L"clf", mgls_clf, mglc_clf, false, 5}, - {L"cloud",L"Draw cloud",L"cloud Adat ['fmt']|Xdat Ydat Zdat Adat ['fmt']", mgls_cloud, mglc_cloud, false, 0}, - {L"colorbar",L"Draw colorbar",L"colorbar ['fmt' pos]|Vdat ['fmt' pos]|'sch' pos x y w h ", mgls_colorbar, mglc_colorbar, false, 1}, - {L"columnplot",L"Set position of plot inside cell of column", L"columnplot num ind [d]", mgls_columnplot, mglc_columnplot, false, 4}, - {L"combine", L"Direct multiplication of arrays", L"combine Res Adat Bdat", mgls_combine, mglc_combine, false, 3}, - {L"cone",L"Draw cone",L"cone x1 y1 z1 x2 y2 z2 r1 [r2 'fmt' edge]", mgls_cone, mglc_cone, false, 1}, - {L"cont",L"Draw contour lines",L"cont Zdat ['fmt' num zpos]|Vdat Zdat ['fmt' zpos]|Xdat Ydat Zdat ['fmt' num zpos]|Vdat Xdat Ydat Zdat ['fmt' zpos]", mgls_cont, mglc_cont, false, 0}, - {L"cont3",L"Draw contour lines for 3D data",L"cont3 Adat 'dir' [val 'fmt' num]|Vdat Adat 'dir' [val 'fmt']|Xdat Ydat Zdat Adat 'dir' [val 'fmt' num]|Vdat Xdat Ydat Zdar Adat 'dir' [val 'fmt']", mgls_cont3, mglc_cont3, false, 0}, - {L"conta",L"Draw contour lines at central slices of 3D data",L"conta Adat ['fmt' num]|Xdat Ydat Zdat Adat ['fmt' num]", mgls_conta, mglc_conta, false, 0}, - {L"contd",L"Draw solid contours with manual colors",L"contd Zdat ['fmt' num zpos]|Vdat Zdat ['fmt' zpos]|Xdat Ydat Zdat ['fmt' num zpos]|Vdat Xdat Ydat Zdat ['fmt' zpos]", mgls_contd, mglc_contd, false, 0}, - {L"contf",L"Draw solid contours",L"contf Zdat ['fmt' num zpos]|Vdat Zdat ['fmt' zpos]|Xdat Ydat Zdat ['fmt' num zpos]|Vdat Xdat Ydat Zdat ['fmt' zpos]", mgls_contf, mglc_contf, false, 0}, - {L"contf3",L"Draw solid contour lines for 3D data",L"contf3 Adat 'dir' [val 'fmt' num]|Vdat Adat 'dir' [val 'fmt']|Xdat Ydat Zdat Adat 'dir' [val 'fmt' num]|Vdat Xdat Ydat Zdar Adat 'dir' [val 'fmt']", mgls_contf3, mglc_contf3, false, 0}, - {L"contfa",L"Draw solid contour lines at central slices of 3D data",L"contfa Adat [fmt num]|Xdat Ydat Zdat Adat [fmt num]", mgls_contfa, mglc_contfa, false, 0}, - {L"contfx",L"Draw solid contour lines at x-slice (or x-plane)",L"contfx Dat ['fmt' pos num]", mgls_contfx, mglc_contfx, false, 0}, - {L"contfy",L"Draw solid contour lines at y-slice (or y-plane)",L"contfy Dat ['fmt' pos num]", mgls_contfy, mglc_contfy, false, 0}, - {L"contfz",L"Draw solid contour lines at z-slice (or z-plane)",L"contfz Dat ['fmt' pos num]", mgls_contfz, mglc_contfz, false, 0}, - {L"contx",L"Draw contour lines at x-slice (or x-plane)",L"contx Dat ['fmt' pos num]", mgls_contx, mglc_contx, false, 0}, - {L"conty",L"Draw contour lines at y-slice (or y-plane)",L"conty Dat ['fmt' pos num]", mgls_conty, mglc_conty, false, 0}, - {L"contz",L"Draw contour lines at z-slice (or z-plane)",L"contz Dat ['fmt' pos num]", mgls_contz, mglc_contz, false, 0}, - {L"copy",L"Copy data from another variable",L"copy Dat1 Dat2 ['eq' onaxis]", mgls_copy, mglc_copy, true, 3}, - {L"cosfft",L"Cos-Fourier transform at some direction",L"cosfft Dat 'dir'", mgls_cosfft, mglc_cosfft, false, 3}, - {L"crange",L"Set color range",L"crange Dat [sym] | c1 c2", mgls_crange, mglc_crange, false, 2}, - {L"crop",L"Crop edge of data",L"crop Dat n1 n2 'dir'", mgls_crop, mglc_crop, false, 3}, - {L"crust",L"Draw reconstructed surface for arbitrary data points",L"crust Xdat Ydat Zdat ['fmt']", mgls_crust, mglc_crust, false, 0}, - {L"ctick",L"Set ticks for colorbar",L"ctick 'tmpl' | dx", mgls_ctick, mglc_ctick, false, 2}, - {L"cumsum",L"Cumulative summation",L"cumsum Dat 'dir'", mgls_cumsum, mglc_cumsum, false, 3}, - {L"curve",L"Draw curve",L"curve x1 y1 dx1 dy1 x2 y2 dx2 dy2 ['fmt']|x1 y1 z1 dx1 dy1 dz1 x2 y2 z2 dx2 dy2 dz2 ['fmt']", mgls_curve, mglc_curve, false, 1}, - {L"cut",L"Setup plot points cutting",L"cut val|x1 y1 z1 x2 y2 z2|'cond'", mgls_cut, mglc_cut, false, 2}, - {L"delete",L"Delete slice of data",L"delete Dat 'dir' [pos=0 num=1]", mgls_delete, mglc_delete, false, 3}, - {L"dens",L"Draw density plot",L"dens Zdat ['fmt' zpos]|Xdat Ydat Zdat ['fmt' zpos]", mgls_dens, mglc_dens, false, 0}, - {L"dens3",L"Draw density plot at slices of 3D data",L"dens3 Adat 'dir' [pos 'fmt']|Xdat Ydat Zdat Adat 'dir' [pos 'fmt']", mgls_dens3, mglc_dens3, false, 0}, - {L"densa",L"Draw density plot at central slices of 3D data",L"densa Adat ['fmt']|Xdat Ydat Zdat Adat ['fmt']", mgls_densa, mglc_densa, false, 0}, - {L"densx",L"Draw density plot at x-slice (or x-plane)",L"densx Dat ['fmt' pos]", mgls_densx, mglc_densx, false, 0}, - {L"densy",L"Draw density plot at y-slice (or y-plane)",L"densy Dat ['fmt' pos]", mgls_densy, mglc_densy, false, 0}, - {L"densz",L"Draw density plot at z-slice (or z-plane)",L"densz Dat ['fmt' pos]", mgls_densz, mglc_densz, false, 0}, - {L"dew",L"Draw dew plot",L"dew Udat Vdat ['fmt']|Xdat Ydat Udat Vdat ['fmt']", mgls_dew, mglc_dew, false, 0}, - {L"diff",L"Numerically differentiate data",L"diff Var 'dir'", mgls_diff, mglc_diff, false, 3}, - {L"diff2",L"Numerically double differentiate data",L"diff2 Var 'dir'", mgls_diff2, mglc_diff2, false, 3}, - {L"divto",L"Divide by data or number",L"divto Var Dat|Var num", mgls_divto, mglc_divto, false, 3}, - {L"dots",L"Draw dots for arbitrary data points",L"dots Xdat Ydat Zdat ['fmt']", mgls_dots, mglc_dots, false, 0}, - {L"drop",L"Draw drop",L"drop x0 y0 dx dy r ['col' sh asp]|x0 y0 z0 dx dy dz r ['col' sh asp]", mgls_drop, mglc_drop, false, 0}, - {L"envelop",L"Find envelop for the data",L"envelop Dat ['dir']", mgls_envelop, mglc_envelop, false, 3}, - {L"error",L"Draw error boxes",L"error Ydat Yerr ['fmt' zval]|Xdat Ydat Yerr ['fmt' zval]|Xdat Ydat Xerr Yerr ['fmt' zval]", mgls_error, mglc_error, false, 0}, - {L"evaluate",L"Evaluate (interpolate) values of array Dat at points i=idat,j=jdat,k=kdat",L"evaluate Res Dat Idat [norm]|Res Dat Idat Jdat [norm]|Res Dat Idat Jdat Kdat [norm]", mgls_evaluate, mglc_evaluate, true, 3}, - {L"export",L"Export data to PNG picture",L"export Dat 'fname' 'sch' [v1 v2]", mgls_import, mglc_import, false, 3}, - {L"extend",L"Extend data array",L"extend Dat dim1 [dim2]", mgls_extend, mglc_extend, false, 3}, - {L"facex",L"Draw face perpendicular to x-axis",L"facex x0 y0 z0 wy wz ['fmt' d1 d2]", mgls_facex, mglc_facex, false, 1}, - {L"facey",L"Draw face perpendicular to y-axis",L"facex x0 y0 z0 wx wz ['fmt' d1 d2]", mgls_facey, mglc_facey, false, 1}, - {L"facez",L"Draw face perpendicular to z-axis",L"facex x0 y0 z0 wy wz ['fmt' d1 d2]", mgls_facez, mglc_facez, false, 1}, - {L"fall",L"Draw waterfalls",L"fall Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_fall, mglc_fall, false, 0}, - {L"fgets",L"Print string from file",L"fgets x y z 'fname' [pos=0 'fmt' size]|x y z 'fname' [pos=0 'fmt' size]", mgls_fgets, mglc_fgets, false, 1}, - {L"fill",L"Fill data linearly in range [v1, v2]",L"fill Var v1 v2 ['dir'] | Var 'eq' [Vdat Wdat]", mgls_fill, mglc_fill, false, 3}, - {L"fillsample",L"Fill x-,k-samples for transforms",L"fillsample Var num 'how'", mgls_fillsample, mglc_fillsample, false, 3}, - {L"fit",L"Fit data to formula",L"fit Res A 'eq' 'var' [Ini]|Res X A 'eq' 'var' [Ini]|Res X Y A 'eq' 'var' [Ini]|Res X Y Z A 'eq' 'var' [Ini]", mgls_fit, mglc_fit, true, 3}, - {L"fits",L"Fit data to formula",L"fits Res A S 'eq' 'var' [Ini]|Res X A S 'eq' 'var' [Ini]|Res X Y A S 'eq' 'var' [Ini]|Res X Y Z A S 'eq' 'var' [Ini]", mgls_fits, mglc_fits, true, 3}, - {L"flow",L"Draw flow threads for vector field",L"flow Udat Vdat ['fmt' num zval]|Xdat Ydat Udat Vdat ['fmt' num zval]|Udat Vdat Wdat ['fmt' num]|Xdat Ydat Zdat Udat Vdat ['fmt' num]|\ - x0 y0 Udat Vdat ['fmt' zval]|x0 y0 Xdat Ydat Udat Vdat ['fmt' zval]|x0 y0 z0 Udat Vdat Wdat ['fmt']|x0 y0 z0 Xdat Ydat Zdat Udat Vdat Wdat ['fmt']", mgls_flow, mglc_flow, false, 0}, - {L"fog",L"Switch on/off fog",L"fog val [pos]", mgls_fog, mglc_fog, false, 2}, - {L"font",L"Setup font",L"font 'fmt' [size]", mgls_font, mglc_font, false, 2}, - {L"fplot",L"Plot curve by formula",L"fplot 'y(x)' ['fmt' zval num]|'x(t)' 'y(t)' 'z(t)' ['fmt' num]", mgls_fplot, mglc_fplot, false, 1}, - {L"fsurf",L"Plot surface by formula",L"fsurf 'z(x,y)' ['fmt' num]|'x(u,v)' 'y(u,v)' 'z(u,v)' ['fmt' num]", mgls_fsurf, mglc_fsurf, false, 1}, - {L"grad",L"Draw gradient lines for scalar field",L"grad Phi ['fmt' num zval]|Xdat Ydat Phi ['fmt' num zval]|Xdat Ydat Zdat Phi ['fmt' num]", mgls_grad, mglc_grad, false, 0}, - {L"grid",L"Draw grid",L"grid ['dir' 'fmt']", mgls_grid, mglc_grid, false, 0}, - {L"grid2",L"Draw grid for data array(s)",L"grid Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_grid2, mglc_grid2, false, 0}, - {L"grid3",L"Draw grid at slices of 3D data",L"grid3 Adat 'dir' [pos 'fmt']|Xdat Ydat Zdat Adat 'dir' [pos 'fmt']", mgls_grid3, mglc_grid3, false, 0}, - {L"grida",L"Draw grid at central slices of 3D data",L"grida Adat ['fmt']|Xdat Ydat Zdat Adat ['fmt']", mgls_grida, mglc_grida, false, 0}, - {L"hankel",L"Hankel transform at some direction",L"hankel Dat 'dir'", mgls_hankel, mglc_hankel, false, 3}, - {L"hist",L"Create histogram (distribution) of data values",L"hist Res Dat num v1 v2 [nsub]|Res Dat Wdat num v1 v2 [nsub]", mgls_hist, mglc_hist, true, 3}, - {L"idset",L"Set column id for data",L"idset Dat 'ids'", mgls_idset, mglc_idset, false, 3}, - {L"import",L"Import data from PNG picture",L"import Dat 'fname' 'scheme' [v1 v2]", mgls_import, mglc_import, true, 3}, - {L"info",L"Print information about data",L"info Dat [detail]|'message'", mgls_info, mglc_info, false, 3}, - {L"inplot",L"Set position of plot in picture",L"x1 x2 y1 y2 [rel]", mgls_inplot, mglc_inplot, false, 4}, - {L"insert",L"Insert slice of data",L"insert Dat 'dir' [pos=0 num=1]", mgls_insert, mglc_insert, false, 3}, - {L"integrate",L"Integrate data",L"integrate Dat 'dir'", mgls_integrate, mglc_integrate, false, 3}, - {L"jacobian",L"Get Jacobian",L"jacobian Res Xdat Ydat [Zdat]", mgls_jacobian, mglc_jacobian, true, 3}, - {L"label",L"Draw label at arbitrary position",L"label x y 'txt' ['fmt' size]", mgls_label, mglc_label, false, 1}, - {L"legend",L"Draw legend",L"legend [pos 'fmt' size llen]|x y ['fmt' size llen]", mgls_legend, mglc_legend, false, 1}, - {L"legendbox",L"Switch on/off drawing box in legend",L"legendbox val", mgls_legendbox, mglc_legendbox, false, 2}, - {L"legendmarks",L"Set number of marks in the legend",L"legendmarks val", mgls_legendbox, mglc_legendbox, false, 2}, - {L"light",L"Setup light",L"light [val] | val num | num xpos ypos zpos ['fmt' br]", mgls_light, mglc_light, false, 2}, - {L"line",L"Draw line",L"line x1 y1 x2 y2 ['fmt']|x1 y1 z1 x2 y2 z2 ['fmt']", mgls_line, mglc_line, false, 1}, - {L"linewidth",L"Set default line width",L"linewidth val", mgls_linewidth, mglc_linewidth, false, 2}, - {L"loadfont",L"Load fontfaces",L"loadfont ['fmt']", mgls_loadfont, mglc_loadfont, false, 2}, - {L"map",L"Draw mapping plot",L"map Udat Vdat ['fmt']|Xdat Ydat Udat Vdat ['fmt']", mgls_map, mglc_map, false, 0}, - {L"mark",L"Draw mark plot for 1D data",L"mark Ydat Rdat ['fmt' zval]|Xdat Ydat Rdat ['fmt' zval]|Xdat Ydat Zdat Rdat ['fmt']", mgls_mark, mglc_mark, false, 0}, - {L"marksize",L"Set size of markers",L"marksize val", mgls_marksize, mglc_marksize, false, 2}, - {L"max",L"Find maximal value over direction",L"max Res Dat 'dir'", mgls_max, mglc_max, true, 3}, - {L"mesh",L"Draw mesh surface",L"mesh Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_mesh, mglc_mesh, false, 0}, - {L"meshnum",L"Set number of lines in mesh/fall/vect and so on",L"meshnum val", mgls_meshnum, mglc_meshnum, false, 2}, - {L"min",L"Find minimal value over direction",L"min Res Dat 'dir'", mgls_min, mglc_min, true, 3}, - {L"mirror",L"Mirror data at some direction",L"mirror Dat 'dir'", mgls_mirror, mglc_mirror, false, 3}, - {L"modify",L"Modify data values by formula",L"modify Dat 'eq' [num] | Dat 'eq' Vdat [Wdat]", mgls_modify, mglc_modify, false, 3}, - {L"momentum",L"Get momentum along direction",L"momentum Res Dat 'how' ['dir']", mgls_momentum, mglc_momentum, true, 3}, - {L"multo",L"Multiply by data or number",L"multo Var Dat|Var num", mgls_multo, mglc_multo, false, 3}, - {L"new",L"Create new data",L"new Dat nx [ny nz]", mgls_new, mglc_new, true, 3}, - {L"norm",L"Normalize data",L"norm Dat v1 v2 [sym dim]", mgls_norm, mglc_norm, false, 3}, - {L"normsl",L"Normalize data slice by slice",L"normsl Dat v1 v2 ['dir' keep sym] ", mgls_normsl, mglc_normsl, false, 3}, - {L"origin",L"Set axis origin",L"origin x0 y0 [z0]", mgls_origin, mglc_origin, false, 2}, - {L"palette",L"Set palette for 1D plots",L"palette 'colors'", mgls_palette, mglc_palette, false, 2}, - {L"pde",L"Solve PDE",L"pde Res 'ham' IniRe IniIm [dz k0]", mgls_pde, mglc_pde, true, 3}, - {L"perspective",L"Set perspective",L"perspective val", mgls_perspective, mglc_perspective, false, 2}, - {L"pipe",L"Draw flow pipes for vector field",L"pipe Udat Vdat ['fmt' rad num zval]|Xdat Ydat Udat Vdat ['fmt' rad num zval]|Udat Vdat Wdat ['fmt' rad num]|Xdat Ydat Zdat Udat Vdat Wdat ['fmt' rad num]", mgls_pipe, mglc_pipe, false, 0}, - {L"plot",L"Draw usual plot for 1D data",L"plot Ydat ['fmt' zval]|Xdat Ydat ['fmt' zval]|Xdat Ydat Zdat ['fmt']", mgls_plot, mglc_plot, false, 0}, - {L"plotfactor",L"Set plotfactor",L"plotfactor val", mgls_plotfactor, mglc_plotfactor, false, 2}, - {L"put",L"Put value (numeric or array) to given data element",L"put Dat val [i j k] | Dat Val [i j k]", mgls_put, mglc_put, false, 3}, - {L"putsfit",L"Print fitted formula",L"putsfit x y ['pre' 'font' size]|x y z ['pre' 'font' size]", mgls_putsfit, mglc_putsfit, false, 0}, - {L"qo2d",L"Solve PDE in accompanied coordinates",L"qo2d Res 'ham' IniRe IniIm Ray [r k0 Xout Yout]", mgls_qo2d, mglc_qo2d, true, 3}, - {L"quadplot",L"Draw surface of quadrangles",L"quadplot Idat Xdat Ydat ['fmt']|Idat Xdat Ydat Zdat ['fmt']|Idat Xdat Ydat Zdat Cdat ['fmt'] ", mgls_quadplot, mglc_quadplot, false, 0}, - {L"radar",L"Draw radar chart",L"radar Rdat ['fmt' r]", mgls_radar, mglc_radar, false, 0}, - {L"ranges",L"Set axis ranges",L"ranges x1 x2 y1 y2 [z1 z2]", mgls_ranges, mglc_ranges, false, 2}, - {L"ray",L"Solve Hamiltonian ODE (find GO ray or trajectory)",L"ray Res 'ham' x0 y0 z0 px0 py0 pz0 [dz=0.1 tmax=10]", mgls_ray, mglc_ray, true, 3}, - {L"read",L"Read data from file",L"read Dat 'file' [nx ny nz]", mgls_read, mglc_read, true, 3}, - {L"readall",L"Read and join data from several files",L"readall Dat 'templ' [slice]", mgls_readall, mglc_readall, true, 3}, - {L"readhdf",L"Read data from HDF5 file",L"readhdf Dat 'file' 'id'", mgls_readhdf, mglc_readhdf, true, 3}, - {L"readmat",L"Read data from file with sizes specified in first row",L"readmat Dat 'file' [dim]", mgls_readmat, mglc_readmat, true, 3}, - {L"rearrange",L"Rearrange data dimensions",L"rearrange Dat mx [my mz]", mgls_rearrange, mglc_rearrange, false, 3}, - {L"rect",L"Draw rectangle",L"rect x1 y1 x2 y2 ['fmt']|x1 y1 z1 x2 y2 z2 ['fmt']", mgls_rect, mglc_rect, false, 1}, - {L"region",L"Draw filled region between 2 curves",L"region Ydat1 Ydat2 ['fmt' inside]|Xdat Ydat1 Ydat2 ['fmt' inside]", mgls_region, mglc_region, false, 0}, - {L"resize",L"Resize data",L"resize Res Dat mx [my mz]", mgls_resize, mglc_resize, true, 3}, - {L"roll",L"Roll data along direction",L"roll Dat 'dir' num", mgls_roll, mglc_roll, false, 0}, - {L"rotate",L"Rotate plot",L"rotate tetz tetx [tety] | tet x y z", mgls_rotate, mglc_rotate, false, 4}, - {L"rotatetext",L"Set to auto rotate text or not",L"rotatetext val", mgls_rotatetext, mglc_rotatetext, false, 2}, - {L"save",L"Save data to file",L"save Dat 'file'", mgls_save, mglc_save, false, 3}, - {L"savehdf",L"Save data to HDF5 file",L"savehdf Dat 'file' 'id'", mgls_savehdf, mglc_savehdf, false, 3}, - {L"setsize",L"Set picture size",L"setsize width height", mgls_setsize, mglc_setsize, false, 5}, - {L"sew",L"Remove jump into the data, like phase jumps",L"sew Dat ['dir' da]", mgls_sew, mglc_sew, false, 3}, - {L"sinfft",L"Sin-Fourier transform at some direction",L"sinfft Dat 'dir'", mgls_sinfft, mglc_sinfft, false, 3}, - {L"smooth",L"Smooth data",L"smooth Dat [kind 'dir']", mgls_smooth, mglc_smooth, false, 3}, - {L"sphere",L"Draw sphere",L"sphere x0 y0 r ['fmt']|x0 y0 z0 r ['fmt']", mgls_sphere, mglc_sphere, false, 1}, - {L"squeeze",L"Squeeze data",L"squeeze Dat kx [ky kz]", mgls_squeeze, mglc_squeeze, false, 3}, - {L"stem",L"Draw stem plot for 1D data",L"stem Ydat ['fmt' zval]|Xdat Ydat ['fmt' zval]|Xdat Ydat Zdat ['fmt']", mgls_stem, mglc_stem, false, 0}, - {L"step",L"Draw step plot for 1D data",L"step Ydat ['fmt' zval]|Xdat Ydat ['fmt' zval]|Xdat Ydat Zdat ['fmt']", mgls_step, mglc_step, false, 0}, - {L"stfa",L"Draw STFA diagram",L"stfa Udat Vdat dn ['fmt']|Xdat Ydat Udat Vdat dn ['fmt']", mgls_stfa, mglc_stfa, false, 0}, - {L"stfad",L"Do STFA transform",L"stfad Res Real Imag dn ['dir']", mgls_stfad, mglc_stfad, true, 3}, - {L"stickplot",L"Set position of plot inside cell of stick", L"stickplot num ind tet phi", mgls_stickplot, mglc_stickplot, false, 4}, - {L"subdata",L"Extract sub-array",L"subdata Res Dat nx [ny nz]", mgls_subdata, mglc_subdata, true, 3}, - {L"subplot",L"Set position of plot",L"subplot m n pos [dx dy]|m n pos 'style'", mgls_subplot, mglc_subplot, false, 4}, - {L"subto",L"Subtract data or number",L"subto Var Dat|Var num", mgls_subto, mglc_subto, false, 3}, - {L"sum",L"Find summation over direction",L"sum Res Dat 'dir'", mgls_sum, mglc_sum, true, 3}, - {L"surf",L"Draw solid surface",L"surf Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_surf, mglc_surf, false, 0}, - {L"surf3",L"Draw isosurface for 3D data",L"surf3 Adat ['fmt' num]|Xdat Ydat Zdat Adat ['fmt' num]|Adat val ['fmt']|Xdat Ydat Zdat Adat val ['fmt']", mgls_surf3, mglc_surf3, false, 0}, - {L"surf3a",L"Draw isosurface for 3D data transpared by other data",L"surf3a Adat Cdat ['fmt' num]|Xdat Ydat Zdat Adat Cdat ['fmt' num]|Adat Cdat val ['fmt']|Xdat Ydat Zdat Adat Cdat val ['fmt']", mgls_surf3a, mglc_surf3a, false, 0}, - {L"surf3c",L"Draw isosurface for 3D data colored by other data",L"surf3c Adat Cdat ['fmt' num]|Xdat Ydat Zdat Adat Cdat ['fmt' num]|Adat Cdat val ['fmt']|Xdat Ydat Zdat Adat Cdat val ['fmt']", mgls_surf3c, mglc_surf3c, false, 0}, - {L"surfa",L"Draw solid surface transpared by other data",L"surfa Zdat Cdat ['fmt']|Xdat Ydat Zdat Cdat ['fmt']", mgls_surfa, mglc_surfa, false, 0}, - {L"surfc",L"Draw solid surface colored by other data",L"surfc Zdat Cdat ['fmt']|Xdat Ydat Zdat Cdat ['fmt']", mgls_surfc, mglc_surfc, false, 0}, - {L"swap",L"Swap data (usefull after Fourier transform)",L"swap Dat 'dir'", mgls_swap, mglc_swap, false, 0}, - {L"tens",L"Draw tension plot for 1D data",L"tens Ydat Cdat ['fmt' zval]|Xdat Ydat Cdat ['fmt' zval]|Xdat Ydat Zdat Cdat ['fmt']", mgls_tens, mglc_tens, 0}, - {L"ternary",L"Switch on/off to use ternary axis",L"ternary val", mgls_ternary, mglc_ternary, false, 2}, - {L"text",L"Draw text at some position or along curve",L"text x y 'txt' ['fmt' size]|x y z 'txt' ['fmt' size]|x y dx dy 'txt' ['fmt' size]|x y z dx dy dz 'txt' ['fmt' size]|Ydat 'txt' ['font' sise zval]|Xdat Ydat 'txt' ['font' sise zval]", mgls_text, mglc_text, false, 0}, - {L"textmark",L"Draw TeX mark at point position",L"textmark Ydat Rdat 'text' ['fmt' zval]|Xdat Ydat Rdat 'text' ['fmt' zval]|Xdat Ydat Zdat Rdat 'text' ['fmt']", mgls_textmark, mglc_textmark, false, 0}, - {L"ticklen",L"Set tick length",L"ticklen val [stt]", mgls_ticklen, mglc_ticklen, false, 2}, - {L"tickstl",L"Set tick style",L"tickstl 'stl' ['sub']", mgls_tickstl, mglc_tickstl, false, 2}, - {L"tile",L"Draw horizontal tiles",L"tile Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_tile, mglc_tile, false, 0}, - {L"tiles",L"Draw horizontal tiles with variable size",L"tiles Zdat Rdat ['fmt']|Xdat Ydat Zdat Rdat ['fmt']", mgls_tiles, mglc_tiles, false, 0}, - {L"title",L"Print title for the picture",L"title 'text' ['fmt' size]", mgls_title, mglc_title, false, 1}, - {L"tlabel",L"Draw label for t-axis",L"tlabel 'txt' [pos size shift]", mgls_tlabel, mglc_tlabel, false, 1}, - {L"torus",L"Draw surface of curve rotation",L"torus Rdat ['fmt']|Zdat Rdat ['fmt']", mgls_torus, mglc_torus, false, 0}, - {L"trace",L"Get trace of array",L"trace Res Dat", mgls_trace, mglc_trace, true, 3}, - {L"traj",L"Draw vectors along a curve",L"traj Xdat Ydat Udat Vdat ['fmt' zval len]|Xdat Ydat Zdat Udat Vdat Wdat ['fmt' len]", mgls_traj, mglc_traj, false, 0}, - {L"transform",L"Do integral transform of data",L"transform Res 'how' Rdat Idat", mgls_transform, mglc_transform, true, 3}, - {L"transforma",L"Do integral transform of data",L"transforma Res 'how' Adat Pdat", mgls_transforma, mglc_transforma, true, 3}, - {L"transparent",L"Switch off transparency",L"transparent val", mgls_transparent, mglc_transparent, false, 2}, //!!! OLD !!! - {L"transpose",L"Transpose data array",L"transpose Dat ['dir']", mgls_transpose, mglc_transpose, false, 3}, - {L"transptype",L"Set type transparency",L"transptype val", mgls_transptype, mglc_transptype, false, 2}, - {L"triangulate",L"Find triangles of randomly placed points",L"triangulate Res Xdat Ydat [er]|Res Xdat Ydat Zdat [er]", mgls_triangulate, mglc_triangulate, true, 3}, - {L"tricont",L"Draw contour lines for surface of triangles",L"tricont Vdat Idat Xdat Ydat ['fmt']|Vdat Idat Xdat Ydat Zdat ['fmt']|Vdat Idat Xdat Ydat Zdat Cdat ['fmt'] ", mgls_tricont, mglc_tricont, false, 0}, - {L"triplot",L"Draw surface of triangles",L"triplot Idat Xdat Ydat ['fmt']|Idat Xdat Ydat Zdat ['fmt']|Idat Xdat Ydat Zdat Cdat ['fmt'] ", mgls_triplot, mglc_triplot, false, 0}, - {L"tube",L"Draw curve by tube",L"tube Ydat Rdat ['fmt' zval]|Ydat rval ['fmt' zval]|Xdat Ydat Rdat ['fmt' zval]|Xdat Ydat rval ['fmt' zval]|Xdat Ydat Zdat Rdat ['fmt']|Xdat Ydat Zdat rval ['fmt']", mgls_tube, mglc_tube, false, 0}, - {L"var",L"Create new 1D data and fill it in range",L"var Dat nx x1 [x2]", mgls_var, mglc_var, true, 3}, - {L"vect",L"Draw vector field",L"vect Udat Vdat ['fmt' zval kind]|Xdat Ydat Udat Vdat ['fmt' zval kind]|Udat Vdat Wdat ['fmt' kind]|Xdat Ydat Zdat Udat Vdat Wdat ['fmt' kind]", mgls_vect, mglc_vect, false, 0}, - {L"vectc",L"Draw vector field with coloring",L"vectc Udat Vdat ['fmt' zval]|Xdat Ydat Udat Vdat ['fmt' zval]|Udat Vdat Wdat ['fmt']|Xdat Ydat Zdat Udat Vdat Wdat ['fmt']", mgls_vectc, mglc_vectc, false, 0}, - {L"vectl",L"Draw vector field with different lengths",L"vectl Udat Vdat ['fmt' zval]|Xdat Ydat Udat Vdat ['fmt' zval]|Udat Vdat Wdat ['fmt']|Xdat Ydat Zdat Udat Vdat Wdat ['fmt']", mgls_vect, mglc_vect, false, 0}, - {L"write",L"Write current image to graphical file",L"write 'fname' [solid]", mgls_write, mglc_write, false, 5}, - {L"xlabel",L"Draw label for x-axis",L"xlabel 'txt' [pos size shift]", mgls_xlabel, mglc_xlabel, false, 1}, - {L"xrange",L"Set range for x-axis",L"xrange Dat [add] | x1 x2", mgls_xrange, mglc_xrange, false, 2}, - {L"xtick",L"Set ticks for x-axis",L"xtick dx [sx tx] | 'tmpl'", mgls_xtick, mglc_xtick, false, 2}, - {L"ylabel",L"Draw label for y-axis",L"ylabel 'txt' [pos size shift]", mgls_ylabel, mglc_ylabel, false, 1}, - {L"yrange",L"Set range for y-axis",L"yrange Dat [add] | y1 y2", mgls_yrange, mglc_yrange, false, 2}, - {L"ytick",L"Set ticks for y-axis",L"ytick dy [sy ty] | 'tmpl'", mgls_ytick, mglc_ytick, false, 2}, - {L"zlabel",L"Draw label for z-axis",L"zlabel 'txt' [pos size shift]", mgls_zlabel, mglc_zlabel, false, 1}, - {L"zoom",L"Zoom in/out plot",L"zoom x1 y1 x2 y2", mgls_zoom, mglc_zoom, false, 5}, - {L"zrange",L"Set range for z-axis",L"yrange Dat [add] | z1 z2", mgls_zrange, mglc_zrange, false, 2}, - {L"ztick",L"Set ticks for z-axis",L"ztick dz [sz tz] | 'tmpl'", mgls_ztick, mglc_ztick, false, 2}, -{L"",0,0,0,0,0,0}}; -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_f.cpp b/mgl/mgl_f.cpp deleted file mode 100644 index e2cc35b..0000000 --- a/mgl/mgl_f.cpp +++ /dev/null @@ -1,640 +0,0 @@ -/*************************************************************************** - * mgl_f.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 "mgl/mgl_f.h" -#include "mgl/mgl.h" -#include "mgl/mgl_ab.h" -//----------------------------------------------------------------------------- -/// Delete mglGraph object. MUST be called for each mgl_create_* call. -void mgl_delete_graph_(uintptr_t *gr) -{ if(*gr) delete (mglGraph *)(*gr); } -//----------------------------------------------------------------------------- -/// Create mglData object. -uintptr_t mgl_create_data_() -{ return uintptr_t(new mglData()); }; -/// Create mglData object with specified sizes. -uintptr_t mgl_create_data_size_(int *nx, int *ny, int *nz) -{ return uintptr_t(new mglData(*nx,*ny,*nz)); }; -/// Create mglData object from data file. -uintptr_t mgl_create_data_file_(const char *fname,int l) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; - uintptr_t r = uintptr_t(new mglData(s)); delete []s; - return r; -} -/// Delete mglData object. MUST be called for each mgl_create_data_* call. -void mgl_delete_data_(uintptr_t *dat) -{ if(*dat) delete (mglData *)(*dat); }; -//----------------------------------------------------------------------------- -// Setup mglGraph -//----------------------------------------------------------------------------- -/// Set color in mglGraph::Pal array at index \a n. -void mgl_set_palette_(uintptr_t *gr, const char *colors, int l) -{ - char *s=new char[l+1]; memcpy(s,colors,l); s[l]=0; - if(gr) _GR_->SetPalette(s); - delete []s; -} -/// Set color in mglGraph::Pal array at index \a n. -void mgl_set_pal_color_(uintptr_t *gr, int *n, mreal *r, mreal *g, mreal *b) -{ if(gr && *n<100) _GR_->Pal[*n] = mglColor(*r,*g,*b); } -/// Set number of colors in mglGraph::Pal array. -void mgl_set_pal_num_(uintptr_t *gr, int *num) -{ if(gr && *num<100) _GR_->NumPal = *num; } -/// Set mglGraph::RotatedText. -void mgl_set_rotated_text_(uintptr_t *gr, int *rotated) -{ _GR_->RotatedText = *rotated; } -/// Set mglGraph::Cut. -void mgl_set_cut_(uintptr_t *gr, int *cut) -{ _GR_->Cut = *cut; } -/// Set mglGraph::CutMin, mglGraph::CutMax. -void mgl_set_cut_box_(uintptr_t *gr, mreal *x1,mreal *y1,mreal *z1,mreal *x2,mreal *y2,mreal *z2) -{ _GR_->CutMin = mglPoint(*x1,*y1,*z1); _GR_->CutMax = mglPoint(*x2,*y2,*z2); } -/// Set type of transparency mglGraph::TranspType. -void mgl_set_transp_type_(uintptr_t *gr, int *type) -{ _GR_->TranspType = *type; } -/// Switch on/off transparency mglGraph::Transparent. -void mgl_set_transp_(uintptr_t *gr, int *enable) -{ _GR_->Transparent = *enable; } -/// Set width of rectangles in mglGraph::Bars(). -void mgl_set_bar_width_(uintptr_t *gr, mreal *width) -{ _GR_->BarWidth = *width; } -/// Set size of marks mglGraph::BaseLineWidth. -void mgl_set_base_line_width_(uintptr_t *gr, mreal *size) -{ _GR_->BaseLineWidth = *size; } -/// Set size of marks mglGraph::MarkSize. -void mgl_set_mark_size_(uintptr_t *gr, mreal *size) -{ _GR_->MarkSize = *size; } -/// Set size of arrows mglGraph::ArrowSize. -void mgl_set_arrow_size_(uintptr_t *gr, mreal *size) -{ _GR_->ArrowSize = *size; } -/// Set default font size mglGraph::FontSize. -void mgl_set_font_size_(uintptr_t *gr, mreal *size) -{ _GR_->FontSize = *size; } -/// Set default alpha value mglGraph::AlphaDef. -void mgl_set_alpha_default_(uintptr_t *gr, mreal *alpha) -{ _GR_->AlphaDef = *alpha; } -/// Set size of frame in pixels. Normally this function is called internaly. -void mgl_set_size_(uintptr_t *gr, int *width, int *height) -{ _GR_->SetSize(*width,*height); } -void mgl_set_axial_dir_(uintptr_t *gr, const char *dir, int) -{ _GR_->AxialDir = *dir; } -void mgl_set_meshnum_(uintptr_t *gr, int *num) -{ _GR_->MeshNum = *num; } -void mgl_set_draw_face_(uintptr_t *gr, int *enable) -{ _GR_->DrawFace = *enable; } -void mgl_set_scheme_(uintptr_t *gr, char *sch, int l) -{ - char *s; - if(sch && sch[0]) - { s=new char[l+1]; memcpy(s,sch,l); s[l]=0; } - else - { s=new char[7]; strcpy(s,"BbcyrR"); } - _GR_->SetScheme(s); delete []s; -} -/// Set font facename -void mgl_load_font_(uintptr_t *gr, char *name, char *path, int l,int n) -{ - char *s=new char[l+1]; memcpy(s,name,l); s[l]=0; - char *d=new char[n+1]; memcpy(d,path,n); d[n]=0; - _GR_->GetFont()->Load(s,d); delete []s; delete []d; -} -/// Copy font data from another HMGL object -void mgl_copy_font_(uintptr_t *gr, uintptr_t *gr_from) -{ _GR_->GetFont()->Copy(((mglGraph *)(*gr_from))->GetFont()); } -/// Restore font data -void mgl_restore_font_(uintptr_t *gr) -{ _GR_->GetFont()->Restore(); } -//----------------------------------------------------------------------------- -// Export to file -//----------------------------------------------------------------------------- -/// Write the frame in file using PostScript format -void mgl_write_eps_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; - char *d=new char[n+1]; memcpy(d,descr,n); d[n]=0; - _GR_->WriteEPS(s,d); delete []s; delete []d; -} -/// Write the frame in file using ScalableVectorGraphics format -void mgl_write_svg_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; - char *d=new char[n+1]; memcpy(d,descr,n); d[n]=0; - _GR_->WriteSVG(s,d); delete []s; delete []d; -} -void mgl_show_image_(uintptr_t *gr, const char *viewer, int *keep, int l) -{ - char *s=new char[l+1]; memcpy(s,viewer,l); s[l]=0; - _GR_->ShowImage(s,*keep); delete []s; -} -//----------------------------------------------------------------------------- -// Setup frames transparency (alpha) and lightning -//----------------------------------------------------------------------------- -/// Create new frame. -int mgl_new_frame_(uintptr_t *gr) -{ return _GR_->NewFrame(); } -/// Finish frame drawing -void mgl_end_frame_(uintptr_t *gr) -{ _GR_->EndFrame(); } -/// Get the number of created frames -int mgl_get_num_frame_(uintptr_t *gr) -{ return _GR_->GetNumFrame(); } -/// Reset frames counter -void mgl_reset_frames_(uintptr_t *gr) -{ _GR_->ResetFrames(); } -/// Set the transparency on/off. -void mgl_set_alpha_(uintptr_t *gr, int *enable) -{ _GR_->Alpha(*enable); } -/// Set the fog on/off. -void mgl_set_fog_(uintptr_t *gr, mreal *d, mreal *dz) -{ _GR_->Fog(*d, *dz); } -/// Set the using of light on/off. -void mgl_set_light_(uintptr_t *gr, int *enable) -{ _GR_->Light(*enable); } -void mgl_set_light_n_(uintptr_t *gr, int *n, int *enable) -{ _GR_->Light(*n, *enable); } -/// Add white light source. -void mgl_add_light_(uintptr_t *gr, int *n, mreal *x, mreal *y, mreal *z, char *c, int) -{ _GR_->Light(*n,mglPoint(*x,*y,*z),*c); } -/// Add a light source with color {r,g,b}. -void mgl_add_light_rgb_(uintptr_t *gr, int *n, mreal *x, mreal *y, mreal *z, int *infty, - mreal *r, mreal *g, mreal *b,mreal *i) -{ _GR_->Light(*n,mglPoint(*x,*y,*z),mglColor(*r,*g,*b),*i,*infty); } -// Set ambient light brightness -void mgl_set_ambbr_(uintptr_t *gr, mreal *i) -{ _GR_->Ambient(*i); } -//----------------------------------------------------------------------------- -// Scale and rotate -//----------------------------------------------------------------------------- -/// Push transformation matrix into stack. -void mgl_mat_push_(uintptr_t *gr) { _GR_->Push(); } -/// Pop transformation matrix into stack. -void mgl_mat_pop_(uintptr_t *gr) { _GR_->Pop(); } -/// Clear transformation matrix. -void mgl_identity_(uintptr_t *gr, int *rel) { _GR_->Identity(*rel); } -/// Clear up the frame -void mgl_clf_(uintptr_t *gr) -{ _GR_->Clf(); } -/// Clear up the frame -void mgl_clf_rgb_(uintptr_t *gr, mreal *r, mreal *g, mreal *b) -{ _GR_->Clf(mglColor(*r,*g,*b)); } -/// Put further plotting in some region of whole frame surface. -void mgl_subplot_(uintptr_t *gr, int *nx,int *ny,int *m) -{ _GR_->SubPlot(*nx,*ny,*m); } -void mgl_subplot_d_(uintptr_t *gr, int *nx,int *ny,int *m,mreal *dx,mreal *dy) -{ _GR_->SubPlot(*nx,*ny,*m,*dx,*dy); } -void mgl_subplot_s_(uintptr_t *gr, int *nx,int *ny,int *m,const char *st,int l) -{ char *s=new char[l+1]; memcpy(s,st,l); s[l]=0; - _GR_->SubPlot(*nx,*ny,*m,s); delete []s; } -/// Put further plotting in some region of whole frame surface. -void mgl_inplot_(uintptr_t *gr, mreal *x1,mreal *x2,mreal *y1,mreal *y2) -{ _GR_->InPlot(*x1,*x2,*y1,*y2,false); } -void mgl_relplot_(uintptr_t *gr, mreal *x1,mreal *x2,mreal *y1,mreal *y2) -{ _GR_->InPlot(*x1,*x2,*y1,*y2,true); } -void mgl_columnplot_(uintptr_t *gr, int *num, int *i) -{ _GR_->ColumnPlot(*num,*i); } -void mgl_columnplot_d_(uintptr_t *gr, int *num, int *i, mreal *d) -{ _GR_->ColumnPlot(*num,*i,*d); } -void mgl_stickplot_(uintptr_t *gr, int *num, int *i, mreal *tet, mreal *phi) -{ _GR_->StickPlot(*num, *i, *tet, *phi); } -/// Set aspect ratio for further plotting. -void mgl_aspect_(uintptr_t *gr, mreal *Ax,mreal *Ay,mreal *Az) -{ _GR_->Aspect(*Ax,*Ay,*Az); } -/// Rotate a further plotting. -void mgl_rotate_(uintptr_t *gr, mreal *TetX,mreal *TetZ,mreal *TetY) -{ _GR_->Rotate(*TetX,*TetZ,*TetY); } -/// Rotate a further plotting around vector {x,y,z}. -void mgl_rotate_vector_(uintptr_t *gr, mreal *Tet,mreal *x,mreal *y,mreal *z) -{ _GR_->RotateN(*Tet,*x,*y,*z); } -void mgl_perspective_(uintptr_t *gr, mreal val) -{ _GR_->Perspective(val); } -//----------------------------------------------------------------------------- -// Axis functions -//----------------------------------------------------------------------------- -/// Auto adjust ticks -void mgl_adjust_ticks_(uintptr_t *gr, const char *dir, int l) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - _GR_->AdjustTicks(s); delete []s; -} -/// Switch on/off ticks tunning and set factor position for tunned ticks. -void mgl_tune_ticks_(uintptr_t *gr, int *tune, mreal *fact_pos) -{ _GR_->TuneTicks = *tune; _GR_->FactorPos = *fact_pos; } -void mgl_set_ticks_dir_(uintptr_t *gr, char *dir, mreal *d, int *ns, mreal *org) -{ _GR_->SetTicks(*dir, *d, *ns, *org); } -/// Set ticks interval mglGraph::dx, mglGraph::dy, mglGraph::dz. -void mgl_set_ticks_(uintptr_t *gr, mreal *DX, mreal *DY, mreal *DZ) -{ _GR_->dx=*DX; _GR_->dy=*DY; _GR_->dz=*DZ; } -/// Set number of subticks mglGraph::NSx, mglGraph::NSy, mglGraph::NSz. -void mgl_set_subticks_(uintptr_t *gr, int *NX, int *NY, int *NZ) -{ _GR_->NSx=*NX; _GR_->NSy=*NY; _GR_->NSz=*NZ; } -/// Set the values of mglGraph::Cmin and mglGraph::Cmax -void mgl_set_caxis_(uintptr_t *gr, mreal *C1,mreal *C2) -{ _GR_->CAxis(*C1,*C2); } -void mgl_set_crange_(uintptr_t *gr, uintptr_t *a, int *add) { _GR_->CRange(_D_(a),*add); } -void mgl_set_xrange_(uintptr_t *gr, uintptr_t *a, int *add) { _GR_->XRange(_D_(a),*add); } -void mgl_set_yrange_(uintptr_t *gr, uintptr_t *a, int *add) { _GR_->YRange(_D_(a),*add); } -void mgl_set_zrange_(uintptr_t *gr, uintptr_t *a, int *add) { _GR_->ZRange(_D_(a),*add); } -/// Safetly set the value for mglGraph::Min, mglGraph::Max and mglGraph::Org members of the class. -void mgl_set_axis_(uintptr_t *gr, mreal *x1, mreal *y1, mreal *z1, mreal *x2, mreal *y2, mreal *z2, mreal *x0, mreal *y0, mreal *z0) -{ _GR_->Axis(mglPoint(*x1,*y1,*z1),mglPoint(*x2,*y2,*z2),mglPoint(*x0,*y0,*z0)); } -/// Safetly set the transformation formulas for coordinate. -void mgl_set_func_(uintptr_t *gr, const char *EqX,const char *EqY,const char *EqZ,int lx,int ly,int lz) -{ - char *sx=new char[lx+1]; memcpy(sx,EqX,lx); sx[lx]=0; - char *sy=new char[ly+1]; memcpy(sy,EqY,ly); sy[ly]=0; - char *sz=new char[lz+1]; memcpy(sz,EqZ,lz); sz[lz]=0; - _GR_->SetFunc(sx,sy,sz); - delete []sx; delete []sy; delete []sz; -} -void mgl_set_func_ext_(uintptr_t *gr, const char *EqX,const char *EqY,const char *EqZ,const char *EqA,int lx,int ly,int lz,int la) -{ - char *sx=new char[lx+1]; memcpy(sx,EqX,lx); sx[lx]=0; - char *sy=new char[ly+1]; memcpy(sy,EqY,ly); sy[ly]=0; - char *sz=new char[lz+1]; memcpy(sz,EqZ,lz); sz[lz]=0; - char *sa=new char[la+1]; memcpy(sa,EqA,la); sa[la]=0; - _GR_->SetFunc(sx,sy,sz,sa); - delete []sx; delete []sy; delete []sz; delete []sa; -} -/// Set predefined coordinate system -void mgl_set_coor_(uintptr_t *gr, int *how) -{ _GR_->SetCoor(*how); } -void mgl_set_cutoff_(uintptr_t *gr, const char *EqC, int l) -{ - char *s=new char[l+1]; memcpy(s,EqC,l); s[l]=0; - _GR_->CutOff(s); - delete []s; -} -/// Draws bounding box outside the plotting volume by default color. -void mgl_box_(uintptr_t *gr, int *ticks) -{ _GR_->Box(NC,*ticks); } -/// Draws bounding box outside the plotting volume with color \a c. -void mgl_box_str_(uintptr_t *gr, const char *col, int *ticks,int l) -{ - char *s=new char[l+1]; memcpy(s,col,l); s[l]=0; - _GR_->Box(s,*ticks); delete []s; -} -/// Draws bounding box outside the plotting volume. -void mgl_box_rgb_(uintptr_t *gr, mreal *r, mreal *g, mreal *b, int *ticks) -{ _GR_->Box(mglColor(*r,*g,*b),*ticks); } -/// Draw axises with ticks in directions determined by string parameter \a dir. -void mgl_axis_(uintptr_t *gr, const char *dir,int l) -{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; _GR_->Axis(s); delete []s; } -/// Draw grid lines perpendicular to direction determined by string parameter \a dir. -void mgl_axis_grid_(uintptr_t *gr, const char *dir,const char *pen,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; - char *p=new char[n+1]; memcpy(p,pen,n); p[n]=0; - _GR_->Grid(s,p); delete []s; delete []p; -} -/// Print the label \a text for axis \a dir. -void mgl_label_(uintptr_t *gr, const char *dir, const char *text,int,int l) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - _GR_->Label(*dir, s); delete []s; -} -/// Print the label \a text for axis \a dir. -void mgl_label_ext_(uintptr_t *gr, const char *dir, const char *text, mreal *pos, mreal *size, mreal *shift,int,int l) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - _GR_->Label(*dir, s, *pos, *size, *shift); delete []s; -} -void mgl_label_xy_(uintptr_t *gr, mreal *x, mreal *y, const char *txt, const char *fnt, mreal *size,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,txt,l); s[l]=0; - char *p=new char[n+1]; memcpy(p,fnt,n); p[n]=0; - _GR_->Label(*x,*y,s,p,*size); delete []s; delete []p; -} -void mgl_set_xtt_(uintptr_t * gr, const char *templ, int l) -{ - char *s=new char[l+1]; memcpy(s,templ,l); s[l]=0; - _GR_->SetXTT(s); delete []s; -} -void mgl_set_ytt_(uintptr_t * gr, const char *templ, int l) -{ - char *s=new char[l+1]; memcpy(s,templ,l); s[l]=0; - _GR_->SetYTT(s); delete []s; -} -void mgl_set_ztt_(uintptr_t * gr, const char *templ, int l) -{ - char *s=new char[l+1]; memcpy(s,templ,l); s[l]=0; - _GR_->SetZTT(s); delete []s; -} -void mgl_set_ctt_(uintptr_t * gr, const char *templ, int l) -{ - char *s=new char[l+1]; memcpy(s,templ,l); s[l]=0; - _GR_->SetCTT(s); delete []s; -} -//----------------------------------------------------------------------------- -// Simple drawing -//----------------------------------------------------------------------------- -/// Draws the red point (ball) at position \a {x,y,z}. -void mgl_ball_(uintptr_t *gr, mreal *x,mreal *y,mreal *z) -{ _GR_->Ball(mglPoint(*x,*y,*z)); } -/// Draws the point (ball) at position \a {x,y,z} with color {r,g,b}. -void mgl_ball_rgb_(uintptr_t *gr, mreal *x, mreal *y, mreal *z, mreal *r, mreal *g, mreal *b, mreal *alpha) -{ _GR_->Ball(*x,*y,*z,mglColor(*r,*g,*b),*alpha); } -/// Draws the point (ball) at position \a p with color \a col. -void mgl_ball_str_(uintptr_t *gr, mreal *x, mreal *y, mreal *z, const char *col,int) -{ _GR_->Ball(mglPoint(*x,*y,*z),*col); } -/// Draws the line between points with style \a sch. -void mgl_line_(uintptr_t *gr, mreal *x1, mreal *y1, mreal *z1, mreal *x2, mreal *y2, mreal *z2, - const char *pen,int *n,int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - _GR_->Line(mglPoint(*x1,*y1,*z1),mglPoint(*x2,*y2,*z2),s,*n); delete []s; -} -void mgl_facex_(uintptr_t* gr, mreal *x0, mreal *y0, mreal *z0, mreal *wy, mreal *wz, const char *stl, mreal *dx, mreal *dy, int l) -{ - char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; - _GR_->FaceX(*x0,*y0,*z0,*wy,*wz,s,*dx,*dy); delete []s; -} -void mgl_facey_(uintptr_t* gr, mreal *x0, mreal *y0, mreal *z0, mreal *wx, mreal *wz, const char *stl, mreal *dx, mreal *dy, int l) -{ - char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; - _GR_->FaceX(*x0,*y0,*z0,*wx,*wz,s,*dx,*dy); delete []s; -} -void mgl_facez_(uintptr_t* gr, mreal *x0, mreal *y0, mreal *z0, mreal *wx, mreal *wy, const char *stl, mreal *dx, mreal *dy, int l) -{ - char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; - _GR_->FaceX(*x0,*y0,*z0,*wx,*wy,s,*dx,*dy); delete []s; -} -void mgl_curve_(uintptr_t* gr, mreal *x1, mreal *y1, mreal *z1, mreal *dx1, mreal *dy1, mreal *dz1, mreal *x2, mreal *y2, mreal *z2, mreal *dx2, mreal *dy2, mreal *dz2, const char *pen,int *n, int l) -{ - char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; - _GR_->Curve(mglPoint(*x1,*y1,*z1), mglPoint(*dx1,*dy1,*dz1), mglPoint(*x2,*y2,*z2), mglPoint(*dx2,*dy2,*dz2), s, *n); delete []s; -} - -/// Print string \a str in position \a p with font size \a size. -void mgl_puts_(uintptr_t *gr, mreal *x, mreal *y, mreal *z,const char *text,int l) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - _GR_->Puts(mglPoint(*x,*y,*z),s); delete []s; -} -/// Print string \a str in position \a p auintptr_t direction \a d with font size \a size. -void mgl_puts_dir_(uintptr_t *gr, mreal *x, mreal *y, mreal *z, mreal *dx, mreal *dy, mreal *dz, const char *text, mreal *size, int l) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - _GR_->Puts(mglPoint(*x,*y,*z), mglPoint(*dx,*dy,*dz), s, 't', *size); - delete []s; -} -/// Print unrotated string \a str in position \a p with font size \a size. -void mgl_text_(uintptr_t *gr, mreal *x, mreal *y, mreal *z,const char *text,int l) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - _GR_->Text(mglPoint(*x,*y,*z),s); delete []s; -} -/// Print string \a str in position \a p with font size \a size. -void mgl_puts_ext_(uintptr_t *gr, mreal *x, mreal *y, mreal *z,const char *text, - const char *font, mreal *size, const char *dir,int l,int n,int) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - char *f=new char[n+1]; memcpy(f,font,n); f[n]=0; - _GR_->Puts(mglPoint(*x,*y,*z),s,f,*size,*dir); delete []s; delete []f; -} -/// Print unrotated string \a str in position \a p with font size \a size. -void mgl_text_ext_(uintptr_t *gr, mreal *x, mreal *y, mreal *z,const char *text, - const char *font, mreal *size,const char *dir,int l,int n,int) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - char *f=new char[n+1]; memcpy(f,font,n); f[n]=0; - _GR_->Text(mglPoint(*x,*y,*z),s,f,*size,*dir); delete []s; delete []f; -} -/// Draw colorbar at edge of axis -void mgl_colorbar_(uintptr_t *gr, const char *sch,int *where,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - _GR_->Colorbar(s,*where); delete []s; -} -void mgl_colorbar_val_(uintptr_t *gr, uintptr_t *v, const char *sch,int *where,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - _GR_->Colorbar(_D_(v), s,*where); delete []s; -} -void mgl_colorbar_ext_(uintptr_t *gr, const char *sch,int *where, mreal *x, mreal *y, mreal *w, mreal *h, int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - _GR_->Colorbar(s,*where,*x,*y,*w,*h); delete []s; -} -/// Plot data depending on its dimensions and \a type parameter -void mgl_simple_plot_(uintptr_t *gr, uintptr_t *a, int *type, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a) _GR_->SimplePlot(_D_(a),*type,s); - delete []s; -} -//----------------------------------------------------------------------------- -// Plot legend drawing -//----------------------------------------------------------------------------- -/// Add string to legend -void mgl_add_legend_(uintptr_t *gr, const char *text,const char *style,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - char *f=new char[n+1]; memcpy(f,style,n); f[n]=0; - if(gr) _GR_->AddLegend(s,f); delete []s; delete []f; -} -/// Clear saved legend string -void mgl_clear_legend_(uintptr_t *gr) -{ if(gr) _GR_->ClearLegend(); } -/// Draw legend of accumulated strings at position (x, y) by \a font with \a size -void mgl_legend_xy_(uintptr_t *gr, mreal *x, mreal *y, const char *font, mreal *size, mreal *llen,int l) -{ - char *s=new char[l+1]; memcpy(s,font,l); s[l]=0; - if(gr) _GR_->Legend(*x, *y, s, *size,*llen); delete []s; -} -/// Draw legend of accumulated strings by \a font with \a size -void mgl_legend_(uintptr_t *gr, int *where, const char *font, mreal *size, mreal *llen,int l) -{ - char *s=new char[l+1]; memcpy(s,font,l); s[l]=0; - if(gr) _GR_->Legend(*where, s, *size,*llen); delete []s; -} -void mgl_set_legend_box_(uintptr_t *gr, int *enable) -{ _GR_->LegendBox = *enable; } -void mgl_set_legend_marks_(uintptr_t *gr, int *num) -{ _GR_->SetLegendMarks(*num); } -//----------------------------------------------------------------------------- -const unsigned char *mgl_get_rgb_(uintptr_t *graph) -{ - mglGraphAB *g = dynamic_cast((mglGraph *)(*graph)); - return g ? g->GetBits():0; -} -const unsigned char *mgl_get_rgba_(uintptr_t *graph) -{ - mglGraphAB *g = dynamic_cast((mglGraph *)(*graph)); - return g ? g->GetRGBA():0; -} -int mgl_get_width_(uintptr_t *graph) -{ - mglGraphAB *g = dynamic_cast((mglGraph *)(*graph)); - return g ? g->GetWidth():0; -} -int mgl_get_height_(uintptr_t *graph) -{ - mglGraphAB *g = dynamic_cast((mglGraph *)(*graph)); - return g ? g->GetHeight():0; -} -void mgl_set_show_mouse_pos_(uintptr_t *gr, int *enable) -{ - mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->ShowMousePos=*enable; -} -void mgl_get_last_mouse_pos_(uintptr_t *gr, mreal *x, mreal *y, mreal *z) -{ - mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) - { *x=g->LastMousePos.x; *y=g->LastMousePos.y; *z=g->LastMousePos.z;} -} -void mgl_calc_xyz_(uintptr_t *gr, int *xs, int *ys, mreal *x, mreal *y, mreal *z) -{ - mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) - { - mglPoint p = g->CalcXYZ(*xs,*ys); - *x = p.x; *y = p.y; *z = p.z; - } -} -void mgl_calc_scr_(uintptr_t *gr, mreal *x, mreal *y, mreal *z, int *xs, int *ys) -{ - mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->CalcScr(mglPoint(*x,*y,*z),xs,ys); -} -//----------------------------------------------------------------------------- -void mgl_wnd_set_delay_(uintptr_t *gr, mreal *dt) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->Delay = *dt; } -void mgl_wnd_set_auto_clf_(uintptr_t *gr, int *val) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->AutoClf = *val; } -void mgl_wnd_set_show_mouse_pos_(uintptr_t *gr, int *val) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->ShowMousePos = *val; } -void mgl_wnd_set_clf_update_(uintptr_t *gr, int *val) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->ClfOnUpdate = *val; } -void mgl_wnd_toggle_alpha_(uintptr_t *gr) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->ToggleAlpha(); } -void mgl_wnd_toggle_light_(uintptr_t *gr) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->ToggleLight(); } -void mgl_wnd_toggle_zoom_(uintptr_t *gr) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->ToggleZoom(); } -void mgl_wnd_toggle_rotate_(uintptr_t *gr) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->ToggleRotate(); } -void mgl_wnd_toggle_no_(uintptr_t *gr) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->ToggleNo(); } -void mgl_wnd_update_(uintptr_t *gr) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->Update(); } -void mgl_wnd_reload_(uintptr_t *gr, int *o) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->ReLoad(*o); } -void mgl_wnd_adjust_(uintptr_t *gr) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->Adjust(); } -void mgl_wnd_next_frame_(uintptr_t *gr) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->NextFrame(); } -void mgl_wnd_prev_frame_(uintptr_t *gr) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->PrevFrame(); } -void mgl_wnd_animation_(uintptr_t *gr) -{ mglGraphAB *g = dynamic_cast((mglGraph *)(*gr)); - if(g) g->Animation(); } -//----------------------------------------------------------------------------- -mreal mgl_data_get_value_(uintptr_t *d, int *i, int *j, int *k) -{ return _DT_->a[*i+_DT_->nx*(*j+*k*_DT_->ny)]; } -void mgl_data_set_value_(uintptr_t *d, mreal *v, int *i, int *j, int *k) -{ _DT_->a[*i+_DT_->nx*(*j+*k*_DT_->ny)] = *v; } -//----------------------------------------------------------------------------- -/// Zoom in/out a part of picture -void mgl_set_zoom_(uintptr_t *gr, mreal *x1, mreal *y1, mreal *x2, mreal *y2) -{ _GR_->Zoom(*x1,*y1,*x2,*y2); } -void mgl_set_plotfactor_(uintptr_t *gr, mreal *val) -{ - if(*val>0) { _GR_->PlotFactor = *val; _GR_->AutoPlotFactor=false; } - else { _GR_->PlotFactor = 1.55f; _GR_->AutoPlotFactor=true; } -} -void mgl_set_axis_3d_(uintptr_t *gr, mreal *x1, mreal *y1, mreal *z1, mreal *x2, mreal *y2, mreal *z2) -{ _GR_->Axis(mglPoint(*x1,*y1,*z1),mglPoint(*x2,*y2,*z2)); } -void mgl_set_axis_2d_(uintptr_t *gr, mreal *x1, mreal *y1, mreal *x2, mreal *y2) -{ _GR_->Axis(mglPoint(*x1,*y1),mglPoint(*x2,*y2)); } -void mgl_set_origin_(uintptr_t *gr, mreal *x0, mreal *y0, mreal *z0) -{ _GR_->Org = mglPoint(*x0,*y0,*z0); } -void mgl_set_tick_origin_(uintptr_t *gr, mreal *x0, mreal *y0, mreal *z0) -{ _GR_->OrgT = mglPoint(*x0,*y0,*z0); } -//----------------------------------------------------------------------------- -void mgl_title_(uintptr_t *gr, const char *text, const char *fnt, mreal *size,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; - char *f=new char[n+1]; memcpy(f,fnt,n); f[n]=0; - if(gr) _GR_->Title(s,f, *size); - delete []s; delete []f; -} -//----------------------------------------------------------------------------- -void mgl_set_ternary_(uintptr_t *gr, int *enable) -{ _GR_->Ternary(*enable); } -void mgl_sphere_(uintptr_t* gr, mreal *x, mreal *y, mreal *z, mreal *r, const char *stl,int l) -{ - char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; - _GR_->Sphere(mglPoint(*x,*y,*z),*r,s); delete []s; -} -void mgl_drop_(uintptr_t* gr, mreal *x1, mreal *y1, mreal *z1, mreal *x2, mreal *y2, mreal *z2, mreal *r, const char *stl, mreal *shift, mreal *ap, int l) -{ - char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; - _GR_->Drop(mglPoint(*x1,*y1,*z1),mglPoint(*x2,*y2,*z2),*r,s,*shift,*ap); - delete []s; -} -void mgl_cone_(uintptr_t* gr, mreal *x1, mreal *y1, mreal *z1, mreal *x2, mreal *y2, mreal *z2, mreal *r1, mreal *r2, const char *stl, int *edge, int l) -{ - char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; - _GR_->Cone(mglPoint(*x1,*y1,*z1),mglPoint(*x2,*y2,*z2),*r1,*r2,s,*edge); - delete []s; -} -//----------------------------------------------------------------------------- -void mgl_set_def_param_(uintptr_t* gr) { _GR_->DefaultPlotParam(); } -void mgl_set_font_def_(uintptr_t *gr, const char *fnt, int l) -{ l=l<31?l:31; memcpy(_GR_->FontDef, fnt,l); _GR_->FontDef[l]=0; } -void mgl_flush_(uintptr_t *gr) { _GR_->Flush(); } -void mgl_data_fill_eq_(uintptr_t *gr, uintptr_t *d, const char *eq, uintptr_t *vdat, uintptr_t *wdat, int l) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - _DT_->Fill(s,_GR_->Min,_GR_->Max,((mglData *)*vdat),((mglData *)*wdat)); - delete []s; -} -//----------------------------------------------------------------------------- -void mgl_set_auto_(uintptr_t *gr, mreal *x1, mreal *x2, mreal *y1, mreal *y2, mreal *z1, mreal *z2) -{ - _GR_->SetAutoRanges(*x1,*x2,*y1,*y2,*z1,*z2); -} -void mgl_set_tick_len_(uintptr_t *gr, mreal *len, mreal *stt) -{ _GR_->SetTickLen(*len, *stt); } -void mgl_set_tick_stl_(uintptr_t *gr, const char *stl, const char *sub, int l, int m) -{ - char *t=new char[l+1]; memcpy(t,stl,l); t[l]=0; - char *s=new char[m+1]; memcpy(s,sub,m); s[m]=0; - _GR_->SetTickStl(t,s); - delete []s; delete []t; -} -int mgl_get_warn_(uintptr_t *gr) { return _GR_->WarnCode; } -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_fit.cpp b/mgl/mgl_fit.cpp deleted file mode 100644 index 3aced3e..0000000 --- a/mgl/mgl_fit.cpp +++ /dev/null @@ -1,568 +0,0 @@ -/*************************************************************************** - * mgl_fit.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#ifndef NO_GSL -#include -#include -#endif -#include -#include "mgl/mgl_eval.h" -#include "mgl/mgl.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -//----------------------------------------------------------------------------- -/// Structure for keeping data and precompiled fitted formula -struct mglFitData -{ - long n; ///< number of points - mreal *x; ///< x values - mreal *y; ///< y values - mreal *z; ///< z values - mreal *a; ///< function values - mreal *s; ///< value dispersions (sigma) - mglFormula *eq; ///< approximation formula - int m; ///< number of variables - const char *var; ///< variables for fitting -}; -//----------------------------------------------------------------------------- -#ifndef NO_GSL -int mgl_fit__f (const gsl_vector *x, void *data, gsl_vector *f) -{ - mglFitData *fd = (mglFitData *)data; - register long i; - mreal val[MGL_VS]; - for(i=0;im;i++) val[fd->var[i]-'a'] = gsl_vector_get(x,i); - for(i=0;in;i++) - { - val['x'-'a'] = fd->x[i]; - val['y'-'a'] = fd->y ? fd->y[i] : 0; - val['z'-'a'] = fd->z ? fd->z[i] : 0; - gsl_vector_set (f, i, (fd->eq->Calc(val) - fd->a[i])/fd->s[i]); - } - return GSL_SUCCESS; -} -//----------------------------------------------------------------------------- -int mgl_fit__df (const gsl_vector * x, void *data, gsl_matrix * J) -{ - mglFitData *fd = (mglFitData *)data; - register long i,j; - mreal val[MGL_VS],s; - for(i=0;im;i++) val[fd->var[i]-'a'] = gsl_vector_get(x,i); - for(i=0;in;i++) - { - val['x'-'a'] = fd->x[i]; s = fd->s[i]; - val['y'-'a'] = fd->y ? fd->y[i] : 0; - val['z'-'a'] = fd->z ? fd->z[i] : 0; - for(j=0;jm;j++) - gsl_matrix_set (J, i, j, fd->eq->CalcD(val, fd->var[j])/s); - } - return GSL_SUCCESS; -} -//----------------------------------------------------------------------------- -int mgl_fit__fdf (const gsl_vector * x, void *data, gsl_vector * f, gsl_matrix * J) -{ - mgl_fit__f(x, data, f); - mgl_fit__df(x, data, J); - return GSL_SUCCESS; -} -#endif -//----------------------------------------------------------------------------- -/// GSL based fitting procedure for formula/arguments specified by string -mreal mgl_fit_base(mglFitData *fd, mreal *ini) -{ -#ifndef NO_GSL - register long i,m=fd->m,n=fd->n,iter=0; - if(n<1 || fd==0 || ini==0) return -1; - // setup data - double *x_init = new double[fd->m]; - for(i=0;idx, s->x, 1e-4, 1e-4 ); - } - while ( status == GSL_CONTINUE && iter < 500 ); - gsl_multifit_covar (s->J, 0.0, covar ); - mreal res = gsl_blas_dnrm2(s->f); - for(i=0;ix, i); - // free memory - gsl_multifit_fdfsolver_free (s); - gsl_matrix_free (covar); - delete []x_init; - return res; -#else - return 0.0; -#endif -} -//----------------------------------------------------------------------------- -mreal mglGraph::Fit(mglData &fit, const mglData &y, const char *eq, const char *var, mreal *ini, bool print) -{ - mglData x(y.nx); x.Fill(Min.x, Max.x); - mglData s(y); s.Fill(1,1); - return FitS(fit,x,y,s,eq,var,ini,print); -} -//----------------------------------------------------------------------------- -mreal mglGraph::Fit2(mglData &fit, const mglData &z, const char *eq, const char *var, mreal *ini, bool print) -{ - mglData x(z.nx); x.Fill(Min.x, Max.x); - mglData y(z.ny); y.Fill(Min.y, Max.y); - mglData s(z); s.Fill(1,1); - return FitS(fit,x,y,z,s,eq,var,ini,print); -} -//----------------------------------------------------------------------------- -mreal mglGraph::Fit3(mglData &fit, const mglData &a, const char *eq, const char *var, mreal *ini, bool print) -{ - mglData x(a.nx); x.Fill(Min.x, Max.x); - mglData y(a.ny); y.Fill(Min.y, Max.y); - mglData z(a.nz); z.Fill(Min.z, Max.z); - mglData s(a); s.Fill(1,1); - return FitS(fit,x,y,z,a,s,eq,var,ini,print); -} -//----------------------------------------------------------------------------- -mreal mglGraph::Fit(mglData &fit, const mglData &x, const mglData &y, const char *eq, const char *var, mreal *ini, bool print) -{ - mglData s(y); s.Fill(1,1); - return FitS(fit,x,y,s,eq,var,ini,print); -} -//----------------------------------------------------------------------------- -mreal mglGraph::Fit(mglData &fit, const mglData &x, const mglData &y, const mglData &z, const char *eq, const char *var, mreal *ini, bool print) -{ - mglData s(z); s.Fill(1,1); - return FitS(fit,x,y,z,s,eq,var,ini,print); -} -//----------------------------------------------------------------------------- -mreal mglGraph::Fit(mglData &fit, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *eq, const char *var, mreal *ini, bool print) -{ - mglData s(a); s.Fill(1,1); - return FitS(fit,x,y,z,a,s,eq,var,ini,print); -} -//----------------------------------------------------------------------------- -mreal mglGraph::FitS(mglData &fit, const mglData &y, const mglData &s, const char *eq, const char *var, mreal *ini, bool print) -{ - mglData x(y.nx); x.Fill(Min.x, Max.x); - return FitS(fit,x,y,s,eq,var,ini,print); -} - -//----------------------------------------------------------------------------- -mreal mglGraph::FitS(mglData &fit, const mglData &x, const mglData &y, const mglData &s, const char *eq, const char *var, mreal *ini, bool print) -{ - if(x.nx!=y.nx) { SetWarn(mglWarnDim,"Fit[S]"); return -1; } - if(y.nx<2) { SetWarn(mglWarnLow,"Fit[S]"); return -1; } - if(s.nx*s.ny*s.nz != y.nx*y.ny*y.nz) - { SetWarn(mglWarnDim,"FitS"); return -1; } - mglFitData fd; - fd.n = y.nx; fd.x = x.a; fd.y = 0; - fd.z = 0; fd.a = y.a; fd.s = s.a; - fd.var = var; fd.m = strlen(var); - fd.eq = new mglFormula(eq); - mglData in(fd.m); - if(fit.nxCalc(val); - } - if(ini) memcpy(ini,in.a,fd.m*sizeof(mreal)); - } - PrepareFitEq(res,eq,var,ini,print); - delete fd.eq; - return res; -} -//----------------------------------------------------------------------------- -mreal mglGraph::FitS(mglData &fit, const mglData &xx, const mglData &yy, const mglData &z, const mglData &s, const char *eq, const char *var, mreal *ini, bool print) -{ - if(xx.nx!=z.nx) { SetWarn(mglWarnDim,"Fit[S]"); return -1; } - if(s.nx*s.ny*s.nz != z.nx*z.ny*z.nz) - { SetWarn(mglWarnDim,"FitS"); return -1; } - if(yy.nx!=z.ny && (xx.ny!=z.ny || yy.nx!=z.nx || yy.ny!=z.ny)) - { SetWarn(mglWarnDim); return -1; } - if(z.nx<2|| z.ny<2) { SetWarn(mglWarnLow,"Fit[S]"); return -1; } - - mglData x(z.nx, z.ny), y(z.nx, z.ny); - register long i,j; - for(i=0;iCalc(val); - } - if(ini) memcpy(ini,in.a,fd.m*sizeof(mreal)); - } - PrepareFitEq(res, eq,var,ini,print); - delete fd.eq; - return res; -} -//----------------------------------------------------------------------------- -mreal mglGraph::FitS(mglData &fit, const mglData &xx, const mglData &yy, const mglData &zz, const mglData &a, const mglData &s, const char *eq, const char *var, mreal *ini, bool print) -{ - register long i,j,k,i0; - i = a.nx*a.ny*a.nz; - if(a.nx<2 || a.ny<2 || a.nz<2) { SetWarn(mglWarnLow,"Fit[S]"); return -1; } - if(s.nx*s.ny*s.nz != i) { SetWarn(mglWarnDim,"FitS"); return -1; } - bool both = xx.nx*xx.ny*xx.nz==i && yy.nx*yy.ny*yy.nz==i && zz.nx*zz.ny*zz.nz==i; - if(!(both || (xx.nx==a.nx && yy.nx==a.ny && zz.nx==a.nz))) - { SetWarn(mglWarnDim,"Fit[S]"); return -1; } - mglData x(a), y(a), z(a); - for(i=0;iCalc(val); - } - if(ini) memcpy(ini,in.a,fd.m*sizeof(mreal)); - - PrepareFitEq(res, eq,var,ini,print); - delete fd.eq; - return res; -} -//----------------------------------------------------------------------------- -mreal mglGraph::Fit(mglData &fit, const mglData &y, const char *eq, const char *var, mglData &ini, bool print) -{ - if(ini.nx=n1) continue; - res.a[j1] += a.a[i]; - } -} -//----------------------------------------------------------------------------- -void mglGraph::Hist(mglData &res, const mglData &x, const mglData &y, const mglData &a) -{ - int n1=res.nx, n2=res.ny, nn=a.nx*a.ny*a.nz; - if(n1=n1) continue; - j2 = int(n2*(y.a[i]-Min.y)/(Max.y-Min.y)); if(j2<0 || j2>=n2) continue; - res.a[j1+n1*j2] += a.a[i]; - } -} -//----------------------------------------------------------------------------- -void mglGraph::Hist(mglData &res, const mglData &x, const mglData &y, const mglData &z, const mglData &a) -{ - int n1=res.nx, n2=res.ny, n3=res.nz, nn=a.nx*a.ny*a.nz; - if(n1=n1) continue; - j2 = int(n2*(y.a[i]-Min.y)/(Max.y-Min.y)); if(j2<0 || j2>=n2) continue; - j3 = int(n3*(z.a[i]-Min.z)/(Max.z-Min.z)); if(j3<0 || j3>=n3) continue; - res.a[j1+n1*(j2+n2*j3)] += a.a[i]; - } -} -//----------------------------------------------------------------------------- -void mgl_hist_x(HMGL gr, HMDT res, const HMDT x, const HMDT a) -{ gr->Hist(*res, *x, *a); } -void mgl_hist_xy(HMGL gr, HMDT res, const HMDT x, const HMDT y, const HMDT a) -{ gr->Hist(*res, *x, *y, *a); } -void mgl_hist_xyz(HMGL gr, HMDT res, const HMDT x, const HMDT y, const HMDT z, const HMDT a) -{ gr->Hist(*res, *x, *y, *z, *a); } -void mgl_hist_x_(uintptr_t* gr, uintptr_t* res, uintptr_t* x, uintptr_t* a) -{ _GR_->Hist(_DM_(res), _D_(x), _D_(a)); } -void mgl_hist_xy_(uintptr_t* gr, uintptr_t* res, uintptr_t* x, uintptr_t* y, uintptr_t* a) -{ _GR_->Hist(_DM_(res), _D_(x), _D_(y), _D_(a)); } -void mgl_hist_xyz_(uintptr_t* gr, uintptr_t* res, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* a) -{ _GR_->Hist(_DM_(res), _D_(x), _D_(y), _D_(z), _D_(a)); } -//----------------------------------------------------------------------------- -mreal mgl_fit_1(HMGL gr, HMDT fit, const HMDT y, const char *eq, const char *var, mreal *ini) -{ return gr->Fit(*fit, *y, eq, var, ini); } -mreal mgl_fit_2(HMGL gr, HMDT fit, const HMDT z, const char *eq, const char *var, mreal *ini) -{ return gr->Fit2(*fit, *z, eq, var, ini); } -mreal mgl_fit_3(HMGL gr, HMDT fit, const HMDT a, const char *eq, const char *var, mreal *ini) -{ return gr->Fit3(*fit, *a, eq, var, ini); } -mreal mgl_fit_xy(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const char *eq, const char *var, mreal *ini) -{ return gr->Fit(*fit, *x, *y, eq, var, ini); } -mreal mgl_fit_xyz(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const char *eq, const char *var, mreal *ini) -{ return gr->Fit(*fit, *x, *y, *z, eq, var, ini); } -mreal mgl_fit_xyza(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *eq, const char *var, mreal *ini) -{ return gr->Fit(*fit, *x, *y, *z, *a, eq, var, ini); } -mreal mgl_fit_ys(HMGL gr, HMDT fit, const HMDT y, const HMDT s, const char *eq, const char *var, mreal *ini) -{ return gr->FitS(*fit, *y, *s, eq, var, ini); } -mreal mgl_fit_xys(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT s, const char *eq, const char *var, mreal *ini) -{ return gr->FitS(*fit, *x, *y, *s, eq, var, ini); } -mreal mgl_fit_xyzs(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT s, const char *eq, const char *var, mreal *ini) -{ return gr->FitS(*fit, *x, *y, *z, *s, eq, var, ini); } -mreal mgl_fit_xyzas(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT s, const char *eq, const char *var, mreal *ini) -{ return gr->FitS(*fit, *x, *y, *z, *a, *s, eq, var, ini); } - -mreal mgl_fit_1_d(HMGL gr, HMDT fit, const HMDT y, const char *eq, const char *var, HMDT ini) -{ return gr->Fit(*fit, *y, eq, var, *ini); } -mreal mgl_fit_2_d(HMGL gr, HMDT fit, const HMDT z, const char *eq, const char *var, HMDT ini) -{ return gr->Fit2(*fit, *z, eq, var, *ini); } -mreal mgl_fit_3_d(HMGL gr, HMDT fit, const HMDT a, const char *eq, const char *var, HMDT ini) -{ return gr->Fit3(*fit, *a, eq, var, *ini); } -mreal mgl_fit_xy_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const char *eq, const char *var, HMDT ini) -{ return gr->Fit(*fit, *x, *y, eq, var, *ini); } -mreal mgl_fit_xyz_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const char *eq, const char *var, HMDT ini) -{ return gr->Fit(*fit, *x, *y, *z, eq, var, *ini); } -mreal mgl_fit_xyza_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const char *eq, const char *var, HMDT ini) -{ return gr->Fit(*fit, *x, *y, *z, *a, eq, var, *ini); } -mreal mgl_fit_ys_d(HMGL gr, HMDT fit, const HMDT y, const HMDT s, const char *eq, const char *var, HMDT ini) -{ return gr->FitS(*fit, *y, *s, eq, var, *ini); } -mreal mgl_fit_xys_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT s, const char *eq, const char *var, HMDT ini) -{ return gr->FitS(*fit, *x, *y, *s, eq, var, *ini); } -mreal mgl_fit_xyzs_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT s, const char *eq, const char *var, HMDT ini) -{ return gr->FitS(*fit, *x, *y, *z, *s, eq, var, *ini); } -mreal mgl_fit_xyzas_d(HMGL gr, HMDT fit, const HMDT x, const HMDT y, const HMDT z, const HMDT a, const HMDT s, const char *eq, const char *var, HMDT ini) -{ return gr->FitS(*fit, *x, *y, *z, *a, *s, eq, var, *ini); } - -void mgl_puts_fit(HMGL gr, mreal x, mreal y, mreal z, const char *prefix, const char *font, mreal size) -{ gr->PutsFit(mglPoint(x,y,z), prefix, font, size); } -const char *mgl_get_fit(HMGL gr) { return gr->GetFit(); } -//----------------------------------------------------------------------------- -mreal mgl_fit_1_(uintptr_t* gr, uintptr_t* fit, uintptr_t* y, const char *eq, const char *var, mreal *ini, int l, int n) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; - mreal r = _GR_->Fit(_DM_(fit), _D_(y), s, d, ini); - delete []s; delete []d; return r; -} -mreal mgl_fit_2_(uintptr_t* gr, uintptr_t* fit, uintptr_t* z, const char *eq, const char *var, mreal *ini, int l, int n) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; - mreal r = _GR_->Fit2(_DM_(fit), _D_(z), s, d, ini); - delete []s; delete []d; return r; -} -mreal mgl_fit_3_(uintptr_t* gr, uintptr_t* fit, uintptr_t* a, const char *eq, const char *var, mreal *ini, int l, int n) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; - mreal r = _GR_->Fit3(_DM_(fit), _D_(a), s, d, ini); - delete []s; delete []d; return r; -} -mreal mgl_fit_xy_(uintptr_t* gr, uintptr_t* fit, uintptr_t* x, uintptr_t* y, const char *eq, const char *var, mreal *ini, int l, int n) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; - mreal r = _GR_->Fit(_DM_(fit), _D_(x), _D_(y), s, d, ini); - delete []s; delete []d; return r; -} -mreal mgl_fit_xyz_(uintptr_t* gr, uintptr_t* fit, uintptr_t* x, uintptr_t* y, uintptr_t* z, const char *eq, const char *var, mreal *ini, int l, int n) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; - mreal r = _GR_->Fit(_DM_(fit), _D_(x), _D_(y), _D_(z), s, d, ini); - delete []s; delete []d; return r; -} -mreal mgl_fit_xyza_(uintptr_t* gr, uintptr_t* fit, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* a, const char *eq, const char *var, mreal *ini, int l, int n) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; - mreal r = _GR_->Fit(_DM_(fit), _D_(x), _D_(y), _D_(z), _D_(a), s, d, ini); - delete []s; delete []d; return r; -} -mreal mgl_fit_ys_(uintptr_t* gr, uintptr_t* fit, uintptr_t* y, uintptr_t* ss, const char *eq, const char *var, mreal *ini, int l, int n) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; - mreal r = _GR_->FitS(_DM_(fit), _D_(y), _D_(ss), s, d, ini); - delete []s; delete []d; return r; -} -mreal mgl_fit_xys_(uintptr_t* gr, uintptr_t* fit, uintptr_t* x, uintptr_t* y, uintptr_t* ss, const char *eq, const char *var, mreal *ini, int l, int n) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; - mreal r = _GR_->FitS(_DM_(fit), _D_(x), _D_(y), _D_(ss), s, d, ini); - delete []s; delete []d; return r; -} -mreal mgl_fit_xyzs_(uintptr_t* gr, uintptr_t* fit, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* ss, const char *eq, const char *var, mreal *ini, int l, int n) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; - mreal r = _GR_->FitS(_DM_(fit), _D_(x), _D_(y), _D_(z), _D_(ss), s, d, ini); - delete []s; delete []d; return r; -} -mreal mgl_fit_xyzas_(uintptr_t* gr, uintptr_t* fit, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* a, uintptr_t* ss, const char *eq, const char *var, mreal *ini, int l, int n) -{ - char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; - char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; - mreal r = _GR_->FitS(_DM_(fit), _D_(x), _D_(y), _D_(z), _D_(a), _D_(ss), s, d, ini); - delete []s; delete []d; return r; -} -void mgl_puts_fit_(uintptr_t* gr, mreal *x, mreal *y, mreal *z, const char *prefix, const char *font, mreal *size, int l, int n) -{ - char *s=new char[l+1]; memcpy(s,prefix,l); s[l]=0; - char *d=new char[n+1]; memcpy(d,font,n); d[n]=0; - _GR_->PutsFit(mglPoint(*x,*y,*z), s, d, *size); - delete []s; delete []d; -} -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_flow.cpp b/mgl/mgl_flow.cpp deleted file mode 100644 index 419de75..0000000 --- a/mgl/mgl_flow.cpp +++ /dev/null @@ -1,946 +0,0 @@ -/*************************************************************************** - * mgl_flow.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 "mgl/mgl.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -//----------------------------------------------------------------------------- -// -// Flow series -// -//----------------------------------------------------------------------------- -void mglGraph::flow(bool simple, mreal zVal, mreal u, mreal v, - const mglData &x, const mglData &y, const mglData &ax, const mglData &ay) -{ - long n=10*(ax.nx+ax.ny); - bool both = x.nx==ax.nx && y.nx==ax.nx && x.ny==ax.ny && y.ny==ax.ny; - mreal *pp, *cc; - bool *tt; - pp = (mreal *)malloc(3*n*sizeof(mreal)); - cc = (mreal *)malloc(n*sizeof(mreal)); - tt = (bool *)malloc(n*sizeof(bool)); - mreal dt = 0.5/(ax.nx > ax.ny ? ax.nx : ax.ny),e,f,g,ff[4],gg[4],h,s=1; - if(u<0 || v<0) { dt = -dt; u = -u; v = -v; s = -1;} - register long k=0,m; - bool end = false; - do{ - if(k>=n) // resize array if need - { - n += 10*(ax.nx+ax.ny); - pp = (mreal *)realloc(pp,3*n*sizeof(mreal)); - cc = (mreal *)realloc(cc,n*sizeof(mreal)); - tt = (bool *)realloc(tt,n*sizeof(bool)); - } - // insert point - pp[3*k] = simple ? Min.x + (Max.x-Min.x)*u : - (both ? x.Spline1(u,v,0):x.Spline1(u,0,0)); - pp[3*k+1] = simple ? Min.y + (Max.y-Min.y)*v : - (both ? y.Spline1(u,v,0):y.Spline1(v,0,0)); - pp[3*k+2] = zVal; - tt[k] = ScalePoint(pp[3*k],pp[3*k+1],pp[3*k+2]); - for(m=0;m1 || v>1; - } while(!end); - curv_plot(k,pp,cc,tt); - free(pp); free(cc); free(tt); -} -//----------------------------------------------------------------------------- -void mglGraph::Flow(const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch, int num, bool cnt, mreal zVal) -{ - mreal u,v; - long n=ax.nx, m=ax.ny; - if(n*m*ax.nz!=ay.nx*ay.ny*ay.nz) { SetWarn(mglWarnDim,"Flow"); return; } - if(n<2 || m<2) { SetWarn(mglWarnLow,"Flow"); return; } - static int cgid=1; StartGroup("Flow",cgid++); - bool both = x.nx==n && y.nx==n && x.ny==m && y.ny==m; - if(!(both || (x.nx==n && y.nx==m))) { SetWarn(mglWarnDim,"Flow"); return; } - - Arrow1 = Arrow2 = '_'; - SetScheme(sch); - // allocate memory - if(isnan(zVal)) zVal = Min.z; - cnt=(num>0); num = abs(num); // redefine central parater - - for(long k=0;k1) zVal = Min.z+(Max.z-Min.z)*mreal(k)/(ax.nz-1); - for(long i=0;i ax.ny ? ax.nx : ax.ny); - nn = (nn > ax.nz ? nn : ax.nz); - mreal dt = 0.2/nn, e,f,g,ee[4],ff[4],gg[4],h,s=1,u1,v1,w1; - if(u<0 || v<0 || w<0) - { dt = -dt; u = -u; v = -v; w = -w; s = -1;} - register long k=0,m; - bool end = false; - do{ - if(k>=n) // resize array if need - { - n += 10*(ax.nx+ax.ny); - pp = (mreal *)realloc(pp,3*n*sizeof(mreal)); - cc = (mreal *)realloc(cc,n*sizeof(mreal)); - tt = (bool *)realloc(tt,n*sizeof(bool)); - } - // insert point - pp[3*k] = simple ? Min.x + (Max.x-Min.x)*u : - (both ? x.Spline1(u,v,w):x.Spline1(u,0,0)); - pp[3*k+1] = simple ? Min.y + (Max.y-Min.y)*v : - (both ? y.Spline1(u,v,w):y.Spline1(v,0,0)); - pp[3*k+2] = simple ? Min.z + (Max.z-Min.z)*w : - (both ? z.Spline1(u,v,w):z.Spline1(w,0,0)); - tt[k] = ScalePoint(pp[3*k],pp[3*k+1],pp[3*k+2]); - for(m=0;m1 || v>1 || w<0 || w>1; - } while(!end); - curv_plot(k,pp,cc,tt); - free(pp); free(cc); free(tt); -} -//----------------------------------------------------------------------------- -void mglGraph::Flow(const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, - const mglData &az, const char *sch, int num, bool cnt) -{ - mreal u,v,w; - long i,j,n=ax.nx,m=ax.ny,l=ax.nz; - if(ax.nx*ax.ny*ax.nz!=ay.nx*ay.ny*ay.nz || ax.nx*ax.ny*ax.nz!=az.nx*az.ny*az.nz) - { SetWarn(mglWarnDim,"Flow"); return; } - if(ax.nx<2 || ax.ny<2 || ax.nz<2) - { SetWarn(mglWarnLow,"Flow"); return; } - bool both = x.nx*x.ny*x.nz==n*m*l && y.nx*y.ny*y.nz==n*m*l && z.nx*z.ny*z.nz==n*m*l; - if(!(both || (x.nx==n && y.nx==m && z.nx==l))) - { SetWarn(mglWarnDim,"Flow"); return; } - static int cgid=1; StartGroup("Flow3",cgid++); - cnt=(num>0); num = abs(num); // redefine central parater - - Arrow1 = Arrow2 = '_'; - SetScheme(sch); - - for(i=0;i0); -} -//----------------------------------------------------------------------------- -void mglGraph::Grad(const mglData &x, const mglData &y, const mglData &phi, const char *sch, int num, mreal zVal) -{ - mglData ax(phi), ay(phi),xx(phi),yy(phi); - long nn = phi.nx*phi.ny; - if(x.nx*x.ny==nn && y.nx*y.ny==nn) { xx = x; yy = y; } - else if(x.nx==phi.nx && y.nx==phi.ny) - { - register long i,j,i0; - for(i=0;i0,zVal); -} -//----------------------------------------------------------------------------- -void mglGraph::Grad(const mglData &phi, const char *sch, int num, mreal zVal) -{ - mglData x(phi.nx), y(phi.ny), z(phi.nz); - x.Fill(Min.x,Max.x); y.Fill(Min.y,Max.y); z.Fill(Min.z,Max.z); - if(phi.nz>2) Grad(x,y,z,phi,sch,num?num:3); - else Grad(x,y,phi,sch,num?num:5,zVal); -} -//----------------------------------------------------------------------------- -// -// Pipe series -// -//----------------------------------------------------------------------------- -void mglGraph::flowr(bool simple, mreal zVal, mreal u, mreal v, const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, mreal r0) -{ - long n=10*(ax.nx+ax.ny); - bool both = x.nx==ax.nx && y.nx==ax.nx && x.ny==ax.ny && y.ny==ax.ny; - mreal *pp, *cc, *rr; - - pp = (mreal *)malloc(3*n*sizeof(mreal)); - cc = (mreal *)malloc(4*n*sizeof(mreal)); - rr = (mreal *)malloc(n*sizeof(mreal)); - mreal dt = 0.5/(ax.nx > ax.ny ? ax.nx : ax.ny),e,f,g,ff[4],gg[4],h,s=1,ss; - if(u<0 || v<0) { dt = -dt; u = -u; v = -v; s = -1;} - ss = 4/((Cmax-Cmin)*(Cmax-Cmin)); - if(r0==0) r0=0.05; - register long k=0,m; - bool end = false; - do{ - if(k>=n) // resize array if need - { - n += 10*(ax.nx+ax.ny); - pp = (mreal *)realloc(pp,3*n*sizeof(mreal)); - cc = (mreal *)realloc(cc,4*n*sizeof(mreal)); - rr = (mreal *)realloc(rr,n*sizeof(mreal)); - } - // insert point - pp[3*k] = simple ? Min.x + (Max.x-Min.x)*u : (both ? x.Spline1(u,v,0):x.Spline1(u,0,0)); - pp[3*k+1] = simple ? Min.y + (Max.y-Min.y)*v : (both ? y.Spline1(u,v,0):y.Spline1(v,0,0)); - pp[3*k+2] = zVal; - for(m=0;m0 ? r0*sqrt(1e-2+ss*h*h)/2 : -r0/sqrt(1e-2+ss*h*h)/5; - { - mreal a = (2*s*h-Cmin-Cmax)/(Cmax-Cmin); - if(a>1) a=1; if(a<-1) a=-1; - mglColor c = GetC(a,false); - cc[4*k] = c.r; cc[4*k+1] = c.g; cc[4*k+2] = c.b; cc[4*k+3] = AlphaDef; - } - h+=1; k++; - // find next point by midpoint method - ff[0]=f*dt/h; gg[0]=g*dt/h; - e = u+ff[0]/2; h = v+gg[0]/2; - f = ax.Linear1(e,h,0); g = ay.Linear1(e,h,0); h = 1+hypot(f,g); -// f = ax.Spline1(e,h,0); g = ay.Spline1(e,h,0); h = 1+hypot(f,g); - ff[1]=f*dt/h; gg[1]=g*dt/h; - e = u+ff[1]/2; h = v+gg[1]/2; - f = ax.Linear1(e,h,0); g = ay.Linear1(e,h,0); h = 1+hypot(f,g); -// f = ax.Spline1(e,h,0); g = ay.Spline1(e,h,0); h = 1+hypot(f,g); - ff[2]=f*dt/h; gg[2]=g*dt/h; - e = u+ff[2]; h = v+gg[2]; - f = ax.Linear1(e,h,0); g = ay.Linear1(e,h,0); h = 1+hypot(f,g); -// f = ax.Spline1(e,h,0); g = ay.Spline1(e,h,0); h = 1+hypot(f,g); - ff[3]=f*dt/h; gg[3]=g*dt/h; - u += ff[0]/6+ff[1]/3+ff[2]/3+ff[3]/6; - v += gg[0]/6+gg[1]/3+gg[2]/3+gg[3]/6; - // condition of end - end = end || u<0 || v<0 || u>1 || v>1; - } while(!end); - tube_plot(k,pp,cc,rr); - free(pp); free(cc); free(rr); -} -//----------------------------------------------------------------------------- -void mglGraph::Pipe(const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch, mreal r0, int num, bool cnt, mreal zVal) -{ - mreal u,v; - long n=ax.nx, m=ax.ny; - if(n*m*ax.nz!=ay.nx*ay.ny*ay.nz) { SetWarn(mglWarnDim,"Pipe"); return; } - if(n<2 || m<2) { SetWarn(mglWarnLow,"Pipe"); return; } - bool both = x.nx==n && y.nx==n && x.ny==m && y.ny==m; - if(!(both || (x.nx==n && y.nx==m))) { SetWarn(mglWarnDim,"Pipe"); return; } - static int cgid=1; StartGroup("Pipe",cgid++); - - Arrow1 = Arrow2 = '_'; - SetScheme(sch); - // allocate memory - if(isnan(zVal)) zVal = Min.z; - cnt=(num>0); num = abs(num); - - for(long k=0;k1) zVal = Min.z+(Max.z-Min.z)*mreal(k)/(ax.nz-1); - for(long i=0;i ax.ny ? ax.nx : ax.ny); - nn = (nn > ax.nz ? nn : ax.nz); - mreal dt = 0.2/nn, e,f,g,ee[4],ff[4],gg[4],h,s=1,u1,v1,w1,ss; - if(u<0 || v<0 || w<0) - { dt = -dt; u = -u; v = -v; w = -w; s = -1;} - ss = 4/((Cmax-Cmin)*(Cmax-Cmin)); - if(r0==0) r0=0.05; - register long k=0,m; - bool end = false; - do{ - if(k>=n) // resize array if need - { - n += 10*(ax.nx+ax.ny); - pp = (mreal *)realloc(pp,3*n*sizeof(mreal)); - cc = (mreal *)realloc(cc,4*n*sizeof(mreal)); - rr = (mreal *)realloc(rr,n*sizeof(mreal)); - } - // insert point - pp[3*k] = simple ? Min.x + (Max.x-Min.x)*u : (both ? x.Spline1(u,v,w):x.Spline1(u,0,0)); - pp[3*k+1] = simple ? Min.y + (Max.y-Min.y)*v : (both ? y.Spline1(u,v,w):y.Spline1(v,0,0)); - pp[3*k+2] = simple ? Min.z + (Max.z-Min.z)*w : (both ? z.Spline1(u,v,w):z.Spline1(w,0,0)); - for(m=0;m0 ? r0*sqrt(1e-2+ss*h*h)/2 : -r0/sqrt(1e-2+ss*h*h)/5; - { - mreal a = (2*s*h-Cmin-Cmax)/(Cmax-Cmin); - if(a>1) a=1; if(a<-1) a=-1; - mglColor c = GetC(a,false); - cc[4*k] = c.r; cc[4*k+1] = c.g; cc[4*k+2] = c.b; cc[4*k+3] = AlphaDef; - } - h+=1; k++; - // find next point by midpoint method - ee[0]=e*dt/h; ff[0]=f*dt/h; gg[0]=g*dt/h; - u1 = u+ee[0]/2; v1 = v+ff[0]/2; w1 = w+gg[0]/2; - e = ax.Linear1(u1,v1,w1); f = ay.Linear1(u1,v1,w1); - g = az.Linear1(u1,v1,w1); h = 1+sqrt(e*e+f*f+g*g); -// e = ax.Spline1(u1,v1,w1); f = ay.Spline1(u1,v1,w1); -// g = az.Spline1(u1,v1,w1); h = 1+sqrt(e*e+f*f+g*g); - ee[1]=e*dt/h; ff[1]=f*dt/h; gg[1]=g*dt/h; - u1 = u+ee[1]/2; v1 = v+ff[1]/2; w1 = w+gg[1]/2; - e = ax.Linear1(u1,v1,w1); f = ay.Linear1(u1,v1,w1); - g = az.Linear1(u1,v1,w1); h = 1+sqrt(e*e+f*f+g*g); -// e = ax.Spline1(u1,v1,w1); f = ay.Spline1(u1,v1,w1); -// g = az.Spline1(u1,v1,w1); h = 1+sqrt(e*e+f*f+g*g); - ee[2]=e*dt/h; ff[2]=f*dt/h; gg[2]=g*dt/h; - u1 = u+ee[2]; v1 = v+ff[2]; w1 = w+gg[2]; - e = ax.Linear1(u1,v1,w1); f = ay.Linear1(u1,v1,w1); - g = az.Linear1(u1,v1,w1); h = 1+sqrt(e*e+f*f+g*g); -// e = ax.Spline1(u1,v1,w1); f = ay.Spline1(u1,v1,w1); -// g = az.Spline1(u1,v1,w1); h = 1+sqrt(e*e+f*f+g*g); - ee[3]=e*dt/h; ff[3]=f*dt/h; gg[3]=g*dt/h; - u += ee[0]/6+ee[1]/3+ee[2]/3+ee[3]/6; - v += ff[0]/6+ff[1]/3+ff[2]/3+ff[3]/6; - w += gg[0]/6+gg[1]/3+gg[2]/3+gg[3]/6; - // condition of end - end = end || u<0 || v<0 || u>1 || v>1 || w<0 || w>1; - } while(!end); - tube_plot(k,pp,cc,rr); - free(pp); free(cc); free(rr); -} -//----------------------------------------------------------------------------- -void mglGraph::Pipe(const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch, mreal r0, int num, bool cnt) -{ - mreal u,v,w; - long i,j,n=ax.nx,m=ax.ny,l=ax.nz; - if(ax.nx*ax.ny*ax.nz!=ay.nx*ay.ny*ay.nz || ax.nx*ax.ny*ax.nz!=az.nx*az.ny*az.nz) - { SetWarn(mglWarnDim,"Pipe"); return; } - if(ax.nx<2 || ax.ny<2 || ax.nz<2) - { SetWarn(mglWarnLow,"Pipe"); return; } - bool both = x.nx*x.ny*x.nz==n*m*l && y.nx*y.ny*y.nz==n*m*l && z.nx*z.ny*z.nz==n*m*l; - if(!(both || (x.nx==n && y.nx==m && z.nx==l))) - { SetWarn(mglWarnDim,"Pipe"); return; } - static int cgid=1; StartGroup("Pipe3",cgid++); - - Arrow1 = Arrow2 = '_'; - SetScheme(sch); - cnt=(num>0); num = abs(num); - - for(i=0;iFlow(*x, *y, *ax, *ay, sch, num, central, zVal); } -/// Plot flows for vector field {ax,ay} with color proportional to value |a| -void mgl_flow_2d(HMGL gr, const HMDT ax, const HMDT ay, const char *sch, int num, int central, mreal zVal) -{ if(gr && ay && ax) gr->Flow(*ax, *ay, sch, num, central, zVal); } -/// Plot flows for 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to value |a| -void mgl_flow_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch, int num, int central) -{ if(gr && ay && ax && az && x && y && z) gr->Flow(*x, *y, *z, *ax, *ay, *az, sch, num, central); } -/// Plot flows for 3d vector field {ax,ay,ay} with color proportional to value |a| -void mgl_flow_3d(HMGL gr, const HMDT ax, const HMDT ay, const HMDT az, const char *sch, int num, int central) -{ if(gr && ay && ax && az) gr->Flow(*ax, *ay, *az, sch, num, central); } -//----------------------------------------------------------------------------- -/// Plot flows for vector field {ax,ay} parametrically depended on coordinate {x,y} with color proportional to value |a| -void mgl_flowp_xy(HMGL gr, mreal x0, mreal y0, mreal z0, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch) -{ if(gr && ay && ax && x && y) gr->FlowP(mglPoint(x0,y0,z0), *x, *y, *ax, *ay, sch); } -/// Plot flows for vector field {ax,ay} with color proportional to value |a| -void mgl_flowp_2d(HMGL gr, mreal x0, mreal y0, mreal z0, const HMDT ax, const HMDT ay, const char *sch) -{ if(gr && ay && ax) gr->FlowP(mglPoint(x0,y0,z0), *ax, *ay, sch); } -/// Plot flows for 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to value |a| -void mgl_flowp_xyz(HMGL gr, mreal x0, mreal y0, mreal z0, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch) -{ if(gr && ay && ax && az && x && y && z) gr->FlowP(mglPoint(x0,y0,z0), *x, *y, *z, *ax, *ay, *az, sch); } -/// Plot flows for 3d vector field {ax,ay,ay} with color proportional to value |a| -void mgl_flowp_3d(HMGL gr, mreal x0, mreal y0, mreal z0, const HMDT ax, const HMDT ay, const HMDT az, const char *sch) -{ if(gr && ay && ax && az) gr->FlowP(mglPoint(x0,y0,z0), *ax, *ay, *az, sch); } -//----------------------------------------------------------------------------- -/// Plot flow pipes for vector field {ax,ay} parametrically depended on coordinate {x,y} with color proportional to value |a| -void mgl_pipe_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch, mreal r0, int num, int central, mreal zVal) -{ if(gr && ay && ax && x && y) gr->Pipe(*x, *y, *ax, *ay, sch, r0, num, central, zVal); } -/// Plot flow pipes for vector field {ax,ay} with color proportional to value |a| -void mgl_pipe_2d(HMGL gr, const HMDT ax, const HMDT ay, const char *sch, mreal r0, int num, int central, mreal zVal) -{ if(gr && ay && ax) gr->Pipe(*ax, *ay, sch, r0, num, central, zVal); } -/// Plot flow pipes for 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to value |a| -void mgl_pipe_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch, mreal r0, int num, int central) -{ if(gr && ay && ax && az && x && y && z) gr->Pipe(*x, *y, *z, *ax, *ay, *az, sch, r0, num, central); } -/// Plot flow pipes for 3d vector field {ax,ay,ay} with color proportional to value |a| -void mgl_pipe_3d(HMGL gr, const HMDT ax, const HMDT ay, const HMDT az, const char *sch, mreal r0, int num, int central) -{ if(gr && ay && ax && az) gr->Pipe(*ax, *ay, *az, sch, r0, num, central); } -//----------------------------------------------------------------------------- -/// The gradient of the scalar field -void mgl_grad_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT ph, const char *sch, int num) -{ if(gr&&x&&y&&z&&ph) gr->Grad(*x,*y,*z,*ph,sch,num); } -void mgl_grad_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT ph, const char *sch, int num, mreal zVal) -{ if(gr&&x&&y&&ph) gr->Grad(*x,*y,*ph,sch,num,zVal); } -void mgl_grad(HMGL gr, const HMDT ph, const char *sch, int num, mreal zVal) -{ if(gr&&ph) gr->Grad(*ph,sch,num,zVal); } -//----------------------------------------------------------------------------- -// Fortran interface -//----------------------------------------------------------------------------- -/// Plot flows for vector field {ax,ay} parametrically depended on coordinate {x,y} with color proportional to value |a| -void mgl_flow_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, - int *num, int *central, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && x && y) _GR_->Flow(_D_(x), _D_(y), _D_(ax), _D_(ay), s, *num, *central, *zVal); - delete []s; -} -/// Plot flows for vector field {ax,ay} with color proportional to value |a| -void mgl_flow_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch, int *num, int *central, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax) _GR_->Flow(_D_(ax), _D_(ay), s, *num, *central, *zVal); - delete []s; -} -/// Plot flows for 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to value |a| -void mgl_flow_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, - const char *sch, int *num, int *central,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && az && x && y && z) - _GR_->Flow(_D_(x), _D_(y), _D_(z), _D_(ax), _D_(ay), _D_(az), s, *num, *central); - delete []s; -} -/// Plot flows for 3d vector field {ax,ay,ay} with color proportional to value |a| -void mgl_flow_3d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, int *num, int *central,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && az) _GR_->Flow(_D_(ax), _D_(ay), _D_(az), s, *num, *central); - delete []s; -} -//----------------------------------------------------------------------------- -/// Plot flows for vector field {ax,ay} parametrically depended on coordinate {x,y} with color proportional to value |a| -void mgl_flowp_xy_(uintptr_t *gr, mreal *x0, mreal *y0, mreal *z0, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && x && y) - _GR_->FlowP(mglPoint(*x0,*y0,*z0), _D_(x), _D_(y), _D_(ax), _D_(ay), s); - delete []s; -} -/// Plot flows for vector field {ax,ay} with color proportional to value |a| -void mgl_flowp_2d_(uintptr_t *gr, mreal *x0, mreal *y0, mreal *z0, uintptr_t *ax, uintptr_t *ay, const char *sch, int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax) - _GR_->FlowP(mglPoint(*x0,*y0,*z0), _D_(ax), _D_(ay), s); - delete []s; -} -/// Plot flows for 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to value |a| -void mgl_flowp_xyz_(uintptr_t *gr, mreal *x0, mreal *y0, mreal *z0, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && az && x && y && z) - _GR_->FlowP(mglPoint(*x0,*y0,*z0), _D_(x), _D_(y), _D_(z), _D_(ax), _D_(ay), _D_(az), s); - delete []s; -} -/// Plot flows for 3d vector field {ax,ay,ay} with color proportional to value |a| -void mgl_flowp_3d_(uintptr_t *gr, mreal *x0, mreal *y0, mreal *z0, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && az) - _GR_->FlowP(mglPoint(*x0,*y0,*z0), _D_(ax), _D_(ay), _D_(az), s); - delete []s; -} -//----------------------------------------------------------------------------- -/// Plot flow pipes for vector field {ax,ay} parametrically depended on coordinate {x,y} with color proportional to value |a| -void mgl_pipe_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, mreal *r0, - int *num, int *central, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && x && y) - _GR_->Pipe(_D_(x), _D_(y), _D_(ax), _D_(ay), s, *r0, *num, *central, *zVal); - delete []s; -} -/// Plot flow pipes for vector field {ax,ay} with color proportional to value |a| -void mgl_pipe_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch, mreal *r0, int *num, int *central, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax) _GR_->Pipe(_D_(ax), _D_(ay), s, *r0, *num, *central, *zVal); - delete []s; -} -/// Plot flow pipes for 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to value |a| -void mgl_pipe_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, - const char *sch, mreal *r0, int *num, int *central,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && az && x && y && z) - _GR_->Pipe(_D_(x), _D_(y), _D_(z), _D_(ax), _D_(ay), _D_(az), s, *r0, *num, *central); - delete []s; -} -/// Plot flow pipes for 3d vector field {ax,ay,ay} with color proportional to value |a| -void mgl_pipe_3d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, mreal *r0, int *num, int *central,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && az) _GR_->Pipe(_D_(ax), _D_(ay), _D_(az), s, *r0, *num, *central); - delete []s; -} -//----------------------------------------------------------------------------- -/// Plot gradient for scalar field ph parametrically depended on coordinate {x,y} with color proportional to value |a| -void mgl_grad_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ph, const char *sch, - int *num, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ph && x && y) _GR_->Grad(_D_(x), _D_(y), _D_(ph), s, *num, *zVal); - delete []s; -} -void mgl_grad_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ph, const char *sch, - int *num, int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ph && x && y && z) _GR_->Grad(_D_(x), _D_(y), _D_(z), _D_(ph), s, *num); - delete []s; -} -/// Plot flows for vector field {ax,ay} with color proportional to value |a| -void mgl_grad_(uintptr_t *gr, uintptr_t *ph, const char *sch, int *num, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ph) _GR_->Flow(_D_(ph), s, *num, *zVal); - delete []s; -} -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_gl.cpp b/mgl/mgl_gl.cpp deleted file mode 100644 index 81abcd3..0000000 --- a/mgl/mgl_gl.cpp +++ /dev/null @@ -1,511 +0,0 @@ -/*************************************************************************** - * mgl_gl.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 - -#include "mgl/mgl_gl.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -//----------------------------------------------------------------------------- -/// Create mglGraph object in OpenGL mode. -HMGL mgl_create_graph_gl() -{ return new mglGraphGL; } -/// Create mglGraph object in OpenGL mode. -uintptr_t mgl_create_graph_gl_() -{ return uintptr_t(new mglGraphGL); } -//----------------------------------------------------------------------------- -mglGraphGL::mglGraphGL() : mglGraphAB(1,1) {} -//----------------------------------------------------------------------------- -mglGraphGL::~mglGraphGL(){} -//----------------------------------------------------------------------------- -bool mglGraphGL::Alpha(bool enable) -{ - bool t = UseAlpha; - if(enable) - { - UseAlpha = true; - glDisable(GL_DEPTH_TEST); - glEnable(GL_ALPHA_TEST); - glEnable(GL_BLEND); - if(TranspType==1) glBlendFunc(GL_DST_COLOR, GL_ZERO); -// else if(TranspType==2) glBlendFunc(GL_SRC_ALPHA, GL_ONE); - else glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - } - else - { - UseAlpha = false; - glEnable(GL_DEPTH_TEST); - glDisable(GL_ALPHA_TEST); - glDisable(GL_BLEND); - } - return t; -} -//----------------------------------------------------------------------------- -void mglGraphGL::Light(int n,mglPoint p,mglColor c, mreal br,bool infty) -{ - mglColor AmbLight = mglColor(AmbBr,AmbBr,AmbBr); - mglColor DifLight = mglColor(br,br,br); - GLenum light[8] = {GL_LIGHT0,GL_LIGHT1,GL_LIGHT2,GL_LIGHT3,GL_LIGHT4, - GL_LIGHT5,GL_LIGHT6,GL_LIGHT7}; - float amb[4], pos[4],dif[4]; - if(n<0 || n>7) { SetWarn(mglWarnLId); return; } - if(c.Valid()) - { - DifLight = c*br; - AmbLight = c*AmbBr; - } - dif[0] = DifLight.r; dif[1] = DifLight.g; - dif[2] = DifLight.b; dif[3] = 1.; - amb[0] = AmbLight.r; amb[1] = AmbLight.g; - amb[2] = AmbLight.b; amb[3] = 1.; - pos[0] = p.x; pos[1] = p.y; - pos[2] = p.z; pos[3] = infty ? 0:1; - glShadeModel(GL_SMOOTH); - //glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 5.0); - //glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, pos); - - glLightfv(light[n], GL_AMBIENT, amb); - glLightfv(light[n], GL_DIFFUSE, dif); - //glLightfv(light[n], GL_SPECULAR, spc); - glLightfv(light[n], GL_POSITION, pos); - glEnable(light[n]); -} -//----------------------------------------------------------------------------- -void mglGraphGL::LightScale() -{ - mglGraphAB::LightScale(); - GLenum light[8] = {GL_LIGHT0,GL_LIGHT1,GL_LIGHT2,GL_LIGHT3,GL_LIGHT4, - GL_LIGHT5,GL_LIGHT6,GL_LIGHT7}; - float pos[4]={0,0,0,0}; - for(int i=0;i<8;i++) - { - pos[0] = pLight[3*i]; - pos[1] = pLight[3*i+1]; - pos[2] = pLight[3*i+2]; - if(nLight[i]) glLightfv(light[i], GL_POSITION, pos); - } -} -//----------------------------------------------------------------------------- -void mglGraphGL::Light(int n, bool enable) -{ - GLenum light[8] = {GL_LIGHT0,GL_LIGHT1,GL_LIGHT2,GL_LIGHT3,GL_LIGHT4, - GL_LIGHT5,GL_LIGHT6,GL_LIGHT7}; - if(enable) glEnable(light[n]); - else glDisable(light[n]); -} -//----------------------------------------------------------------------------- -bool mglGraphGL::Light(bool enable) -{ - bool t = UseLight; - UseLight = enable; - if(enable) { glEnable(GL_LIGHTING); glEnable(GL_NORMALIZE);} - else { glDisable(GL_LIGHTING); glDisable(GL_NORMALIZE); } - return t; -} -//----------------------------------------------------------------------------- -void mglGraphGL::View(mreal TetX,mreal TetY,mreal TetZ) -{ - glMatrixMode(GL_PROJECTION);//GL_PROJECTION GL_VIEWPORT GL_MODELVIEW - glRotated(TetX,1.,0.,0.); - glRotated(TetY,0.,1.,0.); - glRotated(TetZ,0.,0.,1.); -} -//----------------------------------------------------------------------------- -void mglGraphGL::Fog(mreal , mreal) -{ -/* if(d>0) - { - glFogf(GL_FOG_MODE,GL_EXP); - glFogf(GL_FOG_DENSITY,5*d); - glFogfv(GL_FOG_COLOR,back); - glEnable(GL_FOG); - } - else glDisable(GL_FOG);*/ -} -//----------------------------------------------------------------------------- -void mglGraphGL::Clf(mglColor Back) -{ - Fog(0); - CurrPal = -1; - if(Back==NC) Back=mglColor(1,1,1); -// glDepthFunc(GL_LESS); - glDepthFunc(GL_GREATER); -// back[0]=Back.r; back[1]=Back.g; back[2]=Back.b; - glClearColor(Back.r,Back.g,Back.b,0.); - glClearDepth(-10.); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glEnable(GL_COLOR_MATERIAL); -} -//----------------------------------------------------------------------------- -void mglGraphGL::Ball(mreal x,mreal y,mreal z,mglColor col,mreal alpha) -{ - if(alpha==0) return; - if(alpha<0) { alpha = -alpha; } - else { if(!ScalePoint(x,y,z)) return; } - if(!col.Valid()) col = mglColor(1.,0.,0.); - alpha = Transparent ? alpha : 1; - mreal p[3] = {x,y,z}; PostScale(p,1); - glBegin(GL_POINTS); - glColor4f(col.r,col.g,col.b,alpha); - glVertex3f(p[0],p[1],p[2]); - glEnd(); -} -//----------------------------------------------------------------------------- -void mglGraphGL::ball(mreal *p,mreal *c) -{ - glBegin(GL_POINTS); -#if(MGL_USE_DOUBLE==1) - glColor4dv(c); - glVertex3dv(p); -#else - glColor4fv(c); - glVertex3fv(p); -#endif - glEnd(); -} -//----------------------------------------------------------------------------- -void mglGraphGL::Pen(mglColor col, char style,mreal width) -{ - mglGraphAB::Pen(col,style,width); - if(style==0) return; - if(style!='-') switch(style) - { - case '|': glLineStipple(int(width),0xff00); break; - case ';': glLineStipple(int(width),0xf0f0); break; - case ':': glLineStipple(int(width),0x8888); break; - case 'j': glLineStipple(int(width),0xfe10); break; - case 'i': glLineStipple(int(width),0xe4e4); break; - case ' ': glLineStipple(int(width),0x0000); break; - } - if(width>=1) glLineWidth(width); - else glLineWidth(1); - if(style=='-') glDisable(GL_LINE_STIPPLE); - else glEnable(GL_LINE_STIPPLE); -} -//----------------------------------------------------------------------------- -void mglGraphGL::EndFrame() -{ -// mglGraph::EndFrame(); - glEndList(); -} -//----------------------------------------------------------------------------- -int mglGraphGL::NewFrame() -{ - Clf(); - Identity(); - glNewList(CurFrameId,GL_COMPILE); - CurFrameId++; - return CurFrameId-1; -} -//----------------------------------------------------------------------------- -unsigned char **mglGraphGL::GetRGBLines(long &width, long &height, unsigned char *&f, bool alpha) -{ - long x, y, d = alpha ? 4:3; - GLint w[4]; - glGetIntegerv(GL_VIEWPORT,w); - x=w[0]; y=w[1]; width=w[2]; height=w[3]; - unsigned char **p; - - p = (unsigned char **)malloc(height * sizeof(unsigned char *)); - f = (unsigned char *) malloc(width*height * sizeof(unsigned char)*d); - for(long i=0;i0 ? (s+1.f)*(s+1.f) : (1.f-s)*(s-1.f)); - s = n*(s+1.f)/2.f; k = long(s); s -= k; - if(k0 ? (s+1.f)*(s+1.f) : (1.f-s)*(s-1.f)); - s = n*(s+1.f)/2.f; k = long(s); s -= k; - if(k0 ? (s+1.f)*(s+1.f) : (1.f-s)*(s-1.f)); - s = n*(s+1.f)/2.f; k = long(s); s -= k; - if(k0 ? (s+1.f)*(s+1.f) : (1.f-s)*(s-1.f)); - s = n*(s+1.f)/2.f; k = long(s); s -= k; - if(k': - s = s*1.1; - glBegin(GL_LINE_LOOP); - glVertex3f(x-s/2,y-s,z); glVertex3f(x-s/2,y+s,z); - glVertex3f(x+s,y,z); glEnd(); break; - case 'L': - s = s*1.1; - glBegin(GL_TRIANGLES); - glVertex3f(x+s/2,y-s,z); glVertex3f(x+s/2,y+s,z); - glVertex3f(x-s,y,z); glEnd(); break; - case '<': - s = s*1.1; - glBegin(GL_LINE_LOOP); - glVertex3f(x+s/2,y-s,z); glVertex3f(x+s/2,y+s,z); - glVertex3f(x-s,y,z); glEnd(); break; - - case 'S': - glBegin(GL_QUADS); - glVertex3f(x-s,y-s,z); glVertex3f(x+s,y-s,z); - glVertex3f(x+s,y+s,z); glVertex3f(x-s,y+s,z); - glEnd(); break; - case 'D': - s = s*1.1; - glBegin(GL_QUADS); - glVertex3f(x,y-s,z); glVertex3f(x+s,y,z); - glVertex3f(x,y+s,z); glVertex3f(x-s,y,z); - glEnd(); break; - case 'T': - s = s*1.1; - glBegin(GL_TRIANGLES); - glVertex3f(x-s,y-s/2,z); glVertex3f(x+s,y-s/2,z); - glVertex3f(x,y+s,z); glEnd(); break; - case 'V': - s = s*1.1; - glBegin(GL_TRIANGLES); - glVertex3f(x-s,y+s/2,z); glVertex3f(x+s,y+s/2,z); - glVertex3f(x,y-s,z); glEnd(); break; - case 'o': - glBegin(GL_LINE_LOOP); - for(i=0;i<16;i++) - glVertex3f(x+s*cos(i*M_PI_4/2),y+s*sin(i*M_PI_4/2),z); - glEnd(); break; - case 'O': - glBegin(GL_POLYGON); - for(i=0;i<16;i++) - glVertex3f(x+s*cos(i*M_PI_4/2),y+s*sin(i*M_PI_4/2),z); - glEnd(); break; - } - } -} -//----------------------------------------------------------------------------- -void mglGraphGL::InPlot(mreal x1,mreal x2,mreal y1,mreal y2,bool rel) -{ - mglGraphAB::InPlot(x1,x2,y1,y2,rel); - glMatrixMode(GL_MODELVIEW);//GL_MODELVIEW GL_VIEWPORT GL_PROJECTION - glLoadIdentity(); - glScaled(2,2,1.5); - glTranslated(-0.5,-0.5,-0.5); -} -//----------------------------------------------------------------------------- -void mglGraphGL::Glyph(mreal x, mreal y, mreal f, int s, long j, char col) -{ - int ss=s&3; - mreal p[12]; - f /= fnt->GetFact(ss); - mglColor cc = mglColor(col); - if(!cc.Valid()) cc = mglColor(CDef[0],CDef[1],CDef[2]); - glColor4f(cc.r,cc.g,cc.b,CDef[3]); - if(s&8) - { - mreal dy = 0.004; - if(s&4) glBegin(GL_LINE_LOOP); - else glBegin(GL_QUADS); - p[2]=p[5]=p[8]=p[11]=0; - p[0]=p[6]=x; p[1]=p[4] =y+dy; - p[3]=p[9]=fabs(f)+x; p[7]=p[10]=y-dy; - PostScale(p,4); - glVertex3f(p[0],p[1],p[2]); glVertex3f(p[3],p[4],p[5]); - glVertex3f(p[9],p[10],p[11]); glVertex3f(p[6],p[7],p[8]); - glEnd(); - } - else if(s&4) - { - const short *line = fnt->GetLn(ss,j); - long ik,ii,il=0, nl=fnt->GetNl(ss,j); - if(!line || nl<=0) return; - glBegin(GL_LINES); - for(ik=0;ikGetTr(ss,j); - register long ik,ii, nt=fnt->GetNt(ss,j); - if(!trig || nt<=0) return; - glBegin(GL_TRIANGLES); - for(ik=0;ik * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -#include -#include -#include -#include -#include -#include -#if(!defined(PATH_MAX)) -#define PATH_MAX 256 -#endif -#ifdef _MSC_VER -#include -int strcasecmp (const char *s1,const char *s2) -{ - while (*s1 != '\0' && tolower(*s1) == tolower(*s2)) - { s1++; s2++; } - return tolower(*(unsigned char *) s1) - tolower(*(unsigned char *) s2); -} -#endif -#ifdef WIN32 -#define bzero(a,b) memset(a,0,b) -#endif -#include "mgl/mgl_idtf.h" -#include -#ifndef MAXFLOAT -#define MAXFLOAT 1e30 -#endif -#define IDTFROUND(x) int((x)*1000000.0f+0.5f)/1000000.0f -// #define IDTFROUND(x) ldexpf(roundf(ldexpf((x),20)),-20) -// const static bool dbg = true; -#ifdef HAVE_U3D -#ifdef HAVE_HPDF_H -#include -#include -#include -#include -#include -#include -#endif // HAVE_HPDF_H - -#include "u3d/IFXResult.h" -#include "u3d/IFXOSLoader.h" - -#include "u3d/ConverterResult.h" -#include "u3d/IFXDebug.h" -#include "u3d/IFXCOM.h" - -#include "u3d/ConverterOptions.h" -#include "u3d/SceneConverterLib.h" -#include "u3d/SceneUtilities.h" -#include "u3d/IFXOSUtilities.h" - -#include "u3d/File.h" -#include "u3d/Tokens.h" -#include "u3d/Point.h" -#endif // HAVE_U3D - - -/* -Here is the description of supported TGA format - -DATA TYPE 2: Unmapped RGB - -| Offset | Length | Description | -|--------|--------|------------------------------------------------------------| -| 0 | 1 | Number of Characters in Identification Field. | -| | | | -| | | This field is a one-byte unsigned integer, specifying | -| | | the length of the Image Identification Field. Its value | -| | | is 0 to 255. A value of 0 means that no Image | -| | | Identification Field is included. | -|--------|--------|------------------------------------------------------------| -| 1 | 1 | Color Map Type. | -| | | | -| | | This field contains 0. | -|--------|--------|------------------------------------------------------------| -| 2 | 1 | Image Type Code. | -| | | | -| | | This field will always contain a binary 2. | -| | | ( That's what makes it Data Type 2 ). | -|--------|--------|------------------------------------------------------------| -| 3 | 5 | Color Map Specification. | -| | | | -| | | Ignored | -|--------|--------|------------------------------------------------------------| -| 8 | 10 | Image Specification. | -| | | | -| 8 | 2 | X Origin of Image. | -| | | Integer ( lo-hi ) X coordinate of the lower left corner | -| | | of the image. | -| 10 | 2 | Y Origin of Image. | -| | | Integer ( lo-hi ) Y coordinate of the lower left corner | -| | | of the image. | -| 12 | 2 | Width of Image. | -| | | Integer ( lo-hi ) width of the image in pixels. | -| 14 | 2 | Height of Image. | -| | | Integer ( lo-hi ) height of the image in pixels. | -| 16 | 1 | Image Pixel Size. | -| | | Number of bits in a pixel. This is 24 for Targa 24, | -| | | 32 for Targa 32 | -| 17 | 1 | Image Descriptor Byte. | -| | | Not used | -|--------|--------|------------------------------------------------------------| -| 18 | varies | Image Identification Field. | -| | | | -| | | Contains a free-form identification field of the length | -| | | specified in byte 1 of the image record. It's usually | -| | | omitted ( length in byte 1 = 0 ), but can be up to 255 | -| | | characters. If more identification information is | -| | | required, it can be stored after the image data. | -|--------|--------|------------------------------------------------------------| -| varies | varies | Image Data Field. | -| | | | -| | | This field specifies (width) x (height) pixels. Each | -| | | pixel specifies an RGB color value, which is stored as | -| | | an integral number of bytes. | -| | | The 3 byte entry contains 1 byte each of blue, green, | -| | | and red. | -| | | The 4 byte entry contains 1 byte each of blue, green, | -| | | red, and attribute. | --------------------------------------------------------------------------------- - -*/ - - -typedef struct _TgaHeader -{ - uint8_t numIden; - uint8_t colorMapType; - uint8_t imageType; - uint8_t colorMapSpec[5]; // not used, just here to take up space - uint8_t origX[2]; - uint8_t origY[2]; - uint8_t width[2]; - uint8_t height[2]; - uint8_t bpp; - uint8_t imageDes; // don't use, space eater -} TgaHeader; - -TGAImageMin::TGAImageMin() -{ - Width = 0; - Height = 0; - Channels = 0; - RGBPixels = NULL; -} - -TGAImageMin::~TGAImageMin() -{ - Deallocate(); -} - -void TGAImageMin::Deallocate() -{ - if(RGBPixels) - { - delete[] RGBPixels; - } - - RGBPixels = NULL; - - Width = 0; - Height = 0; - Channels = 0; -} - -bool TGAImageMin::Write( const char* pFileName ) const -{ - TgaHeader header; - uint8_t* BGRPixels = NULL; // BGRA -// fprintf(stderr, "name %s width %u height %u channels %u pixels %p\n", pFileName, Width, Height, Channels, RGBPixels ); - bool ret = true; - FILE* outFile = NULL; - - if( !RGBPixels ) - { - ret = false; - } - - if( ret ) - { - outFile = fopen( pFileName, "wb" ); - - if( !outFile ) - ret = false; - } - - if( ret ) - { - // first attemp to write TGA image - BGRPixels = new uint8_t[ Width * Height * Channels ]; - if( NULL != BGRPixels && NULL != RGBPixels ) - { - // R and B channels reordering - uint32_t i; - for( i = 0; i < Width * Height * Channels; i += Channels ) - { - BGRPixels[i] = RGBPixels[i+2]; // R->B - BGRPixels[i+1] = RGBPixels[i+1]; // G->G - BGRPixels[i+2] = RGBPixels[i]; // B->R - if( 4 == Channels ) - BGRPixels[i+3] = RGBPixels[i+3]; // A->A - } - } - else - ret = false; - } - - if( ret ) - { - memset(&header,0, sizeof(TgaHeader)); - header.imageType = 2; - header.width[0] = Width % 256; header.width[1] = Width / 256; - header.height[0] = Height % 256; header.height[1] = Height / 256; - header.bpp = Channels*8; - - size_t count = fwrite( &header, sizeof(TgaHeader), 1, outFile ); - // if file header was not successfully written - if( 1 != count ) - { - ret = false; - } - } - - if( ret ) - { - size_t count = - fwrite( BGRPixels, Width * Height * Channels, 1, outFile ); - - // if file data was not successfully written - if( 1 != count ) - { - ret = false; - } - } - - if( outFile ) - { - fclose( outFile ); - } - - if( BGRPixels ) - { - delete[] BGRPixels; - } - - return ret; -} - -bool TGAImageMin::Initialize( uint32_t width, uint32_t height, uint32_t channels ) -{ - bool result = true; - - if(width < 1 || height < 1 || (channels != 3 && channels != 4)) - { - result = false; - } - else - { - Height = height; - Width = width; - Channels = channels; - - RGBPixels = new uint8_t[ width * height * channels ]; - if( !RGBPixels ) - result = false; - } - - return result; -} - - -//----------------------------------------------------------------------------- -/// Create mglGraph object in IDTF mode. -HMGL mgl_create_graph_idtf() -{ return new mglGraphIDTF; } -/// Create mglGraph object in IDTF mode. -uintptr_t mgl_create_graph_idtf_() -{ return uintptr_t(new mglGraphIDTF); } -//----------------------------------------------------------------------------- -// helper output routines -//----------------------------------------------------------------------------- -inline std::string i2s ( int x ) -{ - std::ostringstream o; - o << x; - return o.str(); -}; -//----------------------------------------------------------------------------- -#define IDTFPrintVector3(x) \ - (x)[0] << " " << (x)[1] << " " << (x)[2] -//----------------------------------------------------------------------------- -#define IDTFPrintVector4(x) \ - (x)[0] << " " << (x)[1] << " " << (x)[2] << " " << (x)[3] -//----------------------------------------------------------------------------- -#define sign(x) ((x<0.0) ? (-1.0) : (1.0)) - -static mreal mgl_globpos[4][4] = { {0.5, 0, 0, 0.5}, {0, 0.5, 0, 0.5}, {0, 0, 0.5, 0.5}, {0, 0, 0, 1} }; -static mreal mgl_globinv[4][4] = { {2, 0, 0, -1}, {0, 2, 0, -1}, {0, 0, 2, -1}, {0, 0, 0, 1} }; -const mreal mgl_definv[4][4] = { {2, 0, 0, -1}, {0, 2, 0, -1}, {0, 0, 2, -1}, {0, 0, 0, 1} }; -const mreal mgl_idtrans[4][4] = { {1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1} }; - -//----------------------------------------------------------------------------- -// u3d object methods -//----------------------------------------------------------------------------- -void u3dNode::print ( std::ofstream& ostr ) -{ - ostr - << "NODE \"" << this->type << "\" {\n" - << "\tNODE_NAME \"" << this->name << "\"\n" - << "\tPARENT_LIST {\n" - << "\t\tPARENT_COUNT 1\n" - << "\t\tPARENT 0 {\n" - << "\t\t\tPARENT_NAME \"" << ( this->parent.empty() ? std::string("") : this->parent ) << "\"\n" - << "\t\t\tPARENT_TM {\n"; - for ( int i=0; i<4;i++ ) - ostr << "\t\t\t\t" << IDTFPrintVector4 ( position[i] ) << "\n"; - ostr << "\t\t\t}\n" - << "\t\t}\n" - << "\t}\n"; - if ( this->type != "GROUP" ) - { - ostr << "\tRESOURCE_NAME \"" << ( this->resource.empty() ? this->name : this->resource ) << "\"\n"; - } - if ( this->type == "MODEL" && both_visible ) - { - ostr << "\tMODEL_VISIBILITY \"BOTH\"\n"; - } - ostr << "}\n" - << "\n"; -}; - -void u3dLight::print_light_resource ( std::ofstream& ostr ) -{ - ostr - << "\t\tRESOURCE_NAME \"" << this->name << "\"\n" - << "\t\tLIGHT_TYPE \"" << this->type << "\"\n" - << "\t\tLIGHT_COLOR " << this->color.r << " " << this->color.g << " " << this->color.b << "\n" - << "\t\tLIGHT_ATTENUATION " << this->attenuation << " 0.000000 0.000000\n" - << "\t\tLIGHT_INTENSITY " << this->intensity << "\n"; -}; -void u3dLight::print_node ( std::ofstream& ostr ) -{ - u3dNode Node; - Node.name = name; -// for(int i=0; i<3; i++) -// for(int j=0; j<3; j++) -// Node.position[i][j]=this->position[i][j]; - memcpy ( Node.position,this->position, sizeof ( Node.position ) ); - Node.type = "LIGHT"; - Node.print ( ostr ); -} - -void mglGraphIDTF::SetAmbientLight ( mglColor c, mreal br ) -{ - u3dLight Light; - Lights.push_back ( Light ); - - Lights.back().name = "AmbientLight"; - Lights.back().type = "AMBIENT"; - Lights.back().attenuation = 1.0; - Lights.back().intensity = br >= 0.0 ? br : this->AmbBr;; - Lights.back().color = c; - memcpy ( Lights.back().position, mgl_idtrans, sizeof ( mgl_idtrans ) ); - } -void mglGraphIDTF::AddLight ( mglPoint p, mglColor color, mreal br, bool infty ) -{ - u3dLight Light; - Lights.push_back ( Light ); - - Lights.back().color = color; - Lights.back().attenuation = 1.0; - Lights.back().intensity = br; - Lights.back().name = "Light" + i2s ( Lights.size() ); - - memcpy ( Lights.back().position, mgl_idtrans, sizeof ( mgl_idtrans ) ); - mreal a = p.x, b = p.y, c = p.z; - if ( infty ) - { - Lights.back().type = "DIRECTIONAL"; - mreal n = sqrt ( a*a+b*b+c*c ); - if ( n != 0.0f ) - { - a /= n; b /= n; c /=n; - } - else - return; - if ( sqrt ( a*a+b*b ) != 0.0 ) - { -// -b/sqrt(a*a+b*b) -a/sqrt(a*a+b*b) 0.0 -// -a*c/sqrt(a*a+b*b) -b*c/sqrt(a*a+b*b) sqrt(a*a+b*b) -// a b c - Lights.back().position[0][0] = -b/sqrt ( a*a+b*b ); - Lights.back().position[0][1] = -a/sqrt ( a*a+b*b ); - Lights.back().position[1][0] = -a*c/sqrt ( a*a+b*b ); - Lights.back().position[1][1] = -b*c/sqrt ( a*a+b*b ); - Lights.back().position[1][2] = sqrt ( a*a+b*b ); - Lights.back().position[2][0] = a; - Lights.back().position[2][1] = b; - Lights.back().position[2][2] = c; - } - else - { -// 1 0 0 -// 0 1 0 -// 0 0 sign(c) - Lights.back().position[2][2] = sign ( c ); - } - } - else - { - Lights.back().type = "POINT"; - Lights.back().position[3][0] = a; - Lights.back().position[3][1] = b; - Lights.back().position[3][2] = c; - } - - -}; - -void u3dMaterial::print_material ( std::ofstream& ostr ) -{ - ostr - << "\t\tRESOURCE_NAME \"" << name << "\"\n" - << "\t\tMATERIAL_AMBIENT 0.000000 0.000000 0.000000\n" - << "\t\tMATERIAL_DIFFUSE " << diffuse.r << " " << diffuse.g << " " << diffuse.b << "\n" - << "\t\tMATERIAL_SPECULAR " << specular.r << " " << specular.g << " " << specular.b << "\n" - << "\t\tMATERIAL_EMISSIVE " << emissive.r << " " << emissive.g << " " << emissive.b << "\n" - << "\t\tMATERIAL_REFLECTIVITY " << reflectivity << "\n" - << "\t\tMATERIAL_OPACITY " << opacity << "\n"; -} - -void u3dMaterial::print_shader ( std::ofstream& ostr ) -{ - ostr << "\t\tRESOURCE_NAME \"" << this->name << "\"\n"; - if ( this->texture.empty() && this->vertex_color ) - { - ostr << "\t\tATTRIBUTE_USE_VERTEX_COLOR \"TRUE\"\n"; - } - ostr << "\t\tSHADER_MATERIAL_NAME \"" << this->name << "\"\n"; - if ( this->texture.empty() ) - ostr - << "\t\tSHADER_ACTIVE_TEXTURE_COUNT 0\n"; - else - { - ostr - << "\t\tSHADER_ACTIVE_TEXTURE_COUNT 1\n" - << "\t\tSHADER_TEXTURE_LAYER_LIST {\n" - << "\t\t\tTEXTURE_LAYER 0 {\n" - << "\t\t\t\tTEXTURE_LAYER_BLEND_FUNCTION \"REPLACE\"\n" - << "\t\t\t\tTEXTURE_LAYER_BLEND_SOURCE \"ALPHA\"\n"; - if (this->textumrealpha) - ostr << - "\t\t\t\tTEXTURE_LAYER_ALPHA_ENABLED \"TRUE\"\n"; - ostr - << "\t\t\t\tTEXTURE_LAYER_REPEAT \"NONE\"\n" - << "\t\t\t\tTEXTURE_NAME \"" << this->texture << "\"\n" - << "\t\t\t}\n" - << "\t\t}\n"; - } -} - -size_t mglGraphIDTF::AddMaterial ( const u3dMaterial& Material ) -{ - size_t mid; - for ( mid = 0; mid < Materials.size(); mid++ ) - { - if ( Materials[mid] == Material ) - { - return mid; - } - } - - Materials.push_back ( Material ); - Materials.back().name = "Material" + i2s ( mid ); - return ( mid ); -} - -void u3dTexture::print_texture ( const char *fname, std::ofstream& ostr ) -{ - char filename[PATH_MAX]; - bzero( filename, sizeof(filename) ); - const size_t fnlen = strlen(fname); - if ( fnlen > 5 && strcasecmp(fname+fnlen-5, ".idtf") == 0 ) - strncpy(filename, fname, ( sizeof(filename)-1 > fnlen-5 ) ? (fnlen-5) : (sizeof(filename)-1) ); - else - strncpy(filename, fname, sizeof(filename)-1); - strncat(filename, this->name.c_str(), sizeof(filename)-strlen(filename)-5); - strcat(filename, ".tga" ); - ostr - << "\t\tRESOURCE_NAME \"" << this->name << "\"\n"; - if (this->image.Channels == 4) - ostr << - "\t\tTEXTURE_IMAGE_TYPE \"RGBA\"\n"; - ostr - << "\t\tTEXTURE_IMAGE_COUNT 1\n" - << "\t\tIMAGE_FORMAT_LIST {\n" - << "\t\t\tIMAGE_FORMAT 0 {\n" - << "\t\t\t\tCOMPRESSION_TYPE \"PNG\"\n"; - if (this->image.Channels == 4) - ostr << - "\t\t\t\tALPHA_CHANNEL \"TRUE\"\n"; - ostr - << "\t\t\t\tBLUE_CHANNEL \"TRUE\"\n" - << "\t\t\t\tGREEN_CHANNEL \"TRUE\"\n" - << "\t\t\t\tRED_CHANNEL \"TRUE\"\n" - << "\t\t\t}\n" - << "\t\t}\n" - << "\t\tTEXTURE_PATH \"" << filename << "\"\n"; - this->image.Write( filename ); -} - -u3dTexture& mglGraphIDTF::AddTexture() -{ - u3dTexture Texture; - Textures.push_back ( Texture ); - Textures.back().name = "Texture" + i2s ( Textures.size() ); - Textures.back().image.Width = 0; - Textures.back().image.Height = 0; - Textures.back().image.Channels = 0; - Textures.back().image.RGBPixels = NULL; - return ( Textures.back() ); -} - -// Get the last point set or start a new one if things have changed -u3dPointSet& mglGraphIDTF::GetPointSet() -{ - if ( points_finished ) - { - u3dPointSet PointSet = u3dPointSet ( "PointSet" + i2s ( PointSets.size() ), this ); - PointSets.push_back ( PointSet ); - points_finished = false; - } - return PointSets.back(); -} - -// Get the last line set or start a new one if things have changed -u3dLineSet& mglGraphIDTF::GetLineSet() -{ - if ( lines_finished ) - { - u3dLineSet LineSet = u3dLineSet ( "LineSet" + i2s ( LineSets.size() ), this ); - LineSets.push_back ( LineSet ); - lines_finished = false; - } - return LineSets.back(); -} - -// Get the last mesh or start a new one if things have changed -u3dMesh& mglGraphIDTF::GetMesh() -{ - if ( mesh_finished ) - { - u3dMesh Mesh = u3dMesh ( "Mesh" + i2s ( Meshes.size() ), this, this->vertex_color_flag, this->disable_compression_flag ); - Meshes.push_back ( Mesh ); - mesh_finished = false; - } - return Meshes.back(); -} - -size_t u3dModel::AddPoint ( const mreal *p ) -{ - return AddPoint( mglPoint ( p[0], p[1], p[2] ) ); -} - -size_t u3dModel::AddPoint ( const mglPoint& pnt ) -{ - mglPoint point; - point.x = invpos[0][0]*pnt.x+invpos[0][1]*pnt.y+invpos[0][2]*pnt.z+invpos[0][3]; - point.y = invpos[1][0]*pnt.x+invpos[1][1]*pnt.y+invpos[1][2]*pnt.z+invpos[1][3]; - point.z = invpos[2][0]*pnt.x+invpos[2][1]*pnt.y+invpos[2][2]*pnt.z+invpos[2][3]; -// printf("%f %f %f - %f %f %f\n", pnt.x, pnt.y, pnt.z, point.x, point.y, point.z); - for ( size_t i=0; i< this->Points.size(); i++ ) - if ( this->Points[i] == point ) - return i; - this->Points.push_back ( point ); - return ( this->Points.size()-1 ); -} - -size_t u3dModel::AddColor ( const mreal *c ) -{ - mglColor color = mglColor ( IDTFROUND(c[0]), IDTFROUND(c[1]), IDTFROUND(c[2]) ); - for ( size_t i=0; i< this->Colors.size(); i++ ) - if ( this->Colors[i] == color ) - return i; - this->Colors.push_back ( color ); - return ( this->Colors.size()-1 ); -}; - -size_t u3dModel::AddColor ( const mglColor& c ) -{ - mglColor color = mglColor ( c.r, c.g, c.b ); - for ( size_t i=0; i< this->Colors.size(); i++ ) - if ( this->Colors[i] == color ) - return i; - this->Colors.push_back ( color ); - return ( this->Colors.size()-1 ); -}; - -void u3dMesh::AddTriangle ( size_t pid0, size_t pid1, size_t pid2, - size_t cid0, size_t cid1, size_t cid2 ) -{ - size_t3 triangle; - triangle.a = pid0; - triangle.b = pid1; - triangle.c = pid2; - Triangles.push_back ( triangle ); - triangle.a = cid0; - triangle.b = cid1; - triangle.c = cid2; - faceColors.push_back ( triangle ); -}; - -void u3dMesh::AddTriangle ( size_t pid0, size_t pid1, size_t pid2, size_t mid) -{ - size_t3 triangle; - triangle.a = pid0; - triangle.b = pid1; - triangle.c = pid2; - Triangles.push_back ( triangle ); - faceShaders.push_back ( mid ); -}; -//----------------------------------------------------------------------------- -void mglGraphIDTF::MakeTransformMatrix( mreal position[4][4], mreal invpos[4][4] ) -{ - const mreal s3=2*PlotFactor; - position[0][0]=B[0] /(s3*zoomx2); - position[0][1]=B[1] /(s3*zoomx2); - position[0][2]=B[2] /(s3*zoomx2); - position[0][3]=(xPos - zoomx1*Width)/(zoomx2); - position[1][0]=B[3] /(s3*zoomy2); - position[1][1]=B[4] /(s3*zoomy2); - position[1][2]=B[5] /(s3*zoomy2); - position[1][3]=(yPos - zoomy1*Height)/(zoomy2); - position[2][0]=B[6] /(s3*sqrt(zoomx2*zoomy2)); - position[2][1]=B[7] /(s3*sqrt(zoomx2*zoomy2)); - position[2][2]=B[8] /(s3*sqrt(zoomx2*zoomy2)); - position[2][3]=(zPos) /(sqrt(zoomx2*zoomy2)); - position[3][0]=0.0f; - position[3][1]=0.0f; - position[3][2]=0.0f; - position[3][3]=1.0f; -// -// From Mesa-2.2\src\glu\project.c -// - -// -// Invert matrix m. This algorithm contributed by Stephane Rehel -// -// - -/* Here's some shorthand converting standard (row,column) to index. */ -#define m11 position[0][0] -#define m12 position[0][1] -#define m13 position[0][2] -#define m14 position[0][3] -#define m21 position[1][0] -#define m22 position[1][1] -#define m23 position[1][2] -#define m24 position[1][3] -#define m31 position[2][0] -#define m32 position[2][1] -#define m33 position[2][2] -#define m34 position[2][3] -#define m41 position[3][0] -#define m42 position[3][1] -#define m43 position[3][2] -#define m44 position[3][3] - - register double det; - double tmp[16]; /* Allow out == in. */ - - /* Inverse = adjoint / det. (See linear algebra texts.)*/ - - tmp[0]= m22 * m33 - m23 * m32; - tmp[1]= m23 * m31 - m21 * m33; - tmp[2]= m21 * m32 - m22 * m31; - - /* Compute determinant as early as possible using these cofactors. */ - det= m11 * tmp[0] + m12 * tmp[1] + m13 * tmp[2]; - - /* Run singularity test. */ - if (det == 0.0) { - printf("invert_matrix: Warning: Singular matrix.\n"); - bzero ( invpos, sizeof ( invpos ) ); - } - else { - double d12, d13, d23, d24, d34, d41; - register double im11, im12, im13, im14; - - det= 1. / det; - - /* Compute rest of inverse. */ - tmp[0] *= det; - tmp[1] *= det; - tmp[2] *= det; - tmp[3] = 0.; - - im11= m11 * det; - im12= m12 * det; - im13= m13 * det; - im14= m14 * det; - tmp[4] = im13 * m32 - im12 * m33; - tmp[5] = im11 * m33 - im13 * m31; - tmp[6] = im12 * m31 - im11 * m32; - tmp[7] = 0.; - - /* Pre-compute 2x2 dets for first two rows when computing */ - /* cofactors of last two rows. */ - d12 = im11*m22 - m21*im12; - d13 = im11*m23 - m21*im13; - d23 = im12*m23 - m22*im13; - d24 = im12*m24 - m22*im14; - d34 = im13*m24 - m23*im14; - d41 = im14*m21 - m24*im11; - - tmp[8] = d23; - tmp[9] = -d13; - tmp[10] = d12; - tmp[11] = 0.; - - tmp[12] = -(m32 * d34 - m33 * d24 + m34 * d23); - tmp[13] = (m31 * d34 + m33 * d41 + m34 * d13); - tmp[14] = -(m31 * d24 + m32 * d41 + m34 * d12); - tmp[15] = 1.; - - for (int r=0; r<4; r++) - for (int c=0; c<4; c++) - invpos[r][c] = tmp[c*4+r]; - } - -#undef m11 -#undef m12 -#undef m13 -#undef m14 -#undef m21 -#undef m22 -#undef m23 -#undef m24 -#undef m31 -#undef m32 -#undef m33 -#undef m34 -#undef m41 -#undef m42 -#undef m43 -#undef m44 -/* puts("pos"); - printf("%f %f %f %f\n", position[0][0], position[0][1], position[0][2], position[0][3]); - printf("%f %f %f %f\n", position[1][0], position[1][1], position[1][2], position[1][3]); - printf("%f %f %f %f\n", position[2][0], position[2][1], position[2][2], position[2][3]); - printf("%f %f %f %f\n", position[3][0], position[3][1], position[3][2], position[3][3]); - puts("invpos"); - printf("%f %f %f %f\n", invpos[0][0], invpos[0][1], invpos[0][2], invpos[0][3]); - printf("%f %f %f %f\n", invpos[1][0], invpos[1][1], invpos[1][2], invpos[1][3]); - printf("%f %f %f %f\n", invpos[2][0], invpos[2][1], invpos[2][2], invpos[2][3]); - printf("%f %f %f %f\n", invpos[3][0], invpos[3][1], invpos[3][2], invpos[3][3]); - - printf("B %f %f %f %f %f %f %f %f %f\n", B[0], B[1], B[2], B[3], B[4], B[5], B[6], B[7], B[8]); - printf("pos %f %f %f\n", xPos, yPos, zPos); */ -} -//----------------------------------------------------------------------------- -u3dModel::u3dModel ( const std::string name, mglGraphIDTF *Graph, const bool& vertex_color ) -{ - this->name = name; - this->Graph = Graph; - this->vertex_color = vertex_color; - this->both_visible = Graph->double_sided_flag; - this->parent = Graph->GetCurrentGroup(); - if (this->parent) this->parent->NumberOfChildren++; - Graph->MakeTransformMatrix(this->position, this->invpos); -} -//----------------------------------------------------------------------------- -size_t u3dModel::AddModelMaterial ( const mreal *c, bool emissive, bool vertex_color ) -{ - u3dMaterial Material; - mglColor color = mglColor ( IDTFROUND(c[0]), IDTFROUND(c[1]), IDTFROUND(c[2]) ); - if ( emissive ) - { - Material.diffuse = color; - Material.specular = BC; - Material.emissive = color; - } - else - { - Material.diffuse = Graph->diff_int * color; - Material.specular = Graph->spec_int * color; - Material.emissive = Graph->emis_int * color; - } - Material.opacity = this->Graph->fixalpha ( c[3] ); - Material.vertex_color = vertex_color; - for ( size_t mid=0; mid < this->ModelMaterials.size(); mid++ ) - { - if ( Graph->Materials[this->ModelMaterials[mid]] == Material ) - { - return ( mid ); - } - } - this->ModelMaterials.push_back ( Graph->AddMaterial ( Material ) ); - return ( this->ModelMaterials.size()-1 ); -}; -void u3dModel::print_node ( std::ofstream& ostr ) -{ - u3dNode Node; - Node.name = name; - - for ( int i=0; i<4;i++ ) - for ( int j=0; j<4;j++ ) - Node.position[i][j] = position[0][i]*mgl_globinv[j][0] - + position[1][i]*mgl_globinv[j][1] - + position[2][i]*mgl_globinv[j][2] - + position[3][i]*mgl_globinv[j][3]; - Node.type = "MODEL"; - Node.both_visible = this->both_visible; - if ( this->parent == NULL) - Node.parent = ""; - else - Node.parent = this->parent->name; - Node.print ( ostr ); -} -void u3dModel::print_shading_modifier ( std::ofstream& ostr ) -{ - ostr << "MODIFIER \"SHADING\" {\n" - << "\tMODIFIER_NAME \"" << this->name << "\"\n" - << "\tPARAMETERS {\n" - << "\t\tSHADER_LIST_COUNT " << this->ModelMaterials.size() << "\n" - << "\t\tSHADER_LIST_LIST {\n"; - int ShaderListNum = 0; - for ( ModelMaterial_list::const_iterator it = this->ModelMaterials.begin(); it != this->ModelMaterials.end(); ++it ) - { - ostr << "\t\t\tSHADER_LIST " << ShaderListNum++ << " {\n" - << "\t\t\t\tSHADER_COUNT 1\n" - << "\t\t\t\tSHADER_NAME_LIST {\n" - << "\t\t\t\t\tSHADER 0 NAME: \"" << Graph->Materials[*it].name << "\"\n" - << "\t\t\t\t}\n" - << "\t\t\t}\n"; - } - ostr << "\t\t}\n" - << "\t}\n" - << "}\n" - << "\n"; -} -void u3dBall::print_node ( std::ofstream& ostr ) -{ - u3dNode Node; - Node.name = name; - Node.resource = "UnitBall"; - mreal position[4][4]; - memcpy ( position, mgl_idtrans, sizeof ( mgl_idtrans ) ); - position[0][0] = this->radius; - position[1][1] = this->radius; - position[2][2] = this->radius; - position[0][3] = this->center.x; - position[1][3] = this->center.y; - position[2][3] = this->center.z; - for ( int i=0; i<4;i++ ) - for ( int j=0; j<4;j++ ) - Node.position[i][j] = position[0][i]*mgl_globinv[j][0] - + position[1][i]*mgl_globinv[j][1] - + position[2][i]*mgl_globinv[j][2] - + position[3][i]*mgl_globinv[j][3]; - Node.type = "MODEL"; - Node.both_visible = false; - if ( this->parent == NULL) - Node.parent = ""; - else - Node.parent = this->parent->name; - Node.print ( ostr ); -} - -void u3dBall::print_shading_modifier ( std::ofstream& ostr ) -{ - ostr << "MODIFIER \"SHADING\" {\n" - << "\tMODIFIER_NAME \"" << this->name << "\"\n" - << "\tPARAMETERS {\n" - << "\t\tSHADER_LIST_COUNT 1\n" - << "\t\tSHADER_LIST_LIST {\n" - << "\t\t\tSHADER_LIST 0 {\n" - << "\t\t\t\tSHADER_COUNT 1\n" - << "\t\t\t\tSHADER_NAME_LIST {\n" - << "\t\t\t\t\tSHADER 0 NAME: \"" << this->Graph->Materials[this->material].name << "\"\n" - << "\t\t\t\t}\n" - << "\t\t\t}\n" - << "\t\t}\n" - << "\t}\n" - << "}\n" - << "\n"; -} - -u3dPointSet::u3dPointSet ( const std::string& name, mglGraphIDTF *Graph ) : - u3dModel ( name, Graph, true ) -{ - const mreal color[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; - this->AddModelMaterial ( color, true, true ); - this->both_visible = false; -} -void u3dPointSet::point_plot ( const mglPoint& pnt, const mglColor& c ) -{ - mglPoint point; - point.x = invpos[0][0]*pnt.x+invpos[0][1]*pnt.y+invpos[0][2]*pnt.z+invpos[0][3]; - point.y = invpos[1][0]*pnt.x+invpos[1][1]*pnt.y+invpos[1][2]*pnt.z+invpos[1][3]; - point.z = invpos[2][0]*pnt.x+invpos[2][1]*pnt.y+invpos[2][2]*pnt.z+invpos[2][3]; - Points.push_back( point ); - Colors.push_back( c ); -} - -void u3dPointSet::print_model_resource ( std::ofstream& ostrtmp ) -{ - if ( this->Points.size() == 0 ) return; - // is there just one color in the model? - bool onecolor = true; - size_t numColors = this->Colors.size(); - for ( size_t cid=0; cid < numColors; cid++ ) - { - if ( Colors[0].r != Colors[cid].r || Colors[0].g != Colors[cid].g || Colors[0].b != Colors[cid].b ) - { - onecolor = false; - break; - } - } - if ( onecolor ) // if there is just one color in the model - make the corresponding material - { - this->ModelMaterials.pop_back(); - mreal c[4] = { this->Colors[0].r, this->Colors[0].g, this->Colors[0].b, 1.0f }; - this->AddModelMaterial ( c, true, false ); - this->Colors.clear(); - numColors = 0; - this->vertex_color = false; - } - bool colored = this->Colors.size() > 0; - - if ( !colored && this->Colors[0] == BC ) -{ - size_t numMaterials = this->ModelMaterials.size(); - size_t numPoints = this->Points.size(); - - if ( numPoints == 0 ) return; - - ostrtmp - << "\t\tRESOURCE_NAME \"" << this->name << "\"\n" - << "\t\tMODEL_TYPE \"POINT_SET\"\n" - << "\t\tPOINT_SET {\n" - << "\t\t\tPOINT_COUNT " << numPoints << "\n" - << "\t\t\tMODEL_POSITION_COUNT " << numPoints << "\n" - << "\t\t\tMODEL_NORMAL_COUNT 0\n" - << "\t\t\tMODEL_DIFFUSE_COLOR_COUNT 0\n" - << "\t\t\tMODEL_SPECULAR_COLOR_COUNT 0\n" - << "\t\t\tMODEL_TEXTURE_COORD_COUNT 0\n" - << "\t\t\tMODEL_SHADING_COUNT " << numMaterials << "\n" - << "\t\t\tMODEL_SHADING_DESCRIPTION_LIST {\n"; - for ( size_t id=0; id < numMaterials; id++ ) - { - ostrtmp - << "\t\t\t\tSHADING_DESCRIPTION " << id << " {\n" - << "\t\t\t\t\tTEXTURE_LAYER_COUNT 0\n" - << "\t\t\t\t\tSHADER_ID " << id << "\n" - << "\t\t\t\t}\n"; - } - ostrtmp << "\t\t\t}\n"; - - ostrtmp << "\t\t\tPOINT_POSITION_LIST {\n"; - for ( size_t id=0; id < numPoints; id++ ) - { - ostrtmp << "\t\t\t\t" << i2s ( id ) << "\n"; - } - ostrtmp << "\t\t\t}\n"; - - ostrtmp << "\t\t\tPOINT_SHADING_LIST {\n"; - for ( size_t id=0; id < numPoints; id++ ) - { - ostrtmp << "\t\t\t\t 0\n"; - } - ostrtmp << "\t\t\t}\n"; - - ostrtmp << "\t\t\tMODEL_POSITION_LIST {\n"; - for ( size_t pid=0; pid < numPoints; pid++ ) - { - ostrtmp << "\t\t\t\t" - << ( this->Points[pid].x ) << " " - << ( this->Points[pid].y ) << " " - << ( this->Points[pid].z ) << "\n"; - } - ostrtmp << "\t\t\t}\n"; - - ostrtmp << "\t\t}\n"; -} -else -// Convert pointset to mesh -{ - size_t numPoints = this->Points.size(); - size_t duplpoints = this->Points.size() % 3; - if ( duplpoints > 0 ) - { - this->Points.push_back( this->Points.back() ); - this->Colors.push_back( this->Colors.back() ); - numPoints++; - } - if ( duplpoints == 1 ) - { - this->Points.push_back( this->Points.back() ); - this->Colors.push_back( this->Colors.back() ); - numPoints++; - } - - size_t numTriangles = this->Points.size() / 3; - - ostrtmp - << "\t\tRESOURCE_NAME \"" << this->name << "\"\n" - << "\t\tMODEL_TYPE \"MESH\"\n" - << "\t\tMESH {\n" - << "\t\t\tFACE_COUNT " << numTriangles << "\n" - << "\t\t\tMODEL_POSITION_COUNT " << numPoints << "\n" - << "\t\t\tMODEL_BASE_POSITION_COUNT " << numPoints << "\n" - << "\t\t\tMODEL_NORMAL_COUNT 0\n" - << "\t\t\tMODEL_DIFFUSE_COLOR_COUNT " << numColors << "\n" - << "\t\t\tMODEL_SPECULAR_COLOR_COUNT 0\n" - << "\t\t\tMODEL_TEXTURE_COORD_COUNT 0\n" - << "\t\t\tMODEL_BONE_COUNT 0\n" - << "\t\t\tMODEL_SHADING_COUNT 1\n" - << "\t\t\tMODEL_SHADING_DESCRIPTION_LIST {\n" - << "\t\t\t\tSHADING_DESCRIPTION 0 {\n" - << "\t\t\t\t\tTEXTURE_LAYER_COUNT 0\n" - << "\t\t\t\t\tSHADER_ID 0\n" - << "\t\t\t\t}\n" - << "\t\t\t}\n"; - - ostrtmp << "\t\t\tMESH_FACE_POSITION_LIST {\n"; - for ( size_t id=0; id < numTriangles; id++ ) - { - ostrtmp << "\t\t\t\t" - << 3*id+0 << " " - << 3*id+1 << " " - << 3*id+2 << "\n"; - } - ostrtmp << "\t\t\t}\n"; - - ostrtmp << "\t\t\tMESH_FACE_SHADING_LIST {\n"; - for ( size_t id=0; id < numTriangles; id++ ) - { - ostrtmp << "\t\t\t\t0\n"; - } - ostrtmp << "\t\t\t}\n"; - - if ( colored ) - { - ostrtmp << "\t\t\tMESH_FACE_DIFFUSE_COLOR_LIST {\n"; - for ( size_t id=0; id < numTriangles; id++ ) - { - ostrtmp << "\t\t\t\t" - << 3*id+0 << " " - << 3*id+1 << " " - << 3*id+2 << "\n"; - } - ostrtmp << "\t\t\t}\n"; - } - - ostrtmp << "\t\t\tMODEL_POSITION_LIST {\n"; - for ( size_t pid=0; pid < numPoints; pid++ ) - { - ostrtmp << "\t\t\t\t" - << ( this->Points[pid].x ) << " " - << ( this->Points[pid].y ) << " " - << ( this->Points[pid].z ) << "\n"; - } - ostrtmp << "\t\t\t}\n"; - - if ( colored ) - { - ostrtmp << "\t\t\tMODEL_DIFFUSE_COLOR_LIST {\n"; - for ( size_t cid=0; cid < numColors; cid++ ) - { - ostrtmp << "\t\t\t\t" - << this->Colors[cid].r << " " - << this->Colors[cid].g << " " - << this->Colors[cid].b << "\n"; - } - ostrtmp << "\t\t\t}\n"; - } - - ostrtmp << "\t\t\tMODEL_BASE_POSITION_LIST {\n"; - for ( size_t pid=0; pid < numPoints; pid++ ) - { - ostrtmp << "\t\t\t\t" << pid << "\n"; - } - ostrtmp << "\t\t\t}\n"; - - ostrtmp << "\t\t}\n"; -} -} -/* -*/ -void u3dLineSet::AddLine ( size_t pid1, size_t pid2, size_t mid ) -{ - u3dLine line = {pid1, pid2, mid}; - for ( size_t lid=0; lid < this->Lines.size(); lid++ ) - { - if ( this->Lines[lid].mid == mid && ( - ( this->Lines[lid].pid1 == pid1 && this->Lines[lid].pid2 == pid2 ) - || - ( this->Lines[lid].pid1 == pid2 && this->Lines[lid].pid2 == pid1 ) - ) ) - { - return; - } - } - this->Lines.push_back ( line ); -} - -void u3dLineSet::line_plot ( mreal *p1, mreal *p2, mreal *c1, mreal *c2 ) -{ - mreal color[4]; - size_t pid1 = this->AddPoint ( p1 ); - size_t pid2 = this->AddPoint ( p2 ); - color[0] = ( c1[0] + c2[0] ) /2.0f; - color[1] = ( c1[1] + c2[1] ) /2.0f; - color[2] = ( c1[2] + c2[2] ) /2.0f; - color[3] = 1.0f; - size_t mid = this->AddModelMaterial ( color, true, false ); - u3dLine line = {pid1, pid2, mid}; - this->Lines.push_back ( line ); -} - -void u3dLineSet::print_model_resource ( std::ofstream& ostrtmp ) -{ - size_t numMaterials = this->ModelMaterials.size(); - size_t numPoints = this->Points.size(); - size_t numLines = this->Lines.size(); - - if ( numLines == 0 ) return; - - ostrtmp - << "\t\tRESOURCE_NAME \"" << this->name << "\"\n" - << "\t\tMODEL_TYPE \"LINE_SET\"\n" - << "\t\tLINE_SET {\n" - << "\t\t\tLINE_COUNT " << numLines << "\n" - << "\t\t\tMODEL_POSITION_COUNT " << numPoints << "\n" - << "\t\t\tMODEL_NORMAL_COUNT 0\n" - << "\t\t\tMODEL_DIFFUSE_COLOR_COUNT 0\n" - << "\t\t\tMODEL_SPECULAR_COLOR_COUNT 0\n" - << "\t\t\tMODEL_TEXTURE_COORD_COUNT 0\n" - << "\t\t\tMODEL_SHADING_COUNT " << numMaterials << "\n" - << "\t\t\tMODEL_SHADING_DESCRIPTION_LIST {\n"; - for ( size_t id=0; id < numMaterials; id++ ) - { - ostrtmp - << "\t\t\t\tSHADING_DESCRIPTION " << id << " {\n" - << "\t\t\t\t\tTEXTURE_LAYER_COUNT 0\n" - << "\t\t\t\t\tSHADER_ID " << id << "\n" - << "\t\t\t\t}\n"; - } - ostrtmp << "\t\t\t}\n"; - - ostrtmp << "\t\t\tLINE_POSITION_LIST {\n"; - for ( size_t id=0; id < numLines; id++ ) - { - ostrtmp << "\t\t\t\t" << i2s ( this->Lines[id].pid1 ) << " " << i2s ( this->Lines[id].pid2 ) << "\n"; - } - ostrtmp << "\t\t\t}\n"; - - ostrtmp << "\t\t\tLINE_SHADING_LIST {\n"; - for ( size_t id=0; id < numLines; id++ ) - { - ostrtmp << "\t\t\t\t" << this->Lines[id].mid << "\n"; - } - ostrtmp << "\t\t\t}\n"; - - ostrtmp << "\t\t\tMODEL_POSITION_LIST {\n"; - for ( size_t pid=0; pid < numPoints; pid++ ) - { - ostrtmp << "\t\t\t\t" - << ( this->Points[pid].x ) << " " - << ( this->Points[pid].y ) << " " - << ( this->Points[pid].z ) << "\n"; - } - ostrtmp << "\t\t\t}\n"; - - ostrtmp << "\t\t}\n"; -} -//----------------------------------------------------------------------------- -void u3dMesh::quad_plot ( mreal *pp0,mreal *pp1,mreal *pp2,mreal *pp3, - mreal *cc0,mreal *cc1,mreal *cc2,mreal *cc3 ) -{ - this->trig_plot ( pp0,pp1,pp2,cc0,cc1,cc2 ); - this->trig_plot ( pp1,pp3,pp2,cc1,cc3,cc2 ); -} -//----------------------------------------------------------------------------- -void u3dMesh::quad_plot_n ( mreal *pp0,mreal *pp1,mreal *pp2,mreal *pp3, - mreal *cc0,mreal *cc1,mreal *cc2,mreal *cc3, - mreal *nn0,mreal *nn1,mreal *nn2,mreal *nn3 ) -{ - this->trig_plot_n ( pp0,pp1,pp2,cc0,cc1,cc2,nn0,nn1,nn2 ); - this->trig_plot_n ( pp1,pp3,pp2,cc1,cc3,cc2,nn0,nn2,nn3 ); -} -//----------------------------------------------------------------------------- -void u3dMesh::trig_plot ( mreal *pp0,mreal *pp1,mreal *pp2, - mreal *cc0,mreal *cc1,mreal *cc2 ) -{ - size_t pid0 = this->AddPoint ( pp0 ); - size_t pid1 = this->AddPoint ( pp1 ); - size_t pid2 = this->AddPoint ( pp2 ); - - if ( !this->vertex_color ) - { - const mreal color[4] = - { - ( cc0[0]+cc1[0]+cc2[0] ) /3.0f, - ( cc0[1]+cc1[1]+cc2[1] ) /3.0f, - ( cc0[2]+cc1[2]+cc2[2] ) /3.0f, - ( cc0[3]+cc1[3]+cc2[3] ) /3.0f - }; - size_t mid = this->AddModelMaterial ( color, false, false); - this->AddTriangle ( pid0, pid1, pid2, mid ); - } - else - { - if ( ModelMaterials.size() == 0 ) - { - const mreal color[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; - this->AddModelMaterial ( color, false, true ); - } - size_t cid0 = this->AddColor ( cc0 ); - size_t cid1 = this->AddColor ( cc1 ); - size_t cid2 = this->AddColor ( cc2 ); - this->AddTriangle ( pid0, pid1, pid2, cid0, cid1, cid2 ); - } -} -//----------------------------------------------------------------------------- -void u3dMesh::trig_plot_n ( mreal *pp0,mreal *pp1,mreal *pp2, - mreal *cc0,mreal *cc1,mreal *cc2, - mreal *nn0,mreal *nn1,mreal *nn2 ) -{ - size_t pid0 = this->AddPoint ( pp0 ); - size_t pid1 = this->AddPoint ( pp1 ); - size_t pid2 = this->AddPoint ( pp2 ); - - if ( !this->vertex_color ) - { - const mreal color[4] = - { - ( cc0[0]+cc1[0]+cc2[0] ) /3.0f, - ( cc0[1]+cc1[1]+cc2[1] ) /3.0f, - ( cc0[2]+cc1[2]+cc2[2] ) /3.0f, - ( cc0[3]+cc1[3]+cc2[3] ) /3.0f - }; - size_t mid = this->AddModelMaterial ( color, false, false ); - this->AddTriangle ( pid0, pid1, pid2, mid ); - } - else - { - if ( ModelMaterials.size() == 0 ) - { - const mreal color[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; - this->AddModelMaterial ( color, false, true ); - } - mreal cc[3]; - size_t cid0 = this->AddColor ( this->Graph->col2col ( cc0, nn0, cc ) ); - size_t cid1 = this->AddColor ( this->Graph->col2col ( cc1, nn1, cc ) ); - size_t cid2 = this->AddColor ( this->Graph->col2col ( cc2, nn2, cc ) ); - this->AddTriangle ( pid0, pid1, pid2, cid0, cid1, cid2 ); - } -} -//----------------------------------------------------------------------------- -void u3dMesh::print_model_resource ( std::ofstream& ostrtmp ) -{ - size_t numMaterials = this->ModelMaterials.size(); - size_t numPoints = this->Points.size(); - size_t numTriangles = this->Triangles.size(); - size_t numTexCoords = this->textureCoords.size(); - bool textured = this->textureDimension > 0; - bool shaded = this->faceShaders.size() > 0; - - if ( numTriangles == 0 ) return; - - if ( this->Colors.size() == 1 ) // if there is just one color in the model - make the corresponding material - { - this->ModelMaterials.pop_back(); - mreal c[4] = { this->Colors[0].r, this->Colors[0].g, this->Colors[0].b, 1.0f }; - this->AddModelMaterial ( c, false, false ); - this->Colors.clear(); - } - bool colored = this->Colors.size() > 0; - size_t numColors = this->Colors.size(); - - ostrtmp - << "\t\tRESOURCE_NAME \"" << this->name << "\"\n" - << "\t\tMODEL_TYPE \"MESH\"\n" - << "\t\tMESH {\n" - << "\t\t\tFACE_COUNT " << numTriangles << "\n" - << "\t\t\tMODEL_POSITION_COUNT " << numPoints << "\n"; - if ( this->disable_compression ) - { - ostrtmp << "\t\t\tMODEL_BASE_POSITION_COUNT " << numPoints << "\n"; - } - ostrtmp - << "\t\t\tMODEL_NORMAL_COUNT 0\n" - << "\t\t\tMODEL_DIFFUSE_COLOR_COUNT " << numColors << "\n" - << "\t\t\tMODEL_SPECULAR_COLOR_COUNT 0\n" - << "\t\t\tMODEL_TEXTURE_COORD_COUNT " << numTexCoords << "\n" - << "\t\t\tMODEL_BONE_COUNT 0\n" - << "\t\t\tMODEL_SHADING_COUNT " << numMaterials << "\n" - << "\t\t\tMODEL_SHADING_DESCRIPTION_LIST {\n"; - for ( size_t cid=0; cid < numMaterials; cid++ ) - { - ostrtmp - << "\t\t\t\tSHADING_DESCRIPTION " << cid << " {\n"; - if ( textured ) - ostrtmp - << "\t\t\t\t\tTEXTURE_LAYER_COUNT 1\n" - << "\t\t\t\t\tTEXTURE_COORD_DIMENSION_LIST {\n" - << "\t\t\t\t\t\tTEXTURE_LAYER 0 DIMENSION: " << this->textureDimension << "\n" - << "\t\t\t\t\t}\n"; - else - ostrtmp - << "\t\t\t\t\tTEXTURE_LAYER_COUNT 0\n"; - ostrtmp - << "\t\t\t\t\tSHADER_ID " << cid << "\n" - << "\t\t\t\t}\n"; - } - ostrtmp << "\t\t\t}\n"; - - ostrtmp << "\t\t\tMESH_FACE_POSITION_LIST {\n"; - for ( size_t id=0; id < numTriangles; id++ ) - { - ostrtmp << "\t\t\t\t" - << this->Triangles[id].a << " " - << this->Triangles[id].b << " " - << this->Triangles[id].c << "\n"; - } - ostrtmp << "\t\t\t}\n"; - - ostrtmp << "\t\t\tMESH_FACE_SHADING_LIST {\n"; - for ( size_t id=0; id < numTriangles; id++ ) - { - if ( shaded ) - ostrtmp << "\t\t\t\t" << this->faceShaders[id] << "\n"; - else - ostrtmp << "\t\t\t\t0\n"; - } - ostrtmp << "\t\t\t}\n"; - - if ( textured ) - { - ostrtmp << "\t\t\tMESH_FACE_TEXTURE_COORD_LIST {\n"; - for ( size_t id=0; id < numTriangles; id++ ) - { - ostrtmp << "\t\t\t\tFACE " << id << " {\n" - << "\t\t\t\t\tTEXTURE_LAYER 0 TEX_COORD: " - << this->faceColors[id].a << " " - << this->faceColors[id].b << " " - << this->faceColors[id].c << "\n" - << "\t\t\t\t}\n"; - } - ostrtmp << "\t\t\t}\n"; - } - - if ( colored ) - { - ostrtmp << "\t\t\tMESH_FACE_DIFFUSE_COLOR_LIST {\n"; - for ( size_t id=0; id < numTriangles; id++ ) - { - ostrtmp << "\t\t\t\t" - << this->faceColors[id].a << " " - << this->faceColors[id].b << " " - << this->faceColors[id].c << "\n"; - } - ostrtmp << "\t\t\t}\n"; - } - - ostrtmp << "\t\t\tMODEL_POSITION_LIST {\n"; - for ( size_t pid=0; pid < numPoints; pid++ ) - { - ostrtmp << "\t\t\t\t" - << ( this->Points[pid].x ) << " " - << ( this->Points[pid].y ) << " " - << ( this->Points[pid].z ) << "\n"; - } - ostrtmp << "\t\t\t}\n"; - - if ( colored ) - { - ostrtmp << "\t\t\tMODEL_DIFFUSE_COLOR_LIST {\n"; - for ( size_t cid=0; cid < numColors; cid++ ) - { - ostrtmp << "\t\t\t\t" - << this->Colors[cid].r << " " - << this->Colors[cid].g << " " - << this->Colors[cid].b << "\n"; - } - ostrtmp << "\t\t\t}\n"; - } - - if ( textured ) - { - ostrtmp << "\t\t\tMODEL_TEXTURE_COORD_LIST {\n"; - for ( size_t cid=0; cid < numTexCoords; cid++ ) - { - ostrtmp << "\t\t\t\t" - << this->textureCoords[cid].U << " " - << ( this->textureDimension == 2 ? this->textureCoords[cid].V : 0.0 ) << " " - << "0.000000 0.000000\n"; - } - ostrtmp << "\t\t\t}\n"; - } - - if ( this->disable_compression ) - { - ostrtmp << "\t\t\tMODEL_BASE_POSITION_LIST {\n"; - for ( size_t pid=0; pid < numPoints; pid++ ) - { - ostrtmp << "\t\t\t\t" << pid << "\n"; - } - ostrtmp << "\t\t\t}\n"; - } - - ostrtmp << "\t\t}\n"; -} -//----------------------------------------------------------------------------- -mglGraphIDTF::mglGraphIDTF() : mglGraphAB ( 1,1 ), - diff_int ( 0.8f ), spec_int ( 0.4f ), emis_int ( 0.25f ), - double_sided_flag ( true ), vertex_color_flag ( false ), textures_flag ( true ), disable_compression_flag ( true ), unrotate_flag ( false ), ball_is_point_flag ( false ), - points_finished ( true ), lines_finished ( true ), mesh_finished ( true ), - CurrentGroup ( NULL ), rotX(0), rotY(0), rotZ(0) -{ Width = Height = Depth = 1; } -//----------------------------------------------------------------------------- -mglGraphIDTF::~mglGraphIDTF() {} -//----------------------------------------------------------------------------- -void mglGraphIDTF::Light ( int n, mglPoint p, mglColor c, mreal br, bool infty ) -{ - if ( n<0 || n>9 ) { SetWarn ( mglWarnLId ); return; } - nLight[n] = true; aLight[n] = 3; bLight[n] = br; - rLight[3*n] = p.x; rLight[3*n+1] = p.y; rLight[3*n+2] = p.z; - cLight[3*n] = c.r; cLight[3*n+1] = c.g; cLight[3*n+2] = c.b; - iLight[n] = infty; -} -//----------------------------------------------------------------------------- -void mglGraphIDTF::Clf ( mglColor Back ) -{ - CurrPal = -1; - if ( Back==NC ) Back=mglColor ( 1,1,1 ); - Groups.clear(); - CurrentGroup = NULL; - LineSets.clear(); - PointSets.clear(); - Meshes.clear(); - Balls.clear(); - Materials.clear(); - Textures.clear(); - points_finished = true; - lines_finished = true; - mesh_finished = true; -} -//----------------------------------------------------------------------------- -void mglGraphIDTF::DefaultPlotParam() -{ - rotX = rotY = rotZ = 0; - mglGraphAB::DefaultPlotParam(); -} - -void mglGraphIDTF::StartGroup ( const char *name ) -{ - points_finished = true; - lines_finished = true; - mesh_finished = true; - if ( name == NULL || strlen(name) == 0 || strcmp(name,"") == 0 ) - { - CurrentGroup = NULL; - return; - } - for ( u3dGroup_list::iterator it = Groups.begin(); it != Groups.end(); ++it ) - { - if ( name == it->name ) - { - CurrentGroup = &(*it); - return; - } - } - u3dGroup Group; - Group.name = name; - Group.parent = CurrentGroup; - if (Group.parent) - { - Group.parent->NumberOfChildren++; - } - Groups.push_back ( Group ); - CurrentGroup = &Groups.back(); -} -void mglGraphIDTF::StartAutoGroup ( const char *name ) -{ - points_finished = true; - lines_finished = true; - mesh_finished = true; - u3dGroup Group; - Group.name = name; - Group.parent = CurrentGroup; - if (Group.parent) - { - Group.parent->NumberOfChildren++; - } - Group.isauto = true; - Groups.push_back ( Group ); - CurrentGroup = &Groups.back(); -} -void mglGraphIDTF::EndGroup() -{ - points_finished = true; - lines_finished = true; - mesh_finished = true; - if (CurrentGroup == NULL ) - return; - CurrentGroup = CurrentGroup->parent; -} -u3dGroup* mglGraphIDTF::GetCurrentGroup() -{ - return CurrentGroup; -} -//----------------------------------------------------------------------------- -void mglGraphIDTF::UnitBall ( ) -{ - const size_t ThetaResolution = 10; // 4 - const size_t PhiResolution = 10; // 3 - mglPoint pnt; - mglPoint nrm; - const mglPoint Center = mglPoint ( 0, 0, 0 ); - const mreal Radius = 1.0f; - u3dMesh Mesh = u3dMesh ( "UnitBall" , this, false, true ); - Mesh.both_visible=false; - - mreal color[4] = {0.0f, 0.0f, 0.0f, 1.0f}; - Mesh.AddModelMaterial ( color, false, false ); - -// tetrahedron -// Mesh.Points.push_back ( Radius * mglPoint ( 1, 1, 1) ); -// Mesh.Points.push_back ( Radius * mglPoint (-1, -1, 1) ); -// Mesh.Points.push_back ( Radius * mglPoint (-1, 1, -1) ); -// Mesh.Points.push_back ( Radius * mglPoint ( 1, -1, -1) ); -// size_t3 triangle; -// triangle.a = 0; -// triangle.b = 1; -// triangle.c = 3; -// Mesh.Triangles.push_back ( triangle ); -// triangle.a = 0; -// triangle.b = 2; -// triangle.c = 1; -// Mesh.Triangles.push_back ( triangle ); -// triangle.a = 1; -// triangle.b = 2; -// triangle.c = 3; -// Mesh.Triangles.push_back ( triangle ); -// triangle.a = 0; -// triangle.b = 2; -// triangle.c = 3; -// Mesh.Triangles.push_back ( triangle ); -// Meshes.push_back ( Mesh ); -//return; - - // Create north pole - nrm.x = nrm.y = 0.0; nrm.z = 1.0; - pnt = Center + Radius * nrm; - Mesh.Points.push_back ( pnt ); - - // Create south pole - nrm.x = nrm.y = 0.0; nrm.z = -1.0; - pnt = Center + Radius * nrm; - Mesh.Points.push_back ( pnt ); - - // Create intermediate points - for ( size_t i=0; i < ThetaResolution; i++ ) - { - double deltaTheta = 2*M_PI/ThetaResolution; - double theta = i*deltaTheta;; - - for ( size_t j=1; jGetCurrentGroup(); - if (ball.parent) ball.parent->NumberOfChildren++; - ball.name = "Ball" + i2s(Balls.size()) ; - - u3dMaterial Material; - Material.diffuse = diff_int * col; - Material.specular = spec_int * col; - Material.emissive = emis_int * col; - Material.reflectivity = 0.1f; - Material.opacity = alpha; - Material.vertex_color = false; - ball.material = this->AddMaterial ( Material ); - - Balls.push_back(ball); -} -//----------------------------------------------------------------------------- -void mglGraphIDTF::ball ( mreal *,mreal * ) -{ -// point_plot ( mglPoint ( p[0], p[1], p[2] ) ); -} -//----------------------------------------------------------------------------- -void mglGraphIDTF::mark_plot ( mreal *pp, char type ) -{ - mreal x=pp[0],y=pp[1],z=pp[2]; -#define pnt(x, y) ( p + ss*mglPoint((mreal)(x), (mreal)(y), 0.0f)) - mglPoint p = mglPoint ( x, y, z ); - mglPoint p1; - mglPoint p2; - mreal ss=MarkSize*0.35*font_factor; - if ( type=='.' || ss==0 ) - { - point_plot ( p, mglColor( CDef[0], CDef[1], CDef[2] ) ); - } - else - { - mreal pw = PenWidth; PenWidth = BaseLineWidth; - unsigned pd = PDef; PDef = 0xffff; - // mreal zv = strchr("oOVDTS",type) ? pp[2]+BaseLineWidth : pp[2]; - if(!strchr("xsSoO",type)) ss *= 1.1; - switch ( type ) - { - case 'P': - line_plot ( pnt ( -1,-1 ), pnt ( 1,-1 ) ); - line_plot ( pnt ( 1,-1 ), pnt ( 1, 1 ) ); - line_plot ( pnt ( 1 ,1 ), pnt ( -1, 1 ) ); - line_plot ( pnt ( -1, 1 ), pnt ( -1,-1 ) ); - case '+': - line_plot ( pnt ( -1, 0 ), pnt ( 1, 0 ) ); - line_plot ( pnt ( 0,-1 ), pnt ( 0, 1 ) ); - break; - case 'X': - line_plot ( pnt ( -1,-1 ), pnt ( 1,-1 ) ); - line_plot ( pnt ( 1,-1 ), pnt ( 1, 1 ) ); - line_plot ( pnt ( 1 ,1 ), pnt ( -1, 1 ) ); - line_plot ( pnt ( -1, 1 ), pnt ( -1,-1 ) ); - case 'x': - line_plot ( pnt ( -1,-1 ), pnt ( 1, 1 ) ); - line_plot ( pnt ( 1,-1 ), pnt ( -1, 1 ) ); - break; - case 's': - line_plot ( pnt ( -1,-1 ), pnt ( 1,-1 ) ); - line_plot ( pnt ( 1,-1 ), pnt ( 1, 1 ) ); - line_plot ( pnt ( 1 ,1 ), pnt ( -1, 1 ) ); - line_plot ( pnt ( -1, 1 ), pnt ( -1,-1 ) ); - break; - case 'd': - line_plot ( pnt ( 0,-1 ), pnt ( 1, 0 ) ); - line_plot ( pnt ( 1, 0 ), pnt ( 0, 1 ) ); - line_plot ( pnt ( 0, 1 ), pnt ( -1, 0 ) ); - line_plot ( pnt ( -1, 0 ), pnt ( 0,-1 ) ); - break; - case '*': - line_plot ( pnt ( -1, 0 ), pnt ( 1, 0 ) ); - line_plot ( pnt ( -0.6,-0.8 ), pnt ( 0.6, 0.8 ) ); - line_plot ( pnt ( -0.6, 0.8 ), pnt ( 0.6,-0.8 ) ); - break; - case 'Y': - line_plot ( pnt ( 0.0,-1.0 ), pnt ( 0, 0 ) ); - line_plot ( pnt ( -0.8, 0.6 ), pnt ( 0, 0 ) ); - line_plot ( pnt ( 0.8, 0.6 ), pnt ( 0, 0 ) ); - break; - - case '^': - line_plot ( pnt ( 0.0, 1.0 ), pnt ( 0.7,-0.5 ) ); - line_plot ( pnt ( 0.7,-0.5 ), pnt ( -0.7,-0.5 ) ); - line_plot ( pnt ( -0.7,-0.5 ), pnt ( 0.0, 1.0 ) ); - break; - case 'v': - line_plot ( pnt ( 0.0,-1.0 ), pnt ( 0.7, 0.5 ) ); - line_plot ( pnt ( 0.7, 0.5 ), pnt ( -0.7, 0.5 ) ); - line_plot ( pnt ( -0.7, 0.5 ), pnt ( 0.0,-1.0 ) ); - break; - - case 'R': - trig_plot ( pnt ( -0.5, 1.0 ), pnt ( -0.5,-1.0 ), pnt ( 1.0, 0.0 ) ); - break; - case '>': - line_plot ( pnt ( -0.5,-1.0 ), pnt ( -0.5, 1.0 ) ); - line_plot ( pnt ( -0.5, 1.0 ), pnt ( 1.0, 0.0 ) ); - line_plot ( pnt ( 1.0, 0.0 ), pnt ( -0.5,-1.0 ) ); - break; - case 'L': - trig_plot ( pnt ( 0.5,-1.0 ), pnt ( 0.5, 1.0 ), pnt ( -1.0, 0.0 ) ); - break; - case '<': - line_plot ( pnt ( 0.5,-1.0 ), pnt ( 0.5, 1.0 ) ); - line_plot ( pnt ( 0.5, 1.0 ), pnt ( -1.0, 0.0 ) ); - line_plot ( pnt ( -1.0, 0.0 ), pnt ( 0.5,-1.0 ) ); - break; - - case 'S': - quad_plot ( pnt ( -1,-1 ), pnt ( 1,-1 ), pnt ( -1, 1 ), pnt ( 1, 1 ) ); - break; - case 'D': - quad_plot ( pnt ( 0,-1 ), pnt ( 1, 0 ), pnt ( -1, 0 ), pnt ( 0, 1 ) ); - break; - case 'T': - trig_plot ( pnt ( -1.0,-0.5 ), pnt ( 1.0,-0.5 ), pnt ( 0.0, 1.0 ) ); - break; - case 'V': - trig_plot ( pnt ( 0.0,-1.0 ), pnt ( 1.0, 0.5 ), pnt ( -1.0, 0.5 ) ); - break; - case 'C': - point_plot ( p, mglColor( CDef[0], CDef[1], CDef[2] ) ); - case 'o': - p1 = pnt ( 1, 0 ); - for ( int i=1;i<32;i++ ) - { - p2 = pnt ( cos ( i*M_PI/16. ), sin ( i*M_PI/16. ) ); - line_plot ( p1, p2 ); - p1 = p2; - } - p2 = pnt ( 1, 0 ); - line_plot ( p1, p2 ); - break; - case 'O': - p1 = pnt ( 1, 0 ); - for ( int i=1;i<32;i++ ) - { - p2 = pnt ( cos ( i*M_PI/16. ), sin ( i*M_PI/16. ) ); - trig_plot ( p,p1,p2 ); - p1 = p2; - } - p2 = pnt ( 1, 0 ); - trig_plot ( p,p1,p2 ); - break; - } - PDef = pd; - PenWidth = pw; - } -#undef pnt -} -//----------------------------------------------------------------------------- -mreal* mglGraphIDTF::col2col ( const mreal *c, const mreal *n, mreal *r ) -{ - register long i,j; - static mreal u[3]; - mglColor b = mglColor ( c[0], c[1], c[2] ); - if ( r==0 ) r = u; - if ( UseLight && n && this->vertex_color_flag ) - { - mreal nn; - b = AmbBr*b; - mglPoint Normal = mglPoint ( n[0], n[1], n[2] ); // Normal to surface after transform - nn = Norm ( Normal ); - if ( nn != 0.0f ) - for ( i=0;i<10;i++ ) - { - if ( !nLight[i] ) continue; - j = 3*i; - mglPoint PLight = mglPoint ( pLight[j], pLight[j+1], pLight[j+2] ); - nn = 2* ( Normal*PLight ) / ( Normal*Normal ); - mglPoint d = PLight - nn * Normal; - nn = 1 + d.z/Norm ( d ); - - nn = exp ( -aLight[i]*nn ) *bLight[i]*2; - b = b + nn * mglColor ( cLight[j], cLight[j+1], cLight[j+2] ); - } - b.r = b.r<1 ? b.r : 1; - b.g = b.g<1 ? b.g : 1; - b.b = b.b<1 ? b.b : 1; - } - r[0] = b.r; r[1] = b.g; r[2] = b.b; - return r; -} -//----------------------------------------------------------------------------- -void mglGraphIDTF::quad_plot ( mreal *pp0,mreal *pp1,mreal *pp2,mreal *pp3, - mreal *cc0,mreal *cc1,mreal *cc2,mreal *cc3 ) -{ - GetMesh().quad_plot ( pp0, pp1, pp2, pp3, cc0, cc1, cc2, cc3 ); -} -//----------------------------------------------------------------------------- -void mglGraphIDTF::cloud_plot(long nx,long ny,long nz,mreal *pp,mreal *a,mreal alpha) -{ - register long i,j,k,i0; - if(!pp || !a || !DrawFace || alpha==0) return; - mreal *aa=new mreal[nx*ny*nz]; - mreal *cc=new mreal[4*nx*ny*nz]; - bool *tt=new bool[nx*ny*nz]; - if(!aa || !cc || !tt) - { delete []aa; delete []cc; delete []tt; return; } - for(i=0;i0 ? ( s+1.f ) * ( s+1.f ) : ( 1.f-s ) * ( s-1.f ) ); - s = n* ( s+1.f ) /2.f; k = long ( s ); s -= k; - if ( kname; - GroupName.append( "_xSections" ); - StartAutoGroup( GroupName.c_str() ); - for(i=0;iname; - GroupName.append( "_ySections" ); - StartAutoGroup( GroupName.c_str() ); - for(j=0;jname; - GroupName.append( "_zSections" ); - StartAutoGroup( GroupName.c_str() ); - for(k=0;kname; - GroupName.append( "_Cells" ); - StartAutoGroup( GroupName.c_str() ); - { - register mreal t,s; - register long k; - const long n = NumCol-1; - mglColor c; - size_t *pid=new size_t[nx*ny*nz]; - - PostScale ( pp,nx*ny*nz ); - mesh_finished = true; - u3dMesh& Mesh = GetMesh(); - mesh_finished = true; - Mesh.textureDimension = 1; - Mesh.vertex_color = false; - u3dTexture& texture = AddTexture (); - texture.image.Initialize ( NumCol+2, 1, 4 ); - for ( i=0;i0 ? ( s+1.f ) * ( s+1.f ) : ( 1.f-s ) * ( s-1.f ) ); - texture.image.RGBPixels[4*(i+1)+3] = t*255; - } - texture.image.RGBPixels[4*0+0] = texture.image.RGBPixels[4*1+0]; - texture.image.RGBPixels[4*0+1] = texture.image.RGBPixels[4*1+0]; - texture.image.RGBPixels[4*0+2] = texture.image.RGBPixels[4*1+0]; - texture.image.RGBPixels[4*0+3] = texture.image.RGBPixels[4*1+0]; - texture.image.RGBPixels[4*(NumCol+1)+0] = texture.image.RGBPixels[4*NumCol+0]; - texture.image.RGBPixels[4*(NumCol+1)+1] = texture.image.RGBPixels[4*NumCol+0]; - texture.image.RGBPixels[4*(NumCol+1)+2] = texture.image.RGBPixels[4*NumCol+0]; - texture.image.RGBPixels[4*(NumCol+1)+3] = texture.image.RGBPixels[4*NumCol+0]; - u3dMaterial Material; - Material.color = mglColor ( 1.0f, 1.0f, 1.0f ); - Material.opacity = 1.0f; - Material.emissive = false; - Material.vertex_color = false; - Material.texture = texture.name; - Material.textumrealpha = true; - Mesh.ModelMaterials.push_back ( AddMaterial ( Material ) ); - for ( i=0;i0 ? ( s+1.f ) * ( s+1.f ) : ( 1.f-s ) * ( s-1.f ) ); - s = n* ( s+1.f ) /2.f; k = long ( s ); s -= k; - if ( k0 ? ( s+1.f ) * ( s+1.f ) : ( 1.f-s ) * ( s-1.f ) ); - s = n* ( s+1.f ) /2.f; k = long ( s ); s -= k; - if ( k0 ? ( s+1.f ) * ( s+1.f ) : ( 1.f-s ) * ( s-1.f ) ); - s = n* ( s+1.f ) /2.f; k = long ( s ); s -= k; - if ( k0 ? ( s+1.f ) * ( s+1.f ) : ( 1.f-s ) * ( s-1.f ) ); - s = n* ( s+1.f ) /2.f; k = long ( s ); s -= k; - if ( k0 && Norm( mglPoint(pp[3*(i0)+0]-pp[3*(i0-1)+0], pp[3*(i0)+1]-pp[3*(i0-1)+1], pp[3*(i0)+2]-pp[3*(i0-1)+2]) - dx ) > FLT_EPS ) || - ( j>0 && Norm( mglPoint(pp[3*(i0)+0]-pp[3*(i0-n)+0], pp[3*(i0)+1]-pp[3*(i0-n)+1], pp[3*(i0)+2]-pp[3*(i0-n)+2]) - dy ) > FLT_EPS ) ) - { -// fprintf(stderr,"points %f %f %f x-1 %f %f %f y-1 %f %f %f tt %u fl %u\n", pp[3*i0+0], pp[3*i0+1], pp[3*i0+2], pp[3*(i0-1)+0], pp[3*(i0-1)+1], pp[3*(i0-1)+2], pp[3*(i0-n)+0], pp[3*(i0-n)+1], pp[3*(i0-n)+2], tt[i0], flat ); -// fprintf(stderr,"n %ld m %ld i %ld j %ld\n", n, m, i, j); -// fprintf(stderr,"dx %f %f %f\n", pp[3*(i0)+0]-pp[3*(i0-1)+0], pp[3*(i0)+1]-pp[3*(i0-1)+1], pp[3*(i0)+2]-pp[3*(i0-1)+2]); -// fprintf(stderr,"dy %f %f %f\n", pp[3*(i0)+0]-pp[3*(i0-n)+0], pp[3*(i0)+1]-pp[3*(i0-n)+1], pp[3*(i0)+2]-pp[3*(i0-n)+2]); - flat = false; - break; - } - } - if ( !flat ) - break; - } -//fprintf(stderr, "flat %u\n", flat ); - } - if (flat) - { - u3dTexture& texture = AddTexture (); - texture.image.Initialize ( n, m, (UseAlpha?4:3) ); - for ( i=0;i 0 && cc ) \ - { \ - Mesh.AddTriangle(pid[i0+(i1)], pid[i0+(i2)], pid[i0+(i3)], pid[i0+(i1)], pid[i0+(i2)], pid[i0+(i3)]); \ - } \ - else if ( Mesh.vertex_color && (cc || UseLight) ) \ - { \ - Mesh.AddTriangle(pid[i0+(i1)], pid[i0+(i2)], pid[i0+(i3)], cid[i0+(i1)], cid[i0+(i2)], cid[i0+(i3)]); \ - } \ - else \ - { \ - if (cc) \ - { \ - mreal col [4]; \ - size_t mid; \ - col[0] = (c[4*(i1)+0] + c[4*(i2)+0] + c[4*(i3)+0])/3.0f; \ - col[1] = (c[4*(i1)+1] + c[4*(i2)+1] + c[4*(i3)+1])/3.0f; \ - col[2] = (c[4*(i1)+2] + c[4*(i2)+2] + c[4*(i3)+2])/3.0f; \ - col[3] = (c[4*(i1)+3] + c[4*(i2)+3] + c[4*(i3)+3])/3.0f; \ - mid = Mesh.AddModelMaterial(col, false, false); \ - Mesh.AddTriangle(pid[i0+(i1)], pid[i0+(i2)], pid[i0+(i3)], mid); \ - } \ - else \ - { \ - Mesh.AddTriangle(pid[i0+(i1)], pid[i0+(i2)], pid[i0+(i3)], 0); \ - } \ - } - for ( j=0;jSetAmbientLight(); - LightScale(); - for ( int i=0; i<10; i++ ) - if ( nLight[i] ) - { - if ( unrotate_flag ) - AddLight ( mglPoint ( rLight[3*i], rLight[3*i+1], rLight[3*i+2] ), - mglColor ( cLight[3*i], cLight[3*i+1], cLight[3*i+2] ), - bLight[i], iLight[i] ); - else - AddLight ( mglPoint ( pLight[3*i], pLight[3*i+1], pLight[3*i+2] ), - mglColor ( cLight[3*i], cLight[3*i+1], cLight[3*i+2] ), - bLight[i], iLight[i] ); - } - } -// Cleanup -// Remove empty models - for ( u3dPointSet_list::iterator it = PointSets.begin(); it != PointSets.end();) - { - if (it->Points.empty()) - { - if ( it->parent ) - it->parent->NumberOfChildren--; - it = PointSets.erase(it); - } - else ++it; - } - for ( u3dLineSet_list::iterator it = LineSets.begin(); it != LineSets.end();) - { - if (it->Points.empty() || it->Lines.empty()) - { - if ( it->parent ) - it->parent->NumberOfChildren--; - it = LineSets.erase(it); - } - else ++it; - } - for ( u3dMesh_list::iterator it = Meshes.begin(); it != Meshes.end();) - { - if (it->Points.empty() || it->Triangles.empty()) - { - if ( it->parent ) - it->parent->NumberOfChildren--; - it = Meshes.erase(it); - } - else ++it; - } -// Remove automatically created groups that are the only object in manually created ones - for ( u3dGroup_list::iterator it = Groups.begin(); it != Groups.end(); ++it ) - { - if (it->isauto && it->parent && !it->parent->isauto && it->parent->NumberOfChildren == 1) - { - it->name = it->parent->name; - it->parent->NumberOfChildren = 0; - it->parent = it->parent->parent; - it->isauto = false; - } - } -// Reduce groups with just one model in them to just models - for ( u3dPointSet_list::iterator it = PointSets.begin(); it != PointSets.end(); ++it ) - { - if (it->parent && it->parent->NumberOfChildren == 1) - { - it->name = it->parent->name; - it->parent->NumberOfChildren = 0; - it->parent = it->parent->parent; - } - } - for ( u3dLineSet_list::iterator it = LineSets.begin(); it != LineSets.end(); ++it ) - { - if (it->parent && it->parent->NumberOfChildren == 1) - { - it->name = it->parent->name; - it->parent->NumberOfChildren = 0; - it->parent = it->parent->parent; - } - } - for ( u3dMesh_list::iterator it = Meshes.begin(); it != Meshes.end(); ++it ) - { - if (it->parent && it->parent->NumberOfChildren == 1) - { - it->name = it->parent->name; - it->parent->NumberOfChildren = 0; - it->parent = it->parent->parent; - } - } - -// Make inverse coordinate transform with the model, if so desired - if (unrotate_flag) - { - SubPlot(1,1,0); - Rotate(rotX, rotZ, rotY); - MakeTransformMatrix( mgl_globpos, mgl_globinv); - } - else - memcpy( mgl_globinv, mgl_definv, sizeof(mgl_definv)); - - ostr << std::fixed << std::setprecision(6) - << "FILE_FORMAT \"IDTF\"\n" - << "FORMAT_VERSION 100\n" - << "\n"; - if(!unrotate_flag) - ostr - << "NODE \"VIEW\" {\n" - << " NODE_NAME \"DefaultView\"\n" - << " PARENT_LIST {\n" - << " PARENT_COUNT 1\n" - << " PARENT 0 {\n" - << " PARENT_NAME \"\"\n" - << " PARENT_TM {\n" - << " 1.000000 0.000000 0.000000 0.000000\n" - << " 0.000000 1.000000 0.000000 0.000000\n" - << " 0.000000 0.000000 1.000000 0.000000\n" - << " 0.000000 0.000000 2.000000 1.000000\n" - << " }\n" - << " }\n" - << " }\n" - << " RESOURCE_NAME \"SceneViewResource\"\n" - << " VIEW_DATA {\n" - << " VIEW_TYPE \"ORTHO\"\n" - << " VIEW_PROJECTION 2.000000\n" - << " VIEW_PORT_WIDTH 2\n" - << " VIEW_PORT_HEIGHT 2\n" - << " }\n" - << "}\n" - << "\n"; - for ( u3dGroup_list::iterator it = Groups.begin(); it != Groups.end(); ++it ) - { - if ( it->name == "" || it->NumberOfChildren == 0 ) - continue; - u3dNode Node; - Node.name = it->name; - if ( it->parent == NULL) - Node.parent = ""; - else - Node.parent = it->parent->name; - memcpy ( Node.position, mgl_idtrans, sizeof ( mgl_idtrans ) ); - Node.type = "GROUP"; - Node.print ( ostr ); - } - for ( u3dLight_list::iterator it = Lights.begin(); it != Lights.end(); ++it ) - { - it->print_node ( ostr ); - } - for ( u3dPointSet_list::iterator it = PointSets.begin(); it != PointSets.end(); ++it ) - { - it->print_node ( ostr ); - } - for ( u3dLineSet_list::iterator it = LineSets.begin(); it != LineSets.end(); ++it ) - { - it->print_node ( ostr ); - } - for ( u3dMesh_list::iterator it = Meshes.begin(); it != Meshes.end(); ++it ) - { - it->print_node ( ostr ); - } - for ( u3dBall_list::iterator it = Balls.begin(); it != Balls.end(); ++it ) - { - it->print_node ( ostr ); - } - if(!unrotate_flag) - ostr - << "RESOURCE_LIST \"VIEW\" {\n" - << " RESOURCE_COUNT 1\n" - << " RESOURCE 0 {\n" - << " RESOURCE_NAME \"SceneViewResource\"\n" - << " VIEW_PASS_COUNT 1\n" - << " VIEW_ROOT_NODE_LIST {\n" - << " ROOT_NODE 0 {\n" - << " ROOT_NODE_NAME \"\"\n" - << " }\n" - << " }\n" - << " }\n" - << "}\n" - << "\n"; - - unsigned int ResourceCount; - - // Write lights - if ( !Lights.empty() ) - { - ostr << "RESOURCE_LIST \"LIGHT\" {\n" - << "\tRESOURCE_COUNT " << Lights.size() << "\n"; - ResourceCount = 0; - for ( u3dLight_list::iterator it = Lights.begin(); it != Lights.end(); ++it ) - { - ostr << "\tRESOURCE " << ResourceCount++ << " {\n"; - it->print_light_resource ( ostr ); - ostr << "\t}\n"; - } - ostr << "}\n" - << "\n"; - } - - if ( Balls.size() != 0 ) - { - UnitBall(); - } - - // Write models - ostr << "RESOURCE_LIST \"MODEL\" {\n" - << "\tRESOURCE_COUNT " << ( PointSets.size() + LineSets.size() + Meshes.size() ) << "\n"; - ResourceCount = 0; - for ( u3dPointSet_list::iterator it = PointSets.begin(); it != PointSets.end(); ++it ) - { - ostr << "\tRESOURCE " << ResourceCount++ << " {\n"; - it->print_model_resource ( ostr ); - ostr << "\t}\n"; - } - for ( u3dLineSet_list::iterator it = LineSets.begin(); it != LineSets.end(); ++it ) - { - ostr << "\tRESOURCE " << ResourceCount++ << " {\n"; - it->print_model_resource ( ostr ); - ostr << "\t}\n"; - } - for ( u3dMesh_list::iterator it = Meshes.begin(); it != Meshes.end(); ++it ) - { - ostr << "\tRESOURCE " << ResourceCount++ << " {\n"; - it->print_model_resource ( ostr ); - ostr << "\t}\n"; - } - ostr << "}\n" - << "\n"; - - if ( Balls.size() != 0 ) - { - Meshes.pop_back(); - } - - // Write shaders - ostr << "RESOURCE_LIST \"SHADER\" {\n" - << "\tRESOURCE_COUNT " << Materials.size() << "\n"; - ResourceCount = 0; - for ( u3dMaterial_list::iterator it = Materials.begin(); it != Materials.end(); ++it ) - { - ostr << "\tRESOURCE " << ResourceCount++ << " {\n"; - it->print_shader ( ostr ); - ostr << "\t}\n"; - } - ostr << "}\n" - << "\n"; - - // Write materials - ostr << "RESOURCE_LIST \"MATERIAL\" {\n" - << "\tRESOURCE_COUNT " << Materials.size() << "\n"; - ResourceCount = 0; - for ( u3dMaterial_list::iterator it = Materials.begin(); it != Materials.end(); ++it ) - { - ostr << "\tRESOURCE " << ResourceCount++ << " {\n"; - it->print_material ( ostr ); - ostr << "\t}\n"; - } - ostr << "}\n" - << "\n"; - - // Write textures - if ( Textures.size() != 0 ) - { - ostr << "RESOURCE_LIST \"TEXTURE\" {\n" - << "\tRESOURCE_COUNT " << Textures.size() << "\n"; - ResourceCount = 0; - for ( u3dTexture_list::iterator it = Textures.begin(); it != Textures.end(); ++it ) - { - ostr << "\tRESOURCE " << ResourceCount++ << " {\n"; - it->print_texture ( fname, ostr ); - ostr << "\t}\n"; - } - ostr << "}\n" - << "\n"; - } - - // Write shading modifiers - for ( u3dPointSet_list::iterator it = PointSets.begin(); it != PointSets.end(); ++it ) - { - it->print_shading_modifier ( ostr ); - } - for ( u3dLineSet_list::iterator it = LineSets.begin(); it != LineSets.end(); ++it ) - { - it->print_shading_modifier ( ostr ); - } - for ( u3dMesh_list::iterator it = Meshes.begin(); it != Meshes.end(); ++it ) - { - it->print_shading_modifier ( ostr ); - } - for ( u3dBall_list::iterator it = Balls.begin(); it != Balls.end(); ++it ) - { - it->print_shading_modifier ( ostr ); - } - - ostr.close (); - -} -//----------------------------------------------------------------------------- -#ifdef HAVE_U3D -// Rotate (X,Y,Z) by Tet around (x,y,z) -void RotateMy( HPDF_REAL *X, HPDF_REAL *Y, HPDF_REAL *Z, HPDF_REAL Tet, HPDF_REAL x, HPDF_REAL y, HPDF_REAL z) -{ - double C[3][3], c=cos(Tet*M_PI/180),s=-sin(Tet*M_PI/180),r=1-c,n=sqrt(x*x+y*y+z*z); - HPDF_REAL u = *X, v = *Y, w = *Z; - x/=n; y/=n; z/=n; - C[0][0] = x*x*r+c; C[0][1] = x*y*r-z*s; C[0][2] = x*z*r+y*s; - C[1][0] = x*y*r+z*s; C[1][1] = y*y*r+c; C[1][2] = y*z*r-x*s; - C[2][0] = x*z*r-y*s; C[2][1] = y*z*r+x*s; C[2][2] = z*z*r+c; - - *X = C[0][0]*u + C[0][1]*v + C[0][2]*w; - *Y = C[1][0]*u + C[1][1]*v + C[1][2]*w; - *Z = C[2][0]*u + C[2][1]*v + C[2][2]*w; -} - -void mglGraphIDTF::WriteU3D ( const char *fileNameParam,const char *descr ) -{ - char fname[PATH_MAX]; // file name without extension - bzero( fname, sizeof(fname) ); - strncpy(fname, fileNameParam, sizeof(fname)-1); - const size_t fnlen = strlen(fname); - if ( fnlen > 5 && strcasecmp(fname+fnlen-5, ".idtf") == 0 ) - fname[fnlen-5]='\0'; - else if ( fnlen > 4 && strcasecmp(fname+fnlen-4, ".u3d") == 0 ) - fname[fnlen-4]='\0'; - else if ( fnlen > 4 && strcasecmp(fname+fnlen-4, ".pdf") == 0 ) - fname[fnlen-4]='\0'; - - - // Preparatory work - { - Lights.clear(); - if ( UseLight ) - { - this->SetAmbientLight(); - LightScale(); - for ( int i=0; i<10; i++ ) - if ( nLight[i] ) - { - if ( unrotate_flag ) - AddLight ( mglPoint ( rLight[3*i], rLight[3*i+1], rLight[3*i+2] ), - mglColor ( cLight[3*i], cLight[3*i+1], cLight[3*i+2] ), - bLight[i], iLight[i] ); - else - AddLight ( mglPoint ( pLight[3*i], pLight[3*i+1], pLight[3*i+2] ), - mglColor ( cLight[3*i], cLight[3*i+1], cLight[3*i+2] ), - bLight[i], iLight[i] ); - } - } - // Cleanup - // Remove empty models - for ( u3dPointSet_list::iterator it = PointSets.begin(); it != PointSets.end();) - { - if (it->Points.empty()) - { - if ( it->parent ) - it->parent->NumberOfChildren--; - it = PointSets.erase(it); - } - else ++it; - } - for ( u3dLineSet_list::iterator it = LineSets.begin(); it != LineSets.end();) - { - if (it->Points.empty() || it->Lines.empty()) - { - if ( it->parent ) - it->parent->NumberOfChildren--; - it = LineSets.erase(it); - } - else ++it; - } - for ( u3dMesh_list::iterator it = Meshes.begin(); it != Meshes.end();) - { - if (it->Points.empty() || it->Triangles.empty()) - { - if ( it->parent ) - it->parent->NumberOfChildren--; - it = Meshes.erase(it); - } - else ++it; - } - // Remove automatically created groups that are the only object in manually created ones - for ( u3dGroup_list::iterator it = Groups.begin(); it != Groups.end(); ++it ) - { - if (it->isauto && it->parent && !it->parent->isauto && it->parent->NumberOfChildren == 1) - { - it->name = it->parent->name; - it->parent->NumberOfChildren = 0; - it->parent = it->parent->parent; - it->isauto = false; - } - } - // Reduce groups with just one model in them to just models - for ( u3dPointSet_list::iterator it = PointSets.begin(); it != PointSets.end(); ++it ) - { - if (it->parent && it->parent->NumberOfChildren == 1) - { - it->name = it->parent->name; - it->parent->NumberOfChildren = 0; - it->parent = it->parent->parent; - } - } - for ( u3dLineSet_list::iterator it = LineSets.begin(); it != LineSets.end(); ++it ) - { - if (it->parent && it->parent->NumberOfChildren == 1) - { - it->name = it->parent->name; - it->parent->NumberOfChildren = 0; - it->parent = it->parent->parent; - } - } - for ( u3dMesh_list::iterator it = Meshes.begin(); it != Meshes.end(); ++it ) - { - if (it->parent && it->parent->NumberOfChildren == 1) - { - it->name = it->parent->name; - it->parent->NumberOfChildren = 0; - it->parent = it->parent->parent; - } - } - - // Make inverse coordinate transform with the model, if so desired - if (unrotate_flag) - { - SubPlot(1,1,0); - Rotate(rotX, rotZ, rotY); - MakeTransformMatrix( mgl_globpos, mgl_globinv); - } - else - memcpy( mgl_globinv, mgl_definv, sizeof(mgl_definv)); - - } - - // Initialize U3D lib - IFXRESULT result = IFX_OK; - - result = IFXSetDefaultLocale(); - IFXTRACE_GENERIC(L"[Converter] IFXSetDefaultLocale %i\n", result); - - if( IFXSUCCESS(result) ) - { - IFXDEBUG_STARTUP(); - result = IFXCOMInitialize(); - } - - if( !IFXSUCCESS(result) ) - { - fprintf(stderr, "unable to load U3D library!"); - return; - } - - // Let us enclose it to be sure everything is cleared before we thry to unload the lib - - { - using namespace U3D_IDTF; - // Initialize converter - ConverterOptions converterOptions; - FileOptions fileOptions; - - wchar_t *wU3DFileName = new wchar_t [mbstowcs(NULL, fname, 32000)+1+4]; - mbstowcs(wU3DFileName, fname, 32000); - wcscat(wU3DFileName,L".u3d"); - fileOptions.outFile = wU3DFileName; - delete [] wU3DFileName; - - fileOptions.exportOptions = IFXExportOptions(65535); - fileOptions.profile = 0; - fileOptions.scalingFactor = 1.0f; - fileOptions.debugLevel = 0; - - converterOptions.positionQuality = 1000; - converterOptions.texCoordQuality = 1000; - converterOptions.normalQuality = 1000; - converterOptions.diffuseQuality = 1000; - converterOptions.specularQuality = 1000; - converterOptions.geoQuality = 1000; - converterOptions.textureQuality = 100; - converterOptions.animQuality = 1000; - converterOptions.textureLimit = 0; - converterOptions.removeZeroAreaFaces = FALSE; - converterOptions.zeroAreaFaceTolerance = 100.0f * FLT_EPSILON; - converterOptions.excludeNormals = TRUE; - - SceneUtilities sceneUtils; - - result = sceneUtils.InitializeScene( fileOptions.profile, fileOptions.scalingFactor ); - - SceneConverter converter( &sceneUtils, &converterOptions ); - - // Do real work, create model to be converted - { - NodeList& Nodes = converter.m_nodeList; - SceneResources& Resources = converter.m_sceneResources; - ModifierList& Modifiers = converter.m_modifierList; - - Resources.GetResourceList( IDTF_LIGHT )->SetType( IDTF_LIGHT ); - Resources.GetResourceList( IDTF_MODEL )->SetType( IDTF_MODEL ); - Resources.GetResourceList( IDTF_VIEW )->SetType( IDTF_VIEW ); - Resources.GetResourceList( IDTF_SHADER )->SetType( IDTF_SHADER ); - Resources.GetResourceList( IDTF_MATERIAL )->SetType( IDTF_MATERIAL ); - Resources.GetResourceList( IDTF_TEXTURE )->SetType( IDTF_TEXTURE ); - - // Start write the Camera - if(!unrotate_flag) - { - // Camera Resource - { - ViewResourceList* pViewResources = static_cast< ViewResourceList* >( Resources.GetResourceList( IDTF_VIEW ) ); - ViewResource defaultViewResource; - defaultViewResource.SetName( L"SceneViewResource" ); - defaultViewResource.AddRootNode( L"" ); - pViewResources->AddResource( defaultViewResource ); - } - - // Camera node - { - ViewNode View; - View.SetType( IDTF_VIEW ); - View.SetName( L"DefaultView" ); - View.SetResourceName( L"SceneViewResource" ); - ParentList Parents; - ParentData Parent; - Parent.SetParentName( L"" ); - IFXMatrix4x4 Matrix; - Matrix.Reset(); - Matrix.Translate3x4( IFXVector3( 0, 0, 2 ) ); - Parent.SetParentTM( Matrix ); - Parents.AddParentData( Parent ); - View.SetParentList( Parents ); - ViewNodeData ViewData; - ViewData.SetUnitType( IDTF_VIEW_UNIT_PIXEL ); - ViewData.SetClipping( VIEW_NEAR_CLIP, VIEW_FAR_CLIP ); - ViewData.SetViewPort( 2, 2, VIEW_PORT_H_POSITION, VIEW_PORT_V_POSITION ); - ViewData.SetType( IDTF_ORTHO_VIEW ); - ViewData.SetProjection( 2 ); - View.SetViewData( ViewData ); - Nodes.AddNode( &View ); - } - } - // End of Camera - - // Create nodes - { - // Create global inverse transform matrix - IFXMatrix4x4 GlobInv; - { - GlobInv[ 0] = mgl_globinv[0][0]; - GlobInv[ 1] = mgl_globinv[1][0]; - GlobInv[ 2] = mgl_globinv[2][0]; - GlobInv[ 3] = mgl_globinv[3][0]; - GlobInv[ 4] = mgl_globinv[0][1]; - GlobInv[ 5] = mgl_globinv[1][1]; - GlobInv[ 6] = mgl_globinv[2][1]; - GlobInv[ 7] = mgl_globinv[3][1]; - GlobInv[ 8] = mgl_globinv[0][2]; - GlobInv[ 9] = mgl_globinv[1][2]; - GlobInv[10] = mgl_globinv[2][2]; - GlobInv[11] = mgl_globinv[3][2]; - GlobInv[12] = mgl_globinv[0][3]; - GlobInv[13] = mgl_globinv[1][3]; - GlobInv[14] = mgl_globinv[2][3]; - GlobInv[15] = mgl_globinv[3][3]; - } - // Create Group nodes - for ( u3dGroup_list::iterator it = Groups.begin(); it != Groups.end(); ++it ) - { - if ( it->name == "" || it->NumberOfChildren == 0 ) - continue; - Node Group; - Group.SetType( IDTF_GROUP ); - Group.SetName( it->name.c_str() ); - ParentList Parents; - ParentData Parent; - if ( it->parent == NULL) - Parent.SetParentName( L"" ); - else - Parent.SetParentName( it->parent->name.c_str() ); - IFXMatrix4x4 Matrix; - Matrix.Reset(); - Parent.SetParentTM( Matrix ); - Parents.AddParentData( Parent ); - Group.SetParentList( Parents ); - Nodes.AddNode( &Group ); - } - // Create Light nodes - for ( u3dLight_list::iterator it = Lights.begin(); it != Lights.end(); ++it ) - { - LightNode Light; - Light.SetType( IDTF_LIGHT ); - Light.SetName( it->name.c_str() ); - Light.SetResourceName( it->name.c_str() ); - ParentList Parents; - ParentData Parent; - Parent.SetParentName( L"" ); - IFXMatrix4x4 Matrix; - Matrix.Reset(); - Matrix[ 0] = it->position[0][0]; - Matrix[ 1] = it->position[1][0]; - Matrix[ 2] = it->position[2][0]; - Matrix[ 3] = it->position[3][0]; - Matrix[ 4] = it->position[0][1]; - Matrix[ 5] = it->position[1][1]; - Matrix[ 6] = it->position[2][1]; - Matrix[ 7] = it->position[3][1]; - Matrix[ 8] = it->position[0][2]; - Matrix[ 9] = it->position[1][2]; - Matrix[10] = it->position[2][2]; - Matrix[11] = it->position[3][2]; - Matrix[12] = it->position[0][3]; - Matrix[13] = it->position[1][3]; - Matrix[14] = it->position[2][3]; - Matrix[15] = it->position[3][3]; - Parent.SetParentTM( Matrix ); - Parents.AddParentData( Parent ); - Light.SetParentList( Parents ); - Nodes.AddNode( &Light ); - } - // Create Model nodes - for ( u3dPointSet_list::iterator it = PointSets.begin(); it != PointSets.end(); ++it ) - { - ModelNode Model; - Model.SetType( IDTF_MODEL ); - Model.SetName( it->name.c_str() ); - Model.SetResourceName( it->name.c_str() ); - ParentList Parents; - ParentData Parent; - if ( it->parent == NULL) - Parent.SetParentName( L"" ); - else - Parent.SetParentName( it->parent->name.c_str() ); - - IFXMatrix4x4 Position; - Position[ 0] = it->position[0][0]; - Position[ 1] = it->position[1][0]; - Position[ 2] = it->position[2][0]; - Position[ 3] = it->position[3][0]; - Position[ 4] = it->position[0][1]; - Position[ 5] = it->position[1][1]; - Position[ 6] = it->position[2][1]; - Position[ 7] = it->position[3][1]; - Position[ 8] = it->position[0][2]; - Position[ 9] = it->position[1][2]; - Position[10] = it->position[2][2]; - Position[11] = it->position[3][2]; - Position[12] = it->position[0][3]; - Position[13] = it->position[1][3]; - Position[14] = it->position[2][3]; - Position[15] = it->position[3][3]; - - IFXMatrix4x4 Matrix; - Matrix.Reset(); - Matrix.Multiply3x4(GlobInv, Position); - - Parent.SetParentTM( Matrix ); - Parents.AddParentData( Parent ); - Model.SetParentList( Parents ); - - Nodes.AddNode( &Model ); - } - for ( u3dLineSet_list::iterator it = LineSets.begin(); it != LineSets.end(); ++it ) - { - ModelNode Model; - Model.SetType( IDTF_MODEL ); - Model.SetName( it->name.c_str() ); - Model.SetResourceName( it->name.c_str() ); - ParentList Parents; - ParentData Parent; - if ( it->parent == NULL) - Parent.SetParentName( L"" ); - else - Parent.SetParentName( it->parent->name.c_str() ); - - IFXMatrix4x4 Position; - Position[ 0] = it->position[0][0]; - Position[ 1] = it->position[1][0]; - Position[ 2] = it->position[2][0]; - Position[ 3] = it->position[3][0]; - Position[ 4] = it->position[0][1]; - Position[ 5] = it->position[1][1]; - Position[ 6] = it->position[2][1]; - Position[ 7] = it->position[3][1]; - Position[ 8] = it->position[0][2]; - Position[ 9] = it->position[1][2]; - Position[10] = it->position[2][2]; - Position[11] = it->position[3][2]; - Position[12] = it->position[0][3]; - Position[13] = it->position[1][3]; - Position[14] = it->position[2][3]; - Position[15] = it->position[3][3]; - - IFXMatrix4x4 Matrix; - Matrix.Reset(); - Matrix.Multiply3x4(GlobInv, Position); - - Parent.SetParentTM( Matrix ); - Parents.AddParentData( Parent ); - Model.SetParentList( Parents ); - - Nodes.AddNode( &Model ); - } - for ( u3dMesh_list::iterator it = Meshes.begin(); it != Meshes.end(); ++it ) - { -// if ( it->name == "UnitBall" ) -// continue; - ModelNode Model; - Model.SetType( IDTF_MODEL ); - Model.SetName( it->name.c_str() ); - Model.SetResourceName( it->name.c_str() ); - ParentList Parents; - ParentData Parent; - if ( it->parent == NULL) - Parent.SetParentName( L"" ); - else - Parent.SetParentName( it->parent->name.c_str() ); - - IFXMatrix4x4 Position; - Position.Reset(); - Position[ 0] = it->position[0][0]; - Position[ 1] = it->position[1][0]; - Position[ 2] = it->position[2][0]; - Position[ 3] = it->position[3][0]; - Position[ 4] = it->position[0][1]; - Position[ 5] = it->position[1][1]; - Position[ 6] = it->position[2][1]; - Position[ 7] = it->position[3][1]; - Position[ 8] = it->position[0][2]; - Position[ 9] = it->position[1][2]; - Position[10] = it->position[2][2]; - Position[11] = it->position[3][2]; - Position[12] = it->position[0][3]; - Position[13] = it->position[1][3]; - Position[14] = it->position[2][3]; - Position[15] = it->position[3][3]; - - IFXMatrix4x4 Matrix; - Matrix.Reset(); - Matrix.Multiply3x4(GlobInv,Position); - - Parent.SetParentTM( Matrix ); - Parents.AddParentData( Parent ); - Model.SetParentList( Parents ); - - if (it->both_visible) - Model.SetVisibility( L"BOTH" ); - - Nodes.AddNode( &Model ); - } - for ( u3dBall_list::iterator it = Balls.begin(); it != Balls.end(); ++it ) - { - ModelNode Model; - Model.SetType( IDTF_MODEL ); - Model.SetName( it->name.c_str() ); - Model.SetResourceName( L"UnitBall" ); - ParentList Parents; - ParentData Parent; - if ( it->parent == NULL) - Parent.SetParentName( L"" ); - else - Parent.SetParentName( it->parent->name.c_str() ); - - IFXMatrix4x4 Position; - Position.Reset(); - IFXVector3 Scale(it->radius, it->radius, it->radius); - Position.Scale3x4(Scale); - IFXVector3 Center(it->center.x, it->center.y, it->center.z); - Position.SetTranslation(Center); - - IFXMatrix4x4 Matrix; - Matrix.Reset(); - Matrix.Multiply3x4(GlobInv,Position); - - Parent.SetParentTM( Matrix ); - Parents.AddParentData( Parent ); - Model.SetParentList( Parents ); - - Nodes.AddNode( &Model ); - } - } - // End nodes - - // Write lights resources - LightResourceList* pLightResources = static_cast< LightResourceList* >( Resources.GetResourceList( IDTF_LIGHT ) ); - for ( u3dLight_list::iterator it = Lights.begin(); it != Lights.end(); ++it ) - { - LightResource lightResource; - lightResource.SetName( it->name.c_str() ); - if (it->type == "POINT") - lightResource.m_type = IDTF_POINT_LIGHT; - else if (it->type == "DIRECTIONAL" ) - lightResource.m_type = IDTF_DIRECTIONAL_LIGHT; - else - lightResource.m_type = IDTF_AMBIENT_LIGHT; - lightResource.m_color.SetColor( IFXVector4( it->color.r, it->color.g, it->color.b ) ); - lightResource.m_attenuation.SetPoint( IFXVector3( it->attenuation, 0.0f, 0.0f ) ); - lightResource.m_intensity = it->intensity; - lightResource.m_spotAngle = 0.0f; - pLightResources->AddResource( lightResource ); - } - - // Write model resources - ModelResourceList* pModelResources = static_cast< ModelResourceList* >( Resources.GetResourceList( IDTF_MODEL ) ); - for ( u3dPointSet_list::iterator it = PointSets.begin(); it != PointSets.end(); ++it ) - { - // is there just one color in the model? - bool onecolor = true; - // is there just one black color in the model? - bool oneblackcolor = false; - size_t numColors = it->Colors.size(); - for ( size_t cid=0; cid < numColors; cid++ ) - { - if ( it->Colors[0].r != it->Colors[cid].r || it->Colors[0].g != it->Colors[cid].g || it->Colors[0].b != it->Colors[cid].b ) - { - onecolor = false; - break; - } - } - if ( onecolor ) // if there is just one color in the model - make the corresponding material - { - it->ModelMaterials.pop_back(); - mreal c[4] = { it->Colors[0].r, it->Colors[0].g, it->Colors[0].b, 1.0f }; - it->AddModelMaterial ( c, true, false ); - oneblackcolor = it->Colors[0] == BC; - it->Colors.clear(); - numColors = 0; - it->vertex_color = false; - } - bool colored = it->Colors.size() > 0; - - if ( oneblackcolor ) - { - size_t numPoints = it->Points.size(); - - PointSetResource pointSetResource; - pointSetResource.SetName( it->name.c_str() ); - pointSetResource.m_type = IDTF_POINT_SET; - pointSetResource.pointCount = numPoints; - pointSetResource.m_modelDescription.positionCount = numPoints; - pointSetResource.m_modelDescription.basePositionCount = 0; - pointSetResource.m_modelDescription.normalCount = 0; - pointSetResource.m_modelDescription.diffuseColorCount = 0; - pointSetResource.m_modelDescription.specularColorCount = 0; - pointSetResource.m_modelDescription.textureCoordCount = 0; - pointSetResource.m_modelDescription.boneCount = 0; - pointSetResource.m_modelDescription.shadingCount = 1; - ShadingDescription shadingDescription; - shadingDescription.m_shaderId = 0; - shadingDescription.m_textureLayerCount = 0; - pointSetResource.m_shadingDescriptions.AddShadingDescription( shadingDescription ); - - for ( size_t id=0; id < numPoints; id++ ) - pointSetResource.m_pointPositions.CreateNewElement() = id; - - for ( size_t id=0; id < numPoints; id++ ) - pointSetResource.m_pointShaders.CreateNewElement() = 0; - - for ( size_t pid=0; pid < numPoints; pid++ ) - pointSetResource.m_positions.CreateNewElement().SetPoint( IFXVector3 ( it->Points[pid].x, it->Points[pid].y, it->Points[pid].z ) ); - - pModelResources->AddResource( &pointSetResource ); - } - else - // Convert pointset to mesh - { - size_t numPoints = it->Points.size(); - size_t duplpoints = it->Points.size() % 3; - if ( duplpoints > 0 ) - { - it->Points.push_back( it->Points.back() ); - it->Colors.push_back( it->Colors.back() ); - numPoints++; - } - if ( duplpoints == 1 ) - { - it->Points.push_back( it->Points.back() ); - it->Colors.push_back( it->Colors.back() ); - numPoints++; - } - - size_t numTriangles = it->Points.size() / 3; - - MeshResource meshResource; - meshResource.SetName( it->name.c_str() ); - meshResource.m_type = IDTF_MESH; - meshResource.faceCount = numTriangles; - meshResource.m_modelDescription.positionCount = numPoints; - meshResource.m_modelDescription.basePositionCount = numPoints; - meshResource.m_modelDescription.normalCount = 0; - meshResource.m_modelDescription.diffuseColorCount = numColors; - meshResource.m_modelDescription.specularColorCount = 0; - meshResource.m_modelDescription.textureCoordCount = 0; - meshResource.m_modelDescription.boneCount = 0; - meshResource.m_modelDescription.shadingCount = 1; - ShadingDescription shadingDescription; - shadingDescription.m_shaderId = 0; - shadingDescription.m_textureLayerCount = 0; - meshResource.m_shadingDescriptions.AddShadingDescription( shadingDescription ); - - for ( size_t id=0; id < numTriangles; id++ ) - meshResource.m_facePositions.CreateNewElement().SetData( 3*id+0, 3*id+1, 3*id+2 ); - - for ( size_t id=0; id < numTriangles; id++ ) - meshResource.m_faceShaders.CreateNewElement() = 0; - - if ( colored ) - for ( size_t id=0; id < numTriangles; id++ ) - meshResource.m_faceDiffuseColors.CreateNewElement().SetData( 3*id+0, 3*id+1, 3*id+2 ); - - for ( size_t pid=0; pid < numPoints; pid++ ) - meshResource.m_positions.CreateNewElement().SetPoint( IFXVector3 ( it->Points[pid].x, it->Points[pid].y, it->Points[pid].z ) ); - - if ( colored ) - for ( size_t cid=0; cid < numColors; cid++ ) - meshResource.m_diffuseColors.CreateNewElement().SetColor( IFXVector4 ( it->Colors[cid].r, it->Colors[cid].g, it->Colors[cid].b ) ); - - for ( size_t pid=0; pid < numPoints; pid++ ) - meshResource.m_basePositions.CreateNewElement() = pid; - - pModelResources->AddResource( &meshResource ); - } - } - for ( u3dLineSet_list::iterator it = LineSets.begin(); it != LineSets.end(); ++it ) - { - size_t numMaterials = it->ModelMaterials.size(); - size_t numPoints = it->Points.size(); - size_t numLines = it->Lines.size(); - - LineSetResource lineSetResource; - lineSetResource.SetName( it->name.c_str() ); - lineSetResource.m_type = IDTF_LINE_SET; - lineSetResource.lineCount = numLines; - lineSetResource.m_modelDescription.positionCount = numPoints; - lineSetResource.m_modelDescription.basePositionCount = 0; - lineSetResource.m_modelDescription.normalCount = 0; - lineSetResource.m_modelDescription.diffuseColorCount = 0; - lineSetResource.m_modelDescription.specularColorCount = 0; - lineSetResource.m_modelDescription.textureCoordCount = 0; - lineSetResource.m_modelDescription.boneCount = 0; - lineSetResource.m_modelDescription.shadingCount = numMaterials; - for ( size_t id=0; id < numMaterials; id++ ) - { - ShadingDescription shadingDescription; - shadingDescription.m_shaderId = id; - shadingDescription.m_textureLayerCount = 0; - lineSetResource.m_shadingDescriptions.AddShadingDescription( shadingDescription ); - } - - for ( size_t id=0; id < numLines; id++ ) - lineSetResource.m_linePositions.CreateNewElement().SetData( it->Lines[id].pid1, it->Lines[id].pid2 ); - - for ( size_t id=0; id < numLines; id++ ) - lineSetResource.m_lineShaders.CreateNewElement() = it->Lines[id].mid; - - for ( size_t pid=0; pid < numPoints; pid++ ) - lineSetResource.m_positions.CreateNewElement().SetPoint( IFXVector3 ( it->Points[pid].x, it->Points[pid].y, it->Points[pid].z ) ); - - pModelResources->AddResource( &lineSetResource ); - } - for ( u3dMesh_list::iterator it = Meshes.begin(); it != Meshes.end(); ++it ) - { - size_t numMaterials = it->ModelMaterials.size(); - size_t numPoints = it->Points.size(); - size_t numTriangles = it->Triangles.size(); - size_t numTexCoords = it->textureCoords.size(); - bool textured = it->textureDimension > 0; - bool shaded = it->faceShaders.size() > 0; - - if ( it->Colors.size() == 1 ) // if there is just one color in the model - make the corresponding material - { - it->ModelMaterials.pop_back(); - mreal c[4] = { it->Colors[0].r, it->Colors[0].g, it->Colors[0].b, 1.0f }; - it->AddModelMaterial ( c, false, false ); - it->Colors.clear(); - } - bool colored = it->Colors.size() > 0; - size_t numColors = it->Colors.size(); - - MeshResource meshResource; - meshResource.SetName( it->name.c_str() ); - meshResource.m_type = IDTF_MESH; - meshResource.faceCount = numTriangles; - meshResource.m_modelDescription.positionCount = numPoints; - if ( it->disable_compression ) - meshResource.m_modelDescription.basePositionCount = numPoints; - else - meshResource.m_modelDescription.basePositionCount = 0; - meshResource.m_modelDescription.normalCount = 0; - meshResource.m_modelDescription.diffuseColorCount = numColors; - meshResource.m_modelDescription.specularColorCount = 0; - meshResource.m_modelDescription.textureCoordCount = numTexCoords; - meshResource.m_modelDescription.boneCount = 0; - meshResource.m_modelDescription.shadingCount = numMaterials; - for ( size_t cid=0; cid < numMaterials; cid++ ) - { - ShadingDescription shadingDescription; - shadingDescription.m_shaderId = cid; - if ( textured ) - { - shadingDescription.m_textureLayerCount = 1; - shadingDescription.AddTextureCoordDimension( it->textureDimension ); - } - else - shadingDescription.m_textureLayerCount = 0; - meshResource.m_shadingDescriptions.AddShadingDescription( shadingDescription ); - } - - for ( size_t id=0; id < numTriangles; id++ ) - meshResource.m_facePositions.CreateNewElement().SetData( it->Triangles[id].a, it->Triangles[id].b, it->Triangles[id].c ); - - for ( size_t id=0; id < numTriangles; id++ ) - if ( shaded ) - meshResource.m_faceShaders.CreateNewElement() = it->faceShaders[id]; - else - meshResource.m_faceShaders.CreateNewElement() = 0; - - if ( textured ) - for ( size_t id=0; id < numTriangles; id++ ) - meshResource.m_faceTextureCoords.CreateNewElement().m_texCoords.CreateNewElement().SetData( it->faceColors[id].a, it->faceColors[id].b, it->faceColors[id].c ); - - if ( colored ) - for ( size_t id=0; id < numTriangles; id++ ) - meshResource.m_faceDiffuseColors.CreateNewElement().SetData( it->faceColors[id].a, it->faceColors[id].b, it->faceColors[id].c ); - - for ( size_t pid=0; pid < numPoints; pid++ ) - meshResource.m_positions.CreateNewElement().SetPoint( IFXVector3 ( it->Points[pid].x, it->Points[pid].y, it->Points[pid].z ) ); - - if ( colored ) - for ( size_t cid=0; cid < numColors; cid++ ) - meshResource.m_diffuseColors.CreateNewElement().SetColor( IFXVector4 ( it->Colors[cid].r, it->Colors[cid].g, it->Colors[cid].b ) ); - - if ( textured ) - for ( size_t cid=0; cid < numTexCoords; cid++ ) - meshResource.m_textureCoords.CreateNewElement().Set( it->textureCoords[cid].U, ( it->textureDimension == 2 ? it->textureCoords[cid].V : 0.0 ), 0.0, 0.0 ); - - if ( it->disable_compression ) - for ( size_t pid=0; pid < numPoints; pid++ ) - meshResource.m_basePositions.CreateNewElement() = pid; - - pModelResources->AddResource( &meshResource ); - } - if ( Balls.size() != 0 ) - { - const size_t ThetaResolution = 10; // 4 - const size_t PhiResolution = 10; // 3 - mglPoint pnt; - mglPoint nrm; - const mglPoint Center = mglPoint ( 0, 0, 0 ); - const mreal Radius = 1.0f; - const size_t numTriangles = ThetaResolution*(PhiResolution-2)*2; - const size_t numPoints = ThetaResolution*(PhiResolution-2)+2; - - MeshResource meshResource; - meshResource.SetName( L"UnitBall" ); - meshResource.m_type = IDTF_MESH; - meshResource.faceCount = numTriangles; - meshResource.m_modelDescription.positionCount = numPoints; - meshResource.m_modelDescription.basePositionCount = numPoints; - meshResource.m_modelDescription.normalCount = 0; - meshResource.m_modelDescription.diffuseColorCount = 0; - meshResource.m_modelDescription.specularColorCount = 0; - meshResource.m_modelDescription.textureCoordCount = 0; - meshResource.m_modelDescription.boneCount = 0; - meshResource.m_modelDescription.shadingCount = 1; - ShadingDescription shadingDescription; - shadingDescription.m_shaderId = 0; - shadingDescription.m_textureLayerCount = 0; - meshResource.m_shadingDescriptions.AddShadingDescription( shadingDescription ); - - // tetrahedron - // Mesh.Points.push_back ( Radius * mglPoint ( 1, 1, 1) ); - // Mesh.Points.push_back ( Radius * mglPoint (-1, -1, 1) ); - // Mesh.Points.push_back ( Radius * mglPoint (-1, 1, -1) ); - // Mesh.Points.push_back ( Radius * mglPoint ( 1, -1, -1) ); - // size_t3 triangle; - // triangle.a = 0; - // triangle.b = 1; - // triangle.c = 3; - // Mesh.Triangles.push_back ( triangle ); - // triangle.a = 0; - // triangle.b = 2; - // triangle.c = 1; - // Mesh.Triangles.push_back ( triangle ); - // triangle.a = 1; - // triangle.b = 2; - // triangle.c = 3; - // Mesh.Triangles.push_back ( triangle ); - // triangle.a = 0; - // triangle.b = 2; - // triangle.c = 3; - // Mesh.Triangles.push_back ( triangle ); - // Meshes.push_back ( Mesh ); - - // Create north pole - nrm.x = nrm.y = 0.0; nrm.z = 1.0; - pnt = Center + Radius * nrm; - meshResource.m_positions.CreateNewElement().SetPoint( IFXVector3 (pnt.x, pnt.y, pnt.z ) ); - - // Create south pole - nrm.x = nrm.y = 0.0; nrm.z = -1.0; - pnt = Center + Radius * nrm; - meshResource.m_positions.CreateNewElement().SetPoint( IFXVector3 (pnt.x, pnt.y, pnt.z ) ); - - // Create intermediate points - for ( size_t i=0; i < ThetaResolution; i++ ) - { - double deltaTheta = 2*M_PI/ThetaResolution; - double theta = i*deltaTheta;; - - for ( size_t j=1; jAddResource( &meshResource ); - } - - // Write shaders - ShaderResourceList* pShaderResources = static_cast< ShaderResourceList* >( Resources.GetResourceList( IDTF_SHADER ) ); - for ( u3dMaterial_list::iterator it = Materials.begin(); it != Materials.end(); ++it ) - { - Shader shaderResource; - shaderResource.SetName( it->name.c_str() ); - if ( it->texture.empty() && it->vertex_color ) - shaderResource.m_useVertexColor = IDTF_TRUE; - shaderResource.m_materialName = it->name.c_str(); - if ( ! it->texture.empty() ) - { - TextureLayer textureLayer; - textureLayer.m_channel = 0; - textureLayer.m_intensity = 1.0f; - textureLayer.m_blendFunction = L"REPLACE"; - textureLayer.m_blendSource = L"ALPHA"; - textureLayer.m_blendConstant = 0.5; - textureLayer.m_alphaEnabled = (it->textumrealpha ? IDTF_TRUE : IDTF_FALSE); - textureLayer.m_repeat = L"NONE"; - textureLayer.m_textureName = it->texture.c_str(); - shaderResource.AddTextureLayer( textureLayer ); - } - pShaderResources->AddResource( shaderResource ); - } - - // Write materials - MaterialResourceList* pMaterialResources = static_cast< MaterialResourceList* >( Resources.GetResourceList( IDTF_MATERIAL ) ); - for ( u3dMaterial_list::iterator it = Materials.begin(); it != Materials.end(); ++it ) - { - Material materialResource; - materialResource.SetName( it->name.c_str() ); - materialResource.m_ambient.SetColor( IFXVector4( 0, 0, 0 ) ); - materialResource.m_diffuse.SetColor( IFXVector4( it->diffuse.r, it->diffuse.g, it->diffuse.b ) ); - materialResource.m_specular.SetColor( IFXVector4( it->specular.r, it->specular.g, it->specular.b ) ); - materialResource.m_emissive.SetColor( IFXVector4( it->emissive.r, it->emissive.g, it->emissive.b ) ); - materialResource.m_reflectivity = it->reflectivity; - materialResource.m_opacity = it->opacity; - pMaterialResources->AddResource( materialResource ); - } - - // Write textures - TextureResourceList* pTextureResources = static_cast< TextureResourceList* >( Resources.GetResourceList( IDTF_TEXTURE ) ); - for ( u3dTexture_list::iterator it = Textures.begin(); it != Textures.end(); ++it ) - { - char filename[PATH_MAX]; - bzero( filename, sizeof(filename) ); - strncpy(filename, fname, sizeof(filename)-1); - strncat(filename, it->name.c_str(), sizeof(filename)-strlen(filename)-5); - strcat(filename, ".tga" ); - - Texture textureResource; - textureResource.SetName( it->name.c_str() ); - ImageFormat imageFormat; - imageFormat.m_compressionType = IDTF_IMAGE_COMPRESSION_TYPE_PNG; - imageFormat.m_alpha = (it->image.Channels == 4 ? IDTF_TRUE : IDTF_FALSE) ; - imageFormat.m_blue = IDTF_TRUE; - imageFormat.m_green = IDTF_TRUE; - imageFormat.m_red = IDTF_TRUE; - - textureResource.AddImageFormat( imageFormat ); - textureResource.SetExternal( FALSE ); - textureResource.SetPath( filename ); - textureResource.SetImageType( (it->image.Channels == 4 ? IDTF_IMAGE_TYPE_RGBA : IDTF_IMAGE_TYPE_RGB) ); - - textureResource.m_textureImage.Initialize( it->image.Width, it->image.Height, it->image.Channels ); - textureResource.m_textureImage.SetData( it->image.RGBPixels ); - - pTextureResources->AddResource( textureResource ); - } - - // Write shading modifiers - for ( u3dPointSet_list::iterator it = PointSets.begin(); it != PointSets.end(); ++it ) - { - ShadingModifier shadingModifier; - shadingModifier.SetName( it->name.c_str() ); - shadingModifier.SetType( IDTF_SHADING_MODIFIER ); - shadingModifier.SetChainType( IDTF_NODE ); - shadingModifier.SetAttributes( ATTRMESH | ATTRLINE | ATTRPOINT | ATTRGLYPH ); - for ( ModelMaterial_list::const_iterator itm = it->ModelMaterials.begin(); itm != it->ModelMaterials.end(); ++itm ) - { - ShaderList shaderList; - shaderList.AddShaderName( this->Materials[*itm].name.c_str() ); - shadingModifier.AddShaderList( shaderList ); - } - Modifiers.AddModifier( &shadingModifier ); - } - for ( u3dLineSet_list::iterator it = LineSets.begin(); it != LineSets.end(); ++it ) - { - ShadingModifier shadingModifier; - shadingModifier.SetName( it->name.c_str() ); - shadingModifier.SetType( IDTF_SHADING_MODIFIER ); - shadingModifier.SetChainType( IDTF_NODE ); - shadingModifier.SetAttributes( ATTRMESH | ATTRLINE | ATTRPOINT | ATTRGLYPH ); - for ( ModelMaterial_list::const_iterator itm = it->ModelMaterials.begin(); itm != it->ModelMaterials.end(); ++itm ) - { - ShaderList shaderList; - shaderList.AddShaderName( this->Materials[*itm].name.c_str() ); - shadingModifier.AddShaderList( shaderList ); - } - Modifiers.AddModifier( &shadingModifier ); - } - for ( u3dMesh_list::iterator it = Meshes.begin(); it != Meshes.end(); ++it ) - { - ShadingModifier shadingModifier; - shadingModifier.SetName( it->name.c_str() ); - shadingModifier.SetType( IDTF_SHADING_MODIFIER ); - shadingModifier.SetChainType( IDTF_NODE ); - shadingModifier.SetAttributes( ATTRMESH | ATTRLINE | ATTRPOINT | ATTRGLYPH ); - for ( ModelMaterial_list::const_iterator itm = it->ModelMaterials.begin(); itm != it->ModelMaterials.end(); ++itm ) - { - ShaderList shaderList; - shaderList.AddShaderName( this->Materials[*itm].name.c_str() ); - shadingModifier.AddShaderList( shaderList ); - } - Modifiers.AddModifier( &shadingModifier ); - } - for ( u3dBall_list::iterator it = Balls.begin(); it != Balls.end(); ++it ) - { - ShadingModifier shadingModifier; - shadingModifier.SetName( it->name.c_str() ); - shadingModifier.SetType( IDTF_SHADING_MODIFIER ); - shadingModifier.SetChainType( IDTF_NODE ); - shadingModifier.SetAttributes( ATTRMESH | ATTRLINE | ATTRPOINT | ATTRGLYPH ); - ShaderList shaderList; - shaderList.AddShaderName( this->Materials[it->material].name.c_str() ); - shadingModifier.AddShaderList( shaderList ); - Modifiers.AddModifier( &shadingModifier ); - } - - } - - // Write to IDTF file -// char *idtfFileName = new char [strlen(fname)+1+5]; -// strcpy(idtfFileName, fname); -// strcat(idtfFileName,".idtf"); -// converter.Export( idtfFileName ); -// delete [] idtfFileName; - - // Convert to binary - converter.Convert(); - - //---------------------------------------------- - // Scene now built and in the U3D engine. - // It is now time to examine the scene and/or - // dump it to a debug file or a U3D file. - //---------------------------------------------- - // Write out the scene to a U3D file if this is enabled. - if ( IFXSUCCESS( result ) && ( fileOptions.exportOptions > 0 ) ) - { - result = sceneUtils.WriteSceneToFile( fileOptions.outFile, fileOptions.exportOptions ); - } - // If enabled, dump the scene to the debug file. - if ( IFXSUCCESS( result ) && ( fileOptions.debugLevel > 0 ) ) - { - U8 file[MAXIMUM_FILENAME_LENGTH]; - result = fileOptions.outFile.ConvertToRawU8( file, MAXIMUM_FILENAME_LENGTH ); - - if ( IFXSUCCESS( result ) ) - result = sceneUtils.WriteDebugInfo( (const char*)file ); - } - - } - IFXTRACE_GENERIC( L"[Converter] Exit code = %x\n", result); - if ( !IFXSUCCESS( result ) ) fprintf(stderr,"converter exit code %x\n", result); - IFXRESULT comResult = IFXCOMUninitialize(); - IFXTRACE_GENERIC( L"[Converter] IFXCOMUninitialize %i\n", comResult ); - if ( !IFXSUCCESS( result ) ) fprintf(stderr,"U3D library unload error %x\n", comResult); - IFXDEBUG_SHUTDOWN(); -} -#ifdef HAVE_HPDF_H -void mglGraphIDTF::WritePDF ( const char *fileNameParam,const char *descr ) - { - char fname[PATH_MAX]; // file name without extension - bzero( fname, sizeof(fname) ); - strncpy(fname, fileNameParam, sizeof(fname)-1); - const size_t fnlen = strlen(fname); - if ( fnlen > 5 && strcasecmp(fname+fnlen-5, ".idtf") == 0 ) - fname[fnlen-5]='\0'; - else if ( fnlen > 4 && strcasecmp(fname+fnlen-4, ".u3d") == 0 ) - fname[fnlen-4]='\0'; - else if ( fnlen > 4 && strcasecmp(fname+fnlen-4, ".pdf") == 0 ) - fname[fnlen-4]='\0'; - - HPDF_Rect rect = {0, 0, 600, 600}; - - HPDF_Doc pdf; - HPDF_Page page; - HPDF_Annotation annot; - HPDF_U3D u3d; - - HPDF_Dict view; - - char u3dFileName[strlen(fname)+1+4+4]; - strcpy(u3dFileName, fname); - strcat(u3dFileName,"_tmp.u3d"); - char pdfFileName[strlen(fname)+1+4]; - strcpy(pdfFileName, fname); - strcat(pdfFileName,".pdf"); - - WriteU3D(u3dFileName); - - pdf = HPDF_New (NULL, NULL); - if (!pdf) { - fprintf (stderr, "error: cannot create PdfDoc object\n"); - return; - } - - pdf->pdf_version = HPDF_VER_17; - - page = HPDF_AddPage (pdf); - - HPDF_Page_SetWidth (page, 600); - HPDF_Page_SetHeight (page, 600); - - u3d = HPDF_LoadU3DFromFile (pdf, u3dFileName); - - // Default view - view = HPDF_Create3DView (u3d->mmgr, "DefaultView"); - - // Position camera - if(unrotate_flag) - { - HPDF_REAL c2cx = 0, c2cy = 0, c2cz = 1; - RotateMy(&c2cx, &c2cy, &c2cz, -rotX, 1, 0, 0); - RotateMy(&c2cx, &c2cy, &c2cz, -rotY, 0, 1, 0); - RotateMy(&c2cx, &c2cy, &c2cz, -rotZ, 0, 0, 1); - HPDF_3DView_SetCamera (view, 0, 0, 0, c2cx, c2cy, c2cz, 3, 0); - } - else - HPDF_3DView_SetCamera (view, 0, 0, 0, 0, 0, 1, 3, 0); - - // Set ortho projection - HPDF_3DView_SetOrthogonalProjection (view, unrotate_flag?300/PlotFactor:300); - - // Background color - HPDF_3DView_SetBackgroundColor (view, 0.9, 0.9, 0.9); - - // Lighting -// HPDF_3DView_SetLighting (view, "CAD"); - - // Control of individual nodes - for ( u3dPointSet_list::iterator it = PointSets.begin(); it != PointSets.end(); ++it ) - { - HPDF_Array nodes = NULL; - HPDF_Dict node = NULL; - HPDF_Dict modedict = NULL; - HPDF_STATUS ret = HPDF_OK; - - nodes = (HPDF_Array)HPDF_Dict_GetItem (view, "NA", HPDF_OCLASS_ARRAY); - if (nodes == NULL) { - nodes = HPDF_Array_New (view->mmgr); - HPDF_Dict_Add (view, "NA", nodes); - } - - node = HPDF_Dict_New (view->mmgr); - HPDF_Dict_AddName (node, "Type", "3DNode"); - HPDF_Dict_Add (node, "N", HPDF_String_New (view->mmgr, it->name.c_str(), NULL)); - - modedict = HPDF_Dict_New (view->mmgr); - modedict->header.obj_class |= HPDF_OSUBCLASS_XOBJECT; - HPDF_Dict_AddName (modedict, "Type", "3DRenderMode"); - HPDF_Dict_AddName (modedict, "Subtype", "ShadedVertices"); - - HPDF_Dict_Add (node, "RM", modedict); - - ret = HPDF_Array_Add(nodes, node); - } - - // Add views - HPDF_U3D_Add3DView (u3d, view); - HPDF_U3D_SetDefault3DView(u3d, "DefaultView"); - - HPDF_Dict js = NULL; - - js = HPDF_DictStream_New (pdf->mmgr, pdf->xref); - - js->header.obj_class |= HPDF_OSUBCLASS_XOBJECT; - - /* add required elements */ - js->filter = HPDF_STREAM_FILTER_NONE; - - const unsigned char buf[] = -"\ -// inspired by s2plot.js \n\ -// arrays of specially-named sections of the model tree \n\ -var bbmeshes = new Array(); // stores the billboard meshes \n\ -var bbpos = new Array(); // stores the billboard positions \n\ -var bbscale = new Array(); // stores the billboard scales \n\ -var bbcount = 0; // how many billboard meshes are there? \n\ -var vrx = new Array(); // x volume rendering planes \n\ -var vrxcount = 0; \n\ -var vry = new Array(); \n\ -var vrycount = 0; \n\ -var vrz = new Array(); \n\ -var vrzcount = 0; \n\ - \n\ - \n\ -// compile lists of BBOARD*, VRSET* and FRAME* meshes \n\ -var meshes=scene.meshes; \n\ -var meshescount=meshes.count; \n\ -for (var i=0; i 0) { \n\ - Pname = mesh.parent.name; \n\ - if (mesh.parent.name.length > 0) { \n\ - PPname = mesh.parent.parent.name; \n\ - if (mesh.parent.parent.name.length > 0) { \n\ - PPPname = mesh.parent.parent.parent.name; \n\ - if (mesh.parent.parent.parent.name.length > 0) { \n\ - PPPPname = mesh.parent.parent.parent.parent.name; \n\ - } \n\ - } \n\ - } \n\ - } \n\ - if (( name.indexOf(\"_bb\") > -1) || \n\ - ( Pname.indexOf(\"_bb\") > -1) || \n\ - ( PPname.indexOf(\"_bb\") > -1)) { \n\ - bbmeshes.push(mesh); \n\ - var bb_scale = Math.pow(Math.abs(mesh.transform.determinant),1.0/3.0); // scale. \n\ - var bb_center = mesh.computeBoundingBox().center; // center (vector3) \n\ - bbpos.push(mesh.transform.translation.addScaled(bb_center, bb_scale)); \n\ - bbscale.push(Matrix4x4().translate(bb_center.scale(-1)).scale(bb_scale, bb_scale, bb_scale)); \n\ - } else if (( Pname.indexOf(\"xSections\") > -1) || \n\ - ( PPname.indexOf(\"xSections\") > -1) || \n\ - ( PPPname.indexOf(\"xSections\") > -1)) { \n\ - vrx.push(mesh); \n\ - } else if (( Pname.indexOf(\"ySections\") > -1) || \n\ - ( PPname.indexOf(\"ySections\") > -1) || \n\ - ( PPPname.indexOf(\"ySections\") > -1)) { \n\ - vry.push(mesh); \n\ - } else if (( Pname.indexOf(\"zSections\") > -1) || \n\ - ( PPname.indexOf(\"zSections\") > -1) || \n\ - ( PPPname.indexOf(\"zSections\") > -1)) { \n\ - vrz.push(mesh); \n\ - } \n\ - \n\ -} \n\ -bbcount=bbmeshes.length; \n\ -vrxcount=vrx.length; \n\ -vrycount=vry.length; \n\ -vrzcount=vrz.length; \n\ - \n\ -// Get Camera \n\ -var camera = scene.cameras.getByIndex(0); \n\ - \n\ -function doBillboard() { \n\ - \n\ - // Loop through all billboards, orientating their view direction with the camera position. \n\ - var cam_posn = camera.position.subtract(camera.targetPosition); // Camera's position vector (vector3) \n\ - var cam_up = camera.up.subtract(camera.position); // Camera's up vector (vector3) \n\ - for (var j = 0; j < bbcount; j++) { \n\ - var bb_pos = bbpos[j]; \n\ - var bb_trans = Matrix4x4(); \n\ - bb_trans.setView(bb_pos, cam_posn.add(bb_pos), cam_up.add(bb_pos)); \n\ - bbmeshes[j].transform.set(bbscale[j].multiply(bb_trans)); // Set billboard view. \n\ - } \n\ - \n\ -} \n\ - \n\ -// volume rendering handling code \n\ -function setVRSETvis(which, visibility, update) { \n\ - if (which == 0) { \n\ - for (var j=0; j= Math.abs(camdir.x)) && \n\ - (Math.abs(camdir.y) >= Math.abs(camdir.z))) { \n\ - whichframeset = 1; \n\ - } else if ((Math.abs(camdir.z) >= Math.abs(camdir.x)) && \n\ - (Math.abs(camdir.z) >= Math.abs(camdir.y))) { \n\ - whichframeset = 2; \n\ - } \n\ - if ( whichframeset != oldframeset ) { \n\ - oldframeset = whichframeset; \n\ - allSetVis(whichframeset); \n\ - } \n\ -} \n\ - \n\ - \n\ -mreh = new MouseEventHandler(); \n\ -mreh.onMouseDown = false; \n\ -mreh.onMouseMove = true; \n\ -mreh.reportAllTargets = false; \n\ -mreh.onEvent = function(event) { \n\ - if (event.leftButtonDown) { \n\ - doBillboard(); \n\ - pickFrameSet(); \n\ - } \n\ -} \n\ -runtime.addEventHandler(mreh); \n\ - \n\ -ceh = new RenderEventHandler(); \n\ -ceh.onEvent = function(event) { \n\ - doBillboard(); \n\ - pickFrameSet(); \n\ -} \n\ -runtime.addEventHandler(ceh); \n\ - \n\ -doBillboard(); \n\ -pickFrameSet(); \n\ - \n\ -"; - HPDF_Stream_Write (js->stream, buf, strlen((char*)buf)); - HPDF_Dict_Add (u3d, "OnInstantiate", js); - - // Create annotation - annot = HPDF_Page_Create3DAnnot (page, rect, u3d ); - - /* save the document to a file */ - HPDF_SaveToFile (pdf, pdfFileName); - - /* clean up */ - HPDF_Free (pdf); - - remove(u3dFileName); - } -#else -void mglGraphIDTF::WritePDF ( const char *fileNameParam,const char *descr ) {} -#endif -#else // HAVE_U3D -void mglGraphIDTF::WriteU3D ( const char *fileNameParam,const char *descr ) {} -void mglGraphIDTF::WritePDF ( const char *fileNameParam,const char *descr ) {} -#endif // HAVE_U3D -//----------------------------------------------------------------------------- -void mglGraphIDTF::quads_plot(long n,mreal *pp,mreal *cc,bool *tt) -{ - register long i; - mreal *p=NULL, *c=NULL; - u3dMesh *pMesh = NULL;; - u3dModel *pModel = NULL;; - u3dLineSet *pLineSet = NULL; - if(DrawFace) - { - pModel = pMesh = &GetMesh(); - } - else - { - pModel = pLineSet = &GetLineSet(); - } - PostScale(pp,4*n); LightScale(); - if(cc) - { - - size_t mid = SIZE_MAX; - if(DrawFace) - { - if ( pMesh->vertex_color ) - { - const mreal color[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - mid = pMesh->AddModelMaterial ( color, false, true ); - } - } - - for(i=0;iAddPoint ( p ); - size_t pid1 = pModel->AddPoint ( p+3 ); - size_t pid2 = pModel->AddPoint ( p+6 ); - size_t pid3 = pModel->AddPoint ( p+9 ); - - if(DrawFace) - { - if ( pMesh->vertex_color ) - { - size_t cid0 = pMesh->AddColor ( c ); - size_t cid1 = pMesh->AddColor ( c+4 ); - size_t cid2 = pMesh->AddColor ( c+8 ); - size_t cid3 = pMesh->AddColor ( c+12 ); - pMesh->AddTriangle ( pid0, pid1, pid3, cid0, cid1, cid3 ); - pMesh->AddTriangle ( pid1, pid2, pid3, cid1, cid2, cid3 ); - } - else - { - mreal color[4]; - color[0] = ( c[0]+ c[4]+c[12] ) /3.0f; - color[1] = ( c[1]+ c[5]+c[13] ) /3.0f; - color[2] = ( c[2]+ c[6]+c[14] ) /3.0f; - color[3] = ( c[3]+ c[7]+c[15] ) /3.0f; - mid = pMesh->AddModelMaterial ( color, false, false ); - pMesh->AddTriangle ( pid0, pid1, pid3, mid ); - color[0] = ( c[4]+ c[8]+c[12] ) /3.0f; - color[1] = ( c[5]+ c[9]+c[13] ) /3.0f; - color[2] = ( c[6]+c[10]+c[14] ) /3.0f; - color[3] = ( c[7]+c[11]+c[15] ) /3.0f; - mid = pMesh->AddModelMaterial ( color, false, false ); - pMesh->AddTriangle ( pid1, pid2, pid3, mid ); - } - } - else - { - mreal color[4]; - color[3] = 1.0f; - color[0] = ( c[ 0+0] + c[ 4+0] ) /2.0f; - color[1] = ( c[ 0+1] + c[ 4+1] ) /2.0f; - color[2] = ( c[ 0+2] + c[ 4+2] ) /2.0f; - mid = pLineSet->AddModelMaterial ( color, true, false ); - pLineSet->AddLine( pid0, pid1, mid ); - color[0] = ( c[ 0+0] + c[12+0] ) /2.0f; - color[1] = ( c[ 0+1] + c[12+1] ) /2.0f; - color[2] = ( c[ 0+2] + c[12+2] ) /2.0f; - mid = pLineSet->AddModelMaterial ( color, true, false ); - pLineSet->AddLine( pid0, pid3, mid ); - color[0] = ( c[12+0] + c[ 8+0] ) /2.0f; - color[1] = ( c[12+1] + c[ 8+1] ) /2.0f; - color[2] = ( c[12+2] + c[ 8+2] ) /2.0f; - mid = pLineSet->AddModelMaterial ( color, true, false ); - pLineSet->AddLine( pid3, pid2, mid ); - color[0] = ( c[ 4+0] + c[ 8+0] ) /2.0f; - color[1] = ( c[ 4+1] + c[ 8+1] ) /2.0f; - color[2] = ( c[ 4+2] + c[ 8+2] ) /2.0f; - mid = pLineSet->AddModelMaterial ( color, true, false ); - pLineSet->AddLine( pid1, pid2, mid ); - } - } - } - else - { - - size_t mid = SIZE_MAX; - size_t cid = SIZE_MAX; - if(DrawFace) - { - if ( pMesh->vertex_color ) - { - const mreal color[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - mid = pMesh->AddModelMaterial ( color, false, true ); - cid = pMesh->AddColor ( CDef ); - } - else - { - mid = pMesh->AddModelMaterial ( CDef, false, false ); - } - } - else - { - mid = pLineSet->AddModelMaterial ( CDef, true, false ); - } - - for(i=0;iAddPoint ( p ); - size_t pid1 = pModel->AddPoint ( p+3 ); - size_t pid2 = pModel->AddPoint ( p+6 ); - size_t pid3 = pModel->AddPoint ( p+9 ); - - if(DrawFace) - { - if ( pMesh->vertex_color ) - { - pMesh->AddTriangle ( pid0, pid1, pid3, cid, cid, cid ); - pMesh->AddTriangle ( pid1, pid2, pid3, cid, cid, cid ); - } - else - { - pMesh->AddTriangle ( pid0, pid1, pid3, mid ); - pMesh->AddTriangle ( pid1, pid2, pid3, mid ); - } - } - else - { - pLineSet->AddLine( pid0, pid1, mid ); - pLineSet->AddLine( pid0, pid3, mid ); - pLineSet->AddLine( pid3, pid2, mid ); - pLineSet->AddLine( pid1, pid2, mid ); - } - } - } -} -//----------------------------------------------------------------------------- -// I do not remember what problem this workaround was initially for -void mglGraphIDTF::Putsw(mglPoint p,const wchar_t *text,const char *font,mreal size,char dir,mreal shift) -{ - bool disable_compression_sav = disable_compression_flag; - bool vertex_color_sav = vertex_color_flag; - disable_compression_flag = true; - vertex_color_flag = false; - mglGraphAB::Putsw(p, text, font, size, dir, shift); - disable_compression_flag = disable_compression_sav; - vertex_color_flag = vertex_color_sav; -} -mreal mglGraphIDTF::Putsw(mglPoint p,mglPoint l,const wchar_t *text,char font,mreal size) -{ - bool disable_compression_sav = disable_compression_flag; - bool vertex_color_sav = vertex_color_flag; - disable_compression_flag = true; - vertex_color_flag = false; - mreal ret = mglGraphAB::Putsw(p, l, text, font, size); - disable_compression_flag = disable_compression_sav; - vertex_color_flag = vertex_color_sav; - return ret; -} diff --git a/mgl/mgl_main.cpp b/mgl/mgl_main.cpp deleted file mode 100644 index 666f9a5..0000000 --- a/mgl/mgl_main.cpp +++ /dev/null @@ -1,1227 +0,0 @@ -/*************************************************************************** - * mgl_main.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#ifdef WIN32 -#include -#include -#else -#include -#endif -#include -#include -#include "mgl/mgl.h" -#include "mgl/mgl_eval.h" -//----------------------------------------------------------------------------- -const char *mglWarn[mglWarnEnd] = {"%s: data dimension(s) is incompatible", - "%s: data dimension(s) is too small", - "%s: minimal data value is negative", - "No file or wrong data dimensions", - "Not enough memory", - "%s: data values are zero", - "Too many legend entries", - "No legend entries", - "%s: slice value is out of range", - "%s: number of contours is zero or negative", - "Couldn't open file %s", - "Light: ID is out of range", - "Setsize: size(s) is zero or negative", - "Format %s is not supported for that build"}; -//----------------------------------------------------------------------------- -mglColorID mglColorIds[] = {{'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)}, - {'w', mglColor(1,1,1)}, {'W', mglColor(0.7,0.7,0.7)}, - {'c', mglColor(0,1,1)}, {'C', mglColor(0,0.5,0.5)}, - {'m', mglColor(1,0,1)}, {'M', mglColor(0.5,0,0.5)}, - {'y', mglColor(1,1,0)}, {'Y', mglColor(0.5,0.5,0)}, - {'h', mglColor(0.5,0.5,0.5)}, {'H', mglColor(0.3,0.3,0.3)}, - {'l', mglColor(0,1,0.5)}, {'L', mglColor(0,0.5,0.25)}, - {'e', mglColor(0.5,1,0)}, {'E', mglColor(0.25,0.5,0)}, - {'n', mglColor(0,0.5,1)}, {'N', mglColor(0,0.25,0.5)}, - {'u', mglColor(0.5,0,1)}, {'U', mglColor(0.25,0,0.5)}, - {'q', mglColor(1,0.5,0)}, {'Q', mglColor(0.5,0.25,0)}, - {'p', mglColor(1,0,0.5)}, {'P', mglColor(0.5,0,0.25)}, - {' ', mglColor(-1,-1,-1)}, {0, mglColor(-1,-1,-1)} // the last one MUST have id=0 -}; -//----------------------------------------------------------------------------- -bool mglTestMode=false; -void mglTest(const char *str, ...) -{ - if(mglTestMode) - { - char buf[256]; - va_list lst; - va_start(lst,str); - vsprintf(buf,str,lst); - va_end(lst); - printf("TEST: %s\n",buf); - fflush(stdout); - } -} -//--------------------------------------------------------------------------- -void mglGraph::RecalcBorder() -{ - if(!fx && !fy && !fz) - { FMin = Min; FMax = Max; } - else - { - FMin = mglPoint( 1e30, 1e30, 1e30); - FMax = mglPoint(-1e30,-1e30,-1e30); - register int i,j; - for(i=0;i<51;i++) for(j=0;j<51;j++) // x range - { - SetFBord(Min.x, Min.y+i*(Max.y-Min.y)/50, Min.z+j*(Max.z-Min.z)/50); - SetFBord(Max.x, Min.y+i*(Max.y-Min.y)/50, Min.z+j*(Max.z-Min.z)/50); - } - for(i=0;i<51;i++) for(j=0;j<51;j++) // y range - { - SetFBord(Min.x+i*(Max.x-Min.x)/50, Min.y, Min.z+j*(Max.z-Min.z)/50); - SetFBord(Min.x+i*(Max.x-Min.x)/50, Max.y, Min.z+j*(Max.z-Min.z)/50); - } - for(i=0;i<51;i++) for(j=0;j<51;j++) // x range - { - SetFBord(Min.x+i*(Max.x-Min.x)/50, Min.y+j*(Max.y-Min.y)/50, Min.x); - SetFBord(Min.x+i*(Max.x-Min.x)/50, Min.y+j*(Max.y-Min.y)/50, Max.z); - } - if(!fx) { FMin.x = Min.x; FMax.x = Max.x; } - if(!fy) { FMin.y = Min.y; FMax.y = Max.y; } - if(!fz) { FMin.z = Min.z; FMax.z = Max.z; } - } -} -//----------------------------------------------------------------------------- -void mglGraph::SetFBord(mreal x,mreal y,mreal z) -{ - if(fx) - { - mreal v = fx->Calc(x,y,z); - if(FMax.x < v) FMax.x = v; - if(FMin.x > v) FMin.x = v; - } - if(fy) - { - mreal v = fy->Calc(x,y,z); - if(FMax.y < v) FMax.y = v; - if(FMin.y > v) FMin.y = v; - } - if(fz) - { - mreal v = fz->Calc(x,y,z); - if(FMax.z < v) FMax.z = v; - if(FMin.z > v) FMin.z = v; - } -} -//----------------------------------------------------------------------------- -void mglGraph::Axis(mglPoint m1, mglPoint m2, mglPoint org) -{ - if(m1.xm2.x) { Min.x=m2.x; Max.x = m1.x; } - if(m1.ym2.y) { Min.y=m2.y; Max.y = m1.y; } - if(m1.zm2.z) { Min.z=m2.z; Max.z = m1.z; } - Cmin = Min.z; Cmax = Max.z; Org = org; - //OrgT = mglPoint(NAN,NAN,NAN); // Let user set it up manually ! - 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; - } - CutMin = mglPoint(0,0,0); CutMax = mglPoint(0,0,0); - RecalcBorder(); -} -//----------------------------------------------------------------------------- -void mglGraph::SetFunc(const char *EqX,const char *EqY,const char *EqZ,const char *EqA) -{ - if(fa) delete fa; if(fx) delete fx; - if(fy) delete fy; if(fz) delete fz; - if(EqX && EqX[0] && (EqX[0]!='x' || EqX[1]!=0)) - fx = new mglFormula(EqX); - else fx = 0; - if(EqY && EqY[0] && (EqY[0]!='y' || EqY[1]!=0)) - fy = new mglFormula(EqY); - else fy = 0; - if(EqZ && EqZ[0] && (EqZ[0]!='z' || EqZ[1]!=0)) - fz = new mglFormula(EqZ); - else fz = 0; - if(EqA && EqA[0] && ((EqA[0]!='c' && EqA[0]!='a') || EqA[1]!=0)) - fa = new mglFormula(EqA); - else fa = 0; - RecalcBorder(); -} -//----------------------------------------------------------------------------- -void mglGraph::CutOff(const char *EqC) -{ - if(fc) delete fc; - if(EqC && EqC[0]) fc = new mglFormula(EqC); else fc = 0; -} -//----------------------------------------------------------------------------- -//#define FLT_EPS 1.1920928955078125e-07 -#define FLT_EPS (1.+2e-07) -bool mglGraph::ScalePoint(mreal &x,mreal &y,mreal &z) -{ -// mreal x1=x,y1=y,z1=z; - if(isnan(x) || isnan(y) || isnan(z)) return false; - mreal x1,y1,z1,x2,y2,z2; - x1 = x>0?x*FLT_EPS:x/FLT_EPS; x2 = x<0?x*FLT_EPS:x/FLT_EPS; - y1 = y>0?y*FLT_EPS:y/FLT_EPS; y2 = y<0?y*FLT_EPS:y/FLT_EPS; - z1 = z>0?z*FLT_EPS:z/FLT_EPS; z2 = z<0?z*FLT_EPS:z/FLT_EPS; - bool res = true; - if(x2>CutMin.x && x1CutMin.y && y1CutMin.z && z1Calc(x,y,z)) res = false; - - if(Cut) - { -// if(x1Max.x || y1Max.y || z1Max.z) res = false; - if((x1-Min.x)*(x1-Max.x)>0 && (x2-Min.x)*(x2-Max.x)>0) res = false; - if((y1-Min.y)*(y1-Max.y)>0 && (y2-Min.y)*(y2-Max.y)>0) res = false; - if((z1-Min.z)*(z1-Max.z)>0 && (z2-Min.z)*(z2-Max.z)>0) res = false; - } - else - { - if(x1Max.x) x=Max.x; - if(y1Max.y) y=Max.y; - if(z1Max.z) z=Max.z; - } - - if(fx) x1 = fx->Calc(x,y,z); else x1=x; - if(fy) y1 = fy->Calc(x,y,z); else y1=y; - if(fz) z1 = fz->Calc(x,y,z); else z1=z; - if(isnan(x1) || isnan(y1) || isnan(z1)) return false; - - x = (2*x1 - FMin.x - FMax.x)/(FMax.x - FMin.x); - y = (2*y1 - FMin.y - FMax.y)/(FMax.y - FMin.y); - z = (2*z1 - FMin.z - FMax.z)/(FMax.z - FMin.z); - if((TernAxis&3)==1) // usual ternary axis - { - if(x+y>0) - { - if(Cut) res = false; - else y = -x; - } - x += (y+1)/2; - } - else if((TernAxis&3)==2) // quaternary axis - { - if(x+y+z>-1) - { - if(Cut) res = false; - else z = -1-y-x; - } - x += 1+(y+z)/2; y += (z+1)/3; - } -/* if(TernAxis) - { - if(x+y>0) - { - if(Cut) res = false; - else y = -x; - } - x = x + (y+1)/2; - }*/ - if(fabs(x)>FLT_EPS) res = false; - if(fabs(y)>FLT_EPS) res = false; - if(fabs(z)>FLT_EPS) res = false; - return res; -} -//----------------------------------------------------------------------------- -void mglGraph::Color(mreal a,mreal a1,mreal a2) -{ - mglColor c; - if(a1==a2) { a1 = Cmin; a2 = Cmax; } - mreal z = (2*a-a1-a2)/(a2-a1); - if(z>1) z=1; if(z<-1) z=-1; - c = GetC(z,false); - DefColor(c,AlphaDef); -} -//----------------------------------------------------------------------------- -void mglGraph::SetScheme(const char *s, bool face) -{ - unsigned i; - mglColor c; - const char *col = "kwrgbcymhWRGBCYMHlenpquLENPQU"; - if(!s || s[0]==0 || s[0]==':') return; - if(face && s[0]=='|' && s[1]==0) { SmoothColorbar=false; return; } - for(;*s;s++) if(strchr(col,*s)) break; - if(s[0]==0) return; - strcpy(last_style, s); - NumCol = 0; - for(i=0;i='1' && s[i+1]<='9') - { cmap[NumCol].Set(s[i],(s[i+1]-'0')/5.f); i++; } - else cmap[NumCol].Set(s[i]); - NumCol++; - if(NumCol>=MGL_CMAP_COLOR) break; - } - else - { - mglColor c1(s[i]); - if(c1.r!=-1) - { - cmap[NumCol].Set(s[i]); - NumCol++; - if(NumCol>=MGL_CMAP_COLOR) break; - } - } - } - if(NumCol==0) NumCol = 2; -} -//----------------------------------------------------------------------------- -mglColor mglGraph::GetC(mreal x,mreal y,mreal z,bool simple) -{ - mglColor c,m; - mreal n; - if(OnCoord && !simple && NumCol>2) - { - m = cmap[0]+cmap[1]+cmap[2]; n = m.Norm(); - c = cmap[0]*((x+1)/(2*n)) + cmap[1]*((y+1)/(2*n)) + cmap[2]*((z+1)/(2*n)); - } - else c = GetC(z); - return c; -} -//----------------------------------------------------------------------------- -mreal mglGraph::GetA(mreal a) -{ - mreal Amin=Cmin, Amax=Cmax; - if(fa) - { - Amin = fa->Calc(0,0,0,Cmin); - Amax = fa->Calc(0,0,0,Cmax); - a = fa->Calc(0,0,0,a); - } - a = (2*a-Amin-Amax)/(Amax-Amin); - a = a<1?(a>-1?a:-1):1; - return a; -} -//----------------------------------------------------------------------------- -mglColor mglGraph::GetC(mreal z, bool scale) -{ - mglColor c; - register long n = NumCol-1; - if(scale) z = GetA(z); - z = (z+1.f)/2.f; - if(SmoothColorbar) - { - z *= n; - long i = long(z); z -= i; - if(i1) m = 1/(cmap[0].r+cmap[1].r); - if((cmap[0].g+cmap[1].g)*m>1) m = 1/(cmap[0].g+cmap[1].g); - if((cmap[0].b+cmap[1].b)*m>1) m = 1/(cmap[0].b+cmap[1].b); - c = cmap[0]*(x*m) + cmap[1]*(y*m); - } - else if(NumCol==3) - c = cmap[0]*(x*(1-y)) + cmap[1]*(y*(1-x)) + cmap[2]*(x*y); - else if(NumCol>3) - c = cmap[0]*(1-x-y+x*y) + cmap[1]*(x*(1-y)) + cmap[2]*(y*(1-x)) + cmap[3]*(x*y); - if(c.r>1) c.r=1; if(c.r<0) c.r=0; - if(c.g>1) c.g=1; if(c.g<0) c.g=0; - if(c.b>1) c.b=1; if(c.b<0) c.b=0; - return c; -} -//----------------------------------------------------------------------------- -void mglGraph::CRange(const mglData &a,bool add, mreal fact) -{ - long n = a.nx*a.ny*a.nz; - register long i; - if(!add) { Cmin = 1e20; Cmax = -1e20; } - for(i=0;ia.a[i] ? Cmax : a.a[i]; - } - if(Cmin==Cmax) Cmax += 1; - mreal dc = (Cmax-Cmin)*fact; - Cmax+=dc; Cmin-=dc; -} -//----------------------------------------------------------------------------- -void mglGraph::XRange(const mglData &a,bool add,mreal fact) -{ - long n = a.nx*a.ny*a.nz; - register long i; - if(!add) { Min.x = 1e20; Max.x = -1e20; } - for(i=0;ia.a[i] ? Max.x : a.a[i]; - } - mreal dc = (Max.x-Min.x)*fact; - Max.x+=dc; Min.x-=dc; - if(AutoOrg && Org.xMax.x && !isnan(Org.x)) Org.x = Max.x; - RecalcBorder(); -} -//----------------------------------------------------------------------------- -void mglGraph::YRange(const mglData &a,bool add,mreal fact) -{ - long n = a.nx*a.ny*a.nz; - register long i; - if(!add) { Min.y = 1e20; Max.y = -1e20; } - for(i=0;ia.a[i] ? Max.y : a.a[i]; - } - mreal dc = (Max.y-Min.y)*fact; - Max.y+=dc; Min.y-=dc; - if(AutoOrg && Org.yMax.y && !isnan(Org.y)) Org.y = Max.y; - RecalcBorder(); -} -//----------------------------------------------------------------------------- -void mglGraph::ZRange(const mglData &a,bool add,mreal fact) -{ - long n = a.nx*a.ny*a.nz; - register long i; - if(!add) { Min.z = 1e20; Max.z = -1e20; } - for(i=0;ia.a[i] ? Max.z : a.a[i]; - } - mreal dc = (Max.z-Min.z)*fact; - Max.z+=dc; Min.z-=dc; - if(AutoOrg && Org.zMax.z && !isnan(Org.z)) Org.z = Max.z; - RecalcBorder(); -} -//----------------------------------------------------------------------------- -char mglGraph::SelectPen(const char *p) -{ - mglColor c = NC; - int w=1; - char st='-',mk=0,cc=0; - - Arrow1 = Arrow2 = '-'; - if(p && *p!=0) - { -// strcpy(last_style, p); - const char *col = "wkrgbcymhRGBCYMHWlenuqpLENUQP"; - const char *stl = " -|;:ji="; - const char *mrk = "*o+xsd.^v<>"; - const char *wdh = "123456789"; - const char *arr = "AKDTVISO_"; - for(unsigned i=0;i') mk = 'R'; - if(mk=='*') mk = 'Y'; - } - } - Pen(c, st, BaseLineWidth*w); - last_style[0]=cc?cc:(NumPal?PalNames[(CurrPal+1)%NumPal]:'k'); - last_style[1]=st; last_style[2]=w+'0'; last_style[3]=mk; last_style[4]=0; - return mk; -} -//----------------------------------------------------------------------------- -void mglGraph::SetPal(const char *colors) -{ - if(!colors || !colors[0]) // restore default if only 1 color - { if(NumPal<2) colors = DefPal; else return; } - memset(Pal,0,100*sizeof(mglColor)); - memset(PalNames,0,101*sizeof(char)); - int i,n = strlen(colors),k; - n = n<100? n:100; - for(i=k=0;i') || strchr(st,'g')); - bool l = !(strchr(st,'l') || strchr(st,'L') || strchr(st,'<') || strchr(st,'g')); - bool u = !(strchr(st,'u') || strchr(st,'U') || strchr(st,'_') || strchr(st,'g')); - bool a = !(strchr(st,'a') || strchr(st,'A') || strchr(st,'^') || strchr(st,'g') || strchr(st,'t')); - // let use simplified scheme -- i.e. no differences between axis, colorbar and/or title - register mreal xs=(x1+x2)/2, ys=(y1+y2)/2, f1 = 1.3, f2 = 1.1; - if(r && l) { x2=xs+(x2-xs)*f1; x1=xs+(x1-xs)*f1; } - else if(r) { x2=xs+(x2-xs)*f1; x1=xs+(x1-xs)*f2; } - else if(l) { x2=xs+(x2-xs)*f2; x1=xs+(x1-xs)*f1; } - if(a && u) { y2=ys+(y2-ys)*f1; y1=ys+(y1-ys)*f1; } - else if(a) { y2=ys+(y2-ys)*f1; y1=ys+(y1-ys)*f2; } - else if(u) { y2=ys+(y2-ys)*f2; y1=ys+(y1-ys)*f1; } - InPlot(x1,x2,y1,y2,false); -} -//----------------------------------------------------------------------------- -void mglGraph::Printf(mglPoint p,const char *str,...) -{ - char text[256]; - va_list ap; - if (!str) return; - va_start(ap, str); - vsprintf(text, str, ap); - va_end(ap); - Puts(p,text,FontDef); -} -//----------------------------------------------------------------------------- -mreal GetX(const mglData &x, int i, int j, int k) -{ - k = kj && x.nx>i && x.ny>1) return x.v(i,j,k); - else if(x.nx>i) return x.v(i); - return 0; -} -//----------------------------------------------------------------------------- -mreal GetY(const mglData &y, int i, int j, int k) -{ - k = kj && y.nx>i && y.ny>1) return y.v(i,j,k); - else if(y.nx>j) return y.v(j); - return 0; -} -//----------------------------------------------------------------------------- -mreal GetZ(const mglData &z, int i, int j, int k) -{ - k = kj && z.nx>i && z.ny>1) return z.v(i,j,k); - else if(z.nx>i) return z.v(i); - return 0; -} -//----------------------------------------------------------------------------- -void mglColor::Set(mglColor c, mreal br) -{ - if(br<0) br=0; if(br>2.f) br=2.f; - r= br<=1.f ? c.r*br : 1 - (1-c.r)*(2-br); - g= br<=1.f ? c.g*br : 1 - (1-c.g)*(2-br); - b= br<=1.f ? c.b*br : 1 - (1-c.b)*(2-br); -} -//----------------------------------------------------------------------------- -void mglColor::Set(char p, mreal bright) -{ - Set(-1,-1,-1); - for(long i=0; mglColorIds[i].id; i++) - if(mglColorIds[i].id==p) - { Set(mglColorIds[i].col, bright); break; } -} -//----------------------------------------------------------------------------- -void mglGraph::ball(mreal *p, mreal *c) -{ Ball(p[0],p[1],p[2],mglColor(c[0],c[1],c[2]),c[3]); } -//----------------------------------------------------------------------------- -void mglGraph::ClearEq() -{ - if(fx) delete fx; if(fy) delete fy; if(fz) delete fz; - if(fa) delete fa; if(fc) delete fc; - fx = fy = fz = fc = fa = 0; - RecalcBorder(); -} -//----------------------------------------------------------------------------- -void mglGraph::DefaultPlotParam() -{ - LegendMarks = 1; - FontSize = 5; BaseLineWidth = 1; - Ambient(); Ternary(0); - PlotId = "frame"; SelectPen("k-1"); - SetScheme("BbcyrR"); SetPalette(MGL_DEF_PAL); - SetTicks('x'); SetTicks('y'); SetTicks('z'); SetTicks('c'); - Axis(mglPoint(-1,-1,-1), mglPoint(1,1,1)); - SetFunc(0,0); CutOff(0); - SetWarn(mglWarnNone); Message = 0; - BarWidth = 0.7; fit_res[0] = 0; - MarkSize = 0.02; ArrowSize = 0.03; - AlphaDef = 0.5; Transparent = true; - FontDef[0]=0; AxialDir = 'y'; - UseAlpha = false; TranspType = 0; - RotatedText = true; fnt->gr = this; - CloudFactor = 1; MeshNum = 0; - ClearLegend(); LegendBox = true; - CutMin=mglPoint(0,0,0); CutMax=mglPoint(0,0,0); - AutoOrg = true; //CurFrameId = 0; - CirclePnts=40; FitPnts=100; GridPnts=50; - DrawFace = true; _tetx=_tety=_tetz=0; - TuneTicks= true; _sx=_sy=_sz = 1; - Alpha(false); Fog(0); FactorPos = 1.15; - xtt[0]=ytt[0]=ztt[0]=ctt[0]=0; - AutoPlotFactor = true; ScalePuts = true; - TickLen = 0.1; st_t = 1; Cut = true; - TickStl[0] = SubTStl[0] = '-'; - TickStl[1] = SubTStl[1] = 0; - PlotFactor = AutoPlotFactor ? 1.55f :2.f; - for(int i=0;i<10;i++) - { Light(i, mglPoint(0,0,1)); Light(i,false); } - Light(0,true); Light(false); - InPlot(0,1,0,1,false); Zoom(0,0,1,1); -} -//----------------------------------------------------------------------------- -void mglGraph::SetTickStl(const char *stl, const char *sub) -{ - if(!stl || !(*stl)) - { TickStl[0] = SubTStl[0] = 0; } - else if(strlen(stl)<32) - { - strcpy(TickStl,stl); - if(!sub || !(*sub)) strcpy(SubTStl,stl); - else if(strlen(sub)<32) strcpy(SubTStl,sub); - } -} -//----------------------------------------------------------------------------- -void mglGraph::SetTickLen(mreal tlen, mreal stt) -{ TickLen=fabs(tlen)>0?tlen:0.1; st_t=stt>0?stt:1; } -//----------------------------------------------------------------------------- -void mglGraph::SimplePlot(const mglData &a, int type, const char *stl) -{ - if(a.nx<2) { SetWarn(mglWarnLow); return; } - if(a.ny<2) switch(type) - { - case 1: Area(a,stl); break; - case 2: Step(a,stl); break; - case 3: Stem(a,stl); break; - case 4: Bars(a,stl); break; - default: Plot(a,stl); break; - } - else if(a.nz<2) switch(type) - { - case 1: Dens(a,stl); break; - case 2: Mesh(a,stl); break; - case 3: Cont(a,stl); break; - default: Surf(a,stl); break; - } - else switch(type) - { - case 1: DensA(a,stl); break; - case 2: ContA(a,stl); break; - case 3: Cloud(a,stl); break; - case 4: CloudP(a,stl); break; - default: Surf3(a,stl); break; - } -} -//----------------------------------------------------------------------------- -void mglGraph::Zoom(mreal x1, mreal y1, mreal x2, mreal y2) -{ - if(x1==x2 || y1==y2) { x1=y1=0; x2=y2=1; } - Clf(); - if(x1Width(text,"rL")*size/8.; - del = del>1 ? del:1; - long k=1,i,j; - bool less; - p[0] = mglPoint(pp[0],pp[1],pp[2]); - string_curve(0,n,pp,nn,text,size,pos); - for(i=1;i=25) break; - } -} -//----------------------------------------------------------------------------- -bool same_chain(long f,long i,long *nn) -{ - long j=f; - while(1) - { - j = nn[j]; - if(j==f || j<0) return false; - if(j==i) return true; - } -} -//----------------------------------------------------------------------------- -void mglGraph::string_curve(long f,long n,mreal *pp,long *nn,const wchar_t *text, mreal size, int pos) -{ - wchar_t L[2]=L"a"; - mglPoint p1,n1,p2; - - mreal w, r, ww, wg=fnt->Height("")*size/8.;//*font_factor; - register long i,k,h; - ScalePuts = false; - - h=3*f; k=3*nn[f]; // print string symbol-by-symbol - mglPoint p0(pp[h],pp[h+1],pp[h+2]),n0(pp[k]-pp[h],pp[k+1]-pp[h+1],pp[k+2]-pp[h+2]); - - for(unsigned j=0;j %g\n",L[0], ww); - p1 = p0+(ww/Norm(n0))*n0; - // let find closest point - for(r=1e10,i=0;i=n || !same_chain(f,i,nn)) { p0=p1; continue; } - // if last point let change it to previous one - if(k<0) { k=i; i=h; } - p2 = mglPoint(pp[3*i],pp[3*i+1],pp[3*i+2]); - n1 = mglPoint(pp[3*k],pp[3*k+1],pp[3*k+2])-p2; - w = (p1-p2)*n1; - // go in wrong direction, let turn back - if((w<0 || w>n1*n1) && i!=h) - { - p2 = mglPoint(pp[3*h],pp[3*h+1],pp[3*h+2]); - n1 = mglPoint(pp[3*i],pp[3*i+1],pp[3*i+2])-p2; - k = i; - } - // under maximum and should skip some points - if(n1.x*n0.y>n1.y*n0.x && pos<0) - { - p1 = p0+((ww/Norm(n0))*n0) + ((wg/Norm(n0)/3)*mglPoint(n0.y,-n0.x,n0.z)); - for(r=1e10,i=0;i=n || !same_chain(f,i,nn)) - { p0 = p0+(ww/Norm(n0))*n0; continue; } - if(k<0) { k=i; i=h; } - p2 = mglPoint(pp[3*i],pp[3*i+1],pp[3*i+2]); - n1 = mglPoint(pp[3*k],pp[3*k+1],pp[3*k+2])-p2; - w = (p1-p2)*n1; - if((w<0 || w>n1*n1) && i!=h) - { - p2 = mglPoint(pp[3*h],pp[3*h+1],pp[3*h+2]); - n1 = mglPoint(pp[3*i],pp[3*i+1],pp[3*i+2])-p2; - k = i; - } - } - // above minimum and should skip some points - if(n1.x*n0.y0) - { - p1 = p0+((ww/Norm(n0))*n0) - ((wg/Norm(n0)/3)*mglPoint(n0.y,-n0.x,n0.z)); - for(r=1e10,i=0;i=n || !same_chain(f,i,nn)) - { p0 = p0+(ww/Norm(n0))*n0; continue; } - if(k<0) { k=i; i=h; } - p2 = mglPoint(pp[3*i],pp[3*i+1],pp[3*i+2]); - n1 = mglPoint(pp[3*k],pp[3*k+1],pp[3*k+2])-p2; - w = (p1-p2)*n1; - if((w<0 || w>n1*n1) && i!=h) - { - p2 = mglPoint(pp[3*h],pp[3*h+1],pp[3*h+2]); - n1 = mglPoint(pp[3*i],pp[3*i+1],pp[3*i+2])-p2; - k = i; - } - } - // OK, next point will be - p0 = p2 + n1*(((p1-p2)*n1)/(n1*n1)); - n0 = n1; - } - ScalePuts = true; -} -//----------------------------------------------------------------------------- -// Pure virtual functions below are defined here for compatibility with MinGW -void mglGraph::Pen(mglColor , char ,mreal ){} -void mglGraph::Light(int ,bool ){} -void mglGraph::Light(int , mglPoint , mglColor , mreal , bool, mreal ){} -void mglGraph::Clf(mglColor ){} -void mglGraph::InPlot(mreal ,mreal ,mreal ,mreal ,bool ){} -//----------------------------------------------------------------------------- -// These functions can be pure virtual but it should be empty (do nothing) -// in some of inherit classes so they are defined empty here -void mglGraph::SetSize(int ,int ){} -mreal mglGraph::GetRatio(){return 1.;} -void mglGraph::Flush(){} -void mglGraph::Finish(){} -//----------------------------------------------------------------------------- -void mglGraph::Mark(mglPoint p,char t) -{ ScalePoint(p.x,p.y,p.z); Mark(p.x,p.y,p.z,t); } -//----------------------------------------------------------------------------- -void mglGraph::View(mreal tetx,mreal tetz,mreal tety) -{ _tetx=tetx; _tety=tety; _tetz=tetz; } -void mglGraph::Identity(bool rel) { InPlot(0,1,0,1,rel); } -//----------------------------------------------------------------------------- -void mglGraph::Rotate(mreal TetX,mreal TetZ,mreal TetY) -{ - RotateN(TetX+_tetx,1.,0.,0.); - RotateN(TetY+_tety,0.,1.,0.); - RotateN(TetZ+_tetz,0.,0.,1.); -} -//----------------------------------------------------------------------------- -void mglGraph::Fog(mreal d, mreal dz) { FogDist=d; FogDz = dz; } -//----------------------------------------------------------------------------- -void mglGraph::Light(int n,mglPoint p, char c, mreal bright, bool infty, mreal ap) -{ Light(n,p,mglColor(c),bright,infty,ap); } -//----------------------------------------------------------------------------- -void mglGraph::Ambient(mreal bright) { AmbBr = bright; } -//----------------------------------------------------------------------------- -mglGraph::mglGraph() -{ - memset(this,0,sizeof(mglGraph)); -// xnum=ynum=znum=0; - fit_res = new char[1024]; - fnt = new mglFont; -// DefaultPlotParam(); -} -//----------------------------------------------------------------------------- -mglGraph::~mglGraph() -{ - if(xnum) delete []xbuf; - if(ynum) delete []ybuf; - if(znum) delete []zbuf; - delete []fit_res; - ClearEq(); - ClearLegend(); - delete fnt; -} -//----------------------------------------------------------------------------- -void mglGraph::SetWarn(int code, const char *who) -{ - WarnCode = code; - if(Message && code>0 && codeCopy(f); // set new typeface and delete existed - else fnt->Load(MGL_DEF_FONT_NAME,0); // restore default typeface -} -//----------------------------------------------------------------------------- -void mglGraph::Title(const wchar_t *str,const char *font,mreal size) -{ - Push(); Identity(); - mglFormula *ox=fx, *oy=fy, *oz=fz; - fx = fy = fz = NULL; - Text(mglPoint((Min.x+Max.x)*0.5, Max.y+(Max.y-Min.y)*0.15, (Min.z+Max.z)*0.5), str, font, size); - fx=ox; fy=oy; fz=oz; - Pop(); -} -//----------------------------------------------------------------------------- -void mglGraph::Title(const char *str,const char *font,mreal size) -{ - unsigned s = strlen(str)+1; - wchar_t *wcs = new wchar_t[s]; - mbstowcs(wcs,str,s); - Title(wcs, font, size); - delete []wcs; -} -//----------------------------------------------------------------------------- -void mglGraph::Labelw(mreal x, mreal y, const wchar_t *text, const char *fnt, mreal size, bool rel) -{ - Push(); Identity(rel); - mglFormula *ox=fx, *oy=fy, *oz=fz; - fx = fy = fz = NULL; - char *f = new char[strlen(fnt)+1]; - strcpy(f,fnt); - for(int i=0;f[i];i++) if(f[i]=='a' || f[i]=='A') f[i]=' '; - Text(mglPoint((Min.x+Max.x)/2+PlotFactor*(Max.x-Min.x)*(x-0.5), - (Min.y+Max.y)/2+PlotFactor*(Max.y-Min.y)*(y-0.5), - Max.z), text, f, size); - delete []f; - fx=ox; fy=oy; fz=oz; - Pop(); -} -//----------------------------------------------------------------------------- -void mglGraph::Label(mreal x, mreal y, const char *str, const char *fnt, mreal size, bool rel) -{ - unsigned s = strlen(str)+1; - wchar_t *wcs = new wchar_t[s]; - mbstowcs(wcs,str,s); - Labelw(x,y,wcs, fnt, size, rel); - delete []wcs; -} -//----------------------------------------------------------------------------- -void mglGraph::Label(char dir, const char *str, mreal pos, mreal size, mreal shift) -{ - unsigned s = strlen(str)+1; - wchar_t *wcs = new wchar_t[s]; - mbstowcs(wcs,str,s); - Labelw(dir, wcs, pos, size, shift); - delete []wcs; -} -//----------------------------------------------------------------------------- -void mglGraph::Puts(mglPoint p,const char *str,const char *font,mreal size,char dir,mreal shift) -{ - unsigned s = strlen(str)+1; - wchar_t *wcs = new wchar_t[s]; - mbstowcs(wcs,str,s); - Putsw(p, wcs, font, size, dir, shift); - delete []wcs; -} -//----------------------------------------------------------------------------- -mreal mglGraph::Puts(mglPoint p,mglPoint l,const char *str,char font,mreal size) -{ - unsigned s = strlen(str)+1; - wchar_t *wcs = new wchar_t[s]; - mbstowcs(wcs,str,s); - mreal res = Putsw(p, l, wcs, font, size); - delete []wcs; - return res; -} -//----------------------------------------------------------------------------- -void mglGraph::Text(mglPoint p,const char *text,const char *font,mreal size,char dir) -{ - bool rt = RotatedText; - RotatedText = false; - Puts(p,text,font,size,dir); - RotatedText = rt; -} -//----------------------------------------------------------------------------- -void mglGraph::Text(mglPoint p,const wchar_t *text,const char *font,mreal size,char dir) -{ - bool rt = RotatedText; - RotatedText = false; - Putsw(p,text,font,size,dir); - RotatedText = rt; -} -//----------------------------------------------------------------------------- -void mglGraph::Text(const mglData &y,const char *str,const char *font,mreal size,mreal zVal) -{ - unsigned s = strlen(str)+1; - wchar_t *wcs = new wchar_t[s]; - mbstowcs(wcs,str,s); - Text(y, wcs, font, size, zVal); - delete []wcs; -} -//----------------------------------------------------------------------------- -void mglGraph::Text(const mglData &x,const mglData &y,const char *str,const char *font,mreal size,mreal zVal) -{ - unsigned s = strlen(str)+1; - wchar_t *wcs = new wchar_t[s]; - mbstowcs(wcs,str,s); - Text(x, y, wcs, font, size, zVal); - delete []wcs; -} -//----------------------------------------------------------------------------- -void mglGraph::Text(const mglData &x,const mglData &y,const mglData &z,const char *str,const char *font,mreal size) -{ - unsigned s = strlen(str)+1; - wchar_t *wcs = new wchar_t[s]; - mbstowcs(wcs,str,s); - Text(x, y, z, wcs, font, size); - delete []wcs; -} -//----------------------------------------------------------------------------- -void mglGraph::TextMark(const mglData &x, const mglData &y, const mglData &z, const mglData &r, const char *str, const char *fnt) -{ - unsigned s = strlen(str)+1; - wchar_t *wcs = new wchar_t[s]; - mbstowcs(wcs,str,s); - TextMark(x, y, z, r, wcs, fnt); - delete []wcs; -} -//----------------------------------------------------------------------------- -void mglGraph::TextMark(const mglData &x, const mglData &y, const mglData &r, const char *str, const char *fnt, mreal zVal) -{ - unsigned s = strlen(str)+1; - wchar_t *wcs = new wchar_t[s]; - mbstowcs(wcs,str,s); - TextMark(x, y, r, wcs, fnt, zVal); - delete []wcs; -} -//----------------------------------------------------------------------------- -void mglGraph::TextMark(const mglData &y, const mglData &r, const char *str, const char *fnt, mreal zVal) -{ - unsigned s = strlen(str)+1; - wchar_t *wcs = new wchar_t[s]; - mbstowcs(wcs,str,s); - TextMark(y, r, wcs, fnt, zVal); - delete []wcs; -} -//----------------------------------------------------------------------------- -void mglGraph::TextMark(const mglData &y, const char *str, const char *fnt, mreal zVal) -{ - unsigned s = strlen(str)+1; - wchar_t *wcs = new wchar_t[s]; - mbstowcs(wcs,str,s); - TextMark(y, wcs, fnt, zVal); - delete []wcs; -} -//----------------------------------------------------------------------------- -void mglGraph::AddLegend(const char *str,const char *style) -{ - if(!str) return; - unsigned s = strlen(str)+1; - wchar_t *wcs = new wchar_t[s]; - mbstowcs(wcs,str,s); - AddLegend(wcs, style); - delete []wcs; -} -//----------------------------------------------------------------------------- -void mglGraph::SetFontSizePT(mreal pt, int dpi) -{ FontSize = pt*27.f/dpi; } -//----------------------------------------------------------------------------- -mreal mglGraph::GetOrgX(char) { return isnan(Org.x) ? Min.x : Org.x; } -mreal mglGraph::GetOrgY(char) { return isnan(Org.y) ? Min.y : Org.y; } -mreal mglGraph::GetOrgZ(char) { return isnan(Org.z) ? Min.z : Org.z; } -//----------------------------------------------------------------------------- -void mglGraph::FaceX(mreal x0, mreal y0, mreal z0, mreal wy, mreal wz, const char *stl, mreal d1, mreal d2) -{ - Face(mglPoint(x0,y0,z0), mglPoint(x0,y0+wy,z0), mglPoint(x0,y0,z0+wz), mglPoint(x0,y0+wy+d1,z0+wz+d2), stl, 2); -} -//----------------------------------------------------------------------------- -void mglGraph::FaceY(mreal x0, mreal y0, mreal z0, mreal wx, mreal wz, const char *stl, mreal d1, mreal d2) -{ - Face(mglPoint(x0,y0,z0), mglPoint(x0+wx,y0,z0), mglPoint(x0,y0,z0+wz), mglPoint(x0+wx+d1,y0,z0+wz+d2), stl, 2); -} -//----------------------------------------------------------------------------- -void mglGraph::FaceZ(mreal x0, mreal y0, mreal z0, mreal wx, mreal wy, const char *stl, mreal d1, mreal d2) -{ - Face(mglPoint(x0,y0,z0), mglPoint(x0,y0+wy,z0), mglPoint(x0+wx,y0,z0), mglPoint(x0+wx+d1,y0+wy+d2,z0), stl, 2); -} -//----------------------------------------------------------------------------- -void mglGraph::ShowImage(const char *viewer, bool keep) -{ - char fname[128], *cmd = new char [128]; - sprintf(fname,"%s.png", tmpnam(NULL)); - WritePNG(fname,"MathGL ShowImage file",false); - if(!viewer || !viewer[0]) - viewer = MGL_DEF_VIEWER; - if(keep) - { - sprintf(cmd,"%s %s &", viewer,fname); - if(system(cmd)==-1) printf("Error to call external viewer\n"); -#ifdef WIN32 -// sleep(2); - sprintf(cmd,"del %s", fname); - } - else - sprintf(cmd,"%s %s; del %s", viewer,fname,fname); -#else - sleep(2); - sprintf(cmd,"rm %s", fname); - } - else - sprintf(cmd,"%s %s; rm %s", viewer,fname,fname); -#endif - if(system(cmd)==-1) printf("Error to call external viewer\n"); - delete []cmd; -} -//----------------------------------------------------------------------------- -void mglGraph::StartGroup(const char *name, int id) -{ - char buf[128]; - sprintf(buf,"%s_%d",name,id); - StartAutoGroup(buf); -} -//----------------------------------------------------------------------------- -void mglGraph::SetAutoRanges(mreal x1, mreal x2, mreal y1, mreal y2, mreal z1, mreal z2) -{ - if(x1!=x2) { Min.x = x1; Max.x = x2; } - if(y1!=y2) { Min.y = y1; Max.y = y2; } - if(z1!=z2) { Min.z = z1; Max.z = z2; } -} -//----------------------------------------------------------------------------- -void mglGraph::Colorbar(const char *sch,int where) -{ - SetScheme(sch); - // ‘0’ - right, ‘1’ - left, ‘2’ - above, ‘3’ - under - if(sch && strchr(sch,'>')) where = 0; - if(sch && strchr(sch,'<')) where = 1; - if(sch && strchr(sch,'^')) where = 2; - if(sch && strchr(sch,'_')) where = 3; - if(sch && strchr(sch,'A')) { Push(); Identity(); } - Colorbar(where, where==0?1:0, where==2?1:0, 1, 1); - if(sch && strchr(sch,'A')) Pop(); -} -//----------------------------------------------------------------------------- -void mglGraph::Colorbar(const mglData &v, const char *sch,int where) -{ - if(sch && strchr(sch,'>')) where = 0; - if(sch && strchr(sch,'<')) where = 1; - if(sch && strchr(sch,'^')) where = 2; - if(sch && strchr(sch,'_')) where = 3; - if(sch && strchr(sch,'A')) { Push(); Identity(); } - Colorbar(v,sch,where, where==0?1:0, where==2?1:0, 1, 1); - if(sch && strchr(sch,'A')) Pop(); -} -//----------------------------------------------------------------------------- -void mglGraph::Colorbar(int where, mreal x, mreal y, mreal w, mreal h) -{ - float d = fabs(Cmax-Cmin); - d = floor(d*pow(10,-floor(log10(d)))); - long n = 50*(d<4?int(2*d+0.5):int(d+0.5))+1; - if(d==1.f) n = 101; - mglData v(n); - if(dc) v.Fill(Cmin,Cmax); - else if(Cmax>Cmin && Cmin>0) - { v.Fill(log(Cmin), log(Cmax)); v.Modify("exp(u)"); } - else if(Cmin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "mgl/mgl_eval.h" -#include "mgl/mgl_data.h" -#include "mgl/mgl.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -#include -#define dual std::complex -#define GAMMA 0.1 -#ifndef NO_GSL -#include -#endif -//----------------------------------------------------------------------------- -// Solve equation du/dz = ham(p,q,x,y,z,|u|)[u] where p=d/dx, q=d/dy. At this moment simplified form of ham is supported: ham = f(p,q,z) + g(x,y,z,'u'), where variable 'u'=|u| (for allowing solve nonlinear problems). You may specify imaginary part like ham = p^2 + i*x*(x>0) but only if dependence on variable 'i' is linear (i.e. ham = hre+i*him). -mglData mglPDE(const char *ham, const mglData &ini_re, const mglData &ini_im, mglPoint Min, mglPoint Max, mreal dz, mreal k0) -{ - mglData res; - int nx=ini_re.nx, ny=ini_re.ny; - int nz = int((Max.z-Min.z)/dz)+1; - if(nx<2 || nz<2 || Max.x==Min.x) return res; // Too small data - if(ini_im.nx*ini_im.ny != nx*ny) return res; // Wrong dimensions - res.Create(nz, nx, ny); -#ifndef NO_GSL - mglFormula eqs(ham); - dual *a = new dual[4*nx*ny], h, h0, h1, h2; // Add "damping" area - mreal *dmp = new mreal[4*nx*ny]; - memset(a,0,4*nx*ny*sizeof(dual)); - memset(dmp,0,4*nx*ny*sizeof(mreal)); - register int i,j,k,i0; - for(j=0;j3*nx/2) dmp[i0] = GAMMA*mgl_ipow((i-3*nx/2-1)/(nx/2.),2); - if(j3*ny/2) dmp[i0]+= GAMMA*mgl_ipow((j-3*ny/2-1)/(ny/2.),2); - } - mreal dx = (Max.x-Min.x)/(nx-1), dy = ny>1?(Max.y-Min.y)/(ny-1):0; - mreal dp = M_PI/(Max.x-Min.x)/k0, dq = M_PI/(Max.y-Min.y)/k0; - mreal var[MGL_VS], xs=(Min.x+Max.x)/2, ys=(Min.y+Max.y)/2; - double xx = Min.x - dx*nx/2, yy = Min.x - dy*ny/2; - double ff = ny>1?4*nx*ny:2*nx, dd = k0*dz; - memset(var,0,MGL_VS*sizeof(mreal)); - // prepare fft. NOTE: slow procedures due to unknown nx, ny. - gsl_fft_complex_wavetable *wtx = gsl_fft_complex_wavetable_alloc(2*nx); - gsl_fft_complex_workspace *wsx = gsl_fft_complex_workspace_alloc(2*nx); - gsl_fft_complex_wavetable *wty = gsl_fft_complex_wavetable_alloc(2*ny); - gsl_fft_complex_workspace *wsy = gsl_fft_complex_workspace_alloc(2*ny); - for(k=1;k1) for(j=0;j<2*ny;j++) for(i=0;i<2*nx;i++) // step 3/2 - { - i0 = i+2*nx*j; - var['x'-'a'] = xs; var['p'-'a'] = 0; - var['y'-'a'] = yy+dy*j; var['q'-'a'] = 0; - h1 = dual(-eqs.CalcD(var,'i'), eqs.Calc(var))*dd; - var['x'-'a'] = xs; var['p'-'a'] = dp*(i1) for(i=0;i<2*nx;i++) - gsl_fft_complex_transform((double *)(a+i), 2*nx, 2*ny, wty, wsy, forward); - for(j=0;j<2*ny;j++) for(i=0;i<2*nx;i++) // step 2 - { - i0 = i+2*nx*j; - var['x'-'a'] = xs; var['p'-'a'] = dp*(i1) for(i=0;i<2*nx;i++) - gsl_fft_complex_transform((double *)(a+i), 2*nx, 2*ny, wty, wsy, backward); - if(ny>1) for(j=0;j<2*ny;j++) for(i=0;i<2*nx;i++) // step 3/2 - { - i0 = i+2*nx*j; - var['x'-'a'] = xx+dx*i; var['p'-'a'] = 0; - var['y'-'a'] = ys; var['q'-'a'] = 0; - h1 = dual(-eqs.CalcD(var,'i'), eqs.Calc(var))*dd; - var['x'-'a'] = xs; var['p'-'a'] = 0; - var['y'-'a'] = ys; var['q'-'a'] = dq*(jH(cy,k1); - var['t'-'a']=k*dt; for(i=0;i<6;i++) var[v[i]-'a'] = x[i]; - k1[0] = eqs.CalcD(var,'p'); k1[3] = -eqs.CalcD(var,'x'); - k1[1] = eqs.CalcD(var,'q'); k1[4] = -eqs.CalcD(var,'y'); - k1[2] = eqs.CalcD(var,'v'); k1[5] = -eqs.CalcD(var,'z'); - // ty = cy/(k1*hh); md->H(ty,k2); - var['t'-'a']=k*dt+hh; for(i=0;i<6;i++) var[v[i]-'a'] = x[i]+k1[i]*hh; - 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'); - // ty = cy/(k2*hh); md->H(ty,k3); - var['t'-'a']=k*dt+hh; for(i=0;i<6;i++) var[v[i]-'a'] = x[i]+k2[i]*hh; - k3[0] = eqs.CalcD(var,'p'); k3[3] = -eqs.CalcD(var,'x'); - k3[1] = eqs.CalcD(var,'q'); k3[4] = -eqs.CalcD(var,'y'); - 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]; } - 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'); - // cy /= (k1+k2+k3*2.)*(h/6); - for(i=0;i<6;i++) - res.a[i+7*k] = x[i] += (k1[i]+k2[i]+2*k3[i])*dt/6; - res.a[6+7*k] = dt*k; - } -#endif - return res; -} -//----------------------------------------------------------------------------- -struct mgl_ap -{ - double x0,y0,x1,y1; // vectors {l, g1, g2} - double t1,ch,q1,pt,dt,d1; // theta_{1,2}, chi, q_{1,2}, p_t, dtau, dq_{1,2} - mgl_ap() { memset(this,0,sizeof(mgl_ap)); }; -}; -//----------------------------------------------------------------------------- -void mgl_init_ra(int n, const mreal *r, mgl_ap *ra) // prepare some intermediate data for mglPDE2d -{ - register double tt; - tt = hypot(r[7]-r[0], r[8]-r[1]); - ra[0].x1 = (r[8]-r[1])/tt; - ra[0].y1 = (r[0]-r[7])/tt; - register long i; - for(i=1;iCreate(nx,nt); yy->Create(nx,nt); } - // start calculation - for(int k=0;ka[i+k*nx] = ray.a[7*k] + ra[k].x1*x1; // new coordiantes - yy->a[i+k*nx] = ray.a[7*k+1] + ra[k].y1*x1; - } - memcpy(px,rx,2*nx*sizeof(double)); - memcpy(pu,ru,2*nx*sizeof(double)); - hh = ra[k].pt*(1/sqrt(sqrt(1.041))-1); // 0.041=0.45^4 -- minimal value of h - var['x'-'a'] = ray.a[7*k]; var['y'-'a'] = ray.a[7*k+1]; - var['p'-'a'] = ray.a[7*k+3] + ra[k].x0*hh; - var['q'-'a'] = ray.a[7*k+4] + ra[k].y0*hh; var['u'-'a'] = 0; - pt0 = (h.CalcD(var,'p')*ra[k].x0 + h.CalcD(var,'q')*ra[k].y0)/ra[k].ch; - for(i=0;i<2*nx;i++) // prepare hamiltonian - { - hh = ra[k].pt*(1/sqrt(sqrt(1.041))-1); - var['x'-'a'] = ray.a[7*k]; var['y'-'a'] = ray.a[7*k+1]; - var['p'-'a'] = ray.a[7*k+3] + ra[k].x0*hh; - var['q'-'a'] = ray.a[7*k+4] + ra[k].y0*hh; var['u'-'a'] = 0; - h0 = dual(h.Calc(var), -h.CalcD(var,'i')); - // x terms - x1 = (2*i-2*nx+1)*dr; - var['x'-'a'] = ray.a[7*k] + ra[k].x1*x1; // new coordiantes - var['y'-'a'] = ray.a[7*k+1] + ra[k].y1*x1; - hh = 1 - ra[k].t1*x1; hh = sqrt(sqrt(0.041+hh*hh*hh*hh)); - tt = (ra[k].pt + ra[k].d1*x1)/hh - ra[k].pt; - var['p'-'a'] = ray.a[7*k+3] + ra[k].x0*tt; // new momentums - var['q'-'a'] = ray.a[7*k+4] + ra[k].y0*tt; var['u'-'a'] = abs(a[i]); - rx[i] = (h.CalcD(var,'p')*ra[k].x0 + h.CalcD(var,'q')*ra[k].y0)/ra[k].ch; - rx[i] = rx[i]>0.3*pt0 ? rx[i] : 0.3*pt0; - hx[i] = (dual(h.Calc(var), -h.CalcD(var,'i'))-h0/2.)/rx[i]; - if(imag(hx[i])>0) hx[i] = hx[i].real(); - // u-y terms - x1 = dk/2*(i0.3*pt0 ? ru[i] : 0.3*pt0; - hu[i] = (dual(h.Calc(var), -h.CalcD(var,'i'))-h0/2.)/ru[i]; - if(imag(hu[i])>0) hu[i] = hu[i].real(); - // add boundary conditions for x-direction - if(i=3*nx/2) - { - x1 = (i-3*nx/2-1)/(nx/2.); - hx[i] -= dual(0,30*GAMMA*x1*x1/k0); - } - } - // Calculate B1 - hh = ra[k].pt*(1/sqrt(sqrt(1.041))-1); - var['x'-'a'] = ray.a[7*k]; // new coordiantes - var['y'-'a'] = ray.a[7*k+1]; - var['p'-'a'] = ray.a[7*k+3] + ra[k].x0*hh; // new momentums - var['q'-'a'] = ray.a[7*k+4] + ra[k].y0*hh; - tt = h.CalcD(var,'p')*ra[k].x1 + h.CalcD(var,'q')*ra[k].y1; - var['x'-'a'] = ray.a[7*k] + ra[k].x1*dr; // new coordiantes - var['y'-'a'] = ray.a[7*k+1] + ra[k].y1*dr; - hh = 1 - ra[k].t1*dr; hh = sqrt(sqrt(0.041+hh*hh*hh*hh)); - hh = (ra[k].ch*ra[k].pt + ra[k].d1*dr)/(hh*ra[k].ch) - ra[k].pt; - var['p'-'a'] = ray.a[7*k+3] + ra[k].x0*hh; // new momentums - var['q'-'a'] = ray.a[7*k+4] + ra[k].y0*hh; - B1 = h.CalcD(var,'p')*ra[k].x1 + h.CalcD(var,'q')*ra[k].y1; - B1 = (B1-tt)/dr; - // Step for field - dual dt = dual(0, -ra[k].dt*k0); - for(i=0;i<2*nx;i++) - a[i] *= exp(hx[i]*dt)*((UseR && k>0)?sqrt(px[i]/rx[i]):1.); - gsl_fft_complex_transform((double *)a, 1, 2*nx, wtx, wsx, forward); - for(i=0;i<2*nx;i++) - a[i] *= exp(hu[i]*dt)*((UseR && k>0)?sqrt(pu[i]/ru[i]):1.)/(2.*nx); - gsl_fft_complex_transform((double *)a, 1, 2*nx, wtx, wsx, backward); - double a1=0, a2=0; - for(i=0;i<2*nx;i++) a1 += norm(a[i]); - hx[0] = hx[2*nx-1] = 0.; - for(i=1;i<2*nx-1;i++) hx[i] = (B1*ra[k].dt*(i-nx))*(a[i+1]-a[i-1]); - for(i=0;i<2*nx;i++) { a[i] += hx[i]; a2 += norm(a[i]); } - a1 = sqrt(a1/a2); - for(i=0;i<2*nx;i++) a[i] *= a1; - } - gsl_fft_complex_workspace_free(wsx); - gsl_fft_complex_wavetable_free(wtx); - delete []a; delete []hu; delete []hx; delete []ra; - delete []rx; delete []ru; delete []px; delete []pu; -#endif - return res; -} -//----------------------------------------------------------------------------- -mglData mglAF2d(const char *ham, const mglData &ini_re, const mglData &ini_im, const mglData &ray, mreal r, mreal k0, mglData *xx, mglData *yy, bool UseR) -{ - mglData res; - int nx=ini_re.nx, nt=ray.ny; - if(nx<2 || ini_im.nx!=nx || nt<2) return res; - res.Create(nx,nt); -#ifndef NO_GSL - dual *a=new dual[2*nx], *hu=new dual[2*nx], *hx=new dual[2*nx]; - mgl_ap *ra = new mgl_ap[nt]; mgl_init_ra(ray.ny, ray.a, ra); // ray - register int i; - for(i=0;iCreate(nx,nt); yy->Create(nx,nt); } - // start calculation - for(int k=0;ka[i+k*nx] = ray.a[7*k] + ra[k].x1*x1; // new coordiantes - yy->a[i+k*nx] = ray.a[7*k+1] + ra[k].y1*x1; - } - var['x'-'a'] = ray.a[7*k]; var['y'-'a'] = ray.a[7*k+1]; - var['p'-'a'] = ray.a[7*k+3];var['q'-'a'] = ray.a[7*k+4]; - var['u'-'a'] = 0; - double p01 = h.CalcD(var,'p'), p02 = h.CalcD(var,'q'), - h0 = h.Calc(var), g0 = h.CalcD(var,'i'), hpp, hxx; - // derivative along momentum - var['p'-'a'] = ray.a[7*k+3] + ra[k].x1*dk; // new momentums - var['q'-'a'] = ray.a[7*k+4] + ra[k].y1*dk; - hpp = ((h.CalcD(var,'p')-p01)*ra[k].x1 + (h.CalcD(var,'q')-p02)*ra[k].y1)/dk; - // derivative along coordinates - var['x'-'a'] = ray.a[7*k] + ra[k].x1*dr; // new coordiantes - var['y'-'a'] = ray.a[7*k+1] + ra[k].y1*dr; - hh = 1 - ra[k].t1*dr; tt = (ra[k].pt + ra[k].d1*dr)/hh - ra[k].pt; - var['p'-'a'] = ray.a[7*k+3] + ra[k].x0*tt; // new momentums - var['q'-'a'] = ray.a[7*k+4] + ra[k].y0*tt; - B1 = ((h.CalcD(var,'p')-p01)*ra[k].x1 + (h.CalcD(var,'q')-p02)*ra[k].y1)/dr; - hxx = h.Calc(var)*hh; - var['x'-'a'] = ray.a[7*k] - ra[k].x1*dr; // new coordiantes - var['y'-'a'] = ray.a[7*k+1] - ra[k].y1*dr; - hh = 1 + ra[k].t1*dr; tt = (ra[k].pt - ra[k].d1*dr)/hh - ra[k].pt; - var['p'-'a'] = ray.a[7*k+3] + ra[k].x0*tt; // new momentums - var['q'-'a'] = ray.a[7*k+4] + ra[k].y0*tt; - hxx = (hxx+h.Calc(var)*hh-2*h0)/(dr*dr); - - for(i=0;i<2*nx;i++) // prepare hamiltonian - { - // x terms - x1 = 2*(i-nx)*dr; hx[i] = dual(hxx*x1*x1/2, -g0); - // u-y terms - x1 = dk/2*(i=3*nx/2) - { - x1 = (i-3*nx/2-1)/(nx/2.); - hx[i] -= dual(0,30*GAMMA*x1*x1/k0); - } - } - // Step for field - dual dt = dual(0, -ra[k].dt*k0); - for(i=0;i<2*nx;i++) - a[i] *= exp(hx[i]*dt)/(2.*nx); - gsl_fft_complex_transform((double *)a, 1, 2*nx, wtx, wsx, forward); - for(i=0;i<2*nx;i++) - a[i] *= exp((hu[i]-hu[0])*dt); - gsl_fft_complex_transform((double *)a, 1, 2*nx, wtx, wsx, backward); - double a1=0, a2=0; - for(i=0;i<2*nx;i++) a1 += norm(a[i]); - hx[0] = hx[2*nx-1] = 0.; - for(i=1;i<2*nx-1;i++) hx[i] = (B1*ra[k].dt*(i-nx))*(a[i+1]-a[i-1]); - for(i=0;i<2*nx;i++) { a[i] += hx[i]; a2 += norm(a[i]); } - a1 = sqrt(a1/a2); - for(i=0;i<2*nx;i++) a[i] *= a1; - } - gsl_fft_complex_workspace_free(wsx); - gsl_fft_complex_wavetable_free(wtx); - delete []a; delete []hu; delete []hx; delete []ra; -#endif - return res; -} -//----------------------------------------------------------------------------- -mglData mglJacobian(const mglData &x, const mglData &y) -{ - int nx = x.nx, ny=x.ny; - mglData r; - if(nx!=y.nx || ny!=y.ny || nx<2 || ny<2) return r; - r.Create(nx,ny); - register int i,j,i0,ip,im,jp,jm; - for(i=0;i0 ? -1:0; jm = j>0 ? -nx:0; - r.a[i0] = (x.a[i0+ip]-x.a[i0+im])*(y.a[i0+jp]-y.a[i0+jm]) - - (y.a[i0+ip]-y.a[i0+im])*(x.a[i0+jp]-x.a[i0+jm]); - r.a[i0] *= mreal((nx-1)*(ny-1)*nx) / ((ip-im)*(jp-jm)); - } - return r; -} -//----------------------------------------------------------------------------- -mglData mglJacobian(const mglData &x, const mglData &y, const mglData &z) -{ - int nx = x.nx, ny=x.ny, nz=x.nz; - mglData r; - if(nx*ny*nz!=y.nx*y.ny*y.nz || nx*ny*nz!=z.nx*z.ny*z.nz) return r; - if(nx<2 || ny<2 || nz<2) return r; - r.Create(nx,ny,nz); - register int i,j,k,i0,ip,im,jp,jm,kp,km; - for(i=0;i0 ? -1:0; jm = j>0 ? -nx:0; km = k>0 ? -nx*ny:0; - r.a[i0] = (x.a[i0+ip]-x.a[i0+im])*(y.a[i0+jp]-y.a[i0+jm])*(z.a[i0+kp]-z.a[i0+km]) - - (x.a[i0+ip]-x.a[i0+im])*(y.a[i0+kp]-y.a[i0+km])*(z.a[i0+jp]-z.a[i0+jm]) - - (x.a[i0+jp]-x.a[i0+jm])*(y.a[i0+ip]-y.a[i0+im])*(z.a[i0+kp]-z.a[i0+km]) + - (x.a[i0+jp]-x.a[i0+jm])*(y.a[i0+kp]-y.a[i0+km])*(z.a[i0+ip]-z.a[i0+im]) + - (x.a[i0+kp]-x.a[i0+km])*(y.a[i0+ip]-y.a[i0+im])*(z.a[i0+jp]-z.a[i0+jm]) - - (x.a[i0+kp]-x.a[i0+km])*(y.a[i0+jp]-y.a[i0+jm])*(z.a[i0+ip]-z.a[i0+im]); - r.a[i0] *= mreal((nx-1)*(ny-1)*(nz-1))*mreal(nx*nx*ny) / ((ip-im)*(jp-jm)*(kp-km)); - } - return r; -} -//----------------------------------------------------------------------------- -HMDT mgl_pde_solve(HMGL gr, const char *ham, const HMDT ini_re, const HMDT ini_im, mreal dz, mreal k0) -{ return new mglData(mglPDE(ham, *ini_re, *ini_im, gr->Min, gr->Max, dz,k0)); } -HMDT mgl_ray_trace(const char *ham, mreal x0, mreal y0, mreal z0, mreal px, mreal py, mreal pz, mreal dt, mreal tmax) -{ return new mglData(mglRay(ham, mglPoint(x0,y0,z0), mglPoint(px,py,pz), dt,tmax)); } -HMDT mgl_qo2d_solve(const char *ham, const HMDT ini_re, const HMDT ini_im, const HMDT ray, mreal r, mreal k0, HMDT xx, HMDT yy) -{ return new mglData(mglQO2d(ham, *ini_re, *ini_im, *ray, r, k0, xx, yy)); } -HMDT mgl_af2d_solve(const char *ham, const HMDT ini_re, const HMDT ini_im, const HMDT ray, mreal r, mreal k0, HMDT xx, HMDT yy) -{ return new mglData(mglAF2d(ham, *ini_re, *ini_im, *ray, r, k0, xx, yy)); } -HMDT mgl_jacobian_2d(const HMDT x, const HMDT y) -{ return new mglData(mglJacobian(*x, *y)); } -HMDT mgl_jacobian_3d(const HMDT x, const HMDT y, const HMDT z) -{ return new mglData(mglJacobian(*x, *y, *z)); } -//----------------------------------------------------------------------------- -uintptr_t mgl_pde_solve_(uintptr_t* gr, const char *ham, uintptr_t* ini_re, uintptr_t* ini_im, mreal *dz, mreal *k0, int l) -{ - char *s=new char[l+1]; memcpy(s,ham,l); s[l]=0; - uintptr_t res = uintptr_t(new mglData(mglPDE(s, _D_(ini_re), _D_(ini_im), _GR_->Min, _GR_->Max, *dz, *k0))); - delete []s; return res; -} -uintptr_t mgl_ray_trace_(const char *ham, mreal *x0, mreal *y0, mreal *z0, mreal *px, mreal *py, mreal *pz, mreal *dt, mreal *tmax,int l) -{ - char *s=new char[l+1]; memcpy(s,ham,l); s[l]=0; - uintptr_t res = uintptr_t(new mglData(mglRay(s, mglPoint(*x0,*y0,*z0), mglPoint(*px,*py,*pz), *dt,*tmax))); - delete []s; return res; -} -uintptr_t mgl_qo2d_solve_(const char *ham, uintptr_t* ini_re, uintptr_t* ini_im, uintptr_t* ray, mreal *r, mreal *k0, uintptr_t* xx, uintptr_t* yy, int l) -{ - char *s=new char[l+1]; memcpy(s,ham,l); s[l]=0; - uintptr_t res = uintptr_t(new mglData(mglQO2d(s, _D_(ini_re), _D_(ini_im), _D_(ray), *r, *k0, ((mglData *)*xx), ((mglData *)*yy)))); - delete []s; return res; -} -uintptr_t mgl_af2d_solve_(const char *ham, uintptr_t* ini_re, uintptr_t* ini_im, uintptr_t* ray, mreal *r, mreal *k0, uintptr_t* xx, uintptr_t* yy, int l) -{ - char *s=new char[l+1]; memcpy(s,ham,l); s[l]=0; - uintptr_t res = uintptr_t(new mglData(mglAF2d(s, _D_(ini_re), _D_(ini_im), _D_(ray), *r, *k0, ((mglData *)*xx), ((mglData *)*yy)))); - delete []s; return res; -} -uintptr_t mgl_jacobian_2d_(uintptr_t* x, uintptr_t* y) -{ return uintptr_t(new mglData(mglJacobian(_D_(x), _D_(y)))); } -uintptr_t mgl_jacobian_3d_(uintptr_t* x, uintptr_t* y, uintptr_t* z) -{ return uintptr_t(new mglData(mglJacobian(_D_(x), _D_(y), _D_(z)))); } -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_vect.cpp b/mgl/mgl_vect.cpp deleted file mode 100644 index 7e4a2a8..0000000 --- a/mgl/mgl_vect.cpp +++ /dev/null @@ -1,666 +0,0 @@ -/*************************************************************************** - * mgl_vect.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "mgl/mgl.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -//----------------------------------------------------------------------------- -// -// Vect series -// -//----------------------------------------------------------------------------- -void mglGraph::Traj(const mglData &x, const mglData &y, const mglData &z, - const mglData &ax, const mglData &ay, const mglData &az, - const char *sch, mreal len) -{ - if(ax.nx<2) { SetWarn(mglWarnLow,"Traj"); return; } - if(ax.nx!=x.nx || z.nx!=x.nx || y.nx!=x.nx || ay.nx!=x.nx || az.nx!=x.nx) - { SetWarn(mglWarnDim,"Traj"); return; } - long n = ax.nx, m, i, j, nc=0; - mglColor cm; - // find maximum - i = ax.ny>ay.ny ? ax.ny:ay.ny; j = z.ny>az.ny ? z.ny:az.ny; - m = x.ny>y.ny ? x.ny:y.ny; if(i>m) m=i; if(j>m) m=j; - cm = cmap[0]; nc=NumCol; NumCol=1; - SetPal(sch); - mreal *pp=new mreal[6*n*m], *cc=new mreal[n*m]; - bool *tt=new bool[2*n*m]; - Pen(NC,'-',BaseLineWidth); -// char st[2]={0,0}; // temporary color scheme - static int cgid=1; StartGroup("Traj",cgid++); - mreal dx,dy,dz,dd,da,xm=0; - register long ix,iy,iz,jx,jy,jz; - for(j=0;jda ? xm : da; - } - xm = 1./(xm ? sqrt(xm):1); - for(j=0;j1) { tx=(n-1)/(MeshNum-1); ty=(m-1)/(MeshNum-1); } - if(tx<1) tx=1; if(ty<1) ty=1; - long nn=n/tx, mm=m/ty; - mreal xm,ym,dx,dy,*pp=new mreal[6*nn*mm],*cc=new mreal[nn*mm]; - mreal dd,dm=(fabs(Cmax)+fabs(Cmin))*1e-5; - bool *tt=new bool[2*nn*mm]; - - for(i=0,xm=0;iym ? xm : ym; - } - xm = 1./(xm==0 ? 1:sqrt(xm)); - long s = both ? n : 1, ni,nj; - - for(k=0;k1) zVal = Min.z+(Max.z-Min.z)*mreal(k)/(ax.nz-1); - for(ni=0;nik ? jj : i+n*j; iy = y.nz>k ? jj : i+n*j; } - else - { ix = x.ny>k ? i+n*k : i; iy = y.ny>k ? j+m*k : j; } - dx = idm ? ax.a[jj]/dd : 0) : ax.a[jj]*xm; - dy *= (flag&MGL_VEC_LEN) ? (dd>dm ? ay.a[jj]/dd : 0) : ay.a[jj]*xm; - if(flag & MGL_VEC_END) - { - pp[6*i0+0] = x.a[ix]-dx; pp[6*i0+3] = x.a[ix]; - pp[6*i0+1] = y.a[iy]-dy; pp[6*i0+4] = y.a[iy]; - } - else if(flag & MGL_VEC_MID) - { - pp[6*i0+0] = x.a[ix]-dx/2; pp[6*i0+3] = x.a[ix]+dx/2; - pp[6*i0+1] = y.a[iy]-dy/2; pp[6*i0+4] = y.a[iy]+dy/2; - } - else - { - pp[6*i0+0] = x.a[ix]; pp[6*i0+3] = x.a[ix]+dx; - pp[6*i0+1] = y.a[iy]; pp[6*i0+4] = y.a[iy]+dy; - } - tt[2*i0] = ScalePoint(pp[6*i0],pp[6*i0+1],pp[6*i0+2]); - tt[2*i0+1]= ScalePoint(pp[6*i0+3],pp[6*i0+4],pp[6*i0+5]); - } - if(flag & MGL_VEC_DOT) - lines_plot(nn*mm,pp,(flag&MGL_VEC_COL)?0:cc,tt,true,flag&MGL_VEC_GRD); - else - vects_plot(nn*mm,pp,(flag&MGL_VEC_COL)?0:cc,tt,flag&MGL_VEC_GRD); - } - EndGroup(); - delete []pp; delete []tt; delete []cc; -} -//----------------------------------------------------------------------------- -void mglGraph::Vect(const mglData &ax, const mglData &ay, const char *sch, mreal zVal, int flag) -{ - if(ax.nx<2 || ax.ny<2) { SetWarn(mglWarnLow,"Vect"); return; } - mglData x(ax.nx), y(ax.ny); - x.Fill(Min.x,Max.x); - y.Fill(Min.y,Max.y); - Vect(x,y,ax,ay,sch,zVal,flag); -} -//----------------------------------------------------------------------------- -// -// VectL series -// -//----------------------------------------------------------------------------- -void mglGraph::VectL(const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch, mreal zVal) -{ Vect(x,y,ax,ay,sch,zVal,MGL_VEC_COL|MGL_VEC_DOT|MGL_VEC_GRD); } -//----------------------------------------------------------------------------- -void mglGraph::VectL(const mglData &ax, const mglData &ay, const char *sch, mreal zVal) -{ - if(ax.nx<2 || ax.ny<2) { SetWarn(mglWarnLow,"Vect"); return; } - mglData x(ax.nx), y(ax.ny); - x.Fill(Min.x,Max.x); - y.Fill(Min.y,Max.y); - VectL(x,y,ax,ay,sch,zVal); -} -//----------------------------------------------------------------------------- -// -// VectC series -// -//----------------------------------------------------------------------------- -void mglGraph::VectC(const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, const char *sch, mreal zVal) -{ Vect(x,y,ax,ay,sch,zVal,MGL_VEC_LEN|MGL_VEC_DOT|MGL_VEC_GRD); } -//----------------------------------------------------------------------------- -void mglGraph::VectC(const mglData &ax, const mglData &ay, const char *sch, mreal zVal) -{ - if(ax.nx<2 || ax.ny<2) { SetWarn(mglWarnLow,"Vect"); return; } - mglData x(ax.nx), y(ax.ny); - x.Fill(Min.x,Max.x); - y.Fill(Min.y,Max.y); - VectC(x,y,ax,ay,sch,zVal); -} -//----------------------------------------------------------------------------- -// -// Vect3 series -// -//----------------------------------------------------------------------------- -void mglGraph::Vect(const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch, int flag) -{ - register long i,j,n=ax.nx,m=ax.ny,l=ax.nz,k,jj,i0; - if(n*m*l!=ay.nx*ay.ny*ay.nz || ax.nx*ax.ny*ax.nz!=az.nx*az.ny*az.nz) - { SetWarn(mglWarnDim,"Vect"); return; } - if(n<2 || m<2 || l<2) { SetWarn(mglWarnLow,"Vect"); return; } - bool both = x.nx*x.ny*x.nz==n*m*l && y.nx*y.ny*y.nz==n*m*l && z.nx*z.ny*z.nz==n*m*l; - if(!(both || (x.nx==n && y.nx==m && z.nx==l))) - { SetWarn(mglWarnDim,"Vect"); return; } - static int cgid=1; StartGroup("Vect3",cgid++); - - long ix,iy,iz; - mreal xm,ym,dx,dy,dz,dd,dm=(fabs(Cmax)+fabs(Cmin))*1e-5; - SetScheme(sch); - Pen(cmap[0],'-',BaseLineWidth); - long tx=1,ty=1,tz=1; - if(MeshNum>1) - { tx=(n-1)/(MeshNum-1); ty=(m-1)/(MeshNum-1); tz=(l-1)/(MeshNum-1);} - if(tx<1) tx=1; if(ty<1) ty=1; if(tz<1) tz=1; - long nn=n/tx, mm=m/ty, ll=l/tz; - - for(i=0,xm=0;iym ? xm : ym; - } - xm = 1./(xm==0 ? 1:sqrt(xm)); - - mreal *pp=new mreal[6*nn*mm*ll],*cc=new mreal[nn*mm*ll]; - bool *tt=new bool[2*nn*mm*ll]; - long s = both ? n:1, t = both ? n*m : 1, ni,nj,nk; - - if(both || (x.nx==n && y.nx==m && z.nx==l)) - { - for(nk=0;nkdm ? ax.a[jj]/dd : 0) : ax.a[jj]*xm; - dy *= (flag&MGL_VEC_LEN) ? (dd>dm ? ay.a[jj]/dd : 0) : ay.a[jj]*xm; - dz *= (flag&MGL_VEC_LEN) ? (dd>dm ? az.a[jj]/dd : 0) : az.a[jj]*xm; - if(flag & MGL_VEC_END) - { - pp[6*i0+0] = x.a[ix]-dx; pp[6*i0+3] = x.a[ix]; - pp[6*i0+1] = y.a[iy]-dy; pp[6*i0+4] = y.a[iy]; - pp[6*i0+2] = z.a[iz]-dz; pp[6*i0+5] = z.a[iz]; - } - else if(flag & MGL_VEC_MID) - { - pp[6*i0+0] = x.a[ix]-dx/2; pp[6*i0+3] = x.a[ix]+dx/2; - pp[6*i0+1] = y.a[iy]-dy/2; pp[6*i0+4] = y.a[iy]+dy/2; - pp[6*i0+2] = z.a[iz]-dz/2; pp[6*i0+5] = z.a[iz]+dz/2; - } - else - { - pp[6*i0+0] = x.a[ix]; pp[6*i0+3] = x.a[ix]+dx; - pp[6*i0+1] = y.a[iy]; pp[6*i0+4] = y.a[iy]+dy; - pp[6*i0+2] = z.a[iz]; pp[6*i0+5] = z.a[iz]+dz; - } - tt[2*i0] = ScalePoint(pp[6*i0],pp[6*i0+1],pp[6*i0+2]); - tt[2*i0+1]= ScalePoint(pp[6*i0+3],pp[6*i0+4],pp[6*i0+5]); - } - if(flag & MGL_VEC_DOT) - lines_plot(nn*mm*ll,pp,(flag&MGL_VEC_COL)?0:cc,tt,true,flag&MGL_VEC_GRD); - else - vects_plot(nn*mm*ll,pp,(flag&MGL_VEC_COL)?0:cc,tt,flag&MGL_VEC_GRD); - } - EndGroup(); - delete []pp; delete []tt; delete []cc; -} -//----------------------------------------------------------------------------- -void mglGraph::Vect(const mglData &ax, const mglData &ay, const mglData &az, const char *sch, int flag) -{ - if(ax.nx<2 || ax.ny<2 || ax.nz<2) - { SetWarn(mglWarnLow,"Vect"); return; } - mglData x(ax.nx), y(ax.ny), z(ax.nz); - x.Fill(Min.x,Max.x); - y.Fill(Min.y,Max.y); - z.Fill(Min.z,Max.z); - Vect(x,y,z,ax,ay,az,sch,flag); -} -//----------------------------------------------------------------------------- -// -// VectL3 series -// -//----------------------------------------------------------------------------- -void mglGraph::VectL(const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, const char *sch) -{ Vect(x,y,z,ax,ay,az,sch,MGL_VEC_COL|MGL_VEC_DOT|MGL_VEC_GRD); } -//----------------------------------------------------------------------------- -void mglGraph::VectL(const mglData &ax, const mglData &ay, const mglData &az, const char *sch) -{ - if(ax.nx<2 || ax.ny<2 || ax.nz<2) - { SetWarn(mglWarnLow,"Vect"); return; } - mglData x(ax.nx), y(ax.ny), z(ax.nz); - x.Fill(Min.x,Max.x); - y.Fill(Min.y,Max.y); - z.Fill(Min.z,Max.z); - VectL(x,y,z,ax,ay,az,sch); -} -//----------------------------------------------------------------------------- -// -// VectC3 series -// -//----------------------------------------------------------------------------- -void mglGraph::VectC(const mglData &x, const mglData &y, const mglData &z, - const mglData &ax, const mglData &ay, const mglData &az, const char *sch) -{ Vect(x,y,z,ax,ay,az,sch,MGL_VEC_LEN|MGL_VEC_DOT|MGL_VEC_GRD); } -//----------------------------------------------------------------------------- -void mglGraph::VectC(const mglData &ax, const mglData &ay, const mglData &az, const char *sch) -{ - if(ax.nx<2 || ax.ny<2 || ax.nz<2) - { SetWarn(mglWarnLow,"VectC"); return; } - mglData x(ax.nx), y(ax.ny), z(ax.nz); - x.Fill(Min.x,Max.x); - y.Fill(Min.y,Max.y); - z.Fill(Min.z,Max.z); - VectC(x,y,z,ax,ay,az,sch); -} -//----------------------------------------------------------------------------- -// -// Map series -// -//----------------------------------------------------------------------------- -void mglGraph::Map(const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, - const char *sch, int ks, bool pnts) -{ - register long i,j,i0,jj,ix,iy,n=ax.nx,m=ax.ny; - if(n*m!=ay.nx*ay.ny) { SetWarn(mglWarnDim,"Map"); return; } - if(n<2 || m<2) { SetWarn(mglWarnLow,"Map"); return; } - bool both = x.nx==n && y.nx==n && x.ny==m && y.ny==m; - if(!(both || (x.nx==n && y.nx==m))) - { SetWarn(mglWarnDim,"Map"); return; } - static int cgid=1; StartGroup("Map",cgid++); - - SetScheme(sch); - mglColor c; - if(ks<0 || ks>=ay.nz || ks>=ax.nz) ks = 0; - long s = both ? n:1, s1, s2, n1, n2; - - mreal *pp = new mreal[3*n*m],*cc = new mreal[4*n*m]; - bool *tt = new bool[n*m]; - mreal xdy,xdx,ydx,ydy; - - for(i=0;iks ? jj : i0; iy = y.nz>ks ? jj : i0; } - else - { ix = x.ny>ks ? i+n*ks : i; iy = y.ny>ks ? j+m*ks : j; } - s1 = i>0 ? 1:0; s2 = i0 ? s:0; s2 = j0 ? n:0; n2 = j1) { tx=(n-1)/(MeshNum-1); ty=(m-1)/(MeshNum-1); } - if(tx<1) tx=1; if(ty<1) ty=1; - - for(i=0,xm=0;iym ? xm : ym; - } - xm = 1./(xm==0 ? 1:sqrt(xm)); - - long s = both ? n : 1; - mglPoint p,q; - - for(k=0;k1) zVal = Min.z+(Max.z-Min.z)*mreal(k)/(ax.nz-1); - for(i=0;ik ? jj : i+n*j; iy = y.nz>k ? jj : i+n*j; } - else - { ix = x.ny>k ? i+n*k : i; iy = y.ny>k ? j+m*k : j; } - dx = iDew(*x, *y, *ax, *ay, sch, zVal); } -/// Plot dew drops for vector field {ax,ay} -void mgl_dew_2d(HMGL gr, const HMDT ax, const HMDT ay, const char *sch,mreal zVal) -{ if(gr && ay && ax) gr->Dew(*ax, *ay, sch, zVal); } -/// Plot arrows {ax,ay,az} along a curve {x,y,y} -void mgl_traj_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch, mreal zVal, mreal len) -{ if(gr && ay && ax && x && y) gr->Traj(*x, *y, *ax, *ay, sch, zVal, len); } -void mgl_traj_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch, mreal len) -{ if(gr && ay && ax && az && z && x && y) gr->Traj(*x, *y, *z, *ax, *ay, *az, sch, len); } -/// Plot vector field {ax,ay} parametrically depended on coordinate {x,y} with length proportional to value |a| -void mgl_vect_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch,mreal zVal,int flag) -{ if(gr && ay && ax && x && y) gr->Vect(*x, *y, *ax, *ay, sch, zVal,flag); } -void mgl_vectl_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch,mreal zVal) -{ if(gr && ay && ax && x && y) gr->VectL(*x, *y, *ax, *ay, sch, zVal); } -/// Plot vector field {ax,ay} with length proportional to value |a| -void mgl_vect_2d(HMGL gr, const HMDT ax, const HMDT ay, const char *sch,mreal zVal,int flag) -{ if(gr && ay && ax) gr->Vect(*ax, *ay, sch, zVal, flag); } -void mgl_vectl_2d(HMGL gr, const HMDT ax, const HMDT ay, const char *sch,mreal zVal) -{ if(gr && ay && ax) gr->VectL(*ax, *ay, sch, zVal); } -/// Plot vector field {ax,ay} parametrically depended on coordinate {x,y} with color proportional to value |a| -void mgl_vectc_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT ax, const HMDT ay, const char *sch,mreal zVal) -{ if(gr && ay && ax && x && y) gr->VectC(*x, *y, *ax, *ay, sch, zVal); } -/// Plot vector field {ax,ay} with color proportional to value |a| -void mgl_vectc_2d(HMGL gr, const HMDT ax, const HMDT ay, const char *sch,mreal zVal) -{ if(gr && ay && ax) gr->VectC(*ax, *ay, sch, zVal); } -/// Plot 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with length proportional to value |a| -void mgl_vect_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch,int flag) -{ if(gr && ay && ax && az && z && x && y) gr->Vect(*x, *y, *z, *ax, *ay, *az, sch,flag); } -void mgl_vectl_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch) -{ if(gr && ay && ax && az && z && x && y) gr->VectL(*x, *y, *z, *ax, *ay, *az, sch); } -/// Plot 3d vector field {ax,ay,ay} with length proportional to value |a| -void mgl_vect_3d(HMGL gr, const HMDT ax, const HMDT ay, const HMDT az, const char *sch,int flag) -{ if(gr && ay && ax && az) gr->Vect(*ax, *ay, *az, sch,flag); } -void mgl_vectl_3d(HMGL gr, const HMDT ax, const HMDT ay, const HMDT az, const char *sch) -{ if(gr && ay && ax && az) gr->VectL(*ax, *ay, *az, sch); } -/// Plot 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to value |a| -void mgl_vectc_xyz(HMGL gr, const HMDT x, const HMDT y, const HMDT z, const HMDT ax, const HMDT ay, const HMDT az, const char *sch) -{ if(gr && ay && ax && az && z && x && y) gr->VectC(*x, *y, *z, *ax, *ay, *az, sch); } -/// Plot 3d vector field {ax,ay,ay} with color proportional to value |a| -void mgl_vectc_3d(HMGL gr, const HMDT ax, const HMDT ay, const HMDT az, const char *sch) -{ if(gr && ay && ax && az) gr->VectC(*ax, *ay, *az, sch); } -/// Color map of matrix a to matrix b, both matrix parametrically depend on coordinates -void mgl_map_xy(HMGL gr, const HMDT x, const HMDT y, const HMDT a, const HMDT b, const char *sch, int ks, int pnts) -{ if(gr && a && b && x && y) gr->Map(*x, *y, *a, *b, sch, ks, pnts); } -/// Color map of matrix a to matrix b -void mgl_map(HMGL gr, const HMDT a, const HMDT b, const char *sch, int ks, int pnts) -{ if(gr && a && b) gr->Map(*a, *b, sch, ks, pnts); } -//----------------------------------------------------------------------------- -// Dual plotting functions (FORTRAN) -//----------------------------------------------------------------------------- -/// Plot dew drops for vector field {ax,ay} parametrically depended on coordinate {x,y} -void mgl_dew_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && x && y) _GR_->Dew(_D_(x), _D_(y), _D_(ax), _D_(ay), s, *zVal); - delete []s; -} -/// Plot dew drops for vector field {ax,ay} -void mgl_dew_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax) _GR_->Dew(_D_(ax), _D_(ay), s, *zVal); - delete []s; -} -/// Plot arrows {ax,ay,az} along a curve {x,y,y} -void mgl_traj_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, mreal *zVal, mreal *len,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && x && y) - _GR_->Traj(_D_(x), _D_(y), _D_(ax), _D_(ay), s, *zVal, *len); - delete []s; -} -void mgl_traj_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch,mreal *len,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && az && z && x && y) - _GR_->Traj(_D_(x), _D_(y), _D_(z), _D_(ax), _D_(ay), _D_(az), s, *len); - delete []s; -} -/// Plot vector field {ax,ay} parametrically depended on coordinate {x,y} with length proportional to value |a| -void mgl_vect_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, mreal *zVal,int *flag,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && x && y) - _GR_->Vect(_D_(x), _D_(y), _D_(ax), _D_(ay), s, *zVal, *flag); - delete []s; -} -void mgl_vectl_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && x && y) _GR_->VectL(_D_(x), _D_(y), _D_(ax), _D_(ay), s, *zVal); - delete []s; -} -/// Plot vector field {ax,ay} with length proportional to value |a| -void mgl_vect_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch, mreal *zVal,int *flag,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax) _GR_->Vect(_D_(ax), _D_(ay), s, *zVal,*flag); - delete []s; -} -void mgl_vectl_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax) _GR_->VectL(_D_(ax), _D_(ay), s, *zVal); - delete []s; -} -/// Plot vector field {ax,ay} parametrically depended on coordinate {x,y} with color proportional to value |a| -void mgl_vectc_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && x && y) _GR_->VectC(_D_(x), _D_(y), _D_(ax), _D_(ay), s, *zVal); - delete []s; -} -/// Plot vector field {ax,ay} with color proportional to value |a| -void mgl_vectc_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch,mreal *zVal,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax) _GR_->VectC(_D_(ax), _D_(ay), s, *zVal); - delete []s; -} -/// Plot 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with length proportional to value |a| -void mgl_vect_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch,int *flag,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && az && z && x && y) - _GR_->Vect(_D_(x), _D_(y), _D_(z), _D_(ax), _D_(ay), _D_(az), s, *flag); - delete []s; -} -void mgl_vectl_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && az && z && x && y) _GR_->VectL(_D_(x), _D_(y), _D_(z), _D_(ax), _D_(ay), _D_(az), s); - delete []s; -} -/// Plot 3d vector field {ax,ay,ay} with length proportional to value |a| -void mgl_vect_3d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, int *flag, int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && az) _GR_->Vect(_D_(ax), _D_(ay), _D_(az), s, *flag); - delete []s; -} -void mgl_vectl_3d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && az) _GR_->VectL(_D_(ax), _D_(ay), _D_(az), s); - delete []s; -} -/// Plot 3d vector field {ax,ay,ay} parametrically depended on coordinate {x,y,z} with color proportional to value |a| -void mgl_vectc_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && az && z && x && y) _GR_->VectC(_D_(x), _D_(y), _D_(z), _D_(ax), _D_(ay), _D_(az), s); - delete []s; -} -/// Plot 3d vector field {ax,ay,ay} with color proportional to value |a| -void mgl_vectc_3d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && ay && ax && az) _GR_->VectC(_D_(ax), _D_(ay), _D_(az), s); - delete []s; -} -/// Color map of matrix a to matrix b, both matrix parametrically depend on coordinates -void mgl_map_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, uintptr_t *b, const char *sch, int *ks, int *pnts,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && b && x && y) _GR_->Map(_D_(x), _D_(y), _D_(a), _D_(b), s, *ks, *pnts); - delete []s; -} -/// Color map of matrix a to matrix b -void mgl_map_(uintptr_t *gr, uintptr_t *a, uintptr_t *b, const char *sch, int *ks, int *pnts,int l) -{ - char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; - if(gr && a && b) _GR_->Map(_D_(a), _D_(b), s, *ks, *pnts); - delete []s; -} -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_zb.cpp b/mgl/mgl_zb.cpp deleted file mode 100644 index b19d5ad..0000000 --- a/mgl/mgl_zb.cpp +++ /dev/null @@ -1,987 +0,0 @@ -/*************************************************************************** - * mgl_zb.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include "mgl/mgl_zb.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -#define imax(a,b) (a)>(b) ? (a) : (b) -#define imin(a,b) (a)<(b) ? (a) : (b) - -//#define MGL_ABUF_8 - -//#define MGL_SIMPLE_LINE -//----------------------------------------------------------------------------- -mglGraphZB::mglGraphZB(int w,int h) : mglGraphAB(w,h) -{ FastNoFace = true; C = 0; SetSize(w,h); } -//----------------------------------------------------------------------------- -mglGraphZB::~mglGraphZB() -{ if(C) { delete []C; delete []Z; } } -//----------------------------------------------------------------------------- -void mglGraphAB::SetDrawReg(int nx, int ny, int m) -{ - int mx = m%nx, my = m/nx; - nx1 = Width*mx/nx; ny1 = Height-Height*(my+1)/ny; - nx2 = Width*(mx+1)/nx; ny2 = Height-Height*my/ny; -} -//----------------------------------------------------------------------------- -void mglGraphAB::PutDrawReg(int , int , int , mglGraphAB *) {} -//----------------------------------------------------------------------------- -void mglGraphZB::PutDrawReg(int nx, int ny, int m, mglGraphAB *g) -{ - mglGraphZB *gr=dynamic_cast(g); - if(!gr) return; - int mx = m%nx, my = m/nx, x1, x2, y1, y2; - x1 = Width*mx/nx; y1 = Height-Height*(my+1)/ny; - x2 = Width*(mx+1)/nx; y2 = Height-Height*my/ny; - register long i,j; - for(j=y1;jZ+8*i,8*(x2-x1)*sizeof(mreal)); - memcpy(C+32*i,gr->C+32*i,32*(x2-x1)); - } -} -//----------------------------------------------------------------------------- -void mglGraphZB::pnt_plot(long x,long y,mreal z,unsigned char ci[4]) -{ - long i0=x+Width*(Height-1-y); - if(x=nx2 || y=ny2) return; - unsigned char *cc = C+32*i0, c[4]; - memcpy(c,ci,4); - mreal *zz = Z+8*i0, zf = FogDist*(z/Depth-0.5-FogDz); - if(zf<0) - { - int d = int(255.f-255.f*exp(5.f*zf)); - unsigned char cb[4] = {BDef[0], BDef[1], BDef[2], d}; - if(d==255) return; - combine(c,cb); - } - if(DrawFace || !FastNoFace) - { -#ifdef MGL_ABUF_8 - if(z>zz[3]) - { -#endif - if(z>zz[1]) - { -#ifdef MGL_ABUF_8 - zz[7] = zz[6]; zz[6] = zz[5]; zz[5] = zz[4]; - zz[4] = zz[3]; zz[3] = zz[2]; - combine(cc+28,cc+24); memcpy(cc+24,cc+20,4); - memcpy(cc+20,cc+16,4); memcpy(cc+16,cc+12,4); - memcpy(cc+12,cc+8,4); -#else - zz[3] = zz[2]; combine(cc+12,cc+8); -#endif - zz[2] = zz[1]; memcpy(cc+8,cc+4,4); - if(z>zz[0]) // shift point on slice down and paste new point - { - zz[1] = zz[0]; zz[0] = z; OI[i0]=ObjId; - memcpy(cc+4,cc,4); memcpy(cc,c,4); - } - else // shift point on slice down and paste new point - { zz[1] = z; memcpy(cc+4,c,4); } - } - else - { - if(z>zz[2]) // shift point on slice down and paste new point - { -#ifdef MGL_ABUF_8 - zz[7] = zz[6]; zz[6] = zz[5]; zz[5] = zz[4]; - zz[4] = zz[3]; zz[3] = zz[2]; - combine(cc+28,cc+24); memcpy(cc+24,cc+20,4); - memcpy(cc+20,cc+16,4); memcpy(cc+16,cc+12,4); - memcpy(cc+12,cc+8,4); -#else - zz[3] = zz[2]; combine(cc+12,cc+8); -#endif - zz[2] = z; memcpy(cc+8,c,4); - } - else // shift point on slice down and paste new point - { -#ifdef MGL_ABUF_8 - zz[7] = zz[6]; zz[6] = zz[5]; zz[5] = zz[4]; - zz[4] = zz[3]; zz[3] = z; - combine(cc+28,cc+24); memcpy(cc+24,cc+20,4); - memcpy(cc+20,cc+16,4); memcpy(cc+16,cc+12,4); - memcpy(cc+12,c,4); -#else - if(z>zz[3]) // point upper the background - { zz[3]=z; combine(cc+12,c); } - else // point below the background - { combine(c,cc+12); memcpy(cc+12,c,4); } -#endif - } - } -#ifdef MGL_ABUF_8 - } - else - { - if(z>zz[5]) - { - if(z>zz[4]) // shift point on slice down and paste new point - { - zz[7] = zz[6]; zz[6] = zz[5]; zz[5] = zz[4]; zz[4] = z; - combine(cc+28,cc+24); memcpy(cc+24,cc+20,4); - memcpy(cc+20,cc+16,4); memcpy(cc+16,c,4); - } - else // shift point on slice down and paste new point - { - zz[7] = zz[6]; zz[6] = zz[5]; zz[5] = z; - combine(cc+28,cc+24); memcpy(cc+24,cc+20,4); - memcpy(cc+20,c,4); - } - } - else - { - if(z>zz[6]) // shift point on slice down and paste new point - { - zz[7] = zz[6]; zz[6] = z; - combine(cc+28,cc+24); memcpy(cc+24,c,4); - } - else if(z>zz[7]) // point upper the background - { zz[7]=z; combine(cc+28,c); } - else // point below the background - { combine(c,cc+28); memcpy(cc+28,c,4); } - } - } -#endif - } - else - { - if(z>zz[0]) // point upper the background - { zz[0]=z; memcpy(cc,c,4); OI[i0]=ObjId; } - } -} -//----------------------------------------------------------------------------- -void mglGraphZB::Finish() -{ - register long i,i0; - long n=Width*Height; - unsigned char c[4],alf=TranspType!=2 ? 0:255,*cc; - if(DrawFace || !FastNoFace) for(i=0;i0 !!! - Z = new mreal[w*h*8]; - mglGraphAB::SetSize(w,h); -} -//----------------------------------------------------------------------------- -int mgl_pnga_save(const char *fname, int w, int h, unsigned char **p); -void mglGraphZB::WriteSlice(int n) -{ - unsigned char **p; - char fname[32]; - sprintf(fname,"%d.png",n); - - p = (unsigned char **)malloc(Height * sizeof(unsigned char *)); - for(long i=0;iGetFact(ss); - mglColor cc = mglColor(col); - if(!cc.Valid()) cc = mglColor(CDef[0],CDef[1],CDef[2]); - mreal c[4]={cc.r,cc.g,cc.b,CDef[3]}; - if(s&8) - { - if(!(s&4)) glyph_line(x,y,f,c,true); - glyph_line(x,y,f,c,false); - } - else - { - if(!(s&4)) glyph_fill(x,y,f,fnt->GetNt(ss,j),fnt->GetTr(ss,j),c); - glyph_wire(x,y,f,fnt->GetNl(ss,j),fnt->GetLn(ss,j),c); - } -} -//----------------------------------------------------------------------------- -/// Create mglGraph object in ZBuffer mode. -HMGL mgl_create_graph_zb(int width, int height) -{ return new mglGraphZB(width,height); } -/// Create mglGraph object in ZBuffer mode. -uintptr_t mgl_create_graph_zb_(int *width, int *height) -{ return uintptr_t(new mglGraphZB(*width,*height)); } -//----------------------------------------------------------------------------- -// -// now these functions from mglGraphAB -// -//----------------------------------------------------------------------------- -void mglGraphAB::Ball(mreal x,mreal y,mreal z,mglColor col,mreal alpha) -{ - if(alpha==0) return; - if(alpha<0) { alpha = -alpha; } - else { if(!ScalePoint(x,y,z)) return; } - if(!col.Valid()) col = mglColor(1.,0.,0.); - unsigned char r[4]; - Finished = false; - alpha = Transparent ? alpha : 1; - mreal p[3] = {x,y,z}, v, u = 1./(9*PenWidth*PenWidth); - PostScale(p,1); - r[0] = (unsigned char)(255.f*col.r); - r[1] = (unsigned char)(255.f*col.g); - r[2] = (unsigned char)(255.f*col.b); - - bool aa=UseAlpha; UseAlpha = true; - register long i,j; - long w = long(5.5+fabs(PenWidth)); - for(i=-w;i<=w;i++) for(j=-w;j<=w;j++) - { - v = (i*i+j*j)*u; - r[3] = (unsigned char)(255.f*alpha*exp(-6.f*v)); - if(r[3]==0) continue; - pnt_plot(long(p[0])+i,long(p[1])+j,p[2],r); - } - UseAlpha = aa; -} -//----------------------------------------------------------------------------- -void mglGraphAB::ball(mreal *p,mreal *c) -{ - unsigned char r[4]; - Finished = false; - r[0] = (unsigned char)(255.f*c[0]); - r[1] = (unsigned char)(255.f*c[1]); - r[2] = (unsigned char)(255.f*c[2]); - - bool aa=UseAlpha; UseAlpha = true; - register long i,j; - long w = long(5.5+fabs(PenWidth)); - mreal v, u = 1./(4*PenWidth*PenWidth); - for(i=-w;i<=w;i++) for(j=-w;j<=w;j++) - { - v = (i*i+j*j)*u; - r[3] = (unsigned char)(255.f*c[3]*exp(-6.f*v)); - if(r[3]==0) continue; - pnt_plot(long(p[0])+i,long(p[1])+j,p[2],r); - } - UseAlpha = aa; -} -//----------------------------------------------------------------------------- -unsigned char* mglGraphAB::col2int(mglColor c,mreal a,unsigned char *r) -{ - mreal cc[4] = {c.r,c.g,c.b,a}; - return col2int(cc,0,r); -} -//----------------------------------------------------------------------------- -unsigned char* mglGraphAB::col2int(mreal *c,mreal *n,unsigned char *r) -{ - register long i,j; - static unsigned char u[4]; - register mreal b0=c[0],b1=c[1],b2=c[2]; - if(r==0) r = u; - if(c[3]<=0) { memset(r,0,4*sizeof(unsigned char)); return r; } - if(UseLight && n) - { - mreal d0,d1,d2,nn; - b0 *= AmbBr; b1 *= AmbBr; b2 *= AmbBr; - for(i=0;i<10;i++) - { - if(!nLight[i]) continue; - j = 3*i; - nn = 2*(n[0]*pLight[j]+n[1]*pLight[j+1]+n[2]*pLight[j+2]) / - (n[0]*n[0]+n[1]*n[1]+n[2]*n[2]+1e-6); - d0 = pLight[j] - n[0]*nn; - d1 = pLight[j+1]-n[1]*nn; - d2 = pLight[j+2]-n[2]*nn; - nn = 1 + d2/sqrt(d0*d0+d1*d1+d2*d2+1e-6); - - nn = exp(-aLight[i]*nn)*bLight[i]*2; - b0 += nn*cLight[j]; - b1 += nn*cLight[j+1]; - b2 += nn*cLight[j+2]; - } - b0 = b0<1 ? b0 : 1; - b1 = b1<1 ? b1 : 1; - b2 = b2<1 ? b2 : 1; - } - r[0] = (unsigned char)(255.f*b0); r[1] = (unsigned char)(255.f*b1); - r[2] = (unsigned char)(255.f*b2); - // c[3] should be <1 but I additionally check it here - r[3] = UseAlpha && c[3]<1 ? (unsigned char)(255.f*c[3]) : 255; - return r; -} -//----------------------------------------------------------------------------- -/* Bilinear interpolation r(u,v) = r0 + (r1-r0)*u + (r2-20)*v + (r3+30-r1-r2)*u*v is used (where r is one of {x,y,z,R,G,B,A}. Variables u,v are determined for each point (x,y) and selected one pair which 0nx1?x1:nx1; x2=x2ny1?y1:ny1; y2=y2x2 || y1>y2) return; - - dd=d1[0]*d2[1]-d1[1]*d2[0]; - dsx =-4*(d2[1]*d3[0] - d2[0]*d3[1])*d1[1]; - dsy = 4*(d2[1]*d3[0] - d2[0]*d3[1])*d1[0]; - - if((d1[0]==0 && d1[1]==0) || (d2[0]==0 && d2[1]==0) || (pp1[0]==pp3[0] && pp1[1]==pp3[1]) || (pp2[0]==pp3[0] && pp2[1]==pp3[1])) - { - mreal ps[3]; - ps[0] = (pp0[0]+pp1[0]+pp2[0]+pp3[0])/4; - ps[1] = (pp0[1]+pp1[1]+pp2[1]+pp3[1])/4; - ps[2] = (pp0[2]+pp1[2]+pp2[2]+pp3[2])/4; - cs[0] = (cc0[0]+cc1[0]+cc2[0]+cc3[0])/4; - cs[1] = (cc0[1]+cc1[1]+cc2[1]+cc3[1])/4; - cs[2] = (cc0[2]+cc1[2]+cc2[2]+cc3[2])/4; - cs[3] = (cc0[3]+cc1[3]+cc2[3]+cc3[3])/4; - trig_plot(ps,pp0,pp1,cs,cc0,cc1); - trig_plot(ps,pp3,pp1,cs,cc3,cc1); - trig_plot(ps,pp2,pp3,cs,cc2,cc3); - trig_plot(ps,pp0,pp2,cs,cc0,cc2); - return; - } - - register long i,j,g; - register mreal u,v,s,xx,yy,q; - for(i=x1;i<=x2;i++) for(j=y1;j<=y2;j++) - { - xx = (i-pp0[0]); yy = (j-pp0[1]); - s = dsx*xx + dsy*yy + (dd+d3[1]*xx-d3[0]*yy)*(dd+d3[1]*xx-d3[0]*yy); - if(s<0) continue; // no solution - s = sqrt(s); - q = d3[0]*yy - d3[1]*xx + dd + s; - u = q ? 2.f*(d2[1]*xx - d2[0]*yy)/q : -1.f; - q = d3[1]*xx - d3[0]*yy + dd + s; - v = q ? 2.f*(d1[0]*yy - d1[1]*xx)/q : -1.f; - g = u<0.f || u>1.f || v<0.f || v>1.f; - if(g) // first root bad - { - q = d3[0]*yy - d3[1]*xx + dd - s; - u = q ? 2.f*(d2[1]*xx - d2[0]*yy)/q : -1.f; - q = d3[1]*xx - d3[0]*yy + dd - s; - v = q ? 2.f*(d1[0]*yy - d1[1]*xx)/q : -1.f; - g = u<0.f || u>1.f || v<0.f || v>1.f; - if(g) continue; // second root bad - } - s = u*v; - cs[0] = cc0[0]+c1[0]*u+c2[0]*v+c3[0]*s; - cs[1] = cc0[1]+c1[1]*u+c2[1]*v+c3[1]*s; - cs[2] = cc0[2]+c1[2]*u+c2[2]*v+c3[2]*s; - cs[3] = cc0[3]+c1[3]*u+c2[3]*v+c3[3]*s; - ns[0]=(d2[2]+d3[2]*u)*(d1[1]+d3[1]*v)-(d2[1]+d3[1]*u)*(d1[2]+d3[2]*v); // normal vector - ns[1]=(d2[0]+d3[0]*u)*(d1[2]+d3[2]*v)-(d2[2]+d3[2]*u)*(d1[0]+d3[0]*v); - ns[2]=(d2[1]+d3[1]*u)*(d1[0]+d3[0]*v)-(d2[0]+d3[0]*u)*(d1[1]+d3[1]*v); - pnt_plot(i,j,pp0[2]+d1[2]*u+d2[2]*v+d3[2]*s,col2int(cs,ns,r)); - } -} -//----------------------------------------------------------------------------- -/* Bilinear interpolation r(u,v) = r0 + (r1-r0)*u + (r2-20)*v + (r3+30-r1-r2)*u*v is used (where r is one of {x,y,z,R,G,B,A}. Variables u,v are determined for each point (x,y) and selected one pair which 0nx1?x1:nx1; x2=x2ny1?y1:ny1; y2=y2x2 || y1>y2) return; - - dd=d1[0]*d2[1]-d1[1]*d2[0]; - dsx =-4*(d2[1]*d3[0] - d2[0]*d3[1])*d1[1]; - dsy = 4*(d2[1]*d3[0] - d2[0]*d3[1])*d1[0]; - - if((d1[0]==0 && d1[1]==0) || (d2[0]==0 && d2[1]==0) || (pp1[0]==pp3[0] && pp1[1]==pp3[1]) || (pp2[0]==pp3[0] && pp2[1]==pp3[1])) - { - mreal ps[3]; - ps[0] = (pp0[0]+pp1[0]+pp2[0]+pp3[0])/4; - ps[1] = (pp0[1]+pp1[1]+pp2[1]+pp3[1])/4; - ps[2] = (pp0[2]+pp1[2]+pp2[2]+pp3[2])/4; - cs[0] = (cc0[0]+cc1[0]+cc2[0]+cc3[0])/4; - cs[1] = (cc0[1]+cc1[1]+cc2[1]+cc3[1])/4; - cs[2] = (cc0[2]+cc1[2]+cc2[2]+cc3[2])/4; - cs[3] = (cc0[3]+cc1[3]+cc2[3]+cc3[3])/4; - trig_plot(ps,pp0,pp1,cs,cc0,cc1); - trig_plot(ps,pp3,pp1,cs,cc3,cc1); - trig_plot(ps,pp2,pp3,cs,cc2,cc3); - trig_plot(ps,pp0,pp2,cs,cc0,cc2); - return; - } - - register long i,j,g; - register mreal u,v,s,xx,yy,q; - for(i=x1;i<=x2;i++) for(j=y1;j<=y2;j++) - { - xx = (i-pp0[0]); yy = (j-pp0[1]); - s = dsx*xx + dsy*yy + (dd+d3[1]*xx-d3[0]*yy)*(dd+d3[1]*xx-d3[0]*yy); - if(s<0) continue; // no solution - s = sqrt(s); - q = d3[0]*yy - d3[1]*xx + dd + s; - u = q ? 2.f*(d2[1]*xx - d2[0]*yy)/q : -1.f; - q = d3[1]*xx - d3[0]*yy + dd + s; - v = q ? 2.f*(d1[0]*yy - d1[1]*xx)/q : -1.f; - g = u<0.f || u>1.f || v<0.f || v>1.f; - if(g) // first root bad - { - q = d3[0]*yy - d3[1]*xx + dd - s; - u = q ? 2.f*(d2[1]*xx - d2[0]*yy)/q : -1.f; - q = d3[1]*xx - d3[0]*yy + dd - s; - v = q ? 2.f*(d1[0]*yy - d1[1]*xx)/q : -1.f; - g = u<0.f || u>1.f || v<0.f || v>1.f; - if(g) continue; // second root bad - } - s = u*v; - cs[0] = cc0[0]+c1[0]*u+c2[0]*v+c3[0]*s; - cs[1] = cc0[1]+c1[1]*u+c2[1]*v+c3[1]*s; - cs[2] = cc0[2]+c1[2]*u+c2[2]*v+c3[2]*s; - cs[3] = cc0[3]+c1[3]*u+c2[3]*v+c3[3]*s; - ns[0] = nn0[0]+n1[0]*u+n2[0]*v+n3[0]*s; - ns[1] = nn0[1]+n1[1]*u+n2[1]*v+n3[1]*s; - ns[2] = nn0[2]+n1[2]*u+n2[2]*v+n3[2]*s; - pnt_plot(i,j,pp0[2]+d1[2]*u+d2[2]*v+d3[2]*s,col2int(cs,ns,r)); - } -} -//----------------------------------------------------------------------------- -/* Bilinear interpolation r(u,v) = r0 + (r1-r0)*u + (r2-20)*v + (r3+30-r1-r2)*u*v is used (where r is one of {x,y,z,R,G,B,A}. Variables u,v are determined for each point (x,y) and selected one pair which 0nx1?x1:nx1; x2=x2ny1?y1:ny1; y2=y2x2 || y1>y2) return; - - dd=d1[0]*d2[1]-d1[1]*d2[0]; - dsx =-4*(d2[1]*d3[0] - d2[0]*d3[1])*d1[1]; - dsy = 4*(d2[1]*d3[0] - d2[0]*d3[1])*d1[0]; - - register long i,j,k; - bool g; - long n = NumCol-1; - register mreal u,v,s,xx,yy,q; - mglColor c; - for(i=x1;i<=x2;i++) for(j=y1;j<=y2;j++) - { - xx = (i-pp0[0]); yy = (j-pp0[1]); - s = dsx*xx + dsy*yy + (dd+d3[1]*xx-d3[0]*yy)*(dd+d3[1]*xx-d3[0]*yy); - if(s<0) continue; // no solution - s = sqrt(s); - q = d3[0]*yy - d3[1]*xx + dd + s; - u = q ? 2.f*(d2[1]*xx - d2[0]*yy)/q : -1.f; - q = d3[1]*xx - d3[0]*yy + dd + s; - v = q ? 2.f*(d1[0]*yy - d1[1]*xx)/q : -1.f; - g = u<0.f || u>1.f || v<0.f || v>1.f; - if(g) // first root bad - { - q = d3[0]*yy - d3[1]*xx + dd - s; - u = q ? 2.f*(d2[1]*xx - d2[0]*yy)/q : -1.f; - q = d3[1]*xx - d3[0]*yy + dd - s; - v = q ? 2.f*(d1[0]*yy - d1[1]*xx)/q : -1.f; - g = u<0.f || u>1.f || v<0.f || v>1.f; - if(g) continue; // second root bad - } - - s = aa0 + a1*u + a2*v + a3*u*v; - r[3] = (unsigned char)(255.f*alpha*(alpha>0 ? (s+1.f)*(s+1.f) : (1.f-s)*(s-1.f))); - s = (s+1.f)/2.f; s *= n; - k = long(s); s -= k; - if(k0 and v>0 and u+v<1.*/ -void mglGraphAB::trig_plot(mreal *pp0,mreal *pp1,mreal *pp2,mreal *cc0,mreal *cc1,mreal *cc2) -{ trig_draw(pp0,pp1,pp2,cc0,cc1,cc2); } -void mglGraphAB::trig_draw(mreal *pp0,mreal *pp1,mreal *pp2,mreal *cc0,mreal *cc1,mreal *cc2) -{ - Finished = false; - unsigned char r[4]; - long y1,x1,y2,x2; - mreal d1[3],d2[3],c1[4],c2[4]; - mreal cs[4],ns[3],dxu,dxv,dyu,dyv; - - d1[0] = pp1[0]-pp0[0]; d2[0] = pp2[0]-pp0[0]; - d1[1] = pp1[1]-pp0[1]; d2[1] = pp2[1]-pp0[1]; - dxu = d2[0]*d1[1] - d1[0]*d2[1]; - if(fabs(dxu)<1e-5) return; // points lies on the same line - - d1[2] = pp1[2]-pp0[2]; d2[2] = pp2[2]-pp0[2]; - c1[0] = cc1[0]-cc0[0]; c2[0] = cc2[0]-cc0[0]; - c1[1] = cc1[1]-cc0[1]; c2[1] = cc2[1]-cc0[1]; - c1[2] = cc1[2]-cc0[2]; c2[2] = cc2[2]-cc0[2]; - c1[3] = cc1[3]-cc0[3]; c2[3] = cc2[3]-cc0[3]; - ns[0]=d2[2]*d1[1]-d2[1]*d1[2]; // normal vector - ns[1]=d2[0]*d1[2]-d2[2]*d1[0]; - ns[2]=d2[1]*d1[0]-d2[0]*d1[1]; - - dyv =-d1[0]/dxu; dxv = d1[1]/dxu; - dyu = d2[0]/dxu; dxu =-d2[1]/dxu; - - x1 = imin(long(pp0[0]),imin(long(pp1[0]),long(pp2[0]))); // bounding box - y1 = imin(long(pp0[1]),imin(long(pp1[1]),long(pp2[1]))); - x2 = imax(long(pp0[0]),imax(long(pp1[0]),long(pp2[0]))); - y2 = imax(long(pp0[1]),imax(long(pp1[1]),long(pp2[1]))); - x1=x1>nx1?x1:nx1; x2=x2ny1?y1:ny1; y2=y2x2 || y1>y2) return; - - register mreal u,v,xx,yy; - register long i,j,g; - for(i=x1;i<=x2;i++) for(j=y1;j<=y2;j++) - { - xx = (i-pp0[0]); yy = (j-pp0[1]); - u = dxu*xx+dyu*yy; v = dxv*xx+dyv*yy; - g = u<0 || v<0 || u+v>1; - if(g) continue; - - cs[0] = cc0[0]+c1[0]*u+c2[0]*v; - cs[1] = cc0[1]+c1[1]*u+c2[1]*v; - cs[2] = cc0[2]+c1[2]*u+c2[2]*v; - cs[3] = cc0[3]+c1[3]*u+c2[3]*v; - pnt_plot(i,j,pp0[2]+d1[2]*u+d2[2]*v,col2int(cs,ns,r)); - } -} -//----------------------------------------------------------------------------- -/* Linear interpolation r(u,v) = r0 + (r1-r0)*u + (r2-20)*v is used (where r is one of {x,y,z,R,G,B,A}. Variables u,v are determined for each point (x,y). Point plotted is u>0 and v>0 and u+v<1.*/ -void mglGraphAB::trig_plot_n(mreal *pp0,mreal *pp1,mreal *pp2, - mreal *cc0,mreal *cc1,mreal *cc2, mreal *nn0,mreal *nn1,mreal *nn2) -{ - Finished = false; - unsigned char r[4]; - long y1,x1,y2,x2; - mreal d1[3],d2[3],c1[4],c2[4],n1[3],n2[3]; - mreal cs[4],ns[3],dxu,dxv,dyu,dyv; - - d1[0] = pp1[0]-pp0[0]; d2[0] = pp2[0]-pp0[0]; - d1[1] = pp1[1]-pp0[1]; d2[1] = pp2[1]-pp0[1]; - dxu = d2[0]*d1[1] - d1[0]*d2[1]; - if(fabs(dxu)<1e-5) return; // points lies on the same line - - d1[2] = pp1[2]-pp0[2]; d2[2] = pp2[2]-pp0[2]; - c1[0] = cc1[0]-cc0[0]; c2[0] = cc2[0]-cc0[0]; - c1[1] = cc1[1]-cc0[1]; c2[1] = cc2[1]-cc0[1]; - c1[2] = cc1[2]-cc0[2]; c2[2] = cc2[2]-cc0[2]; - c1[3] = cc1[3]-cc0[3]; c2[3] = cc2[3]-cc0[3]; - n1[0] = nn1[0]-nn0[0]; n2[0] = nn2[0]-nn0[0]; - n1[1] = nn1[1]-nn0[1]; n2[1] = nn2[1]-nn0[1]; - n1[2] = nn1[2]-nn0[2]; n2[2] = nn2[2]-nn0[2]; - - dyv =-d1[0]/dxu; dxv = d1[1]/dxu; - dyu = d2[0]/dxu; dxu =-d2[1]/dxu; - - x1 = imin(long(pp0[0]),imin(long(pp1[0]),long(pp2[0]))); // bounding box - y1 = imin(long(pp0[1]),imin(long(pp1[1]),long(pp2[1]))); - x2 = imax(long(pp0[0]),imax(long(pp1[0]),long(pp2[0]))); - y2 = imax(long(pp0[1]),imax(long(pp1[1]),long(pp2[1]))); - x1=x1>nx1?x1:nx1; x2=x2ny1?y1:ny1; y2=y2x2 || y1>y2) return; - - register mreal u,v,xx,yy; - register long i,j,g; - for(i=x1;i<=x2;i++) for(j=y1;j<=y2;j++) - { - xx = (i-pp0[0]); yy = (j-pp0[1]); - u = dxu*xx+dyu*yy; v = dxv*xx+dyv*yy; - g = u<0 || v<0 || u+v>1; - if(g) continue; - - cs[0] = cc0[0]+c1[0]*u+c2[0]*v; - cs[1] = cc0[1]+c1[1]*u+c2[1]*v; - cs[2] = cc0[2]+c1[2]*u+c2[2]*v; - cs[3] = cc0[3]+c1[3]*u+c2[3]*v; - ns[0] = nn0[0]+n1[0]*u+n2[0]*v; - ns[1] = nn0[1]+n1[1]*u+n2[1]*v; - ns[2] = nn0[2]+n1[2]*u+n2[2]*v; - pnt_plot(i,j,pp0[2]+d1[2]*u+d2[2]*v,col2int(cs,ns,r)); - } -} -//----------------------------------------------------------------------------- -/*void mglGraphAB::line_plot_s(mreal *x1,mreal *x2,mreal *y1,mreal *y2,bool ) -{ - mreal kx,ky,kz,t,dd=1; - mreal c10,c11,c12; - - register long i; - kx = ky = kz = t = 0; - if(fabs(x1[0]-x2[0])>fabs(x1[1]-x2[1])) - { - dd = 1./fabs(x2[0]-x1[0]); t = fabs(x2[0]-x1[0]); - } - else if(fabs(x1[1]-x2[1])!=0) - { - dd = 1./fabs(x2[1]-x1[1]); t = fabs(x2[1]-x1[1]); - } - kx=(x2[0]-x1[0])*dd; ky=(x2[1]-x1[1])*dd; kz=(x2[2]-x1[2])*dd; - c10=(y2[0]-y1[0])*dd; c11=(y2[1]-y1[1])*dd; c12=(y2[2]-y1[2])*dd; - unsigned char r[4]={255,255,255,255}; - for(i=0;i<=t;i++) - { - r[0] = (unsigned char)(255.f*(y1[0]+c10*i)); - r[1] = (unsigned char)(255.f*(y1[1]+c11*i)); - r[2] = (unsigned char)(255.f*(y1[2]+c12*i)); - pnt_plot(long(x1[0]+kx*i), long(x1[1]+ky*i), x1[2]+kz*i,r); - } -}*/ -//----------------------------------------------------------------------------- -void mglGraphAB::line_plot(mreal *pp0,mreal *pp1,mreal *cc0,mreal *cc1,bool all) -{ line_draw(pp0,pp1,cc0,cc1,all); } -void mglGraphAB::line_draw(mreal *pp0,mreal *pp1,mreal *cc0,mreal *cc1,bool all) -{ -// if(!DrawFace && FastNoFace) { line_plot_s(pp0,pp1,cc0,cc1,all); return; } - Finished = false; - unsigned char r[4]; - long y1,x1,y2,x2; - mreal dxu,dxv,dyu,dyv,dd,pw = fabs(PenWidth); - bool hor = fabs(pp0[0]-pp1[0])>fabs(pp0[1]-pp1[1]); - mreal d10,d11,d12, c10,c11,c12, b; - - d10 = pp1[0]-pp0[0]; d11 = pp1[1]-pp0[1]; - dd = sqrt(d10*d10 + d11*d11); - if(dd<1e-5) return; // points lies on the vertical line - b = PenWidth*PenWidth; - - d12 = pp1[2]-pp0[2]; - c10 = cc1[0]-cc0[0]; c11 = cc1[1]-cc0[1]; - c12 = cc1[2]-cc0[2]; //c13 = cc1[3]-cc0[3]; - - dxv = d11/dd; dyv =-d10/dd; - dxu = d10/dd; dyu = d11/dd; - - x1 = imin(long(pp0[0]),long(pp1[0])); // bounding box - y1 = imin(long(pp0[1]),long(pp1[1])); - x2 = imax(long(pp0[0]),long(pp1[0])); - y2 = imax(long(pp0[1]),long(pp1[1])); - x1 -= int(pw+3.5); y1 -= int(pw+3.5); - x2 += int(pw+3.5); y2 += int(pw+3.5); - x1=x1>nx1?x1:nx1; x2=x2ny1?y1:ny1; y2=y2x2 || y1>y2) return; - - bool aa=UseAlpha; - register mreal u,v,xx,yy; - register long i,j; - register bool tt; - UseAlpha = true; - if(hor) for(i=x1;i<=x2;i++) - { - y1 = int(pp0[1]+(pp1[1]-pp0[1])*(i-pp0[0])/(pp1[0]-pp0[0]) - pw - 3.5); - y2 = int(pp0[1]+(pp1[1]-pp0[1])*(i-pp0[0])/(pp1[0]-pp0[0]) + pw + 3.5); - y1=y1>ny1?y1:ny1; y2=y2y2) continue; - for(j=y1;j<=y2;j++) - { - xx = (i-pp0[0]); yy = (j-pp0[1]); - u = dxu*xx+dyu*yy; v = dxv*xx+dyv*yy; v = v*v; - if(u<0) { v += u*u; u = 0; } - else if(u>dd) { v += (u-dd)*(u-dd); u = dd; } - if(v>b) continue; - tt = all || (PDef & (1<nx1?x1:nx1; x2=x2x2) continue; - - for(i=x1;i<=x2;i++) - { - xx = (i-pp0[0]); yy = (j-pp0[1]); - u = dxu*xx+dyu*yy; v = dxv*xx+dyv*yy; v = v*v; - if(u<0) { v += u*u; u = 0; } - else if(u>dd) { v += (u-dd)*(u-dd); u = dd; } - if(v>b) continue; - tt = all || (PDef & (1<': - p[0] = pp[0]-ss/2; p[1] = pp[1]-ss; p[3] = pp[0]+ss; p[4] = pp[1]; - line_plot(p,p+3,CDef,CDef); - p[0] = pp[0]-ss/2; p[1] = pp[1]+ss; p[3] = pp[0]+ss; p[4] = pp[1]; - line_plot(p,p+3,CDef,CDef); - p[0] = p[3] = pp[0]-ss/2; p[1] = pp[1]-ss; p[4] = pp[1]+ss; - line_plot(p,p+3,CDef,CDef); - break; - case 'O': - for(i=long(-ss);i<=long(ss);i++) for(j=long(-ss);j<=long(ss);j++) - { - if(i*i+j*j>=ss*ss) continue; - pnt_plot(long(pp[0])+i,long(pp[1])+j,zv,cs); - } - case 'o': - for(i=long(-4*ss);i<=long(4*ss);i++) - pnt_plot(long(pp[0]+ss*cos(i*M_PI_4/ss)), - long(pp[1]+ss*sin(i*M_PI_4/ss)),zv,cs); - break; - } - PDef = pd; PenWidth = pw; - } -} -//----------------------------------------------------------------------------- -void mglGraphAB::pnt_plot(long,long,mreal,unsigned char [4]){} -//----------------------------------------------------------------------------- diff --git a/mgl/mgl_zb2.cpp b/mgl/mgl_zb2.cpp deleted file mode 100644 index e2e5f0c..0000000 --- a/mgl/mgl_zb2.cpp +++ /dev/null @@ -1,790 +0,0 @@ -/*************************************************************************** - * mgl_zb2.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include "mgl/mgl_ab.h" -//----------------------------------------------------------------------------- -// -// Low level plot functions for ZBuffer -// -//----------------------------------------------------------------------------- -void mglGraphAB::curv_plot(long n,mreal *pp,bool *tt) -{ - register long i; - mreal *p; - if(!pp || n<2) return; - PostScale(pp,n); - for(i=0;i='A' && (!tt || tt[n-1])) arrow_plot(pp+3*n-3,pp+3*n-6,Arrow1); - if(Arrow2>='A' && (!tt || tt[0])) arrow_plot(pp,pp+3,Arrow2); -} -//----------------------------------------------------------------------------- -void mglGraphAB::curv_plot(long n,mreal *pp,mreal *cc,bool *tt) -{ - register long i; - mreal *p,c1[4],c2[4],a; - mglColor c; - if(!pp || n<2) return; - PostScale(pp,n); - for(i=0;i1) a=1; if(a<-1) a=-1; - c = GetC(a,false); - c1[0] = c.r; c1[1] = c.g; c1[2] = c.b; c1[3] = (a+1)/2; - } - if(cc[i+1]) - { - a = (2*cc[i+1]-Cmin-Cmax)/(Cmax-Cmin); - if(a>1) a=1; if(a<-1) a=-1; - c = GetC(a,false); - c2[0] = c.r; c2[1] = c.g; c2[2] = c.b; c2[3] = (a+1)/2; - } - line_plot(p,p+3,c1,c2); - } - } -} -//----------------------------------------------------------------------------- -void mglGraphAB::curv_plot(long n,mreal *pp,bool *tt,long *nn) -{ - register long i,k=0; - if(!pp || !nn || n<2) return; - PostScale(pp,n); - mreal *p1,*p2; - for(i=0;i1) { dx=(n-1)/(MeshNum-1); dy=(m-1)/(MeshNum-1); } - if(!DrawFace) { dx=(n-1)/9; dy=(m-1)/9; } - if(dx<1) dx=1; - if(dy<1) dy=1; - if(!pp || n<2 || m<2) return; - if(how<0) how = -how; - else PostScale(pp,n*m); - if(how&2) for(i=0;i1e-10 ? pc/sqrt(p1*p2) : NAN; -} -//----------------------------------------------------------------------------- -void mglGraphAB::surf3_plot(long n,long m,long *kx1,long *kx2,long *ky1,long *ky2, long *kz,mreal *pp,mreal *cc,mreal *kk,mreal *nn,bool wire) -{ - if(!DrawFace) wire=true; //return; //wire=true; - register long i,j,k,i0,ii,jj; - long id[12],us[12],ni; - mreal d,d0,p[9],s[9],*c0,*c1,*c2=cc; - LightScale(); // set up light source - - for(i=0;i=0) id[ni++] = kx1[i0]; - if(ky1[i0]>=0) id[ni++] = ky1[i0]; - if(kx1[i0+n]>=0) id[ni++] = kx1[i0+n]; - if(ky1[i0+1]>=0) id[ni++] = ky1[i0+1]; - if(kz[i0]>=0) id[ni++] = kz[i0]; - if(kz[i0+1]>=0) id[ni++] = kz[i0+1]; - if(kz[i0+n+1]>=0) id[ni++] = kz[i0+n+1]; - if(kz[i0+n]>=0) id[ni++] = kz[i0+n]; - if(kx2[i0]>=0) id[ni++] = kx2[i0]; - if(ky2[i0]>=0) id[ni++] = ky2[i0]; - if(kx2[i0+n]>=0) id[ni++] = kx2[i0+n]; - if(ky2[i0+1]>=0) id[ni++] = ky2[i0+1]; - if(ni<3) continue; - // remove points which is too close to first one - for(jj=1;jj1e-5) jj++; - else - { ni--; for(ii=jj;iid0) { d0=d; i0=ii; } - } - if(i0<0) break; // no more triangles. NOTE: should be never here - jj = i0; us[jj]=1; - memcpy(p+6,pp+3*id[jj],3*sizeof(mreal)); - memcpy(s+6,nn+3*id[jj],3*sizeof(mreal)); - PostScale(p+6,1); NormScale(s+6,1); - c2 = cc ? cc+4*id[jj] : CDef; - if(!wire) - { - // smoothing only for Cartesian - if(!fx && !fy && !fz) - { - if(proj) trig_plot_n(p,p+6,p+3,c0,c1,c2,s,s+6,s+3); - else trig_plot_n(p,p+3,p+6,c0,c1,c2,s,s+3,s+6); - } - else - { - if(proj) trig_plot(p,p+6,p+3,c0,c1,c2); - else trig_plot(p,p+3,p+6,c0,c1,c2); - } - } - else line_plot(p+3,p+6,c1,c2,true); - memcpy(p+3,p+6,3*sizeof(mreal)); c1=c2; - memcpy(s+3,s+6,3*sizeof(mreal)); - } - if(wire) line_plot(p,p+6,c0,c2,true); - } -} -//----------------------------------------------------------------------------- -void mglGraphAB::axial_plot(long n,mreal *pp,long *nn,long np, bool wire) -{ - if(!DrawFace) wire=true; - register long i,j; - bool g1,g2; - mreal r1,r2,y1,y2,c1,s1,ph,p1[6],p2[6],n1[6],n2[6],d; - if(!pp || !nn) return; - LightScale(); // set up light source - long k0=0,k1=1,k2=2; - if(AxialDir=='y') { k0=0;k1=2;k2=1; } - if(AxialDir=='x') { k0=2;k1=1;k2=0; } - for(i=0;i=0) - { - d = pp[3*nn[nn[i]]+1]-y2; - n1[k0+3] = -d*c1; n1[k2+3] = pp[3*nn[nn[i]]]-r2; n1[k1+3] = -d*s1; - } - else - { n1[3] = n1[0]; n1[4] = n1[1]; n1[5] = n1[2]; } - g1 = ScalePoint(p1[0],p1[1],p1[2]) && ScalePoint(p1[3],p1[4],p1[5]); - PostScale(p1,2); - NormScale(n1,2); - if(g1 && g2) - { - if(wire) - { - line_plot(p1,p1+3,CDef,CDef,true); - line_plot(p1,p2,CDef,CDef,true); - line_plot(p1+3,p2+3,CDef,CDef,true); - line_plot(p2,p2+3,CDef,CDef,true); - } - else - { - if((!fx && !fy && !fz)) // ����������� ������ ��� ���������� �.�. - quad_plot_n(p1,p1+3,p2,p2+3,CDef,CDef,CDef,CDef,n1,n1+3,n2,n2+3); - else - quad_plot(p1,p1+3,p2,p2+3,CDef,CDef,CDef,CDef); - } - } - memcpy(p2,p1,6*sizeof(mreal)); - memcpy(n2,n1,6*sizeof(mreal)); - g2 = g1; - } - } -} -//----------------------------------------------------------------------------- -void mglGraphAB::quads_plot(long n,mreal *pp,mreal *cc,bool *tt) -{ -// if(!DrawFace) return; - register long i; - mreal *p; - mreal *c1=CDef,*c2=CDef,*c3=CDef,*c4=CDef; - PostScale(pp,4*n); LightScale(); - for(i=0;i1)?cmap[1]:cmap[0]; - s1[3] = s2[3] = AlphaDef; - PostScale(pp,2*n); - long pOld = PDef; - PDef = 0xffff; - for(i=0;i1)?cmap[1]:cmap[0]; - s1[3] = s2[3] = AlphaDef; - PostScale(pp,2*n); - long pOld = PDef; - PDef = 0xffff; - for(i=0;i255? 255 : a1+a2; - } -} -//----------------------------------------------------------------------------- -void mglGraphAB::Glyph(mreal x, mreal y, mreal f, int s, long j, char col) -{ - int ss=s&3; - f /= fnt->GetFact(ss); - mglColor cc = mglColor(col); - if(!cc.Valid()) cc = mglColor(CDef[0],CDef[1],CDef[2]); - mreal c[4]={cc.r,cc.g,cc.b,CDef[3]}; - if(s&8) glyph_line(x,y,f,c,!(s&4)); - else if(s&4) glyph_wire(x,y,f,fnt->GetNl(ss,j),fnt->GetLn(ss,j),c); - else glyph_fill(x,y,f,fnt->GetNt(ss,j),fnt->GetTr(ss,j),c); -} -//----------------------------------------------------------------------------- -void mglGraphAB::glyph_fill(mreal x,mreal y, mreal f, int nt, const short *trig, mreal *c) -{ - long ik,ii; - mreal p[12], pw = Width>2 ? fabs(PenWidth) : 1e-5*Width; - if(!trig || nt<=0) return; - for(ik=0;ik2 ? fabs(PenWidth) : 1e-5*Width; - unsigned pdef=PDef; PDef = 0xffff; - mreal opw=PenWidth; PenWidth=1; - - mreal dy = 0.004; - p[0]=x; p[1]=y+dy; p[2]=0; - p[3]=fabs(f)+x; p[4]=y+dy; p[5]=0; - p[6]=x; p[7]=y-dy; p[8]=0; - p[9]=fabs(f)+x; p[10]=y-dy; p[11]=0; - PostScale(p,4); - if(solid) - { - p[2]+=pw; p[5]+=pw; p[8]+=pw; p[11]+=pw; - quad_draw(p,p+3,p+6,p+9,c,c,c,c); - } - else - { - line_draw(p,p+3,c,c); - line_draw(p+9,p+3,c,c); - line_draw(p,p+6,c,c); - line_draw(p+9,p+6,c,c); - } - PDef = pdef; PenWidth=opw; -} -//----------------------------------------------------------------------------- diff --git a/mgl2cpp.cbp b/mgl2cpp.cbp deleted file mode 100644 index eedf636..0000000 --- a/mgl2cpp.cbp +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - diff --git a/mgl2eps.cbp b/mgl2eps.cbp deleted file mode 100644 index ff361ae..0000000 --- a/mgl2eps.cbp +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - diff --git a/mgl2gif.cbp b/mgl2gif.cbp deleted file mode 100644 index 39e8ef0..0000000 --- a/mgl2gif.cbp +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - diff --git a/mgl2png.cbp b/mgl2png.cbp deleted file mode 100644 index cc3cff0..0000000 --- a/mgl2png.cbp +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - diff --git a/mgl2svg.cbp b/mgl2svg.cbp deleted file mode 100644 index 4ca1409..0000000 --- a/mgl2svg.cbp +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - diff --git a/mgl_example.cbp b/mgl_example.cbp deleted file mode 100644 index 24db98b..0000000 --- a/mgl_example.cbp +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - diff --git a/mglview.cbp b/mglview.cbp deleted file mode 100644 index f17d76e..0000000 --- a/mglview.cbp +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - diff --git a/sample.csv b/sample.csv new file mode 100644 index 0000000..506709a --- /dev/null +++ b/sample.csv @@ -0,0 +1,113 @@ +-0.001 -0.006 32.97 +0.076 -0.074 33.13 +0.067 0.073 32.52 +-0.078 0.064 32.72 +-0.069 -0.083 33.36 +0.158 -0.149 33.19 +0.212 0.007 32.48 +0.143 0.155 31.93 +-0.013 0.209 31.88 +-0.16 0.14 32.34 +-0.217 -0.016 33.03 +-0.146 -0.165 33.64 +0.012 -0.22 33.7 +0.227 -0.217 33.16 +0.304 -0.074 32.48 +0.297 0.087 31.81 +0.211 0.225 31.37 +0.068 0.3 31.23 +-0.094 0.294 31.41 +-0.23 0.208 31.87 +-0.305 0.065 32.51 +-0.299 -0.097 33.19 +-0.213 -0.235 33.79 +-0.069 -0.309 33.97 +0.093 -0.302 33.71 +0.293 -0.285 33.03 +0.378 -0.152 32.37 +0.404 0.005 31.7 +0.37 0.16 31.12 +0.279 0.29 30.69 +0.144 0.374 30.52 +-0.011 0.4 30.59 +-0.166 0.366 30.87 +-0.295 0.276 31.34 +-0.379 0.142 31.93 +-0.407 -0.015 32.58 +-0.372 -0.17 33.22 +-0.28 -0.3 33.78 +-0.144 -0.385 34.08 +0.012 -0.411 33.96 +0.166 -0.375 33.58 +0.369 -0.372 32.72 +0.463 -0.241 32.06 +0.512 -0.084 31.39 +0.512 0.078 30.74 +0.461 0.233 30.19 +0.365 0.364 29.79 +0.233 0.46 29.57 +0.08 0.509 29.56 +-0.083 0.509 29.72 +-0.238 0.458 30.08 +-0.368 0.363 30.57 +-0.465 0.231 31.13 +-0.515 0.076 31.76 +-0.514 -0.088 32.41 +-0.464 -0.243 33.01 +-0.366 -0.375 33.53 +-0.235 -0.47 33.95 +-0.077 -0.519 33.95 +0.085 -0.517 33.69 +0.239 -0.466 33.25 +0.425 -0.449 32.24 +0.525 -0.322 31.65 +0.59 -0.176 30.98 +0.613 -0.017 30.35 +0.596 0.142 29.76 +0.537 0.292 29.25 +0.442 0.421 28.85 +0.317 0.521 28.62 +0.17 0.586 28.53 +0.011 0.61 28.61 +-0.147 0.591 28.87 +-0.297 0.534 29.25 +-0.425 0.439 29.73 +-0.525 0.315 30.28 +-0.59 0.168 30.86 +-0.613 0.008 31.49 +-0.597 -0.153 32.08 +-0.537 -0.303 32.66 +-0.441 -0.432 33.16 +-0.316 -0.531 33.56 +-0.168 -0.595 33.69 +-0.009 -0.617 33.5 +0.151 -0.6 33.16 +0.3 -0.54 32.74 +0.48 -0.539 31.4 +0.588 -0.42 30.82 +0.665 -0.279 30.23 +0.709 -0.124 29.6 +0.717 0.038 28.99 +0.69 0.197 28.41 +0.628 0.345 27.92 +0.534 0.476 27.52 +0.414 0.583 27.25 +0.273 0.66 27.12 +0.119 0.705 27.12 +-0.041 0.713 27.28 +-0.201 0.687 27.59 +-0.349 0.624 28.01 +-0.48 0.531 28.48 +-0.587 0.412 29 +-0.665 0.27 29.57 +-0.709 0.116 30.13 +-0.718 -0.047 30.7 +-0.69 -0.206 31.29 +-0.628 -0.356 31.85 +-0.533 -0.487 32.4 +-0.413 -0.593 32.78 +-0.269 -0.671 32.96 +-0.114 -0.714 32.79 +0.047 -0.722 32.52 +0.205 -0.694 32.2 +0.353 -0.629 31.83 diff --git a/setup.py b/setup.py deleted file mode 100644 index 4d8b35d..0000000 --- a/setup.py +++ /dev/null @@ -1,38 +0,0 @@ -from distutils.core import setup, Extension -import os - -try: - source_dir=os.environ["CMAKE_SOURCE_DIR"] - mgl_dir="mgl/libmgl.so" -except KeyError: - source_dir="." - mgl_dir="mgl/.libs/libmgl.so" - -mgl_module = Extension('_mathgl', - sources=["lang/mgl_python.cpp"], - include_dirs=["%s/include" % source_dir], - extra_objects=[mgl_dir] - ) - -setup ( - name = "mathgl", - version = "1.8", - maintainer="Dmitry Kulagin", - maintainer_email="dik@ufp.appl.sci-nnov.ru", - author="Alexey Balakin", - author_email= "balakin@appl.sci-nnov.ru", - license="Same terms as MathGL", - platforms = ["any"], - url = "http://mathgl.sf.net", - description = "Python interface for MathGL", - long_description = "MathGL is a library for the plotting of the data \ - MathGL is a free library of fast C++ routines for the plotting \ - of the data varied in one or more dimensions. It uses OpenGL \ - (www.opengl.org) for the plotting. Also there is a simple window \ - interface based on GLUT. This provides high compatibility with \ - any operating system (really any which has OpenGL-like libraries). \ - Python interface for MathGL", - package_dir = {"": "lang"}, - py_modules = ["mathgl"], - ext_modules = [mgl_module] - ) diff --git a/mgl/CMakeLists.txt b/src/CMakeLists.txt similarity index 77% rename from mgl/CMakeLists.txt rename to src/CMakeLists.txt index b2e9dfa..60712b8 100644 --- a/mgl/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,11 +1,9 @@ -set(mgl_src -mgl_1d.cpp mgl_combi.cpp mgl_def_font.cpp mgl_fit.cpp mgl_parse.cpp -mgl_2d.cpp mgl_cont.cpp mgl_eps.cpp mgl_flow.cpp mgl_pde.cpp -mgl_3d.cpp mgl_crust.cpp mgl_evalc.cpp mgl_font.cpp mgl_tex_table.cpp -mgl_ab.cpp mgl_data_cf.cpp mgl_eval.cpp mgl_gl.cpp mgl_vect.cpp -mgl_addon.cpp mgl_data.cpp mgl_exec.cpp mgl_idtf.cpp mgl_zb2.cpp -mgl_axis.cpp mgl_data_io.cpp mgl_export.cpp mgl_zb.cpp mgl_evalp.cpp -mgl_c.cpp mgl_data_png.cpp mgl_f.cpp mgl_main.cpp +set(mgl_src +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 opengl.cpp other.cpp parser.cpp pde.cpp pixel.cpp +plot.cpp prim.cpp surf.cpp tex_table.cpp vect.cpp volume.cpp #window.cpp ) add_library(mgl SHARED ${mgl_src}) @@ -67,7 +65,7 @@ if(use_hdf5 OR use_hdf5_18) endif(use_hdf5 OR use_hdf5_18) if(use_hdf4) - target_link_libraries(mgl ${HDF4_LIB}) + target_link_libraries(mgl ${HDF4MF_LIB} ${HDF4_LIB}) add_definitions(-DHAVE_HDF4) include_directories(${HDF4_INCLUDE_DIR}) endif(use_hdf4) @@ -89,7 +87,7 @@ if(UNIX) add_definitions(-DNO_COLOR_ARRAY) endif(UNIX) -set_target_properties(mgl PROPERTIES SOVERSION 5.0.0) +set_target_properties(mgl PROPERTIES SOVERSION 6.0.0) install( TARGETS mgl mgl-static RUNTIME DESTINATION bin diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..8a75374 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,44 @@ +AM_CXXFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include + +lib_LTLIBRARIES = libmgl.la + + +libmgl_la_LIBADD = $(PNG_LIBS) $(GL_LIBS) $(LOPENMP) +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 = \ +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 eval.cpp \ +evalp.cpp exec.cpp export.cpp fit.cpp font.cpp \ +opengl.cpp other.cpp parser.cpp tex_table.cpp pde.cpp \ +pixel.cpp plot.cpp prim.cpp surf.cpp vect.cpp \ +volume.cpp export_3d.cpp diff --git a/mgl/Makefile.in b/src/Makefile.in similarity index 58% rename from mgl/Makefile.in rename to src/Makefile.in index 6a1ad71..f93a942 100644 --- a/mgl/Makefile.in +++ b/src/Makefile.in @@ -34,18 +34,13 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@USE_QT_TRUE@am__append_1 = -DWITH_QT -@USE_WX_TRUE@am__append_2 = -DWITH_WX -@USE_FLTK_TRUE@am__append_3 = -DWITH_FLTK -@USE_GLUT_TRUE@am__append_4 = -DWITH_GLUT -@USE_PTHREAD_TRUE@am__append_5 = $(PTHREAD_LIBS) -@USE_GSL_TRUE@am__append_6 = $(GSL_LIBS) -@USE_HDF4_TRUE@am__append_7 = $(HDF4_LIBS) -@USE_HDF5_TRUE@am__append_8 = $(HDF5_LIBS) -@USE_GIF_TRUE@am__append_9 = $(GIF_LIBS) -@USE_JPEG_TRUE@am__append_10 = $(JPEG_LIBS) -@USE_U3D_TRUE@am__append_11 = $(U3D_LIBS) -subdir = mgl +@USE_PTHREAD_TRUE@am__append_1 = $(PTHREAD_LIBS) +@USE_GSL_TRUE@am__append_2 = $(GSL_LIBS) +@USE_HDF4_TRUE@am__append_3 = $(HDF4_LIBS) +@USE_HDF5_TRUE@am__append_4 = $(HDF5_LIBS) +@USE_JPEG_TRUE@am__append_5 = $(JPEG_LIBS) +@USE_U3D_TRUE@am__append_6 = $(U3D_LIBS) +subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/autotroll.m4 \ @@ -84,30 +79,24 @@ am__DEPENDENCIES_1 = @USE_GSL_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) @USE_HDF4_TRUE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1) @USE_HDF5_TRUE@am__DEPENDENCIES_5 = $(am__DEPENDENCIES_1) -@USE_GIF_TRUE@am__DEPENDENCIES_6 = $(am__DEPENDENCIES_1) -@USE_JPEG_TRUE@am__DEPENDENCIES_7 = $(am__DEPENDENCIES_1) -@USE_U3D_TRUE@am__DEPENDENCIES_8 = $(am__DEPENDENCIES_1) +@USE_JPEG_TRUE@am__DEPENDENCIES_6 = $(am__DEPENDENCIES_1) +@USE_U3D_TRUE@am__DEPENDENCIES_7 = $(am__DEPENDENCIES_1) libmgl_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \ - $(am__DEPENDENCIES_6) $(am__DEPENDENCIES_7) \ - $(am__DEPENDENCIES_8) -am_libmgl_la_OBJECTS = libmgl_la-mgl_data_cf.lo libmgl_la-mgl_axis.lo \ - libmgl_la-mgl_data_png.lo libmgl_la-mgl_zb2.lo \ - libmgl_la-mgl_c.lo libmgl_la-mgl_eps.lo libmgl_la-mgl_font.lo \ - libmgl_la-mgl_zb.lo libmgl_la-mgl_combi.lo \ - libmgl_la-mgl_eval.lo libmgl_la-mgl_gl.lo \ - libmgl_la-mgl_def_font.lo libmgl_la-mgl_1d.lo \ - libmgl_la-mgl_cont.lo libmgl_la-mgl_exec.lo \ - libmgl_la-mgl_tex_table.lo libmgl_la-mgl_2d.lo \ - libmgl_la-mgl_crust.lo libmgl_la-mgl_export.lo \ - libmgl_la-mgl_main.lo libmgl_la-mgl_3d.lo \ - libmgl_la-mgl_data.lo libmgl_la-mgl_f.lo libmgl_la-mgl_idtf.lo \ - libmgl_la-mgl_ab.lo libmgl_la-mgl_data_io.lo \ - libmgl_la-mgl_flow.lo libmgl_la-mgl_vect.lo \ - libmgl_la-mgl_parse.lo libmgl_la-mgl_fit.lo \ - libmgl_la-mgl_pde.lo libmgl_la-mgl_evalc.lo \ - libmgl_la-mgl_addon.lo libmgl_la-mgl_evalp.lo + $(am__DEPENDENCIES_6) $(am__DEPENDENCIES_7) +am_libmgl_la_OBJECTS = libmgl_la-axis.lo libmgl_la-base_cf.lo \ + libmgl_la-base.lo libmgl_la-canvas_cf.lo libmgl_la-canvas.lo \ + libmgl_la-cont.lo libmgl_la-crust.lo libmgl_la-data.lo \ + libmgl_la-data_io.lo libmgl_la-data_new.lo \ + libmgl_la-data_op.lo libmgl_la-data_png.lo \ + libmgl_la-def_font.lo libmgl_la-export_2d.lo libmgl_la-eval.lo \ + libmgl_la-evalp.lo libmgl_la-exec.lo libmgl_la-export.lo \ + libmgl_la-fit.lo libmgl_la-font.lo libmgl_la-opengl.lo \ + libmgl_la-other.lo libmgl_la-parser.lo libmgl_la-tex_table.lo \ + libmgl_la-pde.lo libmgl_la-pixel.lo libmgl_la-plot.lo \ + libmgl_la-prim.lo libmgl_la-surf.lo libmgl_la-vect.lo \ + libmgl_la-volume.lo libmgl_la-export_3d.lo libmgl_la_OBJECTS = $(am_libmgl_la_OBJECTS) libmgl_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(libmgl_la_CXXFLAGS) \ @@ -163,10 +152,6 @@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLTK_FLAGS = @FLTK_FLAGS@ FLTK_LIBS = @FLTK_LIBS@ -GIF_FLAGS = @GIF_FLAGS@ -GIF_LIBS = @GIF_LIBS@ -GLUT_FLAGS = @GLUT_FLAGS@ -GLUT_LIBS = @GLUT_LIBS@ GL_LIBS = @GL_LIBS@ GREP = @GREP@ GSL_FLAGS = @GSL_FLAGS@ @@ -192,7 +177,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MGL_AGE = @MGL_AGE@ MGL_CURRENT = @MGL_CURRENT@ MGL_RELEASE = @MGL_RELEASE@ @@ -247,13 +231,10 @@ TMPDIR = @TMPDIR@ U3D_LIBS = @U3D_LIBS@ UIC = @UIC@ VERSION = @VERSION@ -WX_FLAGS = @WX_FLAGS@ -WX_LIBS = @WX_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -287,6 +268,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -307,27 +289,22 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libmgl.la -WIDGETS = $(am__append_1) $(am__append_2) $(am__append_3) \ - $(am__append_4) -libmgl_la_LIBADD = $(PNG_LIBS) $(GL_LIBS) $(LOPENMP) $(am__append_5) \ - $(am__append_6) $(am__append_7) $(am__append_8) \ - $(am__append_9) $(am__append_10) $(am__append_11) +libmgl_la_LIBADD = $(PNG_LIBS) $(GL_LIBS) $(LOPENMP) $(am__append_1) \ + $(am__append_2) $(am__append_3) $(am__append_4) \ + $(am__append_5) $(am__append_6) libmgl_la_LDFLAGS = -no-undefined -version-info $(MGL_CURRENT):$(MGL_REVISION):$(MGL_AGE) -libmgl_la_CXXFLAGS = $(WIDGETS) -DMGL_FONT_PATH=\"$(datadir)/$(PACKAGE)/fonts/\" \ - -DMOD_LIB_DIR=\"$(libdir)/mgl/\" $(HDF5_FLAGS) $(HDF4_FLAGS) $(GIF_FLAGS) $(JPEG_FLAGS) \ - $(TIFF_FLAGS) $(PNG_FLAGS) $(FLTK_FLAGS) $(ADDON_FLAGS) $(AM_CXXFLAGS) \ - $(PTHREAD_FLAGS) +libmgl_la_CXXFLAGS = \ + -DMOD_LIB_DIR=\"$(libdir)/mgl/\" $(HDF5_FLAGS) $(HDF4_FLAGS) $(JPEG_FLAGS) \ + $(PNG_FLAGS) $(FLTK_FLAGS) $(ADDON_FLAGS) $(AM_CXXFLAGS) $(PTHREAD_FLAGS) libmgl_la_SOURCES = \ -mgl_data_cf.cpp mgl_axis.cpp mgl_data_png.cpp mgl_zb2.cpp \ -mgl_c.cpp mgl_eps.cpp mgl_font.cpp mgl_zb.cpp \ -mgl_combi.cpp mgl_eval.cpp mgl_gl.cpp mgl_def_font.cpp\ -mgl_1d.cpp mgl_cont.cpp mgl_exec.cpp mgl_tex_table.cpp\ -mgl_2d.cpp mgl_crust.cpp mgl_export.cpp mgl_main.cpp \ -mgl_3d.cpp mgl_data.cpp mgl_f.cpp mgl_idtf.cpp \ -mgl_ab.cpp mgl_data_io.cpp mgl_flow.cpp mgl_vect.cpp \ -mgl_parse.cpp mgl_fit.cpp mgl_pde.cpp mgl_evalc.cpp \ -mgl_addon.cpp mgl_evalp.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 eval.cpp \ +evalp.cpp exec.cpp export.cpp fit.cpp font.cpp \ +opengl.cpp other.cpp parser.cpp tex_table.cpp pde.cpp \ +pixel.cpp plot.cpp prim.cpp surf.cpp vect.cpp \ +volume.cpp export_3d.cpp all: all-am @@ -342,9 +319,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu mgl/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu mgl/Makefile + $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -403,40 +380,38 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_1d.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_2d.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_3d.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_ab.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_addon.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_axis.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_c.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_combi.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_cont.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_crust.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_data.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_data_cf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_data_io.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_data_png.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_def_font.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_eps.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_eval.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_evalc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_evalp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_exec.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_export.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_f.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_fit.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_flow.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_font.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_gl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_idtf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_main.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_parse.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_pde.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_tex_table.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_vect.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_zb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-mgl_zb2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-axis.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-base.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-base_cf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-canvas.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-canvas_cf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-cont.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-crust.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-data.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-data_io.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-data_new.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-data_op.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-data_png.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-def_font.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-eval.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-evalp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-exec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-export.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-export_2d.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-export_3d.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-fit.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-font.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-opengl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-other.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-parser.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-pde.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-pixel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-plot.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-prim.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-surf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-tex_table.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-vect.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_la-volume.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -459,243 +434,229 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< -libmgl_la-mgl_data_cf.lo: mgl_data_cf.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_data_cf.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_data_cf.Tpo -c -o libmgl_la-mgl_data_cf.lo `test -f 'mgl_data_cf.cpp' || echo '$(srcdir)/'`mgl_data_cf.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_data_cf.Tpo $(DEPDIR)/libmgl_la-mgl_data_cf.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_data_cf.cpp' object='libmgl_la-mgl_data_cf.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-axis.lo: axis.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-axis.lo -MD -MP -MF $(DEPDIR)/libmgl_la-axis.Tpo -c -o libmgl_la-axis.lo `test -f 'axis.cpp' || echo '$(srcdir)/'`axis.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-axis.Tpo $(DEPDIR)/libmgl_la-axis.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='axis.cpp' object='libmgl_la-axis.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_data_cf.lo `test -f 'mgl_data_cf.cpp' || echo '$(srcdir)/'`mgl_data_cf.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-axis.lo `test -f 'axis.cpp' || echo '$(srcdir)/'`axis.cpp -libmgl_la-mgl_axis.lo: mgl_axis.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_axis.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_axis.Tpo -c -o libmgl_la-mgl_axis.lo `test -f 'mgl_axis.cpp' || echo '$(srcdir)/'`mgl_axis.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_axis.Tpo $(DEPDIR)/libmgl_la-mgl_axis.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_axis.cpp' object='libmgl_la-mgl_axis.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-base_cf.lo: base_cf.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-base_cf.lo -MD -MP -MF $(DEPDIR)/libmgl_la-base_cf.Tpo -c -o libmgl_la-base_cf.lo `test -f 'base_cf.cpp' || echo '$(srcdir)/'`base_cf.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-base_cf.Tpo $(DEPDIR)/libmgl_la-base_cf.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='base_cf.cpp' object='libmgl_la-base_cf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_axis.lo `test -f 'mgl_axis.cpp' || echo '$(srcdir)/'`mgl_axis.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-base_cf.lo `test -f 'base_cf.cpp' || echo '$(srcdir)/'`base_cf.cpp -libmgl_la-mgl_data_png.lo: mgl_data_png.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_data_png.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_data_png.Tpo -c -o libmgl_la-mgl_data_png.lo `test -f 'mgl_data_png.cpp' || echo '$(srcdir)/'`mgl_data_png.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_data_png.Tpo $(DEPDIR)/libmgl_la-mgl_data_png.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_data_png.cpp' object='libmgl_la-mgl_data_png.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-base.lo: base.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-base.lo -MD -MP -MF $(DEPDIR)/libmgl_la-base.Tpo -c -o libmgl_la-base.lo `test -f 'base.cpp' || echo '$(srcdir)/'`base.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-base.Tpo $(DEPDIR)/libmgl_la-base.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='base.cpp' object='libmgl_la-base.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_data_png.lo `test -f 'mgl_data_png.cpp' || echo '$(srcdir)/'`mgl_data_png.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-base.lo `test -f 'base.cpp' || echo '$(srcdir)/'`base.cpp -libmgl_la-mgl_zb2.lo: mgl_zb2.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_zb2.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_zb2.Tpo -c -o libmgl_la-mgl_zb2.lo `test -f 'mgl_zb2.cpp' || echo '$(srcdir)/'`mgl_zb2.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_zb2.Tpo $(DEPDIR)/libmgl_la-mgl_zb2.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_zb2.cpp' object='libmgl_la-mgl_zb2.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-canvas_cf.lo: canvas_cf.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-canvas_cf.lo -MD -MP -MF $(DEPDIR)/libmgl_la-canvas_cf.Tpo -c -o libmgl_la-canvas_cf.lo `test -f 'canvas_cf.cpp' || echo '$(srcdir)/'`canvas_cf.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-canvas_cf.Tpo $(DEPDIR)/libmgl_la-canvas_cf.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='canvas_cf.cpp' object='libmgl_la-canvas_cf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_zb2.lo `test -f 'mgl_zb2.cpp' || echo '$(srcdir)/'`mgl_zb2.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-canvas_cf.lo `test -f 'canvas_cf.cpp' || echo '$(srcdir)/'`canvas_cf.cpp -libmgl_la-mgl_c.lo: mgl_c.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_c.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_c.Tpo -c -o libmgl_la-mgl_c.lo `test -f 'mgl_c.cpp' || echo '$(srcdir)/'`mgl_c.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_c.Tpo $(DEPDIR)/libmgl_la-mgl_c.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_c.cpp' object='libmgl_la-mgl_c.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-canvas.lo: canvas.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-canvas.lo -MD -MP -MF $(DEPDIR)/libmgl_la-canvas.Tpo -c -o libmgl_la-canvas.lo `test -f 'canvas.cpp' || echo '$(srcdir)/'`canvas.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-canvas.Tpo $(DEPDIR)/libmgl_la-canvas.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='canvas.cpp' object='libmgl_la-canvas.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_c.lo `test -f 'mgl_c.cpp' || echo '$(srcdir)/'`mgl_c.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-canvas.lo `test -f 'canvas.cpp' || echo '$(srcdir)/'`canvas.cpp -libmgl_la-mgl_eps.lo: mgl_eps.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_eps.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_eps.Tpo -c -o libmgl_la-mgl_eps.lo `test -f 'mgl_eps.cpp' || echo '$(srcdir)/'`mgl_eps.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_eps.Tpo $(DEPDIR)/libmgl_la-mgl_eps.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_eps.cpp' object='libmgl_la-mgl_eps.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-cont.lo: cont.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-cont.lo -MD -MP -MF $(DEPDIR)/libmgl_la-cont.Tpo -c -o libmgl_la-cont.lo `test -f 'cont.cpp' || echo '$(srcdir)/'`cont.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-cont.Tpo $(DEPDIR)/libmgl_la-cont.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='cont.cpp' object='libmgl_la-cont.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_eps.lo `test -f 'mgl_eps.cpp' || echo '$(srcdir)/'`mgl_eps.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-cont.lo `test -f 'cont.cpp' || echo '$(srcdir)/'`cont.cpp -libmgl_la-mgl_font.lo: mgl_font.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_font.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_font.Tpo -c -o libmgl_la-mgl_font.lo `test -f 'mgl_font.cpp' || echo '$(srcdir)/'`mgl_font.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_font.Tpo $(DEPDIR)/libmgl_la-mgl_font.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_font.cpp' object='libmgl_la-mgl_font.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-crust.lo: crust.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-crust.lo -MD -MP -MF $(DEPDIR)/libmgl_la-crust.Tpo -c -o libmgl_la-crust.lo `test -f 'crust.cpp' || echo '$(srcdir)/'`crust.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-crust.Tpo $(DEPDIR)/libmgl_la-crust.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='crust.cpp' object='libmgl_la-crust.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_font.lo `test -f 'mgl_font.cpp' || echo '$(srcdir)/'`mgl_font.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-crust.lo `test -f 'crust.cpp' || echo '$(srcdir)/'`crust.cpp -libmgl_la-mgl_zb.lo: mgl_zb.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_zb.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_zb.Tpo -c -o libmgl_la-mgl_zb.lo `test -f 'mgl_zb.cpp' || echo '$(srcdir)/'`mgl_zb.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_zb.Tpo $(DEPDIR)/libmgl_la-mgl_zb.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_zb.cpp' object='libmgl_la-mgl_zb.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-data.lo: data.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-data.lo -MD -MP -MF $(DEPDIR)/libmgl_la-data.Tpo -c -o libmgl_la-data.lo `test -f 'data.cpp' || echo '$(srcdir)/'`data.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-data.Tpo $(DEPDIR)/libmgl_la-data.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='data.cpp' object='libmgl_la-data.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_zb.lo `test -f 'mgl_zb.cpp' || echo '$(srcdir)/'`mgl_zb.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-data.lo `test -f 'data.cpp' || echo '$(srcdir)/'`data.cpp -libmgl_la-mgl_combi.lo: mgl_combi.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_combi.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_combi.Tpo -c -o libmgl_la-mgl_combi.lo `test -f 'mgl_combi.cpp' || echo '$(srcdir)/'`mgl_combi.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_combi.Tpo $(DEPDIR)/libmgl_la-mgl_combi.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_combi.cpp' object='libmgl_la-mgl_combi.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-data_io.lo: data_io.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-data_io.lo -MD -MP -MF $(DEPDIR)/libmgl_la-data_io.Tpo -c -o libmgl_la-data_io.lo `test -f 'data_io.cpp' || echo '$(srcdir)/'`data_io.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-data_io.Tpo $(DEPDIR)/libmgl_la-data_io.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='data_io.cpp' object='libmgl_la-data_io.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_combi.lo `test -f 'mgl_combi.cpp' || echo '$(srcdir)/'`mgl_combi.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-data_io.lo `test -f 'data_io.cpp' || echo '$(srcdir)/'`data_io.cpp -libmgl_la-mgl_eval.lo: mgl_eval.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_eval.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_eval.Tpo -c -o libmgl_la-mgl_eval.lo `test -f 'mgl_eval.cpp' || echo '$(srcdir)/'`mgl_eval.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_eval.Tpo $(DEPDIR)/libmgl_la-mgl_eval.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_eval.cpp' object='libmgl_la-mgl_eval.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-data_new.lo: data_new.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-data_new.lo -MD -MP -MF $(DEPDIR)/libmgl_la-data_new.Tpo -c -o libmgl_la-data_new.lo `test -f 'data_new.cpp' || echo '$(srcdir)/'`data_new.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-data_new.Tpo $(DEPDIR)/libmgl_la-data_new.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='data_new.cpp' object='libmgl_la-data_new.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_eval.lo `test -f 'mgl_eval.cpp' || echo '$(srcdir)/'`mgl_eval.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-data_new.lo `test -f 'data_new.cpp' || echo '$(srcdir)/'`data_new.cpp -libmgl_la-mgl_gl.lo: mgl_gl.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_gl.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_gl.Tpo -c -o libmgl_la-mgl_gl.lo `test -f 'mgl_gl.cpp' || echo '$(srcdir)/'`mgl_gl.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_gl.Tpo $(DEPDIR)/libmgl_la-mgl_gl.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_gl.cpp' object='libmgl_la-mgl_gl.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-data_op.lo: data_op.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-data_op.lo -MD -MP -MF $(DEPDIR)/libmgl_la-data_op.Tpo -c -o libmgl_la-data_op.lo `test -f 'data_op.cpp' || echo '$(srcdir)/'`data_op.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-data_op.Tpo $(DEPDIR)/libmgl_la-data_op.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='data_op.cpp' object='libmgl_la-data_op.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_gl.lo `test -f 'mgl_gl.cpp' || echo '$(srcdir)/'`mgl_gl.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-data_op.lo `test -f 'data_op.cpp' || echo '$(srcdir)/'`data_op.cpp -libmgl_la-mgl_def_font.lo: mgl_def_font.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_def_font.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_def_font.Tpo -c -o libmgl_la-mgl_def_font.lo `test -f 'mgl_def_font.cpp' || echo '$(srcdir)/'`mgl_def_font.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_def_font.Tpo $(DEPDIR)/libmgl_la-mgl_def_font.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_def_font.cpp' object='libmgl_la-mgl_def_font.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-data_png.lo: data_png.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-data_png.lo -MD -MP -MF $(DEPDIR)/libmgl_la-data_png.Tpo -c -o libmgl_la-data_png.lo `test -f 'data_png.cpp' || echo '$(srcdir)/'`data_png.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-data_png.Tpo $(DEPDIR)/libmgl_la-data_png.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='data_png.cpp' object='libmgl_la-data_png.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_def_font.lo `test -f 'mgl_def_font.cpp' || echo '$(srcdir)/'`mgl_def_font.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-data_png.lo `test -f 'data_png.cpp' || echo '$(srcdir)/'`data_png.cpp -libmgl_la-mgl_1d.lo: mgl_1d.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_1d.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_1d.Tpo -c -o libmgl_la-mgl_1d.lo `test -f 'mgl_1d.cpp' || echo '$(srcdir)/'`mgl_1d.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_1d.Tpo $(DEPDIR)/libmgl_la-mgl_1d.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_1d.cpp' object='libmgl_la-mgl_1d.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-def_font.lo: def_font.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-def_font.lo -MD -MP -MF $(DEPDIR)/libmgl_la-def_font.Tpo -c -o libmgl_la-def_font.lo `test -f 'def_font.cpp' || echo '$(srcdir)/'`def_font.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-def_font.Tpo $(DEPDIR)/libmgl_la-def_font.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='def_font.cpp' object='libmgl_la-def_font.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_1d.lo `test -f 'mgl_1d.cpp' || echo '$(srcdir)/'`mgl_1d.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-def_font.lo `test -f 'def_font.cpp' || echo '$(srcdir)/'`def_font.cpp -libmgl_la-mgl_cont.lo: mgl_cont.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_cont.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_cont.Tpo -c -o libmgl_la-mgl_cont.lo `test -f 'mgl_cont.cpp' || echo '$(srcdir)/'`mgl_cont.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_cont.Tpo $(DEPDIR)/libmgl_la-mgl_cont.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_cont.cpp' object='libmgl_la-mgl_cont.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-export_2d.lo: export_2d.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-export_2d.lo -MD -MP -MF $(DEPDIR)/libmgl_la-export_2d.Tpo -c -o libmgl_la-export_2d.lo `test -f 'export_2d.cpp' || echo '$(srcdir)/'`export_2d.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-export_2d.Tpo $(DEPDIR)/libmgl_la-export_2d.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='export_2d.cpp' object='libmgl_la-export_2d.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_cont.lo `test -f 'mgl_cont.cpp' || echo '$(srcdir)/'`mgl_cont.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-export_2d.lo `test -f 'export_2d.cpp' || echo '$(srcdir)/'`export_2d.cpp -libmgl_la-mgl_exec.lo: mgl_exec.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_exec.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_exec.Tpo -c -o libmgl_la-mgl_exec.lo `test -f 'mgl_exec.cpp' || echo '$(srcdir)/'`mgl_exec.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_exec.Tpo $(DEPDIR)/libmgl_la-mgl_exec.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_exec.cpp' object='libmgl_la-mgl_exec.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-eval.lo: eval.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-eval.lo -MD -MP -MF $(DEPDIR)/libmgl_la-eval.Tpo -c -o libmgl_la-eval.lo `test -f 'eval.cpp' || echo '$(srcdir)/'`eval.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-eval.Tpo $(DEPDIR)/libmgl_la-eval.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='eval.cpp' object='libmgl_la-eval.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_exec.lo `test -f 'mgl_exec.cpp' || echo '$(srcdir)/'`mgl_exec.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-eval.lo `test -f 'eval.cpp' || echo '$(srcdir)/'`eval.cpp -libmgl_la-mgl_tex_table.lo: mgl_tex_table.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_tex_table.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_tex_table.Tpo -c -o libmgl_la-mgl_tex_table.lo `test -f 'mgl_tex_table.cpp' || echo '$(srcdir)/'`mgl_tex_table.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_tex_table.Tpo $(DEPDIR)/libmgl_la-mgl_tex_table.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_tex_table.cpp' object='libmgl_la-mgl_tex_table.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-evalp.lo: evalp.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-evalp.lo -MD -MP -MF $(DEPDIR)/libmgl_la-evalp.Tpo -c -o libmgl_la-evalp.lo `test -f 'evalp.cpp' || echo '$(srcdir)/'`evalp.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-evalp.Tpo $(DEPDIR)/libmgl_la-evalp.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='evalp.cpp' object='libmgl_la-evalp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_tex_table.lo `test -f 'mgl_tex_table.cpp' || echo '$(srcdir)/'`mgl_tex_table.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-evalp.lo `test -f 'evalp.cpp' || echo '$(srcdir)/'`evalp.cpp -libmgl_la-mgl_2d.lo: mgl_2d.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_2d.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_2d.Tpo -c -o libmgl_la-mgl_2d.lo `test -f 'mgl_2d.cpp' || echo '$(srcdir)/'`mgl_2d.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_2d.Tpo $(DEPDIR)/libmgl_la-mgl_2d.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_2d.cpp' object='libmgl_la-mgl_2d.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-exec.lo: exec.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-exec.lo -MD -MP -MF $(DEPDIR)/libmgl_la-exec.Tpo -c -o libmgl_la-exec.lo `test -f 'exec.cpp' || echo '$(srcdir)/'`exec.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-exec.Tpo $(DEPDIR)/libmgl_la-exec.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='exec.cpp' object='libmgl_la-exec.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_2d.lo `test -f 'mgl_2d.cpp' || echo '$(srcdir)/'`mgl_2d.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-exec.lo `test -f 'exec.cpp' || echo '$(srcdir)/'`exec.cpp -libmgl_la-mgl_crust.lo: mgl_crust.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_crust.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_crust.Tpo -c -o libmgl_la-mgl_crust.lo `test -f 'mgl_crust.cpp' || echo '$(srcdir)/'`mgl_crust.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_crust.Tpo $(DEPDIR)/libmgl_la-mgl_crust.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_crust.cpp' object='libmgl_la-mgl_crust.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-export.lo: export.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-export.lo -MD -MP -MF $(DEPDIR)/libmgl_la-export.Tpo -c -o libmgl_la-export.lo `test -f 'export.cpp' || echo '$(srcdir)/'`export.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-export.Tpo $(DEPDIR)/libmgl_la-export.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='export.cpp' object='libmgl_la-export.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_crust.lo `test -f 'mgl_crust.cpp' || echo '$(srcdir)/'`mgl_crust.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-export.lo `test -f 'export.cpp' || echo '$(srcdir)/'`export.cpp -libmgl_la-mgl_export.lo: mgl_export.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_export.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_export.Tpo -c -o libmgl_la-mgl_export.lo `test -f 'mgl_export.cpp' || echo '$(srcdir)/'`mgl_export.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_export.Tpo $(DEPDIR)/libmgl_la-mgl_export.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_export.cpp' object='libmgl_la-mgl_export.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-fit.lo: fit.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-fit.lo -MD -MP -MF $(DEPDIR)/libmgl_la-fit.Tpo -c -o libmgl_la-fit.lo `test -f 'fit.cpp' || echo '$(srcdir)/'`fit.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-fit.Tpo $(DEPDIR)/libmgl_la-fit.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='fit.cpp' object='libmgl_la-fit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_export.lo `test -f 'mgl_export.cpp' || echo '$(srcdir)/'`mgl_export.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-fit.lo `test -f 'fit.cpp' || echo '$(srcdir)/'`fit.cpp -libmgl_la-mgl_main.lo: mgl_main.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_main.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_main.Tpo -c -o libmgl_la-mgl_main.lo `test -f 'mgl_main.cpp' || echo '$(srcdir)/'`mgl_main.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_main.Tpo $(DEPDIR)/libmgl_la-mgl_main.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_main.cpp' object='libmgl_la-mgl_main.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-font.lo: font.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-font.lo -MD -MP -MF $(DEPDIR)/libmgl_la-font.Tpo -c -o libmgl_la-font.lo `test -f 'font.cpp' || echo '$(srcdir)/'`font.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-font.Tpo $(DEPDIR)/libmgl_la-font.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='font.cpp' object='libmgl_la-font.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_main.lo `test -f 'mgl_main.cpp' || echo '$(srcdir)/'`mgl_main.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-font.lo `test -f 'font.cpp' || echo '$(srcdir)/'`font.cpp -libmgl_la-mgl_3d.lo: mgl_3d.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_3d.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_3d.Tpo -c -o libmgl_la-mgl_3d.lo `test -f 'mgl_3d.cpp' || echo '$(srcdir)/'`mgl_3d.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_3d.Tpo $(DEPDIR)/libmgl_la-mgl_3d.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_3d.cpp' object='libmgl_la-mgl_3d.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-opengl.lo: opengl.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-opengl.lo -MD -MP -MF $(DEPDIR)/libmgl_la-opengl.Tpo -c -o libmgl_la-opengl.lo `test -f 'opengl.cpp' || echo '$(srcdir)/'`opengl.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-opengl.Tpo $(DEPDIR)/libmgl_la-opengl.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='opengl.cpp' object='libmgl_la-opengl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_3d.lo `test -f 'mgl_3d.cpp' || echo '$(srcdir)/'`mgl_3d.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-opengl.lo `test -f 'opengl.cpp' || echo '$(srcdir)/'`opengl.cpp -libmgl_la-mgl_data.lo: mgl_data.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_data.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_data.Tpo -c -o libmgl_la-mgl_data.lo `test -f 'mgl_data.cpp' || echo '$(srcdir)/'`mgl_data.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_data.Tpo $(DEPDIR)/libmgl_la-mgl_data.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_data.cpp' object='libmgl_la-mgl_data.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-other.lo: other.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-other.lo -MD -MP -MF $(DEPDIR)/libmgl_la-other.Tpo -c -o libmgl_la-other.lo `test -f 'other.cpp' || echo '$(srcdir)/'`other.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-other.Tpo $(DEPDIR)/libmgl_la-other.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='other.cpp' object='libmgl_la-other.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_data.lo `test -f 'mgl_data.cpp' || echo '$(srcdir)/'`mgl_data.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-other.lo `test -f 'other.cpp' || echo '$(srcdir)/'`other.cpp -libmgl_la-mgl_f.lo: mgl_f.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_f.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_f.Tpo -c -o libmgl_la-mgl_f.lo `test -f 'mgl_f.cpp' || echo '$(srcdir)/'`mgl_f.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_f.Tpo $(DEPDIR)/libmgl_la-mgl_f.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_f.cpp' object='libmgl_la-mgl_f.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-parser.lo: parser.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-parser.lo -MD -MP -MF $(DEPDIR)/libmgl_la-parser.Tpo -c -o libmgl_la-parser.lo `test -f 'parser.cpp' || echo '$(srcdir)/'`parser.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-parser.Tpo $(DEPDIR)/libmgl_la-parser.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='parser.cpp' object='libmgl_la-parser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_f.lo `test -f 'mgl_f.cpp' || echo '$(srcdir)/'`mgl_f.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-parser.lo `test -f 'parser.cpp' || echo '$(srcdir)/'`parser.cpp -libmgl_la-mgl_idtf.lo: mgl_idtf.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_idtf.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_idtf.Tpo -c -o libmgl_la-mgl_idtf.lo `test -f 'mgl_idtf.cpp' || echo '$(srcdir)/'`mgl_idtf.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_idtf.Tpo $(DEPDIR)/libmgl_la-mgl_idtf.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_idtf.cpp' object='libmgl_la-mgl_idtf.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-tex_table.lo: tex_table.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-tex_table.lo -MD -MP -MF $(DEPDIR)/libmgl_la-tex_table.Tpo -c -o libmgl_la-tex_table.lo `test -f 'tex_table.cpp' || echo '$(srcdir)/'`tex_table.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-tex_table.Tpo $(DEPDIR)/libmgl_la-tex_table.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='tex_table.cpp' object='libmgl_la-tex_table.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_idtf.lo `test -f 'mgl_idtf.cpp' || echo '$(srcdir)/'`mgl_idtf.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-tex_table.lo `test -f 'tex_table.cpp' || echo '$(srcdir)/'`tex_table.cpp -libmgl_la-mgl_ab.lo: mgl_ab.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_ab.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_ab.Tpo -c -o libmgl_la-mgl_ab.lo `test -f 'mgl_ab.cpp' || echo '$(srcdir)/'`mgl_ab.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_ab.Tpo $(DEPDIR)/libmgl_la-mgl_ab.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_ab.cpp' object='libmgl_la-mgl_ab.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-pde.lo: pde.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-pde.lo -MD -MP -MF $(DEPDIR)/libmgl_la-pde.Tpo -c -o libmgl_la-pde.lo `test -f 'pde.cpp' || echo '$(srcdir)/'`pde.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-pde.Tpo $(DEPDIR)/libmgl_la-pde.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='pde.cpp' object='libmgl_la-pde.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_ab.lo `test -f 'mgl_ab.cpp' || echo '$(srcdir)/'`mgl_ab.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-pde.lo `test -f 'pde.cpp' || echo '$(srcdir)/'`pde.cpp -libmgl_la-mgl_data_io.lo: mgl_data_io.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_data_io.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_data_io.Tpo -c -o libmgl_la-mgl_data_io.lo `test -f 'mgl_data_io.cpp' || echo '$(srcdir)/'`mgl_data_io.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_data_io.Tpo $(DEPDIR)/libmgl_la-mgl_data_io.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_data_io.cpp' object='libmgl_la-mgl_data_io.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-pixel.lo: pixel.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-pixel.lo -MD -MP -MF $(DEPDIR)/libmgl_la-pixel.Tpo -c -o libmgl_la-pixel.lo `test -f 'pixel.cpp' || echo '$(srcdir)/'`pixel.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-pixel.Tpo $(DEPDIR)/libmgl_la-pixel.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='pixel.cpp' object='libmgl_la-pixel.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_data_io.lo `test -f 'mgl_data_io.cpp' || echo '$(srcdir)/'`mgl_data_io.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-pixel.lo `test -f 'pixel.cpp' || echo '$(srcdir)/'`pixel.cpp -libmgl_la-mgl_flow.lo: mgl_flow.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_flow.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_flow.Tpo -c -o libmgl_la-mgl_flow.lo `test -f 'mgl_flow.cpp' || echo '$(srcdir)/'`mgl_flow.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_flow.Tpo $(DEPDIR)/libmgl_la-mgl_flow.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_flow.cpp' object='libmgl_la-mgl_flow.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-plot.lo: plot.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-plot.lo -MD -MP -MF $(DEPDIR)/libmgl_la-plot.Tpo -c -o libmgl_la-plot.lo `test -f 'plot.cpp' || echo '$(srcdir)/'`plot.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-plot.Tpo $(DEPDIR)/libmgl_la-plot.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='plot.cpp' object='libmgl_la-plot.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_flow.lo `test -f 'mgl_flow.cpp' || echo '$(srcdir)/'`mgl_flow.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-plot.lo `test -f 'plot.cpp' || echo '$(srcdir)/'`plot.cpp -libmgl_la-mgl_vect.lo: mgl_vect.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_vect.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_vect.Tpo -c -o libmgl_la-mgl_vect.lo `test -f 'mgl_vect.cpp' || echo '$(srcdir)/'`mgl_vect.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_vect.Tpo $(DEPDIR)/libmgl_la-mgl_vect.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_vect.cpp' object='libmgl_la-mgl_vect.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-prim.lo: prim.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-prim.lo -MD -MP -MF $(DEPDIR)/libmgl_la-prim.Tpo -c -o libmgl_la-prim.lo `test -f 'prim.cpp' || echo '$(srcdir)/'`prim.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-prim.Tpo $(DEPDIR)/libmgl_la-prim.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='prim.cpp' object='libmgl_la-prim.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_vect.lo `test -f 'mgl_vect.cpp' || echo '$(srcdir)/'`mgl_vect.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-prim.lo `test -f 'prim.cpp' || echo '$(srcdir)/'`prim.cpp -libmgl_la-mgl_parse.lo: mgl_parse.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_parse.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_parse.Tpo -c -o libmgl_la-mgl_parse.lo `test -f 'mgl_parse.cpp' || echo '$(srcdir)/'`mgl_parse.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_parse.Tpo $(DEPDIR)/libmgl_la-mgl_parse.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_parse.cpp' object='libmgl_la-mgl_parse.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-surf.lo: surf.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-surf.lo -MD -MP -MF $(DEPDIR)/libmgl_la-surf.Tpo -c -o libmgl_la-surf.lo `test -f 'surf.cpp' || echo '$(srcdir)/'`surf.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-surf.Tpo $(DEPDIR)/libmgl_la-surf.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='surf.cpp' object='libmgl_la-surf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_parse.lo `test -f 'mgl_parse.cpp' || echo '$(srcdir)/'`mgl_parse.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-surf.lo `test -f 'surf.cpp' || echo '$(srcdir)/'`surf.cpp -libmgl_la-mgl_fit.lo: mgl_fit.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_fit.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_fit.Tpo -c -o libmgl_la-mgl_fit.lo `test -f 'mgl_fit.cpp' || echo '$(srcdir)/'`mgl_fit.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_fit.Tpo $(DEPDIR)/libmgl_la-mgl_fit.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_fit.cpp' object='libmgl_la-mgl_fit.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-vect.lo: vect.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-vect.lo -MD -MP -MF $(DEPDIR)/libmgl_la-vect.Tpo -c -o libmgl_la-vect.lo `test -f 'vect.cpp' || echo '$(srcdir)/'`vect.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-vect.Tpo $(DEPDIR)/libmgl_la-vect.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='vect.cpp' object='libmgl_la-vect.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_fit.lo `test -f 'mgl_fit.cpp' || echo '$(srcdir)/'`mgl_fit.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-vect.lo `test -f 'vect.cpp' || echo '$(srcdir)/'`vect.cpp -libmgl_la-mgl_pde.lo: mgl_pde.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_pde.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_pde.Tpo -c -o libmgl_la-mgl_pde.lo `test -f 'mgl_pde.cpp' || echo '$(srcdir)/'`mgl_pde.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_pde.Tpo $(DEPDIR)/libmgl_la-mgl_pde.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_pde.cpp' object='libmgl_la-mgl_pde.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-volume.lo: volume.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-volume.lo -MD -MP -MF $(DEPDIR)/libmgl_la-volume.Tpo -c -o libmgl_la-volume.lo `test -f 'volume.cpp' || echo '$(srcdir)/'`volume.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-volume.Tpo $(DEPDIR)/libmgl_la-volume.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='volume.cpp' object='libmgl_la-volume.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_pde.lo `test -f 'mgl_pde.cpp' || echo '$(srcdir)/'`mgl_pde.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-volume.lo `test -f 'volume.cpp' || echo '$(srcdir)/'`volume.cpp -libmgl_la-mgl_evalc.lo: mgl_evalc.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_evalc.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_evalc.Tpo -c -o libmgl_la-mgl_evalc.lo `test -f 'mgl_evalc.cpp' || echo '$(srcdir)/'`mgl_evalc.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_evalc.Tpo $(DEPDIR)/libmgl_la-mgl_evalc.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_evalc.cpp' object='libmgl_la-mgl_evalc.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_la-export_3d.lo: export_3d.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-export_3d.lo -MD -MP -MF $(DEPDIR)/libmgl_la-export_3d.Tpo -c -o libmgl_la-export_3d.lo `test -f 'export_3d.cpp' || echo '$(srcdir)/'`export_3d.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-export_3d.Tpo $(DEPDIR)/libmgl_la-export_3d.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='export_3d.cpp' object='libmgl_la-export_3d.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_evalc.lo `test -f 'mgl_evalc.cpp' || echo '$(srcdir)/'`mgl_evalc.cpp - -libmgl_la-mgl_addon.lo: mgl_addon.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_addon.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_addon.Tpo -c -o libmgl_la-mgl_addon.lo `test -f 'mgl_addon.cpp' || echo '$(srcdir)/'`mgl_addon.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_addon.Tpo $(DEPDIR)/libmgl_la-mgl_addon.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_addon.cpp' object='libmgl_la-mgl_addon.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_addon.lo `test -f 'mgl_addon.cpp' || echo '$(srcdir)/'`mgl_addon.cpp - -libmgl_la-mgl_evalp.lo: mgl_evalp.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_la-mgl_evalp.lo -MD -MP -MF $(DEPDIR)/libmgl_la-mgl_evalp.Tpo -c -o libmgl_la-mgl_evalp.lo `test -f 'mgl_evalp.cpp' || echo '$(srcdir)/'`mgl_evalp.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_la-mgl_evalp.Tpo $(DEPDIR)/libmgl_la-mgl_evalp.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_evalp.cpp' object='libmgl_la-mgl_evalp.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-mgl_evalp.lo `test -f 'mgl_evalp.cpp' || echo '$(srcdir)/'`mgl_evalp.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_la-export_3d.lo `test -f 'export_3d.cpp' || echo '$(srcdir)/'`export_3d.cpp mostlyclean-libtool: -rm -f *.lo diff --git a/src/axis.cpp b/src/axis.cpp new file mode 100644 index 0000000..d5641f6 --- /dev/null +++ b/src/axis.cpp @@ -0,0 +1,800 @@ +/*************************************************************************** + * axis.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License 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 +#include +#include +#include "mgl/data.h" +#include "mgl/canvas.h" +//----------------------------------------------------------------------------- +#define islog(a, b) (((a)>0 && (b)>10*(a)) || ((b)<0 && (a)<10*(b))) +#define sign(a) ((a)<0 ? -1:1) + +//----------------------------------------------------------------------------- +wchar_t *mgl_wcsdup(const wchar_t *s) +{ + wchar_t *r = (wchar_t *)malloc((wcslen(s)+1)*sizeof(wchar_t)); + memcpy(r,s,(wcslen(s)+1)*sizeof(wchar_t)); + return r; +} +//----------------------------------------------------------------------------- +void mgl_wcstrim(wchar_t *str) +{ + wchar_t *c = mgl_wcsdup(str); + unsigned long n=wcslen(str); + long k; + for(k=0;k' ') break; + wcscpy(c,&(str[k])); + n = wcslen(c); + for(k=n-1;k>=0;k--) if(c[k]>' ') break; + c[k+1] = 0; + wcscpy(str,c); free(c); +} +//----------------------------------------------------------------------------- +// Ticks setup +//----------------------------------------------------------------------------- +void mglCanvas::SetAxisStl(const char *stl, const char *tck, const char *sub) +{ + if(!stl || !(*stl)) strcpy(AxisStl,"k"); + else if(strlen(stl)<32) strcpy(AxisStl,stl); + if(!tck || !(*tck)) strcpy(TickStl,AxisStl); + else if(strlen(tck)<32) strcpy(TickStl,tck); + if(!sub || !(*sub)) strcpy(SubTStl,AxisStl); + else if(strlen(sub)<32) strcpy(SubTStl,sub); +} +//----------------------------------------------------------------------------- +void mglCanvas::SetTickLen(float tlen, float stt) +{ TickLen = tlen?tlen:0.02; st_t=stt>0?stt:1; } +//----------------------------------------------------------------------------- +void mglCanvas::SetTicks(char dir, float d, int ns, float org) +{ + if(!strchr("xyzca",dir)) return; + mglAxis &aa = (dir=='x' ? ax : (dir=='y' ? ay : (dir=='z' ? az : ac))); + + if(aa.f==1) aa.t[0]=0; + aa.d=d; aa.f=0; aa.ns=ns; aa.o=org; + aa.txt.clear(); +} +//----------------------------------------------------------------------------- +void mglCanvas::SetTicksVal(char dir, HCDT v, const wchar_t *lbl, bool add) +{ + if(!strchr("xyzca",dir)) return; + mglAxis &aa = (dir=='x' ? ax : (dir=='y' ? ay : (dir=='z' ? az : ac))); + bool ff = (dir=='x' ? fx : (dir=='y' ? fy : (dir=='z' ? fz : fa))); + + aa.txt.clear(); + if(add) { UpdateAxis(); AdjustTicks(aa,ff); } + if(!v || !lbl || !lbl[0]) { aa.f = 0; return; } + aa.f = 2; aa.ns=0; aa.ds=0; + register long i,j,l=0,n=v->GetNx(); + for(i=j=l=0;iv(i)); + i++; l=j+1; + } + if(j>1 && lbl[j]=='n' && lbl[j-1]=='\\') + { + aa.AddLabel(std::wstring(lbl+l,j-l-1),v->v(i)); + i++; l=j+1; + } + } + if(iv(i)); +} +//----------------------------------------------------------------------------- +void mglCanvas::SetTicksVal(char dir, HCDT v, const char *lbl, bool add) +{ + long ll=strlen(lbl); + wchar_t *wcs = new wchar_t[ll+1]; + mbstowcs(wcs,lbl,ll); wcs[ll]=0; + SetTicksVal(dir,v,wcs,add); + delete []wcs; +} +//----------------------------------------------------------------------------- +void mglCanvas::SetTicksVal(char dir, const wchar_t *lbl, bool add) +{ + register long i,j,len=wcslen(lbl); + for(i=0,j=1;j63) i=63; + mglData val(i+1); val.Fill(Min.x,Max.x); + SetTicksVal(dir, &val, lbl, add); +} +//----------------------------------------------------------------------------- +void mglCanvas::SetTicksVal(char dir, const char *lbl, bool add) +{ + register long i,j,len=strlen(lbl); + for(i=0,j=1;j63) i=63; + mglData val(i+1); val.Fill(Min.x,Max.x); + SetTicksVal(dir, &val, lbl, add); +} +//----------------------------------------------------------------------------- +void mglCanvas::SetTicksVal(char dir, HCDT v, const wchar_t **lbl, bool add) +{ + if(!strchr("xyzca",dir)) return; + mglAxis &aa = (dir=='x' ? ax : (dir=='y' ? ay : (dir=='z' ? az : ac))); + bool ff = (dir=='x' ? fx : (dir=='y' ? fy : (dir=='z' ? fz : fa))); + + aa.txt.clear(); + if(add) { UpdateAxis(); AdjustTicks(aa,ff); } + if(!v || !lbl) { aa.f = 0; return; } + aa.f = 2; aa.ns=0; aa.ds=0; + register long i,n=v->GetNx(); + for(i=0;iv(i)); +} +//----------------------------------------------------------------------------- +void mglCanvas::SetTicksVal(char dir, HCDT v, const char **lbl, bool add) +{ + if(!strchr("xyzca",dir)) return; + mglAxis &aa = (dir=='x' ? ax : (dir=='y' ? ay : (dir=='z' ? az : ac))); + bool ff = (dir=='x' ? fx : (dir=='y' ? fy : (dir=='z' ? fz : fa))); + + aa.txt.clear(); + if(add) { UpdateAxis(); AdjustTicks(aa,ff); } + if(!v || !lbl) { aa.f = 0; return; } + aa.f = 2; aa.ns=0; aa.ds=0; + register unsigned long i,n=v->GetNx(),l=0; + for(i=0;il) l=strlen(lbl[i]); + wchar_t *str=new wchar_t[l+1]; + for(i=0;iv(i)); + } + delete []str; +} +//----------------------------------------------------------------------------- +void mglCanvas::SetTickTempl(char dir, const wchar_t *t) +{ + if(!strchr("xyzca",dir)) return; + mglAxis &aa = (dir=='x' ? ax : (dir=='y' ? ay : (dir=='z' ? az : ac))); + + if(aa.f==1) aa.f = 0; // remove time ticks + if(!t || !t[0]) aa.t[0]=0; + else if(wcslen(t)<255) wcscpy(aa.t,t); +} +//----------------------------------------------------------------------------- +void mglCanvas::SetTickTempl(char dir, const char *t) +{ + if(!strchr("xyzca",dir)) return; + mglAxis &aa = (dir=='x' ? ax : (dir=='y' ? ay : (dir=='z' ? az : ac))); + + if(aa.f==1) aa.f = 0; // remove time ticks + if(!t || !t[0]) aa.t[0]=0; + else if(strlen(t)<255) mbstowcs(aa.t,t,strlen(t)+1); +} +//----------------------------------------------------------------------------- +void mglCanvas::SetTickTime(char dir, float d, const char *t) +{ + if(!strchr("xyzca",dir)) return; + mglAxis &aa = (dir=='x' ? ax : (dir=='y' ? ay : (dir=='z' ? az : ac))); + + if(!t || !t[0]) // adjust template + { + time_t tt; tm t1,t2; + tt=aa.v1; localtime_r(&tt,&t1); + tt=aa.v2; localtime_r(&tt,&t2); + t = t1.tm_yday!=t2.tm_yday ? "%x" : "%X"; + } + + aa.dv = d; aa.f = 1; aa.txt.clear(); + if(strlen(t)<255) mbstowcs(aa.t,t,strlen(t)+1); + + if(strchr("xyztuvw",aa.ch)) + aa.org = mglPoint(GetOrgX(aa.ch), GetOrgY(aa.ch), GetOrgZ(aa.ch)); + if(aa.ch=='x') aa.v0 = aa.org.x; + if(aa.ch=='y') aa.v0 = aa.org.y; + if(aa.ch=='z') aa.v0 = aa.org.z; + + wchar_t buf[64]; + float v, v0 = 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 + { v1 = aa.v1; v0 = v0 - aa.dv*floor((v0-aa.v2)/aa.dv+1e-3); } + if(v0+aa.dv!=v0 && v1+aa.dv!=v1) for(v=v0;v<=v1;v+=aa.dv) + { + time_t tt = v; tm tp; localtime_r(&tt,&tp); + wcsftime(buf,64,aa.t,&tp); aa.AddLabel(buf,v); + } +} +//----------------------------------------------------------------------------- +void mglCanvas::AdjustTicks(const char *dir, bool force) +{ + UpdateAxis(); TuneTicks = true; + if(strchr(dir,'x')) + { if(force) ax.d=0; AdjustTicks(ax,fx); } + if(strchr(dir,'y')) + { if(force) ay.d=0; AdjustTicks(ay,fy); } + if(strchr(dir,'z')) + { if(force) az.d=0; AdjustTicks(az,fz); } + if(strchr(dir,'a') || strchr(dir,'c')) + { if(force) ac.d=0; AdjustTicks(ac,fa); } +} +//----------------------------------------------------------------------------- +void mglCanvas::AdjustTicks(mglAxis &aa, bool ff) +{ + float d = fabs(aa.v2-aa.v1), n; + if(aa.f>0) return; + if(ff && islog(aa.v1,aa.v2)) + { aa.dv = 0; aa.ds=0; } + else if(aa.d>0) + { aa.dv = aa.d; aa.ds = aa.d/(fabs(aa.ns)+1); } + else if(aa.d>-1.5) // like =0 or =-1 + { + n = floor(log10(d)); d = floor(d*pow(10.,-n)); + n = pow(10.,n); aa.o=0; + if(d==1) { aa.dv = n/5; aa.ds=n/10; } + else if(d<4){ aa.dv = n/2; aa.ds=n/10; } + else if(d<7){ aa.dv = n; aa.ds=n/5; } + else { aa.dv = 2*n; aa.ds=n/2; } + } + else // TODO: Check it!!! + { + d /= -aa.d; n = floor(log10(d)); + int k = int(d*pow(10.,-n)+0.5); + aa.dv = pow(10.,n)*k; + aa.o=0; aa.ds = pow(10.,n); + } + LabelTicks(aa); +} +//----------------------------------------------------------------------------- +int mgl_tick_ext(float a, float b, wchar_t s[32], float &v) +{ + int kind = 0; + if(fabs(a-b)<0.01*fabs(a)) + { + kind = 1; + v = fabs(a-b); + if(v>100.f) + { + int k=int(log10(v)-0.01); + kind=3; v=mgl_ipow(10.,k); + mglprintf(s, 32, L"(@{\\times{}10^{%d}})", k); + } + if(v<1e-2f) + { + int k=int(log10(v)-0.01)-1; + kind=3; v=mgl_ipow(10.,k); + mglprintf(s, 32, L"(@{\\times{}10^{%d}})", k); + } + } + else + { + v = fabs(b)>fabs(a)?fabs(b):fabs(a); + if(v>100.f) + { + kind = 2; + int k=int(log10(v)-0.01); + v=mgl_ipow(10.,k); + mglprintf(s, 32, L"\\times 10^{%d}", k); + } + if(v<1e-2f) + { + kind = 2; + int k=int(log10(v)-0.01)-1; + v=mgl_ipow(10.,k); + mglprintf(s, 32, L"\\times 10^{%d}", k); + } + } + return kind; +} +//----------------------------------------------------------------------------- +void mgl_tick_text(float z, float z0, float d, float v, int kind, wchar_t str[64]) +{ + float u = fabs(z)z0) u = fabs(z-z0)z0)) u /= v; + if((kind&1) && z>z0) + { + int n1,n2; + mglprintf(str, 64, fabs(u)<1 ? L"@{(+%.2g)}" : L"@{(+%.3g)}",u); + n1=wcslen(str); mglprintf(str, 64, L"@{(+%g)}",u); n2=wcslen(str); + if(n10) // positive log-scale + { + v0 = exp(M_LN10*floor(0.1+log10(aa.v1))); + for(v=v0;v<=aa.v2*MGL_FLT_EPS;v*=10) if(v*MGL_FLT_EPS>=aa.v1) + { + mglprintf(buf,64,L"10^{%d}",int(floor(0.1+log10(v)))); + aa.AddLabel(buf,v); + } + } + else if(aa.dv==0 && aa.v2<0) // negative log-scale + { + v0 = -exp(M_LN10*floor(0.1+log10(-aa.v2))); + for(v=v0;v>=aa.v1*MGL_FLT_EPS;v*=10) if(v*MGL_FLT_EPS<=aa.v2) + { + mglprintf(buf,64,L"-10^{%d}",int(floor(0.1+log10(-v)))); + aa.AddLabel(buf,v); + } + } + else if(aa.dv) // ticks drawing + { + int kind=0; + wchar_t s[32]=L""; + if(aa.t[0]==0) kind = mgl_tick_ext(aa.v2, aa.v1, s, w); + if(!TuneTicks) kind = 0; + + v0 = 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 + { v1 = aa.v1; v0 = v0 - aa.dv*floor((v0-aa.v2)/aa.dv+1e-3); } + + if(v0+aa.dv!=v0 && v1+aa.dv!=v1) for(v=v0;v<=v1;v+=aa.dv) + { + if(aa.t[0]) + mglprintf(buf, 64, aa.t, fabs(v)0) for(i=0;i0) + { + if(aa.v2>aa.v1) v0 = v0 - aa.ds*floor((v0-aa.v1)/aa.ds+1e-3); + else v0 = v0 - aa.ds*floor((v0-aa.v2)/aa.ds+1e-3); + if(v0+aa.ds!=v0 && aa.v2+aa.ds!=aa.v2) + for(v=v0;v0))) pos[0]='T'; + if(aa.ch=='T') pos[0]='t'; + float *w=new float[n], h = TextHeight(FontDef,-1)/4, c=NAN, l=NAN, tet=0, v; // find sizes + long *kk=new long[n]; + for(i=0;i0 ? (p-q).norm() : NAN; + c = cw[i] ? l:w[i]; + } + c /= 1.1; + if(get(MGL_ENABLE_RTEXT) && get(MGL_TICKS_ROTATE) && l>c) // try rotate first + { tet = c>h ? asin(h*1.1/c) : M_PI/2; pos[2]='L'; + l=h/sin(tet); for(i=0;i0) for(i=0;iaa.v1 && c0 || nn.x<0) ? 'T':'t'; + if(aa.ch=='T') pos[0]='t'; + mglPnt &qq = Pnt[kk[i]]; v = qq.u; + qq.u = v*cos(tet) + qq.v*sin(tet); + qq.v = qq.v*cos(tet) - v*sin(tet); + text_plot(kk[i], aa.txt[i].text.c_str(), pos, -1, 0.07); + } + delete []w; delete []kk; +} +//----------------------------------------------------------------------------- +void mglCanvas::tick_draw(mglPoint o, mglPoint d1, mglPoint d2, int f) +{ + if(TickLen==0) return; + float v = font_factor*TickLen/sqrt(1+f*st_t); + mglPoint p=o; + long k1,k2,k3; + + if(*TickStl && !f) SetPenPal(TickStl); + if(*SubTStl && f) SetPenPal(SubTStl); + ScalePoint(o, d1, false); d1.Normalize(); + ScalePoint(p, d2, false); d2.Normalize(); + k2 = AddPnt(p, CDef, mglPoint(NAN), 0, 0); + p += d1*v; k1 = AddPnt(p, CDef, mglPoint(NAN), 0, 0); + p = o+d2*v; k3 = AddPnt(p, CDef, mglPoint(NAN), 0, 0); + line_plot(k1,k2); line_plot(k2,k3); +} +//----------------------------------------------------------------------------- +void mglCanvas::Grid(const char *dir, const char *pen) +{ + if(!dir || !dir[0]) return; + AdjustTicks(dir,false); + SetPenPal(pen); + // TODO: Ternary axis labeling ... + if(strchr(dir,'x')) DrawGrid(ax); + if(strchr(dir,'y')) DrawGrid(ay); + if(strchr(dir,'z')) DrawGrid(az); +} +//----------------------------------------------------------------------------- +void mglCanvas::DrawGrid(mglAxis &aa) +{ + aa.org = mglPoint(GetOrgX(aa.ch), GetOrgY(aa.ch), GetOrgZ(aa.ch)); + mglPoint d=aa.dir, da1,da2,db1,db2,oa,ob, p,q; + da1 = aa.a*(aa.a*Min); da2 = aa.a*(aa.a*Max); + db1 = aa.b*(aa.b*Min); db2 = aa.b*(aa.b*Max); + oa = aa.b*(aa.b*aa.org); ob = aa.a*(aa.a*aa.org); + + register long i,j,n=aa.txt.size(),k1,k2; + float v; + + Reserve(62*n); + if(n>0) for(i=0;i')) where = 0; + if(sch && strchr(sch,'<')) where = 1; + if(sch && strchr(sch,'^')) where = 2; + if(sch && strchr(sch,'_')) where = 3; + if(sch && strchr(sch,'A')) { Push(); Identity(); } + Colorbar(where, where==0?1:0, where==2?1:0, 1, 1, AddTexture(sch)); + if(sch && strchr(sch,'A')) Pop(); +} +//----------------------------------------------------------------------------- +void mglCanvas::Colorbar(int where, float x, float y, float w, float h, long s) +{ + long n=256; + mglData v(n); + if(ac.d || Min.c*Max.c<=0) v.Fill(Min.c,Max.c); + else if(Max.c>Min.c && Min.c>0) + { v.Fill(log(Min.c), log(Max.c)); v.Modify("exp(u)"); } + else if(Min.c')) where = 0; + if(sch && strchr(sch,'<')) where = 1; + if(sch && strchr(sch,'^')) where = 2; + if(sch && strchr(sch,'_')) where = 3; + if(sch && strchr(sch,'A')) { Push(); Identity(); } + Colorbar(v,sch,where, where==0?1:0, where==2?1:0, 1, 1); + if(sch && strchr(sch,'A')) Pop(); +} +//----------------------------------------------------------------------------- +void mglCanvas::Colorbar(HCDT v, const char *sch, int where, float x, float y, float w, float h) +{ + float *c=new float[v->GetNx()]; + if(!sch || !(*sch)) sch = MGL_DEF_PAL; + long s = AddTexture(sch); // TODO Check it + int nc = GetNumPal(s*256); + float dc = nc>1 ? 1/(MGL_FLT_EPS*(nc-1)):0; + for(long i=0;iGetNx();i++) c[i] = s+i*dc; + colorbar(v, c, where, x, y, w, h); + delete []c; +} +//----------------------------------------------------------------------------- +void mglCanvas::Label(char dir, const char *str, float pos, float shift) +{ + unsigned s = strlen(str)+1; + wchar_t *wcs = new wchar_t[s]; + mbstowcs(wcs,str,s); + Labelw(dir, wcs, pos, shift); + delete []wcs; +} +//----------------------------------------------------------------------------- +void mglCanvas::Labelw(char dir, const wchar_t *text, float pos, float shift) +{ + float t, x0, y0, z0; + x0 = GetOrgX(dir); y0 = GetOrgY(dir); z0 = GetOrgZ(dir); + mglPoint p,ss=(Min+Max)/2,q,qq,nn; + + if(dir=='x') // TODO: Tern axis & colorbar labels!!! + { + AdjustTicks(ax,fx); + if(ax.dv) t = (Min.x+Max.x+pos*(Max.x-Min.x))/2; + else t = Min.x*pow(Max.x/Min.x, (pos+1)/2); + nn = mglPoint(0,ss.y-y0,ss.z-z0); + p = mglPoint(t,y0,z0); q = mglPoint(1,0,0); + } + if(dir=='y') + { + AdjustTicks(ay,fy); + if(ay.dv) t = (Min.y+Max.y+pos*(Max.y-Min.y))/2; + else t = Min.y*pow(Max.y/Min.y, (pos+1)/2); + nn = mglPoint(ss.x-x0,0,ss.z-z0); + p = mglPoint(x0,t,z0); q = mglPoint(0,1,0); + if(TernAxis&3) + { q = mglPoint(-1,1,0); pos=-pos; } + } + if(dir=='t' && (TernAxis&3)) + { + AdjustTicks(ay,fy); pos = -pos; + if(ay.dv) t = (Min.y+Max.y+pos*(Max.y-Min.y))/2; + else t = Min.y*pow(Max.y/Min.y, (pos+1)/2); + nn = mglPoint(ss.x-x0,0,ss.z-z0); + p = mglPoint(x0,t,z0); q = mglPoint(0,1,0); + } + if(dir=='z') + { + AdjustTicks(az,fz); + if(az.dv) t = (Min.z+Max.z+pos*(Max.z-Min.z))/2; + else t = Min.z*pow(Max.z/Min.z, (pos+1)/2); + nn = mglPoint(ss.x-x0,ss.y-y0,0); + p = mglPoint(x0,y0,t); q = mglPoint(0,0,1); + } + ss = p; ScalePoint(ss,nn,false); + char font[33],ff[3]=":C"; + if(pos<-0.2) ff[1]='L'; if(pos>0.2) ff[1]='R'; + strcpy(font,FontDef); strcat(font,ff); + strcat(font,nn.y>1e-5 || nn.x<0 ? "T":"t"); + text_plot(AddPnt(p,-1,q,0),text,font,-1.4,0.3+shift); +} +//----------------------------------------------------------------------------- +void mglCanvas::Label(float x, float y, const char *str, const char *font, bool rel) +{ + unsigned s = strlen(str)+1; + wchar_t *wcs = new wchar_t[s]; + mbstowcs(wcs,str,s); + Labelw(x,y,wcs, font, rel); + delete []wcs; +} +//----------------------------------------------------------------------------- +void mglCanvas::Labelw(float x, float y, const wchar_t *text, const char *font, bool rel) +{ + Push(); Identity(rel); + mglFormula *ox=fx, *oy=fy, *oz=fz; + fx = fy = fz = NULL; + char *f = new char[strlen(font)+1]; memset(f,0,strlen(font)+1); + strcpy(f,font); + for(int i=0;f[i];i++) if(f[i]=='a' || f[i]=='A') f[i]=' '; + mglPoint p((Min.x+Max.x)/2+B.pf*(Max.x-Min.x)*(x-0.5), + (Min.y+Max.y)/2+B.pf*(Max.y-Min.y)*(y-0.5), Max.z); + text_plot(AddPnt(p,-1,mglPoint(NAN),0),text,f,-1.4,1); + delete []f; fx=ox; fy=oy; fz=oz; Pop(); +} +//----------------------------------------------------------------------------- +void mglCanvas::Box(const char *col, bool ticks) +{ + mglPoint o = Org; + float tl=TickLen; + if(!ticks) TickLen=0; + SetPenPal(col); + Org = Min; Axis("xyz_"); + if(TernAxis&1) + { + Org.z=Max.z; Org.x=Max.x; Axis("xz_"); + Org.x=Min.x; Org.y=Max.y; Axis("z_"); + + mglAxis ty(ay); ty.ch='T'; + ty.dir = mglPoint(-1,1); ty.org = mglPoint(1,0,Max.z); + DrawAxis(ty, false, 0); ty.ch='t'; + ty.dir = mglPoint(0,-1); ty.org = mglPoint(0,1,Max.z); + DrawAxis(ty, false, 0); + } + else if(TernAxis&2) + { + mglAxis ty(az); + ty.ch='T'; ty.a=mglPoint(1,0); ty.b=mglPoint(-1,1); + ty.dir = mglPoint(-1,0,1); ty.org = mglPoint(1,0,Max.z); + DrawAxis(ty, false, 0); + ty.ch='t'; ty.a=mglPoint(0,1); ty.b=mglPoint(-1,1); + ty.dir = mglPoint(0,-1,1); ty.org = mglPoint(0,1,Max.z); + DrawAxis(ty, false, 0); + } + else + { + Org.z=Max.z; Axis("xy_"); + Org = Max; Axis("xyz_"); + Org.z=Min.z; Axis("xy_"); + Org.x=Min.x; DrawAxis(az,0,0); + Org.x=Max.x; Org.y=Min.y; DrawAxis(az,0,0); + } + Org=o; TickLen=tl; +} +//----------------------------------------------------------------------------- +void mglCanvas::colorbar(HCDT vv, const float *c, int where, float x, float y, float w, float h) +{ + static int cgid=1; StartGroup("Colorbar",cgid++); + register unsigned long i,n=vv->GetNx(); + long n1,n2,n3,n4; + float d,s3=B.pf,ss=1; // NOTE: colorbar was wider ss=s3*0.9; + mglPoint p1,p2; + + Push(); set(MGL_DISABLE_SCALE); B=B1; B.pf=s3; + x = 2*x-1; y = 2*y-1; + for(i=0;iv(i))*2-1; + p1 = p2 = mglPoint((ss*d+s3)*w+x*s3, (ss*d+s3)*h+y*s3, s3); + switch(where) + { + case 1: p1.x = x*s3; p2.x = (x+0.1*w)*s3; break; + case 2: p1.y = (y-0.1*h)*s3; p2.y = y*s3; break; + case 3: p1.y = y*s3; p2.y = (y+0.1*h)*s3; break; + default:p1.x = (x-0.1*w)*s3; p2.x = x*s3; break; + } + n1 = AddPnt(p1,c[i]); n2 = AddPnt(p2,c[i]); + d = GetA(vv->v(i+1))*2-1; + p1 = p2 = mglPoint((ss*d+s3)*w+x*s3, (ss*d+s3)*h+y*s3, s3); + switch(where) + { + case 1: p1.x = x*s3; p2.x = (x+0.1*w)*s3; break; + case 2: p1.y = (y-0.1*h)*s3; p2.y = y*s3; break; + case 3: p1.y = y*s3; p2.y = (y+0.1*h)*s3; break; + default:p1.x = (x-0.1*w)*s3; p2.x = x*s3; break; + } + n3 = AddPnt(p1,c[i]); n4 = AddPnt(p2,c[i]); + quad_plot(n1,n2,n3,n4); + } + if(n<64) + { + wchar_t buf[64]; + for(i=0;iv(i); + mglprintf(buf,64,ac.t[0]?ac.t:(fabs(d)<1 ? L"%.2g" : L"%.3g"),d); + ac.AddLabel(buf,d); + } + } + else { UpdateAxis(); AdjustTicks(ac,fa); } + // hint for using standard label drawing function + float cc=AddTexture('k'); + for(i=0;i * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License 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 "mgl/base.h" +#include "mgl/define.h" +//----------------------------------------------------------------------------- +char *mgl_strdup(const char *s) +{ + char *r = (char *)malloc((strlen(s)+1)*sizeof(char)); + memcpy(r,s,(strlen(s)+1)*sizeof(char)); + return r; +} +//----------------------------------------------------------------------------- +void mgl_strtrim(char *str) +{ + char *c = mgl_strdup(str); + unsigned long n=strlen(str); + long k; + for(k=0;k' ') break; + strcpy(c,&(str[k])); + n = strlen(c); + for(k=n-1;k>=0;k--) // óäàëÿåì íà÷àëüíûå ïðîáåëû + if(c[k]>' ') break; + c[k+1] = 0; + strcpy(str,c); free(c); +} +//----------------------------------------------------------------------------- +void mgl_strlwr(char *str) +{ + for(long k=0;k<(long)strlen(str);k++) // óäàëÿåì íà÷àëüíûå ïðîáåëû + str[k] = (str[k]>='A' && str[k]<='Z') ? str[k]+'a'-'A' : str[k]; +} +//----------------------------------------------------------------------------- +mglBase::mglBase() +{ +// memset(this,0,sizeof(mglBase)); // since mglBase is abstract then I can do it?!! + Message=0; Flag=0; saved=false; prev_val=0; +#ifdef HAVE_PTHREAD + pthread_mutex_init(&mutexPnt,0); + pthread_mutex_init(&mutexTxt,0); +#endif + fnt=0; *FontDef=*last_style=0; + fx=fy=fz=fa=fc=0; + + InUse = 1; prev_val = NAN; + // Always create default palette txt[0] and default scheme txt[1] + Txt.reserve(3); + Txt.push_back(mglTexture(MGL_DEF_PAL,-1)); + Txt.push_back(mglTexture("BbcyrR",1)); + last_style[0]='k'; last_style[1]='-'; last_style[2]='0'; + last_style[3]=last_style[4]=0; + MinS=mglPoint(-1,-1,-1); MaxS=mglPoint(1,1,1); +} +mglBase::~mglBase() { ClearEq(); } +//----------------------------------------------------------------------------- +float mglBase::GetRatio() { return 1; } +//----------------------------------------------------------------------------- +void mglBase::StartGroup(const char *name, int id) +{ + LightScale(); + char buf[128]; + sprintf(buf,"%s_%d",name,id); + StartAutoGroup(buf); +} +//----------------------------------------------------------------------------- +const char *mglWarn[mglWarnEnd] = {"%s: data dimension(s) is incompatible", + "%s: data dimension(s) is too small", + "%s: minimal data value is negative", + "No file or wrong data dimensions", + "Not enough memory", + "%s: data values are zero", + "Too many legend entries", + "No legend entries", + "%s: slice value is out of range", + "%s: number of contours is zero or negative", + "Couldn't open file %s", + "Light: ID is out of range", + "Setsize: size(s) is zero or negative", + "Format %s is not supported for that build"}; +//----------------------------------------------------------------------------- +void mglBase::SetWarn(int code, const char *who) +{ + WarnCode = code>0 ? code:0; + if(Message) + { + if(code>0 && code=0 && a<=1) ? a : (isnan(n.x) ? 1:AlphaDef); + a = (a>=0 && a<=1) ? a : AlphaDef; + c = (c>=0) ? c:CDef; + // NOTE: RGBA color for OpenGL and EPS/SVG modes only! + mglPnt q; + q.x=p.x; q.y=p.y; q.z=p.z; q.c=c; + q.t=a; q.u=n.x; q.v=n.y; q.w=n.z; + Txt[long(c)].GetC(c,a,q); + MGL_PUSH(Pnt,q,mutexPnt); return Pnt.size()-1; +} +//----------------------------------------------------------------------------- +long mglBase::CopyNtoC(long from, float c) // NOTE: this is not-thread-safe!!! +{ + 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); } + MGL_PUSH(Pnt,p,mutexPnt); return Pnt.size()-1; +} +//----------------------------------------------------------------------------- +long mglBase::CopyProj(long from, mglPoint p, mglPoint n) // NOTE: this is not-thread-safe!!! +{ + if(from<0) return -1; + mglPnt q=Pnt[from]; + q.x=p.x; q.y=p.y; q.z=p.z; + q.u=n.x; q.v=n.y; q.w=n.z; + MGL_PUSH(Pnt,q,mutexPnt); return Pnt.size()-1; +} +//----------------------------------------------------------------------------- +void mglBase::Reserve(long n) // NOTE: this is not-thread-safe!!! +{ + if(TernAxis&4) n*=4; + Pnt.reserve(n); +} +//----------------------------------------------------------------------------- +// Boundaries and scaling +//--------------------------------------------------------------------------- +void mglBase::RecalcCRange() +{ + if(!fa) + { FMin.c = Min.c; FMax.c = Max.c; } + else + { + FMin.c = 1e30; FMax.c = -1e30; + register int i; + float a; + int n=30; + for(i=0;i<=n;i++) + { + a = fa->Calc(0,0,0,Min.c+i*(Max.c-Min.c)/n); + if(aFMax.c) FMax.c=a; + } + } +} +//----------------------------------------------------------------------------- +void mglBase::RecalcBorder() +{ + if(!fx && !fy && !fz) + { FMin = Min; FMax = Max; } + else + { + FMin = mglPoint( 1e30, 1e30, 1e30); + FMax = mglPoint(-1e30,-1e30,-1e30); + register int i,j; + int n=30; + for(i=0;i<=n;i++) for(j=0;j<=n;j++) // x range + { + SetFBord(Min.x, Min.y+i*(Max.y-Min.y)/n, Min.z+j*(Max.z-Min.z)/n); + SetFBord(Max.x, Min.y+i*(Max.y-Min.y)/n, Min.z+j*(Max.z-Min.z)/n); + } + for(i=0;i<=n;i++) for(j=0;j<=n;j++) // y range + { + SetFBord(Min.x+i*(Max.x-Min.x)/n, Min.y, Min.z+j*(Max.z-Min.z)/n); + SetFBord(Min.x+i*(Max.x-Min.x)/n, Max.y, Min.z+j*(Max.z-Min.z)/n); + } + for(i=0;i<=n;i++) for(j=0;j<=n;j++) // x range + { + SetFBord(Min.x+i*(Max.x-Min.x)/n, Min.y+j*(Max.y-Min.y)/n, Min.x); + SetFBord(Min.x+i*(Max.x-Min.x)/n, Min.y+j*(Max.y-Min.y)/n, Max.z); + } + if(!fx) { FMin.x = Min.x; FMax.x = Max.x; } + if(!fy) { FMin.y = Min.y; FMax.y = Max.y; } + if(!fz) { FMin.z = Min.z; FMax.z = Max.z; } + } + RecalcCRange(); +} +//----------------------------------------------------------------------------- +void mglBase::SetFBord(float x,float y,float z) +{ + if(fx) + { + float v = fx->Calc(x,y,z); + if(FMax.x < v) FMax.x = v; + if(FMin.x > v) FMin.x = v; + } + if(fy) + { + float v = fy->Calc(x,y,z); + if(FMax.y < v) FMax.y = v; + if(FMin.y > v) FMin.y = v; + } + if(fz) + { + float v = fz->Calc(x,y,z); + if(FMax.z < v) FMax.z = v; + if(FMin.z > v) FMin.z = v; + } +} +//----------------------------------------------------------------------------- +bool mglBase::ScalePoint(mglPoint &p, mglPoint &n, bool use_nan) +{ + float &x=p.x, &y=p.y, &z=p.z; + if(isnan(x) || isnan(y) || 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; + z1 = z>0?z*MGL_FLT_EPS:z/MGL_FLT_EPS; z2 = z<0?z*MGL_FLT_EPS:z/MGL_FLT_EPS; + bool res = true; + if(x2>CutMin.x && x1CutMin.y && y1CutMin.z && z1Calc(x,y,z)) res = false; + + if(get(MGL_ENABLE_CUT) || !use_nan) + { +// if(x1Max.x || y1Max.y || z1Max.z) res = false; + if((x1-Min.x)*(x1-Max.x)>0 && (x2-Min.x)*(x2-Max.x)>0 && Min.x!=Max.x) res = false; + if((y1-Min.y)*(y1-Max.y)>0 && (y2-Min.y)*(y2-Max.y)>0 && Min.y!=Max.y) res = false; + if((z1-Min.z)*(z1-Max.z)>0 && (z2-Min.z)*(z2-Max.z)>0 && Min.z!=Max.z) res = false; + } + else + { + if(x1Max.x) x=Max.x; + if(y1Max.y) y=Max.y; + if(z1Max.z) z=Max.z; + } + + x1=x; y1=y; z1=z; + 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; } + + x = (2*x1 - FMin.x - FMax.x)/(FMax.x - FMin.x); + y = (2*y1 - FMin.y - FMax.y)/(FMax.y - FMin.y); + z = (2*z1 - FMin.z - FMax.z)/(FMax.z - FMin.z); + n.x *= 2/(FMax.x - FMin.x); + n.y *= 2/(FMax.y - FMin.y); + n.z *= 2/(FMax.z - FMin.z); + if((TernAxis&3)==1) // usual ternary axis + { + if(x+y>0) + { + if(get(MGL_ENABLE_CUT)) res = false; + else y = -x; + } + x += (y+1)/2; n.x += n.y/2; + } + else if((TernAxis&3)==2) // quaternary axis + { + if(x+y+z>-1) + { + if(get(MGL_ENABLE_CUT)) res = false; + else z = -1-y-x; + } + x += 1+(y+z)/2; y += (z+1)/3; + n.x += (n.y+n.z)/2; n.y += n.z/3; + } +// if(fabs(x)>MGL_FLT_EPS) res = false; +// if(fabs(y)>MGL_FLT_EPS) res = false; +// if(fabs(z)>MGL_FLT_EPS) res = false; + + if(!res && use_nan) x = NAN; // extra sign that point shouldn't be plotted + return res; +} +//----------------------------------------------------------------------------- +// Ranges +//----------------------------------------------------------------------------- +void mglBase::SetRanges(mglPoint m1, mglPoint m2) +{ + if(m1.xm2.x) { Min.x=m2.x; Max.x = m1.x; } + if(m1.ym2.y) { Min.y=m2.y; Max.y = m1.y; } + if(m1.zm2.z) { Min.z=m2.z; Max.z = m1.z; } + if(m1.cm2.c) { Min.c=m2.c; Max.c = m1.c; } + if(Min.c==Max.c) { 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; + } + CutMin = mglPoint(0,0,0); CutMax = mglPoint(0,0,0); + RecalcBorder(); +} +//----------------------------------------------------------------------------- +void mglBase::CRange(const mglDataA &a,bool add, float fact) +{ + float v1=a.Minimal(), v2=a.Maximal(), dv; + dv=(v2-v1)*fact; v1 -= dv; v2 += dv; + if(!add) { Min.c = v1; Max.c = v2; } + else if(Min.cv1) Min.c=v1; + if(Max.cdv ? v2:dv; + } + if(Org.cMax.c && !isnan(Org.c)) Org.c = Max.c; + RecalcCRange(); +} +//----------------------------------------------------------------------------- +void mglBase::XRange(const mglDataA &a,bool add,float fact) +{ + float v1=a.Minimal(), v2=a.Maximal(), dv; + dv=(v2-v1)*fact; v1 -= dv; v2 += dv; + if(!add) { Min.x = v1; Max.x = v2; } + else if(Min.xv1) Min.x=v1; + if(Max.xdv ? v2:dv; + } + if(Org.xMax.x && !isnan(Org.x)) Org.x = Max.x; + RecalcBorder(); +} +//----------------------------------------------------------------------------- +void mglBase::YRange(const mglDataA &a,bool add,float fact) +{ + float v1=a.Minimal(), v2=a.Maximal(), dv; + dv=(v2-v1)*fact; v1 -= dv; v2 += dv; + if(!add) { Min.y = v1; Max.y = v2; } + else if(Min.yv1) Min.y=v1; + if(Max.ydv ? v2:dv; + } + if(Org.yMax.y && !isnan(Org.y)) Org.y = Max.y; + RecalcBorder(); +} +//----------------------------------------------------------------------------- +void mglBase::ZRange(const mglDataA &a,bool add,float fact) +{ + float v1=a.Minimal(), v2=a.Maximal(), dv; + dv=(v2-v1)*fact; v1 -= dv; v2 += dv; + if(!add) { Min.z = v1; Max.z = v2; } + else if(Min.zv1) Min.z=v1; + if(Max.zdv ? v2:dv; + } + if(Org.zMax.z && !isnan(Org.z)) Org.z = Max.z; + RecalcBorder(); +} +//----------------------------------------------------------------------------- +void mglBase::SetAutoRanges(float x1, float x2, float y1, float y2, float z1, float z2, float c1, float c2) +{ + if(x1!=x2) { Min.x = x1; Max.x = x2; } + if(y1!=y2) { Min.y = y1; Max.y = y2; } + if(z1!=z2) { Min.z = z1; Max.z = z2; } + if(c1!=c2) { Min.c = c1; Max.c = c2; } +} +//----------------------------------------------------------------------------- +void mglBase::Ternary(int t) +{ + static mglPoint x1(-1,-1,-1),x2(1,1,1),o(NAN,NAN,NAN); + static bool c = true; + TernAxis = t; + if(t&3) + { + x1 = Min; x2 = Max; o = Org; + c = get(MGL_ENABLE_CUT); clr(MGL_ENABLE_CUT); + SetRanges(mglPoint(0,0,0),mglPoint(1,1,t==1?0:1)); + Org=mglPoint(0,0,0); + } + else { SetRanges(x1,x2); Org=o; SetCut(c); } +} +//----------------------------------------------------------------------------- +// Transformation functions +//----------------------------------------------------------------------------- +void mglBase::SetFunc(const char *EqX,const char *EqY,const char *EqZ,const char *EqA) +{ + if(fa) delete fa; if(fx) delete fx; + if(fy) delete fy; if(fz) delete fz; + if(EqX && *EqX && (EqX[0]!='x' || EqX[1]!=0)) + fx = new mglFormula(EqX); + else fx = 0; + if(EqY && *EqY && (EqY[0]!='y' || EqY[1]!=0)) + fy = new mglFormula(EqY); + else fy = 0; + if(EqZ && *EqZ && (EqZ[0]!='z' || EqZ[1]!=0)) + fz = new mglFormula(EqZ); + else fz = 0; + if(EqA && *EqA && ((EqA[0]!='c' && EqA[0]!='a') || EqA[1]!=0)) + fa = new mglFormula(EqA); + else fa = 0; + RecalcBorder(); +} +//----------------------------------------------------------------------------- +void mglBase::CutOff(const char *EqC) +{ + if(fc) delete fc; + if(EqC && EqC[0]) fc = new mglFormula(EqC); else fc = 0; +} +//----------------------------------------------------------------------------- +void mglBase::SetCoor(int how) +{ + switch(how) + { + case mglCartesian: SetFunc(0,0); break; + case mglPolar: + SetFunc("x*cos(y)","x*sin(y)"); break; + case mglSpherical: + SetFunc("x*sin(y)*cos(z)","x*sin(y)*sin(z)","x*cos(y)"); break; + case mglParabolic: + SetFunc("x*y","(x*x-y*y)/2"); break; + case mglParaboloidal: + SetFunc("(x*x-y*y)*cos(z)/2","(x*x-y*y)*sin(z)/2","x*y"); break; + case mglOblate: + SetFunc("cosh(x)*cos(y)*cos(z)","cosh(x)*cos(y)*sin(z)","sinh(x)*sin(y)"); break; +// SetFunc("x*y*cos(z)","x*y*sin(z)","(x*x-1)*(1-y*y)"); break; + case mglProlate: + SetFunc("sinh(x)*sin(y)*cos(z)","sinh(x)*sin(y)*sin(z)","cosh(x)*cos(y)"); break; + case mglElliptic: + SetFunc("cosh(x)*cos(y)","sinh(x)*sin(y)"); break; + case mglToroidal: + SetFunc("sinh(x)*cos(z)/(cosh(x)-cos(y))","sinh(x)*sin(z)/(cosh(x)-cos(y))", + "sin(y)/(cosh(x)-cos(y))"); break; + case mglBispherical: + SetFunc("sin(y)*cos(z)/(cosh(x)-cos(y))","sin(y)*sin(z)/(cosh(x)-cos(y))", + "sinh(x)/(cosh(x)-cos(y))"); break; + case mglBipolar: + SetFunc("sinh(x)/(cosh(x)-cos(y))","sin(y)/(cosh(x)-cos(y))"); break; + case mglLogLog: SetFunc("lg(x)","lg(y)"); break; + case mglLogX: SetFunc("lg(x)",""); break; + case mglLogY: SetFunc("","lg(y)"); break; + default: SetFunc(0,0); break; + } +} +//----------------------------------------------------------------------------- +void mglBase::ClearEq() +{ + if(fx) delete fx; if(fy) delete fy; if(fz) delete fz; + if(fa) delete fa; if(fc) delete fc; + fx = fy = fz = fc = fa = 0; + RecalcBorder(); +} +//----------------------------------------------------------------------------- +// Colors ids +//----------------------------------------------------------------------------- +mglColorID mglColorIds[] = {{'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)}, + {'w', mglColor(1,1,1)}, {'W', mglColor(0.7,0.7,0.7)}, + {'c', mglColor(0,1,1)}, {'C', mglColor(0,0.5,0.5)}, + {'m', mglColor(1,0,1)}, {'M', mglColor(0.5,0,0.5)}, + {'y', mglColor(1,1,0)}, {'Y', mglColor(0.5,0.5,0)}, + {'h', mglColor(0.5,0.5,0.5)}, {'H', mglColor(0.3,0.3,0.3)}, + {'l', mglColor(0,1,0.5)}, {'L', mglColor(0,0.5,0.25)}, + {'e', mglColor(0.5,1,0)}, {'E', mglColor(0.25,0.5,0)}, + {'n', mglColor(0,0.5,1)}, {'N', mglColor(0,0.25,0.5)}, + {'u', mglColor(0.5,0,1)}, {'U', mglColor(0.25,0,0.5)}, + {'q', mglColor(1,0.5,0)}, {'Q', mglColor(0.5,0.25,0)}, + {'p', mglColor(1,0,0.5)}, {'P', mglColor(0.5,0,0.25)}, + {' ', mglColor(-1,-1,-1)}, {0, mglColor(-1,-1,-1)} // the last one MUST have id=0 +}; +//----------------------------------------------------------------------------- +void mglColor::Set(mglColor c, float br) +{ + if(br<0) br=0; if(br>2.f) br=2.f; + r = br<=1.f ? c.r*br : 1 - (1-c.r)*(2-br); + g = br<=1.f ? c.g*br : 1 - (1-c.g)*(2-br); + b = br<=1.f ? c.b*br : 1 - (1-c.b)*(2-br); + a = 1; +} +//----------------------------------------------------------------------------- +void mglColor::Set(char p, float bright) +{ + Set(-1,-1,-1); + for(long i=0; mglColorIds[i].id; i++) + if(mglColorIds[i].id==p) + { Set(mglColorIds[i].col, bright); break; } +} +//----------------------------------------------------------------------------- +void mglTexture::Set(const char *s, int smooth, float alpha) +{ + // NOTE: New syntax -- colors are CCCCC or {CNCNCCCN}; options inside [] + if(!s || !s[0]) return; + register long i,j=0,m=0,l=strlen(s); + const char *cols = "kwrgbcymhWRGBCYMHlenpquLENPQU"; + for(i=0;i=0; // Use mapping, smoothed colors + for(i=j=n=0;i0 && s[i+1]>'0' && s[i+1]<='9')// ext color + { c[2*n] = mglColor(s[i],(s[i+1]-'0')/5.f); i++; } + else c[2*n] = mglColor(s[i]); // usual color + n++; + } + // NOTE: User can change alpha if it placed like {AN} + if(s[i]=='A' && j<1 && m>0 && s[i+1]>'0' && s[i+1]<='9') + { alpha = 0.1*(s[i+1]-'0'); i++; } + } + for(i=0;in-1) // NOTE: never should be here! + { col[2*i] = c[2*n-2];col[2*i+1] = c[2*n-1]; printf("AddTexture -- out of bounds"); } + else + { + col[2*i] = c[2*j]*(1-u)+c[2*j+2]*u; + col[2*i+1]=c[2*j+1]*(1-u)+c[2*j+3]*u; + } + } + col[512]=col[510]; col[513]=col[511]; + delete []c; +} +//----------------------------------------------------------------------------- +void mglTexture::GetC(float u,float v,mglPnt &p) +{ + u -= long(u); + register long i=long(256*u); u = u*256-i; + mglColor *s=col+2*i; + p.r = (s[0].r*(1-u)+s[2].r*u)*(1-v) + (s[1].r*(1-u)+s[3].r*u)*v; + p.g = (s[0].g*(1-u)+s[2].g*u)*(1-v) + (s[1].g*(1-u)+s[3].g*u)*v; + p.b = (s[0].b*(1-u)+s[2].b*u)*(1-v) + (s[1].b*(1-u)+s[3].b*u)*v; + 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(mglTexture &t) +{ return n==t.n && !memcmp(col,t.col,514*sizeof(mglColor)); } +//----------------------------------------------------------------------------- +long mglBase::AddTexture(const char *cols, int smooth) +{ + mglTexture t(cols,smooth); + if(t.n==0) return smooth<0 ? 0:1; + // check if already exist + for(unsigned long i=0;i=0) { p=(p+1)%n; id = 256*i+p; } + last_style[0]=MGL_DEF_PAL[p%strlen(MGL_DEF_PAL)]; // TODO: last_style correctly !!! + CDef = i + (n>0 ? (p+0.5)/n : 0); CurrPal++; + return CDef; +} +//----------------------------------------------------------------------------- +char mglBase::SetPenPal(const char *p, long *Id) +{ + char mk=0; + PDef = 0xffff; // reset to solid line + last_style[1]='-'; + + Arrow1 = Arrow2 = 0; PenWidth = 1; + if(p && *p!=0) + { +// const char *col = "wkrgbcymhRGBCYMHWlenuqpLENUQP"; + const char *stl = " -|;:ji="; + const char *mrk = "*o+xsd.^v<>"; + const char *wdh = "123456789"; + const char *arr = "AKDTVISO_"; + long m=0; + for(unsigned i=0;i0) continue; + if(strchr(stl,p[i])) + { + switch(p[i]) + { + case '|': PDef = 0x00ff; break; + case ';': PDef = 0x0f0f; break; + case '=': PDef = 0x3333; break; + case ':': PDef = 0x1111; break; + case 'j': PDef = 0x087f; break; + case 'i': PDef = 0x2727; break; + case ' ': PDef = 0x0000; break; + default: PDef = 0xffff; break; // '-' + } + last_style[1]=p[i]; + } + else if(strchr(mrk,p[i])) mk = p[i]; + else if(strchr(wdh,p[i])) + { last_style[2] = p[i]; PenWidth = p[i]-'0'; } + else if(strchr(arr,p[i])) + { + if(!Arrow1) Arrow1 = p[i]; + else Arrow2 = p[i]; + } + } + if(Arrow1=='_') Arrow1=0; if(Arrow2=='_') Arrow2=0; + if(strchr(p,'#')) + { + if(mk=='.') mk = 'C'; + if(mk=='+') mk = 'P'; + if(mk=='x') mk = 'X'; + if(mk=='o') mk = 'O'; + if(mk=='d') mk = 'D'; + if(mk=='s') mk = 'S'; + if(mk=='^') mk = 'T'; + if(mk=='v') mk = 'V'; + if(mk=='<') mk = 'L'; + if(mk=='>') mk = 'R'; + if(mk=='*') mk = 'Y'; + } + } + last_style[3]=mk; + long tt, n; + tt = AddTexture(p,-1); n=Txt[tt].n; + CDef = tt+((n+CurrPal-1)%n+0.5)/n; + if(Id) *Id=long(tt)*256+(n+CurrPal-1)%n; + return mk; +} +//----------------------------------------------------------------------------- +float mglBase::GetA(float a) +{ + if(fa) a = fa->Calc(0,0,0,a); + a = (a-FMin.c)/(FMax.c-FMin.c); + a = a<1?(a>0?a:0):1/MGL_FLT_EPS; // for texture a must be <1 always!!! + return a; +} +//----------------------------------------------------------------------------- +mglPoint GetX(const mglDataA *x, int i, int j, int k) +{ + k = kGetNz() ? k : 0; + if(x->GetNy()>1) + return mglPoint(x->v(i,j,k),x->dvx(i,j,k),x->dvy(i,j,k)); + else + return mglPoint(x->v(i),x->dvx(i),0); +} +//----------------------------------------------------------------------------- +mglPoint GetY(const mglDataA *y, int i, int j, int k) +{ + k = kGetNz() ? k : 0; + if(y->GetNy()>1) + return mglPoint(y->v(i,j,k),y->dvx(i,j,k),y->dvy(i,j,k)); + else + return mglPoint(y->v(j),0,y->dvx(j)); +} +//----------------------------------------------------------------------------- +mglPoint GetZ(const mglDataA *z, int i, int j, int k) +{ + if(z->GetNy()>1) + return mglPoint(z->v(i,j,k),z->dvx(i,j,k),z->dvy(i,j,k)); + else + return mglPoint(z->v(k),0,0); +} +//----------------------------------------------------------------------------- +void mglBase::vect_plot(long p1, long p2, float s) +{ + if(p1<0 || p2<0) return; + const mglPnt &q1=Pnt[p1], &q2=Pnt[p2]; + mglPnt s1=q2,s2=q2; + s = s<=0 ? 0.1 : s*0.1; + s1.x = q2.x - 3*s*(q2.x-q1.x) + s*(q2.y-q1.y); + s2.x = q2.x - 3*s*(q2.x-q1.x) - s*(q2.y-q1.y); + s1.y = q2.y - 3*s*(q2.y-q1.y) - s*(q2.x-q1.x); + s2.y = q2.y - 3*s*(q2.y-q1.y) + s*(q2.x-q1.x); + s1.z = s2.z = q2.z - 3*s*(q2.z-q1.z); + long n1,n2; + n1=Pnt.size(); MGL_PUSH(Pnt,s1,mutexPnt); + n2=Pnt.size(); MGL_PUSH(Pnt,s2,mutexPnt); + line_plot(p1,p2); line_plot(n1,p2); line_plot(p2,n2); +} +//----------------------------------------------------------------------------- +int mglFindArg(const char *str) +{ + register long l=0,k=0,i;//,j,len=strlen(lst); + for(i=0;i0) { s[n]=0; s=s+n+1; } + mgl_strtrim(a); b=s; + n=mglFindArg(s); if(n>0) { s[n]=0; s=s+n+1; } + mgl_strtrim(b); + + float ff=atof(b),ss; + if(!strcmp(a+1,"range")) + { + n=mglFindArg(s); c=s; + if(n>0) { s[n]=0; s=s+n+1; } + mgl_strtrim(c); ss = atof(c); + if(a[0]=='x') { Min.x=ff; Max.x=ss; } + else if(a[0]=='y') { Min.y=ff; Max.y=ss; } + else if(a[0]=='z') { Min.z=ff; Max.z=ss; } + else if(a[0]=='c') { Min.c=ff; Max.c=ss; } + } + else if(!strcmp(a,"cut")) SetCut(ff!=0 || !strncmp(s,"on",2)); + else if(!strcmp(a,"meshnum")) SetMeshNum(ff); + else if(!strcmp(a,"alpha")) SetAlphaDef(ff); + else if(!strcmp(a,"ambient")) SetAmbient(ff); + else if(!strcmp(a,"marksize")) SetMarkSize(ff); + else if(!strcmp(a,"fontsize")) SetFontSize(ff); + else if(!strcmp(a,"arrowsize")) SetArrowSize(ff); + else if(!strcmp(a,"size")) + { SetMarkSize(ff); SetFontSize(ff); SetArrowSize(ff); } + else if(!strcmp(a,"num") || !strcmp(a,"number") || !strcmp(a,"value")) res = ff; + } + free(q); prev_val=res; return res; +} +//----------------------------------------------------------------------------- +void mglBase::LoadState() +{ + if(!saved) return; + MarkSize=MSS; ArrowSize=ASS; + FontSize=FSS; AlphaDef=ADS; + MeshNum=MNS; SetCut(CSS); AmbBr=LSS; + Min=MinS; Max=MaxS; saved=false; +} +//----------------------------------------------------------------------------- diff --git a/src/base_cf.cpp b/src/base_cf.cpp new file mode 100644 index 0000000..29a3f2a --- /dev/null +++ b/src/base_cf.cpp @@ -0,0 +1,184 @@ +/*************************************************************************** + * base.cpp is part of Math gric Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "mgl/base_cf.h" +//----------------------------------------------------------------------------- +// +// C interfaces +// +//----------------------------------------------------------------------------- +void mgl_buf_warn(HMGL gr, char *buf) { gr->Message = buf; } +int mgl_get_warn(HMGL gr) { return gr->GetWarn(); } +void mgl_set_warn(HMGL gr, int code, const char *txt) +{ gr->SetWarn(code,txt); } +void mgl_set_origin(HMGL gr, float x0, float y0, float z0) +{ gr->SetOrigin(x0,y0,z0); } +void mgl_set_palette(HMGL gr, const char *colors) +{ gr->SetPalette(colors); } +void mgl_set_meshnum(HMGL gr, int num) { gr->SetMeshNum(num); } +void mgl_set_alpha_default(HMGL gr, float alpha) { gr->SetAlphaDef(alpha); } +//----------------------------------------------------------------------------- +void mgl_set_cut(HMGL gr, int cut) { gr->SetCut(cut); } +void mgl_set_cut_box(HMGL gr, float x1,float y1,float z1,float x2,float y2,float z2) +{ gr->SetCutBox(x1,y1,z1,x2,y2,z2); } +void mgl_set_cutoff(HMGL gr, const char *EqC) { gr->CutOff(EqC); } +//----------------------------------------------------------------------------- +void mgl_set_ternary(HMGL gr, int enable) { gr->Ternary(enable); } +void mgl_set_range_val(HMGL gr, char dir, float v1,float v2) +{ + if(dir=='c') gr->CRange(v1,v2); + else if(dir=='x') gr->XRange(v1,v2); + else if(dir=='y') gr->YRange(v1,v2); + else if(dir=='z') gr->ZRange(v1,v2); } +void mgl_set_range_dat(HMGL gr, char dir, HCDT a, int add) +{ + if(dir=='c') gr->CRange(_Da_(a),add); + else if(dir=='x') gr->XRange(_Da_(a),add); + else if(dir=='y') gr->YRange(_Da_(a),add); + else if(dir=='z') gr->ZRange(_Da_(a),add); } +void mgl_set_ranges(HMGL gr, float x1, float y1, float z1, float x2, float y2, float z2) +{ gr->SetRanges(x1,y1,z1,x2,y2,z2); } +void mgl_set_func(HMGL gr, const char *EqX,const char *EqY,const char *EqZ,const char *EqA) +{ gr->SetFunc(EqX,EqY,EqZ,EqA); } +void mgl_set_coor(HMGL gr, int how) { gr->SetCoor(how); } +//----------------------------------------------------------------------------- +long mgl_data_get_nx(HCDT d) { return _Da_(d).GetNx(); } +long mgl_data_get_ny(HCDT d) { return _Da_(d).GetNy(); } +long mgl_data_get_nz(HCDT d) { return _Da_(d).GetNz(); } +//----------------------------------------------------------------------------- +void mgl_set_bar_width(HMGL gr, float width) { gr->SetBarWidth(width); } +//----------------------------------------------------------------------------- +// +// Fortran interfaces +// +//----------------------------------------------------------------------------- +void mgl_set_origin_(uintptr_t *gr, float *x0, float *y0, float *z0) +{ _GR_->SetOrigin(*x0,*y0,*z0); } +int mgl_get_warn_(uintptr_t *gr) { return _GR_->GetWarn(); } +void mgl_set_warn_(uintptr_t *gr, int *code, const char *txt, int l) +{ char *s=new char[l+1]; memcpy(s,txt,l); s[l]=0; + _GR_->SetWarn(*code, s); delete []s; } +void mgl_set_palette_(uintptr_t *gr, const char *colors, int l) +{ char *s=new char[l+1]; memcpy(s,colors,l); s[l]=0; + _GR_->SetPalette(s); delete []s; } +void mgl_set_meshnum_(uintptr_t *gr, int *num) { _GR_->SetMeshNum(*num); } +void mgl_set_alpha_default_(uintptr_t *gr, float *alpha) { _GR_->SetAlphaDef(*alpha); } +//----------------------------------------------------------------------------- +void mgl_set_cut_box_(uintptr_t *gr, float *x1,float *y1,float *z1,float *x2,float *y2,float *z2) +{ _GR_->SetCutBox(*x1,*y1,*z1,*x2,*y2,*z2); } +void mgl_set_cut_(uintptr_t *gr, int *cut) { _GR_->SetCut(*cut); } +void mgl_set_cutoff_(uintptr_t *gr, const char *EqC, int l) +{ char *s=new char[l+1]; memcpy(s,EqC,l); s[l]=0; + _GR_->CutOff(s); delete []s; } +//----------------------------------------------------------------------------- +void mgl_set_ternary_(uintptr_t *gr, int *enable) { _GR_->Ternary(*enable); } +void mgl_set_range_val_(uintptr_t *gr, const char *dir, float *v1,float *v2,int) +{ + if(*dir=='c') _GR_->CRange(*v1,*v2); + else if(*dir=='x') _GR_->XRange(*v1,*v2); + else if(*dir=='y') _GR_->YRange(*v1,*v2); + else if(*dir=='z') _GR_->ZRange(*v1,*v2); } +void mgl_set_range_dat_(uintptr_t *gr, const char *dir, uintptr_t *a, int *add,int) +{ + if(*dir=='c') _GR_->CRange(*_DA_(a),*add); + else if(*dir=='x') _GR_->XRange(*_DA_(a),*add); + else if(*dir=='y') _GR_->YRange(*_DA_(a),*add); + else if(*dir=='z') _GR_->ZRange(*_DA_(a),*add); } +void mgl_set_ranges_(uintptr_t *gr, float *x1, float *y1, float *z1, float *x2, float *y2, float *z2) +{ _GR_->SetRanges(*x1,*y1,*z1,*x2,*y2,*z2); } +void mgl_set_func_(uintptr_t *gr, const char *EqX,const char *EqY,const char *EqZ,const char *EqA,int lx,int ly,int lz,int la) +{ + char *sx=new char[lx+1]; memcpy(sx,EqX,lx); sx[lx]=0; + char *sy=new char[ly+1]; memcpy(sy,EqY,ly); sy[ly]=0; + char *sz=new char[lz+1]; memcpy(sz,EqZ,lz); sz[lz]=0; + char *sa=new char[la+1]; memcpy(sa,EqA,la); sa[la]=0; + _GR_->SetFunc(sx,sy,sz,sa); + delete []sx; delete []sy; delete []sz; delete []sa; +} +void mgl_set_coor_(uintptr_t *gr, int *how) +{ _GR_->SetCoor(*how); } +//----------------------------------------------------------------------------- +long mgl_data_get_nx_(uintptr_t *d) { return _DA_(d)->GetNx(); } +long mgl_data_get_ny_(uintptr_t *d) { return _DA_(d)->GetNy(); } +long mgl_data_get_nz_(uintptr_t *d) { return _DA_(d)->GetNz(); } +//----------------------------------------------------------------------------- +void mgl_set_tick_rotate(HMGL gr, int enable){ gr->SetTickRotate(enable); } +void mgl_set_tick_skip(HMGL gr, int enable) { gr->SetTickSkip(enable); } +void mgl_set_tick_rotate_(uintptr_t *gr,int *enable){ _GR_->SetTickRotate(*enable); } +void mgl_set_tick_skip_(uintptr_t *gr, int *enable) { _GR_->SetTickSkip(*enable); } +//----------------------------------------------------------------------------- +void mgl_set_rotated_text(HMGL gr, int enable) { gr->SetRotatedText(enable); } +void mgl_set_mark_size(HMGL gr, mreal size) { gr->SetMarkSize(size); } +void mgl_set_arrow_size(HMGL gr, mreal size) { gr->SetArrowSize(size); } +void mgl_set_font_size(HMGL gr, mreal size) { gr->SetFontSize(size); } +void mgl_set_font_def(HMGL gr, const char *fnt) { gr->SetFontDef(fnt); } +void mgl_load_font(HMGL gr, const char *name, const char *path) +{ gr->GetFont()->Load(name,path); } +void mgl_copy_font(HMGL gr, HMGL gr_from) { gr->GetFont()->Copy(gr_from->GetFont()); } +void mgl_restore_font(HMGL gr) { gr->GetFont()->Restore(); } +//----------------------------------------------------------------------------- +void mgl_set_bar_width_(uintptr_t *gr, float *width) { _GR_->SetBarWidth(*width); } +void mgl_set_rotated_text_(uintptr_t *gr, int *rotated) { _GR_->SetRotatedText(*rotated); } +void mgl_set_mark_size_(uintptr_t *gr, mreal *size) { _GR_->SetMarkSize(*size); } +void mgl_set_arrow_size_(uintptr_t *gr, mreal *size) { _GR_->SetArrowSize(*size); } +void mgl_set_font_size_(uintptr_t *gr, mreal *size) { _GR_->SetFontSize(*size); } +void mgl_set_font_def_(uintptr_t *gr, char *name, int l) +{ char *s=new char[l+1]; memcpy(s,name,l); s[l]=0; + _GR_->SetFontDef(s); delete []s; } +void mgl_load_font_(uintptr_t *gr, char *name, char *path, int l,int n) +{ char *s=new char[l+1]; memcpy(s,name,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,path,n); d[n]=0; + _GR_->GetFont()->Load(s,d); delete []s; delete []d; } +void mgl_copy_font_(uintptr_t *gr, uintptr_t *gr_from) +{ _GR_->GetFont()->Copy(((mglBase *)(*gr_from))->GetFont()); } +void mgl_restore_font_(uintptr_t *gr) { _GR_->GetFont()->Restore(); } +//----------------------------------------------------------------------------- +void mgl_start_group(HMGL gr, const char *s) { gr->StartAutoGroup(s); } +void mgl_end_group(HMGL gr) { gr->EndGroup(); } +void mgl_start_group_(uintptr_t *gr, const char *name,int l) +{ char *s=new char[l+1]; memcpy(s,name,l); s[l]=0; + _GR_->StartAutoGroup(s); delete []s; } +void mgl_end_group_(uintptr_t *gr) { _GR_->EndGroup(); } +//----------------------------------------------------------------------------- +#include +bool mglTestMode=false; +void mgl_test_txt(const char *str, ...) +{ + if(mglTestMode) + { + char buf[256]; + va_list lst; + va_start(lst,str); + vsprintf(buf,str,lst); + va_end(lst); + printf("TEST: %s\n",buf); + fflush(stdout); + } +} +void mgl_set_test_mode(int enable) +{ mglTestMode=enable; } +//--------------------------------------------------------------------------- +long mgl_use_graph(HMGL gr, int inc) +{ gr->InUse+=inc; return gr->InUse; } +long mgl_use_graph_(uintptr_t *gr, int *inc) +{ _GR_->InUse+=*inc; return _GR_->InUse; } +//--------------------------------------------------------------------------- +void mgl_set_ambbr(HMGL gr, float i) { gr->SetAmbient(i); } +void mgl_set_ambbr_(uintptr_t *gr, float *i){ _GR_->SetAmbient(*i); } +//--------------------------------------------------------------------------- diff --git a/src/canvas.cpp b/src/canvas.cpp new file mode 100644 index 0000000..57296ab --- /dev/null +++ b/src/canvas.cpp @@ -0,0 +1,759 @@ +/*************************************************************************** + * canvas.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License 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 +#include "mgl/canvas.h" +//----------------------------------------------------------------------------- +mglCanvas::mglCanvas(int w, int h) : mglBase() +{ + clr(MGL_DISABLE_SCALE); + Z=0; C=G=G4=0; OI=0; gif=0; + CurFrameId=0; + Width=Height=Depth=0; ObjId=-1; + fscl=ftet=0; + dr_nx1=dr_nx2=dr_ny1=dr_ny2=0; // Allowed drawing region + + fnt = new mglFont; fnt->gr = this; ac.ch='c'; + ax.dir = mglPoint(1,0,0); ax.a = mglPoint(0,1,0); ax.b = mglPoint(0,0,1); ax.ch='x'; + ay.dir = mglPoint(0,1,0); ay.a = mglPoint(1,0,0); ay.b = mglPoint(0,0,1); ay.ch='y'; + az.dir = mglPoint(0,0,1); az.a = mglPoint(0,1,0); az.b = mglPoint(1,0,0); az.ch='z'; +#ifdef HAVE_PTHREAD + pthread_mutex_init(&mutexSub,0); pthread_mutex_init(&mutexLeg,0); + pthread_mutex_init(&mutexPrm,0); pthread_mutex_init(&mutexPtx,0); + pthread_mutex_init(&mutexStk,0); pthread_mutex_init(&mutexGrp,0); +#endif + SetSize(w,h); SetQuality(MGL_DRAW_NORM); DefaultPlotParam(); +} +//----------------------------------------------------------------------------- +mglCanvas::~mglCanvas() +{ + delete fnt; + if(G) { delete []G; delete []C; delete []Z; delete []G4;delete []OI; } +} +//----------------------------------------------------------------------------- +float mglCanvas::GetRatio() { return inW/inH; } +void mglCanvas::AddLegend(const wchar_t *text,const char *style) +{ if(text) MGL_PUSH(Leg,mglText(text,style),mutexLeg); } +void mglCanvas::add_prim(mglPrim &a) +{ a.id = ObjId; MGL_PUSH(Prm,a,mutexPrm); clr(MGL_FINISHED); } +//----------------------------------------------------------------------------- +void mglCanvas::DefaultPlotParam() +{ +/* NOTE: following variables and mutex will not be changed +std::vector Txt; ///< Pointer to textures +char *Message; ///< Buffer for receiving messages +long InUse; ///< Smart pointer (number of users) +mglPoint LastMousePos; ///< Last mouse position +mglFont *fnt; ///< Class for printing vector text +int Quality; ///< Quality of plot (0x0-pure, 0x1-fast; 0x2-fine; 0x4 - low memory) +int Width; ///< Width of the image +int Height; ///< Height of the image +int Depth; ///< Depth of the image +int CurFrameId; ///< Number of automaticle created frames +GifFileType *gif; +*/ + SetTickRotate(true); SetTickSkip(true); + SetWarn(mglWarnNone); ObjId = 0; + SetFunc(0,0); CutOff(0); + SetRanges(mglPoint(-1,-1,-1,-1), mglPoint(1,1,1,1)); + SetBarWidth(0.7); SetMarkSize(1); SetArrowSize(1); + SetAlphaDef(0.5); FontDef[0]=0; + SetTranspType(0); SetMeshNum(0); + SetRotatedText(true); CurrPal = 0; + SetLegendMarks(); SetFontSize(4); + SetTuneTicks(true); + Clf(); SetAmbient(); Ternary(0); + PlotId = "frame"; clr(MGL_DISABLE_SCALE); + SetDefScheme("BbcyrR"); SetPalette(MGL_DEF_PAL); + SetPenPal("k-1"); + SetTicks('x'); SetTicks('y'); SetTicks('z'); SetTicks('c'); + _tetx=_tety=_tetz=0; stack.clear(); + Alpha(false); FactorPos = 1.07; + SetTickLen(0); SetCut(true); + AdjustTicks("xyzc",true); + + for(int i=0;i<10;i++) { AddLight(i, mglPoint(0,0,1)); Light(i,false); } + Light(0,true); Light(false); + SetPlotFactor(0); InPlot(0,1,0,1,false); +} +//----------------------------------------------------------------------------- +// Optimal axis position +//----------------------------------------------------------------------------- +float mglCanvas::FindOptOrg(char dir, int ind) +{ + static mglPoint px, py, pz, m1, m2; + static mglMatrix bb; bb.b[0]=1e30; + mglPoint nn[8]={mglPoint(0,0,0), mglPoint(0,0,1), mglPoint(0,1,0), mglPoint(0,1,1), + mglPoint(1,0,0), mglPoint(1,0,1), mglPoint(1,1,0), mglPoint(1,1,1)}, pp[8]; + memcpy(pp, nn, 8*sizeof(mglPoint)); + // do nothing if transformation matrix the same + if(memcmp(B.b,bb.b,9*sizeof(float)) || m1!=Min || m2!=Max) + { + m1 = Min; m2 = Max; memcpy(&bb,&B,sizeof(mglMatrix)); + PostScale(pp,8); + // find point with minimal y + register long i,j; + for(i=j=0;i<8;i++) if(pp[i].y1-x + px = Min+(Max-Min)/px; + py = Min+(Max-Min)/py; + pz = Min+(Max-Min)/pz; + } + float res = px.val(ind); + if(dir=='y') res = py.val(ind); + if(dir=='z') res = pz.val(ind); + return res; +} +//----------------------------------------------------------------------------- +float mglCanvas::GetOrgX(char dir) +{ + float res = Org.x; + if(isnan(res)) + { + if(strchr("xyz",dir)) res = FindOptOrg(dir,0); + else if(dir=='t') res = Min.x; + else res = B.b[6]>0 ? Max.x:Min.x; + } + return res; +} +//----------------------------------------------------------------------------- +float mglCanvas::GetOrgY(char dir) +{ + float res = Org.y; + if(isnan(res)) + { + if(strchr("xyz",dir)) res = FindOptOrg(dir,1); + else if(dir=='t') res = Min.y; + else res = B.b[7]>0 ? Max.y:Min.y; + } + return res; +} +//----------------------------------------------------------------------------- +float mglCanvas::GetOrgZ(char dir) +{ + float res = Org.z; + if(isnan(res)) + { + if(strchr("xyz",dir)) res = FindOptOrg(dir,2); + else if(dir=='t') res = Min.z; + else res = B.b[8]>0 ? Max.z:Min.z; + } + return res; +} +//----------------------------------------------------------------------------- +// Put primitives +//----------------------------------------------------------------------------- +#define MGL_MARK_PLOT if(Quality&4) mark_draw(p,type,size?size:MarkSize,&d);else \ + { mglPrim a; a.w = fabs(PenWidth); a.s = size?size:MarkSize; \ + a.n1 = p; a.n4 = type; a.z = Pnt[p].z; add_prim(a); } +void mglCanvas::mark_plot(long p, char type, float size) +{ + if(p<0 || isnan(Pnt[p].x)) return; + long pp=p; + mglDrawReg d; d.set(this,1,1,0); + if(size>=0) size *= MarkSize; + if(TernAxis&4) for(int i=0;i<4;i++) + { p = ProjScale(i, pp); MGL_MARK_PLOT } + else { MGL_MARK_PLOT } +} +//----------------------------------------------------------------------------- +#define MGL_LINE_PLOT if(Quality&4) line_draw(p1,p2,&dd);else \ + { mglPrim a(1); a.z = (Pnt[p1].z+Pnt[p2].z)/2; \ + if(pw>1) a.z += pw-1; a.n3=PDef; a.s = pPos; \ + a.n1 = p1; a.n2 = p2; a.w = pw; add_prim(a); } +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; + mglDrawReg dd; dd.set(this,1,1,0); + long pp1=p1,pp2=p2; + float pw = fabs(PenWidth),d; + d = hypot(Pnt[p1].x-Pnt[p2].x, Pnt[p1].y-Pnt[p2].y); + if(TernAxis&4) for(int i=0;i<4;i++) + { p1 = ProjScale(i, pp1); p2 = ProjScale(i, pp2); + MGL_LINE_PLOT } + else { MGL_LINE_PLOT } + pPos = fmod(pPos+d/pw/1.5, 16); +} +//----------------------------------------------------------------------------- +#define MGL_TRIG_PLOT if(Quality&4) trig_draw(p1,p2,p3,true,&d);else \ + { mglPrim a(2); a.n1 = p1; a.n2 = p2; a.n3 = p3; \ + a.z = (Pnt[p1].z+Pnt[p2].z+Pnt[p3].z)/3; 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; + 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++) + { p1 = ProjScale(i, pp1); p2 = ProjScale(i, pp2); + p3 = ProjScale(i, pp3); MGL_TRIG_PLOT } + else { MGL_TRIG_PLOT } +} +//----------------------------------------------------------------------------- +#define MGL_QUAD_PLOT if(Quality&4) quad_draw(p1,p2,p3,p4,&d);else \ + { mglPrim a(3); a.n1 = p1; a.n2 = p2; a.n3 = p3; a.n4 = p4; \ + a.z = (Pnt[p1].z+Pnt[p2].z+Pnt[p3].z+Pnt[p4].z)/4; \ + 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; } + 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++) + { p1 = ProjScale(i, pp1); p2 = ProjScale(i, pp2); + p3 = ProjScale(i, pp3); p4 = ProjScale(i, pp4); + MGL_QUAD_PLOT } + else { MGL_QUAD_PLOT } +} +//----------------------------------------------------------------------------- +float mglCanvas::text_plot(long p,const wchar_t *text,const char *font,float size,float sh,float col) +{ + if(p<0 || isnan(Pnt[p].x)) return 0; + if(size<0) size *= -FontSize; + if(!font) font=""; + + if(TernAxis&4) // text at projections + { + float res; + TernAxis = TernAxis&(~4); + for(int i=0;i<4;i++) + res = text_plot(ProjScale(i,p),text,font,size/2,sh,col); + TernAxis = TernAxis|4; + return res; + } + + if(!(Quality&4)) // add text itself + { + mglPrim a(6); + a.n1 = p; a.z = Pnt[p].z; + mglText txt(text,font); + MGL_PUSH(Ptx,txt,mutexPtx); + a.n3 = Ptx.size()-1; + a.s = size; a.w = sh; a.p=col; + add_prim(a); + } + float shift = -sh-0.2, fsize=size/8.*font_factor, h = fnt->Height(font)*fsize, w; + if(strchr(font,'@')) // draw box around text + { + long k1,k2,k3,k4; + w = fnt->Width(text,font)*fsize; + mglPnt pp=Pnt[p], pt; + int align; mglGetStyle(font,0,&align); align = align&3; + float d=-w*align/2.; + pt = pp; pt.x+= d; MGL_PUSH(Pnt,pt,mutexPnt); k1=Pnt.size()-1; + pt = pp; pt.x+= w+d; MGL_PUSH(Pnt,pt,mutexPnt); k2=Pnt.size()-1; + pt = pp; pt.x+= d; pt.y+= h/2; MGL_PUSH(Pnt,pt,mutexPnt); k3=Pnt.size()-1; + pt = pp; pt.x+= w+d; pt.y+= h/2; MGL_PUSH(Pnt,pt,mutexPnt); k4=Pnt.size()-1; + line_plot(k1,k2); line_plot(k1,k3); line_plot(k4,k2); line_plot(k4,k3); + } + // text drawing itself + Push(); + if(strchr(font,'T')) shift = sh+0.2; + shift += 0.11; // Correction for glyph rotation around proper point + + mglPnt q=Pnt[p]; + float ll = q.u*q.u+q.v*q.v; + if(q.u<0) { q.u=-q.u; q.v=-q.v; q.w=-q.w; } + shift *= h; B.z= q.z; + if(ll==0) { Pop(); return 0; } + + if(isnan(ll) || !get(MGL_ENABLE_RTEXT)) + { + fscl = fsize; ftet = 0; + B.x = q.x; B.y= q.y - shift; + } + else + { + if(ll==0) { Pop(); return 0; } + B.x = q.x+shift*q.v/sqrt(ll); + B.y= q.y-shift*q.u/sqrt(ll); + fscl = fsize; + ftet = -180*atan2(q.v,q.u)/M_PI; + } + fsize *= fnt->Puts(text,font,col)/2; + Pop(); return fsize; +} +//----------------------------------------------------------------------------- +void mglCanvas::Glyph(float x, float y, float f, int s, long j, float col) +{ + mglPrim a(4); + a.s = fscl/B.pf; a.w = ftet; a.p = B.pf; + float cc = col<0 ? AddTexture(char(0.5-col)):col; + if(cc<0) cc = CDef; + a.n1 = AddPnt(mglPoint(B.x,B.y,B.z), cc, mglPoint(x,y,f/fnt->GetFact(s&3)), -1, 0); + a.n3 = s; a.n4 = j; a.z = B.z; + if(a.n1<0) return; + mglDrawReg d; d.set(this,1,1,0); + if(Quality&4) glyph_draw(&a,&d); + else add_prim(a); +} +//----------------------------------------------------------------------------- +// Plot positioning functions +//----------------------------------------------------------------------------- +void mglCanvas::SubPlot(int nx,int ny,int m, float dx, float dy) +{ + float x1,x2,y1,y2; + int mx = m%nx, my = m/nx; + if(get(MGL_AUTO_FACTOR)) { dx /= 1.55; dy /= 1.55; } + else { dx /= 2; dy /= 2; } + x1 = (mx+dx)/nx; x2 = (mx+1+dx)/nx; + y2 = 1.f-(my+dy)/ny; y1 = 1.f-(my+1+dy)/ny; + InPlot(x1,x2,y1,y2,false); +} +//----------------------------------------------------------------------------- +void mglCanvas::SubPlot(int nx,int ny,int m, const char *style) +{ + float x1,x2,y1,y2; + int mx = m%nx, my = m/nx; + x1 = float(mx)/nx; x2 = float(mx+1)/nx; + y2 = 1.f-float(my)/ny; y1 = 1.f-float(my+1)/ny; + InPlot(x1,x2,y1,y2,style); +} +//----------------------------------------------------------------------------- +void mglCanvas::MultiPlot(int nx,int ny,int m, int dx, int dy, const char *style) +{ + float x1,x2,y1,y2; + int mx = m%nx, my = m/nx; + dx = (dx<1 || dx+mx>=nx) ? 1 : dx; + dy = (dy<1 || dy+my>=ny) ? 1 : dy; + x1 = float(mx)/nx; x2 = float(mx+dx)/nx; + y2 = 1-float(my)/ny; y1 = 1-float(my+dy)/ny; + InPlot(x1,x2,y1,y2,style); +} +//----------------------------------------------------------------------------- +void mglCanvas::InPlot(float x1,float x2,float y1,float y2, const char *st) +{ + if(Width<=0 || Height<=0 || Depth<=0) return; + if(!st) { InPlot(x1,x2,y1,y2,false); return; } + inW = Width*(x2-x1); inH = Height*(y2-y1); Persp = 0; + mglPrim p; p.id = ObjId; + p.n1=x1*Width; p.n2=x2*Width; p.n3=y1*Height; p.n4=y2*Height; + MGL_PUSH(Sub,p,mutexSub); + + if(strchr(st,'T')) { y1*=0.9; y2*=0.9; } // general title + bool r = !(strchr(st,'r') || strchr(st,'R') || strchr(st,'>') || strchr(st,'g')); + bool l = !(strchr(st,'l') || strchr(st,'L') || strchr(st,'<') || strchr(st,'g')); + bool u = !(strchr(st,'u') || strchr(st,'U') || strchr(st,'_') || strchr(st,'g')); + bool a = !(strchr(st,'a') || strchr(st,'A') || strchr(st,'^') || strchr(st,'g') || strchr(st,'t')); + // let use simplified scheme -- i.e. no differences between axis, colorbar and/or title + register float xs=(x1+x2)/2, ys=(y1+y2)/2, f1 = 1.3, f2 = 1.1; + if(r && l) { x2=xs+(x2-xs)*f1; x1=xs+(x1-xs)*f1; } + else if(r) { x2=xs+(x2-xs)*f1; x1=xs+(x1-xs)*f2; } + else if(l) { x2=xs+(x2-xs)*f2; x1=xs+(x1-xs)*f1; } + if(a && u) { y2=ys+(y2-ys)*f1; y1=ys+(y1-ys)*f1; } + else if(a) { y2=ys+(y2-ys)*f1; y1=ys+(y1-ys)*f2; } + else if(u) { y2=ys+(y2-ys)*f2; y1=ys+(y1-ys)*f1; } + + B.clear(); + if(get(MGL_AUTO_FACTOR)) B.pf = 1.55; // Automatically change plot factor !!! + B.x = (x1+x2)/2*Width; + B.y = (y1+y2)/2*Height; + B.b[0] = Width*(x2-x1); B.b[4] = Height*(y2-y1); + B.b[8] = sqrt(B.b[0]*B.b[4]); + B.z = (1.f-B.b[8]/(2*Depth))*Depth; + B1=B; font_factor = B.b[0] < B.b[4] ? B.b[0] : B.b[4]; +} +//----------------------------------------------------------------------------- +void mglCanvas::InPlot(float x1,float x2,float y1,float y2, bool rel) +{ + if(Width<=0 || Height<=0 || Depth<=0) return; + B.clear(); + if(get(MGL_AUTO_FACTOR)) B.pf = 1.55; // Automatically change plot factor !!! + if(rel) + { + B.x = B1.x + (x1+x2-1)/2*B1.b[0]; + B.y = B1.y + (y1+y2-1)/2*B1.b[4]; + B.b[0] = B1.b[0]*(x2-x1); B.b[4] = B1.b[4]*(y2-y1); + B.b[8] = sqrt(B.b[0]*B.b[4]); + B.z = B1.z + (1.f-B.b[8]/(2*Depth))*B1.b[8]; + } + else + { + B.x = (x1+x2)/2*Width; + B.y = (y1+y2)/2*Height; + B.b[0] = Width*(x2-x1); B.b[4] = Height*(y2-y1); + B.b[8] = sqrt(B.b[0]*B.b[4]); + B.z = (1.f-B.b[8]/(2*Depth))*Depth; + B1=B; + } + inW = B.b[0]; inH=B.b[4]; Persp = 0; + font_factor = B.b[0] < B.b[4] ? B.b[0] : B.b[4]; + mglPrim p; p.id = ObjId; + p.n1=x1*Width; p.n2=x2*Width; p.n3=y1*Height; p.n4=y2*Height; + MGL_PUSH(Sub,p,mutexSub); +} +//----------------------------------------------------------------------------- +void mglCanvas::Rotate(float TetX,float TetZ,float TetY) +{ + RotateN(TetX+_tetx,1.,0.,0.); + RotateN(TetY+_tety,0.,1.,0.); + RotateN(TetZ+_tetz,0.,0.,1.); +} +//----------------------------------------------------------------------------- +void mglCanvas::RotateN(float Tet,float x,float y,float z) +{ + float R[9],T[9],c=cos(Tet*M_PI/180),s=-sin(Tet*M_PI/180),r=1-c,n=sqrt(x*x+y*y+z*z); + x/=n; y/=n; z/=n; + T[0] = x*x*r+c; T[1] = x*y*r-z*s; T[2] = x*z*r+y*s; + T[3] = x*y*r+z*s; T[4] = y*y*r+c; T[5] = y*z*r-x*s; + T[6] = x*z*r-y*s; T[7] = y*z*r+x*s; T[8] = z*z*r+c; + memcpy(R,B.b,9*sizeof(float)); + B.b[0] = T[0]*R[0] + T[3]*R[1] + T[6]*R[2]; + B.b[1] = T[1]*R[0] + T[4]*R[1] + T[7]*R[2]; + B.b[2] = T[2]*R[0] + T[5]*R[1] + T[8]*R[2]; + B.b[3] = T[0]*R[3] + T[3]*R[4] + T[6]*R[5]; + B.b[4] = T[1]*R[3] + T[4]*R[4] + T[7]*R[5]; + B.b[5] = T[2]*R[3] + T[5]*R[4] + T[8]*R[5]; + B.b[6] = T[0]*R[6] + T[3]*R[7] + T[6]*R[8]; + B.b[7] = T[1]*R[6] + T[4]*R[7] + T[7]*R[8]; + B.b[8] = T[2]*R[6] + T[5]*R[7] + T[8]*R[8]; + if(get(MGL_AUTO_FACTOR)) + { + float w=(fabs(B.b[3])+fabs(B.b[4])+fabs(B.b[5]))/B1.b[4]; + float h=(fabs(B.b[0])+fabs(B.b[1])+fabs(B.b[2]))/B1.b[0]; + B.pf = 1.55+0.6147*(w=0;i--) + { + const mglPrim &p = Sub[i]; + if(p.n1<=x && p.n2>=x && p.n3<=y && p.n4>=y) + { id=p.id; break; } + } + return id; +} +//----------------------------------------------------------------------------- +void mglCanvas::Aspect(float Ax,float Ay,float Az) +{ + float a = fabs(Ax) > fabs(Ay) ? fabs(Ax) : fabs(Ay); + a = a > fabs(Az) ? a : fabs(Az); + if(a==0) { SetWarn(mglWarnZero,"Aspect"); return; } + Ax/=a; Ay/=a; Az/=a; + B.b[0] *= Ax; B.b[3] *= Ax; B.b[6] *= Ax; + B.b[1] *= Ay; B.b[4] *= Ay; B.b[7] *= Ay; + B.b[2] *= Az; B.b[5] *= Az; B.b[8] *= Az; +} +//----------------------------------------------------------------------------- +void mglCanvas::StickPlot(int num, int id, float tet, float phi) +{ + float dx,dy,w0,h0; + mglPoint p1(-1,0,0), p2(1,0,0); + InPlot(0,1,0,1,true); Rotate(tet, phi); + PostScale(p1); PostScale(p2); + w0=1/(1+(num-1)*fabs(p2.x-p1.x)/inW); dx=(p2.x-p1.x)*w0/inW; + h0=1/(1+(num-1)*fabs(p2.y-p1.y)/inH); dy=(p2.y-p1.y)*h0/inH; + + p1 = mglPoint(-1,0,0); p2 = mglPoint(1,0,0); + InPlot(dx>0?0:1-w0, dx>0?w0:1, dy>0?0:1-h0, dy>0?h0:1, true); + Rotate(tet,phi); PostScale(p1); PostScale(p2); + w0=1/(1+(num-1)*fabs(p2.x-p1.x)/inW); dx=(p2.x-p1.x)*w0/inW; + h0=1/(1+(num-1)*fabs(p2.y-p1.y)/inH); dy=(p2.y-p1.y)*h0/inH; + + float x1=dx>0?dx*id:1-w0+dx*id, x2=dx>0?w0+dx*id:1+dx*id; + float y1=dy>0?dy*id:1-h0+dy*id, y2=dy>0?h0+dy*id:1+dy*id; + InPlot(x1, x2, y1, y2, true); Rotate(tet,phi); +} +//----------------------------------------------------------------------------- +void mglCanvas::ColumnPlot(int num, int i, float dd) +{ + float d = i/(num+B.pf-1); + float w = B.pf/(num+B.pf-1); + InPlot(0,1,d,d+w*(1-dd),true); +} +//----------------------------------------------------------------------------- +// Lighting and transparency +//----------------------------------------------------------------------------- +void mglCanvas::Fog(float d, float dz) { FogDist=d; FogDz = dz; } +//----------------------------------------------------------------------------- +bool mglCanvas::Alpha(bool enable) +{ bool t=get(MGL_ENABLE_ALPHA); set(enable,MGL_ENABLE_ALPHA); return t; } +//----------------------------------------------------------------------------- +bool mglCanvas::Light(bool enable) +{ bool t=get(MGL_ENABLE_LIGHT); set(enable,MGL_ENABLE_LIGHT); return t; } +//----------------------------------------------------------------------------- +void mglCanvas::Light(int n, bool enable) +{ + if(n<0 || n>9) { SetWarn(mglWarnLId); return; } + light[n].n = enable; +} +//----------------------------------------------------------------------------- +void mglCanvas::AddLight(int n, mglPoint p, char col, float br, bool inf, float ap) +{ + if(n<0 || n>9) { SetWarn(mglWarnLId); return; } + light[n].n = true; light[n].a = ap>0?ap*ap:3; + light[n].b = br; light[n].i = inf; + light[n].r = p; light[n].c = mglColor(col); +} +//----------------------------------------------------------------------------- +void mglCanvas::arrow_plot(long n1, long n2,char st) +{ + if(n1<0 || n2<0 || !strchr("AVKSDTIO",st)) return; + const mglPnt &p1=Pnt[n1], &p2=Pnt[n2]; + mglPnt q1=p1,q2=p1,q3=p1,q4=p1; + q1.u=q2.u=q3.u=q4.u=NAN; + + float lx=p1.x-p2.x, ly=p1.y-p2.y, ll, kx,ky; + ll = hypot(lx,ly)/(PenWidth*ArrowSize*0.35*font_factor); + if(ll==0) return; + lx /= ll; ly /= ll; kx = ly; ky = -lx; + Reserve(6); + long k1,k2,k3,k4; + + switch(st) + { + case 'I': + q1.x = p1.x+kx; q1.y = p1.y+ky; k1=Pnt.size(); MGL_PUSH(Pnt,q1,mutexPnt); + q2.x = p1.x-kx; q2.y = p1.y-ky; k2=Pnt.size(); MGL_PUSH(Pnt,q2,mutexPnt); + line_plot(k1,k2); break; + case 'D': + q1.x = p1.x+kx; q1.y = p1.y+ky; k1=Pnt.size(); MGL_PUSH(Pnt,q1,mutexPnt); + q2.x = p1.x+lx; q2.y = p1.y+ly; k2=Pnt.size(); MGL_PUSH(Pnt,q2,mutexPnt); + q3.x = p1.x-kx; q3.y = p1.y-ky; k3=Pnt.size(); MGL_PUSH(Pnt,q3,mutexPnt); + q4.x = p1.x-lx; q4.y = p1.y-ly; k4=Pnt.size(); MGL_PUSH(Pnt,q4,mutexPnt); + quad_plot(k1,k2,k4,k3); break; + case 'S': + q1.x = p1.x+kx-lx; q1.y = p1.y+ky-ly; k1=Pnt.size(); MGL_PUSH(Pnt,q1,mutexPnt); + q2.x = p1.x-kx-lx; q2.y = p1.y-ky-ly; k2=Pnt.size(); MGL_PUSH(Pnt,q2,mutexPnt); + q3.x = p1.x-kx+lx; q3.y = p1.y-ky+ly; k3=Pnt.size(); MGL_PUSH(Pnt,q3,mutexPnt); + q4.x = p1.x+kx+lx; q4.y = p1.y+ky+ly; k4=Pnt.size(); MGL_PUSH(Pnt,q4,mutexPnt); + quad_plot(k1,k2,k4,k3); break; + case 'T': + q1.x = p1.x+kx-lx; q1.y = p1.y+ky-ly; k1=Pnt.size(); MGL_PUSH(Pnt,q1,mutexPnt); + q2.x = p1.x-kx-lx; q2.y = p1.y-ky-ly; k2=Pnt.size(); MGL_PUSH(Pnt,q2,mutexPnt); + q3.x = p1.x+lx; q3.y = p1.y+ly; k3=Pnt.size(); MGL_PUSH(Pnt,q3,mutexPnt); + trig_plot(k1,k2,k3); break; + case 'A': + q1.x = p1.x; q1.y = p1.y; k1=Pnt.size(); MGL_PUSH(Pnt,q1,mutexPnt); + q2.x = p1.x-kx-2*lx; q2.y = p1.y-ky-2*ly; k2=Pnt.size(); MGL_PUSH(Pnt,q2,mutexPnt); + q3.x = p1.x-1.5*lx; q3.y = p1.y-1.5*ly; k3=Pnt.size(); MGL_PUSH(Pnt,q3,mutexPnt); + q4.x = p1.x+kx-2*lx; q4.y = p1.y+ky-2*ly; k4=Pnt.size(); MGL_PUSH(Pnt,q4,mutexPnt); + quad_plot(k1,k2,k4,k3); break; + case 'K': + q1.x = p1.x; q1.y = p1.y; k1=Pnt.size(); MGL_PUSH(Pnt,q1,mutexPnt); + q2.x = p1.x-kx-2*lx; q2.y = p1.y-ky-2*ly; k2=Pnt.size(); MGL_PUSH(Pnt,q2,mutexPnt); + q3.x = p1.x-1.5*lx; q3.y = p1.y-1.5*ly; k3=Pnt.size(); MGL_PUSH(Pnt,q3,mutexPnt); + q4.x = p1.x+kx-2*lx; q4.y = p1.y+ky-2*ly; k4=Pnt.size(); MGL_PUSH(Pnt,q4,mutexPnt); + quad_plot(k1,k2,k4,k3); + q1.x = p1.x+kx; q1.y = p1.y+ky; k1=Pnt.size(); MGL_PUSH(Pnt,q1,mutexPnt); + q2.x = p1.x-kx; q2.y = p1.y-ky; k2=Pnt.size(); MGL_PUSH(Pnt,q2,mutexPnt); + line_plot(k1,k2); break; + case 'V': + q1.x = p1.x; q1.y = p1.y; k1=Pnt.size(); MGL_PUSH(Pnt,q1,mutexPnt); + q2.x = p1.x-kx+2*lx; q2.y = p1.y-ky+2*ly; k2=Pnt.size(); MGL_PUSH(Pnt,q2,mutexPnt); + q3.x = p1.x+1.5*lx; q3.y = p1.y+1.5*ly; k3=Pnt.size(); MGL_PUSH(Pnt,q3,mutexPnt); + q4.x = p1.x+kx+2*lx; q4.y = p1.y+ky+2*ly; k4=Pnt.size(); MGL_PUSH(Pnt,q4,mutexPnt); + quad_plot(k1,k2,k4,k3); break; + case 'O': + { + q1.x = p1.x; q1.y = p1.y; k1=Pnt.size(); MGL_PUSH(Pnt,q1,mutexPnt); + double t,c,s; + for(int i=0;i<16;i++) + { + t = M_PI*i/8.; s=sin(t); c=cos(t); + q2.x = p1.x+kx*s+lx*c; q2.y = p1.y+ky*s+ly*c; + k2=Pnt.size(); MGL_PUSH(Pnt,q2,mutexPnt); + t = M_PI*(i+1)/8.; s=sin(t); c=cos(t); + q3.x = p1.x+kx*s+lx*c; q3.y = p1.y+ky*s+ly*c; + k3=Pnt.size(); MGL_PUSH(Pnt,q3,mutexPnt); + trig_plot(k1,k2,k3); + } + break; + } + } +} +//----------------------------------------------------------------------------- +wchar_t *mgl_wcsdup(const wchar_t *s); +void mglCanvas::AddLegend(const char *str,const char *style) +{ + if(!str) return; + unsigned s = strlen(str)+1; + wchar_t *wcs = new wchar_t[s]; + mbstowcs(wcs,str,s); + AddLegend(wcs, style); + delete []wcs; +} +//----------------------------------------------------------------------------- +void mglCanvas::Legend(const std::vector &leg, float x, float y, const char *font, float size, float ll) +{ + long n=leg.size(); + if(n<1) { SetWarn(mglWarnLeg); return; } + static int cgid=1; StartGroup("Legend",cgid++); + if(ll<=0 || isnan(ll)) ll=0.1; + ll *=font_factor; + if(size<0) size = -size*FontSize; + // setup font and parse absolute coordinates + if(!font) font="#"; + char *pA, *ff = new char[strlen(font)+3]; + strcpy(ff,font); strcat(ff,":L"); Push(); + if((pA=strchr(ff,'A'))) { *pA = ' '; InPlot(0,1,0,1,false); } + // find sizes + float h=TextHeight(font,size)/2; + float dx = 0.03*inW, dy = 0.03*inH, w=0, t; + register long i,j; + for(i=0;it ? w:t; + } + w += ll+0.01*inW; // add space for lines + x = x*(inW-w-2*dx)+B.x-inW/2+dx; + y = y*(inH-h*n-2*dy)+B.y-inH/2+dy; + // draw it + long k1,k2,k3,k4; + mglPoint p,q=mglPoint(NAN); + float c1=AddTexture('w'), c2=AddTexture('k'); + if((Flag&3)==2) { float cc=c1; c2=c2; c2=cc; }; + if(strchr(font,'#')) // draw bounding box + { + k1=AddPnt(mglPoint(x,y,Depth),c1,q,-1,0); + k2=AddPnt(mglPoint(x+w,y,Depth),c1,q,-1,0); + k3=AddPnt(mglPoint(x,y+h*n,Depth),c1,q,-1,0); + k4=AddPnt(mglPoint(x+w,y+h*n,Depth),c1,q,-1,0); + quad_plot(k1,k2,k3,k4); + k1=CopyNtoC(k1,c2); k2=CopyNtoC(k2,c2); + k3=CopyNtoC(k3,c2); k4=CopyNtoC(k4,c2); + line_plot(k1,k2); line_plot(k2,k4); + line_plot(k4,k3); line_plot(k3,k1); + } + for(i=0;i0 ? size/FontSize:-size, h=TextHeight(stl,size)*s/2; + if(h>=inH) { SetWarn(mglWarnSpc,"FrameBox"); return; } + bool box=(stl && strchr(stl,'#')); + int align; mglGetStyle(stl,0,&align); align = align&3; + float x=B1.x-inW/2, y=B1.y+inH/2-h; + mglPoint p(B1.x + inW/2.1*(align-1),y,Depth),q(NAN); + if(title) text_plot(AddPnt(p,-1,q,-1,0),title,stl,size); + if(box) // draw boungind box + { + float c1=AddTexture('w'), c2=AddTexture('k'); + if((Flag&3)==2) { float cc=c1; c2=c2; c2=cc; }; + long k1,k2,k3,k4; + k1=AddPnt(mglPoint(x,y,Depth),c1,q,-1,0); + k2=AddPnt(mglPoint(x+inW,y,Depth),c1,q,-1,0); + k3=AddPnt(mglPoint(x,y+h,Depth),c1,q,-1,0); + k4=AddPnt(mglPoint(x+inW,y+h,Depth),c1,q,-1,0); + quad_plot(k1,k2,k3,k4); + k1=CopyNtoC(k1,c2); k2=CopyNtoC(k2,c2); + k3=CopyNtoC(k3,c2); k4=CopyNtoC(k4,c2); + line_plot(k1,k2); line_plot(k2,k4); + line_plot(k4,k3); line_plot(k3,k1); + } + + B.clear(); B=B1; + B.y = B1.y - h/2; + B.b[4] = B1.b[4]-h; + inH-=h; Persp = 0; + font_factor = B.b[0] < B.b[4] ? B.b[0] : B.b[4]; +} +//----------------------------------------------------------------------------- +void mglCanvas::StartAutoGroup (const char *lbl) +{ + static int id=1; + if(lbl==NULL) { id=1; return; } + if(ObjId<0) { ObjId = -id; id++; } + MGL_PUSH(Grp,mglGroup(lbl,ObjId),mutexGrp); +} +//----------------------------------------------------------------------------- +void mglCanvas::EndGroup() { LoadState(); } +//----------------------------------------------------------------------------- diff --git a/src/canvas_cf.cpp b/src/canvas_cf.cpp new file mode 100644 index 0000000..4c7bd0d --- /dev/null +++ b/src/canvas_cf.cpp @@ -0,0 +1,333 @@ +/*************************************************************************** + * canvas_cf.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "mgl/canvas.h" +#include "mgl/canvas_cf.h" +//----------------------------------------------------------------------------- +#undef _GR_ +#define _GR_ ((mglCanvas *)(*gr)) +#define _Gr_ ((mglCanvas *)(gr)) +//----------------------------------------------------------------------------- +const unsigned char *mgl_get_rgb(HMGL gr) { return _Gr_->GetBits(); } +const unsigned char *mgl_get_rgba(HMGL gr) { return _Gr_->GetRGBA(); } +int mgl_get_width(HMGL gr) { return _Gr_->GetWidth(); } +int mgl_get_height(HMGL gr) { return _Gr_->GetHeight(); } +void mgl_calc_xyz(HMGL gr, int xs, int ys, mreal *x, mreal *y, mreal *z) +{ mglPoint p = _Gr_->CalcXYZ(xs,ys); *x = p.x; *y = p.y; *z = p.z; } +void mgl_calc_scr(HMGL gr, mreal x, mreal y, mreal z, int *xs, int *ys) +{ _Gr_->CalcScr(mglPoint(x,y,z),xs,ys); } +void mgl_set_obj_id(HMGL gr, int id) { _Gr_->SetObjId(id); } +int mgl_get_obj_id(HMGL gr, long x, long y) { return _Gr_->GetObjId(x,y); } +int mgl_get_spl_id(HMGL gr, long x, long y) { return _Gr_->GetSplId(x,y); } +//----------------------------------------------------------------------------- +int mgl_new_frame(HMGL gr) { return _Gr_->NewFrame(); } +void mgl_end_frame(HMGL gr) { _Gr_->EndFrame(); } +int mgl_get_num_frame(HMGL gr) { return _Gr_->GetNumFrame(); } +void mgl_reset_frames(HMGL gr) { _Gr_->ResetFrames(); } +//----------------------------------------------------------------------------- +void mgl_set_transp_type(HMGL gr, int type) { _Gr_->SetTranspType(type); } +void mgl_set_alpha(HMGL gr, int enable) { _Gr_->Alpha(enable); } +void mgl_set_fog(HMGL gr, float d, float dz) { _Gr_->Fog(d,dz); } +void mgl_set_light(HMGL gr, int enable) { _Gr_->Light(enable); } +void mgl_set_light_n(HMGL gr, int n, int enable) { _Gr_->Light(n, enable); } +void mgl_add_light_ext(HMGL gr, int n, float x, float y, float z, char c, float br, int inf, float ap) +{ _Gr_->AddLight(n,mglPoint(x,y,z),c,br,inf,ap); } +void mgl_add_light(HMGL gr, int n, float x, float y, float z, char c) +{ _Gr_->AddLight(n,mglPoint(x,y,z),c,0.5); } +//----------------------------------------------------------------------------- +void mgl_mat_push(HMGL gr) { _Gr_->Push(); } +void mgl_mat_pop(HMGL gr) { _Gr_->Pop(); } +void mgl_clf(HMGL gr) { _Gr_->Clf(); } +void mgl_clf_rgb(HMGL gr, float r, float g, float b){ _Gr_->Clf(mglColor(r,g,b)); } +//----------------------------------------------------------------------------- +void mgl_subplot(HMGL gr, int nx,int ny,int m) { _Gr_->SubPlot(nx,ny,m); } +void mgl_subplot_d(HMGL gr, int nx,int ny,int m,float dx,float dy) +{ _Gr_->SubPlot(nx,ny,m,dx,dy); } +void mgl_subplot_s(HMGL gr, int nx,int ny,int m,const char *style) +{ _Gr_->SubPlot(nx,ny,m,style); } +void mgl_multiplot(HMGL gr, int nx,int ny,int m,int dx,int dy,const char *style) +{ _Gr_->MultiPlot(nx,ny,m,dx,dy,style); } +void mgl_inplot(HMGL gr, float x1,float x2,float y1,float y2) +{ _Gr_->InPlot(x1,x2,y1,y2,false); } +void mgl_relplot(HMGL gr, float x1,float x2,float y1,float y2) +{ _Gr_->InPlot(x1,x2,y1,y2,true); } +void mgl_columnplot(HMGL gr, int num, int i) +{ _Gr_->ColumnPlot(num,i); } +void mgl_columnplot_d(HMGL gr, int num, int i, float d) +{ _Gr_->ColumnPlot(num,i,d); } +void mgl_stickplot(HMGL gr, int num, int i, float tet, float phi) +{ _Gr_->StickPlot(num, i, tet, phi); } +void mgl_aspect(HMGL gr, float Ax,float Ay,float Az) +{ _Gr_->Aspect(Ax,Ay,Az); } +void mgl_rotate(HMGL gr, float TetX,float TetZ,float TetY) +{ _Gr_->Rotate(TetX,TetZ,TetY); } +void mgl_view(HMGL gr, float TetX,float TetZ,float TetY) +{ _Gr_->View(TetX,TetZ,TetY); } +void mgl_rotate_vector(HMGL gr, float Tet,float x,float y,float z) +{ _Gr_->RotateN(Tet,x,y,z); } +void mgl_perspective(HMGL gr, float val) +{ _Gr_->Perspective(val); } +void mgl_title(HMGL gr, const char *title, const char *stl, float size) +{ _Gr_->Title(title,stl,size); } +void mgl_titlew(HMGL gr, const wchar_t *title, const char *stl, float size) +{ _Gr_->Title(title,stl,size); } +//----------------------------------------------------------------------------- +int mgl_new_frame_(uintptr_t *gr) { return _GR_->NewFrame(); } +void mgl_end_frame_(uintptr_t *gr) { _GR_->EndFrame(); } +int mgl_get_num_frame_(uintptr_t *gr) { return _GR_->GetNumFrame(); } +void mgl_reset_frames_(uintptr_t *gr) { _GR_->ResetFrames(); } +//----------------------------------------------------------------------------- +void mgl_set_transp_type_(uintptr_t *gr, int *type) { _GR_->SetTranspType(*type); } +void mgl_set_alpha_(uintptr_t *gr, int *enable) { _GR_->Alpha(*enable); } +void mgl_set_fog_(uintptr_t *gr, float *d, float *dz) { _GR_->Fog(*d, *dz); } +void mgl_set_light_(uintptr_t *gr, int *enable) { _GR_->Light(*enable); } +void mgl_set_light_n_(uintptr_t *gr, int *n, int *enable) +{ _GR_->Light(*n, *enable); } +void mgl_add_light_(uintptr_t *gr, int *n, float *x, float *y, float *z, char *c, int) +{ _GR_->AddLight(*n,mglPoint(*x,*y,*z),*c); } +void mgl_add_light_ext_(uintptr_t *gr, int *n, float *x, float *y, float *z, char *c, float *br, int *inf, float *ap, int) +{ _GR_->AddLight(*n,mglPoint(*x,*y,*z),*c,*br,*inf,*ap); } +//----------------------------------------------------------------------------- +void mgl_mat_push_(uintptr_t *gr) { _GR_->Push(); } +void mgl_mat_pop_(uintptr_t *gr) { _GR_->Pop(); } +void mgl_clf_(uintptr_t *gr) +{ _GR_->Clf(); } +void mgl_clf_rgb_(uintptr_t *gr, float *r, float *g, float *b) +{ _GR_->Clf(mglColor(*r,*g,*b)); } +//----------------------------------------------------------------------------- +void mgl_subplot_(uintptr_t *gr, int *nx,int *ny,int *m) +{ _GR_->SubPlot(*nx,*ny,*m); } +void mgl_subplot_d_(uintptr_t *gr, int *nx,int *ny,int *m,float *dx,float *dy) +{ _GR_->SubPlot(*nx,*ny,*m,*dx,*dy); } +void mgl_subplot_s_(uintptr_t *gr, int *nx,int *ny,int *m,const char *st,int l) +{ char *s=new char[l+1]; memcpy(s,st,l); s[l]=0; + _GR_->SubPlot(*nx,*ny,*m,s); delete []s; } +void mgl_multiplot_(uintptr_t *gr, int *nx,int *ny,int *m,int *dx,int *dy,const char *st,int l) +{ char *s=new char[l+1]; memcpy(s,st,l); s[l]=0; + _GR_->MultiPlot(*nx,*ny,*m,*dx,*dy,s); delete []s; } +void mgl_inplot_(uintptr_t *gr, float *x1,float *x2,float *y1,float *y2) +{ _GR_->InPlot(*x1,*x2,*y1,*y2,false); } +void mgl_relplot_(uintptr_t *gr, float *x1,float *x2,float *y1,float *y2) +{ _GR_->InPlot(*x1,*x2,*y1,*y2,true); } +void mgl_columnplot_(uintptr_t *gr, int *num, int *i) +{ _GR_->ColumnPlot(*num,*i); } +void mgl_columnplot_d_(uintptr_t *gr, int *num, int *i, float *d) +{ _GR_->ColumnPlot(*num,*i,*d); } +void mgl_stickplot_(uintptr_t *gr, int *num, int *i, float *tet, float *phi) +{ _GR_->StickPlot(*num, *i, *tet, *phi); } + +void mgl_title_(uintptr_t *gr, const char *title, const char *stl, float *size, int l,int m) +{ char *t=new char[l+1]; memcpy(t,title,l); t[l]=0; + char *s=new char[m+1]; memcpy(s,stl,m); s[m]=0; + _GR_->Title(t,s,*size); delete []s; delete []t; } +void mgl_aspect_(uintptr_t *gr, float *Ax,float *Ay,float *Az) +{ _GR_->Aspect(*Ax,*Ay,*Az); } +void mgl_rotate_(uintptr_t *gr, float *TetX,float *TetZ,float *TetY) +{ _GR_->Rotate(*TetX,*TetZ,*TetY); } +void mgl_view_(uintptr_t *gr, float *TetX,float *TetZ,float *TetY) +{ _GR_->View(*TetX,*TetZ,*TetY); } +void mgl_rotate_vector_(uintptr_t *gr, float *Tet,float *x,float *y,float *z) +{ _GR_->RotateN(*Tet,*x,*y,*z); } +void mgl_perspective_(uintptr_t *gr, float val) +{ _GR_->Perspective(val); } +//----------------------------------------------------------------------------- +const unsigned char *mgl_get_rgb_(uintptr_t *gr) { return gr ? _GR_->GetBits():0; } +const unsigned char *mgl_get_rgba_(uintptr_t *gr){ return gr ? _GR_->GetRGBA():0; } +int mgl_get_width_(uintptr_t *gr) { return gr ? _GR_->GetWidth():0; } +int mgl_get_height_(uintptr_t *gr) { return gr ? _GR_->GetHeight():0;} +void mgl_calc_xyz_(uintptr_t *gr, int *xs, int *ys, mreal *x, mreal *y, mreal *z) +{ mglPoint p = _GR_->CalcXYZ(*xs,*ys); *x = p.x; *y = p.y; *z = p.z; } +void mgl_calc_scr_(uintptr_t *gr, mreal *x, mreal *y, mreal *z, int *xs, int *ys) +{ _GR_->CalcScr(mglPoint(*x,*y,*z),xs,ys); } +void mgl_set_obj_id_(uintptr_t *gr, int *id) { _GR_->SetObjId(*id); } +int mgl_get_obj_id_(uintptr_t *gr, int *x, int *y) { return _GR_->GetObjId(*x,*y); } +int mgl_get_spl_id_(uintptr_t *gr, int *x, int *y) { return _GR_->GetSplId(*x,*y); } +//----------------------------------------------------------------------------- +HMGL mgl_create_graph(int width, int height) +{ return new mglCanvas(width,height); } +void mgl_delete_graph(HMGL gr) { delete gr; } +void mgl_set_size(HMGL gr, int width, int height) +{ _Gr_->SetSize(width, height); } +void mgl_set_def_param(HMGL gr) { _Gr_->DefaultPlotParam(); } +void mgl_combine_gr(HMGL gr, HMGL in) +{ const mglCanvas *gg = dynamic_cast(in); + if(gg) _Gr_->Combine(gg); } +//----------------------------------------------------------------------------- +void mgl_set_tick_len(HMGL gr, float len, float stt) +{ _Gr_->SetTickLen(len,stt); } +void mgl_set_axis_stl(HMGL gr, const char *stl, const char *tck, const char *sub) +{ _Gr_->SetAxisStl(stl,tck,sub); } +void mgl_tune_ticks(HMGL gr, int tune, float pos) +{ _Gr_->SetTuneTicks(tune,pos); } +void mgl_adjust_ticks(HMGL gr, const char *dir) +{ _Gr_->AdjustTicks(dir); } +void mgl_set_ticks(HMGL gr, char dir, float d, int ns, float org) +{ _Gr_->SetTicks(dir,d,ns,org); } +void mgl_set_ticks_str(HMGL gr, char dir, const char *lbl, int add) +{ _Gr_->SetTicksVal(dir,lbl,add); } +void mgl_set_ticks_wcs(HMGL gr, char dir, const wchar_t *lbl, int add) +{ _Gr_->SetTicksVal(dir,lbl,add); } +void mgl_set_ticks_val(HMGL gr, char dir, HCDT val, const char *lbl, int add) +{ _Gr_->SetTicksVal(dir,val,lbl,add); } +void mgl_set_ticks_valw(HMGL gr, char dir, HCDT val, const wchar_t *lbl, int add) +{ _Gr_->SetTicksVal(dir,val,lbl,add); } +void mgl_set_tick_templ(HMGL gr, char dir, const char *templ) +{ _Gr_->SetTickTempl(dir,templ); } +void mgl_set_tick_templw(HMGL gr, char dir, const wchar_t *templ) +{ _Gr_->SetTickTempl(dir,templ); } +void mgl_set_tick_time(HMGL gr, char dir, float d, const char *t) +{ _Gr_->SetTickTime(dir,d,t); } +//----------------------------------------------------------------------------- +void mgl_box(HMGL gr) { _Gr_->Box(); } +void mgl_box_str(HMGL gr, const char *col, int ticks) +{ _Gr_->Box(col,ticks); } +void mgl_axis(HMGL gr, const char *dir, int adj) +{ _Gr_->Axis(dir,adj); } +void mgl_axis_grid(HMGL gr, const char *dir,const char *pen) +{ _Gr_->Grid(dir,pen); } +void mgl_label(HMGL gr, char dir, const char *text) +{ _Gr_->Label(dir,text); } +void mgl_label_ext(HMGL gr, char dir, const char *text, float pos, float shift) +{ _Gr_->Label(dir,text,pos,shift); } +void mgl_labelw_ext(HMGL gr, char dir, const wchar_t *text, float pos, float shift) +{ _Gr_->Labelw(dir,text,pos,shift); } +void mgl_label_xy(HMGL gr, float x, float y, const char *text, const char *fnt) +{ _Gr_->Label(x,y,text,fnt); } +void mgl_labelw_xy(HMGL gr, float x, float y, const wchar_t *text, const char *fnt) +{ _Gr_->Labelw(x,y,text,fnt); } +//----------------------------------------------------------------------------- +void mgl_colorbar(HMGL gr, const char *sch,int where) +{ _Gr_->Colorbar(sch,where); } +void mgl_colorbar_ext(HMGL gr, const char *sch, int where, float x, float y, float w, float h) +{ _Gr_->Colorbar(sch,where,x,y,w,h); } +void mgl_colorbar_val(HMGL gr, HCDT dat, const char *sch,int where) +{ _Gr_->Colorbar(dat,sch,where); } +void mgl_colorbar_val_ext(HMGL gr, HCDT dat, const char *sch,int where,float x, float y, float w, float h) +{ _Gr_->Colorbar(dat,sch,where,x,y,w,h); } +//----------------------------------------------------------------------------- +void mgl_add_legend(HMGL gr, const char *text,const char *style) +{ _Gr_->AddLegend(text,style); } +void mgl_add_legendw(HMGL gr, const wchar_t *text,const char *style) +{ _Gr_->AddLegend(text,style); } +void mgl_clear_legend(HMGL gr) +{ _Gr_->ClearLegend(); } +void mgl_legend_xy(HMGL gr, float x, float y, const char *font, float size, float llen) +{ _Gr_->Legend(x,y,font,size,llen); } +void mgl_legend(HMGL gr, int where, const char *font, float size, float llen) +{ _Gr_->Legend(where,font,size,llen); } +void mgl_set_legend_marks(HMGL gr, int num) +{ _Gr_->SetLegendMarks(num); } +//----------------------------------------------------------------------------- +uintptr_t mgl_create_graph_(int *width, int *height) +{ return uintptr_t(new mglCanvas(*width,*height)); } +void mgl_delete_graph_(uintptr_t *gr) { delete _GR_; } +void mgl_set_size_(uintptr_t *gr, int *width, int *height) +{ _GR_->SetSize(*width,*height); } +void mgl_set_def_param_(uintptr_t *gr) { _GR_->DefaultPlotParam(); } +void mgl_combine_gr_(uintptr_t *gr, uintptr_t *in) +{ _GR_->Combine((mglCanvas *)in); } +//----------------------------------------------------------------------------- +void mgl_set_tick_len_(uintptr_t *gr, float *len, float *stt) +{ _GR_->SetTickLen(*len, *stt); } +void mgl_set_axis_stl_(uintptr_t *gr, const char *stl, const char *tck, const char *sub, int l,int m,int n) +{ char *a=new char[l+1]; memcpy(a,stl,l); a[l]=0; + char *t=new char[m+1]; memcpy(t,tck,m); t[m]=0; + char *s=new char[n+1]; memcpy(s,sub,n); s[n]=0; + _GR_->SetAxisStl(a,t,s); delete []a; delete []s; delete []t; } +void mgl_adjust_ticks_(uintptr_t *gr, const char *dir, int l) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; + _GR_->AdjustTicks(s); delete []s; } +void mgl_set_ticks_(uintptr_t *gr, char *dir, float *d, int *ns, float *org, int) +{ _GR_->SetTicks(*dir, *d, *ns, *org); } +void mgl_set_ticks_str_(uintptr_t *gr, const char *dir, const char *lbl, int *add,int,int l) +{ char *s=new char[l+1]; memcpy(s,lbl,l); s[l]=0; + _GR_->SetTicksVal(*dir,s,*add); delete []s; } +void mgl_set_ticks_val_(uintptr_t *gr, const char *dir, uintptr_t *val, const char *lbl, int *add,int,int l) +{ char *s=new char[l+1]; memcpy(s,lbl,l); s[l]=0; + _GR_->SetTicksVal(*dir,_DA_(val),s,*add); delete []s; } +void mgl_tune_ticks_(uintptr_t *gr, int *tune, float *fact_pos) +{ _GR_->SetTuneTicks(*tune, *fact_pos); } +void mgl_set_tick_templ_(uintptr_t *gr, const char *dir, const char *templ,int,int l) +{ char *s=new char[l+1]; memcpy(s,templ,l); s[l]=0; + _GR_->SetTickTempl(*dir,s); delete []s; } +void mgl_set_tick_time_(uintptr_t *gr, const char *dir, float *d, const char *t,int,int l) +{ char *s=new char[l+1]; memcpy(s,t,l); s[l]=0; + _GR_->SetTickTime(*dir,*d,s); delete []s; } +//----------------------------------------------------------------------------- +void mgl_box_(uintptr_t *gr) { _GR_->Box(); } +void mgl_box_str_(uintptr_t *gr, const char *col, int *ticks, int l) +{ char *s=new char[l+1]; memcpy(s,col,l); s[l]=0; + _GR_->Box(s,*ticks); delete []s; } +void mgl_axis_(uintptr_t *gr, const char *dir, int *adj,int l) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; _GR_->Axis(s,*adj); delete []s; } +void mgl_axis_grid_(uintptr_t *gr, const char *dir,const char *pen,int l,int n) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; + char *p=new char[n+1]; memcpy(p,pen,n); p[n]=0; + _GR_->Grid(s,p); delete []s; delete []p; } +void mgl_label_(uintptr_t *gr, const char *dir, const char *text,int,int l) +{ char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; + _GR_->Label(*dir, s); delete []s; } +void mgl_label_ext_(uintptr_t *gr, const char *dir, const char *text, float *pos, float *shift,int,int l) +{ char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; + _GR_->Label(*dir, s, *pos, *shift); delete []s; } +void mgl_label_xy_(uintptr_t *gr, float *x, float *y, const char *txt, const char *fnt,int l,int n) +{ char *s=new char[l+1]; memcpy(s,txt,l); s[l]=0; + char *p=new char[n+1]; memcpy(p,fnt,n); p[n]=0; + _GR_->Label(*x,*y,s,p); delete []s; delete []p; } +//----------------------------------------------------------------------------- +void mgl_colorbar_(uintptr_t *gr, const char *sch,int *where,int l) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + _GR_->Colorbar(s,*where); delete []s; } +void mgl_colorbar_ext_(uintptr_t *gr, const char *sch,int *where, float *x, float *y, float *w, float *h, int l) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + _GR_->Colorbar(s,*where,*x,*y,*w,*h); delete []s; } +void mgl_colorbar_val_(uintptr_t *gr, uintptr_t *dat, const char *sch,int *where,int l) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + _GR_->Colorbar(_DA_(dat), s,*where); delete []s; } +void mgl_colorbar_val_ext_(uintptr_t *gr, uintptr_t *dat, const char *sch,int *where, float *x, float *y, float *w, float *h, int l) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + _GR_->Colorbar(_DA_(dat),s,*where,*x,*y,*w,*h); delete []s; } +//----------------------------------------------------------------------------- +void mgl_add_legend_(uintptr_t *gr, const char *text,const char *style,int l,int n) +{ char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; + char *f=new char[n+1]; memcpy(f,style,n); f[n]=0; + _GR_->AddLegend(s,f); delete []s; delete []f; } +void mgl_clear_legend_(uintptr_t *gr) { if(gr) _GR_->ClearLegend(); } +void mgl_legend_xy_(uintptr_t *gr, float *x, float *y, const char *font, float *size, float *llen,int l) +{ char *s=new char[l+1]; memcpy(s,font,l); s[l]=0; + _GR_->Legend(*x, *y, s, *size,*llen); delete []s; } +void mgl_legend_(uintptr_t *gr, int *where, const char *font, float *size, float *llen,int l) +{ char *s=new char[l+1]; memcpy(s,font,l); s[l]=0; + _GR_->Legend(*where, s, *size,*llen); delete []s; } +void mgl_set_legend_marks_(uintptr_t *gr, int *num) +{ _GR_->SetLegendMarks(*num); } +//----------------------------------------------------------------------------- +void mgl_set_quality(HMGL gr, int qual) { _Gr_->SetQuality(qual); } +void mgl_set_quality_(uintptr_t *gr, int *qual) { _GR_->SetQuality(*qual); } +//----------------------------------------------------------------------------- +void mgl_set_plotid(HMGL gr, const char *id) { _Gr_->PlotId = id; } +void mgl_set_plotid_(uintptr_t *gr, const char *id,int l) +{ char *s=new char[l+1]; memcpy(s,id,l); s[l]=0; + _GR_->PlotId = s; delete []s; } +//----------------------------------------------------------------------------- +void mgl_mpi_send(HMGL gr, int id) { _Gr_->MPI_Send(id); } +void mgl_mpi_recv(HMGL gr, int id) { _Gr_->MPI_Recv(id); } +void mgl_mpi_send_(uintptr_t *gr, int *id) { _GR_->MPI_Send(*id); } +void mgl_mpi_recv_(uintptr_t *gr, int *id) { _GR_->MPI_Recv(*id); } +//----------------------------------------------------------------------------- diff --git a/src/cont.cpp b/src/cont.cpp new file mode 100644 index 0000000..f66dac4 --- /dev/null +++ b/src/cont.cpp @@ -0,0 +1,1325 @@ +/*************************************************************************** + * cont.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License 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 +#include "mgl/surf.h" +#include "mgl/cont.h" +#include "mgl/data.h" +#include "mgl/eval.h" +//----------------------------------------------------------------------------- +// +// Text printing along a curve +// +//----------------------------------------------------------------------------- +bool same_chain(long f,long i,long *nn) +{ + long j=f; + while(1) + { + j = nn[j]; + if(j==f || j<0) return false; + if(j==i) return true; + } +} +//----------------------------------------------------------------------------- +void mgl_string_curve(mglBase *gr,long f,long ,long *ff,long *nn,const wchar_t *text, const char *font, float size) +{ + if(nn[f]==-1) return; // do nothing since there is no curve + if(!font) font=""; + int pos = strchr(font,'t') ? 1:-1, align; + char cc=mglGetStyle(font,0,&align); align = align&3; + float c=cc ? -cc : gr->GetClrC(ff[f]); + long len = wcslen(text); + char *fnt = new char[strlen(font)+3]; strcpy(fnt,font); + float *wdt=new float[len+1], h=gr->TextHeight(font,size)/4, tet, tt; // TODO optimaze ratio + mglPoint *pt=new mglPoint[len+1]; + wchar_t L[2]=L"a"; + register long i,j,k,m; + + std::vector qa, qb; // curves above and below original + mglPoint p=gr->GetPnt(ff[f]), q=p, s=gr->GetPnt(ff[nn[f]]), l=!(s-q), t=l; + qa.push_back(q+l*h); qb.push_back(q-l*h); + for(i=nn[f];i>=0 && i!=f;i=nn[i]) // construct curves + { + p=q; q=s; l=t; + if(nn[i]>=0) { s=gr->GetPnt(ff[nn[i]]); t=!(s-q); } + tet = t.x*l.y-t.y*l.x; + tt = 1+fabs(t.x*l.x+t.y*l.y); + if(tet>0) + { qa.push_back(q+l*h); qa.push_back(q+t*h); qb.push_back(q-(l+t)*(h/tt)); } + else if(tet<0) + { qb.push_back(q-l*h); qb.push_back(q-t*h); qa.push_back(q+(l+t)*(h/tt)); } + else + { qa.push_back(q+l*h); qb.push_back(q-l*h); } + } + if(pos<0) qa=qb; + // adjust text direction + bool rev = align==2; + if(qa[0].x>qa[1].x) + { + if(align==0){ strcat(fnt,":R"); align=2; } + else if(align==1) rev = true; + else { strcat(fnt,":L"); align=0; } + } + if(rev) reverse(qa.begin(),qa.end()); + for(j=0;jTextWidth(L,font,size)/2; } + wdt[len]=0; + + // place glyphs points + pt[0] = qa[0]; m = qa.size(); + float a,b,d,w,t1,t2; + for(i=j=0,tt=0;jw) break; + if(k>i+1 && ka*d should be here! + if(b*b>1e3*a*c) { t1 = d/(b+w); t2 = d/(b-w); } // keep precision + else { t1 = (b-w)/a; t2 = (b+w)/a; } + if(t1<0 || t1text_plot(gr->AddPnt(pt[j]-(pos*h)*l,c,s,-1,0),L,font,size,0,c); } + delete []wdt; delete []pt; delete []fnt; +} +//----------------------------------------------------------------------------- +void mgl_textw_xyz(HMGL gr, HCDT x, HCDT y, HCDT z,const wchar_t *text, const char *font, const char *opt) +{ + long n=y->GetNx(); + if(x->GetNx()!=n || z->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Text"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Text"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("TextC",cgid++); + + long *nn = new long[n], *ff = new long[n]; + mglPoint p; + register long i; + for(i=0;iv(i),y->v(i),z->v(i)); + ff[i] = gr->AddPnt(p,-1); + } + for(i=1;iEndGroup(); + delete []ff; delete []nn; +} +//----------------------------------------------------------------------------- +void mgl_textw_xy(HMGL gr, HCDT x, HCDT y, const wchar_t *text, const char *font, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Text"); return; } + gr->SaveState(opt); + mglData z(y->GetNx()); + z.Fill(gr->Min.z,gr->Min.z); + mgl_textw_xyz(gr,x,y,&z,text,font,0); +} +//----------------------------------------------------------------------------- +void mgl_textw_y(HMGL gr, HCDT y, const wchar_t *text, const char *font, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Text"); return; } + gr->SaveState(opt); + mglData x(y->GetNx()), z(y->GetNx()); + x.Fill(gr->Min.x,gr->Max.x); + z.Fill(gr->Min.z,gr->Min.z); + mgl_textw_xyz(gr,&x,y,&z,text,font,0); +} +//----------------------------------------------------------------------------- +void mgl_text_xyz(HMGL gr, HCDT x, HCDT y, HCDT z,const char *text, const char *font, const char *opt) +{ + unsigned s = strlen(text)+1; + wchar_t *wcs = new wchar_t[s]; + mbstowcs(wcs,text,s); + mgl_textw_xyz(gr,x,y,z, wcs, font, opt); + delete []wcs; +} +//----------------------------------------------------------------------------- +void mgl_text_xy(HMGL gr, HCDT x, HCDT y, const char *text, const char *font, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Text"); return; } + mglData z(y->GetNx()); + z.Fill(gr->Min.z,gr->Min.z); + mgl_text_xyz(gr,x,y,&z,text,font,opt); +} +//----------------------------------------------------------------------------- +void mgl_text_y(HMGL gr, HCDT y, const char *text, const char *font, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Text"); return; } + mglData x(y->GetNx()), z(y->GetNx()); + x.Fill(gr->Min.x,gr->Max.x); + z.Fill(gr->Min.z,gr->Min.z); + mgl_text_xyz(gr,&x,y,&z,text,font,opt); +} +//----------------------------------------------------------------------------- +void mgl_text_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z,const char *text,const char *font, const char *opt,int l,int n,int lo) +{ char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; + char *f=new char[n+1]; memcpy(f,font,n); f[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_text_xyz(_GR_, _DA_(x),_DA_(y), _DA_(z), s, f, o); + delete []o; delete []s; delete []f; } +//----------------------------------------------------------------------------- +void mgl_text_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *text, const char *font, const char *opt, int l,int n,int lo) +{ char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; + char *f=new char[n+1]; memcpy(f,font,n); f[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_text_xy(_GR_, _DA_(x),_DA_(y),s,f,o); + delete []o; delete []s; delete []f; } +//----------------------------------------------------------------------------- +void mgl_text_y_(uintptr_t *gr, uintptr_t *y, const char *text, const char *font, const char *opt, int l,int n,int lo) +{ char *s=new char[l+1]; memcpy(s,text,l); s[l]=0; + char *f=new char[n+1]; memcpy(f,font,n); f[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_text_y(_GR_, _DA_(y),s,f,o); delete []o; delete []s; delete []f; } +//----------------------------------------------------------------------------- +// +// Cont series +// +//----------------------------------------------------------------------------- +struct mglSegment +{ + long next,prev; + mglPoint p1,p2; + mglSegment(mglPoint q1,mglPoint q2) {p1=q1;p2=q2;next=prev=-1;} +}; +// function for connecting arbitrary line segments +void mgl_connect(HMGL gr, float val, HCDT a, HCDT x, HCDT y, HCDT z, float c, int text,long ak) +{ + long n=a->GetNx(), m=a->GetNy(); + if(n<2 || m<2 || x->GetNx()*x->GetNy()!=n*m || y->GetNx()*y->GetNy()!=n*m || z->GetNx()*z->GetNy()!=n*m) + { gr->SetWarn(mglWarnDim,"ContGen"); return; } + std::vector ss; + + register long i,j; + float d1,d2,d3,d4; + bool o1,o2,o3,o4; + mglPoint p1,p2,p3,p4,q1,q2,q3,q4; + for(i=0;iv(i,j,ak),a->v(i+1,j,ak)); o1 = d1>=0 && d1<1; + d2 = mgl_d(val,a->v(i,j,ak),a->v(i,j+1,ak)); o2 = d2>=0 && d2<1; + d3 = mgl_d(val,a->v(i+1,j+1,ak),a->v(i+1,j,ak)); o3 = d3>=0 && d3<1; + d4 = mgl_d(val,a->v(i+1,j+1,ak),a->v(i,j+1,ak)); o4 = d4>=0 && d4<1; + p1 = mglPoint(x->v(i,j), y->v(i,j),z->v(i,j)); + p2 = mglPoint(x->v(i+1,j), y->v(i+1,j),z->v(i+1,j)); + p3 = mglPoint(x->v(i,j+1), y->v(i,j+1),z->v(i,j+1)); + p4 = mglPoint(x->v(i+1,j+1), y->v(i+1,j+1),z->v(i+1,j+1)); + q1 = p1*(1-d1)+p2*d1; q2 = p1*(1-d2)+p3*d1; + q3 = p4*(1-d3)+p2*d3; q4 = p4*(1-d4)+p3*d4; + if(o1 && o2) { o1 = o2 = false; ss.push_back(mglSegment(q1,q2)); } + if(o1 && o3) { o1 = o3 = false; ss.push_back(mglSegment(q1,q3)); } + if(o1 && o4) { o1 = o4 = false; ss.push_back(mglSegment(q1,q4)); } + if(o2 && o3) { o2 = o3 = false; ss.push_back(mglSegment(q2,q3)); } + if(o2 && o4) { o2 = o4 = false; ss.push_back(mglSegment(q2,q4)); } + if(o3 && o4) { o3 = o4 = false; ss.push_back(mglSegment(q3,q4)); } + } + if(ss.size()==0) return; + // connect it + +} + +// NOTE! All data MUST have the same size! Only first slice is used! +void mgl_cont_gen(HMGL gr, float val, HCDT a, HCDT x, HCDT y, HCDT z, float c, int text,long ak) +{ + long n=a->GetNx(), m=a->GetNy(); + if(n<2 || m<2 || x->GetNx()*x->GetNy()!=n*m || y->GetNx()*y->GetNy()!=n*m || z->GetNx()*z->GetNy()!=n*m) + { gr->SetWarn(mglWarnDim,"ContGen"); return; } + + mglPoint *kk = new mglPoint[2*n*m],p; + float d, r, kx, ky; + register long i,j,k, pc=0; + // Usually number of points is much smaller. So, there is no reservation. +// gr->Reserve(2*n*m); + + // add intersection point of isoline and Y axis + for(i=0;iv(i,j,ak),a->v(i+1,j,ak)); + if(d>=0 && d<1) + { + p = mglPoint(x->v(i,j)*(1-d)+x->v(i+1,j)*d, + y->v(i,j)*(1-d)+y->v(i+1,j)*d, + z->v(i,j)*(1-d)+z->v(i+1,j)*d); + kk[pc] = mglPoint(i+d,j,gr->AddPnt(p,c)); pc++; + } + } + // add intersection point of isoline and X axis + for(i=0;iv(i,j,ak),a->v(i,j+1,ak)); + if(d>=0 && d<1) + { + p = mglPoint(x->v(i,j)*(1-d)+x->v(i,j+1)*d, + y->v(i,j)*(1-d)+y->v(i,j+1)*d, + z->v(i,j)*(1-d)+z->v(i,j+1)*d); + kk[pc] = mglPoint(i,j+d,gr->AddPnt(p,c)); pc++; + } + } + // deallocate arrays and finish if no point + if(pc==0) { delete []kk; return; } + // allocate arrays for curve (nn - next, ff - prev) + long *nn = new long[pc], *ff = new long[pc]; + // -1 is not parsed, -2 starting + for(i=0;i=0) + { + kx = kk[j].x; ky = kk[j].y; i = -1; + i11 = long(kx+1e-5); i12 = long(kx-1e-5); + j11 = long(ky+1e-5); j12 = long(ky-1e-5); + r=10; + for(k=0;k=0); + for(i=0;i1) + { + wchar_t wcs[64]; + mglprintf(wcs,64,L"%4.3g",val); + mglPoint t; + float del = 2*gr->TextWidth(wcs,"",-0.5); + // find width and height of drawing area + float ar=gr->GetRatio(), w=gr->FontFactor(), h; + if(delGetPnt(ff[k]); + i = long(t.x/del); t.x -= i*del; + j = long(t.y/del); t.y -= j*del; + if(i<0 || i>=m || j<0 || j>=n) continue; // never should be here! + r = t.x*t.x+t.y*t.y; i += m*j; + if(rr[i]>r) { rr[i]=r; oo[i]=k; } + } + for(i=0;i=0) + mgl_string_curve(gr,oo[i],pc,ff,nn,wcs,"t:C",-0.5); + delete []oo; delete []rr; + } + for(i=0;i=0) gr->line_plot(ff[i], ff[nn[i]]); + delete []kk; delete []nn; delete []ff; +} +//----------------------------------------------------------------------------- +void mgl_cont_gen(HMGL gr, float val, HCDT a, HCDT x, HCDT y, HCDT z, const char *sch) +{ + bool text=(sch && strchr(sch,'t')); + gr->SetPenPal(sch); + mgl_cont_gen(gr,val,a,x,y,z,gr->CDef,text,0); +} +//----------------------------------------------------------------------------- +void mgl_cont_xy_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ + register long i,j,n=z->GetNx(),m=z->GetNy(); + if(x->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Cont"); return; } + if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"Cont"); return; } + bool both = x->GetNx()*x->GetNy()==m*n && y->GetNx()*y->GetNy()==m*n; + if(y->GetNx()!=z->GetNy() && !both) { gr->SetWarn(mglWarnDim, "Cont"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Cont",cgid++); + + bool text=(sch && strchr(sch,'t')); + bool fixed=(sch && strchr(sch,'_')) || (gr->Min.z==gr->Max.z); + long s=gr->AddTexture(sch); + gr->SetPenPal(sch); + + mglData xx, yy, zz(z->GetNx(), z->GetNy()); + if(!both) // make + { + xx.Create(z->GetNx(), z->GetNy()); + yy.Create(z->GetNx(), z->GetNy()); + for(i=0;iv(i); yy.a[i+n*j] = y->v(j); } + x = &xx; y = &yy; + } + // x, y -- have the same size z + float z0, v0; + for(j=0;jGetNz();j++) for(i=0;iGetNx();i++) + { + v0 = v->v(i); z0 = fixed ? gr->Min.z : v0; + if(z->GetNz()>1) + z0 = gr->Min.z+(gr->Max.z-gr->Min.z)*float(j)/(z->GetNz()-1); + zz.Fill(z0,z0); + mgl_cont_gen(gr,v0,z,x,y,&zz,gr->GetC(s,v0),text,j); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_cont_val(HMGL gr, HCDT v, HCDT z, const char *sch, const char *opt) +{ + if(z->GetNx()<2 || z->GetNy()<2) { gr->SetWarn(mglWarnLow,"Cont"); return; } + gr->SaveState(opt); + mglData x(z->GetNx(), z->GetNy()), y(z->GetNx(), z->GetNy()); + x.Fill(gr->Min.x,gr->Max.x,'x'); + y.Fill(gr->Min.y,gr->Max.y,'y'); + mgl_cont_xy_val(gr,v,&x,&y,z,sch,0); +} +//----------------------------------------------------------------------------- +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); + 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); + mgl_cont_xy_val(gr,&v,x,y,z,sch,0); +} +//----------------------------------------------------------------------------- +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); + 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); + mgl_cont_val(gr,&v,z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_cont_xy_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cont_xy_val(_GR_, _DA_(v), _DA_(x), _DA_(y), _DA_(a), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_cont_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cont_val(_GR_, _DA_(v), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_cont_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cont_xy(_GR_, _DA_(x), _DA_(y), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_cont_(uintptr_t *gr, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cont(_GR_, _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// ContF series +// +//----------------------------------------------------------------------------- +long mgl_add_pnt(HMGL gr, float d, HCDT x, HCDT y, HCDT z, long i1, long j1, long i2, long j2, float c, bool edge) +{ + long res=-1; + if(edge || (d>0 && d<1)) + { + mglPoint p,u,v; + p = mglPoint(x->v(i1,j1)*(1-d)+x->v(i2,j2)*d, + y->v(i1,j1)*(1-d)+y->v(i2,j2)*d, + z->v(i1,j1)*(1-d)+z->v(i2,j2)*d); + u = mglPoint(x->dvx(i1,j1)*(1-d)+x->dvx(i2,j2)*d, + y->dvx(i1,j1)*(1-d)+y->dvx(i2,j2)*d, + z->dvx(i1,j1)*(1-d)+z->dvx(i2,j2)*d); + v = mglPoint(x->dvy(i1,j1)*(1-d)+x->dvy(i2,j2)*d, + y->dvy(i1,j1)*(1-d)+y->dvy(i2,j2)*d, + z->dvy(i1,j1)*(1-d)+z->dvy(i2,j2)*d); + res = gr->AddPnt(p,c,u^v); + } + return res; +} +//----------------------------------------------------------------------------- +void mgl_add_range(HMGL gr, HCDT a, HCDT x, HCDT y, HCDT z, long i1, long j1, long di, long dj, float c, long &u1, long &u2, long ak, float v1, float v2) +{ + long i2=i1+di, j2=j1+dj; + + float f1 = a->v(i1,j1,ak), f2 = a->v(i2,j2,ak), d1, d2; + d1 = mgl_d(v1,f1,f2); + u1 = mgl_add_pnt(gr,d1,x,y,z,i1,j1,i2,j2,c,false); + d2 = mgl_d(v2,f1,f2); + u2 = mgl_add_pnt(gr,d2,x,y,z,i1,j1,i2,j2,c,false); + if(d1>d2) { j2=u1; u1=u2; u2=j2; } +} +//----------------------------------------------------------------------------- +void mgl_add_edges(HMGL gr, HCDT a, HCDT x, HCDT y, HCDT z, long i1, long j1, long di, long dj, float c, long &u1, long &u2, long ak, float v1, float v2) +{ + long i2=i1+di, j2=j1+dj; + u1 = u2 = -1; + + float f1 = a->v(i1,j1,ak), f2 = a->v(i2,j2,ak); + if(f1<=v2 && f1>=v1) + u1 = mgl_add_pnt(gr,0,x,y,z,i1,j1,i2,j2,c,true); + if(f2<=v2 && f2>=v1) + u2 = mgl_add_pnt(gr,1,x,y,z,i1,j1,i2,j2,c,true); +} +//----------------------------------------------------------------------------- +void mgl_contf_gen(HMGL gr, float v1, float v2, HCDT a, HCDT x, HCDT y, HCDT z, float c, long ak) +{ + long n=a->GetNx(), m=a->GetNy(); + if(n<2 || m<2 || x->GetNx()*x->GetNy()!=n*m || y->GetNx()*y->GetNy()!=n*m || z->GetNx()*z->GetNy()!=n*m) + { gr->SetWarn(mglWarnDim,"ContFGen"); return; } + + register long i,j; + gr->Reserve(n*m); + long *kk = new long[4*n], l1,l2, r1,r2, t1,t2, u1,u2, b1,b2, d1,d2, p[8],num; + memset(kk,-1,2*n*sizeof(long)); + for(i=0;i=0) p[num++] = b1; if(t1>=0) p[num++] = t1; + if(t2>=0) p[num++] = t2; if(b2>=0) p[num++] = b2; + if(r1>=0) p[num++] = r1; if(r2>=0) p[num++] = r2; + if(d2>=0) p[num++] = d2; if(u2>=0) p[num++] = u2; + if(u1>=0) p[num++] = u1; if(d1>=0) p[num++] = d1; + if(l2>=0) p[num++] = l2; if(l1>=0) p[num++] = l1; + // draw it + if(num<3) continue; + if(num==4) gr->quad_plot(p[0],p[1],p[3],p[2]); + else if(num==3) gr->trig_plot(p[0],p[1],p[2]); + else if(num==5) + { + gr->quad_plot(p[0],p[1],p[3],p[2]); + gr->trig_plot(p[0],p[3],p[4]); + } + else if(num==6) + { + gr->quad_plot(p[0],p[1],p[3],p[2]); + gr->quad_plot(p[0],p[3],p[5],p[4]); + } + } + } + delete []kk; +} +//----------------------------------------------------------------------------- +void mgl_contf_gen(HMGL gr, float v1, float v2, HCDT a, HCDT x, HCDT y, HCDT z, const char *c) +{ + gr->SetPenPal(c); + mgl_contf_gen(gr,v1,v2,a,x,y,z,gr->CDef,0); +} +//----------------------------------------------------------------------------- +void mgl_contf_xy_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ + register long i,j,n=z->GetNx(),m=z->GetNy(); + if(x->GetNx()!=n) { gr->SetWarn(mglWarnDim,"ContF"); return; } + if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContF"); return; } + bool both = x->GetNx()*x->GetNy()==m*n && y->GetNx()*y->GetNy()==m*n; + if(y->GetNx()!=z->GetNy() && !both) { gr->SetWarn(mglWarnDim, "ContF"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("ContF",cgid++); + long s=gr->AddTexture(sch); + + bool fixed=(sch && strchr(sch,'_')) || (gr->Min.z==gr->Max.z); + mglData xx, yy, zz(z->GetNx(), z->GetNy()); + if(!both) // make + { + xx.Create(z->GetNx(), z->GetNy()); + yy.Create(z->GetNx(), z->GetNy()); + for(j=0;jv(i); yy.a[i+n*j] = y->v(j); } + x = &xx; y = &yy; + } + // x, y -- have the same size z + float z0, v0; + for(j=0;jGetNz();j++) for(i=0;iGetNx()-1;i++) + { + v0 = v->v(i); z0 = fixed ? gr->Min.z : v0; + if(z->GetNz()>1) + z0 = gr->Min.z+(gr->Max.z-gr->Min.z)*float(j)/(z->GetNz()-1); + zz.Fill(z0,z0); + mgl_contf_gen(gr,v0,v->v(i+1),z,x,y,&zz,gr->GetC(s,v0),j); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_contf_val(HMGL gr, HCDT v, HCDT z, const char *sch, const char *opt) +{ + if(z->GetNx()<2 || z->GetNy()<2) { gr->SetWarn(mglWarnLow,"Cont"); return; } + gr->SaveState(opt); + mglData x(z->GetNx(), z->GetNy()), y(z->GetNx(), z->GetNy()); + x.Fill(gr->Min.x,gr->Max.x,'x'); + y.Fill(gr->Min.y,gr->Max.y,'y'); + mgl_contf_xy_val(gr,v,&x,&y,z,sch,0); +} +//----------------------------------------------------------------------------- +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); + if(Num<1) { gr->SetWarn(mglWarnCnt,"Cont"); return; } + mglData v(Num); v.Fill(gr->Min.c, gr->Max.c); + mgl_contf_xy_val(gr,&v,x,y,z,sch,0); +} +//----------------------------------------------------------------------------- +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); + if(Num<1) { gr->SetWarn(mglWarnCnt,"Cont"); return; } + mglData v(Num); v.Fill(gr->Min.c, gr->Max.c); + mgl_contf_val(gr,&v,z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_contf_xy_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contf_xy_val(_GR_, _DA_(v), _DA_(x), _DA_(y), _DA_(a), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_contf_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contf_val(_GR_, _DA_(v), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_contf_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contf_xy(_GR_, _DA_(x), _DA_(y), _DA_(a), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_contf_(uintptr_t *gr, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contf(_GR_, _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// ContD series +// +//----------------------------------------------------------------------------- +int mgl_get_ncol(const char *sch, char *res) +{ + int i,j,n=strlen(sch); + for(i=j=0;iGetNx(),m=z->GetNy(); + if(x->GetNx()!=n) { gr->SetWarn(mglWarnDim,"ContD"); return; } + if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContD"); return; } + bool both = x->GetNx()*x->GetNy()==m*n && y->GetNx()*y->GetNy()==m*n; + if(y->GetNx()!=z->GetNy() && !both) { gr->SetWarn(mglWarnDim, "ContD"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("ContD",cgid++); + if(!sch || !sch[0]) sch = MGL_DEF_PAL; +// char *cc = new char[strlen(sch)]; + long s = gr->AddTexture(sch,1); + int nc = gr->GetNumPal(s*256); + + bool fixed=(sch && strchr(sch,'_')) || (gr->Min.z==gr->Max.z); + mglData xx, yy, zz(z->GetNx(), z->GetNy()); + if(!both) // make + { + xx.Create(z->GetNx(), z->GetNy()); + yy.Create(z->GetNx(), z->GetNy()); + for(i=0;iv(i); yy.a[i+n*j] = y->v(j); } + x = &xx; y = &yy; + } + // x, y -- have the same size z + float z0, v0, dc = nc>1 ? 1/(MGL_FLT_EPS*(nc-1)) : 0; + for(j=0;jGetNz();j++) for(i=0;iGetNx()-1;i++) + { + v0 = v->v(i); z0 = fixed ? gr->Min.z : v0; + if(z->GetNz()>1) + z0 = gr->Min.z+(gr->Max.z-gr->Min.z)*float(j)/(z->GetNz()-1); + zz.Fill(z0,z0); + mgl_contf_gen(gr,v0,v->v(i+1),z,x,y,&zz,s+i*dc,j); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_contd_val(HMGL gr, HCDT v, HCDT z, const char *sch, const char *opt) +{ + if(z->GetNx()<2 || z->GetNy()<2) { gr->SetWarn(mglWarnLow,"ContD"); return; } + gr->SaveState(opt); + mglData x(z->GetNx(), z->GetNy()), y(z->GetNx(), z->GetNy()); + x.Fill(gr->Min.x,gr->Max.x,'x'); + y.Fill(gr->Min.y,gr->Max.y,'y'); + mgl_contd_xy_val(gr,v,&x,&y,z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_contd_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ + if(!sch || !sch[0]) sch = MGL_DEF_PAL; + gr->SaveState(opt); + mglData v(mgl_get_ncol(sch,0)+1); + v.Fill(gr->Min.c, gr->Max.c); + mgl_contd_xy_val(gr,&v,x,y,z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_contd(HMGL gr, HCDT z, const char *sch, const char *opt) +{ + if(!sch || !sch[0]) sch = MGL_DEF_PAL; + gr->SaveState(opt); + mglData v(mgl_get_ncol(sch,0)+1); + v.Fill(gr->Min.c, gr->Max.c); + mgl_contd_val(gr,&v,z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_contd_xy_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contd_xy_val(_GR_, _DA_(v), _DA_(x), _DA_(y), _DA_(a), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_contd_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contd_val(_GR_, _DA_(v), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_contd_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contd_xy(_GR_, _DA_(x), _DA_(y), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_contd_(uintptr_t *gr, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contd(_GR_, _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Cont3 series +// +//----------------------------------------------------------------------------- +struct _mgl_slice { mglData x,y,z,a; }; +//----------------------------------------------------------------------------- +void mgl_get_slice(_mgl_slice &s, HCDT x, HCDT y, HCDT z, HCDT a, char dir, float d, bool both) +{ + register long i,j,i0,n=a->GetNx(),m=a->GetNy(),l=a->GetNz(), nx=1,ny=1,p; + + if(dir=='x') { nx = m; ny = l; if(d<0) d = n/2.; } + if(dir=='y') { nx = n; ny = l; if(d<0) d = m/2.; } + if(dir=='z') { nx = n; ny = m; if(d<0) d = l/2.; } + s.x.Create(nx,ny); s.y.Create(nx,ny); + s.z.Create(nx,ny); s.a.Create(nx,ny); + p = long(d); d -= p; + float v; + + if(both) + { + if(dir=='x') for(j=0;jv(p,i,j)*(1-d) + x->v(p+1,i,j)*d; + s.y.a[i0] = y->v(p,i,j)*(1-d) + y->v(p+1,i,j)*d; + s.z.a[i0] = z->v(p,i,j)*(1-d) + z->v(p+1,i,j)*d; + s.a.a[i0] = a->v(p,i,j)*(1-d) + a->v(p+1,i,j)*d; + } + if(dir=='y') for(j=0;jv(i,p,j)*(1-d) + x->v(i,p+1,j)*d; + s.y.a[i0] = y->v(i,p,j)*(1-d) + y->v(i,p+1,j)*d; + s.z.a[i0] = z->v(i,p,j)*(1-d) + z->v(i,p+1,j)*d; + s.a.a[i0] = a->v(i,p,j)*(1-d) + a->v(i,p+1,j)*d; + } + if(dir=='z') for(j=0;jv(i,j,p)*(1-d) + x->v(i,j,p+1)*d; + s.y.a[i0] = y->v(i,j,p)*(1-d) + y->v(i,j,p+1)*d; + s.z.a[i0] = z->v(i,j,p)*(1-d) + z->v(i,j,p+1)*d; + s.a.a[i0] = a->v(i,j,p)*(1-d) + a->v(i,j,p+1)*d; + } + } + else // x, y, z -- vectors + { + if(dir=='x') + { + v = x->v(p)*(1-d)+x->v(p+1)*d; + for(j=0;jv(i); s.z.a[i0] = z->v(j); + s.a.a[i0] = a->v(p,i,j)*(1-d) + a->v(p+1,i,j)*d; + } + } + if(dir=='y') + { + v = y->v(p)*(1-d)+y->v(p+1)*d; + for(j=0;jv(i); s.z.a[i0] = z->v(j); + s.a.a[i0] = a->v(i,p,j)*(1-d) + a->v(i,p+1,j)*d; + } + } + if(dir=='z') + { + v = z->v(p)*(1-d)+z->v(p+1)*d; + for(j=0;jv(i); s.y.a[i0] = y->v(j); + s.a.a[i0] = a->v(i,j,p)*(1-d) + a->v(i,j,p+1)*d; + } + } + } +} +//----------------------------------------------------------------------------- +void mgl_cont3_xyz_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, HCDT a, char dir, float sVal, const char *sch, const char *opt) +{ + long n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); + if(n<2 || m<2 || l<2) { gr->SetWarn(mglWarnLow,"Cont3"); return; } + 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,"Cont3"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Cont3",cgid++); + + bool text=(sch && strchr(sch,'t')); + long ss=gr->AddTexture(sch); + gr->SetPenPal(sch); + + _mgl_slice s; + mgl_get_slice(s,x,y,z,a,dir,sVal,both); + for(long i=0;iGetNx();i++) + { + float v0 = v->v(i); + mgl_cont_gen(gr,v0,&s.a,&s.x,&s.y,&s.z,gr->GetC(ss,v0),text,0); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_cont3_val(HMGL gr, HCDT v, HCDT a, char dir, float sVal, const char *sch, const char *opt) +{ + if(a->GetNx()<2 || a->GetNy()<2 || a->GetNz()<2) + { gr->SetWarn(mglWarnLow,"Cont3"); return; } + gr->SaveState(opt); + mglData x(a->GetNx()), y(a->GetNy()),z(a->GetNz()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + z.Fill(gr->Min.z,gr->Max.z); + mgl_cont3_xyz_val(gr,v,&x,&y,&z,a,dir,sVal,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_cont3_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, char dir, float sVal, const char *sch, const char *opt) +{ + float r = gr->SaveState(opt); + long Num = 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); + mgl_cont3_xyz_val(gr,&v,x,y,z,a,dir,sVal,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_cont3(HMGL gr, HCDT a, char dir, float sVal, const char *sch, const char *opt) +{ + float r = gr->SaveState(opt); + long Num = 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); + mgl_cont3_val(gr,&v,a,dir,sVal,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_cont3_xyz_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cont3_xyz_val(_GR_, _DA_(v), _DA_(x), _DA_(y), _DA_(z), _DA_(a), *dir, *sVal, s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_cont3_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cont3_val(_GR_, _DA_(v), _DA_(a), *dir, *sVal, s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_cont3_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cont3_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(a), *dir, *sVal, s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_cont3_(uintptr_t *gr, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cont3(_GR_, _DA_(a), *dir, *sVal, s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Dens3 series +// +//----------------------------------------------------------------------------- +void mgl_dens3_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, char dir, float sVal, const char *sch, const char *opt) +{ + long n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); + if(n<2 || m<2 || l<2) { gr->SetWarn(mglWarnLow,"Dens3"); return; } + 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,"Dens3"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Dens3",cgid++); + + _mgl_slice s; + mgl_get_slice(s,x,y,z,a,dir,sVal,both); + mgl_surfc_xy(gr,&s.x,&s.y,&s.z,&s.a,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_dens3(HMGL gr, HCDT a, char dir, float sVal, const char *sch, const char *opt) +{ + if(a->GetNx()<2 || a->GetNy()<2 || a->GetNz()<2) + { gr->SetWarn(mglWarnLow,"Dens3"); return; } + gr->SaveState(opt); + mglData x(a->GetNx()), y(a->GetNy()),z(a->GetNz()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + z.Fill(gr->Min.z,gr->Max.z); + mgl_dens3_xyz(gr,&x,&y,&z,a,dir,sVal,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_dens3_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_dens3_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(a), *dir, *sVal, s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_dens3_(uintptr_t *gr, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_dens3(_GR_, _DA_(a), *dir, *sVal, s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Grid3 series +// +//----------------------------------------------------------------------------- +void mgl_grid3_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, char dir, float sVal, const char *sch, const char *opt) +{ + long n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); + if(n<2 || m<2 || l<2) { gr->SetWarn(mglWarnLow,"Grid3"); return; } + 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,"Grid3"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Grid3",cgid++); + + _mgl_slice s; + mgl_get_slice(s,x,y,z,a,dir,sVal,both); + mgl_mesh_xy(gr,&s.x,&s.y,&s.z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_grid3(HMGL gr, HCDT a, char dir, float sVal, const char *sch, const char *opt) +{ + if(a->GetNx()<2 || a->GetNy()<2 || a->GetNz()<2) + { gr->SetWarn(mglWarnLow,"Grid3"); return; } + gr->SaveState(opt); + mglData x(a->GetNx()), y(a->GetNy()), z(a->GetNz()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + z.Fill(gr->Min.z,gr->Max.z); + mgl_grid3_xyz(gr,&x,&y,&z,a,dir,sVal,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_grid3_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_grid3_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(a), *dir, *sVal, s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_grid3_(uintptr_t *gr, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_grid3(_GR_, _DA_(a), *dir, *sVal, s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// ContF3 series +// +//----------------------------------------------------------------------------- +void mgl_contf3_xyz_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, HCDT a, char dir, float sVal, const char *sch, const char *opt) +{ + long n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); + if(n<2 || m<2 || l<2) { gr->SetWarn(mglWarnLow,"ContF3"); return; } + 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,"ContF3"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("ContF3",cgid++); + + long ss=gr->AddTexture(sch); + _mgl_slice s; + mgl_get_slice(s,x,y,z,a,dir,sVal,both); + for(long i=0;iGetNx();i++) + { + float v0 = v->v(i); + mgl_contf_gen(gr,v0,v->v(i+1),&s.a,&s.x,&s.y,&s.z,gr->GetC(ss,v0),0); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_contf3_val(HMGL gr, HCDT v, HCDT a, char dir, float sVal, const char *sch, const char *opt) +{ + if(a->GetNx()<2 || a->GetNy()<2 || a->GetNz()<2) + { gr->SetWarn(mglWarnLow,"ContF3"); return; } + gr->SaveState(opt); + mglData x(a->GetNx()), y(a->GetNy()),z(a->GetNz()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + z.Fill(gr->Min.z,gr->Max.z); + mgl_contf3_xyz_val(gr,v,&x,&y,&z,a,dir,sVal,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_contf3_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, char dir, float sVal, const char *sch, const char *opt) +{ + float r = gr->SaveState(opt); + long Num = isnan(r)?7:long(r+0.5); + if(Num<1) { gr->SetWarn(mglWarnCnt,"ContF3"); return; } + mglData v(Num+2); + for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*float(i)/(Num+1); + mgl_contf3_xyz_val(gr,&v,x,y,z,a,dir,sVal,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_contf3(HMGL gr, HCDT a, char dir, float sVal, const char *sch, const char *opt) +{ + float r = gr->SaveState(opt); + long Num = 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,dir,sVal,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_contf3_xyz_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contf3_xyz_val(_GR_, _DA_(v), _DA_(x), _DA_(y), _DA_(z), _DA_(a), *dir, *sVal, s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_contf3_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contf3_val(_GR_, _DA_(v), _DA_(a), *dir, *sVal, s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_contf3_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contf3_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(a), *dir, *sVal, s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_contf3_(uintptr_t *gr, uintptr_t *a, const char *dir, float *sVal, const char *sch, const char *opt,int,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contf3(_GR_, _DA_(a), *dir, *sVal, s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Axial series +// +//----------------------------------------------------------------------------- +long mgl_find_prev(long i, long pc, long *nn) +{ + for(long k=0;kReserve(pc*82); else gr->Reserve(pc*82); + for(i=0;iAddPnt(p,cc) : gr->AddPnt(p,cc,(a*q1.y + c*q1.x)^b); + p = a*ff[nn[i]].y + c*ff[nn[i]].x; + p2 = wire ? gr->AddPnt(p,cc) : gr->AddPnt(p,cc,(a*q2.y + c*q2.x)^b); + if(wire) gr->line_plot(p1,p2); + + for(j=1;j<41;j++) + { + p3 = p1; p4 = p2; + fi = j*M_PI/20; si = sin(fi); co = cos(fi); + p = a*ff[i].y + b*(si*ff[i].x) + c*(co*ff[i].x); + p1 = wire ? gr->AddPnt(p,cc) : gr->AddPnt(p,cc,(a*q1.y + b*(si*q1.x) + c*(co*q1.x))^(b*co-c*si)); + p = a*ff[nn[i]].y + b*(si*ff[nn[i]].x) + c*(co*ff[nn[i]].x); + p2 = wire ? gr->AddPnt(p,cc) : gr->AddPnt(p,cc,(a*q2.y + b*(si*q2.x) + c*(co*q2.x))^(b*co-c*si)); + if(wire) + { gr->line_plot(p1,p2); gr->line_plot(p1,p3); + gr->line_plot(p4,p2); gr->line_plot(p4,p3); } + else gr->quad_plot(p3,p4,p1,p2); + } + } +} +//----------------------------------------------------------------------------- +// NOTE! All data MUST have the same size! Only first slice is used! +void mgl_axial_gen(HMGL gr, float val, HCDT a, HCDT x, HCDT y, float c, char dir,long ak,bool wire) +{ + long n=a->GetNx(), m=a->GetNy(); + if(n<2 || m<2 || x->GetNx()*x->GetNy()!=n*m || y->GetNx()*y->GetNy()!=n*m) + { gr->SetWarn(mglWarnDim,"ContGen"); return; } + + mglPoint *kk = new mglPoint[2*n*m],*pp = new mglPoint[2*n*m],p; + float d, kx, ky; + register long i,j,k, pc=0; + // Usually number of points is much smaller. So, there is no reservation. +// gr->Reserve(2*n*m); + + // add intersection point of isoline and Y axis + for(j=0;jv(i,j,ak),a->v(i+1,j,ak)); + if(d>=0 && d<1) + { + pp[pc] = mglPoint(x->v(i,j)*(1-d)+x->v(i+1,j)*d, + y->v(i,j)*(1-d)+y->v(i+1,j)*d); + kk[pc] = mglPoint(i+d,j); pc++; + } + } + // add intersection point of isoline and X axis + for(j=0;jv(i,j,ak),a->v(i,j+1,ak)); + if(d>=0 && d<1) + { + pp[pc] = mglPoint(x->v(i,j)*(1-d)+x->v(i,j+1)*d, + y->v(i,j)*(1-d)+y->v(i,j+1)*d); + kk[pc] = mglPoint(i,j+d); pc++; + } + } + // deallocate arrays and finish if no point + if(pc==0) { delete []kk; return; } + // allocate arrays for curve + long *nn = new long[pc], *ff = new long[pc]; + for(i=0;i=0) + { + kx = kk[j].x; ky = kk[j].y; i = -1; + i11 = long(kx+1e-5); i12 = long(kx-1e-5); + j11 = long(ky+1e-5); j12 = long(ky-1e-5); + for(k=0;k=0); + mgl_axial_plot(gr,pc,pp,nn,dir,c,wire); + delete []kk; delete []nn; delete []ff; delete []pp; +} +//----------------------------------------------------------------------------- +void mgl_axial_xy_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ + register long i,j,n=z->GetNx(),m=z->GetNy(); + if(x->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Axial"); return; } + if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"Axial"); return; } + bool both = x->GetNx()*x->GetNy()==m*n && y->GetNx()*y->GetNy()==m*n; + if(y->GetNx()!=z->GetNy() && !both) { gr->SetWarn(mglWarnDim, "Axial"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Axial",cgid++); + + long s=gr->AddTexture(sch); + char dir='y'; + if(sch) + { + if(strchr(sch,'x')) dir = 'x'; + if(strchr(sch,'z')) dir = 'z'; + } + + mglData xx, yy; + if(!both) // make + { + xx.Create(z->GetNx(), z->GetNy()); + yy.Create(z->GetNx(), z->GetNy()); + for(j=0;jv(i); yy.a[i+n*j] = y->v(j); } + x = &xx; y = &yy; + } + // x, y -- have the same size z + float v0; + bool wire = sch && strchr(sch,'#'); + for(j=0;jGetNz();j++) for(i=0;iGetNx();i++) + { + v0 = v->v(i); + mgl_axial_gen(gr,v0,z,x,y,gr->GetC(s,v0),dir,j,wire); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_axial_val(HMGL gr, HCDT v, HCDT a, const char *sch, const char *opt) +{ + if(a->GetNx()<2 || a->GetNy()<2) { gr->SetWarn(mglWarnLow,"Axial"); return; } + gr->SaveState(opt); + mglData x(a->GetNx(),a->GetNy()), y(a->GetNx(),a->GetNy()); + if(gr->Max.x*gr->Min.x>=0) x.Fill(gr->Min.x,gr->Max.x,'x'); + else x.Fill(0,gr->Max.x,'x'); + y.Fill(gr->Min.y,gr->Max.y,'y'); + mgl_axial_xy_val(gr,v,&x,&y,a,sch,0); +} +//----------------------------------------------------------------------------- +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); + 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); + mgl_axial_xy_val(gr,&v,x,y,a,sch,0); +} +//----------------------------------------------------------------------------- +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); + 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); + mgl_axial_val(gr,&v,a,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_axial_xy_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_axial_xy_val(_GR_, _DA_(v), _DA_(x), _DA_(y), _DA_(a), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_axial_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_axial_val(_GR_, _DA_(v), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_axial_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_axial_xy(_GR_, _DA_(x), _DA_(y), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_axial_(uintptr_t *gr, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_axial(_GR_, _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Torus series +// +//----------------------------------------------------------------------------- +void mgl_torus(HMGL gr, HCDT r, HCDT z, const char *sch, const char *opt) +{ + long i,j,n=r->GetNx(); + if(n*r->GetNy()!=z->GetNx()*z->GetNy()) { gr->SetWarn(mglWarnDim,"Torus"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Torus"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Torus",cgid++); + + mglPoint *pp = new mglPoint[n]; + long *nn = new long[n]; + long ss=gr->AddTexture(sch); + char dir='y'; + if(sch) + { + if(strchr(sch,'x')) dir = 'x'; + if(strchr(sch,'z')) dir = 'z'; + } + + float c = gr->GetC(ss,gr->Min.c); + for(j=0;jGetNy();j++) + { + for(i=0;iv(i,j), z->v(i,j)); + } + mgl_axial_plot(gr,n,pp,nn,dir,c,sch && strchr(sch,'#')); + } + gr->EndGroup(); + delete []nn; delete []pp; +} +//----------------------------------------------------------------------------- +void mgl_torus_(uintptr_t *gr, uintptr_t *r, uintptr_t *z, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_torus(_GR_, _DA_(r), _DA_(z), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- diff --git a/src/crust.cpp b/src/crust.cpp new file mode 100644 index 0000000..ac1ac13 --- /dev/null +++ b/src/crust.cpp @@ -0,0 +1,457 @@ +/*************************************************************************** + * crust.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License 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 +#include "mgl/other.h" +#include "mgl/data.h" +//----------------------------------------------------------------------------- +// +// TriPlot series +// +//----------------------------------------------------------------------------- +void mgl_triplot_xyzc(HMGL gr, HCDT nums, HCDT x, HCDT y, HCDT z, HCDT a, const char *sch, const char *opt) +{ + long n = x->GetNx(), m = nums->GetNy(); + if(y->GetNx()!=n || z->GetNx()!=n || nums->GetNx()<3) { gr->SetWarn(mglWarnLow,"TriPlot"); return; } + if(a->GetNx()!=m && a->GetNx()!=n) { gr->SetWarn(mglWarnLow,"TriPlot"); return; } + long ss=gr->AddTexture(sch); + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("TriPlot",cgid++); + mglPoint p,q=mglPoint(NAN); + + register long i,k,k1,k2,k3; + long nc = a->GetNx(); + if(nc!=n && nc>=m) // colors per triangle + { + gr->Reserve(m*3); + for(i=0;iv(0,i)+0.5); + p = mglPoint(x->v(k), y->v(k), z->v(k)); + k1 = gr->AddPnt(p,gr->GetC(ss,a->v(k)),q); + k = long(nums->v(1,i)+0.5); + p = mglPoint(x->v(k), y->v(k), z->v(k)); + k2 = gr->AddPnt(p,gr->GetC(ss,a->v(k)),q); + k = long(nums->v(2,i)+0.5); + p = mglPoint(x->v(k), y->v(k), z->v(k)); + k3 = gr->AddPnt(p,gr->GetC(ss,a->v(k)),q); + gr->trig_plot(k1,k2,k3); + } + } + else if(nc>=n) // colors per point + { + gr->Reserve(n); + long *kk = new long[n]; + for(k=0;kv(k), y->v(k), z->v(k)); + kk[k] = gr->AddPnt(p,gr->GetC(ss,a->v(k)),q); + } + for(i=0;iv(0,i)+0.5); + k2 = long(nums->v(1,i)+0.5); + k3 = long(nums->v(2,i)+0.5); + gr->trig_plot(kk[k1],kk[k2],kk[k3]); + } + delete []kk; + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_triplot_xyz(HMGL gr, HCDT nums, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ mgl_triplot_xyzc(gr,nums,x,y,z,z,sch,opt); } +//----------------------------------------------------------------------------- +void mgl_triplot_xy(HMGL gr, HCDT nums, HCDT x, HCDT y, const char *sch, const char *opt) +{ + gr->SaveState(opt); + mglData z(x->GetNx()); z.Fill(gr->Min.z,gr->Min.z); + mgl_triplot_xyzc(gr,nums,x,y,&z,&z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_triplot_xyzc_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_triplot_xyzc(_GR_, _DA_(nums), _DA_(x), _DA_(y), _DA_(z), _DA_(c), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_triplot_xyz_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_triplot_xyz(_GR_, _DA_(nums), _DA_(x), _DA_(y), _DA_(z), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_triplot_xy_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_triplot_xy(_GR_, _DA_(nums), _DA_(x), _DA_(y), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// QuadPlot series +// +//----------------------------------------------------------------------------- +void mgl_quadplot_xyzc(HMGL gr, HCDT nums, HCDT x, HCDT y, HCDT z, HCDT a, const char *sch, const char *opt) +{ + long n = x->GetNx(), m = nums->GetNy(); + if(y->GetNx()!=n || z->GetNx()!=n || nums->GetNx()<4) { gr->SetWarn(mglWarnLow,"QuadPlot"); return; } + if(a->GetNx()!=m && a->GetNx()!=n) { gr->SetWarn(mglWarnLow,"QuadPlot"); return; } + long ss=gr->AddTexture(sch); + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("QuadPlot",cgid++); + mglPoint p,q=mglPoint(NAN); + + register long i,k,k1,k2,k3,k4; + long nc = a->GetNx(); + if(nc!=n && nc>=m) // colors per triangle + { + gr->Reserve(m*4); + for(i=0;iv(0,i)+0.5); + p = mglPoint(x->v(k), y->v(k), z->v(k)); + k1 = gr->AddPnt(p,gr->GetC(ss,a->v(k)),q); + k = long(nums->v(1,i)+0.5); + p = mglPoint(x->v(k), y->v(k), z->v(k)); + k2 = gr->AddPnt(p,gr->GetC(ss,a->v(k)),q); + k = long(nums->v(2,i)+0.5); + p = mglPoint(x->v(k), y->v(k), z->v(k)); + k3 = gr->AddPnt(p,gr->GetC(ss,a->v(k)),q); + k = long(nums->v(3,i)+0.5); + p = mglPoint(x->v(k), y->v(k), z->v(k)); + k4 = gr->AddPnt(p,gr->GetC(ss,a->v(k)),q); + gr->quad_plot(k1,k2,k3,k4); + } + } + else if(nc>=n) // colors per point + { + gr->Reserve(n); + long *kk = new long[n]; + for(k=0;kv(k), y->v(k), z->v(k)); + kk[k] = gr->AddPnt(p,gr->GetC(ss,a->v(k)),q); + } + for(i=0;iv(0,i)+0.5); + k2 = long(nums->v(1,i)+0.5); + k3 = long(nums->v(2,i)+0.5); + k4 = long(nums->v(3,i)+0.5); + gr->quad_plot(kk[k1],kk[k2],kk[k3],kk[k4]); + } + delete []kk; + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_quadplot_xyz(HMGL gr, HCDT nums, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ mgl_quadplot_xyzc(gr,nums,x,y,z,z,sch,opt); } +//----------------------------------------------------------------------------- +void mgl_quadplot_xy(HMGL gr, HCDT nums, HCDT x, HCDT y, const char *sch, const char *opt) +{ + gr->SaveState(opt); + mglData z(x->GetNx()); z.Fill(gr->Min.z,gr->Min.z); + mgl_quadplot_xyzc(gr,nums,x,y,&z,&z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_quadplot_xyzc_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_quadplot_xyzc(_GR_, _DA_(nums), _DA_(x), _DA_(y), _DA_(z), _DA_(c), s, o); + delete []o; delete []s;} +//----------------------------------------------------------------------------- +void mgl_quadplot_xyz_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_quadplot_xyzc(_GR_, _DA_(nums), _DA_(x), _DA_(y), _DA_(z), _DA_(z), s, o); + delete []o; delete []s;} +//----------------------------------------------------------------------------- +void mgl_quadplot_xy_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_quadplot_xy(_GR_, _DA_(nums), _DA_(x), _DA_(y), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// TriCont series +// +//----------------------------------------------------------------------------- +void mgl_tricont_line(HMGL gr, float val, long k1, long k2, long k3, HCDT x, HCDT y, HCDT z, HCDT a, bool zVal,float c) +{ + float d1,d2; + mglPoint p1,p2,n; + d1 = mgl_d(val,a->v(k1),a->v(k2)); + d2 = mgl_d(val,a->v(k1),a->v(k3)); + if(d1<0 || d1>1 || d2<0 || d2>1) return; + p1 = mglPoint(x->v(k1)*(1-d1)+x->v(k2)*d1, y->v(k1)*(1-d1)+y->v(k2)*d1, + zVal?z->v(k1)*(1-d1)+z->v(k2)*d1:gr->Min.z); + if(!gr->ScalePoint(p1,n)) return; + p2 = mglPoint(x->v(k1)*(1-d2)+x->v(k3)*d2, y->v(k1)*(1-d2)+y->v(k3)*d2, + zVal?z->v(k1)*(1-d2)+z->v(k3)*d2:gr->Min.z); + if(!gr->ScalePoint(p2,n)) return; + + k1 = gr->AddPnt(p1,c); k2 = gr->AddPnt(p2,c); + gr->line_plot(k1,k2); +} +//----------------------------------------------------------------------------- +void mgl_tricont_xyzcv(HMGL gr, HCDT v, HCDT nums, HCDT x, HCDT y, HCDT z, HCDT a, const char *sch, const char *opt) +{ + long n = x->GetNx(), m = nums->GetNy(); + if(y->GetNx()!=n || z->GetNx()!=n || nums->GetNx()<3) { gr->SetWarn(mglWarnLow,"TriCont"); return; } + if(a->GetNx()!=m && a->GetNx()!=n) { gr->SetWarn(mglWarnLow,"TriCont"); return; } + long ss=gr->AddTexture(sch); + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("TriCont",cgid++); + float val; + register long i,k; + long k1,k2,k3; + bool zVal = (sch && strchr(sch,'_')); + for(k=0;kGetNx();k++) for(i=0;iv(0,i)+0.1); if(k1<0 || k1>=n) continue; + k2 = long(nums->v(1,i)+0.1); if(k2<0 || k2>=n) continue; + k3 = long(nums->v(2,i)+0.1); if(k3<0 || k3>=n) continue; + val = v->v(k); + float c = gr->GetC(ss,val); + mgl_tricont_line(gr,val, k1,k2,k3,x,y,z,a,zVal,c); + mgl_tricont_line(gr,val, k2,k1,k3,x,y,z,a,zVal,c); + mgl_tricont_line(gr,val, k3,k2,k1,x,y,z,a,zVal,c); + } +} +//----------------------------------------------------------------------------- +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); + 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); +} +//----------------------------------------------------------------------------- +void mgl_tricont_xyc(HMGL gr, HCDT nums, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ mgl_tricont_xyzc(gr,nums,x,y,z,z,sch,opt); } +//----------------------------------------------------------------------------- +void mgl_tricont_xycv(HMGL gr, HCDT v, HCDT nums, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ mgl_tricont_xyzcv(gr,v,nums,x,y,z,z,sch,opt); } +//----------------------------------------------------------------------------- +void mgl_tricont_xyzcv_(uintptr_t *gr, uintptr_t *v, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tricont_xyzcv(_GR_, _DA_(v), _DA_(nums), _DA_(x), _DA_(y), _DA_(z), _DA_(c), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_tricont_xycv_(uintptr_t *gr, uintptr_t *v, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tricont_xycv(_GR_, _DA_(v), _DA_(nums), _DA_(x), _DA_(y), _DA_(z), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_tricont_xyzc_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *sch, const char *opt, int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tricont_xyzc(_GR_, _DA_(nums), _DA_(x), _DA_(y), _DA_(z), _DA_(c), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_tricont_xyc_(uintptr_t *gr, uintptr_t *nums, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt, int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tricont_xyc(_GR_, _DA_(nums), _DA_(x), _DA_(y), _DA_(z), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Dots series +// +//----------------------------------------------------------------------------- +void mgl_dots_a(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, const char *sch, const char *opt) +{ + long n = x->GetNx(); + if(y->GetNx()!=n || z->GetNx()!=n || a->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Dots"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Dots",cgid++); + char mk=gr->SetPenPal(sch); + long ss=gr->AddTexture(sch), pp; + if(mk==0) mk='.'; + gr->Reserve(n); + mglPoint p; + + for(long i=0;iv(i),y->v(i),z->v(i)); + pp = gr->AddPnt(p,gr->GetC(ss,a->v(i))); + gr->mark_plot(pp, mk); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_dots(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ mgl_dots_a(gr, x, y, z, z, sch, opt); } +//----------------------------------------------------------------------------- +void mgl_dots_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_dots(_GR_, _DA_(x),_DA_(y),_DA_(z),s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_dots_a_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_dots_a(_GR_, _DA_(x),_DA_(y),_DA_(z),_DA_(a),s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// mglTriangulation +// +//----------------------------------------------------------------------------- +long mgl_crust(long n,mglPoint *pp,long **nn,float ff); +HMDT mgl_triangulation_3d(HCDT x, HCDT y, HCDT z, float er) +{ + mglData *nums=new mglData; + long n = x->GetNx(), m; + if(y->GetNx()!=n || z->GetNx()!=n) return nums; + register long i; + mglPoint *pp = new mglPoint[n]; + long *nn=0; + for(i=0;iv(i), y->v(i), z->v(i)); + m = mgl_crust(n,pp,&nn,er); + + if(m>0) + { + nums->Create(3,m); + for(i=0;i<3*m;i++) nums->a[i]=nn[i]; + } + delete []pp; free(nn); return nums; +} +//----------------------------------------------------------------------------- +HMDT mgl_triangulation_2d(HCDT x, HCDT y, float er) +{ + mglData z(x->GetNx()); + return mgl_triangulation_3d(x,y,&z,er); +} +//----------------------------------------------------------------------------- +uintptr_t mgl_triangulation_3d_(uintptr_t *x, uintptr_t *y, uintptr_t *z, float *er) +{ return uintptr_t(mgl_triangulation_3d(_DA_(x),_DA_(y),_DA_(z),*er)); } +uintptr_t mgl_triangulation_2d_(uintptr_t *x, uintptr_t *y, float *er) +{ return uintptr_t(mgl_triangulation_2d(_DA_(x),_DA_(y),*er)); } +//----------------------------------------------------------------------------- +// +// Crust series +// +//----------------------------------------------------------------------------- +void mgl_crust(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ + if(y->GetNx()!=x->GetNx() || z->GetNx()!=x->GetNx()) + { gr->SetWarn(mglWarnDim,"Crust"); return; } + HMDT nums = mgl_triangulation_3d(x, y, z, 0); + mgl_triplot_xyzc(gr,nums,x,y,z,z,sch,opt); + mgl_delete_data(nums); +} +//----------------------------------------------------------------------------- +void mgl_crust_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_crust(_GR_, _DA_(x),_DA_(y),_DA_(z),s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +long mgl_insert_trig(long i1,long i2,long i3,long **n) +{ + static long Cur=0,Max=0; + if(i1<0 || i2<0 || i3<0) return Cur; + if(*n==0) + { + Max = 1024; Cur = 0; + *n = (long *)malloc(Max*3*sizeof(long)); + memset(*n,0,Max*3*sizeof(long)); + } + if(Cur>=Max) + { + Max += 1024; + *n = (long *)realloc(*n,Max*3*sizeof(long)); + memset(*n+3*(Max-1024),0,3*1024*sizeof(long)); + } + long *nn = *n; + register long i,k1; + if(i1>i3) { k1=i1; i1=i3; i3=k1; } // simple sorting + if(i1>i2) { k1=i1; i1=i2; i2=k1; } + if(i2>i3) { k1=i2; i2=i3; i3=k1; } + for(i=0;i0) continue; + r = mgl_norm(qq[i]-qq[k1]); + if(rr) rm = r; + } + rs += sqrt(rm); + } + rs *= ff/n; rs = rs*rs; // "average" distance + long ind[100], set[100], ii; // indexes of "close" points, flag that it was added and its number + mglPoint qq[100]; // normalized point coordinates + long k1,k2,k3,m=0; + for(i=0;i0) + { + set[k1]=1; + m = mgl_insert_trig(i,ind[k1],ind[k2],nn); + k1 = k2; + } + m = mgl_insert_trig(i,ind[k1],ind[0],nn); + } + return m; +} +//----------------------------------------------------------------------------- diff --git a/src/data.cpp b/src/data.cpp new file mode 100644 index 0000000..fbc3bc4 --- /dev/null +++ b/src/data.cpp @@ -0,0 +1,1557 @@ +/*************************************************************************** + * data.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License 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 +#include +#include "mgl/data.h" +#include "mgl/eval.h" + +int mglNumThr=0; +void mglFillP(long x,long y, const mreal *a,long nx,long ny,mreal _p[4][4]); +void mglFillP(long x, const mreal *a,long nx,mreal _p[4]); +void mglFillP5(long x,long y, const mreal *a,long nx,long ny,mreal _p[6][6]); +void mglFillP5(long x, const mreal *a,long nx,mreal _p[6]); +//----------------------------------------------------------------------------- +void mglSetNumThr(int n) +{ +#ifdef HAVE_PTHREAD + mglNumThr = n>0 ? n : get_nprocs_conf(); +#else + mglNumThr = 1; +#endif +} +//----------------------------------------------------------------------------- +void mglStartThread(void *(*func)(void *), void (*post)(mglThreadD *,mreal *), long n, mreal *a, + const mreal *b, const mreal *c, const long *p, void *v, const mreal *d, const mreal *e, char *s) +{ + if(!func) return; +#ifdef HAVE_PTHREAD + if(mglNumThr<1) mglSetNumThr(0); + if(mglNumThr>1) + { + pthread_t *tmp=new pthread_t[mglNumThr]; + mglThreadD *par=new mglThreadD[mglNumThr]; + register long i; + for(i=0;ip[0]; + mreal *b=t->a, delta=t->c[0], y5,y3,x2y; + const mreal *a=t->b; + for(i=t->id;in;i+=mglNumThr) + { + j = i%nx; + d3 = d5 = 0; + if(j==0) { d3 = 1; d5 = 2; } + if(j==1) { d5 = 1; } + if(j==nx-1) { d3 = -1; d5 = -2;} + if(j==nx-2) { d5 = -1;} + y3 = (a[i+d3-1] + a[i+d3] + a[i+d3+1]); + y5 = (a[i+d5-2] + a[i+d5-1] + a[i+d5] + a[i+d5+1] + a[i+d5+2]); + x2y= (a[i+d5+1] + 4*a[i+d5+2] + 4*a[i+d5-2] + a[i+d5-1]); + j = t->p[2]; + if(d3) b[i] = a[i]; + else if(j==SMOOTH_LINE_3 || d5) b[i] = y3/3.; + else if(j==SMOOTH_LINE_5) b[i] = y5/5.; + else if(j==SMOOTH_QUAD_5) b[i] = (17*y5-5*x2y)/35.; + if(delta>0) b[i] = mgl_max(a[i]-delta,mgl_min(a[i]+delta,b[i])); + } + return 0; +} +void *mgl_smth_y(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j,d3,d5, nx=t->p[0],ny=t->p[1]; + mreal *b=t->a, delta=t->c[0], y5,y3,x2y; + const mreal *a=t->b; + for(i=t->id;in;i+=mglNumThr) + { + j = (i/nx)%ny; + d3 = d5 = 0; + if(j==0) { d3 = 1; d5 = 2; } + if(j==1) { d5 = 1; } + if(j==ny-1) { d3 = -1; d5 = -2;} + if(j==ny-2) { d5 = -1;} + y3 = (a[i+nx*(d3-1)] + a[i+nx*d3] + a[i+nx*(d3+1)]); + y5 = (a[i+nx*(d5-2)] + a[i+nx*(d5-1)] + a[i+nx*d5] + a[i+nx*(d5+1)] + a[i+nx*(d5+2)]); + x2y= (a[i+nx*(d5+1)] + 4*a[i+nx*(d5+2)] + 4*a[i+nx*(d5-2)] + a[i+nx*(d5-1)]); + j = t->p[2]; + if(d3) b[i] = a[i]; + else if(j==SMOOTH_LINE_3 || d5) b[i] = y3/3.; + else if(j==SMOOTH_LINE_5) b[i] = y5/5.; + else if(j==SMOOTH_QUAD_5) b[i] = (17*y5-5*x2y)/35.; + if(delta>0) b[i] = mgl_max(a[i]-delta,mgl_min(a[i]+delta,b[i])); + } + return 0; +} +void *mgl_smth_z(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j,d3,d5, nn=t->p[0]*t->p[1], nz=t->n/nn; + mreal *b=t->a, delta=t->c[0], y5,y3,x2y; + const mreal *a=t->b; + for(i=t->id;in;i+=mglNumThr) + { + j = i/nn; + d3 = d5 = 0; + if(j==0) { d3 = 1; d5 = 2; } + if(j==1) { d5 = 1; } + if(j==nz-1) { d3 = -1; d5 = -2;} + if(j==nz-2) { d5 = -1;} + y3 = (a[i+nn*(d3-1)] + a[i+nn*d3] + a[i+nn*(d3+1)]); + y5 = (a[i+nn*(d5-2)] + a[i+nn*(d5-1)] + a[i+nn*d5] + a[i+nn*(d5+1)] + a[i+nn*(d5+2)]); + x2y= (a[i+nn*(d5+1)] + 4*a[i+nn*(d5+2)] + 4*a[i+nn*(d5-2)] + a[i+nn*(d5-1)]); + j = t->p[2]; + if(d3) b[i] = a[i]; + else if(j==SMOOTH_LINE_3 || d5) b[i] = y3/3.; + else if(j==SMOOTH_LINE_5) b[i] = y5/5.; + else if(j==SMOOTH_QUAD_5) b[i] = (17*y5-5*x2y)/35.; + if(delta>0) b[i] = mgl_max(a[i]-delta,mgl_min(a[i]+delta,b[i])); + } + return 0; +} +void mgl_data_smooth(HMDT d, const char *dirs, float delta) +{ + long Type = SMOOTH_QUAD_5; + if(strchr(dirs,'0') || strchr(dirs,'1')) return; + if(strchr(dirs,'3')) Type = SMOOTH_LINE_3; + if(strchr(dirs,'5')) Type = SMOOTH_LINE_5; + long nx=d->nx,ny=d->ny,nz=d->nz; +// if(Type == SMOOTH_NONE) return; + long p[3]={nx,ny,Type}; + mreal *b = new mreal[nx*ny*nz]; + // ����������� �� x + memset(b,0,nx*ny*nz*sizeof(mreal)); + if(nx>4 && strchr(dirs,'x')) + { + mglStartThread(mgl_smth_x,0,nx*ny*nz,b,d->a,&delta,p); + memcpy(d->a,b,nx*ny*nz*sizeof(mreal)); + memset(b,0,nx*ny*nz*sizeof(mreal)); + } + if(ny>4 && strchr(dirs,'y')) + { + mglStartThread(mgl_smth_y,0,nx*ny*nz,b,d->a,&delta,p); + memcpy(d->a,b,nx*ny*nz*sizeof(mreal)); + memset(b,0,nx*ny*nz*sizeof(mreal)); + } + if(nz>4 && strchr(dirs,'z')) + { + mglStartThread(mgl_smth_z,0,nx*ny*nz,b,d->a,&delta,p); + memcpy(d->a,b,nx*ny*nz*sizeof(mreal)); + } + delete []b; +} +void mgl_data_smooth_(uintptr_t *d, const char *dir, float *delta,int l) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; + mgl_data_smooth(_DT_,s,*delta); delete []s; } +//----------------------------------------------------------------------------- +void *mgl_csum_z(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j, nz=t->p[2], nn=t->n; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;ip[0], ny=t->p[1], nn=t->n; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;ip[0], nn=t->n; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;inx,ny=d->ny,nz=d->nz,nn=nx*ny*nz; + long p[3]={nx,ny,nz}; + mreal *b = new mreal[nn]; + memcpy(b,d->a,nn*sizeof(mreal)); + if(strchr(dir,'z') && nz>1) + { + mglStartThread(mgl_csum_z,0,nx*ny,b,d->a,0,p); + memcpy(d->a,b,nn*sizeof(mreal)); + } + if(strchr(dir,'y') && ny>1) + { + mglStartThread(mgl_csum_y,0,nx*nz,b,d->a,0,p); + memcpy(d->a,b,nn*sizeof(mreal)); + } + if(strchr(dir,'x') && nx>1) + { + mglStartThread(mgl_csum_x,0,nz*ny,b,d->a,0,p); + memcpy(d->a,b,nn*sizeof(mreal)); + } + delete []b; +} +void mgl_data_cumsum_(uintptr_t *d, const char *dir,int l) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; + mgl_data_cumsum(_DT_,s); delete []s; } +//----------------------------------------------------------------------------- +void *mgl_int_z(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j, nz=t->p[2], nn=t->n; + mreal *b=t->a, dd=0.5/nz; + const mreal *a=t->b; + for(i=t->id;ip[0], ny=t->p[1], nn=t->n; + mreal *b=t->a, dd=0.5/ny; + const mreal *a=t->b; + for(i=t->id;ip[0], nn=t->n; + mreal *b=t->a, dd=0.5/nx; + const mreal *a=t->b; + for(i=t->id;inx,ny=d->ny,nz=d->nz,nn=nx*ny*nz; + long p[3]={nx,ny,nz}; + mreal *b = new mreal[nn]; + memcpy(b,d->a,nn*sizeof(mreal)); + if(strchr(dir,'z') && nz>1) + { + mglStartThread(mgl_int_z,0,nx*ny,b,d->a,0,p); + memcpy(d->a,b,nn*sizeof(mreal)); + } + if(strchr(dir,'y') && ny>1) + { + mglStartThread(mgl_int_y,0,nx*nz,b,d->a,0,p); + memcpy(d->a,b,nn*sizeof(mreal)); + } + if(strchr(dir,'x') && nx>1) + { + mglStartThread(mgl_int_x,0,nz*ny,b,d->a,0,p); + memcpy(d->a,b,nn*sizeof(mreal)); + } + delete []b; +} +void mgl_data_integral_(uintptr_t *d, const char *dir,int l) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; + mgl_data_integral(_DT_,s); delete []s; } +//----------------------------------------------------------------------------- +void *mgl_dif_z(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j, nz=t->p[2], nn=t->n; + mreal *b=t->a, dd=0.5*nz; + const mreal *a=t->b; + for(i=t->id;ip[0], ny=t->p[1], nn=t->n; + mreal *b=t->a, dd=0.5*ny; + const mreal *a=t->b; + for(i=t->id;ip[0], nn=t->n; + mreal *b=t->a, dd=0.5*nx; + const mreal *a=t->b; + for(i=t->id;inx,ny=d->ny,nz=d->nz,nn=nx*ny*nz; + long p[3]={nx,ny,nz}; + mreal *b = new mreal[nn]; + if(strchr(dir,'z') && nz>1) + { + mglStartThread(mgl_dif_z,0,nx*ny,b,d->a,0,p); + memcpy(d->a,b,nn*sizeof(mreal)); + } + if(strchr(dir,'y') && ny>1) + { + mglStartThread(mgl_dif_y,0,nx*nz,b,d->a,0,p); + memcpy(d->a,b,nn*sizeof(mreal)); + } + if(strchr(dir,'x') && nx>1) + { + mglStartThread(mgl_dif_x,0,nz*ny,b,d->a,0,p); + memcpy(d->a,b,nn*sizeof(mreal)); + } + delete []b; +} +void mgl_data_diff_(uintptr_t *d, const char *dir,int l) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; + mgl_data_diff(_DT_,s); delete []s; } +//----------------------------------------------------------------------------- +void *mgl_dif2_z(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j, nz=t->p[2], nn=t->n; + mreal *b=t->a, dd=0.5*nz*nz; + const mreal *a=t->b; + for(i=t->id;ip[0], ny=t->p[1], nn=t->n; + mreal *b=t->a, dd=0.5*ny*ny; + const mreal *a=t->b; + for(i=t->id;ip[0], nn=t->n; + mreal *b=t->a, dd=0.5*nx*nx; + const mreal *a=t->b; + for(i=t->id;inx,ny=d->ny,nz=d->nz,nn=nx*ny*nz; + long p[3]={nx,ny,nz}; + mreal *b = new mreal[nn]; + if(strchr(dir,'z') && nz>1) + { + mglStartThread(mgl_dif2_z,0,nx*ny,b,d->a,0,p); + memcpy(d->a,b,nn*sizeof(mreal)); + } + if(strchr(dir,'y') && ny>1) + { + mglStartThread(mgl_dif2_y,0,nx*nz,b,d->a,0,p); + memcpy(d->a,b,nn*sizeof(mreal)); + } + if(strchr(dir,'x') && nx>1) + { + mglStartThread(mgl_dif2_x,0,nz*ny,b,d->a,0,p); + memcpy(d->a,b,nn*sizeof(mreal)); + } + delete []b; +} +void mgl_data_diff2_(uintptr_t *d, const char *dir,int l) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; + mgl_data_diff2(_DT_,s); delete []s; } +//----------------------------------------------------------------------------- +void mgl_data_swap(HMDT d, const char *dir) +{ + if(strchr(dir,'z') && d->nz>1) mgl_data_roll(d,'z',d->nz/2); + if(strchr(dir,'y') && d->ny>1) mgl_data_roll(d,'y',d->ny/2); + if(strchr(dir,'x') && d->nx>1) mgl_data_roll(d,'x',d->nx/2); +} +void mgl_data_swap_(uintptr_t *d, const char *dir,int l) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; + mgl_data_swap(_DT_,s); delete []s; } +//----------------------------------------------------------------------------- +void mgl_data_roll(HMDT dd, char dir, long num) +{ + long nx=dd->nx,ny=dd->ny,nz=dd->nz; + register long i,d; + mreal *b,*a=dd->a; + if(dir=='z' && nz>1) + { + d = num>0 ? num%nz : (num+nz*(1+num/nz))%nz; + if(d==0) return; // nothing to do + b = new mreal[nx*ny*nz]; + memcpy(b,a+nx*ny*d,nx*ny*(nz-d)*sizeof(mreal)); + memcpy(b+nx*ny*(nz-d),a,nx*ny*d*sizeof(mreal)); + memcpy(a,b,nx*ny*nz*sizeof(mreal)); delete []b; + } + if(dir=='y' && ny>1) + { + d = num>0 ? num%ny : (num+ny*(1+num/ny))%ny; + if(d==0) return; // nothing to do + b = new mreal[nx*ny*nz]; + memcpy(b,a+nx*d,(nx*ny*nz-nx*d)*sizeof(mreal)); + for(i=0;i1) + { + d = num>0 ? num%nx : (num+nx*(1+num/nx))%nx; + if(d==0) return; // nothing to do + b = new mreal[nx*ny*nz]; + memcpy(b,a+d,(nx*ny*nz-d)*sizeof(mreal)); + for(i=0;inx,ny=d->ny,nz=d->nz; + register long i,j,k,i0,j0; + mreal b, *a=d->a; + if(strchr(dir,'z') && nz>1) + { + for(j=0;j1) + { + for(k=0;k1) + { + for(j=0;j(d); + if(dd) + { + register long nx=dd->nx, ny=dd->ny, nz=dd->nz; + kx = kx=0 ? kx:0; + ky = ky=0 ? ky:0; + kz = kz=0 ? kz:0; + x -= kx; if(nx==1) x=0; + y -= ky; if(ny==1) y=0; + z -= kz; if(nz==1) z=0; + + register long i0 = kx+nx*(ky+ny*kz); + const mreal *aa=dd->a+i0; + b0 = aa[0]*(1-x-y+x*y) + x*(1-y)*aa[1] + y*(1-x)*aa[nx] + x*y*aa[1+nx]; + aa = dd->a + i0 + nx*ny; + b1 = aa[0]*(1-x-y+x*y) + x*(1-y)*aa[1] + y*(1-x)*aa[nx] + x*y*aa[1+nx]; + } + else + { + register long n=d->GetNx(), ny=d->GetNy(), nz=d->GetNz(); + kx = (kx>=0 ? (kx=0 ? (ky=0 ? (kzv(kx,ky,kz)*(1-x-y+x*y) + x*(1-y)*d->v(kx+1,ky,kz) + + y*(1-x)*d->v(kx,ky+1,kz) + x*y*d->v(kx+1,ky+1,kz); + kz++; + b1 = d->v(kx,ky,kz)*(1-x-y+x*y) + x*(1-y)*d->v(kx+1,ky,kz) + + y*(1-x)*d->v(kx,ky+1,kz) + x*y*d->v(kx+1,ky+1,kz); + } + return b0 + z*(b1-b0); +} +//----------------------------------------------------------------------------- +float mgl_data_spline(HCDT d, float x,float y,float z) +{ + const mglData *dd=dynamic_cast(d); + if(!d) return 0; // NOTE: don't support general arrays + return mglSpline3(dd->a,dd->nx,dd->ny,dd->nz,x,y,z,0,0,0); +} +//----------------------------------------------------------------------------- +mreal mglSpline3(const mreal *a, long nx, long ny, long nz, mreal x, mreal y, mreal z,mreal *dx, mreal *dy, mreal *dz) +{ + if(!a || nx<1 || ny<1 || nz<1) return 0; + mreal _p[4][4]; + register long i,j; + register mreal fx=1, fy=1; + long kx=long(x),ky=long(y),kz=long(z); + bool dd = (dx && dy && dz); + mreal b=0; + if(x<0 || y<0 || z<0 || x>nx-1 || y>ny-1 || z>nz-1) + return 0; + if(dd) { *dx=*dy=*dz=0; } + if(nz>1 && z!=kz) // 3d interpolation + { // TODO: add dx,dy,dz evaluation + mreal b1[4]={0,0,0,0}; + if(kx>nx-2) kx = nx-2; + if(ky>ny-2) ky = ny-2; + if(kz>nz-2) kz = nz-2; + + long kk=1; + if(kz==0) { kk=0; } + else if(nz>3 && kz==nz-2) { kk=2; } + for(long k=0;k<4;k++) + { + mglFillP(kx, ky, a+(kz+k-kk)*nx*ny, nx, ny, _p); + for(i=0,fx=1;i<4;i++) + { + for(j=0,fy=1;j<4;j++) + { b1[k] += fy*fx*_p[i][j]; fy *= y-ky; } + fx *= x-kx; + } + } + mglFillP(kk, b1, nz>3 ? 4:3, _p[0]); + for(i=0,fx=1,b=0;i<4;i++) + { b += fx*_p[0][i]; fx *= z-kz; } + } + else if(ny>1 && y!=ky) // 2d interpolation + { + if(kx>nx-2) kx = nx-2; + if(ky>ny-2) ky = ny-2; + mglFillP(kx, ky, a+kz*nx*ny, nx, ny, _p); + fx = 1; b = 0; + for(i=0;i<4;i++) + { + fy = 1; + for(j=0;j<4;j++) + { + b += fy*fx*_p[i][j]; + if(dd) + { + *dx+= i*fy*fx*_p[i][j]; + *dy+= j*fy*fx*_p[i][j]; + } + fy *= y-ky; + } + fx *= x-kx; + } + if(dd) { *dx /= x-kx; *dy /= y-ky; } + } + else if(nx>1 && x!=kx) // 1d interpolation + { + if(kx>nx-2) kx = nx-2; + mglFillP(kx, a+(ky+ny*kz)*nx, nx, _p[0]); + for(i=0,fx=1,b=0;i<4;i++) + { + b += fx*_p[0][i]; + if(dd) *dx+= i*fx*_p[0][i]; + fx *= x-kx; + } + if(dd) *dx /= x-kx; + } + else // no interpolation + b = a[kx+nx*(ky+ny*kz)]; + return b; +} +//----------------------------------------------------------------------------- +void mglFillP(long x,long y, const mreal *a,long nx,long ny,mreal _p[4][4]) +{ + mreal sx[4]={0,0,0,0},sy[4]={0,0,0,0},f[4]={0,0,0,0},d[4]={0,0,0,0}; + if(x<0 || y<0 || x>nx-2 || y>ny-2) + { + memset(_p[0],0,4*sizeof(mreal)); + memset(_p[1],0,4*sizeof(mreal)); + memset(_p[2],0,4*sizeof(mreal)); + memset(_p[3],0,4*sizeof(mreal)); + return; + } + // �������� ������� + f[0]=a[x+nx*y]; f[1]=a[x+nx*(y+1)]; + if(nx>1) { f[2]=a[x+1+nx*y]; f[3]=a[x+1+nx*(y+1)]; } + else { f[2] = f[0]; f[3] = f[1]; } + // ����������� �� x + if(nx>1) + { + if(x==0) + { + sx[0]=a[x+1+y*nx]-a[x+nx*y]; + sx[1]=a[x+1+nx*(y+1)]-a[x+nx*(y+1)]; + } + else + { + sx[0]=(a[x+1+nx*y]-a[x-1+nx*y])/2; + sx[1]=(a[x+1+nx*(y+1)]-a[x-1+nx*(y+1)])/2; + } + } + if(x==nx-2) + { + sx[2]=a[x+1+nx*y]-a[x+nx*y]; + sx[3]=a[x+1+nx*(y+1)]-a[x+nx*(y+1)]; + } + else + { + sx[2]=(a[x+2+nx*y]-a[x+nx*y])/2; + sx[3]=(a[x+2+nx*(y+1)]-a[x+nx*(y+1)])/2; + } + // ����������� �� y + if(y==0) + { + sy[0]=a[x+nx*(y+1)]-a[x+nx*y]; + sy[2]=a[x+1+nx*(y+1)]-a[x+1+nx*y]; + } + else + { + sy[0]=(a[x+nx*(y+1)]-a[x+nx*(y-1)])/2; + sy[2]=(a[x+1+nx*(y+1)]-a[x+1+nx*(y-1)])/2; + } + if(y==ny-2) + { + sy[1]=a[x+nx*(y+1)]-a[x+nx*y]; + sy[3]=a[x+1+nx*(y+1)]-a[x+1+nx*y]; + } + else + { + sy[1]=(a[x+nx*(y+2)]-a[x+nx*y])/2; + sy[3]=(a[x+1+nx*(y+2)]-a[x+1+nx*y])/2; + } + // ������������ ����������� + if(nx>1) + { + // ������ d[0] + if(y==0 && x==0) + d[0]=(a[x+1+nx*(y+1)]-a[x+nx*(y+1)]-a[x+1+nx*y]+a[x+nx*y]); + else if(y==0) + d[0]=(a[x+1+nx*(y+1)]-a[x-1+nx*(y+1)]-a[x+1+nx*y]+a[x-1+nx*y])/2; + else if(x==0) + d[0]=(a[x+1+nx*(y+1)]-a[x+nx*(y+1)]-a[x+1+nx*(y-1)]+a[x+nx*(y-1)])/2; + else + d[0]=(a[x+1+nx*(y+1)]-a[x-1+nx*(y+1)]-a[x+1+nx*(y-1)]+a[x-1+nx*(y-1)])/4; + // ������ d[1] + if(y==ny-2 && x==0) + d[1]=(a[x+1+nx*(y+1)]-a[x+nx*(y+1)]-a[x+1+nx*y]+a[x+nx*y]); + else if(y==ny-2) + d[1]=(a[x+1+nx*(y+1)]-a[x-1+nx*(y+1)]-a[x+1+nx*y]+a[x-1+nx*y])/2; + else if(x==0) + d[1]=(a[x+1+nx*(y+2)]-a[x+nx*(y+2)]-a[x+1+nx*y]+a[x+nx*y])/2; + else + d[1]=(a[x+1+nx*(y+2)]-a[x-1+nx*(y+2)]-a[x+1+nx*y]+a[x-1+nx*y])/4; + // ������ d[2] + if(y==0 && x==nx-2) + d[2]=(a[x+1+nx*(y+1)]-a[x+nx*(y+1)]-a[x+1+nx*y]+a[x+nx*y]); + else if(y==0) + d[2]=(a[x+2+nx*(y+1)]-a[x+nx*(y+1)]-a[x+2+nx*y]+a[x+nx*y])/2; + else if(x==nx-2) + d[2]=(a[x+1+nx*(y+1)]-a[x+nx*(y+1)]-a[x+1+nx*(y-1)]+a[x+nx*(y-1)])/2; + else + d[2]=(a[x+2+nx*(y+1)]-a[x+nx*(y+1)]-a[x+2+nx*(y-1)]+a[x+nx*(y-1)])/4; + // ������ d[3] + if(y==ny-2 && x==nx-2) + d[3]=(a[x+1+nx*(y+1)]-a[x+nx*(y+1)]-a[x+1+nx*y]+a[x+nx*y]); + else if(y==ny-2) + d[3]=(a[x+2+nx*(y+1)]-a[x+nx*(y+1)]-a[x+2+nx*y]+a[x+nx*y])/2; + else if(x==nx-2) + d[3]=(a[x+1+nx*(y+2)]-a[x+nx*(y+2)]-a[x+1+nx*y]+a[x+nx*y])/2; + else + d[3]=(a[x+2+nx*(y+2)]-a[x+nx*(y+2)]-a[x+2+nx*y]+a[x+nx*y])/4; + } + // ��������� ������������ �������� + _p[0][0]=f[0]; _p[1][0]=sx[0]; + _p[2][0]=3*(f[2]-f[0])-2*sx[0]-sx[2]; + _p[3][0]=sx[0]+sx[2]+2*(f[0]-f[2]); + _p[0][1]=sy[0]; _p[1][1]=d[0]; + _p[2][1]=3*(sy[2]-sy[0])-2*d[0]-d[2]; + _p[3][1]=d[0]+d[2]+2*(sy[0]-sy[2]); + _p[0][2]=3*(f[1]-f[0])-2*sy[0]-sy[1]; + _p[1][2]=3*(sx[1]-sx[0])-2*d[0]-d[1]; + _p[2][2]=9*(f[0]-f[1]-f[2]+f[3])+6*(sy[0]-sy[2]+sx[0]-sx[1])+ + 3*(sx[2]-sx[3]+sy[1]-sy[3])+2*(d[1]+d[2])+4*d[0]+d[3]; + _p[3][2]=6*(f[1]+f[2]-f[0]-f[3])+3*(sx[1]-sx[0]+sx[3]-sx[2])+ + 4*(sy[2]-sy[0])+2*(sy[3]-sy[1]-d[0]-d[2])-d[1]-d[3]; + _p[0][3]=2*(f[0]-f[1])+sy[0]+sy[1]; + _p[1][3]=2*(sx[0]-sx[1])+d[0]+d[1]; + _p[2][3]=6*(f[1]+f[2]-f[0]-f[3])+3*(sy[2]-sy[1]+sy[3]-sy[0])+ + 4*(sx[1]-sx[0])+2*(sx[3]-sx[2]-d[0]-d[1])-d[2]-d[3]; + _p[3][3]=d[0]+d[1]+d[2]+d[3]+4*(f[0]-f[1]-f[2]+f[3])+ + 2*(sx[0]-sx[1]+sx[2]-sx[3]+sy[0]-sy[2]+sy[1]-sy[3]); +} +//----------------------------------------------------------------------------- +void mglFillP(long x, const mreal *a,long nx,mreal _p[4]) +{ + if(x<0 || x>nx-2) + { + memset(_p,0,4*sizeof(mreal)); + return; + } + mreal s[2],f[2]; + // �������� ������� + f[0]=a[x]; f[1]=a[x+1]; + // ����������� �� x + if(x==0) s[0]=a[x+1]-a[x]; + else s[0]=(a[x+1]-a[x-1])/2; + if(x==nx-2) s[1]=a[x+1]-a[x]; + else s[1]=(a[x+2]-a[x])/2; + // ��������� ������������ �������� + _p[0]=f[0]; _p[1]=s[0]; + _p[2]=3*(f[1]-f[0])-2*s[0]-s[1]; + _p[3]=s[0]+s[1]+2*(f[0]-f[1]); +} +//----------------------------------------------------------------------------- +float mgl_data_spline_(uintptr_t *d, float *x,float *y,float *z) +{ return mgl_data_spline(_DA_(d),*x,*y,*z); } +float mgl_data_linear_(uintptr_t *d, float *x,float *y,float *z) +{ return mgl_data_linear(_DA_(d),*x,*y,*z); } +//----------------------------------------------------------------------------- +void mgl_data_crop(HMDT d, long n1, long n2, char dir) +{ + long nx=d->nx,ny=d->ny,nz=d->nz, nn; + register long i,k; + mreal *b; + if(n1<0) n1=0; + switch(dir) + { + case 'x': + n2 = n2>0 ? n2 : nx+n2; + if(n2<0 || n2>=nx || n2a+nx*i+n1,nn*sizeof(mreal)); + d->nx = nn; if(!d->link) delete []d->a; + d->a = b; d->link=false; d->NewId(); + break; + case 'y': + n2 = n2>0 ? n2 : ny+n2; + if(n2<0 || n2>=ny || n2a+nx*(n1+k+ny*j),nx*sizeof(mreal)); + d->ny = nn; if(!d->link) delete []d->a; + d->a = b; d->link=false; + break; + case 'z': + n2 = n2>0 ? n2 : nz+n2; + if(n2<0 || n2>=nz || n2a+nx*ny*n1,nn*nx*ny*sizeof(mreal)); + d->nz = nn; if(!d->link) delete []d->a; + d->a = b; d->link=false; + break; + } +} +void mgl_data_crop_(uintptr_t *d, int *n1, int *n2, const char *dir,int) +{ mgl_data_crop(_DT_,*n1,*n2,*dir); } +//----------------------------------------------------------------------------- +float mgl_data_last(HCDT d, const char *cond, long *i, long *j, long *k) +{ + long nx=d->GetNx(),ny=d->GetNy(),nz=d->GetNz(); + if(!cond) cond = "u"; + mglFormula eq(cond); + if(*i<0 || *i>=nx) *i=nx; + if(*j<0 || *j>=ny) *j=ny-1; + if(*k<0 || *k>=nz) *k=nz-1; + register long i0 = *i+nx*(*j+ny*(*k))-1; + mreal x,y,z,dx=nx>1?1/(nx-1.):0,dy=ny>1?1/(ny-1.):0,dz=nz>1?1/(nz-1.):0; + for(;i0>=0;i0--) + { + x = dx*(i0%nx); y = dy*((i0/nx)%ny); z = dz*(i0/(nx*ny)); + if(eq.Calc(x,y,z,d->vthr(i0))) break; + } + *i = i0%nx; *j = (i0/nx)%ny; *k = i0/(nx*ny); + return i0>=0 ? d->vthr(i0) : NAN; // NOTE: Return NAN if false +} +float mgl_data_last_(uintptr_t *d, const char *cond, int *i, int *j, int *k, int l) +{ long ii,jj,kk; char *s=new char[l+1]; memcpy(s,cond,l); s[l]=0; + float res = mgl_data_last(_DT_,s,&ii,&jj,&kk); *i=ii; *j=jj; *k=kk; + delete []s; return res; } +//----------------------------------------------------------------------------- +float mgl_data_first(HCDT d, const char *cond, long *i, long *j, long *k) +{ + long nx=d->GetNx(),ny=d->GetNy(),nz=d->GetNz(); + if(!cond) cond = "u"; + mglFormula eq(cond); + if(*i<0 || *i>=nx) *i=nx; + if(*j<0 || *j>=ny) *j=ny-1; + if(*k<0 || *k>=nz) *k=nz-1; + register long i0 = *i+nx*(*j+ny*(*k))-1; + mreal x,y,z,dx=nx>1?1/(nx-1.):0,dy=ny>1?1/(ny-1.):0,dz=nz>1?1/(nz-1.):0; + for(;i0vthr(i0))) break; + } + *i = i0%nx; *j = (i0/nx)%ny; *k = i0/(nx*ny); + return i0vthr(i0) : NAN; // NOTE: Return NAN if false +} +float mgl_data_first_(uintptr_t *d, const char *cond, int *i, int *j, int *k, int l) +{ long ii,jj,kk; char *s=new char[l+1]; memcpy(s,cond,l); s[l]=0; + float res = mgl_data_first(_DT_,s,&ii,&jj,&kk); *i=ii; *j=jj; *k=kk; + delete []s; return res; } +//----------------------------------------------------------------------------- +long mgl_data_find(HCDT d, const char *cond, char dir, long i, long j, long k) +{ + long nx=d->GetNx(),ny=d->GetNy(),nz=d->GetNz(); + register long m=-1; + if(!cond) cond = "u"; + mglFormula eq(cond); + mreal x=i/(nx-1.),y=j/(ny-1.),z=k/(nz-1.); + if(dir=='x' && nx>1) for(m=i;mv(m,j,k))) break; + if(dir=='y' && ny>1) for(m=j;mv(i,m,k))) break; + if(dir=='z' && nz>1) for(m=k;mv(i,j,m))) break; + return m; +} +int mgl_data_find_(uintptr_t *d, const char *cond, char *dir, int *i, int *j, int *k, int l, int) +{ char *s=new char[l+1]; memcpy(s,cond,l); s[l]=0; + int res = mgl_data_find(_DT_,s,*dir,*i,*j,*k); delete []s; return res; } +//----------------------------------------------------------------------------- +int mgl_data_find_any(HCDT d, const char *cond) +{ + long nx=d->GetNx(),ny=d->GetNy(),nz=d->GetNz(); + register long i,j,k; + register mreal x,y,z; + bool cc = false; + if(!cond || *cond==0) cond = "u"; + mglFormula eq(cond); + for(k=0;kv(i,j,k))) { cc = true; break; } + } + return cc; +} +int mgl_data_find_any_(uintptr_t *d, const char *cond, int l) +{ char *s=new char[l+1]; memcpy(s,cond,l); s[l]=0; + int res = mgl_data_find_any(_DT_,s); delete []s; return res; } +//----------------------------------------------------------------------------- +mreal mgl_data_momentum_val(HCDT dd, char dir, mreal *x, mreal *w, mreal *s, mreal *k) +{ + long nx=dd->GetNx(),ny=dd->GetNy(),nz=dd->GetNz(); + mreal i0=0,i1=0,i2=0,i3=0,i4=0,d,t,v; + register long i; + switch(dir) + { + case 'x': + for(i=0;ivthr(i);i0+= v; + i1+= v*d; i2+= v*t; + i3+= v*d*t; i4+= v*t*t; + } + break; + case 'y': + for(i=0;ivthr(i);i0+= v; + i1+= v*d; i2+= v*t; + i3+= v*d*t; i4+= v*t*t; + } + break; + case 'z': + for(i=0;ivthr(i);i0+= v; + i1+= v*d; i2+= v*t; + i3+= v*d*t; i4+= v*t*t; + } + break; + default: // "self-dispersion" + i0 = nx*ny*nz; + for(i=0;ivthr(i); t = v*v; + i1+= v; i2+= t; + i3+= v*t; i4+= t*t; + } + } + if(i0==0) return 0; d=i1/i0; + if(x) *x=d; + if(w) *w=i2>d*d*i0 ? sqrt(i2/i0-d*d) : 0; + if(s) *s=i3/i0; + if(k) *k=i4/(i0*3); + return i0; +} +float mgl_data_momentum_val_(uintptr_t *d, char *dir, float *m, float *w, float *s, float *k,int) +{ mreal mm,ww,ss,kk,aa; + aa = mgl_data_momentum_val(_DT_,*dir,&mm,&ww,&ss,&kk); + *m=mm; *w=ww; *s=ss; *k=kk; return aa; } +//----------------------------------------------------------------------------- +void mgl_data_norm_slice(HMDT d, float v1,float v2,char dir,long keep_en,long sym) +{ + long nx=d->nx, ny=d->ny, nz=d->nz; + mreal *a=d->a; + mglData b(*d); + register long i,k; + register mreal e0=1, e=1, m1, m2, aa; + if(sym) { v2 = -v1>v2 ? -v1:v2; v1 = -v2; } + if(dir=='z' && nz>1) + { + for(k=0;kaa ? m2 : aa; + e += aa*aa; + } + if(m1==m2) m2+=1; + if(sym) { m2 = -m1>m2 ? -m1:m2; m1 = -m2; } + if(keep_en && k) e = sqrt(e/e0); + else { e0 = e; e=1; } + for(i=0;i1) + { + register long j; + for(j=0;jaa ? m2 : aa; + e += aa*aa; + } + if(m1==m2) m2+=1; + if(sym) { m2 = -m1>m2 ? -m1:m2; m1 = -m2; } + if(keep_en && j) e = sqrt(e/e0); + else { e0 = e; e=1; } + for(k=0;k1) + { + for(i=0;iaa ? m2 : aa; + e += aa*aa; + } + if(m1==m2) m2+=1; + if(sym) { m2 = -m1>m2 ? -m1:m2; m1 = -m2; } + if(keep_en && i) e = sqrt(e/e0); + else { e0 = e; e=1; } + for(k=0;ka, b.a, nx*ny*nz*sizeof(mreal)); +} +void mgl_data_norm_slice_(uintptr_t *d, float *v1,float *v2,char *dir,int *keep_en,int *sym,int ) +{ mgl_data_norm_slice(_DT_,*v1,*v2,*dir,*keep_en,*sym); } +//----------------------------------------------------------------------------- +const char *mgl_data_info(HCDT d) // NOTE: Not thread safe function! +{ + static char buf[512]; + char s[128]; buf[0]=0; + sprintf(s,"nx = %ld\tny = %ld\tnz = %ld\n",d->GetNx(),d->GetNy(),d->GetNz()); strcat(buf,s); + + long i=0,j=0,k=0; + mreal A=0,Wa=0,X=0,Y=0,Z=0,Wx=0,Wy=0,Wz=0, b; + b = mgl_data_max_int(d,&i,&j,&k); + sprintf(s,"Maximum is %g\t at x = %ld\ty = %ld\tz = %ld\n", b,i,j,k); strcat(buf,s); + b = mgl_data_min_int(d,&i,&j,&k); + sprintf(s,"Minimum is %g\t at x = %ld\ty = %ld\tz = %ld\n", b,i,j,k); strcat(buf,s); + + mgl_data_momentum_val(d,'a',&A,&Wa,0,0); mgl_data_momentum_val(d,'x',&X,&Wx,0,0); + mgl_data_momentum_val(d,'y',&Y,&Wy,0,0); mgl_data_momentum_val(d,'z',&Z,&Wz,0,0); + sprintf(s,"Averages are:\n = %g\t = %g\t = %g\t = %g\n", A,X,Y,Z); strcat(buf,s); + sprintf(s,"Widths are:\nWa = %g\tWx = %g\tWy = %g\tWz = %g\n", Wa,Wx,Wy,Wz); strcat(buf,s); + return buf; +} +//----------------------------------------------------------------------------- +void mgl_data_insert(HMDT d, char dir, long at, long num) +{ + if(num<1) return; + at = at<0 ? 0:at; + register long k,nn; + long nx=d->nx, ny=d->ny, nz=d->nz; + mglData b; + if(dir=='x') + { + if(at>nx) at=nx; + nn=nx+num; b.Create(nn,ny,nz); + for(k=0;k0) memcpy(b.a+nn*k, d->a+nx*k,at*sizeof(mreal)); + if(ata+at+nx*k,(nx-at)*sizeof(mreal)); + } + d->Set(b); nx+=num; + } + if(dir=='y') + { + if(at>ny) at=ny; + nn=num+ny; b.Create(nx,nn,nz); + for(k=0;k0) memcpy(b.a+nx*nn*k, d->a+nx*ny*k,at*nx*sizeof(mreal)); + if(ata+nx*(at+ny*k),(ny-at)*nx*sizeof(mreal)); + } + d->Set(b); ny+=num; + } + if(dir=='z') + { + if(at>nz) at=nz; + b.Create(nx,ny,nz+num); + if(at>0) memcpy(b.a, d->a,at*nx*ny*sizeof(mreal)); + if(ata+nx*ny*at,(nz-at)*nx*ny*sizeof(mreal)); + d->Set(b); nz+=num; + } +} +//----------------------------------------------------------------------------- +void mgl_data_delete(HMDT d, char dir, long at, long num) +{ + if(num<1 || at<0) return; + mglData b; + long nx=d->nx, ny=d->ny, nz=d->nz; + register long k,nn; + if(dir=='x') + { + if(at+num>=nx) return; + nn=nx-num; b.Create(nn,ny,nz); + for(k=0;k0) memcpy(b.a+nn*k, d->a+nx*k,at*sizeof(mreal)); + memcpy(b.a+at+nn*k, d->a+at+num+nx*k,(nx-at-num)*sizeof(mreal)); + } + d->Set(b); nx-=num; + } + if(dir=='y') + { + if(at+num>=ny) return; + nn=ny-num; b.Create(nx,nn,nz); + for(k=0;k0) memcpy(b.a+nx*nn*k, d->a+nx*ny*k,at*nx*sizeof(mreal)); + memcpy(b.a+nx*(at+nn*k), d->a+nx*(at+num+ny*k),(ny-at-num)*nx*sizeof(mreal)); + } + d->Set(b); ny-=num; + } + if(dir=='z') + { + if(at+num>=nz) return; + b.Create(nx,ny,nz-num); + if(at>0) memcpy(b.a, d->a,at*nx*ny*sizeof(mreal)); + memcpy(b.a+nx*ny*at, d->a+nx*ny*(at+num),(nz-at-num)*nx*ny*sizeof(mreal)); + d->Set(b); nz-=num; + } +} +//----------------------------------------------------------------------------- +void mgl_data_insert_(uintptr_t *d, const char *dir, int *at, int *num, int) +{ mgl_data_insert(_DT_,*dir,*at,*num); } +void mgl_data_delete_(uintptr_t *d, const char *dir, int *at, int *num, int) +{ mgl_data_delete(_DT_,*dir,*at,*num); } +//----------------------------------------------------------------------------- +mreal mgl_spline5(mreal y1[5], mreal y2[5], long n1, long n2, mreal d, mreal &dy) +{ + mreal a1[4], a2[4], f0,d0,t0,f1,d1,t1, b[6]; + a1[0] = -(3*y1[4]-16*y1[3]+36*y1[2]-48*y1[1]+25*y1[0])/12; + a1[1] = (11*y1[4]-56*y1[3]+114*y1[2]-104*y1[1]+35*y1[0])/12; + a1[2] = -(3*y1[4]-14*y1[3]+24*y1[2]-18*y1[1]+5*y1[0])/4; + a1[3] = (y1[4]-4*y1[3]+6*y1[2]-4*y1[1]+y1[0])/6; + a2[0] = -(3*y2[4]-16*y2[3]+36*y2[2]-48*y2[1]+25*y2[0])/12; + a2[1] = (11*y2[4]-56*y2[3]+114*y2[2]-104*y2[1]+35*y2[0])/12; + a2[2] = -(3*y2[4]-14*y2[3]+24*y2[2]-18*y2[1]+5*y2[0])/4; + a2[3] = (y2[4]-4*y2[3]+6*y2[2]-4*y2[1]+y2[0])/6; + n2++; + f0 = y1[n1]; d0 = a1[0]+n1*(a1[1]+n1*(a1[2]+n1*a1[3])); t0 = a1[1]/2+a1[2]*n1+1.5*n2*n2*a2[3]; + f1 = y2[n2]; d1 = a2[0]+n2*(a2[1]+n2*(a2[2]+n2*a2[3])); t1 = a2[1]/2+a2[2]*n2+1.5*n2*n2*a2[3]; + b[0] = f0; b[1] = d0; b[2] = t0; + b[3] = 10*(f1-f0)+t1-3*t0-4*d1-6*d0; + b[4] = 15*(f0-f1)-2*t1+3*t0+7*d1+8*d0; + b[5] = 6*(f1-f0)+t1-t0-3*d1-3*d0; + dy = b[1] + d*(2*b[2]+d*(3*b[3]+d*(4*b[4]+d*5*b[5]))); + return b[0] + d*(b[1]+d*(b[2]+d*(b[3]+d*(b[4]+d*b[5])))); +} +//----------------------------------------------------------------------------- +mreal mgl_spline3(mreal y1[3], mreal y2[3], long n1, long n2, mreal d, mreal &dy) +{ + mreal a1[2], a2[2], f0,d0,d1,f1, b[4]; + a1[0] = -(y1[2]-4*y1[1]+3*y1[0])/2; + a1[1] = y1[2]-2*y1[1]+y1[0]; + a2[0] = -(y2[2]-4*y2[1]+3*y2[0])/2; + a2[1] = y2[2]-2*y2[1]+y2[0]; + n2++; + f0 = y1[n1]; d0 = a1[0]+a1[1]*n1; + f1 = y2[n2]; d1 = a2[0]+a2[1]*n2; + b[0] = f0; b[1] = d0; + b[2] = 3*(f1-f0)-d1-2*d0; + b[3] = 2*(f0-f1)+d1+d0; + dy = b[1] + d*(2*b[2]+d*3*b[3]); + return b[0] + d*(b[1]+d*(b[2]+d*b[3])); +} +//----------------------------------------------------------------------------- +/*mreal mglData::Spline5(mreal x,mreal y,mreal z,mreal &dx,mreal &dy,mreal &dz) const +{ + mreal res=0; + if(nx<5) return 0; // not interpolation for points < 5 !!! + dx = dy = dz = 0; x*=nx-1; y*=ny-1; z*=nz-1; + if(ny==1 && nz==1) // 1D case + { + long n = long(x), n1 = n>1 ? 2:n, n2 = n0?int((x)/(y)+0.5):int((x)/(y)-0.5)) +void mgl_omod(mreal *a, mreal da, int nx, int n) +{ + register long i,ii; + bool qq=true; + register mreal q; + for(i=1;ip[2], nn=t->n; + for(i=t->id;ia+i, t->b[0], nz, nn); + return 0; +} +void *mgl_sew_y(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i, nx=t->p[0], ny=t->p[1], nn=t->n; + for(i=t->id;ia+(i%nx)+nx*ny*(i/nx), t->b[0], ny, nx); + return 0; +} +void *mgl_sew_x(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i, nx=t->p[0], nn=t->n; + for(i=t->id;ia+i*nx, t->b[0], nx, 1); + return 0; +} +void mgl_data_sew(HMDT d, const char *dirs, float da) +{ + long nx=d->nx, ny=d->ny, nz=d->nz; + long p[3]={nx,ny,nz}; + if(strchr(dirs,'x') && nx>1) mglStartThread(mgl_sew_x,0,nz*ny,d->a,&da,0,p); + if(strchr(dirs,'y') && ny>1) mglStartThread(mgl_sew_y,0,nz*nx,d->a,&da,0,p); + if(strchr(dirs,'z') && nz>1) mglStartThread(mgl_sew_z,0,nx*ny,d->a,&da,0,p); +} +void mgl_data_sew_(uintptr_t *d, const char *dirs, float *da, int l) +{ char *s=new char[l+1]; memcpy(s,dirs,l); s[l]=0; + mgl_data_sew(_DT_,s,*da); delete []s; } +//----------------------------------------------------------------------------- +void mgl_data_put_val(HMDT d, mreal val, long xx, long yy, long zz) +{ + register long nx=d->nx, ny=d->ny, nz=d->nz; + if(xx>=nx || yy>=ny || zz>=nz) return; + mreal *a=d->a; + register long i,j; + if(xx<0 && yy<0 && zz<0)for(i=0;inx, ny=d->ny, nz=d->nz; + if(xx>=nx || yy>=ny || zz>=nz) return; + mreal *a=d->a, vv=v->v(0); + long vx=v->GetNx(), vy=v->GetNy(), vz=v->GetNz(); + register long i,j,k; + if(xx<0 && yy<0 && zz<0) // whole array + { + if(vx>=nx && vy>=ny && vz>=nz) + for(k=0;kv(i,j,k); + else if(vx>=nx && vy>=ny) + for(k=0;kv(i,j); + else if(vx>=nx) for(k=0;kv(i); + else for(i=0;i=nx && vy>=ny) for(j=0;jv(i,j); + else if(vx>=nx) for(j=0;jv(i); + else for(i=0;i=ny && vy>=nz) for(j=0;jv(i,j); + else if(vx>=ny) for(j=0;jv(i); + else for(i=0;i=nx && vy>=nz) for(j=0;jv(i,j); + else if(vx>=nx) for(j=0;jv(i); + else for(j=0;j=nx) for(i=0;iv(i); + else for(i=0;i=ny) for(i=0;iv(i); + else for(i=0;i=nz) for(i=0;iv(i); + else for(i=0;ip[0], ny=t->p[1], nz=t->p[2], nn=t->n; + mreal *b=t->a,au,av,aw,xu,xv,xw,yu,yv,yw,zu,zv,zw; + const mreal *a=t->b, *x=t->c, *y=t->d, *z=t->e; + for(i0=t->id;i0p[0], ny=t->p[1], nn=t->n, same=t->p[2]; + mreal *b=t->a,au,av,xu,xv,yu,yv; + const mreal *a=t->b, *x=t->c, *y=t->d; + for(i0=t->id;i0p[0], nn=t->n, same=t->p[1]; + mreal *b=t->a,au,xu; + const mreal *a=t->b, *x=t->c; + for(i0=t->id;i0(v1); + const mglData *y = dynamic_cast(v2); + const mglData *z = dynamic_cast(v3); + long nx=d->nx,ny=d->ny,nz=d->nz, nn=nx*ny*nz; + if(nx<2 || ny<2) return; + mreal *b = new mreal[nn]; memset(b,0,nn*sizeof(mreal)); + long p[3]={nx,ny,nz}; + + if(x&&y&&z && x->nx*x->ny*x->nz==nn && y->nx*y->ny*y->nz==nn && z->nx*z->ny*z->nz==nn) + mglStartThread(mgl_diff_3,0,nn,b,d->a,x->a,p,0,y->a,z->a); + else if(x&&y && x->nx*x->ny==nx*ny && y->nx*y->ny==nx*ny) + { + p[2]=(x->nz==nz && y->nz==nz); + mglStartThread(mgl_diff_2,0,nn,b,d->a,x->a,p,0,y->a); + } + else if(x && x->nx==nx) + { + p[1]=(x->ny*x->nz==ny*nz); + mglStartThread(mgl_diff_1,0,nn,b,d->a,x->a,p,0,0); + } + memcpy(d->a,b,nn*sizeof(mreal)); delete []b; +} +void mgl_data_diff_par_(uintptr_t *d, uintptr_t *v1, uintptr_t *v2, uintptr_t *v3) +{ mgl_data_diff_par(_DT_,_DA_(v1),_DA_(v2),_DA_(v3)); } +//----------------------------------------------------------------------------- +void mgl_data_set_value(HMDT dat, float v, long i, long j, long k) +{ dat->a[i+dat->nx*(j+dat->ny*k)]=v; } +void mgl_data_set_value_(uintptr_t *d, float *v, int *i, int *j, int *k) +{ mgl_data_set_value(_DT_,*v,*i,*j,*k); } +//----------------------------------------------------------------------------- +float mgl_data_get_value(HCDT dat, long i, long j, long k) +{ return dat->v(i,j,k); } +float mgl_data_get_value_(uintptr_t *d, int *i, int *j, int *k) +{ return mgl_data_get_value(_DA_(d),*i,*j,*k); } +//----------------------------------------------------------------------------- diff --git a/src/data_io.cpp b/src/data_io.cpp new file mode 100644 index 0000000..db76d6d --- /dev/null +++ b/src/data_io.cpp @@ -0,0 +1,1070 @@ +/*************************************************************************** + * data_io.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License 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 +#include +#include +#include +#ifdef HAVE_HDF5 +#include +#endif +#ifdef HAVE_HDF4 +#define intf hdf4_intf +#include +#undef intf +#endif + +#ifndef WIN32 +#include +#endif + +#include "mgl/data.h" +#include "mgl/eval.h" + +//#define isn(ch) ((ch)<' ' && (ch)!='\t') +#define isn(ch) ((ch)=='\n') +//----------------------------------------------------------------------------- +HMDT mgl_create_data() { return new mglData; } +HMDT mgl_create_data_size(long nx, long ny, long nz){ return new mglData(nx,ny,nz); } +HMDT mgl_create_data_file(const char *fname) { return new mglData(fname); } +void mgl_delete_data(HMDT d) { if(d) delete d; } +//----------------------------------------------------------------------------- +uintptr_t mgl_create_data_() +{ return uintptr_t(new mglData()); }; +uintptr_t mgl_create_data_size_(int *nx, int *ny, int *nz) +{ return uintptr_t(new mglData(*nx,*ny,*nz)); }; +uintptr_t mgl_create_data_file_(const char *fname,int l) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; + uintptr_t r = uintptr_t(new mglData(s)); delete []s; return r; } +void mgl_delete_data_(uintptr_t *d) +{ if(_DT_) delete _DT_; }; +//----------------------------------------------------------------------------- +void mglFromStr(HMDT d,char *buf,long NX,long NY,long NZ) +{ + if(NX<1 || NY <1 || NZ<1) return; + mgl_data_create(d, NX,NY,NZ); + long nb = strlen(buf); + register long i=0, j=0, k=0; + while(j0 || buf[j+1]!='#') // this is columns id + while(!isn(buf[j]) && j='a' && buf[j]<='z') + d->id[k++] = buf[j]; + j++; + } + } + while(buf[j]<=' ' && j' ' && buf[j]!=',' && ja[i] = atof(s); + i++; if(i>=NX*NY*NZ) break; + } +} +//----------------------------------------------------------------------------- +void mgl_data_set(HMDT d, HCDT a) +{ + if(!a) return; + const mglData *dd = dynamic_cast(a); // faster for mglData + mgl_data_create(d, a->GetNx(), a->GetNy(), a->GetNz()); + if(dd) // this one should be much faster + memcpy(d->a, dd->a, d->nx*d->ny*d->nz*sizeof(mreal)); + else // very inefficient!!! + { + register long i,j,k; + for(k=0;knz;k++) for(j=0;jny;j++) for(i=0;inx;i++) + d->a[i+d->nx*(j+d->ny*k)] = a->v(i,j,k); + } +} +void mgl_data_set_(uintptr_t *d, uintptr_t *a) { mgl_data_set(_DT_,_DA_(a)); } +//----------------------------------------------------------------------------- +void mgl_data_set_values(HMDT d, const char *v,long NX,long NY,long NZ) +{ + if(NX<1 || NY <1 || NZ<1) return; + register long n=strlen(v)+1; + char *buf = new char[n]; + memcpy(buf,v,n); + mglFromStr(d,buf,NX,NY,NZ); + delete []buf; +} +void mgl_data_set_values_(uintptr_t *d, const char *val, int *nx, int *ny, int *nz, int l) +{ char *s=new char[l+1]; memcpy(s,val,l); s[l]=0; + mgl_data_set_values(_DT_,s,*nx,*ny,*nz); delete []s; } +//----------------------------------------------------------------------------- +void mgl_data_set_vector(HMDT d, gsl_vector *v) +{ +#ifndef NO_GSL + if(!v || v->size<1) return; + mgl_data_create(d, v->size,1,1); + for(long i=0;inx;i++) d->a[i] = v->data[i*v->stride]; +#endif +} +//----------------------------------------------------------------------------- +void mgl_data_set_matrix(HMDT d, gsl_matrix *m) +{ +#ifndef NO_GSL + if(!m || m->size1<1 || m->size2<1) return; + mgl_data_create(d, m->size1,m->size2,1); + register long i,j; + for(j=0;jny;j++) for(i=0;inx;i++) + d->a[i+j*d->nx] = m->data[i * m->tda + j]; +#endif +} +//----------------------------------------------------------------------------- +void mgl_data_set_float(HMDT d, const float *A,long NX,long NY,long NZ) +{ + if(NX<=0 || NY<=0 || NZ<=0) return; + mgl_data_create(d, NX,NY,NZ); if(!A) return; +#if(MGL_USE_DOUBLE==1) + for(long i=0;ia[i] = A[i]; +#else + memcpy(d->a,A,NX*NY*NZ*sizeof(float)); +#endif +} +//----------------------------------------------------------------------------- +void mgl_data_set_double(HMDT d, const double *A,long NX,long NY,long NZ) +{ + if(NX<=0 || NY<=0 || NZ<=0) return; + mgl_data_create(d, NX,NY,NZ); if(!A) return; +#if(MGL_USE_DOUBLE==1) + memcpy(d->a,A,NX*NY*NZ*sizeof(double)); +#else + for(long i=0;ia[i] = A[i]; +#endif +} +//----------------------------------------------------------------------------- +void mgl_data_set_float2(HMDT d, const float **A,long N1,long N2) +{ + if(N1<=0 || N2<=0) return; + mgl_data_create(d, N2,N1,1); if(!A) return; +#if(MGL_USE_DOUBLE==1) + for(long i=0;ia[j+i*N2] = A[i][j]; +#else + for(long i=0;ia+i*N2,A[i],N2*sizeof(float)); +#endif +} +//----------------------------------------------------------------------------- +void mgl_data_set_double2(HMDT d, const double **A,long N1,long N2) +{ + if(N1<=0 || N2<=0) return; + mgl_data_create(d, N2,N1,1); if(!A) return; +#if(MGL_USE_DOUBLE==1) + for(long i=0;ia+i*N2,A[i],N2*sizeof(double)); +#else + for(long i=0;ia[j+i*N2] = A[i][j]; +#endif +} +//----------------------------------------------------------------------------- +void mgl_data_set_float3(HMDT d, const float ***A,long N1,long N2,long N3) +{ + if(N1<=0 || N2<=0 || N3<=0) return; + mgl_data_create(d, N3,N2,N1); if(!A) return; +#if(MGL_USE_DOUBLE==1) + for(long i=0;ia[k+N3*(j+i*N2)] = A[i][j][k]; +#else + for(long i=0;ia+N3*(j+i*N2),A[i][j],N3*sizeof(float)); +#endif +} +//----------------------------------------------------------------------------- +void mgl_data_set_double3(HMDT d, const double ***A,long N1,long N2,long N3) +{ + if(N1<=0 || N2<=0 || N3<=0) return; + mgl_data_create(d, N3,N2,N1); if(!A) return; +#if(MGL_USE_DOUBLE==1) + for(long i=0;ia+N3*(j+i*N2),A[i][j],N3*sizeof(double)); +#else + for(long i=0;ia[k+N3*(j+i*N2)] = A[i][j][k]; +#endif +} +//----------------------------------------------------------------------------- +void mgl_data_set_float1_(uintptr_t *d, const float *A,int *NX) +{ mgl_data_set_float(_DT_,A,*NX,1,1); } +void mgl_data_set_double1_(uintptr_t *d, const double *A,int *NX) +{ mgl_data_set_double(_DT_,A,*NX,1,1); } +void mgl_data_set_float_(uintptr_t *d, const float *A,int *NX,int *NY,int *NZ) +{ mgl_data_set_float(_DT_,A,*NX,*NY,*NZ); } +void mgl_data_set_double_(uintptr_t *d, const double *A,int *NX,int *NY,int *NZ) +{ mgl_data_set_double(_DT_,A,*NX,*NY,*NZ); } +void mgl_data_set_float2_(uintptr_t *d, const float *A,int *N1,int *N2) +{ mgl_data_set_float(_DT_,A,*N1,*N2,1); } +void mgl_data_set_double2_(uintptr_t *d, const double *A,int *N1,int *N2) +{ mgl_data_set_double(_DT_,A,*N1,*N2,1); } +void mgl_data_set_float3_(uintptr_t *d, const float *A,int *N1,int *N2,int *N3) +{ mgl_data_set_float(_DT_,A,*N1,*N2,*N3); } +void mgl_data_set_double3_(uintptr_t *d, const double *A,int *N1,int *N2,int *N3) +{ mgl_data_set_double(_DT_,A,*N1,*N2,*N3); } +//----------------------------------------------------------------------------- +void mgl_data_rearrange(HMDT d, long mx,long my,long mz) +{ + if(mx<1) return; // wrong mx + if(my<1) { my = d->nx*d->ny*d->nz/mx; mz = 1; } + else if(mz<1) mz = (d->nx*d->ny*d->nz)/(mx*my); + long m = mx*my*mz; + if(m==0 || m>d->nx*d->ny*d->nz) return; // too high desired dimensions + d->nx = mx; d->ny = my; d->nz = mz; d->NewId(); +} +void mgl_data_rearrange_(uintptr_t *d, int *mx, int *my, int *mz) +{ mgl_data_rearrange(_DT_,*mx,*my,*mz); } +//----------------------------------------------------------------------------- +void mgl_data_set_id(HMDT d, const char *ids) +{ + d->NewId(); // clearing + be sure about correct length + if(ids) for(long i=0;inx && ids[i]!=0;i++) d->id[i]=ids[i]; +} +void mgl_data_set_id_(uintptr_t *d, const char *eq,int l) +{ char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + mgl_data_set_id(_DT_, s); delete []s; } +//----------------------------------------------------------------------------- +void mgl_data_save(HCDT d, const char *fname,long ns) +{ + FILE *fp; + fp = fopen(fname,"w"); + register long i,j,k; + long nx=d->GetNx(), ny=d->GetNy(), nz=d->GetNz(); + if(ns<0 || (ns>=nz && nz>1)) for(k=0;kv(j,i,k)); + fprintf(fp,"\n"); + } + fprintf(fp,"\n"); + } + else + { // ñîõðàíÿåì òîëüêî ñðåç + if(nz>1) for(i=0;iv(j,i,ns)); + fprintf(fp,"\n"); + } + else if(nsv(j,ns)); + } + fclose(fp); +} +void mgl_data_save_(uintptr_t *d, const char *fname,int *ns,int l) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; + mgl_data_save(_DT_,s,*ns); delete []s; } +//----------------------------------------------------------------------------- +char *mgl_read_gz(gzFile fp) +{ + long size=1024,n=0,m; + char *buf=(char*)malloc(size); + while((m=gzread(fp,buf+size*n,size))>0) + { + if(ma) mgl_data_create(d, 1,1,1); + return false; + } + char *buf = mgl_read_gz(fp); + nb = strlen(buf); gzclose(fp); + + bool first=false,com=false; + register char ch; + for(i=nb-1;i>=0;i--) if(buf[i]>' ') break; + buf[i+1]=0; nb = i; // remove tailing spaces + for(i=0;i' ' && !first) first=true; + if(first && (ch==' ' || ch=='\t' || ch==',') && buf[i+1]>' ') k++; + } + first = false; + for(i=0;inx = mx>0 ? mx:1; d->ny = my>0 ? my:1; d->nz = mz>0 ? mz:1; + if(d->a && d->id) delete []d->id; + if(d->a && !d->link) delete []d->a; + d->a = new mreal[mx*my*mz]; + d->id = new char[mx]; d->link=false; + memset(d->a,0,mx*my*mz*sizeof(mreal)); + memset(d->id,0,mx*sizeof(char)); +} +void mgl_data_create_(uintptr_t *d, int *nx,int *ny,int *nz) +{ mgl_data_create(_DT_,*nx,*ny,*nz); } +//----------------------------------------------------------------------------- +void mgl_data_link(HMDT d, float *A, long mx,long my,long mz) +{ + if(!A) return; + if(d->id && d->a) delete []d->id; + if(!d->link && d->a) delete []d->a; + d->nx = mx>0 ? mx:1; d->ny = my>0 ? my:1; d->nz = mz>0 ? mz:1; + d->link=true; d->NewId(); +} +void mgl_data_link_(uintptr_t *d, float *A, int *nx,int *ny,int *nz) +{ mgl_data_link(_DT_,A,*nx,*ny,*nz); } +//----------------------------------------------------------------------------- +int mgl_data_read_dim(HMDT d, const char *fname,long mx,long my,long mz) +{ + if(mx<=0 || my<=0 || mz<=0) return false; + gzFile fp = gzopen(fname,"r"); + if(!fp) return false; + char *buf = mgl_read_gz(fp); + gzclose(fp); + mglFromStr(d,buf,mx,my,mz); + free(buf); return true; +} +int mgl_data_read_dim_(uintptr_t *d, const char *fname,int *mx,int *my,int *mz,int l) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; + int r = mgl_data_read_dim(_DT_,s,*mx,*my,*mz); delete []s; return r; } +//----------------------------------------------------------------------------- +int mgl_data_read_mat(HMDT d, const char *fname, long dim) +{ + if(dim<=0 || dim>3) return false; + gzFile fp = gzopen(fname,"r"); + if(!fp) return false; + long nx=1, ny=1, nz=1; + char *buf = mgl_read_gz(fp); + long nb = strlen(buf); gzclose(fp); + + register long j=0; + while(j' ') j++; + } + else if(dim==2) + { + sscanf(buf+j,"%ld%ld",&nx,&ny); + while(buf[j]>' ' && j' ' && j' ' && j' ' && j' ' && jGetNN(); + const mglData *b = dynamic_cast(d); + if(b) for(long i=0;ia[i]; if(!isnan(v)) m = m>v ? m:v; } + else for(long i=0;ivthr(i); if(!isnan(v)) m = m>v ? m:v; } + return m; +} +mreal mgl_data_max_(uintptr_t *d) { return mgl_data_max(_DT_); } +//----------------------------------------------------------------------------- +mreal mgl_data_min(HCDT d) +{ + register mreal m=1e10, v; + register long nn=d->GetNN(); + const mglData *b = dynamic_cast(d); + if(b) for(long i=0;ia[i]; if(!isnan(v)) m = mvthr(i); if(!isnan(v)) m = mGetNx(), ny=d->GetNy(), nn=d->GetNN(); + for(long ii=0;iivthr(ii); + if(!isnan(v) && m < v) + { m=v; *i=ii%nx; *j=(ii/nx)%ny; *k=ii/(nx*ny); } + } + return m; +} +mreal mgl_data_max_int_(uintptr_t *d, int *i, int *j, int *k) +{ long ii,jj,kk; float res=mgl_data_max_int(_DT_,&ii,&jj,&kk); + *i=ii; *j=jj; *k=kk; return res; } +//----------------------------------------------------------------------------- +mreal mgl_data_min_int(HCDT d, long *i, long *j, long *k) +{ + register mreal m=1e10, v; + long nx=d->GetNx(), ny=d->GetNy(), nn=d->GetNN(); + for(long ii=0;iivthr(ii); + if(!isnan(v) && m > v) + { m=v; *i=ii%nx; *j=(ii/nx)%ny; *k=ii/(nx*ny); } + } + return m; +} +mreal mgl_data_min_int_(uintptr_t *d, int *i, int *j, int *k) +{ long ii,jj,kk; float res=mgl_data_min_int(_DT_,&ii,&jj,&kk); + *i=ii; *j=jj; *k=kk; return res; } +//----------------------------------------------------------------------------- +mreal mgl_data_max_real(HCDT d, mreal *x, mreal *y, mreal *z) +{ + long im=-1,jm=-1,km=-1; + long nx=d->GetNx(), ny=d->GetNy(), nz=d->GetNz(); + mreal m=mgl_data_max_int(d,&im,&jm,&km), v, v1, v2; + *x=im; *y=jm; *z=km; + + v = d->v(im,jm,km); + if(nx>2) + { + if(im==0) im=1; + if(im==nx-1)im=nx-2; + v1 = d->v(im+1,jm,km); v2 = d->v(im-1,jm,km); + *x = (v1+v2-2*v)==0 ? im : im+(v1-v2)/(v1+v2-2*v)/2; + } + if(ny>2) + { + if(jm==0) jm=1; + if(jm==ny-1)jm=ny-2; + v1 = d->v(im,jm+1,km); v2 = d->v(im,jm-1,km); + *y = (v1+v2-2*v)==0 ? jm : jm+(v1-v2)/(v1+v2-2*v)/2; + } + if(nz>2) + { + if(km==0) km=1; + if(km==nz-1)km=nz-2; + v1 = d->v(im,jm,km+1); v2 = d->v(im,jm,km-1); + *z = (v1+v2-2*v)==0 ? km : km+(v1-v2)/(v1+v2-2*v)/2; + } + return m; +} +mreal mgl_data_max_real_(uintptr_t *d, mreal *x, mreal *y, mreal *z) +{ return mgl_data_max_real(_DT_,x,y,z); } +//----------------------------------------------------------------------------- +mreal mgl_data_min_real(HCDT d, mreal *x, mreal *y, mreal *z) +{ + long im=-1,jm=-1,km=-1; + long nx=d->GetNx(), ny=d->GetNy(), nz=d->GetNz(); + mreal m=mgl_data_min_int(d,&im,&jm,&km), v, v1, v2; + *x=im; *y=jm; *z=km; + + v = d->v(im,jm,km); + if(nx>2) + { + if(im==0) im=1; + if(im==nx-1)im=nx-2; + v1 = d->v(im+1,jm,km); v2 = d->v(im-1,jm,km); + *x = (v1+v2-2*v)==0 ? im : im+(v1-v2)/(v1+v2-2*v)/2; + } + if(ny>2) + { + if(jm==0) jm=1; + if(jm==ny-1)jm=ny-2; + v1 = d->v(im,jm+1,km); v2 = d->v(im,jm-1,km); + *y = (v1+v2-2*v)==0 ? jm : jm+(v1-v2)/(v1+v2-2*v)/2; + } + if(nz>2) + { + if(km==0) km=1; + if(km==nz-1)km=nz-2; + v1 = d->v(im,jm,km+1); v2 = d->v(im,jm,km-1); + *z = (v1+v2-2*v)==0 ? km : km+(v1-v2)/(v1+v2-2*v)/2; + } + return m; +} +mreal mgl_data_min_real_(uintptr_t *d, mreal *x, mreal *y, mreal *z) +{ return mgl_data_min_real(_DT_,x,y,z); } +//----------------------------------------------------------------------------- +void *mgl_fill_x(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i0, nx=t->p[0],ny=t->p[1]; + mreal *b=t->a, x1=t->b[0], dx=t->b[1]; + register char dir = t->s[0]; + for(i0=t->id;i0n;i0+=mglNumThr) + { + if(dir=='x') b[i0] = x1+dx*(i0%nx); + else if(dir=='y') b[i0] = x1+dx*((i0/nx)%ny); + else if(dir=='z') b[i0] = x1+dx*(i0/(nx*ny)); + } + return 0; +} +void mgl_data_fill(HMDT d, float x1,float x2,char dir) +{ + if(isnan(x2)) x2=x1; + if(dir<'x' || dir>'z') dir='x'; + long par[2]={d->nx,d->ny}; + mreal b[2]={x1,x2-x1}; + if(dir=='x') b[1] *= d->nx>1 ? 1./(d->nx-1):0; + if(dir=='y') b[1] *= d->ny>1 ? 1./(d->ny-1):0; + if(dir=='z') b[1] *= d->nz>1 ? 1./(d->nz-1):0; + mglStartThread(mgl_fill_x,0,d->nx*d->ny*d->nz,d->a,b,0,par,0,0,0,&dir); +} +void mgl_data_fill_(uintptr_t *d, float *x1,float *x2,const char *dir,int) +{ mgl_data_fill(_DT_,*x1,*x2,*dir); } +//----------------------------------------------------------------------------- +void mgl_data_norm(HMDT d, float v1,float v2,long sym,long dim) +{ + long i,s,nn=d->nx*d->ny*d->nz; + mreal a1=1e20,a2=-1e20,v,*a=d->a; + if(d->nz>1) s = dim*d->nx*d->ny; + else s = dim*d->ny; + for(i=s;ia[i] ? a2 : a[i]); + } + if(a1==a2) { if(a1!=0) a1=0.; else a2=1; } + if(v1>v2) { v=v1; v1=v2; v2=v; } // swap if uncorrect + if(sym) // use symmetric + { + v2 = -v1>v2 ? -v1:v2; v1 = -v2; + a2 = -a1>a2 ? -a1:a2; a1 = -a2; + } + for(i=s;inx, ny=d->ny, nz=d->nz; + mreal *b; + + // simple checking + if(rx>=nx) rx=nx-1; if(rx<1) rx=1; + if(ry>=ny) ry=ny-1; if(ry<1) ry=1; + if(rz>=nz) rz=nz-1; if(rz<1) rz=1; + // new sizes + kx = 1+(nx-1)/rx; ky = 1+(ny-1)/ry; kz = 1+(nz-1)/rz; + b = new mreal[kx*ky*kz]; + if(!smooth) for(k=0;ka[i*rx+nx*(j*ry+ny*rz*k)]; + else for(k=0;ka[i1+nx*(j1+ny*k1)]; + b[i+kx*(j+ky*k)] = s/dx*dy*dz; + } + if(!d->link) delete []d->a; + d->a=b; d->nx = kx; d->ny = ky; d->nz = kz; d->NewId(); d->link=false; +} +void mgl_data_squeeze_(uintptr_t *d, int *rx,int *ry,int *rz,int *smooth) +{ mgl_data_squeeze(_DT_,*rx,*ry,*rz,*smooth); } +//----------------------------------------------------------------------------- +void mgl_data_extend(HMDT d, long n1, long n2) +{ + long nx=d->nx, ny=d->ny, nz=d->nz; + if(nz>2 || n1==0) return; + long mx,my,mz; + mreal *b=0; + register long i,j; + if(n1>0) // extend to higher dimension(s) + { + n2 = n2>0 ? n2:1; + mx = nx; my = ny>1?ny:n1; mz = ny>1 ? n1 : n2; + b = new mreal[mx*my*mz]; + if(ny>1) for(i=0;ia, nx*ny*sizeof(mreal)); + else for(i=0;ia, nx*sizeof(mreal)); + } + else + { + mx = -n1; my = n2<0 ? -n2 : nx; mz = n2<0 ? nx : ny; + if(n2>0 && ny==1) mz = n2; + b = new mreal[mx*my*mz]; + if(n2<0) for(j=0;ja[j]; + else for(j=0;ja[j]; + if(n2>0 && ny==1) for(i=0;ia, mx*my*sizeof(mreal)); + } + if(b) + { if(!d->link) delete []d->a; + d->a=b; d->nx=mx; d->ny=my; d->nz=mz; d->NewId(); d->link=false; } +} +void mgl_data_extend_(uintptr_t *d, int *n1, int *n2) +{ mgl_data_extend(_DT_,*n1,*n2); } +//----------------------------------------------------------------------------- +void mgl_data_transpose(HMDT d, const char *dim) +{ + long nx=d->nx, ny=d->ny, nz=d->nz; + mreal *b=new mreal[nx*ny*nz], *a=d->a; + register long i,j,k,n; + if(!strcmp(dim,"xyz")) memcpy(b,a,nx*ny*nz*sizeof(mreal)); + else if(!strcmp(dim,"xzy") || !strcmp(dim,"zy")) + { + for(j=0;jnx; d->nx=nx; d->ny=ny; d->nz=nz; + if(nx!=n) d->NewId(); +} +void mgl_data_transpose_(uintptr_t *d, const char *dim,int l) +{ char *s=new char[l+1]; memcpy(s,dim,l); s[l]=0; + mgl_data_transpose(_DT_,s); delete []s; } +//----------------------------------------------------------------------------- +void *mgl_modify(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + mglFormula *f = (mglFormula *)(t->v); + register long i,j,k,i0, nx=t->p[0],ny=t->p[1],nz=t->p[2]; + mreal *b=t->a, dx,dy,dz; + const mreal *v=t->b, *w=t->c; + dx=nx>1?1/(nx-1.):0; dy=ny>1?1/(ny-1.):0; dz=nz>1?1/(nz-1.):0; + for(i0=t->id;i0n;i0+=mglNumThr) + { + i=i0%nx; j=((i0/nx)%ny); k=i0/(nx*ny); + b[i0] = f->Calc(i*dx, j*dy, k*dz, b[i0], v?v[i0]:0, w?w[i0]:0); + } + return 0; +} +void mgl_data_modify(HMDT d, const char *eq,long dim) +{ + long nx=d->nx, ny=d->ny, nz=d->nz, par[3]={nx,ny,nz}; + mglFormula f(eq); + if(dim<0) dim=0; + if(nz>1) // 3D array + { + par[2] -= dim; if(par[2]<0) par[2]=0; + mglStartThread(mgl_modify,0,nx*ny*par[2],d->a+nx*ny*dim,0,0,par,&f); + } + else // 2D or 1D array + { + par[1] -= dim; if(par[1]<0) par[1]=0; + mglStartThread(mgl_modify,0,nx*par[1],d->a+nx*dim,0,0,par,&f); + } +} +void mgl_data_modify_(uintptr_t *d, const char *eq,int *dim,int l) +{ char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + mgl_data_modify(_DT_,s,*dim); delete []s; } +//----------------------------------------------------------------------------- +void mgl_data_modify_vw(HMDT d, const char *eq,HCDT vdat,HCDT wdat) +{ // NOTE: only for mglData + const mglData *v = dynamic_cast(vdat); + const mglData *w = dynamic_cast(wdat); + long nn = d->nx*d->ny*d->nz, par[3]={d->nx,d->ny,d->nz}; + mglFormula f(eq); + if(v && w && v->nx*v->ny*v->nz==nn && w->nx*w->ny*w->nz==nn) + mglStartThread(mgl_modify,0,nn,d->a,v->a,w->a,par,&f); + else if(v && v->nx*v->ny*v->nz==nn) + mglStartThread(mgl_modify,0,nn,d->a,v->a,0,par,&f); + else + mglStartThread(mgl_modify,0,nn,d->a,0,0,par,&f); +} +void mgl_data_modify_vw_(uintptr_t *d, const char *eq, uintptr_t *v, uintptr_t *w,int l) +{ char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + mgl_data_modify_vw(_DT_,s,_DA_(v),_DA_(w)); delete []s; } +//----------------------------------------------------------------------------- +void *mgl_fill_f(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + mglFormula *f = (mglFormula *)(t->v); + register long i,j,k,i0, nx=t->p[0],ny=t->p[1]; + mreal *b=t->a; + const mreal *v=t->b, *w=t->c, *x=t->d; + for(i0=t->id;i0n;i0+=mglNumThr) + { + i=i0%nx; j=((i0/nx)%ny); k=i0/(nx*ny); + b[i0] = f->Calc(x[0]+i*x[1], x[2]+j*x[3], x[4]+k*x[5], b[i0], v?v[i0]:0, w?w[i0]:0); + } + return 0; +} +void mgl_data_fill_eq(HMGL gr, HMDT d, const char *eq, HCDT vdat, HCDT wdat, const char *opt) +{ // NOTE: only for mglData + const mglData *v = dynamic_cast(vdat); + const mglData *w = dynamic_cast(wdat); + long nn = d->nx*d->ny*d->nz, par[3]={d->nx,d->ny,d->nz}; + if(v && v->nx*v->ny*v->nz!=nn) return; + if(w && w->nx*w->ny*w->nz!=nn) return; + gr->SaveState(opt); + mreal xx[6]={gr->Min.x,0, gr->Min.y,0, gr->Min.z,0}; + if(d->nx>1) xx[1] = (gr->Max.x-gr->Min.x)/(d->nx-1.); + if(d->ny>1) xx[3] = (gr->Max.y-gr->Min.y)/(d->ny-1.); + if(d->nz>1) xx[5] = (gr->Max.z-gr->Min.z)/(d->nz-1.); + mglFormula f(eq); + mglStartThread(mgl_fill_f,0,nn,d->a,v?v->a:0,w?w->a:0,par,&f,xx); + gr->LoadState(); +} +void mgl_data_fill_eq_(uintptr_t *gr, uintptr_t *d, const char *eq, uintptr_t *v, uintptr_t *w, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_data_fill_eq(_GR_,_DT_,s,_DA_(v),_DA_(w),o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +#ifdef HAVE_HDF4 +void mgl_data_read_hdf4(HMDT d,const char *fname,const char *data) +{ + int32 sd = SDstart(fname,DFACC_READ), nn, i; + if(sd==-1) return; // is not a HDF4 file + char name[64]; + SDfileinfo(sd,&nn,&i); + for(i=0;i3) continue; + long mm=dims[0]*dims[1]*dims[2]; + if(type==DFNT_FLOAT32) + { + float *b = new float[mm]; + SDreaddata(sds,in,0,dims,b); + mgl_data_set_float(d,b,dims[2],dims[1],dims[0]); + delete []b; + } + if(type==DFNT_FLOAT64) + { + double *b = new double[mm]; + SDreaddata(sds,in,0,dims,b); + mgl_data_set_double(d,b,dims[2],dims[1],dims[0]); + delete []b; + } + } + SDendaccess(sds); + } + SDend(sd); +} +#else +void mgl_data_read_hdf4(HMDT ,const char *,const char *){} +#endif +//----------------------------------------------------------------------------- +#ifdef HAVE_HDF5 +void mgl_data_save_hdf(HCDT dat,const char *fname,const char *data,int rewrite) +{ + const mglData *d = dynamic_cast(dat); // NOTE: only for mglData + hid_t hf,hd,hs; + hsize_t dims[3]; + long rank = 3, res; +#ifndef H5_USE_16_API + H5Eset_auto(H5E_DEFAULT,0,0); +#else + H5Eset_auto(0,0); +#endif + res=H5Fis_hdf5(fname); + if(res>0 && !rewrite) hf = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT); + else hf = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if(hf<0) return; + if(d->nz==1 && d->ny == 1) { rank=1; dims[0]=d->nx; } + else if(d->nz==1) { rank=2; dims[0]=d->ny; dims[1]=d->nx; } + else { rank=3; dims[0]=d->nz; dims[1]=d->ny; dims[2]=d->nx; } + hs = H5Screate_simple(rank, dims, 0); +#if(MGL_USE_DOUBLE==1) +#ifndef H5_USE_16_API + hd = H5Dcreate(hf, data, H5T_NATIVE_DOUBLE, hs, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); +#else /* ! HAVE_HDF5_18 */ + hd = H5Dcreate(hf, data, H5T_NATIVE_DOUBLE, hs, H5P_DEFAULT); +#endif /* HAVE_HDF5_18 */ + H5Dwrite(hd, H5T_NATIVE_DOUBLE, hs, hs, H5P_DEFAULT, d->a); +#else +#ifndef H5_USE_16_API + hd = H5Dcreate(hf, data, H5T_NATIVE_FLOAT, hs, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); +#else /* ! HAVE_HDF5_18 */ + hd = H5Dcreate(hf, data, H5T_NATIVE_FLOAT, hs, H5P_DEFAULT); +#endif /* HAVE_HDF5_18 */ + H5Dwrite(hd, H5T_NATIVE_FLOAT, hs, hs, H5P_DEFAULT, d->a); +#endif + H5Dclose(hd); H5Sclose(hs); H5Fclose(hf); +} +//----------------------------------------------------------------------------- +int mgl_data_read_hdf(HMDT d,const char *fname,const char *data) +{ + hid_t hf,hd,hs; + hsize_t dims[3]; + long rank, res = H5Fis_hdf5(fname); + if(res<=0) { mgl_data_read_hdf4(d,fname,data); return false; } + hf = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); + if(hf<0) return false; +#ifndef H5_USE_16_API + hd = H5Dopen(hf,data,H5P_DEFAULT); +#else + hd = H5Dopen(hf,data); +#endif + if(hd<0) return false; + hs = H5Dget_space(hd); + rank = H5Sget_simple_extent_ndims(hs); + if(rank>0 && rank<=3) + { + H5Sget_simple_extent_dims(hs,dims,0); + if(rank==1) { dims[2]=dims[0]; dims[0]=dims[1]=1; } + else if(rank==2) { dims[2]=dims[1]; dims[1]=dims[0]; dims[0]=1; } +// else if(rank>3) continue; + mgl_data_create(d,dims[2],dims[1],dims[0]); +#if(MGL_USE_DOUBLE==1) + H5Dread(hd, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, d->a); +#else + H5Dread(hd, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, d->a); +#endif + } + H5Dclose(hd); H5Sclose(hs); H5Fclose(hf); return true; +} +int mgl_datas_hdf(const char *fname, char *buf, long size) +{ + hid_t hf,hg,hd,ht; + if(!buf || size<1) return 0; + buf[0]=0; + hf = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); + if(!hf) return 0; +#ifndef H5_USE_16_API + hg = H5Gopen(hf,"/",H5P_DEFAULT); +#else + hg = H5Gopen(hf,"/"); +#endif + hsize_t num, i; + char name[256]; + long pos=0,len; + H5Gget_num_objs(hg, &num); + for(i=0;isize) break; + if(H5Tget_class(ht)==H5T_FLOAT || H5Tget_class(ht)==H5T_INTEGER) + { strcat(buf,name); strcat(buf,"\t"); pos += len+1; } + H5Dclose(hd); H5Tclose(ht); + } + H5Gclose(hg); H5Fclose(hf); + return i; +} +#else +void mgl_data_save_hdf(HCDT ,const char *,const char *,int ){} +int mgl_datas_hdf(const char *, char *, long ){return 0;} +int mgl_data_read_hdf(HMDT ,const char *,const char *){return false;} +#endif +//----------------------------------------------------------------------------- +int mgl_data_read_hdf_(uintptr_t *d, const char *fname, const char *data,int l,int n) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; + char *t=new char[n+1]; memcpy(t,data,n); t[n]=0; + int r = mgl_data_read_hdf(_DT_,s,t); delete []s; delete []t; return r; } +void mgl_data_save_hdf_(uintptr_t *d, const char *fname, const char *data, int *rewrite,int l,int n) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; + char *t=new char[n+1]; memcpy(t,data,n); t[n]=0; + mgl_data_save_hdf(_DT_,s,t,*rewrite); delete []s; delete []t; } +//----------------------------------------------------------------------------- +bool mgl_add_file(long &kx,long &ky, long &kz, mreal *&b, mglData *d,bool as_slice) +{ + if(as_slice && d->nz==1) + { + if(kx==d->nx && d->ny==1) + { + b = (mreal *)realloc(b,kx*(ky+1)*sizeof(mreal)); + memcpy(b+kx*ky,d->a,kx*sizeof(mreal)); ky++; + } + else if(kx==d->nx && ky==d->ny) + { + b = (mreal *)realloc(b,kx*ky*(kz+1)*sizeof(mreal)); + memcpy(b+kx*ky*kz,d->a,kx*ky*sizeof(mreal)); kz++; + } + else return false; + } + else + { + if(d->ny*d->nz==1 && ky*kz==1) + { + b = (mreal *)realloc(b,(kx+d->nx)*sizeof(mreal)); + memcpy(b+kx,d->a,d->nx*sizeof(mreal)); kx+=d->nx; + } + else if(kx==d->nx && kz==1 && d->nz==1) + { + b = (mreal *)realloc(b,kx*(ky+d->ny)*sizeof(mreal)); + memcpy(b+kx*ky,d->a,kx*d->ny*sizeof(mreal)); ky+=d->ny; + } + else if(kx==d->nx && ky==d->ny) + { + b = (mreal *)realloc(b,kx*kx*(kz+d->nz)*sizeof(mreal)); + memcpy(b+kx*ky*kz,d->a,kx*ky*d->nz*sizeof(mreal)); kz+=d->nz; + } + else return false; + } + return true; +} +//----------------------------------------------------------------------------- +int mgl_data_read_range(HMDT dat, const char *templ, double from, double to, double step, int as_slice) +{ + mglData d; + mreal t = from, *b; + long kx,ky,kz; + char *fname = new char[strlen(templ)+20]; + + //read first file + do{ sprintf(fname,templ,t); t+= step; } while(!mgl_data_read(&d,fname) && t<=to); + + if(t>to) return false; + kx = d.nx; ky = d.ny; kz = d.nz; + b = (mreal *)malloc(kx*ky*kz*sizeof(mreal)); + memcpy(b,d.a,kx*ky*kz*sizeof(mreal)); + + // read other files + for(;t<=to;t+=step) + { + sprintf(fname,templ,t); + if(mgl_data_read(&d,fname)) + if(!mgl_add_file(kx,ky,kz,b,&d,as_slice)) + return false; + } + dat->Set(b,kx,ky,kz); + delete []fname; free(b); + return true; +} +int mgl_data_read_range_(uintptr_t *d, const char *fname, double *from, double *to, double *step, int *as_slice,int l) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; + int r = mgl_data_read_range(_DT_,s,*from,*to,*step,*as_slice); delete []s; return r; } +//----------------------------------------------------------------------------- +int mgl_data_read_all(HMDT dat, const char *templ, int as_slice) +{ +#ifndef WIN32 + mglData d; + glob_t res; + unsigned long i; + mreal *b; + long kx,ky,kz; + char *fname = new char[256]; + glob (templ, GLOB_TILDE, NULL, &res); + + //read first file + for(i=0;i=res.gl_pathc) { delete []fname; return false; } + kx = d.nx; ky = d.ny; kz = d.nz; + b = (mreal *)malloc(kx*ky*kz*sizeof(mreal)); + memcpy(b,d.a,kx*ky*kz*sizeof(mreal)); + + for(;iSet(b,kx,ky,kz); + + globfree (&res); + delete []fname; free(b); + return true; +#else + return false; +#endif +} +int mgl_data_read_all_(uintptr_t *d, const char *fname, int *as_slice,int l) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; + int r = mgl_data_read_all(_DT_,s,*as_slice); delete []s; return r; } +//----------------------------------------------------------------------------- diff --git a/src/data_new.cpp b/src/data_new.cpp new file mode 100644 index 0000000..6bacd0f --- /dev/null +++ b/src/data_new.cpp @@ -0,0 +1,1267 @@ +/*************************************************************************** + * data_new.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License 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 +#include +#include + +#ifndef NO_GSL +#include +#include +#include +#endif + +#include "mgl/data.h" +//----------------------------------------------------------------------------- +void mgl_data_envelop(HMDT d, char dir) +{ +#ifndef NO_GSL + register long i,j,k,i0; + long nx=d->nx,ny=d->ny,nz=d->nz,nn=nx*ny*nz; + double *b = new double[2*nn]; + mreal *a=d->a; + for(i=0;i1) + { + gsl_fft_complex_wavetable *wt = gsl_fft_complex_wavetable_alloc(nx); + gsl_fft_complex_workspace *ws = gsl_fft_complex_workspace_alloc(nx); + for(i=0;i1) + { + gsl_fft_complex_wavetable *wt = gsl_fft_complex_wavetable_alloc(ny); + gsl_fft_complex_workspace *ws = gsl_fft_complex_workspace_alloc(ny); + for(j=0;j1) + { + gsl_fft_complex_wavetable *wt = gsl_fft_complex_wavetable_alloc(nz); + gsl_fft_complex_workspace *ws = gsl_fft_complex_workspace_alloc(nz); + for(i=0;iGetNx(),ny=d->GetNy(),nz=d->GetNz(); + mglData *r=new mglData(nx); + register long i; + if(ny>=nx && nz>=nx) for(i=0;ia[i] = d->v(i,i,i); + else if(ny>=nx) for(i=0;ia[i] = d->v(i,i); + else for(i=0;ia[i] = d->v(i); + return r; +} +uintptr_t mgl_data_trace_(uintptr_t *d) +{ return uintptr_t(mgl_data_trace(_DT_)); } +//----------------------------------------------------------------------------- +HMDT mgl_data_subdata_ext(HCDT d, HCDT xx, HCDT yy, HCDT zz) +{ + long n=0,m=0,l=0,i,j,k,i0; + mreal x,y,z; + mglData *r=new mglData; + bool ix=false, iy=false, iz=false; + if(xx->GetNz()>1) // 3d data + { + n = xx->GetNx(); m = xx->GetNy(); l = xx->GetNz(); + j = yy->GetNx()*yy->GetNy()*yy->GetNz(); if(j>1 && j!=n*m*l) return r; // wrong sizes + k = zz->GetNx()*zz->GetNy()*zz->GetNz(); if(k>1 && k!=n*m*l) return r; // wrong sizes + ix = true; iy = j>1; iz = k>1; + } + else if(yy->GetNz()>1) + { + n = yy->GetNx(); m = yy->GetNy(); l = yy->GetNz(); + j = xx->GetNx()*xx->GetNy()*xx->GetNz(); if(j>1 && j!=n*m*l) return r; // wrong sizes + k = zz->GetNx()*zz->GetNy()*zz->GetNz(); if(k>1 && k!=n*m*l) return r; // wrong sizes + iy = true; ix = j>1; iz = k>1; + } + else if(zz->GetNz()>1) + { + n = zz->GetNx(); m = zz->GetNy(); l = zz->GetNz(); + j = yy->GetNx()*yy->GetNy()*yy->GetNz(); if(j>1 && j!=n*m*l) return r; // wrong sizes + k = xx->GetNx()*xx->GetNy()*xx->GetNz(); if(k>1 && k!=n*m*l) return r; // wrong sizes + iz = true; iy = j>1; ix = k>1; + } + else if(xx->GetNy()>1) // 2d data + { + n = xx->GetNx(); m = xx->GetNy(); l = 1; + j = yy->GetNx()*yy->GetNy(); if(j>1 && j!=n*m) return r; // wrong sizes + k = zz->GetNx()*zz->GetNy(); if(k>1 && k!=n*m) return r; // wrong sizes + ix = true; iy = j>1; iz = k>1; + } + else if(yy->GetNy()>1) + { + n = yy->GetNx(); m = yy->GetNy(); l = 1; + j = xx->GetNx()*xx->GetNy(); if(j>1 && j!=n*m) return r; // wrong sizes + k = zz->GetNx()*zz->GetNy(); if(k>1 && k!=n*m) return r; // wrong sizes + iy = true; ix = j>1; iz = k>1; + } + else if(zz->GetNy()>1) + { + n = zz->GetNx(); m = zz->GetNy(); l = 1; + j = yy->GetNx()*yy->GetNy(); if(j>1 && j!=n*m) return r; // wrong sizes + k = xx->GetNx()*xx->GetNy(); if(k>1 && k!=n*m) return r; // wrong sizes + iz = true; iy = j>1; ix = k>1; + } + long nx=d->GetNx(),ny=d->GetNy(),nz=d->GetNz(); + mreal vx=xx->v(0), vy=yy->v(0), vz=zz->v(0); + if(n*m*l>1) // this is 2d or 3d data + { + r->Create(n,m,l); + for(i0=0;i0vthr(i0):vx; + y = iy?yy->vthr(i0):vy; + z = iz?zz->vthr(i0):vz; + r->a[i0] = mgl_data_linear(d,x,y,z); + } + return r; + } + // this is 1d data -> try as normal SubData() + if(xx->GetNx()>1 || vx>=0) { n=xx->GetNx(); ix=true; } + else { n=nx; ix=false; } + if(yy->GetNx()>1 || vy>=0) { m=yy->GetNx(); iy=true; } + else { m=ny; iy=false; } + if(zz->GetNx()>1 || vz>=0) { l=zz->GetNx(); iz=true; } + else { l=nz; iz=false; } + r->Create(n,m,l); + for(k=0;kv(i):i; y = iy?yy->v(j):j; z = iz?zz->v(k):k; + r->a[i+n*(j+m*k)] = mgl_data_linear(d,x,y,z); + } + if(m==1) { r->ny=r->nz; r->nz=1; }// "squeeze" dimensions + if(n==1) { r->nx=r->ny; r->ny=r->nz; r->nz=1; r->NewId();} + return r; +} +//----------------------------------------------------------------------------- +HMDT mgl_data_subdata(HCDT d, long xx,long yy,long zz) +{ + mglData x,y,z; + x.a[0]=xx; y.a[0]=yy; z.a[0]=zz; + return mgl_data_subdata_ext(d,&x,&y,&z); +} +//----------------------------------------------------------------------------- +uintptr_t mgl_data_subdata_(uintptr_t *d, int *xx,int *yy,int *zz) +{ return uintptr_t(mgl_data_subdata(_DT_,*xx,*yy,*zz)); } +uintptr_t mgl_data_subdata_ext_(uintptr_t *d, uintptr_t *xx, uintptr_t *yy, uintptr_t *zz) +{ return uintptr_t(mgl_data_subdata_ext(_DT_,_DA_(xx),_DA_(yy),_DA_(zz))); } +//----------------------------------------------------------------------------- +void *mgl_column(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + mglFormula *f = (mglFormula *)t->v; + register long i,j, nx=t->p[0]; + mreal *b=t->a, var[MGL_VS]; + const mreal *a=t->b; + memset(var,0,('z'-'a')*sizeof(mreal)); + for(i=t->id;in;i+=mglNumThr) + { + for(j=0;js[j]>='a' && t->s[j]<='z') + var[t->s[j]-'a'] = a[j+nx*i]; + b[i] = f->Calc(var); + } + return 0; +} +HMDT mgl_data_column(HCDT dat, const char *eq) +{ // NOTE: only for mglData (for speeding up) + long nx=dat->GetNx(),ny=dat->GetNy(),nz=dat->GetNz(); + mglFormula f(eq); + mglData *r=new mglData(ny,nz); + const mglData *d=dynamic_cast(dat); + if(d) mglStartThread(mgl_column,0,ny*nz,r->a,d->a,0,&nx,&f,0,0,d->id); + return r; +} +uintptr_t mgl_data_column_(uintptr_t *d, const char *eq,int l) +{ char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + uintptr_t r = uintptr_t(mgl_data_column(_DT_,s)); + delete []s; return r; } +//----------------------------------------------------------------------------- +void *mgl_resize(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j,k,i0, nx=t->p[0], ny=t->p[1]; + long n1=t->p[3],n2=t->p[4],n3=t->p[5]; + mreal *b=t->a; + const mreal *a=t->b, *c=t->c; + for(i0=t->id;i0n;i0+=mglNumThr) + { + i=i0%nx; j=((i0/nx)%ny); k=i0/(nx*ny); + b[i0] = mglSpline3(a,n1,n2,n3, c[0]+i*c[1], c[2]+j*c[3], c[4]+k*c[5]); + } + return 0; +} +HMDT mgl_data_resize_box(HCDT dat, long mx,long my,long mz, float x1,float x2, float y1,float y2, float z1,float z2) +{ // NOTE: only for mglData (for speeding up) + mx = mx<1 ? 1:mx; my = my<1 ? 1:my; mz = mz<1 ? 1:mz; + mglData *r=new mglData(mx,my,mz); + const mglData *d=dynamic_cast(dat); + if(!d) return r; + register long nx = d->nx-1, ny = d->ny-1, nz = d->nz-1; + mreal par[6]={nx*x1,0,ny*y1,0,nz*z1,0}; + long nn[6]={mx,my,mz,nx+1,ny+1,nz+1}; + if(mx>1) par[1] = nx*(x2-x1)/(mx-1); + if(my>1) par[3] = ny*(y2-y1)/(my-1); + if(mz>1) par[5] = nz*(z2-z1)/(mz-1); + mglStartThread(mgl_resize,0,mx*my*mz,r->a,d->a,par,nn); + return r; +} +HMDT mgl_data_resize(HCDT d, long mx,long my,long mz) +{ return mgl_data_resize_box(d, mx,my,mz,0,1,0,1,0,1); } +uintptr_t mgl_data_resize_(uintptr_t *d, int *mx,int *my,int *mz) +{ return uintptr_t(mgl_data_resize(_DT_,*mx,*my,*mz)); } +uintptr_t mgl_data_resize_box_(uintptr_t *d, int *mx,int *my,int *mz, float *x1,float *x2, float *y1,float *y2, float *z1,float *z2) +{ return uintptr_t(mgl_data_resize_box(_DT_,*mx,*my,*mz,*x1,*x2,*y1,*y2,*z1,*z2)); } +//----------------------------------------------------------------------------- +void *mgl_combine(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i0, nx=t->p[0]; + mreal *b=t->a; + const mreal *c=t->b, *d=t->c; + for(i0=t->id;i0n;i0+=mglNumThr) b[i0] = c[i0%nx]*d[i0/nx]; + return 0; +} +HMDT mgl_data_combine(HCDT d1, HCDT d2) +{ // NOTE: only for mglData (for speeding up) + const mglData *a=dynamic_cast(d1); + const mglData *b=dynamic_cast(d2); + + mglData *r=new mglData; + if(a->nz>1 || (a->ny>1 && b->ny>1) || b->nz>1) return r; + long n1=a->ny,n2=b->nx; + bool dim2=true; + if(a->ny==1) { n1=b->nx; n2=b->ny; dim2 = false; } + r->Create(a->nx,n1,n2); + if(dim2) n1=a->nx*a->ny; else { n1=a->nx; n2=b->nx*b->ny; } + mglStartThread(mgl_combine,0,n1*n2,r->a,a->a,b->a,&n1); + return r; +} +uintptr_t mgl_data_combine_(uintptr_t *a, uintptr_t *b) +{ return uintptr_t(mgl_data_combine(_DA_(a),_DA_(b))); } +//----------------------------------------------------------------------------- +void *mgl_sum_z(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j, nz=t->p[2], nn=t->n; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;ip[0], ny=t->p[1], nn=t->n; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;ip[0], nn=t->n; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;iGetNx(),ny=dat->GetNy(),nz=dat->GetNz(); + long p[3]={nx,ny,nz}; + mreal *b = new mreal[nx*ny*nz]; + mreal *c = new mreal[nx*ny*nz]; + + const mglData *d=dynamic_cast(dat); + if(d) memcpy(c,d->a,nx*ny*nz*sizeof(mreal)); + else for(long i=0;ivthr(i); + + if(strchr(dir,'z') && nz>1) + { + mglStartThread(mgl_sum_z,0,nx*ny,b,c,0,p); + memcpy(c,b,nx*ny*sizeof(mreal)); p[2] = 1; + } + if(strchr(dir,'y') && ny>1) + { + mglStartThread(mgl_sum_y,0,nx*p[2],b,c,0,p); + memcpy(c,b,nx*p[2]*sizeof(mreal)); p[1] = p[2]; p[2] = 1; + } + if(strchr(dir,'x') && nx>1) + { + mglStartThread(mgl_sum_x,0,p[1]*p[2],b,c,0,p); + p[0] = p[1]; p[1] = p[2]; p[2] = 1; + } + mglData *r=new mglData(p[0],p[1],p[2]); + memcpy(r->a,b,p[0]*p[1]*p[2]*sizeof(mreal)); + delete []b; delete []c; return r; +} +uintptr_t mgl_data_sum_(uintptr_t *d, const char *dir,int l) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; + uintptr_t r=uintptr_t(mgl_data_sum(_DT_,s)); delete []s; return r; } +//----------------------------------------------------------------------------- +void *mgl_max_z(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j, nz=t->p[2], nn=t->n; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;ip[0], ny=t->p[1], nn=t->n; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;ip[0], nn=t->n; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;iGetNx(),ny=dat->GetNy(),nz=dat->GetNz(); + long p[3]={nx,ny,nz}; + mreal *b = new mreal[nx*ny*nz]; + mreal *c = new mreal[nx*ny*nz]; + + const mglData *d=dynamic_cast(dat); + if(d) memcpy(c,d->a,nx*ny*nz*sizeof(mreal)); + else for(long i=0;ivthr(i); + + if(strchr(dir,'z') && nz>1) + { + mglStartThread(mgl_max_z,0,nx*ny,b,c,0,p); + memcpy(c,b,nx*ny*sizeof(mreal)); p[2] = 1; + } + if(strchr(dir,'y') && ny>1) + { + mglStartThread(mgl_max_y,0,nx*p[2],b,c,0,p); + memcpy(c,b,nx*p[2]*sizeof(mreal)); p[1] = p[2]; p[2] = 1; + } + if(strchr(dir,'x') && nx>1) + { + mglStartThread(mgl_max_x,0,p[1]*p[2],b,c,0,p); + p[0] = p[1]; p[1] = p[2]; p[2] = 1; + } + mglData *r=new mglData(p[0],p[1],p[2]); + memcpy(r->a,b,p[0]*p[1]*p[2]*sizeof(mreal)); + delete []b; delete []c; return r; +} +uintptr_t mgl_data_max_dir_(uintptr_t *d, const char *dir,int l) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; + uintptr_t r=uintptr_t(mgl_data_max_dir(_DT_,s)); delete []s; return r; } +//----------------------------------------------------------------------------- +void *mgl_min_z(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j, nz=t->p[2], nn=t->n; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;ip[0], ny=t->p[1], nn=t->n; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;ip[0], nn=t->n; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;iGetNx(),ny=dat->GetNy(),nz=dat->GetNz(); + long p[3]={nx,ny,nz}; + mreal *b = new mreal[nx*ny*nz]; + mreal *c = new mreal[nx*ny*nz]; + + const mglData *d=dynamic_cast(dat); + if(d) memcpy(c,d->a,nx*ny*nz*sizeof(mreal)); + else for(long i=0;ivthr(i); + + if(strchr(dir,'z') && nz>1) + { + mglStartThread(mgl_min_z,0,nx*ny,b,c,0,p); + memcpy(c,b,nx*ny*sizeof(mreal)); p[2] = 1; + } + if(strchr(dir,'y') && ny>1) + { + mglStartThread(mgl_min_y,0,nx*p[2],b,c,0,p); + memcpy(c,b,nx*p[2]*sizeof(mreal)); p[1] = p[2]; p[2] = 1; + } + if(strchr(dir,'x') && nx>1) + { + mglStartThread(mgl_min_x,0,p[1]*p[2],b,c,0,p); + p[0] = p[1]; p[1] = p[2]; p[2] = 1; + } + mglData *r=new mglData(p[0],p[1],p[2]); + memcpy(r->a,b,p[0]*p[1]*p[2]*sizeof(mreal)); + delete []b; delete []c; return r; +} +uintptr_t mgl_data_min_dir_(uintptr_t *d, const char *dir,int l) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; + uintptr_t r=uintptr_t(mgl_data_min_dir(_DT_,s)); delete []s; return r; } +//----------------------------------------------------------------------------- +void *mgl_mom_z(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j,k,ii; + long nx=t->p[0], ny=t->p[1], nz=t->p[2], nn=t->n; + mreal *b=t->a, i0,i1,x,y,z; + const mreal *a=t->b; + const mglFormula *eq = (mglFormula *)t->v; + for(i=t->id;iCalc(x,y,z,a[ii]); + } + b[i] = i0>0 ? i1/i0 : 0; + } + return 0; +} +void *mgl_mom_y(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j,k,ii; + long nx=t->p[0], ny=t->p[1], nz=t->p[2], nn=t->n; + mreal *b=t->a, i0,i1,x,y,z; + const mreal *a=t->b; + const mglFormula *eq = (mglFormula *)t->v; + for(i=t->id;iCalc(x,y,z,a[ii]); + } + b[i] = i0>0 ? i1/i0 : 0; + } + return 0; +} +void *mgl_mom_x(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j,k,ii; + long nx=t->p[0], ny=t->p[1], nz=t->p[2], nn=t->n; + mreal *b=t->a, i0,i1,x,y,z; + const mreal *a=t->b; + const mglFormula *eq = (mglFormula *)t->v; + for(i=t->id;iCalc(x,y,z,a[ii]); + } + b[i] = i0>0 ? i1/i0 : 0; + } + return 0; +} +HMDT mgl_data_momentum(HCDT dat, char dir, const char *how) +{ // NOTE: only for mglData (for speeding up) + long nx=dat->GetNx(),ny=dat->GetNy(),nz=dat->GetNz(); + const mglData *d=dynamic_cast(dat); + mglData *b=new mglData; + if(!d) return b; + mglFormula eq(how); + long p[3]={nx,ny,nz}; + if(dir=='x') + { b->Create(nx); mglStartThread(mgl_mom_x,0,nx,b->a,d->a,0,p,&eq); } + if(dir=='y') + { b->Create(ny); mglStartThread(mgl_mom_y,0,ny,b->a,d->a,0,p,&eq); } + if(dir=='z') + { b->Create(nz); mglStartThread(mgl_mom_z,0,nz,b->a,d->a,0,p,&eq); } + return b; +} +uintptr_t mgl_data_momentum_(uintptr_t *d, char *dir, const char *how, int,int l) +{ char *s=new char[l+1]; memcpy(s,how,l); s[l]=0; + uintptr_t r=uintptr_t(mgl_data_momentum(_DT_,*dir, s)); + delete []s; return r; } +//----------------------------------------------------------------------------- +void *mgl_eval(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i, nx=t->p[0], ny=t->p[1], nz=t->p[2], n1=t->p[3], nn=t->n; + const mreal *a=t->b, *ii=t->c, *jj=t->d, *kk=t->e; + mreal *b=t->a,x,y,z; + for(i=t->id;i(dat); + const mglData *i=dynamic_cast(idat); + const mglData *j=dynamic_cast(jdat); + const mglData *k=dynamic_cast(kdat); + if(!d || !i) return r; + + long p[4]={i->nx,i->ny,i->nz,norm}; + register long n=i->nx*i->ny*i->nz; + if(j && j->nx*j->ny*j->nz!=n) return r; + if(k && k->nx*k->ny*k->nz!=n) return r; + r->Create(i->nx,i->ny,i->nz); + mglStartThread(mgl_eval,0,n,r->a,d->a,i->a,p,0,j?j->a:0,k?k->a:0); + return r; +} +uintptr_t mgl_data_evaluate_(uintptr_t *d, uintptr_t *idat, uintptr_t *jdat, uintptr_t *kdat, int *norm) +{ return uintptr_t(mgl_data_evaluate(_DT_,_DA_(idat),_DA_(jdat),_DA_(kdat),*norm)); } +//----------------------------------------------------------------------------- +void mgl_data_fourier(HMDT re, HMDT im, const char *dir) +{ +#ifndef NO_GSL + long nx = re->nx, ny = re->ny, nz = re->nz; + if(nx*ny*nz != im->nx*im->ny*im->nz || !dir || dir[0]==0) return; + double *a = new double[2*nx*ny*nz]; + register long i,j; + gsl_fft_direction how = strchr(dir,'i')?backward:forward; + for(i=0;ia[i]; a[2*i+1] = im->a[i]; } + if(strchr(dir,'x') && nx>1) + { + gsl_fft_complex_wavetable *wt = gsl_fft_complex_wavetable_alloc(nx); + gsl_fft_complex_workspace *ws = gsl_fft_complex_workspace_alloc(nx); + for(i=0;i1) + { + gsl_fft_complex_wavetable *wt = gsl_fft_complex_wavetable_alloc(ny); + gsl_fft_complex_workspace *ws = gsl_fft_complex_workspace_alloc(ny); + for(j=0;j1) + { + gsl_fft_complex_wavetable *wt = gsl_fft_complex_wavetable_alloc(nz); + gsl_fft_complex_workspace *ws = gsl_fft_complex_workspace_alloc(nz); + for(i=0;ia[i] = a[2*i]; im->a[i] = a[2*i+1]; } + delete []a; +#endif +} +void mgl_data_fourier_(uintptr_t *re, uintptr_t *im, const char *dir, int l) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; + mgl_data_fourier(_DM_(re),_DM_(im),s); delete []s; } +//----------------------------------------------------------------------------- +HMDT mgl_data_stfa(HCDT re, HCDT im, long dn, char dir) +{ + mglData *d=new mglData; +#ifndef NO_GSL + if(dn<2) return d; + dn = 2*(dn/2); + long nx = re->GetNx(), ny = re->GetNy(); + if(nx*ny!=im->GetNx()*im->GetNy()) return d; + register long i,j,k,i0,dd=dn/2; + double *a = new double[4*dn],ff; +// for(i=0;i=ny) i0=ny-1; + if(k=dn+dd) + { ff = 0.5*(k-3.5*dd)/dd; ff=0.5-ff*(3-ff*ff); } + a[2*k] = re->v(i,i0)*ff; a[2*k+1] = im->v(i,i0)*ff; + } + gsl_fft_complex_forward(a, 1, 2*dn, wt, ws); + for(k=0;ka[i0+mx*mz*dd] = hypot(a[4*k],a[4*k+1])/dn; + d->a[i0] = hypot(a[4*k+2*dn],a[4*k+2*dn+1])/dn; + } + } + } + else + { + mx = dn; my = nx/dn; mz = ny; + mgl_data_create(d, my, mx, mz); + for(j=0;j=nx) i0=nx-1; + if(k=3*dd) + { ff = 0.5*(k-3.5*dd)/dd; ff=0.5-ff*(3-ff*ff); } + a[2*k] = re->v(i0,j)*ff; a[2*k+1] = im->v(i0,j)*ff; + } + gsl_fft_complex_forward(a, 1, 2*dn, wt, ws); + for(k=0;ka[i0+dd*my] = hypot(a[4*k],a[4*k+1])/dn; + d->a[i0] = hypot(a[4*k+2*dn],a[4*k+2*dn+1])/dn; + } + } + } + delete []a; + gsl_fft_complex_workspace_free(ws); + gsl_fft_complex_wavetable_free(wt); +#endif + return d; +} +uintptr_t mgl_data_stfa_(uintptr_t *re, uintptr_t *im, int *dn, char *dir, int) +{ return uintptr_t(mgl_data_stfa(_DA_(re),_DA_(im),*dn,*dir)); } +//----------------------------------------------------------------------------- +void mgl_data_fill_sample(HMDT d, long n, const char *how) +{ + bool xx = strchr(how,'x'); + mgl_data_create(d,n,1,1); + register long i; + if(strchr(how,'h')) // Hankel + { +#ifndef NO_GSL + gsl_dht *dht = gsl_dht_new(n,0,1); + for(i=0;ia[i] = xx ? gsl_dht_x_sample(dht, i) : gsl_dht_k_sample(dht, i); + gsl_dht_free(dht); +#endif + } + else // Fourier + { + if(xx) for(i=0;ia[i] = mreal(2*i-n)/n; + else for(i=0;ia[i] = M_PI*(inx, ny=d->ny, nz=d->nz; + mreal *a=d->a; + if(strchr(dir,'x') && nx>1) + { + ai = new double[nx]; af = new double[nx]; + dht = gsl_dht_new(nx,0,1); + mm = gsl_sf_bessel_zero_J0(nx+1); + for(i=0;i1) + { + ai = new double[ny]; af = new double[ny]; + dht = gsl_dht_new(ny,0,1); + mm = gsl_sf_bessel_zero_J0(ny+1); + for(i=0;i1) + { + ai = new double[nz]; af = new double[nz]; + dht = gsl_dht_new(nz,0,1); + mm = gsl_sf_bessel_zero_J0(nz+1); + k = nx*ny; for(i=0;inx, ny=d->ny, nz=d->nz; + mreal *a=d->a; + if(strchr(dir,'x') && nx>1) + { + wt = gsl_fft_complex_wavetable_alloc(2*nx); + ws = gsl_fft_complex_workspace_alloc(2*nx); + b = new double[4*nx]; + for(i=0;i1) + { + wt = gsl_fft_complex_wavetable_alloc(2*ny); + ws = gsl_fft_complex_workspace_alloc(2*ny); + b = new double[4*ny]; + for(i=0;i1) + { + wt = gsl_fft_complex_wavetable_alloc(2*nz); + ws = gsl_fft_complex_workspace_alloc(2*nz); + b = new double[4*nz]; k = nx*ny; + for(i=0;inx, ny=d->ny, nz=d->nz; + mreal *a=d->a; + if(strchr(dir,'x') && nx>1) + { + wt = gsl_fft_complex_wavetable_alloc(2*nx); + ws = gsl_fft_complex_workspace_alloc(2*nx); + b = new double[4*nx]; + for(i=0;i1) + { + wt = gsl_fft_complex_wavetable_alloc(2*ny); + ws = gsl_fft_complex_workspace_alloc(2*ny); + b = new double[4*ny]; + for(i=0;i1) + { + wt = gsl_fft_complex_wavetable_alloc(2*nz); + ws = gsl_fft_complex_workspace_alloc(2*nz); + b = new double[4*nz]; k = nx*ny; + for(i=0;iGetNx(), ny = am->GetNy(), nz = am->GetNz(); + if(nx*ny*nz != ph->GetNx()*ph->GetNy()*ph->GetNz() || !tr || tr[0]==0) + return (new mglData); + mglData re(nx,ny,nz), im(nx,ny,nz); + for(long i=0;ivthr(i)*cos(ph->vthr(i)); + im.a[i] = am->vthr(i)*sin(ph->vthr(i)); } + return mgl_transform(&re, &im, tr); +} +//----------------------------------------------------------------------------- +HMDT mgl_transform(HCDT re, HCDT im, const char *tr) +{ + long nx = re->GetNx(), ny = re->GetNy(), nz = re->GetNz(); + if(nx*ny*nz != im->GetNx()*im->GetNy()*im->GetNz() || !tr || tr[0]==0) + return (new mglData); + mglData rr(re),ii(im); + if(strchr(tr,'i') && strchr(tr,'f')) // general case + { + if(tr[0]=='f') mgl_data_fourier(&rr,&ii,"x"); + if(tr[0]=='i') mgl_data_fourier(&rr,&ii,"xi"); + if(tr[1]=='f') mgl_data_fourier(&rr,&ii,"y"); + if(tr[1]=='i') mgl_data_fourier(&rr,&ii,"yi"); + if(tr[2]=='f') mgl_data_fourier(&rr,&ii,"z"); + if(tr[2]=='i') mgl_data_fourier(&rr,&ii,"zi"); + } + else if(strchr(tr,'f')) // do Fourier only once for speeding up + { + char str[4] = " "; + if(tr[0]=='f') str[0]='x'; + if(tr[1]=='f') str[1]='y'; + if(tr[2]=='f') str[2]='z'; + mgl_data_fourier(&rr,&ii,str); + } + else if(strchr(tr,'i')) // do Fourier only once for speeding up + { + char str[5] = " i"; + if(tr[0]=='f') str[0]='x'; + if(tr[1]=='f') str[1]='y'; + if(tr[2]=='f') str[2]='z'; + mgl_data_fourier(&rr,&ii,str); + } + else if(strchr(tr,'s')) // do Fourier only once for speeding up + { + if(tr[0]=='s') { rr.SinFFT("x"); ii.SinFFT("x"); } + if(tr[1]=='s') { rr.SinFFT("y"); ii.SinFFT("y"); } + if(tr[2]=='s') { rr.SinFFT("z"); ii.SinFFT("z"); } + } + else if(strchr(tr,'c')) // do Fourier only once for speeding up + { + if(tr[0]=='c') { rr.CosFFT("x"); ii.CosFFT("x"); } + if(tr[1]=='c') { rr.CosFFT("y"); ii.CosFFT("y"); } + if(tr[2]=='c') { rr.CosFFT("z"); ii.CosFFT("z"); } + } + else if(strchr(tr,'s')) // do Fourier only once for speeding up + { + if(tr[0]=='h') { rr.Hankel("x"); ii.Hankel("x"); } + if(tr[1]=='h') { rr.Hankel("y"); ii.Hankel("y"); } + if(tr[2]=='h') { rr.Hankel("z"); ii.Hankel("z"); } + } + mglData *d = new mglData(nx, ny, nz); + register long i; + for(i=0;ia[i] = hypot(rr.a[i],ii.a[i]); + return d; +} +//----------------------------------------------------------------------------- +uintptr_t mgl_transform_a_(uintptr_t *am, uintptr_t *ph, const char *tr, int l) +{ char *s=new char[l+1]; memcpy(s,tr,l); s[l]=0; + uintptr_t res = uintptr_t(mgl_transform_a(_DA_(am),_DA_(ph),s)); + delete []s; return res; } +uintptr_t mgl_transform_(uintptr_t *re, uintptr_t *im, const char *tr, int l) +{ char *s=new char[l+1]; memcpy(s,tr,l); s[l]=0; + uintptr_t res = uintptr_t(mgl_transform(_DA_(re),_DA_(im),s)); + delete []s; return res; } +//----------------------------------------------------------------------------- +void *mgl_eqmul(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i, nx=t->p[0]; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;in;i+=mglNumThr) b[i] *= a[i%nx]; + return 0; +} +void mgl_data_mul_dat(HMDT d, HCDT a) +{ + long n, nx=d->nx, ny=d->ny, nz=d->nz; + const mglData *b = dynamic_cast(a); + if(b) + { + if(b->nz==1 && b->ny==1 && nx==b->nx) + { n=nx; mglStartThread(mgl_eqmul,0,nx*ny*nz,d->a,b->a,0,&n); } + else if(b->nz==1 && ny==b->ny && nx==b->nx) + { n=nx*ny; mglStartThread(mgl_eqmul,0,nx*ny*nz,d->a,b->a,0,&n); } + else if(nz==b->nz && ny==b->ny && nx==b->nx) + { n=nx*ny*nz; mglStartThread(mgl_eqmul,0,nx*ny*nz,d->a,b->a,0,&n); } + } + else for(long k=0;ka[i+nx*(j+ny*k)] *= a->v(i,j,k); +} +//----------------------------------------------------------------------------- +void mgl_data_mul_num(HMDT d, float a) +{ + long n=1, nx=d->nx, ny=d->ny, nz=d->nz; + mglStartThread(mgl_eqmul,0,nx*ny*nz,d->a,&a,0,&n); +} +//----------------------------------------------------------------------------- +void *mgl_eqdiv(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i, nx=t->p[0]; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;in;i+=mglNumThr) b[i] /= a[i%nx]; + return 0; +} +void mgl_data_div_dat(HMDT d, HCDT a) +{ + long n, nx=d->nx, ny=d->ny, nz=d->nz; + const mglData *b = dynamic_cast(a); + if(b) + { + if(b->nz==1 && b->ny==1 && nx==b->nx) + { n=nx; mglStartThread(mgl_eqdiv,0,nx*ny*nz,d->a,b->a,0,&n); } + else if(b->nz==1 && ny==b->ny && nx==b->nx) + { n=nx*ny; mglStartThread(mgl_eqdiv,0,nx*ny*nz,d->a,b->a,0,&n); } + else if(nz==b->nz && ny==b->ny && nx==b->nx) + { n=nx*ny*nz; mglStartThread(mgl_eqdiv,0,nx*ny*nz,d->a,b->a,0,&n); } + } + else for(long k=0;ka[i+nx*(j+ny*k)] /= a->v(i,j,k); +} +//----------------------------------------------------------------------------- +void mgl_data_div_num(HMDT d, float a) +{ + long n=1, nx=d->nx, ny=d->ny, nz=d->nz; + mglStartThread(mgl_eqdiv,0,nx*ny*nz,d->a,&a,0,&n); +} +//----------------------------------------------------------------------------- +void *mgl_eqadd(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i, nx=t->p[0]; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;in;i+=mglNumThr) b[i] += a[i%nx]; + return 0; +} +void mgl_data_add_dat(HMDT d, HCDT a) +{ + long n, nx=d->nx, ny=d->ny, nz=d->nz; + const mglData *b = dynamic_cast(a); + if(b) + { + if(b->nz==1 && b->ny==1 && nx==b->nx) + { n=nx; mglStartThread(mgl_eqadd,0,nx*ny*nz,d->a,b->a,0,&n); } + else if(b->nz==1 && ny==b->ny && nx==b->nx) + { n=nx*ny; mglStartThread(mgl_eqadd,0,nx*ny*nz,d->a,b->a,0,&n); } + else if(nz==b->nz && ny==b->ny && nx==b->nx) + { n=nx*ny*nz; mglStartThread(mgl_eqadd,0,nx*ny*nz,d->a,b->a,0,&n); } + } + else for(long k=0;ka[i+nx*(j+ny*k)] += a->v(i,j,k); +} +//----------------------------------------------------------------------------- +void mgl_data_add_num(HMDT d, float a) +{ + long n=1, nx=d->nx, ny=d->ny, nz=d->nz; + mglStartThread(mgl_eqadd,0,nx*ny*nz,d->a,&a,0,&n); +} +//----------------------------------------------------------------------------- +void *mgl_eqsub(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i, nx=t->p[0]; + mreal *b=t->a; + const mreal *a=t->b; + for(i=t->id;in;i+=mglNumThr) b[i] -= a[i%nx]; + return 0; +} +void mgl_data_sub_dat(HMDT d, HCDT a) +{ + long n, nx=d->nx, ny=d->ny, nz=d->nz; + const mglData *b = dynamic_cast(a); + if(b) + { + if(b->nz==1 && b->ny==1 && nx==b->nx) + { n=nx; mglStartThread(mgl_eqsub,0,nx*ny*nz,d->a,b->a,0,&n); } + else if(b->nz==1 && ny==b->ny && nx==b->nx) + { n=nx*ny; mglStartThread(mgl_eqsub,0,nx*ny*nz,d->a,b->a,0,&n); } + else if(nz==b->nz && ny==b->ny && nx==b->nx) + { n=nx*ny*nz; mglStartThread(mgl_eqsub,0,nx*ny*nz,d->a,b->a,0,&n); } + } + else for(long k=0;ka[i+nx*(j+ny*k)] -= a->v(i,j,k); +} +//----------------------------------------------------------------------------- +void mgl_data_sub_num(HMDT d, float a) +{ + long n=1, nx=d->nx, ny=d->ny, nz=d->nz; + mglStartThread(mgl_eqsub,0,nx*ny*nz,d->a,&a,0,&n); +} +//----------------------------------------------------------------------------- +void mgl_data_mul_dat_(uintptr_t *d, uintptr_t *b) { mgl_data_mul_dat(_DT_, _DA_(b)); } +void mgl_data_div_dat_(uintptr_t *d, uintptr_t *b) { mgl_data_div_dat(_DT_, _DA_(b)); } +void mgl_data_add_dat_(uintptr_t *d, uintptr_t *b) { mgl_data_add_dat(_DT_, _DA_(b)); } +void mgl_data_sub_dat_(uintptr_t *d, uintptr_t *b) { mgl_data_sub_dat(_DT_, _DA_(b)); } +void mgl_data_mul_num_(uintptr_t *d, float *b) { mgl_data_mul_num(_DT_, *b); } +void mgl_data_div_num_(uintptr_t *d, float *b) { mgl_data_div_num(_DT_, *b); } +void mgl_data_add_num_(uintptr_t *d, float *b) { mgl_data_add_num(_DT_, *b); } +void mgl_data_sub_num_(uintptr_t *d, float *b) { mgl_data_sub_num(_DT_, *b); } +//----------------------------------------------------------------------------- +void mgl_hist_p(mglThreadD *t,mreal *a) +{ + register long i,j,n=t[0].p[0]; + mreal *b; + for(i=0;in, n = t->p[0]; + mreal *b=new mreal[n], *v=(mreal *)t->v; + const mreal *a=t->b, *c=t->c; + for(i=t->id;i=0 && ka = b; return 0; +} +void *mgl_hist_2(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,k, nn=t->n, n = t->p[0]; + long ns=t->p[1], nx=t->p[2], ny=t->p[3], nz=t->p[4]; + mreal *b=new mreal[n], *v=(mreal *)t->v, f,w=1, x,y,z, d=1./ns; + const mreal *a=t->b, *c=t->c; + bool sp = n>0; + for(i=t->id;i=0 && ka = b; return 0; +} +HMDT mgl_data_hist(HCDT dat, long n, float v1, float v2, long nsub) +{ + mglData *b=new mglData; // NOTE: For mglData only! + const mglData *d = dynamic_cast(dat); + if(n<2 || v1==v2 || !d) return b; + mgl_data_create(b,n,1,1); + mreal v[2]={v1,v2}; + long nx=d->nx, ny=d->ny, nz=d->nz; + long ns=abs(nsub)+1, p[5]={n,ns,nx,ny,nz}; + if(nsub==0) mglStartThread(mgl_hist_1,mgl_hist_p, nx*ny*nz, b->a,d->a,0,p,v); + else mglStartThread(mgl_hist_2,mgl_hist_p, nx*ny*nz*ns*ns*ns, b->a,d->a,0,p,v); + return b; +} +//----------------------------------------------------------------------------- +HMDT mgl_data_hist_w(HCDT dat, HCDT weight, long n, float v1, float v2, long nsub) +{ + mglData *b=new mglData; // NOTE: For mglData only! + const mglData *d = dynamic_cast(dat); + const mglData *w = dynamic_cast(weight); + if(n<2 || v1==v2 || !d || !w) return b; + mgl_data_create(b,n,1,1); + mreal v[2]={v1,v2}; + + long nx=d->nx, ny=d->ny, nz=d->nz; + long ns=abs(nsub)+1, p[5]={n,ns,nx,ny,nz}; + if(nsub==0) mglStartThread(mgl_hist_1,mgl_hist_p, nx*ny*nz, b->a,d->a,w->a,p,v); + else mglStartThread(mgl_hist_2,mgl_hist_p, nx*ny*nz*ns*ns*ns, b->a,d->a,w->a,p,v); + return b; +} +//----------------------------------------------------------------------------- +uintptr_t mgl_data_hist_(uintptr_t *d, int *n, float *v1, float *v2, int *nsub) +{ return uintptr_t(mgl_data_hist(_DT_,*n,*v1,*v2,*nsub)); } +uintptr_t mgl_data_hist_w_(uintptr_t *d, uintptr_t *w, int *n, float *v1, float *v2, int *nsub) +{ return uintptr_t(mgl_data_hist_w(_DT_,_DA_(w),*n,*v1,*v2,*nsub)); } +//----------------------------------------------------------------------------- +mreal mglLinear(const mreal *a, long nx, long ny, long nz, mreal x, mreal y, mreal z) +{ + if(!a || nx<1 || ny<1 || nz<1) return 0; + register long i0; + long kx,ky,kz; + mreal b=0,dx,dy,dz,b1,b0; + if(x<0 || y<0 || z<0 || x>nx-1 || y>ny-1 || z>nz-1) + return 0; + if(nz>1 && z!=long(z)) // 3d interpolation + { + kx=long(x); ky=long(y); kz=long(z); + dx = x-kx; dy = y-ky; dz = z-kz; + + i0 = kx+nx*(ky+ny*kz); + b0 = a[i0]*(1-dx-dy+dx*dy) + dx*(1-dy)*a[i0+1] + + dy*(1-dx)*a[i0+nx] + dx*dy*a[i0+nx+1]; + i0 = kx+nx*(ky+ny*(kz+1)); + b1 = a[i0]*(1-dx-dy+dx*dy) + dx*(1-dy)*a[i0+1] + + dy*(1-dx)*a[i0+nx] + dx*dy*a[i0+nx+1]; + b = b0 + dz*(b1-b0); + } + else if(ny>1 && y!=long(y)) // 2d interpolation + { + kx=long(x); ky=long(y); + dx = x-kx; dy=y-ky; + i0 = kx+nx*ky; + b = a[i0]*(1-dx-dy+dx*dy) + dx*(1-dy)*a[i0+1] + + dy*(1-dx)*a[i0+nx] + dx*dy*a[i0+nx+1]; + } + else if(nx>1 && x!=long(x)) // 1d interpolation + { + kx = long(x); + b = a[kx] + (x-kx)*(a[kx+1]-a[kx]); + } + else // no interpolation + b = a[long(x+nx*(y+ny*z))]; + return b; +} +//----------------------------------------------------------------------------- diff --git a/src/data_op.cpp b/src/data_op.cpp new file mode 100644 index 0000000..97f740b --- /dev/null +++ b/src/data_op.cpp @@ -0,0 +1,26 @@ +/*************************************************************************** + * data_op.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License 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 +#include +#include + +#include "mgl/data.h" +//----------------------------------------------------------------------------- diff --git a/mgl/mgl_data_png.cpp b/src/data_png.cpp similarity index 63% rename from mgl/mgl_data_png.cpp rename to src/data_png.cpp index 4668695..b1479e3 100644 --- a/mgl/mgl_data_png.cpp +++ b/src/data_png.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * mgl_data_png.cpp is part of Math Graphic Library + * data_png.cpp is part of Math Graphic Library * Copyright (C) 2007 Alexey Balakin * * * * This program is free software; you can redistribute it and/or modify * @@ -21,9 +21,7 @@ #ifndef NO_PNG #include #endif -#include "mgl/mgl_data.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" +#include "mgl/data.h" //----------------------------------------------------------------------------- long mgl_col_dif(unsigned char *c1,unsigned char *c2,bool sum) { @@ -39,40 +37,12 @@ unsigned char *mgl_create_scheme(const char *scheme,long &num) unsigned char *c=0,*cc=new unsigned char[3*strlen(scheme)+3]; long nc=1,np=0; register long i,j; + mglColor col; for(i=0;i=v2) return; long num=0; @@ -121,18 +91,18 @@ void mglData::Import(const char *fname,const char *scheme,mreal v1,mreal v2) { long w=png_get_image_width(png_ptr, info_ptr); long h=png_get_image_height(png_ptr, info_ptr); - Create(w,h,1); + d->Create(w,h,1); register long i,j,k; long pos=0,val,mval=256; - for(i=0;iny;i++) for(j=0;jnx;j++) { for(mval=256,k=0;kny-i-1]+3*j,true); if(val==0) { pos=k; break; } if(vala[j+d->nx*i] = v1 + pos*(v2-v1)/num; } } delete []c; @@ -141,15 +111,18 @@ void mglData::Import(const char *fname,const char *scheme,mreal v1,mreal v2) #endif } //----------------------------------------------------------------------------- -void mglData::Export(const char *fname,const char *scheme,mreal v1,mreal v2,int ns) const +void mgl_data_export(HCDT dd, const char *fname, const char *scheme,float v1,float v2,long ns) { - register long i,j,i0,k; + register long i,j,k; + long nx=dd->GetNx(), ny=dd->GetNy(), nz=dd->GetNz(); + mreal vv; if(v1>v2) return; + if(ns<0 || ns>=nz) ns=0; if(v1==v2) { v1 = 1e20; v2=-1e20; for(i=0;iv2) v2=a[i]; } + { vv = dd->vthr(i); if(vvv2) v2=vv; } } if(v1==v2) return; #ifndef NO_PNG @@ -160,14 +133,11 @@ void mglData::Export(const char *fname,const char *scheme,mreal v1,mreal v2,int unsigned char **p = (unsigned char **)malloc(ny*sizeof(unsigned char *)); unsigned char *d = (unsigned char *)malloc(3*nx*ny*sizeof(unsigned char)); for(i=0;i=nz) ns=0; - long dd = nx*ny*ns; for(i=0;iv(j,i,ns)-v1)/(v2-v1)); if(k<0) k=0; if(k>=num) k=num-1; - memcpy(d+3*i0,c+3*k,3*sizeof(unsigned char)); + memcpy(d+3*(j+i*nx),c+3*k,3*sizeof(unsigned char)); } delete []c; @@ -191,23 +161,18 @@ void mglData::Export(const char *fname,const char *scheme,mreal v1,mreal v2,int #endif } //----------------------------------------------------------------------------- -void mgl_data_export(HMDT dat, const char *fname, const char *scheme,mreal v1,mreal v2,int ns) -{ dat->Export(fname,scheme,v1,v2,ns); } -void mgl_data_import(HMDT dat, const char *fname, const char *scheme,mreal v1,mreal v2) -{ dat->Import(fname,scheme,v1,v2); } -//----------------------------------------------------------------------------- -void mgl_data_export_(long* d, const char *fname, const char *scheme, mreal *v1, mreal *v2, int *ns,int l, int n) +void mgl_data_export_(uintptr_t *d, const char *fname, const char *scheme,float *v1,float *v2,int *ns,int l,int n) { char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; char *f=new char[n+1]; memcpy(f,scheme,n); f[n]=0; - _DT_->Export(s,f,*v1,*v2,*ns); + mgl_data_export(_DT_,s,f,*v1,*v2,*ns); delete []s; delete []f; } -void mgl_data_import_(long* d, const char *fname, const char *scheme, mreal *v1, mreal *v2,int l, int n) +void mgl_data_import_(uintptr_t *d, const char *fname, const char *scheme,float *v1,float *v2,int l,int n) { char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; char *f=new char[n+1]; memcpy(f,scheme,n); f[n]=0; - _DT_->Import(s,f,*v1,*v2); + mgl_data_import(_DT_,s,f,*v1,*v2); delete []s; delete []f; } //----------------------------------------------------------------------------- diff --git a/mgl/mgl_def_font.cpp b/src/def_font.cpp similarity index 99% rename from mgl/mgl_def_font.cpp rename to src/def_font.cpp index 547bc85..a853dbe 100644 --- a/mgl/mgl_def_font.cpp +++ b/src/def_font.cpp @@ -17,10 +17,9 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include //# font STIXGeneral.otf has 516 glyphs unsigned mgl_numg=516, mgl_cur=246080; -mreal mgl_fact=50; +float mgl_fact=50; long mgl_gen_fnt[516][6] = { {33, 232, 41, 0, 39, 62042}, {34, 285, 41, 82, 38, 62276}, diff --git a/mgl/mgl_eval.cpp b/src/eval.cpp similarity index 86% rename from mgl/mgl_eval.cpp rename to src/eval.cpp index 22fc89a..a28502d 100644 --- a/mgl/mgl_eval.cpp +++ b/src/eval.cpp @@ -1,697 +1,707 @@ -/*************************************************************************** - * mgl_eval.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 -#include -#include -#ifndef NO_GSL -#include -#include -#include -#endif -#include "mgl/mgl_eval.h" -//----------------------------------------------------------------------------- -// êîíñòàíòû äëÿ ðàñïîçíîâàíèÿ âûðàæåíèÿ -enum{ -EQ_NUM=0, // a variable substitution -EQ_RND, // random number -EQ_A, // numeric constant -// normal functions of 2 arguments -EQ_LT, // comparison xy -EQ_EQ, // comparison x=y -EQ_OR, // comparison x|y -EQ_AND, // comparison x&y -EQ_ADD, // addition x+y -EQ_SUB, // substraction x-y -EQ_MUL, // multiplication x*y -EQ_DIV, // division x/y -EQ_IPOW, // power x^n for integer n -EQ_POW, // power x^y -EQ_MOD, // x modulo y -EQ_LOG, // logarithm of x on base a, log_a(x) = ln(x)/ln(a) -EQ_ARG, // argument of complex number arg(x,y) = atan2(x,y) -// special functions of 2 arguments -EQ_BESJ, // regular cylindrical Bessel function of fractional order -EQ_BESY, // irregular cylindrical Bessel function of fractional order -EQ_BESI, // regular modified Bessel function of fractional order -EQ_BESK, // irregular modified Bessel function of fractional order -EQ_ELE, // elliptic integral E(\phi,k) = \int_0^\phi dt \sqrt((1 - k^2 \sin^2(t))) -EQ_ELF, // elliptic integral F(\phi,k) = \int_0^\phi dt 1/\sqrt((1 - k^2 \sin^2(t))) -EQ_LP, // Legendre polynomial P_l(x), (|x|<=1, l>=0) -EQ_BETA, // beta function B(x,y) = Gamma(x)*Gamma(y)/Gamma(x+y) -// normal functions of 1 argument -EQ_SIN, // sine function \sin(x). !!! MUST BE FIRST 1-PLACE FUNCTION -EQ_COS, // cosine function \cos(x). -EQ_TAN, // tangent function \tan(x). -EQ_ASIN, // inverse sine function \sin(x). -EQ_ACOS, // inverse cosine function \sin(x). -EQ_ATAN, // inverse tangent function \tan(x). -EQ_SINH, // hyperbolic sine function \sin(x). -EQ_COSH, // hyperbolic cosine function \sin(x). -EQ_TANH, // hyperbolic tangent function \tan(x). -EQ_ASINH, // inverse hyperbolic sine function \sin(x). -EQ_ACOSH, // inverse hyperbolic cosine function \sin(x). -EQ_ATANH, // inverse hyperbolic tangent function \tan(x). -EQ_SQRT, // square root function \sqrt(x) -EQ_EXP, // exponential function \exp(x) -EQ_LN, // logarithm of x, ln(x) -EQ_LG, // decimal logarithm of x, lg(x) = ln(x)/ln(10) -EQ_SIGN, // sign of number -EQ_STEP, // step function -EQ_INT, // integer part [x] -EQ_ABS, // absolute value of x -// special functions of 1 argument -EQ_LI2, // dilogarithm for a real argument Li2(x) = - \Re \int_0^x ds \log(1-s)/s. -EQ_ELLE, // complete elliptic integral is denoted by E(k) = E(\pi/2, k). -EQ_ELLK, // complete elliptic integral is denoted by K(k) = F(\pi/2, k). -EQ_AI, // Airy function Ai(x) -EQ_BI, // Airy function Bi(x) -EQ_ERF, // error function erf(x) = (2/\sqrt(\pi)) \int_0^x dt \exp(-t^2). -EQ_EI3, // exponential integral Ei_3(x) = \int_0^x dt \exp(-t^3) for x >= 0. -EQ_EI, // exponential integral Ei(x), Ei(x) := - PV(\int_{-x}^\infty dt \exp(-t)/t), where PV denotes the principal value of the integral. -EQ_E1, // exponential integral E_1(x), E_1(x) := Re \int_1^\infty dt \exp(-xt)/t. -EQ_E2, // exponential integral E_2(x), E_2(x) := Re \int_1^\infty dt \exp(-xt)/t^2. -EQ_SI, // Sine integral Si(x) = \int_0^x dt \sin(t)/t. -EQ_CI, // Cosine integral Ci(x) = \int_0^x dt \cos(t)/t. -EQ_GAMMA, // Gamma function \Gamma(x) = \int_0^\infty dt t^{x-1} \exp(-t) -EQ_PSI, // digamma function \psi(x) = \Gamma'(x)/\Gamma(x) for general x, x \ne 0. -EQ_W0, // principal branch of the Lambert W function, W_0(x). Functions W(x), are defined to be solutions of the equation W\exp(W) = x. -EQ_W1, // secondary mreal-valued branch of the Lambert W function, W_{-1}(x). Functions W(x), are defined to be solutions of the equation W\exp(W) = x. -EQ_SINC, // compute \sinc(x) = \sin(\pi x) / (\pi x) for any value of x. -EQ_ZETA, // Riemann zeta function \zeta(s) = \sum_{k=1}^\infty k^{-s}for arbitrary s, s \ne 1. -EQ_ETA, // eta function \eta(s) = (1-2^{1-s}) \zeta(s) for arbitrary s. -EQ_AID, // Derivative of Airy function Ai(x) -EQ_BID, // Derivative of Airy function Bi(x) -EQ_Z, // Dawson function \exp(-x^2) \int_0^x dt \exp(t^2) -// Jacoby functions of 2 arguments -EQ_SN, // Jacobian elliptic function sn(u|m) // !!! MUST BE FIRST NON 1-PLACE FUNCTION -EQ_SC, // Jacobian elliptic function sn(u|m)/cn(u|m) -EQ_SD, // Jacobian elliptic function sn(u|m)/dn(u|m) -EQ_NS, // Jacobian elliptic function 1/sn(u|m) -EQ_NC, // Jacobian elliptic function 1/cn(u|m) -EQ_ND, // Jacobian elliptic function 1/dn(u|m) -EQ_CN, // Jacobian elliptic function cn(u|m) -EQ_CS, // Jacobian elliptic function cn(u|m)/sn(u|m) -EQ_CD, // Jacobian elliptic function cn(u|m)/dn(u|m) -EQ_DN, // Jacobian elliptic function dn(u|m) -EQ_DS, // Jacobian elliptic function dn(u|m)/sn(u|m) -EQ_DC, // Jacobian elliptic function dn(u|m)/cn(u|m) - // MUST BE LAST ELLIPTIC FUNCTION -// non-ready -EQ_EN, -EQ_CL, // Clausen function -}; -//----------------------------------------------------------------------------- -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif -//----------------------------------------------------------------------------- -#ifndef NO_GSL -gsl_rng *mgl_rng=0; -#endif -void mgl_srnd(long seed) -{ -#ifndef NO_GSL - if(mgl_rng==0) - { - gsl_rng_env_setup(); - mgl_rng = gsl_rng_alloc(gsl_rng_default); - } - gsl_rng_set(mgl_rng, seed); -#else - srand(seed); -#endif -} -double mgl_rnd() -{ -#ifndef NO_GSL - if(mgl_rng==0) - { - gsl_rng_env_setup(); - mgl_rng = gsl_rng_alloc(gsl_rng_default); - gsl_rng_set(mgl_rng, time(0)); - } - return gsl_rng_uniform(mgl_rng); -// gsl_rng_free(r); -#else - return rand()/(RAND_MAX-1.); -#endif -} -//----------------------------------------------------------------------------- -double mgl_ipow(double x,int n); -int mglFormula::Error=0; -bool mglCheck(char *str,int n); -int mglFindInText(char *str,const char *lst); -//----------------------------------------------------------------------------- -void mgl_strtrim(char *str) -{ - char *c = mgl_strdup(str); - unsigned long n=strlen(str); - long k; - for(k=0;k' ') break; - strcpy(c,&(str[k])); - n = strlen(c); - for(k=n-1;k>=0;k--) // óäàëÿåì íà÷àëüíûå ïðîáåëû - if(c[k]>' ') break; - c[k+1] = 0; - strcpy(str,c); free(c); -} -//----------------------------------------------------------------------------- -void mgl_strlwr(char *str) -{ - for(long k=0;k<(long)strlen(str);k++) // óäàëÿåì íà÷àëüíûå ïðîáåëû - str[k] = (str[k]>='A' && str[k]<='Z') ? str[k]+'a'-'A' : str[k]; -} -//----------------------------------------------------------------------------- -// äåñòðóêòîð ôîðìóëû -mglFormula::~mglFormula() -{ - if(Left) delete Left; - if(Right) delete Right; -} -//----------------------------------------------------------------------------- -// êîíñòðóêòîð ôîðìóëû (àâòîìàòè÷åñêè ðàñïîçíàåò è "êîìïèëèðóåò" ôîðìóëó) -mglFormula::mglFormula(const char *string) -{ -#ifndef NO_GSL - gsl_set_error_handler_off(); -#endif - Error=0; - Left=Right=0; - Res=0; Kod=0; - if(!string) { Kod = EQ_NUM; Res = 0; return; } -//printf("%s\n",string); fflush(stdout); - char *str = new char[strlen(string)+1]; - strcpy(str,string); - static char Buf[2048]; - long n,len; - mgl_strtrim(str); - mgl_strlwr(str); - len=strlen(str); - if(str[0]==0) { delete []str; return; } - if(str[0]=='(' && mglCheck(&(str[1]),len-2)) // åñëè âñå âûðàæåíèå â ñêîáàõ, òî óáèðàåì èõ - { - strcpy(Buf,str+1); - len-=2; Buf[len]=0; - strcpy(str,Buf); - } - len=strlen(str); - n=mglFindInText(str,"&|"); // ìåíüøèé ïðèîðèòåò - ñëîæåíèå, âû÷èòàíèå - if(n>=0) - { - if(str[n]=='|') Kod=EQ_OR; else Kod=EQ_AND; - strcpy(Buf,str); Buf[n]=0; - Left=new mglFormula(Buf); - Right=new mglFormula(Buf+n+1); - delete []str; - return; - } - n=mglFindInText(str,"<>="); // ìåíüøèé ïðèîðèòåò - ñëîæåíèå, âû÷èòàíèå - if(n>=0) - { - if(str[n]=='<') Kod=EQ_LT; - else if(str[n]=='>') Kod=EQ_GT; - else Kod=EQ_EQ; - strcpy(Buf,str); Buf[n]=0; - Left=new mglFormula(Buf); - Right=new mglFormula(Buf+n+1); - delete []str; - return; - } - n=mglFindInText(str,"+-"); // ìåíüøèé ïðèîðèòåò - ñëîæåíèå, âû÷èòàíèå - if(n>=0) - { - if(str[n]=='+') Kod=EQ_ADD; else Kod=EQ_SUB; - strcpy(Buf,str); Buf[n]=0; - Left=new mglFormula(Buf); - Right=new mglFormula(Buf+n+1); - delete []str; - return; - } - n=mglFindInText(str,"*/"); // ñðåäíèé ïðèîðèòåò - óìíîæåíèå, äåëåíèå - if(n>=0) - { - if(str[n]=='*') Kod=EQ_MUL; else Kod=EQ_DIV; - strcpy(Buf,str); Buf[n]=0; - Left=new mglFormula(Buf); - Right=new mglFormula(Buf+n+1); - delete []str; - return; - } - n=mglFindInText(str,"^"); // âûñîêèé ïðèîðèòåò - âîçâåäåíèå â ñòåïåíü - if(n>=0) - { - Kod=EQ_IPOW; - strcpy(Buf,str); Buf[n]=0; - Left=new mglFormula(Buf); - Right=new mglFormula(Buf+n+1); - delete []str; - return; - } - - for(n=0;n=len) // ýòî ÷èñëî èëè ïåðåìåííàÿ - { - Kod = EQ_NUM; -// Left = Right = 0; - if(str[1]==0 && str[0]>='a' && str[0]<='z') // äîñòóïíûå ïåðåìííûå - { Kod=EQ_A; Res = str[0]-'a'; } - else if(!strcmp(str,"rnd")) Kod=EQ_RND; - else if(!strcmp(str,"pi")) Res=M_PI; - else Res=atof(str); // ýòî ÷èñëî - } - else - { - char name[128]; - strcpy(name,str); -// strcpy(Buf,str); - name[n]=0; -// len-=n; - memcpy(Buf,&(str[n+1]),len-n); - len=strlen(Buf); - Buf[--len]=0; - if(!strncmp(name,"jacobi_",7)) - memmove(name,name+7,(strlen(name+7)+1)*sizeof(char)); - if(name[0]=='a') - { - if(!strcmp(name+1,"sin")) Kod=EQ_ASIN; - else if(!strcmp(name+1,"cos")) Kod=EQ_ACOS; - else if(!strcmp(name+1,"tan")) Kod=EQ_ATAN; - else if(!strcmp(name+1,"sinh")) Kod=EQ_ASINH; - else if(!strcmp(name+1,"cosh")) Kod=EQ_ACOSH; - else if(!strcmp(name+1,"tanh")) Kod=EQ_ATANH; - else if(!strcmp(name+1,"rg")) Kod=EQ_ARG; - else if(!strcmp(name+1,"bs")) Kod=EQ_ABS; - else if(!strcmp(name+1,"i")) Kod=EQ_AI; - else if(!strcmp(name+1,"iry_ai")) Kod=EQ_AI; - else if(!strcmp(name+1,"iry_bi")) Kod=EQ_BI; - else if(!strcmp(name+1,"iry_dai")) Kod=EQ_AID; - else if(!strcmp(name+1,"iry_dbi")) Kod=EQ_BID; - } - else if(name[0]=='b') - { - if(!strcmp(name+1,"i")) Kod=EQ_BI; - else if(!strcmp(name+1,"essel_j")) Kod=EQ_BESJ; - else if(!strcmp(name+1,"essel_i")) Kod=EQ_BESI; - else if(!strcmp(name+1,"essel_k")) Kod=EQ_BESK; - else if(!strcmp(name+1,"essel_y")) Kod=EQ_BESY; - else if(!strcmp(name+1,"eta")) Kod=EQ_BETA; - } - else if(name[0]=='c') - { - if(!strcmp(name+1,"os")) Kod=EQ_COS; - else if(!strcmp(name+1,"osh")) Kod=EQ_COSH; - else if(!strcmp(name+1,"h")) Kod=EQ_COSH; - else if(!strcmp(name+1,"i")) Kod=EQ_CI; - else if(!strcmp(name+1,"n")) Kod=EQ_CN; - else if(!strcmp(name+1,"s")) Kod=EQ_CS; - else if(!strcmp(name+1,"d")) Kod=EQ_CD; - else if(!strcmp(name+1,"l")) Kod=EQ_CL; - } - else if(name[0]=='d') - { - if(!strcmp(name+1,"n")) Kod=EQ_DN; - else if(!strcmp(name+1,"s")) Kod=EQ_DS; - else if(!strcmp(name+1,"c")) Kod=EQ_DC; - else if(!strcmp(name+1,"ilog")) Kod=EQ_LI2; - } - else if(name[0]=='e') - { - if(!strcmp(name+1,"xp")) Kod=EQ_EXP; - else if(!strcmp(name+1,"rf")) Kod=EQ_ERF; - else if(!strcmp(name+1,"n")) Kod=EQ_EN; - else if(!strcmp(name+1,"e")) Kod=EQ_ELLE; - else if(!strcmp(name+1,"k")) Kod=EQ_ELLK; - else if(name[0]==0) Kod=EQ_ELE; - else if(!strcmp(name+1,"i")) Kod=EQ_EI; - else if(!strcmp(name+1,"1")) Kod=EQ_E1; - else if(!strcmp(name+1,"2")) Kod=EQ_E2; - else if(!strcmp(name+1,"ta")) Kod=EQ_ETA; - else if(!strcmp(name+1,"i3")) Kod=EQ_EI3; - else if(!strcmp(name+1,"lliptic_e")) Kod=EQ_ELE; - else if(!strcmp(name+1,"lliptic_f")) Kod=EQ_ELF; - else if(!strcmp(name+1,"lliptic_ec")) Kod=EQ_ELLE; - else if(!strcmp(name+1,"lliptic_kc")) Kod=EQ_ELLK; - } - else if(name[0]=='l') - { - if(!strcmp(name+1,"og")) Kod=EQ_LOG; - else if(!strcmp(name+1,"g")) Kod=EQ_LG; - else if(!strcmp(name+1,"n")) Kod=EQ_LN; - else if(!strcmp(name+1,"i2")) Kod=EQ_LI2; - else if(!strcmp(name+1,"egendre")) Kod=EQ_LP; - } - else if(name[0]=='s') - { - if(!strcmp(name+1,"qrt")) Kod=EQ_SQRT; - else if(!strcmp(name+1,"in")) Kod=EQ_SIN; - else if(!strcmp(name+1,"tep")) Kod=EQ_STEP; - else if(!strcmp(name+1,"ign")) Kod=EQ_SIGN; - else if(!strcmp(name+1,"inh")) Kod=EQ_SINH; - else if(!strcmp(name+1,"h")) Kod=EQ_SINH; - else if(!strcmp(name+1,"i")) Kod=EQ_SI; - else if(!strcmp(name+1,"n")) Kod=EQ_SN; - else if(!strcmp(name+1,"c")) Kod=EQ_SC; - else if(!strcmp(name+1,"d")) Kod=EQ_SD; - else if(!strcmp(name+1,"inc")) Kod=EQ_SINC; - } - else if(name[0]=='t') - { - if(!strcmp(name+1,"g")) Kod=EQ_TAN; - else if(!strcmp(name+1,"an")) Kod=EQ_TAN; - else if(!strcmp(name+1,"anh")) Kod=EQ_TANH; - else if(!strcmp(name+1,"h")) Kod=EQ_TANH; - } - else if(!strcmp(name,"pow")) Kod=EQ_POW; - else if(!strcmp(name,"mod")) Kod=EQ_MOD; - else if(!strcmp(name,"i")) Kod=EQ_BESI; - else if(!strcmp(name,"int")) Kod=EQ_INT; - else if(!strcmp(name,"j")) Kod=EQ_BESJ; - else if(!strcmp(name,"k")) Kod=EQ_BESK; - else if(!strcmp(name,"y")) Kod=EQ_BESY; - else if(!strcmp(name,"f")) Kod=EQ_ELF; - else if(!strcmp(name,"gamma")) Kod=EQ_GAMMA; - else if(!strcmp(name,"ns")) Kod=EQ_NS; - else if(!strcmp(name,"nc")) Kod=EQ_NC; - else if(!strcmp(name,"nd")) Kod=EQ_ND; - else if(!strcmp(name,"w0")) Kod=EQ_W0; - else if(!strcmp(name,"w1")) Kod=EQ_W1; - else if(!strcmp(name,"psi")) Kod=EQ_PSI; - else if(!strcmp(name,"zeta")) Kod=EQ_ZETA; - else if(!strcmp(name,"z")) Kod=EQ_Z; - else { delete []str; return; } // unknown function - n=mglFindInText(Buf,","); - if(n>=0) - { - Buf[n]=0; - Left=new mglFormula(Buf); - Right=new mglFormula(&(Buf[n+1])); - } - else Left=new mglFormula(Buf); - } - delete []str; -} -//----------------------------------------------------------------------------- -// evaluate formula for 'x'='r', 'y'='n'='v', 't'='z', 'u'='a' variables -mreal mglFormula::Calc(mreal x,mreal y,mreal t,mreal u) const -{ - Error=0; - mreal a1[MGL_VS]; memset(a1,0,MGL_VS*sizeof(mreal)); - a1['a'-'a'] = a1['c'-'a'] = a1['u'-'a'] = u; - a1['x'-'a'] = a1['r'-'a'] = x; - a1['y'-'a'] = a1['n'-'a'] = a1['v'-'a'] = y; - a1['z'-'a'] = a1['t'-'a'] = t; - mreal a = CalcIn(a1); - return isfinite(a) ? a : NAN; -} -//----------------------------------------------------------------------------- -// evaluate formula for 'x'='r', 'y'='n', 't'='z', 'u'='a', 'v'='b', 'w'='c' variables -mreal mglFormula::Calc(mreal x,mreal y,mreal t,mreal u,mreal v,mreal w) const -{ - Error=0; - mreal a1[MGL_VS]; memset(a1,0,MGL_VS*sizeof(mreal)); - a1['c'-'a'] = a1['w'-'a'] = w; - a1['b'-'a'] = a1['v'-'a'] = v; - a1['a'-'a'] = a1['u'-'a'] = u; - a1['x'-'a'] = a1['r'-'a'] = x; - a1['y'-'a'] = a1['n'-'a'] = y; - a1['z'-'a'] = a1['t'-'a'] = t; - mreal a = CalcIn(a1); - return isfinite(a) ? a : NAN; -} -//----------------------------------------------------------------------------- -// evaluate formula for arbitrary set of variables -mreal mglFormula::Calc(const mreal var[MGL_VS]) const -{ - Error=0; - mreal a = CalcIn(var); - return isfinite(a) ? a : NAN; -} -//----------------------------------------------------------------------------- -// evaluate derivate of formula respect to 'diff' variable for arbitrary set of other variables -mreal mglFormula::CalcD(const mreal var[MGL_VS], char diff) const -{ - Error=0; - mreal a = CalcDIn(diff-'a', var); - return isfinite(a) ? a : NAN; -} -//----------------------------------------------------------------------------- -double cand(double a,double b) {return a&&b?1:0;} -double cor(double a,double b) {return a||b?1:0;} -double ceq(double a,double b) {return a==b?1:0;} -double clt(double a,double b) {return ab?1:0;} -double add(double a,double b) {return a+b;} -double sub(double a,double b) {return a-b;} -double mul(double a,double b) {return a&&b?a*b:0;} -double div(double a,double b) {return b?a/b:NAN;} -double ipw(double a,double b) {return mgl_ipow(a,int(b));} -double llg(double a,double b) {return log(a)/log(b);} -#ifndef NO_GSL -double gslEllE(double a,double b) {return gsl_sf_ellint_E(a,b,GSL_PREC_SINGLE);} -double gslEllF(double a,double b) {return gsl_sf_ellint_F(a,b,GSL_PREC_SINGLE);} -double gslLegP(double a,double b) {return gsl_sf_legendre_Pl(int(a),b);} -double gslEllEc(double a) {return gsl_sf_ellint_Ecomp(a,GSL_PREC_SINGLE);} -double gslEllFc(double a) {return gsl_sf_ellint_Kcomp(a,GSL_PREC_SINGLE);} -double gslAi(double a) {return gsl_sf_airy_Ai(a,GSL_PREC_SINGLE);} -double gslBi(double a) {return gsl_sf_airy_Bi(a,GSL_PREC_SINGLE);} -double gslAi_d(double a) {return gsl_sf_airy_Ai_deriv(a,GSL_PREC_SINGLE);} -double gslBi_d(double a) {return gsl_sf_airy_Bi_deriv(a,GSL_PREC_SINGLE);} -#endif -double sgn(double a) {return a<0 ? -1:(a>0?1:0);} -double stp(double a) {return a>0 ? 1:0;} -double arg(double a,double b) { return atan2(b,a); } -double mgz1(double) {return 0;} -double mgz2(double,double) {return 0;} -#ifdef WIN32 -double asinh(double x) { return log(x+sqrt(x*x+1)); } -double acosh(double x) { return x>1 ? log(x+sqrt(x*x-1)) : NAN; } -double atanh(double x) { return fabs(x)<1 ? log((1+x)/(1-x))/2 : NAN; } -#endif -//----------------------------------------------------------------------------- -typedef double (*func_1)(double); -typedef double (*func_2)(double, double); -// evaluation of embedded (included) expressions -mreal mglFormula::CalcIn(const mreal *a1) const -{ - func_2 f2[22] = {clt,cgt,ceq,cor,cand,add,sub,mul,div,ipw,pow,fmod,llg,arg -#ifndef NO_GSL - ,gsl_sf_bessel_Jnu,gsl_sf_bessel_Ynu, - gsl_sf_bessel_Inu,gsl_sf_bessel_Knu, - gslEllE,gslEllF,gslLegP,gsl_sf_beta -#else - ,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2 -#endif - }; - func_1 f1[42] = {sin,cos,tan,asin,acos,atan,sinh,cosh,tanh, - asinh,acosh,atanh,sqrt,exp,log,log10,sgn,stp,floor,fabs -#ifndef NO_GSL - ,gsl_sf_dilog,gslEllEc,gslEllFc,gslAi,gslBi,gsl_sf_erf, - gsl_sf_expint_3,gsl_sf_expint_Ei,gsl_sf_expint_E1,gsl_sf_expint_E2, - gsl_sf_Si,gsl_sf_Ci,gsl_sf_gamma,gsl_sf_psi,gsl_sf_lambert_W0, - gsl_sf_lambert_Wm1,gsl_sf_sinc,gsl_sf_zeta,gsl_sf_eta,gslAi_d,gslBi_d, - gsl_sf_dawson -#else - ,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1, - mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1 -#endif - }; -// if(Error) return 0; - if(KodCalcIn(a1); - if(!isnan(a)) - { - if(KodCalcIn(a1); - return !isnan(b) ? f2[Kod-EQ_LT](a,b) : NAN; - } - else if(KodCalcIn(a1); - if(isnan(b)) return NAN; - gsl_sf_elljac_e(a,b, &sn, &cn, &dn); - switch(Kod) - { - case EQ_SN: return sn; - case EQ_SC: return sn/cn; - case EQ_SD: return sn/dn; - case EQ_CN: return cn; - case EQ_CS: return cn/sn; - case EQ_CD: return cn/dn; - case EQ_DN: return dn; - case EQ_DS: return dn/sn; - case EQ_DC: return dn/cn; - case EQ_NS: return 1./sn; - case EQ_NC: return 1./cn; - case EQ_ND: return 1./dn; - } - } -#endif - } - return NAN; -} -//----------------------------------------------------------------------------- -double mgp(double ,double ) {return 1;} -double mgm(double ,double ) {return -1;} -double mul1(double ,double b) {return b;} -double mul2(double a,double ) {return a;} -double div1(double ,double b) {return b?1/b:NAN;} -double div2(double a,double b) {return b?-a/(b*b):NAN;} -double ipw1(double a,double b) {return int(b)*mgl_ipow(a,int(b-1));} -double pow1(double a,double b) {return b*pow(a,b-1);} -double pow2(double a,double b) {return log(a)*pow(a,b);} -double llg1(double a,double b) {return 1/(a*log(b));} -double llg2(double a,double b) {return -log(a)/(b*log(b)*log(b));} -double cos_d(double a) {return -sin(a);} -double tan_d(double a) {return 1./(cos(a)*cos(a));} -double asin_d(double a) {return 1./sqrt(1-a*a);} -double acos_d(double a) {return -1./sqrt(1-a*a);} -double atan_d(double a) {return 1./(1+a*a);} -double tanh_d(double a) {return 1./(cosh(a)*cosh(a));} -double atanh_d(double a){return 1./(1-a*a);} -double asinh_d(double a){return 1./sqrt(1+a*a);} -double acosh_d(double a){return 1./sqrt(a*a-1);} -double sqrt_d(double a) {return 0.5/sqrt(a);} -double log10_d(double a){return M_LN10/a;} -double log_d(double a) {return 1/a;} -double erf_d(double a) {return 2*exp(-a*a)/sqrt(M_PI);} -double dilog_d(double a){return log(a)/(1-a);} -double ei_d(double a) {return exp(a)/a;} -double si_d(double a) {return a?sin(a)/a:1;} -double ci_d(double a) {return cos(a)/a;} -double exp3_d(double a) {return exp(-a*a*a);} -double e1_d(double a) {return exp(-a)/a;} -double sinc_d(double a) {return a ? (cos(M_PI*a)/a-sin(M_PI*a)/(M_PI*a*a)) : 0;} -#ifndef NO_GSL -double e2_d(double a) {return -gsl_sf_expint_E1(a);} -double gslJnuD(double a,double b) {return 0.5*(gsl_sf_bessel_Jnu(a-1,b)-gsl_sf_bessel_Jnu(a+1,b));} -double gslYnuD(double a,double b) {return 0.5*(gsl_sf_bessel_Ynu(a-1,b)-gsl_sf_bessel_Ynu(a+1,b));} -double gslKnuD(double a,double b) {return -(a*gsl_sf_bessel_Knu(a,b)/b +gsl_sf_bessel_Knu(a-1,b));} -double gslInuD(double a,double b) {return -(a*gsl_sf_bessel_Inu(a,b)/b -gsl_sf_bessel_Inu(a-1,b));} -double gslEllE1(double a,double b) {return sqrt(1-sin(a)*sin(a)*b);} -double gslEllE2(double a,double b) {return (gsl_sf_ellint_E(a,b,GSL_PREC_SINGLE) - gsl_sf_ellint_F(a,b,GSL_PREC_SINGLE))/(2*b);} -double gslEllF1(double a,double b) {return 1./sqrt(1-sin(a)*sin(a)*b);} -double gslEllF2(double a,double b) {return (gsl_sf_ellint_E(a,b,GSL_PREC_SINGLE) - gsl_sf_ellint_F(a,b,GSL_PREC_SINGLE)*(1-b))/(2*b*(1-b)) - sin(2*a)/(sqrt(1-sin(a)*sin(a)*b)*2*(1-b));} -double gslE_d(double a) {return (gsl_sf_ellint_Ecomp(a,GSL_PREC_SINGLE) - gsl_sf_ellint_Kcomp(a,GSL_PREC_SINGLE))/(2*a);} -double gslK_d(double a) {return (gsl_sf_ellint_Ecomp(a,GSL_PREC_SINGLE) - (1-a)*gsl_sf_ellint_Kcomp(a,GSL_PREC_SINGLE))/(2*a*(1-a));} -double gamma_d(double a) {return gsl_sf_psi(a)*gsl_sf_gamma(a);} -#endif -//----------------------------------------------------------------------------- -// evaluation of derivative of embedded (included) expressions -mreal mglFormula::CalcDIn(int id, const mreal *a1) const -{ - func_2 f21[22] = {mgz2,mgz2,mgz2, mgz2,mgz2,mgp, mgp,mul1,div1, ipw1,pow1,mgp,llg1, mgz2// TODO deriv of arg! -#ifndef NO_GSL - ,mgz2,mgz2,mgz2, mgz2,gslEllE1,gslEllF2, mgz2,mgz2 -#else - ,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2 -#endif - }; - func_2 f22[22] = {mgz2,mgz2,mgz2,mgz2,mgz2,mgp,mgm,mul2,div2,mgz2,pow2,mgz2,llg2, mgz2 // TODO deriv of arg! -#ifndef NO_GSL - ,gslJnuD,gslYnuD,gslInuD,gslKnuD,gslEllE2,gslEllF2,mgz2/*gslLegP*/,mgz2 -#else - ,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2 -#endif - }; - func_1 f11[42] = {cos,cos_d,tan_d,asin_d,acos_d,atan_d,cosh,sinh,tanh_d, - asinh_d,acosh_d,atanh_d,sqrt_d,exp,log_d,log10_d,mgz1,mgz1,mgz1,sgn -#ifndef NO_GSL - ,dilog_d,gslE_d,gslK_d,gslAi_d,gslBi_d,erf_d,exp3_d,ei_d,e1_d,e2_d, - si_d,ci_d,gamma_d,gsl_sf_psi_1,mgz1,mgz1,sinc_d,mgz1,mgz1,mgz1,mgz1,mgz1 -#else - ,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1, - mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1 -#endif - }; -// if(Error) return 0; - if(KodCalcIn(a1), d = Left->CalcDIn(id,a1); - if(!isnan(a) && !isnan(d)) - { - if(KodCalcIn(a1); - return !isnan(b) ? f21[Kod-EQ_LT](a,b)*d + f22[Kod-EQ_LT](a,b)*Right->CalcDIn(id,a1) : NAN; - } - else if(KodCalcIn(a1); - if(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 !!! - { - case EQ_SN: return cn*dn*d; - case EQ_SC: return dn*d/(cn*cn); - case EQ_SD: return cn*d/(dn*dn); - case EQ_CN: return -dn*sn*d; - case EQ_CS: return dn*d/(sn*sn); - case EQ_CD: return (b-1)*d*sn/(dn*dn); - case EQ_DN: return -b*d*cn*sn; - case EQ_DS: return -cn*d/(sn*sn); - case EQ_DC: return (1-b)*sn*d/(cn*cn); - case EQ_NS: return -cn*dn*d/(sn*sn); - case EQ_NC: return dn*sn*d/(cn*cn); - case EQ_ND: return b*cn*sn*d/(dn*dn); - } - } -#endif - } - return NAN; -} -//----------------------------------------------------------------------------- -// ïðîâåðêà êîððåêòíîñòè ñêîáîê -bool mglCheck(char *str,int n) -{ - register long s = 0,i; - for(i=0;i=0;i--) - { - if(str[i]=='(') l++; - if(str[i]==')') r++; - if(l==r && strchr(lst,str[i])) return i; - } - return -1; -} -//----------------------------------------------------------------------------- +/*************************************************************************** + * eval.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License 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 +#include +#include +#ifndef NO_GSL +#include +#include +#include +#endif +#include "mgl/eval.h" +//----------------------------------------------------------------------------- +// êîíñòàíòû äëÿ ðàñïîçíîâàíèÿ âûðàæåíèÿ +enum{ +EQ_NUM=0, // a variable substitution +EQ_RND, // random number +EQ_A, // numeric constant +// normal functions of 2 arguments +EQ_LT, // comparison xy +EQ_EQ, // comparison x=y +EQ_OR, // comparison x|y +EQ_AND, // comparison x&y +EQ_ADD, // addition x+y +EQ_SUB, // substraction x-y +EQ_MUL, // multiplication x*y +EQ_DIV, // division x/y +EQ_IPOW, // power x^n for integer n +EQ_POW, // power x^y +EQ_MOD, // x modulo y +EQ_LOG, // logarithm of x on base a, log_a(x) = ln(x)/ln(a) +EQ_ARG, // argument of complex number arg(x,y) = atan2(x,y) +// special functions of 2 arguments +EQ_BESJ, // regular cylindrical Bessel function of fractional order +EQ_BESY, // irregular cylindrical Bessel function of fractional order +EQ_BESI, // regular modified Bessel function of fractional order +EQ_BESK, // irregular modified Bessel function of fractional order +EQ_ELE, // elliptic integral E(\phi,k) = \int_0^\phi dt \sqrt((1 - k^2 \sin^2(t))) +EQ_ELF, // elliptic integral F(\phi,k) = \int_0^\phi dt 1/\sqrt((1 - k^2 \sin^2(t))) +EQ_LP, // Legendre polynomial P_l(x), (|x|<=1, l>=0) +EQ_BETA, // beta function B(x,y) = Gamma(x)*Gamma(y)/Gamma(x+y) +// normal functions of 1 argument +EQ_SIN, // sine function \sin(x). !!! MUST BE FIRST 1-PLACE FUNCTION +EQ_COS, // cosine function \cos(x). +EQ_TAN, // tangent function \tan(x). +EQ_ASIN, // inverse sine function \sin(x). +EQ_ACOS, // inverse cosine function \sin(x). +EQ_ATAN, // inverse tangent function \tan(x). +EQ_SINH, // hyperbolic sine function \sin(x). +EQ_COSH, // hyperbolic cosine function \sin(x). +EQ_TANH, // hyperbolic tangent function \tan(x). +EQ_ASINH, // inverse hyperbolic sine function \sin(x). +EQ_ACOSH, // inverse hyperbolic cosine function \sin(x). +EQ_ATANH, // inverse hyperbolic tangent function \tan(x). +EQ_SQRT, // square root function \sqrt(x) +EQ_EXP, // exponential function \exp(x) +EQ_LN, // logarithm of x, ln(x) +EQ_LG, // decimal logarithm of x, lg(x) = ln(x)/ln(10) +EQ_SIGN, // sign of number +EQ_STEP, // step function +EQ_INT, // integer part [x] +EQ_ABS, // absolute value of x +// special functions of 1 argument +EQ_LI2, // dilogarithm for a real argument Li2(x) = - \Re \int_0^x ds \log(1-s)/s. +EQ_ELLE, // complete elliptic integral is denoted by E(k) = E(\pi/2, k). +EQ_ELLK, // complete elliptic integral is denoted by K(k) = F(\pi/2, k). +EQ_AI, // Airy function Ai(x) +EQ_BI, // Airy function Bi(x) +EQ_ERF, // error function erf(x) = (2/\sqrt(\pi)) \int_0^x dt \exp(-t^2). +EQ_EI3, // exponential integral Ei_3(x) = \int_0^x dt \exp(-t^3) for x >= 0. +EQ_EI, // exponential integral Ei(x), Ei(x) := - PV(\int_{-x}^\infty dt \exp(-t)/t), where PV denotes the principal value of the integral. +EQ_E1, // exponential integral E_1(x), E_1(x) := Re \int_1^\infty dt \exp(-xt)/t. +EQ_E2, // exponential integral E_2(x), E_2(x) := Re \int_1^\infty dt \exp(-xt)/t^2. +EQ_SI, // Sine integral Si(x) = \int_0^x dt \sin(t)/t. +EQ_CI, // Cosine integral Ci(x) = \int_0^x dt \cos(t)/t. +EQ_GAMMA, // Gamma function \Gamma(x) = \int_0^\infty dt t^{x-1} \exp(-t) +EQ_PSI, // digamma function \psi(x) = \Gamma'(x)/\Gamma(x) for general x, x \ne 0. +EQ_W0, // principal branch of the Lambert W function, W_0(x). Functions W(x), are defined to be solutions of the equation W\exp(W) = x. +EQ_W1, // secondary real-valued branch of the Lambert W function, W_{-1}(x). Functions W(x), are defined to be solutions of the equation W\exp(W) = x. +EQ_SINC, // compute \sinc(x) = \sin(\pi x) / (\pi x) for any value of x. +EQ_ZETA, // Riemann zeta function \zeta(s) = \sum_{k=1}^\infty k^{-s}for arbitrary s, s \ne 1. +EQ_ETA, // eta function \eta(s) = (1-2^{1-s}) \zeta(s) for arbitrary s. +EQ_AID, // Derivative of Airy function Ai(x) +EQ_BID, // Derivative of Airy function Bi(x) +EQ_Z, // Dawson function \exp(-x^2) \int_0^x dt \exp(t^2) +// Jacoby functions of 2 arguments +EQ_SN, // Jacobian elliptic function sn(u|m) // !!! MUST BE FIRST NON 1-PLACE FUNCTION +EQ_SC, // Jacobian elliptic function sn(u|m)/cn(u|m) +EQ_SD, // Jacobian elliptic function sn(u|m)/dn(u|m) +EQ_NS, // Jacobian elliptic function 1/sn(u|m) +EQ_NC, // Jacobian elliptic function 1/cn(u|m) +EQ_ND, // Jacobian elliptic function 1/dn(u|m) +EQ_CN, // Jacobian elliptic function cn(u|m) +EQ_CS, // Jacobian elliptic function cn(u|m)/sn(u|m) +EQ_CD, // Jacobian elliptic function cn(u|m)/dn(u|m) +EQ_DN, // Jacobian elliptic function dn(u|m) +EQ_DS, // Jacobian elliptic function dn(u|m)/sn(u|m) +EQ_DC, // Jacobian elliptic function dn(u|m)/cn(u|m) + // MUST BE LAST ELLIPTIC FUNCTION +// non-ready +EQ_EN, +EQ_CL, // Clausen function +}; +//----------------------------------------------------------------------------- +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif +//----------------------------------------------------------------------------- +extern "C"{ +void mgl_srnd(long seed); +double mgl_rnd(); +double mgl_ipow(double x,int n); +} +int mglFormula::Error=0; +bool mglCheck(char *str,int n); +int mglFindInText(char *str,const char *lst); +//----------------------------------------------------------------------------- +#ifndef NO_GSL +gsl_rng *mgl_rng=0; +#endif +void mgl_srnd(long seed) +{ +#ifndef NO_GSL + if(mgl_rng==0) + { + gsl_rng_env_setup(); + mgl_rng = gsl_rng_alloc(gsl_rng_default); + } + gsl_rng_set(mgl_rng, seed); +#else + srand(seed); +#endif +} +double mgl_rnd() +{ +#ifndef NO_GSL + if(mgl_rng==0) + { + gsl_rng_env_setup(); + mgl_rng = gsl_rng_alloc(gsl_rng_default); + gsl_rng_set(mgl_rng, time(0)); + } + return gsl_rng_uniform(mgl_rng); +// gsl_rng_free(r); +#else + return rand()/(RAND_MAX-1.); +#endif +} +//----------------------------------------------------------------------------- +// äåñòðóêòîð ôîðìóëû +mglFormula::~mglFormula() +{ + if(Left) delete Left; + if(Right) delete Right; +} +//----------------------------------------------------------------------------- +// êîíñòðóêòîð ôîðìóëû (àâòîìàòè÷åñêè ðàñïîçíàåò è "êîìïèëèðóåò" ôîðìóëó) +mglFormula::mglFormula(const char *string) +{ +#ifndef NO_GSL + gsl_set_error_handler_off(); +#endif + Error=0; + Left=Right=0; + Res=0; Kod=0; + if(!string) { Kod = EQ_NUM; Res = 0; return; } + char *str = new char[strlen(string)+1]; + strcpy(str,string); + static char Buf[2048]; + long n,len; + mgl_strtrim(str); + mgl_strlwr(str); + len=strlen(str); + if(str[0]==0) { delete []str; return; } + if(str[0]=='(' && mglCheck(&(str[1]),len-2)) // åñëè âñå âûðàæåíèå â ñêîáàõ, òî óáèðàåì èõ + { + strcpy(Buf,str+1); + len-=2; Buf[len]=0; + strcpy(str,Buf); + } + len=strlen(str); + n=mglFindInText(str,"&|"); // ìåíüøèé ïðèîðèòåò - ñëîæåíèå, âû÷èòàíèå + if(n>=0) + { + if(str[n]=='|') Kod=EQ_OR; else Kod=EQ_AND; + strcpy(Buf,str); Buf[n]=0; + Left=new mglFormula(Buf); + Right=new mglFormula(Buf+n+1); + delete []str; + return; + } + n=mglFindInText(str,"<>="); // ìåíüøèé ïðèîðèòåò - ñëîæåíèå, âû÷èòàíèå + if(n>=0) + { + if(str[n]=='<') Kod=EQ_LT; + else if(str[n]=='>') Kod=EQ_GT; + else Kod=EQ_EQ; + strcpy(Buf,str); Buf[n]=0; + Left=new mglFormula(Buf); + Right=new mglFormula(Buf+n+1); + delete []str; + return; + } + n=mglFindInText(str,"+-"); // ìåíüøèé ïðèîðèòåò - ñëîæåíèå, âû÷èòàíèå + if(n>=0) + { + if(str[n]=='+') Kod=EQ_ADD; else Kod=EQ_SUB; + strcpy(Buf,str); Buf[n]=0; + Left=new mglFormula(Buf); + Right=new mglFormula(Buf+n+1); + delete []str; + return; + } + n=mglFindInText(str,"*/"); // ñðåäíèé ïðèîðèòåò - óìíîæåíèå, äåëåíèå + if(n>=0) + { + if(str[n]=='*') Kod=EQ_MUL; else Kod=EQ_DIV; + strcpy(Buf,str); Buf[n]=0; + Left=new mglFormula(Buf); + Right=new mglFormula(Buf+n+1); + delete []str; + return; + } + n=mglFindInText(str,"^"); // âûñîêèé ïðèîðèòåò - âîçâåäåíèå â ñòåïåíü + if(n>=0) + { + Kod=EQ_IPOW; + strcpy(Buf,str); Buf[n]=0; + Left=new mglFormula(Buf); + Right=new mglFormula(Buf+n+1); + delete []str; + return; + } + + for(n=0;n=len) // ýòî ÷èñëî èëè ïåðåìåííàÿ + { + Kod = EQ_NUM; +// Left = Right = 0; + if(str[1]==0 && str[0]>='a' && str[0]<='z') // äîñòóïíûå ïåðåìííûå + { Kod=EQ_A; Res = str[0]-'a'; } + else if(!strcmp(str,"rnd")) Kod=EQ_RND; + else if(!strcmp(str,"pi")) Res=M_PI; + else Res=atof(str); // ýòî ÷èñëî + } + else + { + char name[128]; + strcpy(name,str); +// strcpy(Buf,str); + name[n]=0; +// len-=n; + memcpy(Buf,&(str[n+1]),len-n); + len=strlen(Buf); + Buf[--len]=0; + if(!strncmp(name,"jacobi_",7)) + memmove(name,name+7,(strlen(name+7)+1)*sizeof(char)); + if(name[0]=='a') + { + if(!strcmp(name+1,"sin")) Kod=EQ_ASIN; + else if(!strcmp(name+1,"cos")) Kod=EQ_ACOS; + else if(!strcmp(name+1,"tan")) Kod=EQ_ATAN; + else if(!strcmp(name+1,"sinh")) Kod=EQ_ASINH; + else if(!strcmp(name+1,"cosh")) Kod=EQ_ACOSH; + else if(!strcmp(name+1,"tanh")) Kod=EQ_ATANH; + else if(!strcmp(name+1,"rg")) Kod=EQ_ARG; + else if(!strcmp(name+1,"bs")) Kod=EQ_ABS; + else if(!strcmp(name+1,"i")) Kod=EQ_AI; + else if(!strcmp(name+1,"iry_ai")) Kod=EQ_AI; + else if(!strcmp(name+1,"iry_bi")) Kod=EQ_BI; + else if(!strcmp(name+1,"iry_dai")) Kod=EQ_AID; + else if(!strcmp(name+1,"iry_dbi")) Kod=EQ_BID; + } + else if(name[0]=='b') + { + if(!strcmp(name+1,"i")) Kod=EQ_BI; + else if(!strcmp(name+1,"essel_j")) Kod=EQ_BESJ; + else if(!strcmp(name+1,"essel_i")) Kod=EQ_BESI; + else if(!strcmp(name+1,"essel_k")) Kod=EQ_BESK; + else if(!strcmp(name+1,"essel_y")) Kod=EQ_BESY; + else if(!strcmp(name+1,"eta")) Kod=EQ_BETA; + } + else if(name[0]=='c') + { + if(!strcmp(name+1,"os")) Kod=EQ_COS; + else if(!strcmp(name+1,"osh")) Kod=EQ_COSH; + else if(!strcmp(name+1,"h")) Kod=EQ_COSH; + else if(!strcmp(name+1,"i")) Kod=EQ_CI; + else if(!strcmp(name+1,"n")) Kod=EQ_CN; + else if(!strcmp(name+1,"s")) Kod=EQ_CS; + else if(!strcmp(name+1,"d")) Kod=EQ_CD; + else if(!strcmp(name+1,"l")) Kod=EQ_CL; + } + else if(name[0]=='d') + { + if(!strcmp(name+1,"n")) Kod=EQ_DN; + else if(!strcmp(name+1,"s")) Kod=EQ_DS; + else if(!strcmp(name+1,"c")) Kod=EQ_DC; + else if(!strcmp(name+1,"ilog")) Kod=EQ_LI2; + } + else if(name[0]=='e') + { + if(!strcmp(name+1,"xp")) Kod=EQ_EXP; + else if(!strcmp(name+1,"rf")) Kod=EQ_ERF; + else if(!strcmp(name+1,"n")) Kod=EQ_EN; + else if(!strcmp(name+1,"e")) Kod=EQ_ELLE; + else if(!strcmp(name+1,"k")) Kod=EQ_ELLK; + else if(name[0]==0) Kod=EQ_ELE; + else if(!strcmp(name+1,"i")) Kod=EQ_EI; + else if(!strcmp(name+1,"1")) Kod=EQ_E1; + else if(!strcmp(name+1,"2")) Kod=EQ_E2; + else if(!strcmp(name+1,"ta")) Kod=EQ_ETA; + else if(!strcmp(name+1,"i3")) Kod=EQ_EI3; + else if(!strcmp(name+1,"lliptic_e")) Kod=EQ_ELE; + else if(!strcmp(name+1,"lliptic_f")) Kod=EQ_ELF; + else if(!strcmp(name+1,"lliptic_ec")) Kod=EQ_ELLE; + else if(!strcmp(name+1,"lliptic_kc")) Kod=EQ_ELLK; + } + else if(name[0]=='l') + { + if(!strcmp(name+1,"og")) Kod=EQ_LOG; + else if(!strcmp(name+1,"g")) Kod=EQ_LG; + else if(!strcmp(name+1,"n")) Kod=EQ_LN; + else if(!strcmp(name+1,"i2")) Kod=EQ_LI2; + else if(!strcmp(name+1,"egendre")) Kod=EQ_LP; + } + else if(name[0]=='s') + { + if(!strcmp(name+1,"qrt")) Kod=EQ_SQRT; + else if(!strcmp(name+1,"in")) Kod=EQ_SIN; + else if(!strcmp(name+1,"tep")) Kod=EQ_STEP; + else if(!strcmp(name+1,"ign")) Kod=EQ_SIGN; + else if(!strcmp(name+1,"inh")) Kod=EQ_SINH; + else if(!strcmp(name+1,"h")) Kod=EQ_SINH; + else if(!strcmp(name+1,"i")) Kod=EQ_SI; + else if(!strcmp(name+1,"n")) Kod=EQ_SN; + else if(!strcmp(name+1,"c")) Kod=EQ_SC; + else if(!strcmp(name+1,"d")) Kod=EQ_SD; + else if(!strcmp(name+1,"inc")) Kod=EQ_SINC; + } + else if(name[0]=='t') + { + if(!strcmp(name+1,"g")) Kod=EQ_TAN; + else if(!strcmp(name+1,"an")) Kod=EQ_TAN; + else if(!strcmp(name+1,"anh")) Kod=EQ_TANH; + else if(!strcmp(name+1,"h")) Kod=EQ_TANH; + } + else if(!strcmp(name,"pow")) Kod=EQ_POW; + else if(!strcmp(name,"mod")) Kod=EQ_MOD; + else if(!strcmp(name,"i")) Kod=EQ_BESI; + else if(!strcmp(name,"int")) Kod=EQ_INT; + else if(!strcmp(name,"j")) Kod=EQ_BESJ; + else if(!strcmp(name,"k")) Kod=EQ_BESK; + else if(!strcmp(name,"y")) Kod=EQ_BESY; + else if(!strcmp(name,"f")) Kod=EQ_ELF; + else if(!strcmp(name,"gamma")) Kod=EQ_GAMMA; + else if(!strcmp(name,"ns")) Kod=EQ_NS; + else if(!strcmp(name,"nc")) Kod=EQ_NC; + else if(!strcmp(name,"nd")) Kod=EQ_ND; + else if(!strcmp(name,"w0")) Kod=EQ_W0; + else if(!strcmp(name,"w1")) Kod=EQ_W1; + else if(!strcmp(name,"psi")) Kod=EQ_PSI; + else if(!strcmp(name,"zeta")) Kod=EQ_ZETA; + else if(!strcmp(name,"z")) Kod=EQ_Z; + else { delete []str; return; } // unknown function + n=mglFindInText(Buf,","); + if(n>=0) + { + Buf[n]=0; + Left=new mglFormula(Buf); + Right=new mglFormula(&(Buf[n+1])); + } + else Left=new mglFormula(Buf); + } + delete []str; +} +//----------------------------------------------------------------------------- +// evaluate formula for 'x'='r', 'y'='n'='v', 't'='z', 'u'='a' variables +float mglFormula::Calc(float x,float y,float t,float u) const +{ + Error=0; + float a1[MGL_VS]; memset(a1,0,MGL_VS*sizeof(float)); + a1['a'-'a'] = a1['c'-'a'] = a1['u'-'a'] = u; + a1['x'-'a'] = a1['r'-'a'] = x; + a1['y'-'a'] = a1['n'-'a'] = a1['v'-'a'] = y; + a1['z'-'a'] = a1['t'-'a'] = t; + float a = CalcIn(a1); + return isfinite(a) ? a : NAN; +} +//----------------------------------------------------------------------------- +// evaluate formula for 'x'='r', 'y'='n', 't'='z', 'u'='a', 'v'='b', 'w'='c' variables +float mglFormula::Calc(float x,float y,float t,float u,float v,float w) const +{ + Error=0; + float a1[MGL_VS]; memset(a1,0,MGL_VS*sizeof(float)); + a1['c'-'a'] = a1['w'-'a'] = w; + a1['b'-'a'] = a1['v'-'a'] = v; + a1['a'-'a'] = a1['u'-'a'] = u; + a1['x'-'a'] = a1['r'-'a'] = x; + a1['y'-'a'] = a1['n'-'a'] = y; + a1['z'-'a'] = a1['t'-'a'] = t; + float a = CalcIn(a1); + return isfinite(a) ? a : NAN; +} +//----------------------------------------------------------------------------- +// evaluate formula for arbitrary set of variables +float mglFormula::Calc(const float var[MGL_VS]) const +{ + Error=0; + float a = CalcIn(var); + return isfinite(a) ? a : NAN; +} +//----------------------------------------------------------------------------- +// evaluate formula for 'x'='r', 'y'='n'='v', 't'='z', 'u'='a' variables +float mglFormula::CalcD(char diff,float x,float y,float t,float u) const +{ + Error=0; + float a1[MGL_VS]; memset(a1,0,MGL_VS*sizeof(float)); + a1['a'-'a'] = a1['c'-'a'] = a1['u'-'a'] = u; + a1['x'-'a'] = a1['r'-'a'] = x; + a1['y'-'a'] = a1['n'-'a'] = a1['v'-'a'] = y; + a1['z'-'a'] = a1['t'-'a'] = t; + float a = CalcDIn(diff-'a', a1); + return isfinite(a) ? a : NAN; +} +//----------------------------------------------------------------------------- +// evaluate formula for 'x'='r', 'y'='n', 't'='z', 'u'='a', 'v'='b', 'w'='c' variables +float mglFormula::CalcD(char diff,float x,float y,float t,float u,float v,float w) const +{ + Error=0; + float a1[MGL_VS]; memset(a1,0,MGL_VS*sizeof(float)); + a1['c'-'a'] = a1['w'-'a'] = w; + a1['b'-'a'] = a1['v'-'a'] = v; + a1['a'-'a'] = a1['u'-'a'] = u; + a1['x'-'a'] = a1['r'-'a'] = x; + a1['y'-'a'] = a1['n'-'a'] = y; + a1['z'-'a'] = a1['t'-'a'] = t; + float a = CalcDIn(diff-'a', a1); + return isfinite(a) ? a : NAN; +} +//----------------------------------------------------------------------------- +// evaluate derivate of formula respect to 'diff' variable for arbitrary set of other variables +float mglFormula::CalcD(const float var[MGL_VS], char diff) const +{ + Error=0; + float a = CalcDIn(diff-'a', var); + return isfinite(a) ? a : NAN; +} +//----------------------------------------------------------------------------- +double cand(double a,double b) {return a&&b?1:0;} +double cor(double a,double b) {return a||b?1:0;} +double ceq(double a,double b) {return a==b?1:0;} +double clt(double a,double b) {return ab?1:0;} +double add(double a,double b) {return a+b;} +double sub(double a,double b) {return a-b;} +double mul(double a,double b) {return a&&b?a*b:0;} +double div(double a,double b) {return b?a/b:NAN;} +double ipw(double a,double b) {return mgl_ipow(a,int(b));} +double llg(double a,double b) {return log(a)/log(b);} +#ifndef NO_GSL +double gslEllE(double a,double b) {return gsl_sf_ellint_E(a,b,GSL_PREC_SINGLE);} +double gslEllF(double a,double b) {return gsl_sf_ellint_F(a,b,GSL_PREC_SINGLE);} +double gslLegP(double a,double b) {return gsl_sf_legendre_Pl(int(a),b);} +double gslEllEc(double a) {return gsl_sf_ellint_Ecomp(a,GSL_PREC_SINGLE);} +double gslEllFc(double a) {return gsl_sf_ellint_Kcomp(a,GSL_PREC_SINGLE);} +double gslAi(double a) {return gsl_sf_airy_Ai(a,GSL_PREC_SINGLE);} +double gslBi(double a) {return gsl_sf_airy_Bi(a,GSL_PREC_SINGLE);} +double gslAi_d(double a) {return gsl_sf_airy_Ai_deriv(a,GSL_PREC_SINGLE);} +double gslBi_d(double a) {return gsl_sf_airy_Bi_deriv(a,GSL_PREC_SINGLE);} +#endif +double sgn(double a) {return a<0 ? -1:(a>0?1:0);} +double stp(double a) {return a>0 ? 1:0;} +double arg(double a,double b) { return atan2(b,a); } +double mgz1(double) {return 0;} +double mgz2(double,double) {return 0;} +#ifdef WIN32 +double asinh(double x) { return log(x+sqrt(x*x+1)); } +double acosh(double x) { return x>1 ? log(x+sqrt(x*x-1)) : NAN; } +double atanh(double x) { return fabs(x)<1 ? log((1+x)/(1-x))/2 : NAN; } +#endif +//----------------------------------------------------------------------------- +typedef double (*func_1)(double); +typedef double (*func_2)(double, double); +// evaluation of embedded (included) expressions +float mglFormula::CalcIn(const float *a1) const +{ + func_2 f2[22] = {clt,cgt,ceq,cor,cand,add,sub,mul,div,ipw,pow,fmod,llg,arg +#ifndef NO_GSL + ,gsl_sf_bessel_Jnu,gsl_sf_bessel_Ynu, + gsl_sf_bessel_Inu,gsl_sf_bessel_Knu, + gslEllE,gslEllF,gslLegP,gsl_sf_beta +#else + ,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2 +#endif + }; + func_1 f1[42] = {sin,cos,tan,asin,acos,atan,sinh,cosh,tanh, + asinh,acosh,atanh,sqrt,exp,log,log10,sgn,stp,floor,fabs +#ifndef NO_GSL + ,gsl_sf_dilog,gslEllEc,gslEllFc,gslAi,gslBi,gsl_sf_erf, + gsl_sf_expint_3,gsl_sf_expint_Ei,gsl_sf_expint_E1,gsl_sf_expint_E2, + gsl_sf_Si,gsl_sf_Ci,gsl_sf_gamma,gsl_sf_psi,gsl_sf_lambert_W0, + gsl_sf_lambert_Wm1,gsl_sf_sinc,gsl_sf_zeta,gsl_sf_eta,gslAi_d,gslBi_d, + gsl_sf_dawson +#else + ,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1, + mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1 +#endif + }; +// if(Error) return 0; + if(KodCalcIn(a1); + if(!isnan(a)) + { + if(KodCalcIn(a1); + return !isnan(b) ? f2[Kod-EQ_LT](a,b) : NAN; + } + else if(KodCalcIn(a1); + if(isnan(b)) return NAN; + gsl_sf_elljac_e(a,b, &sn, &cn, &dn); + switch(Kod) + { + case EQ_SN: return sn; + case EQ_SC: return sn/cn; + case EQ_SD: return sn/dn; + case EQ_CN: return cn; + case EQ_CS: return cn/sn; + case EQ_CD: return cn/dn; + case EQ_DN: return dn; + case EQ_DS: return dn/sn; + case EQ_DC: return dn/cn; + case EQ_NS: return 1./sn; + case EQ_NC: return 1./cn; + case EQ_ND: return 1./dn; + } + } +#endif + } + return NAN; +} +//----------------------------------------------------------------------------- +double mgp(double ,double ) {return 1;} +double mgm(double ,double ) {return -1;} +double mul1(double ,double b) {return b;} +double mul2(double a,double ) {return a;} +double div1(double ,double b) {return b?1/b:NAN;} +double div2(double a,double b) {return b?-a/(b*b):NAN;} +double ipw1(double a,double b) {return int(b)*mgl_ipow(a,int(b-1));} +double pow1(double a,double b) {return b*pow(a,b-1);} +double pow2(double a,double b) {return log(a)*pow(a,b);} +double llg1(double a,double b) {return 1/(a*log(b));} +double llg2(double a,double b) {return -log(a)/(b*log(b)*log(b));} +double cos_d(double a) {return -sin(a);} +double tan_d(double a) {return 1./(cos(a)*cos(a));} +double asin_d(double a) {return 1./sqrt(1-a*a);} +double acos_d(double a) {return -1./sqrt(1-a*a);} +double atan_d(double a) {return 1./(1+a*a);} +double tanh_d(double a) {return 1./(cosh(a)*cosh(a));} +double atanh_d(double a){return 1./(1-a*a);} +double asinh_d(double a){return 1./sqrt(1+a*a);} +double acosh_d(double a){return 1./sqrt(a*a-1);} +double sqrt_d(double a) {return 0.5/sqrt(a);} +double log10_d(double a){return M_LN10/a;} +double log_d(double a) {return 1/a;} +double erf_d(double a) {return 2*exp(-a*a)/sqrt(M_PI);} +double dilog_d(double a){return log(a)/(1-a);} +double ei_d(double a) {return exp(a)/a;} +double si_d(double a) {return a?sin(a)/a:1;} +double ci_d(double a) {return cos(a)/a;} +double exp3_d(double a) {return exp(-a*a*a);} +double e1_d(double a) {return exp(-a)/a;} +double sinc_d(double a) {return a ? (cos(M_PI*a)/a-sin(M_PI*a)/(M_PI*a*a)) : 0;} +#ifndef NO_GSL +double e2_d(double a) {return -gsl_sf_expint_E1(a);} +double gslJnuD(double a,double b) {return 0.5*(gsl_sf_bessel_Jnu(a-1,b)-gsl_sf_bessel_Jnu(a+1,b));} +double gslYnuD(double a,double b) {return 0.5*(gsl_sf_bessel_Ynu(a-1,b)-gsl_sf_bessel_Ynu(a+1,b));} +double gslKnuD(double a,double b) {return -(a*gsl_sf_bessel_Knu(a,b)/b +gsl_sf_bessel_Knu(a-1,b));} +double gslInuD(double a,double b) {return -(a*gsl_sf_bessel_Inu(a,b)/b -gsl_sf_bessel_Inu(a-1,b));} +double gslEllE1(double a,double b) {return sqrt(1-sin(a)*sin(a)*b);} +double gslEllE2(double a,double b) {return (gsl_sf_ellint_E(a,b,GSL_PREC_SINGLE) - gsl_sf_ellint_F(a,b,GSL_PREC_SINGLE))/(2*b);} +double gslEllF1(double a,double b) {return 1./sqrt(1-sin(a)*sin(a)*b);} +double gslEllF2(double a,double b) {return (gsl_sf_ellint_E(a,b,GSL_PREC_SINGLE) - gsl_sf_ellint_F(a,b,GSL_PREC_SINGLE)*(1-b))/(2*b*(1-b)) - sin(2*a)/(sqrt(1-sin(a)*sin(a)*b)*2*(1-b));} +double gslE_d(double a) {return (gsl_sf_ellint_Ecomp(a,GSL_PREC_SINGLE) - gsl_sf_ellint_Kcomp(a,GSL_PREC_SINGLE))/(2*a);} +double gslK_d(double a) {return (gsl_sf_ellint_Ecomp(a,GSL_PREC_SINGLE) - (1-a)*gsl_sf_ellint_Kcomp(a,GSL_PREC_SINGLE))/(2*a*(1-a));} +double gamma_d(double a) {return gsl_sf_psi(a)*gsl_sf_gamma(a);} +#endif +//----------------------------------------------------------------------------- +// evaluation of derivative of embedded (included) expressions +float mglFormula::CalcDIn(int id, const float *a1) const +{ + func_2 f21[22] = {mgz2,mgz2,mgz2, mgz2,mgz2,mgp, mgp,mul1,div1, ipw1,pow1,mgp,llg1, mgz2 +#ifndef NO_GSL + ,mgz2,mgz2,mgz2, mgz2,gslEllE1,gslEllF2, mgz2,mgz2 +#else + ,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2 +#endif + }; + func_2 f22[22] = {mgz2,mgz2,mgz2,mgz2,mgz2,mgp,mgm,mul2,div2,mgz2,pow2,mgz2,llg2, mgz2 +#ifndef NO_GSL + ,gslJnuD,gslYnuD,gslInuD,gslKnuD,gslEllE2,gslEllF2,mgz2/*gslLegP*/,mgz2 +#else + ,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2,mgz2 +#endif + }; + func_1 f11[42] = {cos,cos_d,tan_d,asin_d,acos_d,atan_d,cosh,sinh,tanh_d, + asinh_d,acosh_d,atanh_d,sqrt_d,exp,log_d,log10_d,mgz1,mgz1,mgz1,sgn +#ifndef NO_GSL + ,dilog_d,gslE_d,gslK_d,gslAi_d,gslBi_d,erf_d,exp3_d,ei_d,e1_d,e2_d, + si_d,ci_d,gamma_d,gsl_sf_psi_1,mgz1,mgz1,sinc_d,mgz1,mgz1,mgz1,mgz1,mgz1 +#else + ,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1, + mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1,mgz1 +#endif + }; +// if(Error) return 0; + if(KodCalcIn(a1), d = Left->CalcDIn(id,a1); + if(!isnan(a) && !isnan(d)) + { + if(KodCalcIn(a1); + return !isnan(b) ? f21[Kod-EQ_LT](a,b)*d + f22[Kod-EQ_LT](a,b)*Right->CalcDIn(id,a1) : NAN; + } + else if(KodCalcIn(a1); + if(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 !!! + { + case EQ_SN: return cn*dn*d; + case EQ_SC: return dn*d/(cn*cn); + case EQ_SD: return cn*d/(dn*dn); + case EQ_CN: return -dn*sn*d; + case EQ_CS: return dn*d/(sn*sn); + case EQ_CD: return (b-1)*d*sn/(dn*dn); + case EQ_DN: return -b*d*cn*sn; + case EQ_DS: return -cn*d/(sn*sn); + case EQ_DC: return (1-b)*sn*d/(cn*cn); + case EQ_NS: return -cn*dn*d/(sn*sn); + case EQ_NC: return dn*sn*d/(cn*cn); + case EQ_ND: return b*cn*sn*d/(dn*dn); + } + } +#endif + } + return NAN; +} +//----------------------------------------------------------------------------- +// ïðîâåðêà êîððåêòíîñòè ñêîáîê +bool mglCheck(char *str,int n) +{ + register long s = 0,i; + for(i=0;i=0;i--) + { + if(str[i]=='(') l++; + if(str[i]==')') r++; + if(l==r && strchr(lst,str[i])) return i; + } + return -1; +} +//----------------------------------------------------------------------------- diff --git a/mgl/mgl_evalp.cpp b/src/evalp.cpp similarity index 94% rename from mgl/mgl_evalp.cpp rename to src/evalp.cpp index 0aa536b..14113cb 100644 --- a/mgl/mgl_evalp.cpp +++ b/src/evalp.cpp @@ -21,20 +21,19 @@ #include #include #include -#include "mgl/mgl_parse.h" +#include "mgl/parser.h" #ifndef NO_GSL #include #include #endif //----------------------------------------------------------------------------- -double mgl_ipow(double x,int n); void mgl_wcstrim(wchar_t *str); void mgl_wcslwr(wchar_t *str); void mgl_wcstombs(char *dst, const wchar_t *src, int size); int mglFormulaError; -mglData mglFormulaCalc(const wchar_t *string, mglParse *arg); +mglData mglFormulaCalc(const wchar_t *string, mglParser *arg); //----------------------------------------------------------------------------- -mglData mglApplyOper(const wchar_t *a1, const wchar_t *a2, mglParse *arg, double (*func)(double,double)) +mglData mglApplyOper(const wchar_t *a1, const wchar_t *a2, mglParser *arg, double (*func)(double,double)) { const mglData &a = mglFormulaCalc(a1,arg), &b = mglFormulaCalc(a2,arg); long n = mgl_max(a.nx,b.nx), m = mgl_max(a.ny,b.ny), l = mgl_max(a.nz,b.nz); @@ -94,19 +93,28 @@ double mul(double a,double b);// {return a&&b?a*b:0;} double div(double a,double b);// {return b?a/b:NAN;} double ipw(double a,double b);// {return mgl_ipow(a,int(b));} double llg(double a,double b);// {return log(a)/log(b);} -double asinh(double x);// { return log(x+sqrt(x*x+1)); } -double acosh(double x);// { return x>1 ? log(x+sqrt(x*x-1)) : NAN; } -double atanh(double x);// { return fabs(x)<1 ? log((1+x)/(1-x))/2 : NAN; } +//double asinh(double x);// { return log(x+sqrt(x*x+1)); } +//double acosh(double x);// { return x>1 ? log(x+sqrt(x*x-1)) : NAN; } +//double atanh(double x);// { return fabs(x)<1 ? log((1+x)/(1-x))/2 : NAN; } double gslEllE(double a,double b);// {return gsl_sf_ellint_E(a,b,GSL_PREC_SINGLE);} double gslEllF(double a,double b);// {return gsl_sf_ellint_F(a,b,GSL_PREC_SINGLE);} double gslLegP(double a,double b);// {return gsl_sf_legendre_Pl(int(a),b);} //----------------------------------------------------------------------------- +// It seems that standard wcstombs() have a bug. So, I replace by my own. +void mgl_wcstombs(char *dst, const wchar_t *src, int size) +{ + register int j; + for(j=0;j 'x', 0x2 -> 'y', 0x4 -> 'z' // NOTE: the speed is not a goal (mglFormula is faster). It is true interpreter! -mglData mglFormulaCalc(const wchar_t *string, mglParse *arg) +mglData mglFormulaCalc(const wchar_t *string, mglParser *arg) { #ifndef NO_GSL gsl_set_error_handler_off(); @@ -144,11 +152,11 @@ mglData mglFormulaCalc(const wchar_t *string, mglParse *arg) else { if(ar) // res 1d array - { k = res.nx; res.InsertColumns(k); res.Put(a1,k); } + { k = res.nx; res.Insert('x',k); res.Put(a1,k); } else if(mt) // res 2d array - { k = res.ny; res.InsertRows(k); res.Put(a1,-1,k); } + { k = res.ny; res.Insert('y',k); res.Put(a1,-1,k); } else // res 3d array - { k = res.nz; res.InsertSlices(k); res.Put(a1,-1,-1,k); } + { k = res.nz; res.Insert('z',k); res.Put(a1,-1,-1,k); } } j=i+1; } @@ -160,11 +168,11 @@ mglData mglFormulaCalc(const wchar_t *string, mglParse *arg) else { if(ar) // res 1d array - { k = res.nx; res.InsertColumns(k); res.Put(a1,k); } + { k = res.nx; res.Insert('x',k); res.Put(a1,k); } else if(mt) // res 2d array - { k = res.ny; res.InsertRows(k); res.Put(a1,-1,k); } + { k = res.ny; res.Insert('y',k); res.Put(a1,-1,k); } else // res 3d array - { k = res.nz; res.InsertSlices(k); res.Put(a1,-1,-1,k); } + { k = res.nz; res.Insert('z',k); res.Put(a1,-1,-1,k); } } return res; } @@ -225,8 +233,8 @@ mglData mglFormulaCalc(const wchar_t *string, mglParse *arg) mglData d = mglFormulaCalc(Buf, arg); const wchar_t *p=Buf+n+1; if(!wcscmp(p,L"a")) v = d.a[0]; - else if(!wcscmp(p,L"fst")) { int i=-1,j=-1,k=-1; v = d.Find(0,i,j,k); } - else if(!wcscmp(p,L"lst")) { int i=-1,j=-1,k=-1; v = d.Last(0,i,j,k); } + else if(!wcscmp(p,L"fst")) { long i=-1,j=-1,l=-1; v = d.Find(0,i,j,l); } + else if(!wcscmp(p,L"lst")) { long i=-1,j=-1,l=-1; v = d.Last(0,i,j,l); } else if(!wcscmp(p,L"nx")) v=d.nx; else if(!wcscmp(p,L"ny")) v=d.ny; else if(!wcscmp(p,L"nz")) v=d.nz; diff --git a/src/exec.cpp b/src/exec.cpp new file mode 100644 index 0000000..6f8772d --- /dev/null +++ b/src/exec.cpp @@ -0,0 +1,3599 @@ +/*************************************************************************** + * mgl_exec.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#ifdef WIN32 +#include +#include +#else +#include +#endif + +#include "mgl/parser.h" +#define iint(x) floor((x)+0.5) +wchar_t *mgl_str_copy(const char *s); +//----------------------------------------------------------------------------- +int mgls_addlegend(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2 && k[1]==2) gr->AddLegend(a[0].w.c_str(),a[1].s.c_str()); + else return 1; + return 0; +} +void mglc_addlegend(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ if(k[0]==2 && k[1]==2) mglprintf(out,1024,L"gr->AddLegend(\"%s\", \"%s\");",a[0].s.c_str(),a[1].s.c_str()); } +//----------------------------------------------------------------------------- +int mgls_addto(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1) *(a[0].d) += *(a[1].d); + else if(k[0]==1 && k[1]==3) *(a[0].d) += a[1].v; + else return 1; + return 0; +} +void mglc_addto(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1) mglprintf(out,1024,L"%s += %s;",a[0].s.c_str(), a[1].s.c_str()); + else if(k[0]==1 && k[1]==3) mglprintf(out,1024,L"%s += %g;",a[0].s.c_str(), a[1].v); +} +//----------------------------------------------------------------------------- +int mgls_alpha(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + gr->Alpha(k[0]==3 ? a[0].v!=0 : true); return 0; +} +void mglc_alpha(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + mglprintf(out,1024,L"gr->Alpha(%s);",(k[0]==3&&a[0].v!=0)?"true":"false"); +} +//----------------------------------------------------------------------------- +int mgls_alphadef(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) gr->SetAlphaDef(a[0].v); else return 1; + return 0; +} +void mglc_alphadef(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ if(k[0]==3) mglprintf(out,1024,L"gr->SetAlphaDef(%g);",a[0].v); } +//----------------------------------------------------------------------------- +int mgls_ambient(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) gr->SetAmbient(a[0].v); else return 1; + return 0; +} +void mglc_ambient(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ if(k[0]==3) mglprintf(out,1024,L"gr->SetAmbient(%g);",a[0].v); } +//----------------------------------------------------------------------------- +int mgls_area(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Area(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[2]!=1) gr->Area(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else gr->Area(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + return 0; +} +void mglc_area(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Area(%s, \"%s\", \"%s\");",a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else if(k[2]!=1) + mglprintf(out,1024,L"gr->Area(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); + else mglprintf(out,1024,L"gr->Area(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_aspect(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3) gr->Aspect(a[0].v, a[1].v, k[2]==3?a[2].v:1); + else return 1; + return 0; +} +void mglc_aspect(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3) + mglprintf(out,1024,L"gr->Aspect(%g, %g, %g);", a[0].v, a[1].v, k[2]==3?a[2].v:1); +} +//----------------------------------------------------------------------------- +int mgls_axial(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Axial(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) + gr->Axial(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_axial(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Axial(%s, \"%s\", \"%s\");", a[0].s.c_str(),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->Axial(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_axis(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2 && k[1]==2) gr->SetFunc(a[0].s.c_str(),a[1].s.c_str(),k[2]==2?a[2].s.c_str():"",k[3]==2?a[3].s.c_str():""); + else if(k[0]==2) gr->Axis(a[0].s.c_str(), k[1]==3 && a[1].v!=0); + else if(k[0]==3) gr->SetCoor(iint(a[0].v)); + else if(k[0]==0) gr->Axis("xyz"); + else return 1; + return 0; +} +void mglc_axis(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2 && k[1]==2 && k[2]==2) + mglprintf(out,1024,L"gr->SetFunc(\"%s\", \"%s\", \"%s\", \"%s\");", a[0].s.c_str(),a[1].s.c_str(),a[2].s.c_str(),k[2]==2?a[2].s.c_str():"",k[3]==2?a[3].s.c_str():""); + else if(k[0]==2) mglprintf(out,1024,L"gr->Axis(\"%s\");", a[0].s.c_str()); + else if(k[0]==3) mglprintf(out,1024,L"gr->SetCoor(\"%d\");", iint(a[0].v)); + else if(k[0]==0) mglprintf(out,1024,L"gr->Axis(\"xyz\");"); +} +//----------------------------------------------------------------------------- +int mgls_ball(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3) + gr->Mark(mglPoint(a[0].v,a[1].v,a[2].v),k[3]==2 ? a[3].s.c_str():"r."); + else if(k[0]==3 && k[1]==3) + gr->Mark(mglPoint(a[0].v,a[1].v),k[2]==2 ? a[2].s.c_str():"r."); + else return 1; + return 0; +} +void mglc_ball(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3) + mglprintf(out,1024,L"gr->Mark(mglPoint(%g, %g, %g), \"%s\");", a[0].v,a[1].v,a[2].v,k[3]==2 ? a[3].s.c_str():"r."); + else if(k[0]==3 && k[1]==3) + mglprintf(out,1024,L"gr->Mark(mglPoint(%g, %g), \"%s\");", a[0].v, a[1].v, k[2]==2 ? a[2].s.c_str():"r."); +} +//----------------------------------------------------------------------------- +int mgls_box(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + gr->Box(k[0]==2 ? a[0].s.c_str() : "", k[1]!=3 || a[1].v); return 0; +} +void mglc_box(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ mglprintf(out,1024,L"gr->Box(\"%s\", %s);", k[0]==2 ? a[0].s.c_str() : "", k[1]!=3 || a[1].v ? "true":"false"); } +//----------------------------------------------------------------------------- +int mgls_bars(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Bars(*(a[0].d), k[1]==2?a[1].s.c_str():"",opt); + else if(k[2]!=1) gr->Bars(*(a[0].d), *(a[1].d), k[2]==2?a[2].s.c_str():"",opt); + else gr->Bars(*(a[0].d), *(a[1].d), *(a[2].d), k[3]==2?a[3].s.c_str():"",opt); + return 0; +} +void mglc_bars(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Bars(%s, \"%s\", \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else if(k[2]!=1) + mglprintf(out,1024,L"gr->Bars(%s, %s, \"%s\", \"%s\");",a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); + else + mglprintf(out,1024,L"gr->Bars(%s, %s, %s, \"%s\", \"%s\");",a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_barh(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Barh(*(a[0].d), k[1]==2?a[1].s.c_str():"",opt); + else gr->Barh(*(a[0].d), *(a[1].d), k[2]==2?a[2].s.c_str():"",opt); + return 0; +} +void mglc_barh(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Barh(%s, \"%s\", \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else + mglprintf(out,1024,L"gr->Barh(%s, %s, \"%s\", \"%s\");",a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_belt(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Belt(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) gr->Belt(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_belt(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Belt(%s, \"%s\", \"%s\");", a[0].s.c_str(),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->Belt(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_boxs(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Boxs(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) gr->Boxs(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_boxs(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Boxs(%s, \"%s\", \"%s\");", a[0].s.c_str(),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->Boxs(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_beam(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==3) + gr->Beam(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),a[4].v, + k[5]==2? a[5].s.c_str():"",k[6]==3?iint(a[6].v):0, iint(k[7]==3?a[7].v:3)); + else return 1; + return 0; +} +void mglc_beam(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==3) + mglprintf(out,1024,L"gr->Beam(%s, %s, %s, %s, %g, \"%s\", %d, %d);", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].v, k[5]==2? a[5].s.c_str():"",k[6]==3?iint(a[6].v):0, iint(k[7]==3?a[7].v:3)); +} +//----------------------------------------------------------------------------- +int mgls_clearlegend(mglGraph *gr, long , mglArg *, int [10], const char *) +{ gr->ClearLegend(); return 0; } +void mglc_clearlegend(wchar_t out[1024], long , mglArg *, int [10], const char *) +{ mglprintf(out,1024,L"gr->ClearLegend();"); } +//----------------------------------------------------------------------------- +int mgls_clf(mglGraph *gr, long , mglArg *, int [10], const char *) +{ gr->Clf(); return 0; } +void mglc_clf(wchar_t out[1024], long , mglArg *, int [10], const char *) +{ mglprintf(out,1024,L"gr->Clf();"); } +//----------------------------------------------------------------------------- +int mgls_chart(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) gr->Chart(*(a[0].d), k[1]==2?a[1].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_chart(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==3 && k[1]==3) mglprintf(out,1024,L"gr->Chart(%s, \"%s\", \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_cloud(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Cloud(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1) + gr->Cloud(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + return 0; +} +void mglc_cloud(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Cloud(%s,\"%s\", \"%s\");",a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->Cloud(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(),a[1].s.c_str(),a[2].s.c_str(),a[3].s.c_str(),k[4]==2?a[4].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_crange(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) gr->SetRange('c',*(a[0].d),k[1]==3 && a[1].v!=0); + else if(k[0]==3 && k[1]==3) gr->SetRange('c', a[0].v, a[1].v); + else return 1; + return 0; +} +void mglc_crange(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) + mglprintf(out,1024,L"gr->SetRange('c', %s, %s);",a[0].s.c_str(), (k[1]==3 && a[1].v!=0)?"true":"false"); + else if(k[0]==3 && k[1]==3) + mglprintf(out,1024,L"gr->SetRange('c', %g, %g);", a[0].v, a[1].v); +} +//----------------------------------------------------------------------------- +int mgls_crop(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3 && k[2]==3 && k[3]==2) + a[0].d->Crop(iint(a[1].v),iint(a[2].v),a[3].s.c_str()[0]); + else return 1; + return 0; +} +void mglc_crop(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3 && k[2]==3 && k[3]==2) + mglprintf(out,1024,L"%s.Crop(%d, %d, '%c');",a[0].s.c_str(), iint(a[1].v), iint(a[2].v), a[3].s.c_str()[0]); +} +//----------------------------------------------------------------------------- +int mgls_cumsum(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) a[0].d->CumSum(a[1].s.c_str()); + else return 1; + return 0; +} +void mglc_cumsum(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.CumSum(\"%s\");",a[0].s.c_str(), a[1].s.c_str()); } +//----------------------------------------------------------------------------- +int mgls_curve(mglGraph *gr, long n, mglArg *a, int [10], const char *) +{ + register long i; + for(i=0;i<12;i++) if(i>=n || a[i].type!=2) break; + if(i==12) + gr->Curve(mglPoint(a[0].v,a[1].v,a[2].v), + mglPoint(a[3].v,a[4].v,a[5].v), + mglPoint(a[6].v,a[7].v,a[8].v), + mglPoint(a[9].v,a[10].v,a[11].v), + (n>12 && a[12].type==1) ? a[12].s.c_str() : 0); + else if(i==8) + gr->Curve(mglPoint(a[0].v,a[1].v), + mglPoint(a[2].v,a[3].v), + mglPoint(a[4].v,a[5].v), + mglPoint(a[6].v,a[7].v), + (n>8 && a[8].type==1) ? a[8].s.c_str() : 0); + return 0; +} +void mglc_curve(wchar_t out[1024], long n, mglArg *a, int [10], const char *) +{ + register long i; + for(i=0;i<12;i++) if(i>=n || a[i].type!=2) break; + if(i==12) + mglprintf(out,1024,L"gr->Curve(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), \"%s\");", a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, a[5].v, a[6].v, a[7].v, a[8].v, a[9].v, a[10].v, a[11].v, (n>12 && a[12].type==1) ? a[12].s.c_str() : ""); + else if(i==8) + mglprintf(out,1024,L"gr->Curve(mglPoint(%g, %g), mglPoint(%g, %g), mglPoint(%g, %g), mglPoint(%g, %g), \"%s\");", a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, a[5].v, a[6].v, a[7].v, (n>8 && a[8].type==1) ? a[8].s.c_str() : ""); +} +//----------------------------------------------------------------------------- +int mgls_cut(mglGraph *gr, long n, mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && n == 1) gr->SetCut(a[0].v != 0); + else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3) + gr->SetCutBox(mglPoint(a[0].v,a[1].v,a[2].v), mglPoint(a[3].v,a[4].v,a[5].v)); + else if(k[0]==2 && n == 1) gr->CutOff(a[0].s.c_str()); + else return 1; + return 0; +} +void mglc_cut(wchar_t out[1024], long n, mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && n == 1) mglprintf(out,1024,L"gr->SetCut(%s);",(a[0].v != 0)?"true":"false"); + else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3) + mglprintf(out,1024,L"gr->SetCutBox(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g));", a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, a[5].v); + else if(k[0]==2 && n == 1) + mglprintf(out,1024,L"gr->CutOff(\"%s\");", a[0].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_crust(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1) + gr->Crust(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_crust(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->Crust(%s, %s, %s, \"%s\", \"%s\");",a[0].s.c_str(),a[1].s.c_str(),a[2].s.c_str(),k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_colorbar(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3) + gr->Colorbar(a[0].s.c_str(), iint(a[1].v), a[2].v, a[3].v, a[4].v, a[5].v); + else if(k[0]==1) gr->Colorbar(*(a[0].d), k[1]==2 ? a[1].s.c_str():"", k[2]==3 ? iint(a[2].v):0); + else gr->Colorbar(k[0]==2 ? a[0].s.c_str():"", k[1]==3 ? iint(a[1].v):0); + return 0; +} +void mglc_colorbar(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3) + mglprintf(out,1024,L"gr->Colorbar(\"%s\", %d, %g, %g, %g, %g);",a[0].s.c_str(), iint(a[1].v), a[2].v, a[3].v, a[4].v, a[5].v); + else if(k[0]==1) + mglprintf(out,1024,L"gr->Colorbar(%s, \"%s\", %d);",a[0].s.c_str(), k[1]==2 ? a[1].s.c_str():"", k[2]==3 ? iint(a[2].v):0); + else + mglprintf(out,1024,L"gr->Colorbar(\"%s\", %d);",k[0]==2 ? a[0].s.c_str():"", k[1]==3 ? iint(a[1].v):0); +} +//----------------------------------------------------------------------------- +int mgls_copy(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1) + { + a[0].d->Set(*(a[1].d)); + if(k[2]==2 && (k[3]!=3 || a[3].v!=0)) gr->Fill(*(a[0].d), a[2].s.c_str()); + else if(k[2]==2) a[0].d->Modify(a[2].s.c_str()); + } + else if(k[0]==1 && k[1]==2) + { + a[0].d->Create(1,1,1); + a[0].d->a[0] = a[1].v; + } + else return 1; + return 0; +} +void mglc_copy(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==2 && (k[3]!=3 || a[3].v!=0)) + mglprintf(out,1024,L"%s.Set(%s);\tgr->Fill(%s,\"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str()); + else if(k[0]==1 && k[1]==1 && k[2]==2) + mglprintf(out,1024,L"%s.Set(%s);\t%s.Modify(\"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str()); + else if(k[0]==1 && k[1]==1) + mglprintf(out,1024,L"%s.Set(%s);", a[0].s.c_str(), a[1].s.c_str()); + else if(k[0]==1 && k[1]==2) + mglprintf(out,1024,L"%s.Create();\t%s.a[0]=%g;", a[0].s.c_str(), a[0].s.c_str(), a[1].v); +} +//----------------------------------------------------------------------------- +int mgls_cont(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Cont(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]!=1) + gr->Cont(*(a[0].d), *(a[1].d), k[2]==2?a[2].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]!=1) + gr->Cont(*(a[0].d), *(a[1].d), *(a[2].d), k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]!=1) + gr->Cont(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), k[4]==2?a[4].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_cont(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Cont(%s, \"%s\", \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]!=1) + mglprintf(out,1024,L"gr->Cont(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]!=1) + mglprintf(out,1024,L"gr->Cont(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]!=1) + mglprintf(out,1024,L"gr->Cont(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_contf(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) + gr->ContF(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]!=1) + gr->ContF(*(a[0].d), *(a[1].d), k[2]==2?a[2].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]!=1) + gr->ContF(*(a[0].d), *(a[1].d), *(a[2].d), k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]!=1) + gr->ContF(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), k[4]==2?a[4].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_contf(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->ContF(%s, \"%s\", \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]!=1) + mglprintf(out,1024,L"gr->ContF(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]!=1) + mglprintf(out,1024,L"gr->ContF(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]!=1) + mglprintf(out,1024,L"gr->ContF(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_contd(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) + gr->ContD(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]!=1) + gr->ContD(*(a[0].d), *(a[1].d), k[2]==2?a[2].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]!=1) + gr->ContD(*(a[0].d), *(a[1].d), *(a[2].d), k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]!=1) + gr->ContD(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), k[4]==2?a[4].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_contd(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->ContD(%s, \"%s\", \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]!=1) + mglprintf(out,1024,L"gr->ContD(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]!=1) + mglprintf(out,1024,L"gr->ContD(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]!=1) + mglprintf(out,1024,L"gr->ContD(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_cont3(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]==2) + gr->Cont3(*(a[0].d), a[1].s.c_str()[0], k[2]==3?iint(a[2].v):-1, k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1 && k[2]==2) + gr->Cont3(*(a[0].d), *(a[1].d), a[2].s.c_str()[0], k[3]==3?iint(a[3].v):-1, k[4]==2?a[4].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) + gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.c_str()[0], k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2) + gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.c_str()[0], k[6]==3?iint(a[6].v):-1, k[7]==2?a[7].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_cont3(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]==2) + mglprintf(out,1024,L"gr->Cont3(%s, '%c', %d, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str()[0], k[2]==3?iint(a[2].v):-1, k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1 && k[2]==2) + mglprintf(out,1024,L"gr->Cont3(%s, %s, '%c', %d, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str()[0], k[3]==3?iint(a[3].v):-1, k[4]==2?a[4].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) + mglprintf(out,1024,L"gr->Cont3(%s, %s, %s, %s, '%c', %d, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str()[0], k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2) + mglprintf(out,1024,L"gr->Cont3(%s, %s, %s, %s, %s, '%c', %d, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str()[0], k[6]==3?iint(a[6].v):-1, k[7]==2?a[7].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_contf3(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]==2) + gr->ContF3(*(a[0].d), a[1].s.c_str()[0], k[2]==3?iint(a[2].v):-1, k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1 && k[2]==2) + gr->ContF3(*(a[0].d), *(a[1].d), a[2].s.c_str()[0], k[3]==3?iint(a[3].v):-1, k[4]==2?a[4].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) + gr->ContF3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.c_str()[0], k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2) + gr->ContF3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.c_str()[0], k[6]==3?iint(a[6].v):-1, k[7]==2?a[7].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_contf3(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]==2) + mglprintf(out,1024,L"gr->ContF3(%s, '%c', %d, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str()[0], k[2]==3?iint(a[2].v):-1, k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1 && k[2]==2) + mglprintf(out,1024,L"gr->ContF3(%s, %s, '%c', %d, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str()[0], k[3]==3?iint(a[3].v):-1, k[4]==2?a[4].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) + mglprintf(out,1024,L"gr->ContF3(%s, %s, %s, %s, '%c', %d, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str()[0], k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2) + mglprintf(out,1024,L"gr->ContF3(%s, %s, %s, %s, %s, '%c', %d, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str()[0], k[6]==3?iint(a[6].v):-1, k[7]==2?a[7].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_contx(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) gr->ContX(*(a[0].d),k[1]==2?a[1].s.c_str():"",k[2]==3?a[2].v:NAN,opt); + else return 1; + return 0; +} +void mglc_contx(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) + mglprintf(out,1024,L"gr->ContX(%s, \"%s\", %g, \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"", k[2]==3?a[2].v:NAN,opt); +} +//----------------------------------------------------------------------------- +int mgls_contfx(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) gr->ContFX(*(a[0].d),k[1]==2?a[1].s.c_str():"",k[2]==3?a[2].v:NAN,opt); + else return 1; + return 0; +} +void mglc_contfx(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) + mglprintf(out,1024,L"gr->ContFX(%s, \"%s\", %g, \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"", k[2]==3?a[2].v:NAN,opt); +} +//----------------------------------------------------------------------------- +int mgls_conty(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) gr->ContY(*(a[0].d),k[1]==2?a[1].s.c_str():"",k[2]==3?a[2].v:NAN,opt); + else return 1; + return 0; +} +void mglc_conty(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) + mglprintf(out,1024,L"gr->ContY(%s, \"%s\", %g, \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"", k[2]==3?a[2].v:NAN,opt); +} +//----------------------------------------------------------------------------- +int mgls_contfy(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) gr->ContFY(*(a[0].d),k[1]==2?a[1].s.c_str():"",k[2]==3?a[2].v:NAN,opt); + else return 1; + return 0; +} +void mglc_contfy(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) + mglprintf(out,1024,L"gr->ContFY(%s, \"%s\", %g, \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"", k[2]==3?a[2].v:NAN,opt); +} +//----------------------------------------------------------------------------- +int mgls_contz(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) gr->ContZ(*(a[0].d),k[1]==2?a[1].s.c_str():"",k[2]==3?a[2].v:NAN,opt); + else return 1; + return 0; +} +void mglc_contz(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) + mglprintf(out,1024,L"gr->ContZ(%s, \"%s\", %g, \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"", k[2]==3?a[2].v:NAN,opt); +} +//----------------------------------------------------------------------------- +int mgls_contfz(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) gr->ContFZ(*(a[0].d),k[1]==2?a[1].s.c_str():"",k[2]==3?a[2].v:NAN,opt); + else return 1; + return 0; +} +void mglc_contfz(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) + mglprintf(out,1024,L"gr->ContFZ(%s, \"%s\", %g, \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"", k[2]==3?a[2].v:NAN,opt); +} +//----------------------------------------------------------------------------- +int mgls_cone(mglGraph *gr, long , mglArg *a, int [10], const char *) +{ + bool ok=true; + for(int i=0;i<7;i++) if(a[i].type!=2) ok=false; + if(ok) + { + if(a[7].type==2) + gr->Cone(mglPoint(a[0].v,a[1].v,a[2].v), mglPoint(a[3].v,a[4].v,a[5].v), + a[6].v, a[7].v, (a[8].type==1) ? a[8].s.c_str() : 0, (a[9].type==2) ? a[9].v!=0 : false); + else + gr->Cone(mglPoint(a[0].v,a[1].v,a[2].v), mglPoint(a[3].v,a[4].v,a[5].v), + a[6].v, -1, (a[7].type==1) ? a[7].s.c_str() : 0, (a[8].type==2) ? a[8].v!=0 : false); + } + else return 1; + return 0; +} +void mglc_cone(wchar_t out[1024], long , mglArg *a, int [10], const char *) +{ + bool ok=true; + for(int i=0;i<7;i++) if(a[i].type!=2) ok=false; + if(ok) + { + if(a[7].type==2) + mglprintf(out,1024,L"gr->Cone(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), %g, %g, \"%s\", %s);", a[0].v,a[1].v,a[2].v, a[3].v,a[4].v,a[5].v, a[6].v, a[7].v, (a[8].type==2) ? a[8].s.c_str() : "", (a[9].type==2 && a[9].v!=0) ? "true" : "false"); + else + mglprintf(out,1024,L"gr->Cone(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), %g, -1, \"%s\", %s);", a[0].v,a[1].v,a[2].v, a[3].v,a[4].v,a[5].v, a[6].v, (a[7].type==2) ? a[7].s.c_str() : "", (a[8].type==2 && a[8].v!=0)? "true" : "false"); + } +} +//----------------------------------------------------------------------------- +int mgls_ellipse(mglGraph *gr, long , mglArg *a, int [10], const char *) +{ + int i; + for(i=0;i<7;i++) if(a[i].type!=2) + { i--; break; } + if(i==6) + gr->Ellipse(mglPoint(a[0].v,a[1].v,a[2].v), mglPoint(a[3].v,a[4].v,a[5].v), + a[6].v, a[7].type==2?a[7].s.c_str():"r"); + else if(i==4) + gr->Ellipse(mglPoint(a[0].v,a[1].v), mglPoint(a[2].v,a[3].v), + a[4].v, a[5].type==2?a[5].s.c_str():"r"); + else return 1; + return 0; +} +void mglc_ellipse(wchar_t out[1024], long , mglArg *a, int [10], const char *) +{ + int i; + for(i=0;i<7;i++) if(a[i].type!=2) { i--; break; } + if(i==6) + mglprintf(out,1024,L"gr->Ellipse(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), %g, \"%s\");", a[0].v,a[1].v,a[2].v, a[3].v,a[4].v,a[5].v, a[6].v, (a[7].type==2) ? a[7].s.c_str() : "r"); + else if(i==4) + mglprintf(out,1024,L"gr->Ellipse(mglPoint(%g, %g), mglPoint(%g, %g), %g, \"%s\");", a[0].v,a[1].v,a[2].v,a[3].v,a[4].v, (a[5].type==2) ? a[5].s.c_str() : "r"); +} +//----------------------------------------------------------------------------- +int mgls_circle(mglGraph *gr, long , mglArg *a, int [10], const char *) +{ + int i; + for(i=0;i<4;i++) if(a[i].type!=2) { i--; break; } + if(i==3) + gr->Circle(mglPoint(a[0].v,a[1].v,a[2].v), a[3].v, a[4].type==2?a[4].s.c_str():"r"); + else if(i==2) + gr->Circle(mglPoint(a[0].v,a[1].v), a[2].v, a[3].type==2?a[3].s.c_str():"r"); + else return 1; + return 0; +} +void mglc_circle(wchar_t out[1024], long , mglArg *a, int [10], const char *) +{ + int i; + for(i=0;i<4;i++) if(a[i].type!=2) + { i--; break; } + if(i==3) + mglprintf(out,1024,L"gr->Circle(mglPoint(%g, %g, %g), %g, \"%s\");", a[0].v,a[1].v,a[2].v, a[3].v, (a[4].type==2) ? a[4].s.c_str() : "r"); + else if(i==2) + mglprintf(out,1024,L"gr->Circle(mglPoint(%g, %g), %g, \"%s\");", a[0].v,a[1].v, a[2].v, (a[3].type==2) ? a[3].s.c_str() : "r"); +} +//----------------------------------------------------------------------------- +int mgls_rhomb(mglGraph *gr, long , mglArg *a, int [10], const char *) +{ + int i; + for(i=0;i<7;i++) if(a[i].type!=2) + { i--; break; } + if(i==6) + gr->Rhomb(mglPoint(a[0].v,a[1].v,a[2].v), mglPoint(a[3].v,a[4].v,a[5].v), + a[6].v, a[7].type==2?a[7].s.c_str():"r"); + else if(i==4) + gr->Rhomb(mglPoint(a[0].v,a[1].v), mglPoint(a[2].v,a[3].v), + a[4].v, a[5].type==2?a[5].s.c_str():"r"); + else return 1; + return 0; +} +void mglc_rhomb(wchar_t out[1024], long , mglArg *a, int [10], const char *) +{ + int i; + for(i=0;i<7;i++) if(a[i].type!=2) + { i--; break; } + if(i==6) + mglprintf(out,1024,L"gr->Rhomb(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), %g, \"%s\");", a[0].v,a[1].v,a[2].v, a[3].v,a[4].v,a[5].v, a[6].v, (a[7].type==2) ? a[7].s.c_str() : "r"); + else if(i==4) + mglprintf(out,1024,L"gr->Rhomb(mglPoint(%g, %g), mglPoint(%g, %g), %g, \"%s\");", a[0].v,a[1].v,a[2].v, a[3].v,a[4].v, (a[5].type==2) ? a[5].s.c_str() : "r"); +} +//----------------------------------------------------------------------------- +int mgls_dens(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Dens(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]!=1) + gr->Dens(*(a[0].d), *(a[1].d), *(a[2].d), k[3]==2?a[3].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_dens(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Dens(%s,\"%s\", \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]!=1) + mglprintf(out,1024,L"gr->Dens(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_dens3(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]==2) + gr->Dens3(*(a[0].d),a[1].s.c_str()[0],k[2]==3?iint(a[2].v):-1,k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) + gr->Dens3(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),a[4].s.c_str()[0], + k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_dens3(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]==2) + mglprintf(out,1024,L"gr->Dens3(%s, '%c', %d, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str()[0], k[2]==3?iint(a[2].v):-1, k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) + mglprintf(out,1024,L"gr->Dens3(%s, %s, %s, %s, '%c', %d, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str()[0], k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_densx(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) gr->DensX(*(a[0].d),k[1]==2?a[1].s.c_str():"",k[2]==3?a[2].v:NAN,opt); + else return 1; + return 0; +} +void mglc_densx(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) mglprintf(out,1024,L"gr->DensX(%s, \"%s\", %g, \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"", k[2]==3?a[2].v:NAN,opt); +} +//----------------------------------------------------------------------------- +int mgls_densy(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) gr->DensY(*(a[0].d),k[1]==2?a[1].s.c_str():"",k[2]==3?a[2].v:NAN,opt); + else return 1; + return 0; +} +void mglc_densy(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) mglprintf(out,1024,L"gr->DensY(%s, \"%s\", %g, \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"", k[2]==3?a[2].v:NAN,opt); +} +//----------------------------------------------------------------------------- +int mgls_densz(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) gr->DensZ(*(a[0].d),k[1]==2?a[1].s.c_str():"",k[2]==3?a[2].v:NAN,opt); + else return 1; + return 0; +} +void mglc_densz(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) mglprintf(out,1024,L"gr->DensZ(%s, \"%s\", %g, \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"", k[2]==3?a[2].v:NAN,opt); +} +//----------------------------------------------------------------------------- +int mgls_divto(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1) *(a[0].d) /= *(a[1].d); + else if(k[0]==1 && k[1]==3) *(a[0].d) /= a[1].v; + else return 1; + return 0; +} +void mglc_divto(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1) mglprintf(out,1024,L"%s /= %s;",a[0].s.c_str(), a[1].s.c_str()); + else if(k[0]==1 && k[1]==3) mglprintf(out,1024,L"%s /= %g;",a[0].s.c_str(), a[1].v); +} +//----------------------------------------------------------------------------- +int mgls_multo(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1) *(a[0].d) *= *(a[1].d); + else if(k[0]==1 && k[1]==3) *(a[0].d) *= a[1].v; + else return 1; + return 0; +} +void mglc_multo(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1) mglprintf(out,1024,L"%s *= %s;",a[0].s.c_str(), a[1].s.c_str()); + else if(k[0]==1 && k[1]==3) mglprintf(out,1024,L"%s *= %g;",a[0].s.c_str(), a[1].v); +} +//----------------------------------------------------------------------------- +int mgls_subto(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1) *(a[0].d) -= *(a[1].d); + else if(k[0]==1 && k[1]==3) *(a[0].d) -= a[1].v; + else return 1; + return 0; +} +void mglc_subto(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1) mglprintf(out,1024,L"%s -= %s;",a[0].s.c_str(), a[1].s.c_str()); + else if(k[0]==1 && k[1]==3) mglprintf(out,1024,L"%s -= %g;",a[0].s.c_str(), a[1].v); +} +//----------------------------------------------------------------------------- +int mgls_dots(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + gr->Dots(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1) + gr->Dots(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_dots(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->Dots(%s, %s, %s, \"%s\", \"%s\");",a[0].s.c_str(),a[1].s.c_str(),a[2].s.c_str(),k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_diff(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) a[0].d->Diff(a[1].s.c_str()); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + a[0].d->Diff(*(a[1].d), *(a[2].d), *(a[3].d)); + else if(k[0]==1 && k[1]==1 && k[2]==1) + a[0].d->Diff(*(a[1].d), *(a[2].d)); + else return 1; + return 0; +} +void mglc_diff(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Diff(\"%s\");", a[0].s.c_str(), a[1].s.c_str()); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"%s.Diff(%s, %s, %s);", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str()); + else if(k[0]==1 && k[1]==1 && k[2]==1) + mglprintf(out,1024,L"%s.Diff(%s, %s);", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_diff2(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) a[0].d->Diff2(a[1].s.c_str()); + else return 1; + return 0; +} +void mglc_diff2(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Diff2(\"%s\");", a[0].s.c_str(), a[1].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_drop(mglGraph *gr, long n, mglArg *a, int k[10], const char *) +{ + register int i; + for(i=0;i<7;i++) if(k[i]!=3) break; + if(i==7) + gr->Drop(mglPoint(a[0].v,a[1].v,a[2].v), mglPoint(a[3].v,a[4].v,a[5].v), a[6].v, + k[7]==2 ? a[7].s.c_str():"b", k[8]==3 ? a[8].v:1., (n>9 && a[9].type==2) ? a[9].v:1.); + else if(i==5) + gr->Drop(mglPoint(a[0].v,a[1].v), mglPoint(a[2].v,a[3].v), a[4].v, + k[5]==2 ? a[5].s.c_str():"b", k[6]==3 ? a[6].v:1., k[7]==3 ? a[7].v:1.); + else return 1; + return 0; +} +void mglc_drop(wchar_t out[1024], long n, mglArg *a, int k[10], const char *) +{ + register int i; + for(i=0;i<7;i++) if(k[i]!=3) break; + if(i==7) + mglprintf(out,1024,L"gr->Drop(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), %g, \"%s\", %g, %g);", a[0].v,a[1].v,a[2].v, a[3].v,a[4].v,a[5].v, a[6].v, k[7]==2 ? a[7].s.c_str():"b", k[8]==3 ? a[8].v:1., (n>9 && a[9].type==2) ? a[9].v:1.); + else if(i==5) + mglprintf(out,1024,L"gr->Drop(mglPoint(%g, %g), mglPoint(%g, %g), %g, \"%s\", %g, %g);", a[0].v,a[1].v, a[2].v,a[3].v, a[4].v, k[5]==2 ? a[5].s.c_str():"b", k[6]==3 ? a[6].v:1., k[7]==3 ? a[7].v:1.); +} +//----------------------------------------------------------------------------- +int mgls_dew(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + gr->Dew(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1) gr->Dew(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_dew(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->Dew(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1) + mglprintf(out,1024,L"gr->Dew(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_fall(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Fall(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) gr->Fall(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_fall(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Fall(%s, \"%s\", \"%s\");", a[0].s.c_str(),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->Fall(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_mesh(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Mesh(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) gr->Mesh(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_mesh(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Mesh(%s, \"%s\", \"%s\");", a[0].s.c_str(),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->Mesh(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_surf(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Surf(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) gr->Surf(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_surf(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Surf(%s, \"%s\", \"%s\");", a[0].s.c_str(),k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->Surf(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_surfc(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1 || k[1]!=1) return 1; + else if(k[2]!=1) gr->SurfC(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else if(k[2]==1 && k[3]==1) gr->SurfC(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_surfc(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1 || k[1]!=1) return; + else if(k[2]!=1) + mglprintf(out,1024,L"gr->SurfC(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(),a[1].s.c_str(),k[2]==2?a[2].s.c_str():"",opt); + else if(k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->SurfC(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_surfa(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1 || k[1]!=1) return 1; + else if(k[2]!=1) gr->SurfA(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else if(k[2]==1 && k[3]==1) gr->SurfA(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_surfa(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1 || k[1]!=1) return; + else if(k[2]!=1) + mglprintf(out,1024,L"gr->SurfA(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(),a[1].s.c_str(),k[2]==2?a[2].s.c_str():"",opt); + else if(k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->SurfA(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_flow(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + int i; + for(i=0;i<7;i++) if(k[i]!=1) break; + if(i==2) + gr->Flow(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else if(i==4) + gr->Flow(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + else if(i==3) + gr->Flow(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else if(i==6) + gr->Flow(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),k[6]==2?a[6].s.c_str():"",opt); + else if(k[0]==3 && k[1]==3 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1) + gr->FlowP(mglPoint(a[0].v,a[1].v,k[7]==3?a[7].v:NAN), + *(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),k[6]==2?a[6].s.c_str():"",opt); + else if(k[0]==3 && k[1]==3 && k[2]==1 && k[3]==1) + gr->FlowP(mglPoint(a[0].v,a[1].v,k[5]==3?a[5].v:NAN), + *(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==1 && k[4]==1 && k[5]==1 && k[6]==1 && k[7]==1 && k[8]==1) + gr->FlowP(mglPoint(a[0].v,a[1].v,a[2].v), + *(a[3].d),*(a[4].d),*(a[5].d),*(a[6].d),*(a[7].d),*(a[8].d),k[9]==2?a[9].s.c_str():"",opt); + else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==1 && k[4]==1 && k[5]==1) + gr->FlowP(mglPoint(a[0].v,a[1].v,a[2].v), + *(a[3].d),*(a[4].d),*(a[5].d),k[6]==2?a[6].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_flow(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + int i; + for(i=0;i<7;i++) if(k[i]!=1) break; + if(i==2) + mglprintf(out,1024,L"gr->Flow(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); + else if(i==4) + mglprintf(out,1024,L"gr->Flow(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); + else if(i==3) + mglprintf(out,1024,L"gr->Flow(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(i==6) + mglprintf(out,1024,L"gr->Flow(%s, %s, %s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str(), k[6]==2?a[6].s.c_str():"",opt); + else if(k[0]==3 && k[1]==3 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1) + mglprintf(out,1024,L"gr->FlowP(mglPoint(%g,%g,%g), %s, %s, %s, %s, \"%s\", \"%s\");", + a[0].v,a[1].v,k[7]==3?a[7].v:NAN,a[2].s.c_str(),a[3].s.c_str(),a[4].s.c_str(),a[5].s.c_str(),k[6]==2?a[6].s.c_str():"",opt); + else if(k[0]==3 && k[1]==3 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->FlowP(mglPoint(%g,%g,%g), %s, %s, \"%s\", \"%s\");", + a[0].v,a[1].v,k[5]==3?a[5].v:NAN,a[2].s.c_str(),a[3].s.c_str(),k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==1 && k[4]==1 && k[5]==1 && k[6]==1 && k[7]==1 && k[8]==1) + mglprintf(out,1024,L"gr->FlowP(mglPoint(%g,%g,%g), %s, %s, %s, %s, %s, %s, \"%s\", \"%s\");", + a[0].v,a[1].v,a[2].v,a[3].s.c_str(),a[4].s.c_str(),a[5].s.c_str(),a[6].s.c_str(),a[7].s.c_str(),a[8].s.c_str(),k[9]==2?a[9].s.c_str():"",opt); + else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==1 && k[4]==1 && k[5]==1) + mglprintf(out,1024,L"gr->FlowP(mglPoint(%g,%g,%g), %s, %s, %s, \"%s\", \"%s\");", + a[0].v,a[1].v,a[2].v,a[3].s.c_str(),a[4].s.c_str(),a[5].s.c_str(),k[6]==2?a[6].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_grad(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + int i; + for(i=0;i<7;i++) if(k[i]!=1) break; + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + gr->Grad(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d), k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1) + gr->Grad(*(a[0].d),*(a[1].d),*(a[2].d), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1) + gr->Grad(*(a[0].d), k[1]==2?a[1].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_grad(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->Grad(%s, %s, %s, %s, \"%s\", \"%s\");", + a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->Grad(%s, %s, %s, \"%s\", \"%s\");", + a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1) + mglprintf(out,1024,L"gr->Grad(%s, \"%s\", \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_fill(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==2) + { + if(k[2]==1 && a[2].d && k[3]==1 && a[3].d) + gr->Fill(*(a[0].d),a[1].s.c_str(), *(a[2].d), *(a[3].d),opt); + else if(k[2]==1 && a[2].d) + gr->Fill(*(a[0].d),a[1].s.c_str(), *(a[2].d),opt); + else gr->Fill(*(a[0].d),a[1].s.c_str(),opt); + } + else if(k[0]==1 && k[1]==3 && k[2]==3) + a[0].d->Fill(a[1].v,a[2].v,k[3]==2?a[3].s.c_str()[0]:'x'); + else return 1; + return 0; +} +void mglc_fill(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==2) + mglprintf(out,1024,L"gr->Fill(%s,\"%s\", %s, %s, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==1?a[2].s.c_str():"", k[3]==1?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==3 && k[2]==3) + mglprintf(out,1024,L"%s.Fill(%g, %g, '%c');", a[0].s.c_str(), a[1].v,a[2].v, k[3]==2?a[3].s.c_str()[0]:'x'); +} +//----------------------------------------------------------------------------- +int mgls_fillsample(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3 && k[2]==2) a[0].d->FillSample(iint(a[1].v), a[2].s.c_str()); + else return 1; + return 0; +} +void mglc_fillsample(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3 && k[2]==2) + mglprintf(out,1024,L"%s.FillSample(%d, \"%s\");", a[0].s.c_str(), iint(a[1].v), a[2].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_fog(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) gr->Fog(a[0].v,k[1]==3?a[1].v:0.25); + else return 1; + return 0; +} +void mglc_fog(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) mglprintf(out,1024,L"gr->Fog(%g, %g);", a[0].v,k[1]==3?a[1].v:0.25); +} +//----------------------------------------------------------------------------- +int mgls_font(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) + { gr->SetFontDef(a[0].s.c_str()); if(k[1]==3) gr->SetFontSize(a[1].v); } + else return 1; + return 0; +} +void mglc_font(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2 && k[1]==3) + mglprintf(out,1024,L"gr->SetFontDef(\"%s\");\tgr->SetFontSize(%g);", a[0].s.c_str(), a[1].v); + else if(k[0]==2) + mglprintf(out,1024,L"gr->SetFontDef(\"%s\");",a[0].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_loadfont(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2 && a[0].s.c_str()[0]) gr->LoadFont(a[0].s.c_str()); + else gr->RestoreFont(); + return 0; +} +void mglc_loadfont(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2 && a[0].s.c_str()[0]) + mglprintf(out,1024,L"gr->LoadFont(\"%s\");", a[0].s.c_str()); + else + mglprintf(out,1024,L"gr->RestoreFont();"); +} +//----------------------------------------------------------------------------- +int mgls_grid(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + gr->Grid(k[0]==2?a[0].s.c_str():"xyzt", k[1]==2?a[1].s.c_str():"B-"); + return 0; +} +void mglc_grid(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + mglprintf(out,1024,L"gr->Grid(\"%s\", \"%s\");", k[0]==2?a[0].s.c_str():"xyz", k[1]==2?a[1].s.c_str():"B-"); +} +//----------------------------------------------------------------------------- +int mgls_grid2(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]!=1) + gr->Grid(*(a[0].d), *(a[1].d), *(a[2].d), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1) gr->Grid(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_grid2(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]!=1) + mglprintf(out,1024,L"gr->Grid(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1) + mglprintf(out,1024,L"gr->Grid(%s,\"%s\", \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_grid3(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]==2) + gr->Grid3(*(a[0].d),a[1].s.c_str()[0],k[2]==3?iint(a[2].v):-1,k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) + gr->Grid3(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),a[4].s.c_str()[0], + k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_grid3(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]==2) + mglprintf(out,1024,L"gr->Grid3(%s, '%c', %d, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str()[0], k[2]==3?iint(a[2].v):-1, k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) + mglprintf(out,1024,L"gr->Grid3(%s, %s, %s, %s, '%c', %d, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str()[0], k[5]==3?iint(a[5].v):-1, k[6]==2?a[6].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_light(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==0) gr->Light(true); + else if(k[0]!=3) return 1; + else if(k[1]!=3) gr->Light(a[0].v!=0); + else if(k[2]==3 && k[3]==3) + gr->AddLight(iint(a[0].v),mglPoint(a[1].v,a[2].v,a[3].v), + k[4]==2?a[4].s.c_str()[0]:'w',k[5]==3?a[5].v:0.5,true,k[6]==3?a[6].v:0); + else gr->Light(iint(a[0].v),a[1].v!=0); + return 0; +} +void mglc_light(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==0) mglprintf(out,1024,L"gr->Light(true);"); + else if(k[0]!=3) return; + else if(k[1]!=3) mglprintf(out,1024,L"gr->Light(%s);", a[0].v!=0 ? "true":"false"); + else if(k[2]==3 && k[3]==3) + mglprintf(out,1024,L"gr->AddLight(%d, mglPoint(%g, %g, %g), '%c', %g, true, %g);", + iint(a[0].v), a[1].v, a[2].v, a[3].v, k[4]==2?a[4].s.c_str()[0]:'w', k[5]==3?a[5].v:0.5, k[6]==3?a[6].v:0); + else mglprintf(out,1024,L"gr->Light(%d, %s);", iint(a[0].v), a[1].v!=0 ? "true":"false"); +} +//----------------------------------------------------------------------------- +int mgls_line(mglGraph *gr, long n, mglArg *a, int [10], const char *) +{ + int i; + if(n>5) + { + bool ok=true; + for(i=0;i<6;i++) if(a[i].type!=2) ok=false; + if(ok) + gr->Line(mglPoint(a[0].v,a[1].v,a[2].v), + mglPoint(a[3].v,a[4].v,a[5].v), + (n==7 && a[6].type==1) ? a[6].s.c_str() : 0, 100); + else return 1; + } + else if(n>3) + { + bool ok=true; + for(i=0;i<4;i++) if(a[i].type!=2) ok=false; + if(ok) + gr->Line(mglPoint(a[0].v,a[1].v,NAN), mglPoint(a[2].v,a[3].v,NAN), + (n==5 && a[4].type==1) ? a[4].s.c_str() : 0, 100); + else return 1; + } + else return 1; + return 0; +} +void mglc_line(wchar_t out[1024], long n, mglArg *a, int [10], const char *) +{ + int i; + if(n>5) + { + bool ok=true; + for(i=0;i<6;i++) if(a[i].type!=2) ok=false; + if(ok) + mglprintf(out,1024,L"gr->Line(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), \"%s\", 100);", a[0].v,a[1].v,a[2].v, a[3].v,a[4].v,a[5].v, (n==7 && a[6].type==1) ? a[6].s.c_str() : ""); + } + else if(n>3) + { + bool ok=true; + for(i=0;i<4;i++) if(a[i].type!=2) ok=false; + if(ok) + mglprintf(out,1024,L"gr->Line(mglPoint(%g, %g, gr->Min.z), mglPoint(%g, %g, gr->Min.z), \"%s\", 100);", a[0].v,a[1].v,a[2].v, a[3].v, (n==5 && a[4].type==1) ? a[4].s.c_str() : ""); + } +} +//----------------------------------------------------------------------------- +int mgls_legend(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3) + gr->Legend(a[0].v, a[1].v, k[2]==2?a[2].s.c_str():"rL", k[3]==3?a[3].v:-1, k[4]==3?a[4].v:0.1); + else + gr->Legend(k[0]==3?iint(a[0].v):3, k[1]==2?a[1].s.c_str():"rL", k[2]==3?a[2].v:-1, k[3]==3?a[3].v:0.1); + return 0; +} +void mglc_legend(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3) + mglprintf(out,1024,L"gr->Legend(%g, %g, \"%s\", %g, %g);", a[0].v, a[1].v, k[2]==2?a[2].s.c_str():"rL", k[3]==3?a[3].v:-1, k[4]==3?a[4].v:0.1); + else + mglprintf(out,1024,L"gr->Legend(%d, \"%s\", %g, %g);", k[0]==3?iint(a[0].v):3, k[1]==2?a[1].s.c_str():"rL", k[2]==3?a[2].v:-1, k[4]==3?a[4].v:0.1); +} +//----------------------------------------------------------------------------- +int mgls_barwidth(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) gr->SetBarWidth(a[0].v); + else return 1; + return 0; +} +void mglc_barwidth(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) mglprintf(out,1024,L"gr->SetBarWidth(%g);", a[0].v); +} +//----------------------------------------------------------------------------- +int mgls_legendmarks(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) gr->SetLegendMarks(iint(a[0].v)); + else return 1; + return 0; +} +void mglc_legendmarks(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) mglprintf(out,1024,L"gr->SetLegendMarks(%d);", iint(a[0].v)); +} +//----------------------------------------------------------------------------- +int mgls_modify(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) + a[0].d->Modify(a[1].s.c_str(),*(a[2].d),*(a[3].d)); + else if(k[0]==1 && k[1]==2 && k[2]==1) + a[0].d->Modify(a[1].s.c_str(),*(a[2].d)); + else if(k[0]==1 && k[1]==2) + a[0].d->Modify(a[1].s.c_str(), k[2]==3 ? iint(a[2].v):0); + else return 1; + return 0; +} +void mglc_modify(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"%s.Modify(\"%s\", %s, %s);", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str()); + else if(k[0]==1 && k[1]==2 && k[2]==1) + mglprintf(out,1024,L"%s.Modify(\"%s\", %s);", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str()); + else if(k[0]==1 && k[1]==2) + mglprintf(out,1024,L"%s.Modify(\"%s\", %d);", a[0].s.c_str(), a[1].s.c_str(), k[2]==3 ? iint(a[2].v):0); +} +//----------------------------------------------------------------------------- +int mgls_max(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==2) *(a[0].d) = a[1].d->Max(a[2].s.c_str()); + else return 1; + return 0; +} +void mglc_max(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==2) + mglprintf(out,1024,L"%s = %s.Max(\"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_min(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==2) *(a[0].d) = a[1].d->Min(a[2].s.c_str()); + else return 1; + return 0; +} +void mglc_min(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==2) + mglprintf(out,1024,L"%s = %s.Min(\"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_sum(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==2) *(a[0].d) = a[1].d->Sum(a[2].s.c_str()); + else return 1; + return 0; +} +void mglc_sum(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==2) + mglprintf(out,1024,L"%s = %s.Sum(\"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_meshnum(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) gr->SetMeshNum(a[0].v); else return 1; + return 0; +} +void mglc_meshnum(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) mglprintf(out,1024,L"gr->SetMeshNum(%d);", iint(a[0].v)); +} +//----------------------------------------------------------------------------- +int mgls_quality(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) gr->SetQuality(a[0].v); else return 1; + return 0; +} +void mglc_quality(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) mglprintf(out,1024,L"gr->SetQuality(%d);", iint(a[0].v)); +} +//----------------------------------------------------------------------------- +int mgls_marksize(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) gr->SetMarkSize(a[0].v/50); else return 1; + return 0; +} +void mglc_marksize(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) mglprintf(out,1024,L"gr->SetMarkSize(%g);", a[0].v/50); +} +//----------------------------------------------------------------------------- +int mgls_mark(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1 || k[1]!=1) return 1; + else if(k[2]!=1) gr->Mark(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else if(k[3]!=1) gr->Mark(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else gr->Mark(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + return 0; +} +void mglc_mark(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1 || k[1]!=1) return; + else if(k[2]!=1) + mglprintf(out,1024,L"gr->Mark(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); + else if(k[3]!=1) + mglprintf(out,1024,L"gr->Mark(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else + mglprintf(out,1024,L"gr->Mark(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_map(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + gr->Map(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1) + gr->Map(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_map(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->Map(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1) + mglprintf(out,1024,L"gr->Map(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_read(mglGraph *gr, long n, mglArg *a, int k[10], const char *) +{ + bool rr=true; + if(k[0]!=1 || k[1]!=2) return 1; + else if(n==2) rr=a[0].d->Read(a[1].s.c_str()); + else rr=a[0].d->Read(a[1].s.c_str(), k[2]==3?iint(a[2].v):1, + k[3]==3?iint(a[3].v):1, k[4]==3?iint(a[4].v):1); + if(!rr) gr->SetWarn(mglWarnFile); + return 0; +} +void mglc_read(wchar_t out[1024], long n, mglArg *a, int k[10], const char *) +{ + if(k[0]!=1 || k[1]!=2) return; + else if(n==2) mglprintf(out,1024,L"%s.Read(\"%s\");", a[0].s.c_str(), a[1].s.c_str()); + else + mglprintf(out,1024,L"%s.Read(\"%s\", %d, %d, %d);", a[0].s.c_str(), a[1].s.c_str(), k[2]==3?iint(a[2].v):1, k[3]==3?iint(a[3].v):1, k[4]==3?iint(a[4].v):1); +} +//----------------------------------------------------------------------------- +int mgls_readmat(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + bool rr=true; + if(k[0]!=1 || k[1]!=2) return 1; + else rr=a[0].d->ReadMat(a[1].s.c_str(), k[2]==3?iint(a[2].v):2); + if(!rr) gr->SetWarn(mglWarnFile); + return 0; +} +void mglc_readmat(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) + mglprintf(out,1024,L"%s.ReadMat(\"%s\", %d);", a[0].s.c_str(), a[1].s.c_str(), k[2]==3?iint(a[2].v):2); +} +//----------------------------------------------------------------------------- +int mgls_readall(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]!=1 || k[1]!=2) return 1; + else if(k[2]==3 && k[3]==3) + a[0].d->ReadRange(a[1].s.c_str(), a[2].v, a[3].v, k[4]==3?a[4].v:1.f, k[5]==3?(a[5].v!=0) : false); + else a[0].d->ReadAll(a[1].s.c_str(), k[2]==3?(a[2].v!=0) : false); + return 0; +} +void mglc_readall(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]!=1 || k[1]!=2) return; + else if(k[2]==3 && k[3]==3) + mglprintf(out,1024,L"%s.ReadRange(\"%s\", %g, %g, %g, %s);", a[0].s.c_str(), a[1].s.c_str(), a[2].v, a[3].v, k[4]==3?a[4].v:1.f, (k[5]==3&&a[5].v!=0)?"true":"false"); + else + mglprintf(out,1024,L"%s.ReadAll(\"%s\", %s);", a[0].s.c_str(), a[1].s.c_str(), (k[2]==3&&a[2].v!=0)?"true":"false"); +} +//----------------------------------------------------------------------------- +int mgls_readhdf(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==2) a[0].d->ReadHDF(a[1].s.c_str(), a[2].s.c_str()); + else return 1; + return 0; +} +void mglc_readhdf(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==2) mglprintf(out,1024,L"%s.ReadHDF(\"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_savehdf(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==2) a[0].d->SaveHDF(a[1].s.c_str(), a[2].s.c_str()); + else return 1; + return 0; +} +void mglc_savehdf(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==2) + mglprintf(out,1024,L"%s.SaveHDF(\"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_rect(mglGraph *gr, long n, mglArg *a, int [10], const char *) +{ + long i; + if(n>5) + { + bool ok=true; + for(i=0;i<6;i++) if(a[i].type!=2) ok=false; + if(ok) + { + if(a[0].v==a[3].v) gr->Face(mglPoint(a[0].v,a[1].v,a[2].v), + mglPoint(a[0].v,a[4].v,a[2].v), + mglPoint(a[3].v,a[1].v,a[5].v), + mglPoint(a[3].v,a[4].v,a[5].v), + (n==7 && a[6].type==1) ? a[6].s.c_str() : 0); + else gr->Face(mglPoint(a[0].v,a[1].v,a[2].v), + mglPoint(a[0].v,a[4].v,a[5].v), + mglPoint(a[3].v,a[1].v,a[2].v), + mglPoint(a[3].v,a[4].v,a[5].v), + (n==7 && a[6].type==1) ? a[6].s.c_str() : 0); + } + else return 1; + } + else if(n>3) + { + bool ok=true; + for(i=0;i<4;i++) if(a[i].type!=2) ok=false; + if(ok) + gr->Face(mglPoint(a[0].v,a[1].v,NAN), mglPoint(a[0].v,a[3].v,NAN), + mglPoint(a[2].v,a[1].v,NAN), mglPoint(a[2].v,a[3].v,NAN), + (n==5 && a[4].type==1) ? a[4].s.c_str() : 0); + else return 1; + } + else return 1; + return 0; +} +void mglc_rect(wchar_t out[1024], long n, mglArg *a, int [10], const char *) +{ + long i; + if(n>5) + { + bool ok=true; + for(i=0;i<6;i++) if(a[i].type!=2) ok=false; + if(ok) + { + if(a[0].v==a[3].v) + mglprintf(out,1024,L"gr->Face(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), \"%s\");", a[0].v,a[1].v,a[2].v, a[0].v,a[4].v,a[2].v, a[3].v,a[1].v,a[5].v, a[3].v,a[4].v,a[5].v, (n==7 && a[6].type==1) ? a[6].s.c_str() : ""); + else + mglprintf(out,1024,L"gr->Face(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), \"%s\");", a[0].v,a[1].v,a[2].v, a[0].v,a[4].v,a[5].v, a[3].v,a[1].v,a[2].v, a[3].v,a[4].v,a[5].v, (n==7 && a[6].type==1) ? a[6].s.c_str() : ""); + } + } + else if(n>3) + { + bool ok=true; + for(i=0;i<4;i++) if(a[i].type!=2) ok=false; + if(ok) + mglprintf(out,1024,L"gr->Face(mglPoint(%g, %g, NAN), mglPoint(%g, %g, NAN), mglPoint(%g, %g, NAN), mglPoint(%g, %g, NAN), \"%s\", 2);", a[0].v,a[1].v, a[0].v,a[3].v, a[2].v,a[1].v, a[2].v,a[3].v, (n==5 && a[4].type==1) ? a[4].s.c_str() : ""); + } +} +//----------------------------------------------------------------------------- +int mgls_resize(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1) + *(a[0].d) = a[1].d->Resize(k[2]==3?iint(a[2].v):1, + k[3]==3?iint(a[3].v):1, k[4]==3?iint(a[4].v):1); + else return 1; + return 0; +} +void mglc_resize(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1) + mglprintf(out,1024,L"%s = %s.Resize(%d, %d, %d);", a[0].s.c_str(), a[1].s.c_str(), k[2]==3?iint(a[2].v):1, k[3]==3?iint(a[3].v):1, k[4]==3?iint(a[4].v):1); +} +//----------------------------------------------------------------------------- +int mgls_rotate(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) + gr->RotateN(a[0].v, a[1].v, a[2].v, a[3].v); + else if(k[0]==3 && k[1]==3) + gr->Rotate(a[0].v, a[1].v, k[2]==3?a[2].v:0); + else return 1; + return 0; +} +void mglc_rotate(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) + mglprintf(out,1024,L"gr->RotateN(%g, %g, %g, %g);", a[0].v, a[1].v, a[2].v, a[3].v); + else if(k[0]==3 && k[1]==3) + mglprintf(out,1024,L"gr->Rotate(%g, %g, %g);", a[0].v, a[1].v, k[2]==3?a[2].v:0); +} +//----------------------------------------------------------------------------- +int mgls_rotatetext(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) gr->SetRotatedText(a[0].v!=0); + else return 1; + return 0; +} +void mglc_rotatetext(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) mglprintf(out,1024,L"gr->SetRotatedText(%s);", (a[0].v!=0)?"true":"false"); +} +//----------------------------------------------------------------------------- +int mgls_save(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) a[0].d->Save(a[1].s.c_str()); + else return 1; + return 0; +} +void mglc_save(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Save(\"%s\");", a[0].s.c_str(), a[1].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_smooth(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) a[0].d->Smooth(k[1]==2?a[1].s.c_str():"xyz"); + else return 1; + return 0; +} +void mglc_smooth(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) + mglprintf(out,1024,L"%s.Smooth(\"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"xyz"); +} +//----------------------------------------------------------------------------- +int mgls_swap(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) a[0].d->Swap(a[1].s.c_str()); + else return 1; + return 0; +} +void mglc_swap(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Swap(\"%s\");", a[0].s.c_str(), a[1].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_idset(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) a[0].d->SetColumnId(a[1].s.c_str()); + else return 1; + return 0; +} +void mglc_idset(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.SetColumnId(\"%s\");", a[0].s.c_str(), a[1].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_stem(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Stem(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[2]!=1) gr->Stem(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else gr->Stem(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + return 0; +} +void mglc_stem(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Stem(%s, \"%s\", \"%s\");",a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else if(k[2]!=1) + mglprintf(out,1024,L"gr->Stem(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); + else mglprintf(out,1024,L"gr->Stem(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_step(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Step(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[2]!=1) gr->Step(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else gr->Step(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + return 0; +} +void mglc_step(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Step(%s, \"%s\", \"%s\");",a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else if(k[2]!=1) + mglprintf(out,1024,L"gr->Step(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); + else mglprintf(out,1024,L"gr->Step(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_plot(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Plot(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[2]!=1) gr->Plot(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else gr->Plot(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + return 0; +} +void mglc_plot(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Plot(%s, \"%s\", \"%s\");",a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else if(k[2]!=1) + mglprintf(out,1024,L"gr->Plot(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); + else mglprintf(out,1024,L"gr->Plot(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_boxplot(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->BoxPlot(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + else if(k[2]!=1) gr->BoxPlot(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + return 0; +} +void mglc_boxplot(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->BoxPlot(%s, \"%s\", \"%s\");",a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else if(k[2]!=1) + mglprintf(out,1024,L"gr->BoxPlot(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_candle(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) + gr->Candle(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),k[5]==2?a[5].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1) + gr->Candle(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) + gr->Candle(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1) + gr->Candle(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else + gr->Candle(*(a[0].d),k[1]==2?a[1].s.c_str():"",opt); + return 0; +} +void mglc_candle(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) + mglprintf(out,1024,L"gr->Candle(%s, %s, %s, %s, %s, \"%s\", \"%s\");",a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), k[5]==2?a[5].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->Candle(%s, %s, %s, %s, \"%s\", \"%s\");",a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(),k[4]==2?a[4].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->Candle(%s, %s, %s, \"%s\", \"%s\");",a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[1]==1) + mglprintf(out,1024,L"gr->Candle(%s, %s, \"%s\", \"%s\");",a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"", opt); + else + mglprintf(out,1024,L"gr->Candle(%s, \"%s\", \"%s\");",a[0].s.c_str(), k[1]==2?a[1].s.c_str():"", opt); +} +//----------------------------------------------------------------------------- +int mgls_radar(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) gr->Radar(*(a[0].d), k[1]==2?a[1].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_radar(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1) + mglprintf(out,1024,L"gr->Radar(%s, \"%s\", \"%s\");",a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_squeeze(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3) + a[0].d->Squeeze(iint(a[1].v), k[2]==3?iint(a[2].v):1, k[3]==3?iint(a[3].v):1, k[4]==3 && a[4].v>0); + else return 1; + return 0; +} +void mglc_squeeze(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3) + mglprintf(out,1024,L"%s.Squeeze(%d, %d, %d, %s);", a[0].s.c_str(), iint(a[1].v), + k[2]==3?iint(a[2].v):1, k[3]==3?iint(a[3].v):1, k[4]==3 && a[4].v>0 ? "true":"false"); +} +//----------------------------------------------------------------------------- +int mgls_stfad(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==3) + *(a[0].d) = mglSTFA(*(a[1].d),*(a[2].d), iint(a[3].v), k[4]==2?a[4].s.c_str()[0]:'x'); + else return 1; + return 0; +} +void mglc_stfad(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==3) + mglprintf(out,1024,L"%s = mglSTFA(%s, %s, %d, '%c');", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), iint(a[3].v), k[4]==2?a[4].s.c_str()[0]:'x'); +} +//----------------------------------------------------------------------------- +int mgls_setsize(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && a[1].v>1 && a[0].v>1) + gr->SetSize(iint(a[0].v), iint(a[1].v)); + else return 1; + return 0; +} +void mglc_setsize(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && a[1].v>1 && a[0].v>1) + mglprintf(out,1024,L"gr->SetSize(%d, %d);", iint(a[0].v), iint(a[1].v)); +} +//----------------------------------------------------------------------------- +int mgls_sphere(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + int i; + for(i=0;i<7;i++) if(k[i]!=3) break; + if(i==4) + gr->Sphere(mglPoint(a[0].v,a[1].v,a[2].v), a[3].v, k[4]==2 ? a[4].s.c_str():"r"); + else if(i==3) + gr->Sphere(mglPoint(a[0].v,a[1].v), a[2].v, k[3]==2 ? a[3].s.c_str():"r"); + else return 1; + return 0; +} +void mglc_sphere(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + int i; + for(i=0;i<7;i++) if(k[i]!=3) break; + if(i==4) + mglprintf(out,1024,L"gr->Sphere(mglPoint(%g, %g, %g), %g, \"%s\");", a[0].v,a[1].v,a[2].v, a[3].v, k[4]==2 ? a[4].s.c_str():"r"); + else if(i==3) + mglprintf(out,1024,L"gr->Sphere(mglPoint(%g, %g), %g, \"%s\");", a[0].v,a[1].v, a[2].v, k[3]==2 ? a[3].s.c_str():"r"); +} +//----------------------------------------------------------------------------- +int mgls_stfa(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==3) + gr->STFA(*(a[0].d),*(a[1].d), iint(a[2].v), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==3) + gr->STFA(*(a[0].d),*(a[1].d), *(a[2].d),*(a[3].d), iint(a[4].v), k[5]==2?a[5].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_stfa(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==3) + mglprintf(out,1024,L"gr->STFA(%s, %s, %d, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), iint(a[2].v), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==3) + mglprintf(out,1024,L"gr->STFA(%s, %s, %s, %s, %d, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), iint(a[4].v), k[5]==2?a[5].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_surf3(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]==0) gr->Surf3(*(a[0].d),opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==3) + gr->Surf3(a[4].v,*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d), + k[5]==2? a[5].s.c_str():"",opt); + else if(k[1]==3) gr->Surf3(a[1].v,*(a[0].d),k[2]==2? a[2].s.c_str():"",opt); + else if(k[1]==2) gr->Surf3(*(a[0].d),a[1].s.c_str(),opt); + else if(k[1]==1 && k[2]==1 && k[3]==1) + gr->Surf3(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d), k[4]==2? a[4].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_surf3(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]==0) mglprintf(out,1024,L"gr->Surf3(%s,\"\",\"%s\");", a[0].s.c_str(),opt); + else if(k[1]==1 && k[2]==1 && k[3]==1 && k[4]==3) + mglprintf(out,1024,L"gr->Surf3(%g, %s, %s, %s, %s, \"%s\", \"%s\");", a[4].v, a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[5]==2?a[5].s.c_str():"",opt); + else if(k[1]==3) + mglprintf(out,1024,L"gr->Surf3(%g, %s, \"%s\", \"%s\");", a[1].v, a[0].s.c_str(), k[2]==2? a[2].s.c_str():"",opt); + else if(k[1]==2) + mglprintf(out,1024,L"gr->Surf3(%s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(),opt); + else if(k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->Surf3(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_surf3c(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1 || k[1]!=1) return 1; + else if(k[2]==0) gr->Surf3C(*(a[0].d),*(a[1].d),opt); + else if(k[2]==1 && k[3]==1 && k[4]==1 && k[5]==3) + gr->Surf3C(a[5].v,*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d), + k[6]==2? a[6].s.c_str():"",opt); + else if(k[2]==3) gr->Surf3C(a[2].v,*(a[0].d),*(a[1].d),k[3]==2? a[3].s.c_str():"",opt); + else if(k[2]==2) gr->Surf3C(*(a[0].d),*(a[1].d),a[2].s.c_str(),opt); + else if(k[2]==1 && k[3]==1 && k[4]==1) + gr->Surf3C(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d), k[5]==2? a[5].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_surf3c(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1 || k[1]!=1) return; + else if(k[2]==0) mglprintf(out,1024,L"gr->Surf3C(%s, %s, \"\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(),opt); + else if(k[2]==1 && k[3]==1 && k[4]==1 && k[5]==3) + mglprintf(out,1024,L"gr->Surf3C(%g, %s, %s, %s, %s, %s, \"%s\", \"%s\");", a[5].v, a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), k[6]==2? a[6].s.c_str():"",opt); + else if(k[2]==3) + mglprintf(out,1024,L"gr->Surf3C(%g, %s, %s, \"%s\", \"%s\");", a[2].v, a[0].s.c_str(), a[1].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[2]==2) + mglprintf(out,1024,L"gr->Surf3C(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(),opt); + else if(k[2]==1 && k[3]==1 && k[4]==1) + mglprintf(out,1024,L"gr->Surf3C(%s, %s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), k[5]==2?a[5].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_surf3a(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1 || k[1]!=1) return 1; + else if(k[2]==0) gr->Surf3A(*(a[0].d),*(a[1].d),opt); + else if(k[2]==1 && k[3]==1 && k[4]==1 && k[5]==3) + gr->Surf3A(a[5].v,*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d), + k[6]==2? a[6].s.c_str():"",opt); + else if(k[2]==3) gr->Surf3A(a[2].v,*(a[0].d),*(a[1].d),k[3]==2? a[3].s.c_str():"",opt); + else if(k[2]==2) gr->Surf3A(*(a[0].d),*(a[1].d),a[2].s.c_str(),opt); + else if(k[2]==1 && k[3]==1 && k[4]==1) + gr->Surf3A(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d), + k[5]==2? a[5].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_surf3a(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1 || k[1]!=1) return; + else if(k[2]==0) mglprintf(out,1024,L"gr->Surf3A(%s, %s, \"\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(),opt); + else if(k[2]==1 && k[3]==1 && k[4]==1 && k[5]==3) + mglprintf(out,1024,L"gr->Surf3A(%g, %s, %s, %s, %s, %s, \"%s\", \"%s\");", a[5].v, a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), k[6]==2? a[6].s.c_str():"",opt); + else if(k[2]==3) + mglprintf(out,1024,L"gr->Surf3A(%g, %s, %s, \"%s\", \"%s\");", a[2].v, a[0].s.c_str(), a[1].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[2]==2) + mglprintf(out,1024,L"gr->Surf3A(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(),opt); + else if(k[2]==1 && k[3]==1 && k[4]==1) + mglprintf(out,1024,L"gr->Surf3A(%s, %s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), k[5]==2?a[5].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_subplot(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==2) + gr->SubPlot(iint(a[0].v), iint(a[1].v), iint(a[2].v), a[3].s.c_str()); + else if(k[0]==3 && k[1]==3 && k[2]==3) + gr->SubPlot(iint(a[0].v), iint(a[1].v), iint(a[2].v), k[3]==3?a[3].v:0, k[4]==3?a[4].v:0); + else return 1; + return 0; +} +void mglc_subplot(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==2) + mglprintf(out,1024,L"gr->SubPlot(%d, %d, %d, \"%s\");", iint(a[0].v), iint(a[1].v), iint(a[2].v), a[3].s.c_str()); + else if(k[0]==3 && k[1]==3 && k[2]==3) + mglprintf(out,1024,L"gr->SubPlot(%d, %d, %d, %g, %g);", iint(a[0].v), iint(a[1].v), iint(a[2].v), k[3]==3?a[3].v:0, k[4]==3?a[4].v:0); +} +//----------------------------------------------------------------------------- +int mgls_multiplot(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3) + gr->MultiPlot(iint(a[0].v), iint(a[1].v), iint(a[2].v), iint(a[3].v), iint(a[4].v), k[5]==2?a[3].s.c_str():"<>_^"); + else return 1; + return 0; +} +void mglc_multiplot(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3) + mglprintf(out,1024,L"gr->MultiPlot(%d, %d, %d, %d, %d, \"%s\");", iint(a[0].v), iint(a[1].v), iint(a[2].v), iint(a[3].v), iint(a[4].v), k[5]==2?a[3].s.c_str():"<>_^"); +} +//----------------------------------------------------------------------------- +int mgls_title(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) gr->Title(a[0].w.c_str(), k[1]==2?a[1].s.c_str():"#", k[2]==2?a[2].v:-2); + else return 1; + return 0; +} +void mglc_title(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) + mglprintf(out,1024,L"gr->Title(L\"%ls\", \"%s\", %g);", a[0].w.c_str(), k[1]==2?a[1].s.c_str():"#", k[2]==2?a[2].v:-2); +} +//----------------------------------------------------------------------------- +int mgls_column(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==2) *(a[0].d) = a[1].d->Column(a[2].s.c_str()); + else return 1; + return 0; +} +void mglc_column(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==2) + mglprintf(out,1024,L"%s = %s.Column(\"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_subdata(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==3) + *(a[0].d) = a[1].d->SubData(iint(a[2].v), k[3]==3?iint(a[3].v):-1, k[4]==3?iint(a[4].v):-1); + else return 1; + return 0; +} +void mglc_subdata(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==3) + mglprintf(out,1024,L"%s = %s.SubData(%d, %d, %d);", a[0].s.c_str(), a[1].s.c_str(), iint(a[2].v), k[3]==3?iint(a[3].v):-1, k[4]==3?iint(a[4].v):-1); +} +//----------------------------------------------------------------------------- +int mgls_trace(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1) *(a[0].d) = a[1].d->Trace(); + else return 1; + return 0; +} +void mglc_trace(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1) mglprintf(out,1024,L"%s = %s.Trace();", a[0].s.c_str(), a[1].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_tile(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]!=1) gr->Tile(*(a[0].d), k[1]==2? a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) + gr->Tile(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2? a[3].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_tile(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]!=1) + mglprintf(out,1024,L"gr->Tile(%s, \"%s\", \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->Tile(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_tiles(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return 1; + else if(k[1]==1 && k[2]!=1) + gr->TileS(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1) + gr->TileS(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2? a[4].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_tiles(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1) return; + else if(k[1]==1 && k[2]!=1) + mglprintf(out,1024,L"gr->TileS(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); + else if(k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->TileS(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_text(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==2) + gr->Putsw(mglPoint(a[0].v,a[1].v,a[2].v),a[3].w.c_str(), + (k[4]==2 && a[4].s.c_str()[0]!=0)?a[4].s.c_str():"",k[5]==3?a[5].v:-1); + else if(k[0]==3 && k[1]==3 && k[2]==2) + gr->Putsw(mglPoint(a[0].v,a[1].v),a[2].w.c_str(), + (k[3]==2 && a[3].s.c_str()[0]!=0)?a[3].s.c_str():"",k[4]==3?a[4].v:-1); + else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3 && k[6]==2) + gr->Putsw(mglPoint(a[0].v,a[1].v,a[2].v), mglPoint(a[3].v,a[4].v,a[5].v), a[6].w.c_str(), k[7]==2?a[7].s.c_str():":L", k[8]==3?a[8].v:-1); + else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==2) + gr->Putsw(mglPoint(a[0].v,a[1].v), mglPoint(a[2].v,a[3].v), a[4].w.c_str(), k[5]==2?a[5].s.c_str():":L", k[6]==3?a[6].v:-1); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2) + gr->Text(*(a[0].d),*(a[1].d),*(a[2].d),a[3].w.c_str(),k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==2) + gr->Text(*(a[0].d),*(a[1].d),a[2].w.c_str(),k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==2) + gr->Text(*(a[0].d),a[1].w.c_str(),k[2]==2?a[2].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_text(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==2) + mglprintf(out,1024,L"gr->Puts(mglPoint(%g, %g, %g), L\"%ls\", \"%s\", %g);", a[0].v, a[1].v, a[2].v, a[3].w.c_str(), (k[4]==2 && a[4].s.c_str()[0]!=0)?a[4].s.c_str():"", k[5]==3?a[5].v:-1); + else if(k[0]==3 && k[1]==3 && k[2]==2) + mglprintf(out,1024,L"gr->Puts(mglPoint(%g, %g), L\"%ls\", \"%s\", %g);", a[0].v, a[1].v, a[2].w.c_str(), (k[3]==2 && a[3].s.c_str()[0]!=0)?a[3].s.c_str():"", k[4]==3?a[4].v:-1); + else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3 && k[6]==2) + mglprintf(out,1024,L"gr->Puts(mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), L\"%ls\", \"%s\", %g);", a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, a[5].v, a[6].w.c_str(), k[7]==2?a[7].s.c_str():":L", k[8]==3?a[8].v:-1); + else if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==2) + mglprintf(out,1024,L"gr->Puts(mglPoint(%g, %g), mglPoint(%g, %g), L\"%ls\", \"%s\", %g);", a[0].v, a[1].v, a[2].v, a[3].v, a[4].w.c_str(), k[5]==2?a[5].s.c_str():":L", k[6]==3?a[6].v:-1); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2) + mglprintf(out,1024,L"gr->Text(%s, %s, %s, L\"%ls\", \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].w.c_str(), k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==2) + mglprintf(out,1024,L"gr->Text(%s, %s, L\"%ls\", \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].w.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==2) + mglprintf(out,1024,L"gr->Text(%s, L\"%ls\", \"%s\", \"%s\");", a[0].s.c_str(), a[1].w.c_str(), k[2]==2?a[2].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_torus(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1) gr->Torus(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_torus(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1) mglprintf(out,1024,L"gr->Torus(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_transptype(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) gr->SetTranspType(a[0].v); + else return 1; + return 0; +} +void mglc_transptype(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) mglprintf(out,1024,L"gr->SetTranspType(%d);", iint(a[0].v)); +} +//----------------------------------------------------------------------------- +int mgls_transform(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) + *(a[0].d) = mglTransform(*(a[2].d),*(a[3].d),a[1].s.c_str()); + else return 1; + return 0; +} +void mglc_transform(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"%s = mglTransform(%s, %s, \"%s\");",a[0].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[1].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_transforma(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) + *(a[0].d) = mglTransformA(*(a[2].d),*(a[3].d),a[1].s.c_str()); + else return 1; + return 0; +} +void mglc_transforma(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"%s = mglTransformA(%s, %s, \"%s\");",a[0].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[1].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_tube(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + gr->Tube(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==3) + gr->Tube(*(a[0].d),*(a[1].d),*(a[2].d),a[3].v,k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1) + gr->Tube(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==3) + gr->Tube(*(a[0].d),*(a[1].d),a[2].v,k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1) + gr->Tube(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else if(k[0]==1 && k[1]==3) + gr->Tube(*(a[0].d),a[1].v,k[2]==2?a[2].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_tube(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->Tube(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==3) + mglprintf(out,1024,L"gr->Tube(%s, %s, %s, %g, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].v, k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->Tube(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==3) + mglprintf(out,1024,L"gr->Tube(%s, %s, %g, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].v, k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1) + mglprintf(out,1024,L"gr->Tube(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); + else if(k[0]==1 && k[1]==3) + mglprintf(out,1024,L"gr->Tube(%s, %g, \"%s\", \"%s\");", a[0].s.c_str(), a[1].v, k[2]==2?a[2].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_textmark(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) + gr->TextMark(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),a[4].w.c_str(),k[5]==2?a[5].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2) + gr->TextMark(*(a[0].d),*(a[1].d),*(a[2].d),a[3].w.c_str(),k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==2) + gr->TextMark(*(a[0].d),*(a[1].d),a[2].w.c_str(),k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==2) + gr->TextMark(*(a[0].d),a[1].w.c_str(),k[2]==2?a[2].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_textmark(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2) + mglprintf(out,1024,L"gr->TextMark(%s, %s, %s, %s, L\"%ls\", \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].w.c_str(), k[5]==2?a[5].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2) + mglprintf(out,1024,L"gr->TextMark(%s, %s, %s, L\"%ls\", \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].w.c_str(), k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==2) + mglprintf(out,1024,L"gr->TextMark(%s, %s, L\"%ls\", \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].w.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==2) + mglprintf(out,1024,L"gr->TextMark(%s, L\"%ls\", \"%s\", \"%s\");", a[0].s.c_str(), a[1].w.c_str(), k[2]==2?a[2].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_triplot(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) + gr->TriPlot(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),k[5]==2?a[5].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + gr->TriPlot(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1) + gr->TriPlot(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_triplot(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) + mglprintf(out,1024,L"gr->TriPlot(%s, %s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), k[5]==2?a[5].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->TriPlot(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->TriPlot(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_quadplot(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) + gr->QuadPlot(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),k[5]==2?a[5].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + gr->QuadPlot(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1) + gr->QuadPlot(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_quadplot(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) + mglprintf(out,1024,L"gr->QuadPlot(%s, %s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), k[5]==2?a[5].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->QuadPlot(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->QuadPlot(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_tricont(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1) + gr->TriContV(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),k[6]==2?a[6].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) + gr->TriContV(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),k[5]==2?a[5].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + gr->TriCont(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_tricont(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1) + mglprintf(out,1024,L"gr->TriContV(%s, %s, %s, %s, %s, %s, \"%s\", \"%s\");", + a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str(), k[6]==2?a[6].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) + mglprintf(out,1024,L"gr->TriContV(%s, %s, %s, %s, %s, \"%s\", \"%s\");", + a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), k[5]==2?a[5].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->TriCont(%s, %s, %s, %s, \"%s\", \"%s\");", + a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_ternary(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) gr->Ternary(int(a[0].v)); + else return 1; + return 0; +} +void mglc_ternary(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) mglprintf(out,1024,L"gr->Ternary(%d);", int(a[0].v)); +} +//----------------------------------------------------------------------------- +int mgls_transpose(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) a[0].d->Transpose(k[1]==2?a[1].s.c_str():"yxz"); + else return 1; + return 0; +} +void mglc_transpose(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) mglprintf(out,1024,L"%s.Transpose(\"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"yxz"); +} +//----------------------------------------------------------------------------- +int mgls_vect(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + int i; + for(i=0;i<7;i++) if(k[i]!=1) break; + if(i==2) + gr->Vect(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else if(i==4) + gr->Vect(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + else if(i==3) + gr->Vect(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else if(i==6) + gr->Vect(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),k[6]==2?a[6].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_vect(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + int i; + for(i=0;i<7;i++) if(k[i]!=1) break; + if(i==2) + mglprintf(out,1024,L"gr->Vect(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); + else if(i==4) + mglprintf(out,1024,L"gr->Vect(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); + else if(i==3) + mglprintf(out,1024,L"gr->Vect(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(i==6) + mglprintf(out,1024,L"gr->Vect(%s, %s, %s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str(), k[6]==2?a[6].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_traj(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + int i; + for(i=0;i<7;i++) if(k[i]!=1) break; + if(i==4) + gr->Traj(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",opt); + else if(i==6) + gr->Traj(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),k[6]==2?a[6].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_traj(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + int i; + for(i=0;i<7;i++) if(k[i]!=1) break; + if(i==4) + mglprintf(out,1024,L"gr->Traj(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); + else if(i==6) + mglprintf(out,1024,L"gr->Traj(%s, %s, %s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str(), k[6]==2?a[6].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_xlabel(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) gr->Label('x', a[0].w.c_str(), k[1]==3?a[1].v:1, k[2]==3?a[2].v:0); + else return 1; + return 0; +} +void mglc_xlabel(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) mglprintf(out,1024,L"gr->Label('x', L\"%ls\", %g, %g);", a[0].w.c_str(), k[1]==3?a[1].v:1, k[2]==3?a[2].v:0); +} +//----------------------------------------------------------------------------- +int mgls_ylabel(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) gr->Label('y', a[0].w.c_str(), k[1]==3?a[1].v:1, k[2]==3?a[2].v:0); + else return 1; + return 0; +} +void mglc_ylabel(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) mglprintf(out,1024,L"gr->Label('y', L\"%ls\", %g, %g);", a[0].w.c_str(), k[1]==3?a[1].v:1, k[2]==3?a[2].v:0); +} +//----------------------------------------------------------------------------- +int mgls_zlabel(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) gr->Label('z', a[0].w.c_str(), k[1]==3?a[1].v:1, k[2]==3?a[2].v:0); + else return 1; + return 0; +} +void mglc_zlabel(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) mglprintf(out,1024,L"gr->Label('z', L\"%ls\", %g, %g);", a[0].w.c_str(), k[1]==3?a[1].v:1, k[2]==3?a[2].v:0); +} +//----------------------------------------------------------------------------- +int mgls_tlabel(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) gr->Label('t', a[0].w.c_str(), k[1]==3?a[1].v:1, k[2]==3?a[2].v:0); + else return 1; + return 0; +} +void mglc_tlabel(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) mglprintf(out,1024,L"gr->Label('t', L\"%ls\", %g, %g);", a[0].w.c_str(), k[1]==3?a[1].v:1, k[2]==3?a[2].v:0); +} +//----------------------------------------------------------------------------- +int mgls_label(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==2) + gr->Label(a[0].v, a[1].v, a[2].w.c_str(), k[3]==2?a[3].s.c_str():""); + else return 1; + return 0; +} +void mglc_label(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==2) + mglprintf(out,1024,L"gr->Label(%g, %g, \"%s\", \"%s\");", a[0].v, a[1].v, a[2].w.c_str(), k[3]==2?a[3].s.c_str():""); +} +//----------------------------------------------------------------------------- +int mgls_xrange(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) gr->SetRange('x',*(a[0].d),k[1]==3?(a[1].v!=0):false); + else if(k[0]==3 && k[1]==3) gr->SetRange('x',a[0].v,a[1].v); + else return 1; + return 0; +} +void mglc_xrange(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) + mglprintf(out,1024,L"gr->SetRange('x', %s, %s);", a[0].s.c_str(), (k[1]==3&&a[1].v!=0)?"true":"false"); + else if(k[0]==3 && k[1]==3) + mglprintf(out,1024,L"gr->SetRange('x', %g, %g));", a[0].v, a[1].v); +} +//----------------------------------------------------------------------------- +int mgls_yrange(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) gr->SetRange('y',*(a[0].d),k[1]==3?(a[1].v!=0):false); + else if(k[0]==3 && k[1]==3) gr->SetRange('y',a[0].v,a[1].v); + else return 1; + return 0; +} +void mglc_yrange(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) + mglprintf(out,1024,L"gr->SetRange('y', %s, %s);", a[0].s.c_str(), (k[1]==3&&a[1].v!=0)?"true":"false"); + else if(k[0]==3 && k[1]==3) + mglprintf(out,1024,L"gr->SetRange('y', %g, %g));", a[0].v, a[1].v); +} +//----------------------------------------------------------------------------- +int mgls_zrange(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) gr->SetRange('z',*(a[0].d),k[1]==3?(a[1].v!=0):false); + else if(k[0]==3 && k[1]==3) gr->SetRange('z',a[0].v,a[1].v); + else return 1; + return 0; +} +void mglc_zrange(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) + mglprintf(out,1024,L"gr->SetRange('z', %s, %s);", a[0].s.c_str(), (k[1]==3&&a[1].v!=0)?"true":"false"); + else if(k[0]==3 && k[1]==3) + mglprintf(out,1024,L"gr->SetRange('z', %g, %g));", a[0].v, a[1].v); +} +//----------------------------------------------------------------------------- +int mgls_xtick(mglGraph *gr, long n, mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==2) + { + mreal v[50]; wchar_t *s=new wchar_t[50*256]; int i; + for(i=0;i<50 && iSetTicksVal('x',mglData(i,v),s); delete []s; + } + else if(k[0]==3) + gr->SetTicks('x', a[0].v, k[1]==3?iint(a[1].v):0, k[2]==3?a[2].v:NAN); + else if(k[0]==2) gr->SetTickTempl('x',a[0].w.c_str()); + else return 1; + return 0; +} +void mglc_xtick(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3) + mglprintf(out,1024,L"gr->SetTicks('x', %g, %d, %g);", a[0].v, iint(a[1].v),a[2].v); + else if(k[0]==3 && k[1]==3) + mglprintf(out,1024,L"gr->SetTicks('x', %g, %d);", a[0].v, iint(a[1].v)); + else if(k[0]==3 && k[1]==2) + mglprintf(out,1024,L"gr->SetTicksVal('x', %g, \"%s\");", a[0].v, a[1].s.c_str()); // TODO: Many labels in C++ output of xtick + else if(k[0]==3) mglprintf(out,1024,L"gr->SetTicks('x', %g);", a[0].v); + else if(k[0]==2) + mglprintf(out,1024,L"gr->SetTickTempl('x',L\"%ls\");", a[0].w.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_ytick(mglGraph *gr, long n, mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==2) + { + mreal v[50]; wchar_t *s=new wchar_t[50*256]; int i; + for(i=0;i<50 && iSetTicksVal('y',mglData(i,v),s); delete []s; + } + else if(k[0]==3) + gr->SetTicks('y', a[0].v, k[1]==3?iint(a[1].v):0, k[2]==3?a[2].v:NAN); + else if(k[0]==2) gr->SetTickTempl('y',a[0].w.c_str()); + else return 1; + return 0; +} +void mglc_ytick(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3) + mglprintf(out,1024,L"gr->SetTicks('y', %g, %d, %g);", a[0].v, iint(a[1].v),a[2].v); + else if(k[0]==3 && k[1]==3) + mglprintf(out,1024,L"gr->SetTicks('y', %g, %d);", a[0].v, iint(a[1].v)); + else if(k[0]==3 && k[1]==2) + mglprintf(out,1024,L"gr->SetTicksVal('y', %g, \"%s\");", a[0].v, a[1].s.c_str()); // TODO: Many labels in C++ output of ytick + else if(k[0]==3) mglprintf(out,1024,L"gr->SetTicks('y', %g);", a[0].v); + else if(k[0]==2) mglprintf(out,1024,L"gr->SetTickTempl('y',L\"%ls\");", a[0].w.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_ztick(mglGraph *gr, long n, mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==2) + { + mreal v[50]; wchar_t *s=new wchar_t[50*256]; int i; + for(i=0;i<50 && iSetTicksVal('z',mglData(i,v),s); delete []s; + } + else if(k[0]==3) + gr->SetTicks('z', a[0].v, k[1]==3?iint(a[1].v):0, k[2]==3?a[2].v:NAN); + else if(k[0]==2) gr->SetTickTempl('z',a[0].w.c_str()); + else return 1; + return 0; +} +void mglc_ztick(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3) + mglprintf(out,1024,L"gr->SetTicks('z', %g, %d, %g);", a[0].v, iint(a[1].v),a[2].v); + else if(k[0]==3 && k[1]==3) + mglprintf(out,1024,L"gr->SetTicks('z', %g, %d);", a[0].v, iint(a[1].v)); + else if(k[0]==3 && k[1]==2) + mglprintf(out,1024,L"gr->SetTicksVal('z', %g, \"%s\");", a[0].v, a[1].s.c_str()); // TODO: Many labels in C++ output of ztick + else if(k[0]==3) mglprintf(out,1024,L"gr->SetTicks('z', %g);", a[0].v); + else if(k[0]==2) mglprintf(out,1024,L"gr->SetTickTempl('z',L\"%ls\");", a[0].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_error(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + gr->Error(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d), k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1) + gr->Error(*(a[0].d),*(a[1].d),*(a[2].d), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1) + gr->Error(*(a[0].d),*(a[1].d), k[2]==2?a[2].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_error(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->Error(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->Error(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1) + mglprintf(out,1024,L"gr->Error(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_extend(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3) a[0].d->Extend(iint(a[1].v),k[2]==3?iint(a[2].v):0); + else return 1; + return 0; +} +void mglc_extend(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3) + mglprintf(out,1024,L"%s.Extend(%d, %d);", a[0].s.c_str(), iint(a[1].v), k[2]==3?iint(a[2].v):0); +} +//----------------------------------------------------------------------------- +int mgls_datas(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) + { + char *buf=new char[1024]; + mgl_datas_hdf(a[0].s.c_str(),buf,1024); + gr->SetWarn(-1,buf); + delete []buf; + } + else return 1; + return 0; +} +void mglc_datas(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) mglprintf(out,1024,L"{char b[1024]; mgl_datas_hdf(\"%s\"s,b,1024); gr->SetWarn(-1,b);}",a[0].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_info(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) gr->SetWarn(-1,a[0].d->PrintInfo()); + else if(k[0]==2) gr->SetWarn(-1,a[0].s.c_str()); + else return 1; + return 0; +} +void mglc_info(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) mglprintf(out,1024,L"gr->SetWarn(-1,%s.PrintInfo());", a[0].s.c_str()); + if(k[0]==2) mglprintf(out,1024,L"gr->SetWarn(-1,\"%s\");",a[0].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_integrate(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) a[0].d->Integral(a[1].s.c_str()); + else return 1; + return 0; +} +void mglc_integrate(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Integral(\"%s\");", a[0].s.c_str(), a[1].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_inplot(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) + gr->InPlot(a[0].v, a[1].v, a[2].v, a[3].v, k[4]==3&&a[4].v!=0); + else return 1; + return 0; +} +void mglc_inplot(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) + mglprintf(out,1024,L"gr->InPlot(%g, %g, %g, %g, %s);", a[0].v, a[1].v, a[2].v, a[3].v, k[4]==3&&a[4].v!=0 ? "true":"false"); +} +//----------------------------------------------------------------------------- +int mgls_columnplot(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3) gr->ColumnPlot(iint(a[0].v), iint(a[1].v), k[2]==3?a[2].v:0); + else return 1; + return 0; +} +void mglc_columnplot(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3) + mglprintf(out,1024,L"gr->ColumnPlot(%d, %d, %g);", iint(a[0].v), iint(a[1].v), k[2]==3?a[2].v:0); +} +//----------------------------------------------------------------------------- +int mgls_stickplot(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) + gr->StickPlot(iint(a[0].v), iint(a[1].v), a[2].v, a[3].v); + else return 1; + return 0; +} +void mglc_stickplot(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) + mglprintf(out,1024,L"gr->StickPlot(%d, %d, %g, %g);", + iint(a[0].v), iint(a[1].v), a[2].v, a[3].v); +} +//----------------------------------------------------------------------------- +int mgls_pipe(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + int i; + for(i=0;i<7;i++) if(k[i]!=1) break; + if(i==2) + gr->Pipe(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",k[3]==3?a[3].v:0.05,opt); + else if(i==4) + gr->Pipe(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),k[4]==2?a[4].s.c_str():"",k[5]==3?a[5].v:0.05,opt); + else if(i==3) + gr->Pipe(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",k[4]==3?a[4].v:0.05,opt); + else if(i==6) + gr->Pipe(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d), + k[6]==2?a[6].s.c_str():"",k[7]==3?a[7].v:0.05,opt); + else return 1; + return 0; +} +void mglc_pipe(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + int i; + for(i=0;i<7;i++) if(k[i]!=1) break; + if(i==2) + mglprintf(out,1024,L"gr->Pipe(%s, %s, \"%s\", %g, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"", k[3]==3?a[3].v:0.05,opt); + else if(i==4) + mglprintf(out,1024,L"gr->Pipe(%s, %s, %s, %s, \"%s\", %g, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"", k[5]==3?a[5].v:0.05,opt); + else if(i==3) + mglprintf(out,1024,L"gr->Pipe(%s, %s, %s, \"%s\", %g, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"", k[4]==3?a[4].v:0.05,opt); + else if(i==6) + mglprintf(out,1024,L"gr->Pipe(%s, %s, %s, %s, %s, %s, \"%s\", %g, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str(), k[6]==2?a[6].s.c_str():"", k[7]==3?a[7].v:0.05,opt); +} +//----------------------------------------------------------------------------- +int mgls_origin(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3) gr->SetOrigin(a[0].v,a[1].v,k[2]==3?a[2].v:NAN); + else return 1; + return 0; +} +void mglc_origin(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3) + mglprintf(out,1024,L"gr->SetOrigin(%g, %g, %g);", a[0].v, a[1].v, k[2]==3?a[2].v:NAN); +} +//----------------------------------------------------------------------------- +int mgls_norm(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3 && k[2]==3) + a[0].d->Norm(a[1].v,a[2].v,k[3]==3?a[3].v!=0:false,k[4]==3?iint(a[4].v):0); + else return 1; + return 0; +} +void mglc_norm(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3 && k[2]==3) + mglprintf(out,1024,L"%s.Norm(%g, %g, %s, %d);", a[0].s.c_str(), a[1].v, a[2].v, (k[3]==3&&a[3].v!=0)?"true":"false", k[4]==3?iint(a[4].v):0); +} +//----------------------------------------------------------------------------- +int mgls_hist(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==3 && k[4]==3 && k[5]==3) + *(a[0].d) = a[1].d->Hist(*(a[2].d), int(a[3].v+0.5), a[4].v, a[5].v, k[6]==3?int(a[6].v+0.5):0); + else if(k[0]==1 && k[1]==1 && k[2]==3 && k[3]==3 && k[4]==3) + *(a[0].d) = a[1].d->Hist(int(a[2].v+0.5), a[3].v, a[4].v, k[5]==3?int(a[5].v+0.5):0); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) + *(a[0].d) = gr->Hist(*(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + *(a[0].d) = gr->Hist(*(a[1].d), *(a[2].d), *(a[3].d),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1) + *(a[0].d) = gr->Hist(*(a[1].d), *(a[2].d),opt); + else return 1; + return 0; +} +void mglc_hist(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==3 && k[4]==3 && k[5]==3) + mglprintf(out,1024,L"%s = %s.Hist(%s, %d, %g, %g, %d);", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), iint(a[3].v), a[4].v, a[5].v, k[6]==3?iint(a[6].v):0); + else if(k[0]==1 && k[1]==1 && k[2]==3 && k[3]==3 && k[4]==3) + mglprintf(out,1024,L"%s = %s.Hist(%d, %g, %g, %d);", a[0].s.c_str(), a[1].s.c_str(), iint(a[2].v), a[3].v, a[4].v, k[5]==3?iint(a[5].v):0); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) + mglprintf(out,1024,L"%s = gr->Hist(%s, %s, %s, %s, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"%s = gr->Hist(%s, %s, %s, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1) + mglprintf(out,1024,L"%s = gr->Hist(%s, %s, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(),opt); +} +//----------------------------------------------------------------------------- +int mgls_mirror(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) a[0].d->Mirror(a[1].s.c_str()); + else return 1; + return 0; +} +void mglc_mirror(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Mirror(\"%s\");", a[0].s.c_str(), a[1].s.c_str()); } +//----------------------------------------------------------------------------- +int mgls_hankel(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) a[0].d->Hankel(a[1].s.c_str()); else return 1; + return 0; +} +void mglc_hankel(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Hankel('%s');", a[0].s.c_str(), a[1].s.c_str()); } +//----------------------------------------------------------------------------- +int mgls_sinfft(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) a[0].d->SinFFT(a[1].s.c_str()); else return 1; + return 0; +} +void mglc_sinfft(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.SinFFT('%s');", a[0].s.c_str(), a[1].s.c_str()); } +//----------------------------------------------------------------------------- +int mgls_cosfft(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) a[0].d->CosFFT(a[1].s.c_str()); else return 1; + return 0; +} +void mglc_cosfft(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.CosFFT('%s');", a[0].s.c_str(), a[1].s.c_str()); } +//----------------------------------------------------------------------------- +int mgls_new(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) a[0].d->Create(k[1]==3?iint(a[1].v):1, k[2]==3?iint(a[2].v):1, k[3]==3?iint(a[3].v):1); + else return 1; + return 0; +} +void mglc_new(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) + mglprintf(out,1024,L"%s.Create(%d, %d, %d);", a[0].s.c_str(), k[1]==3?iint(a[1].v):1, k[2]==3?iint(a[2].v):1, k[3]==3?iint(a[3].v):1); +} +//----------------------------------------------------------------------------- +int mgls_var(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3 && k[2]==3) + { a[0].d->Create(iint(a[1].v)); a[0].d->Fill(a[2].v, k[3]==3?a[3].v:NAN); } + else return 1; + return 0; +} +void mglc_var(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3 && k[2]==3) + mglprintf(out,1024,L"%s.Create(%d);\t%s.Fill(%g,%g);",a[0].s.c_str(), iint(a[1].v), a[0].s.c_str(), a[2].v, k[3]==3?a[3].v:NAN); +} +//----------------------------------------------------------------------------- +int mgls_chdir(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) + { int r=chdir(a[0].s.c_str()); if(r) gr->SetWarn(mglWarnFile); } + else return 1; + return 0; +} +void mglc_chdir(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ if(k[0]==2) mglprintf(out,1024,L"chdir(\"%s\");", a[0].s.c_str()); } +//----------------------------------------------------------------------------- +int mgls_perspective(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) gr->Perspective(a[0].v); + else return 1; + return 0; +} +void mglc_perspective(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ if(k[0]==3) mglprintf(out,1024,L"gr->Perspective(%g);", a[0].v); } +//----------------------------------------------------------------------------- +int mgls_facex(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3) + gr->FaceX(mglPoint(a[0].v, a[1].v, a[2].v), a[3].v, a[4].v, k[5]==2?a[5].s.c_str():"", k[6]==3?a[6].v:0, k[7]==3?a[7].v:0); + else return 1; + return 0; +} +void mglc_facex(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3) + mglprintf(out,1024,L"gr->FaceX(mglPoint(%g, %g, %g), %g, %g, \"%s\", %g, %g);", a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, k[5]==2?a[5].s.c_str():"", k[6]==3?a[6].v:0, k[7]==3?a[7].v:0); +} +//----------------------------------------------------------------------------- +int mgls_facey(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3) + gr->FaceY(mglPoint(a[0].v, a[1].v, a[2].v), a[3].v, a[4].v, k[5]==2?a[5].s.c_str():"", k[6]==3?a[6].v:0, k[7]==3?a[7].v:0); + else return 1; + return 0; +} +void mglc_facey(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3) + mglprintf(out,1024,L"gr->FaceY(mglPoint(%g, %g, %g), %g, %g, \"%s\", %g, %g);", a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, k[5]==2?a[5].s.c_str():"", k[6]==3?a[6].v:0, k[7]==3?a[7].v:0); +} +//----------------------------------------------------------------------------- +int mgls_facez(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3) + gr->FaceZ(mglPoint(a[0].v, a[1].v, a[2].v), a[3].v, a[4].v, k[5]==2?a[5].s.c_str():"", k[6]==3?a[6].v:0, k[7]==3?a[7].v:0); + else return 1; + return 0; +} +void mglc_facez(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3 && k[4]==3) + mglprintf(out,1024,L"gr->FaceZ(mglPoint(%g, %g, %g), %g, %g, \"%s\", %g, %g);", a[0].v, a[1].v, a[2].v, a[3].v, a[4].v, k[5]==2?a[5].s.c_str():"", k[6]==3?a[6].v:0, k[7]==3?a[7].v:0); +} +//----------------------------------------------------------------------------- +int mgls_normsl(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3 && k[2]==3) + a[0].d->NormSl(a[1].v, a[2].v, k[3]==2?a[3].s.c_str()[0]:'z', k[4]==3?a[4].v!=0:true, k[5]==3?a[5].v!=0:false); + else return 1; + return 0; +} +void mglc_normsl(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3 && k[2]==3) + mglprintf(out,1024,L"%s.NormSl(%g, %g, '%c', %s, %s);", a[0].s.c_str(), a[1].v, a[2].v, k[3]==2?a[3].s.c_str()[0]:'z', (k[4]!=3||a[4].v!=0)?"true":"false", (k[5]==3&&a[5].v!=0)?"true":"false"); +} +//----------------------------------------------------------------------------- +int mgls_momentum(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==2) + *(a[0].d) = a[1].d->Momentum(k[3]==2?a[3].s.c_str()[0]:'z', a[2].s.c_str()); + else return 1; + return 0; +} +void mglc_momentum(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==2) + mglprintf(out,1024,L"%s = %s.Momentum('%c', \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[3]==2?a[3].s.c_str()[0]:'z', a[2].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_fit(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1&& k[5]==2 && k[6]==2 && k[7]==1 && a[7].d->nx>=long(strlen(a[6].s.c_str()))) + *(a[0].d) = gr->Fit(*(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.c_str(), a[6].s.c_str(), *(a[7].d),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1&& k[5]==2 && k[6]==2) + *(a[0].d) = gr->Fit(*(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.c_str(), a[6].s.c_str(),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2 && k[5]==2 && k[6]==1 && a[6].d->nx>=long(strlen(a[5].s.c_str()))) + *(a[0].d) = gr->Fit(*(a[1].d), *(a[2].d), *(a[3].d), a[4].s.c_str(), a[5].s.c_str(), *(a[6].d),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2 && k[5]==2) + *(a[0].d) = gr->Fit(*(a[1].d), *(a[2].d), *(a[3].d), a[4].s.c_str(), a[5].s.c_str(),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2 && k[4]==2 && k[5]==1 && a[5].d->nx>=long(strlen(a[4].s.c_str()))) + *(a[0].d) = gr->Fit(*(a[1].d), *(a[2].d), a[3].s.c_str(), a[4].s.c_str(), *(a[5].d),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2 && k[4]==2) + *(a[0].d) = gr->Fit(*(a[1].d), *(a[2].d), a[3].s.c_str(), a[4].s.c_str(),opt); + else if(k[0]==1 && k[1]==1 && k[2]==2 && k[3]==2 && k[4]==1 && a[4].d->nx>=long(strlen(a[3].s.c_str()))) + *(a[0].d) = gr->Fit(*(a[1].d), a[2].s.c_str(), a[3].s.c_str(), *(a[4].d),opt); + else if(k[0]==1 && k[1]==1 && k[2]==2 && k[3]==2) + *(a[0].d) = gr->Fit(*(a[1].d), a[2].s.c_str(), a[3].s.c_str(),opt); + else return 1; + return 0; +} +void mglc_fit(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1&& k[5]==2 && k[6]==2) + mglprintf(out,1024,L"%s = gr->Fit(%s, %s, %s, %s, \"%s\", \"%s\", %s, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str(), a[6].s.c_str(), k[7]==1?a[7].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2 && k[5]==2) + mglprintf(out,1024,L"%s = gr->Fit(%s, %s, %s, \"%s\", \"%s\", %s, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str(), k[6]==1?a[6].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2 && k[4]==2) + mglprintf(out,1024,L"%s = gr->Fit(%s, %s, \"%s\", \"%s\", %s, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), k[5]==1?a[5].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==2 && k[3]==2) + mglprintf(out,1024,L"%s = gr->Fit(%s, \"%s\", \"%s\", %s, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==1?a[5].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_fits(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1 && k[6]==2 && k[7]==2 && k[8]==1 && a[8].d->nx>=long(strlen(a[7].s.c_str()))) + *(a[0].d) = gr->FitS(*(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), *(a[5].d), a[6].s.c_str(), a[7].s.c_str(), *(a[8].d),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1 && k[6]==2 && k[7]==2) + *(a[0].d) = gr->FitS(*(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), *(a[5].d), a[6].s.c_str(), a[7].s.c_str(),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2 && k[6]==2 && k[7]==1 && a[7].d->nx>=long(strlen(a[6].s.c_str()))) + *(a[0].d) = gr->FitS(*(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.c_str(), a[6].s.c_str(), *(a[7].d),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2 && k[6]==2) + *(a[0].d) = gr->FitS(*(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.c_str(), a[6].s.c_str(),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2 && k[5]==2 && k[6]==1 && a[6].d->nx>=long(strlen(a[5].s.c_str()))) + *(a[0].d) = gr->FitS(*(a[1].d), *(a[2].d), *(a[3].d), a[4].s.c_str(), a[5].s.c_str(), *(a[6].d),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2 && k[5]==2) + *(a[0].d) = gr->FitS(*(a[1].d), *(a[2].d), *(a[3].d), a[4].s.c_str(), a[5].s.c_str(),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2 && k[4]==2 && k[5]==1 && a[5].d->nx>=long(strlen(a[4].s.c_str()))) + *(a[0].d) = gr->FitS(*(a[1].d), *(a[2].d), a[3].s.c_str(), a[4].s.c_str(), *(a[5].d),opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2 && k[4]==2) + *(a[0].d) = gr->FitS(*(a[1].d), *(a[2].d), a[3].s.c_str(), a[4].s.c_str(),opt); + else return 1; + return 0; +} +void mglc_fits(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1 && k[6]==2 && k[7]==2) + mglprintf(out,1024,L"%s = gr->FitS(%s, %s, %s, %s, %s, \"%s\", \"%s\", %s, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str(), a[6].s.c_str(), a[7].s.c_str(), (k[8]==1 && a[8].d->nx>=long(strlen(a[7].s.c_str())))?a[8].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2 && k[6]==2) + mglprintf(out,1024,L"%s = gr->FitS(%s, %s, %s, %s, \"%s\", \"%s\", %s, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str(), a[6].s.c_str(), (k[7]==1 && a[7].d->nx>=long(strlen(a[6].s.c_str())))?a[7].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2 && k[5]==2) + mglprintf(out,1024,L"%s = gr->FitS(%s, %s, %s, \"%s\", \"%s\", %s, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str(), (k[6]==1 && a[6].d->nx>=long(strlen(a[5].s.c_str())))?a[6].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2 && k[4]==2) + mglprintf(out,1024,L"%s = gr->FitS(%s, %s, \"%s\", \"%s\", %s, \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), (k[5]==1 && a[5].d->nx>=long(strlen(a[4].s.c_str())))?a[5].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_putsfit(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3) + gr->PutsFit(mglPoint(a[0].v,a[1].v,a[2].v), k[3]==2?a[3].s.c_str():"", k[4]==2?a[4].s.c_str():"", k[5]==3?a[5].v:-1); + else if(k[0]==3 && k[1]==3) + gr->PutsFit(mglPoint(a[0].v,a[1].v), k[2]==2?a[2].s.c_str():"", k[3]==2?a[3].s.c_str():"", k[4]==3?a[4].v:-1); + else return 1; + return 0; +} +void mglc_putsfit(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3 && k[1]==3 && k[2]==3) + mglprintf(out,1024,L"gr->PutsFit(mglPoint(%g, %g, %g), \"%s\", \"%s\", %g);", a[0].v,a[1].v,a[2].v, k[3]==2?a[3].s.c_str():"", k[4]==2?a[4].s.c_str():"", k[5]==3?a[5].v:-1); + else if(k[0]==3 && k[1]==3) + mglprintf(out,1024,L"gr->PutsFit(mglPoint(%g, %g), \"%s\", \"%s\", %g);", a[0].v,a[1].v, k[2]==2?a[2].s.c_str():"", k[3]==2?a[3].s.c_str():"", k[4]==3?a[4].v:-1); + + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==1 && k[6]==2 && k[7]==2) + mglprintf(out,1024,L"gr->FitS(%s, %s, %s, %s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str(), a[6].s.c_str(), a[7].s.c_str(), (k[8]==1 && a[8].d->nx>=long(strlen(a[7].s.c_str())))?a[8].s.c_str():"NULL", (k[9]==3&&a[9].v!=0)?"true":"false"); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1 && k[5]==2 && k[6]==2) + mglprintf(out,1024,L"gr->FitS(%s, %s, %s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str(), a[6].s.c_str(), (k[7]==1 && a[7].d->nx>=long(strlen(a[6].s.c_str())))?a[7].s.c_str():"NULL", (k[8]==3&&a[8].v!=0)?"true":"false"); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==2 && k[5]==2) + mglprintf(out,1024,L"gr->FitS(%s, %s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), a[5].s.c_str(), (k[6]==1 && a[6].d->nx>=long(strlen(a[5].s.c_str())))?a[6].s.c_str():"NULL", (k[7]==3&&a[7].v!=0)?"true":"false"); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==2 && k[4]==2) + mglprintf(out,1024,L"gr->FitS(%s, %s, %s, \"%s\", \"%s\", %s, %s);", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), (k[5]==1 && a[5].d->nx>=long(strlen(a[4].s.c_str())))?a[5].s.c_str():"NULL", (k[6]==3&&a[6].v!=0)?"true":"false"); +} +//----------------------------------------------------------------------------- +int mgls_arrowsize(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) gr->SetArrowSize(a[0].v/50); + else return 1; + return 0; +} +void mglc_arrowsize(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) mglprintf(out,1024,L"gr->SetArrowSize(%g);", a[0].v/50); +} +//----------------------------------------------------------------------------- +int mgls_rearrange(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3) + a[0].d->Rearrange(iint(a[1].v), k[2]==3?iint(a[2].v):0, k[3]==3?iint(a[3].v):0); + else return 1; + return 0; +} +void mglc_rearrange(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3) + mglprintf(out,1024,L"%s.Rearrange(%d, %d, %d);",a[0].s.c_str(), iint(a[1].v), k[2]==3?iint(a[2].v):0, k[3]==3?iint(a[3].v):0); +} +//----------------------------------------------------------------------------- +int mgls_ctick(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) gr->SetTickTempl('c',a[0].w.c_str()); + else if(k[0]==3) gr->SetTicks('c',a[0].v); + else return 1; + return 0; +} +void mglc_ctick(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) mglprintf(out,1024,L"gr->SetTickTempl('c',L\"%ls\");", a[0].w.c_str()); + else if(k[0]==3) mglprintf(out,1024,L"gr->SetTicks('c',%g);", a[0].v); +} +//----------------------------------------------------------------------------- +int mgls_fplot(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==2 && k[1]==2 && k[2]==2) + gr->FPlot(a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==2) gr->FPlot(a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_fplot(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==2 && k[1]==2 && k[2]==2) + mglprintf(out,1024,L"gr->FPlot(\"%s\", \"%s\", \"%s\", \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==2) + mglprintf(out,1024,L"gr->FPlot(\"%s\", \"%s\", \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_fsurf(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==2 && k[1]==2 && k[2]==2) gr->FSurf(a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==2) gr->FSurf(a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_fsurf(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==2 && k[1]==2 && k[2]==2) + mglprintf(out,1024,L"gr->FSurf(\"%s\", \"%s\", \"%s\", \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==2) + mglprintf(out,1024,L"gr->FSurf(\"%s\", \"%s\", \"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_fgets(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + char buf[1024]; + FILE *fp; + if((k[0]==3 && k[1]==3 && k[2]==3 && k[3]==2) || (k[0]==3 && k[1]==3 && k[2]==2)) + { + int i, j=k[2]==3?1:0, n = (k[j+3]==3?iint(a[j+3].v):0); + float vv = k[2]==3 ? a[2].v:0; + fp = fopen(a[j+2].s.c_str(),"rt"); + if(!fp) + { + if(gr->Self()->Message) sprintf(gr->Self()->Message,"Wrong file %s",a[j+2].s.c_str()); + return 0; + } + for(i=0;iSelf()->Message) sprintf(gr->Self()->Message,"Couldn't read %d-th string of file %s",n,a[j+2].s.c_str()); + fclose(fp); return 0; + } + fclose(fp); + gr->Puts(mglPoint(a[0].v,a[1].v,vv),buf, (k[j+4]==2)?a[j+4].s.c_str():"", k[j+5]==3?a[j+5].v:-1.4); + } + else return 1; + return 0; +} +void mglc_fgets(wchar_t [1024], long , mglArg *, int [10], const char *) {} +//----------------------------------------------------------------------------- +int mgls_import(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==2) + a[0].d->Import(a[1].s.c_str(), a[2].s.c_str(), k[3]==3?a[3].v:0, k[4]==3?a[4].v:1); + else return 1; + return 0; +} +void mglc_import(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==2) + mglprintf(out,1024,L"%s->Import(%s, %s, %g, %g);", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==3?a[3].v:0, k[4]==3?a[4].v:1); +} +//----------------------------------------------------------------------------- +int mgls_export(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==2) + a[0].d->Export(a[1].s.c_str(), a[2].s.c_str(), k[3]==3?a[3].v:0, k[4]==3?a[4].v:1); + else return 1; + return 0; +} +void mglc_export(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==2) + mglprintf(out,1024,L"%s->Export(%s, %s, %g, %g);", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==3?a[3].v:0, k[4]==3?a[4].v:1); +} +//----------------------------------------------------------------------------- +int mgls_write(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) gr->WriteFrame(a[0].s.c_str(), "MathGL"); + else return 1; + return 0; +} +void mglc_write(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) + mglprintf(out,1024,L"gr->WriteFrame(\"%s\", \"MathGL\");", a[0].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_region(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1) + gr->Region(*(a[0].d),*(a[1].d),*(a[2].d),k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1) + gr->Region(*(a[0].d),*(a[1].d),k[2]==2?a[2].s.c_str():"",opt); + else return 1; + return 0; +} +void mglc_region(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->Region(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else if(k[0]==1 && k[1]==1) + mglprintf(out,1024,L"gr->Region(%s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_envelop(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) a[0].d->Envelop(k[1]==2 ? a[1].s.c_str()[0] : 'x'); + else return 1; + return 0; +} +void mglc_envelop(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) mglprintf(out,1024,L"%s.Envelop('%c');",a[0].s.c_str(), k[1]==2?a[1].s.c_str()[0]:'x'); +} +//----------------------------------------------------------------------------- +int mgls_sew(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) a[0].d->Sew(k[1]==2?a[1].s.c_str():"xyz", k[2]==3 ? a[2].v : 2*M_PI); + else return 1; + return 0; +} +void mglc_sew(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) mglprintf(out,1024,L"%s.Sew(\"%s\", %g);", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"xyz", k[2]==3 ? a[2].v : 2*M_PI); +} +//----------------------------------------------------------------------------- +int mgls_evaluate(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1 && k[4]==1) + *(a[0].d) = a[1].d->Evaluate(*(a[2].d), *(a[3].d), *(a[4].d), k[5]!=3 || a[5].v!=0); + else if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + *(a[0].d) = a[1].d->Evaluate(*(a[2].d), *(a[3].d), k[4]!=3 || a[4].v!=0); + else if(k[0]==1 && k[1]==1 && k[2]==1) + *(a[0].d) = a[1].d->Evaluate(*(a[2].d), k[3]!=3 || a[3].v!=0); + else return 1; + return 0; +} +void mglc_evaluate(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1) mglprintf(out,1024,L"%s.Sew(\"%s\", %g);", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"xyz", k[2]==3 ? a[2].v : 2*M_PI); +} +//----------------------------------------------------------------------------- +int mgls_put(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[1]==3 && k[0]==1) + a[0].d->Put(a[1].v, k[2]==3?iint(a[2].v):-1, k[3]==3?iint(a[3].v):-1, k[4]==3?iint(a[4].v):-1); + else if(k[0]==1 && k[1]==1) + a[0].d->Put(*(a[1].d), k[2]==3?iint(a[2].v):-1, k[3]==3?iint(a[3].v):-1, k[4]==3?iint(a[4].v):-1); + else return 1; + return 0; +} +void mglc_put(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==3) + mglprintf(out,1024,L"%s.Put(%g, %d, %d, %d);", a[0].s.c_str(), a[1].v, k[2]==3?iint(a[2].v):-1, k[3]==3?iint(a[3].v):-1, k[4]==3?iint(a[4].v):-1); + else if(k[0]==1 && k[1]==1) + mglprintf(out,1024,L"%s.Put(%s, %d, %d, %d);", a[0].s.c_str(), a[1].s.c_str(), k[2]==3?iint(a[2].v):-1, k[3]==3?iint(a[3].v):-1, k[4]==3?iint(a[4].v):-1); +} +//----------------------------------------------------------------------------- +int mgls_palette(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) gr->SetPalette(a[0].s.c_str()); + else return 1; + return 0; +} +void mglc_palette(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) mglprintf(out,1024,L"gr->SetPalette(\"%s\");", a[0].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_combine(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==1) + *(a[0].d) = a[1].d->Combine(*(a[2].d)); + else return 1; + return 0; +} +void mglc_combine(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==1) + mglprintf(out,1024,L"%s = %s.Combine(%s);",a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_pde(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) + *(a[0].d) = gr->PDE(a[1].s.c_str(), *(a[2].d), *(a[3].d), k[4]==3?a[4].v:0.1, k[5]==3?a[5].v:100,opt); + else return 1; + return 0; +} +void mglc_pde(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"%s = gr->PDE(\"%s\", %s, %s, %g, %g, \"%s\");",a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==3?a[4].v:0.1, k[5]==3?a[5].v:100,opt); +} +//----------------------------------------------------------------------------- +int mgls_qo2d(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1 && k[4]==1) + *(a[0].d) = mglData(true, mgl_qo2d_solve(a[1].s.c_str(), a[2].d, a[3].d, a[4].d, k[5]==3?a[5].v:1, k[6]==3?a[6].v:100, k[7]==1?a[7].d:0, k[8]==1?a[8].d:0)); + else return 1; + return 0; +} +void mglc_qo2d(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"%s = mglQO2d(\"%s\", %s, %s, %s, %g, %g, %s, %s);",a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), a[4].s.c_str(), k[5]==3?a[5].v:1, k[6]==3?a[6].v:100, k[7]==1?a[7].s.c_str():"NULL", k[8]==1?a[8].s.c_str():"NULL"); +} +//----------------------------------------------------------------------------- +int mgls_ray(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3 && k[6]==3 && k[7]==3) + *(a[0].d) = mglRay(a[1].s.c_str(), mglPoint(a[2].v, a[3].v, a[4].v), mglPoint(a[5].v, a[6].v, a[7].v), k[8]==3?a[8].v:0.1, k[9]==3?a[9].v:10); + else return 1; + return 0; +} +void mglc_ray(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==3 && k[3]==3 && k[4]==3 && k[5]==3 && k[6]==3 && k[7]==3) + mglprintf(out,1024,L"%s = mglRay(\"%s\", mglPoint(%g, %g, %g), mglPoint(%g, %g, %g), %g, %g);",a[0].s.c_str(), a[1].s.c_str(), a[2].v, a[3].v, a[4].v, a[5].v, a[6].v, a[7].v, k[8]==3?a[8].v:0.1, k[9]==3?a[9].v:10); +} +//----------------------------------------------------------------------------- +int mgls_jacobian(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + *(a[0].d) = mglJacobian(*(a[1].d), *(a[2].d), *(a[3].d)); + else if(k[0]==1 && k[1]==1 && k[2]==1) + *(a[0].d) = mglJacobian(*(a[1].d), *(a[2].d)); + else return 1; + return 0; +} +void mglc_jacobian(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"%s = mglJacobian(%s, %s, %s);", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str()); + else if(k[0]==1 && k[1]==1 && k[2]==1) + mglprintf(out,1024,L"%s = mglJacobian(%s, %s);", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_tens(mglGraph *gr, long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1 || k[1]!=1) return 1; + else if(k[2]!=1) gr->Tens(*(a[0].d),*(a[1].d), k[2]==2?a[2].s.c_str():"",opt); + else if(k[3]!=1) gr->Tens(*(a[0].d),*(a[1].d),*(a[2].d), k[3]==2?a[3].s.c_str():"",opt); + else gr->Tens(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d), k[4]==2?a[4].s.c_str():"",opt); + return 0; +} +void mglc_tens(wchar_t out[1024], long , mglArg *a, int k[10], const char *opt) +{ + if(k[0]!=1 || k[1]!=1) return; + else if(k[2]!=1) + mglprintf(out,1024,L"gr->Tens(%s, %s, \"%s\", \"%s\");",a[0].s.c_str(), a[1].s.c_str(), k[2]==2?a[2].s.c_str():"",opt); + else if(k[3]!=1) + mglprintf(out,1024,L"gr->Tens(%s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==2?a[3].s.c_str():"",opt); + else mglprintf(out,1024,L"gr->Plot(%s, %s, %s, %s, \"%s\", \"%s\");", a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==2?a[4].s.c_str():"",opt); +} +//----------------------------------------------------------------------------- +int mgls_ticklen(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==3) gr->SetTickLen(a[0].v, k[1]==3?a[1].v:1); else return 1; + return 0; +} +void mglc_ticklen(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ if(k[0]==3) mglprintf(out,1024,L"gr->SetTickLen(%g,%g);", a[0].v, k[1]==3?a[1].v:1); } +//----------------------------------------------------------------------------- +int mgls_axisstl(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==2) + gr->SetAxisStl(a[0].s.c_str(), k[1]==2?a[1].s.c_str():"", k[2]==2?a[2].s.c_str():""); + else return 1; + return 0; +} +void mglc_axisstl(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ if(k[0]==2) mglprintf(out,1024,L"gr->SetAxisStl(\"%s\",\"%s\",\"%s\");", a[0].s.c_str(), k[1]==2?a[1].s.c_str():"", k[2]==2?a[2].s.c_str():""); } +//----------------------------------------------------------------------------- +int mgls_ranges(mglGraph *gr, long n, mglArg *a, int k[10], const char *) +{ + register int i; + if(n==6) + { + bool ok=true; + for(i=0;i<6;i++) if(k[i]!=3) ok = false; + if(ok) gr->SetRanges(a[0].v,a[1].v,a[2].v, a[3].v,a[4].v,a[5].v); + else return 1; + } + else if(n==4) + { + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) gr->SetRanges(a[0].v,a[1].v, a[2].v,a[3].v); + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) gr->SetRanges(*(a[0].d),*(a[1].d), *(a[2].d),*(a[3].d)); + else return 1; + } + else if(k[0]==1 && k[1]==1 && k[2]==1) gr->SetRanges(*(a[0].d),*(a[1].d), *(a[2].d)); + else if(k[0]==1 && k[1]==1) gr->SetRanges(*(a[0].d),*(a[1].d)); + else return 1; + return 0; +} +void mglc_ranges(wchar_t out[1024], long n, mglArg *a, int k[10], const char *) +{ + register int i; + if(n==6) + { + bool ok=true; + for(i=0;i<6;i++) if(k[i]!=3) ok = false; + if(ok) mglprintf(out,1024,L"gr->SetRanges(%g, %g, %g, %g, %g, %g);", a[0].v,a[1].v,a[2].v,a[3].v,a[4].v,a[5].v); + } + else if(n==4) + { + if(k[0]==3 && k[1]==3 && k[2]==3 && k[3]==3) + mglprintf(out,1024,L"gr->SetRanges(%g, %g, %g, %g);", a[0].v,a[1].v,a[2].v,a[3].v); + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"gr->SetRanges(%s, %s, %s, %s);", a[0].s.c_str(),a[1].s.c_str(),a[2].s.c_str(),a[3].s.c_str()); + } + else if(k[0]==1 && k[1]==1 && k[2]==1) + mglprintf(out,1024,L"gr->SetRanges(%s, %s, %s);", a[0].s.c_str(),a[1].s.c_str(),a[2].s.c_str()); + else if(k[0]==1 && k[1]==1) + mglprintf(out,1024,L"gr->SetRanges(%s, %s);", a[0].s.c_str(),a[1].s.c_str()); +} +//----------------------------------------------------------------------------- +int mgls_adjust(mglGraph *gr, long , mglArg *a, int k[10], const char *) +{ gr->Adjust(k[0]==2?a[0].s.c_str():"xyzc"); return 0; } +void mglc_adjust(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ mglprintf(out,1024,L"gr->Adjust(\"%s\");",k[0]==2?a[0].s.c_str():"xyzc"); } +//----------------------------------------------------------------------------- +int mgls_insert(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) a[0].d->Insert(a[1].s.c_str()[0], k[2]==3 ? iint(a[2].v):0, k[3]==3 ? iint(a[3].v):1); + else return 1; + return 0; +} +void mglc_insert(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Insert('%c', %d, %d);", + a[0].s.c_str(), a[1].s.c_str()[0], k[2]==3 ? iint(a[2].v):0, k[3]==3 ? iint(a[3].v):1); +} +//----------------------------------------------------------------------------- +int mgls_delete(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) a[0].d->Delete(a[1].s.c_str()[0], k[2]==3 ? iint(a[2].v):0, k[3]==3 ? iint(a[3].v):1); + else return 1; + return 0; +} +void mglc_delete(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2) mglprintf(out,1024,L"%s.Delete('%c', %d, %d);", + a[0].s.c_str(), a[1].s.c_str()[0], k[2]==3 ? iint(a[2].v):0, k[3]==3 ? iint(a[3].v):1); +} +//----------------------------------------------------------------------------- +int mgls_roll(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==3) a[0].d->Roll(a[1].s.c_str()[0], iint(a[2].v)); + else return 1; + return 0; +} +void mglc_roll(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==2 && k[2]==3) mglprintf(out,1024,L"%s.Roll('%c', %d);", + a[0].s.c_str(), a[1].s.c_str()[0], iint(a[2].v)); +} +//----------------------------------------------------------------------------- +int mgls_triangulate(mglGraph *, long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + *(a[0].d) = mglTriangulation(*(a[1].d), *(a[2].d), *(a[3].d), k[4]==3?a[4].v:0); + else if(k[0]==1 && k[1]==1 && k[2]==1) + *(a[0].d) = mglTriangulation(*(a[1].d), *(a[2].d), k[3]==3?a[3].v:0); + else return 1; + return 0; +} +void mglc_triangulate(wchar_t out[1024], long , mglArg *a, int k[10], const char *) +{ + if(k[0]==1 && k[1]==1 && k[2]==1 && k[3]==1) + mglprintf(out,1024,L"%s = mglTriangulation(%s, %s, %s, %g);",a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), a[3].s.c_str(), k[4]==3?a[4].v:0); + else if(k[0]==1 && k[1]==1 && k[2]==1) + mglprintf(out,1024,L"%s = mglTriangulation(%s, %s, %g);",a[0].s.c_str(), a[1].s.c_str(), a[2].s.c_str(), k[3]==3?a[3].v:0); +} +//----------------------------------------------------------------------------- +mglCommand mgls_base_cmd[] = { + {L"addlegend",L"Add legend entry",L"addlegend 'txt' 'fmt'", mgls_addlegend, mglc_addlegend, false, 2}, + {L"addto",L"Add data or number",L"addto Var Dat|Var num", mgls_addto, mglc_addto, false, 3}, + {L"adjust",L"Adjust ticks for best view",L"adjust ['dir']", mgls_adjust, mglc_adjust, false, 2}, + {L"alpha",L"Switch on/off transparency",L"alpha [val]", mgls_alpha, mglc_alpha, false, 2}, + {L"alphadef",L"Set default transparency",L"alphadef val", mgls_alphadef, mglc_alphadef, false, 2}, + {L"ambient",L"Set ambient light brightness",L"ambient val", mgls_ambient, mglc_ambient, false, 2}, + {L"area",L"Draw area plot for 1D data",L"area Ydat ['fmt']|Xdat Ydat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_area, mglc_area, false, 0}, + {L"arrowsize",L"Set size of arrows",L"arrowsize val", mgls_arrowsize, mglc_arrowsize, false, 2}, + {L"aspect",L"Set aspect ration",L"aspect valx valy [valz]", mgls_aspect, mglc_aspect, false, 4}, + {L"axial",L"Draw surfaces of contour lines rotation",L"axial Zdat ['fmt' num]|Xdat Ydat Zdat ['fmt' num]", mgls_axial, mglc_axial, false, 0}, + {L"axis",L"Setup or draw axis",L"axis ['dir' adjust]|'fx' 'fy' ['fz' 'fc']|how", mgls_axis, mglc_axis, false, 1}, + {L"axisstl",L"Set axis and tick style",L"axisstl 'stl' ['sub']", mgls_axisstl, mglc_axisstl, false, 2}, + {L"ball",L"Draw point (ball)",L"ball posx posy ['fmt']|posx posy posz ['fmt']", mgls_ball, mglc_ball, false, 1}, + {L"barh",L"Draw horizontal bars for 1D data", L"barh Ydat ['fmt' above]|Xdat Ydat ['fmt' above]", mgls_barh, mglc_barh, false, 0}, + {L"bars",L"Draw bars for 1D data",L"bars Ydat ['fmt' above]|Xdat Ydat ['fmt' above]|Xdat Ydat Zdat ['fmt' above]", mgls_bars, mglc_bars, false, 0}, + {L"barwidth",L"Set default bars width",L"barwidth val", mgls_barwidth, mglc_barwidth, false, 2}, + {L"beam",L"Draw quasioptical beam",L"beam Tr G1 G2 Adat r ['sch' flag num] ", mgls_beam, mglc_beam, false, 0}, + {L"belt",L"Draw belts",L"belt Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_belt, mglc_belt, false, 0}, + {L"box",L"Draw bounding box",L"box ['fmt' ticks]", mgls_box, mglc_box, false, 1}, + {L"boxplot",L"Draw boxplot for 2D data",L"boxplot Ydat ['fmt']|Xdat Ydat ['fmt']", mgls_boxplot, mglc_boxplot, false, 0}, + {L"boxs",L"Draw boxes",L"boxs Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_boxs, mglc_boxs, false, 0}, + {L"candle",L"Draw candlestick chart",L"candle candle Vdat1 ['fmt']|Vdat1 Vdat2 ['fmt']|Vdat1 Ydat1 Ydat2 ['fmt']||Vdat1 Vdat2 Ydat1 Ydat2 ['fmt']|Xdat Vdat1 Vdat2 Ydat1 Ydat2 ['fmt']", mgls_candle, mglc_candle, false, 0}, + {L"chart",L"Draw chart",L"chart Dat ['fmt']", mgls_chart, mglc_chart, false, 0}, + {L"chdir",L"Change current directory",L"chdir 'dir'", mgls_chdir, mglc_chdir, false, 5}, + {L"clearlegend",L"Clear legend antries",L"clearlegend", mgls_clearlegend, mglc_clearlegend, false, 2}, + {L"clf",L"Clear picture",L"clf", mgls_clf, mglc_clf, false, 5}, + {L"cloud",L"Draw cloud",L"cloud Adat ['fmt']|Xdat Ydat Zdat Adat ['fmt']", mgls_cloud, mglc_cloud, false, 0}, + {L"colorbar",L"Draw colorbar",L"colorbar ['fmt' pos]|Vdat ['fmt' pos]|'sch' pos x y w h ", mgls_colorbar, mglc_colorbar, false, 1}, + {L"column",L"Get data column filled by formula on column ids",L"column Res Dat 'eq'", mgls_column, mglc_column, true, 3}, + {L"columnplot",L"Set position of plot inside cell of column", L"columnplot num ind [d]", mgls_columnplot, mglc_columnplot, false, 4}, + {L"combine", L"Direct multiplication of arrays", L"combine Res Adat Bdat", mgls_combine, mglc_combine, false, 3}, + {L"cone",L"Draw cone",L"cone x1 y1 z1 x2 y2 z2 r1 [r2 'fmt' edge]", mgls_cone, mglc_cone, false, 1}, + {L"cont",L"Draw contour lines",L"cont Zdat ['fmt' num zpos]|Vdat Zdat ['fmt' zpos]|Xdat Ydat Zdat ['fmt' num zpos]|Vdat Xdat Ydat Zdat ['fmt' zpos]", mgls_cont, mglc_cont, false, 0}, + {L"cont3",L"Draw contour lines for 3D data",L"cont3 Adat 'dir' [val 'fmt' num]|Vdat Adat 'dir' [val 'fmt']|Xdat Ydat Zdat Adat 'dir' [val 'fmt' num]|Vdat Xdat Ydat Zdar Adat 'dir' [val 'fmt']", mgls_cont3, mglc_cont3, false, 0}, + {L"contd",L"Draw solid contours with manual colors",L"contd Zdat ['fmt' num zpos]|Vdat Zdat ['fmt' zpos]|Xdat Ydat Zdat ['fmt' num zpos]|Vdat Xdat Ydat Zdat ['fmt' zpos]", mgls_contd, mglc_contd, false, 0}, + {L"contf",L"Draw solid contours",L"contf Zdat ['fmt' num zpos]|Vdat Zdat ['fmt' zpos]|Xdat Ydat Zdat ['fmt' num zpos]|Vdat Xdat Ydat Zdat ['fmt' zpos]", mgls_contf, mglc_contf, false, 0}, + {L"contf3",L"Draw solid contour lines for 3D data",L"contf3 Adat 'dir' [val 'fmt' num]|Vdat Adat 'dir' [val 'fmt']|Xdat Ydat Zdat Adat 'dir' [val 'fmt' num]|Vdat Xdat Ydat Zdar Adat 'dir' [val 'fmt']", mgls_contf3, mglc_contf3, false, 0}, + {L"contfx",L"Draw solid contour lines at x-slice (or x-plane)",L"contfx Dat ['fmt' pos num]", mgls_contfx, mglc_contfx, false, 0}, + {L"contfy",L"Draw solid contour lines at y-slice (or y-plane)",L"contfy Dat ['fmt' pos num]", mgls_contfy, mglc_contfy, false, 0}, + {L"contfz",L"Draw solid contour lines at z-slice (or z-plane)",L"contfz Dat ['fmt' pos num]", mgls_contfz, mglc_contfz, false, 0}, + {L"contx",L"Draw contour lines at x-slice (or x-plane)",L"contx Dat ['fmt' pos num]", mgls_contx, mglc_contx, false, 0}, + {L"conty",L"Draw contour lines at y-slice (or y-plane)",L"conty Dat ['fmt' pos num]", mgls_conty, mglc_conty, false, 0}, + {L"contz",L"Draw contour lines at z-slice (or z-plane)",L"contz Dat ['fmt' pos num]", mgls_contz, mglc_contz, false, 0}, + {L"copy",L"Copy data from another variable",L"copy Dat1 Dat2 ['eq' onaxis]", mgls_copy, mglc_copy, true, 3}, + {L"cosfft",L"Cos-Fourier transform at some direction",L"cosfft Dat 'dir'", mgls_cosfft, mglc_cosfft, false, 3}, + {L"crange",L"Set color range",L"crange Dat [sym] | c1 c2", mgls_crange, mglc_crange, false, 2}, + {L"crop",L"Crop edge of data",L"crop Dat n1 n2 'dir'", mgls_crop, mglc_crop, false, 3}, + {L"crust",L"Draw reconstructed surface for arbitrary data points",L"crust Xdat Ydat Zdat ['fmt']", mgls_crust, mglc_crust, false, 0}, + {L"ctick",L"Set ticks for colorbar",L"ctick 'tmpl' | dx", mgls_ctick, mglc_ctick, false, 2}, + {L"cumsum",L"Cumulative summation",L"cumsum Dat 'dir'", mgls_cumsum, mglc_cumsum, false, 3}, + {L"curve",L"Draw curve",L"curve x1 y1 dx1 dy1 x2 y2 dx2 dy2 ['fmt']|x1 y1 z1 dx1 dy1 dz1 x2 y2 z2 dx2 dy2 dz2 ['fmt']", mgls_curve, mglc_curve, false, 1}, + {L"cut",L"Setup plot points cutting",L"cut val|x1 y1 z1 x2 y2 z2|'cond'", mgls_cut, mglc_cut, false, 2}, + {L"datas",L"Print list of data names in HDF file",L"datas 'fname'", mgls_datas, mglc_datas, false, 3}, + {L"delete",L"Delete slice of data",L"delete Dat 'dir' [pos=0 num=1]", mgls_delete, mglc_delete, false, 3}, + {L"dens",L"Draw density plot",L"dens Zdat ['fmt' zpos]|Xdat Ydat Zdat ['fmt' zpos]", mgls_dens, mglc_dens, false, 0}, + {L"dens3",L"Draw density plot at slices of 3D data",L"dens3 Adat 'dir' [pos 'fmt']|Xdat Ydat Zdat Adat 'dir' [pos 'fmt']", mgls_dens3, mglc_dens3, false, 0}, + {L"densx",L"Draw density plot at x-slice (or x-plane)",L"densx Dat ['fmt' pos]", mgls_densx, mglc_densx, false, 0}, + {L"densy",L"Draw density plot at y-slice (or y-plane)",L"densy Dat ['fmt' pos]", mgls_densy, mglc_densy, false, 0}, + {L"densz",L"Draw density plot at z-slice (or z-plane)",L"densz Dat ['fmt' pos]", mgls_densz, mglc_densz, false, 0}, + {L"dew",L"Draw dew plot",L"dew Udat Vdat ['fmt']|Xdat Ydat Udat Vdat ['fmt']", mgls_dew, mglc_dew, false, 0}, + {L"diff",L"Numerically differentiate data",L"diff Var 'dir'", mgls_diff, mglc_diff, false, 3}, + {L"diff2",L"Numerically double differentiate data",L"diff2 Var 'dir'", mgls_diff2, mglc_diff2, false, 3}, + {L"divto",L"Divide by data or number",L"divto Var Dat|Var num", mgls_divto, mglc_divto, false, 3}, + {L"dots",L"Draw dots for arbitrary data points",L"dots Xdat Ydat Zdat ['fmt']", mgls_dots, mglc_dots, false, 0}, + {L"drop",L"Draw drop",L"drop x0 y0 dx dy r ['col' sh asp]|x0 y0 z0 dx dy dz r ['col' sh asp]", mgls_drop, mglc_drop, false, 0}, + {L"envelop",L"Find envelop for the data",L"envelop Dat ['dir']", mgls_envelop, mglc_envelop, false, 3}, + {L"error",L"Draw error boxes",L"error Ydat Yerr ['fmt']|Xdat Ydat Yerr ['fmt']|Xdat Ydat Xerr Yerr ['fmt']", mgls_error, mglc_error, false, 0}, + {L"evaluate",L"Evaluate (interpolate) values of array Dat at points i=idat,j=jdat,k=kdat",L"evaluate Res Dat Idat [norm]|Res Dat Idat Jdat [norm]|Res Dat Idat Jdat Kdat [norm]", mgls_evaluate, mglc_evaluate, true, 3}, + {L"export",L"Export data to PNG picture",L"export Dat 'fname' 'sch' [v1 v2]", mgls_import, mglc_import, false, 3}, + {L"extend",L"Extend data array",L"extend Dat dim1 [dim2]", mgls_extend, mglc_extend, false, 3}, + {L"facex",L"Draw face perpendicular to x-axis",L"facex x0 y0 z0 wy wz ['fmt' d1 d2]", mgls_facex, mglc_facex, false, 1}, + {L"facey",L"Draw face perpendicular to y-axis",L"facex x0 y0 z0 wx wz ['fmt' d1 d2]", mgls_facey, mglc_facey, false, 1}, + {L"facez",L"Draw face perpendicular to z-axis",L"facex x0 y0 z0 wy wz ['fmt' d1 d2]", mgls_facez, mglc_facez, false, 1}, + {L"fall",L"Draw waterfalls",L"fall Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_fall, mglc_fall, false, 0}, + {L"fgets",L"Print string from file",L"fgets x y z 'fname' [pos=0 'fmt' size]|x y z 'fname' [pos=0 'fmt' size]", mgls_fgets, mglc_fgets, false, 1}, + {L"fill",L"Fill data linearly in range [v1, v2]",L"fill Var v1 v2 ['dir'] | Var 'eq' [Vdat Wdat]", mgls_fill, mglc_fill, false, 3}, + {L"fillsample",L"Fill x-,k-samples for transforms",L"fillsample Var num 'how'", mgls_fillsample, mglc_fillsample, false, 3}, + {L"fit",L"Fit data to formula",L"fit Res A 'eq' 'var' [Ini]|Res X A 'eq' 'var' [Ini]|Res X Y A 'eq' 'var' [Ini]|Res X Y Z A 'eq' 'var' [Ini]", mgls_fit, mglc_fit, true, 3}, + {L"fits",L"Fit data to formula",L"fits Res A S 'eq' 'var' [Ini]|Res X A S 'eq' 'var' [Ini]|Res X Y A S 'eq' 'var' [Ini]|Res X Y Z A S 'eq' 'var' [Ini]", mgls_fits, mglc_fits, true, 3}, + {L"flow",L"Draw flow threads for vector field",L"flow Udat Vdat ['fmt' num]|Xdat Ydat Udat Vdat ['fmt' num]|Udat Vdat Wdat ['fmt' num]|Xdat Ydat Zdat Udat Vdat ['fmt' num]|\ + x0 y0 Udat Vdat ['fmt']|x0 y0 Xdat Ydat Udat Vdat ['fmt']|x0 y0 z0 Udat Vdat Wdat ['fmt']|x0 y0 z0 Xdat Ydat Zdat Udat Vdat Wdat ['fmt']", mgls_flow, mglc_flow, false, 0}, + {L"fog",L"Switch on/off fog",L"fog val [pos]", mgls_fog, mglc_fog, false, 2}, + {L"font",L"Setup font",L"font 'fmt' [size]", mgls_font, mglc_font, false, 2}, + {L"fplot",L"Plot curve by formula",L"fplot 'y(x)' ['fmt' num]|'x(t)' 'y(t)' 'z(t)' ['fmt' num]", mgls_fplot, mglc_fplot, false, 1}, + {L"fsurf",L"Plot surface by formula",L"fsurf 'z(x,y)' ['fmt' num]|'x(u,v)' 'y(u,v)' 'z(u,v)' ['fmt' num]", mgls_fsurf, mglc_fsurf, false, 1}, + {L"grad",L"Draw gradient lines for scalar field",L"grad Phi ['fmt' num]|Xdat Ydat Phi ['fmt' num]|Xdat Ydat Zdat Phi ['fmt' num]", mgls_grad, mglc_grad, false, 0}, + {L"grid",L"Draw grid",L"grid ['dir' 'fmt']", mgls_grid, mglc_grid, false, 0}, + {L"grid2",L"Draw grid for data array(s)",L"grid Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_grid2, mglc_grid2, false, 0}, + {L"grid3",L"Draw grid at slices of 3D data",L"grid3 Adat 'dir' [pos 'fmt']|Xdat Ydat Zdat Adat 'dir' [pos 'fmt']", mgls_grid3, mglc_grid3, false, 0}, + {L"hankel",L"Hankel transform at some direction",L"hankel Dat 'dir'", mgls_hankel, mglc_hankel, false, 3}, + {L"hist",L"Create histogram (distribution) of data values",L"hist Res Dat num v1 v2 [nsub]|Res Dat Wdat num v1 v2 [nsub]", mgls_hist, mglc_hist, true, 3}, + {L"idset",L"Set column id for data",L"idset Dat 'ids'", mgls_idset, mglc_idset, false, 3}, + {L"import",L"Import data from PNG picture",L"import Dat 'fname' 'scheme' [v1 v2]", mgls_import, mglc_import, true, 3}, + {L"info",L"Print information about data",L"info Dat [detail]|'message'", mgls_info, mglc_info, false, 3}, + {L"inplot",L"Set position of plot in picture",L"x1 x2 y1 y2 [rel]", mgls_inplot, mglc_inplot, false, 4}, + {L"insert",L"Insert slice of data",L"insert Dat 'dir' [pos=0 num=1]", mgls_insert, mglc_insert, false, 3}, + {L"integrate",L"Integrate data",L"integrate Dat 'dir'", mgls_integrate, mglc_integrate, false, 3}, + {L"jacobian",L"Get Jacobian",L"jacobian Res Xdat Ydat [Zdat]", mgls_jacobian, mglc_jacobian, true, 3}, + {L"label",L"Draw label at arbitrary position",L"label x y 'txt' ['fmt' size]", mgls_label, mglc_label, false, 1}, + {L"legend",L"Draw legend",L"legend [pos 'fmt' size llen]|x y ['fmt' size llen]", mgls_legend, mglc_legend, false, 1}, + {L"legendmarks",L"Set number of marks in the legend",L"legendmarks val", mgls_legendmarks, mglc_legendmarks, false, 2}, + {L"light",L"Setup light",L"light [val] | val num | num xpos ypos zpos ['fmt' br]", mgls_light, mglc_light, false, 2}, + {L"line",L"Draw line",L"line x1 y1 x2 y2 ['fmt']|x1 y1 z1 x2 y2 z2 ['fmt']", mgls_line, mglc_line, false, 1}, + {L"loadfont",L"Load fontfaces",L"loadfont ['fmt']", mgls_loadfont, mglc_loadfont, false, 2}, + {L"map",L"Draw mapping plot",L"map Udat Vdat ['fmt']|Xdat Ydat Udat Vdat ['fmt']", mgls_map, mglc_map, false, 0}, + {L"mark",L"Draw mark plot for 1D data",L"mark Ydat Rdat ['fmt']|Xdat Ydat Rdat ['fmt']|Xdat Ydat Zdat Rdat ['fmt']", mgls_mark, mglc_mark, false, 0}, + {L"marksize",L"Set size of markers",L"marksize val", mgls_marksize, mglc_marksize, false, 2}, + {L"max",L"Find maximal value over direction",L"max Res Dat 'dir'", mgls_max, mglc_max, true, 3}, + {L"mesh",L"Draw mesh surface",L"mesh Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_mesh, mglc_mesh, false, 0}, + {L"meshnum",L"Set number of lines in mesh/fall/vect and so on",L"meshnum val", mgls_meshnum, mglc_meshnum, false, 2}, + {L"min",L"Find minimal value over direction",L"min Res Dat 'dir'", mgls_min, mglc_min, true, 3}, + {L"mirror",L"Mirror data at some direction",L"mirror Dat 'dir'", mgls_mirror, mglc_mirror, false, 3}, + {L"modify",L"Modify data values by formula",L"modify Dat 'eq' [num] | Dat 'eq' Vdat [Wdat]", mgls_modify, mglc_modify, false, 3}, + {L"momentum",L"Get momentum along direction",L"momentum Res Dat 'how' ['dir']", mgls_momentum, mglc_momentum, true, 3}, + {L"multiplot",L"Set position of plot",L"multiplot m n pos dx dy 'style'", mgls_multiplot, mglc_multiplot, false, 4}, + {L"multo",L"Multiply by data or number",L"multo Var Dat|Var num", mgls_multo, mglc_multo, false, 3}, + {L"new",L"Create new data",L"new Dat nx [ny nz]", mgls_new, mglc_new, true, 3}, + {L"norm",L"Normalize data",L"norm Dat v1 v2 [sym dim]", mgls_norm, mglc_norm, false, 3}, + {L"normsl",L"Normalize data slice by slice",L"normsl Dat v1 v2 ['dir' keep sym] ", mgls_normsl, mglc_normsl, false, 3}, + {L"origin",L"Set axis origin",L"origin x0 y0 [z0]", mgls_origin, mglc_origin, false, 2}, + {L"palette",L"Set palette for 1D plots",L"palette 'colors'", mgls_palette, mglc_palette, false, 2}, + {L"pde",L"Solve PDE",L"pde Res 'ham' IniRe IniIm [dz k0]", mgls_pde, mglc_pde, true, 3}, + {L"perspective",L"Set perspective",L"perspective val", mgls_perspective, mglc_perspective, false, 2}, + {L"pipe",L"Draw flow pipes for vector field",L"pipe Udat Vdat ['fmt' rad num]|Xdat Ydat Udat Vdat ['fmt' rad num]|Udat Vdat Wdat ['fmt' rad num]|Xdat Ydat Zdat Udat Vdat Wdat ['fmt' rad num]", mgls_pipe, mglc_pipe, false, 0}, + {L"plot",L"Draw usual plot for 1D data",L"plot Ydat ['fmt']|Xdat Ydat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_plot, mglc_plot, false, 0}, + {L"put",L"Put value (numeric or array) to given data element",L"put Dat val [i j k] | Dat Val [i j k]", mgls_put, mglc_put, false, 3}, + {L"putsfit",L"Print fitted formula",L"putsfit x y ['pre' 'font' size]|x y z ['pre' 'font' size]", mgls_putsfit, mglc_putsfit, false, 0}, + {L"qo2d",L"Solve PDE in accompanied coordinates",L"qo2d Res 'ham' IniRe IniIm Ray [r k0 Xout Yout]", mgls_qo2d, mglc_qo2d, true, 3}, + {L"quadplot",L"Draw surface of quadrangles",L"quadplot Idat Xdat Ydat ['fmt']|Idat Xdat Ydat Zdat ['fmt']|Idat Xdat Ydat Zdat Cdat ['fmt'] ", mgls_quadplot, mglc_quadplot, false, 0}, + {L"quality",L"Set plot quality",L"quality val", mgls_quality, mglc_quality, false, 2}, + {L"radar",L"Draw radar chart",L"radar Rdat ['fmt']", mgls_radar, mglc_radar, false, 0}, + {L"ranges",L"Set axis ranges",L"ranges x1 x2 y1 y2 [z1 z2]", mgls_ranges, mglc_ranges, false, 2}, + {L"ray",L"Solve Hamiltonian ODE (find GO ray or trajectory)",L"ray Res 'ham' x0 y0 z0 px0 py0 pz0 [dz=0.1 tmax=10]", mgls_ray, mglc_ray, true, 3}, + {L"read",L"Read data from file",L"read Dat 'file' [nx ny nz]", mgls_read, mglc_read, true, 3}, + {L"readall",L"Read and join data from several files",L"readall Dat 'templ' [slice]", mgls_readall, mglc_readall, true, 3}, + {L"readhdf",L"Read data from HDF5 file",L"readhdf Dat 'file' 'id'", mgls_readhdf, mglc_readhdf, true, 3}, + {L"readmat",L"Read data from file with sizes specified in first row",L"readmat Dat 'file' [dim]", mgls_readmat, mglc_readmat, true, 3}, + {L"rearrange",L"Rearrange data dimensions",L"rearrange Dat mx [my mz]", mgls_rearrange, mglc_rearrange, false, 3}, + {L"rect",L"Draw rectangle",L"rect x1 y1 x2 y2 ['fmt']|x1 y1 z1 x2 y2 z2 ['fmt']", mgls_rect, mglc_rect, false, 1}, + {L"region",L"Draw filled region between 2 curves",L"region Ydat1 Ydat2 ['fmt' inside]|Xdat Ydat1 Ydat2 ['fmt' inside]", mgls_region, mglc_region, false, 0}, + {L"resize",L"Resize data",L"resize Res Dat mx [my mz]", mgls_resize, mglc_resize, true, 3}, + {L"roll",L"Roll data along direction",L"roll Dat 'dir' num", mgls_roll, mglc_roll, false, 0}, + {L"rotate",L"Rotate plot",L"rotate tetz tetx [tety] | tet x y z", mgls_rotate, mglc_rotate, false, 4}, + {L"rotatetext",L"Set to auto rotate text or not",L"rotatetext val", mgls_rotatetext, mglc_rotatetext, false, 2}, + {L"save",L"Save data to file",L"save Dat 'file'", mgls_save, mglc_save, false, 3}, + {L"savehdf",L"Save data to HDF5 file",L"savehdf Dat 'file' 'id'", mgls_savehdf, mglc_savehdf, false, 3}, + {L"setsize",L"Set picture size",L"setsize width height", mgls_setsize, mglc_setsize, false, 5}, + {L"sew",L"Remove jump into the data, like phase jumps",L"sew Dat ['dir' da]", mgls_sew, mglc_sew, false, 3}, + {L"sinfft",L"Sin-Fourier transform at some direction",L"sinfft Dat 'dir'", mgls_sinfft, mglc_sinfft, false, 3}, + {L"smooth",L"Smooth data",L"smooth Dat [kind 'dir']", mgls_smooth, mglc_smooth, false, 3}, + {L"sphere",L"Draw sphere",L"sphere x0 y0 r ['fmt']|x0 y0 z0 r ['fmt']", mgls_sphere, mglc_sphere, false, 1}, + {L"squeeze",L"Squeeze data",L"squeeze Dat kx [ky kz]", mgls_squeeze, mglc_squeeze, false, 3}, + {L"stem",L"Draw stem plot for 1D data",L"stem Ydat ['fmt']|Xdat Ydat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_stem, mglc_stem, false, 0}, + {L"step",L"Draw step plot for 1D data",L"step Ydat ['fmt']|Xdat Ydat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_step, mglc_step, false, 0}, + {L"stfa",L"Draw STFA diagram",L"stfa Udat Vdat dn ['fmt']|Xdat Ydat Udat Vdat dn ['fmt']", mgls_stfa, mglc_stfa, false, 0}, + {L"stfad",L"Do STFA transform",L"stfad Res Real Imag dn ['dir']", mgls_stfad, mglc_stfad, true, 3}, + {L"stickplot",L"Set position of plot inside cell of stick", L"stickplot num ind tet phi", mgls_stickplot, mglc_stickplot, false, 4}, + {L"subdata",L"Extract sub-array",L"subdata Res Dat nx [ny nz]", mgls_subdata, mglc_subdata, true, 3}, + {L"subplot",L"Set position of plot",L"subplot m n pos [dx dy]|m n pos 'style'", mgls_subplot, mglc_subplot, false, 4}, + {L"subto",L"Subtract data or number",L"subto Var Dat|Var num", mgls_subto, mglc_subto, false, 3}, + {L"sum",L"Find summation over direction",L"sum Res Dat 'dir'", mgls_sum, mglc_sum, true, 3}, + {L"surf",L"Draw solid surface",L"surf Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_surf, mglc_surf, false, 0}, + {L"surf3",L"Draw isosurface for 3D data",L"surf3 Adat ['fmt' num]|Xdat Ydat Zdat Adat ['fmt' num]|Adat val ['fmt']|Xdat Ydat Zdat Adat val ['fmt']", mgls_surf3, mglc_surf3, false, 0}, + {L"surf3a",L"Draw isosurface for 3D data transpared by other data",L"surf3a Adat Cdat ['fmt' num]|Xdat Ydat Zdat Adat Cdat ['fmt' num]|Adat Cdat val ['fmt']|Xdat Ydat Zdat Adat Cdat val ['fmt']", mgls_surf3a, mglc_surf3a, false, 0}, + {L"surf3c",L"Draw isosurface for 3D data colored by other data",L"surf3c Adat Cdat ['fmt' num]|Xdat Ydat Zdat Adat Cdat ['fmt' num]|Adat Cdat val ['fmt']|Xdat Ydat Zdat Adat Cdat val ['fmt']", mgls_surf3c, mglc_surf3c, false, 0}, + {L"surfa",L"Draw solid surface transpared by other data",L"surfa Zdat Cdat ['fmt']|Xdat Ydat Zdat Cdat ['fmt']", mgls_surfa, mglc_surfa, false, 0}, + {L"surfc",L"Draw solid surface colored by other data",L"surfc Zdat Cdat ['fmt']|Xdat Ydat Zdat Cdat ['fmt']", mgls_surfc, mglc_surfc, false, 0}, + {L"swap",L"Swap data (usefull after Fourier transform)",L"swap Dat 'dir'", mgls_swap, mglc_swap, false, 0}, + {L"tens",L"Draw tension plot for 1D data",L"tens Ydat Cdat ['fmt']|Xdat Ydat Cdat ['fmt']|Xdat Ydat Zdat Cdat ['fmt']", mgls_tens, mglc_tens, false, 0}, + {L"ternary",L"Switch on/off to use ternary axis",L"ternary val", mgls_ternary, mglc_ternary, false, 2}, + {L"text",L"Draw text at some position or along curve",L"text x y 'txt' ['fmt' size]|x y z 'txt' ['fmt' size]|x y dx dy 'txt' ['fmt' size]|x y z dx dy dz 'txt' ['fmt' size]|Ydat 'txt' ['font' sise]|Xdat Ydat 'txt' ['font' sise]", mgls_text, mglc_text, false, 0}, + {L"textmark",L"Draw TeX mark at point position",L"textmark Ydat Rdat 'text' ['fmt']|Xdat Ydat Rdat 'text' ['fmt']|Xdat Ydat Zdat Rdat 'text' ['fmt']", mgls_textmark, mglc_textmark, false, 0}, + {L"ticklen",L"Set tick length",L"ticklen val [stt]", mgls_ticklen, mglc_ticklen, false, 2}, + {L"tile",L"Draw horizontal tiles",L"tile Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_tile, mglc_tile, false, 0}, + {L"tiles",L"Draw horizontal tiles with variable size",L"tiles Zdat Rdat ['fmt']|Xdat Ydat Zdat Rdat ['fmt']", mgls_tiles, mglc_tiles, false, 0}, + {L"title",L"Add title for current subplot/inplot",L"title 'txt' ['fmt' size]", mgls_title, mglc_title, false, 0}, + {L"tlabel",L"Draw label for t-axis",L"tlabel 'txt' [pos size shift]", mgls_tlabel, mglc_tlabel, false, 1}, + {L"torus",L"Draw surface of curve rotation",L"torus Rdat ['fmt']|Zdat Rdat ['fmt']", mgls_torus, mglc_torus, false, 0}, + {L"trace",L"Get trace of array",L"trace Res Dat", mgls_trace, mglc_trace, true, 3}, + {L"traj",L"Draw vectors along a curve",L"traj Xdat Ydat Udat Vdat ['fmt' len]|Xdat Ydat Zdat Udat Vdat Wdat ['fmt' len]", mgls_traj, mglc_traj, false, 0}, + {L"transform",L"Do integral transform of data",L"transform Res 'how' Rdat Idat", mgls_transform, mglc_transform, true, 3}, + {L"transforma",L"Do integral transform of data",L"transforma Res 'how' Adat Pdat", mgls_transforma, mglc_transforma, true, 3}, + {L"transpose",L"Transpose data array",L"transpose Dat ['dir']", mgls_transpose, mglc_transpose, false, 3}, + {L"transptype",L"Set type transparency",L"transptype val", mgls_transptype, mglc_transptype, false, 2}, + {L"triangulate",L"Find triangles of randomly placed points",L"triangulate Res Xdat Ydat [er]|Res Xdat Ydat Zdat [er]", mgls_triangulate, mglc_triangulate, true, 3}, + {L"tricont",L"Draw contour lines for surface of triangles",L"tricont Vdat Idat Xdat Ydat ['fmt']|Vdat Idat Xdat Ydat Zdat ['fmt']|Vdat Idat Xdat Ydat Zdat Cdat ['fmt'] ", mgls_tricont, mglc_tricont, false, 0}, + {L"triplot",L"Draw surface of triangles",L"triplot Idat Xdat Ydat ['fmt']|Idat Xdat Ydat Zdat ['fmt']|Idat Xdat Ydat Zdat Cdat ['fmt'] ", mgls_triplot, mglc_triplot, false, 0}, + {L"tube",L"Draw curve by tube",L"tube Ydat Rdat ['fmt']|Ydat rval ['fmt']|Xdat Ydat Rdat ['fmt']|Xdat Ydat rval ['fmt']|Xdat Ydat Zdat Rdat ['fmt']|Xdat Ydat Zdat rval ['fmt']", mgls_tube, mglc_tube, false, 0}, + {L"var",L"Create new 1D data and fill it in range",L"var Dat nx x1 [x2]", mgls_var, mglc_var, true, 3}, + {L"vect",L"Draw vector field",L"vect Udat Vdat ['fmt' kind]|Xdat Ydat Udat Vdat ['fmt' kind]|Udat Vdat Wdat ['fmt' kind]|Xdat Ydat Zdat Udat Vdat Wdat ['fmt' kind]", mgls_vect, mglc_vect, false, 0}, + {L"write",L"Write current image to graphical file",L"write 'fname' [solid]", mgls_write, mglc_write, false, 5}, + {L"xlabel",L"Draw label for x-axis",L"xlabel 'txt' [pos size shift]", mgls_xlabel, mglc_xlabel, false, 1}, + {L"xrange",L"Set range for x-axis",L"xrange Dat [add] | x1 x2", mgls_xrange, mglc_xrange, false, 2}, + {L"xtick",L"Set ticks for x-axis",L"xtick dx [sx tx] | 'tmpl'", mgls_xtick, mglc_xtick, false, 2}, + {L"ylabel",L"Draw label for y-axis",L"ylabel 'txt' [pos size shift]", mgls_ylabel, mglc_ylabel, false, 1}, + {L"yrange",L"Set range for y-axis",L"yrange Dat [add] | y1 y2", mgls_yrange, mglc_yrange, false, 2}, + {L"ytick",L"Set ticks for y-axis",L"ytick dy [sy ty] | 'tmpl'", mgls_ytick, mglc_ytick, false, 2}, + {L"zlabel",L"Draw label for z-axis",L"zlabel 'txt' [pos size shift]", mgls_zlabel, mglc_zlabel, false, 1}, + {L"zrange",L"Set range for z-axis",L"yrange Dat [add] | z1 z2", mgls_zrange, mglc_zrange, false, 2}, + {L"ztick",L"Set ticks for z-axis",L"ztick dz [sz tz] | 'tmpl'", mgls_ztick, mglc_ztick, false, 2}, +{L"",L"",L"",NULL,NULL,0,0}}; +//----------------------------------------------------------------------------- +int mgl_draw_class(mglBase *gr, void *p) +{ mglGraph g(gr); return p ? ((mglDraw *)p)->Draw(&g) : 0; } +void mgl_reload_class(void *p) +{ if(p) ((mglDraw *)p)->Reload(); } +//----------------------------------------------------------------------------- +int mgl_draw_graph(mglBase *gr, void *p) +{ + mglGraph g(gr); + draw_func func = (draw_func)(p); + return func ? func(&g) : 0; +} +//----------------------------------------------------------------------------- diff --git a/mgl/mgl_export.cpp b/src/export.cpp similarity index 72% rename from mgl/mgl_export.cpp rename to src/export.cpp index ec8ca81..e45e020 100644 --- a/mgl/mgl_export.cpp +++ b/src/export.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * mgl_export.cpp is part of Math Graphic Library + * export.cpp is part of Math Graphic Library * Copyright (C) 2007 Alexey Balakin * * * * This program is free software; you can redistribute it and/or modify * @@ -32,34 +32,17 @@ extern "C" { } #endif -#include "mgl/mgl.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" +#include "mgl/canvas.h" +#include "mgl/canvas_cf.h" +int mgl_tga_save(const char *fname, int w, int h, unsigned char **p); int mgl_bps_save(const char *fname, int w, int h, unsigned char **p); int mgl_bmp_save(const char *fname, int w, int h, unsigned char **p); int mgl_png_save(const char *fname, int w, int h, unsigned char **p); int mgl_pnga_save(const char *fname, int w, int h, unsigned char **p); int mgl_jpeg_save(const char *fname, int w, int h, unsigned char **p); //----------------------------------------------------------------------------- -unsigned char **mglGraph::GetRGBLines(long &, long &, unsigned char *&f, bool ) -{ f=0; return 0; } -//----------------------------------------------------------------------------- -void mglGraph::WriteSVG(const char *,const char *) {} -void mglGraph::WriteIDTF(const char *,const char *) {} -void mglGraph::WriteU3D(const char *,const char *) {} -void mglGraph::WritePDF(const char *,const char *) {} -void mglGraph::DoubleSided(bool ) {} -void mglGraph::VertexColor(bool ) {} -void mglGraph::TextureColor(bool ){} -void mglGraph::Compression(bool ) {} -void mglGraph::Unrotate(bool ) {} -void mglGraph::BallIsPoint(bool ) {} -void mglGraph::StartGroup ( const char * ) {} -void mglGraph::StartAutoGroup ( const char * ) {} -void mglGraph::EndGroup() {} -//----------------------------------------------------------------------------- -void mglGraph::WriteJPEG(const char *fname,const char *) +void mglCanvas::WriteJPEG(const char *fname,const char *) { #ifdef HAVE_JPEG long w,h; @@ -75,20 +58,31 @@ void mglGraph::WriteJPEG(const char *fname,const char *) #endif } //----------------------------------------------------------------------------- -void mglGraph::WritePNG(const char *fname,const char *,bool alpha) +void mglCanvas::WritePNGs(const char *fname,const char *) { long w,h; unsigned char *f=0, **p=0; - p = GetRGBLines(w,h,f,alpha); + p = GetRGBLines(w,h,f,false); if(p) { - if(alpha && mgl_pnga_save(fname,w,h,p)) SetWarn(mglWarnOpen,fname); - if(!alpha && mgl_png_save(fname,w,h,p)) SetWarn(mglWarnOpen,fname); + if(mgl_png_save(fname,w,h,p)) SetWarn(mglWarnOpen,fname); free(p); if(f) free(f); } } //----------------------------------------------------------------------------- -void mglGraph::WriteBMP(const char *fname,const char *) +void mglCanvas::WritePNG(const char *fname,const char *) +{ + long w,h; + unsigned char *f=0, **p=0; + p = GetRGBLines(w,h,f,true); + if(p) + { + if(mgl_pnga_save(fname,w,h,p)) SetWarn(mglWarnOpen,fname); + free(p); if(f) free(f); + } +} +//----------------------------------------------------------------------------- +void mglCanvas::WriteBMP(const char *fname,const char *) { long w,h; unsigned char *f=0, **p=0; @@ -100,7 +94,19 @@ void mglGraph::WriteBMP(const char *fname,const char *) } } //----------------------------------------------------------------------------- -void mglGraph::WriteEPS(const char *fname,const char *) +void mglCanvas::WriteTGA(const char *fname,const char *) +{ + long w,h; + unsigned char *f=0, **p=0; + p = GetRGBLines(w,h,f,true); + if(p) + { + if(mgl_tga_save(fname,w,h,p)) SetWarn(mglWarnOpen,fname); + free(p); if(f) free(f); + } +} +//----------------------------------------------------------------------------- +void mglCanvas::WriteBPS(const char *fname,const char *) { long w,h; unsigned char *f=0, **p=0; @@ -181,20 +187,45 @@ int mgl_bmp_save(const char *fname, int w, int h, unsigned char **p) fwrite("BM",2,1,fp); fwrite(&u,4,1,fp); fwrite(z,4,1,fp); u=54; fwrite(&u,4,1,fp); // BITMAPINFOHEADER - u=40; fwrite(&u,4,1,fp); fwrite(&(w),4,1,fp); fwrite(&(h),4,1,fp); + u=40; fwrite(&u,4,1,fp); fwrite(&w,4,1,fp); fwrite(&h,4,1,fp); unsigned short pp=1; fwrite(&pp,2,1,fp); pp=24; fwrite(&pp,2,1,fp); u = w*h*3; fwrite(z,4,1,fp); fwrite(&u,4,1,fp); fwrite(z,4,1,fp); fwrite(z,4,1,fp); fwrite(z,4,1,fp); fwrite(z,4,1,fp); // image -// for(int i=h-1;i>=0;i--) fwrite(p[i],3*w,1,fp); + const unsigned char *q; register int i,j; for(i=h-1;i>=0;i--) for(j=0;j=0;i--) for(j=0;jWritePNG(fname,descr); } -/// Write the frame in file using PNG format +{ _Gr_->WritePNG(fname,descr); } void mgl_write_png_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; char *f=new char[n+1]; memcpy(f,descr,n); f[n]=0; - _GR_->WritePNG(s,f); delete []s; delete []f; -} -/// Write the frame in file using PNG format + _GR_->WritePNG(s,f); delete []s; delete []f; } void mgl_write_png_solid(HMGL gr, const char *fname,const char *descr) -{ gr->WritePNG(fname,descr,false); } -/// Write the frame in file using PNG format +{ _Gr_->WritePNGs(fname,descr); } void mgl_write_png_solid_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; char *f=new char[n+1]; memcpy(f,descr,n); f[n]=0; - _GR_->WritePNG(s,f,false); delete []s; delete []f; -} + _GR_->WritePNGs(s,f); delete []s; delete []f; } //----------------------------------------------------------------------------- -/// Write the frame in file using JPEG format void mgl_write_jpg(HMGL gr, const char *fname,const char *descr) -{ gr->WriteJPEG(fname,descr); } -/// Write the frame in file using JPEG format +{ _Gr_->WriteJPEG(fname,descr); } void mgl_write_jpg_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; char *f=new char[n+1]; memcpy(f,descr,n); f[n]=0; - _GR_->WriteJPEG(s,f); delete []s; delete []f; -} + _GR_->WriteJPEG(s,f); delete []s; delete []f; } //----------------------------------------------------------------------------- -/// Write the frame in file using TIFF format -void mgl_write_bmp(HMGL gr, const char *fname,const char *descr) -{ gr->WriteBMP(fname,descr); } -/// Write the frame in file using TIFF format -void mgl_write_bmp_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; +void mgl_write_tga(HMGL gr, const char *fname,const char *descr) +{ _Gr_->WriteTGA(fname,descr); } +void mgl_write_tga_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; char *f=new char[n+1]; memcpy(f,descr,n); f[n]=0; - _GR_->WriteBMP(s,f); delete []s; delete []f; -} + _GR_->WriteTGA(s,f); delete []s; delete []f; } //----------------------------------------------------------------------------- -/// Write the frame in file using IDTF format -void mgl_write_idtf(HMGL gr, const char *fname,const char *descr) -{ gr->WriteIDTF(fname,descr); } -/// Write the frame in file using IDTF format -void mgl_write_idtf_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; +void mgl_write_bmp(HMGL gr, const char *fname,const char *descr) +{ _Gr_->WriteBMP(fname,descr); } +void mgl_write_bmp_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; char *f=new char[n+1]; memcpy(f,descr,n); f[n]=0; - _GR_->WriteIDTF(s,f); delete []s; delete []f; -} + _GR_->WriteBMP(s,f); delete []s; delete []f; } //----------------------------------------------------------------------------- -/// Write the frame in file using U3D format -void mgl_write_u3d(HMGL gr, const char *fname,const char *descr) -{ gr->WriteU3D(fname,descr); } -/// Write the frame in file using U3D format -void mgl_write_u3d_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; +void mgl_write_bps(HMGL gr, const char *fname,const char *descr) +{ _Gr_->WriteBPS(fname,descr); } +void mgl_write_bps_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; char *f=new char[n+1]; memcpy(f,descr,n); f[n]=0; - _GR_->WriteU3D(s,f); delete []s; delete []f; -} + _GR_->WriteBPS(s,f); delete []s; delete []f; } //----------------------------------------------------------------------------- -/// Write the frame in file using PDF format -void mgl_write_pdf(HMGL gr, const char *fname,const char *descr) -{ gr->WritePDF(fname,descr); } -/// Write the frame in file using PDF format -void mgl_write_pdf_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; +void mgl_write_idtf(HMGL gr, const char *fname,const char *descr) +{ _Gr_->WriteIDTF(fname,descr); } +void mgl_write_idtf_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; char *f=new char[n+1]; memcpy(f,descr,n); f[n]=0; - _GR_->WritePDF(s,f); delete []s; delete []f; -} + _GR_->WriteIDTF(s,f); delete []s; delete []f; } //----------------------------------------------------------------------------- -/// Write the frame in file using PNG format void mgl_write_gif(HMGL gr, const char *fname,const char *descr) -{ gr->WriteGIF(fname,descr); } -/// Write the frame in file using PNG format +{ _Gr_->WriteGIF(fname,descr); } void mgl_write_gif_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; char *f=new char[n+1]; memcpy(f,descr,n); f[n]=0; - _GR_->WriteGIF(s,f); delete []s; delete []f; -} + _GR_->WriteGIF(s,f); delete []s; delete []f; } //----------------------------------------------------------------------------- -/// Write the frame in file using PNG format void mgl_start_gif(HMGL gr, const char *fname,int ms) -{ gr->StartGIF(fname,ms); } -/// Write the frame in file using PNG format +{ _Gr_->StartGIF(fname,ms); } void mgl_start_gif_(uintptr_t *gr, const char *fname,int *ms,int l) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; - _GR_->StartGIF(s,*ms); delete []s; -} +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; + _GR_->StartGIF(s,*ms); delete []s; } //----------------------------------------------------------------------------- -/// Write the frame in file using PNG format -void mgl_close_gif(HMGL gr) -{ gr->CloseGIF(); } -/// Write the frame in file using PNG format -void mgl_start_gif_(uintptr_t *gr) -{ - _GR_->CloseGIF(); -} +void mgl_close_gif(HMGL gr) { _Gr_->CloseGIF(); } +void mgl_close_gif_(uintptr_t *gr) { _GR_->CloseGIF(); } //----------------------------------------------------------------------------- void mgl_write_frame(HMGL gr, const char *fname,const char *descr) -{ gr->WriteFrame(fname,descr); } +{ _Gr_->WriteFrame(fname,descr); } void mgl_write_frame_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) -{ - char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; char *f=new char[n+1]; memcpy(f,descr,n); f[n]=0; - _GR_->WriteFrame(s,f); delete []s; delete []f; -} + _GR_->WriteFrame(s,f); delete []s; delete []f;} +//----------------------------------------------------------------------------- +void mgl_show_image(HMGL gr, const char *viewer, int keep) +{ _Gr_->ShowImage(viewer,keep); } +void mgl_show_image_(uintptr_t *gr, const char *viewer, int *keep, int l) +{ char *s=new char[l+1]; memcpy(s,viewer,l); s[l]=0; + _GR_->ShowImage(s,*keep); delete []s; } //----------------------------------------------------------------------------- diff --git a/src/export_2d.cpp b/src/export_2d.cpp new file mode 100644 index 0000000..9cee46a --- /dev/null +++ b/src/export_2d.cpp @@ -0,0 +1,524 @@ +/*************************************************************************** + * export_2d.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "mgl/canvas.h" +#include "mgl/canvas_cf.h" +#include +#include +#include +void mgl_printf(void *fp, bool gz, const char *str, ...); +//----------------------------------------------------------------------------- +char *mgl_get_dash(unsigned short d, float w) +{ + static char s[64],b[4]; + if(d==0xffff) { strcpy(s,""); return s; } + int f=0, p=d&1, n=p?0:1, i, j; + strcpy(s, p ? "" : "0"); + for(i=0;i<16;i++) + { + j = i;//15-i; + if(((d>>j)&1) == p) f++; + else + { + sprintf(b," %g",f*w); strcat(s,b); + p = (d>>j)&1; f = 1; n++; + } + } + sprintf(b," %g",f*w); strcat(s,b); + strcat(s,n%2 ? "" : " 0"); + return s; +} +//----------------------------------------------------------------------------- +bool mglCanvas::IsSame(const mglPrim &pr,float wp,mglColor cp,int st) +{ + if(abs(pr.type)!=1) return false; + if(pr.w>=1 && wp!=pr.w) return false; + if(pr.w<1 && wp!=1) return false; + if(st!=pr.n3) return false; + mglColor c=put_color(pr); + return (cp==c); +} +//----------------------------------------------------------------------------- +void mglCanvas::WriteEPS(const char *fname,const char *descr) +{ + if(Prm.size()<1) return; + if(!get(MGL_FINISHED)) Finish(); + time_t now; + time(&now); + + bool gz = fname[strlen(fname)-1]=='z'; + void *fp = gz ? gzopen(fname,"wt") : fopen(fname,"wt"); + if(!fp) { SetWarn(mglWarnOpen,fname); return; } + mgl_printf(fp, gz, "%%!PS-Adobe-3.0 EPSF-3.0\n%%%%BoundingBox: 0 0 %d %d\n",Width,Height); + mgl_printf(fp, gz, "%%%%Creator: MathGL library\n%%%%Title: %s\n",descr ? descr : fname); + mgl_printf(fp, gz, "%%%%CreationDate: %s\n",ctime(&now)); + mgl_printf(fp, gz, "/lw {setlinewidth} def\n/rgb {setrgbcolor} def\n"); + mgl_printf(fp, gz, "/np {newpath} def\n/cp {closepath} def\n"); + mgl_printf(fp, gz, "/ll {lineto} def\n/mt {moveto} def\n"); + mgl_printf(fp, gz, "/rl {rlineto} def\n/rm {rmoveto} def\n/dr {stroke} def\n"); + mgl_printf(fp, gz, "/ss {%g} def\n",MarkSize*0.4*font_factor);// remove *font_factor); ??? + mgl_printf(fp, gz, "/s2 {%g} def\n",MarkSize*0.8*font_factor);// remove *font_factor); ??? + mgl_printf(fp, gz, "/sm {-%g} def\n",MarkSize*0.4*font_factor);//remove *font_factor); ??? + mgl_printf(fp, gz, "/m_c {ss 0.3 mul 0 360 arc} def\n"); + mgl_printf(fp, gz, "/d0 {[] 0 setdash} def\n/sd {setdash} def\n"); + + bool m_p=false,m_x=false,m_d=false,m_v=false,m_t=false, + m_s=false,m_a=false,m_o=false,m_T=false, + m_V=false,m_S=false,m_D=false,m_Y=false,m_l=false, + m_L=false,m_r=false,m_R=false,m_X=false,m_P=false; + register unsigned long i; + // add mark definition if present + for(i=0;i0) continue; if(Prm[i].n4=='+') m_p = true; + if(Prm[i].n4=='x') m_x = true; if(Prm[i].n4=='s') m_s = true; + if(Prm[i].n4=='d') m_d = true; if(Prm[i].n4=='v') m_v = true; + if(Prm[i].n4=='^') m_t = true; if(Prm[i].n4=='*') m_a = true; + if(Prm[i].n4=='o' || Prm[i].n4=='O' || Prm[i].n4=='C') m_o = true; + if(Prm[i].n4=='S') m_S = true; if(Prm[i].n4=='D') m_D = true; + if(Prm[i].n4=='V') m_V = true; if(Prm[i].n4=='T') m_T = true; + if(Prm[i].n4=='<') m_l = true; if(Prm[i].n4=='L') m_L = true; + if(Prm[i].n4=='>') m_r = true; if(Prm[i].n4=='R') m_R = true; + if(Prm[i].n4=='Y') m_Y = true; + if(Prm[i].n4=='P') m_P = true; if(Prm[i].n4=='X') m_X = true; + } + if(m_P) { m_p=true; m_s=true; } + if(m_X) { m_x=true; m_s=true; } + if(m_p) mgl_printf(fp, gz, "/m_p {sm 0 rm s2 0 rl sm sm rm 0 s2 rl d0} def\n"); + if(m_x) mgl_printf(fp, gz, "/m_x {sm sm rm s2 s2 rl 0 sm 2 mul rm sm 2 mul s2 rl d0} def\n"); + if(m_s) mgl_printf(fp, gz, "/m_s {sm sm rm 0 s2 rl s2 0 rl 0 sm 2 mul rl cp d0} def\n"); + if(m_d) mgl_printf(fp, gz, "/m_d {sm 0 rm ss ss rl ss sm rl sm sm rl cp d0} def\n"); + if(m_v) mgl_printf(fp, gz, "/m_v {sm ss 2 div rm s2 0 rl sm sm 1.5 mul rl d0 cp} def\n"); + if(m_t) mgl_printf(fp, gz, "/m_t {sm sm 2 div rm s2 0 rl sm ss 1.5 mul rl d0 cp} def\n"); + if(m_a) mgl_printf(fp, gz, "/m_a {sm 0 rm s2 0 rl sm 1.6 mul sm 0.8 mul rm ss 1.2 mul ss 1.6 mul rl 0 sm 1.6 mul rm sm 1.2 mul ss 1.6 mul rl d0} def\n"); + if(m_o) mgl_printf(fp, gz, "/m_o {ss 0 360 d0 arc} def\n"); + if(m_S) mgl_printf(fp, gz, "/m_S {sm sm rm 0 s2 rl s2 0 rl 0 sm 2 mul rl cp} def\n"); + if(m_D) mgl_printf(fp, gz, "/m_D {sm 0 rm ss ss rl ss sm rl sm sm rl cp} def\n"); + if(m_V) mgl_printf(fp, gz, "/m_V {sm ss 2 div rm s2 0 rl sm sm 1.5 mul rl cp} def\n"); + if(m_T) mgl_printf(fp, gz, "/m_T {sm sm 2 div rm s2 0 rl sm ss 1.5 mul rl cp} def\n"); + if(m_Y) mgl_printf(fp, gz, "/m_Y {0 sm rm 0 ss rl sm ss rl s2 0 rm sm sm rl d0} def\n"); + if(m_r) mgl_printf(fp, gz, "/m_r {sm 2 div sm rm 0 s2 rl ss 1.5 mul sm rl d0 cp} def\n"); + if(m_l) mgl_printf(fp, gz, "/m_l {ss 2 div sm rm 0 s2 rl sm 1.5 mul sm rl d0 cp} def\n"); + if(m_R) mgl_printf(fp, gz, "/m_R {sm 2 div sm rm 0 s2 rl ss 1.5 mul sm rl cp} def\n"); + if(m_L) mgl_printf(fp, gz, "/m_L {ss 2 div sm rm 0 s2 rl sm 1.5 mul sm rl cp} def\n"); + if(m_P) mgl_printf(fp, gz, "/m_P {m_p 0 sm rm m_s} def\n"); + if(m_X) mgl_printf(fp, gz, "/m_X {m_x ss sm rm m_s} def\n"); +// if(m_C) mgl_printf(fp, gz, "/m_C {m_c m_o} def\n"); + mgl_printf(fp, gz, "\n"); + + // write definition for all glyphs + put_desc(fp,gz,"/%c%c_%04x { np\n", "\t%d %d mt ", "%d %d ll ", "cp\n", "} def\n"); + // write primitives + float wp=-1; + mglColor cp; + int st=0; + char str[256]=""; + for(i=0;i1) sprintf(str,"%.2g %.2g %.2g rgb ", cp.r,cp.g,cp.b); + + if(Prm[i].type==0) // mark + { + float x0 = Pnt[Prm[i].n1].x,y0 = Pnt[Prm[i].n1].y; + sprintf(str,"1 lw %.2g %.2g %.2g rgb ", cp.r,cp.g,cp.b); + wp=1; + if(Prm[i].s!=MarkSize) + { + mgl_printf(fp, gz, "/ss {%g} def\n",Prm[i].s*0.4*font_factor); + mgl_printf(fp, gz, "/s2 {%g} def\n",Prm[i].s*0.8*font_factor); + mgl_printf(fp, gz, "/sm {-%g} def\n",Prm[i].s*0.4*font_factor); + } + switch(Prm[i].n4) + { + case '+': mgl_printf(fp, gz, "np %g %g mt m_p %sdr\n",x0,y0,str); break; + case 'x': mgl_printf(fp, gz, "np %g %g mt m_x %sdr\n",x0,y0,str); break; + case 's': mgl_printf(fp, gz, "np %g %g mt m_s %sdr\n",x0,y0,str); break; + case 'd': mgl_printf(fp, gz, "np %g %g mt m_d %sdr\n",x0,y0,str); break; + case '*': mgl_printf(fp, gz, "np %g %g mt m_a %sdr\n",x0,y0,str); break; + case 'v': mgl_printf(fp, gz, "np %g %g mt m_v %sdr\n",x0,y0,str); break; + case '^': mgl_printf(fp, gz, "np %g %g mt m_t %sdr\n",x0,y0,str); break; + case 'S': mgl_printf(fp, gz, "np %g %g mt m_S %sfill\n",x0,y0,str); break; + case 'D': mgl_printf(fp, gz, "np %g %g mt m_D %sfill\n",x0,y0,str); break; + case 'V': mgl_printf(fp, gz, "np %g %g mt m_V %sfill\n",x0,y0,str); break; + case 'T': mgl_printf(fp, gz, "np %g %g mt m_T %sfill\n",x0,y0,str); break; + case 'o': mgl_printf(fp, gz, "%g %g m_o %sdr\n",x0,y0,str);break; + case 'O': mgl_printf(fp, gz, "%g %g m_o %sfill\n",x0,y0,str);break; + case 'Y': mgl_printf(fp, gz, "np %g %g mt m_Y %sdr\n",x0,y0,str); break; + case '<': mgl_printf(fp, gz, "np %g %g mt m_l %sdr\n",x0,y0,str); break; + case '>': mgl_printf(fp, gz, "np %g %g mt m_r %sdr\n",x0,y0,str); break; + case 'L': mgl_printf(fp, gz, "np %g %g mt m_L %sfill\n",x0,y0,str); break; + case 'R': mgl_printf(fp, gz, "np %g %g mt m_R %sfill\n",x0,y0,str); break; + case 'P': mgl_printf(fp, gz, "np %g %g mt m_P %sdr\n",x0,y0,str); break; + case 'X': mgl_printf(fp, gz, "np %g %g mt m_X %sdr\n",x0,y0,str); break; + case 'C': mgl_printf(fp, gz, "%g %g m_o %g %g m_c %sdr\n",x0,y0,x0,y0,str); break; + default: mgl_printf(fp, gz, "%g %g m_c %sfill\n",x0,y0,str); + } + if(Prm[i].s!=MarkSize) + { + mgl_printf(fp, gz, "/ss {%g} def\n",MarkSize*0.4*font_factor); + mgl_printf(fp, gz, "/s2 {%g} def\n",MarkSize*0.8*font_factor); + mgl_printf(fp, gz, "/sm {-%g} def\n",MarkSize*0.4*font_factor); + } + } + else if(Prm[i].type==3) // quad + mgl_printf(fp, gz, "np %g %g mt %g %g ll %g %g ll %g %g ll cp %sfill\n", + Pnt[Prm[i].n1].x, Pnt[Prm[i].n1].y, Pnt[Prm[i].n2].x, Pnt[Prm[i].n2].y, + Pnt[Prm[i].n4].x, Pnt[Prm[i].n4].y, Pnt[Prm[i].n3].x, Pnt[Prm[i].n3].y, str); + else if(Prm[i].type==2) // trig + mgl_printf(fp, gz, "np %g %g mt %g %g ll %g %g ll cp %sfill\n", + Pnt[Prm[i].n1].x, Pnt[Prm[i].n1].y, Pnt[Prm[i].n2].x, Pnt[Prm[i].n2].y, + Pnt[Prm[i].n3].x, Pnt[Prm[i].n3].y, str); + else if(Prm[i].type==1) // line + { + sprintf(str,"%.2g lw %.2g %.2g %.2g rgb ", Prm[i].w>1 ? Prm[i].w:1., cp.r,cp.g,cp.b); + wp = Prm[i].w>1 ? Prm[i].w:1; st = Prm[i].n3; + put_line(fp,gz,i,wp,cp,st, "np %g %g mt ", "%g %g ll ", false); + const char *sd = mgl_get_dash(Prm[i].n3,Prm[i].w); + if(sd && sd[0]) mgl_printf(fp, gz, "%s [%s] %g sd dr\n",str,sd,Prm[i].w*Prm[i].s); + else mgl_printf(fp, gz, "%s d0 dr\n",str); + } + else if(Prm[i].type==4) // glyph + { + float ss = Prm[i].s/Prm[i].p/1.1, xx = Pnt[Prm[i].n1].u, + yy = Pnt[Prm[i].n1].v, zz = Pnt[Prm[i].n1].w; + mgl_printf(fp, gz, "gsave\t%g %g translate %g %g scale %g rotate %s\n", + Pnt[Prm[i].n1].x, Pnt[Prm[i].n1].y, ss, ss, -Prm[i].w, str); + if(Prm[i].n3&8) // this is "line" + { + float dy = 0.004,f=fabs(zz); + mgl_printf(fp, gz, "np %g %g mt %g %g ll %g %g ll %g %g ll cp ", + xx,yy+dy, xx+f,yy+dy, xx+f,yy-dy, xx,yy-dy); + } + else + mgl_printf(fp, gz, "%.3g %.3g translate %g %g scale %c%c_%04x ", + xx, yy, zz, zz, Prm[i].n3&1?'b':'n', + Prm[i].n3&2?'i':'n', Prm[i].n4); + if(Prm[i].n3&4) mgl_printf(fp, gz, "dr"); + else mgl_printf(fp, gz, "eofill"); + mgl_printf(fp, gz, " grestore\n"); + } + } + for(i=0;i\n"); + mgl_printf(fp, gz, "\n"); + mgl_printf(fp, gz, "\n",Width,Height); + + mgl_printf(fp, gz, "\n"); + mgl_printf(fp, gz, "\n\n\n",descr?descr:fname,ctime(&now)); + + // write definition for all glyphs + put_desc(fp,gz,"\n"); + // currentColor -> inherit ??? + mgl_printf(fp, gz, "\n"); + // write primitives + float wp=-1; + register unsigned long i; + int st=0; + mglColor cp; + + for(i=0;i\n", + int(255*cp.r),int(255*cp.g),int(255*cp.b)); + else + mgl_printf(fp, gz, "\n", + int(255*cp.r),int(255*cp.g),int(255*cp.b)); + switch(Prm[i].n4) + { + case 'P': + mgl_printf(fp, gz, "\n", x-s,y,x+s,y,x,y-s,x,y+s, x-s,y-s,x+s,y-s,x+s,y+s,x-s,y+s,x-s,y-s); break; + case '+': + mgl_printf(fp, gz, "\n", + x-s,y,x+s,y,x,y-s,x,y+s); break; + case 'X': + mgl_printf(fp, gz, "\n", x-s,y-s,x+s,y+s,x+s,y-s,x-s,y+s, x-s,y-s,x+s,y-s,x+s,y+s,x-s,y+s,x-s,y-s); break; + case 'x': + mgl_printf(fp, gz, "\n", + x-s,y-s,x+s,y+s,x+s,y-s,x-s,y+s); break; + case 's': + case 'S': + mgl_printf(fp, gz, "\n", + x-s,y-s,x+s,y-s,x+s,y+s,x-s,y+s); break; + case 'd': + case 'D': + mgl_printf(fp, gz, "\n", + x-s,y,x,y-s,x+s,y,x,y+s); break; + case '^': + case 'T': + mgl_printf(fp, gz, "\n", + x-s,y+s/2,x+s,y+s/2,x,y-s); break; + case 'v': + case 'V': + mgl_printf(fp, gz, "\n", + x-s,y-s/2,x+s,y-s/2,x,y+s); break; + case '<': + case 'L': + mgl_printf(fp, gz, "\n", + x+s/2,y+s,x+s/2,y-s,x-s,y); break; + case '>': + case 'R': + mgl_printf(fp, gz, "\n", + x-s/2,y+s,x-s/2,y-s,x+s,y); break; + case 'Y': + mgl_printf(fp, gz, "\n", + x,y+s, x,y, x+s,y-s, x,y, x-s,y-s); break; + case 'C': + mgl_printf(fp, gz, "\n\n", int(255*cp.r),int(255*cp.g),int(255*cp.b),x,y,x,y,s); break; + case 'o': + mgl_printf(fp, gz, "\n", + x,y,s); break; + case 'O': + mgl_printf(fp, gz, "\n", + int(255*cp.r),int(255*cp.g),int(255*cp.b),x,y,s); break; + case '*': + mgl_printf(fp, gz, "\n", + x-s,y,x+s,y,x-0.8*s,y-1.6*s,x+0.8*s,y+1.6*s,x+0.8*s,y-1.6*s,x-0.8*s,y+1.6*s); break; + default: + mgl_printf(fp, gz, "\n", + int(255*cp.r),int(255*cp.g),int(255*cp.b),x,y); break; + } + mgl_printf(fp, gz, "\n"); + } + else if(Prm[i].type==2 && cp.a>0) + { + mgl_printf(fp, gz, "\n", + int(255*cp.r),int(255*cp.g),int(255*cp.b),cp.a); + mgl_printf(fp, gz, " \n", + Pnt[Prm[i].n1].x, Height-Pnt[Prm[i].n1].y, Pnt[Prm[i].n2].x, Height-Pnt[Prm[i].n2].y, + Pnt[Prm[i].n3].x, Height-Pnt[Prm[i].n3].y); + } + else if(Prm[i].type==3 && cp.a>0) + { + mgl_printf(fp, gz, "\n", + int(255*cp.r),int(255*cp.g),int(255*cp.b),cp.a); + mgl_printf(fp, gz, " \n", + Pnt[Prm[i].n1].x, Height-Pnt[Prm[i].n1].y, Pnt[Prm[i].n2].x, Height-Pnt[Prm[i].n2].y, + Pnt[Prm[i].n3].x, Height-Pnt[Prm[i].n3].y, Pnt[Prm[i].n4].x, Height-Pnt[Prm[i].n4].y); + } + else if(Prm[i].type==1) + { +// const char *dash[]={"", "8 8","4 4","1 3","7 4 1 4","3 2 1 2"}; + mgl_printf(fp,gz,"1) mgl_printf(fp, gz, " stroke-width=\"%g\"", Prm[i].w); + wp = Prm[i].w>1 ? Prm[i].w:1; st = Prm[i].n3; + put_line(fp,gz,i,wp,cp,st, "> \n"); + } + else if(Prm[i].type==4) + { + float ss = Prm[i].s/2, xx = Pnt[Prm[i].n1].u, yy = Pnt[Prm[i].n1].v, zz = Pnt[Prm[i].n1].w; + if(Prm[i].n3&8) // this is "line" + { + mgl_printf(fp, gz, "", int(255*cp.r),int(255*cp.g),int(255*cp.b)); + else + mgl_printf(fp, gz, " fill=\"#%02x%02x%02x\">", int(255*cp.r),int(255*cp.g),int(255*cp.b)); + float dy = 0.004,f=fabs(zz); + mgl_printf(fp, gz, "\n", + xx,yy+dy, xx+f,yy+dy, xx+f,yy-dy, xx,yy-dy); + } + else + { + ss *= zz; + mgl_printf(fp, gz, "", int(255*cp.r),int(255*cp.g),int(255*cp.b)); + else + mgl_printf(fp, gz, " fill=\"#%02x%02x%02x\">", int(255*cp.r),int(255*cp.g),int(255*cp.b)); + mgl_printf(fp, gz, "\n", + xx/zz, yy/zz, Prm[i].n3&1?'b':'n', + Prm[i].n3&2?'i':'n', Prm[i].n4); + } + } + } + + for(i=0;i"); + if(gz) gzclose(fp); else fclose((FILE *)fp); +} +//----------------------------------------------------------------------------- +#define xx(i,n) (Pnt[Prm[i].n].x) +#define yy(i,n) (Pnt[Prm[i].n].y) +void mglCanvas::put_line(void *fp, bool gz, long i, float wp, mglColor cp,int st, const char *ifmt, const char *nfmt, bool neg) +{ + float x0=xx(i,n1), y0=yy(i,n1); + bool ok=true; + register unsigned long k = i,j; // first point + while(ok) + { + for(ok=false,j=i+1;j10) { m=0; mgl_printf(fp, gz, "\n"); } + ok=true; m++; + } + else if(xx(j,n2)==x0 && yy(j,n2)==y0) + { + k=j; Prm[k].type = -1; + x0 = xx(k,n1); y0=yy(k,n1); + mgl_printf(fp, gz, nfmt,x0,neg?Height-y0:y0); + if(m>10) { m=0; mgl_printf(fp, gz, "\n"); } + ok=true; m++; + } + } + } +} +//----------------------------------------------------------------------------- +//put_desc(fp,"%c%c%c_%04x {", "np %d %d mt %d %d ll %d %d ll cp fill\n", +//"np %d %d mt ", "%d %d ll ", "cp dr\n", "} def") +void mglCanvas::put_desc(void *fp, bool gz, const char *pre, const char *ln1, const char *ln2, const char *ln3, const char *suf) +{ + register unsigned long i,j,n; + wchar_t *g; + int *s; + for(n=i=0;iGetNl(Prm[i].n3&3,Prm[i].n4); // TODO: add after font enabled + const short *ln=fnt->GetLn(Prm[i].n3&3,Prm[i].n4); + long ik,ii; + bool np=true; + if(ln && nl>0) for(ik=0;ikWriteEPS(fname,descr); } +void mgl_write_eps_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,descr,n); d[n]=0; + _GR_->WriteEPS(s,d); delete []s; delete []d; } +//----------------------------------------------------------------------------- +void mgl_write_svg(HMGL gr, const char *fname,const char *descr) +{ _Gr_->WriteSVG(fname,descr); } +void mgl_write_svg_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,descr,n); d[n]=0; + _GR_->WriteSVG(s,d); delete []s; delete []d; } +//----------------------------------------------------------------------------- diff --git a/src/export_3d.cpp b/src/export_3d.cpp new file mode 100644 index 0000000..9f63393 --- /dev/null +++ b/src/export_3d.cpp @@ -0,0 +1,146 @@ +/*************************************************************************** + * export_3d.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "mgl/canvas.h" +#include "mgl/canvas_cf.h" +void mglTexture::GetRGBA(unsigned char *f) +{ + register long i,j,i0; + mglColor c1,c2,c; + for(i=255;i>=0;i--) + { + c1 = col[2*i]; c2 = col[2*i+1]; + for(j=0;j<256;j++) + { + i0 = 4*(j+256*i); + c = c1 + (c2-c1)*(j/255.); + f[i0] = int(255*c.b); + f[i0+1] = int(255*c.g); + f[i0+2] = int(255*c.r); + f[i0+3] = int(255*c.a); + } + } +} +//----------------------------------------------------------------------------- +void mglCanvas::WriteOBJ(const char *fname,const char *descr) +{ + if(Prm.size()<=0) return; // nothing to do + register unsigned long i,j; + long m1=0,m2=0,m; + for(i=0;im2) m2=m; } + long *ng = new long[m2-m1+1]; + for(i=0;i=0 && m p; + mglPrim q; + for(i=0;i=0 && m0;i--) + { Txt[i-1].GetRGBA(buf); fwrite(buf,256*256,1,fp); } + fclose(fp); delete []buf; delete []tname; + +} +//----------------------------------------------------------------------------- +#undef _GR_ +#define _GR_ ((mglCanvas *)(*gr)) +#define _Gr_ ((mglCanvas *)(gr)) +void mgl_write_obj(HMGL gr, const char *fname,const char *descr) +{ _Gr_->WriteOBJ(fname,descr); } +void mgl_write_obj_(uintptr_t *gr, const char *fname,const char *descr,int l,int n) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,descr,n); d[n]=0; + _GR_->WriteOBJ(s,d); delete []s; delete []d; } +//----------------------------------------------------------------------------- diff --git a/src/fit.cpp b/src/fit.cpp new file mode 100644 index 0000000..4690950 --- /dev/null +++ b/src/fit.cpp @@ -0,0 +1,486 @@ +/*************************************************************************** + * fit.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef NO_GSL +#include +#include +#endif +#include +#include "mgl/fit.h" +#include "mgl/eval.h" +#include "mgl/data.h" +//----------------------------------------------------------------------------- +int mglFitPnts; ///< Number of output points in fitting +char mglFitRes[1024]; ///< Last fitted formula +//----------------------------------------------------------------------------- +/// Structure for keeping data and precompiled fitted formula +struct mglFitData +{ + long n; ///< number of points + float *x; ///< x values + float *y; ///< y values + float *z; ///< z values + float *a; ///< function values + float *s; ///< value dispersions (sigma) + mglFormula *eq; ///< approximation formula + int m; ///< number of variables + const char *var; ///< variables for fitting +}; +//----------------------------------------------------------------------------- +#ifndef NO_GSL +int mgl_fit__f (const gsl_vector *x, void *data, gsl_vector *f) +{ + mglFitData *fd = (mglFitData *)data; + register long i; + float val[MGL_VS]; + for(i=0;im;i++) val[fd->var[i]-'a'] = gsl_vector_get(x,i); + for(i=0;in;i++) + { + val['x'-'a'] = fd->x[i]; + val['y'-'a'] = fd->y ? fd->y[i] : 0; + val['z'-'a'] = fd->z ? fd->z[i] : 0; + gsl_vector_set (f, i, (fd->eq->Calc(val) - fd->a[i])/fd->s[i]); + } + return GSL_SUCCESS; +} +//----------------------------------------------------------------------------- +int mgl_fit__df (const gsl_vector * x, void *data, gsl_matrix * J) +{ + mglFitData *fd = (mglFitData *)data; + register long i,j; + float val[MGL_VS],s; + for(i=0;im;i++) val[fd->var[i]-'a'] = gsl_vector_get(x,i); + for(i=0;in;i++) + { + val['x'-'a'] = fd->x[i]; s = fd->s[i]; + val['y'-'a'] = fd->y ? fd->y[i] : 0; + val['z'-'a'] = fd->z ? fd->z[i] : 0; + for(j=0;jm;j++) + gsl_matrix_set (J, i, j, fd->eq->CalcD(val, fd->var[j])/s); + } + return GSL_SUCCESS; +} +//----------------------------------------------------------------------------- +int mgl_fit__fdf (const gsl_vector * x, void *data, gsl_vector * f, gsl_matrix * J) +{ + mgl_fit__f(x, data, f); + mgl_fit__df(x, data, J); + return GSL_SUCCESS; +} +#endif +//----------------------------------------------------------------------------- +/// GSL based fitting procedure for formula/arguments specified by string +float mgl_fit_base(mglFitData *fd, float *ini) +{ +#ifndef NO_GSL + register long i,m=fd->m,n=fd->n,iter=0; + if(n<1 || fd==0 || ini==0) return -1; + // setup data + double *x_init = new double[fd->m]; + for(i=0;idx, s->x, 1e-4, 1e-4 ); + } + while ( status == GSL_CONTINUE && iter < 500 ); + gsl_multifit_covar (s->J, 0.0, covar ); + float res = gsl_blas_dnrm2(s->f); + for(i=0;ix, i); + // free memory + gsl_multifit_fdfsolver_free (s); + gsl_matrix_free (covar); + delete []x_init; + return res; +#else + return 0.0; +#endif +} +//----------------------------------------------------------------------------- +void mglPrepareFitEq(mglBase *gr,float chi, const char *eq, const char *var, float *par) +{ + if(gr->Message) + { + sprintf(gr->Message,"chi=%g,\t",chi); + for(int i=0;iMessage, mglFitRes); + } + } + memset(mglFitRes, 0, 1024); //mglFitRes[0] = 0; + char buf[32]=""; + register long i,k,len=strlen(eq); + for(i=k=0;iSaveState(opt); + mglData x(y->GetNx()); x.Fill(gr->Min.x, gr->Max.x); + mglData s(y); s.Fill(1,1); + return mgl_fit_xys(gr,&x,y,&s,eq,var,ini,0); +} +//----------------------------------------------------------------------------- +HMDT mgl_fit_2(HMGL gr, HCDT z, const char *eq, const char *var, HMDT ini, const char *opt) +{ + gr->SaveState(opt); + mglData x(z->GetNx()); x.Fill(gr->Min.x, gr->Max.x); + mglData y(z->GetNy()); y.Fill(gr->Min.y, gr->Max.y); + mglData s(z); s.Fill(1,1); + return mgl_fit_xyzs(gr,&x,&y,z,&s,eq,var,ini,0); +} +//----------------------------------------------------------------------------- +HMDT mgl_fit_3(HMGL gr, HCDT a, const char *eq, const char *var, HMDT ini, const char *opt) +{ + gr->SaveState(opt); + mglData x(a->GetNx()); x.Fill(gr->Min.x, gr->Max.x); + mglData y(a->GetNy()); y.Fill(gr->Min.y, gr->Max.y); + mglData z(a->GetNz()); z.Fill(gr->Min.z, gr->Max.z); + mglData s(a); s.Fill(1,1); + return mgl_fit_xyzas(gr,&x,&y,&z,a,&s,eq,var,ini,0); +} +//----------------------------------------------------------------------------- +HMDT mgl_fit_xy(HMGL gr, HCDT x, HCDT y, const char *eq, const char *var, HMDT ini, const char *opt) +{ + mglData s(y); s.Fill(1,1); + return mgl_fit_xys(gr,x,y,&s,eq,var,ini,opt); +} +//----------------------------------------------------------------------------- +HMDT mgl_fit_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *eq, const char *var, HMDT ini, const char *opt) +{ + mglData s(z); s.Fill(1,1); + return mgl_fit_xyzs(gr,x,y,z,&s,eq,var,ini,opt); +} +//----------------------------------------------------------------------------- +HMDT mgl_fit_xyza(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, const char *eq, const char *var, HMDT ini, const char *opt) +{ + mglData s(a); s.Fill(1,1); + return mgl_fit_xyzas(gr,x,y,z,a,&s,eq,var,ini,opt); +} +//----------------------------------------------------------------------------- +HMDT mgl_fit_ys(HMGL gr, HCDT y, HCDT s, const char *eq, const char *var, HMDT ini, const char *opt) +{ + gr->SaveState(opt); + mglData x(y->GetNx()); x.Fill(gr->Min.x, gr->Max.x); + return mgl_fit_xys(gr,&x,y,s,eq,var,ini,0); +} +//----------------------------------------------------------------------------- +HMDT mgl_fit_xys(HMGL gr, HCDT xx, HCDT yy, HCDT ss, const char *eq, const char *var, HMDT ini, const char *opt) +{ + mglData *fit=new mglData; + long m = yy->GetNx(); + if(xx->GetNx()!=m) { gr->SetWarn(mglWarnDim,"Fit[S]"); return fit; } + if(m<2) { gr->SetWarn(mglWarnLow,"Fit[S]"); return fit; } + if(ss->GetNx()*ss->GetNy()*ss->GetNz() != m*yy->GetNy()*yy->GetNz()) + { gr->SetWarn(mglWarnDim,"FitS"); return fit; } + gr->SaveState(opt); + mglData x(xx), y(yy), s(ss); + mglFitData fd; + fd.n = m; fd.x = x.a; fd.y = 0; + fd.z = 0; fd.a = y.a; fd.s = s.a; + fd.var = var; fd.m = strlen(var); + fd.eq = new mglFormula(eq); + mglData in(fd.m); + fit->Create(mglFitPnts, yy->GetNy(), yy->GetNz()); + float val[MGL_VS],res=-1; + register long j; + for(long i=0;iGetNy()*yy->GetNz();i++) + { + if(ini && ini->nx>=fd.m) in.Set(ini->a,fd.m); + else in.Fill(0.,0); + fd.a = y.a+i*m; fd.x = x.a+(i%x.ny)*m; + fd.s = s.a+i*m; + res = mgl_fit_base(&fd,in.a); + for(j=0;jMin.x+j*(gr->Max.x-gr->Min.x)/(mglFitPnts-1); + fit->a[j+i*mglFitPnts] = fd.eq->Calc(val); + } + if(ini && ini->nx>=fd.m) memcpy(ini->a,in.a,fd.m*sizeof(mreal)); + } + mglPrepareFitEq(gr,res,eq,var,in.a); + delete fd.eq; gr->LoadState(); return fit; +} +//----------------------------------------------------------------------------- +HMDT mgl_fit_xyzs(HMGL gr, HCDT xx, HCDT yy, HCDT zz, HCDT ss, const char *eq, const char *var, HMDT ini, const char *opt) +{ + mglData *fit=new mglData; + long m=zz->GetNx(),n=zz->GetNy(); + if(xx->GetNx()!=m) { gr->SetWarn(mglWarnDim,"Fit[S]"); return fit; } + if(ss->GetNx()*ss->GetNy()*ss->GetNz() != m*n*zz->GetNz()) + { gr->SetWarn(mglWarnDim,"FitS"); return fit; } + if(yy->GetNx()!=n && (xx->GetNy()!=n || yy->GetNx()!=m || yy->GetNy()!=n)) + { gr->SetWarn(mglWarnDim); return fit; } + if(m<2|| n<2) { gr->SetWarn(mglWarnLow,"Fit[S]"); return fit; } + + gr->SaveState(opt); + mglData x(m, n), y(m, n), z(zz), s(ss); + register long i,j; + for(i=0;iCreate(mglFitPnts, mglFitPnts, zz->GetNz()); + float val[MGL_VS], res = -1; + for(i=0;iGetNz();i++) + { + if(ini && ini->nx>=fd.m) in.Set(ini->a,fd.m); + else in.Fill(0.,0); + fd.a = z.a+i*m*n; fd.s = s.a+i*m*n; + res = mgl_fit_base(&fd,in.a); + for(j=0;jMin.x+(j%mglFitPnts)*(gr->Max.x-gr->Min.x)/(mglFitPnts-1); + val['y'-'a'] = gr->Min.y+(j/mglFitPnts)*(gr->Max.y-gr->Min.y)/(mglFitPnts-1); + fit->a[j+i*mglFitPnts*mglFitPnts] = fd.eq->Calc(val); + } + if(ini && ini->nx>=fd.m) memcpy(ini->a,in.a,fd.m*sizeof(mreal)); + } + mglPrepareFitEq(gr,res, eq,var,in.a); + delete fd.eq; gr->LoadState(); return fit; +} +//----------------------------------------------------------------------------- +HMDT mgl_fit_xyzas(HMGL gr, HCDT xx, HCDT yy, HCDT zz, HCDT aa, HCDT ss, const char *eq, const char *var, HMDT ini, const char *opt) +{ + mglData *fit=new mglData; + register long i,j,k,i0; + long m=aa->GetNx(), n=aa->GetNy(), l=aa->GetNz(); + i = n*m*l; + if(m<2 || n<2 || l<2) { gr->SetWarn(mglWarnLow,"Fit[S]"); return fit; } + if(ss->GetNx()*ss->GetNy()*ss->GetNz() != i) { gr->SetWarn(mglWarnDim,"FitS"); return fit; } + bool both = xx->GetNx()*xx->GetNy()*xx->GetNz()==i && yy->GetNx()*yy->GetNy()*yy->GetNz()==i && zz->GetNx()*zz->GetNy()*zz->GetNz()==i; + if(!(both || (xx->GetNx()==m && yy->GetNx()==n && zz->GetNx()==l))) + { gr->SetWarn(mglWarnDim,"Fit[S]"); return fit; } + + gr->SaveState(opt); + mglData x(aa), y(aa), z(aa), a(aa), s(ss); + for(i=0;iCreate(mglFitPnts, mglFitPnts, mglFitPnts); + float val[MGL_VS], res = -1; + + if(ini && ini->nx>=fd.m) in.Set(ini->a,fd.m); + else in.Fill(0.,0); + res = mgl_fit_base(&fd,in.a); + for(j=0;jMin.x+(j%mglFitPnts)*(gr->Max.x-gr->Min.x)/(mglFitPnts-1); + val['y'-'a'] = gr->Min.y+(j/mglFitPnts)*(gr->Max.y-gr->Min.y)/(mglFitPnts-1); + val['z'-'a'] = gr->Min.z+i*(gr->Max.y-gr->Min.y)/(mglFitPnts-1); + fit->a[j+mglFitPnts*mglFitPnts*i] = fd.eq->Calc(val); + } + if(ini && ini->nx>=fd.m) memcpy(ini->a,in.a,fd.m*sizeof(mreal)); + + mglPrepareFitEq(gr,res, eq,var,in.a); + delete fd.eq; gr->LoadState(); return fit; +} +//----------------------------------------------------------------------------- +HMDT mgl_hist_x(HMGL gr, HCDT x, HCDT a, const char *opt) +{ + mglData *res = new mglData(mglFitPnts); + long nn=a->GetNx()*a->GetNy()*a->GetNz(); + if(nn!=x->GetNx()*x->GetNy()*x->GetNz()) { gr->SetWarn(mglWarnDim); return res; } + gr->SaveState(opt); + register long i,j1; + for(i=0;iv(i)-gr->Min.x)/(gr->Max.x-gr->Min.x)); + if(j1>=0 && j1a[j1] += a->v(i); + } + gr->LoadState(); return res; +} +//----------------------------------------------------------------------------- +HMDT mgl_hist_xy(HMGL gr, HCDT x, HCDT y, HCDT a, const char *opt) +{ + mglData *res = new mglData(mglFitPnts, mglFitPnts); + long nn=a->GetNx()*a->GetNy()*a->GetNz(); + if(nn!=x->GetNx()*x->GetNy()*x->GetNz() || nn!=y->GetNx()*y->GetNy()*y->GetNz()) + { gr->SetWarn(mglWarnDim); return res; } + gr->SaveState(opt); + register long i,j1,j2; + for(i=0;iv(i)-gr->Min.x)/(gr->Max.x-gr->Min.x)); + j2 = long(mglFitPnts*(y->v(i)-gr->Min.y)/(gr->Max.y-gr->Min.y)); + if(j1>=0 && j1=0 && j2a[j1+mglFitPnts*j2] += a->v(i); + } + gr->LoadState(); return res; +} +//----------------------------------------------------------------------------- +HMDT mgl_hist_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, const char *opt) +{ + mglData *res = new mglData(mglFitPnts, mglFitPnts, mglFitPnts); + long nn=a->GetNx()*a->GetNy()*a->GetNz(); + if(nn!=x->GetNx()*x->GetNy()*x->GetNz() || nn!=y->GetNx()*y->GetNy()*y->GetNz() || nn!=z->GetNx()*z->GetNy()*z->GetNz()) + { gr->SetWarn(mglWarnDim); return res; } + gr->SaveState(opt); + register long i,j1,j2,j3; + for(i=0;iv(i)-gr->Min.x)/(gr->Max.x-gr->Min.x)); + j2 = long(mglFitPnts*(y->v(i)-gr->Min.y)/(gr->Max.y-gr->Min.y)); + j3 = long(mglFitPnts*(z->v(i)-gr->Min.z)/(gr->Max.z-gr->Min.z)); + if(j1>=0 && j1=0 && j2=0 && j3a[j1+mglFitPnts*(j2+mglFitPnts*j3)] += a->v(i); + } + gr->LoadState(); return res; +} +//----------------------------------------------------------------------------- +uintptr_t mgl_hist_x_(uintptr_t* gr, uintptr_t* x, uintptr_t* a, const char *opt, int lo) +{ char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + uintptr_t r = (uintptr_t)mgl_hist_x(_GR_, _DA_(x), _DA_(a), o); + delete []o; return r; } +uintptr_t mgl_hist_xy_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, uintptr_t* a, const char *opt, int lo) +{ char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + uintptr_t r = (uintptr_t)mgl_hist_xy(_GR_, _DA_(x), _DA_(y), _DA_(a), o); + delete []o; return r; } +uintptr_t mgl_hist_xyz_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* a, const char *opt, int lo) +{ char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + uintptr_t r = (uintptr_t)mgl_hist_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(a), o); + delete []o; return r; } +//----------------------------------------------------------------------------- +const char *mgl_get_fit(HMGL ) { return mglFitRes; } +//----------------------------------------------------------------------------- +uintptr_t mgl_fit_1_(uintptr_t* gr, uintptr_t* y, const char *eq, const char *var, uintptr_t *ini, const char *opt, int l, int n, int lo) +{ + char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + uintptr_t r = (uintptr_t)mgl_fit_1(_GR_, _DA_(y), s, d, _DM_(ini), o); + delete []o; delete []s; delete []d; return r; +} +uintptr_t mgl_fit_2_(uintptr_t* gr, uintptr_t* z, const char *eq, const char *var, uintptr_t *ini, const char *opt, int l, int n, int lo) +{ + char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + uintptr_t r = (uintptr_t)mgl_fit_2(_GR_, _DA_(z), s, d, _DM_(ini), o); + delete []o; delete []s; delete []d; return r; +} +uintptr_t mgl_fit_3_(uintptr_t* gr, uintptr_t* a, const char *eq, const char *var, uintptr_t *ini, const char *opt, int l, int n, int lo) +{ + char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + uintptr_t r = (uintptr_t)mgl_fit_3(_GR_, _DA_(a), s, d, _DM_(ini), o); + delete []o; delete []s; delete []d; return r; +} +uintptr_t mgl_fit_xy_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, const char *eq, const char *var, uintptr_t *ini, const char *opt, int l, int n, int lo) +{ + char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + uintptr_t r = (uintptr_t)mgl_fit_xy(_GR_, _DA_(x), _DA_(y), s, d, _DM_(ini), o); + delete []o; delete []s; delete []d; return r; +} +uintptr_t mgl_fit_xyz_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, uintptr_t* z, const char *eq, const char *var, uintptr_t *ini, const char *opt, int l, int n, int lo) +{ + char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + uintptr_t r = (uintptr_t)mgl_fit_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), s, d, _DM_(ini), o); + delete []o; delete []s; delete []d; return r; +} +uintptr_t mgl_fit_xyza_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* a, const char *eq, const char *var, uintptr_t *ini, const char *opt, int l, int n, int lo) +{ + char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + uintptr_t r = (uintptr_t)mgl_fit_xyza(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(a), s, d, _DM_(ini), o); + delete []o; delete []s; delete []d; return r; +} +uintptr_t mgl_fit_ys_(uintptr_t* gr, uintptr_t* y, uintptr_t* ss, const char *eq, const char *var, uintptr_t *ini, const char *opt, int l, int n, int lo) +{ + char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + uintptr_t r = (uintptr_t)mgl_fit_ys(_GR_, _DA_(y), _DA_(ss), s, d, _DM_(ini), o); + delete []o; delete []s; delete []d; return r; +} +uintptr_t mgl_fit_xys_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, uintptr_t* ss, const char *eq, const char *var, uintptr_t *ini, const char *opt, int l, int n, int lo) +{ + char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + uintptr_t r = (uintptr_t)mgl_fit_xys(_GR_, _DA_(x), _DA_(y), _DA_(ss), s, d, _DM_(ini), o); + delete []o; delete []s; delete []d; return r; +} +uintptr_t mgl_fit_xyzs_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* ss, const char *eq, const char *var, uintptr_t *ini, const char *opt, int l, int n, int lo) +{ + char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + uintptr_t r = (uintptr_t)mgl_fit_xyzs(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(ss), s, d, _DM_(ini), o); + delete []o; delete []s; delete []d; return r; +} +uintptr_t mgl_fit_xyzas_(uintptr_t* gr, uintptr_t* x, uintptr_t* y, uintptr_t* z, uintptr_t* a, uintptr_t* ss, const char *eq, const char *var, uintptr_t *ini, const char *opt, int l, int n, int lo) +{ + char *s=new char[l+1]; memcpy(s,eq,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,var,n); d[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + uintptr_t r = (uintptr_t)mgl_fit_xyzas(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(a), _DA_(ss), s, d, _DM_(ini), o); + delete []o; delete []s; delete []d; return r; +} +//----------------------------------------------------------------------------- diff --git a/mgl/mgl_font.cpp b/src/font.cpp similarity index 82% rename from mgl/mgl_font.cpp rename to src/font.cpp index ceac59d..6be00ed 100644 --- a/mgl/mgl_font.cpp +++ b/src/font.cpp @@ -30,109 +30,87 @@ #include #endif -#include "mgl/mgl.h" -#include "mgl/mgl_font.h" -//----------------------------------------------------------------------------- -#ifndef MGL_FONT_PATH -#define MGL_FONT_PATH "." // path to fonts -#endif +#include "mgl/base.h" +#include "mgl/font.h" //----------------------------------------------------------------------------- extern unsigned mgl_numg, mgl_cur; -extern mreal mgl_fact; +extern float mgl_fact; extern long mgl_gen_fnt[516][6]; extern short mgl_buf_fnt[246080]; -const mreal mgl_fgen = 4*14; +const float mgl_fgen = 4*14; extern mglTeXsymb mgl_tex_symb[]; mglFont mglDefFont; //----------------------------------------------------------------------------- -mreal mglFont::Puts(const char *str,const char *how, char col) -{ - int font=0, align=1; - if(how) - { - if(strchr(how,'R')) align = 2; - if(strchr(how,'C')) align = 1; - if(strchr(how,'L')) align = 0; - if(strchr(how,'D')) align+= 4; - if(strchr(how,'b')) font = font|MGL_FONT_BOLD; - if(strchr(how,'i')) font = font|MGL_FONT_ITAL; - if(strchr(how,'w')) font = font|MGL_FONT_WIRE; - if(strchr(how,'o')) font = font|MGL_FONT_OLINE; - if(strchr(how,'u')) font = font|MGL_FONT_ULINE; - } - return Puts(str, font, align, col); -} -//----------------------------------------------------------------------------- -mreal mglFont::Width(const char *str,const char *how) -{ - int font=0; - if(how) - { - if(strchr(how,'b')) font = font|MGL_FONT_BOLD; - if(strchr(how,'i')) font = font|MGL_FONT_ITAL; - if(strchr(how,'w')) font = font|MGL_FONT_WIRE; - if(strchr(how,'o')) font = font|MGL_FONT_OLINE; - if(strchr(how,'u')) font = font|MGL_FONT_ULINE; - } - return Width(str, font); -} -//----------------------------------------------------------------------------- -mreal mglFont::Puts(const wchar_t *str,const char *how, char col) -{ - int font=0, align=1; - if(how) - { - if(strchr(how,'R')) align = 2; - if(strchr(how,'C')) align = 1; - if(strchr(how,'L')) align = 0; - if(strchr(how,'D')) align+= 4; - if(strchr(how,'b')) font = font|MGL_FONT_BOLD; - if(strchr(how,'i')) font = font|MGL_FONT_ITAL; - if(strchr(how,'w')) font = font|MGL_FONT_WIRE; - if(strchr(how,'o')) font = font|MGL_FONT_OLINE; - if(strchr(how,'u')) font = font|MGL_FONT_ULINE; +char mglGetStyle(const char *how, int *font, int *align) +{ + const char *cols = "kwrgbcymhWRGBCYMHlenpquLENPQU"; + char col=0; + if(!how || *how==0) return col; + // NOTE: no brightness for text color + for(;*how && *how!=':';how++) + if(strchr(cols,*how)) col=*how; + if(align) + { + *align = 1; + if(strchr(how,'R')) *align = 2; + if(strchr(how,'C')) *align = 1; + if(strchr(how,'L')) *align = 0; + if(strchr(how,'D')) *align+= 4; } - return Puts(str, font, align,col); -} -//----------------------------------------------------------------------------- -mreal mglFont::Width(const wchar_t *str,const char *how) -{ - int font=0; - if(how) - { - if(strchr(how,'b')) font = font|MGL_FONT_BOLD; - if(strchr(how,'i')) font = font|MGL_FONT_ITAL; - if(strchr(how,'w')) font = font|MGL_FONT_WIRE; - if(strchr(how,'o')) font = font|MGL_FONT_OLINE; - if(strchr(how,'u')) font = font|MGL_FONT_ULINE; - } - return Width(str, font); + if(font) + { + *font = 0; + if(strchr(how,'b')) *font = *font|MGL_FONT_BOLD; + if(strchr(how,'i')) *font = *font|MGL_FONT_ITAL; + if(strchr(how,'w')) *font = *font|MGL_FONT_WIRE; + if(strchr(how,'o')) *font = *font|MGL_FONT_OLINE; + if(strchr(how,'u')) *font = *font|MGL_FONT_ULINE; + } + return col; } //----------------------------------------------------------------------------- -mreal mglFont::Puts(const char *str,int font,int align, char col) +float mglFont::Puts(const char *str,const char *how,float col) { + int font=0, align=1; + char cc=mglGetStyle(how,&font,&align); unsigned size = strlen(str)+1; wchar_t *wcs = new wchar_t[size]; mbstowcs(wcs,str,size); - mreal w = Puts(wcs,font,align,col); + float w = Puts(wcs,font,align,cc?-cc:col); delete []wcs; return w; } //----------------------------------------------------------------------------- -mreal mglFont::Width(const char *str,int font) +float mglFont::Width(const char *str,const char *how) { + int font=0; + mglGetStyle(how,&font); unsigned size = strlen(str)+1; wchar_t *wcs = new wchar_t[size]; mbstowcs(wcs,str,size); - mreal w = Width(wcs,font); + float w = Width(wcs,font); delete []wcs; return w; } //----------------------------------------------------------------------------- -mreal mglFont::Puts(const wchar_t *str,int font,int align, char col) +float mglFont::Puts(const wchar_t *str,const char *how,float col) +{ + int font=0, align=1; + char cc=mglGetStyle(how,&font,&align); + return Puts(str, font, align,cc?-cc:col); +} +//----------------------------------------------------------------------------- +float mglFont::Width(const wchar_t *str,const char *how) +{ + int font=0; + mglGetStyle(how,&font); + return Width(str, font); +} +//----------------------------------------------------------------------------- +float mglFont::Puts(const wchar_t *str,int font,int align, float col) { if(numg==0) return 0; - mreal ww=0,w=0,h = (align&4) ? 500./fact[0] : 0; + float ww=0,w=0,h = (align&4) ? 500./fact[0] : 0; unsigned size = wcslen(str)+1; if(parse) { @@ -170,10 +148,10 @@ mreal mglFont::Puts(const wchar_t *str,int font,int align, char col) return ww; } //----------------------------------------------------------------------------- -mreal mglFont::Width(const wchar_t *str,int font) +float mglFont::Width(const wchar_t *str,int font) { if(numg==0) return 0; - mreal w=0; + float w=0; unsigned size = wcslen(str)+1; if(parse) { @@ -197,14 +175,14 @@ mreal mglFont::Width(const wchar_t *str,int font) return w; } //----------------------------------------------------------------------------- -mreal mglFont::Height(int font) +float mglFont::Height(int font) { if(numg==0) return 0; int s = (font/MGL_FONT_BOLD)&3; return (500.f)/fact[s]; } //----------------------------------------------------------------------------- -mreal mglFont::Height(const char *how) +float mglFont::Height(const char *how) { if(numg==0) return 0; int s=0; @@ -332,7 +310,7 @@ void mglFont::Convert(const wchar_t *str, unsigned *res) res[j] = 0; } //----------------------------------------------------------------------------- -mreal mglFont::get_ptr(long &i,unsigned *str, unsigned **b1, unsigned **b2,mreal &w1,mreal &w2, mreal f1, mreal f2, int st) +float mglFont::get_ptr(long &i,unsigned *str, unsigned **b1, unsigned **b2,float &w1,float &w2, float f1, float f2, int st) { static unsigned s1[2]={0,0}, s2[2]={0,0}; register long k; @@ -365,7 +343,7 @@ mreal mglFont::get_ptr(long &i,unsigned *str, unsigned **b1, unsigned **b2,mreal return w1>w2 ? w1 : w2; } //----------------------------------------------------------------------------- -void mglFont::draw_ouline(mglGraph *gr, int st, mreal x, mreal y, mreal f, mreal g, mreal ww, char ccol) +void mglFont::draw_ouline(int st, float x, float y, float f, float g, float ww, float ccol) { if(st&MGL_FONT_OLINE) gr->Glyph(x,y+499*f/g, ww*g, (st&MGL_FONT_WIRE)?12:8, 0, ccol); @@ -374,18 +352,18 @@ void mglFont::draw_ouline(mglGraph *gr, int st, mreal x, mreal y, mreal f, mreal } //----------------------------------------------------------------------------- #define MGL_CLEAR_STYLE {st = style; yy = y; ff = f; ccol=col; a = (st/MGL_FONT_BOLD)&3;} -mreal mglFont::Puts(const unsigned *text, mreal x,mreal y,mreal f,int style,char col) +float mglFont::Puts(const unsigned *text, float x,float y,float f,int style,float col) { if(numg==0) return 0; register long j,k; long i; register unsigned s,ss; - mreal w=0; // string width + float w=0; // string width int st = style; // current style unsigned *b1, *b2; // pointer to substring unsigned *str; // string itself - mreal yy=y, ff=f, ww, w1, w2; - char ccol=col; + float yy=y, ff=f, ww, w1, w2; + float ccol=col; int a = (st/MGL_FONT_BOLD)&3; for(i=0;text[i];i++); str = new unsigned[i+1]; @@ -405,7 +383,7 @@ mreal mglFont::Puts(const unsigned *text, mreal x,mreal y,mreal f,int style,char str[i-1]=0; i--; ww = Puts(b1, x, yy, ff, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); if(gr && !(style&0x10)) // add under-/over- line now - draw_ouline(gr,st,x,y,f,fact[a],ww,ccol); + draw_ouline(st,x,y,f,fact[a],ww,ccol); MGL_CLEAR_STYLE } else if(s==unsigned(-9)) // underset @@ -414,7 +392,7 @@ mreal mglFont::Puts(const unsigned *text, mreal x,mreal y,mreal f,int style,char Puts(b1, x+(ww-w1)/2, yy, ff, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); Puts(b2, x+(ww-w2)/2, yy-150*ff/fact[a], ff/4, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); if(gr && !(style&0x10)) // add under-/over- line now - draw_ouline(gr,st,x,y,f,fact[a],ww,ccol); + draw_ouline(st,x,y,f,fact[a],ww,ccol); MGL_CLEAR_STYLE } else if(s==unsigned(-8)) // overset @@ -423,7 +401,7 @@ mreal mglFont::Puts(const unsigned *text, mreal x,mreal y,mreal f,int style,char Puts(b1, x+(ww-w1)/2, yy, ff, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); Puts(b2, x+(ww-w2)/2, yy+375*ff/fact[a], ff/4, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); if(gr && !(style&0x10)) // add under-/over- line now - draw_ouline(gr,st,x,y,f,fact[a],ww,ccol); + draw_ouline(st,x,y,f,fact[a],ww,ccol); MGL_CLEAR_STYLE } else if(s==unsigned(-12)) // sub @@ -432,7 +410,7 @@ mreal mglFont::Puts(const unsigned *text, mreal x,mreal y,mreal f,int style,char Puts(b1, x+(ww-w1)/2, yy, ff, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); Puts(b2, x+(ww-w2)/2, yy-250*ff/fact[a], ff/4, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); if(gr && !(style&0x10)) // add under-/over- line now - draw_ouline(gr,st,x,y,f,fact[a],ww,ccol); + draw_ouline(st,x,y,f,fact[a],ww,ccol); MGL_CLEAR_STYLE } else if(s==unsigned(-13)) // sup @@ -441,7 +419,7 @@ mreal mglFont::Puts(const unsigned *text, mreal x,mreal y,mreal f,int style,char Puts(b1, x+(ww-w1)/2, yy, ff, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); Puts(b2, x+(ww-w2)/2, yy+450*ff/fact[a], ff/4, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); if(gr && !(style&0x10)) // add under-/over- line now - draw_ouline(gr,st,x,y,f,fact[a],ww,ccol); + draw_ouline(st,x,y,f,fact[a],ww,ccol); MGL_CLEAR_STYLE } else if(s==unsigned(-11)) // stackl @@ -450,7 +428,7 @@ mreal mglFont::Puts(const unsigned *text, mreal x,mreal y,mreal f,int style,char Puts(b1, x, yy+250*ff/fact[a], ff*0.45, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); Puts(b2, x, yy-110*ff/fact[a], ff*0.45, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); if(gr && !(style&0x10)) // add under-/over- line now - draw_ouline(gr,st,x,y,f,fact[a],ww,ccol); + draw_ouline(st,x,y,f,fact[a],ww,ccol); MGL_CLEAR_STYLE } else if(s==unsigned(-10)) // stacr @@ -459,7 +437,7 @@ mreal mglFont::Puts(const unsigned *text, mreal x,mreal y,mreal f,int style,char Puts(b1, x+(ww-w1), yy+250*ff/fact[a], ff*0.45, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); Puts(b2, x+(ww-w2), yy-110*ff/fact[a], ff*0.45, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); if(gr && !(style&0x10)) // add under-/over- line now - draw_ouline(gr,st,x,y,f,fact[a],ww,ccol); + draw_ouline(st,x,y,f,fact[a],ww,ccol); MGL_CLEAR_STYLE } else if(s==unsigned(-7)) // stack @@ -468,7 +446,7 @@ mreal mglFont::Puts(const unsigned *text, mreal x,mreal y,mreal f,int style,char Puts(b1, x+(ww-w1)/2, yy+250*ff/fact[a], ff*0.45, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); Puts(b2, x+(ww-w2)/2, yy-110*ff/fact[a], ff*0.45, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); if(gr && !(style&0x10)) // add under-/over- line now - draw_ouline(gr,st,x,y,f,fact[a],ww,ccol); + draw_ouline(st,x,y,f,fact[a],ww,ccol); MGL_CLEAR_STYLE } else if(s==unsigned(-6)) // frac @@ -478,7 +456,7 @@ mreal mglFont::Puts(const unsigned *text, mreal x,mreal y,mreal f,int style,char Puts(b2, x+(ww-w2)/2, yy-110*ff/fact[a], ff*0.45, (st&(~MGL_FONT_OLINE)&(~MGL_FONT_ULINE)), ccol); if(gr && !(style&0x10)) // add under-/over- line now { - draw_ouline(gr,st,x,y,f,fact[a],ww,ccol); + draw_ouline(st,x,y,f,fact[a],ww,ccol); gr->Glyph(x,y+150*f/fact[a], ww*fact[a], (st&MGL_FONT_WIRE)?12:8, 0, ccol); } MGL_CLEAR_STYLE @@ -486,7 +464,7 @@ mreal mglFont::Puts(const unsigned *text, mreal x,mreal y,mreal f,int style,char else if(s==unsigned(-4)) MGL_CLEAR_STYLE // should be never here but if I miss sth ... else if(s==unsigned(-14)) // script symbols { - register long j,k=1; + k=1; if(str[i+1]==unsigned(-3)) for(j=i+2;k>0 && str[j];j++) { if(str[j]==unsigned(-3)) k++; @@ -499,8 +477,8 @@ mreal mglFont::Puts(const unsigned *text, mreal x,mreal y,mreal f,int style,char ff *= 1.5; else if(s==unsigned(-1)) // set normal font st = style & MGL_FONT_ROMAN; - else if((s&MGL_COLOR_MASK)==MGL_COLOR_MASK) // color specification - ccol = s&0xff; + else if((s&MGL_COLOR_MASK)==MGL_COLOR_MASK) // color specification + ccol = -float(s & 0xff); else { ss = s&MGL_FONT_MASK; @@ -516,11 +494,10 @@ mreal mglFont::Puts(const unsigned *text, mreal x,mreal y,mreal f,int style,char else gr->Glyph(x,yy,ff,a,j,ccol); } } - else - j = Internal('!'); + else j = Internal('!'); ww = ff*width[a][j]/fact[a]; if(gr && !(style&0x10)) // add under-/over- line now - draw_ouline(gr,st,x,y,f,fact[a],ww,ccol); + draw_ouline(st,x,y,f,fact[a],ww,ccol); if(s & MGL_FONT_ZEROW) ww = 0; MGL_CLEAR_STYLE } @@ -581,7 +558,8 @@ bool mglFont::read_def(unsigned &cur) numg = mgl_numg; cur = mgl_cur; // copy default factor for other font styles; fact[1] = fact[2] = fact[3] = fact[0] = mgl_fact*mgl_fgen; - buf = (short *)malloc(cur*sizeof(short)); // prealocate buffer + Buf = (short *)malloc(cur*sizeof(short)); // prealocate buffer + memset(Buf,0,cur*sizeof(short)); // now allocate memory for all fonts mem_alloc(); // and load symbols itself @@ -595,49 +573,49 @@ bool mglFont::read_def(unsigned &cur) numt[0][i] = mgl_gen_fnt[i][4]; tr[0][i] = mgl_gen_fnt[i][5]; } - memcpy(buf, mgl_buf_fnt, cur*sizeof(short)); + memcpy(Buf, mgl_buf_fnt, cur*sizeof(short)); numb = cur; main_copy(); // copy normal style as default for other styles return true; } //----------------------------------------------------------------------------- -bool mglFont::read_data(const char *fname, float *ff, short *wdt, short *numl, - unsigned *posl, short *numt, unsigned *post, unsigned &cur) +bool mglFont::read_data(const char *fname, float *ff, short *wdt, short *lnum, + unsigned *posl, short *tnum, unsigned *post, unsigned &cur) { - gzFile fp; - char str[256]; - int tmpw, tmpnl, tmpnt; - unsigned s,n, tmpi, tmppl, tmppt; - register long i,j,ch,retVal; - fp = gzopen(fname,"r"); if(!fp) return false; // false if no file - // first string is comment (not used), second string have information + gzFile fp; + char str[256]; + int n, tmpw, tmpnl, tmpnt; + unsigned s, tmpi, tmppl, tmppt; + register long i,j,ch,retVal; + fp = gzopen(fname,"r"); if(!fp) return false; // false if no file + // first string is comment (not used), second string have information if(!gzgets(fp,str,256) || !gzgets(fp,str,256)) - { gzclose(fp); return false; } - retVal = sscanf(str, "%u%f%d", &n, ff, &s); + { gzclose(fp); return false; } + retVal = sscanf(str, "%d%f%d", &n, ff, &s); //Check sscanf read all data (3 items) if(retVal != 3) { gzclose(fp); return false; } - buf = (short *)realloc(buf, (cur+s)*sizeof(short)); // prealocate buffer - if(!buf) { gzclose(fp); return false; } - - for(i=0;i=0 && buf[i]!=sep;i--); - path=buf; buf[i]=0; base = buf+i+1; + path = buf; buf[i]=0; base = buf+i+1; } } - Clear(); // first clear old + Clear(); // first clear old sprintf(str,"%s%c%s.vfm",path,sep,base); - if(!base || !read_main(str,cur)) + if(!base || !read_main(str,cur)) { read_def(cur); setlocale(LC_NUMERIC,oldLocale); - if(buf) delete []buf; return true; } + if(buf) delete []buf; return true; } //================== bold =========================================== sprintf(str,"%s%c%s_b.vfm",path,sep,base); // this file may absent @@ -741,8 +712,8 @@ bool mglFont::Load(const char *base, const char *path) // Finally normalize all factors fact[0] *= mgl_fgen; fact[1] *= mgl_fgen; fact[2] *= mgl_fgen; fact[3] *= mgl_fgen; - if(buf) delete []buf; - setlocale(LC_NUMERIC,oldLocale); + setlocale(LC_NUMERIC,oldLocale); + if(buf) delete []buf; return true; } //----------------------------------------------------------------------------- @@ -762,7 +733,7 @@ void mglFont::Clear() // if(gr) gr->Clf(); if(numg) { - delete []id; free(buf); numg = 0; + delete []id; free(Buf); numg = 0; delete []width[0]; delete []width[1]; delete []width[2]; delete []width[3]; delete []tr[0]; delete []tr[1]; delete []tr[2]; delete []tr[3]; delete []ln[0]; delete []ln[1]; delete []ln[2]; delete []ln[3]; @@ -799,9 +770,9 @@ void mglFont::Copy(mglFont *f) memcpy(numl[1],f->numl[1],numg*sizeof(short)); memcpy(numl[2],f->numl[2],numg*sizeof(short)); memcpy(numl[3],f->numl[3],numg*sizeof(short)); - memcpy(fact,f->fact,4*sizeof(mreal)); + memcpy(fact,f->fact,4*sizeof(float)); // now copy symbols descriptions - buf = (short *)malloc(numb*sizeof(short)); - memcpy(buf, f->buf, numb*sizeof(short)); + Buf = (short *)malloc(numb*sizeof(short)); + memcpy(Buf, f->Buf, numb*sizeof(short)); } //----------------------------------------------------------------------------- diff --git a/src/opengl.cpp b/src/opengl.cpp new file mode 100644 index 0000000..9409f8a --- /dev/null +++ b/src/opengl.cpp @@ -0,0 +1,257 @@ +#ifdef WIN32 +#include +#endif +#ifdef __APPLE__ +#include +#else +#include +#endif +#include "mgl/opengl.h" +#include +//----------------------------------------------------------------------------- +/// Create mglGraph object in OpenGL mode. +HMGL mgl_create_graph_gl() +{ return new mglCanvasGL; } +/// Create mglGraph object in OpenGL mode. +uintptr_t mgl_create_graph_gl_() +{ return uintptr_t(new mglCanvasGL); } +//----------------------------------------------------------------------------- +mglCanvasGL::mglCanvasGL() : mglCanvas(1,1) {} +//----------------------------------------------------------------------------- +mglCanvasGL::~mglCanvasGL(){} +//----------------------------------------------------------------------------- +void mglCanvasGL::Finish() +{ + if(Prm.size()>0) + { + std::sort(Prm.begin(), Prm.end()); + glVertexPointer(3, GL_FLOAT, sizeof(mglPnt), &(Pnt[0].x)); + glNormalPointer(GL_FLOAT, sizeof(mglPnt), &(Pnt[0].u)); + glColorPointer(4, GL_FLOAT, sizeof(mglPnt), &(Pnt[0].r)); + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_NORMAL_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); + + int pdef=PDef; + float ss=pPos, ww=PenWidth; + mglPrim p; + for(unsigned long i=0;i7) { SetWarn(mglWarnLId); return; } + if(c.Valid()) + { + DifLight = c*br; + AmbLight = c*AmbBr; + } + dif[0] = DifLight.r; dif[1] = DifLight.g; + dif[2] = DifLight.b; dif[3] = 1.; + amb[0] = AmbLight.r; amb[1] = AmbLight.g; + amb[2] = AmbLight.b; amb[3] = 1.; + pos[0] = p.x; pos[1] = p.y; + pos[2] = p.z; pos[3] = infty ? 0:1; + glShadeModel(GL_SMOOTH); + //glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, 5.0); + //glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, pos); + + glLightfv(lght[n], GL_AMBIENT, amb); + glLightfv(lght[n], GL_DIFFUSE, dif); + //glLightfv(lght[n], GL_SPECULAR, spc); + glLightfv(lght[n], GL_POSITION, pos); + glEnable(lght[n]); +} +//----------------------------------------------------------------------------- +void mglCanvasGL::Light(int n, bool enable) +{ + GLenum lght[8] = {GL_LIGHT0,GL_LIGHT1,GL_LIGHT2,GL_LIGHT3,GL_LIGHT4, + GL_LIGHT5,GL_LIGHT6,GL_LIGHT7}; + if(enable) glEnable(lght[n]); + else glDisable(lght[n]); +} +//----------------------------------------------------------------------------- +bool mglCanvasGL::Light(bool enable) +{ + if(enable) { glEnable(GL_LIGHTING); glEnable(GL_NORMALIZE);} + else { glDisable(GL_LIGHTING); glDisable(GL_NORMALIZE); } + return mglCanvas::Light(enable); +} +//----------------------------------------------------------------------------- +void mglCanvasGL::LightScale() +{ + mglCanvas::LightScale(); + GLenum ll[8] = {GL_LIGHT0,GL_LIGHT1,GL_LIGHT2,GL_LIGHT3,GL_LIGHT4, + GL_LIGHT5,GL_LIGHT6,GL_LIGHT7}; + float pos[4]={0,0,0,0}; + for(int i=0;i<8;i++) + { + pos[0] = light[i].p.x; + pos[1] = light[i].p.y; + pos[2] = light[i].p.z; + if(light[i].n) glLightfv(ll[i], GL_POSITION, pos); + } +} +//----------------------------------------------------------------------------- +void mglCanvasGL::View(float TetX,float TetY,float TetZ) +{ + glMatrixMode(GL_PROJECTION);//GL_PROJECTION GL_VIEWPORT GL_MODELVIEW + glRotated(TetX,1.,0.,0.); + glRotated(TetY,0.,1.,0.); + glRotated(TetZ,0.,0.,1.); +} +//----------------------------------------------------------------------------- +void mglCanvasGL::Fog(float , float) +{ +/* if(d>0) // TODO: Add fog to OpenGL mode + { + glFogf(GL_FOG_MODE,GL_EXP); + glFogf(GL_FOG_DENSITY,5*d); + glFogfv(GL_FOG_COLOR,back); + glEnable(GL_FOG); + } + else glDisable(GL_FOG);*/ +} +//----------------------------------------------------------------------------- +void mglCanvasGL::Clf(mglColor Back) +{ + mglCanvas::Clf(Back); +// glDepthFunc(GL_LESS); + glDepthFunc(GL_GREATER); +// back[0]=Back.r; back[1]=Back.g; back[2]=Back.b; + glClearColor(Back.r,Back.g,Back.b,0.); + glClearDepth(-10.); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glEnable(GL_COLOR_MATERIAL); + + glMatrixMode(GL_MODELVIEW);//GL_MODELVIEW GL_VIEWPORT GL_PROJECTION + glLoadIdentity(); + glScaled(2,2,1.5); + glTranslated(-0.5,-0.5,-0.5); +} +//----------------------------------------------------------------------------- +void mglCanvasGL::set_pen(unsigned style,float width) +{ + if(style==0) return; + if(style!=0xffff) + { + glEnable(GL_LINE_STIPPLE); + glLineStipple(int(width+0.5),style); + } + else glDisable(GL_LINE_STIPPLE); + if(width>0) glLineWidth(width); + else glLineWidth(1); +} +//----------------------------------------------------------------------------- +void mglCanvasGL::EndFrame() +{ +// mglGraph::EndFrame(); + glEndList(); +} +//----------------------------------------------------------------------------- +int mglCanvasGL::NewFrame() +{ + Clf(); Identity(); + glNewList(CurFrameId,GL_COMPILE); + CurFrameId++; + return CurFrameId-1; +} +//----------------------------------------------------------------------------- +unsigned char **mglCanvasGL::GetRGBLines(long &width, long &height, unsigned char *&f, bool alpha) +{ + long x, y, d = alpha ? 4:3; + GLint w[4]; + glGetIntegerv(GL_VIEWPORT,w); + x=w[0]; y=w[1]; width=w[2]; height=w[3]; + unsigned char **p; + + p = (unsigned char **)malloc(height * sizeof(unsigned char *)); + f = (unsigned char *) malloc(width*height * sizeof(unsigned char)*d); + for(long i=0;i * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * 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 +//----------------------------------------------------------------------------- +// +// DensX, DensY, DensZ series +// +//----------------------------------------------------------------------------- +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(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; + gr->SaveState(opt); + + if(l>1) + { + aa.Create(m,l); xx.Create(m,l); yy.Create(m,l); zz.Create(m,l); + float d = (n-1)*(sv - gr->Min.x)/(gr->Max.x - gr->Min.x); + k = long(d); d = d - k; + if(k>n-2) { k=n-2; d=1; } + if(k<0) { k=0; d=0; } + for(j=0;jv(k,i,j)*(1-d) + d*a->v(k+1,i,j); + a = &aa; + } + else + { xx.Create(n,m); yy.Create(n,m); zz.Create(n,m); } + xx.Fill(sv, sv); + yy.Fill(gr->Min.y, gr->Max.y,'x'); + zz.Fill(gr->Min.z, gr->Max.z,'y'); + mgl_surfc_xy(gr,&xx,&yy,&zz,a,sch,0); +} +//----------------------------------------------------------------------------- +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(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; + gr->SaveState(opt); + + if(l>1) + { + aa.Create(n,l); xx.Create(n,l); yy.Create(n,l); zz.Create(n,l); + float d = (m-1)*(sv - gr->Min.y)/(gr->Max.y - gr->Min.y); + k = long(d); d = d - k; + if(k>m-2) { k=m-2; d=1; } + if(k<0) { k=0; d=0; } + for(j=0;jv(i,k,j)*(1-d) + d*a->v(i,k+1,j); + a = &aa; + } + else + { xx.Create(n,m); yy.Create(n,m); zz.Create(n,m); } + yy.Fill(sv, sv); + xx.Fill(gr->Min.x, gr->Max.x,'x'); + zz.Fill(gr->Min.z, gr->Max.z,'y'); + mgl_surfc_xy(gr,&xx,&yy,&zz,a,sch,0); +} +//----------------------------------------------------------------------------- +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(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; + gr->SaveState(opt); + + xx.Create(n,m); yy.Create(n,m); zz.Create(n,m); + if(l>1) + { + aa.Create(n,m); + float d = (l-1)*(sv - gr->Min.z)/(gr->Max.z - gr->Min.z); + k = long(d); d = d - k; + if(k>l-2) { k=l-2; d=1; } + if(k<0) { k=0; d=0; } + for(j=0;jv(i,j,k)*(1-d) + d*a->v(i,j,k+1); + a = &aa; + } + zz.Fill(sv, sv); + yy.Fill(gr->Min.y, gr->Max.y,'y'); + xx.Fill(gr->Min.x, gr->Max.x,'x'); + mgl_surfc_xy(gr,&xx,&yy,&zz,a,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_dens_x_(uintptr_t *gr, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_dens_x(_GR_, _DA_(a), s, *sv, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_dens_y_(uintptr_t *gr, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ + char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_dens_y(_GR_, _DA_(a), s, *sv, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_dens_z_(uintptr_t *gr, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ + char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_dens_z(_GR_, _DA_(a), s, *sv, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// ContX, ContY, ContZ series +// +//----------------------------------------------------------------------------- +void mgl_cont_gen(HMGL gr, float val, HCDT a, HCDT x, HCDT y, HCDT z, float c, int text,long ak); +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(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContX"); return; } + if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"ContX"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("ContX",cgid++); + mglData xx,yy,zz,aa; + + bool text=(sch && strchr(sch,'t')); + long ss=gr->AddTexture(sch); + gr->SetPenPal(sch); + + if(l>1) + { + aa.Create(m,l); xx.Create(m,l); yy.Create(m,l); zz.Create(m,l); + float d = (n-1)*(sv - gr->Min.x)/(gr->Max.x - gr->Min.x); + k = long(d); d = d - k; + if(k>n-2) { k=n-2; d=1; } + if(k<0) { k=0; d=0; } + for(j=0;jv(k,i,j)*(1-d) + d*a->v(k+1,i,j); + a = &aa; + } + else + { xx.Create(n,m); yy.Create(n,m); zz.Create(n,m); } + xx.Fill(sv, sv); + yy.Fill(gr->Min.y, gr->Max.y,'x'); + zz.Fill(gr->Min.z, gr->Max.z,'y'); + for(i=0;iGetNx();i++) + { + register float v0 = v->v(i); + mgl_cont_gen(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +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(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContY"); return; } + if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"ContY"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("ContY",cgid++); + mglData xx,yy,zz,aa; + + bool text=(sch && strchr(sch,'t')); + long ss=gr->AddTexture(sch); + gr->SetPenPal(sch); + + if(l>1) + { + aa.Create(n,l); xx.Create(n,l); yy.Create(n,l); zz.Create(n,l); + float d = (m-1)*(sv - gr->Min.y)/(gr->Max.y - gr->Min.y); + k = long(d); d = d - k; + if(k>m-2) { k=m-2; d=1; } + if(k<0) { k=0; d=0; } + for(j=0;jv(i,k,j)*(1-d) + d*a->v(i,k+1,j); + a = &aa; + } + else + { xx.Create(n,m); yy.Create(n,m); zz.Create(n,m); } + yy.Fill(sv, sv); + xx.Fill(gr->Min.x, gr->Max.x,'x'); + zz.Fill(gr->Min.z, gr->Max.z,'y'); + for(i=0;iGetNx();i++) + { + register float v0 = v->v(i); + mgl_cont_gen(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +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(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContZ"); return; } + if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"ContZ"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("ContZ",cgid++); + mglData xx,yy,zz,aa; + + bool text=(sch && strchr(sch,'t')); + long ss=gr->AddTexture(sch); + gr->SetPenPal(sch); + + xx.Create(n,m); yy.Create(n,m); zz.Create(n,m); + if(l>1) + { + aa.Create(n,m); + float d = (l-1)*(sv - gr->Min.z)/(gr->Max.z - gr->Min.z); + k = long(d); d = d - k; + if(k>l-2) { k=l-2; d=1; } + if(k<0) { k=0; d=0; } + for(j=0;jv(i,j,k)*(1-d) + d*a->v(i,j,k+1); + a = &aa; + } + zz.Fill(sv, sv); + yy.Fill(gr->Min.y, gr->Max.y,'y'); + xx.Fill(gr->Min.x, gr->Max.x,'x'); + for(i=0;iGetNx();i++) + { + register float v0 = v->v(i); + mgl_cont_gen(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +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); + 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); +} +//----------------------------------------------------------------------------- +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); + 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); +} +//----------------------------------------------------------------------------- +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); + 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); +} +//----------------------------------------------------------------------------- +void mgl_cont_x_(uintptr_t *gr, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cont_x(_GR_, _DA_(a), s, *sv, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_cont_y_(uintptr_t *gr, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cont_y(_GR_, _DA_(a), s, *sv, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_cont_z_(uintptr_t *gr, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cont_z(_GR_, _DA_(a), s, *sv, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_cont_x_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cont_x_val(_GR_, _DA_(v), _DA_(a), s, *sv, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_cont_y_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cont_y_val(_GR_, _DA_(v), _DA_(a), s, *sv, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_cont_z_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cont_z_val(_GR_, _DA_(v), _DA_(a), s, *sv, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// ContFX, ContFY, ContFZ series +// +//----------------------------------------------------------------------------- +void mgl_contf_gen(HMGL gr, float v1, float v2, HCDT a, HCDT x, HCDT y, HCDT z, float c, long ak); +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(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContFX"); return; } + if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"ContFX"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("ContFX",cgid++); + mglData xx,yy,zz,aa; + long ss=gr->AddTexture(sch); + + if(l>1) + { + aa.Create(m,l); xx.Create(m,l); yy.Create(m,l); zz.Create(m,l); + float d = (n-1)*(sv - gr->Min.x)/(gr->Max.x - gr->Min.x); + k = long(d); d = d - k; + if(k>n-2) { k=n-2; d=1; } + if(k<0) { k=0; d=0; } + for(j=0;jv(k,i,j)*(1-d) + d*a->v(k+1,i,j); + a = &aa; + } + else + { xx.Create(n,m); yy.Create(n,m); zz.Create(n,m); } + xx.Fill(sv, sv); + yy.Fill(gr->Min.y, gr->Max.y,'x'); + zz.Fill(gr->Min.z, gr->Max.z,'y'); + for(i=0;iGetNx()-1;i++) + { + register float v0 = v->v(i); + mgl_contf_gen(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +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(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContFY"); return; } + if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"ContFY"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("ContFY",cgid++); + mglData xx,yy,zz,aa; + long ss=gr->AddTexture(sch); + + if(l>1) + { + aa.Create(n,l); xx.Create(n,l); yy.Create(n,l); zz.Create(n,l); + float d = (m-1)*(sv - gr->Min.y)/(gr->Max.y - gr->Min.y); + k = long(d); d = d - k; + if(k>m-2) { k=m-2; d=1; } + if(k<0) { k=0; d=0; } + for(j=0;jv(i,k,j)*(1-d) + d*a->v(i,k+1,j); + a = &aa; + } + else + { xx.Create(n,m); yy.Create(n,m); zz.Create(n,m); } + yy.Fill(sv, sv); + xx.Fill(gr->Min.x, gr->Max.x,'x'); + zz.Fill(gr->Min.z, gr->Max.z,'y'); + for(i=0;iGetNx()-1;i++) + { + register float v0 = v->v(i); + mgl_contf_gen(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +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(n<2 || m<2) { gr->SetWarn(mglWarnLow,"ContFZ"); return; } + if(svMin.x || sv>gr->Max.x) { gr->SetWarn(mglWarnSlc,"ContFZ"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("ContFZ",cgid++); + mglData xx,yy,zz,aa; + long ss=gr->AddTexture(sch); + + xx.Create(n,m); yy.Create(n,m); zz.Create(n,m); + if(l>1) + { + aa.Create(n,m); + float d = (l-1)*(sv - gr->Min.z)/(gr->Max.z - gr->Min.z); + k = long(d); d = d - k; + if(k>l-2) { k=l-2; d=1; } + if(k<0) { k=0; d=0; } + for(j=0;jv(i,j,k)*(1-d) + d*a->v(i,j,k+1); + a = &aa; + } + zz.Fill(sv, sv); + yy.Fill(gr->Min.y, gr->Max.y,'y'); + xx.Fill(gr->Min.x, gr->Max.x,'x'); + for(i=0;iGetNx()-1;i++) + { + register float v0 = v->v(i); + mgl_contf_gen(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +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); + mglData v(Num); v.Fill(gr->Min.c, gr->Max.c); + mgl_contf_x_val(gr,&v,a,sch,sv,0); +} +//----------------------------------------------------------------------------- +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); + mglData v(Num); v.Fill(gr->Min.c, gr->Max.c); + mgl_contf_y_val(gr,&v,a,sch,sv,0); +} +//----------------------------------------------------------------------------- +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); + mglData v(Num); v.Fill(gr->Min.c, gr->Max.c); + mgl_contf_z_val(gr,&v,a,sch,sv,0); +} +//----------------------------------------------------------------------------- +void mgl_contf_x_(uintptr_t *gr, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contf_x(_GR_, _DA_(a), s, *sv, o); delete []o; delete []s; } +/// Draw several contour plots for data a at y = *sv +void mgl_contf_y_(uintptr_t *gr, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contf_y(_GR_, _DA_(a), s, *sv, o); delete []o; delete []s; } +/// Draw several contour plots for data a at z = *sv +void mgl_contf_z_(uintptr_t *gr, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contf_z(_GR_, _DA_(a), s, *sv, o); delete []o; delete []s; } +/// Draw contour plots for data a at x = *sv +void mgl_contf_x_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contf_x_val(_GR_, _DA_(v), _DA_(a), s, *sv, o); delete []o; delete []s;} +/// Draw contour plots for data a at y = *sv +void mgl_contf_y_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contf_y_val(_GR_, _DA_(v), _DA_(a), s, *sv, o); delete []o; delete []s;} +/// Draw contour plots for data a at z = *sv +void mgl_contf_z_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const char *sch, float *sv, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_contf_z_val(_GR_, _DA_(v), _DA_(a), s, *sv, o); delete []o; delete []s;} +//----------------------------------------------------------------------------- diff --git a/mgl/mgl_parse.cpp b/src/parser.cpp similarity index 63% rename from mgl/mgl_parse.cpp rename to src/parser.cpp index 5443add..a58af84 100644 --- a/mgl/mgl_parse.cpp +++ b/src/parser.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * mgl_parse.cpp is part of Math Graphic Library + * parse.cpp is part of Math Graphic Library * Copyright (C) 2007 Alexey Balakin * * * * This program is free software; you can redistribute it and/or modify * @@ -20,11 +20,9 @@ #include #include #include - -#include "mgl/mgl_parse.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" - +//----------------------------------------------------------------------------- +#include "mgl/parser.h" +//----------------------------------------------------------------------------- #ifdef WIN32 #include wchar_t *wcstokw32(wchar_t *wcs, const wchar_t *delim) { return wcstok(wcs,delim); } @@ -32,8 +30,9 @@ wchar_t *wcstokw32(wchar_t *wcs, const wchar_t *delim) { return wcstok(wcs,delim #else #include #endif - +//----------------------------------------------------------------------------- wchar_t *mgl_wcsdup(const wchar_t *s); +void mgl_wcstrim(wchar_t *str); //----------------------------------------------------------------------------- mglFunc::mglFunc(long p, const wchar_t *f, mglFunc *prev) { @@ -45,19 +44,19 @@ mglFunc::mglFunc(long p, const wchar_t *f, mglFunc *prev) if(narg<0 || narg>9) narg=0; } //----------------------------------------------------------------------------- -long mglParse::IsFunc(const wchar_t *name, int *na) +long mglParser::IsFunc(const wchar_t *name, int *na) { mglFunc *f=func; while(f) { - if(!wcscmp(name,f->func)) + if(f->func==name) { if(na) *na=f->narg; return f->pos; } f = f->next; } return 0; } //----------------------------------------------------------------------------- -void mglParse::ScanFunc(const wchar_t *line) +void mglParser::ScanFunc(const wchar_t *line) { static long num=0; if(!line) @@ -70,19 +69,6 @@ void mglParse::ScanFunc(const wchar_t *line) func = new mglFunc(num-1, line+i, func); } //----------------------------------------------------------------------------- -void mgl_wcstrim(wchar_t *str) -{ - wchar_t *c = mgl_wcsdup(str); - unsigned long n=wcslen(str); - long k; - for(k=0;k' ') break; - wcscpy(c,&(str[k])); - n = wcslen(c); - for(k=n-1;k>=0;k--) if(c[k]>' ') break; - c[k+1] = 0; - wcscpy(str,c); free(c); -} -//----------------------------------------------------------------------------- wchar_t *mgl_str_copy(const char *s) { wchar_t *str = new wchar_t[strlen(s)+1]; @@ -104,16 +90,7 @@ bool check_for_name(const wchar_t *s) return !isalpha(s[0])||wcschr(s,'.')||wcschr(s,':')||wcschr(s,'(')||wcschr(s,')'); } //----------------------------------------------------------------------------- -// It seems that standard wcstombs() have a bug. So, I replace by my own. -void mgl_wcstombs(char *dst, const wchar_t *src, int size) -{ - register int j; - for(j=0;jcreate) @@ -138,12 +114,19 @@ int mglParse::Exec(mglGraph *gr, const wchar_t *com, long n, mglArg *a, const wc mglVar *v = AddVar(var); v->d.Create(1,1,1); a[0].type = 0; a[0].d = &(v->d); - wcscpy(a[0].w, var); k[0] = 1; - mgl_wcstombs(a[0].s, a[0].w, 1024); -// wcstombs(a[0].s, a[0].w, 1024); + a[0].w = var; k[0] = 1; + } + char *o=0; + if(opt && *opt) // TODO: parse arguments of options + { + long len = wcslen(opt); + o = new char[len+1]; + for(i=0;isave(out, n, a, k); - return rts->exec(gr, n, a, k); + if(out) rts->save(out, n, a, k, o); + int res=rts->exec(gr, n, a, k, o); + if(o) delete []o; + return res; } //----------------------------------------------------------------------------- void mglVar::MoveAfter(mglVar *var) @@ -153,8 +136,7 @@ void mglVar::MoveAfter(mglVar *var) prev = next = 0; if(var) { - prev = var; - next = var->next; + prev = var; next = var->next; var->next = this; if(func==0) func = var->func; } @@ -174,11 +156,7 @@ void mglNum::MoveAfter(mglNum *var) if(next) next->prev = prev; prev = next = 0; if(var) - { - prev = var; - next = var->next; - var->next = this; - } + { prev = var; next = var->next; var->next = this; } if(next) next->prev = this; } //----------------------------------------------------------------------------- @@ -188,9 +166,18 @@ mglNum::~mglNum() if(next) next->prev = prev; } //----------------------------------------------------------------------------- -mglParse::mglParse(bool setsize) +mglParser::mglParser(bool setsize) { - memset(this,0,sizeof(mglParse)); + DataList=0; NumList=0; func=0; fn_stack=0; +// wchar_t *par[40]; ///< Parameter for substituting instead of $1, ..., $9 + out=0; *leg=0; + Skip=Stop=for_br=false; + memset(for_stack,0,40*sizeof(int)); + memset(if_stack,0,40*sizeof(int)); + memset(if_for,0,40*sizeof(int)); + if_pos=fn_pos=fn_num=for_addr=0; + for(long i=0;i<40;i++) par[i]=0; + Cmd = mgls_base_cmd; AllowSetSize=setsize; Once = true; parlen=320; @@ -198,20 +185,20 @@ mglParse::mglParse(bool setsize) fval = new mglData[40]; } //----------------------------------------------------------------------------- -mglParse::~mglParse() +mglParser::~mglParser() { if(DataList) { while(DataList->next) delete DataList->next; delete DataList; } - for(long i=0;i<40;i++) if(par[i]) delete []par[i]; + for(long i=0;i<40;i++) if(par[i]) delete [](par[i]); delete []op1; delete []op2; delete []fval; if(Cmd!=mgls_base_cmd) delete []Cmd; if(fn_stack) free(fn_stack); } //----------------------------------------------------------------------------- -bool mglParse::AddParam(int n, const char *str, bool isstr) +bool mglParser::AddParam(int n, const char *str, bool isstr) { unsigned s = strlen(str)+1; wchar_t *wcs = new wchar_t[s]; @@ -220,7 +207,7 @@ bool mglParse::AddParam(int n, const char *str, bool isstr) delete []wcs; return r; } //----------------------------------------------------------------------------- -int mglParse::Parse(mglGraph *gr, const char *str, long pos) +int mglParser::Parse(mglGraph *gr, const char *str, long pos) { unsigned s = strlen(str)+1; wchar_t *wcs = new wchar_t[s]; @@ -229,7 +216,7 @@ int mglParse::Parse(mglGraph *gr, const char *str, long pos) delete []wcs; return r; } //----------------------------------------------------------------------------- -mglVar *mglParse::AddVar(const char *str) +mglVar *mglParser::AddVar(const char *str) { unsigned s = strlen(str)+1; wchar_t *wcs = new wchar_t[s]; @@ -239,7 +226,7 @@ mglVar *mglParse::AddVar(const char *str) return v; } //----------------------------------------------------------------------------- -mglVar *mglParse::FindVar(const char *str) +mglVar *mglParser::FindVar(const char *str) { unsigned s = strlen(str)+1; wchar_t *wcs = new wchar_t[s]; @@ -249,7 +236,7 @@ mglVar *mglParse::FindVar(const char *str) return v; } //----------------------------------------------------------------------------- -mglNum *mglParse::AddNum(const char *str) +mglNum *mglParser::AddNum(const char *str) { unsigned s = strlen(str)+1; wchar_t *wcs = new wchar_t[s]; @@ -259,7 +246,7 @@ mglNum *mglParse::AddNum(const char *str) return v; } //----------------------------------------------------------------------------- -mglNum *mglParse::FindNum(const char *str) +mglNum *mglParser::FindNum(const char *str) { unsigned s = strlen(str)+1; wchar_t *wcs = new wchar_t[s]; @@ -269,57 +256,55 @@ mglNum *mglParse::FindNum(const char *str) return v; } //----------------------------------------------------------------------------- -bool mglParse::AddParam(int n, const wchar_t *str, bool isstr) +bool mglParser::AddParam(int n, const wchar_t *str, bool isstr) { if(n<0 || n>39 || wcschr(str,'$')) return false; if(!isstr) parlen += wcslen(str); - if(par[n]) delete []par[n]; + if(par[n]) delete [](par[n]); par[n] = new wchar_t[wcslen(str)+1]; wcscpy(par[n],str); return true; } //----------------------------------------------------------------------------- -mglVar *mglParse::FindVar(const wchar_t *name) +mglVar *mglParser::FindVar(const wchar_t *name) { mglVar *v=DataList; while(v) { - if(!wcscmp(name, v->s)) return v; + if(v->s==name) return v; v = v->next; } return 0; } //----------------------------------------------------------------------------- -mglVar *mglParse::AddVar(const wchar_t *name) +mglVar *mglParser::AddVar(const wchar_t *name) { mglVar *v = FindVar(name); if(v) return v; - v = new mglVar; - wcsncpy(v->s,name,256); + v = new mglVar; v->s = name; if(DataList) v->MoveAfter(DataList); else DataList = v; return v; } //----------------------------------------------------------------------------- -mglNum *mglParse::FindNum(const wchar_t *name) +mglNum *mglParser::FindNum(const wchar_t *name) { mglNum *v=NumList; while(v) { - if(!wcscmp(name, v->s)) return v; + if(v->s==name) return v; v = v->next; } return 0; } //----------------------------------------------------------------------------- -mglNum *mglParse::AddNum(const wchar_t *name) +mglNum *mglParser::AddNum(const wchar_t *name) { mglNum *v = FindNum(name); if(v) return v; - v = new mglNum; - wcsncpy(v->s,name,256); - if(NumList) v->MoveAfter(NumList); - else NumList = v; + v = new mglNum; v->s = name; + if(NumList) v->MoveAfter(NumList); + else NumList = v; return v; } //----------------------------------------------------------------------------- @@ -337,16 +322,13 @@ int mglFindArg(const wchar_t *str) return 0; } //----------------------------------------------------------------------------- -void wcstrim_mgl(wchar_t *str); -void wcslwr_mgl(wchar_t *str); -//----------------------------------------------------------------------------- bool mgls_suffix(const wchar_t *p, mglData *d, mreal *v) { mreal x,y,z,k; bool ok=false; if(!wcscmp(p,L"a")) { ok = true; *v = d->a[0]; } - else if(!wcscmp(p,L"fst")) { ok = true; int i=-1,j=-1,k=-1; *v = d->Find(0,i,j,k); } - else if(!wcscmp(p,L"lst")) { ok = true; int i=-1,j=-1,k=-1; *v = d->Last(0,i,j,k); } + else if(!wcscmp(p,L"fst")) { ok = true; long i=-1,j=-1,l=-1; *v = d->Find(0,i,j,l); } + else if(!wcscmp(p,L"lst")) { ok = true; long i=-1,j=-1,l=-1; *v = d->Last(0,i,j,l); } else if(!wcscmp(p,L"nx")) { ok = true; *v=d->nx; } else if(!wcscmp(p,L"ny")) { ok = true; *v=d->ny; } else if(!wcscmp(p,L"nz")) { ok = true; *v=d->nz; } @@ -376,8 +358,8 @@ bool mgls_suffix(const wchar_t *p, mglData *d, mreal *v) } //----------------------------------------------------------------------------- // convert substrings to arguments -mglData mglFormulaCalc(const wchar_t *string, mglParse *arg); -void mglParse::FillArg(mglGraph *gr, int k, wchar_t **arg, mglArg *a) +mglData mglFormulaCalc(const wchar_t *string, mglParser *arg); +void mglParser::FillArg(mglGraph *gr, int k, wchar_t **arg, mglArg *a) { register long n; for(n=1;n=2048) arg[n][2048]=0; - wcscpy(a[n-1].w, arg[n]+1); + a[n-1].w = arg[n]+1; } else if(arg[n][0]=='{') { // this is temp data arg[n][wcslen(arg[n])-1] = 0; u=new mglVar; u->temp=true; - mglprintf(a[n-1].w,2048,L"/*%ls*/",arg[n]); + a[n-1].w = L"/*"+std::wstring(arg[n])+L"*/"; if(DataList) u->MoveAfter(DataList); else DataList = u; a[n-1].type = 0; a[n-1].d = &(u->d); ParseDat(gr, arg[n]+1, u->d); // TODO: Check it } - else if((v = FindVar(arg[n]))!=0) - { // have to find normal variables (for data creation) - a[n-1].type = 0; a[n-1].d = &(v->d); - wcscpy(a[n-1].w, v->s); - } - else if((f = FindNum(arg[n]))!=0) - { // have to find normal variables (for data creation) - a[n-1].type = 2; a[n-1].d = 0; a[n-1].v = f->d; - wcscpy(a[n-1].w, f->s); - } + else if((v = FindVar(arg[n]))!=0) // have to find normal variables (for data creation) + { a[n-1].type=0; a[n-1].d=&(v->d); a[n-1].w=v->s; } + else if((f = FindNum(arg[n]))!=0) // have to find normal variables (for data creation) + { a[n-1].type=2; a[n-1].d=0; a[n-1].v=f->d; a[n-1].w = f->s; } else { // parse all numbers and formulas by unified way const mglData &d=mglFormulaCalc(arg[n], this); -//printf("arg: %ls, -- dat: %ld x %ld x %ld, -- val: %g\n",arg[n],d.nx,d.ny,d.nz,d.a[0]); if(d.nx*d.ny*d.nz==1) { a[n-1].type = 2; a[n-1].v = d.a[0]; } else { u=new mglVar; u->temp=true; u->d=d; - mglprintf(a[n-1].w,2048,L"/*%ls*/",arg[n]); + a[n-1].w = L"/*"+std::wstring(arg[n])+L"*/"; if(DataList) u->MoveAfter(DataList); else DataList = u; a[n-1].type = 0; a[n-1].d = &(u->d); @@ -430,9 +405,8 @@ void mglParse::FillArg(mglGraph *gr, int k, wchar_t **arg, mglArg *a) } } //----------------------------------------------------------------------------- -// return values: 0 - not found, 1 - OK, 2 - wrong arguments, -// 3 - wrong command, 4 - string too long -int mglParse::PreExec(mglGraph *, long k, wchar_t **arg, mglArg *a) +// return values: 0 - not found, 1 - OK, 2 - wrong arguments, 3 - wrong command, 4 - string too long +int mglParser::PreExec(mglGraph *, long k, wchar_t **arg, mglArg *a) { long n=0; mglVar *v; @@ -510,7 +484,7 @@ int mglParse::PreExec(mglGraph *, long k, wchar_t **arg, mglArg *a) return n; } //----------------------------------------------------------------------------- -void mglParse::PutArg(const wchar_t *string, wchar_t *str, bool def) +void mglParser::PutArg(const wchar_t *string, wchar_t *str, bool def) { if(parlen>0) { @@ -519,8 +493,7 @@ void mglParse::PutArg(const wchar_t *string, wchar_t *str, bool def) register long n; while((t=wcschr(str,'$'))!=0) { - wcscpy(sb,t+2); - t[0]=0; + wcscpy(sb,t+2); t[0]=0; n = t[1]-'0'; if(n>=0 && n<=9 && par[n]) wcscat(str,par[n]); n = t[1]-'a'; if(n>=0 && n<='z'-'a' && par[n+10]) wcscat(str,par[n+10]); if(t[1]=='$') wcscat(str,L"\xffff"); @@ -532,22 +505,24 @@ void mglParse::PutArg(const wchar_t *string, wchar_t *str, bool def) } //----------------------------------------------------------------------------- // return values: 0 - OK, 1 - wrong arguments, 2 - wrong command, 3 - string too long, 4 -- unclosed string -int mglParse::Parse(mglGraph *gr, const wchar_t *string, long pos) +int mglParser::Parse(mglGraph *gr, const wchar_t *string, long pos) { - if(!gr || Stop) return 0; + if(Stop) return 0; wchar_t *str, *s = new wchar_t[wcslen(string)+1+40*parlen],*arg[1024],*t; str = s; wcscpy(str,string); - wcstrim_mgl(str); - long n,k=0,m=0; - // try parse ':' - for(n=k=0;n='0' && ss[1]<='9') - { - int n=ss[1]-'0';// res = 0; - ss +=2; mgl_wcstrim(ss); - AddParam(n, ss); - delete []s; return 0; - } - if(*ss=='$' && ss[1]>='a' && ss[1]<='z') + str += 7; mgl_wcstrim(str);// int res = 1; + int nn = str[1]<='9' ? str[1]-'0' : (str[1]>='a' ? str[1]-'a'+10:-1); + if(*str=='$' && nn>=0 && nn<='z'-'a'+10) { - int n=ss[1]-'a';// res = 0; - ss +=2; mgl_wcstrim(ss); - AddParam(n+10, ss); - delete []s; return 0; + str +=2; mgl_wcstrim(str); + AddParam(n, str); delete []s; return 0; } } if(!wcsncmp(str+3,L"num",3)) { - str += 7; wcstrim_mgl(str); int res = 1; - if(*str=='$' && str[1]>='0' && str[1]<='9') + str += 7; mgl_wcstrim(str); int res = 1; + int nn = str[1]<='9' ? str[1]-'0' : (str[1]>='a' ? str[1]-'a'+10:-1); + if(*str=='$' && nn>=0 && nn<='z'-'a'+10) { - int n=str[1]-'0'; res = 0; - str +=2; mgl_wcstrim(str); - const mglData &d=mglFormulaCalc(str, this); - char *buf=new char[128]; - sprintf(buf,"%g",d.a[0]); - AddParam(n, buf); - delete []buf; - } - if(*str=='$' && str[1]>='a' && str[1]<='z') - { - int n=str[1]-'a'; res = 0; - str +=2; mgl_wcstrim(str); + res = 0; str +=2; mgl_wcstrim(str); const mglData &d=mglFormulaCalc(str, this); char *buf=new char[128]; sprintf(buf,"%g",d.a[0]); - AddParam(n+10, buf); - delete []buf; + AddParam(n, buf); delete []buf; } - delete []s; return res; + delete []s; return res; } if(!wcsncmp(str+3,L"chr",3)) { - str += 7; wcstrim_mgl(str); int res = 1; - if(*str=='$' && str[1]>='0' && str[1]<='9') - { - int n=str[1]-'0'; res = 0; - str +=2; mgl_wcstrim(str); - const mglData &d=mglFormulaCalc(str, this); - wchar_t buf[2]={0,0}; buf[0] = wchar_t(d.a[0]); - AddParam(n, buf); - } - if(*str=='$' && str[1]>='a' && str[1]<='z') + str += 7; mgl_wcstrim(str); int res = 1; + int nn = str[1]<='9' ? str[1]-'0' : (str[1]>='a' ? str[1]-'a'+10:-1); + if(*str=='$' && nn>=0 && nn<='z'-'a'+10) { - int n=str[1]-'a'; res = 0; - str +=2; mgl_wcstrim(str); + res = 0; str +=2; mgl_wcstrim(str); const mglData &d=mglFormulaCalc(str, this); wchar_t buf[2]={0,0}; buf[0] = wchar_t(d.a[0]); - AddParam(n+10, buf); - } - delete []s; return res; - } - if(!wcsncmp(str+3,L"pal",3)) - { - str += 7; wcstrim_mgl(str); int res = 1; - if(*str=='$' && str[1]>='0' && str[1]<='9') - { - int n=str[1]-'0'; res = 0; - str +=2; mgl_wcstrim(str); - const mglData &d=mglFormulaCalc(str, this); - wchar_t buf[2]={0,0}; - buf[0] = gr->DefPal[int(d.a[0])%gr->NumPal]; AddParam(n, buf); } - if(*str=='$' && str[1]>='a' && str[1]<='z') - { - int n=str[1]-'a'; res = 0; - str +=2; mgl_wcstrim(str); - const mglData &d=mglFormulaCalc(str, this); - wchar_t buf[2]={0,0}; - buf[0] = gr->DefPal[int(d.a[0])%gr->NumPal]; - AddParam(n+10, buf); - } - delete []s; return res; + delete []s; return res; } } if(!skip() && !wcsncmp(str,L"for",3) && (str[3]==' ' || str[3]=='\t')) { - t = str+4; - while(*t && isspace(*t)) t++; + for(t=str+4;*t<=' ';t++); // if command have format 'for $N ...' then change it to 'for N ...' if(*t=='$' && t[1]>='0' && t[1]<='9') *t = ' '; if(*t=='$' && t[1]>='a' && t[1]<='z') *t = ' '; } + // parse arguments (parameters $1, ..., $9) - PutArg (string,str,false); wcstrim_mgl(str); + PutArg(string,str,false); mgl_wcstrim(str); + wchar_t *opt=0; for(k=0;k<1024;k++) // parse string to substrings (by spaces) { n = mglFindArg(str); - if(n<1) + if(n<1) // this is option { - if(str[-n]==';') ProcOpt(gr,str-n); + if(str[-n]==';') opt = str-n+1; if(n<0) str[-n]=0; break; } str[n]=0; arg[k] = str;// k++; - str = str+n+1; wcstrim_mgl(str); + str = str+n+1; mgl_wcstrim(str); } // try to find last argument if(str[0]!=0 && str[0]!='#' && str[0]!=';') { arg[k] = str; k++; } @@ -684,7 +608,8 @@ int mglParse::Parse(mglGraph *gr, const wchar_t *string, long pos) // execute first special (program-flow-control) commands if(!skip() && !wcscmp(arg[0],L"stop")) { Stop = true; delete []s; delete []a; return 0; } - if(!wcscmp(arg[0],L"func")) { delete []s; delete []a; return 0; } + if(!wcscmp(arg[0],L"func")) + { delete []s; delete []a; return 0; } n = FlowExec(gr, arg[0],k-1,a); if(n) { delete []s; delete []a; return n-1; } if(skip()) { delete []s; delete []a; return 0; } @@ -704,22 +629,25 @@ int mglParse::Parse(mglGraph *gr, const wchar_t *string, long pos) if(a[0].type==1) { int na=0; - mgl_wcstombs(a[0].s, a[0].w, 1024); n=-IsFunc(a[0].w,&na); - if(n && k!=na+2) + a[0].s.assign(a[0].w.begin(),a[0].w.end()); + n=-IsFunc(a[0].w.c_str(),&na); + if(n && k!=na+2) { - if(gr->Message) - sprintf(gr->Message,"Bad arguments for %ls: %ld instead of %d\n", - a[0].w,k-2,na); + if(gr->Self()->Message) + sprintf(gr->Self()->Message,"Bad arguments for %ls: %ld instead of %d\n", + a[0].w.c_str(),k-2,na); n = 1; } else if(n) { if(!fn_stack) { fn_num = 100; - fn_stack = (mglFnStack*)malloc(fn_num*sizeof(mglFnStack)); } + fn_stack = (mglFnStack*)malloc(fn_num*sizeof(mglFnStack)); + memset(fn_stack,0,fn_num*sizeof(mglFnStack)); } if(fn_pos >= fn_num) { fn_num+= 100; - fn_stack = (mglFnStack*)realloc(fn_stack,fn_num*sizeof(mglFnStack)); } + fn_stack = (mglFnStack*)realloc(fn_stack,fn_num*sizeof(mglFnStack)); + memset(fn_stack+fn_num-100,0,100*sizeof(mglFnStack)); } memcpy(fn_stack[fn_pos].par,par+1,9*sizeof(wchar_t*)); memset(par+1,0,9*sizeof(wchar_t*)); for(int i=1;ia[1].v) { mreal step = a[3].type==2?a[3].v:1; - int m = int(step>0 ? (a[2].v-a[1].v)/step : 0); - if(m>0) + mm = int(step>0 ? (a[2].v-a[1].v)/step : 0); + if(mm>0) { - n=0; fval[r].Create(m+1); - for(int ii=0;ii0) n--; else if(!wcscmp(L"setsize",arg[0]) && !AllowSetSize) n = 2; - else n = Exec(gr, arg[0],k-1,a, arg[1]); + else n = Exec(gr, arg[0],k-1,a, arg[1], opt); delete []a; } mglVar *v = DataList, *u; @@ -784,55 +712,43 @@ int mglParse::Parse(mglGraph *gr, const wchar_t *string, long pos) if(v->temp) { if(DataList==v) DataList = v->next; delete v; } v = u; } - // restore plot settings if it was changed - ProcOpt(gr,0); - delete []s; - return n; + delete []s; return n; } //----------------------------------------------------------------------------- // return values: 0 - OK, 1 - wrong arguments, 2 - wrong command, 3 - string too long, 4 -- unclosed string -int mglParse::ParseDat(mglGraph *gr, const wchar_t *string, mglData &res) +int mglParser::ParseDat(mglGraph *gr, const wchar_t *string, mglData &res) { wchar_t *str, *s = new wchar_t[wcslen(string)+1+parlen],*arg[32]; str = s; - wcscpy(str,string); wcstrim_mgl(str); + wcscpy(str,string); mgl_wcstrim(str); long n,k=0; for(k=0;k<32;k++) // parse string to substrings (by spaces) { n = mglFindArg(str); - if(n<1) - { - if(str[-n]==';') ProcOpt(gr,str-n); - if(n<0) str[-n]=0; - break; - } + if(n<0) { str[-n]=0; break; } str[n]=0; arg[k] = str;// k++; - str = str+n+1; wcstrim_mgl(str); + str = str+n+1; mgl_wcstrim(str); } // try to find last argument if(str[0]!=0 && str[0]!='#' && str[0]!=';') { arg[k] = str; k++; } if(k<1) n =0; else - { - // fill arguments by its values + { // fill arguments by its values mglArg *a = new mglArg[k+1]; FillArg(gr, k, arg, a+1); a[0].type=0; a[0].d=&res; // alocate new arrays and execute the command itself int kk[10], i; for(i=0;i<10;i++) kk[i] = i<=k ? a[i].type + 1 : 0; - for(i=0;i<=k;i++) mgl_wcstombs(a[i].s, a[i].w, 1024); + for(i=0;i<=k;i++) a[i].s.assign(a[i].w.begin(),a[i].w.end()); mglCommand *rts=FindCommand(arg[0]); if(!rts || !rts->create) return 2; - if(out) rts->save(out, k, a, kk); - n = rts->exec(gr, k, a, kk); + n = rts->exec(gr, k, a, kk, 0); delete []a; } - // restore plot settings if it was changed - ProcOpt(gr,0); delete []s; - return n; + delete []s; return n; } //----------------------------------------------------------------------------- -int mglParse::FlowExec(mglGraph *, const wchar_t *com, long m, mglArg *a) +int mglParser::FlowExec(mglGraph *, const wchar_t *com, long m, mglArg *a) { int n=-1; if(!ifskip() && !wcscmp(com,L"once")) @@ -857,10 +773,10 @@ int mglParse::FlowExec(mglGraph *, const wchar_t *com, long m, mglArg *a) } else if(a[0].type==0) { - n = 0; mgl_wcstombs(a[1].s, a[1].w, 1024); - cond = a[0].d->FindAny((m>1 && a[1].type==1) ? a[1].s:"u")?3:0; + n = 0; a[1].s.assign(a[1].w.begin(),a[1].w.end()); + cond = a[0].d->FindAny((m>1 && a[1].type==1) ? a[1].s.c_str():"u")?3:0; if(out) mglprintf(out,1024,L"if(%ls.FindAny(\"%s\"))\t{", - a[0].w, (m>1 && a[1].type==1) ? a[1].s:"u"); + a[0].w.c_str(), (m>1 && a[1].type==1) ? a[1].s.c_str():"u"); } else n = 1; if(n==0) @@ -892,10 +808,10 @@ int mglParse::FlowExec(mglGraph *, const wchar_t *com, long m, mglArg *a) } else if(a[0].type==0) { - n = 0; mgl_wcstombs(a[1].s, a[1].w, 1024); - cond = a[0].d->FindAny((m>1 && a[1].type==1) ? a[1].s:"u")?3:0; + n = 0; a[1].s.assign(a[1].w.begin(),a[1].w.end()); + cond = a[0].d->FindAny((m>1 && a[1].type==1) ? a[1].s.c_str():"u")?3:0; if(out) mglprintf(out,1024,L"else if(%ls.FindAny(\"%s\"))\t{", - a[0].w, (m>1 && a[1].type==1) ? a[1].s:"u"); + a[0].w.c_str(), (m>1 && a[1].type==1) ? a[1].s.c_str():"u"); } else n = 1; if(n==0) if_stack[if_pos-1] = cond; @@ -954,52 +870,43 @@ int mglParse::FlowExec(mglGraph *, const wchar_t *com, long m, mglArg *a) return n+1; } //----------------------------------------------------------------------------- -void mgl_error_print(int line, int r, mglGraph *gr) +void mgl_error_print(int line, int r, char *Message) { - if(r==0) printf("%s\n",gr->Message); + if(r==0) printf("%s\n",Message ? Message:""); if(r==1) printf("Wrong argument(s) in line %d\n", line); if(r==2) printf("Wrong command in line %d\n", line); if(r==3) printf("String too long in line %d\n", line); if(r==4) printf("Unbalanced ' in line %d\n", line); - if(gr->Message) gr->Message[0]=0; + if(Message) Message[0]=0; } -void mglParse::Execute(mglGraph *gr, FILE *fp, bool print) +#include +void mglParser::Execute(mglGraph *gr, FILE *fp, bool print) { if(gr==0 || fp==0) return; - fseek(fp,0,SEEK_END); // get file size - long len=ftell(fp),cur=0; - fseek(fp,0,SEEK_SET); // restore back - wchar_t *str=new wchar_t[len+1]; - if(len>0) for(cur=0;cur0) error(i+1, r, gr); - if(gr->Message && gr->Message[0]) error(i,0,gr); + if(r>0) error(i+1, r, 0); + if(gr->Self()->Message && gr->Self()->Message[0]) error(i,0,gr->Self()->Message); } } } //----------------------------------------------------------------------------- -void mglParse::Execute(mglGraph *gr, const wchar_t *text, void (*error)(int line, int kind, mglGraph *gr)) +void mglParser::Execute(mglGraph *gr, const wchar_t *text, void (*error)(int line, int kind, char *mes)) { unsigned s = wcslen(text)+1; wchar_t *wcs = new wchar_t[s]; @@ -1015,7 +922,7 @@ void mglParse::Execute(mglGraph *gr, const wchar_t *text, void (*error)(int line delete []wcs; free(str); } //----------------------------------------------------------------------------- -void mglParse::Execute(mglGraph *gr, const char *text, void (*error)(int line, int kind, mglGraph *gr)) +void mglParser::Execute(mglGraph *gr, const char *text, void (*error)(int line, int kind, char *mes)) { unsigned s = strlen(text)+1; wchar_t *wcs = new wchar_t[s]; @@ -1024,7 +931,7 @@ void mglParse::Execute(mglGraph *gr, const char *text, void (*error)(int line, i delete []wcs; } //----------------------------------------------------------------------------- -int mglParse::Export(wchar_t cpp_out[1024], mglGraph *gr, const wchar_t *str) +int mglParser::Export(wchar_t cpp_out[1024], mglGraph *gr, const wchar_t *str) { *op1 = *op2 = 0; out = cpp_out; @@ -1033,202 +940,26 @@ int mglParse::Export(wchar_t cpp_out[1024], mglGraph *gr, const wchar_t *str) return res; } //----------------------------------------------------------------------------- -void mglParse::ProcOpt(mglGraph *gr, wchar_t *str) -{ - wchar_t buf[256]=L""; - if(str==0) - { - if(opt[0]) - { - gr->Min.x = val[0]; gr->Max.x = val[1]; gr->RecalcBorder(); - if(out) mglprintf(buf,256,L"\tgr->Min.x = tx1;\tgr->Max.x = tx2;}"); - wcscat(op2,buf); - } - if(opt[1]) - { - gr->Min.y = val[2]; gr->Max.y = val[3]; gr->RecalcBorder(); - if(out) mglprintf(buf,256,L"\tgr->Min.y = ty1;\tgr->Max.y = ty2;}"); - wcscat(op2,buf); - } - if(opt[2]) - { - gr->Min.z = val[4]; gr->Max.z = val[5]; gr->RecalcBorder(); - if(out) mglprintf(buf,256,L"\tgr->Min.z = tz1;\tgr->Max.z = tz2;}"); - wcscat(op2,buf); - } - if(opt[3]) - { - gr->Cmin = val[6]; gr->Cmax = val[7]; - if(out) mglprintf(buf,256,L"\tgr->Cmin = tc1;\tgr->Cmax = tc2;}"); - wcscat(op2,buf); - } - if(opt[4]) - { - gr->Ambient(val[8]); - if(out) mglprintf(buf,256,L"\tgr->Ambient(tam);}"); - wcscat(op2,buf); - } - if(opt[5]) - { - gr->Cut = val[10]!=0; - if(out) mglprintf(buf,256,L"\tgr->Cut = tct;}"); - wcscat(op2,buf); - } - if(opt[6]) - { - gr->AlphaDef = val[12]; - if(out) mglprintf(buf,256,L"\tgr->AlphaDef = tad;}"); - wcscat(op2,buf); - } - if(opt[7]) - { - gr->MeshNum = int(val[14]); - if(out) mglprintf(buf,256,L"\tgr->MeshNum = tmn;}"); - wcscat(op2,buf); - } - if(opt[8]) - { - gr->FontSize = val[16]; - if(out) mglprintf(buf,256,L"\tgr->FontSize = tfs;}"); - wcscat(op2,buf); - } - if(opt[9]) - { - gr->MarkSize = val[17]; - if(out) mglprintf(buf,256,L"\tgr->MarkSize = tms;}"); - wcscat(op2,buf); - } - if(opt[10]) - { - gr->AddLegend(leg, gr->last_style); - if(out) mglprintf(buf,256,L"\tgr->AddLegend(\"%s\", \"%s\");", leg, gr->last_style); - wcscat(op2,buf); - } - for(long i=0;i<16;i++) opt[i]=false; - } - else - { - wchar_t *q=str,*s,*a,*b,*c; - long n; - wcstrim_mgl(q); q++; - // NOTE: not consider '#' inside legend entry !!! - s=wcschr(q,'#'); if(s) *s=0; - while(q && *q) - { - // NOTE: not consider ';' inside legend entry !!! - s=q; q=wcschr(s,';'); - if(q) { *q=0; q++; } - wcstrim_mgl(s); a=s; - n=mglFindArg(s); if(n>0) { s[n]=0; s=s+n+1; } - wcstrim_mgl(a); b=s; - n=mglFindArg(s); if(n>0) { s[n]=0; s=s+n+1; } - wcstrim_mgl(b); - - mglData bb,ss; - bb = mglFormulaCalc(b, this); - mreal ff = bb.a[0]; - if(!wcscmp(a+1,L"range")) - { - n=mglFindArg(s); c=s; - if(n>0) { s[n]=0; s=s+n+1; } - wcstrim_mgl(c); - ss = mglFormulaCalc(c, this); - if(a[0]=='x') - { - val[0] = gr->Min.x; val[1] = gr->Max.x; opt[0]=true; - gr->Min.x = bb.a[0]; gr->Max.x = ss.a[0]; - if(out) mglprintf(buf,256,L"{mreal tx1=gr->Min.x, tx2=gr->Max.x;\tgr->Min.x=%g;\tgr->Max.x=%g;", wcstod(b,0), wcstod(s,0)); - wcscat(op1,buf); - } - else if(a[0]=='y') - { - val[2] = gr->Min.y; val[3] = gr->Max.y; opt[1]=true; - gr->Min.y = bb.a[0]; gr->Max.y = ss.a[0]; - if(out) mglprintf(buf,256,L"{mreal ty1=gr->Min.y, ty2=gr->Max.y;\tgr->Min.y=%g;\tgr->Max.y=%g;", wcstod(b,0), wcstod(s,0)); - wcscat(op1,buf); - } - else if(a[0]=='z') - { - val[4] = gr->Min.z; val[5] = gr->Max.z; opt[2]=true; - gr->Min.z = bb.a[0]; gr->Max.z = ss.a[0]; - if(out) mglprintf(buf,256,L"{mreal tz1=gr->Min.z, tz2=gr->Max.z;\tgr->Min.z=%g;\tgr->Max.z=%g;", wcstod(b,0), wcstod(s,0)); - wcscat(op1,buf); - } - else if(a[0]=='c') - { - val[6] = gr->Cmin; val[7] = gr->Cmax; opt[3]=true; - gr->Cmin = bb.a[0]; gr->Cmax = ss.a[0]; - if(out) mglprintf(buf,256,L"{mreal tc1=gr->Cmin, tc2=gr->Cmax;\tgr->Cmin=%g;\tgr->Cmax=%g;", wcstod(b,0), wcstod(s,0)); - wcscat(op1,buf); - } - } - else if(!wcscmp(a,L"cut")) - { - val[10]= gr->Cut; opt[5]=true; - gr->Cut = (ff!=0 || !wcsncmp(s,L"on",2)); - if(out) mglprintf(buf,256,L"{bool tct=gr->Cut;\tgr->Cut=%s;", gr->Cut?"true":"false"); - wcscat(op1,buf); - } - else if(!wcscmp(a,L"meshnum")) - { - val[14]= gr->MeshNum; opt[7]=true; gr->MeshNum = int(ff); - if(out) mglprintf(buf,256,L"{int tmn=gr->MeshNum;\tgr->MeshNum=%d;", gr->MeshNum); - wcscat(op1,buf); - } - else if(!wcscmp(a,L"alphadef") || !wcscmp(a,L"alpha")) - { - val[12]= gr->AlphaDef; opt[6]=true; gr->AlphaDef = ff; - if(out) mglprintf(buf,256,L"{mreal tad=gr->AlphaDef;\tgr->AlphaDef=%g;", ff); - wcscat(op1,buf); - } - else if(!wcscmp(a,L"fontsize")) - { - val[16]= gr->FontSize; opt[8]=true; - gr->FontSize = ff>0 ? ff : -ff*gr->FontSize; - if(out) mglprintf(buf,256,L"{mreal tfs=gr->FontSize;\tgr->FontSize=%g;", gr->FontSize); - wcscat(op1,buf); - } - else if(!wcscmp(a,L"ambient")) - { - val[8] = gr->AmbBr; opt[4]=true; gr->Ambient(ff); - if(out) mglprintf(buf,256,L"{mreal tam=gr->AmbBr;\tgr->Ambient(%g);", ff); - wcscat(op1,buf); - } - else if(!wcscmp(a,L"marksize")) - { - val[17]= gr->MarkSize; opt[9]=true; gr->MarkSize = ff/50; - if(out) mglprintf(buf,256,L"{mreal tad=gr->MarkSize;\tgr->MarkSize=%g/50;", ff); - wcscat(op1,buf); - } - else if(!wcscmp(a,L"legend")) // TODO: parsing of string tail (other options???) - { - b = wcschr(s+1,'\''); if(b) *b=0; - opt[10]=true; wcscpy(leg,s+1); - } - } - } -} -//----------------------------------------------------------------------------- -void mglParse::DeleteVar(mglVar *v) +void mglParser::DeleteVar(mglVar *v) { if(!v) return; if(DataList==v) DataList = v->next; delete v; } //----------------------------------------------------------------------------- -void mglParse::DeleteVar(const char *name) +void mglParser::DeleteVar(const char *name) { mglVar *v = FindVar(name); DeleteVar(v); } //----------------------------------------------------------------------------- -void mglParse::DeleteVar(const wchar_t *name) +void mglParser::DeleteVar(const wchar_t *name) { mglVar *v = FindVar(name); DeleteVar(v); } //----------------------------------------------------------------------------- -void mglParse::AddCommand(mglCommand *cmd, int mc) +void mglParser::AddCommand(mglCommand *cmd, int mc) { int i, mp; if(mc<1) @@ -1243,7 +974,7 @@ void mglParse::AddCommand(mglCommand *cmd, int mc) Cmd = buf; } //----------------------------------------------------------------------------- -mglCommand mglParse::Prg[]={ +mglCommand mglParser::Prg[]={ {L"break",L"Break for-cycle",L"break", 0, 0, 0, 5}, {L"call",L"Execute script in external file",L"call 'name' [args]", 0, 0, 0, 5}, {L"continue",L"Skip commands and iterate for-cycle again",L"continue", 0, 0, 0, 5}, @@ -1264,52 +995,54 @@ mglCommand mglParse::Prg[]={ {L"stop",L"Stop execution",L"stop", 0, 0, 0, 5}, {L"",0,0, 0, 0, 0, 0}}; //----------------------------------------------------------------------------- -HMPR mgl_create_parser() { return new mglParse; } +HMPR mgl_create_parser() { return new mglParser; } void mgl_delete_parser(HMPR p) { delete p; } void mgl_add_param(HMPR p, int id, const char *str) { p->AddParam(id,str); } void mgl_add_paramw(HMPR p, int id, const wchar_t *str) { p->AddParam(id,str); } HMDT mgl_add_var(HMPR p, const char *name) { mglVar *v=p->AddVar(name); return &(v->d); } HMDT mgl_find_var(HMPR p, const char *name) { mglVar *v=p->FindVar(name); return &(v->d); } -int mgl_parse(HMGL gr, HMPR p, const char *str, int pos) { return p->Parse(gr, str, pos); } -int mgl_parsew(HMGL gr, HMPR p, const wchar_t *str, int pos){ return p->Parse(gr, str, pos); } -void mgl_parse_text(HMGL gr, HMPR p, const char *str) { p->Execute(gr, str); } -void mgl_parsew_text(HMGL gr, HMPR p, const wchar_t *str){ p->Parse(gr, str); } +void mgl_del_var(HMPR p, const char *name) { p->DeleteVar(name); } +int mgl_parse(HMGL gr, HMPR p, const char *str, int pos) +{ return p->Parse(gr, str, pos); } +int mgl_parsew(HMGL gr, HMPR p, const wchar_t *str, int pos) +{ return p->Parse(gr, str, pos); } +void mgl_parse_text(HMGL gr, HMPR p, const char *str, void (*error)(int line, int kind, char *mes)) +{ p->Execute(gr, str, error); } +void mgl_parsew_text(HMGL gr, HMPR p, const wchar_t *str, void (*error)(int line, int kind, char *mes)) +{ p->Execute(gr, str, error); } +void mgl_parse_file(HMGL gr, HMPR p, FILE *fp, int print) +{ p->Execute(gr,fp,print); } void mgl_restore_once(HMPR p) { p->RestoreOnce(); } +void mgl_parser_stop(HMPR p) { p->Stop = true; } void mgl_parser_allow_setsize(HMPR p, int a) { p->AllowSetSize = a; } -void mgl_scan_func(HMPR p, const wchar_t *line) { p->ScanFunc(line); } //----------------------------------------------------------------------------- -uintptr_t mgl_create_parser_() { return uintptr_t(new mglParse); } +#define _PR_ ((mglParser *)(*p)) +uintptr_t mgl_create_parser_() { return uintptr_t(new mglParser); } void mgl_delete_parser_(uintptr_t* p) { delete _PR_; } void mgl_add_param_(uintptr_t* p, int *id, const char *str, int l) -{ - char *s=new char[l+1]; memcpy(s,str,l); s[l]=0; - _PR_->AddParam(*id, s); delete []s; -} +{ char *s=new char[l+1]; memcpy(s,str,l); s[l]=0; + _PR_->AddParam(*id, s); delete []s; } /*===!!! NOTE !!! You must not delete obtained data arrays !!!===============*/ uintptr_t mgl_add_var_(uintptr_t* p, const char *name, int l) -{ - char *s=new char[l+1]; memcpy(s,name,l); s[l]=0; +{ char *s=new char[l+1]; memcpy(s,name,l); s[l]=0; mglVar *v=_PR_->AddVar(s); delete []s; - return uintptr_t(&(v->d)); -} + return uintptr_t(&(v->d)); } /*===!!! NOTE !!! You must not delete obtained data arrays !!!===============*/ uintptr_t mgl_find_var_(uintptr_t* p, const char *name, int l) -{ - char *s=new char[l+1]; memcpy(s,name,l); s[l]=0; +{ char *s=new char[l+1]; memcpy(s,name,l); s[l]=0; mglVar *v=_PR_->FindVar(s); delete []s; - return uintptr_t(&(v->d)); -} + return uintptr_t(&(v->d)); } +void mgl_del_var_(uintptr_t* p, const char *name, int l) +{ char *s=new char[l+1]; memcpy(s,name,l); s[l]=0; + _PR_->DeleteVar(s); delete []s; } int mgl_parse_(uintptr_t* gr, uintptr_t* p, const char *str, int *pos, int l) -{ - char *s=new char[l+1]; memcpy(s,str,l); s[l]=0; - int r = _PR_->Parse(_GR_, s, *pos); delete []s; return r; -} -void mgl_parse_text_(uintptr_t* gr, uintptr_t* p, const char *str, int l) -{ - char *s=new char[l+1]; memcpy(s,str,l); s[l]=0; - _PR_->Execute(_GR_, s); delete []s; -} +{ char *s=new char[l+1]; memcpy(s,str,l); s[l]=0; + int r = _PR_->Parse(_GR_, s, *pos); delete []s; return r; } + void mgl_parse_text_(uintptr_t* gr, uintptr_t* p, const char *str, int l) +{ char *s=new char[l+1]; memcpy(s,str,l); s[l]=0; + _PR_->Execute(_GR_, s); delete []s; } void mgl_restore_once_(uintptr_t* p) { _PR_->RestoreOnce(); } void mgl_parser_allow_setsize_(uintptr_t* p, int *a) { _PR_->AllowSetSize = *a; } +void mgl_parser_stop_(uintptr_t* p) { _PR_->Stop = true; } //----------------------------------------------------------------------------- diff --git a/src/pde.cpp b/src/pde.cpp new file mode 100644 index 0000000..8c78368 --- /dev/null +++ b/src/pde.cpp @@ -0,0 +1,525 @@ +/*************************************************************************** + * mgl_pde.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "mgl/data.h" +#include +#define dual std::complex +#define GAMMA 0.1 +#ifndef NO_GSL +#include +#endif +//----------------------------------------------------------------------------- +struct mgl_pde_ham +{ + dual *a,*hxy,*hxv,*huv,*huy; + mglFormula *eqs; + long nx,ny; + mreal xx,yy,xs,ys,dx,dy,dq,dp,zz; + double dd; +}; +void *mgl_pde_hprep(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + mgl_pde_ham *f = (mgl_pde_ham *)t->v; + mglFormula *eqs = f->eqs; + register long i,j,i0, nx=2*f->nx, ny=2*f->ny; + mreal var[MGL_VS]; + dual *a = f->a,*h; + memset(var,0,('z'-'a')*sizeof(mreal)); + var['z'-'a'] = f->zz; + for(i0=t->id,h=f->hxy;i0n;i0+=mglNumThr) + { + i = i0%nx; j = i0/nx; var['u'-'a'] = abs(a[i0]); + var['x'-'a'] = f->xx+f->dx*i; var['p'-'a'] = 0; + var['y'-'a'] = f->yy+f->dy*j; var['q'-'a'] = 0; + h[i0] = dual(-eqs->CalcD(var,'i'), eqs->Calc(var))*f->dd; + } + if(f->ny>2) for(i0=t->id,h=f->huy;i0n;i0+=mglNumThr) // step 3/2 + { + i = i0%nx; j = i0/nx; var['u'-'a'] = abs(a[i0]); + var['x'-'a'] = f->xs; var['p'-'a'] = f->dp*(iyy+f->dy*j; var['q'-'a'] = 0; + h[i0] = dual(-eqs->CalcD(var,'i'), eqs->Calc(var))*f->dd; + } + for(i0=t->id,h=f->huv;i0n;i0+=mglNumThr) // step 2 + { + i = i0%nx; j = i0/nx; var['u'-'a'] = abs(a[i0]); + var['x'-'a'] = f->xs; var['p'-'a'] = f->dp*(iys; var['q'-'a'] = f->dq*(jCalcD(var,'i'), eqs->Calc(var))*f->dd; + } + if(f->ny>2) for(i0=t->id,h=f->hxv;i0n;i0+=mglNumThr) // step 3/2 + { + i = i0%nx; j = i0/nx; var['u'-'a'] = abs(a[i0]); + var['x'-'a'] = f->xx+f->dx*i; var['p'-'a'] = 0; + var['y'-'a'] = f->ys; var['q'-'a'] = f->dq*(jCalcD(var,'i'), eqs->Calc(var))*f->dd; + } + return 0; +} +// Solve equation du/dz = ham(p,q,x,y,z,|u|)[u] where p=d/dx, q=d/dy. At this moment simplified form of ham is supported: ham = f(p,q,z) + g(x,y,z,'u'), where variable 'u'=|u| (for allowing solve nonlinear problems). You may specify imaginary part like ham = p^2 + i*x*(x>0) but only if dependence on variable 'i' is linear (i.e. ham = hre+i*him). +HMDT mgl_pde_solve(HMGL gr, const char *ham, HCDT ini_re, HCDT ini_im, float dz, float k0, const char *opt) +{ + gr->SaveState(opt); + mglPoint Min=gr->Min, Max=gr->Max; + mglData *res=new mglData; + int nx=ini_re->GetNx(), ny=ini_re->GetNy(); + int nz = int((Max.z-Min.z)/dz)+1; + if(nx<2 || nz<2 || Max.x==Min.x) // Too small data + { gr->SetWarn(mglWarnLow,"PDE"); return res; } + if(ini_im->GetNx()*ini_im->GetNy() != nx*ny)// Wrong dimensions + { gr->SetWarn(mglWarnDim,"PDE"); return res; } + mgl_data_create(res, nz, nx, ny); +#ifndef NO_GSL + mglFormula eqs(ham); + dual *a = new dual[4*nx*ny], hh0; // Add "damping" area + dual *hxy = new dual[4*nx*ny], *hxv = new dual[4*nx*ny]; + dual *huy = new dual[4*nx*ny], *huv = new dual[4*nx*ny]; + dual *hx = new dual[2*nx], *hv = new dual[2*ny]; + dual *hy = new dual[2*ny], *hu = new dual[2*nx]; + mreal *dmp = new mreal[4*nx*ny]; + memset(a,0,4*nx*ny*sizeof(dual)); + register int i,j,k,i0; + for(j=0;jv(i,j), ini_im->v(i,j)); + res->a[nz*(i+nx*j)] = abs(a[i0]); + } + memset(dmp,0,4*nx*ny*sizeof(mreal)); + for(j=0;j<2*ny;j++) for(i=0;i<2*nx;i++) // step 1 + { + i0 = i+2*nx*j; + if(i3*nx/2) dmp[i0] += GAMMA*mgl_ipow((i-3*nx/2-1)/(nx/2.),2); + if(j3*ny/2) dmp[i0] += GAMMA*mgl_ipow((j-3*ny/2-1)/(ny/2.),2); + } + mreal dx = (Max.x-Min.x)/(nx-1), dy = ny>1?(Max.y-Min.y)/(ny-1):0; + mreal dp = M_PI/(Max.x-Min.x)/k0, dq = M_PI/(Max.y-Min.y)/k0; + mreal xs=(Min.x+Max.x)/2, ys=(Min.y+Max.y)/2; + double xx = Min.x - dx*nx/2, yy = Min.x - dy*ny/2; + double ff = ny>1?4*nx*ny:2*nx, dd = k0*dz; + + mgl_pde_ham tmp;tmp.eqs = &eqs; + tmp.nx = nx; tmp.ny = ny; tmp.a=a; tmp.hxy=hxy; + tmp.hxv=hxv; tmp.huy=huy; tmp.huv=huv; tmp.dd = dd; + tmp.xx = xx; tmp.xs = xs; tmp.dx = dx; tmp.dp = dp; + tmp.yy = yy; tmp.ys = ys; tmp.dy = dy; tmp.dq = dq; + + // prepare fft. NOTE: slow procedures due to unknown nx, ny. + gsl_fft_complex_wavetable *wtx = gsl_fft_complex_wavetable_alloc(2*nx); + gsl_fft_complex_workspace *wsx = gsl_fft_complex_workspace_alloc(2*nx); + gsl_fft_complex_wavetable *wty = gsl_fft_complex_wavetable_alloc(2*ny); + gsl_fft_complex_workspace *wsy = gsl_fft_complex_workspace_alloc(2*ny); + for(k=1;k1) for(i=0;i<2*nx;i++) for(j=0;j<2*ny;j++) + { + i0 = i+2*nx*j; + huy[i0] -= (hu[i]+hy[j]-hh0)/2.; huv[i0] -= (hu[i]+hv[j]-hh0)/2.; + hxy[i0] -= (hx[i]+hy[j]-hh0)/2.; hxv[i0] -= (hx[i]+hv[j]-hh0)/2.; + } + // solve equation + for(i=0;i<4*nx*ny;i++) a[i] *= exp(hxy[i])*exp(-double(dmp[i]*dz))/ff; + for(i=0;i<2*ny;i++) gsl_fft_complex_transform((double *)(a+i*2*nx), 1, 2*nx, wtx, wsx, forward); + for(i=0;i<4*nx*ny;i++) a[i] *= exp(huy[i]); + if(ny>1) for(i=0;i<2*nx;i++) gsl_fft_complex_transform((double *)(a+i), 2*nx, 2*ny, wty, wsy, forward); + for(i=0;i<4*nx*ny;i++) a[i] *= exp(huv[i]); + for(i=0;i<2*ny;i++) gsl_fft_complex_transform((double *)(a+2*i*nx), 1, 2*nx, wtx, wsx, backward); + for(i=0;i<4*nx*ny;i++) a[i] *= exp(hxv[i]); + if(ny>1) for(i=0;i<2*nx;i++) gsl_fft_complex_transform((double *)(a+i), 2*nx, 2*ny, wty, wsy, backward); + for(i=0;ia[k+nz*(i+nx*j)] = abs(a[i0]); + } + } + gsl_fft_complex_workspace_free(wsx); + gsl_fft_complex_wavetable_free(wtx); + gsl_fft_complex_workspace_free(wsy); + gsl_fft_complex_wavetable_free(wty); + delete []a; delete []dmp; + delete []hxy; delete []hxv; delete []huy; delete []huv; + delete []hx; delete []hy; delete []hu; delete []hv; +#endif + gr->LoadState(); + return res; +} +//----------------------------------------------------------------------------- +// Solve GO ray equation like dr/dt = d ham/dp, dp/dt = -d ham/dr where ham = ham(x,y,z,p,q,v,t) and px=p, py=q, pz=v. The starting point (at t=0) is r0, p0. Result is array of {x,y,z,p,q,v,t} +HMDT mgl_ray_trace(const char *ham, float x0, float y0, float z0, float px, float py, float pz, float dt, float tmax) +{ + mglData *res=new mglData; + if(tmaxa[0] = x0; x[1] = res->a[1] = y0; x[2] = res->a[2] = z0; + x[3] = res->a[3] = px; x[4] = res->a[4] = py; x[5] = res->a[5] = pz; + res->a[6] = 0; + // Runge Kutta scheme of 4th order + char v[7]="xyzpqv"; + mreal var[MGL_VS]; memset(var,0,MGL_VS*sizeof(mreal)); + register int i,k; + for(k=1;kH(cy,k1); + var['t'-'a']=k*dt; for(i=0;i<6;i++) var[v[i]-'a'] = x[i]; + k1[0] = eqs.CalcD(var,'p'); k1[3] = -eqs.CalcD(var,'x'); + k1[1] = eqs.CalcD(var,'q'); k1[4] = -eqs.CalcD(var,'y'); + k1[2] = eqs.CalcD(var,'v'); k1[5] = -eqs.CalcD(var,'z'); + // ty = cy/(k1*hh); md->H(ty,k2); + var['t'-'a']=k*dt+hh; for(i=0;i<6;i++) var[v[i]-'a'] = x[i]+k1[i]*hh; + 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'); + // ty = cy/(k2*hh); md->H(ty,k3); + var['t'-'a']=k*dt+hh; for(i=0;i<6;i++) var[v[i]-'a'] = x[i]+k2[i]*hh; + k3[0] = eqs.CalcD(var,'p'); k3[3] = -eqs.CalcD(var,'x'); + k3[1] = eqs.CalcD(var,'q'); k3[4] = -eqs.CalcD(var,'y'); + 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]; } + 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'); + // cy /= (k1+k2+k3*2.)*(h/6); + for(i=0;i<6;i++) + res->a[i+7*k] = x[i] += (k1[i]+k2[i]+2*k3[i])*dt/6; + res->a[6+7*k] = dt*k; + } +#endif + return res; +} +//----------------------------------------------------------------------------- +struct mgl_ap +{ + double x0,y0,x1,y1; // vectors {l, g1, g2} + double t1,ch,q1,pt,dt,d1; // theta_{1,2}, chi, q_{1,2}, p_t, dtau, dq_{1,2} + mgl_ap() { memset(this,0,sizeof(mgl_ap)); }; +}; +//----------------------------------------------------------------------------- +void mgl_init_ra(int n, const mreal *r, mgl_ap *ra) // prepare some intermediate data for mglPDE2d +{ + register double tt; + tt = hypot(r[7]-r[0], r[8]-r[1]); + ra[0].x1 = (r[8]-r[1])/tt; + ra[0].y1 = (r[0]-r[7])/tt; + register long i; + for(i=1;iv; + mgl_ap *ra = f->ra; + mglFormula *h = f->h; + const mreal *r = f->r; + mreal var[MGL_VS], pt0=f->pt0, tt, x1, hh; + memset(var,0,MGL_VS*sizeof(mreal)); + register long i, nx=t->n; + for(i=t->id;idr; + var['x'-'a'] = r[0] + ra->x1*x1; // new coordiantes + var['y'-'a'] = r[1] + ra->y1*x1; + hh = 1 - ra->t1*x1; hh = sqrt(sqrt(0.041+hh*hh*hh*hh)); + tt = (ra->pt + ra->d1*x1)/hh - ra->pt; + var['p'-'a'] = r[3] + ra->x0*tt; // new momentums + var['q'-'a'] = r[4] + ra->y0*tt; var['u'-'a'] = abs(f->a[i]); + f->rx[i] = (h->CalcD(var,'p')*ra->x0 + h->CalcD(var,'q')*ra->y0)/ra->ch; + f->hx[i] = dual(h->Calc(var), -h->CalcD(var,'i')); + // u-y terms + x1 = f->dk/2*(ix1*x1; // new momentums + var['q'-'a'] = r[4] + ra->y1*x1; var['u'-'a'] = 0; + f->ru[i] = (h->CalcD(var,'p')*ra->x0 + h->CalcD(var,'q')*ra->y0)/ra->ch; + f->hu[i] = dual(h->Calc(var), -h->CalcD(var,'i')); + + f->rx[i] = f->rx[i]>0.3*pt0 ? f->rx[i] : 0.3*pt0; + f->hx[i] = (f->hx[i]-f->h0/2.)/f->rx[i]; + if(imag(f->hx[i])>0) f->hx[i] = f->hx[i].real(); + f->ru[i] = f->ru[i]>0.3*pt0 ? f->ru[i] : 0.3*pt0; + f->hu[i] = (f->hu[i]-f->h0/2.)/f->ru[i]; + if(imag(f->hu[i])>0) f->hu[i] = f->hu[i].real(); + // add boundary conditions for x-direction + f->hx[i] -= dual(0,f->dmp[i]); + } + return 0; +} +HMDT mgl_qo2d_solve(const char *ham, HCDT ini_re, HCDT ini_im, HCDT ray_dat, float r, float k0, HMDT xx, HMDT yy) +{ + mglData *res=new mglData; + const mglData *ray=dynamic_cast(ray_dat); // NOTE: Ray must be mglData! + if(!ray) return res; + int nx=ini_re->GetNx(), nt=ray->ny; + if(nx<2 || ini_im->GetNx()!=nx || nt<2) return res; + mgl_data_create(res,nx,nt,1); +#ifndef NO_GSL + dual *a=new dual[2*nx], *hu=new dual[2*nx], *hx=new dual[2*nx], h0; + double *ru=new double[2*nx], *rx=new double[2*nx], *dmp=new double[2*nx], + *pu=new double[2*nx], *px=new double[2*nx]; + mgl_ap *ra = new mgl_ap[nt]; mgl_init_ra(ray->ny, ray->a, ra); // ray + register int i; + mglFormula h(ham); + mreal var[MGL_VS], dr = r/(nx-1), dk = M_PI*(nx-1)/(k0*r*nx), tt, x1, hh, B1, pt0; + memset(var,0,MGL_VS*sizeof(mreal)); + + memset(dmp,0,2*nx*sizeof(double)); + for(i=0;iv(i),ini_im->v(i)); // ini + for(i=0;i<2*nx;i++) { rx[i] = ru[i] = 1; } + gsl_fft_complex_wavetable *wtx = gsl_fft_complex_wavetable_alloc(2*nx); + gsl_fft_complex_workspace *wsx = gsl_fft_complex_workspace_alloc(2*nx); + if(xx && yy) { xx->Create(nx,nt); yy->Create(nx,nt); } + + mgl_qo2d_ham tmp; + tmp.hx=hx; tmp.rx=rx; tmp.hu=hu; tmp.ru=ru; tmp.dmp=dmp; + tmp.dr=dr; tmp.dk=dk; tmp.h=&h; tmp.a=a; + // start calculation + for(int k=0;ka[i+k*nx]=abs(a[i+nx/2])*sqrt(ra[0].ch/ra[k].ch); + if(xx && yy) for(i=0;ia[i+k*nx] = ray->a[7*k] + ra[k].x1*x1; // new coordiantes + yy->a[i+k*nx] = ray->a[7*k+1] + ra[k].y1*x1; + } + memcpy(px,rx,2*nx*sizeof(double)); + memcpy(pu,ru,2*nx*sizeof(double)); + hh = ra[k].pt*(1/sqrt(sqrt(1.041))-1); // 0.041=0.45^4 -- minimal value of h + var['x'-'a'] = ray->a[7*k]; var['y'-'a'] = ray->a[7*k+1]; + var['p'-'a'] = ray->a[7*k+3] + ra[k].x0*hh; + var['q'-'a'] = ray->a[7*k+4] + ra[k].y0*hh; var['u'-'a'] = 0; + h0 = dual(h.Calc(var), -h.CalcD(var,'i')); + pt0 = (h.CalcD(var,'p')*ra[k].x0 + h.CalcD(var,'q')*ra[k].y0)/ra[k].ch; + + tmp.h0=h0; tmp.pt0=pt0; tmp.r=ray->a+7*k; tmp.ra=ra+k; + mglStartThread(mgl_qo2d_hprep,0,2*nx,0,0,0,0,&tmp); + + // Calculate B1 + hh = ra[k].pt*(1/sqrt(sqrt(1.041))-1); + var['x'-'a'] = ray->a[7*k]; // new coordiantes + var['y'-'a'] = ray->a[7*k+1]; + var['p'-'a'] = ray->a[7*k+3] + ra[k].x0*hh; // new momentums + var['q'-'a'] = ray->a[7*k+4] + ra[k].y0*hh; + tt = h.CalcD(var,'p')*ra[k].x1 + h.CalcD(var,'q')*ra[k].y1; + var['x'-'a'] = ray->a[7*k] + ra[k].x1*dr; // new coordiantes + var['y'-'a'] = ray->a[7*k+1] + ra[k].y1*dr; + hh = 1 - ra[k].t1*dr; hh = sqrt(sqrt(0.041+hh*hh*hh*hh)); + hh = (ra[k].ch*ra[k].pt + ra[k].d1*dr)/(hh*ra[k].ch) - ra[k].pt; + var['p'-'a'] = ray->a[7*k+3] + ra[k].x0*hh; // new momentums + var['q'-'a'] = ray->a[7*k+4] + ra[k].y0*hh; + B1 = h.CalcD(var,'p')*ra[k].x1 + h.CalcD(var,'q')*ra[k].y1; + B1 = (B1-tt)/dr; + // Step for field + dual dt = dual(0, -ra[k].dt*k0); + for(i=0;i<2*nx;i++) a[i] *= exp(hx[i]*dt); + gsl_fft_complex_transform((double *)a, 1, 2*nx, wtx, wsx, forward); + for(i=0;i<2*nx;i++) a[i] *= exp(hu[i]*dt)/(2.*nx); + gsl_fft_complex_transform((double *)a, 1, 2*nx, wtx, wsx, backward); + double a1=0, a2=0; + for(i=0;i<2*nx;i++) a1 += norm(a[i]); + hx[0] = hx[2*nx-1] = 0.; + for(i=1;i<2*nx-1;i++) hx[i] = (B1*ra[k].dt*(i-nx))*(a[i+1]-a[i-1]); + for(i=0;i<2*nx;i++) { a[i] += hx[i]; a2 += norm(a[i]); } + a1 = sqrt(a1/a2); + for(i=0;i<2*nx;i++) a[i] *= a1; + } + gsl_fft_complex_workspace_free(wsx); + gsl_fft_complex_wavetable_free(wtx); + delete []a; delete []hu; delete []hx; delete []ra; delete []dmp; + delete []rx; delete []ru; delete []px; delete []pu; +#endif + return res; +} +//----------------------------------------------------------------------------- +void *mgl_jacob2(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j,i0,ip,im,jp,jm, nx=t->p[0], ny=t->p[1]; + mreal *r=t->a; + const mreal *x=t->b, *y=t->c; + for(i0=t->id;i0n;i0+=mglNumThr) + { + i=i0%nx; j=i0/nx; + ip = i0 ? -1:0; jm = j>0 ? -nx:0; + r[i0] = (x[i0+ip]-x[i0+im])*(y[i0+jp]-y[i0+jm]) - + (y[i0+ip]-y[i0+im])*(x[i0+jp]-x[i0+jm]); + r[i0] *= mreal((nx-1)*(ny-1)) / ((ip-im)*(jp-jm)); + } + return 0; +} +HMDT mgl_jacobian_2d(HCDT x, HCDT y) +{ + int nx = x->GetNx(), ny=x->GetNy(); + mglData *r=new mglData; + if(nx!=y->GetNx() || ny!=y->GetNy() || nx<2 || ny<2) return r; + mgl_data_create(r,nx,ny,1); + const mglData *xx=dynamic_cast(x); + const mglData *yy=dynamic_cast(y); + if(xx && yy) + { + long p[2]={nx,ny}; + mglStartThread(mgl_jacob2,0,nx*ny,r->a,xx->a,yy->a,p); + } + else // slow variant + { + register long i,j,ip,im,jp,jm; + for(j=0;j0 ? i-1:i; ip = i0 ? j-1:j; jp = ja[i+nx*j] = (x->v(ip,j)-x->v(im,j))*(y->v(i,jp)-y->v(i,jm)) - + (y->v(ip,j)-y->v(im,j))*(x->v(i,jp)-x->v(i,jm)); + r->a[i+nx*j] *= mreal((nx-1)*(ny-1)) / ((ip-im)*(jp-jm)); + } + } + return r; +} +//----------------------------------------------------------------------------- +void *mgl_jacob3(void *par) +{ + mglThreadD *t=(mglThreadD *)par; + register long i,j,k,i0,ip,im,jp,jm,kp,km, nx=t->p[0], ny=t->p[1], nz=t->p[2]; + mreal *r=t->a; + const mreal *x=t->b, *y=t->c, *z=t->d; + for(i0=t->id;i0n;i0+=mglNumThr) + { + i=i0%nx; j=(i0/nx)%ny; k=i0/(nx*ny); + ip = i0 ? -1:0; jm = j>0 ? -nx:0; km = k>0 ? -nx*ny:0; + r[i0] = (x[i0+ip]-x[i0+im])*(y[i0+jp]-y[i0+jm])*(z[i0+kp]-z[i0+km]) - + (x[i0+ip]-x[i0+im])*(y[i0+kp]-y[i0+km])*(z[i0+jp]-z[i0+jm]) - + (x[i0+jp]-x[i0+jm])*(y[i0+ip]-y[i0+im])*(z[i0+kp]-z[i0+km]) + + (x[i0+jp]-x[i0+jm])*(y[i0+kp]-y[i0+km])*(z[i0+ip]-z[i0+im]) + + (x[i0+kp]-x[i0+km])*(y[i0+ip]-y[i0+im])*(z[i0+jp]-z[i0+jm]) - + (x[i0+kp]-x[i0+km])*(y[i0+jp]-y[i0+jm])*(z[i0+ip]-z[i0+im]); + r[i0] *= mreal((nx-1)*(ny-1)*(nz-1)) / ((ip-im)*(jp-jm)*(kp-km)); + } + return 0; +} +HMDT mgl_jacobian_3d(HCDT x, HCDT y, HCDT z) +{ + int nx = x->GetNx(), ny=x->GetNy(), nz=x->GetNz(), nn = nx*ny*nz; + mglData *r=new mglData; + if(nx<2 || ny<2 || nz<2) return r; + if(nn!=y->GetNx()*y->GetNy()*y->GetNz() || nn!=z->GetNx()*z->GetNy()*z->GetNz()) return r; + mgl_data_create(r,nx,ny,nz); + const mglData *xx=dynamic_cast(x); + const mglData *yy=dynamic_cast(y); + const mglData *zz=dynamic_cast(z); + if(xx && yy && zz) + { + long p[3]={nx,ny,nz}; + mglStartThread(mgl_jacob3,0,nx*ny*nz,r->a,xx->a,yy->a,p,0,zz->a); + } + else // slow variant + { + register long i,j,k,ip,im,jp,jm,kp,km,i0; + for(k=0;k0 ? i-1:i; ip = i0 ? j-1:j; jp = j0 ? k-1:k; kp = ka[i0] = (x->v(ip,j,k)-x->v(im,j,k))*(y->v(i,jp,k)-y->v(i,jm,k))*(z->v(i,j,kp)-z->v(i,j,km)) - + (x->v(ip,j,k)-x->v(im,j,k))*(y->v(i,j,kp)-y->v(i,j,km))*(z->v(i,jp,k)-z->v(i,jm,k)) - + (x->v(i,jp,k)-x->v(i,jm,k))*(y->v(ip,j,k)-y->v(im,j,k))*(z->v(i,j,kp)-z->v(i,j,km)) + + (x->v(i,jp,k)-x->v(i,jm,k))*(y->v(i,j,kp)-y->v(i,j,km))*(z->v(ip,j,k)-z->v(im,j,k)) + + (x->v(i,j,kp)-x->v(i,j,km))*(y->v(ip,j,k)-y->v(im,j,k))*(z->v(i,jp,k)-z->v(i,jm,k)) - + (x->v(i,j,kp)-x->v(i,j,km))*(y->v(i,jp,k)-y->v(i,jm,k))*(z->v(ip,j,k)-z->v(im,j,k)); + r->a[i0] *= mreal((nx-1)*(ny-1)*(nz-1)) / ((ip-im)*(jp-jm)*(kp-km)); + } + + } + return r; +} +//----------------------------------------------------------------------------- +uintptr_t mgl_pde_solve_(uintptr_t* gr, const char *ham, uintptr_t* ini_re, uintptr_t* ini_im, mreal *dz, mreal *k0, const char *opt, int l, int lo) +{ char *s=new char[l+1]; memcpy(s,ham,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + uintptr_t res = uintptr_t(mgl_pde_solve(_GR_, s, _DA_(ini_re), _DA_(ini_im), *dz, *k0, o)); + delete []o; delete []s; return res; } +uintptr_t mgl_ray_trace_(const char *ham, mreal *x0, mreal *y0, mreal *z0, mreal *px, mreal *py, mreal *pz, mreal *dt, mreal *tmax,int l) +{ char *s=new char[l+1]; memcpy(s,ham,l); s[l]=0; + uintptr_t res = uintptr_t(mgl_ray_trace(s, *x0,*y0,*z0, *px,*py,*pz, *dt,*tmax)); + delete []s; return res; } +uintptr_t mgl_qo2d_solve_(const char *ham, uintptr_t* ini_re, uintptr_t* ini_im, uintptr_t* ray, mreal *r, mreal *k0, uintptr_t* xx, uintptr_t* yy, int l) +{ char *s=new char[l+1]; memcpy(s,ham,l); s[l]=0; + uintptr_t res = uintptr_t(mgl_qo2d_solve(s, _DA_(ini_re), _DA_(ini_im), _DA_(ray), *r, *k0, _DM_(xx), _DM_(yy))); + delete []s; return res; } +uintptr_t mgl_jacobian_2d_(uintptr_t* x, uintptr_t* y) +{ return uintptr_t(mgl_jacobian_2d(_DA_(x), _DA_(y))); } +uintptr_t mgl_jacobian_3d_(uintptr_t* x, uintptr_t* y, uintptr_t* z) +{ return uintptr_t(mgl_jacobian_3d(_DA_(x), _DA_(y), _DA_(z))); } +//----------------------------------------------------------------------------- diff --git a/src/pixel.cpp b/src/pixel.cpp new file mode 100644 index 0000000..25d95c1 --- /dev/null +++ b/src/pixel.cpp @@ -0,0 +1,981 @@ +/*************************************************************************** + * pixel.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License 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 +#include +#include "mgl/canvas.h" +//----------------------------------------------------------------------------- +void mglCanvas::SetSize(int w,int h) +{ + if(w<=0 || h<=0) { SetWarn(mglWarnSize); return; } + Width = w; Height = h; Depth = long(sqrt(w*h)); + if(G) { delete []G; delete []C; delete []Z; delete []G4;delete []OI; } + G = new unsigned char[w*h*3]; + G4 = new unsigned char[w*h*4]; + C = new unsigned char[w*h*12]; + Z = new float[w*h*3]; // only 3 planes + OI= new int[w*h]; + InPlot(0,1,0,1,false); + Persp = 0; + Clf(); +} +//----------------------------------------------------------------------------- +void mglDrawReg::set(mglCanvas *gr, int nx, int ny, int m) +{ + int mx = m%nx, my = m/nx; + x1 = gr->GetWidth()*mx/nx; y1 = gr->GetHeight()-gr->GetHeight()*(my+1)/ny; + x2 = gr->GetWidth()*(mx+1)/nx; y2 = gr->GetHeight()-gr->GetHeight()*my/ny; +} +//----------------------------------------------------------------------------- +void mglCanvas::PutDrawReg(mglDrawReg *d, const mglCanvas *gr) +{ + if(!gr) return; + int dd = d->x2 - d->x1; + register long i,j; + for(j=d->y1;jy2;j++) + { + i = d->x1+Width*(Height-1-j); + memcpy(OI+i,gr->OI+i,dd*sizeof(int)); + memcpy(Z+3*i,gr->Z+3*i,3*dd*sizeof(float)); + memcpy(C+12*i,gr->C+12*i,12*dd); + } +} +//----------------------------------------------------------------------------- +void mglCanvas::PostScale(mglPoint &p) +{ + mglPoint q=p/(2*B.pf); + p.x = B.x + q.x*B.b[0] + q.y*B.b[1] + q.z*B.b[2]; + p.y = B.y+ q.x*B.b[3] + q.y*B.b[4] + q.z*B.b[5]; + p.z = B.z+ q.x*B.b[6] + q.y*B.b[7] + q.z*B.b[8]; + if(Persp) + { + register float d = (1-Persp*Depth/2)/(1-Persp*p.z); + p.x = Width/2 + d*(p.x-Width/2); + p.y = Height/2 + d*(p.y-Height/2); + } +} +//----------------------------------------------------------------------------- +bool mglCanvas::ScalePoint(mglPoint &p, mglPoint &n, bool use_nan) +{ + bool res = get(MGL_DISABLE_SCALE) || mglBase::ScalePoint(p,n,use_nan); + if(TernAxis&4) return res; + PostScale(p); + + mglPoint y=n/(2*B.pf); + n.x = y.x*B.b[0] + y.y*B.b[1] + y.z*B.b[2]; + n.y = y.x*B.b[3] + y.y*B.b[4] + y.z*B.b[5]; + n.z = y.x*B.b[6] + y.y*B.b[7] + y.z*B.b[8]; + if(Persp) + { + register float d = (1-Persp*Depth/2)/(1-Persp*p.z); + // NOTE: No d* since I use transformed p here. + register float dd = Persp*n.z/(1-Persp*p.z); + n.x = d*n.x + dd*(p.x-Width/2); + n.y = d*n.y + dd*(p.y-Height/2); + } + return res; +} +//----------------------------------------------------------------------------- +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; + 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 + { + if(nf==0) + { p.x = xx+w/2 + (q.x+(q.y+1)/2)*w/2; + n.x = (nn.x+nn.y/2)*w/2; + p.y = yy+h + q.y*h/2; n.y = nn.y*h/2; } + } + else if(TernAxis&2) // quaternary axis + { + if(nf==0) + { p.x = xx+w/2 + (q.x+(q.y+1)/2)*w/2; + n.x = (nn.x+nn.y/2)*w/2; + p.y = yy+h + q.y*h/2; + n.y = nn.y*h/2; } + else if(nf==1) + { p.x = xx+w/2 + (q.x+(1-q.z)/2)*w/2; + n.x = (nn.x-nn.z/2)*w/2; + p.y = yy+h - q.z*h/2; + n.y = -nn.z*h/2; } + else if(nf==2) + { p.x = xx+w/2 + (q.y-q.z)/2*w/2; + n.x = (nn.y-nn.z/2)*w/2; + p.y = yy+h + (q.y+q.z)*h/2; + n.y = (nn.y+nn.z)/2*h/2; } + else + { p.x = xx+w/2 + (q.x+1+(q.y+q.z)/2)*w/2; + n.x = (nn.x+(nn.y+nn.z)/2)*w/2; + p.y = yy+h + (q.y+(q.z+1)/3)*h/2; + n.y = (nn.y+nn.z/3)*h/2; } + } + else + { + if(nf==0) + { p.x = xx + q.x*w; n.x = nn.x*w/2; + p.y = yy + q.y*h; n.y = nn.y*h/2; + p.z = B1.z + q.z*d; n.z = nn.z*d/2; } + else if(nf==1) + { p.x = xx + q.x*w; n.x = nn.x*w/2; + p.y = yy+h + q.z*h; n.y = nn.z*h/2; + p.z = B1.z + q.y*d; n.z = nn.y*d/2; } + else if(nf==2) + { p.x = xx+w + q.z*w; n.x = nn.z*w/2; + p.y = yy + q.y*h; n.y = nn.y*h/2; + p.z = B1.z+ q.x*d; n.z = nn.x*d/2; } + else + { p.x = xx+w + q.x*B.b[0]/2 + q.y*B.b[1]/2 + q.z*B.b[2]/2; + p.y = yy+h + q.x*B.b[3]/2 + q.y*B.b[4]/2 + q.z*B.b[5]/2; + p.z = B.z + q.x*B.b[6]/2 + q.y*B.b[7]/2 + q.z*B.b[8]/2; + n.x = (nn.x*B.b[0] + nn.y*B.b[1] + nn.z*B.b[2])/2; + n.y = (nn.x*B.b[3] + nn.y*B.b[4] + nn.z*B.b[5])/2; + n.z = (nn.x*B.b[6] + nn.y*B.b[7] + nn.z*B.b[8])/2; } + } + return CopyProj(id,p,n); +} +//----------------------------------------------------------------------------- +void mglCanvas::LightScale() +{ + register float xx,yy,zz; + register long i; + for(i=0;i<10;i++) + { + if(!light[i].n) continue; + // NOTE: I neglect curved coordinates here!!! + xx = light[i].r.x/(2*B.pf*(FMax.x-FMin.x)); + yy = light[i].r.y/(2*B.pf*(FMax.y-FMin.y)); + zz = light[i].r.z/(2*B.pf*(FMax.z-FMin.z)); + + light[i].p.x = xx*B.b[0] + yy*B.b[1] + zz*B.b[2]; + light[i].p.y = xx*B.b[3] + yy*B.b[4] + zz*B.b[5]; + light[i].p.z = xx*B.b[6] + yy*B.b[7] + zz*B.b[8]; + light[i].p /= light[i].p.norm(); + } +} +//----------------------------------------------------------------------------- +// NOTE: Perspective, transformation formulas and lists are not support just now !!! Also it use LAST InPlot parameters!!! +mglPoint mglCanvas::CalcXYZ(int xs, int ys) +{ + float s3 = 2*B.pf, x, y, z; // TODO: Take into account z-value of z-buffer + ys = Height - ys; + float xx = xs-B.x, yy = ys-B.y; + float d1=B.b[0]*B.b[4]-B.b[1]*B.b[3], d2=B.b[1]*B.b[5]-B.b[2]*B.b[4], d3=B.b[0]*B.b[5]-B.b[2]*B.b[3]; + if(fabs(d1) > fabs(d2) && fabs(d1) > fabs(d3)) // x-y plane + { + z = 0; + x = s3*(B.b[4]*xx-B.b[1]*yy)/d1; + y = s3*(B.b[0]*yy-B.b[3]*xx)/d1; + } + else if(fabs(d2) > fabs(d3)) // y-z + { + x = 0; + y = s3*(B.b[5]*xx-B.b[2]*yy)/d2; + z = s3*(B.b[1]*yy-B.b[4]*xx)/d2; + } + else // x-z + { + y = 0; + x = s3*(B.b[5]*xx-B.b[2]*yy)/d3; + z = s3*(B.b[0]*yy-B.b[3]*xx)/d3; + } + LastMousePos = mglPoint(Min.x + (Max.x-Min.x)*(x+1)/2, + Min.y + (Max.y-Min.y)*(y+1)/2, + Min.z + (Max.z-Min.z)*(z+1)/2); + return LastMousePos; +} +//----------------------------------------------------------------------------- +void mglCanvas::CalcScr(mglPoint p, int *xs, int *ys) +{ + mglPoint n; + ScalePoint(p,n); + if(xs) *xs=int(p.x); + if(ys) *ys=int(p.y); +} +//----------------------------------------------------------------------------- +mglPoint mglCanvas::CalcScr(mglPoint p) +{ int x,y; CalcScr(p,&x,&y); return mglPoint(x,y); } +//----------------------------------------------------------------------------- +//mglCanvas *mgl_tmp_gr; +bool operator<(const mglPrim &a, const mglPrim &b) +{ + if( a.z < b.z-0.5 ) return true; + if( a.z > b.z+0.5 ) return false; + if( a.w < b.w ) return true; + if( a.w > b.w ) return false; + if( a.n3 < b.n3 ) return true; + if( a.n3 > b.n3 ) return false; + return a.type < b.type; +// if( type != a.type ) return type < a.type; +// if( a1->type==1 && (a1->xx(mgl_tmp_gr)!=a2->xx(mgl_tmp_gr)) ) +// return (a2->xx(mgl_tmp_gr)xx(mgl_tmp_gr)) ? 1 : -1; +// if( a1->type==1 ) return (a2->yy(mgl_tmp_gr)yy(mgl_tmp_gr)) ? 1 : -1; +// return 0; +} +//----------------------------------------------------------------------------- +bool operator>(const mglPrim &a, const mglPrim &b) +{ + if( a.z < b.z-0.5 ) return false; + if( a.z > b.z+0.5 ) return true; + if( a.w < b.w ) return false; + if( a.w > b.w ) return true; + if( a.n3 < b.n3 ) return false; + if( a.n3 > b.n3 ) return true; + return a.type > b.type; +} +//----------------------------------------------------------------------------- +void *mgl_canvas_thr(void *par) +{ mglThreadG *t=(mglThreadG *)par; (t->gr->*(t->f))(t->id, t->n); return NULL; } +void mglStartThread(void (mglCanvas::*func)(unsigned long i, unsigned long n), mglCanvas *gr, unsigned long n) +{ + if(!func || !gr) return; +#ifdef HAVE_PTHREAD + if(mglNumThr<1) mglSetNumThr(0); + if(mglNumThr>1) + { + pthread_t *tmp=new pthread_t[mglNumThr]; + mglThreadG *par=new mglThreadG[mglNumThr]; + register int i; + for(i=0;i*func)(0,n); } +} +//----------------------------------------------------------------------------- +void mglCanvas::pxl_primdr(unsigned long id, unsigned long n) +{ + int nx=1,ny=1,pdef=PDef; + register unsigned long i; + if(id0) + { + std::sort(Prm.begin(), Prm.end()); +// mglStartThread(&mglCanvas::pxl_primdr,this,Prm.size()); // TODO: check conflicts in pthreads + pxl_primdr(-1,Prm.size()); + } + unsigned long n=Width*Height; + BDef[3] = (Flag&3)!=2 ? 0:255; + if(Quality&2) mglStartThread(&mglCanvas::pxl_combine,this,n); + else mglStartThread(&mglCanvas::pxl_memcpy,this,n); + BDef[3] = 255; + mglStartThread(&mglCanvas::pxl_backgr,this,n); + set(MGL_FINISHED); +} +//----------------------------------------------------------------------------- +void mglCanvas::Clf(mglColor Back) +{ + Fog(0); PDef = 0xffff; pPos = 0; StartAutoGroup(NULL); + Pnt.clear(); Prm.clear(); Ptx.clear(); + Sub.clear(); Leg.clear(); Grp.clear(); + if(Back==0) Back = 'w'; + if((Flag&3)==2) Back = 'k'; + BDef[0]=Back.r*255; BDef[1]=Back.g*255;BDef[2]=Back.b*255; BDef[3]=0; + register long i,n=Width*Height; + memset(C,0,12*n); memset(OI,0,n*sizeof(int)); + for(i=0;i<3*n;i++) Z[i] = -1e20f; // TODO: Parallelization ?!? + clr(MGL_FINISHED); +} +//----------------------------------------------------------------------------- +void mglCanvas::Combine(const mglCanvas *gr) +{ + if(Width!=gr->Width || Height!=gr->Height) return; // wrong sizes + register long i,j,i0; + for(i=0;iZ[3*i0+2],gr->C+12*i0+8); + pnt_plot(i,j,gr->Z[3*i0+1],gr->C+12*i0+4); + } + pnt_plot(i,j,gr->Z[3*i0],gr->C+12*i0); + } +} +//----------------------------------------------------------------------------- +void mglCanvas::pnt_plot(long x,long y,float z,const unsigned char ci[4]) +{ + long i0=x+Width*(Height-1-y); + if(ci[3]==0) return; + unsigned char *cc = C+12*i0, c[4]; + memcpy(c,ci,4); + float *zz = Z+3*i0, zf = FogDist*(z/Depth-0.5-FogDz); + if(zf<0) + { + int d = int(255.f-255.f*exp(5.f*zf)); + unsigned char cb[4] = {BDef[0], BDef[1], BDef[2], d}; + if(d==255) return; + combine(c,cb); + } + if(Quality&2) + { + if(z>zz[1]) // shift point on slice down and paste new point + { + zz[2] = zz[1]; combine(cc+8,cc+4); + if(z>zz[0]) + { zz[1] = zz[0]; zz[0] = z; OI[i0]=ObjId; + memcpy(cc+4,cc,4); memcpy(cc,c,4); } + else { zz[1] = z; memcpy(cc+4,c,4); } + } + else + { + if(z>zz[2]) // shift point on slice down and paste new point + { zz[2] = z; combine(cc+8,c); } + else // point below the background + { combine(c,cc+8); memcpy(cc+8,c,4); } + } + } + else + { + if(z>zz[0]) // point upper the background + { zz[0]=z; memcpy(cc,c,4); OI[i0]=ObjId; } + } +} +//----------------------------------------------------------------------------- +unsigned char* mglCanvas::col2int(const mglPnt &p,unsigned char *r) +{ + if(!r) return r; + if(p.a<=0) { memset(r,0,4*sizeof(unsigned char)); return r; } + register float b0=p.r,b1=p.g,b2=p.b; + if(get(MGL_ENABLE_LIGHT) && !isnan(p.u)) + { + b0 *= AmbBr; b1 *= AmbBr; b2 *= AmbBr; + float d0,d1,d2,nn; + register long i; + for(i=0;i<10;i++) + { + if(!light[i].n) continue; + 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); + d0 = light[i].p.x - p.u*nn; + d1 = light[i].p.y - p.v*nn; + d2 = light[i].p.z - p.w*nn; + nn = 1 + d2/sqrt(d0*d0+d1*d1+d2*d2+1e-6); + + nn = exp(-light[i].a*nn)*light[i].b*2; + b0 += nn*light[i].c.r; + b1 += nn*light[i].c.g; + b2 += nn*light[i].c.b; + } + b0 = b0<1 ? b0 : 1; + b1 = b1<1 ? b1 : 1; + b2 = b2<1 ? b2 : 1; + } + r[0] = (unsigned char)(255*b0); r[1] = (unsigned char)(255*b1); + r[2] = (unsigned char)(255*b2); + // p.a should be <1 but I additionally check it here + r[3] = get(MGL_ENABLE_ALPHA) && p.a<1 ? (unsigned char)(256*p.a) : 255; + return r; +} +//----------------------------------------------------------------------------- +/// color mixing: color c1 is under color c2 !!! +void mglCanvas::combine(unsigned char *c1,unsigned char *c2) +{ + if(!c2[3]) return; + register unsigned int a1=c1[3], a2=c2[3],b1=255-a2; + if(a1==0 || a2==255) { memcpy(c1,c2,4); return; } + if((Flag&3)==0) + { + c1[0] = (c1[0]*b1 + c2[0]*a2)/256; + c1[1] = (c1[1]*b1 + c2[1]*a2)/256; + c1[2] = (c1[2]*b1 + c2[2]*a2)/256; + c1[3] = (unsigned char)(a2+a1*b1/255); + } + else if((Flag&3)==1) + { + c1[0] = (unsigned char)((255-a1*(255-c1[0])/256)*(255-a2*(255-c2[0])/256)/256); + c1[1] = (unsigned char)((255-a1*(255-c1[1])/256)*(255-a2*(255-c2[1])/256)/256); + c1[2] = (unsigned char)((255-a1*(255-c1[2])/256)*(255-a2*(255-c2[2])/256)/256); + c1[3] = 255; + } + else if((Flag&3)==2) + { + unsigned int b2,b3; + b1 = (c1[0]*a1 + c2[0]*a2)/256; c1[0] = b1<255 ? b1 : 255; + b2 = (c1[1]*a1 + c2[1]*a2)/256; c1[1] = b2<255 ? b2 : 255; + b3 = (c1[2]*a1 + c2[2]*a2)/256; c1[2] = b3<255 ? b3 : 255; + c1[3] = a1+a2>255? 255 : a1+a2; + } +} +//----------------------------------------------------------------------------- +unsigned char **mglCanvas::GetRGBLines(long &w, long &h, unsigned char *&f, bool alpha) +{ + long d = alpha ? 4:3; + unsigned char **p; + if(!get(MGL_FINISHED)) Finish(); + p = (unsigned char **)malloc(Height * sizeof(unsigned char *)); + for(long i=0;id->x1?x1:d->x1; x2=x2x2?x2:d->x2-1; + y1=y1>d->y1?y1:d->y1; y2=y2y2?y2:d->y2-1; + if(x1>x2 || y1>y2) return; + + dd = d1.x*d2.y-d1.y*d2.x; + dsx =-4*(d2.y*d3.x - d2.x*d3.y)*d1.y; + dsy = 4*(d2.y*d3.x - d2.x*d3.y)*d1.x; + + if((d1.x==0 && d1.y==0) || (d2.x==0 && d2.y==0) || !(Quality&2)) + { trig_draw(k1,k2,k4,true,d); trig_draw(k1,k3,k4,true,d); return; } + + mglPoint n1 = mglPoint(p2.x-p1.x,p2.y-p1.y,p2.z-p1.z)^mglPoint(p3.x-p1.x,p3.y-p1.y,p3.z-p1.z); + mglPoint n2 = mglPoint(p2.x-p4.x,p2.y-p4.y,p2.z-p4.z)^mglPoint(p3.x-p4.x,p3.y-p4.y,p3.z-p4.z); + mglPoint nr = (n1+n2)*0.5; + + register long i,j,g; + register float u,v,s,xx,yy,q; + float x0 = p1.x, y0 = p1.y; + for(i=x1;i<=x2;i++) for(j=y1;j<=y2;j++) + { + xx = (i-x0); yy = (j-y0); + s = dsx*xx + dsy*yy + (dd+d3.y*xx-d3.x*yy)*(dd+d3.y*xx-d3.x*yy); + if(s<0) continue; // no solution + s = sqrt(s); + q = d3.x*yy - d3.y*xx + dd + s; + u = q ? 2.f*(d2.y*xx - d2.x*yy)/q : -1.f; + q = d3.y*xx - d3.x*yy + dd + s; + v = q ? 2.f*(d1.x*yy - d1.y*xx)/q : -1.f; + g = u<0.f || u>1.f || v<0.f || v>1.f; + if(g) // first root bad + { + q = d3.x*yy - d3.y*xx + dd - s; + u = q ? 2.f*(d2.y*xx - d2.x*yy)/q : -1.f; + q = d3.y*xx - d3.x*yy + dd - s; + v = q ? 2.f*(d1.x*yy - d1.y*xx)/q : -1.f; + g = u<0.f || u>1.f || v<0.f || v>1.f; + if(g) continue; // second root bad + } + p = p1+d1*u+d2*v+d3*(u*v); + if(isnan(p.u)) + { p.u = nr.x; p.v = nr.y; p.w = nr.z; } + pnt_plot(i,j,p.z,col2int(p,r)); + } +} +//----------------------------------------------------------------------------- +/* Linear interpolation r(u,v) = r0 + (r1-r0)*u + (r2-r0)*v is used, where r is + one of {x,y,z,R,G,B,A}. Variables u,v are determined for each point (x,y). + Point plotted is u>0 and v>0 and u+v<1.*/ +void mglCanvas::trig_draw(long k1, long k2, long k3, bool anorm, mglDrawReg *d) +{ + if(!(Quality&3)) + { + fast_draw(k1,k2,d); fast_draw(k1,k3,d); + fast_draw(k2,k3,d); return; + } + clr(MGL_FINISHED); + unsigned char r[4]; + long y1,x1,y2,x2; + float dxu,dxv,dyu,dyv; + const mglPnt &p1=Pnt[k1], &p2=Pnt[k2], &p3=Pnt[k3]; + mglPnt d1=p2-p1, d2=p3-p1, p; + + dxu = d2.x*d1.y - d1.x*d2.y; + if(fabs(dxu)<1e-5) return; // points lies on the same line + dyv =-d1.x/dxu; dxv = d1.y/dxu; + dyu = d2.x/dxu; dxu =-d2.y/dxu; + + x1 = long(fmin(fmin(p1.x,p2.x),p3.x)); // bounding box + y1 = long(fmin(fmin(p1.y,p2.y),p3.y)); + x2 = long(fmax(fmax(p1.x,p2.x),p3.x)); + y2 = long(fmax(fmax(p1.y,p2.y),p3.y)); + x1=x1>d->x1?x1:d->x1; x2=x2x2?x2:d->x2-1; + y1=y1>d->y1?y1:d->y1; y2=y2y2?y2:d->y2-1; + if(x1>x2 || y1>y2) return; + // default normale + mglPoint nr = mglPoint(p2.x-p1.x,p2.y-p1.y,p2.z-p1.z)^mglPoint(p3.x-p1.x,p3.y-p1.y,p3.z-p1.z); + + register float u,v,xx,yy; + register long i,j,g; + float x0 = p1.x, y0 = p1.y; + for(i=x1;i<=x2;i++) for(j=y1;j<=y2;j++) + { + xx = (i-x0); yy = (j-y0); + u = dxu*xx+dyu*yy; v = dxv*xx+dyv*yy; + g = u<0 || v<0 || u+v>1; + if(g) continue; + if(Quality&2) // slow but accurate + { + p = p1+d1*u+d2*v; + if(isnan(p.u) && anorm) + { p.u = nr.x; p.v = nr.y; p.w = nr.z; } + pnt_plot(i,j,p.z,col2int(p,r)); + } + else pnt_plot(i,j,p1.z,col2int(p1,r)); + } +} +//----------------------------------------------------------------------------- +void mglCanvas::line_draw(long k1, long k2, mglDrawReg *dr) +{ + if(!(Quality&3)) { fast_draw(k1,k2,dr); return; } + clr(MGL_FINISHED); + unsigned char r[4]; + long y1,x1,y2,x2; + + float pw=PenWidth*sqrt(font_factor/400), dxu,dxv,dyu,dyv,dd; + const mglPnt &p1=Pnt[k1], &p2=Pnt[k2]; + mglPnt d=p2-p1, p; + bool hor = fabs(d.x)>fabs(d.y); + + x1 = long(fmin(p1.x,p2.x)); y1 = long(fmin(p1.y,p2.y)); // bounding box + x2 = long(fmax(p1.x,p2.x)); y2 = long(fmax(p1.y,p2.y)); + x1=x1>dr->x1?x1:dr->x1; x2=x2x2?x2:dr->x2-1; + y1=y1>dr->y1?y1:dr->y1; y2=y2y2?y2:dr->y2-1; + dd = sqrt(d.x*d.x + d.y*d.y); + if(x1>x2 || y1>y2 || dd<1e-5) return; + + dxv = d.y/dd; dyv =-d.x/dd; + dxu = d.x/dd; dyu = d.y/dd; + + bool aa=get(MGL_ENABLE_ALPHA); + register float u,v,xx,yy; + register long i,j; + set(MGL_ENABLE_ALPHA); + if(hor) for(i=x1;i<=x2;i++) + { + y1 = int(p1.y+d.y*(i-p1.x)/d.x - pw - 3.5); + y2 = int(p1.y+d.y*(i-p1.x)/d.x + pw + 3.5); + y1=y1>dr->y1?y1:dr->y1; y2=y2y2?y2:dr->y2-1; + if(y1>y2) continue; + for(j=y1;j<=y2;j++) + { + xx = (i-p1.x); yy = (j-p1.y); + u = dxu*xx+dyu*yy; v = dxv*xx+dyv*yy; v = v*v; + if(u<0) { v += u*u; u = 0; } + else if(u>dd) { v += (u-dd)*(u-dd); u = dd; } + if(v>pw*pw) continue; + if(!( PDef & ( 1<dr->x1?x1:dr->x1; x2=x2x2?x2:dr->x2-1; + if(x1>x2) continue; + + for(i=x1;i<=x2;i++) + { + xx = (i-p1.x); yy = (j-p1.y); + u = dxu*xx+dyu*yy; v = dxv*xx+dyv*yy; v = v*v; + if(u<0) { v += u*u; u = 0; } + else if(u>dd) { v += (u-dd)*(u-dd); u = dd; } + if(v>pw*pw) continue; + if(!(PDef & (1<fabs(d.y); + + x1 = long(fmin(p1.x,p2.x)); y1 = long(fmin(p1.y,p2.y)); // bounding box + x2 = long(fmax(p1.x,p2.x)); y2 = long(fmax(p1.y,p2.y)); + x1=x1>dr->x1?x1:dr->x1; x2=x2x2?x2:dr->x2-1; + y1=y1>dr->y1?y1:dr->y1; y2=y2y2?y2:dr->y2-1; + if(x1>x2 || y1>y2) return; + + register long i; + if(hor) for(i=x1;i<=x2;i++) + pnt_plot(i, p1.y+d.y*(i-p1.x)/d.x, p1.z+d.z*(i-p1.x)/d.x+pw, r); + else for(i=y1;i<=y2;i++) + pnt_plot(p1.x+d.x*(i-p1.y)/d.y, i, p1.z+d.z*(i-p1.y)/d.y+pw, r); +} +//----------------------------------------------------------------------------- +void mglCanvas::pnt_draw(long k, mglDrawReg *dr) +{ + bool aa=get(MGL_ENABLE_ALPHA); set(MGL_ENABLE_ALPHA); + register long i,j,s,x,y; + register float v,pw=PenWidth*sqrt(font_factor/400); + const mglPnt &p=Pnt[k]; + unsigned char cs[4], cc; col2int(p,cs); cc = cs[3]; + s = long(5.5+fabs(pw)); + for(j=-s;j<=s;j++) for(i=-s;i<=s;i++) + { + v = (i*i+j*j)/(9*pw*pw); + cs[3] = (unsigned char)(cc*exp(-6*v)); + if(cs[3]==0) continue; + x=p.x+i; y=p.y+j; + if(x>=dr->x1 && x<=dr->x2 && y>=dr->y1 && y<=dr->y2) + pnt_plot(p.x+i,p.y+j,p.z,cs); + } + set(aa,MGL_ENABLE_ALPHA); +} +//----------------------------------------------------------------------------- +void mglCanvas::mark_draw(long k, char type, float size, mglDrawReg *d) +{ + const mglPnt &q=Pnt[k]; + unsigned char cs[4]; col2int(q,cs); cs[3] = size>0 ? 255 : 255*q.t; + unsigned long pos = Pnt.size(), qos=pos; + mglPnt p=q; + float ss=fabs(size)*0.35*font_factor; + register long i,j; +#ifdef HAVE_PTHREAD + pthread_mutex_lock(&mutexPnt); +#endif + if(type=='.' || ss==0) pnt_draw(k,d); + else + { + float pw = PenWidth; PenWidth = 1; + int pd = PDef; PDef = 0xffff; + if(!strchr("xsSoO",type)) ss *= 1.1; + switch(type) + { + case 'P': + p.x = q.x-ss; p.y = q.y-ss; Pnt.push_back(p); + p.x = q.x+ss; p.y = q.y-ss; Pnt.push_back(p); line_draw(pos,pos+1,d); + p.x = q.x+ss; p.y = q.y+ss; Pnt.push_back(p); line_draw(pos+1,pos+2,d); + p.x = q.x-ss; p.y = q.y+ss; Pnt.push_back(p); line_draw(pos+2,pos+3,d); + line_draw(pos+3,pos,d); qos+=4; + case '+': + p.x = q.x-ss; p.y = q.y; Pnt.push_back(p); + p.x = q.x+ss; p.y = q.y; Pnt.push_back(p); line_draw(qos,qos+1,d); + p.x = q.x; p.y = q.y-ss; Pnt.push_back(p); + p.x = q.x; p.y = q.y+ss; Pnt.push_back(p); line_draw(qos+2,qos+3,d); + break; + case 'X': + p.x = q.x-ss; p.y = q.y-ss; Pnt.push_back(p); + p.x = q.x+ss; p.y = q.y-ss; Pnt.push_back(p); line_draw(pos,pos+1,d); + p.x = q.x+ss; p.y = q.y+ss; Pnt.push_back(p); line_draw(pos+1,pos+2,d); + p.x = q.x-ss; p.y = q.y+ss; Pnt.push_back(p); line_draw(pos+2,pos+3,d); + line_draw(pos+3,pos,d); qos+=4; + case 'x': + p.x = q.x-ss; p.y = q.y-ss; Pnt.push_back(p); + p.x = q.x+ss; p.y = q.y+ss; Pnt.push_back(p); line_draw(qos,qos+1,d); + p.x = q.x+ss; p.y = q.y-ss; Pnt.push_back(p); + p.x = q.x-ss; p.y = q.y+ss; Pnt.push_back(p); line_draw(qos+2,qos+3,d); + break; + case 'S': + p.x = q.x-ss; p.y = q.y-ss; Pnt.push_back(p); + p.x = q.x-ss; p.y = q.y+ss; Pnt.push_back(p); + p.x= q.x+ss; p.y= q.y+ss; Pnt.push_back(p); + p.x = q.x+ss; p.y = q.y-ss; Pnt.push_back(p); + quad_draw(pos,pos+1,pos+3,pos+2,d); qos+=4; + case 's': + p.x = q.x-ss; p.y = q.y-ss; Pnt.push_back(p); + p.x = q.x+ss; p.y = q.y-ss; Pnt.push_back(p); line_draw(qos,qos+1,d); + p.x = q.x+ss; p.y = q.y+ss; Pnt.push_back(p); line_draw(qos+1,qos+2,d); + p.x = q.x-ss; p.y = q.y+ss; Pnt.push_back(p); line_draw(qos+2,qos+3,d); + line_draw(qos+3,qos,d); break; + case 'D': + p.x = q.x; p.y = q.y-ss; Pnt.push_back(p); + p.x = q.x+ss; p.y = q.y; Pnt.push_back(p); + p.x= q.x; p.y= q.y+ss; Pnt.push_back(p); + p.x = q.x-ss; p.y = q.y; Pnt.push_back(p); + quad_draw(pos,pos+1,pos+3,pos+2,d); qos+=4; + case 'd': + p.x = q.x; p.y = q.y-ss; Pnt.push_back(p); + p.x = q.x+ss; p.y = q.y; Pnt.push_back(p); line_draw(qos,qos+1,d); + p.x = q.x; p.y = q.y+ss; Pnt.push_back(p); line_draw(qos+1,qos+2,d); + p.x = q.x-ss; p.y = q.y; Pnt.push_back(p); line_draw(qos+2,qos+3,d); + line_draw(qos+3,qos,d); break; + case 'Y': + p.x = q.x; p.y = q.y; Pnt.push_back(p); + p.x = q.x; p.y = q.y-ss; Pnt.push_back(p); line_draw(pos,pos+1,d); + p.x = q.x-0.8*ss; p.y = q.y+0.6*ss; Pnt.push_back(p); line_draw(pos,pos+2,d); + p.x = q.x+0.8*ss; p.y = q.y+0.6*ss; Pnt.push_back(p); line_draw(pos,pos+3,d); + break; + case '*': + p.x = q.x-ss; p.y = q.y; Pnt.push_back(p); + p.x = q.x+ss; p.y = q.y; Pnt.push_back(p); line_draw(pos,pos+1,d); + p.x = q.x-0.6*ss; p.y = q.y-0.8*ss; Pnt.push_back(p); + p.x = q.x+0.6*ss; p.y = q.y+0.8*ss; Pnt.push_back(p); line_draw(pos+2,pos+3,d); + p.x = q.x-0.6*ss; p.y = q.y+0.8*ss; Pnt.push_back(p); + p.x = q.x+0.6*ss; p.y = q.y-0.8*ss; Pnt.push_back(p); line_draw(pos+4,pos+5,d); + break; + case 'T': + p.x = q.x-ss; p.y = q.y-ss/2; Pnt.push_back(p); + p.x = q.x+ss; p.y = q.y-ss/2; Pnt.push_back(p); + p.x= q.x; p.y= q.y+ss; Pnt.push_back(p); + trig_draw(pos,pos+1,pos+2,false,d); qos+=3; + case '^': + p.x = q.x-ss; p.y = q.y-ss/2; Pnt.push_back(p); + p.x = q.x+ss; p.y = q.y-ss/2; Pnt.push_back(p); line_draw(qos,qos+1,d); + p.x= q.x; p.y= q.y+ss; Pnt.push_back(p); line_draw(qos+1,qos+2,d); + line_draw(qos+2,qos,d); break; + case 'V': + p.x = q.x-ss; p.y = q.y+ss/2; Pnt.push_back(p); + p.x = q.x+ss; p.y = q.y+ss/2; Pnt.push_back(p); + p.x= q.x; p.y= q.y-ss; Pnt.push_back(p); + trig_draw(pos,pos+1,pos+2,false,d); qos+=3; + case 'v': + p.x = q.x-ss; p.y = q.y+ss/2; Pnt.push_back(p); + p.x = q.x+ss; p.y = q.y+ss/2; Pnt.push_back(p); line_draw(qos,qos+1,d); + p.x= q.x; p.y= q.y-ss; Pnt.push_back(p); line_draw(qos+1,qos+2,d); + line_draw(qos+2,qos,d); break; + case 'L': + p.x = q.x+ss/2; p.y = q.y+ss; Pnt.push_back(p); + p.x = q.x+ss/2; p.y = q.y-ss; Pnt.push_back(p); + p.x= q.x-ss; p.y= q.y; Pnt.push_back(p); + trig_draw(pos,pos+1,pos+2,false,d); qos+=3; + case '<': + p.x = q.x+ss/2; p.y = q.y+ss; Pnt.push_back(p); + p.x = q.x+ss/2; p.y = q.y-ss; Pnt.push_back(p); line_draw(qos,qos+1,d); + p.x= q.x-ss; p.y= q.y; Pnt.push_back(p); line_draw(qos+1,qos+2,d); + line_draw(qos+2,qos,d); break; + case 'R': + p.x = q.x-ss/2; p.y = q.y+ss; Pnt.push_back(p); + p.x = q.x-ss/2; p.y = q.y-ss; Pnt.push_back(p); + p.x= q.x+ss; p.y= q.y; Pnt.push_back(p); + trig_draw(pos,pos+1,pos+2,false,d); qos+=3; + case '>': + p.x = q.x-ss/2; p.y = q.y+ss; Pnt.push_back(p); + p.x = q.x-ss/2; p.y = q.y-ss; Pnt.push_back(p); line_draw(qos,qos+1,d); + p.x= q.x+ss; p.y= q.y; Pnt.push_back(p); line_draw(qos+1,qos+2,d); + line_draw(qos+2,qos,d); break; + case 'O': + for(j=long(-ss);j<=long(ss);j++) for(i=long(-ss);i<=long(ss);i++) + { + register long x=long(q.x)+i, y=long(q.y)+j; + if(i*i+j*j>=ss*ss || xx1 || x>d->x2 || yy1 || y>d->y2) continue; + pnt_plot(x,y,q.z+1,cs); + } + case 'o': + for(i=0;i<=20;i++) + { + p.x = q.x+ss*cos(i*M_PI/10); p.y = q.y+ss*sin(i*M_PI/10); Pnt.push_back(p); + if(i>0) line_draw(pos+i-1,pos+i,d); + } + break; + case 'C': + pnt_draw(k,d); + for(i=0;i<=20;i++) + { + p.x = q.x+ss*cos(i*M_PI/10); p.y = q.y+ss*sin(i*M_PI/10); Pnt.push_back(p); + if(i>0) line_draw(pos+i-1,pos+i,d); + } + break; + } + PDef = pd; PenWidth = pw; + Pnt.erase(Pnt.begin()+pos,Pnt.end()); + } +#ifdef HAVE_PTHREAD + pthread_mutex_unlock(&mutexPnt); +#endif +} +//----------------------------------------------------------------------------- +void mglCanvas::glyph_draw(const mglPrim *P, mglDrawReg *d) +{ + if(P->n1<0) return; // Should be never here + mglPnt p=Pnt[P->n1]; + float f = p.w; +#ifdef HAVE_PTHREAD + pthread_mutex_lock(&mutexPnt); +#endif + Push(); B.clear(); + B.b[0] = B.b[4] = B.b[8] = P->s*P->p; + RotateN(P->w,0,0,1); B.pf = P->p; + B.x=p.x; B.y=p.y; B.z=p.z; + + int ss=P->n3&3; + if(P->n3&8) + { + if(!(P->n3&4)) glyph_line(p,f,true, d); + glyph_line(p,f,false, d); + } + else + { + if(!(P->n3&4)) glyph_fill(p,f,fnt->GetNt(ss,P->n4),fnt->GetTr(ss,P->n4), d); + glyph_wire(p,f,fnt->GetNl(ss,P->n4),fnt->GetLn(ss,P->n4), d); + } + Pop(); +#ifdef HAVE_PTHREAD + pthread_mutex_unlock(&mutexPnt); +#endif +} +//----------------------------------------------------------------------------- +void mglCanvas::glyph_fill(const mglPnt &pp, float f, int nt, const short *trig, mglDrawReg *d) +{ + if(!trig || nt<=0) return; + long ik,ii,pos=Pnt.size(); + mglPnt p=pp; p.u=NAN; + float pw = Width>2 ? fabs(PenWidth) : 1e-5*Width; + + mglPoint p1,p2,p3; + for(ik=0;ik2 ? fabs(PenWidth) : 1e-5*Width; + unsigned pdef=PDef; PDef = 0xffff; + float opw=PenWidth; PenWidth=1; + mglPoint p1,p2,p3,p4; + long pos=Pnt.size(); + + float dy = 0.004; + p1 = mglPoint(pp.u,pp.v-dy,0); PostScale(p1); + p2 = mglPoint(pp.u,pp.v+dy,0); PostScale(p2); + p3 = mglPoint(fabs(f)+pp.u,pp.v+dy,0); PostScale(p3); + p4 = mglPoint(fabs(f)+pp.u,pp.v-dy,0); PostScale(p4); + + p.x = p1.x; p.y = p1.y; p.z = p1.z+(solid?pw:0); Pnt.push_back(p); + p.x = p2.x; p.y = p2.y; p.z = p2.z+(solid?pw:0); Pnt.push_back(p); + p.x = p3.x; p.y = p3.y; p.z = p3.z+(solid?pw:0); Pnt.push_back(p); + p.x = p4.x; p.y = p4.y; p.z = p4.z+(solid?pw:0); Pnt.push_back(p); + + if(solid) quad_draw(pos,pos+1,pos+3,pos+2,d); + else + { + line_draw(pos,pos+1,d); line_draw(pos+2,pos+1,d); + line_draw(pos,pos+3,d); line_draw(pos+2,pos+3,d); + } + PDef = pdef; PenWidth=opw; + Pnt.erase(Pnt.begin()+pos,Pnt.end()); +} +//----------------------------------------------------------------------------- diff --git a/src/plot.cpp b/src/plot.cpp new file mode 100644 index 0000000..1dc0019 --- /dev/null +++ b/src/plot.cpp @@ -0,0 +1,1523 @@ +/*************************************************************************** + * plot.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * 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 +//----------------------------------------------------------------------------- +// +// Plot by formulas series +// +//----------------------------------------------------------------------------- +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); + + float *x = (float *)malloc(n*sizeof(float)); + float *y = (float *)malloc(n*sizeof(float)); + mglFormula *eq = new mglFormula(eqY); + register int i; + float d = (gr->Max.x - gr->Min.x)/(n-1.), xs, ys, yr, ym=fabs(gr->Max.y - gr->Min.y)/1000; + for(i=0;iMin.x + i*d; y[i]=eq->Calc(x[i]); } + + for(i=0;iCalc(xs); + if(fabs(yr-ys)>ym) // bad approximation here + { + x = (float *)realloc(x,(n+1)*sizeof(float)); + y = (float *)realloc(y,(n+1)*sizeof(float)); + memmove(x+i+2,x+i+1,(n-i-1)*sizeof(float)); + memmove(y+i+2,y+i+1,(n-i-1)*sizeof(float)); + x[i+1] = xs; y[i+1] = yr; n++; + } + else i++; + } + + delete eq; + mglData yy,xx; + xx.Set(x,n); free(x); + yy.Set(y,n); free(y); + mgl_plot_xy(gr,&xx,&yy,pen,0); +} +//----------------------------------------------------------------------------- +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); + + float *x = (float *)malloc(n*sizeof(float)); + float *y = (float *)malloc(n*sizeof(float)); + float *z = (float *)malloc(n*sizeof(float)); + float *t = (float *)malloc(n*sizeof(float)); + mglFormula *ex, *ey, *ez; + ex = new mglFormula(eqX ? eqX : "0"); + ey = new mglFormula(eqY ? eqY : "0"); + ez = new mglFormula(eqZ ? eqZ : "0"); + register int i; + float ts, xs, ys, zs, xr, yr, zr, xm=fabs(gr->Max.x - gr->Min.x)/1000, ym=fabs(gr->Max.y - gr->Min.y)/1000, zm=fabs(gr->Max.z - gr->Min.z)/1000; + for(i=0;iCalc(0,0,t[i]); + y[i] = ey->Calc(0,0,t[i]); + z[i] = ez->Calc(0,0,t[i]); + } + + for(i=0;iCalc(0,0,ts); + ys=(y[i]+y[i+1])/2; yr=ey->Calc(0,0,ts); + zs=(z[i]+z[i+1])/2; zr=ez->Calc(0,0,ts); + if(fabs(xr-xs)>xm || fabs(yr-ys)>ym || fabs(zr-zs)>zm) // bad approximation here + { + z = (float *)realloc(z,(n+1)*sizeof(float)); + t = (float *)realloc(t,(n+1)*sizeof(float)); + x = (float *)realloc(x,(n+1)*sizeof(float)); + y = (float *)realloc(y,(n+1)*sizeof(float)); + memmove(x+i+2,x+i+1,(n-i-1)*sizeof(float)); + memmove(y+i+2,y+i+1,(n-i-1)*sizeof(float)); + memmove(z+i+2,z+i+1,(n-i-1)*sizeof(float)); + memmove(t+i+2,t+i+1,(n-i-1)*sizeof(float)); + t[i+1]=ts; x[i+1]=xr; y[i+1]=yr; z[i+1]=zr; n++; + } + else i++; + } + delete ex; delete ey; delete ez; + + mglData xx,yy,zz; + xx.Set(x,n); yy.Set(y,n); zz.Set(z,n); + free(x); free(y); free(z); free(t); + mgl_plot_xyz(gr,&xx,&yy,&zz,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_fplot_(uintptr_t *gr, const char *fy, const char *stl, const char *opt, int ly, int ls, int lo) +{ char *s=new char[ly+1]; memcpy(s,fy,ly); s[ly]=0; + char *p=new char[ls+1]; memcpy(p,stl,ls); p[ls]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_fplot(_GR_, s, p, o); + delete []s; delete []p; delete []o; } +//----------------------------------------------------------------------------- +void mgl_fplot_xyz_(uintptr_t *gr, const char *fx, const char *fy, const char *fz, const char *stl, const char *opt, int lx, int ly, int lz, int ls, int lo) +{ char *sx=new char[lx+1]; memcpy(sx,fx,lx); sx[lx]=0; + char *sy=new char[ly+1]; memcpy(sy,fy,ly); sy[ly]=0; + char *sz=new char[lz+1]; memcpy(sz,fz,lz); sz[lz]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + char *p=new char[ls+1]; memcpy(p,stl,ls); p[ls]=0; + mgl_fplot_xyz(_GR_, sx, sy, sz, p, o); + delete []sx; delete []sy; delete []sz; delete []p; delete []o; } +//----------------------------------------------------------------------------- +// +// Radar series +// +//----------------------------------------------------------------------------- +void mgl_radar(HMGL gr, HCDT a, const char *pen, const char *opt) +{ + long n = a->GetNx(), ny=a->GetNy(); + 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; + register long i,j; + for(j=0;jv(i,j))*cos(2*i*M_PI/n); + y.a[i+(n+1)*j] = (r+a->v(i,j))*sin(2*i*M_PI/n); + } + x.a[n+(n+1)*j] = r+a->v(0,j); y.a[n+(n+1)*j] = 0; + } + mgl_plot_xy(gr,&x,&y,pen,0); + if(pen && strchr(pen,'#')) // draw "grid" + { + m = 1.1*(a->Maximal()+r); + x.Create(2); y.Create(2); + for(i=0;i0) + { + x.Create(101); y.Create(101); + for(i=0;i<101;i++) + { x.a[i]=r*cos(2*i*M_PI/100); y.a[i]=r*sin(2*i*M_PI/100); } + mgl_plot_xy(gr,&x,&y,"k",0); + } + } +} +//----------------------------------------------------------------------------- +void mgl_radar_(uintptr_t *gr, uintptr_t *a, const char *pen, const char *opt, int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_radar(_GR_, _DA_(a),s,o); delete []s; delete []o; } +//----------------------------------------------------------------------------- +// +// Candle series +// +//----------------------------------------------------------------------------- +void mgl_candle_xyv(HMGL gr, HCDT x, HCDT v1, HCDT v2, HCDT y1, HCDT y2, const char *pen, const char *opt) +{ + long i,n=v1->GetNx(),pal; + bool d1=false,d2=false; + if(!y1) { y1 = new mglData(n); d1=true; ((mglData *)y1)->Fill(NAN,NAN); } + if(!y2) { y2 = new mglData(n); d2=true; ((mglData *)y2)->Fill(NAN,NAN); } + if(n<2) { gr->SetWarn(mglWarnLow,"Candle"); return; } + if(x->GetNx()GetNx()!=n || y1->GetNx()!=n || y2->GetNx()!=n) + { gr->SetWarn(mglWarnDim,"Candle"); return; } + static int cgid=1; gr->StartGroup("Candle",cgid++); + gr->SaveState(opt); gr->SetPenPal(pen,&pal); + gr->NextColor(pal); gr->Reserve(8*n); + + long n1,n2,n3,n4; + float m1,m2,xx,x1,x2,d; + for(i=0;iv(i); m2 = v2->v(i); xx = x->v(i); + n1 = gr->AddPnt(mglPoint(xx,y1->v(i),gr->Min.z)); + n2 = gr->AddPnt(mglPoint(xx,m1,gr->Min.z)); + gr->line_plot(n1,n2); + n3 = gr->AddPnt(mglPoint(xx,y2->v(i),gr->Min.z)); + n4 = gr->AddPnt(mglPoint(xx,m2,gr->Min.z)); + gr->line_plot(n3,n4); + + d = iv(i+1)-xx : xx-x->v(i-1); + x1 = xx + d/2*(1-gr->BarWidth); + x2 = x1 + gr->BarWidth*d; + n1 = gr->AddPnt(mglPoint(x1,m1,gr->Min.z)); + n2 = gr->AddPnt(mglPoint(x2,m1,gr->Min.z)); + n3 = gr->AddPnt(mglPoint(x1,m2,gr->Min.z)); + n4 = gr->AddPnt(mglPoint(x2,m2,gr->Min.z)); + gr->line_plot(n1,n2); gr->line_plot(n1,n3); + gr->line_plot(n4,n2); gr->line_plot(n4,n3); + if(m1>m2) gr->quad_plot(n1,n2,n3,n4); + } + if(d1) delete y1; if(d2) delete y2; +} +//----------------------------------------------------------------------------- +void mgl_candle_yv(HMGL gr, HCDT v1, HCDT v2, HCDT y1, HCDT y2, const char *pen, const char *opt) +{ + if(v1->GetNx()<2) { gr->SetWarn(mglWarnLow,"Candle"); return; } + gr->SaveState(opt); + mglData x(v1->GetNx()+1); + x.Fill(gr->Min.x,gr->Max.x); + mgl_candle_xyv(gr,&x,v1,v2,y1,y2,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_candle(HMGL gr, HCDT v1, HCDT y1, HCDT y2, const char *pen, const char *opt) +{ + mglData v2(v1); + v2.Roll('x',1); v2.a[0]=NAN; + mgl_candle_yv(gr,v1,&v2,y1,y2,pen,opt); +} +//----------------------------------------------------------------------------- +void mgl_candle_xyv_(uintptr_t *gr, uintptr_t *x, uintptr_t *v1, uintptr_t *v2, uintptr_t *y1, uintptr_t *y2, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_candle_xyv(_GR_,_DA_(x),_DA_(v1),_DA_(v2),_DA_(y1),_DA_(y2),s,o); delete []s; delete []o; } +//----------------------------------------------------------------------------- +void mgl_candle_yv_(uintptr_t *gr, uintptr_t *v1, uintptr_t *v2, uintptr_t *y1, uintptr_t *y2, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_candle_yv(_GR_,_DA_(v1),_DA_(v2),_DA_(y1),_DA_(y2),s,o); delete []s; delete []o; } +//----------------------------------------------------------------------------- +void mgl_candle_(uintptr_t *gr, uintptr_t *y, uintptr_t *y1, uintptr_t *y2, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_candle(_GR_,_DA_(y),_DA_(y1),_DA_(y2),s,o); + delete []s; delete []o; } +//----------------------------------------------------------------------------- +// +// Plot series +// +//----------------------------------------------------------------------------- +void mgl_plot_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *pen, const char *opt) +{ + long j,m,mx,my,mz,n=y->GetNx(),pal; + if(x->GetNx()!=n || z->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Plot"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Plot"); return; } + static int cgid=1; gr->StartGroup("Plot",cgid++); + gr->SaveState(opt); + m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); m = z->GetNy() > m ? z->GetNy() : m; + char mk=gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); + bool t1,t2,t3; + mglPoint p1,p2,p3,nn; + long n1=-1,n2=-1,n3=-1; + + for(j=0;jGetNy() ? j:0; my = jGetNy() ? j:0; + mz = jGetNy() ? j:0; gr->NextColor(pal); + t1 = t2 = false; + register long i; + for(i=0;i0) { n2=n1; p2=p1; t2=t1; } + p1 = mglPoint(x->v(i,mx), y->v(i,my), z->v(i,mz)); + n1 = gr->AddPnt(p1); t1 = n1>=0; // NOT thread-safe!!! + if(mk && t1) gr->mark_plot(n1,mk); + if(t1 && t2) + { + gr->line_plot(n1,n2); + if(i==0) gr->arrow_plot(n1,n2,gr->Arrow1); + if(i==n-1) gr->arrow_plot(n1,n2,gr->Arrow2); + } + + if(i>0 && ((t1 && !t2) || (t2 && !t1))) // do smoothing + { + float i1=0, i2=1, ii; + p3=p1; t3=t1; n3=n1; // copy current + do { + ii = (i1+i2)/2; + p1.x = x->v(i,mx)*ii+x->v(i-1,mx)*(1-ii); + p1.y = y->v(i,my)*ii+y->v(i-1,my)*(1-ii); + p1.z = z->v(i,mz)*ii+z->v(i-1,mz)*(1-ii); + n1 = gr->AddPnt(p1); t1 = n1>=0; // NOT thread-safe!!! + if((t1 && t3) || (t2 && !t1)) i2 = ii; + else i1 = ii; + } while(fabs(i2-i1)>1e-3); + if(t2) gr->line_plot(n1,n2); + else gr->line_plot(n3,n1); + } + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_plot_xy(HMGL gr, HCDT x, HCDT y, const char *pen, const char *opt) +{ + gr->SaveState(opt); + mglData z(y->GetNx()); + z.Fill(gr->Min.z,gr->Min.z); + mgl_plot_xyz(gr,x,y,&z,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_plot(HMGL gr, HCDT y, const char *pen, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Plot"); return; } + gr->SaveState(opt); + mglData x(y->GetNx()), z(y->GetNx()); + x.Fill(gr->Min.x,gr->Max.x); + z.Fill(gr->Min.z,gr->Min.z); + mgl_plot_xyz(gr,&x,y,&z,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_plot_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_plot_xyz(_GR_, _DA_(x),_DA_(y),_DA_(z),s,o); delete []s; delete []o; } +//----------------------------------------------------------------------------- +void mgl_plot_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_plot_xy(_GR_, _DA_(x),_DA_(y),s,o); delete []s; delete []o; } +//----------------------------------------------------------------------------- +void mgl_plot_(uintptr_t *gr, uintptr_t *y, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_plot(_GR_, _DA_(y),s,o); delete []s; delete []o; } +//----------------------------------------------------------------------------- +// +// Tens series +// +//----------------------------------------------------------------------------- +void mgl_tens_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT c, const char *pen, const char *opt) +{ + long j,m,mx,my,mz,mc,n=y->GetNx(), pal; + if(x->GetNx()!=n || z->GetNx()!=n || c->GetNx()!=n) + { gr->SetWarn(mglWarnDim,"Tens"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Tens"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Tens",cgid++); + m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); m = z->GetNy() > m ? z->GetNy() : m; + char mk=gr->SetPenPal(pen, &pal); gr->Reserve(2*n*m); + long ss=gr->AddTexture(pen); + bool t1,t2,t3; + mglPoint p1,p2,p3,nn; + long n1=-1,n2=-1,n3=-1; + + for(j=0;jGetNy() ? j:0; my = jGetNy() ? j:0; + mz = jGetNy() ? j:0; mc = jGetNy() ? j:0; + register long i; + t1 = t2 = false; + for(i=0;i0) { n2=n1; p2=p1; t2=t1; } + p1 = mglPoint(x->v(i,mx), y->v(i,my), z->v(i,mz), c->v(i,mc)); + n1 = gr->AddPnt(p1,gr->GetC(ss,p1.c)); t1 = n1>=0; // NOT thread-safe!!! + if(mk && t1) gr->mark_plot(n1,mk); + if(t1 && t2) + { + gr->line_plot(n1,n2); + if(i==0) gr->arrow_plot(n1,n2,gr->Arrow1); + if(i==n-1) gr->arrow_plot(n1,n2,gr->Arrow2); + } + + if(i>0 && ((t1 && !t2) || (t2 && !t1))) // do smoothing + { + float i1=0, i2=1, ii; + p3=p1; t3=t1; n3=n1; // copy current + do { + ii = (i1+i2)/2; + p1.x = x->v(i,mx)*ii+x->v(i-1,mx)*(1-ii); + p1.y = y->v(i,my)*ii+y->v(i-1,my)*(1-ii); + p1.z = z->v(i,mz)*ii+z->v(i-1,mz)*(1-ii); + p1.c = c->v(i,mc)*ii+c->v(i-1,mc)*(1-ii); + n1 = gr->AddPnt(p1,gr->GetC(ss,p1.c)); t1 = n1>=0; // NOT thread-safe!!! + if((t1 && t3) || (t2 && !t1)) i2 = ii; + else i1 = ii; + } while(fabs(i2-i1)>1e-3); + if(t2) gr->line_plot(n1,n2); + else gr->line_plot(n3,n1); + } + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_tens_xy(HMGL gr, HCDT x, HCDT y, HCDT c, const char *pen, const char *opt) +{ + gr->SaveState(opt); + mglData z(y->GetNx()); + z.Fill(gr->Min.z,gr->Min.z); + mgl_tens_xyz(gr,x,y,&z,c,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_tens(HMGL gr, HCDT y, HCDT c, const char *pen, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Tens"); return; } + gr->SaveState(opt); + mglData x(y->GetNx()), z(y->GetNx()); + x.Fill(gr->Min.x,gr->Max.x); + z.Fill(gr->Min.z,gr->Min.z); + mgl_tens_xyz(gr,&x,y,&z,c,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_tens_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *c, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tens_xyz(_GR_, _DA_(x),_DA_(y),_DA_(z),_DA_(c),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_tens_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *c, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tens_xy(_GR_, _DA_(x),_DA_(y),_DA_(c),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_tens_(uintptr_t *gr, uintptr_t *y, uintptr_t *c, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tens(_GR_, _DA_(y),_DA_(c),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Area series +// +//----------------------------------------------------------------------------- +void mgl_area_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *pen, const char *opt) +{ + long i,j,n=y->GetNx(),m,mx,my,mz,pal; + if(n<2) { gr->SetWarn(mglWarnLow,"Area"); return; } + if(x->GetNx()!=n || z->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Area"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Area3",cgid++); + m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); m = z->GetNy() > m ? z->GetNy() : m; + + float z0=gr->GetOrgZ('x'); + float c1,c2; + mglPoint p1,p2,p3,p4,nn; + long n1,n2,n3,n4; + gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); + long s=gr->AddTexture(pen,1); + for(j=0;jNextColor(pal); c2=c1=gr->CDef; + if(gr->GetNumPal(pal)==2*m) + { c1 = s+2*j/(2*m-1.); c2 = s+(2*j+0.999)/(2*m-1); } +// if(gr->GetNumPal(pal)==2*m) c2 = gr->NextColor(pal); + mx = jGetNy() ? j:0; my = jGetNy() ? j:0; mz = jGetNy() ? j:0; + + nn = mglPoint(-y->dvx(0,my),x->dvx(0,mx)); + n1 = gr->AddPnt(mglPoint(x->v(0,mx),y->v(0,my),z->v(0,mz)),c1,nn); + n2 = gr->AddPnt(mglPoint(x->v(0,mx),y->v(0,my),z0),c2,nn); + for(i=1;idvx(i,my),x->dvx(i,mx)); + n1 = gr->AddPnt(mglPoint(x->v(i,mx),y->v(i,my),z->v(i,mz)),c1,nn); + n2 = gr->AddPnt(mglPoint(x->v(i,mx),y->v(i,my),z0),c2,nn); + gr->quad_plot(n1,n2,n3,n4); + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_area_xy(HMGL gr, HCDT x, HCDT y, const char *pen, const char *opt) +{ + long i,j,n=y->GetNx(),m=y->GetNy(),mx,my,pal; + if(x->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Area"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Area"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Curve",cgid++); + float y0=gr->GetOrgY('x'), z0; + float c1,c2; + mglPoint nn=mglPoint(0,0,1); + long n1,n2,n3,n4; + + float *f=new float[n]; memset(f,0,n*sizeof(float)); + bool sum = (pen && strchr(pen,'a')); + + gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); + long s=gr->AddTexture(pen,1); + for(j=0;jNextColor(pal); c2=c1=gr->CDef; + if(gr->GetNumPal(pal)==2*m) + { c1 = s+2*j/(2*m-1.); c2 = s+(2*j+0.999)/(2*m-1); } + mx = jGetNy() ? j:0; my = jGetNy() ? j:0; + z0 = gr->Min.z + (m-1-j)*(gr->Max.z-gr->Min.z)/m; + + n1 = gr->AddPnt(mglPoint(x->v(0,mx),y->v(0,my),z0),c1,nn); + n2 = gr->AddPnt(mglPoint(x->v(0,mx),sum?0:y0,z0),c2,nn); + for(i=1;iAddPnt(mglPoint(x->v(i,mx),sum?f[i]:y->v(i,my),z0),c1,nn); + n2 = gr->AddPnt(mglPoint(x->v(i,mx),sum?f[i]:y0,z0),c2,nn); + gr->quad_plot(n1,n2,n3,n4); f[i]+=y->v(i,my); + } + } + gr->EndGroup(); delete []f; +} +//----------------------------------------------------------------------------- +void mgl_area(HMGL gr, HCDT y, const char *pen, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Area"); return; } + gr->SaveState(opt); + mglData x(y->GetNx()); + x.Fill(gr->Min.x,gr->Max.x); + mgl_area_xy(gr,&x,y,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_area_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_area_xyz(_GR_, _DA_(x),_DA_(y),_DA_(z),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_area_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_area_xy(_GR_, _DA_(x),_DA_(y),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_area_(uintptr_t *gr, uintptr_t *y, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_area(_GR_, _DA_(y),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Region series +// +//----------------------------------------------------------------------------- +void mgl_region_xy(HMGL gr, HCDT x, HCDT y1, HCDT y2, const char *pen, const char *opt) +{ + long i,j, n=y1->GetNx(), m=y1->GetNy(), mx, pal; + if(x->GetNx()!=n || y2->GetNx()!=n || y2->GetNy()!=m) + { gr->SetWarn(mglWarnDim,"Region"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Region"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Region",cgid++); + float c1,c2; + mglPoint nn=mglPoint(0,0,1); + long n1,n2,n3,n4; + float xx,f1,f2,f3,f4; + bool inside = (pen && strchr(pen,'i')); // NOTE: check if 'i' is free (used here for inside flag) + + gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); + long s=gr->AddTexture(pen,1); + for(j=0;jNextColor(pal); c2=c1=gr->CDef; + if(gr->GetNumPal(pal)==2*m) + { c1 = s+2*j/(2*m-1.); c2 = s+(2*j+0.999)/(2*m-1); } + mx = jGetNy() ? j:0; + float z0 = gr->Min.z + (m-1-j)*(gr->Max.z-gr->Min.z)/m; + + f1 = y1->v(0,j); f2 = y2->v(0,j); xx = x->v(0,mx); + n1 = gr->AddPnt(mglPoint(xx,f1,z0),c1,nn); + n2 = gr->AddPnt(mglPoint(xx,f2,z0),c2,nn); + for(i=1;iv(i,j); f2 = y2->v(i,j); xx = x->v(i,mx); + n1 = gr->AddPnt(mglPoint(xx,f1,z0),c1,nn); + n2 = gr->AddPnt(mglPoint(xx,f2,z0),c2,nn); + if(!inside || (f2>f1 && f4>f3)) + gr->quad_plot(n1,n2,n3,n4); + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_region(HMGL gr, HCDT y1, HCDT y2, const char *pen, const char *opt) +{ + gr->SaveState(opt); + mglData x(y1->GetNx()); + x.Fill(gr->Min.z, gr->Max.z); + mgl_region_xy(gr,&x,y1,y2,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_region_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y1, uintptr_t *y2, const char *pen, const char *opt, int l, int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_region_xy(_GR_, _DA_(x),_DA_(y1),_DA_(y2),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_region_(uintptr_t *gr, uintptr_t *y1, uintptr_t *y2, const char *pen, const char *opt, int l, int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_region(_GR_, _DA_(y1),_DA_(y2),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Step series +// +//----------------------------------------------------------------------------- +void mgl_step_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *pen, const char *opt) +{ + long i,j,m,mx,my,mz,n=y->GetNx(), pal; + if(x->GetNx()!=n || z->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Step"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Step"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Step3",cgid++); + m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); m = z->GetNy() > m ? z->GetNy() : m; + + char mk=gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); + long n1,n2; + for(j=0;jGetNy() ? j:0; my = jGetNy() ? j:0; + mz = jGetNy() ? j:0; gr->NextColor(pal); + n1 = gr->AddPnt(mglPoint(x->v(0,mx), y->v(0,my), z->v(0,mz))); + if(mk) gr->mark_plot(n1,mk); + for(i=1;iAddPnt(mglPoint(x->v(i,mx), y->v(i,my), z->v(i-1,mz))); + gr->line_plot(n1,n2); + if(i==1) gr->arrow_plot(n1,n2,gr->Arrow1); + + n2 = n1; // vertical + n1 = gr->AddPnt(mglPoint(x->v(i,mx), y->v(i,my), z->v(i,mz))); + if(mk) gr->mark_plot(n1,mk); + gr->line_plot(n1,n2); + if(i==n-1) gr->arrow_plot(n1,n2,gr->Arrow2); + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_step_xy(HMGL gr, HCDT x, HCDT y, const char *pen, const char *opt) +{ + long i,j,m,mx,my,n=y->GetNx(), pal; + if(x->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Step"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Step"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Step",cgid++); + m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); + + float zVal = gr->Min.z; + char mk=gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); + long n1,n2; + for(j=0;jGetNy() ? j:0; my = jGetNy() ? j:0; + gr->NextColor(pal); + n1 = gr->AddPnt(mglPoint(x->v(0,mx), y->v(0,my), zVal)); + if(mk) gr->mark_plot(n1,mk); + for(i=1;iAddPnt(mglPoint(x->v(i,mx), y->v(i-1,my), zVal)); + gr->line_plot(n1,n2); + if(i==1) gr->arrow_plot(n1,n2,gr->Arrow1); + + n2 = n1; // vertical + n1 = gr->AddPnt(mglPoint(x->v(i,mx), y->v(i,my), zVal)); + if(mk) gr->mark_plot(n1,mk); + gr->line_plot(n1,n2); + if(i==n-1) gr->arrow_plot(n1,n2,gr->Arrow2); + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_step(HMGL gr, HCDT y, const char *pen, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Step"); return; } + gr->SaveState(opt); + mglData x(y->GetNx()); + x.Fill(gr->Min.x,gr->Max.x); + mgl_step_xy(gr,&x,y,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_step_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_step_xyz(_GR_, _DA_(x),_DA_(y),_DA_(z),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_step_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_step_xy(_GR_, _DA_(x),_DA_(y),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_step_(uintptr_t *gr, uintptr_t *y, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_step(_GR_, _DA_(y),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Stem series +// +//----------------------------------------------------------------------------- +void mgl_stem_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *pen, const char *opt) +{ + long i,j,m,mx,my,mz,n=y->GetNx(), pal; + if(x->GetNx()!=n || z->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Stem"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Stem"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Stem3",cgid++); + m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); m = z->GetNy() > m ? z->GetNy() : m; + + float z0=gr->GetOrgZ('x'); + char mk=gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); + long n1,n2; + for(j=0;jGetNy() ? j:0; my = jGetNy() ? j:0; + mz = jGetNy() ? j:0; gr->NextColor(pal); + for(i=0;iAddPnt(mglPoint(x->v(i,mx), y->v(i,my), z->v(i-1,mz))); + if(mk) gr->mark_plot(n1,mk); + n2 = gr->AddPnt(mglPoint(x->v(i,mx), y->v(i,my), z0)); + gr->line_plot(n1,n2); + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_stem_xy(HMGL gr, HCDT x, HCDT y, const char *pen, const char *opt) +{ + long i,j,m,mx,my,n=y->GetNx(), pal; + if(x->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Stem"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Stem"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Stem",cgid++); + m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); + + float zVal = gr->Min.z; + float y0=gr->GetOrgY('x'); + char mk=gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); + long n1,n2; + for(j=0;jGetNy() ? j:0; my = jGetNy() ? j:0; + gr->NextColor(pal); + for(i=0;iAddPnt(mglPoint(x->v(i,mx), y->v(i,my), zVal)); + if(mk) gr->mark_plot(n1,mk); + n2 = gr->AddPnt(mglPoint(x->v(i,mx), y0, zVal)); + gr->line_plot(n1,n2); + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_stem(HMGL gr, HCDT y, const char *pen, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Stem"); return; } + gr->SaveState(opt); + mglData x(y->GetNx()); + x.Fill(gr->Min.x,gr->Max.x); + mgl_stem_xy(gr,&x,y,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_stem_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_stem_xyz(_GR_,_DA_(x),_DA_(y),_DA_(z),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_stem_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_stem_xy(_GR_,_DA_(x),_DA_(y),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_stem_(uintptr_t *gr, uintptr_t *y, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_stem(_GR_,_DA_(y),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Bars series +// +//----------------------------------------------------------------------------- +void mgl_bars_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *pen, const char *opt) +{ + long i,j,m,mx,my,mz,n=y->GetNx(), pal; + if(x->GetNx()!=n || z->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Bars"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Bars"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Bars3",cgid++); + m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); m = z->GetNy() > m ? z->GetNy() : m; + + bool wire = pen && strchr(pen,'#'); + bool above = pen && strchr(pen,'a'), fall = pen && strchr(pen,'f'); + if(above) fall = false; + float c1,c2,c; + mglPoint p1,p2,p3,p4,nn; + long n1,n2,n3,n4; + float *dd=new float[n], x1,x2,y1,y2,z0,zz,zp,d; + memset(dd,0,n*sizeof(float)); + + gr->SetPenPal(pen,&pal); + if(wire) gr->Reserve(4*n*m); else gr->Reserve(4*n*m); + for(j=0;jNextColor(pal); c2=c1=gr->CDef; + if(gr->GetNumPal(pal)==2*m) c2 = gr->NextColor(pal); + mx = jGetNy() ? j:0; my = jGetNy() ? j:0; mz = jGetNy() ? j:0; + zp = z0 = gr->GetOrgZ('x'); + for(i=0;iv(i+1,mx)-x->v(i,mx) : x->v(i,mx)-x->v(i-1,mx); + x1 = x->v(i,mx) + d/2*(1-gr->BarWidth); + d = iv(i+1,my)-y->v(i,my) : y->v(i,my)-y->v(i-1,my); + y1 = y->v(i,my) + d/2*(1-gr->BarWidth); + x2 = x1 + gr->BarWidth*d; y2 = y1 + gr->BarWidth*d; + zz = z->v(i,mz); + if(!above) + { + x2 = (x2-x1)/m; x1 += j*x2; x2 += x1; + y2 = (y2-y1)/m; y1 += j*y2; y2 += y1; + } + else + { z0 = gr->GetOrgZ('x') + dd[i]; dd[i] += zz; zz += z0; } + if(fall) { z0 = zp; zz += z0; zp = zz; } + + c = z->v(i,mz)<0 ? c1 : c2; + nn = mglPoint(-y->dvx(i,my),x->dvx(i,mx)); + p1 = mglPoint(x1,y1,zz); p2 = mglPoint(x1,y1,z0); + p3 = mglPoint(x2,y2,z0); p4 = mglPoint(x2,y2,zz); + if(wire) + { + n1 = gr->AddPnt(p1,c); n2 = gr->AddPnt(p2,c); + n3 = gr->AddPnt(p3,c); n4 = gr->AddPnt(p4,c); + gr->line_plot(n1,n2); gr->line_plot(n1,n4); + gr->line_plot(n3,n2); gr->line_plot(n3,n4); + } + else + { + n1 = gr->AddPnt(p1,c,nn); n2 = gr->AddPnt(p2,c,nn); + n3 = gr->AddPnt(p3,c,nn); n4 = gr->AddPnt(p4,c,nn); + gr->quad_plot(n1,n2,n4,n3); + } + } + } + gr->EndGroup(); delete []dd; +} +//----------------------------------------------------------------------------- +void mgl_bars_xy(HMGL gr, HCDT x, HCDT y, const char *pen, const char *opt) +{ + long i,j,m,mx,my,n=y->GetNx(),pal; + if(x->GetNx()SetWarn(mglWarnDim,"Bars"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Bars"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Bars",cgid++); + m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); + + bool wire = pen && strchr(pen,'#'); + bool above = pen && strchr(pen,'a')!=0, fall = pen && strchr(pen,'f')!=0; + if(above) fall = false; + float c1,c2,c; + long n1,n2,n3,n4; + float *dd=new float[n], x1,x2,yy,y0,yp,d; + memset(dd,0,n*sizeof(float)); + + gr->SetPenPal(pen,&pal); + if(wire) gr->Reserve(4*n*m); else gr->Reserve(4*n*m); + for(j=0;jNextColor(pal); c2=c1=gr->CDef; + if(gr->GetNumPal(pal)==2*m) c2 = gr->NextColor(pal); + mx = jGetNy() ? j:0; my = jGetNy() ? j:0; + yp = y0 = gr->GetOrgZ('x'); + for(i=0;iv(i+1,mx)-x->v(i,mx) : x->v(i,mx)-x->v(i-1,mx); + x1 = x->v(i,mx) + d/2*(1-gr->BarWidth); + x2 = x1 + gr->BarWidth*d; yy = y->v(i,my); + if(!above) + { x2 = (x2-x1)/m; x1 += j*x2; x2 += x1; } + else + { y0 = gr->GetOrgY('x') + dd[i]; dd[i] += yy; yy += y0; } + if(fall) { y0 = yp; yy += y0; yp = yy; } + + c = (y->v(i,my)<0) ? c1 : c2; + n1 = gr->AddPnt(mglPoint(x1,yy,gr->Min.z),c); + n2 = gr->AddPnt(mglPoint(x1,y0,gr->Min.z),c); + n3 = gr->AddPnt(mglPoint(x2,y0,gr->Min.z),c); + n4 = gr->AddPnt(mglPoint(x2,yy,gr->Min.z),c); + if(wire) + { + gr->line_plot(n1,n2); gr->line_plot(n1,n4); + gr->line_plot(n3,n2); gr->line_plot(n3,n4); + } + else gr->quad_plot(n1,n2,n4,n3); + } + } + gr->EndGroup(); delete []dd; +} +//----------------------------------------------------------------------------- +void mgl_bars(HMGL gr, HCDT y, const char *pen, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Bars"); return; } + gr->SaveState(opt); + mglData x(y->GetNx()+1); + x.Fill(gr->Min.x,gr->Max.x); + mgl_bars_xy(gr,&x,y,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_bars_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_bars_xyz(_GR_,_DA_(x),_DA_(y),_DA_(z),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_bars_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_bars_xy(_GR_,_DA_(x),_DA_(y),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_bars_(uintptr_t *gr, uintptr_t *y, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_bars(_GR_,_DA_(y),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Barh series +// +//----------------------------------------------------------------------------- +void mgl_barh_yx(HMGL gr, HCDT y, HCDT v, const char *pen, const char *opt) +{ + long i,j,m,mx,my,n=v->GetNx(),pal; + if(y->GetNx()SetWarn(mglWarnDim,"Barh"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Barh"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Barh",cgid++); + m = y->GetNy() > v->GetNy() ? y->GetNy() : v->GetNy(); + + bool wire = pen && strchr(pen,'#'); + bool above = pen && strchr(pen,'a'), fall = pen && strchr(pen,'f'); + if(above) fall = false; + float c1,c2,c; + long n1,n2,n3,n4; + float *dd=new float[n], y1,y2,xx,x0,xp,d; + memset(dd,0,n*sizeof(float)); + + gr->SetPenPal(pen,&pal); + if(wire) gr->Reserve(4*n*m); else gr->Reserve(4*n*m); + for(j=0;jNextColor(pal); c2=c1=gr->CDef; + if(gr->GetNumPal(pal)==2*m) c2 = gr->NextColor(pal); + mx = jGetNy() ? j:0; my = jGetNy() ? j:0; + xp = x0 = gr->GetOrgX('y'); + for(i=0;iv(i+1,my)-y->v(i,my) : y->v(i,my)-y->v(i-1,my); + y1 = y->v(i,my) + d/2*(1-gr->BarWidth); + y2 = y1 + gr->BarWidth*d; xx = v->v(i,mx); + if(!above) + { y2 = (y2-y1)/m; y1 += j*y2; y2 += y1; } + else + { x0 = gr->GetOrgX('y') + dd[i]; dd[i] += xx; xx += x0; } + if(fall) { x0 = xp; xx += x0; xp = xx; } + + c = (v->v(i,mx)<0) ? c1 : c2; + n1 = gr->AddPnt(mglPoint(xx,y1,gr->Min.z),c); + n2 = gr->AddPnt(mglPoint(xx,y2,gr->Min.z),c); + n3 = gr->AddPnt(mglPoint(x0,y2,gr->Min.z),c); + n4 = gr->AddPnt(mglPoint(x0,y1,gr->Min.z),c); + if(wire) + { + gr->line_plot(n1,n2); gr->line_plot(n1,n4); + gr->line_plot(n3,n2); gr->line_plot(n3,n4); + } + else gr->quad_plot(n1,n2,n4,n3); + } + } + gr->EndGroup(); delete []dd; +} +//----------------------------------------------------------------------------- +void mgl_barh(HMGL gr, HCDT v, const char *pen, const char *opt) +{ + if(v->GetNx()<2) { gr->SetWarn(mglWarnLow,"Barh"); return; } + gr->SaveState(opt); + mglData y(v->GetNx()+1); + y.Fill(gr->Min.y,gr->Max.y); + mgl_barh_yx(gr,&y,v,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_barh_yx_(uintptr_t *gr, uintptr_t *y, uintptr_t *v, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_barh_yx(_GR_,_DA_(y),_DA_(v),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_barh_(uintptr_t *gr, uintptr_t *v, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_barh(_GR_,_DA_(v),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// BoxPlot series +// +//----------------------------------------------------------------------------- +double sgn(double a); +int mgl_cmp_flt(const void *a, const void *b) +{ + const float *aa = (const float *)a; + const float *bb = (const float *)b; + return int(sgn(*aa-*bb)); +} +//----------------------------------------------------------------------------- +void mgl_boxplot_xy(HMGL gr, HCDT x, HCDT y, const char *pen, const char *opt) +{ + long n=y->GetNx(), m=y->GetNy(); + if(x->GetNx()SetWarn(mglWarnDim,"BoxPlot"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("BoxPlot",cgid++); + float *b = new float[5*n], *d = new float[m], x1, x2, dd; + float zVal = gr->Min.z; + register long i,j; + for(i=0;iv(i,j))) + { d[mm]=y->v(i,j); mm++; } + if(m==0) { b[i]=NAN; break; } + qsort(d, mm, sizeof(float), mgl_cmp_flt); + b[i] = d[0]; b[i+4*n] = d[mm-1]; k = mm/4; + b[i+n] = (mm%4) ? d[k] : (d[k]+d[k-1])/2.; + b[i+2*n] = (mm%2) ? d[mm/2] : (d[mm/2]+d[mm/2-1])/2.; + b[i+3*n] = (mm%4) ? d[mm-k-1] : (d[mm-k-1]+d[mm-k])/2.; + } + delete []d; + + mglPoint p1,p2; + long n1,n2,pal; + gr->SetPenPal(pen,&pal); gr->NextColor(pal); gr->Reserve(18*n); + for(i=0;iv(i+1)-x->v(i) : x->v(i)-x->v(i-1); + x1 = x->v(i) + dd/2*(1-gr->BarWidth); + x2 = x1 + gr->BarWidth*dd; + for(j=0;j<5;j++) // horizontal lines + { + p1=mglPoint(x1,b[i+j*n],zVal); n1=gr->AddPnt(p1,gr->CDef); + p2=mglPoint(x2,b[i+j*n],zVal); n2=gr->AddPnt(p2,gr->CDef); + gr->line_plot(n1,n2); + } + //vertical lines + p1=mglPoint(x1,b[i+n],zVal); n1=gr->AddPnt(p1,gr->CDef); + p2=mglPoint(x1,b[i+3*n],zVal); n2=gr->AddPnt(p2,gr->CDef); + gr->line_plot(n1,n2); + p1=mglPoint(x2,b[i+n],zVal); n1=gr->AddPnt(p1,gr->CDef); + p2=mglPoint(x2,b[i+3*n],zVal); n2=gr->AddPnt(p2,gr->CDef); + gr->line_plot(n1,n2); + p1=mglPoint(x->v(i),b[i],zVal); n1=gr->AddPnt(p1,gr->CDef); + p2=mglPoint(x->v(i),b[i+n],zVal); n2=gr->AddPnt(p2,gr->CDef); + gr->line_plot(n1,n2); + p1=mglPoint(x->v(i),b[i+3*n],zVal); n1=gr->AddPnt(p1,gr->CDef); + p2=mglPoint(x->v(i),b[i+4*n],zVal); n2=gr->AddPnt(p2,gr->CDef); + gr->line_plot(n1,n2); + } + delete []b; gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_boxplot(HMGL gr, HCDT y, const char *pen, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"BoxPlot"); return; } + gr->SaveState(opt); + mglData x(y->GetNx()+1); + x.Fill(gr->Min.x,gr->Max.x); + mgl_boxplot_xy(gr,&x,y,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_boxplot_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_boxplot_xy(_GR_,_DA_(x),_DA_(y),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_boxplot_(uintptr_t *gr, uintptr_t *y, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_boxplot(_GR_,_DA_(y),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Error series +// +//----------------------------------------------------------------------------- +void mgl_error_exy(HMGL gr, HCDT x, HCDT y, HCDT ex, HCDT ey, const char *pen, const char *opt) +{ + long i,j,k,m,mx,my,m1,m2,n=ey->GetNx(),pal; + if(x->GetNx()!=n || y->GetNx()!=n || ex->GetNx()!=n ) + { gr->SetWarn(mglWarnDim,"Error"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Error"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Error",cgid++); + m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); + m = ex->GetNy() > m ? ex->GetNy() : m; + m = ey->GetNy() > m ? ey->GetNy() : m; + + bool ma = pen && strchr(pen,'@'); + char mk = gr->SetPenPal(pen,&pal); + float zVal=gr->Min.z; gr->Reserve(5*n*m); + if(ma && !strchr("PXsSdD+xoOC",mk)) mk = 'S'; + long n1,n2,n3,n4; + for(j=0;jGetNy() ? j:0; my = jGetNy() ? j:0; + m1 = jGetNy() ? j:0; m2 = jGetNy() ? j:0; + gr->NextColor(pal); + if(ma) + { + if(strchr("PXsS",mk)) for(i=0;iAddPnt(mglPoint(x->v(i,mx)-ex->v(i,m1), y->v(i,my)+ey->v(i,m2), zVal)); + n2 = gr->AddPnt(mglPoint(x->v(i,mx)-ex->v(i,m1), y->v(i,my)-ey->v(i,m2), zVal)); + n3 = gr->AddPnt(mglPoint(x->v(i,mx)+ex->v(i,m1), y->v(i,my)+ey->v(i,m2), zVal)); + n4 = gr->AddPnt(mglPoint(x->v(i,mx)+ex->v(i,m1), y->v(i,my)-ey->v(i,m2), zVal)); + gr->line_plot(n1,n2); gr->line_plot(n1,n3); + gr->line_plot(n4,n2); gr->line_plot(n4,n3); + } + if(strchr("dD",mk)) for(i=0;iAddPnt(mglPoint(x->v(i,mx), y->v(i,my)+ey->v(i,m2), zVal)); + n2 = gr->AddPnt(mglPoint(x->v(i,mx)-ex->v(i,m1), y->v(i,my), zVal)); + n3 = gr->AddPnt(mglPoint(x->v(i,mx), y->v(i,my)-ey->v(i,m2), zVal)); + n4 = gr->AddPnt(mglPoint(x->v(i,mx)+ex->v(i,m1), y->v(i,my), zVal)); + gr->line_plot(n1,n2); gr->line_plot(n2,n3); + gr->line_plot(n3,n4); gr->line_plot(n4,n1); + } + if(strchr("oOC",mk)) for(i=0;iAddPnt(mglPoint(x->v(i,mx)+ex->v(i,m1)*cos(k*M_PI/20), + y->v(i,my)+ey->v(i,m2)*sin(k*M_PI/20), zVal)); + if(k>0) gr->line_plot(n1,n2); + } + } + switch(mk) + { + case 'P': case '+': for(i=0;iAddPnt(mglPoint(x->v(i,mx), y->v(i,my)+ey->v(i,m2), zVal)); + n2 = gr->AddPnt(mglPoint(x->v(i,mx)-ex->v(i,m1), y->v(i,my), zVal)); + n3 = gr->AddPnt(mglPoint(x->v(i,mx), y->v(i,my)-ey->v(i,m2), zVal)); + n4 = gr->AddPnt(mglPoint(x->v(i,mx)+ex->v(i,m1), y->v(i,my), zVal)); + gr->line_plot(n1,n3); gr->line_plot(n2,n4); + } break; + case 'X': case 'x': for(i=0;iAddPnt(mglPoint(x->v(i,mx)-ex->v(i,m1), y->v(i,my)+ey->v(i,m2), zVal)); + n2 = gr->AddPnt(mglPoint(x->v(i,mx)-ex->v(i,m1), y->v(i,my)-ey->v(i,m2), zVal)); + n3 = gr->AddPnt(mglPoint(x->v(i,mx)+ex->v(i,m1), y->v(i,my)+ey->v(i,m2), zVal)); + n4 = gr->AddPnt(mglPoint(x->v(i,mx)+ex->v(i,m1), y->v(i,my)-ey->v(i,m2), zVal)); + gr->line_plot(n1,n3); gr->line_plot(n2,n4); + } break; + case 'S': for(i=0;iAddPnt(mglPoint(x->v(i,mx)-ex->v(i,m1), y->v(i,my)+ey->v(i,m2), zVal)); + n2 = gr->AddPnt(mglPoint(x->v(i,mx)-ex->v(i,m1), y->v(i,my)-ey->v(i,m2), zVal)); + n3 = gr->AddPnt(mglPoint(x->v(i,mx)+ex->v(i,m1), y->v(i,my)+ey->v(i,m2), zVal)); + n4 = gr->AddPnt(mglPoint(x->v(i,mx)+ex->v(i,m1), y->v(i,my)-ey->v(i,m2), zVal)); + gr->quad_plot(n1,n2,n3,n4); + } break; + case 'D': for(i=0;iAddPnt(mglPoint(x->v(i,mx), y->v(i,my)+ey->v(i,m2), zVal)); + n2 = gr->AddPnt(mglPoint(x->v(i,mx)-ex->v(i,m1), y->v(i,my), zVal)); + n3 = gr->AddPnt(mglPoint(x->v(i,mx), y->v(i,my)-ey->v(i,m2), zVal)); + n4 = gr->AddPnt(mglPoint(x->v(i,mx)+ex->v(i,m1), y->v(i,my), zVal)); + gr->quad_plot(n1,n2,n3,n4); + } break; + case 'O': for(i=0;iAddPnt(mglPoint(x->v(i,mx),y->v(i,my),zVal)); + for(k=0,n2=-1;k<=40;k++) + { + n1 = n2; + n2 = gr->AddPnt(mglPoint(x->v(i,mx)+ex->v(i,m1)*cos(k*M_PI/20), + y->v(i,my)+ey->v(i,m2)*sin(k*M_PI/20), zVal)); + if(k>0) gr->trig_plot(n1,n2,n3); + } + } break; + case 'C': for(i=0;imark_plot(gr->AddPnt(mglPoint(x->v(i,mx),y->v(i,my),zVal)), '.'); + } + } + else for(i=0;imark_plot(gr->AddPnt(mglPoint(x->v(i,mx),y->v(i,my),zVal)), mk); + + n1 = gr->AddPnt(mglPoint(x->v(i,mx), y->v(i,my)+ey->v(i,m2), zVal)); + n2 = gr->AddPnt(mglPoint(x->v(i,mx), y->v(i,my)-ey->v(i,m2), zVal)); + gr->line_plot(n1,n2); gr->arrow_plot(n1,n2,'I'); gr->arrow_plot(n2,n1,'I'); + + n1 = gr->AddPnt(mglPoint(x->v(i,mx)+ex->v(i,m1), y->v(i,my), zVal)); + n2 = gr->AddPnt(mglPoint(x->v(i,mx)-ex->v(i,m1), y->v(i,my), zVal)); + gr->line_plot(n1,n2); gr->arrow_plot(n1,n2,'I'); gr->arrow_plot(n2,n1,'I'); + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_error_xy(HMGL gr, HCDT x, HCDT y, HCDT ey, const char *pen, const char *opt) +{ + gr->SaveState(opt); + mglData ex(y->GetNx()); + ex.Fill(NAN,NAN); + mgl_error_exy(gr,x,y,&ex,ey,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_error(HMGL gr, HCDT y, HCDT ey, const char *pen, const char *opt) +{ + gr->SaveState(opt); + mglData x(y->GetNx()); + x.Fill(gr->Min.x,gr->Max.x); + mgl_error_xy(gr,&x,y,ey,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_error_(uintptr_t *gr, uintptr_t *y, uintptr_t *ey, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_error(_GR_,_DA_(y),_DA_(ey),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_error_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ey, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_error_xy(_GR_,_DA_(x),_DA_(y),_DA_(ey),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_error_exy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ex, uintptr_t *ey, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_error_exy(_GR_,_DA_(x),_DA_(y),_DA_(ex),_DA_(ey),s,o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Chart series +// +//----------------------------------------------------------------------------- +void face_plot(mglBase *gr, mglPoint o, mglPoint d1, mglPoint d2, float c, bool wire) +{ + const int num=40; + mglPoint p,nn=d1^d2; + d1 = d1/num; d2 = d2/num; + register long i,j,i0,n=num+1; + long *id=new long[n*n]; + gr->Reserve(n*n); + for(j=0;jAddPnt(p,c,nn); } + for(i=0;iquad_plot(id[i0],id[i0+1],id[i0+n],id[i0+n+1]); + } + if(wire) + { + gr->Reserve(4*n); gr->SetPenPal("k-"); + long *jj=id+n+1; + jj[0] = jj[1] = gr->CopyNtoC(id[0],gr->CDef); + jj[2] = jj[3] = gr->CopyNtoC(id[n*n-1],gr->CDef); + for(i=1;iCopyNtoC(id[i],gr->CDef); + jj[1] = gr->CopyNtoC(id[n*i],gr->CDef); + jj[2] = gr->CopyNtoC(id[n*n-1-i],gr->CDef); + jj[3] = gr->CopyNtoC(id[n*n-1-n*i],gr->CDef); + gr->line_plot(jj[4],jj[0]); + gr->line_plot(jj[5],jj[1]); + gr->line_plot(jj[6],jj[2]); + gr->line_plot(jj[7],jj[3]); + } + } + delete []id; +} +//----------------------------------------------------------------------------- +void mgl_chart(HMGL gr, HCDT a, const char *cols, const char *opt) +{ + if(a->Minimal()<0) { gr->SetWarn(mglWarnNeg,"Chart"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Chart",cgid++); + bool wire = false; // draw edges + register long n=a->GetNx(),i,j; + if(cols && !strcmp(cols,"#")) { wire = true; cols = 0; } + if(!cols) cols = MGL_DEF_PAL; + float *c = new float[strlen(cols)+1],cc; + long nc=0; // number of colors + for(i=0;iAddTexture(cols[i]); nc++; } + else if(cols[i]=='#') wire = true; + } + + float dy = (gr->Max.y-gr->Min.y)/a->GetNy(), dx, ss, cs, x1, y1, dz=gr->Max.z-gr->Min.z; + mglPoint d1,d2,o; + + for(j=0;jGetNy();j++) + { + y1 = gr->Min.y + dy*j; + for(i=0,ss=0;iv(i,j); + if(ss==0) continue; + for(cs=0,i=0;iv(i,j)/ss; cc = c[i%nc]; + if(dx==0) continue; + x1 = gr->Min.x + (gr->Max.x-gr->Min.x)*cs/ss; dx *= (gr->Max.x-gr->Min.x); + if(cc>=0) + { + face_plot(gr,mglPoint(x1,y1,gr->Min.z),mglPoint(dx,0,0),mglPoint(0,0,dz),cc,wire); + face_plot(gr,mglPoint(x1,y1,gr->Min.z),mglPoint(dx,0,0),mglPoint(0,dy,0),cc,wire); + face_plot(gr,mglPoint(x1,y1,gr->Min.z),mglPoint(0,dy,0),mglPoint(0,0,dz),cc,wire); + + face_plot(gr,mglPoint(x1+dx,y1+dy,gr->Max.z),mglPoint(-dx,0,0),mglPoint(0,0,-dz),cc,wire); + face_plot(gr,mglPoint(x1+dx,y1+dy,gr->Max.z),mglPoint(-dx,0,0),mglPoint(0,-dy,0),cc,wire); + face_plot(gr,mglPoint(x1+dx,y1+dy,gr->Max.z),mglPoint(0,-dy,0),mglPoint(0,0,-dz),cc,wire); + } + cs += a->v(i,j); + } + } + gr->EndGroup(); delete []c; +} +//----------------------------------------------------------------------------- +void mgl_chart_(uintptr_t *gr, uintptr_t *a, const char *col, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,col,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_chart(_GR_, _DA_(a), s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Mark series +// +//----------------------------------------------------------------------------- +void mgl_mark_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT r, const char *pen, const char *opt) +{ + long j,m,mx,my,mz,mr,n=y->GetNx(),pal; + if(x->GetNx()!=n || z->GetNx()!=n || r->GetNx()!=n) + { gr->SetWarn(mglWarnDim,"Mark"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Mark"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Mark",cgid++); + m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); + m = z->GetNy() > m ? z->GetNy() : m; + char mk=gr->SetPenPal(pen,&pal); gr->Reserve(n*m); + if(mk==0) return; + + for(j=0;jNextColor(pal); + mx = jGetNy() ? j:0; my = jGetNy() ? j:0; + mz = jGetNy() ? j:0; mr = jGetNy() ? j:0; + for(int i=0;imark_plot(gr->AddPnt(mglPoint(x->v(i,mx),y->v(i,my),z->v(i,mz))), mk, r->v(i,mr)); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_mark_xy(HMGL gr, HCDT x, HCDT y, HCDT r, const char *pen, const char *opt) +{ + gr->SaveState(opt); + mglData z(y->GetNx()); + z.Fill(gr->Min.z,gr->Min.z); + mgl_mark_xyz(gr,x,y,&z,r,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_mark_y(HMGL gr, HCDT y, HCDT r, const char *pen, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Mark"); return; } + gr->SaveState(opt); + mglData x(y->GetNx()), z(y->GetNx()); + x.Fill(gr->Min.x,gr->Max.x); + z.Fill(gr->Min.z,gr->Min.z); + mgl_mark_xyz(gr,&x,y,&z,r,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_mark_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *r, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_mark_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(r),s,o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_mark_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *r, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_mark_xy(_GR_, _DA_(x), _DA_(y), _DA_(r),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_mark_y_(uintptr_t *gr, uintptr_t *y, uintptr_t *r, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_mark_y(_GR_,_DA_(y),_DA_(r),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Tube series +// +//----------------------------------------------------------------------------- +void mgl_tube_xyzr(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT r, const char *pen, const char *opt) +{ + long j,m,mx,my,mz,mr,n=y->GetNx(),pal; + if(n<2) { gr->SetWarn(mglWarnLow,"Tube"); return; } + if(x->GetNx()!=n || z->GetNx()!=n || r->GetNx()!=n) + { gr->SetWarn(mglWarnDim,"Tube"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Tube",cgid++); + m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); + m = z->GetNy() > m ? z->GetNy() : m; + m = r->GetNy() > m ? r->GetNy() : m; + + const int num=41; + gr->SetPenPal(pen,&pal); + gr->Reserve(n*m*num); + mglPoint p,l,t,u,q,d; + long *nn=new long[2*num]; + memset(nn,-1,2*num*sizeof(long)); + for(j=0;jNextColor(pal); + mx = jGetNy() ? j:0; my = jGetNy() ? j:0; + mz = jGetNy() ? j:0; mr = jGetNy() ? j:0; + register long i,k; + for(i=0;idvx(i,mx),y->dvx(i,my),z->dvx(i,mz)); + t = !l; t.Normalize(); u = t^l; u.Normalize(); + q = mglPoint(x->v(i,mx),y->v(i,my),z->v(i,mz)); + float si,co,ff, rr=r->v(i,mr), dr=r->dvx(i,mr); + for(k=0;kAddPnt(p,gr->CDef,d,-1,3); + if(i*k>0) + gr->quad_plot(nn[k],nn[k-1],nn[k+num],nn[k+num-1]); + } + } + } + delete []nn; gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_tube_xyr(HMGL gr, HCDT x, HCDT y, HCDT r, const char *pen, const char *opt) +{ + gr->SaveState(opt); + mglData z(y->GetNx()); + z.Fill(gr->Min.z,gr->Min.z); + mgl_tube_xyzr(gr,x,y,&z,r,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_tube_r(HMGL gr, HCDT y, HCDT r, const char *pen, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Tube"); return; } + gr->SaveState(opt); + mglData x(y->GetNx()), z(y->GetNx()); + x.Fill(gr->Min.x,gr->Max.x); + z.Fill(gr->Min.z,gr->Min.z); + mgl_tube_xyzr(gr,&x,y,&z,r,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_tube(HMGL gr, HCDT y, float rr, const char *pen, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Tube"); return; } + gr->SaveState(opt); + mglData x(y->GetNx()), r(y->GetNx()), z(y->GetNx()); + x.Fill(gr->Min.x,gr->Max.x); + r.Fill(rr,rr); + z.Fill(gr->Min.z,gr->Min.z); + mgl_tube_xyzr(gr,&x,y,&z,&r,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_tube_xy(HMGL gr, HCDT x, HCDT y, float rr, const char *pen, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Tube"); return; } + gr->SaveState(opt); + mglData r(y->GetNx()), z(y->GetNx()); + r.Fill(rr,rr); + z.Fill(gr->Min.z,gr->Min.z); + mgl_tube_xyzr(gr,x,y,&z,&r,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_tube_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, float rr, const char *pen, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"Tube"); return; } + gr->SaveState(opt); + mglData r(y->GetNx()); + r.Fill(rr,rr); + mgl_tube_xyzr(gr,x,y,z,&r,pen,0); +} +//----------------------------------------------------------------------------- +void mgl_tube_xyzr_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *r, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tube_xyzr(_GR_,_DA_(x),_DA_(y),_DA_(z), _DA_(r),s,o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_tube_xyr_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *r, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tube_xyr(_GR_,_DA_(x),_DA_(y),_DA_(r),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_tube_r_(uintptr_t *gr, uintptr_t *y, uintptr_t *r, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tube_r(_GR_,_DA_(y),_DA_(r),s,o); delete []s; delete []o; } +//----------------------------------------------------------------------------- +void mgl_tube_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, float *r, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tube_xyz(_GR_,_DA_(x),_DA_(y),_DA_(z),*r,s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_tube_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, float *r, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tube_xy(_GR_,_DA_(x),_DA_(y),*r,s,o); delete []s; delete []o; } +//----------------------------------------------------------------------------- +void mgl_tube_(uintptr_t *gr, uintptr_t *y, float *r, const char *pen, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tube(_GR_,_DA_(y),*r,s,o); + delete []s; delete []o; } +//----------------------------------------------------------------------------- diff --git a/src/prim.cpp b/src/prim.cpp new file mode 100644 index 0000000..0b0c606 --- /dev/null +++ b/src/prim.cpp @@ -0,0 +1,580 @@ +/*************************************************************************** + * prim.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License 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 +#include "mgl/prim.h" +#include "mgl/data.h" +//----------------------------------------------------------------------------- +// +// Mark & Curve series +// +//----------------------------------------------------------------------------- +void mgl_mark(HMGL gr, float x,float y,float z,const char *mark) +{ + char mk = gr->SetPenPal(mark); + if(!mk) mk = '.'; + mglPoint p(x,y,z); + gr->mark_plot(gr->AddPnt(p,gr->CDef,mglPoint(NAN),-1,3),mk); +} +//----------------------------------------------------------------------------- +void mgl_mark_(uintptr_t *gr, mreal *x, mreal *y, mreal *z, const char *pen,int l) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + mgl_mark(_GR_, *x,*y,*z,s); delete []s; } +//----------------------------------------------------------------------------- +void mgl_ball(HMGL gr, float x,float y,float z) +{ + mglPoint p(x,y,z); + gr->mark_plot(gr->AddPnt(p,gr->AddTexture('r'),mglPoint(NAN),-1,3),'.'); +} +//----------------------------------------------------------------------------- +void mgl_ball_(uintptr_t *gr, mreal *x,mreal *y,mreal *z) +{ mgl_ball(_GR_, *x,*y,*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; + mglPoint p1(x1,y1,z1), p2(x2,y2,z2), p=p1,nn=mglPoint(NAN); + gr->SetPenPal(pen); + n = (n<2) ? 2 : n; + + register long i,k1,k2; + register float s; + gr->Reserve(n); + k1 = gr->AddPnt(p,gr->CDef,nn,-1,3); + for(i=1;iAddPnt(p,gr->CDef,nn,-1,3); + gr->line_plot(k2,k1); + if(i==1) gr->arrow_plot(k2,k1,gr->Arrow1); + if(i==n-1) gr->arrow_plot(k1,k2,gr->Arrow2); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_line_(uintptr_t *gr, mreal *x1, mreal *y1, mreal *z1, mreal *x2, mreal *y2, mreal *z2, const char *pen,int *n,int l) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + mgl_line(_GR_, *x1,*y1,*z1, *x2,*y2,*z2,s,*n); delete []s; } +//----------------------------------------------------------------------------- +void mgl_curve(HMGL gr, float x1, float y1, float z1, float dx1, float dy1, float dz1, float x2, float y2, float z2, float dx2, float dy2, float dz2, const char *pen,int n) +{ + static int cgid=1; gr->StartGroup("Curve",cgid++); + mglPoint p1(x1,y1,z1), p2(x2,y2,z2), d1(dx1,dy1,dz1), d2(dx2,dy2,dz2), a,b,p=p1,nn=mglPoint(NAN); + a = 3*(p2-p1)-d2-2*d1; b = d1+d2-2*(p2-p1); + n = (n<2) ? 2 : n; + gr->SetPenPal(pen); + + register long i,k1,k2; + register float s; + gr->Reserve(n); + k1=gr->AddPnt(p,gr->CDef,nn,-1,3); + for(i=0;iAddPnt(p,gr->CDef,nn,-1,3); + gr->line_plot(k2,k1); + if(i==1) gr->arrow_plot(k2,k1,gr->Arrow1); + if(i==n-1) gr->arrow_plot(k1,k2,gr->Arrow2); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_curve_(uintptr_t* gr, mreal *x1, mreal *y1, mreal *z1, mreal *dx1, mreal *dy1, mreal *dz1, mreal *x2, mreal *y2, mreal *z2, mreal *dx2, mreal *dy2, mreal *dz2, const char *pen,int *n, int l) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + mgl_curve(_GR_, *x1,*y1,*z1, *dx1,*dy1,*dz1, *x2,*y2,*z2, *dx2,*dy2,*dz2, s, *n); delete []s;} +//----------------------------------------------------------------------------- +void mgl_error_box(HMGL gr, float x, float y, float z, float ex, float ey, float ez, const char *pen) +{ + static int cgid=1; gr->StartGroup("ErBox",cgid++); + char mk=gr->SetPenPal(pen); + mglPoint p(x,y,z), q,nn=mglPoint(NAN); + gr->Reserve(7); + long k1,k2; + q = p; q.x += ex; k1 = gr->AddPnt(q,gr->CDef,nn,0,3); + q = p; q.x -= ex; k2 = gr->AddPnt(q,gr->CDef,nn,0,3); + gr->line_plot(k1,k2); gr->arrow_plot(k1,k2,'I'); gr->arrow_plot(k2,k1,'I'); + q = p; q.y += ey; k1 = gr->AddPnt(q,gr->CDef,nn,0,3); + q = p; q.y -= ey; k2 = gr->AddPnt(q,gr->CDef,nn,0,3); + gr->line_plot(k1,k2); gr->arrow_plot(k1,k2,'I'); gr->arrow_plot(k2,k1,'I'); + q = p; q.z += ez; k1 = gr->AddPnt(q,gr->CDef,nn,0,3); + q = p; q.z -= ez; k2 = gr->AddPnt(q,gr->CDef,nn,0,3); + gr->line_plot(k1,k2); gr->arrow_plot(k1,k2,'I'); gr->arrow_plot(k2,k1,'I'); + if(mk) gr->mark_plot(gr->AddPnt(p,gr->CDef,nn,0,3),mk); + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_error_box_(uintptr_t *gr, mreal *x1, mreal *y1, mreal *z1, mreal *x2, mreal *y2, mreal *z2, const char *pen,int l) +{ char *s=new char[l+1]; memcpy(s,pen,l); s[l]=0; + mgl_error_box(_GR_, *x1,*y1,*z1, *x2,*y2,*z2,s); delete []s; } +//----------------------------------------------------------------------------- +// +// Face series +// +//----------------------------------------------------------------------------- +void mgl_face(HMGL gr, float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, const char *stl) +{ + static int cgid=1; gr->StartGroup("Face",cgid++); + long pal; + 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; + 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); } + mglPoint q1,q2,q3,q4; + q1 = (p2-p1)^(p3-p1); q4 = (p2-p4)^(p3-p4); + q2 = (p1-p2)^(p4-p2); q3 = (p1-p3)^(p4-p3); + gr->Reserve(4); + long k1,k2,k3,k4; + k1 = gr->AddPnt(p1,c1,q1,-1,3); k2 = gr->AddPnt(p2,c2,q2,-1,3); + k3 = gr->AddPnt(p3,c3,q3,-1,3); k4 = gr->AddPnt(p4,c4,q4,-1,3); + gr->quad_plot(k1,k2,k3,k4); + if(strchr(stl,'#')) + { + gr->Reserve(4); + pal = gr->AddTexture('k'); + k1=gr->CopyNtoC(k1,pal); k2=gr->CopyNtoC(k2,pal); + k3=gr->CopyNtoC(k3,pal); k4=gr->CopyNtoC(k4,pal); + gr->line_plot(k1,k2); gr->line_plot(k1,k3); + gr->line_plot(k3,k4); gr->line_plot(k2,k4); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_facex(HMGL gr, float x0, float y0, float z0, float wy, float wz, const char *stl, float d1, float d2) +{ mgl_face(gr, x0,y0,z0, x0,y0+wy,z0, x0,y0,z0+wz, x0,y0+wy+d1,z0+wz+d2, stl); } +//----------------------------------------------------------------------------- +void mgl_facey(HMGL gr, float x0, float y0, float z0, float wx, float wz, const char *stl, float d1, float d2) +{ mgl_face(gr, x0,y0,z0, x0+wx,y0,z0, x0,y0,z0+wz, x0+wx+d1,y0,z0+wz+d2, stl); } +//----------------------------------------------------------------------------- +void mgl_facez(HMGL gr, float x0, float y0, float z0, float wx, float wy, const char *stl, float d1, float d2) +{ mgl_face(gr, x0,y0,z0, x0,y0+wy,z0, x0+wx,y0,z0, x0+wx+d1,y0+wy+d2,z0, stl); } +//----------------------------------------------------------------------------- +void mgl_facex_(uintptr_t* gr, mreal *x0, mreal *y0, mreal *z0, mreal *wy, mreal *wz, const char *stl, mreal *dx, mreal *dy, int l) +{ char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; + mgl_facex(_GR_, *x0,*y0,*z0,*wy,*wz,s,*dx,*dy); delete []s; +} +//----------------------------------------------------------------------------- +void mgl_facey_(uintptr_t* gr, mreal *x0, mreal *y0, mreal *z0, mreal *wx, mreal *wz, const char *stl, mreal *dx, mreal *dy, int l) +{ char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; + mgl_facey(_GR_, *x0,*y0,*z0,*wx,*wz,s,*dx,*dy); delete []s; } +//----------------------------------------------------------------------------- +void mgl_facez_(uintptr_t* gr, mreal *x0, mreal *y0, mreal *z0, mreal *wx, mreal *wy, const char *stl, mreal *dx, mreal *dy, int l) +{ char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; + mgl_facez(_GR_, *x0,*y0,*z0,*wx,*wy,s,*dx,*dy); delete []s; } +//----------------------------------------------------------------------------- +void mgl_face_(uintptr_t* gr, float *x0, float *y0, float *z0, float *x1, float *y1, float *z1, float *x2, float *y2, float *z2, float *x3, float *y3, float *z3, const char *stl, int l) +{ char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; + mgl_face(_GR_, *x0,*y0,*z0, *x1,*y1,*z1, *x2,*y2,*z2, *x3,*y3,*z3, stl); delete []s; } +//----------------------------------------------------------------------------- +// +// Cone +// +//----------------------------------------------------------------------------- +void mgl_cone(HMGL gr, float x1, float y1, float z1, float x2, float y2, float z2, float r1, float r2, const char *stl, int edge) +{ + if(r2<0) r2=r1; + if(r1==0 && r2==0) return; + + static int cgid=1; gr->StartGroup("Cone",cgid++); + mglPoint p1(x1,y1,z1), p2(x2,y2,z2), p,q, d=p2-p1,a,b; + a=!d; a.Normalize(); b=d^a; b.Normalize(); + long ss=gr->AddTexture(stl); + float c1=gr->GetC(ss,p1.z), c2=gr->GetC(ss,p2.z); + long *kk=new long[164],k1=-1,k2=-1; + gr->Reserve(edge?166:82); + if(edge) + { + k1=gr->AddPnt(p1,c1,d,-1,3); + k2=gr->AddPnt(p2,c2,d,-1,3); + } + float f,si,co, dr=r2-r1; + register long i; + for(i=0;i<41;i++) + { + f = i*M_PI/20; co = cos(f); si = sin(f); + p = p1+(r1*co)*a+(r1*si)*b; + q = (si*a-co*b)^(d + (dr*co)*a + (dr*si)*b); + kk[i] = gr->AddPnt(p,c1,q,-1,3); + if(edge) kk[i+82] = gr->AddPnt(p,c1,d,-1,3); + p = p2+(r2*co)*a+(r2*si)*b; + kk[i+41] = gr->AddPnt(p,c2,q,-1,3); + if(edge) kk[i+123] = gr->AddPnt(p,c2,d,-1,3); + } + for(i=0;i<40;i++) + { + gr->quad_plot(kk[i],kk[i+1],kk[i+41],kk[i+42]); + if(edge) + { + gr->trig_plot(k1,kk[i+82],kk[i+83]); + gr->trig_plot(k2,kk[i+123],kk[i+124]); + } + } + gr->EndGroup(); delete []kk; +} +//----------------------------------------------------------------------------- +void mgl_cone_(uintptr_t* gr, mreal *x1, mreal *y1, mreal *z1, mreal *x2, mreal *y2, mreal *z2, mreal *r1, mreal *r2, const char *stl, int *edge, int l) +{ char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; + mgl_cone(_GR_, *x1,*y1,*z1, *x2,*y2,*z2,*r1,*r2,s,*edge); delete []s; } +//----------------------------------------------------------------------------- +// +// Ellipse & Rhomb +// +//----------------------------------------------------------------------------- +void mgl_ellipse(HMGL gr, float x1, float y1, float z1, float x2, float y2, float z2, float r, const char *stl) +{ + const int n = 41; + long pal=0,n0,n1=-1,n2,m1=-1,m2; + gr->SetPenPal(stl,&pal); + float c=gr->NextColor(pal); + float k=(gr->GetNumPal(pal)>1)?gr->NextColor(pal):gr->AddTexture('k'); + bool wire = !(stl && strchr(stl,'#')), box = (stl && strchr(stl,'@')) || !wire; + + gr->Reserve(2*n+1); + mglPoint p1(x1,y1,z1), p2(x2,y2,z2), v=p2-p1, u=mglPoint(0,0,1)^v, q=u^v, p, s; + u = (r/u.norm())*u; s = (p1+p2)/2.; v *=0.5+r/v.norm(); + // central point first + n0 = gr->AddPnt(p1,c,q,-1,3); + for(long i=0;iAddPnt(p,c,q,-1,3); + m2 = m1; m1 = gr->CopyNtoC(n1,k); + if(i>0) + { + if(wire) gr->trig_plot(n0,n1,n2); + if(box) gr->line_plot(m1,m2); + } + } +} +//----------------------------------------------------------------------------- +void mgl_rhomb(HMGL gr, float x1, float y1, float z1, float x2, float y2, float z2, float r, const char *stl) +{ + long pal=0, n1,n2,n3,n4; + gr->SetPenPal(stl,&pal); + float c=gr->NextColor(pal); + float k=(gr->GetNumPal(pal)>1)?gr->NextColor(pal):gr->AddTexture('k'); + float b=(gr->GetNumPal(pal)>2)?gr->NextColor(pal):c; + bool wire = !(stl && strchr(stl,'#')), box = (stl && strchr(stl,'@')) || !wire; + gr->Reserve(8); + mglPoint p1(x1,y1,z1), p2(x2,y2,z2), u=mglPoint(0,0,1)^(p1-p2), q=u^(p1-p2), p, s,qq; + u = (r/u.norm())*u; s = (p1+p2)/2.; + p = p1; q = qq; n1 = gr->AddPnt(p,c,qq,-1,3); + p = s+u;q = qq; n2 = gr->AddPnt(p,b==c?c:k,qq,-1,3); + p = p2; q = qq; n3 = gr->AddPnt(p,b,qq,-1,3); + p = s-u;q = qq; n4 = gr->AddPnt(p,b==c?c:k,qq,-1,3); + if(wire) gr->quad_plot(n1,n2,n4,n3); + n1 = gr->CopyNtoC(n1,k); n2 = gr->CopyNtoC(n2,k); + n3 = gr->CopyNtoC(n3,k); n4 = gr->CopyNtoC(n4,k); + if(box) + { gr->line_plot(n1,n2); gr->line_plot(n2,n3); + gr->line_plot(n3,n4); gr->line_plot(n4,n1); } +} +//----------------------------------------------------------------------------- +void mgl_ellipse_(uintptr_t* gr, float *x1, float *y1, float *z1, float *x2, float *y2, float *z2, float *r, const char *stl,int l) +{ char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; + mgl_ellipse(_GR_,*x1,*y1,*z1,*x2,*y2,*z2,*r,s); delete []s; } +//----------------------------------------------------------------------------- +void mgl_rhomb_(uintptr_t* gr, float *x1, float *y1, float *z1, float *x2, float *y2, float *z2, float *r, const char *stl,int l) +{ char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; + mgl_rhomb(_GR_,*x1,*y1,*z1,*x2,*y2,*z2,*r,s); delete []s; } +//----------------------------------------------------------------------------- +// +// Sphere & Drop +// +//----------------------------------------------------------------------------- +void mgl_sphere(HMGL gr, float x, float y, float z, float r, const char *stl) +{ mgl_drop(gr,x,y,z,1,0,0,2*r,stl,0,1); } +//----------------------------------------------------------------------------- +void mgl_sphere_(uintptr_t* gr, mreal *x, mreal *y, mreal *z, mreal *r, const char *stl,int l) +{ char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; + mgl_sphere(_GR_, *x,*y,*z,*r,s); delete []s; } +//----------------------------------------------------------------------------- +void mgl_drop(HMGL gr, mglPoint p, mglPoint q, float r, float c, float sh, float a) +{ + mglPoint p1,p2,pp,qq; + if(q.norm()==0) { q = mglPoint(1,0,0); sh=0; } + q.Normalize(); p1 = !q; p2 = q^p1; r /= 2; + + static int cgid=1; gr->StartGroup("Drop",cgid++); + const int n = 41; + register long i,j; + gr->Reserve(n*n); + long *nn=new long[2*n]; + + float u,v,x,y,z,rr,dr, co,si; + for(i=0;iAddPnt(pp,c,qq,-1,3); + if(i*j>0) gr->quad_plot(nn[j-1], nn[j], nn[j+n-1], nn[j+n]); + } + delete []nn; gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_drop(HMGL gr, float x1, float y1, float z1, float x2, float y2, float z2, float r, const char *stl, float sh, float a) +{ + float c=gr->AddTexture((stl && stl[0]) ? stl[0]:'r'); + mgl_drop(gr,mglPoint(x1,y1,z1), mglPoint(x2,y2,z2), r, c, sh, a); +} +//----------------------------------------------------------------------------- +void mgl_drop_(uintptr_t* gr, mreal *x1, mreal *y1, mreal *z1, mreal *x2, mreal *y2, mreal *z2, mreal *r, const char *stl, mreal *shift, mreal *ap, int l) +{ char *s=new char[l+1]; memcpy(s,stl,l); s[l]=0; + mgl_drop(_GR_, *x1,*y1,*z1, *x2,*y2,*z2, *r,s,*shift,*ap); delete []s; } +//----------------------------------------------------------------------------- +// +// Dew series +// +//----------------------------------------------------------------------------- +void mgl_dew_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt) +{ + long i,j,n=ax->GetNx(),m=ax->GetNy(),k; + if(n*m*ax->GetNz()!=ay->GetNx()*ay->GetNy()*ay->GetNz()) { gr->SetWarn(mglWarnDim,"Dew"); return; } + if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"Dew"); return; } + 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,"Dew"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("DewXY",cgid++); + + float xm,ym,dx,dy,dd; + long ss = gr->AddTexture(sch); + bool inv = sch && strchr(sch,'A'); + float zVal = gr->Min.z; + long tx=1,ty=1; + if(gr->MeshNum>1) { tx=(n-1)/(gr->MeshNum-1); ty=(m-1)/(gr->MeshNum-1); } + if(tx<1) tx=1; if(ty<1) ty=1; + + for(i=0,xm=0;iGetNz();i++) + { + ym = hypot(ax->vthr(i),ay->vthr(i)); + xm = xm>ym ? xm : ym; + } + xm = 1./MGL_FLT_EPS/(xm==0 ? 1:xm); + mglPoint p,q; + + for(k=0;kGetNz();k++) + { + if(ax->GetNz()>1) zVal = gr->Min.z+(gr->Max.z-gr->Min.z)*float(k)/(ax->GetNz()-1); + for(i=0;iv(i,j,k),-ay->v(i,j,k),0) : mglPoint(ax->v(i,j,k),ay->v(i,j,k),0); + p = mglPoint(xx, yy, zVal); dd = q.norm(); + float ccc = gr->GetC(ss,dd*xm,false); + mgl_drop(gr,p,q,(dxEndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_dew_2d(HMGL gr, HCDT ax, HCDT ay, const char *sch, const char *opt) +{ + if(ax->GetNx()<2 || ax->GetNy()<2) { gr->SetWarn(mglWarnLow,"Vect"); return; } + gr->SaveState(opt); + mglData x(ax->GetNx()), y(ax->GetNy()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_dew_xy(gr,&x,&y,ax,ay,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_dew_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_dew_xy(_GR_, _DA_(x), _DA_(y), _DA_(ax), _DA_(ay), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_dew_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_dew_2d(_GR_, _DA_(ax), _DA_(ay), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Puts series +// +//----------------------------------------------------------------------------- +void mgl_puts(HMGL gr, float x, float y, float z,const char *text, const char *font, float size) +{ mgl_puts_dir(gr, x, y, z, NAN, 0, 0, text, font, size); } +void mgl_putsw(HMGL gr, float x, float y, float z,const wchar_t *text, const char *font, float size) +{ mgl_putsw_dir(gr, x, y, z, NAN, 0, 0, text, font, size); } +//----------------------------------------------------------------------------- +void mgl_puts_dir(HMGL gr, float x, float y, float z, float dx, float dy, float dz, const char *text, const char *font, float size) +{ + long len = strlen(text); + wchar_t *buf = new wchar_t[len+1]; + mbstowcs(buf,text,len); buf[len]=0; + mgl_putsw_dir(gr, x, y, z, dx, dy, dz, buf, font, size); + delete []buf; +} +//----------------------------------------------------------------------------- +void mgl_putsw_dir(HMGL gr, float x, float y, float z, float dx, float dy, float dz, const wchar_t *text, const char *font, float size) +{ + mglPoint p(x,y,z), d(dx,dy,dz); + long k = gr->AddPnt(p,-1,d,-1,3); + gr->text_plot(k,text,font,size); +} +//----------------------------------------------------------------------------- +void mgl_puts_(uintptr_t *gr, float *x, float *y, float *z,const char *text, const char *font, float *size, int l, int n) +{ wchar_t *s=new wchar_t[l+1]; mbstowcs(s,text,l); s[l]=0; + char *f=new char[n+1]; memcpy(f,font,n); f[n]=0; + mgl_putsw_dir(_GR_, *x, *y, *z, NAN, 0, 0, s, f, *size); + delete []s; delete []f; } +//----------------------------------------------------------------------------- +void mgl_puts_dir_(uintptr_t *gr, float *x, float *y, float *z, float *dx, float *dy, float *dz, const char *text, const char *font, float *size, int l, int n) +{ wchar_t *s=new wchar_t[l+1]; mbstowcs(s,text,l); s[l]=0; + char *f=new char[n+1]; memcpy(f,font,n); f[n]=0; + mgl_putsw_dir(_GR_, *x, *y, *z, *dx, *dy, *dz, s, f, *size); + delete []s; delete []f; } +//----------------------------------------------------------------------------- +// +// TextMark series +// +//----------------------------------------------------------------------------- +void mgl_textmarkw_xyzr(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT r, const wchar_t *text, const char *fnt, const char *opt) +{ + long j,m,mx,my,mz,mr,n=y->GetNx(); + if(x->GetNx()!=n || z->GetNx()!=n || r->GetNx()!=n) + { gr->SetWarn(mglWarnDim,"Mark"); return; } + if(n<2) { gr->SetWarn(mglWarnLow,"Mark"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("TextMark",cgid++); + m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); m = z->GetNy() > m ? z->GetNy() : m; + gr->Reserve(n*m); + + mglPoint p,q(NAN); + for(j=0;jGetNy() ? j:0; my = jGetNy() ? j:0; + mz = jGetNy() ? j:0; mr = jGetNy() ? j:0; + register long i,k; + for(i=0;iv(i,mx), y->v(i,my), z->v(i,mz)); + k = gr->AddPnt(p,-1,q); + gr->text_plot(k, text, fnt, -0.5*fabs(r->v(i,mr))); + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_textmarkw_xyr(HMGL gr, HCDT x, HCDT y, HCDT r, const wchar_t *text, const char *fnt, const char *opt) +{ + gr->SaveState(opt); + mglData z(y->GetNx()); z.Fill(gr->Min.z,gr->Min.z); + mgl_textmarkw_xyzr(gr,x,y,&z,r,text,fnt,0); +} +//----------------------------------------------------------------------------- +void mgl_textmarkw_yr(HMGL gr, HCDT y, HCDT r, const wchar_t *text, const char *fnt, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"TextMark"); return; } + gr->SaveState(opt); + mglData x(y->GetNx()); x.Fill(gr->Min.x,gr->Max.x); + mglData z(y->GetNx()); z.Fill(gr->Min.z,gr->Min.z); + mgl_textmarkw_xyzr(gr,&x,y,&z,r,text,fnt,0); +} +//----------------------------------------------------------------------------- +void mgl_textmarkw(HMGL gr, HCDT y, const wchar_t *text, const char *fnt, const char *opt) +{ + if(y->GetNx()<2) { gr->SetWarn(mglWarnLow,"TextMark"); return; } + gr->SaveState(opt); + mglData r(y->GetNx()); r.Fill(1,1); + mglData x(y->GetNx()); x.Fill(gr->Min.x,gr->Max.x); + mglData z(y->GetNx()); z.Fill(gr->Min.z,gr->Min.z); + mgl_textmarkw_xyzr(gr,&x,y,&z,&r,text,fnt,0); +} +//----------------------------------------------------------------------------- +void mgl_textmark_xyzr(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT r, const char *str, const char *fnt, const char *opt) +{ long s = strlen(str)+1; wchar_t *wcs = new wchar_t[s]; mbstowcs(wcs,str,s); + mgl_textmarkw_xyzr(gr, x, y, z, r, wcs, fnt, opt); delete []wcs; } +//----------------------------------------------------------------------------- +void mgl_textmark_xyr(HMGL gr, HCDT x, HCDT y, HCDT r, const char *str, const char *fnt, const char *opt) +{ long s = strlen(str)+1; wchar_t *wcs = new wchar_t[s]; mbstowcs(wcs,str,s); + mgl_textmarkw_xyr(gr, x, y, r, wcs, fnt, opt); delete []wcs; } +//----------------------------------------------------------------------------- +void mgl_textmark_yr(HMGL gr, HCDT y, HCDT r, const char *str, const char *fnt, const char *opt) +{ long s = strlen(str)+1; wchar_t *wcs = new wchar_t[s]; mbstowcs(wcs,str,s); + mgl_textmarkw_yr(gr, y, r, wcs, fnt, opt); delete []wcs; } +//----------------------------------------------------------------------------- +void mgl_textmark(HMGL gr, HCDT y, const char *str, const char *fnt, const char *opt) +{ long s = strlen(str)+1; wchar_t *wcs = new wchar_t[s]; mbstowcs(wcs,str,s); + mgl_textmarkw(gr, y, wcs, fnt, opt); delete []wcs; } +//----------------------------------------------------------------------------- +void mgl_textmark_xyzr_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *r, const char *text, const char *fnt, const char *opt, int l,int n,int lo) +{ wchar_t *s=new wchar_t[l+1]; memcpy(s,text,l); s[l]=0; + char *f=new char[n+1]; memcpy(f,fnt,n); f[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_textmarkw_xyzr(_GR_, _DA_(x),_DA_(y),_DA_(z),_DA_(r),s,f, o); + delete []o; delete []s; delete []f; } +//----------------------------------------------------------------------------- +void mgl_textmark_xyr_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *r, const char *text, const char *fnt, const char *opt, int l,int n,int lo) +{ wchar_t *s=new wchar_t[l+1]; memcpy(s,text,l); s[l]=0; + char *f=new char[n+1]; memcpy(f,fnt,n); f[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_textmarkw_xyr(_GR_, _DA_(x),_DA_(y),_DA_(r),s,f, o); + delete []o; delete []s; delete []f; } +//----------------------------------------------------------------------------- +void mgl_textmark_yr_(uintptr_t *gr, uintptr_t *y, uintptr_t *r, const char *text, const char *fnt, const char *opt, int l,int n,int lo) +{ wchar_t *s=new wchar_t[l+1]; memcpy(s,text,l); s[l]=0; + char *f=new char[n+1]; memcpy(f,fnt,n); f[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_textmarkw_yr(_GR_, _DA_(y),_DA_(r),s,f, o); delete []o; delete []s; delete []f; } +//----------------------------------------------------------------------------- +void mgl_textmark_(uintptr_t *gr, uintptr_t *y, const char *text, const char *fnt, const char *opt, int l,int n,int lo) +{ wchar_t *s=new wchar_t[l+1]; memcpy(s,text,l); s[l]=0; + char *f=new char[n+1]; memcpy(f,fnt,n); f[n]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_textmarkw(_GR_, _DA_(y),s,f, o); delete []o; delete []s; delete []f; } +//----------------------------------------------------------------------------- +// +// PutsFit series +// +//----------------------------------------------------------------------------- +extern char mglFitRes[1024]; ///< Last fitted formula +void mgl_puts_fit(HMGL gr, float x, float y, float z, const char *pre, const char *font, float size) +{ + long n = strlen(mglFitRes)+(pre?strlen(pre):0)+1; + char *buf = new char[n]; + if(pre) sprintf(buf,"%s%s",pre,mglFitRes); + else strcpy(buf,mglFitRes); + mgl_puts(gr,x,y,z,buf,font,size); + delete []buf; +} +void mgl_puts_fit_(uintptr_t* gr, mreal *x, mreal *y, mreal *z, const char *prefix, const char *font, mreal *size, int l, int n) +{ + char *s=new char[l+1]; memcpy(s,prefix,l); s[l]=0; + char *d=new char[n+1]; memcpy(d,font,n); d[n]=0; + mgl_puts_fit(_GR_, *x,*y,*z, s, d, *size); + delete []s; delete []d; +} +//----------------------------------------------------------------------------- diff --git a/src/surf.cpp b/src/surf.cpp new file mode 100644 index 0000000..01abaf5 --- /dev/null +++ b/src/surf.cpp @@ -0,0 +1,917 @@ +/*************************************************************************** + * surf.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * 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" +//----------------------------------------------------------------------------- +void mgl_mesh_plot(mglBase *gr, long *pos, long n, long m, int how) +{ + int d = gr->MeshNum>0 ? gr->MeshNum+1 : 1; + register long i,j; + if(how&1) for(j=0;jline_plot(pos[n*j+i],pos[n*j+i+1]); + if(how&2) for(j=0;jline_plot(pos[n*j+i],pos[n*j+i+n]); +} +//----------------------------------------------------------------------------- +void mgl_surf_plot(mglBase *gr, long *pos, long n, long m) +{ + register long i,j; + for(j=0;jquad_plot(pos[n*j+i],pos[n*j+i+1],pos[n*j+i+n],pos[n*j+i+n+1]); +} +//----------------------------------------------------------------------------- +// +// Plot by formulas series +// +//----------------------------------------------------------------------------- +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); + mglData z(n,n); + mglFormula *eq = new mglFormula(eqZ); + register int i,j; + float dx = (gr->Max.x - gr->Min.x)/(n-1.), dy = (gr->Max.y - gr->Min.y)/(n-1.); + for(j=0;jCalc(gr->Min.x+i*dx, gr->Min.y+j*dy); + mgl_surf(gr, &z, sch,0); + delete eq; +} +//----------------------------------------------------------------------------- +void mgl_fsurf_xyz(HMGL gr, const char *eqX, const char *eqY, 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); + mglData x(n,n), y(n,n), z(n,n); + if(n<=0) n=100; + mglFormula *ex, *ey, *ez; + ex = new mglFormula(eqX ? eqX : "u"); + ey = new mglFormula(eqY ? eqY : "v"); + ez = new mglFormula(eqZ); + register int i,j; + register float u,v; + for(j=0;jCalc(0,v,0,u); + y.a[i+n*j] = ey->Calc(0,v,0,u); + z.a[i+n*j] = ez->Calc(0,v,0,u); + } + mgl_surf_xy(gr,&x,&y,&z,sch,0); + delete ex; delete ey; delete ez; +} +//----------------------------------------------------------------------------- +void mgl_fsurf_(uintptr_t *gr, const char *fy, const char *stl, const char *opt, int ly, int ls, int lo) +{ char *s=new char[ly+1]; memcpy(s,fy,ly); s[ly]=0; + char *p=new char[ls+1]; memcpy(p,stl,ls); p[ls]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_fsurf(_GR_, s, p, o); delete []o; delete []s; delete []p; } +//----------------------------------------------------------------------------- +void mgl_fsurf_xyz_(uintptr_t *gr, const char *fx, const char *fy, const char *fz, const char *stl, const char *opt, int lx, int ly, int lz, int ls, int lo) +{ + char *sx=new char[lx+1]; memcpy(sx,fx,lx); sx[lx]=0; + char *sy=new char[ly+1]; memcpy(sy,fy,ly); sy[ly]=0; + char *sz=new char[lz+1]; memcpy(sz,fz,lz); sz[lz]=0; + char *p=new char[ls+1]; memcpy(p,stl,ls); p[ls]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_fsurf_xyz(_GR_, sx, sy, sz, p, o); delete []o; + delete []sx; delete []sy; delete []sz; delete []p; +} +//----------------------------------------------------------------------------- +// +// Mesh series +// +//----------------------------------------------------------------------------- +void mgl_mesh_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ + register long i,j,k,n=z->GetNx(),m=z->GetNy(); + if(x->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Mesh"); return; } + if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"Mesh"); return; } + if(y->GetNx()!=m && (x->GetNy()!=m || y->GetNx()!=n || y->GetNy()!=m)) + { gr->SetWarn(mglWarnDim); return; }; + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Mesh",cgid++); + gr->SetPenPal("-"); + long ss = gr->AddTexture(sch); + long *pos = new long[n*m]; + gr->Reserve(n*m*z->GetNz()); + + mglPoint p; + float c; + for(k=0;kGetNz();k++) + { + for(j=0;jv(i,j,k)); + c = gr->GetC(ss,p.z); pos[i+n*j] = gr->AddPnt(p,c); + } + mgl_mesh_plot(gr,pos,n,m,3); + } + delete []pos; gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_mesh(HMGL gr, HCDT z, const char *sch, const char *opt) +{ + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Mesh"); return; } + gr->SaveState(opt); + mglData x(z->GetNx()), y(z->GetNy()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_mesh_xy(gr,&x,&y,z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_mesh_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_mesh_xy(_GR_, _DA_(x), _DA_(y), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_mesh_(uintptr_t *gr, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_mesh(_GR_, _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Fall series +// +//----------------------------------------------------------------------------- +void mgl_fall_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ + register long i,j,k,n=z->GetNx(),m=z->GetNy(); + if(x->GetNx()!=z->GetNx()) { gr->SetWarn(mglWarnDim,"Fall"); return; } + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Fall"); return; } + if(y->GetNx()!=z->GetNy() && (x->GetNy()!=z->GetNy() || y->GetNx()!=z->GetNx() || y->GetNy()!=z->GetNy())) + { gr->SetWarn(mglWarnDim); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Fall",cgid++); + gr->SetPenPal("-"); + long ss = gr->AddTexture(sch); + long *pos = new long[n*m]; + gr->Reserve(n*m*z->GetNz()); + + mglPoint p; + float c; + for(k=0;kGetNz();k++) + { + for(j=0;jv(i,j,k)); + c = gr->GetC(ss,p.z); pos[i+n*j] = gr->AddPnt(p,c); + } + mgl_mesh_plot(gr,pos,n,m, (sch && strchr(sch,'x')) ? 2:1); + } + delete []pos; gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_fall(HMGL gr, HCDT z, const char *sch, const char *opt) +{ + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Fall"); return; } + gr->SaveState(opt); + mglData x(z->GetNx()), y(z->GetNy()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_fall_xy(gr,&x,&y,z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_fall_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_fall_xy(_GR_, _DA_(x), _DA_(y), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_fall_(uintptr_t *gr, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_fall(_GR_, _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Grid series +// +//----------------------------------------------------------------------------- +void mgl_grid_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ + register long i,j,k,n=z->GetNx(),m=z->GetNy(); + if(x->GetNx()!=z->GetNx()) { gr->SetWarn(mglWarnDim,"Grid"); return; } + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Grid"); return; } + if(y->GetNx()!=z->GetNy() && (x->GetNy()!=z->GetNy() || y->GetNx()!=z->GetNx() || y->GetNy()!=z->GetNy())) + { gr->SetWarn(mglWarnDim); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Grid",cgid++); + float zVal = gr->Min.z; + gr->SetPenPal(sch?sch:"k-"); + long *pos = new long[n*m]; + gr->Reserve(n*m*z->GetNz()); + + mglPoint p; + for(k=0;kGetNz();k++) + { + if(z->GetNz()>1) zVal = gr->Min.z+(gr->Max.z-gr->Min.z)*float(k)/(z->GetNz()-1); + for(j=0;jAddPnt(p,gr->CDef); + } + mgl_mesh_plot(gr,pos,n,m,3); + } + delete []pos; gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_grid(HMGL gr, HCDT z,const char *sch, const char *opt) +{ + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Grid"); return; } + gr->SaveState(opt); + mglData x(z->GetNx()), y(z->GetNy()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_grid_xy(gr,&x,&y,z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_grid_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_grid_xy(_GR_,_DA_(x), _DA_(y), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_grid_(uintptr_t *gr, uintptr_t *a,const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_grid(_GR_, _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Surf series +// +//----------------------------------------------------------------------------- +void mgl_surf_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ + register long i,j,k,n=z->GetNx(),m=z->GetNy(); + if(x->GetNx()!=n) { gr->SetWarn(mglWarnDim,"Surf"); return; } + if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"Surf"); return; } + if(y->GetNx()!=m && (x->GetNy()!=m || y->GetNx()!=n || y->GetNy()!=m)) + { gr->SetWarn(mglWarnDim); return; }; + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Surf",cgid++); + long ss = gr->AddTexture(sch); + long *pos = new long[n*m]; + bool wire = (sch && strchr(sch,'#')); + gr->Reserve(n*m*z->GetNz()*(wire?2:1)); + + mglPoint p,q,s,xx,yy; + float c; + for(k=0;kGetNz();k++) + { + for(j=0;jv(i,j,k)); + q = mglPoint(xx.y, yy.y, z->dvx(i,j,k)); + s = mglPoint(xx.z, yy.z, z->dvy(i,j,k)); + c = gr->GetC(ss,p.z); + pos[i+n*j] = gr->AddPnt(p,c,q^s); + } + mgl_surf_plot(gr,pos,n,m); + if(wire) + { + gr->SetPenPal("k-"); + for(i=0;iCopyNtoC(pos[i],gr->CDef); + mgl_mesh_plot(gr,pos,n,m,3); + } + } + delete []pos; gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_surf(HMGL gr, HCDT z, const char *sch, const char *opt) +{ + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Surf"); return; } + gr->SaveState(opt); + mglData x(z->GetNx()), y(z->GetNy()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_surf_xy(gr,&x,&y,z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_surf_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surf_xy(_GR_, _DA_(x), _DA_(y), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_surf_(uintptr_t *gr, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surf(_GR_, _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Belt series +// +//----------------------------------------------------------------------------- +void mgl_belt_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ + register long i,j,k,n=z->GetNx(),m=z->GetNy(); + if(x->GetNx()!=z->GetNx()) { gr->SetWarn(mglWarnDim,"Belt"); return; } + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Belt"); return; } + if(y->GetNx()!=z->GetNy() && (x->GetNy()!=z->GetNy() || y->GetNx()!=z->GetNx() || y->GetNy()!=z->GetNy())) + { gr->SetWarn(mglWarnDim); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Belt",cgid++); + + long ss = gr->AddTexture(sch); + long *pos = new long[2*(n>m?n:m)]; + gr->Reserve(2*n*m*z->GetNz()); + bool how = !(sch && strchr(sch,'x')); + + mglPoint p1,p2,q,s,xx,yy; + float c; + for(k=0;kGetNz();k++) + { + if(how) for(i=0;iv(i,j,k)); + s = mglPoint(xx.z, yy.z, z->dvy(i,j,k)); + q = mglPoint(xx.y, yy.y, 0); s = q^s; + c = gr->GetC(ss,p1.z); + p2 = mglPoint(GetX(x,i+1,j,k).x,GetY(y,i+1,j,k).x,p1.z); + pos[2*j] = gr->AddPnt(p1,c,s); + pos[2*j+1]=gr->AddPnt(p2,c,s); + } + mgl_surf_plot(gr,pos,2,m); + } + else for(j=0;jv(i,j,k)); + q = mglPoint(xx.y, yy.y, z->dvx(i,j,k)); + s = mglPoint(xx.z, yy.z, 0); s = q^s; + c = gr->GetC(ss,p1.z); + p2 = mglPoint(GetX(x,i,j+1,k).x,GetY(y,i,j+1,k).x,p1.z); + pos[2*i] = gr->AddPnt(p1,c,s); + pos[2*i+1]=gr->AddPnt(p2,c,s); + } + mgl_surf_plot(gr,pos,2,n); + } + } + delete []pos; gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_belt(HMGL gr, HCDT z, const char *sch, const char *opt) +{ + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Belt"); return; } + gr->SaveState(opt); + mglData x(z->GetNx()), y(z->GetNy()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_belt_xy(gr,&x,&y,z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_belt_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_belt_xy(_GR_, _DA_(x), _DA_(y), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_belt_(uintptr_t *gr, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_belt(_GR_, _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Dens series +// +//----------------------------------------------------------------------------- +void mgl_dens_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ + register long i,j,k,n=z->GetNx(),m=z->GetNy(); + if(x->GetNx()!=z->GetNx()) { gr->SetWarn(mglWarnDim,"Dens"); return; } + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Dens"); return; } + if(y->GetNx()!=z->GetNy() && (x->GetNy()!=z->GetNy() || y->GetNx()!=z->GetNx() || y->GetNy()!=z->GetNy())) + { gr->SetWarn(mglWarnDim); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Dens",cgid++); + float zVal = gr->Min.z; + + long ss = gr->AddTexture(sch); + long *pos = new long[n*m]; + gr->Reserve(n*m*z->GetNz()); + + mglPoint p,s=mglPoint(0,0,1); + float zz, c; + for(k=0;kGetNz();k++) + { + if(z->GetNz()>1) + zVal = gr->Min.z+(gr->Max.z-gr->Min.z)*float(k)/(z->GetNz()-1); + for(j=0;jv(i,j,k); c = gr->GetC(ss,zz); + if(isnan(zz)) p.x = NAN; + pos[i+n*j] = gr->AddPnt(p,c,s); + } + mgl_surf_plot(gr,pos,n,m); + if(sch && strchr(sch,'#')) + { + gr->Reserve(n*m); gr->SetPenPal("k-"); + for(i=0;iCopyNtoC(pos[i],gr->CDef); + mgl_mesh_plot(gr,pos,n,m,3); + } + } + delete []pos; gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_dens(HMGL gr, HCDT z, const char *sch, const char *opt) +{ + gr->SaveState(opt); + mglData x(z->GetNx()), y(z->GetNy()); + x.Fill(gr->Min.x, gr->Max.x); + y.Fill(gr->Min.y, gr->Max.y); + mgl_dens_xy(gr,&x,&y,z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_dens_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_dens_xy(_GR_,_DA_(x), _DA_(y), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_dens_(uintptr_t *gr, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_dens(_GR_,_DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// STFA series +// +//----------------------------------------------------------------------------- +void mgl_stfa_xy(HMGL gr, HCDT x, HCDT y, HCDT re, HCDT im, int dn, const char *sch, const char *opt) +{ mglData tmp(mglSTFA(*re,*im,dn,'x')); mgl_dens_xy(gr,x,y,&tmp,sch,opt); } +//----------------------------------------------------------------------------- +void mgl_stfa(HMGL gr, HCDT re, HCDT im, int dn, const char *sch, const char *opt) +{ mglData tmp(mglSTFA(*re,*im,dn,'x')); mgl_dens(gr,&tmp,sch,opt); } +//----------------------------------------------------------------------------- +void mgl_stfa_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *re, uintptr_t *im, int *dn, const char *sch, const char *opt, int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_stfa_xy(_GR_,_DA_(x), _DA_(y), _DA_(re), _DA_(im), *dn, s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_stfa_(uintptr_t *gr, uintptr_t *re, uintptr_t *im, int *dn, const char *sch, const char *opt, int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_stfa(_GR_,_DA_(re), _DA_(im), *dn, s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// SurfC series +// +//----------------------------------------------------------------------------- +void mgl_surfc_xy(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT c, const char *sch, const char *opt) +{ + register long i,j,k,n=z->GetNx(),m=z->GetNy(); + if(x->GetNx()!=z->GetNx()) { gr->SetWarn(mglWarnDim,"SurfC"); return; } + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"SurfC"); return; } + if(z->GetNx()*z->GetNy()*z->GetNz()!=c->GetNx()*c->GetNy()*c->GetNz()) + { gr->SetWarn(mglWarnDim); return; } + if(y->GetNx()!=z->GetNy() && (x->GetNy()!=z->GetNy() || y->GetNx()!=z->GetNx() || y->GetNy()!=z->GetNy())) + { gr->SetWarn(mglWarnDim); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("SurfC",cgid++); + + long ss = gr->AddTexture(sch); + long *pos = new long[n*m]; + gr->Reserve(n*m*z->GetNz()); + float col; + + mglPoint p,q,s,xx,yy; + for(k=0;kGetNz();k++) + { + for(j=0;jv(i,j,k)); + q = mglPoint(xx.y, yy.y, z->dvx(i,j,k)); + s = mglPoint(xx.z, yy.z, z->dvy(i,j,k)); + col = gr->GetC(ss,c->v(i,j,k)); + pos[i+n*j] = gr->AddPnt(p,col,q^s); + } + mgl_surf_plot(gr,pos,n,m); + if(sch && strchr(sch,'#')) + { + gr->Reserve(n*m); gr->SetPenPal("k-"); + for(i=0;iCopyNtoC(pos[i],gr->CDef); + mgl_mesh_plot(gr,pos,n,m,3); + } + } + delete []pos; gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_surfc(HMGL gr, HCDT z, HCDT c, const char *sch, const char *opt) +{ + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"SurfC"); return; } + gr->SaveState(opt); + mglData x(z->GetNx()), y(z->GetNy()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_surfc_xy(gr,&x,&y,z,c,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_surfc_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surfc_xy(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_surfc_(uintptr_t *gr, uintptr_t *z, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surfc(_GR_, _DA_(z), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// SurfA series +// +//----------------------------------------------------------------------------- +void mgl_surfa_xy(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT c, const char *sch, const char *opt) +{ + register long i,j; + long k,n=z->GetNx(),m=z->GetNy(); + if(x->GetNx()!=z->GetNx()) { gr->SetWarn(mglWarnDim,"SurfA"); return; } + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"SurfA"); return; } + if(z->GetNx()*z->GetNy()*z->GetNz()!=c->GetNx()*c->GetNy()*c->GetNz()) + { gr->SetWarn(mglWarnDim); return; } + if(y->GetNx()!=z->GetNy() && (x->GetNy()!=z->GetNy() || y->GetNx()!=z->GetNx() || y->GetNy()!=z->GetNy())) + { gr->SetWarn(mglWarnDim); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("SurfA",cgid++); + + long ss = gr->AddTexture(sch); + long *pos = new long[n*m]; + gr->Reserve(n*m*z->GetNz()); + + mglPoint p,q,s,xx,yy; + for(k=0;kGetNz();k++) + { + for(j=0;jv(i,j,k)); + q = mglPoint(xx.y, yy.y, z->dvx(i,j,k)); + s = mglPoint(xx.z, yy.z, z->dvy(i,j,k)); + pos[i+n*j] = gr->AddPnt(p,gr->GetC(ss,z->v(i,j,k)),q^s,gr->GetA(c->v(i,j,k))); + } + mgl_surf_plot(gr,pos,n,m); + if(sch && strchr(sch,'#')) + { + gr->Reserve(n*m); gr->SetPenPal("k-"); + for(i=0;iCopyNtoC(pos[i],gr->CDef); + mgl_mesh_plot(gr,pos,n,m,3); + } + } + delete []pos; gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_surfa(HMGL gr, HCDT z, HCDT c, const char *sch, const char *opt) +{ + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"SurfC"); return; } + mglData x(z->GetNx()), y(z->GetNy()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + gr->SaveState(opt); + mgl_surfa_xy(gr,&x,&y,z,c,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_surfa_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surfa_xy(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_surfa_(uintptr_t *gr, uintptr_t *z, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surfa(_GR_, _DA_(z), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Boxs series +// +//----------------------------------------------------------------------------- +void mgl_boxs_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ + register long i,j,k,n=z->GetNx(),m=z->GetNy(); + if(x->GetNx()GetNx()) { gr->SetWarn(mglWarnDim,"Boxs"); return; } + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Boxs"); return; } + long ly = x->GetNy()>=z->GetNy() ? y->GetNy() : y->GetNx(), lx = x->GetNx(); + + if(y->GetNx()GetNy() && (x->GetNy()GetNy() || y->GetNx()GetNx() || y->GetNy()GetNy())) + { gr->SetWarn(mglWarnDim); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Boxs",cgid++); + + long ss = gr->AddTexture(sch); + bool wire = sch && strchr(sch,'#'); + bool full = sch && strchr(sch,'@'); + gr->Reserve(8*n*m*z->GetNz()); + + mglPoint p1,p2,p3,p4,q,s,t(wire||full?NAN:0,0,1),xx,yy; + float zz,z1,z2,x1,y1,c,z0=gr->GetOrgZ('x'); + long k1,k2,k3,k4,k5,k6,k7,k8; + for(k=0;kGetNz();k++) + { + for(i=0;iv(i,j,k); c = gr->GetC(ss,zz); + xx = GetX(x,i,j,k); yy = GetY(y,i,j,k); + x1 = iv(i+1,j,k):NAN; + z2 = jv(i,j+1,k):NAN; + q = mglPoint(xx.y,yy.y,0); + s = mglPoint(xx.z,yy.z,0); + p1 = mglPoint(xx.x,yy.x,zz); k1 = gr->AddPnt(p1,c,t); + p2 = mglPoint(x1,yy.x,zz); k2 = gr->AddPnt(p2,c,t); + p3 = mglPoint(xx.x,y1,zz); k3 = gr->AddPnt(p3,c,t); + p4 = mglPoint(x1,y1,zz); k4 = gr->AddPnt(p4,c,t); + if(wire) + { + gr->line_plot(k1,k2); gr->line_plot(k1,k3); + gr->line_plot(k4,k2); gr->line_plot(k4,k3); + } + else gr->quad_plot(k1,k2,k3,k4); + + if(full) + { + p1 = mglPoint(xx.x,yy.x,z0); k5 = gr->AddPnt(p1,c,t); + p2 = mglPoint(x1,yy.x,z0); k6 = gr->AddPnt(p2,c,t); + p3 = mglPoint(xx.x,y1,z0); k7 = gr->AddPnt(p3,c,t); + p4 = mglPoint(x1,y1,z0); k8 = gr->AddPnt(p4,c,t); + if(wire) + { + gr->line_plot(k5,k6); gr->line_plot(k5,k7); + gr->line_plot(k8,k6); gr->line_plot(k8,k7); + gr->line_plot(k1,k5); gr->line_plot(k3,k7); + gr->line_plot(k2,k6); gr->line_plot(k4,k8); + } + else + { + gr->quad_plot(k1,k2,k5,k6); gr->quad_plot(k1,k3,k5,k7); + gr->quad_plot(k4,k2,k8,k6); gr->quad_plot(k4,k3,k8,k7); + gr->quad_plot(k5,k6,k7,k8); + } + } + else + { + p3 = mglPoint(x1,yy.x,z1); k5 = gr->AddPnt(p3,c,wire?t:q); + p4 = mglPoint(x1,y1,z1); k6 = gr->AddPnt(p4,c,wire?t:q); + if(wire) + { gr->line_plot(k2,k5); gr->line_plot(k6,k5); gr->line_plot(k6,k4); } + else gr->quad_plot(k2,k4,k5,k6); + p3 = mglPoint(xx.x,y1,z2); k7 = gr->AddPnt(p3,c,wire?t:s); + p4 = mglPoint(x1,y1,z2); k8 = gr->AddPnt(p4,c,wire?t:s); + if(wire) + { gr->line_plot(k3,k7); gr->line_plot(k4,k8); gr->line_plot(k7,k8); } + else gr->quad_plot(k3,k4,k7,k8); + } + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_boxs(HMGL gr, HCDT z, const char *sch, const char *opt) +{ + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Boxs"); return; } + gr->SaveState(opt); + mglData x(z->GetNx()+1), y(z->GetNy()+1); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_boxs_xy(gr,&x,&y,z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_boxs_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_boxs_xy(_GR_, _DA_(x), _DA_(y), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_boxs_(uintptr_t *gr, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_boxs(_GR_, _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Tile series +// +//----------------------------------------------------------------------------- +void mgl_tile_xy(HMGL gr, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +{ + register long i,j,k,n=z->GetNx(),m=z->GetNy(); + if(x->GetNx()GetNx()) { gr->SetWarn(mglWarnDim,"Tile"); return; } + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Tile"); return; } + long ly = x->GetNy()>=z->GetNy() ? y->GetNy() : y->GetNx(), lx = x->GetNx(); + if(y->GetNx()GetNy() && (x->GetNy()GetNy() || y->GetNx()GetNx() || y->GetNy()GetNy())) + { gr->SetWarn(mglWarnDim); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Tile",cgid++); + + long ss = gr->AddTexture(sch); + gr->Reserve(4*n*m*z->GetNz()); + + mglPoint p1,p2,p3,p4,s=mglPoint(0,0,1); + float zz,x1,x2,y1,y2,c; + long k1,k2,k3,k4; + for(k=0;kGetNz();k++) + { + for(j=0;jv(i,j,k); c = gr->GetC(ss,zz); + x1 = GetX(x,i,j,k).x; y1 = GetY(y,i,j,k).x; + x2 = iAddPnt(p1,c,s); + p2 = mglPoint(x2,y1,zz); k2 = gr->AddPnt(p2,c,s); + p3 = mglPoint(x1,y2,zz); k3 = gr->AddPnt(p3,c,s); + p4 = mglPoint(x2,y2,zz); k4 = gr->AddPnt(p4,c,s); + gr->quad_plot(k1,k2,k3,k4); + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_tile(HMGL gr, HCDT z, const char *sch, const char *opt) +{ + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Tile"); return; } + gr->SaveState(opt); + mglData x(z->GetNx()+1), y(z->GetNy()+1); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_tile_xy(gr,&x,&y,z,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_tile_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tile_xy(_GR_, _DA_(x), _DA_(y), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_tile_(uintptr_t *gr, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tile(_GR_, _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_tiles_xy(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT s, const char *sch, const char *opt) +{ + register long i,j,k,n=z->GetNx(),m=z->GetNy(); + if(x->GetNx()!=z->GetNx() || s->GetNx()*s->GetNy()*s->GetNz()!=z->GetNx()*z->GetNy()*z->GetNz()) + { gr->SetWarn(mglWarnDim,"Tile"); return; } + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Tile"); return; } + long ly = x->GetNy()>=z->GetNy() ? y->GetNy() : y->GetNx(), lx = x->GetNx(); + if(y->GetNx()GetNy() && (x->GetNy()GetNy() || y->GetNx()GetNx() || y->GetNy()GetNy())) + { gr->SetWarn(mglWarnDim); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("TileS",cgid++); + + long cc = gr->AddTexture(sch); + gr->Reserve(4*n*m*z->GetNz()); + + mglPoint p1,p2,p3,p4,t=mglPoint(0,0,1); + float zz,x1,x2,x3,x4,y1,y2,y3,y4,ss,sm,c; + long k1,k2,k3,k4; + for(k=0;kGetNz();k++) + { + for(j=0;jv(i,j,k); c = gr->GetC(cc,zz); + // TODO check it!!! + ss = (1-gr->GetA(s->v(i,j,k)))/2; sm = 1-ss; + + x1 = GetX(x,i,j,k).x; y1 = GetY(y,i,j,k).x; + x2 = x3 = x4 = y2 = y3 = y4 = NAN; + if(iAddPnt(p1,c,t); + p2 = mglPoint(x1+x2*sm+x4*ss+x3*ss*sm, y1+y2*sm+y4*ss+y3*ss*sm, zz); + k2 = gr->AddPnt(p2,c,t); + p3 = mglPoint(x1+x2*ss+x4*sm+x3*ss*sm, y1+y2*ss+y4*sm+y3*ss*sm, zz); + k3 = gr->AddPnt(p3,c,t); + p4 = mglPoint(x1+x2*sm+x4*sm+x3*sm*sm, y1+y2*sm+y4*sm+y3*sm*sm, zz); + k4 = gr->AddPnt(p4,c,t); + gr->quad_plot(k1,k2,k3,k4); + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_tiles(HMGL gr, HCDT z, HCDT s, const char *sch, const char *opt) +{ + if(z->GetNx()<2 || z->GetNy()<2){ gr->SetWarn(mglWarnLow,"Tile"); return; } + gr->SaveState(opt); + mglData x(z->GetNx()+1), y(z->GetNy()+1); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_tiles_xy(gr,&x,&y,z,s,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_tiles_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, uintptr_t *r, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tiles_xy(_GR_, _DA_(x), _DA_(y), _DA_(a), _DA_(r), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_tiles_(uintptr_t *gr, uintptr_t *a, uintptr_t *r, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_tiles(_GR_, _DA_(a), _DA_(r), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Map series +// +//----------------------------------------------------------------------------- +void mgl_map_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt) +{ + register long i,j,n=ax->GetNx(),m=ax->GetNy(); + if(n*m!=ay->GetNx()*ay->GetNy()) { gr->SetWarn(mglWarnDim,"Map"); return; } + if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"Map"); return; } + 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,"Map"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Map",cgid++); + + long ss = gr->AddTexture((sch && *sch)?sch:"rgb",2); + long s = both ? n:1, s1, s2; + + float xdy,xdx,ydx,ydy,xx,yy; + mglPoint p,t=mglPoint(NAN); + long *pos = new long[n*m]; + gr->Reserve(n*m); + + for(j=0;j0 ? 1:0; s2 = iv(i+s2,j)-ax->v(i-s1,j))/(GetX(x,i+s2,j).x-GetX(x,i-s1,j).x); + ydx = (ay->v(i+s2,j)-ay->v(i-s1,j))/(GetX(x,i+s2,j).x-GetX(x,i-s1,j).x); + s1 = j>0 ? s:0; s2 = jv(i,j+s2)-ax->v(i,j-s1))/(GetY(y,i,j+s2).x-GetY(y,i,j-s1).x); + ydy = (ay->v(i,j+s2)-ay->v(i,j-s1))/(GetY(y,i,j+s2).x-GetY(y,i,j-s1).x); + xdx = xdx*ydy - xdy*ydx; // Jacobian + + p = mglPoint(ax->v(i,j), ay->v(i,j), xdx); + if(both) + { + xx = (x->v(i,j) - gr->Min.x)/(gr->Max.x - gr->Min.x); + yy = (y->v(i,j) - gr->Min.y)/(gr->Max.y - gr->Min.y); + } + else + { + xx = (x->v(i) - gr->Min.x)/(gr->Max.x - gr->Min.x); + yy = (y->v(j) - gr->Min.y)/(gr->Max.y - gr->Min.y); + } + if(xx<0) xx=0; if(xx>=1) xx=1/MGL_FLT_EPS; + if(yy<0) yy=0; if(yy>=1) yy=1/MGL_FLT_EPS; + pos[i+n*j] = gr->AddPnt(p,gr->GetC(ss,xx,false),t,yy); + } + if(sch && strchr(sch,'.')) for(i=0;imark_plot(pos[i],'.',-1); + else mgl_surf_plot(gr,pos,n,m); + delete []pos; gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_map(HMGL gr, HCDT ax, HCDT ay, const char *sch, const char *opt) +{ + if(ax->GetNx()<2 || ax->GetNy()<2) { gr->SetWarn(mglWarnLow,"Map"); return; } + gr->SaveState(opt); + mglData x(ax->GetNx()), y(ax->GetNy()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_map_xy(gr,&x,&y,ax,ay,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_map_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_map_xy(_GR_, _DA_(x), _DA_(y), _DA_(a), _DA_(b), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_map_(uintptr_t *gr, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_map(_GR_, _DA_(a), _DA_(b), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- diff --git a/mgl/mgl_tex_table.cpp b/src/tex_table.cpp similarity index 99% rename from mgl/mgl_tex_table.cpp rename to src/tex_table.cpp index 75ca877..190db63 100644 --- a/mgl/mgl_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/mgl_font.h" +#include "mgl/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 new file mode 100644 index 0000000..44fab1b --- /dev/null +++ b/src/vect.cpp @@ -0,0 +1,1067 @@ +/*************************************************************************** + * vect.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * 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 +//----------------------------------------------------------------------------- +// +// Traj series +// +//----------------------------------------------------------------------------- +void mgl_traj_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt) +{ + long m,mx,my,mz,nx,ny,nz,n=ax->GetNx(),pal; + 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; //isnan(gr->PrevValue()) ? 0:gr->PrevValue(); + static int cgid=1; gr->StartGroup("Traj",cgid++); + + register long i, j; + // find maximum + i = ax->GetNy()>ay->GetNy() ? ax->GetNy():ay->GetNy(); j = z->GetNy()>az->GetNy() ? z->GetNy():az->GetNy(); + m = x->GetNy()>y->GetNy() ? x->GetNy():y->GetNy(); if(i>m) m=i; if(j>m) m=j; + gr->SetPenPal(sch,&pal); gr->Reserve(4*n*m); + + float dx,dy,dz,dd,da,xm=0; + mglPoint p1,p2; + for(j=0;jGetNy() ? j:0; my = jGetNy() ? j:0; mz = jGetNy() ? j:0; + da = sqrt(ax->v(i,mx)*ax->v(i,mx)+ay->v(i,my)*ay->v(i,my)+az->v(i,mz)*az->v(i,mz)); + xm = xm>da ? xm : da; + } + xm = 1./(xm ? sqrt(xm):1); + for(j=0;jNextColor(pal); + for(i=0;iGetNy() ? j:0; ny = jGetNy() ? j:0; nz = jGetNy() ? j:0; + mx = jGetNy() ? j:0; my = jGetNy() ? j:0; mz = jGetNy() ? j:0; + da = sqrt(ax->v(i,mx)*ax->v(i,mx)+ay->v(i,my)*ay->v(i,my)+az->v(i,mz)*az->v(i,mz)); + if(len==0) + { + if(iv(i+1,nx)-x->v(i,nx); dy=y->v(i+1,ny)-y->v(i,ny); dz=z->v(i+1,nz)-z->v(i,nz); } + else + { dx=x->v(i,nx)-x->v(i-1,nx); dy=y->v(i,ny)-y->v(i-1,ny); dz=z->v(i,nz)-z->v(i-1,nz); } + dd = da ? 1/da : 0; dd *= sqrt(dx*dx+dy*dy+dz*dz); + } + else dd = len; + + p1 = mglPoint(x->v(i,nx), y->v(i,ny), z->v(i,nz)); + p2 = mglPoint(x->v(i,nx)+dd*ax->v(i,mx), y->v(i,ny)+dd*ay->v(i,my), z->v(i,nz)+dd*az->v(i,mz)); + nx = gr->AddPnt(p1); ny = gr->AddPnt(p2); + gr->vect_plot(nx,ny); + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_traj_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt) +{ + if(ax->GetNx()<2) { gr->SetWarn(mglWarnLow,"Traj"); return; } + if(x->GetNx()!=ax->GetNx() || y->GetNx()!=ax->GetNx() || ay->GetNx()!=ax->GetNx()) + { gr->SetWarn(mglWarnDim,"Traj"); return; } + gr->SaveState(opt); + mglData z(x->GetNx()), az(x->GetNx()); z.Fill(gr->Min.z,gr->Min.z); + mgl_traj_xyz(gr,x,y,&z,ax,ay,&az,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_traj_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_traj_xy(_GR_, _DA_(x), _DA_(y), _DA_(ax), _DA_(ay), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_traj_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_traj_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(ax), _DA_(ay), _DA_(az), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Vect series +// +//----------------------------------------------------------------------------- +void mgl_vect_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt) +{ + long i,j,n=ax->GetNx(),m=ax->GetNy(),k; + if(n*m*ax->GetNz()!=ay->GetNx()*ay->GetNy()*ay->GetNz()) { gr->SetWarn(mglWarnDim,"Vect"); return; } + if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"Vect"); return; } + 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,"Vect"); return; } + float r = gr->SaveState(opt); + long flag = isnan(r) ? 0:long(r+0.5); + static int cgid=1; gr->StartGroup("Vect",cgid++); + + long ss = gr->AddTexture(sch); + gr->Reserve(4*n*m); + float zVal = gr->Min.z; + + long tx=1,ty=1; + if(gr->MeshNum>1) { tx=(n-1)/(gr->MeshNum-1); ty=(m-1)/(gr->MeshNum-1); } + if(tx<1) tx=1; if(ty<1) ty=1; + float xm=0,ym,dx,dy; + float dd,dm=(fabs(gr->Max.c)+fabs(gr->Min.c))*1e-5; + + for(k=0;kGetNz();k++) for(j=0;jv(i,j,k)*ax->v(i,j,k)+ay->v(i,j,k)*ay->v(i,j,k); + xm = xm>ym ? xm : ym; + } + xm = 1./(xm==0 ? 1:sqrt(xm)); + long n1,n2; + mglPoint p1,p2; + float c1,c2, xx,yy; + + for(k=0;kGetNz();k++) + { + if(ax->GetNz()>1) zVal = gr->Min.z+(gr->Max.z-gr->Min.z)*float(k)/(ax->GetNz()-1); + for(i=0;iv(i,j,k),ay->v(i,j,k)); + dx *= (flag&MGL_VEC_LEN) ? (dd>dm ? ax->v(i,j,k)/dd : 0) : ax->v(i,j,k)*xm; + dy *= (flag&MGL_VEC_LEN) ? (dd>dm ? ay->v(i,j,k)/dd : 0) : ay->v(i,j,k)*xm; + + if(flag & MGL_VEC_END) + { p1 = mglPoint(xx-dx,yy-dy,zVal); p2 = mglPoint(xx,yy,zVal); } + else if(flag & MGL_VEC_MID) + { p1=mglPoint(xx-dx/2,yy-dy/2,zVal); p2=mglPoint(xx+dx/2,yy+dy/2,zVal); } + else + { p1 = mglPoint(xx,yy,zVal); p2 = mglPoint(xx+dx,yy+dy,zVal); } + if(flag&MGL_VEC_COL) { c1 = c2 = ss; } else + { c1=gr->GetC(ss,dd*xm*1.5-1,false); c2=gr->GetC(ss,dd*xm*1.5-0.5,false);} + n1=gr->AddPnt(p1,c1); n2=gr->AddPnt(p2,c2); + if(flag & MGL_VEC_DOT) gr->line_plot(n1,n2); + else gr->vect_plot(n1,n2); + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_vect_2d(HMGL gr, HCDT ax, HCDT ay, const char *sch, const char *opt) +{ + gr->SaveState(opt); + mglData x(ax->GetNx()), y(ax->GetNy()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_vect_xy(gr,&x,&y,ax,ay,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_vect_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_vect_xy(_GR_, _DA_(x), _DA_(y), _DA_(ax), _DA_(ay), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_vect_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_vect_2d(_GR_, _DA_(ax), _DA_(ay), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Vect3 series +// +//----------------------------------------------------------------------------- +void mgl_vect_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt) +{ + register long i,j,n=ax->GetNx(),m=ax->GetNy(),l=ax->GetNz(),k; + if(n*m*l!=ay->GetNx()*ay->GetNy()*ay->GetNz() || ax->GetNx()*ax->GetNy()*ax->GetNz()!=az->GetNx()*az->GetNy()*az->GetNz()) + { gr->SetWarn(mglWarnDim,"Vect"); return; } + if(n<2 || m<2 || l<2) { gr->SetWarn(mglWarnLow,"Vect"); return; } + 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; } + float r = gr->SaveState(opt); + long flag = isnan(r) ? 0:long(r+0.5); + static int cgid=1; gr->StartGroup("Vect3",cgid++); + + float xm=0,ym,dx,dy,dz,dd,dm=(fabs(gr->Max.c)+fabs(gr->Min.c))*1e-5; + long ss = gr->AddTexture(sch); + gr->Reserve(2*n*m*l); + long tx=1,ty=1,tz=1; + if(gr->MeshNum>1) + { tx=(n-1)/(gr->MeshNum-1); ty=(m-1)/(gr->MeshNum-1); tz=(l-1)/(gr->MeshNum-1);} + if(tx<1) tx=1; if(ty<1) ty=1; if(tz<1) tz=1; + + for(k=0;kv(i,j,k)*ax->v(i,j,k)+ay->v(i,j,k)*ay->v(i,j,k)+az->v(i,j,k)*az->v(i,j,k); + xm = xm>ym ? xm : ym; + } + xm = 1./(xm==0 ? 1:sqrt(xm)); + + long n1,n2; + mglPoint p1,p2; + float c1,c2, xx,yy,zz; + + for(k=0;kv(i,j,k)*ax->v(i,j,k)+ay->v(i,j,k)*ay->v(i,j,k)+az->v(i,j,k)*az->v(i,j,k)); + dx *= (flag&MGL_VEC_LEN) ? (dd>dm ? ax->v(i,j,k)/dd : 0) : ax->v(i,j,k)*xm; + dy *= (flag&MGL_VEC_LEN) ? (dd>dm ? ay->v(i,j,k)/dd : 0) : ay->v(i,j,k)*xm; + dz *= (flag&MGL_VEC_LEN) ? (dd>dm ? az->v(i,j,k)/dd : 0) : az->v(i,j,k)*xm; + + if(flag & MGL_VEC_END) + { p1 = mglPoint(xx-dx,yy-dy,zz-dz); p2 = mglPoint(xx,yy,zz); } + else if(flag & MGL_VEC_MID) + { p1=mglPoint(xx-dx/2,yy-dy/2,zz-dz/2); p2=mglPoint(xx+dx/2,yy+dy/2,zz+dz/2); } + else + { p1 = mglPoint(xx,yy,zz); p2 = mglPoint(xx+dx,yy+dy,zz+dz); } + if(flag&MGL_VEC_COL) { c1 = c2 = ss; } else + { c1=gr->GetC(ss,dd*xm*1.5-1,false); c2=gr->GetC(ss,dd*xm*1.5-0.5,false); } + n1=gr->AddPnt(p1,c1); n2=gr->AddPnt(p2,c2); + if(flag & MGL_VEC_DOT) gr->line_plot(n1,n2); + else gr->vect_plot(n1,n2); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_vect_3d(HMGL gr, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt) +{ + gr->SaveState(opt); + mglData x(ax->GetNx()), y(ax->GetNy()), z(ax->GetNz()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + z.Fill(gr->Min.z,gr->Max.z); + mgl_vect_xyz(gr,&x,&y,&z,ax,ay,az,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_vect_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_vect_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(ax), _DA_(ay), _DA_(az), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_vect_3d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, const char *opt, int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_vect_3d(_GR_, _DA_(ax), _DA_(ay), _DA_(az), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Flow 2d series +// +//----------------------------------------------------------------------------- +void flow(mglBase *gr, float zVal, float u, float v, const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, long ss, bool vv) +{ + long n=10*(ax.nx+ax.ny); + bool both = x.nx==ax.nx && y.nx==ax.nx && x.ny==ax.ny && y.ny==ax.ny; + + mglPoint *pp = new mglPoint[n], dp; + float *cc = new float[n]; + 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; + if(u<0 || v<0) { dt = -dt; u = -u; v = -v; s = -1;} + register long k=0,m; + bool end = false; + do{ + pp[k].x = both ? x.Spline1(u,v,0):x.Spline1(u,0,0); + pp[k].y = both ? y.Spline1(u,v,0):y.Spline1(v,0,0); + pp[k].z = zVal; + for(m=0;mGetC(ss,s*h); + if(h<1e-5) break; // stationary point + k++; + // find next point by midpoint method + h+=1; ff[0]=f*dt/h; gg[0]=g*dt/h; + e = u+ff[0]/2; h = v+gg[0]/2; + f = ax.Linear1(e,h,0); g = ay.Linear1(e,h,0); + h = 1+hypot(f,g); ff[1]=f*dt/h; gg[1]=g*dt/h; + e = u+ff[1]/2; h = v+gg[1]/2; + f = ax.Linear1(e,h,0); g = ay.Linear1(e,h,0); + h = 1+hypot(f,g); ff[2]=f*dt/h; gg[2]=g*dt/h; + e = u+ff[2]; h = v+gg[2]; + f = ax.Linear1(e,h,0); g = ay.Linear1(e,h,0); + h = 1+hypot(f,g); ff[3]=f*dt/h; gg[3]=g*dt/h; + u += ff[0]/6+ff[1]/3+ff[2]/3+ff[3]/6; + v += gg[0]/6+gg[1]/3+gg[2]/3+gg[3]/6; + // condition of end + end = end || k>=n || u<0 || v<0 || u>1 || v>1; + } while(!end); + if(k>1) + { + long i,j,jj,a=long(1./fabs(dt)); + gr->Reserve(k); j = gr->AddPnt(pp[0],cc[0]); + for(i=1;iAddPnt(pp[i],cc[i]); + if(vv && i%a==0) + { + if(dt<0) gr->vect_plot(j,jj,a/5); + else gr->vect_plot(jj,j,a/5); + } + else gr->line_plot(jj,j); + } + } + delete []pp; delete []cc; +} +//----------------------------------------------------------------------------- +void mgl_flow_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt) +{ + float u,v; + long n=ax->GetNx(), m=ax->GetNy(); + if(n*m*ax->GetNz()!=ay->GetNx()*ay->GetNy()*ay->GetNz()) { gr->SetWarn(mglWarnDim,"Flow"); return; } + if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"Flow"); return; } + 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); + if(isnan(r)) r = gr->PrevValue(); + long num = isnan(r)?5:long(r+0.5); + static int cgid=1; gr->StartGroup("Flow",cgid++); + + long ss = gr->AddTexture(sch); + bool vv = sch && strchr(sch,'v'); + // allocate memory + float zVal = gr->Min.z; + bool cnt=(num>0); + num = abs(num); + mglData xx(x), yy(y), bx(ax), by(ay); + + for(long k=0;kGetNz();k++) + { + if(ax->GetNz()>1) zVal = gr->Min.z+(gr->Max.z-gr->Min.z)*float(k)/(ax->GetNz()-1); + for(long i=0;iEndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_flow_2d(HMGL gr, HCDT ax, HCDT ay, const char *sch, const char *opt) +{ + gr->SaveState(opt); + mglData x(ax->GetNx()), y(ax->GetNy()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_flow_xy(gr,&x,&y,ax,ay,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_flow_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_flow_xy(_GR_, _DA_(x), _DA_(y), _DA_(ax), _DA_(ay), s, o); delete []o; delete []s; } +void mgl_flow_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_flow_2d(_GR_, _DA_(ax), _DA_(ay), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_flowp_xy(HMGL gr, float x0, float y0, float z0, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, const char *opt) +{ + mglPoint p(x0,y0,z0); + float u,v; + long n=ax->GetNx(), m=ax->GetNy(); + if(n*m*ax->GetNz()!=ay->GetNx()*ay->GetNy()*ay->GetNz()) { gr->SetWarn(mglWarnDim,"Flow"); return; } + if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"Flow"); return; } + 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; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("FlowP",cgid++); + + long ss = gr->AddTexture(sch); + bool vv = sch && strchr(sch,'v'); + // find coordinates u, v + register long i,j; + register float d, dm=1e7; + long i0=0,j0=0; + for(i=0;iv(i,j)-p.x,y->v(i,j)-p.y) : hypot(x->v(i)-p.x,y->v(j)-p.y); + if(dv(i0,j0)-p.x; dy = y->v(i0,j0)-p.y; + dxu= x->dvx(i0,j0); dyu= y->dvx(i0,j0); + dxv= x->dvy(i0,j0); dyv= y->dvy(i0,j0); + d = dxv*dyu-dxu*dyv; + u = (i0+(dxv*dy-dx*dyv)/d)/n; + v = (j0-(dxu*dy-dx*dyu)/d)/m; + } + else + { + dx = x->v(i0)-p.x; dy = y->v(j0)-p.y; + dxu= x->dvx(i0); dyv= y->dvx(j0); + u = (i0+dx/dxu)/n; v = (j0+dy/dyv)/m; + } + } + mglData xx(x), yy(y), bx(ax), by(ay); + flow(gr, p.z, u, v, xx, yy, bx, by,ss,vv); + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_flowp_2d(HMGL gr, float x0, float y0, float z0, HCDT ax, HCDT ay, const char *sch, const char *opt) +{ + gr->SaveState(opt); + mglData x(ax->GetNx()), y(ax->GetNy()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_flowp_xy(gr,x0,y0,z0,&x,&y,ax,ay,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_flowp_xy_(uintptr_t *gr, float *x0, float *y0, float *z0, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt, int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_flowp_xy(_GR_, *x0,*y0,*z0, _DA_(x), _DA_(y), _DA_(ax), _DA_(ay), s, o); delete []o; delete []s; +} +void mgl_flowp_2d_(uintptr_t *gr, float *x0, float *y0, float *z0, uintptr_t *ax, uintptr_t *ay, const char *sch, const char *opt, int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_flowp_2d(_GR_, *x0,*y0,*z0, _DA_(ax), _DA_(ay), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Flow 3d series +// +//----------------------------------------------------------------------------- +void flow(mglBase *gr, float u, float v, float w, const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az,long ss,bool vv) +{ + static long n=10*(ax.nx+ax.ny); + long nn = ax.nx*ax.ny*ax.nz; + bool both = x.nx*x.ny*x.nz==nn && y.nx*y.ny*y.nz==nn && z.nx*z.ny*z.nz==nn; + mglPoint *pp = new mglPoint[n], dp; + float *cc = new float[n]; + 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)); + + 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; + if(u<0 || v<0 || w<0) + { dt = -dt; u = -u; v = -v; w = -w; s = -1;} + register long k=0,m; + bool end = false; + do{ + pp[k].x = both ? x.Spline1(u,v,w):x.Spline1(u,0,0); + pp[k].y = both ? y.Spline1(u,v,w):y.Spline1(v,0,0); + pp[k].z = both ? z.Spline1(u,v,w):z.Spline1(w,0,0); + for(m=0;mGetC(ss,s*h); + if(h<1e-5) break; // stationary point + k++; + // find next point by midpoint method + h+=1; ee[0]=e*dt/h; ff[0]=f*dt/h; gg[0]=g*dt/h; + u1 = u+ee[0]/2; v1 = v+ff[0]/2; w1 = w+gg[0]/2; + e = ax.Linear1(u1,v1,w1); f = ay.Linear1(u1,v1,w1); + g = az.Linear1(u1,v1,w1); h = 1+sqrt(e*e+f*f+g*g); + ee[1]=e*dt/h; ff[1]=f*dt/h; gg[1]=g*dt/h; + u1 = u+ee[1]/2; v1 = v+ff[1]/2; w1 = w+gg[1]/2; + e = ax.Linear1(u1,v1,w1); f = ay.Linear1(u1,v1,w1); + g = az.Linear1(u1,v1,w1); h = 1+sqrt(e*e+f*f+g*g); + ee[2]=e*dt/h; ff[2]=f*dt/h; gg[2]=g*dt/h; + u1 = u+ee[2]; v1 = v+ff[2]; w1 = w+gg[2]; + e = ax.Linear1(u1,v1,w1); f = ay.Linear1(u1,v1,w1); + g = az.Linear1(u1,v1,w1); h = 1+sqrt(e*e+f*f+g*g); + ee[3]=e*dt/h; ff[3]=f*dt/h; gg[3]=g*dt/h; + u += ee[0]/6+ee[1]/3+ee[2]/3+ee[3]/6; + v += ff[0]/6+ff[1]/3+ff[2]/3+ff[3]/6; + w += gg[0]/6+gg[1]/3+gg[2]/3+gg[3]/6; + // condition of end + end = end || k>=n || u<0 || v<0 || u>1 || v>1 || w<0 || w>1; + } while(!end); + if(k>1) + { + long i,j,jj,a=long(1./fabs(dt)); + gr->Reserve(k); j = gr->AddPnt(pp[0],cc[0]); + for(i=1;iAddPnt(pp[i],cc[i]); + if(vv && i%a==0) + { + if(dt<0) gr->vect_plot(j,jj,a/5); + else gr->vect_plot(jj,j,a/5); + } + else gr->line_plot(jj,j); + } + } + delete []pp; + delete []cc; +} +//----------------------------------------------------------------------------- +void mgl_flow_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt) +{ + float u,v,w; + long i,j,n=ax->GetNx(),m=ax->GetNy(),l=ax->GetNz(); + if(ax->GetNx()*ax->GetNy()*ax->GetNz()!=ay->GetNx()*ay->GetNy()*ay->GetNz() || ax->GetNx()*ax->GetNy()*ax->GetNz()!=az->GetNx()*az->GetNy()*az->GetNz()) + { gr->SetWarn(mglWarnDim,"Flow"); return; } + if(ax->GetNx()<2 || ax->GetNy()<2 || ax->GetNz()<2) + { gr->SetWarn(mglWarnLow,"Flow"); return; } + 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,"Flow"); return; } + float r = gr->SaveState(opt); + if(isnan(r)) r = gr->PrevValue(); + long num = isnan(r)?3:long(r+0.5); + static int cgid=1; gr->StartGroup("Flow3",cgid++); + bool cnt=(num>0); num = abs(num); // redefine central parater + long ss = gr->AddTexture(sch); + bool vv = sch && strchr(sch,'v'); + + mglData xx(x), yy(y), zz(z), bx(ax), by(ay), bz(az); + for(i=0;iEndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_flow_3d(HMGL gr, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt) +{ + gr->SaveState(opt); + mglData x(ax->GetNx()), y(ax->GetNy()), z(ax->GetNz()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + z.Fill(gr->Min.z,gr->Max.z); + mgl_flow_xyz(gr,&x,&y,&z,ax,ay,az,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_flow_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_flow_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(ax), _DA_(ay), _DA_(az), s, o); delete []o; delete []s; } +void mgl_flow_3d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_flow_3d(_GR_, _DA_(ax), _DA_(ay), _DA_(az), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_flowp_xyz(HMGL gr, float x0, float y0, float z0, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt) +{ + mglPoint p(x0,y0,z0); + float u,v,w; + long n=ax->GetNx(),m=ax->GetNy(),l=ax->GetNz(); + if(ax->GetNx()*ax->GetNy()*ax->GetNz()!=ay->GetNx()*ay->GetNy()*ay->GetNz() || ax->GetNx()*ax->GetNy()*ax->GetNz()!=az->GetNx()*az->GetNy()*az->GetNz()) + { gr->SetWarn(mglWarnDim,"Flow"); return; } + if(ax->GetNx()<2 || ax->GetNy()<2 || ax->GetNz()<2) + { gr->SetWarn(mglWarnLow,"Flow"); return; } + 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,"Flow"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("FlowP3",cgid++); + long ss = gr->AddTexture(sch); + bool vv = sch && strchr(sch,'v'); + + // find coordinates u, v, w + register long i,j,k; + register float d, dm=1e7; + long i0=0,j0=0,k0=0; + float dx,dy,dz; + for(i=0;iv(i,j,k)-p.x; dy = y->v(i,j,k)-p.y; dz = x->v(i,j,k)-p.z; } + else + { dx = x->v(i)-p.x; dy = y->v(j)-p.y; dz = x->v(k)-p.z; } + d = sqrt(dx*dx+dy*dy+dz*dz); + if(dv(i0,j0,k0)-p.x; dy = y->v(i0,j0,k0)-p.y; dz = z->v(i0,j0,k0)-p.z; + dxu= x->dvx(i0,j0,k0); dyu= y->dvx(i0,j0,k0); dzu= z->dvx(i0,j0,k0); + dxv= x->dvy(i0,j0,k0); dyv= y->dvy(i0,j0,k0); dzv= z->dvy(i0,j0,k0); + dxw= x->dvz(i0,j0,k0); dyw= y->dvz(i0,j0,k0); dzw= z->dvz(i0,j0,k0); + d = dxu*(dyw*dzv-dyv*dzw)+dxv*(dyu*dzw-dyw*dzu)+dxw*(dyv*dzu-dyu*dzv); + u = (i0+(dx*(dyw*dzv-dyv*dzw)+dxv*(dy*dzw-dyw*dz)+dxw*(dyv*dz-dy*dzv))/d)/n; + v = (j0-(dx*(dyw*dzu-dyu*dzw)+dxu*(dy*dzw-dyw*dz)+dxw*(dyu*dz-dy*dzu))/d)/m; + w = (i0+(dx*(dyv*dzu-dyu*dzv)+dxu*(dy*dzv-dyv*dz)+dxv*(dyu*dz-dy*dzu))/d)/l; + } + else + { + dx = x->v(i0)-p.x; dy = y->v(j0)-p.y; dz = z->v(k0)-p.z; + dxu= x->dvx(i0); dyv= y->dvx(j0); dzw= z->dvx(k0); + u = (i0+dx/dxu)/n; v = (j0+dy/dyv)/m; w = (k0+dz/dzw)/m; + } + } + mglData xx(x), yy(y), zz(z), bx(ax), by(ay), bz(az); + flow(gr, u, v, w, xx, yy, zz, bx, by, bz,ss,vv); + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_flowp_3d(HMGL gr, float x0, float y0, float z0, HCDT ax, HCDT ay, HCDT az, const char *sch, const char *opt) +{ + gr->SaveState(opt); + mglData x(ax->GetNx()), y(ax->GetNy()), z(ax->GetNz()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + z.Fill(gr->Min.z,gr->Max.z); + mgl_flowp_xyz(gr, x0,y0,z0, &x,&y,&z,ax,ay,az,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_flowp_xyz_(uintptr_t *gr, float *x0, float *y0, float *z0, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, const char *opt, int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_flowp_xyz(_GR_, *x0,*y0,*z0, _DA_(x), _DA_(y), _DA_(z), _DA_(ax), _DA_(ay), _DA_(az), s, o); + delete []o; delete []s; } +void mgl_flowp_3d_(uintptr_t *gr, float *x0, float *y0, float *z0, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, const char *opt, int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_flowp_3d(_GR_, *x0,*y0,*z0, _DA_(ax), _DA_(ay), _DA_(az), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Grad series +// +//----------------------------------------------------------------------------- +void mgl_grad_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT phi, const char *sch, const char *opt) +{ + mglData ax(phi), ay(phi),az(phi),xx(phi),yy(phi),zz(phi); + long n=xx.nx, m=xx.ny, l=xx.nz, nn = n*m*l; + if(x->GetNx()*x->GetNy()*x->GetNz()==nn && y->GetNx()*y->GetNy()*y->GetNz()==nn && x->GetNx()*x->GetNy()*x->GetNz()==nn) + { xx.Set(x); yy.Set(y); zz.Set(z); } // nothing to do + else if(x->GetNx()==n && y->GetNx()==m && z->GetNx()==l) + { // prepare data + register long i,j,k,i0; + for(i=0;iv(i); + yy.a[i0] = y->v(j); zz.a[i0] = z->v(k); } + } + else { gr->SetWarn(mglWarnDim,"Grad"); return; } + ax.Diff(xx,yy,zz); ay.Diff(yy,xx,zz); az.Diff(zz,xx,yy); + mgl_flow_xyz(gr,&xx,&yy,&zz,&ax,&ay,&az,sch,opt); +} +//----------------------------------------------------------------------------- +void mgl_grad_xy(HMGL gr, HCDT x, HCDT y, HCDT phi, const char *sch, const char *opt) +{ + mglData ax(phi), ay(phi),xx(phi),yy(phi); + long n = phi->GetNx(), m=phi->GetNy(), nn=n*m; + if(x->GetNx()*x->GetNy()==nn && y->GetNx()*y->GetNy()==nn) { xx.Set(x); yy.Set(y); } + else if(x->GetNx()==n && y->GetNx()==m) + { + register long i,j,i0; + for(i=0;iv(i); yy.a[i0] = y->v(j); } + } + else { gr->SetWarn(mglWarnDim,"Grad"); return; } + ax.Diff(xx,yy); ay.Diff(yy,xx); + mgl_flow_xy(gr,&xx,&yy,&ax,&ay,sch,opt); +} +//----------------------------------------------------------------------------- +void mgl_grad(HMGL gr, HCDT phi, const char *sch, const char *opt) +{ + mglData x(phi->GetNx()), y(phi->GetNy()), z(phi->GetNz()); + gr->SaveState(opt); + x.Fill(gr->Min.x,gr->Max.x); y.Fill(gr->Min.y,gr->Max.y); z.Fill(gr->Min.z,gr->Max.z); + if(phi->GetNz()==1) mgl_grad_xy(gr,&x,&y,phi,sch,0); + else mgl_grad_xyz(gr,&x,&y,&z,phi,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_grad_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ph, const char *sch, const char *opt, int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_grad_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(ph), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_grad_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ph, const char *sch, const char *opt, int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_grad_xy(_GR_, _DA_(x), _DA_(y), _DA_(ph), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_grad_(uintptr_t *gr, uintptr_t *ph, const char *sch, const char *opt, int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_grad(_GR_, _DA_(ph), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Pipe 2d series +// +//----------------------------------------------------------------------------- +void flowr(mglBase *gr, float zVal, float u, float v, const mglData &x, const mglData &y, const mglData &ax, const mglData &ay, float r0,long sc) +{ + long n=10*(ax.nx+ax.ny); + bool both = x.nx==ax.nx && y.nx==ax.nx && x.ny==ax.ny && y.ny==ax.ny; + + mglPoint *pp = new mglPoint[n], dp; + float *cc = new float[n]; + 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); + if(u<0 || v<0) { dt = -dt; u = -u; v = -v; s = -1;} + register long k=0,m; + bool end = false; + do{ + pp[k].x = both ? x.Spline1(u,v,0):x.Spline1(u,0,0); + pp[k].y = both ? y.Spline1(u,v,0):y.Spline1(v,0,0); + pp[k].z = zVal; + for(m=0;mGetC(sc,s*h); + pp[k].c = r0>0 ? r0*sqrt(1e-2+ss*h*h)/2 : -r0/sqrt(1e-2+ss*h*h)/5; + if(h<1e-5) break; // stationary point + k++; + // find next point by midpoint method + h+=1; ff[0]=f*dt/h; gg[0]=g*dt/h; + e = u+ff[0]/2; h = v+gg[0]/2; + f = ax.Linear1(e,h,0); g = ay.Linear1(e,h,0); h = 1+hypot(f,g); + ff[1]=f*dt/h; gg[1]=g*dt/h; + e = u+ff[1]/2; h = v+gg[1]/2; + f = ax.Linear1(e,h,0); g = ay.Linear1(e,h,0); h = 1+hypot(f,g); + ff[2]=f*dt/h; gg[2]=g*dt/h; + e = u+ff[2]; h = v+gg[2]; + f = ax.Linear1(e,h,0); g = ay.Linear1(e,h,0); h = 1+hypot(f,g); + ff[3]=f*dt/h; gg[3]=g*dt/h; + u += ff[0]/6+ff[1]/3+ff[2]/3+ff[3]/6; + v += gg[0]/6+gg[1]/3+gg[2]/3+gg[3]/6; + // condition of end + end = end || k>=n || u<0 || v<0 || u>1 || v>1; + } while(!end); + if(k>1) + { + const int num=41; + long i,j,*id=new long[2*num]; + mglPoint p,l=pp[1]-pp[0],t,q,d; + t = !l; t.Normalize(); q = t^l; q.Normalize(); + float si,co,fi, rr=pp[0].c,dr=l.c; + gr->Reserve(num*k); + + for(j=0;jAddPnt(p,cc[0],d); + } + for(i=1;iAddPnt(p,cc[i],d); + if(j>0) gr->quad_plot(id[j-1],id[j],id[j+num-1],id[j+num]); + } + } + delete []id; + } + delete []pp; delete []cc; +} +//----------------------------------------------------------------------------- +void mgl_pipe_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const char *sch, float r0, const char *opt) +{ + float u,v; + long n=ax->GetNx(), m=ax->GetNy(); + if(n*m*ax->GetNz()!=ay->GetNx()*ay->GetNy()*ay->GetNz()) { gr->SetWarn(mglWarnDim,"Pipe"); return; } + if(n<2 || m<2) { gr->SetWarn(mglWarnLow,"Pipe"); return; } + 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); + if(isnan(r)) r = gr->PrevValue(); + long num = isnan(r)?5:long(r+0.5); + static int cgid=1; gr->StartGroup("Pipe",cgid++); + + long ss = gr->AddTexture(sch); + // allocate memory + float zVal = gr->Min.z; + bool cnt=(num>0); num = abs(num); + + mglData xx(x), yy(y), bx(ax), by(ay); + for(long k=0;kGetNz();k++) + { + if(ax->GetNz()>1) zVal = gr->Min.z+(gr->Max.z-gr->Min.z)*float(k)/(ax->GetNz()-1); + for(long i=0;iEndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_pipe_2d(HMGL gr, HCDT ax, HCDT ay, const char *sch, float r0, const char *opt) +{ + gr->SaveState(opt); + mglData x(ax->GetNx()), y(ax->GetNy()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + mgl_pipe_xy(gr,&x,&y,ax,ay,sch,r0,0); +} +//----------------------------------------------------------------------------- +void mgl_pipe_xy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *ax, uintptr_t *ay, const char *sch, float *r0, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_pipe_xy(_GR_, _DA_(x), _DA_(y), _DA_(ax), _DA_(ay), s, *r0, o); delete []o; delete []s; } +void mgl_pipe_2d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, const char *sch, float *r0, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_pipe_2d(_GR_, _DA_(ax), _DA_(ay), s, *r0, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Pipe 3d series +// +//----------------------------------------------------------------------------- +void flowr(mglBase *gr, float u, float v, float w, const mglData &x, const mglData &y, const mglData &z, const mglData &ax, const mglData &ay, const mglData &az, float r0,long sc) +{ + static long n=10*(ax.nx+ax.ny); + long nn = ax.nx*ax.ny*ax.nz; + bool both = x.nx*x.ny*x.nz==nn && y.nx*y.ny*y.nz==nn && z.nx*z.ny*z.nz==nn; + mglPoint *pp = new mglPoint[n], dp; + float *cc = new float[n]; + 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)); + + 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); + + if(u<0 || v<0 || w<0) + { dt = -dt; u = -u; v = -v; w = -w; s = -1;} + register long k=0,m; + bool end = false; + do{ + pp[k].x = both ? x.Spline1(u,v,w):x.Spline1(u,0,0); + pp[k].y = both ? y.Spline1(u,v,w):y.Spline1(v,0,0); + pp[k].z = both ? z.Spline1(u,v,w):z.Spline1(w,0,0); + for(m=0;mGetC(sc,s*h); + pp[k].c = r0>0 ? r0*sqrt(1e-2+ss*h*h)/2 : -r0/sqrt(1e-2+ss*h*h)/5; + if(h<1e-5) break; // stationary point + k++; + // find next point by midpoint method + h+=1; ee[0]=e*dt/h; ff[0]=f*dt/h; gg[0]=g*dt/h; + u1 = u+ee[0]/2; v1 = v+ff[0]/2; w1 = w+gg[0]/2; + e = ax.Linear1(u1,v1,w1); f = ay.Linear1(u1,v1,w1); + g = az.Linear1(u1,v1,w1); h = 1+sqrt(e*e+f*f+g*g); + ee[1]=e*dt/h; ff[1]=f*dt/h; gg[1]=g*dt/h; + u1 = u+ee[1]/2; v1 = v+ff[1]/2; w1 = w+gg[1]/2; + e = ax.Linear1(u1,v1,w1); f = ay.Linear1(u1,v1,w1); + g = az.Linear1(u1,v1,w1); h = 1+sqrt(e*e+f*f+g*g); + ee[2]=e*dt/h; ff[2]=f*dt/h; gg[2]=g*dt/h; + u1 = u+ee[2]; v1 = v+ff[2]; w1 = w+gg[2]; + e = ax.Linear1(u1,v1,w1); f = ay.Linear1(u1,v1,w1); + g = az.Linear1(u1,v1,w1); h = 1+sqrt(e*e+f*f+g*g); + ee[3]=e*dt/h; ff[3]=f*dt/h; gg[3]=g*dt/h; + u += ee[0]/6+ee[1]/3+ee[2]/3+ee[3]/6; + v += ff[0]/6+ff[1]/3+ff[2]/3+ff[3]/6; + w += gg[0]/6+gg[1]/3+gg[2]/3+gg[3]/6; + // condition of end + end = end || k>=n || u<0 || v<0 || u>1 || v>1 || w<0 || w>1; + } while(!end); + if(k>1) + { + const int num=41; + long i,j,*id=new long[2*num]; + mglPoint p,l=pp[1]-pp[0],t,q,d; + t = !l; t.Normalize(); q = t^l; q.Normalize(); + float si,co,fi, rr=pp[0].c,dr=l.c; + gr->Reserve(num*k); + + for(j=0;jAddPnt(p,cc[0],d); + } + for(i=1;iAddPnt(p,cc[i],d); + if(j>0) gr->quad_plot(id[j-1],id[j],id[j+num-1],id[j+num]); + } + } + delete []id; + } + delete []pp; delete []cc; +} +//----------------------------------------------------------------------------- +void mgl_pipe_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, HCDT az, const char *sch, float r0, const char *opt) +{ + float u,v,w; + long i,j,n=ax->GetNx(),m=ax->GetNy(),l=ax->GetNz(); + if(ax->GetNx()*ax->GetNy()*ax->GetNz()!=ay->GetNx()*ay->GetNy()*ay->GetNz() || ax->GetNx()*ax->GetNy()*ax->GetNz()!=az->GetNx()*az->GetNy()*az->GetNz()) + { gr->SetWarn(mglWarnDim,"Pipe"); return; } + if(ax->GetNx()<2 || ax->GetNy()<2 || ax->GetNz()<2) + { gr->SetWarn(mglWarnLow,"Pipe"); return; } + 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,"Pipe"); return; } + float r = gr->SaveState(opt); + if(isnan(r)) r = gr->PrevValue(); + long num = isnan(r)?3:long(r+0.5); + static int cgid=1; gr->StartGroup("Pipe3",cgid++); + + long ss = gr->AddTexture(sch); + bool cnt=(num>0); num = abs(num); + + mglData xx(x), yy(y), zz(z), bx(ax), by(ay), bz(az); + for(i=0;iEndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_pipe_3d(HMGL gr, HCDT ax, HCDT ay, HCDT az, const char *sch, float r0, const char *opt) +{ + gr->SaveState(opt); + mglData x(ax->GetNx()), y(ax->GetNy()), z(ax->GetNz()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + z.Fill(gr->Min.z,gr->Max.z); + mgl_pipe_xyz(gr,&x,&y,&z,ax,ay,az,sch,r0,0); +} +//----------------------------------------------------------------------------- +void mgl_pipe_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, float *r0, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_pipe_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(ax), _DA_(ay), _DA_(az), s, *r0, o); + delete []o; delete []s; } +void mgl_pipe_3d_(uintptr_t *gr, uintptr_t *ax, uintptr_t *ay, uintptr_t *az, const char *sch, float *r0, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_pipe_3d(_GR_, _DA_(ax), _DA_(ay), _DA_(az), s, *r0, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- diff --git a/src/volume.cpp b/src/volume.cpp new file mode 100644 index 0000000..9f2109a --- /dev/null +++ b/src/volume.cpp @@ -0,0 +1,775 @@ +/*************************************************************************** + * surf.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * 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 +//----------------------------------------------------------------------------- +// +// CloudQ series +// +//----------------------------------------------------------------------------- +void mgl_cloud_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT a, const char *sch, const char *opt) +{ + if(!(gr->GetQuality()&3)) return; // do nothing in fast_draw + long i,j,k,n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); + register int i0; + if(n<2 || m<2 || l<2) { gr->SetWarn(mglWarnLow,"Cloud"); return; } + 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); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Cloud",cgid++); + + int tx=1,ty=1,tz=1; + if(gr->MeshNum>1) + { tx=(n-1)/(gr->MeshNum-1); ty=(m-1)/(gr->MeshNum-1); tz=(l-1)/(gr->MeshNum-1);} + if(tx<1) tx=1; if(ty<1) ty=1; if(tz<1) tz=1; + + float alpha = gr->AlphaDef; + bool inv = sch && strchr(sch,'-'); + bool dot = sch && strchr(sch,'.'); + alpha /= pow(n/tx*m/ty*l/tz,1./3)/20; + float aa,bb; + if(alpha>1) alpha = 1; + long ss = gr->AddTexture(sch); + + // x, y, z -- have the same size as a + long nn=(n/tx)*(m/ty)*(l/tz), *pos=new long[(n/tx)*(m/ty)*(l/tz)]; + gr->Reserve(nn); + mglPoint p,q=mglPoint(NAN); + for(k=0;kv(i,j,k),y->v(i,j,k),z->v(i,j,k)) : mglPoint(x->v(i),y->v(j),z->v(k)); + aa = gr->GetA(a->v(i,j,k)); + if(inv) bb = (1-aa)*(1-aa)*alpha; + else bb = aa*aa*alpha; + pos[i+(n/tx)*(j+(m/ty)*k)] = gr->AddPnt(p,gr->GetC(ss,aa,false),q,bb); + } + n /= tx; m /= ty; l /= tz; + if(dot) for(i=0;imark_plot(pos[i],'.'); + else for(i=0;iquad_plot(pos[i0],pos[i0+1],pos[i0+n],pos[i0+n+1]); + if(iquad_plot(pos[i0],pos[i0+1],pos[i0+n*m],pos[i0+n*m+1]); + if(kquad_plot(pos[i0],pos[i0+n],pos[i0+n+n*m],pos[i0+n+n*m]); + } + delete []pos; gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void mgl_cloud(HMGL gr, HCDT a, const char *sch, const char *opt) +{ + if(a->GetNx()<2 || a->GetNy()<2 || a->GetNz()<2) + { gr->SetWarn(mglWarnLow,"Cloud"); return; } + gr->SaveState(opt); + mglData x(a->GetNx()), y(a->GetNy()),z(a->GetNz()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + z.Fill(gr->Min.z,gr->Max.z); + mgl_cloud_xyz(gr,&x,&y,&z,a,sch,0); +} +//----------------------------------------------------------------------------- +void mgl_cloud_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cloud_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_cloud_(uintptr_t *gr, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_cloud(_GR_, _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Surf3 series +// +//----------------------------------------------------------------------------- +mglPoint mgl_normal_3d(const mglDataA *a, mglPoint p, bool inv, long n,long m,long l) +{ + register long i,j,k; + register float x=p.x, y=p.y, z=p.z; + float nx=0, ny=0, nz=0; + i=long(x); j=long(y); k=long(z); + i = idvx(i,j,k)*(1-x) + a->dvx(i+1,j,k)*x; + else nx = a->dvx(i,j,k); + if(jdvy(i,j,k)*(1-y) + a->dvy(i,j+1,k)*y; + else ny = a->dvy(i,j,k); + if(kdvz(i,j,k)*(1-z) + a->dvz(i,j,k+1)*z; + else nz = a->dvz(i,j,k); + return inv ? mglPoint(nx,ny,nz) : mglPoint(-nx,-ny,-nz); +} +//----------------------------------------------------------------------------- +float mgl_normal_1d(const mglDataA *a, float x, bool inv, long n) +{ + register long i=long(x); x-=i; + float nx = a->dvx(i); + if(idvx(i+1)*x; + return inv ? nx : -nx; +} +//----------------------------------------------------------------------------- +mglPoint mgl_find_norm(bool both, HCDT x, HCDT y, HCDT z, HCDT a, mglPoint u, bool inv, long n,long m,long l) +{ + mglPoint s = mgl_normal_3d(a,u,inv,n,m,l), t, q; + if(both) + { + t = mgl_normal_3d(x,u,true,n,m,l); q.x = (s*t)/(t*t); + t = mgl_normal_3d(y,u,true,n,m,l); q.y = (s*t)/(t*t); + t = mgl_normal_3d(z,u,true,n,m,l); q.z = (s*t)/(t*t); + } + else + { + q.x = s.x/mgl_normal_1d(x,u.x,true,n); + q.y = s.y/mgl_normal_1d(y,u.y,true,m); + q.z = s.z/mgl_normal_1d(z,u.z,true,l); + } + return q; +} +//----------------------------------------------------------------------------- +inline float mgl_cos_pp(const mglPoint *kk,long i0,long i1,long i2) +{ + mglPoint dp1 = kk[i1]-kk[i0], dp2 = kk[i2]-kk[i0]; + float p1=dp1*dp1,p2=dp2*dp2,pc=dp1*dp2; + return p1*p2>1e-10 ? pc/sqrt(p1*p2) : NAN; +} +//----------------------------------------------------------------------------- +void mgl_surf3_plot(HMGL gr, long n,long m,long *kx1,long *kx2,long *ky1,long *ky2, long *kz, std::vector kk, bool wire) +{ + register long i,j,k,i0,ii,jj; + long id[12],us[12],pd[12],ni; + mglPoint pp[12]; + float d,d0; + + for(i=0;i=0) id[ni++] = kx1[i0]; + if(ky1[i0]>=0) id[ni++] = ky1[i0]; + if(kx1[i0+n]>=0) id[ni++] = kx1[i0+n]; + if(ky1[i0+1]>=0) id[ni++] = ky1[i0+1]; + if(kz[i0]>=0) id[ni++] = kz[i0]; + if(kz[i0+1]>=0) id[ni++] = kz[i0+1]; + if(kz[i0+n+1]>=0) id[ni++] = kz[i0+n+1]; + if(kz[i0+n]>=0) id[ni++] = kz[i0+n]; + if(kx2[i0]>=0) id[ni++] = kx2[i0]; + if(ky2[i0]>=0) id[ni++] = ky2[i0]; + if(kx2[i0+n]>=0) id[ni++] = kx2[i0+n]; + if(ky2[i0+1]>=0) id[ni++] = ky2[i0+1]; + if(ni<3) continue; + + for(jj=0;jj1e-5) jj++; + else + { ni--; for(ii=jj;iid0) { d0=d; i0=ii; } + } + if(i0<0) break; // no more triangles. NOTE: should be never here + jj = i0; us[jj]=1; p3 = pd[jj]; + if(wire) + { + gr->line_plot(p1, p2); + gr->line_plot(p1, p3); + gr->line_plot(p2, p3); + } + else gr->trig_plot(p1, p2, p3); + p2 = p3; + } + } +} +//----------------------------------------------------------------------------- +void mgl_surf3_xyz_val(HMGL gr, float val, HCDT x, HCDT y, HCDT z, HCDT a, const char *sch, const char *opt) +{ + long i,j,k,i1,n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); + long *kx1,*kx2,*ky1,*ky2,*kz; + bool both, wire = sch && strchr(sch,'#'); + float d; + if(n<2 || m<2 || l<2) { gr->SetWarn(mglWarnLow,"Surf3"); return; } + 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,"Surf3"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Surf3",cgid++); + + bool inv = (sch && strchr(sch,'-')); + long ss = gr->AddTexture(sch), pos; + + kx1 = new long[n*m]; kx2 = new long[n*m]; + ky1 = new long[n*m]; ky2 = new long[n*m]; + kz = new long[n*m]; + float c=gr->GetC(ss,val); + std::vector kk; + kk.reserve(n*m*l); + + mglPoint p,q,u; + float a0; + for(k=0;kReserve(n*m); gr->Reserve(n*m); + for(j=0;jv(i,j,k); + if(iv(i+1,j,k)); + if(d>=0 && d<1) + { + if(both) p = mglPoint(x->v(i,j,k)*(1-d)+x->v(i+1,j,k)*d, + y->v(i,j,k)*(1-d)+y->v(i+1,j,k)*d, + z->v(i,j,k)*(1-d)+z->v(i+1,j,k)*d); + else p = mglPoint(x->v(i)*(1-d)+x->v(i+1)*d, y->v(j), z->v(k)); + u = mglPoint(i+d,j,k); + q = mgl_find_norm(both, x,y,z,a, u, inv,n,m,l); + pos = gr->AddPnt(p,c,q); u.c=pos; + if(pos<0) continue; + kk.push_back(u); kx2[i1] = kk.size()-1; + } + } + if(jv(i,j+1,k)); + if(d>=0 && d<1) + { + if(both) p = mglPoint(x->v(i,j,k)*(1-d)+x->v(i,j+1,k)*d, + y->v(i,j,k)*(1-d)+y->v(i,j+1,k)*d, + z->v(i,j,k)*(1-d)+z->v(i,j+1,k)*d); + else p = mglPoint(x->v(i), y->v(j)*(1-d)+y->v(j+1)*d, z->v(k)); + u = mglPoint(i,j+d,k); + q = mgl_find_norm(both, x,y,z,a, u, inv,n,m,l); + pos = gr->AddPnt(p,c,q); u.c=pos; + if(pos<0) continue; + kk.push_back(u); ky2[i1] = kk.size()-1; + } + } + if(k>0) + { + d = mgl_d(val,a->v(i,j,k-1),a0); + if(d>=0 && d<1) + { + if(both) p = mglPoint(x->v(i,j,k-1)*(1-d)+x->v(i,j,k)*d, + y->v(i,j,k-1)*(1-d)+y->v(i,j,k)*d, + z->v(i,j,k-1)*(1-d)+z->v(i,j,k)*d); + else p = mglPoint(x->v(i), y->v(j), z->v(k-1)*(1-d)+z->v(k)*d); + u = mglPoint(i,j,k+d-1); + q = mgl_find_norm(both, x,y,z,a, u, inv,n,m,l); + pos = gr->AddPnt(p,c,q); u.c=pos; + if(pos<0) continue; + kk.push_back(u); kz[i1] = kk.size()-1; + } + } + } + if(k>0) mgl_surf3_plot(gr,n,m,kx1,kx2,ky1,ky2,kz,kk,wire); + } + gr->EndGroup(); + delete []kx1; delete []kx2; delete []ky1; + delete []ky2; delete []kz; +} +//----------------------------------------------------------------------------- +void mgl_surf3_val(HMGL gr, float val, HCDT a, const char *sch, const char *opt) +{ + if(a->GetNx()<2 || a->GetNy()<2 || a->GetNz()<2) { gr->SetWarn(mglWarnLow,"Surf3"); return; } + gr->SaveState(opt); + mglData x(a->GetNx()), y(a->GetNy()),z(a->GetNz()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + z.Fill(gr->Min.z,gr->Max.z); + mgl_surf3_xyz_val(gr,val,&x,&y,&z,a,sch,0); +} +//----------------------------------------------------------------------------- +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); + for(long i=0;iMax.c + (gr->Min.c-gr->Max.c)*(i+1.)/(num+1); + mgl_surf3_xyz_val(gr,v,x,y,z,a,sch,0); + } +} +//----------------------------------------------------------------------------- +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); + for(long i=0;iMax.c + (gr->Min.c-gr->Max.c)*(i+1.)/(num+1); + mgl_surf3_val(gr,v,a,sch,0); + } +} +//----------------------------------------------------------------------------- +void mgl_surf3_xyz_val_(uintptr_t *gr, float *Val, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surf3_xyz_val(_GR_, *Val, _DA_(x), _DA_(y), _DA_(z), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_surf3_val_(uintptr_t *gr, float *Val, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surf3_val(_GR_, *Val, _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_surf3_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surf3_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_surf3_(uintptr_t *gr, uintptr_t *a, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surf3(_GR_, _DA_(a), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Surf3A series +// +//----------------------------------------------------------------------------- +void mgl_surf3a_xyz_val(HMGL gr, float val, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *sch, const char *opt) +{ + long i,j,k,i1,n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); + long *kx1,*kx2,*ky1,*ky2,*kz; + bool both, wire = sch && strchr(sch,'#'); + float d; + if(n<2 || m<2 || l<2) { gr->SetWarn(mglWarnLow,"Surf3A"); return; } + 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,"Surf3A"); return; } + if(b->GetNx()*b->GetNy()*b->GetNz()!=n*m*l) { gr->SetWarn(mglWarnDim,"Surf3A"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Surf3A",cgid++); + + bool inv = (sch && strchr(sch,'-')); + long ss = gr->AddTexture(sch), pos; + + kx1 = new long[n*m]; kx2 = new long[n*m]; + ky1 = new long[n*m]; ky2 = new long[n*m]; + kz = new long[n*m]; + float c=gr->GetC(ss,val),aa; + std::vector kk; + kk.reserve(n*m*l); + + mglPoint p,q,u; + float a0,b0; + for(k=0;kReserve(n*m); gr->Reserve(n*m); + for(j=0;jv(i,j,k); b0 = b->v(i,j,k); + if(iv(i+1,j,k)); + if(d>=0 && d<1) + { + if(both) p = mglPoint(x->v(i,j,k)*(1-d)+x->v(i+1,j,k)*d, + y->v(i,j,k)*(1-d)+y->v(i+1,j,k)*d, + z->v(i,j,k)*(1-d)+z->v(i+1,j,k)*d); + else p = mglPoint(x->v(i)*(1-d)+x->v(i+1)*d, y->v(j), z->v(k)); + aa = gr->GetA(b0*(1-d)+b->v(i+1,j,k)*d); + u = mglPoint(i+d,j,k); + q = mgl_find_norm(both, x,y,z,a, u, inv,n,m,l); + pos = gr->AddPnt(p,c,q,aa); u.c=pos; + if(pos<0) continue; + kk.push_back(u); kx2[i1] = kk.size()-1; + } + } + if(jv(i,j+1,k)); + if(d>=0 && d<1) + { + if(both) p = mglPoint(x->v(i,j,k)*(1-d)+x->v(i,j+1,k)*d, + y->v(i,j,k)*(1-d)+y->v(i,j+1,k)*d, + z->v(i,j,k)*(1-d)+z->v(i,j+1,k)*d); + else p = mglPoint(x->v(i), y->v(j)*(1-d)+y->v(j+1)*d, z->v(k)); + aa = gr->GetA(b0*(1-d)+b->v(i,j+1,k)*d); + u = mglPoint(i,j+d,k); + q = mgl_find_norm(both, x,y,z,a, u, inv,n,m,l); + pos = gr->AddPnt(p,c,q,aa); u.c=pos; + if(pos<0) continue; + kk.push_back(u); ky2[i1] = kk.size()-1; + } + } + if(k>0) + { + d = mgl_d(val,a->v(i,j,k-1),a0); + if(d>=0 && d<1) + { + if(both) p = mglPoint(x->v(i,j,k-1)*(1-d)+x->v(i,j,k)*d, + y->v(i,j,k-1)*(1-d)+y->v(i,j,k)*d, + z->v(i,j,k-1)*(1-d)+z->v(i,j,k)*d); + else p = mglPoint(x->v(i), y->v(j), z->v(k-1)*(1-d)+z->v(k)*d); + aa = gr->GetA(b->v(i,j,k-1)*(1-d)+b0*d); + u = mglPoint(i,j,k+d-1); + q = mgl_find_norm(both, x,y,z,a, u, inv,n,m,l); + pos = gr->AddPnt(p,c,q,aa); u.c=pos; + if(pos<0) continue; + kk.push_back(u); kz[i1] = kk.size()-1; + } + } + } + if(k>0) mgl_surf3_plot(gr,n,m,kx1,kx2,ky1,ky2,kz,kk,wire); + } + gr->EndGroup(); + delete []kx1; delete []kx2; delete []ky1; + delete []ky2; delete []kz; +} +//----------------------------------------------------------------------------- +void mgl_surf3a_val(HMGL gr, float val, HCDT a, HCDT b, const char *sch, const char *opt) +{ + if(a->GetNx()<2 || a->GetNy()<2 || a->GetNz()<2) + { gr->SetWarn(mglWarnLow,"Surf3A"); return; } + gr->SaveState(opt); + mglData x(a->GetNx()), y(a->GetNy()),z(a->GetNz()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + z.Fill(gr->Min.z,gr->Max.z); + mgl_surf3a_xyz_val(gr,val,&x,&y,&z,a,b,sch,0); +} +//----------------------------------------------------------------------------- +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); + if(b->GetNx()==num && b->GetNy()==1 && b->GetNz()==1) + { + float v,a0=gr->AlphaDef; + for(long i=0;iMax.c + (gr->Min.c-gr->Max.c)*(i+1.)/(num+1); + gr->AlphaDef = gr->GetA(b->v(i)); + mgl_surf3_xyz_val(gr,v,x,y,z,a,sch,0); + } + gr->AlphaDef = a0; + } + else for(long i=0;iMax.c + (gr->Min.c-gr->Max.c)*(i+1.)/(num+1); + mgl_surf3a_xyz_val(gr,v,x,y,z,a,b,sch,0); + } +} +//----------------------------------------------------------------------------- +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); + if(b->GetNx()==num && b->GetNy()==1 && b->GetNz()==1) + { + float v,a0=gr->AlphaDef; + for(long i=0;iMax.c + (gr->Min.c-gr->Max.c)*(i+1.)/(num+1); + gr->AlphaDef = b->v(i); + mgl_surf3_val(gr,v,a,sch,0); + } + gr->AlphaDef = a0; + } + else for(long i=0;iMax.c + (gr->Min.c-gr->Max.c)*(i+1.)/(num+1); + mgl_surf3a_val(gr,v,a,b,sch,0); + } +} +//----------------------------------------------------------------------------- +void mgl_surf3a_xyz_val_(uintptr_t *gr, float *Val, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surf3a_xyz_val(_GR_, *Val, _DA_(x), _DA_(y), _DA_(z), _DA_(a), _DA_(b), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_surf3a_val_(uintptr_t *gr, float *Val, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surf3a_val(_GR_, *Val, _DA_(a), _DA_(b), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_surf3a_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surf3a_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(a), _DA_(b), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_surf3a_(uintptr_t *gr, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surf3a(_GR_, _DA_(a), _DA_(b), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Surf3C series +// +//----------------------------------------------------------------------------- +void mgl_surf3c_xyz_val(HMGL gr, float val, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *sch, const char *opt) +{ + long i,j,k,i1,n=a->GetNx(),m=a->GetNy(),l=a->GetNz(); + long *kx1,*kx2,*ky1,*ky2,*kz; + bool both, wire = sch && strchr(sch,'#'); + float d; + if(n<2 || m<2 || l<2) { gr->SetWarn(mglWarnLow,"Surf3A"); return; } + 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,"Surf3A"); return; } + if(b->GetNx()*b->GetNy()*b->GetNz()!=n*m*l) { gr->SetWarn(mglWarnDim,"Surf3A"); return; } + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Surf3A",cgid++); + + bool inv = (sch && strchr(sch,'-')); + long ss = gr->AddTexture(sch), pos; + + kx1 = new long[n*m]; kx2 = new long[n*m]; + ky1 = new long[n*m]; ky2 = new long[n*m]; + kz = new long[n*m]; + float c; + std::vector kk; + kk.reserve(n*m*l); + + mglPoint p,q,u; + float a0,b0; + for(k=0;kReserve(n*m); gr->Reserve(n*m); + for(j=0;jv(i,j,k); b0 = b->v(i,j,k); + if(iv(i+1,j,k)); + if(d>=0 && d<1) + { + if(both) p = mglPoint(x->v(i,j,k)*(1-d)+x->v(i+1,j,k)*d, + y->v(i,j,k)*(1-d)+y->v(i+1,j,k)*d, + z->v(i,j,k)*(1-d)+z->v(i+1,j,k)*d); + else p = mglPoint(x->v(i)*(1-d)+x->v(i+1)*d, y->v(j), z->v(k)); + c = gr->GetC(ss,b0*(1-d)+b->v(i+1,j,k)*d); + u = mglPoint(i+d,j,k); + q = mgl_find_norm(both, x,y,z,a, u, inv,n,m,l); + pos = gr->AddPnt(p,c,q); u.c=pos; + if(pos<0) continue; + kk.push_back(u); kx2[i1] = kk.size()-1; + } + } + if(jv(i,j+1,k)); + if(d>=0 && d<1) + { + if(both) p = mglPoint(x->v(i,j,k)*(1-d)+x->v(i,j+1,k)*d, + y->v(i,j,k)*(1-d)+y->v(i,j+1,k)*d, + z->v(i,j,k)*(1-d)+z->v(i,j+1,k)*d); + else p = mglPoint(x->v(i), y->v(j)*(1-d)+y->v(j+1)*d, z->v(k)); + c = gr->GetC(ss,b0*(1-d)+b->v(i,j+1,k)*d); + u = mglPoint(i,j+d,k); + q = mgl_find_norm(both, x,y,z,a, u, inv,n,m,l); + pos = gr->AddPnt(p,c,q); u.c=pos; + if(pos<0) continue; + kk.push_back(u); ky2[i1] = kk.size()-1; + } + } + if(k>0) + { + d = mgl_d(val,a->v(i,j,k-1),a0); + if(d>=0 && d<1) + { + if(both) p = mglPoint(x->v(i,j,k-1)*(1-d)+x->v(i,j,k)*d, + y->v(i,j,k-1)*(1-d)+y->v(i,j,k)*d, + z->v(i,j,k-1)*(1-d)+z->v(i,j,k)*d); + else p = mglPoint(x->v(i), y->v(j), z->v(k-1)*(1-d)+z->v(k)*d); + c = gr->GetC(ss,b->v(i,j,k-1)*(1-d)+b0*d); + u = mglPoint(i,j,k+d-1); + q = mgl_find_norm(both, x,y,z,a, u, inv,n,m,l); + pos = gr->AddPnt(p,c,q); u.c=pos; + if(pos<0) continue; + kk.push_back(u); kz[i1] = kk.size()-1; + } + } + } + if(k>0) mgl_surf3_plot(gr,n,m,kx1,kx2,ky1,ky2,kz,kk,wire); + } + gr->EndGroup(); + delete []kx1; delete []kx2; delete []ky1; + delete []ky2; delete []kz; +} +//----------------------------------------------------------------------------- +void mgl_surf3c_val(HMGL gr, float val, HCDT a, HCDT b, const char *sch, const char *opt) +{ + if(a->GetNx()<2 || a->GetNy()<2 || a->GetNz()<2) { gr->SetWarn(mglWarnLow,"Surf3C"); return; } + gr->SaveState(opt); + mglData x(a->GetNx()), y(a->GetNy()),z(a->GetNz()); + x.Fill(gr->Min.x,gr->Max.x); + y.Fill(gr->Min.y,gr->Max.y); + z.Fill(gr->Min.z,gr->Max.z); + mgl_surf3c_xyz_val(gr,val,&x,&y,&z,a,b,sch,0); +} +//----------------------------------------------------------------------------- +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); + for(long i=0;iMax.c + (gr->Min.c-gr->Max.c)*(i+1.)/(num+1); + mgl_surf3c_xyz_val(gr,v,x,y,z,a,b,sch,0); + } +} +//----------------------------------------------------------------------------- +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); + for(long i=0;iMax.c + (gr->Min.c-gr->Max.c)*(i+1.)/(num+1); + mgl_surf3c_val(gr,v,a,b,sch,0); + } +} +//----------------------------------------------------------------------------- +void mgl_surf3c_xyz_val_(uintptr_t *gr, float *Val, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surf3c_xyz_val(_GR_, *Val, _DA_(x), _DA_(y), _DA_(z), _DA_(a), _DA_(b), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_surf3c_val_(uintptr_t *gr, float *Val, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surf3c_val(_GR_, *Val, _DA_(a), _DA_(b), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_surf3c_xyz_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surf3c_xyz(_GR_, _DA_(x), _DA_(y), _DA_(z), _DA_(a), _DA_(b), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +void mgl_surf3c_(uintptr_t *gr, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int l,int lo) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + char *o=new char[lo+1]; memcpy(o,opt,lo); o[lo]=0; + mgl_surf3c(_GR_, _DA_(a), _DA_(b), s, o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Beam series +// +//----------------------------------------------------------------------------- +// flag & 0x1 -- accompanied coordinates +// flag & 0x2 -- project to r*z +// flag & 0x4 -- normalize field +void mgl_beam_val(HMGL gr, float val, HCDT tr, HCDT g1, HCDT g2, HCDT a, float r, const char *stl, int flag) +{ + long n = a->GetNz(),m=a->GetNx(),l=a->GetNy(); + if(n<2 || m<2 || l<2) { gr->SetWarn(mglWarnLow); return; } + if(a->Minimal()<0) { gr->SetWarn(mglWarnNeg); return; } + if(tr->GetNx()<3 || tr->GetNy()GetNx()<3 || g1->GetNy()GetNx()<3 || g2->GetNy()SetWarn(mglWarnDim,"Beam"); return; } + mglData x(a),y(a),z(a),b(a); + register long i,j,k,i0; + float asum=1, asum0=1, amax, aa; + r = fabs(r); + if(flag & 4) for(j=0;jvthr(j)*a->vthr(j); + if(asum0==0) { gr->SetWarn(mglWarnZero,"Beam"); return; } + for(i=0;ivthr(j+m*l*i); + asum += aa*aa; + amax = amax>aa ? amax : aa; + } + if(amax==0) { asum=0; amax=1; } + for(j=0;jMax.z*i/(n-1.); + } + else + { + x.a[i0] = tr->v(0,i) + g1->v(0,i)*(2*j/(m-1.)-1)*r + g2->v(0,i)*(2*k/(l-1.)-1)*r; + y.a[i0] = tr->v(1,i) + g1->v(1,i)*(2*j/(m-1.)-1)*r + g2->v(1,i)*(2*k/(l-1.)-1)*r; + z.a[i0] = tr->v(2,i) + g1->v(2,i)*(2*j/(m-1.)-1)*r + g2->v(2,i)*(2*k/(l-1.)-1)*r; + } + if(flag & 2) x.a[i0] = hypot(x.a[i0],y.a[i0]); + } + } + mgl_surf3_xyz_val(gr,val,&x,&y,&z,&b,stl,0); +} +//----------------------------------------------------------------------------- +void mgl_beam(HMGL gr, HCDT tr, HCDT g1, HCDT g2, HCDT a, float r, const char *stl, int flag, int num) +{ + num = num<=0 ? 1 : num; + for(long i=0;iMax.c + (gr->Min.c-gr->Max.c)*(i+1.)/(num+1); + mgl_beam_val(gr,v,tr,g1,g2,a,r,stl,flag); + } +} +//----------------------------------------------------------------------------- +void mgl_beam_val_(uintptr_t *gr, float *val, uintptr_t *tr, uintptr_t *g1, uintptr_t *g2, uintptr_t *a, float *r, const char *sch, int *norm,int l) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + mgl_beam_val(_GR_, *val,_DA_(tr),_DA_(g1),_DA_(g2),_DA_(a),*r,s,*norm); delete []s; } +//----------------------------------------------------------------------------- +void mgl_beam_(uintptr_t *gr, uintptr_t *tr, uintptr_t *g1, uintptr_t *g2, uintptr_t *a, float *r, const char *sch, int *norm, int *num,int l) +{ char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; + mgl_beam(_GR_, _DA_(tr), _DA_(g1), _DA_(g2), _DA_(a), *r,s,*norm,*num); delete []s; } +//----------------------------------------------------------------------------- diff --git a/test.cpp b/test.cpp new file mode 100644 index 0000000..c6c8d2b --- /dev/null +++ b/test.cpp @@ -0,0 +1,1943 @@ +/*************************************************************************** + * full_test.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +//#include +#include "mgl/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); +void mgls_prepare3d(mglData *a, mglData *b=0); +void mgls_prepare2v(mglData *a, mglData *b); +void mgls_prepare3v(mglData *ex, mglData *ey, mglData *ez); +//----------------------------------------------------------------------------- +int test(mglGraph *gr) +{ + gr->Rotate(40,60); + gr->Puts(mglPoint(0,0),"Test","t"); + gr->Puts(mglPoint(0,0),"Test","T"); + gr->Line(mglPoint(0),mglPoint(1),"r"); + gr->Puts(mglPoint(-1,0),mglPoint(1,1),"angle"); + gr->Line(mglPoint(-1,0),mglPoint(0,1),"r"); + gr->Label('x',"X axis"); gr->Label('y',"Y axis"); + gr->Axis(); gr->Grid(); + return 0; + + mglParse par; + par.AllowSetSize = true; + FILE *fp=fopen("test.mgl","rt"); + par.Execute(gr,fp,true); + fclose(fp); +/* gr->SetDrawReg(2,2,1); + gr->Rotate(40,60); + gr->Surf("sin(x*y)"); + gr->SubPlot(2,2,1); gr->Box();*/ + +// gr->Box(); + gr->ShowImage("",true); + return 0; +} +//============================================================================= +struct mglSample /// Structure for list of samples +{ + const char *name; + void (*func)(mglGraph*); +}; +//----------------------------------------------------------------------------- +int mgl_cmd_smp(const void *a, const void *b) +{ + const mglSample *aa = (const mglSample *)a; + const mglSample *bb = (const mglSample *)b; + return strcmp(aa->name, bb->name); +} +//----------------------------------------------------------------------------- +extern mglSample samp[]; +int type = 0; +int dotest = 0; +int width = 600; +int height = 400; +int mini = 0; +int big = 0; +int srnd = 0; +mglData s; +//----------------------------------------------------------------------------- +static struct option longopts[] = +{ + { "test", no_argument, &dotest, 1 }, + { "srnd", no_argument, &srnd, 1 }, + { "width", required_argument, NULL, 'w' }, + { "height", required_argument, NULL, 'h' }, + { "list", no_argument, NULL, 'l' }, + { "kind", required_argument, NULL, 'k' }, + { "thread", required_argument, NULL, 't' }, + { "mini", no_argument, &mini, 1 }, + { "big", no_argument, &big, 1 }, + { "png", no_argument, &type, 0 }, + { "eps", no_argument, &type, 1 }, + { "svg", no_argument, &type, 2 }, + { "solid", no_argument, &type, 3 }, + { "jpeg", no_argument, &type, 4 }, + { "idtf", no_argument, &type, 5 }, + { "gif", no_argument, &type, 6 }, + { "none", no_argument, &type, 7 }, + { "bps", no_argument, &type, 8 }, + { "u3d", no_argument, &type, 9 }, + { "pdf", no_argument, &type, 10 }, + { "help", no_argument, NULL, '?' }, + { NULL, 0, NULL, 0 } +}; +//----------------------------------------------------------------------------- +void usage() +{ + puts ( \ + "-png - output png\n" \ + "-width=num - png picture width\n" \ + "-height=num - png picture height\n" \ + "-mini - png picture is 200x133\n" \ + "-big - png picture is 1200x800\n" \ + "-idtf - output idtf\n" \ + "-u3d - output u3d\n" \ + "-pdf - output pdf\n" \ + "-eps - output EPS\n" \ + "-jpeg - output JPEG\n" \ + "-solid - output solid PNG\n" \ + "-svg - output SVG\n" \ + "-none - none output\n" \ + "-srnd - use the same random numbers in any run\n" \ + "-kind=name - produce only this picture" \ + "-thread=num - number of threads used" \ + "-test - perform test\n" + ); +// exit(0); +}; +//----------------------------------------------------------------------------- +void save(mglGraph *gr,const char *name,const char *suf="") +{ +// return; + char buf[128]; + printf("%s ",name); fflush(stdout); + switch(type) + { + case 1: // EPS + sprintf(buf,"%s%s.eps",name,suf); + gr->WriteEPS(buf); + break; + case 2: // SVG + sprintf(buf,"%s%s.svg",name,suf); + gr->WriteSVG(buf); break; + case 3: // PNG + sprintf(buf,"%s%s.png",name,suf); + gr->WritePNG(buf,0,true); break; + case 4: // JPEG + sprintf(buf,"%s%s.jpg",name,suf); + gr->WriteJPEG(buf); break; + case 5: // IDTF + sprintf(buf,"%s%s.idtf",name,suf); + gr->WriteIDTF(buf); break; + case 6: // GIF + sprintf(buf,"%s%s.gif",name,suf); + gr->WriteGIF(buf); break; + case 7: // none + break; + case 8: // EPS to PNG + sprintf(buf,"%s%s.png",name,suf); + gr->WritePNG(buf,0,false); + break; + case 9: // U3D + sprintf(buf,"%s%s.u3d",name,suf); +// gr->WriteU3D(buf); break; // TODO: Add IDTF support + case 10: // PDF + sprintf(buf,"%s%s.pdf",name,suf); +// gr->WritePDF(buf); break; // TODO: Add IDTF support + default:// PNG (no alpha) + sprintf(buf,"%s%s.png",name,suf); + gr->WritePNG(buf,0,false); break; + } +} +//----------------------------------------------------------------------------- +// Sample functions +//----------------------------------------------------------------------------- +void smgl_tval(mglGraph *gr) // ticks features +{ + gr->SetRanges(-M_PI,M_PI, 0, 2); + mreal val[]={-M_PI, -M_PI/2, 0, 0.886, M_PI/2, M_PI}; + mglData xt(6,val); + gr->SetTicksVal('x', xt, "-\\pi\n-\\pi/2\n\n0\nx^*\n\\pi/2\n\\pi"); + gr->Axis(); gr->Grid(); + gr->Plot("2*cos(x^2)^2", "r2"); +} +//----------------------------------------------------------------------------- +void smgl_fonts(mglGraph *gr) // ticks features +{ + float h=1.1, d=0.25; + gr->LoadFont("STIX"); gr->Puts(mglPoint(0,h), "default font (STIX)"); + gr->LoadFont("adventor"); gr->Puts(mglPoint(0,h-d), "adventor font"); + gr->LoadFont("bonum"); gr->Puts(mglPoint(0,h-2*d), "bonum font"); + gr->LoadFont("chorus"); gr->Puts(mglPoint(0,h-3*d), "chorus font"); + gr->LoadFont("cursor"); gr->Puts(mglPoint(0,h-4*d), "cursor font"); + gr->LoadFont("heros"); gr->Puts(mglPoint(0,h-5*d), "heros font"); + gr->LoadFont("heroscn"); gr->Puts(mglPoint(0,h-6*d), "heroscn font"); + gr->LoadFont("pagella"); gr->Puts(mglPoint(0,h-7*d), "pagella font"); + gr->LoadFont("schola"); gr->Puts(mglPoint(0,h-8*d), "schola font"); + gr->LoadFont("termes"); gr->Puts(mglPoint(0,h-9*d), "termes font"); + gr->LoadFont("STIX"); +} +//----------------------------------------------------------------------------- +void smgl_stick(mglGraph *gr) // column plot +{ + if(type==5 || type==9 || type==10) + gr->Puts(mglPoint(0,0),"Does not work in 3D\\n for reasons I do not care to investigate till 2.0"); + + gr->SetRanges(-1, 1, -1, 1, 0, 1); gr->Light(true); + gr->StickPlot(3, 0, 40, 30); gr->Axis("xyz_"); + gr->Surf("exp(-10*y^2-6*x^2)"); + gr->Puts(mglPoint(0.2, 0, 1.2), "z=0", "", -2); + gr->StickPlot(3, 1, 40, 30); gr->Axis("xyz_"); + gr->Surf("exp(-10*y^2/2-6*x^2)/sqrt(2)"); + gr->Puts(mglPoint(0.2, 0, 1.2), "z=1", "", -2); + gr->StickPlot(3, 2, 40, 30); gr->Axis("xyz_"); + gr->Surf("exp(-10*y^2/5-6*x^2)/sqrt(5)"); + gr->Puts(mglPoint(0.2, 0, 1.2), "z=2", "", -2); + gr->Label('x',"\\tau", 0); gr->Label('y', "\\rho"); +} +//----------------------------------------------------------------------------- +void smgl_column(mglGraph *gr) // column plot +{ + char str[32]; + for(int i=0;i<4;i++) + { + gr->ColumnPlot(4,i); + gr->Box(); + sprintf(str,"Plot %d of 4",i); + gr->Puts(mglPoint(-0.5,0.5),str); + sprintf(str,"sin(pi*x+pi*%d/2)",i); + gr->Plot(str); + } +} +//----------------------------------------------------------------------------- +void smgl_map(mglGraph *gr) // example of mapping +{ + mglData a(50, 40), b(50, 40); + gr->Puts(mglPoint(0, 0), "\\to", "C", -1.4); + gr->SetRanges(-1,1,-1,1,-2,2); + + gr->SubPlot(2, 1, 0); + gr->Fill(a,"x"); gr->Fill(b,"y"); + gr->Puts(mglPoint(0, 1.1), "\\{x, y\\}", "C", -2); gr->Box(); + gr->Map(a, b, "brgk"); + + gr->SubPlot(2, 1, 1); + gr->Fill(a,"(x^3+y^3)/2"); gr->Fill(b,"(x-y)/2"); + gr->Puts(mglPoint(0, 1.1), "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", "C", -2); + gr->Box(); + gr->Map(a, b, "brgk"); +} +//----------------------------------------------------------------------------- +void smgl_color_schemes(mglGraph *gr) // Color table +{ + mglData a(256,2); a.Fill(-1,1); + gr->SubPlot(2,10,0,0.2); gr->Dens(a,"kw"); + gr->Puts(mglPoint(-1.4, -0.3), "kw", "C", -8); + gr->SubPlot(2,10,1,0.2); gr->Dens(a,"wk"); + gr->Puts(mglPoint(-1.4, -0.3), "wk", "C", -8); + gr->SubPlot(2,10,2,0.2); gr->Dens(a,"kHCcw"); + gr->Puts(mglPoint(-1.4, -0.3), "kHCcw", "C", -8); + gr->SubPlot(2,10,3,0.2); gr->Dens(a,"kBbcw"); + gr->Puts(mglPoint(-1.4, -0.3), "kBbcw", "C", -8); + gr->SubPlot(2,10,4,0.2); gr->Dens(a,"kRryw"); + gr->Puts(mglPoint(-1.4, -0.3), "kRryw", "C", -8); + gr->SubPlot(2,10,5,0.2); gr->Dens(a,"kGgew"); + gr->Puts(mglPoint(-1.4, -0.3), "kGgew", "C", -8); + gr->SubPlot(2,10,6,0.2); gr->Dens(a,"BbwrR"); + gr->Puts(mglPoint(-1.4, -0.3), "BbwrR", "C", -8); + gr->SubPlot(2,10,7,0.2); gr->Dens(a,"BbwgG"); + gr->Puts(mglPoint(-1.4, -0.3), "BbwgG", "C", -8); + gr->SubPlot(2,10,8,0.2); gr->Dens(a,"GgwmM"); + gr->Puts(mglPoint(-1.4, -0.3), "GgwmM", "C", -8); + gr->SubPlot(2,10,9,0.2); gr->Dens(a,"UuwqR"); + gr->Puts(mglPoint(-1.4, -0.3), "UuwqR", "C", -8); + gr->SubPlot(2,10,10,0.2); gr->Dens(a,"QqwcC"); + gr->Puts(mglPoint(-1.4, -0.3), "QqwcC", "C", -8); + gr->SubPlot(2,10,11,0.2); gr->Dens(a,"CcwyY"); + gr->Puts(mglPoint(-1.4, -0.3), "CcwyY", "C", -8); + gr->SubPlot(2,10,12,0.2); gr->Dens(a,"bcwyr"); + gr->Puts(mglPoint(-1.4, -0.3), "bcwyr", "C", -8); + gr->SubPlot(2,10,13,0.2); gr->Dens(a,"bwr"); + gr->Puts(mglPoint(-1.4, -0.3), "bwr", "C", -8); + gr->SubPlot(2,10,14,0.2); gr->Dens(a,"BbcyrR"); + gr->Puts(mglPoint(-1.4, -0.3), "BbcyrR", "C", -8); + gr->SubPlot(2,10,15,0.2); gr->Dens(a,"UbcyqR"); + gr->Puts(mglPoint(-1.4, -0.3), "UbcyqR", "C", -8); + gr->SubPlot(2,10,16,0.2); gr->Dens(a,"BbcwyrR"); + gr->Puts(mglPoint(-1.4, -0.3), "BbcwyrR", "C", -8); + gr->SubPlot(2,10,17,0.2); gr->Dens(a,"bcyr"); + gr->Puts(mglPoint(-1.4, -0.3), "bcyr", "C", -8); + gr->SubPlot(2,10,18,0.2); gr->Dens(a,"BbcyrR|"); + gr->Puts(mglPoint(-1.4, -0.3), "BbcyrR|", "C", -8); + gr->SubPlot(2,10,19,0.2); gr->Dens(a,"bgr"); + gr->Puts(mglPoint(-1.4, -0.3), "bgr", "C", -8); +} +//----------------------------------------------------------------------------- +void smgl_colors(mglGraph *gr) // Color table +{ + //#LENUQ + gr->FaceZ(mglPoint(-1, -1), 0.4, 0.3, "L#"); gr->Puts(mglPoint(-0.8,-0.9), "L", "C:w", -1.4); + gr->FaceZ(mglPoint(-0.6,-1), 0.4, 0.3, "E#"); gr->Puts(mglPoint(-0.4,-0.9), "E", "C:w", -1.4); + gr->FaceZ(mglPoint(-0.2,-1), 0.4, 0.3, "N#"); gr->Puts(mglPoint(0, -0.9), "N", "C:w", -1.4); + gr->FaceZ(mglPoint(0.2, -1), 0.4, 0.3, "U#"); gr->Puts(mglPoint(0.4,-0.9), "U", "C:w", -1.4); + gr->FaceZ(mglPoint(0.6, -1), 0.4, 0.3, "Q#"); gr->Puts(mglPoint(0.8,-0.9), "Q", "C:w", -1.4); + //#lenuq + gr->FaceZ(mglPoint(-1, -0.7), 0.4, 0.3, "l#"); gr->Puts(mglPoint(-0.8,-0.6), "l", "C:k", -1.4); + gr->FaceZ(mglPoint(-0.6,-0.7), 0.4, 0.3, "e#"); gr->Puts(mglPoint(-0.4,-0.6), "e", "C:k", -1.4); + gr->FaceZ(mglPoint(-0.2,-0.7), 0.4, 0.3, "n#"); gr->Puts(mglPoint(0, -0.6), "n", "C:k", -1.4); + gr->FaceZ(mglPoint(0.2, -0.7), 0.4, 0.3, "u#"); gr->Puts(mglPoint(0.4,-0.6), "u", "C:k", -1.4); + gr->FaceZ(mglPoint(0.6, -0.7), 0.4, 0.3, "q#"); gr->Puts(mglPoint(0.8,-0.6), "q", "C:k", -1.4); + //#CMYkP + gr->FaceZ(mglPoint(-1, -0.4), 0.4, 0.3, "C#"); gr->Puts(mglPoint(-0.8,-0.3), "C", "C:w", -1.4); + gr->FaceZ(mglPoint(-0.6,-0.4), 0.4, 0.3, "M#"); gr->Puts(mglPoint(-0.4,-0.3), "M", "C:w", -1.4); + gr->FaceZ(mglPoint(-0.2,-0.4), 0.4, 0.3, "Y#"); gr->Puts(mglPoint(0, -0.3), "Y", "C:w", -1.4); + gr->FaceZ(mglPoint(0.2, -0.4), 0.4, 0.3, "k#"); gr->Puts(mglPoint(0.4,-0.3), "k", "C:w", -1.4); + gr->FaceZ(mglPoint(0.6, -0.4), 0.4, 0.3, "P#"); gr->Puts(mglPoint(0.8,-0.3), "P", "C:w", -1.4); + //#cmywp + gr->FaceZ(mglPoint(-1, -0.1), 0.4, 0.3, "c#"); gr->Puts(mglPoint(-0.8, 0), "c", "C:k", -1.4); + gr->FaceZ(mglPoint(-0.6,-0.1), 0.4, 0.3, "m#"); gr->Puts(mglPoint(-0.4, 0), "m", "C:k", -1.4); + gr->FaceZ(mglPoint(-0.2,-0.1), 0.4, 0.3, "y#"); gr->Puts(mglPoint(0, 0), "y", "C:k", -1.4); + gr->FaceZ(mglPoint(0.2, -0.1), 0.4, 0.3, "w#"); gr->Puts(mglPoint(0.4, 0), "w", "C:k", -1.4); + gr->FaceZ(mglPoint(0.6, -0.1), 0.4, 0.3, "p#"); gr->Puts(mglPoint(0.8, 0), "p", "C:k", -1.4); + //#BGRHW + gr->FaceZ(mglPoint(-1, 0.2), 0.4, 0.3, "B#"); gr->Puts(mglPoint(-0.8, 0.3), "B", "C:w", -1.4); + gr->FaceZ(mglPoint(-0.6,0.2), 0.4, 0.3, "G#"); gr->Puts(mglPoint(-0.4, 0.3), "G", "C:w", -1.4); + gr->FaceZ(mglPoint(-0.2,0.2), 0.4, 0.3, "R#"); gr->Puts(mglPoint(0, 0.3), "R", "C:w", -1.4); + gr->FaceZ(mglPoint(0.2, 0.2), 0.4, 0.3, "H#"); gr->Puts(mglPoint(0.4, 0.3), "H", "C:w", -1.4); + gr->FaceZ(mglPoint(0.6, 0.2), 0.4, 0.3, "W#"); gr->Puts(mglPoint(0.8, 0.3), "W", "C:w", -1.4); + //#bgrhw + gr->FaceZ(mglPoint(-1, 0.5), 0.4, 0.3, "b#"); gr->Puts(mglPoint(-0.8, 0.6), "b", "C:k", -1.4); + gr->FaceZ(mglPoint(-0.6,0.5), 0.4, 0.3, "g#"); gr->Puts(mglPoint(-0.4, 0.6), "g", "C:k", -1.4); + gr->FaceZ(mglPoint(-0.2,0.5), 0.4, 0.3, "r#"); gr->Puts(mglPoint(0, 0.6), "r", "C:k", -1.4); + gr->FaceZ(mglPoint(0.2, 0.5), 0.4, 0.3, "h#"); gr->Puts(mglPoint(0.4, 0.6), "h", "C:k", -1.4); + gr->FaceZ(mglPoint(0.6, 0.5), 0.4, 0.3, "w#"); gr->Puts(mglPoint(0.8, 0.6), "w", "C:k", -1.4); + //#brighted + gr->FaceZ(mglPoint(-1, 0.8), 0.4, 0.3, "{r1}#"); gr->Puts(mglPoint(-0.8, 0.9), "\\{r1\\}", "C:w", -1.4); + gr->FaceZ(mglPoint(-0.6,0.8), 0.4, 0.3, "{r3}#"); gr->Puts(mglPoint(-0.4, 0.9), "\\{r3\\}", "C:w", -1.4); + gr->FaceZ(mglPoint(-0.2,0.8), 0.4, 0.3, "{r5}#"); gr->Puts(mglPoint(0, 0.9), "\\{r5\\}", "C:k", -1.4); + gr->FaceZ(mglPoint(0.2, 0.8), 0.4, 0.3, "{r7}#"); gr->Puts(mglPoint(0.4, 0.9), "\\{r7\\}", "C:k", -1.4); + gr->FaceZ(mglPoint(0.6, 0.8), 0.4, 0.3, "{r9}#"); gr->Puts(mglPoint(0.8, 0.9), "\\{r9\\}", "C:k", -1.4); +} +//----------------------------------------------------------------------------- +void smgl_qo2d(mglGraph *gr) +{ + gr->Compression(true); // try to save space + mglData r, xx, yy, a, im(128), re(128); + const char *ham = "p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)"; + r = mglRay(ham, mglPoint(-0.7, -1), mglPoint(0, 0.5), 0.02, 2); + gr->Plot(r.SubData(0), r.SubData(1), "k"); + gr->Axis(); gr->Label('x', "\\i x"); gr->Label('y', "\\i z"); + // now start beam tracing + gr->Fill(re,"exp(-48*x^2)"); + a = mglQO2d(ham, re, im, r, 1, 30, &xx, &yy); + gr->SetRange('c',0, 1); + gr->Dens(xx, yy, a, "wyrRk"); + gr->Plot("-x", "k|"); + gr->Puts(mglPoint(0, 0.85), "absorption: (x+y)/2 for x+y>0"); + gr->Puts(mglPoint(0.7, -0.05), "central ray"); + gr->Puts(mglPoint(0,1.1),"Beam and ray tracing"); + gr->Compression(false); //put setting back +} +//----------------------------------------------------------------------------- +void smgl_pde(mglGraph *gr) // PDE and Ray sample +{ + gr->Compression(true); // try to save space + mglData a,re(128),im(128); + gr->Axis(); + gr->Label('x', "\\i x"); + gr->Label('y', "\\i z"); + + gr->Fill(re,"exp(-48*(x+0.7)^2)"); + a = gr->PDE("p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)", re, im, 0.01, 30); + a.Transpose("yxz"); + gr->SetRange('c',0, 1); + gr->Dens(a,"wyrRk"); + gr->Plot("-x", "k|"); + gr->Puts(mglPoint(0, 0.85), "absorption: (x+z)/2 for x+z>0"); + gr->Puts(mglPoint(0,1.1),"Equation: ik_0\\partial_zu + \\Delta u + x\\cdot u + i \\frac{x+z}{2}\\cdot u = 0"); + gr->Compression(false); //put setting back +} +//----------------------------------------------------------------------------- +void smgl_stfa(mglGraph *gr) // STFA sample +{ + mglData a(2000), b(2000); + gr->Fill(a,"cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+\ + cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)"); + gr->SubPlot(1, 2, 0); + gr->Plot(a); + gr->Axis(); + gr->Label('x', "\\i t"); + + gr->SubPlot(1, 2, 1); + gr->STFA(a, b, 64, "BbcyrR"); + gr->Axis(); + gr->Label('x', "\\i t"); + gr->Label('y', "\\omega", 0); +} +//----------------------------------------------------------------------------- +void smgl_envelop(mglGraph *gr) // Envelop reconstruction +{ + mglData a(1000); + gr->Fill(a,"exp(-8*x^2)*sin(10*pi*x)"); + gr->Plot(a, "b"); + a.Envelop('x'); + gr->Plot(a, "r"); + gr->Axis(); +} +//----------------------------------------------------------------------------- +void smgl_sew(mglGraph *gr) // Phase reconstruction +{ + gr->VertexColor(false); + mglData a(100, 100); + a.Modify("mod((y^2-(1-x)^2)/2,0.1)"); + gr->Rotate(40, 60); + gr->Light(true); + gr->Alpha(true); + gr->Surf(a, "b"); + a.Sew("xy", 0.1); + gr->Surf(a, "r"); + gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_samplee(mglGraph *gr) // TeX sample +{ + gr->Puts(mglPoint(0), "\\sqrt{\\frac{\\alpha^{\\gamma^2}+\\overset 1{\\big\\infty}}{\\sqrt3{2+b}}}", 0, -4); +} +//----------------------------------------------------------------------------- +void smgl_sampled(mglGraph *gr) // arrow styles +{ + mreal a=0.1,b=0.4,c=0.5; + gr->Line(mglPoint(a,1),mglPoint(b,1),"k-A"); gr->Puts(mglPoint(c,1),"Style 'A' or 'A\\_'","rL"); + gr->Line(mglPoint(a,0.8),mglPoint(b,0.8),"k-V"); gr->Puts(mglPoint(c,0.8),"Style 'V' or 'V\\_'","rL"); + gr->Line(mglPoint(a,0.6),mglPoint(b,0.6),"k-K"); gr->Puts(mglPoint(c,0.6),"Style 'K' or 'K\\_'","rL"); + gr->Line(mglPoint(a,0.4),mglPoint(b,0.4),"k-I"); gr->Puts(mglPoint(c,0.4),"Style 'I' or 'I\\_'","rL"); + gr->Line(mglPoint(a,0.2),mglPoint(b,0.2),"k-D"); gr->Puts(mglPoint(c,0.2),"Style 'D' or 'D\\_'","rL"); + gr->Line(mglPoint(a,0),mglPoint(b,0),"k-S"); gr->Puts(mglPoint(c,0),"Style 'S' or 'S\\_'","rL"); + gr->Line(mglPoint(a,-0.2),mglPoint(b,-0.2),"k-O"); gr->Puts(mglPoint(c,-0.2),"Style 'O' or 'O\\_'","rL"); + gr->Line(mglPoint(a,-0.4),mglPoint(b,-0.4),"k-T"); gr->Puts(mglPoint(c,-0.4),"Style 'T' or 'T\\_'","rL"); + gr->Line(mglPoint(a,-0.6),mglPoint(b,-0.6),"k-_"); gr->Puts(mglPoint(c,-0.6),"Style '\\_' or none","rL"); + gr->Line(mglPoint(a,-0.8),mglPoint(b,-0.8),"k-AS"); gr->Puts(mglPoint(c,-0.8),"Style 'AS'","rL"); + gr->Line(mglPoint(a,-1),mglPoint(b,-1),"k-_A"); gr->Puts(mglPoint(c,-1),"Style '\\_A'","rL"); + + a=-1; b=-0.7; c=-0.6; + gr->Line(mglPoint(a,1),mglPoint(b,1),"kAA"); gr->Puts(mglPoint(c,1),"Style 'AA'","rL"); + gr->Line(mglPoint(a,0.8),mglPoint(b,0.8),"kVV"); gr->Puts(mglPoint(c,0.8),"Style 'VV'","rL"); + gr->Line(mglPoint(a,0.6),mglPoint(b,0.6),"kKK"); gr->Puts(mglPoint(c,0.6),"Style 'KK'","rL"); + gr->Line(mglPoint(a,0.4),mglPoint(b,0.4),"kII"); gr->Puts(mglPoint(c,0.4),"Style 'II'","rL"); + gr->Line(mglPoint(a,0.2),mglPoint(b,0.2),"kDD"); gr->Puts(mglPoint(c,0.2),"Style 'DD'","rL"); + gr->Line(mglPoint(a,0),mglPoint(b,0),"kSS"); gr->Puts(mglPoint(c,0),"Style 'SS'","rL"); + gr->Line(mglPoint(a,-0.2),mglPoint(b,-0.2),"kOO"); gr->Puts(mglPoint(c,-0.2),"Style 'OO'","rL"); + gr->Line(mglPoint(a,-0.4),mglPoint(b,-0.4),"kTT"); gr->Puts(mglPoint(c,-0.4),"Style 'TT'","rL"); + gr->Line(mglPoint(a,-0.6),mglPoint(b,-0.6),"k-__"); gr->Puts(mglPoint(c,-0.6),"Style '\\_\\_'","rL"); + gr->Line(mglPoint(a,-0.8),mglPoint(b,-0.8),"k-VA"); gr->Puts(mglPoint(c,-0.8),"Style 'VA'","rL"); + gr->Line(mglPoint(a,-1),mglPoint(b,-1),"k-AV"); gr->Puts(mglPoint(c,-1),"Style 'AV'","rL"); +} +//----------------------------------------------------------------------------- +void smgl_samplec(mglGraph *gr) // error boxes +{ + mglData x(10), y(10), ex(10), ey(10), y0(50); + x.Modify("2*x-1 + 0.2*rnd-0.1"); + y.Modify("(2*x-1)^2 + 0.2*rnd-0.1"); + y0.Modify("(2*x-1)^2"); + ex.Modify("0.2"); + ey.Modify("0.1"); + + gr->Clf(); + gr->SubPlot(2,2,0); + gr->Error(y,ey,"ko"); + gr->Plot(y0,"r"); + gr->Axis(); + gr->Puts(mglPoint(0,1.2,0),"Random \\i{y}"); + gr->SubPlot(2,2,1); + gr->Error(x,y,ex,"ko"); + gr->Plot(y0,"r"); + gr->Axis(); + gr->Puts(mglPoint(0,1.2,0),"Random \\i{x, y}"); + gr->SubPlot(2,2,2); + gr->Error(x,y,ey,ey,"ko"); + gr->Plot(y0,"r"); + gr->Axis(); + gr->Puts(mglPoint(0,1.2,0),"Random \\i{x, y} and 2d boxes"); + gr->SubPlot(2,2,3); + gr->Puts(mglPoint(0,1.2,0),"Random point in 3d space"); + gr->Rotate(40,60); + for(int i=0;i<10;i++) + gr->Error(mglPoint(mgl_rnd()-0.5,mgl_rnd()-0.5,mgl_rnd()-0.5), mglPoint(0.1,0.1,0.1),"bo"); + gr->Axis(); + gr->Rotate(0,0); // for unrotate in IDTF +} +//----------------------------------------------------------------------------- +void smgl_sampleb(mglGraph *gr) // Gaussian beam +{ + gr->Alpha(true); gr->Light(true); gr->AddLight(0,mglPoint(0,0,1)); + mglData a(30,30,30), b(30,30,30); + a.Modify("exp(-16*((z-0.5)^2+(y-0.5)^2)/(1+4*x^2))"); + b.Modify("16*((z-0.5)^2+(y-0.5)^2)*(x)/(1+4*x^2)"); + gr->SetRange('c',0,1); + + gr->SubPlot(2,2,0); gr->Rotate(40,60); + gr->VertexColor(false); + // since we have one-color trasparent surfaces - disable (per-vertex) coloring + gr->Surf3(a,"wgk"); gr->Box(); + gr->SubPlot(2,2,1); gr->Rotate(40,60); + gr->Dens3(a,'x'); gr->Dens3(a,'y'); gr->Dens3(a,'z'); + gr->Box(); gr->Axis(); + gr->SubPlot(2,2,2); gr->Rotate(40,60); + gr->Cloud(a); gr->Box(); + gr->SubPlot(2,2,3); gr->Rotate(40,60); + gr->VertexColor(false); + // for variable transparency the only way is to disable smooth (per-vertex) coloring + gr->Surf3A(b,a,"q"); gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_samplea(mglGraph *gr) // flag # +{ + gr->Alpha(true); gr->Light(true); gr->AddLight(0,mglPoint(0,0,1)); + mglData a(30,20); + a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); + + gr->SubPlot(2,2,0); gr->Rotate(40,60); + gr->Surf(a,"BbcyrR#"); gr->Box(); + gr->SubPlot(2,2,1); gr->Rotate(40,60); + gr->Dens(a,"BbcyrR#"); gr->Box(); + gr->SubPlot(2,2,2); gr->Rotate(40,60); + gr->Cont(a,"BbcyrR#"); gr->Box(); + gr->SubPlot(2,2,3); gr->Rotate(40,60); + gr->Axial(a,"BbcyrR#"); gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_sample9(mglGraph *gr) // 2d plot +{ + gr->Light(true); gr->AddLight(0,mglPoint(0,0,1)); + + mglData a0(50,40); + a0.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); + gr->SubPlot(2,2,0); gr->Rotate(60,40); + gr->Surf(a0); gr->Box(); + + mglData x(50,40),y(50,40),z(50,40); + x.Modify("0.8*sin(2*pi*x)*sin(pi*y)"); + y.Modify("0.8*cos(2*pi*x)*sin(pi*y)"); + z.Modify("0.8*cos(pi*y)"); + gr->SubPlot(2,2,1); gr->Rotate(60,40); + gr->Surf(x,y,z,"BbwrR"); gr->Box(); + + mglData a1(50,40,3); + a1.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); + a1.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*sin(3*pi*(x*y))",1); + a1.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",2); + gr->SubPlot(2,2,2); gr->Rotate(60,40); + gr->Alpha(true); + gr->Surf(a1); gr->Box(); + + gr->SubPlot(2,2,3); gr->Rotate(60,40); + gr->Dens(a1); gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_sample8(mglGraph *gr) // 1d plot +{ + mglData y0(50); y0.Modify("sin(pi*(2*x-1))"); + gr->SubPlot(2,2,0); + gr->Plot(y0); gr->Box(); + + gr->SubPlot(2,2,1); + mglData y1(50,2); + y1.Modify("sin(pi*2*x-pi)"); y1.Modify("cos(pi*2*x-pi)/2",1); + gr->Plot(y1); gr->Box(); + + mglData x(50); x.Modify("cos(pi*2*x-pi)"); + gr->Plot(x,y0,"Y+"); + + gr->Plot(y1.SubData(-1,0),y1.SubData(-1,1),"q|"); + + gr->SubPlot(2,2,2); gr->Rotate(60,40); + mglData z(50); z.Modify("2*x-1"); + gr->Plot(x,y0,z); gr->Box(); + + mglData y2(10,3); y2.Modify("cos(pi*(2*x-1-y))"); + y2.Modify("2*x-1",2); + gr->Plot(y2.SubData(-1,0),y2.SubData(-1,1),y2.SubData(-1,2),"bo "); + + gr->SubPlot(2,2,3); gr->Rotate(60,40); + gr->Bars(x,y0,z,"ri"); gr->Box(); + + gr->Rotate(0,0); // for unrotate in IDTF +} +//----------------------------------------------------------------------------- +void smgl_sample7(mglGraph *gr) // smoothing +{ + mglData y0(30),y1,y2,y3; + y0.Modify("0.4*sin(2*pi*x) + 0.3*cos(3*pi*x) - 0.4*sin(4*pi*x)+0.2*rnd"); + + y1=y0; y1.Smooth("3"); + y2=y0; y2.Smooth("5"); + y3=y0; y3.Smooth(""); + + gr->Plot(y0,"k"); gr->AddLegend("NONE","k"); + gr->Plot(y1,"r"); gr->AddLegend("LINE\\_3","r"); + gr->Plot(y2,"g"); gr->AddLegend("LINE\\_5","g"); + gr->Plot(y3,"b"); gr->AddLegend("QUAD\\_5","b"); + gr->Legend(); gr->Box(); + gr->ClearLegend(); // clear legend strings +} +//----------------------------------------------------------------------------- +void smgl_sample6(mglGraph *gr) // differentiate +{ + mglData a(30,40); a.Modify("x*y"); + gr->SetRanges(0,1,0,1,0,1); + gr->SubPlot(2,2,0); gr->Rotate(60,40); + gr->Surf(a); gr->Box(); + gr->Puts(mglPoint(0.7,1,1.2),"a(x,y)"); + gr->SubPlot(2,2,1); gr->Rotate(60,40); + a.Diff("x"); gr->Surf(a); gr->Box(); + gr->Puts(mglPoint(0.7,1,1.2),"da/dx"); + gr->SubPlot(2,2,2); gr->Rotate(60,40); + a.Integral("xy"); gr->Surf(a); gr->Box(); + gr->Puts(mglPoint(0.7,1,1.2),"\\int da/dx dxdy"); + gr->SubPlot(2,2,3); gr->Rotate(60,40); + a.Diff2("y"); gr->Surf(a); gr->Box(); + gr->Puts(mglPoint(0.7,1,1.2),"\\int {d^2}a/dxdy dx"); +} +//----------------------------------------------------------------------------- +void smgl_sample5(mglGraph *gr) // pen styles +{ + if(type==5 || type==9 || type==10) gr->Puts(mglPoint(0,1.2),"line styles not supported","rL"); + mreal d,x1,x2,x0,y=0.95; + d=0.3, x0=0.2, x1=0.5, x2=0.6; + gr->Line(mglPoint(x0,1-0*d),mglPoint(x1,1-0*d),"k-"); gr->Puts(mglPoint(x2,y-0*d),"Solid '-'","rL"); + gr->Line(mglPoint(x0,1-1*d),mglPoint(x1,1-1*d),"k|"); gr->Puts(mglPoint(x2,y-1*d),"Long Dash '|'","rL"); + gr->Line(mglPoint(x0,1-2*d),mglPoint(x1,1-2*d),"k;"); gr->Puts(mglPoint(x2,y-2*d),"Dash ';'","rL"); + gr->Line(mglPoint(x0,1-3*d),mglPoint(x1,1-3*d),"k="); gr->Puts(mglPoint(x2,y-3*d),"Small dash '='","rL"); + gr->Line(mglPoint(x0,1-4*d),mglPoint(x1,1-4*d),"kj"); gr->Puts(mglPoint(x2,y-4*d),"Dash-dot 'j'","rL"); + gr->Line(mglPoint(x0,1-5*d),mglPoint(x1,1-5*d),"ki"); gr->Puts(mglPoint(x2,y-5*d),"Small dash-dot 'i'","rL"); + gr->Line(mglPoint(x0,1-6*d),mglPoint(x1,1-6*d),"k:"); gr->Puts(mglPoint(x2,y-6*d),"Dots ':'","rL"); + gr->Line(mglPoint(x0,1-7*d),mglPoint(x1,1-7*d),"k "); gr->Puts(mglPoint(x2,y-7*d),"None ' '","rL"); + + d=0.25; x1=-1; x0=-0.8; y = -0.05; + gr->Mark(mglPoint(x1,5*d),"."); gr->Puts(mglPoint(x0,y+5*d),"'.'","rL"); + gr->Mark(mglPoint(x1,4*d),"+"); gr->Puts(mglPoint(x0,y+4*d),"'+'","rL"); + gr->Mark(mglPoint(x1,3*d),"x"); gr->Puts(mglPoint(x0,y+3*d),"'x'","rL"); + gr->Mark(mglPoint(x1,2*d),"*"); gr->Puts(mglPoint(x0,y+2*d),"'*'","rL"); + gr->Mark(mglPoint(x1,d),"s"); gr->Puts(mglPoint(x0,y+d),"'s'","rL"); + gr->Mark(mglPoint(x1,0),"d"); gr->Puts(mglPoint(x0,y),"'d'","rL"); + gr->Mark(mglPoint(x1,-d,0),"o"); gr->Puts(mglPoint(x0,y-d),"'o'","rL"); + gr->Mark(mglPoint(x1,-2*d,0),"^"); gr->Puts(mglPoint(x0,y-2*d),"'\\^'","rL"); + gr->Mark(mglPoint(x1,-3*d,0),"v"); gr->Puts(mglPoint(x0,y-3*d),"'v'","rL"); + gr->Mark(mglPoint(x1,-4*d,0),"<"); gr->Puts(mglPoint(x0,y-4*d),"'<'","rL"); + gr->Mark(mglPoint(x1,-5*d,0),">"); gr->Puts(mglPoint(x0,y-5*d),"'>'","rL"); + + d=0.25; x1=-0.5; x0=-0.3; y = -0.05; + gr->Mark(mglPoint(x1,5*d),"C"); gr->Puts(mglPoint(x0,y+5*d),"'\\#.'","rL"); + gr->Mark(mglPoint(x1,4*d),"P"); gr->Puts(mglPoint(x0,y+4*d),"'\\#+'","rL"); + gr->Mark(mglPoint(x1,3*d),"X"); gr->Puts(mglPoint(x0,y+3*d),"'\\#x'","rL"); + gr->Mark(mglPoint(x1,2*d),"Y"); gr->Puts(mglPoint(x0,y+2*d),"'\\#*'","rL"); + gr->Mark(mglPoint(x1,d),"S"); gr->Puts(mglPoint(x0,y+d),"'\\#s'","rL"); + gr->Mark(mglPoint(x1,0),"D"); gr->Puts(mglPoint(x0,y),"'\\#d'","rL"); + gr->Mark(mglPoint(x1,-d,0),"O"); gr->Puts(mglPoint(x0,y-d),"'\\#o'","rL"); + gr->Mark(mglPoint(x1,-2*d,0),"T"); gr->Puts(mglPoint(x0,y-2*d),"'\\#\\^'","rL"); + gr->Mark(mglPoint(x1,-3*d,0),"V"); gr->Puts(mglPoint(x0,y-3*d),"'\\#v'","rL"); + gr->Mark(mglPoint(x1,-4*d,0),"L"); gr->Puts(mglPoint(x0,y-4*d),"'\\#<'","rL"); + gr->Mark(mglPoint(x1,-5*d,0),"R"); gr->Puts(mglPoint(x0,y-5*d),"'\\#>'","rL"); +} +//----------------------------------------------------------------------------- +void smgl_sample4(mglGraph *gr) // font features +{ +// setlocale(LC_CTYPE, "ru_RU.cp1251"); +// gr->Putsw(mglPoint(0,1),L"Text can be in english è â Þíèêîäå"); + gr->Putsw(mglPoint(0,1),L"Text can be in ASCII and in Unicode"); + gr->Puts(mglPoint(0,0.6),"It can be \\wire{wire}, \\big{big} or #r{colored}"); + gr->Puts(mglPoint(0,0.2),"One can change style in string: " + "\\b{bold}, \\i{italic, \\b{both}}"); + gr->Puts(mglPoint(0,-0.2),"Easy to \\a{overline} or " + "\\u{underline}"); + gr->Puts(mglPoint(0,-0.6),"Easy to change indexes ^{up} _{down} @{center}"); + gr->Puts(mglPoint(0,-1),"It parse TeX: \\int \\alpha \\cdot " + "\\sqrt3{sin(\\pi x)^2 + \\gamma_{i_k}} dx"); +} +//----------------------------------------------------------------------------- +void smgl_sample3(mglGraph *gr) // curvilinear coordinates +{ + mglData x(50),y(50),z(50); + y.Fill(0.5,0.5); + x.Fill(-1,1); // create data arrays + + gr->SetRanges(mglPoint(-1,-1,-1),mglPoint(1,1,1)); + gr->SetOrigin(-1,1,-1); gr->SetTicks('z', 0.5); // set tick step to 0.5 + + gr->SubPlot(2,2,0); + gr->Rotate(60,40); + gr->Plot(x,y,z,"r2"); + gr->Axis(); gr->Grid(); + gr->Puts(mglPoint(0,1.3,1),"Cartesian"); + + gr->SubPlot(2,2,1); + gr->SetFunc("y*sin(pi*x)","y*cos(pi*x)",0); + gr->Rotate(60,40); + gr->Plot(x,y,z,"r2"); + gr->Axis(); gr->Grid(); + gr->Puts(mglPoint(0,1.3,1),"Cylindrical"); + + gr->SubPlot(2,2,2); + gr->Rotate(60,40); + gr->SetFunc("2*y*x","y*y - x*x",0); + gr->Plot(x,y,z,"r2"); + gr->Axis(); gr->Grid(); + gr->Puts(mglPoint(0,1.3,1),"Parabolic"); + + gr->SubPlot(2,2,3); + gr->Rotate(60,40); + gr->SetFunc("y*sin(pi*x)","y*cos(pi*x)","x+z"); + gr->Plot(x,y,z,"r2"); + gr->Axis(); gr->Grid(); + gr->Puts(mglPoint(0,1.3,1),"Spiral"); + gr->SetFunc(0,0,0); // set to default Cartesian +} +//----------------------------------------------------------------------------- +void smgl_sample2(mglGraph *gr) // axis and grid +{ + gr->SubPlot(2,2,0); + gr->SetTicks('x', 0.4, 3); // sets tick step to 0.4 + gr->SetTicks('y', 0.4, 3); // and draws 3 subticks + gr->Box(); // should be after the ticks change + gr->Axis("xy"); + gr->Grid(); + gr->Puts(mglPoint(0,1.3,1),"Axis and grid"); + + gr->SetTicks('x'); gr->SetTicks('y'); // restore back + gr->SetRanges(mglPoint(-1,-1,-1),mglPoint(1,1,1)); gr->SetOrigin(0,0,0); + + gr->SubPlot(2,2,1); + gr->Rotate(60,40); + gr->Axis(); + gr->Label('x',"x"); + gr->Label('y',"y"); + gr->Label('z',"z"); + gr->Puts(mglPoint(0,0,1.5),"Axis and labels"); + + gr->SubPlot(2,2,2); + gr->Rotate(60,40); + gr->SetTicks('x', 0.2); gr->SetTicks('y', 0.2); + gr->SetTicks('z', 0.2); // too low step of ticks + gr->SetRanges(mglPoint(-1,-1,-1),mglPoint(1,1,1)); gr->SetOrigin(-1,-1,-1); + gr->Axis(); + gr->Grid(); + gr->Puts(mglPoint(0,0,1.5),"Shift origin and add grid"); + gr->Puts(mglPoint(0,0,1.2),"(note, too many ticks)"); + + gr->SubPlot(2,2,3); + gr->Rotate(60,40); + gr->SetTicks('x', -6); // decrease the number of ticks + gr->SetTicks('y', -6); + gr->Axis("yz"); + gr->Label('y',"Y axis",0); + gr->Label('z',"Z axis",0); + gr->Puts(mglPoint(0,0,1.5),"Remove X axis, and"); + gr->Puts(mglPoint(0,0,1.2),"decrease number of ticks"); + + gr->Rotate(0,0); // for unrotate in IDTF +} +//----------------------------------------------------------------------------- +void smgl_sample1(mglGraph *gr) // transformation +{ + gr->SubPlot(2,2,0); // just new axis without rotation and aspects + gr->Box(); + gr->Puts(mglPoint(-1,1.1,1),"Just box","rL"); + gr->InPlot(0.2,0.5,0.7,1,false); + gr->Box(); + gr->Puts(mglPoint(0,1.2,1),"InPlot example"); + gr->SubPlot(2,2,1); // new axis with aspect and rotation + gr->Rotate(60,40); + gr->Aspect(1,1,1); + gr->Box(); + gr->Puts(mglPoint(1,1,1.5),"Rotate only","rR"); + gr->SubPlot(2,2,2); // aspect in other direction + gr->Rotate(60,40); + gr->Aspect(1,1,2); + gr->Box(); + gr->Puts(mglPoint(0,0,2),"Aspect and Rotate"); + gr->SubPlot(2,2,3); // rotation before aspect. INCORRECT !!! + gr->Rotate(60,40); + gr->Aspect(1,2,2); + gr->Box(); + gr->Puts(mglPoint(0,0,1.5),"Aspect in other direction"); + gr->Rotate(0,0); // for unrotate in IDTF +} +//----------------------------------------------------------------------------- +void mgls_prepare1d(mglData *y, mglData *y1, mglData *y2, mglData *x1, mglData *x2) +{ + register long i,n=50; + if(y) y->Create(n,3); + if(x1) x1->Create(n); if(x2) x2->Create(n); + if(y1) y1->Create(n); if(y2) y2->Create(n); + mreal xx; + for(i=0;ia[i] = 0.7*sin(2*M_PI*xx) + 0.5*cos(3*M_PI*xx) + 0.2*sin(M_PI*xx); + y->a[i+n] = sin(2*M_PI*xx); + y->a[i+2*n] = cos(2*M_PI*xx); + } + if(y1) y1->a[i] = 0.5+0.3*cos(2*M_PI*xx); + if(y2) y2->a[i] = 0.3*sin(2*M_PI*xx); + if(x1) x1->a[i] = xx*2-1; + if(x2) x2->a[i] = 0.05+0.03*cos(2*M_PI*xx); + } +} +//----------------------------------------------------------------------------- +void smgl_plot(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->Box(); gr->Plot(y); +} +//----------------------------------------------------------------------------- +void smgl_area(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->SetOrigin(0,0,0); gr->Box(); gr->Area(y); +} +//----------------------------------------------------------------------------- +void smgl_area_2(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->SetOrigin(0,0,0); gr->Box(); gr->Area(y,"cbgGyr"); +} +//----------------------------------------------------------------------------- +void smgl_stem(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->SetOrigin(0,0,0); gr->Box(); gr->Stem(y,"o"); +} +//----------------------------------------------------------------------------- +void smgl_step(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->Box(); gr->Step(y); +} +//----------------------------------------------------------------------------- +void smgl_bars_2(mglGraph *gr) +{ + mglData ys(10,3); ys.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); + gr->SetOrigin(0,0,0); gr->Box(); gr->Bars(ys,"cbgGyr"); +} +//----------------------------------------------------------------------------- +void smgl_bars_a(mglGraph *gr) +{ + mglData ys(10,3); ys.Modify("0.3*sin(pi*(2*x+y/2))+0.1*rnd"); + gr->SetOrigin(0,0,0); gr->Box(); gr->Bars(ys,"a"); +} +//----------------------------------------------------------------------------- +void smgl_bars_f(mglGraph *gr) +{ + mglData ys(10,2); ys.Modify("0.24*sin(pi*(2*x+y/2))+0.06*rnd"); + gr->SetOrigin(0,0,0); gr->Box(); gr->Bars(ys,"f"); +} +//----------------------------------------------------------------------------- +void smgl_bars(mglGraph *gr) +{ + mglData ys(10,3); ys.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); + gr->SetOrigin(0,0,0); gr->Box(); gr->Bars(ys); +} +//----------------------------------------------------------------------------- +void smgl_barh(mglGraph *gr) +{ + mglData ys(10,3); ys.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); + gr->SetOrigin(0,0,0); gr->Box(); gr->Barh(ys); +} +//----------------------------------------------------------------------------- +void smgl_tens(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->Box(); gr->Tens(y.SubData(-1,0), y.SubData(-1,1)); +} +//----------------------------------------------------------------------------- +void smgl_text(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + gr->Box(); gr->Plot(y.SubData(-1,0)); + gr->Text(y,"This is very very long string drawn along a curve",":k"); + gr->Text(y,"Another string drawn above a curve","T:r"); +} +//----------------------------------------------------------------------------- +void smgl_region(mglGraph *gr) +{ + mglData y1,y2; mgls_prepare1d(0, &y1, &y2); + gr->Box(); gr->Region(y2,y1,"r"); + gr->Plot(y1,"k2"); gr->Plot(y2,"k2"); +} +//----------------------------------------------------------------------------- +void smgl_region_2(mglGraph *gr) +{ + mglData y1,y2; mgls_prepare1d(0, &y1, &y2); + gr->Box(); gr->Region(y2,y1,"yr"); + gr->Plot(y1,"k2"); gr->Plot(y2,"k2"); +} +//----------------------------------------------------------------------------- +void smgl_mark(mglGraph *gr) +{ + mglData y,y1; mgls_prepare1d(&y,&y1); + gr->Box(); gr->Mark(y,y1,"bs"); +} +//----------------------------------------------------------------------------- +void smgl_traj(mglGraph *gr) +{ + mglData x,y,y1,y2; mgls_prepare1d(&y,&y1,&y2,&x); + gr->Box(); gr->Plot(x,y); gr->Traj(x,y,y1,y2); +} +//----------------------------------------------------------------------------- +void smgl_textmark(mglGraph *gr) +{ + mglData y,y1; mgls_prepare1d(&y,&y1); + gr->Box(); gr->TextMark(y,y1,"\\gamma"); +} +//----------------------------------------------------------------------------- +void smgl_torus(mglGraph *gr) +{ + mglData y1,y2; mgls_prepare1d(0,&y1,&y2); + gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); + gr->Box(); gr->Torus(y1,y2,"pz"); +} +//----------------------------------------------------------------------------- +void smgl_tube(mglGraph *gr) +{ + mglData y,y1; mgls_prepare1d(&y,&y1); + gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); + gr->Box(); gr->Tube(y,0.05); +} +//----------------------------------------------------------------------------- +void smgl_tube_3d(mglGraph *gr) +{ + mglData y,y1,y2,x1,x2; mgls_prepare1d(&y,&y1,&y2,&x1,&x2); + gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); + gr->Box(); gr->Tube(y,0.05); gr->Tube(y1,x1,y2,x2); +} +//----------------------------------------------------------------------------- +void smgl_radar(mglGraph *gr) +{ + mglData yr(10,3); yr.Modify("0.4*sin(pi*(2*x+y/2))+0.1*rnd"); + gr->Box(); gr->Radar(yr,"#"); +} +//----------------------------------------------------------------------------- +void smgl_error(mglGraph *gr) +{ + mglData y; mgls_prepare1d(&y); + mglData x0(10), y0(10), ex0(10), ey0(10); + mreal x; + for(int i=0;i<10;i++) + { + x = i/9.; + x0.a[i] = 2*x-1 + 0.1*mgl_rnd()-0.05; + y0.a[i] = 0.7*sin(2*M_PI*x)+0.5*cos(3*M_PI*x)+0.2*sin(M_PI*x)+0.2*mgl_rnd()-0.1; + ey0.a[i]=0.2; ex0.a[i]=0.1; + } + gr->Box(); gr->Plot(y.SubData(-1,0)); + gr->Error(x0,y0,ex0,ey0,"ko"); +} +//----------------------------------------------------------------------------- +void smgl_chart(mglGraph *gr) +{ + mglData ch(7,2); for(int i=0;i<7*2;i++) ch.a[i]=mgl_rnd()+0.1; + gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); + gr->Box(); gr->Chart(ch,"#"); +} +//----------------------------------------------------------------------------- +void smgl_ring_chart(mglGraph *gr) +{ + mglData ch(7,2); for(int i=0;i<7*2;i++) ch.a[i]=mgl_rnd()+0.1; + gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); + gr->SetFunc("(y+2)/3*cos(pi*x)","(y+2)/3*sin(pi*x)",""); + gr->Box(); gr->Chart(ch,"bgr cmy#"); +} +//----------------------------------------------------------------------------- +void smgl_pie_chart(mglGraph *gr) +{ + mglData ch(7,2); for(int i=0;i<7*2;i++) ch.a[i]=mgl_rnd()+0.1; + gr->Light(true); gr->Rotate(40,60); gr->VertexColor(false); + gr->SetFunc("(y+1)/2*cos(pi*x)","(y+1)/2*sin(pi*x)",""); + gr->Box(); gr->Chart(ch,"bgr cmy#"); +} +//----------------------------------------------------------------------------- +void mgls_prepare2d(mglData *a, mglData *b, mglData *v) +{ + register long i,j,n=50,m=40,i0; + if(a) a->Create(n,m); if(b) b->Create(n,m); + if(v) { v->Create(9); v->Fill(-1,1); } + mreal x,y; + for(i=0;ia[i0] = 0.6*sin(2*M_PI*x)*sin(3*M_PI*y)+0.4*cos(3*M_PI*x*y); + if(b) b->a[i0] = 0.6*cos(2*M_PI*x)*cos(3*M_PI*y)+0.4*cos(3*M_PI*x*y); + } +} +//----------------------------------------------------------------------------- +void smgl_grad(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Box(); gr->Grad(a); + gr->Alpha(true); gr->Dens(a); +} +//----------------------------------------------------------------------------- +void smgl_contt(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Box(); gr->Cont(a,"t"); +} +//----------------------------------------------------------------------------- +void smgl_tiles(mglGraph *gr) +{ + mglData a,b; mgls_prepare2d(&a,&b); + gr->Box(); gr->TileS(a,b); +} +//----------------------------------------------------------------------------- +void smgl_contd(mglGraph *gr) +{ + mglData a,v; mgls_prepare2d(&a,0,&v); + gr->Box(); gr->ContD(v,a); gr->Colorbar(v); +} +//----------------------------------------------------------------------------- +void smgl_dens(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Box(); gr->Dens(a); gr->Colorbar(); +} +//----------------------------------------------------------------------------- +void smgl_surf_sl(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->Surf(a,"|"); +} +//----------------------------------------------------------------------------- +void smgl_surf(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->Surf(a); +} +//----------------------------------------------------------------------------- +void smgl_stereo(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); + gr->SubPlot(2,1,0); gr->Rotate(40,60+3); + gr->Box(); gr->Surf(a); + gr->SubPlot(2,1,1); gr->Rotate(40,60-3); + gr->Box(); gr->Surf(a); + gr->Rotate(0,0); // for unrotate in IDTF +} +//----------------------------------------------------------------------------- +void smgl_tile(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->Tile(a); +} +//----------------------------------------------------------------------------- +void smgl_belt(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->Belt(a); +} +//----------------------------------------------------------------------------- +void smgl_mesh(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->Mesh(a); +} +//----------------------------------------------------------------------------- +void smgl_fall(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->Fall(a); +} +//----------------------------------------------------------------------------- +void smgl_contf(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->ContF(a); +} +//----------------------------------------------------------------------------- +void smgl_cont(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); + gr->Box(); gr->Cont(a); +} +//----------------------------------------------------------------------------- +void smgl_surfc(mglGraph *gr) +{ + mglData a,b; mgls_prepare2d(&a,&b); + gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->SurfC(a,b); +} +//----------------------------------------------------------------------------- +void smgl_boxs(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->SetOrigin(0,0,0); gr->Light(true); gr->Rotate(40,60); + gr->Box(); gr->Boxs(a); +} +//----------------------------------------------------------------------------- +void smgl_surf_fog(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); gr->Fog(1); gr->Box(); + (type==5 || type==9 || type==10)?gr->Puts(mglPoint(),"Fog not supported") : gr->Surf(a); + gr->Fog(0); +} +//----------------------------------------------------------------------------- +void smgl_surf_alpha(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); gr->Alpha(true); + gr->Box(); gr->Surf(a); +} +//----------------------------------------------------------------------------- +void smgl_axial(mglGraph *gr) +{ + mglData a; mgls_prepare2d(&a); + gr->Light(true); gr->Rotate(40,60); + gr->Alpha(true); gr->VertexColor(false); + gr->Box(); gr->Axial(a); +} +//----------------------------------------------------------------------------- +void smgl_surfa(mglGraph *gr) +{ + mglData a,b; mgls_prepare2d(&a,&b); + gr->Light(true); gr->Rotate(40,60); + gr->Alpha(true); gr->VertexColor(false); + gr->Box(); gr->SurfA(a,b); +} +//----------------------------------------------------------------------------- +void mgls_prepare3d(mglData *a, mglData *b) +{ + register long i,j,k,n=60,m=50,l=40,i0; + if(a) a->Create(n,m,l); if(b) b->Create(n,m,l); + mreal x,y,z; + for(i=0;ia[i0] = -2*(x*x + y*y + z*z*z*z - z*z - 0.1); + if(b) b->a[i0] = 1-2*tanh((x+y)*(x+y)); + } +} +//----------------------------------------------------------------------------- +/*void smgl_surf3_rgbd(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->VertexColor(true); + gr->Box(); gr->Surf3(c,"bgrd"); +}*/ +//----------------------------------------------------------------------------- +void smgl_conta(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->VertexColor(false); + gr->Box(); gr->Cont3(c,'x'); gr->Cont3(c,'y'); gr->Cont3(c,'z'); +} +//----------------------------------------------------------------------------- +void smgl_dens_xyz(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->VertexColor(false); + gr->Box(); gr->DensX(c.Sum("x"),0,-1); + gr->DensY(c.Sum("y"),0,1); gr->DensZ(c.Sum("z"),0,-1); +} +//----------------------------------------------------------------------------- +void smgl_cont_xyz(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->VertexColor(false); + gr->Box(); gr->ContX(c.Sum("x"),"",-1); + gr->ContY(c.Sum("y"),"",1); + gr->ContZ(c.Sum("z"),"",-1); +} +//----------------------------------------------------------------------------- +void smgl_contfa(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->Light(true); gr->VertexColor(false); + gr->Box(); gr->ContF3(c,'x'); gr->ContF3(c,'y'); gr->ContF3(c,'z'); +} +//----------------------------------------------------------------------------- +void smgl_surf3(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); + gr->VertexColor(false); + gr->Box(); gr->Surf3(c); +} +//----------------------------------------------------------------------------- +void smgl_surf3a(mglGraph *gr) +{ + mglData c,d; mgls_prepare3d(&c,&d); + gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); + gr->VertexColor(false); + gr->Box(); gr->Surf3A(c,d); +} +//----------------------------------------------------------------------------- +void smgl_surf3c(mglGraph *gr) +{ + mglData c,d; mgls_prepare3d(&c,&d); + gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); + gr->VertexColor(false); + gr->Box(); gr->Surf3C(c,d); +} +//----------------------------------------------------------------------------- +void smgl_densa(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->Alpha(true); gr->VertexColor(false); + gr->SetOrigin(0,0,0); gr->Axis(); + gr->Box(); gr->Dens3(c,'x'); gr->Dens3(c,'y'); gr->Dens3(c,'z'); +} +//----------------------------------------------------------------------------- +void smgl_cloud(mglGraph *gr) +{ + mglData c; mgls_prepare3d(&c); + gr->Rotate(40,60); gr->Alpha(true); gr->VertexColor(false); + gr->Box(); gr->Cloud(c,"wyrRk"); +} +//----------------------------------------------------------------------------- +void mgls_prepare2v(mglData *a, mglData *b) +{ + register long i,j,n=20,m=30,i0; + if(a) a->Create(n,m); if(b) b->Create(n,m); + mreal x,y; + for(i=0;ia[i0] = 0.6*sin(2*M_PI*x)*sin(3*M_PI*y)+0.4*cos(3*M_PI*x*y); + if(b) b->a[i0] = 0.6*cos(2*M_PI*x)*cos(3*M_PI*y)+0.4*cos(3*M_PI*x*y); + } +} +//----------------------------------------------------------------------------- +void smgl_vect(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Box(); gr->Vect(a,b); +} +//----------------------------------------------------------------------------- +void smgl_vectl(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Box(); gr->Vect(a,b,"","value 49"); +} +//----------------------------------------------------------------------------- +void smgl_vectc(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Box(); gr->Vect(a,b,"","value 50"); +} +//----------------------------------------------------------------------------- +void smgl_flow(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Box(); gr->Flow(a,b); +} +//----------------------------------------------------------------------------- +void smgl_pipe2(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Box(); gr->Pipe(a,b); +} +//----------------------------------------------------------------------------- +void smgl_pipe(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Light(true); gr->Compression(true); // try to save space + gr->Box(); gr->Pipe(a,b); + gr->Compression(false); //put setting back +} +//----------------------------------------------------------------------------- +void smgl_dew(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Light(true); gr->Compression(true); // try to save space + gr->DoubleSided(false); // try to improve performance + gr->Box(); gr->SetMeshNum(20); gr->Dew(a,b); + gr->DoubleSided(true); + gr->Compression(false); //put setting back +} +//----------------------------------------------------------------------------- +void smgl_dew2(mglGraph *gr) +{ + mglData a,b; mgls_prepare2v(&a,&b); + gr->Rotate(40,60); gr->Light(true); gr->Compression(true); // try to save space + gr->DoubleSided(false); // try to improve performance + gr->Box(); gr->SetMeshNum(10); gr->Dew(a,b); + gr->DoubleSided(true); + gr->Compression(false); //put setting back +} +//----------------------------------------------------------------------------- +void mgls_prepare3v(mglData *ex, mglData *ey, mglData *ez) +{ + register long i,j,k,n=10,i0; + if(!ex || !ey || !ez) return; + ex->Create(n,n,n); ey->Create(n,n,n); ez->Create(n,n,n); + mreal x,y,z, r1,r2; + for(i=0;ia[i0]=0.2*x/r1 - 0.2*x/r2; + ey->a[i0]=0.2*y/r1 - 0.2*y/r2; + ez->a[i0]=0.2*(z-0.3)/r1 - 0.2*(z+0.3)/r2; + } +} +//----------------------------------------------------------------------------- +void smgl_flow3(mglGraph *gr) +{ + mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); + gr->Rotate(40,60); + gr->Box(); gr->Box(); gr->Flow(ex,ey,ez,"bwr"); +} +//----------------------------------------------------------------------------- +void smgl_vect3(mglGraph *gr) +{ + mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); + gr->Rotate(40,60); + gr->Box(); gr->Box(); gr->Vect(ex,ey,ez,"bwr"); +} +//----------------------------------------------------------------------------- +void smgl_vectl3(mglGraph *gr) +{ + mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); + gr->Rotate(40,60); + gr->Box(); gr->Box(); gr->Vect(ex,ey,ez,"bwr","value 49"); +} +//----------------------------------------------------------------------------- +void smgl_vectc3(mglGraph *gr) +{ + mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); + gr->Rotate(40,60); + gr->Box(); gr->Box(); gr->Vect(ex,ey,ez,"bwr","value 50"); +} +//----------------------------------------------------------------------------- +void smgl_pipe3(mglGraph *gr) +{ + mglData ex,ey,ez; mgls_prepare3v(&ex,&ey,&ez); + gr->Rotate(40,60); gr->Light(true); + gr->Compression(true); // try to save space + gr->Clf(); gr->Box(); gr->Pipe(ex,ey,ez); + gr->Compression(false); // put setting back +} +//----------------------------------------------------------------------------- +void smgl_crust(mglGraph *gr) +{ + mglData pnts("hotdogs.pts"); pnts.Norm(-1,1,true); + gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); + gr->Clf(); gr->Box(); gr->Crust(pnts.SubData(0),pnts.SubData(1),pnts.SubData(2)); +} +//----------------------------------------------------------------------------- +void smgl_dots(mglGraph *gr) +{ + mglData pnts("hotdogs.pts"); pnts.Norm(-1,1,true); + gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); + gr->Clf(); gr->Box(); gr->Dots(pnts.SubData(0),pnts.SubData(1),pnts.SubData(2)); +} +//----------------------------------------------------------------------------- +void smgl_legend(mglGraph *gr) +{ + mglData f(50,3); + mreal x; + for(int i=0;i<50;i++) + { + x=i/49.; + f.a[i]=sin(2*M_PI*x*x); + f.a[i+50]=sin(2*M_PI*x); + f.a[i+100]=sin(2*M_PI*sqrt(x)); + } + gr->SetRanges(mglPoint(0), mglPoint(1)); + gr->Box(); gr->Plot(f); gr->Axis("xy"); + if(type==5 || type==9 || type==10) gr->SetLegendBox(false); + gr->AddLegend("sin(\\pi {x^2})","b"); gr->AddLegend("sin(\\pi x)","g*"); + gr->AddLegend("sin(\\pi \\sqrt{x})","r+"); gr->Legend(); +} +//----------------------------------------------------------------------------- +void smgl_type0(mglGraph *gr) // TranspType = 0 +{ + if(type==5 || type==9 || type==10) return; + gr->Alpha(true); gr->Light(true); gr->AddLight(0,mglPoint(0,0,1)); + mglData a; mgls_prepare2d(&a); + gr->SetTranspType(0); gr->Clf(); + gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box(); + gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box(); + gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box(); + gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_type1(mglGraph *gr) // TranspType = 1 +{ + if(type==5 || type==9 || type==10) return; + gr->Alpha(true); gr->Light(true); gr->AddLight(0,mglPoint(0,0,1)); + mglData a; mgls_prepare2d(&a); + gr->SetTranspType(1); gr->Clf(); + gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box(); + gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box(); + gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box(); + gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_type2(mglGraph *gr) // TranspType = 2 +{ + if(type==5 || type==9 || type==10) return; + gr->Alpha(true); gr->Light(true); gr->AddLight(0,mglPoint(0,0,1)); + mglData a; mgls_prepare2d(&a); + gr->SetTranspType(2); gr->Clf(); + gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box(); + gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box(); + gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box(); + gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_molecule(mglGraph *gr) // example of moleculas +{ + gr->VertexColor(false); gr->Compression(false); // per-vertex colors and compression are detrimental to transparency + gr->DoubleSided(false); // we do not get into atoms, while rendering internal surface has negative impact on trasparency + gr->Alpha(true); gr->Light(true); + + gr->SubPlot(2,2,0); + gr->StartGroup("Methane"); + gr->StartGroup("MetaneLabel"); + gr->Puts(mglPoint(0,1.2),"Methane, CH_4",0,-2); + gr->EndGroup(); + gr->Rotate(60,120); + gr->Sphere(mglPoint(0,0,0),0.25,"k"); + gr->Drop(mglPoint(0,0,0),mglPoint(0,0,1),0.35,"h",1,2); + gr->Sphere(mglPoint(0,0,0.7),0.25,"g"); + gr->Drop(mglPoint(0,0,0),mglPoint(-0.94,0,-0.33),0.35,"h",1,2); + gr->Sphere(mglPoint(-0.66,0,-0.23),0.25,"g"); + gr->Drop(mglPoint(0,0,0),mglPoint(0.47,0.82,-0.33),0.35,"h",1,2); + gr->Sphere(mglPoint(0.33,0.57,-0.23),0.25,"g"); + gr->Drop(mglPoint(0,0,0),mglPoint(0.47,-0.82,-0.33),0.35,"h",1,2); + gr->Sphere(mglPoint(0.33,-0.57,-0.23),0.25,"g"); + gr->EndGroup(); + + gr->SubPlot(2,2,1); + gr->StartGroup("Water"); + gr->StartGroup("WaterLabel"); + gr->Puts(mglPoint(0,1.2),"Water, H_{2}O",0,-2); + gr->EndGroup(); + gr->Rotate(60,100); + gr->StartGroup("Water_O"); + gr->Sphere(mglPoint(0,0,0),0.25,"r"); + gr->EndGroup(); + gr->StartGroup("Water_Bond_1"); + gr->Drop(mglPoint(0,0,0),mglPoint(0.3,0.5,0),0.3,"m",1,2); + gr->EndGroup(); + gr->StartGroup("Water_H_1"); + gr->Sphere(mglPoint(0.3,0.5,0),0.25,"g"); + gr->EndGroup(); + gr->StartGroup("Water_Bond_2"); + gr->Drop(mglPoint(0,0,0),mglPoint(0.3,-0.5,0),0.3,"m",1,2); + gr->EndGroup(); + gr->StartGroup("Water_H_2"); + gr->Sphere(mglPoint(0.3,-0.5,0),0.25,"g"); + gr->EndGroup(); + gr->EndGroup(); + + gr->SubPlot(2,2,2); + gr->StartGroup("Oxygen"); + gr->StartGroup("OxygenLabel"); + gr->Puts(mglPoint(0,1.2),"Oxygen, O_2",0,-2); + gr->EndGroup(); + gr->Rotate(60,120); + gr->Drop(mglPoint(0,0.5,0),mglPoint(0,-0.3,0),0.3,"m",1,2); + gr->Sphere(mglPoint(0,0.5,0),0.25,"r"); + gr->Drop(mglPoint(0,-0.5,0),mglPoint(0,0.3,0),0.3,"m",1,2); + gr->Sphere(mglPoint(0,-0.5,0),0.25,"r"); + gr->EndGroup(); + + gr->SubPlot(2,2,3); + gr->StartGroup("Ammonia"); + gr->StartGroup("AmmoniaLabel"); + gr->Puts(mglPoint(0,1.2),"Ammonia, NH_3",0,-2); + gr->EndGroup(); + gr->Rotate(60,120); + gr->Sphere(mglPoint(0,0,0),0.25,"b"); + gr->Drop(mglPoint(0,0,0),mglPoint(0.33,0.57,0),0.32,"n",1,2); + gr->Sphere(mglPoint(0.33,0.57,0),0.25,"g"); + gr->Drop(mglPoint(0,0,0),mglPoint(0.33,-0.57,0),0.32,"n",1,2); + gr->Sphere(mglPoint(0.33,-0.57,0),0.25,"g"); + gr->Drop(mglPoint(0,0,0),mglPoint(-0.65,0,0),0.32,"n",1,2); + gr->Sphere(mglPoint(-0.65,0,0),0.25,"g"); + gr->EndGroup(); + gr->DoubleSided( true ); // put back +} +//----------------------------------------------------------------------------- +void smgl_ternary(mglGraph *gr) // flag # +{ + mglData x(50),y(50),rx(10),ry(10), a(20,30); + a.Modify("4*x*y"); + x.Modify("0.25*(1+cos(2*pi*x))"); + y.Modify("0.25*(1+sin(2*pi*x))"); + rx.Modify("rnd"); ry.Modify("(1-v)*rnd",rx); + + gr->Puts(mglPoint(-0.8,1.3), "Ternary plot (x+y+t=1)"); + gr->Ternary(true); + gr->Plot(x,y,"r2"); + gr->Plot(rx,ry,"q^ "); + gr->Cont(a,"BbcyrR"); + gr->Line(mglPoint(0.5,0), mglPoint(0,0.75), "g2"); + gr->Axis(); gr->Grid("xyz","B;"); + gr->Label('x',"x comp."); + gr->Label('y',"y comp."); + gr->Label('t',"t comp."); + gr->Ternary(false); +} +//----------------------------------------------------------------------------- +void smgl_drops(mglGraph *gr) // flag # +{ + gr->VertexColor(false); // not strictly required, but looks better imho + gr->Light(true); gr->Alpha(false); + gr->Puts(mglPoint(-1,1.2),"sh=0"); + gr->Drop(mglPoint(-1,0),mglPoint(0,1),0.5,"r",0); + gr->Puts(mglPoint(-0.33,1.2),"sh=0.33"); + gr->Drop(mglPoint(-0.33,0),mglPoint(0,1),0.5,"r",0.33); + gr->Puts(mglPoint(0.33,1.2),"sh=0.67"); + gr->Drop(mglPoint(0.33,0),mglPoint(0,1),0.5,"r",0.67); + gr->Puts(mglPoint(1,1.2),"sh=1"); + gr->Drop(mglPoint(1,0),mglPoint(0,1),0.5,"r",1); + gr->Ball(mglPoint(-1,0,1),'k'); + gr->Ball(mglPoint(-0.33,0,1),'k'); + gr->Ball(mglPoint(0.33,0,1),'k'); + gr->Ball(mglPoint(1,0,1),'k'); + gr->Line(mglPoint(-1,0,1),mglPoint(1,0,1),"b"); +} +//----------------------------------------------------------------------------- +void smgl_fish(mglGraph *gr) // flag # +{ + gr->VertexColor(false); // the model is big even without information on point colors + gr->Compression(true); // fishes are important, not their scales + gr->DoubleSided(false); // we do not get into drops, while rendering internal surfaces may have negative impact on performace + gr->Light(true); gr->Alpha(false); + mglData a(10,10), b(10,10), x(10,10), y(10,10); + a.Modify("0.3*x+rnd"); x.Modify("x+0.1*rnd"); + b.Modify("0.3*y+rnd"); y.Modify("y+0.1*rnd"); + + gr->Clf(); + gr->SetRanges(mglPoint(0,0),mglPoint(1.1,1.1)); + gr->Light(true); + gr->Dew(x,y,a,b,"BbcyrR"); + gr->Compression(false); gr->DoubleSided(true); +} +//----------------------------------------------------------------------------- +void smgl_mirror(mglGraph *gr) // flag # +{ + gr->VertexColor(true); gr->TextureColor(false); // Let us use pre-lighting for this example + mglData a(30,40),x(30),y1(40),y2(40); + a.Modify("pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)"); + x.Fill(-1,1); y1.Fill(0,1); y2.Fill(0,-1); + + gr->Alpha(false); gr->Rotate(40,60); + gr->Light(true); gr->Box(); + gr->Surf(x,y1,a,"r"); gr->Surf(x,y2,a,"b"); + gr->VertexColor(false); gr->TextureColor(true); // set settings back +} +//----------------------------------------------------------------------------- +void smgl_semilog(mglGraph *gr) // semi-log axis +{ + mglData x(2000), y(2000); + x.Modify("0.01/(x+10^(-5))"); y.Modify("sin(1/v)",x); + + gr->SetRanges(mglPoint(0.01,-1),mglPoint(1000,1)); + gr->SetFunc("lg(x)",0,0); gr->SetTicks('x', 0); gr->Box(); + gr->Plot(x,y,"b2"); + gr->Axis(); gr->Grid("xy","g"); + gr->Label('x',"x",0); gr->Label('y', "y = sin 1/x",0); +} +//----------------------------------------------------------------------------- +void smgl_loglog(mglGraph *gr) // log-log axis +{ + mglData x(2000), y(2000); + x.Modify("pow(10,6*x-3)"); y.Modify("sqrt(1+v^2)",x); + + gr->SetRanges(mglPoint(0.001,0.1),mglPoint(1000,1000)); + gr->SetFunc("lg(x)","lg(y)",0); + gr->SetTicks('x', 0); + gr->SetTicks('y', 0); + gr->Box(); gr->Axis(); gr->Grid("xy","g;"); + gr->Plot(x,y,"b2"); + gr->Label('x',"x",0); gr->Label('y', "y=\\sqrt{1+x^2}",0); +} +//----------------------------------------------------------------------------- +void smgl_fit(mglGraph *gr) // nonlinear fitting +{ + mglData rnd(100), in(100), res; + gr->Fill(rnd,"0.4*rnd+0.1+sin(2*pi*x)"); + gr->Fill(in,"0.3+sin(2*pi*x)"); + + gr->SetRanges(mglPoint(-1,-2), mglPoint(1,2)); + gr->Plot(rnd, ". "); + gr->Box(); + + mreal ini[3] = {1,1,3}; + mglData Ini(3,ini); + gr->Fit(res, rnd, "a+b*sin(c*x)", "abc", Ini); + gr->Plot(res, "r"); + gr->Plot(in, "b"); + gr->Puts(mglPoint(-1, -1.3), "fitted:", "L:r", -1); + gr->PutsFit(mglPoint(0, -1.8), "y = ", "C:r", -1); + gr->Puts(mglPoint(0, 2.2), "initial: y = 0.3+sin(2\\pi x)", "C:b", -1); + gr->SetRanges(mglPoint(-1,-1,-1),mglPoint(1,1,1)); gr->SetOrigin(0,0,0); +} +//----------------------------------------------------------------------------- +#include "mgl/parser.h" +void smgl_parser(mglGraph *gr) // example of MGL parsing +{ + mreal a[100]; // let a_i = sin(4*pi*x), x=0...1 + for(int i=0;i<100;i++)a[i]=sin(4*M_PI*i/99); + mglParse *parser = new mglParse; + mglData &d =(parser->AddVar("dat"))->d; + d.Set(a,100); // set data to variable + parser->Execute(gr, "plot dat; xrange 0 1\nbox\naxis"); + // you may break script at any line do something + // and continue after that + parser->Execute(gr, "xlabel 'x'\nylabel 'y'\nbox"); + // also you may use cycles or conditions in script + parser->Execute(gr, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext"); + delete parser; +} +//----------------------------------------------------------------------------- +void smgl_2_axis(mglGraph *gr) // 2 axis +{ + mglData y1,y2; mgls_prepare1d(0,&y2,&y1); + gr->SetRanges(mglPoint(-1,-1,-1),mglPoint(1,1,1)); gr->SetOrigin(-1,-1,-1); + gr->Axis(); gr->Label('y',"axis 1",0); gr->Plot(y1,"b"); + // set up second axis + gr->SetRanges(mglPoint(0,0,0),mglPoint(1,1,1)); gr->SetOrigin(1,1,1); + gr->Axis(); gr->Label('y',"axis 2",0); gr->Stem(y2,"r"); +} +//----------------------------------------------------------------------------- +void smgl_flow_dens(mglGraph *gr) // flow threads and density plot +{ + mglData a,b,d; mgls_prepare2v(&a,&b); d = a; + for(int i=0;iFlow(a,b,"br"); gr->Dens(d,"BbcyrR"); gr->Box(); +} +//----------------------------------------------------------------------------- +void smgl_surf_cont(mglGraph *gr) // contour lines over surface +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); + gr->Box(); gr->Surf(a,"kw"); + gr->SetRange('c',-1,0); gr->Cont(a,"w"); + gr->SetRange('c', 0,1); gr->Cont(a,"k"); +} +//----------------------------------------------------------------------------- +void smgl_mesh_cont(mglGraph *gr) // contours under mesh +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); + gr->Box(); gr->Mesh(a); gr->Cont(a, 0, "zrange -1 -1"); +} +//----------------------------------------------------------------------------- +void smgl_surf_cont_y(mglGraph *gr) // contours on the surface +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); gr->Light(true); + gr->Box(); gr->Surf(a); gr->Cont(a,"y"); +} +//----------------------------------------------------------------------------- +void smgl_surf_cont_fog(mglGraph *gr) // contours on the surface in fog +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); gr->Light(true); gr->Fog(1,0.1); + gr->Box(); gr->Surf(a); gr->Cont(a,"y"); +} +//----------------------------------------------------------------------------- +void smgl_surf_caxis(mglGraph *gr) // caxis and the surface +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); gr->Light(true); + gr->SetRange('c',0,1); gr->Box(); gr->Surf(a); +} +//----------------------------------------------------------------------------- +void smgl_surf_cut(mglGraph *gr) // cutting +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); gr->Light(true); + gr->SetRanges(mglPoint(-1,-1,0),mglPoint(1,1,1)); gr->SetCut(false); + gr->Box(); gr->Surf(a); +} +//----------------------------------------------------------------------------- +void smgl_several_light(mglGraph *gr) // several light sources +{ + mglData a; mgls_prepare2d(&a); + gr->Rotate(40,60); gr->Light(true); + gr->AddLight(1,mglPoint(0,1,0),'c'); gr->AddLight(2,mglPoint(1,0,0),'y'); + gr->AddLight(3,mglPoint(0,-1,0),'m'); + gr->Box(); gr->Surf(a,"h"); +// gr->Light(1,false); gr->Light(2,false); gr->Light(3,false); +} +//----------------------------------------------------------------------------- +void mgls_preparecc(mglData *c) +{ + register long i,j,k,n=61,m=51,l=40,i0; + if(!c) return; c->Create(n,m,l); + mreal x,y,z; + for(i=0;ia[i0] = -2*(x*x + y*y + z*z*z*z - z*z - 0.1); + } +} +//----------------------------------------------------------------------------- +void smgl_cutminmax2(mglGraph *gr) // CutMin CutMax example +{ + mglData c; mgls_preparecc(&c); + mglData v(10); v.Fill(-0.5,1); + gr->Rotate(40,60); gr->Light(true); + gr->VertexColor(false); gr->Compression(false); + gr->SetCutBox(mglPoint(0,-1,-1), mglPoint(1,0,1.1)); + gr->Box(); gr->Surf3(-0.5,c); + gr->ContF3(v,c,'x',-1); gr->ContF3(v,c,'y',-1); + gr->ContF3(v,c,'z',0); gr->ContF3(v,c,'z',39); +} +//----------------------------------------------------------------------------- +void smgl_cutminmax(mglGraph *gr) // CutMin CutMax example +{ + mglData c; mgls_preparecc(&c); + gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); + gr->VertexColor(false); gr->Compression(false); + gr->SetCutBox(mglPoint(0,-1,-1), mglPoint(1,0,1.1)); + gr->Box(); gr->Surf3(c); +} +//----------------------------------------------------------------------------- +void smgl_surf3_cutoff(mglGraph *gr) // CutMin CutMax example +{ + mglData c; mgls_preparecc(&c); + gr->Rotate(40,60); gr->Light(true); gr->Alpha(true); + gr->VertexColor(false); gr->Compression(false); + gr->CutOff("(z>(x+0.5*y-1)^2-1) & (z>(x-0.5*y-1)^2-1)"); + gr->Box(); gr->Surf3(c); +} +//----------------------------------------------------------------------------- +void smgl_boxplot(mglGraph *gr) // flow threads and density plot +{ + mglData a(10,7); a.Modify("(2*rnd-1)^3/2"); + gr->Box(); gr->BoxPlot(a); gr->Plot(a," ko"); +} +//----------------------------------------------------------------------------- +int main(int argc,char **argv) +{ + const char *suf = ""; + char name[256]=""; + int ch; +// mglGraphIDTF u3d; + mglGraph *gr = NULL; + mglSample *s=samp; + while(( ch = getopt_long_only(argc, argv, "", longopts, NULL)) != -1) + switch(ch) + { + case 0: break; + case 'w': width =atoi(optarg); break; + case 'h': height=atoi(optarg); break; + case 'k': strcpy(name, optarg); break; + case 't': mglNumThr=atoi(optarg); break; + case 'l': + while(s->name[0]) { printf("%s ",s->name); s++; } + printf("\n"); return 0; + case '?': + default: usage(); return 0; + } + + gr = new mglGraph; +// if(type==5 || type==9 || type==10) { u3d.unrotate_flag = true; gr = &u3d; } + + if(mini) { gr->SetSize(200,133); suf = "_sm"; } + else if(big) + { gr->SetSize(1200,800); suf = "_lg"; } + else gr->SetSize(width,height); + + if(dotest) + { +// gr->SetSize(600,600); + mgl_set_test_mode(true); test(gr); + gr->WritePNG("test.png","",false); + gr->WriteEPS("test.eps"); + return 0; + } + + if(srnd) mgl_srnd(1); + gr->VertexColor(false); gr->TextureColor(true); gr->Compression(false); + if(name[0]==0) while(s->name[0]) // all samples + { + gr->DefaultPlotParam(); gr->Clf(); + s->func(gr); save(gr, s->name, suf); + fflush(stdout); s++; + } + else // manual sample + { + mglSample tst; tst.name=name; + int i=0; + for(i=0;samp[i].name[0];i++); // determine the number of samples + s = (mglSample *) bsearch(&tst, samp, i, sizeof(mglSample), mgl_cmd_smp); + if(s) + { + gr->DefaultPlotParam(); gr->Clf(); + s->func(gr); save(gr, s->name, suf); + } + else printf("no sample %s\n",name); + } + printf("\n"); return 0; +} +//----------------------------------------------------------------------------- +mglSample samp[] = { + {"2_axis", smgl_2_axis}, + {"area", smgl_area}, + {"area_2", smgl_area_2}, + {"axial", smgl_axial}, + {"barh", smgl_barh}, + {"bars", smgl_bars}, + {"bars_2", smgl_bars_2}, + {"bars_a", smgl_bars_a}, + {"bars_f", smgl_bars_f}, + {"belt", smgl_belt}, + {"boxplot", smgl_boxplot}, + {"boxs", smgl_boxs}, + {"chart", smgl_chart}, + {"cloud", smgl_cloud}, + {"color_schemes", smgl_color_schemes}, + {"colors", smgl_colors}, + {"column", smgl_column}, + {"cont", smgl_cont}, + {"cont_xyz", smgl_cont_xyz}, + {"conta", smgl_conta}, + {"contd", smgl_contd}, + {"contf", smgl_contf}, + {"contfa", smgl_contfa}, + {"contt", smgl_contt}, + {"crust", smgl_crust}, + {"cutminmax", smgl_cutminmax}, + {"cutminmax2", smgl_cutminmax2}, + {"dens", smgl_dens}, + {"dens_xyz", smgl_dens_xyz}, + {"densa", smgl_densa}, + {"dew", smgl_dew}, + {"dew2", smgl_dew2}, + {"dots", smgl_dots}, + {"drops", smgl_drops}, + {"envelop", smgl_envelop}, + {"error", smgl_error}, + {"fall", smgl_fall}, + {"fish", smgl_fish}, + {"fit", smgl_fit}, + {"flow", smgl_flow}, + {"flow3", smgl_flow3}, + {"flow_dens", smgl_flow_dens}, + {"fonts", smgl_fonts}, + {"grad", smgl_grad}, + {"legend", smgl_legend}, + {"loglog", smgl_loglog}, + {"map", smgl_map}, + {"mark", smgl_mark}, + {"mesh", smgl_mesh}, + {"mesh_cont", smgl_mesh_cont}, + {"mirror", smgl_mirror}, +// {"molecule", smgl_molecule}, // TODO: enable sample later +// {"parser", smgl_parser}, // TODO: enable sample later + {"pde", smgl_pde}, + {"pie_chart", smgl_pie_chart}, + {"pipe", smgl_pipe}, + {"pipe2", smgl_pipe2}, + {"pipe3", smgl_pipe3}, + {"plot", smgl_plot}, + {"qo2d", smgl_qo2d}, + {"radar", smgl_radar}, + {"region", smgl_region}, + {"region_2", smgl_region_2}, + {"ring_chart", smgl_ring_chart}, + {"sample1", smgl_sample1}, + {"sample2", smgl_sample2}, + {"sample3", smgl_sample3}, + {"sample4", smgl_sample4}, + {"sample5", smgl_sample5}, + {"sample6", smgl_sample6}, + {"sample7", smgl_sample7}, + {"sample8", smgl_sample8}, + {"sample9", smgl_sample9}, + {"samplea", smgl_samplea}, + {"sampleb", smgl_sampleb}, + {"samplec", smgl_samplec}, + {"sampled", smgl_sampled}, +// {"samplee", smgl_samplee}, // TODO: enable sample later + {"semilog", smgl_semilog}, + {"several_light", smgl_several_light}, + {"sew", smgl_sew}, + {"stem", smgl_stem}, + {"step", smgl_step}, + {"stereo", smgl_stereo}, + {"stfa", smgl_stfa}, + {"stick", smgl_stick}, + {"surf", smgl_surf}, + {"surf3", smgl_surf3}, + {"surf3_cutoff", smgl_surf3_cutoff}, + {"surf3a", smgl_surf3a}, + {"surf3c", smgl_surf3c}, + {"surf_alpha", smgl_surf_alpha}, + {"surf_caxis", smgl_surf_caxis}, + {"surf_cont", smgl_surf_cont}, + {"surf_cont_fog", smgl_surf_cont_fog}, + {"surf_cont_y", smgl_surf_cont_y}, + {"surf_cut", smgl_surf_cut}, + {"surf_fog", smgl_surf_fog}, + {"surf_sl", smgl_surf_sl}, + {"surfa", smgl_surfa}, + {"surfc", smgl_surfc}, + {"tens", smgl_tens}, + {"ternary", smgl_ternary}, + {"text", smgl_text}, + {"textmark", smgl_textmark}, + {"tile", smgl_tile}, + {"tiles", smgl_tiles}, + {"torus", smgl_torus}, + {"traj", smgl_traj}, + {"tube", smgl_tube}, + {"tube_3d", smgl_tube_3d}, + {"tval", smgl_tval}, + {"type0", smgl_type0}, + {"type1", smgl_type1}, + {"type2", smgl_type2}, + {"vect", smgl_vect}, + {"vect3", smgl_vect3}, + {"vectc", smgl_vectc}, + {"vectc3", smgl_vectc3}, + {"vectl", smgl_vectl}, + {"vectl3", smgl_vectl3}, + {"", NULL}}; diff --git a/texinfo/CMakeLists.txt b/texinfo/CMakeLists.txt index a5e48fc..c96ff7c 100644 --- a/texinfo/CMakeLists.txt +++ b/texinfo/CMakeLists.txt @@ -12,53 +12,51 @@ if(use_doc) 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 appendix_en.texi core_en.texi example_en.texi mgl_en.texi samples_en.texi class_en.texi data_en.texi overview_en.texi) - set(list_texi_files_ru mathgl_ru.texi appendix_ru.texi core_ru.texi example_ru.texi mgl_ru.texi samples_ru.texi class_ru.texi data_ru.texi overview_ru.texi) - add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en.info ${CMAKE_SOURCE_DIR}/texinfo/mathgl_ru.info + set(list_texi_files_en mathgl_en.texi mgl_en.texi overview_en.texi example_en.texi ex_mgl_en.texi + core_en.texi widget_en.texi data_en.texi other_en.texi samples_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 + core_ru.texi widget_ru.texi data_ru.texi other_ru.texi samples_ru.texi appendix_ru.texi fdl.texi) + + add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en.info + COMMAND ${findth} --split=chapter mathgl_en.texi -o mathgl_en + COMMAND ${findth} --split=chapter mgl_en.texi -o mgl_en COMMAND ${findmi} --no-validate mathgl_en.texi - COMMAND ${findmi} --no-validate mathgl_ru.texi - DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/png/all.png +# DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/png/all.png DEPENDS ${list_texi_files_en} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/texinfo + ) + add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/mathgl_ru.info + COMMAND ${findth} --split=chapter mathgl_ru.texi -o mathgl_ru + COMMAND ${findth} --split=chapter mgl_ru.texi -o mgl_ru + COMMAND ${findmi} --no-validate mathgl_ru.texi +# DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/png/all.png DEPENDS ${list_texi_files_ru} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/texinfo ) - add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en.pdf ${CMAKE_SOURCE_DIR}/texinfo/mathgl_ru.pdf + add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en.pdf COMMAND ${findtp} mathgl_en.texi COMMAND ${findtp} mathgl_en.texi COMMAND ${findtp} mathgl_en.texi -# COMMAND ${findtp} mathgl_ru.texi -# COMMAND ${findtp} mathgl_ru.texi -# COMMAND ${findtp} mathgl_ru.texi - DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/png/all.png - DEPENDS ${list_texi_files_en} - DEPENDS ${list_texi_files_ru} - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/texinfo - ) - add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en ${CMAKE_SOURCE_DIR}/texinfo/mathgl_ru - COMMAND ${findth} --split=chapter mathgl_en.texi - COMMAND ${findth} --split=chapter mathgl_ru.texi - DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/png/all.png +# DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/png/all.png DEPENDS ${list_texi_files_en} DEPENDS ${list_texi_files_ru} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/texinfo ) add_custom_target(documentation ALL - DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en.pdf DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en.info - DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en + # DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/mathgl_en.pdf + # DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/mathgl_ru.info # DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/mathgl_ru.pdf - DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/mathgl_ru.info - DEPENDS ${CMAKE_SOURCE_DIR}/texinfo/mathgl_ru ) add_custom_target(clean - COMMAND rm -f mathgl*.[^t]* mathgl*.t[^e]* mathgl*.te[^x]* mathgl*.tex[^i] ${CMAKE_SOURCE_DIR}/texinfo/png/*.png mathgl.info* + COMMAND rm -f mathgl*.[hali]* mathgl*.?? mathgl_*/* *~ png/*.png WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/texinfo ) install(DIRECTORY ./ DESTINATION ${MGL_DOC_PATH} FILES_MATCHING PATTERN ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE PATTERN "*.png" - PATTERN "*.html" + PATTERN "*/*.html" PATTERN "./mathgl*.info*" PATTERN "./mathgl*.pdf") endif(use_doc) diff --git a/texinfo/Makefile.in b/texinfo/Makefile.in deleted file mode 100644 index a9cf8ed..0000000 --- a/texinfo/Makefile.in +++ /dev/null @@ -1,1056 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = texinfo -DIST_COMMON = $(mathgl_en_TEXINFOS) $(mathgl_ru_TEXINFOS) \ - $(mgl_en_TEXINFOS) $(mgl_ru_TEXINFOS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/config/autotroll.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/include/mgl/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -SOURCES = -DIST_SOURCES = -INFO_DEPS = mathgl_en.info mathgl_ru.info mgl_en.info mgl_ru.info -TEXINFO_TEX = $(top_srcdir)/config/texinfo.tex -am__TEXINFO_TEX_DIR = $(top_srcdir)/config -DVIS = mathgl_en.dvi mathgl_ru.dvi mgl_en.dvi mgl_ru.dvi -PDFS = mathgl_en.pdf mathgl_ru.pdf mgl_en.pdf mgl_ru.pdf -PSS = mathgl_en.ps mathgl_ru.ps mgl_en.ps mgl_ru.ps -HTMLS = mathgl_en.html mathgl_ru.html mgl_en.html mgl_ru.html -TEXINFOS = mathgl_en.texi mathgl_ru.texi mgl_en.texi mgl_ru.texi -TEXI2DVI = texi2dvi -DVIPS = dvips -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive -am__installdirs = "$(DESTDIR)$(infodir)" -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_CXXFLAGS = @AM_CXXFLAGS@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FLTK_FLAGS = @FLTK_FLAGS@ -FLTK_LIBS = @FLTK_LIBS@ -GIF_FLAGS = @GIF_FLAGS@ -GIF_LIBS = @GIF_LIBS@ -GLUT_FLAGS = @GLUT_FLAGS@ -GLUT_LIBS = @GLUT_LIBS@ -GL_LIBS = @GL_LIBS@ -GREP = @GREP@ -GSL_FLAGS = @GSL_FLAGS@ -GSL_LIBS = @GSL_LIBS@ -HAVE_SWIG = @HAVE_SWIG@ -HDF4_FLAGS = @HDF4_FLAGS@ -HDF4_LIBS = @HDF4_LIBS@ -HDF5_FLAGS = @HDF5_FLAGS@ -HDF5_LIBS = @HDF5_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JPEG_FLAGS = @JPEG_FLAGS@ -JPEG_LIBS = @JPEG_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MGL_AGE = @MGL_AGE@ -MGL_CURRENT = @MGL_CURRENT@ -MGL_RELEASE = @MGL_RELEASE@ -MGL_REVISION = @MGL_REVISION@ -MKDIR_P = @MKDIR_P@ -MOC = @MOC@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OCTAVE = @OCTAVE@ -OCTAVE_ARCH = @OCTAVE_ARCH@ -OCTAVE_INCFLAGS = @OCTAVE_INCFLAGS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PNG_LIBS = @PNG_LIBS@ -PTHREAD_FLAGS = @PTHREAD_FLAGS@ -PTHREAD_LIBS = @PTHREAD_LIBS@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_HEADERS = @PYTHON_HEADERS@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -QMAKE = @QMAKE@ -QT_CFLAGS = @QT_CFLAGS@ -QT_CPPFLAGS = @QT_CPPFLAGS@ -QT_CXXFLAGS = @QT_CXXFLAGS@ -QT_DEFINES = @QT_DEFINES@ -QT_INCPATH = @QT_INCPATH@ -QT_LDFLAGS = @QT_LDFLAGS@ -QT_LFLAGS = @QT_LFLAGS@ -QT_LIBS = @QT_LIBS@ -QT_PATH = @QT_PATH@ -QT_VERSION = @QT_VERSION@ -QT_VERSION_MAJOR = @QT_VERSION_MAJOR@ -RANLIB = @RANLIB@ -RCC = @RCC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TMPDIR = @TMPDIR@ -U3D_LIBS = @U3D_LIBS@ -UIC = @UIC@ -VERSION = @VERSION@ -WX_FLAGS = @WX_FLAGS@ -WX_LIBS = @WX_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -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_ru.texi mgl_en.texi mgl_ru.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 - -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 - -mgl_en_TEXINFOS = \ -mgl_cmd_en.texi samples_en.texi ex_mgl_en.texi concept_en.texi fdl.texi - -mgl_ru_TEXINFOS = \ -mgl_cmd_ru.texi samples_ru.texi ex_mgl_ru.texi concept_ru.texi fdl.texi - -all: all-recursive - -.SUFFIXES: -.SUFFIXES: .dvi .ps -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu texinfo/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu texinfo/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -mathgl_en.info: mathgl_en.texi $(mathgl_en_TEXINFOS) - restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - rm -rf $$backupdir && mkdir $$backupdir && \ - if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ - for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ - if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ - done; \ - else :; fi && \ - if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $@ `test -f 'mathgl_en.texi' || echo '$(srcdir)/'`mathgl_en.texi; \ - then \ - rc=0; \ - else \ - rc=$$?; \ - $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ - fi; \ - rm -rf $$backupdir; exit $$rc - -mathgl_en.dvi: mathgl_en.texi $(mathgl_en_TEXINFOS) - TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ - MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2DVI) -o $@ `test -f 'mathgl_en.texi' || echo '$(srcdir)/'`mathgl_en.texi - -mathgl_en.pdf: mathgl_en.texi $(mathgl_en_TEXINFOS) - TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ - MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2PDF) -o $@ `test -f 'mathgl_en.texi' || echo '$(srcdir)/'`mathgl_en.texi - -mathgl_en.html: mathgl_en.texi $(mathgl_en_TEXINFOS) - rm -rf $(@:.html=.htp) - if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $(@:.html=.htp) `test -f 'mathgl_en.texi' || echo '$(srcdir)/'`mathgl_en.texi; \ - then \ - rm -rf $@; \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ - else \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ - exit 1; \ - fi - -mathgl_ru.info: mathgl_ru.texi $(mathgl_ru_TEXINFOS) - restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - rm -rf $$backupdir && mkdir $$backupdir && \ - if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ - for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ - if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ - done; \ - else :; fi && \ - if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $@ `test -f 'mathgl_ru.texi' || echo '$(srcdir)/'`mathgl_ru.texi; \ - then \ - rc=0; \ - else \ - rc=$$?; \ - $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ - fi; \ - rm -rf $$backupdir; exit $$rc - -mathgl_ru.dvi: mathgl_ru.texi $(mathgl_ru_TEXINFOS) - TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ - MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2DVI) -o $@ `test -f 'mathgl_ru.texi' || echo '$(srcdir)/'`mathgl_ru.texi - -mathgl_ru.pdf: mathgl_ru.texi $(mathgl_ru_TEXINFOS) - TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ - MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2PDF) -o $@ `test -f 'mathgl_ru.texi' || echo '$(srcdir)/'`mathgl_ru.texi - -mathgl_ru.html: mathgl_ru.texi $(mathgl_ru_TEXINFOS) - rm -rf $(@:.html=.htp) - if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $(@:.html=.htp) `test -f 'mathgl_ru.texi' || echo '$(srcdir)/'`mathgl_ru.texi; \ - then \ - rm -rf $@; \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ - else \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ - exit 1; \ - fi - -mgl_en.info: mgl_en.texi $(mgl_en_TEXINFOS) - restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - rm -rf $$backupdir && mkdir $$backupdir && \ - if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ - for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ - if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ - done; \ - else :; fi && \ - if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $@ `test -f 'mgl_en.texi' || echo '$(srcdir)/'`mgl_en.texi; \ - then \ - rc=0; \ - else \ - rc=$$?; \ - $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ - fi; \ - rm -rf $$backupdir; exit $$rc - -mgl_en.dvi: mgl_en.texi $(mgl_en_TEXINFOS) - TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ - MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2DVI) -o $@ `test -f 'mgl_en.texi' || echo '$(srcdir)/'`mgl_en.texi - -mgl_en.pdf: mgl_en.texi $(mgl_en_TEXINFOS) - TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ - MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2PDF) -o $@ `test -f 'mgl_en.texi' || echo '$(srcdir)/'`mgl_en.texi - -mgl_en.html: mgl_en.texi $(mgl_en_TEXINFOS) - rm -rf $(@:.html=.htp) - if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $(@:.html=.htp) `test -f 'mgl_en.texi' || echo '$(srcdir)/'`mgl_en.texi; \ - then \ - rm -rf $@; \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ - else \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ - exit 1; \ - fi - -mgl_ru.info: mgl_ru.texi $(mgl_ru_TEXINFOS) - restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - rm -rf $$backupdir && mkdir $$backupdir && \ - if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ - for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ - if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ - done; \ - else :; fi && \ - if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $@ `test -f 'mgl_ru.texi' || echo '$(srcdir)/'`mgl_ru.texi; \ - then \ - rc=0; \ - else \ - rc=$$?; \ - $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ - fi; \ - rm -rf $$backupdir; exit $$rc - -mgl_ru.dvi: mgl_ru.texi $(mgl_ru_TEXINFOS) - TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ - MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2DVI) -o $@ `test -f 'mgl_ru.texi' || echo '$(srcdir)/'`mgl_ru.texi - -mgl_ru.pdf: mgl_ru.texi $(mgl_ru_TEXINFOS) - TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ - MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ - $(TEXI2PDF) -o $@ `test -f 'mgl_ru.texi' || echo '$(srcdir)/'`mgl_ru.texi - -mgl_ru.html: mgl_ru.texi $(mgl_ru_TEXINFOS) - rm -rf $(@:.html=.htp) - if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ - -o $(@:.html=.htp) `test -f 'mgl_ru.texi' || echo '$(srcdir)/'`mgl_ru.texi; \ - then \ - rm -rf $@; \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \ - else \ - if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \ - rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \ - exit 1; \ - fi -.dvi.ps: - TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ - $(DVIPS) -o $@ $< - -uninstall-dvi-am: - @$(NORMAL_UNINSTALL) - @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ - rm -f "$(DESTDIR)$(dvidir)/$$f"; \ - done - -uninstall-html-am: - @$(NORMAL_UNINSTALL) - @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ - rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ - done - -uninstall-info-am: - @$(PRE_UNINSTALL) - @if test -d '$(DESTDIR)$(infodir)' && \ - (install-info --version && \ - install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - relfile=`echo "$$file" | sed 's|^.*/||'`; \ - echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ - if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ - then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ - done; \ - else :; fi - @$(NORMAL_UNINSTALL) - @list='$(INFO_DEPS)'; \ - for file in $$list; do \ - relfile=`echo "$$file" | sed 's|^.*/||'`; \ - relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ - (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ - echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ - rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ - else :; fi); \ - done - -uninstall-pdf-am: - @$(NORMAL_UNINSTALL) - @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ - rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ - done - -uninstall-ps-am: - @$(NORMAL_UNINSTALL) - @list='$(PSS)'; test -n "$(psdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ - rm -f "$(DESTDIR)$(psdir)/$$f"; \ - done - -dist-info: $(INFO_DEPS) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - list='$(INFO_DEPS)'; \ - for base in $$list; do \ - case $$base in \ - $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ - esac; \ - if test -f $$base; then d=.; else d=$(srcdir); fi; \ - base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ - for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ - if test -f $$file; then \ - relfile=`expr "$$file" : "$$d/\(.*\)"`; \ - test -f "$(distdir)/$$relfile" || \ - cp -p $$file "$(distdir)/$$relfile"; \ - else :; fi; \ - done; \ - done - -mostlyclean-aminfo: - -rm -rf mathgl_en.aux mathgl_en.cp mathgl_en.cps mathgl_en.fn mathgl_en.fns \ - mathgl_en.ky mathgl_en.kys mathgl_en.log mathgl_en.pg \ - mathgl_en.tmp mathgl_en.toc mathgl_en.tp mathgl_en.tps \ - mathgl_en.vr mathgl_en.vrs mathgl_ru.aux mathgl_ru.cp \ - mathgl_ru.cps mathgl_ru.fn mathgl_ru.fns mathgl_ru.ky \ - mathgl_ru.kys mathgl_ru.log mathgl_ru.pg mathgl_ru.tmp \ - mathgl_ru.toc mathgl_ru.tp mathgl_ru.tps mathgl_ru.vr \ - mathgl_ru.vrs mgl_en.aux mgl_en.cp mgl_en.cps mgl_en.fn \ - mgl_en.fns mgl_en.ky mgl_en.kys mgl_en.log mgl_en.pg \ - mgl_en.tmp mgl_en.toc mgl_en.tp mgl_en.tps mgl_en.vr \ - mgl_en.vrs mgl_ru.aux mgl_ru.cp mgl_ru.cps mgl_ru.fn \ - mgl_ru.fns mgl_ru.ky mgl_ru.kys mgl_ru.log mgl_ru.pg \ - mgl_ru.tmp mgl_ru.toc mgl_ru.tp mgl_ru.tps mgl_ru.vr \ - mgl_ru.vrs - -clean-aminfo: - -test -z "mathgl_en.dvi mathgl_en.pdf mathgl_en.ps mathgl_en.html mathgl_ru.dvi \ - mathgl_ru.pdf mathgl_ru.ps mathgl_ru.html mgl_en.dvi \ - mgl_en.pdf mgl_en.ps mgl_en.html mgl_ru.dvi mgl_ru.pdf \ - mgl_ru.ps mgl_ru.html" \ - || rm -rf mathgl_en.dvi mathgl_en.pdf mathgl_en.ps mathgl_en.html mathgl_ru.dvi \ - mathgl_ru.pdf mathgl_ru.ps mathgl_ru.html mgl_en.dvi \ - mgl_en.pdf mgl_en.ps mgl_en.html mgl_ru.dvi mgl_ru.pdf \ - mgl_ru.ps mgl_ru.html - -maintainer-clean-aminfo: - @list='$(INFO_DEPS)'; for i in $$list; do \ - i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ - echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ - rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ - done - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-info -check-am: all-am -check: check-recursive -all-am: Makefile $(INFO_DEPS) all-local -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(infodir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-aminfo clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: $(DVIS) - -html: html-recursive - -html-am: $(HTMLS) - -info: info-recursive - -info-am: $(INFO_DEPS) - -install-data-am: install-data-local install-info-am - -install-dvi: install-dvi-recursive - -install-dvi-am: $(DVIS) - @$(NORMAL_INSTALL) - test -z "$(dvidir)" || $(MKDIR_P) "$(DESTDIR)$(dvidir)" - @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ - done -install-exec-am: - -install-html: install-html-recursive - -install-html-am: $(HTMLS) - @$(NORMAL_INSTALL) - test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" - @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ - for p in $$list; do \ - if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ - $(am__strip_dir) \ - if test -d "$$d$$p"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ - $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ - echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \ - $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ - else \ - list2="$$list2 $$d$$p"; \ - fi; \ - done; \ - test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ - done; } -install-info: install-info-recursive - -install-info-am: $(INFO_DEPS) - @$(NORMAL_INSTALL) - test -z "$(infodir)" || $(MKDIR_P) "$(DESTDIR)$(infodir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ - for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - esac; \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ - for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ - $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ - if test -f $$ifile; then \ - echo "$$ifile"; \ - else : ; fi; \ - done; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done - @$(POST_INSTALL) - @if (install-info --version && \ - install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ - list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ - for file in $$list; do \ - relfile=`echo "$$file" | sed 's|^.*/||'`; \ - echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ - install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ - done; \ - else : ; fi -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: $(PDFS) - @$(NORMAL_INSTALL) - test -z "$(pdfdir)" || $(MKDIR_P) "$(DESTDIR)$(pdfdir)" - @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done -install-ps: install-ps-recursive - -install-ps-am: $(PSS) - @$(NORMAL_INSTALL) - test -z "$(psdir)" || $(MKDIR_P) "$(DESTDIR)$(psdir)" - @list='$(PSS)'; test -n "$(psdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-aminfo \ - maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: $(PDFS) - -ps: ps-recursive - -ps-am: $(PSS) - -uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ - uninstall-local uninstall-pdf-am uninstall-ps-am - -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am all-local check check-am clean clean-aminfo \ - clean-generic clean-libtool ctags ctags-recursive dist-info \ - distclean distclean-generic distclean-libtool distclean-tags \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-data-local \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-aminfo maintainer-clean-generic mostlyclean \ - mostlyclean-aminfo mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-dvi-am uninstall-html-am uninstall-info-am \ - uninstall-local uninstall-pdf-am uninstall-ps-am - - -#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 - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/texinfo/class_en.texi b/texinfo/class_en.texi index 4e822e3..1fd9c8d 100644 --- a/texinfo/class_en.texi +++ b/texinfo/class_en.texi @@ -38,7 +38,7 @@ Class mglGraphIDTF implements plotting function for 1D, 2D and 3D plots and exp @section mglGraphAB class @cindex mglGraphAB @cindex window -#cindex mglDraw +@c @cindex mglDraw Generally this class is a bit less abstract class than mglGraph class (@pxref{MathGL core}). It provide many protected methods for handling intermediate data from mglGraph methods and require a few methods to be defined by derived class. The developers of derived classes should look on file @samp{mgl_ab.h} and comments inside it or contact me. diff --git a/texinfo/concept_en.texi b/texinfo/concept_en.texi index f05b618..8bd1cc4 100644 --- a/texinfo/concept_en.texi +++ b/texinfo/concept_en.texi @@ -1,4 +1,4 @@ - +@c ------------------------------------------------------------------ @node Coordinate axes, Line styles, , General concepts @subsection Coordinate axes @@ -25,7 +25,22 @@ The line style is defined by the string which may contain specifications for col By default palette contain following colors: dark grayH’, blueb’, greeng’, redr’, cyanc’, magentam’, yellowy’, grayh’, green-bluel’, sky-bluen’, orangeq’, green-yellowe’, blue-violetu’, purplep’.

The color types are: ‘k’ -- black, ‘r’ -- red, ‘R’ -- dark red, ‘g’ -- green, ‘G’ -- dark green, ‘b’ -- blue, ‘B’ -- dark blue, ‘c’ -- cyan, ‘C’ -- dark cyan, ‘m’ -- magenta, ‘M’ -- dark magenta, ‘y’ -- yellow, ‘Y’ -- dark yellow (gold), ‘h’ -- gray, ‘H’ -- dark gray, ‘w’ -- white, ‘W’ -- bright gray, ‘l’ -- green-blue, ‘L’ -- dark green-blue, ‘e’ -- green-yellow, ‘E’ -- dark green-yellow, ‘n’ -- sky-blue, ‘N’ -- dark sky-blue, ‘u’ -- blue-violet, ‘U’ -- dark blue-violet, ‘p’ -- purple, ‘P’ -- dark purple, ‘q’ -- orange, ‘Q’ -- dark orange (brown).

+@end html +@end ifhtml + + +You can also use ``lighted'' colors. The ``lighted'' color contain 2 symbols in brackets @samp{@{cN@}}: first one is the usual symbol for color specification, the second one is a digit for its brightness. The digit can be in range @samp{1}...@samp{9}. +Number @samp{5} corresponds to a normal color, @samp{1} is a very dark version of the color (practically black), and @samp{9} is a very bright version of the color (practically white). For example, the colors can be @samp{@{b2@}} @samp{@{b7@}} @samp{@{r7@}} and so on. + +@float +@image{../png/colors, 7cm} +@caption{Colors and its ids.} +@end float + + +@ifhtml +@html Dashing style has the following meaning: space -- no line (usable for plotting only marks), ‘-’ -- solid line (■■■■■■■■■■■■■■■■), ‘|’ -- long dashed line (■■■■■■■■□□□□□□□□), ‘;’ -- dashed line (■■■■□□□□■■■■□□□□), ‘=’ -- small dashed line (■■□□■■□□■■□□■■□□), ‘:’ -- dotted line (■□□□■□□□■□□□■□□□), ‘j’ -- dash-dotted line (■■■■■■■□□□□■□□□□), ‘i’ -- small dash-dotted line (■■■□□■□□■■■□□■□□). @end html @end ifhtml @@ -51,6 +66,7 @@ One may specify to draw a special symbol (an arrow) at the beginning and at the @caption{Arrow styles.} @end float +@c ------------------------------------------------------------------ @node Color scheme, Font styles, Line styles, General concepts @subsection Color scheme @@ -58,14 +74,6 @@ One may specify to draw a special symbol (an arrow) at the beginning and at the The color scheme is used for determining the color of surfaces, isolines, isosurfaces and so on. The color scheme is defined by the string, which may contain several characters that are color id (@pxref{Line styles}) or characters @samp{d#:|}. Symbol @samp{d} denotes the interpolation by 3d position instead of the coloring by amplitude. Symbol @samp{#} switches to mesh drawing or to a wire plot. Symbol @samp{|} disables color interpolation in color scheme, which can be useful, for example, for sharp colors during matrix plotting. Symbol @samp{:} finishes the color scheme parsing. Following it, the user may put styles for the text, rotation axis for curves/isocontours, and so on. Color scheme may contain up to 32 color values. -You may also use ``lighted'' colors in the color scheme specification (@emph{not in line style!}). The ``lighted'' color contain 2 symbols: first one is the usual symbol for color specification, the second one is a digit for its brightness. The digit can be in range @samp{1}...@samp{9}. -Number @samp{5} corresponds to a normal color, @samp{1} is a very dark version of the color (practically black), and @samp{9} is a very bright version of the color (practically white). For example, the color scheme can be @samp{b2b7wr7r2}. - -@float -@image{../png/colors, 7cm} -@caption{Colors and its ids.} -@end float - For coloring by @emph{amplitude} (most common) the final color is a linear interpolation of color array. The color array is constructed from the string ids. The argument is the amplitude normalized between @var{Cmin} -- @var{Cmax} (@pxref{Axis settings}). For example, string containing 4 characters @samp{bcyr} corresponds to a colorbar from blue (lowest value) through cyan (next value) through yellow (next value) to the red (highest value). String @samp{kw} corresponds to a colorbar from black (lowest value) to white (highest value). String @samp{m} corresponds to a simple magenta color. There are several useful combinations. String @samp{kw} corresponds to the simplest gray color scheme where higher values are brighter. String @samp{wk} presents the inverse gray color scheme where higher value is darker. Strings @samp{kRryw}, @samp{kGgw}, @samp{kBbcw} present the well-known @emph{hot}, @emph{summer} and @emph{winter} color schemes. Strings @samp{BbwrR} and @samp{bBkRr} allow to view bi-color figure on white or black background, where negative values are blue and positive values are red. String @samp{BbcyrR} gives a color scheme similar to the well-known @emph{jet} color scheme. @@ -75,16 +83,18 @@ There are several useful combinations. String @samp{kw} corresponds to the simpl @caption{Most popular color schemes.} @end float -When coloring by @emph{coordinate}, the final color is determined by the position of the point in 3d space and is calculated from formula c=x*c[1] + y*c[2] + z*c[3]. Here, c[1], c[2], c[3] are the first three elements of color array; x, y, z are normalized to @var{Min} -- @var{Max} coordinates of the point. This type of coloring is useful for isosurface plot where color may show the exact position of a piece of surface. +When coloring by @emph{coordinate} (used in @ref{map}), the final color is determined by the position of the point in 3d space and is calculated from formula c=x*c[1] + y*c[2]. Here, c[1], c[2] are the first two elements of color array; x, y are normalized to axis range coordinates of the point. +@c This type of coloring is useful for isosurface plot where color may show the exact position of a piece of surface. +@c ------------------------------------------------------------------ @node Font styles, Textual formulas, Color scheme, General concepts @subsection Font styles @cindex Font styles -Text style is specified by the string which may contain several characters of font (@samp{ribwou}) and/or alignment (@samp{LRC}) specifications. The string also may contain the color id characters @samp{wkrgbcymhRGBCYMHW} (@pxref{Line styles}) after the symbol @samp{:}. For example, @samp{biC:b} sets the bold italic font text aligned at the center and with blue color. +Text style is specified by the string which may contain several characters of font (@samp{ribwou}) and/or alignment (@samp{LRC}) specifications. The string also may contain the color id characters @samp{wkrgbcymhRGBCYMHW} (@pxref{Line styles}) after the symbol @samp{:}. For example, @samp{r:iCb} sets the bold italic font text aligned at the center and with red color. -The font types are: @samp{r} -- roman font, @samp{i} -- italic style, @samp{b} -- bold style. By default roman roman font is used. The align types are: @samp{L} -- align left (default), @samp{C} -- align center, @samp{R} -- align right. Additional font effects are: @samp{w} -- wired, @samp{o} -- over-lined, @samp{u} -- underlined. +The font types are: @samp{r} -- roman (or regular) font, @samp{i} -- italic style, @samp{b} -- bold style. By default roman roman font is used. The align types are: @samp{L} -- align left (default), @samp{C} -- align center, @samp{R} -- align right. Additional font effects are: @samp{w} -- wired, @samp{o} -- over-lined, @samp{u} -- underlined. @c Also a parsing of the LaTeX-like syntax is provided (for detail, @pxref{mglFont class} and @ref{Font settings}). Also a parsing of the LaTeX-like syntax is provided. There are commands for the font style changing inside the string (for example, use \b for bold font): \a or \overline -- over-lined, \b or \textbf -- bold, \i or \textit -- italic, \r or \textrm -- roman (disable bold and italic attributes), \u or \underline -- underlined, \w or \wire -- wired, \big -- bigger size, @@ -- smaller size. The lower and upper indexes are specified by @samp{_} and @samp{^} symbols. At this the changed font style is applied only on next symbol or symbols in braces @{@}. The text in braces @{@} are treated as single symbol that allow one to print the index of index. For example, compare the strings @samp{sin (x^@{2^3@})} and @samp{sin (x^2^3)}. You may also change text color inside string by command #? or by \color? where @samp{?} is symbolic id of the color (@pxref{Line styles}). For example, words @samp{Blue} and @samp{red} will be colored in the string @samp{#b@{Blue@} and \colorr@{red@} text}. The most of functions understand the newline symbol @samp{\n} and allows to print multi-line text. Finally, you can use arbitrary UTF codes by command @code{\utf0x????}. For example, @code{\utf0x3b1} will produce @@ -117,7 +127,8 @@ The small part of most common special TeX symbols are: @math{\angle} -- \angle, The font size can be defined explicitly (if @var{size}>0) or relative to a base font size as |@var{size}|*@var{FontSize} (if @var{size}<0). The value @var{size}=0 specifies that the string will not be printed. The base font size is measured in internal ``MathGL'' units. Special functions @code{SetFontSizePT(), SetFontSizeCM(), SetFontSizeIN()} allow one to set it in more ``common'' variables for a given dpi value of the picture. -@node Textual formulas, , Font styles, General concepts +@c ------------------------------------------------------------------ +@node Textual formulas, Command options, Font styles, General concepts @subsection Textual formulas @cindex Textual formulas @@ -153,7 +164,7 @@ Trigonometric functions are: @samp{sin(x)}, @samp{cos(x)}, @samp{tan(x)} (or @sa @end html @end ifhtml @ifnothtml -There are a set of special functions: @samp{gamma(x)} -- Gamma function @math{\Gamma(x) = \int_0^\infty dt t^@{x-1@} \exp(-t)} , @samp{psi(x)} -- digamma function @math{\psi(x) = \Gamma’(x)/\Gamma(x)} for x!=0, @samp{ai(x)} -- Airy function Ai(x), @samp{bi(x)} -- Airy function Bi(x), @samp{cl(x)} -- Clausen function, @samp{li2(x)} (or @samp{dilog(x)}) -- dilogarithm @math{Li_2(x) = - \Re \int_0^x ds \log(1-s)/s}, @samp{sinc(x)} -- compute @math{sinc(x) = \sin(\pi x) / (\pi x)} for any value of x, @samp{zeta(x)} -- Riemann zeta function @math{\zeta(s) = \sum_@{k=1@}^\infty k^@{-s@}} for arbitrary s!=1, @samp{eta(x)} -- eta function @math{\eta(s) = (1-2^@{1-s@}) \zeta(s)} for arbitrary s, @samp{lp(l,x)} -- Legendre polynomial @math{P_l(x)}, (|x|<=1, l>=0), @samp{w0(x)}, @samp{w1(x)} -- principal branch of the Lambert @var{W} functions. Function W(x) is defined to be solution of the equation @math{W \exp(W) = x}. +There are a set of special functions: @samp{gamma(x)} -- Gamma function @math{\Gamma(x) = \int_0^\infty dt t^@{x-1@} \exp(-t)} , @samp{psi(x)} -- digamma function @math{\psi(x) = \Gamma'(x)/\Gamma(x)} for x!=0, @samp{ai(x)} -- Airy function Ai(x), @samp{bi(x)} -- Airy function Bi(x), @samp{cl(x)} -- Clausen function, @samp{li2(x)} (or @samp{dilog(x)}) -- dilogarithm @math{Li_2(x) = - \Re \int_0^x ds \log(1-s)/s}, @samp{sinc(x)} -- compute @math{sinc(x) = \sin(\pi x) / (\pi x)} for any value of x, @samp{zeta(x)} -- Riemann zeta function @math{\zeta(s) = \sum_@{k=1@}^\infty k^@{-s@}} for arbitrary s!=1, @samp{eta(x)} -- eta function @math{\eta(s) = (1-2^@{1-s@}) \zeta(s)} for arbitrary s, @samp{lp(l,x)} -- Legendre polynomial @math{P_l(x)}, (|x|<=1, l>=0), @samp{w0(x)}, @samp{w1(x)} -- principal branch of the Lambert @var{W} functions. Function W(x) is defined to be solution of the equation @math{W \exp(W) = x}. The exponent integrals are: @samp{ci(x)} -- Cosine integral @math{Ci(x) = \int_0^x dt \cos(t)/t}, @samp{si(x)} -- Sine integral @math{Si(x) = \int_0^x dt \sin(t)/t}, @samp{erf(x)} -- error function @math{erf(x) = (2/\sqrt(\pi)) \int_0^x dt \exp(-t^2)}, @samp{ei(x)} -- exponential integral @math{Ei(x) := - PV(\int_@{-x@}^\infty dt \exp(-t)/t)} (where PV denotes the principal value of the integral), @samp{e1(x)} -- exponential integral @math{E_1(x) := Re \int_1^\infty dt \exp(-xt)/t} , @samp{e2(x)} -- exponential integral @math{E_2(x) := Re \int_1^\infty dt \exp(-xt)/t^2}, @samp{ei3(x)} -- exponential integral @math{Ei_3(x) = \int_0^x dt \exp(-t^3)} for x>=0. @@ -169,3 +180,62 @@ Note, some of these functions are unavailable if NO_GSL is defined during compil 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. +@c ------------------------------------------------------------------ +@node Command options, , Textual formulas, General concepts +@section Command options + +Command options allow the easy setup of the plot by changing of global settings only for this plot. Each option is separated from the previous text by symbol @samp{;}. Options work so that them remember the current settings, change settings as it being set in the option, execute command and return the original settings back. So, the options usage for data handling commands or for graphics setup commands is useless. + +The most useful options are @code{xrange, yrange, zrange}. They sets the boundaries for data change. This boundaries are used for automatically filled variables. So, these options allow one to change the position of some plots. For example, in command @code{Plot(y,"","xrange 0.1 0.9");} or @code{plot y; xrange 0.1 0.9} the x coordinate will be equidistantly distributed in range 0.1 ... 0.9. + +The full list of options are: +@cindex alpha +@cindex alphadef +@deffn {MGL option} alpha @code{val} +@deffnx {MGL option} alphadef @code{val} +Sets alpha value (transparency) of the plot. The value should be in range [0, 1]. See also @ref{alphadef}. +@end deffn +@cindex ambient +@deffn {MGL option} ambient @code{val} +Sets brightness of ambient light for the plot. The value should be in range [0, 1]. See also @ref{ambient}. +@end deffn +@cindex crange +@deffn {MGL option} crange @code{val1 val2} +Sets boundaries of color change for the plot. See also @ref{crange}. +@end deffn +@cindex xrange +@deffn {MGL option} xrange @code{val1 val2} +Sets boundaries of x coordinate change for the plot. See also @ref{xrange}. +@end deffn +@cindex yrange +@deffn {MGL option} yrange @code{val1 val2} +Sets boundaries of y coordinate change for the plot. See also @ref{yrange}. +@end deffn +@cindex zrange +@deffn {MGL option} zrange @code{val1 val2} +Sets boundaries of z coordinate change for the plot. See also @ref{zrange}. +@end deffn +@cindex cut +@deffn {MGL option} cut @code{val} +Sets whether to cut or to project the plot points lying outside the bounding box. See also @ref{cut}. +@end deffn +@cindex fontsize +@deffn {MGL option} fontsize @code{val} +Sets the size of text. See also @ref{font}. +@end deffn +@cindex marksize +@deffn {MGL option} marksize @code{val} +Sets the size of marks. See also @ref{marksize}. +@end deffn +@cindex meshnum +@deffn {MGL option} meshnum @code{val} +Work like @ref{meshnum} command. +@end deffn +@cindex legend +@deffn {MGL option} legend 'txt' +Adds string 'txt' to internal legend accumulator. The style of described line and mark is taken from arguments of the last @ref{1D plotting} command. See also @ref{legend}. +@end deffn +@cindex value +@deffn {MGL option} value @code{val} +Set the value to be used as additional numeric parameter in plotting command. +@end deffn diff --git a/texinfo/concept_ru.texi b/texinfo/concept_ru.texi index 0d988a4..d2407ea 100644 --- a/texinfo/concept_ru.texi +++ b/texinfo/concept_ru.texi @@ -1,5 +1,4 @@ - - +@c ------------------------------------------------------------------ @node Coordinate axes, Line styles, , General concepts @subsection Оси координат @@ -13,6 +12,7 @@ Вид меток по осям определяется функцией @code{SetTicks()} (@pxref{Axis settings}). Она имеет 3 аргумента: первый @var{d} задает шаг меток (если положительны) или их число (если отрицательны) или логарифмические метки (если равны нулю); второ @var{ns} задает число "подметок"; последний определяет начальную точку для меток (по умолчанию это точка пересечения осей). Функция @var{SetTuneTicks} включает/выключает выделение общего множителя (большого или малого факторов в диапазоне) для меток осей координат. Наконец, если стандартный вид меток не устраивает пользователя, то их шаблон можно задать явно (можно использовать и ТеХ символы), воспользовавшись функциями @code{SetXTT(), SetYTT(). SetZTT(). SetCTT()}. Кроме того, в качестве меток можно вывести произвольный текст использовав функцию @code{SetTicksVal()}. +@c ------------------------------------------------------------------ @node Line styles, Color scheme, Coordinate axes, General concepts @subsection Стиль линий @@ -52,6 +52,7 @@ @caption{Стили стрелок.} @end float +@c ------------------------------------------------------------------ @node Color scheme, Font styles, Line styles, General concepts @subsection Цветовая схема @@ -78,12 +79,13 @@ При определении цвета по @emph{положению точки в пространстве} окончательный цвет определяется по формуле c=x*c[1] + y*c[2] + z*c[3]. Здесь c[1], c[2], c[3] -- первые три цвета в цветовом массиве; x, y, z -- координаты точки, нормированные на @var{Min}x@var{Max}. Такой тип определения цвета полезен, например, при построении поверхностей уровня, когда цвет дает представление о положении точки в пространстве. +@c ------------------------------------------------------------------ @node Font styles, Textual formulas, Color scheme, General concepts @subsection Стиль текста @cindex Стиль текста -Стиль текста задается строкой, которая может содержать несколько символов: тип шрифта (@samp{ribwou}) и/или выравнивания (@samp{LRC}), а также цвет текста @samp{wkrgbcymhRGBCYMHW} (@pxref{Line styles}) после символа @samp{:}. Например, @samp{biC:b} соответствует жирному курсиву с выравниванием по центру синего цвета. +Стиль текста задается строкой, которая может содержать несколько символов: тип шрифта (@samp{ribwou}) и/или выравнивания (@samp{LRC}), а также цвет текста @samp{wkrgbcymhRGBCYMHW} (@pxref{Line styles}) после символа @samp{:}. Например, @samp{r:iCb} соответствует жирному курсиву с выравниванием по центру красного цвета. Начертания шрифта: @samp{r} -- прямой шрифт, @samp{i} -- курсив, @samp{b} -- жирный. По умолчанию используется прямой шрифт. Типы выравнивания текста: @samp{L} -- по левому краю (по умолчанию), @samp{C} -- по центру, @samp{R} -- по правому краю. Дополнительные эффекты шрифта: @samp{w} -- контурный, @samp{o} -- надчеркнутый, @samp{u} -- подчеркнутый. @c Синтаксический разбор LaTeX-их команд по умолчанию включен (подробнее см. @pxref{mglFont class} и @ref{Font settings}). @@ -117,7 +119,8 @@ Размер текста может быть задан явно (если @var{size}>0) или относительно базового размера шрифта для рисунка |@var{size}|*@var{FontSize} при @var{size}<0. Значение @var{size}=0 указывает, что соответствующая строка выводиться не будет. Базовый размер шрифта измеряется во внутренних единицах. Специальные функции @code{SetFontSizePT(), SetFontSizeCM(), SetFontSizeIN()} позволяют задавать его в более ``привычных'' единицах. -@node Textual formulas, , Font styles, General concepts +@c ------------------------------------------------------------------ +@node Textual formulas, Command options, Font styles, General concepts @subsection Текстовые формулы @cindex Текстовые формулы @@ -152,7 +155,7 @@ MathGL имеет быстрый парсер текстовых формул @end html @end ifhtml @ifnothtml -Специальные функции: @samp{gamma(x)} -- гамма функция @math{\Gamma(x) = \int_0^\infty dt t^@{x-1@} \exp(-t)} , @samp{psi(x)} -- дигамма функция @math{\psi(x) = \Gamma’(x)/\Gamma(x)} для x!=0, @samp{ai(x)} -- Эйри функция Ai(x), @samp{bi(x)} -- Эйри функция Bi(x), @samp{cl(x)} -- функция Клаузена, @samp{li2(x)} (или @samp{dilog(x)}) -- дилогарифм @math{Li_2(x) = - \Re \int_0^x ds \log(1-s)/s}, @samp{sinc(x)} -- функция @math{sinc(x) = \sin(\pi x) / (\pi x)} для любых x, @samp{zeta(x)} -- зета функция Римана @math{\zeta(s) = \sum_@{k=1@}^\infty k^@{-s@}} для s!=1, @samp{eta(x)} -- эта функция @math{\eta(s) = (1-2^@{1-s@}) \zeta(s)} для произвольного s, @samp{lp(l,x)} -- полином Лежандра @math{P_l(x)}, (|x|<=1, l>=0), @samp{w0(x)}, @samp{w1(x)} -- функции Ламберта @var{W}. Функции W(x) определены как решение уравнения @math{W \exp(W) = x}. +Специальные функции: @samp{gamma(x)} -- гамма функция @math{\Gamma(x) = \int_0^\infty dt t^@{x-1@} \exp(-t)} , @samp{psi(x)} -- дигамма функция @math{\psi(x) = \Gamma'(x)/\Gamma(x)} для x!=0, @samp{ai(x)} -- Эйри функция Ai(x), @samp{bi(x)} -- Эйри функция Bi(x), @samp{cl(x)} -- функция Клаузена, @samp{li2(x)} (или @samp{dilog(x)}) -- дилогарифм @math{Li_2(x) = - \Re \int_0^x ds \log(1-s)/s}, @samp{sinc(x)} -- функция @math{sinc(x) = \sin(\pi x) / (\pi x)} для любых x, @samp{zeta(x)} -- зета функция Римана @math{\zeta(s) = \sum_@{k=1@}^\infty k^@{-s@}} для s!=1, @samp{eta(x)} -- эта функция @math{\eta(s) = (1-2^@{1-s@}) \zeta(s)} для произвольного s, @samp{lp(l,x)} -- полином Лежандра @math{P_l(x)}, (|x|<=1, l>=0), @samp{w0(x)}, @samp{w1(x)} -- функции Ламберта @var{W}. Функции W(x) определены как решение уравнения @math{W \exp(W) = x}. Экспоненциальные интегралы: @samp{ci(x)} -- cos-интеграл @math{Ci(x) = \int_0^x dt \cos(t)/t}, @samp{si(x)} -- sin-интеграл @math{Si(x) = \int_0^x dt \sin(t)/t}, @samp{erf(x)} -- функция ошибки @math{erf(x) = (2/\sqrt(\pi)) \int_0^x dt \exp(-t^2)}, @samp{ei(x)} -- интеграл @math{Ei(x) := - PV(\int_@{-x@}^\infty dt \exp(-t)/t)} (где PV обозначает главное значение), @samp{e1(x)} -- интеграл @math{E_1(x) := Re \int_1^\infty dt \exp(-xt)/t} , @samp{e2(x)} -- интеграл @math{E_2(x) := Re \int_1^\infty dt \exp(-xt)/t^2}, @samp{ei3(x)} -- интеграл @math{Ei_3(x) = \int_0^x dt \exp(-t^3)} для x>=0. @@ -167,3 +170,64 @@ MathGL имеет быстрый парсер текстовых формул При разборе формул нет различия между верхним и нижним регистром. Если аргумент лежит вне области определения функции, то возвращается NaN. +@c ------------------------------------------------------------------ +@node Command options, , Textual formulas, General concepts +@section Command options + +@section Опции команд + +Опции команд позволяют легко настроить вид отдельного графика не меняя глобальных настроек для все рисунка. Каждая опция отделяется от предыдущей символом @samp{;}. Опции работают так, что запоминают текущие настройки рисунка, применяют собственные настройки, выполняют команду и возвращают глобальные настройки обратно. Поэтому использование опций для команд обработки данных или настройки графика бесполезно. + +Наиболее часто используемые опции -- @code{xrange, yrange, zrange}, устанавливают границы изменения осей координат (и тем самым автоматических массивов). Например, команда @code{Plot(y,"","xrange 0.1 0.9");} или @code{plot y; xrange 0.1 0.9} построит кривую с x-координатой равно распределенной в интервале 0.1 ... 0.9, а не вдоль текущей оси x. + +Полный список опций: +@cindex alpha +@cindex alphadef +@deffn {Опция MGL} alpha @code{val} +@deffnx {Опция MGL} alphadef @code{val} +Задает величину прозрачности поверхности. Значение должно быть в диапазоне [0, 1]. См. также @ref{alphadef} +@end deffn +@cindex ambient +@deffn {Опция MGL} ambient @code{val} +Задает яркость фонового освещения. Значение должно быть в диапазоне [0, 1]. См. также @ref{ambient} +@end deffn +@cindex crange +@deffn {Опция MGL} crange @code{val1 val2} +Задает границы цветовой шкалы. См. также @ref{crange} +@end deffn +@cindex xrange +@deffn {Опция MGL} xrange @code{val1 val2} +Задает границы изменения координаты x. См. также @ref{xrange} +@end deffn +@cindex yrange +@deffn {Опция MGL} yrange @code{val1 val2} +Задает границы изменения координаты y. См. также @ref{yrange} +@end deffn +@cindex zrange +@deffn {Опция MGL} zrange @code{val1 val2} +Задает границы изменения координаты z. См. также @ref{zrange} +@end deffn +@cindex cut +@deffn {Опция MGL} cut @code{val} +Задает обрезание точек за пределами осей координат. См. также @ref{cut} +@end deffn +@cindex fontsize +@deffn {Опция MGL} fontsize @code{val} +Задает размер текста. См. также @ref{font} +@end deffn +@cindex marksize +@deffn {Опция MGL} marksize @code{val} +Задает размер маркеров. См. также @ref{marksize} +@end deffn +@cindex meshnum +@deffn {Опция MGL} meshnum @code{val} +Задает ориентировочное число линий, стрелок, ячеек и пр. См. также @ref{meshnum} +@end deffn +@cindex legend +@deffn {Опция MGL} legend 'txt' +Добавляет строку 'txt' во внутренний массив записей легенды. Стиль линии и маркера аргумента последней вызванной команды построения @ref{1D plotting}. См. также @ref{legend} +@end deffn +@cindex value +@deffn {MGL option} value @code{val} +Задает значение, которое будет использовано как дополнительный числовой параметр при построении графика. +@end deffn diff --git a/texinfo/core_en.texi b/texinfo/core_en.texi index 0103d78..dbfc6e5 100644 --- a/texinfo/core_en.texi +++ b/texinfo/core_en.texi @@ -2,128 +2,171 @@ @chapter MathGL core @cindex mglGraph -The core of MathGL is @strong{mglGraph} class defined in @code{#include }. It contains a lot of plotting functions for 1D, 2D and 3D plots. It also encapsulates parameters for axes drawing. Moreover an arbitrary coordinate transformation may be used for each axis. All plotting functions use data encapsulated in mglData class (@pxref{mglData class}) 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{Other classes}. - -Note that class mglGraph is abstract and contains only interface functions for plotting but does not make plot by itself. For plotting in specific device (screen, memory or file) one should use derived classes: mglGraphZB -- for bitmap picture in file or in memory; mglGraphPS -- for vector PostScript picture; mglGraphGL -- for drawing using OpenGL, or for GLUT windows interface; and so on, @pxref{Plotter classes}. If you want not only to create a picture but to view it in a window/widget or to run animation and so on then look at @ref{Widget classes}. - -There is a C++ wrapper class which have the same name @code{mglGraph} and defined in @code{mgl/mgl_graph.h}. You can use this class even with non-GNU compilers (i.e. in Borland or Microsoft one), but you @strong{should not include} any @code{mgl/mgl.h} or @code{mgl/mgl_parse.h} headers in this case! This wrapper class also used as base for all SWIG-based interfaces (Python, Octave and so on). So, later it is refered as @samp{Python} class for distinguish from original @samp{C++} class defined in @code{mgl/mgl.h} . +@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 plots. It also encapsulates parameters for axes drawing. Moreover an arbitrary coordinate transformation may be used for each axis. All plotting functions use data encapsulated in mglData class (@pxref{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{Other classes}. +@end ifclear @menu -* Graphics setup:: -* Axis settings:: -* Transformation matrix:: -* Export to file:: -* Primitives drawing:: -* Text printing:: -* Axis and Colorbar:: -* Legend:: -* 1D plotting:: -* 2D plotting:: -* 3D plotting:: -* Dual plotting:: -* Vector fields:: -* Other plotting:: -* Nonlinear fitting:: -* Data distributions:: -* Frames/Animation:: -* IDTF functions:: +* Constructor:: +* Graphics setup:: +* Axis settings:: +* Transformation matrix:: +* Export picture:: +* Primitives drawing:: +* Text printing:: +* Axis and Colorbar:: +* Legend:: +* 1D plotting:: +* 2D plotting:: +* 3D plotting:: +* Dual plotting:: +* Vector fields:: +* Other plotting:: +* Nonlinear fitting:: +* Data manipulation:: +* IDTF functions:: @end menu @c ################################################################## -@node Graphics setup, Axis settings, , MathGL core +@node Constructor, Graphics setup, , MathGL core +@section Create and delete objects + +@ifclear UDAV +@deftypefn {Constructor on @code{mglGraph}} {} mglGraph (@code{int} kind=@code{0}, @code{int} width=@code{600}, @code{int} height=@code{400}) +@deftypefnx {Constructor on @code{mglGraph}} {} mglGraph (@code{const mglGraph &}gr) +@deftypefnx {Constructor on @code{mglGraph}} {} mglGraph (@code{HMGL} gr) +@deftypefnx {C function} @code{HMGL} mgl_create_graph (@code{int} width, @code{int} height) +@deftypefnx {C function} @code{HMGL} mgl_create_graph_gl () +Creates the instance of class mglGraph with specified sizes @var{width} and @var{height}. Parameter @var{kind} may have following values: @samp{0} -- use default plotter, @samp{1} -- use OpenGL plotter. +@end deftypefn + +@deftypefn {Destructor on @code{mglGraph}} {} ~mglGraph () +@deftypefnx {C function} @code{HMGL} mgl_delete_graph (@code{HMGL} gr) +Deletes the instance of class mglGraph. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{HMGL} Self () +Returns the pointer to internal object of type @code{HMGL}. +@end deftypefn +@end ifclear + +@ifset UDAV +You don't need to create canvas object in MGL. +@end ifset + +@c ################################################################## +@node Graphics setup, Axis settings, Constructor, MathGL core @section Graphics setup @cindex MathGL setup Functions and variables in this group influences on overall graphics appearance. So all of them should be placed @emph{before} any actual plotting function calls. -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} DefaultPlotParam () +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} DefaultPlotParam () @deftypefnx {C function} @code{void} mgl_set_def_param (@code{HMGL} gr) -Restore initial values for all of parameters except described in @ref{Zooming}. +Restore initial values for all of parameters. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{void} SetPlotId (@code{const char *}id) +Sets name of plot for saving filename (in GLUT window for example). @end deftypefn +@end ifclear @menu -* Transparency:: -* Lighting:: -* Fog:: -* Default sizes:: -* Zooming:: -* Cutting:: -* Font settings:: -* Palette and colors:: -* Error handling:: -* Other settings:: +* Transparency:: +* Lighting:: +* Fog:: +* Default sizes:: +* Cutting:: +* Font settings:: +* Palette and colors:: +* Error handling:: @end menu @c ================================================================== @node Transparency, Lighting, , Graphics setup @subsection Transparency @cindex Alpha +@ifclear UDAV @cindex SetAlphaDef -@cindex SetTransparent @cindex SetTranspType +@end ifclear +@cindex AlphaDef +@cindex TranspType -There are several functions and variables for setup transparency. The general function is @code{Alpha()} which switch on/off the transparency for overall plot. It influence only for graphics which created after @code{Alpha()} call (with one exception, mglGraphGL). Function @code{SetAlphaDef} specify the default value of alpha-channel. You may switch off transparency of selected plot by function @code{SetTransparent}. Finally, function @code{SetTranspType} set the kind of transparency. @sref{Transparent surface sample} +There are several functions and variables for setup transparency. The general function is @ref{alpha} which switch on/off the transparency for overall plot. It influence only for graphics which created after @ref{alpha} call (with one exception, OpenGL). Function @ref{alphadef} specify the default value of alpha-channel. Finally, function @ref{transptype} set the kind of transparency. @sref{Transparent surface sample} -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{bool} Alpha (@code{bool} enable) +@anchor{alpha} +@deftypefn {MGL command} {} alpha @code{[val=on]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Alpha (@code{bool} enable) @deftypefnx {C function} @code{void} mgl_set_alpha (@code{HMGL} gr, @code{int} enable) -Sets the transparency on/off and returns previous value of transparency. It is recommended to call this function before any plotting command. In any case it must be called before @code{Finish()} function if the last is used. Default value is transparency off. Unfortunately it switches the transparency on/off for all subplots. Use @code{SetTransparent(false)} in particular plot to disable its transparency. +@end ifclear +Sets the transparency on/off and returns previous value of transparency. It is recommended to call this function before any plotting command. Default value is transparency off. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetAlphaDef (@code{float} val) +@anchor{alphadef} +@deftypefn {MGL command} {} alphadef @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetAlphaDef (@code{float} val) @deftypefnx {C function} @code{void} mgl_set_alpha_default (@code{HMGL} gr, @code{float} alpha) -Sets default value of alpha channel (transparency) for all plotting functions. Note, that OpenGL (mglGraphGL) has incorrect drawing for large values of alpha in case of several overlapping surfaces. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetTransparent (@code{bool} val) -@deftypefnx {C function} @code{void} mgl_set_transp (@code{HMGL} gr, @code{int} enable) -Flag which temporary switches transparency on/off for the plot. This is the same as @code{Alpha(val)} but more correctly work in mglGraphGL class. +@end ifclear +Sets default value of alpha channel (transparency) for all plotting functions. Initial value is 0.5. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetTranspType (@code{int} type) +@anchor{transptype} +@deftypefn {MGL command} {} transptype @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTranspType (@code{int} type) @deftypefnx {C function} @code{void} mgl_set_transp_type (@code{HMGL} gr, @code{int} enable) +@end ifclear Set the transparency type. Normal transparency (@samp{0}) -- below things is less visible than upper ones. It does not look well in OpenGL mode (mglGraphGL) for several surfaces. Glass-like transparency (@samp{1}) -- below and upper things are commutable and just decrease intensity of light by RGB channel. Lamp-like transparency (@samp{2}) -- below and upper things are commutable and are the source of some additional light. I recommend to set @code{SetAlphaDef(0.3)} or less for lamp-like transparency. @xref{Normal transparency}, @ref{Glass-like transparency}, @ref{Lamp-like transparency}. @end deftypefn -@deftypecv {@emph{Obsolete option}} mglGraph @code{float} AlphaDef -Default value of alpha channel. See @code{SetAlphaDef()}. -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{bool} Transparent -Flag which temporary switches transparency on/off for the plot. See @code{SetTransparent()}. -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{int} TranspType -This variable set the transparency type. See @code{SetTranspType()}. -@end deftypecv - @c ================================================================== @node Lighting, Fog, Transparency, Graphics setup @subsection Lighting +@ifclear UDAV +@cindex SetAmbient +@cindex AddLight +@end ifclear @cindex Light @cindex Ambient -@cindex AddLight -There are several functions for setup lighting. The general function is @code{Light(bool)} which switch on/off the lighting for overall plot. It influence only for graphics which created after @code{Light()} call (with one exception, mglGraphGL). Generally MathGL support up to 10 independent light sources. But in OpenGL mode only 8 of light sources is used due to OpenGL limitations. The position, color, brightness of each light source can be set separately. By default only one light source is active. It is source number @code{0} with white color, located at top of the plot. +There are several functions for setup lighting. The general function is @code{Light(bool)} which switch on/off the lighting for overall plot. It influence only for graphics which created after @ref{light} call (with one exception, OpenGL). Generally MathGL support up to 10 independent light sources. But in OpenGL mode only 8 of light sources is used due to OpenGL limitations. The position, color, brightness of each light source can be set separately. By default only one light source is active. It is source number @code{0} with white color, located at top of the plot. -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{bool} Light (@code{bool} enable) +@anchor{light} +@deftypefn {MGL command} {} light @code{[val=on]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{bool} Light (@code{bool} enable) @deftypefnx {C function} @code{void} mgl_set_light (@code{HMGL} gr, @code{int} enable) +@end ifclear Sets the using of light on/off for overall plot. Function returns previous value of lighting. Default value is lightning off. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Light (@code{int} n, @code{bool} enable) +@deftypefn {MGL command} {} light @code{num} @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Light (@code{int} n, @code{bool} enable) @deftypefnx {C function} @code{void} mgl_set_light_n (@code{HMGL} gr, @code{int} n, @code{int} enable) +@end ifclear Switch on/off @var{n}-th light source separately. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} AddLight (@code{int} n, @code{float} x, @code{float} y, @code{float} z, @code{char} c=@code{'w'}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} Light (@code{int} n, @code{mglPoint} p, @code{char} c=@code{'w'}, @code{float} bright=@code{0.5}, @code{bool} infty=@code{true}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} Light (@code{int} n, @code{mglPoint} p, @code{mglColor} c, @code{float} bright=@code{0.5}, @code{bool} infty=@code{true}) +@deftypefn {MGL command} {} light @code{num xpos ypos zpos} ['col'='w' @code{br=0.5}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} AddLight (@code{int} n, @code{mglPoint} p, @code{char} c=@code{'w'}, @code{float} bright=@code{0.5}, @code{bool} infty=@code{true}, @code{float} ap=@code{0}) @deftypefnx {C function} @code{void} mgl_add_light (@code{HMGL} gr, @code{int} n, @code{float} x, @code{float} y, @code{float} z, @code{char} c) +@deftypefnx {C function} @code{void} mgl_add_light_ext (@code{HMGL} gr, @code{int} n, @code{float} x, @code{float} y, @code{float} z, @code{char} c, @code{float} bright, @code{int} infty, @code{float} ap) +@end ifclear The function adds a light source with identification @var{n} at position @var{p} with color @var{c} and with brightness @var{bright} (which must be in range [0,1]). Flag @var{infty}=@code{true} puts the source to infinite distance (for the faster drawing). @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Ambient (@code{float} bright=@code{0.5}) -@deftypefnx {C function} @code{void} mgl_set_ambbr (@code{HMGL} gr, @code{float} bright) +@anchor{ambient} +@deftypefn {MGL command} {} ambient @code{val} +@ifclear UDAV +@deftypefnx {Метод класса @code{mglGraph}} @code{void} SetAmbient (@code{float} bright=@code{0.5}) +@deftypefnx {Функция С} @code{void} mgl_set_ambbr (@code{HMGL} gr, @code{float} bright) +@end ifclear Sets the brightness of ambient light. The value should be in range [0,1]. @end deftypefn @@ -132,106 +175,87 @@ Sets the brightness of ambient light. The value should be in range [0,1]. @subsection Fog @cindex Fog -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Fog (@code{float} d, @code{float} dz=@code{0.25}) +@anchor{fog} +@deftypefn {MGL command} {} fog @code{val [dz=0.25]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Fog (@code{float} d, @code{float} dz=@code{0.25}) @deftypefnx {C function} @code{void} mgl_set_fog (@code{HMGL} gr, @code{float} d, @code{float} dz) +@end ifclear Function imitate a fog in the plot. Fog start from relative distance @var{dz} from view point and its density growths exponentially in depth. So that the fog influence is determined by law ~ 1-exp(-@emph{d*z}). Here @emph{z} is normalized to 1 depth of the plot. If value @var{d}=@code{0} then the fog is absent. @sref{Surface in fog sample} @end deftypefn @c ================================================================== -@node Default sizes, Zooming, Fog, Graphics setup +@node Default sizes, Cutting, Fog, Graphics setup @subsection Default sizes -@cindex SetTickLen -@cindex SetTickStl +@ifclear UDAV @cindex SetBarWidth @cindex SetMarkSize @cindex SetArrowSize -@cindex SetBaseLineWidth - -These variables control the default (initial) values for most graphics parameters including sizes of markers, arrows, linewidth and so on. As any other settings these ones will influence only on plots created after the settings change. - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetBarWidth ( @code{float} val) +@cindex SetMeshNum +@cindex SetPlotId +@end ifclear +@cindex BarWidth +@cindex MarkSize +@cindex ArrowSize +@cindex MeshNum + +These variables control the default (initial) values for most graphics parameters including sizes of markers, arrows, line width and so on. As any other settings these ones will influence only on plots created after the settings change. + +@anchor{barwidth} +@deftypefn {MGL command} {} barwidth @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetBarWidth ( @code{float} val) @deftypefnx {C function} @code{void} mgl_set_bar_width (@code{HMGL} gr, @code{float} val) -Sets relative width of rectangles in Bars, Barh, BoxPlot (@pxref{Bars}). Default value is @code{0.7}. +@end ifclear +Sets relative width of rectangles in @ref{bars}, @ref{barh}, @ref{boxplot}, @ref{candle}. Default value is @code{0.7}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetMarkSize (@code{float} val) +@anchor{marksize} +@deftypefn {MGL command} {} marksize @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetMarkSize (@code{float} val) @deftypefnx {C function} @code{void} mgl_set_mark_size (@code{HMGL} gr, @code{float} val) +@end ifclear Sets size of marks for @ref{1D plotting}. Default value is @code{0.02}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetArrowSize (@code{float} val) +@anchor{arrowsize} +@deftypefn {MGL command} {} arrowsize @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetArrowSize (@code{float} val) @deftypefnx {C function} @code{void} mgl_set_arrow_size (@code{HMGL} gr, @code{float} val) +@end ifclear Sets size of arrows for @ref{1D plotting}, lines and curves (@pxref{Primitives drawing}). Default value is @code{0.03}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetBaseLineWidth (@code{float} val) -@deftypefnx {C function} @code{void} mgl_set_base_line_width (@code{HMGL} gr, @code{float} val) -Defines the base width for all lines. The value <1 is ignored. For values > 1 the real line width is result of multiplication of specified line width and the value of @var{BaseLineWidth}. Increase of this variables is actual for large bitmap pictures. Default value is @code{1}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetTickLen (@code{float} val, @code{float} stt=@code{1}) -@deftypefnx {C function} @code{void} mgl_set_tick_len (@code{HMGL} gr, @code{float} val, @code{float} stt) -The relative length of axis ticks. Default value is @code{0.1}. Parameter @var{stt}>0 set relative length of subticks which is in @code{sqrt(1+stt)} times smaller. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetTickStl (@code{const char *}stl, @code{const char *}sub=@code{0}) -@deftypefnx {C function} @code{void} mgl_set_tick_stl (@code{HMGL} gr, @code{const char *}stl, @code{const char *}sub) -The line style of axis ticks (@var{stl}) and subticks (@var{sub}). If @var{stl} is empty then default style is used (@samp{k} or @samp{w} depending on transparency type). If @var{sub} is empty then ticks style is used (i.e. @var{stl}). -@end deftypefn - -@deftypecv {@emph{Obsolete option}} mglGraph @code{float} BarWidth -Relative width of rectangles. See @code{SetBarWidth()}. -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{float} MarkSize -The size of marks. See @code{SetMarkSize()}. -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{float} ArrowSize -The size of arrows. See @code{SetArrowSize()}. -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{float} BaseLineWidth -The variable define the base width for all lines. See @code{SetBaseLineWidth()}. -@end deftypecv - -@c ================================================================== -@node Zooming, Cutting, Default sizes, Graphics setup -@subsection Zooming -@cindex SetPlotFactor -@cindex Zoom - -These variables and functions control the overall zooming of the picture (see Zoom()) or the sub-picture (see PlotFactor). Normally you can use these variables and functions for removing ``white'' spaces around a plot. - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetPlotFactor (@code{float} val) -@deftypefnx {C function} @code{void} mgl_set_plotfactor (@code{HMGL} gr, @code{float} val) -Sets the factor of plot size. It is not recommended to set it lower then 1.5. This is some analogue of function Zoom() but applied not to overall image but for each InPlot. Use negative value or zero to enable automatic @code{PlotFactor} selection. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Zoom (@code{float} x1, @code{float} y1, @code{float} x2, @code{float} y2) -@deftypefnx {C function} @code{void} mgl_set_zoom (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} x2, @code{float} y2) -The function changes the scale of graphics that correspond to zoom in/out of the picture. After function call the current plot will be cleared and further the picture will contain plotting from its part [x1,x2]*[y1,y2]. Here picture coordinates @var{x1}, @var{x2}, @var{y1}, @var{y2} changes from 0 to 1. Attention! this settings can not be overwritten by any other functions. Use @code{Zoom(0,0,1,1)} to return default view. +@anchor{meshnum} +@anchor{MeshNum} +@deftypefn {MGL command} {} meshnum @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetMeshNum (@code{int} val) +@deftypefnx {C function} @code{void} mgl_set_meshnum (@code{HMGL} gr, @code{int} num) +@end ifclear +Sets approximate number of lines in @ref{mesh}, @ref{fall}, @ref{grid} and also the number of hachures in @ref{vect}, @ref{dew} and the number of cells in @ref{cloud}. By default (=0) it draws all lines/hachures/cells. @end deftypefn -@deftypecv {@emph{Obsolete option}} mglGraph @code{float} PlotFactor -The factor of plot size. See @code{SetPlotFactor()}. -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{bool} AutoPlotFactor -Switch on/off automatic change of PlotFactor variable during plot rotation. See @code{SetPlotFactor()}. -@end deftypecv - @c ================================================================== -@node Cutting, Font settings, Zooming, Graphics setup +@node Cutting, Font settings, Default sizes, Graphics setup @subsection Cutting +@ifclear UDAV @cindex SetCut @cindex SetCutBox @cindex CutOff +@end ifclear +@cindex Cut These variables and functions set the condition when the points are excluded (cutted) from the drawing. Note, that a point with NAN value(s) of coordinate or amplitude will be automatically excluded from the drawing. -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetCut (@code{bool} val) +@anchor{cut} +@deftypefn {MGL command} {} cut @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetCut (@code{bool} val) @deftypefnx {C function} @code{void} mgl_set_cut (@code{HMGL} gr, @code{int} val) +@end ifclear Flag which determines how points outside bounding box are drawn. If it is @code{true} then points are excluded from plot (it is default) otherwise the points are projected to edges of bounding box. @end deftypefn @@ -240,157 +264,126 @@ Flag which determines how points outside bounding box are drawn. If it is @code{ @caption{Left figure is drawn with parameter @code{Cut=false}. Right one is drawn with parameter @code{Cut=true}.} @end float -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetCutBox (@code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2) +@deftypefn {MGL command} {} cut @code{x1 y1 z1 x2 y2 z2} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetCutBox (@code{mglPoint} p1, @code{mglPoint} p1) @deftypefnx {C function} @code{void} mgl_set_cut_box (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2) +@end ifclear Lower and upper edge of the box in which never points are drawn. If both edges are the same (the variables are equal) then the cutting box is empty. @sref{CutMinMax sample} @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} CutOff (@code{const char *}EqC) -@deftypefnx {C function} @code{void} mgl_set_cutoff (@code{HMGL} gr, @code{const char *}EqC) -Sets the cutting off condition by formula @var{EqC}. This condition determine will point be plotted or not. If value of formula is nonzero then point is omitted, otherwise it plotted. Set argument as @code{""} to disable cutting off condition. @sref{CutOff sample} +@deftypefn {MGL command} {} cut 'cond' +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} CutOff (@code{const char *}cond) +@deftypefnx {C function} @code{void} mgl_set_cutoff (@code{HMGL} gr, @code{const char *}cond) +@end ifclear +Sets the cutting off condition by formula @var{cond}. This condition determine will point be plotted or not. If value of formula is nonzero then point is omitted, otherwise it plotted. Set argument as @code{""} to disable cutting off condition. @sref{CutOff sample} @end deftypefn -@deftypecv {@emph{Obsolete option}} mglGraph @code{bool} Cut -Flag which determines how points outside bounding box are drawn. See @code{SetCut()}. -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{mglPoint} {CutMin, CutMax} -Lower and upper edge of the box in which never points are drawn. See @code{SetCutBox()}. -@end deftypecv - @c ================================================================== @node Font settings, Palette and colors, Cutting, Graphics setup @subsection Font settings +@ifclear UDAV @cindex SetFontSize @cindex SetFontDef @cindex SetRotatedText @cindex SetFontSizePT @cindex SetFontSizeCM @cindex SetFontSizeIN -@cindex SetFont -@cindex GetFont @cindex LoadFont @cindex CopyFont @cindex RestoreFont +@end ifclear +@cindex Font +@cindex RotateText -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetFontSize (@code{float} val) -@deftypefnx {C function} @code{void} mgl_set_font_size (@code{HMGL} gr, @code{float} val) -Sets the size of font for tick and axis labels. Default font size of axis labels is 1.4 times large than for tick labels. +@anchor{font} +@deftypefn {MGL command} {} font 'fnt' [@code{val=6}] +Font style for text and labels (see text). Initial style is 'fnt'=':rC' give Roman font with centering. Parameter @code{val} sets the size of font for tick and axis labels. Default font size of axis labels is 1.4 times large than for tick labels. For more detail, @pxref{Font styles}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetFontDef (@code{const char *}fnt) +@anchor{rotatetext} +@deftypefn {MGL command} {} rotatetext @code{val} +@deftypefnx {Method on @code{mglGraph}} @code{void} SetRotatedText (@code{bool} val) +@deftypefnx {C function} @code{void} mgl_set_rotated_text (@code{HMGL} gr, @code{int} val) +Sets to use or not text rotation. +@end deftypefn + +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} SetFontDef (@code{const char *}fnt) @deftypefnx {C function} @code{void} mgl_set_font_def (@code{HMGL} gr, @code{const char *} val) Sets the font specification (@pxref{Text printing}). Default is @samp{rC} -- Roman font centering. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetRotatedText (@code{bool} val) -@deftypefnx {C function} @code{void} mgl_set_rotated_text (@code{HMGL} gr, @code{int} val) -Sets to use or not text rotation along axis. +@deftypefn {Method on @code{mglGraph}} @code{void} SetFontSize (@code{float} val) +@deftypefnx {C function} @code{void} mgl_set_font_size (@code{HMGL} gr, @code{float} val) +Sets the size of font for tick and axis labels. Default font size of axis labels is 1.4 times large than for tick labels. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{void} SetFontSizePT (@code{float} cm, @code{int} dpi=@code{72}) +Set FontSize by size in pt and picture DPI (default is 16 pt for dpi=72). +@end deftypefn +@deftypefn {Method on @code{mglGraph}} @code{inline void} SetFontSizeCM (@code{float} cm, @code{int} dpi=@code{72}) +Set FontSize by size in centimeters and picture DPI (default is 0.56 cm = 16 pt). +@end deftypefn +@deftypefn {Method on @code{mglGraph}} @code{inline void} SetFontSizeIN (@code{float} cm, @code{int} dpi=@code{72}) +Set FontSize by size in inch and picture DPI (default is 0.22 in = 16 pt). @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} LoadFont (@code{const char *}name, @code{const char *}path=@code{""}) +@deftypefn {Method on @code{mglGraph}} @code{void} LoadFont (@code{const char *}name, @code{const char *}path=@code{""}) @deftypefnx {C function} @code{void} mgl_load_font (@code{HMGL} gr, @code{const char *}name, @code{const char *}path) Load font typeface from @var{path}/@var{name}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} CopyFont (@code{mglGraph *} from) +@deftypefn {Method on @code{mglGraph}} @code{void} CopyFont (@code{mglGraph *} from) @deftypefnx {C function} @code{void} mgl_copy_font (@code{HMGL} gr, @code{HMGL} gr_from) Copy font data from another @code{mglGraph} object. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} RestoreFont () +@deftypefn {Method on @code{mglGraph}} @code{void} RestoreFont () @deftypefnx {C function} @code{void} mgl_restore_font (@code{HMGL} gr) Restore font data to default typeface. @end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} SetFontSizePT (@code{float} cm, @code{int} dpi=@code{72}) -Set FontSize by size in pt and picture DPI (default is 16 pt for dpi=72). -@end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{inline void} SetFontSizeCM (@code{float} cm, @code{int} dpi=@code{72}) -Set FontSize by size in centimeters and picture DPI (default is 0.56 cm = 16 pt). -@end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{inline void} SetFontSizeIN (@code{float} cm, @code{int} dpi=@code{72}) -Set FontSize by size in inch and picture DPI (default is 0.22 in = 16 pt). -@end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} SetFont (@code{mglFont *}f) -Sets font typeface. Note that each mglFont instance can be used with @emph{ONLY ONE} mglGraph instance at a moment of time! If @code{f==""} then default font is used. -@end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{inline mglFont *}GetFont () -Gets current typeface. Note that this variable can be deleted at next SetFont() call! -@end deftypefn - -@deftypecv {@emph{Obsolete option}} mglGraph @code{float} FontSize -The font size. See @code{SetFontSize()}. -@end deftypecv -@deftypecv {@emph{Obsolete option}} mglGraph @code{char} FontDef@code{[32]} -Font style. See @code{SetFontDef()}. -@end deftypecv -@deftypecv {@emph{Obsolete option}} mglGraph @code{bool} RotatedText -Set to use or not text rotation along axis. -@end deftypecv +@end ifclear @c ================================================================== @node Palette and colors, Error handling, Font settings, Graphics setup @subsection Pallete and colors -@cindex SetPalColor -@cindex SetPalNum +@ifclear UDAV @cindex SetPalette -@cindex SetScheme -@cindex SelectPen +@end ifclear +@cindex Palette -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetPalette (@code{const char *}@var{colors}) +@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}) +@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 (@pxref{1D plotting}) for curves which styles are not specified. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetPalColor (@code{int} n, @code{float} r, @code{float} g, @code{float} b) -@deftypefnx {C function} @code{void} mgl_set_pal_color (@code{HMGL} gr, @code{int} n, @code{float} r, @code{float} g, @code{float} b) -Sets color for individual palette entry. Look at @code{SetPalette()} function for simplified palette setting. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetPalNum (@code{int} num) -@deftypefnx {C function} @code{void} mgl_set_pal_num (@code{HMGL} gr, @code{int} num) -Sets the number of actual colors in palette. The value must be less then 100. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetScheme (@code{const char *}sch) -@deftypefnx {C function} @code{void} mgl_set_scheme (@code{HMGL} gr, @code{const char *}sch) -Set the color scheme for following plots. Usually this function is used internally. @xref{Color scheme}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} SelectPen (@code{const char *}sch) -Set the line and mark styles for following plots. Usually this function is used internally. @xref{Line styles}. -@end deftypefn - - -@deftypecv {@emph{Obsolete option}} mglGraph @code{mglColor} Pal@code{[101]} -Color palette for @ref{1D plotting}. See @code{SetPalette()}. -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{int} NumPal -Number of actual colors in palette. See @code{SetPalette()}. -@end deftypecv - @c ================================================================== -@node Error handling, Other settings, Palette and colors, Graphics setup +@node Error handling, , Palette and colors, Graphics setup @subsection Error handling - +@ifclear UDAV @cindex Message -@c @cindex WarnCode @cindex SetWarn -@cindex GetWarnCode +@cindex GetWarn -There are 2 variables which indicate the warnings/errors presence during plot creation. Normally user should set it to zero by @code{SetWarn(0);} before plotting and check if @var{WarnCode} is not zero after plotting. Only last warning will be saved. All warnings/errors produced by MathGL is not critical -- the plot just will not be drawn. +Normally user should set it to zero by @code{SetWarn(0);} before plotting and check if @var{GetWarn} return non zero after plotting. Only last warning will be saved. All warnings/errors produced by MathGL is not critical -- the plot just will not be drawn. -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} SetWarn (@code{int} code, @code{const char *}who=@code{""}) -Set warning code and corresponding message from function @var{who}. Normally you should call this function only for clearing the warning state, i.e. call @code{SetWarn(0);}. +@deftypefn {Method on @code{mglGraph}} @code{void} SetWarn (@code{int} code, @code{const char *}info=@code{""}) +@deftypefnx {C function} @code{void} mgl_set_warn (@code{HMGL} gr, @code{int} code, @code{const char *}info) +Set warning code. Normally you should call this function only for clearing the warning state, i.e. call @code{SetWarn(0);}. Text @var{info} will be printed as is if @var{code}<0. @end deftypefn -@deftypecv {General option (C++)} mglGraph @code{char *} Message -Pointer to buffer for writing messages about matters why some plot are not drawn. Set to NULL to disable messages. The buffer length must be at least 1024. If Message[0]==0 then there are no messages -@end deftypecv +@deftypefn {Method on @code{mglGraph}} @code{void} Message (@code{char *}buf) +@deftypefnx {C function} @code{void} mgl_buf_warn (@code{HMGL} gr, @code{const char *}buf) +Set buffer for writing messages about matters why some plot are not drawn. Set to NULL to disable messages. The buffer length must be at least 1024. If @var{buf}[0]==0 then there are no messages. +@end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{int} GetWarnCode () +@deftypefn {Method on @code{mglGraph}} @code{int} GetWarnCode () @deftypefnx {C function} @code{int} mgl_get_warn_code (@code{HMGL} gr) Return the numerical ID of warning about the not drawn plot. Possible values are: @table @code @@ -426,57 +419,8 @@ Setsize: size(s) is zero or negative Format is not supported for that build @end table @end deftypefn +@end ifclear -@deftypecv {Obsolete option} mglGraph @code{int} WarnCode -Numerical ID of warning about the not drawn plot. -@end deftypecv - -@c ================================================================== -@node Other settings, , Error handling, Graphics setup -@subsection Other settings -@cindex SetMeshNum -@cindex SetAxialDir -@cindex SetDrawFace -@cindex PlotId - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetMeshNum (@code{int} val) -@deftypefnx {C function} @code{void} mgl_set_meshnum (@code{HMGL} gr, @code{int} num) -Sets approximate number of lines in Mesh(), Fall(), Grid() and also the number of hachures in Vect(), VectC(), Dew() and the number of cells in Cloud*(). By default (=0) it draws all lines/hachures/cells. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetAxialDir (@code{char} val) -@deftypefnx {C function} @code{} mgl_set_axial_dir (@code{HMGL} gr, @code{char} dir) -Sets direction around which curve rotated in Axial() and Torus(). Default value is 'z'. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetDrawFace (@code{bool} val) -@deftypefnx {C function} @code{void} mgl_set_draw_face (@code{HMGL} gr, @code{int} val) -Enable/disable faces drawing. It is useful for speeding up drawing (for example, during rotation and so on). -@end deftypefn - -@deftypecv {General option (C++)} mglGraph @code{const char *} PlotId -Id of plot for saving filename (in GLUT window for example). -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{int} MeshNum -Sets approximate number of lines/hachures/cells. See @code{SetMeshNum()}. -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{char} AxialDir -Set rotation direction. See @code{SetAxialDir()}. -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{bool} DrawFace -Flag for preventing faces drawing. See @code{SetDrawFace()}. -@end deftypecv - -@deftypecv {General option (C++)} mglGraph @code{int} CirclePnts -Number of points used for a circle approximation (for example, in @ref{Primitives drawing}, @ref{Tube}, @ref{Pipe} and so on). Default value is 40. -@end deftypecv - -@deftypecv {General option (C++)} mglGraph @code{int} GridPnts -Number of points used for grid lines drawing (it is important for curved coordinates). Default value is 50. -@end deftypecv @c ================================================================== @node Axis settings, Transformation matrix, Graphics setup, MathGL core @@ -485,280 +429,425 @@ Number of points used for grid lines drawing (it is important for curved coordin These large set of variables and functions control how the axis and ticks will be drawn. Note that there is 3-step transformation of data coordinates are performed. Firstly, coordinates are projected if @code{Cut=true} (@pxref{Cutting}), after it transformation formulas are applied, and finally the data was normalized in bounding box. @menu -* Ranges (bounding box):: -* Curved coordinates:: -* Ticks:: +* Ranges (bounding box):: +* Curved coordinates:: +* Ticks:: @end menu @c ------------------------------------------------------------------ @node Ranges (bounding box), Curved coordinates, , Axis settings @subsection Ranges (bounding box) -@cindex Axis -@cindex CAxis +@cindex CRange @cindex XRange @cindex YRange @cindex ZRange -@cindex Min -@cindex Max -@cindex Cmin -@cindex Cmax -@cindex RecalcBorder -@cindex Org -@cindex AutoOrg +@cindex Ranges +@cindex Origin +@ifclear UDAV +@cindex SetRange @cindex SetRanges -@cindex SetAutoRanges - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetRanges (@code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2, @code{float} z1=@code{0}, @code{float} z2=@code{0}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} Axis (@code{mglPoint} min, @code{mglPoint} max, @code{mglPoint} org=@code{mglPoint(NAN,NAN,NAN)}) -@deftypefnx {C function} @code{void} mgl_set_axis_2d (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} x2, @code{float} y2) -@deftypefnx {C function} @code{void} mgl_set_axis_3d (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2) -Safely sets the value for @var{Min}, @var{Max} and @var{Org} members (options) of the class. If minimal and maximal values of the coordinate are the same then they are ignored. This function also sets @var{Cmin}=@code{Min.z} and @var{Cmax}=@code{Max.z}. This is default color range for 2d plots. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetCRange (@code{float} min, @code{float} max) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} CAxis (@code{float} min, @code{float} max) -@deftypefnx {C function} @code{void} mgl_set_caxis (@code{HMGL} gr, @code{float} min, @code{float} max) -Safely sets minimal and maximal values of data for coloring. This values are used later for determining the color of the surface. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} XRange (@code{const mglData &} dat, @code{bool} add=@code{false}, @code{float} fact=@code{0}) -@deftypefnx {C function} @code{void} mgl_set_xrange (@code{HMGL} gr, @code{const HMDT} a, @code{int} add) -Sets values of @code{Min.x} and @code{Max.x} as minimal and maximal values of data @var{a}. Parameter @var{add} specify to add or not the new range to current one. Parameter @var{fact} add additional range increase on value (@var{Max}-@var{Min})*@var{fact}. See also Axis(). -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} YRange (@code{const mglData &} dat, @code{bool} add=@code{false}, @code{float} fact=@code{0}) -@deftypefnx {C function} @code{void} mgl_set_yrange (@code{HMGL} gr, @code{const HMDT} a, @code{int} add) -Sets values of @code{Min.y} and @code{Max.y} as minimal and maximal values of data @var{a}. Parameter @var{add} specify to add or not the new range to current one. Parameter @var{fact} add additional range increase on value (@var{Max}-@var{Min})*@var{fact}. See also Axis(). -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ZRange (@code{const mglData &} dat, @code{bool} add=@code{false}, @code{float} fact=@code{0}) -@deftypefnx {C function} @code{void} mgl_set_zrange (@code{HMGL} gr, @code{const HMDT} a, @code{int} add) -Sets values of @code{Min.z} and @code{Max.z} as minimal and maximal values of data @var{a}. Parameter @var{add} specify to add or not the new range to current one. Parameter @var{fact} add additional range increase on value (@var{Max}-@var{Min})*@var{fact}. See also Axis(). -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} CRange (@code{const mglData &} dat, @code{bool} add=@code{false}, @code{float} fact=@code{0}) -@deftypefnx {C function} @code{void} mgl_set_crange (@code{HMGL} gr, @code{const HMDT} a, @code{int} add) -Sets values of @code{Cmin} and @code{Cmax} as minimal and maximal values of data @var{a}. Parameter @var{add} specify to add or not the new range to current one. Parameter @var{fact} add additional range increase on value (@var{Cmax}-@var{Cmin})*@var{fact}. See also CAxis(). -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetAutoRanges (@code{float} x1, @code{float} x2, @code{float} y1=@code{0}, @code{float} y2=@code{0}, @code{float} z1=@code{0}, @code{float} z2=@code{0}) -@deftypefnx {C function} @code{void} mgl_set_auto (@code{HMGL} gr, @code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2, @code{float} z1, @code{float} z2) -Sets ranges for automatic variables of plots. It act as changing of @var{Min}, @var{Max} proprties without calling of RecalcBorder(). Function don't change the direction if minimal and maximal values are the same. For example, if y@var{y1}=@var{y2} then ranges along y-direction will not be changed (will be used previous one). Note that the automatic range become axis range after next call of [XYZ]Range() function(s). -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetOrigin (@code{float} x0, @code{float} y0, @code{float} z0=@code{NAN}) +@cindex SetOrigin +@end ifclear + +@anchor{xrange} +@anchor{yrange} +@anchor{zrange} +@anchor{crange} +@deftypefn {MGL command} {} xrange @code{v1 v2} +@deftypefnx {MGL command} {} yrange @code{v1 v2} +@deftypefnx {MGL command} {} zrange @code{v1 v2} +@deftypefnx {MGL command} {} crange @code{v1 v2} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetRange (@code{char} dir, @code{float} v1, @code{float} v2) +@deftypefnx {C function} @code{void} mgl_set_range_val (@code{HMGL} gr, @code{char} dir, @code{float} v1, @code{float} v2) +@end ifclear +Sets the range for @samp{x}-,@samp{y}-,@samp{z}- coordinate or coloring (@samp{c}). See also @ref{ranges}. +@end deftypefn + + +@deftypefn {MGL command} {} xrange dat [@code{add=off}] +@deftypefnx {MGL command} {} yrange dat [@code{add=off}] +@deftypefnx {MGL command} {} zrange dat [@code{add=off}] +@deftypefnx {MGL command} {} crange dat [@code{add=off}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetRange (@code{char} dir, @code{const mglData &}dat, @code{bool} add=@code{false}) +@deftypefnx {C function} @code{void} mgl_set_range_dat (@code{HMGL} gr, @code{char} dir, @code{const HCDT} a, @code{int} add) +@end ifclear +Sets the range for @samp{x}-,@samp{y}-,@samp{z}- coordinate or coloring (@samp{c}) as minimal and maximal values of data @var{dat}. Parameter @code{add=on} shows that the new range will be joined to existed one (not replace it). +@end deftypefn + +@anchor{ranges} +@deftypefn {MGL command} {} ranges @code{x1 x2 y1 y2 [z1=0 z2=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetRanges (@code{mglPoint} p1, @code{mglPoint} p2) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetRanges (@code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2, @code{float} z1=@code{0}, @code{float} z2=@code{0}) +@deftypefnx {C function} @code{void} mgl_set_ranges (@code{HMGL} gr, @code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2, @code{float} z1, @code{float} z2) +@end ifclear +Sets the ranges of coordinates. If minimal and maximal values of the coordinate are the same then they are ignored. Also it sets the range for coloring (analogous to @code{crange z1 z2}). This is default color range for 2d plots. Initial ranges are [-1, 1]. +@end deftypefn + +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} SetRanges (@code{const mglData &}xx, @code{const mglData &}yy) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetRanges (@code{const mglData &}xx, @code{const mglData &}yy, @code{const mglData &}zz) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetRanges (@code{const mglData &}xx, @code{const mglData &}yy, @code{const mglData &}zz, @code{const mglData &}cc) +Sets the ranges of x-,y-,z-coordinates and coloring as minimal and maximal values of data @var{xx}, @var{yy}, @var{zz}, @var{cc} correspondingly. +@end deftypefn +@end ifclear + +@anchor{origin} +@deftypefn {MGL command} {} origin @code{x0 y0 [z0=nan]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetOrigin (@code{mglPoint} p0) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetOrigin (@code{float} x0, @code{float} y0, @code{float} z0=@code{NAN}) @deftypefnx {C function} @code{void} mgl_set_origin (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0) -Sets center of axis cross section. If one of values is NAN then MathGL library try to select optimal axis position. +@end ifclear +Sets center of axis cross section. If one of values is NAN then MathGL try to select optimal axis position. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} RecalcBorder () -Recalculates internal parameter for correct apply of transformation rules. @strong{Must be called} after any direct change of members @var{Min}, @var{Max}, @var{fx}, @var{fy}, @var{fz} if its changes should be seen on the plot. -@end deftypefn - -@deftypecv {General option (C++)} mglGraph @code{mglPoint} {Min, Max} -Lower and upper edges of bounding box for graphics. These variables are used for determining the range of automatic (non-specified) arrays in most of plotting functions. So, you may change it before plot and return it back after it and the plot will have automatic x-(y-,z-)coordinate normalized in this range but not in bounding box. @strong{BUT} if you want to change the bounding box then you @strong{must} call @code{RecalcBorder();} after it or use Axis() function. -@end deftypecv - -@deftypecv {General option (C++)} mglGraph @code{float} {Cmin, Cmax} -Minimal and maximal value for data (used for coloring). -@end deftypecv - -@deftypecv {General option (C++)} mglGraph @code{mglPoint} Org -Center of axis cross section. If one of values is NAN then MathGL library try to select optimal axis position. -@end deftypecv - -@deftypecv {General option (C++)} mglGraph @code{bool} AutoOrg -Flag for automatic shifting of axes origin @var{Org} if it lies out of range @var{Min} ... @var{Max}. -@end deftypecv @c ------------------------------------------------------------------ @node Curved coordinates, Ticks, Ranges (bounding box), Axis settings @subsection Curved coordinates +@cindex Axis +@ifclear UDAV @cindex SetFunc @cindex SetCoor @cindex Ternary +@end ifclear -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetFunc (@code{const char *}EqX, @code{const char *}EqY, @code{const char *}EqZ=@code{""}, @code{const char *}EqA=@code{""}) -@deftypefnx {C function} @code{void} mgl_set_func (@code{HMGL} gr, @code{const char *}EqX, @code{const char *}EqY, @code{const char *}EqZ) -@deftypefnx {C function} @code{void} mgl_set_func_ext (@code{HMGL} gr, @code{const char *}EqX, @code{const char *}EqY, @code{const char *}EqZ, @code{const char *}EqA) +@deftypefn {MGL command} {} axis 'fx' 'fy' ['fz'='' 'fa'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetFunc (@code{const char *}EqX, @code{const char *}EqY, @code{const char *}EqZ=@code{""}, @code{const char *}EqA=@code{""}) +@deftypefnx {C function} @code{void} mgl_set_func (@code{HMGL} gr, @code{const char *}EqX, @code{const char *}EqY, @code{const char *}EqZ, @code{const char *}EqA) +@end ifclear Sets transformation formulas for curvilinear coordinate. Each string should contain mathematical expression for real coordinate depending on internal coordinates @samp{x}, @samp{y}, @samp{z} and @samp{a} or @samp{c} for colorbar. For example, the cylindrical coordinates are introduced as @code{Axis("x*cos(y)", "x*sin(y)", "z");}. For removing of formulas the corresponding parameter should be empty or @code{NULL}. Using transformation formulas will slightly slowing the program. Parameter @var{EqA} set the similar transformation formula for color scheme. @xref{Textual formulas}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetCoor (@code{int} how) +@deftypefn {MGL command} {} axis @code{how} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetCoor (@code{int} how) @deftypefnx {C function} @code{void} mgl_set_coor (@code{HMGL} gr, @code{int} how) +@end ifclear Sets one of the predefined transformation formulas for curvilinear coordinate. Paramater @var{how} define the coordinates: @code{mglCartesian=0} -- Cartesian coordinates (no transformation); @code{mglPolar=1} -- Polar coordiantes @math{x_n=x*cos(y),y_n=x*sin(y), z_n=z}; @code{mglSpherical=2} -- Sperical coordinates @math{x_n=x*sin(y)*cos(z), y_n=x*sin(y)*sin(z), z_n=x*cos(y)}; @code{mglParabolic=3} -- Parabolic coordinates @math{x_n=x*y, y_n=(x*x-y*y)/2, z_n=z}; @code{mglParaboloidal=4} -- Paraboloidal coordinates @math{x_n=(x*x-y*y)*cos(z)/2, y_n=(x*x-y*y)*sin(z)/2, z_n=x*y}; @code{mglOblate=5} -- Oblate coordinates @math{x_n=cosh(x)*cos(y)*cos(z), y_n=cosh(x)*cos(y)*sin(z), z_n=sinh(x)*sin(y)}; @code{mglProlate=6} -- Prolate coordinates @math{x_n=sinh(x)*sin(y)*cos(z), y_n=sinh(x)*sin(y)*sin(z), z_n=cosh(x)*cos(y)}; @code{mglElliptic=7} -- Elliptic coordinates @math{x_n=cosh(x)*cos(y), y_n=sinh(x)*sin(y), z_n=z}; @code{mglToroidal=8} -- Toroidal coordinates @math{x_n=sinh(x)*cos(z)/(cosh(x)-cos(y)), y_n=sinh(x)*sin(z)/(cosh(x)-cos(y)), z_n=sin(y)/(cosh(x)-cos(y))}; @code{mglBispherical=9} -- Bispherical coordinates @math{x_n=sin(y)*cos(z)/(cosh(x)-cos(y)), y_n=sin(y)*sin(z)/(cosh(x)-cos(y)), z_n=sinh(x)/(cosh(x)-cos(y))}; @code{mglBipolar=10} -- Bipolar coordinates @math{x_n=sinh(x)/(cosh(x)-cos(y)), y_n=sin(y)/(cosh(x)-cos(y)), z_n=z}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Ternary (@code{bool} tern) +@anchor{ternary} +@deftypefn {MGL command} {} ternary @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Ternary (@code{bool} tern) @deftypefnx {C function} @code{void} mgl_set_ternary (@code{HMGL} gr, @code{int} tern) +@end ifclear The function sets to draws Ternary plot. This special plot is for 3 dependent coordinates (components) @var{a}, @var{b}, @var{c} so that @var{a}+@var{b}+@var{c}=1. MathGL uses only 2 independent coordinates @var{a}=x and @var{b}=y since it is enough to plot everything. At this third coordinate z act as another parameter to produce contour lines, surfaces and so on. @sref{Ternary plot sample} @end deftypefn @c ------------------------------------------------------------------ @node Ticks, , Curved coordinates, Axis settings @subsection Ticks - +@cindex AxisStl +@cindex TickLen +@cindex Adjust +@cindex XTick +@cindex YTick +@cindex ZTick +@cindex CTick +@ifclear UDAV +@cindex SetAxisStl +@cindex SetTickLen @cindex SetTicks @cindex SetTicksVal @cindex SetTuneTicks -@cindex AdjustTicks -@cindex SetXTT -@cindex SetYTT -@cindex SetZTT -@cindex SetCTT - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} AdjustTicks (@code{const char *}dir=@code{"xyz"}) -@deftypefnx {C function} @code{void} mgl_adjust_ticks (@code{HMGL} gr, @code{const char *}dir) -Set the ticks step, number of sub-ticks and initial ticks position to be the most human readable for the axis along direction(s) @var{dir}. Also set @code{SetTuneTicks(true)}. +@cindex SetTickTime +@cindex SetTickTempl +@cindex SetTickRotate +@cindex SetTickSkip +@end ifclear + +@anchor{ticklen} +@deftypefn {MGL command} {} ticklen @code{val} [@code{stt=1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTickLen (@code{float} val, @code{float} stt=@code{1}) +@deftypefnx {C function} @code{void} mgl_set_tick_len (@code{HMGL} gr, @code{float} val, @code{float} stt) +@end ifclear +The relative length of axis ticks. Default value is @code{0.1}. Parameter @var{stt}>0 set relative length of subticks which is in @code{sqrt(1+stt)} times smaller. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetTicks (@code{char} dir, @code{float} d=@code{-5}, @code{int} ns=@code{0}, @code{float} org=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_set_ticks_dir (@code{HMGL} gr, @code{char} dir, @code{float} d, @code{int} ns, @code{float} org) -@deftypefnx {C function} @code{void} mgl_set_ticks (@code{HMGL} gr, @code{float} dx, @code{float} dy, @code{float} dz) -@deftypefnx {C function} @code{void} mgl_set_subticks (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} nz) -@deftypefnx {C function} @code{void} mgl_set_tick_origin (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0) -Set the ticks step @var{d}, number of sub-ticks @var{ns} and initial ticks position @var{org} for the axis along direction @var{dir} (use 'c' for colorbar ticks). Variable @var{d} set step for axis ticks (if positive) or it's number on the axis range (if negative). Zero value set logarithmic ticks. If @var{org} value is NAN then value from @var{Org} is used. +@deftypefn {MGL command} {} axisstl 'stl' ['tck'='' 'sub'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetAxisStl (@code{const char *}stl=@code{"k"}, @code{const char *}tck=@code{0}, @code{const char *}sub=@code{0}) +@deftypefnx {C function} @code{void} mgl_set_axis_stl (@code{HMGL} gr, @code{const char *}stl, @code{const char *}tck, @code{const char *}sub) +@end ifclear +The line style of axis, (@var{stl}) ticks (@var{tck}) and subticks (@var{sub}). If @var{stl} is empty then default style is used (@samp{k} or @samp{w} depending on transparency type). If @var{sub} or @var{sub} is empty then axis style is used (i.e. @var{stl}). @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetTicksVal (@code{char} dir, @code{int} n, @code{float *}val, @code{const char **}lbl) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} SetTicksVal (@code{char} dir, @code{int} n, @code{float *}val, @code{const wchar_t **}lbl) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} SetTicksVal (@code{char} dir, @code{int} n, @code{float} val1, @code{wchar_t *}lbl1, ...) -@deftypefnx {C function} @code{void} mgl_set_ticks_vals (@code{HMGL} gr, @code{char} dir, @code{int} n, @code{float *}val, @code{const char **}lbl) -@deftypefnx {C function} @code{void} mgl_set_ticks_val (@code{HMGL} gr, @code{char} dir, @code{int} n, @code{double} val, @code{const char *}lbl, ...) -Set the manual positions @var{val} and its labels @var{lbl} for @var{n}-th ticks along axis @var{dir}. The arrays @var{val} and @var{lbl} must contain @var{n} elements. Use @code{SetTicks()} to restore automatic ticks. Note, you @strong{have to be} very careful to use floating-point (not integer!!!) values as ticks position due to limitations of stdarg library (argument transfer). @sref{Manual ticks sample} +@anchor{adjust} +@deftypefn {MGL command} {} adjust ['dir'='xyzc'] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Adjust (@code{const char *}dir=@code{"xyz"}) +@deftypefnx {C function} @code{void} mgl_adjust_ticks (@code{HMGL} gr, @code{const char *}dir) +@end ifclear +Set the ticks step, number of sub-ticks and initial ticks position to be the most human readable for the axis along direction(s) @var{dir}. Also set @code{SetTuneTicks(true)}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetTuneTicks (@code{bool} tune, @code{float} pos=@code{1.15}) +@anchor{xtick} +@anchor{ytick} +@anchor{ztick} +@anchor{ctick} +@deftypefn {MGL command} {} xtick @code{val [sub=0 org=nan]} +@deftypefnx {MGL command} {} ytick @code{val [sub=0 org=nan]} +@deftypefnx {MGL command} {} ztick @code{val [sub=0 org=nan]} +@deftypefnx {MGL command} {} ctick @code{val [sub=0 org=nan]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTicks (@code{char} dir, @code{float} d=@code{0}, @code{int} ns=@code{0}, @code{float} org=@code{NAN}) +@deftypefnx {C function} @code{void} mgl_set_ticks_dir (@code{HMGL} gr, @code{char} dir, @code{float} d, @code{int} ns, @code{float} org) +@deftypefnx {C function} @code{void} mgl_set_ticks (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} nz) +@end ifclear +Set the ticks step @var{d}, number of sub-ticks @var{ns} and initial ticks position @var{org} for the axis along direction @var{dir} (use 'c' for colorbar ticks). Variable @var{d} set step for axis ticks (if positive) or it's number on the axis range (if negative). Zero value set automatic ticks. If @var{org} value is NAN then axis origin is used. +@end deftypefn + +@deftypefn {MGL command} {} xtick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...] +@deftypefnx {MGL command} {} ytick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...] +@deftypefnx {MGL command} {} ztick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTicksVal (@code{char} dir, @code{const char *}lbl, @code{bool} add=@code{false}) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTicksVal (@code{char} dir, @code{const wchar_t *}lbl, @code{bool} add=@code{false}) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTicksVal (@code{char} dir, @code{const mglData &}val, @code{const char *}lbl, @code{bool} add=@code{false}) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTicksVal (@code{char} dir, @code{const mglData &}val, @code{const wchar_t *}lbl, @code{bool} add=@code{false}) +@deftypefnx {C function} @code{void} mgl_set_ticks_str (@code{HMGL} gr, @code{char} dir, @code{const char *}lbl, @code{bool} add) +@deftypefnx {C function} @code{void} mgl_set_ticks_wcs (@code{HMGL} gr, @code{char} dir, @code{const wchar_t *}lbl, @code{bool} add) +@deftypefnx {C function} @code{void} mgl_set_ticks_val (@code{HMGL} gr, @code{char} dir, @code{HCDT} val, @code{const char *}lbl, @code{bool} add) +@deftypefnx {C function} @code{void} mgl_set_ticks_valw (@code{HMGL} gr, @code{char} dir, @code{HCDT} val, @code{const wchar_t *}lbl, @code{bool} add) +@end ifclear +Set the manual positions @var{val} and its labels @var{lbl} for ticks along axis @var{dir}. If array @var{val} is absent then values equidistantly distributed in interval [@var{Min}.x, @var{Max}.x] are used. Labels are separated by @samp{\n} symbol. Use @code{SetTicks()} to restore automatic ticks. @sref{Manual ticks sample} +@end deftypefn + +@deftypefn {MGL command} {} xtick 'templ' +@deftypefnx {MGL command} {} ytick 'templ' +@deftypefnx {MGL command} {} ztick 'templ' +@deftypefnx {MGL command} {} ctick 'templ' +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTickTempl (@code{char} dir, @code{const char *}templ) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTickTempl (@code{char} dir, @code{const wchar_t *}templ) +@deftypefnx {C function} @code{void} mgl_set_tick_templ (@code{HMGL} gr, @code{const char *}templ) +@deftypefnx {C function} @code{void} mgl_set_tick_templw (@code{HMGL} gr, @code{const wchar_t *}templ) +@end ifclear +Set template @var{templ} for x-,y-,z-axis ticks or colorbar ticks. It may contain TeX symbols also. If @var{templ}=@code{""} then default template is used (in simplest case it is @samp{%.2g}). Setting on template switch off automatic ticks tuning. +@end deftypefn + +@deftypefn {MGL command} {} xtick val 'templ' +@deftypefnx {MGL command} {} ytick val 'templ' +@deftypefnx {MGL command} {} ztick val 'templ' +@deftypefnx {MGL command} {} ctick val 'templ' +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTickTime (@code{char} dir, @code{float} val, @code{const char *}templ) +@deftypefnx {C function} @code{void} mgl_set_tick_time (@code{HMGL} gr, @code{float} val, @code{const char *}templ) +@end ifclear +Set time labels with step @var{val} and template @var{templ} for x-,y-,z-axis ticks or colorbar ticks. It may contain TeX symbols also. +@end deftypefn + +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} SetTuneTicks (@code{bool} tune, @code{float} pos=@code{1.15}) @deftypefnx {C function} @code{void} mgl_tune_ticks (@code{HMGL} gr, @code{bool} tune, @code{float} pos) Switch on/off ticks enhancing by factoring common multiplier (for small, like from 0.001 to 0.002, or large, like from 1000 to 2000, coordinate values) or common component (for narrow range, like from 0.999 to 1.000). Also set the position @var{pos} of common multiplier/component on the axis: =0 at minimal axis value, =1 at maximal axis value. Default value is 1.15. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetXTT (@code{const char *}xtt) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} SetYTT (@code{const char *}ytt) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} SetZTT (@code{const char *}ztt) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} SetCTT (@code{const char *}ctt) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} SetXTT (@code{const wchar_t *}xtt) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} SetYTT (@code{const wchar_t *}ytt) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} SetZTT (@code{const wchar_t *}ztt) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} SetCTT (@code{const wchar_t *}ctt) -@deftypefnx {C function} @code{void} mgl_set_xttw (@code{HMGL} gr, @code{const wchar_t *}xtt) -@deftypefnx {C function} @code{void} mgl_set_yttw (@code{HMGL} gr, @code{const wchar_t *}ytt) -@deftypefnx {C function} @code{void} mgl_set_zttw (@code{HMGL} gr, @code{const wchar_t *}ztt) -@deftypefnx {C function} @code{void} mgl_set_cttw (@code{HMGL} gr, @code{const wchar_t *}ctt) -@deftypefnx {C function} @code{void} mgl_set_xtt (@code{HMGL} gr, @code{const wchar_t *}xtt) -@deftypefnx {C function} @code{void} mgl_set_ytt (@code{HMGL} gr, @code{const wchar_t *}ytt) -@deftypefnx {C function} @code{void} mgl_set_ztt (@code{HMGL} gr, @code{const wchar_t *}ztt) -@deftypefnx {C function} @code{void} mgl_set_ctt (@code{HMGL} gr, @code{const wchar_t *}ctt) -The template for x-,y-,z-axis ticks or colorbar ticks. It may contain TeX symbols also. If @var{xtt}, @var{ytt}, @var{ztt}, @var{ctt}=@code{""} then default template is used (in simplest case it is @samp{%.2g}). Setting of template switch off automatic ticks tuning (see @code{SetTuneTicks()}). +@deftypefn {Method on @code{mglGraph}} @code{void} SetTickRotate (@code{bool} val) +@deftypefnx {C function} @code{void} mgl_set_tick_rotate (@code{HMGL} gr, @code{bool} val) +Enable/disable ticks rotation if there are too many ticks or ticks labels are too long. @end deftypefn -@deftypecv {@emph{Obsolete option}} mglGraph @code{float} {dx, dy, dz} -Step for axis ticks. See @code{SetTicks()}. -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{int} {NSx, NSy, NSz} -Number of axis sub-ticks. See @code{SetTicks()}. -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{mglPoint} OrgT -Starting point for ticks. See @code{SetTicks()}. -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{bool} TuneTicks -Switch on/off ticks enhancing by factoring common multiplier. See @code{SetTuneTicks()}. -@end deftypecv - -@deftypecv {@emph{Obsolete option}} mglGraph @code{float} FactorPos -The position of common multiplier/component on the axis. See @code{SetTuneTicks()}. -@end deftypecv - +@deftypefn {Method on @code{mglGraph}} @code{void} SetTickSkip (@code{bool} val) +@deftypefnx {C function} @code{void} mgl_set_tick_skip (@code{HMGL} gr, @code{bool} val) +Enable/disable ticks skipping if there are too many ticks or ticks labels are too long. +@end deftypefn +@end ifclear @c ################################################################## -@node Transformation matrix, Export to file, Axis settings, MathGL core +@node Transformation matrix, Export picture, Axis settings, MathGL core @section Transformation matrix @cindex Aspect @cindex Rotate @cindex RotateN @cindex SubPlot +@cindex MultiPlot @cindex StickPlot +@cindex ColumnPlot @cindex InPlot -@cindex Identity +@cindex Title @cindex Perspective -@cindex RestoreM @cindex View -@cindex ColumnPlot @cindex Push @cindex Pop -These functions control how and where further plotting will be placed. There is a curtain order of calling of these functions for the better plot view. First one should be SubPlot() or InPlot() for specifying the place. After it a Rotate() and Aspect(). And finally any other plotting functions may be called. Alternatevely you can use ColumnPlot() for position plots in the column one by another without gap between plot axis (bounding boxes). +These functions control how and where further plotting will be placed. There is a curtain order of calling of these functions for the better plot view. First one should be @ref{subplot} or @ref{inplot} for specifying the place. After it a @ref{rotate} and @ref{aspect}. And finally any other plotting functions may be called. Alternatively you can use @ref{columnplot} or @ref{stickplot} for position plots in the column (or stick) one by another without gap between plot axis (bounding boxes). -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SubPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{float} dx=@code{0}, @code{float} dy=@code{0}) +@anchor{subplot} +@deftypefn {MGL command} {} subplot @code{nx ny m [dx=0 dy=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SubPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{float} dx=@code{0}, @code{float} dy=@code{0}) @deftypefnx {C function} @code{void} mgl_subplot (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m) @deftypefnx {C function} @code{void} mgl_subplot_d (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{float} dx, @code{float} dy) +@end ifclear Puts further plotting in a @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. This function set off any aspects or rotations. So it should be used first for creating the subplot. From the aesthetical point of view it is not recommended to use this function with different matrices in the same frame. The position of the cell can be shifted from its default position by relative size @var{dx}, @var{dy}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SubPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{const char *}style) +@deftypefn {MGL command} {} subplot @code{nx ny m} 'style' +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SubPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{const char *}style) @deftypefnx {C function} @code{void} mgl_subplot_s (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{const char *}style) +@end ifclear The same as previous but space reserved for axis/colorbar is saved only if @var{style} contain: @samp{L} or @samp{<} -- at left side, @samp{R} or @samp{>} -- at right side, @samp{A} or @samp{^} -- at top side, @samp{U} or @samp{_} -- at bottom side. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} InPlot (@code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2, @code{bool} rel=@code{false}) +@deftypefn {MGL command} {} multiplot @code{nx ny m dx dy} ['style'='<>_^'] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} MultiPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{int} dx, @code{int} dy, @code{const char *}style=@code{"<>_^"}) +@deftypefnx {C function} @code{void} mgl_multiplot (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{int} dx, @code{int} dy, @code{const char *}style) +@end ifclear +Puts further plotting in a rectangle of @var{dx}*@var{dy} cells starting from @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. This function set off any aspects or rotations. Extra space will be reserved for axis/colorbar if @var{style} contain: @samp{L} or @samp{<} -- at left side, @samp{R} or @samp{>} -- at right side, @samp{A} or @samp{^} -- at top side, @samp{U} or @samp{_} -- at bottom side. +@end deftypefn + +@anchor{inplot} +@deftypefn {MGL command} {} inplot @code{x1 x2 y1 y2 [rel=off]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} InPlot (@code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2, @code{bool} rel=@code{false}) @deftypefnx {C function} @code{void} mgl_inplot (@code{HMGL} gr, @code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2) @deftypefnx {C function} @code{void} mgl_relplot (@code{HMGL} gr, @code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2) -Puts further plotting in some region of the whole frame surface. This function allows one to create a plot in arbitrary place of the screen. The position is defined by rectangular coordinates [@var{x1}, @var{x2}]*[@var{y1}, @var{y2}]. The coordinates @var{x1}, @var{x2}, @var{y1}, @var{y2} are normalized to interval [0, 1]. If parameter @var{rel}=@code{true} then the relative position to current SubPlot() (or last InPlot() with @var{rel}=@code{false}) is used. This function set off any aspects or rotations. So it should be used first for creating subplot. +@end ifclear +Puts further plotting in some region of the whole frame surface. This function allows one to create a plot in arbitrary place of the screen. The position is defined by rectangular coordinates [@var{x1}, @var{x2}]*[@var{y1}, @var{y2}]. The coordinates @var{x1}, @var{x2}, @var{y1}, @var{y2} are normalized to interval [0, 1]. If parameter @var{rel}=@code{true} then the relative position to current @ref{subplot} (or @ref{inplot} with @var{rel}=@code{false}) is used. This function set off any aspects or rotations. So it should be used first for creating subplot. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ColumnPlot (@code{int} num, @code{int} ind, @code{float} d=@code{0}) +@anchor{columnplot} +@deftypefn {MGL command} {} columnplot @code{num ind [d=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} ColumnPlot (@code{int} num, @code{int} ind, @code{float} d=@code{0}) @deftypefnx {C function} @code{void} mgl_columnplot (@code{HMGL} gr, @code{int} num, @code{int} ind) @deftypefnx {C function} @code{void} mgl_columnplot_d (@code{HMGL} gr, @code{int} num, @code{int} ind, @code{float} d) -Puts further plotting in @var{ind}-th cell of column with @var{num} cells. The position is relative to previous SubPlot() call (or InPlot() with @var{rel}=@code{false}). Parameter @var{d} set extra gap between cells. @sref{ColumnPlot sample} +@end ifclear +Puts further plotting in @var{ind}-th cell of column with @var{num} cells. The position is relative to previous @ref{subplot} (or @ref{inplot} with @var{rel}=@code{false}). Parameter @var{d} set extra gap between cells. @sref{ColumnPlot sample} @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} StickPlot (@code{int} num, @code{int} ind, @code{float} tet, @code{float} phi) +@anchor{stickplot} +@deftypefn {MGL command} {} stickplot @code{num ind tet phi} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} StickPlot (@code{int} num, @code{int} ind, @code{float} tet, @code{float} phi) @deftypefnx {C function} @code{void} mgl_stickplot (@code{HMGL} gr, @code{int} num, @code{int} ind, @code{float} tet, @code{float} phi) -Puts further plotting in @var{ind}-th cell of stick with @var{num} cells. At this, stick is rotated on angles @var{tet}, @var{phi}. The position is relative to previous SubPlot() call (or InPlot() with @var{rel}=@code{false}). @sref{StickPlot sample} +@end ifclear +Puts further plotting in @var{ind}-th cell of stick with @var{num} cells. At this, stick is rotated on angles @var{tet}, @var{phi}. The position is relative to previous @ref{subplot} (or @ref{inplot} with @var{rel}=@code{false}). @sref{StickPlot sample} @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Rotate (@code{float} TetX, @code{float} TetZ, @code{float} TetY=@code{0}) +@anchor{title} +@deftypefn {MGL command} {} title 'title' ['stl'='#' @code{size=-2}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Title (@code{const char *}txt, @code{const char *}stl=@code{"#"}, @code{float} size=@code{-2}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Title (@code{const wchar_t *}txt, @code{const char *}stl=@code{"#"}, @code{float} size=@code{-2}) +@deftypefnx {C function} @code{void} mgl_title (@code{HMGL} gr, @code{const char *}txt, @code{const char *}stl, @code{float} size) +@deftypefnx {C function} @code{void} mgl_titlew (@code{HMGL} gr, @code{const wchar_t *}txt, @code{const char *}stl, @code{float} size) +@end ifclear +Add text @var{title} for current subplot/inplot by font @var{stl} with specified @var{size}. If @var{stl} contains @samp{#} then bounding box around title will be drawn. This function set off any aspects or rotations. So it should be used just after creating subplot. +@end deftypefn + +@anchor{rotate} +@deftypefn {MGL command} {} rotate @code{tetz tetx [tety=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Rotate (@code{float} TetX, @code{float} TetZ, @code{float} TetY=@code{0}) @deftypefnx {C function} @code{void} mgl_rotate (@code{HMGL} gr, @code{float} TetX, @code{float} TetZ, @code{float} TetY) +@end ifclear Rotates a further plotting relative to each axis @{x, z, y@} consecutively on angles @var{TetX}, @var{TetZ}, @var{TetY}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} RotateN (@code{float} Tet, @code{float} x, @code{float} y, @code{float} z) +@deftypefn {MGL command} {} rotate @code{tet x y z} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} RotateN (@code{float} Tet, @code{float} x, @code{float} y, @code{float} z) @deftypefnx {C function} @code{void} mgl_rotate_vector (@code{HMGL} gr, @code{float Tet}, @code{float x}, @code{float y}, @code{float z}) +@end ifclear Rotates a further plotting around vector @{@var{x}, @var{y}, @var{z}@} on angle @var{Tet}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Aspect (@code{float} Ax, @code{float} Ay, @code{float} Az) +@anchor{aspect} +@deftypefn {MGL command} {} aspect @code{ax ay [az=1]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Aspect (@code{float} Ax, @code{float} Ay, @code{float} Az) @deftypefnx {C function} @code{void} mgl_aspect (@code{HMGL} gr, @code{float} Ax, @code{float} Ay, @code{float} Az) -Defines aspect ratio for the plot. The viewable axes will be related one to another as the ratio @var{Ax:Ay:Az}. For the best effect it should be used after Rotate() function. +@end ifclear +Defines aspect ratio for the plot. The viewable axes will be related one to another as the ratio @var{Ax:Ay:Az}. For the best effect it should be used after @ref{rotate} function. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Perspective (@code{float} a) +@anchor{perspective} +@deftypefn {MGL command} {} perspective @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Perspective (@code{float} a) @deftypefnx {C function} @code{void} mgl_perspective (@code{HMGL} gr, @code{float} a) +@end ifclear Add (switch on) the perspective to plot. The parameter @math{a ~ 1/z_@{eff@} \in [0,1)}. By default (@code{a=0}) the perspective is off. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Identity (@code{bool} rel=@code{false}) -@deftypefnx {C function} @code{void} mgl_identity (@code{HMGL} gr, @code{int} rel) -Clears transformation matrix. This function clears all previous effects of Aspect(), SubPlot(), InPlot() or Rotate() functions. It is equivalent to the call of @code{InPlot(0,1,0,1,rel)}. +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} View (@code{float} TetX, @code{float} TetZ, @code{float} TetY=@code{0}) +@deftypefnx {C function} @code{void} mgl_view (@code{HMGL} gr, @code{float} TetX, @code{float} TetZ, @code{float} TetY) +Rotates a further plotting relative to each axis @{x, z, y@} consecutively on angles @var{TetX}, @var{TetZ}, @var{TetY}. Rotation is done independently on @ref{rotate}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Push () +@deftypefn {Method on @code{mglGraph}} @code{void} Push () @deftypefnx {C function} @code{void} mgl_mat_push (@code{HMGL} gr) Push transformation matrix into stack. Later you can restore its current state by Pop() function. Stack can keep up to 10 matrices. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Pop () +@deftypefn {Method on @code{mglGraph}} @code{void} Pop () @deftypefnx {C function} @code{void} mgl_mat_pop (@code{HMGL} gr) Pop (restore last 'pushed') transformation matrix into stack. @end deftypefn +@end ifclear @c ################################################################## -@node Export to file, Primitives drawing, Transformation matrix, MathGL core -@section Export to file +@node Export picture, Primitives drawing, Transformation matrix, MathGL core +@section Export picture +@cindex SetSize + +Functions in this group save or give access to produced picture. So, usually they should be called after plotting is done. + +@anchor{setsize} +@deftypefn {MGL command} {} setsize @code{w h} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetSize (@code{int} width, @code{int} height) +@deftypefnx {C function} @code{void} mgl_set_size (@code{HMGL} gr, @code{int} width, @code{int} height) +@end ifclear +Sets size of picture in pixels. This function @strong{must be} called before any other plotting because it completely remove picture contents. +@end deftypefn + +@anchor{quality} +@deftypefn {MGL command} {} quality @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetQuality (@code{int} val=@code{MGL_DRAW_NORM}) +@deftypefnx {C function} @code{void} mgl_set_quality (@code{HMGL} gr, @code{int} val) +@end ifclear +Sets quality of the plot depending on value @var{val}: @code{MGL_DRAW_WIRE=0} -- no face drawing (fastest), @code{MGL_DRAW_FAST=1} -- no color interpolation (fast), @code{MGL_DRAW_NORM=2} -- high quality (normal). If @code{MGL_DRAW_LMEM=0x4} is set then direct bitmap drawing is used (low memory usage). +@end deftypefn + +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} StartGroup (const char *name) +@deftypefnx {C function} @code{void} mgl_start_group (@code{HMGL} gr, @code{const char *}name) +Starts group definition. Groups contain objects and other groups, they are used to select a part of a model to zoom to or to make invizible or to make semitransparent and so on. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{void} EndGroup () +@deftypefnx {C function} @code{void} mgl_end_group (@code{HMGL} gr) +Ends group definition. +@end deftypefn +@end ifclear + +@menu +* Export to file:: +* Frames/Animation:: +* Bitmap in memory:: +* Parallelization:: +@end menu + +@c ================================================================== +@node Export to file, Frames/Animation, , Export picture +@subsection Export to file +@cindex Write +@ifclear UDAV @cindex WriteFrame @cindex WritePNG @cindex WriteGIF @@ -766,85 +855,253 @@ Pop (restore last 'pushed') transformation matrix into stack. @cindex WriteSVG @cindex WriteBMP @cindex WriteEPS +@cindex WriteBPS +@cindex WriteTGA +@cindex WriteTEX +@cindex WriteOBJ +@cindex WriteWGL @cindex WriteJPEG -@cindex SetSize -@cindex Flush -@cindex Finish @cindex ShowImage +@end ifclear These functions export current view to a graphic file. The filename @var{fname} should have appropriate extension. Parameter @var{descr} gives the short description of the picture. Just now the transparency is supported in PNG and SVG files. -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} WriteFrame (@code{const char *}fname=@code{""}, @code{const char *}descr=@code{""}) +@anchor{write} +@deftypefn {MGL command} {} write 'fname' +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} WriteFrame (@code{const char *}fname=@code{""}, @code{const char *}descr=@code{""}) @deftypefnx {C function} @code{void} mgl_write_frame (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) +@end ifclear Exports current frame to a file @var{fname} which type is determined by the extension. Parameter @var{descr} adds description to file (can be @code{""}). If @var{fname}=@code{""} then the file @samp{frame####.jpg} is used, where @samp{####} is current frame id and name @samp{frame} is defined by @var{PlotId} class property. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} WritePNG (@code{const char *}fname, @code{const char *}descr=@code{""}, @code{int} compr=@code{""}, @code{bool} alpha=@code{true}) +@ifclear UDAV + +@deftypefn {Method on @code{mglGraph}} @code{void} WritePNG (@code{const char *}fname, @code{const char *}descr=@code{""}, @code{int} compr=@code{""}, @code{bool} alpha=@code{true}) @deftypefnx {C function} @code{void} mgl_write_png (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) @deftypefnx {C function} @code{void} mgl_write_png_solid (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) -Exports current frame to PNG file. Parameter @var{fname} specifies the file name, @var{descr} adds description to file, @var{alpha} gives the transparency type. By default there are no description added and transparent image used. This function does nothing if NO_PNG is defined during compilation of MathGL library. +Exports current frame to PNG file. Parameter @var{fname} specifies the file name, @var{descr} adds description to file, @var{alpha} gives the transparency type. By default there are no description added and semitransparent image used. This function does nothing if NO_PNG is defined during compilation of MathGL library. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} WriteJPEG (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefn {Method on @code{mglGraph}} @code{void} WriteJPEG (@code{const char *}fname, @code{const char *}descr=@code{""}) @deftypefnx {C function} @code{void} mgl_write_jpg (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) Exports current frame to JPEG file. Parameter @var{fname} specifies the file name, @var{descr} adds description to file. By default there is no description added. This function does nothing if NO_JPEG is defined during compilation of MathGL library. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} WriteGIF (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefn {Method on @code{mglGraph}} @code{void} WriteGIF (@code{const char *}fname, @code{const char *}descr=@code{""}) @deftypefnx {C function} @code{void} mgl_write_gif (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) Exports current frame to GIF file. Parameter @var{fname} specifies the file name, @var{descr} adds description to file. By default there is no description added. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} WriteBMP (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefn {Method on @code{mglGraph}} @code{void} WriteBMP (@code{const char *}fname, @code{const char *}descr=@code{""}) @deftypefnx {C function} @code{void} mgl_write_bmp (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) Exports current frame to BMP file. Parameter @var{fname} specifies the file name, @var{descr} adds description to file. There is no compression used. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} WriteEPS (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefn {Method on @code{mglGraph}} @code{void} WriteTGA (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefnx {C function} @code{void} mgl_write_tga (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) +Exports current frame to TGA file. Parameter @var{fname} specifies the file name, @var{descr} adds description to file. There is no compression used. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{void} WriteEPS (@code{const char *}fname, @code{const char *}descr=@code{""}) @deftypefnx {C function} @code{void} mgl_write_eps (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) -Exports current frame to EPS file. The vector representation is used if possible. So it is not recommended for the export of large data plot. It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter @var{fname} specifies the file name, @var{descr} adds description to file. By default there is no description added. If file name is terminated by @samp{z} (for example, @samp{fname.eps.gz}) then file will be compressed in gzip format. +Exports current frame to EPS file using vector representation. So it is not recommended for the export of large data plot. It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter @var{fname} specifies the file name, @var{descr} adds description to file. By default there is no description added. If file name is terminated by @samp{z} (for example, @samp{fname.eps.gz}) then file will be compressed in gzip format. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} WriteSVG (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefn {Method on @code{mglGraph}} @code{void} WriteBPS (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefnx {C function} @code{void} mgl_write_eps (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) +Exports current frame to EPS file using bitmap representation. Parameter @var{fname} specifies the file name, @var{descr} adds description to file. By default there is no description added. If file name is terminated by @samp{z} (for example, @samp{fname.eps.gz}) then file will be compressed in gzip format. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{void} WriteSVG (@code{const char *}fname, @code{const char *}descr=@code{""}) @deftypefnx {C function} @code{void} mgl_write_svg (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) -Exports current frame to SVG (Scalable Vector Graphics) file. The vector representation is used. In difference of EPS format, SVG format support transparency that allows to correctly draw half-transparent plot (like SurfA(), Surf3A(), CloudQ() or CloudP()). Note, the output file may be too large for graphic of large data array (especially for surfaces). It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter @var{fname} specifies the file name, @var{descr} adds description to file (default is file name). If file name is terminated by @samp{z} (for example, @samp{fname.svgz}) then file will be compressed in gzip format. +Exports current frame to SVG (Scalable Vector Graphics) file using vector representation. In difference of EPS format, SVG format support transparency that allows to correctly draw semitransparent plot (like @ref{surfa}, @ref{surf3a} or @ref{cloud}). Note, the output file may be too large for graphic of large data array (especially for surfaces). It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter @var{fname} specifies the file name, @var{descr} adds description to file (default is file name). If file name is terminated by @samp{z} (for example, @samp{fname.svgz}) then file will be compressed in gzip format. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{void} WriteTEX (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefnx {C function} @code{void} mgl_write_tex (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) +Exports current frame to LaTeX (package Tikz/PGF) file using vector representation. Note, the output file may be too large for graphic of large data array (especially for surfaces). It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter @var{fname} specifies the file name, @var{descr} adds description to file (default is file name). +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{void} WriteOBJ (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefnx {C function} @code{void} mgl_write_obj (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) +Exports current frame to OBJ/MTL file using vector representation. Note, the output file may be too large for graphic of large data array (especially for surfaces). It is better to use bitmap format (for example PNG or JPEG). However, program has no internal limitations for size of output file. Parameter @var{fname} specifies the file name, @var{descr} adds description to file (default is file name). @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} WriteIDTF (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefn {Method on @code{mglGraph}} @code{void} WriteIDTF (@code{const char *}fname, @code{const char *}descr=@code{""}) @deftypefnx {C function} @code{void} mgl_write_idtf (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) Exports current frame to IDTF file. Later this file can be converted to U3D format. The vector representation is used. So, the output file may be too large for graphic of large data array (especially for surfaces). However, program has no internal limitations for size of output file. Parameter @var{fname} specifies the file name, @var{descr} adds description to file (default is file name). @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ShowImage (@code{const char *}viewer=@code{"kuickshow"}, @code{bool} nowait=@code{false}) +@deftypefn {Method on @code{mglGraph}} @code{void} ShowImage (@code{const char *}viewer, @code{bool} nowait=@code{false}) @deftypefnx {C function} @code{void} mgl_show_image (@code{const char *}viewer, @code{int} nowait) Displays the current picture using external program @var{viewer} for viewing. The function save the picture to temporary file and call @var{viewer} to display it. If @var{nowait}=@code{true} then the function return immediately (it will not wait while window will be closed). @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetSize (@code{int} width, @code{int} height) -@deftypefnx {C function} @code{void} mgl_set_size (@code{HMGL} gr, @code{int} width, @code{int} height) -Sets size of picture in pixels. This function @strong{must be} called before any other plotting because it completely remove picture contents. +@end ifclear + + +@c ################################################################## +@node Frames/Animation, Bitmap in memory, Export to file, Export picture +@subsection Frames/Animation + +@ifset UDAV +There are no commands for making animation in MGL. However you can use features of utilities (@pxref{Utilities}). For example, by busing special comments @samp{##a } or @samp{##c }. +@end ifset + +@ifclear UDAV +@cindex NewFrame +@cindex EndFrame +@cindex GetNumFrame +@cindex ResetFrames +@cindex StartGIF +@cindex CloseGIF + +These functions provide ability to create several pictures simultaneously. For most of cases it is useless but for widget classes (@pxref{Widget classes}) they can provide a way to show animation. Also you can write several frames into animated GIF file. + +@deftypefn {Method on @code{mglGraph}} @code{int} NewFrame () +@deftypefnx {C function} @code{int} mgl_new_frame (@code{HMGL} gr) +Creates new frame. Function returns current frame id. This is not thread safe function in OpenGL mode! Use direct list creation in multi-threading drawing. The function @code{EndFrame()} @strong{must} be call after the finishing of the frame drawing for each call of this function. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{void} EndFrame () +@deftypefnx {C function} @code{void} mgl_end_frame (@code{HMGL} gr) +Finishes the frame drawing. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{int} GetNumFrame () +@deftypefnx {C function} @code{int} mgl_get_num_frame (@code{HMGL} gr) +Gets the number of created frames. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{void} ResetFrames () +@deftypefnx {C function} @code{int} mgl_reset_frames (@code{HMGL} gr) +Reset frames counter (start it from zero). +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{void} StartGIF (@code{const char *}fname, @code{int} ms=@code{100}) +@deftypefnx {C function} @code{void} mgl_start_gif (@code{HMGL} gr, @code{const char *}fname, @code{int} ms) +Start writing frames into animated GIF file @var{fname}. Parameter @var{ms} set the delay between frames in milliseconds. You @strong{should not} change the picture size during writing the cinema. Use @code{CloseGIF()} to finalize writing. Note, that this function is disabled in OpenGL mode. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{int} CloseGIF () +@deftypefnx {C function} @code{void} mgl_close_gif (@code{HMGL} gr) +Finish writing animated GIF and close connected pointers. +@end deftypefn +@end ifclear + +@c ------------------------------------------------------------------ +@node Bitmap in memory, Parallelization, Frames/Animation, Export picture +@subsection Bitmap in memory + +@ifclear UDAV +These functions return the created picture (bitmap), its width and height. You may display it by yourself in any graphical library (see also, @ref{Widget classes}) or save in file (see also, @ref{Export to file}). + +@deftypefn {Method on @code{mglGraph}} @code{void} GetRGB (@code{char *}buf, @code{int} size) +@deftypefnx {Method on @code{mglGraph}} @code{void} GetBGRN (@code{char *}buf, @code{int} size) +@deftypefnx {C function} @code{const unsigned char *} mgl_get_rgb (@code{HMGL} gr) +Gets RGB bitmap of the current state of the image. Format of each element of bits is: @{red, green, blue@}. Number of elements is Width*Height. Position of element @{i,j@} is [3*i + 3*Width*j] (or is [4*i + 4*Width*j] for @code{GetBGRN()}). You have to provide the proper @var{size} of the buffer, @var{buf}, i.e. the code for Python should look like +@verbatim +from mathgl import * +gr = mglGraph(); +bits='\t'; +bits=bits.expandtabs(4*gr.GetWidth()*gr.GetHeight()); +gr.GetBGRN(bits, len(bits)); +@end verbatim +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{void} GetRGBA (@code{char *}buf, @code{int} size) +@deftypefnx {C function} @code{const unsigned char *} mgl_get_rgba (@code{HMGL} gr) +Gets RGBA bitmap of the current state of the image. Format of each element of bits is: @{red, green, blue, alpha@}. Number of elements is Width*Height. Position of element @{i,j@} is [4*i + 4*Width*j]. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{int} GetWidth () +@deftypefnx {Method on @code{mglGraph}} @code{int} GetHeight () +@deftypefnx {C function} @code{int} mgl_get_width (@code{HMGL} gr) +@deftypefnx {C function} @code{int} mgl_get_height (@code{HMGL} gr) +Gets width and height of the image. +@end deftypefn + + +@deftypefn {Method on @code{mglGraph}} @code{mglPoint} CalcXYZ (@code{int} xs, @code{int} ys) +@deftypefnx {C function} @code{void} mgl_calc_xyz (@code{HMGL} gr, @code{int} xs, @code{int} ys, @code{float *}x, @code{float *}y, @code{float *}z) +Calculate 3D coordinate @{x,y,z@} for screen point @{xs,ys@}. At this moment it ignore perspective and transformation formulas (curvilinear coordinates). The calculation are done for the last used InPlot (@pxref{Transformation matrix}). +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{mglPoint} CalcScr (@code{mglPoint} p) +@deftypefnx {C function} @code{void} mgl_calc_scr (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{int *}xs, @code{int *}ys) +Calculate screen point @{xs,ys@} for 3D coordinate @{x,y,z@}. The calculation are done for the last used InPlot (@pxref{Transformation matrix}). +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{void} SetObjId (@code{int} id) +@deftypefnx {C function} @code{void} mgl_set_obj_id (@code{HMGL} gr, @code{int} id) +Set the numeric id for object or subplot/inplot. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{int} GetObjId (@code{long} xs, @code{long} ys) +@deftypefnx {C function} @code{int} mgl_get_obj_id (@code{HMGL} gr, @code{long} xs, @code{long} ys) +Get the numeric id for most upper object at pixel @{xs, ys@} of the picture. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{int} GetSplId (@code{long} xs, @code{long} ys) +@deftypefnx {C function} @code{int} mgl_get_spl_id (@code{HMGL} gr, @code{long} xs, @code{long} ys) +Get the numeric id for most subplot/inplot at pixel @{xs, ys@} of the picture. +@end deftypefn + +@end ifclear + + +@c ------------------------------------------------------------------ +@node Parallelization, , Bitmap in memory, Export picture +@subsection Parallelization + +@ifclear UDAV +@cindex SetDrawReg +@cindex PutDrawReg +@cindex Combine +@cindex MPI_Send +@cindex MPI_Recv + +There are few functions which allow parallelization at user-level. First 2 limit the drawing region (for example, by subplot per thread) and copy data from that region in another @code{mglGraph} instance. + +@deftypefn {Method on @code{mglGraph}} @code{int} SetDrawReg (@code{int} nx, @code{int} ny, @code{int} m) +@deftypefnx {C function} @code{int} mgl_set_draw_reg (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m) +Set drawable region as a @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{int} PutDrawReg (@code{int} nx, @code{int} ny, @code{int} m, @code{const mglGraph *}g) +@deftypefnx {C function} @code{int} mgl_put_draw_reg (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{HMGL} g) +Put drawing from another instance @var{g} for a @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. The width and height of both instances must be the same. +@end deftypefn + +Another option is combining bitmap image (taking into account Z-ordering) from different instances. This method is most appropriate for computer clusters when the data size is so large that it exceed the memory of single computer node. + +@deftypefn {Method on @code{mglGraph}} @code{int} Combine (@code{const mglGraph *}g) +@deftypefnx {C function} @code{int} mgl_combine_gr (@code{HMGL} gr, @code{HMGL} g) +Combine drawing from instance @var{g} with @var{gr} (or with this) taking into account Z-ordering of pixels. The width and height of both instances must be the same. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Flush () -@deftypefnx {C function} @code{void} mgl_flush (@code{HMGL} gr) -Flushes the plotting commands to frame. This function may be useful if one wants to remove array before the finishing of the plot (i.e. before calling @code{Finish()}). Also call of this function separate the objects in mglGraphIDTF. Most of plots call this function internally. +@deftypefn {Method on @code{mglGraph}} @code{int} MPI_Send (@code{int} id) +@deftypefnx {C function} @code{int} mgl_mpi_send (@code{HMGL} gr, @code{int} id) +Send graphical information from node @var{id} using MPI. The width and height in both nodes must be the same. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Finish () -Finishes plotting and create a picture. Normally this function is called internally. +@deftypefn {Method on @code{mglGraph}} @code{int} MPI_Recv (@code{int} id) +@deftypefnx {C function} @code{int} mgl_mpi_send (@code{HMGL} gr, @code{int} id) +Receive graphical information from node @var{id} using MPI. The width and height in both nodes must be the same. @end deftypefn +@end ifclear + @c ################################################################## -@node Primitives drawing, Text printing, Export to file, MathGL core +@node Primitives drawing, Text printing, Export picture, MathGL core @section Primitives drawing @cindex Ball @cindex Clf @cindex Line @cindex Curve @cindex Glyph -@cindex Mark -@cindex Error @cindex Face @cindex FaceX @cindex FaceY @@ -853,148 +1110,221 @@ Finishes plotting and create a picture. Normally this function is called interna @cindex Drop @cindex Sphere +@ifclear UDAV +@cindex Mark +@cindex Error +@end ifclear + + These functions draw some simple objects like line, point, sphere, drop, cone and so on. +@c TODO @sref{Primitives sample} -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Clf (@code{mglColor} Back=@code{WC}) +@anchor{clf} +@deftypefn {MGL command} {} clf +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Clf () +@deftypefnx {Method on @code{mglGraph}} @code{void} Clf (@code{float} r, @code{float} g, @code{float} b) @deftypefnx {C function} @code{void} mgl_clf (@code{HMGL} gr) @deftypefnx {C function} @code{void} mgl_clf_rgb (@code{HMGL} gr, @code{float} r, @code{float} g, @code{float} b) -Clear the picture and fill it by color @var{Back}. +@end ifclear +Clear the picture and fill it by color specified color. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Ball (@code{float} x, @code{float} y, @code{float} z, @code{mglColor} col=@code{RC}, @code{float} alpha=@code{1}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} Ball (@code{mglPoint} p, @code{char} col=@code{'r'}) -@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} Ball (@code{float} x, @code{float} y, @code{float} z, @code{char} col=@code{'r'}) +@anchor{ball} +@deftypefn {MGL command} {} ball @code{x y} ['col'='r.'] +@deftypefnx {MGL command} {} ball @code{x y z} ['col'='r.'] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Ball (@code{mglPoint} p, @code{char} col=@code{'r'}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Mark (@code{mglPoint} p, @code{const char *}mark) @deftypefnx {C function} @code{void} mgl_ball (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z) -@deftypefnx {C function} @code{void} mgl_ball_rgb (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{float} r, @code{float} g, @code{float} b, @code{float} alpha) -@deftypefnx {C function} @code{void} mgl_ball_str (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{char} col) -Draws a point (ball) at position @var{p}=@{@var{x}, @var{y}, @var{z}@} with color @var{col}. +@deftypefnx {C function} @code{void} mgl_mark (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const char *}mark) +@end ifclear +Draws a mark (point @samp{.} by default) at position @var{p}=@{@var{x}, @var{y}, @var{z}@} with color @var{col}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Error (@code{mglPoint} p, @code{mglPoint} e, @code{char} *pen=@code{""}) -Draws a 3d error box at position @var{p} with sizes @var{e} and style @var{pen}. +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} Error (@code{mglPoint} p, @code{mglPoint} e, @code{char} *stl=@code{""}) +Draws a 3d error box at position @var{p} with sizes @var{e} and style @var{stl}. @end deftypefn +@end ifclear -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Line (@code{mglPoint} p1, @code{mglPoint} p2, @code{char *}stl=@code{"B"}, @code{int}num=@code{2}) -@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} Line (@code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{char *}stl=@code{"B"}, @code{int}num=@code{2}) +@anchor{line} +@deftypefn {MGL command} {} line @code{x1 y1 x2 y2} ['stl'=''] +@deftypefnx {MGL command} {} line @code{x1 y1 z1 x2 y2 z2} ['stl'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Line (@code{mglPoint} p1, @code{mglPoint} p2, @code{char *}stl=@code{"B"}, @code{int}num=@code{2}) @deftypefnx {C function} @code{void} mgl_line (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{char *}stl, @code{int}num) +@end ifclear Draws a geodesic line (straight line in Cartesian coordinates) from point @var{p1} to @var{p2} using line style @var{stl}. Parameter @var{num} define the ``quality'' of the line. If @var{num}=@code{2} then the stright line will be drawn in all coordinate system (independently on transformation formulas (@pxref{Curved coordinates}). Contrary, for large values (for example, =@code{100}) the geodesic line will be drawn in corresponding coordinate system (straight line in Cartesian coordinates, circle in polar coordinates and so on). Line will be drawn even if it lies out of bounding box. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Curve (@code{mglPoint} p1, @code{mglPoint} d1, @code{mglPoint} p2, @code{mglPoint} d2, @code{const char *}stl=@code{"B"}, @code{int} num=@code{100}) -@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} Curve (@code{float} x1, @code{float} y1, @code{float} z1, @code{float} dx1, @code{float} dy1, @code{float} dz1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} dx2, @code{float} dy2, @code{float} dz2, @code{const char *}stl=@code{"B"}, @code{int} num=@code{100}) +@anchor{curve} +@deftypefn {MGL command} {} curve @code{x1 y1 dx1 dy1 x2 y2 dx2 dy2} ['stl'=''] +@deftypefnx {MGL command} {} curve @code{x1 y1 z1 dx1 dy1 dz1 x2 y2 z2 dx2 dy2 dz2} ['stl'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Curve (@code{mglPoint} p1, @code{mglPoint} d1, @code{mglPoint} p2, @code{mglPoint} d2, @code{const char *}stl=@code{"B"}, @code{int} num=@code{100}) @deftypefnx {C function} @code{void} mgl_curve (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} dx1, @code{float} dy1, @code{float} dz1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} dx2, @code{float} dy2, @code{float} dz2, @code{const char *}stl, @code{int} num) +@end ifclear Draws Bezier-like curve from point @var{p1} to @var{p2} using line style @var{stl}. At this tangent is codirected with @var{d1}, @var{d2} and proportional to its amplitude. Parameter @var{num} define the ``quality'' of the curve. If @var{num}=@code{2} then the straight line will be drawn in all coordinate system (independently on transformation formulas @pxref{Curved coordinates}). Contrary, for large values (for example, =@code{100}) the spline like Bezier curve will be drawn in corresponding coordinate system. Curve will be drawn even if it lies out of bounding box. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Face (@code{mglPoint} p1, @code{mglPoint} p2, @code{mglPoint} p3, @code{mglPoint} p4, @code{const char *}stl=@code{"w"}, @code{int} num=@code{2}, @code{float} val=@code{NAN}) -Draws the solid quadrangle (face) with vertexes @var{p1}, @var{p2}, @var{p3}, @var{p4} and with color(s) @var{stl}. At this colors can be the same for all vertexes or different if all 4 colors are specified for each vertex. In first case parameter @var{val} (if not @code{NAN}) set the color according color scheme. Face will be drawn even if it lies out of bounding box. +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} Face (@code{mglPoint} p1, @code{mglPoint} p2, @code{mglPoint} p3, @code{mglPoint} p4, @code{const char *}stl=@code{"w"}) +@deftypefnx {C function} @code{void} mgl_curve (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} x3, @code{float} y3, @code{float} z3, @code{float} x4, @code{float} y4, @code{float} z4, @code{const char *}stl) +Draws the solid quadrangle (face) with vertexes @var{p1}, @var{p2}, @var{p3}, @var{p4} and with color(s) @var{stl}. At this colors can be the same for all vertexes or different if all 4 colors are specified for each vertex. Face will be drawn even if it lies out of bounding box. @end deftypefn +@end ifclear -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} FaceX (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} wy, @code{float} wz, @code{const char *}stl=@code{"w"}, @code{float} dx=@code{0}, @code{float} dy=@code{0}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} FaceY (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} wx, @code{float} wz, @code{const char *}stl=@code{"w"}, @code{float} dx=@code{0}, @code{float} dy=@code{0}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} FaceZ (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} wx, @code{float} wy, @code{const char *}stl=@code{"w"}, @code{float} dx=@code{0}, @code{float} dy=@code{0}) +@anchor{facex} +@anchor{facey} +@anchor{facez} +@deftypefn {MGL command} {} facex @code{x0 y0 z0 wy wz} ['stl'='' @code{d1=0 d2=0}] +@deftypefnx {MGL command} {} facey @code{x0 y0 z0 wx wz} ['stl'='' @code{d1=0 d2=0}] +@deftypefnx {MGL command} {} facez @code{x0 y0 z0 wx wy} ['stl'='' @code{d1=0 d2=0}] +@deftypefnx {Method on @code{mglGraph}} @code{void} FaceX (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} wy, @code{float} wz, @code{const char *}stl=@code{"w"}, @code{float} d1=@code{0}, @code{float} d2=@code{0}) +@deftypefnx {Method on @code{mglGraph}} @code{void} FaceY (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} wx, @code{float} wz, @code{const char *}stl=@code{"w"}, @code{float} d1=@code{0}, @code{float} d2=@code{0}) +@deftypefnx {Method on @code{mglGraph}} @code{void} FaceZ (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} wx, @code{float} wy, @code{const char *}stl=@code{"w"}, @code{float} d1=@code{0}, @code{float} d2=@code{0}) @deftypefnx {C function} @code{void} mgl_facex (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} wy, @code{float} wz, @code{const char *}stl, @code{float} d1, @code{float} d2) @deftypefnx {C function} @code{void} mgl_facey (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} wx, @code{float} wz, @code{const char *}stl, @code{float} d1, @code{float} d2) @deftypefnx {C function} @code{void} mgl_facez (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} wx, @code{float} wy, @code{const char *}stl, @code{float} d1, @code{float} d2) Draws the solid rectangle (face) perpendicular to [x,y,z]-axis correspondingly at position @{@var{x0}, @var{y0}, @var{z0}@} with color @var{stl} and with widths @var{wx}, @var{wy}, @var{wz} along corresponding directions. At this colors can be the same for all vertexes or separately if all 4 colors are specified for each vertex. Parameters @var{d1}!=0, @var{d2}!=0 set additional shift of the last vertex (i.e. to draw quadrangle). @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Sphere (@code{mglPoint} p, @code{float} r, @code{const char *}stl=@code{"r"}) -@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} Sphere (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} r, @code{const char *}stl=@code{"r"}) +@anchor{sphere} +@deftypefn {MGL command} {} sphere @code{x0 y0 r} ['col'='r'] +@deftypefnx {MGL command} {} sphere @code{x0 y0 z0 r} ['col'='r'] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Sphere (@code{mglPoint} p, @code{float} r, @code{const char *}stl=@code{"r"}) @deftypefnx {C function} @code{void} mgl_sphere (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} r, @code{const char *}stl) -Draw the sphere with radius @var{r} and center at point @var{p}=@{@var{x}, @var{y}, @var{z}@} and color @var{stl}. +@end ifclear +Draw the sphere with radius @var{r} and center at point @var{p}=@{@var{x0}, @var{y0}, @var{z0}@} and color @var{stl}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Drop (@code{mglPoint} p, @code{mglPoint} q, @code{float} r, @code{mglColor} col, @code{float} shift=@code{1}, @code{float} ap=@code{1}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} Drop (@code{mglPoint} p, @code{mglPoint} q, @code{float} r, @code{const char *}col="r", @code{float} shift=@code{1}, @code{float} ap=@code{1}) -@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} Drop (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} dx, @code{float} dy, @code{float} dz, @code{float} r, @code{const char *}col="r", @code{float} shift=@code{1}, @code{float} ap=@code{1}) +@anchor{drop} +@deftypefn {MGL command} {} drop @code{x0 y0 dx dy r} ['col'='r' @code{sh=1 asp=1}] +@deftypefnx {MGL command} {} drop @code{x0 y0 z0 dx dy dz r} ['col'='r' @code{sh=1 asp=1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Drop (@code{mglPoint} p, @code{mglPoint} d, @code{float} r, @code{const char *}stl=@code{"r"}, @code{float} shift=@code{1}, @code{float} ap=@code{1}) @deftypefnx {C function} @code{void} mgl_drop (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} dx, @code{float} dy, @code{float} dz, @code{float} r, @code{const char *}col, @code{float} shift, @code{float} ap) -Draw the drop with radius @var{r} at point @var{p} elongated in direction @var{q} and with color @var{col}. Parameter @var{shift} set the degree of drop oblongness: @samp{0} is sphere, @samp{1} is maximally oblongness drop. Parameter @var{ap} set relative width of the drop (this is analogue of ``ellipticity'' for the sphere). @sref{Drops sample} +@end ifclear +Draw the drop with radius @var{r} at point @var{p} elongated in direction @var{d} and with color @var{col}. Parameter @var{shift} set the degree of drop oblongness: @samp{0} is sphere, @samp{1} is maximally oblongness drop. Parameter @var{ap} set relative width of the drop (this is analogue of ``ellipticity'' for the sphere). @sref{Drops sample} @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Cone (@code{mglPoint} p1, @code{mglPoint} p2, @code{float} r1, @code{float} r2=@code{-1}, @code{const char *}stl=@code{"B"}, @code{bool} edge=@code{false}) -@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} Cone (@code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} r1, @code{float} r2=@code{-1}, @code{const char *}stl=@code{"B"}, @code{bool} edge=@code{false}) +@anchor{cone} +@deftypefn {MGL command} {} cone @code{x1 y1 z1 x2 y2 z2 r1} [@code{r2=-1} 'stl'='' @code{edge=off}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Cone (@code{mglPoint} p1, @code{mglPoint} p2, @code{float} r1, @code{float} r2=@code{-1}, @code{const char *}stl=@code{"B"}, @code{bool} edge=@code{false}) @deftypefnx {C function} @code{void} mgl_cone (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} r1, @code{float} r2, @code{const char *}stl, @code{int} draw_edge) +@end ifclear Draw tube (or truncated cone if @var{edge}=@code{false}) between points @var{p1}, @var{p2} with radius at the edges @var{r1}, @var{r2}. If @var{r2}<0 then it is supposed that @var{r2}=@var{r1}. The cone color is defined by string @var{stl}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Mark (@code{mglPoint} p, @code{char} mark=@code{'.'}) -@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} Mark (@code{float} x, @code{float} y, @code{float} z, @code{char} mark=@code{'.'}) -@deftypefnx {C function} @code{void} mgl_mark (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{char} mark) -Draws a marks of different type at position @var{p}. +@anchor{circle} +@deftypefn {MGL command} {} circle @code{x0 y0 r} ['col'='r'] +@deftypefnx {MGL command} {} circle @code{x0 y0 z0 r} ['col'='r'] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Circle (@code{mglPoint} p, @code{float} r, @code{const char *}stl=@code{"r"}) +@end ifclear +Draw the circle with radius @var{r} and center at point @var{p}=@{@var{x0}, @var{y0}, @var{z0}@} and color @var{stl}. If @var{col} contain: @samp{#} then wire figure is drawn, @samp{@@} then boundary is drawn (by second color of @var{col} or by black). +@end deftypefn + +@anchor{ellipse} +@deftypefn {MGL command} {} ellipse @code{x1 y1 x2 y2 r} ['col'='r' @code{sh=1 asp=1}] +@deftypefnx {MGL command} {} ellipse @code{x1 y1 z1 x2 y2 z2 r} ['col'='r' @code{sh=1 asp=1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Ellipse (@code{mglPoint} p1, @code{mglPoint} p2, @code{float} r, @code{const char *}col=@code{"r"}) +@deftypefnx {C function} @code{void} mgl_ellipse (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} r, @code{const char *}col) +@end ifclear +Draw the ellipse with radius @var{r} and focal points @var{p1}, @var{p2} by color @var{col}. If @var{col} contain: @samp{#} then wire figure is drawn, @samp{@@} then boundary is drawn (by second color of @var{col} or by black). @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Glyph (@code{float} x, @code{float} y, @code{float} f, @code{int} nt, @code{const short *}trig, @code{int} nl, @code{const short *}line) -Draw a set of triangles (or lines if @var{trig}=@code{NULL}) for glyph which is placed at point @{@var{x}, @var{y}@}. Values in the arrays are normalized by factor @var{f}. Normally this function is used internally. +@anchor{rhomb} +@deftypefn {MGL command} {} rhomb @code{x1 y1 x2 y2 r} ['col'='r' @code{sh=1 asp=1}] +@deftypefnx {MGL command} {} rhomb @code{x1 y1 z1 x2 y2 z2 r} ['col'='r' @code{sh=1 asp=1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Rhomb (@code{mglPoint} p1, @code{mglPoint} p2, @code{float} r, @code{const char *}col=@code{"r"}) +@deftypefnx {C function} @code{void} mgl_rhomb (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} r, @code{const char *}col) +@end ifclear +Draw the rhombus with width @var{r} and edge points @var{p1}, @var{p2} by color @var{col}. If @var{col} contain: @samp{#} then wire figure is drawn, @samp{@@} then boundary is drawn (by second color of @var{col} or by black). If @var{col} contain 3 colors then gradient filling is used. @end deftypefn @c ################################################################## @node Text printing, Axis and Colorbar, Primitives drawing, MathGL core @section Text printing +@ifclear UDAV @cindex Puts @cindex Putsw +@end ifclear @cindex Text -@cindex Title - -These functions draw the text. There are functions for drawing text in arbitrary place, in arbitrary direction and along arbitrary curve. The class mglFont (@pxref{mglFont class}) is used for low-level string parsing and printing. It can use arbitrary font-faces and parse many TeX commands (for detail @pxref{Font styles}). All these functions have 2 variant: for printing 8-bit text (@code{char *}) and for printing Unicode text (@code{wchar_t *}). In first case the conversion in current locale is used. So sometimes you need to specify it by @code{setlocale()} function. The size argument control the size of text: if positive it give the value, if negative it give the value relative to @var{FontSize}. The font type (STIX, arial, courier, times and so on) can be selected by function SetFont(), GetFont(). @xref{Font settings}. - -The font parameters are described by string. This string may contain several characters of font type (@samp{rbiwou}) and/or align (@samp{LRC}) specification. Also it may contain the text color @samp{wkrgbcymhRGBCYMHW} (@pxref{Line styles}) after symbol @samp{:}. The font types are: @samp{r} -- roman font, @samp{i} -- italic style, @samp{b} -- bold style, @samp{w} -- wired style, @samp{o} -- over-lined text, @samp{u} -- underlined text. By default roman font is used. The align types are: @samp{L} -- align left (default), @samp{C} -- align center, @samp{R} -- align right. For example, string @samp{iC:b} correspond to italic font style for centered text which printed by blue color. - -If string contains symbols @samp{aA} then text is printed at arbitrary position @{@var{x}, @var{y}@} (supposed to be in range [0,1]) of subplot (for @samp{a}) or picture (for @samp{A}). - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Puts (@code{mglPoint} p, @code{const char *}text, @code{const char *}font=@code{""}, @code{float} size=@code{-1}, @code{char} dir=@code{0}, @code{float} shift=@code{0}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} Putsw (@code{mglPoint} p, @code{const wchar_t *}text, @code{const char *}font=@code{""}, @code{float} size=@code{-1}, @code{char} dir=@code{0}, @code{float} shift=@code{0}) -@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} Puts (@code{float} x, @code{float} y, @code{float} z, @code{const char *}text, @code{const char *}font=@code{""}, @code{float} size=@code{-1}, @code{char} dir=@code{0}) -@deftypefnx {C function} @code{void} mgl_puts (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const char *}text) -@deftypefnx {C function} @code{void} mgl_putsw (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const wchar_t *}text) -@deftypefnx {C function} @code{void} mgl_puts_ext (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const char *}text, @code{const char *}font, @code{float} size, @code{char} dir) -@deftypefnx {C function} @code{void} mgl_putsw_ext (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const wchar_t *}text, @code{const char *}font, @code{float} size, @code{char} dir) -The function plots the string @var{text} at position @var{p} with fonts specifying by the criteria @var{how}. The size of font is set by @var{size} parameter (default is @var{FontSize}). Parameter @var{dir} specifies the additional string align. The aligns are: @samp{x} -- align as x-label, @samp{y} -- align as y-label, @samp{z} -- align as z-label, @samp{i} -- align as x-label but inverse writing direction, @samp{t} -- no align (default), @samp{n} -- align in x-y plane. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{float} Puts (@code{mglPoint} p, @code{mglPoint} l, @code{const char *}text, @code{char}where=@code{'t'}, @code{float} size=@code{-1}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{float} Putsw (@code{mglPoint} p, @code{mglPoint} l, @code{const wchar_t *}text, @code{char}where=@code{'t'}, @code{float} size=@code{-1}) -@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} Puts (@code{float} x, @code{float} y, @code{float} z, @code{float} dx, @code{float} dy, @code{float} dz, @code{const char *}text, @code{char}where=@code{'t'}, @code{float} size=@code{-1}) -@deftypefnx {C function} @code{void} mgl_puts_dir (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{float} dx, @code{float} dy, @code{float} dz, @code{const char *}text, @code{float} size) -@deftypefnx {C function} @code{void} mgl_putsw_dir (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{float} dx, @code{float} dy, @code{float} dz, @code{const wchar_t *}text, @code{float} size) -The function plots the string @var{text} at position @var{p} along direction @var{l} with specified @var{size}. Parameter @var{where} set to print text above the line (@samp{T}) or under the line (@samp{t}). Function return the width of the string. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Text (@code{mglPoint} p, @code{const char *}text, @code{const char *}font=@code{""}, @code{float} size=@code{-1}, @code{char} dir=@code{0}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} Text (@code{mglPoint} p, @code{const wchar_t *}text, @code{const char *}font=@code{""}, @code{float} size=@code{-1}, @code{char} dir=@code{0}) -The function plots the string @var{text} at position @var{p} with fonts @var{how}. These functions are obsolete -- use Puts(), Putsw() functions instead. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Printf (@code{mglPoint} p, @code{const char *}arg, ...) -Print formatted string at point @var{p}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Label (@code{float} x, @code{float} y, @code{const char *}text, @code{const char *}font=@code{""}, @code{float} size=@code{-1}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} Labelw (@code{float} x, @code{float} y, @code{const wchar_t *}text, @code{const char *}font=@code{""}, @code{float} size=@code{-1}) -@deftypefnx {C function} @code{void} mgl_label_xy (@code{HMGL} gr, @code{float} x, @code{float} y, @code{const char *}text, @code{const char *}font, @code{float} size) -@deftypefnx {C function} @code{void} mgl_labelw_xy (@code{HMGL} gr, @code{float} x, @code{float} y, @code{const wchar_t *}text, @code{const char *}font, @code{float} size) -The function draws the string @var{text} at position @{@var{x}, @var{y}@} with fonts specifying by @var{font}. The size of font is set by @var{size} parameter (default is @var{FontSize}). Coordiantes @code{x, y} are supposed to be in range [0,1]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Title (@code{const char *}text, @code{const char *}font=@code{0}, @code{float} size=@code{-2}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} Title (@code{const wchar_t *}text, @code{const char *}font=@code{0}, @code{float} size=@code{-2}) -@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} Title (@code{const char *}text, @code{const char *}font=@code{0}, @code{int} size=@code{-2}) -@deftypefnx {C function} @code{void} mgl_title (@code{HMGL} gr, @code{const char *}text, @code{const char *}font, @code{int} size) -@deftypefnx {C function} @code{void} mgl_titlew (@code{HMGL} gr, @code{const wchar_t *}text, @code{const char *}font, @code{int} size) -Print string @var{text} as title of the picture (at the top of the picture). Can be used at any place (even inside SubPlot()). -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Text (@code{const mglData &}y, @code{const char *}text, @code{const char *}font=@code{""}, float size=@code{-1}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} Text (@code{const mglData &}y, @code{const wchar_t *}text, @code{const char *}font=@code{""}, float size=@code{-1}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const char *}text, @code{const char *}font=@code{""}, float size=@code{-1}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const wchar_t *}text, @code{const char *}font=@code{""}, float size=@code{-1}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}text, @code{const char *}font=@code{""}, float size=@code{-1}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const wchar_t *}text, @code{const char *}font=@code{""}, float size=@code{-1}) -@deftypefnx {C function} @code{void} mgl_text_y (@code{HMGL} gr, @code{const HMDT} y, @code{const char *}text, @code{const char *}font, float size) -@deftypefnx {C function} @code{void} mgl_text_xy (@code{const HMDT} x, @code{const HMDT} y, @code{const char *}text, @code{const char *}font, float size) -@deftypefnx {C function} @code{void} mgl_text_xyz (@code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}text, @code{const char *}font, float size) -The function draws @var{text} along the curve between points @{@var{x}[i], @var{y}[i], @var{z}[i]@} by font style @var{font} and with size @var{size}. The string @var{font} may contain symbols @samp{t} for printing the text under the curve (default), or @samp{T} for printing the text above the curve. The sizes of 1st dimension must be equal for all arrays @code{x.nx=y.nx=z.nx}. If array @var{x} is not specified then its an automatic array is used with values equidistantly distributed in interval [@var{Min}.x, @var{Max}.x] (@pxref{Ranges (bounding box)}). If array @var{z} is not specified then @var{z}[i] = @var{zVal} is used. @sref{Text sample} -@end deftypefn +@cindex Label +@cindex fgets + +These functions draw the text. There are functions for drawing text in arbitrary place, in arbitrary direction and along arbitrary curve. MathGL can use arbitrary font-faces and parse many TeX commands (for detail @pxref{Font styles}). All these functions have 2 variant: for printing 8-bit text (@code{char *}) and for printing Unicode text (@code{wchar_t *}). In first case the conversion in current locale is used. So sometimes you need to specify it by @code{setlocale()} function. The size argument control the size of text: if positive it give the value, if negative it give the value relative to @var{FontSize}. The font type (STIX, arial, courier, times and so on) can be selected by function LoadFont(). @xref{Font settings}. + +The font parameters are described by string. This string may set the text color @samp{wkrgbcymhRGBCYMHW} (@pxref{Line styles}). Also, after delimiter symbol @samp{:}, it can contain characters of font type (@samp{rbiwou}) and/or align (@samp{LRC}) specification. The font types are: @samp{r} -- roman (or regular) font, @samp{i} -- italic style, @samp{b} -- bold style, @samp{w} -- wired style, @samp{o} -- over-lined text, @samp{u} -- underlined text. By default roman font is used. The align types are: @samp{L} -- align left (default), @samp{C} -- align center, @samp{R} -- align right. For example, string @samp{b:iC} correspond to italic font style for centered text which printed by blue color. + +If string contains symbols @samp{aA} then text is printed at arbitrary position @{@var{x}, @var{y}@} (supposed to be in range [0,1]) of subplot (for @samp{a}) or picture (for @samp{A}). If string contains symbol @samp{@@} then box around text is drawn. + +@anchor{text} +@deftypefn {MGL command} {} text @code{x y} 'text' ['fnt'='' @code{size=-1}] +@deftypefnx {MGL command} {} text @code{x y z} 'text' ['fnt'='' @code{size=-1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Puts (@code{mglPoint} p, @code{const char *}text, @code{const char *}fnt=@code{""}, @code{float} size=@code{-1}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Putsw (@code{mglPoint} p, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}, @code{float} size=@code{-1}) +@deftypefnx {C function} @code{void} mgl_puts (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const char *}text, @code{const char *}fnt, @code{float} size) +@deftypefnx {C function} @code{void} mgl_putsw (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const wchar_t *}text, @code{const char *}fnt, @code{float} size) +@end ifclear +The function plots the string @var{text} at position @var{p} with fonts specifying by the criteria @var{fnt}. The size of font is set by @var{size} parameter (default is @var{FontSize}). +@end deftypefn + +@deftypefn {MGL command} {} text @code{x y dx dy} 'text' ['fnt'=':L' @code{size=-1}] +@deftypefnx {MGL command} {} text @code{x y z dx dy dz} 'text' ['fnt'=':L' @code{size=-1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Puts (@code{mglPoint} p, @code{mglPoint} d, @code{const char *}text, @code{const char *}fnt=@code{':L'}, @code{float} size=@code{-1}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Putsw (@code{mglPoint} p, @code{mglPoint} d, @code{const wchar_t *}text, @code{const char *}fnt=@code{':L'}, @code{float} size=@code{-1}) +@deftypefnx {C function} @code{void} mgl_puts_dir (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{float} dx, @code{float} dy, @code{float} dz, @code{const char *}text, @code{const char *}fnt, @code{float} size) +@deftypefnx {C function} @code{void} mgl_putsw_dir (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{float} dx, @code{float} dy, @code{float} dz, @code{const wchar_t *}text, @code{const char *}fnt, @code{float} size) +@end ifclear +The function plots the string @var{text} at position @var{p} along direction @var{d} with specified @var{size}. Parameter @var{fnt} set text style and text position: above (@samp{T}) or under (@samp{t}) the line. +@end deftypefn + +@anchor{fgets} +@deftypefn {MGL command} {} fgets @code{x y} 'fname' [@code{n=0} 'fnt'='' @code{size=-1.4}] +@deftypefnx {MGL command} {} fgets @code{x y z} 'fname' [@code{n=0} 'fnt'='' @code{size=-1.4}] +Draws unrotated @var{n}-th line of file @var{fname} at position @{@var{x},@var{y},@var{z}@} with specified @var{size}. By default parameters from @ref{font} command are used. +@end deftypefn + +@anchor{label} +@deftypefn {MGL command} {} label @code{x y} 'text' ['fnt'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Label (@code{float} x, @code{float} y, @code{const char *}text, @code{const char *}fnt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Labelw (@code{float} x, @code{float} y, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}) +@deftypefnx {C function} @code{void} mgl_label_xy (@code{HMGL} gr, @code{float} x, @code{float} y, @code{const char *}text, @code{const char *}fnt) +@deftypefnx {C function} @code{void} mgl_labelw_xy (@code{HMGL} gr, @code{float} x, @code{float} y, @code{const wchar_t *}text, @code{const char *}fnt) +@end ifclear +The function draws the string @var{text} at position @{@var{x}, @var{y}@} with fonts specifying by @var{fnt}. Coordinates @code{x, y} are supposed to be in range [0,1]. +@end deftypefn + + +@deftypefn {MGL command} {} text ydat 'text' ['fnt'=''] +@deftypefnx {MGL command} {} text xdat ydat 'text' ['fnt'=''] +@deftypefnx {MGL command} {} text xdat ydat zdat 'text' ['fnt'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Text (@code{const mglData &}y, @code{const char *}text, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Text (@code{const mglData &}y, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const char *}text, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}text, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_text_y (@code{HMGL} gr, @code{HCDT} y, @code{const char *}text, @code{const char *}fnt, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_textw_y (@code{HMGL} gr, @code{HCDT} y, @code{const wchar_t *}text, @code{const char *}fnt, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_text_xy (@code{HCDT} x, @code{HCDT} y, @code{const char *}text, @code{const char *}fnt, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_textw_xy (@code{HCDT} x, @code{HCDT} y, @code{const wchar_t *}text, @code{const char *}fnt, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_text_xyz (@code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}text, @code{const char *}fnt, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_textw_xyz (@code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const wchar_t *}text, @code{const char *}fnt, @code{const char *}opt) +@end ifclear +The function draws @var{text} along the curve between points @{@var{x}[i], @var{y}[i], @var{z}[i]@} by font style @var{fnt}. The string @var{fnt} may contain symbols @samp{t} for printing the text under the curve (default), or @samp{T} for printing the text above the curve. The sizes of 1st dimension must be equal for all arrays @code{x.nx=y.nx=z.nx}. If array @var{x} is not specified then its an automatic array is used with values equidistantly distributed in interval [@var{Min}.x, @var{Max}.x] (@pxref{Ranges (bounding box)}). If array @var{z} is not specified then @var{z}[i] = @var{Min}.z is used. String @var{opt} contain command options (@pxref{Command options}). @sref{Text sample} +@end deftypefn @c ################################################################## @node Axis and Colorbar, Legend, Text printing, MathGL core @@ -1007,50 +1337,83 @@ The function draws @var{text} along the curve between points @{@var{x}[i], @var{ These functions draw the ``things for measuring'', like axis with ticks, colorbar with ticks, grid along axis, bounding box and labels for axis. For more information @pxref{Axis settings}. -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Axis (@code{const char *}dir=@code{"xyz"}, @code{bool} adjust=@code{false}) -@deftypefnx {C function} @code{void} mgl_axis (@code{HMGL} gr, @code{const char *}dir) -Draws axes with ticks (@pxref{Axis settings}) in directions determined by string parameter @var{dir}.If string contain the symbol @samp{_} then tick labels are not printed. Font for ticks labels is determined by @var{FontDef} (@pxref{Font settings}). Ticks will be adjusted if @var{adjust}=@code{true} (by call of @code{AdjustTicks()}). You may specified an arrow at the end of axis (see @pxref{Line styles}) -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Colorbar (@code{const char *}sch=@code{""}, @code{int} where=@code{0}) -@deftypefnx {C function} @code{void} mgl_colorbar (@code{HMGL} gr, @code{const char *}sch, @code{int} where) -Draws colorbar with color scheme @var{sch} (current scheme if @code{sch=""}) at edge of plot. Parameter @var{where} specifies the position of the colorbar: @samp{0} - at right (default), @samp{1} - at left, @samp{2} - at top, @samp{3} - at bottom. If string @var{sch} contains @samp{<>^_} then the parameter @var{pos} is defined as: @code{pos=0} for @samp{>} (right), @code{pos=1} for @samp{<} (left), @code{pos=2} for @samp{^} (top), @code{pos=3} for @samp{_} (bottom). If string have @samp{A} then absolute (relative to picture) coordinates is used. @sref{Dens sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Colorbar (@code{const mglData &}v, @code{const char *}sch=@code{""}, @code{int} where=@code{0}) -@deftypefnx {C function} @code{void} mgl_colorbar_val (@code{HMGL} gr, @code{const HMDT} v, @code{const char *}sch, @code{int} where) +@anchor{axis} +@deftypefn {MGL command} {} axis ['dir'='xyz' @code{adjust=off}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Axis (@code{const char *}dir=@code{"xyz"}, @code{bool} adjust=@code{false}) +@deftypefnx {C function} @code{void} mgl_axis (@code{HMGL} gr, @code{const char *}dir, @code{int} adjust) +@end ifclear +Draws axes with ticks (@pxref{Axis settings}) in directions determined by string parameter @var{dir}.If string contain the symbol @samp{_} then tick labels are not printed. Font for ticks labels is determined by @var{FontDef} (@pxref{Font settings}). Ticks will be adjusted if @var{adjust}=@code{true} (by call of @code{AdjustTicks()}). You can specified an arrow at the end of axis (see @pxref{Line styles}) +@end deftypefn + +@anchor{colorbar} +@deftypefn {MGL command} {} colorbar ['sch'='' @code{pos=0}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Colorbar (@code{const char *}sch=@code{""}, @code{int} pos=@code{0}) +@deftypefnx {C function} @code{void} mgl_colorbar (@code{HMGL} gr, @code{const char *}sch, @code{int} pos) +@end ifclear +Draws colorbar with color scheme @var{sch} (current scheme if @code{sch=""}) at edge of plot. Parameter @var{pos} specifies the position of the colorbar: @samp{0} - at right (default), @samp{1} - at left, @samp{2} - at top, @samp{3} - at bottom. If string @var{sch} contains @samp{<>^_} then the parameter @var{pos} is defined as: @code{pos=0} for @samp{>} (right), @code{pos=1} for @samp{<} (left), @code{pos=2} for @samp{^} (top), @code{pos=3} for @samp{_} (bottom). If string have @samp{A} then absolute (relative to picture) coordinates is used. @sref{Dens sample} +@end deftypefn + +@deftypefn {MGL command} {} colorbar vdat ['sch'='' @code{pos=0}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Colorbar (@code{const mglData &}v, @code{const char *}sch=@code{""}, @code{int} pos=@code{0}) +@deftypefnx {C function} @code{void} mgl_colorbar_val (@code{HMGL} gr, @code{HCDT} v, @code{const char *}sch, @code{int} pos) +@end ifclear The same as previous but with sharp colors @var{sch} (current palette if @code{sch=""}) for values @var{v}. @sref{ContD sample} @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Colorbar (@code{const char *}sch, @code{int} where, @code{float} x, @code{float} y, @code{float} w, @code{float} h) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} Colorbar (@code{int} where, @code{float} x, @code{float} y, @code{float} w, @code{float} h) -@deftypefnx {C function} @code{void} mgl_colorbar_ext (@code{HMGL} gr, @code{const char *}sch, @code{int} where, @code{float} x, @code{float} y, @code{float} w, @code{float} h) +@deftypefn {MGL command} {} colorbar 'sch' @code{pos x y w h} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Colorbar (@code{const char *}sch, @code{int} pos, @code{float} x, @code{float} y, @code{float} w, @code{float} h) +@deftypefnx {Method on @code{mglGraph}} @code{void} Colorbar (@code{int} pos, @code{float} x, @code{float} y, @code{float} w, @code{float} h) +@deftypefnx {C function} @code{void} mgl_colorbar_ext (@code{HMGL} gr, @code{const char *}sch, @code{int} pos, @code{float} x, @code{float} y, @code{float} w, @code{float} h) +@end ifclear The same as first one but at arbitrary position of subplot @{@var{x}, @var{y}@} (supposed to be in range [0,1]). Parameters @var{w}, @var{h} set the relative width and height of the colorbar. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Colorbar (@code{const mglData &}v, @code{const char *}sch, @code{int} where, @code{float} x, @code{float} y, @code{float} w, @code{float} h) +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} Colorbar (@code{const mglData &}v, @code{const char *}sch, @code{int} pos, @code{float} x, @code{float} y, @code{float} w, @code{float} h) +@deftypefnx {C function} @code{void} mgl_colorbar_val_ext (@code{HMGL} gr, @code{HCDT} v, @code{const char *}sch, @code{int} pos, @code{float} x, @code{float} y, @code{float} w, @code{float} h) The same as previous but with sharp colors @var{sch} (current palette if @code{sch=""}) for values @var{v}. @sref{ContD sample} @end deftypefn +@end ifclear -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Grid (@code{const char *}dir=@code{"xyz"}, @code{const char *}pen=@code{"B-"}) +@anchor{grid} +@deftypefn {MGL command} {} grid ['dir'='xyz' 'pen'='B'] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Grid (@code{const char *}dir=@code{"xyz"}, @code{const char *}pen=@code{"B"}) @deftypefnx {C function} @code{void} mgl_axis_grid (@code{HMGL} gr, @code{const char *}dir, @code{const char *}pen) -Draws grid lines perpendicular to direction determined by string parameter @var{dir}. The step of grid lines is the same as tick step for an Axis(). The style of lines is determined by @var{pen} parameter (default value is dark blue solid line @samp{B-}). +@end ifclear +Draws grid lines perpendicular to direction determined by string parameter @var{dir}. The step of grid lines is the same as tick step for @ref{axis}. The style of lines is determined by @var{pen} parameter (default value is dark blue solid line @samp{B-}). @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Box (@code{const char *}col=@code{""}, @code{bool} ticks=@code{true}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} Box (@code{mglColor} col, @code{bool} ticks=@code{true}) +@anchor{box} +@deftypefn {MGL command} {} box ['stl'='k' @code{ticks=on}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Box (@code{const char *}col=@code{""}, @code{bool} ticks=@code{true}) @deftypefnx {C function} @code{void} mgl_box (@code{HMGL} gr, @code{int} ticks) -@deftypefnx {C function} @code{void} mgl_box_rgb (@code{HMGL} gr, @code{float} r, @code{float} g, @code{float} b, @code{int} ticks) @deftypefnx {C function} @code{void} mgl_box_str (@code{HMGL} gr, @code{const char *}col, @code{int} ticks) +@end ifclear Draws bounding box outside the plotting volume with color @var{col}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Label (@code{char} dir, @code{const char *}text, @code{float} pos=@code{0}, @code{float} size=@code{-1.4}, @code{float} shift=@code{0}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} Label (@code{char} dir, @code{const wchar_t *}text, @code{float} pos=@code{0}, @code{float} size=@code{-1.4}, @code{float} shift=@code{0}) +@anchor{xlabel} +@anchor{ylabel} +@anchor{zlabel} +@anchor{tlabel} +@deftypefn {MGL command} {} xlabel 'text' [@code{pos=1 shift=0}] +@deftypefnx {MGL command} {} ylabel 'text' [@code{pos=1 shift=0}] +@deftypefnx {MGL command} {} zlabel 'text' [@code{pos=1 shift=0}] +@deftypefnx {MGL command} {} tlabel 'text' [@code{pos=1 shift=0}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Label (@code{char} dir, @code{const char *}text, @code{float} pos=@code{1}, @code{float} shift=@code{0}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Label (@code{char} dir, @code{const wchar_t *}text, @code{float} pos=@code{1}, @code{float} shift=@code{0}) @deftypefnx {C function} @code{void} mgl_label (@code{HMGL} gr, @code{char} dir, @code{const char *}text) -@deftypefnx {C function} @code{void} mgl_label_ext (@code{HMGL} gr, @code{char} dir, @code{const char *}text, @code{float} pos, @code{float} size, @code{float} shift) -@deftypefnx {C function} @code{void} mgl_labelw_ext (@code{HMGL} gr, @code{char} dir, @code{const wchar_t *}text, @code{float} pos, @code{float} size, @code{float} shift) -Prints the label @var{text} for axis @var{dir}=@samp{x},@samp{y},@samp{z},@samp{t} (here @samp{t} is ``ternary'' axis @math{t=1-x-y}). The position of label is determined by @var{pos} parameter. If @var{pos}=0 then label is printed at the center of axis. If @var{pos}>0 then label is printed at the maximum of axis. If @var{pos}<0 then label is printed at the minimum of axis. Parameter @var{size} determines the font size for the label. By default the font size is 1.4 times larger than the one for ticks @var{FontSize} (@pxref{Font settings}). @xref{Text printing}. +@deftypefnx {C function} @code{void} mgl_label_ext (@code{HMGL} gr, @code{char} dir, @code{const char *}text, @code{float} pos, @code{float} shift) +@deftypefnx {C function} @code{void} mgl_labelw_ext (@code{HMGL} gr, @code{char} dir, @code{const wchar_t *}text, @code{float} pos, @code{float} shift) +@end ifclear +Prints the label @var{text} for axis @var{dir}=@samp{x},@samp{y},@samp{z},@samp{t} (here @samp{t} is ``ternary'' axis @math{t=1-x-y}). The position of label is determined by @var{pos} parameter. If @var{pos}=0 then label is printed at the center of axis. If @var{pos}>0 then label is printed at the maximum of axis. If @var{pos}<0 then label is printed at the minimum of axis. @xref{Text printing}. @end deftypefn @c ################################################################## @@ -1062,1667 +1425,1289 @@ Prints the label @var{text} for axis @var{dir}=@samp{x},@samp{y},@samp{z},@samp{ @cindex SetLegendBox @cindex SetLegendMarks -These functions draw legend to the graph (useful for @ref{1D plotting}). Legend entry is a pair of strings: one for style of the line, another one with description text (with included TeX parsing). The arrays of strings may be used directly or by accumulating first to the internal arrays (by function AddLegend()) and further plotting it. The position of the legend can be selected automatic or manually. Parameters @var{font} and @var{size} specify the font style and size (@pxref{Font settings}). Parameter @var{llen} set the relative width of the line sample and the text indent. If line style string for entry is empty then the corresponding text is printed without indent. If string @var{font} contains symbol @samp{A} then legend coordinates set position in the picture (not in the current subplot). @sref{Legend sample} - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Legend (@code{int} where=@code{0x3}, @code{const char *}font=@code{"rL"}, @code{float} size=@code{-0.8}, @code{float} llen=@code{0.1}) -@deftypefnx {C function} @code{void} mgl_legend (@code{HMGL} gr, @code{int} where, @code{const char *}font, @code{float} size, @code{float} llen) -Draws legend of accumulated legend entries by font @var{font} with @var{size}. Parameter @var{where} sets the position of the legend: @samp{0} is bottom left corner, @samp{1} is bottom right corner, @samp{2} is top left corner, @samp{3} is top right corner (is default). -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Legend (@code{int} n, @code{wchar_t **}text, @code{char **}style, @code{int} where=@code{0x3}, @code{const char *}font=@code{"rL"}, @code{float} size=@code{-0.8}, @code{float} llen=@code{0.1}) -Draws legend with @var{n}-th elements of string array @var{text} by font @var{font} with @var{size}. Entry strings @var{text} describe curves with line style @var{style} (including marks). Parameter @var{where} sets the position of the legend: @samp{0} is bottom left corner, @samp{1} is bottom right corner, @samp{2} is top left corner, @samp{3} is top right corner (is default). -@end deftypefn +These functions draw legend to the graph (useful for @ref{1D plotting}). Legend entry is a pair of strings: one for style of the line, another one with description text (with included TeX parsing). The arrays of strings may be used directly or by accumulating first to the internal arrays (by function @ref{addlegend}) and further plotting it. The position of the legend can be selected automatic or manually. Parameters @var{fnt} and @var{size} specify the font style and size (@pxref{Font settings}). Parameter @var{llen} set the relative width of the line sample and the text indent. If line style string for entry is empty then the corresponding text is printed without indent. If string @var{fnt} contains symbol @samp{A} then legend coordinates set position in the picture (not in the current subplot). If string @var{fnt} contains symbol @samp{#} then box around legend is drawn. @sref{Legend sample} -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Legend (@code{float} x, @code{float} y, @code{const char *}font=@code{"rL"}, @code{float} size=@code{-0.8}, @code{float} llen=@code{0.1}) -@deftypefnx {C function} @code{void} mgl_legend_xy (@code{HMGL} gr, @code{float} x, @code{float} y, @code{const char *}font, @code{float} size, @code{float} llen) -Draws legend of accumulated legend entries by font @var{font} with @var{size}. Position of legend is determined by parameter @var{x}, @var{y} which supposed to be normalized to interval [0,1]. +@anchor{legend} +@deftypefn {MGL command} {} legend [@code{pos=3} 'fnt'='#' @code{size=-0.8 llen=0.1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Legend (@code{int} pos=@code{0x3}, @code{const char *}fnt=@code{"#"}, @code{float} size=@code{-0.8}, @code{float} llen=@code{0.1}) +@deftypefnx {C function} @code{void} mgl_legend (@code{HMGL} gr, @code{int} pos, @code{const char *}fnt, @code{float} size, @code{float} llen) +@end ifclear +Draws legend of accumulated legend entries by font @var{fnt} with @var{size}. Parameter @var{pos} sets the position of the legend: @samp{0} is bottom left corner, @samp{1} is bottom right corner, @samp{2} is top left corner, @samp{3} is top right corner (is default). @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Legend (@code{int} n, @code{wchar_t **}text, @code{char **}style, @code{float} x, @code{float} y, @code{const char *}font=@code{"rL"}, @code{float} size=@code{-0.8}, @code{float} llen=@code{0.1}) -Draws legend with @var{n}-th elements of string array @var{text} by font @var{font} with @var{size}. Entry strings @var{text} describe curves with line style @var{style} (including marks). Position of legend is determined by parameter @var{x}, @var{y} which supposed to be normalized to interval [0,1]. +@deftypefn {MGL command} {} legend @code{x y} ['fnt'='#' @code{size=-1 llen=0.1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Legend (@code{float} x, @code{float} y, @code{const char *}fnt=@code{"#"}, @code{float} size=@code{-0.8}, @code{float} llen=@code{0.1}) +@deftypefnx {C function} @code{void} mgl_legend_xy (@code{HMGL} gr, @code{float} x, @code{float} y, @code{const char *}fnt, @code{float} size, @code{float} llen) +@end ifclear +Draws legend of accumulated legend entries by font @var{fnt} with @var{size}. Position of legend is determined by parameter @var{x}, @var{y} which supposed to be normalized to interval [0,1]. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} AddLegend (@code{const char *}text, @code{const char *}style) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} AddLegend (@code{const wchar_t *}text, @code{const char *}style) +@anchor{addlegend} +@deftypefn {MGL command} {} addlegend 'text' 'stl' +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} AddLegend (@code{const char *}text, @code{const char *}style) +@deftypefnx {Method on @code{mglGraph}} @code{void} AddLegend (@code{const wchar_t *}text, @code{const char *}style) @deftypefnx {C function} @code{void} mgl_add_legend (@code{HMGL} gr, @code{const char *}text, @code{const char *}style) @deftypefnx {C function} @code{void} mgl_add_legendw (@code{HMGL} gr, @code{const wchar_t *}text, @code{const char *}style) -Adds string @var{text} to internal legend accumulator. The style of described line and mark is specified in string @var{style} (@pxref{Line styles}). Maximal number of entries is 100. +@end ifclear +Adds string @var{text} to internal legend accumulator. The style of described line and mark is specified in string @var{style} (@pxref{Line styles}). @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ClearLegend () +@anchor{clearlegend} +@deftypefn {MGL command} {} clearlegend +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} ClearLegend () @deftypefnx {C function} @code{void} mgl_clear_legend (@code{HMGL} gr) +@end ifclear Clears saved legend strings. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetLegendBox (@code{bool} enable) -@deftypefnx {C function} @code{void} mgl_set_legend_box (@code{HMGL} gr, @code{int} enable) -Switch on/off drawing box near legend. By default (=@code{true}) box is drawn. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetLegendMarks (@code{int} num) +@anchor{legendmarks} +@deftypefn {MGL command} {} legendmarks @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetLegendMarks (@code{int} num) @deftypefnx {C function} @code{void} mgl_set_legend_marks (@code{HMGL} gr, @code{int} num) +@end ifclear Set the number of marks in the legend. By default 1 mark is used. @end deftypefn -@deftypecv {@emph{Obsolete option}} mglGraph @code{bool} LegendBox -Switch on/off drawing box near legend. See @code{SetLegendBox()}. -@end deftypecv - @c ################################################################## @node 1D plotting, 2D plotting, Legend, MathGL core @section 1D plotting - -These functions perform plotting of 1D data. 1D means that data depended from only 1 parameter like parametric curve @{x(i),y(i),z(i)@}, i=1...n. There are 5 generally different types of data representations: simple line plot (Plot), line plot with filling under it (Area), stairs plot (Step), bar plot (Bars, Barh) and vertical lines (Stem). Each type of plotting has similar interface. There are 3D version and two 2D versions. One of last requires single array. The parameters of line and marks are specified by the string argument. If the string parameter is "" then solid line with color from palette Pal is used (@pxref{Palette and colors}). Also there are some special 1d plots having slightly different interface: surface of curve rotation (Torus), chart (Chart) and error boxes (Error), marks with variable size (Mark), tubes (Tube) and so on. @xref{Line styles}. @sref{1D plot sample} - - -@menu -* Plot:: -* Radar:: -* Tens:: -* Area:: -* Region:: -* Stem:: -* Bars:: -* Barh:: -* Chart:: -* Step:: -* Torus:: -* Tube:: -* Mark:: -* TextMark:: -* Error:: -* BoxPlot:: -@end menu - -@c ================================================================== -@node Plot, Radar, , 1D plotting -@subsection Plot @cindex Plot - -These functions draw continuous lines between points. The plots are drawn for each row if one of the data is the matrix. By any case the sizes of 1st dimension @strong{must be equal} for all arrays @code{x.nx=y.nx=z.nx}. String @var{pen} specifies the color and style of line and marks (@pxref{Line styles}). By default (@code{pen=""}) solid line with color from palette is used (@pxref{Palette and colors}). See also @ref{Area}, @ref{Step}, @ref{Stem}, @ref{Tube}, @ref{Mark}, @ref{Error}, @ref{Belt}, @ref{Tens}. @sref{Plot sample} - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Plot (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_plot_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}pen) -The function draws continuous lines between points @{@var{x}[i], @var{y}[i], @var{z}[i]@} in 3D space. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Plot (@code{const mglData &}x, @code{const mglData &}y, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_plot_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const char *}pen) -The function draws continuous lines between points @{@var{x}[i], @var{y}[i]@} in plane @var{z}=@var{zVal} (default in plane @var{z}=@var{Min.z}). -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Plot (@code{const mglData &}y, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_plot (@code{HMGL} gr, @code{const HMDT} y, @code{const char *}pen) -The function draws continuous lines between points @{@var{x}[i], @var{y}[i]@} in plane @var{z}=@var{zVal} (default in plane @var{z}=@var{Min.z}), where @var{x}[i] values are equidistantly distributed in interval [@var{Min}.x, @var{Max}.x]. -@end deftypefn - -@c ================================================================== -@node Radar, Tens, Plot, 1D plotting -@subsection Radar @cindex Radar - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Radar (@code{const mglData &}a, @code{const char *}pen=@code{""}, @code{float} r=@code{-1}) -@deftypefnx {C function} @code{void} mgl_radar (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}pen, @code{float} r) -This functions draws radar chart which is continuous lines between points located on an radial lines (like plot in Polar coordinates). The plots are drawn for each row if one of the data is the matrix. Parameter @var{r} set the additional shift of data (i.e. the data @var{a}+@var{r} is used instead of @var{a}). If @code{r<0} then @code{r=max(0, -min(a)}. String @var{pen} specifies the color and style of line and marks (@pxref{Line styles}). By default (@code{pen=""}) solid line with color from palette is used (@pxref{Palette and colors}). If @var{pen} containt @samp{#} symbol then "grid" (radial lines and circle for @var{r}) is drawn See also @ref{Plot}. @sref{Radar sample} -@end deftypefn - -@c ================================================================== -@node Tens, Area, Radar, 1D plotting -@subsection Tens @cindex Tens - -These functions draw continuous lines between points with color defined by the special array (look like tension plot). The plots are drawn for each row if one of the data is the matrix. By any case the sizes of 1st dimension @strong{must be equal} for all arrays @code{x.nx=y.nx=z.nx}. String @var{pen} specifies the color scheme (@pxref{Color scheme}) and style and/or width of line (@pxref{Line styles}). By default (@code{pen=""}) solid line with current color scheme is used. See also @ref{Plot}, @ref{Mesh}, @ref{Fall}. @sref{Tens sample} - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Tens (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_tens_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}pen) -The function draws continuous lines between points @{@var{x}[i], @var{y}[i], @var{z}[i]@} in 3D space with color defined by @var{c}[i]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Tens (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}c, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_tens_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} c, @code{const char *}pen) -The function draws continuous lines between points @{@var{x}[i], @var{y}[i]@} in plane @var{z}=@var{zVal} (default in plane @var{z}=@var{Min.z}) with color defined by @var{c}[i]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Tens (@code{const mglData &}y, @code{const mglData &}c, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_tens (@code{HMGL} gr, @code{const HMDT} y, @code{const HMDT} c, @code{const char *}pen) -The function draws continuous lines between points @{@var{x}[i], @var{y}[i]@} in plane @var{z}=@var{zVal} (default in plane @var{z}=@var{Min.z}) with color defined by @var{c}[i], where @var{x}[i] values are equidistantly distributed in interval [@var{Min}.x, @var{Max}.x]. -@end deftypefn - -@c ================================================================== -@node Area, Region, Tens, 1D plotting -@subsection Area @cindex Area - -These functions draw continuous lines between points and fills it to axis plane. The plots are drawn for each row if one of the data is the matrix. By any case the sizes of 1st dimension @strong{must be equal} for all arrays @code{x.nx=y.nx=z.nx}. String @var{pen} specifies the color and style of line and marks (@pxref{Line styles}). By default (@code{pen=""}) solid line with color from palette is used (@pxref{Palette and colors}). Also you can use gradient filling if number of specified colors is equal to 2*number of curves. If string contain symbol @samp{a} then lines are drawn one above another (like summation) -- you can reach the same effect if call @code{y.CumSum("y");} before plot. See also @ref{Plot}, @ref{Bars}, @ref{Stem}. @sref{Area sample} - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Area (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_area_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}pen) -The function draws continuous lines between points @{@var{x}[i], @var{y}[i], @var{z}[i]@} in 3D space and fills it down to @var{z} = Org.z. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Area (@code{const mglData &}x, @code{const mglData &}y, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_area_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const char *}pen) -The function draws continuous lines between points @{@var{x}[i], @var{y}[i]@} in plane @var{z}=@var{zVal} (default in plane @var{z}=@var{Min.z}) and fills it down to @var{y} = Org.y. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Area (@code{const mglData &}y, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_area (@code{HMGL} gr, @code{const HMDT} y, @code{const char *}pen) -The function draws continuous lines between points @{@var{x}[i], @var{y}[i]@} in plane @var{z}=@var{zVal} (default in plane @var{z}=@var{Min.z}) and fills it down to @var{y} = Org.y, where @var{x}[i] values are equidistantly distributed in interval [@var{Min}.x, @var{Max}.x]. -@end deftypefn - -@c ================================================================== -@node Region, Stem, Area, 1D plotting -@subsection Region @cindex Region - -These functions fill area between 2 curves. The plots are drawn for each row if one of the data is the matrix. By any case the sizes of 1st dimension @strong{must be equal} for all arrays @code{x.nx=y1.nx=y2.nx} and all dimensions of arrays @var{y1} and @var{y2} must be equal too. String @var{pen} specifies the color (@pxref{Line styles}). By default (@code{pen=""}) color from palette is used (@pxref{Palette and colors}). Also you can use gradient filling if number of specified colors is equal to 2*number of curves. See also @ref{Area}, @ref{Bars}, @ref{Stem}. @sref{Region sample} - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Region (@code{const mglData &}x, @code{const mglData &}y1, @code{const mglData &}y2, @code{const char *}pen=@code{""}, @code{float} zVal=@code{NAN}, @code{bool} inside=@code{true}) -@deftypefnx {C function} @code{void} mgl_region_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y1, @code{const HMDT} y2, @code{const char *}pen, @code{int} inside) -The function fills area between curves @{@var{x}[i], @var{y1}[i]@} and @{@var{x}[i], @var{y2}[i]@} at z=@var{zVal}. Parameter @code{inside=false} set to fill are with y12}). If string @var{sch} have symbol @samp{#} then grid lines are drawn. See also @ref{dens}, @ref{cont}, @ref{contd}, @code{contf[xyz]}. @sref{ContF sample} +@end deftypefn + +@deftypefn {MGL command} {} contf zdat ['sch'=''] +@deftypefnx {MGL command} {} contf xdat ydat zdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} ContF (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} ContF (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_contf (@code{HMGL} gr, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_contf_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The same as previous with vector @var{v} of @var{num}-th elements equidistantly distributed in color range. Here @var{num} is equal to parameter @var{value} in options @var{opt} (default is 7). +@end deftypefn + +@anchor{contd} +@deftypefn {MGL command} {} contd vdat zdat ['sch'=''] +@deftypefnx {MGL command} {} contd vdat xdat ydat zdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} ContD (@code{const mglData &}v, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} ContD (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_contd_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_contd_xy_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws solid (or filled) contour lines for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} at @var{z}=@var{v}[k] (or at @var{z} = @var{Min}.z if @var{sch} contain symbol @samp{_}) with manual colors. Contours are plotted for @var{z}[i,j]=@var{v}[k] where @var{v}[k] are values of data array @var{v} (must be @code{v.nx>2}). String @var{sch} sets the contour colors: the color of k-th contour is determined by character @code{sch[k%strlen(sch)]}. See also @ref{dens}, @ref{cont}, @ref{contf}. @sref{ContD sample} +@end deftypefn + +@deftypefn {MGL command} {} contd zdat ['sch'=''] +@deftypefnx {MGL command} {} contd xdat ydat zdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} ContD (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} ContD (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_contd (@code{HMGL} gr, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_contd_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The same as previous with vector @var{v} of @var{num}-th elements equidistantly distributed in color range. Here @var{num} is equal to parameter @var{value} in options @var{opt} (default is 7). +@end deftypefn + +@anchor{axial} +@deftypefn {MGL command} {} axial vdat zdat ['sch'=''] +@deftypefnx {MGL command} {} axial vdat xdat ydat zdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Axial (@code{const mglData &}v, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Axial (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_axial_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_axial_xy_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws surface which is result of contour plot rotation for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@}. Contours are plotted for @var{z}[i,j]=@var{v}[k] where @var{v}[k] are values of data array @var{v}. If string @var{sch} have symbol @samp{#} then wire plot is produced. If string contain symbols @samp{x} or @samp{z} then rotation axis will be set to specified direction (default is @samp{y}). See also @ref{cont}, @ref{contf}, @ref{torus}, @ref{surf3}. @sref{Axial sample} +@end deftypefn + +@deftypefn {MGL command} {} axial zdat ['sch'=''] +@deftypefnx {MGL command} {} axial xdat ydat zdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Axial (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}, @code{int} num=@code{3}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Axial (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}, @code{int} num=@code{3}) +@deftypefnx {C function} @code{void} mgl_axial (@code{HMGL} gr, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_axial_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The same as previous with vector @var{v} of @var{num}-th elements equidistantly distributed in color range. Here @var{num} is equal to parameter @var{value} in options @var{opt} (default is 3). +@end deftypefn + +@anchor{grid2} +@deftypefn {MGL command} {} grid2 zdat ['sch'=''] +@deftypefnx {MGL command} {} grid2 xdat ydat zdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Grid (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Grid (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_grid (@code{HMGL} gr, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_grid_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws grid lines for density plot of surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} at @var{z} = @var{zVal}. String @var{sch} sets the color scheme. Previous color scheme is used by default. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Grid is plotted for each z slice of the data. See also @ref{dens}, @ref{cont}, @ref{contf}, @ref{meshnum}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Mark (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}r, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_mark_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} r, @code{const char *}pen) -The function draws marks for points @{@var{x}[i], @var{y}[i]@} in plane @var{z}=@var{zVal} (default in plane @var{z}=@var{Min.z}). -@end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Mark (@code{const mglData &}y, @code{const mglData &}r, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_mark_y (@code{HMGL} gr, @code{const HMDT} y, @code{const HMDT} r, @code{const char *}pen) -The function draws marks for points @{@var{x}[i], @var{y}[i]@} in plane @var{z}=@var{zVal} (default in plane @var{z}=@var{Min.z}), where @var{x}[i] values are equidistantly distributed in interval [@var{Min}.x, @var{Max}.x]. -@end deftypefn +@c ################################################################## +@node 3D plotting, Dual plotting, 2D plotting, MathGL core +@section 3D plotting +@cindex Surf3 +@cindex Dens3 +@cindex Cont3 +@cindex ContF3 +@cindex Grid3 +@cindex Cloud +@cindex Beam -@c ================================================================== -@node TextMark, Error, Mark, 1D plotting -@subsection TextMark -@cindex TextMark +These functions perform plotting of 3D data. 3D means that data depend from 3 independent parameters like matrix @math{f(x_i,y_j,z_k), i=1...n, j=1...m, k=1...l}.By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{a} should be equal @code{x.nx=a.nx && y.nx=a.ny && z.nz=a.nz} or @code{x.nx=y.nx=z.nx=a.nx && x.ny=y.ny=z.ny=a.ny && x.nz=y.nz=z.nz=a.nz}. Arrays @var{x}, @var{y} and @var{z} can be vectors (not matrices as @var{a}). String @var{sch} sets the color scheme (@pxref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (@pxref{Command options}). @sref{3D plot sample} + +@anchor{surf3} +@deftypefn {MGL command} {} surf3 adat @code{val} ['sch'=''] +@deftypefnx {MGL command} {} surf3 xdat ydat zdat adat @code{val} ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Surf3 (@code{float} val, @code{const mglData &}a, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Surf3 (@code{float} val, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_surf3_val (@code{HMGL} gr, @code{float} val, @code{HCDT} a, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_surf3_xyz_val (@code{HMGL} gr, @code{float} val, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws isosurface plot for 3d array specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) at @var{a}(x,y,z)=@var{val}. If string contain @samp{#} then wire plot is produced. Note, that there is possibility of incorrect plotting due to uncertainty of cross-section defining if there are two or more isosurface intersections inside one cell. See also @ref{cloud}, @ref{dens3}, @ref{surf3c}, @ref{surf3a}, @ref{axial}. @sref{Surf3 sample} +@end deftypefn + +@deftypefn {MGL command} {} surf3 adat ['sch'=''] +@deftypefnx {MGL command} {} surf3 xdat ydat zdat adat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Surf3 (@code{const mglData &}a, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Surf3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_surf3 (@code{HMGL} gr, @code{HCDT} a, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_surf3_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{const char *}sch, @code{const char *}opt) +@end ifclear +Draws @var{num}-th uniformly distributed in color range isosurfaces for 3d data. Here @var{num} is equal to parameter @var{value} in options @var{opt} (default is 3). +@end deftypefn + +@anchor{cloud} +@deftypefn {MGL command} {} cloud adat ['sch'=''] +@deftypefnx {MGL command} {} cloud xdat ydat zdat adat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Cloud (@code{const mglData &}a, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Cloud (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_cloud (@code{HMGL} gr, @code{HCDT} a, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_cloud_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws cloud plot for 3d data specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). This plot is a set of cubes with color and transparency proportional to value of @var{a}. The resulting plot is like cloud -- low value is transparent but higher ones are not. The number of plotting cells depend on @ref{MeshNum}. If string @var{sch} contain symbol @samp{.} then lower quality plot will produced with much low memory usage. If string @var{sch} contain symbol @samp{-} then transparency will be inversed, i.e. higher become transparent and lower become not transparent. See also @ref{surf3}. @sref{Cloud sample} +@end deftypefn + +@anchor{dens3} +@deftypefn {MGL command} {} dens3 adat 'dir' [@code{sval=-1} 'sch'=''] +@deftypefnx {MGL command} {} dens3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Dens3 (@code{const mglData &}a, @code{char} dir, @code{float} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Dens3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{float} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_dens3 (@code{HMGL} gr, @code{HCDT} a, @code{char} dir, @code{float} sVal, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_dens3_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{char} dir, @code{float} sVal, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws density plot for 3d data specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Density is plotted at slice @var{sVal} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. If string @var{stl} have symbol @samp{#} then grid lines are drawn. See also @ref{cont3}, @ref{contf3}, @ref{dens}, @ref{grid3}. @sref{Dens3 sample} +@end deftypefn + +@anchor{cont3} +@deftypefn {MGL command} {} cont3 vdat adat 'dir' [@code{sval=-1} 'sch'=''] +@deftypefnx {MGL command} {} cont3 vdat xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Cont3 (@code{const mglData &}v, @code{const mglData &}a, @code{char} dir, @code{float} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Cont3 (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{float} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_cont3_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} a, @code{char} dir, @code{float} sVal, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_cont3_xyz_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{char} dir, @code{float} sVal, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws contour plot for 3d data specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Contours are plotted for values specified in array @var{v} at slice @var{sVal} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. If string @var{stl} have symbol @samp{#} then grid lines are drawn. If string @var{stl} have symbol @samp{t} or @samp{T} then contour labels will be drawn below (or above) the contours. See also @ref{dens3}, @ref{contf3}, @ref{cont}, @ref{grid3}. @sref{Cont3 sample} +@end deftypefn + +@deftypefn {MGL command} {} cont3 adat 'dir' [@code{sval=-1} 'sch'=''] +@deftypefnx {MGL command} {} cont3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Cont3 (@code{const mglData &}a, @code{char} dir, @code{float} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Cont3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{float} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_cont3 (@code{HMGL} gr, @code{HCDT} a, @code{char} dir, @code{float} sVal, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_cont3_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{char} dir, @code{float} sVal, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The same as previous with vector @var{v} of @var{num}-th elements equidistantly distributed in color range. Here @var{num} is equal to parameter @var{value} in options @var{opt} (default is 7). +@end deftypefn + +@anchor{contf3} +@deftypefn {MGL command} {} contf3 vdat adat 'dir' [@code{sval=-1} 'sch'=''] +@deftypefnx {MGL command} {} contf3 vdat xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Contf3 (@code{const mglData &}v, @code{const mglData &}a, @code{char} dir, @code{float} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Contf3 (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{float} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_contf3_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} a, @code{char} dir, @code{float} sVal, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_contf3_xyz_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{char} dir, @code{float} sVal, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws solid (or filled) contour plot for 3d data specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Contours are plotted for values specified in array @var{v} at slice @var{sVal} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. If string @var{stl} have symbol @samp{#} then grid lines are drawn. If string @var{stl} have symbol @samp{t} or @samp{T} then contour labels will be drawn below (or above) the contours. See also @ref{dens3}, @ref{cont3}, @ref{contf}, @ref{grid3}. @sref{Cont3 sample} +@end deftypefn + +@deftypefn {MGL command} {} contf3 adat 'dir' [@code{sval=-1} 'sch'=''] +@deftypefnx {MGL command} {} contf3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Contf3 (@code{const mglData &}a, @code{char} dir, @code{float} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Contf3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{float} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_contf3 (@code{HMGL} gr, @code{HCDT} a, @code{char} dir, @code{float} sVal, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_contf3_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{char} dir, @code{float} sVal, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The same as previous with vector @var{v} of @var{num}-th elements equidistantly distributed in color range. Here @var{num} is equal to parameter @var{value} in options @var{opt} (default is 7). +@end deftypefn + +@anchor{grid3} +@deftypefn {MGL command} {} grid3 adat 'dir' [@code{sval=-1} 'sch'=''] +@deftypefnx {MGL command} {} grid3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Grid3 (@code{const mglData &}a, @code{char} dir, @code{float} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Grid3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{float} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_grid3 (@code{HMGL} gr, @code{HCDT} a, @code{char} dir, @code{float} sVal, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_grid3_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{char} dir, @code{float} sVal, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws grid for 3d data specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Grid is plotted at slice @var{sVal} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. See also @ref{cont3}, @ref{contf3}, @ref{dens3}, @ref{grid2}, @ref{meshnum}. +@end deftypefn + +@anchor{beam} +@deftypefn {MGL command} {} beam tr g1 g2 adat @code{rval} ['sch'='' @code{flag=0 num=3}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Beam (@code{const mglData &}tr, @code{const mglData &}g1, @code{const mglData &}g2, @code{const mglData &}a, @code{float} r, @code{const char *}stl=@code{""}, @code{int} flag=@code{0}, @code{int} num=@code{3}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Beam (@code{float} val, @code{const mglData &}tr, @code{const mglData &}g1, @code{const mglData &}g2, @code{const mglData &}a, @code{float} r, @code{const char *}stl=@code{""}, @code{int} flag=@code{0}) +@deftypefnx {C function} @code{void} mgl_beam (@code{HMGL} gr, @code{HCDT} tr, @code{HCDT} g1, @code{HCDT} g2, @code{HCDT} a, @code{float} r, @code{const char *}stl, @code{int} flag, @code{int} num) +@deftypefnx {C function} @code{void} mgl_beam_val (@code{HMGL} gr, @code{float} val, @code{HCDT} tr, @code{HCDT} g1, @code{HCDT} g2, @code{HCDT} a, @code{float} r, @code{const char *}stl, @code{int} flag) +@end ifclear +Draws the isosurface for 3d array @var{a} at constant values of @var{a}=@var{val}. This is special kind of plot for @var{a} specified in accompanied coordinates along curve @var{tr} with orts @var{g1}, @var{g2} and with transverse scale @var{r}. Variable @var{flag} is bitwise: @samp{0x1} - draw in accompanied (not laboratory) coordinates; @samp{0x2} - draw projection to @math{\rho-z} plane; @samp{0x4} - draw normalized in each slice field. The x-size of data arrays @var{tr}, @var{g1}, @var{g2} must be nx>2. The y-size of data arrays @var{tr}, @var{g1}, @var{g2} and z-size of the data array @var{a} must be equal. See also @ref{surf3}. +@end deftypefn -These functions draw string @var{text} as marks with size proportional to @var{r}*@var{MarkSize} (@pxref{Default sizes}) at points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. The plots are drawn for each row if one of the data is the matrix. By any case the sizes of 1st dimension @strong{must be equal} for all arrays @code{x.nx=y.nx=z.nx=r.nx}. String @var{pen} specifies the color and style of line and marks (@pxref{Line styles}). By default (@code{pen=""}) solid line with color from palette is used (@pxref{Palette and colors}). See also @ref{Plot}, @ref{Mark}, @ref{Stem}. @sref{TextMark sample} -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} TextMark (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}r, @code{const char *}text, @code{const char *}fnt=@code{""}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} TextMark (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}r, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}) -@deftypefnx {C function} @code{void} mgl_textmarkw_xyzr (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} r, @code{const wchar_t *}text, @code{const char *}fnt) -@deftypefnx {C function} @code{void} mgl_textmark_xyzr (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} r, @code{const char *}text, @code{const char *}fnt) -The function draws textual marks for points @{@var{x}[i], @var{y}[i], @var{z}[i]@} in 3D space. -@end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} TextMark (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}r, @code{const char *}text, @code{const char *}fnt=@code{""}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} TextMark (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}r, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}) -@deftypefnx {C function} @code{void} mgl_textmarkw_xyr (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} r, @code{const wchar_t *}text, @code{const char *}fnt) -@deftypefnx {C function} @code{void} mgl_textmark_xyr (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} r, @code{const char *}text, @code{const char *}fnt) -The function draws textual marks for points @{@var{x}[i], @var{y}[i]@} in plane @var{z}=@var{zVal} (default in plane @var{z}=@var{Min.z}). -@end deftypefn +@c ################################################################## +@node Dual plotting, Vector fields, 3D plotting, MathGL core +@section Dual plotting -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} TextMark (@code{const mglData &}y, @code{const mglData &}r, @code{const char *}text, @code{const char *}fnt=@code{""}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} TextMark (@code{const mglData &}y, @code{const mglData &}r, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}) -@deftypefnx {C function} @code{void} mgl_textmarkw_yr (@code{HMGL} gr, @code{const HMDT} y, @code{const HMDT} r, @code{const wchar_t *}text, @code{const char *}fnt) -@deftypefnx {C function} @code{void} mgl_textmark_yr (@code{HMGL} gr, @code{const HMDT} y, @code{const HMDT} r, @code{const char *}text, @code{const char *}fnt) -The function draws textual marks for points @{@var{x}[i], @var{y}[i]@} in plane @var{z}=@var{zVal} (default in plane @var{z}=@var{Min.z}), where @var{x}[i] values are equidistantly distributed in interval [@var{Min}.x, @var{Max}.x]. -@end deftypefn +@cindex SurfC +@cindex SurfA +@cindex Surf3C +@cindex Surf3A +@cindex TileS +@cindex Map +@cindex STFA -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} TextMark (@code{const mglData &}y, @code{const char *}text, @code{const char *}fnt=@code{""}) -@deftypefnx {Method on @code{mglGraph} (C++)} @code{void} TextMark (@code{const mglData &}y, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}) -@deftypefnx {C function} @code{void} mgl_textmarkw (@code{HMGL} gr, @code{const HMDT} y, @code{const wchar_t *}text, @code{const char *}fnt) -@deftypefnx {C function} @code{void} mgl_textmark (@code{HMGL} gr, @code{const HMDT} y, @code{const char *}text, @code{const char *}fnt) -The function draws textual marks for points @{@var{x}[i], @var{y}[i]@} in plane @var{z}=@var{zVal} (default in plane @var{z}=@var{Min.z}), where @var{x}[i] values are equidistantly distributed in interval [@var{Min}.x, @var{Max}.x]. The mark sizes @var{r}[i]=1 for all points. +These plotting functions draw @emph{two matrix} simultaneously. There are 5 generally different types of data representations: surface or isosurface colored by other data (SurfC, Surf3C), surface or isosurface transpared by other data (SurfA, Surf3A), tiles with variable size (TileS), mapping diagram (Map), STFA diagram (STFA). By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{c} should be equal. Arrays @var{x}, @var{y} (and @var{z} for @code{Surf3C, Surf3A}) can be vectors (not matrices as @var{c}). String @var{sch} sets the color scheme (@pxref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (@pxref{Command options}). + +@anchor{surfc} +@deftypefn {MGL command} {} surfc zdat cdat ['sch'=''] +@deftypefnx {MGL command} {} surfc xdat ydat zdat cdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SurfC (@code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} SurfC (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_surfc (@code{HMGL} gr, @code{HCDT} z, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_surfc_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} and color it by matrix @var{c}[i,j]. If string @var{sch} have symbol @samp{#} then grid lines are drawn. All dimensions of arrays @var{z} and @var{c} must be equal. Surface is plotted for each z slice of the data. See also @ref{surf}, @ref{surfa}, @ref{surf3c}. @sref{SurfC sample} +@end deftypefn + +@anchor{surf3c} +@deftypefn {MGL command} {} surf3c adat cdat @code{val} ['sch'=''] +@deftypefnx {MGL command} {} surf3c xdat ydat zdat adat cdat @code{val} ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Surf3C (@code{float} val, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Surf3C (@code{float} val, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_surf3c_val (@code{HMGL} gr, @code{float} val, @code{HCDT} a, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_surf3c_xyz_val (@code{HMGL} gr, @code{float} val, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws isosurface plot for 3d array specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) at @var{a}(x,y,z)=@var{val}. It is mostly the same as @ref{surf3} function but the color of isosurface depends on values of array @var{c}. If string contain @samp{#} then wire plot is produced. See also @ref{surf3}, @ref{surfc}, @ref{surf3a}. @sref{Surf3C sample} +@end deftypefn + +@deftypefn {MGL command} {} surf3c adat cdat ['sch'=''] +@deftypefnx {MGL command} {} surf3c xdat ydat zdat adat cdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Surf3C (@code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Surf3C (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_surf3c (@code{HMGL} gr, @code{HCDT} a, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_surf3c_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@end ifclear +Draws @var{num}-th uniformly distributed in color range isosurfaces for 3d data. Here @var{num} is equal to parameter @var{value} in options @var{opt} (default is 3). +@end deftypefn + + +@anchor{surfa} +@deftypefn {MGL command} {} surfa zdat cdat ['sch'=''] +@deftypefnx {MGL command} {} surfa xdat ydat zdat cdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SurfA (@code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} SurfA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_surfa (@code{HMGL} gr, @code{HCDT} z, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_surfa_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} and transparent it by matrix @var{c}[i,j]. If string @var{sch} have symbol @samp{#} then grid lines are drawn. All dimensions of arrays @var{z} and @var{c} must be equal. Surface is plotted for each z slice of the data. See also @ref{surf}, @ref{surfc}, @ref{surf3a}. @sref{SurfA sample} +@end deftypefn + +@anchor{surf3a} +@deftypefn {MGL command} {} surf3a adat cdat @code{val} ['sch'=''] +@deftypefnx {MGL command} {} surf3a xdat ydat zdat adat cdat @code{val} ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Surf3A (@code{float} val, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Surf3A (@code{float} val, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_surf3a_val (@code{HMGL} gr, @code{float} val, @code{HCDT} a, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_surf3a_xyz_val (@code{HMGL} gr, @code{float} val, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws isosurface plot for 3d array specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) at @var{a}(x,y,z)=@var{val}. It is mostly the same as @ref{surf3} function but the color of isosurface depends on values of array @var{c}. If string contain @samp{#} then wire plot is produced. See also @ref{surf3}, @ref{surfc}, @ref{surf3a}. @sref{Surf3C sample} +@end deftypefn + +@deftypefn {MGL command} {} surf3a adat cdat ['sch'=''] +@deftypefnx {MGL command} {} surf3a xdat ydat zdat adat cdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Surf3A (@code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Surf3A (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_surf3a (@code{HMGL} gr, @code{HCDT} a, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_surf3a_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@end ifclear +Draws @var{num}-th uniformly distributed in color range isosurfaces for 3d data. At this array @var{c} can be vector with values of transparency and @var{num}=@var{c}.nx. In opposite case @var{num} is equal to parameter @var{value} in options @var{opt} (default is 3). +@end deftypefn + +@anchor{tiles} +@deftypefn {MGL command} {} tiles zdat rdat ['sch'=''] +@deftypefnx {MGL command} {} tiles xdat ydat zdat rdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} TileS (@code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} TileS (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}r, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_tiles (@code{HMGL} gr, @code{HCDT} z, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_tiles_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} r, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws horizontal tiles for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@}. It is mostly the same as @ref{tile} but the size of tiles is determined by @var{r} array. This is some kind of ``transparency'' useful for exporting to EPS files. Tiles is plotted for each z slice of the data. See also @ref{surfa}, @ref{tile}. @sref{TileS sample} +@end deftypefn + +@anchor{map} +@deftypefn {MGL command} {} map udat vdat ['sch'=''] +@deftypefnx {MGL command} {} map xdat ydat udat vdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Map (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Map (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_map (@code{HMGL} gr, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_map_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws mapping plot for matrices @{@var{ax}, @var{ay} @} which parametrically depend on coordinates @var{x}, @var{y}. The initial position of the cell (point) is marked by color. Height is proportional to Jacobian(ax,ay). This plot is like Arnold diagram ???. If string @var{sch} contain symbol @samp{.} then the color ball at matrix knots are drawn otherwise face is drawn. @sref{Map sample} +@end deftypefn + +@anchor{stfa} +@deftypefn {MGL command} {} stfa re im @code{dn} ['sch'=''] +@deftypefnx {MGL command} {} stfa xdat ydat re im @code{dn} ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} STFA (@code{const mglData &}re, @code{const mglData &}im, @code{int} dn, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} STFA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}re, @code{const mglData &}im, @code{int} dn, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_stfa (@code{HMGL} gr, @code{HCDT} re, @code{HCDT} im, @code{int} dn, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_stfa_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} re, @code{HCDT} im, @code{int} dn, @code{const char *}sch, @code{const char *}opt) +@end ifclear +Draws spectrogram of complex array @var{re}+i*@code{im} for Fourier size of @var{dn} points at plane @var{z}=@var{Min}.z. For example in 1D case, result is density plot of data @math{res[i,j]=|\sum_d^dn exp(I*j*d)*(re[i*dn+d]+I*im[i*dn+d])|/dn} with size @{int(nx/dn), dn, ny@}. At this array @var{re}, @var{im} parametrically depend on coordinates @var{x}, @var{y}. The size of @var{re} and @var{im} must be the same. The minor dimensions of arrays @var{x}, @var{y}, @var{re} should be equal. Arrays @var{x}, @var{y} can be vectors (not matrix as @var{re}). @sref{STFA sample} @end deftypefn -@c ================================================================== -@node Error, BoxPlot, TextMark, 1D plotting -@subsection Error -@cindex Error -These functions draw error boxes at points @{@var{x}[i], @var{y}[i]@} on plane @var{z} = @var{zVal} (by default @var{z}=@var{Min.z}). This can be useful, for example, in experimental points, or to show numeric error or some estimations and so on. The plots are drawn for each row if one of the data is the matrix. By any case the sizes of 1st dimension @strong{must be equal} for all arrays @code{x.nx=y.nx=z.nx=r.nx}. String @var{pen} specifies the color and style of line and marks (@pxref{Line styles}). By default (@code{pen=""}) solid line with color from palette is used (@pxref{Palette and colors}). See also @ref{Plot}. @sref{Error sample} +@c ################################################################## +@node Vector fields, Other plotting, Dual plotting, MathGL core +@section Vector fields -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Error (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ex, @code{const mglData &}ey, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_error_exy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ex, @code{const HMDT} ey, @code{const char *}pen) -Draws a error box @{@var{ex}, @var{ey}@} in point position @{@var{x}, @var{y}@}. -@end deftypefn +@cindex Traj +@cindex Vect +@cindex Dew +@cindex Flow +@cindex FlowP +@cindex Pipe -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Error (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ey, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_error_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ey, @code{const char *}pen) -Draws a error box @var{ey} (along only one direction) in point position @{@var{x}, @var{y}@}. +These functions perform plotting of 2D and 3D vector fields. There are 5 generally different types of vector fields representations: simple vector field (Vect), vectors along the curve (Traj), vector field by dew-drops (Dew), flow threads (Flow, FlowP), flow pipes (Pipe). By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{ax} should be equal. The size of @var{ax}, @var{ay} and @var{az} must be equal. Arrays @var{x}, @var{y}, @var{z} can be vectors (not matrices as @var{ax}). String @var{sch} sets the color scheme (@pxref{Color scheme}) for plot. Previous color scheme is used by default. String @var{opt} contain command options (@pxref{Command options}). + +@anchor{traj} +@deftypefn {MGL command} {} traj xdat ydat udat vdat ['sch'=''] +@deftypefnx {MGL command} {} traj xdat ydat zdat udat vdat wdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Traj (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Traj (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_traj_xyz (@code{HMGL} gr, @code{HCDT}x, @code{HCDT}y, @code{HCDT}z, @code{HCDT}ax, @code{HCDT}ay, @code{HCDT}az, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_traj_xy (@code{HMGL} gr, @code{HCDT}x, @code{HCDT}y, @code{HCDT}ax, @code{HCDT}ay, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws vectors @{@var{ax}, @var{ay}, @var{az}@} along a curve @{@var{x}, @var{y}, @var{z}@}. The length of arrows are proportional to @math{\sqrt@{ax^2+ay^2+az^2@}}. String @var{pen} specifies the color (@pxref{Line styles}). By default (@code{pen=""}) color from palette is used (@pxref{Palette and colors}). Parameter @var{len} set the vector length factor (if non-zero) or vector length to be proportional the distance between curve points (if @var{len}=0). The minor sizes of all arrays must be equal and large 2. The plots are drawn for each row if one of the data is the matrix. See also @ref{vect}. @sref{Traj sample} +@end deftypefn + +@anchor{vect} +@deftypefn {MGL command} {} vect udat vdat ['sch'=''] +@deftypefnx {MGL command} {} vect xdat ydat udat vdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Vect (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Vect (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_vect_2d (@code{HMGL} gr, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_vect_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws plane vector field plot for the field @{@var{ax}, @var{ay}@} depending parametrically on coordinates @var{x}, @var{y} at level @var{z}=@var{Min}.z. The length and color of arrows are proportional to @math{\sqrt@{ax^2+ay^2@}}. The number of arrows depend on @ref{meshnum}. Parameter @var{value} in options is bitwise flag for setup the hachures (arrows): @code{MGL_VEC_COL=1} for drawing bi-color arrow, @code{MGL_VEC_LEN=2} for drawing fixed length arrows, @code{MGL_VEC_END=4} for drawing arrows to the cell point, @code{MGL_VEC_MID=8} for drawing arrows with center at cell point, @code{MGL_VEC_DOT=16} for drawing hachures with dots instead of arrows, @code{MGL_VEC_GRD=32} for enabling color gradient along arrows. See also @ref{flow}, @ref{dew}. @sref{Vect sample} +@end deftypefn + +@deftypefn {MGL command} {} vect udat vdat wdat ['sch'=''] +@deftypefnx {MGL command} {} vect xdat ydat zdat udat vdat wdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Vect (@code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Vect (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_vect_3d (@code{HMGL} gr, @code{HCDT} ax, @code{HCDT} ay, @code{HCDT} az, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_vect_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} ax, @code{HCDT} ay, @code{HCDT} az, @code{const char *}sch, @code{const char *}opt) +@end ifclear +This is 3D version of the first functions. Here arrays @var{ax}, @var{ay}, @var{az} must be 3-ranged tensors with equal sizes and the length and color of arrows is proportional to @math{\sqrt@{ax^2+ay^2+az^2@}}. @sref{Vect 3D sample} @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Error (@code{const mglData &}y, @code{const mglData &}ey, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_error (@code{HMGL} gr, @code{const HMDT} y, @code{const HMDT} ey, @code{const char *}pen) -Draws a error box @var{ey} (along only one direction) in point position @{@var{x}, @var{y}@}, where @var{x}[i] values are equidistantly distributed in interval [@var{Min}.x, @var{Max}.x]. +@anchor{dew} +@deftypefn {MGL command} {} dew udat vdat ['sch'=''] +@deftypefnx {MGL command} {} dew xdat ydat udat vdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Dew (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Dew (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_dew (@code{HMGL} gr, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_dew_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws dew-drops for plane vector field @{@var{ax}, @var{ay}@} depending parametrically on coordinates @var{x}, @var{y} at level @var{z}=@var{Min}.z. Note that this is very expensive plot in memory usage and creation time! The color of drops is proportional to @math{\sqrt@{ax^2+ay^2@}}. The number of drops depend on @ref{meshnum}. See also @ref{vect}. @sref{Dew sample} +@end deftypefn + +@anchor{flow} +@deftypefn {MGL command} {} flow udat vdat ['sch'=''] +@deftypefnx {MGL command} {} flow xdat ydat udat vdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Flow (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Flow (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_flow_2d (@code{HMGL} gr, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_flow_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws flow threads for the plane vector field @{@var{ax}, @var{ay}@} parametrically depending on coordinates @var{x}, @var{y} at level @var{z} = @var{Min}.z. Number of threads is proportional to @var{value} option (default is 5). If @var{value}<0 then threads start only from edges of axis range. Warm color corresponds to normal flow (like attractor). Cold one corresponds to inverse flow (like source). If string @var{sch} contain symbol @samp{v} then arrows are drawn on flow threads. See also @ref{pipe}, @ref{vect}. @sref{Flow sample} +@end deftypefn + +@deftypefn {MGL command} {} flow udat vdat wdat ['sch'=''] +@deftypefnx {MGL command} {} flow xdat ydat zdat udat vdat wdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Flow (@code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Flow (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_flow_3d (@code{HMGL} gr, @code{HCDT} ax, @code{HCDT} ay, @code{HCDT} az, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_flow_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} ax, @code{HCDT} ay, @code{HCDT} az, @code{const char *}sch, @code{const char *}opt) +@end ifclear +This is 3D version of the first functions. Here arrays @var{ax}, @var{ay}, @var{az} must be 3-ranged tensors with equal sizes and the color of line is proportional to @math{\sqrt@{ax^2+ay^2+az^2@}}. @sref{Flow 3D sample} @end deftypefn -@c ================================================================== -@node BoxPlot, , Error, 1D plotting -@subsection BoxPlot -@cindex BoxPlot - -These functions draw boxplot (also known as a box-and-whisker diagram) at points @var{x}[i] on plane @var{z} = @var{zVal} (by default @var{z}=@var{Min.z}). This is five-number summaries of data @var{a}[i,j] (minimum, lower quartile (Q1), median (Q2), upper quartile (Q3) and maximum) along second (j-th) direction. The sizes of 1st dimension @strong{must be equal} for all arrays @code{x.nx=a.nx}. String @var{pen} specifies the color and style of line (@pxref{Line styles}). By default (@code{pen=""}) solid line with color from palette is used (@pxref{Palette and colors}). See also @ref{Plot}, @ref{Error}, @ref{Bars}, @ref{Default sizes}. @sref{BoxPlot sample} - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} BoxPlot (@code{const mglData &}x, @code{const mglData &}a, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_boxplot_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} a, @code{const char *}pen) -Draws a boxplot with specified values of coordinate @var{x}[i]. +@deftypefn {MGL command} {} flow @code{x0 y0} udat vdat ['sch'=''] +@deftypefnx {MGL command} {} flow @code{x0 y0} xdat ydat udat vdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_flowp_2d (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_flowp_xy (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{HCDT} x, @code{HCDT} y, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The same as first one (@ref{flow}) but draws single flow thread starting from point @var{p0}=@{@var{x0},@var{y0},@var{z0}@}. +@end deftypefn + +@deftypefn {MGL command} {} flow @code{x0 y0 z0} udat vdat wdat ['sch'=''] +@deftypefnx {MGL command} {} flow @code{x0 y0 z0} xdat ydat zdat udat vdat wdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_flowp_3d (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{HCDT} ax, @code{HCDT} ay, @code{HCDT} az, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_flowp_xyz (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} ax, @code{HCDT} ay, @code{HCDT} az, @code{const char *}sch, @code{const char *}opt) +@end ifclear +This is 3D version of the previous functions. +@end deftypefn + +@anchor{grad} +@deftypefn {MGL command} {} grad pdat ['sch'=''] +@deftypefnx {MGL command} {} grad xdat ydat pdat ['sch'=''] +@deftypefnx {MGL command} {} grad xdat ydat zdat pdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Grad (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Grad (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Grad (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}phi, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_grad (@code{HMGL} gr, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_grad_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_grad_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws gradient lines for scalar field @var{phi}[i,j,k] specified parametrically @{@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]@}. Number of lines is proportional to @var{value} option (default is 5). If @var{value}<0 then lines start only from edges of axis range. Warm color corresponds to normal flow (like minimum). Cold one corresponds to inverse flow (like maximum). If string @var{sch} contain symbol @samp{v} then arrows are drawn on flow threads. See also @ref{dens3}, @ref{cont3}, @ref{flow}. +@end deftypefn + +@anchor{pipe} +@deftypefn {MGL command} {} pipe udat vdat ['sch'='' @code{r0=0.05}] +@deftypefnx {MGL command} {} pipe xdat ydat udat vdat ['sch'='' @code{r0=0.05}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Pipe (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Pipe (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_pipe_2d (@code{HMGL} gr, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{float} r0, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_pipe_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} ax, @code{HCDT} ay, @code{const char *}sch, @code{float} r0, @code{const char *}opt) +@end ifclear +The function draws flow pipes for the plane vector field @{@var{ax}, @var{ay}@} parametrically depending on coordinates @var{x}, @var{y} at level @var{z} = @var{Min}.z. Number of pipes is proportional to @var{value} option (default is 5). If @var{value}<0 then pipes start only from edges of axis range. The color of lines is proportional to @math{\sqrt@{ax^2+ay^2@}}. Warm color corresponds to normal flow (like attractor). Cold one corresponds to inverse flow (like source). Parameter @var{r0} set the base pipe radius. If @var{r0}<0 then pipe radius is inverse proportional to amplitude. The size of @var{ax} and @var{ay} must be equal. The minor dimensions of arrays @var{x}, @var{y} and @var{ax} must be equal too. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{ax}). The vector field is plotted for each z slice of @var{ax}, @var{ay}. See also @ref{flow}, @ref{vect}. @sref{Pipe sample} +@end deftypefn + +@deftypefn {MGL command} {} pipe udat vdat wdat ['sch'='' @code{r0=0.05}] +@deftypefnx {MGL command} {} pipe xdat ydat zdat udat vdat wdat ['sch'='' @code{r0=0.05}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Pipe (@code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Pipe (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_pipe_3d (@code{HMGL} gr, @code{HCDT} ax, @code{HCDT} ay, @code{HCDT} az, @code{const char *}sch, @code{float} r0, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_pipe_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} ax, @code{HCDT} ay, @code{HCDT} az, @code{const char *}sch, @code{float} r0, @code{const char *}opt) +@end ifclear +This is 3D version of the first functions. Here arrays @var{ax}, @var{ay}, @var{az} must be 3-ranged tensors with equal sizes and the color of line is proportional to @math{\sqrt@{ax^2+ay^2+az^2@}}. @sref{Pipe 3D sample} @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} BoxPlot (@code{const mglData &}a, @code{const char *}pen=@code{""}) -@deftypefnx {C function} @code{void} mgl_boxplot (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}pen) -Draws a boxplot with @var{x}[i] values equidistantly distributed in interval [@var{Min}.x, @var{Max}.x]. -@end deftypefn @c ################################################################## -@node 2D plotting, 3D plotting, 1D plotting, MathGL core -@section 2D plotting - -These functions perform plotting of 2D data. 2D means that data depend from 2 independent parameters like matrix @math{f(x_i,y_j), i=1...n, j=1...m}. There are several generally different types of data representations: simple mesh lines plot (Mesh), surface plot (Surf), surface plot by boxes (Boxs), surface plot by tiles (Tile), waterfall-like plot (Fall), belt plot (Belt), density plot (Dens), contour lines plot (Cont), solid contours plot (ContF) and its rotational figure (Axial). Cont, ContF and Axial functions have variants for automatic and manual selection of level values for contours. Also there are functions for plotting data grid lines according to the data format (Grid) for enhancing density or contour plots. Each type of plotting has similar interface. There are 2 kind of versions which handle the arrays of data and coordinates or only single data array. Parameters of color scheme are specified by the string argument. @xref{Color scheme}. @sref{2D plot sample} - -@menu -* Mesh:: -* Fall:: -* Belt:: -* Surf:: -* Boxs:: -* Tile:: -* Dens:: -* Cont:: -* ContF:: -* ContD:: -* Axial:: -* Grad:: -* Grid:: -@end menu - -@c ================================================================== -@node Mesh, Fall, , 2D plotting -@subsection Mesh -@cindex Mesh +@node Other plotting, Nonlinear fitting, Vector fields, MathGL core +@section Other plotting -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Mesh (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_mesh_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch) -The function draws mesh lines for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Mesh lines are plotted for each z slice of the data. See also @ref{Surf}, @ref{Fall}, MeshNum (@pxref{Other settings}), @ref{Cont}, @ref{Tens}. @sref{Mesh sample} +@cindex DensXYZ +@cindex ContXYZ +@cindex ContFXYZ +@cindex Dots +@cindex Crust +@cindex TriPlot +@cindex TriCont +@cindex QuadPlot +@cindex Plots by formula + +These functions perform miscellaneous plotting. There is unstructured data points plots (Dots), surface reconstruction (Crust), surfaces on the triangular mesh (TriPlot), textual formula plotting (Plots by formula), data plots at edges (Dens[XYZ], Cont[XYZ], ContF[XYZ]), simple plot (SimplePlot). Each type of plotting has similar interface. There are 2 kind of versions which handle the arrays of data and coordinates or only single data array. Parameters of color scheme are specified by the string argument. @xref{Color scheme}. + +@anchor{densz} @anchor{densy} @anchor{densx} @anchor{DensXYZ} +@deftypefn {MGL command} {} densx dat ['sch'='' @code{sval=nan}] +@deftypefnx {MGL command} {} densy dat ['sch'='' @code{sval=nan}] +@deftypefnx {MGL command} {} densz dat ['sch'='' @code{sval=nan}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} DensX (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} DensY (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} DensZ (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_dens_x (@code{HMGL} gr, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_dens_y (@code{HMGL} gr, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_dens_z (@code{HMGL} gr, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +@end ifclear +These plotting functions draw density plot in x, y, or z plain. If @var{a} is a tensor (3-dimensional data) then interpolation to a given @var{sVal} is performed. These functions are useful for creating projections of the 3D data array to the bounding box. For example, code like +@example +gr->DensX(c.Sum("x"),"BbcyrR",-1); +gr->DensY(c.Sum("y"),"",1); +gr->DensZ(c.Sum("z"),"",-1); +@end example +will produce the following picture. See also @ref{ContXYZ}, @ref{ContFXYZ}, @ref{dens}, @ref{Data manipulation}. @sref{Dens projection sample} +@end deftypefn + +@anchor{contz} @anchor{conty} @anchor{contx} @anchor{ContXYZ} +@deftypefn {MGL command} {} contx dat ['sch'='' @code{sval=nan}] +@deftypefnx {MGL command} {} conty dat ['sch'='' @code{sval=nan}] +@deftypefnx {MGL command} {} contz dat ['sch'='' @code{sval=nan}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} ContX (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} ContY (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} ContZ (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_cont_x (@code{HMGL} gr, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_cont_y (@code{HMGL} gr, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_cont_z (@code{HMGL} gr, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +@end ifclear +These plotting functions draw contour lines in x, y, or z plain. If @var{a} is a tensor (3-dimensional data) then interpolation to a given @var{sVal} is performed. These functions are useful for creating projections of the 3D data array to the bounding box. For example, code like +@example +gr->ContX(c.Sum("x"),"BbcyrR",-1); +gr->ContY(c.Sum("y"),0,1); +gr->ContZ(c.Sum("z"),0,-1); +@end example +will produce the following picture. See also @ref{ContFXYZ}, @ref{DensXYZ}, @ref{cont}, @ref{Data manipulation}. @sref{Cont projection sample} +@end deftypefn + +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} ContX (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} ContY (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} ContZ (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_cont_x_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_cont_y_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_cont_z_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +The same as previous with manual contour levels. +@end deftypefn +@end ifclear + +@anchor{contfz} @anchor{contfy} @anchor{contfx} @anchor{ContFXYZ} +@deftypefn {MGL command} {} contfx dat ['sch'='' @code{sval=nan}] +@deftypefnx {MGL command} {} contfy dat ['sch'='' @code{sval=nan}] +@deftypefnx {MGL command} {} contfz dat ['sch'='' @code{sval=nan}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} ContFX (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} ContFY (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} ContFZ (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_contf_x (@code{HMGL} gr, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_contf_y (@code{HMGL} gr, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_contf_z (@code{HMGL} gr, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +@end ifclear +These plotting functions draw solid contours in x, y, or z plain. If @var{a} is a tensor (3-dimensional data) then interpolation to a given @var{sVal} is performed. These functions are useful for creating projections of the 3D data array to the bounding box. For example, code like +@example +gr->ContFX(c.Sum("x"),"BbcyrR",-1); +gr->ContFY(c.Sum("y"),0,1); +gr->ContFZ(c.Sum("z"),0,-1); +@end example +will produce the following picture. See also @ref{ContFXYZ}, @ref{DensXYZ}, @ref{cont}, @ref{Data manipulation}. @sref{Cont projection sample} +@end deftypefn + +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} ContFX (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} ContFY (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} ContFZ (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_contf_x_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_contf_y_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_contf_z_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} a, @code{const char *}stl, @code{float} sVal, @code{const char *}opt) +The same as previous with manual contour levels. +@end deftypefn +@end ifclear + +@anchor{fplot} +@deftypefn {MGL command} {} fplot 'y(x)' ['pen'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} FPlot (@code{const char *}eqY, @code{const char *}pen=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_fplot (@code{HMGL} gr, @code{const char *}eqY, @code{const char *}pen, @code{const char *}opt) +@end ifclear +Draws command function @samp{y(x)} at plane @var{z}=@var{Min}.z where @samp{x} variable is changed in @code{xrange}. You do not need to create the data arrays to plot it. See also @ref{plot}. +@end deftypefn + +@deftypefn {MGL command} {} fplot 'x(t)' 'y(t)' 'z(t)' ['pen'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} FPlot (@code{const char *}eqX, @code{const char *}eqY, @code{const char *}eqZ, @code{const char *}pen, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_fplot_xyz (@code{HMGL} gr, @code{const char *}eqX, @code{const char *}eqY, @code{const char *}eqZ, @code{const char *}pen, @code{const char *}opt) +@end ifclear +Draws command parametrical curve @{@samp{x(t)}, @samp{y(t)}, @samp{z(t)}@} where @samp{t} variable is changed in range [0, 1]. You do not need to create the data arrays to plot it. See also @ref{plot}. +@end deftypefn + +@anchor{fsurf} +@deftypefn {MGL command} {} fsurf 'z(x,y)' ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} FSurf (@code{const char *}eqZ, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}); +@deftypefnx {C function} @code{void} mgl_fsurf (@code{HMGL} gr, @code{const char *}eqZ, @code{const char *}sch, @code{const char *}opt); +@end ifclear +Draws command surface for function @samp{z(x,y)} where @samp{x}, @samp{y} variable are changed in @code{xrange, yrange}. You do not need to create the data arrays to plot it. See also @ref{surf}. +@end deftypefn + +@deftypefn {MGL command} {} fsurf 'x(u,v)' 'y(u,v)' 'z(u,v)' ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} FSurf (@code{const char *}eqX, @code{const char *}eqY, @code{const char *}eqZ, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_fsurf_xyz (@code{HMGL} gr, @code{const char *}eqX, @code{const char *}eqY, @code{const char *}eqZ, @code{const char *}sch, @code{const char *}opt) +@end ifclear +Draws command parametrical surface @{@samp{x(u,v)}, @samp{y(u,v)}, @samp{z(u,v)}@} where @samp{u}, @samp{v} variable are changed in range [0, 1]. You do not need to create the data arrays to plot it. See also @ref{surf}. +@end deftypefn + +@anchor{triplot} +@deftypefn {MGL command} {} triplot idat xdat ydat ['sch'=''] +@deftypefnx {MGL command} {} triplot idat xdat ydat zdat ['sch'=''] +@deftypefnx {MGL command} {} triplot idat xdat ydat zdat cdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} TriPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} TriPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} TriPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_triplot_xy (@code{HMGL} gr, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_triplot_xyz (@code{HMGL} gr, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_triplot_xyzc (@code{HMGL} gr, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws the surface of triangles. Triangle vertexes are set by indexes @var{id} of data points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string contain @samp{#} then wire plot is produced. First dimensions of @var{id} must be 3 or greater. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. Parameter @var{c} set the colors of triangles (if @var{id}.ny=@var{c}.nx) or colors of vertexes (if @var{x}.nx=@var{c}.nx). See also @ref{dots}, @ref{crust}, @ref{quadplot}. +@end deftypefn + +@anchor{tricont} +@deftypefn {MGL command} {} tricont vdat idat xdat ydat zdat cdat ['sch'=''] +@deftypefnx {MGL command} {} tricont vdat idat xdat ydat zdat ['sch'=''] +@deftypefnx {MGL command} {} tricont idat xdat ydat zdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} TriCont (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} TriCont (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} TriContV (@code{const mglData &}v, @code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} TriContV (@code{const mglData &}v, @code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_tricont_xyzc (@code{HMGL} gr, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_tricont_xyz (@code{HMGL} gr, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_tricont_xyzcv (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_tricont_xyzv (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws contour lines for surface of triangles at @var{z}=@var{v}[k] (or at @var{z} = @var{Min}.z if @var{sch} contain symbol @samp{_}). Triangle vertexes are set by indexes @var{id} of data points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Contours are plotted for @var{z}[i,j]=@var{v}[k] where @var{v}[k] are values of data array @var{v}. String @var{sch} sets the color scheme. Previous color scheme is used by default. Array @var{c} (if specified) is used for contour coloring. First dimensions of @var{id} must be 3 or greater. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. Parameter @var{c} set the colors of triangles (if @var{id}.ny=@var{c}.nx) or colors of vertexes (if @var{x}.nx=@var{c}.nx). See also @ref{triplot}, @ref{cont}. +@end deftypefn + +@anchor{quadplot} +@deftypefn {MGL command} {} quadplot idat xdat ydat ['sch'=''] +@deftypefnx {MGL command} {} quadplot idat xdat ydat zdat ['sch'=''] +@deftypefnx {MGL command} {} quadplot idat xdat ydat zdat cdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} QuadPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} QuadPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} QuadPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_quadplot_xy (@code{HMGL} gr, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_quadplot_xyz (@code{HMGL} gr, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_quadplot_xyzc (@code{HMGL} gr, @code{HCDT} id, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} c, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws the surface of quadrangles. Quadrangles vertexes are set by indexes @var{id} of data points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string contain @samp{#} then wire plot is produced. First dimensions of @var{id} must be 4 or greater. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. Parameter @var{c} set the colors of quadrangles (if @var{id}.ny=@var{c}.nx) or colors of vertexes (if @var{x}.nx=@var{c}.nx). See also @ref{triplot}. +@end deftypefn + +@anchor{dots} +@deftypefn {MGL command} {} dots xdat ydat zdat ['sch'=''] +@deftypefnx {MGL command} {} dots xdat ydat zdat adat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Dots (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Dots (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_dots (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_dots_a (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws the arbitrary placed points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If array @var{a} is specified then it define the transparency of dots. Arrays @var{x}, @var{y}, @var{z}, @var{a} must have equal sizes. See also @ref{crust}, @ref{mark}, @ref{plot}. @sref{Dots sample} +@end deftypefn + +@anchor{crust} +@deftypefn {MGL command} {} crust xdat ydat zdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Crust (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_crust (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function reconstruct and draws the surface for arbitrary placed points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string contain @samp{#} then wire plot is produced. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. See also @ref{dots}, @ref{triplot}. @sref{Crust sample} @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Mesh (@code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_mesh (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn +@c ################################################################## +@node Nonlinear fitting, Data manipulation, Other plotting, MathGL core +@section Nonlinear fitting +@cindex Fit +@cindex FitS +@cindex PutsFit +@cindex mglFitPnts +@cindex Fit2 +@cindex Fit3 -@c ================================================================== -@node Fall, Belt, Mesh, 2D plotting -@subsection Fall -@cindex Fall +These functions fit data to formula. Fitting goal is to find formula parameters for the best fit the data points, i.e. to minimize the sum @math{\sum_i (f(x_i, y_i, z_i) - a_i)^2/s_i^2}. At this, approximation function @samp{f} can depend only on one argument @samp{x} (1D case), on two arguments @samp{x,y} (2D case) and on three arguments @samp{x,y,z} (3D case). The function @samp{f} also may depend on parameters. Normally the list of fitted parameters is specified by @var{var} string (like, @samp{abcd}). Usually user should supply initial values for fitted parameters by @var{ini} variable. But if he/she don't supply it then the zeros are used. Parameter @var{print}=@code{true} switch on printing the found coefficients to @var{Message} (@pxref{Error handling}). -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Fall (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_fall_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch) -The function draws fall lines for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@}. This plot can be used for plotting several curves shifted in depth one from another. String @var{sch} sets the color scheme. Previous color scheme is used by default. If @var{sch} contain @samp{x} then lines are drawn along x-direction else (by default) lines are drawn along y-direction. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Fall lines are plotted for each z slice of the data. See also @ref{Belt}, @ref{Mesh}, @ref{Tens}, MeshNum (@pxref{Other settings}). @sref{Fall sample} +Functions Fit() and FitS() do not draw the obtained data themselves. They fill the data @var{fit} by formula @samp{f} with found coefficients and return it. At this, the @samp{x,y,z} coordinates are equidistantly distributed in the axis range. Number of points in @var{fit} is selected as maximal value of @var{fit} size and the value of @var{mglFitPnts}. Note, that this functions use GSL library and do something only if MathGL was compiled with GSL support. @sref{Fitting sample} + +@anchor{fits} +@deftypefn {MGL command} {} fits res adat sdat 'func' 'var' [ini=0] +@deftypefnx {MGL command} {} fits res xdat adat sdat 'func' 'var' [ini=0] +@deftypefnx {MGL command} {} fits res xdat ydat adat sdat 'func' 'var' [ini=0] +@deftypefnx {MGL command} {} fits res xdat ydat zdat adat sdat 'func' 'var' [ini=0] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{mglData} FitS (@code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} FitS (@code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} FitS (@code{const mglData &}x, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} FitS (@code{const mglData &}x, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} FitS (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} FitS (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} FitS (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} FitS (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{HMDT} mgl_fit_ys (@code{HMGL} gr, @code{HCDT} a, @code{HCDT} s, @code{const char *}func, @code{const char *}var, @code{HMDT} ini, @code{const char *}opt) +@deftypefnx {C function} @code{HMDT} mgl_fit_xys (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} a, @code{HCDT} s, @code{const char *}func, @code{const char *}var, @code{HMDT} ini, @code{const char *}opt) +@deftypefnx {C function} @code{HMDT} mgl_fit_xyzs (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} a, @code{HCDT} s, @code{const char *}func, @code{const char *}var, @code{HMDT} ini, @code{const char *}opt) +@deftypefnx {C function} @code{HMDT} mgl_fit_xyzas (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{HCDT} s, @code{const char *}func, @code{const char *}var, @code{HMDT} ini, @code{const char *}opt) +@end ifclear +Fit data along x-, y- and z-directions for array specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) with weight factor @var{s}[i,j,k]. +@end deftypefn + +@anchor{fit} +@deftypefn {MGL command} {} fit res adat sdat 'func' 'var' [ini=0] +@deftypefnx {MGL command} {} fit res xdat adat sdat 'func' 'var' [ini=0] +@deftypefnx {MGL command} {} fit res xdat ydat adat sdat 'func' 'var' [ini=0] +@deftypefnx {MGL command} {} fit res xdat ydat zdat adat sdat 'func' 'var' [ini=0] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{mglData} Fit (@code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} Fit (@code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} Fit (@code{const mglData &}x, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} Fit (@code{const mglData &}x, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} Fit (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} Fit (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} Fit (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} Fit (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{HMDT} mgl_fit_y (@code{HMGL} gr, @code{HCDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini, @code{const char *}opt) +@deftypefnx {C function} @code{HMDT} mgl_fit_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini, @code{const char *}opt) +@deftypefnx {C function} @code{HMDT} mgl_fit_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini, @code{const char *}opt) +@deftypefnx {C function} @code{HMDT} mgl_fit_xyza (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini, @code{const char *}opt) +@end ifclear +Fit data along x-, y- and z-directions for array specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) with weight factor 1. +@end deftypefn + + +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{mglData} Fit2 (@code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} Fit2 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} Fit3 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} Fit3 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{HMDT} mgl_fit_2 (@code{HMGL} gr, @code{HCDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini, @code{const char *}opt) +@deftypefnx {C function} @code{HMDT} mgl_fit_3 (@code{HMGL} gr, @code{HCDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini, @code{const char *}opt) +Fit data along all directions for 2d or 3d arrays @var{a} with @var{s}=1 and @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. +@end deftypefn +@end ifclear + +@anchor{putsfit} +@deftypefn {MGL command} {} putsfit @code{x y} ['pre'='' 'fnt'='' @code{size=-1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} PutsFit (@code{mglPoint} p, @code{const char *}prefix=@code{""}, @code{const char *}font=@code{""}, @code{float} size=@code{-1}) +@deftypefnx {C function} @code{void} mgl_puts_fit (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const char *}prefix, @code{const char *}font, @code{float} size) +@end ifclear +Print last fitted formula with found coefficients (as numbers) at position @var{p0}. The string @var{prefix} will be printed before formula. All other parameters are the same as in @ref{Text printing}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Fall (@code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_fall (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{const char *}GetFit () +@deftypefnx {C function} @code{const char *} mgl_get_fit (@code{HMGL} gr) +Get last fitted formula with found coefficients (as numbers). @end deftypefn +@end ifclear -@c ================================================================== -@node Belt, Surf, Fall, 2D plotting -@subsection Belt -@cindex Belt -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Belt (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_belt_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch) -The function draws belts for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@}. This plot can be used as 3d generalization of Plot (@pxref{Plot}). String @var{sch} sets the color scheme. Previous color scheme is used by default. If @var{sch} contain @samp{x} then belts are drawn along x-direction else (by default) belts are drawn along y-direction. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Belts are plotted for each z slice of the data. See also @ref{Fall}, @ref{Surf}, @ref{Plot}, MeshNum (@pxref{Other settings}). @sref{Belt sample} -@end deftypefn +@c ################################################################## +@node Data manipulation, IDTF functions, Nonlinear fitting, MathGL core +@section Data manipulation +@cindex Hist -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Belt (@code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_belt (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. +@deftypefn {MGL command} {} hist @sc{res} xdat adat +@deftypefnx {MGL command} {} hist @sc{res} xdat ydat adat +@deftypefnx {MGL command} {} hist @sc{res} xdat ydat zdat adat +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{mglData} Hist (@code{const mglData &}x, @code{const mglData &}a, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} Hist (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{mglData} Hist (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{HMDT} mgl_hist_x (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} a, @code{const char *}opt) +@deftypefnx {C function} @code{HMDT} mgl_hist_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} a, @code{const char *}opt) +@deftypefnx {C function} @code{HMDT} mgl_hist_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{const char *}opt) +@end ifclear +These functions make distribution (histogram) of data. They do not draw the obtained data themselves. These functions can be useful if user have data defined for random points (for example, after PIC simulation) and he want to produce a plot which require regular data (defined on grid(s)). The range for grids is always selected as axis range. Arrays @var{x}, @var{y}, @var{z} define the positions (coordinates) of random points. Array @var{a} define the data value. Number of points in output array @var{res} is selected as maximal value of @var{res} size and the value of @var{mglFitPnts}. +@end deftypefn + + +@deftypefn {MGL command} {} fill dat 'eq' +@deftypefnx {MGL command} {} fill dat 'eq' vdat +@deftypefnx {MGL command} {} fill dat 'eq' vdat wdat +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Fill (@code{mglData &}u, @code{const char *}eq, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Fill (@code{mglData &}u, @code{const char *}eq, @code{const mglData &}v, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Fill (@code{mglData &}u, @code{const char *}eq, @code{const mglData &}v, @code{const mglData &}w, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_data_fill_eq (@code{HMGL} gr, @code{HMDT} u, @code{const char *}eq, @code{HCDT}v, @code{HCDT}w, @code{const char *}opt) +@end ifclear +Fills the value of array according to the formula in string @var{eq}. Formula is an arbitrary expression depending on variables @samp{x}, @samp{y}, @samp{z}, @samp{u}, @samp{v}, @samp{w}. Coordinates @samp{x}, @samp{y}, @samp{z} are supposed to be normalized in axis range. Variable @samp{u} is the original value of the array. Variables @samp{v} and @samp{w} are values of arrays @var{v}, @var{w} which can be @code{NULL} (i.e. can be omitted). +@end deftypefn + +@deftypefn {MGL command} {} pde @sc{res} 'ham' ini_re ini_im [@code{dz=0.1 k0=100}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{mglData} PDE (@code{const char *}ham, @code{const mglData &}ini_re, @code{const mglData &}ini_im, @code{float} dz=@code{0.1}, @code{float} k0=@code{100}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{HMDT} mgl_pde_solve (@code{HMGL} gr, @code{const char *}ham, @code{HCDT} ini_re, @code{HCDT} ini_im, @code{float} dz, @code{float} k0, @code{const char *}opt) +@end ifclear +Solves equation du/dz = i*k0*@var{ham}(p,q,x,y,z,|u|)[u], where p=-i/k0*d/dx, q=-i/k0*d/dy are pseudo-differential operators. Parameters @var{ini_re}, @var{ini_im} specify real and imaginary part of initial field distribution. Parameters @var{Min}, @var{Max} set the bounding box for the solution. Note, that really this ranges are increased by factor 3/2 for purpose of reducing reflection from boundaries. Parameter @var{dz} set the step along evolutionary coordinate z. At this moment, simplified form of function @var{ham} is supported -- all ``mixed'' terms (like @samp{x*p}->x*d/dx) are excluded. For example, in 2D case this function is effectively @math{ham = f(p,z) + g(x,z,u)}. However commutable combinations (like @samp{x*q}->x*d/dy) are allowed. Here variable @samp{u} is used for field amplitude |u|. This allow one solve nonlinear problems -- for example, for nonlinear Shrodinger equation you may set @code{ham="p^2 + q^2 - u^2"}. You may specify imaginary part for wave absorption, like @code{ham = "p^2 + i*x*(x>0)"}, but only if dependence on variable @samp{i} is linear (i.e. @math{ham = hre+i*him}). @sref{PDE sample} @sref{PDE sample} @end deftypefn -@c ================================================================== -@node Surf, Boxs, Belt, 2D plotting -@subsection Surf -@cindex Surf - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_surf_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch) -The function draws surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string @var{sch} have symbol @samp{#} then grid lines are drawn. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Surface is plotted for each z slice of the data. See also @ref{Mesh}, @ref{Dens}, @ref{Belt}, @ref{Tile}, @ref{Boxs}, @ref{SurfC}, @ref{SurfA}. @sref{Surf sample} -@end deftypefn +@c ################################################################## +@node IDTF functions, , Data manipulation, MathGL core +@section IDTF functions +@cindex NewFrame +@cindex EndFrame +@cindex GetNumFrame -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf (@code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_surf (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn +These functions provide IDTF specific features. In all other cases they do nothing. -@c ================================================================== -@node Boxs, Tile, Surf, 2D plotting -@subsection Boxs -@cindex Boxs +@ifclear UDAV -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Boxs (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_boxs_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch) -The function draws vertical boxes for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Surface is plotted for each z slice of the data. See also @ref{Surf}, @ref{Dens}, @ref{Tile}, @ref{Step}. @sref{Boxs sample} +@deftypefn {Method on @code{mglGraph}} @code{void} VertexColor (@code{bool} enable) +Enables smooth color change. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Boxs (@code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_boxs (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. +@deftypefn {Method on @code{mglGraph}} @code{void} Compression (@code{bool} enable) +Gives smaller files, but quality degrades. @end deftypefn -@c ================================================================== -@node Tile, Dens, Boxs, 2D plotting -@subsection Tile -@cindex Tile - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Tile (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_tile_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch) -The function draws horizontal tiles for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@}. Such plot can be used as 3d generalization of Step (@pxref{Step}). String @var{sch} sets the color scheme. Previous color scheme is used by default. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Surface is plotted for each z slice of the data. See also @ref{Surf}, @ref{Boxs}, @ref{Step}, @ref{TileS}. @sref{Tile sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Tile (@code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_tile (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node Dens, Cont, Tile, 2D plotting -@subsection Dens -@cindex Dens - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Dens (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_dens_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) -The function draws density plot for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} at @var{z} = @var{zVal}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string @var{sch} have symbol @samp{#} then grid lines are drawn. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Surface is plotted for each z slice of the data. See also @ref{Surf}, @ref{Cont}, @ref{ContF}, @ref{Boxs}, @ref{Tile}, @ref{DensXYZ}. @sref{Dens sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Dens (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_dens (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node Cont, ContF, Dens, 2D plotting -@subsection Cont -@cindex Cont - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Cont (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_cont_xy_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) -The function draws contour lines for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} at @var{z} = @var{zVal} (or for @var{z=v}[k] if @code{zVal==NAN}). Contours are plotted for @var{z}[i,j]=@var{v}[k] where @var{v}[k] are values of data array @var{v}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string @var{sch} have symbol @samp{#} then grid lines are drawn. If string @var{sch} have symbol @samp{t} or @samp{T} then contour labels @var{v}[k] will be drawn below (or above) the contours. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Surface is plotted for each z slice of the data. See also @ref{Dens}, @ref{ContF}, @ref{ContD}, @ref{Axial}, @ref{ContXYZ}. @sref{Cont sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Cont (@code{const mglData &}v, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_cont__val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Cont (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{7}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_cont_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{int} num, @code{float} zVal) -The same as first one with vector @var{v} of @var{num}-th elements equidistantly distributed in range [@var{Cmin}, @var{Cmax}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Cont (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{7}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_cont (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch, @code{int} num, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node ContF, ContD, Cont, 2D plotting -@subsection ContF -@cindex ContF - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContF (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_contf_xy_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) -The function draws solid (or filled) contour lines for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} at @var{z} = @var{zVal} (or for @var{z=v}[k] if @code{zVal==NAN}). Contours are plotted for @var{z}[i,j]=@var{v}[k] where @var{v}[k] are values of data array @var{v} (must be @code{v.nx>2}). String @var{sch} sets the color scheme. Previous color scheme is used by default. If string @var{sch} have symbol @samp{#} then grid lines are drawn. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Surface is plotted for each z slice of the data. See also @ref{Dens}, @ref{Cont}, @ref{Axial}, @ref{ContFXYZ}. @sref{ContF sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContF (@code{const mglData &}v, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_contf_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContF (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{7}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_contf_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{int} num, @code{float} zVal) -The same as first one with vector @var{v} of @var{num}-th elements equidistantly distributed in range [@var{Cmin}, @var{Cmax}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContF (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{7}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_contf (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch, @code{int} num, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node ContD, Axial, ContF, 2D plotting -@subsection ContD -@cindex ContD - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContD (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_contd_xy_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) -The function draws solid (or filled) contour lines for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} at @var{z} = @var{zVal} (or for @var{z=v}[k] if @code{zVal==NAN}) with manual colors. Contours are plotted for @var{z}[i,j]=@var{v}[k] where @var{v}[k] are values of data array @var{v} (must be @code{v.nx>2}). String @var{sch} sets the contour colors: the color of k-th contour is determined by character @code{sch[k%strlen(sch)]}. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Surface is plotted for each z slice of the data. See also @ref{Dens}, @ref{Cont}, @ref{ContF}. @sref{ContD sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContD (@code{const mglData &}v, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_contd_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContD (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{7}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_contd_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{int} num, @code{float} zVal) -The same as first one with vector @var{v} of @var{num}-th elements equidistantly distributed in range [@var{Cmin}, @var{Cmax}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContD (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{7}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_contd (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch, @code{int} num, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node Axial, Grad, ContD, 2D plotting -@subsection Axial -@cindex Axial - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Axial (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_axial_xy_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch) -The function draws surface which is result of contour plot rotation for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@}. Contours are plotted for @var{z}[i,j]=@var{v}[k] where @var{v}[k] are values of data array @var{v}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string @var{sch} have symbol @samp{#} then wire plot is produced. If string contain symbols @samp{x}, @samp{y} or @samp{z} then rotation axis @var{AxialDir} (@pxref{Other settings}) will be set to specified direction. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Surface is plotted for each z slice of the data. See also @ref{Cont}, @ref{ContF}, @ref{Torus}, @ref{Surf3}. @sref{Axial sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Axial (@code{const mglData &}v, @code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_axial_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} z, @code{const char *}sch) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Axial (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) -@deftypefnx {C function} @code{void} mgl_axial_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{int} num) -The same as first one with vector @var{v} of @var{num}-th elements equidistantly distributed in range [@var{Cmin}, @var{Cmax}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Axial (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) -@deftypefnx {C function} @code{void} mgl_axial (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch, @code{int} num) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - - -@c ================================================================== -@node Grad, Grid, Axial, 2D plotting -@subsection Grad -@cindex Grad - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Grad (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}phi, @code{const char *}sch=@code{""}, @code{int} num=@code{5}) -@deftypefnx {C function} @code{void} mgl_grad_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{int} num, @code{float} zVal) -The function draws gradient lines for scalar field @var{phi}[i,j,k] specified parametrically @{@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. Number of lines is proportional to @var{num}. If @var{num}<0 then lines start from borders only. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{phi} should be equal @code{x.nx=phi.nx && y.nx=phi.ny && z.nx=phi.nz} or @code{x.nx=y.nx=z.nx=phi.nx && x.ny=y.ny=z.ny=phi.ny && x.nz=y.nz=z.nz=phi.nz}. Arrays @var{x}, @var{y} and @var{z} can be vectors (not matrices as @var{phi}). See also @ref{Dens3}, @ref{Cont3}, @ref{Flow}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Grad (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{5}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_grad_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{int} num, @code{float} zVal) -The function draws gradient lines for scalar field @var{phi}[i,j] specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{phi}[i,j]@} at @var{z} = @var{zVal}. String @var{sch} sets the color scheme. Previous color scheme is used by default. Number of lines is proportional to @var{num}. If @var{num}<0 then lines start from borders only. The minor dimensions of arrays @var{x}, @var{y}, @var{phi} should be equal @code{x.nx=phi.nx && y.nx=phi.ny} or @code{x.nx=y.nx=phi.nx && x.ny=y.ny=phi.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{phi}). Lines are plotted for each z slice of the data. See also @ref{Dens}, @ref{Cont}, @ref{ContF}, @ref{Flow}. @sref{Grad sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Grad (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{5}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_grad (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch, @code{int} num, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node Grid, , Grad, 2D plotting -@subsection Grid -@cindex Grid - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Grid (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_grid_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) -The function draws grid lines for density plot of surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} at @var{z} = @var{zVal}. String @var{sch} sets the color scheme. Previous color scheme is used by default. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Grid is plotted for each z slice of the data. See also @ref{Dens}, @ref{Cont}, @ref{ContF}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Grid (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_grid (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - - -@c ################################################################## -@node 3D plotting, Dual plotting, 2D plotting, MathGL core -@section 3D plotting - -These functions perform plotting of 3D data. 3D means that data depend from 3 independent parameters like matrix @math{f(x_i,y_j,z_k), i=1...n, j=1...m, k=1...l}. There are 5 generally different types of data representations: isosurface or surface of constant value (Surf3), density plot at slices (Dens3), contour lines plot at slices (Cont3), solid contours plot at slices (ContF3) and cloud-like plot (Cloud). Surf3, Cont3 and ContF3 functions have variants for automatic and manual selection of level values for surfaces/contours. Also there are functions for plotting data grid lines according to the data format (Grid3) for enhancing density or contour plots. Each type of plotting has similar interface. There are 2 kind of versions which handle the arrays of data and coordinates or only single data array. Parameters of color scheme are specified by the string argument. @xref{Color scheme}. @sref{3D plot sample} - -@menu -* Surf3:: -* Dens3:: -* Cont3:: -* ContF3:: -* Grid3:: -* Cloud:: -* Beam:: -@end menu - -@c ================================================================== -@node Surf3, Dens3, , 3D plotting -@subsection Surf3 -@cindex Surf3 - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf3 (@code{float} val, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}) -@deftypefnx {C function} @code{void} mgl_surf3_xyz_val (@code{HMGL} gr, @code{float} val, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl) -The function draws isosurface plot for 3d array specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) at @var{a}(x,y,z)=@var{val}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string contain @samp{#} then wire plot is produced. Arrays @var{x}, @var{y}, @var{z} can be vectors (not 3d arrays as @var{a}). Note, that there is possibility of incorrect plotting due to uncertainty of cross-section defining if there are two or more isosurface intersections inside one cell. See also @ref{Cloud}, @ref{Dens3}, @ref{Surf3C}, @ref{Surf3A}, @ref{Axial}. @sref{Surf3 sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf3 (@code{float} val, @code{const mglData &}a, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_surf3_val (@code{HMGL} gr, @code{float} val, @code{const HMDT} a, @code{const char *}sch) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{int} num=@code{3}) -@deftypefnx {C function} @code{void} mgl_surf3_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl, @code{int} num) -Draws @var{num}-th uniformly distributed in range [@var{Cmin}, @var{Cmax}] isosurfaces for 3d data specified parametrically. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf3 (@code{const mglData &}a, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) -@deftypefnx {C function} @code{void} mgl_surf3 (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}sch, @code{int} num) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node Dens3, Cont3, Surf3, 3D plotting -@subsection Dens3 -@cindex Dens3 -@cindex DensA - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Dens3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}) -@deftypefnx {C function} @code{void} mgl_dens3_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}stl) -The function draws density plot for 3d data specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Density is plotted at slice @var{sVal} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string @var{stl} have symbol @samp{#} then grid lines are drawn. The minor dimensions of arrays @var{x}, @var{y}, @var{z} must be equal. Arrays @var{x}, @var{y}, @var{z} can be vectors (not 3d arrays as @var{a}). See also @ref{Cont3}, @ref{ContF3}, @ref{Dens}, @ref{Grid3}. @sref{Dens3 sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Dens3 (@code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_dens3 (@code{HMGL} gr, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}sch) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} DensA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}) -@deftypefnx {C function} @code{void} mgl_dens3_all_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl) -Draws density plots at all central slices of the 3d data specified parametrically. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} DensA (@code{const mglData &}a, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_dens3_all (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}sch) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node Cont3, ContF3, Dens3, 3D plotting -@subsection Cont3 -@cindex Cont3 -@cindex ContA - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Cont3 (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}) -@deftypefnx {C function} @code{void} mgl_cont3_xyz_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}stl) -The function draws contour plot for 3d data specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Contours are plotted for values specified in array @var{v} at slice @var{sVal} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. String @var{stl} sets the color scheme. Previous color scheme is used by default. If string @var{stl} have symbol @samp{#} then grid lines are drawn. If string @var{stl} have symbol @samp{t} or @samp{T} then contour labels @var{v}[k] will be drawn below (or above) the contours. The minor dimensions of arrays @var{x}, @var{y}, @var{z} must be equal. Arrays @var{x}, @var{y}, @var{z} can be vectors (not 3d arrays as @var{a}). See also @ref{Dens3}, @ref{ContF3}, @ref{Cont}, @ref{Grid3}. @sref{Cont3 sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Cont3 (@code{const mglData &}v, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_cont3_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}sch) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Cont3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}, @code{int} num=@code{7}) -@deftypefnx {C function} @code{void} mgl_cont3_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}stl, @code{int} num) -The same as first one with vector @var{v} of @var{num}-th elements equidistantly distributed in range [@var{Cmin}, @var{Cmax}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Cont3 (@code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{int} num=@code{7}) -@deftypefnx {C function} @code{void} mgl_cont3 (@code{HMGL} gr, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}sch, @code{int} num) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{int} num=@code{7}) -@deftypefnx {C function} @code{void} mgl_cont3_all_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl, @code{int} num) -Draws contour plots at all central slices of the 3d data specified parametrically. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContA (@code{const mglData &}a, @code{const char *}sch=@code{""}, @code{int} num=@code{7}) -@deftypefnx {C function} @code{void} mgl_cont3_all (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}sch, @code{int} num) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node ContF3, Grid3, Cont3, 3D plotting -@subsection ContF3 -@cindex ContF3 -@cindex ContFA - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContF3 (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}) -@deftypefnx {C function} @code{void} mgl_contf3_xyz_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}stl) -The function draws solid (or filled) contour plot for 3d data specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Contours are plotted for values specified in array @var{v} at slice @var{sVal} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string @var{stl} have symbol @samp{#} then grid lines are drawn. The minor dimensions of arrays @var{x}, @var{y}, @var{z} must be equal. Arrays @var{x}, @var{y}, @var{z} can be vectors (not 3d arrays as @var{a}). See also @ref{Dens3}, @ref{Cont3}, @ref{ContF}, @ref{Grid3}. @sref{ContF3 sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContF3 (@code{const mglData &}v, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_contf3_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}sch) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContF3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}, @code{int} num=@code{7}) -@deftypefnx {C function} @code{void} mgl_contf3_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}stl, @code{int} num) -The same as first one with vector @var{v} of @var{num}-th elements equidistantly distributed in range [@var{Cmin}, @var{Cmax}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContF3 (@code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{int} num=@code{7}) -@deftypefnx {C function} @code{void} mgl_contf3 (@code{HMGL} gr, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}sch, @code{int} num) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContFA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{int} num=@code{7}) -@deftypefnx {C function} @code{void} mgl_contf3_all_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl, @code{int} num) -Draws contour plots at all central slices of the 3d data specified parametrically. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContFA (@code{const mglData &}a, @code{const char *}sch=@code{""}, @code{int} num=@code{7}) -@deftypefnx {C function} @code{void} mgl_contf3_all (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}sch, @code{int} num) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node Grid3, Cloud, ContF3, 3D plotting -@subsection Grid3 -@cindex Grid3 -@cindex GridA - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Grid3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}) -@deftypefnx {C function} @code{void} mgl_grid3_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}stl) -The function draws grid for 3d data specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Grid is plotted at slice @var{sVal} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. String @var{sch} sets the color scheme. Previous color scheme is used by default. The minor dimensions of arrays @var{x}, @var{y}, @var{z} must be equal. Arrays @var{x}, @var{y}, @var{z} can be vectors (not 3d arrays as @var{a}). See also @ref{Cont3}, @ref{ContF3}, @ref{Dens3}, @ref{Grid}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Grid3 (@code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_grid3 (@code{HMGL} gr, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}sch) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} GridA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}) -@deftypefnx {C function} @code{void} mgl_grid3_all_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl) -Draws grids at all central slices of the 3d data specified parametrically. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} GridA (@code{const mglData &}a, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_grid3_all (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}sch) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node Cloud, Beam, Grid3, 3D plotting -@subsection Cloud -@cindex CloudP -@cindex CloudQ - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Cloud (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} alpha=@code{1}) -@deftypefnx {C function} @code{void} mgl_cloud_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl, @code{float} alpha=@code{1}) -The function draws cloud plot for 3d data specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). This plot is a set of cubes with color and transparency proportional to value of @var{a}. The resulting plot is like cloud -- low value is transparent but higher ones are not. The number of plotting cells depend on MeshNum (@pxref{Other settings}). String @var{sch} sets the color scheme. Previous color scheme is used by default. Parameter @var{alpha} changes the overall transparency of plot. The minor dimensions of arrays @var{x}, @var{y}, @var{z} must be equal. Arrays @var{x}, @var{y}, @var{z} can be vectors (not 3d arrays as @var{a}). See also @ref{Surf3}. @sref{Cloud sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Cloud (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} alpha=@code{1}) -@deftypefnx {C function} @code{void} mgl_cloud (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} alpha=@code{1}) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} CloudP (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} alpha=@code{1}) -@deftypefnx {C function} @code{void} mgl_cloudp_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl, @code{float} alpha=@code{1}) -The same as first one but the semi-transparent points are used instead of cubes. @sref{CloudP sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} CloudP (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} alpha=@code{1}) -@deftypefnx {C function} @code{void} mgl_cloudp (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} alpha=@code{1}) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - - -@c ================================================================== -@node Beam, , Cloud, 3D plotting -@subsection Beam -@cindex Beam - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Beam (@code{float} val, @code{const mglData &}tr, @code{const mglData &}g1, @code{const mglData &}g2, @code{const mglData &}a, @code{float} r, @code{const char *}stl=@code{""}, @code{int} flag=@code{0}) -@deftypefnx {C function} @code{void} mgl_beam_val (@code{HMGL} gr, @code{float} val, @code{const HMDT} tr, @code{const HMDT} g1, @code{const HMDT} g2, @code{const HMDT} a, @code{float} r, @code{const char *}stl, @code{int} flag) -Draws the isosurface for 3d array @var{a} at constant values of @var{a}=@var{val}. This is special kind of plot for @var{a} specified in accompanied coordinates along curve @var{tr} with orts @var{g1}, @var{g2} and with transverse scale @var{r}. Variable @var{flag} is bitwise: @samp{0x1} - draw in accompanied (not laboratory) coordinates; @samp{0x2} - draw projection to @math{\rho-z} plane; @samp{0x4} - draw normalized in each slice field. The x-size of data arrays @var{tr}, @var{g1}, @var{g2} must be nx>2. The y-size of data arrays @var{tr}, @var{g1}, @var{g2} and z-size of the data array @var{a} must be equal. @xref{Surf3}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Beam (@code{const mglData &}tr, @code{const mglData &}g1, @code{const mglData &}g2, @code{const mglData &}a, @code{float} r, @code{const char *}stl=@code{""}, @code{int} flag=@code{0}, @code{int} num=@code{3}) -@deftypefnx {C function} @code{void} mgl_beam (@code{HMGL} gr, @code{const HMDT} tr, @code{const HMDT} g1, @code{const HMDT} g2, @code{const HMDT} a, @code{float} r, @code{const char *}stl, @code{int} flag=@code{0}, @code{int} num=@code{3}) -Draws @var{num}-th uniformly distributed in range [@var{Cmin}, @var{Cmax}] isosurfaces for 3d data specified parametrically. -@end deftypefn - - - -@c ################################################################## -@node Dual plotting, Vector fields, 3D plotting, MathGL core -@section Dual plotting - -These plotting functions draw @emph{two matrix} simultaneously. There are 5 generally different types of data representations: surface or isosurface colored by other data (SurfC, Surf3C), surface or isosurface transpared by other data (SurfA, Surf3A), tiles with variable size (TileS), mapping diagram (Map), STFA diagram (STFA). Surf3A and Surf3C have variants for automatic and manual selection of level values for isosurfaces. Each type of plotting has similar interface. There are 2 kind of versions which handle the arrays of data and coordinates or only single data array. Parameters of color scheme are specified by the string argument. @xref{Color scheme}. - -@menu -* SurfC:: -* Surf3C:: -* SurfA:: -* Surf3A:: -* TileS:: -* Map:: -* STFA:: -@end menu - -@c ================================================================== -@node SurfC, Surf3C, , Dual plotting -@subsection SurfC -@cindex SurfC - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SurfC (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_surfc_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch) -The function draws surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} and color it by matrix @var{c}[i,j]. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string @var{sch} have symbol @samp{#} then grid lines are drawn. All dimensions of arrays @var{z} and @var{c} must be equal. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Surface is plotted for each z slice of the data. See also @ref{Surf}, @ref{SurfA}, @ref{Surf3C}. @sref{SurfC sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SurfC (@code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_surfc (@code{HMGL} gr, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - - -@c ================================================================== -@node Surf3C, SurfA, SurfC, Dual plotting -@subsection Surf3C -@cindex Surf3C - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf3C (@code{float} val, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}stl=@code{""}) -@deftypefnx {C function} @code{void} mgl_surf3c_xyz_val (@code{HMGL} gr, @code{float} val, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}stl) -The function draws isosurface plot for 3d array specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) at @var{a}(x,y,z)=@var{val}. It is mostly the same as Surf3() function but the color of isosurface depends on values of array @var{c}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string contain @samp{#} then wire plot is produced. All dimensions of arrays @var{z} and @var{c} must be equal. Arrays @var{x}, @var{y}, @var{z} can be vectors (not 3d arrays as @var{a}). Note, that there is possibility of incorrect plotting due to uncertainty of cross-section defining if there are two or more isosurface intersections inside one cell. See also @ref{Surf3}, @ref{SurfC}, @ref{Surf3A}. @sref{Surf3C sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf3C (@code{float} val, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_surf3c_val (@code{HMGL} gr, @code{float} val, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}sch) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf3C (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}stl=@code{""}, @code{int} num=@code{3}) -@deftypefnx {C function} @code{void} mgl_surf3c_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}stl, @code{int} num) -Draws @var{num}-th uniformly distributed in range [@var{Cmin}, @var{Cmax}] isosurfaces for 3d data specified parametrically. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf3C (@code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) -@deftypefnx {C function} @code{void} mgl_surf3c (@code{HMGL} gr, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}sch, @code{int} num) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - - -@c ================================================================== -@node SurfA, Surf3A, Surf3C, Dual plotting -@subsection SurfA -@cindex SurfA - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SurfA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_surfa_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch) -The function draws surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} and transparent it by matrix @var{c}[i,j]. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string @var{sch} have symbol @samp{#} then grid lines are drawn. All dimensions of arrays @var{z} and @var{c} must be equal. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Surface is plotted for each z slice of the data. See also @ref{Surf}, @ref{SurfC}, @ref{Surf3A}, @ref{TileS}. @sref{SurfA sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SurfA (@code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_surfa (@code{HMGL} gr, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - - -@c ================================================================== -@node Surf3A, TileS, SurfA, Dual plotting -@subsection Surf3A -@cindex Surf3A - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf3A (@code{float} val, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}stl=@code{""}) -@deftypefnx {C function} @code{void} mgl_surf3a_xyz_val (@code{HMGL} gr, @code{float} val, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}stl) -The function draws isosurface plot for 3d array specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) at @var{a}(x,y,z)=@var{val}. It is mostly the same as Surf3() function but the transparency of isosurface depends on values of @var{b} array. This allows one to remove the part of isosurface where @var{b} is negligibly small (useful for phase plotting of a beam or a pulse). String @var{sch} sets the color scheme. Previous color scheme is used by default. If string contain @samp{#} then wire plot is produced. All dimensions of arrays @var{z} and @var{c} must be equal. Arrays @var{x}, @var{y}, @var{z} can be vectors (not 3d arrays as @var{a}). Note, that there is possibility of incorrect plotting due to uncertainty of cross-section defining if there are two or more isosurface intersections inside one cell. See also @ref{Surf3}, @ref{SurfA}, @ref{Surf3C}. @sref{Surf3A sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf3A (@code{float} val, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_surf3a_val (@code{HMGL} gr, @code{float} val, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}sch) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf3A (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}stl=@code{""}, @code{int} num=@code{3}) -@deftypefnx {C function} @code{void} mgl_surf3a_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}stl, @code{int} num) -Draws @var{num}-th uniformly distributed in range [@var{Cmin}, @var{Cmax}] isosurfaces for 3d data specified parametrically. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf3A (@code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) -@deftypefnx {C function} @code{void} mgl_surf3a (@code{HMGL} gr, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}sch, @code{int} num) -The same as previous with @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node TileS, Map, Surf3A, Dual plotting -@subsection TileS -@cindex TileS - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} TileS (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}r, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_tiles_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} r, @code{const char *}sch) -The function draws horizontal tiles for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@}. It is mostly the same as Tile() but the size of tiles is determined by @var{r} array. This is some kind of ``transparency'' useful for exporting to EPS files. String @var{sch} sets the color scheme. Previous color scheme is used by default. The minor dimensions of arrays @var{x}, @var{y}, @var{z} should be equal @code{x.nx=z.nx && y.nx=z.ny} or @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{z}). Surface is plotted for each z slice of the data. See also @ref{SurfA}, @ref{Tile}. @sref{TileS sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} TileS (@code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_tiles (@code{HMGL} gr, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node Map, STFA, TileS, Dual plotting -@subsection Map -@cindex Map - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Map (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{int} ks=@code{0}, @code{bool} pnts=@code{true}) -@deftypefnx {C function} @code{void} mgl_map_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{int} ks, @code{int} pnts) -The function draws mapping plot for matrices @{@var{ax}, @var{ay} @} which parametrically depend on coordinates @var{x}, @var{y}. The initial position of the cell (point) is marked by color. Height is proportional to Jacobian(ax,ay). This plot is like Arnold diagram ???. If @code{pnts=false} then face is drawn otherwise the color ball at matrix knots are drawn. Parameter @var{ks} specifies the slice of matrices which will be used. String @var{sch} sets the color scheme. Previous color scheme is used by default. The size of @var{ax} and @var{ay} must be the same. The minor dimensions of arrays @var{x}, @var{y}, @var{ax} should be equal. Arrays @var{x}, @var{y} can be vectors (not matrix as @var{ax}). @xref{Color scheme}. @sref{Map sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Map (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{int} ks=@code{0}, @code{bool} pnts=@code{true}) -@deftypefnx {C function} @code{void} mgl_map (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{int} ks, @code{int} pnts) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node STFA, , Map, Dual plotting -@subsection STFA -@cindex STFA - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} STFA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}re, @code{const mglData &}im, @code{int} dn, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_stfa_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} re, @code{const HMDT} im, @code{int} dn, @code{const char *}sch, @code{float} zVal) -Draws spectrogram of complex array @var{re}+i*@code{im} for Fourier size of @var{dn} points at plane @var{z=zVal}. Parameter @var{dn} is arbitrary even integer. For example in 1D case, result is density plot of data @math{res[i,j]=|\sum_d^dn exp(I*j*d)*(re[i*dn+d]+I*im[i*dn+d])|/dn} with size @{int(nx/dn), dn, ny@}. At this array @var{re}, @var{im} parametrically depend on coordinates @var{x}, @var{y}. String @var{sch} sets the color scheme. Previous color scheme is used by default. The size of @var{re} and @var{im} must be the same. The minor dimensions of arrays @var{x}, @var{y}, @var{re} should be equal. Arrays @var{x}, @var{y} can be vectors (not matrix as @var{re}). @sref{STFA sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} STFA (@code{const mglData &}re, @code{const mglData &}im, @code{int} dn, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_stfa (@code{HMGL} gr, @code{const HMDT} re, @code{const HMDT} im, @code{int} dn, @code{const char *}sch, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - - -@c ################################################################## -@node Vector fields, Other plotting, Dual plotting, MathGL core -@section Vector fields - -These functions perform plotting of 2D and 3D vector fields. There are 5 generally different types of vector fields representations: simple vector field (Vect), vectors along the curve (Traj), vector field by dew-drops (Dew), flow threads (Flow, FlowP), flow pipes (Pipe). Each type of plotting has similar interface. There are 2 kind of versions which handle the arrays of data and coordinates or only single data array. Parameters of color scheme are specified by the string argument. @xref{Color scheme}. - -@menu -* Traj:: -* Vect:: -* VectL:: -* VectC:: -* Dew:: -* Flow:: -* FlowP:: -* Pipe:: -@end menu - -@c ================================================================== -@node Traj, Vect, , Vector fields -@subsection Traj -@cindex Traj - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Traj (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{float} len=@code{0}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} Traj (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}, @code{float} len=@code{0}) -@deftypefnx {C function} @code{void} mgl_traj_xyz (@code{HMGL} gr, @code{const HMDT}x, @code{const HMDT}y, @code{const HMDT}z, @code{const HMDT}ax, @code{const HMDT}ay, @code{const HMDT}az, @code{const char *}sch, @code{float} len) -@deftypefnx {C function} @code{void} mgl_traj_xy (@code{HMGL} gr, @code{const HMDT}x, @code{const HMDT}y, @code{const HMDT}ax, @code{const HMDT}ay, @code{const char *}sch, @code{float} zVal, @code{float} len) -The function draws vectors @{@var{ax}, @var{ay}, @var{az}@} along a curve @{@var{x}, @var{y}, @var{z}@}. The length of arrows are proportional to @math{\sqrt@{ax^2+ay^2+az^2@}}. String @var{pen} specifies the color (@pxref{Line styles}). By default (@code{pen=""}) color from palette is used (@pxref{Palette and colors}). Parameter @var{len} set the vector length factor (if non-zero) or vector length to be proportional the distance between curve points (if @var{len}=0). The minor sizes of all arrays must be equal and large 2. The plots are drawn for each row if one of the data is the matrix. See also @ref{Vect}. @sref{Traj sample} -@end deftypefn - -@c ================================================================== -@node Vect, VectL, Traj, Vector fields -@subsection Vect -@cindex Vect - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Vect (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}, @code{int} flag=@code{0}) -@deftypefnx {C function} @code{void} mgl_vect_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} zVal, @code{int} flag) -The function draws plane vector field plot for the field @{@var{ax}, @var{ay}@} depending parametrically on coordinates @var{x}, @var{y} at level @var{z=zVal}. The length and color of arrows are proportional to @math{\sqrt@{ax^2+ay^2@}}. The number of arrows depend on @var{MeshNum} (@pxref{Other settings}). The color is specified by the string argument @var{sch}. Previous color scheme is used by default. Parameter @var{flag} is bitwise flag for setup the hachures (arrows): @code{MGL_VEC_COL} for drawing bi-color arrow, @code{MGL_VEC_LEN} for drawing fixed length arrows, @code{MGL_VEC_DOT} for drawing hachures with dots instead of arrows, @code{MGL_VEC_END} for drawing arrows to the cell point, @code{MGL_VEC_MID} for drawing arrows with center at cell point. The size of @var{ax} and @var{ay} must be equal. The minor dimensions of arrays @var{x}, @var{y} and @var{ax} must be equal too. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{ax}). The vector field is plotted for each z slice of @var{ax}, @var{ay}. See also @ref{VectL}, @ref{VectC}, @ref{Flow}, @ref{Dew}. @sref{Vect sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Vect (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}, @code{int} flag=@code{0}) -@deftypefnx {C function} @code{void} mgl_vect_2d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} zVal, @code{int} flag) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Vect (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{int} flag=@code{0}) -@deftypefnx {C function} @code{void} mgl_vect_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch, @code{int} flag) -This is 3D version of the first functions. Here arrays @var{ax}, @var{ay}, @var{az} must be 3-ranged tensors with equal sizes and the length and color of arrows is proportional to @math{\sqrt@{ax^2+ay^2+az^2@}}. @sref{Vect 3D sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Vect (@code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{int} flag=@code{0}) -@deftypefnx {C function} @code{void} mgl_vect_3d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch, @code{int} flag) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node VectL, VectC, Vect, Vector fields -@subsection VectL -@cindex VectL - -These functions are obsolete -- use Vect() functions instead. - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} VectL (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_vectl_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} zVal) -The function draws plane vector field plot for the field @{@var{ax}, @var{ay}@} depending parametrically on coordinates @var{x}, @var{y} at level @var{z=zVal}. The length of hachures is proportional to @math{\sqrt@{ax^2+ay^2@}}. The number of hachures depend on @var{MeshNum} (@pxref{Other settings}). Points are denote the start of hachures. The color is specified by the string argument @var{sch}. Previous color scheme is used by default. The size of @var{ax} and @var{ay} must be equal. The minor dimensions of arrays @var{x}, @var{y} and @var{ax} must be equal too. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{ax}). The vector field is plotted for each z slice of @var{ax}, @var{ay}. See also @ref{Vect}, @ref{VectC}, @ref{Flow}, @ref{Dew}. @sref{VectL sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} VectL (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_vectl_2d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} VectL (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_vectl_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch) -This is 3D version of the first functions. Here arrays @var{ax}, @var{ay}, @var{az} must be 3-ranged tensors with equal sizes and the length of hachures is proportional to @math{\sqrt@{ax^2+ay^2+az^2@}}. @sref{VectL 3D sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} VectL (@code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_vectl_3d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node VectC, Dew, VectL, Vector fields -@subsection VectC -@cindex VectC - -These functions are obsolete -- use Vect() functions instead. - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} VectC (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_vectc_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} zVal) -The function draws plane vector field plot for the field @{@var{ax}, @var{ay}@} depending parametrically on coordinates @var{x}, @var{y} at level @var{z=zVal}. The color of hachures is proportional to @math{\sqrt@{ax^2+ay^2@}}. The number of hachures depend on @var{MeshNum} (@pxref{Other settings}). Points are denote the start of hachures. The color is specified by the string argument @var{sch}. Previous color scheme is used by default. The size of @var{ax} and @var{ay} must be equal. The minor dimensions of arrays @var{x}, @var{y} and @var{ax} must be equal too. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{ax}). The vector field is plotted for each z slice of @var{ax}, @var{ay}. See also @ref{Vect}, @ref{VectL}, @ref{Flow}, @ref{Dew}. @sref{VectC sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} VectC (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_vectc_2d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} VectC (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_vectc_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch) -This is 3D version of the first functions. Here arrays @var{ax}, @var{ay}, @var{az} must be 3-ranged tensors with equal sizes and the color of hachures is proportional to @math{\sqrt@{ax^2+ay^2+az^2@}}. @sref{VectC 3D sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} VectC (@code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_vectc_3d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node Dew, Flow, VectC, Vector fields -@subsection Dew -@cindex Dew - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Dew (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_dew_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} zVal) -The function draws dew-drops for plane vector field @{@var{ax}, @var{ay}@} depending parametrically on coordinates @var{x}, @var{y} at level @var{z=zVal}. Note that this is very expensive plot in memory usage and creation time! The color of drops is proportional to @math{\sqrt@{ax^2+ay^2@}}. The number of drops depend on @var{MeshNum} (@pxref{Other settings}). The color is specified by the string argument @var{sch}. Previous color scheme is used by default. The size of @var{ax} and @var{ay} must be equal. The minor dimensions of arrays @var{x}, @var{y} and @var{ax} must be equal too. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{ax}). The vector field is plotted for each z slice of @var{ax}, @var{ay}. See also @ref{Vect}, @ref{VectC}. @sref{Dew sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Dew (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_dew (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node Flow, FlowP, Dew, Vector fields -@subsection Flow -@cindex Flow - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Flow (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{int} num=@code{5}, @code{bool} central=@code{true}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_flow_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{int} num, @code{int} central, @code{float} zVal) -The function draws flow threads for the plane vector field @{@var{ax}, @var{ay}@} parametrically depending on coordinates @var{x}, @var{y} at level z = @var{zVal}. Number of threads is proportional to @var{num}. Parameter @var{central} sets the thread start from center (if true) or only from edges (if false). From v.1.11 it is ignored and always equal to (@var{num}>0). The color of lines is proportional to @math{\sqrt@{ax^2+ay^2@}}. Warm color corresponds to normal flow (like attractor). Cold one corresponds to inverse flow (like source). String @var{sch} sets the color scheme. Previous color scheme is used by default. The size of @var{ax} and @var{ay} must be equal. The minor dimensions of arrays @var{x}, @var{y} and @var{ax} must be equal too. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{ax}). The vector field is plotted for each z slice of @var{ax}, @var{ay}. See also @ref{Pipe}, @ref{VectC}, @ref{Vect}. @sref{Flow sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Flow (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{int} num=@code{5}, @code{bool} central=@code{true}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_flow_2d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{int} num, @code{int} central, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Flow (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{int} num=@code{3}, @code{bool} central=@code{true}) -@deftypefnx {C function} @code{void} mgl_flow_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch, @code{int} num, @code{int} central) -This is 3D version of the first functions. Here arrays @var{ax}, @var{ay}, @var{az} must be 3-ranged tensors with equal sizes and the color of line is proportional to @math{\sqrt@{ax^2+ay^2+az^2@}}. @sref{Flow 3D sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Flow (@code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{int} num=@code{3}, @code{bool} central=@code{true}) -@deftypefnx {C function} @code{void} mgl_flow_3d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch, @code{int} num, @code{int} central) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@c ================================================================== -@node FlowP, Pipe, Flow, Vector fields -@subsection FlowP -@cindex FlowP - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}) -@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} FlowP (@code{float} x0, @code{float} y0, @code{float} z0, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_flowp_xy (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch) -The function draws flow thread for the plane vector field @{@var{ax}, @var{ay}@} parametrically depending on coordinates @var{x}, @var{y} from point @var{p0} at level z = @var{p0}.z. The color of lines is proportional to @math{\sqrt@{ax^2+ay^2@}}. Warm color corresponds to normal flow (like attractor). Cold one corresponds to inverse flow (like source). String @var{sch} sets the color scheme. Previous color scheme is used by default. The size of @var{ax} and @var{ay} must be equal. The minor dimensions of arrays @var{x}, @var{y} and @var{ax} must be equal too. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{ax}). The vector field is plotted for each z slice of @var{ax}, @var{ay}. See also @ref{Pipe}, @ref{VectC}, @ref{Vect}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}) -@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} FlowP (@code{float} x0, @code{float} y0, @code{float} z0, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_flowp_2d (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}) -@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} FlowP (@code{float} x0, @code{float} y0, @code{float} z0, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_flowp_xyz (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch) -This is 3D version of the first functions. Here arrays @var{ax}, @var{ay}, @var{az} must be 3-ranged tensors with equal sizes and the color of line is proportional to @math{\sqrt@{ax^2+ay^2+az^2@}}. @sref{Flow 3D sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}) -@deftypefnx {Method on @code{mglGraph} (Python)} @code{void} FlowP (@code{float} x0, @code{float} y0, @code{float} z0, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_flowp_3d (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - - -@c ================================================================== -@node Pipe, , FlowP, Vector fields -@subsection Pipe -@cindex Pipe - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Pipe (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{int} num=@code{5}, @code{bool} central=@code{true}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_pipe_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} r0, @code{int} num, @code{int} central, @code{float} zVal) -The function draws flow pipes for the plane vector field @{@var{ax}, @var{ay}@} parametrically depending on coordinates @var{x}, @var{y} at level z = @var{zVal}. Number of pipes is proportional to @var{num}. Parameter @var{central} sets the pipe start from center (if true) or only from edges (if false). From v.1.11 it is ignored and always equal to (@var{num}>0). The color of lines is proportional to @math{\sqrt@{ax^2+ay^2@}}. Warm color corresponds to normal flow (like attractor). Cold one corresponds to inverse flow (like source). String @var{sch} sets the color scheme. Previous color scheme is used by default. Parameter @var{r0} set the base pipe radius. If @var{r0}<0 then pipe radius is inverse proportional to amplitude. The size of @var{ax} and @var{ay} must be equal. The minor dimensions of arrays @var{x}, @var{y} and @var{ax} must be equal too. Arrays @var{x} and @var{y} can be vectors (not matrices as @var{ax}). The vector field is plotted for each z slice of @var{ax}, @var{ay}. See also @ref{Flow}, @ref{VectC}, @ref{Vect}. @sref{Pipe sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Pipe (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{int} num=@code{5}, @code{bool} central=@code{true}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_pipe_2d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} r0, @code{int} num, @code{int} central, @code{float} zVal) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Pipe (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{int} num=@code{3}, @code{bool} central=@code{true}) -@deftypefnx {C function} @code{void} mgl_pipe_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch, @code{float} r0, @code{int} num, @code{int} central) -This is 3D version of the first functions. Here arrays @var{ax}, @var{ay}, @var{az} must be 3-ranged tensors with equal sizes and the color of line is proportional to @math{\sqrt@{ax^2+ay^2+az^2@}}. @sref{Pipe 3D sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Pipe (@code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{int} num=@code{3}, @code{bool} central=@code{true}) -@deftypefnx {C function} @code{void} mgl_pipe_3d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch, @code{float} r0, @code{int} num, @code{int} central) -The same as previous with @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - - -@c ################################################################## -@node Other plotting, Nonlinear fitting, Vector fields, MathGL core -@section Other plotting - -These functions perform miscelaneous plotting. There is unstructured data points plots (Dots), surface reconstruction (Crust), surfaces on the triangular mesh (TriPlot), textual formula plotting (Plots by formula), data plots at edges (Dens[XYZ], Cont[XYZ], ContF[XYZ]), simple plot (SimplePlot). Each type of plotting has similar interface. There are 2 kind of versions which handle the arrays of data and coordinates or only single data array. Parameters of color scheme are specified by the string argument. @xref{Color scheme}. - -@menu -* DensXYZ:: -* ContXYZ:: -* ContFXYZ:: -* Dots:: -* Crust:: -* TriPlot:: -* TriCont:: -* QuadPlot:: -* Plots by formula:: -* SimplePlot:: -@end menu - -@c ================================================================== -@node DensXYZ, ContXYZ, , Other plotting -@subsection DensXYZ -@cindex DensX -@cindex DensY -@cindex DensZ - -These plotting functions draw density plot in x, y, or z plain. If @var{a} is a tensor (3-dimensional data) then interpolation to a given @var{sVal} is performed. These functions are useful for creating projections of the 3D data array to the bounding box. For example, code like -@example -gr->DensX(c.Sum("x"),"BbcyrR",-1); -gr->DensY(c.Sum("y"),0,1); -gr->DensZ(c.Sum("z"),0,-1); -@end example -will produce the following picture. See also @ref{ContXYZ}, @ref{ContFXYZ}, @ref{Dens}, @ref{Data distributions}. @sref{Dens projection sample} - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} DensX (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_dens_x (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) -Draws density plot for data @var{a} at x = @var{sVal}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} DensY (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_dens_y (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) -Draws density plot for data @var{a} at y = @var{sVal}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} DensZ (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_dens_z (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) -Draws density plot for data @var{a} at z = @var{sVal}. -@end deftypefn - -@c ================================================================== -@node ContXYZ, ContFXYZ, DensXYZ, Other plotting -@subsection ContXYZ -@cindex ContX -@cindex ContY -@cindex ContZ - -These plotting functions draw contour lines in x, y, or z plain. If @var{a} is a tensor (3-dimensional data) then interpolation to a given @var{sVal} is performed. These functions are useful for creating projections of the 3D data array to the bounding box. For example, code like -@example -gr->ContX(c.Sum("x"),"BbcyrR",-1); -gr->ContY(c.Sum("y"),0,1); -gr->ContZ(c.Sum("z"),0,-1); -@end example -will produce the following picture. See also @ref{ContFXYZ}, @ref{DensXYZ}, @ref{Cont}, @ref{Data distributions}. @sref{Cont projection sample} - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContX (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) -@deftypefnx {C function} @code{void} mgl_cont_x (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal, @code{int} num) -Draws @var{num}-th contour lines for data @var{a} at x = @var{sVal}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContY (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) -@deftypefnx {C function} @code{void} mgl_cont_y (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal, @code{int} num) -Draws @var{num}-th contour lines for data @var{a} at y = @var{sVal}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContZ (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) -@deftypefnx {C function} @code{void} mgl_cont_z (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal, @code{int} num) -Draws @var{num}-th contour lines for data @var{a} at z = @var{sVal}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContX (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_cont_x_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) -Draws contour lines for data @var{a}=@var{v}[i] at x = @var{sVal}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContY (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_cont_y_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) -Draws contour lines for data @var{a}=@var{v}[i] at y = @var{sVal}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContZ (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_cont_z_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) -Draws contour lines for data @var{a}=@var{v}[i] at z = @var{sVal}. -@end deftypefn - -@c ================================================================== -@node ContFXYZ, Dots, ContXYZ, Other plotting -@subsection ContFXYZ -@cindex ContFX -@cindex ContFY -@cindex ContFZ - -These plotting functions draw solid contour lines in x, y, or z plain. If @var{a} is a tensor (3-dimensional data) then interpolation to a given @var{sVal} is performed. These functions are useful for creating projections of the 3D data array to the bounding box. See also @ref{ContXYZ}, @ref{DensXYZ}, @ref{ContF}, @ref{Data distributions}. - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContFX (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) -@deftypefnx {C function} @code{void} mgl_contf_x (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal, @code{int} num) -Draws @var{num}-th solid contours for data @var{a} at x = @var{sVal}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContFY (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) -@deftypefnx {C function} @code{void} mgl_contf_y (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal, @code{int} num) -Draws @var{num}-th solid contours for data @var{a} at y = @var{sVal}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContFZ (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) -@deftypefnx {C function} @code{void} mgl_contf_z (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal, @code{int} num) -Draws @var{num}-th solid contours for data @var{a} at z = @var{sVal}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContFX (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_contf_x_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) -Draws solid contours for data @var{a}=@var{v}[i] at x = @var{sVal}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContFY (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_contf_y_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) -Draws solid contours for data @var{a}=@var{v}[i] at y = @var{sVal}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ContFZ (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_contf_z_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) -Draws solid contours for data @var{a}=@var{v}[i] at z = @var{sVal}. -@end deftypefn - -@c ================================================================== -@node Dots, Crust, ContFXYZ, Other plotting -@subsection Dots -@cindex Dots - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Dots (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} Dots (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_dots (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch) -@deftypefnx {C function} @code{void} mgl_dots_a (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}sch) -The function draws the arbitrary placed points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If array @var{a} is specified then it define the transparency of dots. Arrays @var{x}, @var{y}, @var{z}, @var{a} must have equal sizes. See also @ref{Crust}, @ref{Mark}, @ref{Plot}. @sref{Dots sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Dots (@code{const mglData &}tr, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_dots_tr (@code{HMGL} gr, @code{const HMDT} tr, @code{const char *}sch) -The same as previous with @var{x=tr}(0,:), @var{y=tr}(1,:), @var{z=tr}(2,:) and if @var{tr}.nx>3 then @var{a=tr}(3,:). -@end deftypefn - -@c ================================================================== -@node Crust, TriPlot, Dots, Other plotting -@subsection Crust -@cindex Crust - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Crust (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} er=@code{0}) -@deftypefnx {C function} @code{void} mgl_crust (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{float} er) -The function reconstruct and draws the surface for arbitrary placed points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Parameter @var{er} set relative radius for (increase it for removing holes). String @var{sch} sets the color scheme. Previous color scheme is used by default. If string contain @samp{#} then wire plot is produced. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. See also @ref{Dots}, @ref{TriPlot}. @sref{Crust sample} -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Crust (@code{const mglData &}tr, @code{const char *}sch=@code{""}, @code{float} er=@code{0}) -@deftypefnx {C function} @code{void} mgl_crust_tr (@code{HMGL} gr, @code{const HMDT} tr, @code{const char *}sch, @code{float} er) -The same as previous with @var{x=tr}(0,:), @var{y=tr}(1,:), @var{z=tr}(2,:). -@end deftypefn - -@c ================================================================== -@node TriPlot, TriCont, Crust, Other plotting -@subsection TriPlot -@cindex TriPlot - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} TriPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} TriPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_triplot_xyz (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch) -@deftypefnx {C function} @code{void} mgl_triplot_xyzc (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch) -The function draws the surface of triangles. Triangle vertexes are set by indexes @var{id} of data points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string contain @samp{#} then wire plot is produced. First dimensions of @var{id} must be 3 or greater. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. Parameter @var{c} set the colors of triangles (if @var{id}.ny=@var{c}.nx) or colors of vertexes (if @var{x}.nx=@var{c}.nx). See also @ref{Dots}, @ref{Crust}, @ref{QuadPlot}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} TriPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_triplot_xy (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const char *}sch, @code{float} zVal) -The same as previous with @var{z}[i]=@var{zVal}. -@end deftypefn - -@c ================================================================== -@node TriCont, QuadPlot, TriPlot, Other plotting -@subsection TriCont -@cindex TriCont - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} TriContV (@code{const mglData &}v, @code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} TriContV (@code{const mglData &}v, @code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_tricont_xyzcv (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch, @code{float} zVal) -@deftypefnx {C function} @code{void} mgl_tricont_xyzv (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) -The function draws contour lines for surface of triangles at @var{z} = @var{zVal} (or for @var{z=v}[k] if @code{zVal==NAN}). Triangle vertexes are set by indexes @var{id} of data points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Contours are plotted for @var{z}[i,j]=@var{v}[k] where @var{v}[k] are values of data array @var{v}. String @var{sch} sets the color scheme. Previous color scheme is used by default. Array @var{c} (if specified) is used for contour coloring. First dimensions of @var{id} must be 3 or greater. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. Parameter @var{c} set the colors of triangles (if @var{id}.ny=@var{c}.nx) or colors of vertexes (if @var{x}.nx=@var{c}.nx). See also @ref{TriPlot}, @ref{Cont}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} TriCont (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{num}=@code{7}, @code{float} zVal=@code{NAN}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} TriCont (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{num}=@code{7}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_tricont_xyzc (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch, @code{num}, @code{float} zVal) -@deftypefnx {C function} @code{void} mgl_tricont_xyz (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{num}, @code{float} zVal) -The same as first one with vector @var{v} of @var{num}-th elements equidistantly distributed in range [@var{Cmin}, @var{Cmax}]. -@end deftypefn - -@c ================================================================== -@node QuadPlot, Plots by formula, TriCont, Other plotting -@subsection QuadPlot -@cindex QuadPlot - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} QuadPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} QuadPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {C function} @code{void} mgl_quadplot_xyz (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch) -@deftypefnx {C function} @code{void} mgl_quadplot_xyzc (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch) -The function draws the surface of quadrangles. Quadrangles vertexes are set by indexes @var{id} of data points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. If string contain @samp{#} then wire plot is produced. First dimensions of @var{id} must be 4 or greater. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. Parameter @var{c} set the colors of quadrangles (if @var{id}.ny=@var{c}.nx) or colors of vertexes (if @var{x}.nx=@var{c}.nx). See also @ref{TriPlot}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} QuadPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {C function} @code{void} mgl_quadplot_xy (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const char *}sch, @code{float} zVal) -The same as previous with @var{z}[i]=@var{zVal}. -@end deftypefn - -@c ================================================================== -@node Plots by formula, SimplePlot, QuadPlot, Other plotting -@subsection Plots by formula -@cindex Plot -@cindex Surf - -These functions perform plotting of 1D or 2D functions specified by textual formula. You do not need to create the data arrays to plot it. The parameter @var{stl} set the line style (@pxref{Line styles}) for @code{Plot()} or color scheme (@pxref{Color scheme}) for @code{Surf()}. The parameter @var{n} set the minimal number of points along coordinate(s) for plots. At this time (v. 1.10) there is adaptive increase of data points numbers but only for 1D variant (i.e. for Plot()). - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Plot (@code{const char *}eqY, @code{const char *}stl=@code{""}, @code{float} zVal=@code{NAN}, @code{int} n=@code{100}) -@deftypefnx {C function} @code{void} mgl_fplot (@code{HMGL} gr, @code{const char *}eqY, @code{const char *}stl, @code{float} zVal, @code{int} n) -The function draws function @samp{eqY(x)} at plane z=@var{zVal} where @samp{x} variable is changed in range [@var{Min}.x, @var{Max}.x]. See also @ref{Plot}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Plot (@code{const char *}eqX, @code{const char *}eqY, @code{const char *}eqZ, @code{const char *}stl=@code{""}, @code{float} zVal=@code{NAN}, @code{int} n=@code{100}) -@deftypefnx {C function} @code{void} mgl_fplot_xyz (@code{HMGL} gr, @code{const char *}eqX, @code{const char *}eqY, @code{const char *}eqZ, @code{const char *}stl, @code{float} zVal, @code{int} n) -The function draws parametrical curve @{@samp{eqX(t)}, @samp{eqY(t)}, @samp{eqZ(t)}@} where @samp{t} variable is changed in range [0, 1]. See also @ref{Plot}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf (@code{const char *}eqZ, @code{const char *}stl=@code{""}, @code{int} n=@code{100}); -@deftypefnx {C function} @code{void} mgl_fsurf (@code{HMGL} gr, @code{const char *}eqZ, @code{const char *}stl, @code{int} n); -The function draws surface for function @samp{eqY(x,y)} where @samp{x}, @samp{y} variables are changed in range [@var{Min}, @var{Max}]. See also @ref{Surf}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Surf (@code{const char *}eqX, @code{const char *}eqY, @code{const char *}eqZ, @code{const char *}stl=@code{""}, @code{int} n=@code{100}) -@deftypefnx {C function} @code{void} mgl_fsurf_xyz (@code{HMGL} gr, @code{const char *}eqX, @code{const char *}eqY, @code{const char *}eqZ, @code{const char *}stl, @code{int} n) -The function draws parametrical surface @{@samp{eqX(u,v)}, @samp{eqY(u,v)}, @samp{eqZ(u,v)}@} where @samp{u}, @samp{v} variables are changed in range [0, 1]. See also @ref{Surf}. -@end deftypefn - -@c ================================================================== -@node SimplePlot, , Plots by formula, Other plotting -@subsection SimplePlot -@cindex SimplePlot - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SimplePlot (@code{const mglData &}a, @code{int} type=@code{0}, @code{const char *}stl=@code{""}) -@deftypefnx {C function} @code{void} mgl_simple_plot (@code{HMGL} gr, @code{const HMDT} a, @code{int} type, @code{const char *}stl) -Plots the array @var{a} depending on it's dimensions and @var{type} parameter. String @var{stl} specifies the style of plotting. For 1d data: @code{type=0} -- @ref{Plot}, @code{type=1} -- @ref{Area}, @code{type=2} -- @ref{Step}, @code{type=3} -- @ref{Stem}, @code{type=4} -- @ref{Bars}. For 2d data: @code{type=0} -- @ref{Surf}, @code{type=1} -- @ref{Dens}, @code{type=2} -- @ref{Mesh}, @code{type=3} -- @ref{Cont}. For 3d data: @code{type=0} -- @ref{Surf3}, @code{type=1} -- @ref{Dens3}, @code{type=2} -- @ref{Cont3}, @code{type=2} -- @ref{Cloud}. -@end deftypefn - -@c ################################################################## -@node Nonlinear fitting, Data distributions, Other plotting, MathGL core -@section Nonlinear fitting -@cindex Fit -@cindex FitS -@cindex PutsFit -@cindex FitPnts -@cindex Fit2 -@cindex Fit3 - -These functions fit data to formula. Fitting goal is to find formula parameters for the best fit the data points, i.e. to minimize the sum @math{\sum_i (f(x_i, y_i, z_i) - a_i)^2/s_i^2}. At this, approximation function @samp{f} can depend only on one argument @samp{x} (1D case), on two arguments @samp{x,y} (2D case) and on three arguments @samp{x,y,z} (3D case). The function @samp{f} also may depend on parameters. Normally the list of fitted parameters is specified by @var{var} string (like, @samp{abcd}). Usually user should supply initial values for fitted parameters by @var{ini} variable. But if he/she don't supply it then the zeros are used. Parameter @var{print}=@code{true} switch on printing the found coefficients to @var{Message} (@pxref{Error handling}). - -Functions Fit() and FitS() do not draw the obtained data themselves. They fill the data @var{fit} by formula @samp{f} with found coefficients and return the @math{\chi^2} error of approximation. At this, the @samp{x,y,z} coordinates are equidistantly distributed in the interval @var{Min}--@var{Max}. Number of points in @var{fit} is selected as maximal value of @var{fit} size and the value of @var{FitPnts}. Note, that this functions use GSL library and do something only if MathGL was compiled with GSL support. @sref{Fitting sample} - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) -@deftypefnx {C function} @code{float} mgl_fit_xyzas (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{float *}ini) -@deftypefnx {C function} @code{float} mgl_fit_xyzas_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) -Fit data along x-, y- and z-directions for 3d array specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) -@deftypefnx {C function} @code{float} mgl_fit_xyzs (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{float *}ini) -@deftypefnx {C function} @code{float} mgl_fit_xyzs_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) -Fit data along x-, and y-directions for 2d array specified parametrically @var{a}[i,j](@var{x}[i,j], @var{y}[i,j]) for each data slice. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) -@deftypefnx {C function} @code{float} mgl_fit_xys (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{float *}ini) -@deftypefnx {C function} @code{float} mgl_fit_xys_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) -Fit data along x-direction for 1d array specified parametrically @var{a}[i](@var{x}[i]) for each data slice. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) -@deftypefnx {C function} @code{float} mgl_fit_ys (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{float *}ini) -@deftypefnx {C function} @code{float} mgl_fit_ys_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) -Fit data along x-direction for 1d array with @var{x} equidistantly distributed in interval [@var{Min}.x, @var{Max}.x]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) -@deftypefnx {C function} @code{float} mgl_fit_xyza (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{float *}ini) -@deftypefnx {C function} @code{float} mgl_fit_xyza_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) -Fit data along x-, y- and z-directions for 3d array specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) with @var{s}[i,j,k]=1. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) -@deftypefnx {C function} @code{float} mgl_fit_xyz (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{float *}ini) -@deftypefnx {C function} @code{float} mgl_fit_xyz_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) -Fit data along x-, and y-directions for 2d array specified parametrically @var{a}[i,j](@var{x}[i,j], @var{y}[i,j]) with @var{s}[i,j]=1 for each data slice. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) -@deftypefnx {C function} @code{float} mgl_fit_xy (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{float *}ini) -@deftypefnx {C function} @code{float} mgl_fit_xy_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) -Fit data along x-direction for 1d array specified parametrically @var{a}[i](@var{x}[i]) with @var{s}[i]=1 for each data slice. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{""}, @code{bool} print=@code{false}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) -@deftypefnx {C function} @code{float} mgl_fit_1 (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{float *}ini) -@deftypefnx {C function} @code{float} mgl_fit_1_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) -Fit data along x-direction for 1d array @var{a} with @var{s}=1 and @var{x} equidistantly distributed in interval [@var{Min}.x, @var{Max}.x]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{float} Fit2 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{float} Fit2 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) -@deftypefnx {C function} @code{float} mgl_fit_2 (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{float *}ini) -@deftypefnx {C function} @code{float} mgl_fit_2_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) -Fit data along x-, and y-directions for 2d array @var{a} with @var{s}=1 and @var{x}, @var{y} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{float} Fit3 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{float} Fit3 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) -@deftypefnx {C function} @code{float} mgl_fit_3 (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{float *}ini) -@deftypefnx {C function} @code{float} mgl_fit_3_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) -Fit data along x-, y- and z-directions for 3d array @var{a} with @var{s}=1 and @var{x}, @var{y}, @var{z} equidistantly distributed in interval [@var{Min}, @var{Max}]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} PutsFit (@code{mglPoint} p, @code{const char *}prefix=@code{""}, @code{const char *}font=@code{NULL}, @code{float} size=@code{-1}) -@deftypefnx {C function} @code{void} mgl_puts_fit (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const char *}prefix, @code{const char *}font, @code{float} size=@code{-1}) -Print last fitted formula with found coefficients (as numbers) at position @var{p0}. The string @var{prefix} will be printed before formula. All other parameters are the same as in @ref{Text printing}. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{const char *}GetFit () -@deftypefnx {C function} @code{const char *} mgl_get_fit (@code{HMGL} gr) -Get last fitted formula with found coefficients (as numbers). -@end deftypefn - -@deftypecv {General option (C++)} mglGraph @code{int} FitPnts -Minimal number of points for output array after nonlinear fitting. -@end deftypecv - - - -@c ################################################################## -@node Data distributions, Frames/Animation, Nonlinear fitting, MathGL core -@section Data distributions -@cindex Hist - -These functions make distribution (histogram) of data. They do not draw the obtained data themselves. These functions can be useful if user have data defined for random points (for example, after PIC simulation) and he want to produce a plot which require regular data (defined on grid(s)). The range for grids is always selected as axis range Min...Max. Arrays @var{x}, @var{y}, @var{z} define the positions (coordinates) of random points. Array @var{a} define the data value. Number of points in output array @var{res} is selected as maximal value of @var{res} size and the value of @var{FitPnts}. - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Hist (@code{mglData &}res, @code{const mglData &}x, @code{const mglData &}a) -@deftypefnx {C function} @code{int} mgl_hist_x (@code{HMGL} gr, @code{HMDT} res, @code{const HMDT} x, @code{const HMDT} a) -Creates 1D distribution of the data values @var{a} in range [Min, Max]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Hist (@code{mglData &}res, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a) -@deftypefnx {C function} @code{int} mgl_hist_xy (@code{HMGL} gr, @code{HMDT} res, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} a) -Creates 2D distribution of the data values @var{a} in range [Min, Max]. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Hist (@code{mglData &}res, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a) -@deftypefnx {C function} @code{int} mgl_hist_xyz (@code{HMGL} gr, @code{HMDT} res, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a) -Creates 3D distribution of the data values @var{a} in range [Min, Max]. -@end deftypefn - - -@c ################################################################## -@node Frames/Animation, IDTF functions, Data distributions, MathGL core -@section Frames/Animation -@cindex NewFrame -@cindex EndFrame -@cindex GetNumFrame - -These functions provide ability to create several pictures simultaneously. For most of cases it is useless but for widget classes (@pxref{Widget classes}) they can provide a way to show animation. Also you can write several frames into animated GIF file. - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{int} NewFrame () -@deftypefnx {C function} @code{int} mgl_new_frame (@code{HMGL} gr) -Creates new frame. Function returns current frame id. This is not thread safe function in OpenGL mode! Use direct list creation in multi-threading drawing. The function @code{EndFrame()} @strong{must} be call after the finishing of the frame drawing for each call of this function. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} EndFrame () -@deftypefnx {C function} @code{void} mgl_end_frame (@code{HMGL} gr) -Finishes the frame drawing. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{int} GetNumFrame () -@deftypefnx {C function} @code{int} mgl_get_num_frame (@code{HMGL} gr) -Gets the number of created frames. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} ResetFrames () -@deftypefnx {C function} @code{int} mgl_reset_frames (@code{HMGL} gr) -Reset frames counter (start it from zero). -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} StartGIF (@code{const char *}fname, @code{int} ms=@code{100}) -@deftypefnx {C function} @code{void} mgl_start_gif (@code{HMGL} gr, @code{const char *}fname, @code{int} ms) -Start writing frames into animated GIF file @var{fname}. Parameter @var{ms} set the delay between frames in milliseconds. You @strong{should not} change the picture size during writing the cinema. Use CloseGIF() to finalize writing. Note, that this function is disabled in OpenGL mode. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{int} CloseGIF () -@deftypefnx {C function} @code{void} mgl_close_gif (@code{HMGL} gr) -Finish writing animated GIF and close connected pointers. -@end deftypefn - -@c ################################################################## -@node IDTF functions, , Frames/Animation, MathGL core -@section IDTF functions -@cindex NewFrame -@cindex EndFrame -@cindex GetNumFrame - -These functions provide IDTF specific features. In all other cases they do nothing. - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} VertexColor (@code{bool} enable) -Enables smooth color change. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} Compression (@code{bool} enable) -Gives smaller files, but quality degrades. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} StartGroup (const char *name) -Starts group definition. Groups contain objects and other groups, they are used to select a part of a model to zoom to or to make invizible or to make transparent and so on. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++)} @code{void} EndGroup () -Ends group definition. -@end deftypefn +@c inline void DoubleSided(bool){} // NOTE: Add later -- IDTF +@c inline void TextureColor(bool){} // NOTE: Add later -- IDTF +@end ifclear diff --git a/texinfo/core_ru.texi b/texinfo/core_ru.texi index 1ec64b8..b3ff1a5 100644 --- a/texinfo/core_ru.texi +++ b/texinfo/core_ru.texi @@ -2,128 +2,171 @@ @chapter Ядро MathGL @cindex mglGraph -Основным классом MathGL является класс @strong{mglGraph}, определенный в @code{#include }. Он включает в себя множество функций для построения графиков от 1D, 2D и 3D массивов. Он также содержит функции вывода текста и построения осей координат. Есть возможность построения в произвольной системе координат, которая задается строковыми формулами. Все графические функции используют класс mglData (@pxref{mglData class}) для хранения массивов данных. Это позволяет легко контролировать размеры, работу с памятью и производить обработку данных. Дополнительная информация о цветах, шрифтах, вычисления формул может быть найдена в @ref{Other classes}. - -Замечу, что класс mglGraph -- абстрактный класс, содержащий только интерфейсную часть для построения графиков. Он не выполняет собственно построения на конкретное устройство. Для практического использования (при выводе на экран, в память или в файл) используйте производные классы: mglGraphZB для растровых рисунков; mglGraphPS для векторных рисунков (в форматах EPS и/или SVG) и для быстрого, но менее аккуратного рисования растровой картинки; mglGraphGL для рисования с использованием OpenGL; и т.д. @pxref{Plotter classes}. Если вы хотите не только построить картинку, но и отобразить ее в окне/органе управления или запустить анимацию, то посмотрите также @ref{Widget classes}. - -Начиная с версии 1.10 есть специальный класс "оболочка" к функциям С-интерфейса. Он также называется @code{mglGraph} и определен в файле @code{mgl/mgl_graph.h}. Этот класс можно использовать и на не-GNU компиляторах (т.е. в Borland или Microsoft компиляторах), но в этом случае вы @strong{не должны подключать} заголовочные файлы @code{mgl/mgl.h} или @code{mgl/mgl_parse.h}! Этот класс используется также как базовый класс для интерфейсов на основе SWIG (Python, Octave и пр). Далее в документации функции члены "оболочечного" класса обозначены как @samp{Python} для отделения от оригинального класса @samp{C++}, определенного в @code{mgl/mgl.h}. +@ifclear UDAV +Основным классом MathGL является класс @strong{mglGraph}, определенный в @code{#include }. Он включает в себя множество функций для построения графиков от 1D, 2D и 3D массивов. Он также содержит функции вывода текста и построения осей координат. Есть возможность построения в произвольной системе координат, которая задается строковыми формулами. Все графические функции используют класс mglData (@pxref{Data processing}) для хранения массивов данных. Это позволяет легко контролировать размеры, работу с памятью и производить обработку данных. Дополнительная информация о цветах, шрифтах, вычисления формул может быть найдена в @ref{Other classes}. +@end ifclear @menu -* Graphics setup:: -* Axis settings:: -* Transformation matrix:: -* Export to file:: -* Primitives drawing:: -* Text printing:: -* Axis and Colorbar:: -* Legend:: -* 1D plotting:: -* 2D plotting:: -* 3D plotting:: -* Dual plotting:: -* Vector fields:: -* Other plotting:: -* Nonlinear fitting:: -* Data distributions:: -* Frames/Animation:: -* IDTF functions:: +* Constructor:: +* Graphics setup:: +* Axis settings:: +* Transformation matrix:: +* Export picture:: +* Primitives drawing:: +* Text printing:: +* Axis and Colorbar:: +* Legend:: +* 1D plotting:: +* 2D plotting:: +* 3D plotting:: +* Dual plotting:: +* Vector fields:: +* Other plotting:: +* Nonlinear fitting:: +* Data distributions:: +* IDTF functions:: @end menu @c ################################################################## -@node Graphics setup, Axis settings, , MathGL core +@node Constructor, Graphics setup, , MathGL core +@section Создание и удаление графического объекта + +@ifclear UDAV +@deftypefn {Constructor on @code{mglGraph}} {} mglGraph (@code{int} kind=@code{0}, @code{int} width=@code{600}, @code{int} height=@code{400}) +@deftypefnx {Constructor on @code{mglGraph}} {} mglGraph (@code{const mglGraph &}gr) +@deftypefnx {Constructor on @code{mglGraph}} {} mglGraph (@code{HMGL} gr) +@deftypefnx {C function} @code{HMGL} mgl_create_graph (@code{int} width, @code{int} height) +@deftypefnx {C function} @code{HMGL} mgl_create_graph_gl () +Создает (или использует созданный) экземпляр класса, производного от @code{mglBase} (тип @code{HMGL}) с указанными размерами @var{width} и @var{height}. Параметр @var{type} может иметь следующие значения: @samp{0} -- использовать рисование по умолчанию, @samp{1} -- использовать рисование в OpenGL. +@end deftypefn + +@deftypefnx {Destructor on @code{mglGraph}} {} ~mglGraph () +@deftypefnx {C function} @code{HMGL} mgl_delete_graph (@code{HMGL} gr) +Удаляет экземпляр класса mglGraph. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{HMGL} Self () +Возвращает указатель на используемый объект типа @code{HMGL}. +@end deftypefn +@end ifclear + +@ifset UDAV +MGL не требует создания данного типа объектов. +@end ifset + +@c ################################################################## +@node Graphics setup, Axis settings, Constructor, MathGL core @section Настройка графика @cindex Настройка MathGL Функции и переменные в этой группе влияют на вид всего рисунка. Соответственно они должны располагаться @emph{перед} вызовом функций непосредственно рисующих графики. -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} DefaultPlotParam () +@ifclear UDAV +@deftypefn {Метод класса @code{mglGraph}} @code{void} DefaultPlotParam () @deftypefnx {Функция С} @code{void} mgl_set_def_param (@code{HMGL} gr) -Устанавливает все настройки по умолчанию, кроме описанных в @ref{Zooming}. +Устанавливает все настройки по умолчанию. @end deftypefn +@deftypefn {Method on @code{mglGraph}} @code{void} SetPlotId (@code{const char *}id) +Задает имя графика для сохранения в файл (например, в окне GLUT). +@end deftypefn +@end ifclear + @menu -* Transparency:: -* Lighting:: -* Fog:: -* Default sizes:: -* Zooming:: -* Cutting:: -* Font settings:: -* Palette and colors:: -* Error handling:: -* Other settings:: +* Transparency:: +* Lighting:: +* Fog:: +* Default sizes:: +* Cutting:: +* Font settings:: +* Palette and colors:: +* Error handling:: @end menu @c ================================================================== @node Transparency, Lighting, , Graphics setup @subsection Прозрачность @cindex Alpha +@ifclear UDAV @cindex SetAlphaDef -@cindex SetTransparent @cindex SetTranspType +@end ifclear +@cindex AlphaDef +@cindex TranspType Эти функции и переменные настраивают тип и степень прозрачности поверхностей. Главной является функция @code{Alpha()}, которая включает/выключает прозрачность для всех графиков, созданных после вызова @code{Alpha()} (за исключением mglGraphGL). Функция @code{SetAlphaDef} устанавливает величину alpha-канала по умолчанию. Прозрачность можно выключить для отдельного графика с помощью @code{SetTransparent}. Наконец, функция @code{SetTranspType} задает тип прозрачности. @sref{Transparent surface sample} -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{bool} Alpha (@code{bool} enable) -@deftypefnx {Функция С} @code{void} mgl_set_alpha (@code{HMGL} gr, @code{int} enable) -Включает/выключает прозрачность и возвращает свое предыдущее состояние. По умолчанию прозрачность выключена. Функция включает прозрачность для @emph{всего} рисунка. Используйте @code{SetTransparent(false)} для конкретного графика для выключения прозрачности. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetAlphaDef (@code{float} val) -@deftypefnx {Функция С} @code{void} mgl_set_alpha_по умолчанию (@code{HMGL} gr, @code{float} alpha) -Задает значение прозрачности по умолчанию для всех графиков. Отмечу, что OpenGL (mglGraphGL) некорректно рисует большое число перекрывающихся прозрачных поверхностей (больше двух). -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetTransparent (@code{bool} val) -@deftypefnx {Функция С} @code{void} mgl_set_transp (@code{HMGL} gr, @code{int} enable) -Временно включает/возвращает прозрачность графиков. Это аналог @code{Alpha(val)}, но работает более корректно для класса mglGraphGL. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetTranspType (@code{int} type) -@deftypefnx {Функция С} @code{void} mgl_set_transp_type (@code{HMGL} gr, @code{int} enable) +@anchor{alpha} +@deftypefn {MGL command} {} alpha @code{[val=on]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Alpha (@code{bool} enable) +@deftypefnx {C function} @code{void} mgl_set_alpha (@code{HMGL} gr, @code{int} enable) +@end ifclear +Включает/выключает прозрачность и возвращает свое предыдущее состояние. По умолчанию прозрачность выключена. Функция включает прозрачность для @emph{всего} рисунка. +@end deftypefn + +@anchor{alphadef} +@deftypefn {MGL command} {} alphadef @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetAlphaDef (@code{float} val) +@deftypefnx {C function} @code{void} mgl_set_alpha_default (@code{HMGL} gr, @code{float} alpha) +@end ifclear +Задает значение прозрачности по умолчанию для всех графиков. Значение по умолчанию 0.5. +@end deftypefn + +@anchor{transptype} +@deftypefn {MGL command} {} transptype @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTranspType (@code{int} type) +@deftypefnx {C function} @code{void} mgl_set_transp_type (@code{HMGL} gr, @code{int} enable) +@end ifclear Задает тип прозрачности. Обычная прозрачность (@samp{0}) -- "закрытые" объекты видны меньше чем закрывающие. Этот режим некорректно отображается в OpenGL (mglGraphGL) для нескольких перекрывающихся поверхностей. "Стеклянная" прозрачность (@samp{1}) -- закрытые и закрывающие объекты единообразно ослабляют интенсивность света (по RGB каналам). "Ламповая" прозрачность (@samp{2}) -- закрытые и закрывающие объекты являются источниками дополнительного освещения (рекомендую установить @code{SetAlphaDef(0.3)} или меньше в этом случае). @xref{Normal transparency}, @ref{Glass-like transparency}, @ref{Lamp-like transparency}. @end deftypefn -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{float} AlphaDef -Значение прозрачности по умолчанию для всех графиков. См. @code{SetAlphaDef()}. -@end deftypecv - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{bool} Transparent -Флаг, временно включающий/выключающий прозрачность графиков. См. @code{SetTransparent()}. -@end deftypecv - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{int} TranspType -Тип прозрачности. См. @code{SetTranspType()}. -@end deftypecv - @c ================================================================== @node Lighting, Fog, Transparency, Graphics setup @subsection Освещение +@ifclear UDAV +@cindex SetAmbient +@cindex AddLight +@end ifclear @cindex Light @cindex Ambient -@cindex AddLight Эти функции настраивают освещение графика. Главная функция @code{Light(bool)} включает/выключает освещение графиков построенных после ее вызова (в OpenGL работает сразу для всего рисунка). MathGL поддерживает до 10 независимых источников света. Но в режиме OpenGL можно использовать только первые 8 из них. Положение, цвет, яркость каждого источника света можно задавать по отдельности. По умолчанию включен только первый (с порядковым номером @code{0}) источник света белого цвета, расположенный сверху. -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{bool} Light (@code{bool} enable) -@deftypefnx {Функция С} @code{void} mgl_set_light (@code{HMGL} gr, @code{int} enable) +@anchor{light} +@deftypefn {MGL command} {} light @code{[val=on]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{bool} Light (@code{bool} enable) +@deftypefnx {C function} @code{void} mgl_set_light (@code{HMGL} gr, @code{int} enable) +@end ifclear Включает/выключает освещение графика и возвращает предыдущее состояние. По умолчанию освещение выключено. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Light (@code{int} n, @code{bool} enable) -@deftypefnx {Функция С} @code{void} mgl_set_light_n (@code{HMGL} gr, @code{int} n, @code{int} enable) +@deftypefn {MGL command} {} light @code{num} @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Light (@code{int} n, @code{bool} enable) +@deftypefnx {C function} @code{void} mgl_set_light_n (@code{HMGL} gr, @code{int} n, @code{int} enable) +@end ifclear Включает/выключает @var{n}-ый источник света. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} AddLight (@code{int} n, @code{float} x, @code{float} y, @code{float} z, @code{char} c=@code{'w'}) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} Light (@code{int} n, @code{mglPoint} p, @code{char} c=@code{'w'}, @code{float} bright=@code{0.5}, @code{bool} infty=@code{true}) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} Light (@code{int} n, @code{mglPoint} p, @code{mglColor} c, @code{float} bright=@code{0.5}, @code{bool} infty=@code{true}) -@deftypefnx {Функция С} @code{void} mgl_add_light (@code{HMGL} gr, @code{int} n, @code{float} x, @code{float} y, @code{float} z, @code{char} c) +@deftypefn {MGL command} {} light @code{num xpos ypos zpos} ['col'='w' @code{br=0.5}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} AddLight (@code{int} n, @code{mglPoint} p, @code{char} c=@code{'w'}, @code{float} bright=@code{0.5}, @code{bool} infty=@code{true}, @code{float} ap=@code{0}) +@deftypefnx {C function} @code{void} mgl_add_light (@code{HMGL} gr, @code{int} n, @code{float} x, @code{float} y, @code{float} z, @code{char} c) +@deftypefnx {C function} @code{void} mgl_add_light_ext (@code{HMGL} gr, @code{int} n, @code{float} x, @code{float} y, @code{float} z, @code{char} c, @code{float} bright, @code{int} infty, @code{float} ap) +@end ifclear Добавляет источник света с номером @var{n} в положение @var{p} с цветом @var{c} и яркостью @var{bright}, которая должна быть в диапазоне [0,1]. Флаг @var{infty}=@code{true} делает источник бесконечно удаленным (для более быстрого рисования). @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Ambient (@code{float} bright=@code{0.5}) +@anchor{ambient} +@deftypefn {MGL command} {} ambient @code{val} +@ifclear UDAV +@deftypefnx {Метод класса @code{mglGraph}} @code{void} SetAmbient (@code{float} bright=@code{0.5}) @deftypefnx {Функция С} @code{void} mgl_set_ambbr (@code{HMGL} gr, @code{float} bright) +@end ifclear Задает яркость рассеянного освещения. Значение должно быть в диапазоне [0,1]. @end deftypefn @@ -132,106 +175,87 @@ @subsection Туман @cindex Fog -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Fog (@code{float} d, @code{float} dz=@code{0.25}) -@deftypefnx {Функция С} @code{void} mgl_set_fog (@code{HMGL} gr, @code{float} d, @code{float} dz) +@anchor{fog} +@deftypefn {MGL command} {} fog @code{val [dz=0.25]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Fog (@code{float} d, @code{float} dz=@code{0.25}) +@deftypefnx {C function} @code{void} mgl_set_fog (@code{HMGL} gr, @code{float} d, @code{float} dz) +@end ifclear Имитирует туман на графике. Туман начинается на относительном расстоянии @var{dz} от точки обзора и его плотность растет экспоненциально вглубь по закону ~@math{1-exp(-d*z)}. Здесь @emph{z} -- нормализованная на 1 глубина графика. Если @var{d}=@code{0} то туман отсутствует. @sref{Surface in fog sample} @end deftypefn @c ================================================================== -@node Default sizes, Zooming, Fog, Graphics setup +@node Default sizes, Cutting, Fog, Graphics setup @subsection Базовые размеры -@cindex SetTickLen -@cindex SetTickStl +@ifclear UDAV @cindex SetBarWidth @cindex SetMarkSize @cindex SetArrowSize -@cindex SetBaseLineWidth +@cindex SetMeshNum +@cindex SetPlotId +@end ifclear +@cindex BarWidth +@cindex MarkSize +@cindex ArrowSize +@cindex MeshNum Эти функции задают величины большинства параметров графика, включая размеры маркеров, стрелок, толщину линий и т.д. Как и любые другие настройки, они подействуют только на графики созданные после изменения настроек. -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetBarWidth ( @code{float} val) -@deftypefnx {Функция С} @code{void} mgl_set_bar_width (@code{HMGL} gr, @code{float} val) +@anchor{barwidth} +@deftypefn {MGL command} {} barwidth @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetBarWidth ( @code{float} val) +@deftypefnx {C function} @code{void} mgl_set_bar_width (@code{HMGL} gr, @code{float} val) +@end ifclear Задает относительный размер прямоугольников в Bars, Barh, BoxPlot (@pxref{Bars}). Значение по умолчанию @code{0.7}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetMarkSize (@code{float} val) -@deftypefnx {Функция С} @code{void} mgl_set_mark_size (@code{HMGL} gr, @code{float} val) +@anchor{marksize} +@deftypefn {MGL command} {} marksize @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetMarkSize (@code{float} val) +@deftypefnx {C function} @code{void} mgl_set_mark_size (@code{HMGL} gr, @code{float} val) +@end ifclear Задает размер маркеров для @ref{1D plotting}. Значение по умолчанию @code{0.02}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetArrowSize (@code{float} val) -@deftypefnx {Функция С} @code{void} mgl_set_arrow_size (@code{HMGL} gr, @code{float} val) +@anchor{arrowsize} +@deftypefn {MGL command} {} arrowsize @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetArrowSize (@code{float} val) +@deftypefnx {C function} @code{void} mgl_set_arrow_size (@code{HMGL} gr, @code{float} val) +@end ifclear Задает размер стрелок для @ref{1D plotting}, линий и кривых (@pxref{Primitives drawing}). Значение по умолчанию @code{0.03}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetBaseLineWidth (@code{float} val) -@deftypefnx {Функция С} @code{void} mgl_set_base_line_width (@code{HMGL} gr, @code{float} val) -Задает базовую толщину линий. Значения <1 игнорируются. Для значений >1 реальная толщина получается перемножением указанной ширины линии на данное значение. Увеличение ширины линии актуально для больших растровых рисунков. Значение по умолчанию @code{1}. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetTickLen (@code{float} val, @code{float} stt=@code{1}) -@deftypefnx {Функция С} @code{void} mgl_set_tick_len (@code{HMGL} gr, @code{float} val, @code{float} stt) -Задает относительную длину меток осей координат. Значение по умолчанию @code{0.1}. Параметр @var{stt}>0 задает относительную длину подметок, которые в @code{sqrt(1+stt)} раз меньше. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetTickStl (@code{const char *}stl, @code{const char *}sub=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_set_tick_stl (@code{HMGL} gr, @code{const char *}stl, @code{const char *}sub) -Задает стиль меток (@var{stl}) и подметок (@var{sub}) осей координат. Если @var{stl} пустая или ноль, то используется стиль по умолчанию (@samp{k} или @samp{w} в зависимости от типа прозрачности). Если @var{sub} пустая или ноль, то используется стиль меток (т.е. @var{stl}). -@end deftypefn - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{float} BarWidth -Относительная ширина боксов. См. @code{SetBarWidth()}. -@end deftypecv - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{float} MarkSize -Размер маркеров. См. @code{SetMarkSize()}. -@end deftypecv - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{float} ArrowSize -Размер стрелок. См. @code{SetArrowSize()}. -@end deftypecv - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{float} BaseLineWidth -Базовая ширина линий. См. @code{SetBaseLineWidth()}. -@end deftypecv - -@c ================================================================== -@node Zooming, Cutting, Default sizes, Graphics setup -@subsection Масштабирование -@cindex SetPlotFactor -@cindex Zoom - -Эти функции управляют масштабированием всего рисунка (см Zoom()) или отдельной картинки (см PlotFactor). Обычно эти функции используются для удаления пустого места вокруг графиков. - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetPlotFactor (@code{float} val) -@deftypefnx {Функция С} @code{void} mgl_set_plotfactor (@code{HMGL} gr, @code{float} val) -Задает масштаб картинки (значение должно быть больше 1). Не рекомендуется устанавливать значения меньше 1.5. Это аналог функции Zoom(), но применяется только к конкретной картинке, заданной InPlot. Используйте ноль для включения автоматического масштабирования. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Zoom (@code{float} x1, @code{float} y1, @code{float} x2, @code{float} y2) -@deftypefnx {Функция С} @code{void} mgl_set_zoom (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} x2, @code{float} y2) -Масштабирует весь рисунок. После вызова функции текущий график будет очищен и в дальнейшем рисунок будет содержать только область [x1,x2]*[y1,y2] от исходного рисунка. Координаты @var{x1}, @var{x2}, @var{y1}, @var{y2} меняются в диапазоне от 0 до 1. Внимание! эти настройки не могут быть переписаны никакими другими функциями. Используйте @code{Zoom(0,0,1,1)} для перехода в масштаб по умолчанию. +@anchor{meshnum} +@anchor{MeshNum} +@deftypefn {MGL command} {} meshnum @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetMeshNum (@code{int} val) +@deftypefnx {C function} @code{void} mgl_set_meshnum (@code{HMGL} gr, @code{int} num) +@end ifclear +Задает ориентировочное число линий в Mesh(), Fall(), Grid() и число стрелок (штрихов) в Vect(), Dew() и число ячеек в Cloud*(). По умолчанию (=0) рисуются все линии, стрелки, ячейки. @end deftypefn -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{float} PlotFactor -Множитель масштаба картинки. См. @code{SetPlotFactor()}. -@end deftypecv - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{bool} AutoPlotFactor -Включает/выключает автоматическое изменение PlotFactor при вращении графика. См. @code{SetPlotFactor()}. -@end deftypecv - @c ================================================================== -@node Cutting, Font settings, Zooming, Graphics setup +@node Cutting, Font settings, Default sizes, Graphics setup @subsection Обрезание +@ifclear UDAV @cindex SetCut @cindex SetCutBox @cindex CutOff +@end ifclear +@cindex Cut Эти функции задают условия когда точка будет исключена (вырезана) из рисования. Замечу, что все точки со значением(-ями) NAN по одной из координат или амплитуде автоматически исключаются из рисования. -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetCut (@code{bool} val) -@deftypefnx {Функция С} @code{void} mgl_set_cut (@code{HMGL} gr, @code{int} val) +@anchor{cut} +@deftypefn {MGL command} {} cut @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetCut (@code{bool} val) +@deftypefnx {C function} @code{void} mgl_set_cut (@code{HMGL} gr, @code{int} val) +@end ifclear Задает обрезание точек за пределами осей координат. Если @code{true} то такие точки исключаются из рисования (это по умолчанию) иначе они проецируются на ограничивающий прямоугольник. @end deftypefn @@ -240,156 +264,125 @@ @caption{Левый рисунок нарисован при @code{Cut=false}, правый при @code{Cut=true}.} @end float -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetCutBox (@code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2) -@deftypefnx {Функция С} @code{void} mgl_set_cut_box (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2) +@deftypefn {MGL command} {} cut @code{x1 y1 z1 x2 y2 z2} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetCutBox (@code{mglPoint} p1, @code{mglPoint} p1) +@deftypefnx {C function} @code{void} mgl_set_cut_box (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2) +@end ifclear Задает границы параллелепипеда внутри которого точки не рисуются. Если границы одинаковы (переменные равны), то параллелепипеда считается пустым. @sref{CutMinMax sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} CutOff (@code{const char *}EqC) -@deftypefnx {Функция С} @code{void} mgl_set_cutoff (@code{HMGL} gr, @code{const char *}EqC) -Задает условие обрезания по формуле @var{EqC}. Это условие исключает точки из рисования если результат вычисления формулы не равен нулю. Установите аргумент @code{""} для выключения условия обрезания. @sref{CutOff sample} +@deftypefn {MGL command} {} cut 'cond' +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} CutOff (@code{const char *}cond) +@deftypefnx {C function} @code{void} mgl_set_cutoff (@code{HMGL} gr, @code{const char *}cond) +@end ifclear +Задает условие обрезания по формуле @var{cond}. Это условие исключает точки из рисования если результат вычисления формулы не равен нулю. Установите аргумент @code{""} для выключения условия обрезания. @sref{CutOff sample} @end deftypefn -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{bool} Cut -Флаг рисования точек вне осей координат. См. @code{SetCut()}. -@end deftypecv - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{mglPoint} {CutMin, CutMax} -Нижний и верхний угол параллелепипеда внутри которого точки не рисуются. См. @code{SetCutBox()}. -@end deftypecv - @c ================================================================== @node Font settings, Palette and colors, Cutting, Graphics setup @subsection Шрифты +@ifclear UDAV @cindex SetFontSize @cindex SetFontDef @cindex SetRotatedText @cindex SetFontSizePT @cindex SetFontSizeCM @cindex SetFontSizeIN -@cindex SetFont -@cindex GetFont @cindex LoadFont @cindex CopyFont @cindex RestoreFont +@end ifclear +@cindex Font +@cindex RotateText -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetFontSize (@code{float} val) -@deftypefnx {Функция С} @code{void} mgl_set_font_size (@code{HMGL} gr, @code{float} val) -Задает базовый размер шрифта. По умолчанию размер подписей оси координат в 1.4 раза больше. +@anchor{font} +@deftypefn {MGL command} {} font 'fnt' [@code{val=6}] +Задает стиль и размер шрифта (@pxref{Text printing}). Вначале используется @samp{:rC} -- прямой шрифт с выравниванием по центру. По умолчанию размер подписей оси координат в 1.4 раза больше. См. также @pxref{Font styles}. +@end deftypefn + +@anchor{rotatetext} +@deftypefn {MGL command} {} rotatetext @code{val} +@deftypefnx {Method on @code{mglGraph}} @code{void} SetRotatedText (@code{bool} val) +@deftypefnx {C function} @code{void} mgl_set_rotated_text (@code{HMGL} gr, @code{int} val) +Включает/выключает вращение меток и подписей осей координат вдоль оси. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetFontDef (@code{const char *}fnt) -@deftypefnx {Функция С} @code{void} mgl_set_font_def (@code{HMGL} gr, @code{const char *} val) +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} SetFontDef (@code{const char *}fnt) +@deftypefnx {C function} @code{void} mgl_set_font_def (@code{HMGL} gr, @code{const char *} val) Задает стиль шрифта (@pxref{Text printing}). По умолчанию используется @samp{rC} -- прямой шрифт с выравниванием по центру. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetRotatedText (@code{bool} val) -@deftypefnx {Функция С} @code{void} mgl_set_rotated_text (@code{HMGL} gr, @code{int} val) -Включает/выключает вращение меток и подписей осей координат вдоль оси. +@deftypefn {Метод класса @code{mglGraph}} @code{void} SetFontSize (@code{float} val) +@deftypefnx {Функция С} @code{void} mgl_set_font_size (@code{HMGL} gr, @code{float} val) +Задает базовый размер шрифта. По умолчанию размер подписей оси координат в 1.4 раза больше. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} LoadFont (@code{const char *}name, @code{const char *}path=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} SetFontSizePT (@code{float} cm, @code{int} dpi=@code{72}) +Задает размер шрифта в пунктах для заданного DPI (по умолчанию 16 pt для dpi=72). +@end deftypefn +@deftypefn {Метод класса @code{mglGraph}} @code{inline void} SetFontSizeCM (@code{float} cm, @code{int} dpi=@code{72}) +Задает размер шрифта в сантиметрах для заданного DPI (по умолчанию 0.56 см = 16 pt). +@end deftypefn +@deftypefn {Метод класса @code{mglGraph}} @code{inline void} SetFontSizeIN (@code{float} cm, @code{int} dpi=@code{72}) +Задает размер шрифта в дюймах для заданного DPI (по умолчанию 0.22 in = 16 pt). +@end deftypefn + +@deftypefn {Метод класса @code{mglGraph}} @code{void} LoadFont (@code{const char *}name, @code{const char *}path=@code{""}) @deftypefnx {Функция С} @code{void} mgl_load_font (@code{HMGL} gr, @code{const char *}name, @code{const char *}path) Загружает начертание шрифта из файла @var{path}/@var{name}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} CopyFont (@code{mglGraph *} from) +@deftypefn {Метод класса @code{mglGraph}} @code{void} CopyFont (@code{mglGraph *} from) @deftypefnx {Функция С} @code{void} mgl_copy_font (@code{HMGL} gr, @code{HMGL} gr_from) Копирует начертание шрифта из другого объекта @code{mglGraph}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} RestoreFont () +@deftypefn {Метод класса @code{mglGraph}} @code{void} RestoreFont () @deftypefnx {Функция С} @code{void} mgl_restore_font (@code{HMGL} gr) Восстанавливает начертание шрифта по умолчанию. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} SetFontSizePT (@code{float} cm, @code{int} dpi=@code{72}) -Задает размер шрифта в пунктах для заданного DPI (по умолчанию 16 pt для dpi=72). -@end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{inline void} SetFontSizeCM (@code{float} cm, @code{int} dpi=@code{72}) -Задает размер шрифта в сантиметрах для заданного DPI (по умолчанию 0.56 см = 16 pt). -@end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{inline void} SetFontSizeIN (@code{float} cm, @code{int} dpi=@code{72}) -Задает размер шрифта в дюймах для заданного DPI (по умолчанию 0.22 in = 16 pt). -@end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} SetFont (@code{mglFont *}f) -Задает начертание шрифта. Замечу, что каждый объект mglFont может использоваться @emph{только с одним} объектом mglGraph в каждый момент времени! Если @code{f==NULL}, то используется начертание по умолчанию. -@end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{inline mglFont *}GetFont () -Возвращает текущее начертание шрифта. Указатель правилен только до следующего вызова функции SetFont()! -@end deftypefn - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{float} FontSize -Размер шрифта. См. @code{SetFontSize()}. -@end deftypecv -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{char} FontDef@code{[32]} -Стиль шрифта. См. @code{SetFontDef()}. -@end deftypecv -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{bool} RotatedText -Флаг вращения меток и подписей к осям координат. -@end deftypecv +@end ifclear @c ================================================================== @node Palette and colors, Error handling, Font settings, Graphics setup @subsection Палитра и цвета -@cindex SetPalColor -@cindex SetPalNum +@ifclear UDAV @cindex SetPalette -@cindex SetScheme -@cindex SelectPen - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetPalette (@code{const char *}@var{colors}) -@deftypefnx {Функция С} @code{void} mgl_set_palette (@code{HMGL} gr, @code{const char *}@var{colors}) +@end ifclear +@cindex Palette + +@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}) +@end ifclear Задает палитру как последовательность цветов. Значение по умолчанию @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 графиках (@pxref{1D plotting}) для кривых с неопределенным стилем линии. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetPalColor (@code{int} n, @code{float} r, @code{float} g, @code{float} b) -@deftypefnx {Функция С} @code{void} mgl_set_pal_color (@code{HMGL} gr, @code{int} n, @code{float} r, @code{float} g, @code{float} b) -Задает цвет отдельной ячейки палитры. См. функцию @code{SetPalette()} для упрощенного задания палитры. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetPalNum (@code{int} num) -@deftypefnx {Функция С} @code{void} mgl_set_pal_num (@code{HMGL} gr, @code{int} num) -Задает число цветов в палитре. Значение должно быть меньше 100. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetScheme (@code{const char *}sch) -@deftypefnx {Функция С} @code{void} mgl_set_scheme (@code{HMGL} gr, @code{const char *}sch) -Задает цветовую схему. Обычно функция вызывается внутри библиотеки. @xref{Color scheme}. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} SelectPen (@code{const char *}sch) -Задает стиль линий и маркеров. Обычно функция вызывается внутри библиотеки. @xref{Line styles}. -@end deftypefn - - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{mglColor} Pal@code{[101]} -Палитра @ref{1D plotting}. См. @code{SetPalette()}. -@end deftypecv - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{int} NumPal -Число цветов в палитре. См. @code{SetPalette()}. -@end deftypecv - @c ================================================================== -@node Error handling, Other settings, Palette and colors, Graphics setup +@node Error handling, , Palette and colors, Graphics setup @subsection Обработка ошибок - +@ifclear UDAV @cindex Message -@cindex GetWarnCode @cindex SetWarn +@cindex GetWarn Есть 2 переменные показывающие наличие предупреждения/ошибки при создании графика. Обычно вы должны сбросить их с помощью @code{SetWarn(0);} перед построением и проверить переменную @var{WarnCode} на наличие ошибок после построения. Только последнее предупреждение сохраняется. Замечу, что все предупреждения/ошибки в MathGL не являются критичными -- в худшем из вариантов соответствующий график просто не будет построен. -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} SetWarn (@code{int} code, @code{const char *}who=@code{""}) -Задает код предупреждения и поясняющее сообщение от функции @var{who}. Обычно вызывается только для очистки предупреждений (@code{SetWarn(0);}) или внутри библиотеки. +@deftypefn {Метод класса @code{mglGraph}} @code{void} SetWarn (@code{int} code) +Задает код предупреждения. Обычно вызывается только для очистки предупреждений (@code{SetWarn(0);}) или внутри библиотеки. @end deftypefn -@deftypecv {Переменная(C++)} mglGraph @code{char *} Message -Указатель на строку для вывода сообщений библиотеки о причине отсутствия графика. Если равен NULL, то сообщения не выводятся. Размер буфера должен быть не менее 1024 байт. Если Message[0]==0, то сообщений нет. -@end deftypecv +@deftypefn {Метод класса @code{mglGraph}} @code{void} Message (@code{char *}buf) +Задает буфер для вывода сообщений библиотеки о причине отсутствия графика. Если равен NULL, то сообщения не выводятся. Размер буфера должен быть не менее 1024 байт. Если @var{buf}[0]==0, то сообщений нет. +@end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{int} GetWarn () +@deftypefn {Method on @code{mglGraph}} @code{int} GetWarn () @deftypefnx {C function} @code{int} mgl_get_warn (@code{HMGL} gr) Возвращает код сообщения о причине отсутствия графика. Возможные значения: @table @code @@ -425,57 +418,8 @@ Setsize: размер(ы) равны нулю или отрицательны Формат не поддерживается @end table @end deftypefn +@end ifclear -@deftypecv {Устаревшая переменная} mglGraph @code{int} WarnCode -Код сообщения о причине отсутствия графика. -@end deftypecv - -@c ================================================================== -@node Other settings, , Error handling, Graphics setup -@subsection Прочие настройки -@cindex SetMeshNum -@cindex SetAxialDir -@cindex SetDrawFace -@cindex PlotId - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetMeshNum (@code{int} val) -@deftypefnx {Функция С} @code{void} mgl_set_meshnum (@code{HMGL} gr, @code{int} num) -Задает ориентировочное число линий в Mesh(), Fall(), Grid() и число стрелок (штрихов) в Vect(), Dew() и число ячеек в Cloud*(). По умолчанию (=0) рисуются все линии, стрелки, ячейки. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetAxialDir (@code{char} val) -@deftypefnx {Функция С} @code{} mgl_set_axial_dir (@code{HMGL} gr, @code{char} dir) -Задает ось вращения для Axial() и Torus(). По умолчанию это 'z'. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetDrawFace (@code{bool} val) -@deftypefnx {Функция С} @code{void} mgl_set_draw_face (@code{HMGL} gr, @code{int} val) -Запрещает/разрешает рисование граней. Запрет вывода граней позволяет ускорить рисование (например для вращения картинки). -@end deftypefn - -@deftypecv {Переменная(C++)} mglGraph @code{const char *} PlotId -Идентификатор рисунка для сохранения в файл. -@end deftypecv - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{int} MeshNum -Число линий, стрелок, ячеек. См. @code{SetMeshNum()}. -@end deftypecv - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{char} AxialDir -Ось вращения. См. @code{SetAxialDir()}. -@end deftypecv - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{bool} DrawFace -Флаг запрета рисования граней. См. @code{SetDrawFace()}. -@end deftypecv - -@deftypecv {Переменная(C++)} mglGraph @code{int} CirclePnts -Число точек при аппроксимации окружности в @ref{Primitives drawing}, @ref{Tube}, @ref{Pipe} и т.д. По умолчанию 40. -@end deftypecv - -@deftypecv {Переменная(C++)} mglGraph @code{int} GridPnts -Число точек при построении линий сеток -- важно для криволинейных координат. По умолчанию 50. -@end deftypecv @c ================================================================== @node Axis settings, Transformation matrix, Graphics setup, MathGL core @@ -484,278 +428,427 @@ Setsize: размер(ы) равны нулю или отрицательны Эти функции управляет видом и масштабом осей координат. Перед построением для каждой точки выполняются 3 преобразования: сначала определяется возможность рисования точки (@pxref{Cutting}), далее применяются формулы перехода к криволинейным координатам и наконец точка отображается. @menu -* Ranges (bounding box):: -* Transformation:: -* Ticks:: +* Ranges (bounding box):: +* Transformation:: +* Ticks:: @end menu @c ------------------------------------------------------------------ @node Ranges (bounding box), Transformation, , Axis settings @subsection Масштаб осей координат -@cindex Axis -@cindex CAxis +@cindex CRange @cindex XRange @cindex YRange @cindex ZRange -@cindex Min -@cindex Max -@cindex Cmin -@cindex Cmax -@cindex RecalcBorder -@cindex Org -@cindex AutoOrg +@cindex Ranges +@cindex Origin +@ifclear UDAV +@cindex SetRange @cindex SetRanges -@cindex SetAutoRanges - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetRanges (@code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2, @code{float} z1=@code{0}, @code{float} z2=@code{0}) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} Axis (@code{mglPoint} min, @code{mglPoint} max, @code{mglPoint} org=@code{mglPoint(NAN,NAN,NAN)}) -@deftypefnx {Функция С} @code{void} mgl_set_axis_2d (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} x2, @code{float} y2) -@deftypefnx {Функция С} @code{void} mgl_set_axis_3d (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2) -Безопасным образом задает значения переменных @var{Min}, @var{Max} и @var{Org}. Если минимальное и максимальное значение координаты равны, то они игнорируются по данному направлению. Эта функция также устанавливает размер цветовой шкалы @var{Cmin}=@code{Min.z} и @var{Cmax}=@code{Max.z} -- это режим по умолчанию для 2d графиков. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetCRange (@code{float} min, @code{float} max) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} CAxis (@code{float} min, @code{float} max) -@deftypefnx {Функция С} @code{void} mgl_set_caxis (@code{HMGL} gr, @code{float} min, @code{float} max) -Задает масштаб цветовой шкалы. Эти значения используются для определения цвета поверхностей и прочих 2D и 3D графиков. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} XRange (@code{const mglData &} dat, @code{bool} add=@code{false}, @code{float} fact=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_set_xrange (@code{HMGL} gr, @code{const HMDT} a, @code{int} add) -Задает масштаб по оси X как минимальное и максимальное значение массива @var{a}. Параметр @var{add} указывает добавлять новый диапазон к существующему или заменять его. Параметр @var{fact} дополнительно расширяет диапазон на величину (@var{Max}-@var{Min})*@var{fact}. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} YRange (@code{const mglData &} dat, @code{bool} add=@code{false}, @code{float} fact=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_set_yrange (@code{HMGL} gr, @code{const HMDT} a, @code{int} add) -Задает масштаб по оси Y как минимальное и максимальное значение массива @var{a}. Параметр @var{add} указывает добавлять новый диапазон к существующему или заменять его. Параметр @var{fact} дополнительно расширяет диапазон на величину (@var{Max}-@var{Min})*@var{fact}. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ZRange (@code{const mglData &} dat, @code{bool} add=@code{false}, @code{float} fact=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_set_zrange (@code{HMGL} gr, @code{const HMDT} a, @code{int} add) -Задает масштаб по оси Z как минимальное и максимальное значение массива @var{a}. Параметр @var{add} указывает добавлять новый диапазон к существующему или заменять его. Параметр @var{fact} дополнительно расширяет диапазон на величину (@var{Max}-@var{Min})*@var{fact}. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} CRange (@code{const mglData &} dat, @code{bool} add=@code{false}, @code{float} fact=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_set_crange (@code{HMGL} gr, @code{const HMDT} a, @code{int} add) -Задает цветовой масштаб как минимальное и максимальное значение массива @var{a}. Параметр @var{add} указывает добавлять новый диапазон к существующему или заменять его. Параметр @var{fact} дополнительно расширяет диапазон на величину (@var{Max}-@var{Min})*@var{fact}. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetAutoRanges (@code{float} x1, @code{float} x2, @code{float} y1=@code{0}, @code{float} y2=@code{0}, @code{float} z1=@code{0}, @code{float} z2=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_set_auto (@code{HMGL} gr, @code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2, @code{float} z1, @code{float} z2) -Задает масштаб "автоматических" (не указанных явно) переменных. Функция меняет значения @var{Min}, @var{Max} буз вызова RecalcBorder(). Если минимальное и максимальное значение координаты равны, то они игнорируются по данному направлению. Замечу, что этот масштаб становится масштабом осей при следующем вызове функций [XYZ]Range(). -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetOrigin (@code{float} x0, @code{float} y0, @code{float} z0=@code{NAN}) -@deftypefnx {Функция С} @code{void} mgl_set_origin (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0) +@cindex SetOrigin +@end ifclear + +@anchor{xrange} +@anchor{yrange} +@anchor{zrange} +@anchor{crange} +@deftypefn {MGL command} {} xrange @code{v1 v2} +@deftypefnx {MGL command} {} yrange @code{v1 v2} +@deftypefnx {MGL command} {} zrange @code{v1 v2} +@deftypefnx {MGL command} {} crange @code{v1 v2} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetRange (@code{char} dir, @code{float} v1, @code{float} v2) +@deftypefnx {C function} @code{void} mgl_set_range_val (@code{HMGL} gr, @code{char} dir, @code{float} v1, @code{float} v2) +@end ifclear +Задает диапазон изменения @samp{x}-,@samp{y}-,@samp{z}-,@samp{c}-координат. См. также @ref{ranges}. +@end deftypefn + + +@deftypefn {MGL command} {} xrange dat [@code{add=off}] +@deftypefnx {MGL command} {} yrange dat [@code{add=off}] +@deftypefnx {MGL command} {} zrange dat [@code{add=off}] +@deftypefnx {MGL command} {} crange dat [@code{add=off}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetRange (@code{char} dir, @code{const mglData &}dat, @code{bool} add=@code{false}) +@deftypefnx {C function} @code{void} mgl_set_range_dat (@code{HMGL} gr, @code{char} dir, @code{const HCDT} a, @code{int} add) +@end ifclear +Задает диапазон изменения @samp{x}-,@samp{y}-,@samp{z}-,@samp{c}-координат как минимальное и максимальное значение массива @var{dat}. Параметр @var{add} указывает добавлять новый диапазон к существующему или заменять его. +@end deftypefn + +@anchor{ranges} +@deftypefn {MGL command} {} ranges @code{x1 x2 y1 y2 [z1=0 z2=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetRanges (@code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2, @code{float} z1=@code{0}, @code{float} z2=@code{0}) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetRanges (@code{mglPoint} p1, @code{mglPoint} p2) +@deftypefnx {C function} @code{void} mgl_set_ranges (@code{HMGL} gr, @code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2, @code{float} z1, @code{float} z2) +@end ifclear +Задает диапазон изменения координат. Если минимальное и максимальное значение координаты равны, то они игнорируются по данному направлению. Также устанавливает размер цветовой шкалы, аналогично команде @code{crange z1 z2}. Начальные диапазоны равны [-1, 1]. +@end deftypefn + +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} SetRanges (@code{const mglData &}xx, @code{const mglData &}yy) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetRanges (@code{const mglData &}xx, @code{const mglData &}yy, @code{const mglData &}zz) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetRanges (@code{const mglData &}xx, @code{const mglData &}yy, @code{const mglData &}zz, @code{const mglData &}cc) +Задает диапазон изменения @samp{x}-,@samp{y}-,@samp{z}-,@samp{c}-координат как минимальное и максимальное значение массивов @var{xx}, @var{yy}, @var{zz}, @var{cc} соответственно. +@end deftypefn +@end ifclear + +@anchor{origin} +@deftypefn {MGL command} {} origin @code{x0 y0 [z0=nan]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetOrigin (@code{float} x0, @code{float} y0, @code{float} z0=@code{NAN}) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetOrigin (@code{mglPoint} p0) +@deftypefnx {C function} @code{void} mgl_set_origin (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0) +@end ifclear Задает центр пересечения осей координат. Если одно из значений равно NAN, то MathGL попытается выбрать оптимальное положение осей координат по этому направлению. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} RecalcBorder () -Повторно вычисляет внутренние параметры для правильного применения функций перехода в криволинейную систему координат. @strong{Должна быть вызвана} после каждого прямого изменения переменных @var{Min}, @var{Max}, @var{fx}, @var{fy}, @var{fz} если их изменение должно отразиться на графике. -@end deftypefn - -@deftypecv {Переменная(C++)} mglGraph @code{mglPoint} {Min, Max} -Масштаб осей координат. Эти переменные используются также для определения диапазона "автоматических" массивов (массивов не указанных явно при построении графика). Вы можете изменить их перед построением графика и потом вернуть их назад. В результате график будет в указанном диапазоне, а не в диапазоне осей координат. @strong{НО} если вы хотите поменять масштаб осей, то вы @strong{должны} вызвать функцию @code{RecalcBorder();}. -@end deftypecv - -@deftypecv {Переменная(C++)} mglGraph @code{float} {Cmin, Cmax} -Масштаб цветовой шкалы. См. @code{CAxis(), CRange()}. -@end deftypecv - -@deftypecv {Переменная(C++)} mglGraph @code{mglPoint} Org -Центр пересечения осей координат. См. @code{SetOrigin()}. -@end deftypecv - -@deftypecv {Переменная(C++)} mglGraph @code{bool} AutoOrg -Флаг для автоматического сдвига осей координат если их центр пересечения лежит вне диапазона осей координат @var{Min} ... @var{Max}. -@end deftypecv - @c ------------------------------------------------------------------ @node Transformation, Ticks, Ranges (bounding box), Axis settings @subsection Криволинейные координаты +@cindex Axis +@ifclear UDAV @cindex SetFunc @cindex SetCoor @cindex Ternary +@end ifclear -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetFunc (@code{const char *}EqX, @code{const char *}EqY, @code{const char *}EqZ=@code{""}, @code{const char *}EqA=@code{""}) -@deftypefnx {Функция С} @code{void} mgl_set_func (@code{HMGL} gr, @code{const char *}EqX, @code{const char *}EqY, @code{const char *}EqZ) -@deftypefnx {Функция С} @code{void} mgl_set_func_ext (@code{HMGL} gr, @code{const char *}EqX, @code{const char *}EqY, @code{const char *}EqZ, @code{const char *}EqA) +@deftypefn {MGL command} {} axis 'fx' 'fy' ['fz'='' 'fa'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetFunc (@code{const char *}EqX, @code{const char *}EqY, @code{const char *}EqZ=@code{""}, @code{const char *}EqA=@code{""}) +@deftypefnx {C function} @code{void} mgl_set_func (@code{HMGL} gr, @code{const char *}EqX, @code{const char *}EqY, @code{const char *}EqZ, @code{const char *}EqA) +@end ifclear Задает формулы перехода к криволинейным координатам. Каждая строка является математическим выражением, зависящим от старых координат @samp{x}, @samp{y}, @samp{z} и @samp{a} или @samp{c} для цветовой шкалы. Например, для цилиндрических координат будет @code{Axis("x*cos(y)", "x*sin(y)", "z");}. Для удаления формул соответствующий параметр должен быть пустым или @code{NULL}. Использование формул преобразования слегка замедляет программу, т.е.. @code{Axis("", "", "")} быстрее чем @code{Axis("1*x", "1*y", "1*z")}. Параметр @var{EqA} задает аналогичную формулу для цветовой шкалы. @xref{Textual formulas}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetCoor (@code{int} how) -@deftypefnx {Функция С} @code{void} mgl_set_coor (@code{HMGL} gr, @code{int} how) +@deftypefn {MGL command} {} axis @code{how} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetCoor (@code{int} how) +@deftypefnx {C function} @code{void} mgl_set_coor (@code{HMGL} gr, @code{int} how) +@end ifclear Устанавливает одну из предопределенных систем криволинейных координат в зависимости от параметра @var{how}: @code{mglCartesian=0} -- декартова система (нет преобразования координат, наиболее быстрая); @code{mglPolar=1} -- полярные координаты @math{x_n=x*cos(y),y_n=x*sin(y), z_n=z}; @code{mglSpherical=2} -- сферические координаты @math{x_n=x*sin(y)*cos(z), y_n=x*sin(y)*sin(z), z_n=x*cos(y)}; @code{mglParabolic=3} -- параболические координаты @math{x_n=x*y, y_n=(x*x-y*y)/2, z_n=z}; @code{mglParaboloidal=4} -- Paraboloidal coordinates @math{x_n=(x*x-y*y)*cos(z)/2, y_n=(x*x-y*y)*sin(z)/2, z_n=x*y}; @code{mglOblate=5} -- Oblate coordinates @math{x_n=cosh(x)*cos(y)*cos(z), y_n=cosh(x)*cos(y)*sin(z), z_n=sinh(x)*sin(y)}; @code{mglProlate=6} -- Prolate coordinates @math{x_n=sinh(x)*sin(y)*cos(z), y_n=sinh(x)*sin(y)*sin(z), z_n=cosh(x)*cos(y)}; @code{mglElliptic=7} -- эллиптические координаты @math{x_n=cosh(x)*cos(y), y_n=sinh(x)*sin(y), z_n=z}; @code{mglToroidal=8} -- тороидальные координаты @math{x_n=sinh(x)*cos(z)/(cosh(x)-cos(y)), y_n=sinh(x)*sin(z)/(cosh(x)-cos(y)), z_n=sin(y)/(cosh(x)-cos(y))}; @code{mglBispherical=9} -- бисферические координаты @math{x_n=sin(y)*cos(z)/(cosh(x)-cos(y)), y_n=sin(y)*sin(z)/(cosh(x)-cos(y)), z_n=sinh(x)/(cosh(x)-cos(y))}; @code{mglBipolar=10} -- биполярные координаты @math{x_n=sinh(x)/(cosh(x)-cos(y)), y_n=sin(y)/(cosh(x)-cos(y)), z_n=z}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Ternary (@code{bool} tern) -@deftypefnx {Функция С} @code{void} mgl_set_ternary (@code{HMGL} gr, @code{int} tern) +@anchor{ternary} +@deftypefn {MGL command} {} ternary @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Ternary (@code{bool} tern) +@deftypefnx {C function} @code{void} mgl_set_ternary (@code{HMGL} gr, @code{int} tern) +@end ifclear Задает рисование треугольных (Ternary) осей координат. Это специальный тип графика для 3 зависимых координат (компонент) @var{a}, @var{b}, @var{c} таких, что @var{a}+@var{b}+@var{c}=1. MathGL использует только 2 независимые координаты @var{a}=x и @var{b}=y поскольку их достаточно для построения всех графиков. При этом третья координата z является независимым параметром для построения линий уровня, поверхностей и т.д. @sref{Ternary plot sample} @end deftypefn @c ------------------------------------------------------------------ @node Ticks, , Transformation, Axis settings @subsection Метки осей - +@cindex AxisStl +@cindex TickLen +@cindex Adjust +@cindex XTick +@cindex YTick +@cindex ZTick +@cindex CTick +@ifclear UDAV +@cindex SetAxisStl +@cindex SetTickLen @cindex SetTicks @cindex SetTicksVal @cindex SetTuneTicks -@cindex AdjustTicks -@cindex SetXTT -@cindex SetYTT -@cindex SetZTT -@cindex SetCTT - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} AdjustTicks (@code{const char *}dir=@code{"xyz"}) -@deftypefnx {Функция С} @code{void} mgl_adjust_ticks (@code{HMGL} gr, @code{const char *}dir) -Автоматически задает шаг меток осей, число подметок и начальное положение меток для осей координат @var{dir} в виде наиболее удобном для человека. Также задает @code{SetTuneTicks(true)}. +@cindex SetTickTime +@cindex SetTickTempl +@cindex SetTickRotate +@cindex SetTickSkip +@end ifclear + +@anchor{ticklen} +@deftypefn {MGL command} {} ticklen @code{val} [@code{stt=1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTickLen (@code{float} val, @code{float} stt=@code{1}) +@deftypefnx {C function} @code{void} mgl_set_tick_len (@code{HMGL} gr, @code{float} val, @code{float} stt) +@end ifclear +Задает относительную длину меток осей координат. Значение по умолчанию @code{0.1}. Параметр @var{stt}>0 задает относительную длину подметок, которые в @code{sqrt(1+stt)} раз меньше. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetTicks (@code{char} dir, @code{float} d=@code{-5}, @code{int} ns=@code{0}, @code{float} org=@code{NAN}) -@deftypefnx {Функция С} @code{void} mgl_set_ticks_dir (@code{HMGL} gr, @code{char} dir, @code{float} d, @code{int} ns, @code{float} org) -@deftypefnx {Функция С} @code{void} mgl_set_ticks (@code{HMGL} gr, @code{float} dx, @code{float} dy, @code{float} dz) -@deftypefnx {Функция С} @code{void} mgl_set_subticks (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} nz) -@deftypefnx {Функция С} @code{void} mgl_set_tick_origin (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0) -Задает шаг меток осей @var{d}, число подметок @var{ns} и начальное положение меток @var{org} для оси вдоль направления @var{dir} (используйте 'c' для меток colorbar). Переменная @var{d} задает шаг меток (если положительна) или их число на оси (если отрицательна). Нулевое значение задает логарифмические метки. Если @var{org}=@code{NAN}, то используется значение из переменной @var{Org}. +@deftypefn {MGL command} {} axisstl 'stl' ['tck'='' 'sub'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetAxisStl (@code{const char *}stl=@code{"k"}, @code{const char *}tck=@code{0}, @code{const char *}sub=@code{0}) +@deftypefnx {C function} @code{void} mgl_set_axis_stl (@code{HMGL} gr, @code{const char *}stl, @code{const char *}tck, @code{const char *}sub) +@end ifclear +Задает стиль осей (@var{stl}), меток (@var{tck}) и подметок (@var{sub}) осей координат. Если @var{stl} пустая или ноль, то используется стиль по умолчанию (@samp{k} или @samp{w} в зависимости от типа прозрачности). Если @var{tck}, @var{sub} пустая или ноль, то используется стиль осей (т.е. @var{stl}). @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetTicksVal (@code{char} dir, @code{int} n, @code{float *}val, @code{const char **}lbl) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetTicksVal (@code{char} dir, @code{int} n, @code{float *}val, @code{const wchar_t **}lbl) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} SetTicksVal (@code{char} dir, @code{int} n, @code{float} val1, @code{wchar_t *}lbl1, ...) -@deftypefnx {Функция С} @code{void} mgl_set_ticks_vals (@code{HMGL} gr, @code{char} dir, @code{int} n, @code{float *}val, @code{const char **}lbl) -@deftypefnx {Функция С} @code{void} mgl_set_ticks_val (@code{HMGL} gr, @code{char} dir, @code{int} n, @code{double} val, @code{const char *}lbl, ...) -Задает явное положение @var{val} и подписи @var{lbl} для @var{n} меток вдоль оси @var{dir}. Массивы @var{val} и @var{lbl} должны содержать @var{n} элементов. Используйте @code{SetTicks()} для восстановления автоматических меток. Вы должны быть @strong{очень осторожны} и использовать числа с плавающей точкой (а @emph{не целые!!!}) для положения меток -- из-за ограничений передачи аргументов в библиотеке stdarg. @sref{Manual ticks sample} +@anchor{adjust} +@deftypefn {MGL command} {} adjust ['dir'='xyzc'] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Adjust (@code{const char *}dir=@code{"xyz"}) +@deftypefnx {C function} @code{void} mgl_adjust_ticks (@code{HMGL} gr, @code{const char *}dir) +@end ifclear +Автоматически задает шаг меток осей, число подметок и начальное положение меток для осей координат @var{dir} в виде наиболее удобном для человека. Также задает @code{SetTuneTicks(true)}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetTuneTicks (@code{bool} tune, @code{float} pos=@code{1.15}) -@deftypefnx {Функция С} @code{void} mgl_tune_ticks (@code{HMGL} gr, @code{bool} tune, @code{float} pos) -Включает/выключает улучшение вида меток осей путем вынесения общего множителя (для маленьких, типа 0.001...0.002, или больших, типа 1000...2000, значений координат) или общей компоненты (для узкого диапазона, типа 0.999...1.000). Также задает положение @var{pos} общего множителя на оси: =0 около минимального значения, =1 около максимального значения. +@anchor{xtick} +@anchor{ytick} +@anchor{ztick} +@anchor{ctick} +@deftypefn {MGL command} {} xtick @code{val [sub=0 org=nan]} +@deftypefnx {MGL command} {} ytick @code{val [sub=0 org=nan]} +@deftypefnx {MGL command} {} ztick @code{val [sub=0 org=nan]} +@deftypefnx {MGL command} {} ctick @code{val [sub=0 org=nan]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTicks (@code{char} dir, @code{float} d=@code{0}, @code{int} ns=@code{0}, @code{float} org=@code{NAN}) +@deftypefnx {C function} @code{void} mgl_set_ticks_dir (@code{HMGL} gr, @code{char} dir, @code{float} d, @code{int} ns, @code{float} org) +@deftypefnx {C function} @code{void} mgl_set_ticks(@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} nz) +@end ifclear +Задает шаг меток осей @var{d}, число подметок @var{ns} и начальное положение меток @var{org} для оси вдоль направления @var{dir} (используйте 'c' для меток colorbar). Переменная @var{d} задает шаг меток (если положительна) или их число на оси (если отрицательна). Нулевое значение задает логарифмические метки. Если @var{org}=@code{NAN}, то используется значение из переменной @var{Org}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetXTT (@code{const char *}xtt) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetYTT (@code{const char *}ytt) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetZTT (@code{const char *}ztt) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetCTT (@code{const char *}ctt) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetXTT (@code{const wchar_t *}xtt) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetYTT (@code{const wchar_t *}ytt) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetZTT (@code{const wchar_t *}ztt) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetCTT (@code{const wchar_t *}ctt) -@deftypefnx {Функция С} @code{void} mgl_set_xttw (@code{HMGL} gr, @code{const wchar_t *}xtt) -@deftypefnx {Функция С} @code{void} mgl_set_yttw (@code{HMGL} gr, @code{const wchar_t *}ytt) -@deftypefnx {Функция С} @code{void} mgl_set_zttw (@code{HMGL} gr, @code{const wchar_t *}ztt) -@deftypefnx {Функция С} @code{void} mgl_set_cttw (@code{HMGL} gr, @code{const wchar_t *}ctt) -@deftypefnx {Функция С} @code{void} mgl_set_xtt (@code{HMGL} gr, @code{const wchar_t *}xtt) -@deftypefnx {Функция С} @code{void} mgl_set_ytt (@code{HMGL} gr, @code{const wchar_t *}ytt) -@deftypefnx {Функция С} @code{void} mgl_set_ztt (@code{HMGL} gr, @code{const wchar_t *}ztt) -@deftypefnx {Функция С} @code{void} mgl_set_ctt (@code{HMGL} gr, @code{const wchar_t *}ctt) -Задает шаблоны для меток вдоль x-,y-,z-оси или colorbar. Шаблон может содержать и символы TeX. Если @var{xtt}, @var{ytt}, @var{ztt}, @var{ctt}=@code{""}, то используется шаблон по умолчанию (в простейшем случае @samp{%.2g}). Установка шаблона выключает автоматическое улучшение вида меток (См. @code{SetTuneTicks()}). -@end deftypefn - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{float} {dx, dy, dz} -Шаг меток осей. См. @code{SetTicks()}. -@end deftypecv - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{int} {NSx, NSy, NSz} -Число подметок. См. @code{SetTicks()}. -@end deftypecv - -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{mglPoint} OrgT -Начальная точка для меток. См. @code{SetTicks()}. -@end deftypecv +@deftypefn {MGL command} {} xtick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...] +@deftypefnx {MGL command} {} ytick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...] +@deftypefnx {MGL command} {} ztick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTicksVal (@code{char} dir, @code{const char *}lbl, @code{bool} add=@code{false}) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTicksVal (@code{char} dir, @code{const wchar_t *}lbl, @code{bool} add=@code{false}) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTicksVal (@code{char} dir, @code{const mglData &}val, @code{const char *}lbl, @code{bool} add=@code{false}) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTicksVal (@code{char} dir, @code{const mglData &}val, @code{const wchar_t *}lbl, @code{bool} add=@code{false}) +@deftypefnx {C function} @code{void} mgl_set_ticks_str (@code{HMGL} gr, @code{char} dir, @code{const char *}lbl, @code{bool} add) +@deftypefnx {C function} @code{void} mgl_set_ticks_wcs (@code{HMGL} gr, @code{char} dir, @code{const wchar_t *}lbl, @code{bool} add) +@deftypefnx {C function} @code{void} mgl_set_ticks_val (@code{HMGL} gr, @code{char} dir, @code{HCDT} val, @code{const char *}lbl, @code{bool} add) +@deftypefnx {C function} @code{void} mgl_set_ticks_valw (@code{HMGL} gr, @code{char} dir, @code{HCDT} val, @code{const wchar_t *}lbl, @code{bool} add) +@end ifclear +Задает явное положение @var{val} и подписи @var{lbl} для меток вдоль оси @var{dir}. Если массив @var{val} не указан, то используются значения равнораспределенные в интервале [@var{Min}.x, @var{Max}.x]. Метки разделяются символом @samp{\n}. Используйте @code{SetTicks()} для восстановления автоматических меток. @sref{Manual ticks sample} +@end deftypefn + +@deftypefn {MGL command} {} xtick 'templ' +@deftypefnx {MGL command} {} ytick 'templ' +@deftypefnx {MGL command} {} ztick 'templ' +@deftypefnx {MGL command} {} ctick 'templ' +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTickTempl (@code{char} dir, @code{const char *}templ) +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTickTempl (@code{char} dir, @code{const wchar_t *}templ) +@deftypefnx {C function} @code{void} mgl_set_tick_templ (@code{HMGL} gr, @code{const char *}templ) +@deftypefnx {C function} @code{void} mgl_set_tick_templw (@code{HMGL} gr, @code{const wchar_t *}templ) +@end ifclear +Задает шаблон @var{templ} для меток вдоль x-,y-,z-оси или colorbar. Шаблон может содержать и символы TeX. Если @var{templ}=@code{""}, то используется шаблон по умолчанию (в простейшем случае @samp{%.2g}). Установка шаблона выключает автоматическое улучшение вида меток (См. @code{SetTuneTicks()}). +@end deftypefn + +@deftypefn {MGL command} {} xtick val 'templ' +@deftypefnx {MGL command} {} ytick val 'templ' +@deftypefnx {MGL command} {} ztick val 'templ' +@deftypefnx {MGL command} {} ctick val 'templ' +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTickTime (@code{char} dir, @code{float} val, @code{const char *}templ) +@deftypefnx {C function} @code{void} mgl_set_tick_time (@code{HMGL} gr, @code{float} val, @code{const char *}templ) +@end ifclear +Задает метки времени с шагом @var{val} и шаблоном @var{templ} для меток вдоль x-,y-,z-оси или colorbar. Шаблон может содержать и символы TeX. +@end deftypefn + +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} SetTuneTicks (@code{bool} tune, @code{float} pos=@code{1.15}) +@deftypefnx {C function} @code{void} mgl_tune_ticks (@code{HMGL} gr, @code{bool} tune, @code{float} pos) +Включает/выключает улучшение вида меток осей путем вынесения общего множителя (для маленьких, типа 0.001...0.002, или больших, типа 1000...2000, значений координат) или общей компоненты (для узкого диапазона, типа 0.999...1.000). Также задает положение @var{pos} общего множителя на оси: =0 около минимального значения, =1 около максимального значения. +@end deftypefn -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{bool} TuneTicks -Флаг автоматического улучшения меток. См. @code{SetTuneTicks()}. -@end deftypecv +@deftypefn {Method on @code{mglGraph}} @code{void} SetTickRotate (@code{bool} val) +@deftypefnx {C function} @code{void} mgl_set_tick_rotate (@code{HMGL} gr, @code{bool} val) +Включает/выключает поворот меток если их число или длина меток слишком велики. +@end deftypefn -@deftypecv {@emph{Устаревшая переменная}} mglGraph @code{float} FactorPos -Положение общего множителя. См. @code{SetTuneTicks()}. -@end deftypecv +@deftypefn {Method on @code{mglGraph}} @code{void} SetTickSkip (@code{bool} val) +@deftypefnx {C function} @code{void} mgl_set_tick_skip (@code{HMGL} gr, @code{bool} val) +Включает/выключает пропуск меток если их число или длина меток слишком велики. +@end deftypefn +@end ifclear @c ################################################################## -@node Transformation matrix, Export to file, Axis settings, MathGL core +@node Transformation matrix, Export picture, Axis settings, MathGL core @section Матрица преобразования @cindex Aspect @cindex Rotate @cindex RotateN @cindex SubPlot +@cindex MultiPlot +@cindex StickPlot +@cindex ColumnPlot @cindex InPlot -@cindex Identity +@cindex Title @cindex Perspective -@cindex RestoreM @cindex View -@cindex ColumnPlot +@cindex Push +@cindex Pop Эти функции контролируют где и как график будет расположен. Существует определенный порядок вызова этих функций для лучшего вида графика. Вначале должны вызываться функции SubPlot() или InPlot() для указания местоположения вывода. После них -- функции вращения Rotate() и сжатия Aspect(). И наконец любые другие функции для рисования графика. Вместо вращения графика можно вызвать функцию ColumnPlot() для расположения графиков в столбец одного над другим без зазора между осями. -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SubPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{float} dx=@code{0}, @code{float} dy=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_subplot (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m) -@deftypefnx {Функция С} @code{void} mgl_subplot_d (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{float} dx, @code{float} dy) +@anchor{subplot} +@deftypefn {MGL command} {} subplot @code{nx ny m [dx=0 dy=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SubPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{float} dx=@code{0}, @code{float} dy=@code{0}) +@deftypefnx {C function} @code{void} mgl_subplot (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m) +@deftypefnx {C function} @code{void} mgl_subplot_d (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{float} dx, @code{float} dy) +@end ifclear Помещает последующий вывод в @var{m}-ую ячейку сетки размером @var{nx}*@var{ny} от всего рисунка. Функция сбрасывает матрицу трансформации (повороты и сжатие графика) и должна вызываться первой для создания "подграфика". С эстетической точки зрения не рекомендуется вызывать эту функцию с различными (или не кратными) размерами сетки. Ячейка может быть дополнительно сдвинута относительно своего обычного положения на относительный размер @var{dx}, @var{dy}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SubPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{const char *}style) +@deftypefn {MGL command} {} subplot @code{nx ny m} 'style' +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SubPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{const char *}style) @deftypefnx {C function} @code{void} mgl_subplot_s (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{const char *}style) +@end ifclear Аналогично предыдущему, но место для осей/colorbar резервируется только если строка @var{style} содержит: @samp{L} или @samp{<} -- с левого края, @samp{R} или @samp{>} -- с правого края, @samp{A} или @samp{^} -- с верхнего края, @samp{U} или @samp{_} -- с нижнего края. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} InPlot (@code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2, @code{bool} rel=@code{false}) -@deftypefnx {Функция С} @code{void} mgl_inplot (@code{HMGL} gr, @code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2) -@deftypefnx {Функция С} @code{void} mgl_relplot (@code{HMGL} gr, @code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2) +@deftypefn {MGL command} {} multiplot @code{nx ny m dx dy} ['style'='<>_^'] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} MultiPlot (@code{int} nx, @code{int} ny, @code{int} m, @code{int} dx, @code{int} dy, @code{const char *}style=@code{"<>_^"}) +@deftypefnx {C function} @code{void} mgl_multiplot (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{int} dx, @code{int} dy, @code{const char *}style) +@end ifclear +Помещает последующий вывод в прямоугольник из @var{dx}*@var{dy} ячеек, начиная с @var{m}-ой ячейки, сетки размером @var{nx}*@var{ny} от всего рисунка. Функция сбрасывает матрицу трансформации (повороты и сжатие графика) и должна вызываться первой для создания "подграфика". Место для осей/colorbar резервируется если строка @var{style} содержит: @samp{L} или @samp{<} -- с левого края, @samp{R} или @samp{>} -- с правого края, @samp{A} или @samp{^} -- с верхнего края, @samp{U} или @samp{_} -- с нижнего края. +@end deftypefn + +@anchor{inplot} +@deftypefn {MGL command} {} inplot @code{x1 x2 y1 y2 [rel=off]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} InPlot (@code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2, @code{bool} rel=@code{false}) +@deftypefnx {C function} @code{void} mgl_inplot (@code{HMGL} gr, @code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2) +@deftypefnx {C function} @code{void} mgl_relplot (@code{HMGL} gr, @code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2) +@end ifclear Помещает последующий вывод в прямоугольную область [@var{x1}, @var{x2}]*[@var{y1}, @var{y2}] (исходный размер [0,1]*[0,1]). Эта функция позволяет поместить график в произвольную область рисунка. Если параметр @var{rel}=@code{true}, то используется позиция относительно текщего SubPlot() (или InPlot() с @var{rel}=@code{false}). Функция сбрасывает матрицу трансформации (повороты и сжатие графика) и должна вызываться первой для создания "подграфика". @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ColumnPlot (@code{int} num, @code{int} ind, @code{float} d=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_columnplot (@code{HMGL} gr, @code{int} num, @code{int} ind) -@deftypefnx {Функция С} @code{void} mgl_columnplot (@code{HMGL} gr, @code{int} num, @code{int} ind, @code{float} d) +@anchor{columnplot} +@deftypefn {MGL command} {} columnplot @code{num ind [d=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} ColumnPlot (@code{int} num, @code{int} ind, @code{float} d=@code{0}) +@deftypefnx {C function} @code{void} mgl_columnplot (@code{HMGL} gr, @code{int} num, @code{int} ind) +@deftypefnx {C function} @code{void} mgl_columnplot_d (@code{HMGL} gr, @code{int} num, @code{int} ind, @code{float} d) +@end ifclear Помещает последующий вывод в @var{ind}-ую строку столбца из @var{num} строк. Положение столбца выбирается относительно последнего вызова SubPlot() (или InPlot() с @var{rel}=@code{false}). Параметр @var{d} задает дополнительный зазор между строк. @sref{ColumnPlot sample} @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} StickPlot (@code{int} num, @code{int} ind, @code{float} tet, @code{float} phi) +@anchor{stickplot} +@deftypefn {MGL command} {} stickplot @code{num ind tet phi} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} StickPlot (@code{int} num, @code{int} ind, @code{float} tet, @code{float} phi) @deftypefnx {C function} @code{void} mgl_stickplot (@code{HMGL} gr, @code{int} num, @code{int} ind, @code{float} tet, @code{float} phi) +@end ifclear Помещает последующий вывод в @var{ind}-ую ячейку "бруска" из @var{num} ячеек. При этом сам брусок повернут на углы @var{tet}, @var{phi}. Положение выбирается относительно последнего вызова SubPlot() (или InPlot() с @var{rel}=@code{false}). @sref{StickPlot sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Rotate (@code{float} TetX, @code{float} TetZ, @code{float} TetY=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_rotate (@code{HMGL} gr, @code{float} TetX, @code{float} TetZ, @code{float} TetY) + +@anchor{title} +@deftypefn {MGL command} {} title 'txt' ['stl'='#' @code{size=-2}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Title (@code{const char *}txt, @code{const char *}stl=@code{"#"}, @code{float} size=@code{-2}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Title (@code{const wchar_t *}txt, @code{const char *}stl=@code{"#"}, @code{float} size=@code{-2}) +@deftypefnx {C function} @code{void} mgl_title(@code{HMGL} gr, @code{const char *}txt, @code{const char *}stl, @code{float} size) +@deftypefnx {C function} @code{void} mgl_titlew (@code{HMGL} gr, @code{const wchar_t *}txt, @code{const char *}stl, @code{float} size) +@end ifclear +Выводит заголовок @var{title} для текущего "подграфика" шрифтом @var{stl} с размером @var{size}. Если строка @var{stl} содержит @samp{#}, то рисуется обрамляющий прямоугольник. Функция сбрасывает матрицу трансформации (повороты и сжатие графика) и должна вызываться сразу после создания "подграфика". +@end deftypefn + +@anchor{rotate} +@deftypefn {MGL command} {} rotate @code{tetz tetx [tety=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Rotate (@code{float} TetX, @code{float} TetZ, @code{float} TetY=@code{0}) +@deftypefnx {C function} @code{void} mgl_rotate (@code{HMGL} gr, @code{float} TetX, @code{float} TetZ, @code{float} TetY) +@end ifclear Вращает систему координат относительно осей @{x, z, y@} последовательно на углы @var{TetX}, @var{TetZ}, @var{TetY}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} RotateN (@code{float} Tet, @code{float} x, @code{float} y, @code{float} z) -@deftypefnx {Функция С} @code{void} mgl_rotate_vector (@code{HMGL} gr, @code{float Tet}, @code{float x}, @code{float y}, @code{float z}) +@deftypefn {MGL command} {} rotate @code{tet x y z} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} RotateN (@code{float} Tet, @code{float} x, @code{float} y, @code{float} z) +@deftypefnx {C function} @code{void} mgl_rotate_vector (@code{HMGL} gr, @code{float Tet}, @code{float x}, @code{float y}, @code{float z}) +@end ifclear Вращает систему координат относительно вектора @{@var{x}, @var{y}, @var{z}@} на угол @var{Tet}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Aspect (@code{float} Ax, @code{float} Ay, @code{float} Az) -@deftypefnx {Функция С} @code{void} mgl_aspect (@code{HMGL} gr, @code{float} Ax, @code{float} Ay, @code{float} Az) +@anchor{aspect} +@deftypefn {MGL command} {} aspect @code{ax ay [az=1]} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Aspect (@code{float} Ax, @code{float} Ay, @code{float} Az) +@deftypefnx {C function} @code{void} mgl_aspect (@code{HMGL} gr, @code{float} Ax, @code{float} Ay, @code{float} Az) +@end ifclear Устанавливает соотношение размеров осей в отношении @var{Ax:Ay:Az}. Для лучшего вида следует вызывать после функции Rotate(). @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Perspective (@code{float} a) -@deftypefnx {Функция С} @code{void} mgl_perspective (@code{HMGL} gr, @code{float} a) +@anchor{perspective} +@deftypefn {MGL command} {} perspective @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Perspective (@code{float} a) +@deftypefnx {C function} @code{void} mgl_perspective (@code{HMGL} gr, @code{float} a) +@end ifclear Добавляет (включает) перспективу для графика. Параметр @math{a ~ 1/z_@{eff@} \in [0,1)}. По умолчанию (@code{a=0}) перспектива отключена. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Identity (@code{bool} rel=@code{false}) -@deftypefnx {Функция С} @code{void} mgl_identity (@code{HMGL} gr, @code{int} rel) -Сбрасывает матрицу трансформации. Эквивалентно вызову @code{InPlot(0,1,0,1,rel)}. +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} View (@code{float} TetX, @code{float} TetZ, @code{float} TetY=@code{0}) +@deftypefnx {C function} @code{void} mgl_view (@code{HMGL} gr, @code{float} TetX, @code{float} TetZ, @code{float} TetY) +Вращает систему координат относительно осей @{x, z, y@} последовательно на углы @var{TetX}, @var{TetZ}, @var{TetY}. Вращение происходит независимо от @code{Rotate()}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Push () +@deftypefn {Method on @code{mglGraph}} @code{void} Push () @deftypefnx {C function} @code{void} mgl_mat_push (@code{HMGL} gr) Помещает матрицу преобразования в стек. Позднее вы можете восстановить текущее состояние с помощью функции Pop(). Стек может содержать до 10 матриц. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Pop () +@deftypefn {Method on @code{mglGraph}} @code{void} Pop () @deftypefnx {C function} @code{void} mgl_mat_pop (@code{HMGL} gr) Заменяет (восстанавливает) матрицу преобразования на последнюю помещенную в стек матрицу. @end deftypefn +@end ifclear @c ################################################################## -@node Export to file, Primitives drawing, Transformation matrix, MathGL core -@section Экспорт в файл +@node Export picture, Primitives drawing, Transformation matrix, MathGL core +@section Экспорт рисунка +@cindex SetSize + +Функции в этой группе сохраняют или дают доступ к полученному рисунку. Поэтом обычно они должны вызываться в конце рисования. + +@anchor{setsize} +@deftypefn {MGL command} {} setsize @code{w h} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetSize (@code{int} width, @code{int} height) +@deftypefnx {C function} @code{void} mgl_set_size (@code{HMGL} gr, @code{int} width, @code{int} height) +@end ifclear +Изменяет размер картинки в пикселях. Функция должна вызываться @strong{перед} любыми функциями построения потому что полностью очищает содержимое рисунка. +@end deftypefn + +@anchor{quality} +@deftypefn {MGL command} {} quality @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetQuality (@code{int} val=@code{MGL_DRAW_NORM}) +@deftypefnx {C function} @code{void} mgl_set_quality (@code{HMGL} gr, @code{int} val) +@end ifclear +Задает качество графика в зависимости от значения @var{val}: @code{MGL_DRAW_WIRE=0} -- нет рисования граней (наиболее быстрый), @code{MGL_DRAW_FAST=1} -- нет интерполяции цвета (быстрый), @code{MGL_DRAW_NORM=2} -- высокое качество (нормальный). Если установлен бит @code{MGL_DRAW_LMEM=0x4}, то происходит прямое рисование в растровое изображение (меньше затраты памяти). +@end deftypefn + +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} StartGroup (const char *name) +@deftypefnx {C function} @code{void} mgl_start_group (@code{HMGL} gr, @code{const char *}name) +Начинает определение группы. Группа может содержать объекты и другие группы. Они используются для выбора части модели при приближении, изменении прозрачности и т.д. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{void} EndGroup () +@deftypefnx {C function} @code{void} mgl_end_group (@code{HMGL} gr) +Завершает определение группы. +@end deftypefn +@end ifclear + +@menu +* Export to file:: +* Frames/Animation:: +* Bitmap in memory:: +* Parallelization:: +@end menu + +@c ================================================================== +@node Export to file, Frames/Animation, , Export picture +@subsection Экспорт в файл +@cindex Write +@ifclear UDAV @cindex WriteFrame @cindex WritePNG @cindex WriteGIF @@ -763,77 +856,245 @@ Setsize: размер(ы) равны нулю или отрицательны @cindex WriteSVG @cindex WriteBMP @cindex WriteEPS +@cindex WriteBPS +@cindex WriteTGA +@cindex WriteTEX +@cindex WriteOBJ +@cindex WriteWGL @cindex WriteJPEG -@cindex SetSize -@cindex Flush -@cindex Finish @cindex ShowImage +@end ifclear Эти функции экспортируют текущую картинку (кадр) в файл. Имя файла @var{fname} должно иметь соответствующее расширение. Параметр @var{descr} дает краткое описание картинки. Пока прозрачность поддерживается только для форматов PNG, SVG и IDTF. -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} WriteFrame (@code{const char *}fname=@code{""}, @code{const char *}descr=@code{""}) -@deftypefnx {Функция С} @code{void} mgl_write_frame (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) +@anchor{write} +@deftypefn {MGL command} {} write 'fname' +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} WriteFrame (@code{const char *}fname=@code{""}, @code{const char *}descr=@code{""}) +@deftypefnx {C function} @code{void} mgl_write_frame (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) +@end ifclear Экспортирует текущий кадр в файл @var{fname} с типом, определяемым по расширению. Параметр @var{descr} добавляет описание (может быть пустым). Если @var{fname} пустой, то используется имя @samp{frame####.jpg}, где @samp{####} -- текущий номер кадра и имя @samp{frame} определяется переменной @var{PlotId}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} WritePNG (@code{const char *}fname, @code{const char *}descr=@code{""}, @code{int} compr=@code{""}, @code{bool} alpha=@code{true}) +@ifclear UDAV + +@deftypefn {Метод класса @code{mglGraph}} @code{void} WritePNG (@code{const char *}fname, @code{const char *}descr=@code{""}, @code{int} compr=@code{""}, @code{bool} alpha=@code{true}) @deftypefnx {Функция С} @code{void} mgl_write_png (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) @deftypefnx {Функция С} @code{void} mgl_write_png_solid (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) Экспортирует текущий кадр в PNG файл. Параметры функции следующие: @var{fname} -- имя файла, @var{descr} -- описание файла, @var{alpha} -- прозрачность фона. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} WriteJPEG (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} WriteJPEG (@code{const char *}fname, @code{const char *}descr=@code{""}) @deftypefnx {Функция С} @code{void} mgl_write_jpg (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) Экспортирует текущий кадр в JPEG файл. Параметры функции следующие: @var{fname} -- имя файла, @var{descr} -- описание файла. Если при компиляции MathGL не был определен флаг HAVE_JPEG, то экспорт в файл не производится. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} WriteGIF (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} WriteGIF (@code{const char *}fname, @code{const char *}descr=@code{""}) @deftypefnx {Функция С} @code{void} mgl_write_gif (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) Экспортирует текущий кадр в GIF файл. Параметры функции следующие: @var{fname} -- имя файла, @var{descr} -- описание файла. Если при компиляции MathGL не был определен флаг HAVE_GIF, то экспорт в файл не производится. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} WriteBMP (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} WriteBMP (@code{const char *}fname, @code{const char *}descr=@code{""}) @deftypefnx {Функция С} @code{void} mgl_write_bmp (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) Экспортирует текущий кадр в BMP файл. Параметры функции следующие: @var{fname} -- имя файла, @var{descr} -- описание файла. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} WriteEPS (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} WriteTGA (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefnx {Функция С} @code{void} mgl_write_tga (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) +Экспортирует текущий кадр в TGA файл. Параметры функции следующие: @var{fname} -- имя файла, @var{descr} -- описание файла. +@end deftypefn + +@deftypefn {Метод класса @code{mglGraph}} @code{void} WriteEPS (@code{const char *}fname, @code{const char *}descr=@code{""}) @deftypefnx {Функция С} @code{void} mgl_write_eps (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) -Экспортирует текущий кадр в EPS файл, используя векторное представление графика (класс mglGraphPS). Вследствие чего не рекомендуется сохранять большие графики (поверхности, а особенно поверхности уровня) в формате EPS из-за большого размера файла. Хотя никаких внутренних ограничений на размер выходного файла нет. Для них лучше использовать растровый формат (например, PNG или JPEG). Параметры функции следующие: @var{fname} -- имя файла, @var{descr} -- описание файла. Если имя файла оканчивается на @samp{z} (например, @samp{fname.eps.gz}), то файл автоматически архивируется в формате gzip. +Экспортирует текущий кадр в EPS файл, используя векторное представление графика. Вследствие чего не рекомендуется сохранять большие графики (поверхности, а особенно поверхности уровня) из-за большого размера файла. Хотя никаких внутренних ограничений на размер выходного файла нет. Для них лучше использовать растровый формат (например, PNG или JPEG). Параметры функции следующие: @var{fname} -- имя файла, @var{descr} -- описание файла. Если имя файла оканчивается на @samp{z} (например, @samp{fname.eps.gz}), то файл автоматически архивируется в формате gzip. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} WriteSVG (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} WriteBPS (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefnx {Функция С} @code{void} mgl_write_eps (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) +Экспортирует текущий кадр в EPS файл, используя растровое представление графика. Параметры функции следующие: @var{fname} -- имя файла, @var{descr} -- описание файла. Если имя файла оканчивается на @samp{z} (например, @samp{fname.eps.gz}), то файл автоматически архивируется в формате gzip. +@end deftypefn + +@deftypefn {Метод класса @code{mglGraph}} @code{void} WriteSVG (@code{const char *}fname, @code{const char *}descr=@code{""}) @deftypefnx {Функция С} @code{void} mgl_write_svg (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) -Экспортирует текущий кадр в SVG файл, используя векторное представление графика (класс mglGraphPS). Вследствие чего не рекомендуется сохранять большие графики (поверхности, а особенно поверхности уровня) в формате SVG из-за большого размера файла. Хотя никаких внутренних ограничений на размер выходного файла нет. Для них лучше использовать растровый формат (например, PNG или JPEG). Параметры функции следующие: @var{fname} -- имя файла, @var{descr} -- описание файла. Если имя файла оканчивается на @samp{z} (например, @samp{fname.svgz}), то файл автоматически архивируется в формате gzip. +Экспортирует текущий кадр в SVG файл, используя векторное представление графика. Вследствие чего не рекомендуется сохранять большие графики (поверхности, а особенно поверхности уровня) из-за большого размера файла. Хотя никаких внутренних ограничений на размер выходного файла нет. Для них лучше использовать растровый формат (например, PNG или JPEG). Параметры функции следующие: @var{fname} -- имя файла, @var{descr} -- описание файла. Если имя файла оканчивается на @samp{z} (например, @samp{fname.svgz}), то файл автоматически архивируется в формате gzip. +@end deftypefn + +@deftypefn {Метод класса @code{mglGraph}} @code{void} WriteTEX (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefnx {Функция С} @code{void} mgl_write_tex (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) +Экспортирует текущий кадр в LaTeX файл (пакет Tikz/PGF), используя векторное представление графика (класс mglGraphPS). Вследствие чего не рекомендуется сохранять большие графики (поверхности, а особенно поверхности уровня) из-за большого размера файла. Хотя никаких внутренних ограничений на размер выходного файла нет. Для них лучше использовать растровый формат (например, PNG или JPEG). Параметры функции следующие: @var{fname} -- имя файла, @var{descr} -- описание файла. +@end deftypefn + +@deftypefn {Метод класса @code{mglGraph}} @code{void} WriteOBJ (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefnx {Функция С} @code{void} mgl_write_obj (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) +Экспортирует текущий кадр в OBJ/MTL файл, используя векторное представление графика (класс mglGraphPS). Вследствие чего не рекомендуется сохранять большие графики (поверхности, а особенно поверхности уровня) из-за большого размера файла. Хотя никаких внутренних ограничений на размер выходного файла нет. Для них лучше использовать растровый формат (например, PNG или JPEG). Параметры функции следующие: @var{fname} -- имя файла, @var{descr} -- описание файла. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} WriteIDTF (@code{const char *}fname, @code{const char *}descr=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} WriteIDTF (@code{const char *}fname, @code{const char *}descr=@code{""}) @deftypefnx {Функция С} @code{void} mgl_write_idtf (@code{HMGL} gr, @code{const char *}fname, @code{const char *}descr) Экспортирует текущий кадр в IDTF файл, используя векторное представление графика (класс mglGraphIDTF). Параметры функции следующие: @var{fname} -- имя файла, @var{descr} -- описание файла. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ShowImage (@code{const char *}viewer=@code{"kuickshow"}, @code{bool} nowait=@code{false}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ShowImage (@code{const char *}viewer=@code{"kuickshow"}, @code{bool} nowait=@code{false}) @deftypefnx {Функция С} @code{void} mgl_show_image (@code{const char *}viewer, @code{int} nowait) Отображает текущий кадр используя внешнюю программу просмотра @var{viewer}. Функция сохраняет картинку во временный файл и вызывает @var{viewer} для его отображения. Если @var{nowait}=@code{true}, то функция возвращает управление немедленно -- не ждет пока окно просмотра будет закрыто. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetSize (@code{int} width, @code{int} height) -@deftypefnx {Функция С} @code{void} mgl_set_size (@code{HMGL} gr, @code{int} width, @code{int} height) -Изменяет размер картинки в пикселях. Функция должна вызываться @strong{перед} любыми функциями построения потому что полностью очищает содержимое рисунка. +@end ifclear + + +@c ################################################################## +@node Frames/Animation, Bitmap in memory, Export to file, Export picture +@subsection Кадры/Анимация + +@ifset UDAV +В MGL нет специальных комманд для создания анимации. Однако можно воспользоваться возможностями утилит (@pxref{Utilities}). Например, используя комментарии спеиального вида @samp{##a } или @samp{##c }. +@end ifset + +@ifclear UDAV +@cindex NewFrame +@cindex EndFrame +@cindex GetNumFrame +@cindex ResetFrames +@cindex StartGIF +@cindex CloseGIF + +Эти функции позволяют создавать несколько картинок одновременно. В большинстве случаев это бесполезно, но для органов управления (@pxref{Widget classes}) это позволяет показывать анимацию. Также можно записать несколько кадров в анимированный GIF файл. + +@deftypefn {Метод класса @code{mglGraph}} @code{int} NewFrame () +@deftypefnx {Функция С} @code{int} mgl_new_frame (@code{HMGL} gr) +Создает новый кадр. Функция возвращает номер текущего кадра. В режиме OpenGL функция не должны вызываться в параллельных потоках! -- используйте прямое создание списка. Функция @code{EndFrame()} @strong{должна} быть вызвана после рисования кадра для каждого вызова этой функции. +@end deftypefn + +@deftypefn {Метод класса @code{mglGraph}} @code{void} EndFrame () +@deftypefnx {Функция С} @code{void} mgl_end_frame (@code{HMGL} gr) +Завершает рисование кадра. +@end deftypefn + +@deftypefn {Метод класса @code{mglGraph}} @code{int} GetNumFrame () +@deftypefnx {Функция С} @code{int} mgl_get_num_frame (@code{HMGL} gr) +Возвращает число созданных кадров. +@end deftypefn + +@deftypefn {Метод класса @code{mglGraph}} @code{void} ResetFrames () +@deftypefnx {Функция С} @code{int} mgl_reset_frames (@code{HMGL} gr) +Сбрасывает счетчик кадров в 0. +@end deftypefn + +@deftypefn {Метод класса @code{mglGraph}} @code{void} StartGIF (@code{const char *}fname, @code{int} ms=@code{100}) +@deftypefnx {Функция С} @code{void} mgl_start_gif (@code{HMGL} gr, @code{const char *}fname, @code{int} ms) +Начинает запись кадров в анимированный GIF файл @var{fname}. Параметр @var{ms} задает задержку между кадрами в миллисекундах. Вы @strong{не должны} менять размер рисунка во время создания кино. Используйте CloseGIF() для завершения записи. Эта функция не работает в режиме OpenGL. +@end deftypefn + +@deftypefn {Метод класса @code{mglGraph}} @code{int} CloseGIF () +@deftypefnx {Функция С} @code{void} mgl_close_gif (@code{HMGL} gr) +Завершает запись анимированного GIF файла. +@end deftypefn +@end ifclear + +@c ------------------------------------------------------------------ +@node Bitmap in memory, Parallelization, Frames/Animation, Export picture +@subsection Рисование в памяти + +@ifclear UDAV +Эти функции возвращают созданный растровый рисунок, его ширину и высоту. В дальнейшем его можно использовать в любой графической библиотеке (см. также, @ref{Widget classes}) или сохранить в файл (см. также, @ref{Export to file}). + +@deftypefn {Метод класса @code{mglGraph}} @code{void} GetRGB (@code{char *}buf, @code{int} size) +@deftypefnx {Метод класса @code{mglGraph}} @code{void} GetBGRN (@code{char *}buf, @code{int} size) +@deftypefnx {C function} @code{const unsigned char *} mgl_get_rgb (@code{HMGL} gr) +Возвращает растровое изображение в формате RGB для текущего кадра. Формат каждого элемента (пикселя): @{red, green, blue@}. Число элементов Width*Height. Положение элемента @{i,j@} есть [3*i + 3*Width*j] (или [4*i + 4*Width*j] для @code{GetBGRN()}). В Python вы должны предоставить буфер @var{buf} достаточного размера @var{size}, т.е. код должен выглядеть следующим образом +@verbatim +from mathgl import * +gr = mglGraph(); +bits='\t'; +bits=bits.expandtabs(4*gr.GetWidth()*gr.GetHeight()); +gr.GetBGRN(bits, len(bits)); +@end verbatim +@end deftypefn + +@deftypefn {Метод класса @code{mglGraph}} @code{void} GetRGBA (@code{char *}buf, @code{int} size) +@deftypefnx {C function} @code{const unsigned char *} mgl_get_rgba (@code{HMGL} gr) +Возвращает растровое изображение в формате RGBA для текущего кадра. Формат каждого элемента (пикселя): @{red, green, blue, alpha@}. Число элементов Width*Height. Положение элемента @{i,j@} есть [4*i + 4*Width*j]. +@end deftypefn + +@deftypefn {Метод класса @code{mglGraph}} @code{int} GetWidth () +@deftypefnx {Метод класса @code{mglGraph}} @code{int} GetHeight () +@deftypefnx {C function} @code{int} mgl_get_width (@code{HMGL} gr) +@deftypefnx {C function} @code{int} mgl_get_height (@code{HMGL} gr) +Возвращает ширину и высоту изображения. +@end deftypefn + + +@deftypefn {Метод класса @code{mglGraph}} @code{mglPoint} CalcXYZ (@code{int} xs, @code{int} ys) +@deftypefnx {C function} @code{void} mgl_calc_xyz (@code{HMGL} gr, @code{int} xs, @code{int} ys, @code{float *}x, @code{float *}y, @code{float *}z) +Вычисляет 3D координаты @{x,y,z@} для экранной точки @{xs,ys@}. В данный момент игнорируется перспектива графика и формулы перехода в криволинейные координаты. Вычисления производятся для последнего использованного InPlot (@pxref{Transformation matrix}). +@end deftypefn + +@deftypefn {Метод класса @code{mglGraph}} @code{mglPoint} CalcScr (@code{mglPoint} p) +@deftypefnx {C function} @code{void} mgl_calc_scr (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{int *}xs, @code{int *}ys) +Вычисляет экранные координаты @{xs,ys@} для 3D координат @{x,y,z@}. Вычисления производятся для последнего использованного InPlot (@pxref{Transformation matrix}). +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{void} SetObjId (@code{int} id) +@deftypefnx {C function} @code{void} mgl_set_obj_id (@code{HMGL} gr, @code{int} id) +Задает числовой идентификатор для объектов или "подграфиков". +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{int} GetObjId (@code{long} xs, @code{long} ys) +@deftypefnx {C function} @code{int} mgl_get_obj_id (@code{HMGL} gr, @code{long} xs, @code{long} ys) +Возвращает числовой идентификатор верхнего объекта в точке @{xs, ys@} рисунка. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{int} GetSplId (@code{long} xs, @code{long} ys) +@deftypefnx {C function} @code{int} mgl_get_spl_id (@code{HMGL} gr, @code{long} xs, @code{long} ys) +Возвращает числовой идентификатор верхнего "подграфика" в точке @{xs, ys@} рисунка. +@end deftypefn + +@end ifclear + +@c ------------------------------------------------------------------ +@node Parallelization, , Bitmap in memory, Export picture +@subsection Распараллеливание + +@ifclear UDAV +@cindex SetDrawReg +@cindex PutDrawReg +@cindex Combine +@cindex MPI_Send +@cindex MPI_Recv + +There are few functions which allow parallelization at user-level. First 2 limit the drawing region (for example, by subplot per thread) and copy data from that region in another @code{mglGraph} instance. + +@deftypefn {Method on @code{mglGraph}} @code{int} SetDrawReg (@code{int} nx, @code{int} ny, @code{int} m) +@deftypefnx {C function} @code{int} mgl_set_draw_reg (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m) +Set drawable region as a @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. +@end deftypefn + +@deftypefn {Method on @code{mglGraph}} @code{int} PutDrawReg (@code{int} nx, @code{int} ny, @code{int} m, @code{const mglGraph *}g) +@deftypefnx {C function} @code{int} mgl_put_draw_reg (@code{HMGL} gr, @code{int} nx, @code{int} ny, @code{int} m, @code{HMGL} g) +Put drawing from another instance @var{g} for a @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. The width and height of both instances must be the same. +@end deftypefn + +Another option is combining bitmap image (taking into account Z-ordering) from different instances. This method is most appropriate for computer clusters when the data size is so large that it exceed the memory of single computer node. + +@deftypefn {Method on @code{mglGraph}} @code{int} Combine (@code{const mglGraph *}g) +@deftypefnx {C function} @code{int} mgl_combine_gr (@code{HMGL} gr, @code{HMGL} g) +Combine drawing from instance @var{g} with @var{gr} (or with this) taking into account Z-ordering of pixels. The width and height of both instances must be the same. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Flush () -@deftypefnx {Функция С} @code{void} mgl_flush (@code{HMGL} gr) -Завершает рисование текущих графических команд, подготавливает кадр к экспорту в файл и служит для разделения объектов в mglGraphIDTF. Однако обычно данная функция вызывается внутри библиотеки. +@deftypefn {Method on @code{mglGraph}} @code{int} MPI_Send (@code{int} id) +@deftypefnx {C function} @code{int} mgl_mpi_send (@code{HMGL} gr, @code{int} id) +Send graphical information from node @var{id} using MPI. The width and height in both nodes must be the same. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Finish () -Завершает рисование и готовит растровое изображение. +@deftypefn {Method on @code{mglGraph}} @code{int} MPI_Recv (@code{int} id) +@deftypefnx {C function} @code{int} mgl_mpi_send (@code{HMGL} gr, @code{int} id) +Receive graphical information from node @var{id} using MPI. The width and height in both nodes must be the same. @end deftypefn +@end ifclear @c ################################################################## -@node Primitives drawing, Text printing, Export to file, MathGL core +@node Primitives drawing, Text printing, Export picture, MathGL core @section Рисование примитивов @cindex Ball @cindex Clf @@ -852,140 +1113,209 @@ Setsize: размер(ы) равны нулю или отрицательны Эти функции рисуют рисуют простые объекты типа линий, точек, сфер, капель, конусов, и т.д. -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Clf (@code{mglColor} Back=@code{WC}) -@deftypefnx {Функция С} @code{void} mgl_clf (@code{HMGL} gr) -@deftypefnx {Функция С} @code{void} mgl_clf_rgb (@code{HMGL} gr, @code{float} r, @code{float} g, @code{float} b) +@anchor{clf} +@deftypefn {MGL command} {} clf +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Clf () +@deftypefnx {Method on @code{mglGraph}} @code{void} Clf (@code{float} r, @code{float} g, @code{float} b) +@deftypefnx {C function} @code{void} mgl_clf (@code{HMGL} gr) +@deftypefnx {C function} @code{void} mgl_clf_rgb (@code{HMGL} gr, @code{float} r, @code{float} g, @code{float} b) +@end ifclear Очищает рисунок и заполняет его цветом @var{Back}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Ball (@code{float} x, @code{float} y, @code{float} z, @code{mglColor} col=@code{RC}, @code{float} alpha=@code{1}) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} Ball (@code{mglPoint} p, @code{char} col=@code{'r'}) -@deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} Ball (@code{float} x, @code{float} y, @code{float} z, @code{char} col=@code{'r'}) -@deftypefnx {Функция С} @code{void} mgl_ball (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z) -@deftypefnx {Функция С} @code{void} mgl_ball_rgb (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{float} r, @code{float} g, @code{float} b, @code{float} alpha) -@deftypefnx {Функция С} @code{void} mgl_ball_str (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{char} col) -Рисует точку (шарик) с координатами @var{p}=@{@var{x}, @var{y}, @var{z}@} и цветом @var{col}. +@anchor{ball} +@deftypefn {MGL command} {} ball @code{x y} ['col'='r.'] +@deftypefnx {MGL command} {} ball @code{x y z} ['col'='r.'] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Ball (@code{mglPoint} p, @code{char} col=@code{'r'}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Mark (@code{mglPoint} p, @code{const char *}mark) +@deftypefnx {C function} @code{void} mgl_ball (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z) +@deftypefnx {C function} @code{void} mgl_mark (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const char *}mark) +@end ifclear +Рисует маркер (точку по умолчанию) с координатами @var{p}=@{@var{x}, @var{y}, @var{z}@} и цветом @var{col}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Error (@code{mglPoint} p, @code{mglPoint} e, @code{char} *pen=@code{""}) +@ifclear UDAV +@deftypefn {Метод класса @code{mglGraph}} @code{void} Error (@code{mglPoint} p, @code{mglPoint} e, @code{char} *pen=@code{""}) Рисует 3d error box в точке @var{p} размером @var{e} и стилем @var{pen}. @end deftypefn +@end ifclear -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Line (@code{mglPoint} p1, @code{mglPoint} p2, @code{char *}stl=@code{"B"}, @code{int}num=@code{2}) -@deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} Line (@code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{char *}stl=@code{"B"}, @code{int}num=@code{2}) -@deftypefnx {Функция С} @code{void} mgl_line (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{char *}stl, @code{int}num) +@anchor{line} +@deftypefn {MGL command} {} line @code{x1 y1 x2 y2} ['stl'=''] +@deftypefnx {MGL command} {} line @code{x1 y1 z1 x2 y2 z2} ['stl'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Line (@code{mglPoint} p1, @code{mglPoint} p2, @code{char *}stl=@code{"B"}, @code{int}num=@code{2}) +@deftypefnx {C function} @code{void} mgl_line (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{char *}stl, @code{int}num) +@end ifclear Рисует геодезическую линию (декартовых координатах -- прямую) из точки @var{p1} в @var{p2} использую стиль линии @var{stl}. Параметр @var{num} определяет гладкость линии (число точек на линии). Если @var{num}=@code{2}, то рисуется прямая даже в криволинейных координатах. Наоборот, для больших значений (например, =@code{100}) рисуется геодезическая линия (окружность в полярных координатах, парабола в параболических и т.д.). Линия рисуется даже если часть ее лежит вне диапазона осей координат. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Curve (@code{mglPoint} p1, @code{mglPoint} d1, @code{mglPoint} p2, @code{mglPoint} d2, @code{const char *}stl=@code{"B"}, @code{int} num=@code{100}) -@deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} Curve (@code{float} x1, @code{float} y1, @code{float} z1, @code{float} dx1, @code{float} dy1, @code{float} dz1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} dx2, @code{float} dy2, @code{float} dz2, @code{const char *}stl=@code{"B"}, @code{int} num=@code{100}) -@deftypefnx {Функция С} @code{void} mgl_curve (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} dx1, @code{float} dy1, @code{float} dz1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} dx2, @code{float} dy2, @code{float} dz2, @code{const char *}stl, @code{int} num) +@anchor{curve} +@deftypefn {MGL command} {} curve @code{x1 y1 dx1 dy1 x2 y2 dx2 dy2} ['stl'=''] +@deftypefnx {MGL command} {} curve @code{x1 y1 z1 dx1 dy1 dz1 x2 y2 z2 dx2 dy2 dz2} ['stl'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Curve (@code{mglPoint} p1, @code{mglPoint} d1, @code{mglPoint} p2, @code{mglPoint} d2, @code{const char *}stl=@code{"B"}, @code{int} num=@code{100}) +@deftypefnx {C function} @code{void} mgl_curve (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} dx1, @code{float} dy1, @code{float} dz1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} dx2, @code{float} dy2, @code{float} dz2, @code{const char *}stl, @code{int} num) +@end ifclear Рисует кривую Безье из точки @var{p1} в @var{p2} используя стиль линии @var{stl}. Касательные в точках пропорциональны @var{d1}, @var{d2}. Параметр @var{num} определяет гладкость линии (число точек на линии). Кривая рисуется даже если часть ее лежит вне диапазона осей координат. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Face (@code{mglPoint} p1, @code{mglPoint} p2, @code{mglPoint} p3, @code{mglPoint} p4, @code{const char *}stl=@code{"w"}, @code{int} num=@code{2}, @code{float} val=@code{NAN}) -Рисует заполненный четырехугольник (грань) с углами в точках @var{p1}, @var{p2}, @var{p3}, @var{p4} и цветом(-ами) @var{stl}. При этом цвет может быть один для всей грани, или различным если указаны все 4 цвета. В последнем случае параметр @var{val} (если не @code{NAN}) задает цвет в соответствии с цветовой схемой. Грань будет нарисована даже если часть ее лежит вне диапазона осей координат. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} FaceX (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} wy, @code{float} wz, @code{const char *}stl=@code{"w"}, @code{float} dx=@code{0}, @code{float} dy=@code{0}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} FaceY (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} wx, @code{float} wz, @code{const char *}stl=@code{"w"}, @code{float} dx=@code{0}, @code{float} dy=@code{0}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} FaceZ (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} wx, @code{float} wy, @code{const char *}stl=@code{"w"}, @code{float} dx=@code{0}, @code{float} dy=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_facex (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} wy, @code{float} wz, @code{const char *}stl, @code{float} d1, @code{float} d2) -@deftypefnx {Функция С} @code{void} mgl_facey (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} wx, @code{float} wz, @code{const char *}stl, @code{float} d1, @code{float} d2) -@deftypefnx {Функция С} @code{void} mgl_facez (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} wx, @code{float} wy, @code{const char *}stl, @code{float} d1, @code{float} d2) +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} Face (@code{mglPoint} p1, @code{mglPoint} p2, @code{mglPoint} p3, @code{mglPoint} p4, @code{const char *}stl=@code{"w"}) +@deftypefnx {C function} @code{void} mgl_curve (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} x3, @code{float} y3, @code{float} z3, @code{float} x4, @code{float} y4, @code{float} z4, @code{const char *}stl) +Рисует заполненный четырехугольник (грань) с углами в точках @var{p1}, @var{p2}, @var{p3}, @var{p4} и цветом(-ами) @var{stl}. При этом цвет может быть один для всей грани, или различным если указаны все 4 цвета. Грань будет нарисована даже если часть ее лежит вне диапазона осей координат. +@end deftypefn +@end ifclear + +@anchor{facex} +@anchor{facey} +@anchor{facez} +@deftypefn {MGL command} {} facex @code{x0 y0 z0 wy wz} ['stl'='' @code{d1=0 d2=0}] +@deftypefnx {MGL command} {} facey @code{x0 y0 z0 wx wz} ['stl'='' @code{d1=0 d2=0}] +@deftypefnx {MGL command} {} facez @code{x0 y0 z0 wx wy} ['stl'='' @code{d1=0 d2=0}] +@deftypefnx {Method on @code{mglGraph}} @code{void} FaceX (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} wy, @code{float} wz, @code{const char *}stl=@code{"w"}, @code{float} d1=@code{0}, @code{float} d2=@code{0}) +@deftypefnx {Method on @code{mglGraph}} @code{void} FaceY (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} wx, @code{float} wz, @code{const char *}stl=@code{"w"}, @code{float} d1=@code{0}, @code{float} d2=@code{0}) +@deftypefnx {Method on @code{mglGraph}} @code{void} FaceZ (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} wx, @code{float} wy, @code{const char *}stl=@code{"w"}, @code{float} d1=@code{0}, @code{float} d2=@code{0}) +@deftypefnx {C function} @code{void} mgl_facex (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} wy, @code{float} wz, @code{const char *}stl, @code{float} d1, @code{float} d2) +@deftypefnx {C function} @code{void} mgl_facey (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} wx, @code{float} wz, @code{const char *}stl, @code{float} d1, @code{float} d2) +@deftypefnx {C function} @code{void} mgl_facez (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} wx, @code{float} wy, @code{const char *}stl, @code{float} d1, @code{float} d2) Рисует закрашенный прямоугольник (грань) перпендикулярно оси [x,y,z] в точке @{@var{x0}, @var{y0}, @var{z0}@} цветом @var{stl} и шириной @var{wx}, @var{wy}, @var{wz} вдоль соответствующего направления. При этом цвет может быть один для всей грани, или различным для разных вершин если указаны все 4 цвета. Параметры @var{d1}!=0, @var{d2}!=0 задают дополнительный сдвиг последней точки (т.е. рисуют четырехугольник).Грань будет нарисована даже если часть ее лежит вне диапазона осей координат. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Sphere (@code{mglPoint} p, @code{float} r, @code{const char *}stl=@code{"r"}) -@deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} Sphere (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} r, @code{const char *}stl=@code{"r"}) -@deftypefnx {Функция С} @code{void} mgl_sphere (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} r, @code{const char *}stl) -Рисует сферу радиуса @var{r} с центром в точке @var{p}=@{@var{x}, @var{y}, @var{z}@} цветом @var{stl}. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Drop (@code{mglPoint} p, @code{mglPoint} q, @code{float} r, @code{mglColor} col, @code{float} shift=@code{1}, @code{float} ap=@code{1}) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} Drop (@code{mglPoint} p, @code{mglPoint} q, @code{float} r, @code{const char *}col="r", @code{float} shift=@code{1}, @code{float} ap=@code{1}) -@deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} Drop (@code{float} x0, @code{float} y0, @code{float} z0, @code{float} dx, @code{float} dy, @code{float} dz, @code{float} r, @code{const char *}col="r", @code{float} shift=@code{1}, @code{float} ap=@code{1}) -@deftypefnx {Функция С} @code{void} mgl_drop (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} dx, @code{float} dy, @code{float} dz, @code{float} r, @code{const char *}col, @code{float} shift, @code{float} ap) -Рисует каплю радиуса @var{r} в точке @var{p} вытянутую вдоль направления @var{q} цветом @var{col}. Параметр @var{shift} определяет степень вытянутости: @samp{0} -- сфера, @samp{1} -- классическая капля. Параметр @var{ap} определяет относительную ширину капли (аналог "эллиптичности" для сферы). @sref{Drops sample} +@anchor{sphere} +@deftypefn {MGL command} {} sphere @code{x0 y0 r} ['col'='r'] +@deftypefnx {MGL command} {} sphere @code{x0 y0 z0 r} ['col'='r'] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Sphere (@code{mglPoint} p, @code{float} r, @code{const char *}stl=@code{"r"}) +@deftypefnx {C function} @code{void} mgl_sphere (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} r, @code{const char *}stl) +@end ifclear +Рисует сферу радиуса @var{r} с центром в точке @var{p}=@{@var{x0}, @var{y0}, @var{z0}@} цветом @var{stl}. +@end deftypefn + +@anchor{drop} +@deftypefn {MGL command} {} drop @code{x0 y0 dx dy r} ['col'='b' @code{sh=1 asp=1}] +@deftypefnx {MGL command} {} drop @code{x0 y0 z0 dx dy dz r} ['col'='b' @code{sh=1 asp=1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Drop (@code{mglPoint} p, @code{mglPoint} d, @code{float} r, @code{mglColor} col, @code{float} shift=@code{1}, @code{float} ap=@code{1}) +@deftypefnx {C function} @code{void} mgl_drop (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} dx, @code{float} dy, @code{float} dz, @code{float} r, @code{const char *}col, @code{float} shift, @code{float} ap) +@end ifclear +Рисует каплю радиуса @var{r} в точке @var{p} вытянутую вдоль направления @var{d} цветом @var{col}. Параметр @var{shift} определяет степень вытянутости: @samp{0} -- сфера, @samp{1} -- классическая капля. Параметр @var{ap} определяет относительную ширину капли (аналог "эллиптичности" для сферы). @sref{Drops sample} +@end deftypefn + +@anchor{cone} +@deftypefn {MGL command} {} cone @code{x1 y1 z1 x2 y2 z2 r1} [@code{r2=-1} 'stl'='' @code{edge=off}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Cone (@code{mglPoint} p1, @code{mglPoint} p2, @code{float} r1, @code{float} r2=@code{-1}, @code{const char *}stl=@code{"B"}, @code{bool} edge=@code{false}) +@deftypefnx {C function} @code{void} mgl_cone (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} r1, @code{float} r2, @code{const char *}stl, @code{int} draw_edge) +@end ifclear +Рисует трубу (или усеченный конус если @var{edge}=@code{false}) между точками @var{p1}, @var{p2} с радиусами на концах @var{r1}, @var{r2}. Если @var{r2}<0, то полагается @var{r2}=@var{r1}. Цвет конуса задается строкой @var{stl}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Cone (@code{mglPoint} p1, @code{mglPoint} p2, @code{float} r1, @code{float} r2=@code{-1}, @code{const char *}stl=@code{"B"}, @code{bool} edge=@code{false}) -@deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} Cone (@code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} r1, @code{float} r2=@code{-1}, @code{const char *}stl=@code{"B"}, @code{bool} edge=@code{false}) -@deftypefnx {Функция С} @code{void} mgl_cone (@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} r1, @code{float} r2, @code{const char *}stl, @code{int} draw_edge) -Рисует трубу (или усеченный конус если @var{edge}=@code{false}) между точками @var{p1}, @var{p2} с радиусами на концах @var{r1}, @var{r2}. Если @var{r2}<0, то полагается @var{r2}=@var{r1}. Цвет конуса задается строкой @var{stl}. +@anchor{circle} +@deftypefn {MGL command} {} circle @code{x0 y0 r} ['col'='r'] +@deftypefnx {MGL command} {} circle @code{x0 y0 z0 r} ['col'='r'] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Circle (@code{mglPoint} p, @code{float} r, @code{const char *}stl=@code{"r"}) +@end ifclear +Рисует круг радиуса @var{r} с центром в точке @var{p}=@{@var{x0}, @var{y0}, @var{z0}@} цветом @var{stl}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Mark (@code{mglPoint} p, @code{char} mark=@code{'.'}) -@deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} Mark (@code{float} x, @code{float} y, @code{float} z, @code{char} mark=@code{'.'}) -@deftypefnx {Функция С} @code{void} mgl_mark (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{char} mark) -Рисует маркер типа @var{mark} в точке @var{p}. +@anchor{ellipse} +@deftypefn {MGL command} {} ellipse @code{x1 y1 x2 y2 r} ['col'='r' @code{sh=1 asp=1}] +@deftypefnx {MGL command} {} ellipse @code{x1 y1 z1 x2 y2 z2 r} ['col'='r' @code{sh=1 asp=1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Ellipse (@code{mglPoint} p1, @code{mglPoint} p2, @code{float} r, @code{const char *}col=@code{"r"}) +@deftypefnx {C function} @code{void} mgl_ellipse(@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} r, @code{const char *}col) +@end ifclear +Рисует круг радиуса @var{r} с фокусами в точках @var{p1}, @var{p2} цветом @var{stl}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). @sref{Ellipse sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Glyph (@code{float} x, @code{float} y, @code{float} f, @code{int} nt, @code{const short *}trig, @code{int} nl, @code{const short *}line) -Рисует набор треугольников (или линий если @var{trig}=@code{NULL}) для буквы расположенной в точке @{@var{x}, @var{y}@}. Значения массивов будут нормированы на множитель @var{f}. Обычно эта функция используется внутри библиотеки. +@anchor{rhomb} +@deftypefn {MGL command} {} rhomb @code{x1 y1 x2 y2 r} ['col'='r' @code{sh=1 asp=1}] +@deftypefnx {MGL command} {} rhomb @code{x1 y1 z1 x2 y2 z2 r} ['col'='r' @code{sh=1 asp=1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Rhomb (@code{mglPoint} p1, @code{mglPoint} p2, @code{float} r, @code{const char *}col=@code{"r"}) +@deftypefnx {C function} @code{void} mgl_rhomb(@code{HMGL} gr, @code{float} x1, @code{float} y1, @code{float} z1, @code{float} x2, @code{float} y2, @code{float} z2, @code{float} r, @code{const char *}col) +@end ifclear +Рисует ромб ширины @var{r} с вершинами в точках @var{p1}, @var{p2} цветом @var{stl}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). Если @var{col} содержит 3 цвета, то используется градиентная заливка. @sref{Ellipse sample} @end deftypefn @c ################################################################## @node Text printing, Axis and Colorbar, Primitives drawing, MathGL core @section Вывод текста +@ifclear UDAV @cindex Puts @cindex Putsw +@end ifclear @cindex Text -@cindex Title - -Функции для вывода текста позволяют вывести строку текста в произвольном месте рисунка, в произвольном направлении и вдоль произвольной кривой. Для низкоуровневого вывода и разбора ТеХ-их выражений используется класс mglFont (@pxref{mglFont class}). Он позволяет использовать произвольное начертание шрифта и многие ТеХ-ие команды (детальнее @pxref{Font styles}). Все функции вывода текста имеют варианты для 8-bit строк (@code{char *}) и для Unicode строк (@code{wchar_t *}). В первом случае используется конверсия из текущей локали, т.е. иногда вам требуется явно указать локаль с помощью функции @code{setlocale()}. Аргумент @var{size} определяет размер текста: размер шрифта если положителен или относительный размер (=-@var{size}*@var{FontSize}) если отрицателен. Начертание шрифта (STIX, arial, courier, times и др) можно изменить с помощью функций SetFont(), GetFont(). @xref{Font settings}. - -Параметры шрифта задаются строкой, которая может содержать символы стиля (@samp{rbiwou}) и/или выравнивания (@samp{LRC}). Также строка может содержать символы цвета @samp{wkrgbcymhRGBCYMHW} (@pxref{Line styles}) после символа @samp{:}. Стили шрифта: @samp{r} -- прямой, @samp{i} -- курсив, @samp{b} -- жирный, @samp{w} -- контурный, @samp{o} -- надчеркнутый, @samp{u} -- подчеркнутый. По умолчанию используется прямой шрифт. Типы выравнивания: @samp{L} -- по левому краю (по умолчанию), @samp{C} -- по центру, @samp{R} -- по правому краю. Например, строка @samp{iC:b} соответствует курсиву синего цвета с выравниванием по центру. - -Если строка содержит символы @samp{aA}, то текст выводится в абсолютных координатах (полагаются в диапазоне [0,1]). При этом используются координаты относительно рисунка (если указано @samp{A}) или относительно последнего SubPlot()/InPlot() (если указано @samp{a}). - -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Puts (@code{mglPoint} p, @code{const char *}text, @code{const char *}font=@code{""}, @code{float} size=@code{-1}, @code{char} dir=@code{0}, @code{float} shift=@code{0}) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} Putsw (@code{mglPoint} p, @code{const wchar_t *}text, @code{const char *}font=@code{""}, @code{float} size=@code{-1}, @code{char} dir=@code{0}, @code{float} shift=@code{0}) -@deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} Puts (@code{float} x, @code{float} y, @code{float} z, @code{const char *}text, @code{const char *}font=@code{""}, @code{float} size=@code{-1}, @code{char} dir=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_puts (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const char *}text) -@deftypefnx {Функция С} @code{void} mgl_putsw (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const wchar_t *}text) -@deftypefnx {Функция С} @code{void} mgl_puts_ext (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const char *}text, @code{const char *}font, @code{float} size, @code{char} dir) -@deftypefnx {Функция С} @code{void} mgl_putsw_ext (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const wchar_t *}text, @code{const char *}font, @code{float} size, @code{char} dir) -Выводит строку @var{text} от точки @var{p} шрифтом определяемым строкой @var{how}. Параметр @var{dir} указывает дополнительное выравнивание строки: @samp{x} -- как метку вдоль оси x, @samp{y} -- как метку вдоль оси y, @samp{z} -- как метку вдоль оси z, @samp{i} -- как метку вдоль оси x с инвертированием, @samp{t} -- без выравнивания (по умолчанию), @samp{n} -- выровнять в плоскости x-y. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{float} Puts (@code{mglPoint} p, @code{mglPoint} l, @code{const char *}text, @code{char}where=@code{'t'}, @code{float} size=@code{-1}) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{float} Putsw (@code{mglPoint} p, @code{mglPoint} l, @code{const wchar_t *}text, @code{char}where=@code{'t'}, @code{float} size=@code{-1}) -@deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} Puts (@code{float} x, @code{float} y, @code{float} z, @code{float} dx, @code{float} dy, @code{float} dz, @code{const char *}text, @code{char}where=@code{'t'}, @code{float} size=@code{-1}) -@deftypefnx {Функция С} @code{void} mgl_puts_dir (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{float} dx, @code{float} dy, @code{float} dz, @code{const char *}text, @code{float} size) -@deftypefnx {Функция С} @code{void} mgl_putsw_dir (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{float} dx, @code{float} dy, @code{float} dz, @code{const wchar_t *}text, @code{float} size) -Выводит строку @var{text} от точки @var{p} вдоль направления @var{l}. Параметр @var{where} указывает выводить текст над линией (@samp{T}) или под ней (@samp{t}). Функция возвращает ширину строки. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Printf (@code{mglPoint} p, @code{const char *}arg, ...) -Выводит форматированную строку от точки @var{p}. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Label (@code{float} x, @code{float} y, @code{const char *}text, @code{const char *}font=@code{""}, @code{float} size=@code{-1}) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} Labelw (@code{float} x, @code{float} y, @code{const wchar_t *}text, @code{const char *}font=@code{""}, @code{float} size=@code{-1}) -@deftypefnx {Функция С} @code{void} mgl_label_xy (@code{HMGL} gr, @code{float} x, @code{float} y, @code{const char *}text, @code{const char *}font, @code{float} size) -@deftypefnx {Функция С} @code{void} mgl_labelw_xy (@code{HMGL} gr, @code{float} x, @code{float} y, @code{const wchar_t *}text, @code{const char *}font, @code{float} size) -Выводит строку @var{text} в произвольном месте экрана от точки @{@var{x}, @var{y}@} шрифтом указанным @var{font}. Координаты @code{x, y} считаются лежащими в диапазоне [0,1]. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Title (@code{const char *}text, @code{const char *}font=@code{0}, @code{float} size=@code{-2}) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} Title (@code{const wchar_t *}text, @code{const char *}font=@code{0}, @code{float} size=@code{-2}) -@deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} Title (@code{const char *}text, @code{const char *}font=@code{0}, @code{int} size=@code{-2}) -@deftypefnx {Функция С} @code{void} mgl_title (@code{HMGL} gr, @code{const char *}text, @code{const char *}font, @code{int} size) -@deftypefnx {Функция С} @code{void} mgl_titlew (@code{HMGL} gr, @code{const wchar_t *}text, @code{const char *}font, @code{int} size) -Выводит строку @var{text} как заголовок рисунка (по верху рисунка). Может использоваться из любого места (даже изнутри SubPlot()). -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Text (@code{const mglData &}y, @code{const char *}text, @code{const char *}font=@code{""}, float size=@code{-1}) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} Text (@code{const mglData &}y, @code{const wchar_t *}text, @code{const char *}font=@code{""}, float size=@code{-1}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const char *}text, @code{const char *}font=@code{""}, float size=@code{-1}) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const wchar_t *}text, @code{const char *}font=@code{""}, float size=@code{-1}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}text, @code{const char *}font=@code{""}, float size=@code{-1}) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const wchar_t *}text, @code{const char *}font=@code{""}, float size=@code{-1}) -@deftypefnx {Функция С} @code{void} mgl_text_y (@code{HMGL} gr, @code{const HMDT} y, @code{const char *}text, @code{const char *}font, float size) -@deftypefnx {Функция С} @code{void} mgl_text_xy (@code{const HMDT} x, @code{const HMDT} y, @code{const char *}text, @code{const char *}font, float size) -@deftypefnx {Функция С} @code{void} mgl_text_xyz (@code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}text, @code{const char *}font, float size) -Выводит строку @var{text} вдоль кривой @{@var{x}[i], @var{y}[i], @var{z}[i]@} шрифтом @var{font}. Строка @var{font} может содержать символы: @samp{t} для вывода текста под кривой (по умолчанию), или @samp{T} для вывода текста над кривой. Размеры по 1-ой размерности должны быть одинаковы для всех массивов @code{x.nx=y.nx=z.nx}. Если массив @var{x} не указан, то используется "автоматический" массив со значениями в диапазоне [@var{Min}.x, @var{Max}.x] (@pxref{Ranges (bounding box)}). Если массив @var{z} не указан, то используется @var{z}[i] = @var{zVal}. @sref{Text sample} +@cindex Label +@cindex fgets + +Функции для вывода текста позволяют вывести строку текста в произвольном месте рисунка, в произвольном направлении и вдоль произвольной кривой. MathGL позволяет использовать произвольное начертание шрифта и многие ТеХ-ие команды (детальнее @pxref{Font styles}). Все функции вывода текста имеют варианты для 8-bit строк (@code{char *}) и для Unicode строк (@code{wchar_t *}). В первом случае используется конверсия из текущей локали, т.е. иногда вам требуется явно указать локаль с помощью функции @code{setlocale()}. Аргумент @var{size} определяет размер текста: размер шрифта если положителен или относительный размер (=-@var{size}*@var{FontSize}) если отрицателен. Начертание шрифта (STIX, arial, courier, times и др) можно изменить с помощью функции LoadFont(). @xref{Font settings}. + +Параметры шрифта задаются строкой, которая может содержать символы цвета @samp{wkrgbcymhRGBCYMHW} (@pxref{Line styles}) и, после символа @samp{:}, символы стиля (@samp{rbiwou}) и/или выравнивания (@samp{LRC}). Стили шрифта: @samp{r} -- прямой, @samp{i} -- курсив, @samp{b} -- жирный, @samp{w} -- контурный, @samp{o} -- надчеркнутый, @samp{u} -- подчеркнутый. По умолчанию используется прямой шрифт. Типы выравнивания: @samp{L} -- по левому краю (по умолчанию), @samp{C} -- по центру, @samp{R} -- по правому краю. Например, строка @samp{b:iC} соответствует курсиву синего цвета с выравниванием по центру. + +Если строка содержит символы @samp{aA}, то текст выводится в абсолютных координатах (полагаются в диапазоне [0,1]). При этом используются координаты относительно рисунка (если указано @samp{A}) или относительно последнего SubPlot()/InPlot() (если указано @samp{a}). Если строка содержит символ @samp{@@}, то вокруг текста рисуется прямоугольник. + +@anchor{text} +@deftypefn {MGL command} {} text @code{x y} 'text' ['fnt'='' @code{size=-1}] +@deftypefnx {MGL command} {} text @code{x y z} 'text' ['fnt'='' @code{size=-1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Puts (@code{mglPoint} p, @code{const char *}text, @code{const char *}fnt=@code{""}, @code{float} size=@code{-1}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Putsw (@code{mglPoint} p, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}, @code{float} size=@code{-1}) +@deftypefnx {C function} @code{void} mgl_puts (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const char *}text, @code{const char *}fnt, @code{float} size) +@deftypefnx {C function} @code{void} mgl_putsw (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const wchar_t *}text, @code{const char *}fnt, @code{float} size) +@end ifclear +Выводит строку @var{text} от точки @var{p} шрифтом определяемым строкой @var{fnt}. +@end deftypefn + +@deftypefn {MGL command} {} text @code{x y dx dy} 'text' ['fnt'=':L' @code{size=-1}] +@deftypefnx {MGL command} {} text @code{x y z dx dy dz} 'text' ['fnt'=':L' @code{size=-1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Puts (@code{mglPoint} p, @code{mglPoint} d, @code{const char *}text, @code{const char *}fnt=@code{':L'}, @code{float} size=@code{-1}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Putsw (@code{mglPoint} p, @code{mglPoint} d, @code{const wchar_t *}text, @code{const char *}fnt=@code{':L'}, @code{float} size=@code{-1}) +@deftypefnx {C function} @code{void} mgl_puts_dir (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{float} dx, @code{float} dy, @code{float} dz, @code{const char *}text, @code{const char *}fnt, @code{float} size) +@deftypefnx {C function} @code{void} mgl_putsw_dir (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{float} dx, @code{float} dy, @code{float} dz, @code{const wchar_t *}text, @code{const char *}fnt, @code{float} size) +@end ifclear +Выводит строку @var{text} от точки @var{p} вдоль направления @var{d}. Параметр @var{fnt} задает стиль текста и указывает выводить текст над линией (@samp{T}) или под ней (@samp{t}). +@end deftypefn + +@anchor{fgets} +@deftypefn {MGL command} {} fgets @code{x y} 'fname' [@code{n=0} 'fnt'='' @code{size=-1.4}] +@deftypefnx {MGL command} {} fgets @code{x y z} 'fname' [@code{n=0} 'fnt'='' @code{size=-1.4}] +Выводит @var{n}-ую строку файла @var{fname} от точки @{@var{x},@var{y},@var{z}@} шрифтом @var{fnt} и размером @var{size}. +@end deftypefn + +@anchor{label} +@deftypefn {MGL command} {} label @code{x y} 'text' ['fnt'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Label (@code{float} x, @code{float} y, @code{const char *}text, @code{const char *}fnt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Labelw (@code{float} x, @code{float} y, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}) +@deftypefnx {C function} @code{void} mgl_label_xy (@code{HMGL} gr, @code{float} x, @code{float} y, @code{const char *}text, @code{const char *}fnt) +@deftypefnx {C function} @code{void} mgl_labelw_xy (@code{HMGL} gr, @code{float} x, @code{float} y, @code{const wchar_t *}text, @code{const char *}fnt) +@end ifclear +Выводит строку @var{text} в произвольном месте экрана от точки @{@var{x}, @var{y}@} шрифтом указанным @var{fnt}. Координаты @code{x, y} считаются лежащими в диапазоне [0,1]. +@end deftypefn + +@deftypefnx {MGL command} {} text xdat ydat 'text' ['fnt'='' @code{size=-1 zval=nan}] +@deftypefnx {MGL command} {} text xdat ydat zdat 'text' ['fnt'='' @code{size=-1}] +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} Text (@code{const mglData &}y, @code{const char *}text, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Text (@code{const mglData &}y, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const char *}text, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}text, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Text (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const wchar_t *}text, @code{const char *}fnt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_text_y (@code{HMGL} gr, @code{HCDT} y, @code{const char *}text, @code{const char *}fnt, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_textw_y (@code{HMGL} gr, @code{HCDT} y, @code{const wchar_t *}text, @code{const char *}fnt, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_text_xy (@code{HCDT} x, @code{HCDT} y, @code{const char *}text, @code{const char *}fnt, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_textw_xy (@code{HCDT} x, @code{HCDT} y, @code{const wchar_t *}text, @code{const char *}fnt, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_text_xyz (@code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}text, @code{const char *}fnt, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_textw_xyz (@code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const wchar_t *}text, @code{const char *}fnt, @code{const char *}opt) +@end ifclear +Выводит строку @var{text} вдоль кривой @{@var{x}[i], @var{y}[i], @var{z}[i]@} шрифтом @var{fnt}. Строка @var{fnt} может содержать символы: @samp{t} для вывода текста под кривой (по умолчанию), или @samp{T} для вывода текста над кривой. Размеры по 1-ой размерности должны быть одинаковы для всех массивов @code{x.nx=y.nx=z.nx}. Если массив @var{x} не указан, то используется "автоматический" массив со значениями в диапазоне [@var{Min}.x, @var{Max}.x] (@pxref{Ranges (bounding box)}). Если массив @var{z} не указан, то используется @var{z}[i] = @var{Min}.z. Строка @var{opt} содержит опции команды (@pxref{Command options}). @sref{Text sample} @end deftypefn @c ################################################################## @@ -999,50 +1329,83 @@ Setsize: размер(ы) равны нулю или отрицательны Эти функции рисуют объекты для "измерения" типа осей координат, цветовой таблицы (colorbar), сетку по осям, обрамляющий параллелепипед и подписи по осям координат. См. также @pxref{Axis settings}. -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Axis (@code{const char *}dir=@code{"xyz"}, @code{bool} adjust=@code{false}) -@deftypefnx {Функция С} @code{void} mgl_axis (@code{HMGL} gr, @code{const char *}dir) -Рисует оси координат и метки на них (@pxref{Axis settings}) в направлениях, указанных строкой @var{dir}. Если строка содержит символ @samp{_}, то подписи меток отображаться не будут. Шрифт подписей определяется функцией @code{SetFontDef()} (@pxref{Font settings}). Метки будут "подогнаны" если @var{adjust}=@code{true} (с помощью вызова функции @code{AdjustTicks()}). -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Colorbar (@code{const char *}sch=@code{""}, @code{int} pos=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_colorbar (@code{HMGL} gr, @code{const char *}sch, @code{int} pos) +@anchor{axis} +@deftypefn {MGL command} {} axis ['dir'='xyz' @code{adjust=off}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Axis (@code{const char *}dir=@code{"xyz"}, @code{bool} adjust=@code{false}) +@deftypefnx {C function} @code{void} mgl_axis (@code{HMGL} gr, @code{const char *}dir, @code{int} adjust) +@end ifclear +Рисует оси координат и метки на них (@pxref{Axis settings}) в направлениях, указанных строкой @var{dir}. Если строка содержит символ @samp{_}, то подписи меток отображаться не будут. Шрифт подписей определяется функцией @code{SetFontDef()} (@pxref{Font settings}). Метки будут "подогнаны" если @var{adjust}=@code{true} (с помощью вызова функции @code{AdjustTicks()}). +@end deftypefn + +@anchor{colorbar} +@deftypefn {MGL command} {} colorbar ['sch'='' @code{pos=0}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Colorbar (@code{const char *}sch=@code{""}, @code{int} pos=@code{0}) +@deftypefnx {C function} @code{void} mgl_colorbar (@code{HMGL} gr, @code{const char *}sch, @code{int} pos) +@end ifclear Рисует полосу соответствия цвета и числовых значений (colorbar) для цветовой схемы @var{sch} (используется текущая для @code{sch=""}) с краю от графика. Параметр @var{pos} задает местоположение: @samp{0} - справа (по умолчанию), @samp{1} - слева, @samp{2} - сверху, @samp{3} - снизу. Если строка @var{sch} содержит @samp{<>^_}, то параметр @var{pos} определяется как: @code{pos=0} для @samp{>} (справа), @code{pos=1} для @samp{<} (слева), @code{pos=2} для @samp{^} (сверху), @code{pos=3} для @samp{_} (снизу). Если строка содержит @samp{A}, то используются абсолютные координаты (относительно рисунка). @sref{Dens sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Colorbar (@code{const mglData &}v, @code{const char *}sch=@code{""}, @code{int} where=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_colorbar_val (@code{HMGL} gr, @code{const HMDT} v, @code{const char *}sch, @code{int} where) +@deftypefn {MGL command} {} colorbar vdat ['sch'='' @code{pos=0}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Colorbar (@code{const mglData &}v, @code{const char *}sch=@code{""}, @code{int} pos=@code{0}) +@deftypefnx {C function} @code{void} mgl_colorbar_val (@code{HMGL} gr, @code{HCDT} v, @code{const char *}sch, @code{int} pos) +@end ifclear Аналогично предыдущему, но для цветовой схемы без сглаживания с заданными значениями @var{v}. @sref{ContD sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Colorbar (@code{const char *}sch, @code{int} where, @code{float} x, @code{float} y, @code{float} w, @code{float} h) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} Colorbar (@code{int} where, @code{float} x, @code{float} y, @code{float} w, @code{float} h) -@deftypefnx {Функция С} @code{void} mgl_colorbar_ext (@code{HMGL} gr, @code{const char *}sch, @code{int} where, @code{float} x, @code{float} y, @code{float} w, @code{float} h) +@deftypefn {MGL command} {} colorbar 'sch' @code{pos x y w h} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Colorbar (@code{const char *}sch, @code{int} pos, @code{float} x, @code{float} y, @code{float} w, @code{float} h) +@deftypefnx {Method on @code{mglGraph}} @code{void} Colorbar (@code{int} pos, @code{float} x, @code{float} y, @code{float} w, @code{float} h) +@deftypefnx {C function} @code{void} mgl_colorbar_ext (@code{HMGL} gr, @code{const char *}sch, @code{int} pos, @code{float} x, @code{float} y, @code{float} w, @code{float} h) +@end ifclear Аналогично первому, но в произвольном месте графика @{@var{x}, @var{y}@} (полагаются в диапазоне [0,1]). Параметры @var{w}, @var{h} задают относительную ширину и высоту colorbar. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Colorbar (@code{const mglData &}v, @code{const char *}sch, @code{int} where, @code{float} x, @code{float} y, @code{float} w, @code{float} h) +@ifclear UDAV +@deftypefn {Method on @code{mglGraph}} @code{void} Colorbar (@code{const mglData &}v, @code{const char *}sch, @code{int} pos, @code{float} x, @code{float} y, @code{float} w, @code{float} h) +@deftypefnx {C function} @code{void} mgl_colorbar_val_ext (@code{HMGL} gr, @code{HCDT} v, @code{const char *}sch, @code{int} pos, @code{float} x, @code{float} y, @code{float} w, @code{float} h) Аналогично предыдущему, но для цветовой схемы без сглаживания с заданными значениями @var{v}. @end deftypefn +@end ifclear -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Grid (@code{const char *}dir=@code{"xyz"}, @code{const char *}pen=@code{"B-"}) -@deftypefnx {Функция С} @code{void} mgl_axis_grid (@code{HMGL} gr, @code{const char *}dir, @code{const char *}pen) +@anchor{grid} +@deftypefn {MGL command} {} grid ['dir'='xyz' 'pen'='B'] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Grid (@code{const char *}dir=@code{"xyz"}, @code{const char *}pen=@code{"B"}) +@deftypefnx {C function} @code{void} mgl_axis_grid (@code{HMGL} gr, @code{const char *}dir, @code{const char *}pen) +@end ifclear Рисует линии сетки в направлениях перпендикулярным @var{dir}. Шаг сетки такой же как у меток осей координат. Стиль линий задается параметром @var{pen} (по умолчанию -- сплошная темно синяя линия @samp{B-}). @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Box (@code{const char *}col=@code{""}, @code{bool} ticks=@code{true}) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} Box (@code{mglColor} col, @code{bool} ticks=@code{true}) -@deftypefnx {Функция С} @code{void} mgl_box (@code{HMGL} gr, @code{int} ticks) -@deftypefnx {Функция С} @code{void} mgl_box_rgb (@code{HMGL} gr, @code{float} r, @code{float} g, @code{float} b, @code{int} ticks) -@deftypefnx {Функция С} @code{void} mgl_box_str (@code{HMGL} gr, @code{const char *}col, @code{int} ticks) +@anchor{box} +@deftypefn {MGL command} {} box ['stl'='k' @code{ticks=on}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Box (@code{const char *}col=@code{""}, @code{bool} ticks=@code{true}) +@deftypefnx {C function} @code{void} mgl_box (@code{HMGL} gr, @code{int} ticks) +@deftypefnx {C function} @code{void} mgl_box_str (@code{HMGL} gr, @code{const char *}col, @code{int} ticks) +@end ifclear Рисует ограничивающий параллелепипед цветом @var{col}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Label (@code{char} dir, @code{const char *}text, @code{float} pos=@code{0}, @code{float} size=@code{-1.4}, @code{float} shift=@code{0}) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} Label (@code{char} dir, @code{const wchar_t *}text, @code{float} pos=@code{0}, @code{float} size=@code{-1.4}, @code{float} shift=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_label (@code{HMGL} gr, @code{char} dir, @code{const char *}text) -@deftypefnx {Функция С} @code{void} mgl_label_ext (@code{HMGL} gr, @code{char} dir, @code{const char *}text, @code{float} pos, @code{float} size, @code{float} shift) -@deftypefnx {Функция С} @code{void} mgl_labelw_ext (@code{HMGL} gr, @code{char} dir, @code{const wchar_t *}text, @code{float} pos, @code{float} size, @code{float} shift) -Выводит подпись @var{text} для оси @var{dir}=@samp{x},@samp{y},@samp{z},@samp{t} (где @samp{t} -- ``тернарная'' ось @math{t=1-x-y}). Параметр @var{pos} задает положение подписи: при @var{pos}=0 -- по центру оси, при @var{pos}>0 -- около максимальных значений, при @var{pos}<0 -- около минимальных значений. Параметр @var{size} задает размер шрифта (по умолчанию в 1.4 раза больше чем у меток, @pxref{Font settings}). @xref{Text printing}. +@anchor{xlabel} +@anchor{ylabel} +@anchor{zlabel} +@anchor{tlabel} +@deftypefn {MGL command} {} xlabel 'text' [@code{pos=1 shift=0}] +@deftypefnx {MGL command} {} ylabel 'text' [@code{pos=1 shift=0}] +@deftypefnx {MGL command} {} zlabel 'text' [@code{pos=1 shift=0}] +@deftypefnx {MGL command} {} tlabel 'text' [@code{pos=1 shift=0}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Label (@code{char} dir, @code{const char *}text, @code{float} pos=@code{1}, @code{float} shift=@code{0}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Label (@code{char} dir, @code{const wchar_t *}text, @code{float} pos=@code{1}, @code{float} shift=@code{0}) +@deftypefnx {C function} @code{void} mgl_label (@code{HMGL} gr, @code{char} dir, @code{const char *}text) +@deftypefnx {C function} @code{void} mgl_label_ext (@code{HMGL} gr, @code{char} dir, @code{const char *}text, @code{float} pos, @code{float} shift) +@deftypefnx {C function} @code{void} mgl_labelw_ext (@code{HMGL} gr, @code{char} dir, @code{const wchar_t *}text, @code{float} pos, @code{float} shift) +@end ifclear +Выводит подпись @var{text} для оси @var{dir}=@samp{x},@samp{y},@samp{z},@samp{t} (где @samp{t} -- ``тернарная'' ось @math{t=1-x-y}). Параметр @var{pos} задает положение подписи: при @var{pos}=0 -- по центру оси, при @var{pos}>0 -- около максимальных значений, при @var{pos}<0 -- около минимальных значений. @xref{Text printing}. @end deftypefn @c ################################################################## @@ -1054,45 +1417,51 @@ Setsize: размер(ы) равны нулю или отрицательны @cindex SetLegendBox @cindex SetLegendMarks -Эти функции обеспечивают рисование легенды графика (полезно для @ref{1D plotting}). Запись в легенде состоит из двух строк: одна для стиля линии и маркеров, другая с текстом описания (с включенным разбором TeX-их команд). Можно использовать непосредственно массивы строк, или накопление во внутренние массивы с помощью функции AddLegend() с последующим отображением. Положение легенды можно задать автоматически или вручную. Параметры @var{font} и @var{size} задают стиль и размер шрифта (@pxref{Font settings}). Параметр @var{llen} задает относительную ширину примера линии. Ели стиль линии пустой, то соответствующий текст печатается без отступа. Если строка @var{font} содержит символ @samp{A}, то координаты легенды считаются относительно картинки (а не текущего subplot). @sref{Legend sample} - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Legend (@code{int} where=@code{0x3}, @code{const char *}font=@code{"rL"}, @code{float} size=@code{-0.8}, @code{float} llen=@code{0.1}) -@deftypefnx {Функция С} @code{void} mgl_legend (@code{HMGL} gr, @code{int} where, @code{const char *}font, @code{float} size, @code{float} llen) -Рисует легенду из накопленных записей шрифтом @var{font} размером @var{size}. Параметр @var{where} задает положение легенды: @samp{0} -- в нижнем левом углу, @samp{1} -- нижнем правом углу, @samp{2} -- верхнем левом углу, @samp{3} -- верхнем правом углу (по умолчанию). -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Legend (@code{int} n, @code{wchar_t **}text, @code{char **}style, @code{int} where=@code{0x3}, @code{const char *}font=@code{"rL"}, @code{float} size=@code{-0.8}, @code{float} llen=@code{0.1}) -Рисует легенду из @var{n} записей шрифтом @var{font} размером @var{size}. Массив @var{text} задает описание кривых со стилем @var{style} (включая маркеры). Параметр @var{where} задает положение легенды: @samp{0} -- в нижнем левом углу, @samp{1} -- нижнем правом углу, @samp{2} -- верхнем левом углу, @samp{3} -- верхнем правом углу (по умолчанию). -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Legend (@code{float} x, @code{float} y, @code{const char *}font=@code{"rL"}, @code{float} size=@code{-0.8}, @code{float} llen=@code{0.1}) -@deftypefnx {Функция С} @code{void} mgl_legend_xy (@code{HMGL} gr, @code{float} x, @code{float} y, @code{const char *}font, @code{float} size, @code{float} llen) -Рисует легенду из накопленных записей шрифтом @var{font} размером @var{size}. Положение легенды задается параметрами @var{x}, @var{y}, которые полагаются нормированными в диапазоне [0,1]. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Legend (@code{int} n, @code{wchar_t **}text, @code{char **}style, @code{float} x, @code{float} y, @code{const char *}font=@code{"rL"}, @code{float} size=@code{-0.8}, @code{float} llen=@code{0.1}) -Рисует легенду из @var{n} записей шрифтом @var{font} размером @var{size}. Массив @var{text} задает описание кривых со стилем @var{style} (включая маркеры). Положение легенды задается параметрами @var{x}, @var{y}, которые полагаются нормированными в диапазоне [0,1]. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} AddLegend (@code{const char *}text, @code{const char *}style) -@deftypefnx {Метод класса @code{mglGraph} (C++)} @code{void} AddLegend (@code{const wchar_t *}text, @code{const char *}style) -@deftypefnx {Функция С} @code{void} mgl_add_legend (@code{HMGL} gr, @code{const char *}text, @code{const char *}style) -@deftypefnx {Функция С} @code{void} mgl_add_legendw (@code{HMGL} gr, @code{const wchar_t *}text, @code{const char *}style) -Добавляет описание @var{text} кривой со стилем @var{style} (@pxref{Line styles}) во внутренний массив записей легенды. Максимальное число записей 100. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ClearLegend () -@deftypefnx {Функция С} @code{void} mgl_clear_legend (@code{HMGL} gr) +Эти функции обеспечивают рисование легенды графика (полезно для @ref{1D plotting}). Запись в легенде состоит из двух строк: одна для стиля линии и маркеров, другая с текстом описания (с включенным разбором TeX-их команд). Можно использовать непосредственно массивы строк, или накопление во внутренние массивы с помощью функции AddLegend() с последующим отображением. Положение легенды можно задать автоматически или вручную. Параметры @var{fnt} и @var{size} задают стиль и размер шрифта (@pxref{Font settings}). Параметр @var{llen} задает относительную ширину примера линии. Ели стиль линии пустой, то соответствующий текст печатается без отступа. Если строка @var{fnt} содержит символ @samp{A}, то координаты легенды считаются относительно картинки (а не текущего subplot). Если строка @var{fnt} содержит символ @samp{#}, то рисуется прямоугольник вокруг легенды. @sref{Legend sample} + +@anchor{legend} +@deftypefn {MGL command} {} legend [@code{pos=3} 'fnt'='#' @code{size=-0.8 llen=0.1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Legend (@code{int} pos=@code{0x3}, @code{const char *}fnt=@code{"#"}, @code{float} size=@code{-0.8}, @code{float} llen=@code{0.1}) +@deftypefnx {C function} @code{void} mgl_legend (@code{HMGL} gr, @code{int} pos, @code{const char *}fnt, @code{float} size, @code{float} llen) +@end ifclear +Рисует легенду из накопленных записей шрифтом @var{fnt} размером @var{size}. Параметр @var{pos} задает положение легенды: @samp{0} -- в нижнем левом углу, @samp{1} -- нижнем правом углу, @samp{2} -- верхнем левом углу, @samp{3} -- верхнем правом углу (по умолчанию). +@end deftypefn + +@deftypefn {MGL command} {} legend @code{x y} ['fnt'='#' @code{size=-1 llen=0.1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Legend (@code{float} x, @code{float} y, @code{const char *}fnt=@code{"#"}, @code{float} size=@code{-0.8}, @code{float} llen=@code{0.1}) +@deftypefnx {C function} @code{void} mgl_legend_xy (@code{HMGL} gr, @code{float} x, @code{float} y, @code{const char *}fnt, @code{float} size, @code{float} llen) +@end ifclear +Рисует легенду из накопленных записей шрифтом @var{fnt} размером @var{size}. Положение легенды задается параметрами @var{x}, @var{y}, которые полагаются нормированными в диапазоне [0,1]. +@end deftypefn + +@anchor{addlegend} +@deftypefn {MGL command} {} addlegend 'text' 'stl' +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} AddLegend (@code{const char *}text, @code{const char *}style) +@deftypefnx {Method on @code{mglGraph}} @code{void} AddLegend (@code{const wchar_t *}text, @code{const char *}style) +@deftypefnx {C function} @code{void} mgl_add_legend (@code{HMGL} gr, @code{const char *}text, @code{const char *}style) +@deftypefnx {C function} @code{void} mgl_add_legendw (@code{HMGL} gr, @code{const wchar_t *}text, @code{const char *}style) +@end ifclear +Добавляет описание @var{text} кривой со стилем @var{style} (@pxref{Line styles}) во внутренний массив записей легенды. +@end deftypefn + +@anchor{clearlegend} +@deftypefn {MGL command} {} clearlegend +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} ClearLegend () +@deftypefnx {C function} @code{void} mgl_clear_legend (@code{HMGL} gr) +@end ifclear Очищает внутренний массив записей легенды. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SetLegendBox (@code{bool} enable) -@deftypefnx {Функция С} @code{void} mgl_set_legend_box (@code{HMGL} gr, @code{int} enable) -Включает/выключает рисование прямоугольника вокруг легенды. По умолчанию (=@code{true}) прямоугольник рисуется. -@end deftypefn - -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} SetLegendMarks (@code{int} num) +@anchor{legendmarks} +@deftypefn {MGL command} {} legendmarks @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetLegendMarks (@code{int} num) @deftypefnx {C function} @code{void} mgl_set_legend_marks (@code{HMGL} gr, @code{int} num) +@end ifclear Задает число маркеров в легенде. По умолчанию используется 1 маркер. @end deftypefn @@ -1103,21 +1472,21 @@ Setsize: размер(ы) равны нулю или отрицательны Эти функции строят графики для одномерных (1D) массивов. Одномерными считаются массивы, зависящие только от одного параметра (индекса) подобно кривой в параметрической форме @{x(i),y(i),z(i)@}, i=1...n. Есть 5 основных типов 1D графиков: линия (Plot), линия с заполнением (Area), ступеньки (Step), прямоугольники (Bars, Barh) и вертикальные линии (Stem). Все эти типы графиков имеют похожий интерфейс. Есть версии для рисования в пространстве и на плоскости. В последнем случае имеется возможность использования только одного массива. Стиль линии и маркеров указывается строковой переменной. Если она равна "", то используется сплошная линия с цветом из палитры (@pxref{Palette and colors}). Кроме того, есть еще несколько типов графиков для одномерных массивов, имеющих другой интерфейс и вид: поверхность вращения кривой (Torus), диаграмма (Chart), размер ошибки (Error), маркеры переменного размера (Mark), трубками (Tube) и т.д. @xref{Line styles}. @sref{1D plot sample} @menu -* Plot:: -* Radar:: -* Tens:: -* Area:: -* Region:: -* Stem:: -* Bars:: -* Barh:: -* Chart:: -* Step:: -* Torus:: -* Tube:: -* Mark:: -* TextMark:: -* Error:: +* Plot:: +* Radar:: +* Tens:: +* Area:: +* Region:: +* Stem:: +* Bars:: +* Barh:: +* Chart:: +* Step:: +* Torus:: +* Tube:: +* Mark:: +* TextMark:: +* Error:: * BoxPlot:: @end menu @@ -1128,17 +1497,17 @@ Setsize: размер(ы) равны нулю или отрицательны Функции рисуют ломанную линию по точкам. График рисуется для каждой строки если один из массивов матрица. Размер по 1-ой координате @strong{должен быть одинаков} для всех массивов @code{x.nx=y.nx=z.nx}. Строка @var{pen} задает цвет и стиль линии и маркеров (@pxref{Line styles}). По умолчанию (@code{pen=""}) рисуется сплошная линия с текущим цветом из палитры (@pxref{Palette and colors}). См. также @ref{Area}, @ref{Step}, @ref{Stem}, @ref{Tube}, @ref{Mark}, @ref{Error}, @ref{Belt}, @ref{Tens}. @sref{Plot sample} -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Plot (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}pen=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Plot (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}pen=@code{""}) @deftypefnx {Функция С} @code{void} mgl_plot_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}pen) Рисует в пространстве линию между точками @{@var{x}[i], @var{y}[i], @var{z}[i]@}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Plot (@code{const mglData &}x, @code{const mglData &}y, @code{const char *}pen=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Plot (@code{const mglData &}x, @code{const mglData &}y, @code{const char *}pen=@code{""}) @deftypefnx {Функция С} @code{void} mgl_plot_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const char *}pen) Рисует линию между точками @{@var{x}[i], @var{y}[i]@} в плоскости @var{z}=@var{zVal} (по умолчанию в плоскости @var{z}=@var{Min.z}). @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Plot (@code{const mglData &}y, @code{const char *}pen=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Plot (@code{const mglData &}y, @code{const char *}pen=@code{""}) @deftypefnx {Функция С} @code{void} mgl_plot (@code{HMGL} gr, @code{const HMDT} y, @code{const char *}pen) Рисует линию между точками @{@var{x}[i], @var{y}[i]@} в плоскости @var{z}=@var{zVal} (по умолчанию в плоскости @var{z}=@var{Min.z}), где значения @var{x}[i] равно распределены в интервале [@var{Min}.x, @var{Max}.x]. @end deftypefn @@ -1148,7 +1517,7 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection Radar @cindex Radar -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Radar (@code{const mglData &}a, @code{const char *}pen=@code{""}, @code{float} r=@code{-1}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Radar (@code{const mglData &}a, @code{const char *}pen=@code{""}, @code{float} r=@code{-1}) @deftypefnx {Функция С} @code{void} mgl_radar (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}pen, @code{float} r) Функции рисуют radar chart, представляющий собой ломанную с вершинами на радиальных линиях (типа ломанной в полярных координатах). График рисуется для каждой строки если один из массивов матрица. Параметр @var{r} задает дополнительный сдвиг данных (т.е. используется @var{a}+@var{r} вместо @var{a}). Если @code{r<0}, то @code{r=max(0, -min(a)}. Строка @var{pen} задает цвет и стиль линии и маркеров (@pxref{Line styles}). По умолчанию (@code{pen=""}) используется сплошная линия с текущим цветом из палитры (@pxref{Palette and colors}). Если @var{pen} содержит символ @samp{#}, то также рисуется "сетка" (радиальные линии и круг для @var{r}). См. также @ref{Plot}. @sref{Radar sample} @end deftypefn @@ -1160,17 +1529,17 @@ Setsize: размер(ы) равны нулю или отрицательны Функции рисуют ломанную линию по точкам с цветом, определяемым массивом @var{c} (типа графика натяжений). График рисуется для каждой строки если один из массивов матрица. Размер по 1-ой координате @strong{должен быть одинаков} для всех массивов @code{x.nx=y.nx=z.nx=c.nx}. Строка @var{pen} задает цветовую схему (@pxref{Color scheme}) и стиль и/или толщину линии (@pxref{Line styles}). По умолчанию (@code{pen=""}) используется сплошная линия с текущей цветовой схемой. См. также @ref{Plot}, @ref{Mesh}, @ref{Fall}. @sref{Tens sample} -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Tens (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}pen=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Tens (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}pen=@code{""}) @deftypefnx {Функция С} @code{void} mgl_tens_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}pen) Рисует в пространстве линию между точками @{@var{x}[i], @var{y}[i], @var{z}[i]@} с цветом @var{c}[i]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Tens (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}c, @code{const char *}pen=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Tens (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}c, @code{const char *}pen=@code{""}) @deftypefnx {Функция С} @code{void} mgl_tens_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} c, @code{const char *}pen) Рисует линию между точками @{@var{x}[i], @var{y}[i]@} в плоскости @var{z}=@var{zVal} (по умолчанию в плоскости @var{z}=@var{Min.z}) с цветом @var{c}[i]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Tens (@code{const mglData &}y, @code{const mglData &}c, @code{const char *}pen=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Tens (@code{const mglData &}y, @code{const mglData &}c, @code{const char *}pen=@code{""}) @deftypefnx {Функция С} @code{void} mgl_tens (@code{HMGL} gr, @code{const HMDT} y, @code{const HMDT} c, @code{const char *}pen) Рисует линию между точками @{@var{x}[i], @var{y}[i]@} в плоскости @var{z}=@var{zVal} (по умолчанию в плоскости @var{z}=@var{Min.z}) с цветом @var{c}[i], где значения @var{x}[i] равно распределены в интервале [@var{Min}.x, @var{Max}.x]. @end deftypefn @@ -1182,17 +1551,17 @@ Setsize: размер(ы) равны нулю или отрицательны Функции рисуют ломанную линию между точками и закрашивает ее вниз до плоскости осей координат. График рисуется для каждой строки если один из массивов матрица. Размер по 1-ой координате @strong{должен быть одинаков} для всех массивов @code{x.nx=y.nx=z.nx}. Строка @var{pen} задает цвет и стиль линии и маркеров (@pxref{Line styles}). По умолчанию (@code{pen=""}) используется сплошная линия с текущим цветом из палитры (@pxref{Palette and colors}). Также можно использовать градиентное закрашивание если число указанных цветов равно удвоенному числу кривых для построения. Если строка содержит символ @samp{a}, то линии рисуются одна поверх другой (с суммированием) -- того же эффекта можно достичь вызовом @code{y.CumSum("y");} перед построением графика. См. также @ref{Plot}, @ref{Bars}, @ref{Stem}. @sref{Area sample} -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Area (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}pen=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Area (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}pen=@code{""}) @deftypefnx {Функция С} @code{void} mgl_area_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}pen) Рисует в пространстве линию между точками @{@var{x}[i], @var{y}[i], @var{z}[i]@} и закрашивает ее вниз до плоскости @var{z} = Org.z. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Area (@code{const mglData &}x, @code{const mglData &}y, @code{const char *}pen=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Area (@code{const mglData &}x, @code{const mglData &}y, @code{const char *}pen=@code{""}) @deftypefnx {Функция С} @code{void} mgl_area_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const char *}pen) Рисует линию между точками @{@var{x}[i], @var{y}[i]@} в плоскости @var{z}=@var{zVal} (по умолчанию в плоскости @var{z}=@var{Min.z}) и закрашивает ее до прямой @var{y} = Org.y. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Area (@code{const mglData &}y, @code{const char *}pen=@code{""}, @code{bool} sum=@code{false}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Area (@code{const mglData &}y, @code{const char *}pen=@code{""}, @code{bool} sum=@code{false}) @deftypefnx {Функция С} @code{void} mgl_area (@code{HMGL} gr, @code{const HMDT} y, @code{const char *}pen) @deftypefnx {Функция С} @code{void} mgl_area_s (@code{HMGL} gr, @code{const HMDT} y, @code{const char *}pen) Рисует линию между точками @{@var{x}[i], @var{y}[i]@} в плоскости @var{z}=@var{zVal} (по умолчанию в плоскости @var{z}=@var{Min.z}) и закрашивает ее до прямой @var{y} = Org.y, где значения @var{x}[i] равно распределены в интервале [@var{Min}.x, @var{Max}.x]. Параметр @var{sum} задает режим рисования линий одна поверх другой (с сумированием). Замечу, что того же эффекта можно достичь вызовом @code{y.CumSum("y");} перед построением графика. @@ -1205,12 +1574,12 @@ Setsize: размер(ы) равны нулю или отрицательны Функции закрашивают область между 2 кривыми. График рисуется для каждой строки если один из массивов матрица. Размер по 1-ой координате @strong{должен быть одинаков} для всех массивов @code{x.nx=y1.nx=y2.nx} и размеры массивов @var{y1}, @var{y2} должны быть также одинаковы. Строка @var{pen} задает цвет (@pxref{Line styles}). По умолчанию (@code{pen=""}) используется текущий цвет из палитры (@pxref{Palette and colors}). Также можно использовать градиентное закрашивание если число указанных цветов равно удвоенному числу кривых для построения. См. также @ref{Area}, @ref{Bars}, @ref{Stem}. @sref{Region sample} -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Region (@code{const mglData &}x, @code{const mglData &}y1, @code{const mglData &}y2, @code{const char *}pen=@code{""}, @code{float} zVal=@code{NAN}, @code{bool} inside=@code{true}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Region (@code{const mglData &}x, @code{const mglData &}y1, @code{const mglData &}y2, @code{const char *}pen=@code{""}, @code{float} zVal=@code{NAN}, @code{bool} inside=@code{true}) @deftypefnx {Функция С} @code{void} mgl_region_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y1, @code{const HMDT} y2, @code{const char *}pen, @code{int} inside) Закрашивает область между кривыми @{@var{x}[i], @var{y1}[i]@} и @{@var{x}[i], @var{y2}[i]@} при z=@var{zVal}. При @code{inside=off} закрашивается только область y12}). Строка @var{sch} задает цвет контуров: цвет k-го контура определяется символом @code{sch[k%strlen(sch)]}. Младшие размерности массивов @var{x}, @var{y}, @var{z} должны быть одинаковы @code{x.nx=z.nx && y.nx=z.ny} или @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{z}). График строится для каждого z среза данных. См. также @ref{Dens}, @ref{Cont}, @ref{ContF}. @sref{ContD sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContD (@code{const mglData &}v, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContD (@code{const mglData &}v, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_contd_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContD (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{7}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContD (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{7}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_contd_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{int} num, @code{float} zVal) Как предыдущий с вектором @var{v} из @var{num} элементов равно распределенных в интервале [@var{Cmin}, @var{Cmax}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContD (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{7}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContD (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{7}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_contd (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch, @code{int} num, @code{float} zVal) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -1656,22 +2025,22 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection Axial @cindex Axial -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Axial (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Axial (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_axial_xy_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch) -Рисует поверхность вращения линии уровня для параметрически заданной поверхности @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@}. Линии уровня рисуются для @var{z}[i,j]=@var{v}[k]. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Если @var{sch} содержит @samp{#}, то рисуется сетчатая поверхность. Если строка содержит символы @samp{x}, @samp{y} или @samp{z}, то ось вращения (@pxref{Other settings}) устанавливается в указанное направление. Младшие размерности массивов @var{x}, @var{y}, @var{z} должны быть одинаковы @code{x.nx=z.nx && y.nx=z.ny} или @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{z}). График строится для каждого z среза данных. См. также @ref{Cont}, @ref{ContF}, @ref{Torus}, @ref{Surf3}. @sref{Axial sample} +Рисует поверхность вращения линии уровня для параметрически заданной поверхности @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@}. Линии уровня рисуются для @var{z}[i,j]=@var{v}[k]. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Если @var{sch} содержит @samp{#}, то рисуется сетчатая поверхность. Если строка содержит символы @samp{x}, @samp{y} или @samp{z}, то ось вращения устанавливается в указанное направление. Младшие размерности массивов @var{x}, @var{y}, @var{z} должны быть одинаковы @code{x.nx=z.nx && y.nx=z.ny} или @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{z}). График строится для каждого z среза данных. См. также @ref{Cont}, @ref{ContF}, @ref{Torus}, @ref{Surf3}. @sref{Axial sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Axial (@code{const mglData &}v, @code{const mglData &}z, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Axial (@code{const mglData &}v, @code{const mglData &}z, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_axial_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} z, @code{const char *}sch) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Axial (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Axial (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) @deftypefnx {Функция С} @code{void} mgl_axial_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{int} num) Как предыдущий с вектором @var{v} из @var{num} элементов равно распределенных в интервале [@var{Cmin}, @var{Cmax}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Axial (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Axial (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) @deftypefnx {Функция С} @code{void} mgl_axial (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch, @code{int} num) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -1681,18 +2050,18 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection Grad @cindex Grad -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Grad (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}phi, @code{const char *}sch=@code{""}, @code{int} num=@code{5}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Grad (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}phi, @code{const char *}sch=@code{""}, @code{int} num=@code{5}) @deftypefnx {Функция С} @code{void} mgl_grad_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{int} num, @code{float} zVal) Рисует линии градиента скалярного поля @var{phi}[i,j,k] заданного параметрически @{@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]@}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Число линий пропорционально @var{num}. Линии рисуются только с границ интервала при @var{num}<0. Младшие размерности массивов @var{x}, @var{y}, @var{z}, @var{phi} должны быть одинаковы @code{x.nx=phi.nx && y.nx=phi.ny && z.nx=phi.nz} или @code{x.nx=y.nx=z.nx=phi.nx && x.ny=y.ny=z.ny=phi.ny && x.nz=y.nz=z.nz=phi.nz}. Массивы @var{x}, @var{y} и @var{z} могут быть векторами (не матрицами как @var{phi}). См. также @ref{Dens3}, @ref{Cont3}, @ref{Flow}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Grad (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{5}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Grad (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{5}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_grad_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{int} num, @code{float} zVal) Рисует линии градиента скалярного поля @var{phi}[i,j] заданного параметрически @{@var{x}[i,j], @var{y}[i,j]@} при @var{z} = @var{zVal}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Число линий пропорционально @var{num}. Линии рисуются только с границ интервала при @var{num}<0. Младшие размерности массивов @var{x}, @var{y}, @var{phi} должны быть одинаковы @code{x.nx=phi.nx && y.nx=phi.ny} или @code{x.nx=y.nx=phi.nx && x.ny=y.ny=phi.ny}. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{phi}). График строится для каждого z среза данных. См. также @ref{Dens}, @ref{Cont}, @ref{ContF}, @ref{Flow}. @sref{Grad sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Grad (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{5}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Grad (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{int} num=@code{5}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_grad (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch, @code{int} num, @code{float} zVal) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -1702,12 +2071,12 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection Grid @cindex Grid -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Grid (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Grid (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_grid_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) Рисует плоскую сету для параметрически заданной поверхности @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} при @var{z} = @var{zVal}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Младшие размерности массивов @var{x}, @var{y}, @var{z} должны быть одинаковы @code{x.nx=z.nx && y.nx=z.ny} или @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{z}). График строится для каждого z среза данных. См. также @ref{Dens}, @ref{Cont}, @ref{ContF}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Grid (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Grid (@code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_grid (@code{HMGL} gr, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -1720,13 +2089,13 @@ Setsize: размер(ы) равны нулю или отрицательны Эти функции строят графики для трехмерных (3D) массивов. Трехмерными считаются массивы, зависящие от трех параметров (индексов) подобно матрице @math{f(x_i,y_j,z_k), i=1...n, j=1...m, k=1...l}. Есть 5 основных типов 3D графиков: поверхность постоянного уровня (Surf3), график плотности на срезе (Dens3), линии уровня на срезе (Cont3), закрашенные контуры уровня на срезе (ContF3) и график объемной прозрачности типа облака (Cloud). В функциях Cont3(), ContF3() и Surf3() значения уровней можно задавать автоматически и вручную. Можно также нарисовать на срезе сетку (Grid3) по массиву данных для улучшения вида графика плотности или линий уровня. Каждый тип графика имеет похожий интерфейс. Есть версия для рисования одного массива с автоматическими координатами и версия для параметрически заданного массива. Параметры цветовой схемы задаются строкой @xref{Color scheme}. @sref{3D plot sample} @menu -* Surf3:: -* Dens3:: -* Cont3:: -* ContF3:: -* Grid3:: -* Cloud:: -* Beam:: +* Surf3:: +* Dens3:: +* Cont3:: +* ContF3:: +* Grid3:: +* Cloud:: +* Beam:: @end menu @c ================================================================== @@ -1734,22 +2103,22 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection Surf3 @cindex Surf3 -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Surf3 (@code{float} val, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Surf3 (@code{float} val, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}) @deftypefnx {Функция С} @code{void} mgl_surf3_xyz_val (@code{HMGL} gr, @code{float} val, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl) Рисует поверхность уровня для 3d массива, заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) при @var{a}(x,y,z)=@var{val}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Если @var{sch} содержит @samp{#}, то рисуется сетчатая поверхность. Массивы @var{x}, @var{y}, @var{z} могут быть векторами (не 3d массивами как @var{a}). Замечу, что возможно некорректная отрисовка граней вследствие неопределенности построения сечения если поверхность пересекает ячейку данных 2 и более раз. См. также @ref{Cloud}, @ref{Dens3}, @ref{Surf3C}, @ref{Surf3A}, @ref{Axial}. @sref{Surf3 sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Surf3 (@code{float} val, @code{const mglData &}a, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Surf3 (@code{float} val, @code{const mglData &}a, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_surf3_val (@code{HMGL} gr, @code{float} val, @code{const HMDT} a, @code{const char *}sch) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Surf3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{int} num=@code{3}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Surf3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{int} num=@code{3}) @deftypefnx {Функция С} @code{void} mgl_surf3_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl, @code{int} num) Рисует @var{num} поверхностей уровня равномерно распределенных в интервале [@var{Cmin}, @var{Cmax}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Surf3 (@code{const mglData &}a, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Surf3 (@code{const mglData &}a, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) @deftypefnx {Функция С} @code{void} mgl_surf3 (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}sch, @code{int} num) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -1760,22 +2129,22 @@ Setsize: размер(ы) равны нулю или отрицательны @cindex Dens3 @cindex DensA -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Dens3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Dens3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}) @deftypefnx {Функция С} @code{void} mgl_dens3_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}stl) Рисует график плотности для 3d массива, заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). График рисуется на срезе @var{sVal} в направлении @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Если @var{stl} содержит @samp{#}, то на срезе рисуется сетка. Младшие размерности массивов @var{x}, @var{y}, @var{z} должны быть одинаковы. Массивы @var{x}, @var{y}, @var{z} могут быть векторами (не 3d массивами как @var{a}). См. также @ref{Cont3}, @ref{ContF3}, @ref{Dens}, @ref{Grid3}. @sref{Dens3 sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Dens3 (@code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Dens3 (@code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_dens3 (@code{HMGL} gr, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}sch) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} DensA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} DensA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}) @deftypefnx {Функция С} @code{void} mgl_dens3_all_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl) Рисует графики плотности на всех центральных срезах 3d данных, заданных параметрически. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} DensA (@code{const mglData &}a, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} DensA (@code{const mglData &}a, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_dens3_all (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}sch) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -1786,32 +2155,32 @@ Setsize: размер(ы) равны нулю или отрицательны @cindex Cont3 @cindex ContA -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Cont3 (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Cont3 (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}) @deftypefnx {Функция С} @code{void} mgl_cont3_xyz_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}stl) Рисует линии уровня для 3d массива, заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Линии рисуются для значений из массива @var{v} на срезе @var{sVal} в направлении @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@}. Строка @var{stl} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Если @var{stl} содержит @samp{#}, то на срезе рисуется сетка. Если @var{sch} содержит @samp{t} или @samp{T}, то значения @var{v}[k] будут выведены вдоль контуров над (или под) кривой. Младшие размерности массивов @var{x}, @var{y}, @var{z} должны быть одинаковы. Массивы @var{x}, @var{y}, @var{z} могут быть векторами (не 3d массивами как @var{a}). См. также @ref{Dens3}, @ref{ContF3}, @ref{Cont}, @ref{Grid3}. @sref{Cont3 sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Cont3 (@code{const mglData &}v, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Cont3 (@code{const mglData &}v, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_cont3_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}sch) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Cont3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}, @code{int} num=@code{7}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Cont3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}, @code{int} num=@code{7}) @deftypefnx {Функция С} @code{void} mgl_cont3_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}stl, @code{int} num) Как предыдущий с вектором @var{v} из @var{num} элементов равно распределенных в интервале [@var{Cmin}, @var{Cmax}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Cont3 (@code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{int} num=@code{7}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Cont3 (@code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{int} num=@code{7}) @deftypefnx {Функция С} @code{void} mgl_cont3 (@code{HMGL} gr, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}sch, @code{int} num) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{int} num=@code{7}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{int} num=@code{7}) @deftypefnx {Функция С} @code{void} mgl_cont3_all_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl, @code{int} num) Рисует линии уровня на всех центральных срезах 3d данных, заданных параметрически. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContA (@code{const mglData &}a, @code{const char *}sch=@code{""}, @code{int} num=@code{7}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContA (@code{const mglData &}a, @code{const char *}sch=@code{""}, @code{int} num=@code{7}) @deftypefnx {Функция С} @code{void} mgl_cont3_all (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}sch, @code{int} num) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -1822,32 +2191,32 @@ Setsize: размер(ы) равны нулю или отрицательны @cindex ContF3 @cindex ContFA -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContF3 (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContF3 (@code{const mglData &}v, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}) @deftypefnx {Функция С} @code{void} mgl_contf3_xyz_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}stl) Рисует закрашенные линии (контуры) уровня для 3d массива, заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Линии рисуются для значений из массива @var{v} на срезе @var{sVal} в направлении @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Если @var{stl} содержит @samp{#}, то на срезе рисуется сетка. Младшие размерности массивов @var{x}, @var{y}, @var{z} должны быть одинаковы. Массивы @var{x}, @var{y}, @var{z} могут быть векторами (не 3d массивами как @var{a}). См. также @ref{Dens3}, @ref{Cont3}, @ref{ContF}, @ref{Grid3}. @sref{ContF3 sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContF3 (@code{const mglData &}v, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContF3 (@code{const mglData &}v, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_contf3_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}sch) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContF3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}, @code{int} num=@code{7}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContF3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}, @code{int} num=@code{7}) @deftypefnx {Функция С} @code{void} mgl_contf3_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}stl, @code{int} num) Как предыдущий с вектором @var{v} из @var{num} элементов равно распределенных в интервале [@var{Cmin}, @var{Cmax}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContF3 (@code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{int} num=@code{7}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContF3 (@code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}, @code{int} num=@code{7}) @deftypefnx {Функция С} @code{void} mgl_contf3 (@code{HMGL} gr, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}sch, @code{int} num) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContFA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{int} num=@code{7}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContFA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{int} num=@code{7}) @deftypefnx {Функция С} @code{void} mgl_contf3_all_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl, @code{int} num) Рисует закрашенные линии (контуры) уровня на всех центральных срезах 3d данных, заданных параметрически. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContFA (@code{const mglData &}a, @code{const char *}sch=@code{""}, @code{int} num=@code{7}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContFA (@code{const mglData &}a, @code{const char *}sch=@code{""}, @code{int} num=@code{7}) @deftypefnx {Функция С} @code{void} mgl_contf3_all (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}sch, @code{int} num) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -1858,22 +2227,22 @@ Setsize: размер(ы) равны нулю или отрицательны @cindex Grid3 @cindex GridA -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Grid3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Grid3 (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}stl=@code{""}) @deftypefnx {Функция С} @code{void} mgl_grid3_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}stl) Рисует сетку для 3d массива, заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). График рисуется на срезе @var{sVal} в направлении @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Младшие размерности массивов @var{x}, @var{y}, @var{z} должны быть одинаковы. Массивы @var{x}, @var{y}, @var{z} могут быть векторами (не 3d массивами как @var{a}). См. также @ref{Cont3}, @ref{ContF3}, @ref{Dens3}, @ref{Grid}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Grid3 (@code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Grid3 (@code{const mglData &}a, @code{char} dir, @code{int} sVal=@code{-1}, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_grid3 (@code{HMGL} gr, @code{const HMDT} a, @code{char} dir, @code{int} sVal, @code{const char *}sch) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} GridA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} GridA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}) @deftypefnx {Функция С} @code{void} mgl_grid3_all_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl) Рисует сетку на всех центральных срезах 3d данных, заданных параметрически. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} GridA (@code{const mglData &}a, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} GridA (@code{const mglData &}a, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_grid3_all (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}sch) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -1881,41 +2250,29 @@ Setsize: размер(ы) равны нулю или отрицательны @c ================================================================== @node Cloud, Beam, Grid3, 3D plotting @subsection Cloud -@cindex CloudP -@cindex CloudQ +@cindex Cloud -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Cloud (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} alpha=@code{1}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Cloud (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} alpha=@code{1}) @deftypefnx {Функция С} @code{void} mgl_cloud_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl, @code{float} alpha=@code{1}) -Рисует облачный график для 3d массива, заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). График состоит из кубиков с цветом и прозрачностью пропорциональной значениям @var{a}. Результат похож на облако -- малые значения прозрачны, а большие нет. Число кубиков зависит от SetMeshNum() (@pxref{Other settings}). Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Параметр @var{alpha} меняет общую прозрачность графика. Младшие размерности массивов @var{x}, @var{y}, @var{z} должны быть одинаковы. Массивы @var{x}, @var{y}, @var{z} могут быть векторами (не 3d массивами как @var{a}). См. также @ref{Surf3}. @sref{Cloud sample} +Рисует облачный график для 3d массива, заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). График состоит из кубиков с цветом и прозрачностью пропорциональной значениям @var{a}. Результат похож на облако -- малые значения прозрачны, а большие нет. Число кубиков зависит от @ref{MeshNum}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Параметр @var{alpha} меняет общую прозрачность графика. Младшие размерности массивов @var{x}, @var{y}, @var{z} должны быть одинаковы. Массивы @var{x}, @var{y}, @var{z} могут быть векторами (не 3d массивами как @var{a}). См. также @ref{Surf3}. @sref{Cloud sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Cloud (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} alpha=@code{1}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Cloud (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} alpha=@code{1}) @deftypefnx {Функция С} @code{void} mgl_cloud (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} alpha=@code{1}) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} CloudP (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} alpha=@code{1}) -@deftypefnx {Функция С} @code{void} mgl_cloudp_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}stl, @code{float} alpha=@code{1}) -Как первый, но используются полупрозрачные точки вместо кубиков. @sref{CloudP sample} -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} CloudP (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} alpha=@code{1}) -@deftypefnx {Функция С} @code{void} mgl_cloudp (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} alpha=@code{1}) -Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. -@end deftypefn - - @c ================================================================== @node Beam, , Cloud, 3D plotting @subsection Beam @cindex Beam -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Beam (@code{float} val, @code{const mglData &}tr, @code{const mglData &}g1, @code{const mglData &}g2, @code{const mglData &}a, @code{float} r, @code{const char *}stl=@code{""}, @code{int} flag=@code{0}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Beam (@code{float} val, @code{const mglData &}tr, @code{const mglData &}g1, @code{const mglData &}g2, @code{const mglData &}a, @code{float} r, @code{const char *}stl=@code{""}, @code{int} flag=@code{0}) @deftypefnx {Функция С} @code{void} mgl_beam_val (@code{HMGL} gr, @code{float} val, @code{const HMDT} tr, @code{const HMDT} g1, @code{const HMDT} g2, @code{const HMDT} a, @code{float} r, @code{const char *}stl, @code{int} flag) Рисует поверхность уровня для 3d массива @var{a} при постоянном значении @var{a}=@var{val}. Это специальный тип графика для @var{a} заданного в сопровождающей системе координат вдоль кривой @var{tr} с ортами @var{g1}, @var{g2} и с поперечным размером @var{r}. Переменная @var{flag} -- битовый флаг: @samp{0x1} - рисовать в сопровождающих (не лабораторных) координатах; @samp{0x2} - рисовать проекцию на плоскость @math{\rho-z}; @samp{0x4} - рисовать нормированное в каждом сечении поле. Размеры массивов по 1-му индексу @var{tr}, @var{g1}, @var{g2} должны быть nx>2. Размеры массивов по 2-му индексу @var{tr}, @var{g1}, @var{g2} и размер по 3-му индексу массива @var{a} должны быть одинаковы. См. также @ref{Surf3}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Beam (@code{const mglData &}tr, @code{const mglData &}g1, @code{const mglData &}g2, @code{const mglData &}a, @code{float} r, @code{const char *}stl=@code{""}, @code{int} flag=@code{0}, @code{int} num=@code{3}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Beam (@code{const mglData &}tr, @code{const mglData &}g1, @code{const mglData &}g2, @code{const mglData &}a, @code{float} r, @code{const char *}stl=@code{""}, @code{int} flag=@code{0}, @code{int} num=@code{3}) @deftypefnx {Функция С} @code{void} mgl_beam (@code{HMGL} gr, @code{const HMDT} tr, @code{const HMDT} g1, @code{const HMDT} g2, @code{const HMDT} a, @code{float} r, @code{const char *}stl, @code{int} flag=@code{0}, @code{int} num=@code{3}) Рисует @var{num} равномерно распределенных в интервале [@var{Cmin}, @var{Cmax}] поверхностей уровня 3d массива в сопровождающей системе координат. @end deftypefn @@ -1929,13 +2286,13 @@ Setsize: размер(ы) равны нулю или отрицательны Эти функции строят графики для двух связанных массивов. Есть несколько основных типов 3D графиков: поверхность и поверхность уровня с окраской по второму массиву (SurfC, Surf3C), поверхность и поверхность уровня с прозрачностью по второму массиву (SurfA, Surf3A), плитки переменного размера (TileS), диаграмма точечного отображения (Map), STFA диаграмма (STFA). В функциях Surf3A() и Surf3C() значения уровней можно задавать автоматически и вручную. Каждый тип графика имеет похожий интерфейс. Есть версия для рисования одного массива с автоматическими координатами и версия для параметрически заданного массива. Параметры цветовой схемы задаются строкой @xref{Color scheme}. @menu -* SurfC:: -* Surf3C:: -* SurfA:: -* Surf3A:: -* TileS:: -* Map:: -* STFA:: +* SurfC:: +* Surf3C:: +* SurfA:: +* Surf3A:: +* TileS:: +* Map:: +* STFA:: @end menu @c ================================================================== @@ -1943,12 +2300,12 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection SurfC @cindex SurfC -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SurfC (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} SurfC (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_surfc_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch) Рисует параметрически заданную поверхность @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} с цветом, заданным массивом @var{c}[i,j]. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Если @var{sch} содержит @samp{#}, то на поверхности рисуется сетка. Все размеры массивов @var{z} и @var{c} должны быть одинаковы. Младшие размерности массивов @var{x}, @var{y}, @var{z} должны быть одинаковы @code{x.nx=z.nx && y.nx=z.ny} или @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{z}). График строится для каждого z среза данных. См. также @ref{Surf}, @ref{SurfA}, @ref{Surf3C}. @sref{SurfC sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SurfC (@code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} SurfC (@code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_surfc (@code{HMGL} gr, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -1959,22 +2316,22 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection Surf3C @cindex Surf3C -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Surf3C (@code{float} val, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}stl=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Surf3C (@code{float} val, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}stl=@code{""}) @deftypefnx {Функция С} @code{void} mgl_surf3c_xyz_val (@code{HMGL} gr, @code{float} val, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}stl) Рисует поверхность уровня для 3d массива, заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) при @var{a}(x,y,z)=@var{val}. Аналогично Surf3(), но цвет задается массивом @var{c}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Если @var{sch} содержит @samp{#}, то рисуется сетчатая поверхность. Все размеры массивов @var{z} и @var{c} должны быть одинаковы. Массивы @var{x}, @var{y}, @var{z} могут быть векторами (не 3d массивами как @var{a}). Замечу, что возможно некорректная отрисовка граней вследствие неопределенности построения сечения если поверхность пересекает ячейку данных 2 и более раз. См. также @ref{Surf3}, @ref{SurfC}, @ref{Surf3A}. @sref{Surf3C sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Surf3C (@code{float} val, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Surf3C (@code{float} val, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_surf3c_val (@code{HMGL} gr, @code{float} val, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}sch) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Surf3C (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}stl=@code{""}, @code{int} num=@code{3}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Surf3C (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}stl=@code{""}, @code{int} num=@code{3}) @deftypefnx {Функция С} @code{void} mgl_surf3c_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}stl, @code{int} num) Рисует @var{num} поверхностей уровня равномерно распределенных в интервале [@var{Cmin}, @var{Cmax}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Surf3C (@code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Surf3C (@code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) @deftypefnx {Функция С} @code{void} mgl_surf3c (@code{HMGL} gr, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}sch, @code{int} num) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -1985,12 +2342,12 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection SurfA @cindex SurfA -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SurfA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} SurfA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_surfa_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch) Рисует параметрически заданную поверхность @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} с прозрачностью, заданным массивом @var{c}[i,j]. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Если @var{sch} содержит @samp{#}, то на поверхности рисуется сетка. Все размеры массивов @var{z} и @var{c} должны быть одинаковы. Младшие размерности массивов @var{x}, @var{y}, @var{z} должны быть одинаковы @code{x.nx=z.nx && y.nx=z.ny} или @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{z}). График строится для каждого z среза данных. См. также @ref{Surf}, @ref{SurfC}, @ref{Surf3A}, @ref{TileS}. @sref{SurfA sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SurfA (@code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} SurfA (@code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_surfa (@code{HMGL} gr, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -2001,22 +2358,22 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection Surf3A @cindex Surf3A -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Surf3A (@code{float} val, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}stl=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Surf3A (@code{float} val, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}stl=@code{""}) @deftypefnx {Функция С} @code{void} mgl_surf3a_xyz_val (@code{HMGL} gr, @code{float} val, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}stl) Рисует поверхность уровня для 3d массива, заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) при @var{a}(x,y,z)=@var{val}. Аналогично Surf3(), но прозрачность задается массивом @var{c}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Если @var{sch} содержит @samp{#}, то рисуется сетчатая поверхность. Все размеры массивов @var{z} и @var{c} должны быть одинаковы. Массивы @var{x}, @var{y}, @var{z} могут быть векторами (не 3d массивами как @var{a}). Замечу, что возможно некорректная отрисовка граней вследствие неопределенности построения сечения если поверхность пересекает ячейку данных 2 и более раз. См. также @ref{Surf3}, @ref{SurfA}, @ref{Surf3C}. @sref{Surf3A sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Surf3A (@code{float} val, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Surf3A (@code{float} val, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_surf3a_val (@code{HMGL} gr, @code{float} val, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}sch) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Surf3A (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}stl=@code{""}, @code{int} num=@code{3}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Surf3A (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}c, @code{const char *}stl=@code{""}, @code{int} num=@code{3}) @deftypefnx {Функция С} @code{void} mgl_surf3a_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}stl, @code{int} num) Рисует @var{num} поверхностей уровня равномерно распределенных в интервале [@var{Cmin}, @var{Cmax}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Surf3A (@code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Surf3A (@code{const mglData &}a, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{int} num=@code{3}) @deftypefnx {Функция С} @code{void} mgl_surf3a (@code{HMGL} gr, @code{const HMDT} a, @code{const HMDT} c, @code{const char *}sch, @code{int} num) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -2026,12 +2383,12 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection TileS @cindex TileS -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} TileS (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}r, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} TileS (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}r, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_tiles_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} r, @code{const char *}sch) Рисует плитки для параметрически заданной поверхности @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@}. Аналогично Tile(), но размер плиток задается массивов @var{r}. Это создает эффект "прозрачности" при экспорте в файлы EPS. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Младшие размерности массивов @var{x}, @var{y}, @var{z} должны быть одинаковы @code{x.nx=z.nx && y.nx=z.ny} или @code{x.nx=y.nx=z.nx && x.ny=y.ny=z.ny}. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{z}). График строится для каждого z среза данных. См. также @ref{SurfA}, @ref{Tile}. @sref{TileS sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} TileS (@code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} TileS (@code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_tiles (@code{HMGL} gr, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -2041,12 +2398,12 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection Map @cindex Map -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Map (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{int} ks=@code{0}, @code{bool} pnts=@code{true}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Map (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{int} ks=@code{0}, @code{bool} pnts=@code{true}) @deftypefnx {Функция С} @code{void} mgl_map_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{int} ks, @code{int} pnts) Визуализирует точечное отображение для матриц @{@var{ax}, @var{ay} @} параметрически зависящих от координат @var{x}, @var{y}. Исходное положение ячейки задает ее цвет. Высота пропорциональна якобиану J(ax,ay). График является аналогом диаграммы Арнольда. Если @code{pnts=false}, то рисуются грани, иначе цветные точки рисуются в узлах матриц (полезно для "запутанного" отображения). Параметр @var{ks} задает используемый срез матриц. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Все размеры массивов @var{ax} и @var{ay} должны быть одинаковы. Младшие размерности массивов @var{x}, @var{y}, @var{ax} должны быть одинаковы. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{ax}). @xref{Color scheme}. @sref{Map sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Map (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{int} ks=@code{0}, @code{bool} pnts=@code{true}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Map (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{int} ks=@code{0}, @code{bool} pnts=@code{true}) @deftypefnx {Функция С} @code{void} mgl_map (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{int} ks, @code{int} pnts) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -2056,12 +2413,12 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection STFA @cindex STFA -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} STFA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}re, @code{const mglData &}im, @code{int} dn, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} STFA (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}re, @code{const mglData &}im, @code{int} dn, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_stfa_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} re, @code{const HMDT} im, @code{int} dn, @code{const char *}sch, @code{float} zVal) Рисует спектрограмму комплексного массива @var{re}+i*@code{im} для Фурье размером @var{dn} точек в плоскости @var{z=zVal}. Параметр @var{dn} -- любое четное число. Например в 1D случае, результатом будет график плотности от массива @math{res[i,j]=|\sum_d^dn exp(I*j*d)*(re[i*dn+d]+I*im[i*dn+d])|/dn} размером @{int(nx/dn), dn, ny@}. Массивы @var{re}, @var{im} параметрически зависят от координат @var{x}, @var{y}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Все размеры массивов @var{re} и @var{im} должны быть одинаковы. Младшие размерности массивов @var{x}, @var{y}, @var{re} должны быть одинаковы. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{re}). @sref{STFA sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} STFA (@code{const mglData &}re, @code{const mglData &}im, @code{int} dn, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} STFA (@code{const mglData &}re, @code{const mglData &}im, @code{int} dn, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_stfa (@code{HMGL} gr, @code{const HMDT} re, @code{const HMDT} im, @code{int} dn, @code{const char *}sch, @code{float} zVal) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -2074,12 +2431,12 @@ Setsize: размер(ы) равны нулю или отрицательны Эти функции рисуют графики для 2D и 3D векторных полей. Есть несколько типов графиков: просто векторное поле (Vect), вектора вдоль траектории (Traj), векторное поле каплями (Dew), нити тока (Flow, FlowP), трубки тока (Pipe). Каждый тип графика имеет похожий интерфейс. Есть версия для рисования одного массива с автоматическими координатами и версия для параметрически заданного массива. Параметры цветовой схемы задаются строкой @xref{Color scheme}. @menu -* Traj:: -* Vect:: -* Dew:: -* Flow:: -* FlowP:: -* Pipe:: +* Traj:: +* Vect:: +* Dew:: +* Flow:: +* FlowP:: +* Pipe:: @end menu @c ================================================================== @@ -2087,8 +2444,8 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection Traj @cindex Traj -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Traj (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{float} len=@code{0}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} Traj (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}, @code{float} len=@code{0}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Traj (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{float} len=@code{0}) +@deftypefnx {Метод класса @code{mglGraph}} @code{void} Traj (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}, @code{float} len=@code{0}) @deftypefnx {Функция С} @code{void} mgl_traj_xyz (@code{HMGL} gr, @code{const HMDT}x, @code{const HMDT}y, @code{const HMDT}z, @code{const HMDT}ax, @code{const HMDT}ay, @code{const HMDT}az, @code{const char *}sch, @code{float} len) @deftypefnx {Функция С} @code{void} mgl_traj_xy (@code{HMGL} gr, @code{const HMDT}x, @code{const HMDT}y, @code{const HMDT}ax, @code{const HMDT}ay, @code{const char *}sch, @code{float} zVal, @code{float} len) Рисует вектора @{@var{ax}, @var{ay}, @var{az}@} вдоль кривой @{@var{x}, @var{y}, @var{z}@}. Длина векторов пропорциональна @math{\sqrt@{ax^2+ay^2+az^2@}}. Строка @var{pen} задает цвет (@pxref{Line styles}). По умолчанию (@code{pen=""}) используется текущий цвет из палитры (@pxref{Palette and colors}). Параметр @var{len} задает фактор длины векторов (если не нуль) или выбирать длину пропорционально расстоянию между точками кривой (если @var{len}=0). Размер по 1-му индексу должен быть 2 или больше. График рисуется для каждой строки если один из массивов матрица. См. также @ref{Vect}. @sref{Traj sample} @@ -2099,22 +2456,22 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection Vect @cindex Vect -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Vect (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}, @code{int} flag=@code{0}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Vect (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}, @code{int} flag=@code{0}) @deftypefnx {Функция С} @code{void} mgl_vect_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} zVal, @code{int} flag) -Рисует векторное поле @{@var{ax}, @var{ay}@} параметрически зависящее от координат @var{x}, @var{y} на плоскости при @var{z}=@var{zVal}. Длина и цвет векторов пропорциональна @math{\sqrt@{ax^2+ay^2@}}. Число рисуемых векторов зависит от @code{SetMeshNum()} (@pxref{Other settings}). Цвет задается строкой @var{sch}. Предыдущая цветовая схема используется по умолчанию. Параметр @var{flag} побитовый флаг для настройки вид векторов: @code{MGL_VEC_COL} -- двуцветный вектор, @code{MGL_VEC_LEN} -- одинаковая длина векторов, @code{MGL_VEC_DOT} -- рисует штрихи вместо стрелок, @code{MGL_VEC_END} -- рисует стрелку в точку сетки, @code{MGL_VEC_MID} -- рисует стрелку с серединой в точке сетки. Все размеры массивов @var{ax} и @var{ay} должны быть одинаковы. Младшие размерности массивов @var{x}, @var{y} и @var{ax} должны быть одинаковы. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{ax}). График строится для каждого z среза @var{ax}, @var{ay}. См. также @ref{Flow}, @ref{Dew}. @sref{Vect sample} +Рисует векторное поле @{@var{ax}, @var{ay}@} параметрически зависящее от координат @var{x}, @var{y} на плоскости при @var{z}=@var{zVal}. Длина и цвет векторов пропорциональна @math{\sqrt@{ax^2+ay^2@}}. Число рисуемых векторов зависит от @ref{MeshNum}. Цвет задается строкой @var{sch}. Предыдущая цветовая схема используется по умолчанию. Параметр @var{flag} побитовый флаг для настройки вид векторов: @code{MGL_VEC_COL} -- двуцветный вектор, @code{MGL_VEC_LEN} -- одинаковая длина векторов, @code{MGL_VEC_DOT} -- рисует штрихи вместо стрелок, @code{MGL_VEC_END} -- рисует стрелку в точку сетки, @code{MGL_VEC_MID} -- рисует стрелку с серединой в точке сетки. Все размеры массивов @var{ax} и @var{ay} должны быть одинаковы. Младшие размерности массивов @var{x}, @var{y} и @var{ax} должны быть одинаковы. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{ax}). График строится для каждого z среза @var{ax}, @var{ay}. См. также @ref{Flow}, @ref{Dew}. @sref{Vect sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Vect (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}, @code{int} flag=@code{0}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Vect (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}, @code{int} flag=@code{0}) @deftypefnx {Функция С} @code{void} mgl_vect_2d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} zVal, @code{int} flag) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Vect (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{int} flag=@code{0}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Vect (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{int} flag=@code{0}) @deftypefnx {Функция С} @code{void} mgl_vect_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch, @code{int} flag) Это 3D версия графика. Здесь массивы @var{ax}, @var{ay}, @var{az} должны быть 3d массивами, а длина и цвет пропорциональны @math{\sqrt@{ax^2+ay^2+az^2@}}. @sref{Vect 3D sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Vect (@code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{int} flag=@code{0}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Vect (@code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{int} flag=@code{0}) @deftypefnx {Функция С} @code{void} mgl_vect_3d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch, @code{int} flag) Как предыдущий с @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -2124,12 +2481,12 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection Dew @cindex Dew -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Dew (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Dew (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_dew_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} zVal) -Рисует капли для векторного поля @{@var{ax}, @var{ay}@}, параметрически зависящего от координат @var{x}, @var{y} при @var{z=zVal}. Замечу, что график требует много памяти и процессорного времени для своего создания! Цвет капель пропорционален @math{\sqrt@{ax^2+ay^2@}}. Число капель определяется @code{SetMeshNum()} (@pxref{Other settings}). Цвет задается строкой @var{sch}. Предыдущая цветовая схема используется по умолчанию. Все размеры массивов @var{ax} и @var{ay} должны быть одинаковы. Младшие размерности массивов @var{x}, @var{y} и @var{ax} должны быть одинаковы. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{ax}). График строится для каждого z среза @var{ax}, @var{ay}. См. также @ref{Vect}. @sref{Dew sample} +Рисует капли для векторного поля @{@var{ax}, @var{ay}@}, параметрически зависящего от координат @var{x}, @var{y} при @var{z=zVal}. Замечу, что график требует много памяти и процессорного времени для своего создания! Цвет капель пропорционален @math{\sqrt@{ax^2+ay^2@}}. Число капель определяется @ref{MeshNum}. Цвет задается строкой @var{sch}. Предыдущая цветовая схема используется по умолчанию. Все размеры массивов @var{ax} и @var{ay} должны быть одинаковы. Младшие размерности массивов @var{x}, @var{y} и @var{ax} должны быть одинаковы. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{ax}). График строится для каждого z среза @var{ax}, @var{ay}. См. также @ref{Vect}. @sref{Dew sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Dew (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Dew (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_dew (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} zVal) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -2139,22 +2496,22 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection Flow @cindex Flow -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Flow (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{int} num=@code{5}, @code{bool} central=@code{true}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Flow (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{int} num=@code{5}, @code{bool} central=@code{true}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_flow_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{int} num, @code{int} central, @code{float} zVal) Рисует нити тока для векторного поля @{@var{ax}, @var{ay}@}, параметрически зависящего от координат @var{x}, @var{y} на плоскости при z = @var{zVal}. Число нитей пропорционально @var{num}. Параметр @var{central} задает возможность старта нитей изнутри сетки (если true) или только с краев (если false). С версии 1.11 он игнорируется и всегда равен (@var{num}>0). Цвет нитей пропорционален @math{\sqrt@{ax^2+ay^2@}}. Теплые цвета соответствуют нормальному току (типа стока). Холодные цвета соответствуют обратному току (типа источника). Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Все размеры массивов @var{ax} и @var{ay} должны быть одинаковы. Младшие размерности массивов @var{x}, @var{y} и @var{ax} должны быть одинаковы. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{ax}). График строится для каждого z среза @var{ax}, @var{ay}. См. также @ref{Pipe}, @ref{Vect}. @sref{Flow sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Flow (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{int} num=@code{5}, @code{bool} central=@code{true}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Flow (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{int} num=@code{5}, @code{bool} central=@code{true}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_flow_2d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{int} num, @code{int} central, @code{float} zVal) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Flow (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{int} num=@code{3}, @code{bool} central=@code{true}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Flow (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{int} num=@code{3}, @code{bool} central=@code{true}) @deftypefnx {Функция С} @code{void} mgl_flow_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch, @code{int} num, @code{int} central) Это 3D версия графика. Здесь массивы @var{ax}, @var{ay}, @var{az} должны быть 3d массивами, а цвет пропорционален @math{\sqrt@{ax^2+ay^2+az^2@}}. @sref{Flow 3D sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Flow (@code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{int} num=@code{3}, @code{bool} central=@code{true}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Flow (@code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{int} num=@code{3}, @code{bool} central=@code{true}) @deftypefnx {Функция С} @code{void} mgl_flow_3d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch, @code{int} num, @code{int} central) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -2164,25 +2521,25 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection FlowP @cindex FlowP -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}) @deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} FlowP (@code{float} x0, @code{float} y0, @code{float} z0, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_flowp_xy (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch) Рисует нить тока из точки @var{p0} для векторного поля @{@var{ax}, @var{ay}@}, параметрически зависящего от координат @var{x}, @var{y} на плоскости при z = @var{p0}.z. Цвет нити пропорционален @math{\sqrt@{ax^2+ay^2@}}. Теплые цвета соответствуют нормальному току (типа стока). Холодные цвета соответствуют обратному току (типа источника). Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Все размеры массивов @var{ax} и @var{ay} должны быть одинаковы. Младшие размерности массивов @var{x}, @var{y} и @var{ax} должны быть одинаковы. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{ax}). График строится для каждого z среза @var{ax}, @var{ay}. См. также @ref{Pipe}, @ref{Vect}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}) @deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} FlowP (@code{float} x0, @code{float} y0, @code{float} z0, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_flowp_2d (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}) @deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} FlowP (@code{float} x0, @code{float} y0, @code{float} z0, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_flowp_xyz (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch) Это 3D версия графика. Здесь массивы @var{ax}, @var{ay}, @var{az} должны быть 3d массивами, а цвет пропорциональны @math{\sqrt@{ax^2+ay^2+az^2@}}. @sref{Flow 3D sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} FlowP (@code{mglPoint} p0, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}) @deftypefnx {Метод класса @code{mglGraph} (Python)} @code{void} FlowP (@code{float} x0, @code{float} y0, @code{float} z0, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_flowp_3d (@code{HMGL} gr, @code{float} x0, @code{float} y0, @code{float} z0, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @@ -2194,22 +2551,22 @@ Setsize: размер(ы) равны нулю или отрицательны @subsection Pipe @cindex Pipe -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Pipe (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{int} num=@code{5}, @code{bool} central=@code{true}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Pipe (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{int} num=@code{5}, @code{bool} central=@code{true}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_pipe_xy (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} r0, @code{int} num, @code{int} central, @code{float} zVal) Рисует трубки тока для векторного поля @{@var{ax}, @var{ay}@}, параметрически зависящего от координат @var{x}, @var{y} на плоскости при z = @var{zVal}. Число трубок пропорционально @var{num}. Параметр @var{central} задает возможность старта трубок изнутри сетки (если true) или только с краев (если false). С версии 1.11 он игнорируется и всегда равен (@var{num}>0). Цвет и радиус трубок пропорционален @math{\sqrt@{ax^2+ay^2@}}. Теплые цвета соответствуют нормальному току (типа стока). Холодные цвета соответствуют обратному току (типа источника). Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Параметр @var{r0} задает радиус трубок. При @var{r0}<0 радиус трубок обратно пропорционален их амплитуде. Все размеры массивов @var{ax} и @var{ay} должны быть одинаковы. Младшие размерности массивов @var{x}, @var{y} и @var{ax} должны быть одинаковы. Массивы @var{x} и @var{y} могут быть векторами (не матрицами как @var{ax}). График строится для каждого z среза @var{ax}, @var{ay}. См. также @ref{Flow}, @ref{Vect}. @sref{Pipe sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Pipe (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{int} num=@code{5}, @code{bool} central=@code{true}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Pipe (@code{const mglData &}ax, @code{const mglData &}ay, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{int} num=@code{5}, @code{bool} central=@code{true}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_pipe_2d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const char *}sch, @code{float} r0, @code{int} num, @code{int} central, @code{float} zVal) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Pipe (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{int} num=@code{3}, @code{bool} central=@code{true}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Pipe (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{int} num=@code{3}, @code{bool} central=@code{true}) @deftypefnx {Функция С} @code{void} mgl_pipe_xyz (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch, @code{float} r0, @code{int} num, @code{int} central) Это 3D версия графика. Здесь массивы @var{ax}, @var{ay}, @var{az} должны быть 3d массивами, а цвет пропорциональны @math{\sqrt@{ax^2+ay^2+az^2@}}. @sref{Pipe 3D sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Pipe (@code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{int} num=@code{3}, @code{bool} central=@code{true}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Pipe (@code{const mglData &}ax, @code{const mglData &}ay, @code{const mglData &}az, @code{const char *}sch=@code{""}, @code{float} r0=@code{0.05}, @code{int} num=@code{3}, @code{bool} central=@code{true}) @deftypefnx {Функция С} @code{void} mgl_pipe_3d (@code{HMGL} gr, @code{const HMDT} ax, @code{const HMDT} ay, @code{const HMDT} az, @code{const char *}sch, @code{float} r0, @code{int} num, @code{int} central) Как предыдущий с @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn @@ -2222,16 +2579,16 @@ Setsize: размер(ы) равны нулю или отрицательны Это функции, не относящиеся к какой-то специальной категории. Сюда входят функции построения графиков по текстовым формулам (Plots by formula), рисования поверхностей из треугольников (TriPlot), произвольных точек в пространстве (Dots) и реконструкции по ним поверхности (Crust), графики плотности и линии уровня на плоскостях, перпендикулярных осям x, y или z (Dens[XYZ], Cont[XYZ], ContF[XYZ]), функция "упрощенного" рисования (SimplePlot). Каждый тип графика имеет похожий интерфейс. Есть версия для рисования одного массива с автоматическими координатами и версия для параметрически заданного массива. Параметры цветовой схемы задаются строкой. @xref{Color scheme}. @menu -* DensXYZ:: -* ContXYZ:: -* ContFXYZ:: -* Dots:: -* Crust:: -* TriPlot:: -* TriCont:: -* QuadPlot:: -* Plots by formula:: -* SimplePlot:: +* DensXYZ:: +* ContXYZ:: +* ContFXYZ:: +* Dots:: +* Crust:: +* TriPlot:: +* TriCont:: +* QuadPlot:: +* Plots by formula:: +* SimplePlot:: @end menu @c ================================================================== @@ -2249,17 +2606,17 @@ gr->DensZ(c.Sum("z"),0,-1); @end example создают такую картинку. См. также @ref{ContXYZ}, @ref{ContFXYZ}, @ref{Dens}, @ref{Data distributions}. @sref{Dens projection sample} -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} DensX (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} DensX (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_dens_x (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) Рисует график плотности @var{a} при x = @var{sVal}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} DensY (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} DensY (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_dens_y (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) Рисует график плотности @var{a} при y = @var{sVal}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} DensZ (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} DensZ (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_dens_z (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) Рисует график плотности @var{a} при z = @var{sVal}. @end deftypefn @@ -2279,32 +2636,32 @@ gr->ContZ(c.Sum("z"),0,-1); @end example создают такую картинку. См. также @ref{ContFXYZ}, @ref{DensXYZ}, @ref{Cont}, @ref{Data distributions}. @sref{Cont projection sample} -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContX (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContX (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) @deftypefnx {Функция С} @code{void} mgl_cont_x (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal, @code{int} num) Рисует @var{num} линий уровня для массива @var{a} при x = @var{sVal}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContY (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContY (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) @deftypefnx {Функция С} @code{void} mgl_cont_y (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal, @code{int} num) Рисует @var{num} линий уровня для массива @var{a} при y = @var{sVal}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContZ (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContZ (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) @deftypefnx {Функция С} @code{void} mgl_cont_z (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal, @code{int} num) Рисует @var{num} линий уровня для массива @var{a} при z = @var{sVal}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContX (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContX (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_cont_x_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) Рисует линии уровня для массива @var{a}=@var{v}[i] при x = @var{sVal}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContY (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContY (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_cont_y_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) Рисует линии уровня для массива @var{a}=@var{v}[i] при y = @var{sVal}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContZ (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContZ (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_cont_z_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) Рисует линии уровня для массива @var{a}=@var{v}[i] при z = @var{sVal}. @end deftypefn @@ -2318,32 +2675,32 @@ gr->ContZ(c.Sum("z"),0,-1); Эти функции рисуют закрашенные контуры уровня на x, y или z плоскостях. Если @var{a} -- 3d массив, то выполняется интерполяция к заданному срезу @var{sVal}. Функции полезны для создания проекций 3D массивов на оси координат. См. также @ref{ContXYZ}, @ref{DensXYZ}, @ref{ContF}, @ref{Data distributions}. -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContFX (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContFX (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) @deftypefnx {Функция С} @code{void} mgl_contf_x (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal, @code{int} num) Рисует @var{num} закрашенных контуров уровня для массива @var{a} при x = @var{sVal}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContFY (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContFY (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) @deftypefnx {Функция С} @code{void} mgl_contf_y (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal, @code{int} num) Рисует @var{num} закрашенных контуров уровня для массива @var{a} при y = @var{sVal}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContFZ (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContFZ (@code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}, @code{int} num=@code{7}) @deftypefnx {Функция С} @code{void} mgl_contf_z (@code{HMGL} gr, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal, @code{int} num) Рисует @var{num} закрашенных контуров уровня для массива @var{a} при z = @var{sVal}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContFX (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContFX (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_contf_x_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) Рисует закрашенные конутры уровня для массива @var{a}=@var{v}[i] при x = @var{sVal}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContFY (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContFY (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_contf_y_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) Рисует закрашенные конутры уровня для массива @var{a}=@var{v}[i] при y = @var{sVal}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ContFZ (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} ContFZ (@code{const mglData &}v, @code{const mglData &}a, @code{const char *}stl=@code{""}, @code{float} sVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_contf_z_val (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} a, @code{const char *}stl, @code{float} sVal) Рисует закрашенные конутры уровня для массива @var{a}=@var{v}[i] при z = @var{sVal}. @end deftypefn @@ -2353,14 +2710,14 @@ gr->ContZ(c.Sum("z"),0,-1); @subsection Dots @cindex Dots -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Dots (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} Dots (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Dots (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) +@deftypefnx {Метод класса @code{mglGraph}} @code{void} Dots (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_dots (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch) @deftypefnx {Функция С} @code{void} mgl_dots_a (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}sch) Рисует произвольно расположенные точки @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Если определен массив @var{a}, то он задает прозрачность точек. Массивы @var{x}, @var{y}, @var{z}, @var{a} должны иметь одинаковые размеры. См. также @ref{Crust}, @ref{Mark}, @ref{Plot}. @sref{Dots sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Dots (@code{const mglData &}tr, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Dots (@code{const mglData &}tr, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_dots_tr (@code{HMGL} gr, @code{const HMDT} tr, @code{const char *}sch) Как предыдущий с @var{x=tr}(0,:), @var{y=tr}(1,:), @var{z=tr}(2,:) и если @var{tr}.nx>3, то @var{a=tr}(3,:). @end deftypefn @@ -2370,12 +2727,12 @@ gr->ContZ(c.Sum("z"),0,-1); @subsection Crust @cindex Crust -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Crust (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} er=@code{0}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Crust (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} er=@code{0}) @deftypefnx {Функция С} @code{void} mgl_crust (@code{HMGL} gr, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{float} er) Реконструирует и рисует поверхность по произвольно расположенным точкам @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Параметр @var{er} задает радиус ошибки (увеличте для удаления дыр). Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Если строка содержит @samp{#}, то рисуется сетчатая поверхность. Массивы @var{x}, @var{y}, @var{z} должны иметь одинаковые размеры. См. также @ref{Dots}, @ref{TriPlot}. @sref{Crust sample} @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Crust (@code{const mglData &}tr, @code{const char *}sch=@code{""}, @code{float} er=@code{0}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Crust (@code{const mglData &}tr, @code{const char *}sch=@code{""}, @code{float} er=@code{0}) @deftypefnx {Функция С} @code{void} mgl_crust_tr (@code{HMGL} gr, @code{const HMDT} tr, @code{const char *}sch, @code{float} er) Как предыдущий с @var{x=tr}(0,:), @var{y=tr}(1,:), @var{z=tr}(2,:). @end deftypefn @@ -2385,14 +2742,14 @@ gr->ContZ(c.Sum("z"),0,-1); @subsection TriPlot @cindex TriPlot -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} TriPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{void} TriPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} TriPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) +@deftypefnx {Метод класса @code{mglGraph}} @code{void} TriPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) @deftypefnx {Функция С} @code{void} mgl_triplot_xyz (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch) @deftypefnx {Функция С} @code{void} mgl_triplot_xyzc (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch) Рисует поверхность из треугольников. Вершины треугольников задаются индексами @var{id} в массиве точек @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Если строка содержит @samp{#}, то рисуется сетчатая поверхность. Размер по 1-му индексу массива @var{id} должен быть 3 или больше. Массивы @var{x}, @var{y}, @var{z} должны иметь одинаковые размеры. Массив @var{c} задает цвет треугольников (если @var{id}.ny=@var{c}.nx) или цвет вершин (если @var{x}.nx=@var{c}.nx). См. также @ref{Dots}, @ref{Crust}, @ref{QuadPlot}, @ref{TriCont}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} TriPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} TriPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) @deftypefnx {Функция С} @code{void} mgl_triplot_xy (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const char *}sch, @code{float} zVal) Как предыдущий с @var{z}[i]=@var{zVal}. @end deftypefn @@ -2402,15 +2759,15 @@ gr->ContZ(c.Sum("z"),0,-1); @subsection TriCont @cindex TriCont -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} TriContV (@code{const mglData &}v, @code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} TriContV (@code{const mglData &}v, @code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) +@deftypefn {Method on @code{mglGraph}} @code{void} TriContV (@code{const mglData &}v, @code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) +@deftypefnx {Method on @code{mglGraph}} @code{void} TriContV (@code{const mglData &}v, @code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) @deftypefnx {C function} @code{void} mgl_tricont_xyzcv (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch, @code{float} zVal) @deftypefnx {C function} @code{void} mgl_tricont_xyzv (@code{HMGL} gr, @code{const HMDT} v, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{float} zVal) Рисует линии уровня поверхности из треугольников при @var{z} = @var{zVal} (или для @var{z=v}[k] если @code{zVal==NAN}). Вершины треугольников задаются индексами @var{id} в массиве точек @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Размер по 1-му индексу массива @var{id} должен быть 3 или больше. Массивы @var{x}, @var{y}, @var{z} должны иметь одинаковые размеры. Массив @var{c} задает цвет треугольников (если @var{id}.ny=@var{c}.nx) или цвет вершин (если @var{x}.nx=@var{c}.nx). См. также @ref{TriPlot}, @ref{Cont}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} TriCont (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{num}=@code{7}, @code{float} zVal=@code{NAN}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} TriCont (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{num}=@code{7}, @code{float} zVal=@code{NAN}) +@deftypefn {Method on @code{mglGraph}} @code{void} TriCont (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}, @code{num}=@code{7}, @code{float} zVal=@code{NAN}) +@deftypefnx {Method on @code{mglGraph}} @code{void} TriCont (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}, @code{num}=@code{7}, @code{float} zVal=@code{NAN}) @deftypefnx {C function} @code{void} mgl_tricont_xyzc (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch, @code{num}, @code{float} zVal) @deftypefnx {C function} @code{void} mgl_tricont_xyz (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch, @code{num}, @code{float} zVal) Аналогично предыдущему с вектором @var{v} из @var{num} элементов равно распределенных в интервале [@var{Cmin}, @var{Cmax}]. @@ -2421,14 +2778,14 @@ gr->ContZ(c.Sum("z"),0,-1); @subsection QuadPlot @cindex QuadPlot -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} QuadPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) -@deftypefnx {Method on @code{mglGraph} (C++, Python)} @code{void} QuadPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) +@deftypefn {Method on @code{mglGraph}} @code{void} QuadPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}c, @code{const char *}sch=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} QuadPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const char *}sch=@code{""}) @deftypefnx {C function} @code{void} mgl_quadplot_xyz (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const char *}sch) @deftypefnx {C function} @code{void} mgl_quadplot_xyzc (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} c, @code{const char *}sch) Рисует поверхность из четырехугольников. Вершины четырехугольников задаются индексами @var{id} в массиве точек @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Строка @var{sch} задает цветовую схему. Предыдущая цветовая схема используется по умолчанию. Если строка содержит @samp{#}, то рисуется сетчатая поверхность. Размер по 1-му индексу массива @var{id} должен быть 4 или больше. Массивы @var{x}, @var{y}, @var{z} должны иметь одинаковые размеры. Массив @var{c} задает цвет четырехугольников (если @var{id}.ny=@var{c}.nx) или цвет вершин (если @var{x}.nx=@var{c}.nx). См. также @ref{TriPlot}. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} QuadPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) +@deftypefn {Method on @code{mglGraph}} @code{void} QuadPlot (@code{const mglData &}id, @code{const mglData &}x, @code{const mglData &}y, @code{const char *}sch=@code{""}, @code{float} zVal=@code{NAN}) @deftypefnx {C function} @code{void} mgl_quadplot_xy (@code{HMGL} gr, @code{const HMDT} id, @code{const HMDT} x, @code{const HMDT} y, @code{const char *}sch, @code{float} zVal) Как предыдущий с @var{z}[i]=@var{zVal}. @end deftypefn @@ -2441,22 +2798,22 @@ gr->ContZ(c.Sum("z"),0,-1); Эти функции строят графики 1D или 2D функций, заданный текстовыми формулами. Вам не нужно создавать массивы для их построения. Параметр @var{stl} задаект стиль линии (@pxref{Line styles}) для @code{Plot()} или цветовую схему (@pxref{Color scheme}) для @code{Surf()}. Параметр @var{n} задает минимальное число точек по координате(ам) для графика. В настоящее время (v. 1.10) число точек автоматически увеличивается для области резкого изменения функции, но только для 1D графиков (т.е. для Plot()). -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Plot (@code{const char *}eqY, @code{const char *}stl=@code{""}, @code{float} zVal=@code{NAN}, @code{int} n=@code{100}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Plot (@code{const char *}eqY, @code{const char *}stl=@code{""}, @code{float} zVal=@code{NAN}, @code{int} n=@code{100}) @deftypefnx {Функция С} @code{void} mgl_fplot (@code{HMGL} gr, @code{const char *}eqY, @code{const char *}stl, @code{float} zVal, @code{int} n) Рисует функцию @samp{eqY(x)} в плоскости z=@var{zVal} с координатой @samp{x} в диапазоне [@var{Min}.x, @var{Max}.x]. См. также @ref{Plot}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Plot (@code{const char *}eqX, @code{const char *}eqY, @code{const char *}eqZ, @code{const char *}stl=@code{""}, @code{float} zVal=@code{NAN}, @code{int} n=@code{100}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Plot (@code{const char *}eqX, @code{const char *}eqY, @code{const char *}eqZ, @code{const char *}stl=@code{""}, @code{float} zVal=@code{NAN}, @code{int} n=@code{100}) @deftypefnx {Функция С} @code{void} mgl_fplot_xyz (@code{HMGL} gr, @code{const char *}eqX, @code{const char *}eqY, @code{const char *}eqZ, @code{const char *}stl, @code{float} zVal, @code{int} n) Рисует параметрическую кривую @{@samp{eqX(t)}, @samp{eqY(t)}, @samp{eqZ(t)}@}, где координата @samp{t} меняется в диапазоне [0, 1]. См. также @ref{Plot}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Surf (@code{const char *}eqZ, @code{const char *}stl=@code{""}, @code{int} n=@code{100}); +@deftypefn {Метод класса @code{mglGraph}} @code{void} Surf (@code{const char *}eqZ, @code{const char *}stl=@code{""}, @code{int} n=@code{100}); @deftypefnx {Функция С} @code{void} mgl_fsurf (@code{HMGL} gr, @code{const char *}eqZ, @code{const char *}stl, @code{int} n); Рисует поверхность @samp{eqY(x,y)} с координатами @samp{x}, @samp{y} в диапазоне [@var{Min}, @var{Max}]. См. также @ref{Surf}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} Surf (@code{const char *}eqX, @code{const char *}eqY, @code{const char *}eqZ, @code{const char *}stl=@code{""}, @code{int} n=@code{100}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Surf (@code{const char *}eqX, @code{const char *}eqY, @code{const char *}eqZ, @code{const char *}stl=@code{""}, @code{int} n=@code{100}) @deftypefnx {Функция С} @code{void} mgl_fsurf_xyz (@code{HMGL} gr, @code{const char *}eqX, @code{const char *}eqY, @code{const char *}eqZ, @code{const char *}stl, @code{int} n) Рисует параметрическую поверхность @{@samp{eqX(u,v)}, @samp{eqY(u,v)}, @samp{eqZ(u,v)}@}, где координаты @samp{u}, @samp{v} меняются в диапазоне [0, 1]. См. также @ref{Surf}. @end deftypefn @@ -2466,7 +2823,7 @@ gr->ContZ(c.Sum("z"),0,-1); @subsection SimplePlot @cindex SimplePlot -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} SimplePlot (@code{const mglData &}a, @code{int} type=@code{0}, @code{const char *}stl=@code{""}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} SimplePlot (@code{const mglData &}a, @code{int} type=@code{0}, @code{const char *}stl=@code{""}) @deftypefnx {Функция С} @code{void} mgl_simple_plot (@code{HMGL} gr, @code{const HMDT} a, @code{int} type, @code{const char *}stl) Рисует график массива @var{a} в зависимости от его размерности и параметра @var{type}. Строка @var{stl} задает стиль графика. Для 1d массивов: @code{type=0} -- @ref{Plot}, @code{type=1} -- @ref{Area}, @code{type=2} -- @ref{Step}, @code{type=3} -- @ref{Stem}, @code{type=4} -- @ref{Bars}. Для 2d массивов: @code{type=0} -- @ref{Surf}, @code{type=1} -- @ref{Dens}, @code{type=2} -- @ref{Mesh}, @code{type=3} -- @ref{Cont}. Для 3d массивов: @code{type=0} -- @ref{Surf3}, @code{type=1} -- @ref{Dens3}, @code{type=2} -- @ref{Cont3}, @code{type=2} -- @ref{Cloud}. @end deftypefn @@ -2485,82 +2842,82 @@ gr->ContZ(c.Sum("z"),0,-1); Функции Fit() и FitS() не рисуют полученные массивы. Они заполняют массив @var{fit} по формуле @samp{f} с найденными коэффициентами и возвращают @math{\chi^2} ошибку аппроксимации. При этом, координаты @samp{x,y,z} равнораспределены в интервале @var{Min}--@var{Max}. Число точек в @var{fit} выбирается максимальным из размера массива @var{fit} и значения переменной @var{FitPnts}. Функции используют библиотеку GSL. @sref{Fitting sample} -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) +@deftypefn {Метод класса @code{mglGraph}} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) +@deftypefnx {Метод класса @code{mglGraph}} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) @deftypefnx {Функция С} @code{float} mgl_fit_xyzas (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{float *}ini) @deftypefnx {Функция С} @code{float} mgl_fit_xyzas_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) "Подгоняют" формулу вдоль x-, y- и z-направлений для 3d массива заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) +@deftypefn {Метод класса @code{mglGraph}} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) +@deftypefnx {Метод класса @code{mglGraph}} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) @deftypefnx {Функция С} @code{float} mgl_fit_xyzs (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{float *}ini) @deftypefnx {Функция С} @code{float} mgl_fit_xyzs_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) "Подгоняют" формулу вдоль x- и y-направлений для 2d массива заданного параметрически @var{a}[i,j](@var{x}[i,j], @var{y}[i,j]) для каждого среза данных. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) +@deftypefn {Метод класса @code{mglGraph}} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) +@deftypefnx {Метод класса @code{mglGraph}} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) @deftypefnx {Функция С} @code{float} mgl_fit_xys (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{float *}ini) @deftypefnx {Функция С} @code{float} mgl_fit_xys_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) "Подгоняют" формулу вдоль x-направления для 1d массива заданного параметрически @var{a}[i](@var{x}[i]) для каждого среза данных. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) +@deftypefn {Метод класса @code{mglGraph}} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) +@deftypefnx {Метод класса @code{mglGraph}} @code{float} FitS (@code{mglData &}fit, @code{const mglData &}a, @code{const mglData &}s, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) @deftypefnx {Функция С} @code{float} mgl_fit_ys (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{float *}ini) @deftypefnx {Функция С} @code{float} mgl_fit_ys_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const HMDT} s, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) "Подгоняют" формулу вдоль x-направления для 1d массива с @var{x} равно распределенным в интервале [@var{Min}.x, @var{Max}.x]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) +@deftypefn {Метод класса @code{mglGraph}} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) +@deftypefnx {Метод класса @code{mglGraph}} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) @deftypefnx {Функция С} @code{float} mgl_fit_xyza (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{float *}ini) @deftypefnx {Функция С} @code{float} mgl_fit_xyza_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) "Подгоняют" формулу вдоль x-, y- и z-направлений для 3d массива заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]) с @var{s}[i,j,k]=1. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) +@deftypefn {Метод класса @code{mglGraph}} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) +@deftypefnx {Метод класса @code{mglGraph}} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) @deftypefnx {Функция С} @code{float} mgl_fit_xyz (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{float *}ini) @deftypefnx {Функция С} @code{float} mgl_fit_xyz_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) "Подгоняют" формулу вдоль x- и y-направлений для 2d массива заданного параметрически @var{a}[i,j](@var{x}[i,j], @var{y}[i,j]) с @var{s}[i,j]=1 для каждого среза данных. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) +@deftypefn {Метод класса @code{mglGraph}} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) +@deftypefnx {Метод класса @code{mglGraph}} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}x, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) @deftypefnx {Функция С} @code{float} mgl_fit_xy (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{float *}ini) @deftypefnx {Функция С} @code{float} mgl_fit_xy_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} x, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) "Подгоняют" формулу вдоль x-направления для 1d массива заданного параметрически @var{a}[i](@var{x}[i]) с @var{s}[i]=1 для каждого среза данных. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{""}, @code{bool} print=@code{false}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) +@deftypefn {Метод класса @code{mglGraph}} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{""}, @code{bool} print=@code{false}) +@deftypefnx {Метод класса @code{mglGraph}} @code{float} Fit (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) @deftypefnx {Функция С} @code{float} mgl_fit_1 (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{float *}ini) @deftypefnx {Функция С} @code{float} mgl_fit_1_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) "Подгоняют" формулу вдоль x-направления для 1d массива @var{a} с @var{s}=1 и @var{x} равно распределенным в интервале [@var{Min}.x, @var{Max}.x]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{float} Fit2 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{float} Fit2 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) +@deftypefn {Метод класса @code{mglGraph}} @code{float} Fit2 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) +@deftypefnx {Метод класса @code{mglGraph}} @code{float} Fit2 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) @deftypefnx {Функция С} @code{float} mgl_fit_2 (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{float *}ini) @deftypefnx {Функция С} @code{float} mgl_fit_2_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) "Подгоняют" формулу вдоль x- и y-направлений для 2d массива @var{a} с @var{s}=1 и @var{x}, @var{y} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{float} Fit3 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) -@deftypefnx {Метод класса @code{mglGraph} (C++, Python)} @code{float} Fit3 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) +@deftypefn {Метод класса @code{mglGraph}} @code{float} Fit3 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{float *}ini=@code{NULL}, @code{bool} print=@code{false}) +@deftypefnx {Метод класса @code{mglGraph}} @code{float} Fit3 (@code{mglData &}fit, @code{const mglData &}a, @code{const char *}func, @code{const char *}var, @code{mglData &}ini, @code{bool} print=@code{false}) @deftypefnx {Функция С} @code{float} mgl_fit_3 (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{float *}ini) @deftypefnx {Функция С} @code{float} mgl_fit_3_d (@code{HMGL} gr, @code{HMDT} fit, @code{const HMDT} a, @code{const char *}func, @code{const char *}var, @code{HMDT} ini) "Подгоняют" формулу вдоль x-, y- и z-направлений для 3d массива @var{a} с @var{s}=1 и @var{x}, @var{y}, @var{z} равно распределенными в интервале [@var{Min}, @var{Max}]. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} PutsFit (@code{mglPoint} p, @code{const char *}prefix=@code{""}, @code{const char *}font=@code{NULL}, @code{float} size=@code{-1}) +@deftypefn {Метод класса @code{mglGraph}} @code{void} PutsFit (@code{mglPoint} p, @code{const char *}prefix=@code{""}, @code{const char *}font=@code{NULL}, @code{float} size=@code{-1}) @deftypefnx {Функция С} @code{void} mgl_puts_fit (@code{HMGL} gr, @code{float} x, @code{float} y, @code{float} z, @code{const char *}prefix, @code{const char *}font, @code{float} size=@code{-1}) Печатает последнюю подобранную формулу с найденными коэффициентами в точке @var{p0}. Строка @var{prefix} будет напечатана перед формулой. Все другие параметры такие же как в @ref{Text printing}. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{const char *}GetFit () +@deftypefn {Метод класса @code{mglGraph}} @code{const char *}GetFit () @deftypefnx {Функция С} @code{const char *} mgl_get_fit (@code{HMGL} gr) Возвращает последнюю подобранную формулу с найденными коэффициентами. @end deftypefn @@ -2573,71 +2930,30 @@ gr->ContZ(c.Sum("z"),0,-1); @c ################################################################## -@node Data distributions, Frames/Animation, Nonlinear fitting, MathGL core +@node Data distributions, IDTF functions, Nonlinear fitting, MathGL core @section Распределение данных @cindex Hist Эти функции создают распределения данных. Они не выполняют построение сами по себе. Функции могут быть полезны в случае когда данные пользователя определены на случайно расположенных точка (например, после PIC расчетов) и он хочет построить график, требующий регулярных данных (данных на сетках). Диапазон сеток равен диапазону осей координат Min...Max. Массивы @var{x}, @var{y}, @var{z} определяют положение (координаты) точек. Массив @var{a} задает значения данных. Число точек в результате @var{res} -- максимум из размера @var{res} и значения @var{FitPnts}. -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Hist (@code{mglData &}res, @code{const mglData &}x, @code{const mglData &}a) +@deftypefn {Method on @code{mglGraph}} @code{void} Hist (@code{mglData &}res, @code{const mglData &}x, @code{const mglData &}a) @deftypefnx {C function} @code{int} mgl_hist_x (@code{HMGL} gr, @code{HMDT} res, @code{const HMDT} x, @code{const HMDT} a) Создет 1D распределение значений массива @var{a} в диапазоне [Min, Max]. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Hist (@code{mglData &}res, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a) +@deftypefn {Method on @code{mglGraph}} @code{void} Hist (@code{mglData &}res, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}a) @deftypefnx {C function} @code{int} mgl_hist_xy (@code{HMGL} gr, @code{HMDT} res, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} a) Создет 2D распределение значений массива @var{a} в диапазоне [Min, Max]. @end deftypefn -@deftypefn {Method on @code{mglGraph} (C++, Python)} @code{void} Hist (@code{mglData &}res, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a) +@deftypefn {Method on @code{mglGraph}} @code{void} Hist (@code{mglData &}res, @code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z, @code{const mglData &}a) @deftypefnx {C function} @code{int} mgl_hist_xyz (@code{HMGL} gr, @code{HMDT} res, @code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z, @code{const HMDT} a) Создет 3D распределение значений массива @var{a} в диапазоне [Min, Max]. @end deftypefn - - -@c ################################################################## -@node Frames/Animation, IDTF functions, Data distributions, MathGL core -@section Кадры/Анимация -@cindex NewFrame -@cindex EndFrame -@cindex GetNumFrame - -Эти функции позволяют создавать несколько картинок одновременно. В большинстве случаев это бесполезно, но для органов управления (@pxref{Widget classes}) это позволяет показывать анимацию. Также можно записать несколько кадров в анимированный GIF файл. - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{int} NewFrame () -@deftypefnx {Функция С} @code{int} mgl_new_frame (@code{HMGL} gr) -Создает новый кадр. Функция возвращает номер текущего кадра. В режиме OpenGL функция не должны вызываться в параллельных потоках! -- используйте прямое создание списка. Функция @code{EndFrame()} @strong{должна} быть вызвана после рисования кадра для каждого вызова этой функции. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} EndFrame () -@deftypefnx {Функция С} @code{void} mgl_end_frame (@code{HMGL} gr) -Завершает рисование кадра. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{int} GetNumFrame () -@deftypefnx {Функция С} @code{int} mgl_get_num_frame (@code{HMGL} gr) -Возвращает число созданных кадров. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} ResetFrames () -@deftypefnx {Функция С} @code{int} mgl_reset_frames (@code{HMGL} gr) -Сбрасывает счетчик кадров в 0. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{void} StartGIF (@code{const char *}fname, @code{int} ms=@code{100}) -@deftypefnx {Функция С} @code{void} mgl_start_gif (@code{HMGL} gr, @code{const char *}fname, @code{int} ms) -Начинает запись кадров в анимированный GIF файл @var{fname}. Параметр @var{ms} задает задержку между кадрами в миллисекундах. Вы @strong{не должны} менять размер рисунка во время создания кино. Используйте CloseGIF() для завершения записи. Эта функция не работает в режиме OpenGL. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++, Python)} @code{int} CloseGIF () -@deftypefnx {Функция С} @code{void} mgl_close_gif (@code{HMGL} gr) -Завершает запись анимированного GIF файла. -@end deftypefn - @c ################################################################## -@node IDTF functions, , Frames/Animation, MathGL core +@node IDTF functions, , Data distributions, MathGL core @section IDTF функции @cindex NewFrame @cindex EndFrame @@ -2645,19 +2961,10 @@ gr->ContZ(c.Sum("z"),0,-1); Эти функции обеспечивают поддержку особых возможностей при создании IDTF. Во всех прочих случаях они не делают ничего. -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} VertexColor (@code{bool} enable) +@deftypefn {Метод класса @code{mglGraph}} @code{void} VertexColor (@code{bool} enable) Разрешает плавное изменение цвета. @end deftypefn -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} Compression (@code{bool} enable) +@deftypefn {Метод класса @code{mglGraph}} @code{void} Compression (@code{bool} enable) Дает меньший объем файла, но с худшим качеством. @end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} StartGroup (const char *name) -Начинает определение группы. Группа может содержать объекты и другие группы. Они используются для выбора части модели при приближении, изменении прозрачности и т.д. -@end deftypefn - -@deftypefn {Метод класса @code{mglGraph} (C++)} @code{void} EndGroup () -Завершает определение группы. -@end deftypefn - diff --git a/texinfo/data_en.texi b/texinfo/data_en.texi index 272c458..08d902d 100644 --- a/texinfo/data_en.texi +++ b/texinfo/data_en.texi @@ -1,26 +1,31 @@ @c ------------------------------------------------------------------ -@chapter mglData class +@chapter Data processing -Class 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 (@pxref{Installation and usage}). +Class 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 (@pxref{Installation and usage}). Data arrays are denoted by Small Caps (like @sc{dat}) if it can be (re-)created by MGL commands. @menu -* Public variables:: -* Create and delete:: -* Fill:: -* Rearrange:: -* File I/O:: -* Make another data:: -* Change data:: -* Interpolation:: -* Informational functions:: -* Operators:: -* Global functions:: +* Public variables:: +* Data constructor:: +* Data resizing:: +* Data filling:: +* File I/O:: +* Make another data:: +* Data changing:: +* Interpolation:: +* Data information:: +* Operators:: +* Global functions:: @end menu @c ------------------------------------------------------------------ -@node Public variables, Create and delete, , mglData class +@node Public variables, Data constructor, , Data processing @section Public variables +@ifset UDAV +MGL don't support direct access to data arrays. See section @ref{Data filling} +@end ifset + +@ifclear UDAV @deftypecv {Variable} mglData @code{float *} a Data array itself. The flat data representation is used. For example, matrix [nx x ny] is presented as flat (1d-) array with length nx*ny. The element with indexes @{i, j, k@} is a[i+nx*j+nx*ny*k] (indexes are zero based). @end deftypecv @@ -36,155 +41,141 @@ Number of points in 3d dimensions ('z' dimension). @deftypecv {Variable} mglData @code{char *} id Column (or slice if nz>1) names -- one character per column. @end deftypecv +@deftypecv {Variable} mglData @code{bool} link +Flag to use external data, i.e. don't delete it. +@end deftypecv - -@c ------------------------------------------------------------------ -@node Create and delete, Fill, Public variables, mglData class -@section Create and delete -@cindex mglData -@cindex Set - -@defop Constructor mglData @code{} mglData (@code{int} mx=@code{1}, @code{int} my=@code{1}, @code{int} mz=@code{1}) -Default constructor. Allocates the memory for data array and initializes it by zero. -@end defop -@defop Constructor mglData @code{} mglData (@code{const char *}fname) -Initializes the data by reading from file. -@end defop -@defop Constructor mglData @code{} mglData (@code{const mglData} &dat) -Initiates by other @code{mglData} instance. -@end defop -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Create (@code{int} mx, @code{int} my=@code{1}, @code{int} mz=@code{1}) -@deftypefnx {C function} @code{void} mgl_data_create (@code{HMDT} dat, @code{int} mx, @code{int} my, @code{int} mz) -Creates or recreates the array with specified size and fills it by zero. This function does nothing if one of parameters @var{mx}, @var{my}, @var{mz} is zero or negative. -@end deftypefn - -@deftypefn {Method on @code{mglData} (C++)} @code{void} Set (@code{const float *}A, @code{int} NX, @code{int} NY=@code{1}, @code{int} NZ=@code{1}) -@deftypefnx {Method on @code{mglData} (C++)} @code{void} Set (@code{const double *}A, @code{int} NX, @code{int} NY=@code{1}, @code{int} NZ=@code{1}) -@deftypefnx {C function} @code{void} mgl_data_set_float (@code{HMDT} dat, @code{const float *}A, @code{int} NX, @code{int} NY, @code{int} NZ) -@deftypefnx {C function} @code{void} mgl_data_set_double (@code{HMDT} dat, @code{const double *}A, @code{int} NX, @code{int} NY, @code{int} NZ) -Allocates memory and copies the data from the @strong{flat} @code{float*} or @code{double*} array. -@end deftypefn - -@deftypefn {Method on @code{mglData} (C++)} @code{void} Set (@code{const float **}A, @code{int} N1, @code{int} N2) -@deftypefnx {Method on @code{mglData} (C++)} @code{void} Set (@code{const double **}A, @code{int} N1, @code{int} N2) -@deftypefnx {C function} @code{void} mgl_data_set_float2 (@code{HMDT} dat, @code{const float **}A, @code{int} N1, @code{int} N2) -@deftypefnx {C function} @code{void} mgl_data_set_double2 (@code{HMDT} dat, @code{const double **}A, @code{int} N1, @code{int} N2) -Allocates memory and copies the data from the @code{float**} or @code{double**} array with dimensions @var{N1}, @var{N2}, i.e. from array defined as @code{float a[N1][N2];}. +@deftypefn {Method on @code{mglData}} @code{float} GetVal (@code{long} i) +@deftypefnx {Method on @code{mglData}} @code{void} SetVal (@code{float} val, @code{long} i) +@deftypefnx {Method on @code{mglData}} @code{float} vthr (@code{long} i) +Gets or sets the value in by "flat" index @var{i} without border checking. Index @var{i} should be in range [0, nx*ny*nz]. @end deftypefn -@deftypefn {Method on @code{mglData} (C++)} @code{void} Set (@code{const float ***}A, @code{int} N1, @code{int} N2) -@deftypefnx {Method on @code{mglData} (C++)} @code{void} Set (@code{const double ***}A, @code{int} N1, @code{int} N2) -@deftypefnx {C function} @code{void} mgl_data_set_float3 (@code{HMDT} dat, @code{const float ***}A, @code{int} N1, @code{int} N2) -@deftypefnx {C function} @code{void} mgl_data_set_double3 (@code{HMDT} dat, @code{const double ***}A, @code{int} N1, @code{int} N2) -Allocates memory and copies the data from the @code{float***} or @code{double***} array with dimensions @var{N1}, @var{N2}, @var{N3}, i.e. from array defined as @code{float a[N1][N2][N3];}. +@deftypefn {Method on @code{mglData}} @code{long} GetNx () +@deftypefnx {Method on @code{mglData}} @code{long} GetNy () +@deftypefnx {Method on @code{mglData}} @code{long} GetNz () +@deftypefnx {C function} @code{long} mgl_data_get_nx (@code{HCDT} dat) +@deftypefnx {C function} @code{long} mgl_data_get_ny (@code{HCDT} dat) +@deftypefnx {C function} @code{long} mgl_data_get_nz (@code{HCDT} dat) +Gets the x-, y-, z-size of the data. @end deftypefn -@deftypefn {Method on @code{mglData} (C++)} @code{void} Set (@code{gsl_vector *}v) -@deftypefnx {C function} @code{void} mgl_data_set_vector (@code{HMDT} dat, @code{gsl_vector *}v) -Allocates memory and copies the data from the @code{gsl_vector *} structure. +@deftypefn {Method on @code{mglData}} @code{float} v (@code{long} i, @code{long} j=@code{0}, @code{long} k=@code{0}) +@deftypefnx {C function} @code{float} mgl_data_get_value (@code{HCDT} dat, @code{int} i, @code{int} j, @code{int} k) +@deftypefnx {C function} @code{float *} mgl_data_value (@code{HMDT} dat, @code{int} i, @code{int} j, @code{int} k) +@deftypefnx {C function} @code{void} mgl_data_set_value (@code{HMDT} dat, @code{float} v, @code{int} i, @code{int} j, @code{int} k) +Gets or sets the value in specified cell of the data with border checking. @end deftypefn -@deftypefn {Method on @code{mglData} (C++)} @code{void} Set (@code{gsl_matrix *}m) -@deftypefnx {C function} @code{void} mgl_data_set_matrix (@code{HMDT} dat, @code{gsl_matrix *}m) -Allocates memory and copies the data from the @code{gsl_matrix *} structure. +@deftypefn {C function} @code{const float *} mgl_data_data (@code{HCDT} dat) +Returns pointer to internal data array. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{inline void} Set (@code{const mglData &}from) -@deftypefnx {C function} @code{void} mgl_data_set (@code{HMDT} dat, @code{const HMDT} from) -Copies the data from mglData instance @var{from}. -@end deftypefn - -@deftypefn {Method on @code{mglData} (C++)} @code{void} Set (@code{const std::vector &}d) -@deftypefnx {Method on @code{mglData} (C++)} @code{void} Set (@code{const std::vector &}d) -@deftypefnx {Method on @code{mglData} (C++)} @code{void} Set (@code{const std::vector &}d) -Allocates memory and copies the data from the @code{std::vector} array. -@end deftypefn - -@deftypefn {Method on @code{mglData} (C+, Python)} @code{void} Set (@code{const char *}str, @code{int} NX, @code{int} NY=@code{1}, @code{int} NZ=@code{1}) -@deftypefnx {C function} @code{void} mgl_data_set_values (@code{const char *}str, @code{int} NX, @code{int} NY, @code{int} NZ) -Allocates memory and scanf the data from the string. +@deftypefn {Method on @code{mglData}} @code{float} dvx (@code{long} i, @code{long} j=@code{0}, @code{long} k=@code{0}) +@deftypefnx {Method on @code{mglData}} @code{float} dvy (@code{long} i, @code{long} j=@code{0}, @code{long} k=@code{0}) +@deftypefnx {Method on @code{mglData}} @code{float} dvz (@code{long} i, @code{long} j=@code{0}, @code{long} k=@code{0}) +Returns numerical derivate along x-, y- or z-direction. @end deftypefn +@end ifclear @c ------------------------------------------------------------------ -@node Fill, Rearrange, Create and delete, mglData class -@section Fill -@cindex Fill -@cindex Modify - -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Fill (@code{float} x1, @code{float} x2, @code{char} dir=@code{'x'}) -@deftypefnx {C function} @code{void} mgl_data_fill (@code{HMDT} dat, @code{float} x1, @code{float} x2, @code{char} dir) -Equidistantly fills the data values to range [@var{x1}, @var{x2}] in direction @var{dir}=@{@samp{x},@samp{y},@samp{z}@}. -@end deftypefn - -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Fill (@code{const char *}eq, @code{mglPoint} Min, @code{mglPoint} Max, @code{const mglData *}vdat=0, @code{const mglData *}wdat=0) -@deftypefnx {C function} @code{void} mgl_data_fill (@code{HMGL} gr, @code{HMDT} dat, @code{const char *}eq, @code{const HMDT *}vdat, @code{const HMDT *}wdat) -Fills the value of array according to the formula in string @var{eq}. Formula is an arbitrary expression depending on variables @samp{x}, @samp{y}, @samp{z}, @samp{u}, @samp{v}, @samp{w}. Coordinates @samp{x}, @samp{y}, @samp{z} are supposed to be normalized in range @var{Min} x @var{Max} (in difference from @code{Modify} functions). Variable @samp{u} is the original value of the array. Variables @samp{v} and @samp{w} are values of @var{vdat}, @var{wdat} which can be @code{NULL} (i.e. can be omitted). -@end deftypefn - -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Modify (@code{const char *}eq, @code{int} dim=@code{0}) -@deftypefnx {Method on @code{mglData} (C++, Python)} @code{void} Modify (@code{const char *}eq, @code{const mglData &}v) -@deftypefnx {Method on @code{mglData} (C++, Python)} @code{void} Modify (@code{const char *}eq, @code{const mglData &}v, @code{const mglData &}w) -@deftypefnx {C function} @code{void} mgl_data_modify (@code{HMDT} dat, @code{const char *}eq, @code{int} dim) -@deftypefnx {C function} @code{void} mgl_data_modify_vw (@code{HMDT} dat, @code{const char *}eq, @code{const HMDT} v, @code{const HMDT} w) -Fills the value of array according to the formula in string @var{eq}. Formula is an arbitrary expression depending on variables @samp{x}, @samp{y}, @samp{z}, @samp{u}, @samp{v}, @samp{w}. Coordinates @samp{x}, @samp{y}, @samp{z} are supposed to be normalized in range [0,1] (in difference from @code{Fill} functions). Variable @samp{u} is the original value of the array. Variables @samp{v} and @samp{w} are values of @var{vdat}, @var{wdat} which can be @code{NULL} (i.e. can be omitted). If @var{dim}>0 is specified then modification will be fulfilled only for slices >=@var{dim}. -@end deftypefn - -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Put (@code{float} val, @code{int} i=@code{-1}, @code{int} j=@code{-1}, @code{int} k=@code{-1}) -@deftypefnx mglData @code{void} mgl_data_put_val (@code{HMDT} a, @code{float} val, @code{int} i, @code{int} j, @code{int} k) -Function sets value(s) of array a[@var{i}, @var{j}, @var{k}] = @var{val}. Negative indexes @var{i}, @var{j}, @var{k}=-1 set the value @var{val} to whole range in corresponding direction(s). For example, @code{Put(val,-1,0,-1);} sets a[i,0,j]=@var{val} for i=0...(nx-1), j=0...(nz-1). -@end deftypefn - -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Put (@code{const mglData &}v, @code{int} i=@code{-1}, @code{int} j=@code{-1}, @code{int} k=@code{-1}) -@deftypefnx mglData @code{void} mgl_data_put_dat (@code{HMDT} a, @code{const HMDT} v, @code{int} i, @code{int} j, @code{int} k) -Function copies value(s) from array @var{v} to the range of original array. Negative indexes @var{i}, @var{j}, @var{k}=-1 set the range in corresponding direction(s). At this minor dimensions of array @var{v} should be large than corresponding dimensions of this array. For example, @code{Put(v,-1,0,-1);} sets a[i,0,j]=v.ny>nz ? v[i,j] : v[i], where i=0...(nx-1), j=0...(nz-1) and condition v.nx>=nx is true. -@end deftypefn - -@deftypefn {C function} @code{void} mgl_data_set_value (@code{HMDT} dat, @code{float} v, @code{int} i, @code{int} j, @code{int} k) -Sets the value in specified cell of the data with border checking. -@end deftypefn - -@deftypefn {C function} @code{float} mgl_data_get_value (@code{HMDT} dat, @code{int} i, @code{int} j, @code{int} k) -Gets the value in specified cell of the data with border checking. +@node Data constructor, Data resizing, Public variables, Data processing +@section Data constructor +@cindex mglData constructor + +@ifset UDAV +There are many functions, which can create data for output (see @ref{Data filling}, @ref{File I/O}, @ref{Make another data}, @ref{Global functions}). Here I put most useful of them. +@end ifset + +@anchor{new} +@deftypefn {MGL command} {} new @sc{dat} [@code{nx=1 ny=1 nz=1}] +@ifclear UDAV +@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{int} mx=@code{1}, @code{int} my=@code{1}, @code{int} mz=@code{1}) +@deftypefnx {C function} @code{HMDT} mgl_create_data () +@deftypefnx {C function} @code{HMDT} mgl_create_data_size (@code{int} mx, @code{int} my, @code{int} mz) +@end ifclear +Default constructor. Allocates the memory for data array and initializes it by zero. @end deftypefn -@deftypefn {Method on @code{mglData} (C+, Python)} @code{void} GetNx () -@deftypefnx {C function} @code{float} mgl_data_get_nx (@code{HMDT} dat) -Gets the x-size of the data. +@anchor{copy} +@deftypefn {MGL command} {} copy @sc{dat} dat2 ['eq'=''] +@deftypefnx {MGL command} {} copy @sc{dat} @code{val} +@ifclear UDAV +@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{const mglData &}dat2) +@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{const mglData *}dat2) +@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{const mglDataA *}dat2) +@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{int} size, @code{const float *}dat2) +@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{int} size, @code{int} cols, @code{const float *}dat2) +@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{int} size, @code{const double *}dat2) +@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{int} size, @code{int} cols, @code{const double *}dat2) +@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{const double *}dat2, @code{int} size) +@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{const double *}dat2, @code{int} size, @code{int} cols) +@end ifclear +Copy constructor. Allocates the memory for data array and copy values from other array. At this, if parameter @var{eq} is specified then the data will be modified by corresponding formula similarly to @ref{fill} function. +@end deftypefn + +@deftypefn {MGL command} {} read @sc{dat} 'fname' +@ifclear UDAV +@deftypefnx {Constructor on @code{mglData}} {} mglData (@code{const char *}fname) +@deftypefnx {C function} @code{HMDT} mgl_create_data_file (@code{const char *}fname) +@end ifclear +Reads data from tab-separated text file with auto determining sizes of the data. @end deftypefn -@deftypefn {Method on @code{mglData} (C+, Python)} @code{void} GetNy () -@deftypefnx {C function} @code{float} mgl_data_get_ny (@code{HMDT} dat) -Gets the y-size of the data. +@deftypefn {MGL command} {} delete dat +@ifclear UDAV +@deftypefnx {Destructor on @code{mglData}} {} ~mglData () +@deftypefnx {C function} @code{void} mgl_delete_data (@code{HMDT} dat) +@end ifclear +Deletes the instance of class mglData. @end deftypefn -@deftypefn {Method on @code{mglData} (C+, Python)} @code{void} GetNz () -@deftypefnx {C function} @code{float} mgl_data_get_nz (@code{HMDT} dat) -Gets the z-size of the data. -@end deftypefn @c ------------------------------------------------------------------ -@node Rearrange, File I/O, Fill, mglData class -@section Rearrange +@node Data resizing, Data filling, Data constructor, Data processing +@section Data resizing +@cindex Create @cindex Rearrange @cindex Extend @cindex Transpose @cindex Squeeze @cindex Crop -@cindex InsertRows -@cindex InsertColumns -@cindex InsertSlices -@cindex DeleteRows -@cindex DeleteColumns -@cindex DeleteSlices @cindex Insert @cindex Delete -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Rearrange (@code{int} mx, @code{int} my=@code{0}, @code{int} mz=@code{0}) + +@deftypefn {MGL command} {} new @sc{dat} [@code{nx=1 ny=1 nz=1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Create (@code{int} mx, @code{int} my=@code{1}, @code{int} mz=@code{1}) +@deftypefnx {C function} @code{void} mgl_data_create (@code{HMDT} dat, @code{int} mx, @code{int} my, @code{int} mz) +@end ifclear +Creates or recreates the array with specified size and fills it by zero. This function does nothing if one of parameters @var{mx}, @var{my}, @var{mz} is zero or negative. +@end deftypefn + +@anchor{rearrange} +@deftypefn {MGL command} {} rearrange dat @code{mx [my=0 mz=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Rearrange (@code{int} mx, @code{int} my=@code{0}, @code{int} mz=@code{0}) @deftypefnx {C function} @code{void} mgl_data_rearrange (@code{HMDT} dat, @code{int} mx, @code{int} my, @code{int} mz) +@end ifclear Rearrange dimensions without changing data array so that resulting sizes should be @var{mx}*@var{my}*@var{mz} < nx*ny*nz. If some of parameter @var{my} or @var{mz} are zero then it will be selected to optimal fill of data array. For example, if @var{my}=0 then it will be change to @var{my}=nx*ny*nz/@var{mx} and @var{mz} will be 1. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Extend (@code{int} n1, @code{int} n2=@code{0}) + +@anchor{transpose} +@deftypefn {MGL command} {} transpose dat ['dim'='yxz'] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Transpose (@code{const char *}dim=@code{"yx"}) +@deftypefnx {C function} @code{void} mgl_data_transpose (@code{const char *}dim) +@end ifclear +Transposes (shift order of) dimensions of the data. New order of dimensions is specified in string @var{dim}. This function can be useful also after reading of one-dimensional data. +@end deftypefn + +@anchor{extend} +@deftypefn {MGL command} {} extend dat @code{n1 [n2=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Extend (@code{int} n1, @code{int} n2=@code{0}) @deftypefnx {C function} @code{void} mgl_data_extend (@code{HMDT} dat, @code{int} n1, @code{int} n2) -Increase the dimensions of the data by inserting new (|@var{n1}|+1)-th slices after (for @var{n1}>0) or before (for @var{n1}<0) of existed one. It is possible to insert 2 dimensions simultaneously for 1d data by using parameter @var{n2}. Data to new slices is copy from existed one. For example, for @var{n1}>0 new array will be +@end ifclear +Increase the dimensions of the data by inserting new (|@var{n1}|+1)-th slices after (for @var{n1}>0) or before (for @var{n1}<0) of existed one. It is possible to insert 2 dimensions simultaneously for 1d data by using parameter @var{n2}. Data to new slices is copy from existed one. For example, for @var{n1}>0 new array will be @iftex @math{a_{ij}^{new} = a_i^{old}} where j=0...@var{n1}. Correspondingly, for @var{n1}<0 new array will be @math{a_{ij}^{new} = a_j^{old}} where i=0...|@var{n1}|. @end iftex @@ -192,12 +183,13 @@ Increase the dimensions of the data by inserting new (|@var{n1}|+1)-th slices af a_ij^new = a_i^old where j=0...@var{n1}. Correspondingly, for @var{n1}<0 new array will be a_ij^new = a_j^old where i=0...|@var{n1}|. @end ifnottex @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Transpose (@code{const char *}dim=@code{"yx"}) -@deftypefnx {C function} @code{void} mgl_data_transpose (@code{const char *}dim) -Transposes (shift order of) dimensions of the data. New order of dimensions is specified int string @var{dim}. This function may be useful also for the reading of one-dimensional data. -@end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Squeeze (@code{int} rx, @code{int} ry=@code{1}, @code{int} rz=@code{1}, @code{bool} smooth=@code{false}) + +@anchor{squeeze} +@deftypefn {MGL command} {} squeeze dat @code{rx [ry=1 rz=1 sm=off]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Squeeze (@code{int} rx, @code{int} ry=@code{1}, @code{int} rz=@code{1}, @code{bool} smooth=@code{false}) @deftypefnx {C function} @code{void} mgl_data_squeeze (@code{HMDT} dat, @code{int} rx, @code{int} ry, @code{int} rz, @code{int} smooth) +@end ifclear Reduces the data size by excluding data elements which indexes are not divisible by @var{rx}, @var{ry}, @var{rz} correspondingly. Parameter @var{smooth} set to use smoothing @iftex (i.e. @math{a_{out}[i]=\sum_{j=i,i+r}a[j]/r}) or not (i.e. @math{a_{out}[i]=a[j*r]}). @@ -207,139 +199,361 @@ Reduces the data size by excluding data elements which indexes are not divisible @end ifnottex @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Crop (@code{int} n1, @code{int} n2, @code{char} dir=@code{'x'}) +@anchor{crop} +@deftypefn {MGL command} {} crop dat @code{n1 n2} 'dir' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Crop (@code{int} n1, @code{int} n2, @code{char} dir=@code{'x'}) @deftypefnx {C function} @code{void} mgl_data_crop (@code{HMDT} dat, @code{int} n1, @code{int} n2, @code{char} dir) +@end ifclear Cuts off edges of the data @var{i}<@var{n1} and @var{i}>@var{n2} if @var{n2}>0 or @var{i}>@code{n[xyz]}-@var{n2} if @var{n2}<=0 along direction @var{dir}. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} InsertRows (@code{int} at, @code{int} num=@code{1}, @code{const char *}eq=@code{NULL}) -Insert @var{num} rows (slice along y-direction) at position @var{at} and fill it by formula @var{eq} (if @var{eq}!=0) or by zeros. +@anchor{insert} +@deftypefn {MGL command} {} insert dat 'dir' @code{[pos=off num=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Insert (@code{char} dir, @code{int} pos=@code{0}, @code{int} num=@code{1}) +@deftypefnx {C function} @code{void} mgl_data_insert (@code{HMDT} dat, @code{char} dir, @code{int} pos, @code{char} num) +@end ifclear +Insert @var{num} slices along @var{dir}-direction at position @var{pos} and fill it by zeros. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} InsertColumns (@code{int} at, @code{int} num=@code{1}, @code{const char *}eq=@code{NULL}) -Insert @var{num} columns (slice along x-direction) at position @var{at} and fill it by formula @var{eq} (if @var{eq}!=0) or by zeros. + +@anchor{delete} +@deftypefn {MGL command} {} delete dat 'dir' @code{[pos=off num=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Delete (@code{char} dir, @code{int} pos=@code{0}, @code{int} num=@code{1}) +@deftypefnx {C function} @code{void} mgl_data_delete (@code{HMDT} dat, @code{char} dir, @code{int} pos, @code{char} num) +@end ifclear +Delete @var{num} slices along @var{dir}-direction at position @var{pos}. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} InsertSlices (@code{int} at, @code{int} num=@code{1}, @code{const char *}eq=@code{NULL}) -Insert @var{num} slices (slice along z-direction) at position @var{at} and fill it by formula @var{eq} (if @var{eq}!=0) or by zeros. + +@c ------------------------------------------------------------------ +@node Data filling, File I/O, Data resizing, Data processing +@section Data filling +@cindex Fill +@cindex Modify +@cindex Set +@cindex List +@cindex Var + +@anchor{list} +@deftypefn {MGL command} {} list @sc{dat} @code{v1 ...} +Creates new variable with name @var{dat} and fills it by numeric values of command arguments @code{v1 ...}. Command can create one-dimensional and two-dimensional arrays with arbitrary values. For creating 2d array the user should use delimiter @samp{|} which means that the following values lie in next row. Array sizes are [maximal of row sizes * number of rows]. For example, command @code{list 1 | 2 3} creates the array [1 0; 2 3]. Note, that the maximal number of arguments is 1000. +@end deftypefn +@deftypefn {MGL command} {} list @sc{dat} d1 ... +Creates new variable with name @var{dat} and fills it by data values of arrays of command arguments @var{d1 ...}. Command can create two-dimensional or three-dimensional (if arrays in arguments are 2d arrays) arrays with arbitrary values. Minor dimensions of all arrays in arguments should be equal to dimensions of first array d1. In the opposite case the argument will be ignored. Note, that the maximal number of arguments is 1000. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} DeleteRows (@code{int} at, @code{int} num=@code{1}) -Delete @var{num} rows (slice along y-direction) at position @var{at}. +@ifclear UDAV +@deftypefn {Method on @code{mglData}} @code{void} Set (@code{const float *}A, @code{int} NX, @code{int} NY=@code{1}, @code{int} NZ=@code{1}) +@deftypefnx {Method on @code{mglData}} @code{void} Set (@code{const double *}A, @code{int} NX, @code{int} NY=@code{1}, @code{int} NZ=@code{1}) +@deftypefnx {C function} @code{void} mgl_data_set_float (@code{HMDT} dat, @code{const float *}A, @code{int} NX, @code{int} NY, @code{int} NZ) +@deftypefnx {C function} @code{void} mgl_data_set_double (@code{HMDT} dat, @code{const double *}A, @code{int} NX, @code{int} NY, @code{int} NZ) +Allocates memory and copies the data from the @strong{flat} @code{float*} or @code{double*} array. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} DeleteColumns (@code{int} at, @code{int} num=@code{1}) -Delete @var{num} columns (slice along x-direction) at position @var{at}. + +@deftypefn {Method on @code{mglData}} @code{void} Set (@code{const float **}A, @code{int} N1, @code{int} N2) +@deftypefnx {Method on @code{mglData}} @code{void} Set (@code{const double **}A, @code{int} N1, @code{int} N2) +@deftypefnx {C function} @code{void} mgl_data_set_float2 (@code{HMDT} dat, @code{const float **}A, @code{int} N1, @code{int} N2) +@deftypefnx {C function} @code{void} mgl_data_set_double2 (@code{HMDT} dat, @code{const double **}A, @code{int} N1, @code{int} N2) +Allocates memory and copies the data from the @code{float**} or @code{double**} array with dimensions @var{N1}, @var{N2}, i.e. from array defined as @code{float a[N1][N2];}. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} DeleteSlices (@code{int} at, @code{int} num=@code{1}) -Delete @var{num} slices (slice along z-direction) at position @var{at}. + +@deftypefn {Method on @code{mglData}} @code{void} Set (@code{const float ***}A, @code{int} N1, @code{int} N2) +@deftypefnx {Method on @code{mglData}} @code{void} Set (@code{const double ***}A, @code{int} N1, @code{int} N2) +@deftypefnx {C function} @code{void} mgl_data_set_float3 (@code{HMDT} dat, @code{const float ***}A, @code{int} N1, @code{int} N2) +@deftypefnx {C function} @code{void} mgl_data_set_double3 (@code{HMDT} dat, @code{const double ***}A, @code{int} N1, @code{int} N2) +Allocates memory and copies the data from the @code{float***} or @code{double***} array with dimensions @var{N1}, @var{N2}, @var{N3}, i.e. from array defined as @code{float a[N1][N2][N3];}. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Insert (@code{char} dir, @code{int} pos=@code{0}, @code{int} num=@code{1}) -@deftypefnx {C function} @code{void} mgl_data_insert (@code{HMDT} dat, @code{char} dir, @code{int} pos, @code{char} num) -Insert @var{num} slices along @var{dir}-direction at position @var{pos} and fill it by zeros. +@deftypefn {Method on @code{mglData}} @code{void} Set (@code{gsl_vector *}v) +@deftypefnx {C function} @code{void} mgl_data_set_vector (@code{HMDT} dat, @code{gsl_vector *}v) +Allocates memory and copies the data from the @code{gsl_vector *} structure. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Delete (@code{char} dir, @code{int} pos=@code{0}, @code{int} num=@code{1}) -@deftypefnx {C function} @code{void} mgl_data_delete (@code{HMDT} dat, @code{char} dir, @code{int} pos, @code{char} num) -Delete @var{num} slices along @var{dir}-direction at position @var{pos}. +@deftypefn {Method on @code{mglData}} @code{void} Set (@code{gsl_matrix *}m) +@deftypefnx {C function} @code{void} mgl_data_set_matrix (@code{HMDT} dat, @code{gsl_matrix *}m) +Allocates memory and copies the data from the @code{gsl_matrix *} structure. +@end deftypefn +@deftypefn {Method on @code{mglData}} @code{void} Set (@code{const mglData &}from) +@deftypefnx {C function} @code{void} mgl_data_set (@code{HMDT} dat, @code{HCDT} from) +Copies the data from mglData instance @var{from}. +@end deftypefn + +@deftypefn {Method on @code{mglData}} @code{void} Set (@code{const std::vector &}d) +@deftypefnx {Method on @code{mglData}} @code{void} Set (@code{const std::vector &}d) +@deftypefnx {Method on @code{mglData}} @code{void} Set (@code{const std::vector &}d) +Allocates memory and copies the data from the @code{std::vector} array. +@end deftypefn + +@deftypefn {Method on @code{mglData}} @code{void} Set (@code{const char *}str, @code{int} NX, @code{int} NY=@code{1}, @code{int} NZ=@code{1}) +@deftypefnx {C function} @code{void} mgl_data_set_values (@code{const char *}str, @code{int} NX, @code{int} NY, @code{int} NZ) +Allocates memory and scanf the data from the string. +@end deftypefn + +@deftypefn {Method on @code{mglData}} @code{void} Link (@code{const mglData &}from) +@deftypefnx {Method on @code{mglData}} @code{void} Link (@code{const float *}A, @code{int} NX, @code{int} NY=@code{1}, @code{int} NZ=@code{1}) +@deftypefnx {C function} @code{void} mgl_data_link (@code{HMDT} dat, @code{const float *}A, @code{int} NX, @code{int} NY, @code{int} NZ) +Links external data array, i.e. don't delete it at exit. +@end deftypefn +@end ifclear + +@anchor{var} +@deftypefn {MGL command} {} var @sc{dat} @code{num v1 [v2=nan]} +Creates new variable with name @var{dat} for one-dimensional array of size @var{num}. Array elements are equidistantly distributed in range [@var{v1}, @var{v2}]. If @var{v2}=@code{nan} then @var{v2=v1} is used. +@end deftypefn + +@anchor{fill} +@deftypefn {MGL command} {} fill dat v1 v2 ['dir'='x'] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Fill (@code{float} v1, @code{float} v2, @code{char} dir=@code{'x'}) +@deftypefnx {C function} @code{void} mgl_data_fill (@code{HMDT} dat, @code{float} v1, @code{float} v2, @code{char} dir) +@end ifclear +Equidistantly fills the data values to range [@var{v1}, @var{v2}] in direction @var{dir}=@{@samp{x},@samp{y},@samp{z}@}. +@end deftypefn + +@deftypefn {MGL command} {} fill dat 'eq' +@deftypefnx {MGL command} {} fill dat 'eq' vdat +@deftypefnx {MGL command} {} fill dat 'eq' vdat wdat +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Fill (@code{HMGL} gr, @code{const char *}eq, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglData}} @code{void} Fill (@code{HMGL} gr, @code{const char *}eq, @code{const mglData &}vdat, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglData}} @code{void} Fill (@code{HMGL} gr, @code{const char *}eq, @code{const mglData &}vdat, @code{const mglData &}wdat, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_data_fill_eq (@code{HMGL} gr, @code{HMDT} dat, @code{const char *}eq, @code{const HMDT *}vdat, @code{const HMDT *}wdat, @code{const char *}opt) +@end ifclear +Fills the value of array according to the formula in string @var{eq}. Formula is an arbitrary expression depending on variables @samp{x}, @samp{y}, @samp{z}, @samp{u}, @samp{v}, @samp{w}. Coordinates @samp{x}, @samp{y}, @samp{z} are supposed to be normalized in axis range of canvas @var{gr} (in difference from @code{Modify} functions). Variable @samp{u} is the original value of the array. Variables @samp{v} and @samp{w} are values of @var{vdat}, @var{wdat} which can be @code{NULL} (i.e. can be omitted). +@end deftypefn + +@anchor{modify} +@deftypefn {MGL command} {} modify dat 'eq' [@code{dim=0}] +@deftypefnx {MGL command} {} modify dat 'eq' vdat +@deftypefnx {MGL command} {} modify dat 'eq' vdat wdat +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Modify (@code{const char *}eq, @code{int} dim=@code{0}) +@deftypefnx {Method on @code{mglData}} @code{void} Modify (@code{const char *}eq, @code{const mglData &}v) +@deftypefnx {Method on @code{mglData}} @code{void} Modify (@code{const char *}eq, @code{const mglData &}v, @code{const mglData &}w) +@deftypefnx {C function} @code{void} mgl_data_modify (@code{HMDT} dat, @code{const char *}eq, @code{int} dim) +@deftypefnx {C function} @code{void} mgl_data_modify_vw (@code{HMDT} dat, @code{const char *}eq, @code{HCDT} v, @code{HCDT} w) +@end ifclear +The same as previous ones but coordinates @samp{x}, @samp{y}, @samp{z} are supposed to be normalized in range [0,1]. If @var{dim}>0 is specified then modification will be fulfilled only for slices >=@var{dim}. @end deftypefn +@anchor{put} +@deftypefn {MGL command} {} put dat @code{val [i=: j=: k=:]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Put (@code{float} val, @code{int} i=@code{-1}, @code{int} j=@code{-1}, @code{int} k=@code{-1}) +@deftypefnx mglData @code{void} mgl_data_put_val (@code{HMDT} a, @code{float} val, @code{int} i, @code{int} j, @code{int} k) +@end ifclear +Sets value(s) of array a[@var{i}, @var{j}, @var{k}] = @var{val}. Negative indexes @var{i}, @var{j}, @var{k}=-1 set the value @var{val} to whole range in corresponding direction(s). For example, @code{Put(val,-1,0,-1);} sets a[i,0,j]=@var{val} for i=0...(nx-1), j=0...(nz-1). +@end deftypefn + +@deftypefn {MGL command} {} put dat vdat [@code{i=: j=: k=:}] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Put (@code{const mglData &}v, @code{int} i=@code{-1}, @code{int} j=@code{-1}, @code{int} k=@code{-1}) +@deftypefnx mglData @code{void} mgl_data_put_dat (@code{HMDT} a, @code{HCDT} v, @code{int} i, @code{int} j, @code{int} k) +@end ifclear +Copies value(s) from array @var{v} to the range of original array. Negative indexes @var{i}, @var{j}, @var{k}=-1 set the range in corresponding direction(s). At this minor dimensions of array @var{v} should be large than corresponding dimensions of this array. For example, @code{Put(v,-1,0,-1);} sets a[i,0,j]=v.ny>nz ? v[i,j] : v[i], where i=0...(nx-1), j=0...(nz-1) and condition v.nx>=nx is true. +@end deftypefn + +@anchor{idset} +@deftypefn {MGL command} {} idset dat 'ids' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} SetColumnId (@code{const char *}ids) +@deftypefnx mglData @code{void} mgl_data_set_id (@code{const char *}ids) +@end ifclear +Sets the symbol @var{ids} for data columns. The string should contain one symbol 'a'...'z' per column. These ids are used in @ref{column} function. +@end deftypefn + + @c ------------------------------------------------------------------ -@node File I/O, Make another data, Rearrange, mglData class +@node File I/O, Make another data, Data filling, Data processing @section File I/O @cindex Read -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Read (@code{const char *}fname) +@cindex ReadMat +@cindex ReadRange +@cindex ReadAll +@cindex Save +@cindex ReadHDF +@cindex SaveHDF +@cindex Import +@cindex Export + +@anchor{read} +@deftypefn {MGL command} {} read @sc{dat} 'fname' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Read (@code{const char *}fname) @deftypefnx {C function} @code{void} mgl_data_read (@code{HMDT} dat, @code{const char *}fname) +@end ifclear Reads data from tab-separated text file with auto determining sizes of the data. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Read (@code{const char *}fname, @code{int} mx, @code{int} my=@code{1}, @code{int} mz=@code{1}) + +@deftypefn {MGL command} {} read @sc{dat} 'fname' @code{mx [my=1 mz=1]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Read (@code{const char *}fname, @code{int} mx, @code{int} my=@code{1}, @code{int} mz=@code{1}) @deftypefnx {C function} @code{void} mgl_data_read_dim (@code{HMDT} dat, @code{const char *}fname, @code{int} mx, @code{int} my, @code{int} mz) +@end ifclear Reads data from text file with specified data sizes. This function does nothing if one of parameters @var{mx}, @var{my} or @var{mz} is zero or negative. @end deftypefn -@cindex ReadMat -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} ReadMat (@code{const char *}fname, @code{int} dim=@code{2}) + +@anchor{readmat} +@deftypefn {MGL command} {} readmat @sc{dat} 'fname' [@code{dim=2}] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} ReadMat (@code{const char *}fname, @code{int} dim=@code{2}) @deftypefnx {C function} @code{void} mgl_data_read_mat (@code{HMDT} dat, @code{const char *}fname, @code{int} dim) +@end ifclear Read data from text file with size specified at beginning of the file by first @var{dim} numbers. At this, variable @var{dim} set data dimensions. @end deftypefn -@cindex ReadRange -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} ReadRange (@code{const char *}templ, @code{float} from, @code{float} to, @code{float} step=@code{1.f}, @code{bool} as_slice=@code{false}) +@anchor{readall} +@deftypefn {MGL command} {} readall @sc{dat} 'templ' @code{v1 v2 [dv=1 slice=off]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} ReadRange (@code{const char *}templ, @code{float} from, @code{float} to, @code{float} step=@code{1.f}, @code{bool} as_slice=@code{false}) +@end ifclear Join data arrays from several text files. The file names are determined by function call @code{sprintf(fname,templ,val);}, where @var{val} changes from @var{from} to @var{to} with step @var{step}. The data load one-by-one in the same slice if @var{as_slice}=@code{false} or as slice-by-slice if @var{as_slice}=@code{true}. @end deftypefn -@cindex ReadAll -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} ReadAll (@code{const char *}templ, @code{bool} as_slice=@code{false}) + +@deftypefn {MGL command} {} readall @sc{dat} 'templ' @code{[slice=off]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} ReadAll (@code{const char *}templ, @code{bool} as_slice=@code{false}) +@end ifclear Join data arrays from several text files which filenames satisfied the template @var{templ} (for example, @var{templ}=@code{"t_*.dat"}). The data load one-by-one in the same slice if @var{as_slice}=@code{false} or as slice-by-slice if @var{as_slice}=@code{true}. @end deftypefn -@cindex Save -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Save (@code{const char *}fname, @code{int} ns=@code{-1}) @code{const} -@deftypefnx {C function} @code{void} mgl_data_save (@code{const HMDT} dat, @code{const char *}fname, @code{int} ns) +@anchor{save} +@deftypefn {MGL command} {} save dat 'fname' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Save (@code{const char *}fname, @code{int} ns=@code{-1}) @code{const} +@deftypefnx {C function} @code{void} mgl_data_save (@code{HCDT} dat, @code{const char *}fname, @code{int} ns) +@end ifclear Saves the whole data array (for @var{ns}=@code{-1}) or only @var{ns}-th slice to text file. @end deftypefn -@cindex ReadHDF -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} ReadHDF (@code{const char *}fname, @code{const char *}dname) -Reads data array named @var{dname} from HDF5 or HDF4 file. This function does nothing if NO_HDF5|NO_HDF4 was defined during library compilation. +@anchor{readhdf} +@deftypefn {MGL command} {} readhdf @sc{dat} 'fname' 'dname' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} ReadHDF (@code{const char *}fname, @code{const char *}dname) +@deftypefnx {C function} @code{void} mgl_data_read_hdf (@code{HMDT} dat, @code{const char *}fname, @code{const char *}dname) +@end ifclear +Reads data array named @var{dname} from HDF5 or HDF4 file. This function does nothing if HDF5|HDF4 was disabled during library compilation. @end deftypefn -@cindex SaveHDF -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} SaveHDF (@code{const char *}fname, @code{const char *}dname, @code{bool} rewrite=@code{false}) @code{const} -Saves data array named @var{dname} from HDF5 or HDF4 file. This function does nothing if NO_HDF5|NO_HDF4 was defined during library compilation. + +@anchor{savehdf} +@deftypefn {MGL command} {} savehdf dat 'fname' 'dname' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} SaveHDF (@code{const char *}fname, @code{const char *}dname, @code{bool} rewrite=@code{false}) @code{const} +@deftypefnx {C function} @code{void} mgl_data_save_hdf (@code{HCDT} dat, @code{const char *}fname, @code{const char *}dname, @code{int} rewrite) +@end ifclear +Saves data array named @var{dname} to HDF5 file. This function does nothing if HDF5 was disabled during library compilation. @end deftypefn -@cindex Import -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Import (@code{const char *}fname, @code{const char *}scheme, @code{float} v1=@code{0}, float v2=@code{1}) +@anchor{datas} +@deftypefn {MGL command} {} datas 'fname' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} DatasHDF (@code{const char *}fname, @code{char *}buf, @code{long} size) @code{const} +@deftypefnx {C function} @code{void} mgl_datas_hdf (@code{const char *}fname, @code{char *}buf, @code{long} size) +@end ifclear +Put data names from HDF5 file @var{fname} into @var{buf} as '\t' separated fields. In MGL version the list of data names will be printed as message. This function does nothing if HDF5 was disabled during library compilation. +@end deftypefn + +@anchor{import} +@deftypefn {MGL command} {} import @sc{dat} 'fname' 'sch' [@code{v1=0 v2=1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Import (@code{const char *}fname, @code{const char *}scheme, @code{float} v1=@code{0}, float v2=@code{1}) @deftypefnx {C function} @code{void} mgl_data_import (@code{HMDT} dat, @code{const char *}fname, @code{const char *}scheme, @code{float} v1, float v2) +@end ifclear Reads data from bitmap file (now support only PNG format). The RGB values of bitmap pixels are transformed to float values in range [@var{v1}, @var{v2}] using color scheme @var{scheme} (@pxref{Color scheme}). @end deftypefn -@cindex Export -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Export (@code{const char *}fname, @code{const char *}scheme, @code{float} v1=@code{0}, float v2=@code{0}, @code{int} ns=@code{-1}) const + +@anchor{export} +@deftypefn {MGL command} {} export dat 'fname' 'sch' [@code{v1=0 v2=0}] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Export (@code{const char *}fname, @code{const char *}scheme, @code{float} v1=@code{0}, float v2=@code{0}, @code{int} ns=@code{-1}) const @deftypefnx {C function} @code{void} mgl_data_export (@code{HMDT} dat, @code{const char *}fname, @code{const char *}scheme, @code{float} v1, float v2, @code{int} ns) const +@end ifclear Saves data matrix (or @code{ns}-th slice for 3d data) to bitmap file (now support only PNG format). The data values are transformed from range [@var{v1}, @var{v2}] to RGB pixels of bitmap using color scheme @var{scheme} (@pxref{Color scheme}). If @var{v1}>=@var{v2} then the values of @var{v1}, @var{v2} are automatically determined as minimal and maximal value of the data array. @end deftypefn @c ------------------------------------------------------------------ -@node Make another data, Change data, File I/O, mglData class +@node Make another data, Data changing, File I/O, Data processing @section Make another data - @cindex SubData -@deftypefn {Method on @code{mglData} (C++, Python)} @code{mglData} SubData (@code{int} xx, @code{int} yy=@code{-1}, @code{int} zz=@code{-1}) @code{const} -@deftypefnx {C function} @code{HMDT} mgl_data_subdata (@code{const HMDT} dat, @code{int} xx, @code{int} yy, @code{int} zz) -Extracts sub-array data from the original data array keeping fixed positive index. For example @code{SubData(-1,2)} extracts 3d row (indexes are zero based), @code{SubData(4,-1)} extracts 5th column, @code{SubData(-1,-1,3)} extracts 4th slice and so on. -@end deftypefn - -@deftypefn {Method on @code{mglData} (C++, Python)} @code{mglData} SubData (@code{const mglData &}xx, @code{const mglData &}yy, @code{const mglData &}zz) @code{const} -@deftypefnx {C function} @code{HMDT} mgl_data_subdata_ext (@code{const HMDT} dat, @code{const HMDT} xx, @code{const HMDT} yy, @code{const HMDT} zz) -Extracts sub-array data from the original data array for indexes specified by arrays @var{xx}, @var{yy}, @var{zz} (indirect access). The resulting array have the same dimensions as input arrays for 2D and 3D arguments. This function work like previous one for 1D arguments (or numbers). The dimensions of all argument must be the same if they are 2D or 3D arrays. -@end deftypefn - @cindex Column -@deftypefn {Method on @code{mglData} (C++, Python)} @code{mglData} Column (@code{const char *}eq) @code{const} -@deftypefnx {C function} @code{HMDT} mgl_data_column (@code{const HMDT} dat, @code{const char *}eq) -Get column (or slice) of the data filled by formula @var{eq} of other named columns. For example, @code{Column("n*w^2/exp(t)");}. The column ids must be defined first by @code{SetColumnId()} function. -@end deftypefn - -@cindex SetColumnId -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} SetColumnId (@code{const char *}ids) -@deftypefnx {C function} @code{void} mgl_data_set_id (@code{HMDT} dat, @code{const char *}ids) -Set the symbol id for data columns. The string must contain one symbol 'a'...'z' per column (without spaces). -@end deftypefn - @cindex Trace -@deftypefn {Method on @code{mglData} (C++, Python)} @code{mglData} Trace () @code{const} -Gets array of diagonal elements a[i,i] (for 2D case) or a[i,i,i] (for 3D case) where i=0...nx-1. Function return copy of itself for 1D case. Data array must have dimensions ny,nz >= nx or ny,nz = 1. -@end deftypefn - @cindex Hist -@deftypefn {Method on @code{mglData} (C++, Python)} @code{mglData} Hist (@code{int} n, @code{float} v1=@code{0}, @code{float} v2=@code{1}, @code{int} nsub=@code{0}) @code{const} -@deftypefnx {C function} @code{HMDT} mgl_data_hist (@code{const HMDT} dat, @code{int} n, @code{float} v1, @code{float} v2, @code{int} nsub) -Creates @var{n}-th points distribution of the data values in range [@var{v1}, @var{v2}]. Parameter @var{nsub} define the number of additional interpolated points (for smoothness of histogram). -@end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{mglData} Hist (@code{const mglData &}w, @code{int} n, @code{float} v1=@code{0}, @code{float} v2=@code{1}, @code{int} nsub=@code{0}) @code{const} -@deftypefnx {C function} @code{HMDT} mgl_data_hist_w (@code{const HMDT} dat, @code{const HMDT} w, @code{int} n, @code{float} v1, @code{float} v2, @code{int} nsub) -Creates @var{n}-th points distribution of the data values in range [@var{v1}, @var{v2}]. Array @var{w} specifies weights of the data elements. Parameter @var{nsub} define the number of additional interpolated points (for smoothness of histogram). +@cindex Resize +@cindex Evaluate +@cindex Combine +@cindex Momentum +@cindex Sum +@cindex Min +@cindex Max + +@anchor{subdata} +@deftypefn {MGL command} {} subdata @sc{res} dat @code{xx [yy=: zz=:]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{mglData} SubData (@code{float} xx, @code{float} yy=@code{-1}, @code{float} zz=@code{-1}) @code{const} +@deftypefnx {C function} @code{HMDT} mgl_data_subdata (@code{HCDT} dat, @code{float} xx, @code{float} yy, @code{float} zz) +@end ifclear +Extracts sub-array data from the original data array keeping fixed positive index. For example @code{SubData(-1,2)} extracts 3d row (indexes are zero based), @code{SubData(4,-1)} extracts 5th column, @code{SubData(-1,-1,3)} extracts 4th slice and so on. If argument(s) are non-integer then linear interpolation between slices is used. In MGL version this command usually is used as inline one @code{dat(xx,yy,zz)}. +@end deftypefn + +@deftypefn {MGL command} {} subdata @sc{res} dat xdat [ydat=: zdat=:] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{mglData} SubData (@code{const mglData &}xx, @code{const mglData &}yy, @code{const mglData &}zz) @code{const} +@deftypefnx {C function} @code{HMDT} mgl_data_subdata_ext (@code{HCDT} dat, @code{HCDT} xx, @code{HCDT} yy, @code{HCDT} zz) +@end ifclear +Extracts sub-array data from the original data array for indexes specified by arrays @var{xx}, @var{yy}, @var{zz} (indirect access). This function work like previous one for 1D arguments or numbers, and resulting array dimensions are equal dimensions of 1D arrays for corresponding direction. For 2D and 3D arrays in arguments, the resulting array have the same dimensions as input arrays. The dimensions of all argument must be the same (or to be scalar 1*1*1) if they are 2D or 3D arrays. In MGL version this command usually is used as inline one @code{dat(xx,yy,zz)}. +@end deftypefn + +@anchor{column} +@deftypefn {MGL command} {} column @sc{res} dat 'eq' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{mglData} Column (@code{const char *}eq) @code{const} +@deftypefnx {C function} @code{HMDT} mgl_data_column (@code{HCDT} dat, @code{const char *}eq) +@end ifclear +Get column (or slice) of the data filled by formula @var{eq} on column ids. For example, @code{Column("n*w^2/exp(t)");}. The column ids must be defined first by @ref{idset} function. In MGL version this command usually is used as inline one @code{dat('eq')}. +@end deftypefn + +@anchor{resize} +@deftypefn {MGL command} {} resize @sc{res} dat @code{mx [my=1 mz=1]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{mglData} Resize (@code{int} mx, @code{int} my=@code{1}, @code{int} mz=@code{1}, @code{float} x1=@code{0}, @code{float} x2=@code{1}, @code{float} y1=@code{0}, @code{float} y2=@code{1}, @code{float} z1=@code{0}, @code{float} z2=@code{1}) @code{const} +@deftypefnx {C function} @code{HMDT} mgl_data_resize (@code{HCDT} dat, @code{int} mx, @code{int} my, @code{int} mz) +@deftypefnx {C function} @code{HMDT} mgl_data_resize_box (@code{HCDT} dat, @code{int} mx, @code{int} my, @code{int} mz, @code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2, @code{float} z1, @code{float} z2) +@end ifclear +Resizes the data to new size @var{mx}, @var{my}, @var{mz} from box (part) [@var{x1},@var{x2}] x [@var{y1},@var{y2}] x [@var{z1},@var{z2}] of original array. Initially x,y,z coordinates are supposed to be in [0,1]. @end deftypefn -@cindex Momentum -@deftypefn {Method on @code{mglData} (C++, Python)} @code{mglData} Momentum (@code{char} dir, @code{const char *}how) @code{const} -@deftypefnx {C function} @code{HMDT} mgl_data_momentum (@code{const HMDT} dat, @code{char} dir, @code{const char *}how) -Get momentum (1D-array) of the data along direction @var{dir}. String @var{how} contain kind of momentum. The momentum is defined like as +@anchor{evaluate} +@deftypefn {MGL command} {} evaluate @sc{res} dat idat [@code{norm=on}] +@deftypefnx {MGL command} {} evaluate @sc{res} dat idat jdat [@code{norm=on}] +@deftypefnx {MGL command} {} evaluate @sc{res} dat idat jdat kdat [@code{norm=on}] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{mglData} Evaluate (@code{const mglData &}idat, @code{bool} norm=@code{true}) @code{const} +@deftypefnx {Method on @code{mglData}} @code{mglData} Evaluate (@code{const mglData &}idat, @code{const mglData &}jdat, @code{bool} norm=@code{true}) @code{const} +@deftypefnx {Method on @code{mglData}} @code{mglData} Evaluate (@code{const mglData &}idat, @code{const mglData &}jdat, @code{const mglData &}kdat, @code{bool} norm=@code{true}) @code{const} +@deftypefnx {C function} @code{HMDT} mgl_data_evaluate (@code{HCDT} dat, @code{HCDT} idat, @code{HCDT} jdat, @code{HCDT} kdat, @code{int} norm) +@end ifclear +Gets array which values is result of interpolation of original array for coordinates from other arrays. All dimensions must be the same for data @var{idat}, @var{jdat}, @var{kdat}. Coordinates from @var{idat}, @var{jdat}, @var{kdat} are supposed to be normalized in range [0,1] (if @var{norm}=@code{true}) or in ranges [0,nx], [0,ny], [0,nz] correspondingly. +@end deftypefn + +@anchor{hist} +@deftypefn {MGL command} {} hist @sc{res} dat @code{num v1 v2 [nsub=0]} +@deftypefnx {MGL command} {} hist @sc{res} dat wdat @code{num v1 v2 [nsub=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{mglData} Hist (@code{int} n, @code{float} v1=@code{0}, @code{float} v2=@code{1}, @code{int} nsub=@code{0}) @code{const} +@deftypefnx {Method on @code{mglData}} @code{mglData} Hist (@code{const mglData &}w, @code{int} n, @code{float} v1=@code{0}, @code{float} v2=@code{1}, @code{int} nsub=@code{0}) @code{const} +@deftypefnx {C function} @code{HMDT} mgl_data_hist (@code{HCDT} dat, @code{int} n, @code{float} v1, @code{float} v2, @code{int} nsub) +@deftypefnx {C function} @code{HMDT} mgl_data_hist_w (@code{HCDT} dat, @code{HCDT} w, @code{int} n, @code{float} v1, @code{float} v2, @code{int} nsub) +@end ifclear +Creates @var{n}-th points distribution of the data values in range [@var{v1}, @var{v2}]. Array @var{w} specifies weights of the data elements (by default is 1). Parameter @var{nsub} define the number of additional interpolated points (for smoothness of histogram). See also @ref{Data manipulation} +@end deftypefn + +@anchor{momentum} +@deftypefn {MGL command} {} momentum @sc{res} dat 'how' ['dir'='z'] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{mglData} Momentum (@code{char} dir, @code{const char *}how) @code{const} +@deftypefnx {C function} @code{HMDT} mgl_data_momentum (@code{HCDT} dat, @code{char} dir, @code{const char *}how) +@end ifclear +Gets momentum (1D-array) of the data along direction @var{dir}. String @var{how} contain kind of momentum. The momentum is defined like as @iftex @math{res_k = \sum_{ij} how(x_i,y_j,z_k) a_{ij}/\sum_{ij} a_{ij}} @end iftex @@ -349,149 +563,212 @@ res_k = \sum_ij how(x_i,y_j,z_k) a_ij/ \sum_ij a_ij if @var{var}=@samp{z} and so on. Coordinates @samp{x}, @samp{y}, @samp{z} are data indexes normalized in range [0,1]. @end deftypefn -@cindex Sum -@deftypefn {Method on @code{mglData} (C++, Python)} @code{mglData} Sum (@code{const char *}dir) @code{const} -@deftypefnx {C function} @code{HMDT} mgl_data_sum (@code{const HMDT} dat, @code{const char *}dir) +@anchor{sum} +@deftypefn {MGL command} {} sum @sc{res} dat 'dir' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{mglData} Sum (@code{const char *}dir) @code{const} +@deftypefnx {C function} @code{HMDT} mgl_data_sum (@code{HCDT} dat, @code{const char *}dir) +@end ifclear Gets array which is the result of summation in given direction or direction(s). @end deftypefn -@cindex Max -@deftypefn {Method on @code{mglData} (C++, Python)} @code{mglData} Max (@code{const char *}dir) @code{const} -@deftypefnx {C function} @code{HMDT} mgl_data_max_dir (@code{const HMDT} dat, @code{const char *}dir) -Gets array which is the maximal data values in given direction or direction(s). -@end deftypefn -@cindex Min -@deftypefn {Method on @code{mglData} (C++, Python)} @code{mglData} Min (@code{const char *}dir) @code{const} -@deftypefnx {C function} @code{HMDT} mgl_data_min_dir (@code{const HMDT} dat, @code{const char *}dir) + +@anchor{max} +@deftypefn {MGL command} {} max @sc{res} dat 'dir' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{mglData} Max (@code{const char *}dir) @code{const} +@deftypefnx {C function} @code{HMDT} mgl_data_max_dir (@code{HCDT} dat, @code{const char *}dir) +@end ifclear Gets array which is the maximal data values in given direction or direction(s). @end deftypefn -@cindex Combine -@deftypefn {Method on @code{mglData} (C++, Python)} @code{mglData} Combine (@code{const mglData &}a) @code{const} -@deftypefnx {C function} @code{HMDT} mgl_data_combine (@code{const HMDT} dat, @code{const HMDT} a) -Return direct multiplication of arrays (like, res[i,j] = this[i]*a[j] and so on). +@anchor{min} +@deftypefn {MGL command} {} min @sc{res} dat 'dir' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{mglData} Min (@code{const char *}dir) @code{const} +@deftypefnx {C function} @code{HMDT} mgl_data_min_dir (@code{HCDT} dat, @code{const char *}dir) +@end ifclear +Gets array which is the maximal data values in given direction or direction(s). @end deftypefn -@cindex Evaluate -@deftypefn {Method on @code{mglData} (C++, Python)} @code{mglData} Evaluate (@code{const mglData &}idat, @code{bool} norm=@code{true}) @code{const} -@deftypefnx {Method on @code{mglData} (C++, Python)} @code{mglData} Evaluate (@code{const mglData &}idat, @code{const mglData &}jdat, @code{bool} norm=@code{true}) @code{const} -@deftypefnx {Method on @code{mglData} (C++, Python)} @code{mglData} Evaluate (@code{const mglData &}idat, @code{const mglData &}jdat, @code{const mglData &}kdat, @code{bool} norm=@code{true}) @code{const} -@deftypefnx {C function} @code{HMDT} mgl_data_evaluate_i (@code{const HMDT} dat, @code{const HMDT} idat, @code{int} norm) -@deftypefnx {C function} @code{HMDT} mgl_data_evaluate_ij (@code{const HMDT} dat, @code{const HMDT} idat, @code{const HMDT} jdat, @code{int} norm) -@deftypefnx {C function} @code{HMDT} mgl_data_evaluate_ijk (@code{const HMDT} dat, @code{const HMDT} idat, @code{const HMDT} jdat, @code{const HMDT} kdat, @code{int} norm) -Get array which values is result of interpolation of original array for coordinates from other arrays. All dimensions must be the same for data @var{idat}, @var{jdat}, @var{kdat}. Coordinates from @var{idat}, @var{jdat}, @var{kdat} are supposed to be normalized in range [0,1] (if @var{norm}=@code{true}) or in ranges [0,nx], [0,ny], [0,nz] correspondingly. +@anchor{combine} +@deftypefn {MGL command} {} combine @sc{res} adat bdat +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{mglData} Combine (@code{const mglData &}a) @code{const} +@deftypefnx {C function} @code{HMDT} mgl_data_combine (@code{HCDT} dat, @code{HCDT} a) +@end ifclear +Returns direct multiplication of arrays (like, res[i,j] = this[i]*a[j] and so on). @end deftypefn -@cindex Resize -@deftypefn {Method on @code{mglData} (C++, Python)} @code{mglData} Resize (@code{int} mx, @code{int} my=@code{1}, @code{int} mz=@code{1}, @code{float} x1=@code{0}, @code{float} x2=@code{1}, @code{float} y1=@code{0}, @code{float} y2=@code{1}, @code{float} z1=@code{0}, @code{float} z2=@code{1}) @code{const} -@deftypefnx {C function} @code{HMDT} mgl_data_resize (@code{const HMDT} dat, @code{int} mx, @code{int} my, @code{int} mz) -@deftypefnx {C function} @code{HMDT} mgl_data_resize_box (@code{const HMDT} dat, @code{int} mx, @code{int} my, @code{int} mz, @code{float} x1, @code{float} x2, @code{float} y1, @code{float} y2, @code{float} z1, @code{float} z2) -Resizes the data to new size @var{mx}, @var{my}, @var{mz} from box (part) [@var{x1},@var{x2}] x [@var{y1},@var{y2}] x [@var{z1},@var{z2}] of original array. Initially x,y,z coordinates are supposed to be in [0,1]. +@anchor{trace} +@deftypefn {MGL command} {} trace @sc{res} dat +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{mglData} Trace () @code{const} +@end ifclear +Gets array of diagonal elements a[i,i] (for 2D case) or a[i,i,i] (for 3D case) where i=0...nx-1. Function return copy of itself for 1D case. Data array must have dimensions ny,nz >= nx or ny,nz = 1. @end deftypefn @c ------------------------------------------------------------------ -@node Change data, Interpolation, Make another data, mglData class -@section Change data +@node Data changing, Interpolation, Make another data, Data processing +@section Data changing +@cindex CumSum +@cindex Integral +@cindex Diff +@cindex Diff2 +@cindex SinFFT +@cindex CosFFT +@cindex Hankel +@cindex Swap +@cindex Roll +@cindex Mirror +@cindex Sew +@cindex Smooth +@cindex Envelop +@cindex Norm +@cindex NormSl These functions change the data in some direction like differentiations, integrations and so on. The direction in which the change will applied is specified by the string parameter, which may contain @samp{x}, @samp{y} or @samp{z} characters for 1-st, 2-nd and 3-d dimension correspondengly. -@cindex CumSum -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} CumSum (@code{const char *}dir) +@anchor{cumsum} +@deftypefn {MGL command} {} cumsum dat 'dir' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} CumSum (@code{const char *}dir) @deftypefnx {C function} @code{void} mgl_data_cumsum (@code{HMDT} dat, @code{const char *}dir) +@end ifclear Cumulative summation of the data in given direction or directions. @end deftypefn -@cindex Integral -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} Integral (@code{const char *}dir) +@anchor{integrate} +@deftypefn {MGL command} {} integrate dat 'dir' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Integral (@code{const char *}dir) @deftypefnx {C function} @code{void} mgl_data_integral (@code{HMDT} dat, @code{const char *}dir) +@end ifclear Integrates (like cumulative summation) the data in given direction or directions. @end deftypefn -@cindex Diff -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} Diff (@code{const char *}dir) -@deftypefnx {Функция С} @code{void} mgl_data_diff (@code{HMDT} dat, @code{const char *}dir) +@anchor{diff} +@deftypefn {MGL command} {} diff dat 'dir' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Diff (@code{const char *}dir) +@deftypefnx {C function} @code{void} mgl_data_diff (@code{HMDT} dat, @code{const char *}dir) +@end ifclear Differentiates the data in given direction or directions. @end deftypefn -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} Diff (@code{const mglData &}x, @code{const mglData &}y) -@deftypefnx {Метод класса @code{mglData} (C++, Python)} @code{void} Diff (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z) -@deftypefnx {Функция С} @code{void} mgl_data_diff_par (@code{HMDT} dat, @code{const HMDT} x, @code{const HMDT}y, @code{const HMDT}z) +@deftypefn {MGL command} {} diff dat xdat ydat [zdat=0] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Diff (@code{const mglData &}x, @code{const mglData &}y) +@deftypefnx {Method on @code{mglData}} @code{void} Diff (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z) +@deftypefnx {C function} @code{void} mgl_data_diff_par (@code{HMDT} dat, @code{HCDT} x, @code{HCDT}y, @code{HCDT}z) +@end ifclear Differentiates the data specified parametrically in direction @var{x} with @var{y}, @var{z}=constant. Parametrical differentiation uses the formula (for 2D case): @math{da/dx = (a_j*y_i-a_i*y_j)/(x_j*y_i-x_i*y_j)} where @math{a_i=da/di, a_j=da/dj} denotes usual differentiation along 1st and 2nd dimensions. The similar formula is used for 3D case. Note, that you may change the order of arguments -- for example, if you have 2D data a(i,j) which depend on coordinates @{x(i,j), y(i,j)@} then usual derivative along @samp{x} will be @code{Diff(x,y);} and usual derivative along @samp{y} will be @code{Diff(y,x);}. @end deftypefn - -@cindex Diff2 -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} Diff2 (@code{const char *}dir) -@deftypefnx {Функция С} @code{void} mgl_data_diff2 (@code{const char *}dir) +@anchor{diff2} +@deftypefn {MGL command} {} diff2 dat 'dir' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Diff2 (@code{const char *}dir) +@deftypefnx {C function} @code{void} mgl_data_diff2 (@code{const char *}dir) +@end ifclear Double-differentiates (like Laplace operator) the data in given direction. @end deftypefn -@cindex SinFFT -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} SinFFT (@code{const char *}dir) -@deftypefnx {Функция С} @code{void} mgl_data_sinfft (@code{HMDT} dat, @code{const char *}dir) +@anchor{sinfft} +@deftypefn {MGL command} {} sinfft dat 'dir' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} SinFFT (@code{const char *}dir) +@deftypefnx {C function} @code{void} mgl_data_sinfft (@code{HMDT} dat, @code{const char *}dir) +@end ifclear Do Sine transform of the data in given direction or directions. The Sine transform is @math{\sum a_i \sin(k i)}. @end deftypefn -@cindex CosFFT -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} CosFFT (@code{const char *}dir) -@deftypefnx {Функция С} @code{void} mgl_data_cosfft (@code{HMDT} dat, @code{const char *}dir) +@anchor{cosfft} +@deftypefn {MGL command} {} cosfft dat 'dir' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} CosFFT (@code{const char *}dir) +@deftypefnx {C function} @code{void} mgl_data_cosfft (@code{HMDT} dat, @code{const char *}dir) +@end ifclear Do Cosine transform of the data in given direction or directions. The Cosine transform is @math{\sum a_i \cos(k i)}. @end deftypefn -@cindex Hankel -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} Hankel (@code{const char *}dir) -@deftypefnx {Функция С} @code{void} mgl_data_hankel (@code{HMDT} dat, @code{const char *}dir) +@anchor{hankel} +@deftypefn {MGL command} {} hankel dat 'dir' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Hankel (@code{const char *}dir) +@deftypefnx {C function} @code{void} mgl_data_hankel (@code{HMDT} dat, @code{const char *}dir) +@end ifclear Do Hankel transform of the data in given direction or directions. The Hankel transform is @math{\sum a_i J_0(k i)}. @end deftypefn - -@cindex Swap -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} Swap (@code{const char *}dir) -@deftypefnx {Функция С} @code{void} mgl_data_swap (@code{HMDT} dat, @code{const char *}dir) +@anchor{swap} +@deftypefn {MGL command} {} swap dat 'dir' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Swap (@code{const char *}dir) +@deftypefnx {C function} @code{void} mgl_data_swap (@code{HMDT} dat, @code{const char *}dir) +@end ifclear Swaps the left and right part of the data in given direction (useful for Fourier spectrum). @end deftypefn -@cindex Roll -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} Roll (@code{char} dir, @code{num}) -@deftypefnx {Функция С} @code{void} mgl_data_roll (@code{HMDT} dat, @code{char} dir, @code{num}) +@anchor{roll} +@deftypefn {MGL command} {} roll dat 'dir' num +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Roll (@code{char} dir, @code{num}) +@deftypefnx {C function} @code{void} mgl_data_roll (@code{HMDT} dat, @code{char} dir, @code{num}) +@end ifclear Rolls the data along direction @var{dir}. Resulting array will be out[i] = ini[(i+num)%nx] if @code{dir='x'}. @end deftypefn -@cindex Mirror -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} Mirror (@code{const char *}dir) -@deftypefnx {Функция С} @code{void} mgl_data_mirror (@code{HMDT} dat, @code{const char *}dir) -Mirror the left-to-right part of the data in given direction. Looks like change the value index @var{i}->@var{n-i}. +@anchor{mirror} +@deftypefn {MGL command} {} mirror dat 'dir' +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Mirror (@code{const char *}dir) +@deftypefnx {C function} @code{void} mgl_data_mirror (@code{HMDT} dat, @code{const char *}dir) +@end ifclear +Mirror the left-to-right part of the data in given direction. Looks like change the value index @var{i}->@var{n-i}. Note, that the similar effect in graphics you can reach by using options (@pxref{Command options}), for example, @code{surf dat; xrange 1 -1}. @end deftypefn -@cindex Sew -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} Sew (@code{const char *}dir, @code{float} da=@code{2*M_PI}) -@deftypefnx {Функция С} @code{void} mgl_data_sew (@code{HMDT} dat, @code{const char *}dir, @code{float} da) +@anchor{sew} +@deftypefn {MGL command} {} sew dat ['dir'='xyz' @code{da=2*pi}] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Sew (@code{const char *}dir, @code{float} da=@code{2*M_PI}) +@deftypefnx {C function} @code{void} mgl_data_sew (@code{HMDT} dat, @code{const char *}dir, @code{float} da) +@end ifclear Remove value steps (like phase jumps after inverse trigonometric functions) with period @var{da} in given direction. @end deftypefn -@cindex Smooth -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} Smooth (@code{int} Type, @code{const char *}dir, @code{float} delta=@code{0}) -@deftypefnx {Функция С} @code{void} mgl_data_smooth (@code{HMDT} dat, @code{int} Type, @code{float} delt, @code{const char *}dirs) -Smooths the data on specified direction or directions by method @var{Type}. Now 4 methods are supported: @code{SMOOTH_NONE} does nothing for @var{delta}=0 or approaches data to zero with the step @var{delta}, @code{SMOOTH_LINE_3} linear averaging by 3 points, @code{SMOOTH_LINE_5} linear averaging by 5 points, @code{SMOOTH_QUAD_5} quadratic averaging by 5 points. Parameter @var{delta} forbids to change values of array more than @var{delta} from the original ones. String @var{dirs} specifies the dimensions which will be smoothed. It may contain characters: 'x' for 1st dimension, 'y' for 2nd dimension, 'z' for 3d dimension. -@end deftypefn -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} Smooth (@code{const char *}dir) -Smooths the data on specified direction(s). This is the same as @code{Smooth()} but argument @var{Type} is specified in string as @samp{0} for @code{SMOOTH_NONE}, @samp{3} for @code{SMOOTH_LINE_3}, @samp{5} for @code{SMOOTH_LINE_5}. If string @var{dir} don't contain digits @samp{035} then @var{Type}=@code{SMOOTH_QUAD_5} is used. +@anchor{smooth} +@deftypefn {MGL command} {} smooth data @code{type} ['dir'='xyz'] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Smooth (@code{const char *}dir=@code{"xyz"}, @code{float} delta=@code{0}) +@deftypefnx {C function} @code{void} mgl_data_smooth (@code{HMDT} dat, @code{const char *}dir, @code{float} delta) +@end ifclear +Smooths the data on specified direction or directions. Parameter @var{delta}>0 forbids to change values of array more than @var{delta} from the original ones. String @var{dirs} specifies the dimensions which will be smoothed. It may contain characters: @samp{x} for 1st dimension, @samp{y} for 2nd dimension, @samp{z} for 3d dimension. If string @var{dir} contain: @samp{0} then does nothing for @var{delta}=0 or approaches data to zero with the step @var{delta}, @samp{2} -- linear averaging over 3 points, @samp{5} -- linear averaging over 5 points. By default quadratic averaging over 5 points is used. @end deftypefn -@cindex Envelop -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} Envelop (@code{char} dir=@code{'x'}) -@deftypefnx {Функция С} @code{void} mgl_data_envelop (@code{HMDT} dat, @code{char} dir) +@anchor{envelop} +@deftypefn {MGL command} {} envelop dat ['dir'='x'] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Envelop (@code{char} dir=@code{'x'}) +@deftypefnx {C function} @code{void} mgl_data_envelop (@code{HMDT} dat, @code{char} dir) +@end ifclear Find envelop for data values along direction @var{dir}. @end deftypefn -@cindex Norm -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} Norm (@code{float} v1=@code{0}, @code{float} v2=@code{1}, @code{bool} sym=@code{false}, @code{int} dim=@code{0}) +@anchor{norm} +@deftypefn {MGL command} {} norm dat @code{v1 v2 [sym=off dim=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Norm (@code{float} v1=@code{0}, @code{float} v2=@code{1}, @code{bool} sym=@code{false}, @code{int} dim=@code{0}) +@end ifclear Normalizes the data to range [@var{v1},@var{v2}]. If flag @var{sym}=@code{true} then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. Modification will be applied only for slices >=@var{dim}. @end deftypefn -@cindex NormSl -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} NormSl (@code{float} v1=@code{0}, @code{float} v2=@code{1}, @code{char} dir=@code{'z'}, @code{bool} keep_en=@code{true}, @code{bool} sym=@code{false}) -@deftypefnx {Функция С} @code{void} mgl_data_norm_slice (@code{HMDT} dat, @code{float} v1, @code{float} v2, @code{char} dir, @code{int} keep_en, @code{int} sym) -Normalizes data slice-by-slice along direction @var{dir} the data in slices to range [@var{v1},@var{v2}]. If flag @var{sym}=@code{true} then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. If @var{keep_en} is set then maximal value of k-th slice will be limited by +@anchor{normsl} +@deftypefn {MGL command} {} normsl dat @code{v1 v2} ['dir'='z' @code{keep=on sym=off}] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} NormSl (@code{float} v1=@code{0}, @code{float} v2=@code{1}, @code{char} dir=@code{'z'}, @code{bool} keep_en=@code{true}, @code{bool} sym=@code{false}) +@deftypefnx {C function} @code{void} mgl_data_norm_slice (@code{HMDT} dat, @code{float} v1, @code{float} v2, @code{char} dir, @code{int} keep_en, @code{int} sym) +@end ifclear +Normalizes data slice-by-slice along direction @var{dir} the data in slices to range [@var{v1},@var{v2}]. If flag @var{sym}=@code{true} then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. If @var{keep_en} is set then maximal value of k-th slice will be limited by @iftex @math{\sqrt{\sum a_{ij}(k)/\sum a_{ij}(0)}}. @end iftex @@ -501,154 +778,265 @@ Normalizes data slice-by-slice along direction @var{dir} the data in slices to r @end deftypefn @c ------------------------------------------------------------------ -@node Interpolation, Informational functions, Change data, mglData class +@node Interpolation, Data information, Data changing, Data processing @section Interpolation + +MGL can use linear interpolation by @ref{subdata} command, or spline interpolation by @ref{evaluate} command. Also you can use @ref{resize} for obtaining a data array with new sizes. + +@ifclear UDAV + +However, there are much faster functions in other modes (C/C++/Fortran/Python/...). + @cindex Spline -@deftypefn {Method on @code{mglData} (C++, Python)} @code{float} Spline (@code{float} x, @code{float} y=@code{0}, @code{float} z=@code{0}) @code{const} -@deftypefnx {C function} @code{float} mgl_data_spline (@code{const HMDT} dat, @code{float} x, @code{float} y, @code{float} z) +@deftypefn {Method on @code{mglData}} @code{float} Spline (@code{float} x, @code{float} y=@code{0}, @code{float} z=@code{0}) @code{const} +@deftypefnx {C function} @code{float} mgl_data_spline (@code{HCDT} dat, @code{float} x, @code{float} y, @code{float} z) Interpolates data by cubic spline to the given point @var{x} in [0...nx-1], @var{y} in [0...ny-1], @var{z} in [0...nz-1]. @end deftypefn @cindex Spline1 -@deftypefn {Method on @code{mglData} (C++, Python)} @code{float} Spline1 (@code{float} x, @code{float} y=@code{0}, @code{float} z=@code{0}) @code{const} -@deftypefnx {C function} @code{float} mgl_data_spline1 (@code{const HMDT} dat, @code{float} x, @code{float} y, @code{float} z) +@deftypefn {Method on @code{mglData}} @code{float} Spline1 (@code{float} x, @code{float} y=@code{0}, @code{float} z=@code{0}) @code{const} Interpolates data by cubic spline to the given point @var{x}, @var{y}, @var{z} which assumed to be normalized in range [0, 1]. @end deftypefn @cindex Linear -@deftypefn {Method on @code{mglData} (C++, Python)} @code{float} Linear (@code{float} x, @code{float} y=@code{0}, @code{float} z=@code{0}) @code{const} -@deftypefnx {C function} @code{float} mgl_data_linear (@code{const HMDT} dat, @code{float} x, @code{float} y, @code{float} z) +@deftypefn {Method on @code{mglData}} @code{float} Linear (@code{float} x, @code{float} y=@code{0}, @code{float} z=@code{0}) @code{const} +@deftypefnx {C function} @code{float} mgl_data_linear (@code{HCDT} dat, @code{float} x, @code{float} y, @code{float} z) Interpolates data by linear function to the given point @var{x} in [0...nx-1], @var{y} in [0...ny-1], @var{z} in [0...nz-1]. @end deftypefn @cindex Linear1 -@deftypefn {Method on @code{mglData} (C++, Python)} @code{float} Linear1 (@code{float} x, @code{float} y=@code{0}, @code{float} z=@code{0}) @code{const} -@deftypefnx {C function} @code{float} mgl_data_linear1 (@code{const HMDT} dat, @code{float} x, @code{float} y, @code{float} z) +@deftypefn {Method on @code{mglData}} @code{float} Linear1 (@code{float} x, @code{float} y=@code{0}, @code{float} z=@code{0}) @code{const} Interpolates data by linear function to the given point @var{x}, @var{y}, @var{z} which assumed to be normalized in range [0, 1]. @end deftypefn -@cindex v -@deftypefn {Method on @code{mglData} (C++, Python)} @code{float} v (@code{int} i, @code{int} j=@code{0}, @code{int} k=@code{0}) @code{const} -@deftypefnx {C function} @code{float} mgl_data_get_value (@code{const HMDT} dat, @code{int} i, @code{int} j, @code{int} k) -Gets the value in specified cell of the data with border checking. -@end deftypefn -@cindex Spline5 -@deftypefn {Method on @code{mglData} (C++, Python)} @code{float} Spline5 (@code{float} x, @code{float} y, @code{float} z, @code{float} &dx, @code{float} &dy, @code{float} &dz) @code{const} -Interpolate by 5-th order splain the data to given point @var{x}, @var{y}, @var{z} which normalized in range [0, 1] and evaluate its derivatives. -@end deftypefn -@deftypefn {C function} @code{float *} mgl_data_value (@code{HMDT} dat, @code{int} i, @code{int} j, @code{int} k) -Gets the pointer to data element. -@end deftypefn -@deftypefn {C function} @code{const float *} mgl_data_data (@code{const HMDT} dat) -Gets the pointer to internal data array. -@end deftypefn +@end ifclear @c ------------------------------------------------------------------ -@node Informational functions, Operators, Interpolation, mglData class -@section Informational functions +@node Data information, Operators, Interpolation, Data processing +@section Data information + +There are not so many functions for obtaining data properties in MGL language. However most of them can be found using "suffixes". Suffix can get some numerical value of the data array (like its size, maximal or minimal value, the sum of elements and so on) as number. Later it can be used as usual number in command arguments. The suffixes start from point @samp{.} right after (without spaces) variable name or its sub-array. For example, @code{a.nx} give the x-size of data @var{a}, @code{b(1).max} give maximal value of second row of variable @var{b}, @code{(c(:,0)^2).sum} give the sum of squares of elements in the first column of @var{c} and so on. + + @cindex PrintInfo -@deftypefn {Метод класса @code{mglData} (C++)} @code{void} PrintInfo (@code{char *}buf, @code{bool} all=@code{false}) @code{const} -Print information about the data (sizes and momentum) to string @var{buf}. Parameter @var{all} set to print most of information (if @code{true}) or just basic one like dimensions, maximal an minimal values. +@anchor{info} +@deftypefn {MGL command} {} info dat +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{const char *} PrintInfo () @code{const} +@deftypefnx {Method on @code{mglData}} @code{void} PrintInfo (@code{FILE *}fp) @code{const} +@deftypefnx {C function} @code{const char *} mgl_data_info (@code{HCDT} dat) +@end ifclear +Gets or prints to file @var{fp} or as message (in MGL) information about the data (sizes, maximum/minimum, momentums and so on). @end deftypefn -@deftypefn {Метод класса @code{mglData} (C++)} @code{void} PrintInfo (@code{FILE *}fp) @code{const} -Print information about the data (sizes and momentum) to FILE (for example, stdout). + +@deftypefn {MGL command} {} info 'txt' +Prints string @var{txt} as message. +@end deftypefn + +@cindex GetNx +@cindex GetNy +@cindex GetNz +@anchor{.nx} @anchor{.ny} @anchor{.nz} +@deftypefn {MGL suffix} {(dat)} .nx +@deftypefnx {MGL suffix} {(dat)} .ny +@deftypefnx {MGL suffix} {(dat)} .nz +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{long} GetNx () +@deftypefnx {Method on @code{mglData}} @code{long} GetNy () +@deftypefnx {Method on @code{mglData}} @code{long} GetNz () +@deftypefnx {C function} @code{long} mgl_data_get_nx (@code{HCDT} dat) +@deftypefnx {C function} @code{long} mgl_data_get_ny (@code{HCDT} dat) +@deftypefnx {C function} @code{long} mgl_data_get_nz (@code{HCDT} dat) +@end ifclear +Gets the x-, y-, z-size of the data. @end deftypefn + + @cindex Maximal -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{float} Maximal () @code{const} -@deftypefnx {Функция С} @code{float} mgl_data_max (@code{const HMDT} dat) +@anchor{.max} +@deftypefn {MGL suffix} {(dat)} .max +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{float} Maximal () @code{const} +@deftypefnx {C function} @code{float} mgl_data_max (@code{HCDT} dat) +@end ifclear Gets maximal value of the data. @end deftypefn + @cindex Minimal -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{float} Minimal () @code{const} -@deftypefnx {Функция С} @code{float} mgl_data_min (@code{HMDT} dat) @code{const} +@anchor{.min} +@deftypefn {MGL suffix} {(dat)} .min +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{float} Minimal () @code{const} +@deftypefnx {C function} @code{float} mgl_data_min (@code{HMDT} dat) @code{const} +@end ifclear Gets minimal value of the data. @end deftypefn -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{float} Maximal (@code{int} &i, @code{int} &j, @code{int} &k) @code{const} -@deftypefnx {Функция С} @code{float} mgl_data_max_int (@code{const HMDT} dat, @code{int} *i, @code{int} *j, @code{int} *k) -Gets maximal value of the data and its position in the array to variables @var{i}, @var{j}, @var{k}. -@end deftypefn -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{float} Minimal (@code{int} &i, @code{int} &j, @code{int} &k) @code{const} -@deftypefnx {Функция С} @code{float} mgl_data_min_int (@code{const HMDT} dat, @code{int} *i, @code{int} *j, @code{int} *k) -Gets minimal value of the data and its position in the array to variables @var{i}, @var{j}, @var{k}. +@ifclear UDAV +@deftypefn {Method on @code{mglData}} @code{float} Minimal (@code{int} &i, @code{int} &j, @code{int} &k) @code{const} +@deftypefnx {C function} @code{float} mgl_data_min_int (@code{HCDT} dat, @code{int} *i, @code{int} *j, @code{int} *k) +Gets position of minimum to variables @var{i}, @var{j}, @var{k} and returns the minimal value. @end deftypefn -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{float} Maximal (@code{float} &i, @code{float} &j, @code{float} &k) @code{const} -@deftypefnx {Функция С} @code{float} mgl_data_max_real (@code{const HMDT} dat, @code{float} *x, @code{float} *y, @code{float} *z) -Gets maximal value of the data and its approximated (interpolated) position to variables @var{i}, @var{j}, @var{k}. +@deftypefn {Method on @code{mglData}} @code{float} Maximal (@code{int} &i, @code{int} &j, @code{int} &k) @code{const} +@deftypefnx {C function} @code{float} mgl_data_max_int (@code{HCDT} dat, @code{int} *i, @code{int} *j, @code{int} *k) +Gets position of maximum to variables @var{i}, @var{j}, @var{k} and returns the maximal value. @end deftypefn -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{float} Minimal (@code{float} &i, @code{float} &j, @code{float} &k) @code{const} -@deftypefnx {Функция С} @code{float} mgl_data_min_real (@code{const HMDT} dat, @code{float} *x, @code{float} *y, @code{float} *z) -Gets minimal value of the data and its approximated (interpolated) position to variables @var{i}, @var{j}, @var{k}. +@deftypefn {Method on @code{mglData}} @code{float} Minimal (@code{float} &i, @code{float} &j, @code{float} &k) @code{const} +@deftypefnx {C function} @code{float} mgl_data_min_real (@code{HCDT} dat, @code{float} *x, @code{float} *y, @code{float} *z) +Gets approximated (interpolated) position of minimum to variables @var{i}, @var{j}, @var{k} and returns the minimal value. @end deftypefn +@end ifclear -@cindex Momentum -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{float} Momentum (@code{char} dir, @code{float} &m, @code{float} &w) @code{const} -@deftypefnx {Функция С} @code{float} mgl_data_momentum_mw (@code{const HMDT} dat, @code{char} dir, @code{float} *m, @code{float} *w) -Gets zero-momentum (energy, @math{I=\sum a_i}) and write first momentum (median, @math{m = \sum \xi_i a_i/I}) and second momentum (width, @math{w^2 = \sum (\xi_i-m)^2 a_i/I}) to variables. Here @math{\xi} is corresponding coordinate if @var{dir} is @samp{'x'}, @samp{'y'} or @samp{'z'}. Otherwise median is @math{m = \sum a_i/N}, width is @math{w^2 = \sum (a_i-m)^2/N}. -@end deftypefn -@deftypefn {Метод класса @code{mglData} (C++)} @code{float} Momentum (@code{char} dir, @code{float} &m, @code{float} &w, @code{float} &s, @code{float} &k) @code{const} -Gets zero-momentum (energy, @math{I=\sum a_i}) and write first momentum (median, @math{m = \sum \xi_i a_i/I}), second momentum (width, @math{w^2 = \sum (\xi_i-m)^2 a_i/I}), third momentum (skewness, @math{s = \sum (\xi_i-m)^3 a_i/ I w^3}) and fourth momentum (kurtosis, @math{k = \sum (\xi_i-m)^4 a_i / 3 I w^4}) to variables. Here @math{\xi} is corresponding coordinate if @var{dir} is @samp{'x'}, @samp{'y'} or @samp{'z'}. Otherwise median is @math{m = \sum a_i/N}, width is @math{w^2 = \sum (a_i-m)^2/N} and so on. +@anchor{.mx} @anchor{.my} @anchor{.mz} +@deftypefn {MGL suffix} {(dat)} .mx +@deftypefnx {MGL suffix} {(dat)} .my +@deftypefnx {MGL suffix} {(dat)} .mz +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{float} Maximal (@code{float} &i, @code{float} &j, @code{float} &k) @code{const} +@deftypefnx {C function} @code{float} mgl_data_max_real (@code{HCDT} dat, @code{float} *x, @code{float} *y, @code{float} *z) +@end ifclear +Gets approximated (interpolated) position of maximum to variables @var{i}, @var{j}, @var{k} and returns the maximal value. @end deftypefn + +@cindex Momentum +@anchor{.ax} @anchor{.ay} @anchor{.az} @anchor{.aa} @anchor{.sum} +@anchor{.wx} @anchor{.wy} @anchor{.wz} @anchor{.wa} +@anchor{.sx} @anchor{.sy} @anchor{.sz} @anchor{.sa} +@anchor{.kx} @anchor{.ky} @anchor{.kz} @anchor{.ka} +@deftypefn {MGL suffix} {(dat)} .sum +@deftypefnx {MGL suffix} {(dat)} .ax +@deftypefnx {MGL suffix} {(dat)} .ay +@deftypefnx {MGL suffix} {(dat)} .az +@deftypefnx {MGL suffix} {(dat)} .aa +@deftypefnx {MGL suffix} {(dat)} .wx +@deftypefnx {MGL suffix} {(dat)} .wy +@deftypefnx {MGL suffix} {(dat)} .wz +@deftypefnx {MGL suffix} {(dat)} .wa +@deftypefnx {MGL suffix} {(dat)} .sx +@deftypefnx {MGL suffix} {(dat)} .sy +@deftypefnx {MGL suffix} {(dat)} .sz +@deftypefnx {MGL suffix} {(dat)} .sa +@deftypefnx {MGL suffix} {(dat)} .kx +@deftypefnx {MGL suffix} {(dat)} .ky +@deftypefnx {MGL suffix} {(dat)} .kz +@deftypefnx {MGL suffix} {(dat)} .ka +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{float} Momentum (@code{char} dir, @code{float} &a, @code{float} &w) @code{const} +@deftypefnx {Method on @code{mglData}} @code{float} Momentum (@code{char} dir, @code{float} &m, @code{float} &w, @code{float} &s, @code{float} &k) @code{const} +@deftypefnx {C function} @code{float} mgl_data_momentum_val (@code{HCDT} dat, @code{char} dir, @code{float} *a, @code{float} *w, @code{float} *s, @code{float} *k) +@end ifclear +Gets zero-momentum (energy, @math{I=\sum dat_i}) and write first momentum (median, @math{a = \sum \xi_i dat_i/I}), second momentum (width, @math{w^2 = \sum (\xi_i-a)^2 dat_i/I}), third momentum (skewness, @math{s = \sum (\xi_i-a)^3 dat_i/ I w^3}) and fourth momentum (kurtosis, @math{k = \sum (\xi_i-a)^4 dat_i / 3 I w^4}) to variables. Here @math{\xi} is corresponding coordinate if @var{dir} is @samp{'x'}, @samp{'y'} or @samp{'z'}. Otherwise median is @math{a = \sum dat_i/N}, width is @math{w^2 = \sum (dat_i-a)^2/N} and so on. +@end deftypefn + +@ifclear UDAV @cindex Find -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{float} Find (@code{const char *}cond, @code{int} &i, @code{int} &j, @code{int} &k) @code{const} -@deftypefnx {Функция С} @code{float} mgl_data_first (@code{const HMDT} dat, @code{const char *}cond, @code{int} *i, @code{int} *j, @code{int} *k) +@deftypefn {Method on @code{mglData}} @code{float} Find (@code{const char *}cond, @code{int} &i, @code{int} &j, @code{int} &k) @code{const} +@deftypefnx {C function} @code{float} mgl_data_first (@code{HCDT} dat, @code{const char *}cond, @code{int} *i, @code{int} *j, @code{int} *k) Find position (after specified in @var{i}, @var{j}, @var{k}) of first nonzero value of formula @var{cond}. Function return the data value at found position. @end deftypefn @cindex Last -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{float} Last (@code{const char *}cond, @code{int} &i, @code{int} &j, @code{int} &k) @code{const} -@deftypefnx {Функция С} @code{float} mgl_data_last (@code{const HMDT} dat, @code{const char *}cond, @code{int} *i, @code{int} *j, @code{int} *k) +@deftypefn {Method on @code{mglData}} @code{float} Last (@code{const char *}cond, @code{int} &i, @code{int} &j, @code{int} &k) @code{const} +@deftypefnx {C function} @code{float} mgl_data_last (@code{HCDT} dat, @code{const char *}cond, @code{int} *i, @code{int} *j, @code{int} *k) Find position (before specified in @var{i}, @var{j}, @var{k}) of last nonzero value of formula @var{cond}. Function return the data value at found position. @end deftypefn -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{int} Find (@code{const char *}cond, @code{char} dir, @code{int} i=@code{0}, @code{int} j=@code{0}, @code{int} k=@code{0}) @code{const} -@deftypefnx {Функция С} @code{float} mgl_data_find (@code{const HMDT} dat, @code{const char *}cond, @code{int} i, @code{int} j, @code{int} k) +@deftypefn {Method on @code{mglData}} @code{int} Find (@code{const char *}cond, @code{char} dir, @code{int} i=@code{0}, @code{int} j=@code{0}, @code{int} k=@code{0}) @code{const} +@deftypefnx {C function} @code{float} mgl_data_find (@code{HCDT} dat, @code{const char *}cond, @code{int} i, @code{int} j, @code{int} k) Return position of first in direction @var{dir} nonzero value of formula @var{cond}. The search is started from point @{i,j,k@}. @end deftypefn @cindex FindAny -@deftypefn {Метод класса @code{mglData} (C++, Python)} @code{bool} FindAny (@code{const char *}cond) @code{const} -@deftypefnx {Функция С} @code{float} mgl_data_find_any (@code{const HMDT} dat, @code{const char *}cond) +@deftypefn {Method on @code{mglData}} @code{bool} FindAny (@code{const char *}cond) @code{const} +@deftypefnx {C function} @code{float} mgl_data_find_any (@code{HCDT} dat, @code{const char *}cond) Determines if any nonzero value of formula in the data array. @end deftypefn +@end ifclear + +@anchor{.a} @anchor{.fst} @anchor{.lst} +@deftypefn {MGL suffix} {(dat)} .a +@deftypefnx {MGL suffix} {(dat)} .fst +@deftypefnx {MGL suffix} {(dat)} .lst +Give first (for @code{.a}, i.e. @code{dat->a[0]}), first nonzero (for @code{.fst}) or last nonzero (for @code{.lst}) value of data array. +@end deftypefn + @c ------------------------------------------------------------------ -@node Operators, Global functions, Informational functions, mglData class +@node Operators, Global functions, Data information, Data processing @section Operators -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} operator= (@code{const mglData &}d) +@deftypefn {MGL command} {} copy @sc{dat} dat2 ['eq'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} operator= (@code{const mglData &}d) +@end ifclear Copies data from other variable. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} operator*= (@code{const mglData &}d) -@deftypefnx {C function} @code{void} mgl_data_mul_dat (@code{HMDT} dat, @code{const HMDT} d) + +@anchor{multo} +@deftypefn {MGL command} {} multo dat dat2 +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} operator*= (@code{const mglData &}d) +@deftypefnx {C function} @code{void} mgl_data_mul_dat (@code{HMDT} dat, @code{HCDT} d) +@end ifclear Multiplies the data by the other one for each element. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} operator/= (@code{const mglData &}d) -@deftypefnx {C function} @code{void} mgl_data_div_dat (@code{HMDT} dat, @code{const HMDT} d) -Divides the data by the other one for each element. -@end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} operator+= (@code{const mglData &}d) -@deftypefnx {C function} @code{void} mgl_data_add_dat (@code{HMDT} dat, @code{const HMDT} d) -Adds the other data. -@end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} operator-= (@code{const mglData &}d) -@deftypefnx {C function} @code{void} mgl_data_sub_dat (@code{HMDT} dat, @code{const HMDT} d) -Subtracts the other data. -@end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} operator*= (@code{float} d) + +@deftypefn {MGL command} {} multo dat @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} operator*= (@code{float} d) @deftypefnx {C function} @code{void} mgl_data_mul_num (@code{HMDT} dat, @code{float} d) +@end ifclear Multiplies each element by the number. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} operator/= (@code{float} d) + +@anchor{divto} +@deftypefn {MGL command} {} divto dat dat2 +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} operator/= (@code{const mglData &}d) +@deftypefnx {C function} @code{void} mgl_data_div_dat (@code{HMDT} dat, @code{HCDT} d) +@end ifclear +Divides the data by the other one for each element. +@end deftypefn + +@deftypefn {MGL command} {} divto dat @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} operator/= (@code{float} d) @deftypefnx {C function} @code{void} mgl_data_div_num (@code{HMDT} dat, @code{float} d) +@end ifclear Divides each element by the number. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} operator+= (@code{float} d) + +@anchor{addto} +@deftypefn {MGL command} {} addto dat dat2 +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} operator+= (@code{const mglData &}d) +@deftypefnx {C function} @code{void} mgl_data_add_dat (@code{HMDT} dat, @code{HCDT} d) +@end ifclear +Adds the other data. +@end deftypefn + +@deftypefn {MGL command} {} addto dat @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} operator+= (@code{float} d) @deftypefnx {C function} @code{void} mgl_data_add_num (@code{HMDT} dat, @code{float} d) +@end ifclear Adds the number to each element. @end deftypefn -@deftypefn {Method on @code{mglData} (C++, Python)} @code{void} operator-= (@code{float} d) + +@anchor{subto} +@deftypefn {MGL command} {} subto dat dat2 +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} operator-= (@code{const mglData &}d) +@deftypefnx {C function} @code{void} mgl_data_sub_dat (@code{HMDT} dat, @code{HCDT} d) +@end ifclear +Subtracts the other data. +@end deftypefn + +@deftypefn {MGL command} {} subto dat @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} operator-= (@code{float} d) @deftypefnx {C function} @code{void} mgl_data_sub_num (@code{HMDT} dat, @code{float} d) +@end ifclear Subtracts the number to each element. @end deftypefn - +@ifclear UDAV @deftypefn {Library Function} mglData operator+ (@code{const mglData &}a, @code{const mglData &}b) Adds the other data. @end deftypefn @@ -685,47 +1073,88 @@ Divides by the other data. @deftypefn {Library Function} mglData operator/ (@code{const mglData &}a, @code{float} b) Divides by the number. @end deftypefn +@end ifclear @c ------------------------------------------------------------------ -@node Global functions, , Operators, mglData class +@node Global functions, , Operators, Data processing @section Global functions -These functions are not methods of @code{mglData} class. However it have additional functionality to handle data. So I put it in this chapter. +These functions are not methods of @code{mglData} class. However it provide additional functionality to handle data. So I put it in this chapter. -@deftypefn {Global function} @code{mglData} mglTransform (@code{const mglData &}real, @code{const mglData &}imag, @code{const char *}type) -@deftypefnx {C function} @code{HMDT} mgl_transform (@code{const HMDT} real, @code{const HMDT} imag, @code{const char *}type) +@anchor{transform} +@deftypefn {MGL command} {} transform @sc{dat} 'type' real imag +@ifclear UDAV +@deftypefnx {Global function} @code{mglData} mglTransform (@code{const mglData &}real, @code{const mglData &}imag, @code{const char *}type) +@deftypefnx {C function} @code{HMDT} mgl_transform (@code{HCDT} real, @code{HCDT} imag, @code{const char *}type) +@end ifclear Do integral transformation of complex data @var{real}, @var{imag} on specified direction. The order of transformations is specified in string @var{type}: first character for x-dimension, second one for y-dimension, third one for z-dimension. The possible character are: @samp{f} is forward Fourier transformation, @samp{i} is inverse Fourier transformation, @samp{s} is Sine transform, @samp{c} is Cosine transform, @samp{h} is Hankel transform, @samp{n} or @samp{ } is no transformation. @end deftypefn -@deftypefn {Global function} @code{mglData} mglTransformA @code{const mglData &}ampl, @code{const mglData &}phase, @code{const char *}type) -@deftypefnx {C function} @code{HMDT} mgl_transform_a @code{const HMDT} ampl, @code{const HMDT} phase, @code{const char *}type) +@anchor{transforma} +@deftypefn {MGL command} {} transforma @sc{dat} 'type' ampl phase +@ifclear UDAV +@deftypefnx {Global function} @code{mglData} mglTransformA @code{const mglData &}ampl, @code{const mglData &}phase, @code{const char *}type) +@deftypefnx {C function} @code{HMDT} mgl_transform_a @code{HCDT} ampl, @code{HCDT} phase, @code{const char *}type) +@end ifclear The same as previous but with specified amplitude @var{ampl} and phase @var{phase} of complex numbers. @end deftypefn -@deftypefn {Global function} @code{mglData} mglSTFA (@code{const mglData &}real, @code{const mglData &}imag, @code{int} dn, @code{char} dir=@code{'x'}) -@deftypefnx {C function} @code{HMDT} mgl_data_stfa (@code{const HMDT} real, @code{const HMDT} imag, @code{int} dn,@code{char} dir) +@anchor{stfad} +@deftypefn {MGL command} {} stfad @sc{res} real imag @code{dn} ['dir'='x'] +@ifclear UDAV +@deftypefnx {Global function} @code{mglData} mglSTFA (@code{const mglData &}real, @code{const mglData &}imag, @code{int} dn, @code{char} dir=@code{'x'}) +@deftypefnx {C function} @code{HMDT} mgl_data_stfa (@code{HCDT} real, @code{HCDT} imag, @code{int} dn,@code{char} dir) +@end ifclear Short time Fourier transformation for real and imaginary parts. Output is amplitude of partial Fourier of length @var{dn}. For example if @var{dir}=@samp{x}, result will have size @{int(nx/dn), dn, ny@} and it will contain @math{res[i,j,k]=|\sum_d^dn exp(I*j*d)*(real[i*dn+d,k]+I*imag[i*dn+d,k])|/dn}. @end deftypefn -@deftypefn {Global function} @code{mglData} mglPDE (@code{const char *}ham, @code{const mglData &}ini_re, @code{const mglData &}ini_im, @code{mglPoint} Min, @code{mglPoint} Max, @code{float} dz=@code{0.1}, @code{float} k0=@code{100}) -@deftypefnx {C function} @code{HMDT} mgl_pde_solve (@code{HMGL} gr, @code{const char *}ham, @code{const HMDT} ini_re, @code{const HMDT} ini_im, @code{float} dz, @code{float} k0) +@anchor{pde} +@deftypefn {MGL command} {} pde @sc{res} 'ham' ini_re ini_im [@code{dz=0.1 k0=100}] +@ifclear UDAV +@deftypefnx {Global function} @code{mglData} mglPDE (@code{HMGL} gr, @code{const char *}ham, @code{const mglData &}ini_re, @code{const mglData &}ini_im, @code{float} dz=@code{0.1}, @code{float} k0=@code{100}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{HMDT} mgl_pde_solve (@code{HMGL} gr, @code{const char *}ham, @code{HCDT} ini_re, @code{HCDT} ini_im, @code{float} dz, @code{float} k0, @code{const char *}opt) +@end ifclear Solves equation du/dz = i*k0*@var{ham}(p,q,x,y,z,|u|)[u], where p=-i/k0*d/dx, q=-i/k0*d/dy are pseudo-differential operators. Parameters @var{ini_re}, @var{ini_im} specify real and imaginary part of initial field distribution. Parameters @var{Min}, @var{Max} set the bounding box for the solution. Note, that really this ranges are increased by factor 3/2 for purpose of reducing reflection from boundaries. Parameter @var{dz} set the step along evolutionary coordinate z. At this moment, simplified form of function @var{ham} is supported -- all ``mixed'' terms (like @samp{x*p}->x*d/dx) are excluded. For example, in 2D case this function is effectively @math{ham = f(p,z) + g(x,z,u)}. However commutable combinations (like @samp{x*q}->x*d/dy) are allowed. Here variable @samp{u} is used for field amplitude |u|. This allow one solve nonlinear problems -- for example, for nonlinear Shrodinger equation you may set @code{ham="p^2 + q^2 - u^2"}. You may specify imaginary part for wave absorption, like @code{ham = "p^2 + i*x*(x>0)"}, but only if dependence on variable @samp{i} is linear (i.e. @math{ham = hre+i*him}). @sref{PDE sample} @sref{PDE sample} @end deftypefn -@deftypefn {Global function} @code{mglData} mglRay (@code{const char *}ham, @code{mglPoint} r0, @code{mglPoint} p0, @code{float} dt=@code{0.1}, @code{float} tmax=@code{10}) +@anchor{ray} +@deftypefn {MGL command} {} ray @sc{res} 'ham' @code{x0 y0 z0 p0 q0 v0 [dt=0.1 tmax=10]} +@ifclear UDAV +@deftypefnx {Global function} @code{mglData} mglRay (@code{const char *}ham, @code{mglPoint} r0, @code{mglPoint} p0, @code{float} dt=@code{0.1}, @code{float} tmax=@code{10}) @deftypefnx {C function} @code{HMDT} mgl_ray_trace (@code{const char *}ham, @code{float} x0, @code{float} y0, @code{float} z0, @code{float} px, @code{float} py, @code{float} pz, @code{float} dt, @code{float} tmax) +@end ifclear Solves GO ray equation like dr/dt = d @var{ham}/dp, dp/dt = -d @var{ham}/dr. This is Hamiltonian equations for particle trajectory in 3D case. Here @var{ham} is Hamiltonian which may depend on coordinates @samp{x}, @samp{y}, @samp{z}, momentums @samp{p}=px, @samp{q}=py, @samp{v}=pz and time @samp{t}: @math{ham = H(x,y,z,p,q,v,t)}. The starting point (at @code{t=0}) is defined by variables @var{r0}, @var{p0}. Parameters @var{dt} and @var{tmax} specify the integration step and maximal time for ray tracing. Result is array of @{x,y,z,p,q,v,t@} with dimensions @{7 * int(@var{tmax}/@var{dt}+1) @}. @sref{Beam tracing sample} @end deftypefn -@deftypefn {Global function} @code{mglData} mglQO2d (@code{const char *}ham, @code{const mglData &}ini_re, @code{const mglData &}ini_im, @code{const mglData &}ray, @code{float} r=@code{1}, @code{float} k0=@code{100}, @code{mglData *}xx=@code{0}, @code{mglData *}yy=@code{0}, @code{bool} UseR=@code{true}) -@deftypefnx {C function} @code{HMDT} mgl_qo2d_solve (@code{const char *}ham, @code{const HMDT} ini_re, @code{const HMDT} ini_im, @code{const HMDT} ray, @code{float} r, @code{float} k0, @code{HMDT} xx, @code{HMDT} yy) -Solves equation du/dt = i*k0*@var{ham}(p,q,x,y,|u|)[u], where p=-i/k0*d/dx, q=-i/k0*d/dy are pseudo-differential operators (see @code{mglPDE()} for details). Parameters @var{ini_re}, @var{ini_im} specify real and imaginary part of initial field distribution. Parameters @var{ray} set the reference ray, i.e. the ray around which the accompanied coordinate system will be maked. You may use, for example, the array created by @code{mglRay()} function. Note, that the reference ray @strong{must be} smooth enough to make accompanied coodrinates unambiguity. Otherwise errors in the solution may appear. If @var{xx} and @var{yy} are non-zero then Cartesian coordinates for each point will be written into them. See also @code{mglPDE()}. @sref{Beam tracing sample} +@anchor{qo2d} +@deftypefn {MGL command} {} qo2d @sc{res} 'ham' ini_re ini_im ray [@code{r=1 k0=100} xx yy] +@ifclear UDAV +@deftypefnx {Global function} @code{mglData} mglQO2d (@code{const char *}ham, @code{const mglData &}ini_re, @code{const mglData &}ini_im, @code{const mglData &}ray, @code{float} r=@code{1}, @code{float} k0=@code{100}, @code{mglData *}xx=@code{0}, @code{mglData *}yy=@code{0}) +@deftypefnx {Global function} @code{mglData} mglQO2d (@code{const char *}ham, @code{const mglData &}ini_re, @code{const mglData &}ini_im, @code{const mglData &}ray, @code{mglData &}xx, @code{mglData &}yy, @code{float} r=@code{1}, @code{float} k0=@code{100}) +@deftypefnx {C function} @code{HMDT} mgl_qo2d_solve (@code{const char *}ham, @code{HCDT} ini_re, @code{HCDT} ini_im, @code{HCDT} ray, @code{float} r, @code{float} k0, @code{HMDT} xx, @code{HMDT} yy) +@end ifclear +Solves equation du/dt = i*k0*@var{ham}(p,q,x,y,|u|)[u], where p=-i/k0*d/dx, q=-i/k0*d/dy are pseudo-differential operators (see @code{mglPDE()} for details). Parameters @var{ini_re}, @var{ini_im} specify real and imaginary part of initial field distribution. Parameters @var{ray} set the reference ray, i.e. the ray around which the accompanied coordinate system will be maked. You may use, for example, the array created by @code{mglRay()} function. Note, that the reference ray @strong{must be} smooth enough to make accompanied coodrinates unambiguity. Otherwise errors in the solution may appear. If @var{xx} and @var{yy} are non-zero then Cartesian coordinates for each point will be written into them. See also @code{mglPDE()}. @sref{Beam tracing sample} @end deftypefn -@deftypefn {Global function} @code{mglData} mglJacobian (@code{const mglData &}x, @code{const mglData &}y) +@anchor{jacobian} +@deftypefn {MGL command} {} jacobian @sc{res} xdat ydat [zdat] +@ifclear UDAV +@deftypefnx {Global function} @code{mglData} mglJacobian (@code{const mglData &}x, @code{const mglData &}y) @deftypefnx {Global function} @code{mglData} mglJacobian (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z) -@deftypefnx {C function} @code{HMDT} mgl_jacobian_2d (@code{const HMDT} x, @code{const HMDT} y) -@deftypefnx {C function} @code{HMDT} mgl_jacobian_3d (@code{const HMDT} x, @code{const HMDT} y, @code{const HMDT} z) -Computates the Jacobian for transformation @{i,j,k@} to @{@var{x},@var{y},@var{z}@} where initial coordinates @{i,j,k@} are data indexes normalized in range [0,1]. The Jacobian is determined by formula det||@math{dr_\alpha/d\xi_\beta}|| where @math{r}=@{@var{x},@var{y},@var{z}@} and @math{\xi}=@{i,j,k@}. All dimensions must be the same for all data arrays. Data must be 3D if all 3 arrays @{@var{x},@var{y},@var{z}@} are specified or 2D if only 2 arrays @{@var{x},@var{y}@} are specified. +@deftypefnx {C function} @code{HMDT} mgl_jacobian_2d (@code{HCDT} x, @code{HCDT} y) +@deftypefnx {C function} @code{HMDT} mgl_jacobian_3d (@code{HCDT} x, @code{HCDT} y, @code{HCDT} z) +@end ifclear +Computes the Jacobian for transformation @{i,j,k@} to @{@var{x},@var{y},@var{z}@} where initial coordinates @{i,j,k@} are data indexes normalized in range [0,1]. The Jacobian is determined by formula det||@math{dr_\alpha/d\xi_\beta}|| where @math{r}=@{@var{x},@var{y},@var{z}@} and @math{\xi}=@{i,j,k@}. All dimensions must be the same for all data arrays. Data must be 3D if all 3 arrays @{@var{x},@var{y},@var{z}@} are specified or 2D if only 2 arrays @{@var{x},@var{y}@} are specified. @end deftypefn + +@anchor{triangulation} +@deftypefn {MGL command} {} triangulation @sc{res} xdat ydat [zdat] +@ifclear UDAV +@deftypefnx {Global function} @code{mglData} mglTriangulation (@code{const mglData &}x, @code{const mglData &}y) +@deftypefnx {Global function} @code{mglData} mglTriangulation (@code{const mglData &}x, @code{const mglData &}y, @code{const mglData &}z) +@deftypefnx {C function} @code{HMDT} mgl_triangulation_2d (@code{HCDT} x, @code{HCDT} y) +@deftypefnx {C function} @code{HMDT} mgl_triangulation_3d (@code{HCDT} x, @code{HCDT} y, @code{HCDT} z) +@end ifclear +Computes triangulation for arbitrary placed points with coordinates @{@var{x},@var{y},@var{z}@} (i.e. finds triangles which connect points). The sizes of 1st dimension @strong{must be equal} for all arrays @code{x.nx=y.nx=z.nx}. Resulting array can be used in @ref{triplot} or @ref{tricont} functions for visualization of reconstructed surface. +@end deftypefn diff --git a/texinfo/data_ru.texi b/texinfo/data_ru.texi index 56cbecf..e885933 100644 --- a/texinfo/data_ru.texi +++ b/texinfo/data_ru.texi @@ -4,21 +4,21 @@ Это класс для работы с массивами данных, определенный в @code{#include }. Он содержит функции для выделения памяти и изменения размера данных, чтения данных из файла, численного дифференцирования/интегрирования/интерполяции и пр., заполнения по текстовой формуле и т.д. Класс позволяет работать с данными размерности не более 3 (как функции от трех переменных -- x,y,z). По умолчанию внутреннее представление данных -- float, выбранный в силу меньшего размера занимаемой памяти и достаточной для построения графиков точности. Базовый тип можно сменить на этапе установки (@pxref{Installation and usage}) указав опцию @code{--enable-double}. Однако, в дальнейшем в документации будет использован тип @code{float}. @menu -* Public variables:: -* Create and delete:: -* Fill:: -* Rearrange:: -* File I/O:: -* Make another data:: -* Change data:: -* Interpolation:: -* Informational functions:: -* Operators:: -* Global functions:: +* Public variables:: +* Data create:: +* Fill:: +* Rearrange:: +* File I/O:: +* Make another data:: +* Change data:: +* Interpolation:: +* Informational functions:: +* Operators:: +* Global functions:: @end menu @c ------------------------------------------------------------------ -@node Public variables, Create and delete, , mglData class +@node Public variables, Data create, , Data processing @section Переменные @deftypecv {Variable} mglData @code{float *} a @@ -39,7 +39,7 @@ @c ------------------------------------------------------------------ -@node Create and delete, Fill, Public variables, mglData class +@node Data create, Fill, Public variables, Data processing @section Создание и удаление @cindex mglData @cindex Set @@ -105,7 +105,7 @@ @end deftypefn @c ------------------------------------------------------------------ -@node Fill, Rearrange, Create and delete, mglData class +@node Fill, Rearrange, Data create, Data processing @section Заполнение данных @cindex Fill @cindex Modify @@ -162,7 +162,7 @@ @end deftypefn @c ------------------------------------------------------------------ -@node Rearrange, File I/O, Fill, mglData class +@node Rearrange, File I/O, Fill, Data processing @section Изменение размеров данных @cindex Rearrange @cindex Extend @@ -246,7 +246,7 @@ a_ij^new = a_i^old where j=0...@var{n1}. Соответственно, для @v @end deftypefn @c ------------------------------------------------------------------ -@node File I/O, Make another data, Rearrange, mglData class +@node File I/O, Make another data, Rearrange, Data processing @section Чтение/сохранение данных @cindex Read @cindex ReadMat @@ -304,7 +304,7 @@ a_ij^new = a_i^old where j=0...@var{n1}. Соответственно, для @v @end deftypefn @c ------------------------------------------------------------------ -@node Make another data, Change data, File I/O, mglData class +@node Make another data, Change data, File I/O, Data processing @section Создание новых данных @cindex SubData @cindex Column @@ -400,7 +400,7 @@ res_k = \sum_ij how(x_i,y_j,z_k) a_ij/ \sum_ij a_ij @end deftypefn @c ------------------------------------------------------------------ -@node Change data, Interpolation, Make another data, mglData class +@node Change data, Interpolation, Make another data, Data processing @section Изменение данных Эти функции изменяют данные вдоль заданного направления(ий) типа например дифференцирования, интегрирования и т.д. Направление указывается строкой @var{dir}, которая может содержать символы @samp{x}, @samp{y} и/или @samp{z}, вдоль которых изменения будут применены. @@ -512,7 +512,7 @@ Smooths the data on specified direction(s). This is the same as @code{Smooth()} @end deftypefn @c ------------------------------------------------------------------ -@node Interpolation, Informational functions, Change data, mglData class +@node Interpolation, Informational functions, Change data, Data processing @section Интерполяция @cindex Spline @deftypefn {Method on @code{mglData} (C++, Python)} @code{float} Spline (@code{float} x, @code{float} y=@code{0}, @code{float} z=@code{0}) @code{const} @@ -552,7 +552,7 @@ Smooths the data on specified direction(s). This is the same as @code{Smooth()} @end deftypefn @c ------------------------------------------------------------------ -@node Informational functions, Operators, Interpolation, mglData class +@node Informational functions, Operators, Interpolation, Data processing @section Информационные функции @cindex PrintInfo @deftypefn {Метод класса @code{mglData} (C++)} @code{void} PrintInfo (@code{char *}buf, @code{bool} all=@code{false}) @code{const} @@ -620,7 +620,7 @@ Smooths the data on specified direction(s). This is the same as @code{Smooth()} @end deftypefn @c ------------------------------------------------------------------ -@node Operators, Global functions, Informational functions, mglData class +@node Operators, Global functions, Informational functions, Data processing @section Операторы @deftypefn {Метод класса @code{mglData} (C++, Python)} @code{void} operator= (@code{const mglData &}d) @@ -693,7 +693,7 @@ Adds the other data. @end deftypefn @c ------------------------------------------------------------------ -@node Global functions, , Operators, mglData class +@node Global functions, , Operators, Data processing @section Глобальные функции Эти функции не методы класса @code{mglData}, но они дают дополнительные возможности по обработке данных. Поэтому я поместил их в эту главу. diff --git a/texinfo/ex_mgl_en.texi b/texinfo/ex_mgl_en.texi index 5dab290..3e3bb50 100644 --- a/texinfo/ex_mgl_en.texi +++ b/texinfo/ex_mgl_en.texi @@ -210,11 +210,11 @@ text 0 0 '\sqrt{\frac{\alpha^{\gamma^2}+\overset 1{\big\infty}}{\sqrt3{2+b}}}', @menu * Array creation:: -* Data changing:: +* Change data:: @end menu @c ------------------------------------------------------------------ -@node Array creation, Data changing, , Data handling +@node Array creation, Change data, , Data handling @subsection Array creation One can put numbers into the data instance by several ways. Let us do it for sinus function: @@ -288,8 +288,8 @@ or loaded from file. The only non-obvious thing here is using multidimensional arrays in C/C++, i.e. arrays defined like @code{float dat[40][30];}. Since, formaly this arrays element @code{dat[i]} can address the memory in arbitrary place you should use the proper function to convert such arrays to @code{mglData} object. For C++ this is functions like @code{mglData::Set(float **dat, int N1, int N2}. For C this is functions like @code{mgl_data_set_float2(HMDT d, const float **dat, int N1, int N2}. At this, you should keep in mind that @code{nx=N2} and @code{ny=N1} after conversion. @c ------------------------------------------------------------------ -@node Data changing, , Array creation, Data handling -@subsection Data changing +@node Change data, , Array creation, Data handling +@subsection Change data MathGL has functions for data processing: differentiating, integrating, smoothing and so on. Let us consider some examples. The simplest ones are integration and differentiation. The direction in which operation will be performed is specified by textual string, which may contain symbols @samp{x}, @samp{y} or @samp{z}. For example, the call of @code{diff a 'x'} will differentiate data along @samp{x} direction; the call of @code{integrate a 'xy'} perform the double integration of data along @samp{x} and @samp{y} directions; the call of @code{diff2 a 'xyz'} will apply 3d Laplace operator to data and so on. Example of this operations on 2d array a=x*y is presented in code: @verbatim diff --git a/texinfo/example_en.texi b/texinfo/example_en.texi index cc4c9e4..5df4f8e 100644 --- a/texinfo/example_en.texi +++ b/texinfo/example_en.texi @@ -65,7 +65,7 @@ The ``interactive'' way of drawing in MathGL consists in window creation with h return mglFlRun(); } @end verbatim -Here function @code{sample} is defined. This function does all drawing. Other function @code{main} is entry point function for console program. Arguments of @code{main} should be transfered to @code{Window()} since it may contain OS specific information (@pxref{mglGraphAB class}). +Here function @code{sample} is defined. This function does all drawing. Other function @code{main} is entry point function for console program. Arguments of @code{main} should be transfered to @code{Window()} since it may contain OS specific information. Alternatively you can create yours own class inherited from class @code{mglDraw} and re-implement the function @code{Draw()} in it: @verbatim @@ -123,13 +123,13 @@ First, the function creates a frame @code{NewFrame()} for rotated axes and draws @node Drawing to file, Drawing in memory, Using FLTK/GLUT window, Basic usage @subsection Drawing to file -Another way of using MathGL library is the direct picture writing to file. It is most usable for plot creating during calculation or for using of small programs (like Matlab or Scilab scripts) for visualizing repetitive sets of data. But the speed of drawing is much higher in comparison with a script language. There are two classes for exporting in file: class @code{mglGraphZB} saves in bitmap format (like PNG), @code{mglGraphPS} saves in vector PostScript format (@pxref{Plotter classes}). +Another way of using MathGL library is the direct picture writing to file. It is most usable for plot creating during calculation or for using of small programs (like Matlab or Scilab scripts) for visualizing repetitive sets of data. But the speed of drawing is much higher in comparison with a script language. The following code produces a bitmap PNG picture: @verbatim int main(int ,char **) { - mglGraphZB gr; + mglGraph gr; gr.Alpha(true); gr.Light(true); gr.Light(0,mglPoint(1,0,-1)); sample(&gr,NULL); // The same drawing function. @@ -143,28 +143,26 @@ The code for export in vector EPS file looks the same: @verbatim int main(int ,char **) { - mglGraphPS gr; + mglGraph gr; gr.Light(true); gr.Light(0,mglPoint(1,0,-1)); sample(&gr,NULL); // The same drawing function. gr.WriteEPS("test.eps"); // Don't forget to save the result! return 0; } @end verbatim -The differences from the using of bitmap picture are: applying of the other class @code{mglGraphPS}, and writing to other format (function @code{WriteEPS()} instead of function @code{WritePNG()}). Moreover, there is no switching of the plot transparency @code{Alpha} since EPS format does not support it. Possibly I shall include transparency in future by program emulation. - -Classes @code{mglGraphZB} and @code{mglGraphPS} have some merits and demerits. Class @code{mglGraphZB} draws beautiful surface with transparency, smoothed colors and lightning, but the output picture is @emph{bitmap}, that leads to a bad scalability. On the contrary, class @code{mglGraphPS} creates vector file with excellent scalability. But file has large size (especially for surfaces), it does not support transparency and color smoothing. So, vector picture looks stylish but a bit angularly. +The difference from the previous one is using other function @code{WriteEPS()} for EPS format instead of function @code{WritePNG()}. Moreover, there is no switching of the plot transparency @code{Alpha} since EPS format does not support it. Possibly I shall include transparency in future by program emulation. @c ------------------------------------------------------------------ @node Drawing in memory, Using QMathGL, Drawing to file, Basic usage @subsection Drawing in memory -The last way of MathGL using is the drawing in memory. Class @code{mglGraphZB} allows one to create a bitmap picture in memory. Further this picture can be displayed in window by some window libraries (like wxWidgets, FLTK, Windows GDI and so on). For example, the code for drawing in wxWidget library looks like: +The last way of MathGL using is the drawing in memory. Class @code{mglGraph} allows one to create a bitmap picture in memory. Further this picture can be displayed in window by some window libraries (like wxWidgets, FLTK, Windows GDI and so on). For example, the code for drawing in wxWidget library looks like: @verbatim void MyForm::OnPaint(wxPaintEvent& event) { int w,h,x,y; GetClientSize(&w,&h); // size of the picture - mglGraphZB gr(w,h); + mglGraph gr(w,h); gr.Alpha(true); // draws something using MathGL gr.Light(true); gr.Light(0,mglPoint(1,0,-1)); @@ -177,13 +175,12 @@ The last way of MathGL using is the drawing in memory. Class @code{mglGraphZB} a } @end verbatim The drawing in other libraries is most the same. -@c Moreover, I excluded the support of TIFF and JPEG files from MathGL by default for compatibility with wxWidgets library. For example, FLTK code will look like @verbatim void Fl_MyWidget::draw() { - mglGraphZB gr(w(),h()); + mglGraph gr(w(),h()); gr.Alpha(true); // draws something using MathGL gr.Light(true); gr.Light(0,mglPoint(1,0,-1)); sample(&gr,NULL); @@ -194,7 +191,7 @@ Qt code will look like @verbatim void MyWidget::paintEvent(QPaintEvent *) { - mglGraphZB gr(w(),h()); + mglGraph gr(w(),h()); gr.Alpha(true); // draws something using MathGL gr.Light(true); gr.Light(0,mglPoint(1,0,-1)); sample(&gr,NULL); @@ -464,7 +461,7 @@ Another example demonstrate the features of TeX formula parsing. @caption{Example of TeX formula parsing} @end float -Finally you can change font during execution (this work well for mglGraphZB class only). +Finally you can change font during execution. @verbatim int sample(mglGraph *gr, void *) { @@ -542,15 +539,15 @@ Finally, you can use @code{mgl2gif} tool for doing the same with MGL scripts (@p @node Data handling, Data plotting, Advanced usage, Examples @section Data handling -Class @code{mglData} contains all functions for the data handling in MathGL (@pxref{mglData class}). There are several matters why I use class @code{mglData} but not a single array: it does not depend on type of data (float or double), sizes of data arrays are kept with data, memory working is simpler and safer. +Class @code{mglData} contains all functions for the data handling in MathGL (@pxref{Data processing}). There are several matters why I use class @code{mglData} but not a single array: it does not depend on type of data (float or double), sizes of data arrays are kept with data, memory working is simpler and safer. @menu * Array creation:: -* Data changing:: +* Change data:: @end menu @c ------------------------------------------------------------------ -@node Array creation, Data changing, , Data handling +@node Array creation, Change data, , Data handling @subsection Array creation One can put the data in @code{mglData} instance by several ways. Let us do it for sinus function: @@ -624,10 +621,10 @@ or by using @code{Modify()} function The only non-obvious thing here is using multidimensional arrays in C/C++, i.e. arrays defined like @code{float dat[40][30];}. Since, formaly this arrays element @code{dat[i]} can address the memory in arbitrary place you should use the proper function to convert such arrays to @code{mglData} object. For C++ this is functions like @code{mglData::Set(float **dat, int N1, int N2);}. For C this is functions like @code{mgl_data_set_float2(HMDT d, const float **dat, int N1, int N2);}. At this, you should keep in mind that @code{nx=N2} and @code{ny=N1} after conversion. @c ------------------------------------------------------------------ -@node Data changing, , Array creation, Data handling -@subsection Data changing +@node Change data, , Array creation, Data handling +@subsection Change data -MathGL has functions for data processing: differentiating, integrating, smoothing and so on (for more detail, @pxref{mglData class}). Let us consider some examples. The simplest ones are integration and differentiation. The direction in which operation will be performed is specified by textual string, which may contain symbols @samp{x}, @samp{y} or @samp{z}. For example, the call of @code{Diff("x")} will differentiate data along @samp{x} direction; the call of @code{Integral("xy")} perform the double integration of data along @samp{x} and @samp{y} directions; the call of @code{Diff2("xyz")} will apply 3d Laplace operator to data and so on. Example of this operations on 2d array a=x*y is presented in code: +MathGL has functions for data processing: differentiating, integrating, smoothing and so on (for more detail, @pxref{Data processing}). Let us consider some examples. The simplest ones are integration and differentiation. The direction in which operation will be performed is specified by textual string, which may contain symbols @samp{x}, @samp{y} or @samp{z}. For example, the call of @code{Diff("x")} will differentiate data along @samp{x} direction; the call of @code{Integral("xy")} perform the double integration of data along @samp{x} and @samp{y} directions; the call of @code{Diff2("xyz")} will apply 3d Laplace operator to data and so on. Example of this operations on 2d array a=x*y is presented in code: @verbatim int sample(mglGraph *gr, void *) { @@ -700,7 +697,7 @@ Let me now show how to plot the data. MathGL generally has 2 types of plotting f Term ``1D data'' means that data depend on single index (parameter) like curve in parametric form @{x(i),y(i),z(i)@}, i=1...n. There are 5 generally different types of data representations: simple line plot, line plot with filling under it, stairs plot, bar plot and vertical lines (@pxref{1D plotting}). Each type of plotting has similar interface. There are 3D version and two 2D versions. One of last requires single array. The parameters of line and marks (@pxref{Line styles}) are specified by the string argument. If the string parameter is @code{NULL} then solid line with color from palette is used (@pxref{Palette and colors}). -Below I shall show the features of 1D plotting on base of @code{Plot()} function (@pxref{Plot}). Let us start from sinus plot: +Below I shall show the features of 1D plotting on base of @code{Plot()} function (see @ref{plot}). Let us start from sinus plot: @verbatim int sample(mglGraph *gr, void *) { @@ -721,9 +718,9 @@ As previously I did not specify the style of lines. As a result, MathGL again us mglData x(50); x.Modify("cos(pi*2*x-pi)"); gr->Plot(x,y0,"Y+"); @end verbatim -Note that solid line is used because I did not specify the type of line. The same picture can be achieved by @code{Plot2()} function. Let us draw ellipse by orange dash line: +Note that solid line is used because I did not specify the type of line. The same picture can be achieved by @code{Plot()} and @code{SubData())} functions. Let us draw ellipse by orange dash line: @verbatim - gr->Plot2(y1,"q|"); + gr->Plot(y1.SubData(-1,0),y1.SubData(-1,1),"q|"); @end verbatim Drawing in 3D space is mostly the same. Let us draw spiral with default line style. Now its color is 4-th color from palette (this is cyan): @@ -732,11 +729,11 @@ Drawing in 3D space is mostly the same. Let us draw spiral with default line sty mglData z(50); z.Modify("2*x-1"); gr->Plot(x,y0,z); gr->Box(); @end verbatim -Function @code{Plot3()} does 3D curve plot but for single array. Use it to put circle marks on the previous plot: +Functions @code{Plot()} and @code{SubData())} make 3D curve plot but for single array. Use it to put circle marks on the previous plot: @verbatim mglData y2(10,3); y2.Modify("cos(pi*(2*x-1+y))"); y2.Modify("2*x-1",2); - gr->Plot3(y2,"bo "); + gr->Plot(y2.SubData(-1,0),y2.SubData(-1,1),y2.SubData(-1,2),"bo "); @end verbatim Note that line style is empty @samp{ } here. Usage of other 1D plotting functions looks similar: @verbatim diff --git a/texinfo/example_ru.texi b/texinfo/example_ru.texi index cc4c9e4..b25bd38 100644 --- a/texinfo/example_ru.texi +++ b/texinfo/example_ru.texi @@ -721,9 +721,9 @@ As previously I did not specify the style of lines. As a result, MathGL again us mglData x(50); x.Modify("cos(pi*2*x-pi)"); gr->Plot(x,y0,"Y+"); @end verbatim -Note that solid line is used because I did not specify the type of line. The same picture can be achieved by @code{Plot2()} function. Let us draw ellipse by orange dash line: +Note that solid line is used because I did not specify the type of line. The same picture can be achieved by @code{Plot()} and @code{SubData())} functions. Let us draw ellipse by orange dash line: @verbatim - gr->Plot2(y1,"q|"); + gr->Plot(y1.SubData(-1,0),y1.SubData(-1,1),"q|"); @end verbatim Drawing in 3D space is mostly the same. Let us draw spiral with default line style. Now its color is 4-th color from palette (this is cyan): @@ -732,11 +732,11 @@ Drawing in 3D space is mostly the same. Let us draw spiral with default line sty mglData z(50); z.Modify("2*x-1"); gr->Plot(x,y0,z); gr->Box(); @end verbatim -Function @code{Plot3()} does 3D curve plot but for single array. Use it to put circle marks on the previous plot: +Functions @code{Plot()} and @code{SubData())} make 3D curve plot but for single array. Use it to put circle marks on the previous plot: @verbatim mglData y2(10,3); y2.Modify("cos(pi*(2*x-1+y))"); y2.Modify("2*x-1",2); - gr->Plot3(y2,"bo "); + gr->Plot(y2.SubData(-1,0),y2.SubData(-1,1),y2.SubData(-1,2),"bo "); @end verbatim Note that line style is empty @samp{ } here. Usage of other 1D plotting functions looks similar: @verbatim diff --git a/texinfo/mathgl.texi b/texinfo/mathgl.texi new file mode 100644 index 0000000..e69de29 diff --git a/texinfo/mathgl_en.texi b/texinfo/mathgl_en.texi index dce0911..d8a7d8c 100644 --- a/texinfo/mathgl_en.texi +++ b/texinfo/mathgl_en.texi @@ -1,6 +1,6 @@ \input texinfo @setfilename mathgl_en.info -@set VERSION 1.11 +@set VERSION 2.0 @settitle MathGL @value{VERSION} @syncodeindex pg cp @comment %**end of header @@ -25,10 +25,10 @@ supports it in developing GNU and promoting software freedom.'' @end quotation @end copying -@c @dircategory MathGL documentation system -@c @direntry -@c * MathGL: (mathgl). The library for scientific graphics. -@c @end direntry +@dircategory MathGL documentation system +@direntry +* MathGL: (mathgl). The library for scientific graphics. +@end direntry @titlepage @title MathGL @@ -47,7 +47,7 @@ supports it in developing GNU and promoting software freedom.'' 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. +Copyright @copyright{} 2008 Alexey A. Balakin. @quotation Permission is granted to copy, distribute and/or modify this document @@ -69,11 +69,9 @@ supports it in developing GNU and promoting software freedom.'' * Overview:: * Examples:: * MathGL core:: -* Plotter classes:: * Widget classes:: -* mglData class:: +* Data processing:: * Other classes:: -* MGL interface:: * Samples:: * TeX-like symbols:: * Copying This Manual:: @@ -86,9 +84,6 @@ supports it in developing GNU and promoting software freedom.'' @macro tdref{nam} @uref{http://mathgl.sourceforge.net/pdf_u3d/\nam\.pdf, 3D pdf} @end macro -@macro MGL -(MGL) -@end macro @node Overview, Examples, , Top @@ -97,25 +92,19 @@ supports it in developing GNU and promoting software freedom.'' @node Examples, MathGL core, Overview, Top @include example_en.texi -@node MathGL core, Plotter classes, Examples, Top +@node MathGL core, Widget classes, Examples, Top @include core_en.texi -@node Plotter classes, Widget classes, MathGL core, Top -@include class_en.texi - -@node Widget classes, mglData class, Plotter classes, Top +@node Widget classes, Data handling, MathGL core, Top @include widget_en.texi -@node mglData class, Other classes, Widget classes, Top +@node Data processing, Other classes, Widget classes, Top @include data_en.texi -@node Other classes, MGL interface, mglData class, Top +@node Other classes, Samples, Data handling, Top @include other_en.texi -@node MGL interface, Samples, Other classes, Top -@include mgl_cmd_en.texi - -@node Samples, TeX-like symbols, MGL interface, Top +@node Samples, TeX-like symbols, Other classes, Top @include samples_en.texi @node TeX-like symbols, Copying This Manual, Samples, Top diff --git a/texinfo/mathgl_ru.texi b/texinfo/mathgl_ru.texi index ea267fb..e88791f 100644 --- a/texinfo/mathgl_ru.texi +++ b/texinfo/mathgl_ru.texi @@ -2,7 +2,7 @@ @setfilename mathgl_ru.info @c @documentlanguage ru @documentencoding UTF-8 -@set VERSION 1.11 +@set VERSION 2.0 @settitle MathGL @value{VERSION} @syncodeindex pg cp @comment %**end of header @@ -27,10 +27,10 @@ supports it in developing GNU and promoting software freedom.'' @end quotation @end copying -@c @dircategory MathGL documentation system -@c @direntry -@c * MathGL: (mathgl). The library for scientific graphics. -@c @end direntry +@dircategory MathGL documentation system +@direntry +* MathGL: (mathgl). The library for scientific graphics. +@end direntry @titlepage @title MathGL @@ -49,7 +49,7 @@ supports it in developing GNU and promoting software freedom.'' Это документация для MathGL (версии @value{VERSION}) -- библиотеки классов и функций для построения научной графики. Пожалуйста сообщайте о любых ошибках в этом руководстве на @email{mathgl.abalakin@@gmail.org}. Дополнительную информацию о MathGL можно найти на домашней странице проекта @uref{http://mathgl.sourceforge.net/}. -Copyright @copyright{} 2009 Алексей Балакин. +Copyright @copyright{} 2009 Алексей Балакин. @quotation Permission is granted to copy, distribute and/or modify this document @@ -71,11 +71,9 @@ supports it in developing GNU and promoting software freedom.'' * Overview:: * Examples:: * MathGL core:: -* Plotter classes:: * Widget classes:: -* mglData class:: +* Data processing:: * Other classes:: -* MGL interface:: * Samples:: * TeX-like symbols:: * Copying This Manual:: @@ -88,9 +86,6 @@ supports it in developing GNU and promoting software freedom.'' @macro tdref{nam} @uref{http://mathgl.sourceforge.net/pdf_u3d/\nam\.pdf, 3D pdf} @end macro -@macro MGL -(MGL) -@end macro @node Overview, Examples, , Top @include overview_ru.texi @@ -98,25 +93,19 @@ supports it in developing GNU and promoting software freedom.'' @node Examples, MathGL core, Overview, Top @include example_ru.texi -@node MathGL core, Plotter classes, Examples, Top +@node MathGL core, Widget classes, Examples, Top @include core_ru.texi -@node Plotter classes, Widget classes, MathGL core, Top -@include class_ru.texi - -@node Widget classes, mglData class, Plotter classes, Top +@node Widget classes, Data handling, MathGL core, Top @include widget_ru.texi -@node mglData class, Other classes, Widget classes, Top +@node Data processing, Other classes, Widget classes, Top @include data_ru.texi -@node Other classes, MGL interface, mglData class, Top +@node Other classes, Samples, Data handling, Top @include other_ru.texi -@node MGL interface, Samples, Other classes, Top -@include mgl_cmd_ru.texi - -@node Samples, TeX-like symbols, MGL interface, Top +@node Samples, TeX-like symbols, Other classes, Top @include samples_ru.texi @node TeX-like symbols, Copying This Manual, Samples, Top diff --git a/texinfo/mgl_cmd_en.texi b/texinfo/mgl_cmd_en.texi index 398241a..429cf51 100644 --- a/texinfo/mgl_cmd_en.texi +++ b/texinfo/mgl_cmd_en.texi @@ -3,6 +3,48 @@ MathGL library supports the simplest scripts for data handling and plotting. These scripts can be used independently (with the help of UDAV, mgl2png, mgl2eps, mgl2svg programs and others, @pxref{Utilities}) or in the frame of the library using. +@menu +* MGL basics:: +@ifset UDAV +* General concepts:: +@end ifset +* Graphics setup @MGL{}:: +* Axis settings @MGL{}:: +* Transformation matrix @MGL{}:: +* Export to file @MGL{}:: +* Primitives drawing @MGL{}:: +* Text printing @MGL{}:: +* Axis and Colorbar @MGL{}:: +* Legend @MGL{}:: +* 1D plotting @MGL{}:: +* 2D plotting @MGL{}:: +* 3D plotting @MGL{}:: +* Dual plotting @MGL{}:: +* Vector fields @MGL{}:: +* Other plotting @MGL{}:: +* Nonlinear fitting @MGL{}:: +* Data create @MGL{}:: +* Data filling @MGL{}:: +* Rearrange data @MGL{}:: +* File I/O @MGL{}:: +* Make another data @MGL{}:: +* Change data @MGL{}:: +* Operators @MGL{}:: +* Program flow @MGL{}:: +* Command options @MGL{}:: +* Suffixes:: +* Utilities:: +@end menu + +@c ################################################################## +@ifset UDAV +@node MGL basics, General concepts, , MGL interface +@end ifset +@ifclear UDAV +@node MGL basics, Graphics setup @MGL{}, , MGL interface +@end ifclear + +@section MGL basics MGL script language is rather simple. Each string is a command. First word of string is the name of command. Other words are command arguments. Command may have up to 1000 arguments (at least for now). Words are separated from each other by space or tabulation symbol. The upper or lower case of words is sufficient, i.e. variables @var{a} and @var{A} are different variables. Symbol @samp{#} starts the comment (all characters after # will be ignored). The exception is situation when @samp{#} is a part of some string. Also options can be specified after symbol @samp{;} (@pxref{Command options @MGL{}}). Symbol @samp{:} starts new command (like new line character) if it is not placed inside a string or inside brackets. If string contain references to external parameters (substrings @samp{$0}, @samp{$1} ... @samp{$9}) or definitions (substrings @samp{$a}, @samp{$b} ... @samp{$z}) then before execution the values of parameter/definition will be substituted instead of reference. It allows to use the same MGL script for different parameters (filenames, paths, condition and so on). @@ -41,41 +83,10 @@ Command may have several set of possible arguments (for example, @code{plot ydat All MGL commands can be divided on several groups. I will use the following notation for a command description: command names are bold, strings are denoted by commas, variable names are italic, numbers are typewriter. Optional arguments are placed in square brackets and default values for them are shown. Detailed description of color, line styles (@pxref{Line styles}), color schemes (@pxref{Color scheme}), font types, TeX-like symbols (@pxref{Font styles}) and formulas (@pxref{Textual formulas}) can be found in corresponding section. -@menu -@ifset UDAV -* General concepts:: -@end ifset -* Graphics setup @MGL{}:: -* Axis settings @MGL{}:: -* Transformation matrix @MGL{}:: -* Export to file @MGL{}:: -* Primitives drawing @MGL{}:: -* Text printing @MGL{}:: -* Axis and Colorbar @MGL{}:: -* Legend @MGL{}:: -* 1D plotting @MGL{}:: -* 2D plotting @MGL{}:: -* 3D plotting @MGL{}:: -* Dual plotting @MGL{}:: -* Vector fields @MGL{}:: -* Other plotting @MGL{}:: -* Nonlinear fitting @MGL{}:: -* Data create @MGL{}:: -* Data filling @MGL{}:: -* Rearrange data @MGL{}:: -* File I/O @MGL{}:: -* Make another data @MGL{}:: -* Change data @MGL{}:: -* Operators @MGL{}:: -* Program flow @MGL{}:: -* Command options @MGL{}:: -* Suffixes:: -* Utilities:: -@end menu @c ################################################################## @ifset UDAV -@node General concepts, , Utilities, MGL interface +@node General concepts, Graphics setup @MGL{}, MGL basics, MGL interface @section General concepts The set of MathGL features is rather rich -- just the number of basic graphics types is larger than 40. Also there are functions for data handling, plot setup and so on. In spite of it I tried to keep a similar style in command names and in the order of arguments. Mostly it is used for different drawing functions. @@ -109,7 +120,7 @@ In addition to the general concepts I want to comment on some non-trivial or les @ifclear UDAV @c ################################################################## -@node Graphics setup @MGL{}, Axis settings @MGL{}, , MGL interface +@node Graphics setup @MGL{}, Axis settings @MGL{}, MGL basics, MGL interface @end ifclear @section Graphics setup @MGL{} @@ -133,24 +144,24 @@ There are several commands for setup transparency. The general command is @ref{a @cindex alpha @anchor{alpha} -@deffn {MGL command} alpha @code{[val=on]} +@deftypefn {MGL command} {} alpha @code{[val=on]} Sets the transparency on/off. It is recommended to call this command before any plotting command. Default value is @code{off}. Use @code{transparent off} in particular plot to disable its transparency. -@end deffn +@end deftypefn @cindex alphadef @anchor{alphadef} -@deffn {MGL command} alphadef @code{val} +@deftypefn {MGL command} {} alphadef @code{val} Default value of alpha channel (transparency) for all plotting commands. Initial value is 0.5. -@end deffn +@end deftypefn @cindex transparent @anchor{transparent} -@deffn {MGL command} transparent @code{val} +@deftypefn {MGL command} {} transparent @code{val} Temporary switches transparency on/off for the plot. -@end deffn +@end deftypefn @cindex transptype @anchor{transptype} -@deffn {MGL command} transptype @code{val} +@deftypefn {MGL command} {} transptype @code{val} This command set the transparency type. Normal transparency (@samp{0}) -- below things is less visible than upper ones. Glass-like transparency (@samp{1}) -- below and upper things are commutable and just decrease intensity of light by RGB channel. Lamp-like transparency (@samp{2}) -- below and upper things are commutable and are the source of some additional light. I recommend to set @code{alphadef 0.3} or less for lamp-like transparency. @xref{Normal transparency}, @ref{Glass-like transparency}, @ref{Lamp-like transparency}. -@end deffn +@end deftypefn @c ================================================================== @node Lighting @MGL{}, Fog @MGL{}, Transparency @MGL{}, Graphics setup @MGL{} @@ -160,22 +171,22 @@ There are several commands for setup lighting. The general command is @ref{light @cindex light @anchor{light} -@deffn {MGL command} light @code{[val=on]} +@deftypefn {MGL command} {} light @code{[val=on]} Sets the using of light on/off for overall plot. It is recommended to call this command before any plotting command. Default value is lightning off. -@end deffn -@deffn {MGL command} light @code{num val} +@end deftypefn +@deftypefn {MGL command} {} light @code{num val} Switch on/off @var{num}-th light source separately. -@end deffn +@end deftypefn -@deffn {MGL command} light @code{num xpos ypos zpos} ['col'='w' @code{br=0.5}] +@deftypefn {MGL command} {} light @code{num xpos ypos zpos} ['col'='w' @code{br=0.5}] The command adds a light source with identification @var{num} at position @{@var{xpos}, @var{ypos}, @var{zpos}@}. The color of light is @var{col} (white by default). The brightness of light is @var{br} which must be in range [0,1]. -@end deffn +@end deftypefn @cindex ambient @anchor{ambient} -@deffn {MGL command} ambient @code{val} +@deftypefn {MGL command} {} ambient @code{val} Sets the brightness of ambient light. The value should be in range [0,1]. Initial value is 0.5. -@end deffn +@end deftypefn @c ================================================================== @node Fog @MGL{}, Default sizes @MGL{}, Lighting @MGL{}, Graphics setup @MGL{} @@ -183,9 +194,9 @@ Sets the brightness of ambient light. The value should be in range [0,1]. Initia @cindex fog @anchor{fog} -@deffn {MGL command} fog @code{val [dz=0.25]} +@deftypefn {MGL command} {} fog @code{val [dz=0.25]} Command imitate a fog in the plot. Fog start from relative distance @var{dz} from view point and its density growths exponentially in depth. So that the fog influence is determined by law ~@math{1-exp(-d*z)}. Here @emph{z} is normalized to 1 depth of the plot. If value @var{val}=@code{0} then the fog is absent. @sref{Surface in fog sample} -@end deffn +@end deftypefn @c ================================================================== @node Default sizes @MGL{}, Zooming @MGL{}, Fog @MGL{}, Graphics setup @MGL{} @@ -195,39 +206,39 @@ These commands control the default (initial) values for most graphics parameters @cindex barwidth @anchor{barwidth} -@deffn {MGL command} barwidth @code{val} +@deftypefn {MGL command} {} barwidth @code{val} Sets relative width of rectangles in @code{bars, barh, boxplot}. Default value is @code{0.7}. -@end deffn +@end deftypefn @cindex marksize @anchor{marksize} -@deffn {MGL command} marksize @code{val} +@deftypefn {MGL command} {} marksize @code{val} The size of marks. Default value is @code{1}. -@end deffn +@end deftypefn @cindex arrowsize @anchor{arrowsize} -@deffn {MGL command} arrowsize @code{val} +@deftypefn {MGL command} {} arrowsize @code{val} The size of arrows for lines and curves. Default value is @code{1}. -@end deffn +@end deftypefn @cindex linewidth @anchor{linewidth} -@deffn {MGL command} linewidth @code{val} +@deftypefn {MGL command} {} linewidth @code{val} The variable define the base width for all lines. The value <1 is ignored. Increase of this variables is actual for large bitmap pictures. Default value is @code{1}. -@end deffn +@end deftypefn @cindex ticklen @anchor{ticklen} -@deffn {MGL command} ticklen @code{val} [@code{stt=1}] +@deftypefn {MGL command} {} ticklen @code{val} [@code{stt=1}] The relative length of axis ticks. Default value is @code{0.1}. Parameter @var{stt}>0 set relative length of subticks which is in @code{sqrt(1+stt)} times smaller. -@end deffn +@end deftypefn @cindex tickstl @anchor{tickstl} -@deffn {MGL command} tickstl 'stl' ['sub'=''] +@deftypefn {MGL command} {} tickstl 'stl' ['sub'=''] The line style of axis ticks (@var{stl}) and subticks (@var{sub}). If @var{stl}='' then default style is used (@samp{k} or @samp{w} depending on transparency type). If @var{sub}='' then ticks style is used (i.e. @var{stl}). -@end deffn +@end deftypefn @c ================================================================== @node Zooming @MGL{}, Cutting @MGL{}, Default sizes @MGL{}, Graphics setup @MGL{} @@ -237,15 +248,15 @@ These commands control the overall zooming of the picture or the sub-picture. No @cindex plotfactor @anchor{plotfactor} -@deffn {MGL command} plotfactor @code{val} +@deftypefn {MGL command} {} plotfactor @code{val} The factor of plot size. It is not recommended to set it lower then 1.6. This is some analogue of command @ref{zoom} but applied not to overall image but for each @ref{inplot}. Use negative value to enable automatic @ref{plotfactor} selection. -@end deffn +@end deftypefn @cindex zoom @anchor{zoom} -@deffn {MGL command} zoom @code{x1 y1 x2 y2} +@deftypefn {MGL command} {} zoom @code{x1 y1 x2 y2} The command changes the scale of graphics that correspond to zoom in/out of the picture. After command call the current plot will be cleared and further the picture will contain plotting from its part [x1,x2]*[y1,y2]. Here picture coordinates @var{x1}, @var{x2}, @var{y1}, @var{y2} changes from 0 to 1. Use @code{zoom 0 0 1 1} to return default view. -@end deffn +@end deftypefn @c ================================================================== @node Cutting @MGL{}, Other settings @MGL{}, Zooming @MGL{}, Graphics setup @MGL{} @@ -255,17 +266,17 @@ These commands set the condition when the points are excluded (cutted) from the @cindex cut @anchor{cut} -@deffn {MGL command} cut @code{val} +@deftypefn {MGL command} {} cut @code{val} Determines how points outside bounding box are drawn. If it is @code{on} then points are excluded from plot (it is default) otherwise the points are projected to edges of bounding box. -@end deffn +@end deftypefn -@deffn {MGL command} cut @code{x1 y1 z1 x2 y2 z2} +@deftypefn {MGL command} {} cut @code{x1 y1 z1 x2 y2 z2} Lower and upper edge of the box in which never points are drawn. If both edges are the same (the variables are equal) then the cutting box is empty. @sref{CutMinMax sample} -@end deffn +@end deftypefn -@deffn {MGL command} cut 'cond' +@deftypefn {MGL command} {} cut 'cond' Command set the cutting off condition by formula @var{cond}. This condition determine will point be plotted or not. If value of formula is nonzero then point is omitted, otherwise it plotted. Set argument as @code{''} to disable cutting off condition. @sref{CutOff sample} -@end deffn +@end deftypefn @c ================================================================== @node Other settings @MGL{}, , Cutting @MGL{}, Graphics setup @MGL{} @@ -273,33 +284,33 @@ Command set the cutting off condition by formula @var{cond}. This condition dete @cindex font @anchor{font} -@deffn {MGL command} font 'fnt' [@code{val=6}] +@deftypefn {MGL command} {} font 'fnt' [@code{val=6}] Font style for text and labels (see text). Initial style is 'fnt'='rC' give Roman font with centering. Parameter @code{val} sets the size of font for tick and axis labels. Default font size of axis labels is 1.4 times large than for tick labels. For more detail, @pxref{Font styles}. -@end deffn +@end deftypefn @cindex rotatetext @anchor{rotatetext} -@deffn {MGL command} rotatetext @code{val} +@deftypefn {MGL command} {} rotatetext @code{val} Set to use or not text rotation along axis. Initial value is @code{on}. -@end deffn +@end deftypefn @cindex palette @anchor{palette} -@deffn {MGL command} palette 'colors' +@deftypefn {MGL command} {} palette 'colors' Set the palette as selected colors. Default value is @code{'Hbgrcmyhlnqeup'}. The palette is used mostly in 1D plots for curves which styles are not specified. -@end deffn +@end deftypefn @cindex meshnum @anchor{meshnum} -@deffn {MGL command} meshnum @code{num} +@deftypefn {MGL command} {} meshnum @code{num} Sets approximate number of lines in @ref{mesh}, @ref{fall}, @ref{grid} and also the number of hachures in @ref{vect}, @ref{vectc}, @ref{dew} and the number of cells in @ref{cloud}. By default (=0) it draws all lines/hachures/cells. -@end deffn +@end deftypefn @cindex axialdir @anchor{axialdir} -@deffn {MGL command} axialdir 'dir' +@deftypefn {MGL command} {} axialdir 'dir' Set direction around which curve rotated in @ref{axial}, @ref{torus}. Default value is 'z'. -@end deffn +@end deftypefn @c ================================================================== @node Axis settings @MGL{}, Transformation matrix @MGL{}, Graphics setup @MGL{}, MGL interface @@ -309,95 +320,95 @@ These large set of commands control how the axis and ticks will be drawn. Note t @cindex axis @anchor{axis} -@deffn {MGL command} axis @code{x1 y1 x2 y2} -@deffnx {MGL command} axis @code{x1 y1 z1 x2 y2 z2} +@deftypefn {MGL command} {} axis @code{x1 y1 x2 y2} +@deftypefnx {MGL command} {} axis @code{x1 y1 z1 x2 y2 z2} @cindex ranges @anchor{ranges} -@deffnx {MGL command} ranges @code{x1 x2 y1 y2 [z1=0 z2=0]} +@deftypefnx {MGL command} {} ranges @code{x1 x2 y1 y2 [z1=0 z2=0]} Sets the ranges of coordinates changing. Also it sets the range for coloring (analogous to @code{caxis z1 z2}). Initial ranges are [-1, 1]. -@end deffn +@end deftypefn -@deffn {MGL command} axis 'fx' 'fy' ['fz'='' 'fa'=''] +@deftypefn {MGL command} {} axis 'fx' 'fy' ['fz'='' 'fa'=''] Sets the transformation formulas for curvilinear coordinates. Each string should contain mathematical expression for real coordinate depending on internal coordinates @samp{x}, @samp{y}, @samp{z} and @samp{a} or @samp{c} for colorbar. For example, the cylindrical coordinates are introduced as @code{axis 'x*cos(y)' 'x*sin(y)' 'z'}. For removing of formulas the corresponding parameter should be @code{''}. The using of transformation formulas will slightly slowing the program, i.e. @code{axis '' '' ''} is faster than @code{axis '1*x' '1*y' '1*z'}. Initially all formulas are absent (Cartesian coordinates are used). For more details about functions and formulas, @pxref{Textual formulas}. -@end deffn +@end deftypefn -@deffn {MGL command} axis @code{how} +@deftypefn {MGL command} {} axis @code{how} Sets one of the predefined transformation formulas for curvilinear coordinate. Paramater @var{how} define the coordinates: @samp{0} -- Cartesian coordinates (no transformation); @samp{1} -- Polar coordiantes @math{x_n=x*cos(y),y_n=x*sin(y), z_n=z}; @samp{2} -- Spherical coordinates @math{x_n=x*sin(y)*cos(z), y_n=x*sin(y)*sin(z), z_n=x*cos(y)}; @samp{3} -- Parabolic coordinates @math{x_n=x*y, y_n=(x*x-y*y)/2, z_n=z}; @samp{4} -- Paraboloidal coordinates @math{x_n=(x*x-y*y)*cos(z)/2, y_n=(x*x-y*y)*sin(z)/2, z_n=x*y}; @samp{5} -- Oblate coordinates @math{x_n=cosh(x)*cos(y)*cos(z), y_n=cosh(x)*cos(y)*sin(z), z_n=sinh(x)*sin(y)}; @samp{6} -- Prolate coordinates @math{x_n=sinh(x)*sin(y)*cos(z), y_n=sinh(x)*sin(y)*sin(z), z_n=cosh(x)*cos(y)}; @samp{7} -- Elliptic coordinates @math{x_n=cosh(x)*cos(y), y_n=sinh(x)*sin(y), z_n=z}; @samp{8} -- Toroidal coordinates @math{x_n=sinh(x)*cos(z)/(cosh(x)-cos(y)), y_n=sinh(x)*sin(z)/(cosh(x)-cos(y)), z_n=sin(y)/(cosh(x)-cos(y))}; @samp{9} -- Bispherical coordinates @math{x_n=sin(y)*cos(z)/(cosh(x)-cos(y)), y_n=sin(y)*sin(z)/(cosh(x)-cos(y)), z_n=sinh(x)/(cosh(x)-cos(y))}; @samp{10} -- Bipolar coordinates @math{x_n=sinh(x)/(cosh(x)-cos(y)), y_n=sin(y)/(cosh(x)-cos(y)), z_n=z}. -@end deffn +@end deftypefn @cindex caxis @anchor{caxis} -@deffn {MGL command} caxis @code{z1 z2} +@deftypefn {MGL command} {} caxis @code{z1 z2} Sets the range for surface coloring. Initial range is [-1, 1]. -@end deffn +@end deftypefn @cindex origin @anchor{origin} -@deffn {MGL command} origin @code{x0 y0 [z0=nan]} +@deftypefn {MGL command} {} origin @code{x0 y0 [z0=nan]} Center of axis cross section. If one of values is @code{nan} then MathGL library try to select optimal axis position. -@end deffn +@end deftypefn @cindex ternary @anchor{ternary} -@deffn {MGL command} ternary @code{val} +@deftypefn {MGL command} {} ternary @code{val} The command sets to draws Ternary plot. This special plot is for 3 dependent coordinates (components) @var{a}, @var{b}, @var{c} so that @var{a}+@var{b}+@var{c}=1. MathGL uses only 2 independent coordinates @var{a}=x and @var{b}=y since it is enough to plot everything. At this third coordinate z act as another parameter to produce contour lines, surfaces and so on. @sref{Ternary plot sample} -@end deffn +@end deftypefn @cindex xrange @anchor{xrange} -@deffn {MGL command} xrange dat [@code{add=off fact=0}] +@deftypefn {MGL command} {} xrange dat [@code{add=off fact=0}] @cindex yrange @anchor{yrange} -@deffnx {MGL command} yrange dat [@code{add=off fact=0}] +@deftypefnx {MGL command} {} yrange dat [@code{add=off fact=0}] @cindex zrange @anchor{zrange} -@deffnx {MGL command} zrange dat [@code{add=off fact=0}] +@deftypefnx {MGL command} {} zrange dat [@code{add=off fact=0}] @cindex crange @anchor{crange} -@deffnx {MGL command} crange dat [@code{add=off fact=0}] +@deftypefnx {MGL command} {} crange dat [@code{add=off fact=0}] Sets the range for x-,y-,z- coordinate or coloring as minimal and maximal values of data @var{dat}. Parameter @code{add=on} shows that the new range will be joined to existed one (nut will not replace it). Parameter @var{fact} add additional range increase on value (@var{Max}-@var{Min})*@var{fact}. -@end deffn +@end deftypefn -@deffn {MGL command} xrange @code{x1 x2} -@deffnx {MGL command} yrange @code{x1 x2} -@deffnx {MGL command} zrange @code{x1 x2} -@deffnx {MGL command} crange @code{x1 x2} +@deftypefn {MGL command} {} xrange @code{x1 x2} +@deftypefnx {MGL command} {} yrange @code{x1 x2} +@deftypefnx {MGL command} {} zrange @code{x1 x2} +@deftypefnx {MGL command} {} crange @code{x1 x2} Sets the range for x-,y-,z- coordinate or coloring. See also @ref{axis}. -@end deffn +@end deftypefn @cindex xtick @anchor{xtick} -@deffn {MGL command} xtick @code{val [sub=0 org=nan]} +@deftypefn {MGL command} {} xtick @code{val [sub=0 org=nan]} @cindex ytick @anchor{ytick} -@deffnx {MGL command} ytick @code{val [sub=0 org=nan]} +@deftypefnx {MGL command} {} ytick @code{val [sub=0 org=nan]} @cindex ztick @anchor{ztick} -@deffnx {MGL command} ztick @code{val [sub=0 org=nan]} +@deftypefnx {MGL command} {} ztick @code{val [sub=0 org=nan]} @cindex ctick @anchor{ctick} -@deffnx {MGL command} ctick @code{val} +@deftypefnx {MGL command} {} ctick @code{val} Sets step for x-, y-, z-axis ticks or colorbar ticks (if @var{val}>0) or it's number (if @var{val}<0) in corresponding direction. Zero value @var{val}=0 sets logarithmic ticks. Parameter @var{sub} sets the number of sub-ticks. Parameter @var{org} set the starting points for ticks. If not @code{org=nan} then the value from @ref{origin} is used. -@end deffn +@end deftypefn -@deffn {MGL command} xtick 'templ' -@deffnx {MGL command} ytick 'templ' -@deffnx {MGL command} ztick 'templ' -@deffnx {MGL command} ctick 'templ' +@deftypefn {MGL command} {} xtick 'templ' +@deftypefnx {MGL command} {} ytick 'templ' +@deftypefnx {MGL command} {} ztick 'templ' +@deftypefnx {MGL command} {} ctick 'templ' Sets the template for x-, y-, z-axis ticks or colorbar ticks. It may contain TeX symbols also. If @var{templ}=@code{''} then default template is used (in simplest case it is @samp{%.2g}) with automatic detaching of common multiplier or common component. -@end deffn +@end deftypefn -@deffn {MGL command} xtick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...] -@deffnx {MGL command} ytick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...] -@deffnx {MGL command} ztick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...] +@deftypefn {MGL command} {} xtick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...] +@deftypefnx {MGL command} {} ytick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...] +@deftypefnx {MGL command} {} ztick @code{val1} 'lbl1' [@code{val2} 'lbl2' ...] Sets manual positions @var{val1},@var{val2},... and labels @var{lbl1},@var{lbl2},... for ticks along x-, y-, z-axis. Labels may contain TeX symbols also. -@end deffn +@end deftypefn @cindex adjust @anchor{adjust} -@deffn {MGL command} adjust ['dir'='xyzc'] +@deftypefn {MGL command} {} adjust ['dir'='xyzc'] Set the ticks step, number of sub-ticks and initial ticks position to be the most human readable for the axis along direction(s) @var{dir}. -@end deffn +@end deftypefn @c ################################################################## @@ -408,53 +419,53 @@ These commands control how and where further plotting will be placed. There is a @cindex subplot @anchor{subplot} -@deffn {MGL command} subplot @code{nx ny m [dx=0 dy=0]} +@deftypefn {MGL command} {} subplot @code{nx ny m [dx=0 dy=0]} Puts further plotting in a @var{m}-th cell of @var{nx}*@var{ny} grid of the whole frame area. This command set off any aspects or rotations. So it should be used first for creating the subplot. From the aesthetical point of view it is not recommended to use this command with different matrices in the same frame. The position of the cell can be shifted from its default position by relative size @var{dx}, @var{dy}. -@end deffn +@end deftypefn -@deffn {MGL command} subplot @code{nx ny m} 'style' +@deftypefn {MGL command} {} subplot @code{nx ny m} 'style' The same as previous but space reserved for axis/colorbar is saved only if @var{style} contain: @samp{L} or @samp{<} -- at left side, @samp{R} or @samp{>} -- at right side, @samp{A} or @samp{^} -- at top side, @samp{U} or @samp{_} -- at bottom side. -@end deffn +@end deftypefn @cindex inplot @anchor{inplot} -@deffn {MGL command} inplot @code{x1 x2 y1 y2 [rel=off]} +@deftypefn {MGL command} {} inplot @code{x1 x2 y1 y2 [rel=off]} Puts further plotting in some region of the whole frame surface. This command allows one to create a plot in arbitrary place of the screen. The position is defined by rectangular coordinates [@var{x1}, @var{x2}]*[@var{y1}, @var{y2}]. The coordinates @var{x1}, @var{x2}, @var{y1}, @var{y2} are normalized to interval [0, 1]. If parameter @var{rel}=@code{on} then the relative position to current @ref{subplot} is used. This command set off any aspects or rotations. So it should be used first for creating subplot. -@end deffn +@end deftypefn @cindex columnplot @anchor{columnplot} -@deffn {MGL command} columnplot @code{num ind [d=0]} +@deftypefn {MGL command} {} columnplot @code{num ind [d=0]} Puts further plotting in @var{ind}-th cell of column with @var{num} cells. The position is relative to previous @ref{subplot} call (or @ref{inplot} with @code{rel=off}). Parameter @var{d} set extra gap between cells. -@end deffn +@end deftypefn @cindex stickplot @anchor{stickplot} -@deffn {MGL command} stickplot @code{num ind tet phi} +@deftypefn {MGL command} {} stickplot @code{num ind tet phi} Puts further plotting in @var{ind}-th cell of stick with @var{num} cells. At this, stick is rotated on angles @var{tet}, @var{phi}. The position is relative to previous @ref{subplot} call (or @ref{inplot} with @code{rel=off}). -@end deffn +@end deftypefn @cindex rotate @anchor{rotate} -@deffn {MGL command} rotate @code{tetz tetx [tety=0]} +@deftypefn {MGL command} {} rotate @code{tetz tetx [tety=0]} Rotates a further plotting relative to each axis (x, z, y) consecutively on angles @var{tetx}, @var{tetz}, @var{tety}. -@end deffn +@end deftypefn -@deffn {MGL command} rotate @code{tet x y z} +@deftypefn {MGL command} {} rotate @code{tet x y z} Rotates a further plotting around vector @{x,y,z@} on angle @var{tet}. -@end deffn +@end deftypefn @cindex aspect @anchor{aspect} -@deffn {MGL command} aspect @code{ax ay [az=1]} +@deftypefn {MGL command} {} aspect @code{ax ay [az=1]} Defines aspect ratio for the plot. The viewable axes will be related one to another as the ratio @var{ax:ay:az}. For the best effect it should be used after @ref{rotate} command. -@end deffn +@end deftypefn @cindex perspective @anchor{perspective} -@deffn {MGL command} perspective @code{val} +@deftypefn {MGL command} {} perspective @code{val} Add (switch on) the perspective to plot. The parameter @math{val ~ 1/z_@{eff@} \in [0,1)}. By default (@code{val=0}) the perspective is off. -@end deffn +@end deftypefn @c ################################################################## @node Export to file @MGL{}, Primitives drawing @MGL{}, Transformation matrix @MGL{}, MGL interface @@ -462,15 +473,15 @@ Add (switch on) the perspective to plot. The parameter @math{val ~ 1/z_@{eff@} \ @cindex write @anchor{write} -@deffn {MGL command} write 'fname' [@code{solid=off}] +@deftypefn {MGL command} {} write 'fname' [@code{solid=off}] Exports current picture/frame to file 'fname' (file type is determined by extension). Solid (usually white) background will be used if @code{solid=on}. If 'fname'='' then the file @samp{frameNNNN.jpg} is used, where @samp{NNNN} is current frame id. -@end deffn +@end deftypefn @cindex setsize @anchor{setsize} -@deffn {MGL command} setsize @code{w h} +@deftypefn {MGL command} {} setsize @code{w h} Sets size of picture in pixels. This function call @strong{must be} placed before any plotting command because it completely remove picture content. In some program the call of this function is forbidden. -@end deffn +@end deftypefn @c ################################################################## @@ -481,69 +492,69 @@ These commands draw some simple objects like line, point, sphere, drop, cone and @cindex clf @anchor{clf} -@deffn {MGL command} clf +@deftypefn {MGL command} {} clf Clear the picture by removes all drawing from it. Does not change transformation matrix. -@end deffn +@end deftypefn @cindex ball @anchor{ball} -@deffn {MGL command} ball @code{x y} ['col'='r'] -@deffnx {MGL command} ball @code{x y z} ['col'='r'] +@deftypefn {MGL command} {} ball @code{x y} ['col'='r'] +@deftypefnx {MGL command} {} ball @code{x y z} ['col'='r'] Draws a point (ball) at position @{@var{x}, @var{y}, @var{z}@} with color defined by string @var{col}. -@end deffn +@end deftypefn @cindex line @anchor{line} -@deffn {MGL command} line @code{x1 y1 x2 y2} ['stl'=''] -@deffnx {MGL command} line @code{x1 y1 z1 x2 y2 z2} ['stl'=''] +@deftypefn {MGL command} {} line @code{x1 y1 x2 y2} ['stl'=''] +@deftypefnx {MGL command} {} line @code{x1 y1 z1 x2 y2 z2} ['stl'=''] Draws a geodesic line (straight line in Cartesian coordinates) from point @{@var{x1},@var{y1},@var{z1}@} to @{@var{x2},@var{y2},@var{z2}@} using line style @var{stl}. -@end deffn +@end deftypefn @cindex curve @anchor{curve} -@deffn {MGL command} curve @code{x1 y1 dx1 dy1 x2 y2 dx2 dy2} ['stl'=''] -@deffnx {MGL command} curve @code{x1 y1 z1 dx1 dy1 dz1 x2 y2 z2 dx2 dy2 dz2} ['stl'=''] +@deftypefn {MGL command} {} curve @code{x1 y1 dx1 dy1 x2 y2 dx2 dy2} ['stl'=''] +@deftypefnx {MGL command} {} curve @code{x1 y1 z1 dx1 dy1 dz1 x2 y2 z2 dx2 dy2 dz2} ['stl'=''] Draws Bezier-like curve from point @{@var{x1},@var{y1},@var{z1}@} to @{@var{x2},@var{y2},@var{z2}@} using line style @var{stl}. At this tangent is co-directed with @{@var{dx1},@var{dy1},@var{dz1}@}, @{@var{dx2},@var{dy2},@var{dz2}@} and proportional to its amplitude. -@end deffn +@end deftypefn @cindex facex @anchor{facex} -@deffn {MGL command} facex @code{x0 y0 z0 wy wz} ['stl'='' @code{d1=0 d2=0}] +@deftypefn {MGL command} {} facex @code{x0 y0 z0 wy wz} ['stl'='' @code{d1=0 d2=0}] @cindex facey @anchor{facey} -@deffnx {MGL command} facey @code{x0 y0 z0 wx wz} ['stl'='' @code{d1=0 d2=0}] +@deftypefnx {MGL command} {} facey @code{x0 y0 z0 wx wz} ['stl'='' @code{d1=0 d2=0}] @cindex facez @anchor{facez} -@deffnx {MGL command} facez @code{x0 y0 z0 wx wy} ['stl'='' @code{d1=0 d2=0}] +@deftypefnx {MGL command} {} facez @code{x0 y0 z0 wx wy} ['stl'='' @code{d1=0 d2=0}] Draws the solid rectangle (face) perpendicular to [x,y,z]-axis correspondingly at position @{@var{x0}, @var{y0}, @var{z0}@} with color @var{stl} and with widths @var{wx}, @var{wy}, @var{wz} along corresponding directions. At this colors can be the same for all vertexes or different if all 4 colors are specified for each vertex. Parameters @var{d1}!=0, @var{d2}!=0 set additional shift of the last vertex (i.e. to draw quadrangle). -@end deffn +@end deftypefn @cindex sphere @anchor{sphere} -@deffn {MGL command} sphere @code{x0 y0 r} ['col'='r'] -@deffnx {MGL command} sphere @code{x0 y0 z0 r} ['col'='r'] +@deftypefn {MGL command} {} sphere @code{x0 y0 r} ['col'='r'] +@deftypefnx {MGL command} {} sphere @code{x0 y0 z0 r} ['col'='r'] Draw the sphere with radius @var{r} and center at point @{@var{x0}, @var{y0}, @var{z0}@} and color @var{stl}. -@end deffn +@end deftypefn @cindex drop @anchor{drop} -@deffn {MGL command} drop @code{x0 y0 dx dy r} ['col'='b' @code{sh=1 asp=1}] -@deffnx {MGL command} drop @code{x0 y0 z0 dx dy dz r} ['col'='b' @code{sh=1 asp=1}] +@deftypefn {MGL command} {} drop @code{x0 y0 dx dy r} ['col'='b' @code{sh=1 asp=1}] +@deftypefnx {MGL command} {} drop @code{x0 y0 z0 dx dy dz r} ['col'='b' @code{sh=1 asp=1}] Draw the drop with radius @var{r} at point @{@var{x0},@var{y0},@var{z0}@} elongated in direction @{@var{dx},@var{dy},@var{dz}@} and with color @var{col}. Parameter @var{sh} set the degree of drop oblongness: @samp{0} is sphere, @samp{1} is maximally oblongness drop. Parameter @var{asp} set relative width of the drop (this is analogue of ``ellipticity'' for the sphere). @sref{Drops sample} -@end deffn +@end deftypefn @cindex cone @anchor{cone} -@deffn {MGL command} cone @code{x1 y1 z1 x2 y2 z2 r1} [@code{r2=-1} 'stl'='' @code{edge=off}] +@deftypefn {MGL command} {} cone @code{x1 y1 z1 x2 y2 z2 r1} [@code{r2=-1} 'stl'='' @code{edge=off}] Draw tube (or truncated cone if @var{edge}=@code{off}) between points @{@var{x1},@var{y1},@var{z1}@}, @{@var{x2},@var{y2},@var{z2}@} with radiuses at the edges @var{r1}, @var{r2}. If @var{r2}<0 then it is supposed that @var{r2}=@var{r1}. The cone color is defined by string @var{stl}. -@end deffn +@end deftypefn @cindex rect @anchor{rect} -@deffn {MGL command} rect @code{x1 y1 x2 y2} ['st'=''] -@deffnx {MGL command} rect @code{x1 y1 z1 x2 y2 z2} ['st'=''] +@deftypefn {MGL command} {} rect @code{x1 y1 x2 y2} ['st'=''] +@deftypefnx {MGL command} {} rect @code{x1 y1 z1 x2 y2 z2} ['st'=''] Draw rectangle from point @{@var{x1},@var{y1},@var{z1}@} to point @{@var{x2},@var{y2},@var{z2}@} using colors @var{stl}. If @var{stl} have 4 or more colors then it defines colors for each rectangle vertex (useful for making gradients, like @samp{wwrr}) else first color is used for whole rectangle. -@end deffn +@end deftypefn @c ################################################################## @node Text printing @MGL{}, Axis and Colorbar @MGL{}, Primitives drawing @MGL{}, MGL interface @@ -553,34 +564,34 @@ These commands draw the text. There are commands for drawing text in arbitrary p @cindex text @anchor{text} -@deffn {MGL command} text @code{x y} 'text' ['fnt'='' @code{size=-1.4}] -@deffnx {MGL command} text @code{x y z} 'text' ['fnt'='' @code{size=-1.4}] +@deftypefn {MGL command} {} text @code{x y} 'text' ['fnt'='' @code{size=-1.4}] +@deftypefnx {MGL command} {} text @code{x y z} 'text' ['fnt'='' @code{size=-1.4}] Draws unrotated text string @var{text} at position @{@var{x},@var{y},@var{z}@} with specified style @var{fnt} and @var{size}. By default parameters from @code{font} command are used. -@end deffn +@end deftypefn -@deffn {MGL command} text @code{x y dx dy} 'text' [@code{size=-1.4}] -@deffnx {MGL command} text @code{x y z dx dy dz} 'text' [@code{size=-1.4}] +@deftypefn {MGL command} {} text @code{x y dx dy} 'text' [@code{size=-1.4}] +@deftypefnx {MGL command} {} text @code{x y z dx dy dz} 'text' [@code{size=-1.4}] The command plots the string @var{text} at position @{@var{x},@var{y},@var{z}@} along direction @{@var{dx},@var{dy},@var{dz}@} with specified style @var{fnt} and @var{size}. By default parameters from @code{font} command are used. -@end deffn +@end deftypefn -@deffn {MGL command} text ydat 'text' ['fnt'='' @code{size=-1 zval=nan}] -@deffnx {MGL command} text xdat ydat 'text' ['fnt'='' @code{size=-1 zval=nan}] -@deffnx {MGL command} text xdat ydat zdat 'text' ['fnt'='' @code{size=-1}] +@deftypefn {MGL command} {} text ydat 'text' ['fnt'='' @code{size=-1 zval=nan}] +@deftypefnx {MGL command} {} text xdat ydat 'text' ['fnt'='' @code{size=-1 zval=nan}] +@deftypefnx {MGL command} {} text xdat ydat zdat 'text' ['fnt'='' @code{size=-1}] The command draws @var{text} along the curve between points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@} by font style @var{fnt} and with size @var{size}. The string @var{fnt} may contain symbols @samp{t} for printing the text under the curve (default), or @samp{T} for printing the text above the curve. The sizes of 1st dimension must be equal for all arrays @var{xdat.nx=ydat.nx=zdat.nx}. If array @var{xdat} is not specified then its an automatic array is used with values equidistantly distributed along x. If array @var{zdat} is not specified then @var{z}[i] = @var{zval} is used. @sref{Text sample} -@end deffn +@end deftypefn @cindex title @anchor{title} -@deffn {MGL command} title 'text' ['fnt'='' @code{size=-2}] +@deftypefn {MGL command} {} title 'text' ['fnt'='' @code{size=-2}] Print string @var{text} as title of the picture (at the top of the picture). Can be used at any place (even inside @ref{subplot}). -@end deffn +@end deftypefn @cindex fgets @anchor{fgets} -@deffn {MGL command} fgets @code{x y} 'fname' [@code{n=0} 'fnt'='' @code{size=-1.4}] -@deffnx {MGL command} fgets @code{x y z} 'fname' [@code{n=0} 'fnt'='' @code{size=-1.4}] +@deftypefn {MGL command} {} fgets @code{x y} 'fname' [@code{n=0} 'fnt'='' @code{size=-1.4}] +@deftypefnx {MGL command} {} fgets @code{x y z} 'fname' [@code{n=0} 'fnt'='' @code{size=-1.4}] Draws unrotated @var{n}-th line of file @var{fname} at position @{@var{x},@var{y},@var{z}@} with specified @var{size}. By default parameters from @ref{font} command are used. -@end deffn +@end deftypefn @c ################################################################## @@ -591,50 +602,50 @@ These commands draw the ``things for measuring'', like axis with ticks, colorbar @cindex axis @c @anchor{} -@deffn {MGL command} axis ['dir'='xyz' @code{adjust=off}] +@deftypefn {MGL command} {} axis ['dir'='xyz' @code{adjust=off}] Draws axes with ticks (@pxref{Axis settings @MGL{}}) in directions determined by string parameter @var{dir}.If string contain the symbol @samp{_} then tick labels are not printed. Font for ticks labels is determined by command @ref{font}. Ticks will be automatically adjusted if @var{adjust}=@code{on} (by call of @code{adjust 'dir'}). -@end deffn +@end deftypefn @cindex colorbar @anchor{colorbar} -@deffn {MGL command} colorbar ['sch'='' @code{pos=0}] +@deftypefn {MGL command} {} colorbar ['sch'='' @code{pos=0}] Draws colorbar with color scheme @var{sch} (current scheme if @code{sch=''}) at edge of plot. Parameter @var{pos} specifies the position of colorbar: @samp{0} - at right (default), @samp{1} - at left, @samp{2} - at top, @samp{3} - at bottom. If string @var{sch} contains @samp{<>^_} then the parameter @var{pos} is defined as: @code{pos=0} for @samp{>} (right), @code{pos=1} for @samp{<} (left), @code{pos=2} for @samp{^} (top), @code{pos=3} for @samp{_} (bottom). If string have @samp{A} then absolute (relative to picture) coordinates is used. @sref{Dens sample} -@end deffn +@end deftypefn -@deffn {MGL command} colorbar vdat ['sch'='' @code{pos=0}] +@deftypefn {MGL command} {} colorbar vdat ['sch'='' @code{pos=0}] The same as previous but with sharp colors @var{sch} (current palette if @code{sch=""}) for values @var{v}. @sref{ContD sample} -@end deffn +@end deftypefn -@deffn {MGL command} colorbar 'sch' @code{pos x y w h} +@deftypefn {MGL command} {} colorbar 'sch' @code{pos x y w h} The same as first one but at arbitrary position of subplot @{@var{x}, @var{y}@} (supposed to be in range [0,1]). Parameters @var{w}, @var{h} set the relative width and height of the colorbar. -@end deffn +@end deftypefn @cindex grid @anchor{grid} -@deffn {MGL command} grid ['dir'='xyz' 'pen'='B'] +@deftypefn {MGL command} {} grid ['dir'='xyz' 'pen'='B'] Draws grid lines perpendicular to direction determined by string parameter @var{dir}. The step of grid lines is the same as tick step for an @code{axis}. The style of lines is determined by @var{pen} parameter. -@end deffn +@end deftypefn @cindex box @anchor{box} -@deffn {MGL command} box ['stl'='k' @code{ticks=on}] +@deftypefn {MGL command} {} box ['stl'='k' @code{ticks=on}] Draws bounding box outside the plotting volume with line style 'stl'. If @code{ticks=on} then ticks are drawn with current axis setting. -@end deffn +@end deftypefn @cindex xlabel @anchor{xlabel} -@deffn {MGL command} xlabel 'text' [@code{pos=0 size=-1.4 shift=0}] +@deftypefn {MGL command} {} xlabel 'text' [@code{pos=0 size=-1.4 shift=0}] @cindex ylabel @anchor{ylabel} -@deffnx {MGL command} ylabel 'text' [@code{pos=0 size=-1.4 shift=0}] +@deftypefnx {MGL command} {} ylabel 'text' [@code{pos=0 size=-1.4 shift=0}] @cindex zlabel @anchor{zlabel} -@deffnx {MGL command} zlabel 'text' [@code{pos=0 size=-1.4 shift=0}] +@deftypefnx {MGL command} {} zlabel 'text' [@code{pos=0 size=-1.4 shift=0}] @cindex tlabel @anchor{tlabel} -@deffnx {MGL command} tlabel 'text' [@code{pos=0 size=-1.4 shift=0}] +@deftypefnx {MGL command} {} tlabel 'text' [@code{pos=0 size=-1.4 shift=0}] Prints the label @var{text} for x-,y-,z-,t-axis (here @samp{t} is ``ternary'' axis @math{t=1-x-y}). The position of label is determined by @var{pos} parameter. If @var{pos}=0 then label is printed at the center of axis. If @var{pos}>0 then label is printed at the maximum of axis (default). If @var{pos}<0 then label is printed at the minimum of axis. The font size is 1.4 times larger than the one for ticks @code{font}. Parameter @code{shift} specify additional shifting of the label. @xref{Text printing @MGL{}}. -@end deffn +@end deftypefn @c ################################################################## @node Legend @MGL{}, 1D plotting @MGL{}, Axis and Colorbar @MGL{}, MGL interface @@ -644,37 +655,37 @@ These commands draw legend to the graph (useful for @ref{1D plotting @MGL{}}). L @cindex legend @anchor{legend} -@deffn {MGL command} legend [@code{pos=3} 'fnt'='rL' @code{size=-1 llen=0.1}] +@deftypefn {MGL command} {} legend [@code{pos=3} 'fnt'='rL' @code{size=-1 llen=0.1}] Draws legend of accumulated legend entries by font @var{fnt} with specified @var{size}. Parameter @var{pos} sets the position of the legend: @samp{0} is bottom left corner, @samp{1} is bottom right corner, @samp{2} is top left corner, @samp{3} is top right corner (is default). -@end deffn +@end deftypefn -@deffn {MGL command} legend @code{x y} ['fnt'='rL' @code{size=-1 llen=0.1}] +@deftypefn {MGL command} {} legend @code{x y} ['fnt'='rL' @code{size=-1 llen=0.1}] Draws legend of accumulated legend entries by font @var{fnt} with @var{size}. Position of legend in the current subplot is determined by parameter @var{x}, @var{y} which supposed to be normalized to interval [0,1]. -@end deffn +@end deftypefn @cindex addlegend @anchor{addlegend} -@deffn {MGL command} addlegend 'text' 'stl' +@deftypefn {MGL command} {} addlegend 'text' 'stl' Adds string @var{text} to internal legend accumulator. The style of described line and mark is specified in string @var{stl} (@pxref{Line styles}). Maximal number of entries is 100. -@end deffn +@end deftypefn @cindex clearlegend @anchor{clearlegend} -@deffn {MGL command} clearlegend +@deftypefn {MGL command} {} clearlegend Clears saved legend strings. -@end deffn +@end deftypefn @cindex legendbox @anchor{legendbox} -@deffn {MGL command} legendbox @code{val} +@deftypefn {MGL command} {} legendbox @code{val} Switches on/off the drawing of a box near legend. By default, the box is drawn. -@end deffn +@end deftypefn @cindex legendmarks @anchor{legendmarks} -@deffn {MGL command} legendmarks @code{val} +@deftypefn {MGL command} {} legendmarks @code{val} Set the number of marks in the legend. By default 1 mark is used. -@end deffn +@end deftypefn @c ################################################################## @node 1D plotting @MGL{}, 2D plotting @MGL{}, Legend @MGL{}, MGL interface @@ -686,129 +697,129 @@ The plots are drawn for each row if one of the data is the matrix. By any case t @cindex plot @anchor{plot} -@deffn {MGL command} plot ydat ['stl'='' @code{zval=nan}] -@deffnx {MGL command} plot xdat ydat ['stl'='' @code{zval=nan}] -@deffnx {MGL command} plot xdat ydat zdat ['stl'=''] +@deftypefn {MGL command} {} plot ydat ['stl'=''] +@deftypefnx {MGL command} {} plot xdat ydat ['stl'=''] +@deftypefnx {MGL command} {} plot xdat ydat zdat ['stl'=''] Draws continuous lines between points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. See also @ref{area}, @ref{step}, @ref{stem}, @ref{tube}, @ref{mark}, @ref{error}, @ref{belt}, @ref{tens}. @sref{Plot sample} -@end deffn +@end deftypefn @cindex radar @anchor{radar} -@deffn {MGL command} radar adat ['stl'='' @code{r=-1}] +@deftypefn {MGL command} {} radar adat ['stl'='' @code{r=-1}] Draws radar chart which is continuous lines between points located on an radial lines (like plot in Polar coordinates). The plots are drawn for each row if one of the data is the matrix. Parameter @var{r} set the additional shift of data (i.e. the data @var{adat}+@var{r} is used instead of @var{adat}). If @code{r<0} then @code{r=max(0, -min(adat)}. String @var{pen} specifies the color and style of line and marks (@pxref{Line styles}). By default (@code{stl=""}) solid line with color from palette is used (@pxref{Line styles}). If @var{pen} containt @samp{#} symbol then "grid" (radial lines and circle for @var{r}) is drawn See also @ref{plot}. @sref{Radar sample} -@end deffn +@end deftypefn @cindex tens @anchor{tens} -@deffn {MGL command} tens ydat cdat ['stl'='' @code{zval=nan}] -@deffnx {MGL command} tens xdat ydat cdat ['stl'='' @code{zval=nan}] -@deffnx {MGL command} tens xdat ydat zdat cdat ['stl'=''] +@deftypefn {MGL command} {} tens ydat cdat ['stl'=''] +@deftypefnx {MGL command} {} tens xdat ydat cdat ['stl'=''] +@deftypefnx {MGL command} {} tens xdat ydat zdat cdat ['stl'=''] Draws continuous lines between points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@} with color defined by @var{cdat}[i] (look like tension plot). See also @ref{plot}, @ref{mesh}, @ref{fall}. @sref{Tens sample} -@end deffn +@end deftypefn @cindex area @anchor{area} -@deffn {MGL command} area ydat ['stl'='' @code{zval=nan}] -@deffnx {MGL command} area xdat ydat ['stl'='' @code{zval=nan}] -@deffnx {MGL command} area xdat ydat zdat ['stl'=''] +@deftypefn {MGL command} {} area ydat ['stl'=''] +@deftypefnx {MGL command} {} area xdat ydat ['stl'=''] +@deftypefnx {MGL command} {} area xdat ydat zdat ['stl'=''] Draws continuous lines between points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@} and fills it down to axis (to axis plane in 3D). You can use gradient filling if number of specified colors is equal to 2*number of curves. If string contain symbol @samp{a} then lines are drawn one above another (like summation). See also @ref{plot}, @ref{bars}, @ref{stem}, @ref{region}. @sref{Area sample} -@end deffn +@end deftypefn @cindex region @anchor{region} -@deffn {MGL command} region fdat gdat ['stl'='' @code{inside=off}] -@deffnx {MGL command} region xdat fdat gdat ['stl'='' @code{inside=off}] +@deftypefn {MGL command} {} region fdat gdat ['stl'='' @code{inside=off}] +@deftypefnx {MGL command} {} region xdat fdat gdat ['stl'='' @code{inside=off}] Fills area between curves @{@var{xdat}[i], @var{fdat}[i]@} and @{@var{xdat}[i], @var{gdat}[i]@}. Parameter @code{inside=off} set to fill are with y1adat (minimum, lower quartile (Q1), median (Q2), upper quartile (Q3) and maximum) along second (j-th) direction. See also @ref{plot}, @ref{error}, @ref{bars}. @sref{BoxPlot sample} -@end deffn +@end deftypefn @c ################################################################## @node 2D plotting @MGL{}, 3D plotting @MGL{}, 1D plotting @MGL{}, MGL interface @@ -820,116 +831,116 @@ String parameter @var{sch} sets the color scheme (@pxref{Color scheme}). Previou @cindex surf @anchor{surf} -@deffn {MGL command} surf zdat ['sch'=''] -@deffnx {MGL command} surf xdat ydat zdat ['sch'=''] +@deftypefn {MGL command} {} surf zdat ['sch'=''] +@deftypefnx {MGL command} {} surf xdat ydat zdat ['sch'=''] Draws surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. See also @ref{mesh}, @ref{dens}, @ref{belt}, @ref{tile}, @ref{boxs}, @ref{surfc}, @ref{surfa}. @sref{Surf sample} -@end deffn +@end deftypefn @cindex mesh @anchor{mesh} -@deffn {MGL command} mesh zdat ['sch'=''] -@deffnx {MGL command} mesh xdat ydat zdat ['sch'=''] +@deftypefn {MGL command} {} mesh zdat ['sch'=''] +@deftypefnx {MGL command} {} mesh xdat ydat zdat ['sch'=''] Draws mesh lines for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. See also @ref{surf}, @ref{fall}, @ref{meshnum}, @ref{cont}, @ref{tens}. @sref{Mesh sample} -@end deffn +@end deftypefn @cindex fall @anchor{fall} -@deffn {MGL command} fall zdat ['sch'=''] -@deffnx {MGL command} fall xdat ydat zdat ['sch'=''] +@deftypefn {MGL command} {} fall zdat ['sch'=''] +@deftypefnx {MGL command} {} fall xdat ydat zdat ['sch'=''] Draws fall lines for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. If @var{sch} contain @samp{x} then lines are drawn along x-direction else (by default) lines are drawn along y-direction. See also @ref{belt}, @ref{mesh}, @ref{tens}, @ref{meshnum}. @sref{Fall sample} -@end deffn +@end deftypefn @cindex belt @anchor{belt} -@deffn {MGL command} belt zdat ['sch'=''] -@deffnx {MGL command} belt xdat ydat zdat ['sch'=''] +@deftypefn {MGL command} {} belt zdat ['sch'=''] +@deftypefnx {MGL command} {} belt xdat ydat zdat ['sch'=''] Draws belts for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. If @var{sch} contain @samp{x} then belts are drawn along x-direction else (by default) lines are drawn along y-direction. See also @ref{fall}, @ref{surf}, @ref{plot}, @ref{meshnum}. @sref{Belt sample} -@end deffn +@end deftypefn @cindex boxs @anchor{boxs} -@deffn {MGL command} boxs zdat ['sch'=''] -@deffnx {MGL command} boxs xdat ydat zdat ['sch'=''] +@deftypefn {MGL command} {} boxs zdat ['sch'=''] +@deftypefnx {MGL command} {} boxs xdat ydat zdat ['sch'=''] Draws vertical boxes for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. See also @ref{surf}, @ref{dens}, @ref{tile}, @ref{step}. @sref{Boxs sample} -@end deffn +@end deftypefn @cindex tile @anchor{tile} -@deffn {MGL command} tile zdat ['sch'=''] -@deffnx {MGL command} tile xdat ydat zdat ['sch'=''] +@deftypefn {MGL command} {} tile zdat ['sch'=''] +@deftypefnx {MGL command} {} tile xdat ydat zdat ['sch'=''] Draws horizontal tiles for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. Such plot can be used as 3d generalization of @ref{step}. See also @ref{surf}, @ref{boxs}, @ref{step}, @ref{tiles}. @sref{Tile sample} -@end deffn +@end deftypefn @cindex dens @anchor{dens} -@deffn {MGL command} dens zdat ['sch'='' @code{zval=nan}] -@deffnx {MGL command} dens xdat ydat zdat ['sch'='' @code{zval=nan}] +@deftypefn {MGL command} {} dens zdat ['sch'=''] +@deftypefnx {MGL command} {} dens xdat ydat zdat ['sch'=''] Draws density plot for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} at @var{z} = @var{zVal}. See also @ref{surf}, @ref{cont}, @ref{contf}, @ref{boxs}, @ref{tile}, @code{dens[xyz]}. @sref{Dens sample} -@end deffn +@end deftypefn @cindex cont @anchor{cont} -@deffn {MGL command} cont vdat zdat ['sch'='' @code{zval=nan}] -@deffnx {MGL command} cont vdat xdat ydat zdat ['sch'='' @code{zval=nan}] -Draws contour lines for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} at @var{z} = @var{zVal} (or for @var{z}=@var{vdat}[k] if @code{zval=nan}). Contours are plotted for @var{zdat}[i,j]=@var{vdat}[k] for all k. If string @var{stl} contain 't' (or 'T') symbol then contour labels will be drawn below (or above) the contours. See also @ref{dens}, @ref{contf}, @ref{contd}, @ref{axial}, @code{cont[xyz]}. @sref{Cont sample} -@end deffn +@deftypefn {MGL command} {} cont vdat zdat ['sch'=''] +@deftypefnx {MGL command} {} cont vdat xdat ydat zdat ['sch'=''] +Draws contour lines for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} at @var{z} = @var{zVal} (or for @var{z}=@var{vdat}[k] if). Contours are plotted for @var{zdat}[i,j]=@var{vdat}[k] for all k. If string @var{stl} contain 't' (or 'T') symbol then contour labels will be drawn below (or above) the contours. See also @ref{dens}, @ref{contf}, @ref{contd}, @ref{axial}, @code{cont[xyz]}. @sref{Cont sample} +@end deftypefn -@deffn {MGL command} cont zdat ['sch'='' @code{num=7 zval=nan}] -@deffnx {MGL command} cont xdat ydat zdat ['sch'='' @code{num=7 zval=nan}] +@deftypefn {MGL command} {} cont zdat ['sch'='' @code{num=7 zval=nan}] +@deftypefnx {MGL command} {} cont xdat ydat zdat ['sch'='' @code{num=7 zval=nan}] The same as previous one with vector @var{vdat} of @var{num}-th elements equidistantly distributed in color range (see, @code{caxis}). -@end deffn +@end deftypefn @cindex contf @anchor{contf} -@deffn {MGL command} contf vdat zdat ['sch'='' @code{zval=nan}] -@deffnx {MGL command} contf vdat xdat ydat zdat ['sch'='' @code{zval=nan}] -Draws solid (or filled) contours for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} at @var{z} = @var{zVal} (or for @var{z}=@var{vdat}[k] if @code{zval=nan}). Contours are plotted for @var{zdat}[i,j]=@var{vdat}[k] for all k (must be @code{vdat.nx>2}). See also @ref{dens}, @ref{cont}, @ref{contd}, @code{contf[xyz]}. @sref{ContF sample} -@end deffn +@deftypefn {MGL command} {} contf vdat zdat ['sch'=''] +@deftypefnx {MGL command} {} contf vdat xdat ydat zdat ['sch'=''] +Draws solid (or filled) contours for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} at @var{z} = @var{zVal} (or for @var{z}=@var{vdat}[k] if). Contours are plotted for @var{zdat}[i,j]=@var{vdat}[k] for all k (must be @code{vdat.nx>2}). See also @ref{dens}, @ref{cont}, @ref{contd}, @code{contf[xyz]}. @sref{ContF sample} +@end deftypefn -@deffn {MGL command} contf zdat ['sch'='' @code{num=7 zval=nan}] -@deffnx {MGL command} contf xdat ydat zdat ['sch'='' @code{num=7 zval=nan}] +@deftypefn {MGL command} {} contf zdat ['sch'='' @code{num=7 zval=nan}] +@deftypefnx {MGL command} {} contf xdat ydat zdat ['sch'='' @code{num=7 zval=nan}] The same as previous one with vector @var{vdat} of @var{num}-th elements equidistantly distributed in color range (see, @code{caxis}). -@end deffn +@end deftypefn @cindex contd @anchor{contd} -@deffn {MGL command} contd vdat zdat ['sch'='' @code{zval=nan}] -@deffnx {MGL command} contd vdat xdat ydat zdat ['sch'='' @code{zval=nan}] -Draws solid (or filled) contours for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} at @var{z} = @var{zVal} (or for @var{z}=@var{vdat}[k] if @code{zval=nan}) with manual colors. Contours are plotted for @var{zdat}[i,j]=@var{vdat}[k] for all k (must be @code{vdat.nx>2}). The color of k-th contour is @code{sch[k%strlen(sch)]}. See also @ref{dens}, @ref{cont}, @ref{contf}. @sref{ContD sample} -@end deffn +@deftypefn {MGL command} {} contd vdat zdat ['sch'=''] +@deftypefnx {MGL command} {} contd vdat xdat ydat zdat ['sch'=''] +Draws solid (or filled) contours for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} at @var{z} = @var{zVal} (or for @var{z}=@var{vdat}[k] if) with manual colors. Contours are plotted for @var{zdat}[i,j]=@var{vdat}[k] for all k (must be @code{vdat.nx>2}). The color of k-th contour is @code{sch[k%strlen(sch)]}. See also @ref{dens}, @ref{cont}, @ref{contf}. @sref{ContD sample} +@end deftypefn -@deffn {MGL command} contd zdat ['sch'='' @code{num=7 zval=nan}] -@deffnx {MGL command} contd xdat ydat zdat ['sch'='' @code{num=7 zval=nan}] +@deftypefn {MGL command} {} contd zdat ['sch'='' @code{num=7 zval=nan}] +@deftypefnx {MGL command} {} contd xdat ydat zdat ['sch'='' @code{num=7 zval=nan}] The same as previous one with vector @var{vdat} of @var{num}-th elements equidistantly distributed in color range (see, @code{caxis}). -@end deffn +@end deftypefn @cindex axial @anchor{axial} -@deffn {MGL command} axial vdat zdat ['sch'=''] -@deffnx {MGL command} axial vdat xdat ydat zdat ['sch'=''] +@deftypefn {MGL command} {} axial vdat zdat ['sch'=''] +@deftypefnx {MGL command} {} axial vdat xdat ydat zdat ['sch'=''] Draws surface which is result of contour plot rotation surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. Contours are plotted for @var{zdat}[i,j]=@var{vdat}[k] for all k. If string @var{sch} have symbol @samp{#} then wire plot is produced. If string @var{sch} contain symbols @samp{x}, @samp{y} or @samp{z} then rotation axis @code{axialdir} will be set to specified direction. If string @var{sch} have symbol @samp{#} then wire plot is produced. See also @ref{cont}, @ref{contf}, @ref{torus}, @ref{surf3}. @sref{Axial sample} -@end deffn +@end deftypefn -@deffn {MGL command} axial zdat ['sch'='' @code{num=3}] -@deffnx {MGL command} axial xdat ydat zdat ['sch'='' @code{num=3}] +@deftypefn {MGL command} {} axial zdat ['sch'='' @code{num=3}] +@deftypefnx {MGL command} {} axial xdat ydat zdat ['sch'='' @code{num=3}] The same as previous one with vector @var{vdat} of @var{num}-th elements equidistantly distributed in color range (see, @code{caxis}). -@end deffn +@end deftypefn @cindex grad @anchor{grad} -@deffn {MGL command} grad pdat ['sch'='' @code{num=5 zval=nan}] -@deffnx {MGL command} grad xdat ydat pdat ['sch'='' @code{num=5 zval=nan}] -@deffnx {MGL command} grad xdat ydat zdat pdat ['sch'='' @code{num=5}] +@deftypefn {MGL command} {} grad pdat ['sch'='' @code{num=5 zval=nan}] +@deftypefnx {MGL command} {} grad xdat ydat pdat ['sch'='' @code{num=5 zval=nan}] +@deftypefnx {MGL command} {} grad xdat ydat zdat pdat ['sch'='' @code{num=5}] Draws gradient lines for scalar field @var{pdat} specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j]@} or @{@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]@}. String @var{sch} sets the color scheme. Previous color scheme is used by default. Number of lines is proportional to @var{num}. If @var{num}<0 then lines start from borders only. See also @ref{dens}, @ref{cont}, @ref{dens3}, @ref{cont3}, @ref{flow}. @sref{Grad sample} -@end deffn +@end deftypefn @cindex grid2 @anchor{grid2} -@deffn {MGL command} grid2 zdat ['sch'='' @code{zval=nan}] -@deffnx {MGL command} grid2 xdat ydat zdat ['sch'='' @code{zval=nan}] +@deftypefn {MGL command} {} grid2 zdat ['sch'=''] +@deftypefnx {MGL command} {} grid2 xdat ydat zdat ['sch'=''] Draws grid lines for density plot of surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} at @var{z} = @var{zVal}. See also @ref{dens}, @ref{cont}, @ref{contf}. -@end deffn +@end deftypefn @c ################################################################## @@ -943,94 +954,94 @@ String paramter @var{sch} sets the color scheme (@pxref{Color scheme}). Previous @cindex surf3 @anchor{surf3} -@deffn {MGL command} surf3 adat @code{val} ['sch'=''] -@deffnx {MGL command} surf3 xdat ydat zdat adat @code{val} ['sch'=''] +@deftypefn {MGL command} {} surf3 adat @code{val} ['sch'=''] +@deftypefnx {MGL command} {} surf3 xdat ydat zdat adat @code{val} ['sch'=''] Draws isosurface plot for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]) at @var{a}(x,y,z)=@var{val}. If string contain @samp{#} then wire plot is produced. See also @ref{cloud}, @ref{dens3}, @ref{surf3c}, @ref{surf3a}, @ref{axial}. @sref{Surf3 sample} -@end deffn +@end deftypefn -@deffn {MGL command} surf3 adat ['sch'='' @code{num=5}] -@deffnx {MGL command} surf3 xdat ydat zdat adat ['sch'='' @code{num=5}] +@deftypefn {MGL command} {} surf3 adat ['sch'='' @code{num=5}] +@deftypefnx {MGL command} {} surf3 xdat ydat zdat adat ['sch'='' @code{num=5}] Draws @var{num}-th uniformly distributed in color range (see @ref{caxis}) isosurfaces for 3d data specified parametrically. -@end deffn +@end deftypefn @cindex dens3 @anchor{dens3} -@deffn {MGL command} dens3 adat 'dir' [@code{sval=-1} 'sch'=''] -@deffnx {MGL command} dens3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'=''] +@deftypefn {MGL command} {} dens3 adat 'dir' [@code{sval=-1} 'sch'=''] +@deftypefnx {MGL command} {} dens3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'=''] Draws density plot for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). Density is plotted at slice @var{sval} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. If string @var{stl} have symbol @samp{#} then grid lines are drawn. See also @ref{cont3}, @ref{contf3}, @ref{dens}, @ref{grid3}. @sref{Dens3 sample} -@end deffn +@end deftypefn @cindex densa @anchor{densa} -@deffn {MGL command} densa adat ['sch'=''] -@deffnx {MGL command} densa xdat ydat zdat adat ['sch'=''] +@deftypefn {MGL command} {} densa adat ['sch'=''] +@deftypefnx {MGL command} {} densa xdat ydat zdat adat ['sch'=''] Draws density plots at all central slices of the 3d data specified parametrically. -@end deffn +@end deftypefn @cindex cont3 @anchor{cont3} -@deffn {MGL command} cont3 vdat adat 'dir' [@code{sval=-1} 'sch'=''] -@deffnx {MGL command} cont3 vdat xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'=''] +@deftypefn {MGL command} {} cont3 vdat adat 'dir' [@code{sval=-1} 'sch'=''] +@deftypefnx {MGL command} {} cont3 vdat xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'=''] Draws contour plot for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). Contours are plotted for values specified in array @var{vdat} at slice @var{sval} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. If string @var{stl} have symbol @samp{#} then grid lines are drawn. If string @var{stl} contain 't' (or 'T') symbol then contour labels will be drawn below (or above) the contours. See also @ref{dens3}, @ref{contf3}, @ref{cont}, @ref{grid3}. @sref{Cont3 sample} -@end deffn +@end deftypefn -@deffn {MGL command} cont3 adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}] -@deffnx {MGL command} cont3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}] +@deftypefn {MGL command} {} cont3 adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}] +@deftypefnx {MGL command} {} cont3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}] The same as previous one with vector @var{vdat} of @var{num}-th elements equidistantly distributed in color range (see @code{caxis}). -@end deffn +@end deftypefn @cindex conta @anchor{conta} -@deffn {MGL command} conta adat ['sch'='' @code{num=7}] -@deffnx {MGL command} conta xdat ydat zdat adat ['sch'='' @code{num=7}] +@deftypefn {MGL command} {} conta adat ['sch'='' @code{num=7}] +@deftypefnx {MGL command} {} conta xdat ydat zdat adat ['sch'='' @code{num=7}] Draws contour plots at all central slices of the 3d data specified parametrically. -@end deffn +@end deftypefn @cindex contf3 @anchor{contf3} -@deffn {MGL command} contf3 vdat adat 'dir' [@code{sval=-1} 'sch'=''] -@deffnx {MGL command} contf3 vdat xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'=''] +@deftypefn {MGL command} {} contf3 vdat adat 'dir' [@code{sval=-1} 'sch'=''] +@deftypefnx {MGL command} {} contf3 vdat xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'=''] Draws solid contour plot for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). Contours are plotted for values specified in array @var{vdat} at slice @var{sval} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. If string @var{stl} have symbol @samp{#} then grid lines are drawn. See also @ref{dens3}, @ref{cont3}, @ref{contf}, @ref{grid3}. @sref{ContF3 sample} -@end deffn +@end deftypefn -@deffn {MGL command} contf3 adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}] -@deffnx {MGL command} contf3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}] +@deftypefn {MGL command} {} contf3 adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}] +@deftypefnx {MGL command} {} contf3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'='' @code{num=7}] The same as previous one with vector @var{vdat} of @var{num}-th elements equidistantly distributed in color range (see @ref{caxis}). -@end deffn +@end deftypefn @cindex contfa @anchor{contfa} -@deffn {MGL command} contfa adat ['sch'='' @code{num=7}] -@deffnx {MGL command} contfa xdat ydat zdat adat ['sch'='' @code{num=7}] +@deftypefn {MGL command} {} contfa adat ['sch'='' @code{num=7}] +@deftypefnx {MGL command} {} contfa xdat ydat zdat adat ['sch'='' @code{num=7}] Draws solid contour plots at all central slices of the 3d data specified parametrically. -@end deffn +@end deftypefn @cindex grid3 @anchor{grid3} -@deffn {MGL command} grid3 adat 'dir' [@code{sval=-1} 'sch'=''] -@deffnx {MGL command} grid3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'=''] +@deftypefn {MGL command} {} grid3 adat 'dir' [@code{sval=-1} 'sch'=''] +@deftypefnx {MGL command} {} grid3 xdat ydat zdat adat 'dir' [@code{sval=-1} 'sch'=''] Draws grid for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). Grid is plotted at slice @var{sval} in @var{dir}=@{@samp{x}, @samp{y}, @samp{z}@} direction. See also @ref{cont3}, @ref{contf3}, @ref{dens3}, @ref{grid2}. @sref{Dens3 sample} -@end deffn +@end deftypefn @cindex grida @anchor{grida} -@deffn {MGL command} grida adat ['sch'=''] -@deffnx {MGL command} grida xdat ydat zdat adat ['sch'=''] +@deftypefn {MGL command} {} grida adat ['sch'=''] +@deftypefnx {MGL command} {} grida xdat ydat zdat adat ['sch'=''] Draws grids at all central slices of the 3d data specified parametrically. -@end deffn +@end deftypefn @cindex cloud @anchor{cloud} -@deffn {MGL command} cloud adat ['sch'=''] -@deffnx {MGL command} cloud xdat ydat zdat adat ['sch'=''] +@deftypefn {MGL command} {} cloud adat ['sch'=''] +@deftypefnx {MGL command} {} cloud xdat ydat zdat adat ['sch'=''] Draws cloud for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]). This plot is a set of cubes with color and transparency proportional to value of @var{adat}. The resulting plot is like cloud -- low value is transparent but higher ones are not. The number of plotting cells depend on @ref{meshnum}. Paramater @var{alpha} changes the overall transparency of plot. See also @ref{surf3}. @sref{Cloud sample} -@end deffn +@end deftypefn @cindex beam @anchor{beam} -@deffn {MGL command} beam tr g1 g2 adat @code{rval} ['sch'='' @code{flag=0 num=3}] +@deftypefn {MGL command} {} beam tr g1 g2 adat @code{rval} ['sch'='' @code{flag=0 num=3}] Draws @var{num}-th uniformly distributed in color range (see @code{caxis}) isosurfaces for 3d array @var{adat}. This is special kind of plot for @var{adat} specified in accompanied coordinates along curve @var{tr} with orts @var{g1}, @var{g2} and with transverse scale @var{rval}. Variable @var{flag} is bitwise: @samp{0x1} - draw in accompanied (not laboratory) coordinates; @samp{0x2} - draw projection to @math{\rho-z} plane; @samp{0x4} - draw normalized in each slice field. The x-size of data arrays @var{tr}, @var{g1}, @var{g2} must be nx>2. The y-size of data arrays @var{tr}, @var{g1}, @var{g2} and z-size of the data array @var{a} must be equal. See also @ref{surf3}. -@end deffn +@end deftypefn @c ################################################################## @@ -1043,62 +1054,62 @@ String paramter @var{sch} sets the color scheme (@pxref{Color scheme}). Previous @cindex surfc @anchor{surfc} -@deffn {MGL command} surfc zdat cdat ['sch'=''] -@deffnx {MGL command} surfc xdat ydat zdat cdat ['sch'=''] +@deftypefn {MGL command} {} surfc zdat cdat ['sch'=''] +@deftypefnx {MGL command} {} surfc xdat ydat zdat cdat ['sch'=''] Draws surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} and color it by matrix @var{cdat}[i,j]. See also @ref{surf}, @ref{surfa}, @ref{surf3c}. @sref{SurfC sample} -@end deffn +@end deftypefn @cindex surf3c @anchor{surf3c} -@deffn {MGL command} surf3c adat cdat @code{val} ['sch'=''] -@deffnx {MGL command} surf3c xdat ydat zdat adat cdat @code{val} ['sch'=''] +@deftypefn {MGL command} {} surf3c adat cdat @code{val} ['sch'=''] +@deftypefnx {MGL command} {} surf3c xdat ydat zdat adat cdat @code{val} ['sch'=''] Draws isosurface plot for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]) at @var{a}(x,y,z)=@var{val}. It is mostly the same as @ref{surf3} command but the color of isosurface depends on values of array @var{cdat}. If string contain @samp{#} then wire plot is produced. See also @ref{surf3}, @ref{surfc}, @ref{surf3a}. @sref{Surf3C sample} -@end deffn +@end deftypefn -@deffn {MGL command} surf3c adat cdat ['sch'='' @code{num=5}] -@deffnx {MGL command} surf3c xdat ydat zdat adat cdat ['sch'='' @code{num=5}] +@deftypefn {MGL command} {} surf3c adat cdat ['sch'='' @code{num=5}] +@deftypefnx {MGL command} {} surf3c xdat ydat zdat adat cdat ['sch'='' @code{num=5}] Draws @var{num}-th uniformly distributed in color range (see @code{caxis}) isosurfaces for 3d data specified parametrically. -@end deffn +@end deftypefn @cindex surfa @anchor{surfa} -@deffn {MGL command} surfa zdat cdat ['sch'=''] -@deffnx {MGL command} surfa xdat ydat zdat cdat ['sch'=''] +@deftypefn {MGL command} {} surfa zdat cdat ['sch'=''] +@deftypefnx {MGL command} {} surfa xdat ydat zdat cdat ['sch'=''] Draws surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@} and transparent it by matrix @var{cdat}[i,j]. See also @ref{surf}, @ref{surfc}, @ref{surf3a}, @ref{tiles}. @sref{SurfA sample} -@end deffn +@end deftypefn @cindex surf3a @anchor{surf3a} -@deffn {MGL command} surf3a adat cdat @code{val} ['sch'=''] -@deffnx {MGL command} surf3a xdat ydat zdat adat cdat @code{val} ['sch'=''] +@deftypefn {MGL command} {} surf3a adat cdat @code{val} ['sch'=''] +@deftypefnx {MGL command} {} surf3a xdat ydat zdat adat cdat @code{val} ['sch'=''] Draws isosurface plot for 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]) at @var{a}(x,y,z)=@var{val}. It is mostly the same as @ref{surf3} command but the transparency of isosurface depends on values of array @var{cdat}. If string contain @samp{#} then wire plot is produced. See also @ref{surf3}, @ref{surfa}, @ref{surf3c}. @sref{Surf3A sample} -@end deffn +@end deftypefn -@deffn {MGL command} surf3a adat cdat ['sch'='' @code{num=5}] -@deffnx {MGL command} surf3a xdat ydat zdat adat cdat ['sch'='' @code{num=5}] +@deftypefn {MGL command} {} surf3a adat cdat ['sch'='' @code{num=5}] +@deftypefnx {MGL command} {} surf3a xdat ydat zdat adat cdat ['sch'='' @code{num=5}] Draws @var{num}-th uniformly distributed in color range (see @code{caxis}) isosurfaces for 3d data specified parametrically. -@end deffn +@end deftypefn @cindex tiles @anchor{tiles} -@deffn {MGL command} tiles zdat rdat ['sch'=''] -@deffnx {MGL command} tiles xdat ydat zdat rdat ['sch'=''] +@deftypefn {MGL command} {} tiles zdat rdat ['sch'=''] +@deftypefnx {MGL command} {} tiles xdat ydat zdat rdat ['sch'=''] Draws horizontal tiles for surface specified parametrically @{@var{xdat}[i,j], @var{ydat}[i,j], @var{zdat}[i,j]@}. It is mostly the same as @ref{tile} but the size of tiles is determined by @var{rdat} array. See also @ref{surfa}, @ref{tile}. @sref{TileS sample} -@end deffn +@end deftypefn @cindex map @anchor{map} -@deffn {MGL command} map udat vdat ['sch'='' @code{pnts=on}] -@deffnx {MGL command} map xdat ydat udat vdat ['sch'='' @code{pnts=on}] +@deftypefn {MGL command} {} map udat vdat ['sch'='' @code{pnts=on}] +@deftypefnx {MGL command} {} map xdat ydat udat vdat ['sch'='' @code{pnts=on}] Draws mapping plot for matrixes @{@var{udat}, @var{vdat} @} which parametrically depend on coordinates @var{xdat}, @var{ydat}. The previous position of the cell (point) is marked by color. Height is proportional to Jacobian(udat,vdat). This plot is like Arnold diagram ???. If @code{pnts=off} then face is drawn otherwise the color ball at matrix knots are drawn. The size of @var{udat} and @var{vdat} must be the same. @sref{Map sample} -@end deffn +@end deftypefn @cindex stfa @anchor{stfa} -@deffn {MGL command} stfa re im @code{dn} ['sch'='' @code{pnts=on}] -@deffnx {MGL command} stfa xdat ydat re im @code{dn} ['sch'='' @code{pnts=on}] +@deftypefn {MGL command} {} stfa re im @code{dn} ['sch'='' @code{pnts=on}] +@deftypefnx {MGL command} {} stfa xdat ydat re im @code{dn} ['sch'='' @code{pnts=on}] Draws spectrogram of complex array @var{re}+i*@code{im} for Fourier size of @var{dn} points at plane @var{z=zVal}. Parameter @var{dn} is arbitrary even integer. For example in 1D case, result is density plot of data @math{res[i,j]=|\sum_d^dn exp(I*j*d)*(re[i*dn+d]+I*im[i*dn+d])|/dn} with size @{int(nx/dn), dn, ny@}. @sref{STFA sample} -@end deffn +@end deftypefn @@ -1115,88 +1126,88 @@ The size of @var{udat}, @var{vdat} and @var{wdat} must be equal. The minor dimen @cindex traj @anchor{traj} -@deffn {MGL command} traj xdat ydat udat vdat ['sch'='' @code{zval=nan len=0}] -@deffnx {MGL command} traj xdat ydat zdat udat vdat wdat ['sch'='' @code{len=0}] +@deftypefn {MGL command} {} traj xdat ydat udat vdat ['sch'='' @code{zval=nan len=0}] +@deftypefnx {MGL command} {} traj xdat ydat zdat udat vdat wdat ['sch'='' @code{len=0}] Draws vectors @{@var{udat}, @var{vdat}, @var{wdat}@} along a curve @var{xdat}, @var{ydat}, @var{zdat}. The length and color of arrows are proportional to @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. See also @code{vect}. @sref{Traj sample} -@end deffn +@end deftypefn @cindex vect @anchor{vect} -@deffn {MGL command} vect udat vdat ['sch'='' @code{zval=nan flag=0}] -@deffnx {MGL command} vect xdat ydat udat vdat ['sch'='' @code{zval=nan flag=0}] +@deftypefn {MGL command} {} vect udat vdat ['sch'='' @code{zval=nan flag=0}] +@deftypefnx {MGL command} {} vect xdat ydat udat vdat ['sch'='' @code{zval=nan flag=0}] Draws plane vector field plot for the field @{@var{udat}, @var{vdat}@} depending parametrically on coordinates @var{xdat}, @var{ydat} at level @var{z=zval}. The length and color of arrows are proportional to @math{\sqrt@{udat^2+vdat^2@}}. The number of arrows depend on @ref{meshnum}. See also @ref{flow}, @ref{dew}, @ref{vectc}. @sref{Vect sample} -@end deffn +@end deftypefn -@deffn {MGL command} vect udat vdat wdat ['sch'='' @code{flag=0}] -@deffnx {MGL command} vect xdat ydat zdat udat vdat wdat ['sch'='' @code{flag=0}] +@deftypefn {MGL command} {} vect udat vdat wdat ['sch'='' @code{flag=0}] +@deftypefnx {MGL command} {} vect xdat ydat zdat udat vdat wdat ['sch'='' @code{flag=0}] This is 3D version of the previous command. Here arrays @var{udat}, @var{vdat}, @var{wdat} must be 3-ranged tensors with equal sizes and the length and color of arrows are proportional to @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{Vect 3D sample} -@end deffn +@end deftypefn @cindex vectc @anchor{vectc} -@deffn {MGL command} vectc udat vdat ['sch'='' @code{zval=nan}] -@deffnx {MGL command} vectc xdat ydat udat vdat ['sch'='' @code{zval=nan}] +@deftypefn {MGL command} {} vectc udat vdat ['sch'=''] +@deftypefnx {MGL command} {} vectc xdat ydat udat vdat ['sch'=''] Draws plane vector field plot for the field @{@var{udat}, @var{vdat}@} depending parametrically on coordinates @var{xdat}, @var{ydat} at level @var{z=zVal}. The color of hachures is proportional to @math{\sqrt@{udat^2+vdat^2@}}. The number of hachures depend on @var{meshnum}. See also @code{vect, flow, pipe, dew}. @sref{VectC sample} -@end deffn +@end deftypefn -@deffn {MGL command} vectc udat vdat wdat ['sch'=''] -@deffnx {MGL command} vectc xdat ydat zdat udat vdat wdat ['sch'=''] +@deftypefn {MGL command} {} vectc udat vdat wdat ['sch'=''] +@deftypefnx {MGL command} {} vectc xdat ydat zdat udat vdat wdat ['sch'=''] This is 3D version of the previous command. Here arrays @var{udat}, @var{vdat}, @var{wdat} must be 3-ranged tensors with equal sizes and the color of hachures is proportional to @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{VectC 3D sample} -@end deffn +@end deftypefn @cindex vectl @anchor{vectl} -@deffn {MGL command} vectl udat vdat ['sch'='' @code{zval=nan}] -@deffnx {MGL command} vectl xdat ydat udat vdat ['sch'='' @code{zval=nan}] +@deftypefn {MGL command} {} vectl udat vdat ['sch'=''] +@deftypefnx {MGL command} {} vectl xdat ydat udat vdat ['sch'=''] Draws plane vector field plot for the field @{@var{udat}, @var{vdat}@} depending parametrically on coordinates @var{xdat}, @var{ydat} at level @var{z=zVal}. The length of hachures is proportional to @math{\sqrt@{udat^2+vdat^2@}}. The number of hachures depend on @var{meshnum}. See also @code{vectc, flow, pipe, dew}. @sref{Vect sample} -@end deffn +@end deftypefn -@deffn {MGL command} vectl udat vdat wdat ['sch'=''] -@deffnx {MGL command} vectl xdat ydat zdat udat vdat wdat ['sch'=''] +@deftypefn {MGL command} {} vectl udat vdat wdat ['sch'=''] +@deftypefnx {MGL command} {} vectl xdat ydat zdat udat vdat wdat ['sch'=''] This is 3D version of the previous command. Here arrays @var{udat}, @var{vdat}, @var{wdat} must be 3-ranged tensors with equal sizes and the length of hachures is proportional to @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{VectL 3D sample} -@end deffn +@end deftypefn @cindex dew @anchor{dew} -@deffn {MGL command} dew udat vdat ['sch'='' @code{zval=nan}] -@deffnx {MGL command} dew xdat ydat udat vdat ['sch'='' @code{zval=nan}] +@deftypefn {MGL command} {} dew udat vdat ['sch'=''] +@deftypefnx {MGL command} {} dew xdat ydat udat vdat ['sch'=''] Draws dew-drops for plane vector field @{@var{udat}, @var{vdat}@} depending parametrically on coordinates @var{xdat}, @var{ydat} at level @var{z=zval}. The color of drops is proportional to @math{\sqrt@{udat^2+vdat^2@}}. The number of drops depend on @ref{meshnum}. Note that this is very expensive plot in memory usage and creation time! See also @ref{vect}. @sref{Dew sample} -@end deffn +@end deftypefn @cindex flow @anchor{flow} -@deffn {MGL command} flow udat vdat ['sch'='' @code{num=5 zval=nan}] -@deffnx {MGL command} flow xdat ydat udat vdat ['sch'='' @code{num=5 zval=nan}] +@deftypefn {MGL command} {} flow udat vdat ['sch'='' @code{num=5 zval=nan}] +@deftypefnx {MGL command} {} flow xdat ydat udat vdat ['sch'='' @code{num=5 zval=nan}] Draws plane flow threads for the vector field @{@var{udat}, @var{vdat}@} depending parametrically on coordinates @var{xdat}, @var{ydat} at level @var{z=zVal}. Number of threads is proportional to @var{num}. The color of lines is proportional to @math{\sqrt@{udat^2+vdat^2@}}. Warm color corresponds to normal flow (like attractor). Cold one corresponds to inverse flow (like source). See also @code{vect, vectc, pipe}. @sref{Flow sample} -@end deffn +@end deftypefn -@deffn {MGL command} flow udat vdat wdat ['sch'='' @code{num=3}] -@deffnx {MGL command} flow xdat ydat zdat udat vdat wdat ['sch'='' @code{num=3}] +@deftypefn {MGL command} {} flow udat vdat wdat ['sch'='' @code{num=3}] +@deftypefnx {MGL command} {} flow xdat ydat zdat udat vdat wdat ['sch'='' @code{num=3}] This is 3D version of the previous command. Here arrays @var{udat}, @var{vdat}, @var{wdat} must be 3-ranged tensors with equal sizes and the color is proportional to @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{Flow 3D sample} -@end deffn +@end deftypefn -@deffn {MGL command} flow @code{x0 y0} udat vdat ['sch'='' @code{zval=nan}] -@deffnx {MGL command} flow @code{x0 y0} xdat ydat udat vdat ['sch'='' @code{zval=nan}] +@deftypefn {MGL command} {} flow @code{x0 y0} udat vdat ['sch'=''] +@deftypefnx {MGL command} {} flow @code{x0 y0} xdat ydat udat vdat ['sch'=''] Draws plane flow threads for the vector field @{@var{udat}, @var{vdat}@} depending parametrically on coordinates @var{xdat}, @var{ydat} from point @{@var{x0}, @var{y0}@} at level @var{z=zVal}. The color of lines is proportional to @math{\sqrt@{udat^2+vdat^2@}}. Warm color corresponds to normal flow (like attractor). Cold one corresponds to inverse flow (like source). See also @code{vect, vectc, pipe}. @sref{Flow sample} -@end deffn +@end deftypefn -@deffn {MGL command} flow @code{x0 y0 z0} udat vdat wdat ['sch'=''] -@deffnx {MGL command} flow @code{x0 y0 z0} xdat ydat zdat udat vdat wdat ['sch'=''] +@deftypefn {MGL command} {} flow @code{x0 y0 z0} udat vdat wdat ['sch'=''] +@deftypefnx {MGL command} {} flow @code{x0 y0 z0} xdat ydat zdat udat vdat wdat ['sch'=''] Draws flow thread from point @{@var{x0}, @var{y0}, @var{z0}@}. Arrays @var{udat}, @var{vdat}, @var{wdat} must be 3-ranged tensors with equal sizes and the color is proportional to @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{Flow 3D sample} -@end deffn +@end deftypefn @cindex pipe @anchor{pipe} -@deffn {MGL command} pipe udat vdat ['sch'='' @code{r0=0.05 num=5 zval=nan}] -@deffnx {MGL command} pipe xdat ydat udat vdat ['sch'='' @code{r0=0.05 num=5 zval=nan}] +@deftypefn {MGL command} {} pipe udat vdat ['sch'='' @code{r0=0.05 num=5 zval=nan}] +@deftypefnx {MGL command} {} pipe xdat ydat udat vdat ['sch'='' @code{r0=0.05 num=5 zval=nan}] Draws plane flow pipes for the vector field @{@var{udat}, @var{vdat}@} depending parametrically on coordinates @var{xdat}, @var{ydat} at level @var{z=zVal}. Number of pipes is proportional to @var{num}. The color of pipes is proportional to @math{\sqrt@{udat^2+vdat^2@}}. Warm color corresponds to normal flow (like attractor). Cold one corresponds to inverse flow (like source). Parameter @var{r0} set the base pipe radius. If @var{r0}<0 then pipe radius is inverse proportional to amplitude. The size of @var{ax} and @var{ay} must be equal. See also @code{vect, vectc, pipe}. @sref{Pipe sample} -@end deffn +@end deftypefn -@deffn {MGL command} pipe udat vdat wdat ['sch'='' @code{r0=0.05 num=3}] -@deffnx {MGL command} pipe xdat ydat zdat udat vdat wdat ['sch'='' @code{r0=0.05 num=3}] +@deftypefn {MGL command} {} pipe udat vdat wdat ['sch'='' @code{r0=0.05 num=3}] +@deftypefnx {MGL command} {} pipe xdat ydat zdat udat vdat wdat ['sch'='' @code{r0=0.05 num=3}] This is 3D version of the previous command. Here arrays @var{udat}, @var{vdat}, @var{wdat} must be 3-ranged tensors with equal sizes and the color is proportional to @math{\sqrt@{udat^2+vdat^2+wdat^2@}}. @sref{Pipe 3D sample} -@end deffn +@end deftypefn @c ################################################################## @@ -1209,88 +1220,88 @@ These commands perform miscelaneous plotting. There is unstructured data points @cindex densy @cindex densz @anchor{densz} @anchor{densy} @anchor{densx} -@deffn {MGL command} densx dat ['sch'='' @code{val=nan}] -@deffnx {MGL command} densy dat ['sch'='' @code{val=nan}] -@deffnx {MGL command} densz dat ['sch'='' @code{val=nan}] +@deftypefn {MGL command} {} densx dat ['sch'='' @code{val=nan}] +@deftypefnx {MGL command} {} densy dat ['sch'='' @code{val=nan}] +@deftypefnx {MGL command} {} densz dat ['sch'='' @code{val=nan}] These plotting commands draw density plot in x, y or z plain. If @var{dat} is a tensor (3-dimensional data) then interpolation to a given @var{val} is performed. These commands are useful for creating projections of the 3D data array to the bounding box. See also @code{cont[xyz], contf[xyz]}, @ref{dens}. @sref{Dens projection sample} -@end deffn +@end deftypefn @cindex contx @cindex conty @cindex contz @anchor{contz} @anchor{conty} @anchor{contx} -@deffn {MGL command} contx dat ['sch'='' @code{val=nan num=7}] -@deffnx {MGL command} conty dat ['sch'='' @code{val=nan num=7}] -@deffnx {MGL command} contz dat ['sch'='' @code{val=nan num=7}] +@deftypefn {MGL command} {} contx dat ['sch'='' @code{val=nan num=7}] +@deftypefnx {MGL command} {} conty dat ['sch'='' @code{val=nan num=7}] +@deftypefnx {MGL command} {} contz dat ['sch'='' @code{val=nan num=7}] These plotting commands draw contour lines in x, y or z plain. If @var{dat} is a tensor (3-dimensional data) then interpolation to a given @var{val} is performed. These commands are useful for creating projections of the 3D data array to the bounding box. See also @code{dens[xyz], contf[xyz]}, @ref{cont}. @sref{Cont projection sample} -@end deffn +@end deftypefn @cindex contfx @cindex contfy @cindex contfz @anchor{contfz} @anchor{contfy} @anchor{contfx} -@deffn {MGL command} contfx dat ['sch'='' @code{val=nan num=7}] -@deffnx {MGL command} contfy dat ['sch'='' @code{val=nan num=7}] -@deffnx {MGL command} contfz dat ['sch'='' @code{val=nan num=7}] +@deftypefn {MGL command} {} contfx dat ['sch'='' @code{val=nan num=7}] +@deftypefnx {MGL command} {} contfy dat ['sch'='' @code{val=nan num=7}] +@deftypefnx {MGL command} {} contfz dat ['sch'='' @code{val=nan num=7}] These plotting commands draw solid contours in x, y or z plain. If @var{dat} is a tensor (3-dimensional data) then interpolation to a given @var{val} is performed. These commands are useful for creating projections of the 3D data array to the bounding box. See also @code{dens[xyz], cont[xyz]}, @ref{contf}. -@end deffn +@end deftypefn @cindex dots @anchor{dots} -@deffn {MGL command} dots xdat ydat zdat ['sch'=''] -@deffnx {MGL command} dots xdat ydat zdat adat ['sch'=''] +@deftypefn {MGL command} {} dots xdat ydat zdat ['sch'=''] +@deftypefnx {MGL command} {} dots xdat ydat zdat adat ['sch'=''] Draws the arbitrary placed points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. Variable @var{adat}[i] set transparency for dots. See also @ref{crust}, @ref{mark}, @ref{plot}. @sref{Dots sample} -@end deffn +@end deftypefn @cindex crust @anchor{crust} -@deffn {MGL command} crust xdat ydat zdat ['sch'=''] +@deftypefn {MGL command} {} crust xdat ydat zdat ['sch'=''] Reconstructs and draws the surface for arbitrary placed points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. If string contain @samp{#} then wire plot is produced. See also @ref{dots}, @ref{triplot}. @sref{Crust sample} -@end deffn +@end deftypefn @cindex triplot @anchor{triplot} -@deffn {MGL command} triplot idat xdat ydat ['sch'='' @code{zval=nan}] -@deffnx {MGL command} triplot idat xdat ydat zdat ['sch'=''] -@deffnx {MGL command} triplot idat xdat ydat zdat cdat ['sch'=''] +@deftypefn {MGL command} {} triplot idat xdat ydat ['sch'=''] +@deftypefnx {MGL command} {} triplot idat xdat ydat zdat ['sch'=''] +@deftypefnx {MGL command} {} triplot idat xdat ydat zdat cdat ['sch'=''] Draws the surface of triangles. Triangle vertexes are set by indexes @var{idat} of data points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. If string contain @samp{#} then wire plot is produced. First dimensions of @var{idat} must be 3 or greater. See also @code{dots, crust, quadplot}. Parameter @var{cdat} set the colors of triangles (if @var{idat}.ny=@var{cdat}.nx) or colors of vertexes (if @var{xdat}.nx=@var{cdat}.nx). See also @ref{dots}, @ref{crust}, @ref{quadplot}, @ref{tricont}. -@end deffn +@end deftypefn @cindex tricont @anchor{tricont} -@deffn {MGL command} tricont vdat idat xdat ydat zdat cdat ['sch'='' @code{zval=nan}] -@deffnx {MGL command} tricont vdat idat xdat ydat zdat ['sch'='' @code{zval=nan}] -@deffnx {MGL command} tricont idat xdat ydat zdat ['sch'='' @code{num=7 zval=nan}] -Draws contour lines for surface of triangles at @var{z} = @var{zVal} (or for @var{z}=@var{vdat}[k] if @code{zval=nan}). Triangle vertexes are set by indexes @var{idat} of data points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. Contours are plotted for @var{zdat}[i,j]=@var{vdat}[k] for all k (or @var{num} contours equidistantly distributed in range [@var{Cmin}, @var{Cmax}].). See also @ref{triplot}, @ref{cont}. -@end deffn +@deftypefn {MGL command} {} tricont vdat idat xdat ydat zdat cdat ['sch'=''] +@deftypefnx {MGL command} {} tricont vdat idat xdat ydat zdat ['sch'=''] +@deftypefnx {MGL command} {} tricont idat xdat ydat zdat ['sch'='' @code{num=7 zval=nan}] +Draws contour lines for surface of triangles at @var{z} = @var{zVal} (or for @var{z}=@var{vdat}[k] if). Triangle vertexes are set by indexes @var{idat} of data points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. Contours are plotted for @var{zdat}[i,j]=@var{vdat}[k] for all k (or @var{num} contours equidistantly distributed in range [@var{Cmin}, @var{Cmax}].). See also @ref{triplot}, @ref{cont}. +@end deftypefn @cindex quadplot @anchor{quadplot} -@deffn {MGL command} quadplot idat xdat ydat ['sch'='' @code{zval=nan}] -@deffnx {MGL command} quadplot idat xdat ydat zdat ['sch'=''] -@deffnx {MGL command} quadplot idat xdat ydat zdat cdat ['sch'=''] +@deftypefn {MGL command} {} quadplot idat xdat ydat ['sch'=''] +@deftypefnx {MGL command} {} quadplot idat xdat ydat zdat ['sch'=''] +@deftypefnx {MGL command} {} quadplot idat xdat ydat zdat cdat ['sch'=''] Draws the surface of quadrangles. Quadrangle vertexes are set by indexes @var{idat} of data points @{@var{xdat}[i], @var{ydat}[i], @var{zdat}[i]@}. If string contain @samp{#} then wire plot is produced. First dimensions of @var{idat} must be 4 or greater. See also @code{triplot, dots, crust}. Parameter @var{cdat} set the colors of triangles (if @var{idat}.ny=@var{cdat}.nx) or colors of vertexes (if @var{xdat}.nx=@var{cdat}.nx). See also @ref{triplot}. -@end deffn +@end deftypefn @cindex fplot @anchor{fplot} -@deffn {MGL command} fplot 'y(x)' ['pen'='' @code{zval=nan num=100}] +@deftypefn {MGL command} {} fplot 'y(x)' ['pen'='' @code{zval=nan num=100}] Draws command function @samp{y(x)} at plane z=@var{zval} where @samp{x} variable is changed in @code{xrange}. You do not need to create the data arrays to plot it. The parameter @var{num} set the minimal number of points along coordinate(s) for plots. See also @ref{plot}. -@end deffn +@end deftypefn -@deffn {MGL command} fplot 'x(t)' 'y(t)' 'z(t)' ['pen'='' @code{num=100}] +@deftypefn {MGL command} {} fplot 'x(t)' 'y(t)' 'z(t)' ['pen'='' @code{num=100}] Draws command parametrical curve @{@samp{x(t)}, @samp{y(t)}, @samp{z(t)}@} where @samp{t} variable is changed in range [0, 1]. You do not need to create the data arrays to plot it. The parameter @var{num} set the minimal number of points along coordinate(s) for plots. See also @ref{plot}. -@end deffn +@end deftypefn @cindex fsurf @anchor{fsurf} -@deffn {MGL command} fsurf 'z(x,y)' ['sch'='' @code{num=100}] +@deftypefn {MGL command} {} fsurf 'z(x,y)' ['sch'='' @code{num=100}] Draws command surface for function @samp{z(x,y)} where @samp{x}, @samp{y} variable are changed in @code{xrange, yrange}. You do not need to create the data arrays to plot it. The parameter @var{num} set the minimal number of points along coordinate(s) for plots. See also @ref{surf}. -@end deffn +@end deftypefn -@deffn {MGL command} fsurf 'x(u,v)' 'y(u,v)' 'z(u,v)' ['sch'='' @code{num=100}] +@deftypefn {MGL command} {} fsurf 'x(u,v)' 'y(u,v)' 'z(u,v)' ['sch'='' @code{num=100}] Draws command parametrical surface @{@samp{x(u,v)}, @samp{y(u,v)}, @samp{z(u,v)}@} where @samp{u}, @samp{v} variable are changed in range [0, 1]. You do not need to create the data arrays to plot it. The parameter @var{num} set the minimal number of points along coordinate(s) for plots. See also @ref{surf}. -@end deffn +@end deftypefn @c ################################################################## @@ -1306,27 +1317,27 @@ The dimensions of arrays must be at least the same as the number of specified ar @cindex fits @anchor{fits} -@deffn {MGL command} fits adat sdat 'func' 'var' [ini=0] -@deffnx {MGL command} fits xdat adat sdat 'func' 'var' [ini=0] -@deffnx {MGL command} fits xdat ydat adat sdat 'func' 'var' [ini=0] -@deffnx {MGL command} fits xdat ydat zdat adat sdat 'func' 'var' [ini=0] +@deftypefn {MGL command} {} fits adat sdat 'func' 'var' [ini=0] +@deftypefnx {MGL command} {} fits xdat adat sdat 'func' 'var' [ini=0] +@deftypefnx {MGL command} {} fits xdat ydat adat sdat 'func' 'var' [ini=0] +@deftypefnx {MGL command} {} fits xdat ydat zdat adat sdat 'func' 'var' [ini=0] Fit data along x-, y- and z-directions for 1d-,2d- or 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]) with weight factor @var{sdat}[i,j,k]. -@end deffn +@end deftypefn @cindex fit @anchor{fit} -@deffn {MGL command} fit adat 'func' 'var' [ini=0] -@deffnx {MGL command} fit xdat adat 'func' 'var' [ini=0] -@deffnx {MGL command} fit xdat ydat adat 'func' 'var' [ini=0] -@deffnx {MGL command} fit xdat ydat zdat adat 'func' 'var' [ini=0] +@deftypefn {MGL command} {} fit adat 'func' 'var' [ini=0] +@deftypefnx {MGL command} {} fit xdat adat 'func' 'var' [ini=0] +@deftypefnx {MGL command} {} fit xdat ydat adat 'func' 'var' [ini=0] +@deftypefnx {MGL command} {} fit xdat ydat zdat adat 'func' 'var' [ini=0] Fit data along x-, y- and z-directions for 1d-,2d- or 3d array specified parametrically @var{adat}[i,j,k](@var{xdat}[i,j,k], @var{ydat}[i,j,k], @var{zdat}[i,j,k]) with weight factor =1. -@end deffn +@end deftypefn @cindex putsfit @anchor{putsfit} -@deffn {MGL command} putsfit @code{x y} ['pre'='' 'fnt'='' @code{size=-1}] +@deftypefn {MGL command} {} putsfit @code{x y} ['pre'='' 'fnt'='' @code{size=-1}] Print last fitted formula with found coefficients (as numbers) at position @{@var{x}, @var{y}@}. The string @var{pre} will be printed before formula. All other parameters are the same as in @ref{Text printing @MGL{}}. -@end deffn +@end deftypefn @c ################################################################## @@ -1335,48 +1346,48 @@ Print last fitted formula with found coefficients (as numbers) at position @{@va @cindex new @anchor{new} -@deffn {MGL command} new dat [@code{nx=1 ny=1 nz=1}] +@deftypefn {MGL command} {} new dat [@code{nx=1 ny=1 nz=1}] Creates or recreates the array @var{dat} with specified size and fills it by zero. This command does nothing if one of parameters @var{nx}, @var{ny}, @var{nz} is zero or negative. -@end deffn +@end deftypefn @cindex var @anchor{var} -@deffn {MGL command} var dat @code{num v1 [v2=nan]} +@deftypefn {MGL command} {} var dat @code{num v1 [v2=nan]} Creates new variable with name @var{dat} for one-dimensional array of size @var{num}. Array elements are equidistantly distributed in range [@var{v1}, @var{v2}]. If @var{v2}=@code{nan} then @var{v2=v1} is used. -@end deffn +@end deftypefn @cindex list @anchor{list} -@deffn {MGL command} list dat @code{v1 ...} +@deftypefn {MGL command} {} list dat @code{v1 ...} Creates new variable with name @var{dat} and fills it by numeric values of command arguments @code{v1 ...}. Command can create one-dimensional and two-dimensional arrays with arbitrary values. For creating 2d array the user should use delimiter @samp{|} which means that the following values lie in next row. Array sizes are [maximal of row sizes * number of rows]. For example, command @code{list 1 | 2 3} creates the array [1 0; 2 3]. Note, that the maximal number of arguments is 1000. -@end deffn +@end deftypefn -@deffn {MGL command} list dat d1 ... +@deftypefn {MGL command} {} list dat d1 ... Creates new variable with name @var{dat} and fills it by data values of arrays of command arguments @var{d1 ...}. Command can create two-dimensional or three-dimensional (if arrays in arguments are 2d arrays) arrays with arbitrary values. Minor dimensions of all arrays in arguments should be equal to dimensions of first array d1. In the opposite case the argument will be ignored. Note, that the maximal number of arguments is 1000. -@end deffn +@end deftypefn @cindex copy @anchor{copy} -@deffn {MGL command} copy dat1 dat2 ['eq'='' @code{on_axis=on}] -@deffnx {MGL command} copy dat1 @code{val} +@deftypefn {MGL command} {} copy dat1 dat2 ['eq'='' @code{on_axis=on}] +@deftypefnx {MGL command} {} copy dat1 @code{val} Creates new variable with name @var{dat1} and fills it by data values of array @var{dat2}. At this, if parameter @var{eq} is specified then the data will be modified by corresponding formula by the same way as in @ref{fill} command (for @code{on_axis=on}) or in @ref{modify} command (for @code{on_axis=off}). -@end deffn +@end deftypefn @cindex idset @anchor{idset} -@deffn {MGL command} idset dat 'ids' +@deftypefn {MGL command} {} idset dat 'ids' Set the symbol id for data columns. The string must contain one symbol 'a'...'z' per column (without spaces). -@end deffn +@end deftypefn @cindex info @anchor{info} -@deffn {MGL command} info dat [@code{detail=off}] +@deftypefn {MGL command} {} info dat [@code{detail=off}] Display information (sizes, maximum/minimum, momentums and so on) about the data dat. Show brief information by default (if @code{detail=off}). -@end deffn +@end deftypefn -@deffn {MGL command} info 'text' +@deftypefn {MGL command} {} info 'text' Display @var{text} as information (warning). -@end deffn +@end deftypefn @c ------------------------------------------------------------------ @node Data filling @MGL{}, Rearrange data @MGL{}, Data create @MGL{}, MGL interface @@ -1386,34 +1397,34 @@ Display @var{text} as information (warning). @cindex fill @anchor{fill} -@deffn {MGL command} fill dat v1 v2 ['dir'='x'] +@deftypefn {MGL command} {} fill dat v1 v2 ['dir'='x'] Equidistantly fills the data values to range [@var{x1}, @var{x2}] in direction @var{dir}=@{@samp{x},@samp{y},@samp{z}@}. -@end deffn +@end deftypefn -@deffn {MGL command} fill dat 'eq' -@deffnx {MGL command} fill dat 'eq' vdat -@deffnx {MGL command} fill dat 'eq' vdat wdat +@deftypefn {MGL command} {} fill dat 'eq' +@deftypefnx {MGL command} {} fill dat 'eq' vdat +@deftypefnx {MGL command} {} fill dat 'eq' vdat wdat Command fills the value of array according to the formula in string @var{eq}. Formula is an arbitrary expression depending on variables @samp{x}, @samp{y}, @samp{z}, @samp{u}, @samp{v}, @samp{w}. Coordinates @samp{x}, @samp{y}, @samp{z} are supposed to be normalized in @emph{bounding box} (in difference from @code{modify} commands). Variable @samp{u} is the original value of the array. Variables @samp{v} and @samp{w} are values of @var{vdat}, @var{wdat}. -@end deffn +@end deftypefn @cindex modify @anchor{modify} -@deffn {MGL command} modify dat 'eq' [@code{dim=0}] -@deffnx {MGL command} modify dat 'eq' vdat -@deffnx {MGL command} modify dat 'eq' vdat wdat +@deftypefn {MGL command} {} modify dat 'eq' [@code{dim=0}] +@deftypefnx {MGL command} {} modify dat 'eq' vdat +@deftypefnx {MGL command} {} modify dat 'eq' vdat wdat Command fills the value of array according to the formula in string @var{eq}. Formula is an arbitrary expression depending on variables @samp{x}, @samp{y}, @samp{z}, @samp{u}. Coordinates @samp{x}, @samp{y}, @samp{z} are data indexes normalized in range [0,1]. Variable @samp{u} is the original value of the array. If @var{dim}>0 is specified then modification will be fulfilled only for slices >=@var{dim}. -@end deffn +@end deftypefn @cindex put @anchor{put} -@deffn {MGL command} put dat @code{val [i=: j=: k=:]} +@deftypefn {MGL command} {} put dat @code{val [i=: j=: k=:]} Function sets value(s) of array @var{dat}[@var{i}, @var{j}, @var{k}] = @var{val}. Negative indexes @var{i}, @var{j}, @var{k}=@samp{:} set the value @var{val} to whole range in corresponding direction(s). For example, @code{put dat val : 0 :} sets @var{dat}[i,0,j]=@var{val} for i=0...(@var{dat}.nx-1), j=0...(@var{dat}.nz-1). -@end deffn +@end deftypefn -@deffn {MGL command} put dat vdat [@code{i=: j=: k=:}] +@deftypefn {MGL command} {} put dat vdat [@code{i=: j=: k=:}] Function copies value(s) from array @var{vdat} to the range of array @var{dat}. Negative indexes @var{i}, @var{j}, @var{k}=@samp{:} set the range in corresponding direction(s). At this minor dimensions of array @var{vdat} should be large than corresponding dimensions of array @var{dat}. For example, @code{put dat v : 0 :} sets @var{dat}[i,0,j]=@var{vdat}.ny>@var{dat}.nz ? @var{vdat}[i,j] : @var{vdat}[i], where i=0...(@var{dat}.nx-1), j=0...(@var{dat}.nz-1) and condition vdat.nx>=dat.nx is true. -@end deffn +@end deftypefn @@ -1423,13 +1434,13 @@ Function copies value(s) from array @var{vdat} to the range of array @var{dat}. @cindex rearrange @anchor{rearrange} -@deffn {MGL command} rearrange dat @code{mx [my=0 mz=0]} +@deftypefn {MGL command} {} rearrange dat @code{mx [my=0 mz=0]} Rearrange dimensions without changing data array so that resulting sizes should be @var{mx}*@var{my}*@var{mz} < nx*ny*nz. If some of parameter @var{my} or @var{mz} are zero then it will be selected to optimal fill of data array. For example, if @var{my}=0 then it will be change to @var{my}=nx*ny*nz/@var{mx} and @var{mz} will be 1. -@end deffn +@end deftypefn @cindex extend @anchor{extend} -@deffn {MGL command} extend dat @code{n1 [n2=0]} +@deftypefn {MGL command} {} extend dat @code{n1 [n2=0]} Increase the dimensions of the data by inserting new (|@var{n1}|+1)-th slices after (for @var{n1}>0) or before (for @var{n1}<0) of existed one. It is possible to insert 2 dimensions simultaneously for 1d data by using parameter @var{n2}. Data to new slices is copy from existed one. For example, for @var{n1}>0 new array will be @iftex @math{a_{ij}^{new} = a_i^{old}} where j=0...@var{n1}. Correspondingly, for @var{n1}<0 new array will be @math{a_{ij}^{new} = a_j^{old}} where i=0...|@var{n1}|. @@ -1437,17 +1448,17 @@ Increase the dimensions of the data by inserting new (|@var{n1}|+1)-th slices af @ifnottex a_ij^new = a_i^old where j=0...@var{n1}. Correspondingly, for @var{n1}<0 new array will be a_ij^new = a_j^old where i=0...|@var{n1}|. @end ifnottex -@end deffn +@end deftypefn @cindex transpose @anchor{transpose} -@deffn {MGL command} transpose dat ['dim'='yxz'] +@deftypefn {MGL command} {} transpose dat ['dim'='yxz'] Transposes (shift order of) dimensions of the data. New order of dimensions is specified int string @var{dim}. This command may be useful also for the reading of one-dimensional data. -@end deffn +@end deftypefn @cindex squeeze @anchor{squeeze} -@deffn {MGL command} squeeze dat @code{rx [ry=1 rz=1 sm=off]} +@deftypefn {MGL command} {} squeeze dat @code{rx [ry=1 rz=1 sm=off]} Reduces the data size by excluding data elements which indexes are not divisible by @var{rx}, @var{ry}, @var{rz} correspondingly. Parameter @var{sm} set to use smoothing @iftex (i.e. @math{a_{out}[i]=\sum_{j=i}^{i+r}a[j]/r}) or not (i.e. @math{a_{out}[i]=a[j*r]}). @@ -1455,29 +1466,29 @@ Reduces the data size by excluding data elements which indexes are not divisible @ifnottex (i.e. out[i]=\sum_@{j=i@}^@{i+r@} a[j]/r) or not (i.e. out[i]=a[j*r]). @end ifnottex -@end deffn +@end deftypefn @cindex crop @anchor{crop} -@deffn {MGL command} crop dat @code{n1 n2} 'dir' +@deftypefn {MGL command} {} crop dat @code{n1 n2} 'dir' Cuts off edges of the data @var{i}<@var{n1} and @var{i}>@var{n2} if @var{n2}>0 or @var{i}>@code{n[xyz]}-@var{n2} if @var{n2}<=0 along direction @var{dir}. -@end deffn +@end deftypefn @cindex delete @anchor{delete} -@deffn {MGL command} delete dat +@deftypefn {MGL command} {} delete dat Deletes variable @var{dat} and makes its memory free. Can be useful for huge data arrays. -@end deffn +@end deftypefn -@deffn {MGL command} delete dat 'dir' @code{[pos=off num=0]} +@deftypefn {MGL command} {} delete dat 'dir' @code{[pos=off num=0]} Delete @var{num} slices along @var{dir}-direction at position @var{pos}. -@end deffn +@end deftypefn @cindex insert @anchor{insert} -@deffn {MGL command} insert dat 'dir' @code{[pos=off num=0]} +@deftypefn {MGL command} {} insert dat 'dir' @code{[pos=off num=0]} Insert @var{num} slices along @var{dir}-direction at position @var{pos}. -@end deffn +@end deftypefn @c ------------------------------------------------------------------ @node File I/O @MGL{}, Make another data @MGL{}, Rearrange data @MGL{}, MGL interface @@ -1485,59 +1496,59 @@ Insert @var{num} slices along @var{dir}-direction at position @var{pos}. @cindex read @anchor{read} -@deffn {MGL command} read dat 'fname' +@deftypefn {MGL command} {} read dat 'fname' Reads data from tab-separated text file with auto determining sizes of the data. -@end deffn +@end deftypefn -@deffn {MGL command} read dat 'fname' @code{mx [my=1 mz=1]} +@deftypefn {MGL command} {} read dat 'fname' @code{mx [my=1 mz=1]} Reads data from text file with specified data sizes. This command does nothing if one of parameters @var{mx}, @var{my} or @var{mz} is zero or negative. -@end deffn +@end deftypefn @cindex readmat @anchor{readmat} -@deffn {MGL command} readmat dat 'fname' [@code{dim=2}] +@deftypefn {MGL command} {} readmat dat 'fname' [@code{dim=2}] Read data from text file with size specified at beginning of the file by first @var{dim} numbers. At this, variable @var{dim} set data dimensions. -@end deffn +@end deftypefn @cindex readall @anchor{readall} -@deffn {MGL command} readall dat 'templ' @code{v1 v2 [dv=1 slice=off]} +@deftypefn {MGL command} {} readall dat 'templ' @code{v1 v2 [dv=1 slice=off]} Join data arrays from several text files. The file names are determined by function call @code{sprintf(fname,templ,val);}, where @var{val} changes from @var{v1} to @var{v2} with step @var{dv}. The data load one-by-one in the same slice if @var{slice}=@code{off} or as slice-by-slice if @var{slice}=@code{on}. -@end deffn +@end deftypefn -@deffn {MGL command} readall dat 'templ' @code{[slice=off]} +@deftypefn {MGL command} {} readall dat 'templ' @code{[slice=off]} Join data arrays from several text files which filenames satisfied the template @var{templ} (for example, @var{templ}=@code{"t_*.dat"}). The data load one-by-one in the same slice if @var{slice}=@code{off} or as slice-by-slice if @var{slice}=@code{on}. -@end deffn +@end deftypefn @cindex save @anchor{save} -@deffn {MGL command} save dat 'fname' +@deftypefn {MGL command} {} save dat 'fname' Saves the whole data array to tab-separated text file. -@end deffn +@end deftypefn @cindex readhdf @anchor{readhdf} -@deffn {MGL command} readhdf dat 'fname' 'dname' +@deftypefn {MGL command} {} readhdf dat 'fname' 'dname' Reads data array named @var{dname} from HDF5 or HDF4 file @var{fname}. -@end deffn +@end deftypefn @cindex savehdf @anchor{savehdf} -@deffn {MGL command} savehdf dat 'fname' 'dname' +@deftypefn {MGL command} {} savehdf dat 'fname' 'dname' Saves data array named @var{dname} from HDF5 or HDF4 file @var{fname}. -@end deffn +@end deftypefn @cindex import @anchor{import} -@deffn {MGL command} import dat 'fname' 'sch' [@code{v1=0 v2=1}] +@deftypefn {MGL command} {} import dat 'fname' 'sch' [@code{v1=0 v2=1}] Reads data from bitmap file. The RGB values of bitmap pixels are transformed to float values in range [@var{v1}, @var{v2}] using color scheme @var{sch} (@pxref{Color scheme}). -@end deffn +@end deftypefn @cindex export @anchor{export} -@deffn {MGL command} export dat 'fname' 'sch' [@code{v1=0 v2=0}] +@deftypefn {MGL command} {} export dat 'fname' 'sch' [@code{v1=0 v2=0}] Saves data matrix to bitmap file. The data values are transformed from range [@var{v1}, @var{v2}] to RGB pixels of bitmap using color scheme @var{sch} (@pxref{Color scheme}). If @var{v1}>=@var{v2} then the values of @var{v1}, @var{v2} are automatically determined as minimal and maximal value of the data array. -@end deffn +@end deftypefn @c ------------------------------------------------------------------ @node Make another data @MGL{}, Change data @MGL{}, File I/O @MGL{}, MGL interface @@ -1545,35 +1556,35 @@ Saves data matrix to bitmap file. The data values are transformed from range [@v @cindex combine @anchor{combine} -@deffn {MGL command} combine res adat bdat +@deftypefn {MGL command} {} combine res adat bdat Returns direct multiplication of arrays (like, res[i,j] = adat[i]*bdat[j] and so on). -@end deffn +@end deftypefn @cindex evaluate @anchor{evaluate} -@deffn {MGL command} evaluate res dat idat [@code{norm=on}] -@deffnx {MGL command} evaluate res dat idat jdat [@code{norm=on}] -@deffnx {MGL command} evaluate res dat idat jdat kdat [@code{norm=on}] +@deftypefn {MGL command} {} evaluate res dat idat [@code{norm=on}] +@deftypefnx {MGL command} {} evaluate res dat idat jdat [@code{norm=on}] +@deftypefnx {MGL command} {} evaluate res dat idat jdat kdat [@code{norm=on}] Get array which values is result of interpolation of original array for coordinates from other arrays (for example, res[i,j]=dat[idat[i,j],jdat[i,j]]). All dimensions must be the same for data @var{idat}, @var{jdat}, @var{kdat}. Coordinates from @var{idat}, @var{jdat}, @var{kdat} are supposed to be normalized in range [0,1] (if @var{norm}=@code{true}) or in ranges [0,nx], [0,ny], [0,nz] correspondingly. -@end deffn +@end deftypefn @cindex hist @anchor{hist} -@deffn {MGL command} hist res dat @code{num v1 v2 [nsub=0]} -@deffnx {MGL command} hist res dat wdat @code{num v1 v2 [nsub=0]} +@deftypefn {MGL command} {} hist res dat @code{num v1 v2 [nsub=0]} +@deftypefnx {MGL command} {} hist res dat wdat @code{num v1 v2 [nsub=0]} Creates @var{num}-th points distribution @var{res} of the data values of @var{dat} in range [@var{v1}, @var{v2}]. Array @var{wdat} specifies weights of the data elements (all weight is 1 if @var{wdat} is not specified). Parameter @var{nsub} define the number of additional interpolated points (for smoothness of histogram). -@end deffn +@end deftypefn -@deffn {MGL command} hist res xdat adat -@deffnx {MGL command} hist res xdat ydat adat -@deffnx {MGL command} hist res xdat ydat zdat adat +@deftypefn {MGL command} {} hist res xdat adat +@deftypefnx {MGL command} {} hist res xdat ydat adat +@deftypefnx {MGL command} {} hist res xdat ydat zdat adat Creates distribution @var{res} of the data values of @var{adat} in axis range [Min, Max]. Array @var{adat} look like weights of the data points. -@end deffn +@end deftypefn @cindex momentum @anchor{momentum} -@deffn {MGL command} momentum res dat 'how' ['dir'='z'] +@deftypefn {MGL command} {} momentum res dat 'how' ['dir'='z'] Get momentum (1D-array) of the data along direction @var{dir}. String @var{how} contain kind of momentum. The momentum is defined like as @iftex @math{res_k = \sum_{ij} how(x_i,y_j,z_k) a_{ij}/\sum_{ij} a_{ij}} @@ -1582,83 +1593,83 @@ Get momentum (1D-array) of the data along direction @var{dir}. String @var{how} res_k = \sum_ij how(x_i,y_j,z_k) a_ij/ \sum_ij a_ij @end ifnottex if @var{var}=@samp{z} and so on. Coordinates @samp{x}, @samp{y}, @samp{z} are data indexes normalized in range [0,1]. -@end deffn +@end deftypefn @cindex sum @anchor{sum} -@deffn {MGL command} sum res dat 'dir' +@deftypefn {MGL command} {} sum res dat 'dir' Gets array which is the result of summation in given direction or direction(s). -@end deffn +@end deftypefn @cindex max @anchor{max} -@deffn {MGL command} max res dat 'dir' +@deftypefn {MGL command} {} max res dat 'dir' Gets array which is the maximal data values in given direction or direction(s). -@end deffn +@end deftypefn @cindex min @anchor{min} -@deffn {MGL command} min res dat 'dir' +@deftypefn {MGL command} {} min res dat 'dir' Gets array which is the minimal data values in given direction or direction(s). -@end deffn +@end deftypefn @cindex resize @anchor{resize} -@deffn {MGL command} resize res dat @code{mx [my=1 mz=1]} +@deftypefn {MGL command} {} resize res dat @code{mx [my=1 mz=1]} Makes array @var{res} of sizes @var{mx}, @var{my}, @var{mz} with interpolated data of array @var{dat}. -@end deffn +@end deftypefn @cindex subdata @anchor{subdata} -@deffn {MGL command} subdata res dat @code{xx [yy=: zz=:]} +@deftypefn {MGL command} {} subdata res dat @code{xx [yy=: zz=:]} Extracts sub-array data @var{res} from the original data @var{dat} array keeping fixed positive index. For example @code{subdata a b : 2} extracts 3d row (indexes are zero based), @code{subdata a b 4 :} extracts 5th column, @code{subdata a b : : 3} extracts 4th slice and so on. Note that symbol @samp{:} is defined @samp{:}=@code{-1} in MGL. -@end deffn +@end deftypefn @cindex trace @anchor{trace} -@deffn {MGL command} trace res dat +@deftypefn {MGL command} {} trace res dat Gets array of diagonal elements @var{dat}[i,i] (for 2D case) or @var{dat}[i,i,i] (for 3D case) where i=0...nx-1. Function return copy of @var{dat} for 1D case. Data array must have dimensions @var{dat}.ny, @var{dat}.nz >= @var{dat}.nx or @var{dat}.ny, @var{dat}.nz = 1. -@end deffn +@end deftypefn @cindex transform @anchor{transform} -@deffn {MGL command} transform dat 'type' real imag +@deftypefn {MGL command} {} transform dat 'type' real imag Do integral transformation of complex data @var{real}, @var{imag} on specified direction. The order of transformations is specified in string @var{type}: first character for x-dimension, second one for y-dimension, third one for z-dimension. The possible character are: @samp{f} is forward Fourier transformation, @samp{i} is inverse Fourier transformation, @samp{s} is Sine transform, @samp{c} is Cosine transform, @samp{h} is Hankel transform, @samp{n} or @samp{ } is no transformation. -@end deffn +@end deftypefn @cindex transforma @anchor{transforma} -@deffn {MGL command} transforma dat 'type' ampl phase +@deftypefn {MGL command} {} transforma dat 'type' ampl phase The same as previous but with specified amplitude @var{ampl} and phase @var{phase} of complex numbers. -@end deffn +@end deftypefn @cindex stfad @anchor{stfad} -@deffn {MGL command} stfad res real imag @code{dn} ['dir'='x'] +@deftypefn {MGL command} {} stfad res real imag @code{dn} ['dir'='x'] Short time Fourier transformation for real and imaginary parts. Output is amplitude of partial Fourier of length @var{dn}. For example if @var{dir}=@samp{x}, result will have size @{int(nx/dn), dn, ny@} and it will contain @math{res[i,j,k]=|\sum_d^dn exp(I*j*d)*(real[i*dn+d,k]+I*imag[i*dn+d,k])|/dn}. -@end deffn +@end deftypefn @cindex pde @anchor{pde} -@deffn {MGL command} pde res 'ham' ini_re ini_im [@code{dz=0.1 k0=100}] +@deftypefn {MGL command} {} pde res 'ham' ini_re ini_im [@code{dz=0.1 k0=100}] Solves equation du/dz = i*k0*@var{ham}(p,q,x,y,z,|u|)[u], where p=-i/k0*d/dx, q=-i/k0*d/dy are pseudo-differential operators. Parameters @var{ini_re}, @var{ini_im} specify real and imaginary part of initial field distribution. Coordinates of the equation (and the solution) are supposed to be in the bounding box. Note, that really this ranges are increased by factor 3/2 for purpose of reducing reflection from boundaries. Parameter @var{dz} set the step along evolutionary coordinate z. At this moment, simplified form of function @var{ham} is supported -- all ``mixed'' terms (like @samp{x*p}->x*d/dx) are excluded. For example, in 2D case this function is effectively @math{ham = f(p,z) + g(x,z,u)}. However commutable combinations (like @samp{x*q}->x*d/dy) are allowed. Here variable @samp{u} is used for field amplitude |u|. This allow one solve nonlinear problems -- for example, for non-linear Shrodinger equation you may set @code{ham='p^2+q^2-u^2'}. You may specify imaginary part for wave absorption, like @code{ham = 'p^2+i*x*(x>0)'}, but only if dependence on variable @samp{i} is linear (i.e. @math{ham = hre+i*him}). @sref{PDE sample} -@end deffn +@end deftypefn @cindex ray @anchor{ray} -@deffn {MGL command} ray res 'ham' @code{x0 y0 z0 p0 q0 v0 [dt=0.1 tmax=10]} +@deftypefn {MGL command} {} ray res 'ham' @code{x0 y0 z0 p0 q0 v0 [dt=0.1 tmax=10]} Solves GO ray equation like d@emph{r}/dt = d @var{ham}/d@emph{p}, d@emph{p}/dt = -d @var{ham}/d@emph{r}. This is Hamiltonian equations for particle trajectory in 3D case. Here @var{ham} is Hamiltonian which may depend on coordiantes @samp{x}, @samp{y}, @samp{z}, momentums @samp{p}=px, @samp{q}=py, @samp{v}=pz and time @samp{t}: @math{ham = H(x,y,z,p,q,v,t)}. The starting point (at @code{t=0}) is defined by variables @{@var{x0}, @var{y0}, @var{z0}, @var{p0}, @var{q0}, @var{v0}@}. Parameters @var{dt} and @var{tmax} specify the integration step and maximal time for ray tracing. Result is array of @{x,y,z,p,q,v,t@} with dimensions @{7 * int(@var{tmax}/@var{dt}+1) @}. See also @ref{pde}. @sref{Beam tracing sample} -@end deffn +@end deftypefn @cindex qo2d @anchor{qo2d} -@deffn {MGL command} qo2d res 'ham' ini_re ini_im ray [@code{r=1 k0=100} xx=0 yy=0] +@deftypefn {MGL command} {} qo2d res 'ham' ini_re ini_im ray [@code{r=1 k0=100} xx=0 yy=0] Solves equation du/dt = i*k0*@var{ham}(p,q,x,y,|u|)[u], where p=-i/k0*d/dx, q=-i/k0*d/dy are pseudo-differential operators. Parameters @var{ini_re}, @var{ini_im} specify real and imaginary part of initial field distribution. Parameters @var{ray} set the reference ray, i.e. the ray around which the accompanied coordinate system will be maked. You may use, for example, the array created by @ref{ray} function. Note, that the reference ray @strong{must be} smooth enough to make accompanied coodrinates unambiguity. Otherwise errors in the solution may appear. If @var{xx} and @var{yy} are non-zero then Cartesian coordinates for each point will be written into them. @sref{Beam tracing sample} -@end deffn +@end deftypefn @cindex jacobian @anchor{jacobian} -@deffn {MGL command} jacobian res xdat ydat [zdat=0] +@deftypefn {MGL command} {} jacobian res xdat ydat [zdat=0] Computates the Jacobian for transformation @{i,j,k@} to @{@var{xdat},@var{ydat},@var{zdat}@} where initial coordinates @{i,j,k@} are data indexes normalized in range [0,1]. The Jacobian is determined by formula det||@math{dr_\alpha/d\xi_\beta}|| where @math{r}=@{@var{xdat},@var{ydat},@var{zdat}@} and @math{\ xi}=@{i,j,k@}. All dimensions must be the same for all data arrays. Data must be 3D if all 3 arrays @{@var{xdat},@var{ydat},@var{zdat}@} are specified or 2D if only 2 arrays @{@var{xdat},@var{ydat}@} are specified. -@end deffn +@end deftypefn @@ -1670,83 +1681,83 @@ These commands change the data in some direction like differentiations, integrat @cindex cumsum @anchor{cumsum} -@deffn {MGL command} cumsum dat 'dir' +@deftypefn {MGL command} {} cumsum dat 'dir' Cumulative summation of the data in given direction or directions. -@end deffn +@end deftypefn @cindex integrate @anchor{integrate} -@deffn {MGL command} integrate dat 'dir' +@deftypefn {MGL command} {} integrate dat 'dir' Integrates (like cumulative summation) the data in given direction or directions. -@end deffn +@end deftypefn @cindex diff @anchor{diff} -@deffn {MGL command} diff dat 'dir' +@deftypefn {MGL command} {} diff dat 'dir' Differentiates the data in given direction or directions. -@end deffn -@deffn {MGL command} diff dat xdat ydat [zdat=0] +@end deftypefn +@deftypefn {MGL command} {} diff dat xdat ydat [zdat=0] Differentiates the data @var{dat} specified parametrically in direction @var{xdat} with @var{ydat}, @var{zdat}=constant. Parameter @var{zdat} can be omitted that correspond to 2D case. Parametrical differentiation uses the formula (for 2D case): @math{da/dx = (a_j*y_i-a_i*y_j)/(x_j*y_i-x_i*y_j)} where @math{a_i=da/di, a_j=da/dj} denotes usual differentiation along 1st and 2nd dimensions. The similar formula is used for 3D case. Note, that you may change the order of arguments -- for example, if you have 2D data a(i,j) which depend on coordinates @{x(i,j), y(i,j)@} then usual derivative along @samp{x} will be @code{diff a x y} and usual derivative along @samp{y} will be @code{diff a y x}. -@end deffn +@end deftypefn @cindex diff2 @anchor{diff2} -@deffn {MGL command} diff2 dat 'dir' +@deftypefn {MGL command} {} diff2 dat 'dir' Double-differentiates (like Laplace operator) the data in given direction. -@end deffn +@end deftypefn @cindex sinfft @anchor{sinfft} -@deffn {MGL command} sinfft dat 'dir' +@deftypefn {MGL command} {} sinfft dat 'dir' Do Sine transform of the data in given direction or directions. The Sine transform is @math{\sum a_i \sin(k i)}. -@end deffn +@end deftypefn @cindex cosfft @anchor{cosfft} -@deffn {MGL command} cosfft dat 'dir' +@deftypefn {MGL command} {} cosfft dat 'dir' Do Cosine transform of the data in given direction or directions. The Cosine transform is @math{\sum a_i \cos(k i)}. -@end deffn +@end deftypefn @cindex hankel @anchor{hankel} -@deffn {MGL command} hankel dat 'dir' +@deftypefn {MGL command} {} hankel dat 'dir' Do Hankel transform of the data in given direction or directions. The Hankel transform is @math{\sum a_i J_0(k i)}. -@end deffn +@end deftypefn @cindex swap @anchor{swap} -@deffn {MGL command} swap dat 'dir' +@deftypefn {MGL command} {} swap dat 'dir' Swaps the left and right part of the data in given direction (useful for Fourier spectrum). -@end deffn +@end deftypefn @cindex roll @anchor{roll} -@deffn {MGL command} roll dat 'dir' num +@deftypefn {MGL command} {} roll dat 'dir' num Rolls the data along direction 'dir'. Resulting array will be out[i] = ini[(i+num)%nx] if @code{dir='x'}. -@end deffn +@end deftypefn @cindex mirror @anchor{mirror} -@deffn {MGL command} mirror dat 'dir' +@deftypefn {MGL command} {} mirror dat 'dir' Mirror the left-to-right part of the data in given direction. Looks like change the value index @var{i}->@var{n-i}. -@end deffn +@end deftypefn @cindex sew @anchor{sew} -@deffn {MGL command} sew dat ['dir'='xyz' @code{da=2*pi}] +@deftypefn {MGL command} {} sew dat ['dir'='xyz' @code{da=2*pi}] Remove value steps (like phase jumps after inverse trigonometric commands) with period @var{da} in given direction. -@end deffn +@end deftypefn @cindex smooth @anchor{smooth} -@deffn {MGL command} smooth data @code{type} ['dir'='xyz'] +@deftypefn {MGL command} {} smooth data @code{type} ['dir'='xyz'] Smooths the data on specified direction or directions by method @var{Type}. Now 4 methods are supported: @samp{0} does nothing, @samp{1} linear averaging by 3 points, @samp{2} linear averaging by 5 points, @samp{3} quadratic averaging by 5 points. -@end deffn +@end deftypefn @cindex envelop @anchor{envelop} -@deffn {MGL command} envelop dat ['dir'='x'] +@deftypefn {MGL command} {} envelop dat ['dir'='x'] Find envelop for data values along direction @var{dir}. Only one direction can be specified at once. -@end deffn +@end deftypefn @cindex normsl @anchor{normsl} -@deffn {MGL command} normsl dat @code{v1 v2} ['dir'='z' @code{keep=on sym=off}] +@deftypefn {MGL command} {} normsl dat @code{v1 v2} ['dir'='z' @code{keep=on sym=off}] Normalizes data slice-by-slice along direction @var{dir} the data in slices to range [@var{v1},@var{v2}]. If flag @var{sym}=@code{on} then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. If @var{keep} is set then maximal value of k-th slice will be limited by @iftex @math{\sqrt{\sum a_{ij}(k)/\sum a_{ij}(0)}}. @@ -1754,13 +1765,13 @@ Normalizes data slice-by-slice along direction @var{dir} the data in slices to r @ifnottex @math{\sqrt@{\sum a_ij(k)/\sum a_ij(0)@}}. @end ifnottex -@end deffn +@end deftypefn @cindex norm @anchor{norm} -@deffn {MGL command} norm dat @code{v1 v2 [sym=off dim=0]} +@deftypefn {MGL command} {} norm dat @code{v1 v2 [sym=off dim=0]} Normalizes the data to range [@var{v1},@var{v2}]. If flag @var{sym}=@code{on} then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. Modification will be applied only for slices >=@var{dim}. -@end deffn +@end deftypefn @c ------------------------------------------------------------------ @node Operators @MGL{}, Program flow @MGL{}, Change data @MGL{}, MGL interface @@ -1768,39 +1779,39 @@ Normalizes the data to range [@var{v1},@var{v2}]. If flag @var{sym}=@code{on} th @cindex multo @anchor{multo} -@deffn {MGL command} multo dat dat2 +@deftypefn {MGL command} {} multo dat dat2 Multiplies the data by the other one for each element. -@end deffn -@deffn {MGL command} multo dat @code{val} +@end deftypefn +@deftypefn {MGL command} {} multo dat @code{val} Multiplies each element by the number. -@end deffn +@end deftypefn @cindex divto @anchor{divto} -@deffn {MGL command} divto dat dat2 +@deftypefn {MGL command} {} divto dat dat2 Divides the data by the other one for each element. -@end deffn -@deffn {MGL command} divto dat @code{val} +@end deftypefn +@deftypefn {MGL command} {} divto dat @code{val} Divides each element by the number. -@end deffn +@end deftypefn @cindex addto @anchor{addto} -@deffn {MGL command} addto dat dat2 +@deftypefn {MGL command} {} addto dat dat2 Adds the other data. -@end deffn -@deffn {MGL command} addto dat @code{val} +@end deftypefn +@deftypefn {MGL command} {} addto dat @code{val} Adds the number to each element. -@end deffn +@end deftypefn @cindex subto @anchor{subto} -@deffn {MGL command} subto dat dat2 +@deftypefn {MGL command} {} subto dat dat2 Subtracts the other data. -@end deffn -@deffn {MGL command} subto dat @code{val} +@end deftypefn +@deftypefn {MGL command} {} subto dat @code{val} Subtracts the number to each element. -@end deffn +@end deftypefn @c ------------------------------------------------------------------ @node Program flow @MGL{}, Command options @MGL{}, Operators @MGL{}, MGL interface @@ -1810,102 +1821,102 @@ These commands control program flow, like, conditions, cycles, define script arg @cindex chdir @anchor{chdir} -@deffn {MGL command} chdir 'path' +@deftypefn {MGL command} {} chdir 'path' Changes the current directory to @var{path}. -@end deffn +@end deftypefn @cindex define @anchor{define} -@deffn {MGL command} define $N smth +@deftypefn {MGL command} {} define $N smth Sets @var{N}-th script argument to @var{smth}. Note, that @var{smth} is used as is (with @samp{'} symbols if present). Here @var{N} is digit (0...9) or alpha (a...z). -@end deffn -@deffn {MGL command} define name smth +@end deftypefn +@deftypefn {MGL command} {} define name smth Create scalar variable @code{name} which have the numeric value of @code{smth}. Later you can use this variable as usual number. Here @var{N} is digit (0...9) or alpha (a...z). -@end deffn +@end deftypefn @cindex defchr @anchor{defchr} -@deffn {MGL command} defchr $N smth +@deftypefn {MGL command} {} defchr $N smth Sets @var{N}-th script argument to character with value evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z). -@end deffn +@end deftypefn @cindex defnum @anchor{defnum} -@deffn {MGL command} defnum $N smth +@deftypefn {MGL command} {} defnum $N smth Sets @var{N}-th script argument to number with value evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z). -@end deffn +@end deftypefn @cindex defpal @anchor{defpal} -@deffn {MGL command} defpal $N smth +@deftypefn {MGL command} {} defpal $N smth Sets @var{N}-th script argument to palette character at position evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z). -@end deffn +@end deftypefn @cindex call @anchor{call} -@deffn {MGL command} call 'fname' [ARG1 ARG2 ... ARG9] +@deftypefn {MGL command} {} call 'fname' [ARG1 ARG2 ... ARG9] Executes function @var{fname} (or script if function is not found). Optional arguments will be passed to functions. See also @ref{func}. -@end deffn +@end deftypefn @cindex func @anchor{func} -@deffn {MGL command} func 'fname' [narg=0] +@deftypefn {MGL command} {} func 'fname' [narg=0] Define the function @var{fname} and number of required arguments. The arguments will be placed in script parameters $1, $2, ... $9. Note, you should stop script execution before function definition(s) by command @ref{stop}. See also @ref{return}. -@end deffn +@end deftypefn @cindex return @anchor{return} -@deffn {MGL command} return +@deftypefn {MGL command} {} return Return from the function. See also @ref{func}. -@end deffn +@end deftypefn @cindex if @anchor{if} -@deffn {MGL command} if dat 'cond' +@deftypefn {MGL command} {} if dat 'cond' Starts block which will be executed if @var{dat} satisfy to @var{cond}. -@end deffn -@deffn {MGL command} if @code{val} +@end deftypefn +@deftypefn {MGL command} {} if @code{val} Starts block which will be executed if @code{val} is nonzero. -@end deffn +@end deftypefn @cindex elseif @anchor{elseif} -@deffn {MGL command} elseif dat 'cond' +@deftypefn {MGL command} {} elseif dat 'cond' Starts block which will be executed if previous @code{if} or @code{elseif} is false and @var{dat} satisfy to @var{cond}. -@end deffn -@deffn {MGL command} elseif @code{val} +@end deftypefn +@deftypefn {MGL command} {} elseif @code{val} Starts block which will be executed if previous @code{if} or @code{elseif} is false and @code{val} is nonzero. -@end deffn +@end deftypefn @cindex else @anchor{else} -@deffn {MGL command} else +@deftypefn {MGL command} {} else Starts block which will be executed if previous @code{if} or @code{elseif} is false. -@end deffn +@end deftypefn @cindex endif @anchor{endif} -@deffn {MGL command} endif +@deftypefn {MGL command} {} endif Finishes @code{if/elseif/else} block. -@end deffn +@end deftypefn @cindex for @anchor{for} -@deffn {MGL command} for $N @code{v1 v2 [dv=1]} +@deftypefn {MGL command} {} for $N @code{v1 v2 [dv=1]} Starts cycle with $@var{N}-th argument changing from @var{v1} to @var{v2} with the step @var{dv}. Here @var{N} is digit (0...9) or alpha (a...z). -@end deffn -@deffn {MGL command} for $N dat +@end deftypefn +@deftypefn {MGL command} {} for $N dat Starts cycle with $@var{N}-th argument changing for @var{dat} values. Here @var{N} is digit (0...9) or alpha (a...z). -@end deffn +@end deftypefn @cindex next @anchor{next} -@deffn {MGL command} next +@deftypefn {MGL command} {} next Finishes @code{for} cycle. -@end deffn +@end deftypefn @cindex once @anchor{once} -@deffn {MGL command} once @code{val} +@deftypefn {MGL command} {} once @code{val} The code between @code{once on} and @code{once off} will be executed only once. Useful for large data manipulation in programs like UDAV. -@end deffn +@end deftypefn @cindex stop @anchor{stop} -@deffn {MGL command} stop +@deftypefn {MGL command} {} stop Terminate execution. -@end deffn +@end deftypefn @c ------------------------------------------------------------------ @node Command options @MGL{}, Suffixes, Program flow @MGL{}, MGL interface @@ -1921,47 +1932,47 @@ The full list of options are: @deffn {MGL option} alpha @code{val} @deffnx {MGL option} alphadef @code{val} Sets alpha value (transparency) of the plot. The value should be in range [0, 1]. See also @ref{alphadef}. -@end deffn +@end deftypefn @cindex ambient @deffn {MGL option} ambient @code{val} Sets brightness of ambient light for the plot. The value should be in range [0, 1]. See also @ref{ambient}. -@end deffn +@end deftypefn @cindex crange @deffn {MGL option} crange @code{val1 val2} Sets boundaries of color change for the plot. See also @ref{crange}. -@end deffn +@end deftypefn @cindex xrange @deffn {MGL option} xrange @code{val1 val2} Sets boundaries of x coordinate change for the plot. See also @ref{xrange}. -@end deffn +@end deftypefn @cindex yrange @deffn {MGL option} yrange @code{val1 val2} Sets boundaries of y coordinate change for the plot. See also @ref{yrange}. -@end deffn +@end deftypefn @cindex zrange @deffn {MGL option} zrange @code{val1 val2} Sets boundaries of z coordinate change for the plot. See also @ref{zrange}. -@end deffn +@end deftypefn @cindex cut @deffn {MGL option} cut @code{val} Sets whether to cut or to project the plot points lying outside the bounding box. See also @ref{cut}. -@end deffn +@end deftypefn @cindex fontsize @deffn {MGL option} fontsize @code{val} Sets the size of text. See also @ref{font}. -@end deffn +@end deftypefn @cindex marksize @deffn {MGL option} marksize @code{val} Sets the size of marks. See also @ref{marksize}. -@end deffn +@end deftypefn @cindex meshnum @deffn {MGL option} meshnum @code{val} Work like @ref{meshnum} command. -@end deffn +@end deftypefn @cindex legend @deffn {MGL option} legend 'txt' Adds string 'txt' to internal legend accumulator. The style of described line and mark is taken from arguments of the last @ref{1D plotting @MGL{}} command. See also @ref{legend}. -@end deffn +@end deftypefn @c ------------------------------------------------------------------ @node Suffixes, Utilities, Command options @MGL{}, MGL interface diff --git a/texinfo/mgl_cmd_ru.texi b/texinfo/mgl_cmd_ru.texi index cb53add..beb04f8 100644 --- a/texinfo/mgl_cmd_ru.texi +++ b/texinfo/mgl_cmd_ru.texi @@ -1910,7 +1910,7 @@ Gets array which is the maximal data values in given direction or direction(s). @c ------------------------------------------------------------------ @node Command options @MGL{}, Suffixes, Program flow @MGL{}, MGL interface -@section Опции команд @MGL{} +@section Опции команд Опции команд позволяют легко настроить вид отдельного графика не меняя глобальных настроек для все рисунка. Опции указываются после команды. Каждая опция отделяется от предыдущей символом @samp{;}. Опции работают так, что запоминают текущие настройки рисунка, применяют собственные настройки, выполняют команду и возвращают глобальные настройки обратно. Поэтому использование опций для команд обработки данных или настройки графика бесполезно. diff --git a/texinfo/mgl_en.texi b/texinfo/mgl_en.texi index 66c5f81..fe6e6ad 100644 --- a/texinfo/mgl_en.texi +++ b/texinfo/mgl_en.texi @@ -1,6 +1,6 @@ \input texinfo @setfilename mgl_en.info -@set VERSION 1.11 +@set VERSION 2.0 @settitle MGL script language for version @value{VERSION} @syncodeindex pg cp @comment %**end of header @@ -25,10 +25,10 @@ supports it in developing GNU and promoting software freedom.'' @end quotation @end copying -@c @dircategory MathGL documentation system -@c @direntry -@c * MathGL: (mathgl). The library for scientific graphics. -@c @end direntry +@dircategory MathGL documentation system +@direntry +* MathGL: (mathgl). The library for scientific graphics. +@end direntry @titlepage @title MGL script language @@ -47,7 +47,7 @@ supports it in developing GNU and promoting software freedom.'' This file documents the MGL script language. It corresponds to release @value{VERSION} of the MathGL library. Please report any errors in this manual to @email{mathgl.abalakin@@gmail.org}. More information about MGL and MathGL can be found at the project homepage, @uref{http://mathgl.sourceforge.net/}. -Copyright @copyright{} 2008 Alexey A. Balakin. +Copyright @copyright{} 2008 Alexey A. Balakin. @quotation Permission is granted to copy, distribute and/or modify this document @@ -66,8 +66,10 @@ supports it in developing GNU and promoting software freedom.'' @end ifnottex @menu -* MGL interface:: +* Overview:: * Examples:: +* MathGL core:: +* Data processing:: * Samples:: * Copying This Manual:: * Index:: @@ -79,17 +81,21 @@ supports it in developing GNU and promoting software freedom.'' @macro tdref{nam} @uref{http://mathgl.sourceforge.net/pdf_u3d/\nam\.pdf, 3D pdf} @end macro -@macro MGL -@end macro @set UDAV -@node MGL interface, Examples, , Top -@include mgl_cmd_en.texi +@node Overview, Examples, , Top +@include overview_en.texi -@node Examples, Samples, MGL interface, Top +@node Examples, MathGL core, Overview, Top @include ex_mgl_en.texi -@node Samples,Copying This Manual, Examples, Top +@node MathGL core, Data handling, Examples, Top +@include core_en.texi + +@node Data processing, Samples, MathGL core, Top +@include data_en.texi + +@node Samples, Copying This Manual, Data handling, Top @include samples_en.texi @node Copying This Manual, Index, Samples, Top diff --git a/texinfo/mgl_ru.texi b/texinfo/mgl_ru.texi index cee1571..730bcf5 100644 --- a/texinfo/mgl_ru.texi +++ b/texinfo/mgl_ru.texi @@ -2,7 +2,7 @@ @setfilename mgl_ru.info @c @documentlanguage ru @documentencoding UTF-8 -@set VERSION 1.11 +@set VERSION 2.0 @settitle Язык MGL для версии @value{VERSION} @syncodeindex pg cp @comment %**end of header @@ -27,10 +27,10 @@ supports it in developing GNU and promoting software freedom.'' @end quotation @end copying -@c @dircategory MathGL documentation system -@c @direntry -@c * MathGL: (mathgl). The library for scientific graphics. -@c @end direntry +@dircategory MathGL documentation system +@direntry +* MathGL: (mathgl). The library for scientific graphics. +@end direntry @titlepage @title Язык MGL @@ -49,7 +49,7 @@ supports it in developing GNU and promoting software freedom.'' Это документация для языка MGL (версии @value{VERSION}). Пожалуйста сообщайте о любых ошибках в этом руководстве на @email{mathgl.abalakin@@gmail.org}. Дополнительную информацию о MGL и MathGL можно найти на домашней странице проекта @uref{http://mathgl.sourceforge.net/}. -Copyright @copyright{} 2010 Алексей Балакин. +Copyright @copyright{} 2010 Алексей Балакин. @quotation Permission is granted to copy, distribute and/or modify this document @@ -68,8 +68,10 @@ supports it in developing GNU and promoting software freedom.'' @end ifnottex @menu -* MGL interface:: +* Overview:: * Examples:: +* MathGL core:: +* Data processing:: * Samples:: * Copying This Manual:: * Index:: @@ -81,17 +83,21 @@ supports it in developing GNU and promoting software freedom.'' @macro tdref{nam} @uref{http://mathgl.sourceforge.net/pdf_u3d/\nam\.pdf, 3D pdf} @end macro -@macro MGL -@end macro @set UDAV -@node MGL interface, Examples, , Top -@include mgl_cmd_ru.texi +@node Overview, Examples, , Top +@include overview_ru.texi -@node Examples, Samples, MGL interface, Top +@node Examples, MathGL core, Overview, Top @include ex_mgl_ru.texi -@node Samples,Copying This Manual, Examples, Top +@node MathGL core, Data handling, Examples, Top +@include core_ru.texi + +@node Data processing, Samples, MathGL core, Top +@include data_ru.texi + +@node Samples, Copying This Manual, Data handling, Top @include samples_ru.texi @node Copying This Manual, Index, Samples, Top diff --git a/texinfo/other_en.texi b/texinfo/other_en.texi index 83f546b..eb221cc 100644 --- a/texinfo/other_en.texi +++ b/texinfo/other_en.texi @@ -5,9 +5,9 @@ @menu * mglParse class:: * mglFormula class:: -* mglFont class:: * mglColor class:: * mglPoint class:: +* mglFont class:: * mglVar class:: * mglCommand class:: * mglArg class:: @@ -18,110 +18,89 @@ @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 (@pxref{MGL interface}). The main function of mglParse class is @code{Parse()}. Exactly this function parses and executes the script string-by-string. Also there are two 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). The variable @var{DataList} contains full list of variables in script. Flag @var{AllowSetSize} allows one to prevent changing the size of the picture inside the script (forbids the MGL command @code{setsize}). -Note an important feature -- if user defines function @var{func} in variable then it will be called before the destroying of this variable (@pxref{mglVar class}). +@c Note an important feature -- if user defines function @var{func} in variable then it will be called before the destroying of this variable (@pxref{mglVar class}). -@deftypefn {Method on @code{mglParse} (C++, Python)} @code{} mglParse (@code{bool} setsize=@code{false}) +@deftypefn {Constructor on @code{mglParse}} @code{} mglParse (@code{bool} setsize=@code{false}) @deftypefnx {C function} @code{HMPR} mgl_create_parser () Constructor initializes all values with zero and set @var{AllowSetSize} value. @end deftypefn -@deftypefn {Method on @code{mglParse} (C++, Python)} @code{} ~mglParse () +@deftypefn {Destructor on @code{mglParse}} @code{} ~mglParse () @deftypefnx {C function} @code{void} mgl_delete_parser (@code{HMPR} p) Destructor delete parser @end deftypefn -@deftypefn {Method on @code{mglParse} (C++, Python)} @code{int} Parse (@code{mglGraph *}gr, @code{const char *}str, @code{long} pos=@code{0}) -@deftypefnx {Method on @code{mglParse} (C++)} @code{int} Parse (@code{mglGraph *}gr, @code{const wchar_t *}str, @code{long} pos=@code{0}) +@deftypefn {Method on @code{mglParse}} @code{int} Parse (@code{mglGraph *}gr, @code{const char *}str, @code{long} pos=@code{0}) +@deftypefnx {Method on @code{mglParse}} @code{int} Parse (@code{mglGraph *}gr, @code{const wchar_t *}str, @code{long} pos=@code{0}) @deftypefnx {C function} @code{int} mgl_parse (@code{HMGL} gr, @code{HMPR} p, @code{const char *}str, @code{int} pos) @deftypefnx {C function} @code{int} mgl_parsew (@code{HMGL} gr, @code{HMPR} p, @code{const wchar_t *}str, @code{int} pos) Main function in the class. It parses the string @var{str} and executes it by using @var{gr} as a graphics plotter. Returns the value depending on an error presence in the string @var{str}: 0 -- no error, 1 -- wrong command argument(s), 2 -- unknown command, 3 -- string is too long. Optional argument @var{pos} allows to save the string position in the document (or file) for using @code{for|next} command. @end deftypefn -@deftypefn {Method on @code{mglParse} (C++)} @code{int} Export (@code{wchar_t} cpp_out@code{[1024]}, @code{mglGraph *}gr, @code{const wchar_t *}str) -Function parses the string @var{str}, executes it by using @var{gr} as a graphics plotter and exports it to C++ code. Returns the value depending on an error presence in the string @var{str}: 0 -- no error, 1 -- wrong command argument(s), 2 -- unknown command, 3 -- string is too long. Output C++ text will be placed in @var{out} variable. If string @var{str} have options (defined after ';' symbol) then the corresponding C++ texts are placed in variables @var{op1}, @var{op2}. +@deftypefn {Method on @code{mglParse}} @code{void} Execute (@code{mglGraph *}gr, @code{FILE *}fp, @code{bool} print=@code{false}) +@deftypefnx {C function} @code{int} mgl_parsew (@code{HMGL} gr, @code{HMPR} p, @code{FILE *}fp, @code{int} print) +Function parse and execute line-by-line MGL script in file @var{fp}. If @var{print}=@code{true} then all warnings and information will be printed in stdout. @end deftypefn -@deftypefn {Method on @code{mglParse} (C++)} @code{void} Execute (@code{mglGraph *}gr, @code{FILE *}fp, @code{bool} print=@code{false}) -Function parse and execute line-by-line MGL script in file @var{fp}. If @var{print}=@code{true} then all warnings and information will be printed in stdout. Also this function support the @code{for|next} MGL commands. -@end deftypefn -@deftypefn {Method on @code{mglParse} (C++)} @code{void} Execute (@code{mglGraph *}gr, @code{int} num, @code{const wchar_t **}text, @code{void (*} error @code{)(int line, int kind)=NULL}) -Function parse and execute line-by-line MGL script in array @var{text}. If @var{error} is not @code{NULL} then this function will be called for all warnings, information and other messages. Also this function support the @code{for|next} MGL commands. -@end deftypefn - -@deftypefn {Method on @code{mglParse} (C++, Python)} @code{void} Execute (@code{mglGraph *}gr, @code{const char *}text, @code{void (*} error @code{)(int line, int kind)=NULL}) -@deftypefnx {Method on @code{mglParse} (C++)} @code{void} Execute (@code{mglGraph *}gr, @code{const wchar_t *}text, @code{void (*} error @code{)(int line, int kind)=NULL}) -@deftypefnx {C function} @code{void} mgl_parse_text (@code{HMGL} gr, @code{HMPR} p, @code{const char *}text) -@deftypefnx {C function} @code{void} mgl_parsew_text (@code{HMGL} gr, @code{HMPR} p, @code{const wchar_t *}text) -Function parse and execute line-by-line MGL script in string @var{text}. Lines are separated by @samp{\n} symbol as usual. If @var{error} is not @code{NULL} then this function will be called for all warnings, information and other messages. Also this function support the @code{for|next} MGL commands. +@deftypefn {Method on @code{mglParse}} @code{void} Execute (@code{mglGraph *}gr, @code{const char *}text, @code{void (*} error @code{)(int line, int kind, char *mes)=NULL}) +@deftypefnx{Method on @code{mglParse}} @code{void} Execute (@code{mglGraph *}gr, @code{const wchar_t *}text, @code{void (*} error @code{)(int line, int kind, char *mes)=NULL}) +@deftypefnx {C function} @code{void} mgl_parse_text (@code{HMGL} gr, @code{HMPR} p, @code{const char *}text, @code{void (*} error @code{)(int line, int kind, char *mes)}) +@deftypefnx {C function} @code{void} mgl_parsew_text (@code{HMGL} gr, @code{HMPR} p, @code{const wchar_t *}text, @code{void (*} error @code{)(int line, int kind, char *mes)}) +Function parse and execute line-by-line MGL script in array @var{text}. Lines are separated by newline symbol @samp{\n} as usual. If @var{error} is not @code{NULL} then this function will be called for all warnings, information and other messages. @end deftypefn -@deftypefn {Method on @code{mglParse} (C++, Python)} @code{bool} AddParam (@code{int} n, @code{const char *}str, @code{bool} isstr=@code{true}) +@deftypefn {Method on @code{mglParse}} @code{bool} AddParam (@code{int} n, @code{const char *}str, @code{bool} isstr=@code{true}) @deftypefnx {Method on @code{mglParse} (C++)} @code{bool} AddParam (@code{int} n, @code{const wchar_t *}str, @code{bool} isstr=@code{true}) @deftypefnx {C function} @code{void} mgl_add_param (@code{HMPR} p, @code{int} id, @code{const char *}val) @deftypefnx {C function} @code{void} mgl_add_paramw (@code{HMPR} p, @code{int} id, @code{const wchar_t *}val) Function set the value of @var{n}-th parameter as string @var{str} (@var{n}=0, 1 ... 9). It return @code{true} for success. @end deftypefn -@deftypefn {Method on @code{mglParse} (C++, Python)} @code{mglVar *} FindVar (@code{const char *}name) -@deftypefnx {Method on @code{mglParse} (C++)} @code{mglVar *} FindVar (@code{const wchar_t *}name) -@deftypefnx {C function} @code{const HMDT} mgl_find_var (@code{HMPR} p, @code{const char *}name) -Function returns the pointer to variable with name @var{name} or zero if variable is absent. Use this function to put external data array to the script or get the data from the script. +@deftypefn {Method on @code{mglParse}} @code{mglData *} FindVar (@code{const char *}name) +@deftypefnx {C function} @code{HMDT} mgl_find_var (@code{HMPR} p, @code{const char *}name) +Function returns the pointer to variable with name @var{name} or zero if variable is absent. Use this function to put external data array to the script or get the data from the script. You must @strong{not delete} obtained data arrays! @end deftypefn -@deftypefn {Method on @code{mglParse} (C++, Python)} @code{mglVar *} AddVar (@code{const char *}name) -@deftypefnx {Method on @code{mglParse} (C++)} @code{mglVar *} AddVar (@code{const wchar_t *}name) -@deftypefnx {C function} @code{const HMDT} mgl_add_var (@code{HMPR} p, @code{const char *}name) -Function returns the pointer to variable with name @var{name}. If variable is absent then new variable is created with name @var{name}. Use this function to put external data array to the script or get the data from the script. +@deftypefn {Method on @code{mglParse}} @code{mglData *} AddVar (@code{const char *}name) +@deftypefnx {C function} @code{HMDT} mgl_add_var (@code{HMPR} p, @code{const char *}name) +Function returns the pointer to variable with name @var{name}. If variable is absent then new variable is created with name @var{name}. Use this function to put external data array to the script or get the data from the script. You must @strong{not delete} obtained data arrays! @end deftypefn -@deftypefn {Method on @code{mglParse} (C++)} @code{void} DeleteVar (@code{mglVar *}v) -@deftypefnx {Method on @code{mglParse} (C++)} @code{void} DeleteVar (@code{const char *}name) -@deftypefnx {Method on @code{mglParse} (C++)} @code{void} DeleteVar (@code{const wchar_t *}name) +@deftypefn{Method on @code{mglParse} (C++)} @code{void} DeleteVar (@code{const char *}name) +@deftypefnx {C function} @code{void} mgl_del_var (@code{HMPR} p, @code{const char *}name) Function delete the variable specified by its name or by its pointer. @end deftypefn -@deftypefn {Method on @code{mglParse} (C++, Python)} @code{inline void} RestoreOnce () +@deftypefn {Method on @code{mglParse}} @code{void} RestoreOnce () @deftypefnx {C function} @code{void} mgl_restore_once (@code{HMPR} p) Restore Once flag. @end deftypefn -@deftypefn {Method on @code{mglParse} (Python)} @code{void} AllowSetSize (@code{bool} a) +@deftypefn {Method on @code{mglParse}} @code{void} AllowSetSize (@code{bool} a) @deftypefnx {C function} @code{void} mgl_parser_allow_setsize (@code{HMPR} p, @code{int} a) Allow to parse 'setsize' command or not. @end deftypefn -@deftypefn {Method on @code{mglParse} (C++)} @code{void} AddCommand (@code{mglCommand *}cmd, @code{int} num=@code{0}) -Add @var{num} commands @var{cmd} to the defined MGL commands list. Parameter @var{cmd} is array of @code{mglCommand} structures. If parameter @var{num}=0 then it will be determined automatically. At this, array @var{cmd} @strong{must have} last element with @code{name=L""} +@deftypefn {Method on @code{mglParse}} @code{void} Stop () +@deftypefnx {C function} @code{void} mgl_parser_stop (@code{HMPR} p) +Sends stop signal which terminate execution at next command. @end deftypefn -@deftypecv {Option} mglParse @code{mglVar *} DataList -List of variables defined in script. -@end deftypecv -@deftypecv {Option} mglParse @code{bool} AllowSetSize -Flag which allows/forbids the command @code{setsize} in scripts. -@end deftypecv -@deftypecv {Option} mglParse @code{bool} Stop -Flag which interrupt script execution. -@end deftypecv -@deftypecv {Option} mglParse @code{mglCommand *} Cmd -Table (array) of recognizable MGL commands (can be changed by user). Items in the table @strong{MUST be sorted} by @var{name} field !!! Last items must have empty name (i.e. @code{L""}). -@end deftypecv -@deftypecv {Option} mglParse @code{wchar_t *} op1 -These strings contain command options and should be placed before the command. These variables are used for MGL->C++ (or other language) conversion. -@end deftypecv -@deftypecv {Option} mglParse @code{wchar_t *} op2 -These strings contain command options and should be placed after the command. These variables are used for MGL->C++ (or other language) conversion. -@end deftypecv + +@deftypefn {Method on @code{mglParse}} @code{void} Stop () +@deftypefnx {C function} @code{void} mgl_parser_stop (@code{HMPR} p) +Sends stop signal which terminate execution at next command. +@end deftypefn @c ------------------------------------------------------------------ -@node mglFormula class, mglFont class, mglParse class, Other classes +@node mglFormula class, mglColor class, mglParse class, Other classes @section mglFormula class @cindex mglFormula -Class for evaluating of formula specified by the string. This class is defined in @code{#include }. +Class for evaluating of formula specified by the string. This class is defined in @code{#include }. This class is accessible only from C++ (and only from GNU compilers in default binary files). 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}. @@ -144,12 +123,144 @@ Evaluates the formula derivation respect to @var{diff} for variables in array @v Returns error code: @code{0} means no error; @code{ERR_LOG} means error in logarithm or power functions; @code{ERR_ARC} means error in inverse functions (like asin); @code{ERR_SQRT} means error in sqrt function. @end deftypemethod + @c ------------------------------------------------------------------ -@node mglFont class, mglColor class, mglFormula class, Other classes +@node mglColor class, mglPoint class, mglFormula class, Other classes +@section mglColor class +@cindex mglColor + +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}. + +@deftypecv {Parameter} mglColor @code{float} {r, g, b, a} +Reg, green and blue component of color. +@end deftypecv + +@deftypemethod mglColor @code{} mglColor (@code{float} R, @code{float} G, @code{float} B, @code{float} A=@code{1}) +Constructor sets the color by float values of Red, Green, Blue and Alpha channels. These values should be in interval [0,1]. +@end deftypemethod +@deftypemethod mglColor @code{} mglColor (@code{char} c=@code{'k'}, @code{float} bright=@code{1}) +Constructor sets the color from character id. The black color is used by default. Parameter @var{br} set additional ``lightness'' of color. +@end deftypemethod +@deftypemethod mglColor @code{void} Set (@code{float} R, @code{float} G, @code{float} B, @code{float} A=@code{1}) +Sets color from values of Red, Green, Blue and Alpha channels. These values should be in interval [0,1]. +@end deftypemethod +@deftypemethod mglColor @code{void} Set (@code{mglColor} c, @code{float} bright=@code{1}) +Sets color as ``lighted'' version of color @var{c}. +@end deftypemethod +@deftypemethod mglColor @code{void} Set (@code{char} p, @code{float} bright=@code{1}) +Sets color from symbolic id. +@end deftypemethod +@deftypemethod mglColor @code{bool} Valid () +Checks correctness of the color. +@end deftypemethod +@deftypemethod mglColor @code{float} Norm () +Gets maximal of spectral component. +@end deftypemethod +@deftypemethod mglColor @code{bool} operator== (@code{const mglColor &}c) +@deftypemethodx mglColor @code{bool} operator!= (@code{const mglColor &}c) +Compare with another color +@end deftypemethod + + +@deftypefn {Library Function} {mglColor} operator+ (@code{const mglColor &}a, @code{const mglColor &}b) +Adds colors by its RGB values. +@end deftypefn +@deftypefn {Library Function} @code{mglColor} operator- (@code{const mglColor &}a, @code{const mglColor &}b) +Subtracts colors by its RGB values. +@end deftypefn +@deftypefn {Library Function} @code{mglColor} operator* (@code{const mglColor &}a, @code{float} b) +@deftypefnx {Library Function} @code{mglColor} operator* (@code{float} a, @code{const mglColor &}b) +Multiplies color by number. +@end deftypefn +@deftypefn {Library Function} @code{mglColor} operator/ (@code{const mglColor &}a, @code{float} b) +Divide color by number. +@end deftypefn +@deftypefn {Library Function} @code{mglColor} operator! (@code{const mglColor &}a) +Return inverted color. +@end deftypefn + +@c ------------------------------------------------------------------ +@node mglPoint class, mglFont class, mglColor class, Other classes +@section mglPoint class +@cindex mglPoint + +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. +@end deftypecv + +@deftypemethod mglPoint @code{} mglPoint (@code{float} X=@code{0}, @code{float} Y=@code{0}, @code{float} Z=@code{0}, @code{float} C=@code{0}) +Constructor sets the color by float values of Red, Green, Blue and Alpha channels. These values should be in interval [0,1]. +@end deftypemethod + +@deftypemethod mglPoint @code{bool} IsNAN () +Returns @code{true} if point contain NAN values. +@end deftypemethod +@deftypemethod mglPoint @code{float} norm () +Returns the norm @math{\sqrt@{x^2+y^2+z^2@}} of vector. +@end deftypemethod +@deftypemethod mglPoint @code{void} Normalize () +Normalizes vector to be unit vector. +@end deftypemethod +@deftypemethod mglPoint @code{float} val (@code{int} i) +Returns point component: @var{x} for @var{i}=0, @var{y} for @var{i}=1, @var{z} for @var{i}=2, @var{c} for @var{i}=3. +@end deftypemethod + + +@deftypefn {Library Function} @code{mglPoint} operator+ (@code{const mglPoint &}a, @code{const mglPoint &}b) +Point of summation (summation of vectors). +@end deftypefn +@deftypefn {Library Function} @code{mglPoint} operator- (@code{const mglPoint &}a, @code{const mglPoint &}b) +Point of difference (difference of vectors). +@end deftypefn +@deftypefn {Library Function} @code{mglPoint} operator* (@code{float} a, @code{const mglPoint &}b) +@deftypefnx {Library Function} @code{mglPoint} operator* (@code{const mglPoint &}a, @code{float} b) +Multiplies (scale) points by number. +@end deftypefn +@deftypefn {Library Function} @code{mglPoint} operator/ (@code{const mglPoint &}a, @code{float} b) +Multiplies (scale) points by number 1/b. +@end deftypefn +@deftypefn {Library Function} @code{float} operator* (@code{const mglPoint &}a, @code{const mglPoint &}b) +Scalar product of vectors. +@end deftypefn + +@deftypefn {Library Function} @code{mglPoint} operator/ (@code{const mglPoint &}a, @code{const mglPoint &}b) +Return vector of element-by-element product. +@end deftypefn + +@deftypefn {Library Function} @code{mglPoint} operator^ (@code{const mglPoint &}a, @code{const mglPoint &}b) +Cross-product of vectors. +@end deftypefn +@deftypefn {Library Function} @code{mglPoint} operator& (@code{const mglPoint &}a, @code{const mglPoint &}b) +The part of @var{a} which is perpendicular to vector @var{b}. +@end deftypefn +@deftypefn {Library Function} @code{mglPoint} operator| (@code{const mglPoint &}a, @code{const mglPoint &}b) +The part of @var{a} which is parallel to vector @var{b}. +@end deftypefn + +@deftypefn {Library Function} @code{mglPoint} operator! (@code{const mglPoint &}a) +Return vector perpendicular to vector @var{a}. +@end deftypefn +@deftypefn {Library Function} @code{float} mgl_norm (@code{const mglPoint &}a) +Return the norm sqrt(|@var{a}|^2) of vector @var{a}. +@end deftypefn + +@deftypefn {Library Function} @code{bool} operator== (@code{const mglPoint &}a, @code{const mglPoint &}b) +Return true if points are the same. +@end deftypefn +@deftypefn {Library Function} @code{bool} operator!= (@code{const mglPoint &}a, @code{const mglPoint &}b) +Return true if points are different. +@end deftypefn + +@c ------------------------------------------------------------------ +@node mglFont class, mglVar class, mglPoint class, Other classes @section mglFont class @cindex mglFont -Class for working with font: load, get metrics, parse and draw strings. This class is defined in @code{#include }. +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. @@ -159,7 +270,7 @@ The over way of font and alignment setting is the using of the integer constant. @menu -* Format of font files:: +* Format of font files:: @end menu @@ -172,16 +283,16 @@ Load font from file @var{path}/@var{base} into the memory. The font may contain @deftypemethod mglFont @code{void} Restore () Restore default font. @end deftypemethod -@deftypemethod mglFont @code{void} (@code{mglFont *} fnt) +@deftypemethod mglFont @code{void} Copy (@code{mglFont *}fnt) Copy data from other font instance. @end deftypemethod @deftypemethod mglFont @code{void} Clear () Clear memory by deleting the loaded font. @end deftypemethod -@deftypemethod mglFont @code{inline unsigned} GetNumGlyph () +@deftypemethod mglFont @code{unsigned} GetNumGlyph () Return the number of glyphs in the font. @end deftypemethod -@deftypemethod mglFont @code{inline bool} Ready () +@deftypemethod mglFont @code{bool} Ready () Return true if font is loaded and ready for use. @end deftypemethod @@ -219,7 +330,7 @@ Prints Unicode text string for font specified by string. Gets width of Unicode text string for font specified by string. @end deftypemethod -@deftypecv {Parameter} mglFont @code{mglGraph *} gr +@deftypecv {Parameter} mglFont @code{HMGL} gr Instance of mglGraph class which is used for character drawing. @end deftypecv @deftypecv {Parameter} mglFont @code{bool} parse @@ -248,128 +359,17 @@ Each font file can be compressed by gzip. Note: the closing contour line is done automatically (so the last segment may be absent). For starting new contour use a point with coordinates @code{@{0x3fff, 0x3fff@}}. - -@c ------------------------------------------------------------------ -@node mglColor class, mglPoint class, mglFont class, Other classes -@section mglColor class -@cindex mglColor - -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}. - -@deftypecv {Parameter} mglVar @code{float} {r, g, b} -Reg, green and blue component of color. -@end deftypecv - -@deftypemethod mglColor @code{} mglColor (@code{float} R, @code{float} G, @code{float} B) -Constructor sets the color by float values of Red, Green and Blue channels. -@end deftypemethod -@deftypemethod mglColor @code{} mglColor (@code{char} c=@code{'k'}) -Constructor sets the color from character id. The black color is used by default. -@end deftypemethod -@deftypemethod mglColor @code{void} Set (@code{float} R, @code{float} G, @code{float} B) -Sets color from values of Red, Green and Blue channels. This values should be in interval [0,1]. -@end deftypemethod -@deftypemethod mglColor @code{void} Set (@code{mglColor} c, @code{float} bright=@code{1}) -Sets color as ``lighted'' version of color @var{c}. -@end deftypemethod -@deftypemethod mglColor @code{void} Set (@code{char} p) -Sets color from symbolic id. -@end deftypemethod -@deftypemethod mglColor @code{bool} Valid () -Checks correctness of the color. -@end deftypemethod -@deftypemethod mglColor @code{float} Norm () -Gets maximal of spectral component. -@end deftypemethod -@deftypemethod mglColor @code{bool} operator== (@code{const mglColor &}c) -Compare with another color -@end deftypemethod - -@deftypefn {Library Function} {inline mglColor} operator+ (@code{const mglColor &}a, @code{const mglColor &}b) -Adds colors by its RGB values. -@end deftypefn -@deftypefn {Library Function} {inline mglColor} operator- (@code{const mglColor &}a, @code{const mglColor &}b) -Subtracts colors by its RGB values. -@end deftypefn -@deftypefn {Library Function} {inline mglColor} operator* (@code{const mglColor &}a, @code{float} b) -Multiplies color by number. -@end deftypefn -@deftypefn {Library Function} {inline mglColor} operator* (@code{float} a, @code{const mglColor &}b) -Multiplies color by number. -@end deftypefn -@deftypefn {Library Function} {inline mglColor} operator/ (@code{const mglColor &}a, @code{float} b) -Divide color by number. -@end deftypefn -@deftypefn {Library Function} {inline mglColor} operator! (@code{const mglColor &}a) -Return inverted color. -@end deftypefn - -@c ------------------------------------------------------------------ -@node mglPoint class, mglArg class, mglColor class, Other classes -@section mglPoint class -@cindex mglPoint - -Structure describes point in space. This structure is defined in @code{#include } - -@deftypecv {Parameter} mglVar @code{float} {x, y, z} -Point coordinates. By default all values are zero. -@end deftypecv - -@deftypefn {Library Function} {inline mglPoint} operator+ (@code{const mglPoint &}a, @code{const mglPoint &}b) -Point of summation (summation of vectors). -@end deftypefn -@deftypefn {Library Function} {inline mglPoint} operator- (@code{const mglPoint &}a, @code{const mglPoint &}b) -Point of difference (difference of vectors). -@end deftypefn -@deftypefn {Library Function} {inline mglPoint} operator* (@code{float} a, @code{const mglPoint &}b) -Multiplies (scale) points by number. -@end deftypefn -@deftypefn {Library Function} {inline mglPoint} operator* (@code{const mglPoint &}a, @code{float} b) -Multiplies (scale) points by number. -@end deftypefn -@deftypefn {Library Function} {inline mglPoint} operator/ (@code{const mglPoint &}a, @code{float} b) -Multiplies (scale) points by number 1/b. -@end deftypefn -@deftypefn {Library Function} {inline float} operator- (@code{const mglPoint &}a, @code{const mglPoint &}b) -Scalar product of vectors. -@end deftypefn -@deftypefn {Library Function} {inline mglPoint} operator^ (@code{const mglPoint &}a, @code{const mglPoint &}b) -Cross-product of vectors. -@end deftypefn -@deftypefn {Library Function} {inline mglPoint} operator& (@code{const mglPoint &}a, @code{const mglPoint &}b) -The part of @var{a} which is perpendicular to vector @var{b}. -@end deftypefn -@deftypefn {Library Function} {inline mglPoint} operator| (@code{const mglPoint &}a, @code{const mglPoint &}b) -The part of @var{a} which is parallel to vector @var{b}. -@end deftypefn - -@deftypefn {Library Function} {inline mglPoint} operator! (@code{const mglPoint &}a) -Return vector perpendicular to vector @var{a}. -@end deftypefn -@deftypefn {Library Function} {inline bool} Norm (@code{const mglPoint &}a) -Return the norm |@var{a}|^2 of vector @var{a}. -@end deftypefn - -@deftypefn {Library Function} {inline bool} operator== (@code{const mglPoint &}a, @code{const mglPoint &}b) -Return true if points are the same. -@end deftypefn -@deftypefn {Library Function} {inline bool} operator!= (@code{const mglPoint &}a, @code{const mglPoint &}b) -Return true if points are different. -@end deftypefn - @c ------------------------------------------------------------------ -@node mglVar class, mglCommand class, mglArg class, Other classes +@node mglVar class, mglCommand class, mglFont class, Other classes @section mglVar class @cindex mglVar -Structure describes variable of type @code{mglData} and its name in MGL script. This structure is used by @code{mglParse} and is defined in @code{#include }. +Structure describes variable of type @code{mglData} and its name in MGL script. This structure is used by @code{mglParse} and is defined in @code{#include }. This class is accessible only from C++ (and only from GNU compilers in default binary files). @deftypecv {Parameter} mglVar @code{mglData} d Data itself @end deftypecv -@deftypecv {Parameter} mglVar @code{wchar_t} s[256] +@deftypecv {Parameter} mglVar @code{std::wstring} s Data name @end deftypecv @deftypecv {Parameter} mglVar @code{void *} o @@ -394,11 +394,11 @@ Move variable after @var{var} and copy @code{func} from @code{var} (if @code{fun @c ------------------------------------------------------------------ -@node mglCommand class, , mglVar class, Other classes +@node mglCommand class, mglArg class, mglVar class, Other classes @section mglCommand class @cindex mglCommand -Structure describes MGL command, its name, short description, executable and export functions. The structure is used by @code{mglParse} and is defined in @code{#include }. +Structure describes MGL command, its name, short description, executable and export functions. The structure is used by @code{mglParse} and is defined in @code{#include }. This class is accessible only from C++ (and only from GNU compilers in default binary files). @deftypecv {Parameter} mglCommand @code{const wchar_t *} name Name of command. @@ -418,11 +418,11 @@ Function for exporting in C++ (can be NULL). @c ------------------------------------------------------------------ -@node mglArg class, mglVar class, mglPoint class, Other classes +@node mglArg class, , mglCommand class, Other classes @section mglArg class @cindex mglArg -Structure describes arguments of functions in the stucture @code{mglCommand}. It is defined in @code{#include }. +Structure describes arguments of functions in the stucture @code{mglCommand}. It is defined in @code{#include }. This class is accessible only from C++ (and only from GNU compilers in default binary files). @deftypecv {Parameter} mglArg @code{int} type Type of argument: 0-data, 1-string, 2-number. @@ -430,10 +430,10 @@ Type of argument: 0-data, 1-string, 2-number. @deftypecv {Parameter} mglArg @code{mglData *} d Pointer to data (used if type=0). @end deftypecv -@deftypecv {Parameter} mglArg @code{wchar_t} w[2048] +@deftypecv {Parameter} mglArg @code{std::wstring} w String with parameters (used if type=1 or if type=0 as variable name). @end deftypecv -@deftypecv {Parameter} mglArg @code{char} s[2048] +@deftypecv {Parameter} mglArg @code{std::string} s String with parameters (used if type=1). @end deftypecv @deftypecv {Parameter} mglArg @code{float} v diff --git a/texinfo/overview_en.texi b/texinfo/overview_en.texi index 05aec1e..02f67aa 100644 --- a/texinfo/overview_en.texi +++ b/texinfo/overview_en.texi @@ -15,12 +15,13 @@ a library with large and growing set of graphics. @end itemize @menu -* Why have I written MathGL?:: +* Why have I written MathGL?:: * MathGL features:: * Installation and usage:: * General concepts:: * FAQ:: * Interfaces:: +* Utilities:: * Thanks:: @end menu @@ -29,7 +30,7 @@ a library with large and growing set of graphics. A code for making high-quality scientific graphics under Linux and Windows. A code for the fast handling and plotting of large data arrays. A code for working in window and console regimes and for easy including into another program. A code with large and renewal set of graphics. Exactly such a code I was looking for in the last years. Exactly such a code I tried to realize in MathGL library. -At this version (@value{VERSION}) MathGL has more than 20000 code strings, more than 40 general types of graphics for 1d, 2d and 3d data arrays. It can export graphics to bitmap and vector (EPS or SVG) files. It has OpenGL interface and can be used from console programs. It has functions for data handling and script MGL language for simplification of data plotting. It also has several types of transparency and smoothed lighting, vector fonts and TeX-like symbol parsing, arbitrary curvilinear coordinate system and many other useful things (see pictures section at @uref{http://mathgl.sf.net/, homepage}). Finally it is platform-independent and free (under GPL v.2.0 or later license). +At this version (@value{VERSION}) MathGL has more than 50 general types of graphics for 1d, 2d and 3d data arrays. It can export graphics to bitmap and vector (EPS or SVG) files. It has OpenGL interface and can be used from console programs. It has functions for data handling and script MGL language for simplification of data plotting. It also has several types of transparency and smoothed lighting, vector fonts and TeX-like symbol parsing, arbitrary curvilinear coordinate system and many other useful things (see pictures section at @uref{http://mathgl.sf.net/, homepage}). Finally it is platform-independent and free (under GPL v.2.0 or later license). @node MathGL features, Installation and usage, Why have I written MathGL?, Overview @section MathGL features @@ -46,7 +47,7 @@ two-dimensional plots (Mesh, Surf, Dens, Cont, ContF, Boxs, Axial, Fall, Belt, T three-dimensional plots (Surf3, Dens3, Cont3, ContF3, Cloud-like, @pxref{3D plotting}); @item -dual data plots: vector fields Vect and VectC, flow threads Flow, mapping chart Map, surfaces and isosurfaces, transparent or colored (i.e. with transparency or color varied) by other data SurfA, SurfC, Surf3A, Surf3C (@pxref{Dual plotting}); +dual data plots: vector fields Vect, flow threads Flow, mapping chart Map, surfaces and isosurfaces, transparent or colored (i.e. with transparency or color varied) by other data SurfA, SurfC, Surf3A, Surf3C (@pxref{Dual plotting}); @item and so on. For details see @pxref{MathGL core}. @@ -54,13 +55,13 @@ and so on. For details see @pxref{MathGL core}. In fact, I created the functions for drawing of all the types of scientific plots that I know. The list of plots is growing; if you need some special type of a plot then please email me @email{mathgl.abalakin@@gmail.com, e-mail} and it will appear in the new version. -I tried to make plots as nice looking as possible: e.g., a surface can be transparent and highlighted by several (up to 10) light sources. Most of the drawing functions have 2 variants: simple one for the fast plotting of data, complex one for specifying of the exact position of the plot (including parametric representation). Resulting image can be saved in bitmap (with the help of mglGraphZB, mglGraphGL) PNG, JPEG, TIFF, BMP format or in vector EPS or SVG format (with the help of mglGraphPS), or in IDTF format (with the help of mglGraphIDTF) which can be converted into U3D. +I tried to make plots as nice looking as possible: e.g., a surface can be transparent and highlighted by several (up to 10) light sources. Most of the drawing functions have 2 variants: simple one for the fast plotting of data, complex one for specifying of the exact position of the plot (including parametric representation). Resulting image can be saved in bitmap PNG, JPEG, TGA, BMP format or in vector EPS, SVG or TeX format, or in IDTF format (with the help of mglGraphIDTF) which can be converted into U3D. -All texts are drawn by vector fonts, which allows for high scalability and portability. Texts may contain commands for: some of the TeX-like symbols, changing index (upper or lower indexes) and the style of font inside the text string (@pxref{mglFont class}). Texts of ticks are rotated with axis rotation. It is possible to create a legend of plot and put text in an arbitrary position on the plot. Arbitrary text encoding (by the help of function @code{setlocale()}) and UTF-16 encoding are supported. +All texts are drawn by vector fonts, which allows for high scalability and portability. Texts may contain commands for: some of the TeX-like symbols, changing index (upper or lower indexes) and the style of font inside the text string (@pxref{Font styles}). Texts of ticks are rotated with axis rotation. It is possible to create a legend of plot and put text in an arbitrary position on the plot. Arbitrary text encoding (by the help of function @code{setlocale()}) and UTF-16 encoding are supported. -Special mglData class is used for data encapsulation (@pxref{mglData class}). In addition to a safe creation and deletion of data arrays it includes functions for data processing (smoothing, differentiating, integrating, interpolating and so on) and reading of data files with automatic size determination. Class mglData can handle arrays with up to three dimensions (arrays which depend on up to 3 independent indexes @math{a_@{ijk@}}). Using an array with higher number of dimensions is not meaningful, because I do not know how it can be plotted. Data filling and modification may be done manually or by textual formulas. +Special class mglData is used for data encapsulation (@pxref{Data processing}). In addition to a safe creation and deletion of data arrays it includes functions for data processing (smoothing, differentiating, integrating, interpolating and so on) and reading of data files with automatic size determination. Class mglData can handle arrays with up to three dimensions (arrays which depend on up to 3 independent indexes @math{a_@{ijk@}}). Using an array with higher number of dimensions is not meaningful, because I do not know how it can be plotted. Data filling and modification may be done manually or by textual formulas. -The mglFormula class allows a fast evaluation of a textual mathematical expression (@pxref{mglFormula class}). It is based on string precompilation to tree-like code at the creation of class instance. At evaluation stage code performs only fast tree-walk and returns the value of the expression. In addition to changing data values, textual formulas are also used for drawing in @emph{arbitrary} curvilinear coordinates. A set of such curvilinear coordinates is limited only by user’s imagination rather than a fixed list like: polar, parabolic, spherical, and so on. +There is fast evaluation of a textual mathematical expression (@pxref{Textual formulas}). It is based on string precompilation to tree-like code at the creation of class instance. At evaluation stage code performs only fast tree-walk and returns the value of the expression. In addition to changing data values, textual formulas are also used for drawing in @emph{arbitrary} curvilinear coordinates. A set of such curvilinear coordinates is limited only by user's imagination rather than a fixed list like: polar, parabolic, spherical, and so on. @node Installation and usage, General concepts, MathGL features, Overview @section Installation and usage @@ -68,12 +69,12 @@ The mglFormula class allows a fast evaluation of a textual mathematical expressi 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 beginning from version 1.2.1. 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. +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. -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-tiff, --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}. +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 cmake 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. However the making of MathGL documentation is switched off for this case. You can use WYSIWYG tools to change cmake build options. +One can use also CMake 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. @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}).. @@ -87,20 +88,20 @@ To compile your own program, you need to specify the linker option @code{-lmgl} @node General concepts, FAQ, Installation and usage, Overview @section General concepts -The set of MathGL features is rather rich -- just the number of basic graphics types -is larger than 40. Also there are functions for data handling, plot setup and so on. In spite of it I tried to keep a similar style in function names and in the order of arguments. Mostly it is +The set of MathGL features is rather rich -- just the number of basic graphics types +is larger than 50. Also there are functions for data handling, plot setup and so on. In spite of it I tried to keep a similar style in function names and in the order of arguments. Mostly it is used for different drawing functions. There are six most general (base) concepts: @enumerate @item -@strong{Any picture is created in memory first.} The internal (memory) representation can be different: bitmap picture or the list of vector primitives. After that the user may decide what he/she want: save to file, display on the screen, run animation, do additional editing and so on. This approach assures a high portability of the program -- the source code will produce exactly the same picture in @emph{any} OS. Another big positive consequence is the ability to create the picture in the console program (using command line, without creating a window)! +@strong{Any picture is created in memory first.} The internal (memory) representation can be different: bitmap picture (for @code{SetQuality(MGL_DRAW_LMEM)}) or the list of vector primitives (default). After that the user may decide what he/she want: save to file, display on the screen, run animation, do additional editing and so on. This approach assures a high portability of the program -- the source code will produce exactly the same picture in @emph{any} OS. Another big positive consequence is the ability to create the picture in the console program (using command line, without creating a window)! @item @strong{Every plot settings (style of lines, font, color scheme) are specified by a string.} It provides convenience for user/programmer -- short string with parameters is more comprehensible than a large set of parameters. Also it provides portability -- the strings are the same in any OS so that it is not necessary to think about argument types. @item -@strong{All functions have ``simplified'' and ``advanced'' forms.} It is done for user’s convenience. One needs to specify only one data array in the ``simplified'' form in order to see the result. But one may set parametric dependence of coordinates and produce rather complex curves and surfaces in the ``advanced'' form. In both cases the order of function arguments is the same: first data arrays, second the string with plot parameters, and later optional arguments for plot tuning. +@strong{All functions have ``simplified'' and ``advanced'' forms.} It is done for user's convenience. One needs to specify only one data array in the ``simplified'' form in order to see the result. But one may set parametric dependence of coordinates and produce rather complex curves and surfaces in the ``advanced'' form. In both cases the order of function arguments is the same: first data arrays, second the string with style, and later string with options for additional plot tuning. @item -@strong{All data arrays for plotting are encapsulated in mglData class.} This reduces the number of errors while working with memory and provides a uniform interface for data of different types (float, double and so on) or for formula plotting. +@strong{All data arrays for plotting are encapsulated in mglData(A) class.} This reduces the number of errors while working with memory and provides a uniform interface for data of different types (float, double and so on) or for formula plotting. @item @strong{All plots are vector plots.} The MathGL library is intended for handling scientific data which have vector nature (lines, faces, matrices and so on). As a result, vector representation is used in all cases! In addition, the vector representation allows one to scale the plot easily -- change the canvas size by a factor of 2, and the picture will be proportionally scaled. @item @@ -110,11 +111,12 @@ There are six most general (base) concepts: In addition to the general concepts I want to comment on some non-trivial or less commonly used general ideas -- plot positioning, axis specification and curvilinear coordinates, styles for lines, text and color scheme. @menu -* Coordinate axes:: -* Line styles:: -* Color scheme:: -* Font styles:: -* Textual formulas:: +* Coordinate axes:: +* Line styles:: +* Color scheme:: +* Font styles:: +* Textual formulas:: +* Command options:: @end menu @include concept_en.texi @@ -133,7 +135,7 @@ Most ``new'' types of plots can be created by using the existing drawing functio No. The MathGL library is self-contained and does not require the knowledge of external libraries. @item In which language is the library written? For which languages does it have an interface? -The core of the MathGL library is written in C++. But there are interfaces for: pure C, Fortran, Pascal, Forth, and its own command language MGL. Also there is a large set of interpreted languages, which are supported (Python, Java, ALLEGROCL, CHICKEN, Lisp, CFFI, C#, Guile, Lua, Modula 3, Mzscheme, Ocaml, Octave, Perl, PHP, Pike, R, Ruby, Tcl). These interfaces are written using SWIG (both pure C functions and classes) but only the interface for Python and Octave is included in the autoconf/automake script. The reason is that I don’t know any other interpreted languages :(. Note that most other languages can use (link to) the pure C functions. +The core of the MathGL library is written in C++. But there are interfaces for: pure C, Fortran, Pascal, Forth, and its own command language MGL. Also there is a large set of interpreted languages, which are supported (Python, Java, ALLEGROCL, CHICKEN, Lisp, CFFI, C#, Guile, Lua, Modula 3, Mzscheme, Ocaml, Octave, Perl, PHP, Pike, R, Ruby, Tcl). These interfaces are written using SWIG (both pure C functions and classes) but only the interface for Python and Octave is included in the autoconf/automake script. The reason is that I don't know any other interpreted languages :(. Note that most other languages can use (link to) the pure C functions. @item How can I use MathGL with Fortran? You can use MathGL as is with @code{gfortran} because it uses by default the AT&T notation for external functions. For other compilers (like Visual Fortran) you have to switch on the AT&T notation manually. The AT&T notation requires that the symbol @samp{_} is added at the end of each function name, function argument(s) is passed by pointers and the string length(s) is passed at the end of the argument list. For example: @@ -162,7 +164,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 (@pxref{Cutting}). Last, you may change the transparency of a part of the plot by the help of functions @code{SurfA()}, @code{Surf3A()} (@pxref{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 1.10, you can use the header file @code{#include } which contains wrapper C++ classes, which should be acceptable for any compiler. Note, that wrapper classes are @strong{incompatible} with classes in usual headers and you should use only one of them (wrapper or usual)! However, I recommend to use the usual headers if you use GNU compilers (like MinGW). +In version 2.0, the recomended 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. @@ -173,13 +175,12 @@ The simplest way is using the combination CMake+MinGW. Also you need some extra You should create a separate thread for processing window messages. The cross-platform way is using the @code{pthread} library. You can update the data by calling @code{mglGraphFLTK::Update()} function. The code can look like this: @verbatim //----------------------------------------------------------------------------- -#include +#include #include -#include mglPoint pnt; // some global variable for changable data //----------------------------------------------------------------------------- -int sample(mglGraph *gr, void *) +int sample(mglGraph *gr) { gr->Box(); gr->Line(mglPoint(),pnt,"Ar2"); // just draw a vector return 0; @@ -188,8 +189,7 @@ int sample(mglGraph *gr, void *) void *mgl_fltk_tmp(void *) { mglFlRun(); return 0; } int main (int argc, char ** argv) { - mglGraphFLTK gr; - gr.Window(argc,argv,sample,"test"); // create window + mglWindow gr(0,sample,"test"); // create window static pthread_t tmp; pthread_create(&tmp, 0, mgl_fltk_tmp, 0); pthread_detach(tmp); // run window handling in the separate thread @@ -203,6 +203,32 @@ int main (int argc, char ** argv) } //----------------------------------------------------------------------------- @end verbatim +If you just need a static image with current results of calculation then you can set @code{NULL} as plotting function and call @code{Update()} when you want to update the image. This way is also usefult for Fortran users. +@verbatim +//----------------------------------------------------------------------------- +#include +//----------------------------------------------------------------------------- +int sample(mglGraph *gr) +{ + gr->Box(); gr->Line(mglPoint(),pnt,"Ar2"); // just draw a vector + return 0; +} +//----------------------------------------------------------------------------- +void *mgl_fltk_tmp(void *) { mglFlRun(); return 0; } +int main (int argc, char ** argv) +{ + mglWindow gr(0,NULL,"test"); // create window + for(int i=0;i<10;i++) // do calculation + { + sleep(1); // which can be very long + pnt = mglPoint(2*mgl_rnd()-1,2*mgl_rnd()-1); + sample(&gr); // draw picture + gr.Update(); // update window + } + return 0; // finish calculations and close the window +} +//----------------------------------------------------------------------------- +@end verbatim @item How many people write this library? @@ -212,207 +238,256 @@ Most of the library was written by one person. This is a result of nearly a year You can import data into a @code{mglData} instance and display it by @code{Dens()} function. For example, for black-and-white bitmap you can use the code: @code{mglData bmp; bmp.Import("fname.png","wk"); gr->Dens(bmp,"wk");}. @item How can I use MathGL in Qt, FLTK, wxWidgets etc.? -There are special classes (widgets) for these libraries: QMathGL for Qt, Fl_MathGL for FLTK and so on. If you don’t find the appropriate class then you can create your own widget that displays a bitmap using mglGraphAB::GetBits(). +There are special classes (widgets) for these libraries: QMathGL for Qt, Fl_MathGL for FLTK and so on. If you don't find the appropriate class then you can create your own widget that displays a bitmap using mglCanvas::GetBits(). @item How can I create U3D file (make 3D in PDF)? There are 2 steps: first you should create IDTF file, and later convert it to U3D. You can use @uref{http://sourceforge.net/project/showfiles.php?group_id=152187&package_id=300628, U3D tools} for converting IDTF file to U3D. It needs @uref{http://libharu.org, libharu} 2.1.0 or later. For installation use @code{./bootstrap, ./configure, make, sudo make install}. It provides IDTFConverter program for converting text files *.idtf to binary files *.u3d. The latter can be included into PDF. @item How I can change the font family? -First, you should download new font files from @uref{http://mathgl.sourceforge.net/download.html, here} or from @uref{http://sourceforge.net/project/showfiles.php?group_id=152187&package_id=267177, here}. Next, you should load the font files into mglGraph class instance @var{gr} by the following command: @code{gr->SetFont(new mglFont(fontname,path));}. Here @var{fontname} is the base font name like @samp{STIX} and @var{path} sets the location of font files. Use @code{gr->SetFont(NULL);} to start using the default font. +First, you should download new font files from @uref{http://mathgl.sourceforge.net/download.html, here} or from @uref{http://sourceforge.net/project/showfiles.php?group_id=152187&package_id=267177, here}. Next, you should load the font files into mglGraph class instance @var{gr} by the following command: @code{gr->LoadFont(fontname,path);}. Here @var{fontname} is the base font name like @samp{STIX} and @var{path} sets the location of font files. Use @code{gr->RestoreFont();} to start using the default font. @item How can I draw tick out of a bounding box? -Just set a negative value for @var{TickLen}. For example, use @code{gr->SetTickLen(-0.1);}. +Just set a negative value in @var{SetTickLen}. For example, use @code{gr->SetTickLen(-0.1);}. @end table -@node Interfaces, Thanks, FAQ, Overview +@node Interfaces, Utilities, FAQ, Overview @section Interfaces The MathGL library has interfaces for a set of languages. Most of them are based on the C interface via SWIG tool. There are Python, Java, Octave, Lisp, C#, Guile, Lua, Modula 3, Ocaml, Perl, PHP, Pike, R, Ruby, and Tcl interfaces. Also there is a Fortran interface which has a similar set of functions, but slightly different types of arguments (integers instead of pointers). These functions are marked as [C function]. @c ++++++++++ -Some of the languages listed above support classes (like Python). For them, a special wrapper was written. These classes and functions are marked as (Python). +Some of the languages listed above support classes (like C++ or Python). For them, a special wrapper was written. @c ++++++++++ -Finally, a special command language MGL was written for a faster access to C++ plotting functions. Corresponding scripts can be executed separately (by UDAV, mgl2png, mgl2eps and so on) or from the C++ code (@pxref{mglParse class}). These commands are described in @ref{MGL interface}. +Finally, a special command language MGL was written for a faster access to plotting functions. Corresponding scripts can be executed separately (by UDAV, mgl2png, mgl2eps and so on) +@ifclear UDAV + or from the C/C++/Python/... code (@pxref{mglParse class}). +@end ifclear +@ifclear UDAV @menu * C interface:: * Python interface:: +* MGL interface:: @end menu @node C interface, Python interface, , Interfaces -@subsection C interface +@subsection C/Fortran interface 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: @itemize -@item +@item @code{HMGL} --- Pointer to class @code{mglGraph} (@pxref{MathGL core}). -@item -@code{HMDT} --- Pointer to class @code{mglData} (@pxref{mglData class}). -@item -@code{HMPR} --- Pointer to class @code{mglParse} (@pxref{mglParse class}).. +@item +@code{HMDT} --- Pointer to class @code{mglData} (@pxref{Data processing}). +@item +@code{HMPR} --- Pointer to class @code{mglParse} (@pxref{mglParse class}). @end itemize -These variables contain identifiers for graphics drawing objects and for the data objects. +These variables contain identifiers for graphics drawing objects and for the data objects. -Fortran functions/subroutines have the same names as C functions. However, there is a difference. Variable of type @code{HMGL, HMDT} must be an integer with sufficient size (@code{integer*4} in the 32-bit operating system or @code{integer*8} in the 64-bit operating system). All C functions are subroutines in Fortran, which are called by operator @code{call}. The exceptions are functions, which return variables of types @code{HMGL} or @code{HMDT}. These functions should be declared as integer in Fortran code. Also, one should keep in mind that strings in Fortran are denoted by @code{’} symbol, not the @code{"} symbol. +Fortran functions/subroutines have the same names as C functions. However, there is a difference. Variable of type @code{HMGL, HMDT} must be an integer with sufficient size (@code{integer*4} in the 32-bit operating system or @code{integer*8} in the 64-bit operating system). All C functions are subroutines in Fortran, which are called by operator @code{call}. The exceptions are functions, which return variables of types @code{HMGL} or @code{HMDT}. These functions should be declared as integer in Fortran code. Also, one should keep in mind that strings in Fortran are denoted by @code{'} symbol, not the @code{"} symbol. -@strong{Create and delete objects} +@node Python interface, MGL interface, C interface, Interfaces +@subsection C++/Python interface +MathGL provides the interface to a set of languages via SWIG library. Some of these languages support classes. The typical example is Python -- which is named in this chapter's title. Exactly the same classes are used for high-level C++ API. Its feature is using only inline member-functions what make high-level API to be independent on compiler even for binary build. + +There are 2 classes in: @itemize -@item Functions for non-visual ``grapher'' creation: -@deftypefn {C function} @code{HMGL} mgl_create_graph_gl () -Create the instance of class mglGraphGL. +@item @code{mglGraph} +-- provide most plotting functions (@pxref{MathGL core}). +@item @code{mglData} +-- provide base data processing (@pxref{Data processing}). It have an additional feature to access data values. You can use a construct like this: @code{dat[i]=sth;} or @code{sth=dat[i]} where flat representation of data is used (i.e., @var{i} can be in range 0...nx*nx*nz-1). You can also import NumPy arrays as input arguments in Python: @code{mgl_dat = mglData(numpy_dat);}. +@c @item @code{mglParse} -- practically the same as C++ class @code{MathGL provides the interface to a set of languages via SWIG library. Some of these languages support classes. The typical example is Python -- which is denoted in the chapter title. +@end itemize + + +To use Python classes just execute @samp{import mathgl}. The simplest example will be: +@verbatim +import mathgl +a=mathgl.mglGraph() +a.Box() +a.WritePNG("test.png") +@end verbatim +Alternatively you can import all classes from @code{mathgl} module and easily access MathGL classes like this: +@verbatim +from mathgl import * +a=mglGraph() +a.Box() +a.WritePNG("test.png") +@end verbatim +This becomes useful if you create many @code{mglData} objects, for example. + + +@node MGL interface, , Python interface, Interfaces +@end ifclear +@subsection MGL interface + +MathGL library supports the simplest scripts for data handling and plotting. These scripts can be used independently (with the help of UDAV, mglconv, mglview programs and others, @pxref{Utilities}) or in the frame of the library using. + +MGL script language is rather simple. Each string is a command. First word of string is the name of command. Other words are command arguments. Command may have up to 1000 arguments (at least for now). Words are separated from each other by space or tabulation symbol. The upper or lower case of words is sufficient, i.e. variables @var{a} and @var{A} are different variables. Symbol @samp{#} starts the comment (all characters after # will be ignored). The exception is situation when @samp{#} is a part of some string. Also options can be specified after symbol @samp{;} (@pxref{Command options}). Symbol @samp{:} starts new command (like new line character) if it is not placed inside a string or inside brackets. + +If string contain references to external parameters (substrings @samp{$0}, @samp{$1} ... @samp{$9}) or definitions (substrings @samp{$a}, @samp{$b} ... @samp{$z}) then before execution the values of parameter/definition will be substituted instead of reference. It allows to use the same MGL script for different parameters (filenames, paths, condition and so on). + +Argument can be a string, a variable name or a number. +@itemize @bullet +@item +The string is any symbols between ordinary marks @samp{'}. + +@item +Usually variable have a name which is arbitrary combination of symbols (except spaces and @samp{'}) started from a letter and with length less than 64. A temporary array can be used as variable: +@itemize @bullet +@item +sub-arrays (like in @ref{subdata} command) as command argument. For example, @code{a(1)} or @code{a(1,:)} or @code{a(1,:,:)} is second row, @code{a(:,2)} or @code{a(:,2,:)} is third column, @code{a(:,:,0)} is first slice and so on. Also you can extract a part of array from m-th to n-th element by code @code{a(m:n,:,:)} or just @code{a(m:n)}. + +@item +any column combinations defined by formulas, like @code{a('n*w^2/exp(t)')} if names for data columns was specified (by @ref{idset} command or in the file at string started with @code{##}). + +@item +any expression (without spaces) of existed variables produce temporary variable. For example, @samp{sqrt(dat(:,5)+1)} will produce temporary variable with data values equal to @code{tmp[i,j] = sqrt(dat[i,5,j]+1)}. + +@item +temporary variable of higher dimensions by help of []. For example, @samp{[1,2,3]} will produce a temporary vector of 3 elements @{1, 2, 3@}; @samp{[[11,12],[21,22]]} will produce matrix 2*2 and so on. Here you can join even an arrays of the same dimensions by construction like @samp{[v1,v2,...,vn]}. + +@item +result of code for making new data (@pxref{Make another data}) inside @{@}. For example, @samp{@{sum dat 'x'@}} produce temporary variable which contain result of summation of @var{dat} along direction 'x'. This is the same array @var{tmp} as produced by command @samp{sum tmp dat 'x'}. You can use nested constructions, like @samp{@{sum @{max dat 'z'@} 'x'@}}. +@end itemize +Temporary variables can not be used as 1st argument for commands which create (return) the data (like @samp{new}, @samp{read}, @samp{hist} and so on). + +@item +Special names @code{nan=#QNAN, pi=3.1415926..., on=1, off=0, :=-1} are treated as number if they were not redefined by user. Variables with suffixes are treated as numbers (@pxref{Data information}). Names defined by @ref{define} command are treated as number. Also results of formulas with sizes 1x1x1 are treated as number (for example, @samp{pi/dat.nx}). +@end itemize +Before the first using all variables must be defined with the help of commands, like, @ref{new}, @ref{var}, @ref{list}, @ref{copy}, @ref{read}, @ref{hist}, @ref{sum} and so on (see sections @ref{Data constructor}, @ref{Data filling} and @ref{Make another data}). + +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{plot ydat ['stl'='' zval=nan]}. 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{plot ydat '' 1} or @code{plot ydat ''} is correct, but @code{plot ydat 1} is incorrect (argument @code{'stl'} is missed). + +Below I show commands to control program flow, like, conditions, cycles, define script arguments and so on. Other commands can be found in chapters @ref{MathGL core} and @ref{Data processing}. + +@cindex chdir +@anchor{chdir} +@deftypefn {MGL command} {} chdir 'path' +Changes the current directory to @var{path}. @end deftypefn -@deftypefn {C function} @code{HMGL} mgl_create_graph_zb (@code{int} width, @code{int} height) -Create the instance of class mglGraphZB with specified sizes. + +@cindex define +@anchor{define} +@deftypefn {MGL command} {} define $N smth +Sets @var{N}-th script argument to @var{smth}. Note, that @var{smth} is used as is (with @samp{'} symbols if present). Here @var{N} is digit (0...9) or alpha (a...z). @end deftypefn -@deftypefn {C function} @code{HMGL} mgl_create_graph_ps (@code{int} width, @code{int} height) -Create the instance of class mglGraphPS with specified sizes. +@deftypefn {MGL command} {} define name smth +Create scalar variable @code{name} which have the numeric value of @code{smth}. Later you can use this variable as usual number. Here @var{N} is digit (0...9) or alpha (a...z). @end deftypefn -@deftypefn {C function} @code{HMGL} mgl_create_graph_idtf () -Create the instance of class mglGraphIDTF. +@cindex defchr +@anchor{defchr} +@deftypefn {MGL command} {} defchr $N smth +Sets @var{N}-th script argument to character with value evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z). @end deftypefn - -@item Function for windowed ``grapher'' creation: -@deftypefn {C function} @code{HMGL} mgl_create_graph_glut (@code{int (*}draw@code{)(HMGL gr, void *p)}, @code{const char *}title, @code{void *}par) -Create the instance of class mglGraphGLUT and the connected GLUT window. Only one GLUT window can be opened at once. Argument description can be found in @ref{mglGraphAB class}. +@cindex defnum +@anchor{defnum} +@deftypefn {MGL command} {} defnum $N smth +Sets @var{N}-th script argument to number with value evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z). @end deftypefn -@deftypefn {C function} @code{HMGL} mgl_create_graph_fltk (@code{int (*}draw@code{)(HMGL gr, void *p)}, @code{const char *}title, @code{void *}par) -Create the instance of class mglGraphFLTK and the connected FLTK window. Several windows can be opened at the same time. However user must call @code{mgl_fltk_run()} function to start the message handling cycle. Argument description can be found in @ref{mglGraphAB class}. Note that @var{draw} can be @code{NULL} for displaying static bitmaps only (no animation or slides). +@cindex defpal +@anchor{defpal} +@deftypefn {MGL command} {} defpal $N smth +Sets @var{N}-th script argument to palette character at position evaluated from @var{smth}. Here @var{N} is digit (0...9) or alpha (a...z). @end deftypefn -@deftypefn {C function} @code{HMGL} mgl_create_graph_qt (@code{int (*}draw@code{)(HMGL gr, void *p)}, @code{const char *}title, @code{void *}par) -Create the instance of class mglGraphQT and the connected Qt window. Several windows can be opened at the same time. However user must call @code{mgl_qt_run()} function to start the message handling cycle. Arguments description can be found in @ref{mglGraphAB class}. Note, that @var{draw} can be @code{NULL} for displaying static bitmaps only (no animation or slides). + +@cindex call +@anchor{call} +@deftypefn {MGL command} {} call 'fname' [ARG1 ARG2 ... ARG9] +Executes function @var{fname} (or script if function is not found). Optional arguments will be passed to functions. See also @ref{func}. @end deftypefn -@deftypefn {C function} @code{void} mgl_fltk_run () -Start FLTK message handling cycle. A normal program will end main() function with @code{return mgl_fltk_run();}. +@cindex func +@anchor{func} +@deftypefn {MGL command} {} func 'fname' [narg=0] +Define the function @var{fname} and number of required arguments. The arguments will be placed in script parameters $1, $2, ... $9. Note, you should stop script execution before function definition(s) by command @ref{stop}. See also @ref{return}. @end deftypefn -@deftypefn {C function} @code{void} mgl_fltk_thread () -Start FLTK message handling cycle. In distinction to @code{mgl_fltk_run()} the loop is started in a separate thread, so that program continues immediately. +@cindex return +@anchor{return} +@deftypefn {MGL command} {} return +Return from the function. See also @ref{func}. @end deftypefn -@deftypefn {C function} @code{void} mgl_qt_run () -Start Qt message handling cycle. A normal program will end main() function with @code{return mgl_qt_run();}. Alternatively, the user may setup Qt application by direct Qt function calls. + + +@cindex if +@anchor{if} +@deftypefn {MGL command} {} if dat 'cond' +Starts block which will be executed if @var{dat} satisfy to @var{cond}. @end deftypefn -@deftypefn {C function} @code{void} mgl_qt_thread () -Start Qt message handling cycle. In distinction to @code{mgl_qt_run()} the loop is started in separate thread so that the program continues immediately. +@deftypefn {MGL command} {} if @code{val} +Starts block which will be executed if @code{val} is nonzero. @end deftypefn -@deftypefn {C function} @code{void} mgl_update (@code{HMGL} graph) -Manually update contents of the window. +@cindex elseif +@anchor{elseif} +@deftypefn {MGL command} {} elseif dat 'cond' +Starts block which will be executed if previous @code{if} or @code{elseif} is false and @var{dat} satisfy to @var{cond}. @end deftypefn - -@deftypefn {C function} @code{void} mgl_set_show_mouse_pos (@code{HMGL} graph, @code{int} enable) -Switch to show or not in the widget the last mouse click position. +@deftypefn {MGL command} {} elseif @code{val} +Starts block which will be executed if previous @code{if} or @code{elseif} is false and @code{val} is nonzero. @end deftypefn -@deftypefn {C function} @code{void} mgl_get_last_mouse_pos (@code{HMGL} graph, @code{float *}x, @code{float *}y, @code{float *}z) -Last position of mouse click. +@cindex else +@anchor{else} +@deftypefn {MGL command} {} else +Starts block which will be executed if previous @code{if} or @code{elseif} is false. @end deftypefn -@deftypefn {C function} @code{void} mgl_calc_xyz (@code{HMGL} graph, @code{int} xs, @code{int} ys, @code{float *}x, @code{float *}y, @code{float *}z) -Calculate 3D coordinate @{x,y,z@} for screen point @{xs,ys@}. At this moment, it ignores perspective and transformation formulas (curvilinear coordinates). The calculations are done for the last used InPlot (@pxref{Transformation matrix}). +@cindex endif +@anchor{endif} +@deftypefn {MGL command} {} endif +Finishes @code{if/elseif/else} block. @end deftypefn - -@item Functions for data creation: -@deftypefn {C function} @code{HMDT} mgl_create_data () -Create a simple instance of class mglData. +@cindex for +@anchor{for} +@deftypefn {MGL command} {} for $N @code{v1 v2 [dv=1]} +Starts cycle with $@var{N}-th argument changing from @var{v1} to @var{v2} with the step @var{dv}. Here @var{N} is digit (0...9) or alpha (a...z). @end deftypefn -@deftypefn {C function} @code{HMDT} mgl_create_data_size (@code{int} nx, @code{int} ny, @code{int} nz) -Create an instance of class mglData with specified sizes. +@deftypefn {MGL command} {} for $N dat +Starts cycle with $@var{N}-th argument changing for @var{dat} values. Here @var{N} is digit (0...9) or alpha (a...z). @end deftypefn -@deftypefn {C function} @code{HMDT} mgl_create_data_file (@code{const char *}fname) -Create an instance of class mglData and fill it by data from text file. +@cindex next +@anchor{next} +@deftypefn {MGL command} {} next +Finishes @code{for} cycle. @end deftypefn -@item Each created object @strong{must} be deleted after usage by functions: -@deftypefn {C function} @code{void} mgl_delete_graph (@code{HMGL} graph) -Delete the instance of a class. Must be used after plotting for every created graphical object. +@cindex once +@anchor{once} +@deftypefn {MGL command} {} once @code{val} +The code between @code{once on} and @code{once off} will be executed only once. Useful for large data manipulation in programs like UDAV. @end deftypefn -@deftypefn {C function} @code{void} mgl_delete_data (@code{HMDT} dat) -Delete the instance of a class. Must be used after the use of every created data object. +@cindex stop +@anchor{stop} +@deftypefn {MGL command} {} stop +Terminate execution. @end deftypefn -@end itemize -@node Python interface, , C interface, Interfaces -@subsection Python interface +@c ------------------------------------------------------------------ +@node Utilities, Thanks, Interfaces, Overview +@section Utilities for parsing MGL -MathGL provides the interface to a set of languages via SWIG library. Some of these languages support classes. The typical example is Python -- which is named in this chapter’s title. +MathGL library provides several tools for parsing MGL scripts. There is tools saving it to bitmap or vectorial images (@code{mgl2conv}). Tool @code{mglview} show MGL script and allow to rotate and setup the image. Also you can translate MGL script to C++ file by help of @code{mgl2cpp} tool. -To use Python classes just execute @samp{import mathgl}. The simplest example will be: -@verbatim -import mathgl -a=mathgl.mglGraph() -a.Box() -a.WritePNG(’test.png’) -@end verbatim -Alternatively you can import all classes from @code{mathgl} module and easily access MathGL classes like this: -@verbatim -from mathgl import * -a=mglGraph() -a.Box() -a.WritePNG(’test.png’) -@end verbatim -This becomes useful if you create many @code{mglData} objects, for example. - -There are 2 classes in Python interface: -@itemize -@item @code{mglGraph} --- provide practically the same functionality as C++ class @code{mglGraph} (@pxref{MathGL core}). But it is not an abstract class and it allows one to select at construction stage which plotter (ZB or PS and so on) will be used. -@item @code{mglData} --- is exactly the same class as C++ @code{mglData} (@pxref{mglData class}), but an additional feature to access data values is added. You can use a construct like this: @code{dat[i]=sth;} or @code{sth=dat[i]} where flat representation of data is used (i.e., @var{i} can be in range 0...nx*nx*nz-1). You can also import NumPy arrays as input arguments: @code{mgl_dat = mglData(numpy_dat);}. -@c @item @code{mglParse} -- practically the same as C++ class @code{MathGL provides the interface to a set of languages via SWIG library. Some of these languages support classes. The typical example is Python -- which is denoted in the chapter title. - -To use Python classes just execute @samp{import mathgl}. The simplest example will be: -@verbatim -import mathgl -a=mathgl.mglGraph() -a.Box() -a.WritePNG(’test.png’) -@end verbatim -Alternatively, you can import all the classes from @code{mathgl} module and easily access MathGL classes: -@verbatim -from mathgl import * -a=mglGraph() -a.Box() -a.WritePNG(’test.png’) -@end verbatim -This is useful if you create many @code{mglData} objects, for example. - -There are 2 classes in Python interface: -@itemize -@item @code{mglGraph} --- provide practically the same functionality as C++ class @code{mglGraph} (@pxref{MathGL core}). But it is not an abstract class and it allows one to select at the construction stage which plotter (ZB or PS and so on) will be used. -@item @code{mglData} --- is exactly the same class as C++ @code{mglData} (@pxref{mglData class}), but an additional feature to access data values is added. You can use a construct like this: @code{dat[i]=sth;} or @code{sth=dat[i]} where flat representation of data is used (i.e., @var{i} can be in range 0...nx*nx*nz-1). -@c @item @code{mglParse} -- practically the same as C++ class @code{mglParse} (@pxref{mglParse class}). -@end itemize - -There is one main difference from C++ classes -- Python class @code{mglGraph} does not have variables (options). All the corresponding features are moved to methods. -The core of MathGL Python class is the @strong{mglGraph} class. It contains a lot of plotting functions for 1D, 2D and 3D plots. So most of the sections describe its methods. Its constructor has the following arguments: - -@defop Constructor {mglGraph (Python)} @code{} mglGraph (@code{int} kind=@code{0}, @code{int} width=@code{600}, @code{int} height=@code{400}) -Create the instance of class mglGraph with specified sizes @var{width} and @var{height}. Parameter @var{type} may have following values: @samp{0} -- use @code{mglGraphZB} plotter (default), @samp{1} -- use @code{mglGraphPS} plotter, @samp{2} -- use @code{mglGraphGL} plotter, @samp{3} -- use @code{mglGraphIDTF} plotter. -@end defop -@end itemize +All of this tools have similar set of arguments. First argument is name of script file, next argument is optional output file name, last arguments are options. There are options for setting script parameters (it is @code{$0, $1, ... $9}) and locale settings. The script parameters have format @samp{-Nval}. Here N=0,1...9 is parameter ID and val is its value. For example, option @samp{-1test} set to substitute @samp{test} instead of @code{$1} in the script. Option -Lval set locale to val. For example, @samp{-Lutf8} will set UTF-8 locale for script. -There is one difference from C++ classes -- Python class @code{mglGraph} does not have variables (options). All the corresponding features are moved to methods. -The core of MathGL Python class is the @strong{mglGraph} class. It contains a lot of plotting functions for 1D, 2D and 3D plots. So most of the sections describe its methods. Its constructor has the following arguments: +Both tools expect stdin input if script file is not specified. This allows to use Linux pipes to send script and produce plot. -@defop Constructor {mglGraph (Python)} @code{} mglGraph (@code{int} kind=@code{0}, @code{int} width=@code{600}, @code{int} height=@code{400}) -Create the instance of class mglGraph with specified sizes @var{width} and @var{height}. Parameter @var{type} may have following values: @samp{0} -- use @code{mglGraphZB} plotter (default), @samp{1} -- use @code{mglGraphPS} plotter, @samp{2} -- use @code{mglGraphGL} plotter, @samp{3} -- use @code{mglGraphIDTF} plotter. -@end defop +Additionally you can create animated GIF file or a set of JPEG files with names @samp{frameNNNN.jpg} (here @samp{NNNN} is frame index). You should use @code{mgl2gif} tool and specify the values of @code{$0} parameter for making animation. Values of the parameter @code{$0} can be specified inside the script by comment @code{##a val} for each value @code{val} (one comment for one value) or by option(s) @samp{-Aval}. Also you can specify a cycle for animation by comment @code{##c v1 v2 dv} or by option @code{-Cn1:n2}. Tool @code{mgl2gif} will execute script several times (once for each specified value of @code{$0}) and save result in animated GIF file. For saving each frame in JPEG just add command @code{write ''} at the end of the script. -@node Thanks, , Interfaces, Overview +@node Thanks, , Utilities, Overview @section Thanks @itemize @bullet @item My special thanks to Marina Balakina for the patience during the writing of this library and for the help in documentation writing and spelling. @item -I’m thankful to D. Kulagin and S.M. Plis for making Debian packages. +I'm thankful to D. Kulagin and S.M. Plis for making Debian packages. @item -I’m thankful to M. Vidassov for the help in handling solid UTF-8 fonts. +I'm thankful to M. Vidassov for the help in handling solid UTF-8 fonts. @item -I’m thankful to N. Troickiy and V. Lipatov for making RPM packages. +I'm thankful to N. Troickiy and V. Lipatov for making RPM packages. @item -I’m thankful to S. Skobelev, A. Korotkevich, V. Onuchin, S.M. Plis, R. Kiselev, A. Ivanov, M. Vidiassov and V. Lipatov for fruitful comments. +I'm thankful to S. Skobelev, A. Korotkevich, V. Onuchin, S.M. Plis, R. Kiselev, A. Ivanov, M. Vidiassov and V. Lipatov for fruitful comments. @end itemize diff --git a/texinfo/overview_ru.texi b/texinfo/overview_ru.texi index 31c4652..5fb890b 100644 --- a/texinfo/overview_ru.texi +++ b/texinfo/overview_ru.texi @@ -16,7 +16,7 @@ MathGL это ... @end itemize @menu -* Why I have written MathGL?:: +* Why I have written MathGL?:: * MathGL features:: * Installation and usage:: * General concepts:: @@ -30,7 +30,7 @@ MathGL это ... Код для создания качественной научной графики на различных платформах. Код для быстрой обработки и отображения больших массивов данных. Код для работы в графическом и консольном режимах и легкого интегрирования в другие программы. Код с большим обновляемым набором графиков и инструментами обработки данных. Именно такого кода мне не хватало в последние годы при работе на персональных компьютерах и на кластерах. И именно такой код я постарался создать в библиотеке MathGL. -На данный момент (версия @value{VERSION}) MathGL это более 20000 строк кода, более 40 основных типов графиков для одно-, двух- и трехмерных массивов, возможность экспорта в растровые и векторные (EPS или SVG) файлы, интерфейс для OpenGL и возможность запуска в консольном режиме, функции для обработки данных и даже простейший командный (интерпретируемый) язык MGL для упрощения построения графиков. Кроме того, есть несколько типов прозрачности, гладкое освещение, векторные шрифты, TeX-ие команды в надписях, произвольные криволинейные системы координат и прочие полезные мелочи (см. раздел pictures на @uref{http://mathgl.sf.net/, домашней странице}). Ну, и, естественно, полная переносимость библиотеки и ее свободное распространение под лицензией GPL v.2.0 или более поздней. +На данный момент (версия @value{VERSION}) MathGL это более 50 основных типов графиков для одно-, двух- и трехмерных массивов, возможность экспорта в растровые и векторные (EPS или SVG) файлы, интерфейс для OpenGL и возможность запуска в консольном режиме, функции для обработки данных и даже простейший командный (интерпретируемый) язык MGL для упрощения построения графиков. Кроме того, есть несколько типов прозрачности, гладкое освещение, векторные шрифты, TeX-ие команды в надписях, произвольные криволинейные системы координат и прочие полезные мелочи (см. раздел pictures на @uref{http://mathgl.sf.net/, домашней странице}). Ну, и, естественно, полная переносимость библиотеки и ее свободное распространение под лицензией GPL v.2.0 или более поздней. @node MathGL features, Installation and usage, Why I have written MathGL?, Overview @section Возможности MathGL @@ -47,7 +47,7 @@ MathGL это ... рисование трехмерных массивов (Surf3, Dens3, Cont3, ContF3, Cloud-like, @pxref{3D plotting}); @item -рисование нескольких связанных массивов: векторные поля Vect и VectC, линии тока Flow, точечное отображение Map, поверхности с прозрачностью или цветом, определяемым другим массивом SurfA, SurfC, Surf3A, Surf3C (@pxref{Dual plotting}); +рисование нескольких связанных массивов: векторные поля Vect, линии тока Flow, точечное отображение Map, поверхности с прозрачностью или цветом, определяемым другим массивом SurfA, SurfC, Surf3A, Surf3C (@pxref{Dual plotting}); @item и другие (см. @pxref{MathGL core}). @@ -55,13 +55,13 @@ MathGL это ... Фактически, я постарался реализовать все известные мне типы научных графиков. Список графиков постоянно пополняется, и если Вам нужен какой-то новый вариант, пишите на @email{mathgl.abalakin@@gmail.com, e-mail}, и в новой версии библиотеки этот график появится. -Я постарался сделать графики максимально красивыми -- поверхности могут быть прозрачными и освещены произвольно расположенными источниками света (максимальное их количество 10). Большинство функций рисования имеет два варианта: простой для быстрого построения картинки и более сложный для детальной настройки отображения, включающего в том числе возможность параметрического задания всех массивов. Получившееся изображение можно сохранить в растровом (с помощью классов mglGraphZB, mglGraphGL) формате PNG, JPEG, GIF, TIFF или BMP; в векторном EPS или SVG формате (с помощью класса mglGraphPS) и в IDTF формате (с помощью класса mglGraphIDTF), который можно конвертировать в U3D формат. +Я постарался сделать графики максимально красивыми -- поверхности могут быть прозрачными и освещены произвольно расположенными источниками света (максимальное их количество 10). Большинство функций рисования имеет два варианта: простой для быстрого построения картинки и более сложный для детальной настройки отображения, включающего в том числе возможность параметрического задания всех массивов. Получившееся изображение можно сохранить в растровом формате PNG, JPEG, GIF, TGA или BMP; в векторном EPS, SVG или TeX формате, и в IDTF формате (с помощью класса mglGraphIDTF), который можно конвертировать в U3D формат. -Все надписи выводятся векторным шрифтом, что обеспечивает их хорошую масштабируемость и переносимость. Текст может содержать команды для большинства ТеХ-их символов, изменения положения (верхний и нижний индексы) и стиля шрифта внутри строки текста (@pxref{mglFont class}). Текст меток поворачивается вместе с осями. На график можно вывести описание кривых (легенду) и поместить надпись в произвольную точку экрана или пустить ее вдоль кривой. Поддерживаются произвольные кодировки текста (с помощью стандартной функции @code{setlocale()}) и текст в кодировке UTF-16. +Все надписи выводятся векторным шрифтом, что обеспечивает их хорошую масштабируемость и переносимость. Текст может содержать команды для большинства ТеХ-их символов, изменения положения (верхний и нижний индексы) и стиля шрифта внутри строки текста (@pxref{Font styles}). Текст меток поворачивается вместе с осями. На график можно вывести описание кривых (легенду) и поместить надпись в произвольную точку экрана или пустить ее вдоль кривой. Поддерживаются произвольные кодировки текста (с помощью стандартной функции @code{setlocale()}) и текст в кодировке UTF-16. -Для представления данных используется специальный класс mglData (@pxref{mglData class}). Помимо безопасного создания и удаления массивов, он включает функции по их обработке (дифференцированию, интегрированию, сглаживанию, интерполяции и т.д.) и чтению текстового файла с автоматическим определением размеров данных. Класс mglData позволяет работать с массивами размерности вплоть до 3 (массивы, зависящие от трех независимых индексов @math{a_@{ijk@}}). Использование массивов с большим числом размерностей нецелесообразно, поскольку я не представляю, как их можно отобразить на экране. Заполнение или изменение значений массива можно выполнить как вручную, так и по формуле, заданной текстовой строкой. +Для представления данных используется специальный класс mglData (@pxref{Data processing}). Помимо безопасного создания и удаления массивов, он включает функции по их обработке (дифференцированию, интегрированию, сглаживанию, интерполяции и т.д.) и чтению текстового файла с автоматическим определением размеров данных. Класс mglData позволяет работать с массивами размерности вплоть до 3 (массивы, зависящие от трех независимых индексов @math{a_@{ijk@}}). Использование массивов с большим числом размерностей нецелесообразно, поскольку я не представляю, как их можно отобразить на экране. Заполнение или изменение значений массива можно выполнить как вручную, так и по формуле, заданной текстовой строкой. -Для @emph{быстрого} вычисления значения выражения, заданного текстовой строкой, используется класс mglFormula (@pxref{mglFormula class}). Он основан на компиляции строки в древоподобную структуру при создании экземпляра класса. На этапе вычисления происходит быстрый обход дерева с выдачей результата для конкретных значений переменных. Помимо изменения значений массива данных, текстовые формулы используются для рисования в @emph{произвольной} криволинейной системе координат. Набор таких координат ограничивается только фантазией пользователя, а не фиксированным числом (типа полярной, параболической, цилиндрической и т.д.). +Для @emph{быстрого} вычисления значения выражения, заданного текстовой строкой (@pxref{Textual formulas}). Он основан на компиляции строки в древоподобную структуру при создании экземпляра класса. На этапе вычисления происходит быстрый обход дерева с выдачей результата для конкретных значений переменных. Помимо изменения значений массива данных, текстовые формулы используются для рисования в @emph{произвольной} криволинейной системе координат. Набор таких координат ограничивается только фантазией пользователя, а не фиксированным числом (типа полярной, параболической, цилиндрической и т.д.). @node Installation and usage, General concepts, MathGL features, Overview @section Установка MathGL @@ -69,17 +69,17 @@ MathGL это ... Установка библиотеки возможна 4-мя способами. @enumerate @item -Скомпилировать библиотеку непосредственно из исходных файлов. С библиотекой поставляется стандартный скрипт для autoconf/automake. Для его запуска достаточно в командной строке выполнить 3 команды: сначала @code{./configure} далее @code{make} и, наконец, с правами суперпользователя @code{make install}. Иногда после компиляции библиотеки может потребоваться обновление списка библиотека в системе -- выполните команду @code{ldconfig} с правами суперпользователя. +Скомпилировать библиотеку непосредственно из исходных файлов. С библиотекой поставляется стандартный скрипт для autoconf/automake. Для его запуска достаточно в командной строке выполнить 3 команды: сначала @code{./configure} далее @code{make} и, наконец, с правами суперпользователя @code{make install}. Иногда после компиляции библиотеки может потребоваться обновление списка библиотека в системе -- выполните команду @code{ldconfig} с правами суперпользователя. Замечу, что если используется версия из SVN, то вначале (перед @code{./configure}) следует выполнить команду @code{./bootstrap}. -Скрипт @code{./configure} имеет несколько дополнительных опций, которые по умолчанию отключены. К их числу относятся: @code{--enable-fltk, --enable-glut, --enable-qt} для поддержки FLTK, GLUT и/или Qt окон; @code{--enable-jpeg, --enable-tiff, --enable-hdf5} для поддержки соответствующих форматов; @code{--enable-all} для включения всех возможностей. Для использования типа @code{double} для внутреннего хранения данных используйте опцию @code{--enable-double}. Для создания интерфейсов к другим языкам (кроме С/Фортран/MGL) используйте опции @code{--enable-python, --enable-octave} или @code{--enable-langall} для всех поддерживаемых языков. Полный список опций можно увидеть, выполнив @code{./configure --help}. +Скрипт @code{./configure} имеет несколько дополнительных опций, которые по умолчанию отключены. К их числу относятся: @code{--enable-fltk, --enable-glut, --enable-qt} для поддержки FLTK, GLUT и/или Qt окон; @code{--enable-jpeg, --enable-gif, --enable-hdf5} для поддержки соответствующих форматов; @code{--enable-all} для включения всех возможностей. Для использования типа @code{double} для внутреннего хранения данных используйте опцию @code{--enable-double}. Для создания интерфейсов к другим языкам (кроме С/Фортран/MGL) используйте опции @code{--enable-python, --enable-octave} или @code{--enable-langall} для всех поддерживаемых языков. Полный список опций можно увидеть, выполнив @code{./configure --help}. @item -В случае если инструменты autoconf/automake не доступны (например, при компиляции под Windows или MacOS), то можно воспользоваться системой сборки cmake. В данном случае будет недоступна сборка документации, но сборка самой библиотеки и утилит возможна и не на GNU компиляторах. +В случае если инструменты autoconf/automake не доступны (например, при компиляции под Windows или MacOS), то можно воспользоваться системой сборки CMake. В данном случае сборка самой библиотеки и утилит возможна и не на GNU компиляторах. @item Использовать предварительно скомпилированные файлы -- с библиотекой поставляются файлы для MinGW (платформа Win32). В скомпилированной версии достаточно распаковать заголовочные файлы в папку с заголовочными файлами и библиотеку libmgl.a в папку с библиотеками. По умолчанию, скомпилированная версия включают поддержку GSL (www.gsl.org), PNG, GIF и JPEG. Соответственно, при сборке программы эти библиотеки должны быть установлены (их можно найти на @uref{http://gnuwin32.sourceforge.net/packages.html}). @item -Установить из стандартных пакетов (RPM, deb, DevPak и пр.). +Установить из стандартных пакетов (RPM, deb, DevPak и пр.). @end enumerate При сборке пользовательской программы достаточно указать ключ @code{-lmgl} для компиляции в консольной программе или с использованием внешней графической библиотеки. При использовании окон FLTK или GLUT надо указать/добавить ключи, включающие соответствующие библиотеки -- @code{-lmgl-fltk} или @code{-lmgl-glut}. Для использования в Фортране дополнительно надо указать опцию @code{-lstdc++} для библиотек C++. @@ -92,13 +92,13 @@ MathGL это ... Всего основных концепций (базисных идей) шесть: @enumerate @item -@strong{Все рисунки создаются в памяти.} Это могут быть как растровые картинки, так и векторные списки примитивов. Дальнейшая судьба рисунков определяется пользователем: можно сохранить в файл, вывести на экран, создать анимацию/кино, дополнительно отредактировать и т.д. Такой подход обеспечивает высокую переносимость библиотеки -- один и тот же программный код создаст в точности одинаковый рисунок на @emph{любой} операционной системе. Кроме того, при таком подходе рисунки можно создавать непосредственно в консольной программе -- графическое окно не нужно! +@strong{Все рисунки создаются в памяти.} Это могут быть как растровые картинки (для @code{SetQuality(MGL_DRAW_LMEM)}), так и векторные списки примитивов (по умолчанию). Дальнейшая судьба рисунков определяется пользователем: можно сохранить в файл, вывести на экран, создать анимацию/кино, дополнительно отредактировать и т.д. Такой подход обеспечивает высокую переносимость библиотеки -- один и тот же программный код создаст в точности одинаковый рисунок на @emph{любой} операционной системе. Кроме того, при таком подходе рисунки можно создавать непосредственно в консольной программе -- графическое окно не нужно! @item @strong{Все настройки графиков (стиль линий, цветовые схемы поверхностей, стиль и цвет текста) задаются строками.} Это обеспечивает: удобство для пользователя -- короткую строку легче читать и здесь тяжелее ошибиться, чем в большом списке параметров; переносимость -- строки выглядят одинаково на всех платформах и не надо заботиться о типе и числе аргументов. @item -@strong{Все функции имеют ``упрощенный'' и ``продвинутый'' варианты.} Сделано опять из-за удобства. В ``упрощенном'' варианте для построения графика нужны только один-два массив(а) данных, которые автоматически равнораспределяются в заданном диапазоне осей координат. В ``продвинутой'' версии можно не только указать явно диапазон построения графика, но и задать его параметрически. Последнее позволяет легко строить довольно сложные кривые и поверхности. В обоих вариантах функций порядок аргументов стандартен: сначала идут массивы данных, потом необязательный строковый параметр стиля графика, а далее -- второстепенные необязательные параметры для более точной настройки графика. +@strong{Все функции имеют ``упрощенный'' и ``продвинутый'' варианты.} Сделано опять из-за удобства. В ``упрощенном'' варианте для построения графика нужны только один-два массив(а) данных, которые автоматически равнораспределяются в заданном диапазоне осей координат. В ``продвинутой'' версии можно не только указать явно диапазон построения графика, но и задать его параметрически. Последнее позволяет легко строить довольно сложные кривые и поверхности. В обоих вариантах функций порядок аргументов стандартен: сначала идут массивы данных, потом необязательный строковый параметр стиля графика, а далее строка опций для более точной настройки графика. @item -@strong{Все данные передаются через экземпляры класса mglData.} Такой подход позволяет избежать ошибок при работе с памятью и единообразно передавать данные разных типов (float, double, данные из файла, заполненных пользователем и пр.) в функции рисования. +@strong{Все данные передаются через экземпляры класса mglData(A).} Такой подход позволяет избежать ошибок при работе с памятью и единообразно передавать данные разных типов (float, double, данные из файла, заполненных пользователем и пр.) в функции рисования. @item @strong{Все элементы рисунков векторные.} Изначально библиотека MathGL была ориентированна на работу с научными данными, которые по своей природе векторные (линии, грани, матрицы и т.д.). Поэтому векторность используется во всех рисунках! Причем иногда даже в ущерб производительности (например, при выводе шрифтов). Помимо всего прочего, векторность позволяет легко масштабировать рисунок -- измените размер картинки в 2 раза, и рисунок пропорционально растянется. @item @@ -108,11 +108,12 @@ MathGL это ... Кроме основных концепций я хотел бы остановиться на нескольких, как оказалось, нетривиальных моментах -- способе указания положения графика, осей координат и строковых параметров линий, поверхностей, текста. @menu -* Coordinate axes:: -* Line styles:: -* Color scheme:: -* Font styles:: -* Textual formulas:: +* Coordinate axes:: +* Line styles:: +* Color scheme:: +* Font styles:: +* Textual formulas:: +* Command options:: @end menu @include concept_ru.texi @@ -161,9 +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? -Начиная с версии 1.10, можно использовать заголовочный файл @code{#include }, содержащий C++ классы только с @code{inline} функциями. Такие классы должны быть совместимы с любым компилятором. Отмечу, что эти "интерфейсные" классы @strong{не совместимы} с классами в обычных заголовочных файлах и использоваться должны только одни из них! Я рекомендую использовать обычные заголовочные классы для компиляторов GNU (например для MinGW). - -@c @strong{Наконец!} Пожалуйста @emph{не спрашивайте} меня вопросы про Windows. Я не использую Windows. Я ничего не знаю о Visual Basic, Visual C++, CBuiled или .NET. Найдите подходящие форумы в интернете и задайте свой вопрос там. +Начиная с версии 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. @@ -172,13 +171,12 @@ gr->Window(argc,argv,foo_draw,"Title",this); Следует создать отдельный поток для обработки сообщений в окно. Кросс-платформенный путь -- использование библиотеки @code{pthread}. Обновление данных в окне можно выполнить вызовом функции @code{mglGraphFLTK::Update()}. Пример код имеет вид: @verbatim //----------------------------------------------------------------------------- -#include +#include #include -#include mglPoint pnt; // some global variable for changable data //----------------------------------------------------------------------------- -int sample(mglGraph *gr, void *) +int sample(mglGraph *gr) { gr->Box(); gr->Line(mglPoint(),pnt,"Ar2"); // just draw a vector return 0; @@ -187,8 +185,7 @@ int sample(mglGraph *gr, void *) void *mgl_fltk_tmp(void *) { mglFlRun(); return 0; } int main (int argc, char ** argv) { - mglGraphFLTK gr; - gr.Window(argc,argv,sample,"test"); // create window + mglWindow gr(0,sample,"test"); // create window static pthread_t tmp; pthread_create(&tmp, 0, mgl_fltk_tmp, 0); pthread_detach(tmp); // run window handling in the separate thread @@ -202,8 +199,32 @@ int main (int argc, char ** argv) } //----------------------------------------------------------------------------- @end verbatim - - +В случае если требуется вывести статичную картинку с текущими результатами расчетов, то достаточно передать @code{NULL} вместо функции рисования и вызывать @code{Update()} по мере необходимости для обновления графика. Такой способ подходит и для пользователей фортрана. +@verbatim +//----------------------------------------------------------------------------- +#include +//----------------------------------------------------------------------------- +int sample(mglGraph *gr) +{ + gr->Box(); gr->Line(mglPoint(),pnt,"Ar2"); // just draw a vector + return 0; +} +//----------------------------------------------------------------------------- +void *mgl_fltk_tmp(void *) { mglFlRun(); return 0; } +int main (int argc, char ** argv) +{ + mglWindow gr(0,NULL,"test"); // create window + for(int i=0;i<10;i++) // do calculation + { + sleep(1); // which can be very long + pnt = mglPoint(2*mgl_rnd()-1,2*mgl_rnd()-1); + sample(&gr); // draw picture + gr.Update(); // update window + } + return 0; // finish calculations and close the window +} +//----------------------------------------------------------------------------- +@end verbatim @item Сколько человек участвовало в создании библиотеки? Большую часть библиотеки написал один человек. Это результат примерно года работы на написание ядра библиотеки и базовых функций (в основном вечерами и по выходным). Процесс усовершенствования продолжается и теперь :). Скрипты сборки в основном написаны Д.Кулагиным, а экспорт в IDTF написан М.Видассовым. @@ -212,13 +233,13 @@ int main (int argc, char ** argv) Можно импортировать ее в экземпляр @code{mglData} и построить с помощью функции @code{Dens()}. Например, для черно-белого рисунка можно использовать код: @code{mglData bmp; bmp.Import("fname.png","wk"); gr->Dens(bmp,"wk");}. @item Как использовать MathGL в Qt, FLTK, wxWidgets ...? -Есть специальные классы (виджеты) для этих библиотек: QMathGL для Qt, Fl_MathGL для FLTK и т.д. Если Вы не нашли подходящий класс, то можете создать свой собственный виджет, рисующий растровое изображение из mglGraphAB::GetBits(). +Есть специальные классы (виджеты) для этих библиотек: QMathGL для Qt, Fl_MathGL для FLTK и т.д. Если Вы не нашли подходящий класс, то можете создать свой собственный виджет, рисующий растровое изображение из mglCanvas::GetBits(). @item Как мне создать U3D файл (3D in PDF)? Процедура состоит из двух шагов: создания файла IDTF и его конвертация в U3D. Можно использовать @uref{http://sourceforge.net/project/showfiles.php?group_id=152187&package_id=300628, U3D tools} для конвертации IDTF в U3D. Ему требуется библиотека @uref{http://libharu.org, libharu} 2.1.0 или более поздняя. Для установки используйте обычную процедуру @code{./bootstrap, ./configure, make, sudo make install}. В результате появится программа IDTFConverter для конвертации файлов *.idtf в бинарные файлы *.u3d. Последние можно включить в PDF. @item Как сменить шрифт (семейство шрифтов)? -Во-первых, надо загрузить файлы @uref{http://mathgl.sourceforge.net/download.html, отсюда} или @uref{http://sourceforge.net/project/showfiles.php?group_id=152187&package_id=267177, отсюда}. Далее, в экземпляре mglGraph загружаем шрифты: @code{gr->SetFont(new mglFont(fontname,path));}. Здесь @var{fontname} -- базовое имя шрифта, например @samp{STIX}, и @var{path} -- путь к папке с файлами шрифтов. Вызовите @code{gr->SetFont(NULL);} для использования шрифта по умолчанию. +Во-первых, надо загрузить файлы @uref{http://mathgl.sourceforge.net/download.html, отсюда} или @uref{http://sourceforge.net/project/showfiles.php?group_id=152187&package_id=267177, отсюда}. Далее, в экземпляре mglGraph загружаем шрифты: @code{gr->LoadFont(fontname,path);}. Здесь @var{fontname} -- базовое имя шрифта, например @samp{STIX}, и @var{path} -- путь к папке с файлами шрифтов. Вызовите @code{gr->RestoreFont();} для использования шрифта по умолчанию. @item Как нарисовать метки оси снаружи от графика? Просто используйте отрицательные значения длины меток, например @code{gr->SetTickLen(-0.1);}. @@ -230,174 +251,106 @@ int main (int argc, char ** argv) Библиотека MathGL имеет интерфейсы к целому ряду языков программирования. Большинство из них базируется на С интерфейсе и построены с помощью инструментария SWIG. Сюда входят Python, Java, Octave, Lisp, C#, Guile, Lua, Modula 3, Ocaml, Perl, PHP, Pike, R, Ruby, Tcl. Кроме того, есть отдельный интерфейс к Фортрану, имеющий похожий набор функций, но со слегка различным типом аргументов (использованы целые вместо указателей). Функции С и Фортран интерфейса помечены [функции С]. @c ++++++++++ -Некоторое из языков представленных выше поддерживают объектное программирование (классы). Для них написан собственная оболочка и соответствующие функции/методы помечены (Python). Функции и методы доступные в С++ помечены (С++). +Некоторые из языков представленных выше поддерживают объектное программирование (классы). Для них написан собственная оболочка и соответствующие функции/методы помечены (Python). Функции и методы доступные в С++ помечены (С++). @c ++++++++++ -Наконец, специальный командный язык MGL был написан для быстрого доступа к функциям C++ со всеми их возможностями. Скрипты MGL могут быть выполнены как из внешних программ (UDAV, mgl2png, mgl2eps и т.д.) так и из кода на C++/C/Python и пр. (@pxref{mglParse class}). Подробно эти команды описаны в @ref{MGL interface}. +Наконец, специальный командный язык MGL был написан для быстрого доступа к функциям C++ со всеми их возможностями. Скрипты MGL могут быть выполнены как из внешних программ (UDAV, mglconv, mglview и т.д.) так и из кода на C++/C/Python и пр. (@pxref{mglParse class}). @menu * C interface:: * Python interface:: +* MGL interface:: @end menu @node C interface, Python interface, , Interfaces -@subsection C интерфейс +@subsection C/Фортран интерфейс C интерфейс является базовым для большинства других интерфейсов. Он содержит функции на чистом C для большинства методов классов MathGL. В отличие от членов-функций C++ классов, C функции в качестве аргументов должны явно иметь переменные типа HMGL (для графики) и/или HMDT (для массивов данных) для указания объекта рисования или данных. Таким образом, первым вызовом пользователя должно быть создание этих объектов с помощью функций @code{mgl_create_*()}, а последним -- их удаление с помощью функций @code{mgl_delete_*()}. Все функции описанны в заголовочном файле @code{#include } и используют переменные для идентификаторов объектов рисования/данных следующих типов: @itemize -@item +@item @code{HMGL} --- Указатель на класс @code{mglGraph} (@pxref{MathGL core}). -@item -@code{HMDT} --- Указатель на класс @code{mglData} (@pxref{mglData class}). -@item +@item +@code{HMDT} --- Указатель на класс @code{mglData} (@pxref{Data processing}). +@item @code{HMPR} --- Указатель на класс @code{mglParse} (@pxref{mglParse class}).. @end itemize -Эти переменные содержат идентификаторы объектов графики или данных. +Эти переменные содержат идентификаторы объектов графики или данных. + +Фортрановские функции имеют те же имена, что и функции C. Однако, есть различие: переменные типов @code{HMGL, HMDT} должны быть объявлены как целые достаточной разрядности (integer*4 на 32-битных системах или integer*8 на 64-битных системах). Все С функции являются процедурами для Фортрана (должны вызываться с помощью оператора call). Исключение составляют функции, возвращающие переменные типа @code{HMGL} или @code{HMDT}. Последние должны быть объявлены целыми для использования в фортрановском коде. Также помните, что строки в фортране обозначаются одинарной кавычкой @code{'}, а не двойной @code{"} как в С/С++. -Фортрановские функции имеют те же имена, что и функции C. Однако, есть различие: переменные типов @code{HMGL, HMDT} должны быть объявлены как целые достаточной разрядности (integer*4 на 32-битных системах или integer*8 на 64-битных системах). Все С функции являются процедурами для Фортрана (должны вызываться с помощью оператора call). Исключение составляют функции, возвращающие переменные типа @code{HMGL} или @code{HMDT}. Последние должны быть объявлены целыми для использования в фортрановском коде. Также помните, что строки в фортране обозначаются одинарной кавычкой @code{’}, а не двойной @code{"} как в С/С++. +@node Python interface, MGL interface, C interface, Interfaces +@subsection C++/Python interface -@strong{Создание и удаление графического объекта} +MathGL provides the interface to a set of languages via SWIG library. Some of these languages support classes. The typical example is Python -- which is named in this chapter's title. Exactly the same classes are used for high-level C++ API. Its feature is using only inline member-functions what make high-level API to be independent on compiler even for binary build. +There are 2 classes in: @itemize -@item Функции для рисования в памяти: -@deftypefn {C function} @code{HMGL} mgl_create_graph_gl () -Создает экземпляр класса mglGraphGL. -@end deftypefn -@deftypefn {C function} @code{HMGL} mgl_create_graph_zb (@code{int} width, @code{int} height) -Создает экземпляр класса mglGraphZB с указанными размерами. -@end deftypefn -@deftypefn {C function} @code{HMGL} mgl_create_graph_ps (@code{int} width, @code{int} height) -Создает экземпляр класса mglGraphPS с указанными размерами. -@end deftypefn -@deftypefn {C function} @code{HMGL} mgl_create_graph_idtf () -Создает экземпляр класса mglGraphIDTF. -@end deftypefn - -@item Функции для рисования в окне: -@deftypefn {C function} @code{HMGL} mgl_create_graph_glut (@code{int (*}draw@code{)(HMGL gr, void *p)}, @code{const char *}title, @code{void *}par) -Создает экземпляр класса mglGraphGLUT и связанное с ним окно. Одновременно может быть открыто только одно окно. Описание аргументов функции см. в @ref{mglGraphAB class}. -@end deftypefn -@deftypefn {C function} @code{HMGL} mgl_create_graph_fltk (@code{int (*}draw@code{)(HMGL gr, void *p)}, @code{const char *}title, @code{void *}par) -Создает экземпляр класса mglGraphFLTK и связанное с ним окно. Одновременно может быть открыто несколько окно. Однако Вы должны вызвать функцию @code{mgl_fltk_run()} для начала обработки сообщений окну. Описание аргументов функции см. в @ref{mglGraphAB class}. Замечу, что параметр @var{draw} может быть равным @code{NULL} для отображения текущей статической картинки (анимация и слайды не доступны). -@end deftypefn -@deftypefn {C function} @code{HMGL} mgl_create_graph_qt (@code{int (*}draw@code{)(HMGL gr, void *p)}, @code{const char *}title, @code{void *}par) -Создает экземпляр класса mglGraphQT и связанное с ним окно. Одновременно может быть открыто несколько окно. Однако Вы должны вызвать функцию @code{mgl_qt_run()} для начала обработки сообщений окну. Описание аргументов функции см. в @ref{mglGraphAB class}. Замечу, что параметр @var{draw} может быть равным @code{NULL} для отображения текущей статической картинки (анимация и слайды не доступны). -@end deftypefn -@deftypefn {C function} @code{void} mgl_fltk_run () -Запускает цикл обработки сообщений FLTK. Обычно программа завершает функцию main() вызовом @code{return mgl_fltk_run();}. -@end deftypefn -@deftypefn {C function} @code{void} mgl_fltk_thread () -Запускает цикл обработки сообщений FLTK. В отличие от @code{mgl_fltk_run()} цикл запускается в отдельном потоке, так что основная программа продолжает выполнение сразу. -@end deftypefn -@deftypefn {C function} @code{void} mgl_qt_run () -Запускает цикл обработки сообщений Qt. Обычно программа завершает функцию main() вызовом @code{return mgl_qt_run();}. -@end deftypefn -@deftypefn {C function} @code{void} mgl_qt_thread () -Запускает цикл обработки сообщений Qt. В отличие от @code{mgl_qt_run()} цикл запускается в отдельном потоке, так что основная программа продолжает выполнение сразу. -@end deftypefn -@deftypefn {C function} @code{void} mgl_update (@code{HMGL} graph) -Обновляет содержимое экрана. -@end deftypefn - -@deftypefn {C function} @code{void} mgl_set_show_mouse_pos (@code{HMGL} graph, @code{int} enable) -Switch to show or not in the widget the last mouse click position. -@end deftypefn -@deftypefn {C function} @code{void} mgl_get_last_mouse_pos (@code{HMGL} graph, @code{float *}x, @code{float *}y, @code{float *}z) -Last position of mouse click. -@end deftypefn -@deftypefn {C function} @code{void} mgl_calc_xyz (@code{HMGL} graph, @code{int} xs, @code{int} ys, @code{float *}x, @code{float *}y, @code{float *}z) -Calculate 3D coordinate @{x,y,z@} for screen point @{xs,ys@}. At this moment it ignore perspective and transformation formulas (curvilinear coordinates). The calculation are done for the last used InPlot (@pxref{Transformation matrix}). -@end deftypefn - - -@item Functions for data creation: -@deftypefn {C function} @code{HMDT} mgl_create_data () -Create simple instance of class mglData. -@end deftypefn -@deftypefn {C function} @code{HMDT} mgl_create_data_size (@code{int} nx, @code{int} ny, @code{int} nz) -Create instance of class mglData with specified sizes. -@end deftypefn -@deftypefn {C function} @code{HMDT} mgl_create_data_file (@code{const char *}fname) -Create instance of class mglData and fill it by data from text file. -@end deftypefn - -@item Each created object @strong{must} be deleted after usage by functions: -@deftypefn {C function} @code{void} mgl_delete_graph (@code{HMGL} graph) -Delete the instance of class. Must be used after plotting for every created graphical object. -@end deftypefn -@deftypefn {C function} @code{void} mgl_delete_data (@code{HMDT} dat) -Delete the instance of class. Must be used after using for every created data object. -@end deftypefn +@item @code{mglGraph} +-- provide most plotting functions (@pxref{MathGL core}). +@item @code{mglData} +-- provide base data processing (@pxref{Data processing}). It have an additional feature to access data values. You can use a construct like this: @code{dat[i]=sth;} or @code{sth=dat[i]} where flat representation of data is used (i.e., @var{i} can be in range 0...nx*nx*nz-1). You can also import NumPy arrays as input arguments in Python: @code{mgl_dat = mglData(numpy_dat);}. +@c @item @code{mglParse} -- practically the same as C++ class @code{MathGL provides the interface to a set of languages via SWIG library. Some of these languages support classes. The typical example is Python -- which is denoted in the chapter title. @end itemize -@node Python interface, , C interface, Interfaces -@subsection Python интерфейс - -MathGL provide the interface to a set of languages via SWIG library. Some of these languages support classes. The typical example is Python -- which is denoted in the chapter title. To use Python classes just execute @samp{import mathgl}. The simplest example will be: @verbatim import mathgl a=mathgl.mglGraph() a.Box() -a.WritePNG(’test.png’) +a.WritePNG("test.png") @end verbatim -Alternatively you can import all classes from @code{mathgl} module and easily access MathGL classes: +Alternatively you can import all classes from @code{mathgl} module and easily access MathGL classes like this: @verbatim from mathgl import * a=mglGraph() a.Box() -a.WritePNG(’test.png’) +a.WritePNG("test.png") @end verbatim -It become useful if you will create many @code{mglData} object, for example. +This becomes useful if you create many @code{mglData} objects, for example. -There are 2 classes in Python interface: -@itemize -@item @code{mglGraph} --- provide practically the same functionality as C++ class @code{mglGraph} (@pxref{MathGL core}). But it is not abstract class and it allows one to select at construction stage which plotter (ZB or PS and so on) will be used. -@item @code{mglData} --- is absolutely the same class as C++ @code{mglData} (@pxref{mglData class}). But an additional feature to acess data values is added. You can use construction like this: @code{dat[i]=sth;} or @code{sth=dat[i]} at this flat representation of data is used (i.e., @var{i} can be in range 0...nx*nx*nz-1. Also you can import NumPy arrays as input arguments: @code{mgl_dat = mglData(numpy_dat);}. -@c @item @code{mglParse} -- practically the same as C++ class @code{MathGL provide the interface to a set of languages via SWIG library. Some of these languages support classes. The typical example is Python -- which is denoted in the chapter title. -To use Python classes just execute @samp{import mathgl}. The simplest example will be: -@verbatim -import mathgl -a=mathgl.mglGraph() -a.Box() -a.WritePNG(’test.png’) -@end verbatim -Alternatively you can import all classes from @code{mathgl} module and easily access MathGL classes: -@verbatim -from mathgl import * -a=mglGraph() -a.Box() -a.WritePNG(’test.png’) -@end verbatim -It become useful if you will create many @code{mglData} object, for example. +@node MGL interface, , Python interface, Interfaces +@subsection MGL interface -There are 2 classes in Python interface: -@itemize -@item @code{mglGraph} --- provide practically the same functionality as C++ class @code{mglGraph} (@pxref{MathGL core}). But it is not abstract class and it allows one to select at construction stage which plotter (ZB or PS and so on) will be used. -@item @code{mglData} --- is absolutely the same class as C++ @code{mglData} (@pxref{mglData class}). But an additional feature to acess data values is added. You can use construction like this: @code{dat[i]=sth;} or @code{sth=dat[i]} at this flat representation of data is used (i.e., @var{i} can be in range 0...nx*nx*nz-1. -@c @item @code{mglParse} -- practically the same as C++ class @code{mglParse} (@pxref{mglParse class}). -@end itemize +MathGL имеет встроенный скриптовый язык MGL для обработки и отображения данных. Скрипты MGL можно использовать как независимо (программами UDAV, mgl2png, mgl2eps, mgl2svg и пр., @pxref{Utilities}) так и вызовами библиотеки. + +Язык MGL достаточно простой. Каждая строка -- отдельная команда. Первое слово -- имя команды, а все остальные ее аргументы. Команда может иметь до 1000 аргументов (по крайней мере сейчас). Слова разделяются одно от другого пробелом или символом табуляции. Различий между верхним и нижним индексом нет, т.е. переменные @var{a} и @var{A} идентичны. Символ @samp{#} начинает комментарий -- все символы после него игнорируются до конца строки. Исключением является случай, когда @samp{#} входит в строку. Опции команды указываются после символа @samp{;} (@pxref{Command options}). Символ @samp{:} начинает новую команду (подобно переводу строки) если он расположен не внутри скобок или строки. -There is main difference from C++ classes -- Python class @code{mglGraph} don’t have variables (options). All corresponding features are moved to methods. -The core of MathGL Python class is @strong{mglGraph} class. It contains a lot of plotting functions for 1D, 2D and 3D plots. So most of sections is describe its methods. Its constructor have following arguments: +Если строка содержит ссылки на внешние параметры (@samp{$0}, @samp{$1} ... @samp{$9}) или макроопределения (@samp{$a}, @samp{$b} ... @samp{$z}), то текущие значения параметров/макроопределений подставляются в строку вместо ссылки до выполнением команды. Это позволяет использовать один и тот же скрипт при различных входных параметрах командной строки или вводить макроопределения по ходу исполнения команд скрипта. -@defop Constructor {mglGraph (Python)} @code{} mglGraph (@code{int} kind=@code{0}, @code{int} width=@code{600}, @code{int} height=@code{400}) -Create the instance of class mglGraph with specified sizes @var{width} and @var{height}. Parameter @var{type} may have following values: @samp{0} -- use @code{mglGraphZB} plotter (default), @samp{1} -- use @code{mglGraphPS} plotter, @samp{2} -- use @code{mglGraphGL} plotter, @samp{3} -- use @code{mglGraphIDTF} plotter. -@end defop +Аргументы команды могут быть строками, переменными или числами. +@itemize @bullet +@item +Строка -- произвольный набор символов между метками @samp{'}. + +@item +Обычно переменная имеет имя, состоящее из букв и чисел (должно начинаться с буквы и не быть длиннее 64 символов). В качестве переменной можно использовать временные массивы, включающие в себя: +@itemize @bullet +@item +срезы (``подмассивы'') массивов данных (подобно команде @ref{subdata}). Например, @code{a(1)} или @code{a(1,:)} или @code{a(1,:,:)} -- вторая строка массива @var{a}, @code{a(:,2)} или @code{a(:,2,:)} -- третий столбец, @code{a(:,:,0)} -- первый срез и т.д. Также можно выделить часть массива с m-го по n-ый элемент @code{a(m:n,:,:)} или просто @code{a(m:n)}. + +@item +произвольные комбинации столбцов данных (например, @code{a('n*w^2/exp(t)')}), если столбцы данных были именованы командой @ref{idset} или в файле данных (в строке начинающейся с @code{##}). + +@item +произвольное выражение из существующих переменных и констант. Например, @samp{sqrt(dat(:,5)+1)} даст временный массив данных с элементами равными @code{tmp[i,j] = sqrt(dat[i,5,j]+1)}. + +@item +массивы с элементами заданными в квадратных скобках [], разделенные @samp{,}. При этом внутри выражения не должно быть пробелов! Например, @samp{[1,2,3]} даст временный массив из 3 элементов @{1, 2, 3@}; @samp{[[11,12],[21,22]]} даст матрицу 2*2 и т.д. Элементами такой конструкции могут быть и массивы если их размерности одинаковые, например @samp{[v1,v2,...,vn]}. + +@item +результат команд построения новых данных (@pxref{Make another data}), если они заключены в фигурные скобки @{@}. Например, @samp{@{sum dat 'x'@}} даст временный массив, который есть результат суммирования @var{dat} вдоль 'x'. Это такой же массив как и @var{tmp}, полученный командой @samp{sum tmp dat 'x'}. При этом можно использовать вложенные конструкции, например @samp{@{sum @{max dat 'z'@} 'x'@}}. @end itemize +Временные массивы не могут стоять в качестве первого аргумента команд, создающих массивы (например, @samp{new}, @samp{read}, @samp{hist} и т.д.). -There is main difference from C++ classes -- Python class @code{mglGraph} don’t have variables (options). All corresponding features are moved to methods. The core of MathGL Python class is @strong{mglGraph} class. It contains a lot of plotting functions for 1D, 2D and 3D plots. So most of sections is describe its methods. Its constructor have following arguments: +@item +К скалярным переменным, кроме собственно чисел, относятся: специальные переменные @code{nan=#QNAN, pi=3.1415926..., on=1, off=0, :=-1}, переменные с суффиксами (@pxref{Data information}), переменные определенные командой @ref{define}. Также массивы размером 1x1x1 считаются скалярами (например, @samp{pi/dat.nx}). +@end itemize +Перед первым использованием все переменные должны быть определены с помощью команд, создающих массивы (@ref{new}, @ref{var}, @ref{list}, @ref{copy}, @ref{read}, @ref{hist}, @ref{sum} и др., @pxref{Data create} и @ref{Make another data}). -@defop Constructor {mglGraph (Python)} @code{} mglGraph (@code{int} kind=@code{0}, @code{int} width=@code{600}, @code{int} height=@code{400}) -Create the instance of class mglGraph with specified sizes @var{width} and @var{height}. Parameter @var{type} may have following values: @samp{0} -- use @code{mglGraphZB} plotter (default), @samp{1} -- use @code{mglGraphPS} plotter, @samp{2} -- use @code{mglGraphGL} plotter, @samp{3} -- use @code{mglGraphIDTF} plotter. -@end defop +Команды могут иметь несколько наборов аргументов (например, @code{plot ydat} и @code{plot xdat ydat}). Все аргументы команды для выбранного набора должны быть указаны, однако часть из них могут иметь значения по умолчанию. Такие аргументы в описании команд будут помещены в квадратные скобки [], например @code{plot ydat ['stl'='' zval=nan]}. При этом запись @code{[arg1 arg2 arg3 ...]} подразумевает @code{[arg1 [arg2 [arg3 ...]]]}, т.е. опускать можно только аргументы с конца, если вы согласны с их значениями по умолчанию. Например, @code{plot ydat '' 1} или @code{plot ydat ''} правильно, а @code{plot ydat 1} не правильно (аргумент @code{'stl'} пропущен). @node Thanks, , Interfaces, Overview @@ -407,11 +360,11 @@ Create the instance of class mglGraph with specified sizes @var{width} and @var{ @item My special thanks to Marina Balakina for the patience during library writing and for the help in documentation writing and spelling. @item -I’m thankful to D. Kulagin and S.M. Plis for making Debian packages. +I'm thankful to D. Kulagin and S.M. Plis for making Debian packages. @item -I’m thankful to M. Vidassov for the help in handling solid UTF-8 fonts. +I'm thankful to M. Vidassov for the help in handling solid UTF-8 fonts. @item -I’m thankful to N. Troickiy and V. Lipatov for making RPM packages. +I'm thankful to N. Troickiy and V. Lipatov for making RPM packages. @item -I’m thankful to S. Skobelev, A. Korotkevich, V. Onuchin, S.M. Plis, R. Kiselev, A. Ivanov, M. Vidiassov and V. Lipatov for fruitful comments. +I'm thankful to S. Skobelev, A. Korotkevich, V. Onuchin, S.M. Plis, R. Kiselev, A. Ivanov, M. Vidiassov and V. Lipatov for fruitful comments. @end itemize diff --git a/texinfo/png/Makefile.in b/texinfo/png/Makefile.in deleted file mode 100644 index f5e89c6..0000000 --- a/texinfo/png/Makefile.in +++ /dev/null @@ -1,471 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = texinfo/png -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/config/autotroll.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/include/mgl/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -SOURCES = -DIST_SOURCES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(pngdir)" -DATA = $(png_DATA) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_CXXFLAGS = @AM_CXXFLAGS@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FLTK_FLAGS = @FLTK_FLAGS@ -FLTK_LIBS = @FLTK_LIBS@ -GIF_FLAGS = @GIF_FLAGS@ -GIF_LIBS = @GIF_LIBS@ -GLUT_FLAGS = @GLUT_FLAGS@ -GLUT_LIBS = @GLUT_LIBS@ -GL_LIBS = @GL_LIBS@ -GREP = @GREP@ -GSL_FLAGS = @GSL_FLAGS@ -GSL_LIBS = @GSL_LIBS@ -HAVE_SWIG = @HAVE_SWIG@ -HDF4_FLAGS = @HDF4_FLAGS@ -HDF4_LIBS = @HDF4_LIBS@ -HDF5_FLAGS = @HDF5_FLAGS@ -HDF5_LIBS = @HDF5_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JPEG_FLAGS = @JPEG_FLAGS@ -JPEG_LIBS = @JPEG_LIBS@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MGL_AGE = @MGL_AGE@ -MGL_CURRENT = @MGL_CURRENT@ -MGL_RELEASE = @MGL_RELEASE@ -MGL_REVISION = @MGL_REVISION@ -MKDIR_P = @MKDIR_P@ -MOC = @MOC@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OCTAVE = @OCTAVE@ -OCTAVE_ARCH = @OCTAVE_ARCH@ -OCTAVE_INCFLAGS = @OCTAVE_INCFLAGS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PNG_LIBS = @PNG_LIBS@ -PTHREAD_FLAGS = @PTHREAD_FLAGS@ -PTHREAD_LIBS = @PTHREAD_LIBS@ -PYTHON = @PYTHON@ -PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ -PYTHON_HEADERS = @PYTHON_HEADERS@ -PYTHON_PLATFORM = @PYTHON_PLATFORM@ -PYTHON_PREFIX = @PYTHON_PREFIX@ -PYTHON_VERSION = @PYTHON_VERSION@ -QMAKE = @QMAKE@ -QT_CFLAGS = @QT_CFLAGS@ -QT_CPPFLAGS = @QT_CPPFLAGS@ -QT_CXXFLAGS = @QT_CXXFLAGS@ -QT_DEFINES = @QT_DEFINES@ -QT_INCPATH = @QT_INCPATH@ -QT_LDFLAGS = @QT_LDFLAGS@ -QT_LFLAGS = @QT_LFLAGS@ -QT_LIBS = @QT_LIBS@ -QT_PATH = @QT_PATH@ -QT_VERSION = @QT_VERSION@ -QT_VERSION_MAJOR = @QT_VERSION_MAJOR@ -RANLIB = @RANLIB@ -RCC = @RCC@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TMPDIR = @TMPDIR@ -U3D_LIBS = @U3D_LIBS@ -UIC = @UIC@ -VERSION = @VERSION@ -WX_FLAGS = @WX_FLAGS@ -WX_LIBS = @WX_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -pkgpyexecdir = @pkgpyexecdir@ -pkgpythondir = @pkgpythondir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pyexecdir = @pyexecdir@ -pythondir = @pythondir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -pngdir = $(docdir)/png -images = ${shell $(top_builddir)/examples/mgl_example -list} -png_images = ${images:=.png} -png_DATA = $(png_images) -CLEANFILES = $(png_images) -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu texinfo/png/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu texinfo/png/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-pngDATA: $(png_DATA) - @$(NORMAL_INSTALL) - test -z "$(pngdir)" || $(MKDIR_P) "$(DESTDIR)$(pngdir)" - @list='$(png_DATA)'; test -n "$(pngdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pngdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pngdir)" || exit $$?; \ - done - -uninstall-pngDATA: - @$(NORMAL_UNINSTALL) - @list='$(png_DATA)'; test -n "$(pngdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pngdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pngdir)" && rm -f $$files -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(DATA) -installdirs: - for dir in "$(DESTDIR)$(pngdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-pngDATA - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-pngDATA - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-pngDATA install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am uninstall-pngDATA - - -$(png_images): hotdogs.pts # $(top_builddir)/examples/mgl_example - $(top_builddir)/examples/mgl_example -kind=${@:.png=} - cp ${@} ../../png/ - touch $(srcdir)/../mathgl.texi - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/texinfo/samples_en.texi b/texinfo/samples_en.texi index 2e9e957..45fd791 100644 --- a/texinfo/samples_en.texi +++ b/texinfo/samples_en.texi @@ -4,18 +4,17 @@ This chapter contain a lot of sample codes for all types of plots and for most i @ifclear UDAV Most of examples have the sample code on 5 languages: C++, MGL, C, Fortran and Python. However, I put only C++ code for some of examples due to a lot of them and clearency how to write code for other languages. All samples are divided on 6 large categories. The minimal code to view the samples for different languages are following. -@strong{C++ code} +@strong{C++/Python code} For compilation use: @code{g++ -o sample sample.cpp -lmgl}. @verbatim #include int main() { - mglGraph *gr = new mglGraphZB; + mglGraph gr; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // put sample code here //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - gr->ShowImage(); delete gr; - return 0; + gr.ShowImage(); return 0; } @end verbatim @strong{MGL code} @@ -26,7 +25,7 @@ For preview use: @code{mglview sample.mgl}. # --> you may use sample as is :) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @end verbatim -@strong{Pure C code} +@strong{C/Fortran code} For compilation use: @code{gcc -o sample sample.c -lmgl}. @verbatim #include @@ -42,7 +41,7 @@ int main() } @end verbatim @strong{Fortran code} -For compilation use: @code{gfortran -o sample sample.f90 -lmgl}. Note, fortran don't have argument checking. So you have to take special attention to pass real variables to real arguments of functions and integer variables to integer arguments of functions. There is no other special checking for that!!! +For compilation use: @code{gfortran -o sample sample.f90 -lmgl}. Note, fortran don't have argument checking. So you have to take special attention to pass real variables to real arguments of functions and integer variables to integer arguments of functions. There is no other special checking for that!!! Note you should use @code{integer} variables for any pointers (to data, to grapher, to parser and so on). Sometimes you may need to add @code{call} keyword before function calls. @verbatim integer gr, mgl_create_graph_zb gr = mgl_create_graph_zb(600,400) @@ -111,14 +110,14 @@ gr.ShowImage(); @c @caption{Example of Plot. @tdref{plot}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(50,3); y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); -gr->Box(); -gr->Plot(y); +gr.Box(); +gr.Plot(y); @end verbatim @strong{MGL code} @end ifclear @@ -131,36 +130,16 @@ box plot y @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(50,3,1); mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); mgl_data_modify(y,"sin(2*pi*x)",1); mgl_data_modify(y,"cos(2*pi*x)",2); mgl_box(gr,1); -mgl_plot(gr,y,NULL); +mgl_plot(gr,y,""); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer y, mgl_create_data_size -y = mgl_create_data_size(50,3,1) -call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0) -call mgl_data_modify(y,'sin(2*pi*x)',1) -call mgl_data_modify(y,'cos(2*pi*x)',2) -call mgl_box(gr,1) -call mgl_plot(gr,y,'') -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -y = mglData(50,3); -y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0); -y.Modify("sin(2*pi*x)",1); -y.Modify("cos(2*pi*x)",2); -gr.Box(); -gr.Plot(y); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Radar sample, Tens sample, Plot sample, 1D plotting samples @@ -171,11 +150,11 @@ gr.Plot(y); @c @caption{Example of Plot. @tdref{radar}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(10,3); y.Modify("0.4*sin(pi*(2*x+y/2))+0.1*rnd"); -gr->Radar(y,"#"); +gr.Radar(y,"#"); @end verbatim @strong{MGL code} @end ifclear @@ -185,27 +164,13 @@ modify y '0.4*sin(pi*(2*x+y/2))+0.1*rnd' radar y '#' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(10,3,1); mgl_data_modify(y,"0.4*sin(pi*(2*x+y/2))+0.1*rnd",0); mgl_radar(gr,y,"#",-1); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer y, mgl_create_data_size -y = mgl_create_data_size(10,3,1) -call mgl_data_modify(y,'0.4*sin(pi*(2*x+y/2))+0.1*rnd',0) -call mgl_radar(gr,y,'#',-1.) -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -y = mglData(10,3); -y.Modify("0.4*sin(pi*(2*x+y/2))+0.1*rnd"); -gr.Radar(y,"#"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Tens sample, Area sample, Radar sample, 1D plotting samples @@ -216,13 +181,13 @@ gr.Radar(y,"#"); @c @caption{Example of Tens. @tdref{tens}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(50), c(50); y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)"); c.Modify("sin(2*pi*x)"); -gr->Box(); -gr->Tens(y,c); +gr.Box(); +gr.Tens(y,c); @end verbatim @strong{MGL code} @end ifclear @@ -235,38 +200,17 @@ box tens y c @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(50,1,1); HMDT c = mgl_create_data_size(50,1,1); mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); mgl_data_modify(c,"sin(2*pi*x)",0); mgl_box(gr,1); -mgl_tens(gr,y,c,NULL); +mgl_tens(gr,y,c,""); mgl_delete_data(y); mgl_delete_data(c); @end verbatim -@strong{Fortran code} -@verbatim -integer y, c, mgl_create_data_size -y = mgl_create_data_size(50,1,1) -c = mgl_create_data_size(50,1,1) -call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0) -call mgl_data_modify(c,'sin(2*pi*x)',0) -call mgl_box(gr,1) -call mgl_tens(gr,y,'') -call mgl_delete_data(y) -call mgl_delete_data(c) -@end verbatim -@strong{Python} -@verbatim -y = mglData(50); -c = mglData(50); -y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)"); -c.Modify("sin(2*pi*x)"); -gr.Box(); -gr.Tens(y,c); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Area sample, Area gradient sample, Tens sample, 1D plotting samples @@ -277,15 +221,15 @@ gr.Tens(y,c); @c @caption{Example of Area. @tdref{area}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(50,3); y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); -gr->Org=mglPoint(0,0); -gr->Box(); -gr->Area(y); +gr.Org=mglPoint(0,0); +gr.Box(); +gr.Area(y); @end verbatim @strong{MGL code} @end ifclear @@ -299,7 +243,7 @@ box area y @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(50,3,1); mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); @@ -307,31 +251,9 @@ mgl_data_modify(y,"sin(2*pi*x)",1); mgl_data_modify(y,"cos(2*pi*x)",2); mgl_set_origin(gr,0.,0.,0.); mgl_box(gr,1); -mgl_area(gr,y,NULL); +mgl_area(gr,y,""); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer y, mgl_create_data_size -y = mgl_create_data_size(50,3,1) -call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0) -call mgl_data_modify(y,'sin(2*pi*x)',1) -call mgl_data_modify(y,'cos(2*pi*x)',2) -call mgl_set_origin(gr,0.,0.,0.) -call mgl_box(gr,1) -call mgl_area(gr,y,'') -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -y = mglData(50,3); -y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0); -y.Modify("sin(2*pi*x)",1); -y.Modify("cos(2*pi*x)",2); -gr.SetOrigin(0.,0.); -gr.Box(); -gr.Area(y); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Area gradient sample, Bars sample, Area sample, 1D plotting samples @@ -342,15 +264,15 @@ gr.Area(y); @c @caption{Example of Area. @tdref{area}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(50,3); y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); -gr->Org=mglPoint(0,0); -gr->Box(); -gr->Area(y,"cbgGyr"); +gr.Org=mglPoint(0,0); +gr.Box(); +gr.Area(y,"cbgGyr"); @end verbatim @strong{MGL code} @end ifclear @@ -364,7 +286,7 @@ box area y 'cbgGyr' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(50,3,1); mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); @@ -375,28 +297,6 @@ mgl_box(gr,1); mgl_area(gr,y,"cbgGyr"); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer y, mgl_create_data_size -y = mgl_create_data_size(50,3,1) -call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0) -call mgl_data_modify(y,'sin(2*pi*x)',1) -call mgl_data_modify(y,'cos(2*pi*x)',2) -call mgl_set_origin(gr,0.,0.,0.) -call mgl_box(gr,1) -call mgl_area(gr,y,'cbgGyr') -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -y = mglData(50,3); -y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0); -y.Modify("sin(2*pi*x)",1); -y.Modify("cos(2*pi*x)",2); -gr.SetOrigin(0.,0.); -gr.Box(); -gr.Area(y,"cbgGyr"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Bars sample, Bars 2 colors sample, Area gradient sample, 1D plotting samples @@ -407,13 +307,13 @@ gr.Area(y,"cbgGyr"); @c @caption{Example of Bars. @tdref{bars}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(10,3); y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); -gr->Org=mglPoint(0,0); -gr->Box(); -gr->Bars(y); +gr.Org=mglPoint(0,0); +gr.Box(); +gr.Bars(y); @end verbatim @strong{MGL code} @end ifclear @@ -425,33 +325,15 @@ box bars y @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(10,3,1); mgl_data_modify(y,"0.8*sin(pi*(2*x+y/2))+0.2*rnd"); mgl_set_origin(gr,0.,0.,0.); mgl_box(gr,1); -mgl_bars(gr,y,NULL); +mgl_bars(gr,y,""); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer y, mgl_create_data_size -y = mgl_create_data_size(10,3,1) -call mgl_data_modify(y,'0.8*sin(pi*(2*x+y/2))+0.2*rnd') -call mgl_set_origin(gr,0.,0.,0.) -call mgl_box(gr,1) -call mgl_bars(gr,y,'') -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -y = mglData(10,3); -y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); -gr.SetOrigin(0.,0.); -gr.Box(); -gr.Bars(y); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Bars 2 colors sample, Bars above sample, Bars sample, 1D plotting samples @@ -462,13 +344,13 @@ gr.Bars(y); @c @caption{Example of Bars. @tdref{bars}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(10,3); y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); -gr->Org=mglPoint(0,0); -gr->Box(); -gr->Bars(y,"cbgGyr"); +gr.Org=mglPoint(0,0); +gr.Box(); +gr.Bars(y,"cbgGyr"); @end verbatim @strong{MGL code} @end ifclear @@ -480,7 +362,7 @@ box bars y 'cbgGyr' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(10,3,1); mgl_data_modify(y,"0.8*sin(pi*(2*x+y/2))+0.2*rnd"); @@ -489,24 +371,6 @@ mgl_box(gr,1); mgl_bars(gr,y,"cbgGyr"); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer y, mgl_create_data_size -y = mgl_create_data_size(10,3,1) -call mgl_data_modify(y,'0.8*sin(pi*(2*x+y/2))+0.2*rnd') -call mgl_set_origin(gr,0.,0.,0.) -call mgl_box(gr,1) -call mgl_bars(gr,y,'cbgGyr') -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -y = mglData(10,3); -y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); -gr.SetOrigin(0.,0.); -gr.Box(); -gr.Bars(y,"cbgGyr"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Bars above sample, Bars fall sample, Bars 2 colors sample, 1D plotting samples @@ -517,13 +381,13 @@ gr.Bars(y,"cbgGyr"); @c @caption{Example of Bars. @tdref{bars}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(10,3); y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); -gr->Org=mglPoint(0,0); -gr->Box(); -gr->Bars(y,"a"); +gr.Org=mglPoint(0,0); +gr.Box(); +gr.Bars(y,"a"); @end verbatim @strong{MGL code} @end ifclear @@ -535,7 +399,7 @@ box bars y 'a' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(10,3,1); mgl_data_modify(y,"0.8*sin(pi*(2*x+y/2))+0.2*rnd"); @@ -544,24 +408,6 @@ mgl_box(gr,1); mgl_bars(gr,y,"a"); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer y, mgl_create_data_size -y = mgl_create_data_size(10,3,1) -call mgl_data_modify(y,'0.8*sin(pi*(2*x+y/2))+0.2*rnd') -call mgl_set_origin(gr,0.,0.,0.) -call mgl_box(gr,1) -call mgl_bars(gr,y,'a') -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -y = mglData(10,3); -y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); -gr.SetOrigin(0.,0.); -gr.Box(); -gr.Bars(y,"a"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Bars fall sample, Barh sample, Bars above sample, 1D plotting samples @@ -572,13 +418,13 @@ gr.Bars(y,"a"); @c @caption{Example of Bars. @tdref{bars}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(10,3); y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); -gr->Org=mglPoint(0,0); -gr->Box(); -gr->Bars(y,"f"); +gr.Org=mglPoint(0,0); +gr.Box(); +gr.Bars(y,"f"); @end verbatim @strong{MGL code} @end ifclear @@ -590,7 +436,7 @@ box bars y 'f' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(10,3,1); mgl_data_modify(y,"0.8*sin(pi*(2*x+y/2))+0.2*rnd"); @@ -599,24 +445,6 @@ mgl_box(gr,1); mgl_bars(gr,y,"f"); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer y, mgl_create_data_size -y = mgl_create_data_size(10,3,1) -call mgl_data_modify(y,'0.8*sin(pi*(2*x+y/2))+0.2*rnd') -call mgl_set_origin(gr,0.,0.,0.) -call mgl_box(gr,1) -call mgl_bars(gr,y,'f') -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -y = mglData(10,3); -y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); -gr.SetOrigin(0.,0.); -gr.Box(); -gr.Bars(y,"f"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Barh sample, Step sample, Bars fall sample, 1D plotting samples @@ -627,13 +455,13 @@ gr.Bars(y,"f"); @c @caption{Example of Barh. @tdref{barh}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(10,3); y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); -gr->Org=mglPoint(0,0); -gr->Box(); -gr->Barh(y); +gr.Org=mglPoint(0,0); +gr.Box(); +gr.Barh(y); @end verbatim @strong{MGL code} @end ifclear @@ -645,33 +473,15 @@ box barh y @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(10,3,1); mgl_data_modify(y,"0.8*sin(pi*(2*x+y/2))+0.2*rnd"); mgl_set_origin(gr,0.,0.,0.); mgl_box(gr,1); -mgl_barh(gr,y,NULL); +mgl_barh(gr,y,""); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer y, mgl_create_data_size -y = mgl_create_data_size(10,3,1) -call mgl_data_modify(y,'0.8*sin(pi*(2*x+y/2))+0.2*rnd') -call mgl_set_origin(gr,0.,0.,0.) -call mgl_box(gr,1) -call mgl_barh(gr,y,'') -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -y = mglData(10,3); -y.Modify("0.8*sin(pi*(2*x+y/2))+0.2*rnd"); -gr.SetOrigin(0.,0.); -gr.Box(); -gr.Barh(y); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Step sample, Stem sample, Barh sample, 1D plotting samples @@ -682,14 +492,14 @@ gr.Barh(y); @c @caption{Example of Step. @tdref{step}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(50,3); y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); -gr->Box(); -gr->Step(y); +gr.Box(); +gr.Step(y); @end verbatim @strong{MGL code} @end ifclear @@ -702,36 +512,16 @@ box step y @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(50,3,1); mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); mgl_data_modify(y,"sin(2*pi*x)",1); mgl_data_modify(y,"cos(2*pi*x)",2); mgl_box(gr,1); -mgl_step(gr,y,NULL); +mgl_step(gr,y,""); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer y, mgl_create_data_size -y = mgl_create_data_size(50,3,1) -call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0) -call mgl_data_modify(y,'sin(2*pi*x)',1) -call mgl_data_modify(y,'cos(2*pi*x)',2) -call mgl_box(gr,1) -call mgl_step(gr,y,'') -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -y = mglData(50,3); -y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0); -y.Modify("sin(2*pi*x)",1); -y.Modify("cos(2*pi*x)",2); -gr.Box(); -gr.Step(y); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Stem sample, Region sample, Step sample, 1D plotting samples @@ -742,15 +532,15 @@ gr.Step(y); @c @caption{Example of Stem. @tdref{stem}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(50,3); y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); -gr->Org=mglPoint(0,0); -gr->Box(); -gr->Stem(y,"o"); +gr.Org=mglPoint(0,0); +gr.Box(); +gr.Stem(y,"o"); @end verbatim @strong{MGL code} @end ifclear @@ -764,7 +554,7 @@ box stem y 'o' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(50,3,1); mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); @@ -775,28 +565,6 @@ mgl_box(gr,1); mgl_stem(gr,y,"o"); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer y, mgl_create_data_size -y = mgl_create_data_size(50,3,1) -call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0) -call mgl_data_modify(y,'sin(2*pi*x)',1) -call mgl_data_modify(y,'cos(2*pi*x)',2) -call mgl_set_origin(gr,0.,0.,0.) -call mgl_box(gr,1) -call mgl_stem(gr,y,'o') -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -y = mglData(50,3); -y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0); -y.Modify("sin(2*pi*x)",1); -y.Modify("cos(2*pi*x)",2); -gr.SetOrigin(0.,0.); -gr.Box(); -gr.Stem(y,"o"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Region sample, Region gradient sample, Stem sample, 1D plotting samples @@ -807,15 +575,15 @@ gr.Stem(y,"o"); @c @caption{Example of Region. @tdref{region}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y1(50), y2(50); y1.Modify("0.3*sin(2*pi*x)"); y2.Modify("0.5+0.3*cos(2*pi*x)"); -gr->Box(); -gr->Region(y1,y2,"r"); -gr->Plot(y1,"k2"); -gr->Plot(y2,"k2"); +gr.Box(); +gr.Region(y1,y2,"r"); +gr.Plot(y1,"k2"); +gr.Plot(y2,"k2"); @end verbatim @strong{MGL code} @end ifclear @@ -830,7 +598,7 @@ plot y1 'k2' plot y2 'k2' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y1 = mgl_create_data_size(50,1,1); HMDT y2 = mgl_create_data_size(50,1,1); @@ -843,30 +611,6 @@ mgl_plot(gr,y2,"k2"); mgl_delete_data(y1); mgl_delete_data(y2); @end verbatim -@strong{Fortran code} -@verbatim -integer y1, y2, mgl_create_data_size -y1 = mgl_create_data_size(50,1,1); -y2 = mgl_create_data_size(50,1,1); -call mgl_data_modify(y1,'0.3*sin(2*pi*x)',0); -call mgl_data_modify(y2,'0.5+0.3*cos(2*pi*x)',0); -call mgl_box(gr,1); -call mgl_region(gr,y1,y2,'r',1); -call mgl_plot(gr,y1,'k2'); -call mgl_plot(gr,y2,'k2'); -call mgl_delete_data(y1); -call mgl_delete_data(y2); -@end verbatim -@strong{Python} -@verbatim -y1, y2, x = mglData(50), mglData(50), mglData(50); -y1.Modify("0.3*sin(2*pi*x)"); -y2.Modify("0.5+0.3*cos(2*pi*x)"); -gr.Box(); -gr.Region(y1,y2,"r"); -gr.Plot(y1,"k2"); -gr.Plot(y2,"k2"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Region gradient sample, Error sample, Region sample, 1D plotting samples @@ -877,15 +621,15 @@ gr.Plot(y2,"k2"); @c @caption{Example of Region. @tdref{region}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y1(50), y2(50); y1.Modify("0.3*sin(2*pi*x)"); y2.Modify("0.5+0.3*cos(2*pi*x)"); -gr->Box(); -gr->Region(y1,y2,"yr"); -gr->Plot(y1,"k2"); -gr->Plot(y2,"k2"); +gr.Box(); +gr.Region(y1,y2,"yr"); +gr.Plot(y1,"k2"); +gr.Plot(y2,"k2"); @end verbatim @strong{MGL code} @end ifclear @@ -900,7 +644,7 @@ plot y1 'k2' plot y2 'k2' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y1 = mgl_create_data_size(50,1,1); HMDT y2 = mgl_create_data_size(50,1,1); @@ -913,30 +657,6 @@ mgl_plot(gr,y2,"k2"); mgl_delete_data(y1); mgl_delete_data(y2); @end verbatim -@strong{Fortran code} -@verbatim -integer y1, y2, mgl_create_data_size -y1 = mgl_create_data_size(50,1,1); -y2 = mgl_create_data_size(50,1,1); -call mgl_data_modify(y1,'0.3*sin(2*pi*x)',0); -call mgl_data_modify(y2,'0.5+0.3*cos(2*pi*x)',0); -call mgl_box(gr,1); -call mgl_region(gr,y1,y2,'yr',1); -call mgl_plot(gr,y1,'k2'); -call mgl_plot(gr,y2,'k2'); -call mgl_delete_data(y1); -call mgl_delete_data(y2); -@end verbatim -@strong{Python} -@verbatim -y1, y2, x = mglData(50), mglData(50), mglData(50); -y1.Modify("0.3*sin(2*pi*x)"); -y2.Modify("0.5+0.3*cos(2*pi*x)"); -gr.Box(); -gr.Region(y1,y2,"yr"); -gr.Plot(y1,"k2"); -gr.Plot(y2,"k2"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Error sample, BoxPlot sample, Region gradient sample, 1D plotting samples @@ -947,16 +667,16 @@ gr.Plot(y2,"k2"); @c @caption{Example of Error. @tdref{error}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(50,1), x0(10), y0(10), ex(10), ey(10); y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); x0.Modify("2*x-1 + 0.1*rnd-0.05"); y0.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x) + 0.2*rnd-0.1"); ey.Modify("0.2"); ex.Modify("0.1"); -gr->Box(); -gr->Plot(y); -gr->Error(x0,y0,ex,ey,"ko"); +gr.Box(); +gr.Plot(y); +gr.Error(x0,y0,ex,ey,"ko"); @end verbatim @strong{MGL code} @end ifclear @@ -976,7 +696,7 @@ plot y error x0 y0 ex ey 'ko' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(50,1,1); HMDT x0 = mgl_create_data_size(10,1,1); @@ -988,45 +708,12 @@ mgl_data_modify(x0,"2*x-1 + 0.1*rnd-0.05",0); mgl_data_modify(y0,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x) + 0.2*rnd-0.1",0); mgl_data_modify(ey,"0.2",0); mgl_data_modify(ex,"0.1",0); mgl_box(gr,1); -mgl_plot(gr,y,NULL); +mgl_plot(gr,y,""); mgl_error_exy(gr,x0,y0,ex,ey,"ko"); mgl_delete_data(x0); mgl_delete_data(y0); mgl_delete_data(ex); mgl_delete_data(ey); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer y, x0, y0, ex, ey, mgl_create_data_size -y = mgl_create_data_size(50,3,1) -x0 = mgl_create_data_size(10,1,1) -y0 = mgl_create_data_size(10,1,1) -ex = mgl_create_data_size(10,1,1) -ey = mgl_create_data_size(10,1,1) -call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0) -call mgl_data_modify(x0,'2*x-1 + 0.1*rnd-0.05',0); -call mgl_data_modify(y0,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + & - 0.2*sin(pi*x) + 0.2*rnd-0.1',0); -call mgl_data_modify(ey,'0.2',0) -call mgl_data_modify(ex,'0.1',0); -call mgl_box(gr,1) -call mgl_plot(gr,y,'') -call mgl_error_exy(gr,x0,y0,ex,ey,'ko') -call mgl_delete_data(x0) -call mgl_delete_data(y0) -call mgl_delete_data(ex) -call mgl_delete_data(ey) -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -y, x0, y0, ex, ey = mglData(50,1), mglData(10), mglData(10), mglData(10), mglData(10); -y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0); -x0.Modify("2*x-1+0.1*rnd-0.05"); -y0.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)+0.2*rnd-0.1"); -ey.Modify("0.2"); ex.Modify("0.1"); -gr.Box(); gr.Plot(y); -gr.Error(x0,y0,ex,ey,"ko"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node BoxPlot sample, Mark sample, Error sample, 1D plotting samples @@ -1037,13 +724,13 @@ gr.Error(x0,y0,ex,ey,"ko"); @c @caption{Example of BoxPlot. @tdref{boxplot}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(10,7); a.Modify("(2*rnd-1)^3/2"); -gr->BoxPlot(a); -gr->Box(); -gr->Plot(a," ko"); +gr.BoxPlot(a); +gr.Box(); +gr.Plot(a," ko"); @end verbatim @strong{MGL code} @end ifclear @@ -1054,33 +741,15 @@ boxplot a box:plot a ' ko' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(10,7,1); mgl_data_modify(a,"(2*rnd-1)^3/2",0); mgl_box(gr,1); mgl_plot(gr,a," ko"); -mgl_boxplot(gr,a,NULL); +mgl_boxplot(gr,a,""); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -y = mgl_create_data_size(10,7,1) -call mgl_data_modify(a,'(2*rnd-1)^3/2',0); -call mgl_box(gr,1) -call mgl_plot(gr,a,' ko') -call mgl_boxplot(gr,a,'') -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(10,7); -a.Modify("(2*rnd-1)^3/2"); -gr.Box(); -gr.Plot(a," ko"); -gr.BoxPlot(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Mark sample, TextMark sample, BoxPlot sample, 1D plotting samples @@ -1091,15 +760,15 @@ gr.BoxPlot(a); @c @caption{Example of Mark. @tdref{mark}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(50,3), y1(50); y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); y1.Modify("0.5+0.3*cos(2*pi*x)"); -gr->Box(); -gr->Mark(y,y1,"bs"); +gr.Box(); +gr.Mark(y,y1,"bs"); @end verbatim @strong{MGL code} @end ifclear @@ -1114,7 +783,7 @@ box mark y y1 'bs' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(50,3,1); HMDT y1 = mgl_create_data_size(50,1,1); @@ -1127,29 +796,6 @@ mgl_mark_y(gr,y,y1,"bs"); mgl_delete_data(y); mgl_delete_data(y1); @end verbatim -@strong{Fortran code} -@verbatim -integer y, y1, mgl_create_data_size -y = mgl_create_data_size(50,3,1) -y1 = mgl_create_data_size(50,1,1) -call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0) -call mgl_data_modify(y,'sin(2*pi*x)',1) -call mgl_data_modify(y,'cos(2*pi*x)',2) -call mgl_data_modify(y1,'0.5+0.3*cos(2*pi*x)',0) -call mgl_box(gr,1) -call mgl_mark_y(gr,y,y1,'bs') -call mgl_delete_data(y) -call mgl_delete_data(y1) -@end verbatim -@strong{Python} -@verbatim -y, y1 = mglData(50,3), mglData(50); -y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0); -y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); -y1.Modify("0.5+0.3*cos(2*pi*x)"); -gr.Box(); -gr.Mark(y,y1,"bs"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node TextMark sample, Tube sample, Mark sample, 1D plotting samples @@ -1160,15 +806,15 @@ gr.Mark(y,y1,"bs"); @c @caption{Example of TextMark. @tdref{textmark}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(50,3), y1(50); y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); y1.Modify("0.5+0.3*cos(2*pi*x)"); -gr->Box(); -gr->TextMark(y,y1,"\\gamma"); +gr.Box(); +gr.TextMark(y,y1,"\\gamma"); @end verbatim @strong{MGL code} @end ifclear @@ -1183,7 +829,7 @@ box textmark y y1 '\gamma' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y, y1; y = mgl_create_data_size(50,3,1); @@ -1197,29 +843,6 @@ mgl_textmark_yr(gr,y,y1,"\\gamma",""); mgl_delete_data(y); mgl_delete_data(y1); @end verbatim -@strong{Fortran code} -@verbatim -integer y, y1, mgl_create_data_size -y = mgl_create_data_size(50,3,1) -y1 = mgl_create_data_size(50,1,1) -call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0) -call mgl_data_modify(y,'sin(2*pi*x)',1) -call mgl_data_modify(y,'cos(2*pi*x)',2) -call mgl_data_modify(y1,'0.5+0.3*cos(2*pi*x)',0) -call mgl_box(gr,1) -call mgl_textmark_yr(gr,y,y1,'\gamma','') -call mgl_delete_data(y) -call mgl_delete_data(y1) -@end verbatim -@strong{Python} -@verbatim -y, y1 = mglData(50,3), mglData(50); -y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0); -y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); -y1.Modify("0.5+0.3*cos(2*pi*x)"); -gr.Box(); -gr.TextMark(y,y1,"\\gamma"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Tube sample, Text sample, TextMark sample, 1D plotting samples @@ -1230,16 +853,16 @@ gr.TextMark(y,y1,"\\gamma"); @c @caption{Example of Tube. @tdref{tube}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(50,3); y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); -gr->Rotate(40,60); -gr->Light(true); -gr->Box(); -gr->Tube(y,0.05); +gr.Rotate(40,60); +gr.Light(true); +gr.Box(); +gr.Tube(y,0.05); @end verbatim @strong{MGL code} @end ifclear @@ -1254,7 +877,7 @@ box tube y 0.05 @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(50,3,1); mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); @@ -1263,30 +886,9 @@ mgl_data_modify(y,"cos(2*pi*x)",2); mgl_rotate(gr,40.,60.,0.); mgl_set_light(gr,1); mgl_box(gr,1); -mgl_tube(gr,y,0.05,NULL); +mgl_tube(gr,y,0.05,""); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer y, mgl_create_data_size -y = mgl_create_data_size(50,3,1) -call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0) -call mgl_data_modify(y,'sin(2*pi*x)',1) -call mgl_data_modify(y,'cos(2*pi*x)',2) -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_box(gr,1) -call mgl_tube(gr,y,0.05,'') -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -y = mglData(50,3); -y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0); -y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); -gr.Rotate(40,60); gr.Light(True); gr.Box(); -gr.Tube(y,0.05); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Text sample, Torus sample, Tube sample, 1D plotting samples @@ -1297,16 +899,16 @@ gr.Tube(y,0.05); @c @caption{Example of Text. @tdref{text}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(50,3); y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); -gr->Box(); -gr->Plot(y.SubData(-1,0)); -gr->Text(y,"This is very long string drawn along a curve",":k"); -gr->Text(y,"Another string drawn above a curve","T:r"); +gr.Box(); +gr.Plot(y.SubData(-1,0)); +gr.Text(y,"This is very long string drawn along a curve",":k"); +gr.Text(y,"Another string drawn above a curve","T:r"); @end verbatim @strong{MGL code} @end ifclear @@ -1321,37 +923,16 @@ text y 'This is very long string drawn along a curve' ':k' text y 'Another string drawn above a curve' 'T:r' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(50,1,1); mgl_data_modify(y,"0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); mgl_box(gr,1); -mgl_plot(gr,y,NULL); +mgl_plot(gr,y,""); mgl_text_y(gr,y,"This is very long string drawn along a curve",":k",-1.); mgl_text_y(gr,y,"Another string drawn above a curve","T:r",-1.); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer y, mgl_create_data_size -y = mgl_create_data_size(50,1,1) -call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0) -call mgl_box(gr,1) -call mgl_plot(gr,y,'') -call mgl_text_y(gr,y,'This is very long string drawn along a curve',':k',-1.) -call mgl_text_y(gr,y,'Another string drawn above a curve','T:r',-1.) -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -y = mglData(50,3); -y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0); -y.Modify("sin(2*pi*x)",1); y.Modify("cos(2*pi*x)",2); -gr.Box(); -gr.Plot(y.SubData(-1,0)); -gr.Text(y,"This is very long string drawn along a curve",":k"); -gr.Text(y,"Another string drawn above a curve","T:r"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Torus sample, Chart sample, Text sample, 1D plotting samples @@ -1362,15 +943,15 @@ gr.Text(y,"Another string drawn above a curve","T:r"); @c @caption{Example of Torus. @tdref{torus}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y1(50), y2(50); y1.Modify("0.5+0.3*cos(2*pi*x)"); y2.Modify("0.3*sin(2*pi*x)"); -gr->Rotate(40,60); -gr->Light(true); -gr->Box(); -gr->Torus(y1,y2,"pz"); +gr.Rotate(40,60); +gr.Light(true); +gr.Box(); +gr.Torus(y1,y2,"pz"); @end verbatim @strong{MGL code} @end ifclear @@ -1385,7 +966,7 @@ box torus y1 y2 'pz' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y1 = mgl_create_data_size(50,1,1); HMDT y2 = mgl_create_data_size(50,1,1); @@ -1398,29 +979,6 @@ mgl_torus(gr,y1,y2,"pz"); mgl_delete_data(y1); mgl_delete_data(y2); @end verbatim -@strong{Fortran code} -@verbatim -integer y1, y2, mgl_create_data_size -y1 = mgl_create_data_size(50,1,1); -y2 = mgl_create_data_size(50,1,1); -call mgl_data_modify(y1,"0.5+0.3*cos(2*pi*x)",0); -call mgl_data_modify(y2,"0.3*sin(2*pi*x)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_box(gr,1) -call mgl_torus(gr,y1,y2,'pz') -call mgl_delete_data(y1) -call mgl_delete_data(y2) -@end verbatim -@strong{Python} -@verbatim -y1, y2 = mglData(50), mglData(50); -y1.Modify("0.5+0.3*cos(2*pi*x)"); -y2.Modify("0.3*sin(2*pi*x)"); -gr.Rotate(40,60); gr.Light(True); -gr.Box(); -gr.Torus(y1,y2,"pz"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Chart sample, Pie chart sample, Torus sample, 1D plotting samples @@ -1431,14 +989,14 @@ gr.Torus(y1,y2,"pz"); @c @caption{Example of Chart. @tdref{chart}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData ch(7,2); ch.Modify("rnd+0.1"); -gr->Rotate(40,60); -gr->Light(true); -gr->Box(); -gr->Chart(ch,"#"); +gr.Rotate(40,60); +gr.Light(true); +gr.Box(); +gr.Chart(ch,"#"); @end verbatim @strong{MGL code} @end ifclear @@ -1451,7 +1009,7 @@ box chart ch @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT ch = mgl_create_data_size(7,2,1); mgl_data_modify(ch,"rnd+0.1",0); @@ -1461,24 +1019,6 @@ mgl_box(gr,1); mgl_chart(gr,ch,"#"); mgl_delete_data(ch); @end verbatim -@strong{Fortran code} -@verbatim -integer ch, mgl_create_data_size -ch = mgl_create_data_size(7,2,1) -call mgl_data_modify(ch,'rnd+0.1',0) -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_box(gr,1) -call mgl_chart(gr,ch,'#') -call mgl_delete_data(ch) -@end verbatim -@strong{Python} -@verbatim -ch = mglData(7,2); ch.Modify("rnd+0.1"); -gr.Rotate(40,60); gr.Light(True); -gr.Box(); -gr.Chart(ch,"#"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Pie chart sample, Ring chart sample, Chart sample, 1D plotting samples @@ -1490,15 +1030,15 @@ gr.Chart(ch,"#"); @c @caption{Example of Chart in cylindrical coordinates. @tdref{pie_chart}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData ch(7,2); ch.Modify("rnd+0.1"); -gr->Rotate(40,60); -gr->Light(true); -gr->SetFunc("(y+1)/2*cos(pi*x)","(y+1)/2*sin(pi*x)"); -gr->Box(); -gr->Chart(ch,"bgr cmy#"); +gr.Rotate(40,60); +gr.Light(true); +gr.SetFunc("(y+1)/2*cos(pi*x)","(y+1)/2*sin(pi*x)"); +gr.Box(); +gr.Chart(ch,"bgr cmy#"); @end verbatim @strong{MGL code} @end ifclear @@ -1512,7 +1052,7 @@ box chart ch 'bgr cmy#' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT ch = mgl_create_data_size(7,2,1); mgl_data_modify(ch,"rnd+0.1",0); @@ -1523,26 +1063,6 @@ mgl_box(gr,1); mgl_chart(gr,ch,"bgr cmy#"); mgl_delete_data(ch); @end verbatim -@strong{Fortran code} -@verbatim -integer ch, mgl_create_data_size -ch = mgl_create_data_size(7,2,1) -call mgl_data_modify(ch,'rnd+0.1',0) -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_set_func(gr,'(y+1)/2*cos(pi*x)','(y+1)/2*sin(pi*x)',''); -call mgl_box(gr,1) -call mgl_chart(gr,ch,'bgr cmy#') -call mgl_delete_data(ch) -@end verbatim -@strong{Python} -@verbatim -ch = mglData(7,2); ch.Modify("rnd+0.1"); -gr.Rotate(40,60); gr.Light(True); -gr.SetFunc("(y+1)/2*cos(pi*x)","(y+1)/2*sin(pi*x)"); -gr.Box(); -gr.Chart(ch,"bgr cmy#"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Ring chart sample, , Pie chart sample, 1D plotting samples @@ -1554,15 +1074,15 @@ gr.Chart(ch,"bgr cmy#"); @c @caption{Example of Chart in cylindrical coordinates. @tdref{pie_chart}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData ch(7,2); ch.Modify("rnd+0.1"); -gr->Rotate(40,60); -gr->Light(true); -gr->SetFunc("(y+2)/3*cos(pi*x)","(y+2)/3*sin(pi*x)"); -gr->Box(); -gr->Chart(ch,"bgr cmy#"); +gr.Rotate(40,60); +gr.Light(true); +gr.SetFunc("(y+2)/3*cos(pi*x)","(y+2)/3*sin(pi*x)"); +gr.Box(); +gr.Chart(ch,"bgr cmy#"); @end verbatim @strong{MGL code} @end ifclear @@ -1576,7 +1096,7 @@ box chart ch 'bgr cmy#' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT ch = mgl_create_data_size(7,2,1); mgl_data_modify(ch,"rnd+0.1",0); @@ -1587,26 +1107,6 @@ mgl_box(gr,1); mgl_chart(gr,ch,"bgr cmy#"); mgl_delete_data(ch); @end verbatim -@strong{Fortran code} -@verbatim -integer ch, mgl_create_data_size -ch = mgl_create_data_size(7,2,1) -call mgl_data_modify(ch,'rnd+0.1',0) -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_set_func(gr,'(y+2)/3*cos(pi*x)','(y+2)/3*sin(pi*x)',''); -call mgl_box(gr,1) -call mgl_chart(gr,ch,'bgr cmy#') -call mgl_delete_data(ch) -@end verbatim -@strong{Python} -@verbatim -ch = mglData(7,2); ch.Modify("rnd+0.1"); -gr.Rotate(40,60); gr.Light(True); -gr.SetFunc("(y+2)/3*cos(pi*x)","(y+2)/3*sin(pi*x)"); -gr.Box(); -gr.Chart(ch,"bgr cmy#"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node 2D plotting samples, 3D plotting samples, 1D plotting samples, Samples @@ -1637,14 +1137,14 @@ gr.Chart(ch,"bgr cmy#"); @c @caption{Example of Surf. @tdref{surf}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); -gr->Light(true); -gr->Box(); -gr->Surf(a); +gr.Rotate(40,60); +gr.Light(true); +gr.Box(); +gr.Surf(a); @end verbatim @strong{MGL code} @end ifclear @@ -1657,7 +1157,7 @@ box surf a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -1667,24 +1167,6 @@ mgl_box(gr,1); mgl_surf(gr,a,0); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_box(gr,1) -call mgl_surf(gr,a,'') -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); gr.Box(); -gr.Surf(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Transparent surface sample, Surface in fog sample, Surf sample, 2D plotting samples @@ -1696,15 +1178,15 @@ gr.Surf(a); @c @caption{Example of Surf & Alpha. @tdref{surf_alpha}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); -gr->Light(true); -gr->Alpha(true); -gr->Box(); -gr->Surf(a); +gr.Rotate(40,60); +gr.Light(true); +gr.Alpha(true); +gr.Box(); +gr.Surf(a); @end verbatim @strong{MGL code} @end ifclear @@ -1718,7 +1200,7 @@ box surf a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -1729,26 +1211,6 @@ mgl_box(gr,1); mgl_surf(gr,a,0); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_set_alpha(gr,1) -call mgl_box(gr,1) -call mgl_surf(gr,a,'') -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); gr.Box(); -gr.Alpha(True); -gr.Surf(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Surface in fog sample, Sharp colors sample, Transparent surface sample, 2D plotting samples @@ -1760,15 +1222,15 @@ gr.Surf(a); @c @caption{Example of Surf & Fog. @tdref{surf_fog}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); -gr->Light(true); -gr->Fog(1); -gr->Box(); -gr->Surf(a); +gr.Rotate(40,60); +gr.Light(true); +gr.Fog(1); +gr.Box(); +gr.Surf(a); @end verbatim @strong{MGL code} @end ifclear @@ -1782,7 +1244,7 @@ box surf a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -1793,26 +1255,6 @@ mgl_box(gr,1); mgl_surf(gr,a,0); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_set_fog(gr,1.,0.25) -call mgl_box(gr,1) -call mgl_surf(gr,a,'') -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); gr.Box(); -gr.Fog(1); -gr.Surf(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Sharp colors sample, Mesh sample, Surface in fog sample, 2D plotting samples @@ -1823,14 +1265,14 @@ gr.Surf(a); @c @caption{Example of sharp color scheme. @tdref{surf_sl}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); -gr->Light(true); -gr->Box(); -gr->Surf(a,"BbcyrR|"); +gr.Rotate(40,60); +gr.Light(true); +gr.Box(); +gr.Surf(a,"BbcyrR|"); @end verbatim @strong{MGL code} @end ifclear @@ -1843,7 +1285,7 @@ box surf a 'BbcyrR|' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -1853,24 +1295,6 @@ mgl_box(gr,1); mgl_surf(gr,a,"BbcyrR|"); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_box(gr,1) -call mgl_surf(gr,a,'BbcyrR|') -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); gr.Box(); -gr.Surf(a,"BbcyrR|"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Mesh sample, Fall sample, Sharp colors sample, 2D plotting samples @@ -1881,13 +1305,13 @@ gr.Surf(a,"BbcyrR|"); @c @caption{Example of Mesh. @tdref{mesh}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); -gr->Box(); -gr->Mesh(a); +gr.Rotate(40,60); +gr.Box(); +gr.Mesh(a); @end verbatim @strong{MGL code} @end ifclear @@ -1899,7 +1323,7 @@ box mesh a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -1908,23 +1332,6 @@ mgl_box(gr,1); mgl_mesh(gr,a,0); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_box(gr,1) -call mgl_mesh(gr,a,'') -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); gr.Box(); -gr.Mesh(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Fall sample, Belt sample, Mesh sample, 2D plotting samples @@ -1935,13 +1342,13 @@ gr.Mesh(a); @c @caption{Example of Fall. @tdref{fall}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); -gr->Box(); -gr->Fall(a); +gr.Rotate(40,60); +gr.Box(); +gr.Fall(a); @end verbatim @strong{MGL code} @end ifclear @@ -1953,7 +1360,7 @@ box fall a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -1962,23 +1369,6 @@ mgl_box(gr,1); mgl_fall(gr,a,0); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_box(gr,1) -call mgl_fall(gr,a,'') -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); gr.Box(); -gr.Fall(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Belt sample, Tile sample, Fall sample, 2D plotting samples @@ -1989,14 +1379,14 @@ gr.Fall(a); @c @caption{Example of Belt. @tdref{belt}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); -gr->Light(true); -gr->Box(); -gr->Belt(a); +gr.Rotate(40,60); +gr.Light(true); +gr.Box(); +gr.Belt(a); @end verbatim @strong{MGL code} @end ifclear @@ -2009,7 +1399,7 @@ box belt a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -2019,24 +1409,6 @@ mgl_box(gr,1); mgl_belt(gr,a,0); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_box(gr,1) -call mgl_belt(gr,a,'') -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); gr.Box(); -gr.Belt(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Tile sample, Boxs sample, Belt sample, 2D plotting samples @@ -2047,14 +1419,14 @@ gr.Belt(a); @c @caption{Example of Tile. @tdref{tile}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); -gr->Light(true); -gr->Box(); -gr->Tile(a); +gr.Rotate(40,60); +gr.Light(true); +gr.Box(); +gr.Tile(a); @end verbatim @strong{MGL code} @end ifclear @@ -2067,7 +1439,7 @@ box tile a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -2077,24 +1449,6 @@ mgl_box(gr,1); mgl_tile(gr,a,0); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_box(gr,1) -call mgl_tile(gr,a,'') -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); gr.Box(); -gr.Tile(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Boxs sample, Dens sample, Tile sample, 2D plotting samples @@ -2105,14 +1459,14 @@ gr.Tile(a); @c @caption{Example of Boxs. @tdref{boxs}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); gr->Light(true); -gr->Org = mglPoint(0,0,0); -gr->Box(); -gr->Boxs(a); +gr.Rotate(40,60); gr.Light(true); +gr.Org = mglPoint(0,0,0); +gr.Box(); +gr.Boxs(a); @end verbatim @strong{MGL code} @end ifclear @@ -2126,7 +1480,7 @@ box boxs a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -2137,26 +1491,6 @@ mgl_box(gr,1); mgl_boxs(gr,a,0,0.); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_set_origin(gr,0.,0.,0.); -call mgl_box(gr,1) -call mgl_boxs(gr,a,'',0.) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); -gr.SetOrigin(0.,0.,0.); gr.Box(); -gr.Boxs(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Dens sample, Cont sample, Boxs sample, 2D plotting samples @@ -2168,13 +1502,13 @@ gr.Boxs(a); @c @caption{Example of Dens & Colorbar. @tdref{dens}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Box(); -gr->Dens(a); -gr->Colorbar(); +gr.Box(); +gr.Dens(a); +gr.Colorbar(); @end verbatim @strong{MGL code} @end ifclear @@ -2186,7 +1520,7 @@ dens a colorbar @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -2195,24 +1529,6 @@ mgl_dens(gr,a,0,0); mgl_colorbar(gr,"",0); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_box(gr,1) -call mgl_dens(gr,a,'',0) -call mgl_colorbar(gr,'',0) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Box(); -gr.Dens(a); -gr.Colorbar(); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Cont sample, ContF sample, Dens sample, 2D plotting samples @@ -2223,13 +1539,13 @@ gr.Colorbar(); @c @caption{Example of Cont. @tdref{cont}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); -gr->Box(); -gr->Cont(a); +gr.Rotate(40,60); +gr.Box(); +gr.Cont(a); @end verbatim @strong{MGL code} @end ifclear @@ -2241,7 +1557,7 @@ box cont a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -2250,27 +1566,6 @@ mgl_box(gr,1); mgl_cont(gr,a,0,7,NAN); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -real zero, nan -! I don't know the NaN symbol in Fortran. So I produce it as zero/zero -zero = 0; nan = zero/zero -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_box(gr,1) -call mgl_cont(gr,a,'',7,nan) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); -gr.Box(); -gr.Cont(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node ContF sample, ContD sample, Cont sample, 2D plotting samples @@ -2281,13 +1576,13 @@ gr.Cont(a); @c @caption{Example of ContF. @tdref{contf}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); gr->Light(true); -gr->Box(); -gr->ContF(a); +gr.Rotate(40,60); gr.Light(true); +gr.Box(); +gr.ContF(a); @end verbatim @strong{MGL code} @end ifclear @@ -2300,7 +1595,7 @@ box contf a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -2310,28 +1605,6 @@ mgl_box(gr,1); mgl_contf(gr,a,0,7,NAN); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -real zero, nan -! I don't know the NaN symbol in Fortran. So I produce it as zero/zero -zero = 0; nan = zero/zero -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_box(gr,1) -call mgl_contf(gr,a,'',7,nan) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); -gr.Box(); -gr.ContF(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node ContD sample, Axial sample, ContF sample, 2D plotting samples @@ -2342,14 +1615,14 @@ gr.ContF(a); @c @caption{Example of ContD. @tdref{contd}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40), v(9); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); v.Fill(-1,1); -gr->Box(); -gr->ContD(v,a); -gr->Colorbar(v); +gr.Box(); +gr.ContD(v,a); +gr.Colorbar(v); @end verbatim @strong{MGL code} @end ifclear @@ -2362,7 +1635,7 @@ contd v a colorbar v @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); HMDT v = mgl_create_data_size(9,1,1); @@ -2370,32 +1643,10 @@ mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); mgl_data_fill(v,-1.,1.,'x'); mgl_box(gr,1); mgl_contd_val(gr,v,a,0,0); -mgl_colorbar_val(gr,v,NULL,0); +mgl_colorbar_val(gr,v,"",0); mgl_delete_data(a); mgl_delete_data(v); @end verbatim -@strong{Fortran code} -@verbatim -integer a, v, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -v = mgl_create_data_size(9,1,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_data_fill(v,-1.,1.,'x'); -call mgl_box(gr,1) -call mgl_contd_val(gr,v,a,'',0); -call mgl_colorbar_val(gr,v,NULL,0); -call mgl_delete_data(a) -call mgl_delete_data(v) -@end verbatim -@strong{Python} -@verbatim -a, v = mglData(50,40), mglData(9); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -v.Fill(-1,1); -gr.Box(); -gr.ContD(v,a); -gr.Colorbar(v); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Axial sample, Grad sample, ContD sample, 2D plotting samples @@ -2406,15 +1657,15 @@ gr.Colorbar(v); @c @caption{Example of Axial. @tdref{axial}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); -gr->Light(true); -gr->Alpha(true); -gr->Box(); -gr->Axial(a); +gr.Rotate(40,60); +gr.Light(true); +gr.Alpha(true); +gr.Box(); +gr.Axial(a); @end verbatim @strong{MGL code} @end ifclear @@ -2428,7 +1679,7 @@ box axial a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -2439,26 +1690,6 @@ mgl_box(gr,1); mgl_axial(gr,a,"",3); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_set_alpha(gr,1) -call mgl_box(gr,1) -call mgl_axial(gr,a,'',3) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); gr.Alpha(True); -gr.Box(); -gr.Axial(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Grad sample, , Axial sample, 2D plotting samples @@ -2469,12 +1700,12 @@ gr.Axial(a); @c @caption{Example of Grad. @tdref{grad}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Box(); gr->Alpha(true); gr->Dens(a); -gr->Grad(a); +gr.Box(); gr.Alpha(true); gr.Dens(a); +gr.Grad(a); @end verbatim @strong{MGL code} @end ifclear @@ -2485,7 +1716,7 @@ box:alpha on:dens a grad a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -2495,24 +1726,6 @@ mgl_dens(gr,a,0,0); mgl_grad(gr,a,0,0); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_box(gr,1) -call mgl_set_alpha(gr,1) -call mgl_dens(gr,a,'',0) -call mgl_grad(gr,a,'',0) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Box(); gr.Alpha(1); gr.Dens(a); -gr.Colorbar(); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node 3D plotting samples, Dual plotting samples, 2D plotting samples, Samples @@ -2520,7 +1733,6 @@ gr.Colorbar(); @menu * Surf3 sample:: * Cloud sample:: -* CloudP sample:: * Dens3 sample:: * Cont3 sample:: * ContF3 sample:: @@ -2539,15 +1751,15 @@ gr.Colorbar(); @c @caption{Example of Surf3. @tdref{surf3}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(60,50,40); a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr->Rotate(40,60); -gr->Light(true); -gr->Alpha(true); -gr->Box(); -gr->Surf3(a); +gr.Rotate(40,60); +gr.Light(true); +gr.Alpha(true); +gr.Box(); +gr.Surf3(a); @end verbatim @strong{MGL code} @end ifclear @@ -2561,7 +1773,7 @@ box surf3 a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(60,50,40); mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); @@ -2572,29 +1784,9 @@ mgl_box(gr,1); mgl_surf3(gr,a,0,3); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_set_alpha(gr,1) -call mgl_box(gr,1) -call mgl_surf3(gr,a,'',3) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(60,50,40); -a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr.Rotate(40,60); gr.Light(True); gr.Alpha(True); -gr.Box(); -gr.Surf3(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ -@node Cloud sample, CloudP sample, Surf3 sample, 3D plotting samples +@node Cloud sample, Dens3 sample, Surf3 sample, 3D plotting samples @subsection Cloud sample @cindex Cloud @float @@ -2602,14 +1794,14 @@ gr.Surf3(a); @c @caption{Example of Cloud. @tdref{cloud}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(60,50,40); a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr->Rotate(40,60); -gr->Alpha(true); -gr->Box(); -gr->Cloud(a,"wyrRk"); +gr.Rotate(40,60); +gr.Alpha(true); +gr.Box(); +gr.Cloud(a,"wyrRk"); @end verbatim @strong{MGL code} @end ifclear @@ -2622,7 +1814,7 @@ box cloud a 'wyrRk' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(60,50,40); mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); @@ -2632,74 +1824,9 @@ mgl_box(gr,1); mgl_cloud(gr,a,"wyrRk",1.); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_alpha(gr,1) -call mgl_box(gr,1) -call mgl_cloud(gr,a,'wyrRk',1.) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(60,50,40); -a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr.Rotate(40,60); gr.Alpha(True); -gr.Box(); -gr.Cloud(a,"wyrRk"); -@end verbatim -@end ifclear -@c ------------------------------------------------------------------ -@node CloudP sample, Dens3 sample, Cloud sample, 3D plotting samples -@subsection CloudP sample -@cindex CloudP -@float -@image{../png/cloudp, 7cm} -@c @caption{Example of CloudP. @tdref{cloudp}} -@end float -@ifclear UDAV -@strong{C++ code} -@verbatim -mglData a(60,50,40); -a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr->Rotate(40,60); -gr->Alpha(true); -gr->Box(); -gr->CloudP(a,"wyrRk"); -@end verbatim -@strong{MGL code} -@end ifclear -Not available. -@ifclear UDAV -@strong{Pure C code} -@verbatim -HMDT a = mgl_create_data_size(60,50,40); -mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -mgl_rotate(gr,40.,60.,0.); -mgl_set_alpha(gr,1); -mgl_box(gr,1); -mgl_cloudp(gr,a,"wyrRk",1.); -mgl_delete_data(a); -@end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_alpha(gr,1) -call mgl_box(gr,1) -call mgl_cloudp(gr,a,'wyrRk',1.) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -Not available. @end ifclear @c ------------------------------------------------------------------ -@node Dens3 sample, Cont3 sample, CloudP sample, 3D plotting samples +@node Dens3 sample, Cont3 sample, Cloud sample, 3D plotting samples @subsection Dens3 sample @cindex Dens3 @cindex Axis @@ -2708,14 +1835,14 @@ Not available. @c @caption{Example of Dens3. @tdref{densa}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(60,50,40); a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr->Rotate(40,60); gr->Alpha(true); gr->Org = mglPoint(0,0,0); -gr->Box(); -gr->DensA(a); -gr->Axis(); +gr.Rotate(40,60); gr.Alpha(true); gr.Org = mglPoint(0,0,0); +gr.Box(); +gr.DensA(a); +gr.Axis(); @end verbatim @strong{MGL code} @end ifclear @@ -2730,7 +1857,7 @@ densa a axis @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(60,50,40); mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); @@ -2742,28 +1869,6 @@ mgl_dens3_all(gr,a,0); mgl_axis(gr,"xyz"); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_alpha(gr,1) -call mgl_set_origin(gr,0.,0.,0.); -call mgl_box(gr,1) -call mgl_dens3_all(gr,a,'') -call mgl_axis(gr,"xyz") -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(60,50,40); -a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr.Rotate(40,60); gr.Alpha(True); -gr.SetOrigin(0,0,0); gr.Box(); -gr.Axis(); -gr.DensA(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Cont3 sample, ContF3 sample, Dens3 sample, 3D plotting samples @@ -2774,13 +1879,13 @@ gr.DensA(a); @c @caption{Example of Cont3. @tdref{conta}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(60,50,40); a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr->Rotate(40,60); -gr->Box(); -gr->ContA(a); +gr.Rotate(40,60); +gr.Box(); +gr.ContA(a); @end verbatim @strong{MGL code} @end ifclear @@ -2792,7 +1897,7 @@ box conta a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(60,50,40); mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); @@ -2801,24 +1906,6 @@ mgl_box(gr,1); mgl_cont_all(gr,a,0,7); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_box(gr,1) -call mgl_cont_all(gr,a,'',7) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(60,50,40); -a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr.Rotate(40,60); -gr.Box(); -gr.ContA(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node ContF3 sample, Cont projection sample, Cont3 sample, 3D plotting samples @@ -2829,13 +1916,13 @@ gr.ContA(a); @c @caption{Example of ContF3. @tdref{contfa}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(60,50,40); a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr->Rotate(40,60); gr->Light(true); -gr->Box(); -gr->ContFA(a); +gr.Rotate(40,60); gr.Light(true); +gr.Box(); +gr.ContFA(a); @end verbatim @strong{MGL code} @end ifclear @@ -2848,7 +1935,7 @@ box contfa a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(60,50,40); mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); @@ -2858,25 +1945,6 @@ mgl_box(gr,1); mgl_contf_all(gr,a,0,7); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_box(gr,1) -call mgl_contf_all(gr,a,'',7) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(60,50,40); -a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr.Rotate(40,60); gr.Light(True); -gr.Box(); -gr.ContFA(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Cont projection sample, Dens projection sample, ContF3 sample, 3D plotting samples @@ -2889,15 +1957,15 @@ gr.ContFA(a); @c @caption{Example of projection by Cont[XYZ]. @tdref{cont_xyz}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(60,50,40); a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr->Rotate(40,60); -gr->Box(); -gr->ContX(a.Sum("x"),"",-1); -gr->ContY(a.Sum("y"),"",1); -gr->ContZ(a.Sum("z"),"",-1); +gr.Rotate(40,60); +gr.Box(); +gr.ContX(a.Sum("x"),"",-1); +gr.ContY(a.Sum("y"),"",1); +gr.ContZ(a.Sum("z"),"",-1); @end verbatim @strong{MGL code} @end ifclear @@ -2914,7 +1982,7 @@ sum s a 'z' contz s '' -1 @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(60,50,40), s; mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); @@ -2925,33 +1993,6 @@ s=mgl_data_sum(a,"y"); mgl_cont_y(gr,s,0,1.,7); mgl_delete_data(s); s=mgl_data_sum(a,"z"); mgl_cont_z(gr,s,0,-1.,7); mgl_delete_data(s); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a,s, mgl_create_data_size, mgl_data_sum -a = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_box(gr,1) -s=mgl_data_sum(a,'x') -call mgl_cont_x(gr,s,'',-1.,7) -call mgl_delete_data(s) -s=mgl_data_sum(a,'y') -call mgl_cont_y(gr,s,'',1.,7) -call mgl_delete_data(s) -s=mgl_data_sum(a,'z') -call mgl_cont_z(gr,s,'',-1.,7) -call mgl_delete_data(s) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(60,50,40); -a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr.Rotate(40,60); gr.Box(); -gr.ContX(a.Sum("x"),"",-1); -gr.ContY(a.Sum("y"),"",1); -gr.ContZ(a.Sum("z"),"",-1); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Dens projection sample, CutMinMax sample, Cont projection sample, 3D plotting samples @@ -2964,15 +2005,15 @@ gr.ContZ(a.Sum("z"),"",-1); @c @caption{Example of projection by Dens[XYZ]. @tdref{dens_xyz}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(60,50,40); a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr->Rotate(40,60); -gr->Box(); -gr->DensX(a.Sum("x"),"",-1); -gr->DensY(a.Sum("y"),"",1); -gr->DensZ(a.Sum("z"),"",-1); +gr.Rotate(40,60); +gr.Box(); +gr.DensX(a.Sum("x"),"",-1); +gr.DensY(a.Sum("y"),"",1); +gr.DensZ(a.Sum("z"),"",-1); @end verbatim @strong{MGL code} @end ifclear @@ -2989,7 +2030,7 @@ sum s a 'z' densz s '' -1 @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a, s; a = mgl_create_data_size(60,50,40); mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); @@ -3000,33 +2041,6 @@ s=mgl_data_sum(a,"y"); mgl_dens_y(gr,s,0,1.); mgl_delete_data(s); s=mgl_data_sum(a,"z"); mgl_dens_z(gr,s,0,-1.); mgl_delete_data(s); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a,s, mgl_create_data_size, mgl_data_sum -a = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_box(gr,1) -s=mgl_data_sum(a,'x') -call mgl_dens_x(gr,s,'',-1.) -call mgl_delete_data(s) -s=mgl_data_sum(a,'y') -call mgl_dens_y(gr,s,'',1.) -call mgl_delete_data(s) -s=mgl_data_sum(a,'z') -call mgl_dens_z(gr,s,'',-1.) -call mgl_delete_data(s) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(60,50,40); -a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr.Rotate(40,60); gr.Box(); -gr.DensX(a.Sum("x"),"",-1); -gr.DensY(a.Sum("y"),"",1); -gr.DensZ(a.Sum("z"),"",-1); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node CutMinMax sample, Isocaps sample, Dens projection sample, 3D plotting samples @@ -3039,16 +2053,16 @@ gr.DensZ(a.Sum("z"),"",-1); @c @caption{Example of Surf3 & CutMin, CutMax. @tdref{cutminmax}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(60,50,40); a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr->Rotate(40,60); -gr->Light(true); -gr->Alpha(true); -gr->CutMin = mglPoint(0,-1,-1); gr->CutMax = mglPoint(1,0,1); -gr->Box(); -gr->Surf3(a); +gr.Rotate(40,60); +gr.Light(true); +gr.Alpha(true); +gr.CutMin = mglPoint(0,-1,-1); gr.CutMax = mglPoint(1,0,1); +gr.Box(); +gr.Surf3(a); @end verbatim @strong{MGL code} @end ifclear @@ -3063,7 +2077,7 @@ box surf3 a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(60,50,40); mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); @@ -3075,27 +2089,6 @@ mgl_box(gr,1); mgl_surf3(gr,a,0,3); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_set_alpha(gr,1) -call mgl_set_cut_box(gr,0.,-1.,-1.,1.,0.,1.); -call mgl_box(gr,1) -call mgl_surf3(gr,a,'',3) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(60,50,40); -a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr.Rotate(40,60); gr.Light(True); gr.Alpha(True); -gr.SetCutBox(0,-1,-1,1,0,1); gr.Box(); -gr.Surf3(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Isocaps sample, CutOff sample, CutMinMax sample, 3D plotting samples @@ -3109,17 +2102,17 @@ gr.Surf3(a); @c @caption{Example of ``Isocaps''. @tdref{cutminmax2}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(61,51,40); a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr->Rotate(40,60); -gr->Light(true); -gr->CutMin = mglPoint(0,-1,-1); gr->CutMax = mglPoint(1,0,1.1); -gr->Box(); -gr->Surf3(-1,a); -gr->ContF3(a,'x',-1); gr->ContF3(a,'y',-1); -gr->ContF3(a,'z', 0); gr->ContF3(a,'z',39); +gr.Rotate(40,60); +gr.Light(true); +gr.CutMin = mglPoint(0,-1,-1); gr.CutMax = mglPoint(1,0,1.1); +gr.Box(); +gr.Surf3(-1,a); +gr.ContF3(a,'x',-1); gr.ContF3(a,'y',-1); +gr.ContF3(a,'z', 0); gr.ContF3(a,'z',39); @end verbatim @strong{MGL code} @end ifclear @@ -3137,7 +2130,7 @@ contf3 a 'z' 0 contf3 a 'z' 39 @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(61,51,40); mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); @@ -3152,31 +2145,6 @@ mgl_contf3(gr,a,'z', 0, "", 7); mgl_contf3(gr,a,'z',39, "", 7); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -a = mgl_create_data_size(61,51,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_set_cut_box(gr,0.,-1.,-1.,1.,0.,1.1); -call mgl_box(gr,1) -call mgl_surf3_val(gr,-1.,a,'') -call mgl_contf3(gr,a,'x',-1, '', 7); -call mgl_contf3(gr,a,'y',-1, '', 7); -call mgl_contf3(gr,a,'z', 0, '', 7); -call mgl_contf3(gr,a,'z',39, '', 7); -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(61,51,40); -a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr.Rotate(40,60); gr.Light(True); -gr.SetCutBox(0,-1,-1,1,0,1.1); gr.Box(); -gr.Surf3(-1,a); -gr.ContF3(a,"x",-1); gr.ContF3(a,"y",-1); -gr.ContF3(a,"z",0); gr.ContF3(a,"z",39); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node CutOff sample, , Isocaps sample, 3D plotting samples @@ -3188,16 +2156,16 @@ gr.ContF3(a,"z",0); gr.ContF3(a,"z",39); @c @caption{Example of Surf3 & CutOff. @tdref{surf3_cutoff}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(60,50,40); a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr->Rotate(40,60); -gr->Light(true); -gr->Alpha(true); -gr->CutOff("(z>(x+0.5*y-1)^2-1) & (z>(x-0.5*y-1)^2-1)"); -gr->Box(); -gr->Surf3(a); +gr.Rotate(40,60); +gr.Light(true); +gr.Alpha(true); +gr.CutOff("(z>(x+0.5*y-1)^2-1) & (z>(x-0.5*y-1)^2-1)"); +gr.Box(); +gr.Surf3(a); @end verbatim @strong{MGL code} @end ifclear @@ -3212,7 +2180,7 @@ box surf3 a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(60,50,40); mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); @@ -3224,28 +2192,6 @@ mgl_box(gr,1); mgl_surf3(gr,a,0,3); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,'-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)',0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_set_alpha(gr,1) -call mgl_set_cutoff(gr,'(z>(x+0.5*y-1)^2-1) & (z>(x-0.5*y-1)^2-1)') -call mgl_box(gr,1) -call mgl_surf3(gr,a,'',3) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(61,51,40); -a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr.Rotate(40,60); gr.Light(True); gr.Alpha(True); -gr.CutOff("(z>(x+0.5*y-1)^2-1) & (z>(x-0.5*y-1)^2-1)"); -gr.Box(); -gr.Surf3(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Dual plotting samples, Basic features, 3D plotting samples, Samples @@ -3281,15 +2227,15 @@ gr.Surf3(a); @c @caption{Example of SurfC. @tdref{surfc}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40), b(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); -gr->Light(true); -gr->Box(); -gr->SurfC(a,b); +gr.Rotate(40,60); +gr.Light(true); +gr.Box(); +gr.SurfC(a,b); @end verbatim @strong{MGL code} @end ifclear @@ -3304,7 +2250,7 @@ box surfc a b @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); HMDT b = mgl_create_data_size(50,40,1); @@ -3316,29 +2262,6 @@ mgl_box(gr,1); mgl_surfc(gr,a,b,0); mgl_delete_data(a); mgl_delete_data(b); @end verbatim -@strong{Fortran code} -@verbatim -integer a,b, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -b = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_box(gr,1) -call mgl_surfc(gr,a,b,'') -call mgl_delete_data(a) -call mgl_delete_data(b) -@end verbatim -@strong{Python} -@verbatim -a, b = mglData(50,40), mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); -gr.Box(); -gr.SurfC(a,b); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node SurfA sample, TileS sample, SurfC sample, Dual plotting samples @@ -3349,16 +2272,16 @@ gr.SurfC(a,b); @c @caption{Example of SurfA. @tdref{surfa}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40), b(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); -gr->Light(true); -gr->Alpha(true); -gr->Box(); -gr->SurfA(a,b); +gr.Rotate(40,60); +gr.Light(true); +gr.Alpha(true); +gr.Box(); +gr.SurfA(a,b); @end verbatim @strong{MGL code} @end ifclear @@ -3374,7 +2297,7 @@ box surfa a b @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a, b; a = mgl_create_data_size(50,40,1); @@ -3388,30 +2311,6 @@ mgl_box(gr,1); mgl_surfa(gr,a,b,0); mgl_delete_data(a); mgl_delete_data(b); @end verbatim -@strong{Fortran code} -@verbatim -integer a,b, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -b = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_set_alpha(gr,1); -call mgl_box(gr,1) -call mgl_surfa(gr,a,b,'') -call mgl_delete_data(a) -call mgl_delete_data(b) -@end verbatim -@strong{Python} -@verbatim -a, b = mglData(50,40), mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); gr.Alpha(True); -gr.Box(); -gr.SurfC(a,b); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node TileS sample, Map sample, SurfA sample, Dual plotting samples @@ -3422,13 +2321,13 @@ gr.SurfC(a,b); @c @caption{Example of TileS. @tdref{tiles}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40), b(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Box(); -gr->TileS(a,b); +gr.Box(); +gr.TileS(a,b); @end verbatim @strong{MGL code} @end ifclear @@ -3441,7 +2340,7 @@ box tile a b @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a, b; a = mgl_create_data_size(50,40,1); @@ -3452,26 +2351,6 @@ mgl_box(gr,1); mgl_tiles(gr,a,b,0); mgl_delete_data(a); mgl_delete_data(b); @end verbatim -@strong{Fortran code} -@verbatim -integer a,b, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -b = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_box(gr,1) -call mgl_tiles(gr,a,b,'') -call mgl_delete_data(a) -call mgl_delete_data(b) -@end verbatim -@strong{Python} -@verbatim -a, b = mglData(50,40), mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Box(); -gr.TileS(a,b); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Map sample, Traj sample, TileS sample, Dual plotting samples @@ -3482,21 +2361,21 @@ gr.TileS(a,b); @c @caption{Example of Map. @tdref{map}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50, 40), b(50, 40); -gr->Puts(mglPoint(0, 0), "\\to", "", -1.4); -gr->Axis(mglPoint(-1,-1,-2),mglPoint(1,1,2)); -gr->SubPlot(2, 1, 0); -a.Fill("x", gr->Min, gr->Max); b.Fill("y", gr->Min, gr->Max); -gr->Puts(mglPoint(0, 1.1), "\\{x, y\\}", "C", -2); gr->Box(); -gr->Map(a, b, "brgk", 0, false); -gr->SubPlot(2, 1, 1); -a.Fill("(x^3+y^3)/2", gr->Min, gr->Max); -b.Fill("(x-y)/2", gr->Min, gr->Max); -gr->Puts(mglPoint(0, 1.1), "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", "C", -2); -gr->Box(); -gr->Map(a, b, "brgk", 0, false); +gr.Puts(mglPoint(0, 0), "\\to", "", -1.4); +gr.Axis(mglPoint(-1,-1,-2),mglPoint(1,1,2)); +gr.SubPlot(2, 1, 0); +a.Fill("x", gr.Min, gr.Max); b.Fill("y", gr.Min, gr.Max); +gr.Puts(mglPoint(0, 1.1), "\\{x, y\\}", "C", -2); gr.Box(); +gr.Map(a, b, "brgk", 0, false); +gr.SubPlot(2, 1, 1); +a.Fill("(x^3+y^3)/2", gr.Min, gr.Max); +b.Fill("(x-y)/2", gr.Min, gr.Max); +gr.Puts(mglPoint(0, 1.1), "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", "C", -2); +gr.Box(); +gr.Map(a, b, "brgk", 0, false); @end verbatim @strong{MGL code} @end ifclear @@ -3519,7 +2398,7 @@ fill b '(x-y)/2' map a b 'brgk' 0 0 @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); HMDT b = mgl_create_data_size(50,40,1); @@ -3531,55 +2410,15 @@ mgl_data_fill_eq(gr, b, "y", 0, 0); mgl_puts_ext(gr, 0.,1.1,0., "\\{x, y\\}", "C", -2., 't'); mgl_box(gr,1); mgl_map(gr, a, b, "brgk", 0, 0); -mgl_subplot(gr, 2, 1, 1); -mgl_data_fill_eq(gr, a, "(x^3+y^3)/2", 0, 0); -mgl_data_fill_eq(gr, b, "(x-y)/2", 0, 0); -mgl_puts_ext(gr, 0.,1.1,0., "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", "C", -2., 't'); -mgl_box(gr,1); -mgl_map(gr, a, b, "brgk", 0, 0); -mgl_box(gr,1); -mgl_map(gr,a,b,0,0,1); -mgl_delete_data(a); mgl_delete_data(b); -@end verbatim -@strong{Fortran code} -@verbatim -integer a,b, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -b = mgl_create_data_size(50,40,1); -call mgl_puts_ext(gr, 0.,0.,0., '\to', '', -1.4, 't'); -call mgl_set_axis_3d(gr,-1.,-1.,-2.,1.,1.,2.); -call mgl_subplot(gr, 2, 1, 0); -call mgl_data_fill_eq(gr, a, 'x', 0, 0); -call mgl_data_fill_eq(gr, b, 'y', 0, 0); -call mgl_puts_ext(gr, 0.,1.1,0., '\{x, y\}', 'C', -2., 't'); -call mgl_box(gr,1); -call mgl_map(gr, a, b, 'brgk', 0, 0); -call mgl_subplot(gr, 2, 1, 1); -call mgl_data_fill_eq(gr, a, '(x^3+y^3)/2', 0, 0); -call mgl_data_fill_eq(gr, b, '(x-y)/2', 0, 0); -call mgl_puts_ext(gr, 0.,1.1,0., '\{\frac{x^3+y^3}{2}, \frac{x-y}{2}\}', 'C', -2., 't'); -call mgl_box(gr,1); -call mgl_map(gr, a, b, 'brgk', 0, 0); -call mgl_box(gr,1); -call mgl_map(gr,a,b,0,0,1); -call mgl_delete_data(a) -call mgl_delete_data(b) -@end verbatim -@strong{Python} -@verbatim -a, b = mglData(50,40), mglData(50,40); -gr.Puts(0, 0, 0, "\\to", "", -1.4); -gr.SetRanges(-1,1,-1,1,-2,2); -gr.SubPlot(2, 1, 0); -gr.Fill(a, "x"); gr.Fill(b, "y"); -gr.Puts(0, 1.1, 0, "\\{x, y\\}", "C", -2); -gr.Box(); -gr.Map(a, b, "brgk", 0, 0); -gr.SubPlot(2, 1, 1); -gr.Fill(a, "(x^3+y^3)/2"); gr.Fill(b, "(x-y)/2"); -gr.Puts(0, 1.1, 0, "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", "C", -2); -gr.Box(); -gr.Map(a, b, "brgk", 0, 0); +mgl_subplot(gr, 2, 1, 1); +mgl_data_fill_eq(gr, a, "(x^3+y^3)/2", 0, 0); +mgl_data_fill_eq(gr, b, "(x-y)/2", 0, 0); +mgl_puts_ext(gr, 0.,1.1,0., "\\{\\frac{x^3+y^3}{2}, \\frac{x-y}{2}\\}", "C", -2., 't'); +mgl_box(gr,1); +mgl_map(gr, a, b, "brgk", 0, 0); +mgl_box(gr,1); +mgl_map(gr,a,b,0,0,1); +mgl_delete_data(a); mgl_delete_data(b); @end verbatim @end ifclear @c ------------------------------------------------------------------ @@ -3591,7 +2430,7 @@ gr.Map(a, b, "brgk", 0, 0); @c @caption{Example of Plot. @tdref{traj}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y(50,3), x(50), y1(50), y2(50); y.Modify("0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)",0); @@ -3600,9 +2439,9 @@ y.Modify("cos(2*pi*x)",2); y1.Modify("0.5+0.3*cos(2*pi*x)"); y2.Modify("0.3*sin(2*pi*x)"); x.Fill(-1,1,'x'); -gr->Box(); -gr->Plot(x,y); -gr->Traj(x,y,y1,y2); +gr.Box(); +gr.Plot(x,y); +gr.Traj(x,y,y1,y2); @end verbatim @strong{MGL code} @end ifclear @@ -3622,7 +2461,7 @@ plot x y traj x y y1 y2 @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y = mgl_create_data_size(50,3,1); HMDT x= mgl_create_data_size(50,1,1); @@ -3635,45 +2474,11 @@ mgl_data_modify(x,"2*x-1",0); mgl_data_modify(y1,"0.5+0.3*cos(2*pi*x)",0); mgl_data_modify(y2,"0.3*sin(2*pi*x)",0); mgl_box(gr,1); -mgl_plot_xy(gr,x,y,NULL); -mgl_traj_xy(gr,yx,y,y1,y2,NULL,0,0); +mgl_plot_xy(gr,x,y,""); +mgl_traj_xy(gr,yx,y,y1,y2,"",0,0); mgl_delete_data(y); mgl_delete_data(y1); mgl_delete_data(x); mgl_delete_data(y2); @end verbatim -@strong{Fortran code} -@verbatim -integer x,y,y1,y2, mgl_create_data_size -y = mgl_create_data_size(50,3,1) -x= mgl_create_data_size(50,1,1); -y1 = mgl_create_data_size(50,1,1); -y2 = mgl_create_data_size(50,1,1); -call mgl_data_modify(y,'0.7*sin(2*pi*x) + 0.5*cos(3*pi*x) + 0.2*sin(pi*x)',0) -call mgl_data_modify(y,'sin(2*pi*x)',1) -call mgl_data_modify(y,'cos(2*pi*x)',2) -call mgl_data_modify(x,'2*x-1',0); -call mgl_data_modify(y1,'0.5+0.3*cos(2*pi*x)',0); -call mgl_data_modify(y2,'0.3*sin(2*pi*x)',0); -call mgl_box(gr,1) -call mgl_plot_xy(gr,x,y,NULL); -call mgl_traj_xy(gr,yx,y,y1,y2,NULL,0,0); -call mgl_delete_data(y) -call mgl_delete_data(x) -call mgl_delete_data(y1) -call mgl_delete_data(y2) -@end verbatim -@strong{Python} -@verbatim -x,y,y1,y2 = mglData(50), mglData(50,3), mglData(50), mglData(50); -y.Modify("0.7*sin(2*pi*x)+0.5*cos(3*pi*x)+0.2*sin(pi*x)",0); -y.Modify("sin(2*pi*x)",1); -y.Modify("cos(2*pi*x)",2); -y1.Modify("0.5+0.3*cos(2*pi*x)"); -y2.Modify("0.3*sin(2*pi*x)"); -x.Fill(-1,1,'x'); -gr.Box(); -gr.Plot(x,y); -gr.Traj(x,y,y1,y2); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Vect sample, VectL sample, Traj sample, Dual plotting samples @@ -3684,13 +2489,13 @@ gr.Traj(x,y,y1,y2); @c @caption{Example of Vect. @tdref{vect}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(20,30), b(20,30); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Box(); -gr->Vect(a,b); +gr.Box(); +gr.Vect(a,b); @end verbatim @strong{MGL code} @end ifclear @@ -3703,7 +2508,7 @@ box vect a b @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(20,30,1); HMDT b = mgl_create_data_size(20,30,1); @@ -3713,26 +2518,6 @@ mgl_box(gr,1); mgl_vect_2d(gr,a,b,0,0.); mgl_delete_data(a); mgl_delete_data(b); @end verbatim -@strong{Fortran code} -@verbatim -integer a,b, mgl_create_data_size -a = mgl_create_data_size(20,30,1); -b = mgl_create_data_size(20,30,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_box(gr,1) -call mgl_vect_2d(gr,a,b,'',0.) -call mgl_delete_data(a) -call mgl_delete_data(b) -@end verbatim -@strong{Python} -@verbatim -a, b = mglData(20,30), mglData(20,30); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Box(); -gr.Vect(a,b); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node VectL sample, VectC sample, Vect sample, Dual plotting samples @@ -3743,13 +2528,13 @@ gr.Vect(a,b); @c @caption{Example of VectL. @tdref{vectl}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(20,30), b(20,30); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Box(); -gr->VectL(a,b); +gr.Box(); +gr.VectL(a,b); @end verbatim @strong{MGL code} @end ifclear @@ -3762,7 +2547,7 @@ box vectl a b @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a, b; a = mgl_create_data_size(20,30,1); @@ -3773,26 +2558,6 @@ mgl_box(gr,1); mgl_vectl_2d(gr,a,b,0,0.); mgl_delete_data(a); mgl_delete_data(b); @end verbatim -@strong{Fortran code} -@verbatim -integer a,b, mgl_create_data_size -a = mgl_create_data_size(20,30,1); -b = mgl_create_data_size(20,30,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_box(gr,1) -call mgl_vectl_2d(gr,a,b,'',0.) -call mgl_delete_data(a) -call mgl_delete_data(b) -@end verbatim -@strong{Python} -@verbatim -a, b = mglData(20,30), mglData(20,30); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Box(); -gr.VectL(a,b); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node VectC sample, Flow sample, VectL sample, Dual plotting samples @@ -3803,13 +2568,13 @@ gr.VectL(a,b); @c @caption{Example of VectC. @tdref{vectc}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(20,30), b(20,30); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Box(); -gr->VectC(a,b); +gr.Box(); +gr.VectC(a,b); @end verbatim @strong{MGL code} @end ifclear @@ -3822,7 +2587,7 @@ box vectc a b @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a, b; a = mgl_create_data_size(20,30,1); @@ -3833,26 +2598,6 @@ mgl_box(gr,1); mgl_vectc_2d(gr,a,b,0,0.); mgl_delete_data(a); mgl_delete_data(b); @end verbatim -@strong{Fortran code} -@verbatim -integer a,b, mgl_create_data_size -a = mgl_create_data_size(20,30,1); -b = mgl_create_data_size(20,30,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_box(gr,1) -call mgl_vectc_2d(gr,a,b,'',0.) -call mgl_delete_data(a) -call mgl_delete_data(b) -@end verbatim -@strong{Python} -@verbatim -a, b = mglData(20,30), mglData(20,30); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Box(); -gr.VectC(a,b); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Flow sample, Pipe sample, VectC sample, Dual plotting samples @@ -3863,13 +2608,13 @@ gr.VectC(a,b); @c @caption{Example of Flow. @tdref{flow}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(20,30), b(20,30); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Box(); -gr->Flow(a,b); +gr.Box(); +gr.Flow(a,b); @end verbatim @strong{MGL code} @end ifclear @@ -3882,7 +2627,7 @@ box flow a b @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(20,30,1); HMDT b = mgl_create_data_size(20,30,1); @@ -3892,26 +2637,6 @@ mgl_box(gr,1); mgl_flow_2d(gr,a,b,0,5,1,0.); mgl_delete_data(a); mgl_delete_data(b); @end verbatim -@strong{Fortran code} -@verbatim -integer a,b, mgl_create_data_size -a = mgl_create_data_size(20,30,1); -b = mgl_create_data_size(20,30,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_box(gr,1) -call mgl_flow_2d(gr,a,b,'',5,1,0.) -call mgl_delete_data(a) -call mgl_delete_data(b) -@end verbatim -@strong{Python} -@verbatim -a, b = mglData(20,30), mglData(20,30); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Box(); -gr.Flow(a,b); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Pipe sample, Dew sample, Flow sample, Dual plotting samples @@ -3922,14 +2647,14 @@ gr.Flow(a,b); @c @caption{Example of Pipe. @tdref{pipe}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(20,30), b(20,30); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Light(true); -gr->Box(); -gr->Pipe(a,b); +gr.Light(true); +gr.Box(); +gr.Pipe(a,b); @end verbatim @strong{MGL code} @end ifclear @@ -3943,7 +2668,7 @@ box pipe a b @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(20,30,1); HMDT b = mgl_create_data_size(20,30,1); @@ -3954,27 +2679,6 @@ mgl_box(gr,1); mgl_pipe_2d(gr,a,b,0,0.05,5,1,0.); mgl_delete_data(a); mgl_delete_data(b); @end verbatim -@strong{Fortran code} -@verbatim -integer a,b, mgl_create_data_size -a = mgl_create_data_size(20,30,1); -b = mgl_create_data_size(20,30,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_set_light(gr,1) -call mgl_box(gr,1) -call mgl_pipe_2d(gr,a,b,'',0.05,5,1,0.) -call mgl_delete_data(a) -call mgl_delete_data(b) -@end verbatim -@strong{Python} -@verbatim -a, b = mglData(20,30), mglData(20,30); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Light(True); gr.Box(); -gr.Pipe(a,b); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Dew sample, Surf3C sample, Pipe sample, Dual plotting samples @@ -3985,14 +2689,14 @@ gr.Pipe(a,b); @c @caption{Example of Dew. @tdref{dew}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(20,30), b(20,30); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Box(); -gr->Light(true); -gr->Dew(a,b); +gr.Box(); +gr.Light(true); +gr.Dew(a,b); @end verbatim @strong{MGL code} @end ifclear @@ -4006,7 +2710,7 @@ light on dew a b @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(20,30,1); HMDT b = mgl_create_data_size(20,30,1); @@ -4017,27 +2721,6 @@ mgl_set_light(gr,1); mgl_dew_2d(gr,a,b,0,0.); mgl_delete_data(a); mgl_delete_data(b); @end verbatim -@strong{Fortran code} -@verbatim -integer a,b, mgl_create_data_size -a = mgl_create_data_size(20,30,1); -b = mgl_create_data_size(20,30,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_box(gr,1) -call mgl_set_light(gr,1); -call mgl_dew_2d(gr,a,b,'',0.) -call mgl_delete_data(a) -call mgl_delete_data(b) -@end verbatim -@strong{Python} -@verbatim -a, b = mglData(20,30), mglData(20,30); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Light(True); gr.Box(); -gr.Dew(a,b); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Surf3C sample, Surf3A sample, Dew sample, Dual plotting samples @@ -4048,16 +2731,16 @@ gr.Dew(a,b); @c @caption{Example of Surf3C. @tdref{surf3c}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(60,50,40), b(60,50,40); a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); b.Modify("1-2*tanh(4*(x+y-1)^2)"); -gr->Rotate(40,60); -gr->Light(true); -gr->Alpha(true); -gr->Box(); -gr->Surf3C(a, b); +gr.Rotate(40,60); +gr.Light(true); +gr.Alpha(true); +gr.Box(); +gr.Surf3C(a, b); @end verbatim @strong{MGL code} @end ifclear @@ -4073,7 +2756,7 @@ box surf3c a b @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(60,50,40); HMDT b = mgl_create_data_size(60,50,40); @@ -4086,30 +2769,6 @@ mgl_box(gr,1); mgl_surf3c(gr,a,b,0,3); mgl_delete_data(a); mgl_delete_data(b); @end verbatim -@strong{Fortran code} -@verbatim -integer a,b, mgl_create_data_size -a = mgl_create_data_size(60,50,40); -b = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_data_modify(b,"1-2*tanh(4*(x+y-1)^2)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_set_alpha(gr,1) -call mgl_box(gr,1) -call mgl_surf3c(gr,a,b,'',3) -call mgl_delete_data(a) -call mgl_delete_data(b) -@end verbatim -@strong{Python} -@verbatim -a, b = mglData(60,50,40), mglData(60,50,40); -a.Modify("-2*((2*x-1)^2+(2*y-1)^2+(2*z-1)^4-(2*z-1)^2-0.1)"); -b.Modify("1-2*tanh(4*(x+y-1)^2)"); -gr.Rotate(40,60); gr.Light(True); gr.Alpha(True); -gr.Box(); -gr.Surf3C(a,b); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Surf3A sample, Vect 3D sample, Surf3C sample, Dual plotting samples @@ -4120,16 +2779,16 @@ gr.Surf3C(a,b); @c @caption{Example of Surf3A. @tdref{surf3a}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(60,50,40), b(60,50,40); a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); b.Modify("1-2*tanh(4*(x+y-1)^2)"); -gr->Rotate(40,60); -gr->Light(true); -gr->Alpha(true); -gr->Box(); -gr->Surf3A(a, b); +gr.Rotate(40,60); +gr.Light(true); +gr.Alpha(true); +gr.Box(); +gr.Surf3A(a, b); @end verbatim @strong{MGL code} @end ifclear @@ -4145,7 +2804,7 @@ box surf3a a b @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a, b; a = mgl_create_data_size(60,50,40); b = mgl_create_data_size(60,50,40); @@ -4158,30 +2817,6 @@ mgl_box(gr,1); mgl_surf3a(gr,a,b,0,3); mgl_delete_data(a); mgl_delete_data(b); @end verbatim -@strong{Fortran code} -@verbatim -integer a,b, mgl_create_data_size -a = mgl_create_data_size(60,50,40); -b = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_data_modify(b,"1-2*tanh(4*(x+y-1)^2)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_set_alpha(gr,1) -call mgl_box(gr,1) -call mgl_surf3a(gr,a,b,'',3) -call mgl_delete_data(a) -call mgl_delete_data(b) -@end verbatim -@strong{Python} -@verbatim -a, b = mglData(60,50,40), mglData(60,50,40); -a.Modify("-2*((2*x-1)^2+(2*y-1)^2+(2*z-1)^4-(2*z-1)^2-0.1)"); -b.Modify("1-2*tanh(4*(x+y-1)^2)"); -gr.Rotate(40,60); gr.Light(True); gr.Alpha(True); -gr.Box(); -gr.Surf3A(a,b); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Vect 3D sample, VectL 3D sample, Surf3A sample, Dual plotting samples @@ -4192,18 +2827,18 @@ gr.Surf3A(a,b); @c @caption{Example of Vect in 3D. @tdref{vect3}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData ex(10,10,10), ey(10,10,10), ez(10,10,10); ex.Fill("0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); + 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); ey.Fill("0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); + 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); ez.Fill("0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); -gr->Rotate(40,60); -gr->Box(); -gr->Vect(ex, ey, ez, "bwr"); + 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); +gr.Rotate(40,60); +gr.Box(); +gr.Vect(ex, ey, ez, "bwr"); @end verbatim @strong{MGL code} @end ifclear @@ -4219,7 +2854,7 @@ box vect ex ey ez 'bwr' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT ex, ey, ez; ex = mgl_create_data_size(10,10,10); @@ -4236,37 +2871,6 @@ mgl_box(gr,1); mgl_vect_3d(gr,ex,ey,ez,"bwr"); mgl_delete_data(ex); mgl_delete_data(ey); mgl_delete_data(ez); @end verbatim -@strong{Fortran code} -@verbatim -integer ex,ey,ez, mgl_create_data_size -ex = mgl_create_data_size(10,10,10) -ey = mgl_create_data_size(10,10,10) -ez = mgl_create_data_size(10,10,10) -call mgl_data_fill_eq(gr, ex, '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_data_fill_eq(gr, ey, '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_data_fill_eq(gr, ez, '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_box(gr,1); -call mgl_vect_3d(gr,ex,ey,ez,'bwr') -call mgl_delete_data(ex) -call mgl_delete_data(ey) -call mgl_delete_data(ez) -@end verbatim -@strong{Python} -@verbatim -ex, ey, ez = mglData(10,10,10), mglData(10,10,10), mglData(10,10,10); -gr.Fill(ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Fill(ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Fill(ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Rotate(40,60); gr.Box(); -gr.Vect(ex,ey,ez,"bwr"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node VectL 3D sample, VectC 3D sample, Vect 3D sample, Dual plotting samples @@ -4277,18 +2881,18 @@ gr.Vect(ex,ey,ez,"bwr"); @c @caption{Example of VectL in 3D. @tdref{vectl3}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData ex(10,10,10), ey(10,10,10), ez(10,10,10); ex.Fill("0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); + 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); ey.Fill("0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); + 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); ez.Fill("0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); -gr->Rotate(40,60); -gr->Box(); -gr->VectL(ex, ey, ez, "bwr"); + 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); +gr.Rotate(40,60); +gr.Box(); +gr.VectL(ex, ey, ez, "bwr"); @end verbatim @strong{MGL code} @end ifclear @@ -4304,7 +2908,7 @@ box vectl ex ey ez 'bwr' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT ex, ey, ez; ex = mgl_create_data_size(10,10,10); @@ -4321,37 +2925,6 @@ mgl_box(gr,1); mgl_vectl_3d(gr,ex,ey,ez,"bwr"); mgl_delete_data(ex); mgl_delete_data(ey); mgl_delete_data(ez); @end verbatim -@strong{Fortran code} -@verbatim -integer ex,ey,ez, mgl_create_data_size -ex = mgl_create_data_size(10,10,10) -ey = mgl_create_data_size(10,10,10) -ez = mgl_create_data_size(10,10,10) -call mgl_data_fill_eq(gr, ex, '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_data_fill_eq(gr, ey, '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_data_fill_eq(gr, ez, '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_box(gr,1); -call mgl_vectl_3d(gr,ex,ey,ez,'bwr') -call mgl_delete_data(ex) -call mgl_delete_data(ey) -call mgl_delete_data(ez) -@end verbatim -@strong{Python} -@verbatim -ex, ey, ez = mglData(10,10,10), mglData(10,10,10), mglData(10,10,10); -gr.Fill(ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Fill(ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Fill(ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Rotate(40,60); gr.Box(); -gr.VectL(ex,ey,ez,"bwr"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node VectC 3D sample, Flow 3D sample, VectL 3D sample, Dual plotting samples @@ -4362,18 +2935,18 @@ gr.VectL(ex,ey,ez,"bwr"); @c @caption{Example of VectC in 3D. @tdref{vectc3}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData ex(10,10,10), ey(10,10,10), ez(10,10,10); ex.Fill("0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); + 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); ey.Fill("0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); + 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); ez.Fill("0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); -gr->Rotate(40,60); -gr->Box(); -gr->VectC(ex, ey, ez, "bwr"); + 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); +gr.Rotate(40,60); +gr.Box(); +gr.VectC(ex, ey, ez, "bwr"); @end verbatim @strong{MGL code} @end ifclear @@ -4389,7 +2962,7 @@ box vectc ex ey ez 'bwr' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT ex, ey, ez; ex = mgl_create_data_size(10,10,10); @@ -4406,37 +2979,6 @@ mgl_box(gr,1); mgl_vectc_3d(gr,ex,ey,ez,"bwr"); mgl_delete_data(ex); mgl_delete_data(ey); mgl_delete_data(ez); @end verbatim -@strong{Fortran code} -@verbatim -integer ex,ey,ez, mgl_create_data_size -ex = mgl_create_data_size(10,10,10) -ey = mgl_create_data_size(10,10,10) -ez = mgl_create_data_size(10,10,10) -call mgl_data_fill_eq(gr, ex, '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_data_fill_eq(gr, ey, '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_data_fill_eq(gr, ez, '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_box(gr,1); -call mgl_vectc_3d(gr,ex,ey,ez,'bwr') -call mgl_delete_data(ex) -call mgl_delete_data(ey) -call mgl_delete_data(ez) -@end verbatim -@strong{Python} -@verbatim -ex, ey, ez = mglData(10,10,10), mglData(10,10,10), mglData(10,10,10); -gr.Fill(ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Fill(ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Fill(ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Rotate(40,60); gr.Box(); -gr.VectC(ex,ey,ez,"bwr"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Flow 3D sample, Pipe 3D sample, VectC 3D sample, Dual plotting samples @@ -4447,18 +2989,18 @@ gr.VectC(ex,ey,ez,"bwr"); @c @caption{Example of Flow in 3D. @tdref{flow3}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData ex(30,30,30), ey(30,30,30), ez(30,30,30); ex.Fill("0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); + 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); ey.Fill("0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); + 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); ez.Fill("0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); -gr->Rotate(40,60); -gr->Box(); -gr->Flow(ex, ey, ez, "bwr"); + 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); +gr.Rotate(40,60); +gr.Box(); +gr.Flow(ex, ey, ez, "bwr"); @end verbatim @strong{MGL code} @end ifclear @@ -4474,7 +3016,7 @@ box flow ex ey ez 'bwr' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT ex, ey, ez; ex = mgl_create_data_size(30,30,30); @@ -4491,37 +3033,6 @@ mgl_box(gr,1); mgl_flow_3d(gr,ex,ey,ez,"bwr",3,1); mgl_delete_data(ex); mgl_delete_data(ey); mgl_delete_data(ez); @end verbatim -@strong{Fortran code} -@verbatim -integer ex,ey,ez, mgl_create_data_size -ex = mgl_create_data_size(30,30,30) -ey = mgl_create_data_size(30,30,30) -ez = mgl_create_data_size(30,30,30) -call mgl_data_fill_eq(gr, ex, '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_data_fill_eq(gr, ey, '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_data_fill_eq(gr, ez, '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_box(gr,1); -call mgl_flow_3d(gr,ex,ey,ez,'bwr',3,1) -call mgl_delete_data(ex) -call mgl_delete_data(ey) -call mgl_delete_data(ez) -@end verbatim -@strong{Python} -@verbatim -ex, ey, ez = mglData(10,10,10), mglData(10,10,10), mglData(10,10,10); -gr.Fill(ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Fill(ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Fill(ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Rotate(40,60); gr.Box(); -gr.Flow(ex,ey,ez,"bwr"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Pipe 3D sample, Crust sample, Flow 3D sample, Dual plotting samples @@ -4532,19 +3043,19 @@ gr.Flow(ex,ey,ez,"bwr"); @c @caption{Example of Pipe in 3D. @tdref{pipe3}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData ex(10,10,10), ey(10,10,10), ez(10,10,10); ex.Fill("0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); + 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); ey.Fill("0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); + 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); ez.Fill("0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr->Min, gr->Max); -gr->Rotate(40,60); -gr->Light(true); -gr->Box(); -gr->Pipe(ex, ey, ez, "bwr"); + 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)", gr.Min, gr.Max); +gr.Rotate(40,60); +gr.Light(true); +gr.Box(); +gr.Pipe(ex, ey, ez, "bwr"); @end verbatim @strong{MGL code} @end ifclear @@ -4561,7 +3072,7 @@ box pipe ex ey ez 'bwr' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT ex, ey, ez; ex = mgl_create_data_size(10,10,10); @@ -4579,38 +3090,6 @@ mgl_box(gr,1); mgl_pipe_3d(gr,ex,ey,ez,"bwr",0.05,3,1); mgl_delete_data(ex); mgl_delete_data(ey); mgl_delete_data(ez); @end verbatim -@strong{Fortran code} -@verbatim -integer ex,ey,ez, mgl_create_data_size -ex = mgl_create_data_size(10,10,10) -ey = mgl_create_data_size(10,10,10) -ez = mgl_create_data_size(10,10,10) -call mgl_data_fill_eq(gr, ex, '0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_data_fill_eq(gr, ey, '0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_data_fill_eq(gr, ez, '0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - & - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)',0,0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1); -call mgl_box(gr,1); -call mgl_pipe_3d(gr,ex,ey,ez,'bwr',0.05,3,1) -call mgl_delete_data(ex) -call mgl_delete_data(ey) -call mgl_delete_data(ez) -@end verbatim -@strong{Python} -@verbatim -ex, ey, ez = mglData(10,10,10), mglData(10,10,10), mglData(10,10,10); -gr.Fill(ex, "0.2*x/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*x/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Fill(ey, "0.2*y/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*y/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Fill(ez, "0.2*(z-0.3)/pow(x^2+y^2+(z-0.3)^2,1.5) - \ - 0.2*(z+0.3)/pow(x^2+y^2+(z+0.3)^2,1.5)"); -gr.Rotate(40,60); gr.Light(True); gr.Box(); -gr.Pipe(ex,ey,ez,"bwr"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Crust sample, Dots sample, Pipe 3D sample, Dual plotting samples @@ -4621,14 +3100,14 @@ gr.Pipe(ex,ey,ez,"bwr"); @c @caption{Example of Crust. @tdref{crust}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a("hotdogs.pts"); a.Norm(-1,1,true); -gr->Rotate(40,60); -gr->Light(true); -gr->Box(); -gr->Crust(a,"p"); +gr.Rotate(40,60); +gr.Light(true); +gr.Box(); +gr.Crust(a,"p"); @end verbatim @strong{MGL code} @end ifclear @@ -4641,7 +3120,7 @@ box crust a 'p' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_file("hotdogs.pts"); mgl_data_norm(a,-1.,1.,1,0); @@ -4651,25 +3130,6 @@ mgl_box(gr,1); mgl_crust_tr(gr,a,"p",0.); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_file -a = mgl_create_data_file("hotdogs.pts") -call mgl_data_norm(a,-1.,1.,1,0) -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_box(gr,1) -call mgl_crust_tr(gr,a,"p",0.) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData("hotdogs.pts"); -a.Norm(-1,1,True); -gr.Rotate(40,60); gr.Light(True); -gr.Box(); -gr.Crust(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Dots sample, , Crust sample, Dual plotting samples @@ -4680,13 +3140,13 @@ gr.Crust(a); @c @caption{Example of Dots. @tdref{dots}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a("hotdogs.pts"); a.Norm(-1,1,true); -gr->Rotate(40,60); -gr->Box(); -gr->Dots(a,"p"); +gr.Rotate(40,60); +gr.Box(); +gr.Dots(a,"p"); @end verbatim @strong{MGL code} @end ifclear @@ -4698,7 +3158,7 @@ box dots a 'p' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_file("hotdogs.pts"); mgl_data_norm(a,-1.,1.,1,0); @@ -4707,24 +3167,6 @@ mgl_box(gr,1); mgl_dots_tr(gr,a,"p"); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_file -a = mgl_create_data_file("hotdogs.pts") -call mgl_data_norm(a,-1.,1.,1,0) -call mgl_rotate(gr,40.,60.,0.) -call mgl_box(gr,1) -call mgl_dots_tr(gr,a,"p") -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData("hotdogs.pts"); -a.Norm(-1,1,True); -gr.Rotate(40,60); gr.Light(True); -gr.Box(); -gr.Dots(a); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @@ -4757,32 +3199,32 @@ gr.Dots(a); @c @caption{Example of Legend usage. @tdref{legend}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y0(50); y0.Modify("sin(pi*(2*x-1))"); -gr->SubPlot(2,2,0); -gr->Plot(y0); gr->Box(); +gr.SubPlot(2,2,0); +gr.Plot(y0); gr.Box(); -gr->SubPlot(2,2,1); +gr.SubPlot(2,2,1); mglData y1(50,2); y1.Modify("sin(pi*2*x-pi)"); y1.Modify("cos(pi*2*x-pi)/2",1); -gr->Plot(y1); gr->Box(); +gr.Plot(y1); gr.Box(); mglData x(50); x.Modify("cos(pi*2*x-pi)"); -gr->Plot(x,y0,"Y+"); +gr.Plot(x,y0,"Y+"); -gr->Plot(y1.SubData(-1,0),y1.SubData(-1,1),"q|"); +gr.Plot(y1.SubData(-1,0),y1.SubData(-1,1),"q|"); -gr->SubPlot(2,2,2); gr->Rotate(60,40); +gr.SubPlot(2,2,2); gr.Rotate(60,40); mglData z(50); z.Modify("2*x-1"); -gr->Plot(x,y0,z); gr->Box(); +gr.Plot(x,y0,z); gr.Box(); mglData y2(10,3); y2.Modify("cos(pi*(2*x-1-y))"); y2.Modify("2*x-1",2); -gr->Plot(y2.SubData(-1,0),y2.SubData(-1,1),y2.SubData(-1,2),"bo "); +gr.Plot(y2.SubData(-1,0),y2.SubData(-1,1),y2.SubData(-1,2),"bo "); -gr->SubPlot(2,2,3); gr->Rotate(60,40); -gr->Bars(x,y0,z,"ri"); gr->Box(); +gr.SubPlot(2,2,3); gr.Rotate(60,40); +gr.Bars(x,y0,z,"ri"); gr.Box(); @end verbatim @strong{MGL code} @end ifclear @@ -4823,31 +3265,31 @@ bars x y0 z 'r':box @c @caption{Example of Legend usage. @tdref{legend}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim -gr->Light(true); +gr.Light(true); mglData a0(50,40); a0.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->SubPlot(2,2,0); gr->Rotate(60,40); -gr->Surf(a0); gr->Box(); +gr.SubPlot(2,2,0); gr.Rotate(60,40); +gr.Surf(a0); gr.Box(); mglData x(50,40),y(50,40),z(50,40); x.Modify("0.8*sin(2*pi*x)*sin(pi*y)"); y.Modify("0.8*cos(2*pi*x)*sin(pi*y)"); z.Modify("0.8*cos(pi*y)"); -gr->SubPlot(2,2,1); gr->Rotate(60,40); -gr->Surf(x,y,z,"BbwrR"); gr->Box(); +gr.SubPlot(2,2,1); gr.Rotate(60,40); +gr.Surf(x,y,z,"BbwrR"); gr.Box(); mglData a1(50,40,3); a1.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); a1.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*sin(3*pi*(x*y))",1); a1.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",2); -gr->SubPlot(2,2,2); gr->Rotate(60,40); -gr->Alpha(true); -gr->Surf(a1); gr->Box(); +gr.SubPlot(2,2,2); gr.Rotate(60,40); +gr.Alpha(true); +gr.Surf(a1); gr.Box(); -gr->SubPlot(2,2,3); gr->Rotate(60,40); -gr->Dens(a1); gr->Box(); +gr.SubPlot(2,2,3); gr.Rotate(60,40); +gr.Dens(a1); gr.Box(); @end verbatim @strong{MGL code} @end ifclear @@ -4888,22 +3330,22 @@ dens a1: box @c @caption{Example of Legend usage. @tdref{legend}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim -gr->Alpha(true); gr->Light(true); gr->Light(0,mglPoint(0,0,1)); +gr.Alpha(true); gr.Light(true); gr.Light(0,mglPoint(0,0,1)); mglData a(30,30,30), b(30,30,30); a.Modify("exp(-16*((z-0.5)^2+(y-0.5)^2)/(1+4*x^2))"); b.Modify("16*((z-0.5)^2+(y-0.5)^2)*(x)/(1+4*x^2)"); -gr->CAxis(0,1); +gr.CAxis(0,1); -gr->SubPlot(2,2,0); gr->Rotate(40,60); -gr->Surf3(a,"wgk"); gr->Box(); -gr->SubPlot(2,2,1); gr->Rotate(40,60); -gr->DensA(a); gr->Box(); gr->Axis(); -gr->SubPlot(2,2,2); gr->Rotate(40,60); -gr->Cloud(a); gr->Box(); -gr->SubPlot(2,2,3); gr->Rotate(40,60); -gr->Surf3A(b,a,"q"); gr->Box(); +gr.SubPlot(2,2,0); gr.Rotate(40,60); +gr.Surf3(a,"wgk"); gr.Box(); +gr.SubPlot(2,2,1); gr.Rotate(40,60); +gr.DensA(a); gr.Box(); gr.Axis(); +gr.SubPlot(2,2,2); gr.Rotate(40,60); +gr.Cloud(a); gr.Box(); +gr.SubPlot(2,2,3); gr.Rotate(40,60); +gr.Surf3A(b,a,"q"); gr.Box(); @end verbatim @strong{MGL code} @end ifclear @@ -4934,49 +3376,49 @@ surf3a b a 'q': box @c @caption{Example of Legend usage. @tdref{legend}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim float d,x1,x2,x0,y=0.95; d=0.3, x0=0.2, x1=0.5, x2=0.6; -gr->Line(mglPoint(x0,1-0*d),mglPoint(x1,1-0*d),"k-"); gr->Puts(mglPoint(x2,y-0*d),"Solid '-'","rL"); -gr->Line(mglPoint(x0,1-1*d),mglPoint(x1,1-1*d),"k|"); gr->Puts(mglPoint(x2,y-1*d),"Long Dash '|'","rL"); -gr->Line(mglPoint(x0,1-2*d),mglPoint(x1,1-2*d),"k;"); gr->Puts(mglPoint(x2,y-2*d),"Dash ';'","rL"); -gr->Line(mglPoint(x0,1-3*d),mglPoint(x1,1-3*d),"k="); gr->Puts(mglPoint(x2,y-3*d),"Small dash '='","rL"); -gr->Line(mglPoint(x0,1-4*d),mglPoint(x1,1-4*d),"kj"); gr->Puts(mglPoint(x2,y-4*d),"Dash-dot 'j'","rL"); -gr->Line(mglPoint(x0,1-5*d),mglPoint(x1,1-5*d),"ki"); gr->Puts(mglPoint(x2,y-5*d),"Small dash-dot 'i'","rL"); -gr->Line(mglPoint(x0,1-6*d),mglPoint(x1,1-6*d),"k:"); gr->Puts(mglPoint(x2,y-6*d),"Dots ':'","rL"); -gr->Line(mglPoint(x0,1-7*d),mglPoint(x1,1-7*d),"k "); gr->Puts(mglPoint(x2,y-7*d),"None ' '","rL"); +gr.Line(mglPoint(x0,1-0*d),mglPoint(x1,1-0*d),"k-"); gr.Puts(mglPoint(x2,y-0*d),"Solid '-'","rL"); +gr.Line(mglPoint(x0,1-1*d),mglPoint(x1,1-1*d),"k|"); gr.Puts(mglPoint(x2,y-1*d),"Long Dash '|'","rL"); +gr.Line(mglPoint(x0,1-2*d),mglPoint(x1,1-2*d),"k;"); gr.Puts(mglPoint(x2,y-2*d),"Dash ';'","rL"); +gr.Line(mglPoint(x0,1-3*d),mglPoint(x1,1-3*d),"k="); gr.Puts(mglPoint(x2,y-3*d),"Small dash '='","rL"); +gr.Line(mglPoint(x0,1-4*d),mglPoint(x1,1-4*d),"kj"); gr.Puts(mglPoint(x2,y-4*d),"Dash-dot 'j'","rL"); +gr.Line(mglPoint(x0,1-5*d),mglPoint(x1,1-5*d),"ki"); gr.Puts(mglPoint(x2,y-5*d),"Small dash-dot 'i'","rL"); +gr.Line(mglPoint(x0,1-6*d),mglPoint(x1,1-6*d),"k:"); gr.Puts(mglPoint(x2,y-6*d),"Dots ':'","rL"); +gr.Line(mglPoint(x0,1-7*d),mglPoint(x1,1-7*d),"k "); gr.Puts(mglPoint(x2,y-7*d),"None ' '","rL"); d=0.25; x1=-1; x0=-0.8; y = -0.05; -gr->Mark(mglPoint(x1,5*d),'.'); gr->Puts(mglPoint(x0,y+5*d),"'.'","rL"); -gr->Mark(mglPoint(x1,4*d),'+'); gr->Puts(mglPoint(x0,y+4*d),"'+'","rL"); -gr->Mark(mglPoint(x1,3*d),'x'); gr->Puts(mglPoint(x0,y+3*d),"'x'","rL"); -gr->Mark(mglPoint(x1,2*d),'*'); gr->Puts(mglPoint(x0,y+2*d),"'*'","rL"); -gr->Mark(mglPoint(x1,d),'s'); gr->Puts(mglPoint(x0,y+d),"'s'","rL"); -gr->Mark(mglPoint(x1,0),'d'); gr->Puts(mglPoint(x0,y),"'d'","rL"); -gr->Mark(mglPoint(x1,-d,0),'o'); gr->Puts(mglPoint(x0,y-d),"'o'","rL"); -gr->Mark(mglPoint(x1,-2*d,0),'^'); gr->Puts(mglPoint(x0,y-2*d),"'\\^'","rL"); -gr->Mark(mglPoint(x1,-3*d,0),'v'); gr->Puts(mglPoint(x0,y-3*d),"'v'","rL"); -gr->Mark(mglPoint(x1,-4*d,0),'<'); gr->Puts(mglPoint(x0,y-4*d),"'<'","rL"); -gr->Mark(mglPoint(x1,-5*d,0),'>'); gr->Puts(mglPoint(x0,y-5*d),"'>'","rL"); +gr.Mark(mglPoint(x1,5*d),'.'); gr.Puts(mglPoint(x0,y+5*d),"'.'","rL"); +gr.Mark(mglPoint(x1,4*d),'+'); gr.Puts(mglPoint(x0,y+4*d),"'+'","rL"); +gr.Mark(mglPoint(x1,3*d),'x'); gr.Puts(mglPoint(x0,y+3*d),"'x'","rL"); +gr.Mark(mglPoint(x1,2*d),'*'); gr.Puts(mglPoint(x0,y+2*d),"'*'","rL"); +gr.Mark(mglPoint(x1,d),'s'); gr.Puts(mglPoint(x0,y+d),"'s'","rL"); +gr.Mark(mglPoint(x1,0),'d'); gr.Puts(mglPoint(x0,y),"'d'","rL"); +gr.Mark(mglPoint(x1,-d,0),'o'); gr.Puts(mglPoint(x0,y-d),"'o'","rL"); +gr.Mark(mglPoint(x1,-2*d,0),'^'); gr.Puts(mglPoint(x0,y-2*d),"'\\^'","rL"); +gr.Mark(mglPoint(x1,-3*d,0),'v'); gr.Puts(mglPoint(x0,y-3*d),"'v'","rL"); +gr.Mark(mglPoint(x1,-4*d,0),'<'); gr.Puts(mglPoint(x0,y-4*d),"'<'","rL"); +gr.Mark(mglPoint(x1,-5*d,0),'>'); gr.Puts(mglPoint(x0,y-5*d),"'>'","rL"); d=0.25; x1=-0.5; x0=-0.3; y = -0.05; -gr->Mark(mglPoint(x1,5*d),'C'); gr->Puts(mglPoint(x0,y+5*d),"'\\#.'","rL"); -gr->Mark(mglPoint(x1,4*d),'P'); gr->Puts(mglPoint(x0,y+4*d),"'\\#+'","rL"); -gr->Mark(mglPoint(x1,3*d),'X'); gr->Puts(mglPoint(x0,y+3*d),"'\\#x'","rL"); -gr->Mark(mglPoint(x1,2*d),'Y'); gr->Puts(mglPoint(x0,y+2*d),"'\\#*'","rL"); -gr->Mark(mglPoint(x1,d),'S'); gr->Puts(mglPoint(x0,y+d),"'\\#s'","rL"); -gr->Mark(mglPoint(x1,0),'D'); gr->Puts(mglPoint(x0,y),"'\\#d'","rL"); -gr->Mark(mglPoint(x1,-d,0),'O'); gr->Puts(mglPoint(x0,y-d),"'\\#o'","rL"); -gr->Mark(mglPoint(x1,-2*d,0),'T'); gr->Puts(mglPoint(x0,y-2*d),"'\\#\\^'","rL"); -gr->Mark(mglPoint(x1,-3*d,0),'V'); gr->Puts(mglPoint(x0,y-3*d),"'\\#v'","rL"); -gr->Mark(mglPoint(x1,-4*d,0),'L'); gr->Puts(mglPoint(x0,y-4*d),"'\\#<'","rL"); -gr->Mark(mglPoint(x1,-5*d,0),'R'); gr->Puts(mglPoint(x0,y-5*d),"'\\#>'","rL"); +gr.Mark(mglPoint(x1,5*d),'C'); gr.Puts(mglPoint(x0,y+5*d),"'\\#.'","rL"); +gr.Mark(mglPoint(x1,4*d),'P'); gr.Puts(mglPoint(x0,y+4*d),"'\\#+'","rL"); +gr.Mark(mglPoint(x1,3*d),'X'); gr.Puts(mglPoint(x0,y+3*d),"'\\#x'","rL"); +gr.Mark(mglPoint(x1,2*d),'Y'); gr.Puts(mglPoint(x0,y+2*d),"'\\#*'","rL"); +gr.Mark(mglPoint(x1,d),'S'); gr.Puts(mglPoint(x0,y+d),"'\\#s'","rL"); +gr.Mark(mglPoint(x1,0),'D'); gr.Puts(mglPoint(x0,y),"'\\#d'","rL"); +gr.Mark(mglPoint(x1,-d,0),'O'); gr.Puts(mglPoint(x0,y-d),"'\\#o'","rL"); +gr.Mark(mglPoint(x1,-2*d,0),'T'); gr.Puts(mglPoint(x0,y-2*d),"'\\#\\^'","rL"); +gr.Mark(mglPoint(x1,-3*d,0),'V'); gr.Puts(mglPoint(x0,y-3*d),"'\\#v'","rL"); +gr.Mark(mglPoint(x1,-4*d,0),'L'); gr.Puts(mglPoint(x0,y-4*d),"'\\#<'","rL"); +gr.Mark(mglPoint(x1,-5*d,0),'R'); gr.Puts(mglPoint(x0,y-5*d),"'\\#>'","rL"); @end verbatim @strong{MGL code} @end ifclear @verbatim -NOT AVAILABLE +TO BE DONE @end verbatim @c ------------------------------------------------------------------ @node Arrow styles sample, Text styles sample, Line styles sample, Basic features @@ -4987,38 +3429,38 @@ NOT AVAILABLE @c @caption{Example of Legend usage. @tdref{legend}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim float a=0.1,b=0.4,c=0.5; -gr->Line(mglPoint(a,1),mglPoint(b,1),"k-A"); gr->Puts(mglPoint(c,1),"Style 'A' or 'A\\_'","rL"); -gr->Line(mglPoint(a,0.8),mglPoint(b,0.8),"k-V"); gr->Puts(mglPoint(c,0.8),"Style 'V' or 'V\\_'","rL"); -gr->Line(mglPoint(a,0.6),mglPoint(b,0.6),"k-K"); gr->Puts(mglPoint(c,0.6),"Style 'K' or 'K\\_'","rL"); -gr->Line(mglPoint(a,0.4),mglPoint(b,0.4),"k-I"); gr->Puts(mglPoint(c,0.4),"Style 'I' or 'I\\_'","rL"); -gr->Line(mglPoint(a,0.2),mglPoint(b,0.2),"k-D"); gr->Puts(mglPoint(c,0.2),"Style 'D' or 'D\\_'","rL"); -gr->Line(mglPoint(a,0),mglPoint(b,0),"k-S"); gr->Puts(mglPoint(c,0),"Style 'S' or 'S\\_'","rL"); -gr->Line(mglPoint(a,-0.2),mglPoint(b,-0.2),"k-O"); gr->Puts(mglPoint(c,-0.2),"Style 'O' or 'O\\_'","rL"); -gr->Line(mglPoint(a,-0.4),mglPoint(b,-0.4),"k-T"); gr->Puts(mglPoint(c,-0.4),"Style 'T' or 'T\\_'","rL"); -gr->Line(mglPoint(a,-0.6),mglPoint(b,-0.6),"k-_"); gr->Puts(mglPoint(c,-0.6),"Style '\\_' or none","rL"); -gr->Line(mglPoint(a,-0.8),mglPoint(b,-0.8),"k-AS"); gr->Puts(mglPoint(c,-0.8),"Style 'AS'","rL"); -gr->Line(mglPoint(a,-1),mglPoint(b,-1),"k-_A"); gr->Puts(mglPoint(c,-1),"Style '\\_A'","rL"); +gr.Line(mglPoint(a,1),mglPoint(b,1),"k-A"); gr.Puts(mglPoint(c,1),"Style 'A' or 'A\\_'","rL"); +gr.Line(mglPoint(a,0.8),mglPoint(b,0.8),"k-V"); gr.Puts(mglPoint(c,0.8),"Style 'V' or 'V\\_'","rL"); +gr.Line(mglPoint(a,0.6),mglPoint(b,0.6),"k-K"); gr.Puts(mglPoint(c,0.6),"Style 'K' or 'K\\_'","rL"); +gr.Line(mglPoint(a,0.4),mglPoint(b,0.4),"k-I"); gr.Puts(mglPoint(c,0.4),"Style 'I' or 'I\\_'","rL"); +gr.Line(mglPoint(a,0.2),mglPoint(b,0.2),"k-D"); gr.Puts(mglPoint(c,0.2),"Style 'D' or 'D\\_'","rL"); +gr.Line(mglPoint(a,0),mglPoint(b,0),"k-S"); gr.Puts(mglPoint(c,0),"Style 'S' or 'S\\_'","rL"); +gr.Line(mglPoint(a,-0.2),mglPoint(b,-0.2),"k-O"); gr.Puts(mglPoint(c,-0.2),"Style 'O' or 'O\\_'","rL"); +gr.Line(mglPoint(a,-0.4),mglPoint(b,-0.4),"k-T"); gr.Puts(mglPoint(c,-0.4),"Style 'T' or 'T\\_'","rL"); +gr.Line(mglPoint(a,-0.6),mglPoint(b,-0.6),"k-_"); gr.Puts(mglPoint(c,-0.6),"Style '\\_' or none","rL"); +gr.Line(mglPoint(a,-0.8),mglPoint(b,-0.8),"k-AS"); gr.Puts(mglPoint(c,-0.8),"Style 'AS'","rL"); +gr.Line(mglPoint(a,-1),mglPoint(b,-1),"k-_A"); gr.Puts(mglPoint(c,-1),"Style '\\_A'","rL"); a=-1; b=-0.7; c=-0.6; -gr->Line(mglPoint(a,1),mglPoint(b,1),"kAA"); gr->Puts(mglPoint(c,1),"Style 'AA'","rL"); -gr->Line(mglPoint(a,0.8),mglPoint(b,0.8),"kVV"); gr->Puts(mglPoint(c,0.8),"Style 'VV'","rL"); -gr->Line(mglPoint(a,0.6),mglPoint(b,0.6),"kKK"); gr->Puts(mglPoint(c,0.6),"Style 'KK'","rL"); -gr->Line(mglPoint(a,0.4),mglPoint(b,0.4),"kII"); gr->Puts(mglPoint(c,0.4),"Style 'II'","rL"); -gr->Line(mglPoint(a,0.2),mglPoint(b,0.2),"kDD"); gr->Puts(mglPoint(c,0.2),"Style 'DD'","rL"); -gr->Line(mglPoint(a,0),mglPoint(b,0),"kSS"); gr->Puts(mglPoint(c,0),"Style 'SS'","rL"); -gr->Line(mglPoint(a,-0.2),mglPoint(b,-0.2),"kOO"); gr->Puts(mglPoint(c,-0.2),"Style 'OO'","rL"); -gr->Line(mglPoint(a,-0.4),mglPoint(b,-0.4),"kTT"); gr->Puts(mglPoint(c,-0.4),"Style 'TT'","rL"); -gr->Line(mglPoint(a,-0.6),mglPoint(b,-0.6),"k-__"); gr->Puts(mglPoint(c,-0.6),"Style '\\_\\_'","rL"); -gr->Line(mglPoint(a,-0.8),mglPoint(b,-0.8),"k-VA"); gr->Puts(mglPoint(c,-0.8),"Style 'VA'","rL"); -gr->Line(mglPoint(a,-1),mglPoint(b,-1),"k-AV"); gr->Puts(mglPoint(c,-1),"Style 'AV'","rL"); +gr.Line(mglPoint(a,1),mglPoint(b,1),"kAA"); gr.Puts(mglPoint(c,1),"Style 'AA'","rL"); +gr.Line(mglPoint(a,0.8),mglPoint(b,0.8),"kVV"); gr.Puts(mglPoint(c,0.8),"Style 'VV'","rL"); +gr.Line(mglPoint(a,0.6),mglPoint(b,0.6),"kKK"); gr.Puts(mglPoint(c,0.6),"Style 'KK'","rL"); +gr.Line(mglPoint(a,0.4),mglPoint(b,0.4),"kII"); gr.Puts(mglPoint(c,0.4),"Style 'II'","rL"); +gr.Line(mglPoint(a,0.2),mglPoint(b,0.2),"kDD"); gr.Puts(mglPoint(c,0.2),"Style 'DD'","rL"); +gr.Line(mglPoint(a,0),mglPoint(b,0),"kSS"); gr.Puts(mglPoint(c,0),"Style 'SS'","rL"); +gr.Line(mglPoint(a,-0.2),mglPoint(b,-0.2),"kOO"); gr.Puts(mglPoint(c,-0.2),"Style 'OO'","rL"); +gr.Line(mglPoint(a,-0.4),mglPoint(b,-0.4),"kTT"); gr.Puts(mglPoint(c,-0.4),"Style 'TT'","rL"); +gr.Line(mglPoint(a,-0.6),mglPoint(b,-0.6),"k-__"); gr.Puts(mglPoint(c,-0.6),"Style '\\_\\_'","rL"); +gr.Line(mglPoint(a,-0.8),mglPoint(b,-0.8),"k-VA"); gr.Puts(mglPoint(c,-0.8),"Style 'VA'","rL"); +gr.Line(mglPoint(a,-1),mglPoint(b,-1),"k-AV"); gr.Puts(mglPoint(c,-1),"Style 'AV'","rL"); @end verbatim @strong{MGL code} @end ifclear @verbatim -NOT AVAILABLE +TO BE DONE @end verbatim @c ------------------------------------------------------------------ @node Text styles sample, TeX parsing sample, Arrow styles sample, Basic features @@ -5029,16 +3471,16 @@ NOT AVAILABLE @c @caption{Example of Legend usage. @tdref{legend}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim -gr->Putsw(mglPoint(0,1),L"Text can be in ASCII and in Unicode"); -gr->Puts(mglPoint(0,0.6),"It can be \\wire{wire}, \\big{big} or #r{colored}"); -gr->Puts(mglPoint(0,0.2),"One can change style in string: " +gr.Putsw(mglPoint(0,1),L"Text can be in ASCII and in Unicode"); +gr.Puts(mglPoint(0,0.6),"It can be \\wire{wire}, \\big{big} or #r{colored}"); +gr.Puts(mglPoint(0,0.2),"One can change style in string: " "\\b{bold}, \\i{italic, \\b{both}}"); -gr->Puts(mglPoint(0,-0.2),"Easy to \\a{overline} or " +gr.Puts(mglPoint(0,-0.2),"Easy to \\a{overline} or " "\\u{underline}"); -gr->Puts(mglPoint(0,-0.6),"Easy to change indexes ^{up} _{down} @{center}"); -gr->Puts(mglPoint(0,-1),"It parse TeX: \\int \\alpha \\cdot " +gr.Puts(mglPoint(0,-0.6),"Easy to change indexes ^{up} _{down} @{center}"); +gr.Puts(mglPoint(0,-1),"It parse TeX: \\int \\alpha \\cdot " "\\sqrt3{sin(\\pi x)^2 + \\gamma_{i_k}} dx"); @end verbatim @strong{MGL code} @@ -5060,9 +3502,9 @@ text 0 -1 'It parse TeX: \int \alpha \cdot \sqrt3{sin(\pi x)^2 + \gamma_{i_k}} d @c @caption{Example of Legend usage. @tdref{legend}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim -gr->Puts(mglPoint(0), "\\sqrt{\\frac{\\alpha^{\\gamma^2}+" +gr.Puts(mglPoint(0), "\\sqrt{\\frac{\\alpha^{\\gamma^2}+" "\\overset 1{\\big\\infty}}{\\sqrt3{2+b}}}", 0, -4); @end verbatim @strong{MGL code} @@ -5079,19 +3521,19 @@ text 0 0 '\sqrt{\frac{\alpha^{\gamma^2}+\overset 1{\big\infty}}{\sqrt3{2+b}}}' ' @c @caption{Example of Legend usage. @tdref{legend}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim float h=1.1, d=0.25; -gr->LoadFont("STIX"); gr->Puts(mglPoint(0,h), "default font (STIX)"); -gr->LoadFont("adventor"); gr->Puts(mglPoint(0,h-d), "adventor font"); -gr->LoadFont("bonum"); gr->Puts(mglPoint(0,h-2*d), "bonum font"); -gr->LoadFont("chorus"); gr->Puts(mglPoint(0,h-3*d), "chorus font"); -gr->LoadFont("cursor"); gr->Puts(mglPoint(0,h-4*d), "cursor font"); -gr->LoadFont("heros"); gr->Puts(mglPoint(0,h-5*d), "heros font"); -gr->LoadFont("heroscn"); gr->Puts(mglPoint(0,h-6*d), "heroscn font"); -gr->LoadFont("pagella"); gr->Puts(mglPoint(0,h-7*d), "pagella font"); -gr->LoadFont("schola"); gr->Puts(mglPoint(0,h-8*d), "schola font"); -gr->LoadFont("termes"); gr->Puts(mglPoint(0,h-9*d), "termes font"); +gr.LoadFont("STIX"); gr.Puts(mglPoint(0,h), "default font (STIX)"); +gr.LoadFont("adventor"); gr.Puts(mglPoint(0,h-d), "adventor font"); +gr.LoadFont("bonum"); gr.Puts(mglPoint(0,h-2*d), "bonum font"); +gr.LoadFont("chorus"); gr.Puts(mglPoint(0,h-3*d), "chorus font"); +gr.LoadFont("cursor"); gr.Puts(mglPoint(0,h-4*d), "cursor font"); +gr.LoadFont("heros"); gr.Puts(mglPoint(0,h-5*d), "heros font"); +gr.LoadFont("heroscn"); gr.Puts(mglPoint(0,h-6*d), "heroscn font"); +gr.LoadFont("pagella"); gr.Puts(mglPoint(0,h-7*d), "pagella font"); +gr.LoadFont("schola"); gr.Puts(mglPoint(0,h-8*d), "schola font"); +gr.LoadFont("termes"); gr.Puts(mglPoint(0,h-9*d), "termes font"); @end verbatim @strong{MGL code} @end ifclear @@ -5106,50 +3548,50 @@ NOT AVAILABLE @c @caption{Example of Legend usage. @tdref{legend}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim //#LENUQ -gr->FaceZ(-1, -1, 0, 0.4, 0.3, "L#"); gr->Puts(mglPoint(-0.8,-0.9), "L", "C:w", -1.4); -gr->FaceZ(-0.6, -1, 0, 0.4, 0.3, "E#"); gr->Puts(mglPoint(-0.4,-0.9), "E", "C:w", -1.4); -gr->FaceZ(-0.2, -1, 0, 0.4, 0.3, "N#"); gr->Puts(mglPoint(0, -0.9), "N", "C:w", -1.4); -gr->FaceZ(0.2, -1, 0, 0.4, 0.3, "U#"); gr->Puts(mglPoint(0.4,-0.9), "U", "C:w", -1.4); -gr->FaceZ(0.6, -1, 0, 0.4, 0.3, "Q#"); gr->Puts(mglPoint(0.8,-0.9), "Q", "C:w", -1.4); +gr.FaceZ(-1, -1, 0, 0.4, 0.3, "L#"); gr.Puts(mglPoint(-0.8,-0.9), "L", "C:w", -1.4); +gr.FaceZ(-0.6, -1, 0, 0.4, 0.3, "E#"); gr.Puts(mglPoint(-0.4,-0.9), "E", "C:w", -1.4); +gr.FaceZ(-0.2, -1, 0, 0.4, 0.3, "N#"); gr.Puts(mglPoint(0, -0.9), "N", "C:w", -1.4); +gr.FaceZ(0.2, -1, 0, 0.4, 0.3, "U#"); gr.Puts(mglPoint(0.4,-0.9), "U", "C:w", -1.4); +gr.FaceZ(0.6, -1, 0, 0.4, 0.3, "Q#"); gr.Puts(mglPoint(0.8,-0.9), "Q", "C:w", -1.4); //#lenuq -gr->FaceZ(-1, -0.7, 0, 0.4, 0.3, "l#"); gr->Puts(mglPoint(-0.8,-0.6), "l", "C:k", -1.4); -gr->FaceZ(-0.6, -0.7, 0, 0.4, 0.3, "e#"); gr->Puts(mglPoint(-0.4,-0.6), "e", "C:k", -1.4); -gr->FaceZ(-0.2, -0.7, 0, 0.4, 0.3, "n#"); gr->Puts(mglPoint(0, -0.6), "n", "C:k", -1.4); -gr->FaceZ(0.2, -0.7, 0, 0.4, 0.3, "u#"); gr->Puts(mglPoint(0.4,-0.6), "u", "C:k", -1.4); -gr->FaceZ(0.6, -0.7, 0, 0.4, 0.3, "q#"); gr->Puts(mglPoint(0.8,-0.6), "q", "C:k", -1.4); +gr.FaceZ(-1, -0.7, 0, 0.4, 0.3, "l#"); gr.Puts(mglPoint(-0.8,-0.6), "l", "C:k", -1.4); +gr.FaceZ(-0.6, -0.7, 0, 0.4, 0.3, "e#"); gr.Puts(mglPoint(-0.4,-0.6), "e", "C:k", -1.4); +gr.FaceZ(-0.2, -0.7, 0, 0.4, 0.3, "n#"); gr.Puts(mglPoint(0, -0.6), "n", "C:k", -1.4); +gr.FaceZ(0.2, -0.7, 0, 0.4, 0.3, "u#"); gr.Puts(mglPoint(0.4,-0.6), "u", "C:k", -1.4); +gr.FaceZ(0.6, -0.7, 0, 0.4, 0.3, "q#"); gr.Puts(mglPoint(0.8,-0.6), "q", "C:k", -1.4); //#CMYkP -gr->FaceZ(-1, -0.4, 0, 0.4, 0.3, "C#"); gr->Puts(mglPoint(-0.8,-0.3), "C", "C:w", -1.4); -gr->FaceZ(-0.6, -0.4, 0, 0.4, 0.3, "M#"); gr->Puts(mglPoint(-0.4,-0.3), "M", "C:w", -1.4); -gr->FaceZ(-0.2, -0.4, 0, 0.4, 0.3, "Y#"); gr->Puts(mglPoint(0, -0.3), "Y", "C:w", -1.4); -gr->FaceZ(0.2, -0.4, 0, 0.4, 0.3, "k#"); gr->Puts(mglPoint(0.4,-0.3), "k", "C:w", -1.4); -gr->FaceZ(0.6, -0.4, 0, 0.4, 0.3, "P#"); gr->Puts(mglPoint(0.8,-0.3), "P", "C:w", -1.4); +gr.FaceZ(-1, -0.4, 0, 0.4, 0.3, "C#"); gr.Puts(mglPoint(-0.8,-0.3), "C", "C:w", -1.4); +gr.FaceZ(-0.6, -0.4, 0, 0.4, 0.3, "M#"); gr.Puts(mglPoint(-0.4,-0.3), "M", "C:w", -1.4); +gr.FaceZ(-0.2, -0.4, 0, 0.4, 0.3, "Y#"); gr.Puts(mglPoint(0, -0.3), "Y", "C:w", -1.4); +gr.FaceZ(0.2, -0.4, 0, 0.4, 0.3, "k#"); gr.Puts(mglPoint(0.4,-0.3), "k", "C:w", -1.4); +gr.FaceZ(0.6, -0.4, 0, 0.4, 0.3, "P#"); gr.Puts(mglPoint(0.8,-0.3), "P", "C:w", -1.4); //#cmywp -gr->FaceZ(-1, -0.1, 0, 0.4, 0.3, "c#"); gr->Puts(mglPoint(-0.8, 0), "c", "C:k", -1.4); -gr->FaceZ(-0.6, -0.1, 0, 0.4, 0.3, "m#"); gr->Puts(mglPoint(-0.4, 0), "m", "C:k", -1.4); -gr->FaceZ(-0.2, -0.1, 0, 0.4, 0.3, "y#"); gr->Puts(mglPoint(0, 0), "y", "C:k", -1.4); -gr->FaceZ(0.2, -0.1, 0, 0.4, 0.3, "w#"); gr->Puts(mglPoint(0.4, 0), "w", "C:k", -1.4); -gr->FaceZ(0.6, -0.1, 0, 0.4, 0.3, "p#"); gr->Puts(mglPoint(0.8, 0), "p", "C:k", -1.4); +gr.FaceZ(-1, -0.1, 0, 0.4, 0.3, "c#"); gr.Puts(mglPoint(-0.8, 0), "c", "C:k", -1.4); +gr.FaceZ(-0.6, -0.1, 0, 0.4, 0.3, "m#"); gr.Puts(mglPoint(-0.4, 0), "m", "C:k", -1.4); +gr.FaceZ(-0.2, -0.1, 0, 0.4, 0.3, "y#"); gr.Puts(mglPoint(0, 0), "y", "C:k", -1.4); +gr.FaceZ(0.2, -0.1, 0, 0.4, 0.3, "w#"); gr.Puts(mglPoint(0.4, 0), "w", "C:k", -1.4); +gr.FaceZ(0.6, -0.1, 0, 0.4, 0.3, "p#"); gr.Puts(mglPoint(0.8, 0), "p", "C:k", -1.4); //#BGRHW -gr->FaceZ(-1, 0.2, 0, 0.4, 0.3, "B#"); gr->Puts(mglPoint(-0.8, 0.3), "B", "C:w", -1.4); -gr->FaceZ(-0.6, 0.2, 0, 0.4, 0.3, "G#"); gr->Puts(mglPoint(-0.4, 0.3), "G", "C:w", -1.4); -gr->FaceZ(-0.2, 0.2, 0, 0.4, 0.3, "R#"); gr->Puts(mglPoint(0, 0.3), "R", "C:w", -1.4); -gr->FaceZ(0.2, 0.2, 0, 0.4, 0.3, "H#"); gr->Puts(mglPoint(0.4, 0.3), "H", "C:w", -1.4); -gr->FaceZ(0.6, 0.2, 0, 0.4, 0.3, "W#"); gr->Puts(mglPoint(0.8, 0.3), "W", "C:w", -1.4); +gr.FaceZ(-1, 0.2, 0, 0.4, 0.3, "B#"); gr.Puts(mglPoint(-0.8, 0.3), "B", "C:w", -1.4); +gr.FaceZ(-0.6, 0.2, 0, 0.4, 0.3, "G#"); gr.Puts(mglPoint(-0.4, 0.3), "G", "C:w", -1.4); +gr.FaceZ(-0.2, 0.2, 0, 0.4, 0.3, "R#"); gr.Puts(mglPoint(0, 0.3), "R", "C:w", -1.4); +gr.FaceZ(0.2, 0.2, 0, 0.4, 0.3, "H#"); gr.Puts(mglPoint(0.4, 0.3), "H", "C:w", -1.4); +gr.FaceZ(0.6, 0.2, 0, 0.4, 0.3, "W#"); gr.Puts(mglPoint(0.8, 0.3), "W", "C:w", -1.4); //#bgrhw -gr->FaceZ(-1, 0.2, 0, 0.4, 0.3, "b#"); gr->Puts(mglPoint(-0.8, 0.6), "b", "C:k", -1.4); -gr->FaceZ(-0.6, 0.5, 0, 0.4, 0.3, "g#"); gr->Puts(mglPoint(-0.4, 0.6), "g", "C:k", -1.4); -gr->FaceZ(-0.2, 0.2, 0, 0.4, 0.3, "r#"); gr->Puts(mglPoint(0, 0.6), "r", "C:k", -1.4); -gr->FaceZ(0.2, 0.2, 0, 0.4, 0.3, "h#"); gr->Puts(mglPoint(0.4, 0.6), "h", "C:k", -1.4); -gr->FaceZ(0.6, 0.2, 0, 0.4, 0.3, "w#"); gr->Puts(mglPoint(0.8, 0.6), "w", "C:k", -1.4); +gr.FaceZ(-1, 0.2, 0, 0.4, 0.3, "b#"); gr.Puts(mglPoint(-0.8, 0.6), "b", "C:k", -1.4); +gr.FaceZ(-0.6, 0.5, 0, 0.4, 0.3, "g#"); gr.Puts(mglPoint(-0.4, 0.6), "g", "C:k", -1.4); +gr.FaceZ(-0.2, 0.2, 0, 0.4, 0.3, "r#"); gr.Puts(mglPoint(0, 0.6), "r", "C:k", -1.4); +gr.FaceZ(0.2, 0.2, 0, 0.4, 0.3, "h#"); gr.Puts(mglPoint(0.4, 0.6), "h", "C:k", -1.4); +gr.FaceZ(0.6, 0.2, 0, 0.4, 0.3, "w#"); gr.Puts(mglPoint(0.8, 0.6), "w", "C:k", -1.4); //#brighted -gr->FaceZ(-1, 0.8, 0, 0.4, 0.3, "r1#"); gr->Puts(mglPoint(-0.8, 0.9), "r1", "C:w", -1.4); -gr->FaceZ(-0.6, 0.8, 0, 0.4, 0.3, "r3#"); gr->Puts(mglPoint(-0.4, 0.9), "r3", "C:w", -1.4); -gr->FaceZ(-0.2, 0.8, 0, 0.4, 0.3, "r5#"); gr->Puts(mglPoint(0, 0.9), "r5", "C:k", -1.4); -gr->FaceZ(0.2, 0.8, 0, 0.4, 0.3, "r7#"); gr->Puts(mglPoint(0.4, 0.9), "r7", "C:k", -1.4); -gr->FaceZ(0.6, 0.8, 0, 0.4, 0.3, "r9#"); gr->Puts(mglPoint(0.8, 0.9), "r9", "C:k", -1.4); +gr.FaceZ(-1, 0.8, 0, 0.4, 0.3, "r1#"); gr.Puts(mglPoint(-0.8, 0.9), "r1", "C:w", -1.4); +gr.FaceZ(-0.6, 0.8, 0, 0.4, 0.3, "r3#"); gr.Puts(mglPoint(-0.4, 0.9), "r3", "C:w", -1.4); +gr.FaceZ(-0.2, 0.8, 0, 0.4, 0.3, "r5#"); gr.Puts(mglPoint(0, 0.9), "r5", "C:k", -1.4); +gr.FaceZ(0.2, 0.8, 0, 0.4, 0.3, "r7#"); gr.Puts(mglPoint(0.4, 0.9), "r7", "C:k", -1.4); +gr.FaceZ(0.6, 0.8, 0, 0.4, 0.3, "r9#"); gr.Puts(mglPoint(0.8, 0.9), "r9", "C:k", -1.4); @end verbatim @strong{MGL code} @end ifclear @@ -5206,49 +3648,49 @@ facez 0.6 0.8 0 0.4 0.3 'r9#': text 0.8 0.9 'r9' 'C:k' @c @caption{Example of Legend usage. @tdref{legend}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(256,2); a.Fill(-1,1); -gr->SubPlot(2,10,0,0.2); gr->Dens(a,"kw", nan); -gr->Puts(mglPoint(-1.4, -0.3), "kw", "C", -8); -gr->SubPlot(2,10,1,0.2); gr->Dens(a,"wk", nan); -gr->Puts(mglPoint(-1.4, -0.3), "wk", "C", -8); -gr->SubPlot(2,10,2,0.2); gr->Dens(a,"kHCcw", nan); -gr->Puts(mglPoint(-1.4, -0.3), "kHCcw", "C", -8); -gr->SubPlot(2,10,3,0.2); gr->Dens(a,"kBbcw", nan); -gr->Puts(mglPoint(-1.4, -0.3), "kBbcw", "C", -8); -gr->SubPlot(2,10,4,0.2); gr->Dens(a,"kRryw", nan); -gr->Puts(mglPoint(-1.4, -0.3), "kRryw", "C", -8); -gr->SubPlot(2,10,5,0.2); gr->Dens(a,"kGgew", nan); -gr->Puts(mglPoint(-1.4, -0.3), "kGgew", "C", -8); -gr->SubPlot(2,10,6,0.2); gr->Dens(a,"BbwrR", nan); -gr->Puts(mglPoint(-1.4, -0.3), "BbwrR", "C", -8); -gr->SubPlot(2,10,7,0.2); gr->Dens(a,"BbwgG", nan); -gr->Puts(mglPoint(-1.4, -0.3), "BbwgG", "C", -8); -gr->SubPlot(2,10,8,0.2); gr->Dens(a,"GgwmM", nan); -gr->Puts(mglPoint(-1.4, -0.3), "GgwmM", "C", -8); -gr->SubPlot(2,10,9,0.2); gr->Dens(a,"UuwqR", nan); -gr->Puts(mglPoint(-1.4, -0.3), "UuwqR", "C", -8); -gr->SubPlot(2,10,10,0.2); gr->Dens(a,"QqwcC", nan); -gr->Puts(mglPoint(-1.4, -0.3), "QqwcC", "C", -8); -gr->SubPlot(2,10,11,0.2); gr->Dens(a,"CcwyY", nan); -gr->Puts(mglPoint(-1.4, -0.3), "CcwyY", "C", -8); -gr->SubPlot(2,10,12,0.2); gr->Dens(a,"bcwyr", nan); -gr->Puts(mglPoint(-1.4, -0.3), "bcwyr", "C", -8); -gr->SubPlot(2,10,13,0.2); gr->Dens(a,"bwr", nan); -gr->Puts(mglPoint(-1.4, -0.3), "bwr", "C", -8); -gr->SubPlot(2,10,14,0.2); gr->Dens(a,"BbcyrR", nan); -gr->Puts(mglPoint(-1.4, -0.3), "BbcyrR", "C", -8); -gr->SubPlot(2,10,15,0.2); gr->Dens(a,"UbcyqR", nan); -gr->Puts(mglPoint(-1.4, -0.3), "UbcyqR", "C", -8); -gr->SubPlot(2,10,16,0.2); gr->Dens(a,"BbcwyrR", nan); -gr->Puts(mglPoint(-1.4, -0.3), "BbcwyrR", "C", -8); -gr->SubPlot(2,10,17,0.2); gr->Dens(a,"bcyr", nan); -gr->Puts(mglPoint(-1.4, -0.3), "bcyr", "C", -8); -gr->SubPlot(2,10,18,0.2); gr->Dens(a,"BbcyrR|", nan); -gr->Puts(mglPoint(-1.4, -0.3), "BbcyrR|", "C", -8); -gr->SubPlot(2,10,19,0.2); gr->Dens(a,"bgr", nan); -gr->Puts(mglPoint(-1.4, -0.3), "bgr", "C", -8); +gr.SubPlot(2,10,0,0.2); gr.Dens(a,"kw", nan); +gr.Puts(mglPoint(-1.4, -0.3), "kw", "C", -8); +gr.SubPlot(2,10,1,0.2); gr.Dens(a,"wk", nan); +gr.Puts(mglPoint(-1.4, -0.3), "wk", "C", -8); +gr.SubPlot(2,10,2,0.2); gr.Dens(a,"kHCcw", nan); +gr.Puts(mglPoint(-1.4, -0.3), "kHCcw", "C", -8); +gr.SubPlot(2,10,3,0.2); gr.Dens(a,"kBbcw", nan); +gr.Puts(mglPoint(-1.4, -0.3), "kBbcw", "C", -8); +gr.SubPlot(2,10,4,0.2); gr.Dens(a,"kRryw", nan); +gr.Puts(mglPoint(-1.4, -0.3), "kRryw", "C", -8); +gr.SubPlot(2,10,5,0.2); gr.Dens(a,"kGgew", nan); +gr.Puts(mglPoint(-1.4, -0.3), "kGgew", "C", -8); +gr.SubPlot(2,10,6,0.2); gr.Dens(a,"BbwrR", nan); +gr.Puts(mglPoint(-1.4, -0.3), "BbwrR", "C", -8); +gr.SubPlot(2,10,7,0.2); gr.Dens(a,"BbwgG", nan); +gr.Puts(mglPoint(-1.4, -0.3), "BbwgG", "C", -8); +gr.SubPlot(2,10,8,0.2); gr.Dens(a,"GgwmM", nan); +gr.Puts(mglPoint(-1.4, -0.3), "GgwmM", "C", -8); +gr.SubPlot(2,10,9,0.2); gr.Dens(a,"UuwqR", nan); +gr.Puts(mglPoint(-1.4, -0.3), "UuwqR", "C", -8); +gr.SubPlot(2,10,10,0.2); gr.Dens(a,"QqwcC", nan); +gr.Puts(mglPoint(-1.4, -0.3), "QqwcC", "C", -8); +gr.SubPlot(2,10,11,0.2); gr.Dens(a,"CcwyY", nan); +gr.Puts(mglPoint(-1.4, -0.3), "CcwyY", "C", -8); +gr.SubPlot(2,10,12,0.2); gr.Dens(a,"bcwyr", nan); +gr.Puts(mglPoint(-1.4, -0.3), "bcwyr", "C", -8); +gr.SubPlot(2,10,13,0.2); gr.Dens(a,"bwr", nan); +gr.Puts(mglPoint(-1.4, -0.3), "bwr", "C", -8); +gr.SubPlot(2,10,14,0.2); gr.Dens(a,"BbcyrR", nan); +gr.Puts(mglPoint(-1.4, -0.3), "BbcyrR", "C", -8); +gr.SubPlot(2,10,15,0.2); gr.Dens(a,"UbcyqR", nan); +gr.Puts(mglPoint(-1.4, -0.3), "UbcyqR", "C", -8); +gr.SubPlot(2,10,16,0.2); gr.Dens(a,"BbcwyrR", nan); +gr.Puts(mglPoint(-1.4, -0.3), "BbcwyrR", "C", -8); +gr.SubPlot(2,10,17,0.2); gr.Dens(a,"bcyr", nan); +gr.Puts(mglPoint(-1.4, -0.3), "bcyr", "C", -8); +gr.SubPlot(2,10,18,0.2); gr.Dens(a,"BbcyrR|", nan); +gr.Puts(mglPoint(-1.4, -0.3), "BbcyrR|", "C", -8); +gr.SubPlot(2,10,19,0.2); gr.Dens(a,"bgr", nan); +gr.Puts(mglPoint(-1.4, -0.3), "bgr", "C", -8); @end verbatim @strong{MGL code} @end ifclear @@ -5304,17 +3746,17 @@ text -1.4 -0.3 'bgr' '' -8 @c @caption{Example of Legend usage. @tdref{legend}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim -gr->Alpha(true); gr->Light(true); +gr.Alpha(true); gr.Light(true); mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->TranspType = 0; gr->Clf(); -gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box(); -gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box(); -gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box(); -gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box(); +gr.TranspType = 0; gr.Clf(); +gr.SubPlot(2,2,0); gr.Rotate(40,60); gr.Surf(a); gr.Box(); +gr.SubPlot(2,2,1); gr.Rotate(40,60); gr.Dens(a); gr.Box(); +gr.SubPlot(2,2,2); gr.Rotate(40,60); gr.Cont(a); gr.Box(); +gr.SubPlot(2,2,3); gr.Rotate(40,60); gr.Axial(a); gr.Box(); @end verbatim @strong{MGL code} @end ifclear @@ -5338,17 +3780,17 @@ subplot 2 2 3: rotate 40 60: axial a: box @c @caption{Example of Legend usage. @tdref{legend}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim -gr->Alpha(true); gr->Light(true); +gr.Alpha(true); gr.Light(true); mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->TranspType = 1; gr->Clf(); -gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box(); -gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box(); -gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box(); -gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box(); +gr.TranspType = 1; gr.Clf(); +gr.SubPlot(2,2,0); gr.Rotate(40,60); gr.Surf(a); gr.Box(); +gr.SubPlot(2,2,1); gr.Rotate(40,60); gr.Dens(a); gr.Box(); +gr.SubPlot(2,2,2); gr.Rotate(40,60); gr.Cont(a); gr.Box(); +gr.SubPlot(2,2,3); gr.Rotate(40,60); gr.Axial(a); gr.Box(); @end verbatim @strong{MGL code} @end ifclear @@ -5372,17 +3814,17 @@ subplot 2 2 3: rotate 40 60: axial a: box @c @caption{Example of Legend usage. @tdref{legend}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim -gr->Alpha(true); gr->Light(true); +gr.Alpha(true); gr.Light(true); mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->TranspType = 2; gr->Clf(); -gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf(a); gr->Box(); -gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->Dens(a); gr->Box(); -gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cont(a); gr->Box(); -gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Axial(a); gr->Box(); +gr.TranspType = 2; gr.Clf(); +gr.SubPlot(2,2,0); gr.Rotate(40,60); gr.Surf(a); gr.Box(); +gr.SubPlot(2,2,1); gr.Rotate(40,60); gr.Dens(a); gr.Box(); +gr.SubPlot(2,2,2); gr.Rotate(40,60); gr.Cont(a); gr.Box(); +gr.SubPlot(2,2,3); gr.Rotate(40,60); gr.Axial(a); gr.Box(); @end verbatim @strong{MGL code} @end ifclear @@ -5400,18 +3842,6 @@ subplot 2 2 3: rotate 40 60: axial a: box - - - - - - - - - - - - @node Additional features, Advanced features, Dual plotting samples, Samples @section Additional features @menu @@ -5424,7 +3854,6 @@ subplot 2 2 3: rotate 40 60: axial a: box * Cont with labels sample:: * Ternary plot sample:: * Quaternary plot sample:: -* Coloring by coordinates sample:: * Drops sample:: * Molecules drawing sample:: @end menu @@ -5439,18 +3868,18 @@ subplot 2 2 3: rotate 40 60: axial a: box @c @caption{Example of Legend usage. @tdref{legend}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData f(50,3); f.Modify("sin(2*pi*x*x)",0); f.Modify("sin(2*pi*x)",1); f.Modify("sin(2*pi*sqrt(x))",2); -gr->Axis(mglPoint(0,-1),mglPoint(1,1)); -gr->Box(); gr->Plot(f); gr->Axis(); -gr->AddLegend("sin(\\pi {x^2})","b"); -gr->AddLegend("sin(\\pi x)","g*"); -gr->AddLegend("sin(\\pi \\sqrt{\\a x})","r+"); -gr->Legend(); +gr.Axis(mglPoint(0,-1),mglPoint(1,1)); +gr.Box(); gr.Plot(f); gr.Axis(); +gr.AddLegend("sin(\\pi {x^2})","b"); +gr.AddLegend("sin(\\pi x)","g*"); +gr.AddLegend("sin(\\pi \\sqrt{\\a x})","r+"); +gr.Legend(); @end verbatim @strong{MGL code} @end ifclear @@ -5469,7 +3898,7 @@ addlegend 'sin(\pi \sqrt{\a x})' 'r+' legend @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT f = mgl_create_data_size(50,3,1); mgl_data_modify(f,"sin(2*pi*x*x)",0); @@ -5477,7 +3906,7 @@ mgl_data_modify(f,"sin(2*pi*x)",1); mgl_data_modify(f,"sin(2*pi*sqrt(x))",2); mgl_set_axis(gr, 0.,-1.,0., 1.,1.,1., 0.,0.,0.); mgl_box(gr,1); -mgl_plot(gr,f,NULL); +mgl_plot(gr,f,""); mgl_axis(gr,"xy"); mgl_add_legend(gr,"sin(\\pi {x^2})","b"); mgl_add_legend(gr,"sin(\\pi x)","g*"); @@ -5485,33 +3914,6 @@ mgl_add_legend(gr,"sin(\\pi \\sqrt{\\a x})","r+"); mgl_legend(gr,3,"rL",-1.,0.1); mgl_delete_data(f); @end verbatim -@strong{Fortran code} -@verbatim -integer f, mgl_create_data_size -f = mgl_create_data_size(50,3,1) -call mgl_data_modify(f,'sin(2*pi*x*x)',0) -call mgl_data_modify(f,'sin(2*pi*x)',1) -call mgl_data_modify(f,'sin(2*pi*sqrt(x))',2) -call mgl_set_axis(gr, 0.,-1.,0., 1.,1.,1., 0.,0.,0.) -call mgl_box(gr,1) -call mgl_plot(gr,f,'') -call mgl_axis(gr,'xy') -call mgl_add_legend(gr,'sin(\pi {x^2})','b'); -call mgl_add_legend(gr,'sin(\pi x)','g*'); -call mgl_add_legend(gr,'sin(\pi \sqrt{\a x})','r+'); -call mgl_legend(gr,3,'rL',-1.,0.1); -call mgl_delete_data(f) -@end verbatim -@strong{Python} -@verbatim -f = mglData(50,3); -f.Modify("sin(2*pi*x*x)",0); f.Modify("sin(2*pi*x)",1); f.Modify("sin(2*pi*sqrt(x))",2); -gr.SetRanges(0,1,-1,1); gr.Box(); gr.Axis(); gr.Plot(f); -gr.AddLegend("sin(\\pi x^2)","b"); -gr.AddLegend("sin(\\pi x)","g*"); -gr.AddLegend("sin(\\pi\\sqrt{\\a x})","r+"); -gr.Legend(); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Adding mesh sample, Surf & Cont sample, Legend sample, Additional features @@ -5526,20 +3928,20 @@ gr.Legend(); @c @caption{Example of adding mesh. @tdref{samplea}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Light(true); -gr->Alpha(true); -gr->SubPlot(2,2,0); gr->Rotate(40,60); -gr->Surf(a,"BbcyrR#"); gr->Box(); -gr->SubPlot(2,2,1); gr->Rotate(40,60); -gr->Dens(a,"BbcyrR#"); gr->Box(); -gr->SubPlot(2,2,2); gr->Rotate(40,60); -gr->Cont(a,"BbcyrR#"); gr->Box(); -gr->SubPlot(2,2,3); gr->Rotate(40,60); -gr->Axial(a,"BbcyrR#"); gr->Box(); +gr.Light(true); +gr.Alpha(true); +gr.SubPlot(2,2,0); gr.Rotate(40,60); +gr.Surf(a,"BbcyrR#"); gr.Box(); +gr.SubPlot(2,2,1); gr.Rotate(40,60); +gr.Dens(a,"BbcyrR#"); gr.Box(); +gr.SubPlot(2,2,2); gr.Rotate(40,60); +gr.Cont(a,"BbcyrR#"); gr.Box(); +gr.SubPlot(2,2,3); gr.Rotate(40,60); +gr.Axial(a,"BbcyrR#"); gr.Box(); @end verbatim @strong{MGL code} @end ifclear @@ -5566,7 +3968,7 @@ axial a 'BbcyrR#' box @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -5582,47 +3984,6 @@ mgl_subplot(gr,2,2,3); mgl_rotate(gr,40.,60.,0.); mgl_axial(gr,a,"BbcyrR#",3); mgl_box(gr,1); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -real zero, nan -zero=0; nan=zero/zero -a = mgl_create_data_size(50,40,1) -call mgl_data_modify(a,'0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))',0) -call mgl_set_alpha(gr,1) -call mgl_set_light(gr,1) -call mgl_subplot(gr,2,2,0) -call mgl_rotate(gr,40.,60.,0.) -call mgl_surf(gr,a,'BbcyrR#') -call mgl_box(gr,1) -call mgl_subplot(gr,2,2,1) -call mgl_rotate(gr,40.,60.,0.) -call mgl_dens(gr,a,'BbcyrR#',-1.) -call mgl_box(gr,1) -call mgl_subplot(gr,2,2,2) -call mgl_rotate(gr,40.,60.,0.) -call mgl_cont(gr,a,'BbcyrR#',7,nan) -call mgl_box(gr,1) -call mgl_subplot(gr,2,2,3) -call mgl_rotate(gr,40.,60.,0.) -call mgl_axial(gr,a,'BbcyrR#',3) -call mgl_box(gr,1) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Light(True); gr.Alpha(True); -gr.SubPlot(2,2,0); -gr.Rotate(40,60); gr.Surf(a,"BbcyrR#"); gr.Box(); -gr.SubPlot(2,2,1); -gr.Rotate(40,60); gr.Dens(a,"BbcyrR#"); gr.Box(); -gr.SubPlot(2,2,2); -gr.Rotate(40,60); gr.Cont(a,"BbcyrR#"); gr.Box(); -gr.SubPlot(2,2,3); -gr.Rotate(40,60); gr.Axial(a,"BbcyrR#"); gr.Box(); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Surf & Cont sample, Flow & Dens sample, Adding mesh sample, Additional features @@ -5634,15 +3995,15 @@ gr.Rotate(40,60); gr.Axial(a,"BbcyrR#"); gr.Box(); @c @caption{Example of Surf & Cont. @tdref{surf_cont_y}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); -gr->Light(true); -gr->Box(); -gr->Surf(a); -gr->Cont(a,"y"); +gr.Rotate(40,60); +gr.Light(true); +gr.Box(); +gr.Surf(a); +gr.Cont(a,"y"); @end verbatim @strong{MGL code} @end ifclear @@ -5656,7 +4017,7 @@ surf a cont a 'y' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -5667,28 +4028,6 @@ mgl_surf(gr,a,0); mgl_cont(gr,a,"y",7,NAN); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -real zero, nan -zero = 0; nan = zero/zero -a = mgl_create_data_size(50,40,1) -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0) -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_box(gr,1) -call mgl_surf(gr,a,'') -call mgl_cont(gr,a,'y',7,nan) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); -gr.Box(); -gr.Surf(a); gr.Cont(a,"y"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Flow & Dens sample, Several light sample, Surf & Cont sample, Additional features @@ -5700,14 +4039,14 @@ gr.Surf(a); gr.Cont(a,"y"); @c @caption{Example of Flow & Dens. @tdref{flow_dens}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40), b(50,40), d(a); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))"); d.Modify("sqrt(v^2+w^2)",a,b); -gr->Box(); -gr->Flow(a,b,"br"); gr->Dens(d,"BbcyrR"); +gr.Box(); +gr.Flow(a,b,"br"); gr.Dens(d,"BbcyrR"); @end verbatim @strong{MGL code} @end ifclear @@ -5723,7 +4062,7 @@ flow a b 'br' dens d 'BbcyrR' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a, b, d; a = mgl_create_data_size(50,40,1); @@ -5737,31 +4076,6 @@ mgl_flow_2d(gr,a,b,"br",5,1,0.); mgl_dens(gr,d,"BbcyrR",-1.); mgl_delete_data(a); mgl_delete_data(b); mgl_delete_data(d); @end verbatim -@strong{Fortran code} -@verbatim -integer a,b,d, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -b = mgl_create_data_size(50,40,1); -d = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_data_modify(b,"0.6*cos(2*pi*x)*cos(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_data_modify(d,"sqrt(v^2+w^2)",a,b); -call mgl_box(gr,1) -call mgl_flow_2d(gr,a,b,'br',5,1,0.) -call mgl_dens(gr,d,'BbcyrR',-1.); -call mgl_delete_data(a) -call mgl_delete_data(b) -call mgl_delete_data(d) -@end verbatim -@strong{Python} -@verbatim -a, b= mglData(50,40), mglData(50,40); d = mglData(a) -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -b.Modify("0.6*cos(2*pi*x)*cos(3*pi*y)+0.4*cos(3*pi*(x*y))"); -d.Modify("sqrt(v^2+w^2)",a,b); -gr.Box(); -gr.Flow(a,b,"br"); gr.Dens(d,"BbcyrR"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Several light sample, Mirrored surface sample, Flow & Dens sample, Additional features @@ -5773,17 +4087,17 @@ gr.Flow(a,b,"br"); gr.Dens(d,"BbcyrR"); @c @caption{Example of Surf with several light. @tdref{several_light}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Rotate(40,60); -gr->Light(true); -gr->Light(1,mglPoint(0,1,0),'c'); -gr->Light(2,mglPoint(1,0,0),'y'); -gr->Light(3,mglPoint(0,-1,0),'m'); -gr->Box(); -gr->Surf(a,"h"); +gr.Rotate(40,60); +gr.Light(true); +gr.Light(1,mglPoint(0,1,0),'c'); +gr.Light(2,mglPoint(1,0,0),'y'); +gr.Light(3,mglPoint(0,-1,0),'m'); +gr.Box(); +gr.Surf(a,"h"); @end verbatim @strong{MGL code} @end ifclear @@ -5799,7 +4113,7 @@ box surf a 'h' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -5812,31 +4126,6 @@ mgl_box(gr,1); mgl_surf(gr,a,"h"); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_add_light_rgb(gr,1,0.,1.,0.,1, 0.,1.,1.,0.5) -call mgl_add_light_rgb(gr,2,1.,0.,0.,1, 1.,1.,0.,0.5) -call mgl_add_light_rgb(gr,3,0.,-1.,0.,1, 1.,0.,1.,0.5) -call mgl_box(gr,1) -call mgl_surf(gr,a,'h') -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Rotate(40,60); gr.Light(True); -gr.AddLight(1,0,1,0,"c"); -gr.AddLight(2,1,0,0,"y"); -gr.AddLight(3,0,-1,0,"m"); -gr.Box(); -gr.Surf(a,"h") -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Mirrored surface sample, Cont with labels sample, Several light sample, Additional features @@ -5847,15 +4136,15 @@ gr.Surf(a,"h") @c @caption{Example of mirrored surface. @tdref{mirror}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(30,40),x(30),y1(40),y2(40); a.Modify("pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)"); x.Fill(-1,1); y1.Fill(0,1); y2.Fill(0,-1); -gr->Rotate(40,60); -gr->Light(true); -gr->Box(); -gr->Surf(x,y1,a,"r"); gr->Surf(x,y2,a,"b"); +gr.Rotate(40,60); +gr.Light(true); +gr.Box(); +gr.Surf(x,y1,a,"r"); gr.Surf(x,y2,a,"b"); @end verbatim @strong{MGL code} @end ifclear @@ -5882,7 +4171,7 @@ surf x y2 a 'b' box @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a,x,y1,y2; a = mgl_create_data_size(30,40,1); @@ -5900,35 +4189,6 @@ mgl_surf_xy(gr,x,y1,a,"r"); mgl_surf_xy(gr,x,y2,a,"b"); mgl_delete_data(a); mgl_delete_data(y1); mgl_delete_data(x); mgl_delete_data(y2); @end verbatim -@strong{Fortran code} -@verbatim -integer a,x,y1,y2, mgl_create_data_size -a = mgl_create_data_size(30,40,1) -x = mgl_create_data_size(30,1,1) -y1 = mgl_create_data_size(40,1,1) -y2 = mgl_create_data_size(40,1,1) -call mgl_data_modify(a,'pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)',0) -call mgl_data_fill(x,-1.,1.,'x') -call mgl_data_fill(y1,0.,1.,'x') -call mgl_data_fill(y2,0.,-1.,'x') -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_box(gr,1) -call mgl_surf_xy(gr,x,y1,a,'r') -call mgl_surf_xy(gr,x,y2,a,'b') -call mgl_delete_data(a) -call mgl_delete_data(y1) -call mgl_delete_data(x) -call mgl_delete_data(y2) -@end verbatim -@strong{Python} -@verbatim -a, x, y1, y2 = mglData(30,40), mglData(30), mglData(40), mglData(40); -a.Modify("pi*(1-2*x)*exp(-4*y^2-4*(2*x-1)^2)"); -x.Fill(-1,1); y1.Fill(0,1); y2.Fill(0,-1); -gr.Rotate(40,60); gr.Light(True); gr.Box(); -gr.Surf(x,y1,a,"r"); gr.Surf(x,y2,a,"b"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Cont with labels sample, Ternary plot sample, Mirrored surface sample, Additional features @@ -5939,12 +4199,12 @@ gr.Surf(x,y1,a,"r"); gr.Surf(x,y2,a,"b"); @c @caption{Example of Cont with labels. @tdref{contt}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Box(); -gr->Cont(a,"BbcyrRt"); +gr.Box(); +gr.Cont(a,"BbcyrRt"); @end verbatim @strong{MGL code} @end ifclear @@ -5955,7 +4215,7 @@ box cont a 'BbcyrRt' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -5963,22 +4223,6 @@ mgl_box(gr,1); mgl_cont(gr,a,"BbcyrRt",7,0); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_box(gr,1) -call mgl_cont(gr,a,'BbcyrRt',7,0) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Box(); -gr.Cont(a,"BbcyrRt"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Ternary plot sample, Quaternary plot sample, Cont with labels sample, Additional features @@ -5989,23 +4233,23 @@ gr.Cont(a,"BbcyrRt"); @c @caption{Example of Ternary plot. @tdref{ternary}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData x(50),y(50),rx(10),ry(10), a(20,30); a.Modify("4*x*y"); x.Modify("0.25*(1+cos(2*pi*x))"); y.Modify("0.25*(1+sin(2*pi*x))"); rx.Modify("rnd"); ry.Modify("(1-v)*rnd",rx); -gr->Text(mglPoint(-0.8,1.3), "Ternary plot (x+y+t=1)"); -gr->Ternary(1); -gr->Plot(x,y,"r2"); -gr->Plot(rx,ry,"q^ "); -gr->Cont(a); -gr->Line(mglPoint(0.5,0), mglPoint(0,0.75), "g2"); -gr->Axis(); gr->Grid("xyz","B;"); -gr->Label('x',"x comp."); -gr->Label('y',"y comp."); -gr->Label('t',"t comp."); +gr.Text(mglPoint(-0.8,1.3), "Ternary plot (x+y+t=1)"); +gr.Ternary(1); +gr.Plot(x,y,"r2"); +gr.Plot(rx,ry,"q^ "); +gr.Cont(a); +gr.Line(mglPoint(0.5,0), mglPoint(0,0.75), "g2"); +gr.Axis(); gr.Grid("xyz","B;"); +gr.Label('x',"x comp."); +gr.Label('y',"y comp."); +gr.Label('t',"t comp."); @end verbatim @strong{MGL code} @end ifclear @@ -6033,7 +4277,7 @@ ylabel 'y comp.' tlabel 't comp.' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT x,y,rx,ry,a; x = mgl_create_data_size(50,1,1); @@ -6061,56 +4305,11 @@ mgl_delete_data(a); mgl_delete_data(x); mgl_delete_data(y); mgl_delete_data(rx); mgl_delete_data(ry); @end verbatim -@strong{Fortran code} -@verbatim -integer a,x,y,rx,ry, mgl_create_data_size -x = mgl_create_data_size(50,1,1) -y = mgl_create_data_size(50,1,1) -rx = mgl_create_data_size(50,1,1) -ry = mgl_create_data_size(50,1,1) -a = mgl_create_data_size(20,30,1) -call mgl_data_modify(x,'0.25*(1+cos(2*pi*x))',0) -call mgl_data_modify(y,'0.25*(1+sin(2*pi*x))',0) -call mgl_data_modify(rx,'rnd',0) -call mgl_data_modify_vw(ry,'(1-v)*rnd',rx,rx) -call mgl_data_modify(a,'4*x*y',0) -call mgl_puts_ext(gr,-0.8,1.3,0.,'Ternary plot (x+y+t=1)','C',-1.4,'t') -call mgl_set_ternary(gr,1) -call mgl_plot_xy(gr,x,y,'r2') -call mgl_plot_xy(gr,rx,ry,'q^ ') -call mgl_cont(gr,a,'',7,0.) -call mgl_line(gr,0.5,0.,0.,0.,0.75,0.,'g2',2) -call mgl_axis(gr,'xyz') -call mgl_axis_grid(gr,'xyz','B:') -call mgl_label(gr,'x','x comp') -call mgl_label(gr,'y','y comp') -call mgl_label(gr,'t','t comp') -call mgl_delete_data(a) -call mgl_delete_data(x) -call mgl_delete_data(y) -call mgl_delete_data(rx) -call mgl_delete_data(ry) -@end verbatim -@strong{Python} -@verbatim -x, y, rx, ry, a = mglData(50), mglData(50), mglData(10), mglData(10), mglData(20,30); -a.Modify("4*x*y"); -x.Modify("0.25*(1+cos(2*pi*x))"); y.Modify("0.25*(1+sin(2*pi*x))"); -rx.Modify("rnd"); ry.Modify("(1-v)*rnd",rx); -gr.Puts(-0.8,1.3,0,"Ternary plot (x+y+t=1)","C",-1.4); -gr.Ternary(1); -gr.Plot(x,y,"r2"); gr.Plot(rx,ry,"q^ "); gr.Cont(a); -gr.Line(0.5,0,0,0,0.75,0,"g2"); -gr.Axis(); gr.Grid("xyz","B;"); -gr.Label("x","x comp."); -gr.Label("y","y comp."); -gr.Label("t","t comp."); -@end verbatim @end ifclear @c ------------------------------------------------------------------ -@node Quaternary plot sample, Coloring by coordinates sample, Ternary plot sample, Additional features +@node Quaternary plot sample, Drops sample, Ternary plot sample, Additional features @subsection Quaternary plot sample @cindex Ternary @float @@ -6118,7 +4317,7 @@ gr.Label("t","t comp."); @c @caption{Example of Ternary plot. @tdref{ternary}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData x(50),y(50),z(50),rx(10),ry(10), a(20,30); a.Modify("x*y*(1-x-y)^2*30"); @@ -6126,14 +4325,14 @@ x.Modify("0.25*(1-x)*(1+cos(2*pi*x))"); y.Modify("0.25*(1-x)*(1+sin(2*pi*x))"); z.Modify("x"); -gr->Text(mglPoint(0,1.3), "Quaternary plot (x+y+z+t=1)"); -gr->Rotate(60,70); gr->Light(true); -gr->Ternary(2); gr->SetCut(true); -gr->Plot(x,y,z,"r2"); gr->Surf(a,"#"); -gr->Axis(); gr->Grid(); gr->Box(); -gr->SetRotatedText(false); -gr->Label('t',"A",1); gr->Label('x',"B",1); -gr->Label('y',"C",1); gr->Label('z',"D",1); +gr.Text(mglPoint(0,1.3), "Quaternary plot (x+y+z+t=1)"); +gr.Rotate(60,70); gr.Light(true); +gr.Ternary(2); gr.SetCut(true); +gr.Plot(x,y,z,"r2"); gr.Surf(a,"#"); +gr.Axis(); gr.Grid(); gr.Box(); +gr.SetRotatedText(false); +gr.Label('t',"A",1); gr.Label('x',"B",1); +gr.Label('y',"C",1); gr.Label('z',"D",1); @end verbatim @strong{MGL code} @end ifclear @@ -6153,90 +4352,14 @@ tlabel 'A' 1:xlabel 'B' 1 ylabel 'C' 1:zlabel 'D' 1 @end verbatim @ifclear UDAV -@strong{Pure C code} -@verbatim -TO BE DONE -@end verbatim -@strong{Fortran code} +@strong{C/Fortran code} @verbatim TO BE DONE @end verbatim -@strong{Python} -@verbatim -x, y, z, a = mglData(50), mglData(50), mglData(50), mglData(20,30); -a.Modify("x*y*(1-x-y)^2*30"); -x.Modify("0.25*(1-x)*(1+cos(2*pi*x))"); -y.Modify("0.25*(1-x)*(1+sin(2*pi*x))"); -z.Modify("x"); - -gr.Text(mglPoint(0,1.3), "Quaternary plot (x+y+z+t=1)"); -gr.Rotate(60,70); gr.Light(True); -gr.Ternary(2); gr.SetCut(True); -gr.Plot(x,y,z,"r2"); gr.Surf(a,"#"); -gr.Axis(); gr->Grid(); gr.Box(); -gr.SetRotatedText(0); -gr.Label('t',"A",1); gr.Label('x',"B",1); -gr.Label('y',"C",1); gr.Label('z',"D",1); -@end verbatim @end ifclear -@c ------------------------------------------------------------------ - -@node Coloring by coordinates sample, Drops sample, Quaternary plot sample, Additional features -@subsection Coloring by coordinates sample -@cindex Surf3 -@float -@image{../png/surf3_rgbd, 7cm} -@c @caption{Example of Surf3 colored by coordinates. @tdref{surf3_rgbd}} -@end float -@ifclear UDAV -@strong{C++ code} -@verbatim -mglData a(60,50,40); -a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr->Rotate(40,60); -gr->Box(); -gr->Surf3(a,"bgrd"); -@end verbatim -@strong{MGL code} -@end ifclear -@verbatim -new a 60 50 40 -modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)' -rotate 40 60 -box -surf3 a 'bgrd' -@end verbatim -@ifclear UDAV -@strong{Pure C code} -@verbatim -HMDT a = mgl_create_data_size(60,50,40); -mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -mgl_rotate(gr,40.,60.,0.); -mgl_box(gr,1); -mgl_surf3(gr,a,"bgrd",3); -mgl_delete_data(a); -@end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_box(gr,1) -call mgl_surf3(gr,a,'bgrd',3) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(60,50,40); -a.Modify("-2*((2*x-1)^2+(2*y-1)^2+(2*z-1)^4-(2*z-1)^2-0.1)"); -gr.Rotate(40,60); gr.Box(); -gr.Surf3(a,"bgrd"); -@end verbatim -@end ifclear @c ------------------------------------------------------------------ -@node Drops sample, Molecules drawing sample, Coloring by coordinates sample, Additional features +@node Drops sample, Molecules drawing sample, Quaternary plot sample, Additional features @subsection Drops sample @cindex Drop @float @@ -6244,22 +4367,22 @@ gr.Surf3(a,"bgrd"); @c @caption{Example of Drop(s). @tdref{drops}} @end float @ifclear UDAV -@strong{C++ code} -@verbatim -gr->Light(true); -gr->Puts(mglPoint(-1,1.2),"sh=0"); -gr->Drop(mglPoint(-1,0),mglPoint(0,1),0.5,"r",0); -gr->Puts(mglPoint(-0.33,1.2),"sh=0.33"); -gr->Drop(mglPoint(-0.33,0),mglPoint(0,1),0.5,"r",0.33); -gr->Puts(mglPoint(0.33,1.2),"sh=0.67"); -gr->Drop(mglPoint(0.33,0),mglPoint(0,1),0.5,"r",0.67); -gr->Puts(mglPoint(1,1.2),"sh=1"); -gr->Drop(mglPoint(1,0),mglPoint(0,1),0.5,"r",1); -gr->Ball(mglPoint(-1,0,1),'k'); -gr->Ball(mglPoint(-0.33,0,1),'k'); -gr->Ball(mglPoint(0.33,0,1),'k'); -gr->Ball(mglPoint(1,0,1),'k'); -gr->Line(mglPoint(-1,0,1),mglPoint(1,0,1),"b"); +@strong{C++/Python code} +@verbatim +gr.Light(true); +gr.Puts(mglPoint(-1,1.2),"sh=0"); +gr.Drop(mglPoint(-1,0),mglPoint(0,1),0.5,"r",0); +gr.Puts(mglPoint(-0.33,1.2),"sh=0.33"); +gr.Drop(mglPoint(-0.33,0),mglPoint(0,1),0.5,"r",0.33); +gr.Puts(mglPoint(0.33,1.2),"sh=0.67"); +gr.Drop(mglPoint(0.33,0),mglPoint(0,1),0.5,"r",0.67); +gr.Puts(mglPoint(1,1.2),"sh=1"); +gr.Drop(mglPoint(1,0),mglPoint(0,1),0.5,"r",1); +gr.Ball(mglPoint(-1,0,1),'k'); +gr.Ball(mglPoint(-0.33,0,1),'k'); +gr.Ball(mglPoint(0.33,0,1),'k'); +gr.Ball(mglPoint(1,0,1),'k'); +gr.Line(mglPoint(-1,0,1),mglPoint(1,0,1),"b"); @end verbatim @strong{MGL code} @end ifclear @@ -6284,7 +4407,7 @@ plot h 'k|' text -1 0.6 'h\sim(1+sh)^2' 'rL' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim mgl_set_light(gr,1); mgl_puts(gr,-1.,1.2,0.,"sh=0"); @@ -6301,38 +4424,6 @@ mgl_ball_str(gr,0.33,0.,1.,"k"); mgl_ball_str(gr,1.,0.,1.,"k"); mgl_line(gr,-1.,0.,1.,1.,0.,1.,"b",2); @end verbatim -@strong{Fortran code} -@verbatim -call mgl_set_light(gr,1); -call mgl_puts(gr,-1.,1.2,0.,"sh=0"); -call mgl_drop(gr,-1.,0.,0.,0.,1.,0.,0.5,"r",0.,1.); -call mgl_puts(gr,-0.33,1.2,0.,"sh=0.33"); -call mgl_drop(gr,-0.33,0.,0.,0.,1.,0.,0.5,"r",0.33,1.); -call mgl_puts(gr,0.33,1.2,0.,"sh=0.67"); -call mgl_drop(gr,0.33,0.,0.,0.,1.,0.,0.5,"r",0.67,1.); -call mgl_puts(gr,1.,1.2,0.,"sh=1"); -call mgl_drop(gr,1.,0.,0.,0.,1.,0.,0.5,"r",1.,1.); -call mgl_ball_str(gr,-1.,0.,1.,"k"); -call mgl_ball_str(gr,-0.33,0.,1.,"k"); -call mgl_ball_str(gr,0.33,0.,1.,"k"); -call mgl_ball_str(gr,1.,0.,1.,"k"); -call mgl_line(gr,-1.,0.,1.,1.,0.,1.,"b",2); -@end verbatim -@strong{Python} -@verbatim -gr.Light(True); -gr.Puts(-1,1.2,0,"sh=0","rC"); -gr.Drop(-1,0,0,0,1,0,0.5,"r",0); -gr.Puts(-0.33,1.2,0,"sh=0.33","rC"); -gr.Drop(-0.33,0,0,0,1,0,0.5,"r",0.33); -gr.Puts(0.33,1.2,0,"sh=0.67","rC"); -gr.Drop(0.33,0,0,0,1,0,0.5,"r",0.67); -gr.Puts(1,1.2,0,"sh=1","rC"); -gr.Drop(1,0,0,0,1,0,0.5,"r",1); -gr.Ball(-1,0,1,"k"); gr.Ball(-0.33,0,1,"k"); -gr.Ball(0.33,0,1,"k"); gr.Ball(1,0,1,"k"); -gr.Line(-1,0,1,1,0,1,"b"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Molecules drawing sample, , Drops sample, Additional features @@ -6344,42 +4435,42 @@ gr.Line(-1,0,1,1,0,1,"b"); @c @caption{Example of molecules drawing. @tdref{molecule}} @end float @ifclear UDAV -@strong{C++ code} -@verbatim -gr->Alpha(true); gr->Light(true); -gr->SubPlot(2,2,0); -gr->Text(mglPoint(0,1.2),"Methane, CH_4",0,-3); gr->Rotate(60,120); -gr->Sphere(mglPoint(0,0,0),0.25,"k"); -gr->Drop(mglPoint(0,0,0),mglPoint(0,0,1),0.35,"h",1,2); -gr->Sphere(mglPoint(0,0,0.7),0.25,"g"); -gr->Drop(mglPoint(0,0,0),mglPoint(-0.94,0,-0.33),0.35,"h",1,2); -gr->Sphere(mglPoint(-0.66,0,-0.23),0.25,"g"); -gr->Drop(mglPoint(0,0,0),mglPoint(0.47,0.82,-0.33),0.35,"h",1,2); -gr->Sphere(mglPoint(0.33,0.57,-0.23),0.25,"g"); -gr->Drop(mglPoint(0,0,0),mglPoint(0.47,-0.82,-0.33),0.35,"h",1,2); -gr->Sphere(mglPoint(0.33,-0.57,-0.23),0.25,"g"); -gr->SubPlot(2,2,1); -gr->Text(mglPoint(0,1.2),"Water, H{_2}O",0,-3); gr->Rotate(60,100); -gr->Sphere(mglPoint(0,0,0),0.25,"r"); -gr->Drop(mglPoint(0,0,0),mglPoint(0.3,0.5,0),0.3,"m",1,2); -gr->Sphere(mglPoint(0.3,0.5,0),0.25,"g"); -gr->Drop(mglPoint(0,0,0),mglPoint(0.3,-0.5,0),0.3,"m",1,2); -gr->Sphere(mglPoint(0.3,-0.5,0),0.25,"g"); -gr->SubPlot(2,2,2); -gr->Text(mglPoint(0,1.2),"Oxygen, O_2",0,-3); gr->Rotate(60,120); -gr->Drop(mglPoint(0,0.5,0),mglPoint(0,-0.3,0),0.3,"m",1,2); -gr->Sphere(mglPoint(0,0.5,0),0.25,"r"); -gr->Drop(mglPoint(0,-0.5,0),mglPoint(0,0.3,0),0.3,"m",1,2); -gr->Sphere(mglPoint(0,-0.5,0),0.25,"r"); -gr->SubPlot(2,2,3); -gr->Text(mglPoint(0,1.2),"Ammonia, NH_3",0,-3); gr->Rotate(60,120); -gr->Sphere(mglPoint(0,0,0),0.25,"b"); -gr->Drop(mglPoint(0,0,0),mglPoint(0.33,0.57,0),0.32,"n",1,2); -gr->Sphere(mglPoint(0.33,0.57,0),0.25,"g"); -gr->Drop(mglPoint(0,0,0),mglPoint(0.33,-0.57,0),0.32,"n",1,2); -gr->Sphere(mglPoint(0.33,-0.57,0),0.25,"g"); -gr->Drop(mglPoint(0,0,0),mglPoint(-0.65,0,0),0.32,"n",1,2); -gr->Sphere(mglPoint(-0.65,0,0),0.25,"g"); +@strong{C++/Python code} +@verbatim +gr.Alpha(true); gr.Light(true); +gr.SubPlot(2,2,0); +gr.Text(mglPoint(0,1.2),"Methane, CH_4",0,-3); gr.Rotate(60,120); +gr.Sphere(mglPoint(0,0,0),0.25,"k"); +gr.Drop(mglPoint(0,0,0),mglPoint(0,0,1),0.35,"h",1,2); +gr.Sphere(mglPoint(0,0,0.7),0.25,"g"); +gr.Drop(mglPoint(0,0,0),mglPoint(-0.94,0,-0.33),0.35,"h",1,2); +gr.Sphere(mglPoint(-0.66,0,-0.23),0.25,"g"); +gr.Drop(mglPoint(0,0,0),mglPoint(0.47,0.82,-0.33),0.35,"h",1,2); +gr.Sphere(mglPoint(0.33,0.57,-0.23),0.25,"g"); +gr.Drop(mglPoint(0,0,0),mglPoint(0.47,-0.82,-0.33),0.35,"h",1,2); +gr.Sphere(mglPoint(0.33,-0.57,-0.23),0.25,"g"); +gr.SubPlot(2,2,1); +gr.Text(mglPoint(0,1.2),"Water, H{_2}O",0,-3); gr.Rotate(60,100); +gr.Sphere(mglPoint(0,0,0),0.25,"r"); +gr.Drop(mglPoint(0,0,0),mglPoint(0.3,0.5,0),0.3,"m",1,2); +gr.Sphere(mglPoint(0.3,0.5,0),0.25,"g"); +gr.Drop(mglPoint(0,0,0),mglPoint(0.3,-0.5,0),0.3,"m",1,2); +gr.Sphere(mglPoint(0.3,-0.5,0),0.25,"g"); +gr.SubPlot(2,2,2); +gr.Text(mglPoint(0,1.2),"Oxygen, O_2",0,-3); gr.Rotate(60,120); +gr.Drop(mglPoint(0,0.5,0),mglPoint(0,-0.3,0),0.3,"m",1,2); +gr.Sphere(mglPoint(0,0.5,0),0.25,"r"); +gr.Drop(mglPoint(0,-0.5,0),mglPoint(0,0.3,0),0.3,"m",1,2); +gr.Sphere(mglPoint(0,-0.5,0),0.25,"r"); +gr.SubPlot(2,2,3); +gr.Text(mglPoint(0,1.2),"Ammonia, NH_3",0,-3); gr.Rotate(60,120); +gr.Sphere(mglPoint(0,0,0),0.25,"b"); +gr.Drop(mglPoint(0,0,0),mglPoint(0.33,0.57,0),0.32,"n",1,2); +gr.Sphere(mglPoint(0.33,0.57,0),0.25,"g"); +gr.Drop(mglPoint(0,0,0),mglPoint(0.33,-0.57,0),0.32,"n",1,2); +gr.Sphere(mglPoint(0.33,-0.57,0),0.25,"g"); +gr.Drop(mglPoint(0,0,0),mglPoint(-0.65,0,0),0.32,"n",1,2); +gr.Sphere(mglPoint(-0.65,0,0),0.25,"g"); @end verbatim @strong{MGL code} @end ifclear @@ -6453,29 +4544,29 @@ sphere -0.65 0 0 0.25 'g' @c @caption{Example of curvelinear coorinates usage. @tdref{sample3}} @end float @ifclear UDAV -@strong{C++ code} -@verbatim -gr->Org = mglPoint(-1,1,-1); -gr->SubPlot(2,2,0); gr->Rotate(60,40); -gr->Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100); -gr->Axis(); gr->Grid(); -gr->Text(mglPoint(0,1.3,1),"Cartesian"); -gr->SubPlot(2,2,1); gr->Rotate(60,40); -gr->SetFunc("y*sin(pi*x)","y*cos(pi*x)"); -gr->Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100); -gr->Axis(); gr->Grid(); -gr->Text(mglPoint(0,1.3,1),"Cylindrical"); -gr->SubPlot(2,2,2); gr->Rotate(60,40); -gr->SetFunc("2*y*x","y*y - x*x"); -gr->Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100); -gr->Axis(); gr->Grid(); -gr->Text(mglPoint(0,1.3,1),"Parabolic"); -gr->SubPlot(2,2,3); gr->Rotate(60,40); -gr->SetFunc("y*sin(pi*x)","y*cos(pi*x)","x+z"); -gr->Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100); -gr->Axis(); gr->Grid(); -gr->Text(mglPoint(0,1.3,1),"Spiral"); -gr->Axis(0,0,0); // set to default Cartesian +@strong{C++/Python code} +@verbatim +gr.Org = mglPoint(-1,1,-1); +gr.SubPlot(2,2,0); gr.Rotate(60,40); +gr.Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100); +gr.Axis(); gr.Grid(); +gr.Text(mglPoint(0,1.3,1),"Cartesian"); +gr.SubPlot(2,2,1); gr.Rotate(60,40); +gr.SetFunc("y*sin(pi*x)","y*cos(pi*x)"); +gr.Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100); +gr.Axis(); gr.Grid(); +gr.Text(mglPoint(0,1.3,1),"Cylindrical"); +gr.SubPlot(2,2,2); gr.Rotate(60,40); +gr.SetFunc("2*y*x","y*y - x*x"); +gr.Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100); +gr.Axis(); gr.Grid(); +gr.Text(mglPoint(0,1.3,1),"Parabolic"); +gr.SubPlot(2,2,3); gr.Rotate(60,40); +gr.SetFunc("y*sin(pi*x)","y*cos(pi*x)","x+z"); +gr.Line(mglPoint(-1,0.5,0),mglPoint(1,0.5,0),"r2",100); +gr.Axis(); gr.Grid(); +gr.Text(mglPoint(0,1.3,1),"Spiral"); +gr.Axis(0,0,0); // set to default Cartesian @end verbatim @strong{MGL code} @end ifclear @@ -6511,7 +4602,7 @@ text 0 1.3 1 'Spiral' axis '' '' '' # set to default Cartesian @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim mgl_set_origin(gr,-1,1,-1); mgl_subplot(gr,2,2,0); mgl_rotate(gr,60,40,0); @@ -6535,62 +4626,6 @@ mgl_axis(gr,"xyz"); mgl_axis_grid(gr,"xyz","B"); mgl_text(gr,0,1.3,1,"Spiral"); mgl_set_func(gr,0,0,0); /* set to default Cartesian */ @end verbatim -@strong{Fortran code} -@verbatim -call mgl_set_origin(gr,-1.,1.,-1.) -call mgl_subplot(gr,2,2,0) -call mgl_rotate(gr,60.,40.,0.) -call mgl_line(gr,-1.,0.5,0.,1.,0.5,0.,'r2',100) -call mgl_axis(gr,'xyz') -call mgl_axis_grid(gr,'xyz','B') -call mgl_text(gr,0.,1.3,1.,'Cartesian') -call mgl_subplot(gr,2,2,1) -call mgl_rotate(gr,60.,40.,0.) -call mgl_set_func(gr,'y*sin(pi*x)','y*cos(pi*x)','') -call mgl_line(gr,-1.,0.5,0.,1.,0.5,0.,'r2',100) -call mgl_axis(gr,'xyz') -call mgl_axis_grid(gr,'xyz','B') -call mgl_text(gr,0.,1.3,1.,'Cylindrical') -call mgl_subplot(gr,2,2,2) -call mgl_rotate(gr,60.,40.,0.) -call mgl_set_func(gr,'2*y*x','y*y - x*x','') -call mgl_line(gr,-1.,0.5,0.,1.,0.5,0.,'r2',100) -call mgl_axis(gr,'xyz') -call mgl_axis_grid(gr,'xyz','B') -call mgl_text(gr,0.,1.3,1.,"Parabolic") -call mgl_subplot(gr,2,2,3) -call mgl_rotate(gr,60.,40.,0.) -call mgl_set_func(gr,'y*sin(pi*x)','y*cos(pi*x)','x+z') -call mgl_line(gr,-1.,0.5,0.,1.,0.5,0.,'r2',100) -call mgl_axis(gr,'xyz') -call mgl_axis_grid(gr,'xyz','B') -call mgl_text(gr,0.,1.3,1.,'Spiral') -call mgl_set_func(gr,'','','') ! set to default Cartesian -@end verbatim -@strong{Python} -@verbatim -gr.SetOrigin(-1,1,-1); -gr.SubPlot(2,2,0); gr.Rotate(60,40); -gr.Line(-1,0.5,0,1,0.5,0,"r2",100); -gr.Axis(); gr.Grid(); -gr.Puts(0,1.3,1,"Gartesian","rC",-1.5); -gr.SubPlot(2,2,1); gr.Rotate(60,40); -gr.SetFunc("y*sin(pi*x)","y*cos(pi*x)"); -gr.Line(-1,0.5,0,1,0.5,0,"r2",100); -gr.Axis(); gr.Grid(); -gr.Puts(0,1.3,1,"Cylindrical","rC",-1.5); -gr.SubPlot(2,2,2); gr.Rotate(60,40); -gr.SetFunc("2*y*x","y*y-x*x"); -gr.Line(-1,0.5,0,1,0.5,0,"r2",100); -gr.Axis(); gr.Grid(); -gr.Puts(0,1.3,1,"Parabolic","rC",-1.5); -gr.SubPlot(2,2,3); gr.Rotate(60,40); -gr.SetFunc("y*sin(pi*x)","y*cos(pi*x)","x+z"); -gr.Line(-1,0.5,0,1,0.5,0,"r2",100); -gr.Axis(); gr.Grid(); -gr.Puts(0,1.3,1,"Spiral","rC",-1.5); -gr.SetFunc("",""); # set to default Gartesian -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node 2-axes sample, Semi-log sample, Curvelinear coorinates sample, Advanced features @@ -6601,16 +4636,16 @@ gr.SetFunc("",""); # set to default Gartesian @c @caption{Example of 2 axes on the plot. @tdref{2_axis}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData y1(50), y2(50); y1.Modify("0.3*sin(2*pi*x)"); y2.Modify("0.5+0.3*cos(2*pi*x)"); -gr->Axis(mglPoint(-1,-1,-1),mglPoint(1,1,1),mglPoint(-1,-1,-1)); -gr->Axis(); gr->Label('y',"axis 1",0); -gr->Plot(y1,"b"); -gr->Axis(mglPoint(0,0,0),mglPoint(1,1,1),mglPoint(1,1,1)); -gr->Axis(); gr->Label('y',"axis 2",0); -gr->Stem(y2,"r"); +gr.Axis(mglPoint(-1,-1,-1),mglPoint(1,1,1),mglPoint(-1,-1,-1)); +gr.Axis(); gr.Label('y',"axis 1",0); +gr.Plot(y1,"b"); +gr.Axis(mglPoint(0,0,0),mglPoint(1,1,1),mglPoint(1,1,1)); +gr.Axis(); gr.Label('y',"axis 2",0); +gr.Stem(y2,"r"); @end verbatim @strong{MGL code} @end ifclear @@ -6631,7 +4666,7 @@ ylabel 'axis 2' 0 stem y2 'r' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT y1 = mgl_create_data_size(50,1,1); HMDT y2 = mgl_create_data_size(50,1,1); @@ -6648,35 +4683,6 @@ mgl_axis(gr,"xyz"); mgl_label_ext(gr,'y',"axis 2",0,-1.4,0.); mgl_stem(gr,y2,"r"); @end verbatim -@strong{Fortran code} -@verbatim -integer y1,y2, mgl_create_data_size -y1 = mgl_create_data_size(50,1,1) -y2 = mgl_create_data_size(50,1,1) -call mgl_data_modify(y1,'0.3*sin(2*pi*x)',0) -call mgl_data_modify(y2,'0.5+0.3*cos(2*pi*x)',0) -call mgl_set_axis_2d(gr,-1.,1.,-1.,1.) -call mgl_set_origin(gr,-1.,-1.,-1.) -call mgl_axis(gr,'xyz') -call mgl_label_ext(gr,'y','axis 1',0,-1.4,0.) -call mgl_plot(gr,y1,'b') -call mgl_set_axis_2d(gr,0.,0.,1.,1.) -call mgl_set_origin(gr,1.,1.,1.) -call mgl_axis(gr,'xyz') -call mgl_label_ext(gr,'y','axis 2',0,-1.4,0.) -call mgl_stem(gr,y2,'r') -@end verbatim -@strong{Python} -@verbatim -y1, y2 = mglData(50), mglData(50); -y1.Modify("0.3*sin(2*pi*x)"); y2.Modify("0.5+0.3*cos(2*pi*x)"); -gr.SetRanges(-1,1,-1,1); gr.SetOrigin(-1,-1); -gr.Axis(); gr.Label("y","axis 1",0); -gr.Plot(y1,"b"); -gr.SetRanges(0,1,0,1); gr.SetOrigin(1,1); -gr.Axis(); gr.Label("y","axis 2",0); -gr.Stem(y2,"r"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Semi-log sample, Log-log sample, 2-axes sample, Advanced features @@ -6689,16 +4695,16 @@ gr.Stem(y2,"r"); @c @caption{Example of semi-log plot. @tdref{semilog}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData x(2000), y(2000); x.Modify("0.01/(x+10^(-5))"); y.Modify("sin(1/v)",x); -gr->Axis(mglPoint(0.01,-1),mglPoint(1000,1),mglPoint(0.01,-1)); -gr->SetFunc("lg(x)",0); gr->SetTicks('x',0); -gr->Box(); -gr->Plot(x,y,"b2"); -gr->Axis(); gr->Grid("xy","g"); -gr->Label('x',"x",0); gr->Label('y', "y = sin 1/x",0); +gr.Axis(mglPoint(0.01,-1),mglPoint(1000,1),mglPoint(0.01,-1)); +gr.SetFunc("lg(x)",0); gr.SetTicks('x',0); +gr.Box(); +gr.Plot(x,y,"b2"); +gr.Axis(); gr.Grid("xy","g"); +gr.Label('x',"x",0); gr.Label('y', "y = sin 1/x",0); @end verbatim @strong{MGL code} @end ifclear @@ -6719,7 +4725,7 @@ ylabel 'y = sin 1/x' 0 box @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT x = mgl_create_data_size(2000,1,1); HMDT y = mgl_create_data_size(2000,1,1); @@ -6735,29 +4741,6 @@ mgl_label_ext(gr,'x',"x",0,-1.4,0); mgl_label_ext(gr,'y', "y = sin 1/x",0,-1.4,0); mgl_delete_data(x); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer x,y, mgl_create_data_size -x = mgl_create_data_size(2000,1,1) -y = mgl_create_data_size(2000,1,1) -call mgl_data_modify(x,'0.01/(x+10^(-5))',0) -call mgl_data_modify_vw(y,'sin(1/v)',x,x) -call mgl_set_axis(gr,0.01,-1.,0.,1000.,1.,0.,0.01,-1.,0.) -call mgl_set_func(gr,'lg(x)','','') -call mgl_set_ticks(gr,0.,-5.,-5.) -call mgl_box(gr,1) -call mgl_plot_xy(gr,x,y,'b2') -call mgl_axis(gr,'xy') -call mgl_axis_grid(gr,'xy','g') -call mgl_label_ext(gr,'x','x',0.,-1.4,0.) -call mgl_label_ext(gr,'y', 'y = sin 1/x',0.,-1.4,0.) -call mgl_delete_data(x) -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -TO BE DONE -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Log-log sample, Fitting sample, Semi-log sample, Advanced features @@ -6770,17 +4753,17 @@ TO BE DONE @c @caption{Example of log-log plot. @tdref{loglog}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData x(100), y(100); x.Modify("pow(10,6*x-3)"); y.Modify("sqrt(1+v^2)",x); -gr->Axis(mglPoint(0.001,0.1),mglPoint(1000,1000),mglPoint(0.001,0.1)); -gr->SetFunc("lg(x)","lg(y)"); -gr->SetTicks('x',0); gr->SetTicks('y',0); -gr->Box(); -gr->Plot(x,y,"b2"); -gr->Axis(); gr->Grid("xy","g;"); -gr->Label('x',"x",0); gr->Label('y', "y=\\sqrt{1+x^2}",0); +gr.Axis(mglPoint(0.001,0.1),mglPoint(1000,1000),mglPoint(0.001,0.1)); +gr.SetFunc("lg(x)","lg(y)"); +gr.SetTicks('x',0); gr.SetTicks('y',0); +gr.Box(); +gr.Plot(x,y,"b2"); +gr.Axis(); gr.Grid("xy","g;"); +gr.Label('x',"x",0); gr.Label('y', "y=\\sqrt{1+x^2}",0); @end verbatim @strong{MGL code} @end ifclear @@ -6801,7 +4784,7 @@ ylabel 'y=\sqrt{1+x^2}' 0 box @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT x = mgl_create_data_size(100,1,1); HMDT y = mgl_create_data_size(100,1,1); @@ -6817,36 +4800,6 @@ mgl_label_ext(gr,'x',"x",0,-1.4,0); mgl_label_ext(gr,'y', "y=\\sqrt{1+x^2}",0,-1.4,0); mgl_delete_data(x); mgl_delete_data(y); @end verbatim -@strong{Fortran code} -@verbatim -integer x,y, mgl_create_data_size -x = mgl_create_data_size(100,1,1) -y = mgl_create_data_size(100,1,1) -call mgl_data_modify(x,'pow(10,6*x-3)',0) -call mgl_data_modify_vw(y,'sqrt(1+v^2)',x,x) -call mgl_set_axis(gr,0.001,0.1,0.,1000.,1000.,0.,0.001,0.1,0.) -call mgl_set_func(gr,'lg(x)','lg(y)','') -call mgl_set_ticks(gr,0.,0.,-5.) -call mgl_box(gr,1) -call mgl_plot_xy(gr,x,y,'b2') -call mgl_axis(gr,'xy') -call mgl_axis_grid(gr,'xy','g;') -call mgl_label_ext(gr,'x','x',0.,-1.4,0) -call mgl_label_ext(gr,'y', 'y=\sqrt{1+x^2}',0.,-1.4,0) -call mgl_delete_data(x) -call mgl_delete_data(y) -@end verbatim -@strong{Python} -@verbatim -x, y = mglData(100), mglData(100); -x.Modify("pow(10,6*x-3)"); y.Modify("sqrt(1+v^2)",x); -gr.SetRanges(0.001,1000,0.1,1000); gr.SetOrigin(0.001,0.1); -gr.SetFunc("lg(x)","lg(y)"); -gr.SetTicks("x",0); gr.SetTicks("y",0); -gr.Box(); gr.Plot(x,y,"b2"); -gr.Axis(); gr.Grid("xy","g;"); -gr.Label("x","x",0); gr.Label("y","y=\\sqrt{1+x^2}",0); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Fitting sample, Envelop sample, Log-log sample, Advanced features @@ -6858,21 +4811,21 @@ gr.Label("x","x",0); gr.Label("y","y=\\sqrt{1+x^2}",0); @c @caption{Example of nonlinear fitting. @tdref{fit}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData rnd(100), in(100), res; -rnd.Fill("0.4*rnd+0.1+sin(2*pi*x)", gr->Min, gr->Max); -in.Fill("0.3+sin(2*pi*x)", gr->Min, gr->Max); -gr->Axis(mglPoint(-1,-2), mglPoint(1,2)); -gr->Plot(rnd, ". "); -gr->Box(); +rnd.Fill("0.4*rnd+0.1+sin(2*pi*x)", gr.Min, gr.Max); +in.Fill("0.3+sin(2*pi*x)", gr.Min, gr.Max); +gr.Axis(mglPoint(-1,-2), mglPoint(1,2)); +gr.Plot(rnd, ". "); +gr.Box(); float ini[3] = {1,1,3}; -gr->Fit(res, rnd, "a+b*sin(c*x)", "abc", ini); -gr->Plot(res, "r"); -gr->Plot(in, "b"); -gr->Text(mglPoint(-1, -1.3), "fitted:", "L:r", -1); -gr->PutsFit(mglPoint(0, -1.8), "y = ", "C:r", -1); -gr->Text(mglPoint(0, 2.2), "initial: y = 0.3+sin(2\\pi x)", "C:b", -1); +gr.Fit(res, rnd, "a+b*sin(c*x)", "abc", ini); +gr.Plot(res, "r"); +gr.Plot(in, "b"); +gr.Text(mglPoint(-1, -1.3), "fitted:", "L:r", -1); +gr.PutsFit(mglPoint(0, -1.8), "y = ", "C:r", -1); +gr.Text(mglPoint(0, 2.2), "initial: y = 0.3+sin(2\\pi x)", "C:b", -1); @end verbatim @strong{MGL code} @end ifclear @@ -6893,7 +4846,7 @@ putsfit 0 -1.8 'y = ' 'C:r' text 0 2.2 'initial: y = 0.3+sin(2\pi x)' 'C:b' -1 @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT rnd,in,res; float ini[3] = {1,1,3}; @@ -6911,41 +4864,6 @@ mgl_puts_ext(gr,-1.,-1.3,0.,"fitted:","L:r",-1.,'t'); mgl_puts_fit(gr,0.,-1.8,0.,"y = ","C:r",-1.); mgl_puts_ext(gr,0.,2.2,0.,"initial: y = 0.3+sin(2\\pi x)","C:b", -1., 't'); @end verbatim -@strong{Fortran code} -@verbatim -integer rnd,in,res, mgl_create_data_size -real ini(3) -ini(1)=1; ini(2)=1; ini(3)=3; -rnd = mgl_create_data_size(100,1,1); -in = mgl_create_data_size(100,1,1); -res = mgl_create_data(); -call mgl_data_modify(rnd,"0.4*rnd+0.1+sin(4*pi*x)",0); -call mgl_data_modify(in,"0.3+sin(4*pi*x)",0); -call mgl_set_axis_2d(gr,-1.,-2.,1.,2.); -call mgl_plot(gr,rnd,". "); -call mgl_box(gr,1); -call mgl_fit_1(gr,res,rnd,"a+b*sin(c*x)","abc",ini); -call mgl_plot(gr,res,"r"); -call mgl_plot(gr,in,"b"); -call mgl_puts_ext(gr,-1.,-1.3,0.,"fitted:","L:r",-1.,'t'); -call mgl_puts_fit(gr,0.,-1.8,0.,"y = ","C:r",-1.); -call mgl_puts_ext(gr,0.,2.2,0.,"initial: y = 0.3+sin(2\\pi x)","C:b", -1., 't'); -@end verbatim -@strong{Python} -@verbatim -rnd, In, res, ini = mglData(100), mglData(100), mglData(), mglData(3); -rnd.Modify("0.4*rnd+0.1+sin(4*pi*x)"); -In.Modify("0.3+sin(4*pi*x)"); -gr.SetRanges(-1,1,-2,2); -gr.Plot(rnd,". "); -gr.Box(); -ini[0], ini[1], ini[2] = 1, 1, 3; -gr.Fit(res,rnd,"a+b*sin(c*x)","abc",ini); -gr.Plot(res,"r"); gr.Plot(In,"b"); -gr.Puts(-1,-1.3,0,"fitted:","L:r",-1); -gr.PutsFit(0,-1.8,0,"y = ","C:r",-1); -gr.Puts(0,2.2,0,"initial: y = 0.3+sin(2\\pi x)","C:b",-1); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Envelop sample, Sew sample, Fitting sample, Advanced features @@ -6956,14 +4874,14 @@ gr.Puts(0,2.2,0,"initial: y = 0.3+sin(2\\pi x)","C:b",-1); @c @caption{Example of envelop reconstruction.}@c @tdref{envelop}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(1000); -a.Fill("exp(-8*x^2)*sin(10*pi*x)", gr->Min, gr->Max); -gr->Plot(a, "b"); +a.Fill("exp(-8*x^2)*sin(10*pi*x)", gr.Min, gr.Max); +gr.Plot(a, "b"); a.Envelop('x'); -gr->Plot(a, "r"); -gr->Axis(); +gr.Plot(a, "r"); +gr.Axis(); @end verbatim @strong{MGL code} @end ifclear @@ -6976,7 +4894,7 @@ plot a 'r' axis @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(1000,1,1); mgl_data_fill_eq(gr,a, "exp(-8*x^2)*sin(10*pi*x)", 0,0); @@ -6985,25 +4903,6 @@ mgl_data_envelop(a,'x'); mgl_plot(gr,a,"r"); mgl_axis(gr,"xyz"); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(1000,1,1) -call mgl_data_fill_eq(gr,a, 'exp(-8*x^2)*sin(10*pi*x)', 0,0) -call mgl_plot(gr,a,'b') -call mgl_data_envelop(a,'x') -call mgl_plot(gr,a,'r') -call mgl_axis(gr,'xyz') -@end verbatim -@strong{Python} -@verbatim -a = mglData(1000); -gr.Fill(a, "exp(-8*x^2)*sin(10*pi*x)"); -gr.Plot(a,"b"); -a.Envelop("x"); -gr.Plot(a,"r"); -gr.Axis(); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Sew sample, STFA sample, Envelop sample, Advanced features @@ -7014,17 +4913,17 @@ gr.Axis(); @c @caption{Example of phase ``sewing''.}@c @tdref{sew}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(100, 100); a.Modify("mod((y^2-(1-x)^2)/2,0.1)"); -gr->Rotate(40, 60); -gr->Light(true); -gr->Alpha(true); -gr->Surf(a, "b"); +gr.Rotate(40, 60); +gr.Light(true); +gr.Alpha(true); +gr.Surf(a, "b"); a.Sew("xy", 0.1); -gr->Surf(a, "r"); -gr->Box(); +gr.Surf(a, "r"); +gr.Box(); @end verbatim @strong{MGL code} @end ifclear @@ -7040,7 +4939,7 @@ surf a 'r' box @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(100,100,1); mgl_data_modify(a, "mod((y^2-(1-x)^2)/2, 0.1)", 0); @@ -7052,29 +4951,6 @@ mgl_data_sew(a,"xy",0.1); mgl_surf(gr,a,"r"); mgl_box(gr,1); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(100,100,1) -call mgl_data_modify(a, 'mod((y^2-(1-x)^2)/2, 0.1)', 0) -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_light(gr,1) -call mgl_set_alpha(gr,1) -call mgl_surf(gr,a,'b') -call mgl_data_sew(a,'xy',0.1) -call mgl_surf(gr,a,'r') -call mgl_box(gr,1) -@end verbatim -@strong{Python} -@verbatim -a = mglData(100, 100); -a.Modify("mod((y^2-(1-x)^2)/2, 0.1)"); -gr.Rotate(40, 60); gr.Light(True); gr.Alpha(True); -gr.Surf(a, "b"); -a.Sew("xy", 0.1); -gr.Surf(a, "r"); -gr.Box(); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node STFA sample, PDE sample, Sew sample, Advanced features @@ -7085,21 +4961,21 @@ gr.Box(); @c @caption{Example of Short Time Fourier Analysis.}@c @tdref{stfa}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(2000), b(2000); a.Fill("cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+ \ cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)", - gr->Min, gr->Max); -gr->SubPlot(1, 2, 0); -gr->Plot(a); -gr->Axis(); -gr->Label('x', "\\i t"); -gr->SubPlot(1, 2, 1); -gr->STFA(a, b, 64); -gr->Axis(); -gr->Label('x', "\\i t"); -gr->Label('y', "\\omega", 0); + gr.Min, gr.Max); +gr.SubPlot(1, 2, 0); +gr.Plot(a); +gr.Axis(); +gr.Label('x', "\\i t"); +gr.SubPlot(1, 2, 1); +gr.STFA(a, b, 64); +gr.Axis(); +gr.Label('x', "\\i t"); +gr.Label('y', "\\omega", 0); @end verbatim @strong{MGL code} @end ifclear @@ -7119,7 +4995,7 @@ ylabel '\omega' 0 xlabel '\i t' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(2000,1,1); HMDT b = mgl_create_data_size(2000,1,1); @@ -7135,38 +5011,6 @@ mgl_axis(gr,"xy"); mgl_label(gr,'x', "\\i t"); mgl_label(gr,'y', "\\omega"); @end verbatim -@strong{Fortran code} -@verbatim -integer a,b, mgl_create_data_size -a = mgl_create_data_size(2000,1,1) -b = mgl_create_data_size(2000,1,1) -call mgl_data_fill_eq(gr, a, 'cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+ & - cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)',0,0) -call mgl_subplot(gr,1,2,0) -call mgl_plot(gr,a,'') -call mgl_axis(gr,'xy') -call mgl_label(gr,'x', '\i t') -call mgl_subplot(gr,1,2,1) -call mgl_stfa(gr,a,b,64,'',0.) -call mgl_axis(gr,'xy') -call mgl_label(gr,'x', '\i t') -call mgl_label(gr,'y', '\omega') -@end verbatim -@strong{Python} -@verbatim -a, b = mglData(2000), mglData(2000); -gr.Fill(a,"cos(50*pi*x)*(x<-.5)+cos(100*pi*x)*(x<0)*(x>-.5)+ \ - cos(200*pi*x)*(x<.5)*(x>0)+cos(400*pi*x)*(x>.5)"); -gr.SubPlot(1, 2, 0); -gr.Plot(a); -gr.Axis(); -gr.Label('x', "\\i t"); -gr.SubPlot(1, 2, 1); -gr.STFA(a, b, 64); -gr.Axis(); -gr.Label('x', "\\i t"); -gr.Label('y', "\\omega", 0); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node PDE sample, Beam tracing sample, STFA sample, Advanced features @@ -7178,21 +5022,21 @@ gr.Label('y', "\\omega", 0); @c @caption{Example of Partial Differential Eduation solving.}@c @tdref{pde}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a,re(128),im(128); -gr->Axis(); -gr->Label('x', "\\i x"); -gr->Label('y', "\\i z"); +gr.Axis(); +gr.Label('x', "\\i x"); +gr.Label('y', "\\i z"); -re.Fill("exp(-48*(x+0.7)^2)", gr->Min, gr->Max); -a = mglPDE("p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)", re, im, gr->Min, gr->Max, 0.01, 30); +re.Fill("exp(-48*(x+0.7)^2)", gr.Min, gr.Max); +a = mglPDE("p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)", re, im, gr.Min, gr.Max, 0.01, 30); a.Transpose("yxz"); -gr->CAxis(0, 1); -gr->Dens(a,"wyrRk"); -gr->Plot("-x", "k|"); -gr->Puts(mglPoint(0, 0.85), "absorption: (x+z)/2 for x+z>0"); -gr->Title("\\r{Equation:} ik_0\\partial_zu + \\Delta u + x\\cdot u + \ +gr.CAxis(0, 1); +gr.Dens(a,"wyrRk"); +gr.Plot("-x", "k|"); +gr.Puts(mglPoint(0, 0.85), "absorption: (x+z)/2 for x+z>0"); +gr.Title("\\r{Equation:} ik_0\\partial_zu + \\Delta u + x\\cdot u + \ i \\frac{x+z}{2}\\cdot u = 0", "iC", -1.5); @end verbatim @strong{MGL code} @@ -7213,7 +5057,7 @@ text 0 0.85 'absorption: (x+z)/2 for x+z>0' '' -1 title 'Equation: ik_0\partial_zu + \Delta u + x\cdot u + i \frac{x+z}{2}\cdot u = 0' 'iC' -1.5 @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data(); HMDT re = mgl_create_data_size(128,1,1); @@ -7234,45 +5078,6 @@ mgl_delete_data(a); mgl_delete_data(im); mgl_delete_data(re); @end verbatim -@strong{Fortran code} -@verbatim -integer a,re,im, mgl_create_data_size -a = mgl_create_data() -re = mgl_create_data_size(128,1,1) -im = mgl_create_data_size(128,1,1) -call mgl_axis(gr,'xyz') -call mgl_label(gr,'x', '\i x') -call mgl_label(gr,'y', '\i z') -call mgl_data_fill_eq(gr,re,'exp(-48*(x+0.7)^2)', 0, 0) -a = mgl_pde_solve(gr, 'p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)', re, im, 0.01, 30.) -call mgl_data_transpose(a, 'yxz') -call mgl_set_caxis(gr, 0., 1.) -call mgl_dens(gr, a,'wyrRk', -1.) -call mgl_fplot(gr, '-x', 'k|', 100) -call mgl_puts(gr, 0., 0.85, 0., 'absorption: (x+z)/2 for x+z>0') -call mgl_title(gr, '\r{Equation:} ik_0\partial_zu + \Delta u + x\cdot u + & -i \frac{x+z}{2}\cdot u = 0', 'iC', -1.5) -call mgl_delete_data(a) -call mgl_delete_data(im) -call mgl_delete_data(re) -@end verbatim -@strong{Python} -@verbatim -a, re, im = mglData(), mglData(128), mglData(128); -gr.Axis(); -gr.Label('x', "\\i x"); -gr.Label('y', "\\i z"); - -gr.Fill(re,"exp(-48*(x+0.7)^2)"); -a = gr.PDE("p^2+q^2-x-1+i*0.5*(z+x)*(z>-x)", re, im, 0.01, 30); -a.Transpose("yxz"); -gr.SetCRange(0, 1); -gr.Dens(a,"wyrRk"); -gr.Plot("-x", "k|"); -gr.Puts(0, 0.85, 0., "absorption: (x+z)/2 for x+z>0"); -gr.Title("\\r{Equation:} ik_0\\partial_zu + \\Delta u + x\\cdot u + \ -i \\frac{x+z}{2}\\cdot u = 0", "iC", -1.5); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Beam tracing sample, Parser sample, PDE sample, Advanced features @@ -7284,22 +5089,22 @@ i \\frac{x+z}{2}\\cdot u = 0", "iC", -1.5); @c @caption{Example of ray and beam tracing. Compare with @ref{PDE sample}.}@c @tdref{qo2d}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData r, xx, yy, a, im(128), re(128); const char *ham = "p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)"; r = mglRay(ham, mglPoint(-0.7, -1), mglPoint(0, 0.5), 0.02, 2); -gr->Plot(r.SubData(0), r.SubData(1), "k"); -gr->Axis(); gr->Label('x', "\\i x"); gr->Label('y', "\\i z"); +gr.Plot(r.SubData(0), r.SubData(1), "k"); +gr.Axis(); gr.Label('x', "\\i x"); gr.Label('y', "\\i z"); // now start beam tracing -re.Fill("exp(-48*x^2)", gr->Min, gr->Max); +re.Fill("exp(-48*x^2)", gr.Min, gr.Max); a = mglQO2d(ham, re, im, r, 1, 30, &xx, &yy); -gr->CAxis(0, 1); -gr->Dens(xx, yy, a, "wyrRk"); -gr->Plot("-x", "k|"); -gr->Puts(mglPoint(0, 0.85), "absorption: (x+y)/2 for x+y>0"); -gr->Puts(mglPoint(0.7, -0.05), "central ray"); -gr->Title("Beam and ray tracing", "C", -1.5); +gr.CAxis(0, 1); +gr.Dens(xx, yy, a, "wyrRk"); +gr.Plot("-x", "k|"); +gr.Puts(mglPoint(0, 0.85), "absorption: (x+y)/2 for x+y>0"); +gr.Puts(mglPoint(0.7, -0.05), "central ray"); +gr.Title("Beam and ray tracing", "C", -1.5); @end verbatim @strong{MGL code} @end ifclear @@ -7324,7 +5129,7 @@ text 0.5 -0.05 'central ray' 'L' -1 title 'Beam and ray tracing' 'C' -1.5 @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim const char *ham = "p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)"; HMDT r, xx, yy, a, im, re; @@ -7349,53 +5154,6 @@ mgl_delete_data(a); mgl_delete_data(r); mgl_delete_data(xx); mgl_delete_data(yy); mgl_delete_data(im); mgl_delete_data(re); @end verbatim -@strong{Fortran code} -@verbatim -integer r, xx, yy, a, im, re, mgl_create_data_size -integer mgl_data_subdata, mgl_ray_trace, mgl_qo2d_solve -character*64 ham -ham = 'p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)' -im = mgl_create_data_size(128,1,1) -re = mgl_create_data_size(128,1,1) -r = mgl_ray_trace(ham, -0.7, -1., 0., 0., 0.5, 0., 0.02, 2.) -xx = mgl_data_subdata(r,0,-1,-1) -yy = mgl_data_subdata(r,1,-1,-1) -call mgl_plot_xy(gr, xx, yy, 'k') -call mgl_axis(gr,'xyz') -call mgl_label(gr,'x','\i x') -call mgl_label(gr,'y','\i z') -call mgl_data_fill_eq(gr,re,'exp(-48*x^2)', 0, 0) -a = mgl_qo2d_solve(ham, re, im, r, 1., 30., xx, yy) -call mgl_set_caxis(gr,0.,1.) -call mgl_dens_xy(gr,xx, yy, a, 'wyrRk', -1.) -call mgl_fplot(gr,'-x', 'k|',100) -call mgl_puts(gr, 0., 0.85, 0., 'absorption: (x+y)/2 for x+y>0') -call mgl_puts(gr, 0.7, -0.05, 0., 'central ray') -call mgl_title(gr, 'Beam and ray tracing', 'C', -1.5) -call mgl_delete_data(a) -call mgl_delete_data(r) -call mgl_delete_data(xx) -call mgl_delete_data(yy) -call mgl_delete_data(im) -call mgl_delete_data(re) -@end verbatim -@strong{Python} -@verbatim -ham = "p^2+q^2-x-1+i*0.5*(y+x)*(y>-x)"; -r, xx, yy, a = mglData(), mglData(), mglData(), mglData(); -im, re = mglData(128), mglData(128); -r = mglRay(ham, mglPoint(-0.7, -1), mglPoint(0, 0.5), 0.02, 2); -gr.Plot(r.SubData(0), r.SubData(1), "k"); -gr.Axis(); gr.Label('x', "\\i x"); gr.Label('y', "\\i z"); -gr.Fill(re,"exp(-48*x^2)"); -a = mglQO2d(ham, re, im, r, 1, 30, xx, yy); -gr.SetCRange(0, 1); -gr.Dens(xx, yy, a, "wyrRk"); -gr.Plot("-x", "k|"); -gr.Puts(0, 0.85, 0, "absorption: (x+y)/2 for x+y>0"); -gr.Puts(0.7, -0.05, 0, "central ray"); -gr.Title("Beam and ray tracing", "C", -1.5); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Parser sample, Manual ticks sample, Beam tracing sample, Advanced features @@ -7406,7 +5164,7 @@ gr.Title("Beam and ray tracing", "C", -1.5); @image{../png/parser, 7cm} @c @caption{Example of MGL parsing.}@c @tdref{parser}} @end float -@strong{C++ code} +@strong{C++/Python code} @verbatim float a[100]; // let a_i = sin(4*pi*x), x=0...1 for(int i=0;i<100;i++) a[i]=sin(4*M_PI*i/99); @@ -7424,7 +5182,7 @@ parser->Execute(gr, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext"); @verbatim NOT AVAILABLE @end verbatim -@strong{Pure C code} +@strong{C/Fortran code} @verbatim float a[100]; /* let a_i = sin(4*pi*x), x=0...1 */ int i; @@ -7439,46 +5197,6 @@ mgl_parse_text(gr, parser, "xlabel 'x'\nylabel 'y'"); /* also you may use cycles or conditions in script */ mgl_parse_text(gr, parser, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext"); @end verbatim -@strong{Fortran code} -@verbatim -integer i,parser,d, mgl_create_data_size, mgl_create_parser -real a(100) -! let a_i = sin(4*pi*x), x=0...1 -do i = 1,100 - a(i)=sin(4*3.1415926*(i-1)/99) -end do -parser = mgl_create_parser() -d = mgl_add_var(parser, "dat") -call mgl_data_set_real(d,a,100,1,1) ! set data to variable -! I don't know how put new line ('\n') into fortran string -! So call mgl_parse_text() for each string :( -call mgl_parse_text(gr, parser, "plot dat; xrange 0 1") -call mgl_parse_text(gr, parser, "box") -call mgl_parse_text(gr, parser, "axis") -! you may break script at any line do something -! and continue after that -call mgl_parse_text(gr, parser, "xlabel 'x'") -call mgl_parse_text(gr, parser, "ylabel 'y'") -! there is now conditions because I don't know -! how to send several string into parser at once :( -!! also you may use cycles or conditions in script -!call mgl_parse_text(gr, parser, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext") -@end verbatim -@strong{Python} -You may need to use @code{from numpy import *} for defining functions like @code{sin()}. -@verbatim -parser = mglParse(); -dat = parser.AddVar("dat"); -dat.Create(100); -for i in range(100): - dat[i] = sin(4*pi*i/99); -parser.Execute(gr, "plot dat; xrange 0 1\nbox\naxis"); -# you may break script at any line do something -# and continue after that -parser.Execute(gr, "xlabel 'x'\nylabel 'y'"); -# also you may use cycles or conditions in script -parser.Execute(gr, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Manual ticks sample, ColumnPlot sample, Parser sample, Advanced features @@ -7489,13 +5207,13 @@ parser.Execute(gr, "for $0 -1 1 0.1\nline 0 0 -1 $0 'r'\nnext"); @c @caption{Example of manual tick values.}@c @tdref{tval}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim -gr->Axis(mglPoint(-M_PI, 0), mglPoint(M_PI, 2)); -gr->SetTicksVal('x', 6, -M_PI, "-\\pi", -M_PI/2, "-\\pi/2", 0., "0", +gr.Axis(mglPoint(-M_PI, 0), mglPoint(M_PI, 2)); +gr.SetTicksVal('x', 6, -M_PI, "-\\pi", -M_PI/2, "-\\pi/2", 0., "0", 0.886, "x^*", M_PI/2, "\\pi/2", M_PI, "\\pi"); -gr->Axis(); gr->Grid(); -gr->Plot("2*cos(x^2)^2", "r2", NAN, 300); +gr.Axis(); gr.Grid(); +gr.Plot("2*cos(x^2)^2", "r2", NAN, 300); @end verbatim @strong{MGL code} @end ifclear @@ -7507,7 +5225,7 @@ grid fplot '2*cos(x^2)^2' 'r2' nan 300 @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim mgl_set_axis_2d(gr, -M_PI, 0, M_PI, 2); mgl_set_ticks_val(gr, 'x', 6, -M_PI, "-\\pi", -M_PI/2, "-\\pi/2", @@ -7516,20 +5234,6 @@ mgl_axis(gr,"xyz"); mgl_axis_grid(gr,"xyz", "B-"); mgl_fplot(gr, "2*cos(x^2)^2", "r2", 300); @end verbatim -@strong{Fortran code} -@verbatim -NOT AVAILABLE -@end verbatim -@strong{Python} -@verbatim -gr.SetRanges(-pi, pi, 0, 2); -parser = mglParse(); -# very "stupid" way because SWIG not support variable arguments -parser.Execute(gr, "xtick -pi '-\pi' -1.571 '-\pi/2' 0 '0' " - "0.886 'x^*' 1.571 '\pi/2' pi '\pi'"); -gr.Axis(); gr.Grid(); -gr.Plot("2*cos(x^2)^2", "r2", 300); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node ColumnPlot sample, StickPlot sample, Manual ticks sample, Advanced features @@ -7540,17 +5244,17 @@ gr.Plot("2*cos(x^2)^2", "r2", 300); @c @caption{Example of ColumnPlot.}@c @tdref{column}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim char str[32]; for(int i=0;i<4;i++) { - gr->ColumnPlot(4,i); - gr->Box(); + gr.ColumnPlot(4,i); + gr.Box(); sprintf(str,"Plot %d of 4",i); - gr->Text(mglPoint(-0.5,0.5),str); + gr.Text(mglPoint(-0.5,0.5),str); sprintf(str,"sin(pi*x+pi*%d/2)",i); - gr->Plot(str); + gr.Plot(str); } @end verbatim @strong{MGL code} @@ -7564,7 +5268,7 @@ fplot 'sin(pi*x+pi*$1/2)' next @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim int i; char str[32]; @@ -7578,14 +5282,6 @@ for(i=0;i<4;i++) mgl_fplot(gr,str,"",100); } @end verbatim -@strong{Fortran code} -@verbatim -NOT AVAILABLE -@end verbatim -@strong{Python} -@verbatim -NOT AVAILABLE -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node StickPlot sample, Stereo image sample, ColumnPlot sample, Advanced features @@ -7596,19 +5292,19 @@ NOT AVAILABLE @c @caption{Example of StickPlot.}@c @tdref{stick}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim -gr->SetRanges(-1, 1, -1, 1, 0, 1); gr->Light(true); -gr->StickPlot(3, 0, 40, 30); gr->Axis("xyz_"); -gr->Surf("exp(-10*y^2-6*x^2)"); -gr->Text(mglPoint(0.2, 0, 1.2), "z=0", "", -2); -gr->StickPlot(3, 1, 40, 30); gr->Axis("xyz_"); -gr->Surf("exp(-10*y^2/2-6*x^2)/sqrt(2)"); -gr->Text(mglPoint(0.2, 0, 1.2), "z=1", "", -2); -gr->StickPlot(3, 2, 40, 30); gr->Axis("xyz_"); -gr->Surf("exp(-10*y^2/5-6*x^2)/sqrt(5)"); -gr->Text(mglPoint(0.2, 0, 1.2), "z=2", "", -2); -gr->Label('x',"\\tau", 0); gr->Label('y', "\\rho"); +gr.SetRanges(-1, 1, -1, 1, 0, 1); gr.Light(true); +gr.StickPlot(3, 0, 40, 30); gr.Axis("xyz_"); +gr.Surf("exp(-10*y^2-6*x^2)"); +gr.Text(mglPoint(0.2, 0, 1.2), "z=0", "", -2); +gr.StickPlot(3, 1, 40, 30); gr.Axis("xyz_"); +gr.Surf("exp(-10*y^2/2-6*x^2)/sqrt(2)"); +gr.Text(mglPoint(0.2, 0, 1.2), "z=1", "", -2); +gr.StickPlot(3, 2, 40, 30); gr.Axis("xyz_"); +gr.Surf("exp(-10*y^2/5-6*x^2)/sqrt(5)"); +gr.Text(mglPoint(0.2, 0, 1.2), "z=2", "", -2); +gr.Label('x',"\\tau", 0); gr.Label('y', "\\rho"); @end verbatim @strong{MGL code} @end ifclear @@ -7626,7 +5322,7 @@ text 0.2 0 1.2 'z=2' '' -2 xlabel '\tau' 0 : ylabel '\rho' @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim mgl_set_axis_3d(gr, -1, -1, 0, 1, 1, 1); mgl_set_light(gr, 1); @@ -7645,24 +5341,6 @@ mgl_text(gr, 0.2, 0, 1.2, "z=2"); mgl_label(gr,'x',"\\tau"); mgl_label(gr,'y', "\\rho"); @end verbatim -@strong{Fortran code} -@verbatim -NOT AVAILABLE -@end verbatim -@strong{Python} -@verbatim -gr->SetRanges(-1, 1, -1, 1, 0, 1); gr->Light(true); -gr->StickPlot(3, 0, 40, 30); gr->Axis("xyz_"); -gr->Surf("exp(-10*y^2-6*x^2)"); -gr->Text(mglPoint(0.2, 0, 1.2), "z=0", "", -2); -gr->StickPlot(3, 1, 40, 30); gr->Axis("xyz_"); -gr->Surf("exp(-10*y^2/2-6*x^2)/sqrt(2)"); -gr->Text(mglPoint(0.2, 0, 1.2), "z=1", "", -2); -gr->StickPlot(3, 2, 40, 30); gr->Axis("xyz_"); -gr->Surf("exp(-10*y^2/5-6*x^2)/sqrt(5)"); -gr->Text(mglPoint(0.2, 0, 1.2), "z=2", "", -2); -gr->Label('x',"\\tau", 0); gr->Label('y', "\\rho"); -@end verbatim @end ifclear @c ------------------------------------------------------------------ @node Stereo image sample, , StickPlot sample, Advanced features @@ -7672,17 +5350,17 @@ gr->Label('x',"\\tau", 0); gr->Label('y', "\\rho"); @c @caption{Example of stereo image.}@c @tdref{stereo}} @end float @ifclear UDAV -@strong{C++ code} +@strong{C++/Python code} @verbatim mglData a(50,40); a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))"); -gr->Light(true); -gr->SubPlot(2,1,0); -gr->Rotate(40,60+3); -gr->Box(); gr->Surf(a); -gr->SubPlot(2,1,1); -gr->Rotate(40,60-3); -gr->Box(); gr->Surf(a); +gr.Light(true); +gr.SubPlot(2,1,0); +gr.Rotate(40,60+3); +gr.Box(); gr.Surf(a); +gr.SubPlot(2,1,1); +gr.Rotate(40,60-3); +gr.Box(); gr.Surf(a); @end verbatim @strong{MGL code} @end ifclear @@ -7698,7 +5376,7 @@ rotate 40 60-3 box:surf a @end verbatim @ifclear UDAV -@strong{Pure C code} +@strong{C/Fortran code} @verbatim HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); @@ -7713,33 +5391,5 @@ mgl_box(gr,1); mgl_surf(gr,a,0); mgl_delete_data(a); @end verbatim -@strong{Fortran code} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(50,40,1); -call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); -call mgl_set_light(gr,1) -call mgl_subplot(gr,2,1,0) -call mgl_rotate(gr,40.,60.+3.,0.) -call mgl_box(gr,1) -call mgl_surf(gr,a,'') -call mgl_subplot(gr,2,1,1) -call mgl_rotate(gr,40.,60.-3.,0.) -call mgl_box(gr,1) -call mgl_surf(gr,a,'') -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(50,40); -a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))"); -gr.Light(True); -gr.SubPlot(2,1,0); -gr.Rotate(40,60+3); -gr.Surf(a); gr.Box(); -gr.SubPlot(2,1,1); -gr.Rotate(40,60-3); -gr.Surf(a); gr.Box(); -@end verbatim @end ifclear diff --git a/texinfo/samples_ru.texi b/texinfo/samples_ru.texi index a60a6b9..1c2e5b6 100644 --- a/texinfo/samples_ru.texi +++ b/texinfo/samples_ru.texi @@ -2524,7 +2524,6 @@ gr.Colorbar(); @menu * Surf3 sample:: * Cloud sample:: -* CloudP sample:: * Dens3 sample:: * Cont3 sample:: * ContF3 sample:: @@ -2598,7 +2597,7 @@ gr.Surf3(a); @end verbatim @end ifclear @c ------------------------------------------------------------------ -@node Cloud sample, CloudP sample, Surf3 sample, 3D plotting samples +@node Cloud sample, Dens3 sample, Surf3 sample, 3D plotting samples @subsection Cloud -- пример использования @cindex Cloud @float @@ -2657,53 +2656,7 @@ gr.Cloud(a,"wyrRk"); @end verbatim @end ifclear @c ------------------------------------------------------------------ -@node CloudP sample, Dens3 sample, Cloud sample, 3D plotting samples -@subsection CloudP -- пример использования -@cindex CloudP -@float -@image{../png/cloudp, 7cm} -@c @caption{Example of CloudP. @tdref{cloudp}} -@end float -@ifclear UDAV -@strong{C++ код} -@verbatim -mglData a(60,50,40); -a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr->Rotate(40,60); -gr->Alpha(true); -gr->Box(); -gr->CloudP(a,"wyrRk"); -@end verbatim -@strong{MGL скрипт} -@end ifclear -Not available. -@ifclear UDAV -@strong{C-ый код} -@verbatim -HMDT a = mgl_create_data_size(60,50,40); -mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -mgl_rotate(gr,40.,60.,0.); -mgl_set_alpha(gr,1); -mgl_box(gr,1); -mgl_cloudp(gr,a,"wyrRk",1.); -mgl_delete_data(a); -@end verbatim -@strong{Fortran} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_set_alpha(gr,1) -call mgl_box(gr,1) -call mgl_cloudp(gr,a,'wyrRk',1.) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -Not available. -@end ifclear -@c ------------------------------------------------------------------ -@node Dens3 sample, Cont3 sample, CloudP sample, 3D plotting samples +@node Dens3 sample, Cont3 sample, Cloud sample, 3D plotting samples @subsection Dens3 -- пример использования @cindex Dens3 @cindex Axis @@ -5422,7 +5375,6 @@ subplot 2 2 3: rotate 40 60: axial a: box * Mirrored surface sample:: * Cont with labels sample:: * Ternary plot sample:: -* Coloring by coordinates sample:: * Drops sample:: * Molecules drawing sample:: @end menu @@ -5979,7 +5931,7 @@ gr.Cont(a,"BbcyrRt"); @end verbatim @end ifclear @c ------------------------------------------------------------------ -@node Ternary plot sample, Coloring by coordinates sample, Cont with labels sample, Additional features +@node Ternary plot sample, Drops sample, Cont with labels sample, Additional features @subsection Ternary plot -- пример использования @cindex Ternary @float @@ -6105,62 +6057,9 @@ gr.Label("y","y comp."); gr.Label("t","t comp."); @end verbatim @end ifclear + @c ------------------------------------------------------------------ -@node Coloring by coordinates sample, Drops sample, Ternary plot sample, Additional features -@subsection Окрашивание по положению грани -@cindex Surf3 -@float -@image{../png/surf3_rgbd, 7cm} -@c @caption{Example of Surf3 colored by coordinates. @tdref{surf3_rgbd}} -@end float -@ifclear UDAV -@strong{C++ код} -@verbatim -mglData a(60,50,40); -a.Modify("-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)"); -gr->Rotate(40,60); -gr->Box(); -gr->Surf3(a,"bgrd"); -@end verbatim -@strong{MGL скрипт} -@end ifclear -@verbatim -new a 60 50 40 -modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)' -rotate 40 60 -box -surf3 a 'bgrd' -@end verbatim -@ifclear UDAV -@strong{C-ый код} -@verbatim -HMDT a = mgl_create_data_size(60,50,40); -mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -mgl_rotate(gr,40.,60.,0.); -mgl_box(gr,1); -mgl_surf3(gr,a,"bgrd",3); -mgl_delete_data(a); -@end verbatim -@strong{Fortran} -@verbatim -integer a, mgl_create_data_size -a = mgl_create_data_size(60,50,40); -call mgl_data_modify(a,"-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)",0); -call mgl_rotate(gr,40.,60.,0.) -call mgl_box(gr,1) -call mgl_surf3(gr,a,'bgrd',3) -call mgl_delete_data(a) -@end verbatim -@strong{Python} -@verbatim -a = mglData(60,50,40); -a.Modify("-2*((2*x-1)^2+(2*y-1)^2+(2*z-1)^4-(2*z-1)^2-0.1)"); -gr.Rotate(40,60); gr.Box(); -gr.Surf3(a,"bgrd"); -@end verbatim -@end ifclear -@c ------------------------------------------------------------------ -@node Drops sample, Molecules drawing sample, Coloring by coordinates sample, Additional features +@node Drops sample, Molecules drawing sample, Quaternary plot sample, Additional features @subsection Drops -- пример использования @cindex Drop @float diff --git a/texinfo/widget_en.texi b/texinfo/widget_en.texi index eff4705..b03c5ef 100644 --- a/texinfo/widget_en.texi +++ b/texinfo/widget_en.texi @@ -1,66 +1,143 @@ @c ------------------------------------------------------------------ @chapter Widget classes -@cindex mglGraphFLTK -@cindex mglGraphQT -@cindex mglGraphGLUT +@cindex mglWindow +@cindex mglGLUT @cindex Fl_MathGL @cindex QMathGL @cindex window @cindex widgets -There are set of ``window'' classes for making a window with MathGL graphics: @code{mglGraphFLTK}, @code{mglGraphQT}, @code{mglGraphGLUT}. All these classes allow user to show, rotate, export, and change view of the plot using keyboard. Most of them (except @code{mglGraphGLUT}) also have toolbar and menu for simplifying plot manipulation. Usually these classes (except @code{mglGraphGLUT}) are derived from @code{mglGraphZB} class and have a ``connected'' class for widget in corresponding window library. All window classes have the same set of functions (@pxref{mglGraphAB class}). Below the full list of classes with short comments. +There are set of ``window'' classes for making a window with MathGL graphics: @code{mglCavasW} and derived for developers, @code{mglWindow} and @code{mglGLUT} for user-level, @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. -@deftp {Class} mglGraphFLTK -Class @code{mglGraphFLTK} adds the possibility to create plotting window with the help of FLTK library. It allows one to show, rotate, export, and change view of the plot by keyboard, menu and toolbar. ``Corresponding'' widget class is @code{Fl_MathGL}. Class is defined in @code{#include }. -@end deftp +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 +{ +public: + virtual int Draw(mglGraph *) { return 0; }; + virtual void Reload() {}; +}; +@end verbatim +You should inherit yours class from @code{mglDraw} and reimplement one or both functions for drawing. -@deftp {Class} Fl_MathGL -Class is FLTK widget for displaying the MathGL output. Class is defined in @code{#include }. -@end deftp +@menu +* mglWindow class:: +* Fl_MathGL class:: +* QMathGL class:: +@end menu -@float -@image{fltk, 7cm} -@caption{Example of FLTK window with MathGL plot.} -@end float -@deftp {Class} mglGraphQT -Class @code{mglGraphQT} adds the possibility to create plotting window with the help of QT library. It allows one to show, rotate, export, and change view of the plot by keyboard, menu and toolbar. ``Corresponding'' widget class is @code{QMathGL}. Class is defined in @code{#include }. -@end deftp +@c ------------------------------------------------------------------ +@node mglWindow class, Fl_MathGL class, , Widget classes +@section mglWindow class +@cindex mglWindow +@cindex window +@c @cindex mglDraw -@deftp {Class} QMathGL -Class is Qt widget for dysplaying the MathGL output. Class is defined in @code{#include }. -@end deftp +This class is derived from mglGraph class (@pxref{MathGL core}). It provide many methods for handling window with MathGL graphics. -@float -@image{qt, 7cm} -@caption{Example of Qt window with MathGL plot.} -@end float +@deftypefn {Constructor on @code{mglWindow}} {} mglWindow (@code{int} kind=@code{0}, @code{int} (*draw)(@code{HMGL} gr, @code{void *}p)=@code{NULL}, @code{const char *}title=@code{"MathGL"}, @code{void *}par=@code{NULL}) +@deftypefnx {Constructor on @code{mglWindow}} {} mglWindow (@code{int} kind=@code{0}, @code{int} (*draw)(@code{mglGraph *}gr), @code{const char *}title=@code{"MathGL"}) +@deftypefnx {Constructor on @code{mglWindow}} {} mglWindow (@code{int} kind=@code{0}, @code{mglDraw *}draw, @code{const char *}title=@code{"MathGL"}) +@deftypefnx {C function} @code{HMGL} mgl_create_graph_qt (@code{int} (*draw)(@code{HMGL} gr, @code{void *}p), @code{const char *}title, @code{void *}par) +@deftypefnx {C function} @code{HMGL} mgl_create_graph_fltk (@code{int} (*draw)(@code{HMGL} gr, @code{void *}p), @code{const char *}title, @code{void *}par) +@deftypefnx {C function} @code{HMGL} mgl_create_graph_glut (@code{int} (*draw)(@code{HMGL} gr, @code{void *}p), @code{const char *}title, @code{void *}par) -@deftp {Class} mglGraphGLUT -Class @code{mglGraphGLUT} adds the possibility to create plotting window with the help of GLUT library. It allows one to show, rotate, export, and change view of the plot only by keyboard. Class is defined in @code{#include }. -@end deftp +Creates a window for plotting. Parameter @var{draw} sets a pointer to drawing function (this is the name of function) or instance of @code{mglDraw} class. There is support of a list of plots (frames). So as one can prepare a set of frames at first and redraw it fast later (but it requires more memory). Function should return positive number of frames for the list or zero if it will plot directly. Note, that @var{draw} can be @code{NULL} for displaying static bitmaps only (no animation or slides). Parameter @var{title} sets the title of the window. Parameter @var{par} contains pointer to data for the plotting function @var{draw}. Parameter @var{kind} may have following values: @samp{0} -- use FLTK window, @samp{1} -- use Qt window. -@float -@image{glut, 7cm} -@caption{Example of GLUT window with MathGL plot.} -@end float +There are some keys handles for manipulating by the plot: 'a', 'd', 'w', 's' for the rotating; ',', '.' for viewing of the previous or next frames in the list; 'r' for the switching of transparency; 'f' for the switching of lightning; 'x' for hiding (closing) the window. -@menu -* Fl_MathGL class:: -* QMathGL class:: -@end menu +@strong{IMPORTANT!!!} You need to add a call of Rotate() (@pxref{Transformation matrix}) function for having possibility of plot rotation. If plot should be unrotated by default just add @code{Rotate(0,0)} in drawing function. +@end deftypefn + +@deftypefn {Method on @code{mglWindow}} @code{void} Run () +@deftypefnx {C function} @code{HMGL} mgl_qt_run () +@deftypefnx {C function} @code{HMGL} mgl_fltk_run () +Run main loop for event handling. Usually it should be called in a separate thread or as last function call in @code{main()}. +@end deftypefn + +@deftypefn {Method on @code{mglWindow}} @code{void} ToggleAlpha () +@deftypefnx {C function} @code{int} mgl_wnd_toggle_alpha (@code{HMGL} gr) +Switch on/off transparency but do not overwrite switches in user drawing function. +@end deftypefn +@deftypefn {Method on @code{mglWindow}} @code{void} ToggleLight () +@deftypefnx {C function} @code{int} mgl_wnd_toggle_light (@code{HMGL} gr) +Switch on/off lighting but do not overwrite switches in user drawing function. +@end deftypefn +@deftypefn {Method on @code{mglWindow}} @code{void} ToggleRotate () +@deftypefnx {C function} @code{int} mgl_wnd_toggle_rotate (@code{HMGL} gr) +Switch on/off rotation by mouse. Usually, left button is used for rotation, middle button for shift, right button for zoom/perspective. +@end deftypefn +@deftypefn {Method on @code{mglWindow}} @code{void} ToggleNo () +@deftypefnx {C function} @code{int} mgl_wnd_toggle_no (@code{HMGL} gr) +Switch off all zooming and rotation and restore initial state. +@end deftypefn +@deftypefn {Method on @code{mglWindow}} @code{void} Update () +@deftypefnx {C function} @code{int} mgl_wnd_update (@code{HMGL} gr) +Update window contents. +@end deftypefn +@deftypefn {Method on @code{mglWindow}} @code{void} ReLoad () +@deftypefnx {C function} @code{int} mgl_wnd_reload (@code{HMGL} gr) +Reload user data and update picture. +@end deftypefn +@deftypefn {Method on @code{mglWindow}} @code{void} Adjust () +@deftypefnx {C function} @code{int} mgl_wnd_adjust (@code{HMGL} gr) +Adjust size of bitmap to window size. +@end deftypefn +@deftypefn {Method on @code{mglWindow}} @code{void} NextFrame () +@deftypefnx {C function} @code{int} mgl_wnd_next_frame (@code{HMGL} gr) +Show next frame if one. +@end deftypefn +@deftypefn {Method on @code{mglWindow}} @code{void} PrevFrame () +@deftypefnx {C function} @code{int} mgl_wnd_prev_frame (@code{HMGL} gr) +Show previous frame if one. +@end deftypefn +@deftypefn {Method on @code{mglWindow}} @code{void} Animation () +@deftypefnx {C function} @code{int} mgl_wnd_animation (@code{HMGL} gr) +Run/stop slideshow (animation) of frames. +@end deftypefn + +@deftypefn {Method on @code{mglWindow}} @code{void} SetDelay (@code{float} dt) +@deftypefnx {C function} @code{int} mgl_wnd_set_delay (@code{HMGL} gr, @code{int} dt) +Sets delay for animation in seconds. Default value is 1 sec. +@end deftypefn + +@deftypefn {Method on @code{mglWindow}} @code{void} Setup (@code{bool} autoclf, @code{bool} showpos, @code{bool} clfupd) +@deftypefnx {C function} @code{int} mgl_setup_window (@code{HMGL} gr, @code{bool} autoclf, @code{bool} showpos, @code{bool} clfupd) +Enable/disable flags for: +@itemize @bullet +@item +clearing canvas between drawing. You may switch it off for accumulate previous drawing (for example some points or parts of a picture). +@item +showing the last mouse click position in the widget. +@item +clearing plot before Update(). +@end itemize +@end deftypefn + +@deftypefn {Method on @code{mglWindow}} @code{mglPoint} LastMousePos () +@deftypefnx {C function} @code{int} mgl_get_last_mouse_pos (@code{HMGL} gr, @code{float *}x, @code{float *}y, @code{float *}z) +Gets last position of mouse click. +@end deftypefn @c ------------------------------------------------------------------ -@node Fl_MathGL class, QMathGL class, , Widget classes +@node Fl_MathGL class, QMathGL class, mglWindow class, Widget classes @section Fl_MathGL class @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 }). -@deftypemethod Fl_MathGL @code{void} set_draw (@code{mglDraw *}dr) -Sets drawing function from a class inherited from @code{mglDraw}. +@float +@image{fltk, 7cm} +@caption{Example of FLTK window with MathGL plot.} +@end float + +@deftypemethod Fl_MathGL @code{void} set_draw (@code{int} (*draw)(@code{HMGL} gr, @code{void *}p)) +@deftypemethodx Fl_MathGL @code{void} set_draw (@code{int} (*draw)(@code{mglGraph *}gr)) +@deftypemethodx Fl_MathGL @code{void} set_draw (@code{mglDraw *}draw) +Sets drawing function as global function as one from a class @code{mglDraw}. There is support of a list of plots (frames). So as one can prepare a set of frames at first and redraw it fast later (but it requires more memory). Function should return positive number of frames for the list or zero if it will plot directly. Parameter @var{par} contains pointer to data for the plotting function @var{draw}. @end deftypemethod @deftypemethod Fl_MathGL @code{void} update (@code{mglGraph *}gr=@code{NULL}) Update (redraw) plot using grapher @var{gr} (built-in by default). @@ -68,40 +145,33 @@ Update (redraw) plot using grapher @var{gr} (built-in by default). @deftypemethod Fl_MathGL @code{void} set_angle (@code{float} t, @code{float} p) Set angles for additional plot rotation @end deftypemethod -@deftypemethod Fl_MathGL @code{void} set_state (@code{int} f) +@deftypemethod Fl_MathGL @code{void} set_flag (@code{int} f) Set bitwise flags for general state (1-Alpha, 2-Light) @end deftypemethod -@deftypemethod Fl_MathGL @code{void} set_state (@code{bool} z, @code{bool} r) -Set flags for handling mouse: @var{z}=@code{true} allow zooming, @var{r}=@code{true} allow rotation/shifting/perspective and so on. -@end deftypemethod -@deftypemethod Fl_MathGL @code{void} set_zoom (@code{float} X1, @code{float} Y1, @code{float} X2, @code{float} Y2) -Set zoom in/out region -@end deftypemethod -@deftypemethod Fl_MathGL @code{void} get_zoom (@code{float *}X1, @code{float *}Y1, @code{float *}X2, @code{float *}Y2) -Get zoom in/out region +@deftypemethod Fl_MathGL @code{void} set_state (@code{bool} r) +Set flags for handling mouse: +@c @var{z}=@code{true} allow zooming, +@var{r}=@code{true} allow rotation/shifting/perspective and so on. @end deftypemethod + @deftypemethod Fl_MathGL @code{void} set_popup (@code{const Fl_Menu_Item *}pmenu, @code{Fl_Widget *}w, @code{void *}v) Set popup menu pointer @end deftypemethod -@deftypemethod Fl_MathGL @code{mglGraph *} get_graph () -Get pointer to grapher + +@deftypemethod Fl_MathGL @code{void} set_graph (@code{mglCanvas *}gr) +@deftypemethodx Fl_MathGL @code{void} set_graph (@code{mglGraph *}gr) +Set new grapher instead of built-in one. Note that Fl_MathGL will automatically delete this object at destruction or at new @code{setGraph()} call. +@end deftypemethod +@deftypemethod Fl_MathGL @code{HMGL} get_graph () +Get pointer to grapher. @end deftypemethod -@deftypecv {Widget option} Fl_MathGL @code{Fl_Valuator *} tet_val +@deftypecv {Fl_MathGL option} Fl_MathGL @code{Fl_Valuator *} tet_val Pointer to external tet-angle validator. @end deftypecv -@deftypecv {Widget option} Fl_MathGL @code{Fl_Valuator *} phi_val +@deftypecv {Fl_MathGL option} Fl_MathGL @code{Fl_Valuator *} phi_val Pointer to external phi-angle validator. @end deftypecv -@deftypecv {Widget option} Fl_MathGL @code{mglGraphAB *} graph -Pointer to grapher -@end deftypecv -@deftypecv {Widget option} Fl_MathGL @code{void *} draw_par -Parameters for drawing function mglGraph::DrawFunc. -@end deftypecv -@deftypecv {Widget option} Fl_MathGL @code{int (*} draw_func @code{)(mglGraph *gr, void *par)} -Drawing function for window procedure. It should return the number of frames. -@end deftypecv @c ------------------------------------------------------------------ @node QMathGL class, , Fl_MathGL class, Widget classes @@ -109,17 +179,27 @@ Drawing function for window procedure. It should return the number of frames. @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 }). + +@float +@image{qt, 7cm} +@caption{Example of Qt window with MathGL plot.} +@end float @deftypemethod QMathGL @code{void} setDraw (@code{mglDraw *}dr) Sets drawing functions from a class inherited from @code{mglDraw}. @end deftypemethod -@deftypemethod QMathGL @code{void} setDraw (@code{int (*}draw)(@code{mglGraph *}gr, @code{void *}p), @code{void *}par=@code{NULL}) +@deftypemethod QMathGL @code{void} setDraw (@code{int (*}draw)(@code{mglBase *}gr, @code{void *}p), @code{void *}par=@code{NULL}) +@deftypemethodx QMathGL @code{void} setDraw (@code{int (*}draw)(@code{mglGraph *}gr, @code{void *}p)) Sets the drawing function @var{draw}. There is support of a list of plots (frames). So as one can prepare a set of frames at first and redraw it fast later (but it requires more memory). Function should return positive number of frames for the list or zero if it will plot directly. Parameter @var{par} contains pointer to data for the plotting function @var{draw}. @end deftypemethod -@deftypemethod QMathGL @code{void} setGraph (@code{mglGraphAB *}gr) -Set pointer to external grapher (instead of built-in @code{mglGraphZB}). Note that QMathGL will automatically delete this object at destruction or at new @code{setGraph()} call. +@deftypemethod QMathGL @code{void} setGraph (@code{mglCanvas *}gr) +@deftypemethodx QMathGL @code{void} setGraph (@code{mglGraph *}gr) +Set pointer to external grapher (instead of built-in @code{mglCanvas}). Note that QMathGL will automatically delete this object at destruction or at new @code{setGraph()} call. +@end deftypemethod +@deftypemethod QMathGL @code{HMGL} getGraph () +Get pointer to grapher. @end deftypemethod @deftypemethod QMathGL @code{void} setPopup (@code{QMenu *}p) @@ -147,143 +227,102 @@ Get transparency state. @deftypemethod QMathGL @code{bool} getLight () Get lightning state. @end deftypemethod -@deftypemethod QMathGL @code{bool} getZoom () -Get mouse zooming state. -@end deftypemethod @deftypemethod QMathGL @code{bool} getRotate () Get mouse rotation state. @end deftypemethod -@defop Slot QMathGL @code{void} refresh () + +@deftypefn {Slot on @code{QMathGL}} @code{void} refresh () Redraw saved bitmap without executing drawing function. -@end defop -@defop Slot QMathGL @code{void} update (@code{mglGraph *}gr=@code{NULL}) +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} update (@code{mglCanvas *}gr=@code{NULL}) Update picture by executing drawing function. -@end defop -@defop Slot QMathGL @code{void} copy () +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} copy () Copy graphics to clipboard. -@end defop -@defop Slot QMathGL @code{void} setPer (@code{int} val) +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} setPer (@code{int} val) Set perspective value. -@end defop -@defop Slot QMathGL @code{void} setPhi (@code{int} val) +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} setPhi (@code{int} val) Set Phi-angle value. -@end defop -@defop Slot QMathGL @code{void} setTet (@code{int} val) +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} setTet (@code{int} val) Set Theta-angle value. -@end defop -@defop Slot QMathGL @code{void} setAlpha (@code{bool} val) +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} setAlpha (@code{bool} val) Switch on/off transparency. -@end defop -@defop Slot QMathGL @code{void} setLight (@code{bool} val) +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} setLight (@code{bool} val) Switch on/off lightning. -@end defop -@defop Slot QMathGL @code{void} setZoom (@code{bool} val) -Switch on/off mouse zooming. -@end defop -@defop Slot QMathGL @code{void} setRotate (@code{bool} val) +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} setRotate (@code{bool} val) Switch on/off mouse rotation. -@end defop -@defop Slot QMathGL @code{void} zoomIn () -Zoom in graphics. -@end defop -@defop Slot QMathGL @code{void} zoomOut () -Zoom out graphics. -@end defop -@defop Slot QMathGL @code{void} restore () +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} restore () Restore zoom and rotation to default values. -@end defop -@defop Slot QMathGL @code{void} reload () -Reload data and redraw graphics. -@end defop -@defop Slot QMathGL @code{void} shiftLeft () -Shift graphics to left direction. -@end defop -@defop Slot QMathGL @code{void} shiftRight () -Shift graphics to right direction. -@end defop -@defop Slot QMathGL @code{void}shiftUp () -Shift graphics to up direction. -@end defop -@defop Slot QMathGL @code{void} shiftDown () -Shift graphics to down direction. -@end defop -@defop Slot QMathGL @code{void} exportPNG (@code{QString} fname=@code{""}) +@end deftypefn +@c @deftypefn {Slot on @code{QMathGL}} @code{void} reload () +@c Reload data and redraw graphics. +@c @end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} exportPNG (@code{QString} fname=@code{""}) Export current picture to PNG file. -@end defop -@defop Slot QMathGL @code{void} exportPNGs (@code{QString} fname=@code{""}) +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} exportPNGs (@code{QString} fname=@code{""}) Export current picture to PNG file (no transparency). -@end defop -@defop Slot QMathGL @code{void} exportJPG (@code{QString} fname=@code{""}) +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} exportJPG (@code{QString} fname=@code{""}) Export current picture to JPEG file. -@end defop -@defop Slot QMathGL @code{void} exportBPS (@code{QString} fname=@code{""}) +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} exportBPS (@code{QString} fname=@code{""}) Export current picture to bitmap EPS file. -@end defop -@defop Slot QMathGL @code{void} exportEPS (@code{QString} fname=@code{""}) +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} exportEPS (@code{QString} fname=@code{""}) Export current picture to vector EPS file. -@end defop -@defop Slot QMathGL @code{void} exportSVG (@code{QString} fname=@code{""}) +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} exportSVG (@code{QString} fname=@code{""}) Export current picture to SVG file. -@end defop -@defop Slot QMathGL @code{void} exportIDTF (@code{QString} fname=@code{""}) +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} exportIDTF (@code{QString} fname=@code{""}) Export current picture to IDTF file. -@end defop -@defop Slot QMathGL @code{void} setMGLFont (@code{QString} path) +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} setMGLFont (@code{QString} path) Restore (@var{path}=@code{""}) or load font for graphics. -@end defop -@defop Slot QMathGL @code{void} print () +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} print () Print current picture -@end defop -@defop Slot QMathGL @code{void} adjust () -Adjust plot size to fill entire window. This function is executed only if graph is mglGraphQT instance. -@end defop -@defop Slot QMathGL @code{void} nextSlide () -Show next slide. This function is executed only if graph is mglGraphQT instance. -@end defop -@defop Slot QMathGL @code{void} prevSlide () -Show previous slide. This function is executed only if graph is mglGraphQT instance. -@end defop -@defop Slot QMathGL @code{void} animation (@code{bool} st=@code{true}) -Start animation. This function is executed only if graph is mglGraphQT instance. -@end defop -@defop Slot QMathGL @code{void} about () +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} about () Show about information. -@end defop -@defop Slot QMathGL @code{void} aboutQt () +@end deftypefn +@deftypefn {Slot on @code{QMathGL}} @code{void} aboutQt () Show information about Qt version. -@end defop +@end deftypefn -@defop Signal QMathGL @code{void} phiChanged (@code{int} val) +@deftypefn {Signal on @code{QMathGL}} @code{void} phiChanged (@code{int} val) Phi angle changed (by mouse or by toolbar). -@end defop -@defop Signal QMathGL @code{void} tetChanged (@code{int} val) +@end deftypefn +@deftypefn {Signal on @code{QMathGL}} @code{void} tetChanged (@code{int} val) Tet angle changed (by mouse or by toolbar). -@end defop -@defop Signal QMathGL @code{void} perChanged (@code{int} val) +@end deftypefn +@deftypefn {Signal on @code{QMathGL}} @code{void} perChanged (@code{int} val) Perspective changed (by mouse or by toolbar). -@end defop -@defop Signal QMathGL @code{void} alphaChanged (@code{bool} val) +@end deftypefn +@deftypefn {Signal on @code{QMathGL}} @code{void} alphaChanged (@code{bool} val) Transparency changed (by toolbar). -@end defop -@defop Signal QMathGL @code{void} lightChanged (@code{bool} val) +@end deftypefn +@deftypefn {Signal on @code{QMathGL}} @code{void} lightChanged (@code{bool} val) Lighting changed (by toolbar). -@end defop -@defop Signal QMathGL @code{void} zoomChanged (@code{bool} val) -Zooming changed (by toolbar). -@end defop -@defop Signal QMathGL @code{void} rotateChanged (@code{bool} val) +@end deftypefn +@deftypefn {Signal on @code{QMathGL}} @code{void} rotateChanged (@code{bool} val) Rotation changed (by toolbar). -@end defop +@end deftypefn -@deftypecv {Widget option} QMathGL @code{QString} appName +@deftypecv {QMathGL option} QMathGL @code{QString} appName Application name for message boxes. @end deftypecv -@deftypecv {Widget option} QMathGL @code{bool} autoResize +@deftypecv {QMathGL option} QMathGL @code{bool} autoResize Allow auto resizing (default is false). @end deftypecv -@deftypecv {Widget option} QMathGL @code{int} animDelay -Animation delay in ms. -@end deftypecv diff --git a/todo.txt b/todo.txt new file mode 100644 index 0000000..d44d679 --- /dev/null +++ b/todo.txt @@ -0,0 +1,66 @@ +============= TEST ============= +1. Triangulation +2. Axis -- projection (ternary + quaternary) + +============= NEW ============= + +01. BeltP() -- analogue of FlowP() but by belt -- fixed and variable width of belt. Color depend on vector field. +02. Box() + edges + half-transparent +03. Parallelization of drawing (MathGL level) +04. Export to LaTeX formats - (pgf/tikz -- vector + bitmap). +05. Export to CALLADA +06. Export to X3D +07. Export to JavaScript (WebGL) +08. GTK and WX window/widgets +09. Import/Export via GIF (as 3d data) ??? +10. Read DICOM files. +11. Labels at TriCont() +12. Cones() -- like Bars() but by Cone() +13. MPI_Send(), MPI_Recv() +14. Add diffusive light (no dependence of normals but have direction) +15. Use Hershey as built-in font ??? +16. Add MGL command "ask $N 'question'" -- like interactive "define" + +============= 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. +8. Pool of threads for speeding up ??? +9. Drops as mglPrim -- not accurate but smaller memory and faster +10. Text aspect ratio in OpenGL mode + +============= DOCS ============= + +1. Write "Quick start" userguide +2. FAQ about sizes of plot (parametrical+inverted, or Min*Max) +3. FAQ about MinGW -- http://www.mingw.org/wiki/FAQ +4. MGL docs -- text what formulas are applicable for scalars too. +5.Sample about pthread using. +6. Add help about cmake and GIF/JPEG to the "Installation and using" +7. Regroup pictures in WWW by big classes + combo plots +8. On which things the subplot influence +9. About unrotated text +10. Add "Howto" section in web site. +11. "Data plotting", "Data plot", "Scientific visualtization", "Surface", "Cloud","Plot", "statistical graphics" to website +12. Examples of animation, u3d, x3d, js and so on +13. Example of inverted axis, minus-log axis +14. Venn() diagram sample +15. Primitives sample +16. Candle() sample +17. Parallelization: + * user level -- SetDrawReg(), PutDrawReg() -- remove!?! + * MPI level -- Combine() + * MathGL level -- pthread in mglData, ??? +18. SetCoor() -- add log-log, log-x, log-y predefined coordinates +19. Boxs() styles: '#' for wire, '@' for full box. NOTE: use Boxs(a,"@"); for testing speed +20. TernAxis=0 -- usual, =1 -- ternary, =2 -- quaternary, &4 -- projections + +============= BUGS ============= + +1. утилиты (mgl2png и пр.) вылетают, если в коментариях русские буквы +2. Last ' isn't send as call argument!!! +3. "Chaos" in area.png (near axis) ??? + diff --git a/udav/CMakeLists.txt b/udav/CMakeLists.txt new file mode 100644 index 0000000..71b5969 --- /dev/null +++ b/udav/CMakeLists.txt @@ -0,0 +1,36 @@ +#set(mgl_wnd_src window.cpp) +set(udav_src anim_dlg.cpp find_dlg.cpp mem_pnl.cpp prop_dlg.cpp textedit.cpp args_dlg.cpp help_pnl.cpp newcmd_dlg.cpp qmglcanvas.cpp text_pnl.cpp calc_dlg.cpp hint_dlg.cpp open_dlg.cpp qmglsyntax.cpp udav_wnd.cpp dat_pnl.cpp info_dlg.cpp opt_dlg.cpp setup_dlg.cpp files_dlg.cpp main.cpp plot_pnl.cpp style_dlg.cpp) + +set(udav_moc_hdr anim_dlg.h files_dlg.h info_dlg.h opt_dlg.h qmglsyntax.h text_pnl.h args_dlg.h find_dlg.h mem_pnl.h plot_pnl.h setup_dlg.h udav_wnd.h calc_dlg.h help_pnl.h newcmd_dlg.h prop_dlg.h style_dlg.h dat_pnl.h hint_dlg.h open_dlg.h qmglcanvas.h textedit.h) + +set(udav_rc udav.qrc) + +if(use_gsl) +# target_link_libraries(mgl ${GSL_LIB} ${GSL_CBLAS_LIB} ) + add_definitions(-DHAVE_GSL) + include_directories(${GSL_INCLUDE_DIR}) +else(use_gsl) + add_definitions(-DNO_GSL) +endif(use_gsl) + + +include(${QT_USE_FILE}) +add_definitions(-DHAVE_QT) +qt4_add_resources(udav_rc_src ${udav_rc} ) +#qt_wrap_cpp(udav udav_moc_src ${udav_moc_hdr} ) +qt4_wrap_cpp(udav_moc_src ${udav_moc_hdr} ) +add_executable(udav ${udav_src} ${udav_moc_src} ${udav_rc_src}) +target_link_libraries(udav mgl) +target_link_libraries(udav ${QT_LIBRARIES}) + +if(use_pthread) + target_link_libraries(udav ${CMAKE_THREAD_LIBS_INIT}) + add_definitions(-DHAVE_PTHREAD) +endif(use_pthread) + +install( + TARGETS udav + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +) diff --git a/udav/ReadMe b/udav/ReadMe new file mode 100644 index 0000000..87d23f7 --- /dev/null +++ b/udav/ReadMe @@ -0,0 +1,11 @@ +READ THIS IN ORDER TO COMPILE THE Qt4 TEMPLATE +---------------------------------------------- + +Before compiling, check the Qt Options, go to +Project->Project Options->C++ Support and open the Qt Options tab. + +Check that the Qt installation directory is correct for the Qt version you've chosen. + +------------------ +Andreas Pakulat +July 2006 diff --git a/udav/anim_dlg.cpp b/udav/anim_dlg.cpp new file mode 100644 index 0000000..44b1ef7 --- /dev/null +++ b/udav/anim_dlg.cpp @@ -0,0 +1,140 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +//----------------------------------------------------------------------------- +#include "anim_dlg.h" +extern int animDelay; +//----------------------------------------------------------------------------- +AnimParam::AnimParam(QWidget *parent) : QDialog(parent) +{ + setWindowTitle(tr("UDAV - Animation setup")); + QHBoxLayout *a; + QVBoxLayout *o, *g; + QLabel *lbl; + QPushButton *b; + o = new QVBoxLayout(this); + lbl = new QLabel(tr("Redraw picture for $0 equal to"),this); + o->addWidget(lbl); + a = new QHBoxLayout(); o->addLayout(a); + g = new QVBoxLayout(); a->addLayout(g); + rbt = new QRadioButton(tr("strings"),this); + connect(rbt, SIGNAL(clicked()),this, SLOT(setRBT())); + g->addWidget(rbt); + text = new QTextEdit(this); g->addWidget(text); + connect(text,SIGNAL(textChanged()),this,SLOT(setRBT())); + + g = new QVBoxLayout(); a->addLayout(g); + rbf = new QRadioButton(tr("values"),this); + connect(rbf, SIGNAL(clicked()),this, SLOT(setRBF())); + g->addWidget(rbf); + lbl = new QLabel(tr("from"),this); + g->addWidget(lbl, Qt::AlignLeft); + p1 = new QLineEdit(this); g->addWidget(p1); + connect(p1,SIGNAL(textChanged(QString)),this,SLOT(setRBF())); + lbl = new QLabel(tr("to"),this); + g->addWidget(lbl, Qt::AlignLeft); + p2 = new QLineEdit(this); g->addWidget(p2); + connect(p2,SIGNAL(textChanged(QString)),this,SLOT(setRBF())); + lbl = new QLabel(tr("with step"),this); + g->addWidget(lbl, Qt::AlignLeft); + dp = new QLineEdit(this); g->addWidget(dp); dp->setText("1"); + connect(dp,SIGNAL(textChanged(QString)),this,SLOT(setRBF())); + b = new QPushButton(tr("Cancel"), this); g->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(reject())); + b = new QPushButton(tr("OK"), this); g->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(fillRes())); + b->setDefault(true); + // general + a = new QHBoxLayout(); o->addLayout(a); + b = new QPushButton(tr("Put to script"), this); a->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(putTxt())); + lbl = new QLabel(tr("Delay (in ms)"),this); a->addWidget(lbl); + delay = new QLineEdit(this); a->addWidget(delay); + QString s; s.sprintf("%d",animDelay); delay->setText(s); + // export to gif/jpeg + a = new QHBoxLayout(); o->addLayout(a); +// fname = new QLineEdit(this); a->addWidget(fname); + gif = new QCheckBox(tr("Export to GIF"), this); a->addWidget(gif); + jpg = new QCheckBox(tr("Save JPEG frames"), this); a->addWidget(jpg); +} +//----------------------------------------------------------------------------- +AnimParam::~AnimParam() {} +//----------------------------------------------------------------------------- +void AnimParam::fillRes() +{ +// gifName = fname->text(); + gifOn = gif->isChecked(); + jpgOn = jpg->isChecked(); + animDelay = delay->text().toInt(); + if(rbt->isChecked()) { res = text->toPlainText(); accept(); } + else if(rbf->isChecked()) + { + res = ""; + QString s; + float x, x2=p2->text().toDouble(), dx=dp->text().toDouble(); + for(x=p1->text().toDouble();xtext().isEmpty() && !p2->text().isEmpty() && !dp->text().isEmpty()) + { + s = "##c "+p1->text()+" "+p2->text()+" "+dp->text()+"\n"; + emit putText(s); + } + if(text->toPlainText().isEmpty()) return; + int i, n = text->toPlainText().count('\n')+1; + for(i=0;itoPlainText().section('\n',i,i); + if(!t.isEmpty()) s = s+"##a "+t+"\n"; + } + emit putText(s); +} +//----------------------------------------------------------------------------- +void AnimParam::setRBF() { rbt->setChecked(false); rbf->setChecked(true); } +//----------------------------------------------------------------------------- +void AnimParam::setRBT() { rbf->setChecked(false); rbt->setChecked(true); } +//----------------------------------------------------------------------------- +void AnimParam::setResult(const QString &s) +{ text->setText(s); rbf->setChecked(false); rbt->setChecked(true); } +//----------------------------------------------------------------------------- +void AnimParam::setResult(double a1, double a2, double da) +{ + p1->setText(QString::number(a1)); + p2->setText(QString::number(a2)); + dp->setText(QString::number(da)); + rbt->setChecked(false); rbf->setChecked(true); +} +//----------------------------------------------------------------------------- + diff --git a/udav/anim_dlg.h b/udav/anim_dlg.h new file mode 100644 index 0000000..2846404 --- /dev/null +++ b/udav/anim_dlg.h @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef ANIMPARAM_H +#define ANIMPARAM_H +//----------------------------------------------------------------------------- +#include +//----------------------------------------------------------------------------- +class QLineEdit; +class QTextEdit; +class QRadioButton; +class QCheckBox; +/// Setup animation parqmeters +class AnimParam : public QDialog +{ +Q_OBJECT +public: + bool gifOn, jpgOn; + /// string with resulting animation parameters + const QString &getResult() { return res; }; + void setResult(const QString &s); + void setResult(double a1,double a2,double da); + AnimParam(QWidget *parent=0); + ~AnimParam(); +signals: + void putText(const QString &par); +private slots: + void fillRes(); + void putTxt(); + void setRBF(); + void setRBT(); +private: + QString res; + QLineEdit *p1, *p2, *dp, *delay;//, *fname; + QTextEdit *text; + QRadioButton *rbt, *rbf; + QCheckBox *gif, *jpg; +}; +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/udav/args_dlg.cpp b/udav/args_dlg.cpp new file mode 100644 index 0000000..287f7f1 --- /dev/null +++ b/udav/args_dlg.cpp @@ -0,0 +1,87 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include "args_dlg.h" +extern mglParser parser; +//----------------------------------------------------------------------------- +ArgsDialog::ArgsDialog(QWidget *parent) : QDialog(parent) +{ + setWindowTitle(tr("UDAV - Set script arguments")); + QHBoxLayout *h; + QVBoxLayout *v; + QGridLayout *g; + QLabel *l; + QPushButton *b; + + v = new QVBoxLayout(this); + g = new QGridLayout(); v->addLayout(g); + l = new QLabel(tr("String for $1"), this); g->addWidget(l, 0, 0); + a[1] = new QLineEdit(this); g->addWidget(a[1], 1, 0); + l = new QLabel(tr("String for $2"), this); g->addWidget(l, 0, 1); + a[2] = new QLineEdit(this); g->addWidget(a[2], 1, 1); + l = new QLabel(tr("String for $3"), this); g->addWidget(l, 2, 0); + a[3] = new QLineEdit(this); g->addWidget(a[3], 3, 0); + l = new QLabel(tr("String for $4"), this); g->addWidget(l, 2, 1); + a[4] = new QLineEdit(this); g->addWidget(a[4], 3, 1); + l = new QLabel(tr("String for $5"), this); g->addWidget(l, 4, 0); + a[5] = new QLineEdit(this); g->addWidget(a[5], 5, 0); + l = new QLabel(tr("String for $6"), this); g->addWidget(l, 4, 1); + a[6] = new QLineEdit(this); g->addWidget(a[6], 5, 1); + l = new QLabel(tr("String for $7"), this); g->addWidget(l, 6, 0); + a[7] = new QLineEdit(this); g->addWidget(a[7], 7, 0); + l = new QLabel(tr("String for $8"), this); g->addWidget(l, 6, 1); + a[8] = new QLineEdit(this); g->addWidget(a[8], 7, 1); + l = new QLabel(tr("String for $9"), this); g->addWidget(l, 8, 0); + a[9] = new QLineEdit(this); g->addWidget(a[9], 9, 0); + l = new QLabel(tr("String for $0"), this); g->addWidget(l, 8, 1); + a[0] = new QLineEdit(this); g->addWidget(a[0], 9, 1); + + h = new QHBoxLayout(); h->addStretch(1); v->addLayout(h); + b = new QPushButton(tr("Cancel"), this); h->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(reject())); + b = new QPushButton(tr("OK"), this); h->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(putArguments())); + b->setDefault(true); +} +//----------------------------------------------------------------------------- +ArgsDialog::~ArgsDialog() {} +//----------------------------------------------------------------------------- +void ArgsDialog::putArguments() +{ + int len=0, i, j, n; + for(i=0;i<10;i++) + if(a[i]->text().length()>len) + len = a[i]->text().length(); + wchar_t *str = new wchar_t[len+2]; + QString s; + for(i=0;i<10;i++) + { + s = a[i]->text(); n = s.length(); + for(j=0;j * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include "mgl/mgl_zb.h" -#include "mgl/mgl_parse.h" -//----------------------------------------------------------------------------- -int main(int narg, char **arg) -{ - mglGraphZB gr; - mglParse p(true); - - if(narg==1) - { - printf("mgl2png convert mgl script to bitmap png file.\n"); - printf("Current version is 1.%g\n",MGL_VERSION); - printf("Usage:\tmgl2png scriptfile [outputfile parameter(s)]\n"); - printf("\tParameters have format \"-Nval\".\n"); - printf("\tHere N=0,1...9 is parameter ID and val is its value.\n"); - printf("\tOption -Lval set locale to val.\n"); - } - else - { - FILE *fp = fopen(arg[1],"rb"); - if(fp==0) { printf("Couldn't open file %s\n",arg[1]); return 1; } - char str[8192], buf[2048]; - for(long i=2;i='0' && arg[i][1]<='9') - p.AddParam(arg[i][1]-'0',arg[i]+2); - if(arg[i][0]=='-' && arg[i][1]=='L') - setlocale(LC_CTYPE, arg[i]+2); - } - gr.Message = buf; *buf=0; - p.Execute(&gr,fp,true); - fclose(fp); - if(narg>2 && arg[2][0]!='-') strcpy(str,arg[2]); - else - { - strcpy(str,arg[1]); strcat(str,".png"); - printf("Write output to %s\n",str); - } - gr.WritePNG(str); - } - return 0; -} -//----------------------------------------------------------------------------- +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef ARGS_DLG_H +#define ARGS_DLG_H +//----------------------------------------------------------------------------- +#include +class QLineEdit; +//----------------------------------------------------------------------------- +/// Dialog for enetring script arguments $0...$9 +class ArgsDialog : public QDialog +{ +Q_OBJECT +public: + ArgsDialog(QWidget *parent=0); + ~ArgsDialog(); + +private slots: + void putArguments(); +private: + QLineEdit *a[10]; +}; +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/udav/calc_dlg.cpp b/udav/calc_dlg.cpp new file mode 100644 index 0000000..e4ce301 --- /dev/null +++ b/udav/calc_dlg.cpp @@ -0,0 +1,257 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include "calc_dlg.h" +extern mglParser parser; +mglData mglFormulaCalc(const wchar_t *string, mglParser *arg); +//----------------------------------------------------------------------------- +// +// Calc dialog +// +//----------------------------------------------------------------------------- +CalcDialog::CalcDialog(QWidget *parent) : QWidget(parent) +{ + QPushButton *b; + QHBoxLayout *m=new QHBoxLayout(this); + QVBoxLayout *o=new QVBoxLayout; m->addLayout(o); m->setStretchFactor(o,1); +// QStandardItem *it; + + text = new QLineEdit(this); o->addWidget(text); + connect(text,SIGNAL(textChanged(QString)),this,SLOT(evaluate())); + connect(text,SIGNAL(returnPressed()),this,SLOT(addResult())); + hist = new QStandardItemModel(this); +// it = new QStandardItem(tr("Formula")); hist->setHorizontalHeaderItem(0,it); +// it = new QStandardItem(tr("Result")); hist->setHorizontalHeaderItem(1,it); + prev = new QListView(this); o->addWidget(prev); + connect(prev,SIGNAL(clicked(QModelIndex)),this,SLOT(putText(QModelIndex))); + QFont f(font()); f.setPointSize(f.pointSize()*0.75); + prev->setModel(hist); prev->setFont(f); + prev->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Ignored); + + + o = new QVBoxLayout; m->addLayout(o); + QLabel *l = new QLabel(tr("Result"),this); o->addWidget(l); + result=new QLineEdit(this); result->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); + result->setReadOnly(true); o->addWidget(result); + b = new QPushButton(tr("To script"), this); o->addWidget(b); + connect(b, SIGNAL(clicked()), this, SLOT(keyPut())); + b = new QPushButton(tr("Clear"), this); o->addWidget(b); + connect(b, SIGNAL(clicked()), this, SLOT(clear())); + + QGridLayout *g = new QGridLayout; m->addLayout(g); m->setStretchFactor(g,0); + b = new QPushButton("7", this); g->addWidget(b, 0, 0); + int minw=b->height(); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(key7())); + b = new QPushButton("8", this); g->addWidget(b, 0, 1); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(key8())); + b = new QPushButton("9", this); g->addWidget(b, 0, 2); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(key9())); + b = new QPushButton("+", this); g->addWidget(b, 0, 3); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(keyAdd())); + b = new QPushButton(QString::fromWCharArray(L"π"), this); g->addWidget(b, 0, 4); + connect(b, SIGNAL(clicked()), this, SLOT(keyPi())); b->setMaximumWidth(minw); + + b = new QPushButton("4", this); g->addWidget(b, 1, 0); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(key4())); + b = new QPushButton("5", this); g->addWidget(b, 1, 1); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(key5())); + b = new QPushButton("6", this); g->addWidget(b, 1, 2); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(key6())); + b = new QPushButton("-", this); g->addWidget(b, 1, 3); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(keySub())); + b = new QPushButton(QString::fromWCharArray(L"x²"), this); g->addWidget(b, 1, 4); + connect(b, SIGNAL(clicked()), this, SLOT(keyX2())); b->setMaximumWidth(minw); + + b = new QPushButton("1", this); g->addWidget(b, 2, 0); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(key1())); + b = new QPushButton("2", this); g->addWidget(b, 2, 1); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(key2())); + b = new QPushButton("3", this); g->addWidget(b, 2, 2); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(key3())); + b = new QPushButton("*", this); g->addWidget(b, 2, 3); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(keyMul())); + b = new QPushButton("(", this); g->addWidget(b, 2, 4); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(keyBrO())); + + b = new QPushButton("0", this); g->addWidget(b, 3, 0); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(key0())); + b = new QPushButton(".", this); g->addWidget(b, 3, 1); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(keyDot())); + b = new QPushButton("E", this); g->addWidget(b, 3, 2); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(keyE())); + b = new QPushButton("/", this); g->addWidget(b, 3, 3); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(keyDiv())); + b = new QPushButton(")", this); g->addWidget(b, 3, 4); b->setMaximumWidth(minw); + connect(b, SIGNAL(clicked()), this, SLOT(keyBrC())); + + fillFuncName(); + o=new QVBoxLayout; m->addLayout(o); m->setStretchFactor(o,0); + type = new QComboBox(this); o->addWidget(type); + type->addItems(names); type->setCurrentIndex(0); + func = new QComboBox(this); o->addWidget(func); + func->addItems(funcName[0]); type->setCurrentIndex(0); + descr= new QLabel(this); o->addWidget(descr); o->setStretchFactor(descr,0); + descr->setText(funcInfo[0].at(0)); + connect(type, SIGNAL(currentIndexChanged(int)), this, SLOT(typeUpdate(int))); + connect(func, SIGNAL(currentIndexChanged(int)), this, SLOT(funcUpdate(int))); + b = new QPushButton(tr("Put function"), this); o->addWidget(b); + connect(b, SIGNAL(clicked()), this, SLOT(keyFnc())); +} +//----------------------------------------------------------------------------- +CalcDialog::~CalcDialog() {} +void CalcDialog::foc() { text->setFocus(Qt::ActiveWindowFocusReason); } +//----------------------------------------------------------------------------- +void CalcDialog::key1() { text->setText("1"); foc(); } +void CalcDialog::key2() { text->setText("2"); foc(); } +void CalcDialog::key3() { text->setText("3"); foc(); } +void CalcDialog::key4() { text->setText("4"); foc(); } +void CalcDialog::key5() { text->setText("5"); foc(); } +void CalcDialog::key6() { text->setText("6"); foc(); } +void CalcDialog::key7() { text->setText("7"); foc(); } +void CalcDialog::key8() { text->setText("8"); foc(); } +void CalcDialog::key9() { text->setText("9"); foc(); } +void CalcDialog::key0() { text->setText("0"); foc(); } +void CalcDialog::keyE() { text->setText("E"); foc(); } +void CalcDialog::keyPi() { text->setText("pi"); foc(); } +void CalcDialog::keyX2() { text->setText("^2"); foc(); } +void CalcDialog::keyAdd() { text->setText("+"); foc(); } +void CalcDialog::keyMul() { text->setText("*"); foc(); } +void CalcDialog::keySub() { text->setText("-"); foc(); } +void CalcDialog::keyDiv() { text->setText("/"); foc(); } +void CalcDialog::keyBrO() { text->setText("("); foc(); } +void CalcDialog::keyBrC() { text->setText(")"); foc(); } +void CalcDialog::keyDot() { text->setText("."); foc(); } +void CalcDialog::clear() { text->clear(); foc(); } +//----------------------------------------------------------------------------- +void CalcDialog::keyFnc() +{ + text->setText(func->currentText()); + text->setCursorPosition(func->currentText().length()-1); foc(); +} +//----------------------------------------------------------------------------- +void CalcDialog::keyPut() { emit putNumber(result->text()); } +//----------------------------------------------------------------------------- +void CalcDialog::putText(QModelIndex ind) +{ text->setText(hist->data(ind).toString()); } +//----------------------------------------------------------------------------- +void CalcDialog::addResult() +{ + QStandardItem *it; + QFont f(prev->font()); f.setBold(true); + hist->insertRows(0,2); + it = new QStandardItem(text->text()); it->setFont(f); hist->setItem(0,it); + it = new QStandardItem(result->text()); hist->setItem(1,it); +} +//----------------------------------------------------------------------------- +void CalcDialog::evaluate() +{ + QString sel=text->text(); + if(sel.isEmpty()) return; + wchar_t *txt=new wchar_t[sel.length()+1]; + sel.toWCharArray(txt); txt[sel.length()]=0; + setlocale(LC_ALL, "C"); + mglData res=mglFormulaCalc(txt, &parser); + setlocale(LC_ALL, ""); +// result->setText(QString::fromWCharArray(txt)); + delete []txt; + result->setText(QString::number(res.a[0])); +} +//----------------------------------------------------------------------------- +void CalcDialog::fillFuncName() +{ + names<9) return; + func->clear(); func->addItems(funcName[s]); func->setCurrentIndex(0); +} +//----------------------------------------------------------------------------- +void CalcDialog::funcUpdate(int f) +{ + int s=type->currentIndex(); + if(s<0 || s>9 || f<0) return; // wrong index + descr->setText(funcInfo[s].at(f)); +} +//----------------------------------------------------------------------------- diff --git a/udav/calc_dlg.h b/udav/calc_dlg.h new file mode 100644 index 0000000..b3d429e --- /dev/null +++ b/udav/calc_dlg.h @@ -0,0 +1,87 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef CALC_DLG_H +#define CALC_DLG_H +//----------------------------------------------------------------------------- +#include +#include +#include +class QLabel; +class QLineEdit; +class QTextEdit; +class QComboBox; +class QListView; +class QPushButton; +//----------------------------------------------------------------------------- +/// Dialog for finding something in text +class CalcDialog : public QWidget +{ +Q_OBJECT +public: + CalcDialog(QWidget *parent = 0); + ~CalcDialog(); +public slots: + void evaluate(); +signals: + void putNumber(const QString &str); +private slots: + void keyPut(); + void key1(); + void key2(); + void key3(); + void key4(); + void key5(); + void key6(); + void key7(); + void key8(); + void key9(); + void key0(); + void keyE(); + void keyDot(); + void keyMul(); + void keyDiv(); + void keyAdd(); + void keySub(); + void keyBrO(); + void keyBrC(); + void keyFnc(); + void keyPi(); + void keyX2(); + void typeUpdate(int s); + void funcUpdate(int s); + void foc(); + void clear(); + void putText(QModelIndex ind); + void addResult(); + +private: + QLineEdit *text; + QLineEdit *result; + QComboBox *type, *func; + QLabel *descr; + QListView *prev; + QStringList names, funcName[10], funcInfo[10]; + QStandardItemModel *hist; + + void fillFuncName(); +}; +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/udav/dat_pnl.cpp b/udav/dat_pnl.cpp new file mode 100644 index 0000000..b0d8eff --- /dev/null +++ b/udav/dat_pnl.cpp @@ -0,0 +1,860 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//----------------------------------------------------------------------------- +#include "dat_pnl.h" +#include "info_dlg.h" +#include "xpm/table.xpm" +//----------------------------------------------------------------------------- +extern mglParser parser; +void updateDataItems(); +void deleteDat(void *o) { if(o) delete ((DatPanel *)o); } +//----------------------------------------------------------------------------- +DatPanel::DatPanel(InfoDialog *inf, QWidget *parent) : QWidget(parent) +{ + setAttribute(Qt::WA_DeleteOnClose); + kz = nx = ny = nz = 0; var = 0; + ready = false; infoDlg = inf; + QBoxLayout *v,*h,*m; + + menu = new QMenu(tr("&Data"),this); + v = new QVBoxLayout(this); + h = new QHBoxLayout(); v->addLayout(h); toolTop(h); + h = new QHBoxLayout(); v->addLayout(h); + m = new QVBoxLayout(); h->addLayout(m); toolLeft(m); + tab = new QTableWidget(this); h->addWidget(tab); + connect(tab, SIGNAL(cellChanged(int,int)), this, SLOT(putValue(int, int))); + + setWindowIcon(QPixmap(table_xpm)); +} +//----------------------------------------------------------------------------- +DatPanel::~DatPanel() { if(var) var->o = 0; } +//----------------------------------------------------------------------------- +void DatPanel::refresh() +{ + bool rc = false; + if(!var) return; + infoDlg->allowRefresh=false; + if(nx!=var->d.nx) { nx = var->d.nx; tab->setColumnCount(nx);rc=true; } + if(ny!=var->d.ny) { ny = var->d.ny; tab->setRowCount(ny); rc=true; } + if(kz>=var->d.nz) { kz = 0; emit sliceChanged(0); } + if(nz!=var->d.ny) { nz = var->d.nz; emit nzChanged(nz); } + id = QString(var->d.id); + if(nz==1 && ny>1 && !id.isEmpty()) + { + QStringList head; + QString s; + for(int i=0;i='a' && id[i]<='z') s=s+" ("+id[i]+")"; + head<setHorizontalHeaderLabels(head); + } + register long i,j,m=var->s.length(); + register float f; + QString s,d; + if(rc) + { + QStringList sh,sv; + for(i=0;isetHorizontalHeaderLabels(sh); + for(i=0;isetVerticalHeaderLabels(sv); + for(i=0;isetItem(j,i,new QTableWidgetItem); + } + for(i=0;id.a[i+nx*(j+ny*kz)]; + if(isnan(f)) s = "nan"; + else s.sprintf("%g",f); + tab->item(j,i)->setText(s); + } + infoDlg->allowRefresh=true; infoDlg->refresh(); + QChar *ss = new QChar[m+1]; + for(i=0;is[i]; + s = QString(ss, m); delete []ss; + d.sprintf("%d * %d * %d", nx, ny, nz); + ready = true; +} +//----------------------------------------------------------------------------- +void DatPanel::setVar(mglVar *v) +{ + ready = false; + if(var) var->o = 0; + var = v; infoDlg->setVar(v); + nx = ny = nz = kz = 0; + if(v) + { + QString s = QString::fromStdWString(v->s); + v->o = this; v->func = deleteDat; + refresh(); + setWindowTitle(s + tr(" - UDAV variable")); + infoDlg->setWindowTitle(s + tr(" - UDAV preview")); + } + else + { tab->setColumnCount(0); tab->setRowCount(0); emit nzChanged(nz); } + emit sliceChanged(0); +} +//----------------------------------------------------------------------------- +void DatPanel::setSlice(int k) +{ + if(k>=nz) k=nz-1; if(k<0) k=0; + if(k!=kz) + { + infoDlg->setSlice(k); + emit sliceChanged(k); + kz = k; refresh(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::putValue(int r, int c) +{ + if(!var || r<0 || c<0 || r>=ny || c>=nx || !ready) return; + QString s = tab->item(r,c)->text().toLower(); + float f; + f = s=="nan" ? NAN : s.toDouble(); + if(f!=var->d.a[c+nx*(r+ny*kz)]) + { + if(isnan(f)) s="nan"; else s.sprintf("%g", f); + tab->item(r,c)->setText(s); + } + var->d.a[c+nx*(r+ny*kz)] = f; + infoDlg->refresh(); +} +//----------------------------------------------------------------------------- +void DatPanel::imprt() +{ + QString fn = QFileDialog::getOpenFileName(this, tr("UDAV - Import PNG"), "", tr("Data files (*.dat)\nAll files (*.*)")); + if(!fn.isEmpty()) + { + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Export to PNG"), tr("Enter color scheme for picture.\nNote that data will be normalized in range [0,1]."), QLineEdit::Normal, "BbcyrR", &ok); + if(ok) var->d.Import(fn.toAscii(), s.toAscii()); + refresh(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::exprt() +{ + QString fn = QFileDialog::getOpenFileName(this, tr("UDAV - Import PNG"), "", tr("PNG files (*.png)\nAll files (*.*)")); + if(!fn.isEmpty()) + { + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Export to PNG"), tr("Enter color scheme for picture"), QLineEdit::Normal, "BbcyrR", &ok); + if(ok) var->d.Export(fn.toAscii(), s.toAscii()); + } +} +//----------------------------------------------------------------------------- +void DatPanel::save() +{ + QString fn = QFileDialog::getSaveFileName(this, tr("UDAV - Save data"), "", tr("Data files (*.dat)\nAll files (*.*)")); + if(!fn.isEmpty()) var->d.Save(fn.toAscii()); +} +//----------------------------------------------------------------------------- +void DatPanel::load() +{ + QString fn = QFileDialog::getOpenFileName(this, tr("UDAV - Load data"), "", tr("Data files (*.dat)\nAll files (*.*)")); + if(!fn.isEmpty()) { var->d.Read(fn.toAscii()); refresh(); } +} +//----------------------------------------------------------------------------- +void DatPanel::copy() +{ + QTableWidgetSelectionRange ts = tab->selectedRanges().first(); + register long i,j; + QString res, s; + for(j=ts.topRow();j<=ts.bottomRow();j++) + { + for(i=ts.leftColumn();i<=ts.rightColumn();i++) + { + res = res + tab->item(j,i)->text(); + if(isetText(res, QClipboard::Clipboard); +} +//----------------------------------------------------------------------------- +void DatPanel::paste() +{ + QString txt = QApplication::clipboard()->text(QClipboard::Clipboard); + QString s, t; + int r = tab->currentRow(), c = tab->currentColumn(), i, j; + for(i=0;id.a[j+c+nx*(i+r+ny*kz)] = t.toDouble(); + } + } + refresh(); +} +//----------------------------------------------------------------------------- +void DatPanel::plot() // TODO: plot dialog +{ + +} +//----------------------------------------------------------------------------- +void DatPanel::list() // TODO: in which script insert ??? +{ +/* if(nx*ny+ny > 1020) + { QMessageBox::warning(this, tr("UDAV - To list conversion"), tr("Too many numbers (>1000) on slice"), QMessageBox::Ok, 0, 0); return; } + if(nz > 1) + QMessageBox::information(this, tr("UDAV - To list conversion"), tr("Only current slice will be inserted"), QMessageBox::Ok, 0, 0); + QString res = "list\t", s; + register long i,j; + for(j=0;ja[i+nx*(j+kz*ny)]); + res += s; + } + if(jd.Modify(s.toAscii()); refresh(); } +} +//----------------------------------------------------------------------------- +void DatPanel::inrange() +{ + QString v1("-1"), v2("1"), dir("x"); + if(sizesDialog(tr("UDAV - Fill data"), tr("Enter range for data and direction of filling"), tr("From"), tr("To"), tr("Direction"), v1, v2, dir)) + { + var->d.Fill(v1.toDouble(), v2.toDouble(), dir[0].toLatin1()); + refresh(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::norm() +{ + QString v1("0"), v2("1"), how; + if(sizesDialog(tr("UDAV - Normalize data"), tr("Enter range for final data"), tr("From"), tr("To"), tr("Symmetrical?"), v1, v2, how)) + { + var->d.Norm(v1.toDouble(), v2.toDouble(), (how=="on" || how.contains('s'))); + refresh(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::normsl() +{ + QString v1("0"), v2("1"), dir("z"); + if(sizesDialog(tr("UDAV - Normalize by slice"), tr("Enter range for final data"), tr("From"), tr("To"), tr("Direction"), v1, v2, dir)) + { + var->d.NormSl(v1.toDouble(), v2.toDouble(), dir[0].toLatin1()); + refresh(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::create() +{ + QString mx, my("1"), mz("1"); + if(sizesDialog(tr("UDAV - Clear data"), tr("Enter new data sizes"), tr("X-size"), tr("Y-size"), tr("Z-size"), mx, my, mz)) + { + var->d.Create(mx.toInt(), my.toInt(), mz.toInt()); + refresh(); updateDataItems(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::reSize() +{ + QString mx, my, mz; + mx.sprintf("%d",nx); my.sprintf("%d",ny); mz.sprintf("%d",nz); + if(sizesDialog(tr("UDAV - Resize data"), tr("Enter new data sizes"), tr("X-size"), tr("Y-size"), tr("Z-size"), mx, my, mz)) + { + var->d = var->d.Resize(mx.toInt(), my.toInt(), mz.toInt()); + refresh(); updateDataItems(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::squize() +{ + QString mx("1"), my("1"), mz("1"); + if(sizesDialog(tr("UDAV - Squeeze data"), tr("Enter step of saved points. For example, '1' save all, '2' save each 2nd point, '3' save each 3d and so on."), tr("X-direction"), tr("Y-direction"), tr("Z-direction"), mx, my, mz)) + { + var->d.Squeeze(mx.toInt(), my.toInt(), mz.toInt()); + refresh(); updateDataItems(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::crop() +{ + QString n1("1"), n2("1"), dir; + if(sizesDialog(tr("UDAV - Crop data"), tr("Enter range of saved date."), tr("From"), tr("To"), tr("Direction"), n1, n2, dir)) + { + var->d.Squeeze(n1.toInt(), n2.toInt(), dir[0].toLatin1()); + refresh(); updateDataItems(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::rearrange() +{ + QString mx, my, mz; + mx.sprintf("%d",nx); my.sprintf("%d",ny); mz.sprintf("%d",nz); + if(sizesDialog(tr("UDAV - Rearrange data"), tr("Enter new data sizes"), tr("X-size"), tr("Y-size"), tr("Z-size"), mx, my, mz)) + { + var->d.Rearrange(mx.toInt(), my.toInt(), mz.toInt()); + refresh(); updateDataItems(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::transp() +{ + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Transpose data"), tr("Enter new order of dimensions.\nFor example, 'yx' or 'yxz' for transpose x-y, 'zyx' for transposing x-z and so on."), QLineEdit::Normal, "yx", &ok); + if(ok) { var->d.Transpose(s.toAscii()); refresh(); updateDataItems(); } +} +//----------------------------------------------------------------------------- +void DatPanel::smooth() +{ + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Smooth data"), tr("Enter direction(s) for smoothing.\nOptionally you may enter the kind of smoothing by 3 or by 5 points. For example 'xy3' - smooth only in x and y directions and use 3-points scheme."), QLineEdit::Normal, "xyz", &ok); + if(ok) { var->d.Smooth(s.toAscii().constData()); refresh(); } +} +//----------------------------------------------------------------------------- +void DatPanel::cumsum() +{ + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Summarize data"), tr("Enter direction(s) for cumulative summation.\nFor example 'xy' - summate along x and y directions."), QLineEdit::Normal, "", &ok); + if(ok) { var->d.CumSum(s.toAscii()); refresh(); } +} +//----------------------------------------------------------------------------- +void DatPanel::integr() +{ + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Integrate data"), tr("Enter direction(s) for integration.\nFor example 'xy' - integrate along x and y directions."), QLineEdit::Normal, "", &ok); + if(ok) { var->d.Integral(s.toAscii()); refresh(); } +} +//----------------------------------------------------------------------------- +void DatPanel::diff() +{ + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Differentiate data"), tr("Enter direction(s) for differentiation.\nFor example 'xy' - differentiate along x and y directions."), QLineEdit::Normal, "", &ok); + if(ok) { var->d.Diff(s.toAscii()); refresh(); } +} +//----------------------------------------------------------------------------- +void DatPanel::diff2() +{ + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Laplace transform"), tr("Enter direction(s) for laplace transform.\nFor example 'xy' - do transform along x and y directions."), QLineEdit::Normal, "", &ok); + if(ok) { var->d.Diff2(s.toAscii()); refresh(); } +} +//----------------------------------------------------------------------------- +void DatPanel::swap() +{ + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Swap data"), tr("Enter direction(s) for swapping (exchange left and right parts).\nFor example 'xy' - swap along x and y directions. Useful for Fourier spectrum."), QLineEdit::Normal, "", &ok); + if(ok) { var->d.Swap(s.toAscii()); refresh(); } +} +//----------------------------------------------------------------------------- +void DatPanel::mirror() +{ + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Mirror data"), tr("Enter direction(s) for mirroring.\nFor example 'xy' - mirror along x and y directions."), QLineEdit::Normal, "", &ok); + if(ok) { var->d.Swap(s.toAscii()); refresh(); } +} +//----------------------------------------------------------------------------- +void DatPanel::sumof() +{ + QString name, val; + if(namesDialog(tr("UDAV - Sum along ..."), tr("Specify direction(s) of summation"), name, val)) + { + mglVar *v = parser.AddVar(name.toAscii()); + v->d = var->d.Sum(val.toAscii()); + updateDataItems(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::maxof() +{ + QString name, val; + if(namesDialog(tr("UDAV - Max along ..."), tr("Specify direction(s) of maximal values"), name, val)) + { + mglVar *v = parser.AddVar(name.toAscii()); + v->d = var->d.Max(val.toAscii()); + updateDataItems(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::minof() +{ + QString name, val; + if(namesDialog(tr("UDAV - Min along ..."), tr("Specify direction(s) of minimal values"), name, val)) + { + mglVar *v = parser.AddVar(name.toAscii()); + v->d = var->d.Min(val.toAscii()); + updateDataItems(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::momentx() +{ + QString name, val; + if(namesDialog(tr("UDAV - Momentum along 'x'"), + tr("Specify which momentum evaluate.\nThe momentum is res_i = sum_jk how(x_i,y_j,z_k) a_jk/ sum_jk a_jk.\nCoordinates x, y, z are data indexes normalized in range [0,1]."), name, val)) + { + mglVar *v = parser.AddVar(name.toAscii()); + v->d = var->d.Momentum('x', val.toAscii()); + updateDataItems(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::momenty() +{ + QString name, val; + if(namesDialog(tr("UDAV - Momentum along 'y'"), + tr("Specify which momentum evaluate.\nThe momentum is res_j = sum_ik how(x_i,y_j,z_k) a_ik/ sum_ik a_ik.\nCoordinates x, y, z are data indexes normalized in range [0,1]."), name, val)) + { + mglVar *v = parser.AddVar(name.toAscii()); + v->d = var->d.Momentum('y', val.toAscii()); + updateDataItems(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::momentz() +{ + QString name, val; + if(namesDialog(tr("UDAV - Momentum along 'z'"), + tr("Specify which momentum evaluate.\nThe momentum is res_k = sum_ij how(x_i,y_j,z_k) a_ij/ sum_ij a_ij.\nCoordinates x, y, z are data indexes normalized in range [0,1]."), name, val)) + { + mglVar *v = parser.AddVar(name.toAscii()); + v->d = var->d.Momentum('z', val.toAscii()); + updateDataItems(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::hist() +{ + QLabel *l; + QLineEdit *id, *v1, *v2; + QSpinBox *nm; + QPushButton *b; + QDialog *d = new QDialog(this); d->setWindowTitle(tr("UDAV - Make histogram")); + QGridLayout *g = new QGridLayout(d); + l = new QLabel(tr("From"), d); g->addWidget(l,0,0); + l = new QLabel(tr("To"), d); g->addWidget(l,0,1); + v1 = new QLineEdit(d); g->addWidget(v1,1,0); + v2 = new QLineEdit(d); g->addWidget(v2,1,1); + l = new QLabel(tr("Number of points"), d); g->addWidget(l,2,0); + l = new QLabel(tr("Put in variable"), d); g->addWidget(l,2,1); + nm = new QSpinBox(d); nm->setRange(2,8192); g->addWidget(nm,3,0); + id = new QLineEdit(d); nm->setSingleStep(10); g->addWidget(id,3,1); + b = new QPushButton(tr("Cancel"), d); g->addWidget(b,4,0); + connect(b, SIGNAL(clicked()), d, SLOT(reject())); + b = new QPushButton(tr("OK"), d); g->addWidget(b,4,1); + connect(b, SIGNAL(clicked()), d, SLOT(accept())); b->setDefault(true); + // now execute dialog and get values + bool res = d->exec(); + if(res && !v1->text().isEmpty() && !v2->text().isEmpty() && !id->text().isEmpty()) + { + mglVar *vv = parser.AddVar(id->text().toAscii()); + if(!vv) return; + vv->d = var->d.Hist(nm->value(), v1->text().toDouble(), v2->text().toDouble()); + updateDataItems(); + } +} +//----------------------------------------------------------------------------- +void DatPanel::addto() +{ + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Change data"), tr("Enter number for adding to data elements:"), QLineEdit::Normal, "", &ok); + if(ok) { var->d += s.toDouble(); refresh(); } +} +//----------------------------------------------------------------------------- +void DatPanel::subto() +{ + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Change data"), tr("Enter number for subtraction from data elements:"), QLineEdit::Normal, "", &ok); + if(ok) { var->d -= s.toDouble(); refresh(); } +} +//----------------------------------------------------------------------------- +void DatPanel::divto() +{ + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Change data"), tr("Enter number for division of data elements:"), QLineEdit::Normal, "", &ok); + if(ok) { var->d /= s.toDouble(); refresh(); } +} +//----------------------------------------------------------------------------- +void DatPanel::multo() +{ + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Change data"), tr("Enter number for multiplication of data elements:"), QLineEdit::Normal, "", &ok); + if(ok) { var->d *= s.toDouble(); refresh(); } +} +//----------------------------------------------------------------------------- +void DatPanel::first() { setSlice(0); } +//----------------------------------------------------------------------------- +void DatPanel::last() { setSlice(nz-1); } +//----------------------------------------------------------------------------- +void DatPanel::next() { setSlice(kz+1); } +//----------------------------------------------------------------------------- +void DatPanel::prev() { setSlice(kz-1); } +//----------------------------------------------------------------------------- +void DatPanel::gosl() +{ + bool ok; + QString s = QInputDialog::getText(this, tr("UDAV - Go to slice"), tr("Enter slice id:"), QLineEdit::Normal, "0", &ok); + if(ok) setSlice(s.toInt()); +} +//----------------------------------------------------------------------------- +void DatPanel::setNz(int nz) { sb->setMaximum(nz-1); } +//----------------------------------------------------------------------------- +bool DatPanel::sizesDialog(const QString &cap, const QString &lab, const QString &desc1, const QString &desc2, const QString &desc3, QString &val1, QString &val2, QString &val3) +{ + QLabel *l; + QLineEdit *f1, *f2, *f3; + QPushButton *b; + QDialog *d = new QDialog(this); + d->setWindowTitle(cap); + QVBoxLayout *v = new QVBoxLayout(d); + l = new QLabel(lab, d); v->addWidget(l); + l = new QLabel(tr("NOTE: All fields must be filled!"), d); v->addWidget(l); + QGridLayout *g = new QGridLayout(); v->addLayout(g); + l = new QLabel(desc1, d); g->addWidget(l, 0, 0); + l = new QLabel(desc2, d); g->addWidget(l, 0, 1); + l = new QLabel(desc3, d); g->addWidget(l, 0, 2); + f1 = new QLineEdit(val1, d); g->addWidget(f1, 1, 0); + f2 = new QLineEdit(val2, d); g->addWidget(f2, 1, 1); + f3 = new QLineEdit(val3, d); g->addWidget(f3, 1, 2); + QHBoxLayout *h = new QHBoxLayout(); v->addLayout(h); + h->addStretch(1); + b = new QPushButton(tr("Cancel"), d); h->addWidget(b); + connect(b, SIGNAL(clicked()), d, SLOT(reject())); + b = new QPushButton(tr("OK"), d); h->addWidget(b); + connect(b, SIGNAL(clicked()), d, SLOT(accept())); + b->setDefault(true); + // now execute dialog and get values + bool res = d->exec(); + val1 = f1->text(); val2 = f2->text(); val3 = f3->text(); + if(val1.isEmpty() || val2.isEmpty() || val3.isEmpty()) res = false; + delete d; + return res; +} +//----------------------------------------------------------------------------- +bool DatPanel::namesDialog(const QString &cap, const QString &lab, QString &name, QString &val) +{ + QLabel *l; + QLineEdit *f1, *f2; + QPushButton *b; + QDialog *d = new QDialog(this); + d->setWindowTitle(cap); + QVBoxLayout *v = new QVBoxLayout(d); + l = new QLabel(lab, d); v->addWidget(l); + l = new QLabel(tr("NOTE: All fields must be filled!"), d); v->addWidget(l); + f1 = new QLineEdit(val, d); v->addWidget(f1); + l = new QLabel(tr("Enter the name for new variable"), d); v->addWidget(l); + f2 = new QLineEdit(d); v->addWidget(f2); + QHBoxLayout *h = new QHBoxLayout(); v->addLayout(h); h->addStretch(1); + b = new QPushButton(tr("Cancel"), d); h->addWidget(b); + connect(b, SIGNAL(clicked()), d, SLOT(reject())); + b = new QPushButton(tr("OK"), d); h->addWidget(b); + connect(b, SIGNAL(clicked()), d, SLOT(accept())); + b->setDefault(true); + // now execute dialog and get values + bool res = d->exec(); + val = f1->text(); name = f2->text(); + if(val.isEmpty() || name.isEmpty()) res = false; + delete d; + return res; +} +//----------------------------------------------------------------------------- +#include "xpm/plot.xpm" +#include "xpm/size.xpm" +#include "xpm/smth.xpm" +#include "xpm/oper_d.xpm" +#include "xpm/oper_s.xpm" +#include "xpm/oper_a.xpm" +#include "xpm/oper_m.xpm" +#include "xpm/crop.xpm" +#include "xpm/tran.xpm" +#include "xpm/integr.xpm" +#include "xpm/diff.xpm" +#include "xpm/diff2.xpm" +#include "xpm/squize.xpm" +#include "xpm/sum.xpm" +#include "xpm/func.xpm" +#include "xpm/swap.xpm" +//----------------------------------------------------------------------------- +void DatPanel::toolTop(QBoxLayout *l) +{ + QAction *a; + QMenu *o; + QToolButton *bb; + + // file menu + o = menu->addMenu(tr("&File")); + a = new QAction(QPixmap(":/xpm/document-open.png"), tr("&Load data"), this); + connect(a, SIGNAL(activated()), this, SLOT(load())); + a->setToolTip(tr("Load data from file. Data will be deleted only\nat exit but UDAV will not ask to save it.")); + a->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_O); o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/document-import.png"), tr("&Import PNG"), this); + connect(a, SIGNAL(activated()), this, SLOT(imprt())); + a->setToolTip(tr("Import data from PNG picture with specified color scheme.\nData will be deleted only at exit but UDAV will not ask it saving.")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/document-save.png"), tr("&Save data"), this); + connect(a, SIGNAL(activated()), this, SLOT(save())); + a->setToolTip(tr("Save data to tab-separeted file.")); + a->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_S); o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/document-export.png"), tr("&Export PNG"), this); + connect(a, SIGNAL(activated()), this, SLOT(exprt())); + a->setToolTip(tr("Export data to PNG picture. The colors defined by \nspecified color scheme. The same as in 'dens' command.")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + +// o->addSeparator(); bb->addSeparator(); +// a = new QAction(QPixmap(insert_xpm), tr("Insert as &list"), this); +// connect(a, SIGNAL(activated()), this, SLOT(list())); +// o->addAction(a); +// bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + + a = new QAction(QPixmap(plot_xpm), tr("Plot &data"), this); + connect(a, SIGNAL(activated()), this, SLOT(plot())); + a->setToolTip(tr("Plot data in new script window. You may select the kind\nof plot, its style and so on.")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/edit-copy.png"), tr("Copy &data"), this); + connect(a, SIGNAL(activated()), this, SLOT(copy())); + a->setToolTip(tr("Copy range of numbers to clipboard.")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/edit-paste.png"), tr("Paste &data"), this); + connect(a, SIGNAL(activated()), this, SLOT(copy())); + a->setToolTip(tr("Paste range of numbers from clipboard.")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + // navigation menu + o = menu->addMenu(tr("&Navigate")); + a = new QAction(QPixmap(":/xpm/go-first.png"), tr("&First slice"), this); + connect(a, SIGNAL(activated()), this, SLOT(first())); + a->setToolTip(tr("Go to the first data slice for 3D data.")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/go-previous.png"), tr("&Prev. slice"), this); + connect(a, SIGNAL(activated()), this, SLOT(prev())); + a->setToolTip(tr("Go to the previous data slice for 3D data.")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + sb = new QSpinBox(this); + l->addWidget(sb); sb->setRange(0,0); + sb->setToolTip(tr("Go to the specified data slice for 3D data.")); + connect(sb, SIGNAL(valueChanged(int)), this, SLOT(setSlice(int))); + connect(this, SIGNAL(sliceChanged(int)), sb, SLOT(setValue(int))); + connect(this, SIGNAL(nzChanged(int)), this, SLOT(setNz(int))); + + a = new QAction(tr("Go to slice"), this); + connect(a, SIGNAL(activated()), this, SLOT(gosl())); + a->setToolTip(tr("Go to the specified data slice for 3D data.")); + o->addAction(a); + + a = new QAction(QPixmap(":/xpm/go-next.png"), tr("Next slice"), this); + connect(a, SIGNAL(activated()), this, SLOT(next())); + a->setToolTip(tr("Go to the next data slice for 3D data.")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/go-last.png"), tr("Last slice"), this); + connect(a, SIGNAL(activated()), this, SLOT(last())); + a->setToolTip(tr("Go to the last data slice for 3D data.")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); +} +//----------------------------------------------------------------------------- +void DatPanel::toolLeft(QBoxLayout *l) +{ + QAction *a; + QMenu *o, *oo; + QToolButton *bb; + + // size menu + o = menu->addMenu(tr("&Sizes")); + a = new QAction(QPixmap(":/xpm/document-new.png"), tr("&Create new"), this); + connect(a, SIGNAL(activated()), this, SLOT(create())); + a->setToolTip(tr("Recreate the data with new sizes and fill it by zeros (Ctrl+N).")); + a->setShortcut(Qt::CTRL+Qt::Key_N); o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(size_xpm), tr("&Resize"), this); + connect(a, SIGNAL(activated()), this, SLOT(reSize())); + a->setToolTip(tr("Resize (interpolate) the data to specified sizes (Ctrl+R).")); + a->setShortcut(Qt::CTRL+Qt::Key_R); o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(squize_xpm), tr("&Squeeze"), this); + connect(a, SIGNAL(activated()), this, SLOT(squize())); + a->setToolTip(tr("Keep only each n-th element of the data array.")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(crop_xpm), tr("Cro&p"), this); + connect(a, SIGNAL(activated()), this, SLOT(crop())); + a->setToolTip(tr("Crop the data edges. Useful to cut off the zero-filled area.")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(tran_xpm), tr("&Transpose"), this); + connect(a, SIGNAL(activated()), this, SLOT(transp())); + a->setToolTip(tr("Transpose data dimensions, like x<->y or x<->z and so on.")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(tr("Re&arrange"), this); + connect(a, SIGNAL(activated()), this, SLOT(rearrange())); + a->setToolTip(tr("Rearrange data sizes without changing data values.")); + o->addAction(a); + + // modify menu + o = menu->addMenu(tr("&Modify")); + a = new QAction(QPixmap(func_xpm), tr("By &formula"), this); + connect(a, SIGNAL(activated()), this, SLOT(byformula())); + a->setToolTip(tr("Change data values according to formula depended on 'x', 'y' and 'z'\nvariables. A set of special function is availible also.")); + a->setShortcut(Qt::CTRL+Qt::Key_M); o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(tr("Fill in &range"), this); + connect(a, SIGNAL(activated()), this, SLOT(inrange())); + a->setToolTip(tr("Fill data equidistantly from one value to another.")); + o->addAction(a); + a = new QAction(tr("&Normalize"), this); + connect(a, SIGNAL(activated()), this, SLOT(norm())); + a->setToolTip(tr("Normalize data so that its minimal\nand maximal values be in specified range.")); + o->addAction(a); + a = new QAction(tr("Norm. s&lices"), this); + connect(a, SIGNAL(activated()), this, SLOT(normsl())); + a->setToolTip(tr("Normalize each data slice perpendicular to some direction\nso that its minimal and maximal values be in specified range.")); + o->addAction(a); + a = new QAction(QPixmap(smth_xpm), tr("&Smooth data"), this); + connect(a, SIGNAL(activated()), this, SLOT(smooth())); + a->setToolTip(tr("Smooth data by one of 4 methods along specified direction(s).")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + oo = menu->addMenu(tr("&Operators")); + a = new QAction(QPixmap(sum_xpm), tr("&Cum. sum"), this); + connect(a, SIGNAL(activated()), this, SLOT(cumsum())); + a->setToolTip(tr("Summate data values along specified direction(s).")); + oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(integr_xpm), tr("&Integrate"), this); + connect(a, SIGNAL(activated()), this, SLOT(integr())); + a->setToolTip(tr("Integrate data values along specified direction(s).")); + oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(diff_xpm), tr("&Differentiate"), this); + connect(a, SIGNAL(activated()), this, SLOT(diff())); + a->setToolTip(tr("Differentiate data values along specified direction(s).")); + oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(diff2_xpm), tr("&Laplace"), this); + connect(a, SIGNAL(activated()), this, SLOT(diff2())); + a->setToolTip(tr("Double differentiate data values along specified direction(s).")); + oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(swap_xpm), tr("&Swap"), this); + connect(a, SIGNAL(activated()), this, SLOT(swap())); + a->setToolTip(tr("Swap left and right data part along specified direction(s).\nThis operation is useful for data after Fourier transform.")); + oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(tr("&Mirror"), this); + connect(a, SIGNAL(activated()), this, SLOT(mirror())); + a->setToolTip(tr("Mirror left and right data part along specified direction(s).\nThis operation do like index change from 'i' to 'n-i'.")); + oo->addAction(a); + + oo = menu->addMenu(tr("&Algebraic")); + a = new QAction(QPixmap(oper_a_xpm), tr("&Add"), this); + connect(a, SIGNAL(activated()), this, SLOT(addto())); + a->setToolTip(tr("Add a number to all data values.")); + oo->addAction(a); + a = new QAction(QPixmap(oper_s_xpm), tr("&Subtract"), this); + connect(a, SIGNAL(activated()), this, SLOT(subto())); + a->setToolTip(tr("Subtract a number to all data values.")); + oo->addAction(a); + a = new QAction(QPixmap(oper_m_xpm), tr("&Multiply"), this); + connect(a, SIGNAL(activated()), this, SLOT(multo())); + a->setToolTip(tr("Multiply all data values by a number.")); + oo->addAction(a); + a = new QAction(QPixmap(oper_d_xpm), tr("&Divide"), this); + connect(a, SIGNAL(activated()), this, SLOT(divto())); + a->setToolTip(tr("Divide all data values by a number.")); + oo->addAction(a); + + oo = menu->addMenu(tr("A¬her data")); + a = new QAction(tr("&Sum of"), this); oo->addAction(a); + connect(a, SIGNAL(activated()), this, SLOT(sumof())); + a = new QAction(tr("M&in of"), this); oo->addAction(a); + connect(a, SIGNAL(activated()), this, SLOT(minof())); + a = new QAction(tr("M&ax of"), this); oo->addAction(a); + connect(a, SIGNAL(activated()), this, SLOT(maxof())); + a = new QAction(tr("Momentum along &x"), this); oo->addAction(a); + connect(a, SIGNAL(activated()), this, SLOT(momentx())); + a = new QAction(tr("Momentum along &y"), this); oo->addAction(a); + connect(a, SIGNAL(activated()), this, SLOT(momenty())); + a = new QAction(tr("Momentum along &z"), this); oo->addAction(a); + connect(a, SIGNAL(activated()), this, SLOT(momentz())); + a = new QAction(tr("&Histogram"), this); oo->addAction(a); + connect(a, SIGNAL(activated()), this, SLOT(hist())); + + l->addStretch(1); +} +//----------------------------------------------------------------------------- +QString DatPanel::dataName() { return QString::fromStdWString(var->s); } +//----------------------------------------------------------------------------- diff --git a/udav/dat_pnl.h b/udav/dat_pnl.h new file mode 100644 index 0000000..39a8b7e --- /dev/null +++ b/udav/dat_pnl.h @@ -0,0 +1,121 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef DAT_PNL_H +#define DAT_PNL_H +//----------------------------------------------------------------------------- +#include +//----------------------------------------------------------------------------- +class mglVar; +class QMenu; +class QBoxLayout; +class QTableWidget; +class QSpinBox; +class InfoDialog; +//----------------------------------------------------------------------------- +/// Window for viewing, handling and editing the data array +class DatPanel : public QWidget +{ +Q_OBJECT +public: + QMenu *menu; + InfoDialog *infoDlg; ///< NOTE: Reference to dialog !!! + DatPanel(InfoDialog *inf, QWidget *parent = 0); + ~DatPanel(); + + void refresh(); ///< Refresh table with new data values + void setVar(mglVar *v); + inline long GetNz() { return nz; } ///< Get number of slices + QString dataName(); + +signals: + void sliceChanged(int); + void nzChanged(int); + +private slots: + void setSlice(int k); + void putValue(int r, int c); + // menu genereal + void load(); + void save(); + void imprt(); + void exprt(); + void copy(); + void paste(); + void plot(); + void list(); + // menu fill + void byformula(); + void inrange(); + void norm(); + void normsl(); + // menu resize + void create(); + void reSize(); + void squize(); + void crop(); + void transp(); + void rearrange(); + // menu change + void smooth(); + void cumsum(); + void integr(); + void diff(); + void diff2(); + void swap(); + void mirror(); + // menu another ??? + void sumof(); + void maxof(); + void minof(); + void momentx(); + void momenty(); + void momentz(); + void hist(); + // menu operations + void addto(); + void subto(); + void divto(); + void multo(); + // menu navigation + void first(); + void last(); + void next(); + void prev(); + void gosl(); + void setNz(int nz); + +private: + int nx,ny,nz; ///< Data sizes + QString id; + QTableWidget *tab; ///< Table itself + int kz; ///< Current z-slice + mglVar *var; ///< Variable with data +// QSpinBox *sb; ///< SpinBox for selecting slice + bool ready; ///< Data is refreshed + QSpinBox *sb; + + bool sizesDialog(const QString &cap, const QString &lab, const QString &desc1, const QString &desc2, const QString &desc3, QString &val1, QString &val2, QString &val3); + bool namesDialog(const QString &cap, const QString &lab, QString &name, QString &val); + void toolTop(QBoxLayout *l); + void toolLeft(QBoxLayout *l); +}; +//----------------------------------------------------------------------------- +#endif // DAT_PNL_H +//----------------------------------------------------------------------------- diff --git a/udav/files_dlg.cpp b/udav/files_dlg.cpp new file mode 100644 index 0000000..9be25ee --- /dev/null +++ b/udav/files_dlg.cpp @@ -0,0 +1,95 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include "files_dlg.h" +//----------------------------------------------------------------------------- +FilesDialog::FilesDialog(QWidget *parent) : QDialog(parent) +{ + setWindowTitle(tr("UDAV - Set template parameters")); + QHBoxLayout *h; + QVBoxLayout *v; + QGridLayout *g; + QLabel *l; + QPushButton *b; + + v = new QVBoxLayout(this); + g = new QGridLayout(); v->addLayout(g); + l = new QLabel(tr("String for %1"), this); g->addWidget(l, 0, 0); + a[0] = new QLineEdit(this); g->addWidget(a[0], 1, 0); + l = new QLabel(tr("String for %2"), this); g->addWidget(l, 0, 1); + a[1] = new QLineEdit(this); g->addWidget(a[1], 1, 1); + l = new QLabel(tr("String for %3"), this); g->addWidget(l, 2, 0); + a[2] = new QLineEdit(this); g->addWidget(a[2], 3, 0); + l = new QLabel(tr("String for %4"), this); g->addWidget(l, 2, 1); + a[3] = new QLineEdit(this); g->addWidget(a[3], 3, 1); + l = new QLabel(tr("String for %5"), this); g->addWidget(l, 4, 0); + a[4] = new QLineEdit(this); g->addWidget(a[4], 5, 0); + l = new QLabel(tr("String for %6"), this); g->addWidget(l, 4, 1); + a[5] = new QLineEdit(this); g->addWidget(a[5], 5, 1); + l = new QLabel(tr("String for %7"), this); g->addWidget(l, 6, 0); + a[6] = new QLineEdit(this); g->addWidget(a[6], 7, 0); + l = new QLabel(tr("String for %8"), this); g->addWidget(l, 6, 1); + a[7] = new QLineEdit(this); g->addWidget(a[7], 7, 1); + l = new QLabel(tr("String for %9"), this); g->addWidget(l, 8, 0); + a[8] = new QLineEdit(this); g->addWidget(a[8], 9, 0); + + h = new QHBoxLayout(); h->addStretch(1); v->addLayout(h); + b = new QPushButton(tr("Cancel"), this); h->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(reject())); + b = new QPushButton(tr("OK"), this); h->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(putArguments())); + b->setDefault(true); +} +//----------------------------------------------------------------------------- +FilesDialog::~FilesDialog() {} +//----------------------------------------------------------------------------- +void FilesDialog::putArguments() +{ + for(int i=0;i<9;i++) s[i] = a[i]->text(); + accept(); +} +//----------------------------------------------------------------------------- +void FilesDialog::setNumFiles(int n) +{ + for(int i=0;i<9;i++) a[i]->setEnabled(i9) narg=9; +} +//----------------------------------------------------------------------------- +QString FilesDialog::putFiles(const QString &str) +{ + QString res=str; + switch(narg) + { + case 1: res = str.arg(s[0]); break; + case 2: res = str.arg(s[0],s[1]); break; + case 3: res = str.arg(s[0],s[1],s[2]); break; + case 4: res = str.arg(s[0],s[1],s[2],s[3]); break; + case 5: res = str.arg(s[0],s[1],s[2],s[3],s[4]); break; + case 6: res = str.arg(s[0],s[1],s[2],s[3],s[4],s[5]); break; + case 7: res = str.arg(s[0],s[1],s[2],s[3],s[4],s[5],s[6]); break; + case 8: res = str.arg(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7]); break; + case 9: res = str.arg(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8]); break; + } + return res; +} +//----------------------------------------------------------------------------- diff --git a/udav/files_dlg.h b/udav/files_dlg.h new file mode 100644 index 0000000..2bb3177 --- /dev/null +++ b/udav/files_dlg.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef FILES_DLG_H +#define FILES_DLG_H +//----------------------------------------------------------------------------- +#include +class QLineEdit; +class QComboBox; +class QRadioButton; +//----------------------------------------------------------------------------- +/// Dialog for enetring script arguments $0...$9 +class FilesDialog : public QDialog +{ +Q_OBJECT +public: + FilesDialog(QWidget *parent=0); + ~FilesDialog(); + QString putFiles(const QString &str); + void setNumFiles(int n); + +private slots: + void putArguments(); +private: + QLineEdit *a[9]; + QString s[9]; + int narg; +}; +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/udav/find_dlg.cpp b/udav/find_dlg.cpp new file mode 100644 index 0000000..3d029d5 --- /dev/null +++ b/udav/find_dlg.cpp @@ -0,0 +1,75 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include "find_dlg.h" +//----------------------------------------------------------------------------- +FindDialog::FindDialog(QWidget *parent) : QDialog(parent) +{ + QLabel *lbl; + QHBoxLayout *a; + setWindowTitle(tr("UDAV - Find")); + QVBoxLayout *o = new QVBoxLayout; + a = new QHBoxLayout; o->addLayout(a); + lbl = new QLabel(tr("Find &what:"), this); a->addWidget(lbl); + line = new QLineEdit(this); lbl->setBuddy(line); a->addWidget(line); + a = new QHBoxLayout; o->addLayout(a); + lbl = new QLabel(tr("Replace &by:"), this); a->addWidget(lbl); + text = new QLineEdit(this); lbl->setBuddy(text); a->addWidget(text); + + caseUse = new QCheckBox(tr("Match &case"), this); o->addWidget(caseUse); + backward = new QCheckBox(tr("Search &backward"), this); o->addWidget(backward); + + a = new QHBoxLayout(this); a->setMargin(11); + a->setSpacing(6); a->addLayout(o); + o = new QVBoxLayout; a->addLayout(o); + find = new QPushButton(tr("&Find"), this); o->addWidget(find); + find->setDefault(true); find->setEnabled(false); + repl= new QPushButton(tr("&Replace"), this); o->addWidget(repl); + repl->setEnabled(false); + cancel = new QPushButton(tr("Close"), this); o->addWidget(cancel); + o->addStretch(1); + connect(line, SIGNAL(textChanged(const QString &)), this, SLOT(enableFind(const QString &))); + connect(find, SIGNAL(clicked()), this, SLOT(findClicked())); + connect(repl, SIGNAL(clicked()), this, SLOT(replClicked())); + connect(cancel, SIGNAL(clicked()),this, SLOT(close())); +} +//----------------------------------------------------------------------------- +FindDialog::~FindDialog() {} +//----------------------------------------------------------------------------- +void FindDialog::findClicked() +{ emit findText(line->text(), caseUse->isChecked(), backward->isChecked()); } +//----------------------------------------------------------------------------- +void FindDialog::replClicked() +{ emit replText(line->text(), text->text(), caseUse->isChecked(), backward->isChecked()); } +//----------------------------------------------------------------------------- +void FindDialog::enableFind(const QString &txt) +{ find->setEnabled(!txt.isEmpty()); repl->setEnabled(!txt.isEmpty()); } +//----------------------------------------------------------------------------- +void FindDialog::closeEvent(QCloseEvent *event) +{ + emit replText("", "", false, false); + event->accept(); +} +//----------------------------------------------------------------------------- diff --git a/utils/mgl2svg.cpp b/udav/find_dlg.h similarity index 54% rename from utils/mgl2svg.cpp rename to udav/find_dlg.h index 22d709f..921c259 100644 --- a/utils/mgl2svg.cpp +++ b/udav/find_dlg.h @@ -1,6 +1,6 @@ /*************************************************************************** - * mgl2svg.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -17,49 +17,39 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include "mgl/mgl_eps.h" -#include "mgl/mgl_parse.h" +#ifndef FIND_DLG_H +#define FIND_DLG_H //----------------------------------------------------------------------------- -int main(int narg, char **arg) +#include +class QCheckBox; +class QLineEdit; +class QPushButton; +//----------------------------------------------------------------------------- +/// Dialog for finding something in text +class FindDialog : public QDialog { - mglGraphPS gr; - mglParse p(true); - - if(narg==1) - { - printf("mgl2svg convert mgl script to vector svg file.\n"); - printf("Current version is 1.%g\n",MGL_VERSION); - printf("Usage:\tmgl2svg scriptfile [outputfile parameter(s)]\n"); - printf("\tParameters have format \"-Nval\".\n"); - printf("\tHere N=0,1...9 is parameter ID and val is its value.\n"); - printf("\tOption -Lval set locale to val.\n"); - } - else - { - FILE *fp = fopen(arg[1],"rb"); - if(fp==0) { printf("Couldn't open file %s\n",arg[1]); return 1; } - char str[8192], buf[2048]; - for(long i=2;i='0' && arg[i][1]<='9') - p.AddParam(arg[i][1]-'0',arg[i]+2); - if(arg[i][0]=='-' && arg[i][1]=='L') - setlocale(LC_CTYPE, arg[i]+2); - } - gr.Message = buf; *buf=0; - p.Execute(&gr,fp,true); - fclose(fp); - if(narg>2 && arg[2][0]!='-') strcpy(str,arg[2]); - else - { - strcpy(str,arg[1]); strcat(str,".svg"); - printf("Write output to %s\n",str); - } - gr.WriteSVG(str); - } - return 0; -} +Q_OBJECT +public: + FindDialog(QWidget *parent = 0); + ~FindDialog(); +signals: + void findText(const QString &str, bool cs, bool fw); + void replText(const QString &str, const QString &txt, bool cs, bool fw); +protected: + void closeEvent(QCloseEvent *event); +private slots: + void findClicked(); + void replClicked(); + void enableFind(const QString &text); +private: + QLineEdit *line; + QLineEdit *text; + QCheckBox *caseUse; + QCheckBox *backward; + QPushButton *find; + QPushButton *repl; + QPushButton *cancel; +}; +//----------------------------------------------------------------------------- +#endif //----------------------------------------------------------------------------- diff --git a/udav/help_pnl.cpp b/udav/help_pnl.cpp new file mode 100644 index 0000000..dfac7b8 --- /dev/null +++ b/udav/help_pnl.cpp @@ -0,0 +1,90 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +//----------------------------------------------------------------------------- +#include "help_pnl.h" +extern QString pathHelp; +void raisePanel(QWidget *w); +//----------------------------------------------------------------------------- +HelpPanel::HelpPanel(QWidget *parent) : QWidget(parent) +{ + QPushButton *b; + QToolButton *t; + QVBoxLayout *o = new QVBoxLayout(this); + QHBoxLayout *a = new QHBoxLayout(); o->addLayout(a); + help = new QTextBrowser(this); o->addWidget(help); + help->setOpenExternalLinks(false); setPath(pathHelp); + + b = new QPushButton(QPixmap(":/xpm/go-previous.png"), tr("Backward")); + connect(b, SIGNAL(clicked()), help, SLOT(backward())); a->addWidget(b); + entry = new QLineEdit(this); a->addWidget(entry); + connect(entry, SIGNAL(textChanged(const QString &)), this, SLOT(showHelp(const QString &))); + connect(entry, SIGNAL(returnPressed()), this, SLOT(showHelp())); + b = new QPushButton(QPixmap(":/xpm/go-next.png"), tr("Forward")); + connect(b, SIGNAL(clicked()), help, SLOT(forward())); a->addWidget(b); + b = new QPushButton(QPixmap(":/xpm/help-faq.png"), tr("&Examples")); + connect(b, SIGNAL(clicked()), this, SLOT(showExamples())); a->addWidget(b); + t = new QToolButton(this); t->setIcon(QPixmap(":/xpm/zoom-in.png")); + connect(t, SIGNAL(clicked()), this, SLOT(zoomIn())); a->addWidget(t); + t = new QToolButton(this); t->setIcon(QPixmap(":/xpm/zoom-out.png")); + connect(t, SIGNAL(clicked()), this, SLOT(zoomOut())); a->addWidget(t); + setWindowTitle(tr("Help")); +} +//----------------------------------------------------------------------------- +void HelpPanel::setPath(const QString &path) +{ + QStringList s; s<<(path+"/"+tr("mgl_en")+".html/"); + help->setSearchPaths(s); + help->setSource(tr("mgl_en")+"_1.html"); +//QString pp=path+"/"+tr("mgl_en")+".html/"+tr("mgl_en")+"_1.html"; +//printf("%s\n",pp.toAscii().constData()); +} +//----------------------------------------------------------------------------- +void HelpPanel::showExamples() +{ + setWindowTitle("Examples"); raisePanel(this); + help->setSource(tr("mgl_en")+"_2.html"); +} +//----------------------------------------------------------------------------- +void HelpPanel::showHelp(const QString &txt) +{ + QString cmd=txt; + raisePanel(this); + if(cmd.isEmpty()) cmd = entry->text().trimmed(); + if(cmd.isEmpty()) help->setSource(tr("mgl_en")+"_1.html"); + else help->setSource(tr("mgl_en")+"_1.html#"+cmd); + setWindowTitle("Help"); +} +//----------------------------------------------------------------------------- +void HelpPanel::zoomIn() +{ + QFont f(help->font()); f.setPointSize(f.pointSize()+1); help->setFont(f); +} +//----------------------------------------------------------------------------- +void HelpPanel::zoomOut() +{ + QFont f(help->font()); f.setPointSize(f.pointSize()-1); help->setFont(f); +} +//----------------------------------------------------------------------------- diff --git a/utils/mgl2eps.cpp b/udav/help_pnl.h similarity index 54% rename from utils/mgl2eps.cpp rename to udav/help_pnl.h index a5ad3c6..c3e70c8 100644 --- a/utils/mgl2eps.cpp +++ b/udav/help_pnl.h @@ -1,6 +1,6 @@ /*************************************************************************** - * mgl2eps.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -17,49 +17,28 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include "mgl/mgl_eps.h" -#include "mgl/mgl_parse.h" +#ifndef HELP_PNL_H +#define HELP_PNL_H //----------------------------------------------------------------------------- -int main(int narg, char **arg) +#include +class QTextBrowser; +class QLineEdit; +//----------------------------------------------------------------------------- +class HelpPanel : public QWidget { - mglGraphPS gr; - mglParse p(true); - - if(narg==1) - { - printf("mgl2eps convert mgl script to vector eps file.\n"); - printf("Current version is 1.%g\n",MGL_VERSION); - printf("Usage:\tmgl2eps scriptfile [outputfile parameter(s)]\n"); - printf("\tParameters have format \"-Nval\".\n"); - printf("\tHere N=0,1...9 is parameter ID and val is its value.\n"); - printf("\tOption -Lval set locale to val.\n"); - } - else - { - FILE *fp = fopen(arg[1],"rb"); - if(fp==0) { printf("Couldn't open file %s\n",arg[1]); return 1; } - char str[8192], buf[2048]; - for(long i=2;i='0' && arg[i][1]<='9') - p.AddParam(arg[i][1]-'0',arg[i]+2); - if(arg[i][0]=='-' && arg[i][1]=='L') - setlocale(LC_CTYPE, arg[i]+2); - } - gr.Message = buf; *buf=0; - p.Execute(&gr,fp,true); - fclose(fp); - if(narg>2 && arg[2][0]!='-') strcpy(str,arg[2]); - else - { - strcpy(str,arg[1]); strcat(str,".eps"); - printf("Write output to %s\n",str); - } - gr.WriteEPS(str); - } - return 0; -} +Q_OBJECT +public: + HelpPanel(QWidget *parent = 0); +public slots: + void showExamples(); + void showHelp(const QString &cmd=QString::null); + void setPath(const QString &path); + void zoomIn(); + void zoomOut(); +private: + QTextBrowser *help; + QLineEdit *entry; +}; +//----------------------------------------------------------------------------- +#endif // HELP_PNL_H //----------------------------------------------------------------------------- diff --git a/udav/hint_dlg.cpp b/udav/hint_dlg.cpp new file mode 100644 index 0000000..ae7e8bd --- /dev/null +++ b/udav/hint_dlg.cpp @@ -0,0 +1,95 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include "hint_dlg.h" +//----------------------------------------------------------------------------- +// +// Hint dialog +// +//----------------------------------------------------------------------------- +#define qtr HintDialog::tr +int numHints=-1; +QString hints[] = { + qtr("You can rotate plot by mouse. Just press 'Rotate' toolbutton, click image and hold a mouse button: left button for rotation, right button for zooming/perspective, middle button for shifting."), + qtr("You may quickly draw the data from file. Just use: udav 'filename.dat' in command line."), + qtr("You can copy the current image to clipboard by pressing Ctrl-Shift-C. Later you can paste it directly into yours document or presentation."), + qtr("You can export image into a set of format (EPS, SVG, PNG, JPEG) by pressing right mouse button inside image and selecting 'Export as ...'."), + qtr("You can setup colors for script highlighting in Property dialog. Just select menu item 'Edit/Properties'."), + qtr("You can save the parameter of animation inside MGL script by using comment started from '##a '."), + qtr("New drawing never clears things drawn already. For example, you can make a surface with contour lines by calling commands 'surf' and 'cont' one after another (in any order). "), + qtr("You can put several plots in the same image by help of commands 'subplot' or 'inplot'."), + qtr("All indexes (of data arrays, subplots and so on) are always start from 0."), + qtr("You can edit MGL file in any text editor. Also you can run it in console by help of commands: mgl2png, mgl2eps, mgl2svg and so on."), + qtr("You can use command 'once on|off' for marking the block which should be executed only once. For example, this can be the block of large data reading/creating/handling. Press F9 (or menu item 'Graphics/Reload') to re-execute this block."), + qtr("You can use command 'stop' for terminating script parsing. It is useful if you don't want to execute a part of script."), + qtr("You can type arbitrary expression as input argument for data or number. In last case, the first value of data array is used."), + qtr("There is powerful calculator with a lot of special functions. You can use buttons or keyboard to type the expression. Also you can use existed variables in the expression."), + qtr("The calculator can help you to put complex expression in the script. Just type the expression (which may depend on coordinates x,y,z and so on) and put it into the script."), + qtr("You can easely insert file or folder names, last fitted formula or numerical value of selection by using menu Edit|Insert."), + qtr("The special dialog (Edit|Insert|New Command) help you select the command, fill its arguments and put it into the script."), + qtr("")}; + +//----------------------------------------------------------------------------- +extern "C"{double mgl_rnd();} +HintDialog::HintDialog(QWidget *parent) : QDialog(parent) +{ + if(numHints<0) + for(numHints=0;!hints[numHints].isEmpty();numHints++){}; + cur = int(mgl_rnd()*numHints); + setWindowTitle(tr("UDAV - Hint")); + QHBoxLayout *a; + QPushButton *b; + QVBoxLayout *o = new QVBoxLayout(this); + text = new QTextEdit(this); o->addWidget(text); + text->setReadOnly(true); text->setText(hints[cur]); + + start = new QCheckBox(tr("&Show at startup"), this); o->addWidget(start); + start->setChecked(true); + + a = new QHBoxLayout; o->addLayout(a); + b = new QPushButton(tr("&Prev"), this); a->addWidget(b); + connect(b, SIGNAL(clicked()), this, SLOT(prevClicked())); + b = new QPushButton(tr("&Next"), this); a->addWidget(b); + connect(b, SIGNAL(clicked()), this, SLOT(nextClicked())); + b = new QPushButton(tr("&Close"), this); a->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(close())); +} +//----------------------------------------------------------------------------- +HintDialog::~HintDialog() {} +//----------------------------------------------------------------------------- +void HintDialog::nextClicked() +{ cur = (cur+1)%numHints; text->setText(hints[cur]); } +//----------------------------------------------------------------------------- +void HintDialog::prevClicked() +{ cur--; if(cur<0) cur=numHints-1; text->setText(hints[cur]); } +//----------------------------------------------------------------------------- +void HintDialog::closeEvent(QCloseEvent *) +{ + QSettings settings("udav","UDAV"); + settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV"); + settings.beginGroup("/UDAV"); + settings.setValue("/showHint", start->isChecked()); + settings.endGroup(); +} +//----------------------------------------------------------------------------- diff --git a/udav/hint_dlg.h b/udav/hint_dlg.h new file mode 100644 index 0000000..d99ae39 --- /dev/null +++ b/udav/hint_dlg.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef HINT_DLG_H +#define HINT_DLG_H +//----------------------------------------------------------------------------- +#include +class QCheckBox; +class QTextEdit; +//----------------------------------------------------------------------------- +/// Dialog for finding something in text +class HintDialog : public QDialog +{ +Q_OBJECT +public: + HintDialog(QWidget *parent = 0); + ~HintDialog(); +protected: + void closeEvent(QCloseEvent *event); +private slots: + void nextClicked(); + void prevClicked(); +private: + int cur; + QTextEdit *text; + QCheckBox *start; +}; +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/udav/info_dlg.cpp b/udav/info_dlg.cpp new file mode 100644 index 0000000..a0a6619 --- /dev/null +++ b/udav/info_dlg.cpp @@ -0,0 +1,80 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include "qmglcanvas.h" +#include "info_dlg.h" +//----------------------------------------------------------------------------- +InfoDialog::InfoDialog(QWidget *parent) : QDialog(parent) +{ + var = 0; kz = 0; allowRefresh = true; + QWidget *p; + QVBoxLayout *v, *u; + QLabel *l; + QTabWidget *tab = new QTabWidget(this); + u = new QVBoxLayout(this); u->addWidget(tab); + // graphics + p = new QWidget(this); v = new QVBoxLayout(p); + l = new QLabel(tr("Select kind of plot"),this); v->addWidget(l); + kind = new QComboBox(this); v->addWidget(kind); + mgl = new QMGLCanvas(this); v->addWidget(mgl,1); + mgl->autoResize = true; + mgl->setToolTip(tr("Data preview for current slice.")); + kind->addItem(tr("1D plot")); kind->addItem(tr("2D plot")); + kind->setCurrentIndex(0); // kind->addItem(tr("3D plot")); + connect(kind, SIGNAL(currentIndexChanged(int)), this, SLOT(refresh())); + kind->setToolTip(tr("Kind of plots: lines for 1D, density for 2D.")); + tab->addTab(p, tr("Preview")); + // information + info = new QTextEdit(this); + info->setToolTip(tr("Short information about the data.")); + tab->addTab(info, tr("Information")); +} +//----------------------------------------------------------------------------- +InfoDialog::~InfoDialog() {} +//----------------------------------------------------------------------------- +#include +void InfoDialog::refresh(bool force) +{ + if(!var || (!force && (!allowRefresh || !isVisible()))) return; + QString text, name, sub; + name = QString::fromStdWString(var->s); + sub = "(:,:,"+QString::number(kz)+")\n"; + int i = kind->currentIndex(); + if(i<1) text = "yrange "+name+"\nplot "+name + sub; + else text = "crange "+name+"\ndens "+name + sub; + text = "zoom 0.15 0.15 0.85 0.85\nbox\n" + text + "\ninfo "+name; + info->setText(mgl->run(text, false)); +} +//----------------------------------------------------------------------------- +void InfoDialog::setVar(mglVar *v) +{ + var=v; + if(v) kind->setCurrentIndex(v->d.ny>1 ? 1:0); + refresh(); +} +//----------------------------------------------------------------------------- +void InfoDialog::showEvent(QShowEvent *) +{ refresh(true); } +//----------------------------------------------------------------------------- diff --git a/udav/info_dlg.h b/udav/info_dlg.h new file mode 100644 index 0000000..0f0b8ef --- /dev/null +++ b/udav/info_dlg.h @@ -0,0 +1,56 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef INFODIALOG_H +#define INFODIALOG_H +//----------------------------------------------------------------------------- +#include +#include +//----------------------------------------------------------------------------- +class QMGLCanvas; +class mglVar; +class QComboBox; +class QTextEdit; +//----------------------------------------------------------------------------- +/// Display picture and short information about variable +class InfoDialog : public QDialog +{ +Q_OBJECT +public: + InfoDialog(QWidget *parent = 0); + ~InfoDialog(); + void setVar(mglVar *v); + void setSlice(int k) { kz=k; refresh(); }; + bool allowRefresh; +// void setName(QString &name); + void showEvent(QShowEvent *ev); + +public slots: + void refresh(bool force=false); + +private: + int kz; + mglVar *var; + QMGLCanvas *mgl; + QTextEdit *info; + QComboBox *kind; +}; +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/udav/main.cpp b/udav/main.cpp new file mode 100644 index 0000000..13b4845 --- /dev/null +++ b/udav/main.cpp @@ -0,0 +1,135 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include "udav_wnd.h" +#include "hint_dlg.h" +#include +#include +//----------------------------------------------------------------------------- +#ifndef UDAV_DIR +#ifdef WIN32 +#define UDAV_DIR "" +#else +#define UDAV_DIR "/usr/local/share/udav/" +#endif +#endif +//----------------------------------------------------------------------------- +extern mglParser parser; +extern QString pathFont; +int mgl_cmd_cmp(const void *a, const void *b); +HintDialog *hintDialog=NULL; +QString pathHelp=MGL_DOC_DIR; +extern bool showHint; +//----------------------------------------------------------------------------- +void udavLoadDefCommands(); +//----------------------------------------------------------------------------- +int main(int argc, char **argv) +{ + QApplication a(argc, argv); + QTranslator translator; +//QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); + + QString lang=""; + QSettings settings("udav","UDAV"); + settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV"); + settings.beginGroup("/UDAV"); + pathHelp = settings.value("/helpPath", MGL_DOC_DIR).toString(); + pathFont = settings.value("/userFont", "").toString(); + lang = settings.value("/udavLang", "").toString(); + settings.endGroup(); + if(pathHelp.isEmpty()) pathHelp=MGL_DOC_DIR; + + if(!lang.isEmpty()) + { + if(!translator.load("udav_"+lang, UDAV_DIR)) + translator.load("udav_"+lang, pathHelp); + a.installTranslator(&translator); + } + + udavLoadDefCommands(); + hintDialog = new HintDialog(); + MainWindow *mw = new MainWindow(); + if(argc>1) + { + QTextCodec *codec = QTextCodec::codecForLocale(); + mw->load(codec->toUnicode(argv[1]), true); + } + mw->show();// mw->edit->setCursorPosition(0); + a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); + if(showHint) hintDialog->exec(); + return a.exec(); +} +//----------------------------------------------------------------------------- +// +// mgl addon +// +//----------------------------------------------------------------------------- +/*mglCommand udav_base_cmd[] = { + {L"fplot",L"Plot curve by formula",L"fplot 'func' ['stl'='' num=100]", mgls_fplot, mglc_fplot}, + {L"fsurf",L"Plot surface by formula",L"fsurf 'func' ['stl'='' numx=100 numy=100]", mgls_fsurf, mglc_fsurf}, + {L"fgets",L"Print string from file",L"fgets x y {z} 'fname' [pos=0 'stl'='' size=-1.4]", mgls_fgets, mglc_fgets}, +{L"",0,0,0,0}};*/ +//----------------------------------------------------------------------------- +void udavAddCommands(const mglCommand *cmd) +{ + int i, mp, mc; + // determine the number of symbols + for(i=0;parser.Cmd[i].name[0];i++){}; mp = i; + for(i=0;cmd[i].name[0];i++){}; mc = i; + mglCommand *buf = new mglCommand[mp+mc+1]; + memcpy(buf, parser.Cmd, mp*sizeof(mglCommand)); + memcpy(buf+mp, cmd, (mc+1)*sizeof(mglCommand)); + qsort(buf, mp+mc, sizeof(mglCommand), mgl_cmd_cmp); + if(parser.Cmd!=mgls_base_cmd) delete []parser.Cmd; + parser.Cmd = buf; +} +//----------------------------------------------------------------------------- +void udavLoadDefCommands() +{ +// udavAddCommands(udav_base_cmd); +} +//----------------------------------------------------------------------------- +#ifdef WIN32 +void udavLoadCommands(const char *, const char *) {} +#else +void udavLoadCommands(const char *, const char *) {} +/*#include +typedef const mglCommadns *(*udav_cmd) (); +void udavLoadCommands(const char *lib, const char *func) +{ + void *jmodule=0; + udav_cmd ff; + if(lt_dlinit()) return; + errors=lt_dlsetsearchpath(MOD_LIB_DIR); + jmodule=lt_dlopenext(lib); + if(jmodule) + { + ff = (udav_cmd) lt_dlsym((lt_dlhandle) jmodule, func); + udavAddCommands(ff()); + lt_dlclose((lt_dlhandle) jmodule); + } + lt_dlexit(); +}*/ +#endif +//----------------------------------------------------------------------------- diff --git a/udav/mem_pnl.cpp b/udav/mem_pnl.cpp new file mode 100644 index 0000000..112999d --- /dev/null +++ b/udav/mem_pnl.cpp @@ -0,0 +1,181 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +//----------------------------------------------------------------------------- +#include "mem_pnl.h" +#include "info_dlg.h" +#include "dat_pnl.h" +//----------------------------------------------------------------------------- +#include "xpm/table.xpm" +#include "xpm/preview.xpm" +//----------------------------------------------------------------------------- +extern bool mglAutoSave; +extern mglParser parser; +//----------------------------------------------------------------------------- +MemPanel::MemPanel(QWidget *parent) : QWidget(parent) +{ + QHBoxLayout *h; + QVBoxLayout *v; + QToolButton *b; + + infoDlg = new InfoDialog(this); + infoDlg->setModal(true); infoDlg->allowRefresh=false; + + v = new QVBoxLayout(this); h = new QHBoxLayout(); v->addLayout(h); + b = new QToolButton(this); b->setIcon(QPixmap(":/xpm/document-new.png")); + b->setToolTip(tr("Create new data array")); h->addWidget(b); + connect(b, SIGNAL(clicked()), this, SLOT(newTable())); + b = new QToolButton(this); b->setIcon(QPixmap(table_xpm)); + b->setToolTip(tr("Edit selected data array")); h->addWidget(b); + connect(b, SIGNAL(clicked()), this, SLOT(editData())); + b = new QToolButton(this); b->setIcon(QPixmap(":/xpm/edit-delete.png")); + b->setToolTip(tr("Delete selected data array")); h->addWidget(b); + connect(b, SIGNAL(clicked()), this, SLOT(delData())); + b = new QToolButton(this); b->setIcon(QPixmap(preview_xpm)); + b->setToolTip(tr("Properties of selected data array")); h->addWidget(b); + connect(b, SIGNAL(clicked()), this, SLOT(infoData())); + b = new QToolButton(this); b->setIcon(QPixmap(":/xpm/view-refresh.png")); + b->setToolTip(tr("Update list of data arrays")); h->addWidget(b); + connect(b, SIGNAL(clicked()), this, SLOT(refresh())); + h->addStretch(1); + b = new QToolButton(this); b->setIcon(QPixmap(":/xpm/edit-delete.png")); + b->setToolTip(tr("Delete ALL data arrays")); h->addWidget(b); + connect(b, SIGNAL(clicked()), this, SLOT(delAllData())); + + colSort = 0; + tab = new QTableWidget(this); tab->setColumnCount(3); v->addWidget(tab); + QStringList sl; sl<setHorizontalHeaderLabels(sl); + connect(tab, SIGNAL(cellClicked(int,int)), this, SLOT(tableClicked(int,int))); + connect(tab, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(tableDClicked(int,int))); + + setWindowTitle(tr("Memory")); +} +//----------------------------------------------------------------------------- +void MemPanel::tableClicked(int, int col) +{ colSort = col; tab->sortItems(col); } +//----------------------------------------------------------------------------- +void MemPanel::tableDClicked(int row, int) { editData(row); } +//----------------------------------------------------------------------------- +DatPanel *MemPanel::newWindow(mglVar *v) +{ + DatPanel *t = new DatPanel(infoDlg); + if(v) t->setVar(v); + addPanel(t); + return t; +} +//----------------------------------------------------------------------------- +void MemPanel::newTable() +{ + bool ok; + QString name = QInputDialog::getText(this, tr("UDAV - New variable"), + tr("Enter name for new variable"), QLineEdit::Normal, "", &ok); + if(!ok || name.isEmpty()) return; + mglVar *v = parser.AddVar(name.toAscii()); + DatPanel *t; + if(v->o) t = (DatPanel *)v->o; + else t = newWindow(v); + t->showMaximized(); t->activateWindow(); + refresh(); +} +//----------------------------------------------------------------------------- +void MemPanel::editData(int n) +{ + if(tab->rowCount()<1) return; + if(n<0) n = tab->currentRow(); + if(n<0) n = 0; + mglVar *v = parser.FindVar(tab->item(n,0)->text().toAscii()); + if(!v) return; + DatPanel *t; + if(v->o) t = (DatPanel *)v->o; + else t = newWindow(v); + t->showMaximized(); t->activateWindow(); +} +//----------------------------------------------------------------------------- +void MemPanel::delData() +{ + if(tab->rowCount()<1) return; + int n = tab->currentRow(); + if(n<0) n = 0; + mglVar *v = parser.FindVar(tab->item(n,0)->text().toAscii()); + if(!v) return; + if(v->o) ((DatPanel *)v->o)->close(); + parser.DeleteVar(v); + refresh(); +} +//----------------------------------------------------------------------------- +void MemPanel::delAllData() +{ + if(QMessageBox::information(this, tr("UDAV - delete all data"), + tr("Do you want to delete all data?"), QMessageBox::No, + QMessageBox::Yes)!=QMessageBox::Yes) return; + while(parser.DataList) parser.DeleteVar(parser.DataList); + refresh(); +} +//----------------------------------------------------------------------------- +void MemPanel::infoData() +{ + if(tab->rowCount()<1) return; + int n = tab->currentRow(); + if(n<0) n = 0; + mglVar *v = parser.FindVar(tab->item(n,0)->text().toAscii()); + if(!v) return; + infoDlg->setVar(v); + QString s = QString::fromStdWString(v->s); + infoDlg->setWindowTitle(s + tr(" - UDAV preview")); + infoDlg->refresh(); + infoDlg->show(); +} +//----------------------------------------------------------------------------- +void MemPanel::refresh() +{ + mglVar *v = parser.DataList; + int n = 0; + while(v) { v = v->next; n++; } + tab->setRowCount(n); + v = parser.DataList; n = 0; + QString s; + QTableWidgetItem *it; + Qt::ItemFlags flags=Qt::ItemIsSelectable|Qt::ItemIsEnabled; + while(v) + { + s = QString::fromStdWString(v->s); + it = new QTableWidgetItem(s); + tab->setItem(n,0,it); it->setFlags(flags); + s.sprintf("%ld * %ld * %ld", v->d.nx, v->d.ny, v->d.nz); + it = new QTableWidgetItem(s); + tab->setItem(n,1,it); it->setFlags(flags); + it->setTextAlignment(Qt::AlignHCenter|Qt::AlignVCenter); + s.sprintf("%12ld", v->d.nx*v->d.ny*v->d.nz*sizeof(float)); + it = new QTableWidgetItem(s); + tab->setItem(n,2,it); it->setFlags(flags); + it->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); + if(v->o) ((DatPanel *)v->o)->refresh(); + v = v->next; n++; + } + tab->sortItems(colSort); + emit refreshData(); +} +//----------------------------------------------------------------------------- diff --git a/udav/mem_pnl.h b/udav/mem_pnl.h new file mode 100644 index 0000000..c60b62e --- /dev/null +++ b/udav/mem_pnl.h @@ -0,0 +1,54 @@ +#ifndef MEM_PNL_H +#define MEM_PNL_H +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +class mglVar; +class InfoDialog; +class DatPanel; +class QTableWidget; +//----------------------------------------------------------------------------- +class MemPanel : public QWidget +{ +Q_OBJECT +public: + MemPanel(QWidget *parent = 0); + DatPanel *newWindow(mglVar *v=0); +public slots: + void refresh(); ///< refresh list of variables +signals: + void addPanel(QWidget *); + void refreshData(); +private slots: + void newTable(); + void editData(int n=-1); + void infoData(); + void delAllData(); + void delData(); + void tableClicked(int row, int col); + void tableDClicked(int row, int col); +private: + InfoDialog *infoDlg; ///< Data preview and information + QTableWidget *tab; + int colSort; +}; +//----------------------------------------------------------------------------- +#endif // MEM_PNL_H +//----------------------------------------------------------------------------- diff --git a/udav/newcmd_dlg.cpp b/udav/newcmd_dlg.cpp new file mode 100644 index 0000000..759da0a --- /dev/null +++ b/udav/newcmd_dlg.cpp @@ -0,0 +1,356 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "newcmd_dlg.h" +#include "opt_dlg.h" +#include "style_dlg.h" +extern mglParser parser; +extern QString pathHelp; +//----------------------------------------------------------------------------- +NewCmdDialog::NewCmdDialog(QWidget *p) : QDialog(p,Qt::WindowStaysOnTopHint) +{ + fillList(); + QPushButton *b; + QToolButton *t; + QHBoxLayout *m = new QHBoxLayout(this), *a; + QVBoxLayout *o = new QVBoxLayout; m->addLayout(o); + optDialog = new OptionDialog(this); + stlDialog = new StyleDialog(this); + type = new QComboBox(this); o->addWidget(type); + type->setToolTip(tr("Groups of MGL commands")); + name = new QComboBox(this); o->addWidget(name); + name->setToolTip(tr("MGL commands for selected group")); + type->addItems(types); name->addItems(argn[0]); + info = new QLabel(this); o->addWidget(info); + info->setToolTip(tr("Short description of selected command")); + kind= new QComboBox(this); o->addWidget(kind); kind->addItem(""); + kind->setToolTip(tr("Kind of command argument order. The notation is:\n" + " * Capital arguments are data (like, Ydat);\n" + " * Argument in '' are strings (like, 'fmt');\n" + " * Other arguments are numbers (like, zval);\n" + " * Arguments in [] are optional arguments.")); + args = new QTableWidget(this); o->addWidget(args); + args->setToolTip(tr("Command arguments. Bold ones are required arguments.\n" + "Other are optional arguments but its order is required.\n" + "You can use '' for default format. See help at right\nfor default values.")); + QStringList sl; sl<setHorizontalHeaderLabels(sl); + + a = new QHBoxLayout; o->addLayout(a); + b = new QPushButton(tr("Add style"),this); a->addWidget(b); + b->setToolTip(tr("Here you can select the plot style.\nThe result will be placed in 'fmt' argument.")); + connect(b, SIGNAL(clicked()),this,SLOT(insertStl())); + b = new QPushButton(tr("Add data"),this); a->addWidget(b); + connect(b, SIGNAL(clicked()),this,SLOT(insertData())); + b = new QPushButton(tr("Options"),this); a->addWidget(b); + b->setToolTip(tr("Here you can specify command options.\nOptions are used for additional plot tunning.")); + connect(b, SIGNAL(clicked()),this,SLOT(insertOpt())); + QLabel *l=new QLabel(tr("Options")); o->addWidget(l); + opt = new QLineEdit(this); o->addWidget(opt); + a = new QHBoxLayout; o->addLayout(a); + b = new QPushButton(tr("Cancel"),this); a->addWidget(b); + connect(b, SIGNAL(clicked()), this, SLOT(reject())); + b = new QPushButton(tr("OK"),this); a->addWidget(b); + connect(b, SIGNAL(clicked()), this, SLOT(finish())); + + o = new QVBoxLayout; m->addLayout(o,1); + a = new QHBoxLayout; o->addLayout(a); + help = new QTextBrowser(this); + help->setMinimumWidth(500); setPath(pathHelp); + help->setOpenExternalLinks(false); o->addWidget(help); + t = new QToolButton(p); t->setIcon(QPixmap(":/xpm/go-previous.png")); + connect(t, SIGNAL(clicked()), help, SLOT(backward())); a->addWidget(t); + t = new QToolButton(p); t->setIcon(QPixmap(":/xpm/go-next.png")); + connect(t, SIGNAL(clicked()), help, SLOT(forward())); a->addWidget(t); + a->addStretch(1); + t = new QToolButton(p); t->setIcon(QPixmap(":/xpm/zoom-in.png")); + connect(t, SIGNAL(clicked()), this, SLOT(zoomIn())); a->addWidget(t); + t = new QToolButton(p); t->setIcon(QPixmap(":/xpm/zoom-out.png")); + connect(t, SIGNAL(clicked()), this, SLOT(zoomOut())); a->addWidget(t); + + connect(type, SIGNAL(currentIndexChanged(int)),this,SLOT(typeChanged(int))); + connect(name, SIGNAL(currentIndexChanged(int)),this,SLOT(nameChanged(int))); + connect(kind, SIGNAL(currentIndexChanged(int)),this,SLOT(kindChanged(int))); + type->setCurrentIndex(0); typeChanged(0); +} +//----------------------------------------------------------------------------- +void NewCmdDialog::zoomIn() +{ QFont f(help->font()); f.setPointSize(f.pointSize()+1); help->setFont(f); } +//----------------------------------------------------------------------------- +void NewCmdDialog::zoomOut() +{ QFont f(help->font()); f.setPointSize(f.pointSize()-1); help->setFont(f); } +//----------------------------------------------------------------------------- +void NewCmdDialog::parseCmd(const QString &txt) +{ + QString str = txt.trimmed().section(':',0,0); + QRegExp sep("[ \t]"); + QString cmd = str.section(sep,0,0),a,b; + bool opt,var,chr; + for(int i=0;i<17;i++) + { + if(cmds[i].contains(cmd)) // find command first + { + typeChanged(i); + nameChanged(cmds[i].indexOf(cmd)); + register int j,j0,k,k0; + bool ok; + for(j0=k0=-1,j=0;jk0)) { j0=j; k0=k; } + } + if(j0>=0) // best choice + { + kindChanged(j0); + for(k=0;kitem(k,1)->setText(str.section(sep,k+1,k+1).trimmed()); + } + return; // selection is done + } + } +} +//----------------------------------------------------------------------------- +void NewCmdDialog::fillList() +{ + types<16) return; + name->clear(); name->addItems(cmds[s]); name->setCurrentIndex(0); +} +//----------------------------------------------------------------------------- +void parse(QStringList &sl, const QString &s) +{ + sl.clear(); + int i, ex=0, i1=0; + bool op=false, sp=true; + for(i=0;isetSearchPaths(s); + help->setSource(tr("mgl_en")+"_1.html"); +} +//----------------------------------------------------------------------------- +void NewCmdDialog::nameChanged(int s) +{ + QString n=name->itemText(s), par, a; + int k; + if(n.isEmpty()) return; + help->setSource(tr("mgl_en")+"_1.html#"+n); + // clear old + kind->clear(); kinds.clear(); for(k=0;ksetText(QString::fromWCharArray(rts->desc)); + + par = QString::fromWCharArray(rts->form); + int i0 = par.indexOf(' '); // first space if present + if(i0<0) { kind->addItem(par); return; } // no arguments + // parse kind of arguments + par = par.mid(i0); + for(k=0;kaddItems(kinds); kind->setCurrentIndex(0); +} +//----------------------------------------------------------------------------- +void NewCmdDialog::kindChanged(int s) +{ + if(s<0 || s>NUM_CH-1) return; + cmd=""; + int nn = argn[s].count(); +//return; + args->setRowCount(nn); args->setColumnCount(2); + QTableWidgetItem *it; + QString a; + QFont f; + bool optional; + for(int i=0;isetItem(i,0,it); + it = new QTableWidgetItem; args->setItem(i,1,it); + a = argn[s].at(i); + optional = (a[0]=='_' || a[0]=='+'); if(optional) a=a.mid(1); + f.setItalic(a[0].isUpper()); f.setBold(!optional); + args->item(i,0)->setText(a); args->item(i,0)->setFont(f); + args->item(i,0)->setFlags(Qt::ItemIsEnabled); + args->item(i,1)->setFlags(Qt::ItemIsEditable|Qt::ItemIsEnabled); + } +} +//----------------------------------------------------------------------------- +void NewCmdDialog::insertData() {} // TODO !!! +//----------------------------------------------------------------------------- +void NewCmdDialog::insertOpt() +{ if(optDialog->exec()) opt->setText(optDialog->getOption()); } +//----------------------------------------------------------------------------- +void NewCmdDialog::insertStl() +{ + int s=kind->currentIndex(); + if(s<0 || s>4) + { QMessageBox::warning(this,tr("New command"), + tr("Select first the proper kind of arguments")); + return; } + if(!argn[s].contains("'fmt'") && !argn[s].contains("_'fmt'")) + { QMessageBox::warning(this,tr("New command"), + tr("There is no 'fmt' argument for this command")); + return; } + int i; + i = argn[s].indexOf("'fmt'"); + if(i<0) i = argn[s].indexOf("_'fmt'"); + if(!stlDialog->exec()) return; + args->item(i,1)->setText(stlDialog->getStyle()); +} +//----------------------------------------------------------------------------- +void NewCmdDialog::finish() +{ + QString txt,cur; + int s = kind->currentIndex(); + if(s<0 || s>4) + { QMessageBox::warning(this,tr("New command"), + tr("Select first the proper kind of arguments")); + cmd=""; return; } + cmd = name->currentText(); + int n = argn[s].count(), i; + bool op=false; + for(i=0;iitem(i,1)->text(); + if(txt.isEmpty()) + { + if(cur[0]!='_' && cur[0]!='+') + { QMessageBox::warning(this,tr("New command"), + tr("You should specify required argument ")+cur); + cmd=""; return; } + if(argn[s].at(i)[0]=='_') op = true; + } + else + { + if(cur[0]=='\'' && txt[0]!='\'') + { QMessageBox::warning(this,tr("New command"), + tr("You should put text inside ' ' for argument ")+cur); + cmd=""; return; } + if(cur[1]=='\'' && txt[0]!='\'') + { QMessageBox::warning(this,tr("New command"), + tr("You should put text inside ' ' for argument ")+cur.mid(1)); + cmd=""; return; } + if(cur[0]=='_' && op) + { QMessageBox::warning(this,tr("New command"), + tr("You should specify all optional arguments before ")+cur.mid(1)); + cmd=""; return; } + cmd = cmd + ' ' + txt; + } + } + cmd = cmd + opt->text(); accept(); emit result(cmd); +} +//----------------------------------------------------------------------------- diff --git a/udav/newcmd_dlg.h b/udav/newcmd_dlg.h new file mode 100644 index 0000000..74526b9 --- /dev/null +++ b/udav/newcmd_dlg.h @@ -0,0 +1,74 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef NEWCMDDIALOG_H +#define NEWCMDDIALOG_H +//----------------------------------------------------------------------------- +#include +#include +#define NUM_CH 16 // number of argument sets for a command +class QComboBox; +class QLabel; +class QLineEdit; +class QTableWidget; +class QTextBrowser; +class OptionDialog; +class StyleDialog; +//----------------------------------------------------------------------------- +class NewCmdDialog : public QDialog +{ +Q_OBJECT +public: + NewCmdDialog(QWidget *p); + const QString &getCommand() { return cmd; } + +private slots: + void typeChanged(int); + void nameChanged(int); + void kindChanged(int); + void insertData(); + void insertOpt(); + void insertStl(); + void finish(); + void zoomIn(); + void zoomOut(); + +public slots: + void setPath(const QString &path); + void parseCmd(const QString &txt); + +signals: + void result(const QString &txt); + +private: + QTextBrowser *help; + QComboBox *type, *name, *kind; + QLineEdit *opt; + QLabel *info; + QTableWidget *args; + QString cmd; + QStringList types, cmds[17], argn[NUM_CH], kinds; + OptionDialog *optDialog; + StyleDialog *stlDialog; + + void fillList(); +}; +//----------------------------------------------------------------------------- +#endif // NEWCMDDIALOG_H +//----------------------------------------------------------------------------- diff --git a/udav/open_dlg.cpp b/udav/open_dlg.cpp new file mode 100644 index 0000000..e478e5e --- /dev/null +++ b/udav/open_dlg.cpp @@ -0,0 +1,165 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "open_dlg.h" +int numDataOpened=0; +extern mglParser parser; +QStringList dataScr; +//----------------------------------------------------------------------------- +DataOpenDialog::DataOpenDialog(QWidget *parent) : QDialog(parent) +{ + setWindowTitle(tr("UDAV - Open data file")); + QHBoxLayout *a; + QLabel *l; + QPushButton *b; + QVBoxLayout *o=new QVBoxLayout(this); + + a = new QHBoxLayout; o->addLayout(a); + l = new QLabel(tr("Data name")); a->addWidget(l); + char buf[32]; sprintf(buf,"mgl_%d",numDataOpened); + name = new QLineEdit(buf,this); a->addWidget(name); + + rA = new QRadioButton(tr("Auto detect data sizes"), this); + rA->setChecked(true); o->addWidget(rA); + rM = new QRadioButton(tr("Set data sizes manually"), this); + o->addWidget(rM); a = new QHBoxLayout; o->addLayout(a); + l = new QLabel(tr("Nx")); a->addWidget(l); + nx = new QLineEdit("1",this); a->addWidget(nx); + l = new QLabel(tr("Ny")); a->addWidget(l); + ny = new QLineEdit("1",this); a->addWidget(ny); + l = new QLabel(tr("Nz")); a->addWidget(l); + nz = new QLineEdit("1",this); a->addWidget(nz); + r2 = new QRadioButton(tr("Matrix with sizes from file"), this); o->addWidget(r2); + r3 = new QRadioButton(tr("3D data with sizes from file"), this);o->addWidget(r3); + + + QSettings settings("udav","UDAV"); + settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV"); + settings.beginGroup("/UDAV"); + dataScr = settings.value("/dataScr").toStringList().mid(0,10); + dataScr.removeDuplicates(); + settings.endGroup(); + + a = new QHBoxLayout; o->addLayout(a); + l = new QLabel(tr("Template")); a->addWidget(l,0); + scr = new QComboBox(this); a->addWidget(scr,1); + scr->setEditable(true); scr->lineEdit()->setText(""); + scr->addItem(tr("default")); scr->addItems(dataScr); + b = new QPushButton("...", this); a->addWidget(b,0); + connect(b, SIGNAL(clicked()),this, SLOT(selectScr())); + + a = new QHBoxLayout; o->addLayout(a); a->addStretch(1); + b = new QPushButton(tr("Cancel"),this); a->addWidget(b); + connect(b,SIGNAL(clicked()),this,SLOT(reject())); + b = new QPushButton(tr("OK"), this); a->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(prepareResult())); + b->setDefault(true); +} +//----------------------------------------------------------------------------- +DataOpenDialog::~DataOpenDialog(){} +//----------------------------------------------------------------------------- +void DataOpenDialog::selectScr() +{ + QString str = QFileDialog::getOpenFileName(this, tr("UDAV - Insert filename"), + scr->lineEdit()->text(), tr("MGL files (*.mgl)")); + if(!str.isEmpty()) + { + scr->lineEdit()->setText(str); + scr->insertItem(1,str); + dataScr.insert(0,str); + dataScr.removeDuplicates(); + } +} + +//----------------------------------------------------------------------------- +void DataOpenDialog::prepareResult() +{ + code = ""; numDataOpened++; data = name->text(); + // prepare unique value of name for next time + char buf[32]; sprintf(buf,"mgl_%d",numDataOpened); name->setText(buf); + mglVar *v = parser.AddVar(data.toAscii()); + bool dd=0; + if(rA->isChecked()) // auto sizes + { + setlocale(LC_ALL, "C"); v->d.Read(file.toAscii().constData()); setlocale(LC_ALL, ""); + if(v->d.nx==1) { v->d.nx = v->d.ny; v->d.ny = v->d.nz; } + code=QString("#read %1 '%2'\n").arg(data).arg(file); + } + else if(rM->isChecked()) // manual sizes + { + int x=nx->text().toInt(), y=ny->text().toInt(), z=nz->text().toInt(); + setlocale(LC_ALL, "C"); v->d.Read(file.toAscii().constData(),x,y,z); setlocale(LC_ALL, ""); + code=QString("#read %1 '%2' %3 %4 %5\n").arg(data).arg(file).arg(x).arg(y).arg(z); + } + else if(r2->isChecked()) // matrix + { + setlocale(LC_ALL, "C"); v->d.ReadMat(file.toAscii().constData()); setlocale(LC_ALL, ""); + code=QString("#readmat %1 '%2'\n").arg(data).arg(file); dd=1; + } + else if(r3->isChecked()) // 3d-data + { + setlocale(LC_ALL, "C"); v->d.ReadMat(file.toAscii().constData(),3); setlocale(LC_ALL, ""); + code=QString("#readmat %1 '%2' 3\n").arg(data).arg(file); dd=2; + } + if(scr->lineEdit()->text().isEmpty() || scr->lineEdit()->text()==tr("default")) + { + if(v->d.nz>1 || dd==2) + code+=QString("rotate 40 60\ncrange %1:box\nsurf3 %1\n").arg(data); + else if(v->d.ny>1 || dd==1) + code+=QString("rotate 40 60\ncrange %1:zrange %1:box\nsurf %1\n").arg(data); + else code+=QString("yrange %1:box\nplot %1\n").arg(data); + } + else + { + QString str; + QFile fp(scr->lineEdit()->text()); + if(fp.open(QFile::ReadOnly | QIODevice::Text)) + { + QTextStream in(&fp); + str = in.readAll(); + code += str.arg(data); + } + } + + QSettings settings("udav","UDAV"); + settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV"); + settings.beginGroup("/UDAV"); + settings.setValue("/dataScr", dataScr); + settings.endGroup(); + + accept(); +} +//----------------------------------------------------------------------------- +void DataOpenDialog::setFile(const QString &fname) +{ + file=fname; + mglData d(file.toAscii().constData()); + rA->setText(tr("Auto detect data sizes (%1 x %2 x %3)").arg(d.nx).arg(d.ny).arg(d.nz)); +} +//----------------------------------------------------------------------------- diff --git a/udav/open_dlg.h b/udav/open_dlg.h new file mode 100644 index 0000000..9f74c9a --- /dev/null +++ b/udav/open_dlg.h @@ -0,0 +1,49 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef OPEN_DLG_H +#define OPEN_DLG_H +//----------------------------------------------------------------------------- +#include +class QLineEdit; +class QComboBox; +class QRadioButton; +//----------------------------------------------------------------------------- +/// Dialog for selecting command options +class DataOpenDialog : public QDialog +{ +Q_OBJECT +public: + DataOpenDialog(QWidget *parent=0); + ~DataOpenDialog(); + inline const QString getCode() { return code; } + inline const QString getName() { return data; } + void setFile(const QString &fname); +private slots: + void prepareResult(); + void selectScr(); +private: + QString code, data, file; + QLineEdit *nx, *ny, *nz, *name; + QRadioButton *rA, *rM, *r2, *r3; + QComboBox *scr; +}; +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/udav/opt_dlg.cpp b/udav/opt_dlg.cpp new file mode 100644 index 0000000..2ca30a6 --- /dev/null +++ b/udav/opt_dlg.cpp @@ -0,0 +1,115 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include "opt_dlg.h" +//----------------------------------------------------------------------------- +OptionDialog::OptionDialog(QWidget *parent) : QDialog(parent) +{ + setWindowTitle(tr("UDAV - Add options")); + QHBoxLayout *a; + QGridLayout *g; + QLabel *lbl; + QPushButton *b; + QVBoxLayout *o = new QVBoxLayout(this); //o->setSpacing(6); + g = new QGridLayout(); o->addLayout(g); + lbl = new QLabel(tr("X-range"),this); g->addWidget(lbl,0,0); + x1 = new QLineEdit(this); g->addWidget(x1,0,1); + x2 = new QLineEdit(this); g->addWidget(x2,0,2); + lbl = new QLabel(tr("Y-range"),this); g->addWidget(lbl,0,3); + y1 = new QLineEdit(this); g->addWidget(y1,0,4); + y2 = new QLineEdit(this); g->addWidget(y2,0,5); + lbl = new QLabel(tr("Z-range"),this); g->addWidget(lbl,1,0); + z1 = new QLineEdit(this); g->addWidget(z1,1,1); + z2 = new QLineEdit(this); g->addWidget(z2,1,2); + lbl = new QLabel(tr("C-range"),this); g->addWidget(lbl,1,3); + c1 = new QLineEdit(this); g->addWidget(c1,1,4); + c2 = new QLineEdit(this); g->addWidget(c2,1,5); + g = new QGridLayout(); o->addLayout(g); + lbl = new QLabel(tr("Alpha"),this); g->addWidget(lbl,0,0); + alpha = new QLineEdit(this); g->addWidget(alpha,1,0); + lbl = new QLabel(tr("Ambient"),this); g->addWidget(lbl,0,1); + amb = new QLineEdit(this); g->addWidget(amb,1,1); + lbl = new QLabel(tr("Mesh num"),this); g->addWidget(lbl,0,2); + mn = new QLineEdit(this); g->addWidget(mn,1,2); + lbl = new QLabel(tr("Font size"),this); g->addWidget(lbl,0,3); + fs = new QLineEdit(this); g->addWidget(fs,1,3); + lbl = new QLabel(tr("Cutting"),this); g->addWidget(lbl,0,4); + cut = new QComboBox(this); g->addWidget(cut,1,4); + cut->insertItem(0,tr("on")); cut->insertItem(1,tr("off")); + a = new QHBoxLayout(); o->addLayout(a); + lbl = new QLabel(tr("Legend"),this); a->addWidget(lbl); + leg = new QLineEdit(this); a->addWidget(leg); + a = new QHBoxLayout(); o->addLayout(a); + a->addStretch(1); + b = new QPushButton(tr("Cancel"), this); a->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(reject())); + b = new QPushButton(tr("OK"), this); a->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(prepareResult())); + b->setDefault(true); +} +//----------------------------------------------------------------------------- +OptionDialog::~OptionDialog() {} +//----------------------------------------------------------------------------- +void OptionDialog::prepareResult() +{ + result = ""; + if(!x1->text().isEmpty() && !x2->text().isEmpty()) + result = result + "; xrange "+x1->text()+" "+x2->text(); + if((x1->text().isEmpty()) ^ (x2->text().isEmpty())) + { + QMessageBox::warning(this,tr("UDAV - command options"), tr("Both fields in xrange must be filled")); + return; + } + if(!y1->text().isEmpty() && !y2->text().isEmpty()) + result = result + "; yrange "+y1->text()+" "+y2->text(); + if((y1->text().isEmpty()) ^ (y2->text().isEmpty())) + { + QMessageBox::warning(this,tr("UDAV - command options"), tr("Both fields in yrange must be filled")); + return; + } + if(!z1->text().isEmpty() && !z2->text().isEmpty()) + result = result + "; zrange "+z1->text()+" "+z2->text(); + if((z1->text().isEmpty()) ^ (z2->text().isEmpty())) + { + QMessageBox::warning(this,tr("UDAV - command options"), tr("Both fields in zrange must be filled")); + return; + } + if(!c1->text().isEmpty() && !c2->text().isEmpty()) + result = result + "; crange "+c1->text()+" "+c2->text(); + if((c1->text().isEmpty()) ^ (c2->text().isEmpty())) + { + QMessageBox::warning(this,tr("UDAV - command options"), tr("Both fields in crange must be filled")); + return; + } + if(!alpha->text().isEmpty()) result = result+"; alpha "+alpha->text(); + if(!amb->text().isEmpty()) result = result+"; ambient "+amb->text(); + if(!mn->text().isEmpty()) result = result+"; meshnum "+mn->text(); + if(!fs->text().isEmpty()) result = result+"; fontsize "+fs->text(); + if(cut->currentIndex()==0) result = result+"; cut on"; + if(cut->currentIndex()==1) result = result+"; cut off"; + if(!leg->text().isEmpty()) result = result+"; legend '"+leg->text()+"'"; + accept(); +} +//----------------------------------------------------------------------------- diff --git a/udav/opt_dlg.h b/udav/opt_dlg.h new file mode 100644 index 0000000..f992649 --- /dev/null +++ b/udav/opt_dlg.h @@ -0,0 +1,47 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef OPTION_DLG_H +#define OPTION_DLG_H +//----------------------------------------------------------------------------- +#include +class QLineEdit; +class QComboBox; +class QRadioButton; +//----------------------------------------------------------------------------- +/// Dialog for selecting command options +class OptionDialog : public QDialog +{ +Q_OBJECT +public: + OptionDialog(QWidget *parent=0); + ~OptionDialog(); + + QString getOption() { return result; } +private slots: + void prepareResult(); +private: + QString result; + QLineEdit *x1, *x2, *y1, *y2, *z1, *z2, *c1, *c2; + QLineEdit *alpha, *amb, *mn, *fs, *leg; + QComboBox *cut; +}; +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/udav/plot_pnl.cpp b/udav/plot_pnl.cpp new file mode 100644 index 0000000..88314e8 --- /dev/null +++ b/udav/plot_pnl.cpp @@ -0,0 +1,471 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "qmglcanvas.h" +#include "plot_pnl.h" +#include "anim_dlg.h" +extern bool mglAutoSave; +extern mglParser parser; +int animDelay=500; +void raisePanel(QWidget *w); +//----------------------------------------------------------------------------- +PlotPanel::PlotPanel(QWidget *parent) : QWidget(parent) +{ + gifOn = jpgOn = false; + animDialog = new AnimParam(this); animPos = -1; + printer = new QPrinter; curPos = -1; + timer = new QTimer(this); + connect(timer, SIGNAL(timeout()), this, SLOT(next())); + connect(animDialog, SIGNAL(putText(const QString &)), this, SLOT(animText(const QString &))); + + menu = new QMenu(tr("&Graphics"),this); + popup = new QMenu(this); + mgl = new QMGLCanvas(this); + + QBoxLayout *v,*h,*m; + v = new QVBoxLayout(this); + h = new QHBoxLayout(); v->addLayout(h); toolTop(h); + h = new QHBoxLayout(); v->addLayout(h); + m = new QVBoxLayout(); h->addLayout(m); toolLeft(m); + mgl->setPopup(popup); + + sv = new QScrollArea(this); h->addWidget(sv); sv->setWidget(mgl); + emit giveFocus(); +} +//----------------------------------------------------------------------------- +PlotPanel::~PlotPanel() { delete printer; } +//----------------------------------------------------------------------------- +void PlotPanel::animText(const QString &txt) { animPutText(txt); } +//----------------------------------------------------------------------------- +void PlotPanel::printPlot() +{ + printer->setOrientation(mgl->getRatio()>1 ? QPrinter::Landscape : QPrinter::Portrait); + QPrintDialog printDlg(printer, this); + if (printDlg.exec() == QDialog::Accepted) + { + setStatus(tr("Printing...")); + QRectF r = printer->pageRect(QPrinter::Inch); + int d1 = int(mgl->width()/r.width()), d2 = int(mgl->height()/r.height()), dpi = printer->resolution(); + if(dpisetResolution(dpi); + QPainter p; + if(!p.begin(printer)) return; // paint on printer + p.drawPixmap(0,0,mgl->getPic()); + setStatus(tr("Printing completed")); + } + else setStatus(tr("Printing aborted")); + emit giveFocus(); +} +//----------------------------------------------------------------------------- +void PlotPanel::setCurPos(int pos) { curPos = pos; pressF5(); } +//----------------------------------------------------------------------------- +void PlotPanel::pressF5() +{ + if(mglAutoSave) save(); + raisePanel(this); + QTime t; t.start(); + mgl->execute(0,curPos); + setStatus(QString(tr("Drawing time %1 ms")).arg(t.elapsed()*1e-3)); + emit giveFocus(); +} +//----------------------------------------------------------------------------- +void PlotPanel::pressF9() +{ + int l=animParam.length(), i; + wchar_t *str = new wchar_t[l+2]; + animPos = 0; curPos = -1; + QString cur = animParam.section('\n',animPos,animPos); + for(i=0;ireload(); + setStatus(QString(tr("Drawing time %1 ms")).arg(t.elapsed()*1e-3)); + emit giveFocus(); +} +//----------------------------------------------------------------------------- +void PlotPanel::animStart(bool st) +{ + if(!st) { timer->stop(); if(gifOn) mgl->closeGIF(); return; } + if(animParam.isEmpty()) + { + if(animDialog->exec()) + { + animParam = animDialog->getResult(); + gifOn = animDialog->gifOn; + jpgOn = animDialog->jpgOn; + } + else return; + } + timer->start(animDelay); + if(gifOn) mgl->startGIF(animDelay); + raisePanel(this); +} +//----------------------------------------------------------------------------- +void PlotPanel::nextSlide() +{ + animSwitch(false); + next(); + emit giveFocus(); +} +//----------------------------------------------------------------------------- +void PlotPanel::next() +{ + if(animParam.isEmpty()) + { + if(animDialog->exec()) + { + animParam = animDialog->getResult(); + gifOn = animDialog->gifOn; + jpgOn = animDialog->jpgOn; + } + else return; + } + int l=animParam.length(), n=animParam.count('\n') + (animParam[l-1]=='\n' ? 0:1), i; + wchar_t *str = new wchar_t[l+2]; + animPos = (animPos+1)%n; + QString cur = animParam.section('\n',animPos,animPos); + for(i=0;igraph->GetNumFrame() >= n) + mgl->execute(0, curPos); + else + { + mgl->graph->NewFrame(); + mgl->execute(0, curPos); + mgl->graph->EndFrame(); + if(jpgOn) mgl->graph->WriteFrame(); + QString s; s.sprintf("%d - %d of %d",mgl->graph->GetNumFrame(),animPos,n); + setStatus(QString(tr("Frame %1 of %2")).arg(animPos).arg(n)); + } +} +//----------------------------------------------------------------------------- +void PlotPanel::prevSlide() +{ + if(animParam.isEmpty()) + { + if(animDialog->exec()) + { + animParam = animDialog->getResult(); + gifOn = animDialog->gifOn; + jpgOn = animDialog->jpgOn; + } + else return; + } + animSwitch(false); + int l=animParam.length(), n=animParam.count('\n') + (animParam[l-1]=='\n' ? 0:1), i; + wchar_t *str = new wchar_t[l+2]; + animPos = (animPos-1+n)%n; + QString cur = animParam.section('\n',animPos,animPos); + for(i=0;iexecute(0, curPos); + emit giveFocus(); +} +//----------------------------------------------------------------------------- +void PlotPanel::animSetup() +{ + if(animDialog->exec()) + { + animParam = animDialog->getResult(); + gifOn = animDialog->gifOn; + jpgOn = animDialog->jpgOn; + animPos = -1; + } +} +//----------------------------------------------------------------------------- +void PlotPanel::adjust() +{ + mgl->setSize(sv->width()-5, sv->height()-5); + raisePanel(this); emit giveFocus(); +} +//----------------------------------------------------------------------------- +void PlotPanel::setMGLFont(const QString &path) { mgl->setMGLFont(path); } +//----------------------------------------------------------------------------- +void PlotPanel::animParseText(const QString &txt) +{ + int i, n = txt.count('\n')+1; + double a1=0,a2=0,da=0; + QString s, all; + for(i=0;isetResult(a1,a2,da); + } + } + if(!all.isEmpty()) + { + animDialog->setResult(all); + animParam = all; + } + else if(a1!=a2 && da!=0) + { + for(double a=a1;a<=a2;a+=da) all = all + QString::number(a)+"\n"; + animParam = all; + } +} +//----------------------------------------------------------------------------- +#include "xpm/wire.xpm" +//----------------------------------------------------------------------------- +void PlotPanel::toolTop(QBoxLayout *l) +{ + QAction *a; + QMenu *o=menu, *oo; + QToolButton *bb; + + // graphics menu + a = new QAction(QPixmap(":/xpm/alpha.png"), tr("&Alpha"), this); + a->setShortcut(Qt::CTRL+Qt::Key_T); a->setCheckable(true); + connect(a, SIGNAL(toggled(bool)), mgl, SLOT(setAlpha(bool))); + connect(mgl, SIGNAL(alphaChanged(bool)), a, SLOT(setOn(bool))); + a->setToolTip(tr("Switch on/off transparency for the graphics (Ctrl+T).")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/weather-clear.png"), tr("&Light"), this); + a->setShortcut(Qt::CTRL+Qt::Key_L); a->setCheckable(true); + connect(a, SIGNAL(toggled(bool)), mgl, SLOT(setLight(bool))); + connect(mgl, SIGNAL(lightChanged(bool)), a, SLOT(setOn(bool))); + a->setToolTip(tr("Switch on/off lightning for the graphics (Ctrl+L).")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(wire_xpm), tr("&Grid"), this); + a->setShortcut(Qt::CTRL+Qt::Key_G); a->setCheckable(true); + connect(a, SIGNAL(toggled(bool)), mgl, SLOT(setGrid(bool))); + a->setToolTip(tr("Switch on/off grid drawing for absolute coordinates (Ctrl+G).")); + o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/object-rotate-right.png"), tr("&Rotate by mouse"), this); + a->setCheckable(true); + connect(a, SIGNAL(toggled(bool)), mgl, SLOT(setRotate(bool))); + connect(mgl, SIGNAL(rotateChanged(bool)), a, SLOT(setOn(bool))); + a->setToolTip(tr("Switch on/off mouse handling of the graphics\n(rotation, shifting, zooming and perspective).")); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + +/* a = new QAction(QPixmap(":/xpm/zoom-fit-best.png"), tr("&Zoom by mouse"), this); + a->setCheckable(true); + connect(a, SIGNAL(toggled(bool)), mgl, SLOT(setZoom(bool))); + connect(mgl, SIGNAL(zoomChanged(bool)), a, SLOT(setOn(bool))); + a->setToolTip(tr("Switch on/off mouse zoom of selected region.")); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a);*/ + + o->addSeparator(); + a = new QAction(QPixmap(":/xpm/zoom-original.png"), tr("Res&tore"), this); + connect(a, SIGNAL(activated()), mgl, SLOT(restore())); + a->setToolTip(tr("Restore default graphics rotation, zoom and perspective (Ctrl+Space).")); + a->setShortcut(Qt::CTRL+Qt::Key_Space); + o->addAction(a); popup->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/view-refresh.png"), tr("Re&draw"), this); + connect(a, SIGNAL(activated()), this, SLOT(pressF5())); + a->setToolTip(tr("Execute script and redraw graphics (F5).")); + a->setShortcut(Qt::Key_F5); + o->addAction(a); popup->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(tr("&Adjust size"), this); + connect(a, SIGNAL(activated()), this, SLOT(adjust())); + a->setToolTip(tr("Change canvas size to fill whole region (F6).")); + a->setShortcut(Qt::Key_F6); o->addAction(a); + + a = new QAction(tr("Re&load"), this); + connect(a, SIGNAL(activated()), this, SLOT(pressF9())); + a->setToolTip(tr("Restore status for 'once' command and reload data (F9).")); + a->setShortcut(Qt::Key_F9); o->addAction(a); popup->addAction(a); + + a = new QAction(QPixmap(":/xpm/process-stop.png"), tr("&Stop"), this); + connect(a, SIGNAL(activated()), mgl, SLOT(stop())); + a->setToolTip(tr("Stop script execution (F7).")); + a->setShortcut(Qt::Key_F7); o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/edit-copy.png"), tr("&Copy plot"), this); + connect(a, SIGNAL(activated()), mgl, SLOT(copy())); + a->setToolTip(tr("Copy graphics to clipboard (Ctrl+Shift+C).")); + a->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_C); + o->addAction(a); popup->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/edit-copy.png"), tr("&Copy click coor."), this); + connect(a, SIGNAL(activated()), mgl, SLOT(copyClickCoor())); + a->setToolTip(tr("Copy coordinates of last mouse click to clipboard.")); + o->addAction(a); popup->addAction(a); + + l->addStretch(1); + + tet = new QSpinBox(this); tet->setWrapping(true); + l->addWidget(tet); tet->setRange(-180, 180); tet->setSingleStep(10); + connect(tet, SIGNAL(valueChanged(int)), mgl, SLOT(setTet(int))); + connect(mgl, SIGNAL(tetChanged(int)), tet, SLOT(setValue(int))); + tet->setToolTip(tr("Set value of \\theta angle.\nYou can use keys (Shift+Meta+Up or Shift+Meta+Down).")); + a = new QAction(this); a->setShortcut(Qt::SHIFT+Qt::META+Qt::Key_Up); + connect(a, SIGNAL(activated()), tet, SLOT(stepUp())); + a = new QAction(this); a->setShortcut(Qt::SHIFT+Qt::META+Qt::Key_Down); + connect(a, SIGNAL(activated()), tet, SLOT(stepDown())); + + phi = new QSpinBox(this); phi->setWrapping(true); + l->addWidget(phi); phi->setRange(-180, 180); phi->setSingleStep(10); + connect(phi, SIGNAL(valueChanged(int)), mgl, SLOT(setPhi(int))); + connect(mgl, SIGNAL(phiChanged(int)), phi, SLOT(setValue(int))); + phi->setToolTip(tr("Set value of \\phi angle.\nYou can use keys (Shift+Meta+Left or Shift+Meta+Right).")); + a = new QAction(this); a->setShortcut(Qt::SHIFT+Qt::META+Qt::Key_Right); + connect(a, SIGNAL(activated()), phi, SLOT(stepUp())); + a = new QAction(this); a->setShortcut(Qt::SHIFT+Qt::META+Qt::Key_Left); + connect(a, SIGNAL(activated()), phi, SLOT(stepDown())); + + oo = new QMenu(tr("&Export as ..."),this); + oo->addAction(tr("PNG"), mgl, SLOT(exportPNG()),Qt::META+Qt::Key_P); + oo->addAction(tr("solid PNG"), mgl, SLOT(exportPNGs()),Qt::META+Qt::Key_F); + oo->addAction(tr("JPEG"), mgl, SLOT(exportJPG()),Qt::META+Qt::Key_J); + oo->addAction(tr("GIF"), mgl, SLOT(exportGIF()),Qt::META+Qt::Key_G); + oo->addAction(tr("bitmap EPS"), mgl, SLOT(exportBPS())); + oo->addAction(tr("vector EPS"), mgl, SLOT(exportEPS()),Qt::META+Qt::Key_E); + oo->addAction(tr("SVG"), mgl, SLOT(exportSVG()),Qt::META+Qt::Key_S); + oo->addAction(tr("C++"), mgl, SLOT(exportCPP())); + oo->addAction(tr("IDTF"), mgl, SLOT(exportIDTF())); + o->addMenu(oo); + popup->addMenu(oo); +} +//----------------------------------------------------------------------------- +void PlotPanel::toolLeft(QBoxLayout *l) +{ + QAction *a; + QMenu *o=menu, *oo; + QToolButton *bb; + + // zooming menu +/* oo = o->addMenu(tr("Zoom/move")); + a = new QAction(QPixmap(":/xpm/go-previous.png"), tr("Move &left"), this); + connect(a, SIGNAL(activated()), mgl, SLOT(shiftLeft())); + a->setShortcut(Qt::CTRL+Qt::META+Qt::Key_Left); + a->setToolTip(tr("Move graphics left by 1/3 of its width.")); + oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/go-up.png"), tr("Move &up"), this); + connect(a, SIGNAL(activated()), mgl, SLOT(shiftUp())); + a->setShortcut(Qt::CTRL+Qt::META+Qt::Key_Up); + a->setToolTip(tr("Move graphics up by 1/3 of its height.")); + oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/zoom-in.png"), tr("Zoom &in"), this); + connect(a, SIGNAL(activated()), mgl, SLOT(zoomIn())); + a->setShortcut(Qt::CTRL+Qt::META+Qt::Key_Equal); + a->setToolTip(tr("Zoom in graphics.")); + oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/zoom-out.png"), tr("Zoom &out"), this); + connect(a, SIGNAL(activated()), mgl, SLOT(zoomOut())); + a->setShortcut(Qt::CTRL+Qt::META+Qt::Key_Minus); + a->setToolTip(tr("Zoom out graphics.")); + oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/go-down.png"), tr("Move &down"), this); + connect(a, SIGNAL(activated()), mgl, SLOT(shiftDown())); + a->setShortcut(Qt::CTRL+Qt::META+Qt::Key_Down); + a->setToolTip(tr("Move graphics up down 1/3 of its height.")); + oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/go-next.png"), tr("Move &right"), this); + connect(a, SIGNAL(activated()), mgl, SLOT(shiftRight())); + a->setShortcut(Qt::CTRL+Qt::META+Qt::Key_Right); + a->setToolTip(tr("Move graphics right by 1/3 of its width.")); + oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a);*/ + + // rotate menu + oo = o->addMenu(tr("Rotate")); + a = new QAction(tr("Rotate up"), this); a->setShortcut(Qt::SHIFT+Qt::META+Qt::Key_Up); + connect(a, SIGNAL(activated()), tet, SLOT(stepUp())); oo->addAction(a); + a->setToolTip(tr("Increase \\theta angle by 10 degrees.")); + a = new QAction(tr("Rotate down"), this); a->setShortcut(Qt::SHIFT+Qt::META+Qt::Key_Down); + connect(a, SIGNAL(activated()), tet, SLOT(stepDown())); oo->addAction(a); + a->setToolTip(tr("Decrease \\theta angle by 10 degrees.")); + a = new QAction(tr("Rotate left"), this); a->setShortcut(Qt::SHIFT+Qt::META+Qt::Key_Right); + connect(a, SIGNAL(activated()), phi, SLOT(stepUp())); oo->addAction(a); + a->setToolTip(tr("Increase \\phi angle by 10 degrees.")); + a = new QAction(tr("Rotate right"), this); a->setShortcut(Qt::SHIFT+Qt::META+Qt::Key_Left); + connect(a, SIGNAL(activated()), phi, SLOT(stepDown())); oo->addAction(a); + a->setToolTip(tr("Decrease \\phi angle by 10 degrees.")); + + // animation menu + oo = o->addMenu(tr("&Animation")); + a = new QAction(QPixmap(":/xpm/media-seek-forward.png"), tr("&Next slide"), this); + connect(a, SIGNAL(activated()), this, SLOT(nextSlide())); + a->setToolTip(tr("Show next slide (Meta+Right).")); + a->setShortcut(Qt::META+Qt::Key_Right); oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/media-seek-backward.png"), tr("&Prev slide"), this); + connect(a, SIGNAL(activated()), this, SLOT(prevSlide())); + a->setToolTip(tr("Show previous slide (Meta+Left).")); + a->setShortcut(Qt::META+Qt::Key_Left); oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/film-b.png"), tr("&Slideshow"), this); + a->setCheckable(true); + connect(a, SIGNAL(toggled(bool)), this, SLOT(animStart(bool))); + connect(this, SIGNAL(animSwitch(bool)),a,SLOT(setChecked(bool))); + a->setToolTip(tr("Run slideshow (Ctrl+F5). If no parameter specified\nthen the dialog with slideshow options will appear.")); + a->setShortcut(Qt::CTRL+Qt::Key_F5); oo->addAction(a); + oo->addAction(tr("Se&tup show"), this, SLOT(animSetup()), Qt::CTRL+Qt::Key_W); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + l->addStretch(1); +} +//----------------------------------------------------------------------------- +void PlotPanel::execute() { mgl->execute(); } +//----------------------------------------------------------------------------- +QString PlotPanel::getFit() { return QString(mgl->graph->GetFit()); } +//----------------------------------------------------------------------------- diff --git a/udav/plot_pnl.h b/udav/plot_pnl.h new file mode 100644 index 0000000..8f4ed5b --- /dev/null +++ b/udav/plot_pnl.h @@ -0,0 +1,89 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef PLOT_PNL_H +#define PLOT_PNL_H +//----------------------------------------------------------------------------- +#include +//----------------------------------------------------------------------------- +class QMenu; +class QTimer; +class QSpinBox; +class QPopupMenu; +class QScrollArea; +class QBoxLayout; +class QMGLCanvas; +class InfoDialog; +class AnimParam; +class DatPanel; +class mglVar; +//----------------------------------------------------------------------------- +class PlotPanel : public QWidget +{ +Q_OBJECT +public: + QMenu *menu; + QMGLCanvas *mgl; + PlotPanel(QWidget *wp=0); + ~PlotPanel(); + void setMGLFont(const QString &path); + QString getFit(); + +public slots: + void animParseText(const QString &txt); + void setCurPos(int pos=-1); + void execute(); + +signals: + void save(); + void animPutText(const QString &); + void setStatus(const QString &); + void animSwitch(bool); + void giveFocus(); + +private slots: + void animText(const QString &); + void printPlot(); + void next(); + void nextSlide(); + void prevSlide(); + void animStart(bool st); + void animSetup(); + void adjust(); + void pressF5(); + void pressF9(); + +private: + bool gifOn, jpgOn; + QScrollArea* sv; + QSpinBox *tet, *phi; + // animation + QString animParam; + int animPos; + int curPos; + QTimer *timer; + AnimParam *animDialog; + QMenu *popup; + QPrinter *printer; + + void toolTop(QBoxLayout *l); + void toolLeft(QBoxLayout *l); +}; +//----------------------------------------------------------------------------- +#endif // PLOT_PNL_H diff --git a/udav/prop_dlg.cpp b/udav/prop_dlg.cpp new file mode 100644 index 0000000..77d6dfc --- /dev/null +++ b/udav/prop_dlg.cpp @@ -0,0 +1,289 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//----------------------------------------------------------------------------- +#include "prop_dlg.h" +#include "udav_wnd.h" +#include "help_pnl.h" +#include "plot_pnl.h" +#include "text_pnl.h" +#include "newcmd_dlg.h" +//----------------------------------------------------------------------------- +extern QColor mglColorScheme[9]; +extern QString defFontFamily; +extern int defFontSize; +extern QString pathHelp; +extern bool mglAutoExecute; +extern bool mglAutoSave; +extern bool mglAutoPure; +extern bool mglCompleter; +extern bool editPosBottom; +extern bool loadInNewWnd; +int defWidth, defHeight; +QString pathFont; +QString lang[]={"","ru"}; +//----------------------------------------------------------------------------- +PropDialog::PropDialog(QWidget *parent) : QDialog(parent) +{ + setWindowTitle(tr("UDAV - Properties")); + QHBoxLayout *h; + QVBoxLayout *v; + QLabel *l; + QPushButton *b; + + v = new QVBoxLayout(this); + h = new QHBoxLayout(); v->addLayout(h); + lbl = new QLabel(tr("Current font"), this); h->addWidget(lbl); + lbl->setFont(QFont(defFontFamily, defFontSize)); + h->addStretch(1); defFont = QFont(defFontFamily, defFontSize); + b = new QPushButton(tr("Change font"), this); h->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(setF())); + + cc[0]=mglColorScheme[0]; cc[1]=mglColorScheme[1]; + cc[2]=mglColorScheme[2]; cc[3]=mglColorScheme[3]; + cc[4]=mglColorScheme[4]; cc[5]=mglColorScheme[5]; + cc[6]=mglColorScheme[6]; cc[7]=mglColorScheme[7]; + cc[8]=mglColorScheme[8];// cc[5]=mglColorScheme[5]; + QPixmap pic(16,16); + l = new QLabel(tr("Setup colors for:"), this); v->addWidget(l, Qt::AlignHCenter); + QGridLayout *g = new QGridLayout(); v->addLayout(g); + pic.fill(cc[0]); cb[0] = new QPushButton(pic, tr("Comments"), this); + connect(cb[0], SIGNAL(clicked()),this, SLOT(setC0())); + g->addWidget(cb[0], 0, 0); + pic.fill(cc[1]); cb[1] = new QPushButton(pic, tr("Strings"), this); + connect(cb[1], SIGNAL(clicked()),this, SLOT(setC1())); + g->addWidget(cb[1], 0, 1); + pic.fill(cc[2]); cb[2] = new QPushButton(pic, tr("Keywords"), this); + connect(cb[2], SIGNAL(clicked()),this, SLOT(setC2())); + g->addWidget(cb[2], 0, 2); + pic.fill(cc[3]); cb[3] = new QPushButton(pic, tr("Options"), this); + connect(cb[3], SIGNAL(clicked()),this, SLOT(setC3())); + g->addWidget(cb[3], 1, 0); + pic.fill(cc[4]); cb[4] = new QPushButton(pic, tr("Suffixes"), this); + connect(cb[4], SIGNAL(clicked()),this, SLOT(setC4())); + g->addWidget(cb[4], 1, 1); + pic.fill(cc[5]); cb[5] = new QPushButton(pic, tr("Numbers"), this); + connect(cb[5], SIGNAL(clicked()),this, SLOT(setC5())); + g->addWidget(cb[5], 1, 2); + pic.fill(cc[6]); cb[6] = new QPushButton(pic, tr("AutoKey"), this); + connect(cb[6], SIGNAL(clicked()),this, SLOT(setC6())); + g->addWidget(cb[6], 2, 0); + pic.fill(cc[7]); cb[7] = new QPushButton(pic, tr("FlowKey"), this); + connect(cb[7], SIGNAL(clicked()),this, SLOT(setC7())); + g->addWidget(cb[7], 2, 1); + + l = new QLabel(tr("Path for help files"), this); v->addWidget(l); + h = new QHBoxLayout(); v->addLayout(h); + hlp = new QLineEdit(pathHelp, this); h->addWidget(hlp,1); + b = new QPushButton("...", this); h->addWidget(b,0); + connect(b,SIGNAL(clicked()),this,SLOT(getPathH())); + + QStringList paths, files, filter; + paths << "." << QDir::homePath() << QDir::rootPath() + << QCoreApplication::applicationDirPath()+"/fonts"; + filter << "*.vfm"; +#ifndef WIN32 + paths << "/usr/local/share/mathgl/fonts/" << "/usr/local/mathgl/fonts/"; +#endif + QFileInfoList info; + for(int i=0;iaddWidget(l); + h = new QHBoxLayout(); v->addLayout(h); + fnt = new QComboBox(this); h->addWidget(fnt,1); + fnt->addItems(files); fnt->setEditable(true); + fnt->lineEdit()->setText(pathFont); + b = new QPushButton("...", this); h->addWidget(b,0); + connect(b,SIGNAL(clicked()),this,SLOT(getPathF())); + + h = new QHBoxLayout(); v->addLayout(h); + l = new QLabel(tr("Language for UDAV"), this); h->addWidget(l,0); + lng = new QComboBox(this); h->addWidget(lng,1); + lng->addItem(tr("English")); lng->addItem(tr("Russian")); + + QSettings settings("udav","UDAV"); + settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV"); + settings.beginGroup("/UDAV"); + QString prev = settings.value("/udavLang", "").toString(); + if(prev==lang[1]) lng->setCurrentIndex(1); + defWidth = settings.value("/defWidth", 640).toInt(); + defHeight = settings.value("/defHeight", 480).toInt(); + settings.endGroup(); + + h = new QHBoxLayout(); v->addLayout(h); + l = new QLabel(tr("Image size"), this); h->addWidget(l,0); + defW = new QLineEdit(QString::number(defWidth),this); h->addWidget(defW,1); + l = new QLabel("x", this); h->addWidget(l,0); + defH = new QLineEdit(QString::number(defHeight),this); h->addWidget(defH,1); + + run = new QCheckBox(tr("Automatically execute script after loading"), this); + run->setChecked(mglAutoExecute); v->addWidget(run); + edt = new QCheckBox(tr("Place editor at top"), this); + edt->setChecked(editPosBottom); v->addWidget(edt); + load = new QCheckBox(tr("Load script to new window"), this); + load->setChecked(loadInNewWnd); v->addWidget(load); + save = new QCheckBox(tr("Automatically save before redrawing (F5)"), this); + save->setChecked(mglAutoSave); v->addWidget(save); + pure = new QCheckBox(tr("Disable face drawing (faster) for mouse rotation/shift/zoom."), this); + pure->setChecked(mglAutoPure); v->addWidget(pure); + cmpl = new QCheckBox(tr("Enable keywords completition"), this); + cmpl->setChecked(mglCompleter); v->addWidget(cmpl); + + h = new QHBoxLayout(); v->addLayout(h); + h->addStretch(1); + b = new QPushButton(tr("Cancel"), this); h->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(reject())); + b = new QPushButton(tr("OK"), this); h->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(applyChanges())); + b->setDefault(true); +} +//----------------------------------------------------------------------------- +PropDialog::~PropDialog() {} +//----------------------------------------------------------------------------- +void PropDialog::setC0() { setC(0); } +//----------------------------------------------------------------------------- +void PropDialog::setC1() { setC(1); } +//----------------------------------------------------------------------------- +void PropDialog::setC2() { setC(2); } +//----------------------------------------------------------------------------- +void PropDialog::setC3() { setC(3); } +//----------------------------------------------------------------------------- +void PropDialog::setC4() { setC(4); } +//----------------------------------------------------------------------------- +void PropDialog::setC5() { setC(5); } +//----------------------------------------------------------------------------- +void PropDialog::setC6() { setC(6); } +//----------------------------------------------------------------------------- +void PropDialog::setC7() { setC(7); } +//----------------------------------------------------------------------------- +void PropDialog::setC8() { setC(8); } +//----------------------------------------------------------------------------- +void PropDialog::getPathH() +{ + QString str = QFileDialog::getExistingDirectory(this, + tr("UDAV - Insert filename"), hlp->text()); + if(!str.isEmpty()) hlp->setText(str+'/'); +} +//----------------------------------------------------------------------------- +void PropDialog::getPathF() +{ + QString str = QFileDialog::getOpenFileName(this, tr("UDAV - Insert filename"), + fnt->lineEdit()->text(), tr("Font files (*.vfm)")); +// if(str.contains(".vfm")) str = str.left(str.length()-4); + if(!str.isEmpty()) fnt->lineEdit()->setText(str); +} +//----------------------------------------------------------------------------- +void PropDialog::setC(int k) +{ + if(k<0 || k>8) return; + QColor c = QColorDialog::getColor(cc[k], this); + if(c.isValid()) + { + QPixmap p(16,16); p.fill(c); + cb[k]->setIcon(p); cc[k] = c; + } +} +//----------------------------------------------------------------------------- +void PropDialog::setF() +{ + bool ok; + QFont f = QFontDialog::getFont(&ok, defFont, this); + if(ok) { defFont = f; lbl->setFont(f); } +} +//----------------------------------------------------------------------------- +void PropDialog::applyChanges() +{ + // defFont editPosBottom pathFont + mglColorScheme[0]=cc[0]; mglColorScheme[1]=cc[1]; + mglColorScheme[2]=cc[2]; mglColorScheme[3]=cc[3]; + mglColorScheme[4]=cc[4]; mglColorScheme[5]=cc[5]; + mglAutoExecute = run->isChecked(); + editPosBottom = edt->isChecked(); + pathHelp = hlp->text(); pathFont = fnt->lineEdit()->text(); + if(pathHelp.isEmpty()) pathHelp=MGL_DOC_DIR; + defFontFamily = defFont.family(); + defFontSize = defFont.pointSize(); + loadInNewWnd = load->isChecked(); + mglAutoSave = save->isChecked(); + mglAutoPure = pure->isChecked(); + mglCompleter = cmpl->isChecked(); + + // apply changes for all windows +#ifdef WIN32 + pathFont = pathFont.replace('/','\\'); +#endif + bool ok=true; + foreach(QWidget *w, QApplication::topLevelWidgets()) + { + if(w->inherits("MainWindow")) + { + MainWindow *s = (MainWindow *)w; + if(ok) { s->writeSettings(); ok = false; } + s->edit->setEditorFont(); + s->hlp->setPath(pathHelp); s->edit->newCmdDlg->setPath(pathHelp); + if(s->hlp->isActiveWindow()) s->hlp->showHelp(); + s->graph->setMGLFont(pathFont); + s->setEditPos(editPosBottom); + s->edit->setCompleter(mglCompleter); + s->update(); + } + } + + if(defWidth!=defW->text().toInt() || defHeight!=defH->text().toInt()) + { + defWidth = defW->text().toInt(); + defHeight = defH->text().toInt(); + sizeChanged(defWidth, defHeight); + } + + QSettings settings("udav","UDAV"); + settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV"); + settings.beginGroup("/UDAV"); + QString prev = settings.value("/udavLang", "").toString(); + int cur=lng->currentIndex(); + if(cur>=0 && prev!=lang[cur]) + { + settings.setValue("/udavLang", lang[lng->currentIndex()]); + QMessageBox::critical(this,tr("UDAV - Properties"),tr("You have to restart UDAV for applying the cahnges.")); + } + settings.setValue("/defWidth", defWidth); + settings.setValue("/defHeight", defHeight); + settings.endGroup(); + + accept(); +} +//----------------------------------------------------------------------------- diff --git a/udav/prop_dlg.h b/udav/prop_dlg.h new file mode 100644 index 0000000..b6f7222 --- /dev/null +++ b/udav/prop_dlg.h @@ -0,0 +1,65 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef PROPDIALOG_H +#define PROPDIALOG_H +//----------------------------------------------------------------------------- +#include +class QLabel; +class QPushButton; +class QCheckBox; +class QLineEdit; +class QComboBox; +//----------------------------------------------------------------------------- +/// Set UDAV general properties +class PropDialog : public QDialog +{ +Q_OBJECT +public: + PropDialog(QWidget *parent = 0); + ~PropDialog(); +signals: + void sizeChanged(int w, int h); +private slots: + void applyChanges(); + void setC0(); + void setC1(); + void setC2(); + void setC3(); + void setC4(); + void setC5(); + void setC6(); + void setC7(); + void setC8(); + void setF(); + void getPathH(); + void getPathF(); +private: + void setC(int k); + QLabel *lbl; + QPushButton *cb[9]; + QCheckBox *run, *edt, *load, *save, *pure, *cmpl; + QLineEdit *hlp, *defW, *defH; + QFont defFont; + QColor cc[9]; + QComboBox *lng, *fnt; +}; +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/udav/qmglcanvas.cpp b/udav/qmglcanvas.cpp new file mode 100644 index 0000000..64868d8 --- /dev/null +++ b/udav/qmglcanvas.cpp @@ -0,0 +1,458 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include //TODO: Add later +#include "qmglcanvas.h" +extern mglParser parser; +extern bool mglAutoPure; +//----------------------------------------------------------------------------- +QMGLCanvas::QMGLCanvas(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f) +{ + autoResize = false; + textMGL = warnMGL = 0; appName = tr("UDAV"); + popup = 0; grBuf = 0; phi = tet = per = 0; + alpha = light = rotate = grid = false; + graph = new mglGraph; + resize(graph->GetWidth(), graph->GetHeight()); + convertFromGraph(pic, graph, &grBuf); + thr = new MGLThread(); thr->cnv = this; +} +//----------------------------------------------------------------------------- +QMGLCanvas::~QMGLCanvas() +{ delete thr; delete graph; if(grBuf) delete []grBuf; } +//----------------------------------------------------------------------------- +void QMGLCanvas::paintEvent(QPaintEvent *) +{ + QPainter paint; + paint.begin(this); + paint.drawPixmap(0,0,pic); + if(grid) + { + int i, h=pic.height(), w=pic.width(); + paint.setPen(QColor(192,192,192)); + for(i=1;i<10;i++) + { + paint.drawText(0,i*h/10,QString::number(1-i*0.1)); + paint.drawLine(0,i*h/10,w,i*h/10); + paint.drawText(i*w/10,h,QString::number(i*0.1)); + paint.drawLine(i*w/10,0,i*w/10,h); + } + } + paint.end(); +} +//----------------------------------------------------------------------------- +void QMGLCanvas::resizeEvent(QResizeEvent *ev) +{ + if(autoResize && ev->size().width()>0 && ev->size().height()>0) + { graph->SetSize(ev->size().width(), ev->size().height()); execute(); repaint(); } + else resize(graph->GetWidth(), graph->GetHeight()); +} +//----------------------------------------------------------------------------- +void QMGLCanvas::setPer(int p) +{ + if(per!=p && p>=0 && p<100) + { per = 100*p; emit perChanged(p); execute(); } +} +//----------------------------------------------------------------------------- +void QMGLCanvas::imgSize(int w, int h) +{ if(w<=0 || h<=0) return; + graph->SetSize(w,h); execute(); } +//----------------------------------------------------------------------------- +void QMGLCanvas::setPhi(int p) +{ if(phi!=p) { phi = p; emit phiChanged(p); execute(); } } +//----------------------------------------------------------------------------- +void QMGLCanvas::setTet(int t) +{ if(tet!=t) { tet = t; emit tetChanged(t); execute(); } } +//----------------------------------------------------------------------------- +void QMGLCanvas::setGrid(bool a) +{ if(grid!=a) { grid = a; emit gridChanged(a); execute(); } } +//----------------------------------------------------------------------------- +void QMGLCanvas::setAlpha(bool a) +{ if(alpha!=a) { alpha = a; emit alphaChanged(a); execute(); } } +//----------------------------------------------------------------------------- +void QMGLCanvas::setLight(bool l) +{ if(light!=l) { light = l; emit lightChanged(l); execute(); } } +//----------------------------------------------------------------------------- +void QMGLCanvas::setRotate(bool r) +{ + if(rotate!=r) + { + rotate=r; + emit rotateChanged(r); + execute(); + } +} +//----------------------------------------------------------------------------- +void QMGLCanvas::restore() +{ + setPhi(0); setTet(0); setPer(0); rotate=false; + emit rotateChanged(false); + execute(); +} +//----------------------------------------------------------------------------- +void QMGLCanvas::execute(mglGraph *gr, int line) +{ + if(!textMGL && autoResize) { run(defText, false, gr); return; } + else if(!textMGL) return; + run(textMGL->toPlainText(), true, gr, line); + if(pic.size()!=size()) setSize(pic.width(), pic.height()); + emit refreshData(); +} +//----------------------------------------------------------------------------- +QString QMGLCanvas::run(const QString &text, bool showm, mglGraph *gr, int line) +{ + defText = text; + if(gr==0) gr=graph; + if(gr==0) return QString(tr("Not initialized!")); + gr->DefaultPlotParam(); + gr->Alpha(alpha); gr->Light(light); + gr->View(tet,phi); gr->SetOrigin(NAN,NAN,NAN); + gr->Perspective(per); +// gr->DrawFace = !(rotate && mglAutoPure); + if(text.count("rotate ")==0 && text.count("rotate\t")==0) gr->Rotate(0,0); + parser.Stop = false; + parser.AllowSetSize = true; + showMessage = showm; + + if(warnMGL && !warnMGL->toPlainText().isEmpty()) warnMGL->clear(); + // At least now I don't want use setup script ! So I skip this code + if(!isHidden()) QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); + if(!thr->isRunning()) + { + thr->gr = gr; thr->text = text; + thr->line = line; thr->start(); + } + if(rotate) thr->wait(); + else while(thr->isRunning()) qApp->processEvents(); + if(warnMGL) warnMGL->setText(thr->warn); + if(!isHidden()) QApplication::restoreOverrideCursor(); + if(gr==graph) + { convertFromGraph(pic, graph, &grBuf); repaint(); } + return thr->mes; +} +//----------------------------------------------------------------------------- +void MGLThread::run() +{ + int i,r,n=text.count('\n')+1; + char *buf=new char[2048]; + gr->Message(buf); warn = ""; + wchar_t *str = new wchar_t[text.length()+2]; + QString cur; + bool high; + // Start parsing the text (just slightly modified copy from mgl_parse.cpp) + parser.ScanFunc(0); for(i=0;itype==0 || rts->type==1)) high = true; + delete []s; + } + + r = cur.toWCharArray(str); str[r] = 0; + buf[0] = 0; gr->SetObjId(i+1); + setlocale(LC_ALL, "C"); + r = parser.Parse(gr,str,i+1); + setlocale(LC_ALL, ""); + if(r<0) { i = -r-2; continue; } + if(r>0) + { + mes = tr("In line ")+QString::number(i); + if(r==1) mes += tr(" -- wrong argument(s):\t"); + if(r==2) mes += tr(" -- wrong command:\t"); + if(r==3) mes += tr(" -- string too long:\t"); + if(r==4) mes += tr(" -- unbalanced ' :\t"); + mes += cur; + warn += mes + "\n"; + } + if(buf && *buf) + { + mes = tr("In line ")+QString::number(i)+" :\t"; + mes = mes + cur + "\n" + QString(buf) + "\n"; + warn += mes + "\n"; + } + } + mes = QString(buf); + gr->Message(0); delete []buf; delete []str; +} +//----------------------------------------------------------------------------- +void QMGLCanvas::mouseDoubleClickEvent(QMouseEvent *ev) +{ + int oi = graph->GetObjId(ev->x(),ev->y())-1; + emit objChanged(oi); +} +//----------------------------------------------------------------------------- +void QMGLCanvas::mousePressEvent(QMouseEvent *ev) +{ + if(!rotate && ev->button()&Qt::LeftButton) + { + mglPoint p = graph->CalcXYZ(ev->x(), ev->y()); + clickPos.sprintf("x=%g, y=%g, z=%g -- Xabs=%.3g, Yabs=%.3g", + p.x,p.y,p.z,double(ev->x())/graph->GetWidth(), + 1-double(ev->y())/graph->GetHeight()); + emit posChanged(clickPos); + } + xe=x0=ev->x(); ye=y0=ev->y(); + ev->accept(); +} +//----------------------------------------------------------------------------- +void QMGLCanvas::mouseReleaseEvent(QMouseEvent *ev) +{ + if(ev->button()&Qt::RightButton && popup && !rotate) // popup menu + popup->popup(QCursor::pos()); + ev->accept(); +} +//----------------------------------------------------------------------------- +void QMGLCanvas::mouseMoveEvent(QMouseEvent *ev) +{ + xe=ev->x(); ye=ev->y(); + if(rotate) + { + if(ev->buttons()&Qt::LeftButton) // rotate + { + float ff = 240/sqrt(float(width()*height())); + phi += int((x0-xe)*ff); + tet += int((y0-ye)*ff); + if(phi>180) phi-=360; if(phi<-180) phi+=360; + if(tet>180) tet-=360; if(tet<-180) tet+=360; + emit tetChanged(int(tet)); emit phiChanged(int(phi)); + execute(); + } +/* if(ev->buttons()&Qt::RightButton) // zoom and perspective + { + float ff = 2.*(y0-ye)/width(), gg = 0.5*(xe-x0)/height(); + float cx = (x1+x2)/2, cy = (y1+y2)/2; + x1 = cx+(x1-cx)*exp(-ff); x2 = cx+(x2-cx)*exp(-ff); + y1 = cy+(y1-cy)*exp(-ff); y2 = cy+(y2-cy)*exp(-ff); + per = per + gg; + if(per<0) per = 0; if(per>=1) per = 0.9999; + if(gg) emit perChanged(int(per)); + execute(); + } + if(ev->buttons()&Qt::MidButton) // shift + { + float ff = 1./sqrt(float(width()*height())); + float dx = (x0-xe)*ff*(x2-x1), dy = (y0-ye)*ff*(y2-y1); + x1 += dx; x2 += dx; y1 -= dy; y2 -= dy; + }*/ + x0 = xe; y0 = ye; +// execute(); + } + ev->accept(); +} +//----------------------------------------------------------------------------- +QString setExtension(QString &fname, const char *ext) +{ + QString oname; + if(fname.right(4)==".mgl") + oname = fname.left(fname.length()-3)+ext; + else + oname = fname+"."+QString(ext); + return oname; +} +//----------------------------------------------------------------------------- +void QMGLCanvas::startGIF(int animDelay, QString fname) +{ if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename. Please save script first."),QMessageBox::Ok,0,0); + else + { + graph->StartGIF(setExtension(fname,"gif").toAscii(), animDelay); + graph->ResetFrames(); + } +} +//----------------------------------------------------------------------------- +void QMGLCanvas::closeGIF() { graph->CloseGIF(); } +//----------------------------------------------------------------------------- +void QMGLCanvas::exportGIF(QString fname) +{ if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename. Please save script first."),QMessageBox::Ok,0,0); + else graph->WriteGIF(setExtension(fname,"gif").toAscii(), appName.toAscii()); +} +//----------------------------------------------------------------------------- +void QMGLCanvas::exportPNG(QString fname) +{ if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename. Please save script first."),QMessageBox::Ok,0,0); + else graph->WritePNG(setExtension(fname,"png").toAscii(), appName.toAscii()); +} +//----------------------------------------------------------------------------- +void QMGLCanvas::exportPNGs(QString fname) +{ if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename. Please save script first."),QMessageBox::Ok,0,0); + else graph->WritePNG(setExtension(fname,"png").toAscii(), appName.toAscii(), false); +} +//----------------------------------------------------------------------------- +void QMGLCanvas::exportJPG(QString fname) +{ if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename. Please save script first."),QMessageBox::Ok,0,0); + else graph->WriteJPEG(setExtension(fname,"jpg").toAscii(), appName.toAscii()); +} +//----------------------------------------------------------------------------- +void QMGLCanvas::exportBPS(QString fname) +{ + if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename. Please save script first."),QMessageBox::Ok,0,0); + else + { + setlocale(LC_ALL, "C"); + graph->WriteBPS(setExtension(fname,"eps.gz").toAscii(), appName.toAscii()); + setlocale(LC_ALL, ""); + } +} +//----------------------------------------------------------------------------- +void QMGLCanvas::exportEPS(QString fname) +{ + if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename. Please save script first."),QMessageBox::Ok,0,0); + else + { + setlocale(LC_ALL, "C"); + graph->WriteEPS(setExtension(fname,"eps.gz").toAscii(), appName.toAscii()); + setlocale(LC_ALL, ""); + } +} +//----------------------------------------------------------------------------- +void QMGLCanvas::exportSVG(QString fname) +{ + if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename. Please save script first."),QMessageBox::Ok,0,0); + else + { + setlocale(LC_ALL, "C"); + graph->WriteSVG(setExtension(fname,"svgz").toAscii(), appName.toAscii()); + setlocale(LC_ALL, ""); + } +} +//----------------------------------------------------------------------------- +void QMGLCanvas::exportIDTF(QString fname) +{ + if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename. Please save script first."),QMessageBox::Ok,0,0); + else + { +/* mglGraphIDTF *ps = new mglGraphIDTF; + ps->SetFont(graph->GetFont()); + execute(ps); + setlocale(LC_ALL, "C"); + ps->WriteIDTF(setExtension(fname,"idtf").toAscii(), appName.toAscii()); + setlocale(LC_ALL, ""); + delete ps;*/ + } +} +//----------------------------------------------------------------------------- +void QMGLCanvas::exportCPP(QString fname) +{ + if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename. Please save script first."),QMessageBox::Ok,0,0); + else + { +/* wchar_t out[1024]; + FILE *fp = fopen(setExtension(fname,"cpp").toAscii(),"wt"); + mglGraphPS *ps = new mglGraphPS(graph->GetWidth(), graph->GetHeight()); + int i, r, n = textMGL->toPlainText().count('\n')+1; + wchar_t *str = new wchar_t[textMGL->toPlainText().length()+2]; + QString cur; + fwprintf(fp,L"int draw_func(mglGraph *gr, void *)\n{\n"); + fwprintf(fp,L"\tstatic bool once = false;\n"); + for(i=0;itoPlainText().section('\n',i,i); + r = cur.toWCharArray(str); str[r] = 0; + out[0] = 0; r = 0; + setlocale(LC_ALL, "C"); + parser.Export(out,ps,str); + setlocale(LC_ALL, ""); + fwprintf(fp,L"\t//%ls\n",str); + if(*out) + { + if(*(parser.op1)) fwprintf(fp,L"%ls\n",parser.op1); + fwprintf(fp,L"\t%ls\n",out); + if(*(parser.op2)) fwprintf(fp,L"%ls\n",parser.op2); + } + } + fwprintf(fp,L"\treturn 0;\n}\n"); + fclose(fp); + delete []str; + delete ps;*/ + } +} +//----------------------------------------------------------------------------- +void QMGLCanvas::reload() { parser.RestoreOnce(); execute(); } +//----------------------------------------------------------------------------- +//void QMGLCanvas::stop() { parser.Stop = true; } +void QMGLCanvas::stop() { thr->terminate(); } +//----------------------------------------------------------------------------- +void convertFromGraph(QPixmap &pic, mglGraph *gr, uchar **buf) +{ + register long w=gr->GetWidth(), h=gr->GetHeight(); + if(*buf) delete [](*buf); + *buf = new uchar[4*w*h]; + gr->GetBGRN(*buf,4*w*h); + QImage img(*buf, w, h, QImage::Format_RGB32); + pic = QPixmap::fromImage(img); +} +//----------------------------------------------------------------------------- +void QMGLCanvas::copy() +{ QApplication::clipboard()->setPixmap(pic, QClipboard::Clipboard); } +//----------------------------------------------------------------------------- +void QMGLCanvas::copyClickCoor() +{ QApplication::clipboard()->setText(clickPos); } +//----------------------------------------------------------------------------- +void QMGLCanvas::setMGLFont(QString path) +{ + if(path.isEmpty()) graph->RestoreFont(); + else + { + QFileInfo fi(path); + graph->LoadFont(fi.baseName().toAscii(), fi.path().toAscii()); + } + execute(); +} +//----------------------------------------------------------------------------- +void QMGLCanvas::setSize(int w, int h) +{ if(w<=0 || h<=0) return; + graph->SetSize(w,h); resize(w, h); execute(); } +//----------------------------------------------------------------------------- diff --git a/udav/qmglcanvas.h b/udav/qmglcanvas.h new file mode 100644 index 0000000..f95e18c --- /dev/null +++ b/udav/qmglcanvas.h @@ -0,0 +1,134 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef QMGLCANVAS_H +#define QMGLCANVAS_H +//----------------------------------------------------------------------------- +#include +#include +#include +#include +class QTextEdit; +class QMenu; +class QMGLCanvas; +/// Class for making picture in separate thread +class MGLThread : public QThread +{ +friend class QMGLCanvas; +Q_OBJECT +protected: + QMGLCanvas *cnv; + mglGraph *gr; + QString mes; ///< gr->Message after execution + QString text; ///< text for parsing + int line; ///< line to highlite + QString warn; + void run(); +}; +//----------------------------------------------------------------------------- +/// Class for displaying the result of MGL script parsing +class QMGLCanvas : public QWidget +{ +friend class MGLThread; +Q_OBJECT +public: + bool autoResize; ///< Allow auto resizing (default is false) + QString appName; ///< Application name for message boxes + QTextEdit *textMGL; ///< Editor with MGL script body + QTextEdit *warnMGL; ///< Buffer for messages and warnings + QString scriptName; ///< Default script name which used for exporting + mglGraph *graph; ///< Built-in mglGraph-er instance (used by default) + + QMGLCanvas(QWidget *parent = 0, Qt::WindowFlags f = 0); + ~QMGLCanvas(); + double getRatio() { return double(graph->GetWidth())/graph->GetHeight(); }; + void setPopup(QMenu *p) { popup = p; }; + void setSize(int w, int h); + /// Execute script from string + QString run(const QString &text, bool showm=true, mglGraph *gr=0, int line=-1); + const QPixmap &getPic() { return pic; }; ///< Pixmap for drawing +signals: + void refreshData(); +public slots: + void execute(mglGraph *gr=0, int line=-1); ///< Execute script (and update picture) + void copy(); ///< copy graphics to clipboard + void copyClickCoor(); ///< copy click coordinates to clipboard + void stop(); ///< Stop execution + void setPer(int p); ///< Set perspective value + void setPhi(int p); ///< Set Phi-angle value + void setTet(int t); ///< Set Theta-angle value + void setGrid(bool a); ///< Switch on/off grid of absolute coor + void setAlpha(bool a); ///< Switch on/off transparency + void setLight(bool l); ///< Switch on/off lightning + void setRotate(bool r); ///< Switch on/off mouse rotation + void imgSize(int w, int h); ///< Set image size + void restore(); ///< Restore zoom and rotation to default values + void reload(); ///< Reload data and execute script + void exportPNG(QString fname=""); ///< export to PNG file + void exportPNGs(QString fname=""); ///< export to PNG file (no transparency) + void exportJPG(QString fname=""); ///< export to JPEG file + void exportGIF(QString fname=""); ///< export to GIF file + void exportBPS(QString fname=""); ///< export to bitmap EPS file + void exportEPS(QString fname=""); ///< export to vector EPS file + void exportSVG(QString fname=""); ///< export to SVG file + void exportCPP(QString fname=""); ///< export to CPP file + void exportIDTF(QString fname=""); ///< export to IDTF file + void setMGLFont(QString path); ///< restore/load font for graphics + void startGIF(int animDelay=500, QString fname=""); + void closeGIF(); +signals: + void phiChanged(int); + void tetChanged(int); + void perChanged(int); + void gridChanged(bool); + void alphaChanged(bool); + void lightChanged(bool); + void rotateChanged(bool); + void posChanged(QString message); ///< user click to show mouse position + void objChanged(int objId); ///< User double-click to select object/line +protected: + void paintEvent(QPaintEvent *); + void resizeEvent(QResizeEvent *); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void mouseDoubleClickEvent(QMouseEvent *); + + MGLThread *thr; ///< Thread for making picture + QPixmap pic; ///< Pixmap for drawing (changed by update) + double tet, phi; ///< Rotation angles + double per; ///< Value of perspective ( must be in [0,1) ) + bool grid; ///< Grid state + bool alpha; ///< Transparency state + bool light; ///< Lightning state + bool rotate; ///< Mouse rotation state + bool showMessage; ///< Flag for showing messages (enabled by each execute()) + QMenu *popup; ///< Pointer to pop-up menu + QString clickPos; ///< Position of last mouse click +private: + int x0, y0, xe, ye; ///< Temporary variables for mouse + uchar *grBuf; + QString defText; ///< Default text for execution +}; +//----------------------------------------------------------------------------- +/// Convert bitmap from mglGraph to QPixmap +void convertFromGraph(QPixmap &pic, mglGraph *gr, uchar **buf); +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/udav/qmglsyntax.cpp b/udav/qmglsyntax.cpp new file mode 100644 index 0000000..be24340 --- /dev/null +++ b/udav/qmglsyntax.cpp @@ -0,0 +1,101 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include "qmglsyntax.h" +#include +mglParser parser; +int mgl_cmd_cmp(const void *a, const void *b); +// comment string keyword option suffix number +QColor mglColorScheme[9] = {QColor(0,127,0), QColor(255,0,0), QColor(0,0,127), QColor(127,0,0), QColor(127,0,0), QColor(0,0,255), QColor(127,0,127), QColor(0,127,127), QColor(0,0,127)}; +//----------------------------------------------------------------------------- +QMGLSyntax::QMGLSyntax(QTextEdit *textEdit) : QSyntaxHighlighter(textEdit) {} +//----------------------------------------------------------------------------- +void QMGLSyntax::highlightBlock(const QString &text) +{ + register int i, j, n, m = text.length(),s=0; + for(n=0;parser.Cmd[n].name[0];n++){}; // determine the number of symbols in parser + bool arg = false, nl = true; + QString num("+-.0123456789:"); + for(i=0;icreate ? mglColorScheme[6]:mglColorScheme[2]); + if(parser.FindCommand(s,true)) setFormat(i,j-i+1,mglColorScheme[7]); + delete []s; + } + else if(text[i]==';') { arg = true; nl = false; continue; } + else if(text[i]==':' && s==0) { nl=true; continue; } + else if(arg) // option + { + const char *o[]={"xrange","yrange","zrange","crange","alpha", + "cut","ambient","meshnum","fontsize","alphadef", + "marksize","legend"}; + int l[12] = {6, 6, 6, 6, 5, 3, 7, 7, 8, 8, 8, 6}; + for(j=0;j<12;j++) + if(text.indexOf(o[j],i)==i && (text[i+l[j]].isSpace() || i+l[j]==text.length())) + setFormat(i,l[j],mglColorScheme[3]); + } + else if(text[i]=='.' && text[i+1].isLetter()) // suffix + { + for(j=i;j +#include +#include +//----------------------------------------------------------------------------- +///Syntax highlighter for MGL script language. +class QMGLSyntax : public QSyntaxHighlighter +{ +public: + QMGLSyntax(QTextEdit *textEdit); + void highlightBlock(const QString &text); +}; +//----------------------------------------------------------------------------- +///Syntax highlighter for messages window. +class MessSyntax : public QSyntaxHighlighter +{ +public: + MessSyntax(QTextEdit *textEdit); + void highlightBlock(const QString &text); +}; +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/udav/setup_dlg.cpp b/udav/setup_dlg.cpp new file mode 100644 index 0000000..c704a96 --- /dev/null +++ b/udav/setup_dlg.cpp @@ -0,0 +1,299 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//----------------------------------------------------------------------------- +#include "setup_dlg.h" +void fillColors(QComboBox *cb); +//----------------------------------------------------------------------------- +SetupDialog::SetupDialog(QWidget *parent) : QDialog(parent) +{ + setWindowTitle(tr("UDAV - Setup plot")); + QWidget *p; + QGridLayout *g; + QLabel *l; + QPushButton *b; + QTabWidget *tab = new QTabWidget(this); + // line style + p = new QWidget(this); + g = new QGridLayout(p); g->setAlignment(Qt::AlignTop); + l = new QLabel(tr("X axis"), p); g->addWidget(l,0,1); + l = new QLabel(tr("Y axis"), p); g->addWidget(l,0,2); + l = new QLabel(tr("Z axis"), p); g->addWidget(l,0,3); + l = new QLabel(tr("C axis"), p); g->addWidget(l,0,4); + l = new QLabel(tr("Minimal"), p); g->addWidget(l,1,0); + xmin = new QLineEdit(p); g->addWidget(xmin,1,1); + ymin = new QLineEdit(p); g->addWidget(ymin,1,2); + zmin = new QLineEdit(p); g->addWidget(zmin,1,3); + cmin = new QLineEdit(p); g->addWidget(cmin,1,4); + l = new QLabel(tr("Maximal"), p); g->addWidget(l,2,0); + xmax = new QLineEdit(p); g->addWidget(xmax,2,1); + ymax = new QLineEdit(p); g->addWidget(ymax,2,2); + zmax = new QLineEdit(p); g->addWidget(zmax,2,3); + cmax = new QLineEdit(p); g->addWidget(cmax,2,4); + l = new QLabel(tr("Origin"), p); g->addWidget(l,3,0); + xorg = new QLineEdit(p); g->addWidget(xorg,3,1); + yorg = new QLineEdit(p); g->addWidget(yorg,3,2); + zorg = new QLineEdit(p); g->addWidget(zorg,3,3); + l = new QLabel(tr("Label"), p); g->addWidget(l,4,0); + xlbl = new QLineEdit(p); g->addWidget(xlbl,4,1); + ylbl = new QLineEdit(p); g->addWidget(ylbl,4,2); + zlbl = new QLineEdit(p); g->addWidget(zlbl,4,3); + l = new QLabel(tr("at position"), p); g->addWidget(l,5,0); + QStringList lpos; + lpos.append(tr("at minimum")); lpos += tr("at center"); lpos += tr("at maximum"); + xpos = new QComboBox(p); g->addWidget(xpos,5,1); xpos->addItems(lpos); + ypos = new QComboBox(p); g->addWidget(ypos,5,2); ypos->addItems(lpos); + zpos = new QComboBox(p); g->addWidget(zpos,5,3); zpos->addItems(lpos); + l = new QLabel(tr("Ticks"), p); g->addWidget(l,6,0); + xtck = new QLineEdit(p); g->addWidget(xtck,6,1); + ytck = new QLineEdit(p); g->addWidget(ytck,6,2); + ztck = new QLineEdit(p); g->addWidget(ztck,6,3); + l = new QLabel(tr("SubTicks"), p); g->addWidget(l,7,0); + xsub = new QLineEdit(p); g->addWidget(xsub,7,1); + ysub = new QLineEdit(p); g->addWidget(ysub,7,2); + zsub = new QLineEdit(p); g->addWidget(zsub,7,3); + l = new QLabel(tr("Start"), p); g->addWidget(l,8,0); + xort = new QLineEdit(p); g->addWidget(xort,8,1); + yort = new QLineEdit(p); g->addWidget(yort,8,2); + zort = new QLineEdit(p); g->addWidget(zort,8,3); + l = new QLabel(tr("Template"), p); g->addWidget(l,9,0); + xtt = new QLineEdit(p); g->addWidget(xtt,9,1); + ytt = new QLineEdit(p); g->addWidget(ytt,9,2); + ztt = new QLineEdit(p); g->addWidget(ztt,9,3); + ctt = new QLineEdit(p); g->addWidget(ctt,9,4); + l = new QLabel(tr("AlphaDef"), p); g->addWidget(l,10,0); + aldef = new QLineEdit(p); g->addWidget(aldef,11,0); + l = new QLabel(tr("Ambient"), p); g->addWidget(l,10,1); + amb = new QLineEdit(p); g->addWidget(amb,11,1); + l = new QLabel(tr("BaseWidth"), p); g->addWidget(l,10,2); + basew = new QLineEdit(p); g->addWidget(basew,11,2); + l = new QLabel(tr("MeshNum"), p); g->addWidget(l,10,3); + mesh = new QLineEdit(p); g->addWidget(mesh,11,3); + l = new QLabel(tr("AxialDir"), p); g->addWidget(l,10,4); + axial = new QComboBox(p); g->addWidget(axial,11,4); + axial->addItem("none"); axial->addItem("x"); + axial->addItem("y"); axial->addItem("z"); + l = new QLabel(tr("Font"), p); g->addWidget(l,12,0); + font = new QLineEdit(p); g->addWidget(font,13,0); + l = new QLabel(tr("FontSize"), p); g->addWidget(l,12,1); + fsize = new QLineEdit(p); g->addWidget(fsize,13,1); + alpha = new QCheckBox(tr("Alpha on"),p); g->addWidget(alpha, 13,2); + light = new QCheckBox(tr("Light on"),p); g->addWidget(light, 13,3); + rotate = new QCheckBox(tr("No text rotation"),p); g->addWidget(rotate, 13,4); + tab->addTab(p, tr("General settings")); + + p = new QWidget(this); + g = new QGridLayout(p); g->setAlignment(Qt::AlignTop); + l = new QLabel(tr("ID"), p); g->addWidget(l,0,0); + l = new QLabel(tr("State"), p); g->addWidget(l,0,1); + l = new QLabel(tr("X pos"), p); g->addWidget(l,0,2); + l = new QLabel(tr("Y pos"), p); g->addWidget(l,0,3); + l = new QLabel(tr("Z pos"), p); g->addWidget(l,0,4); + l = new QLabel(tr("Color"), p); g->addWidget(l,0,5); + l = new QLabel(tr("Brightness"), p); g->addWidget(l,0,6); + char s[3] = "0:"; + for(int i=0;i<10;i++) + { + s[0] = char(i+'0'); + l = new QLabel(s, p); g->addWidget(l,i+1,0); + slight[i] = new QCheckBox(tr("on"),p); g->addWidget(slight[i], i+1, 1); + xlight[i] = new QLineEdit(p); g->addWidget(xlight[i], i+1, 2); + ylight[i] = new QLineEdit(p); g->addWidget(ylight[i], i+1, 3); + zlight[i] = new QLineEdit(p); g->addWidget(zlight[i], i+1, 4); + clight[i] = new QComboBox(p); g->addWidget(clight[i], i+1, 5); + fillColors(clight[i]); + blight[i] = new QLineEdit(p); g->addWidget(blight[i], i+1, 6); + } + tab->addTab(p, tr("Light settings")); + + QVBoxLayout *v = new QVBoxLayout(this); v->addWidget(tab); + QHBoxLayout *h = new QHBoxLayout(); v->addLayout(h); + l = new QLabel(tr("Template name"), this); h->addWidget(l); + fname = new QLineEdit("template.mgl", this); h->addWidget(fname); + h->addStretch(1); + b = new QPushButton(tr("Save"), this); h->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(saveTmpl())); + b = new QPushButton(tr("Cancel"), this); h->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(reject())); + b = new QPushButton(tr("To script"), this); h->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(toScript())); + b->setDefault(true); +} +//----------------------------------------------------------------------------- +SetupDialog::~SetupDialog() {} +//----------------------------------------------------------------------------- +void SetupDialog::saveTmpl() +{ + if(!convert()) return; + QFile f(fname->text()); + if(!f.open(QIODevice::WriteOnly)) + QMessageBox::warning(this, tr("UDAV - Save template"), tr("Could not write to file"), QMessageBox::Ok, 0); + else + { + QTextStream t(&f); t << res; f.close(); + QMessageBox::information(this, tr("UDAV - Save template"), tr("Template saved"), QMessageBox::Ok); + emit putText(QString("#call %1").arg(fname->text())); + } + +} +//----------------------------------------------------------------------------- +void SetupDialog::toScript() +{ + if(!convert()) return; + emit putText(res); + accept(); +} +//----------------------------------------------------------------------------- +bool SetupDialog::convert() +{ + // TODO: add error (missing values) parsing + int i,j; + double x1=0,y1=0,z1=0,x2=0,y2=0,z2=0; + bool u1,v1,w1,u2,v2,w2; + + QString s, col="wwbgrcmylenuqphkWBGRCMYLENUQPH"; + res = ""; + for(i=0;i<10;i++) // set light sources + { + if(!slight[i]->isChecked()) continue; + if(xlight[i]->text().isEmpty() || ylight[i]->text().isEmpty() || zlight[i]->text().isEmpty()) + { + QMessageBox::information(this, tr("UDAV - Setup plot"), tr("Light position should be filled. Ignore it."), QMessageBox::Ok); + continue; + } + x1=xlight[i]->text().toDouble(); y1=ylight[i]->text().toDouble(); + z1=zlight[i]->text().toDouble(); j = clight[i]->currentIndex(); + if(blight[i]->text().isEmpty()) + s.sprintf("light %d %g %g %g '%c'\n", i,x1,y1,z1, col[j].toLatin1()); + else + s.sprintf("light %d %g %g %g '%c' %g\n", i,x1,y1,z1, col[j].toLatin1(), blight[i]->text().toDouble()); + res += s; + } + u1 = !xmin->text().isEmpty(); if(u1) x1 = xmin->text().toDouble(); + u2 = !xmax->text().isEmpty(); if(u2) x2 = xmax->text().toDouble(); + v1 = !ymin->text().isEmpty(); if(v1) y1 = ymin->text().toDouble(); + v2 = !ymin->text().isEmpty(); if(v2) y2 = ymax->text().toDouble(); + w1 = !zmin->text().isEmpty(); if(w1) z1 = zmin->text().toDouble(); + w2 = !zmin->text().isEmpty(); if(w2) z2 = zmax->text().toDouble(); + if(u1&&v1&&w1&&u2&&v2&&w2) + { s.sprintf("axis %g %g %g %g %g %g\n",x1,y1,z1,x2,y2,z2); res += s; } + else + { + if(u1 && u2) {s.sprintf("xrange %g %g\n",x1,x2); res += s;} + if(v1 && v2) {s.sprintf("yrange %g %g\n",y1,y2); res += s;} + if(w1 && w2) {s.sprintf("zrange %g %g\n",z1,z2); res += s;} + } + u1 = !cmin->text().isEmpty(); if(u1) x1 = cmin->text().toDouble(); + u2 = !cmax->text().isEmpty(); if(u2) x2 = cmax->text().toDouble(); + if(u1&&u2) {s.sprintf("crange %g %g\n",x1,x2); res += s;} + + u1 = !xmin->text().isEmpty(); if(u1) x1 = xorg->text().toDouble(); + v1 = !yorg->text().isEmpty(); if(v1) y1 = yorg->text().toDouble(); + w1 = !zorg->text().isEmpty(); if(w1) z1 = zorg->text().toDouble(); + if(u1&&v1&&w1) {s.sprintf("origin %g %g %g\n",x1,y1,z1); res += s;} + + u1 = !xtck->text().isEmpty(); if(u1) x1 = xtck->text().toDouble(); + u2 = !xsub->text().isEmpty(); if(u2) x2 = xsub->text().toDouble(); + v1 = !ytck->text().isEmpty(); if(v1) y1 = ytck->text().toDouble(); + v2 = !ysub->text().isEmpty(); if(v2) y2 = ysub->text().toDouble(); + w1 = !ztck->text().isEmpty(); if(w1) z1 = ztck->text().toDouble(); + w2 = !zsub->text().isEmpty(); if(w2) z2 = zsub->text().toDouble(); + if(u1 && u2) + { + if(xort->text().isEmpty()) s.sprintf("xtick %g %g\n",x1,x2); + else s.sprintf("xtick %g %g %g\n",x1,x2,xort->text().toDouble()); + res += s; + } + if(v1 && v2) + { + if(yort->text().isEmpty()) s.sprintf("ytick %g %g\n",y1,y2); + else s.sprintf("ytick %g %g %g\n",y1,y2,yort->text().toDouble()); + res += s; + } + if(w1 && w2) + { + if(zort->text().isEmpty()) s.sprintf("ztick %g %g\n",z1,z2); + else s.sprintf("ztick %g %g %g\n",z1,z2,zort->text().toDouble()); + res += s; + } + if(u1 && !u2) {s.sprintf("xtick %g\n",x1); res += s;} + if(v1 && !v2) {s.sprintf("ytick %g\n",y1); res += s;} + if(w1 && !w2) {s.sprintf("ztick %g\n",z1); res += s;} + if(!xtt->text().isEmpty()) res = res + "xtick '" + xtt->text() + "'\n"; + if(!ytt->text().isEmpty()) res = res + "ytick '" + ytt->text() + "'\n"; + if(!ztt->text().isEmpty()) res = res + "ztick '" + ztt->text() + "'\n"; + if(!ctt->text().isEmpty()) res = res + "ctick '" + ctt->text() + "'\n"; + + if(!xlbl->text().isEmpty()) + { + s.sprintf("' %d\n", xpos->currentIndex()-1); + res = res + "xlabel '"+ xlbl->text() + s; + } + if(!ylbl->text().isEmpty()) + { + s.sprintf("' %d\n", ypos->currentIndex()-1); + res = res + "ylabel '"+ ylbl->text() + s; + } + if(!zlbl->text().isEmpty()) + { + s.sprintf("' %d\n", zpos->currentIndex()-1); + res = res + "zlabel '"+ zlbl->text() + s; + } + + if(!aldef->text().isEmpty()) + { s.sprintf("alphadef %g\n",aldef->text().toDouble()); res += s; } + if(!amb->text().isEmpty()) + { s.sprintf("ambient %g\n",amb->text().toDouble()); res += s; } + + if(!basew->text().isEmpty()) + { s.sprintf("baselinewidth %g\n",basew->text().toDouble()); res += s; } + if(!mesh->text().isEmpty()) + { s.sprintf("meshnum %d\n",mesh->text().toInt()); res += s; } + if(axial->currentIndex()>0) + { + s.sprintf("axialdir '%c'\n",char('x'+axial->currentIndex()-1)); + res += s; + } + + if(!font->text().isEmpty()) + { + res = res + "font '" + font->text(); + if(!fsize->text().isEmpty()) s.sprintf("' %g\n",fsize->text().toDouble()); + else s.sprintf("'\n"); + res += s; + } + if(rotate->isChecked()) res = res + "rotatetext off\n"; + + if(alpha->isChecked()) res = res + "alpha on\n"; + if(light->isChecked()) res = res + "light on\n"; + return true; +} +//----------------------------------------------------------------------------- diff --git a/udav/setup_dlg.h b/udav/setup_dlg.h new file mode 100644 index 0000000..5b501a9 --- /dev/null +++ b/udav/setup_dlg.h @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef SETUPDIALOG_H +#define SETUPDIALOG_H +//----------------------------------------------------------------------------- +#include +class QLineEdit; +class QCheckBox; +class QComboBox; +//----------------------------------------------------------------------------- +/// Add setup code to script or save it to file (template) +class SetupDialog : public QDialog +{ +Q_OBJECT +public: + SetupDialog(QWidget *parent = 0); + ~SetupDialog(); + +signals: + void putText(const QString &par); + +private slots: + void saveTmpl(); + void toScript(); + +private: + QString res; + QLineEdit *xmin, *xmax, *xorg, *xlbl, *xtck, *xsub, *xort, *xtt; + QLineEdit *ymin, *ymax, *yorg, *ylbl, *ytck, *ysub, *yort, *ytt; + QLineEdit *zmin, *zmax, *zorg, *zlbl, *ztck, *zsub, *zort, *ztt; + QLineEdit *cmin, *cmax, *aldef,*amb, *basew,*mesh, *font, *fsize, *fname, *ctt; + QLineEdit *xlight[10], *ylight[10], *zlight[10], *blight[10]; + QCheckBox *slight[10], *alpha, *light, *rotate; + QComboBox *clight[10], *xpos, *ypos, *zpos, *axial; + + bool convert(); +}; +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/udav/src.pro b/udav/src.pro new file mode 100644 index 0000000..b1f8d91 --- /dev/null +++ b/udav/src.pro @@ -0,0 +1,68 @@ +#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 new file mode 100644 index 0000000..c090088 --- /dev/null +++ b/udav/style_dlg.cpp @@ -0,0 +1,363 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//----------------------------------------------------------------------------- +#include "xpm/none.xpm" +#include "xpm/mark_.xpm" +#include "xpm/mark_cf.xpm" +#include "xpm/mark_x.xpm" +#include "xpm/mark_p.xpm" +#include "xpm/mark_pf.xpm" +#include "xpm/mark_o.xpm" +#include "xpm/mark_of.xpm" +#include "xpm/mark_s.xpm" +#include "xpm/mark_sf.xpm" +#include "xpm/mark_d.xpm" +#include "xpm/mark_df.xpm" +#include "xpm/mark_v.xpm" +#include "xpm/mark_vf.xpm" +#include "xpm/mark_t.xpm" +#include "xpm/mark_tf.xpm" +#include "xpm/mark_l.xpm" +#include "xpm/mark_lf.xpm" +#include "xpm/mark_r.xpm" +#include "xpm/mark_rf.xpm" +#include "xpm/mark_y.xpm" +#include "xpm/mark_a.xpm" +#include "xpm/mark_n.xpm" +#include "xpm/dash_e.xpm" +#include "xpm/dash_s.xpm" +#include "xpm/dash_l.xpm" +#include "xpm/dash_m.xpm" +#include "xpm/dash_d.xpm" +#include "xpm/dash_i.xpm" +#include "xpm/dash_j.xpm" +#include "xpm/arrow_n.xpm" +#include "xpm/arrow_a.xpm" +#include "xpm/arrow_v.xpm" +#include "xpm/arrow_i.xpm" +#include "xpm/arrow_k.xpm" +#include "xpm/arrow_t.xpm" +#include "xpm/arrow_s.xpm" +#include "xpm/arrow_d.xpm" +#include "xpm/arrow_o.xpm" +//----------------------------------------------------------------------------- +#include "style_dlg.h" +void fillColors(QComboBox *cb); +void fillArrows(QComboBox *cb); +void fillDashes(QComboBox *cb); +void fillMarkers(QComboBox *cb); +void convertFromGraph(QPixmap &pic, mglGraph *gr, uchar **buf); +//----------------------------------------------------------------------------- +StyleDialog::StyleDialog(QWidget *parent) : QDialog(parent) +{ + setWindowTitle(tr("UDAV - Insert style/scheme")); + QWidget *p; + QHBoxLayout *h; + QVBoxLayout *v, *u, *vv; + QGridLayout *g; + QLabel *l; + QPushButton *b; + grBuf = 0; + tab = new QTabWidget(this); + // line style + p = new QWidget(this); + g = new QGridLayout(p); g->setAlignment(Qt::AlignTop); +// g->setColStretch(0, 1); g->setColStretch(1, 1); g->setColStretch(2, 1); + l = new QLabel(tr("Arrow at start"), p); g->addWidget(l, 0, 0); + l = new QLabel(tr("Dashing"), p); g->addWidget(l, 0, 1); + l = new QLabel(tr("Arrow at end"), p); g->addWidget(l, 0, 2); + a1 = new QComboBox(p); g->addWidget(a1, 1, 0); fillArrows(a1); + dash = new QComboBox(p); g->addWidget(dash, 1, 1); fillDashes(dash); + a2 = new QComboBox(p); g->addWidget(a2, 1, 2); fillArrows(a2); + l = new QLabel(tr("Color"), p); g->addWidget(l, 2, 0, Qt::AlignRight); + cline=new QComboBox(p); g->addWidget(cline, 2, 1); fillColors(cline); + l = new QLabel(tr("Marks"), p); g->addWidget(l, 3, 0, Qt::AlignRight); + mark = new QComboBox(p); g->addWidget(mark, 3, 1); fillMarkers(mark); + l = new QLabel(tr("Line width"), p); g->addWidget(l, 4, 0, Qt::AlignRight); + width = new QSpinBox(p); g->addWidget(width, 4, 1); + width->setRange(1,9); width->setValue(1); + connect(a1,SIGNAL(activated(int)), this, SLOT(updatePic())); + connect(a2,SIGNAL(activated(int)), this, SLOT(updatePic())); + connect(dash,SIGNAL(activated(int)), this, SLOT(updatePic())); + connect(mark,SIGNAL(activated(int)), this, SLOT(updatePic())); + connect(cline,SIGNAL(activated(int)), this, SLOT(updatePic())); + connect(width,SIGNAL(valueChanged(int)), this, SLOT(updatePic())); + tab->addTab(p, tr("Line style")); + // color scheme + p = new QWidget(this); + v = new QVBoxLayout(p); v->setAlignment(Qt::AlignTop); + g = new QGridLayout(); v->addLayout(g); +// g->setColStretch(0, 1); g->setColStretch(1, 1); + l = new QLabel(tr("Color order"), p); g->addWidget(l, 0, 0); + l = new QLabel(tr("Saturation"),p); g->addWidget(l, 0, 1); + for(int i=0;i<7;i++) + { + cc[i] = new QComboBox(p); g->addWidget(cc[i], i+1, 0); + fillColors(cc[i]); + nn[i] = new QSlider(p); g->addWidget(nn[i], i+1, 1); + nn[i]->setRange(1, 9); nn[i]->setValue(5); + nn[i]->setTickPosition(QSlider::TicksAbove); + nn[i]->setTickInterval(1); nn[i]->setPageStep(2); + nn[i]->setOrientation(Qt::Horizontal); + connect(cc[i],SIGNAL(activated(int)), this, SLOT(updatePic())); + connect(nn[i],SIGNAL(valueChanged(int)), this, SLOT(updatePic())); + } + coor = new QCheckBox(tr("Colors along coordinates"),p); v->addWidget(coor); + swire = new QCheckBox(tr("Wire or mesh plot"),p); v->addWidget(swire); + g = new QGridLayout(); v->addLayout(g); + l = new QLabel(tr("Axial direction"), p); g->addWidget(l, 0, 0, Qt::AlignRight); + l = new QLabel(tr("Text on contours"), p); g->addWidget(l, 1, 0, Qt::AlignRight); + axial = new QComboBox(p); g->addWidget(axial, 0, 1); + axial->addItem(tr("none")); axial->addItem("x"); + axial->addItem("y"); axial->addItem("z"); + ctext = new QComboBox(p); g->addWidget(ctext, 1, 1); + ctext->addItem(tr("none")); ctext->addItem(tr("under")); ctext->addItem(tr("above")); + connect(coor,SIGNAL(toggled(bool)), this, SLOT(updatePic())); + connect(axial,SIGNAL(activated(int)), this, SLOT(updatePic())); + connect(ctext,SIGNAL(activated(int)), this, SLOT(updatePic())); + connect(swire,SIGNAL(toggled(bool)), this, SLOT(updatePic())); + tab->addTab(p, tr("Color scheme")); + // font style + p = new QWidget(this); + v = new QVBoxLayout(p); v->setAlignment(Qt::AlignTop); + h = new QHBoxLayout(); v->addLayout(h); + u = new QVBoxLayout(); h->addLayout(u); + bold = new QCheckBox(tr("Bold style"), p); u->addWidget(bold); + ital = new QCheckBox(tr("Italic style"), p);u->addWidget(ital); + wire = new QCheckBox(tr("Wire style"), p); u->addWidget(wire); + uline = new QCheckBox(tr("Underline"), p); u->addWidget(uline); + oline = new QCheckBox(tr("Overline"), p); u->addWidget(oline); + u = new QVBoxLayout(); h->addLayout(u); + l = new QLabel(tr("Text color"), p); u->addWidget(l); + cfont = new QComboBox(p); fillColors(cfont); u->addWidget(cfont); + u->addSpacing(6); + align = new QGroupBox(tr("Text align"), p); u->addWidget(align); + vv = new QVBoxLayout(align); //vv->addSpacing(11); + rbL = new QRadioButton(tr("left"), align); vv->addWidget(rbL); + rbC = new QRadioButton(tr("at center"), align); + vv->addWidget(rbC); rbC->setChecked(true); + rbR = new QRadioButton(tr("right"), align); vv->addWidget(rbR); + connect(bold,SIGNAL(toggled(bool)), this, SLOT(updatePic())); + connect(ital,SIGNAL(toggled(bool)), this, SLOT(updatePic())); + connect(wire,SIGNAL(toggled(bool)), this, SLOT(updatePic())); + connect(uline,SIGNAL(toggled(bool)), this, SLOT(updatePic())); + connect(oline,SIGNAL(toggled(bool)), this, SLOT(updatePic())); + connect(cfont,SIGNAL(activated(int)), this, SLOT(updatePic())); + connect(rbL,SIGNAL(toggled(bool)), this, SLOT(updatePic())); + connect(rbC,SIGNAL(toggled(bool)), this, SLOT(updatePic())); + connect(rbR,SIGNAL(toggled(bool)), this, SLOT(updatePic())); + tab->addTab(p, tr("Font style")); + connect(tab,SIGNAL(currentChanged(QWidget *)), this, SLOT(updatePic())); + + // dialog itself + v = new QVBoxLayout(this); v->addWidget(tab); + h = new QHBoxLayout(); v->addLayout(h); + l = new QLabel(tr("Resulting string"), this); h->addWidget(l); h->addStretch(1); + pic = new QLabel(this); pic->setMinimumSize(QSize(128,30)); h->addWidget(pic); + res = new QLineEdit(this); res->setReadOnly(true); v->addWidget(res); + + h = new QHBoxLayout(); v->addLayout(h); h->addStretch(1); + b = new QPushButton(tr("Cancel"), this); h->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(reject())); + b = new QPushButton(tr("OK"), this); h->addWidget(b); + connect(b, SIGNAL(clicked()),this, SLOT(accept())); + b->setDefault(true); +} +//----------------------------------------------------------------------------- +StyleDialog::~StyleDialog() { if(grBuf) delete []grBuf; } +//----------------------------------------------------------------------------- +void fillColors(QComboBox *cb) +{ +// string id : "wbgrcmylenuqphkWBGRCMYLENUQPH" + QPixmap pic(16,16); + cb->addItem(QPixmap(none_xpm), QObject::tr("none or default")); + pic.fill(QColor(255,255,255)); cb->addItem(pic, QObject::tr("w - white")); + pic.fill(QColor(0,0,255)); cb->addItem(pic, QObject::tr("b - blue")); + pic.fill(QColor(0,255,0)); cb->addItem(pic, QObject::tr("g - lime")); + pic.fill(QColor(255,0,0)); cb->addItem(pic, QObject::tr("r - red")); + pic.fill(QColor(0,255,255)); cb->addItem(pic, QObject::tr("c - cyan")); + pic.fill(QColor(255,0,255)); cb->addItem(pic, QObject::tr("m - magenta")); + pic.fill(QColor(255,255,0)); cb->addItem(pic, QObject::tr("y - yellow")); + pic.fill(QColor(0,255,127)); cb->addItem(pic, QObject::tr("l - springgreen")); + pic.fill(QColor(127,255,0)); cb->addItem(pic, QObject::tr("e - lawngreen")); + pic.fill(QColor(0,127,255)); cb->addItem(pic, QObject::tr("n - skyblue")); + pic.fill(QColor(127,0,255)); cb->addItem(pic, QObject::tr("u - blueviolet")); + pic.fill(QColor(255,127,0)); cb->addItem(pic, QObject::tr("q - orange")); + pic.fill(QColor(255,0,127)); cb->addItem(pic, QObject::tr("p - deeppink")); + pic.fill(QColor(127,127,127)); cb->addItem(pic, QObject::tr("h - gray")); + pic.fill(QColor(0,0,0)); cb->addItem(pic, QObject::tr("k - black")); + pic.fill(QColor(179,179,179)); cb->addItem(pic, QObject::tr("W - lightgray")); + pic.fill(QColor(0,0,127)); cb->addItem(pic, QObject::tr("B - navy")); + pic.fill(QColor(0,127,0)); cb->addItem(pic, QObject::tr("G - green")); + pic.fill(QColor(127,0,0)); cb->addItem(pic, QObject::tr("R - maroon")); + pic.fill(QColor(0,127,127)); cb->addItem(pic, QObject::tr("C - teal")); + pic.fill(QColor(127,0,127)); cb->addItem(pic, QObject::tr("M - purple")); + pic.fill(QColor(127,127,0)); cb->addItem(pic, QObject::tr("Y - olive")); + pic.fill(QColor(0,127,77)); cb->addItem(pic, QObject::tr("L - seagreen")); + pic.fill(QColor(77,127,0)); cb->addItem(pic, QObject::tr("E - darklawn")); + pic.fill(QColor(0,77,127)); cb->addItem(pic, QObject::tr("N - darkskyblue")); + pic.fill(QColor(77,0,127)); cb->addItem(pic, QObject::tr("U - indigo")); + pic.fill(QColor(127,77,0)); cb->addItem(pic, QObject::tr("Q - brown")); + pic.fill(QColor(127,0,77)); cb->addItem(pic, QObject::tr("P - darkpink")); + pic.fill(QColor(77,77,77)); cb->addItem(pic, QObject::tr("H - darkgray")); +} +//----------------------------------------------------------------------------- +void fillArrows(QComboBox *cb) +{ + // "AVIKTSDO" + cb->addItem(QPixmap(arrow_n_xpm), QObject::tr("none")); + cb->addItem(QPixmap(arrow_a_xpm), QObject::tr("arrow")); + cb->addItem(QPixmap(arrow_v_xpm), QObject::tr("back arrow")); + cb->addItem(QPixmap(arrow_i_xpm), QObject::tr("stop")); + cb->addItem(QPixmap(arrow_k_xpm), QObject::tr("size")); + cb->addItem(QPixmap(arrow_t_xpm), QObject::tr("triangle")); + cb->addItem(QPixmap(arrow_s_xpm), QObject::tr("square")); + cb->addItem(QPixmap(arrow_d_xpm), QObject::tr("rhomb")); + cb->addItem(QPixmap(arrow_o_xpm), QObject::tr("circle")); +} +//----------------------------------------------------------------------------- +void fillDashes(QComboBox *cb) +{ + // "-|;=ji: " + cb->addItem(QPixmap(dash_s_xpm), QObject::tr("solid")); + cb->addItem(QPixmap(dash_l_xpm), QObject::tr("long dash")); + cb->addItem(QPixmap(dash_m_xpm), QObject::tr("dash")); + cb->addItem(QPixmap(dash_e_xpm), QObject::tr("small dash")); + cb->addItem(QPixmap(dash_j_xpm), QObject::tr("dash dot")); + cb->addItem(QPixmap(dash_i_xpm), QObject::tr("small dash dot")); + cb->addItem(QPixmap(dash_d_xpm), QObject::tr("dots")); + cb->addItem(QPixmap(mark_n_xpm), QObject::tr("none")); +} +//----------------------------------------------------------------------------- +void fillMarkers(QComboBox *cb) +{ + // ".+x*sdv^<>o.*+xsdv^<>o" : nf = 10 + cb->addItem(QPixmap(mark_n_xpm), QObject::tr("none")); + cb->addItem(QPixmap(mark__xpm), QObject::tr("dot")); + cb->addItem(QPixmap(mark_p_xpm), QObject::tr("plus")); + cb->addItem(QPixmap(mark_x_xpm), QObject::tr("skew cross")); + cb->addItem(QPixmap(mark_a_xpm), QObject::tr("asterix")); + cb->addItem(QPixmap(mark_s_xpm), QObject::tr("square")); + cb->addItem(QPixmap(mark_d_xpm), QObject::tr("rhomb")); + cb->addItem(QPixmap(mark_v_xpm), QObject::tr("triangle down")); + cb->addItem(QPixmap(mark_t_xpm), QObject::tr("triangle up")); + cb->addItem(QPixmap(mark_l_xpm), QObject::tr("triangle left")); + cb->addItem(QPixmap(mark_r_xpm), QObject::tr("triangle right")); + cb->addItem(QPixmap(mark_o_xpm), QObject::tr("circle")); + + cb->addItem(QPixmap(mark_cf_xpm), QObject::tr("circled dot")); + cb->addItem(QPixmap(mark_y_xpm), QObject::tr("Y-sign")); + cb->addItem(QPixmap(mark_pf_xpm), QObject::tr("squared plus")); + cb->addItem(QPixmap(none_xpm), QObject::tr("squared cross")); + + cb->addItem(QPixmap(mark_sf_xpm), QObject::tr("solid square")); + cb->addItem(QPixmap(mark_df_xpm), QObject::tr("solid rhomb")); + cb->addItem(QPixmap(mark_vf_xpm), QObject::tr("solid triangle down")); + cb->addItem(QPixmap(mark_tf_xpm), QObject::tr("solid triangle up")); + cb->addItem(QPixmap(mark_lf_xpm), QObject::tr("solid triangle left")); + cb->addItem(QPixmap(mark_rf_xpm), QObject::tr("solid triangle right")); + cb->addItem(QPixmap(mark_of_xpm), QObject::tr("solid circle")); +} +//----------------------------------------------------------------------------- +void StyleDialog::updatePic() +{ + static mglGraph gr(0,128,30); + static bool f = true; + mglData x(3), y(3), a(32,2); + x.Fill(-1,1); a.Fill(-1,1); + if(!f) gr.Clf(); + if(f) + { + gr.SubPlot(1,1,0,""); + gr.SetMarkSize(20); + gr.SetArrowSize(20); + f = false; + } + result = ""; + int i,j; + QString col="wbgrcmylenuqphkWBGRCMYLENUQPH", mrk=".+x*sdv^<>o.*+xsdv^<>o", dsh="|;=ji: ", arw="AVIKTSDO", s; + switch(tab->currentIndex()) + { + case 0: // line style + i = a2->currentIndex(); if(i>0) result += arw[i-1]; + j = a1->currentIndex(); if(j>0) + { + if(i==0) result += '_'; + result += arw[j-1]; + } + i = dash->currentIndex(); if(i>0) result += dsh[i-1]; + i = mark->currentIndex(); if(i>0) result += mrk[i-1]; + if(i>11) result += '#'; + i = cline->currentIndex(); if(i>0) result += col[i-1]; + i = width->value(); if(i>1) result += char('0'+i); + gr.Plot(x,y,result.toAscii()); + break; + case 1: // color sceheme + for(j=0;j<7;j++) + { + i = cc[j]->currentIndex(); + if(i<1) break; + result += col[i-1]; + i = nn[j]->value(); + if(i!=5) result += char('0'+i); + } + if(coor->isChecked()) result += 'd'; + if(swire->isChecked()) result += '#'; + i = ctext->currentIndex(); + if(i==1) result += 't'; + if(i==2) result += 'T'; + i = axial->currentIndex(); + if(i>0) result = result+':'+char('x'+i-1); + gr.Surf(a,result.toAscii()); + break; + case 2: // text style + if(bold->isChecked()) result += 'b'; + if(ital->isChecked()) result += 'i'; + if(wire->isChecked()) result += 'w'; + if(uline->isChecked()) result += 'u'; + if(oline->isChecked()) result += 'o'; + if(rbL->isChecked()) result += 'L'; + if(rbC->isChecked()) result += 'C'; + if(rbR->isChecked()) result += 'R'; + i = cfont->currentIndex(); + if(i>0) result = result + ':' + col[i-1]; + gr.Puts(mglPoint(0,-0.5),"Font test",result.toAscii(),-10); + break; + } + result = "'" + result + "'"; + res->setText(result); + QPixmap p; + convertFromGraph(p, &gr, &grBuf); + pic->setPixmap(p); +} +//----------------------------------------------------------------------------- diff --git a/udav/style_dlg.h b/udav/style_dlg.h new file mode 100644 index 0000000..a7c2ce3 --- /dev/null +++ b/udav/style_dlg.h @@ -0,0 +1,61 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef STYLEDIALOG_H +#define STYLEDIALOG_H +//----------------------------------------------------------------------------- +#include +class QComboBox; +class QSlider; +class QSpinBox; +class QGroupBox; +class QTabWidget; +class QCheckBox; +class QLabel; +class QLineEdit; +class QRadioButton; +//----------------------------------------------------------------------------- +/// Selecting styles of command (like line style, color scheme, font style, axis style) +class StyleDialog : public QDialog +{ +Q_OBJECT +public: + QString getStyle() { return result; }; + StyleDialog(QWidget *parent = 0); + ~StyleDialog(); +private slots: + void updatePic(); +private: + QString result; + QComboBox *cc[8], *cline, *cfont; + QSlider *nn[8]; + QComboBox *axial, *ctext, *a1, *a2, *dash, *mark; + QCheckBox *swire, *coor, *upd; + QCheckBox *ital, *bold, *wire, *uline, *oline; + QSpinBox *width; + QGroupBox *align; + QTabWidget *tab; + QLabel *box, *pic; + QLineEdit *res; + QRadioButton *rbL, *rbC, *rbR; + uchar *grBuf; +}; +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/udav/text_pnl.cpp b/udav/text_pnl.cpp new file mode 100644 index 0000000..0dd2dd3 --- /dev/null +++ b/udav/text_pnl.cpp @@ -0,0 +1,538 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//----------------------------------------------------------------------------- +#include "udav_wnd.h" +#include "qmglsyntax.h" +#include "find_dlg.h" +#include "opt_dlg.h" +#include "style_dlg.h" +#include "files_dlg.h" +#include "newcmd_dlg.h" +#include "setup_dlg.h" +#include "open_dlg.h" +#include "text_pnl.h" +#include "plot_pnl.h" +//----------------------------------------------------------------------------- +FilesDialog *files_dlg=0; +QString defFontFamily; +int defFontSize; +bool mglAutoExecute = true; +extern mglParser parser; +extern bool mglCompleter; +//----------------------------------------------------------------------------- +TextPanel::TextPanel(QWidget *parent) : QWidget(parent) +{ + printer = new QPrinter; + findDialog = new FindDialog(this); + optDialog = new OptionDialog(this); + stlDialog = new StyleDialog(this); + newCmdDlg = new NewCmdDialog(this); + setupDlg = new SetupDialog(this); + dataOpenDlg = new DataOpenDialog(this); + if(!files_dlg) files_dlg= new FilesDialog; + + connect(setupDlg, SIGNAL(putText(const QString &)), this, SLOT(animPutText(const QString &))); + connect(newCmdDlg, SIGNAL(result(const QString&)), this, SLOT(putLine(const QString&))); + connect(findDialog, SIGNAL(findText(const QString &, bool, bool)), this, SLOT(findText(const QString &, bool, bool))); + connect(findDialog, SIGNAL(replText(const QString &, const QString &, bool, bool)), this, SLOT(replText(const QString &, const QString &, bool, bool))); + + edit = new TextEdit(this); edit->setAcceptRichText(false); + new QMGLSyntax(edit); + defFontFamily = edit->fontFamily(); + defFontSize = int(edit->fontPointSize()); + + register int i; + for(i=0;mgls_base_cmd[i].name[0];i++) + words<setCaseSensitivity(Qt::CaseInsensitive); +// completer->setCompletionMode(QCompleter::PopupCompletion); +// edit->setCompleter(completer); + edit->setLineWrapMode(QTextEdit::NoWrap); + setCompleter(mglCompleter); + + QBoxLayout *v,*h; + menu = new QMenu(tr("&Edit"),this); + v = new QVBoxLayout(this); + h = new QHBoxLayout(); v->addLayout(h); + toolTop(h); v->addWidget(edit); +} +//----------------------------------------------------------------------------- +TextPanel::~TextPanel() { delete printer; } +//----------------------------------------------------------------------------- +void TextPanel::setCompleter(bool en) +{ + edit->setCompleter(en?completer:0); +// completer->setCompletionMode(en ? QCompleter::PopupCompletion : QCompleter::InlineCompletion); +} +//----------------------------------------------------------------------------- +mglData mglFormulaCalc(const wchar_t *string, mglParser *arg); +void TextPanel::insNVal() +{ + QString sel=edit->textCursor().selectedText(); + if(sel.isEmpty()) return; + wchar_t *txt=new wchar_t[sel.length()+1]; + sel.toWCharArray(txt); txt[sel.length()]=0; + mglData res=mglFormulaCalc(txt, &parser); + delete []txt; + edit->textCursor().insertText(QString::number(res.a[0])); +} +//----------------------------------------------------------------------------- +void TextPanel::insFitF() +{ + QString str(graph->getFit()); + if(str.isEmpty()) return; + edit->textCursor().insertText("'"+str+"'"); +} +//----------------------------------------------------------------------------- +void TextPanel::insFile() +{ + QString str = QFileDialog::getOpenFileName(this, tr("UDAV - Insert filename")); + if(str.isEmpty()) return; + edit->textCursor().insertText("'"+str+"'"); +} +//----------------------------------------------------------------------------- +void TextPanel::insPath() +{ + QString str = QFileDialog::getExistingDirectory(this, tr("UDAV - Insert filename")); + if(str.isEmpty()) return; + edit->textCursor().insertText("'"+str+"'"); +} +//----------------------------------------------------------------------------- +void TextPanel::refreshData() +{ + QStringList vars=words; + mglVar *v = parser.DataList; + while(v) + { + if(v->s.length()>2) vars<s); + v = v->next; + } + delete completer; completer = new QCompleter(vars, this); + completer->setCaseSensitivity(Qt::CaseInsensitive); + completer->setCompletionMode(QCompleter::PopupCompletion); + edit->setCompleter(completer); +} +//----------------------------------------------------------------------------- +void TextPanel::printText() +{ + QPrintDialog printDlg(printer, this); + if (printDlg.exec() == QDialog::Accepted) + { + setStatus(tr("Printing...")); + edit->print(printer); + setStatus(tr("Printing completed")); + } + else setStatus(tr("Printing aborted")); +} +//----------------------------------------------------------------------------- +void TextPanel::find() +{ + findDialog->show(); + findDialog->raise(); + findDialog->activateWindow(); +} +//----------------------------------------------------------------------------- +bool TextPanel::findText(const QString &str, bool cs, bool fw) +{ +// static int para=0, index=0; + static QTextDocument::FindFlags f; + static QString stri=""; + if(!str.isEmpty()) + { + stri = str; + f = QTextDocument::FindFlags(); + if(fw) f = f|QTextDocument::FindBackward; + if(cs) f = f|QTextDocument::FindCaseSensitively; + } + bool res = edit->find(stri, f); + if(!res) + QMessageBox::information(this, tr("UDAV - find text"), tr("No string occurrence is found")); + return res; +} +//----------------------------------------------------------------------------- +void TextPanel::replText(const QString &str, const QString &txt, bool cs, bool fw) +{ + static bool res=false; + if(str.isEmpty()) { res = false; return; } + if(res) edit->textCursor().insertText(txt); + res = findText(str, cs, fw); +} +//----------------------------------------------------------------------------- +void TextPanel::addOptions() +{ + if(optDialog->exec()==QDialog::Accepted) + { + edit->moveCursor(QTextCursor::EndOfLine); + edit->insertPlainText(optDialog->getOption()); + } +} +//----------------------------------------------------------------------------- +void TextPanel::animPutText(const QString &s) +{ edit->moveCursor(QTextCursor::Start); edit->insertPlainText(s); } +//----------------------------------------------------------------------------- +void TextPanel::putText(const QString &txt) +{ edit->insertPlainText(txt); } +//----------------------------------------------------------------------------- +void TextPanel::putLine(const QString &txt) +{ edit->moveCursor(QTextCursor::StartOfLine); + edit->insertPlainText(txt+"\n"); } +//----------------------------------------------------------------------------- +void TextPanel::addStyle() +{ + if(stlDialog->exec()==QDialog::Accepted) + { + QString s = edit->textCursor().block().text(); + int i = s.indexOf(';'); + if(i<0) edit->moveCursor(QTextCursor::EndOfLine); + else + { + edit->moveCursor(QTextCursor::StartOfBlock); + // foolish way :( + for(;i>0;i--) edit->moveCursor(QTextCursor::Left); + } + edit->insertPlainText(stlDialog->getStyle()); + } +} +//----------------------------------------------------------------------------- +void TextPanel::setEditorFont(QFont *f) +{ edit->setFont(f ? *f : QFont(defFontFamily, defFontSize)); } +//----------------------------------------------------------------------------- +QString TextPanel::selection() +{ return edit->textCursor().block().text(); } +//----------------------------------------------------------------------------- +void TextPanel::setCursorPosition(int n) +{ + graph->setCurPos(n); + if(n<0) return; + edit->moveCursor(QTextCursor::Start); + for(int i=0;imoveCursor(QTextCursor::NextBlock); + edit->setFocus(); +} +//----------------------------------------------------------------------------- +void TextPanel::newCmd() +{ + newCmdDlg->parseCmd(edit->textCursor().block().text()); + newCmdDlg->show(); +} +//----------------------------------------------------------------------------- +#ifndef USE_HDF5 +void TextPanel::saveHDF5(const QString &fileName){} +void TextPanel::loadHDF5(const QString &fileName){} +//----------------------------------------------------------------------------- +#else +#define H5_USE_16_API +#include +void TextPanel::loadHDF5(const QString &fileName) +{ + // H5T_C_S1 - C string + hid_t hf,hg,hd,hs,ht; + hsize_t dims[3]; + long rank; + hf = H5Fopen(fileName.toAscii().constData(), H5F_ACC_RDONLY, H5P_DEFAULT); + if(!hf) return; + hg = H5Gopen(hf, "/"); + hsize_t num, nx, ny, nz, i; + char name[256]; + H5Gget_num_objs(hg, &num); + for(i=0;isetText(buf); + graph->animParseText(edit->toPlainText()); + setCurrentFile(fileName); + delete []buf; + setStatus(tr("Loaded document %1").arg(fileName)); + if(mglAutoExecute) graph->execute(); + } + else if(H5Tget_class(ht)==H5T_FLOAT || H5Tget_class(ht)==H5T_INTEGER) + { + for(int j=0;name[j];j++) if(!isalnum(name[j])) name[j]='_'; + mglVar *v = parser.AddVar(name); + nx = ny = nz = 1; + if(rank>0 && rank<=3) + { + H5Sget_simple_extent_dims(hs,dims,0); + switch(rank) + { + case 1: nx=dims[0]; break; + case 2: nx=dims[1]; ny=dims[0]; break; + case 3: nx=dims[2]; ny=dims[1]; nz=dims[0]; break; + } + v->d.Create(nx, ny, nz); + H5Dread(hd, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, v->d.a); + } + } + H5Dclose(hd); H5Sclose(hs); H5Tclose(ht); + } + H5Gclose(hg); H5Fclose(hf); +} +//----------------------------------------------------------------------------- +void TextPanel::saveHDF5(const QString &fileName) +{ + hid_t hf,hd,hs; + hsize_t dims[3]; + long rank = 3; + + H5Eset_auto(0,0); + hf = H5Fcreate(fileName.toAscii().constData(), H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if(hf<0) + { + setStatus(tr("Could not write to %1").arg(fileName)); + return; + } + { // save script + QString txt = edit->toPlainText(); + dims[0] = txt.length()+1; + char *buf = new char[dims[0]+1]; + memcpy(buf, txt.toAscii().constData(), dims[0]); + buf[dims[0]]=0; + hs = H5Screate_simple(1, dims, 0); + hd = H5Dcreate(hf, "mgl_script", H5T_C_S1, hs, H5P_DEFAULT); + H5Dwrite(hd, H5T_C_S1, hs, hs, H5P_DEFAULT, buf); + H5Dclose(hd); H5Sclose(hs); + delete []buf; + } + mglVar *v = parser.DataList; + char name[256]; + while(v) + { + wcstombs(name,v->s.c_str(),v->s.length()+1); + if(v->d.nz==1 && v->d.ny == 1) + { rank = 1; dims[0] = v->d.nx; } + else if(v->d.nz==1) + { rank = 2; dims[0] = v->d.ny; dims[1] = v->d.nx; } + else + { rank = 3; dims[0] = v->d.nz; dims[1] = v->d.ny; dims[2] = v->d.nx; } + hs = H5Screate_simple(rank, dims, 0); + hd = H5Dcreate(hf, name, H5T_IEEE_F32LE, hs, H5P_DEFAULT); + + H5Dwrite(hd, H5T_NATIVE_FLOAT, hs, hs, H5P_DEFAULT, v->d.a); + H5Dclose(hd); H5Sclose(hs); + v = v->next; + } + H5Fclose(hf); + setCurrentFile(fileName); + setStatus(tr("File %1 saved").arg(fileName)); + return; +} +#endif +//----------------------------------------------------------------------------- +void TextPanel::load(const QString &fileName) +{ + if(fileName.right(4).toLower()==".dat") + { + dataOpenDlg->setFile(fileName); + if(dataOpenDlg->exec()) + { + setCurrentFile(fileName.left(fileName.length()-3)+"mgl"); + edit->setText(dataOpenDlg->getCode()); + } + } + else if(fileName.right(4).toLower()==".hdf" || fileName.right(3).toLower()==".h5") + loadHDF5(fileName); + else + { + QFile f(fileName); + if(!f.open(QIODevice::ReadOnly)) + { + QMessageBox::warning(this,tr("UDAV - open file"), + tr("Couldn't open file ")+"'"+fileName+"'", + QMessageBox::Ok,0,0); + return; + } + + QTextStream ts(&f); + ts.setAutoDetectUnicode(true); +// ts.setCodec(QTextCodec::codecForLocale()); + + QString str=ts.readAll(); + int narg=0,i=-1; + if(str.contains('%')) + { + while((i = str.indexOf('%',i+1))>0) + { + char ch = str.at(i+1).toLatin1(); + if(ch>='1' && ch<='9' && ch-'0'>narg) + narg = ch-'0'; + } + if(narg>0) + { + files_dlg->setNumFiles(narg); + if(!files_dlg->exec()) return; // nothing to do + str = files_dlg->putFiles(str); + } + } + + if(narg>0) setCurrentFile(fileName.left(fileName.length()-3)+"mgl"); + edit->setText(str); + graph->animParseText(edit->toPlainText()); + if(narg==0) setCurrentFile(fileName); + } + setStatus(tr("Loaded document ")+fileName); + if(mglAutoExecute) graph->execute(); +} +//----------------------------------------------------------------------------- +void TextPanel::save(const QString &fileName) +{ + if(fileName.right(4)==".hdf" || fileName.right(3)==".h5") + { saveHDF5(fileName); return; } + QString text = edit->toPlainText(); + QFile f(fileName); + if(!f.open(QIODevice::WriteOnly)) + { + setStatus(tr("Could not write to %1").arg(fileName)); + return; + } + QTextStream t(&f); + t.setAutoDetectUnicode(true); + t << text; f.close(); + setCurrentFile(fileName); + setStatus(tr("File %1 saved").arg(fileName)); +} +//----------------------------------------------------------------------------- +void TextPanel::addSetup() { setupDlg->exec(); } +//----------------------------------------------------------------------------- +#include "xpm/option.xpm" +#include "xpm/style.xpm" +//----------------------------------------------------------------------------- +void TextPanel::toolTop(QBoxLayout *l) +{ + QAction *a; + QMenu *o=menu, *oo; + QToolButton *bb; + const MainWindow *mw=findMain(this); + + // general buttons + if(mw) + { + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(mw->aload); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(mw->asave); + } + // edit menu + a = new QAction(QPixmap(":/xpm/edit-undo.png"), tr("&Undo"), this); + connect(a, SIGNAL(activated()), edit, SLOT(undo())); + a->setToolTip(tr("Undo editor change (Ctrl+Z).")); + a->setShortcut(Qt::CTRL+Qt::Key_Z); o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/edit-redo.png"), tr("&Redo"), this); + connect(a, SIGNAL(activated()), edit, SLOT(redo())); + a->setToolTip(tr("Redo editor change (Ctrl+Shift+Z).")); + a->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_Z); o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + o->addSeparator(); + o->addAction(tr("Clear all"), edit, SLOT(clear())); + a = new QAction(QPixmap(":/xpm/edit-cut.png"), tr("Cu&t text"), this); + connect(a, SIGNAL(activated()), edit, SLOT(cut())); + a->setToolTip(tr("Cut selected text to clipboard (Ctrl+X).")); + a->setShortcut(Qt::CTRL+Qt::Key_X); o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/edit-copy.png"), tr("&Copy text"), this); + connect(a, SIGNAL(activated()), edit, SLOT(copy())); + a->setToolTip(tr("Copy selected text or data to clipboard (Ctrl+C).")); + a->setShortcut(Qt::CTRL+Qt::Key_C); o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(QPixmap(":/xpm/edit-paste.png"), tr("&Paste text"), this); + connect(a, SIGNAL(activated()), edit, SLOT(paste())); + a->setToolTip(tr("Paste text or data from clipboard (Ctrl+V).")); + a->setShortcut(Qt::CTRL+Qt::Key_V); o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + o->addAction(QPixmap(":/xpm/edit-select-all.png"), tr("Select &all"), edit, SLOT(selectAll()), Qt::CTRL+Qt::Key_A); + o->addSeparator(); + + a = new QAction(QPixmap(":/xpm/edit-find.png"), tr("&Find/Replace"), this); + connect(a, SIGNAL(activated()), this, SLOT(find())); + a->setToolTip(tr("Show dialog for text finding (Ctrl+F).")); + a->setShortcut(Qt::CTRL+Qt::Key_F); o->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(tr("Find next"), this); + connect(a, SIGNAL(activated()), this, SLOT(findText())); + a->setShortcut(Qt::Key_F3); o->addAction(a); + o->addSeparator(); + + // insert menu + oo = o->addMenu(tr("Insert")); + a = new QAction(QPixmap(":/xpm/format-indent-more.png"), tr("New command"), this); + a->setShortcut(Qt::META+Qt::Key_C); connect(a, SIGNAL(activated()), this, SLOT(newCmd())); + a->setToolTip(tr("Show dialog for new command and put it into the script.")); + oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + a = new QAction(tr("Fitted formula"), this); a->setShortcut(Qt::META+Qt::Key_N); + connect(a, SIGNAL(activated()), this, SLOT(insFitF())); + a->setToolTip(tr("Insert last fitted formula with found coefficients.")); + oo->addAction(a); + a = new QAction(QPixmap(style_xpm), tr("Plot style"), this); + connect(a, SIGNAL(activated()), this, SLOT(addStyle())); + a->setToolTip(tr("Show dialog for styles and put it into the script.\nStyles define the plot view (color scheme, marks, dashing and so on).")); + oo->addAction(a); + a = new QAction(QPixmap(option_xpm), tr("Command options"), this); + connect(a, SIGNAL(activated()), this, SLOT(addOptions())); + a->setToolTip(tr("Show dialog for options and put it into the script.\nOptions are used for additional setup the plot.")); + oo->addAction(a); + a = new QAction(tr("Numeric value"), this); + connect(a, SIGNAL(activated()), this, SLOT(insNVal())); + a->setToolTip(tr("Replace expression by its numerical value.")); + oo->addAction(a); + a = new QAction(QPixmap(":/xpm/x-office-spreadsheet.png"), tr("File name"), this); + a->setShortcut(Qt::META+Qt::Key_P); connect(a, SIGNAL(activated()), this, SLOT(insFile())); + a->setToolTip(tr("Select and insert file name.")); + oo->addAction(a); + a = new QAction(QPixmap(":/xpm/folder.png"), tr("Folder path"), this); + connect(a, SIGNAL(activated()), this, SLOT(insPath())); + a->setToolTip(tr("Select and insert folder name.")); + oo->addAction(a); + + a = new QAction(QPixmap(":/xpm/document-properties.png"), tr("Graphics setup"), this); + connect(a, SIGNAL(activated()), this, SLOT(addSetup())); + a->setToolTip(tr("Show dialog for plot setup and put code into the script.\nThis dialog setup axis, labels, lighting and other general things.")); + oo->addAction(a); + bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(a); + + l->addStretch(1); + if(mw) bb = new QToolButton(this); l->addWidget(bb); bb->setDefaultAction(mw->acalc); +} +//----------------------------------------------------------------------------- diff --git a/udav/text_pnl.h b/udav/text_pnl.h new file mode 100644 index 0000000..4a653ec --- /dev/null +++ b/udav/text_pnl.h @@ -0,0 +1,110 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef TEXT_PNL_H +#define TEXT_PNL_H +//----------------------------------------------------------------------------- +#include +#include +#include "textedit.h" +//----------------------------------------------------------------------------- +class QMenu; +class QPrinter; +class QCompleter; +class QBoxLayout; +class FindDialog; +class OptionDialog; +class StyleDialog; +class SetupDialog; +class NewCmdDialog; +class DataOpenDialog; +class PlotPanel; +//----------------------------------------------------------------------------- +#ifndef WIN32 +#define USE_HDF5 // Enable HDF "projects" +#endif +//----------------------------------------------------------------------------- +class TextPanel : public QWidget +{ +Q_OBJECT +public: + QMenu *menu; + TextEdit *edit; ///< script itself + PlotPanel *graph; ///< NOTE: have to be filled!!! + NewCmdDialog *newCmdDlg; + + TextPanel(QWidget *parent = 0); + ~TextPanel(); + void load(const QString &fileName); + void save(const QString &fileName); + inline bool isModified() { return edit->document()->isModified(); } + inline void setModified(bool m) { edit->document()->setModified(m); } + inline void moveCursor(QTextCursor::MoveOperation c) + { edit->moveCursor(c); } + void setCompleter(bool en); + QString selection(); + +signals: + void setCurrentFile(const QString &s); + void setStatus(const QString &s); + +public slots: + void setEditorFont(QFont *f=0); +// void setEditPos(bool bottom); + void animPutText(const QString &); + void putText(const QString &txt); + void putLine(const QString &txt); + void setCursorPosition(int); + + void addOptions(); + void addStyle(); + void insNVal(); + void insFile(); + void insPath(); + void insFitF(); + void newCmd(); + void addSetup(); + + void refreshData(); + void printText(); + void find(); + bool findText(const QString &str="", bool cs=false, bool fw=true); + void replText(const QString &str, const QString &txt, bool cs=false, bool fw=true); + +private: + + QCompleter *completer; + QStringList words; + QPrinter *printer; + + FindDialog *findDialog; + OptionDialog *optDialog; + StyleDialog *stlDialog; + DataOpenDialog *dataOpenDlg; + SetupDialog *setupDlg; + + void toolTop(QBoxLayout *l); +// void toolLeft(QBoxLayout *l); + + void saveHDF5(const QString &fileName); + void loadHDF5(const QString &fileName); +}; +//----------------------------------------------------------------------------- +#endif // TEXT_PNL_H +//----------------------------------------------------------------------------- diff --git a/udav/textedit.cpp b/udav/textedit.cpp new file mode 100644 index 0000000..323b4e0 --- /dev/null +++ b/udav/textedit.cpp @@ -0,0 +1,143 @@ +/**************************************************************************** + ** + ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + ** All rights reserved. + ** Contact: Nokia Corporation (qt-info@nokia.com) + ** + ** This file is part of the examples of the Qt Toolkit. + ** + ** $QT_BEGIN_LICENSE:BSD$ + ** You may use this file under the terms of the BSD license as follows: + ** + ** "Redistribution and use in source and binary forms, with or without + ** modification, are permitted provided that the following conditions are + ** met: + ** * Redistributions of source code must retain the above copyright + ** notice, this list of conditions and the following disclaimer. + ** * Redistributions in binary form must reproduce the above copyright + ** notice, this list of conditions and the following disclaimer in + ** the documentation and/or other materials provided with the + ** distribution. + ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor + ** the names of its contributors may be used to endorse or promote + ** products derived from this software without specific prior written + ** permission. + ** + ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." + ** $QT_END_LICENSE$ + ** + ****************************************************************************/ + +#include "textedit.h" +#include +#include +#include +#include +#include +#include +#include +#include + +TextEdit::TextEdit(QWidget *parent) : QTextEdit(parent), c(0) +{ +/* setPlainText(tr("This TextEdit provides autocompletions for words that have more than" + " 3 characters. You can trigger autocompletion using ") + + QKeySequence("Ctrl+E").toString(QKeySequence::NativeText));*/ +} + +TextEdit::~TextEdit() {} + +void TextEdit::setCompleter(QCompleter *completer) +{ + if (c) QObject::disconnect(c, 0, this, 0); + c = completer; + if (!c) return; + c->setWidget(this); + c->setCompletionMode(QCompleter::PopupCompletion); + c->setCaseSensitivity(Qt::CaseInsensitive); + QObject::connect(c, SIGNAL(activated(QString)), this, SLOT(insertCompletion(QString))); +} + +QCompleter *TextEdit::completer() const +{ return c; } + +void TextEdit::insertCompletion(const QString& completion) +{ + if (c->widget() != this) return; + QTextCursor tc = textCursor(); + int extra = completion.length() - c->completionPrefix().length(); + tc.movePosition(QTextCursor::Left); + tc.movePosition(QTextCursor::EndOfWord); + tc.insertText(completion.right(extra)); + setTextCursor(tc); +} + +QString TextEdit::textUnderCursor() const +{ + QTextCursor tc = textCursor(); + tc.select(QTextCursor::WordUnderCursor); + return tc.selectedText(); +} + +void TextEdit::focusInEvent(QFocusEvent *e) +{ + if (c) c->setWidget(this); + QTextEdit::focusInEvent(e); +} + +void TextEdit::keyPressEvent(QKeyEvent *e) +{ + if (c && c->popup()->isVisible()) + { + // The following keys are forwarded by the completer to the widget + switch (e->key()) + { + case Qt::Key_Enter: + case Qt::Key_Return: + case Qt::Key_Escape: + case Qt::Key_Tab: + case Qt::Key_Backtab: + e->ignore(); + return; // let the completer do default behavior + default: + break; + } + } + + bool isShortcut = ((e->modifiers() & Qt::ControlModifier) && e->key() == Qt::Key_E); // CTRL+E + if (!c || !isShortcut) // do not process the shortcut when we have a completer + QTextEdit::keyPressEvent(e); + + const bool ctrlOrShift = e->modifiers() & (Qt::ControlModifier | Qt::ShiftModifier); + if (!c || (ctrlOrShift && e->text().isEmpty())) + return; + + static QString eow("~!@#$%^&*()_+{}|:\"<>?,./;'[]\\-="); // end of word + bool hasModifier = (e->modifiers() != Qt::NoModifier) && !ctrlOrShift; + QString completionPrefix = textUnderCursor(); + + if (!isShortcut && (hasModifier || e->text().isEmpty()|| completionPrefix.length() < 3 + || eow.contains(e->text().right(1)))) { + c->popup()->hide(); + return; + } + + if (completionPrefix != c->completionPrefix()) { + c->setCompletionPrefix(completionPrefix); + c->popup()->setCurrentIndex(c->completionModel()->index(0, 0)); + } + QRect cr = cursorRect(); + cr.setWidth(c->popup()->sizeHintForColumn(0) + + c->popup()->verticalScrollBar()->sizeHint().width()); + c->complete(cr); // popup it up! +} diff --git a/udav/textedit.h b/udav/textedit.h new file mode 100644 index 0000000..04cfc30 --- /dev/null +++ b/udav/textedit.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef TEXTEDIT_H +#define TEXTEDIT_H + +#include + +class QCompleter; + +class TextEdit : public QTextEdit +{ + Q_OBJECT + +public: + TextEdit(QWidget *parent = 0); + ~TextEdit(); + + void setCompleter(QCompleter *c); + QCompleter *completer() const; + +protected: + void keyPressEvent(QKeyEvent *e); + void focusInEvent(QFocusEvent *e); + +private slots: + void insertCompletion(const QString &completion); + +private: + QString textUnderCursor() const; + QCompleter *c; +}; + +#endif // TEXTEDIT_H diff --git a/udav/udav.ico b/udav/udav.ico new file mode 100644 index 0000000000000000000000000000000000000000..27423de866f0ccb0cb6ea059621ffb0854d7ace6 GIT binary patch literal 16958 zcmeI2cbHYx)rSX=-V_lLlwOr0D2fWw6hVo-qk;`%!GikPr3#9I3KlG&SOVC4AxMc0 z?ESGuOpF?%5sk*~%KPqn&wSTmMrS}Ve*~Y`bMLw5?7e=g?R^du6;p(%k>!Osp&!bui!qfdg^Y!Y>MGCm`MI^hm>8Q(x3N=mV^E7))z=EzK)XEcIZB5- zo^K1S!E0N9_d15YFgF}K%ZV%>thdUU%}IArQH&`BAB?N)C9A*AGnX;f?`kipTN~AF z9JOC9>Qdt-&;>Tl(~V>I0zBUpI)m444Bo3R^q*rowmG36%m?eDI2Vj{7WcxV=f|Rd z{90?RmJgUK%Xj;c+O17S!iE(+xb1Y^x^fO1HcKe(DHx9o59|*I!Y~+~=ivPDAdUxs z*X#@WM1ScwbEZF7Bi4~M)e+iggE75m?X}|?G~d11X7Sj-f$`#=d&VpK>=V!Kx@#=l zcH6jVWaD zT(T~D+RyasIaRC1`L%1OnBTj_7V+m{!y=|mjkx2Ei2Lq~m^CXt9W^SJ^y`a59_-$ASJB0p^E!VV#%{gR-2;^8ONX z`{qqHiRX9QEn@80h=mIyKL0%8n{OhXdoJR<^I}n-J~4gWb;})p=E?HDI-hG7_g4K* z{3P{NYEL^#;#%YH>014k_uY?tqaX5qWRCGL7DmGv@P9B0%n@^9c(KnJ%lYhc)6jHd z+qUuWcH710C!G{AcW%T}Pvvw!_+Z4Pm&WtE?;aPevrf6Sn(z@3={?q9hTo@f{(OG7H%+4d+MgXG`K1(}=p*JkA11;$ILqrZpB2VE zX>ZUVu4~;o<@P_0IVNJ}%!ntSjCl3ch=(4Em@pyrf*BiZP*Ls1-n_3l0llJTb=X6v zG4JJ#8>ilS1HL!+?$~tGu>S7fa?5z2XV18g&v(&_ZtdJT{?M*nT+^aO%-|mHy?`;a zUw@b<=2n&;`I?yaqq@oGh`FTy^}GH2M#i#ATPoOZ33m zty<|*wYU-H@bhp{7W>-TsIBUDZE-zW%$!RH4T|Tex7YUHKi(TLB0i(X{4jbnk((HC z!3Amlm_0k<=9?q#y*J)J;)rC=!vh8+UuoB6jT)sKNxndrd6E2pKPED7RvY?9KN$n< z(2w)z=Sv38>kJa?EKJXeyvFBLNyfweg zA!BKLpV(=qczgKp)K_ENxQHoJa(d0b8*hxb_11_79*B74k%(uW$=US63lUE|5%J=S z>H3dGj!fg+*}Z$r#HSZipXQhLX7!;D{A>)2xw+%IZl1lo_ue^w-*s2Sn{P&Z^ijm? zuP0x;bmD8*=T-@fU(xagvYMT;Wdc_-rIk0aiFH{!z&srK{ZjiE#1 ze(qPB{lmRl)+e0bb62saxds0}%G&&-Ptw*|??sC2`8^ zE?LvowfStna6OJc{VC$J&vN|x-)YT$g_zn$^q*^b)*o)})G5{6JBJ(+F?n*tJ@-Ud z=ic|pClO1RMx1+YJi7h%X^(^5U7#)a{J0*dMNL212l(Cf-dd>*KG(RvZEl^;>)0{H z_>aAM#hu-{r8r+mT(aKpG4*rd7IznlB!NnL0NKG(E%Et^eF-PW~hSg-aT_nKF*uNL>$SI{5aU%JO|t#vPMZs-$p z$UIK)*>h@hTx&Y@?^j-l_~D0$=bw)_=bW^jTMw?U`m#9Q-+!OW`T6tX`?JrECH?!y zrNjq2-Cw&$><2zGb%IvlbJEY&0N0evee=frX%F4({Wr8}lX~E7_}VqkJ+*al3;8L2 zpF(MfLp=;yg;B&}hoR?)g?if#!@9xE3-FM%xmj8L|vGL6rXXN(l ztYPj^Q;#&p%a+B8f*4{P6N zYI|o(*aUh&Ul?KzU(I@8ydT(VtJHJcce~!c%bK8#pHahKo_cD0d*+!DW5%Rdrai&5 zX}LYxoH-G9-yN}JNp5{~{d)iXv@ZOawJWV-#+$X&9$|gC4%=g~VJ^&sY2ZH5y|T{> zheByJ(3rB44 z-N)Rwz-+h-Cd1iKRt>lgv;q5=n$)(Ee$JWu>UWLEdY|tW+JSYnHEa*N!GUljoD5@O zin)0y{lPtgJ<_^;f_!%^{tJ2j!I4L%T>tch6XKKOjtlob?j792SSzmm-fMl?L(`tl zeE9lno{Gk&b>B6Xx#q*|a3fp+Sq=ECq)pnUjoPZs+TIq_Vn0{gO8WrL73#0YcY9wm zu=jO`USM5WU)I?%a4JlIi{L7l19!m!cnqF}S7Ev9p!v(^PvHyr3ci7F^Z40wU%0PN z>%8ln`gxYur}_II;u`00uB*Yh$3xZwe220-41{f9Q!s`b!RqMm&Hd{4oy>3;38%qC zm35!8p8uonE*`qiv1`QH7qd!6~LZ|Ql?HSpnw;}Q0>?ti#uRrGJheQR2OdGp_# z*9YJGY@kM;vwW6L>!14|o-M5huCbPuLRtB5Ev~8jAC{lXnk!fTBO{##8VxIJR@R{#^-E!9Cz=t$&svW7rd` zLmgNbnnG*n3_W20>llvZn2zlnv%xvt|7gRBa0Cp6!e@Xkd~XA4QIp!LL23Ix_rL!3 zllxzO-xm&pB=N{GVd7lY=K6+t~J#z1i9(^>uJIg=Q zEa(0=;3aqp%qPcmZ0B$;=bQ*3sB42Q06-Te#`XN;B!4#51K)H=my(>`%3d` zC}cHo7N5_B=`aiC_})#e#qq}nnIC*l=CgwDrdO~Z_W6N(-T`&L1?IeQe-_lf1RjJt zU=A32=W@=o;Y28z`&)CaE3|`+KrL!gn=vk4`~QCl{!tI8%QX$5DYS;pum$vmonUV` z7|elFVLVKM%i&s>=Q|_w+cnL<2QUY+zUO;uu6Z4dv-tT{Fy=47)9^T`eLk4??s;Z| zb6f!Cov|MYhrm8C1p0xtc7j&W1R6jcs19Ym1LU{Lko5rbr7@U49iTh(f`PCb902-# z6r2eY;UX|M&C#1dyC3wuvF`wUZuVI~KXCqqJTG#z$2|w?UIvfCA~5cbq4w**u`dSa za?TTA1Zayk?Et-DGbnfNXF0$@Ie*ss|K}U9msM(e|CpnFc5Zy{oqhA2Ty^qa2{xBY;8rk>_rv@T zcwgyrzVAc%uHJ>9W^-NLUh6&Hdo8G4zdH69aIRzFFxVe<0ejOnppDwv5;lMa@UyvJ zpuZB=n*%k$9I$to1Nu|HT3dZ!5bO>Iz~OKl*bB7J7+DK5z^$8%u3y~b;A0PnpV9IK>u=XCBpU@&M?59kDKK%2E)4QiffhxNhyRYP@9Q>lHwP`jVG&OTU}0}c7! z1X@8y=nh-McJMo}{l`0wIqiWR&`as`#ulaNY42S)|Ih;$sJGVA;0&UW^#?Sz?S=*~Xxnp0#2bH;3 zADBbtlH)qQy`UX9uX$%J^auOUuCO;4C;g!9`oX##rM7C-&WY;PCq|7Lli=I}CZ+TK z&b3E_K0E{t1jpP327z;#^JQt*)(Z8!LfwU*8Al&f&5vgCw3HjA+{Q%7mXAHoS!2rbew==c#`f3 zOuIH|TNd}#)?S7W96zfC`+@zY6?A~kU|hBYZPgFP%$(I1yEJWjRrK$_Bu0+>IQ;7% z|G9+!Y-03in%Z73MW;@;WcsZo?=`0!%a~hh&e0xP!iHcR3bj|``!A;bXMA8!Yy?fg zo?tvWLZKh*4ZT4f18UbkKX%;liS)YTwbytV{8jF+bN%OfBSyRz9XiZ0_WEsG@LqFD zpLT)5m^b0OYmzn?599KyXfMSFRhi44SO;8Z>M(}eG-+~09C_pi z>8}9&=P`>GvB8;0kb5mqyVrQ_=HR{7xVdGW8*}q5i@EEvHfYPQs=b5{?1|aBP@B)z zopCT8nIE*(-p~%r3HzimR8u$U)am9_`~CVY34Ovj>)PB=v$6JG$FRort$o*gb1vts z1+H=0qD`x`&Slyva?H=?y!u`Lm*xlS!gy)FJ;M4>lUT#XHN)@5SiN3r9@$^bbNh@r zrtZ>WUg7;sMYNW6Ew)qwdrjsCYp~D{_9b&d`;DD3)E}ZY(Kq5be^;;9nn%XkF|0A; z?byzd#oW2qSj@}m2W`_vbJNNg7Hh}KbUVjy9`myNplx~VM_FxXzkNb~ zWIoX^8S3=2zj>V$YF?wgtt@S;avmKe{h?1XjA=%8POV9AcJHdp``>;~rmgV!8`;dX ztNQ1=(YZTUG|wHE*UudnXUFQf?_;XR4@G@w5%pt5QI+_P<8s=?R~#1?71du})ZD)y zs8qx?Md{Dz5=XlWe|UABjto1-4@{Ge487Rz%(gs#T#-M1mp}gCaWwzNa21bfV#Z(T zI0nN#pB)z`Gm{}n{qmxsbi|>6(UxGJ literal 0 HcmV?d00001 diff --git a/udav/udav.png b/udav/udav.png new file mode 100644 index 0000000000000000000000000000000000000000..76ba7d97bebda3275a4a690afed0c2bc45e2bd7b GIT binary patch literal 4139 zcmV+`5Y+F9P)Nkl z%_Tty300s%t4J*$l0XVdo2F^vl$$URAVRURv5k$f9bb0Y%em~?bD7IK{V?a8oqc!a z>;)TCsYiM=b8a*5^M9ZF^NjF3k5A?$#N5w5{>2y{Bcq~0v%U;+-+1fIyua|k7#{<} zDiHyM7a(T87mefj2g0}j%xeK=)pIRm_r+X>XOV1B69{=erNX!XjO&4OErf`WgdoE~ z0NelwazQlLtJRDh6x696FygqTr>rAvdc#9eRhxDmm)0mMS2A*dcaJ9OpS7k}zg)M_;j zA34I^XU<-w0MKM!1;K7y$7x*4o$(-xlLoQ4I6w$xM~yZV3js(2^nYG4uy@!A z3#?cH#Ui}^I?w;|mwe%sz1Jzb?cv$F{S{ZKaxrR z&z3D$(SPNYaK#mH$t6%IK(WZ+i4#1%Zv6E-4jsNxVK_*ZqIyj!Z~|*xFbKv+V7|#< zTsg)TJv~sX!KqVB=JUi1gGW0%Uie0_bW32jgF7E(Ta?&h zVIUZbWZsBi-fU15C@tV>^*X0conmTgiq3c6C6P!VrDVENp;#zTER~u!PAdS|%I-I> zX@@M@TPO$%kpLBdAahMJ0~8Mdp=ArIl?sk+Qz#UO83vlJ`##WhaU2KBwy_;23;;`2 zr;wcwMv~4#Krj~Q>QsYghA^K{KnRtBCWE3@LkKZ<^`1w=FlUtAHzELFZtl=}ISMF? z0U%QJRk2S*991dN0bRN-UPv;~Od$jyG%W~#y};cMQ-g*#5h6+oBHZ8{=3^ndoorC^ zy-F$oEn~P_6W@r^H6a8$T=`Idc^jyQP_;p|00qCd8q_eL;ek>V08P=4DU39CH`zE( z1ze-3xw+Lg*6Y2(a zE*4?+6AB1XsxT`u{PLII-}?63|H0VUI6I~HUkwJ;=uc%rv`LxOs8LOzv@nAhW(30$ zoS+AYhgkhYz%C?0b|$zx`aSoI{K=bdzQD0#@8dW-UT*BH8vfdCEWT>!!kAYRC^?fn zMFJ4I`$j|nWGeb@D)u4h6=FavoqqU_w{6?To;^P$pD*CLJKt>l-U|W13SmBK*X@X~ z*=QUCg_+qN!DtioXc5fE+5n*%NfR(PYDhshj3j7&x0$j zxSR$+LJ?&(-PIy$26jZAV29KqR1jo@3W%@*roI3Pm;*#2@%=A(UY^Ox38a)r=>u*U z23KEwHNCw(Joun@`NTw#U;la!2M>Pfl%fJE^WHqWZYc)Sh$zg=QG-AnAcSJ=69HeJ zQruJUm=1AODNWmb6L@%@&p3E!nnpZs(%IR`s#Pnw{`%`#vBJbK;Hjtf@Y-u%JgqR* z^ySq6RT?x6lmo|d;Qe&qcg_C=;{vxC7zF`PeSR1KnGgyE07%AS_kTu8$?RZDpz9i@ zY0}r%$L7tOx$U+gF1-|9eioW zW>k?=tpK&iws-6gxeA)zmYrdgpC`&!nN04e90Sc z+;T#(3(he~h7~3Bh{YIy;d#S(z|geetmk<+j!m&xWZ%C1 z*tU(Xe~~-xfJYv=nJrtMzx3sozi?b($OyTIx)!lOiVTI-rbZak?LG^WkXgT%a=7k! z!#05Hx=c@(IdbF(&pr1lFT4QPT?gO#){Si1^zWyQJf|6beNS95}!mZ}?8?^Ph*Ip&?B3!3_}%FXZ}*R)LS}HS6B4yVJ2Oi_y_h z4j;D3=Y3UJw{DQGuI{DY!&}rM&eO|VAkF!Yl#=P`G9P~UA;ls{2^U?|MORmj@MdXb zKXJkL*A|InROeRBxPs)x;}7&FlRxNEJ`aYm5|FliZ^dyOT-QZ5N|}iSn5IcG`GafQ zq{8ZYM2LPU_4Pge zpUanbkWObXO%ovmmQ`nJN>Zs*&@|t}__4o-lwK>w)OEd)48@7ZO;V{OnM{^!HbYNO zjJ`hj;SXP8c=!e`y9|E!J9z7@B7gY9DJqo;QhMBd_h0ha&u+T?*s)`bj&6T+o_au7 zRcHCayR$P#GMPjOf$O?>p3k5VzAbI)x9hsNu7B=%vw_ew9bMNj zj2Q8F9Md$(WHJZ=J9cd0h8y7UVffk4V9%ZxdGEcW6bc1OrN3iz)c@|4S3F*Q^;HfY zJjmIzU;SGp5h}Mygehb!xR5)6*4f+iJx=KBF#< z<07To07JGqJHQ*SYh~JK4Uym$hr*op<0DzknBC+{@9UN12$I#Iouf zIr3fl`+Zd!8-xA(Veeka-o1M{aNq!=qucKY$pkBbOfpa+_uQz8kXmok0mn2=5{U%K zWD3L3@jNJ(r(2>a#0&ub&PzN`1{n9|ROE$#n{K+9?b|oAWedb&@SESjo;_vWdh1O- z_}~PELIKON@H}|t8Q)F}4#L0y+;9V2e!0f_^`GO#7q4LB#*3aldh{5T%HMyk%~*|W zqXMC75YJ>D9?NDs=;`UEySs;ujw~Q3l}e0^j4(2CuHm=6IlDfWagWujSF?5NR&Kqu zgR8D;?1BMLJ_*15?IGTK?>$CF&M`Gr#u}@a1_l2T)(2DQ>)dnEDI2Hb#*Z?Fu;Or^92fp0+mVy%c>KL#mHu}EL+yk>eZ{c^2!x#+z6{y`5vHJ^~VC9dJ2C3 z`(wQS{xQy-J4dltqE@TnI1ZlYVVWkVPoE*5FEBnn&gs*qIdS50&YbCEXvn|bx^=#H z$>lynE|+7~s(;;g{P>@*R9s}}tYKInBmTK0Xe37)Br6-Q8S# z@rstOH%;HyCldaGG8y0H#p8ZhTdP5-1kXMTCr(Uo{P=Osojb?)_&8HjW$N`Bw(Yc} z$S@4*^*WAYV_6o}YL!x{M4?b%eEd?*o?XZ0&4R%}SiT%?yb;prL6XS?Yu5begOevu zQmcKpQvqSV&QMDVTt8Ej*tSKv?BO^L$z+ODD#^&mD8*utWHQ-`1+v);rYVTWea4$U zKb3-?|9pgri3#%gJQEWWluAX)wD%R0GKTWe&xn#EudDbvv1#i;_(>q zxQS`{emxe85s$|ZLPH4A`n_e@)a!LDtKL#0+qRgA`I}Ya8G9k+uE#WO`0Gsr3LdU2 zS}xUfT^z^8as2hvYJ)gVFGEBA#Lb2cP_3?}R;%Oq!xl1Xcq#&b87Z)=d((z-|8&#B z3*lf{b*fdZ<;pZoYq&NMxPpi0$(CW9Auq&8dadrT>+X64u%#TnAFyMw2kvuSrx93z z=edDv`(XJ09Yo4rHf->t%Qb6Ya&kSTQi*|qC+)LmzakbpA<}Fh2*=rx(e?YvO^+ev zOzp$xS%l_Pvt8h9W?L{f{x9XO2bA7`4LG)a?_W1dyxRb|)r zLPBu0+hYTDDR|k{#N%dGxYaExx9giiAj2U zANR(`|4J-kM#z(m-EDxdtJ5&ij@DKp#tj%hf~&aW$?qh_6U$dFXM0mOB>zWenc z2!%qPGiOfI(UB#aT}i3rd!LaJ7#%I4X&Q-yxs*xK=rK9NxbIvL3>A>3c>B7&^Nxu5 z9ubj*IUyhfM_(+!HjMj@8iqkKnWD3^liuE5dU|?VVSBw^XL2&n`1m*z6XT4G+#{AS zD%*BYG8Qre5H=_oEN!cOh_Gr-SlinQ#PrRh9g96M5|76ko+wT{9>*{YgwT*u`r~(2 zoqFBEvMg$~Z;K_&3eTDo4r`l-jmgGBdI(Vfcp+*K)d;nfd11#iA1wK+)X=o1M-l;# za~ zVvJxU2=a0FLgxRp-OUmVQtpiG4T|&g;AAKeQGL6pXNDH~&{QzB{m2hZiSzs9=#n0rBVztf zMi@trC52!g3jl5BjYJ63?EnbrM4kV|iVOejaN9>`RTT(1Uf2bS|9^P;6MKDP$Y1dG p`2VTb{{jmq7ce7<-9!KY002ovPDHLkV1fVu002ovPDHLkV1jwz=*R#7 literal 0 HcmV?d00001 diff --git a/udav/udav.qrc b/udav/udav.qrc new file mode 100644 index 0000000..6771737 --- /dev/null +++ b/udav/udav.qrc @@ -0,0 +1,48 @@ + + + udav.png + xpm/document-new.png + xpm/document-open.png + xpm/document-print.png + xpm/document-save.png + xpm/document-properties.png + xpm/document-export.png + xpm/document-import.png + xpm/alpha.png + xpm/preferences-system.png + xpm/edit-cut.png + xpm/edit-copy.png + xpm/edit-delete.png + xpm/edit-paste.png + xpm/edit-select-all.png + xpm/edit-find.png + xpm/edit-redo.png + xpm/edit-undo.png + xpm/process-stop.png + xpm/zoom-out.png + xpm/zoom-in.png + xpm/zoom-original.png + xpm/zoom-fit-best.png + xpm/view-refresh.png + xpm/weather-clear.png + xpm/help-contents.png + xpm/help-faq.png + xpm/go-first.png + xpm/go-last.png + xpm/go-previous.png + xpm/go-next.png + xpm/go-down.png + xpm/go-up.png + xpm/media-seek-backward.png + xpm/media-seek-forward.png + xpm/film-b.png + xpm/object-rotate-right.png + xpm/accessories-calculator.png + xpm/format-indent-more.png + xpm/x-office-spreadsheet.png + xpm/folder.png + xpm/text-x-generic.png + xpm/x-office-presentation.png + xpm/system-file-manager.png + + diff --git a/udav/udav.rc b/udav/udav.rc new file mode 100644 index 0000000..d12f614 --- /dev/null +++ b/udav/udav.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "udav.ico" diff --git a/udav/udav_ru.qm b/udav/udav_ru.qm new file mode 100644 index 0000000000000000000000000000000000000000..7319dfda816e7222e661094415fd9a67e1b6ea0c GIT binary patch literal 71709 zcmdUY3w)eK+3zITY&M%s(w0(6DeY3)ZQ7=3n_elsrAcql8%=?>T*@ZdB-Rp5d;y$8{$Dkzzh0`f}q0r|7YHLud}&;=lssmAAPgC z@60^&%rnn@o>}(wj`2VE^EH?M@R*6;I_vsx{%W-lWA7It^pp_4{vRRAj~7CGM?FK! z)pJ!^J=-2s&yJ_n^U5;y{LC5Z`Osg~^A9;ZcL>pT0-ihZ%;UKW&uj4ff)LyAeZ`qV z+&EV~U;GH3_`d9YLhS7j;>YN>{~`Py5~a7?C`8o-BJ}ijz&A~VevYx`T_Hk$MB6&x+cT~vJTEFpezs)+3wEyNkkqUIAX z2=UWTicv4D65_QMG5V*k2=TyHG4s~zg@_##Gw%rr@#i0inLnB)M0Hj@&wdHd79qM` z7BgS^n-DiI7Be}I+&D37BR=n~7PAI0@4aiptV@88zg!|_9YR0((P9?IzvZi9*6kMv zG3G=u>jD0LpE&N<^MRKe#L`F&@b$b{d%=ak!#~CPMb8Ow?KrXi;#Yy&C&US}-YZ08 zkvL(|bO?Yk)yWYh6zdcu+#@~N8U7RkT=ZMqa_Z1;N z`5tjb)dGPZM8`vb>$IPW&Vv~tP8<+jYnp`E)g-#Eco6H*DY~!f65{cHiM|y-5#slk ziF`?)5Pg@6f!7+b4v&d}e*;f{o+=Ku;raBd;+zvetA9ROoO>bq-F1_=3QOk z-{N`gwc^lfettk4+JxtIr;584Vcnj8Mcnho^Fl0NF2421;X=HAsrYUT@OtLBt6{$;ulJNxlmC&Z3#;CU)OA5k*@RP2>U(j`llV14J^Q?lw0mkM#m z&r898kYF){{Zb)I>8%o~31p6r4T^j1UPl$hg zueA29r-XR%Yo%k~54fVwtLOXsN{=|}@4&}DOPAk<-@iCXJ^%5e(p7&LC&c?Fmo~MY zEku2|v^m-=#Q!vwZk&}7;-fQ5Py6M0Lfmy@=^3BA1K%GgJ?rUtLM%JKv^xSgU%tC^ zf7L=E{x+`kydM0%{G!r}reWSS*OVT*4D@!#j?$0Z{-O|9K3DqDKTZIBU0C|*&&Gu) ze7p3zM_YyX-kQ>z7rh_*;Wz6bE{eWvtFT<@DZOYbKAjb2sy_zmSkjM`KBOgr9tVq@uZRpUViyGx(HdaDpW zpH})p3)c0#M@nBgdAkr_nNj*$9p0aJQt4}#11~>1tMs+cHsJY8>1(gd03Udv^!1rH z;dy=O>l?4adOlzJ`WNbjcywA>$!^g7gLBG4?^z+l?6qZMZhJzACx27cFdq1RXmi=z zRo7x3Gt1_lHy`_IPubiL;Pdq6vX#&F17Eqa&Er2I#P++&c5XNl>-Md()Q84`&gPY+ zZU#P{TUeHv|Ev(t+*Fo1a}k~|lwJ4>ztn;CSxhva1S!W7VOu zPqqM#pT1mn%{LYZ@w2UEH+%@=9X6rtbGvs6aaOAAn`M6y;tjGxQgCj$$UOr5S4@?cM ze)~A^g}I?qE}bOAf1MRN&5MZ>s0@_3HVZ>(ukvq2ytok8To!tH5Ac53*ULo;>w0xndHFT?{qL#r zikmJLqOwq4HLg~Oi$wVmhu*+*U-^*_-6llc!{x_L3_)%*mCt&nMTqNvRlaQPRgjCl z<*hrT*#Cbm-}!~@SkGDIU3olv;^kehr10KV<=y{&3+sM$dG7~-zauU$Key$6;BQ~~ zq0cYCc(0USL4N<`eEHQMEnuHrSAH|s>xIvh-}dtx0pIiGU#7e~b7T2e<@c|bfA`RL zv0v^lf8f*4Vt$X6KOleqUim}({dXJ7pW^4;tIJ<}5$iDSj`BbK_!S|Jdb<3tUqgT2 zx;R`i^-S=^PlQXa1fT!u_Hg;hYlOI}J{;}>9QUWfGk*DPA(~zeH~jeyA#OT4-283O z)pw5wugT!Oi~GatF9ct??)TwM-#-@X{$jYb{bcZyYr{Kl`U&J_GQ4{x#{1T$aQpij zK*y(t6+U)^GqwMX&)0^}z5#sxjBCS%^btbL+7sTt5c9cYI-XAo@uA=2`8=MthY!B- zetiGA@O#3T*OfEX^LvMf&#l1vF1|l}ZhH#+^v&>jGs}f|>5A}qd-@^YwuI0BA>jPS zrQr{*{j3nl^TJnrb0zjwB7Eg4;H%}<@YU;IfV_D!d`%$?4$?&63-yp;}4~L(w!+a_Z zgh<@ixtQdC?&rO>vX8Z;3-~Nk= znZ4-uj`0=Ce+GO%_CUpoY4?F|->ROUdcI;6`@Ma0#hN`|5#onWS9BbO@oFBg$esdt ze{ym~-#wQKF?DjqKnnQ(;T07FkGupuqq5@QloG6Ctm6E$Zh{^#x8nSdrhuP^D=z%b zv-o~{#i7SPf&KpXimU(70eP2H&)&GJFveFkKEt*AmsDT z$oDAkyN`@KQUQ5;d^w&+;&~FDkoU)bD)LAZ_|dm#Mjm+;_`K?Uk;h+sL5SLWBR~2$ z_Q^T#i9B-v{eCtYdG2zIcV;y5JNbNnXTBxaKR^ z?<=CmhhY=F`S)ncKc5#O@ltft?|utDdU^Ep2k_osTB5t}MSo8n8|~Nzct7)8wDa@O zLoVrv?)^06b97oXclu+X=ewhY*cu_)UyGhUrX1_^K=k6jRAB#1h<>O6c>78=dP($v z5c@BQUh*xBJNl03RnK8whrbm4R3-3o&ywgZPu-7w@YCp>kG~&!+UwD~Mg!h2-mRW* z^hCcJy$tgAu;|y;oeMtmO!OO}kKz5Tc;1D1zY)E6$=|WhcSi3$1h_leqTl?-eL~#5 zF#6D8tAX#6q7N4U*PpJ7K5{4Ex_)=`(Q~lRPL4%?{$HPle*Z}H4~Niy>!r~@{|WMG z<~`B3zj7YzkPD)3zXg1}?^{*l4*~B_Ute`>HDC+4=t%$^99g*?dGcW7h--ltf)HudC0ec)~Yj} z$2|XjRaNp0Jb!#jRog|Uf{r_@+W+fS(Em$Sol{;DP?V~=&Uq8_yuRw-zuyP@;ex6Q z8)8_WSE~-y-66z+?^hkVej4=ByQ)4O!T$Th&#FE#`6|fU?^b>C^C95-*Ht(4KM1&f zU3KH90OvPbV>7{_DT0`dbx#zu<|g*Z%fnAwK`!nAmzW)@xZTbZ`y$+y`TkJy?f^TVv5^1bWdg zV)G}>fIj=L*n+KqGyc2S@eQDZ+6!aLZd?WZ`uy0s*%-HdyLvub4*DoRh$r?z`Tcl)RfupH&#&RR5znvV`QLbc1J9quF8eU>Hl;Ln zb>D}v|Hi~Vlfr!OyE1mu#xi`qFn05U=LzwJw_=}t9PcgK8@uh{(XbQGjNO@f3;3&u z-Tmi0E@jJy*I#4dA$1YEk}Ug ze5HEIo6o^6xV`$=Utt~oI=6b!x51Ymc(r=zDUYGQsnsi2jD>sWiE6dZ->F`I`76-x z{!)F`T=ci3th(!W7oy!u)#*v|p?B`CPXFuy$kz?kd-j0eJrt_W#9xQ}xS~3DV?W0I zQ1yi`Rl=|HO7(R!u+AU2r20=086*uUSedCyw~Azpo?=E5Ci!1Hg^ z^XxloKJY!jd2~(9B^Pgpp4(LOshLlKk3Cm&^OXA__g=2~+J`Z((|=uaKlOlhZ`OQ! z!i(tdV9g_+T!8hwqUN#j=)dbdHIM&K1N6-A)ckzHXQ6lhyXGIY@5MX|HE++rJeyl; zM_mK@-u<51qqD$&`qbK^|AF_@3^XV4o<(q2LC)@-6a#U^lg}1OC@2lN&Ec$!(nA*&Dt_A&kyLR6t zFF^16NbNb-oeBAHXYIM4eLwV{1+^D^wF7wERQs{-lz=ZiU3<+rX!pa_wYPl{FU|J`!1_O3Ir&e4z6e)&=0ZB?T7?*DoPc)qyy?icQZTpm~Z&EKHi z)=cg9Zy6`VaZ73+e)B=_n@iO5;Wqg!DY>fl(Jr*R?O^Q>AH(zW->-daO9t=XQTw9` zwky>BVgvZY_NLljcbo^gu(tL&!m*>Q_K!v7FV!unp5%deT{;u*&Cf7&HX$?{T{MMOhE|}v)#wBriFIOwSnG7MW}q*dE5r-g z___^i4V{F<7IC8edg+!E4ev}0jlnRh0eNF+37#9(P#AngXo20fdTYNNC*Ph+_Z1A? zEDBAQ6X)cYpu-jDZm!kcg3$4yEr5Qi07~#Xhgyy|=7(0;15DbM>c}Pc$NSRlh5lSB z-kHtCr_PP1&hAh4V1kAb>qEz&k2SKtR*JCzZ}(PApt1Z|J#EoGe;IlQ;!1&qhC!(I=rMDXg~oo{JeQ!8db5Yw=uS_do9BmZnqU zv*RR=Gf0!Uad3Acu8qu7(K zZk5=vHU!Z+{9fjndzm+~UK-84G>)v7`Q~2ckE|CLM{?t3!N_`9Xoh9s$a-01?q$)) zdRc7lW%0;*aTt(?UY3lkm*dQ^9B1lffscKS0&AHcYPRI%YRQ0BN_I0}vY=)7#gRov zSxl`pRfsE@5>Mv3`g>EEg5(2!8XpgKoEAB8fQ(BD!ldZM|C2VvHBIT?#P8w&g5$&MlJ*=ikzYa*L=0U24-(*x0KhI0&L+<@q_kkccw zqRSq(3R;513s{qJaI5WX47VJ^FT^rZ+8ys&u4?o#JDn+{x^l@LwLm`HP6{0+!KeJ6 z2MlvErfEdiALvWv+Oj?7i9|zlq~B3zD6D3>?eScp-9 z>Fm$6Qzo0b8WW0R>Wk6%_|Qh60m_TrIJ_;D@9&XnPt-T>abV#q(U7ANXB#PdUCUO{ z+LvmFSTGG44UNHyc@?e7?OAI>m|9E?O#yzFNXbPFN^2x$Tvu<;rMt43Y;Ou8#7N(9 zrQtYR8FQh4ZbHux>7i9N3TmO#$UWPaOYKXi_7l2DOR}&vnMw6Xi8s~I7pY;P#S)-I zyLQkh-QT`sE}d-ak!ppv!!aTe8VfMyp`oRl+Ter|O&uLU7$%{~D6GPKjH)yrGiIWR zrk<`;TP~^4;vIJ)I-zR081h)Futc_(X;dYebE#w@70;NEF<$mTZnzA~MU-0Vuswsy zM00;{LpKU6sU>E`K67Ng# zJz-K@bUxnUCz4P=ZN>L)^?8YFP0nfVPG-7N?q!H4+uO6b4)|`kMiz489jU%lrX$q> zpHY1J!1Vg~^aInS{W1OE^r+VM@(uAOddBEf$}0`o*3RSUd_1`?neItLEyU92vxfDa z8kzvKt;A$pJ3y|#YawiciZ*Bau>NMwvCZ5Sa7vYaCH|wyxE#1q6b_{bf77o!4~#%+ zT=<)Ms@mRjU06F-4vgIh%wejEqVq&oJFL03Y%mWq-kd_F9W=NaWE4_IjN4W6c+#Fe5$jbj@@`W?6PcUr+njJ zDwmzzneOQU^(3KP8&I=e>xh=WQ|m6=Ds^HeCf6a7q9A5qYtXSxQg6W&pjEPk_0CL} zD}G7~w469bP37ZtGaEo7Gonr4H}*F(rGMVb0Xo3}P5O2-X3xFs;M?H_#H9Y7qM%t~ zk=W%bH3C3|_05PH0I!&WgT=)jrQN#;d$QPoauao?fw+!z4jx-rxpny&1_X`+_YaQg zFv`jn-9E@enud;xxzyvnpX$S_@i+SP<7nPqhIPeY8%~=@Sh3;fQA$mVpMZ66rxYo%#;s~fI zZhP9?`gvyg4q8a;HiKn?A%c>Of@rDlGE9_BOpqj9bssJ&C&&6cYeAg3oSN%Ry@qzg-ZX-Iv>WyN)D!2&A?5H~81Ku1v%tjgiM{z!?kNva zHiM3#DFg+dl!X2HRDAwy)sLk^1qEWs_z@C^RwUepVq7ZyjTW*<0$LGK=v#;7Byngn zOPdcg!G^Qlw7*FiB_mWf0L^4TW-=3}LK#{GQX%0fN5WD-DV03eLVu*#Lc_n+N3TI$ zYM@&2+LpmFg%tPM-BNf1DPE)89nrcoh>U`tT>{b*nf z-7Xty*?QIdnAh1(3d1r?BR5Pv)V_K+XJ`zOF>Y}=W9Tx_5_lChzBIJa%A^YKP`D$z zhe{{4J9;l@mG;Oj;;6#5PbEH3f1v&#l)FB<{yJz~LpdH&Bc2&R0(YTT22Bwpb;dyYnTyrV&xtj5T*$42#LB2ua)<19?4a`0$_f9?wpPPZo+XAcL7~u|{ zXo{#%t9C@t{WCmA?o!)5HN%>(a@`WrWQX<;N&-ecnauK78r+RLh6yKK5L)T*yCFch zfZFSbaG;wNfUX14OfH377jCdY;5&U-@X<^p^}^|jr&2Jzu9CrFoELx*9Drf2bh}C@ zBn1rt>F`#ZTbz_Yg+xQTB(xa#8wtE~1Mudp=n2uvT)-j0-4;MB?LAuMj_;M5%VZZ* z1o?fGK)OwkvlV#CDL{IZxMQA>Z9a4DExsBg%0jQ)N#U|`E1jS2zC z{t(QDu2r*>;mCNp!?3A;5$IEA|N)>r*P(-W_iQP0B|20op28DlUJR4{tbrE5_cJ1TaiL6q&b@<4Toew1@N1 z3JboqS8=j}pUQOxInh$UP_%2!B1ove^QL-Ww-Tc!-#6_DnFa!QR^dJ6vP2THT-}7U zf53q7E5kX2P^FzXic=Ila}Bx6>1R~)aXUxVH`+PMPox~G1NR3Hm3b3Lie`j{MjLcHy zOsdeafxR&F%w;f4#U{lXIS|m2kQ_Tmc_HSW*sq7yTDj)l@XRDwE{fcb!^Y*7r5>Xh zShL-{Y8|{LNVqd+Q?wX+Q5%UioASfky@Gh= znvsGt)4`3*cFgu;V^iaL=Zod%U?U@)Sq?xBQyDHqB~fH6*r{rgQ>$2v@>Y6zg;f6x z{2Kh18wme-qnI?~hT_Cg#OW00Mq(`9cSnfa@n**G$m6(OshY~XEhWnpUvs6Yg5dF% zVkF!K;D`7O0|x&tk?N3JH&9&8lg(h|=Sd_=9_Hfcadi@eX$dl->S5o}7E*$aJaxca zD1hHfj}pRCseyDM-iDC2%$1dIfgOU=?~UUJh;-WSL8f*VmdKkAXcnf@)#h7*kp+_H z+ew9rq*X$VyMQJ%YI4x6VQaw!<40s*7Wts^NdQ0r+akpEgRk5jV!9HOgW_)j_6QNdM}-U9jSr1<#d&NZ+dzS%9-bxBO9taw(lr6>IDR!}A*XG!vXp7_d6@3t=`AZ@)~Wm@`bkw1f=U
H0PD?lfD!jc>9+;B@>gmJ-K zm2?3(PxJV0Pn3pyZ*qWtTgj}JkKU2J((nmx#gfutAVMPAjb;F>3>N-N9<&4qQJH(I zhzxL_sAo#rtTAyv`aedB>ZsJ`{?n-5@1R;L2a+u+^&C8p38?9I#7$)Ka2}k=arQ;w zM)9wTbg#U#RT1Mt(}7dkKO{TbcV%zCQJa-392$%A2nDyB@vN}dpj~b2>{wb+WA#bAzSZPQ_H7)#iw00IJF*q^k96ljXw>pTHnW)bfP`%+Mah zH(4)raHAe(D7JYf9K$}_9ouU)>bfun(H{8mEMvJnkJvrat zKFvt9&WRo|3&;H2*~%-orP|fuNZUx0Cbgt9IYrV8)el<5P=lEG4Q|w2$o0(HY|2_b zXgG1$2@QBGXam2ofMf)m8VtD;*#PZnO9bFAI%E_Yl+&F3sOTsU z+fY=KaWYMx=aapO`SDg-aFVnDdLh|1JD-AKA>A3$It*@>O98aX8PXX}W;=@xN!V`y zLHUywz!jj>F}#n7P>tmZxQq#(4l*nY%;p!%T_?jxPFA&&1#z5w?#@EvRW^yUJa*{M z?B3WKh^UyfAty(e^hO;(dCA;LCxgM5s|{(QRg#D+*A@`ao8i?yf~ep8E^N6|+X-n42K#z=WGJz;AQ;7JB@`4g#b)t*=#-}mSpfM&9 z-Jo&0zdMZpW3M*RQ|F5gc-RZ0<*LZk)HI4o2tSZ~7Ro(Od z{HpHNtGdUuSJQjcUQO@es_yyE?^SUM?G-zTNNEGgV)HuCl)N9@g=Tb~>66&@K`a*?vv9u8rec zV5ka!iG`yWNEi^y5J*@76@scaOd!{H#WGZn+YSR%77I`!+sRI?S22TuWwTd6r_ROs z$KaW!^-hRZ9x)hi+sOtC$Hv|ms~DK;gn1B${;qvhwmfKYPP2~IU9iC zkaIXJIGky5hf^g;FRmS04t71)H!fCBTy07sY>8lIu~JNa z@|lPcbjSx90Puqq$7(n5|2B3s*>6G|S~&+A8VqX0Odt3Y0kU*$P`MbYYdA0m>DmuB z9ni{^GuVF8WN!tB&3wnt1-wSCLWe9XVxvRz7+(+<*CSyj*>0xw=d&J}#8;5!{uRA)p_I}0`lKhc~i~P^0Oq?Br(K$KsuXA48furPG1zs&M_$Lsgo5Io9%k`qt4383{Uq3{vTUe# z560VIlnlmz{M6|-nB03|FzS?cPYxdaBB1-1F-V;rGsmV8dl_i~m?^|hic=)_G#&FQ zj(<(|UJW?7t`o!#;M(W|wn47iG28Yk2YVRju7qZ<+YY;Rc*ksWHMR+2=g>p%9Qn{Y zouPLY9eUT$L+={-(7T+WcNH0WSs;^|ijEWQAk~o5DAQOu9CTpZsf9ApN~yN;Ic4BU z27?*i;2PDmKyOD~zKp9#@FEltRcA!hIco2z1QqThFfK+1-sE`r$2IjsiS9rc1!dDo zx^eq#q-nU*rE#tDl^MCwJjm5O2BTY=ffL$+wD#=Ex=?KD#59yqk%zVM7d89={5K64 zbgmniW(F!=H*H>gAU>^;|IC+Vj!ZBPSsl&PXspaSrmw(ZAdbMPBZHn*ZkD-mCZzF2Cl9W4vrK#|_M(&IR=QbcwV7WuTmfNvvEI79LRK5|(Kpkc z8iBKB>G*I*>W^RnZ->ee#>(Kr233*MG)gQ~2mG^E7%HmSd?2zth3YhLpcNwqzpM%- zk(~Z1TUrTlIK(+w;;h*x}4Ar2eUVC(ij>%mtY=iTy}3m1l4L?WZC_&bSKV z%hJa#bz$^Lg+u#aoT9*0kZp()C-gNh{@x~pjzC+_#1&kw6TvZS{_#ZH0V7Bgpcu$h z2>``#1*U~gX=OXRa8xVYwS=TC*}iu_ie!>X{LqZ|SzEy+tg?uq*g~=dFnwzj9#klu za?O<}RW2*0Ns6glpX%vzD&4DsZ(fKat6h-#-j5+jrqkV=IaaLA=JeD84V0m@0%z%* zTE-zlK}7i9w)COh$XV#OX(|jgXm=`Oc%QQ-`3C7QoNx$nJ+ho!G|#H=fuwMIu<`_R z!Q~?P+L3^j`_fa|+SQT;txYW(Wa=OjIu^T$7nsC?fo>L~XF8#qB{ey$cT}PkX$$cr zQqv1KC!y|Miu%Bs;G-S-7nu2hePV;AsfSHX0FHs$&EuY~EKIv?#k>}oCn?))$aH31 zs2l?&y=c3};_a45MDqL!Gh3j;Vr(6EQ)yzX8}4L)TFxt%*K@Mex~&@=WF)M;KgXK@ zlm|;XK%+irsmCveS|yYDfp8|0In@=a_%;fn+qY`?T6ZF>rD|Hau!IfI6EZY*sO@ku zt$9d{GNk2t8=qL^o-=0dqRb<8wID7Xzi$1BMR&tJ&FxR$sBSEx7 zUL2CJhf=3H*I1IuI>p6vQl5?vW5@lOwqy@);_HY{j~lxMbk+=bI+|RARy3oc>W&ts zi1A*x`BMF+VZRzlq$eVQ%RP%DIN1Ii%Vg>cijc8q9B{#)1FFSyR~z6iaL^@Zr3SJ} z0T>4vCGU)JZ5`&h1Q2llP;joKoh4#^s$zEZxlOhL+3JvqqF= zohxuc2I(^e{J#%?&cXltWo_ksFu?Po6aQwAB3BS|YzSsY>)L1Fpb;{@4#Zbuc|hFt z@y5Axmqfb@g}$Y8=JayRnn!(u4u0{7|80(Pj7?716!!GX6Iwv~+faDY`L7drNd=A~PzB+s^Y2ab zV%dZuR;WF;yj}v;b}Yx1AAkwqYAnk~K4Ka8=+p~Fbz&>7;e#l!uXyzL0zC$;tb^J1 z(B+Af`qRb*(HH6X9rxaGajydtk&6$ju%`;)kt~iQsoKNivW8TlfGl~bsrf;Ulc2zu zmq=4#30f;j2?i|^;v`XU`jK=MPn=|&%A`U1arY8Yy_h>02VSmDn&~50^yxY3x4c`5 z1$@>0DgL>{aK#pxm^|-c!%bU%U(z`Fxga`9B1$rFIsB!yP#uD0GAWBJtprN(yWQ!8 zW?uf7nQomyK+R>=_wQl-G82XFz>YB8m!yu`DHV-VB{1r&ixOArP@^OV3Ky`bVkZjf zoXeKtu<9VgJ?B-tM+f|fJAu*}Lo=0@Qd!AocYy$D!{H5hk}a#wIoClPDG(RBGJfW^ zWMyf}{V0PXONfw$DN)tgT3O;>3fL@)GDE|XSwVilYC^p3B&d0Y*C((OjcXc{S}|AD zXd3uO7+iY`QCl-DsJhCQN*HenQj(uMnfi@N)pFQgEyMpjr2?%Yhgt}x{>Ix5T%G~d zve?Z$sT0H#-Ij&ppGHQvS1Tb&#pMWwq*@O(aIGMLX%8S)+;SIpLvD5A6I*oSo#EdN za6F+>lqL_$(X||1-?Db0<8AKl=#0;7=w4_%MCYH!m;dAQn1VHt=R@q-7U2I^_a98f z&bID7@aTpbFC9p89m!1z$&p}VI}Zm_9!bO%25_r_v_9;w;58l=&K5}K!sHhkH#8XN z=cUo0D3XP})L$&wWxZi@vcoswrp6@hoRG)VU~gxNiHZppw3P$~J@C2!GC%w~@Kj4gm+w9j3#8BUJ25uT1hPr~+vx#WU7 z{F2q`nS-ua9T@}*5Gq#3(U+pn&6Y2SZkJ*qCB>!P@G6uN0Bw}hbGTUWm zG&XrWPlp`f1!MV&XjAf#pz#CuA8gOox<1i;8LiRvzCF@th=OrAK4(8l@g# zwbd1jnjZQu(LA5?tQuD<0--4-0=` zJ3SDRFPH|ND)+xnhm_hYY!=MJo7feT%4DJ`AGZ>^{BSKbb*IIOq;NaJ<5}WX*Ah>1 zX{<6IT|#e>aI0}eX*4(~EY6lvoJ&hp2eCC6VhEucmZyjuJ0jd#RC8DNVtQ;{sS#PK zm%SJ@4Cf_t3HMFBUTdjjrd(IWx0Fv=W&QITn${lGmgc0ytyFZug=lb+x9D7d`+O^%&rC`x&zc+Bxc$pLMVC}~yIoYD>x^_Hy?%c@aS1SvRpf0pLN zvdRHDDBvPP2xb9TC7&h5X!X#`v0c1SdL-L%8?n;v*!q@4r@Nk1&*7N6ic=|^2EO-j!9j%lF(jg-hlNCkT*oU|Xo7ff zWfZUzAz)d(fP-)+xfL}h=2t1Zqz}@>;{6$JLwP%NdYF{7#e5!9Z8}xg9S}g0mf5cq zvqD8MV$9wpf9j~od~}vyRm_om!Dg;H+b>U3(Q>?-u;EWSHjQM-D7$Zs5!rV!jJWF; zSg}j2K770yQ+9W?{kR>tz-!oM%dKnza|&3qu7;p{n^~m4QM$jGgLL>VFQeX+>UBbN zi=?iigWlq}}fwW<_8a3Q;8*)zw?Wo7MztKvmTP%RAWImKxnAx?-cA zud27~#-iIzGTG-QQS}m$mZ~aYsk2fZjGll@NtQIFLz>PSZdke;6n5X)w8yXMVD&{A zaT#LLt1xNrEo?foNQc@Ogwi*5Xn&fbfBxdIyrb4g1E6?8WzV$f*I{5?W^LR1FpPJy zIaU75^Lkii*V!+IHd`r8Ub<-kF-lma$p$onFuf=oM!gbykYgMRfpTG3_^fd!zPf^| z<*iJ|3~nfY#_-YB@~cCKRMMQ1F$k&HuxaK>SGv}Og1!6m$o!kvK+N_CI*-gp!ofjS zKqAhgLrQAH8;nT18(T5yqK#G6V^_%5-55EzEErUz@g$y%1h!OYPVI4rQ#xUv2yX-? z0*LP51ST4~k%3~GB=!ncvJ+Xe$lS{)#Kt@}lHD@Wlv5^=x#0w?II2ow9Vzi?k5H|q zGVN5V9^Ev+du`zlk>zCDlJbsp(^QT|JGZgUO-oA};W`_jsO$|F=&JOFU^heN>;{^Y zhW*pGO+>B2(!Pp^#!0SB`-cHwuAX+4se0mcwe#C8mS;;>+EkX9FXU?3Y)t5+t)&z+ zT8I1;e3w11lsO23`p zCgK-;PnSt$mK2JJwEKb>ZCg@Cajh^m{^c1BPfn-A-7#{8q;}ZL5)#gspZSTDPis2L zKJaOkgp-_v*x<|wlgbh0H*WKSSSJMrix>K_s5nkhC~X@1O0z0SZwJ0{sn%))fmmJ# zl#CJ|xfE)_=O9saXdH&>7DPR8=?i|%T9fw6<*JVrplvbJr4P~rOYAv(hUetz65D_v zw@aj0I-uga*ti?!Y%%YDS+x!QsnSb^{%xGrwlMD{ z*Y2-c_J=#PI(RFTxi{89CJkthg_%)DTj*XGgjG)oco9jm?#`T;Q1!Z0CY3{fgK(%R zGMq`@{YpQh!BR*|*`DUOb-8SRpKXn5)7U)UE0NvCwP=#*g~}7Ic!Q(*C`n_B2>(Q+ zABlSCV(eq`7#TLlTP&x=zF7*Fdz6Zw3`^iM<+yLJVItGvljwz4!hM^>*7Ygu58iA? zidTA+3?35wN@DC{bxSHq!#qgz_YE5nnyG3LW-)w; zhDn$xlfL+ymnE_|tS(EWwPP|`B1Q)~H1lUkrl@4uZqdd*sU%@5;x7*^xiXkqz38$k zXjw#Hu^Dn6$!`>A0vADnIdBKwKBevwl(Zc$^k*0WGGnadO*>u9w~&~Tjstsz;dqdl znlGJGZj1y4BO_N!5vyb*GA>gvRWY?jxi!^UreG^Fc867gaUn~IqR-_fqxi!)F&)o4 z-X3EVw!JIAN$xYu!xCVQ*q+Ok#5j6wkYG`C9EYH12xp|pQdkWlxUF0)?fAud7n#RF zu@7-c9Pe@UUThwx;ri%eDgpaf?qq!#HJQFHfnujaW6m;kX7ifobPAy+Fulu^)Kd4i zps2sPj4PdA8ja74Hz)hj1@JrluA)LIIqFz=yFR`XA7&iScblwT%McbM9Yv)|lY^^I zy(@ROdRdE8%Ofw})`d;2w+}+{d3%=k%A9tFd^sqE&9pC8$#8;0-P$im>Qjjt4*PVj z;o+XOc({$h$sYG5ccE=6c9D;p**4>^G?@&Ea(2&EH1Di+G54a1{x6V%lL@jdfQ~n$ zOAcoDGkP=b6+mhzYJzm8W%iJ{H)CbqAfr_ka=b%SSnSB$F~OvEr#Fn7^*OmsRciGI z5z1p^KXg&h(p&=cIr+;7=%stX{Prn3I|%k9c$H+~V#$MbRGrgcu-NG+2D=~e#ol;l zPj8q%-)_};~$sFl|;A|ahXjChrA*yt2j$26{#|lEY0%{w19pkXbQABr& z2I&Xjgt?=2o~?mn+v`1}Rb|_%i+7lpqr%2^`mMch&C_dfW#JZ6#!b7!qoCW+OoKBV z8Mz%Pm07}Qw%eUDD1A?Ygt9X}q)cXEsQLJhF$PBitCjf|G&g%vT_}fbp4Ud^JV?&( z#~%5!!|5F!pe2ziv1p#(tnDxXaMu9K{>8nTij>I(-c2y*EJr~)s&%&_r8e%$PeJLz zBGfVkzB}SZ1sexfcVnj@`x=~SkiFGn`9HPohz=zIlA4`j0m|nO!6|=Zg=@_2+EMw8lA^XE^1V3 zKPFO`ZA{N|0jw&g9*}<9pg=(ddqAI(se!>gEK9@zvLG5wP!HQ}V8c1h0B683EdpC? zsG~E%>5R8H_hPIv856B@s!fiYsl2JDuRAH1P{{z-*$?Lb@E-a} z%`(Z&@J2^m1_qwux$8k6!eHo)-dXx-9Ni6pn0zOKB5_&VZ7^pv($3$1r~LR%6Rl?$2nViC5NWFQu;~ z=P&{A(>Gu>*%6 zm7_^oYT>>yc)EqrBeM<=PHd#3+b|4M`T_@X<;KN9YS*C>o-R_?G<8U|**Cn(G$j}I zoX<6O!~>8#DQfJ9@QjhT+F%njuclT<1)a#%sKhpD@Uc#RFK*T}0Y#kfgt9(4BBQ9T zwQnU1(50m@>YES`921}P*eX5C+qyi_TF9zn)ZU#$0_0B8M}_qL?Nrj#L~sGL4Ma_1 zR~9#$4>E}h5Te(oNhAp9$F;-dC;C&Be}ak}L0&3DS@ISu@CFr1W5|j!QYm`8tK@im z!&o&hWFimY`8}zGLS)w={cVva{cW~YSQXA@oD`Crgqem&6Y4=GVitCIF4aXVv~KMp zl?CU+=|GX4NtY-+;w>N_I$H>eN`>HbEJgsrvSOifI-G>835@S~FjG}pruNJFCn_qY z(Cxmjvr%ynSE+ee%<|$|NkbNI!KA$R{P^Z^R*`wQI1Jz(bXLBcU?=CW*@N<#5?-B@ zO>EnM=`>-PcGzsh_gXk+6dpHX|7hY-_cCMY#pyVb$&pp@gg8R~#J8FSk3%rN+2~@x zQ(EMGEQqX~j@)wup}Vl=Al-R$;e_bQrL5d}AGS^y5{d$#;1ST|upyc1KmsoeLSe&% zr9tu*rhd@Q;U<-HlzUtr2vJ3_@H;gzr#{A*mRu578g<1BXy}z#`Qxi^W`w2wXAKzsbNP%Gzfr;cE~sfkhPV5?18N!^ zig!Rw4kRO@rg4y*3xJa)q4`+fMlgPwA5OiT=%y@EG!r;R<+rk zukJLoXKf`{`_M{^Pr(4clD(=`3IZABHgw?u0nHob0chB$1YZ@S+gW9ZVj@n_V0vCA<*z_xZr-PEp-6;pl`Ra3m>s zgwXi#187L{?jbRTA=U!IkhTT(?Cw4iaj_$qLv99g(wZ2AY; za3Q+j*5UzL$#d=T*|-O1W(|!e$P@Ndkcum?5fsi%z;$g>oG*nSGq%P8v4G!P$IU49 zOj>CjJM+mL~%mmp^*0I@y zjQ&9P#H~TprzstAoR9uy2ClTO)R$~e871VwK_;wFxSIM9rbTJ)4sK4zElwE;D08_~ zq)M)vch&Hl4tdD@H7Vic{m=G#F4mJny`e(Csx~t{i_#?1b&x|&E0^M;t1QmCwZ|E! zQzO+Ju9EZ#*h7Ss&19gM@!l2ym)QhvVOC|?TScT9NX{Y*?S^QCrog*KT++zuqKH77 zXz0Rb+4dY_Rwu<|nh6k#$=ZEXT74MB+RuVEBhaB-i`u=x<1TJ;<&klon~jGK2g$2b zw=9UjtwIf)u^bv9`yp0`glp;Nr==5Rv z@KlOXvab&zag+2(fSVl+$hfEI?$KJL7uL=8LRGb<639(uz{|uW?=#rO-o!0g_kmKF!Otr-6xC8?eOm)$^n( zJYqaB2cMcO)XbV!^A6p+r`c+9&A^rK8_ zej?4AJgJVN<<&6fdggzccmB%9r?Z^NYQaBj97OAKRyJNeQMl$lI>h&5Ja3WiH))SD(JwO>rk&XiLwS(7Yo8v(RT@#Ipu@)U+3 z#Okf-~)^ilTcRtbMcHh+Q-2o4!qLwe`$T9?tXE2KPVYPs)HCRUT67Wu!#NII#w|TeaF9MBCDZUfiUyW^1dl2Qn&m+LWP( zeJWkb+ynh-q_hR1K`xRylIl34DtP_Ci78blgog-S88I6XfGm2s0e;cqieV4sxwIn) zKs`ML+RAoE-)C|}Suuvy=yeGiEyI%X>OY!e;1I-!tbO7F>dZlbqEOQHNF1P)@kobp z&{<65lSpN31_p<{Fm+xq<>_rJnM(PH$-(FyHUT+g&V_$g6AhZAojYN}RAohrI*~wO z8g{Gl615C0hnMVFS0;_(#3+q$C|B@w8h3hlR1mPGRJlK zX6$_k>zA08#+up|3-LZHUrP3kr&oGWB018{(e0PDr1Qx(1WG#Le6W>5J8Qk+u9+`?DOB3j`}>!BWtn2xr=&Yfo^=SU+S~Y_-Lzs2!awPJci=7T174^NEMXga+$B!iwa5T2vXN)HFYJJ> z!1ZBH4nt9-d{$rEClA9o^gl*s>B!PQ@w%A}`#O7#ls?gy@S~RA3Y^-&MK|=apodPB z@T0%RqFb7*(8cX$5zI&8(1ef)p*i3&sGbEP(KU*#@+Wo&qcJNsi&pZ zfe(5FojNltgwENlRQaPA#hV)_D{I&z9m!IAnu#H%m_ar?R9Sd-Oe03^Y$eAVTd}#n zx6P`9??;d^CCUHNP^s?z_gOB8DY0}B6N$PyADkWdL>-Xo2@_`=9&*^$BvTN9OnKT* zl80%6{=OZWlfB~%8SC41^XeEIg_G^Rk$RAeZ^B5ZwL)GaYd9I%R--g5$??cfwCjWF z9W@e5aLU6k+>qR4BRl%teZsgqj56N9TO(&tCY7iiLXLu8m3xM?&0I+d_$f=iicA3$;u=u1l zqR)IPX@+b9*t&v@**3F9YgV;tqx{auyb-nc1NzvOi2#{w_08Hr89d2z)nPoYSkaN8x;i_@=7gq z7NPPa^wE~HvK2f4O%dA+08!_lFW-l?ZRn;qnairYRZl--!NL?E+!~B!07EtzMo&gd z=ppGYS>DUjGA>TFS}KRwY9N9H9i*k|Q_+ibbs33C-h?RkDsjoEByr-!X5~(Fk?ld` zFo4P!wh%cOln}AghCIy654(c&Ujz6k0=ennFSg$=M};P(ZFwd+2AxytvfvaC^|_l= zNP{6Q?|kz%5^XkS0t}}O6ETvQ%Ch77(I=`7OPXPg^70&<0W|?U4v|l_o@Ppqv}64C z14{4kK+Ozv(hs#*>Z%;uQLn=7>0G;E*G-kAuk-tuVHfPhQ2?t{FL2eW^j;4DHFC@I zOef{5Q$0P@kyJ*F=j{pJw?TN^gWeU2u%&S<8P@Z?U1kExdC{3g2ro*t#{La)zBi(3a+>2wyUaJ*L zzWCX14@pjBOiyywK_yimVDCt!`izn)0_-zT z(_{}D>g(wblK%v8wlx;z8EtWH11}eko{f>R_Gu#ztmAM>O2KLtVih^Gh3_nYw+Mz~ z28eTiVR^1Q+uIg+F(%>ipTh`gw}KZM?mDnQeHxYm0}Ro|K{UUY2i9}hd=L{8rKV5u zqFiBS>W$`mRk1t+`Le!&5>SR7jGV5<>CMRRMge+t+0uHfjJv*CIpSpM{DKDo5r9uw z;M~I)lP|`L$N}ZCRZFLGyY%MuuTGWf$Gk@BzBp4iOF>IAyo-OGb+CZSpWTnxMPS8g zY0!=*J$ivsDu9(Li|7~a6M8ZHIW~tWU|}Gud}f_%GfWMZ$F#8FB1>A2_YE79ONakFeTAG8 zx7DgQlxQ>V*h!kl4be?ZcVpy$5velai4@P2$3aseKk-qY-72D~EkMt- zW(_S3bX%?akcppxj;0LKk)JZ1u8cHE1+W-QLE5Xa;WAU*V1W6ltIF=nKvxM|YNf=9 zGWw~H3?>9?`XOGZm+wpC+>DHmcouDp*l+bmYZ65?T()xMezZm9Z&mEV(`>9bU^UZ9 zp}S%902&@h^;p$6JS~SljvkSR|4_7z%Zt1$H~?Ldt~z=DmoBSK9~4)^5H@z`PWIQ5 zlBXa8{f&1WaK{|bpJn#h?cK-P4b3N^0iDI(AdPb@F@nm6$)1+9ET0%?KQS;JCt2OG z;wo3eIdv+t(TzB%fzw~=({iUe#!Ym!q()S~lhQmeIDO+1c-OJ%aC1C~!jHyrh78~Z zMu>!%>+e<)%bT-3>bj`F%MF%W%_@QfoGRBO!)7`^irmm&OZo_T`4jR9QFtr|YPHUa zNx2yqgeMVbhoMLsy0VL5xJ>2{V?4(B`_FNkT1VKLwPKAu;94%YZ5T|X|BxDsGKHa! zfyq0j*eF*$I{U6L?_4|%!_o~c#_?)oBwzvd2$ASeM)}5MTS~h1yq#jl@tC_W70BKS z5qY??*w)-52Mg5HkyE4zE0qz;%}N?v97=hIS6!Nz~ntA8$i6OF`6^ z#XXtK@v;h*v>~>I(}JlEWSVwmn8=-0hZF+S^`?o+Rlv$n6q9as#*nj}Yt(>w*Bx$w zK1azM3Epx8{CRb*j!MMjf*vs)A|)Wt&iB4v7;J{uN*Y~(cywFHhR64jZC4Z zYQs>yv=LBbv%s;fD#PfYvJs$hGK8Ug@pM=dz3%F;;VocPDwQUHOx7p&diNbN4z(h@ zU>tG0Z$ug%bfh?;rSewZwrgyxhUCs%fg}!+t)p_WnG%QwNGGGg0!U;vntMY>TKn6! z<2ZRS###qlTbF~|#1h$V-3M+2avYK))agR=#p2bvHR1ruj}icQQphzdmW6hq4x_+x zZv#?ecg6UKG*ttAML}~!v3t_x#b=CrpD-YGUgtiT%I#SzR&1QGztVPqEYP6~6*lx^ zt(y`^E1*@J!YQ_Z{#)FS_VH&%C_Qq%ok z>oj?7mg*ANQ8eu(UoFB8N1?5Y9r|06Cl+am()s|G`7R9YdF$m>VN@-4jO$XQyhea1 zCRx#I%XNrd=%i@DB#_p?OJc~ zfjhXW>3dmKU33@R)>#Pdq@^mUtHQH~dqj;WnyA%VPzbGknj=kMp$yGBP{&j^`S$LV zX2d>l>U2L`d>N8a>M8l7CwJV&#CX{!s&-0eF>91q$>2sfsRo){%@r;1GFvHyfh8DP zQ;y1PsKFL-0)|~BH?5Nj7TbWrqqrHbcsr(NIy$;?bGvi)q8m{PbCC8mNZX@=Nj=+5 zKB}EO)oVmkOzLg4q!1&pQC+?X@oJ0p`qs^ufn-1=1<3+zLWUlgA;knEx4|6QvM-fm zeNQ7;V~}d&tL$t8HwtI@P;r@w6sjhxu?M9MA``Qs%6D-BT%IJ~wJZF$yPS*zytrVw& z%9Ar-HAM-5l7c!Gxw#}DpunY%*wY_5jK*Ywp@l!Yaa1-gzBw87 z0X5t2m*WO1t%Umq7>T_1HI0J8{2sfIcGLxEt7s%D@MaAC2Hkh%w%0DuAS}hdYr6eh zBI7PAUSi6ocN=R~Jt!8{WM7peSf@x9>o`recAGmiU!LH_K!ye^W<(~V?#X5fC=X{+ zczRDCR43LV?P1Qgl&s8Nq@&8^hFyI*O{$&5f#3@K|Ta(R3=Ck=cbr#vW;N`^MxwC{D3>auaHq-gMhq zCW!Nxx2t-bubXbUk%E=Q7$tNrS!AA3Jw_HCpfpmY7~T0CmCgMLRjbwj6OT=KnsEjGgKM(stfpg|<^gPJKS3}jwNf_L{sCV@<+M>8#pNlr zNdb+qD|pn@fNFL5#&MGTned==V}0`s@2GI}#`brRz z<1DROi%VXR8{LQ8XhY+X+yhdx&Z?7#g|n_I@?m8ZXozZoo%CztBdqiQ0|dMLZ9sQ4 zD)nLC<;X)olAlDAgEBfg>FlNfKtCSxGfA)b&*31BBXqu{g~%FXtP$@Z6e;&IJspw@ z3Q-E_&Fw7HtI}7C83Hl!#8M8c@*>eF;GXgy`P6@OuMyiI6ZoJ z%ou;KMh5dv%J2IoJH@h>IX$YAOz-iofPN@%E2m`CCk+bv^z4OSJ zQ#|}@mLuV1G7e>ny#Cx@8SWG#3uDzNtv!3xRM*arvZA45$oZD%-Bs-IGgMZ&QHnEN z8dQ)};B~kad%XRPuwsw5G5LYYLeosmf1;U=1nzW-IM@qIe9=TavDj4DLNk~P={FX)+ zERDmtW?I@P4n3k|01l79ZbKa|7T`iPVr~lDQzEy8Ovd*S39GPZEz6|=LjQDhK)Bp` z;Gv2q%v#_w*@e5XEsxkyjdZbje8Yq%rDEEW)HRKX)*w_B(;1xAQ3rIS_uT~e$Vas$ zpKH`fhEbI?q*OPJyHQ%9V0dy5sQGwny*M+6l*PPNj-gH&bLq$~I2Oyg6CJ8#3(t4( zsF$w0EQ=&T8N!{WxT6^XBOLiqhb&A0J~a#gd6%rr#{+n*=}XrvWA`2vUIq`{3O-|? zl)Jnj%X9Y;%HilcV<_y@JIZ#VSC)BHYWh@UNEXaE(6K`91m|X3eLtzoE(h0jsJ-2f zC|%HI5F`zGQ^J&n9g_kZ>-J99wy59PS6nbQ#sDq0vri zqUPj%9pOP(OtYF`?hqfYt(!6fK1uje6; zy;uU~MC%pEXOV_rlws~$=5^YLm%)*^$P1L#XKPW^jy%$Jtw*9J{Bta@$_{|%p?qE2 z$_UZ_p<{zSN$9VRZ_g5I=9;6ea_TGCIfG(;9DkohZ1_N*w*7955ntKJ-X!IGpgPmTN?Uzee|&Z4Pr-@N&o-= literal 0 HcmV?d00001 diff --git a/udav/udav_ru.ts b/udav/udav_ru.ts new file mode 100644 index 0000000..529a9fc --- /dev/null +++ b/udav/udav_ru.ts @@ -0,0 +1,4425 @@ + + + + + AnimParam + + UDAV - Animation setup + UDAV - Параметры анимации + + + Redraw picture for $0 equal to + Перерисовать для $0 равного + + + strings + strings in lines + строкам + + + values + числам + + + from + от + + + to + до + + + with step + с шагом + + + Cancel + Отмена + + + OK + OK + + + Put to script + Вставить в код + + + Delay (in ms) + Задержка (в мсек) + + + Export to GIF + Экспорт в GIF + + + Save JPEG frames + Сохранить кадры в JPEG + + + UDAV - animation + UDAV - анимация + + + You should select one of case + Вы должны выбрать строки или числа + + + + ArgsDialog + + UDAV - Set script arguments + UDAV - Аргументы программы + + + String for $1 + Строка для $1 + + + String for $2 + Строка для $2 + + + String for $3 + Строка для $3 + + + String for $4 + Строка для $4 + + + String for $5 + Строка для $5 + + + String for $6 + Строка для $6 + + + String for $7 + Строка для $7 + + + String for $8 + Строка для $8 + + + String for $9 + Строка для $9 + + + String for $0 + Строка для $0 + + + Cancel + Отмена + + + OK + OK + + + + CalcDialog + + Result + Результат + + + To script + В код + + + Clear + Очистить + + + Put function + Вставить функцию + + + Basic + Базовые + + + Exp and log + Exp и log + + + Trigonometric + Тригонометрические + + + Hyperbolic + Гиперболические + + + Bessel + Бесселя + + + Elliptic + Эллиптические + + + Jacobi + Якоби + + + Airy and Gamma + Airy и Gamma + + + Exp-integrals + Exp-интегралы + + + Special + Специальные + + + + DatPanel + + &Data + &Данные + + + - UDAV variable + - UDAV переменная + + + - UDAV preview + - UDAV просмотр + + + UDAV - Import PNG + UDAV - Импорт PNG + + + Data files (*.dat) +All files (*.*) + Файлы данных (*.dat) +Все файлы (*.*) + + + UDAV - Export to PNG + UDAV - Экспорт в PNG + + + Enter color scheme for picture. +Note that data will be normalized in range [0,1]. + Введите цветовую схему рисунка. +Данные будут нормированы в [0,1]. + + + PNG files (*.png) +All files (*.*) + PNG файлы (*.png) +Все файлы (*.*) + + + Enter color scheme for picture + Введите цветовую схему рисунка + + + UDAV - Save data + UDAV - Сохранить данные + + + UDAV - Load data + UDAV - Загрузить данные + + + UDAV - Fill data + UDAV - Заполнить данные + + + Enter formula for data filling. +Note that variables x,y,z supposed to be in range [0,1]. + Введите формулу для данных. +Переменные x,y,z меняются в интервале [0,1]. + + + Enter range for data and direction of filling + Введите диапазон и направление заполнения + + + From + От + + + To + До + + + Direction + Направление + + + UDAV - Normalize data + UDAV - Нормировать данные + + + Enter range for final data + Введите диапазон результата + + + Symmetrical? + Симметрично? + + + UDAV - Normalize by slice + UDAV - Нормировать по срезам + + + UDAV - Clear data + UDAV - Очистить данные + + + Enter new data sizes + Введите новые размеры + + + X-size + Размер по X + + + Y-size + Размер по Y + + + Z-size + Размер по Z + + + UDAV - Resize data + UDAV - Изменить размер данных + + + UDAV - Squeeze data + UDAV - Сжать данные + + + Enter step of saved points. For example, '1' save all, '2' save each 2nd point, '3' save each 3d and so on. + Введите шаг сохраняемых точек. Например, '1' сохранить все, '2' каждую вторую точку, '3' каждую третью и т.д. + + + X-direction + X направление + + + Y-direction + Y направление + + + Z-direction + Z направление + + + UDAV - Crop data + UDAV - Обрезать данные + + + Enter range of saved date. + Введите интервал сохраняемых данных. + + + UDAV - Rearrange data + UDAV - Поменять размеры данных + + + UDAV - Transpose data + UDAV - Транспонировать данные + + + Enter new order of dimensions. +For example, 'yx' or 'yxz' for transpose x-y, 'zyx' for transposing x-z and so on. + Введите новый порядок размерностей. +Например, 'yx' или 'yxz' для транспонирования x-y, 'zyx' для транспонирования x-z и т.д. + + + UDAV - Smooth data + UDAV - Сгладить данные + + + Enter direction(s) for smoothing. +Optionally you may enter the kind of smoothing by 3 or by 5 points. For example 'xy3' - smooth only in x and y directions and use 3-points scheme. + Введите направление(я) сглаживания. +Можно также ввести тип сглаживания по 3 или по 5 точкам. Например 'xy3' - сгладит только в x и y направлениях по 3-точечной схеме. + + + UDAV - Summarize data + UDAV - Суммировать данные + + + Enter direction(s) for cumulative summation. +For example 'xy' - summate along x and y directions. + Введите направление(я) для суммирования. +Например 'xy' - суммировать вдоль x и y направлений. + + + UDAV - Integrate data + UDAV - Интегрировать данные + + + Enter direction(s) for integration. +For example 'xy' - integrate along x and y directions. + Введите направление(я) для инткгрирования. +Например 'xy' - интегрировать вдоль x и y направлений. + + + UDAV - Differentiate data + UDAV - Дифференцировать данные + + + Enter direction(s) for differentiation. +For example 'xy' - differentiate along x and y directions. + Введите направление(я) для дифференцирования. +Например 'xy' - дифференцировать вдоль x и y направлений. + + + UDAV - Laplace transform + UDAV - Преобразование Лапласа + + + Enter direction(s) for laplace transform. +For example 'xy' - do transform along x and y directions. + Введите направление(я) для преобразования Лапласа. +Например 'xy' - преобразовать вдоль x и y направлений. + + + UDAV - Swap data + UDAV - Поменять местами + + + Enter direction(s) for swapping (exchange left and right parts). +For example 'xy' - swap along x and y directions. Useful for Fourier spectrum. + Введите направление(я) для обмена левой и правой частями данных. +Например 'xy' - меняет вдоль x и y направлений. Полезно для Фурье спектров. + + + UDAV - Mirror data + UDAV - Отразить данные + + + Enter direction(s) for mirroring. +For example 'xy' - mirror along x and y directions. + Введите направление(я) для отражения. +Например 'xy' - отразить по x и y направлениям. + + + UDAV - Sum along ... + UDAV - Сумма по ... + + + Specify direction(s) of summation + Введите направление(я) суммирования + + + UDAV - Max along ... + UDAV - Максимум по ... + + + Specify direction(s) of maximal values + Введите направление(я) поиска максимумов + + + UDAV - Min along ... + UDAV - Минимум по ... + + + Specify direction(s) of minimal values + Введите направление(я) поиска минимумов + + + UDAV - Momentum along 'x' + UDAV - Момент по 'x' + + + Specify which momentum evaluate. +The momentum is res_i = sum_jk how(x_i,y_j,z_k) a_jk/ sum_jk a_jk. +Coordinates x, y, z are data indexes normalized in range [0,1]. + Укажите какой момент вычислять. +Момент равен res_i = Σ_jk how(x_i,y_j,z_k) a_jk/ Σ_jk a_jk. +Координаты x, y, z находятся в диапазоне [0,1]. + + + UDAV - Momentum along 'y' + UDAV - Момент по 'y' + + + Specify which momentum evaluate. +The momentum is res_j = sum_ik how(x_i,y_j,z_k) a_ik/ sum_ik a_ik. +Coordinates x, y, z are data indexes normalized in range [0,1]. + Укажите какой момент вычислять. +Момент равен res_j = Σ_ik how(x_i,y_j,z_k) a_ik/ Σ_ik a_ik. +Координаты x, y, z находятся в диапазоне [0,1]. + + + UDAV - Momentum along 'z' + UDAV - Момент по 'z' + + + Specify which momentum evaluate. +The momentum is res_k = sum_ij how(x_i,y_j,z_k) a_ij/ sum_ij a_ij. +Coordinates x, y, z are data indexes normalized in range [0,1]. + Укажите какой момент вычислять. +Момент равен res_k = Σ_ij how(x_i,y_j,z_k) a_ij/ Σ_ij a_ij. +Координаты x, y, z находятся в диапазоне [0,1]. + + + UDAV - Make histogram + UDAV - Найти гистограмму + + + Number of points + Число точек + + + Put in variable + Поместить в переменную + + + Cancel + Отмена + + + OK + OK + + + UDAV - Change data + UDAV - Изменить данные + + + Enter number for adding to data elements: + Введите число для добавления к элементам массива: + + + Enter number for subtraction from data elements: + Введите число для вычитания из элементов массива: + + + Enter number for division of data elements: + Введите число для деления элементов массива: + + + Enter number for multiplication of data elements: + Введите число для умножения элементов массива: + + + UDAV - Go to slice + UDAV - Перейти к срезу + + + Enter slice id: + Введите номер среза: + + + NOTE: All fields must be filled! + Все поля должны быть заполнены! + + + Enter the name for new variable + Введите имя новой переменной + + + &File + &Файл + + + &Load data + &Загрузить данные + + + Load data from file. Data will be deleted only +at exit but UDAV will not ask to save it. + Загрузить данные из файла. Данные будут удалены при +выходе, но UDAV не спросит об их сохранении. + + + &Import PNG + &Импорт PNG + + + Import data from PNG picture with specified color scheme. +Data will be deleted only at exit but UDAV will not ask it saving. + Импортировать данные из PNG рисунка с заданной цветовой схемой. +Данные будут удалены при выходе, но UDAV не спросит об их сохранении. + + + &Save data + Сохранить &данные + + + Save data to tab-separeted file. + Сохранить данные в текстовый файл с разделителем табуляцией. + + + &Export PNG + &Экспорт PNG + + + Export data to PNG picture. The colors defined by +specified color scheme. The same as in 'dens' command. + Экспортирует данные в PNG рисунок. Цвета определяются +указанной цветовой схемой. Рисунок аналогичен команде 'dens'. + + + Plot &data + &Отобразить данные + + + Plot data in new script window. You may select the kind +of plot, its style and so on. + Отобразить данные в новом окне. Вы можете +выбрать тип графика, его стиль и т.д. + + + Copy &data + Копировать &данные + + + Copy range of numbers to clipboard. + Копировать диапазон чисел в буфер обмена. + + + Paste &data + Вставить &данные + + + Paste range of numbers from clipboard. + Вставить диапазон чисел из буфера обмена. + + + &Navigate + Пере&ход + + + &First slice + &Первый срез + + + Go to the first data slice for 3D data. + Перейти к первому срезу 3D данных. + + + &Prev. slice + &Предыдущий срез + + + Go to the previous data slice for 3D data. + Перейти к предыдущему срезу 3D данных. + + + Go to the specified data slice for 3D data. + Перейти к указанному срезу 3D данных. + + + Go to slice + Перейти к срезу + + + Next slice + Следующий срез + + + Go to the next data slice for 3D data. + Перейти к следующему срезу 3D данных. + + + Last slice + Последний срез + + + Go to the last data slice for 3D data. + Перейти к последнему срезу 3D данных. + + + &Sizes + &Размеры + + + &Create new + &Создать новые + + + Recreate the data with new sizes and fill it by zeros (Ctrl+N). + Создает заново данные нового размера и заполняет их нулями (Ctrl+N). + + + &Resize + &Изменить размер + + + Resize (interpolate) the data to specified sizes (Ctrl+R). + Изменяет размер (интерполирует) данных в указанному (Ctrl+R). + + + &Squeeze + С&жать + + + Keep only each n-th element of the data array. + Сохраняет каждый n-ый элемент массива данных. + + + Cro&p + О&брезать + + + Crop the data edges. Useful to cut off the zero-filled area. + Обрезает края данных. Полезно для удаления заполненных нулями областей. + + + &Transpose + &Транспонировать + + + Transpose data dimensions, like x<->y or x<->z and so on. + Транспонирует массив данных, типа x<->y или x<->z и т.д. + + + Re&arrange + По&менять размеры + + + Rearrange data sizes without changing data values. + Меняет размеры данных без изменения самого массива данных. + + + &Modify + &Изменить + + + By &formula + По &формуле + + + Change data values according to formula depended on 'x', 'y' and 'z' +variables. A set of special function is availible also. + Изменяет данные по формуле, зависяещей от переменных 'x', 'y' и 'z'. +Поддерживаются также многие специальные функции. + + + Fill in &range + &Распределить + + + Fill data equidistantly from one value to another. + Распределить равномерно данные от одного значения до другого. + + + &Normalize + &Нормировать + + + Normalize data so that its minimal +and maximal values be in specified range. + Нормирует данные так, что их максимальное и +минимальное значения равны заданным. + + + Norm. s&lices + Норм. по &срезам + + + Normalize each data slice perpendicular to some direction +so that its minimal and maximal values be in specified range. + Нормирует данные по срезам перпендикулярно +заданному направлению так, что их максимальное +и минимальное значения равны заданным. + + + &Smooth data + С&гладить + + + Smooth data by one of 4 methods along specified direction(s). + Сглаживает данные одним из 4-х методов вдоль заданного направления(ий). + + + &Operators + &Опраторы + + + &Cum. sum + &Суммировать + + + Summate data values along specified direction(s). + Суммирует данные вдоль указанного направления(ий). + + + &Integrate + &Интегрировать + + + Integrate data values along specified direction(s). + Интегрирует данные по заданному направлению(ям). + + + &Differentiate + &Дифференцировать + + + Differentiate data values along specified direction(s). + Дифференцирует данные по заданному направлению(ям). + + + &Laplace + &Лаплас + + + Double differentiate data values along specified direction(s). + Дважды дифференцирует данные по заданному направлению(ям). + + + &Swap + &Поменять местами + + + Swap left and right data part along specified direction(s). +This operation is useful for data after Fourier transform. + Меняет местами левую и правую часть данных вдоль указанного направления(ий). +Операция полезна для данных после Фурье преобразования. + + + &Mirror + &Отразить + + + Mirror left and right data part along specified direction(s). +This operation do like index change from 'i' to 'n-i'. + Отражает данные относительно указанного направления(ий). +Действует как замена индекса 'i' на 'n-i'. + + + &Algebraic + &Алгебраические + + + &Add + &Добавить + + + Add a number to all data values. + Добавляет число к элементам массива данных. + + + &Subtract + &Вычесть + + + Subtract a number to all data values. + Вычитает из элементов массива данных число. + + + &Multiply + &Умножить + + + Multiply all data values by a number. + Умножает элементы массива данных на число. + + + &Divide + &Разделить + + + Divide all data values by a number. + Делит элементы массива данных на число. + + + A&nother data + &Новые данные + + + &Sum of + &Сумма по + + + M&in of + М&инимум по + + + M&ax of + М&аксимум по + + + Momentum along &x + Момент вдоль &x + + + Momentum along &y + Момент вдоль &y + + + Momentum along &z + Момент вдоль &z + + + &Histogram + &Гистограмма + + + + DataOpenDialog + + UDAV - Open data file + UDAV - Открыть файл данных + + + Data name + Имя данных + + + Auto detect data sizes + Автом. определение размеров + + + Set data sizes manually + Задать размеры вручную + + + Nx + Nx + + + Ny + Ny + + + Nz + Nz + + + Matrix with sizes from file + Матрица с размерами из файла + + + 3D data with sizes from file + 3D данные с размерами из файла + + + Cancel + Отмена + + + OK + OK + + + Auto detect data sizes (%1 x %2 x %3) + Определить размер автоматически (%1 x %2 x %3) + + + default + по умолчанию + + + UDAV - Insert filename + UDAV - Вставить имя файла + + + MGL files (*.mgl) + Файлы MGL (*.mgl) + + + Template + Шаблон + + + + FilesDialog + + UDAV - Set script arguments + UDAV - Аргументы программы + + + String for %1 + Строка для %1 + + + String for %2 + Строка для %2 + + + String for %3 + Строка для %3 + + + String for %4 + Строка для %4 + + + String for %5 + Строка для %5 + + + String for %6 + Строка для %6 + + + String for %7 + Строка для %7 + + + String for %8 + Строка для %8 + + + String for %9 + Строка для %9 + + + Cancel + Отмена + + + OK + OK + + + UDAV - Set template parameters + UDAV - Параметры шаблона + + + + FindDialog + + UDAV - Find + UDAV - Найти + + + Find &what: + &Что найти: + + + Replace &by: + З&аменить на: + + + Match &case + Учитывать &регистр + + + Search &backward + Искать на&зад + + + &Find + &Найти + + + &Replace + &Заменить + + + Close + Закрыть + + + + GraphWindow + + Printing... + Печатаю... + + + Printing completed + Печать завершена + + + Printing aborted + Печать прервана + + + Drawing time %1 ms + Время рисования %1 мсек + + + Frame %1 of %2 + Кадр %1 из %2 + + + Graphics + График + + + &Graphics + &График + + + &Alpha + &Прозрачность + + + Switch on/off transparency for the graphics (Alt+T). + Включить/выключить прозрачность графика (Alt+T). + + + &Light + &Освещение + + + Switch on/off lightning for the graphics (Alt+L). + Включить/выключить освещение графика (Alt+L). + + + &Grid + &Сетка + + + Switch on/off grid drawing for absolute coordinates (Alt+G). + Включить/выключить сетку абсолютных координат (Alt+G). + + + &Rotate by mouse + &Вращать мышкой + + + Switch on/off mouse handling of the graphics +(rotation, shifting, zooming and perspective). + Включить/выключить изменение графика мышью +(вращение, сдвиг, приближение и перспектива). + + + &Zoom by mouse + &Приближение мышью + + + Switch on/off mouse zoom of selected region. + Включить/выключить приближение выбранного региона. + + + Res&tore + В&осстановить + + + Restore default graphics rotation, zoom and perspective (Alt+Space). + Восстановить вращение, масштаб и перспективу по умолчанию (Alt+Space). + + + Re&draw + Пе&рерисовать + + + Execute script and redraw graphics (F5). + Выполнить код и перерисовать график (F5). + + + &Adjust size + &Подобрать размер + + + Change canvas size to fill whole region (F6). + Изменить размер рисунка так, чтобы он заполнял всю область (F6). + + + Re&load + Пере&грузить + + + Restore status for 'once' command and reload data (F9). + Восстановить статус команды 'once' и перегрузить данные (F9). + + + &Stop + &Остановить + + + Stop script execution (F7). + Остановить выполенение кода (F7). + + + &Copy plot + &Копировать график + + + Copy graphics to clipboard (Ctrl+Shift+C). + Копировать график в буфер обмена (Ctrl+Shift+C). + + + Set value of \theta angle. + Установить значение угла \theta. + + + Set value of \phi angle. + Установить значение угла \phi. + + + &Export as ... + &Экспорт в ... + + + bitmap EPS + растровый EPS + + + vector EPS + векторный EPS + + + Zoom/move + Масштаб/сдвиг + + + Zoom graphics + Приближение графика + + + Move &left + Сдвиг в&лево + + + Move graphics left by 1/3 of its width. + Сдвиг графика влево на 1/3 его ширины. + + + Move &up + Сдвиг &вверх + + + Move graphics up by 1/3 of its height. + Сдвиг графика вверх на 1/3 его высоты. + + + Zoom &in + &Приблизить + + + Zoom in graphics. + Приблизить график. + + + Zoom &out + &Отдалить + + + Zoom out graphics. + Отдалить график. + + + Move &down + Сдвиг в&низ + + + Move graphics up down 1/3 of its height. + Сдвиг графика вниз на 1/3 его высоты. + + + Move &right + Сдвиг вп&раво + + + Move graphics right by 1/3 of its width. + Сдвиг графика вправо на 1/3 его ширины. + + + &Animation + &Анимация + + + Animation + Анимация + + + &Next slide + &Следующий кадр + + + Show next slide (Alt+Right). + Показать следующий кадр (Alt+Right). + + + &Prev slide + &Предыдущий кадр + + + Show previous slide (Alt+Left). + Показать предыдущий кадр (Alt+Left). + + + &Slideshow + &Запустить + + + Run slideshow (Ctrl+F5). If no parameter specified +then the dialog with slideshow options will appear. + Запустить анимацию (Ctrl+F5). Если параметры не были указаны, +то показывается диалог с параметрами анимации. + + + Se&tup show + &Настроить анимацию + + + Switch on/off transparency for the graphics (Ctrl+T). + Включить/выключить прозрачность графика (Ctrl+T). + + + Switch on/off lightning for the graphics (Ctrl+L). + Включить/выключить освещение графика (Ctrl+L). + + + Switch on/off grid drawing for absolute coordinates (Ctrl+G). + Включить/выключить рисование сетки абсолютных координат (Ctrl+G). + + + Restore default graphics rotation, zoom and perspective (Ctrl+Space). + Восстановить вращение, масштаб и перспективу по умолчанию (Ctrl+Space). + + + &Copy click coor. + &Копировать коор. + + + Copy coordinates of last mouse click to clipboard. + Копировать в буфер обмена координаты последнего щелчка мыши. + + + Show next slide (Meta+Right). + Показать следующий кадр (Meta+Right). + + + Show previous slide (Meta+Left). + Показать предыдущий кадр (Meta+Left). + + + Set value of \theta angle. +You can use keys (Shift+Meta+Up or Shift+Meta+Down). + Изменить значение угла \theta. +Можно использовать клавиши (Shift+Meta+Up или Shift+Meta+Down). + + + Set value of \phi angle. +You can use keys (Shift+Meta+Left or Shift+Meta+Right). + Изменить значение угла \phi. +Можно использовать клавиши (Shift+Meta+Left или Shift+Meta+Right). + + + Rotate + Вращать + + + Rotate up + Вращать вверх + + + Increase \theta angle by 10 degrees. + Увеличить угол \theta на 10 градусов. + + + Rotate down + Вращать вниз + + + Decrease \theta angle by 10 degrees. + Уменьшить угол \theta на 10 градусов. + + + Rotate left + Вращать влево + + + Increase \phi angle by 10 degrees. + Увеличить угол \phi на 10 градусов. + + + Rotate right + Вращать вправо + + + Decrease \phi angle by 10 degrees. + Уменьшить угол \phi на 10 градусов. + + + + HelpPanel + + Backward + Назад + + + Forward + Вперед + + + &Examples + &Примеры + + + Help + Помощь + + + mgl_en + mgl_ru + + + + HelpWindow + + Backward + Назад + + + Forward + Вперед + + + &Examples + &Примеры + + + Help + Помощь + + + mgl_en + mgl_ru + + + + HintDialog + + UDAV - Hint + UDAV - Советы + + + &Show at startup + Показывать при з&апуске + + + &Prev + &Предыдущий + + + &Next + &Следующий + + + &Close + &Закрыть + + + + InfoDialog + + Select kind of plot + Выберите тип графика + + + Data preview for current slice. + Просмотр для текущего среза. + + + 1D plot + 1D график + + + 2D plot + 2D график + + + Kind of plots: lines for 1D, density for 2D. + Тип графика: линии для 1D, график плотности для 2D. + + + Preview + Просмотр + + + Short information about the data. + Краткая информация о данных. + + + Information + Информация + + + + MGLThread + + In line + В линии + + + -- wrong argument(s): + -- неправильный аргумент(ы): + + + -- wrong command: + -- неправильная команда: + + + -- string too long: + -- строка слишком длинная: + + + -- unbalanced ' : + -- не хватает ' : + + + + MainWindow + + untitled - UDAV + без имени - UDAV + + + Messages and warnings + Сообщения и предупреждения + + + Calculator + Калькулятор + + + &Open file + &Открыть файл + + + Open and execute/show script or data from file (Ctrl+O). +You may switch off automatic exection in UDAV properties. + Открыть и выполнить/показать код или данные из файла (Ctrl+O). +Вы можете выключить автоматическое выполнение в настройках UDAV. + + + &Save script + &Сохранить код + + + Save script to a file (Ctrl+S) + Сохранить код в файл (Ctrl+S) + + + Show calculator which evaluate and help to type textual formulas. +Textual formulas may contain data variables too. + Показывает калькулятор, который вычисляет и помогает набрать текстовые формулы. +Текстовые формулы могут содержать также и определенные в коде данные. + + + Show info + Окно сообщений + + + Canvas + График + + + Help + Помощь + + + Info + Информация + + + Script + Код + + + Ready + Готово + + + &File + &Файл + + + &New script + &Новый код + + + Create new empty script window (Ctrl+N). + Создать новое пустое окно для кода (Ctrl+N). + + + Save &As ... + Сохранить &как ... + + + &Print script + Печатать &код + + + Print &graphics + &Печатать график + + + Open printer dialog and print graphics (Ctrl+P) + Открыть диалог принтера и напечатать график (Ctrl+P) + + + Recent files + Последние файлы + + + &Quit + В&ыход + + + &Settings + &Настройки + + + Properties + Настройки UDAV + + + Show dialog for UDAV properties. + Показать диалог настроек программы UDAV. + + + Set ar&guments + &Аргументы кода + + + &Help + &Справка + + + MGL &help + MGL &справка + + + Show help on MGL commands (F1). + Показывает справку по текущей команде MGL (F1). + + + &Examples + &Примеры + + + Show examples of MGL usage (Shift+F1). + Показывает примеры использования MGL (Shift+F1). + + + H&ints + С&оветы + + + Show hints of MGL usage. + Показывает советы по использованию MGL. + + + &About + О &программе + + + About &Qt + О библиотеке &Qt + + + UDAV + + + + Do you want to save the changes to the document? + Вы хотите сохранить изменения в коде? + + + Not recognized + Не распознано + + + UDAV v. 0. + + + + +(c) Alexey Balakin, 2008 +http://udav.sf.net/ + +(c) Алексей Балакин, 2008 +http://udav.sf.net/ + + + UDAV - about + UDAV - о программе + + + About Qt + О библиотеке Qt + + + - UDAV + + + + UDAV - save current + UDAV - сохранить текущий код + + + Couldn't change to folder + Не могу перейти в папку + + + UDAV - Open file + UDAV - Открыть файл + + + MGL scripts (*.mgl) +HDF5 files (*.hdf *.h5) +Text files (*.txt) +Data files (*.dat) +All files (*.*) + MGL код (*.mgl) +HDF5 файлы (*.hdf *.h5) +Текст (*.txt) +Файлы данных (*.dat) +Все файлы (*.*) + + + Loading aborted + Загрузка прервана + + + UDAV - save file + UDAV - сохранить файл + + + MGL scripts (*.mgl) +HDF5 files (*.hdf *.h5) +All files (*.*) + MGL код (*.mgl) +HDF5 файлы (*.hdf *.h5) +Все файлы (*.*) + + + Saving aborted + Сохранение прервано + + + untitled* - UDAV + без имени* - UDAV + + + * - UDAV + + + + + MemPanel + + Create new data array + Создать новый массив данных + + + Edit selected data array + Редактировать выбранный массив данных + + + Delete selected data array + Удалить выбранный массив данных + + + Properties of selected data array + Свойства выбранного массива данных + + + Update list of data arrays + Обновить список массивов данных + + + Delete ALL data arrays + Удалить ВСЕ массивы данных + + + Name + Имя + + + Sizes + Размеры + + + Memory + Память + + + UDAV - New variable + UDAV - Новая переменная + + + Enter name for new variable + Введите имя для новой переменной + + + UDAV - delete all data + UDAV - Удалить все данные + + + Do you want to delete all data? + Вы хотите удалить все данные? + + + - UDAV preview + - UDAV просмотр + + + + MemoryWindow + + New + Новый + + + Edit + Правка + + + Delete + Удалить + + + Info + Информация + + + Update + Обновить + + + Delete All + Удалить все + + + Name + Имя + + + Sizes + Размеры + + + Memory + Память + + + UDAV - New variable + UDAV - Новая переменная + + + Enter name for new variable + Введите имя для новой переменной + + + UDAV - delete all data + UDAV - Удалить все данные + + + Do you want to delete all data? + Вы хотите удалить все данные? + + + - UDAV preview + - UDAV просмотр + + + + NewCmdDialog + + Argument + Аргумент + + + Value + Значение + + + Add style + Добавить стиль + + + Add data + Добавить данные + + + Options + Опции + + + Cancel + Отмена + + + OK + OK + + + 1D plots + 1D графики + + + 2D plots + 2D графики + + + 3D plots + 3D графики + + + Dual plots + Парные графики + + + Vector plots + Векторные графики + + + Other plots + Прочие графики + + + Text and legend + Текст и легенда + + + Create data and I/O + Создание данных и I/O + + + Data handling + Обработка данных + + + Data extraction + Выделение данных + + + Axis and colorbar + Оси координат + + + General setup + Настройка графика + + + Axis setup + Настройка осей + + + Scale and rotate + Положение и поворот + + + Program flow + Условия и циклы + + + Nonlinear fitting + Подбор функции + + + Primitives + Примитивы + + + New command + Новая команда + + + Select first the proper kind of arguments + Сначала выберите тип аргументов + + + There is no 'fmt' argument for this command + Нет аргумента 'fmt' для данной команды + + + You should specify required argument + Вы должны ввести все обязательные аргументы + + + You should put text inside ' ' for argument + Вы должны вводить текст внутри ' ' + + + You should specify all optional arguments before + Вы должны ввести все опциональные аргументы перед + + + Groups of MGL commands + Группы команд MGL + + + MGL commands for selected group + Команды MGL для выбранной группы + + + Short description of selected command + Краткое описание выбранной команды + + + Kind of command argument order. The notation is: + * Capital arguments are data (like, Ydat); + * Argument in '' are strings (like, 'fmt'); + * Other arguments are numbers (like, zval); + * Arguments in [] are optional arguments. + Тип аргументов команды. Используются обозначения: + * Заглавными обозначены данные (например, Ydat); + * Аргументы в '' означают строки (например, 'fmt'); + * Прочие аргументы -- числа (например, zval); + * Аргументы в [] опциональны (могут не указываться). + + + Command arguments. Bold ones are required arguments. +Other are optional arguments but its order is required. +You can use '' for default format. See help at right +for default values. + Аргументы команды. Жирным обозначены обязательные аргументы. +Все прочие аргументы опциональны, но их порядок должен соблюдаться. +Можно использовать '' для формата по умолчанию. Справка справа дает +подробное описание команды и значения аргументов по умолчанию. + + + Here you can select the plot style. +The result will be placed in 'fmt' argument. + Здесь можно выбрать стиль графика. +Результат будет помещен в аргумент 'fmt'. + + + Here you can specify command options. +Options are used for additional plot tunning. + Здесь можно выбрать опции команд. +Опции используются для дополнительной +настройки вида графика. + + + mgl_en + mgl_ru + + + + OptionDialog + + UDAV - Add options + UDAV - Добавить опцию + + + X-range + Диапазон по X + + + Y-range + Диапазон по Y + + + Z-range + Диапазон по Z + + + C-range + Диапазон по C + + + Alpha + Прозрачность + + + Ambient + Фоновое освещение + + + Mesh num + Число линий сетки + + + Font size + Размер шрифта + + + Cutting + Обрезание + + + Legend + Легенда + + + Cancel + Отмена + + + OK + OK + + + UDAV - command options + UDAV - опции команд + + + Both fields in xrange must be filled + Оба поля в xrange должны быть заполнены + + + Both fields in yrange must be filled + Оба поля в yrange должны быть заполнены + + + Both fields in zrange must be filled + Оба поля в zrange должны быть заполнены + + + Both fields in crange must be filled + Оба поля в crange должны быть заполнены + + + on + вкл + + + off + выкл + + + + PlotPanel + + &Graphics + &График + + + Printing... + Печатаю... + + + Printing completed + Печать завершена + + + Printing aborted + Печать прервана + + + Drawing time %1 ms + Время рисования %1 мсек + + + Frame %1 of %2 + Кадр %1 из %2 + + + &Alpha + &Прозрачность + + + Switch on/off transparency for the graphics (Ctrl+T). + Включить/выключить прозрачность графика (Ctrl+T). + + + &Light + &Освещение + + + Switch on/off lightning for the graphics (Ctrl+L). + Включить/выключить освещение графика (Ctrl+L). + + + &Grid + &Сетка + + + Switch on/off grid drawing for absolute coordinates (Ctrl+G). + Включить/выключить рисование сетки абсолютных координат (Ctrl+G). + + + &Rotate by mouse + &Вращать мышкой + + + Switch on/off mouse handling of the graphics +(rotation, shifting, zooming and perspective). + Включить/выключить изменение графика мышью +(вращение, сдвиг, приближение и перспектива). + + + &Zoom by mouse + &Приближение мышью + + + Switch on/off mouse zoom of selected region. + Включить/выключить приближение выбранного региона. + + + Res&tore + В&осстановить + + + Restore default graphics rotation, zoom and perspective (Ctrl+Space). + Восстановить вращение, масштаб и перспективу по умолчанию (Ctrl+Space). + + + Re&draw + Пе&рерисовать + + + Execute script and redraw graphics (F5). + Выполнить код и перерисовать график (F5). + + + &Adjust size + &Подобрать размер + + + Change canvas size to fill whole region (F6). + Изменить размер рисунка так, чтобы он заполнял всю область (F6). + + + Re&load + Пере&грузить + + + Restore status for 'once' command and reload data (F9). + Восстановить статус команды 'once' и перегрузить данные (F9). + + + &Stop + &Остановить + + + Stop script execution (F7). + Остановить выполенение кода (F7). + + + &Copy plot + &Копировать график + + + Copy graphics to clipboard (Ctrl+Shift+C). + Копировать график в буфер обмена (Ctrl+Shift+C). + + + &Copy click coor. + &Копировать коор. + + + Copy coordinates of last mouse click to clipboard. + Копировать в буфер обмена координаты последнего щелчка мыши. + + + Set value of \theta angle. +You can use keys (Shift+Meta+Up or Shift+Meta+Down). + Изменить значение угла \theta. +Можно использовать клавиши (Shift+Meta+Up или Shift+Meta+Down). + + + Set value of \phi angle. +You can use keys (Shift+Meta+Left or Shift+Meta+Right). + Изменить значение угла \phi. +Можно использовать клавиши (Shift+Meta+Left или Shift+Meta+Right). + + + &Export as ... + &Экспорт в ... + + + PNG + + + + solid PNG + + + + JPEG + + + + GIF + + + + bitmap EPS + растровый EPS + + + vector EPS + векторный EPS + + + SVG + + + + C++ + + + + IDTF + + + + Zoom/move + Масштаб/сдвиг + + + Move &left + Сдвиг в&лево + + + Move graphics left by 1/3 of its width. + Сдвиг графика влево на 1/3 его ширины. + + + Move &up + Сдвиг &вверх + + + Move graphics up by 1/3 of its height. + Сдвиг графика вверх на 1/3 его высоты. + + + Zoom &in + &Приблизить + + + Zoom in graphics. + Приблизить график. + + + Zoom &out + &Отдалить + + + Zoom out graphics. + Отдалить график. + + + Move &down + Сдвиг в&низ + + + Move graphics up down 1/3 of its height. + Сдвиг графика вниз на 1/3 его высоты. + + + Move &right + Сдвиг вп&раво + + + Move graphics right by 1/3 of its width. + Сдвиг графика вправо на 1/3 его ширины. + + + Rotate + Вращать + + + Rotate up + Вращать вверх + + + Increase \theta angle by 10 degrees. + Увеличить угол \theta на 10 градусов. + + + Rotate down + Вращать вниз + + + Decrease \theta angle by 10 degrees. + Уменьшить угол \theta на 10 градусов. + + + Rotate left + Вращать влево + + + Increase \phi angle by 10 degrees. + Увеличить угол \phi на 10 градусов. + + + Rotate right + Вращать вправо + + + Decrease \phi angle by 10 degrees. + Уменьшить угол \phi на 10 градусов. + + + &Animation + &Анимация + + + &Next slide + &Следующий кадр + + + Show next slide (Meta+Right). + Показать следующий кадр (Meta+Right). + + + &Prev slide + &Предыдущий кадр + + + Show previous slide (Meta+Left). + Показать предыдущий кадр (Meta+Left). + + + &Slideshow + &Запустить + + + Run slideshow (Ctrl+F5). If no parameter specified +then the dialog with slideshow options will appear. + Запустить анимацию (Ctrl+F5). Если параметры не были указаны, +то показывается диалог с параметрами анимации. + + + Se&tup show + &Настроить анимацию + + + + PropDialog + + UDAV - Properties + UDAV - Настройки + + + Select font + Выбрать шрифт + + + Current font + Текущий шрифт + + + Change font + Изменить шрифт + + + Setup colors for: + Настроить цвета для: + + + Comments + Коментарии + + + Strings + Строки + + + Keywords + Команды + + + Options + Опции + + + Suffixes + Суффиксы + + + Numbers + Числа + + + AutoKey + Созд.данных + + + FlowKey + Упр.команды + + + Path for help files + Путь к файлам справки + + + Path for user MathGL font files + Путь к шрифтам MathGL + + + Language for UDAV + Язык для UDAV + + + Russian + Русский + + + Automatically execute script after loading + Автоматически выполнять после загрузки + + + Place editor at top + Поместить редактор сверху + + + Load script to new window + Загружать скрипт в новое окно + + + Automatical save before redrawing (F5) + Автоматически сохранять перед перерисовкой (F5) + + + Cancel + Отмена + + + OK + OK + + + UDAV - Insert filename + UDAV - Вставить имя файла + + + You have to restart UDAV for applying the cahnges. + Вы должны перезапустить UDAV для применения изменений. + + + English + + + + Image size + Размер рисунка + + + Font files (*.vfm) + Файлы шрифтов (*.vfm) + + + Disable face drawing (faster) for mouse rotation/shift/zoom. + Не рисовать грани (быстрее) при вращении мышью. + + + Automatically save before redrawing (F5) + Автоматически сохранять перед перерисовкой (F5) + + + Enable keywords completition + Включить дополнение ключевых слов + + + + QMGLCanvas + + No filename. Please save script first. + Нет имени файла. Сохраните сначала код. + + + UDAV + + + + Not initialized! + Не инициализировано! + + + + QObject + + none or default + нет или по-умолчанию + + + w - white + w - белый + + + b - blue + b - синий + + + g - lime + g - ярко-зеленый + + + r - red + r - красный + + + c - cyan + c - голубой + + + m - magenta + m - малиновый + + + y - yellow + y - желтый + + + l - springgreen + l - сине-зеленый + + + e - lawngreen + e - желто-зеленый + + + n - skyblue + n - небесно-голубой + + + u - blueviolet + u - сине-фиолетовый + + + q - orange + q - оранжевый + + + p - deeppink + p - фиолетовый + + + h - gray + h - серый + + + k - black + k - черный + + + W - lightgray + W - светло-серый + + + B - navy + B - темно синий + + + G - green + G - зеленый + + + R - maroon + R - темно красный + + + C - teal + C - темно голубой + + + M - purple + M -purple + M - пурпурный + + + Y - olive + Y - оливковый + + + L - seagreen + L - темно сине-зеленый + + + E - darklawn + E - темно желто-зеленый + + + N - darkskyblue + N - темно небесно-голубой + + + U - indigo + U - индиго + + + Q - brown + Q - коричневый + + + P - darkpink + P - темно фиолетовый + + + H - darkgray + H - темно серый + + + none + нет + + + arrow + стрелка + + + back arrow + обратная стрелка + + + stop + стоп + + + size + размер + + + triangle + треугольник + + + square + квадрат + + + rhomb + ромб + + + circle + окружность + + + solid + сплошная + + + dash + пунктир + + + dash dot + пунктир-точка + + + small dash + мелкий пунктир + + + small dash dot + мелкий пунктир-точка + + + dots + точки + + + dot + точка + + + cross + крест + + + skew cross + косой крест + + + asterix + звездочка + + + triangle down + треугольник вниз + + + triangle up + треугольник вверх + + + filled square + закрашенный квадрат + + + filled rhomb + закрашенный ромб + + + filled triangle down + закрашенный треугольник вниз + + + filled triangle up + закрашенный треугольник вверх + + + filled circle + круг + + + long dash + длинный пунктир + + + plus + плюс + + + triangle left + треугольник влево + + + triangle right + треугольник вправо + + + circled dot + точка в окружности + + + Y-sign + знак Y + + + squared plus + плюс в квадрате + + + squared cross + косой крест в квадрате + + + solid square + закрашенный квадрат + + + solid rhomb + закрашенный ромб + + + solid triangle down + закрашенный треугольник вниз + + + solid triangle up + закрашенный треугольник вверх + + + solid triangle left + закрашенный треугольник влево + + + solid triangle right + закрашенный треугольник вправо + + + solid circle + круг + + + + ScriptWindow + + +(c) Alexey Balakin, 2008 +http://udav.sf.net/ + +(c) Алексей Балакин, 2008 +http://udav.sf.net/ + + + UDAV - about + UDAV - о программе + + + File/Edit Operations + Файл/Правка + + + &File + &Файл + + + &New script + &Новый код + + + Create new empty script window (Ctrl+N). + Создать новое пустое окно для кода (Ctrl+N). + + + &Open file + &Открыть файл + + + Open and execute/show script or data from file (Ctrl+O). +You may switch off automatic exection in UDAV properties. + Открыть и выполнить/показать код или данные из файла (Ctrl+O). +Вы можете выключить автоматическое выполнение в настройках UDAV. + + + &Save script + &Сохранить файл + + + Save script to a file (Ctrl+S) + Сохранить код в файл (Ctrl+S) + + + Save &As ... + Сохранить &как ... + + + &Print script + Печатать &код + + + Print &graphics + &Печатать график + + + Open printer dialog and print graphics (Ctrl+P) + Открыть диалог принтера и напечатать график (Ctrl+P) + + + Recent files + Последние файлы + + + &Quit + В&ыход + + + &Edit + &Правка + + + &Undo + &Отменить + + + Undo editor change (Ctrl+Z). + Отменить изменения в редакторе (Ctrl+Z). + + + &Redo + &Вернуть + + + Redo editor change (Ctrl+Shift+Z). + Вернуть изменения в редакторе (Ctrl+Shift+Z). + + + Clear all + Очистить все + + + Cu&t text + В&ырезать + + + Cut selected text to clipboard (Ctrl+X). + Вырезать выделенный текст в буфер обмена (Ctrl+X). + + + &Copy + &Копировать + + + Copy selected text or data to clipboard (Ctrl+C). + Копировать выделенный текст в буфер обмена (Ctrl+C). + + + &Paste + &Вставить + + + Paste text or data from clipboard (Ctrl+V). + Вставить текст или данные из буфера обмена (Ctrl+V). + + + Select &all + Выделить вс&е + + + &Find/Replace + &Найти/заменить + + + Show dialog for text finding (Ctrl+F). + Показать диалог поиска текста (Ctrl+F). + + + Find next + Найти текст + + + Insert + Вставить + + + New command + Новая команда + + + Show dialog for new command and put it into the script. + Показать диалог вставки новой команды. + + + Fitted formula + Найденная формула + + + Insert last fitted formula with found coefficients. + Вставить последнюю найденную формулу в текст. + + + Plot style + Стиль графика + + + Show dialog for styles and put it into the script. +Styles define the plot view (color scheme, marks, dashing and so on). + Показать диалог стиля графика и вставить его в код. +Стиль определяет вид графика (цвет, маркеры, пунктир и пр). + + + Command options + Опции команды + + + Show dialog for options and put it into the script. +Options are used for additional setup the plot. + Показать диалог выбора опций команды. Опции используются +для дополнительной настройки выбранного графика. + + + Numeric value + Численное значение + + + Replace expression by its numerical value. + Заменить выделенное выражение его числовым значением. + + + File path + Путь файла + + + Select and insert file name. + Выбрать и вставить путь файла. + + + Folder path + Путь папки + + + Select and insert folder name. + Выбрать и вставить путь папки. + + + Graphics setup + Настройка графика + + + Show dialog for plot setup and put code into the script. +This dialog setup axis, labels, lighting and other general things. + Показать диалог настройки графика и вставить ее в код. +Диалог позволяет настроить оси, подписи, освещение и пр. + + + Properties + Настройки UDAV + + + Show dialog for UDAV properties. + Показать диалог настроек программы UDAV. + + + Set ar&guments + &Аргументы кода + + + Calculator + Калькулятор + + + Show calculator which evaluate and help to type textual formulas. +Textual formulas may contain data variables too. + Показывает калькулятор, который вычисляет и помогает набрать текстовые формулы. +Текстовые формулы могут содержать также и определенные в коде данные. + + + Show info + Окно сообщений + + + &Window + &Окна + + + Tile + Плиткой + + + Cascade + Каскадом + + + Close all + Закрыть все + + + UDAV Help + Справка по UDAV + + + &Help + &Справка + + + MGL &help + MGL &справка + + + Show help on MGL commands (F1). + Показывает справку по текущей команде MGL (F1). + + + &Examples + &Примеры + + + Show examples of MGL usage (Shift+F1). + Показывает примеры использования MGL (Shift+F1). + + + H&ints + С&оветы + + + Show hints of MGL usage. + Показывает советы по использованию MGL. + + + &About + О &программе + + + untitled - UDAV + без имени - UDAV + + + UDAV - save current + UDAV - сохранить текущий код + + + Do you want to save the changes to the document? + Вы хотите сохранить изменения в коде? + + + UDAV - Open file + UDAV - Открыть файл + + + MGL scripts (*.mgl) +HDF5 files (*.hdf *.h5) +Text files (*.txt) +Data files (*.dat) +All files (*.*) + MGL код (*.mgl) +HDF5 файлы (*.hdf *.h5) +Текст (*.txt) +Файлы данных (*.dat) +Все файлы (*.*) + + + Loading aborted + Загрузка прервана + + + UDAV - open file + UDAV - открыть файл + + + Couldn't open file + Не могу открыть файл + + + Loaded document + Загружен документ + + + Could not write to %1 + Не могу записать в %1 + + + File %1 saved + Файл %1 сохранен + + + UDAV - save file + UDAV - сохранить файл + + + MGL scripts (*.mgl) +HDF5 files (*.hdf *.h5) +All files (*.*) + MGL код (*.mgl) +HDF5 файлы (*.hdf *.h5) +Все файлы (*.*) + + + Saving aborted + Сохранение прервано + + + untitled* - UDAV + без имени* - UDAV + + + UDAV - Insert filename + UDAV - Вставить имя файла + + + Messages and warnings + Сообщения и предупреждения + + + Ready + Готово + + + Printing... + Печатаю... + + + Printing completed + Печать завершена + + + Printing aborted + Печать прервана + + + UDAV - find text + UDAV - поиск текста + + + No string occurrence is found + Строка не найдена + + + Not recognized + Не распознано + + + Loaded document %1 + Загружен документ %1 + + + &Data + &Данные + + + File Operations + Работа с файлами + + + &Load data + &Загрузить данные + + + Load data from file. Data will be deleted only +at exit but UDAV will not ask to save it. + Загрузить данные из файла. Данные будут удалены при +выходе, но UDAV не спросит об их сохранении. + + + &Import PNG + &Импорт PNG + + + Import data from PNG picture with specified color scheme. +Data will be deleted only at exit but UDAV will not ask it saving. + Импортировать данные из PNG рисунка с заданной цветовой схемой. +Данные будут удалены при выходе, но UDAV не спросит об их сохранении. + + + &Save data + Сохранить &данные + + + Save data to tab-separeted file. + Сохранить данные в текстовый файл с разделителем табуляцией. + + + &Export PNG + &Экспорт PNG + + + Export data to PNG picture. The colors defined by +specified color scheme. The same as in 'dens' command. + Экспортирует данные в PNG рисунок. Цвета определяются +указанной цветовой схемой. Рисунок аналогичен команде 'dens'. + + + Plot &data + &Отобразить данные + + + Plot data in new script window. You may select the kind +of plot, its style and so on. + Отобразить данные в новом окне. Вы можете +выбрать тип графика, его стиль и т.д. + + + Resize data + Размеры данных + + + &Sizes + &Размеры + + + &Create new + &Создать новые + + + Recreate the data with new sizes and fill it by zeros (Ctrl+N). + Создает заново данные нового размера и заполняет их нулями (Ctrl+N). + + + &Resize + &Изменить размер + + + Resize (interpolate) the data to specified sizes (Ctrl+R). + Изменяет размер (интерполирует) данных в указанному (Ctrl+R). + + + &Squeeze + С&жать + + + Keep only each n-th element of the data array. + Сохраняет каждый n-ый элемент массива данных. + + + Cro&p + О&брезать + + + Crop the data edges. Useful to cut off the zero-filled area. + Обрезает края данных. Полезно для удаления заполненных нулями областей. + + + &Transpose + &Транспонировать + + + Transpose data dimensions, like x<->y or x<->z and so on. + Транспонирует массив данных, типа x<->y или x<->z и т.д. + + + Re&arrange + По&менять размеры + + + Rearrange data sizes without changing data values. + Меняет размеры данных без изменения самого массива данных. + + + Modify data + Изменить данные + + + &Modify + &Изменить + + + By &formula + По &формуле + + + Change data values according to formula depended on 'x', 'y' and 'z' +variables. A set of special function is availible also. + Изменяет данные по формуле, зависяещей от переменных 'x', 'y' и 'z'. +Поддерживаются также многие специальные функции. + + + Fill in &range + &Распределить + + + Fill data equidistantly from one value to another. + Распределить равномерно данные от одного значения до другого. + + + &Normalize + &Нормировать + + + Normalize data so that its minimal +and maximal values be in specified range. + Нормирует данные так, что их максимальное и +минимальное значения равны заданным. + + + Norm. s&lices + Норм. по &срезам + + + Normalize each data slice perpendicular to some direction +so that its minimal and maximal values be in specified range. + Нормирует данные по срезам перпендикулярно +заданному направлению так, что их максимальное +и минимальное значения равны заданным. + + + &Smooth data + С&гладить + + + Smooth data by one of 4 methods along specified direction(s). + Сглаживает данные одним из 4-х методов вдоль заданного направления(ий). + + + &Operators + &Опраторы + + + &Cum. sum + &Суммировать + + + Summate data values along specified direction(s). + Суммирует данные вдоль указанного направления(ий). + + + &Integrate + &Интегрировать + + + Integrate data values along specified direction(s). + Интегрирует данные по заданному направлению(ям). + + + &Differentiate + &Дифференцировать + + + Differentiate data values along specified direction(s). + Дифференцирует данные по заданному направлению(ям). + + + &Laplace + &Лаплас + + + Double differentiate data values along specified direction(s). + Дважды дифференцирует данные по заданному направлению(ям). + + + &Swap + &Поменять местами + + + Swap left and right data part along specified direction(s). +This operation is useful for data after Fourier transform. + Меняет местами левую и правую часть данных вдоль указанного направления(ий). +Операция полезна для данных после Фурье преобразования. + + + &Mirror + &Отразить + + + Mirror left and right data part along specified direction(s). +This operation do like index change from 'i' to 'n-i'. + Отражает данные относительно указанного направления(ий). +Действует как замена индекса 'i' на 'n-i'. + + + &Algebraic + &Алгебраические + + + &Add + &Добавить + + + Add a number to all data values. + Добавляет число к элементам массива данных. + + + &Subtract + &Вычесть + + + Subtract a number to all data values. + Вычитает из элементов массива данных число. + + + &Multiply + &Умножить + + + Multiply all data values by a number. + Умножает элементы массива данных на число. + + + &Divide + &Разделить + + + Divide all data values by a number. + Делит элементы массива данных на число. + + + A&nother data + &Новые данные + + + &Sum of + &Сумма по + + + M&in of + М&инимум по + + + M&ax of + М&аксимум по + + + Momentum along &x + Момент вдоль &x + + + Momentum along &y + Момент вдоль &y + + + Momentum along &z + Момент вдоль &z + + + &Histogram + &Гистограмма + + + Navigate data + Переход к срезам + + + &Navigate + Пере&ход + + + &First slice + &Первый срез + + + Go to the first data slice for 3D data. + Перейти к первому срезу 3D данных. + + + &Prev. slice + &Предыдущий срез + + + Go to the previous data slice for 3D data. + Перейти к предыдущему срезу 3D данных. + + + Go to the specified data slice for 3D data. + Перейти к указанному срезу 3D данных. + + + Go to slice + Перейти к срезу + + + Next slice + Следующий срез + + + Go to the next data slice for 3D data. + Перейти к следующему срезу 3D данных. + + + Last slice + Последний срез + + + Go to the last data slice for 3D data. + Перейти к последнему срезу 3D данных. + + + About Qt + О библиотеке Qt + + + About &Qt + О библиотеке &Qt + + + Couldn't change to folder + Не могу перейти в папку + + + Couldn't open file + Не могу открыть файл + + + &Copy text + &Копировать текст + + + &Paste text + &Вставить текст + + + File name + Имя файла + + + + SetupDialog + + UDAV - Setup plot + UDAV - Настройка графика + + + X axis + Ось X + + + Y axis + Ось Y + + + Z axis + Ось Z + + + C axis + Ось C + + + Minimal + Минимум + + + Maximal + Максимум + + + Origin + Начало осей + + + Label + Подпись + + + at position + в позиции + + + at minimum + минимума + + + at center + по центру + + + at maximum + максимума + + + Ticks + Метки + + + SubTicks + Под-метки + + + Start + Начало меток + + + Template + Шаблон + + + AlphaDef + Базовая прозрачность + + + Ambient + Фоновый свет + + + BaseWidth + Базовая ширина + + + MeshNum + Число линий сетки + + + AxialDir + Ось вращения + + + Font + Стиль текста + + + FontSize + Размер текста + + + Alpha on + Прозрачность + + + Light on + Освещение + + + No text rotation + Запрет вращения текста + + + General settings + Общие настройки + + + State + Состояние + + + Color + Цвет + + + Brightness + Яркость + + + Light settings + Настройки освещения + + + Template name + Имя шаблона + + + Save + Сохранить + + + Cancel + Отмена + + + To script + В код + + + UDAV - Save template + UDAV - Сохранить шаблон + + + Could not write to file + Не могу записать в файл + + + Template saved + Шаблон сохранен + + + Light position should be filled. Ignore it. + Положение источника должно быть заполнено. Игнорирую. + + + ID + + + + X pos + + + + Y pos + + + + Z pos + + + + on + вкл + + + + StyleDialog + + UDAV - Insert style/scheme + UDAV - Вставить стиль/схему + + + Arrow at start + Стрелка в начале + + + Dashing + Пунктир + + + Arrow at end + Стрелка в конце + + + Color + Цвет + + + Marks + Маркер + + + Line width + Толщина + + + Line style + Стиль линии + + + Color order + Порядок цветов + + + Saturation + Насыщенность + + + Colors along coordinates + Цвет вдоль координат + + + Wire or mesh plot + Сетчатый график + + + Axial direction + Ось вращения + + + Text on contours + Текст на контурах + + + none + нет + + + under + под + + + above + над + + + Color scheme + Цветовая схема + + + Bold style + Жирный + + + Italic style + Курсив + + + Wire style + Контур + + + Underline + Подчеркнутый + + + Overline + Надчеркнутый + + + Text color + Цвет текста + + + Text align + Выравнивание + + + left + влево + + + at center + по центру + + + right + вправо + + + Font style + Стиль текста + + + Resulting string + Результат + + + Cancel + Отмена + + + OK + OK + + + + TableWindow + + - UDAV variable + - UDAV переменная + + + - UDAV preview + - UDAV просмотр + + + UDAV - Import PNG + UDAV - Импорт PNG + + + Data files (*.dat) +All files (*.*) + Файлы данных (*.dat) +Все файлы (*.*) + + + UDAV - Export to PNG + UDAV - Экспорт в PNG + + + Enter color scheme for picture. +Note that data will be normalized in range [0,1]. + Введите цветовую схему рисунка. +Данные будут нормированы в [0,1]. + + + PNG files (*.png) +All files (*.*) + PNG файлы (*.png) +Все файлы (*.*) + + + Enter color scheme for picture + Введите цветовую схему рисунка + + + UDAV - Save data + UDAV - Сохранить данные + + + UDAV - Load data + UDAV - Загрузить данные + + + UDAV - Fill data + UDAV - Заполнить данные + + + Enter formula for data filling. +Note that variables x,y,z supposed to be in range [0,1]. + Введите формулу для данных. +Переменные x,y,z меняются в интервале [0,1]. + + + Enter range for data and direction of filling + Введите диапазон и направление заполнения + + + From + От + + + To + До + + + Direction + Направление + + + UDAV - Normalize data + UDAV - Нормировать данные + + + Enter range for final data + Введите диапазон результата + + + Symmetrical? + Симметрично? + + + UDAV - Normalize by slice + UDAV - Нормировать по срезам + + + UDAV - Clear data + UDAV - Очистить данные + + + Enter new data sizes + Введите новые размеры + + + X-size + Размер по X + + + Y-size + Размер по Y + + + Z-size + Размер по Z + + + UDAV - Resize data + UDAV - Изменить размер данных + + + UDAV - Squeeze data + UDAV - Сжать данные + + + Enter step of saved points. For example, '1' save all, '2' save each 2nd point, '3' save each 3d and so on. + Введите шаг сохраняемых точек. Например, '1' сохранить все, '2' каждую вторую точку, '3' каждую третью и т.д. + + + X-direction + X направление + + + Y-direction + Y направление + + + Z-direction + Z направление + + + UDAV - Crop data + UDAV - Обрезать данные + + + Enter range of saved date. + Введите интервал сохраняемых данных. + + + UDAV - Rearrange data + Не знаю хорошего русского термина + UDAV - Поменять размеры данных + + + UDAV - Transpose data + UDAV - Транспонировать данные + + + Enter new order of dimensions. +For example, 'yx' or 'yxz' for transpose x-y, 'zyx' for transposing x-z and so on. + Введите новый порядок размерностей. +Например, 'yx' или 'yxz' для транспонирования x-y, 'zyx' для транспонирования x-z и т.д. + + + UDAV - Smooth data + UDAV - Сгладить данные + + + Enter direction(s) for smoothing. +Optionally you may enter the kind of smoothing by 3 or by 5 points. For example 'xy3' - smooth only in x and y directions and use 3-points scheme. + Введите направление(я) сглаживания. +Можно также ввести тип сглаживания по 3 или по 5 точкам. Например 'xy3' - сгладит только в x и y направлениях по 3-точечной схеме. + + + UDAV - Summarize data + UDAV - Суммировать данные + + + Enter direction(s) for cumulative summation. +For example 'xy' - summate along x and y directions. + Введите направление(я) для суммирования. +Например 'xy' - суммировать вдоль x и y направлений. + + + UDAV - Integrate data + UDAV - Интегрировать данные + + + Enter direction(s) for integration. +For example 'xy' - integrate along x and y directions. + Введите направление(я) для инткгрирования. +Например 'xy' - интегрировать вдоль x и y направлений. + + + UDAV - Differentiate data + UDAV - Дифференцировать данные + + + Enter direction(s) for differentiation. +For example 'xy' - differentiate along x and y directions. + Введите направление(я) для дифференцирования. +Например 'xy' - дифференцировать вдоль x и y направлений. + + + UDAV - Laplace transform + UDAV - Преобразование Лапласа + + + Enter direction(s) for laplace transform. +For example 'xy' - do transform along x and y directions. + Введите направление(я) для преобразования Лапласа. +Например 'xy' - преобразовать вдоль x и y направлений. + + + UDAV - Swap data + UDAV - Поменять местами + + + Enter direction(s) for swapping (exchange left and right parts). +For example 'xy' - swap along x and y directions. Useful for Fourier spectrum. + Введите направление(я) для обмена левой и правой частями данных. +Например 'xy' - меняет вдоль x и y направлений. Полезно для Фурье спектров. + + + UDAV - Mirror data + UDAV - Отразить данные + + + Enter direction(s) for mirroring. +For example 'xy' - mirror along x and y directions. + Введите направление(я) для отражения. +Например 'xy' - отразить по x и y направлениям. + + + UDAV - Sum along ... + UDAV - Сумма по ... + + + Specify direction(s) of summation + Введите направление(я) суммирования + + + UDAV - Max along ... + UDAV - Максимум по ... + + + Specify direction(s) of maximal values + Введите направление(я) поиска максимумов + + + UDAV - Min along ... + UDAV - Минимум по ... + + + Specify direction(s) of minimal values + Введите направление(я) поиска минимумов + + + UDAV - Momentum along 'x' + UDAV - Момент по 'x' + + + Specify which momentum evaluate. +The momentum is res_i = sum_jk how(x_i,y_j,z_k) a_jk/ sum_jk a_jk. +Coordinates x, y, z are data indexes normalized in range [0,1]. + Укажите какой момент вычислять. +Момент равен res_i = Σ_jk how(x_i,y_j,z_k) a_jk/ Σ_jk a_jk. +Координаты x, y, z находятся в диапазоне [0,1]. + + + Specify which momentum evaluate. +The momentum is res_j = sum_ik how(x_i,y_j,z_k) a_ik/ sum_ik a_ik. +Coordinates x, y, z are data indexes normalized in range [0,1]. + Укажите какой момент вычислять. +Момент равен res_j = Σ_ik how(x_i,y_j,z_k) a_ik/ Σ_ik a_ik. +Координаты x, y, z находятся в диапазоне [0,1]. + + + Specify which momentum evaluate. +The momentum is res_k = sum_ij how(x_i,y_j,z_k) a_ij/ sum_ij a_ij. +Coordinates x, y, z are data indexes normalized in range [0,1]. + Укажите какой момент вычислять. +Момент равен res_k = Σ_ij how(x_i,y_j,z_k) a_ij/ Σ_ij a_ij. +Координаты x, y, z находятся в диапазоне [0,1]. + + + UDAV - Momentum along 'y' + UDAV - Момент по 'y' + + + UDAV - Momentum along 'z' + UDAV - Момент по 'z' + + + UDAV - Make histogram + UDAV - Найти гистограмму + + + Number of points + Число точек + + + Put in variable + Поместить в переменную + + + Cancel + Отмена + + + OK + OK + + + UDAV - Change data + UDAV - Изменить данные + + + Enter number for adding to data elements: + Введите число для добавления к элементам массива: + + + Enter number for subtraction from data elements: + Введите число для вычитания из элементов массива: + + + Enter number for division of data elements: + Введите число для деления элементов массива: + + + Enter number for multiplication of data elements: + Введите число для умножения элементов массива: + + + UDAV - Go to slice + UDAV - Перейти к срезу + + + Enter slice id: + Введите номер среза: + + + NOTE: All fields must be filled! + Все поля должны быть заполнены! + + + Enter the name for new variable + Введите имя новой переменной + + + + TextPanel + + &Edit + &Правка + + + UDAV - Insert filename + UDAV - Вставить имя файла + + + Printing... + Печатаю... + + + Printing completed + Печать завершена + + + Printing aborted + Печать прервана + + + UDAV - find text + UDAV - поиск текста + + + No string occurrence is found + Строка не найдена + + + Loaded document %1 + Загружен документ %1 + + + Could not write to %1 + Не могу записать в %1 + + + File %1 saved + Файл %1 сохранен + + + UDAV - open file + UDAV - открыть файл + + + Couldn't open file + Не могу открыть файл + + + Loaded document + Загружен документ + + + &Undo + &Отменить + + + Undo editor change (Ctrl+Z). + Отменить изменения в редакторе (Ctrl+Z). + + + &Redo + &Вернуть + + + Redo editor change (Ctrl+Shift+Z). + Вернуть изменения в редакторе (Ctrl+Shift+Z). + + + Clear all + Очистить все + + + Cu&t text + В&ырезать + + + Cut selected text to clipboard (Ctrl+X). + Вырезать выделенный текст в буфер обмена (Ctrl+X). + + + &Copy text + &Копировать текст + + + Copy selected text or data to clipboard (Ctrl+C). + Копировать выделенный текст в буфер обмена (Ctrl+C). + + + &Paste text + &Вставить текст + + + Paste text or data from clipboard (Ctrl+V). + Вставить текст или данные из буфера обмена (Ctrl+V). + + + Select &all + Выделить вс&е + + + &Find/Replace + &Найти/заменить + + + Show dialog for text finding (Ctrl+F). + Показать диалог поиска текста (Ctrl+F). + + + Find next + Найти текст + + + Insert + Вставить + + + New command + Новая команда + + + Show dialog for new command and put it into the script. + Показать диалог вставки новой команды. + + + Fitted formula + Найденная формула + + + Insert last fitted formula with found coefficients. + Вставить последнюю найденную формулу в текст. + + + Plot style + Стиль графика + + + Show dialog for styles and put it into the script. +Styles define the plot view (color scheme, marks, dashing and so on). + Показать диалог стиля графика и вставить его в код. +Стиль определяет вид графика (цвет, маркеры, пунктир и пр). + + + Command options + Опции команды + + + Show dialog for options and put it into the script. +Options are used for additional setup the plot. + Показать диалог выбора опций команды. Опции используются +для дополнительной настройки выбранного графика. + + + Numeric value + Численное значение + + + Replace expression by its numerical value. + Заменить выделенное выражение его числовым значением. + + + File name + Имя файла + + + Select and insert file name. + Выбрать и вставить путь файла. + + + Folder path + Путь папки + + + Select and insert folder name. + Выбрать и вставить путь папки. + + + Graphics setup + Настройка графика + + + Show dialog for plot setup and put code into the script. +This dialog setup axis, labels, lighting and other general things. + Показать диалог настройки графика и вставить ее в код. +Диалог позволяет настроить оси, подписи, освещение и пр. + + + diff --git a/udav/udav_wnd.cpp b/udav/udav_wnd.cpp new file mode 100644 index 0000000..405d1f6 --- /dev/null +++ b/udav/udav_wnd.cpp @@ -0,0 +1,658 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//----------------------------------------------------------------------------- +#include "udav_wnd.h" +#include "text_pnl.h" +#include "textedit.h" +#include "args_dlg.h" +#include "plot_pnl.h" +#include "mem_pnl.h" +#include "dat_pnl.h" +#include "help_pnl.h" +#include "prop_dlg.h" +#include "qmglsyntax.h" +#include "qmglcanvas.h" +#include "calc_dlg.h" +#include "hint_dlg.h" +//----------------------------------------------------------------------------- +extern HintDialog *hintDialog; +extern bool mglAutoExecute; +ArgsDialog *args_dlg=0; +PropDialog *propDlg=0; +int MainWindow::num_wnd=0; +QStringList recentFiles; +int MaxRecentFiles=5; +bool editPosBottom = false; +bool mglAutoSave = false; +bool mglAutoPure = true; +bool mglCompleter = true; +bool showHint=true; +bool loadInNewWnd = false; +extern mglParser parser; +extern QColor mglColorScheme[9]; +extern QString defFontFamily; +extern int defFontSize; +extern QString pathHelp; +extern QString pathFont; +extern int defWidth, defHeight; +//----------------------------------------------------------------------------- +MainWindow::MainWindow(QWidget *wp) : QMainWindow(wp) +{ + setWindowTitle(tr("untitled - UDAV")); + setAttribute(Qt::WA_DeleteOnClose); + if(!args_dlg) args_dlg = new ArgsDialog; + + + messWnd = new QDockWidget(tr("Messages and warnings"),this); + mess = new TextEdit(this); messWnd->setWidget(mess); + messWnd->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea); + addDockWidget(Qt::BottomDockWidgetArea, messWnd); + messWnd->resize(size().width(), 0); new MessSyntax(mess); + connect(mess,SIGNAL(cursorPositionChanged()),this,SLOT(messClicked())); + + calcWnd = new QDockWidget(tr("Calculator"),this); + calc = new CalcDialog(); calcWnd->setWidget(calc); + calcWnd->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea); + addDockWidget(Qt::BottomDockWidgetArea, calcWnd); + calcWnd->resize(size().width(), 200); + + QAction *a; + aload = a = new QAction(QPixmap(":/xpm/document-open.png"), tr("&Open file"), this); + connect(a, SIGNAL(activated()), this, SLOT(choose())); + a->setToolTip(tr("Open and execute/show script or data from file (Ctrl+O).\nYou may switch off automatic exection in UDAV properties.")); + a->setShortcut(Qt::CTRL+Qt::Key_O); + + asave = a = new QAction(QPixmap(":/xpm/document-save.png"), tr("&Save script"), this); + connect(a, SIGNAL(activated()), this, SLOT(save())); + a->setToolTip(tr("Save script to a file (Ctrl+S)")); + a->setShortcut(Qt::CTRL+Qt::Key_S); + + acalc = a = new QAction(QPixmap(":/xpm/accessories-calculator.png"), tr("Calculator"), this); + a->setShortcut(Qt::Key_F4); a->setCheckable(true); + connect(a, SIGNAL(toggled(bool)), calcWnd, SLOT(setVisible(bool))); + connect(calcWnd, SIGNAL(visibilityChanged(bool)), a, SLOT(setChecked(bool))); + a->setToolTip(tr("Show calculator which evaluate and help to type textual formulas.\nTextual formulas may contain data variables too.")); + a->setChecked(false); calcWnd->setVisible(false); + + ainfo = a = new QAction(tr("Show info"), this); + a->setShortcut(Qt::Key_F2); a->setCheckable(true); + connect(a, SIGNAL(toggled(bool)), messWnd, SLOT(setVisible(bool))); + connect(messWnd, SIGNAL(visibilityChanged(bool)), a, SLOT(setChecked(bool))); + a->setChecked(false); messWnd->setVisible(false); + + + split = new QSplitter(this); + ltab = new QTabWidget(split); + ltab->setMovable(true); ltab->setTabPosition(QTabWidget::South); + rtab = new QTabWidget(split); + rtab->setMovable(true); rtab->setTabPosition(QTabWidget::South); + + graph = new PlotPanel(this); + rtab->addTab(graph,QPixmap(":/xpm/x-office-presentation.png"),tr("Canvas")); + info = new MemPanel(this); + connect(info,SIGNAL(addPanel(QWidget*)),this,SLOT(addPanel(QWidget*))); + rtab->addTab(info,QPixmap(":/xpm/system-file-manager.png"),tr("Info")); + hlp = new HelpPanel(this); + rtab->addTab(hlp,QPixmap(":/xpm/help-contents.png"),tr("Help")); + edit = new TextPanel(this); edit->graph = graph; + graph->mgl->textMGL = edit->edit; + graph->mgl->warnMGL = mess; + ltab->addTab(edit,QPixmap(":/xpm/text-x-generic.png"),tr("Script")); + + makeMenu(); + setCentralWidget(split); + setWindowIcon(QIcon(":/udav.png")); + readSettings(); + if(!propDlg) propDlg = new PropDialog; + + connect(graph, SIGNAL(save()), this, SLOT(save())); + connect(graph, SIGNAL(setStatus(const QString &)), this, SLOT(setStatus(const QString &))); + connect(graph, SIGNAL(animPutText(const QString &)), edit, SLOT(animPutText(const QString &))); + connect(graph,SIGNAL(giveFocus()),edit->edit,SLOT(setFocus())); + connect(graph->mgl, SIGNAL(objChanged(int)), edit, SLOT(setCursorPosition(int))); + connect(graph->mgl, SIGNAL(posChanged(QString)), statusBar(), SLOT(showMessage(QString))); + connect(graph->mgl, SIGNAL(refreshData()), info, SLOT(refresh())); + connect(info, SIGNAL(refreshData()), this, SLOT(refreshData())); + + connect(mess, SIGNAL(textChanged()), this, SLOT(warnChanged())); + connect(calc, SIGNAL(putNumber(QString)),edit,SLOT(putText(QString))); +// connect(mdi, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(subActivated(QMdiSubWindow *))); + connect(propDlg, SIGNAL(sizeChanged(int,int)), graph->mgl, SLOT(imgSize(int,int))); + connect(edit->edit,SIGNAL(textChanged()), this, SLOT(setAsterix())); + connect(edit->edit, SIGNAL(cursorPositionChanged()), this, SLOT(editPosChanged())); + connect(edit,SIGNAL(setCurrentFile(QString)),this,SLOT(setCurrentFile(QString))); + connect(edit,SIGNAL(setStatus(QString)),this,SLOT(setStatus(QString))); + + setStatus(tr("Ready")); + num_wnd++; + edit->setAcceptDrops(false); // for disabling default action by 'edit' + setAcceptDrops(true); +} +//----------------------------------------------------------------------------- +void MainWindow::makeMenu() +{ + QAction *a; + QMenu *o; + + // file menu + { + o = menuBar()->addMenu(tr("&File")); + a = new QAction(QPixmap(":/xpm/document-new.png"), tr("&New script"), this); + connect(a, SIGNAL(activated()), this, SLOT(newDoc())); + a->setToolTip(tr("Create new empty script window (Ctrl+N).")); + a->setShortcut(Qt::CTRL+Qt::Key_N); o->addAction(a); + + o->addAction(aload); + o->addAction(asave); + + a = new QAction(tr("Save &As ..."), this); + connect(a, SIGNAL(activated()), this, SLOT(saveAs())); + o->addAction(a); + + o->addSeparator(); + o->addAction(tr("&Print script"), edit, SLOT(printText())); + a = new QAction(QPixmap(":/xpm/document-print.png"), tr("Print &graphics"), this); + connect(a, SIGNAL(activated()), graph, SLOT(printPlot())); + a->setToolTip(tr("Open printer dialog and print graphics\t(Ctrl+P)")); + a->setShortcut(Qt::CTRL+Qt::Key_P); o->addAction(a); + o->addSeparator(); + fileMenu = o->addMenu(tr("Recent files")); + o->addSeparator(); + o->addAction(tr("&Quit"), qApp, SLOT(closeAllWindows()), Qt::CTRL+Qt::Key_Q); + } + + menuBar()->addMenu(edit->menu); + menuBar()->addMenu(graph->menu); + + // settings menu + { + o = menuBar()->addMenu(tr("&Settings")); + a = new QAction(QPixmap(":/xpm/preferences-system.png"), tr("Properties"), this); + connect(a, SIGNAL(activated()), this, SLOT(properties())); + a->setToolTip(tr("Show dialog for UDAV properties.")); o->addAction(a); + o->addAction(tr("Set ar&guments"), args_dlg, SLOT(exec())); + + o->addAction(acalc); + o->addAction(ainfo); + } + + menuBar()->addSeparator(); + o = menuBar()->addMenu(tr("&Help")); + a = new QAction(QPixmap(":/xpm/help-contents.png"), tr("MGL &help"), this); + connect(a, SIGNAL(activated()), this, SLOT(showHelp())); + a->setToolTip(tr("Show help on MGL commands (F1).")); + a->setShortcut(Qt::Key_F1); o->addAction(a); + a = new QAction(QPixmap(":/xpm/help-faq.png"), tr("&Examples"), this); + connect(a, SIGNAL(activated()), hlp, SLOT(showExamples())); + a->setToolTip(tr("Show examples of MGL usage (Shift+F1).")); + a->setShortcut(Qt::SHIFT+Qt::Key_F1); o->addAction(a); + a = new QAction(QPixmap(":/xpm/help-faq.png"), tr("H&ints"), this); + connect(a, SIGNAL(activated()), hintDialog, SLOT(exec())); + a->setToolTip(tr("Show hints of MGL usage.")); o->addAction(a); + o->addAction(tr("&About"), this, SLOT(about())); + o->addAction(tr("About &Qt"), this, SLOT(aboutQt())); +} +//----------------------------------------------------------------------------- +void MainWindow::refreshData() +{ + for(int i=0; icount(); i++) + { + DatPanel *w = dynamic_cast(ltab->widget(i)); + if(w) w->refresh(); + } + edit->refreshData(); +} +//----------------------------------------------------------------------------- +void MainWindow::closeEvent(QCloseEvent* ce) +{ + bool ok=true; + writeSettings(); + if(edit->isModified()) + switch(QMessageBox::information(this, tr("UDAV"), + tr("Do you want to save the changes to the document?"), + QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel)) + { + case QMessageBox::Yes: save(); break; + case QMessageBox::No: break; + default: ok=false; break; + } + if(ok) + { + num_wnd--; + ce->accept(); + if(num_wnd==0) QApplication::quit(); + } + else ce->ignore(); +} +//----------------------------------------------------------------------------- +void MainWindow::dropEvent(QDropEvent * de) +{ + // Linux Qt send "text/plain" mime data in drop event + // Windows version send "text/uri-list" + QTextCodec *codec = QTextCodec::codecForLocale(); + QString filename; + if ( de->mimeData()->hasFormat("text/plain") ) + { + // Under linux just convert the text from the local encodig to Qt's unicode + filename = codec->toUnicode(de->mimeData()->data("text/plain")); + if (filename.indexOf("file:") == 0) + load(filename.remove("file://").trimmed(), false); + }else + if ( de->mimeData()->hasUrls() ) + { + // Under win - parse the dropped data and find the path to local file + QList UrlList; + QFileInfo finfo; + UrlList = de->mimeData()->urls(); + if ( UrlList.size() > 0) // if at least one QUrl is present in list + { + filename = UrlList[0].toLocalFile(); // convert first QUrl to local path + finfo.setFile( filename ); + if ( finfo.isFile() ) + { + load(filename, false); + } + } + } +} +//----------------------------------------------------------------------------- +void MainWindow::dragEnterEvent(QDragEnterEvent *event) +{ + QTextCodec *codec = QTextCodec::codecForLocale(); + QString filename = codec->toUnicode(event->mimeData()->data("text/plain")); + if ( event->provides("text/plain") ) + { + QTextCodec *codec = QTextCodec::codecForLocale(); + QString instring = codec->toUnicode(event->mimeData()->data("text/plain")); + if ( instring.indexOf("file://") >= 0) + { + event->acceptProposedAction(); + setStatus(instring); + } + }else + if ( event->mimeData()->hasUrls() ) + { + QList UrlList; + QFileInfo finfo; + UrlList = event->mimeData()->urls(); + if ( UrlList.size() > 0) // if at least one QUrl is present in list + { + filename = UrlList[0].toLocalFile(); // convert first QUrl to local path + finfo.setFile( filename ); + if ( finfo.isFile() ) + { + setStatus(filename); + event->acceptProposedAction(); + } + } + } +} +//----------------------------------------------------------------------------- +void MainWindow::showHelp() +{ + QString s = edit->selection(), dlm(" #;:\t"); + int i, n = s.length(); + for(i=0;ishowHelp(s); +} +//----------------------------------------------------------------------------- +int mgl_cmd_cmp(const void *a, const void *b); +void MainWindow::editPosChanged() +{ + register int i, n, m; + QString text = edit->selection(), dlm(" #;:\t"); + n = text.length(); + for(i=0;idesc)+": "+QString::fromWCharArray(rts->form)); + else setStatus(tr("Not recognized")); + delete []s; +} +//----------------------------------------------------------------------------- +void MainWindow::setEditPos(bool bottom) +{ split->setOrientation(bottom ? Qt::Vertical : Qt::Horizontal); } +//----------------------------------------------------------------------------- +void MainWindow::properties() { propDlg->exec(); } +//----------------------------------------------------------------------------- +void MainWindow::messClicked() +{ + QString m = mess->toPlainText(), q; + int p = mess->textCursor().blockNumber(); + for(;p>=0;p--) + { + q = m.section('\n',p,p); + if(q.contains("In line ")) + { + QString s = q.mid(8).section(' ',0,0); + int n = s.toInt(); if(n<0) return; + edit->moveCursor(QTextCursor::Start); + for(int i=0;imoveCursor(QTextCursor::NextBlock); + edit->setFocus(); + } + } + edit->setFocus(); +} +//----------------------------------------------------------------------------- +void MainWindow::warnChanged() +{ + if(mess->toPlainText().isEmpty()) return; + messWnd->show(); ainfo->setChecked(true); +} +//----------------------------------------------------------------------------- +void MainWindow::about() +{ + QString s = tr("UDAV v. 0.")+QString::number(UDAV_VERSION)+ + tr("\n(c) Alexey Balakin, 2008\nhttp://udav.sf.net/"); + QMessageBox::about(this, tr("UDAV - about"), s); +} +//----------------------------------------------------------------------------- +void MainWindow::aboutQt() +{ QMessageBox::aboutQt(this, tr("About Qt")); } +//----------------------------------------------------------------------------- +void MainWindow::writeSettings() +{ + QSettings settings("udav","UDAV"); + settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV"); + settings.beginGroup("/UDAV"); + settings.setValue("/animDelay", animDelay); + settings.setValue("/geometry/size", size()); +// settings.setValue("/geometry/dock", messWnd->size()); + settings.setValue("/geometry/split_e/w1", split->sizes().at(0)); + settings.setValue("/geometry/split_e/w2", split->sizes().at(1)); + + settings.setValue("/recentFiles", recentFiles); + settings.setValue("/recentFilesMax", MaxRecentFiles); + settings.setValue("/helpPath", pathHelp); + settings.setValue("/userFont", pathFont); + settings.setValue("/colComment",mglColorScheme[0].name()); + settings.setValue("/colString", mglColorScheme[1].name()); + settings.setValue("/colKeyword",mglColorScheme[2].name()); + settings.setValue("/colOption", mglColorScheme[3].name()); + settings.setValue("/colSuffix", mglColorScheme[4].name()); + settings.setValue("/colNumber", mglColorScheme[5].name()); + settings.setValue("/colACKeyword", mglColorScheme[6].name()); + settings.setValue("/colFCKeyword", mglColorScheme[7].name()); + settings.setValue("/colReserved", mglColorScheme[8].name()); + settings.setValue("/autoExec", mglAutoExecute); + settings.setValue("/autoSave", mglAutoSave); + settings.setValue("/autoPure", mglAutoPure); + settings.setValue("/editAtTop", editPosBottom); + settings.setValue("/fontFamily", defFontFamily); + settings.setValue("/fontSize", defFontSize); + settings.setValue("/loadInNewWnd", loadInNewWnd); + settings.setValue("/completer", mglCompleter); + settings.endGroup(); +} +//----------------------------------------------------------------------------- +void MainWindow::readSettings() +{ + QSettings settings("udav","UDAV"); + settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV"); + settings.beginGroup("/UDAV"); + pathHelp = settings.value("/helpPath", MGL_DOC_DIR).toString(); + if(pathHelp.isEmpty()) pathHelp=MGL_DOC_DIR; + MaxRecentFiles = settings.value("/recentFilesMax", 5).toInt(); + animDelay = settings.value("/animDelay", 500).toInt(); + resize(settings.value("/geometry/size", QSize(880,720)).toSize()); + QList le; + le.append(settings.value("/geometry/split_e/w1", 230).toInt()); + le.append(settings.value("/geometry/split_e/w2", 604).toInt()); + split->setSizes(le); + + pathFont = settings.value("/userFont", "").toString(); + mglColorScheme[0] = QColor(settings.value("/colComment","#007F00").toString()); + mglColorScheme[1] = QColor(settings.value("/colString", "#FF0000").toString()); + mglColorScheme[2] = QColor(settings.value("/colKeyword","#00007F").toString()); + mglColorScheme[3] = QColor(settings.value("/colOption", "#7F0000").toString()); + mglColorScheme[4] = QColor(settings.value("/colSuffix", "#7F0000").toString()); + mglColorScheme[5] = QColor(settings.value("/colNumber", "#0000FF").toString()); + mglColorScheme[6] = QColor(settings.value("/colACKeyword","#7F007F").toString()); + mglColorScheme[7] = QColor(settings.value("/colFCKeyword","#007F7F").toString()); + mglColorScheme[8] = QColor(settings.value("/colReserved", "#0000FF").toString()); + showHint = settings.value("/showHint", true).toBool(); + mglAutoSave = settings.value("/autoSave", false).toBool(); + mglAutoPure = settings.value("/autoPure", true).toBool(); + mglAutoExecute = settings.value("/autoExec", true).toBool(); + editPosBottom = settings.value("/editAtTop", false).toBool(); + mglCompleter = settings.value("/completer", true).toBool(); + loadInNewWnd = settings.value("/loadInNewWnd", false).toBool(); + defFontFamily = settings.value("/fontFamily", "Georgia").toString(); + defFontSize = settings.value("/fontSize", 10).toInt(); + edit->setEditorFont(); setEditPos(editPosBottom); + graph->setMGLFont(pathFont); + + defWidth = settings.value("/defWidth", 640).toInt(); + defHeight = settings.value("/defHeight", 480).toInt(); + graph->mgl->imgSize(defWidth, defHeight); + + recentFiles = settings.value("/recentFiles").toStringList(); + settings.endGroup(); + updateRecentFileItems(); +} +//----------------------------------------------------------------------------- +void MainWindow::setStatus(const QString &txt) +{ statusBar()->showMessage(txt, 2000); } +//----------------------------------------------------------------------------- +void MainWindow::setCurrentFile(const QString &fileName) +{ + filename = fileName; + graph->mgl->scriptName = filename; + edit->setModified(false); + if(filename.isEmpty()) + setWindowTitle(tr("untitled - UDAV")); + else + { + setWindowTitle(QFileInfo(filename).fileName()+tr(" - UDAV")); + int i = recentFiles.indexOf(filename); + if(i>=0) recentFiles.removeAt(i); + recentFiles.push_front(filename); + updateRecentFileItems(); + if(chdir(qPrintable(QFileInfo(filename).path()))) + QMessageBox::warning(this, tr("UDAV - save current"), + tr("Couldn't change to folder ")+QFileInfo(filename).path()); + } +} +//----------------------------------------------------------------------------- +void MainWindow::openRecentFile() +{ + QAction *a = qobject_cast(sender()); + if(!a) return; + if(edit->isModified()) + switch(QMessageBox::information(this, tr("UDAV - save current"), + tr("Do you want to save the changes to the document?"), + QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel)) + { + case QMessageBox::Yes: save(); break; + case QMessageBox::No: break; + default: return; + } + QString fn = recentFiles[a->data().toInt()]; + if(!fn.isEmpty()) load(fn); +} +//----------------------------------------------------------------------------- +void MainWindow::updateRecentFileItems() +{ + foreach(QWidget *w, QApplication::topLevelWidgets()) + { + MainWindow *wnd = qobject_cast(w); + if(wnd) wnd->updateRecent(); + } +} +//----------------------------------------------------------------------------- +void MainWindow::updateRecent() +{ + QAction *a; + fileMenu->clear(); qApp->processEvents(); + for(int i=0; iaddAction(text, this, SLOT(openRecentFile())); + a->setData(i); + } +} +//----------------------------------------------------------------------------- +void MainWindow::newDoc() +{ + MainWindow *ed = new MainWindow; + ed->show(); ed->activateWindow(); +} +//----------------------------------------------------------------------------- +void MainWindow::choose() +{ + if(edit->isModified()) + switch(QMessageBox::information(this, tr("UDAV - save current"), + tr("Do you want to save the changes to the document?"), + QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel)) + { + case QMessageBox::Yes: save(); break; + case QMessageBox::No: break; + default: return; + } + QSettings settings("udav","UDAV"); + settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV"); + settings.beginGroup("/UDAV"); + QString fn = QFileDialog::getOpenFileName(this, + tr("UDAV - Open file"), + settings.value("/filePath", MGL_DOC_DIR).toString(), + tr("MGL scripts (*.mgl)\nHDF5 files (*.hdf *.h5)\nText files (*.txt)\nData files (*.dat)\nAll files (*.*)")); + settings.endGroup(); + if(!fn.isEmpty()) load(fn); + else setStatus(tr("Loading aborted")); +} +//----------------------------------------------------------------------------- +void MainWindow::load(const QString &fileName, bool noNewWnd) +{ + // save current path + QFileInfo fi(fileName); + QSettings settings("udav","UDAV"); + settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV"); + settings.beginGroup("/UDAV"); + settings.setValue("/filePath", fi.absolutePath()); + settings.endGroup(); + // open new window if it is required + if(loadInNewWnd && !noNewWnd) + { + MainWindow *mw = new MainWindow; + mw->edit->load(fileName); + mw->show(); //ed->activateWindow(); + } + else edit->load(fileName); +} +//----------------------------------------------------------------------------- +void MainWindow::save() +{ + if(filename.isEmpty()) saveAs(); + else edit->save(filename); +} +//----------------------------------------------------------------------------- +void MainWindow::saveAs() +{ + QString fn; + fn = QFileDialog::getSaveFileName(this, tr("UDAV - save file"), "", + tr("MGL scripts (*.mgl)\nHDF5 files (*.hdf *.h5)\nAll files (*.*)")); + if(fn.isEmpty()) + { setStatus(tr("Saving aborted")); return; } + else + { + int nn=fn.length(); + if(fn[nn-4]!='.' && fn[nn-3]!='.') fn = fn + ".mgl"; + filename = fn; save(); + } +} +//----------------------------------------------------------------------------- +void MainWindow::setAsterix() +{ + if(edit->isModified()) + { + if(filename.isEmpty()) + setWindowTitle(tr("untitled* - UDAV")); + else + setWindowTitle(QFileInfo(filename).fileName()+tr("* - UDAV")); + } + else + { + if(filename.isEmpty()) + setWindowTitle(tr("untitled - UDAV")); + else + setWindowTitle(QFileInfo(filename).fileName()+tr(" - UDAV")); + } +} +//----------------------------------------------------------------------------- +void updateDataItems() +{ + foreach (QWidget *w, QApplication::topLevelWidgets()) + { + if(w->inherits("MainWindow")) + ((MainWindow *)w)->info->refresh(); + } +} +//----------------------------------------------------------------------------- +void MainWindow::addPanel(QWidget *w) +{ + DatPanel *d = dynamic_cast(w); + if(d) + { + ltab->addTab(d,QPixmap(":/xpm/x-office-spreadsheet.png"),d->dataName()); + ltab->setCurrentWidget(d); + } +} +//----------------------------------------------------------------------------- +MainWindow *findMain(QWidget *wnd) +{ + MainWindow *mw=0; + QObject *w=wnd; + + while(w) + { + mw = dynamic_cast(w); + if(mw) break; else w = w->parent(); + } + return mw; +} +//----------------------------------------------------------------------------- +void raisePanel(QWidget *w) +{ + MainWindow *mw=findMain(w); + if(mw) mw->rtab->setCurrentWidget(w); +} +//----------------------------------------------------------------------------- diff --git a/udav/udav_wnd.h b/udav/udav_wnd.h new file mode 100644 index 0000000..05515b2 --- /dev/null +++ b/udav/udav_wnd.h @@ -0,0 +1,127 @@ +/*************************************************************************** + * Copyright (C) 2008 by Alexey Balakin * + * mathgl.abalakin@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef UDAV_WND_H +#define UDAV_WND_H +//----------------------------------------------------------------------------- +#include +//----------------------------------------------------------------------------- +#ifndef UDAV_VERSION +#define UDAV_VERSION 7 +#endif +//----------------------------------------------------------------------------- +#ifndef MGL_DOC_DIR +#ifdef WIN32 +#define MGL_DOC_DIR "" +#else +#define MGL_DOC_DIR "/usr/local/share/doc/mathgl/" +#endif +#endif +//----------------------------------------------------------------------------- +class QSplitter; +class QTabWidget; +class QMenu; +class SetupDialog; +class InfoDialog; +class HintDialog; +class PlotPanel; +class MemPanel; +class HelpPanel; +class DatPanel; +class QDockWidget; +class CalcDialog; +class DataOpenDialog; +class QTextEdit; +class TextPanel; +//----------------------------------------------------------------------------- +extern int MaxRecentFiles; +extern int animDelay; +//----------------------------------------------------------------------------- +class MainWindow : public QMainWindow +{ +friend void raisePanel(QWidget *w); +Q_OBJECT +public: + QAction *ainfo, *acalc, *asave, *aload; + TextPanel *edit; + PlotPanel *graph; + MemPanel *info; + HelpPanel *hlp; + MainWindow(QWidget *wp=0); + void load(const QString &fileName, bool noNewWnd=false); + void writeSettings(); + +public slots: + void setEditPos(bool bottom); + void editPosChanged(); + +signals: + void gotoLine(int n,int i); + +protected: + void closeEvent ( QCloseEvent* ); + void dropEvent ( QDropEvent* ); + void dragEnterEvent( QDragEnterEvent* ); + +private slots: + void newDoc(); + void choose(); + void save(); + void saveAs(); + void addPanel(QWidget *); + + void about(); + void aboutQt(); + void openRecentFile(); + void showHelp(); + + void refreshData(); ///< refresh data in variables + void messClicked(); + void properties(); + void setAsterix(); + void warnChanged(); + + + void setCurrentFile(const QString &); + void setStatus(const QString &txt); +// void animParse(const QString &txt); + +private: + static int num_wnd; + QTabWidget *ltab, *rtab; + QSplitter *split; + QTextEdit *mess; ///< messages and warnings + QString filename; + QMenu *fileMenu; + QDockWidget *messWnd, *calcWnd; + CalcDialog *calc; ///< Calculator dock window + + void makeMenu(); + void makeDataMenu(); + void readSettings(); + QWidget *setupInfo(QWidget *par); + void updateRecentFileItems(); + void updateRecent(); +}; +//----------------------------------------------------------------------------- +MainWindow *findMain(QWidget *w); +void raisePanel(QWidget *w); +//----------------------------------------------------------------------------- +#endif +//----------------------------------------------------------------------------- diff --git a/udav/xpm/accessories-calculator.png b/udav/xpm/accessories-calculator.png new file mode 100644 index 0000000000000000000000000000000000000000..9248971a914ebd40b59fc3e5b0aa98cf24178447 GIT binary patch literal 686 zcmV;f0#W^mP)Mh53JODVWnpw>WFU8GbZ8({Xk{Qr zNlj3Y*^6%g00H_*L_t(I%bkU3zgc4(N=eS6`rHdkVHpB4Gd~^Q)%$TL+ z(nFxk*+$tcEtmAp-P>n6{p{&;+~39K*2_~jwpvG|(*f;v2Wy3)p>r%Q+ypoVG@A#f z0zSOo!&)IaY|(5Uas9?zq9uTtnYmK|Q&TyNF{moW7>qHAW|o#q8a3NIxPR}z{I5QG z!letDeg)lbkMinceswy1RTcdQKtzr$+*(=T)!GZZhl`VweBIy2`nm02#rPq#jrSEB$Z0h?RKfv zD@eQD#>XC2O+o^Q;}|e>Ivu?C0C-ibwdi0@EL@qI;r04D7{f$1%g#;%?_Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L00MRZ00MRa+F;{P00007bV*G`2iXN4 z6(kuBtzc#V00MeRL_t(I%bk*INRx3C#-IPL=9WvQgqBuhwz6_Umj!_trcuK1gV+s9 z#Jm+4CDgZOl7$JHb^{9xNytL1yi71OHJcD#Sk7i)N|cukxAod?`JO)5q#IfO;DN(A zJm(w^hv5$-X5^|ImdSGra039(lQd-Yn!>uW;SUS^&x)4a^s8Pf9+Jke2mSqfMZ`X9o7_ZaLPgW55`Lv9k?5=~pONy@A>FdavcC zF5cPK{Q|&O0PtI-iYloZ`#f7~BYNl{%Fq?jC=r=lL?$mW*B0DBM zp_lKq0FVm-NY8ut3_%cviogI*Puwh`pOxBtT7N_00a)Q{V7^lV0Jh$Oydtq;8GBh%MG}7oBAVY| zeA)(wJQx`6AHsv{dS71P3zA>Yz+pC)^;XYUCB z_TL)RMakwSwKb*4!Xr3i!y^(1zdwtMhrvF}P<^!#K*vJg2>;OV0&UkA<@b-1?i10W z;#)lGM>qg0ph?6(vG!=TJ-5?L1s{nIx^SDIQlH2Fpxm)LX48=j@7X~cNwsMMh53JODVWnpw>WFU8GbZ8({Xk{Qr zNlj3Y*^6%g00OH?L_t(I%axK#NK|nY#=rmEJLA1N*GDEB)OrZasDZh+oSvYeh-b)!X&wkCqi5%=xUSx|_F{6#zu1AgWFc?@DNvi{=o` zb31h=C3AB8Z6^Sj!X$=0S8gvrAf%45EJH13#vp`HP#BtSD3rqJ8l3DdD$D`Ha;MgE zVZf?F;{_`ZSZ+ivaM`C+Z(3 zy#C(dnS~`$HdpLVs~B>P!OCIcuN!O=LdQG1`sJDF`RueL>!EAy12@kc&bs9OG9O}C zlIXN&Rr?p0a@>O>s=)e6!>h0VgJY)~t7IxXFDosw6duS%G|xfRb@-M=47tYf&NZUN zanj`{?Kd7o1OPy7T|;7sZgB-3|fr;X0czA^&R5dAdz!r1Ht08mwZ p@_LOR#2;B$Sa_Y67yBrZ={HtPHeP&+9RvUX002ovPDHLkV1i2wZan}1 literal 0 HcmV?d00001 diff --git a/udav/xpm/diff.xpm b/udav/xpm/diff.xpm new file mode 100644 index 0000000..b90448a --- /dev/null +++ b/udav/xpm/diff.xpm @@ -0,0 +1,21 @@ +/* XPM */ +static const char * diff_xpm[] = { +"16 16 2 1", +" c None", +". c #000000", +" ", +" ", +" .. ", +" . . . ", +" . . ", +" .... . ", +" . . . .. ", +" . . . . . ", +" .. . . ", +" . .... ", +" . . . ", +" . . . . .", +" . .. . ", +" . .", +" ", +" "}; diff --git a/udav/xpm/diff2.xpm b/udav/xpm/diff2.xpm new file mode 100644 index 0000000..7a2d7eb --- /dev/null +++ b/udav/xpm/diff2.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static const char * diff2_xpm[] = { +"16 16 3 1", +" c None", +". c #000000", +"+ c #7F7F7F", +" ", +" ", +" ", +" ", +" . ", +" .. ", +" .+.. ", +" +. ..+ ", +" . .. ", +" .+ +.. ", +" +. ..+ ", +" . .. ", +" .+ +.. ", +" ............ ", +" ", +" "}; diff --git a/udav/xpm/document-export.png b/udav/xpm/document-export.png new file mode 100644 index 0000000000000000000000000000000000000000..eb82440191a12fece1743e145b534be260abcde2 GIT binary patch literal 1000 zcmV>P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXN4 z6gLZDy`V<#X}bY*F7WpXSa3TSk6a5^t9YH4k4VPh_Bb#rNB zXklz@E@OHM3S)9*VRU6=Aa`kWXdrZGWgtgMO;9WfXmoUNIxjDGcXuvlX>D*WZ*pg6 zipNI)00PiSL_t(I%cYQ8NYr^8#XrCQ+_X_s+s5vryHX8eTb7juX+2mO)JC9fP?Q7_ zn<0hmM!iHBK}8oT%9pYzLM&okq6=a-+q81Kpkg*TuDVW)JB@ee`t4z$EQ%gFZ|C8B zIOnLXCBN@!>z|;x+`b-QGO!d#F=*nAju`wu#^gJ9`N00&d_`(;(ed?(Q*DXX1WW78 zq_IWTxX84DK#<0+KAzUz4Yjm8nHKkA%Bj7VI==+a+eQ!0_qW{G()LQD_D(EArm^Vs z2G%ag9)cGfR}}i4-3I^{<@-1AgAR`)IPi$@^x5`I`^QNWUmMi&j@3j)wYA zLXXZAt4{#$P7@58P4YZ#IlGT%=r*ibMYE%QL`}s{lg4qrqLOuslPS~|1wyq(#i3Dp z1>oI|80tWI;qkEwww1NAVa+O993A0iHY2){XaJ!9~5AtHOX%#P|wA z=?QdYnYkI*M`?+Z;(|Q7`@LMKsN|Q7M8;%h;1U zJ8(Xk&CtVW{z!Yt$!k@3{Xq(r*htEqOQ-P!D?CL+y|ADg3Zh#k;VegI+;(IM48J$bTT$K`KFRgSg`nDMiXPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iXN4 z6gL@efJ?&w00M4FL_t(I%Z-s;Xw7jP#y{Wx|Hm4$GxNGxE$=U3q^KoVL@hB5t+f^x zE(n)WTq!AWv$!<0kk?WZGBFoQdCP@HYg*@!&gOVIXU_Tme*fRs#Wo{~&&AVo_4Iwd zk2EzkF~Zpi7u38~m<^u}O=Qo^Q`~s8g~IhB$bu|~;x##DE$(5NzCfGrim9%yZd28b z0J=!{y0L_3OIC2cteM*nHc+@&1U(>2V8V(o)Gh2_uWO~|)k}7<1>?Q1udlC9c<)J7 zp5s8pNp4=ZeusQ6Q|kC4N3-bd@e5oz*uY5IY&C3W@=RkKv7u% zw={vyD@7JM#@A)3N~9QI3Rl=pcjS=tKTfvL! z8ZL)hdD6R*u7_)g-zfg$7)S@yl!9^2dFNu{I7T{^bo(IhqCt!#sht7qkKQ3@_8dtb z#$F2{*#$F~GOn>0I)*DmQ8W}#1(Ozl?*|l$Cc&6K%Z}bQN>*iger7q59ZN;YQ`YJ| z+B+sAEiEk{8yXs>p1AXsyc?QR0rjJPL;-Zv5(YuaIOnj|l8fN@{&oBf`6;7B&U3J} zv(i{=y|orlLV@SKU-%bcD9o8Y9z@kxYrS(80Rj=mn&6)Su~*cCAbxnp7!gBcJ)!*C z_;*~a6s*U2Pr=3jYMgUEiXub|?=yM6%cvWJrSU2PWOeiD=zJrK2BI3RG z2$0D}Wb+Q|{=C72^7E5H0H1RaqN+w!No8UH9==K;y z08cd6u?+wK010qNS#tmY3ljhU3ljkVnw%H_000McNliru)dCU@CLGhY87Tk&0cuG^ zK~y-)t&mSkTTu|je{=7RRwR8Tg3!ua7TnbCTxO{o^9{0bS-(ZzvfXzh1jK^hz)d&Z zDuq%?vQkP(T7(e)MPi%YcgKY$#u$@SdNwl*bLN~gQZARbYqeUD5tyC*%iLU>XVGu+ z%b(xnqHiDJ&%R{C8KqK5$Km{VQ!h{7Xy?43mnSQoi^k%vwzBKmGBd8L(rh*fApjsE zJ@t&)W7>Wp4I*kr6}$~JG#W`y z)G#6Xf76e95r#Q(v5I2X42Kx^LBZUY}D`;qn5FxciLM_ej_ug~QY53}!mSE3t?zxwHpXWK} z-YY{xLmWiP&4!4S?k*w%Kv5JTBDA%&eg3uGxLj4$`u_gV)z$UX-EZzMEG>UI@$AWS zilRV7*e4MYCSOdRpPrujfO8S}0T9e=aBy(2)6B>@GdBL1m6a8m%_acuPRe$zP^sC?ptQ@-QuCrdb+y-7#+PUpcUVtdz^5edX(lyb1*!_e$Blc8obQwH#$sup8JB=Bvc!Ow=G z*-6m+%5D|1leTGT$1j$B5 z!fdikRugwB1Ui2tf$2`Cs$6Iq+eAmSpceO1_tfEhRq&rnel8l#`XLbf#oW=|JNFK@ zx{YSt#c`b3&tE*t)KL_Mns&sgw?H zR_E*#-}iCOW%^qVthMxdJ!;i`RF#jN58SHVMnvfM`;^P&KMMeOo`Es;DWUdV+^XA;@yOt3anNuJkLw5{>pnpK~-_iVXe&w ioE*P-eg7YR^T{{CBiU#D3&X0WbcEP)r z=%QrMoYg6I5Q8zI2z{r+`*EJ{?;HUbkH_CZ5WMl6-uwOj7XYs79-o!#x<`QQC33&t z6GagKA`<)Ovxtz%WH3!LjwJw56yf`R;=-jwgnGT6@Uqv9)oL{Wdc9ukbvhkNrBVtA z@N%8O_kC8Y743E#tu`Ffm|-fd_JdAsoVyL2ui8cJ8&F_^?HqA807Q$$M4`YxFn>} zXs}!^?*lG}b}iF1DVNJBKMP>n_RnB2czxz8+P3}4f9Mb3j-%#nF`Fa+0000UFWod3@ax5SUXmoUNIxjD3X>Dy`V=irVb7^B}VQg$JV|oe-V{&C- zbY)~9cWHEJAarPDAV*0}P%H{)baZe!FE4j@cP?jXZE!Aca%X3X$43AF0)$CKK~y-) zosvyRRACf`pSj)f=Fj9z;I%Q$k+M;2QBgD|6u8J1MHDVVC@g}Csliq)D#}F>R1gMI zv?vN9uqY^MThJnjM2er z*tjzZQ~_IohM*?d(88ZT78%aXyXViH;2#P!cXaKIt*nn#mz#sDYsxyRBZX^i&nNvY z!|UGX>ciJj;*mGYx;yU-{}qrteZJeB8awQX#;6}=+9+dz9;B^hBg-ombNT)Y{GmQ# z1>=94?<9FFC0|AcL_}oZb6R@S1CqM-L=p!tNYAS;()IMMw4S;y?*@nEcUhJtsg9)R zhVHYpJjTSt1mTi$w7?{V;sDV1aTK#e=lghu_XD3;vZxRO075}Q0RXz^f+)dPitQ(E z%-gYda01u!x!CiPi#;y^czkvr$ZTH&P@+)2qU%s20PVYX(wJDs%#2Mmq|uaE&)(MU z0PJaAf$|k1G6xV5B9Sl^Wic)tSjWw~4~WOA&hFy#?;glwrvv%h2{W;VNh9FnHS!gh7CNsvH<|wws9PX>FMctA?pDB z{r$MEo7eC>4_()D?>`lZMDjE6Jdbob&B(|InM?)|K}0YNgQ1}zLZMKuT9$=nS@~B` zN>N-~L@*f4eG&lIbrCfS6E%B2<@@;-!r?HbrKLopQ2?^pEI=;pcwHQ&6!E$`lu|5- lMst<}sgC3s;57fI&R>%|GfdSYVr>8b002ovPDHLkV1jlggmVA@ literal 0 HcmV?d00001 diff --git a/udav/xpm/edit-copy.png b/udav/xpm/edit-copy.png new file mode 100644 index 0000000000000000000000000000000000000000..8dd48c494924874a088590a749193994d075c22f GIT binary patch literal 498 zcmVl*+}S4tk-SEw(HMMH$UOFgT8OyWIuox(>z|!eNT?Q)#FJN+p=4fyzsz3(&M5 z1Oj8QEH>2c<<$iq9`D@|1fH*+ou9fEhcV03wkV2NSzd)@nNYt}lHgoRaN9}vHG1pg5Cj3DD1s1zdc6*S;N$b%7N-)ik literal 0 HcmV?d00001 diff --git a/udav/xpm/edit-cut.png b/udav/xpm/edit-cut.png new file mode 100644 index 0000000000000000000000000000000000000000..dc9eb9a7ad3e9500991938d0da531c06f90fea85 GIT binary patch literal 807 zcmV+?1K9kDP) z1Hh-$q?nqWnZ{11 z1JXGjGT#nH5JGSEt3`W-F{81UPnb`417>0bwH3tCzhB0pcmY+{X4F+L%h_RSnk|a_^$fF6B>ZO8Zd4#b& zIcbiYQS<4l$&8G?%anG5EK?xFunXWgL9J9WU-R-}CY`QnUJ$&B%*-pvkEGQ$e0RAv z4j($yFl({I2&EV>4gdf!007lmt}-!W5XkX| l!x~>C;!~(p=dGgX{tck>ItSb|!8`x}002ovPDHLkV1ju0W~TrE literal 0 HcmV?d00001 diff --git a/udav/xpm/edit-delete.png b/udav/xpm/edit-delete.png new file mode 100644 index 0000000000000000000000000000000000000000..184f7628513448fc324a4e2e38ae9ffd2b01a9b2 GIT binary patch literal 783 zcmV+q1MvKbP)3z=Ialx9i#G& z3;rD~Kq#pA77qj=<8w1G>Tx$w+fc*RD_w}90YS(k6b`ew5n*O_j-H3T0G&a__wo=> z-{d)0XtxjbbUz^SJwo5J=S+Q=WMyduv)Ra{u1?Ol-8hOIAi#~Aw*V@Fif>T^P+aO< zdiytE#JrCssJ>w4)Ps#1lz&qX}LOc(GY5M7Lx3 zCj!hbECAdCIPf6kQ~cLgLZRQ?#G$OL98ol2GUgN6h~W1J7#$r&)QW8H>=0CZt%n^1 z72iO8lLxEKN?(6J$z+mLDh&vvQz=wcMO9U7R+)<(ZS+2Qn(F~TdwUxl9T#}*^-|wZ z$7C?bgnyh9)zwS|0#vzb5OreKX60o*B%MTMMFo!1QkvbTDJ*i}C~;Ebs>NcpU@nl6 zBzH#~A}Zhir~wSW@m5ejW~>S|mR z$TH#ORo;&&jEx5XTGrRX%URc$ag~>W+kguw`6GV?J_7fHif;_g@O6LFo N002ovPDHLkV1grWPe1?w literal 0 HcmV?d00001 diff --git a/udav/xpm/edit-find.png b/udav/xpm/edit-find.png new file mode 100644 index 0000000000000000000000000000000000000000..d072d3cbe2dadb1494f77e950952123813613677 GIT binary patch literal 617 zcmV-v0+#)WP)4+SOttuFuo0rp8m zK~y-)osvy!6Hyq2pF7DUO`2wgN>U06wOwc$MHIn>xD*Oicj6|$z;CJaABeUjK|~aE zS$9RDeGK5zq#vnP18H_P9en3BbiKg914X(U4?fX zv=3%78D?M10+5(X0MN8+cL(3TuaZiqIeKc0ZN-aeE4XBZ)ck8EZr_Z=qW7OQ{wVDZ zG+iT=PIKtw7@rGX1_uI+90*bpKD5zs{F**C6zm9u?EJ zQ5_2JmL<2Flg761XDbP7v)0}Ku5Shi%_G^x}q%2kVgpPOH0wIvBfN{N(qOE7M? z3xuFtwW!u4n_D&9s)POg9;6U0U2p=nX__rgY-58pql(|7qW8J5Es5XbtmWcc6+03YVxryf3dbXat2*wyQorvicCWHaaM z^${Ko^E;cZ_ht1ff`3FT9+eG|{}KR{SUhS0lnsNw28{O8e>3MU00000NkvXXu0mjf D_c;L2 literal 0 HcmV?d00001 diff --git a/udav/xpm/edit-paste.png b/udav/xpm/edit-paste.png new file mode 100644 index 0000000000000000000000000000000000000000..24588a3a4d2356be517b0e066a489284f0326842 GIT binary patch literal 561 zcmV-10?z%3P)FTwJtjVg%6=aCXokI21)~9mK^!mx4G5j`|NYgS(rkOVuvAI4O}*sL@D5 zUT?|aXkli7aX_q`X+NwHimYrk&*ZqAx3 z1|BMmD;{?861m(FJkJ0iqO7cZU|;Pi1_5ZQ>aE8wSu*oyiTIugE}S_S`_jqqF38ff z9j2$JFlHMdtgWq+Ohh@F{LG}k&a>C6R#a0FAm({yEE@57U(d35{}DkDP^nZxtIf?F zB9%&U@9u3bX1*b+F(4Z0|J2@sL?VHzFf(&(FdpLZI9q?fsp)w=fNCfkmfyS$y$ksq zyD7pDoj#T4A6yV|!vVTWVS55qMMcP+JpO+Z6!JMl1Q9`1u+}m$ksb}u-zd^;ZvAMD zK7okqL8@P?G#d3CA%_72HRrm3R?E_;*C`gy58D)P*aX&YQ2Sm(M0)=9`Kw%>S{}Z_ z-Z7;aG)bp3q|+I)*~3`7fvRw0;aacRHyQ$Lis9!@1|a7y6KHYMyRt(@|#< z{cBq{wZeZJJbqvRywOcgMZ;bX8R({V0eC(qv{bfm zby!V}<`4o^j$zq9DScbv%ILiw6A^$HfESPQ`SbEnPO8~uyxOOpbRU~FfUe28J$qL8 z@C5Mk;kD~GW0^Bpm31snBktM&3_1-q+s@zOgv6zhyDTl6DE{o}owMVUv2>RDuXiL` z4H7gMZdG_i0!QlYIz4!@dkqC(K-FfCk4>lJ)_b!1Rd%EVnj)wji8Jm)7Zot;7MWwG z*gs|t5o;aT9wf2Ok6$@g1dX*be!bT##gp?c3Eq+E#Mh2RWxi- zG;9IzHaQf6fo=!vH>>VST}Z(FqG7KdPT<2cMZ+#dZlbEl2Y?p^`wGFq1RKr0vRaV6 z7^XIV*yPVOq9g;1-Im=i2krW;ncR=mZuykZ)veF3J9a;RB)EwqzyeSOHl8Hi?*hE} dMW^#GgWuOnx&>a(HQoRK002ovPDHLkV1oBE0Zsq_ literal 0 HcmV?d00001 diff --git a/udav/xpm/edit-select-all.png b/udav/xpm/edit-select-all.png new file mode 100644 index 0000000000000000000000000000000000000000..f4b0b19e0911c64b51a27f62439117b771c89a2d GIT binary patch literal 441 zcmV;q0Y?6bP)5 zlRZwuKoEuBShkdo6Ce-`g&oB%5D1AAAQ1N;1q8tjkfK1KNiIPN7oddNiR2Ov5h<~E z_fdp3{)rVb&8)pM-@G@{3Q0UZ4Mtk4OKcFX>yB@(@46s~{@~tdt!a#*F@{=eYOSf1 zqEd=kmNCmRrfJGFO}SVs_%Q4nl5l^40st@X2}ET1qmqkpcDR%GSO7!>B7!7IO2xkK zV>+FdzDri@f#k|*B7z_Yns?E7Q-Rnx+21PNIsZ`*$1&nK&TTd-5E1ykpBLKVPN(xX z(Q%pq7E)}k=0*TX0KjB2soAg*MG+jw$!k|yXt&!X1sBJAc>Vao`Oz-kKEKy1r~+;C zY&KiDbCm>MlzSK^K=cW00000NkvXXu0mjf50ACM literal 0 HcmV?d00001 diff --git a/udav/xpm/edit-undo.png b/udav/xpm/edit-undo.png new file mode 100644 index 0000000000000000000000000000000000000000..8b0fef9a8319452009247864c41e033694859278 GIT binary patch literal 650 zcmV;50(Jd~P)kSC&LBJ zfVRcM$?V1P3B6PcAX~#mZX7Dr0E-up6>u&Ai1M4+$6px*d6g)50zul{6fOZfD5 zx^(<(+NuITAZTdtF*`7sbB~Mx0Ae$D>fg&k;5u>{h0Ft(%sL2>YF!TkK|`BOGW-0q z$<55rD9F$#2!Mm7ygZedyZydz;2gN<0Fly!zty-=mBaVpcsEVu>hcW{d1#Z{npnGY zBY*fjmK0%?8^t(;YR@+XG=oH^Fxc%lEVS$r0NiT$nf{@pT|4*Ae2zV-96O_3`)`13 k>$j#pJbyuT?P=Bf1qBx3B`dxp6aWAK07*qoM6N<$g68)pi~s-t literal 0 HcmV?d00001 diff --git a/udav/xpm/film-b.png b/udav/xpm/film-b.png new file mode 100644 index 0000000000000000000000000000000000000000..edccf1bc8eaffd630c57ec6ce66d476014cde968 GIT binary patch literal 637 zcmV-@0)qXCP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iXM< z2^}wrwsp<`00I3;L_t(I%YBp2OH@%5$3N%(h-x6TCJ|Z$ZCnZY4@8TWwGt*5L%53; zfglKh#1KIsm_e&{79unuEkuY`Nxy>-B*I;}E26NWv6y%7JuO~u^iAT0%lE-K=lee2 z!+SDOH;i3bT;$8wZ;XtL(CKtIbkOj8bp;1dtyVd6_8h-|eWI_j$yWO$ zK=-+?vdP;Gi>k7|zD9q4mEqxGz~R8)Y>WGkXEjDeRZ)d3O8}$<#=zkU3=QQpgM-V` zYHa~vRN>Ed3xMmFRIC+@5xh5eZ!m_g-nwiA;OUblFIHE0{cZ!Nz;^p5-U~BLt0IcE zJK6K$+^{i^8UwH1eC*bZ5$La;z*=Fd7R7tP7_e3-XbNqNBi@_Ra%H0K0621LO;aA5 z7!`ml(^9jlk`m0#ot7@aorS>X_IaE$OpXTG{dVumceMZ&JF->JP_UMU&u}1+PxnB-4VY3xGhl=ni4T4R3j-V#>hXK-0;!ErINv4 Xj9eh&h1L$i00000NkvXXu0mjfb|Dzv literal 0 HcmV?d00001 diff --git a/udav/xpm/folder.png b/udav/xpm/folder.png new file mode 100644 index 0000000000000000000000000000000000000000..65bd0bbdcb9005cb8929f06e25d9cb15a926366a GIT binary patch literal 581 zcmV-L0=oT)P)2|yPkE-3> z-8b(3_?ov1cYiV%432IDm|3sa>)kUm%nWx2;PmwLe!t&8>~uQMm(4k6LI`Cz9Dc0p zx&Tx;XIE7wlL@7i6(oef_V#uMc)NrGOsCVTl=7;s>w_zRjH+U0Ymj!k-P+vTq}6H> zV^0g%)=c>R8-N-3GD0!|F@>GqJ z%4)bdf_Rm4wwyD#6GYg!0ieZcvQf+lK>!v2)x`$$R0x3iqPe(Z=9oKK7jS;E^w*b55oWe`mg~7=)i^mlj0C%nT8s$wuo= zb!&(s!bMVmQn@?FCx!@o{yMsKc&XWJj=)i68(aN%$9JEC^W*#Yp8+C_MZ$~UM;0NT T9Al?300000NkvXXu0mjfM@0T3 literal 0 HcmV?d00001 diff --git a/udav/xpm/format-indent-more.png b/udav/xpm/format-indent-more.png new file mode 100644 index 0000000000000000000000000000000000000000..00309ea573df7f92c9f60270e3d3a7730e814091 GIT binary patch literal 427 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6U4S$Y z{B+)352QE?JR*x37`TN&n2}-D90{Nxdx@v7EBh^GDFy{~^WP`Afu?ACx;TbdoSr+$ z-rFfrFYXWdpoOmbvW+6yGHewLf|x)on{iA9%>iWH5_N(QPL>L z5}FnC*_QX3Z{^onwwEipUsr; zk-x)3;CxGMPwH#8b(^GRtJ=Ayh(%d=pI(^f6uraacgZ^~w>ZtO=8O%Szo^Z<{pm*4 z1*i2FA1sb~`uAt&wb$JFXP>R_*xy>OwPWLvC1P6)pUOWmmb_)Iy4X%dVH?xM-l+#|Pz4YIK=E^Rr|Onpy9l5bXJrTqL?s1leN%JPHhLqh+g4J;Ac PLBZ_l>gTe~DWM4f10AN+ literal 0 HcmV?d00001 diff --git a/udav/xpm/func.xpm b/udav/xpm/func.xpm new file mode 100644 index 0000000..e62cfe7 --- /dev/null +++ b/udav/xpm/func.xpm @@ -0,0 +1,21 @@ +/* XPM */ +static const char * func_xpm[] = { +"16 16 2 1", +" c None", +". c #000000", +" ", +" ", +" ", +" . . . ", +" . . . ", +" . . . ", +" ... . . . . ", +" . . . . . ", +" . . .. . ", +" . . .. . ", +" . . . . . ", +" . . . . . ", +" . . ", +" . . ", +" ", +" "}; diff --git a/udav/xpm/go-down.png b/udav/xpm/go-down.png new file mode 100644 index 0000000000000000000000000000000000000000..3dd7fccdf06321880f69d65631a363e4b813ba04 GIT binary patch literal 683 zcmV;c0#yBpP)i}4~9FCHr5K@{qtRq-ka(iJ?ZP=uTm zA)-=KTXM11RS2~$6nm&uv{cQSuKf$?CbP4jht?XK7~kVJ-#qia^UW|KLbc-EY953z z>WRV7dqi_}NvUZfgl}C)!*&F0M_|b+V97E80CykVr~%gk05Haon|Y41T|%KagO77# zXg_$ht|?xxSRKlv`0H+L2mld?91sx{?rsQB5|>q-9K_b`yI?say^?H5vawt?QN0%L zQr8VKjyDQ9NJT;|(TgXq`xKW7BF8I9f|vxjL{S!?dO5hlaQ@UaF9;B#f^;@jnqQnt zF(N{uTTQn`k0*~rlb-kaSCCvlqKp-L5!3TI5NItHN89$(7@Zg?Pfm^Zz3vh1d@XXv z%dw2{#h9WC`nbQFn~GCVFR$PcMeY21IKx0j@A8ZjM9Y6Ue=LTlryr z>(@2W+wdKbgN~t*f$yfVK)ah_*yWGG{JKoJQ9bX-)!YpMx+aPwk<4VDSzECWL8lc@ z`=3~j{FA#{Y~yeIt$3GuF4Da7HUP}#KVRBt{l5SJIDAFD4*hqp0JED290h! zVU0NBR?cr`p~-QQ_EsWfBH@EQ`Nc0GKMZR^J`BSAxf26@WBs>$$pHKvI7xf7HPn_K z?i~+>+atsnZ|Jg4VBK;@=p(qz`$(+u}xd3d6n3+*N?MDJ7VE8(JO(EzhB^&{0eRn zE*?mNaRLBn_0NHlrd}YI5_3+{j?R9X$}BA9ySqF4x2)2Bd@j8KF~Xg@H(lYH;N~^f z^&poLB>)3X(jI*{c`tpTvp3}I9wGn`t_kK+f;Jb)x5~Mcm=MA{nSJ@R@P7JTO$g5q z)>vRYlF^9H&d+2YJejC8!ZrPk8zPM`j$uE{Us}u$`^<2oGynhq07*qoM6N<$f}(68 A0{{R3 literal 0 HcmV?d00001 diff --git a/udav/xpm/go-last.png b/udav/xpm/go-last.png new file mode 100644 index 0000000000000000000000000000000000000000..6e904efd06236206721c6a662ec8ecfe74e971c5 GIT binary patch literal 685 zcmV;e0#f~nP)5 zlTApJQ51%s``vp#$I+r-vIvbVCs0U1TC~hLW^i)Pz0@_MiE-%s!hV+qFhuE z1Zm_VBKtFl7NgQ1VznuPg3$S4O4HHl`{uj1g=uPI)C+fW&f$UkzUK&QElXA3suR|5 zJ<;J``J?$u(U`UXPO+vn)Kyk&?u@qR+tHXVUkqlzip{BLi%w!$yRaxEd1FmzWb`T3ks8r@G#>8hztmaZq7PV0 zbE3nanxCyZt880y97jl`qmV)&9f_2Z=U?uj9L4I=^=w>K!{FN|e&4{&F>6dCFan?e zj0t%B{u)}App{FB8^U#6l+*|z$>u-tJ)Ndz>rP!+QC-#j=G5`zmT}-uUontb9=r!a)e|uV|)6#W_-^(UF2DL6`zGMn!p-|9fRGGizh?e=&U5++$Mxhv T)(+xx00000NkvXXu0mjfgrPr^ literal 0 HcmV?d00001 diff --git a/udav/xpm/go-next-b.png b/udav/xpm/go-next-b.png new file mode 100644 index 0000000000000000000000000000000000000000..1f48daf90c7cf2bc300009a74fd5e95cf895abbc GIT binary patch literal 655 zcmV;A0&x9_P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXM< z2^<%@ulx}J00Iw5L_t(I%axPAOIuMC$3O49mzTt}RjSZQc`r+G(9OYrL8Rc=$;MWf zqID^BkrpRMy9sF@g$hCj1)+*K1*|xgf^-q;RZH7MB@)u)pu_y+cq)&GHm-_hav`pgPj~67WL-l8$SsAS*5(B0931Wa=8MT%qd4lisR$&oS#=I z6lx7XtyU+UJ|h$oV|@H+M=a*PcHJj$EdZs8TwHv*bem13az>$W2azzA6+ZYg1CYgL+Dwi{xS_fCh z*v`r`GcPEW0uBxedS}P;>-FlaQeN_!;o3Q|R0>#I+pXksd)dp9uQ{=u0^7b@s@3uv pS_e0NrZx&>w_44;YbCikeggpt5(c;GKQjOT002ovPDHLkV1iop6m0+i literal 0 HcmV?d00001 diff --git a/udav/xpm/go-next.png b/udav/xpm/go-next.png new file mode 100644 index 0000000000000000000000000000000000000000..6ef8de76e0f5bf01c09da24a07c61cfe558d7a4b GIT binary patch literal 676 zcmV;V0$crwP)5 zl1oTbVI0MO-{a21M#B_R#9l-oXcPp6(?)2~B7y{4Mu9@O$#RS~LMu0okc%jC6BNCq zMPfd15iMrWDWnuP(IPA}ow0!)<9P4f`?UyPGZWN-v-$pq!}*{8hcSkHhP!mEu~WAd zo8?nd1jeIrclCk3aF;a@j#!~$nl%(P0Jzf98$5aR>}dqE;fU4n-v&x*nhu}wwKrd{ z4f;b9;fU2%OeY#6`YVQ=TOJkJo9%;vsn26nmF>ePxAA!V*2;(ZnPFo%AB#FaHw-$p z>A83xDHKX5gpddX0EtgSc(|1Lcd)Cxp7`{*Gd4M}fH9|HQD+7~1Grv}*vDrmsZm0K z5C{Q60m5V1o+G_9&%wGQR!!BO+NWc8C&Ce{BNlb~H9*c=C7oHocC*-S7Ns<$C1sQZ zLijB|M!48sj(1C=)P(9pYjao0(5pv%$FEw)G{Dl2Io>Bnm(2P=eF~WywGEfv2*dEE+1BNH1p0gO_(!va6Ym6#!ZeU0XL$ zmOyFA$XqYlC#eqYr*8WRCf~&E#M}5+`DMhod1o}n6nu_w#4?v#yZPlMNv2Zf#pvLQ?bsc$8%}?|wxEMGI60fdRAO~{ zc52bv6uF?Yza^+BugrY=o*FhT7dA)!rvyS0Urwj)#iE6g^YI%&-U+mBcICDJ0000< KMNUMnLSTZVNH5j^ literal 0 HcmV?d00001 diff --git a/udav/xpm/go-previous-b.png b/udav/xpm/go-previous-b.png new file mode 100644 index 0000000000000000000000000000000000000000..7c8443a5dfacbe164c017cf0c9ba5d4cfcd4e231 GIT binary patch literal 645 zcmV;00($+4P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXM< z2^MQ00IR`L_t(I%cYaeOH@%9#-B6ielv^)A&%)VcTt;2+=Q*1rKq<7BO?N% zoT;|`0WL&ZIJ;@tmxxQ}=HOr#Qxt|vB{)O2tlW6H{K)h?iS6wln3%|dF&^0V47K>bGa~vEd9A`UrRF~o7Ak7HnVb}k`Ekj>X4BTtN6&SD!IHAqR|oFR^Z z)zy7y8vp%l7)m%!l2ozn@(0VxJ#?IVW~~-rbMp&SH4Vei!8ya}sYDPoAjD4yaSX;d z6eW!?>^<*697phdiIWonA^{ z6pMY3lHhp~Ld0k^A^^b3O7%R!*%%q)OS*n_Y7+V)9 zmC~w(LdhH&>Snsmv9Rz8uDi%CwaTu$_%4paJ6l_C_m`JHHa#!uxQT5ET1!&ZuCXvY fu-Xyef4}oDtuHO)($Ngd00000NkvXXu0mjf!C)N9 literal 0 HcmV?d00001 diff --git a/udav/xpm/go-previous.png b/udav/xpm/go-previous.png new file mode 100644 index 0000000000000000000000000000000000000000..659cd90d7f80488a8a6a2c12f6f9e5ad98720461 GIT binary patch literal 655 zcmV;A0&x9_P)_fWZPlDqB9?#%D^>oA$FjP8SXdVl!5?|TnYO4RbBH?=GA zTUy2|reO<?=@r%h} zW6#cJQfPC~s>mwxzQ}>D!BbZalds_8_h}r7_JCAa@f4F))r6lUrCf(hQ;9=;jU5L& z+1FnmP_XjQREAhnABYqX00}@!0U-tMq%XJx@e~^h8rvWApSa|&uWz9Di?6_?1E%N@ zl4EB68Hfl3f`qGnd$iXb;n;2VsHt)P`R?O`My|Agci-NCF&}hI2Ui3vQGjU{P_$N1 zwo6b*g`Wk{x;wF^0p~U>`wvX#H%c-OZ~=##s0b5Wa!4-09SO%4;Ep?Tu9$V#I5TQr z&Mtkq{`h6ugzb~9dlQg)8A30C1pt3Qg&t7B3bbY+H`>YWThbX9oF#2!=nK7F-=6arTX3U&+XWy2~<%(BYwFX|c pI#R>7P%^)q3wROKeC1m2{15 zlTT<9K@`TnH@h?0jfHw>O#jh>1nt2m6SAzrkW<%*%=Q}tRboP9pC%r$9&(LA+0sq)ybQD9srhR zz3Fxu)^6aqJl)?FN%nOeOgb)4?+M_zJQ@)DvRBSb2FFH|!GH*69hXP{3*flC1BAti zbJNzAm&ca3iTKDR3xq|-Y2`eKx?tij|4I5$vH1yqf%5H^Fb8J54jK)5$VM-C5%i8b<|k&Kxh=#FG>Ox&>r z4?sb}hlkg>1-vahgJcyDBP0eg&{{(&pkA-x@zeQAv9vj35<}`!ZpEItce&w-qk8xH z6RRw9@QrP7!N5#{!3lE@ZdYYZTfgiFi6Lb!&3aDLCbZTHrTP~zgJ5t59%w*hOF`+NI2)I=27rUhYPA{fkR=AtN%&3O=!O6c#w zgNHJ+H0n~2Y;&wXAav;9(TjQzL8w@v5Muu6P#q*u5HWM5Al2M&Zzsi}i+t|S=lMJj z-$ww1!U2Cg9&goJ8~jHJAuQ80LoGLM-vz)Qd>q$%tUy<196$kVPM)2gVSav&SS+^d zWLuhz;^GqWa_uA%31bVeO^w5aM=+E^845!hNGTCQ0-A)@BrGclx&t7DVD{YzUneK| zmX`~F{l_XrZZ}0|&Z4FM2LQo`=iRLJ58!TY#?g2Y5G?ieG11<^a(z9X)?29o3-8BR z>mR^(=`tH5qm1Wf1K^6h#e1inpghU%p5JBpCom zX@J&ug>_1nD_ViHpC&o}X%t*pQO2uOM2{pkkqP@L1*MFrp zC@d}Iqd!2pQq(-SPg;Hfrqe-fcQ={o=}bL*M2V{`HQ+$i31~de>t|2-os&b=IUgRc zj}6o0Ra+aX@dAaXPo-V~ttoH0$?Wk8-b_xhv@i#N<9n3iP>`e5)mXbFQ3zoH#=(L^ y066O!@YFTzI9QUpl-3qNDHRHIb?*6{0saEH733-q6JhuO0000f| literal 0 HcmV?d00001 diff --git a/udav/xpm/help-faq.png b/udav/xpm/help-faq.png new file mode 100644 index 0000000000000000000000000000000000000000..f6bc72100da287d0cb7051d6603245f2966cb8cf GIT binary patch literal 744 zcmVP)oPb4)T3oLt7x$JT$~qR7%w zX;B;Vvl(YF6GaenOAK@=bYzU z0stu`*krO)f9x#CxgN8m;wMyi0c+htr80DLDypdfcNtY=Tg*^-1_?a#QC9m z2q7|N+%va7e_GLKe0-d5ZhPGdH$o(tOO)y1pi(Xw@PzR zaQ-x$eU6~AxxLX+dZnz=Qd6t^M@eR|A6bwS8V^;fu-gq`|epSR1}WIwLM4>DvC1=5ylwHOe~Ibj=R@# zaHl*Qd08j0_FDsE93n1M&KZ`yJFuE_p>PHw0strnJ^-96#;XgSUFaZG6rVA?;@pG= z>!qVEf&l;#fpc!evUe9&^I0gI8%msWJRM&(H~$(ok6(bIm6l1J-Jg&d&cR|xaAR-VE28Ra_3yUEp0sFhT*)SlDWLw?k zWGi7ZslP(|k;j9>ul550p9FwNIE<#Irg@fkA-`k!+_KSy7`^N`Ze@Bs9< zcwn>HJP?tGqoX6f^>wd)Y{mrId)g~{T`vMY-(OuyDILz9Lm#NK)0W}r?RIo@wM`f< zB%`&lbuktRnMYrbY^`s2#nF6ob5}4e^^^^ea{v-oa2$5~vrMq`sc1B6Zm~T%#*W=0000PA*Jh9cyFkzj@8Rl|wrzVTrBXP&dB3J>#|R-SugBk% zQvirYqqMm>>a}er>^IE=b=zwDw%6CU-;edVC0UXvrQV8)@*NEg^|8w8s-wMk@3{m) z5DdQwv9+buH##=DA+RwJitcPWQ{c-l?dm%3^LRXjXE~V4#HQxP8%)z`E?>IBeEIo= zXE{_=g(%1n4ZqohUDvZSiO<|ww2@9*NaZ+FRT!oTYMSOu zxT31XveKPBcW%Fb*#BVO?P4e~1E5rZtVq1Kx94ql_f1=tlvVC#ZWx9EAr_1ASS)6D zcAgzBG1uK1dpRn-8Xv0^C6N~w8`4nxd8Vd15?NZwyc>M>v}ta3mIi}m;?U6Ga#=8R z{iid=<8cCTmQLG+FGk`QHO5-99GR_^wLuP0Yk5IQC6dQespN^NsgHcm?!BdCtrwh} zoTT79@5A)OrpNvLR}UXLvX2Av1f20K)ag$XX8*vzwYIkQgXDK5a26M30`3KnQ507S u0BqY40B8VL|GG__b7c)iIOqC5SM@u(HR(kN;XjH10000tKSAuPT^ z91PmH7$pWpLv&PdkVkw#OnB5_ppT>Ude`f5Eq@mvQDHNFr(Ztb;M~g+f8*d7hIb$#Dq+*VcBb zw^%G@0cr|@P_pff(qDp5ZOE$zm4}Mr@Amum+q#}xWEiGgmSs|16C6|&e|JTt&utp{ z6;)M>RaI4vrfEAOwlN&`dOYrn&z}v8lQUDzWwLzM!_1}7M_~3zeEbF?!DXNOJmH;6@CaXadC4f>SlB?9~^==XZW-Y5h6a>&s zibOI&-IB2;7=}eqt$|@0h{cAiL^8GH68J;g+_Lf*d;3P8{W`m9 zn)$np4NWluvd*chibU!soT7u#(Gh!LX+H1sRbDyXTK{t9^VEV-tlmdp;PeDuql&y}fd_3LJak)NNw**46p-^b^ z&mj@ZvI1LY9)KZ9VhI3jyWj)BQ;>C05H|LF21==yQc8B=0{%yS0XCc#NPdKXNB{r; M07*qoM6N<$f~CAw@c;k- literal 0 HcmV?d00001 diff --git a/udav/xpm/none.xpm b/udav/xpm/none.xpm new file mode 100644 index 0000000..e81575f --- /dev/null +++ b/udav/xpm/none.xpm @@ -0,0 +1,21 @@ +/* XPM */ +static const char * none_xpm[] = { +"16 16 2 1", +" c None", +". c #000000", +"................", +".. ..", +". . . .", +". . . .", +". . . .", +". . . .", +". . . .", +". .. .", +". .. .", +". . . .", +". . . .", +". . . .", +". . . .", +". . . .", +".. ..", +"................"}; diff --git a/udav/xpm/object-rotate-right.png b/udav/xpm/object-rotate-right.png new file mode 100644 index 0000000000000000000000000000000000000000..49e5727cd3ef39e071685fb7c02e675515b3e1a0 GIT binary patch literal 632 zcmV-;0*C#HP)5lTAoeQ5c4wbLa2g8I24T z3Cth^DG{}(cDe~la2bJ(B!;wVQ=1lUqD{Lt5kWr)5iO!xw5W`-A8-+IXB46$n>LnZ z<)n<>d%btg*J4U@yc6`o2ZxXEeK_akI|^WOsOoIsE}cen6hK8Hz7aEjfEp90Fw%a5 zQU0Y&f5g{LUc{Rh@#aOlKPAY2l)}Uv{r=3p#ff7{JJZMZFs}lz(@4jaJbL=k@2-M~ zg|h0QdJBv1o=fiHV4>(1dONT4>~DavdejiOrSctc=aBqcWO|HLQ>$tjepnq%r0%^s z%C>a?rHnvy5u>T6RE_&lb)673!CydTUJy%KG@rOy6;D*(TnC86&2!n~4MAq8mdsEs zlc!p|*~iyhRlf%!76dLbGmg1+w@NkdYO#-Sa7_l~dVPpZepTXfuu%PQHhl8r3nNNjFJivHe^5Z7wTXWIMz zIVlJt0aA1jZw_T{KnMQDKXcJAvz3NOi*-Jx&U@RU3MCg zz!Ux9wgjVnqH}je0#EETV)xTk(Hshy&;6gd9HN((Ld~Iz6b3f=aN=#)Y=sMXW9~6k=xULU18eq^Pwm5>f&c14BZf zYe95nK#JnRiH*==SAxmkLmxdrjL^?BWW`;2x>%z19x#ygF@3}wxCj{ps zol&BI3dr$TBKH?fG@Vgwj@VLE`>*x`sHT~#`1-X0&1|$C>5O7D8g(O`Q4IH5!>UCA z#B@f9T4bxM*W2c190hpr@ILWaLI!dGBA^c595S9hn=kAOg|QenCF1t1xZCGP(7 zj844Dzcfmf65S_zD3%MD6HEfSt3fc5It c #C3E336", +", c #98F563", +"' c #3FF6BC", +") c #07D5F5", +"! c #0E9EEA", +"~ c #F44C0A", +"{ c #FC0E00", +"] c #FB1900", +"^ c #FF5B00", +"/ c #F7C407", +"( c #B5FD49", +"_ c #4BFFB3", +": c #0BF6F3", +"< c #05D9F9", +"[ c #0CD2F2", +"} c #14DEEB", +"| c #1BF0E3", +"1 c #20FEDE", +"2 c #27FFD7", +"3 c #2BFDD3", +"4 c #3BEEC3", +"5 c #F14F0A", +"6 c #FC1400", +"7 c #FB1700", +"8 c #FF5000", +"9 c #FBBA03", +"0 c #B8FD46", +"a c #39FCC5", +"b c #01CAFE", +"c c #0088FF", +"d c #0075FF", +"e c #008FFF", +"f c #01CCFE", +"g c #22FCDC", +"h c #73FF8B", +"i c #BAFC44", +"j c #D3E228", +"k c #F47B0A", +"l c #FF8C00", +"m c #F4BA0A", +"n c #CBE733", +"o c #7DFC81", +"p c #2BEDD3", +"q c #03C1FB", +"r c #0090FF", +"s c #0082FF", +"t c #009DFF", +"u c #08D4F7", +"v c #3AFAC4", +"w c #98FF66", +"x c #E7EF18", +"y c #FEBC01", +"z c #F4920A", +"A c #F4AD0B", +"B c #D4F62A", +"C c #63FD9B", +"D c #16D9E9", +"E c #0296FD", +"F c #0063FF", +"G c #0059FF", +"H c #0076FF", +"I c #00B6FF", +"J c #1AF2E4", +"K c #6EFF90", +"L c #C8FD36", +"M c #F9E306", +"N c #FFB900", +"O c #FFA800", +"P c #F4AF0B", +"Q c #EFBD0D", +"R c #A0FF5E", +"S c #1BF3E3", +"T c #009CFF", +"U c #0056FF", +"V c #0041FF", +"W c #005DFF", +"X c #00A0FF", +"Y c #0EEEF0", +"Z c #5FFF9F", +"` c #B7FF47", +" . c #F1FA0D", +".. c #F9E606", +"+. c #F0E70E", +"@. c #D4F42A", +"#. c #9CF05F", +"$. c #F4AA0A", +"%. c #DFF01F", +"&. c #8DFD71", +"*. c #4CF4B2", +"=. c #2DDFD1", +"-. c #21D5DE", +";. c #1CDFE2", +">. c #20F4DE", +",. c #3BFFC3", +"'. c #79FF85", +"). c #80FF7E", +"!. c #72FE8C", +"~. c #51FAAD", +"{. c #28EFD6", +"]. c #14CDEA", +"^. c #F4760A", +"/. c #FF6B00", +"(. c #FD6D00", +"_. c #F87A05", +":. c #F1910C", +"<. c #E9B615", +"[. c #D8DF26", +"}. c #B2FC4C", +"|. c #70FF8E", +"1. c #2DFED1", +"2. c #0BE3F3", +"3. c #04B9FB", +"4. c #0099FE", +"5. c #0085FF", +"6. c #007EFF", +"7. c #0A84F4", +"8. c #F1480A", +"9. c #EA0500", +"0. c #C50000", +"a. c #B30000", +"b. c #BB0100", +"c. c #DA0600", +"d. c #FA3500", +"e. c #FCB403", +"f. c #ACFD52", +"g. c #24F8DA", +"h. c #00A5FF", +"i. c #0036FF", +"j. c #0046FF", +"k. c #007FFF", +"l. c #11C0EA", +"m. c #F4440A", +"n. c #E10100", +"o. c #B20000", +"p. c #990000", +"q. c #9B0000", +"r. c #B90000", +"s. c #EB0500", +"t. c #FF6700", +"u. c #E9E716", +"v. c #75FF89", +"w. c #1EE7E0", +"x. c #09B9F6", +"y. c #06ACF8", +"z. c #11C6ED", +"A. c #38F0C6", +"B. c #8FF26F", +"C. c #E9630E", +"D. c #F43606", +"E. c #E92406", +"F. c #E02006", +"G. c #DE2006", +"H. c #F43706", +"I. c #F56806", +"J. c #F5A106", +"K. c #EBCC11", +"L. c #CED92D", +"M. c #B9DB41", +"N. c #B9DD43", +"O. c #C8D933", +"P. c #E3CE18", +"Q. c #E8AB10", +" ", +" ", +" ", +". + @ # $ % & * = - ; > , ' ) ! ", +"~ { ] ^ / ( _ : < [ } | 1 2 3 4 ", +"5 6 7 8 9 0 a b c d e f g h i j ", +"k l m n o p q r s t u v w x y z ", +"A B C D E F G H I J K L M N O P ", +"Q R S T U V W X Y Z ` ...+.@.#.", +"$.%.&.*.=.-.;.>.,.Z '.).!.~.{.].", +"^./.(._.:.<.[.}.|.1.2.3.4.5.6.7.", +"8.9.0.a.b.c.d.e.f.g.h.U i.j.k.l.", +"m.n.o.p.q.r.s.t.u.v.w.x.y.z.A.B.", +"C.D.E.F.G.E.H.I.J.K.L.M.N.O.P.Q.", +" ", +" "}; diff --git a/udav/xpm/process-stop.png b/udav/xpm/process-stop.png new file mode 100644 index 0000000000000000000000000000000000000000..ab6808fba55428710250c72b2569ca5288cd6df2 GIT binary patch literal 820 zcmV-41Izr0P)Mc{ zK~y-)ZIioCQ(+i~pL6L2ZH>mr;3bB}Kr47@YPbohHi(*-khrlBSo{xMIye|<92`s> zj0 zfhzpM@ALIWhKAhp&ub29c4n916Y9^A&F#&y1u(Xj-$dR3#d>J@)tT!?^ zxB;)Of@N(J5UR>rI!z!F(O2i@jx3c*X9mOJ=UQhb^X7PCW6$}40e3bY$EvSKkHsLF zL}s%av!6J@-n)0HBoY{3zj8br){Ru^=#NAqsP(AolnVvazCP5J7L<+- z`2HPr|9>&Rx53dc9cF)8t|?gl%I3HXy4zQg`&b zxfypTgs$s291eB|gVcpW$SN$#WyIXvUjZpZ4OUxP@ZP$G)9YnD9%prQ6sO07@7_H; z?d_Pk9LBeA$dwfUbSdSAnqeR;i@LTpTvd2+co^F>(SQT}{nVX0#rlH>plR6EqS^&1 zyDP=w;XqrPR!Sr&y?#yQ=T8=H-lUw#P+nXl_v#gEv$G^`-$v0ie11Rar6v2v@^W5@ zfm4IGCmR~NTZ2JYDjsL8Sgb8;>r)&K8k(9&7YgEII=x^+r#1#60#9C-Mn2yDwjT2}2(B$L*s yY<9+mt|%;SyT+{|0(y3`SA}UC&P8E)GxrC_O;YyPhW8Wz0000AjQodNDi79I5|3(RJen zPo0{EhVu`FIhs1;8#^*ol`_^Ua5ZgRTEO;6WS?JG1xHlIrtQ_)g8XMypD%bh92XZL%@y~j=r?zX#<>_Ay zj?MhVvcApGd@i4rvfN_pU)QGW`q#B_OPRhKo8-;yZEvqm4`R9-*L?7~b=36Kx*Zc}(y&$D=J@HUQ8!MxuejCZ|M!i% z&Q&&tS9kw!Gf+%;qdi-?J-PWx^^%|^_nzBbuuzY(&i>xb{mc-+2*wv2(<2J_t+h+ zs5rlI{^p#SO2-|aiODDi-jZP}W|aE1)~BmOR3$EA(Vi@w>U%ZDa$9qM8}c0HKK>=@ z`d4d)YqwsmShMx=n<-}wTJ%-CXPi)?Z+d)E$Kx3$zTq0>%B>G-<`ESK<06 zKLv;!Rde(>`RU=L2g~Ovo%n1M@bQ?*+>S*Vvl$k=|9v$za@qmb9gNTaiaD`NnxMxo zp5*#q&TW}{<`>WDw{ULpSLj^#x@qe3m+d`GEQ*uw+Md|dvtPsTSdE!)vF)Ukp32Aj azp#b`#_#;I)BX+6mkge+elF{r5}E*#afeO- literal 0 HcmV?d00001 diff --git a/udav/xpm/tran.xpm b/udav/xpm/tran.xpm new file mode 100644 index 0000000..29fa1ee --- /dev/null +++ b/udav/xpm/tran.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static const char * tran_xpm[] = { +"16 16 4 1", +" c None", +". c #000000", +"+ c #FF0000", +"@ c #0000FF", +" ", +" ", +" ......++++++++ ", +" . . + ", +" . . ..+ + + ++ ", +" . . + ", +" . . ..+ + + ++ ", +" .++++.++++++++ ", +" . . .. ", +" . . @ ", +" . . .. @@@ ", +" . . @ ", +" . . .. @ ", +" . . @@ ", +" . . .. @@@ ", +" ...... "}; diff --git a/udav/xpm/udav.png b/udav/xpm/udav.png new file mode 100644 index 0000000000000000000000000000000000000000..76ba7d97bebda3275a4a690afed0c2bc45e2bd7b GIT binary patch literal 4139 zcmV+`5Y+F9P)Nkl z%_Tty300s%t4J*$l0XVdo2F^vl$$URAVRURv5k$f9bb0Y%em~?bD7IK{V?a8oqc!a z>;)TCsYiM=b8a*5^M9ZF^NjF3k5A?$#N5w5{>2y{Bcq~0v%U;+-+1fIyua|k7#{<} zDiHyM7a(T87mefj2g0}j%xeK=)pIRm_r+X>XOV1B69{=erNX!XjO&4OErf`WgdoE~ z0NelwazQlLtJRDh6x696FygqTr>rAvdc#9eRhxDmm)0mMS2A*dcaJ9OpS7k}zg)M_;j zA34I^XU<-w0MKM!1;K7y$7x*4o$(-xlLoQ4I6w$xM~yZV3js(2^nYG4uy@!A z3#?cH#Ui}^I?w;|mwe%sz1Jzb?cv$F{S{ZKaxrR z&z3D$(SPNYaK#mH$t6%IK(WZ+i4#1%Zv6E-4jsNxVK_*ZqIyj!Z~|*xFbKv+V7|#< zTsg)TJv~sX!KqVB=JUi1gGW0%Uie0_bW32jgF7E(Ta?&h zVIUZbWZsBi-fU15C@tV>^*X0conmTgiq3c6C6P!VrDVENp;#zTER~u!PAdS|%I-I> zX@@M@TPO$%kpLBdAahMJ0~8Mdp=ArIl?sk+Qz#UO83vlJ`##WhaU2KBwy_;23;;`2 zr;wcwMv~4#Krj~Q>QsYghA^K{KnRtBCWE3@LkKZ<^`1w=FlUtAHzELFZtl=}ISMF? z0U%QJRk2S*991dN0bRN-UPv;~Od$jyG%W~#y};cMQ-g*#5h6+oBHZ8{=3^ndoorC^ zy-F$oEn~P_6W@r^H6a8$T=`Idc^jyQP_;p|00qCd8q_eL;ek>V08P=4DU39CH`zE( z1ze-3xw+Lg*6Y2(a zE*4?+6AB1XsxT`u{PLII-}?63|H0VUI6I~HUkwJ;=uc%rv`LxOs8LOzv@nAhW(30$ zoS+AYhgkhYz%C?0b|$zx`aSoI{K=bdzQD0#@8dW-UT*BH8vfdCEWT>!!kAYRC^?fn zMFJ4I`$j|nWGeb@D)u4h6=FavoqqU_w{6?To;^P$pD*CLJKt>l-U|W13SmBK*X@X~ z*=QUCg_+qN!DtioXc5fE+5n*%NfR(PYDhshj3j7&x0$j zxSR$+LJ?&(-PIy$26jZAV29KqR1jo@3W%@*roI3Pm;*#2@%=A(UY^Ox38a)r=>u*U z23KEwHNCw(Joun@`NTw#U;la!2M>Pfl%fJE^WHqWZYc)Sh$zg=QG-AnAcSJ=69HeJ zQruJUm=1AODNWmb6L@%@&p3E!nnpZs(%IR`s#Pnw{`%`#vBJbK;Hjtf@Y-u%JgqR* z^ySq6RT?x6lmo|d;Qe&qcg_C=;{vxC7zF`PeSR1KnGgyE07%AS_kTu8$?RZDpz9i@ zY0}r%$L7tOx$U+gF1-|9eioW zW>k?=tpK&iws-6gxeA)zmYrdgpC`&!nN04e90Sc z+;T#(3(he~h7~3Bh{YIy;d#S(z|geetmk<+j!m&xWZ%C1 z*tU(Xe~~-xfJYv=nJrtMzx3sozi?b($OyTIx)!lOiVTI-rbZak?LG^WkXgT%a=7k! z!#05Hx=c@(IdbF(&pr1lFT4QPT?gO#){Si1^zWyQJf|6beNS95}!mZ}?8?^Ph*Ip&?B3!3_}%FXZ}*R)LS}HS6B4yVJ2Oi_y_h z4j;D3=Y3UJw{DQGuI{DY!&}rM&eO|VAkF!Yl#=P`G9P~UA;ls{2^U?|MORmj@MdXb zKXJkL*A|InROeRBxPs)x;}7&FlRxNEJ`aYm5|FliZ^dyOT-QZ5N|}iSn5IcG`GafQ zq{8ZYM2LPU_4Pge zpUanbkWObXO%ovmmQ`nJN>Zs*&@|t}__4o-lwK>w)OEd)48@7ZO;V{OnM{^!HbYNO zjJ`hj;SXP8c=!e`y9|E!J9z7@B7gY9DJqo;QhMBd_h0ha&u+T?*s)`bj&6T+o_au7 zRcHCayR$P#GMPjOf$O?>p3k5VzAbI)x9hsNu7B=%vw_ew9bMNj zj2Q8F9Md$(WHJZ=J9cd0h8y7UVffk4V9%ZxdGEcW6bc1OrN3iz)c@|4S3F*Q^;HfY zJjmIzU;SGp5h}Mygehb!xR5)6*4f+iJx=KBF#< z<07To07JGqJHQ*SYh~JK4Uym$hr*op<0DzknBC+{@9UN12$I#Iouf zIr3fl`+Zd!8-xA(Veeka-o1M{aNq!=qucKY$pkBbOfpa+_uQz8kXmok0mn2=5{U%K zWD3L3@jNJ(r(2>a#0&ub&PzN`1{n9|ROE$#n{K+9?b|oAWedb&@SESjo;_vWdh1O- z_}~PELIKON@H}|t8Q)F}4#L0y+;9V2e!0f_^`GO#7q4LB#*3aldh{5T%HMyk%~*|W zqXMC75YJ>D9?NDs=;`UEySs;ujw~Q3l}e0^j4(2CuHm=6IlDfWagWujSF?5NR&Kqu zgR8D;?1BMLJ_*15?IGTK?>$CF&M`Gr#u}@a1_l2T)(2DQ>)dnEDI2Hb#*Z?Fu;Or^92fp0+mVy%c>KL#mHu}EL+yk>eZ{c^2!x#+z6{y`5vHJ^~VC9dJ2C3 z`(wQS{xQy-J4dltqE@TnI1ZlYVVWkVPoE*5FEBnn&gs*qIdS50&YbCEXvn|bx^=#H z$>lynE|+7~s(;;g{P>@*R9s}}tYKInBmTK0Xe37)Br6-Q8S# z@rstOH%;HyCldaGG8y0H#p8ZhTdP5-1kXMTCr(Uo{P=Osojb?)_&8HjW$N`Bw(Yc} z$S@4*^*WAYV_6o}YL!x{M4?b%eEd?*o?XZ0&4R%}SiT%?yb;prL6XS?Yu5begOevu zQmcKpQvqSV&QMDVTt8Ej*tSKv?BO^L$z+ODD#^&mD8*utWHQ-`1+v);rYVTWea4$U zKb3-?|9pgri3#%gJQEWWluAX)wD%R0GKTWe&xn#EudDbvv1#i;_(>q zxQS`{emxe85s$|ZLPH4A`n_e@)a!LDtKL#0+qRgA`I}Ya8G9k+uE#WO`0Gsr3LdU2 zS}xUfT^z^8as2hvYJ)gVFGEBA#Lb2cP_3?}R;%Oq!xl1Xcq#&b87Z)=d((z-|8&#B z3*lf{b*fdZ<;pZoYq&NMxPpi0$(CW9Auq&8dadrT>+X64u%#TnAFyMw2kvuSrx93z z=edDv`(XJ09Yo4rHf->t%Qb6Ya&kSTQi*|qC+)LmzakbpA<}Fh2*=rx(e?YvO^+ev zOzp$xS%l_Pvt8h9W?L{f{x9XO2bA7`4LG)a?_W1dyxRb|)r zLPBu0+hYTDDR|k{#N%dGxYaExx9giiAj2U zANR(`|4J-kM#z(m-EDxdtJ5&ij@DKp#tj%hf~&aW$?qh_6U$dFXM0mOB>zWenc z2!%qPGiOfI(UB#aT}i3rd!LaJ7#%I4X&Q-yxs*xK=rK9NxbIvL3>A>3c>B7&^Nxu5 z9ubj*IUyhfM_(+!HjMj@8iqkKnWD3^liuE5dU|?VVSBw^XL2&n`1m*z6XT4G+#{AS zD%*BYG8Qre5H=_oEN!cOh_Gr-SlinQ#PrRh9g96M5|76ko+wT{9>*{YgwT*u`r~(2 zoqFBEvMg$~Z;K_&3eTDo4r`l-jmgGBdI(Vfcp+*K)d;nfd11#iA1wK+)X=o1M-l;# za~ zVvJxU2=a0FLgxRp-OUmVQtpiG4T|&g;AAKeQGL6pXNDH~&{QzB{m2hZiSzs9=#n0rBVztf zMi@trC52!g3jl5BjYJ63?EnbrM4kV|iVOejaN9>`RTT(1Uf2bS|9^P;6MKDP$Y1dG p`2VTb{{jmq7ce7<-9!KY002ovPDHLkV1fVu002ovPDHLkV1jwz=*R#7 literal 0 HcmV?d00001 diff --git a/udav/xpm/update.xpm b/udav/xpm/update.xpm new file mode 100644 index 0000000..5ee1dd6 --- /dev/null +++ b/udav/xpm/update.xpm @@ -0,0 +1,21 @@ +/* XPM */ +static const char *update_xpm[] = { +"16 16 2 1", +" c None", +". c #00007F", +" ", +" ", +" .... ", +" . . ", +" . ..... ", +" . ... ", +" . ", +" ", +" ", +" . ", +" ... . ", +" ..... . ", +" . . ", +" .... ", +" ", +" "}; diff --git a/udav/xpm/view-refresh.png b/udav/xpm/view-refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..3fd71d6e5929ba0c40db1960e36e9acba9d7e525 GIT binary patch literal 912 zcmV;B18@9^P)oWowDaEkzU!j%l38$)o7}}cCnx7z zVrKYAWwOsS=-Lqw-t?qu)r6QQ!notg696vQmg&~r9t3cLe1UW(yG7H)Ku^~yeO+g> z(bg0Jm{BNJFfw+(d}sQhCl&9uE%R)8S2n|p?*PPznUTt5*BiPR+1l3~ipPS`iO?Jk zARN#U4H*a;0yD)$9M29{3dM>Y4K?&WE>{g^G!Zl7)jelV^{i|AG#D_%trsJC8h7YDw+>Nu`!(E)&&KfE(t5U!_KF)uRXGsl%@ z#;0eK6ZhtiUhin`+P8I6C=m!d1ufk}o{_gOutKfI-_b^R{JP z`QzJ2^LHMWS&9G(o-t)@yh1Uq9cxfG6X$C)H~ghbOC7?WrZ-yyL0>0QOs`0x)U>uAAQg z>;&LGL0Gpf^PVr@oj>}%1`wDT7wv!4sq=s3q*Oh&WftpMhqGg=O68@F-$%x80Ep=T zKm-sG?*3PXAs8nI|0Dok)RR-0Y?z4d_HJBzCO6*s&6^5?o^0No>h2ra)My_p{u2^&LcltM%9%NL@3OcL;J5G-fbF(raxE|ezW! z3fe_~f&YQDYv&?Y5flVLjk<|wlX-0z3ufq(Vbc5^nq2rNXI-1yenaLfYLBs4~uT(Wh49B7U*xz_+u1=$qv z#gBA8SHroS)t|T}=?H7zVP)z=>1pR}i_}fvD$u&?1ps~|en?~6bxZe}9X<=GS_lQS z^p52HV{Cm+h>@sg^hz1yDhbrk{?gLd%#L1yR1NrXR2oBd;5xcVT(!w3&nhvlLIdaO zoBHg~8PE!tZ6+S`pOL0!qP-_P?`WgfkFYag0u!<5)MQt z;R23XKNR=>7Evr>Y_OJxWEq7?PyqdeumH&-ge3@N*;I{jaHoyN{$p>f{lHq)$ literal 0 HcmV?d00001 diff --git a/udav/xpm/window.xpm b/udav/xpm/window.xpm new file mode 100644 index 0000000..28ac182 --- /dev/null +++ b/udav/xpm/window.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char * window_xpm[] = { +"16 16 10 1", +" c None", +". c #000000", +"+ c #333377", +"@ c #FFFFFF", +"# c #777777", +"$ c #00007F", +"% c #4444FF", +"& c #FF0000", +"* c #007F00", +"= c #7F0000", +" ", +" ", +".............. ", +".++++++++++++. ", +".@@@@@#@@@@@@. ", +".@$.............", +".@@.%%%%%%%%%%%.", +".@$.@@@@@#@@@@@.", +".@@.@$$@@#@@@@@.", +".@$.@@@@@#@@@@@.", +".@@.@$&*@#@@@@@.", +"....@@@@@#@@@@@.", +" .@$&=@#@@@@@.", +" .@@@@@#@@@@@.", +" .............", +" "}; diff --git a/udav/xpm/wire.xpm b/udav/xpm/wire.xpm new file mode 100644 index 0000000..b67d50b --- /dev/null +++ b/udav/xpm/wire.xpm @@ -0,0 +1,21 @@ +/* XPM */ +static const char * wire_xpm[] = { +"16 16 2 1", +" c None", +". c #000000", +" ", +" ", +" ", +" . . ", +" . . ", +" . . ", +" ............ ", +" . . ", +" . . ", +" . . ", +" . . ", +" ............ ", +" . . ", +" . . ", +" . . ", +" "}; diff --git a/udav/xpm/x-office-presentation.png b/udav/xpm/x-office-presentation.png new file mode 100644 index 0000000000000000000000000000000000000000..f7ea302453f905cba33eb1aa6298614d4c906e84 GIT binary patch literal 567 zcmV-70?7S|P)HQGPCA=`Hv zfJ`PEO>iKYBt1LJv#BX+3$OUGyv=v}0=Zm{zFU(7p2zB{MJkorT_7Hh)7{%k_tMg? zYfB^&v?r6%1eW#j--{P;_RP6xfqedQ>v3+})#;gXt7)wM_s7`y=!juF+8!GpZ9VFy zY4n?>5jN`3G>!fUTmBvdo&%Ih6QZdfHp;7|(!`6M{!fopnEWf3lwSY<002ovPDHLk FV1m=+27CYj literal 0 HcmV?d00001 diff --git a/udav/xpm/x-office-spreadsheet.png b/udav/xpm/x-office-spreadsheet.png new file mode 100644 index 0000000000000000000000000000000000000000..a6b1268d3544aa1591a8f2239b395f69507d6452 GIT binary patch literal 704 zcmV;x0zdtUP)#0!>Lo zK~y-)m6G2}Q(+j#KWCe6de;0^;8}{5aR^c&kt~V|lo1qoA(<3`-AI2$V_kI{G|-z; zg9@z+LvqlC6clK8In8X84D?7%TU$%dIXmy^Vn6KHE_|-OFYojHyx;eIUTJuE_{sYE zdM~@H%fVo99Dqp(y^mUSnWj;EyOpfTn3k zQVt+Vx%JN8TFJW<0g7M2D|-Qm#bWgI^Z*czMrmnnL9!+0qw}Q!hHj7{gMczY4i8Pwrg(I`<7NNs+x{Xz*L46k z9*j}5vP{E`KCau3u5q$)FJDqAd@JwCcs$$11c5*xH;utT z-rXPL;PqbW4jjRDxu`x}hp2E6?2vf;IZb1Hk@m?6Dphq{3Wvi}iA3VU@3XC)nL&Q@ z8uQ!<${MQioVC#nL1x2bdP>kU`-%!xeQ|AJAyDdnFw)(9NncvJ=}sn9=g&;JZG(_y m!=)(82fMm%of;aN0Qd#;^&{yp>n-^J0000h9?ZDxvLFLT?qS^gMtP`Zb|S{X)4%_V4So zctWBK=s!vB|Mipg>o(j6(3H^jG$fisXeO8bnB&_Iw$l6F zW;}+*@YoDrz2DA>16#RpeHJv6hD38v32krLfu@Af7K=uV!L*IfqXY2H;XY(Zk%))c zaqyvALlaz1+r**~LkYdL3^0T$tqO+%SYx+oj4$KuLn)f#Vd5)laY`=v`z1O*zr>1X zYMHi*Y-*~bd?5g>TsYDtyRgXeWg+erBv#(xPOeC<;4u8>GmxmRnKIrd%a$!ESJ1f4w6Q=N<%tDeoCFB zqQaB|XU{F#c5cfz$4{JlJjyMaZXQprc_kEG88NCVeE{6E3#2m>^7o4a1=p3HWHRYB zbPv6~$Lw4#w^2OtOx2pE@6k=O&6RQ$fNmH=(s9mAO-+58&1OgA&&C5)!2mD5kmSo_ zUyS|>@Lzg!`y1(*1K~y-6m6P8~lvx5v$3pU8EDrE z)Y2mQu`AKV{s&z|palK8SQbGHx-GhhQX-_AEh{sg)T&2e{ht+1(i{q?@{ zo-Vd2(~IbPbv7+>!t9yN+HaQ66S?>2K~y-6m6OkJR8<&;pL6cH)6ShcGfbp5YBHUn6AerinV2Rb zY}!I0F)p+*B={e&FeDHN?1*X7)WogEg<`uPjVr-W8oGdjiNq+iA=)C5PGLF}lX_up zr=5H5J#L(#z{2>hzT|v)zF+SV#u%C!868d=A&(hh^$Qce4q${eCrmgkO!VoAsJ2X@nZc=d$YOMW5_ehqD)M^7YC6tr<-OIy9u> zieDCe^0}-s!s>4Ugb87IR9unkaQMsf zL8!S+Bk0TJ@{%s)5~SjaWZXt=Dy5_(8MjF}HoLkU%1cXH7(Ly3$3&ma|N7&RSG)5a zz1v(Csv8Uq6ghO}A^=1CdN9UNcriw#18&{?VSS}q{rov2xv4GZ_Yc13w6(QS@gmlO zrjaC_Nr?^`Oig}Ad%LY?u3lUB{o28abKhRuY~?;_+2=}c?at)7vMQN~1Mt|dvshlz zKi!zAN0E+|N~Jbs#TXwS^J}%*KJmQz8O0^{}kZA^x>hQJ;23$KIiV((Zi)nlaKxv;9tnwz*j2z(JFLl8GshXBcV&ZLi@)K9XwoMmP8rQ z-qDstsLuMvbgVX+P}Ol8fYEnF{{AQLJ$rnofcEwtI(WEy4xqiGt;Gt*F05a*0(_Ug-mdX+r?7J-#0Z50QG~kQlHF1Hs-PKo?NSx9s0;^*SOJtW zcslY45Hu}mFrN?nwfW}FYrkaHuKNTawUGPk8`E*5$;2;#QM z^D!5sNqu8FriDCEeu2_LZKzEq)V)E6#C)5RT@Mffd<|NI?`wRm$z~RFf6$>hnNS0N z{?Q5?1yDklnyceBg=cT+xzx{@BiY%F24MTo7fClK+1OM?c|riPoVcEkGwJ^7$95QwNOrXH!p2Qotza<7P{C*1EgMNv9g%qM6j!^?Q&C}heb;YH zI!9vG&J<<@bGZ1Zc&{biP@}Jp5oN$leupI|EJx1 zc4dIewY5om>Cz^yT * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include -#include "mgl/mgl_eps.h" -#include "mgl/mgl_parse.h" -void wcstrim_mgl(wchar_t *str); -//----------------------------------------------------------------------------- -int main(int narg, char **arg) -{ - mglGraphPS gr; - mglParse p(true); -// setlocale(LC_CTYPE,"C"); - - if(narg==1) - { - printf("mgl2cpp convert mgl script to C++ file.\n"); - printf("Current version is 1.%g\n",MGL_VERSION); - printf("Usage:\tmgl2cpp scriptfile [outputfile parameter(s)]\n"); - printf("\tParameters have format \"-Nval\".\n"); - printf("\tHere N=0,1...9 is parameter ID and val is its value.\n"); - printf("\tOption -Lval set locale to val.\n"); - } - else - { - FILE *fp = fopen(arg[1],"rb"), *fo; - if(fp==0) { printf("Couldn't open file %s\n",arg[1]); return 1; } - wchar_t str[8192], out[1024]; - char fname[256]; - for(long i=2;i='0' && arg[i][1]<='9') - p.AddParam(arg[i][1]-'0',arg[i]+2); - if(arg[i][0]=='-' && arg[i][1]=='L') - setlocale(LC_CTYPE, arg[i]+2); - } - if(narg>2 && arg[2][0]!='-') strcpy(fname,arg[2]); - else - { - strcpy(fname,arg[1]); strcat(fname,".cpp"); - wprintf(L"Write output to %s\n",fname); - } - fo = fopen(fname,"wt"); - fwprintf(fo,L"int draw_func(mglGraph *gr, void *)\n{\n"); - fwprintf(fo,L"\tstatic bool once = false;\n"); - while(!feof(fp)) - { - if(!fgetws(str,8192,fp)) break; - wcstrim_mgl(str); - out[0] = 0; - int r = p.Export(out,&gr,str); - fwprintf(fo,L"\t//%ls\n",str); - if(*out) - { - if(*(p.op1)) fwprintf(fo,L"%ls\n",p.op1); - fwprintf(fo,L"\t%ls\n",out); - if(*(p.op2)) fwprintf(fo,L"%ls\n",p.op2); - fflush(fo); - } - if(r==1) wprintf(L"Wrong argument(s) in %ls\n",str); - if(r==2) wprintf(L"Wrong command in %ls\n",str); - if(r==3) wprintf(L"String too long in %ls\n",str); - if(r==4) wprintf(L"Unbalanced ' in %ls\n", str); - } - fwprintf(fo,L"\treturn 0;\n}\n"); - fclose(fp); fclose(fo); - } - return 0; -} -//----------------------------------------------------------------------------- diff --git a/utils/mgl2gif.cpp b/utils/mgl2gif.cpp deleted file mode 100644 index dcc0b42..0000000 --- a/utils/mgl2gif.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/*************************************************************************** - * mgl2gif.cpp is part of Math Graphic Library - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ -#include -#include -#include -#include -#include "mgl/mgl_zb.h" -#include "mgl/mgl_parse.h" -struct Str -{ - wchar_t *str; - Str *next; - Str(Str *prev, const char *s); - Str(Str *prev, const wchar_t *s); - Str(Str *prev=0) - { str=0; next=0; if(prev) prev->next=this; } - ~Str() - { if(str) delete []str; if(next) delete next; } -}; -void wcstrim_mgl(wchar_t *str); -//----------------------------------------------------------------------------- -Str::Str(Str *prev, const wchar_t *s) -{ - str=0; next=0; if(prev) prev->next=this; - if(s) - { - str = new wchar_t[wcslen(s)+1]; - wcscpy(str,s); - } -} -//----------------------------------------------------------------------------- -Str::Str(Str *prev, const char *s) -{ - str=0; next=0; if(prev) prev->next=this; - if(s) - { - str = new wchar_t[strlen(s)+1]; - mbstowcs(str,s,strlen(s)); - } -} -//----------------------------------------------------------------------------- -int main(int narg, char **arg) -{ - mglGraphZB gr; - mglParse p(true); - - if(narg==1) - { - printf("mgl2gif convert mgl script to bitmap gif file.\n"); - printf("Current version is 1.%g\n",MGL_VERSION); - printf("Usage:\tmgl2gif scriptfile [outputfile parameter(s)]\n"); - printf("\tParameters have format \"-Nval\".\n"); - printf("\tHere N=0,1...9 is parameter ID and val is its value.\n"); - printf("\tOption -Lval set locale to val.\n"); - printf("\tOption -Aval add value of $0 for making animation.\n"); - printf("\tOption -Cn1:n2 cycle from n1 to n2 for making animation.\n"); - } - else - { - Str *head=0, *cur=0; - FILE *fp = fopen(arg[1],"rb"); - if(fp==0) { printf("Couldn't open file %s\n",arg[1]); return 1; } - wchar_t str[8192]; - char fname[2048], buf[2048]; - for(long i=2;i='0' && arg[i][1]<='9') - p.AddParam(arg[i][1]-'0',arg[i]+2); - if(arg[i][0]=='-' && arg[i][1]=='L') - setlocale(LC_CTYPE, arg[i]+2); - if(arg[i][0]=='-' && arg[i][1]=='A') - { - if(cur) cur = new Str(cur,arg[i]+2); - else head = cur = new Str(0,arg[i]+2); - } - if(arg[i][0]=='-' && arg[i][1]=='C') - { - int n,n1,n2; - sscanf(arg[i]+2,"%d:%d",&n1,&n2); - char str[64]; - for(n=n1;n2 && arg[2][0]!='-') strcpy(fname,arg[2]); - else - { - strcpy(fname,arg[1]); strcat(fname,".gif"); - printf("Write output to %s\n",fname); - } - // first read animation parameters from file - while(!feof(fp)) - { - if(!fgetws(str,8192,fp)) break; - wcstrim_mgl(str); - if(str[0]=='#' && str[1]=='#' && str[2]=='a' && str[3]==' ') - { - if(cur) cur = new Str(cur,str+4); - else head = cur = new Str(0,str+4); - } - if(str[0]=='#' && str[1]=='#' && str[2]=='c' && str[3]==' ') - { - float v1,v2,dv,v; - wscanf(str+4,"%g %g %g",&v1,&v2,&dv); - char ss[64]; - for(v=v1;vnext) - { - fseek(fp,0,SEEK_SET); - gr.NewFrame(); - p.AddParam(0,cur->str); - p.Execute(&gr,fp,true); - gr.EndFrame(); - } - gr.CloseGIF(); - } - else // simple gif - { - fseek(fp,0,SEEK_SET); - p.Execute(&gr,fp,true); - gr.WriteGIF(fname); - } - fclose(fp); - } - return 0; -} -//----------------------------------------------------------------------------- diff --git a/utils/mglconv.cpp b/utils/mglconv.cpp new file mode 100644 index 0000000..f717365 --- /dev/null +++ b/utils/mglconv.cpp @@ -0,0 +1,101 @@ +/*************************************************************************** + * mgl2png.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include +#include +#include +#include "mgl/mgl.h" +void mgl_error_print(int line, int r, char *Message); +//----------------------------------------------------------------------------- +int main(int narg, char **arg) +{ + mglGraph gr; + mglParse p(true); + + long i,j=-1,k=-1; + unsigned long n; + for(i=1;i='0' && arg[i][1]<='9') + p.AddParam(arg[i][1]-'0',arg[i]+2); + if(arg[i][0]=='-' && arg[i][1]=='L') + setlocale(LC_CTYPE, arg[i]+2); + if(arg[i][0]=='-' && (arg[i][1]=='h' || (arg[i][1]=='-' && arg[i][2]=='h'))) + { + printf("mgl2png convert mgl script to bitmap png file.\n"); + printf("Current version is 2.%g\n",MGL_VER2); + printf("Usage:\tmgl2png scriptfile [outputfile parameter(s)]\n"); + printf("\tParameters have format \"-Nval\".\n"); + printf("\tHere N=0,1...9 is parameter ID and val is its value.\n"); + printf("\tOption -Lval set locale to val.\n"); + } + if(arg[i][0]!='-' && j<0) j=i; + if(arg[i][0]!='-' && j>0) k=i; + } + // prepare for animation + std::wstring str; + FILE *fp = j>0?fopen(arg[j],"r"):stdin; + while(!feof(fp)) str.push_back(fgetwc(fp)); + if(j>0) fclose(fp); + std::vector var; + for(i=0;;) // collect exact values + { + n = str.find(L"##a ",i); + if(n==std::string::npos) break; + i = n+4; var.push_back(str.substr(i,str.find('\n',i))); + } + n = str.find(L"##c "); + if(n!=std::string::npos) + { + float v1,v2,dv,v; + wscanf(str.c_str()+n+4,L"%g%g%g",&v1,&v2,&dv); + wchar_t ss[64]; + for(v=v1;v<=v2;v+=dv) + { swprintf(ss,64,L"%g",v); var.push_back(ss); } + } + char buf[2048],fname[256]; + if(k>0) strcpy(fname,arg[k]); + else + { strcpy(fname,j>0?arg[j]:"out"); strcat(fname,".png"); } + bool gif= !strcmp(fname+strlen(fname)-4,".gif"); + if(var.size()>1) // there is animation + { + if(gif) gr.StartGIF(fname); + for(i=0;i!=var.size()-1;i++) + { + gr.NewFrame(); + p.AddParam(0,var[i].c_str()); + gr.Message(buf); *buf=0; + p.Execute(&gr,str.c_str(),mgl_error_print); + gr.EndFrame(); + sprintf(buf,"%s-%ld",fname,i); + if(!gif) gr.WriteFrame(buf); + } + if(gif) gr.CloseGIF(); + } + else + { + gr.Message(buf); *buf=0; + p.Execute(&gr,str.c_str(),mgl_error_print); + gr.WriteFrame(fname); + } + printf("Write output to %s\n",fname); + return 0; +} +//----------------------------------------------------------------------------- diff --git a/utils/mglview.cpp b/utils/mglview.cpp index cfdade9..fdee550 100644 --- a/utils/mglview.cpp +++ b/utils/mglview.cpp @@ -20,64 +20,51 @@ #include #include #include -#include "mgl/mgl_fltk.h" -#include "mgl/mgl_parse.h" +#include "mgl/window.h" +#include "mgl/parser.h" //----------------------------------------------------------------------------- -char fname[256]; +std::wstring str; mglParse p(true); -char str[8192]; -char buf[2048]; +void mgl_error_print(int line, int r, char *Message); //----------------------------------------------------------------------------- -int show(mglGraph *gr, void *) +int show(mglGraph *gr) { - FILE *fp = fopen(fname,"rb"); - p.Execute(gr, fp, true); - fclose(fp); + p.Execute(gr,str.c_str(),mgl_error_print); return 0; } //----------------------------------------------------------------------------- int main(int narg, char **arg) { - mglGraphFLTK gr; - - if(narg==1) + long i,j=-1; + for(i=1;i='0' && arg[i][1]<='9') + p.AddParam(arg[i][1]-'0',arg[i]+2); + if(arg[i][0]=='-' && arg[i][1]=='L') + setlocale(LC_CTYPE, arg[i]+2); + if(arg[i][0]=='-' && (arg[i][1]=='h' || (arg[i][1]=='-' && arg[i][2]=='h'))) { - register long i,j; - for(i=2;i='0' && arg[i][1]<='9') - { p.AddParam(arg[i][1]-'0',arg[i]+2); arg[i][0]=0; } - if(arg[i][0]=='-' && arg[i][1]=='L') - { setlocale(LC_CTYPE, arg[i]+2); arg[i][0]=0; } - } - strncpy(fname,arg[1],256); - fclose(fp); - arg[1][0] = 0; - for(i=narg-1;i>=0;i--) - { - if(arg[i][0]==0) - { - for(j=i;j0?fopen(arg[j],"r"):stdin; + while(!feof(fp)) str.push_back(fgetwc(fp)); + if(j>0) fclose(fp); +#if defined(HAVE_FLTK) + int kind=0; +#elif defined(HAVE_QT) + int kind=1; +#endif +#if defined(HAVE_FLTK) || defined(HAVE_QT) + mglWindow gr(kind,show,j>0?arg[j]:"mglview"); + gr.Run(); +#endif return 0; } //----------------------------------------------------------------------------- diff --git a/widgets/CMakeLists.txt b/widgets/CMakeLists.txt index 8bd75cb..a595f05 100644 --- a/widgets/CMakeLists.txt +++ b/widgets/CMakeLists.txt @@ -1,3 +1,6 @@ +set(mgl_wnd_src window.cpp) +#set(mgl_wnd_src ) + if(use_gsl) # target_link_libraries(mgl ${GSL_LIB} ${GSL_CBLAS_LIB} ) add_definitions(-DHAVE_GSL) @@ -9,31 +12,28 @@ endif(use_gsl) if(use_fltk) add_definitions(-DHAVE_FLTK) include_directories(${FLTK_INCLUDE_DIR}) - add_library(mgl-fltk SHARED mgl_fltk.cpp) - add_library(mgl-fltk-static STATIC mgl_fltk.cpp) - set_target_properties(mgl-fltk-static PROPERTIES OUTPUT_NAME "mgl-fltk") - set_target_properties(mgl-fltk PROPERTIES CLEAN_DIRECT_OUTPUT 1) - set_target_properties(mgl-fltk-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) - target_link_libraries(mgl-fltk ${FLTK_LIBRARIES} mgl) - set_target_properties(mgl-fltk PROPERTIES SOVERSION 5.0.0) - install( - TARGETS mgl-fltk mgl-fltk-static - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - ) + set(mgl_wnd_src ${mgl_wnd_src} fltk.cpp) endif(use_fltk) if(use_glut) add_definitions(-DHAVE_GLUT) include_directories(${GLUT_INCLUDE_DIR}) - add_library(mgl-glut SHARED mgl_glut.cpp) - add_library(mgl-glut-static STATIC mgl_glut.cpp) + set(mgl_glut_src glut.cpp) + + add_library(mgl-glut SHARED ${mgl_glut_src}) + add_library(mgl-glut-static STATIC ${mgl_glut_src}) set_target_properties(mgl-glut-static PROPERTIES OUTPUT_NAME "mgl-glut") set_target_properties(mgl-glut PROPERTIES CLEAN_DIRECT_OUTPUT 1) set_target_properties(mgl-glut-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) - target_link_libraries(mgl-glut ${GLUT_LIBRARIES} ${OPENGL_LIBRARIES} mgl) - set_target_properties(mgl-glut PROPERTIES SOVERSION 5.0.0) + set_target_properties(mgl-glut PROPERTIES SOVERSION 6.0.0) + target_link_libraries(mgl-glut mgl) + target_link_libraries(mgl-glut ${GLUT_LIBRARIES} ${OPENGL_LIBRARIES}) + + if(use_pthread) + target_link_libraries(mgl-glut ${CMAKE_THREAD_LIBS_INIT}) + add_definitions(-DHAVE_PTHREAD) + endif(use_pthread) + install( TARGETS mgl-glut mgl-glut-static RUNTIME DESTINATION bin @@ -45,37 +45,46 @@ endif(use_glut) if(use_wx) include(${wxWidgets_USE_FILE}) add_definitions(-DHAVE_WX) - add_library(mgl-wx SHARED mgl_wx.cpp) - add_library(mgl-wx-static STATIC mgl_wx.cpp) - set_target_properties(mgl-wx-static PROPERTIES OUTPUT_NAME "mgl-wx") - set_target_properties(mgl-wx PROPERTIES CLEAN_DIRECT_OUTPUT 1) - set_target_properties(mgl-wx-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) - target_link_libraries(mgl-wx ${wxWidgets_LIBRARIES} mgl) - set_target_properties(mgl-wx PROPERTIES SOVERSION 5.0.0) - install( - TARGETS mgl-wx mgl-wx-static - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - ) + set(mgl_wnd_src ${mgl_wnd_src} wx.cpp) endif(use_wx) if(use_qt) include(${QT_USE_FILE}) add_definitions(-DHAVE_QT) - qt_wrap_cpp(mgl-qt MGL_MOC_FILES ../include/mgl/mgl_qt.h) - add_library(mgl-qt SHARED mgl_qt.cpp ${MGL_MOC_FILES}) - add_library(mgl-qt-static STATIC mgl_qt.cpp ${MGL_MOC_FILES}) - set_target_properties(mgl-qt-static PROPERTIES OUTPUT_NAME "mgl-qt") - set_target_properties(mgl-qt PROPERTIES CLEAN_DIRECT_OUTPUT 1) - set_target_properties(mgl-qt-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) - target_link_libraries(mgl-qt ${QT_LIBRARIES} mgl) - set_target_properties(mgl-qt PROPERTIES SOVERSION 5.0.0) - install( - TARGETS mgl-qt mgl-qt-static - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - ) +# qt_wrap_cpp(mgl-wnd MGL_MOC_FILES ../include/mgl/qt.h) + qt4_wrap_cpp(MGL_MOC_FILES ../include/mgl/qt.h) + set(mgl_wnd_src ${mgl_wnd_src} qt.cpp ${MGL_MOC_FILES}) +endif(use_qt) + +add_library(mgl-wnd SHARED ${mgl_wnd_src}) +add_library(mgl-wnd-static STATIC ${mgl_wnd_src}) +set_target_properties(mgl-wnd-static PROPERTIES OUTPUT_NAME "mgl-wnd") +set_target_properties(mgl-wnd PROPERTIES CLEAN_DIRECT_OUTPUT 1) +set_target_properties(mgl-wnd-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) +set_target_properties(mgl-wnd PROPERTIES SOVERSION 6.0.0) +target_link_libraries(mgl-wnd mgl) + + +if(use_pthread) + target_link_libraries(mgl-wnd ${CMAKE_THREAD_LIBS_INIT}) + add_definitions(-DHAVE_PTHREAD) +endif(use_pthread) + +if(use_fltk) + target_link_libraries(mgl-wnd ${FLTK_LIBRARIES}) +endif(use_fltk) + +if(use_wx) + target_link_libraries(mgl-wnd ${wxWidgets_LIBRARIES}) +endif(use_wx) + +if(use_qt) + target_link_libraries(mgl-wnd ${QT_LIBRARIES}) endif(use_qt) +install( + TARGETS mgl-wnd mgl-wnd-static + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +) diff --git a/widgets/Makefile.am b/widgets/Makefile.am index 7ec6d65..f76b61a 100644 --- a/widgets/Makefile.am +++ b/widgets/Makefile.am @@ -1,41 +1,38 @@ AM_CXXFLAGS += -I$(top_srcdir)/include -I$(top_builddir)/include -lib_LTLIBRARIES = +WIDGETS = +if USE_QT +WIDGETS += -DHAVE_QT +endif if USE_FLTK -lib_LTLIBRARIES += libmgl-fltk.la -libmgl_fltk_la_LDFLAGS = -no-undefined -version-info $(MGL_CURRENT):$(MGL_REVISION):$(MGL_AGE) -libmgl_fltk_la_LIBADD = $(FLTK_LIBS) $(top_builddir)/mgl/libmgl.la -libmgl_fltk_la_CXXFLAGS = $(FLTK_FLAGS) $(AM_CXXFLAGS) -libmgl_fltk_la_SOURCES = mgl_fltk.cpp +WIDGETS += -DHAVE_FLTK endif -if USE_GLUT -lib_LTLIBRARIES += libmgl-glut.la -libmgl_glut_la_LDFLAGS = -no-undefined -version-info $(MGL_CURRENT):$(MGL_REVISION):$(MGL_AGE) -libmgl_glut_la_LIBADD = $(GLUT_LIBS) $(GL_LIBS) $(top_builddir)/mgl/libmgl.la -libmgl_glut_la_CXXFLAGS = $(GLUT_FLAGS) $(AM_CXXFLAGS) -libmgl_glut_la_SOURCES = mgl_glut.cpp -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_WX -lib_LTLIBRARIES += libmgl-wx.la -libmgl_wx_la_LDFLAGS = -no-undefined -version-info $(MGL_CURRENT):$(MGL_REVISION):$(MGL_AGE) -libmgl_wx_la_LIBADD = $(WX_LIBS) $(top_builddir)/mgl/libmgl.la -libmgl_wx_la_CXXFLAGS = $(WX_FLAGS) $(AM_CXXFLAGS) -libmgl_wx_la_SOURCES = mgl_wx.cpp + +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/ -lib_LTLIBRARIES += libmgl-qt.la -libmgl_qt_la_LDFLAGS = $(QT_LDFLAGS) $(LDFLAGS) -no-undefined -version-info $(MGL_CURRENT):$(MGL_REVISION):$(MGL_AGE) -libmgl_qt_la_LIBADD = $(QT_LIBS) $(top_builddir)/mgl/libmgl.la -libmgl_qt_la_CPPFLAGS = $(QT_CPPFLAGS) $(AM_CPPFLAGS) -libmgl_qt_la_CXXFLAGS = $(QT_CXXFLAGS) $(AM_CXXFLAGS) -libmgl_qt_la_SOURCES = $(top_builddir)/include/mgl/mgl_qt.moc.cpp mgl_qt.cpp $(top_srcdir)/include/mgl/mgl_qt.h +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/mgl_qt.moc.cpp +BUILT_SOURCES = $(top_builddir)/include/mgl/qt.moc.cpp CLEANFILES = $(BUILT_SOURCES) endif diff --git a/widgets/Makefile.in b/widgets/Makefile.in index 9229e6a..1ce13df 100644 --- a/widgets/Makefile.in +++ b/widgets/Makefile.in @@ -53,12 +53,19 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@USE_FLTK_TRUE@am__append_1 = libmgl-fltk.la -@USE_GLUT_TRUE@am__append_2 = libmgl-glut.la -@USE_WX_TRUE@am__append_3 = libmgl-wx.la +@USE_QT_TRUE@am__append_1 = -DHAVE_QT +@USE_FLTK_TRUE@am__append_2 = -DHAVE_FLTK +#libmgl_wnd_la_SOURCES = +@USE_FLTK_TRUE@am__append_3 = $(FLTK_LIBS) +@USE_FLTK_TRUE@am__append_4 = $(FLTK_FLAGS) +@USE_FLTK_TRUE@am__append_5 = fltk.cpp DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/config/autotroll.mk -@USE_QT_TRUE@am__append_4 = libmgl-qt.la +@USE_QT_TRUE@am__append_6 = $(QT_LDFLAGS) +@USE_QT_TRUE@am__append_7 = $(QT_LIBS) +@USE_QT_TRUE@am__append_8 = $(QT_CPPFLAGS) +@USE_QT_TRUE@am__append_9 = $(QT_CXXFLAGS) +@USE_QT_TRUE@am__append_10 = $(top_builddir)/include/mgl/qt.moc.cpp qt.cpp $(top_srcdir)/include/mgl/qt.h subdir = widgets ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/autotroll.m4 \ @@ -93,48 +100,22 @@ am__base_list = \ am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = -@USE_FLTK_TRUE@libmgl_fltk_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ -@USE_FLTK_TRUE@ $(top_builddir)/mgl/libmgl.la -am__libmgl_fltk_la_SOURCES_DIST = mgl_fltk.cpp -@USE_FLTK_TRUE@am_libmgl_fltk_la_OBJECTS = libmgl_fltk_la-mgl_fltk.lo -libmgl_fltk_la_OBJECTS = $(am_libmgl_fltk_la_OBJECTS) -libmgl_fltk_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ - $(libmgl_fltk_la_CXXFLAGS) $(CXXFLAGS) \ - $(libmgl_fltk_la_LDFLAGS) $(LDFLAGS) -o $@ -@USE_FLTK_TRUE@am_libmgl_fltk_la_rpath = -rpath $(libdir) -@USE_GLUT_TRUE@libmgl_glut_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ -@USE_GLUT_TRUE@ $(am__DEPENDENCIES_1) \ -@USE_GLUT_TRUE@ $(top_builddir)/mgl/libmgl.la -am__libmgl_glut_la_SOURCES_DIST = mgl_glut.cpp -@USE_GLUT_TRUE@am_libmgl_glut_la_OBJECTS = libmgl_glut_la-mgl_glut.lo -libmgl_glut_la_OBJECTS = $(am_libmgl_glut_la_OBJECTS) -libmgl_glut_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ - $(libmgl_glut_la_CXXFLAGS) $(CXXFLAGS) \ - $(libmgl_glut_la_LDFLAGS) $(LDFLAGS) -o $@ -@USE_GLUT_TRUE@am_libmgl_glut_la_rpath = -rpath $(libdir) -@USE_QT_TRUE@libmgl_qt_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ -@USE_QT_TRUE@ $(top_builddir)/mgl/libmgl.la -am__libmgl_qt_la_SOURCES_DIST = \ - $(top_builddir)/include/mgl/mgl_qt.moc.cpp mgl_qt.cpp \ - $(top_srcdir)/include/mgl/mgl_qt.h -@USE_QT_TRUE@am_libmgl_qt_la_OBJECTS = libmgl_qt_la-mgl_qt.moc.lo \ -@USE_QT_TRUE@ libmgl_qt_la-mgl_qt.lo -libmgl_qt_la_OBJECTS = $(am_libmgl_qt_la_OBJECTS) -libmgl_qt_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(libmgl_qt_la_CXXFLAGS) \ - $(CXXFLAGS) $(libmgl_qt_la_LDFLAGS) $(LDFLAGS) -o $@ -@USE_QT_TRUE@am_libmgl_qt_la_rpath = -rpath $(libdir) -@USE_WX_TRUE@libmgl_wx_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ -@USE_WX_TRUE@ $(top_builddir)/mgl/libmgl.la -am__libmgl_wx_la_SOURCES_DIST = mgl_wx.cpp -@USE_WX_TRUE@am_libmgl_wx_la_OBJECTS = libmgl_wx_la-mgl_wx.lo -libmgl_wx_la_OBJECTS = $(am_libmgl_wx_la_OBJECTS) -libmgl_wx_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(libmgl_wx_la_CXXFLAGS) \ - $(CXXFLAGS) $(libmgl_wx_la_LDFLAGS) $(LDFLAGS) -o $@ -@USE_WX_TRUE@am_libmgl_wx_la_rpath = -rpath $(libdir) +@USE_FLTK_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +@USE_QT_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) +libmgl_wnd_la_DEPENDENCIES = $(top_builddir)/src/libmgl.la \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) +am__libmgl_wnd_la_SOURCES_DIST = window.cpp fltk.cpp \ + $(top_builddir)/include/mgl/qt.moc.cpp qt.cpp \ + $(top_srcdir)/include/mgl/qt.h +@USE_FLTK_TRUE@am__objects_1 = libmgl_wnd_la-fltk.lo +@USE_QT_TRUE@am__objects_2 = libmgl_wnd_la-qt.moc.lo \ +@USE_QT_TRUE@ libmgl_wnd_la-qt.lo +am_libmgl_wnd_la_OBJECTS = libmgl_wnd_la-window.lo $(am__objects_1) \ + $(am__objects_2) +libmgl_wnd_la_OBJECTS = $(am_libmgl_wnd_la_OBJECTS) +libmgl_wnd_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(libmgl_wnd_la_CXXFLAGS) \ + $(CXXFLAGS) $(libmgl_wnd_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include/mgl depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -157,12 +138,8 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(libmgl_fltk_la_SOURCES) $(libmgl_glut_la_SOURCES) \ - $(libmgl_qt_la_SOURCES) $(libmgl_wx_la_SOURCES) -DIST_SOURCES = $(am__libmgl_fltk_la_SOURCES_DIST) \ - $(am__libmgl_glut_la_SOURCES_DIST) \ - $(am__libmgl_qt_la_SOURCES_DIST) \ - $(am__libmgl_wx_la_SOURCES_DIST) +SOURCES = $(libmgl_wnd_la_SOURCES) +DIST_SOURCES = $(am__libmgl_wnd_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -199,10 +176,6 @@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FLTK_FLAGS = @FLTK_FLAGS@ FLTK_LIBS = @FLTK_LIBS@ -GIF_FLAGS = @GIF_FLAGS@ -GIF_LIBS = @GIF_LIBS@ -GLUT_FLAGS = @GLUT_FLAGS@ -GLUT_LIBS = @GLUT_LIBS@ GL_LIBS = @GL_LIBS@ GREP = @GREP@ GSL_FLAGS = @GSL_FLAGS@ @@ -228,7 +201,6 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ MGL_AGE = @MGL_AGE@ MGL_CURRENT = @MGL_CURRENT@ MGL_RELEASE = @MGL_RELEASE@ @@ -283,13 +255,10 @@ TMPDIR = @TMPDIR@ U3D_LIBS = @U3D_LIBS@ UIC = @UIC@ VERSION = @VERSION@ -WX_FLAGS = @WX_FLAGS@ -WX_LIBS = @WX_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -323,6 +292,7 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -342,20 +312,16 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -lib_LTLIBRARIES = $(am__append_1) $(am__append_2) $(am__append_3) \ - $(am__append_4) -@USE_FLTK_TRUE@libmgl_fltk_la_LDFLAGS = -no-undefined -version-info $(MGL_CURRENT):$(MGL_REVISION):$(MGL_AGE) -@USE_FLTK_TRUE@libmgl_fltk_la_LIBADD = $(FLTK_LIBS) $(top_builddir)/mgl/libmgl.la -@USE_FLTK_TRUE@libmgl_fltk_la_CXXFLAGS = $(FLTK_FLAGS) $(AM_CXXFLAGS) -@USE_FLTK_TRUE@libmgl_fltk_la_SOURCES = mgl_fltk.cpp -@USE_GLUT_TRUE@libmgl_glut_la_LDFLAGS = -no-undefined -version-info $(MGL_CURRENT):$(MGL_REVISION):$(MGL_AGE) -@USE_GLUT_TRUE@libmgl_glut_la_LIBADD = $(GLUT_LIBS) $(GL_LIBS) $(top_builddir)/mgl/libmgl.la -@USE_GLUT_TRUE@libmgl_glut_la_CXXFLAGS = $(GLUT_FLAGS) $(AM_CXXFLAGS) -@USE_GLUT_TRUE@libmgl_glut_la_SOURCES = mgl_glut.cpp -@USE_WX_TRUE@libmgl_wx_la_LDFLAGS = -no-undefined -version-info $(MGL_CURRENT):$(MGL_REVISION):$(MGL_AGE) -@USE_WX_TRUE@libmgl_wx_la_LIBADD = $(WX_LIBS) $(top_builddir)/mgl/libmgl.la -@USE_WX_TRUE@libmgl_wx_la_CXXFLAGS = $(WX_FLAGS) $(AM_CXXFLAGS) -@USE_WX_TRUE@libmgl_wx_la_SOURCES = mgl_wx.cpp +WIDGETS = $(am__append_1) $(am__append_2) +lib_LTLIBRARIES = libmgl-wnd.la +libmgl_wnd_la_LDFLAGS = $(LDFLAGS) -no-undefined -version-info \ + $(MGL_CURRENT):$(MGL_REVISION):$(MGL_AGE) $(am__append_6) +libmgl_wnd_la_LIBADD = $(top_builddir)/src/libmgl.la $(am__append_3) \ + $(am__append_7) +libmgl_wnd_la_CPPFLAGS = $(AM_CXXFLAGS) $(WIDGETS) $(am__append_8) +libmgl_wnd_la_CXXFLAGS = $(AM_CXXFLAGS) $(WIDGETS) $(am__append_4) \ + $(am__append_9) +libmgl_wnd_la_SOURCES = window.cpp $(am__append_5) $(am__append_10) # See autotroll.m4 :) @USE_QT_TRUE@SUFFIXES = .moc.cpp .moc.cc .moc.cxx .moc.C .h .hh \ @@ -364,12 +330,7 @@ lib_LTLIBRARIES = $(am__append_1) $(am__append_2) $(am__append_3) \ @USE_QT_TRUE@DISTCLEANFILES = $(BUILT_SOURCES) @USE_QT_TRUE@ACLOCAL_AMFLAGS = -I $(top_srcdir)/config/ -@USE_QT_TRUE@libmgl_qt_la_LDFLAGS = $(QT_LDFLAGS) $(LDFLAGS) -no-undefined -version-info $(MGL_CURRENT):$(MGL_REVISION):$(MGL_AGE) -@USE_QT_TRUE@libmgl_qt_la_LIBADD = $(QT_LIBS) $(top_builddir)/mgl/libmgl.la -@USE_QT_TRUE@libmgl_qt_la_CPPFLAGS = $(QT_CPPFLAGS) $(AM_CPPFLAGS) -@USE_QT_TRUE@libmgl_qt_la_CXXFLAGS = $(QT_CXXFLAGS) $(AM_CXXFLAGS) -@USE_QT_TRUE@libmgl_qt_la_SOURCES = $(top_builddir)/include/mgl/mgl_qt.moc.cpp mgl_qt.cpp $(top_srcdir)/include/mgl/mgl_qt.h -@USE_QT_TRUE@BUILT_SOURCES = $(top_builddir)/include/mgl/mgl_qt.moc.cpp +@USE_QT_TRUE@BUILT_SOURCES = $(top_builddir)/include/mgl/qt.moc.cpp @USE_QT_TRUE@CLEANFILES = $(BUILT_SOURCES) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am @@ -437,14 +398,8 @@ clean-libLTLIBRARIES: echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done -libmgl-fltk.la: $(libmgl_fltk_la_OBJECTS) $(libmgl_fltk_la_DEPENDENCIES) - $(libmgl_fltk_la_LINK) $(am_libmgl_fltk_la_rpath) $(libmgl_fltk_la_OBJECTS) $(libmgl_fltk_la_LIBADD) $(LIBS) -libmgl-glut.la: $(libmgl_glut_la_OBJECTS) $(libmgl_glut_la_DEPENDENCIES) - $(libmgl_glut_la_LINK) $(am_libmgl_glut_la_rpath) $(libmgl_glut_la_OBJECTS) $(libmgl_glut_la_LIBADD) $(LIBS) -libmgl-qt.la: $(libmgl_qt_la_OBJECTS) $(libmgl_qt_la_DEPENDENCIES) - $(libmgl_qt_la_LINK) $(am_libmgl_qt_la_rpath) $(libmgl_qt_la_OBJECTS) $(libmgl_qt_la_LIBADD) $(LIBS) -libmgl-wx.la: $(libmgl_wx_la_OBJECTS) $(libmgl_wx_la_DEPENDENCIES) - $(libmgl_wx_la_LINK) $(am_libmgl_wx_la_rpath) $(libmgl_wx_la_OBJECTS) $(libmgl_wx_la_LIBADD) $(LIBS) +libmgl-wnd.la: $(libmgl_wnd_la_OBJECTS) $(libmgl_wnd_la_DEPENDENCIES) + $(libmgl_wnd_la_LINK) -rpath $(libdir) $(libmgl_wnd_la_OBJECTS) $(libmgl_wnd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -452,11 +407,10 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_fltk_la-mgl_fltk.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_glut_la-mgl_glut.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_qt_la-mgl_qt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_qt_la-mgl_qt.moc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_wx_la-mgl_wx.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_wnd_la-fltk.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_wnd_la-qt.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_wnd_la-qt.moc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmgl_wnd_la-window.Plo@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -479,40 +433,33 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< -libmgl_fltk_la-mgl_fltk.lo: mgl_fltk.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_fltk_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_fltk_la-mgl_fltk.lo -MD -MP -MF $(DEPDIR)/libmgl_fltk_la-mgl_fltk.Tpo -c -o libmgl_fltk_la-mgl_fltk.lo `test -f 'mgl_fltk.cpp' || echo '$(srcdir)/'`mgl_fltk.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_fltk_la-mgl_fltk.Tpo $(DEPDIR)/libmgl_fltk_la-mgl_fltk.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_fltk.cpp' object='libmgl_fltk_la-mgl_fltk.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_wnd_la-window.lo: window.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmgl_wnd_la_CPPFLAGS) $(CPPFLAGS) $(libmgl_wnd_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_wnd_la-window.lo -MD -MP -MF $(DEPDIR)/libmgl_wnd_la-window.Tpo -c -o libmgl_wnd_la-window.lo `test -f 'window.cpp' || echo '$(srcdir)/'`window.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_wnd_la-window.Tpo $(DEPDIR)/libmgl_wnd_la-window.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='window.cpp' object='libmgl_wnd_la-window.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_fltk_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_fltk_la-mgl_fltk.lo `test -f 'mgl_fltk.cpp' || echo '$(srcdir)/'`mgl_fltk.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmgl_wnd_la_CPPFLAGS) $(CPPFLAGS) $(libmgl_wnd_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_wnd_la-window.lo `test -f 'window.cpp' || echo '$(srcdir)/'`window.cpp -libmgl_glut_la-mgl_glut.lo: mgl_glut.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_glut_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_glut_la-mgl_glut.lo -MD -MP -MF $(DEPDIR)/libmgl_glut_la-mgl_glut.Tpo -c -o libmgl_glut_la-mgl_glut.lo `test -f 'mgl_glut.cpp' || echo '$(srcdir)/'`mgl_glut.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_glut_la-mgl_glut.Tpo $(DEPDIR)/libmgl_glut_la-mgl_glut.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_glut.cpp' object='libmgl_glut_la-mgl_glut.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_wnd_la-fltk.lo: fltk.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmgl_wnd_la_CPPFLAGS) $(CPPFLAGS) $(libmgl_wnd_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_wnd_la-fltk.lo -MD -MP -MF $(DEPDIR)/libmgl_wnd_la-fltk.Tpo -c -o libmgl_wnd_la-fltk.lo `test -f 'fltk.cpp' || echo '$(srcdir)/'`fltk.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_wnd_la-fltk.Tpo $(DEPDIR)/libmgl_wnd_la-fltk.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='fltk.cpp' object='libmgl_wnd_la-fltk.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_glut_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_glut_la-mgl_glut.lo `test -f 'mgl_glut.cpp' || echo '$(srcdir)/'`mgl_glut.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmgl_wnd_la_CPPFLAGS) $(CPPFLAGS) $(libmgl_wnd_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_wnd_la-fltk.lo `test -f 'fltk.cpp' || echo '$(srcdir)/'`fltk.cpp -libmgl_qt_la-mgl_qt.moc.lo: $(top_builddir)/include/mgl/mgl_qt.moc.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmgl_qt_la_CPPFLAGS) $(CPPFLAGS) $(libmgl_qt_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_qt_la-mgl_qt.moc.lo -MD -MP -MF $(DEPDIR)/libmgl_qt_la-mgl_qt.moc.Tpo -c -o libmgl_qt_la-mgl_qt.moc.lo `test -f '$(top_builddir)/include/mgl/mgl_qt.moc.cpp' || echo '$(srcdir)/'`$(top_builddir)/include/mgl/mgl_qt.moc.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_qt_la-mgl_qt.moc.Tpo $(DEPDIR)/libmgl_qt_la-mgl_qt.moc.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(top_builddir)/include/mgl/mgl_qt.moc.cpp' object='libmgl_qt_la-mgl_qt.moc.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_wnd_la-qt.moc.lo: $(top_builddir)/include/mgl/qt.moc.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmgl_wnd_la_CPPFLAGS) $(CPPFLAGS) $(libmgl_wnd_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_wnd_la-qt.moc.lo -MD -MP -MF $(DEPDIR)/libmgl_wnd_la-qt.moc.Tpo -c -o libmgl_wnd_la-qt.moc.lo `test -f '$(top_builddir)/include/mgl/qt.moc.cpp' || echo '$(srcdir)/'`$(top_builddir)/include/mgl/qt.moc.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_wnd_la-qt.moc.Tpo $(DEPDIR)/libmgl_wnd_la-qt.moc.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(top_builddir)/include/mgl/qt.moc.cpp' object='libmgl_wnd_la-qt.moc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmgl_qt_la_CPPFLAGS) $(CPPFLAGS) $(libmgl_qt_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_qt_la-mgl_qt.moc.lo `test -f '$(top_builddir)/include/mgl/mgl_qt.moc.cpp' || echo '$(srcdir)/'`$(top_builddir)/include/mgl/mgl_qt.moc.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmgl_wnd_la_CPPFLAGS) $(CPPFLAGS) $(libmgl_wnd_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_wnd_la-qt.moc.lo `test -f '$(top_builddir)/include/mgl/qt.moc.cpp' || echo '$(srcdir)/'`$(top_builddir)/include/mgl/qt.moc.cpp -libmgl_qt_la-mgl_qt.lo: mgl_qt.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmgl_qt_la_CPPFLAGS) $(CPPFLAGS) $(libmgl_qt_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_qt_la-mgl_qt.lo -MD -MP -MF $(DEPDIR)/libmgl_qt_la-mgl_qt.Tpo -c -o libmgl_qt_la-mgl_qt.lo `test -f 'mgl_qt.cpp' || echo '$(srcdir)/'`mgl_qt.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_qt_la-mgl_qt.Tpo $(DEPDIR)/libmgl_qt_la-mgl_qt.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_qt.cpp' object='libmgl_qt_la-mgl_qt.lo' libtool=yes @AMDEPBACKSLASH@ +libmgl_wnd_la-qt.lo: qt.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmgl_wnd_la_CPPFLAGS) $(CPPFLAGS) $(libmgl_wnd_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_wnd_la-qt.lo -MD -MP -MF $(DEPDIR)/libmgl_wnd_la-qt.Tpo -c -o libmgl_wnd_la-qt.lo `test -f 'qt.cpp' || echo '$(srcdir)/'`qt.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_wnd_la-qt.Tpo $(DEPDIR)/libmgl_wnd_la-qt.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='qt.cpp' object='libmgl_wnd_la-qt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmgl_qt_la_CPPFLAGS) $(CPPFLAGS) $(libmgl_qt_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_qt_la-mgl_qt.lo `test -f 'mgl_qt.cpp' || echo '$(srcdir)/'`mgl_qt.cpp - -libmgl_wx_la-mgl_wx.lo: mgl_wx.cpp -@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_wx_la_CXXFLAGS) $(CXXFLAGS) -MT libmgl_wx_la-mgl_wx.lo -MD -MP -MF $(DEPDIR)/libmgl_wx_la-mgl_wx.Tpo -c -o libmgl_wx_la-mgl_wx.lo `test -f 'mgl_wx.cpp' || echo '$(srcdir)/'`mgl_wx.cpp -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/libmgl_wx_la-mgl_wx.Tpo $(DEPDIR)/libmgl_wx_la-mgl_wx.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='mgl_wx.cpp' object='libmgl_wx_la-mgl_wx.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmgl_wx_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_wx_la-mgl_wx.lo `test -f 'mgl_wx.cpp' || echo '$(srcdir)/'`mgl_wx.cpp +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmgl_wnd_la_CPPFLAGS) $(CPPFLAGS) $(libmgl_wnd_la_CXXFLAGS) $(CXXFLAGS) -c -o libmgl_wnd_la-qt.lo `test -f 'qt.cpp' || echo '$(srcdir)/'`qt.cpp mostlyclean-libtool: -rm -f *.lo diff --git a/widgets/mgl_fltk.cpp b/widgets/fltk.cpp similarity index 58% rename from widgets/mgl_fltk.cpp rename to widgets/fltk.cpp index bd82199..4eb5b0a 100644 --- a/widgets/mgl_fltk.cpp +++ b/widgets/fltk.cpp @@ -23,12 +23,8 @@ #include #include #include -//#include -#include "mgl/mgl_fltk.h" -#include "mgl/mgl_eps.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" +#include "mgl/fltk.h" #ifdef USE_GETTEXT #include @@ -42,28 +38,28 @@ //----------------------------------------------------------------------------- #include "xpm/alpha_on.xpm" #include "xpm/light_on.xpm" -#include "xpm/zoom_on.xpm" +//#include "xpm/zoom_on.xpm" #include "xpm/show_on.xpm" #include "xpm/rotate_on.xpm" #include "xpm/show_sl.xpm" #include "xpm/next_sl.xpm" #include "xpm/prev_sl.xpm" -#include "xpm/left_1.xpm" -#include "xpm/right_1.xpm" -#include "xpm/down_1.xpm" -#include "xpm/norm_1.xpm" -#include "xpm/zoom_1.xpm" -#include "xpm/up_1.xpm" +//#include "xpm/left_1.xpm" +//#include "xpm/right_1.xpm" +//#include "xpm/down_1.xpm" +//#include "xpm/norm_1.xpm" +//#include "xpm/zoom_1.xpm" +//#include "xpm/up_1.xpm" #include "xpm/alpha.xpm" #include "xpm/light.xpm" -#include "xpm/zoom_in.xpm" +//#include "xpm/zoom_in.xpm" #include "xpm/zoom_out.xpm" #include "xpm/rotate.xpm" #include "xpm/ok.xpm" //----------------------------------------------------------------------------- Fl_Pixmap xpm_a1(alpha_xpm), xpm_a2(alpha_on_xpm); Fl_Pixmap xpm_l1(light_on_xpm), xpm_l2(light_xpm); -Fl_Pixmap xpm_z1(zoom_in_xpm), xpm_z2(zoom_on_xpm); +//Fl_Pixmap xpm_z1(zoom_in_xpm), xpm_z2(zoom_on_xpm); Fl_Pixmap xpm_s1(show_sl_xpm), xpm_s2(show_on_xpm); Fl_Pixmap xpm_r1(rotate_xpm), xpm_r2(rotate_on_xpm); //----------------------------------------------------------------------------- @@ -71,11 +67,10 @@ Fl_Pixmap xpm_r1(rotate_xpm), xpm_r2(rotate_on_xpm); // class Fl_MathGL // //----------------------------------------------------------------------------- -Fl_MathGL::Fl_MathGL(int x, int y, int w, int h, char *label) : Fl_Widget(x,y,w,h,label) +Fl_MathGL::Fl_MathGL(int xx, int yy, int ww, int hh, char *lbl) : Fl_Widget(xx,yy,ww,hh,lbl) { - graph = 0; - tet=phi=x1=y1=0; x2=y2=1; - zoom = rotate = false; + graph = new mglCanvas; + rotate = false; tet=phi=0; flag=x0=y0=xe=ye=0; tet_val = phi_val = 0; draw_par = 0; draw_func = 0; @@ -83,39 +78,42 @@ Fl_MathGL::Fl_MathGL(int x, int y, int w, int h, char *label) : Fl_Widget(x,y,w, //----------------------------------------------------------------------------- Fl_MathGL::~Fl_MathGL() {} //----------------------------------------------------------------------------- +void Fl_MathGL::set_graph(mglCanvas *gr) +{ + if(!gr) return; + delete graph; graph=gr; +} +//----------------------------------------------------------------------------- void Fl_MathGL::draw() { - if(zoom && x0!=xe && y0!=ye) - fl_rect(x0GetBits() : 0; - if(g) - fl_draw_image(g, x(), y(), graph->GetWidth(), graph->GetHeight(), 3); + if(g) fl_draw_image(g, x(), y(), graph->GetWidth(), graph->GetHeight(), 3); } //----------------------------------------------------------------------------- -void Fl_MathGL::update(mglGraph *gr) +void Fl_MathGL::update(mglCanvas *gr) { if(gr==0) gr=graph; if(gr==0) return; if(draw_func) { - if(gr!=graph || graph->ClfOnUpdate) gr->DefaultPlotParam(); - gr->Message = new char[2048]; gr->Message[0] = 0; - gr->Alpha(flag&1); - gr->Light(flag&2); - gr->View(tet,phi); - gr->Zoom(x1,y1,x2,y2); - gr->DrawFace = !rotate; + if(gr!=graph || graph->get(MGL_CLF_ON_UPD)) gr->DefaultPlotParam(); + gr->ResetFrames(); + char *buf = new char[2048]; *buf = 0; + gr->Message = buf; + gr->Alpha(flag&1); gr->Light(flag&2); + gr->View(tet,phi); gr->Clf(); +// gr->DrawFace = !rotate; // TODO: switch to fast drawing here draw_func(gr, draw_par); - if(gr->Message[0] != 0) fl_message("%s",gr->Message); - delete []gr->Message; gr->Message = 0; + if(*buf) fl_message("%s",buf); + gr->Message = 0; delete []buf; } if(gr==graph && (graph->GetWidth()!=w() || graph->GetHeight()!=h())) size(graph->GetWidth(), graph->GetHeight()); redraw(); Fl::flush(); } //----------------------------------------------------------------------------- -void Fl_MathGL::resize(int x, int y, int w, int h) -{ Fl_Widget::resize(x,y,w,h); } +void Fl_MathGL::resize(int xx, int yy, int ww, int hh) +{ Fl_Widget::resize(xx,yy,ww,hh); } //----------------------------------------------------------------------------- int Fl_MathGL::handle(int code) { @@ -124,14 +122,14 @@ int Fl_MathGL::handle(int code) const Fl_Menu_Item *m = popup->popup(Fl::event_x(), Fl::event_y(), 0, 0, 0); if(m) m->do_callback(wpar, vpar); } - if(graph->ShowMousePos && !zoom && !rotate && code==FL_PUSH && Fl::event_button()==FL_LEFT_MOUSE) + if(graph->get(MGL_SHOW_POS) && !rotate && code==FL_PUSH && Fl::event_button()==FL_LEFT_MOUSE) { mglPoint p = graph->CalcXYZ(Fl::event_x()-x(), Fl::event_y()-y()); char s[128]; sprintf(s,"x=%g, y=%g, z=%g",p.x,p.y,p.z); draw(); fl_color(FL_BLACK); fl_draw(s,40,70); } - if((!zoom && !rotate) || Fl::event_button()!=FL_LEFT_MOUSE) + if(!rotate || Fl::event_button()!=FL_LEFT_MOUSE) { if(code==FL_FOCUS || code==FL_UNFOCUS) return 1; if(code==FL_KEYUP) @@ -139,9 +137,7 @@ int Fl_MathGL::handle(int code) int key=Fl::event_key(); if(!strchr(" .,wasdrfx",key)) return 0; if(key==' ') - { - update(); return 1; - } + { update(); return 1; } if(key=='w') { tet += 10; @@ -168,7 +164,7 @@ int Fl_MathGL::handle(int code) } if(key=='x') { - mglGraphFLTK *g=dynamic_cast(graph); + mglCanvasFL *g=dynamic_cast(graph); if(g && g->FMGL==this) { g->Wnd->hide(); return 1; } else return 0; @@ -176,14 +172,14 @@ int Fl_MathGL::handle(int code) } if(key==',') { - mglGraphFLTK *g=dynamic_cast(graph); + mglCanvasFL *g=dynamic_cast(graph); if(g && g->FMGL==this) { g->PrevFrame(); return 1; } else return 0; } if(key=='.') { - mglGraphFLTK *g=dynamic_cast(graph); + mglCanvasFL *g=dynamic_cast(graph); if(g && g->FMGL==this) { g->NextFrame(); return 1; } else return 0; @@ -202,9 +198,7 @@ int Fl_MathGL::handle(int code) return 0; } if(code==FL_PUSH) - { - xe=x0=Fl::event_x(); ye=y0=Fl::event_y(); - } + { xe=x0=Fl::event_x(); ye=y0=Fl::event_y(); } if(code==FL_DRAG) { xe=Fl::event_x(); ye=Fl::event_y(); @@ -222,92 +216,34 @@ int Fl_MathGL::handle(int code) } if(code==FL_RELEASE) { - if(zoom) - { - int w1=w(),h1=h(); - mreal _x1,_x2,_y1,_y2; - _x1 = x1+(x2-x1)*(x0-x())/mreal(w1); - _y1 = y2-(y2-y1)*(ye-y())/mreal(h1); - _x2 = x1+(x2-x1)*(xe-x())/mreal(w1); - _y2 = y2-(y2-y1)*(y0-y())/mreal(h1); - x1=_x1; x2=_x2; y1=_y1; y2=_y2; - if(x1>x2) { _x1=x1; x1=x2; x2=_x1; } - if(y1>y2) { _x1=y1; y1=y2; y2=_x1; } - update(); - } - else - { - if(tet_val) tet_val->value(tet); - if(phi_val) phi_val->value(phi); - } + if(tet_val) tet_val->value(tet); + if(phi_val) phi_val->value(phi); redraw(); } return 1; } //----------------------------------------------------------------------------- // -// class mglGraphFLTK +// class mglCanvasFL // //----------------------------------------------------------------------------- -mglGraphFLTK::mglGraphFLTK() : mglGraphZB() -{ - GG = 0; Wnd = 0; - NumFig = 0; CurFig = -1; - alpha = light = sshow = 0; -} -//----------------------------------------------------------------------------- -mglGraphFLTK::~mglGraphFLTK() -{ if(GG) free(GG); } -//----------------------------------------------------------------------------- -void mglGraphFLTK::SetSize(int w,int h) -{ - if(GG) free(GG); GG = 0; - mglGraphZB::SetSize(w,h); -} -//----------------------------------------------------------------------------- -void mglGraphFLTK::EndFrame() -{ - CurFig = CurFrameId-1; - if(!GG) - { - GG = (unsigned char *)malloc(3*Width*Height); - NumFig = 1; CurFig = 0; - } - else if(CurFig>NumFig-1) - { - GG = (unsigned char *)realloc(GG,3*(NumFig+1)*Width*Height); - NumFig++; - } - mglGraph::EndFrame(); - memcpy(GG + CurFig*Width*Height*3,G,3*Width*Height); - CurFig++; -} -//----------------------------------------------------------------------------- -void mglGraphFLTK::Clf(mglColor Back) -{ - if(AutoClf) mglGraphZB::Clf(Back); -} -//----------------------------------------------------------------------------- -const unsigned char *mglGraphFLTK::GetBits() -{ - Finish(); - unsigned char *g = G; - if(GG && NumFig>0 && CurFig=0) - g = GG + CurFig*Width*Height*3; - return g; -} +mglCanvasFL::mglCanvasFL() : mglCanvasW() +{ Wnd = 0; alpha = light = sshow = 0; } +mglCanvasFL::~mglCanvasFL() { if(Wnd) delete Wnd; } //----------------------------------------------------------------------------- -void mglGraphFLTK::NextFrame() +void mglCanvasFL::NextFrame() { - if(NumFig>0) { CurFig = CurFig>NumFig-1 ? 0 : CurFig+1; FMGL->redraw(); } + if(GetNumFig()>0) + { SetCurFig(GetCurFig()>GetNumFig()-1 ? 0 : GetCurFig()+1); FMGL->redraw(); } } //----------------------------------------------------------------------------- -void mglGraphFLTK::PrevFrame() +void mglCanvasFL::PrevFrame() { - if(NumFig>0) { CurFig = CurFig<0 ? NumFig-1 : CurFig-1; FMGL->redraw(); } + if(GetNumFig()>0) + { SetCurFig(GetCurFig()<0 ? GetNumFig()-1 : GetCurFig()-1); FMGL->redraw(); } } //----------------------------------------------------------------------------- -void mglGraphFLTK::ToggleAlpha() +void mglCanvasFL::ToggleAlpha() { alpha = 1-alpha; alpha_bt->value(alpha); @@ -317,9 +253,10 @@ void mglGraphFLTK::ToggleAlpha() if(m && !alpha) m->clear(); Update(); } -void alpha_cb(Fl_Widget*, void* v) { ((mglGraphFLTK*)v)->ToggleAlpha(); } +void alpha_cb(Fl_Widget*, void* v) +{ mglCanvasFL *g=dynamic_cast((mglCanvas*)v); if(g) g->ToggleAlpha(); } //----------------------------------------------------------------------------- -void mglGraphFLTK::ToggleLight() +void mglCanvasFL::ToggleLight() { light = 1-light; light_bt->value(light); @@ -329,47 +266,37 @@ void mglGraphFLTK::ToggleLight() if(m && !light) m->clear(); Update(); } -void light_cb(Fl_Widget*, void* v) { ((mglGraphFLTK*)v)->ToggleLight(); } +void light_cb(Fl_Widget*, void* v) +{ mglCanvasFL *g=dynamic_cast((mglCanvas*)v); if(g) g->ToggleLight(); } //----------------------------------------------------------------------------- -void draw_cb(Fl_Widget*, void* v) { ((mglGraphFLTK*)v)->Update(); } +void draw_cb(Fl_Widget*, void* v) +{ mglCanvasFL *g=dynamic_cast((mglCanvas*)v); if(g) g->Update(); } //----------------------------------------------------------------------------- -void mglGraphFLTK::ToggleNo() +void mglCanvasFL::ToggleNo() { - zoom_bt->value(0); zoom_bt->image(xpm_z1); zoom_bt->redraw(); rotate_bt->value(0); rotate_bt->image(xpm_r1); rotate_bt->redraw(); - tet->value(0); phi->value(0); - zoom = rotate = false; - FMGL->set_zoom(0,0,1,1); - Update(); + rotate = false; Update(); } -void norm_cb(Fl_Widget*, void* v) { ((mglGraphFLTK*)v)->ToggleNo(); } +void norm_cb(Fl_Widget*, void* v) +{ mglCanvasFL *g=dynamic_cast((mglCanvas*)v); if(g) g->ToggleNo(); } //----------------------------------------------------------------------------- -void mglGraphFLTK::ToggleZoom() +void mglCanvasFL::ToggleRotate() { - rotate_bt->value(0); rotate_bt->image(xpm_r1); rotate_bt->redraw(); - FMGL->set_state(zoom_bt->value(), false); - zoom_bt->image(zoom_bt->value()?xpm_z2:xpm_z1); - zoom_bt->redraw(); -} -void zoom_cb(Fl_Widget*, void* v) { ((mglGraphFLTK*)v)->ToggleZoom(); } -//----------------------------------------------------------------------------- -void mglGraphFLTK::ToggleRotate() -{ - zoom_bt->value(0); zoom_bt->image(xpm_z1); zoom_bt->redraw(); - FMGL->set_state(false, rotate_bt->value()!=0); + FMGL->set_state(rotate_bt->value()!=0); rotate_bt->image(rotate_bt->value()?xpm_r2:xpm_r1); rotate_bt->redraw(); if(!rotate_bt->value()) Update(); } -void rotate_cb(Fl_Widget*, void* v) { ((mglGraphFLTK*)v)->ToggleRotate(); } +void rotate_cb(Fl_Widget*, void* v) +{ mglCanvasFL *g=dynamic_cast((mglCanvas*)v); if(g) g->ToggleRotate(); } //----------------------------------------------------------------------------- -void mglGraphFLTK::Update() +void mglCanvasFL::Update() { - FMGL->set_state(zoom_bt->value(), rotate_bt->value()); - FMGL->set_state(alpha + 2*light); + FMGL->set_state(rotate_bt->value()); + FMGL->set_flag(alpha + 2*light); FMGL->set_angle(tet->value(), phi->value()); - CurFig=0; + SetCurFig(0); FMGL->update(); } //----------------------------------------------------------------------------- @@ -377,152 +304,85 @@ void export_png_cb(Fl_Widget*, void* v) { char *fname = fl_file_chooser(gettext("Save File As?"), "*.png", 0); if(!fname || !fname[0]) return; - ((mglGraphFLTK*)v)->WritePNG(fname); + ((mglCanvas*)v)->WritePNG(fname); } //----------------------------------------------------------------------------- void export_bps_cb(Fl_Widget*, void* v) { char *fname = fl_file_chooser(gettext("Save File As?"), "*.eps", 0); if(!fname || !fname[0]) return; - ((mglGraphFLTK*)v)->WriteEPS(fname); + ((mglCanvas*)v)->WriteEPS(fname); } //----------------------------------------------------------------------------- void export_pngn_cb(Fl_Widget*, void* v) { char *fname = fl_file_chooser(gettext("Save File As?"), "*.png", 0); if(!fname || !fname[0]) return; - ((mglGraphFLTK*)v)->WritePNG(fname,0,false); + ((mglCanvas*)v)->WritePNGs(fname,0); } //----------------------------------------------------------------------------- void export_jpeg_cb(Fl_Widget*, void* v) { char *fname = fl_file_chooser(gettext("Save File As?"), "*.jpg", 0); if(!fname || !fname[0]) return; - ((mglGraphFLTK*)v)->WriteJPEG(fname); + ((mglCanvas*)v)->WriteJPEG(fname); } //----------------------------------------------------------------------------- void export_svg_cb(Fl_Widget*, void* v) { - mglGraphFLTK* e = (mglGraphFLTK*)v; char *fname = fl_file_chooser(gettext("Save File As?"), "*.svg", 0); if(!fname || !fname[0]) return; - mglGraphPS *ps = new mglGraphPS(e->GetWidth(), e->GetHeight()); - ps->SetFont(e->GetFont()); - e->FMGL->update(ps); ps->WriteSVG(fname); - delete ps; + ((mglCanvas*)v)->WriteSVG(fname); } //----------------------------------------------------------------------------- void export_eps_cb(Fl_Widget*, void* v) { - mglGraphFLTK* e = (mglGraphFLTK*)v; char *fname = fl_file_chooser(gettext("Save File As?"), "*.eps", 0); if(!fname || !fname[0]) return; - mglGraphPS *ps = new mglGraphPS(e->GetWidth(), e->GetHeight()); - ps->SetFont(e->GetFont()); - e->FMGL->update(ps); - ps->WriteEPS(fname); - delete ps; + ((mglCanvas*)v)->WriteEPS(fname); } //----------------------------------------------------------------------------- -void mglGraphFLTK::ReLoad(bool o) -{ if(LoadFunc) { LoadFunc(o, FuncPar); Update(); } } -void oncemore_cb(Fl_Widget*, void*v) { ((mglGraphFLTK*)v)->ReLoad(true); } +void oncemore_cb(Fl_Widget*, void*v) +{ mglCanvasFL *g=dynamic_cast((mglCanvas*)v); if(g) g->ReLoad(); } //----------------------------------------------------------------------------- -void su_cb(Fl_Widget*, void* v) -{ - mglGraphFLTK* e = (mglGraphFLTK*)v; - mreal x1,x2,y1,y2,d; - e->FMGL->get_zoom(&x1,&y1,&x2,&y2); - d = (y2-y1)/3; y1 += d; y2 += d; - e->FMGL->set_zoom(x1,y1,x2,y2); - e->Update(); -} -//----------------------------------------------------------------------------- -void sd_cb(Fl_Widget*, void* v) -{ - mglGraphFLTK* e = (mglGraphFLTK*)v; - mreal x1,x2,y1,y2,d; - e->FMGL->get_zoom(&x1,&y1,&x2,&y2); - d = (y2-y1)/3; y1 -= d; y2 -= d; - e->FMGL->set_zoom(x1,y1,x2,y2); - e->Update(); -} -//----------------------------------------------------------------------------- -void sr_cb(Fl_Widget*, void* v) -{ - mglGraphFLTK* e = (mglGraphFLTK*)v; - mreal x1,x2,y1,y2,d; - e->FMGL->get_zoom(&x1,&y1,&x2,&y2); - d = (x2-x1)/3; x1 += d; x2 += d; - e->FMGL->set_zoom(x1,y1,x2,y2); - e->Update(); -} -//----------------------------------------------------------------------------- -void sl_cb(Fl_Widget*, void* v) -{ - mglGraphFLTK* e = (mglGraphFLTK*)v; - mreal x1,x2,y1,y2,d; - e->FMGL->get_zoom(&x1,&y1,&x2,&y2); - d = (x2-x1)/3; x1 -= d; x2 -= d; - e->FMGL->set_zoom(x1,y1,x2,y2); - e->Update(); -} -//----------------------------------------------------------------------------- -void sz_cb(Fl_Widget*, void* v) -{ - mglGraphFLTK* e = (mglGraphFLTK*)v; - mreal x1,x2,y1,y2,d; - e->FMGL->get_zoom(&x1,&y1,&x2,&y2); - d = (y2-y1)/4; y1 += d; y2 -= d; - d = (x2-x1)/4; x1 += d; x2 -= d; - e->FMGL->set_zoom(x1,y1,x2,y2); - e->Update(); -} -//----------------------------------------------------------------------------- -void so_cb(Fl_Widget*, void* v) -{ - mglGraphFLTK* e = (mglGraphFLTK*)v; - mreal x1,x2,y1,y2,d; - e->FMGL->get_zoom(&x1,&y1,&x2,&y2); - d = (y2-y1)/2; y1 -= d; y2 += d; - d = (x2-x1)/2; x1 -= d; x2 += d; - e->FMGL->set_zoom(x1,y1,x2,y2); - e->Update(); -} -//----------------------------------------------------------------------------- -void mglGraphFLTK::Adjust() +void mglCanvasFL::Adjust() { SetSize(scroll->w(), scroll->h()); FMGL->size(scroll->w(), scroll->h()); Update(); } -void adjust_cb(Fl_Widget*, void*v) { ((mglGraphFLTK*)v)->Adjust(); } +void adjust_cb(Fl_Widget*, void*v) +{ mglCanvasFL *g=dynamic_cast((mglCanvas*)v); if(g) g->Adjust(); } //----------------------------------------------------------------------------- -void quit_cb(Fl_Widget*, void*v) { ((mglGraphFLTK*)v)->Wnd->hide(); } +void quit_cb(Fl_Widget*, void*v) +{ mglCanvasFL *g=dynamic_cast((mglCanvas*)v); if(g) g->Wnd->hide(); } //----------------------------------------------------------------------------- -void snext_cb(Fl_Widget*, void* v) { ((mglGraphFLTK*)v)->NextFrame(); } +void snext_cb(Fl_Widget*, void* v) +{ mglCanvasFL *g=dynamic_cast((mglCanvas*)v); if(g) g->NextFrame(); } //----------------------------------------------------------------------------- -void sprev_cb(Fl_Widget*, void* v) { ((mglGraphFLTK*)v)->PrevFrame(); } +void sprev_cb(Fl_Widget*, void* v) +{ mglCanvasFL *g=dynamic_cast((mglCanvas*)v); if(g) g->PrevFrame(); } //----------------------------------------------------------------------------- void time_cb(void *v) { - mglGraphFLTK *e = (mglGraphFLTK*)v; - if(!e->sshow) return; - e->NextFrame(); - Fl::repeat_timeout(e->Delay, time_cb, v); + mglCanvasFL *g=dynamic_cast((mglCanvas*)v); + if(!g || !g->sshow) return; + g->NextFrame(); + Fl::repeat_timeout(g->GetDelay(), time_cb, v); } //----------------------------------------------------------------------------- -void mglGraphFLTK::Animation() +void mglCanvasFL::Animation() { - sshow = NumFig<2 ? 0 : 1-sshow; + sshow = GetNumFig()<2 ? 0 : 1-sshow; anim_bt->value(sshow); anim_bt->image(sshow?xpm_s2:xpm_s1); anim_bt->redraw(); Fl_Menu_Item *m = (Fl_Menu_Item *)menu->find_item(gettext("Animate/Slideshow")); if(m && sshow) m->set(); if(m && !sshow) m->clear(); - if(sshow) Fl::add_timeout(Delay, time_cb, this); + if(sshow) Fl::add_timeout(GetDelay(), time_cb, this); } -void sshow_cb(Fl_Widget *, void *v) { ((mglGraphFLTK*)v)->Animation(); } +void sshow_cb(Fl_Widget *, void *v) +{ mglCanvasFL *g=dynamic_cast((mglCanvas*)v); if(g) g->Animation(); } void no_cb(Fl_Widget *, void *) {} //----------------------------------------------------------------------------- Fl_Menu_Item pop_graph[15] = { @@ -569,19 +429,13 @@ Fl_Menu_Item menuitems[] = { { 0,0,0,0,0,0,0,0,0 } }; //----------------------------------------------------------------------------- -void mglGraphFLTK::Window(int argc, char **argv, int (*draw)(mglGraph *gr, void *p), const char *title, void *par, void (*reload)(int next, void *p), bool maximize) +void mglCanvasFL::Window(int argc, char **argv, int (*draw)(mglBase *gr, void *p), const char *title, void *par, void (*reload)(void *p), bool maximize) { - NumFig=0; CurFig=0; - CurFrameId = 0; - int n = draw ? draw(this,par) : 0; - if(n=0) NumFig = n; - DrawFunc = draw; FuncPar = par; - LoadFunc = reload; - + SetDrawFunc(draw, par, reload); if(Wnd) { Wnd->label(title); Wnd->show(); return; } - Fl_Window *w1=new Fl_Double_Window(0,0,630,460,title); - menu = new Fl_Menu_Bar(0, 0, 630, 30); + Fl_Window *w1=new Fl_Double_Window(0,0,830,660,title); + menu = new Fl_Menu_Bar(0, 0, 830, 30); menu->copy(menuitems, this); Fl_Group *g = new Fl_Group(0,30,410,30); @@ -600,10 +454,6 @@ void mglGraphFLTK::Window(int argc, char **argv, int (*draw)(mglGraph *gr, void rotate_bt->image(xpm_r1); rotate_bt->callback(rotate_cb,this); rotate_bt->tooltip(gettext("Rotate picture by holding left mouse button")); rotate_bt->box(FL_PLASTIC_UP_BOX); rotate_bt->down_box(FL_PLASTIC_DOWN_BOX); - zoom_bt = new Fl_Button(80, 31, 25, 25); zoom_bt->type(FL_TOGGLE_BUTTON); - zoom_bt->image(xpm_z1); zoom_bt->callback(zoom_cb,this); - zoom_bt->tooltip(gettext("Zoom in selected region of the picture")); - zoom_bt->box(FL_PLASTIC_UP_BOX); zoom_bt->down_box(FL_PLASTIC_DOWN_BOX); o = new Fl_Button(105, 31, 25, 25); o->tooltip(gettext("Return picture to normal zoom")); o->image(new Fl_Pixmap(zoom_out_xpm)); o->callback(norm_cb,this); o->box(FL_PLASTIC_UP_BOX); o->down_box(FL_PLASTIC_DOWN_BOX); @@ -622,47 +472,27 @@ void mglGraphFLTK::Window(int argc, char **argv, int (*draw)(mglGraph *gr, void g->end(); g->resizable(0); g = new Fl_Group(0,60,30,260); - o = new Fl_Button(1, 60, 25, 25); o->tooltip(gettext("Shift the picture up")); - o->image(new Fl_Pixmap(up_1_xpm)); o->callback(su_cb,this); - o->box(FL_PLASTIC_UP_BOX); o->down_box(FL_PLASTIC_DOWN_BOX); - o = new Fl_Button(1, 85, 25, 25); o->tooltip(gettext("Shift the picture left")); - o->image(new Fl_Pixmap(left_1_xpm)); o->callback(sl_cb,this); - o->box(FL_PLASTIC_UP_BOX); o->down_box(FL_PLASTIC_DOWN_BOX); - o = new Fl_Button(1, 110, 25, 25); o->tooltip(gettext("Zoom in the picture")); - o->image(new Fl_Pixmap(zoom_1_xpm)); o->callback(sz_cb,this); - o->box(FL_PLASTIC_UP_BOX); o->down_box(FL_PLASTIC_DOWN_BOX); - o = new Fl_Button(1, 135, 25, 25); o->tooltip(gettext("Zoom out the picture")); - o->image(new Fl_Pixmap(norm_1_xpm)); o->callback(so_cb,this); - o->box(FL_PLASTIC_UP_BOX); o->down_box(FL_PLASTIC_DOWN_BOX); - o = new Fl_Button(1, 160, 25, 25); o->tooltip(gettext("Shift the picture right")); - o->image(new Fl_Pixmap(right_1_xpm)); o->callback(sr_cb,this); - o->box(FL_PLASTIC_UP_BOX); o->down_box(FL_PLASTIC_DOWN_BOX); - o = new Fl_Button(1, 185, 25, 25); o->tooltip(gettext("Shift the picture down")); - o->image(new Fl_Pixmap(down_1_xpm)); o->callback(sd_cb,this); - o->box(FL_PLASTIC_UP_BOX); o->down_box(FL_PLASTIC_DOWN_BOX); - - o = new Fl_Button(1, 215, 25, 25); o->tooltip(gettext("Show previous frame in slideshow")); + o = new Fl_Button(1, 60, 25, 25); o->tooltip(gettext("Show previous frame in slideshow")); o->image(new Fl_Pixmap(prev_sl_xpm)); o->callback(sprev_cb,this); o->box(FL_PLASTIC_UP_BOX); o->down_box(FL_PLASTIC_DOWN_BOX); - anim_bt = new Fl_Button(1, 240, 25, 25); anim_bt->type(FL_TOGGLE_BUTTON); + anim_bt = new Fl_Button(1, 85, 25, 25); anim_bt->type(FL_TOGGLE_BUTTON); anim_bt->image(xpm_s1); anim_bt->callback(sshow_cb,this); anim_bt->tooltip(gettext("Run/Stop slideshow (graphics animation)")); anim_bt->box(FL_PLASTIC_UP_BOX); anim_bt->down_box(FL_PLASTIC_DOWN_BOX); - o = new Fl_Button(1, 265, 25, 25); o->tooltip(gettext("Show next frame in slideshow")); + o = new Fl_Button(1, 110, 25, 25); o->tooltip(gettext("Show next frame in slideshow")); o->image(new Fl_Pixmap(next_sl_xpm)); o->callback(snext_cb,this); o->box(FL_PLASTIC_UP_BOX); o->down_box(FL_PLASTIC_DOWN_BOX); g->end(); g->resizable(0); - scroll = new Fl_Scroll(30, 60, 600, 400); + scroll = new Fl_Scroll(30, 60, 800, 600); //scroll->begin(); - FMGL = new Fl_MathGL(30, 60, 600, 400); + FMGL = new Fl_MathGL(30, 60, 800, 600); FMGL->tet_val = tet; FMGL->phi_val = phi; FMGL->set_popup(pop_graph,w1,this); - FMGL->graph = this; - FMGL->draw_func = draw; - FMGL->draw_par = par; + FMGL->set_graph(this); + FMGL->set_draw(draw, par); scroll->end(); w1->end(); @@ -682,24 +512,23 @@ void mglGraphFLTK::Window(int argc, char **argv, int (*draw)(mglGraph *gr, void delete []tmp[0]; } //----------------------------------------------------------------------------- -int mglFlRun() { return Fl::run(); } -//----------------------------------------------------------------------------- -HMGL mgl_create_graph_fltk_dr(HMDR dr, const char *title) +HMGL mgl_create_graph_fltk(int (*draw)(HMGL gr, void *p), const char *title, void *par) { - mglGraphFLTK *g = new mglGraphFLTK; - g->Window(0,0,title,dr); + mglCanvasFL *g = new mglCanvasFL; + g->Window(0,0,draw,title,par); return g; } +void mgl_fltk_run() { Fl::run(); } //----------------------------------------------------------------------------- -HMGL mgl_create_graph_fltk(int (*draw)(HMGL gr, void *p), const char *title, void *par) +uintptr_t mgl_create_graph_fltk_(const char *title, int l) { - mglGraphFLTK *g = new mglGraphFLTK; - g->Window(0,0,draw,title,par); - return g; + char *s = new char[l+1]; memcpy(s,title,l); s[l]=0; + uintptr_t t = uintptr_t(mgl_create_graph_fltk(0,s,0)); + delete []s; return t; } +void mgl_fltk_run_() { mgl_fltk_run(); } //----------------------------------------------------------------------------- -void *mgl_fl_tmp(void *) { mglFlRun(); return 0; } -void mgl_fltk_run() { mglFlRun(); } +void *mgl_fl_tmp(void *) { Fl::run(); return 0; } /*void mgl_fltk_thread() { static pthread_t tmp; @@ -707,17 +536,3 @@ void mgl_fltk_run() { mglFlRun(); } pthread_detach(tmp); }*/ //----------------------------------------------------------------------------- -//uintptr_t mgl_create_graph_fltk_(int (*draw)(uintptr_t *gr), const char *title, int l) -uintptr_t mgl_create_graph_fltk_(const char *title, int l) -{ - mglGraphFLTK *g = new mglGraphFLTK; - char *s = new char[l+1]; memcpy(s,title,l); s[l]=0; -// g->Window(0,0,mgl_fortran_func,s,(void*)draw); - g->Window(0,0,0,s,0,0); - delete []s; - return uintptr_t(g); -} -//----------------------------------------------------------------------------- -void mgl_fltk_run_() { mglFlRun(); } -//void mgl_fltk_thread_() { mgl_fltk_thread(); } -//----------------------------------------------------------------------------- diff --git a/widgets/mgl_glut.cpp b/widgets/glut.cpp similarity index 72% rename from widgets/mgl_glut.cpp rename to widgets/glut.cpp index 70a10a7..41a4d69 100644 --- a/widgets/mgl_glut.cpp +++ b/widgets/glut.cpp @@ -2,21 +2,21 @@ * mgl_glut.cpp is part of Math Graphic Library * Copyright (C) 2007 Alexey Balakin * * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ #define GLUT_NO_LIB_PRAGMA #define GLUT_NO_WARNING_DISABLE @@ -39,11 +39,9 @@ #include #include -#include "mgl/mgl_glut.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" +#include "mgl/glut.h" -mglGraphGLUT *_mgl_glwnd; +mglCanvasGLUT *_mgl_glwnd; void _mgl_key_up(unsigned char ch,int ,int ); //----------------------------------------------------------------------------- void _mgl_timer(int) @@ -59,15 +57,6 @@ void _mgl_timer(int) glutTimerFunc(int(_mgl_glwnd->Delay*1000),_mgl_timer,0); } //----------------------------------------------------------------------------- -void mglGraphGLUT::ToggleAlpha() { _mgl_key_up('r',0,0); } -void mglGraphGLUT::ToggleLight() { _mgl_key_up('f',0,0); } -void mglGraphGLUT::ToggleNo() { _mgl_key_up('n',0,0); } -void mglGraphGLUT::Update() { _mgl_key_up(' ',0,0); } -void mglGraphGLUT::ReLoad(bool o) { _mgl_key_up(o?']':'[',0,0); } -void mglGraphGLUT::NextFrame() { _mgl_key_up('.',0,0); } -void mglGraphGLUT::PrevFrame() { _mgl_key_up(',',0,0); } -void mglGraphGLUT::Animation() { _mgl_key_up('m',0,0); } -//----------------------------------------------------------------------------- void _mgl_key_up(unsigned char ch,int ,int ) { if(!_mgl_glwnd) return; @@ -113,39 +102,32 @@ void _mgl_key_up(unsigned char ch,int ,int ) if(ch=='[' && _mgl_glwnd->LoadFunc) { glDeleteLists(1,_mgl_glwnd->NumFig); - _mgl_glwnd->LoadFunc(false, 0); - (_mgl_glwnd->DrawFunc)(_mgl_glwnd,_mgl_glwnd->FuncPar); - _mgl_glwnd->Finish(); - } - if(ch==']' && _mgl_glwnd->LoadFunc) - { - glDeleteLists(1,_mgl_glwnd->NumFig); - _mgl_glwnd->LoadFunc(true, 0); + _mgl_glwnd->LoadFunc(_mgl_glwnd->FuncPar); (_mgl_glwnd->DrawFunc)(_mgl_glwnd,_mgl_glwnd->FuncPar); _mgl_glwnd->Finish(); } if(ch=='P') { char str[128]; - sprintf(str,"%s_%d.png",_mgl_glwnd->PlotId,_mgl_glwnd->curr_fig); + sprintf(str,"%s_%d.png",_mgl_glwnd->PlotId.c_str(),_mgl_glwnd->curr_fig); _mgl_glwnd->WritePNG(str, "Math GL"); } if(ch=='J') { char str[128]; - sprintf(str,"%s_%d.jpg",_mgl_glwnd->PlotId,_mgl_glwnd->curr_fig); + sprintf(str,"%s_%d.jpg",_mgl_glwnd->PlotId.c_str(),_mgl_glwnd->curr_fig); _mgl_glwnd->WriteJPEG(str, "Math GL"); } if(ch=='E') { char str[128]; - sprintf(str,"%s_%d.eps",_mgl_glwnd->PlotId,_mgl_glwnd->curr_fig); + sprintf(str,"%s_%d.eps",_mgl_glwnd->PlotId.c_str(),_mgl_glwnd->curr_fig); _mgl_glwnd->WriteEPS(str, "Math GL"); } if(ch==' ') _mgl_glwnd->Clf(); if(ch=='m') _mgl_glwnd->tt = 1-_mgl_glwnd->tt; rL = rL<0 ? 0 : (rL>5 ? 5 : rL); - _mgl_glwnd->Light(0,mglPoint(rL*cos(pL)*sin(tL), rL*sin(pL)*sin(tL), rL*cos(tL)),false); + _mgl_glwnd->AddLight(0,mglPoint(rL*cos(pL)*sin(tL), rL*sin(pL)*sin(tL), rL*cos(tL)),false); _mgl_glwnd->Alpha(Alpha); _mgl_glwnd->Light(Light); // glEnable(GL_BLEND); @@ -173,12 +155,9 @@ void _mgl_display() if(_mgl_glwnd->AutoClf) glutSwapBuffers(); } //----------------------------------------------------------------------------- -mglGraphGLUT::~mglGraphGLUT() -{ - _mgl_glwnd = 0; -} +mglCanvasGLUT::~mglCanvasGLUT() { _mgl_glwnd = 0; } //----------------------------------------------------------------------------- -void mglGraphGLUT::Window(int argc, char **argv,int (*draw)(mglGraph *gr, void *p),const char *title, void *par, void (*reload)(int next, void *p), bool maximize) +void mglCanvasGLUT::Window(int argc, char **argv,int (*draw)(mglBase *gr, void *p),const char *title, void *par, void (*reload)(void *p), bool maximize) { NumFig=0; curr_fig=1; tt=0; _mgl_glwnd = this; @@ -191,7 +170,7 @@ void mglGraphGLUT::Window(int argc, char **argv,int (*draw)(mglGraph *gr, void * glutInitWindowSize(600, 600); glutCreateWindow("MathPlotLibrary"); - Light(0,mglPoint(0,0,3),false); + AddLight(0,mglPoint(0,0,3),false); NumFig = draw(this,par)-1; Finish(); DrawFunc = draw; FuncPar = par; LoadFunc = reload; @@ -207,28 +186,12 @@ void mglGraphGLUT::Window(int argc, char **argv,int (*draw)(mglGraph *gr, void * glDeleteLists(1,NumFig); } //----------------------------------------------------------------------------- -HMGL mgl_create_graph_glut(HMDR dr, const char *title) -{ - mglGraphGLUT *g = new mglGraphGLUT; - g->Window(0,0,title,dr); - return g; -} -//----------------------------------------------------------------------------- HMGL mgl_create_graph_glut(int (*draw)(HMGL gr, void *p), const char *title, void *par) { - mglGraphGLUT *g = new mglGraphGLUT; + mglCanvasGLUT *g = new mglCanvasGLUT; g->Window(0,0,draw,title,par); return g; } //----------------------------------------------------------------------------- -mglGraphGLUT::mglGraphGLUT() : mglGraphGL() {} -//----------------------------------------------------------------------------- -/*uintptr_t mgl_create_graph_glut_(int (*draw)(uintptr_t *gr), const char *title, int l) -{ - mglGraphGLUT *g = new mglGraphGLUT; - char *s = new char[l+1]; memcpy(s,title,l); s[l]=0; - g->Window(0,0,mgl_fortran_func,s,(void*)draw); - delete []s; - return uintptr_t(g); -}*/ +mglCanvasGLUT::mglCanvasGLUT() : mglCanvasGL() {} //----------------------------------------------------------------------------- diff --git a/widgets/mgl_wx.cpp b/widgets/mgl_wx.cpp deleted file mode 100644 index 313972b..0000000 --- a/widgets/mgl_wx.cpp +++ /dev/null @@ -1,761 +0,0 @@ -/*************************************************************************** - * mgl_wx.cpp is part of Math Graphic Library * - * Copyright (C) 2007 Alexey Balakin * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * - * published by the Free Software Foundation; either version 3 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 Library General Public * - * License 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 -#include -#include -#include - -#include "mgl/mgl_idtf.h" -#include "mgl/mgl_eps.h" -#include "mgl/mgl_wx.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -//----------------------------------------------------------------------------- -const wxString ScriptName(L"default"); -enum -{ - TIMER_ID=1000, - LAST_ID -}; -BEGIN_EVENT_TABLE(wxMathGL, wxWindow) - EVT_TIMER (TIMER_ID, wxMathGL::OnNextSlide) - EVT_PAINT (wxMathGL::OnPaint) - EVT_SIZE (wxMathGL::OnSize) - EVT_LEFT_DOWN (wxMathGL::OnMouseLeftDown) - EVT_RIGHT_DOWN (wxMathGL::OnMouseDown) - EVT_MIDDLE_DOWN (wxMathGL::OnMouseDown) - EVT_LEFT_UP (wxMathGL::OnMouseLeftUp) - EVT_RIGHT_UP (wxMathGL::OnMouseRightUp) - EVT_MOTION (wxMathGL::OnMouseMove) -END_EVENT_TABLE() -//----------------------------------------------------------------------------- -// -// class wxMathGL -// -//----------------------------------------------------------------------------- -wxMathGL::wxMathGL(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) : wxWindow(parent,id,pos,size,style,name) -{ - AutoResize = false; draw_par = 0; draw_func = 0; - graph = new mglGraphZB; - popup = 0; //!grBuf = 0; - phi = tet = per = 0; - x1 = y1 = 0; x2 = y2 = 1; - alpha = light = zoom = rotate = false; - SetSize(600, 400); - timer = new wxTimer(this,TIMER_ID); AnimDelay = 1000; -} -//----------------------------------------------------------------------------- -wxMathGL::~wxMathGL() { delete graph; }//!if(grBuf) delete []grBuf; } -//----------------------------------------------------------------------------- -void wxMathGL::SetGraph(mglGraphAB *gr) -{ - if(!gr) return; - delete graph; graph=gr; -} -//----------------------------------------------------------------------------- -void wxMathGL::SetDraw(int (*func)(mglGraph *gr, void *par), void *par) -{ draw_func = func; draw_par = par; } -//----------------------------------------------------------------------------- -int mgl_draw_class(mglGraph *gr, void *p); -void wxMathGL::SetDraw(mglDraw *dr) -{ draw_func = mgl_draw_class; draw_par = dr; } -//----------------------------------------------------------------------------- -void wxMathGL::OnPaint(wxPaintEvent& event) -{ - wxPaintDC dc(this); - dc.DrawBitmap(pic,0,0); - if(zoom) dc.DrawRectangle(x0,y0,xe-x0,ye-y0); - if(graph->ShowMousePos && !MousePos.IsEmpty()) - dc.DrawText(MousePos,0,12); -} -//----------------------------------------------------------------------------- -void wxMathGL::OnSize(wxSizeEvent& event) -{ - wxSize ev = event.GetSize(); - if(graph->GetWidth()==ev.GetWidth() && graph->GetHeight()==ev.GetHeight()) - return; - if(AutoResize && ev.GetWidth()>0 && ev.GetHeight()>0) - { graph->SetSize(ev.GetWidth(), ev.GetHeight()); Update(); } - else SetSize(graph->GetWidth(), graph->GetHeight()); -} -//----------------------------------------------------------------------------- -void wxMathGL::OnNextSlide(wxTimerEvent& evt) { NextSlide(); } -//----------------------------------------------------------------------------- -void wxMathGL::SetPer(int p) -{ if(per!=p && p>=0 && p<100) { per = 100*p; Update(); } } -//----------------------------------------------------------------------------- -void wxMathGL::SetPhi(int p) -{ if(phi!=p) { phi = p; Update(); } } -//----------------------------------------------------------------------------- -void wxMathGL::SetTet(int t) -{ if(tet!=t) { tet = t; Update(); } } -//----------------------------------------------------------------------------- -void wxMathGL::SetAlpha(bool a) -{ if(alpha!=a) { alpha = a; Update(); } } -//----------------------------------------------------------------------------- -void wxMathGL::SetLight(bool l) -{ if(light!=l) { light = l; Update(); } } -//----------------------------------------------------------------------------- -void wxMathGL::SetZoom(bool z) -{ if(zoom!=z) { zoom=z; rotate=false; Update(); } } -//----------------------------------------------------------------------------- -void wxMathGL::SetRotate(bool r) -{ if(rotate!=r) { zoom=false; rotate=r; Update(); } } -//----------------------------------------------------------------------------- -void wxMathGL::ShiftDown() -{ mreal d=(y2-y1)/3; y1+=d; y2+=d; Update(); } -//----------------------------------------------------------------------------- -void wxMathGL::ShiftUp() -{ mreal d=(y2-y1)/3; y1-=d; y2-=d; Update(); } -//----------------------------------------------------------------------------- -void wxMathGL::ShiftRight() -{ mreal d=(x2-x1)/3; x1-=d; x2-=d; Update(); } -//----------------------------------------------------------------------------- -void wxMathGL::ShiftLeft() -{ mreal d=(x2-x1)/3; x1+=d; x2+=d; Update(); } -//----------------------------------------------------------------------------- -void wxMathGL::Restore() -{ - SetPhi(0); SetTet(0); SetPer(0); - x1=y1=0; x2=y2=1; zoom=rotate=false; - Update(); -} -//----------------------------------------------------------------------------- -void wxMathGL::ZoomIn() -{ - mreal d; - d = (y2-y1)/4; y1 += d; y2 -= d; - d = (x2-x1)/4; x1 += d; x2 -= d; - Update(); -} -//----------------------------------------------------------------------------- -void wxMathGL::ZoomOut() -{ - mreal d; - d = (y2-y1)/2; y1 -= d; y2 += d; - d = (x2-x1)/2; x1 -= d; x2 += d; - Update(); -} -//----------------------------------------------------------------------------- -void wxMathGL::Update(mglGraph *gr) -{ - if(gr==0) gr = graph; - if(gr==0 || draw_func==0) return; - gr->DefaultPlotParam(); - gr->Alpha(alpha); gr->Light(light); - gr->View(tet,phi); gr->Org = mglPoint(NAN,NAN,NAN); - gr->Perspective(per); - gr->Zoom(x1,y1,x2,y2); - gr->DrawFace = !rotate; - - char *buf=new char[2048]; buf[0]=0; gr->Message = buf; - draw_func(gr, draw_par); - if(buf[0] != 0) - { - wxMessageDialog dlg(this, wxString(buf,wxConvLocal), appName, wxOK); - dlg.ShowModal(); - } - gr->Message = 0; delete []buf; - MousePos.Empty(); - if(gr==graph) Repaint(); -} -//----------------------------------------------------------------------------- -void convertFromGraph(wxBitmap &pic, mglGraphAB *gr, unsigned char **buf) -{ - const unsigned char *bb = gr->GetBits(); - register long i,w=gr->GetWidth(), h=gr->GetHeight(); - if(*buf) delete [](*buf); - *buf = new unsigned char[4*w*h]; - for(i=0;iCalcXYZ(x, y); - MousePos.Printf(wxT("x=%g, y=%g, z=%g"),p.x,p.y,p.z); - Refresh(); -// emit mouseClick(p.x,p.y,p.z); - } - xe=x0=x; ye=y0=y; ev.Skip(); -} -//----------------------------------------------------------------------------- -void wxMathGL::OnMouseDown(wxMouseEvent &ev) -{ xe=x0=ev.GetX(); ye=y0=ev.GetY(); ev.Skip(); } -//----------------------------------------------------------------------------- -void wxMathGL::OnMouseLeftUp(wxMouseEvent &ev) -{ - if(zoom) - { - int w1=GetSize().GetWidth(),h1=GetSize().GetHeight(); - mreal _x1,_x2,_y1,_y2; - _x1 = x1+(x2-x1)*(x0-GetPosition().x)/mreal(w1); - _y1 = y2-(y2-y1)*(ye-GetPosition().y)/mreal(h1); - _x2 = x1+(x2-x1)*(xe-GetPosition().x)/mreal(w1); - _y2 = y2-(y2-y1)*(y0-GetPosition().y)/mreal(h1); - x1=_x1; x2=_x2; y1=_y1; y2=_y2; - if(x1>x2) { _x1=x1; x1=x2; x2=_x1; } - if(y1>y2) { _x1=y1; y1=y2; y2=_x1; } - x0 = xe; y0 = ye; - Update(); - } -} -//----------------------------------------------------------------------------- -void wxMathGL::OnMouseRightUp(wxMouseEvent &ev) -{ if(popup && !rotate) PopupMenu(popup, ev.GetPosition()); } -//----------------------------------------------------------------------------- -void wxMathGL::OnMouseMove(wxMouseEvent &ev) -{ - long w=GetSize().GetWidth(), h=GetSize().GetHeight(); - xe=ev.GetX(); ye=ev.GetY(); - if(rotate) - { - if(ev.ButtonDown(wxMOUSE_BTN_LEFT)) // rotate - { - mreal ff = 240/sqrt(mreal(w*h)); - phi += int((x0-xe)*ff); - tet += int((y0-ye)*ff); - if(phi>180) phi-=360; if(phi<-180) phi+=360; - if(tet>180) tet-=360; if(tet<-180) tet+=360; -// Update(); - } - if(ev.ButtonDown(wxMOUSE_BTN_RIGHT)) // zoom and perspective - { - mreal ff = 2.*(y0-ye)/w, gg = 0.5*(xe-x0)/h; - mreal cx = (x1+x2)/2, cy = (y1+y2)/2; - x1 = cx+(x1-cx)*exp(-ff); x2 = cx+(x2-cx)*exp(-ff); - y1 = cy+(y1-cy)*exp(-ff); y2 = cy+(y2-cy)*exp(-ff); - per = per + gg; - if(per<0) per = 0; if(per>=1) per = 0.9999; -// Update(); - } - if(ev.ButtonDown(wxMOUSE_BTN_MIDDLE)) // shift - { - mreal ff = 1./sqrt(mreal(w*h)); - mreal dx = (x0-xe)*ff*(x2-x1), dy = (y0-ye)*ff*(y2-y1); - x1 += dx; x2 += dx; y1 -= dy; y2 -= dy; - } - x0 = xe; y0 = ye; - Update(); - } -// if(zoom) Update(); - if(zoom) Refresh(0); -} -//----------------------------------------------------------------------------- -wxString mglSetExtension(wxString &fname, const char *ext) -{ - wxString oname; - if(fname.Right(4)!=wxChar('.')+wxString(ext,*wxConvCurrent)) - oname = fname+wxChar('.')+wxString(ext,*wxConvCurrent); - return oname; -} -//----------------------------------------------------------------------------- -// NOTE: this is replacement for wxString::char_str() which is for v.2.8 or later -const char *mglw_str(const wxString &str) -{ - static char *buf=0; - if(buf) delete []buf; - long i, n=str.Len(); - buf = new char[n+1]; buf[n]=0; - for(i=0;iWritePNG(mglw_str(mglSetExtension(fname,"png")), mglw_str(appName)); -} -//----------------------------------------------------------------------------- -void wxMathGL::ExportPNGs(wxString fname) -{ - if(fname.IsEmpty()) fname = ScriptName; - if(fname.IsEmpty()) wxMessageBox(appName, wxT("No filename."),wxOK|wxICON_ERROR ,this); - else graph->WritePNG(mglw_str(mglSetExtension(fname,"png")), mglw_str(appName), false); -} -//----------------------------------------------------------------------------- -void wxMathGL::ExportJPG(wxString fname) -{ - if(fname.IsEmpty()) fname = ScriptName; - if(fname.IsEmpty()) wxMessageBox(appName, wxT("No filename."),wxOK|wxICON_ERROR ,this); - else graph->WriteJPEG(mglw_str(mglSetExtension(fname,"jpg")), mglw_str(appName)); -} -//----------------------------------------------------------------------------- -void wxMathGL::ExportBPS(wxString fname) -{ - if(fname.IsEmpty()) fname = ScriptName; - if(fname.IsEmpty()) wxMessageBox(appName, wxT("No filename."),wxOK|wxICON_ERROR ,this); - else - { - setlocale(LC_ALL, "C"); - graph->WriteEPS(mglw_str(mglSetExtension(fname,"eps")), mglw_str(appName)); - setlocale(LC_ALL, ""); - } -} -//----------------------------------------------------------------------------- -void wxMathGL::ExportEPS(wxString fname) -{ - if(fname.IsEmpty()) fname = ScriptName; - if(fname.IsEmpty()) wxMessageBox(appName, wxT("No filename."),wxOK|wxICON_ERROR ,this); - else - { - mglGraphPS *ps = new mglGraphPS(graph->GetWidth(), graph->GetHeight()); - ps->SetFont(graph->GetFont()); - Update(ps); - setlocale(LC_ALL, "C"); - ps->WriteEPS(mglw_str(mglSetExtension(fname,"eps")), mglw_str(appName)); - setlocale(LC_ALL, ""); - delete ps; - } -} -//----------------------------------------------------------------------------- -void wxMathGL::ExportSVG(wxString fname) -{ - if(fname.IsEmpty()) fname = ScriptName; - if(fname.IsEmpty()) wxMessageBox(appName, wxT("No filename."),wxOK|wxICON_ERROR ,this); - else - { - mglGraphPS *ps = new mglGraphPS(graph->GetWidth(), graph->GetHeight()); - ps->SetFont(graph->GetFont()); - Update(ps); - setlocale(LC_ALL, "C"); - ps->WriteSVG(mglw_str(mglSetExtension(fname,"svg")), mglw_str(appName)); - setlocale(LC_ALL, ""); - delete ps; - } -} -//----------------------------------------------------------------------------- -void wxMathGL::ExportIDTF(wxString fname) -{ - if(fname.IsEmpty()) fname = ScriptName; - if(fname.IsEmpty()) wxMessageBox(appName, wxT("No filename."),wxOK|wxICON_ERROR ,this); - else - { - mglGraphIDTF *ps = new mglGraphIDTF; - ps->SetFont(graph->GetFont()); - Update(ps); - setlocale(LC_ALL, "C"); - ps->WriteIDTF(mglw_str(mglSetExtension(fname,"idtf")), mglw_str(appName)); - setlocale(LC_ALL, ""); - delete ps; - } -} -//----------------------------------------------------------------------------- -void wxMathGL::Copy() -{ - if (wxTheClipboard->Open()) - { - wxTheClipboard->SetData( new wxBitmapDataObject(pic) ); - wxTheClipboard->Close(); - } -} -//----------------------------------------------------------------------------- -void wxMathGL::SetMGLFont(wxString path) -{ - if(path.IsEmpty()) graph->GetFont()->Restore(); - else graph->GetFont()->Load(mglw_str(path)); -} -//----------------------------------------------------------------------------- -void wxMathGL::SetSize(int w, int h) -{ graph->SetSize(w,h); wxWindow::SetSize(w, h); Update(); }; -//----------------------------------------------------------------------------- -void wxMathGL::Adjust() { graph->Adjust(); } -//----------------------------------------------------------------------------- -void wxMathGL::NextSlide() { graph->NextFrame(); } -//----------------------------------------------------------------------------- -void wxMathGL::PrevSlide() { graph->PrevFrame(); } -//----------------------------------------------------------------------------- -void wxMathGL::Animation(bool st) -{ -/* mglGraphWX *gr = dynamic_cast(graph); - if(st) timer->Start(gr ? int(gr->Delay*1000) : AnimDelay); - else timer->Stop();*/ -} -//----------------------------------------------------------------------------- -void wxMathGL::About() -{ - wxString s = wxT("MathGL v. 1.") + wxString::Format(wxT("%g"),MGL_VERSION) + - wxT("\n(c) Alexey Balakin, 2007\nhttp://mathgl.sourceforge.net/"); - wxMessageBox(s, wxT("MathGL - about"), wxOK|wxICON_INFORMATION, this); -} -//----------------------------------------------------------------------------- -// -// class mglGraphWX -// -//----------------------------------------------------------------------------- -#ifdef ENABLE_MGLGRAPHWX -#include -#include "xpm/fileprint.xpm" -#include "xpm/copy.xpm" -#include "xpm/left_1.xpm" -#include "xpm/right_1.xpm" -#include "xpm/down_1.xpm" -#include "xpm/norm_1.xpm" -#include "xpm/zoom_1.xpm" -#include "xpm/up_1.xpm" -#include "xpm/alpha.xpm" -#include "xpm/light.xpm" -#include "xpm/zoom_in.xpm" -#include "xpm/zoom_out.xpm" -#include "xpm/rotate.xpm" -#include "xpm/ok.xpm" -#include "xpm/show_sl.xpm" -#include "xpm/next_sl.xpm" -#include "xpm/prev_sl.xpm" -//----------------------------------------------------------------------------- -mglGraphWX::mglGraphWX() : mglGraphZB() -{ - GG = 0; Wnd = 0; - NumFig = 0; CurFig = -1; -} -//----------------------------------------------------------------------------- -mglGraphWX::~mglGraphWX() -{ if(GG) free(GG); } -//----------------------------------------------------------------------------- -void mglGraphWX::SetSize(int w,int h) -{ - if(GG) free(GG); GG = 0; - mglGraphZB::SetSize(w,h); -} -//----------------------------------------------------------------------------- -void mglGraphWX::EndFrame() -{ - CurFig = CurFrameId-1; - if(!GG) - { - GG = (unsigned char *)malloc(3*Width*Height); - NumFig = 1; CurFig = 0; - } - else if(CurFig>NumFig-1) - { - GG = (unsigned char *)realloc(GG,3*(NumFig+1)*Width*Height); - NumFig++; - } - mglGraph::EndFrame(); - memcpy(GG + CurFig*Width*Height*3,G,3*Width*Height); - CurFig++; -} -//----------------------------------------------------------------------------- -void mglGraphWX::Clf(mglColor Back) -{ - if(AutoClf) mglGraphZB::Clf(Back); -} -//----------------------------------------------------------------------------- -const unsigned char *mglGraphWX::GetBits() -{ - Finish(); - unsigned char *g = G; - if(GG && NumFig>0 && CurFig=0) - g = GG + CurFig*Width*Height*3; - return g; -} -//----------------------------------------------------------------------------- -void mglGraphWX::NextFrame() -{ - if(NumFig>0) { CurFig = CurFig>NumFig-1 ? 0 : CurFig+1; WMGL->Repaint(); } -} -//----------------------------------------------------------------------------- -void mglGraphWX::PrevFrame() -{ - if(NumFig>0) { CurFig = CurFig<0 ? NumFig-1 : CurFig-1; WMGL->Repaint(); } -} -//----------------------------------------------------------------------------- -void mglGraphWX::ToggleAlpha() { WMGL->SetAlpha(!WMGL->GetAlpha()); } -//----------------------------------------------------------------------------- -void mglGraphWX::ToggleLight() { WMGL->SetLight(!WMGL->GetLight()); } -//----------------------------------------------------------------------------- -void mglGraphWX::ToggleNo() { WMGL->Restore(); } -//----------------------------------------------------------------------------- -void mglGraphWX::ToggleZoom() { WMGL->SetZoom(!WMGL->GetZoom()); } -//----------------------------------------------------------------------------- -void mglGraphWX::ToggleRotate() { WMGL->SetRotate(!WMGL->GetRotate());} -//----------------------------------------------------------------------------- -void mglGraphWX::Update() { CurFig=0; WMGL->Restore(); } -//----------------------------------------------------------------------------- -void mglGraphWX::ReLoad(bool o) { if(LoadFunc){LoadFunc(o, FuncPar);Update();} } -//----------------------------------------------------------------------------- -void mglGraphWX::Adjust() -{ - wxSize sz = scroll->GetSize(); - SetSize(sz.GetWidth(), sz.GetHeight()); - WMGL->SetSize(sz.GetWidth(), sz.GetHeight()); - Update(); -} -//----------------------------------------------------------------------------- -void mglGraphWX::Animation() -{ -/* if(anim) - { - bool s = anim->isChecked(); - anim->setChecked(!s); - WMGL->Animation(!s); - }*/ -} -//----------------------------------------------------------------------------- -void mglGraphWX::Window(int argc, char **argv, int (*draw)(mglGraph *gr, void *p), const char *title, void *par, void (*reload)(int next, void *p), bool maximize) -{ - NumFig=0; CurFig=0; - CurFrameId = 0; - int n = draw ? draw(this,par) : 0; - if(n=0) NumFig = n; - DrawFunc = draw; FuncPar = par; - LoadFunc = reload; popup = 0; - if(Wnd) - { - Wnd->SetLabel(wxString(title,wxConvLibc)); - if(maximize) - { Wnd->SetSize(Wnd->GetMaxSize()); } - else Wnd->Show(); - return; - } - - if(!wxTheApp) { new wxApp; wxTheApp->SetExitOnFrameDelete(true); } - - Wnd = new wxWindow; Wnd->SetSize(650,480); - Wnd->SetLabel(wxString(title,wxConvLibc)); - - scroll = new wxScrolledWindow(Wnd); - WMGL = new wxMathGL(scroll); MakeMenu(); - WMGL->SetPopup(popup); WMGL->SetGraph(this); - WMGL->SetDraw(draw, par); - - WMGL->Update(); - if(maximize) Wnd->SetSize(Wnd->GetMaxSize()); - Wnd->Show(); -} -//----------------------------------------------------------------------------- -void mglGraphWX::MakeMenu() -{ -/* wxMenuBar *m = new wxMenuBar; - wxMenu *o, *oo; - - o = new wxMenu; m->Append(o, wxT("&File")); - oo= new wxMenu; o->AppendSubMenu(oo,wxT("&Export as ...")); - o->Append(wxID_EXIT, wxT("&Close")); - Wnd->Connect(wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(wxWindow::Close)); -*/ -} -/*void mglGraphQT::makeMenu() -{ - QAction *a; - QMenu *o, *oo; - QToolBar *bb; - - popup = new QMenu(Wnd); - // file menu - { - o = Wnd->menuBar()->addMenu(TR("&File")); - oo = new QMenu(TR("&Export as ..."),Wnd); - oo->addAction(TR("PNG"), QMGL, SLOT(exportPNG()),Qt::ALT+Qt::Key_P); - oo->addAction(TR("solid PNG"), QMGL, SLOT(exportPNGs()),Qt::ALT+Qt::Key_F); - oo->addAction(TR("JPEG"), QMGL, SLOT(exportJPG()),Qt::ALT+Qt::Key_J); - oo->addAction(TR("bitmap EPS"), QMGL, SLOT(exportBPS())); - oo->addAction(TR("vector EPS"), QMGL, SLOT(exportEPS()),Qt::ALT+Qt::Key_E); - oo->addAction(TR("SVG"), QMGL, SLOT(exportSVG()),Qt::ALT+Qt::Key_S); - oo->addAction(TR("IDTF"), QMGL, SLOT(exportIDTF())); - o->addMenu(oo); - popup->addMenu(oo); - - o->addSeparator(); - a = new QAction(QPixmap(fileprint), TR("Print &graphics"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(print())); - a->setToolTip(TR("Open printer dialog and print graphics\t(CTRl+P)")); - a->setShortcut(Qt::CTRL+Qt::Key_P); o->addAction(a); - o->addSeparator(); - o->addAction(TR("&Close"), Wnd, SLOT(close()), Qt::CTRL+Qt::Key_W); - } - // graphics menu - { - bb = new QToolBar(TR("Graphics"),Wnd); - Wnd->addToolBar(Qt::TopToolBarArea, bb); - o = Wnd->menuBar()->addMenu(TR("&Graphics")); - a = new QAction(QPixmap(alpha_xpm), TR("&Alpha"), Wnd); - a->setShortcut(Qt::ALT+Qt::Key_T); a->setCheckable(true); - Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(setAlpha(bool))); - Wnd->connect(QMGL, SIGNAL(alphaChanged(bool)), a, SLOT(setOn(bool))); - a->setToolTip(TR("Switch on/off TRansparency for the graphics (Alt+T).")); - o->addAction(a); bb->addAction(a); - a = new QAction(QPixmap(light_xpm), TR("&Light"), Wnd); - a->setShortcut(Qt::ALT+Qt::Key_L); a->setCheckable(true); - Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(setLight(bool))); - Wnd->connect(QMGL, SIGNAL(lightChanged(bool)), a, SLOT(setOn(bool))); - a->setToolTip(TR("Switch on/off lightning for the graphics (Alt+L).")); - o->addAction(a); bb->addAction(a); - a = new QAction(QPixmap(rotate_xpm), TR("&Rotate by mouse"), Wnd); - a->setCheckable(true); - Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(setRotate(bool))); - Wnd->connect(QMGL, SIGNAL(rotateChanged(bool)), a, SLOT(setOn(bool))); - a->setToolTip(TR("Switch on/off mouse handling of the graphics\n(rotation, shifting, zooming and perspective).")); - bb->addAction(a); - a = new QAction(QPixmap(zoom_in_xpm), TR("&Zoom by mouse"), Wnd); - a->setCheckable(true); - Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(setZoom(bool))); - Wnd->connect(QMGL, SIGNAL(zoomChanged(bool)), a, SLOT(setOn(bool))); - a->setToolTip(TR("Switch on/off mouse zoom of selected region.")); - bb->addAction(a); - o->addSeparator(); - a = new QAction(QPixmap(zoom_out_xpm), TR("Res&tore"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(restore())); - a->setToolTip(TR("Restore default graphics rotation, zoom and perspective (Alt+Space).")); - a->setShortcut(Qt::ALT+Qt::Key_Space); - o->addAction(a); bb->addAction(a); popup->addAction(a); - bb->addSeparator(); - a = new QAction(QPixmap(ok_xpm), TR("Re&draw"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(update())); - a->setToolTip(TR("Execute script and redraw graphics (F5).")); - a->setShortcut(Qt::Key_F5); - o->addAction(a); bb->addAction(a); popup->addAction(a); - a = new QAction(TR("&Adjust size"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(adjust())); - a->setToolTip(TR("Change canvas size to fill whole region (F6).")); - a->setShortcut(Qt::Key_F6); o->addAction(a); - a = new QAction(QPixmap(copy_xpm), TR("&Copy plot"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(copy())); - a->setToolTip(TR("Copy graphics to clipboard (CTRl+C).")); - a->setShortcut(Qt::CTRL+Qt::Key_C); - o->addAction(a); bb->addAction(a); popup->addAction(a); - bb->addSeparator(); - tet = new QSpinBox(Wnd); tet->setWrapping(true); - bb->addWidget(tet); tet->setRange(-180, 180); tet->setSingleStep(10); - Wnd->connect(tet, SIGNAL(valueChanged(int)), QMGL, SLOT(setTet(int))); - Wnd->connect(QMGL, SIGNAL(tetChanged(int)), tet, SLOT(setValue(int))); - tet->setToolTip(TR("Set value of \\theta angle.")); - bb->addSeparator(); - phi = new QSpinBox(Wnd); phi->setWrapping(true); - bb->addWidget(phi); phi->setRange(-180, 180); phi->setSingleStep(10); - Wnd->connect(phi, SIGNAL(valueChanged(int)), QMGL, SLOT(setPhi(int))); - Wnd->connect(QMGL, SIGNAL(phiChanged(int)), phi, SLOT(setValue(int))); - phi->setToolTip(TR("Set value of \\phi angle.")); -// bb->addSeparator(); - } - // zooming menu - { - oo = o->addMenu(TR("Zoom/move")); - bb = new QToolBar(TR("Zoom graphics"),Wnd); - Wnd->addToolBar(Qt::LeftToolBarArea, bb); - a = new QAction(QPixmap(left_1_xpm), TR("Move &left"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(shiftLeft())); - a->setToolTip(TR("Move graphics left by 1/3 of its width.")); - bb->addAction(a); oo->addAction(a); - a = new QAction(QPixmap(up_1_xpm), TR("Move &up"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(shiftUp())); - a->setToolTip(TR("Move graphics up by 1/3 of its height.")); - bb->addAction(a); oo->addAction(a); - a = new QAction(QPixmap(zoom_1_xpm), TR("Zoom &in"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(zoomIn())); - a->setToolTip(TR("Zoom in graphics.")); - bb->addAction(a); oo->addAction(a); - a = new QAction(QPixmap(norm_1_xpm), TR("Zoom &out"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(zoomOut())); - a->setToolTip(TR("Zoom out graphics.")); - bb->addAction(a); oo->addAction(a); - a = new QAction(QPixmap(down_1_xpm), TR("Move &down"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(shiftDown())); - a->setToolTip(TR("Move graphics up down 1/3 of its height.")); - bb->addAction(a); oo->addAction(a); - a = new QAction(QPixmap(right_1_xpm), TR("Move &right"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(shiftRight())); - a->setToolTip(TR("Move graphics right by 1/3 of its width.")); - bb->addAction(a); oo->addAction(a); - } - // animation menu - { - o = Wnd->menuBar()->addMenu(TR("&Animation")); - bb = new QToolBar(TR("Animation"),Wnd); - Wnd->addToolBar(Qt::LeftToolBarArea, bb); - a = new QAction(QPixmap(next_sl_xpm), TR("&Next slide"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(nextSlide())); - a->setToolTip(TR("Show next slide (Alt+Right).")); - a->setShortcut(Qt::ALT+Qt::Key_Right); o->addAction(a); bb->addAction(a); - a = new QAction(QPixmap(show_sl_xpm), TR("&Slideshow"), Wnd); - a->setCheckable(true); anim = a; - Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(animation(bool))); - a->setToolTip(TR("Run slideshow (CTRl+F5).")); - a->setShortcut(Qt::CTRL+Qt::Key_F5); o->addAction(a); bb->addAction(a); - a = new QAction(QPixmap(prev_sl_xpm), TR("&Prev slide"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(prevSlide())); - a->setToolTip(TR("Show previous slide (Alt+Left).")); - a->setShortcut(Qt::ALT+Qt::Key_Left); o->addAction(a); bb->addAction(a); - } - - Wnd->menuBar()->addSeparator(); - o = Wnd->menuBar()->addMenu(TR("&Help")); - o->addAction(TR("About"), QMGL, SLOT(about())); - o->addAction(TR("About &Qt"), QMGL, SLOT(aboutQt())); -}*/ -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -HMGL mgl_create_graph_wx_dr(HMDR dr, const char *title) -{ - mglGraphWX *g = new mglGraphWX; - g->Window(0,0,title,dr); - return g; -} -//----------------------------------------------------------------------------- -HMGL mgl_create_graph_wx(int (*draw)(HMGL gr, void *p), const char *title, void *par) -{ - mglGraphWX *g = new mglGraphWX; - g->Window(0,0,draw,title,par); - return g; -} -//----------------------------------------------------------------------------- -//uintptr_t mgl_create_graph_qt_(int (*draw)(uintptr_t *gr), const char *title, int l) -uintptr_t mgl_create_graph_wx_(const char *title, int l) -{ - mglGraphWX *g = new mglGraphWX; - char *s = new char[l+1]; memcpy(s,title,l); s[l]=0; -// g->Window(0,0,mgl_fortran_func,s,(void*)draw); - g->Window(0,0,0,s,0,0); - delete []s; - return uintptr_t(g); -} -//----------------------------------------------------------------------------- -int mglWxRun() { return wxTheApp ? wxTheApp->MainLoop():0; } -//----------------------------------------------------------------------------- -void mgl_wx_run_() { mglWxRun(); } -//----------------------------------------------------------------------------- -#endif \ No newline at end of file diff --git a/widgets/mgl_qt.cpp b/widgets/qt.cpp similarity index 76% rename from widgets/mgl_qt.cpp rename to widgets/qt.cpp index 7ddd228..1425f56 100644 --- a/widgets/mgl_qt.cpp +++ b/widgets/qt.cpp @@ -1,7 +1,7 @@ -/*************************************************************************** - * mgl_qt.cpp is part of Math Graphic Library * - * Copyright (C) 2007 Alexey Balakin * - * * +/*************************************************************************** + * mgl_qt.cpp is part of Math Graphic Library * + * Copyright (C) 2007 Alexey Balakin * + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 3 of the * @@ -17,761 +17,655 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "mgl/mgl_idtf.h" -#include "mgl/mgl_eps.h" -#include "mgl/mgl_qt.h" -#include "mgl/mgl_c.h" -#include "mgl/mgl_f.h" -//----------------------------------------------------------------------------- -#include "xpm/fileprint.xpm" -#include "xpm/copy.xpm" -#include "xpm/left_1.xpm" -#include "xpm/right_1.xpm" -#include "xpm/down_1.xpm" -#include "xpm/norm_1.xpm" -#include "xpm/zoom_1.xpm" -#include "xpm/up_1.xpm" -#include "xpm/alpha.xpm" -#include "xpm/light.xpm" -#include "xpm/zoom_in.xpm" -#include "xpm/zoom_out.xpm" -#include "xpm/rotate.xpm" -#include "xpm/ok.xpm" -#include "xpm/show_sl.xpm" -#include "xpm/next_sl.xpm" -#include "xpm/prev_sl.xpm" -//----------------------------------------------------------------------------- -const QString scriptName("default"); -//----------------------------------------------------------------------------- -// -// class QMathGL -// -//----------------------------------------------------------------------------- -QMathGL::QMathGL(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f) -{ - autoResize = false; draw_par = 0; draw_func = 0; - graph = new mglGraphZB; - popup = 0; grBuf = 0; - phi = tet = per = 0; - x1 = y1 = 0; x2 = y2 = 1; - alpha = light = zoom = rotate = false; - resize(600, 400); -// resize(graph->GetWidth(), graph->GetHeight()); -// convertFromGraph(pic, graph, &grBuf); - - timer = new QTimer(this); animDelay = 1000; - connect(timer, SIGNAL(timeout()), this, SLOT(nextSlide())); -} -//----------------------------------------------------------------------------- -QMathGL::~QMathGL() { delete graph; if(grBuf) delete []grBuf; } -//----------------------------------------------------------------------------- -void QMathGL::setGraph(mglGraphAB *gr) -{ - if(!gr) return; - delete graph; graph=gr; -} -//----------------------------------------------------------------------------- -void QMathGL::setDraw(int (*func)(mglGraph *gr, void *par), void *par) -{ draw_func = func; draw_par = par; } -//----------------------------------------------------------------------------- -int mgl_draw_class(mglGraph *gr, void *p); -void QMathGL::setDraw(mglDraw *dr) -{ draw_func = mgl_draw_class; draw_par = dr; } -//----------------------------------------------------------------------------- -void QMathGL::paintEvent(QPaintEvent *) -{ - QPainter paint; - paint.begin(this); - paint.drawPixmap(0,0,pic); - if(zoom) paint.drawRect(x0,y0,xe-x0,ye-y0); - if(graph->ShowMousePos && !mousePos.isEmpty()) - paint.drawText(0,12,mousePos); - paint.end(); -} -//----------------------------------------------------------------------------- -void QMathGL::resizeEvent(QResizeEvent *ev) -{ - if(autoResize && ev->size().width()>0 && ev->size().height()>0) - { graph->SetSize(ev->size().width(), ev->size().height()); update(); } - else resize(graph->GetWidth(), graph->GetHeight()); -} -//----------------------------------------------------------------------------- -void QMathGL::setPer(int p) -{ - if(per!=p && p>=0 && p<100) - { per = 100*p; emit perChanged(p); update(); } -} -//----------------------------------------------------------------------------- -void QMathGL::setPhi(int p) -{ if(phi!=p) { phi = p; emit phiChanged(p); update(); } } -//----------------------------------------------------------------------------- -void QMathGL::setTet(int t) -{ if(tet!=t) { tet = t; emit tetChanged(t); update(); } } -//----------------------------------------------------------------------------- -void QMathGL::setAlpha(bool a) -{ if(alpha!=a) { alpha = a; emit alphaChanged(a); update(); } } -//----------------------------------------------------------------------------- -void QMathGL::setLight(bool l) -{ if(light!=l) { light = l; emit lightChanged(l); update(); } } -//----------------------------------------------------------------------------- -void QMathGL::setZoom(bool z) -{ - if(zoom!=z) - { - zoom=z; rotate=false; update(); - emit zoomChanged(z); emit rotateChanged(false); - } -} -//----------------------------------------------------------------------------- -void QMathGL::setRotate(bool r) -{ - if(rotate!=r) - { - zoom=false; rotate=r; update(); - emit zoomChanged(false); emit rotateChanged(r); - } -} -//----------------------------------------------------------------------------- -void QMathGL::shiftDown() -{ mreal d=(y2-y1)/3; y1+=d; y2+=d; update(); } -//----------------------------------------------------------------------------- -void QMathGL::shiftUp() -{ mreal d=(y2-y1)/3; y1-=d; y2-=d; update(); } -//----------------------------------------------------------------------------- -void QMathGL::shiftRight() -{ mreal d=(x2-x1)/3; x1-=d; x2-=d; update(); } -//----------------------------------------------------------------------------- -void QMathGL::shiftLeft() -{ mreal d=(x2-x1)/3; x1+=d; x2+=d; update(); } -//----------------------------------------------------------------------------- -void QMathGL::restore() -{ - setPhi(0); setTet(0); setPer(0); - x1=y1=0; x2=y2=1; zoom=rotate=false; - emit zoomChanged(false); emit rotateChanged(false); - update(); -} -//----------------------------------------------------------------------------- -void QMathGL::zoomIn() -{ - mreal d; - d = (y2-y1)/4; y1 += d; y2 -= d; - d = (x2-x1)/4; x1 += d; x2 -= d; - update(); -} -//----------------------------------------------------------------------------- -void QMathGL::zoomOut() -{ - mreal d; - d = (y2-y1)/2; y1 -= d; y2 += d; - d = (x2-x1)/2; x1 -= d; x2 += d; - update(); -} -//----------------------------------------------------------------------------- -void QMathGL::update(mglGraph *gr) -{ - if(gr==0) gr = graph; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "mgl/qt.h" +//----------------------------------------------------------------------------- +#include "xpm/fileprint.xpm" +#include "xpm/copy.xpm" +#include "xpm/left_1.xpm" +#include "xpm/right_1.xpm" +#include "xpm/down_1.xpm" +#include "xpm/norm_1.xpm" +#include "xpm/zoom_1.xpm" +#include "xpm/up_1.xpm" +#include "xpm/alpha.xpm" +#include "xpm/light.xpm" +#include "xpm/zoom_in.xpm" +#include "xpm/zoom_out.xpm" +#include "xpm/rotate.xpm" +#include "xpm/ok.xpm" +#include "xpm/show_sl.xpm" +#include "xpm/next_sl.xpm" +#include "xpm/prev_sl.xpm" +//----------------------------------------------------------------------------- +const QString scriptName("default"); +//----------------------------------------------------------------------------- +// +// class QMathGL +// +//----------------------------------------------------------------------------- +QMathGL::QMathGL(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f) +{ + autoResize = false; draw_par = 0; draw_func = 0; + graph = new mglCanvas; + popup = 0; grBuf = 0; + phi = tet = per = 0; + x1 = y1 = 0; x2 = y2 = 1; + alpha = light = zoom = rotate = false; + resize(600, 400); +// resize(graph->GetWidth(), graph->GetHeight()); +// convertFromGraph(pic, graph, &grBuf); + connect(timer, SIGNAL(timeout()), this, SLOT(nextSlide())); +} +//----------------------------------------------------------------------------- +QMathGL::~QMathGL() { delete graph; if(grBuf) delete []grBuf; } +//----------------------------------------------------------------------------- +void QMathGL::setGraph(mglCanvas *gr) +{ + if(!gr) return; + delete graph; graph=gr; +} +//----------------------------------------------------------------------------- +void QMathGL::paintEvent(QPaintEvent *) +{ + QPainter paint; + paint.begin(this); + paint.drawPixmap(0,0,pic); + if(zoom) paint.drawRect(x0,y0,xe-x0,ye-y0); + if(graph->get(MGL_SHOW_POS) && !mousePos.isEmpty()) + paint.drawText(0,12,mousePos); + paint.end(); +} +//----------------------------------------------------------------------------- +void QMathGL::resizeEvent(QResizeEvent *ev) +{ + if(autoResize && ev->size().width()>0 && ev->size().height()>0) + { graph->SetSize(ev->size().width(), ev->size().height()); update(); } + else resize(graph->GetWidth(), graph->GetHeight()); +} +//----------------------------------------------------------------------------- +void QMathGL::setPer(int p) +{ + if(per!=p && p>=0 && p<100) + { per = 100*p; emit perChanged(p); update(); } +} +//----------------------------------------------------------------------------- +void QMathGL::setPhi(int p) +{ if(phi!=p) { phi = p; emit phiChanged(p); update(); } } +//----------------------------------------------------------------------------- +void QMathGL::setTet(int t) +{ if(tet!=t) { tet = t; emit tetChanged(t); update(); } } +//----------------------------------------------------------------------------- +void QMathGL::setAlpha(bool a) +{ if(alpha!=a) { alpha = a; emit alphaChanged(a); update(); } } +//----------------------------------------------------------------------------- +void QMathGL::setLight(bool l) +{ if(light!=l) { light = l; emit lightChanged(l); update(); } } +//----------------------------------------------------------------------------- +void QMathGL::setRotate(bool r) +{ + if(rotate!=r) + { zoom=false; rotate=r; update(); emit rotateChanged(r); } +} +//----------------------------------------------------------------------------- +/*void QMathGL::setZoom(bool z) +{ + if(zoom!=z) + { zoom=z; rotate=false; update(); + emit zoomChanged(z); emit rotateChanged(false); } +} +//----------------------------------------------------------------------------- +void QMathGL::shiftDown() +{ mreal d=(y2-y1)/3; y1+=d; y2+=d; update(); } +//----------------------------------------------------------------------------- +void QMathGL::shiftUp() +{ mreal d=(y2-y1)/3; y1-=d; y2-=d; update(); } +//----------------------------------------------------------------------------- +void QMathGL::shiftRight() +{ mreal d=(x2-x1)/3; x1-=d; x2-=d; update(); } +//----------------------------------------------------------------------------- +void QMathGL::shiftLeft() +{ mreal d=(x2-x1)/3; x1+=d; x2+=d; update(); } +//----------------------------------------------------------------------------- +void QMathGL::zoomIn() +{ + mreal d; + d = (y2-y1)/4; y1 += d; y2 -= d; + d = (x2-x1)/4; x1 += d; x2 -= d; + update(); +} +//----------------------------------------------------------------------------- +void QMathGL::zoomOut() +{ + mreal d; + d = (y2-y1)/2; y1 -= d; y2 += d; + d = (x2-x1)/2; x1 -= d; x2 += d; + update(); +}*/ +//----------------------------------------------------------------------------- +void QMathGL::restore() +{ + setPhi(0); setTet(0); setPer(0); + x1=y1=0; x2=y2=1; zoom=rotate=false; + emit rotateChanged(false); + update(); +} +//----------------------------------------------------------------------------- +void QMathGL::update(mglCanvas *gr) +{ + if(gr==0) gr = graph; if(gr==0) return; - if(draw_func==0) { refresh(); return; } - if(gr!=graph || graph->ClfOnUpdate) gr->DefaultPlotParam(); - char *buf=new char[2048]; buf[0]=0; gr->Message = buf; + if(draw_func==0) { refresh(); return; } + if(gr!=graph || graph->get(MGL_CLF_ON_UPD)) gr->DefaultPlotParam(); + char *buf=new char[2048]; buf[0]=0; gr->Message = buf; - gr->Alpha(alpha); gr->Light(light); - gr->View(tet,phi); gr->Org = mglPoint(NAN,NAN,NAN); - gr->Perspective(per); - gr->Zoom(x1,y1,x2,y2); - gr->DrawFace = !rotate; + gr->Alpha(alpha); gr->Light(light); + gr->View(tet,phi); gr->Perspective(per); draw_func(gr, draw_par); - if(buf[0] != 0) QMessageBox::warning(this, appName, buf); - gr->Message = 0; delete []buf; - mousePos=""; - if(gr==graph) refresh(); -} -//----------------------------------------------------------------------------- -void QMathGL::refresh() -{ - convertFromGraph(pic, graph, &grBuf); - if(pic.size()!=size()) setSize(pic.width(), pic.height()); - repaint(); -} -//----------------------------------------------------------------------------- -void QMathGL::mousePressEvent(QMouseEvent *ev) -{ - if(!zoom && !rotate && ev->button()&Qt::LeftButton) - { - mglPoint p = graph->CalcXYZ(ev->x(), ev->y()); - mousePos.sprintf("x=%g, y=%g, z=%g",p.x,p.y,p.z); - repaint(); - emit mouseClick(p.x,p.y,p.z); - } - xe=x0=ev->x(); ye=y0=ev->y(); ev->accept(); -} -//----------------------------------------------------------------------------- -void QMathGL::mouseReleaseEvent(QMouseEvent *ev) -{ - if(ev->button()&Qt::LeftButton) - { - if(zoom) - { - int w1=width(),h1=height(); - mreal _x1,_x2,_y1,_y2; - _x1 = x1+(x2-x1)*(x0-x())/mreal(w1); _y1 = y2-(y2-y1)*(ye-y())/mreal(h1); - _x2 = x1+(x2-x1)*(xe-x())/mreal(w1); _y2 = y2-(y2-y1)*(y0-y())/mreal(h1); - x1=_x1; x2=_x2; y1=_y1; y2=_y2; - if(x1>x2) { _x1=x1; x1=x2; x2=_x1; } - if(y1>y2) { _x1=y1; y1=y2; y2=_x1; } - x0 = xe; y0 = ye; - update(); - } - } - if(ev->button()&Qt::RightButton && popup && !rotate) // popup menu - popup->popup(QCursor::pos()); - ev->accept(); -} -//----------------------------------------------------------------------------- -void QMathGL::mouseMoveEvent(QMouseEvent *ev) -{ - xe=ev->x(); ye=ev->y(); - if(rotate) - { - if(ev->buttons()&Qt::LeftButton) // rotate - { - mreal ff = 240/sqrt(mreal(width()*height())); - phi += int((x0-xe)*ff); - tet += int((y0-ye)*ff); - if(phi>180) phi-=360; if(phi<-180) phi+=360; - if(tet>180) tet-=360; if(tet<-180) tet+=360; - emit tetChanged(int(tet)); emit phiChanged(int(phi)); - update(); - } - if(ev->buttons()&Qt::RightButton) // zoom and perspective - { - mreal ff = 2.*(y0-ye)/width(), gg = 0.5*(xe-x0)/height(); - mreal cx = (x1+x2)/2, cy = (y1+y2)/2; - x1 = cx+(x1-cx)*exp(-ff); x2 = cx+(x2-cx)*exp(-ff); - y1 = cy+(y1-cy)*exp(-ff); y2 = cy+(y2-cy)*exp(-ff); - per = per + gg; - if(per<0) per = 0; if(per>=1) per = 0.9999; - if(gg) emit perChanged(int(per)); - update(); - } - if(ev->buttons()&Qt::MidButton) // shift - { - mreal ff = 1./sqrt(mreal(width()*height())); - mreal dx = (x0-xe)*ff*(x2-x1), dy = (y0-ye)*ff*(y2-y1); - x1 += dx; x2 += dx; y1 -= dy; y2 -= dy; - } - x0 = xe; y0 = ye; - update(); - } - if(zoom) update(); - ev->accept(); -} -//----------------------------------------------------------------------------- -QString setExtension(const QString &fname, const char *ext) -{ - QString oname=fname; - if(fname.right(4)!="."+QString(ext)) oname = fname+"."+QString(ext); - return oname; -} -//----------------------------------------------------------------------------- -void QMathGL::exportPNG(QString fname) -{ - if(fname.isEmpty()) fname = scriptName; - if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0); - else graph->WritePNG(setExtension(fname,"png").toAscii(), appName.toAscii()); -} -//----------------------------------------------------------------------------- -void QMathGL::exportPNGs(QString fname) -{ - if(fname.isEmpty()) fname = scriptName; - if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0); - else graph->WritePNG(setExtension(fname,"png").toAscii(), appName.toAscii(), false); -} -//----------------------------------------------------------------------------- -void QMathGL::exportJPG(QString fname) -{ - if(fname.isEmpty()) fname = scriptName; - if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0); - else graph->WriteJPEG(setExtension(fname,"jpg").toAscii(), appName.toAscii()); -} -//----------------------------------------------------------------------------- -void QMathGL::exportBPS(QString fname) -{ - if(fname.isEmpty()) fname = scriptName; - if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0); - else - { - setlocale(LC_ALL, "C"); - graph->WriteEPS(setExtension(fname,"eps").toAscii(), appName.toAscii()); - setlocale(LC_ALL, ""); - } -} -//----------------------------------------------------------------------------- -void QMathGL::exportEPS(QString fname) -{ - if(fname.isEmpty()) fname = scriptName; - if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0); - else - { - mglGraphPS *ps = new mglGraphPS(graph->GetWidth(), graph->GetHeight()); - ps->SetFont(graph->GetFont()); - update(ps); - setlocale(LC_ALL, "C"); - ps->WriteEPS(setExtension(fname,"eps").toAscii(), appName.toAscii()); - setlocale(LC_ALL, ""); - delete ps; - } -} -//----------------------------------------------------------------------------- -void QMathGL::exportSVG(QString fname) -{ - if(fname.isEmpty()) fname = scriptName; - if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0); - else - { - mglGraphPS *ps = new mglGraphPS(graph->GetWidth(), graph->GetHeight()); - ps->SetFont(graph->GetFont()); - update(ps); - setlocale(LC_ALL, "C"); - ps->WriteSVG(setExtension(fname,"svg").toAscii(), appName.toAscii()); - setlocale(LC_ALL, ""); - delete ps; - } -} -//----------------------------------------------------------------------------- -void QMathGL::exportIDTF(QString fname) -{ - if(fname.isEmpty()) fname = scriptName; - if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0); - else - { - mglGraphIDTF *ps = new mglGraphIDTF; - ps->SetFont(graph->GetFont()); - update(ps); - setlocale(LC_ALL, "C"); - ps->WriteIDTF(setExtension(fname,"idtf").toAscii(), appName.toAscii()); - setlocale(LC_ALL, ""); - delete ps; - } -} -//----------------------------------------------------------------------------- -void convertFromGraph(QPixmap &pic, mglGraphAB *gr, uchar **buf) -{ - const uchar *bb = gr->GetBits(); - register long i,w=gr->GetWidth(), h=gr->GetHeight(); - if(*buf) delete [](*buf); - *buf = new uchar[4*w*h]; - for(i=0;isetPixmap(pic, QClipboard::Clipboard); -} -//----------------------------------------------------------------------------- -void QMathGL::setMGLFont(QString path) -{ - if(path.isEmpty()) graph->GetFont()->Restore(); - else graph->GetFont()->Load(path.toAscii()); -} -//----------------------------------------------------------------------------- -void QMathGL::setSize(int w, int h) -{ graph->SetSize(w,h); resize(w, h); update(); }; -//----------------------------------------------------------------------------- -void QMathGL::adjust() { graph->Adjust(); } -//----------------------------------------------------------------------------- -void QMathGL::nextSlide() { graph->NextFrame(); } -//----------------------------------------------------------------------------- -void QMathGL::prevSlide() { graph->PrevFrame(); } -//----------------------------------------------------------------------------- -void QMathGL::animation(bool st) -{ - mglGraphQT *gr = dynamic_cast(graph); - if(st) timer->start(gr ? int(gr->Delay*1000) : animDelay); - else timer->stop(); -} -//----------------------------------------------------------------------------- -void QMathGL::about() -{ - QString s = tr("MathGL v. 1.") + QString::number(MGL_VERSION) + tr("\n(c) Alexey Balakin, 2007\nhttp://mathgl.sourceforge.net/"); - QMessageBox::about(this, tr("MathGL - about"), s); -} -//----------------------------------------------------------------------------- -void QMathGL::aboutQt() { QMessageBox::aboutQt(this, tr("About Qt")); } -//----------------------------------------------------------------------------- -void QMathGL::print() -{ - QPrinter *printer = new QPrinter; + if(buf[0] != 0) QMessageBox::warning(this, appName, buf); + gr->Message = 0; delete []buf; mousePos=""; + if(gr==graph) refresh(); +} +//----------------------------------------------------------------------------- +void QMathGL::refresh() +{ + convertFromGraph(pic, graph, &grBuf); + if(pic.size()!=size()) setSize(pic.width(), pic.height()); + repaint(); +} +//----------------------------------------------------------------------------- +void QMathGL::mousePressEvent(QMouseEvent *ev) +{ + if(!zoom && !rotate && ev->button()&Qt::LeftButton) + { + mglPoint p = graph->CalcXYZ(ev->x(), ev->y()); + mousePos.sprintf("x=%g, y=%g, z=%g",p.x,p.y,p.z); + repaint(); + emit mouseClick(p.x,p.y,p.z); + } + xe=x0=ev->x(); ye=y0=ev->y(); ev->accept(); +} +//----------------------------------------------------------------------------- +void QMathGL::mouseReleaseEvent(QMouseEvent *ev) +{ + if(ev->button()&Qt::LeftButton) + { + if(zoom) + { + int w1=width(),h1=height(); + mreal _x1,_x2,_y1,_y2; + _x1 = x1+(x2-x1)*(x0-x())/mreal(w1); _y1 = y2-(y2-y1)*(ye-y())/mreal(h1); + _x2 = x1+(x2-x1)*(xe-x())/mreal(w1); _y2 = y2-(y2-y1)*(y0-y())/mreal(h1); + x1=_x1; x2=_x2; y1=_y1; y2=_y2; + if(x1>x2) { _x1=x1; x1=x2; x2=_x1; } + if(y1>y2) { _x1=y1; y1=y2; y2=_x1; } + x0 = xe; y0 = ye; + update(); + } + } + if(ev->button()&Qt::RightButton && popup && !rotate) // popup menu + popup->popup(QCursor::pos()); + ev->accept(); +} +//----------------------------------------------------------------------------- +void QMathGL::mouseMoveEvent(QMouseEvent *ev) +{ + xe=ev->x(); ye=ev->y(); + if(rotate) + { + if(ev->buttons()&Qt::LeftButton) // rotate + { + mreal ff = 240/sqrt(mreal(width()*height())); + phi += int((x0-xe)*ff); + tet += int((y0-ye)*ff); + if(phi>180) phi-=360; if(phi<-180) phi+=360; + if(tet>180) tet-=360; if(tet<-180) tet+=360; + emit tetChanged(int(tet)); emit phiChanged(int(phi)); + update(); + } + if(ev->buttons()&Qt::RightButton) // zoom and perspective + { + mreal ff = 2.*(y0-ye)/width(), gg = 0.5*(xe-x0)/height(); + mreal cx = (x1+x2)/2, cy = (y1+y2)/2; + x1 = cx+(x1-cx)*exp(-ff); x2 = cx+(x2-cx)*exp(-ff); + y1 = cy+(y1-cy)*exp(-ff); y2 = cy+(y2-cy)*exp(-ff); + per = per + gg; + if(per<0) per = 0; if(per>=1) per = 0.9999; + if(gg) emit perChanged(int(per)); + update(); + } + if(ev->buttons()&Qt::MidButton) // shift + { + mreal ff = 1./sqrt(mreal(width()*height())); + mreal dx = (x0-xe)*ff*(x2-x1), dy = (y0-ye)*ff*(y2-y1); + x1 += dx; x2 += dx; y1 -= dy; y2 -= dy; + } + x0 = xe; y0 = ye; + update(); + } + if(zoom) update(); + ev->accept(); +} +//----------------------------------------------------------------------------- +QString setExtension(QString &fname, const char *ext) +{ + QString oname; + if(fname.right(4)!="."+QString(ext)) oname = fname+"."+QString(ext); + return oname; +} +//----------------------------------------------------------------------------- +void QMathGL::exportPNG(QString fname) +{ + if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0); + else graph->WritePNG(setExtension(fname,"png").toAscii(), appName.toAscii()); +} +//----------------------------------------------------------------------------- +void QMathGL::exportPNGs(QString fname) +{ + if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0); + else graph->WritePNGs(setExtension(fname,"png").toAscii(), appName.toAscii()); +} +//----------------------------------------------------------------------------- +void QMathGL::exportJPG(QString fname) +{ + if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0); + else graph->WriteJPEG(setExtension(fname,"jpg").toAscii(), appName.toAscii()); +} +//----------------------------------------------------------------------------- +void QMathGL::exportBPS(QString fname) +{ + if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0); + else + { + setlocale(LC_ALL, "C"); + graph->WriteEPS(setExtension(fname,"eps").toAscii(), appName.toAscii()); + setlocale(LC_ALL, ""); + } +} +//----------------------------------------------------------------------------- +void QMathGL::exportEPS(QString fname) +{ + if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0); + else + { + setlocale(LC_ALL, "C"); + graph->WriteEPS(setExtension(fname,"eps").toAscii(), appName.toAscii()); + setlocale(LC_ALL, ""); + } +} +//----------------------------------------------------------------------------- +void QMathGL::exportSVG(QString fname) +{ + if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0); + else + { + setlocale(LC_ALL, "C"); + graph->WriteSVG(setExtension(fname,"svg").toAscii(), appName.toAscii()); + setlocale(LC_ALL, ""); + } +} +//----------------------------------------------------------------------------- +void QMathGL::exportIDTF(QString fname) +{ + if(fname.isEmpty()) fname = scriptName; + if(fname.isEmpty()) QMessageBox::critical(this, appName, tr("No filename."),QMessageBox::Ok,0,0); + else + { // TODO: Add IDTF/U3D export +/* mglGraphIDTF *ps = new mglGraphIDTF; + ps->SetFont(graph->GetFont()); + update(ps); + setlocale(LC_ALL, "C"); + ps->WriteIDTF(setExtension(fname,"idtf").toAscii(), appName.toAscii()); + setlocale(LC_ALL, ""); + delete ps;*/ + } +} +//----------------------------------------------------------------------------- +void convertFromGraph(QPixmap &pic, mglCanvas *gr, uchar **buf) +{ + const uchar *bb = gr->GetBits(); + register long i,w=gr->GetWidth(), h=gr->GetHeight(); + if(*buf) delete [](*buf); + *buf = new uchar[4*w*h]; + for(i=0;isetPixmap(pic, QClipboard::Clipboard); +} +//----------------------------------------------------------------------------- +void QMathGL::setMGLFont(QString path) +{ + if(path.isEmpty()) graph->GetFont()->Restore(); + else graph->GetFont()->Load(path.toAscii()); +} +//----------------------------------------------------------------------------- +void QMathGL::setSize(int w, int h) +{ graph->SetSize(w,h); resize(w, h); update(); }; +//----------------------------------------------------------------------------- +void QMathGL::about() +{ + QString s = tr("MathGL v. 2.") + QString::number(MGL_VER2) + tr("\n(c) Alexey Balakin, 2007\nhttp://mathgl.sourceforge.net/"); + QMessageBox::about(this, tr("MathGL - about"), s); +} +//----------------------------------------------------------------------------- +void QMathGL::aboutQt() { QMessageBox::aboutQt(this, tr("About Qt")); } +//----------------------------------------------------------------------------- +void QMathGL::print() +{ + QPrinter *printer = new QPrinter; printer->setOrientation(getRatio()>1 ? QPrinter::Landscape : QPrinter::Portrait); - QPrintDialog printDlg(printer, this); - if (printDlg.exec() == QDialog::Accepted) - { + QPrintDialog printDlg(printer, this); + if (printDlg.exec() == QDialog::Accepted) + { QRectF r = printer->pageRect(QPrinter::Inch); int d1 = int(pic.width()/r.width()), d2 = int(pic.height()/r.height()); int dpi = printer->resolution(); if(dpisetResolution(dpi); - + QPainter p; if(!p.begin(printer)) return; // paint on printer p.drawPixmap(0,0,pic); - } - delete printer; -} -//----------------------------------------------------------------------------- -// -// class mglGraphQT -// -//----------------------------------------------------------------------------- -mglGraphQT::mglGraphQT() : mglGraphZB() -{ - GG = 0; Wnd = 0; anim=0; - NumFig = 0; CurFig = -1; -} -//----------------------------------------------------------------------------- -mglGraphQT::~mglGraphQT() -{ if(GG) free(GG); } -//----------------------------------------------------------------------------- -void mglGraphQT::SetSize(int w,int h) -{ - if(GG) free(GG); GG = 0; - mglGraphZB::SetSize(w,h); -} -//----------------------------------------------------------------------------- -void mglGraphQT::EndFrame() -{ - CurFig = CurFrameId-1; - if(!GG) - { - GG = (unsigned char *)malloc(3*Width*Height); - NumFig = 1; CurFig = 0; - } - else if(CurFig>NumFig-1) - { - GG = (unsigned char *)realloc(GG,3*(NumFig+1)*Width*Height); - NumFig++; - } - mglGraph::EndFrame(); - memcpy(GG + CurFig*Width*Height*3,G,3*Width*Height); - CurFig++; -} -//----------------------------------------------------------------------------- -void mglGraphQT::Clf(mglColor Back) -{ - if(AutoClf) mglGraphZB::Clf(Back); -} -//----------------------------------------------------------------------------- -const unsigned char *mglGraphQT::GetBits() -{ - Finish(); - unsigned char *g = G; - if(GG && NumFig>0 && CurFig=0) - g = GG + CurFig*Width*Height*3; - return g; -} -//----------------------------------------------------------------------------- -void mglGraphQT::NextFrame() -{ - if(NumFig>0) { CurFig = CurFig>NumFig-1 ? 0 : CurFig+1; QMGL->refresh(); } -} -//----------------------------------------------------------------------------- -void mglGraphQT::PrevFrame() -{ - if(NumFig>0) - { CurFig = CurFig<0 ? NumFig-1 : CurFig-1; QMGL->refresh(); } -} -//----------------------------------------------------------------------------- -void mglGraphQT::Animation() -{ - if(anim) - { - bool s = anim->isChecked(); - anim->setChecked(!s); - QMGL->animation(!s); - } -} -//----------------------------------------------------------------------------- -void mglGraphQT::ToggleAlpha() { QMGL->setAlpha(!QMGL->getAlpha()); } -//----------------------------------------------------------------------------- -void mglGraphQT::ToggleLight() { QMGL->setLight(!QMGL->getLight()); } -//----------------------------------------------------------------------------- -void mglGraphQT::ToggleNo() { QMGL->restore(); } -//----------------------------------------------------------------------------- -void mglGraphQT::ToggleZoom() { QMGL->setZoom(!QMGL->getZoom()); } -//----------------------------------------------------------------------------- -void mglGraphQT::ToggleRotate() { QMGL->setRotate(!QMGL->getRotate());} -//----------------------------------------------------------------------------- -void mglGraphQT::Update() { CurFig=0; QMGL->restore(); } -//----------------------------------------------------------------------------- -void mglGraphQT::ReLoad(bool o) { if(LoadFunc){LoadFunc(o, FuncPar);Update();} } -//----------------------------------------------------------------------------- -void mglGraphQT::Adjust() -{ - SetSize(scroll->width(), scroll->height()); - QMGL->setSize(scroll->width(), scroll->height()); - Update(); -} -//----------------------------------------------------------------------------- -void mglGraphQT::Window(int argc, char **argv, int (*draw)(mglGraph *gr, void *p), const char *title, void *par, void (*reload)(int next, void *p), bool maximize) -{ - NumFig=0; CurFig=0; - CurFrameId = 0; - int n = draw ? draw(this,par) : 0; - if(n=0) NumFig = n; - DrawFunc = draw; FuncPar = par; - LoadFunc = reload; - if(Wnd) - { - Wnd->setWindowTitle(title); - if(maximize) - { Wnd->showMaximized(); } - else Wnd->show(); - return; - } - - if(!qApp) - { - QApplication *a; - if(!argv) - { - static char tmp[2][1]; - tmp[0][0]=tmp[1][0]=0; - static int aa=1; - a = new QApplication(aa, (char **)tmp); - } - else a = new QApplication(argc, argv); - a->connect(a, SIGNAL(lastWindowClosed()), a, SLOT(quit())); - } - - Wnd = new QMainWindow; Wnd->resize(650,480); - Wnd->setWindowTitle(title); - scroll = new QScrollArea(Wnd); - QMGL = new QMathGL(Wnd); makeMenu(); - QMGL->setPopup(popup); QMGL->setGraph(this); - QMGL->setDraw(draw, par); - qApp->processEvents(); - scroll->setWidget(QMGL); - Wnd->setCentralWidget(scroll); - QMGL->update(); - if(!maximize) Wnd->show(); - else Wnd->showMaximized(); -} -//----------------------------------------------------------------------------- -HMGL mgl_create_graph_qt_dr(HMDR dr, const char *title) -{ - mglGraphQT *g = new mglGraphQT; - g->Window(0,0,title,dr); - return g; -} -//----------------------------------------------------------------------------- -HMGL mgl_create_graph_qt(int (*draw)(HMGL gr, void *p), const char *title, void *par) -{ - mglGraphQT *g = new mglGraphQT; - g->Window(0,0,draw,title,par); - return g; -} -//----------------------------------------------------------------------------- -//uintptr_t mgl_create_graph_qt_(int (*draw)(uintptr_t *gr), const char *title, int l) -uintptr_t mgl_create_graph_qt_(const char *title, int l) -{ - mglGraphQT *g = new mglGraphQT; - char *s = new char[l+1]; memcpy(s,title,l); s[l]=0; -// g->Window(0,0,mgl_fortran_func,s,(void*)draw); - g->Window(0,0,0,s,0,0); - delete []s; - return uintptr_t(g); -} -//----------------------------------------------------------------------------- -int mglQtRun() { return qApp ? qApp->exec():0; } -//----------------------------------------------------------------------------- -void *mgl_qt_tmp(void *) { mglQtRun(); return 0; } -/*void mgl_qt_thread() -{ - static pthread_t tmp; - pthread_create(&tmp, 0, mgl_qt_tmp, 0); - pthread_detach(tmp); -}*/ -//----------------------------------------------------------------------------- -void mgl_qt_run() { mglQtRun(); } -void mgl_qt_run_() { mglQtRun(); } -//----------------------------------------------------------------------------- -#define TR QObject::tr -void mglGraphQT::makeMenu() -{ - QAction *a; - QMenu *o, *oo; - QToolBar *bb; - - popup = new QMenu(Wnd); - // file menu - { - o = Wnd->menuBar()->addMenu(TR("&File")); - oo = new QMenu(TR("&Export as ..."),Wnd); - oo->addAction(TR("PNG"), QMGL, SLOT(exportPNG()),Qt::ALT+Qt::Key_P); - oo->addAction(TR("solid PNG"), QMGL, SLOT(exportPNGs()),Qt::ALT+Qt::Key_F); - oo->addAction(TR("JPEG"), QMGL, SLOT(exportJPG()),Qt::ALT+Qt::Key_J); - oo->addAction(TR("bitmap EPS"), QMGL, SLOT(exportBPS())); - oo->addAction(TR("vector EPS"), QMGL, SLOT(exportEPS()),Qt::ALT+Qt::Key_E); - oo->addAction(TR("SVG"), QMGL, SLOT(exportSVG()),Qt::ALT+Qt::Key_S); - oo->addAction(TR("IDTF"), QMGL, SLOT(exportIDTF())); - o->addMenu(oo); - popup->addMenu(oo); - - o->addSeparator(); - a = new QAction(QPixmap(fileprint), TR("Print &graphics"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(print())); - a->setToolTip(TR("Open printer dialog and print graphics\t(CTRl+P)")); - a->setShortcut(Qt::CTRL+Qt::Key_P); o->addAction(a); - o->addSeparator(); - o->addAction(TR("&Close"), Wnd, SLOT(close()), Qt::CTRL+Qt::Key_W); - } - // graphics menu - { - bb = new QToolBar(TR("Graphics"),Wnd); - Wnd->addToolBar(Qt::TopToolBarArea, bb); - o = Wnd->menuBar()->addMenu(TR("&Graphics")); - a = new QAction(QPixmap(alpha_xpm), TR("&Alpha"), Wnd); - a->setShortcut(Qt::ALT+Qt::Key_T); a->setCheckable(true); - Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(setAlpha(bool))); - Wnd->connect(QMGL, SIGNAL(alphaChanged(bool)), a, SLOT(setOn(bool))); - a->setToolTip(TR("Switch on/off TRansparency for the graphics (Alt+T).")); - o->addAction(a); bb->addAction(a); - a = new QAction(QPixmap(light_xpm), TR("&Light"), Wnd); - a->setShortcut(Qt::ALT+Qt::Key_L); a->setCheckable(true); - Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(setLight(bool))); - Wnd->connect(QMGL, SIGNAL(lightChanged(bool)), a, SLOT(setOn(bool))); - a->setToolTip(TR("Switch on/off lightning for the graphics (Alt+L).")); - o->addAction(a); bb->addAction(a); - a = new QAction(QPixmap(rotate_xpm), TR("&Rotate by mouse"), Wnd); - a->setCheckable(true); - Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(setRotate(bool))); - Wnd->connect(QMGL, SIGNAL(rotateChanged(bool)), a, SLOT(setOn(bool))); - a->setToolTip(TR("Switch on/off mouse handling of the graphics\n(rotation, shifting, zooming and perspective).")); - bb->addAction(a); - a = new QAction(QPixmap(zoom_in_xpm), TR("&Zoom by mouse"), Wnd); - a->setCheckable(true); - Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(setZoom(bool))); - Wnd->connect(QMGL, SIGNAL(zoomChanged(bool)), a, SLOT(setOn(bool))); - a->setToolTip(TR("Switch on/off mouse zoom of selected region.")); - bb->addAction(a); - o->addSeparator(); - a = new QAction(QPixmap(zoom_out_xpm), TR("Res&tore"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(restore())); - a->setToolTip(TR("Restore default graphics rotation, zoom and perspective (Alt+Space).")); - a->setShortcut(Qt::ALT+Qt::Key_Space); - o->addAction(a); bb->addAction(a); popup->addAction(a); - bb->addSeparator(); - a = new QAction(QPixmap(ok_xpm), TR("Re&draw"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(update())); - a->setToolTip(TR("Execute script and redraw graphics (F5).")); - a->setShortcut(Qt::Key_F5); - o->addAction(a); bb->addAction(a); popup->addAction(a); - a = new QAction(TR("&Adjust size"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(adjust())); - a->setToolTip(TR("Change canvas size to fill whole region (F6).")); - a->setShortcut(Qt::Key_F6); o->addAction(a); - a = new QAction(QPixmap(copy_xpm), TR("&Copy plot"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(copy())); - a->setToolTip(TR("Copy graphics to clipboard (CTRl+C).")); - a->setShortcut(Qt::CTRL+Qt::Key_C); - o->addAction(a); bb->addAction(a); popup->addAction(a); - bb->addSeparator(); - tet = new QSpinBox(Wnd); tet->setWrapping(true); - bb->addWidget(tet); tet->setRange(-180, 180); tet->setSingleStep(10); - Wnd->connect(tet, SIGNAL(valueChanged(int)), QMGL, SLOT(setTet(int))); - Wnd->connect(QMGL, SIGNAL(tetChanged(int)), tet, SLOT(setValue(int))); - tet->setToolTip(TR("Set value of \\theta angle.")); - bb->addSeparator(); - phi = new QSpinBox(Wnd); phi->setWrapping(true); - bb->addWidget(phi); phi->setRange(-180, 180); phi->setSingleStep(10); - Wnd->connect(phi, SIGNAL(valueChanged(int)), QMGL, SLOT(setPhi(int))); - Wnd->connect(QMGL, SIGNAL(phiChanged(int)), phi, SLOT(setValue(int))); - phi->setToolTip(TR("Set value of \\phi angle.")); -// bb->addSeparator(); - } - // zooming menu - { - oo = o->addMenu(TR("Zoom/move")); - bb = new QToolBar(TR("Zoom graphics"),Wnd); - Wnd->addToolBar(Qt::LeftToolBarArea, bb); - a = new QAction(QPixmap(left_1_xpm), TR("Move &left"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(shiftLeft())); - a->setToolTip(TR("Move graphics left by 1/3 of its width.")); - bb->addAction(a); oo->addAction(a); - a = new QAction(QPixmap(up_1_xpm), TR("Move &up"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(shiftUp())); - a->setToolTip(TR("Move graphics up by 1/3 of its height.")); - bb->addAction(a); oo->addAction(a); - a = new QAction(QPixmap(zoom_1_xpm), TR("Zoom &in"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(zoomIn())); - a->setToolTip(TR("Zoom in graphics.")); - bb->addAction(a); oo->addAction(a); - a = new QAction(QPixmap(norm_1_xpm), TR("Zoom &out"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(zoomOut())); - a->setToolTip(TR("Zoom out graphics.")); - bb->addAction(a); oo->addAction(a); - a = new QAction(QPixmap(down_1_xpm), TR("Move &down"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(shiftDown())); - a->setToolTip(TR("Move graphics up down 1/3 of its height.")); - bb->addAction(a); oo->addAction(a); - a = new QAction(QPixmap(right_1_xpm), TR("Move &right"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(shiftRight())); - a->setToolTip(TR("Move graphics right by 1/3 of its width.")); - bb->addAction(a); oo->addAction(a); - } - // animation menu - { - o = Wnd->menuBar()->addMenu(TR("&Animation")); - bb = new QToolBar(TR("Animation"),Wnd); - Wnd->addToolBar(Qt::LeftToolBarArea, bb); - a = new QAction(QPixmap(next_sl_xpm), TR("&Next slide"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(nextSlide())); - a->setToolTip(TR("Show next slide (Alt+Right).")); - a->setShortcut(Qt::ALT+Qt::Key_Right); o->addAction(a); bb->addAction(a); - a = new QAction(QPixmap(show_sl_xpm), TR("&Slideshow"), Wnd); - a->setCheckable(true); anim = a; - Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(animation(bool))); - a->setToolTip(TR("Run slideshow (CTRl+F5).")); - a->setShortcut(Qt::CTRL+Qt::Key_F5); o->addAction(a); bb->addAction(a); - a = new QAction(QPixmap(prev_sl_xpm), TR("&Prev slide"), Wnd); - Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(prevSlide())); - a->setToolTip(TR("Show previous slide (Alt+Left).")); - a->setShortcut(Qt::ALT+Qt::Key_Left); o->addAction(a); bb->addAction(a); - } - - Wnd->menuBar()->addSeparator(); - o = Wnd->menuBar()->addMenu(TR("&Help")); - o->addAction(TR("About"), QMGL, SLOT(about())); - o->addAction(TR("About &Qt"), QMGL, SLOT(aboutQt())); -} -//----------------------------------------------------------------------------- + } + delete printer; +} +//----------------------------------------------------------------------------- +// +// class mglCanvasQT +// +//----------------------------------------------------------------------------- +mglCanvasQT::mglCanvasQT() : mglCanvasW() +{ Wnd = 0; anim=0; } +//----------------------------------------------------------------------------- +void mglCanvasQT::NextFrame() +{ + if(GetNumFig()>0) + { SetCurFig(GetCurFig()>GetNumFig()-1 ? 0 : GetCurFig()+1); QMGL->refresh(); } +} +//----------------------------------------------------------------------------- +void mglCanvasQT::PrevFrame() +{ + if(GetNumFig()>0) + { SetCurFig(GetCurFig()<0 ? GetNumFig()-1 : GetCurFig()-1); QMGL->refresh(); } +} +//----------------------------------------------------------------------------- +void mglCanvasQT::Animation() +{ + if(anim) + { + bool s = anim->isChecked(); + anim->setChecked(!s); + if(s) timer->stop(); + else timer->start(int(GetDelay()*1000)); + } +} +//----------------------------------------------------------------------------- +void mglCanvasQT::ToggleAlpha() { QMGL->setAlpha(!QMGL->getAlpha()); } +//----------------------------------------------------------------------------- +void mglCanvasQT::ToggleLight() { QMGL->setLight(!QMGL->getLight()); } +//----------------------------------------------------------------------------- +void mglCanvasQT::ToggleNo() { QMGL->restore(); } +//----------------------------------------------------------------------------- +void mglCanvasQT::ToggleRotate(){ QMGL->setRotate(!QMGL->getRotate());} +//----------------------------------------------------------------------------- +void mglCanvasQT::Update() { SetCurFig(0); QMGL->restore(); } +//----------------------------------------------------------------------------- +void mglCanvasQT::Adjust() +{ + SetSize(scroll->width()-3, scroll->height()-3); + QMGL->setSize(scroll->width()-3, scroll->height()-3); + Update(); +} +//----------------------------------------------------------------------------- +void mglCanvasQT::Window(int argc, char **argv, int (*draw)(mglBase *gr, void *p), const char *title, void *par, void (*reload)(void *p), bool maximize) +{ + SetDrawFunc(draw, par, reload); + if(Wnd) + { + Wnd->setWindowTitle(title); + if(maximize) + { Wnd->showMaximized(); } + else Wnd->show(); + return; + } + + if(!qApp) + { + QApplication *a; + if(!argv) + { + static char tmp[2][1]; + tmp[0][0]=tmp[1][0]=0; + static int aa=1; + a = new QApplication(aa, (char **)tmp); + } + else a = new QApplication(argc, argv); + a->connect(a, SIGNAL(lastWindowClosed()), a, SLOT(quit())); + } + + Wnd = new QMainWindow; Wnd->resize(650,480); + Wnd->setWindowTitle(title); + scroll = new QScrollArea(Wnd); + timer = new QTimer(Wnd); + + QMGL = new QMathGL(Wnd); makeMenu(); + QMGL->setPopup(popup); QMGL->setGraph(this); + QMGL->setDraw(draw, par); + qApp->processEvents(); + scroll->setWidget(QMGL); + Wnd->setCentralWidget(scroll); + QMGL->update(); + if(!maximize) Wnd->show(); + else Wnd->showMaximized(); +} +//----------------------------------------------------------------------------- +#define TR QObject::tr +void mglCanvasQT::makeMenu() +{ + QAction *a; + QMenu *o, *oo; + QToolBar *bb; + + popup = new QMenu(Wnd); + // file menu + { + o = Wnd->menuBar()->addMenu(TR("&File")); + oo = new QMenu(TR("&Export as ..."),Wnd); + oo->addAction(TR("PNG"), QMGL, SLOT(exportPNG()),Qt::ALT+Qt::Key_P); + oo->addAction(TR("solid PNG"), QMGL, SLOT(exportPNGs()),Qt::ALT+Qt::Key_F); + oo->addAction(TR("JPEG"), QMGL, SLOT(exportJPG()),Qt::ALT+Qt::Key_J); + oo->addAction(TR("bitmap EPS"), QMGL, SLOT(exportBPS())); + oo->addAction(TR("vector EPS"), QMGL, SLOT(exportEPS()),Qt::ALT+Qt::Key_E); + oo->addAction(TR("SVG"), QMGL, SLOT(exportSVG()),Qt::ALT+Qt::Key_S); + oo->addAction(TR("IDTF"), QMGL, SLOT(exportIDTF())); + o->addMenu(oo); + popup->addMenu(oo); + + o->addSeparator(); + a = new QAction(QPixmap(fileprint), TR("Print &graphics"), Wnd); + Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(print())); + a->setToolTip(TR("Open printer dialog and print graphics\t(CTRl+P)")); + a->setShortcut(Qt::CTRL+Qt::Key_P); o->addAction(a); + o->addSeparator(); + o->addAction(TR("&Close"), Wnd, SLOT(close()), Qt::CTRL+Qt::Key_W); + } + // graphics menu + { + bb = new QToolBar(TR("Graphics"),Wnd); + Wnd->addToolBar(Qt::TopToolBarArea, bb); + o = Wnd->menuBar()->addMenu(TR("&Graphics")); + a = new QAction(QPixmap(alpha_xpm), TR("&Alpha"), Wnd); + a->setShortcut(Qt::ALT+Qt::Key_T); a->setCheckable(true); + Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(setAlpha(bool))); + Wnd->connect(QMGL, SIGNAL(alphaChanged(bool)), a, SLOT(setOn(bool))); + a->setToolTip(TR("Switch on/off TRansparency for the graphics (Alt+T).")); + o->addAction(a); bb->addAction(a); + a = new QAction(QPixmap(light_xpm), TR("&Light"), Wnd); + a->setShortcut(Qt::ALT+Qt::Key_L); a->setCheckable(true); + Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(setLight(bool))); + Wnd->connect(QMGL, SIGNAL(lightChanged(bool)), a, SLOT(setOn(bool))); + a->setToolTip(TR("Switch on/off lightning for the graphics (Alt+L).")); + o->addAction(a); bb->addAction(a); + a = new QAction(QPixmap(rotate_xpm), TR("&Rotate by mouse"), Wnd); + a->setCheckable(true); + Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(setRotate(bool))); + Wnd->connect(QMGL, SIGNAL(rotateChanged(bool)), a, SLOT(setOn(bool))); + a->setToolTip(TR("Switch on/off mouse handling of the graphics\n(rotation, shifting, zooming and perspective).")); + bb->addAction(a); + a = new QAction(QPixmap(zoom_in_xpm), TR("&Zoom by mouse"), Wnd); + a->setCheckable(true); + Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(setZoom(bool))); + Wnd->connect(QMGL, SIGNAL(zoomChanged(bool)), a, SLOT(setOn(bool))); + a->setToolTip(TR("Switch on/off mouse zoom of selected region.")); + bb->addAction(a); + o->addSeparator(); + a = new QAction(QPixmap(zoom_out_xpm), TR("Res&tore"), Wnd); + Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(restore())); + a->setToolTip(TR("Restore default graphics rotation, zoom and perspective (Alt+Space).")); + a->setShortcut(Qt::ALT+Qt::Key_Space); + o->addAction(a); bb->addAction(a); popup->addAction(a); + bb->addSeparator(); + a = new QAction(QPixmap(ok_xpm), TR("Re&draw"), Wnd); + Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(update())); + a->setToolTip(TR("Execute script and redraw graphics (F5).")); + a->setShortcut(Qt::Key_F5); + o->addAction(a); bb->addAction(a); popup->addAction(a); + a = new QAction(TR("&Adjust size"), Wnd); + Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(adjust())); + a->setToolTip(TR("Change canvas size to fill whole region (F6).")); + a->setShortcut(Qt::Key_F6); o->addAction(a); + a = new QAction(QPixmap(copy_xpm), TR("&Copy plot"), Wnd); + Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(copy())); + a->setToolTip(TR("Copy graphics to clipboard (CTRl+C).")); + a->setShortcut(Qt::CTRL+Qt::Key_C); + o->addAction(a); bb->addAction(a); popup->addAction(a); + bb->addSeparator(); + tet = new QSpinBox(Wnd); tet->setWrapping(true); + bb->addWidget(tet); tet->setRange(-180, 180); tet->setSingleStep(10); + Wnd->connect(tet, SIGNAL(valueChanged(int)), QMGL, SLOT(setTet(int))); + Wnd->connect(QMGL, SIGNAL(tetChanged(int)), tet, SLOT(setValue(int))); + tet->setToolTip(TR("Set value of \\theta angle.")); + bb->addSeparator(); + phi = new QSpinBox(Wnd); phi->setWrapping(true); + bb->addWidget(phi); phi->setRange(-180, 180); phi->setSingleStep(10); + Wnd->connect(phi, SIGNAL(valueChanged(int)), QMGL, SLOT(setPhi(int))); + Wnd->connect(QMGL, SIGNAL(phiChanged(int)), phi, SLOT(setValue(int))); + phi->setToolTip(TR("Set value of \\phi angle.")); +// bb->addSeparator(); + } + // zooming menu + { + oo = o->addMenu(TR("Zoom/move")); + bb = new QToolBar(TR("Zoom graphics"),Wnd); + Wnd->addToolBar(Qt::LeftToolBarArea, bb); + a = new QAction(QPixmap(left_1_xpm), TR("Move &left"), Wnd); + Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(shiftLeft())); + a->setToolTip(TR("Move graphics left by 1/3 of its width.")); + bb->addAction(a); oo->addAction(a); + a = new QAction(QPixmap(up_1_xpm), TR("Move &up"), Wnd); + Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(shiftUp())); + a->setToolTip(TR("Move graphics up by 1/3 of its height.")); + bb->addAction(a); oo->addAction(a); + a = new QAction(QPixmap(zoom_1_xpm), TR("Zoom &in"), Wnd); + Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(zoomIn())); + a->setToolTip(TR("Zoom in graphics.")); + bb->addAction(a); oo->addAction(a); + a = new QAction(QPixmap(norm_1_xpm), TR("Zoom &out"), Wnd); + Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(zoomOut())); + a->setToolTip(TR("Zoom out graphics.")); + bb->addAction(a); oo->addAction(a); + a = new QAction(QPixmap(down_1_xpm), TR("Move &down"), Wnd); + Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(shiftDown())); + a->setToolTip(TR("Move graphics up down 1/3 of its height.")); + bb->addAction(a); oo->addAction(a); + a = new QAction(QPixmap(right_1_xpm), TR("Move &right"), Wnd); + Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(shiftRight())); + a->setToolTip(TR("Move graphics right by 1/3 of its width.")); + bb->addAction(a); oo->addAction(a); + } + // animation menu + { + o = Wnd->menuBar()->addMenu(TR("&Animation")); + bb = new QToolBar(TR("Animation"),Wnd); + Wnd->addToolBar(Qt::LeftToolBarArea, bb); + a = new QAction(QPixmap(next_sl_xpm), TR("&Next slide"), Wnd); + Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(nextSlide())); + a->setToolTip(TR("Show next slide (Alt+Right).")); + a->setShortcut(Qt::ALT+Qt::Key_Right); o->addAction(a); bb->addAction(a); + a = new QAction(QPixmap(show_sl_xpm), TR("&Slideshow"), Wnd); + a->setCheckable(true); anim = a; + Wnd->connect(a, SIGNAL(toggled(bool)), QMGL, SLOT(animation(bool))); + a->setToolTip(TR("Run slideshow (CTRl+F5).")); + a->setShortcut(Qt::CTRL+Qt::Key_F5); o->addAction(a); bb->addAction(a); + a = new QAction(QPixmap(prev_sl_xpm), TR("&Prev slide"), Wnd); + Wnd->connect(a, SIGNAL(activated()), QMGL, SLOT(prevSlide())); + a->setToolTip(TR("Show previous slide (Alt+Left).")); + a->setShortcut(Qt::ALT+Qt::Key_Left); o->addAction(a); bb->addAction(a); + } + + Wnd->menuBar()->addSeparator(); + o = Wnd->menuBar()->addMenu(TR("&Help")); + o->addAction(TR("About"), QMGL, SLOT(about())); + o->addAction(TR("About &Qt"), QMGL, SLOT(aboutQt())); +} +//----------------------------------------------------------------------------- +HMGL mgl_create_graph_qt(int (*draw)(HMGL gr, void *p), const char *title, void *par) +{ + mglCanvasQT *g = new mglCanvasQT; + g->Window(0,0,draw,title,par); + return g; +} +void mgl_qt_run() { if(qApp) qApp->exec(); } +//----------------------------------------------------------------------------- +uintptr_t mgl_create_graph_qt_(const char *title, int l) +{ + char *s = new char[l+1]; memcpy(s,title,l); s[l]=0; + uintptr_t t = uintptr_t(mgl_create_graph_qt(0,s,0)); + delete []s; return t; +} +void mgl_qt_run_() { mgl_qt_run(); } +//----------------------------------------------------------------------------- +void *mgl_qt_tmp(void *) { mgl_qt_run(); return 0; } +/*void mgl_qt_thread() + * { + * static pthread_t tmp; + * pthread_create(&tmp, 0, mgl_qt_tmp, 0); + * pthread_detach(tmp); + }*/ +//----------------------------------------------------------------------------- diff --git a/widgets/window.cpp b/widgets/window.cpp new file mode 100644 index 0000000..cb4c764 --- /dev/null +++ b/widgets/window.cpp @@ -0,0 +1,168 @@ +/*************************************************************************** + * window.cpp is part of Math Graphic Library + * Copyright (C) 2007 Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 3 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 Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "mgl/window.h" +//----------------------------------------------------------------------------- +mglCanvasW::mglCanvasW() : mglCanvas() +{ + Setup(true,false,true); Delay=0.5; + LoadFunc=0; FuncPar=0; DrawFunc=0; + GG = 0; NumFig = 0; CurFig = -1; +} +//----------------------------------------------------------------------------- +mglCanvasW::~mglCanvasW() { if(GG) free(GG); } +//----------------------------------------------------------------------------- +void mglCanvasW::Clf(mglColor Back) { if(get(MGL_AUTO_CLF)) mglCanvas::Clf(Back); } +//----------------------------------------------------------------------------- +void mglCanvasW::SetSize(int w,int h) +{ + if(GG) free(GG); GG = 0; + mglCanvas::SetSize(w,h); + // if(Wnd) Wnd->size(w,h); +} +//----------------------------------------------------------------------------- +void mglCanvasW::EndFrame() +{ + CurFig = CurFrameId-1; + if(!GG) + { + GG = (unsigned char *)malloc(3*Width*Height); + NumFig = 1; CurFig = 0; + } + else if(CurFig>NumFig-1) + { + GG = (unsigned char *)realloc(GG,3*(NumFig+1)*Width*Height); + NumFig++; + } + mglCanvas::EndFrame(); + memcpy(GG + CurFig*Width*Height*3,G,3*Width*Height); + CurFig++; +} +//----------------------------------------------------------------------------- +void mglCanvasW::SetDrawFunc(int (*draw)(mglBase *gr, void *p), void *par, void (*reload)(void *p)) +{ + NumFig=0; CurFig=0; + CurFrameId = 0; + int n = draw ? draw(this,par) : 0; + if(n=0) NumFig = n; + DrawFunc = draw; FuncPar = par; + LoadFunc = reload; +} +//----------------------------------------------------------------------------- +const unsigned char *mglCanvasW::GetBits() +{ + const unsigned char *g = mglCanvas::GetBits(); + if(GG && NumFig>0 && CurFig=0) + g = GG + CurFig*Width*Height*3; + return g; +} +//----------------------------------------------------------------------------- +void mglCanvasW::ReLoad() +{ if(LoadFunc) { LoadFunc(FuncPar); Update(); } } +//----------------------------------------------------------------------------- +void mgl_wnd_set_delay(HMGL gr, mreal dt) +{ mglCanvasW *g = dynamic_cast(gr); if(g) g->SetDelay(dt); } +void mgl_wnd_toggle_alpha(HMGL gr) +{ mglCanvasW *g = dynamic_cast(gr); if(g) g->ToggleAlpha(); } +void mgl_wnd_toggle_light(HMGL gr) +{ mglCanvasW *g = dynamic_cast(gr); if(g) g->ToggleLight(); } +//void mgl_wnd_toggle_zoom(HMGL gr) +//{ mglCanvasW *g = dynamic_cast(gr); if(g) g->ToggleZoom(); } +void mgl_wnd_toggle_rotate(HMGL gr) +{ mglCanvasW *g = dynamic_cast(gr); if(g) g->ToggleRotate(); } +void mgl_wnd_toggle_no(HMGL gr) +{ mglCanvasW *g = dynamic_cast(gr); if(g) g->ToggleNo(); } +void mgl_wnd_update(HMGL gr) +{ mglCanvasW *g = dynamic_cast(gr); if(g) g->Update(); } +void mgl_wnd_reload(HMGL gr) +{ mglCanvasW *g = dynamic_cast(gr); if(g) g->ReLoad(); } +void mgl_wnd_adjust(HMGL gr) +{ mglCanvasW *g = dynamic_cast(gr); if(g) g->Adjust(); } +void mgl_wnd_next_frame(HMGL gr) +{ mglCanvasW *g = dynamic_cast(gr); if(g) g->NextFrame(); } +void mgl_wnd_prev_frame(HMGL gr) +{ mglCanvasW *g = dynamic_cast(gr); if(g) g->PrevFrame(); } +void mgl_wnd_animation(HMGL gr) +{ mglCanvasW *g = dynamic_cast(gr); if(g) g->Animation(); } +//----------------------------------------------------------------------------- +void mgl_wnd_set_delay_(uintptr_t *gr, mreal *dt) +{ mglCanvasW *g = dynamic_cast((HMGL)(*gr)); + if(g) g->SetDelay(*dt); } +void mgl_wnd_toggle_alpha_(uintptr_t *gr) +{ mglCanvasW *g = dynamic_cast((HMGL)(*gr)); + if(g) g->ToggleAlpha(); } +void mgl_wnd_toggle_light_(uintptr_t *gr) +{ mglCanvasW *g = dynamic_cast((HMGL)(*gr)); + if(g) g->ToggleLight(); } +//void mgl_wnd_toggle_zoom_(uintptr_t *gr) +//{ mglCanvasW *g = dynamic_cast((HMGL)(*gr)); +// if(g) g->ToggleZoom(); } +void mgl_wnd_toggle_rotate_(uintptr_t *gr) +{ mglCanvasW *g = dynamic_cast((HMGL)(*gr)); + if(g) g->ToggleRotate(); } +void mgl_wnd_toggle_no_(uintptr_t *gr) +{ mglCanvasW *g = dynamic_cast((HMGL)(*gr)); + if(g) g->ToggleNo(); } +void mgl_wnd_update_(uintptr_t *gr) +{ mglCanvasW *g = dynamic_cast((HMGL)(*gr)); + if(g) g->Update(); } +void mgl_wnd_reload_(uintptr_t *gr) +{ mglCanvasW *g = dynamic_cast((HMGL)(*gr)); + if(g) g->ReLoad(); } +void mgl_wnd_adjust_(uintptr_t *gr) +{ mglCanvasW *g = dynamic_cast((HMGL)(*gr)); + if(g) g->Adjust(); } +void mgl_wnd_next_frame_(uintptr_t *gr) +{ mglCanvasW *g = dynamic_cast((HMGL)(*gr)); + if(g) g->NextFrame(); } +void mgl_wnd_prev_frame_(uintptr_t *gr) +{ mglCanvasW *g = dynamic_cast((HMGL)(*gr)); + if(g) g->PrevFrame(); } +void mgl_wnd_animation_(uintptr_t *gr) +{ mglCanvasW *g = dynamic_cast((HMGL)(*gr)); + if(g) g->Animation(); } +//----------------------------------------------------------------------------- +#ifndef HAVE_FLTK +HMGL mgl_create_graph_fltk(int (*)(HMGL gr, void *p), const char *, void *) +{ return NULL; } +void mgl_fltk_run(){} +//----------------------------------------------------------------------------- +uintptr_t mgl_create_graph_fltk_(const char *title, int l) +{ + char *s = new char[l+1]; memcpy(s,title,l); s[l]=0; + uintptr_t t = uintptr_t(mgl_create_graph_fltk(0,s,0)); + delete []s; return t; +} +void mgl_fltk_run_() { mgl_fltk_run(); } +#endif +//----------------------------------------------------------------------------- +#ifndef HAVE_QT +HMGL mgl_create_graph_qt(int (*)(HMGL gr, void *p), const char *, void *) +{ return NULL; } +void mgl_qt_run(){} +//----------------------------------------------------------------------------- +uintptr_t mgl_create_graph_qt_(const char *title, int l) +{ + char *s = new char[l+1]; memcpy(s,title,l); s[l]=0; + uintptr_t t = uintptr_t(mgl_create_graph_qt(0,s,0)); + delete []s; return t; +} +void mgl_qt_run_() { mgl_qt_run(); } +#endif +//----------------------------------------------------------------------------- -- 2.30.2