From d187eac4bde3d27aae8ee200485c47832dc39d71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafael=20Laboissi=C3=A8re?= Date: Fri, 10 Dec 2021 12:04:40 -0300 Subject: [PATCH] New upstream version 2.5 --- CMakeLists.txt | 204 ++++-- ChangeLog.txt | 27 + emblem.mgl | 2 + examples/CMakeLists.txt | 1 + examples/fltk_example.cpp | 36 +- examples/full_test.cpp | 36 +- examples/glut_example.cpp | 2 +- examples/qt_example.cpp | 4 +- examples/samples.cpp | 112 ++- examples/test.c | 19 + examples/test.cpp | 17 + examples/test.f90 | 24 + examples/test.py | 16 + examples/test_fltk.cpp | 13 + fonts/make_bin.cpp | 10 + include/config.h.in | 4 + include/mgl2/Fl_MathGL.h | 32 +- include/mgl2/abstract.h | 27 +- include/mgl2/addon.h | 6 +- include/mgl2/base.h | 31 +- include/mgl2/base_cf.h | 7 +- include/mgl2/canvas.h | 18 +- include/mgl2/canvas_cf.h | 22 +- include/mgl2/canvas_wnd.h | 6 +- include/mgl2/cont.h | 17 +- include/mgl2/data.h | 80 ++- include/mgl2/data_cf.h | 76 +- include/mgl2/datac.h | 55 +- include/mgl2/datac_cf.h | 16 +- include/mgl2/define.h | 15 +- include/mgl2/eval.h | 4 +- include/mgl2/evalc.h | 4 +- include/mgl2/fit.h | 4 +- include/mgl2/fltk.h | 4 +- include/mgl2/font.h | 12 +- include/mgl2/glut.h | 4 +- include/mgl2/mgl.h | 71 +- include/mgl2/mgl_cf.h | 4 +- include/mgl2/opengl.h | 4 +- include/mgl2/other.h | 4 +- include/mgl2/parser.h | 6 +- include/mgl2/pde.h | 8 +- include/mgl2/plot.h | 17 +- include/mgl2/prim.h | 4 +- include/mgl2/qmathgl.h | 11 +- include/mgl2/qt.h | 4 +- include/mgl2/surf.h | 4 +- include/mgl2/thread.h | 4 +- include/mgl2/type.h | 10 +- include/mgl2/vect.h | 4 +- include/mgl2/volume.h | 4 +- include/mgl2/window.h | 4 +- include/mgl2/wnd.h | 4 +- include/mgl2/wnd_cf.h | 4 +- include/mgl2/wx.h | 4 +- include/xpm/arc.xpm | 2 +- include/xpm/arrow_a.xpm | 2 +- include/xpm/arrow_d.xpm | 2 +- include/xpm/arrow_i.xpm | 2 +- include/xpm/arrow_k.xpm | 2 +- include/xpm/arrow_n.xpm | 2 +- include/xpm/arrow_o.xpm | 2 +- include/xpm/arrow_s.xpm | 2 +- include/xpm/arrow_t.xpm | 2 +- include/xpm/arrow_v.xpm | 2 +- include/xpm/axis.xpm | 2 +- include/xpm/axis_sh.xpm | 2 +- include/xpm/barrow_a.xpm | 2 +- include/xpm/barrow_d.xpm | 2 +- include/xpm/barrow_i.xpm | 2 +- include/xpm/barrow_k.xpm | 2 +- include/xpm/barrow_n.xpm | 2 +- include/xpm/barrow_o.xpm | 2 +- include/xpm/barrow_s.xpm | 2 +- include/xpm/barrow_t.xpm | 2 +- include/xpm/barrow_v.xpm | 2 +- include/xpm/box.xpm | 27 +- include/xpm/crop.xpm | 2 +- include/xpm/curve.xpm | 2 +- include/xpm/dash_d.xpm | 2 +- include/xpm/dash_e.xpm | 2 +- include/xpm/dash_i.xpm | 2 +- include/xpm/dash_j.xpm | 2 +- include/xpm/dash_l.xpm | 2 +- include/xpm/dash_m.xpm | 2 +- include/xpm/dash_s.xpm | 2 +- include/xpm/delete.xpm | 23 +- include/xpm/diff.xpm | 2 +- include/xpm/diff2.xpm | 4 +- include/xpm/func.xpm | 2 +- include/xpm/integr.xpm | 7 +- include/xpm/line.xpm | 2 +- include/xpm/mark_.xpm | 2 +- include/xpm/mark_a.xpm | 2 +- include/xpm/mark_cf.xpm | 2 +- include/xpm/mark_d.xpm | 2 +- include/xpm/mark_df.xpm | 2 +- include/xpm/mark_l.xpm | 2 +- include/xpm/mark_lf.xpm | 2 +- include/xpm/mark_o.xpm | 2 +- include/xpm/mark_of.xpm | 2 +- include/xpm/mark_p.xpm | 2 +- include/xpm/mark_pf.xpm | 2 +- include/xpm/mark_r.xpm | 2 +- include/xpm/mark_rf.xpm | 2 +- include/xpm/mark_s.xpm | 2 +- include/xpm/mark_sf.xpm | 2 +- include/xpm/mark_t.xpm | 2 +- include/xpm/mark_tf.xpm | 2 +- include/xpm/mark_v.xpm | 2 +- include/xpm/mark_vf.xpm | 2 +- include/xpm/mark_x.xpm | 2 +- include/xpm/mark_y.xpm | 2 +- include/xpm/mask_a.xpm | 2 +- include/xpm/mask_d.xpm | 2 +- include/xpm/mask_d_.xpm | 2 +- include/xpm/mask_e.xpm | 2 +- include/xpm/mask_i.xpm | 2 +- include/xpm/mask_j.xpm | 2 +- include/xpm/mask_l.xpm | 2 +- include/xpm/mask_m.xpm | 2 +- include/xpm/mask_o.xpm | 2 +- include/xpm/mask_o_.xpm | 2 +- include/xpm/mask_p.xpm | 2 +- include/xpm/mask_r.xpm | 2 +- include/xpm/mask_s.xpm | 2 +- include/xpm/mask_s_.xpm | 2 +- include/xpm/mask_t.xpm | 2 +- include/xpm/mask_u.xpm | 2 +- include/xpm/none.xpm | 2 +- include/xpm/oper.xpm | 2 +- include/xpm/oper_a.xpm | 2 +- include/xpm/oper_d.xpm | 2 +- include/xpm/oper_dir.xpm | 2 +- include/xpm/oper_m.xpm | 4 +- include/xpm/oper_of.xpm | 2 +- include/xpm/oper_s.xpm | 2 +- include/xpm/option.xpm | 4 +- include/xpm/pause.xpm | 2 +- include/xpm/plot.xpm | 2 +- include/xpm/polygon.xpm | 2 +- include/xpm/size.xpm | 2 +- include/xpm/squize.xpm | 4 +- include/xpm/text.xpm | 2 +- include/xpm/update.xpm | 2 +- include/xpm/wire.xpm | 2 +- json/MainWindow.cpp | 2 +- lang/CMakeLists.txt | 16 +- lang/data.i | 58 +- lang/mgl.i | 87 ++- lang/numpy.i | 4 +- mathgl_es.po | 1223 +++++++++++++++++--------------- mathgl_ru.po | 1232 ++++++++++++++++++--------------- mgllab/dialogs.cpp | 18 +- mgllab/editor.cpp | 24 +- mgllab/grid.cpp | 2 +- mgllab/help.cpp | 6 +- mgllab/mathgl.cpp | 16 +- mgllab/mgllab.cpp | 41 +- mgllab/mgllab.h | 5 +- mgllab/mgllab.rc | 2 +- mgllab/table.cpp | 16 +- mgllab/xpm/arc.xpm | 2 +- mgllab/xpm/arrow_a.xpm | 2 +- mgllab/xpm/arrow_d.xpm | 2 +- mgllab/xpm/arrow_i.xpm | 2 +- mgllab/xpm/arrow_k.xpm | 2 +- mgllab/xpm/arrow_n.xpm | 2 +- mgllab/xpm/arrow_o.xpm | 2 +- mgllab/xpm/arrow_s.xpm | 2 +- mgllab/xpm/arrow_t.xpm | 2 +- mgllab/xpm/arrow_v.xpm | 2 +- mgllab/xpm/axis.xpm | 2 +- mgllab/xpm/axis_sh.xpm | 2 +- mgllab/xpm/barrow_a.xpm | 2 +- mgllab/xpm/barrow_d.xpm | 2 +- mgllab/xpm/barrow_i.xpm | 2 +- mgllab/xpm/barrow_k.xpm | 2 +- mgllab/xpm/barrow_n.xpm | 2 +- mgllab/xpm/barrow_o.xpm | 2 +- mgllab/xpm/barrow_s.xpm | 2 +- mgllab/xpm/barrow_t.xpm | 2 +- mgllab/xpm/barrow_v.xpm | 2 +- mgllab/xpm/box.xpm | 27 +- mgllab/xpm/crop.xpm | 2 +- mgllab/xpm/curve.xpm | 2 +- mgllab/xpm/dash_d.xpm | 2 +- mgllab/xpm/dash_e.xpm | 2 +- mgllab/xpm/dash_i.xpm | 2 +- mgllab/xpm/dash_j.xpm | 2 +- mgllab/xpm/dash_l.xpm | 2 +- mgllab/xpm/dash_m.xpm | 2 +- mgllab/xpm/dash_s.xpm | 2 +- mgllab/xpm/delete.xpm | 23 +- mgllab/xpm/diff.xpm | 2 +- mgllab/xpm/diff2.xpm | 4 +- mgllab/xpm/edit-find.xpm | 25 +- mgllab/xpm/func.xpm | 2 +- mgllab/xpm/integr.xpm | 7 +- mgllab/xpm/line.xpm | 2 +- mgllab/xpm/mark_.xpm | 2 +- mgllab/xpm/mark_a.xpm | 2 +- mgllab/xpm/mark_cf.xpm | 2 +- mgllab/xpm/mark_d.xpm | 2 +- mgllab/xpm/mark_df.xpm | 2 +- mgllab/xpm/mark_l.xpm | 2 +- mgllab/xpm/mark_lf.xpm | 2 +- mgllab/xpm/mark_o.xpm | 2 +- mgllab/xpm/mark_of.xpm | 2 +- mgllab/xpm/mark_p.xpm | 2 +- mgllab/xpm/mark_pf.xpm | 2 +- mgllab/xpm/mark_r.xpm | 2 +- mgllab/xpm/mark_rf.xpm | 2 +- mgllab/xpm/mark_s.xpm | 2 +- mgllab/xpm/mark_sf.xpm | 2 +- mgllab/xpm/mark_t.xpm | 2 +- mgllab/xpm/mark_tf.xpm | 2 +- mgllab/xpm/mark_v.xpm | 2 +- mgllab/xpm/mark_vf.xpm | 2 +- mgllab/xpm/mark_x.xpm | 2 +- mgllab/xpm/mark_y.xpm | 2 +- mgllab/xpm/mask_a.xpm | 2 +- mgllab/xpm/mask_d.xpm | 2 +- mgllab/xpm/mask_d_.xpm | 2 +- mgllab/xpm/mask_e.xpm | 2 +- mgllab/xpm/mask_i.xpm | 2 +- mgllab/xpm/mask_j.xpm | 2 +- mgllab/xpm/mask_l.xpm | 2 +- mgllab/xpm/mask_m.xpm | 2 +- mgllab/xpm/mask_o.xpm | 2 +- mgllab/xpm/mask_o_.xpm | 2 +- mgllab/xpm/mask_p.xpm | 2 +- mgllab/xpm/mask_r.xpm | 2 +- mgllab/xpm/mask_s.xpm | 2 +- mgllab/xpm/mask_s_.xpm | 2 +- mgllab/xpm/mask_t.xpm | 2 +- mgllab/xpm/mask_u.xpm | 2 +- mgllab/xpm/none.xpm | 2 +- mgllab/xpm/oper.xpm | 2 +- mgllab/xpm/oper_a.xpm | 2 +- mgllab/xpm/oper_d.xpm | 2 +- mgllab/xpm/oper_dir.xpm | 2 +- mgllab/xpm/oper_m.xpm | 4 +- mgllab/xpm/oper_of.xpm | 2 +- mgllab/xpm/oper_s.xpm | 2 +- mgllab/xpm/option.xpm | 4 +- mgllab/xpm/pause.xpm | 2 +- mgllab/xpm/plot.xpm | 2 +- mgllab/xpm/polygon.xpm | 2 +- mgllab/xpm/size.xpm | 2 +- mgllab/xpm/squize.xpm | 4 +- mgllab/xpm/text.xpm | 2 +- mgllab/xpm/update.xpm | 2 +- mgllab/xpm/wire.xpm | 2 +- scripts/MathGLConfig.cmake.in | 13 + src/CMakeLists.txt | 2 +- src/addon.cpp | 17 +- src/axis.cpp | 9 +- src/base.cpp | 144 +++- src/base_cf.cpp | 27 +- src/canvas.cpp | 17 +- src/canvas_cf.cpp | 59 +- src/complex.cpp | 16 +- src/complex_ex.cpp | 64 +- src/complex_io.cpp | 16 +- src/cont.cpp | 213 +++++- src/cont.hpp | 21 +- src/crust.cpp | 7 +- src/data.cpp | 201 ++++-- src/data_ex.cpp | 239 ++++++- src/data_gr.cpp | 11 +- src/data_io.cpp | 200 +++++- src/data_png.cpp | 36 +- src/eval.cpp | 13 +- src/evalc.cpp | 13 +- src/evalp.cpp | 787 +++++++++++++++++---- src/exec_dat.cpp | 76 +- src/exec_gr.cpp | 86 ++- src/exec_prm.cpp | 20 +- src/exec_set.cpp | 13 +- src/export.cpp | 8 +- src/export_2d.cpp | 28 +- src/export_3d.cpp | 4 +- src/fft.cpp | 4 +- src/fit.cpp | 5 +- src/font.cpp | 50 +- src/fractal.cpp | 4 +- src/interp.hpp | 513 +++++++------- src/obj.cpp | 10 +- src/opengl.cpp | 4 +- src/other.cpp | 20 +- src/parser.cpp | 41 +- src/pde.cpp | 348 ++++++++-- src/pixel.cpp | 6 +- src/pixel_gen.cpp | 79 ++- src/pixel_pix.cpp | 4 +- src/plot.cpp | 115 ++- src/prc.cpp | 6 +- src/prc/PRCbitStream.cc | 8 +- src/prc/PRCbitStream.h | 6 +- src/prc/oPRCFile.cc | 6 +- src/prc/oPRCFile.h | 6 +- src/prc/writePRC.cc | 6 +- src/prc/writePRC.h | 6 +- src/prim.cpp | 12 +- src/random.cpp | 358 ++++++++++ src/surf.cpp | 8 +- src/tex_table.cc | 8 +- src/vect.cpp | 27 +- src/volume.cpp | 4 +- src/window.cpp | 4 +- texinfo/CMakeLists.txt | 6 +- texinfo/concept_en.texi | 8 +- texinfo/concept_ru.texi | 18 +- texinfo/core_en.texi | 122 +++- texinfo/core_ru.texi | 113 ++- texinfo/data_en.texi | 201 +++++- texinfo/data_ru.texi | 215 +++++- texinfo/version.texi.in | 3 +- texinfo/version_hist.txt | 3 + texinfo/web_en.texi | 43 +- texinfo/web_ru.texi | 43 +- texinfo/widget_en.texi | 2 + texinfo/widget_ru.texi | 2 + todo.txt | 59 +- udav/anim_dlg.cpp | 3 +- udav/dat_pnl.cpp | 26 +- udav/info_dlg.cpp | 4 +- udav/mem_pnl.cpp | 20 +- udav/open_dlg.cpp | 8 +- udav/plot_pnl.cpp | 2 +- udav/setup_dlg.cpp | 54 +- udav/style_dlg.cpp | 2 +- udav/udav_wnd.cpp | 1 - udav_new.png | Bin 0 -> 16129 bytes utils/CMakeLists.txt | 14 +- utils/make_pas.cpp | 4 +- utils/mglconv.cpp | 2 +- utils/mgltask.cpp | 205 +++--- utils/mglview.cpp | 2 +- widgets/fltk.cpp | 31 +- widgets/glut.cpp | 4 +- widgets/image.cpp | 2 +- widgets/image.h | 2 +- widgets/qt.cpp | 12 +- widgets/wx.cpp | 4 +- 346 files changed, 6757 insertions(+), 2912 deletions(-) create mode 100644 examples/test.c create mode 100644 examples/test.cpp create mode 100644 examples/test.f90 create mode 100644 examples/test.py create mode 100644 examples/test_fltk.cpp create mode 100644 src/random.cpp create mode 100644 udav_new.png diff --git a/CMakeLists.txt b/CMakeLists.txt index 52b41b0..136425d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,12 @@ cmake_minimum_required(VERSION 3.1.0) +if(POLICY CMP0078) + cmake_policy(SET CMP0078 OLD) +endif() +if(POLICY CMP0086) + cmake_policy(SET CMP0086 OLD) +endif() + project( MathGL2 ) set(mgl_clean_files ) @@ -16,10 +23,10 @@ endif(NOT CMAKE_BUILD_TYPE) set(CMAKE_VERBOSE_MAKEFILE ON) set(MathGL_VERSION_MAJOR 2) -set(MathGL_VERSION_MINOR 4) -set(MathGL_PATCH_VERSION 4) +set(MathGL_VERSION_MINOR 5) +set(MathGL_PATCH_VERSION 0) set(MathGL_VERSION ${MathGL_VERSION_MAJOR}.${MathGL_VERSION_MINOR}.${MathGL_PATCH_VERSION}) -set(MathGL_SOVERSION 7.5.0) +set(MathGL_SOVERSION 7.6.0) string(TIMESTAMP MathGL_DATE UTC) if(CMAKE_BUILD_TYPE STREQUAL "Debug") @@ -37,74 +44,77 @@ set(MathGL_INSTALL_LIB_DIR "lib" CACHE PATH "Installation directory for librarie set(MathGL_INSTALL_BIN_DIR "bin" CACHE PATH "Installation directory for executables") set(MathGL_INSTALL_INCLUDE_DIR "include" CACHE PATH "Installation directory for headers") if(WIN32 AND NOT CYGWIN) - set(DEF_INSTALL_CMAKE_DIR cmake) + set(DEF_INSTALL_CMAKE_DIR cmake) else() - set(DEF_INSTALL_CMAKE_DIR lib/cmake/mathgl) + set(DEF_INSTALL_CMAKE_DIR lib/cmake/mathgl2) endif() set(MathGL_INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files") # Make relative paths absolute (needed later on) foreach(p LIB BIN INCLUDE CMAKE) - set(var MathGL_INSTALL_${p}_DIR) - if(NOT IS_ABSOLUTE "${${var}}") - set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}") - endif() + set(var MathGL_INSTALL_${p}_DIR) + if(NOT IS_ABSOLUTE "${${var}}") + set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}") + endif() endforeach() macro(mgl_po_src) - set(l_files ) - foreach(src_file ${ARGN}) - get_filename_component(fp ${src_file} ABSOLUTE) - file(RELATIVE_PATH rel ${CMAKE_SOURCE_DIR} ${fp}) - list(APPEND l_files "${rel}") - endforeach(src_file ${ARGN}) - set(po_files ${po_files} ${l_files} PARENT_SCOPE) + set(l_files ) + foreach(src_file ${ARGN}) + get_filename_component(fp ${src_file} ABSOLUTE) + file(RELATIVE_PATH rel ${CMAKE_SOURCE_DIR} ${fp}) + list(APPEND l_files "${rel}") + endforeach(src_file ${ARGN}) + set(po_files ${po_files} ${l_files} PARENT_SCOPE) endmacro(mgl_po_src) function(mgl_add_lib mgl_tmp_lib) - if(${mgl_tmp_lib} MATCHES mgl) - set(mgllib mgl) - set(mgllib2 mgl2) - else(${mgl_tmp_lib} MATCHES mgl) - set(mgllib mgl-${mgl_tmp_lib}) - set(mgllib2 mgl2-${mgl_tmp_lib}) - endif(${mgl_tmp_lib} MATCHES mgl) - set(mgl_src_lst ${ARGV}) - list(REMOVE_AT mgl_src_lst 0) - add_library(${mgllib} SHARED ${mgl_src_lst}) - add_library(${mgllib}-static STATIC ${mgl_src_lst}) - set_target_properties(${mgllib} PROPERTIES SOVERSION ${MathGL_SOVERSION}) - set_target_properties(${mgllib} PROPERTIES DEFINE_SYMBOL "mgl_EXPORTS") - set_target_properties(${mgllib} PROPERTIES C_VISIBILITY_PRESET hidden) - set_target_properties(${mgllib} PROPERTIES CXX_VISIBILITY_PRESET hidden) - set_target_properties(${mgllib} PROPERTIES VISIBILITY_INLINES_HIDDEN 1) - target_compile_definitions(${mgllib}-static PUBLIC MGL_STATIC_DEFINE) - if(MSVC) - set(mgl_lib_static "-static") - if(CMAKE_BUILD_TYPE STREQUAL "Debug") - set(mgl_lib_end "d") - else(CMAKE_BUILD_TYPE STREQUAL "Debug") - set(mgl_lib_end) - endif(CMAKE_BUILD_TYPE STREQUAL "Debug") - elseif(MSVC) - set(mgl_lib_static) - set_target_properties(${mgllib} PROPERTIES CLEAN_DIRECT_OUTPUT 1) - set_target_properties(${mgllib}-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) - endif(MSVC) - if(enable-mgl2) - set_target_properties(${mgllib} PROPERTIES OUTPUT_NAME "${mgllib2}${mgl_lib_end}") - set_target_properties(${mgllib}-static PROPERTIES OUTPUT_NAME "${mgllib2}${mgl_lib_static}${mgl_lib_end}") - else(enable-mgl2) - set_target_properties(${mgllib} PROPERTIES OUTPUT_NAME "${mgllib}${mgl_lib_end}") - set_target_properties(${mgllib}-static PROPERTIES OUTPUT_NAME "${mgllib}${mgl_lib_static}${mgl_lib_end}") - endif(enable-mgl2) - - install( - TARGETS ${mgllib} ${mgllib}-static - EXPORT MathGLTargets - RUNTIME DESTINATION ${MathGL_INSTALL_BIN_DIR} - ARCHIVE DESTINATION ${MathGL_INSTALL_LIB_DIR} - LIBRARY DESTINATION ${MathGL_INSTALL_LIB_DIR} - ) + if(${mgl_tmp_lib} MATCHES mgl) + set(mgllib mgl) + set(mgllib2 mgl2) + else(${mgl_tmp_lib} MATCHES mgl) + set(mgllib mgl-${mgl_tmp_lib}) + set(mgllib2 mgl2-${mgl_tmp_lib}) + endif(${mgl_tmp_lib} MATCHES mgl) + set(mgl_src_lst ${ARGV}) + list(REMOVE_AT mgl_src_lst 0) + add_library(${mgllib} SHARED ${mgl_src_lst}) + add_library(${mgllib}-static STATIC ${mgl_src_lst}) + set_target_properties(${mgllib} PROPERTIES SOVERSION ${MathGL_SOVERSION}) + set_target_properties(${mgllib} PROPERTIES DEFINE_SYMBOL "mgl_EXPORTS") + set_target_properties(${mgllib} PROPERTIES C_VISIBILITY_PRESET hidden) + set_target_properties(${mgllib} PROPERTIES CXX_VISIBILITY_PRESET hidden) + set_target_properties(${mgllib} PROPERTIES VISIBILITY_INLINES_HIDDEN 1) + target_compile_definitions(${mgllib}-static PUBLIC MGL_STATIC_DEFINE) + if(MSVC) + set(mgl_lib_static "-static") + set (CMAKE_DEBUG_POSTFIX "d") + set_target_properties(${mgllib} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) + set_target_properties(${mgllib}-static PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) +# if(CMAKE_BUILD_TYPE STREQUAL "Debug") +# set(mgl_lib_end "d") +# else(CMAKE_BUILD_TYPE STREQUAL "Debug") +# set(mgl_lib_end) +# endif(CMAKE_BUILD_TYPE STREQUAL "Debug") + elseif(MSVC) + set(mgl_lib_static) + set_target_properties(${mgllib} PROPERTIES CLEAN_DIRECT_OUTPUT 1) + set_target_properties(${mgllib}-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) + endif(MSVC) + if(enable-mgl2) + set_target_properties(${mgllib} PROPERTIES OUTPUT_NAME "${mgllib2}${mgl_lib_end}") + set_target_properties(${mgllib}-static PROPERTIES OUTPUT_NAME "${mgllib2}${mgl_lib_static}${mgl_lib_end}") + else(enable-mgl2) + set_target_properties(${mgllib} PROPERTIES OUTPUT_NAME "${mgllib}${mgl_lib_end}") + set_target_properties(${mgllib}-static PROPERTIES OUTPUT_NAME "${mgllib}${mgl_lib_static}${mgl_lib_end}") + endif(enable-mgl2) + + install( + TARGETS ${mgllib} ${mgllib}-static + EXPORT MathGLTargets + RUNTIME DESTINATION ${MathGL_INSTALL_BIN_DIR} + ARCHIVE DESTINATION ${MathGL_INSTALL_LIB_DIR} + LIBRARY DESTINATION ${MathGL_INSTALL_LIB_DIR} + ) endfunction(mgl_add_lib mgl_tmp_lib) MACRO(MGL_DEPENDENT_OPTION option doc default depends1 force1 depends2 force2) @@ -200,13 +210,18 @@ MGL_DEPENDENT_OPTION(enable-hdf4 "Enable hdf4 support" OFF "NOT enable-lgpl" ON MGL_DEPENDENT_OPTION(enable-hdf5 "Enable hdf5 support" OFF "NOT enable-lgpl" ON "NOT enable-all" ON) CMAKE_DEPENDENT_OPTION(enable-pdf "Enable pdf support" OFF "NOT enable-all" ON) CMAKE_DEPENDENT_OPTION(enable-gif "Enable gif support" OFF "NOT enable-all" ON) +CMAKE_DEPENDENT_OPTION(enable-arma "Enable Armadillo support" OFF "NOT enable-all" ON) CMAKE_DEPENDENT_OPTION(enable-glut "Enable glut support" OFF "NOT enable-all-widgets" ON) CMAKE_DEPENDENT_OPTION(enable-fltk "Enable fltk widget" OFF "NOT enable-all-widgets" ON) CMAKE_DEPENDENT_OPTION(enable-wx "Enable wxWidget widget" OFF "NOT enable-all-widgets" ON) -CMAKE_DEPENDENT_OPTION(enable-qt4 "Enable Qt4 widget" OFF "NOT enable-all-widgets" ON) +CMAKE_DEPENDENT_OPTION(enable-qt "Enable Qt4 and/or Qt5 widget(s)" OFF "NOT enable-all-widgets" ON) +option(enable-qt4 "Enable Qt4 widget" OFF) CMAKE_DEPENDENT_OPTION(enable-qt4asqt "Set Qt4 as default libmgl-qt" OFF "enable-qt4" OFF) -CMAKE_DEPENDENT_OPTION(enable-qt5 "Enable Qt5 widget" OFF "NOT enable-all-widgets" ON) +option(enable-qt5 "Enable Qt5 widget" OFF) CMAKE_DEPENDENT_OPTION(enable-qt5asqt "Set Qt5 as default libmgl-qt" OFF "enable-qt5" OFF) +CMAKE_DEPENDENT_OPTION(enable-freetype "Enable freetype support" OFF "NOT enable-all" ON) +set(PY3VERSION_DOTTED "3.8" CACHE STRING "Used python version") +string(REPLACE "." "" PY3VERSION_NODOT ${PY3VERSION_DOTTED}) # msvc fwprintf print char* for the specifier of "%s" format if(MSVC AND MSVC_VERSION GREATER 1899) @@ -227,6 +242,19 @@ if(${CMAKE_SIZEOF_VOID_P} EQUAL 4) unset(CMAKE_REQUIRED_FLAGS) endif(${CMAKE_SIZEOF_VOID_P} EQUAL 4) +if(enable-qt) + FIND_PACKAGE(Qt4 4.8) + if(Qt4_FOUND) + set(enable-qt4 ON) + find_package(Qt5 COMPONENTS Widgets) + if(Qt5Widgets_FOUND) + set(enable-qt5 ON) + endif(Qt5Widgets_FOUND) + else(Qt4_FOUND) + set(enable-qt5 ON) + endif(Qt4_FOUND) +endif(enable-qt) + if(enable-qt4 OR enable-qt5) set(QT_ENABLED ON) if(enable-qt4asqt AND enable-qt5asqt) @@ -403,18 +431,31 @@ else(enable-pthr-widget OR enable-pthread) set(MGL_HAVE_PTHREAD 0) endif(enable-pthr-widget OR enable-pthread) +if(enable-arma) + find_package(Armadillo) + if(ARMADILLO_FOUND) + set(MGL_HAVE_ARMA 1) + else(ARMADILLO_FOUND) + set(MGL_HAVE_ARMA 0) + endif(ARMADILLO_FOUND) +else(enable-arma) + set(MGL_HAVE_ARMA 0) +endif(enable-arma) + + if(enable-openmp) - find_package(OpenMP) - if(OPENMP_FOUND) - set(MGL_HAVE_OMP 1) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") - else(OPENMP_FOUND) - message(SEND_ERROR "Couldn't find OpenMP. You can enable POSIX threads instead.") - set(MGL_HAVE_OMP 0) - endif(OPENMP_FOUND) + find_package(OpenMP) + if(OPENMP_FOUND) + set(MGL_HAVE_OMP 1) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + set (MGL_DEP_LIBS OpenMP::OpenMP_CXX ${MGL_DEP_LIBS}) + else(OPENMP_FOUND) + message(SEND_ERROR "Couldn't find OpenMP. You can enable POSIX threads instead.") + set(MGL_HAVE_OMP 0) + endif(OPENMP_FOUND) else(enable-openmp) - set(MGL_HAVE_OMP 0) + set(MGL_HAVE_OMP 0) endif(enable-openmp) if(enable-gsl) @@ -483,10 +524,17 @@ if(enable-hdf5) message(SEND_ERROR "Couldn't find HDF5 library.") endif(NOT HDF5_FOUND) endif(NOT HDF5_FOUND) + + string(REPLACE "." ";" HDF_VERSION_LIST ${HDF5_VERSION}) + list(GET HDF_VERSION_LIST 0 HDF_VERSION_MAJOR) + list(GET HDF_VERSION_LIST 1 HDF_VERSION_MINOR) + set(MGL_DEP_LIBS ${HDF5_LIBRARIES} ${HDF5_C_SHARED_LIBRARY} ${MGL_DEP_LIBS}) include_directories(${HDF5_INCLUDE_DIRS}) else(enable-hdf5) set(MGL_HAVE_HDF5 0) + set(HDF_VERSION_MAJOR 0) + set(HDF_VERSION_MINOR 0) endif(enable-hdf5) if(enable-jpeg) @@ -514,6 +562,18 @@ else(enable-zlib) set(MGL_HAVE_ZLIB 0) endif(enable-zlib) +if(enable-freetype) + set(MGL_HAVE_FREETYPE 1) + include(FindFreetype) + if(NOT FREETYPE_FOUND) + message(SEND_ERROR "Couldn't find FreeType library.") + endif(NOT FREETYPE_FOUND) + set(MGL_DEP_LIBS ${FREETYPE_LIBRARIES} ${MGL_DEP_LIBS}) + include_directories(${FREETYPE_INCLUDE_DIRS}) +else(enable-freetype) + set(MGL_HAVE_FREETYPE 0) +endif(enable-freetype) + if(enable-png) set(MGL_HAVE_PNG 1) if(NOT MGL_HAVE_ZLIB) diff --git a/ChangeLog.txt b/ChangeLog.txt index 784be90..54ec6e1 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,30 @@ +2.5 Released 8 December 2021 + +* Add 'keep' for keeping the data phase/sign or value along line i and j in given direction +* Add functions 'sum', 'prod' at formula evaluation, like "sum(_i^2,5)" will produce "30"=0+1^2+2^2+3^2+4^2, and "prod(1+_i,5)" will produce 5!="120". You can nest them for variables _i,_j,...,_z, like "sum(sum(_j+_i^2,5),5)" will give "200". +* Add functions 'value', 'spline' at formula evaluation, like "value(a,5)" will give value of 6-th element of a, i.e. a[5]. +* Add user-defined functions fn1()...fn9() at formula evaluation, like "fn1(3)\x^_1" will produce "x^3". +* Add mglODEs() (i.e. 'ode') for solving PDE/cascade/etc: ode res 'eqs' 'vars' 'bnd_kind' ini [dt tmax]. Here 'eqs' may contain relative pointer, like 'u(j+1)-2*u(j)+u(j-1)', and can be complex. Variables have 'j' for current index, 't' for current time. +* Add 'lines' to draw a set of lines with arrows between points. +* Add 'dcont' to draw a set of curves, which are intersection of two isosurfaces at given level. +* Add 'first', 'last' to get array of first/last indexes of values larger specified one along given direction. +* Add 'bernoulli', 'binomial', 'brownian', 'discrete', 'exponential', 'gaussian', 'shuffle', 'uniform', 'uniformint' for data filling by random numbers with different distributions. +* Add 'readbin' to read data from binary files. +* Add 'texparse' to enable/disable TeX-like command parsing at text output. +* Update ODE: regularization is used if dt*tmax<0 (total time may differ, but number of steps still the same). +* Add mgl_default_graph() -- the global (default) pointer to HMGL for keeping plot settings, simplifying external scripts and capture it in GUI. +* Add style 'p' in command 'smooth' to use parabolic smoothing of arbitrary points. +* Allow 'background' for scaling image, centering image and tessellate image as mosaic. +* Allow filling 'background' by the specified color. +* Allow masks for 'candle', 'area', 'region', 'bars', 'barh', 'chart', 'tape', 'face', 'polygon', 'ellipse', 'rhomb'. +* Allow single value specification for contour level in 'cont', 'tricont', 'contd', 'contp', 'contv', 'tricontv', 'cont3', 'dcont'. +* Add mgl_dual_save_hdf(), mgl_real_save_hdf(), mgl_int_save_hdf() for saving single number in HDF5 file. Correspondingly, commands 'save' and 'savehdf' can save single value now. +* Add mgl_formula_calc(), mgl_formula_calc_c() for evaluating textual formulas of arbitrary set of data arrays. +* Add mglDataList -- global mglDataA* collection for viewing/changing in GUI data from external languages (like, Python, ...). +* Add Armadillo interface for mglData and mglDataC. +* If nsub parameter of command 'hist' is negative (nsub<0) then the linear interpolation is used instead of spline one. +* Add dark text colors for mgllab. + 2.4.4 Released 8 July 2019 * mglData now have operator() which work as SubData() function. diff --git a/emblem.mgl b/emblem.mgl index a3f2473..8915bc1 100644 --- a/emblem.mgl +++ b/emblem.mgl @@ -31,6 +31,8 @@ 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' +write 'emplem.jpg' + stop cut 0 -1 -1 1 0 1.1 surf3 a -1 'BbcyrR' diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 7c25819..0263910 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,3 +1,4 @@ +file(COPY ${CMAKE_SOURCE_DIR}/udav_new.png DESTINATION ${CMAKE_BINARY_DIR}/examples) file(COPY ${CMAKE_SOURCE_DIR}/examples/iris.dat DESTINATION ${CMAKE_BINARY_DIR}/examples) file(COPY ${CMAKE_SOURCE_DIR}/examples/Equirectangular-projection.jpg DESTINATION ${CMAKE_BINARY_DIR}/examples) file(COPY ${CMAKE_SOURCE_DIR}/examples/samples.cpp DESTINATION ${CMAKE_BINARY_DIR}/examples) diff --git a/examples/fltk_example.cpp b/examples/fltk_example.cpp index 9dc8db3..87f1286 100644 --- a/examples/fltk_example.cpp +++ b/examples/fltk_example.cpp @@ -18,6 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "mgl2/fltk.h" +#include //----------------------------------------------------------------------------- #if defined(WIN32) || defined(_MSC_VER) || defined(__BORLANDC__) #include @@ -32,6 +33,7 @@ void long_calculations() // just delay which correspond to simulate calculations sleep(1); // which can be very long #endif } +#define PTHREAD_SAMPLE3 //----------------------------------------------------------------------------- #if defined(PTHREAD_SAMPLE1) // first variant of multi-threading usage of mglFLTK window mglFLTK *gr=NULL; @@ -51,11 +53,11 @@ void *calc(void *) gr->Update(); // update window } } - exit(0); + exit(0); return NULL; } int main(int argc,char **argv) { - mgl_textdomain(argv?argv[0]:NULL); + mgl_textdomain(argv?argv[0]:NULL,""); static pthread_t thr; pthread_create(&thr,0,calc,0); pthread_detach(thr); @@ -66,7 +68,7 @@ int main(int argc,char **argv) mglPoint pnt; // some global variable for changeable data int main(int argc,char **argv) { - mgl_textdomain(argv?argv[0]:NULL); + mgl_textdomain(argv?argv[0]:NULL,""); mglFLTK gr("test"); gr.RunThr(); // <-- need MathGL version which use pthread for(int i=0;i<10;i++) // do calculation @@ -81,6 +83,34 @@ int main(int argc,char **argv) } return 0; // finish calculations and close the window } +#elif defined(PTHREAD_SAMPLE3) // another variant of multi-threading usage of mglFLTK window. Work only if pthread was enabled for MathGL +mglFLTK *gr=NULL; +void calc() +{ + mglPoint pnt; + for(int i=0;i<10;i++) // do calculation + { + long_calculations(); // which can be very long + pnt.Set(2*mgl_rnd()-1,2*mgl_rnd()-1); + if(gr) + { + gr->Clf(); // make new drawing + gr->Line(mglPoint(),pnt,"Ar2"); + char str[10] = "i=0"; str[2] = '0'+i; + gr->Puts(mglPoint(),str); + gr->Update(); // update window + } + } + exit(0); +} +int main(int argc,char **argv) +{ + mgl_textdomain(argv?argv[0]:NULL,""); +// static pthread_t thr; + std::thread(calc).detach(); + gr = new mglFLTK; + gr->Run(); return 0; +} #else // just default samples //----------------------------------------------------------------------------- int test_wnd(mglGraph *gr); diff --git a/examples/full_test.cpp b/examples/full_test.cpp index e7e1154..afb5e0d 100644 --- a/examples/full_test.cpp +++ b/examples/full_test.cpp @@ -74,11 +74,22 @@ void mgls_prepare3v(mglData *ex, mglData *ey, mglData *ez); void save(mglGraph *gr,const char *name,const char *suf); void test(mglGraph *gr) { +// gr->Box(); gr->WritePNG("1.png"); return; + mglParse par; - par.Execute(gr,"new f 100 'x^3':save f 'test.dat':axis:box:fplot ':test.dat:-1:1'"); - par.Execute(gr,"text 0 0 'ab' '@'"); + par.Execute(gr,"colorbar;size -2;crange 0 1;value 90"); +// par.Execute(gr,"fplot 'x';legend 'рус':legend"); +// par.Execute(gr,"fsurf 'x*y':rasterize:clf:fplot 'sin(x)' '2q':axis"); +// par.Execute(gr,"xrange 0 1:new x 10 '3*x':echo x\nnew a 10 'value([0,1,-1],3*x)':echo a\nnew b 10 'spline([0,1,-1],3*x)':echo b"); +// par.Execute(gr,"new a 1 'sum(_i^2,5)':echo a:new b 1 'prod(1+_i,5)':echo b\n" +// "new c 1 'dsum(_i,5)':echo c:new d 1 'sum(sum(_j+_i^2,5),5)':echo d"); +// par.Execute(gr,"define n 30\nnew a n n n 'x^2+y^2'\nnew b n n n 'z^4+2*x^4-2*y^4'\nrotate 40 60:box:axis\n" +// "dcont [0.5,0.5] a b '2k'\nlight on:alpha on\nsurf3 a 0.5 'r':surf3 b 0.5 'g'"); +// par.Execute(gr,"new f 100 'x^3':save f 'test.dat':axis:box:fplot ':test.dat:-1:1'"); +// par.Execute(gr,"text 0 0 'ab' '@'"); // par.Execute(gr,"new a 3 3 'x*y'\nsubplot 2 1 0 '':dens a:dens a 'k+/'\n" // "subplot 2 1 1 '':mask '+' 'ff00182424f800' 30:dens a '3+'"); + gr->WritePNG("1.png"); return; dual c(0,M_PI/2), r=mgl_ipowc(c,2); @@ -152,6 +163,18 @@ void mgl_generate_texi() fclose(fs); fclose(fp); fclose(fq); } +void mgl_generate_slides() +{ + FILE *fp = fopen("samples.tex","w"); + FILE *fs = fopen("samples.cpp","r"); + for(size_t i=0;samp[i].name && samp[i].name[0];i++) + { + fprintf(fp,"\n\\begin{frame}[fragile]{Пример \\href{http://mathgl.sourceforge.net/doc_en/%s-sample.html}{\\texttt{%s}}}\n%s\n", samp[i].name, samp[i].name, samp[i].info); + fprintf(fp,"\\begin{center}\n\\includegraphics[width=0.7\\linewidth]{png/%s}\n\\end{center}\n\\end{frame}\n", samp[i].name); + } + fclose(fp); fclose(fs); +} + static struct option longopts[] = { { "big", no_argument, &big, 1 }, @@ -343,7 +366,7 @@ int main(int argc,char **argv) default: usage(); return 0; } - if(dotest==1) printf("Global (before):%s\n",mglGlobalMess.c_str()); + if(dotest==1) printf("Global (before):%s\n",mgl_get_global_warn()); gr = new mglGraph; if( type==11|| type==12|| type==5 || type==9) width=height; switch(big) @@ -367,7 +390,7 @@ int main(int argc,char **argv) gr->WriteSVG("test.svg"); gr->WriteEPS("test.eps"); printf("Messages:%s\n",gr->Message()); - printf("Global:%s\n",mglGlobalMess.c_str()); + printf("Global:%s\n",mgl_get_global_warn()); delete gr; return 0; } else if(dotest==2) // NOTE mgl_gen_fnt[###][6] have to be updated if new glyphs will be added to built-in font @@ -396,6 +419,7 @@ int main(int argc,char **argv) clock_t beg,end; while(s->name[0]) // all samples { + if(!strcmp(s->name,"icon")) { s++; continue; } char *buf = new char[strlen(s->mgl)+ll]; strcpy(buf,s->mgl); strcat(buf,mmgl_dat_prepare); fprintf(fp,"\n@item %s",s->name); @@ -410,7 +434,7 @@ int main(int argc,char **argv) else par.Execute(gr,buf); gr->Finish(); end = clock(); - fprintf(fp," @tab %.3g",double(end-beg)/CLOCKS_PER_SEC); + fprintf(fp," @tab %.2g",double(end-beg)/CLOCKS_PER_SEC); printf("\t%d->%g",qual[i],double(end-beg)/CLOCKS_PER_SEC); fflush(fp); fflush(stdout); } @@ -427,6 +451,7 @@ int main(int argc,char **argv) } else if(dotest==6) { + mgl_generate_slides(); mgl_generate_texi(); delete gr; return 0; } @@ -439,6 +464,7 @@ int main(int argc,char **argv) { while(s->name[0]) // all samples { + if(!strcmp(s->name,"icon")) { s++; continue; } gr->DefaultPlotParam(); gr->Clf(); if(use_mgl) { diff --git a/examples/glut_example.cpp b/examples/glut_example.cpp index 07a70f5..54c5239 100644 --- a/examples/glut_example.cpp +++ b/examples/glut_example.cpp @@ -56,7 +56,7 @@ printf("i=%d, gr=%p\n",i,gr); fflush(stdout); } int main(int argc,char **argv) { - mgl_textdomain(argv?argv[0]:NULL); + mgl_textdomain(argv?argv[0]:NULL,""); static pthread_t thr; pthread_create(&thr,0,calc,0); pthread_detach(thr); diff --git a/examples/qt_example.cpp b/examples/qt_example.cpp index c27b101..9afdf37 100644 --- a/examples/qt_example.cpp +++ b/examples/qt_example.cpp @@ -55,7 +55,7 @@ void *calc(void *) } int main(int argc,char **argv) { - mgl_textdomain(argv?argv[0]:NULL); + mgl_textdomain(argv?argv[0]:NULL,""); static pthread_t thr; pthread_create(&thr,0,calc,0); pthread_detach(thr); @@ -88,7 +88,7 @@ int Foo::Draw(mglGraph *gr) } int main(int argc,char **argv) { - mgl_textdomain(argv?argv[0]:NULL); + mgl_textdomain(argv?argv[0]:NULL,""); Foo *foo = new Foo; mglQT gr(foo,"MathGL examples"); foo->Gr = &gr; diff --git a/examples/samples.cpp b/examples/samples.cpp index c49e49e..71f8ecb 100644 --- a/examples/samples.cpp +++ b/examples/samples.cpp @@ -837,6 +837,21 @@ void smgl_fonts(mglGraph *gr) // font typefaces gr->LoadFont(""); } //----------------------------------------------------------------------------- +const char *mmgl_background="define $f udav_new.png\n#background '$f' 's'\n" +"subplot 2 2 0 '':box\nbackground '$f' 'a'\ntext 0.5 0.1 'Default' 'a'\n" +"subplot 2 2 1 '':box\nbackground '$f' 'ca'\ntext 0.5 0.1 'Centering' 'a'\n" +"subplot 2 2 2 '':box\nbackground '$f' 'ma'\ntext 0.5 0.1 'Mosaic' 'a'\n" +"subplot 2 2 3 '':box\nbackground '$f' 'sa'\ntext 0.5 0.1 'Scaling' 'a'"; +void smgl_background(mglGraph *gr) +{ + const char *fname = "udav_new.png"; + gr->SubPlot(2,2,0,""); gr->Box(); gr->LoadBackground(fname,"a"); gr->Puts(0.5,0.1,"Default","a"); + gr->SubPlot(2,2,1,""); gr->Box(); gr->LoadBackground(fname,"ca"); gr->Puts(0.5,0.1,"Centering","a"); + gr->SubPlot(2,2,2,""); gr->Box(); gr->LoadBackground(fname,"ma"); gr->Puts(0.5,0.1,"Mosaic","a"); + gr->SubPlot(2,2,3,""); gr->Box(); gr->LoadBackground(fname,"sa"); gr->Puts(0.5,0.1,"Scaling","a"); + //gr->LoadBackground(fname,"s"); +} +//----------------------------------------------------------------------------- const char *mmgl_bars="new ys 10 3 '0.8*sin(pi*(x+y/4+1.25))+0.2*rnd':origin 0 0 0\n" "subplot 3 2 0 '':title 'Bars plot (default)':box:bars ys\nsubplot 3 2 1 '':title '2 colors':box:bars ys 'cbgGyr'\n" "subplot 3 2 4 '':title '\"\\#\" style':box:bars ys '#'\n" @@ -1667,6 +1682,40 @@ void smgl_surf3ca(mglGraph *gr) gr->Box(); gr->Surf3CA(c,d,c); } //----------------------------------------------------------------------------- +const char *mmgl_dcont="call 'prepare3d'\ntitle 'DCont plot':rotate 50 60:light on:alpha on:box:surf3 c 0 'r':surf3 d 0 'b'\ndcont 0 c d '2k'"; +void smgl_dcont(mglGraph *gr) +{ + mglData c,d,v; mgls_prepare3d(&c,&d); + if(big!=3) gr->Title("DCont plot"); + gr->Rotate(50,60); gr->Light(true); gr->Alpha(true); + gr->Box(); gr->Surf3(0,c,"r"); gr->Surf3(0,d,"b"); + gr->DCont(v,c,d,"2k"); +} +//----------------------------------------------------------------------------- +const char *mmgl_daisy="title 'Advanced formulas'\nnew b 256 256 'dsum(fn1(_i*pi/5),10)\\exp(-64*(x*cos(_1)-y*sin(_1))^2-16*(0.5+y*cos(_1)+x*sin(_1))^2)'\ncrange b:dens b 'BbwrR'"; +void smgl_daisy(mglGraph *gr) +{ + if(big!=3) gr->Title("Advanced formulas"); + mglData b(256,256); + gr->Fill(b,"dsum(fn1(_i*pi/5),10)\\exp(-64*(x*cos(_1)-y*sin(_1))^2-16*(0.5+y*cos(_1)+x*sin(_1))^2)"); + gr->SetRange('c',b); gr->Dens(b,"BbwrR"); +} +//----------------------------------------------------------------------------- +const char *mmgl_keep="yrange 0 pi\nnew !a 100 300 'exp(-6*x^2+10i*(x+y^2))'" +"subplot 2 1 0 '':box\ndens real(a) 'BbwrR'\ntext 1.1 0.5 '\to' 'a'" +"keep a 'y' 50\nsubplot 2 1 1 '':box\ndens real(a) 'BbwrR'"; +void smgl_keep(mglGraph *gr) +{ + gr->SetRange('y',0,M_PI); + mglDataC a(100,300); gr->Fill(a,"exp(-6*x^2+10i*(x+y^2))"); + gr->SubPlot(2,1,0,""); gr->Box(); + gr->Dens(a.Real(),"BbwrR"); + gr->Puts(1.1,0.5,"\\to","a"); + a.Keep("y",50); + gr->SubPlot(2,1,1,""); gr->Box(); + gr->Dens(a.Real(),"BbwrR"); +} +//----------------------------------------------------------------------------- const char *mmgl_cut="call 'prepare2d'\ncall 'prepare3d'\nsubplot 2 2 0:title 'Cut on (default)':rotate 50 60:light on:box:surf a; zrange -1 0.5\n" "subplot 2 2 1:title 'Cut off':rotate 50 60:box:surf a; zrange -1 0.5; cut off\n" "subplot 2 2 2:title 'Cut in box':rotate 50 60:box:alpha on\ncut 0 -1 -1 1 0 1.1:surf3 c\ncut 0 0 0 0 0 0\t# restore back\n" @@ -1695,6 +1744,23 @@ void smgl_traj(mglGraph *gr) gr->Box(); gr->Plot(x,y); gr->Traj(x,y,y1,y2); } //----------------------------------------------------------------------------- +const char *mmgl_lines="subplot 1 1 0 '':title 'Lines plot'\n" +"new x1 11 '0.3*cos(pi*i/5)'\nnew y1 11 '0.3*sin(pi*i/5)'\nnew x2 11 '0.7*cos(pi*i/5)'\nnew y2 11 '0.7*sin(pi*i/5)'\nplot x1 y1\nlines x1 y1 x2 y2 '_A'"; +void smgl_lines(mglGraph *gr) +{ + mglData x1(11),y1(11),x2(11),y2(11); + for(long i=0;i<11;i++) + { + x1.a[i] = 0.3*cos(M_PI*i/5); + y1.a[i] = 0.3*sin(M_PI*i/5); + x2.a[i] = 0.7*cos(M_PI*i/5); + y2.a[i] = 0.7*sin(M_PI*i/5); + } + if(big!=3) {gr->SubPlot(1,1,0,""); gr->Title("Lines plot");} + gr->Plot(x1,y1); + gr->Lines(x1,y1,x2,y2,"_A"); +} +//----------------------------------------------------------------------------- const char *mmgl_mesh="call 'prepare2d'\ntitle 'Mesh plot':rotate 50 60:box:mesh a"; void smgl_mesh(mglGraph *gr) { @@ -1803,6 +1869,14 @@ void smgl_belt(mglGraph *gr) gr->Rotate(50,60); gr->Box(); gr->Belt(a); } //----------------------------------------------------------------------------- +const char *mmgl_beltc="call 'prepare2d'\ntitle 'BeltC plot':rotate 50 60:box:beltc a b"; +void smgl_beltc(mglGraph *gr) +{ + mglData a,b; mgls_prepare2d(&a,&b); + if(big!=3) gr->Title("BeltC plot"); + gr->Rotate(50,60); gr->Box(); gr->BeltC(a,b); +} +//----------------------------------------------------------------------------- const char *mmgl_dens="call 'prepare2d'\nnew a1 30 40 3 '0.6*sin(2*pi*x+pi*(z+1)/2)*sin(3*pi*y+pi*z) + 0.4*cos(3*pi*(x*y)+pi*(z+1)^2/2)'\n" "subplot 2 2 0 '':title 'Dens plot (default)':box:dens a\n" "subplot 2 2 1:title '3d variant':rotate 50 60:box:dens a\n" @@ -2845,6 +2919,26 @@ void smgl_ifs2d(mglGraph *gr) gr->Axis(); gr->Plot(f.SubData(0), f.SubData(1),"r#o ","size 0.05"); } //----------------------------------------------------------------------------- +const char *mmgl_icon="setsize 200 200\nzrange 0 2\n\ndefine $s 0.8\nnew x 200 '$s*(x+1)/2*sin(2*pi*x)'\n" +"new y 200 '$s*(x+1)/2*cos(2*pi*x)'\nnew z 200 '$s*(2-(x+1))+0.1'\n" +"new r 200 '0.02+0.07*(x+1)'\n\nsubplot 1 1 0 '#'\nfsurf 'v*cos(2*pi*u)' 'v*sin(2*pi*u)-0.05' 'v/2' 'Yyyww'\n" +"light on\nrotate 65 80\ntube x y z+0.15 r\ndefine $r 0.13\n" +"fsurf '0+$r*cos(2*pi*u)*cos(2*pi*v)' '0.03+$r*cos(2*pi*u)*sin(2*pi*v)' '2*$s+0.25+$r*sin(2*pi*u)' 'r'\n" +"define $r 0.155\nfsurf '$r*cos(2*pi*u)*cos(2*pi*v)' '$s+$r*cos(2*pi*u)*sin(2*pi*v)' '0.25+$r*sin(2*pi*u)' 'b'\n"; +void smgl_icon(mglGraph *gr) +{ + gr->SetSize(200,200); gr->SetRange('z',0,2); + mglData x(200); gr->Fill(x,"0.8*(x+1)/2*sin(2*pi*x)"); + mglData y(200); gr->Fill(y,"0.8*(x+1)/2*cos(2*pi*x)"); + mglData z(200); gr->Fill(z,"0.8*(2-(x+1))+0.25"); + mglData r(200); gr->Fill(r,"0.02+0.07*(x+1)"); + gr->SubPlot(1,1,0,"#"); + gr->FSurf("v*cos(2*pi*u)","v*sin(2*pi*u)-0.05","v/2","Yyyww"); + gr->Light(true); gr->Rotate(65,80); gr->Tube(x,y,z,r); + gr->FSurf("0.13*cos(2*pi*u)*cos(2*pi*v)","0.03+0.13*cos(2*pi*u)*sin(2*pi*v)","1.85+0.13*sin(2*pi*u)","r"); + gr->FSurf("0.155*cos(2*pi*u)*cos(2*pi*v)","0.8+0.155*cos(2*pi*u)*sin(2*pi*v)","0.25+0.155*sin(2*pi*u)","b"); +} +//----------------------------------------------------------------------------- const char *mmgl_ifs3d="list A [0,0,0,0,.18,0,0,0,0,0,0,0,.01] [.85,0,0,0,.85,.1,0,-0.1,0.85,0,1.6,0,.85]\\\n" "\t[.2,-.2,0,.2,.2,0,0,0,0.3,0,0.8,0,.07] [-.2,.2,0,.2,.2,0,0,0,0.3,0,0.8,0,.07]\n" "ifs3d f A 100000\ntitle 'IFS 3d sample':rotate 50 60\n" @@ -3342,26 +3436,29 @@ void all_prims(mglGraph *gr) // test drawing of all kinds //----------------------------------------------------------------------------- const char *mmgl_minmax="define $p 30\n" "new h 300 300 '-sqrt(1-x^2-y^2)*(3*x*y^2*$p-x^3*$p+6*y)/(3*sqrt(2))+x*y+(y^2+x^2)*$p/3 -7*(y^2+x^2)^2*$p/24+y^2+3*x^2'\n" -"\nminmax e h\n\ncrange h:dens h:box\nfplot 'sin(2*pi*t)' 'cos(2*pi*t)' '0' 'k'\nplot e(0)*2-1 e(1)*2-1 '. c'"; +"\nminmax e h\nsubplot 1 1 0 '':title 'MinMax sample'\ncrange h:dens h:box\n" +"fplot 'sin(2*pi*t)' 'cos(2*pi*t)' '0' 'k'\nplot e(0)*2-1 e(1)*2-1 '. c'"; void smgl_minmax(mglGraph *gr) // test minmax { mglData h(300,300); gr->Fill(h,"-sqrt(1-x^2-y^2)*(3*x*y^2*30-x^3*30+6*y)/(3*sqrt(2))+x*y+(y^2+x^2)*10 -7*(y^2+x^2)^2*30/24+y^2+3*x^2"); mglData e=h.MinMax(); + if(big!=3) { gr->SubPlot(1,1,0,""); gr->Title("MinMax sample"); } gr->SetRange('c',h); gr->Dens(h); gr->Box(); gr->FPlot("sin(2*pi*t)","cos(2*pi*t)","0","k"); e*=2; e-=1; -// for(long i=0;iPlot(e(0),e(1),". c"); } //----------------------------------------------------------------------------- -const char *mmgl_conts="new a 10 10 'sin(2*pi*x*y)'\nrotate 40 60\n" +const char *mmgl_conts="new a 10 10 'sin(2*pi*x*y)'\ntitle 'Conts sample':rotate 40 60:box\n" "dens a '#'\ncont [0,0] a 'r'\nconts r 0 a\nplot 2*r(0)-1 2*r(1)-1 1+r(2) '2c'"; void smgl_conts(mglGraph *gr) // test conts { mglData a(10,10); gr->Fill(a,"sin(2*pi*x*y)"); mglData v, r=a.Conts(0); - gr->Rotate(40,60); gr->Dens(a,"#"); gr->Cont(v,a,"r"); + if(big!=3) { gr->Title("Conts sample"); } + gr->Rotate(40,60); gr->Box(); + gr->Dens(a,"#"); gr->Cont(v,a,"r"); mglData x(r.ny),y(r.ny),z(r.ny); for(long i=0;iPlot(x,y,z,"2c"); @@ -3454,9 +3551,11 @@ mglSample samp[] = { {"aspect", smgl_aspect, mmgl_aspect, "Example of @ref{subplot}, @ref{inplot}, @ref{rotate}, @ref{aspect}, @ref{shear}."}, {"axial", smgl_axial, mmgl_axial, "Function @ref{axial} draw surfaces of rotation for contour lines. You can draw wire surfaces (@samp{#} style) or ones rotated in other directions (@samp{x}, @samp{z} styles)."}, {"axis", smgl_axis, mmgl_axis, "Different forms of @ref{axis} position."}, + {"background", smgl_background, mmgl_background, "Load @ref{background} from an image file."}, {"barh", smgl_barh, mmgl_barh, "Function @ref{barh} is the similar to @ref{bars} but draw horizontal bars."}, {"bars", smgl_bars, mmgl_bars, "Function @ref{bars} draw vertical bars. It have a lot of options: bar-above-bar (@samp{a} style), fall like (@samp{f} style), 2 colors for positive and negative values, wired bars (@samp{#} style), 3D variant."}, {"belt", smgl_belt, mmgl_belt, "Function @ref{belt} draw surface by belts. You can use @samp{x} style for drawing lines in other direction."}, + {"beltc", smgl_beltc, mmgl_beltc, "Function @ref{beltc} draw surface by belts. You can use @samp{x} style for drawing lines in other direction."}, {"bifurcation", smgl_bifurcation, mmgl_bifurcation, "Function @ref{bifurcation} draw Bifurcation diagram for multiple stationary points of the map (like logistic map)."}, {"box", smgl_box, mmgl_box, "Different styles of bounding @ref{box}."}, {"boxplot", smgl_boxplot, mmgl_boxplot, "Function @ref{boxplot} draw box-and-whisker diagram."}, @@ -3480,10 +3579,12 @@ mglSample samp[] = { // {"crust", smgl_crust, mmgl_crust, ""}, // TODO: open after triangulation {"curvcoor", smgl_curvcoor, mmgl_curvcoor, "Some common curvilinear coordinates."}, {"cut", smgl_cut, mmgl_cut, "Example of point cutting (@ref{cut}."}, + {"daisy", smgl_daisy, mmgl_daisy, "Example of subfunctions and summation in textual formulas."}, {"dat_diff", smgl_dat_diff, mmgl_dat_diff, "Example of @ref{diff} and @ref{integrate}."}, {"dat_extra", smgl_dat_extra, mmgl_dat_extra , "Example of @ref{envelop}, @ref{sew}, @ref{smooth} and @ref{resize}."}, {"data1", smgl_data1, mmgl_data1, ""}, {"data2", smgl_data2, mmgl_data2, ""}, + {"dcont", smgl_dcont, mmgl_dcont, "Function @ref{dcont} draw lines of intersections of two isosurfaces."}, {"dens", smgl_dens, mmgl_dens, "Function @ref{dens} draw density plot (also known as color-map) for surface."}, {"dens3", smgl_dens3, mmgl_dens3, "Function @ref{dens3} draw ordinary density plots but at slices of 3D data."}, {"dens_xyz", smgl_dens_xyz, mmgl_dens_xyz, "Functions @ref{densz}, @ref{densy}, @ref{densx} draw density plot on plane perpendicular to corresponding axis. One of possible application is drawing projections of 3D field."}, @@ -3506,15 +3607,18 @@ mglSample samp[] = { {"fonts", smgl_fonts, mmgl_fonts, "Example of @ref{font} typefaces."}, {"grad", smgl_grad, mmgl_grad, "Function @ref{grad} draw gradient lines for matrix."}, {"hist", smgl_hist, mmgl_hist, "Example of @ref{hist} (histogram)."}, + {"icon", smgl_icon, mmgl_icon, "Default UDAV and mgllab icon."}, {"ifs2d", smgl_ifs2d, mmgl_ifs2d, "Function @ref{ifs2d} generate points for fractals using iterated function system in 2d case."}, {"ifs3d", smgl_ifs3d, mmgl_ifs3d, "Function @ref{ifs3d} generate points for fractals using iterated function system in 3d case."}, {"indirect",smgl_indirect,mmgl_indirect, "Comparison of @ref{subdata} vs @ref{evaluate}/"}, {"inplot", smgl_inplot, mmgl_inplot, "Example of @ref{inplot}, @ref{multiplot}, @ref{columnplot}, @ref{gridplot}, @ref{shearplot}, @ref{stickplot}."}, {"iris", smgl_iris, mmgl_iris, "Function @ref{iris} draw Iris plot for columns of data array."}, + {"keep", smgl_keep, mmgl_keep, "Function @ref{keep} conserve initial phase along specified direction(s)."}, {"label", smgl_label, mmgl_label, "Function @ref{label} print text at data points. The string may contain @samp{%x}, @samp{%y}, @samp{%z} for x-, y-, z-coordinates of points, @samp{%n} for point index."}, {"lamerey", smgl_lamerey, mmgl_lamerey, "Function @ref{lamerey} draw Lamerey diagram."}, {"legend", smgl_legend, mmgl_legend , "Example of @ref{legend} styles."}, {"light", smgl_light, mmgl_light, "Example of @ref{light} with different types."}, + {"lines", smgl_lines, mmgl_lines, "Function @ref{lines} draw a set of lines."}, {"loglog", smgl_loglog, mmgl_loglog, "Example of log- and log-log- axis labels."}, {"map", smgl_map, mmgl_map, "Example of @ref{map}."}, {"mark", smgl_mark, mmgl_mark, "Example of @ref{mark}."}, diff --git a/examples/test.c b/examples/test.c new file mode 100644 index 0000000..24fbc33 --- /dev/null +++ b/examples/test.c @@ -0,0 +1,19 @@ +// gcc test.c -lmgl +#include +int main() +{ + HMDT dat = mgl_create_data_size(30,40,1); // data to for plotting + for(long i=0;i<30;i++) for(long j=0;j<40;j++) + mgl_data_set_value(dat, 1/(1+(i-15)*(i-15)/9.+(j-20)*(j-20)/16.),i,j,0); + HMGL gr = mgl_create_graph(600, 400); // class for plot drawing + mgl_set_ranges(gr,0,2,0,2,0,1); // ranges of coordinates + mgl_rotate(gr,50,60,0); // rotate axis + mgl_set_light(gr,1); // enable lighting + mgl_surf(gr,dat,"",""); // plot surface + mgl_cont(gr,dat,"y",""); // plot yellow contour lines + mgl_axis(gr,"xyzt","",""); // draw axis + mgl_puts(gr,1,1,1.2,"\\i f = \\dfrac{1}{1+(5x-5)^2+(5y-5)^2}","",-1); + mgl_write_frame(gr,"sample.png",""); // save it + mgl_delete_data(dat); // free used memory + mgl_delete_graph(gr); +} diff --git a/examples/test.cpp b/examples/test.cpp new file mode 100644 index 0000000..39248db --- /dev/null +++ b/examples/test.cpp @@ -0,0 +1,17 @@ +// g++ test.cpp -lmgl +#include +int main() +{ + mglData dat(30,40); // data to for plotting + for(long i=0;i<30;i++) for(long j=0;j<40;j++) + dat.a[i+30*j] = 1/(1+(i-15)*(i-15)/9.+(j-20)*(j-20)/16.); + mglGraph gr; // class for plot drawing + gr.SetRanges(0,2,0,2,0,1); // ranges of coordinates + gr.Rotate(50,60); // rotate axis + gr.Light(true); // enable lighting + gr.Surf(dat); // plot surface + gr.Cont(dat,"y"); // plot yellow contour lines + gr.Axis(); // draw axis + gr.Puts(mglPoint(1,1,1.2),"\\i f = \\dfrac{1}{1+(5x-5)^2+(5y-5)^2}"); + gr.WriteFrame("sample.png"); // save it +} diff --git a/examples/test.f90 b/examples/test.f90 new file mode 100644 index 0000000..4101ea1 --- /dev/null +++ b/examples/test.f90 @@ -0,0 +1,24 @@ +! gfortran test.f90 -lmgl -fdefault-real-8 +program test +integer(8) :: dat, gr, mgl_create_data_size, mgl_create_graph +real(8) :: v +dat = mgl_create_data_size(30,40,1) ! data to for plotting +do i=0,29 + do j=0, 39 + v = 1/(1+(i-15)*(i-15)/9.+(j-20)*(j-20)/16.) + call mgl_data_set_value(dat, v,i,j,0) + end do +end do +gr = mgl_create_graph(600, 400) ! class for plot drawing +call mgl_set_ranges(gr,0.,2.,0.,2.,0.,1.) ! ranges of coordinates +call mgl_rotate(gr,50.,60.,0.) ! rotate axis +call mgl_set_light(gr,1) ! enable lighting +call mgl_surf(gr,dat,"","") ! plot surface +call mgl_cont(gr,dat,"y","") ! plot yellow contour lines +call mgl_axis(gr,"xyzt","","") ! draw axis +call mgl_puts(gr,1.,1.,1.2,"\i f = \dfrac{1}{1+(5x-5)^2+(5y-5)^2}","",-1.) +call mgl_write_frame(gr,"sample.png","") ! save it +call mgl_delete_data(dat) ! free used memory +call mgl_delete_graph(gr) +end program + diff --git a/examples/test.py b/examples/test.py new file mode 100644 index 0000000..2b31d1c --- /dev/null +++ b/examples/test.py @@ -0,0 +1,16 @@ +# python test.py +from mathgl import * +dat = mglData() # data to for plotting +dat.Create(30,40) +for i in range(0,30): + for j in range(0,40): + dat.SetVal(1/(1+(i-15)*(i-15)/9.+(j-20)*(j-20)/16.),i,j) +gr = mglGraph() # class for plot drawing +gr.SetRanges(0,2,0,2,0,1) # ranges of coordinates +gr.Rotate(50,60) # rotate axis +gr.Light(True) # enable lighting +gr.Surf(dat) # plot surface +gr.Cont(dat,"y") # plot yellow contour lines +gr.Axis() # draw axis +gr.Puts(mglPoint(1,1,1.2),"\i f = \dfrac{1}{1+(5x-5)^2+(5y-5)^2}") +gr.WriteFrame("sample.png") # save it diff --git a/examples/test_fltk.cpp b/examples/test_fltk.cpp new file mode 100644 index 0000000..3e45b4f --- /dev/null +++ b/examples/test_fltk.cpp @@ -0,0 +1,13 @@ +// g++ test_fltk.cpp -lmgl-fltk -lmgl +#include +int sample(mglGraph *gr) +{ + gr->Rotate(60,40); gr->Box(); + return 0; +} +//----------------------------------------------------- +int main(int argc,char **argv) +{ + mglFLTK gr(sample,"MathGL examples"); + return gr.Run(); +} diff --git a/fonts/make_bin.cpp b/fonts/make_bin.cpp index 600745f..b5fa706 100644 --- a/fonts/make_bin.cpp +++ b/fonts/make_bin.cpp @@ -20,6 +20,16 @@ #include #include "mgl2/font.h" //----------------------------------------------------------------------------- +extern mglFont *mglDefFont; +void mgl_init() // TODO try to add ld option: "-init mgl_init" +{ + static bool ini=true; + if(ini) + { + ini = false; + mglDefFont = new mglFont(MGL_DEF_FONT_NAME); + } +} int main(int argc, char *argv[]) { mglFont fnt; diff --git a/include/config.h.in b/include/config.h.in index 6367a08..ed22fd8 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -32,18 +32,22 @@ #endif #define MGL_SIZEOF_LONG ${SIZEOF_LONG} +#define MGL_HAVE_FREETYPE ${MGL_HAVE_FREETYPE} #define MGL_HAVE_LTDL ${MGL_HAVE_LTDL} #define MGL_HAVE_RVAL ${MGL_HAVE_RVAL} #define MGL_HAVE_ZLIB ${MGL_HAVE_ZLIB} #define MGL_HAVE_PNG ${MGL_HAVE_PNG} #define MGL_HAVE_GSL ${MGL_HAVE_GSL} #define MGL_HAVE_OPENGL ${MGL_HAVE_OPENGL} +#define MGL_HAVE_ARMA ${MGL_HAVE_ARMA} #define MGL_HAVE_OMP ${MGL_HAVE_OMP} #define MGL_HAVE_JPEG ${MGL_HAVE_JPEG} #define MGL_HAVE_GIF ${MGL_HAVE_GIF} #define MGL_HAVE_PDF ${MGL_HAVE_PDF} #define MGL_HAVE_HDF4 ${MGL_HAVE_HDF4} #define MGL_HAVE_HDF5 ${MGL_HAVE_HDF5} +#define MGL_HDF5_VER_MAJOR ${HDF_VERSION_MAJOR} +#define MGL_HDF5_VER_MINOR ${HDF_VERSION_MINOR} #define MGL_USE_GETTEXT ${MGL_USE_LIBINTL} #define MGL_FONT_PATH "${MGL_FONT_PATH}" #define MGL_HAVE_FL_COPY ${MGL_HAVE_FL_COPY} diff --git a/include/mgl2/Fl_MathGL.h b/include/mgl2/Fl_MathGL.h index b533c48..bb4019a 100644 --- a/include/mgl2/Fl_MathGL.h +++ b/include/mgl2/Fl_MathGL.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -33,6 +33,7 @@ #include #include class mglCanvas; +class Fl_Double_Window; //----------------------------------------------------------------------------- /// Class is FLTK widget which display MathGL graphics class MGL_EXPORT Fl_MathGL : public Fl_Widget @@ -41,7 +42,6 @@ class MGL_EXPORT 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 - mglCanvas *gr; ///< Built-in mglCanvas instance (mglCanvasFLTK is used by default) std::string prim; ///< manual primitives bool use_pthr; ///< use pthread for update plot @@ -60,6 +60,9 @@ public: /// Set function for parameters inline void set_prop(void (*func)(char id, const char *val, void *par), void *par) { prop_func=func; prop_par=par; } + /// Set function for handling events. Note, use Fl::event_key() for getting pressed keybutton + inline void set_handle(int (*func)(int val, void *par), void *par) + { hndl_func=func; hndl_par=par; } /// Refresh image (without executing update) void refresh(); @@ -86,11 +89,12 @@ public: /// NOTE: Fl_MathGL will automatically delete this object void set_graph(HMGL gr); /// Set grapher object instead of built-in one. - /// NOTE: Fl_MathGL will automatically delete this object inline void set_graph(mglGraph *Gr) { set_graph(Gr->Self()); } /// Get pointer to grapher inline HMGL get_graph() { return (HMGL)gr; } + /// Nullify grapher object for disabling double free. NOTE: this is internal function. + void no_graph() {gr=0;}; /// Get mglDraw pointer or NULL inline mglDraw *get_class() @@ -106,7 +110,7 @@ public: /// Ask to stop of script parsing void stop(bool stop=true); /// Enable/disable key handling as in mglview (default is false) - inline void set_handle_key(bool val) { handle_keys=true; } + inline void set_handle_key(bool val) { handle_keys=val; } /// Get id of last clicked object inline int get_last_id() { return last_id; } void draw_plot(); ///< Single thread drawing itself @@ -114,12 +118,16 @@ public: inline bool running() { return run; } protected: + mglCanvas *gr; ///< Built-in mglCanvas instance (mglCanvasFL is used by default) void *draw_par; ///< Parameters for drawing function draw_func(). /// Drawing function for window procedure. It should return the number of frames. int (*draw_func)(mglBase *gr, void *par); void *prop_par; ///< Parameters for prop_func(). /// Function for setting properties. void (*prop_func)(char id, const char *val, void *par); + void *hndl_par; ///< Parameters for hndl_func(). + /// Function for handling events. + int (*hndl_func)(int val, void *par); mglDraw *draw_cl; int last_id; ///< last selected object id @@ -161,13 +169,13 @@ public: void (*reload)(void*); ///< Callback function for reloading /// Toggle transparency (alpha) button - void toggle_alpha() { toggle(alpha, alpha_bt, _("Graphics/Alpha")); } + void toggle_alpha(); /// Toggle lighting button - void toggle_light() { toggle(light, light_bt, _("Graphics/Light")); } + void toggle_light(); /// Toggle slideshow button - void toggle_sshow() { toggle(sshow, anim_bt, _("Graphics/Animation/Slideshow")); } + void toggle_sshow(); /// Toggle grid drawing button - void toggle_grid() { toggle(grid, grid_bt, _("Graphics/Grid")); } + void toggle_grid(); /// Toggle mouse zoom button void toggle_zoom() { toggle(zoom, zoom_bt); } /// Toggle mouse rotate button @@ -179,7 +187,7 @@ public: /// Check if slideshow running bool is_sshow() { return sshow; } /// Toggle pause calculation button - void toggle_pause() { toggle(pauseC, pause_bt, _("Graphics/Pause calc")); exec_pause(); } + void toggle_pause(); /// Adjust image sizes to the current widget sizes void adjust() { mgl_set_size(FMGL->get_graph(),scroll->w(),scroll->h()); FMGL->size(scroll->w(),scroll->h()); update(); } @@ -207,8 +215,8 @@ public: } void dlg_window(const char *title=""); ///< Create/label dialog window void add_widget(char id, const char *args); ///< Add widget to dialog - void dlg_show() { dlg_finish(); dlg_wnd->show(); } ///< Show window - void dlg_hide() { dlg_wnd->hide(); } ///< Close window + void dlg_show(); ///< Show window + void dlg_hide(); ///< Close window void get_values(); ///< Get all values from dialog window void set_progress(int value, int maximal); ///< Set progress diff --git a/include/mgl2/abstract.h b/include/mgl2/abstract.h index 99c9e72..c8c53b8 100644 --- a/include/mgl2/abstract.h +++ b/include/mgl2/abstract.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -46,8 +46,10 @@ std::string MGL_EXPORT mgl_data_to_string(HCDT d, long ns); std::string MGL_EXPORT mgl_datac_to_string(HCDT d, long ns); /// Get section separated by symbol ch. This is analog of QString::section(). std::string MGL_EXPORT mgl_str_arg(const std::string &str, char ch, int n1, int n2=-1); +std::wstring MGL_EXPORT mgl_wcs_arg(const std::wstring &str, wchar_t ch, int n1, int n2); /// Get sections separated by symbol ch std::vector MGL_EXPORT mgl_str_args(const std::string &str, char ch); +std::vector MGL_EXPORT mgl_wcs_args(const std::wstring &str, wchar_t ch); /// Get string from real number std::string MGL_EXPORT mgl_str_num(double val); /// Get string from complex number @@ -106,6 +108,12 @@ void MGL_EXPORT mgl_data_export_(uintptr_t *dat, const char *fname, const char * /// Save data to HDF file void MGL_EXPORT mgl_data_save_hdf(HCDT d,const char *fname,const char *data,int rewrite); void MGL_EXPORT mgl_data_save_hdf_(uintptr_t *d, const char *fname, const char *data, int *rewrite,int l,int n); +/// Save value to HDF file +void MGL_EXPORT mgl_dual_save_hdf(mdual val,const char *fname,const char *data,int rewrite); +void MGL_EXPORT mgl_real_save_hdf(double val,const char *fname,const char *data,int rewrite); +void MGL_EXPORT mgl_int_save_hdf(long val,const char *fname,const char *data,int rewrite); +void MGL_EXPORT mgl_real_save_hdf_(double *val,const char *fname,const char *data,int *rewrite,int,int); +void MGL_EXPORT mgl_int_save_hdf_(long *val, const char *fname, const char *data, int *rewrite, int, int); /// Get information about the data (sizes and momentum) to string MGL_EXPORT const char *mgl_data_info(HCDT dat); int MGL_EXPORT mgl_data_info_(uintptr_t *dat, char *out, int len); @@ -226,6 +234,9 @@ struct MGL_EXPORT mglNum { d=n.d; c=n.c; s=n.s; return n; } }; //----------------------------------------------------------------------------- +/// List of user-defined data arrays +MGL_EXPORT extern std::vector mglDataList; +//----------------------------------------------------------------------------- /// Abstract class for data array class MGL_EXPORT mglDataA { @@ -237,8 +248,14 @@ public: void (*func)(void *); ///< Callback function for destroying void *o; ///< Pointer to external object - mglDataA() { temp=false; func=0; o=0; } - virtual ~mglDataA() { if(func) func(o); } + mglDataA() { mgl_init(); mglDataList.push_back(this); temp=false; func=0; o=0; } + virtual ~mglDataA() + { + for(long i = mglDataList.size()-1; i>=0; i--) + if(mglDataList[i] == this) + { mglDataList.erase(mglDataList.begin()+i); break; } + if(func) func(o); + } /// Set name for data variable (can be used in mgl_formula_calc() or in MGL scripts) inline void Name(const char *name) { s = name; } inline void Name(const wchar_t *name) { s = name; } @@ -384,7 +401,7 @@ struct MGL_EXPORT mglColorID mglColor col; }; MGL_EXPORT extern mglColorID mglColorIds[31]; -MGL_EXPORT extern std::string mglGlobalMess; ///< Buffer for receiving global messages +// MGL_EXPORT extern std::string mglGlobalMess; ///< Buffer for receiving global messages //----------------------------------------------------------------------------- #endif diff --git a/include/mgl2/addon.h b/include/mgl2/addon.h index 2b7edd8..42cece6 100644 --- a/include/mgl2/addon.h +++ b/include/mgl2/addon.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -55,7 +55,7 @@ void MGL_EXPORT mgl_test(const char *str, ...); /// Print info message void MGL_EXPORT mgl_info(const char *str, ...); /// Locate next data block (block started by -----) -MGL_EXPORT FILE *mgl_next_data(const char *fname,int p); +MGL_EXPORT FILE *mgl_next_data(const char *fname,long p); /// Enable executing MGL script if mgl_fgetstr() meet '#MGL fname.mgl [args]. Default value is 0 (false). void MGL_EXPORT mgl_fgetstr_mgl(int enable); diff --git a/include/mgl2/base.h b/include/mgl2/base.h index c247c43..5d06b83 100644 --- a/include/mgl2/base.h +++ b/include/mgl2/base.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -267,7 +267,8 @@ struct MGL_EXPORT mglGlyph mglGlyph(long Nt, long Nl):nt(0),nl(0),trig(0),line(0) { Create(Nt,Nl); } ~mglGlyph() { if(trig) delete []trig; if(line) delete []line; } - void Create(long Nt, long Nl); + void Create(long Nt, long Nl); ///< Allocate memory for given sizes + void Load(wchar_t id, const char *fname); ///< Load glyph 'id' from TTF/OTF file 'fname' bool operator==(const mglGlyph &g) const MGL_FUNC_PURE; inline bool operator!=(const mglGlyph &g) const MGL_FUNC_PURE { return !(*this==g); } @@ -383,11 +384,11 @@ public: inline void set(bool v,uint32_t fl) { Flag = v ? Flag|fl : Flag&(~fl); } /// Set axis range scaling -- simplified way to shift/zoom axis range -- need to replot whole image! - inline void ZoomAxis(mglPoint p1=mglPoint(0,0,0,0), mglPoint p2=mglPoint(1,1,1,1)) { AMin = p1; AMax = p2; } + inline void ZoomAxis(const mglPoint &p1=mglPoint(0,0,0,0), const mglPoint &p2=mglPoint(1,1,1,1)) { AMin = p1; AMax = p2; } /// Set values of mglGraph::Min and mglGraph::Max inline void SetRanges(mreal x1, mreal x2, mreal y1, mreal y2, mreal z1=0, mreal z2=0, mreal c1=0, mreal c2=0) { SetRanges(mglPoint(x1,y1,z1,c1),mglPoint(x2,y2,z2,c2)); } - void SetRanges(mglPoint v1, mglPoint v2); + void SetRanges(const mglPoint &v1, const mglPoint &v2); /// Set values of mglGraph::Cmin and mglGraph::Cmax as minimal and maximal values of data a void CRange(HCDT a, bool add = false, mreal fact=0); void CRange(mreal v1,mreal v2,bool add=false); @@ -425,7 +426,7 @@ public: /// Set additional cutting box inline void SetCutBox(mreal x1, mreal y1, mreal z1, mreal x2, mreal y2, mreal z2) { CutMin.Set(x1,y1,z1); CutMax.Set(x2,y2,z2); } - inline void SetCutBox(mglPoint v1, mglPoint v2) { CutMin=v1; CutMax=v2; } + inline void SetCutBox(const mglPoint &v1, const mglPoint &v2) { CutMin=v1; CutMax=v2; } /// Reset mask to solid state inline void ResetMask() { mask = MGL_SOLID_MASK; MaskAn = DefMaskAn; } /// Set default mask rotation angle @@ -495,6 +496,7 @@ public: /// Copy font from another mglGraph instance void CopyFont(mglBase *gr); /// Set default font size + void SetFontHscale(mreal val); inline void SetFontSize(mreal val) { FontSize=val>0 ? val:-FontSize*val; } inline mreal GetFontSize() const { return FontSize; } mreal TextWidth(const char *text, const char *font, mreal size) const MGL_FUNC_PURE; @@ -531,15 +533,15 @@ public: // ~~~~~~~~~~~~~~~~~~~~~~ Developer functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /// Add point to the Pnt and return its position - inline long AddPnt(mglPoint p, mreal c=-1, mglPoint n=mglPoint(NAN), mreal a=-1, int scl=1) + inline long AddPnt(const mglPoint &p, mreal c=-1, const mglPoint &n=mglPoint(NAN), mreal a=-1, int scl=1) { return AddPnt(&B,p,c,n,a,scl); } - long AddPnt(const mglMatrix *M, mglPoint p, mreal c=-1, mglPoint n=mglPoint(NAN), mreal a=-1, int scl=1); + long AddPnt(const mglMatrix *M, const mglPoint &p, mreal c=-1, const mglPoint &n=mglPoint(NAN), mreal a=-1, int scl=1); bool AddPntQ(mglPnt &q, const mglMatrix *M, mglPoint p, mreal c=-1, mglPoint n=mglPoint(NAN), mreal a=-1, int scl=1); - inline bool AddPntQ(mglPnt &q, mglPoint p, mreal c=-1, mglPoint n=mglPoint(NAN), mreal a=-1, int scl=1) + inline bool AddPntQ(mglPnt &q, mglPoint p, mreal c=-1, const mglPoint &n=mglPoint(NAN), mreal a=-1, int scl=1) { return AddPntQ(q,&B,p,c,n,a,scl); } - inline bool AddPntQ(long id, const mglMatrix *M, mglPoint p, mreal c=-1, mglPoint n=mglPoint(NAN), mreal a=-1, int scl=1) + inline bool AddPntQ(long id, const mglMatrix *M, const mglPoint &p, mreal c=-1, const mglPoint &n=mglPoint(NAN), mreal a=-1, int scl=1) { return AddPntQ(Pnt[id],M,p,c,n,a,scl); } - inline bool AddPntQ(long id, mglPoint p, mreal c=-1, mglPoint n=mglPoint(NAN), mreal a=-1, int scl=1) + inline bool AddPntQ(long id, const mglPoint &p, mreal c=-1, const mglPoint &n=mglPoint(NAN), mreal a=-1, int scl=1) { return AddPntQ(Pnt[id],&B,p,c,n,a,scl); } inline void SetPntOff(size_t id) { Pnt[id].x=NAN; } long AllocPnts(size_t num); @@ -548,9 +550,9 @@ public: bool CopyNtoC(mglPnt &q, long k, mreal c); inline bool CopyNtoC(long id, long k, mreal c) { return (id>=0)?CopyNtoC(Pnt[id],k,c):false; } - long CopyProj(long from, mglPoint p, mglPoint n, short sub=0); - bool CopyProj(mglPnt &q, long from, mglPoint p, mglPoint n, short sub=0); - void CopyProj(long id, long from, mglPoint p, mglPoint n, short sub=0) + long CopyProj(long from, const mglPoint &p, const mglPoint &n, short sub=0); + bool CopyProj(mglPnt &q, long from, const mglPoint &p, const mglPoint &n, short sub=0); + void CopyProj(long id, long from, const mglPoint &p, const mglPoint &n, short sub=0) { if(id>=0) CopyProj(Pnt[id],from,p,n,sub); } void DisablePnt(long id) { Pnt[id].x = NAN; } void SetRGBA(long k, const mglColor &c) @@ -655,6 +657,7 @@ public: void SetEventFunc(void (*func)(void *), void *par) { event_cb=func; event_par=par; } protected: + bool limit_pm1; ///< limit coordinates in range [-1,+1] for OpenGL only volatile bool Stop; ///< Flag that execution should be terminated. void (*event_cb)(void *); ///< Function to be called for event processing void *event_par; ///< Parameter for event processing function diff --git a/include/mgl2/base_cf.h b/include/mgl2/base_cf.h index 963b46a..a8c6e90 100644 --- a/include/mgl2/base_cf.h +++ b/include/mgl2/base_cf.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -132,6 +132,9 @@ void MGL_EXPORT mgl_set_facenum_(uintptr_t *gr, int *num); /// Clear unused points and primitives. Useful only in combination with mgl_set_facenum(). void MGL_EXPORT mgl_clear_unused(HMGL gr); void MGL_EXPORT mgl_clear_unused_(uintptr_t *gr); +/// Set TeX parsing at text drawing +void MGL_EXPORT mgl_set_tex_parse(HMGL gr, int val); +void MGL_EXPORT mgl_set_tex_parse_(uintptr_t *gr, int *val); /// Set ambient light brightness void MGL_EXPORT mgl_set_ambbr(HMGL gr, double i); diff --git a/include/mgl2/canvas.h b/include/mgl2/canvas.h index c1be2bf..d3fde2f 100644 --- a/include/mgl2/canvas.h +++ b/include/mgl2/canvas.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -204,8 +204,16 @@ using mglBase::Light; /// Rasterize current plot and set it as background image void Rasterize(); - /// Load image for background from file + /// Load image for background from file (basic variant) void LoadBackground(const char *fname, double alpha=1); + /// Load image for background from file. + /** Parameter 'how' can be: + * 'a' for filling current subplot only; + * 's' for spline-based resizing; + * 'f' for fixing aspect ratio at resizing; + * 'c' for centering image; + * 't' for tessellate image. */ + void LoadBackground(const char *fname, const char *how, double alpha=1); /// Fill background image by specified color void FillBackground(const mglColor &cc); @@ -216,7 +224,7 @@ using mglBase::Light; mglPoint CalcXYZ(int xs, int ys, bool real=false) const MGL_FUNC_PURE; /// Calculate screen point {xs,ys} for 3D coordinate {x,y,z} void CalcScr(mglPoint p, int *xs, int *ys) const; - mglPoint CalcScr(mglPoint p) const; + mglPoint CalcScr(const mglPoint &p) const; /// Set object/subplot id inline void SetObjId(long id) { ObjId = id; } /// Get object id @@ -291,7 +299,7 @@ using mglBase::Light; /// Set the ticks parameters void SetTicks(char dir, mreal d=0, int ns=0, mreal org=NAN, const wchar_t *lbl=0); /// Auto adjust ticks - void AdjustTicks(const char *dir="xyzc", bool force=false, std::string stl=""); + void AdjustTicks(const char *dir="xyzc", bool force=false, const std::string &stl=""); /// Tune ticks inline void SetTuneTicks(int tune, mreal pos=1.15) { TuneTicks = tune; FactorPos = pos; } diff --git a/include/mgl2/canvas_cf.h b/include/mgl2/canvas_cf.h index 657a955..57b467f 100644 --- a/include/mgl2/canvas_cf.h +++ b/include/mgl2/canvas_cf.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -31,6 +31,9 @@ uintptr_t MGL_EXPORT mgl_create_graph_(int *width, int *height); /// Delete HMGL object void MGL_EXPORT mgl_delete_graph(HMGL gr); void MGL_EXPORT mgl_delete_graph_(uintptr_t *gr); +/// Return pointer to built-in (default) HMGL object +HMGL MGL_EXPORT mgl_default_graph(); +uintptr_t MGL_EXPORT mgl_default_graph_(); /// Set size of frame in pixels. Normally this function is called internally. void MGL_EXPORT mgl_set_size(HMGL gr, int width, int height); void MGL_EXPORT mgl_set_size_(uintptr_t *gr, int *width, int *height); @@ -175,7 +178,7 @@ void MGL_EXPORT mgl_colorbar_(uintptr_t *gr, const char *sch,int); * ‘-’ for printing usual ‘-’ in ticks labels; * ‘0123456789’ for precision at printing ticks labels.*/ void MGL_EXPORT mgl_colorbar_ext(HMGL gr, const char *sch, double x, double y, double w, double h); -void MGL_EXPORT mgl_colorbar_ext_(uintptr_t *gr, const char *sch, mreal *x, mreal *y, mreal *w, mreal *h, int); +void MGL_EXPORT mgl_colorbar_ext_(uintptr_t *gr, const char *sch, mreal *x, mreal *y, mreal *w, mreal *h,int); /// Draw colorbar with manual colors at edge of axis /** Parameter \a sch may contain: * ‘<>^_’ for positioning at left, at right, at top or at bottom correspondingly; @@ -205,7 +208,7 @@ void MGL_EXPORT mgl_colorbar_val_(uintptr_t *gr, uintptr_t *dat, const char *sch * ‘-’ for printing usual ‘-’ in ticks labels; * ‘0123456789’ for precision at printing ticks labels.*/ void MGL_EXPORT mgl_colorbar_val_ext(HMGL gr, HCDT dat, const char *sch,double x, double y, double w, double h); -void MGL_EXPORT mgl_colorbar_val_ext_(uintptr_t *gr, uintptr_t *dat, const char *sch, mreal *x, mreal *y, mreal *w, mreal *h, int); +void MGL_EXPORT mgl_colorbar_val_ext_(uintptr_t *gr, uintptr_t *dat, const char *sch, mreal *x, mreal *y, mreal *w, mreal *h,int); /// Add string to legend void MGL_EXPORT mgl_add_legend(HMGL gr, const char *text,const char *style); @@ -444,6 +447,17 @@ void MGL_EXPORT mgl_clf_str_(uintptr_t *gr, const char *col, int); /// Load background image void MGL_EXPORT mgl_load_background(HMGL gr, const char *fname, double alpha); void MGL_EXPORT mgl_load_background_(uintptr_t *gr, const char *fname, mreal *alpha, int); +/// Load background image +/** Parameter 'how' can be: + * 'a' for filling current subplot only; + * 's' for scaling (resizing) image to whole area; + * 'c' for centering image; + * 'm' for tessellate image as mosaic. */ +void MGL_EXPORT mgl_load_background_ext(HMGL gr, const char *fname, const char *how, double alpha); +void MGL_EXPORT mgl_load_background_ext_(uintptr_t *gr, const char *fname, const char *how, mreal *alpha, int,int); +/// Fill background by specified color. Colors r,g,b should be in range [0,1]. +void MGL_EXPORT mgl_fill_background(HMGL gr, double r, double g, double b); +void MGL_EXPORT mgl_fill_background_(uintptr_t *gr, double *r, double *g, double *b); /// Put further plotting in m-th cell of nx*ny grid of the image. /** String \a style may contain: diff --git a/include/mgl2/canvas_wnd.h b/include/mgl2/canvas_wnd.h index 18f1b73..d9a3f53 100644 --- a/include/mgl2/canvas_wnd.h +++ b/include/mgl2/canvas_wnd.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -46,7 +46,7 @@ public: void SetCurFig(int c); void ResetFrames(); inline mglPoint GetMousePos() const { return LastMousePos;} - inline void SetMousePos(mglPoint p) { LastMousePos=p; } + inline void SetMousePos(const mglPoint &p) { LastMousePos=p; } inline void Setup(bool clf_upd=true, bool showpos=false) { set(showpos,MGL_SHOW_POS); set(clf_upd,MGL_CLF_ON_UPD); if(!clf_upd) ResetFrames(); } diff --git a/include/mgl2/cont.h b/include/mgl2/cont.h index 239742c..c1bcc36 100644 --- a/include/mgl2/cont.h +++ b/include/mgl2/cont.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -38,11 +38,24 @@ void MGL_EXPORT mgl_text_y(HMGL gr, HCDT y, const char *text, const char *font, void MGL_EXPORT 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_EXPORT mgl_textw_y(HMGL gr, HCDT y, const wchar_t *text, const char *font, const char *opt); + +void MGL_EXPORT mgl_dcont_gen(HMGL gr, double val, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *sch, const char *opt); void MGL_EXPORT mgl_cont_gen(HMGL gr, double val, HCDT a, HCDT x, HCDT y, HCDT z, const char *stl, const char *opt); void MGL_EXPORT mgl_contf_gen(HMGL gr, double v1, double v2, HCDT a, HCDT x, HCDT y, HCDT z, const char *stl, const char *opt); //void MGL_EXPORT mgl_contv_gen(HMGL gr, double v1, double v2, HCDT a, HCDT x, HCDT y, HCDT z, const char *stl); //void MGL_EXPORT mgl_axial_gen(HMGL gr, double v1, double v2, HCDT a, HCDT x, HCDT y, HCDT z, const char *stl); +/// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data specified parametrically +/** Style ‘t’/‘T’ draw contour labels below/above contours. + * If v==NULL then curve levels is selected equidistantly in color range. */ +void MGL_EXPORT mgl_dcont_xyz(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *sch, const char *opt); +void MGL_EXPORT mgl_dcont_xyz_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int,int); +/// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data +/** Style ‘t’/‘T’ draw contour labels below/above contours. + * If v==NULL then curve levels is selected equidistantly in color range. */ +void MGL_EXPORT mgl_dcont(HMGL gr, HCDT v, HCDT a, HCDT b, const char *sch, const char *opt); +void MGL_EXPORT mgl_dcont_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int,int); + /// Draw contour lines at manual levels for 2d data specified parametrically /** Style ‘_’ to draw contours at bottom of axis box. * Style ‘t’/‘T’ draw contour labels below/above contours. */ diff --git a/include/mgl2/data.h b/include/mgl2/data.h index faec67a..4ec83ea 100644 --- a/include/mgl2/data.h +++ b/include/mgl2/data.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -22,6 +22,10 @@ #include "mgl2/data_cf.h" #include "mgl2/pde.h" + +#if MGL_HAVE_ARMA +#include +#endif //----------------------------------------------------------------------------- #include //----------------------------------------------------------------------------- @@ -34,6 +38,7 @@ class MGL_EXPORT mglData : public mglDataA { public: using mglDataA::Momentum; +using mglDataA::Last; 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) @@ -144,6 +149,17 @@ using mglDataA::Momentum; va_end(vl); } +#if MGL_HAVE_ARMA + inline void Set(const arma::vec &d) + { Create(d.n_elem); for(long i=0;i &vars); +//----------------------------------------------------------------------------- /// Wrapper class for expression evaluating class MGL_EXPORT mglExpr { HMEX ex; - mglExpr(const mglExpr &){} // copying is not allowed - const mglExpr &operator=(const mglExpr &t){return t;} // copying is not allowed + mglExpr(const mglExpr &){ex=0;} // copying is not allowed + const mglExpr &operator=(const mglExpr &t){ex=0; return t;} // copying is not allowed public: mglExpr(const char *expr) { ex = mgl_create_expr(expr); } #if MGL_HAVE_RVAL @@ -816,7 +882,7 @@ public: /// Create or recreate the array with specified size and fill it by zero inline void Create(long mx,long my=1,long mz=1) { nx=mx; ny=my; nz=mz; setD(); } - inline void SetRanges(mglPoint p1, mglPoint p2) { v1=p1; v2=p2; setD(); } + inline void SetRanges(const mglPoint &p1, const mglPoint &p2) { v1=p1; v2=p2; setD(); } /// Set formula to be used as dfunction inline void SetFormula(const char *eq) { @@ -907,7 +973,7 @@ class MGL_EXPORT mglDataT : public mglDataA { const mglDataA &dat; long ind; - const mglDataT &operator=(const mglDataT &d) { return d; } + const mglDataT &operator=(const mglDataT &d) { ind=0; return d; } public: mglDataT(const mglDataT &d) : dat(d.dat), ind(d.ind) { s = d.s; } mglDataT(const mglDataA &d, long col=0) : dat(d), ind(col) {} @@ -957,7 +1023,7 @@ class MGL_EXPORT mglDataR : public mglDataA { const mglDataA &dat; long ind; - const mglDataR &operator=(const mglDataR &d) { return d; } + const mglDataR &operator=(const mglDataR &d) { ind=0; return d; } public: mglDataR(const mglDataR &d) : dat(d.dat), ind(d.ind) { s = d.s; } mglDataR(const mglDataA &d, long row=0) : dat(d), ind(row) {} diff --git a/include/mgl2/data_cf.h b/include/mgl2/data_cf.h index 418a296..f493a27 100644 --- a/include/mgl2/data_cf.h +++ b/include/mgl2/data_cf.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -119,6 +119,10 @@ int MGL_EXPORT mgl_data_read_range_(uintptr_t *d, const char *fname, mreal *n1, /// Read data from tab-separated text files with auto determining size which filenames are satisfied to template (like "t_*.dat") int MGL_EXPORT mgl_data_read_all(HMDT dat, const char *templ, int as_slice); int MGL_EXPORT mgl_data_read_all_(uintptr_t *d, const char *fname, int *as_slice,int l); +/// Read data from binary file of type: 0 - double, 1 - float, 2 - long double, 3 - long int, 4 - int, 5 - short int, 6 - char. +/** NOTE: this function may not correctly read binary files written in different CPU kind! */ +int MGL_EXPORT mgl_data_read_bin(HMDT dat, const char *fname, int type); +int MGL_EXPORT mgl_data_read_bin_(uintptr_t *d, const char *fname,int *type,int l); /// Import data array from PNG file according color scheme void MGL_EXPORT mgl_data_import(HMDT dat, const char *fname, const char *scheme,mreal v1,mreal v2); void MGL_EXPORT mgl_data_import_(uintptr_t *dat, const char *fname, const char *scheme,mreal *v1,mreal *v2,int,int); @@ -151,6 +155,10 @@ void MGL_EXPORT mgl_data_limit_(uintptr_t *dat, mreal *v); /// Project the periodical data to range [v1,v2] (like mod() function). Separate branches by NAN if sep=true. void MGL_EXPORT mgl_data_coil(HMDT dat, mreal v1, mreal v2, int sep); void MGL_EXPORT mgl_data_coil_(uintptr_t *dat, mreal *v1, mreal *v2, int *sep); +/// Keep the data sign/value along line i and j in given direction. +/** Parameter "how" may contain: 'x','y' or 'z' for direction (default is 'y'); 'a' for keeping amplitude instead of sign.*/ +void MGL_EXPORT mgl_data_keep(HMDT dat, const char *how, long i, long j); +void MGL_EXPORT mgl_data_keep_(uintptr_t *d, const char *how, long *i, long *j, int); /// Get sub-array of the data with given fixed indexes HMDT MGL_EXPORT mgl_data_subdata(HCDT dat, long xx,long yy,long zz); @@ -170,7 +178,9 @@ uintptr_t MGL_EXPORT mgl_data_section_(uintptr_t *d, uintptr_t *ids, const char HMDT MGL_EXPORT mgl_data_section_val(HCDT dat, long id, char dir, mreal val); uintptr_t MGL_EXPORT mgl_data_section_val_(uintptr_t *d, int *id, const char *dir, mreal *val,int); /// Get contour lines for dat[i,j]=val. NAN values separate the the curves -HMDT mgl_data_conts(mreal val, HCDT dat); +HMDT MGL_EXPORT mgl_data_conts(mreal val, HCDT dat); +/// Evaluate formula 'str' for given list of variables. +HMDT MGL_EXPORT mgl_formula_calc(const char *str, long n, ...); /// Equidistantly fill the data to range [x1,x2] in direction dir void MGL_EXPORT mgl_data_fill(HMDT dat, mreal x1,mreal x2,char dir); @@ -315,6 +325,12 @@ void MGL_EXPORT mgl_data_smooth_(uintptr_t *dat, const char *dirs, mreal *delta, /// Get array which is result of summation in given direction or directions HMDT MGL_EXPORT mgl_data_sum(HCDT dat, const char *dir); uintptr_t MGL_EXPORT mgl_data_sum_(uintptr_t *dat, const char *dir,int); +/// Get array of positions of first value large val +HMDT MGL_EXPORT mgl_data_first_dir(HCDT dat, const char *dir, double val); +uintptr_t MGL_EXPORT mgl_data_first_dir_(uintptr_t *d, const char *dir, double *val,int l); +/// Get array of positions of last value large val +HMDT MGL_EXPORT mgl_data_last_dir(HCDT dat, const char *dir, double val); +uintptr_t MGL_EXPORT mgl_data_last_dir_(uintptr_t *d, const char *dir, double *val,int l); /// Get array which is result of maximal values in given direction or directions HMDT MGL_EXPORT mgl_data_max_dir(HCDT dat, const char *dir); uintptr_t MGL_EXPORT mgl_data_max_dir_(uintptr_t *dat, const char *dir,int); @@ -524,7 +540,59 @@ uintptr_t MGL_EXPORT mgl_data_roots_(const char *func, uintptr_t *ini, const cha HMDT MGL_EXPORT mgl_find_roots_txt(const char *func, const char *vars, HCDT ini); uintptr_t MGL_EXPORT mgl_find_roots_txt_(const char *func, const char *vars, uintptr_t *ini,int,int); /// Find roots for set of nonlinear equations defined by function -bool MGL_EXPORT mgl_find_roots(size_t n, void (*func)(const mreal *x, mreal *f, void *par), mreal *x0, void *par); +int MGL_EXPORT mgl_find_roots(size_t n, void (*func)(const mreal *x, mreal *f, void *par), mreal *x0, void *par); + +/// Gets integer random numbers of uniform distribution in range [lo,hi] +mreal MGL_EXPORT mgl_rnd_integer(long lo, long hi); +double MGL_EXPORT mgl_rnd_integer_(int *lo, int *hi); +/// Gets random numbers of uniform distribution in range [lo,hi] +mreal MGL_EXPORT mgl_rnd_uniform(mreal lo, mreal hi); +double MGL_EXPORT mgl_rnd_uniform_(double *lo, double *hi); +/// Gets random numbers of Bernoulli distribution +mreal MGL_EXPORT mgl_rnd_bernoulli(mreal p); +double MGL_EXPORT mgl_rnd_bernoulli_(double *p); +/// Gets random numbers of binomial distribution +long MGL_EXPORT mgl_rnd_binomial(long trials, mreal p); +int MGL_EXPORT mgl_rnd_binomial_(int *trials, double *p); +/// Gets random numbers of gaussian distribution +mreal MGL_EXPORT mgl_rnd_gaussian(mreal mu, mreal sigma); +double MGL_EXPORT mgl_rnd_gaussian_(double *mu, double *sigma); +/// Gets random numbers of exponential distribution +mreal MGL_EXPORT mgl_rnd_exponential(mreal lambda); +double MGL_EXPORT mgl_rnd_exponential_(double *lambda); +/// Gets random numbers of discrete distribution according A. It assumes A to be 1d. +long MGL_EXPORT mgl_rnd_discrete(HCDT A); +double MGL_EXPORT mgl_rnd_discrete_(uintptr_t *d); + +/// Fills data by integer random numbers of uniform distribution in range [lo,hi] +void MGL_EXPORT mgl_data_rnd_integer(HMDT d, long lo, long hi); +void MGL_EXPORT mgl_data_rnd_integer_(uintptr_t *d, int *lo, int *hi); +/// Fills data by random numbers of uniform distribution in range [lo,hi] +void MGL_EXPORT mgl_data_rnd_uniform(HMDT d, mreal lo, mreal hi); +void MGL_EXPORT mgl_data_rnd_uniform_(uintptr_t *d, double *lo, double *hi); +/// Fills data by random numbers of bernoulli distribution +void MGL_EXPORT mgl_data_rnd_bernoulli(HMDT d, mreal p); +void MGL_EXPORT mgl_data_rnd_bernoulli_(uintptr_t *d, double *p); +/// Fills data by random numbers of binomial distribution +void MGL_EXPORT mgl_data_rnd_binomial(HMDT d, long trials, mreal p); +void MGL_EXPORT mgl_data_rnd_binomial_(uintptr_t *d, double *p); +/// Fills data by random numbers of gaussian distribution +void MGL_EXPORT mgl_data_rnd_gaussian(HMDT d, mreal mu, mreal sigma); +void MGL_EXPORT mgl_data_rnd_gaussian_(uintptr_t *d, double *mu, double *s); +/// Fills data by random numbers of exponential distribution +void MGL_EXPORT mgl_data_rnd_exponential(HMDT d, mreal lambda); +void MGL_EXPORT mgl_data_rnd_exponential_(uintptr_t *d, double *l); +/// Fills data by random numbers of discrete distribution according A +void MGL_EXPORT mgl_data_rnd_discrete(HMDT d, HCDT A); +void MGL_EXPORT mgl_data_rnd_discrete_(uintptr_t *d, uintptr_t *A); +/// Shuffles elements or slices of data array +void MGL_EXPORT mgl_shuffle(HMDT d, char dir); +void MGL_EXPORT mgl_shuffle_(uintptr_t *d, char *dir, int); +/// Fills data by fractional brownian motions along x-direction +void MGL_EXPORT mgl_data_brownian(HMDT d, mreal y1, mreal y2, mreal sigma, mreal alpha); +void MGL_EXPORT mgl_data_brownian_(uintptr_t *d, double *y1, double *y2, double *sigma, double *alpha); + + //----------------------------------------------------------------------------- #ifdef __cplusplus } diff --git a/include/mgl2/datac.h b/include/mgl2/datac.h index f2c0251..857e108 100644 --- a/include/mgl2/datac.h +++ b/include/mgl2/datac.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -22,6 +22,10 @@ #include "mgl2/data.h" #include "mgl2/datac_cf.h" + +#if MGL_HAVE_ARMA +#include +#endif //----------------------------------------------------------------------------- #include #include @@ -36,6 +40,7 @@ class MGL_EXPORT mglDataC : public mglDataA { public: using mglDataA::Momentum; +using mglDataA::Last; 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) @@ -146,6 +151,23 @@ using mglDataA::Momentum; { if(d.size()>0) { Create(d.size()); for(long i=0;i(d1), reinterpret_cast(d2)); } //----------------------------------------------------------------------------- +/// Evaluate formula 'str' for given list of variables 'vars'. +/** NOTE: you need to delete returned data array!*/ +HADT MGL_EXPORT mglFormulaCalcC(const char *str, const std::vector &vars); +//----------------------------------------------------------------------------- #define _DN_(a) ((mglDataC *)*(a)) #define _DC_ ((mglDataC *)*d) //----------------------------------------------------------------------------- @@ -559,8 +602,8 @@ inline dual mglGSplineC(const mglDataA &coef, mreal dx, dual *d1=0, dual *d2=0) class MGL_EXPORT mglExprC { HAEX ex; - mglExprC(const mglExprC &){} // copying is not allowed - const mglExprC &operator=(const mglExprC &t){return t;} // copying is not allowed + mglExprC(const mglExprC &){ex=0;} // copying is not allowed + const mglExprC &operator=(const mglExprC &t){ex=0; return t;} // copying is not allowed public: mglExprC(const char *expr) { ex = mgl_create_cexpr(expr); } ~mglExprC() { mgl_delete_cexpr(ex); } diff --git a/include/mgl2/datac_cf.h b/include/mgl2/datac_cf.h index 5f5730c..afca6f3 100644 --- a/include/mgl2/datac_cf.h +++ b/include/mgl2/datac_cf.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -183,6 +183,8 @@ uintptr_t MGL_EXPORT mgl_datac_section_(uintptr_t *d, uintptr_t *ids, const char /** If section id is negative then reverse order is used (i.e. -1 give last section). */ HADT MGL_EXPORT mgl_datac_section_val(HCDT dat, long id, char dir, mreal val); uintptr_t MGL_EXPORT mgl_datac_section_val_(uintptr_t *d, int *id, const char *dir, mreal *val,int); +/// Evaluate formula 'str' for given list of variables. +HADT MGL_EXPORT mgl_formula_calc_c(const char *str, long n, ...); /// Equidistantly fill the data to range [x1,x2] in direction dir void MGL_EXPORT mgl_datac_fill(HADT dat, mdual x1,mdual x2,char dir); @@ -213,10 +215,15 @@ void MGL_EXPORT mgl_datac_modify_(uintptr_t *dat, const char *eq,int *dim,int); void MGL_EXPORT mgl_datac_modify_vw(HADT dat, const char *eq,HCDT vdat,HCDT wdat); void MGL_EXPORT mgl_datac_modify_vw_(uintptr_t *dat, const char *eq, uintptr_t *vdat, uintptr_t *wdat,int); -/// Limit the data to be inside [-v,v], keeping the original sign +/// Limit the data to be inside [-v,v], keeping the original phase void MGL_EXPORT mgl_datac_limit(HADT dat, mreal v); void MGL_EXPORT mgl_datac_limit_(uintptr_t *dat, mreal *v); +/// Keep the data phase/value along line i and j in given direction. +/** Parameter "how" may contain: 'x','y' or 'z' for direction (default is 'y'); 'a' for keeping amplitude instead of phase.*/ +void MGL_EXPORT mgl_datac_keep(HADT dat, const char *how, long i, long j); +void MGL_EXPORT mgl_datac_keep_(uintptr_t *d, const char *how, long *i, long *j, int); + /// Put value to data element(s) void MGL_EXPORT mgl_datac_put_val(HADT dat, mdual val, long i, long j, long k); void MGL_EXPORT mgl_datac_put_val_(uintptr_t *dat, mdual *val, int *i, int *j, int *k); @@ -321,6 +328,9 @@ void MGL_EXPORT mgl_datac_fft_(uintptr_t *dat, const char *dir,int); HADT MGL_EXPORT mgl_datac_correl(HCDT dat1, HCDT dat2, const char *dir); uintptr_t MGL_EXPORT mgl_datac_correl_(uintptr_t *dat1, uintptr_t *dat2, const char *dir,int); /// Calculate one step of diffraction by finite-difference method with parameter q +/** Parameter \a how may contain: + * ‘x‘,‘y‘,‘z‘ or ‘r‘ for directions or axial along x, + * ‘e‘,‘g‘,‘0‘,‘1‘,‘2‘,‘3‘ for boundary conditions: exp, Gaussian, zero, constant, linear, quadratic.*/ void MGL_EXPORT mgl_datac_diffr(HADT dat, const char *how, mreal q); void MGL_EXPORT mgl_datac_diffr_(uintptr_t *d, const char *how, double q,int l); /// Apply wavelet transform diff --git a/include/mgl2/define.h b/include/mgl2/define.h index 21b2175..6ec43a2 100644 --- a/include/mgl2/define.h +++ b/include/mgl2/define.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -61,6 +61,8 @@ #if MGL_HAVE_ATTRIBUTE #define MGL_FUNC_CONST __attribute__((const)) #define MGL_FUNC_PURE __attribute__((pure)) +#define MGL_FUNC_INIT __attribute__((constructor)) +#define MGL_FUNC_FINI __attribute__((destructor)) #else #define MGL_FUNC_CONST #define MGL_FUNC_PURE @@ -146,7 +148,6 @@ typedef size_t msize; #if !MGL_SYS_NAN #include -#include const unsigned long long mgl_nan[2] = {0x7fffffffffffffff, 0x7fffffff}; const unsigned long long mgl_inf[2] = {0x7ff0000000000000, 0x7f800000}; #define NANd (*(double*)mgl_nan) @@ -293,6 +294,7 @@ extern MGL_EXPORT uint64_t mgl_mask_val[16]; #include #include typedef std::complex dual; +typedef std::complex ddual; //----------------------------------------------------------------------------- inline bool mgl_isrange(double a, double b) { return fabs(a-b)>MGL_MIN_VAL && a-a==0. && b-b==0.; } @@ -351,7 +353,9 @@ typedef cmdual mdual; #endif #endif //----------------------------------------------------------------------------- -extern float mgl_cos[360]; ///< contain cosine with step 1 degree +extern float MGL_EXPORT mgl_cos[360]; ///< contain cosine with step 1 degree +void MGL_EXPORT MGL_FUNC_INIT mgl_init(); ///< initialize MathGL structures +void MGL_EXPORT MGL_FUNC_FINI mgl_fini(); ///< free MathGL structures //----------------------------------------------------------------------------- /// Calculate sqrt(x*x+y*y) double MGL_EXPORT_CONST mgl_hypot(double x, double y); @@ -388,6 +392,9 @@ void MGL_EXPORT mgl_set_global_warn_(const char *text,int); /// Get text of global warning message(s) MGL_EXPORT_PURE const char *mgl_get_global_warn(); int MGL_EXPORT mgl_get_global_warn_(char *out, int len); +/// Clear global warning message +void MGL_EXPORT mgl_clear_global_warn(); +void MGL_EXPORT mgl_clear_global_warn_(); /// Setup gettext usage. NOTE: Russian translation MUST be installed. void MGL_EXPORT mgl_textdomain(const char *argv0, const char *locale); void MGL_EXPORT mgl_textdomain_(const char *locale, int); diff --git a/include/mgl2/eval.h b/include/mgl2/eval.h index b63647f..33c1262 100644 --- a/include/mgl2/eval.h +++ b/include/mgl2/eval.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/evalc.h b/include/mgl2/evalc.h index 7ca0f2d..912fa7f 100644 --- a/include/mgl2/evalc.h +++ b/include/mgl2/evalc.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/fit.h b/include/mgl2/fit.h index 157f14c..86eb5dc 100644 --- a/include/mgl2/fit.h +++ b/include/mgl2/fit.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/fltk.h b/include/mgl2/fltk.h index bd8b1a9..bd034d0 100644 --- a/include/mgl2/fltk.h +++ b/include/mgl2/fltk.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/font.h b/include/mgl2/font.h index 28499ab..b017e15 100644 --- a/include/mgl2/font.h +++ b/include/mgl2/font.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -67,7 +67,8 @@ class MGL_EXPORT mglFont { public: mglBase *gr; ///< mglBase class used for drawing characters - mglFont(const char *name=0, const char *path=0); + mglFont(); + mglFont(const char *name, const char *path=0); virtual ~mglFont(); bool parse; ///< Parse LaTeX symbols @@ -99,6 +100,8 @@ public: /// Get width of text string for font specified by string float Width(const wchar_t *str,const char *how, float *y1=0, float *y2=0) const; + /// Set height scaling factor + inline void HeightScale(float s=1) { Hscale = s>0?s:1; } /// Get internal code for symbol inline long Internal(unsigned s) const { return mgl_internal_code(s,glyphs); } /// Return number of glyphs @@ -115,7 +118,8 @@ protected: std::vector glyphs; ///< information about know glyphs float fact[4]; ///< Divider for width of glyph short *Buf; ///< Buffer for glyph descriptions - size_t numb; ///< Buffer size + size_t numb; ///< Buffer size + float Hscale; ///< Height scaling /// Print text string for font specified by integer constant float Puts(const wchar_t *str,int font,int align, float c1,float c2) const; diff --git a/include/mgl2/glut.h b/include/mgl2/glut.h index 83c345c..4248ecf 100644 --- a/include/mgl2/glut.h +++ b/include/mgl2/glut.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/mgl.h b/include/mgl2/mgl.h index 2263299..7a082ea 100644 --- a/include/mgl2/mgl.h +++ b/include/mgl2/mgl.h @@ -29,23 +29,35 @@ /// Wrapper class for all graphics class MGL_EXPORT mglGraph { - mglGraph(const mglGraph &) {} // copying is not allowed - const mglGraph &operator=(const mglGraph &t) { return t; } + mglGraph(const mglGraph &) {gr=0;} // copying is not allowed + const mglGraph &operator=(const mglGraph &t) { gr=0; return t; } protected: HMGL gr; public: HMPR pr; ///< Pointer to associated MGL parser - mglGraph(int kind=0, int width=600, int height=400) + mglGraph(int kind=-1) { pr = NULL; - if(kind==-1) gr=NULL; + if(kind==0) gr=mgl_create_graph(600, 400); #if MGL_HAVE_OPENGL else if(kind==1) gr=mgl_create_graph_gl(); #else else if(kind==1) - { gr=mgl_create_graph(width, height); + { gr=mgl_default_graph(); mgl_use_graph(gr,1); SetGlobalWarn("OpenGL support was disabled. Please, enable it and rebuild MathGL."); } #endif - else gr=mgl_create_graph(width, height); + else { gr=mgl_default_graph(); mgl_use_graph(gr,1); } + } + mglGraph(int kind, int width, int height) + { pr = NULL; + if(kind==0) gr=mgl_create_graph(width, height); +#if MGL_HAVE_OPENGL + else if(kind==1) gr=mgl_create_graph_gl(); +#else + else if(kind==1) + { gr=mgl_default_graph(); mgl_use_graph(gr,1); + SetGlobalWarn("OpenGL support was disabled. Please, enable it and rebuild MathGL."); } +#endif + else { gr=mgl_default_graph(); mgl_use_graph(gr,1); mgl_set_size(gr,width,height); } } mglGraph(HMGL graph) { pr = NULL; gr = graph; mgl_use_graph(gr,1); } @@ -109,6 +121,8 @@ public: inline void SetMeshNum(int num) { mgl_set_meshnum(gr, num); } /// Set number of visible faces (use 0 to draw all of them) inline void SetFaceNum(int num) { mgl_set_facenum(gr, num); } + /// Set TeX parsing at text drawing + inline void SetTeXparse(bool val) { mgl_set_tex_parse(gr, val); } /// Set cutting for points outside of bounding box inline void SetCut(bool cut) { mgl_set_cut(gr, cut); } @@ -169,6 +183,8 @@ public: static inline void SetGlobalWarn(const char *text) { mgl_set_global_warn(text); } /// Get text of global warning message(s) static inline const char *GlobalWarn() { return mgl_get_global_warn(); } + /// Clear global warning message + static inline void ClearGlobalWarn() { mgl_clear_global_warn(); } /// Suppress printing warnings to stderr static inline void SuppressWarn(bool on) { mgl_suppress_warn(on); } /// Check if MathGL version is valid (return false) or not (return true) @@ -575,9 +591,20 @@ public: /// Clear unused points and primitives. Useful only in combination with SetFaceNum(). inline void ClearUnused() { mgl_clear_unused(gr); } - /// Load background image + /// Load background image (basic variant: no scaling, whole image) inline void LoadBackground(const char *fname, double alpha=1) { mgl_load_background(gr,fname,alpha); } + /// Load image for background from file. + /** Parameter 'how' can be: + * 'a' for filling current subplot only; + * 's' for scaling (resizing) image to whole area; + * 'c' for centering image; + * 'm' for tessellate image as mosaic. */ + inline void LoadBackground(const char *fname, const char *how, double alpha=1) + { mgl_load_background_ext(gr,fname,how,alpha); } + /// Fill background image by specified color. Colors r,g,b should be in range [0,1]. + inline void FillBackground(const mglColor &cc) + { mgl_fill_background(gr, cc.r,cc.g,cc.b); } /// Force drawing the image and use it as background one inline void Rasterize() { mgl_rasterize(gr); } @@ -940,6 +967,17 @@ public: inline void Region(const mglDataA &x1, const mglDataA &y1, const mglDataA &x2, const mglDataA &y2, const char *pen="", const char *opt="") { mgl_region_3d(gr, &x1, &y1, NULL, &x2, &y2, NULL, pen, opt); } + /// Draw lines with arrows between points {x1,y1,z1} and {x2,y2,z2} + inline void Lines(const mglDataA &x1, const mglDataA &y1, const mglDataA &z1, const mglDataA &x2, const mglDataA &y2, const mglDataA &z2, const char *pen="", const char *opt="") + { mgl_lines_xyz(gr, &x1, &y1, &z1, &x2, &y2, &z2, pen, opt); } + /// Draw lines with arrows between points {x1,y1,zMin} and {x2,y2,zMin} + inline void Lines(const mglDataA &x1, const mglDataA &y1, const mglDataA &x2, const mglDataA &y2, const char *pen="", const char *opt="") + { mgl_lines_xy(gr, &x1, &y1, &x2, &y2, pen, opt); } + /// Draw lines with arrows between: points {x1,y} and {x2,y} with y in y-axis range if \a pen contain 'x'; or points {x,y1} and {x,y2} with x in x-axis range. + inline void Lines(const mglDataA &y1, const mglDataA &y2, const char *pen="", const char *opt="") + { if(mglchr(pen,'x')) mgl_lines_x(gr, &y1, &y2, pen, opt); + else mgl_lines(gr, &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); } @@ -1474,6 +1512,25 @@ public: inline void Axial(const mglDataA &z, const char *sch="", const char *opt="") { mgl_axial(gr, &z, sch, opt); } + /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data specified parametrically + /** Style ‘t’/‘T’ draw contour labels below/above contours. */ + inline void DCont(const mglDataA &v, const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const mglDataA &b, const char *sch="", const char *opt="") + { mgl_dcont_xyz(gr, &v, &x, &y, &z, &a, &b, sch, opt); } + /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data + /** Style ‘t’/‘T’ draw contour labels below/above contours. */ + inline void DCont(const mglDataA &v, const mglDataA &a, const mglDataA &b, const char *sch="", const char *opt="") + { mgl_dcont(gr, &v, &a, &b, sch, opt); } + /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data specified parametrically + /** Style ‘t’/‘T’ draw contour labels below/above contours. + * Option "value" set the number of isosurfaces (default is 3). */ + inline void DCont(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const mglDataA &b, const char *sch="", const char *opt="") + { mgl_dcont_xyz(gr, NULL, &x, &y, &z, &a, &b, sch, opt); } + /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data + /** Style ‘t’/‘T’ draw contour labels below/above contours. + * Option "value" set the number of isosurfaces (default is 3). */ + inline void DCont(const mglDataA &a, const mglDataA &b, const char *sch="", const char *opt="") + { mgl_dcont(gr, NULL, &a, &b, sch, opt); } + /// Draw grid lines for density plot at slice for 3d data specified parametrically /** Style ‘x’ or ‘z’ produce plot perpendicular to x- or z-direction correspondingly.*/ inline void Grid3(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const char *stl="", double sVal=-1, const char *opt="") diff --git a/include/mgl2/mgl_cf.h b/include/mgl2/mgl_cf.h index 66d3f16..90b399c 100644 --- a/include/mgl2/mgl_cf.h +++ b/include/mgl2/mgl_cf.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/opengl.h b/include/mgl2/opengl.h index 98cf1f4..6b669c5 100644 --- a/include/mgl2/opengl.h +++ b/include/mgl2/opengl.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/other.h b/include/mgl2/other.h index c299ba7..be93b45 100644 --- a/include/mgl2/other.h +++ b/include/mgl2/other.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/parser.h b/include/mgl2/parser.h index 488c577..b5f8296 100644 --- a/include/mgl2/parser.h +++ b/include/mgl2/parser.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -51,7 +51,7 @@ struct mglCommand /// 12 - axis, 13 - primitives, 14 - axis setup, 15 - text/legend, 16 - data transform int type; }; -extern mglCommand mgls_prg_cmd[], mgls_dat_cmd[], mgls_grf_cmd[], mgls_set_cmd[], mgls_prm_cmd[]; +extern mglCommand mgls_prg_cmd[], mgls_dat_cmd[], mgls_grf_cmd[], mgls_set_cmd[], mgls_prm_cmd[], mgls_rnd_cmd[]; //----------------------------------------------------------------------------- /// Structure for function name and position. struct mglFunc diff --git a/include/mgl2/pde.h b/include/mgl2/pde.h index acf1283..7d2c6ec 100644 --- a/include/mgl2/pde.h +++ b/include/mgl2/pde.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -64,6 +64,10 @@ HMDT MGL_EXPORT mgl_ode_solve(void (*func)(const mreal *x, mreal *dx, void *par) HMDT MGL_EXPORT mgl_ode_solve_str(const char *func, const char *var, HCDT x0, mreal dt, mreal tmax); /// Saves result of ODE solving for var complex variables with right part func (separated by ';') and initial conditions x0 over time interval [0,tmax] with time step dt HADT MGL_EXPORT mgl_ode_solve_str_c(const char *func, const char *var, HCDT x0, mreal dt, mreal tmax); +/// Saves result of ODE solving of n*m equations for m variables var with right part func (separated by ';') and initial conditions x0 over time interval [0,tmax] with time step dt +HMDT MGL_EXPORT mgl_ode_solve_set(const char *func, const char *var, char brd, HCDT x0, mreal dt, mreal tmax); +/// Saves result of ODE solving of n*m equations for m variables var with right part func (separated by ';') and initial conditions x0 over time interval [0,tmax] with time step dt +HADT MGL_EXPORT mgl_ode_solve_set_c(const char *func, const char *var, char brd, HCDT x0, mreal dt, mreal tmax); /// Saves result of ODE solving of n equations with right part func and initial conditions x0 over time interval [0,tmax] with time step dt. Function bord (if not NULL) is called each time step to apply border reflection. HMDT MGL_EXPORT mgl_ode_solve_ex(void (*func)(const mreal *x, mreal *dx, void *par), int n, const mreal *x0, mreal dt, mreal tmax, void *par, void (*bord)(mreal *x, const mreal *xp, void *par)); /// Finds ray with starting point r0, p0 (and prepares ray data for mgl_qo2d_solve) diff --git a/include/mgl2/plot.h b/include/mgl2/plot.h index 90312df..bc6649f 100644 --- a/include/mgl2/plot.h +++ b/include/mgl2/plot.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -253,6 +253,19 @@ void MGL_EXPORT mgl_candle_yv_(uintptr_t *gr, uintptr_t *v1, uintptr_t *v2, uint void MGL_EXPORT mgl_candle(HMGL gr, HCDT v, HCDT y1, HCDT y2, const char *pen, const char *opt); void MGL_EXPORT mgl_candle_(uintptr_t *gr, uintptr_t *y, uintptr_t *y1, uintptr_t *y2, const char *pen, const char *opt,int,int); +/// Draw lines with arrows between points {x1,y1,z1} and {x2,y2,z2} +void MGL_EXPORT mgl_lines_xyz(HMGL gr, HCDT x1, HCDT y1, HCDT z1, HCDT x2, HCDT y2, HCDT z2, const char *pen, const char *opt); +void MGL_EXPORT mgl_lines_xyz_(uintptr_t *gr, uintptr_t *x1, uintptr_t *y1, uintptr_t *z1, uintptr_t *x2, uintptr_t *y2, uintptr_t *z2, const char *pen, const char *opt,int,int); +/// Draw lines with arrows between points {x1,y1,zMin} and {x2,y2,zMin} +void MGL_EXPORT mgl_lines_xy(HMGL gr, HCDT x1, HCDT y1, HCDT x2, HCDT y2, const char *pen, const char *opt); +void MGL_EXPORT mgl_lines_xy_(uintptr_t *gr, uintptr_t *x1, uintptr_t *y1, uintptr_t *x2, uintptr_t *y2, const char *pen, const char *opt,int,int); +/// Draw lines with arrows between points {x1,y} and {x2,y} with y in y-axis range +void MGL_EXPORT mgl_lines_x(HMGL gr, HCDT x1, HCDT x2, const char *pen, const char *opt); +void MGL_EXPORT mgl_lines_x_(uintptr_t *gr, uintptr_t *x1, uintptr_t *x2, const char *pen, const char *opt,int,int); +/// Draw lines lines with arrows between {x,y1} and {x,y2} with x in x-axis range +void MGL_EXPORT mgl_lines(HMGL gr, HCDT y1, HCDT y2 ,const char *pen, const char *opt); +void MGL_EXPORT mgl_lines_(uintptr_t *gr, uintptr_t *y1, uintptr_t *y2, const char *pen, const char *opt,int,int); + #ifdef __cplusplus } #endif diff --git a/include/mgl2/prim.h b/include/mgl2/prim.h index 102a76c..7a7b824 100644 --- a/include/mgl2/prim.h +++ b/include/mgl2/prim.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/qmathgl.h b/include/mgl2/qmathgl.h index 228ddc5..ac4d8ff 100644 --- a/include/mgl2/qmathgl.h +++ b/include/mgl2/qmathgl.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -43,9 +43,8 @@ public: bool enableMouse; ///< Enable mouse handlers bool enableWheel; ///< Enable mouse wheel handlers QString primitives; ///< Manual primitives, defined by user - mglCanvas *gr; ///< Built-in mglCanvas instance (mglCanvasQT is used by default) - QMathGL(QWidget *parent = 0, Qt::WindowFlags f = 0); + QMathGL(QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags()); virtual ~QMathGL(); double getRatio(); void setPopup(QMenu *p) { popup = p; } ///< Set popup menu pointer @@ -54,6 +53,9 @@ public: inline void setGraph(mglGraph *GR) { setGraph(GR->Self()); } inline HMGL getGraph() { return (HMGL)gr; } + /// Nullify grapher object for disabling double free. NOTE: this is internal function. + void noGraph() {gr=0;}; + /// Set drawing functions and its parameter void setDraw(int (*func)(mglBase *gr, void *par), void *par); void setDraw(mglDraw *dr); @@ -185,6 +187,7 @@ protected: void wheelEvent(QWheelEvent *); void mouseDoubleClickEvent(QMouseEvent *); + mglCanvas *gr; ///< Built-in mglCanvas instance (mglCanvasQT is used by default) void *draw_par; ///< Parameters for drawing function mglCanvasWnd::DrawFunc. /// Drawing function for window procedure. It should return the number of frames. int (*draw_func)(mglBase *gr, void *par); diff --git a/include/mgl2/qt.h b/include/mgl2/qt.h index f1fa0ea..3e4adcd 100644 --- a/include/mgl2/qt.h +++ b/include/mgl2/qt.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/surf.h b/include/mgl2/surf.h index c828354..f1dc4d2 100644 --- a/include/mgl2/surf.h +++ b/include/mgl2/surf.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/thread.h b/include/mgl2/thread.h index 537c9b0..a8d8cf7 100644 --- a/include/mgl2/thread.h +++ b/include/mgl2/thread.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/type.h b/include/mgl2/type.h index 4f18f71..1fcb126 100644 --- a/include/mgl2/type.h +++ b/include/mgl2/type.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -194,6 +194,12 @@ struct MGL_EXPORT mglString #if MGL_HAVE_RVAL mglString(mglString &&d):s(d.s),w(d.w) { d.s=NULL; d.w=NULL; } #endif + mglString(wchar_t ch) + { + s=new char[2]; w=new wchar_t[2]; + s[0] = char(ch&0xff); w[0] = ch; + s[1] = w[1] = 0; + } mglString(const char *str) { if(str) diff --git a/include/mgl2/vect.h b/include/mgl2/vect.h index cf8c5c1..b03a9fb 100644 --- a/include/mgl2/vect.h +++ b/include/mgl2/vect.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/volume.h b/include/mgl2/volume.h index c5efca9..dc803a7 100644 --- a/include/mgl2/volume.h +++ b/include/mgl2/volume.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/window.h b/include/mgl2/window.h index d20f348..f39c216 100644 --- a/include/mgl2/window.h +++ b/include/mgl2/window.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/wnd.h b/include/mgl2/wnd.h index 0af0811..ae48ff9 100644 --- a/include/mgl2/wnd.h +++ b/include/mgl2/wnd.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/wnd_cf.h b/include/mgl2/wnd_cf.h index ee70733..3a0c451 100644 --- a/include/mgl2/wnd_cf.h +++ b/include/mgl2/wnd_cf.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/mgl2/wx.h b/include/mgl2/wx.h index b7d208e..f722d5d 100644 --- a/include/mgl2/wx.h +++ b/include/mgl2/wx.h @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/include/xpm/arc.xpm b/include/xpm/arc.xpm index 28f80a1..3416cf1 100644 --- a/include/xpm/arc.xpm +++ b/include/xpm/arc.xpm @@ -2,7 +2,7 @@ static const char * arc_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ...... ", " .. .. ", " . . ", diff --git a/include/xpm/arrow_a.xpm b/include/xpm/arrow_a.xpm index 457c0aa..f841dd4 100644 --- a/include/xpm/arrow_a.xpm +++ b/include/xpm/arrow_a.xpm @@ -2,7 +2,7 @@ static const char * arrow_a_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/arrow_d.xpm b/include/xpm/arrow_d.xpm index 834f703..fa5ae6e 100644 --- a/include/xpm/arrow_d.xpm +++ b/include/xpm/arrow_d.xpm @@ -2,7 +2,7 @@ static const char * arrow_d_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/arrow_i.xpm b/include/xpm/arrow_i.xpm index a8c617e..3bc2959 100644 --- a/include/xpm/arrow_i.xpm +++ b/include/xpm/arrow_i.xpm @@ -2,7 +2,7 @@ static const char * arrow_i_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " .. ", diff --git a/include/xpm/arrow_k.xpm b/include/xpm/arrow_k.xpm index 840d325..339201b 100644 --- a/include/xpm/arrow_k.xpm +++ b/include/xpm/arrow_k.xpm @@ -2,7 +2,7 @@ static const char * arrow_k_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " .. ", diff --git a/include/xpm/arrow_n.xpm b/include/xpm/arrow_n.xpm index 305238b..52f3587 100644 --- a/include/xpm/arrow_n.xpm +++ b/include/xpm/arrow_n.xpm @@ -2,7 +2,7 @@ static const char * arrow_n_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/arrow_o.xpm b/include/xpm/arrow_o.xpm index 6f4b583..807fb0c 100644 --- a/include/xpm/arrow_o.xpm +++ b/include/xpm/arrow_o.xpm @@ -2,7 +2,7 @@ static const char * arrow_o_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/arrow_s.xpm b/include/xpm/arrow_s.xpm index ddeeb7f..7bc2813 100644 --- a/include/xpm/arrow_s.xpm +++ b/include/xpm/arrow_s.xpm @@ -2,7 +2,7 @@ static const char * arrow_s_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/arrow_t.xpm b/include/xpm/arrow_t.xpm index 71ff9dc..f6c1f91 100644 --- a/include/xpm/arrow_t.xpm +++ b/include/xpm/arrow_t.xpm @@ -2,7 +2,7 @@ static const char * arrow_t_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/arrow_v.xpm b/include/xpm/arrow_v.xpm index 038a3e5..c5eb9c4 100644 --- a/include/xpm/arrow_v.xpm +++ b/include/xpm/arrow_v.xpm @@ -2,7 +2,7 @@ static const char * arrow_v_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/axis.xpm b/include/xpm/axis.xpm index 65014f1..9be05e5 100644 --- a/include/xpm/axis.xpm +++ b/include/xpm/axis.xpm @@ -2,7 +2,7 @@ static const char * axis_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " .. ", " . ", diff --git a/include/xpm/axis_sh.xpm b/include/xpm/axis_sh.xpm index d09869f..775288f 100644 --- a/include/xpm/axis_sh.xpm +++ b/include/xpm/axis_sh.xpm @@ -2,7 +2,7 @@ static const char * axis_sh_xpm[] = { "16 16 3 1", " c None", -". c #000000", +". c #007f7f", "+ c #FF0000", " ", " . ", diff --git a/include/xpm/barrow_a.xpm b/include/xpm/barrow_a.xpm index 8545b8f..5753905 100644 --- a/include/xpm/barrow_a.xpm +++ b/include/xpm/barrow_a.xpm @@ -2,7 +2,7 @@ const char * barrow_a_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/barrow_d.xpm b/include/xpm/barrow_d.xpm index fe133de..00c4262 100644 --- a/include/xpm/barrow_d.xpm +++ b/include/xpm/barrow_d.xpm @@ -2,7 +2,7 @@ const char * barrow_d_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/barrow_i.xpm b/include/xpm/barrow_i.xpm index 54e91ad..e4104b3 100644 --- a/include/xpm/barrow_i.xpm +++ b/include/xpm/barrow_i.xpm @@ -2,7 +2,7 @@ const char * barrow_i_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " .. ", diff --git a/include/xpm/barrow_k.xpm b/include/xpm/barrow_k.xpm index be962b1..820c9a8 100644 --- a/include/xpm/barrow_k.xpm +++ b/include/xpm/barrow_k.xpm @@ -2,7 +2,7 @@ const char * barrow_k_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " .. ", diff --git a/include/xpm/barrow_n.xpm b/include/xpm/barrow_n.xpm index 7d2b54c..c5c54d6 100644 --- a/include/xpm/barrow_n.xpm +++ b/include/xpm/barrow_n.xpm @@ -2,7 +2,7 @@ const char * barrow_n_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/barrow_o.xpm b/include/xpm/barrow_o.xpm index a0ea264..86601ce 100644 --- a/include/xpm/barrow_o.xpm +++ b/include/xpm/barrow_o.xpm @@ -2,7 +2,7 @@ const char * barrow_o_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/barrow_s.xpm b/include/xpm/barrow_s.xpm index f19c4d8..08af6b5 100644 --- a/include/xpm/barrow_s.xpm +++ b/include/xpm/barrow_s.xpm @@ -2,7 +2,7 @@ const char * barrow_s_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/barrow_t.xpm b/include/xpm/barrow_t.xpm index 06e23d5..3045694 100644 --- a/include/xpm/barrow_t.xpm +++ b/include/xpm/barrow_t.xpm @@ -2,7 +2,7 @@ const char * barrow_t_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/barrow_v.xpm b/include/xpm/barrow_v.xpm index b31d4d2..3b54b24 100644 --- a/include/xpm/barrow_v.xpm +++ b/include/xpm/barrow_v.xpm @@ -2,7 +2,7 @@ const char * barrow_v_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/box.xpm b/include/xpm/box.xpm index 23260d1..a60f054 100644 --- a/include/xpm/box.xpm +++ b/include/xpm/box.xpm @@ -1,22 +1,23 @@ /* XPM */ static const char * box_xpm[] = { -"16 16 3 1", +"16 16 4 1", " c None", ". c #000000", "+ c #666666", +"= c #ffffff", " ", " ......... ", -" .+ .. ", -" . + . . ", -" . + . . ", -" . + . . ", -" ......... . ", -" . + . . ", -" . + . . ", -" . +++.++++. ", -" . + . . ", -" . + . . ", -" . + . . ", -" .+ .. ", +" .+======.. ", +" .=+=====.=. ", +" .==+====.==. ", +" .===+===.===. ", +" .........====. ", +" .====+==.====. ", +" .====+==.====. ", +" .====+++.++++. ", +" .===+===.===. ", +" .==+====.==. ", +" .=+=====.=. ", +" .+======.. ", " ......... ", " "}; diff --git a/include/xpm/crop.xpm b/include/xpm/crop.xpm index e18a730..474cf18 100644 --- a/include/xpm/crop.xpm +++ b/include/xpm/crop.xpm @@ -2,7 +2,7 @@ static const char * crop_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " . ", " ", diff --git a/include/xpm/curve.xpm b/include/xpm/curve.xpm index 88e37e3..eb613c8 100644 --- a/include/xpm/curve.xpm +++ b/include/xpm/curve.xpm @@ -2,7 +2,7 @@ static const char * curve_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .", " .", " . ", diff --git a/include/xpm/dash_d.xpm b/include/xpm/dash_d.xpm index 6892ce6..f2e4e72 100644 --- a/include/xpm/dash_d.xpm +++ b/include/xpm/dash_d.xpm @@ -2,7 +2,7 @@ static const char * dash_d_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/dash_e.xpm b/include/xpm/dash_e.xpm index 13eaf63..97db0c5 100644 --- a/include/xpm/dash_e.xpm +++ b/include/xpm/dash_e.xpm @@ -2,7 +2,7 @@ static const char * dash_e_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/dash_i.xpm b/include/xpm/dash_i.xpm index 2ad1f1c..f012469 100644 --- a/include/xpm/dash_i.xpm +++ b/include/xpm/dash_i.xpm @@ -2,7 +2,7 @@ static const char * dash_i_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/dash_j.xpm b/include/xpm/dash_j.xpm index 70a9cc4..c5ffeb3 100644 --- a/include/xpm/dash_j.xpm +++ b/include/xpm/dash_j.xpm @@ -2,7 +2,7 @@ static const char * dash_j_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/dash_l.xpm b/include/xpm/dash_l.xpm index 4346c08..f735a73 100644 --- a/include/xpm/dash_l.xpm +++ b/include/xpm/dash_l.xpm @@ -2,7 +2,7 @@ static const char * dash_l_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/dash_m.xpm b/include/xpm/dash_m.xpm index 7cd2b39..83a3794 100644 --- a/include/xpm/dash_m.xpm +++ b/include/xpm/dash_m.xpm @@ -2,7 +2,7 @@ static const char * dash_m_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/dash_s.xpm b/include/xpm/dash_s.xpm index 4edb6c5..92d9a11 100644 --- a/include/xpm/dash_s.xpm +++ b/include/xpm/dash_s.xpm @@ -2,7 +2,7 @@ static const char * dash_s_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/delete.xpm b/include/xpm/delete.xpm index a191ea2..14158c6 100644 --- a/include/xpm/delete.xpm +++ b/include/xpm/delete.xpm @@ -1,21 +1,22 @@ /* XPM */ static const char * delete_xpm[] = { -"16 16 2 1", +"16 16 3 1", " c none", ". c #000000", +"= c #afafaf", " ", " ", " ", -" ... ... ", -" ... ... ", -" ... ... ", -" ...... ", -" .... ", -" .... ", -" ...... ", -" ... ... ", -" ... ... ", -" ... ... ", +" .. .. ", +" .=. .=. ", +" .=. .=. ", +" .=..=. ", +" .==. ", +" .==. ", +" .=..=. ", +" .=. .=. ", +" .=. .=. ", +" .. .. ", " ", " ", " "}; diff --git a/include/xpm/diff.xpm b/include/xpm/diff.xpm index b90448a..7083646 100644 --- a/include/xpm/diff.xpm +++ b/include/xpm/diff.xpm @@ -2,7 +2,7 @@ static const char * diff_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " ", " .. ", diff --git a/include/xpm/diff2.xpm b/include/xpm/diff2.xpm index 7a2d7eb..283abc7 100644 --- a/include/xpm/diff2.xpm +++ b/include/xpm/diff2.xpm @@ -2,8 +2,8 @@ static const char * diff2_xpm[] = { "16 16 3 1", " c None", -". c #000000", -"+ c #7F7F7F", +". c #007f7f", +"+ c #7FaFaF", " ", " ", " ", diff --git a/include/xpm/func.xpm b/include/xpm/func.xpm index e62cfe7..dd73369 100644 --- a/include/xpm/func.xpm +++ b/include/xpm/func.xpm @@ -2,7 +2,7 @@ static const char * func_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " ", " ", diff --git a/include/xpm/integr.xpm b/include/xpm/integr.xpm index ddccb22..4bd93d2 100644 --- a/include/xpm/integr.xpm +++ b/include/xpm/integr.xpm @@ -1,9 +1,8 @@ /* XPM */ static const char * integr_xpm[] = { -"16 16 3 1", +"16 16 2 1", " c None", -". c #000000", -"+ c #808080", +". c #007f7f", " ", " ", " ", @@ -16,7 +15,7 @@ static const char * integr_xpm[] = { " . . . . ", " . . . . ", " . ... . . ", -" . + ", +" . ", " ", " ", " "}; diff --git a/include/xpm/line.xpm b/include/xpm/line.xpm index aff1af3..fc5d2f9 100644 --- a/include/xpm/line.xpm +++ b/include/xpm/line.xpm @@ -2,7 +2,7 @@ static const char * line_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .", " . ", " . ", diff --git a/include/xpm/mark_.xpm b/include/xpm/mark_.xpm index b372f5a..002fcf6 100644 --- a/include/xpm/mark_.xpm +++ b/include/xpm/mark_.xpm @@ -2,7 +2,7 @@ static const char * mark__xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/mark_a.xpm b/include/xpm/mark_a.xpm index 29f34cb..04c5ac6 100644 --- a/include/xpm/mark_a.xpm +++ b/include/xpm/mark_a.xpm @@ -2,7 +2,7 @@ static const char * mark_a_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " . . ", " . . ", diff --git a/include/xpm/mark_cf.xpm b/include/xpm/mark_cf.xpm index f743a31..e2b24cd 100644 --- a/include/xpm/mark_cf.xpm +++ b/include/xpm/mark_cf.xpm @@ -2,7 +2,7 @@ static const char * mark_cf_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ...... ", " .. .. ", " . . ", diff --git a/include/xpm/mark_d.xpm b/include/xpm/mark_d.xpm index 678d75e..e3be025 100644 --- a/include/xpm/mark_d.xpm +++ b/include/xpm/mark_d.xpm @@ -2,7 +2,7 @@ static const char * mark_d_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " . . ", " . . ", diff --git a/include/xpm/mark_df.xpm b/include/xpm/mark_df.xpm index 582d420..a6e73ed 100644 --- a/include/xpm/mark_df.xpm +++ b/include/xpm/mark_df.xpm @@ -2,7 +2,7 @@ static const char * mark_df_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " .... ", " ...... ", diff --git a/include/xpm/mark_l.xpm b/include/xpm/mark_l.xpm index 9edd3e0..f3aa869 100644 --- a/include/xpm/mark_l.xpm +++ b/include/xpm/mark_l.xpm @@ -2,7 +2,7 @@ static const char * mark_l_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " .. . ", " . . ", diff --git a/include/xpm/mark_lf.xpm b/include/xpm/mark_lf.xpm index 2585eb4..9c8b3fa 100644 --- a/include/xpm/mark_lf.xpm +++ b/include/xpm/mark_lf.xpm @@ -2,7 +2,7 @@ static const char * mark_lf_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " .... ", " ..... ", diff --git a/include/xpm/mark_o.xpm b/include/xpm/mark_o.xpm index 3154cdc..bc9874a 100644 --- a/include/xpm/mark_o.xpm +++ b/include/xpm/mark_o.xpm @@ -2,7 +2,7 @@ static const char * mark_o_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ...... ", " .. .. ", " . . ", diff --git a/include/xpm/mark_of.xpm b/include/xpm/mark_of.xpm index 3eeaf38..a3fa739 100644 --- a/include/xpm/mark_of.xpm +++ b/include/xpm/mark_of.xpm @@ -2,7 +2,7 @@ static const char * mark_of_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ...... ", " .......... ", " ............ ", diff --git a/include/xpm/mark_p.xpm b/include/xpm/mark_p.xpm index 3f40cfb..c48b2f1 100644 --- a/include/xpm/mark_p.xpm +++ b/include/xpm/mark_p.xpm @@ -2,7 +2,7 @@ static const char * mark_p_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " . ", " . ", " . ", diff --git a/include/xpm/mark_pf.xpm b/include/xpm/mark_pf.xpm index ea9cdac..1b85e50 100644 --- a/include/xpm/mark_pf.xpm +++ b/include/xpm/mark_pf.xpm @@ -2,7 +2,7 @@ static const char * mark_pf_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", "................", ". . .", ". . .", diff --git a/include/xpm/mark_r.xpm b/include/xpm/mark_r.xpm index 8459014..3c8c49b 100644 --- a/include/xpm/mark_r.xpm +++ b/include/xpm/mark_r.xpm @@ -2,7 +2,7 @@ static const char * mark_r_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " . .. ", " . . ", diff --git a/include/xpm/mark_rf.xpm b/include/xpm/mark_rf.xpm index cedcd01..844e2cd 100644 --- a/include/xpm/mark_rf.xpm +++ b/include/xpm/mark_rf.xpm @@ -2,7 +2,7 @@ static const char * mark_rf_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " .... ", " ..... ", diff --git a/include/xpm/mark_s.xpm b/include/xpm/mark_s.xpm index 1a4c012..c4fab4f 100644 --- a/include/xpm/mark_s.xpm +++ b/include/xpm/mark_s.xpm @@ -2,7 +2,7 @@ static const char * mark_s_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", "................", ". .", ". .", diff --git a/include/xpm/mark_sf.xpm b/include/xpm/mark_sf.xpm index 5a89f1d..b132874 100644 --- a/include/xpm/mark_sf.xpm +++ b/include/xpm/mark_sf.xpm @@ -2,7 +2,7 @@ static const char * mark_sf_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", "................", "................", "................", diff --git a/include/xpm/mark_t.xpm b/include/xpm/mark_t.xpm index 1e6b398..5148539 100644 --- a/include/xpm/mark_t.xpm +++ b/include/xpm/mark_t.xpm @@ -2,7 +2,7 @@ static const char * mark_t_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " . . ", " . . ", diff --git a/include/xpm/mark_tf.xpm b/include/xpm/mark_tf.xpm index 48f61c1..964c45a 100644 --- a/include/xpm/mark_tf.xpm +++ b/include/xpm/mark_tf.xpm @@ -2,7 +2,7 @@ static const char * mark_tf_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " .... ", " ...... ", diff --git a/include/xpm/mark_v.xpm b/include/xpm/mark_v.xpm index 9f03771..9c09de0 100644 --- a/include/xpm/mark_v.xpm +++ b/include/xpm/mark_v.xpm @@ -2,7 +2,7 @@ static const char * mark_v_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/mark_vf.xpm b/include/xpm/mark_vf.xpm index 39d7e99..e2f5235 100644 --- a/include/xpm/mark_vf.xpm +++ b/include/xpm/mark_vf.xpm @@ -2,7 +2,7 @@ static const char * mark_vf_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/include/xpm/mark_x.xpm b/include/xpm/mark_x.xpm index 8d7ee78..ad17eb9 100644 --- a/include/xpm/mark_x.xpm +++ b/include/xpm/mark_x.xpm @@ -2,7 +2,7 @@ static const char * mark_x_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", ". .", " . . ", " . . ", diff --git a/include/xpm/mark_y.xpm b/include/xpm/mark_y.xpm index b5135fd..958cb39 100644 --- a/include/xpm/mark_y.xpm +++ b/include/xpm/mark_y.xpm @@ -2,7 +2,7 @@ static const char * mark_y_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " . . ", diff --git a/include/xpm/mask_a.xpm b/include/xpm/mask_a.xpm index 6949dd9..4893723 100644 --- a/include/xpm/mask_a.xpm +++ b/include/xpm/mask_a.xpm @@ -2,7 +2,7 @@ static const char *mask_a_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "##............##", "##............##", "..##........##..", diff --git a/include/xpm/mask_d.xpm b/include/xpm/mask_d.xpm index dc7f66d..6c96ab9 100644 --- a/include/xpm/mask_d.xpm +++ b/include/xpm/mask_d.xpm @@ -2,7 +2,7 @@ static const char *mask_d_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "........##......", diff --git a/include/xpm/mask_d_.xpm b/include/xpm/mask_d_.xpm index d3eee46..99e8d03 100644 --- a/include/xpm/mask_d_.xpm +++ b/include/xpm/mask_d_.xpm @@ -2,7 +2,7 @@ static const char *mask_D_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "........##......", diff --git a/include/xpm/mask_e.xpm b/include/xpm/mask_e.xpm index 2e6b528..f729a1d 100644 --- a/include/xpm/mask_e.xpm +++ b/include/xpm/mask_e.xpm @@ -2,7 +2,7 @@ static const char *mask_e_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/include/xpm/mask_i.xpm b/include/xpm/mask_i.xpm index a24c1ca..ee9cff6 100644 --- a/include/xpm/mask_i.xpm +++ b/include/xpm/mask_i.xpm @@ -2,7 +2,7 @@ static const char *mask_i_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/include/xpm/mask_j.xpm b/include/xpm/mask_j.xpm index fcc072f..7e8eadc 100644 --- a/include/xpm/mask_j.xpm +++ b/include/xpm/mask_j.xpm @@ -2,7 +2,7 @@ static const char *mask_j_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/include/xpm/mask_l.xpm b/include/xpm/mask_l.xpm index a062db6..17335f4 100644 --- a/include/xpm/mask_l.xpm +++ b/include/xpm/mask_l.xpm @@ -2,7 +2,7 @@ static const char *mask_l_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "..........####..", diff --git a/include/xpm/mask_m.xpm b/include/xpm/mask_m.xpm index e717d96..de4f308 100644 --- a/include/xpm/mask_m.xpm +++ b/include/xpm/mask_m.xpm @@ -2,7 +2,7 @@ static const char *mask_m_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/include/xpm/mask_o.xpm b/include/xpm/mask_o.xpm index 3664bc4..f9b9fa3 100644 --- a/include/xpm/mask_o.xpm +++ b/include/xpm/mask_o.xpm @@ -2,7 +2,7 @@ static const char *mask_o_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/include/xpm/mask_o_.xpm b/include/xpm/mask_o_.xpm index fbecff8..211df44 100644 --- a/include/xpm/mask_o_.xpm +++ b/include/xpm/mask_o_.xpm @@ -2,7 +2,7 @@ static const char *mask_O_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/include/xpm/mask_p.xpm b/include/xpm/mask_p.xpm index d29f774..a49e027 100644 --- a/include/xpm/mask_p.xpm +++ b/include/xpm/mask_p.xpm @@ -2,7 +2,7 @@ static const char *mask_p_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "........##......", "........##......", "........##......", diff --git a/include/xpm/mask_r.xpm b/include/xpm/mask_r.xpm index 47f2aa5..2459137 100644 --- a/include/xpm/mask_r.xpm +++ b/include/xpm/mask_r.xpm @@ -2,7 +2,7 @@ static const char *mask_r_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "..####..........", diff --git a/include/xpm/mask_s.xpm b/include/xpm/mask_s.xpm index a5e1e82..b83be52 100644 --- a/include/xpm/mask_s.xpm +++ b/include/xpm/mask_s.xpm @@ -2,7 +2,7 @@ static const char *mask_s_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/include/xpm/mask_s_.xpm b/include/xpm/mask_s_.xpm index 652db36..2ff6574 100644 --- a/include/xpm/mask_s_.xpm +++ b/include/xpm/mask_s_.xpm @@ -2,7 +2,7 @@ static const char *mask_S_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/include/xpm/mask_t.xpm b/include/xpm/mask_t.xpm index d153fc8..5052969 100644 --- a/include/xpm/mask_t.xpm +++ b/include/xpm/mask_t.xpm @@ -2,7 +2,7 @@ static const char *mask_t_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/include/xpm/mask_u.xpm b/include/xpm/mask_u.xpm index 61996fc..6873046 100644 --- a/include/xpm/mask_u.xpm +++ b/include/xpm/mask_u.xpm @@ -2,7 +2,7 @@ static const char *mask_u_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/include/xpm/none.xpm b/include/xpm/none.xpm index e81575f..3ca0ca5 100644 --- a/include/xpm/none.xpm +++ b/include/xpm/none.xpm @@ -2,7 +2,7 @@ static const char * none_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", "................", ".. ..", ". . . .", diff --git a/include/xpm/oper.xpm b/include/xpm/oper.xpm index ca6a51d..c4939d0 100644 --- a/include/xpm/oper.xpm +++ b/include/xpm/oper.xpm @@ -2,7 +2,7 @@ static const char * oper_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " . ", " . ", diff --git a/include/xpm/oper_a.xpm b/include/xpm/oper_a.xpm index afa1a80..ddf42bc 100644 --- a/include/xpm/oper_a.xpm +++ b/include/xpm/oper_a.xpm @@ -2,7 +2,7 @@ static const char * oper_a_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " ", " ", diff --git a/include/xpm/oper_d.xpm b/include/xpm/oper_d.xpm index 2b89d5e..ff8bd60 100644 --- a/include/xpm/oper_d.xpm +++ b/include/xpm/oper_d.xpm @@ -2,7 +2,7 @@ static const char * oper_d_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " ", " ", diff --git a/include/xpm/oper_dir.xpm b/include/xpm/oper_dir.xpm index f6f7b8a..0a3f03c 100644 --- a/include/xpm/oper_dir.xpm +++ b/include/xpm/oper_dir.xpm @@ -2,7 +2,7 @@ static const char * oper_dir_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " . ", " . . ", " . . ", diff --git a/include/xpm/oper_m.xpm b/include/xpm/oper_m.xpm index f2f8db1..5eb90f1 100644 --- a/include/xpm/oper_m.xpm +++ b/include/xpm/oper_m.xpm @@ -2,8 +2,8 @@ static const char * oper_m_xpm[] = { "16 16 3 1", " c None", -". c #000000", -"+ c #7F7F7F", +". c #007f7f", +"+ c #7FAFAF", " ", " ", " ", diff --git a/include/xpm/oper_of.xpm b/include/xpm/oper_of.xpm index c22a9ba..be3e169 100644 --- a/include/xpm/oper_of.xpm +++ b/include/xpm/oper_of.xpm @@ -2,7 +2,7 @@ static const char * oper_of_xpm[] = { "16 16 3 1", " c None", -". c #000000", +". c #007f7f", "+ c #FF0000", " . ++ ", " . . ++ ", diff --git a/include/xpm/oper_s.xpm b/include/xpm/oper_s.xpm index 6bda134..a83db2a 100644 --- a/include/xpm/oper_s.xpm +++ b/include/xpm/oper_s.xpm @@ -2,7 +2,7 @@ static const char * oper_s_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " ", " ", diff --git a/include/xpm/option.xpm b/include/xpm/option.xpm index d7dd6d6..3ef30d8 100644 --- a/include/xpm/option.xpm +++ b/include/xpm/option.xpm @@ -2,8 +2,8 @@ static const char * option_xpm[] = { "16 16 3 1", " c None", -". c #000000", -"+ c #7F0000", +". c #7f0000", +"+ c #FF0000", " ", " ", " ", diff --git a/include/xpm/pause.xpm b/include/xpm/pause.xpm index e09d88b..e2421eb 100644 --- a/include/xpm/pause.xpm +++ b/include/xpm/pause.xpm @@ -2,7 +2,7 @@ static const char * pause_xpm[] = { "16 16 3 1", " c None", -". c #777777", +". c #afafaf", "q c #000000", " ", " ", diff --git a/include/xpm/plot.xpm b/include/xpm/plot.xpm index acc1eea..70bb211 100644 --- a/include/xpm/plot.xpm +++ b/include/xpm/plot.xpm @@ -2,7 +2,7 @@ static const char * plot_xpm[] = { "16 16 4 1", " c None", -". c #000000", +". c #007f7f", "+ c #0000FF", "@ c #FF0000", " ", diff --git a/include/xpm/polygon.xpm b/include/xpm/polygon.xpm index ecbdb8f..6941429 100644 --- a/include/xpm/polygon.xpm +++ b/include/xpm/polygon.xpm @@ -2,7 +2,7 @@ static const char *polygon_xpm[]={ "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " .. ", " . . ", diff --git a/include/xpm/size.xpm b/include/xpm/size.xpm index 3a1d846..be90e12 100644 --- a/include/xpm/size.xpm +++ b/include/xpm/size.xpm @@ -2,7 +2,7 @@ static const char * size_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " .............. ", diff --git a/include/xpm/squize.xpm b/include/xpm/squize.xpm index fa68e6a..25aeb58 100644 --- a/include/xpm/squize.xpm +++ b/include/xpm/squize.xpm @@ -2,8 +2,8 @@ static const char * squize_xpm[] = { "16 16 3 1", " c None", -". c #000000", -"+ c #7F7F7F", +". c #007f00", +"+ c #7FFF7F", " ", " ", " ...... ", diff --git a/include/xpm/text.xpm b/include/xpm/text.xpm index 56317c0..137dcb2 100644 --- a/include/xpm/text.xpm +++ b/include/xpm/text.xpm @@ -2,7 +2,7 @@ static const char * text_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ............ ", " ............ ", diff --git a/include/xpm/update.xpm b/include/xpm/update.xpm index 5ee1dd6..c7f53d2 100644 --- a/include/xpm/update.xpm +++ b/include/xpm/update.xpm @@ -2,7 +2,7 @@ static const char *update_xpm[] = { "16 16 2 1", " c None", -". c #00007F", +". c #007ffF", " ", " ", " .... ", diff --git a/include/xpm/wire.xpm b/include/xpm/wire.xpm index b67d50b..6996fa5 100644 --- a/include/xpm/wire.xpm +++ b/include/xpm/wire.xpm @@ -2,7 +2,7 @@ static const char * wire_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " ", " ", diff --git a/json/MainWindow.cpp b/json/MainWindow.cpp index 748251d..e6d03b4 100644 --- a/json/MainWindow.cpp +++ b/json/MainWindow.cpp @@ -43,7 +43,7 @@ MainWindow::MainWindow(QWidget* const parent) : QMainWindow(parent), ui(new Ui:: // inject backend object each time javascript object is cleared connect(ui->webView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(injectBackendObject())); // set url to load - ui->webView->load(QUrl(QString("file:///%1/../../json/%2").arg(qApp->applicationDirPath()).arg("index.html"))); + ui->webView->load(QUrl(QString("file:///%1/../../json/%2").arg(qApp->applicationDirPath(),"index.html"))); } //----------------------------------------------------------------------------- void MainWindow::injectBackendObject() diff --git a/lang/CMakeLists.txt b/lang/CMakeLists.txt index da245d2..475dabe 100644 --- a/lang/CMakeLists.txt +++ b/lang/CMakeLists.txt @@ -18,17 +18,17 @@ endif(NOT SWIG_FOUND) INCLUDE(${SWIG_USE_FILE}) if(enable-python) - set(Python_ADDITIONAL_VERSIONS 2.7) - FIND_PACKAGE(PythonInterp) + set(Python_ADDITIONAL_VERSIONS ${PY3VERSION_DOTTED}) + FIND_PACKAGE(PythonInterp ${PY3VERSION_DOTTED} REQUIRED) if(NOT PYTHONINTERP_FOUND) message(SEND_ERROR "Couldn't find python interpreter.") endif(NOT PYTHONINTERP_FOUND) - FIND_PACKAGE(PythonLibs) + FIND_PACKAGE(PythonLibs ${PY3VERSION_DOTTED} REQUIRED) if(NOT PYTHONLIBS_FOUND) message(SEND_ERROR "Couldn't find python development libraries.") endif(NOT PYTHONLIBS_FOUND) execute_process( - COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print numpy.get_include()" + COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print (numpy.get_include())" OUTPUT_VARIABLE NUMPY_INCLUDE_PATH RESULT_VARIABLE NUMPY_ERR OUTPUT_STRIP_TRAILING_WHITESPACE @@ -39,11 +39,11 @@ if(enable-python) include_directories(${PYTHON_INCLUDE_DIR} ${NUMPY_INCLUDE_PATH}) execute_process( - COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}')" + COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}'))" OUTPUT_VARIABLE MGL_PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE) set(SWIG_MODULE_mathgl_EXTRA_DEPS numpy.i ${src_imp_dep}) - if(${CMAKE_VERSION} VERSION_LESS "3.8.0") + if(${CMAKE_VERSION} VERSION_LESS "3.8.0") SWIG_ADD_MODULE(mathgl python mathgl.i) else(${CMAKE_VERSION} VERSION_LESS "3.8.0") SWIG_ADD_LIBRARY(mathgl LANGUAGE python SOURCES mathgl.i) @@ -58,8 +58,8 @@ if(enable-python) ) add_custom_target(mgl_python_module ALL DEPENDS _mathgl mathgl.pyc) - install(FILES ${MathGL2_BINARY_DIR}/lang/mathgl.py ${MathGL2_BINARY_DIR}/lang/mathgl.pyc DESTINATION ${MGL_PYTHON_SITE_PACKAGES}) - install (TARGETS _mathgl LIBRARY DESTINATION ${MGL_PYTHON_SITE_PACKAGES}) + install(FILES ${MathGL2_BINARY_DIR}/lang/mathgl.py ${MathGL2_BINARY_DIR}/lang/__pycache__/mathgl.cpython-${PY3VERSION_NODOT}.pyc DESTINATION ${MGL_PYTHON_SITE_PACKAGES}/mathgl/__pycache__) + install (TARGETS _mathgl LIBRARY DESTINATION ${MGL_PYTHON_SITE_PACKAGES}/mathgl) set(mgl_clean_files ${mgl_clean_files} mathgl.py) endif(enable-python) diff --git a/lang/data.i b/lang/data.i index 6d289d5..8f2fe0d 100644 --- a/lang/data.i +++ b/lang/data.i @@ -30,7 +30,6 @@ public: bool link; ///< use external data (i.e. don't free it) /// Initiate by other mglData variable - mglData(const mglData &d) { a=0; mgl_data_set(this,&d); } // NOTE: must be constructor for mglData& to exclude copy one mglData(const mglData *d) { a=0; mgl_data_set(this, d); } mglData(bool, mglData *d) // NOTE: Variable d will be deleted!!! { if(d) @@ -185,6 +184,34 @@ public: /// Make new id inline void NewId() { id.clear(); } + /// Fills data by integer random numbers of uniform distribution in range [lo,hi] + inline void RndInteger(long lo, long hi) + { mgl_data_rnd_integer(this, lo, hi); } + /// Fills data by random numbers of uniform distribution in range [lo,hi] + inline void RndUniform(mreal lo, mreal hi) + { mgl_data_rnd_uniform(this, lo, hi); } + /// Fills data by random numbers of Bernoulli distribution + inline void RndBernoulli(mreal p=0.5) + { mgl_data_rnd_bernoulli(this, p); } + /// Fills data by random numbers of binomial distribution + inline void RndBinomial(long trials, mreal p=0.5) + { mgl_data_rnd_binomial(this, trials, p); } + /// Fills data by random numbers of Gaussian distribution + inline void RndGaussian(mreal mu=0.0, mreal sigma=1.0) + { mgl_data_rnd_gaussian(this, mu, sigma); } + /// Fills data by random numbers of exponential distribution + inline void RndExponential(mreal lambda) + { mgl_data_rnd_exponential(this, lambda); } + /// Fills data by random numbers of discrete distribution according A + inline void RndDiscrete(const mglData &A) + { mgl_data_rnd_discrete(this, &A); } + /// Shuffles elements or slices of data array + inline void RndShuffle(char dir='a') + { mgl_shuffle(this, dir); } + /// Fills data by fractional brownian motions along x-direction + inline void RndBrownian(mreal y1, mreal y2, mreal sigma, mreal alpha) + { mgl_data_brownian(this, y1, y2, sigma, alpha); } + /// Read data from tab-separated text file with auto determining size inline bool Read(const char *fname) { return mgl_data_read(this,fname); } @@ -221,6 +248,11 @@ public: /// Scan textual file for template and fill data array inline int ScanFile(const char *fname, const char *templ) { return mgl_data_scan_file(this,fname, templ); } + /// Read data from binary file of type: 0 - double, 1 - float, 2 - long double, 3 - long int, 4 - int, 5 - short int, 6 - char. + /** NOTE: this function may not correctly read binary files written in different CPU kind! */ + inline bool ReadBin(const char *fname, int type) + { return mgl_data_read_bin(this, fname, type); } + /// Get column (or slice) of the data filled by formulas of named columns inline mglData Column(const char *eq) const @@ -246,6 +278,9 @@ public: { return mglData(true,mgl_data_section(this,&ids,dir,val)); } inline mglData Section(long id, char dir='y', mreal val=NAN) const { return mglData(true,mgl_data_section_val(this,id,dir,val)); } + /// Get contour lines for dat[i,j]=val. NAN values separate the the curves. + inline mglData Conts(mreal val) + { return mglData(true,mgl_data_conts(val,this)); } /// Get trace of the data array inline mglData Trace() const @@ -259,12 +294,22 @@ public: /// Get array which is result of summation in given direction or directions inline mglData Sum(const char *dir) const { return mglData(true,mgl_data_sum(this,dir)); } + /// Get array of positions of first value large val + inline mglData First(const char *dir, mreal val) const + { return mglData(true,mgl_data_first_dir(this,dir,val)); } + /// Get array of positions of last value large val + inline mglData Last(const char *dir, mreal val) const + { return mglData(true,mgl_data_last_dir(this,dir,val)); } + /// Get array which is result of maximal values in given direction or directions inline mglData Max(const char *dir) const { return mglData(true,mgl_data_max_dir(this,dir)); } /// Get array which is result of minimal values in given direction or directions inline mglData Min(const char *dir) const { return mglData(true,mgl_data_min_dir(this,dir)); } + /// Get positions of local maximums and minimums + inline mglData MinMax() const + { return mglData(true,mgl_data_minmax(this)); } /// Get the data which is direct multiplication (like, d[i,j] = this[i]*a[j] and so on) inline mglData Combine(const mglData &dat) const { return mglData(true,mgl_data_combine(this,&dat)); } @@ -340,7 +385,9 @@ public: * ‘x’, ‘y’, ‘z’ for 1st, 2nd or 3d dimension; * ‘dN’ for linear averaging over N points; * ‘3’ for linear averaging over 3 points; - * ‘5’ for linear averaging over 5 points. + * ‘5’ for linear averaging over 5 points; + * ‘^’ for finding upper bound; + * ‘_’ for finding lower bound. * By default quadratic averaging over 5 points is used. */ inline void Smooth(const char *dirs="xyz",mreal delta=0) { mgl_data_smooth(this,dirs,delta); } @@ -356,6 +403,10 @@ public: /// Project the periodical data to range [v1,v2] (like mod() function). Separate branches by NAN if sep=true. inline void Coil(mreal v1, mreal v2, bool sep=true) { mgl_data_coil(this, v1, v2, sep); } + /// Keep the data sign/value along line i and j in given direction. + /** Parameter "how" may contain: 'x','y' or 'z' for direction (default is 'y'); 'a' for keeping amplitude instead of sign.*/ + inline void Keep(const char *how, long i, long j=0) + { mgl_data_keep(this, how, i, j); } /// Apply Hankel transform inline void Hankel(const char *dir) { mgl_data_hankel(this,dir); } @@ -516,6 +567,9 @@ inline mglData mglRay(const char *ham, mglPoint r0, mglPoint p0, mreal dt=0.1, m /// Saves result of ODE solving for var complex variables with right part func (separated by ';') and initial conditions x0 over time interval [0,tmax] with time step dt inline mglData mglODE(const char *func, const char *var, const mglData &ini, mreal dt=0.1, mreal tmax=10) { return mglData(true, mgl_ode_solve_str(func,var, &ini, dt, tmax)); } +/// Saves result of ODE solving for var complex variables with right part func (separated by ';') and initial conditions x0 of size n*m over time interval [0,tmax] with time step dt +inline mglData mglODEs(const char *func, const char *var, char brd, const mglData &ini, mreal dt=0.1, mreal tmax=10) +{ return mglData(true, mgl_ode_solve_set(func,var, brd, &ini, dt, tmax)); } //----------------------------------------------------------------------------- /// Get array as solution of tridiagonal system of equations a[i]*x[i-1]+b[i]*x[i]+c[i]*x[i+1]=d[i] /** String \a how may contain: diff --git a/lang/mgl.i b/lang/mgl.i index 48badd9..7e20a4e 100644 --- a/lang/mgl.i +++ b/lang/mgl.i @@ -21,25 +21,38 @@ /// Wrapper class for all graphics class mglGraph { - mglGraph(const mglGraph &t) {} // copying is not allowed - const mglGraph &operator=(const mglGraph &t) { return t; } + mglGraph(const mglGraph &) {gr=0;} // copying is not allowed + const mglGraph &operator=(const mglGraph &t) { gr=0; return t; } protected: HMGL gr; public: - inline mglGraph(int kind=0, int width=600, int height=400) - { - if(kind==-1) gr=NULL; + HMPR pr; ///< Pointer to associated MGL parser + mglGraph(int kind=-1) + { pr = NULL; + if(kind==0) gr=mgl_create_graph(600, 400); #if MGL_HAVE_OPENGL else if(kind==1) gr=mgl_create_graph_gl(); #else else if(kind==1) - { gr=mgl_create_graph(width, height); + { gr=mgl_default_graph(); mgl_use_graph(gr,1); SetGlobalWarn("OpenGL support was disabled. Please, enable it and rebuild MathGL."); } #endif - else gr=mgl_create_graph(width, height); + else { gr=mgl_default_graph(); mgl_use_graph(gr,1); } } - inline mglGraph(HMGL graph) - { gr = graph; mgl_use_graph(gr,1); } + mglGraph(int kind, int width, int height) + { pr = NULL; + if(kind==0) gr=mgl_create_graph(width, height); +#if MGL_HAVE_OPENGL + else if(kind==1) gr=mgl_create_graph_gl(); +#else + else if(kind==1) + { gr=mgl_default_graph(); mgl_use_graph(gr,1); + SetGlobalWarn("OpenGL support was disabled. Please, enable it and rebuild MathGL."); } +#endif + else { gr=mgl_default_graph(); mgl_use_graph(gr,1); mgl_set_size(gr,width,height); } + } + mglGraph(HMGL graph) + { pr = NULL; gr = graph; mgl_use_graph(gr,1); } virtual ~mglGraph() { if(mgl_use_graph(gr,-1)<1) mgl_delete_graph(gr); } /// Get pointer to internal HMGL object @@ -97,6 +110,8 @@ public: inline void SetMeshNum(int num) { mgl_set_meshnum(gr, num); } /// Set number of visible faces (use 0 to draw all of them) inline void SetFaceNum(int num) { mgl_set_facenum(gr, num); } + /// Set TeX parsing at text drawing + inline void SetTeXparse(bool val) { mgl_set_tex_parse(gr, val); } /// Set cutting for points outside of bounding box inline void SetCut(bool cut) { mgl_set_cut(gr, cut); } @@ -157,6 +172,8 @@ public: static inline void SetGlobalWarn(const char *text) { mgl_set_global_warn(text); } /// Get text of global warning message(s) static inline const char *GlobalWarn() { return mgl_get_global_warn(); } + /// Clear global warning message + static inline void ClearGlobalWarn() { mgl_clear_global_warn(); } /// Suppress printing warnings to stderr static inline void SuppressWarn(bool on) { mgl_suppress_warn(on); } /// Check if MathGL version is valid (return false) or not (return true) @@ -563,9 +580,20 @@ public: /// Clear unused points and primitives. Useful only in combination with SetFaceNum(). inline void ClearUnused() { mgl_clear_unused(gr); } - /// Load background image + /// Load background image (basic variant: no scaling, whole image) inline void LoadBackground(const char *fname, double alpha=1) { mgl_load_background(gr,fname,alpha); } + /// Load image for background from file. + /** Parameter 'how' can be: + * 'a' for filling current subplot only; + * 's' for scaling (resizing) image to whole area; + * 'c' for centering image; + * 'm' for tessellate image as mosaic. */ + void LoadBackground(const char *fname, const char *how, double alpha=1) + { mgl_load_background_ext(gr,fname,how,alpha); } + /// Fill background image by specified color + void FillBackground(const mglColor &cc) + { mgl_fill_background(gr, cc.r,cc.g,cc.b); } /// Force drawing the image and use it as background one inline void Rasterize() { mgl_rasterize(gr); } @@ -927,6 +955,17 @@ public: inline void Region(const mglData &x1, const mglData &y1, const mglData &x2, const mglData &y2, const char *pen="", const char *opt="") { mgl_region_3d(gr, &x1, &y1, NULL, &x2, &y2, NULL, pen, opt); } + /// Draw lines with arrows between points {x1,y1,z1} and {x2,y2,z2} + inline void Lines(const mglData &x1, const mglData &y1, const mglData &z1, const mglData &x2, const mglData &y2, const mglData &z2, const char *pen="", const char *opt="") + { mgl_lines_xyz(gr, &x1, &y1, &z1, &x2, &y2, &z2, pen, opt); } + /// Draw lines with arrows between points {x1,y1,zMin} and {x2,y2,zMin} + inline void Lines(const mglData &x1, const mglData &y1, const mglData &x2, const mglData &y2, const char *pen="", const char *opt="") + { mgl_lines_xy(gr, &x1, &y1, &x2, &y2, pen, opt); } + /// Draw lines with arrows between: points {x1,y} and {x2,y} with y in y-axis range if \a pen contain 'x'; or points {x,y1} and {x,y2} with x in x-axis range. + inline void Lines(const mglData &y1, const mglData &y2, const char *pen="", const char *opt="") + { if(mglchr(pen,'x')) mgl_lines_x(gr, &y1, &y2, pen, opt); + else mgl_lines(gr, &y1, &y2, pen, opt); } + /// Draw vertical lines from points {x,y,z} to axis plane inline void Stem(const mglData &x, const mglData &y, const mglData &z, const char *pen="", const char *opt="") { mgl_stem_xyz(gr, &x, &y, &z, pen, opt); } @@ -1363,6 +1402,10 @@ public: * Option "value" set the number of contour levels (default is 7). */ inline void Cont(const mglData &z, const char *sch="", const char *opt="") { mgl_cont(gr, &z, sch, opt); } + /// Draw contour lines at a[i,j]=val specified parametrically + /** Style 't'/'T' draw contour labels below/above contours.*/ + inline void ContGen(mreal val, const mglData &a, const mglData &x, const mglData &y, const mglData &z, const char *sch="", const char *opt="") + { mgl_cont_gen(gr, val, &a, &x, &y, &z, sch, opt); } /// Draw solid contours at manual levels for 2d data specified parametrically /** Style ‘_’ to draw contours at bottom of axis box. */ @@ -1382,6 +1425,9 @@ public: * Option "value" set the number of contour levels (default is 7). */ inline void ContF(const mglData &z, const char *sch="", const char *opt="") { mgl_contf(gr, &z, sch, opt); } + /// Draw solid contours between a[i,j]=v1 and a[i,j]=v2 specified parametrically */ + inline void ContFGen(mreal v1, mreal v2, const mglData &a, const mglData &x, const mglData &y, const mglData &z, const char *sch="", const char *opt="") + { mgl_contf_gen(gr, v1,v2, &a, &x, &y, &z, sch, opt); } /// Draw solid contours at manual levels for 2d data specified parametrically with specified colors /** Style ‘_’ to draw contours at bottom of axis box. */ @@ -1452,6 +1498,25 @@ public: inline void Axial(const mglData &z, const char *sch="", const char *opt="") { mgl_axial(gr, &z, sch, opt); } + /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data specified parametrically + /** Style ‘t’/‘T’ draw contour labels below/above contours. */ + inline void DCont(const mglData &v, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &b, const char *sch="", const char *opt="") + { mgl_dcont_xyz(gr, &v, &x, &y, &z, &a, &b, sch, opt); } + /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data + /** Style ‘t’/‘T’ draw contour labels below/above contours. */ + inline void DCont(const mglData &v, const mglData &a, const mglData &b, const char *sch="", const char *opt="") + { mgl_dcont(gr, &v, &a, &b, sch, opt); } + /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data specified parametrically + /** Style ‘t’/‘T’ draw contour labels below/above contours. + * Option "value" set the number of isosurfaces (default is 3). */ + inline void DCont(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &b, const char *sch="", const char *opt="") + { mgl_dcont_xyz(gr, NULL, &x, &y, &z, &a, &b, sch, opt); } + /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data + /** Style ‘t’/‘T’ draw contour labels below/above contours. + * Option "value" set the number of isosurfaces (default is 3). */ + inline void DCont(const mglData &a, const mglData &b, const char *sch="", const char *opt="") + { mgl_dcont(gr, NULL, &a, &b, sch, opt); } + /// Draw grid lines for density plot at slice for 3d data specified parametrically /** Style ‘x’ or ‘z’ produce plot perpendicular to x- or z-direction correspondingly.*/ inline void Grid3(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *stl="", double sVal=-1, const char *opt="") @@ -2315,3 +2380,5 @@ public: void DeleteAll() { mgl_parser_del_all(pr); } }; //----------------------------------------------------------------------------- +//mglGraph mglGr; +//----------------------------------------------------------------------------- diff --git a/lang/numpy.i b/lang/numpy.i index 25d1f1a..441356e 100644 --- a/lang/numpy.i +++ b/lang/numpy.i @@ -107,11 +107,9 @@ if (PyDict_Check( py_obj)) return "dict" ; if (PyList_Check( py_obj)) return "list" ; if (PyTuple_Check( py_obj)) return "tuple" ; - if (PyFile_Check( py_obj)) return "file" ; if (PyModule_Check( py_obj)) return "module" ; - if (PyInstance_Check(py_obj)) return "instance" ; - return "unknow type"; + return "unknown type"; } /* Given a NumPy typecode, return a string describing the type. diff --git a/mathgl_es.po b/mathgl_es.po index 4e829b9..2403115 100644 --- a/mathgl_es.po +++ b/mathgl_es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: MathGL2 2.4.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-06 19:59+0300\n" +"POT-Creation-Date: 2021-12-03 16:47+0300\n" "PO-Revision-Date: 2018-03-24 11:08-0400\n" "Last-Translator: Diego Sejas Viscarra \n" "Language-Team: \n" @@ -18,7 +18,7 @@ msgstr "" "X-Generator: Poedit 2.0.4\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: mgllab/mgllab.cpp:433 +#: mgllab/mgllab.cpp:424 #, c-format msgid "" "\t-1 str set str as argument $1 for script\n" @@ -104,7 +104,7 @@ msgstr "" "(c) Alexey Balakin, 2007\n" "http://mathgl.sourceforge.net/" -#: src/parser.cpp:1066 +#: src/parser.cpp:1075 #, c-format msgid "" "\n" @@ -113,7 +113,7 @@ msgstr "" "\n" "Cambiar datos temporales en línea %ld" -#: src/parser.cpp:1064 +#: src/parser.cpp:1073 #, c-format msgid "" "\n" @@ -122,7 +122,7 @@ msgstr "" "\n" "Texto demasiado largo en línea %ld" -#: src/parser.cpp:1065 +#: src/parser.cpp:1074 #, c-format msgid "" "\n" @@ -131,7 +131,7 @@ msgstr "" "\n" "Desbalance de ' en línea %ld" -#: src/parser.cpp:1062 +#: src/parser.cpp:1071 #, c-format msgid "" "\n" @@ -140,7 +140,7 @@ msgstr "" "\n" "Argumento(s) incorrecto(s) en línea %ld" -#: src/parser.cpp:1063 +#: src/parser.cpp:1072 #, c-format msgid "" "\n" @@ -184,7 +184,7 @@ msgstr " Nuevo" msgid " Save" msgstr " Guardar" -#: mgllab/mgllab.cpp:242 +#: mgllab/mgllab.cpp:233 msgid " Yes " msgstr " Sí " @@ -444,43 +444,43 @@ msgstr "'|' guión largo" msgid "'~' waves" msgstr "'~' ondas" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "0 - special plot" msgstr "0 - gráfico especial" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "1 - other plot" msgstr "1 - otro gráfico" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "10 - dd plot" msgstr "10 - gráfico dd" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "11 - vector plot" msgstr "11 - gráfico vectorial" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "12 - axis" msgstr "12 - eje" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "13 - primitives" msgstr "13 - primitivas" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "14 - axis setup" msgstr "14 - configurar eje" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "15 - text/legend" msgstr "15 - texto/leyenda" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "16 - data transform" msgstr "16 - transformar datos" -#: udav/info_dlg.cpp:47 +#: udav/info_dlg.cpp:49 msgid "1D plot" msgstr "Gráfico 1D" @@ -492,11 +492,11 @@ msgstr "Gráficos 1D" msgid "1D view" msgstr "Vista 1D" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "2 - setup" msgstr "2 - configuración" -#: udav/info_dlg.cpp:47 +#: udav/info_dlg.cpp:49 msgid "2D plot" msgstr "Gráfico 2D" @@ -508,7 +508,7 @@ msgstr "Gráficos 2D" msgid "2D view" msgstr "Vista 2D" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "3 - data handle" msgstr "3 - referencia a datos" @@ -524,27 +524,27 @@ msgstr "Gráficos 3D" msgid "3D view" msgstr "Vista 3D" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "4 - data create" msgstr "4 - crear datos" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "5 - subplot" msgstr "5 - subgráfica" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "6 - program flow" msgstr "6 - flujo de programa" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "7 - 1d plot" msgstr "7 - gráfico 1d" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "8 - 2d plot" msgstr "8 - gráfico 2d" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "9 - 3d plot" msgstr "9 - gráfico 3d" @@ -560,7 +560,7 @@ msgstr "" msgid "@<- Prev" msgstr "@<- Prev." -#: widgets/qt.cpp:1294 udav/udav_wnd.cpp:331 mgllab/mgllab.cpp:347 +#: widgets/qt.cpp:1294 udav/udav_wnd.cpp:331 mgllab/mgllab.cpp:338 msgid "About" msgstr "Acerca de" @@ -590,7 +590,7 @@ msgstr "Añadir curva" msgid "Add curve which properties can be changed later by mouse." msgstr "Añadir curva configurable por el mouse." -#: src/exec_dat.cpp:1666 +#: src/exec_dat.cpp:1728 msgid "Add data or number" msgstr "Añadir datos o número" @@ -607,7 +607,7 @@ msgid "Add inplot" msgstr "Añadir gráfico interno" # Anadir a la leyenda? -#: src/exec_set.cpp:792 +#: src/exec_set.cpp:800 msgid "Add legend entry" msgstr "Añadir entrada a leyenda" @@ -669,7 +669,7 @@ msgstr "Añadir texto" msgid "Add text which properties can be changed later by mouse." msgstr "Añadir texto configurable por el mouse." -#: src/exec_prm.cpp:658 +#: src/exec_prm.cpp:662 msgid "Add title for current subplot/inplot" msgstr "Añadir titulo al subgráfica/gráfica interna" @@ -678,19 +678,19 @@ msgid "Add to" msgstr "Añadir a" # user-defined -#: src/exec_set.cpp:793 +#: src/exec_set.cpp:801 msgid "Add user-defined symbol" msgstr "Añadir símbolo personalizado" -#: widgets/fltk.cpp:877 +#: widgets/fltk.cpp:883 msgid "Adjust picture size to fill drawing area" msgstr "Ajustar imagen al área de dibujo" -#: widgets/fltk.cpp:840 widgets/qt.cpp:1156 udav/plot_pnl.cpp:337 +#: widgets/fltk.cpp:846 widgets/qt.cpp:1156 udav/plot_pnl.cpp:337 msgid "Adjust size" msgstr "Ajustar tamaño" -#: src/exec_set.cpp:794 +#: src/exec_set.cpp:802 msgid "Adjust ticks for best view" msgstr "Optimizar marcas de los ejes" @@ -793,7 +793,7 @@ msgstr "Proporción de escala y a escala z" msgid "Aspect x/z" msgstr "Aspecto x/z" -#: src/exec_set.cpp:800 +#: src/exec_set.cpp:808 msgid "Attach light settings to inplot" msgstr "Vincular configuración de luz a gráfico interno" @@ -817,7 +817,7 @@ msgstr "Ejecutar script automáticamente al cargarlo" msgid "Automatically save before redrawing (F5)" msgstr "Guardar automáticamente antes de graficar (F5)" -#: src/data.cpp:1488 +#: src/data.cpp:1557 #, c-format msgid "" "Averages are:\n" @@ -855,12 +855,12 @@ msgstr "B - azul marino" msgid "Backward" msgstr "Retroceder" -#: src/font.cpp:1021 +#: src/font.cpp:1005 #, c-format msgid "Bad '%ls' at %zu\n" msgstr "\"%ls\" incorrecto en %zu\n" -#: src/parser.cpp:769 +#: src/parser.cpp:778 #, c-format msgid "Bad arguments for %ls: %ld instead of %d\n" msgstr "Error en argumentos de %ls: %ld en vez de %d\n" @@ -877,7 +877,7 @@ msgstr "Básicas" msgid "Begin" msgstr "Inicio" -#: src/parser.cpp:1483 +#: src/parser.cpp:1492 msgid "Begin of do-while loop" msgstr "Inicio de bucle \"do while\"" @@ -905,7 +905,7 @@ msgstr "yrange requiere dos valores" msgid "Both fields in zrange must be filled" msgstr "zrange requiere dos valores" -#: src/parser.cpp:1480 +#: src/parser.cpp:1489 msgid "Break for-loop" msgstr "Salir de bucle \"for\"" @@ -940,8 +940,8 @@ msgstr "Cálculos" #. TODO #. connect(hidden,SIGNAL(cursorPositionChanged()),this,SLOT(hiddenClicked())); -#: udav/udav_wnd.cpp:194 udav/udav_wnd.cpp:206 mgllab/mgllab.cpp:341 -#: mgllab/mgllab.cpp:572 +#: udav/udav_wnd.cpp:194 udav/udav_wnd.cpp:206 mgllab/mgllab.cpp:332 +#: mgllab/mgllab.cpp:567 msgid "Calculator" msgstr "Calculadora" @@ -950,21 +950,21 @@ msgstr "Calculadora" #: udav/dat_pnl.cpp:510 udav/dat_pnl.cpp:552 udav/dat_pnl.cpp:629 #: udav/opt_dlg.cpp:78 udav/setup_dlg.cpp:145 udav/files_dlg.cpp:58 #: udav/style_dlg.cpp:206 udav/data_dlg.cpp:90 udav/subplot_dlg.cpp:219 -#: mgllab/editor.cpp:282 mgllab/mathgl.cpp:166 mgllab/mathgl.cpp:197 +#: mgllab/editor.cpp:286 mgllab/mathgl.cpp:166 mgllab/mathgl.cpp:197 #: mgllab/dialogs.cpp:120 mgllab/dialogs.cpp:164 mgllab/dialogs.cpp:410 #: mgllab/dialogs.cpp:584 mgllab/dialogs.cpp:749 mgllab/dialogs.cpp:1071 -#: mgllab/dialogs.cpp:1318 mgllab/dialogs.cpp:1473 mgllab/mgllab.cpp:497 +#: mgllab/dialogs.cpp:1318 mgllab/dialogs.cpp:1473 mgllab/mgllab.cpp:490 #: mgllab/table.cpp:101 mgllab/table.cpp:179 mgllab/table.cpp:353 #: mgllab/table.cpp:556 mgllab/table.cpp:619 mgllab/table.cpp:675 msgid "Cancel" msgstr "Cancelar" -#: src/crust.cpp:589 +#: src/crust.cpp:588 msgid "Cannot triangulate this set!" msgstr "¡Imposible triangular conjunto!" # Area de imagen? Area de figura? -#: udav/udav_wnd.cpp:226 mgllab/mgllab.cpp:370 mgllab/mgllab.cpp:371 +#: udav/udav_wnd.cpp:226 mgllab/mgllab.cpp:361 mgllab/mgllab.cpp:362 msgid "Canvas" msgstr "Área de dibujo" @@ -985,7 +985,7 @@ msgstr "Cambiar (tamaño de) datos" msgid "Change canvas size to fill whole region (F6)." msgstr "Maximizar el área de dibujo (F6)." -#: src/exec_set.cpp:804 +#: src/exec_set.cpp:812 msgid "Change current directory" msgstr "Cambiar directorio actual" @@ -1005,7 +1005,7 @@ msgstr "Cambiar valores y cerrar esta ventana" msgid "Change font" msgstr "Cambiar fuente" -#: src/exec_set.cpp:855 +#: src/exec_set.cpp:864 msgid "Change view angles - use 'rotate' for plot rotation" msgstr "Modificar ángulos - use \"rotate\" para rotar gráfico" @@ -1018,17 +1018,17 @@ msgstr "Borrar" msgid "Clear all" msgstr "Borrar todo" -#: src/exec_set.cpp:805 +#: src/exec_set.cpp:813 msgid "Clear legend entries" msgstr "Borrar entradas de leyenda" -#: src/exec_set.cpp:806 +#: src/exec_set.cpp:814 msgid "Clear picture" msgstr "Borrar imagen" #. o = new Fl_Button(180, 130, 25, 25);o->image(img_save); o->tooltip("img_save"); -#: widgets/fltk.cpp:1106 widgets/qt.cpp:1108 udav/find_dlg.cpp:52 -#: udav/hint_dlg.cpp:52 mgllab/editor.cpp:566 mgllab/help.cpp:289 +#: widgets/fltk.cpp:1118 widgets/qt.cpp:1108 udav/find_dlg.cpp:52 +#: udav/hint_dlg.cpp:52 mgllab/editor.cpp:570 mgllab/help.cpp:289 #: mgllab/help.cpp:349 mgllab/help.cpp:465 msgid "Close" msgstr "Cerrar" @@ -1075,7 +1075,7 @@ msgstr "" msgid "Column expr" msgstr "Exp. de columna" -#: mgllab/dialogs.cpp:724 mgllab/mgllab.cpp:320 +#: mgllab/dialogs.cpp:724 mgllab/mgllab.cpp:311 msgid "Command" msgstr "Comando" @@ -1099,27 +1099,27 @@ msgstr "Opciones de comando" msgid "Comments" msgstr "Comentarios" -#: src/exec_prm.cpp:646 +#: src/exec_prm.cpp:650 msgid "Computes the attractor of an IFS" msgstr "Calcula el atractor de un IFS" -#: src/exec_prm.cpp:647 +#: src/exec_prm.cpp:651 msgid "Computes the attractor of an IFS for 3d case" msgstr "Calcula el atractor de un IFS para el caso 3d" -#: src/exec_prm.cpp:648 +#: src/exec_prm.cpp:652 msgid "Computes the attractor of an IFS with parameters from *.ifs file" msgstr "Calcula el atractor de un IFS con parámetros de un archivo *.ifs" -#: src/exec_prm.cpp:642 +#: src/exec_prm.cpp:646 msgid "Computes the flame fractal" msgstr "Calcula un fractal de flama" -#: src/parser.cpp:1499 +#: src/parser.cpp:1508 msgid "Condition of do-while loop" msgstr "Condición de un bucle do-while" -#: src/parser.cpp:1489 src/parser.cpp:1493 +#: src/parser.cpp:1498 src/parser.cpp:1502 msgid "Conditional operator" msgstr "Operador condicional" @@ -1136,11 +1136,11 @@ msgstr "Copiar coordenadas del último clic. a memoria" msgid "Copy data" msgstr "Copiar datos" -#: src/exec_dat.cpp:1674 +#: src/exec_dat.cpp:1736 msgid "Copy data from another variable" msgstr "Copiar datos de otra variable" -#: widgets/fltk.cpp:837 +#: widgets/fltk.cpp:843 msgid "Copy graphics" msgstr "Copiar gráfico" @@ -1148,7 +1148,7 @@ msgstr "Copiar gráfico" msgid "Copy graphics to clipboard (Ctrl+Shift+G)." msgstr "Copiar gráfico a memoria (Ctrl+Shift+G)." -#: widgets/fltk.cpp:881 +#: widgets/fltk.cpp:887 msgid "Copy image to clipboard" msgstr "Copiar imagen a memoria" @@ -1164,11 +1164,11 @@ msgstr "Copiar rango de números a memoria (Ctrl+Shift+C)." msgid "Copy selected text or data to clipboard (Ctrl+C)." msgstr "Copiar texto seleccionado o datos a memoria (Ctrl+C)." -#: mgllab/editor.cpp:512 +#: mgllab/editor.cpp:516 msgid "Copy selection to clipboard" msgstr "Copiar selección a memoria" -#: udav/text_pnl.cpp:533 mgllab/mgllab.cpp:310 +#: udav/text_pnl.cpp:533 mgllab/mgllab.cpp:301 msgid "Copy text" msgstr "Copiar texto" @@ -1180,7 +1180,7 @@ msgstr "Cos-FFT" msgid "Cos-Fourier transform along direction(s)" msgstr "Cos-transformada de Fourier en dirrección(es)" -#: src/exec_dat.cpp:1676 +#: src/exec_dat.cpp:1738 msgid "Cos-Fourier transform at some direction" msgstr "Cos-transformada de Fourier en una dirección" @@ -1217,7 +1217,7 @@ msgstr "Crear datos e I/O" msgid "Create data and IO" msgstr "Crear datos e I/O" -#: src/exec_dat.cpp:1702 +#: src/exec_dat.cpp:1765 msgid "Create histogram (distribution) of data values" msgstr "Crear histograma (distribución) de valores de datos" @@ -1225,11 +1225,11 @@ msgstr "Crear histograma (distribución) de valores de datos" msgid "Create new" msgstr "Crear nuevo" -#: src/exec_dat.cpp:1762 +#: src/exec_dat.cpp:1828 msgid "Create new 1D data and fill it in range" msgstr "Crear nuevos datos 1D y llenar en rango" -#: src/exec_dat.cpp:1717 +#: src/exec_dat.cpp:1782 msgid "Create new data" msgstr "Crear nuevos datos" @@ -1245,7 +1245,7 @@ msgstr "Crear arreglo y llenarlo con ceros" msgid "Create new empty script window (Ctrl+N)." msgstr "Crear ventana para nuevo script (Ctrl+N)." -#: src/parser.cpp:1494 +#: src/parser.cpp:1503 msgid "Creates new variable from list of numbers or data" msgstr "Crear nueva variable de una lista de números o datos" @@ -1261,7 +1261,7 @@ msgstr "Cortar (bordes) de datos" msgid "Crop data" msgstr "Cortar datos" -#: src/exec_dat.cpp:1677 +#: src/exec_dat.cpp:1739 msgid "Crop edge of data" msgstr "Cortar borde de datos" @@ -1273,7 +1273,7 @@ msgstr "Cortar bordes de datos. Útil para cortar área con ceros." msgid "CumSum" msgstr "SumCum" -#: src/exec_dat.cpp:1678 +#: src/exec_dat.cpp:1740 msgid "Cumulative summation along direction(s)" msgstr "Suma acumulativa en la(s) dirección(es)" @@ -1289,7 +1289,7 @@ msgstr "Fuente actual" msgid "Cut selected text to clipboard (Ctrl+X)." msgstr "Cortar texto seleccionado a memoria (Ctrl+X)." -#: udav/text_pnl.cpp:528 mgllab/mgllab.cpp:309 +#: udav/text_pnl.cpp:528 mgllab/mgllab.cpp:300 msgid "Cut text" msgstr "Cortar texto" @@ -1341,11 +1341,12 @@ msgstr "Información sobre datos y vista previa." msgid "Data name" msgstr "Nombre de datos" -#: udav/info_dlg.cpp:42 +#. mgl->autoResize = true; // TODO: something strange here !!! +#: udav/info_dlg.cpp:43 msgid "Data preview" msgstr "Vista previa de datos" -#: udav/info_dlg.cpp:43 +#: udav/info_dlg.cpp:44 msgid "Data preview for current slice." msgstr "Vista previa de datos para porción actual." @@ -1365,19 +1366,19 @@ msgstr "Decrementar ángulo \\theta en 10 grados." msgid "Decrease font size" msgstr "Reducir tamaño de fuente" -#: src/parser.cpp:1485 +#: src/parser.cpp:1494 msgid "Define constant or parameter" msgstr "Definir constante o parámetro" -#: src/parser.cpp:1484 +#: src/parser.cpp:1493 msgid "Define parameter as character" msgstr "Definir parámetro como caracter" -#: src/parser.cpp:1486 +#: src/parser.cpp:1495 msgid "Define parameter as numerical value" msgstr "Definir parámetro como valor numérico" -#: src/parser.cpp:1479 +#: src/parser.cpp:1488 msgid "Define parameter from user input" msgstr "Definir parámetro de input del usuario" @@ -1397,7 +1398,7 @@ msgstr "Borrar @b todos@. los datos." msgid "Delete ALL data arrays" msgstr "Borrar TODOS los datos" -#: src/exec_dat.cpp:1681 +#: src/exec_dat.cpp:1743 msgid "Delete data or slice of data" msgstr "Borrar datos o porción de los datos" @@ -1421,7 +1422,7 @@ msgstr "Borrar gráfico seleccionado." msgid "Description" msgstr "Descripción" -#: src/exec_dat.cpp:1682 +#: src/exec_dat.cpp:1744 msgid "Detect curves for maximums of data array" msgstr "Analizar curvas en busca de máximos" @@ -1437,11 +1438,11 @@ msgstr "Diferenciar datos en la(s) dirección(es)" msgid "Diffuse" msgstr "Difuso" -#: src/exec_dat.cpp:1686 +#: src/exec_dat.cpp:1748 msgid "Dilate data larger val" msgstr "Dilatar datos mayores a val" -#: src/exec_dat.cpp:1671 +#: src/exec_dat.cpp:1733 msgid "Direct multiplication of arrays" msgstr "Multiplicación directa de arreglos" @@ -1462,7 +1463,7 @@ msgstr "Distancia entre celdas" msgid "Divide by" msgstr "Dividir por" -#: src/exec_dat.cpp:1687 +#: src/exec_dat.cpp:1749 msgid "Divide by data or number" msgstr "Dividir por datos o número" @@ -1470,11 +1471,11 @@ msgstr "Dividir por datos o número" msgid "Do" msgstr "Hacer" -#: src/exec_dat.cpp:1751 +#: src/exec_dat.cpp:1817 msgid "Do STFA transform" msgstr "Transformada STFA" -#: src/exec_dat.cpp:1757 src/exec_dat.cpp:1758 +#: src/exec_dat.cpp:1823 src/exec_dat.cpp:1824 msgid "Do integral transform of data" msgstr "Transformada integral de datos" @@ -1491,7 +1492,7 @@ msgstr "¿Desea borrar todos los datos?" msgid "Do you want to save the changes to the document?" msgstr "¿Desea guardar los cambios del documento?" -#: mgllab/editor.cpp:282 +#: mgllab/editor.cpp:286 msgid "Don't Save" msgstr "No guardar" @@ -1499,443 +1500,453 @@ msgstr "No guardar" msgid "Double diff." msgstr "Doble dif." -#: src/exec_gr.cpp:1141 +#: src/exec_gr.cpp:1213 msgid "Draw Bifurcation diagram" msgstr "Diagrama de bifurcación" -#: src/exec_gr.cpp:1177 +#: src/exec_gr.cpp:1250 msgid "Draw Iris plots" msgstr "Gráfica de Iris" -#: src/exec_gr.cpp:1179 +#: src/exec_gr.cpp:1252 msgid "Draw Lamerey diagram" msgstr "Diagrama de Lamerey" # apertura-alto-bajo-clausura? -#: src/exec_gr.cpp:1183 +#: src/exec_gr.cpp:1257 msgid "Draw Open-High-Low-Close (OHLC) diagram" msgstr "Diagrama OHLC" -#: src/exec_gr.cpp:1186 +#: src/exec_gr.cpp:1260 msgid "Draw Poincare map" msgstr "Mapa de Poincaré" -#: src/exec_gr.cpp:1192 +#: src/exec_gr.cpp:1266 msgid "Draw STFA diagram" msgstr "Diagrama STFA" -#: src/exec_gr.cpp:1204 +#: src/exec_gr.cpp:1278 msgid "Draw TeX mark at point position" msgstr "Graficar marca de TeX en posición" -#: src/exec_prm.cpp:624 +#: src/exec_prm.cpp:628 msgid "Draw angle arc" msgstr "Graficar arco" -#: src/exec_gr.cpp:1134 +#: src/exec_gr.cpp:1206 msgid "Draw area plot for 1D data" msgstr "Gráfica de área para datos 1D" -#: src/exec_gr.cpp:1137 +#: src/exec_gr.cpp:1209 msgid "Draw bars for 1D data" msgstr "Gráfica de barras para 1D" -#: src/exec_gr.cpp:1139 +#: src/exec_gr.cpp:1211 msgid "Draw belts" msgstr "Gráfica de correas" -#: src/exec_gr.cpp:1140 +#: src/exec_gr.cpp:1212 msgid "Draw belts colored by other data" msgstr "Gráfica de correas coloreada por otros datos" -#: src/exec_gr.cpp:1202 +#: src/exec_gr.cpp:1276 msgid "Draw binormales for 1D data" msgstr "Gráfica de binormales para datos 1D" -#: src/exec_prm.cpp:651 +#: src/exec_prm.cpp:655 msgid "Draw bitmap (logo) along axis range" msgstr "Graficar imagen (logo) en el rango de ejes" -#: src/exec_prm.cpp:628 +#: src/exec_prm.cpp:632 msgid "Draw bounding box" msgstr "Graficar bordes" -#: src/exec_gr.cpp:1143 +#: src/exec_gr.cpp:1215 msgid "Draw boxes" msgstr "Diagrama de cajas" -#: src/exec_gr.cpp:1142 +#: src/exec_gr.cpp:1214 msgid "Draw boxplot for 2D data" msgstr "Diagrama de cajas para datos 2D" -#: src/exec_gr.cpp:1144 +#: src/exec_gr.cpp:1216 msgid "Draw candlestick chart" msgstr "Diagrama de velas" -#: src/exec_gr.cpp:1145 +#: src/exec_gr.cpp:1217 msgid "Draw chart" msgstr "Gráfica de cuadros" -#: src/exec_prm.cpp:629 +#: src/exec_prm.cpp:633 msgid "Draw circle" msgstr "Graficar círculo" -#: src/exec_gr.cpp:1146 +#: src/exec_gr.cpp:1218 msgid "Draw cloud" msgstr "Gráfica de nube" -#: src/exec_prm.cpp:631 +#: src/exec_prm.cpp:635 msgid "Draw colorbar" msgstr "Graficar barra de colores" -#: src/exec_prm.cpp:632 +#: src/exec_prm.cpp:636 msgid "Draw cone" msgstr "Dibujar cono" -#: src/exec_gr.cpp:1147 +#: src/exec_gr.cpp:1219 msgid "Draw cones for 1D data" msgstr "Gráfica de conos para datos 1D" -#: src/exec_gr.cpp:1148 +#: src/exec_gr.cpp:1220 msgid "Draw contour lines" msgstr "Gráfica de curvas de nivel" -#: src/exec_gr.cpp:1158 +#: src/exec_gr.cpp:1230 msgid "Draw contour lines at x-slice (or x-plane)" msgstr "Curvas de nivel en el plano x" -#: src/exec_gr.cpp:1159 +#: src/exec_gr.cpp:1231 msgid "Draw contour lines at y-slice (or y-plane)" msgstr "Curvas de nivel en el plano y" -#: src/exec_gr.cpp:1160 +#: src/exec_gr.cpp:1232 msgid "Draw contour lines at z-slice (or z-plane)" msgstr "Curvas de nivel en el plano z" -#: src/exec_gr.cpp:1149 +#: src/exec_gr.cpp:1221 msgid "Draw contour lines for 3D data" msgstr "Gráfica de curvas de nivel para datos 3D" -#: src/exec_gr.cpp:1209 +#: src/exec_gr.cpp:1283 msgid "Draw contour lines for surface of triangles" msgstr "Curvas de nivel para superficie de triángulos" -#: src/exec_gr.cpp:1156 +#: src/exec_gr.cpp:1228 msgid "Draw contour lines on parametric surface" msgstr "Curvas de nivel sobre superficie paramétrica" -#: src/exec_gr.cpp:1157 +#: src/exec_gr.cpp:1229 msgid "Draw contour tubes" msgstr "Cilindros de nivel" -#: src/exec_gr.cpp:1210 +#: src/exec_gr.cpp:1284 msgid "Draw contour tubes for surface of triangles" msgstr "Cilindros de nivel para superficie de triángulos" -#: src/exec_prm.cpp:633 +#: src/exec_prm.cpp:637 msgid "Draw curve" msgstr "Graficar curva" -#: src/exec_gr.cpp:1212 +#: src/exec_gr.cpp:1286 msgid "Draw curve by tube" msgstr "Graficar curva tubular" -#: src/exec_gr.cpp:1162 +#: src/exec_gr.cpp:1234 +#, fuzzy +msgid "Draw curves of cross-section of isosurfaces a,b for 3D data" +msgstr "Isosuperficie para datos 3D" + +#: src/exec_gr.cpp:1235 msgid "Draw density plot" msgstr "Gráfica de densidad" -#: src/exec_gr.cpp:1163 +#: src/exec_gr.cpp:1236 msgid "Draw density plot at slices of 3D data" msgstr "Gráfica de densidad para secciones de datos 3D data" -#: src/exec_gr.cpp:1164 +#: src/exec_gr.cpp:1237 msgid "Draw density plot at x-slice (or x-plane)" msgstr "Gráfica de densidad en el plano x" -#: src/exec_gr.cpp:1165 +#: src/exec_gr.cpp:1238 msgid "Draw density plot at y-slice (or y-plane)" msgstr "Gráfica de densidad en el plano y" -#: src/exec_gr.cpp:1166 +#: src/exec_gr.cpp:1239 msgid "Draw density plot at z-slice (or z-plane)" msgstr "Gráfica de densidad en el plano z" # Esquema de gotas? -#: src/exec_gr.cpp:1167 +#: src/exec_gr.cpp:1240 msgid "Draw dew plot" msgstr "Gráfica de gotas" -#: src/exec_gr.cpp:1168 +#: src/exec_gr.cpp:1241 msgid "Draw dots for arbitrary data points" msgstr "Diagrama de puntos para datos arbitrarios" -#: src/exec_prm.cpp:634 +#: src/exec_prm.cpp:638 msgid "Draw drop" msgstr "Graficar gota" -#: src/exec_prm.cpp:635 +#: src/exec_prm.cpp:639 msgid "Draw ellipse" msgstr "Graficar elipse" -#: src/exec_prm.cpp:636 +#: src/exec_prm.cpp:640 msgid "Draw error box" msgstr "Graficar caja de error" -#: src/exec_gr.cpp:1169 +#: src/exec_gr.cpp:1242 msgid "Draw error boxes" msgstr "Graficar cajas de error" -#: src/exec_prm.cpp:637 +#: src/exec_prm.cpp:641 msgid "Draw face (quadrangle)" msgstr "Graficar faceta (cuadrángulo)" -#: src/exec_prm.cpp:638 +#: src/exec_prm.cpp:642 msgid "Draw face perpendicular to x-axis" msgstr "Graficar faceta perpendicular al eje x" -#: src/exec_prm.cpp:639 +#: src/exec_prm.cpp:643 msgid "Draw face perpendicular to y-axis" msgstr "Graficar faceta perpendicular al eje y" -#: src/exec_prm.cpp:640 +#: src/exec_prm.cpp:644 msgid "Draw face perpendicular to z-axis" msgstr "Graficar faceta perpendicular al eje z" -#: src/exec_gr.cpp:1189 +#: src/exec_gr.cpp:1263 msgid "Draw filled region (ribbon) between 2 curves" msgstr "Graficar región rellena (banda) entre dos curbas" -#: src/exec_gr.cpp:1184 +#: src/exec_gr.cpp:1258 msgid "Draw flow pipes for vector field" msgstr "Graficar tubos de flujo de campo vectorial" -#: src/exec_gr.cpp:1171 +#: src/exec_gr.cpp:1244 msgid "Draw flow threads for vector field" msgstr "Graficar líneas de flujo para campo vectorial" -#: src/exec_gr.cpp:1173 +#: src/exec_gr.cpp:1246 msgid "Draw flow threads from plain for vector field" msgstr "Graficar de líneas de flujo desde plano para campo vectorial" -#: src/exec_gr.cpp:1174 +#: src/exec_gr.cpp:1247 msgid "Draw gradient lines for scalar field" msgstr "Graficar líneas de gradiente para campo escalar" -#: src/exec_prm.cpp:645 +#: src/exec_prm.cpp:649 msgid "Draw grid" msgstr "Graficar grilla" -#: src/exec_gr.cpp:1176 +#: src/exec_gr.cpp:1249 msgid "Draw grid at slices of 3D data" msgstr "Graficar grilla para cortes de datos 3D" -#: src/exec_gr.cpp:1175 +#: src/exec_gr.cpp:1248 msgid "Draw grid for data array(s)" msgstr "Graficar grilla para arreglo(s) de datos" -#: src/exec_gr.cpp:1136 +#: src/exec_gr.cpp:1208 msgid "Draw horizontal bars for 1D data" msgstr "Graficar barras horizontales pata datos 1D" -#: src/exec_gr.cpp:1205 +#: src/exec_gr.cpp:1279 msgid "Draw horizontal tiles" msgstr "Graficar baldosas horizontales" -#: src/exec_gr.cpp:1206 +#: src/exec_gr.cpp:1280 msgid "Draw horizontal tiles with variable size" msgstr "Baldosas horizontales con tamaño variable" -#: src/exec_gr.cpp:1194 +#: src/exec_gr.cpp:1268 msgid "Draw isosurface for 3D data" msgstr "Isosuperficie para datos 3D" -#: src/exec_gr.cpp:1197 +#: src/exec_gr.cpp:1271 msgid "Draw isosurface for 3D data colored and transpared by other data" msgstr "" "Isosuperficie para datos 3D coloreados y con transparencia de otros datos" -#: src/exec_gr.cpp:1196 +#: src/exec_gr.cpp:1270 msgid "Draw isosurface for 3D data colored by other data" msgstr "Isosuperficie para datos 3D coloreada por otros datos" -#: src/exec_gr.cpp:1195 +#: src/exec_gr.cpp:1269 msgid "Draw isosurface for 3D data transpared by other data" msgstr "Isosuperficie para datos 3D con transparencia de otros datos" -#: src/exec_gr.cpp:1178 +#: src/exec_gr.cpp:1251 msgid "Draw label at arbitrary position" msgstr "Etiqueta en posición arbitraria" -#: src/exec_prm.cpp:630 +#: src/exec_prm.cpp:634 #, fuzzy msgid "Draw label for colorbar" msgstr "Etiqueta para eje t" -#: src/exec_prm.cpp:659 +#: src/exec_prm.cpp:663 msgid "Draw label for t-axis" msgstr "Etiqueta para eje t" -#: src/exec_prm.cpp:660 +#: src/exec_prm.cpp:664 msgid "Draw label for x-axis" msgstr "Etiqueta para el eje x" -#: src/exec_prm.cpp:661 +#: src/exec_prm.cpp:665 msgid "Draw label for y-axis" msgstr "Etiqueta para el eje y" -#: src/exec_prm.cpp:662 +#: src/exec_prm.cpp:666 msgid "Draw label for z-axis" msgstr "Etiqueta para el eje z" -#: src/exec_prm.cpp:649 +#: src/exec_prm.cpp:653 msgid "Draw legend" msgstr "Graficar leyenda" -#: src/exec_prm.cpp:650 +#: src/exec_prm.cpp:654 msgid "Draw line" msgstr "Graficar recta" -#: src/exec_gr.cpp:1180 +#: src/exec_gr.cpp:1253 +#, fuzzy +msgid "Draw lines with arrows for 1D data" +msgstr "Gráfica de barras para 1D" + +#: src/exec_gr.cpp:1254 msgid "Draw mapping plot" msgstr "Gráfica de mapeo" -#: src/exec_gr.cpp:1181 +#: src/exec_gr.cpp:1255 msgid "Draw mark plot for 1D data" msgstr "Gráfica de marcas para datos 1D" -#: src/exec_gr.cpp:1182 +#: src/exec_gr.cpp:1256 msgid "Draw mesh surface" msgstr "Graficar grilla de superficie" -#: src/exec_prm.cpp:627 +#: src/exec_prm.cpp:631 msgid "Draw point (ball)" msgstr "Graficar punto (esfera)" -#: src/exec_prm.cpp:652 +#: src/exec_prm.cpp:656 msgid "Draw polygon" msgstr "Graficar polígono" -#: src/exec_gr.cpp:1138 +#: src/exec_gr.cpp:1210 msgid "Draw quasi-optical beam" msgstr "Graficar haz cuasióptico" -#: src/exec_gr.cpp:1188 +#: src/exec_gr.cpp:1262 msgid "Draw radar chart" msgstr "Diagrama de radar" -#: src/exec_gr.cpp:1161 +#: src/exec_gr.cpp:1233 msgid "Draw reconstructed surface for arbitrary data points" msgstr "Graficar superficie reconstruida para puntos arbitrarios" -#: src/exec_prm.cpp:653 +#: src/exec_prm.cpp:657 msgid "Draw rectangle" msgstr "Graficar rectángulo" -#: src/exec_prm.cpp:654 +#: src/exec_prm.cpp:658 msgid "Draw rhombus" msgstr "Graficar rombo" -#: src/exec_gr.cpp:1153 +#: src/exec_gr.cpp:1225 msgid "Draw solid contour lines at x-slice (or x-plane)" msgstr "Curvas de nivel rellenas en el plano x" -#: src/exec_gr.cpp:1154 +#: src/exec_gr.cpp:1226 msgid "Draw solid contour lines at y-slice (or y-plane)" msgstr "Curvas de nivel rellenas en el plano y" -#: src/exec_gr.cpp:1155 +#: src/exec_gr.cpp:1227 msgid "Draw solid contour lines at z-slice (or z-plane)" msgstr "Curvas de nivel rellenas en el plano z" -#: src/exec_gr.cpp:1152 +#: src/exec_gr.cpp:1224 msgid "Draw solid contour lines for 3D data" msgstr "Isosuperficies rellenas para datos 3D" -#: src/exec_gr.cpp:1151 +#: src/exec_gr.cpp:1223 msgid "Draw solid contours" msgstr "Curvas de nivel rellenas" -#: src/exec_gr.cpp:1150 +#: src/exec_gr.cpp:1222 msgid "Draw solid contours with manual colors" msgstr "Curvas de nivel rellenas con coloración manual" -#: src/exec_gr.cpp:1193 +#: src/exec_gr.cpp:1267 msgid "Draw solid surface" msgstr "Graficar superficie sólida" -#: src/exec_gr.cpp:1200 +#: src/exec_gr.cpp:1274 msgid "Draw solid surface colored and transpared by other data" msgstr "Superficie sólida con color y transparencia de otros datos" -#: src/exec_gr.cpp:1199 +#: src/exec_gr.cpp:1273 msgid "Draw solid surface colored by other data" msgstr "Superficie sólida con coloración de otros datos" -#: src/exec_gr.cpp:1198 +#: src/exec_gr.cpp:1272 msgid "Draw solid surface transpared by other data" msgstr "Superficie sólida con transparencia de otros datos" -#: src/exec_prm.cpp:655 +#: src/exec_prm.cpp:659 msgid "Draw sphere" msgstr "Graficar esfera" -#: src/exec_gr.cpp:1190 +#: src/exec_gr.cpp:1264 msgid "Draw stem plot for 1D data" msgstr "Gráfica de tallos para datos 1D" -#: src/exec_gr.cpp:1191 +#: src/exec_gr.cpp:1265 msgid "Draw step plot for 1D data" msgstr "Gráfica escalonada para datos 1D" -#: src/exec_gr.cpp:1207 +#: src/exec_gr.cpp:1281 msgid "Draw surface of curve rotation" msgstr "Graficar superficie de rotación" -#: src/exec_gr.cpp:1187 +#: src/exec_gr.cpp:1261 msgid "Draw surface of quadrangles" msgstr "Graficar superficie de cuadrángulos" -#: src/exec_gr.cpp:1211 +#: src/exec_gr.cpp:1285 msgid "Draw surface of triangles" msgstr "Graficar superficie de triángulos" -#: src/exec_gr.cpp:1135 +#: src/exec_gr.cpp:1207 msgid "Draw surfaces of contour lines rotation" msgstr "Superficie de rotación de curvas de nivel" -#: src/exec_gr.cpp:1201 +#: src/exec_gr.cpp:1275 msgid "Draw table with data values" msgstr "Graficar tabla de valores" -#: src/exec_gr.cpp:1203 +#: src/exec_gr.cpp:1277 msgid "Draw tension plot for 1D data" msgstr "Gráfica de tensión para datos 1D" -#: src/exec_prm.cpp:657 +#: src/exec_prm.cpp:661 msgid "Draw text at some position or along curve" msgstr "Texto en posición especifica o curva" -#: src/exec_prm.cpp:656 +#: src/exec_prm.cpp:660 msgid "Draw user-defined symbol at given position and direction" msgstr "Símbolo personalizado en posición y dirección dadas" -#: src/exec_gr.cpp:1185 +#: src/exec_gr.cpp:1259 msgid "Draw usual plot for 1D data" msgstr "Gráfica estándar para datos 1D" -#: src/exec_gr.cpp:1213 +#: src/exec_gr.cpp:1287 msgid "Draw vector field" msgstr "Campo vectorial" -#: src/exec_gr.cpp:1214 +#: src/exec_gr.cpp:1288 msgid "Draw vector field at slices of 3D data" msgstr "Campo vectorial de cortes de datos 3D" -#: src/exec_gr.cpp:1208 +#: src/exec_gr.cpp:1282 msgid "Draw vectors along a curve" msgstr "Vectores a lo largo de curva" -#: src/exec_gr.cpp:1170 +#: src/exec_gr.cpp:1243 msgid "Draw waterfalls" msgstr "Gráfica de cascadas" @@ -1956,7 +1967,7 @@ msgstr "E - verde pasto oscuro" msgid "Edges" msgstr "Bordes" -#: udav/text_pnl.cpp:84 mgllab/mgllab.cpp:307 +#: udav/text_pnl.cpp:84 mgllab/mgllab.cpp:298 msgid "Edit" msgstr "Editar" @@ -1968,13 +1979,13 @@ msgstr "Editor arreglo de datos seleccionado" msgid "Elliptic" msgstr "Elíptico" -#: udav/prop_dlg.cpp:171 mgllab/mgllab.cpp:489 +#: udav/prop_dlg.cpp:171 mgllab/mgllab.cpp:481 msgid "Enable keywords completion" msgstr "Completar palabras clave" #. pure = new QCheckBox(_("Disable face drawing (faster) for mouse rotation/shift/zoom."), this); #. pure->setChecked(mglAutoPure); v->addWidget(pure); pure->setEnabled(false); -#: udav/prop_dlg.cpp:169 mgllab/mgllab.cpp:491 +#: udav/prop_dlg.cpp:169 mgllab/mgllab.cpp:483 msgid "Enable mouse wheel for zooming" msgstr "Rueda del mouse para el zoom" @@ -2075,11 +2086,11 @@ msgstr "Ingresar valor para argumento %s" msgid "Envelop" msgstr "Envoltura" -#: src/exec_dat.cpp:1690 +#: src/exec_dat.cpp:1752 msgid "Erode data larger val" msgstr "Erosionar datos" -#: mgllab/editor.cpp:348 +#: mgllab/editor.cpp:352 #, c-format msgid "" "Error reading from file '%s':\n" @@ -2094,7 +2105,7 @@ msgstr "" msgid "Error to call external viewer\n" msgstr "Error al ejecutar visor externo\n" -#: mgllab/editor.cpp:359 +#: mgllab/editor.cpp:363 #, c-format msgid "" "Error writing to file '%s':\n" @@ -2103,7 +2114,7 @@ msgstr "" "Error al escribir al archivo \"%s\"s:\n" "%s." -#: src/exec_dat.cpp:1691 +#: src/exec_dat.cpp:1753 msgid "" "Evaluate (interpolate) values of array Dat at points i=idat,j=jdat,k=kdat" msgstr "" @@ -2111,11 +2122,11 @@ msgstr "" "k=kdat" #. {"defpal",_("Define parameter as palette color"),"defpal $N val", 0, 6}, -#: src/parser.cpp:1488 +#: src/parser.cpp:1497 msgid "Execute if condition is false" msgstr "Ejecutar si condición es falsa" -#: mgllab/mgllab.cpp:487 +#: mgllab/mgllab.cpp:479 msgid "Execute script after loading" msgstr "Ejecutar script al cargarlo" @@ -2123,7 +2134,7 @@ msgstr "Ejecutar script al cargarlo" msgid "Execute script and redraw graphics (F5)." msgstr "Ejecutar script y volver a graficar (F5)." -#: src/parser.cpp:1481 +#: src/parser.cpp:1490 msgid "Execute script in external file" msgstr "Ejecutar script de archivo externo" @@ -2131,7 +2142,7 @@ msgstr "Ejecutar script de archivo externo" msgid "Existing data arrays" msgstr "Arreglos de datos existentes" -#: mgllab/mgllab.cpp:305 +#: mgllab/mgllab.cpp:296 msgid "Exit" msgstr "Salir" @@ -2147,7 +2158,7 @@ msgstr "Integrales exp" msgid "Export Data?" msgstr "¿Exportar datos?" -#: widgets/fltk.cpp:815 +#: widgets/fltk.cpp:821 msgid "Export as ..." msgstr "Exportar como ..." @@ -2159,7 +2170,7 @@ msgstr "Exportar como 2D ..." msgid "Export as 3D ..." msgstr "Exportar como 3D ..." -#: src/exec_dat.cpp:1692 mgllab/table.cpp:846 +#: src/exec_dat.cpp:1754 mgllab/table.cpp:846 msgid "Export data to PNG file" msgstr "Exportar a PNG" @@ -2172,7 +2183,7 @@ msgstr "Exportar a GIF" msgid "Export to PNG" msgstr "Exportar a PNG" -#: src/exec_dat.cpp:1693 +#: src/exec_dat.cpp:1755 msgid "Extend data array" msgstr "Extender arreglo de datos" @@ -2180,11 +2191,11 @@ msgstr "Extender arreglo de datos" msgid "Extract data" msgstr "Extraer datos" -#: src/exec_dat.cpp:1752 +#: src/exec_dat.cpp:1818 msgid "Extract sub-array" msgstr "Extraer subarreglo" -#: src/exec_dat.cpp:1744 +#: src/exec_dat.cpp:1810 msgid "Extract sub-array between values" msgstr "Extraer subarreglo entre valores" @@ -2194,7 +2205,7 @@ msgstr "Factorizar" #. file menu #: widgets/qt.cpp:1083 udav/udav_wnd.cpp:281 udav/dat_pnl.cpp:681 -#: mgllab/mgllab.cpp:292 mgllab/table.cpp:750 +#: mgllab/mgllab.cpp:283 mgllab/table.cpp:750 msgid "File" msgstr "Archivo" @@ -2202,7 +2213,7 @@ msgstr "Archivo" msgid "File %1 saved" msgstr "Archivo %1 guardado" -#: mgllab/mgllab.cpp:242 +#: mgllab/mgllab.cpp:233 msgid "File exist. Overwrite it?" msgstr "¿Sobreescribir archivo existente?" @@ -2210,7 +2221,7 @@ msgstr "¿Sobreescribir archivo existente?" msgid "File name" msgstr "Nombre de archivo" -#: mgllab/mgllab.cpp:318 +#: mgllab/mgllab.cpp:309 msgid "File path" msgstr "Ubicación de archivo" @@ -2218,7 +2229,7 @@ msgstr "Ubicación de archivo" msgid "File to export" msgstr "Archivo a exportar" -#: mgllab/editor.cpp:267 mgllab/mgllab.cpp:412 +#: mgllab/editor.cpp:271 mgllab/mgllab.cpp:403 msgid "File/Recent files" msgstr "Archivo/Archivos recientes" @@ -2230,19 +2241,19 @@ msgstr "Llenar" msgid "Fill data by formula" msgstr "Llenar datos por fórmula" -#: src/exec_dat.cpp:1700 +#: src/exec_dat.cpp:1763 msgid "Fill data by global spline of Vdat" msgstr "Llenar datos con spline global de Vdat" -#: src/exec_dat.cpp:1736 +#: src/exec_dat.cpp:1802 msgid "Fill data by interpolation of Vdat" msgstr "Llenar datos por interpolación de Vdat" -#: src/exec_dat.cpp:1679 +#: src/exec_dat.cpp:1741 msgid "Fill data by triangulated values" msgstr "Llenar datos con valores triángulados" -#: src/exec_dat.cpp:1695 +#: src/exec_dat.cpp:1757 msgid "Fill data linearly in range [v1, v2]" msgstr "Llenar datos linealmente en rango [v1, v2]" @@ -2250,19 +2261,57 @@ msgstr "Llenar datos linealmente en rango [v1, v2]" msgid "Fill in range" msgstr "Llenar en rango" -#: src/exec_dat.cpp:1696 +#: src/exec_dat.cpp:1758 msgid "Fill x-,k-samples for transforms" msgstr "Llenar muestreo x o k para transformada" -#: udav/find_dlg.cpp:48 mgllab/editor.cpp:560 +#: src/random.cpp:350 +msgid "Fills by fractional brownian motion" +msgstr "" + +#: src/random.cpp:356 +msgid "Fills by random integers uniformly chosen in [lo, hi)" +msgstr "" + +#: src/random.cpp:348 +msgid "" +"Fills by random numbers according to Bernoulli distribution with probability " +"p" +msgstr "" + +#: src/random.cpp:353 +msgid "Fills by random numbers according to Gaussian distribution" +msgstr "" + +#: src/random.cpp:349 +msgid "" +"Fills by random numbers according to binomial distribution in n coin flips " +"with probability p" +msgstr "" + +#: src/random.cpp:351 +msgid "Fills by random numbers according to discrete distribution" +msgstr "" + +#: src/random.cpp:352 +msgid "" +"Fills by random numbers according to exponential distribution with " +"probability p" +msgstr "" + +#: src/random.cpp:355 +msgid "Fills by random numbers uniformly chosen in [lo,hi)" +msgstr "" + +#: udav/find_dlg.cpp:48 mgllab/editor.cpp:564 msgid "Find" msgstr "Buscar" -#: src/exec_dat.cpp:1675 +#: src/exec_dat.cpp:1737 msgid "Find correlation between data arrays" msgstr "Correlación entre arreglos de datos" -#: src/exec_dat.cpp:1689 +#: src/exec_dat.cpp:1751 msgid "Find envelop for the data" msgstr "Envoltura para datos" @@ -2270,55 +2319,65 @@ msgstr "Envoltura para datos" msgid "Find envelope along direction(s)" msgstr "Envoltura a lo largo de dirección(es)" +#: src/exec_dat.cpp:1759 +#, fuzzy +msgid "Find first indexes of values larger val over direction" +msgstr "Valor minimal en una dirección" + #: udav/dat_pnl.cpp:804 msgid "Find histogram of data." msgstr "Histograma de datos." -#: src/exec_dat.cpp:1711 +#: src/exec_dat.cpp:1773 +#, fuzzy +msgid "Find last indexes of values larger val over direction" +msgstr "Valor maximal en una dirección" + +#: src/exec_dat.cpp:1776 msgid "Find maximal value over direction" msgstr "Valor maximal en una dirección" -#: src/exec_dat.cpp:1712 +#: src/exec_dat.cpp:1777 msgid "Find minimal value over direction" msgstr "Valor minimal en una dirección" -#: udav/text_pnl.cpp:551 mgllab/mgllab.cpp:316 +#: udav/text_pnl.cpp:551 mgllab/mgllab.cpp:307 msgid "Find next" msgstr "Buscar siguiente" -#: mgllab/editor.cpp:516 +#: mgllab/editor.cpp:520 msgid "Find or replace text" msgstr "Buscar o reemplazar texto" -#: src/exec_dat.cpp:1748 +#: src/exec_dat.cpp:1814 msgid "Find root Dat[i,j,k]=val (inverse evaluate)" msgstr "Encontrar raíz Dat[i,j,k]=val (evaluación inversa)" -#: src/exec_dat.cpp:1740 +#: src/exec_dat.cpp:1806 msgid "Find roots using data as initial values" msgstr "Encontrar raíces usando datos como valores iniciales" -#: src/exec_dat.cpp:1754 +#: src/exec_dat.cpp:1820 msgid "Find summation over direction" msgstr "Suma en una dirección" -#: src/exec_dat.cpp:1760 +#: src/exec_dat.cpp:1826 msgid "Find triangles of randomly placed points" msgstr "Triangulación de puntos arbitrarios" -#: udav/find_dlg.cpp:36 mgllab/editor.cpp:559 +#: udav/find_dlg.cpp:36 mgllab/editor.cpp:563 msgid "Find what:" msgstr "Buscar:" -#: udav/text_pnl.cpp:546 mgllab/editor.cpp:558 +#: udav/text_pnl.cpp:546 mgllab/editor.cpp:562 msgid "Find/Replace" msgstr "Buscar/Reemplazar" -#: mgllab/mgllab.cpp:315 +#: mgllab/mgllab.cpp:306 msgid "Find|Replace" msgstr "Buscar|Reemplazar" -#: src/parser.cpp:1490 +#: src/parser.cpp:1499 msgid "Finish if/else block" msgstr "Terminar bloque \"if/else\"" @@ -2330,11 +2389,11 @@ msgstr "Primera celda" msgid "First slice" msgstr "Primera sección" -#: src/exec_dat.cpp:1697 src/exec_dat.cpp:1698 +#: src/exec_dat.cpp:1760 src/exec_dat.cpp:1761 msgid "Fit data to formula" msgstr "Ajustar datos a fórmula" -#: udav/text_pnl.cpp:567 mgllab/mgllab.cpp:322 +#: udav/text_pnl.cpp:567 mgllab/mgllab.cpp:313 msgid "Fitted formula" msgstr "Fórmula ajustada" @@ -2350,11 +2409,11 @@ msgstr "Niebla" msgid "Fog dist." msgstr "Dist. niebla" -#: mgllab/mgllab.cpp:548 +#: mgllab/mgllab.cpp:543 msgid "Folder for help files" msgstr "Fólder de archivos de ayuda" -#: udav/text_pnl.cpp:587 mgllab/mgllab.cpp:319 +#: udav/text_pnl.cpp:587 mgllab/mgllab.cpp:310 msgid "Folder path" msgstr "Ubicación de directorio" @@ -2362,7 +2421,7 @@ msgstr "Ubicación de directorio" msgid "Font" msgstr "Fuente" -#: mgllab/mgllab.cpp:539 +#: mgllab/mgllab.cpp:534 msgid "Font file name" msgstr "Nombre de archivo de fuente" @@ -2370,11 +2429,11 @@ msgstr "Nombre de archivo de fuente" msgid "Font files (*.vfm)" msgstr "Archivos de fuente (*.vfm)" -#: mgllab/mgllab.cpp:478 +#: mgllab/mgllab.cpp:470 msgid "Font kind" msgstr "Tipo de fuente" -#: mgllab/mgllab.cpp:480 +#: mgllab/mgllab.cpp:472 msgid "Font size" msgstr "Tamaño de fuente" @@ -2386,7 +2445,7 @@ msgstr "Estilo de fuente" msgid "FontSize" msgstr "FontSize" -#: src/parser.cpp:1491 +#: src/parser.cpp:1500 msgid "For loop" msgstr "Bucle \"for\"" @@ -2403,7 +2462,7 @@ msgstr "Cuadro %1 de %2" msgid "From" msgstr "Desde" -#: mgllab/mgllab.cpp:607 +#: mgllab/mgllab.cpp:602 msgid "Function" msgstr "Función" @@ -2421,45 +2480,45 @@ msgstr "Formato GIF deshabilitado. Habilítelo y recompile MathGL." msgid "General setup" msgstr "Config. general" -#: src/exec_dat.cpp:1708 +#: src/exec_dat.cpp:1771 msgid "Get Jacobian" msgstr "Obtener Jacobiano" -#: src/exec_dat.cpp:1673 +#: src/exec_dat.cpp:1735 msgid "Get contour lines for dat[i,j]=val, separated by NAN" msgstr "" -#: src/exec_dat.cpp:1670 +#: src/exec_dat.cpp:1732 msgid "Get data column filled by formula on column ids" msgstr "Llenar columna de datos por fórmula en ids de columnas" -#: src/exec_dat.cpp:1743 +#: src/exec_dat.cpp:1809 msgid "Get formated data from file" msgstr "Obtener datos con formato de archivo" -#: src/exec_dat.cpp:1672 +#: src/exec_dat.cpp:1734 msgid "" "Get indexes or resort data for found connected surfaces dependent on j,k" msgstr "" -#: src/exec_dat.cpp:1715 +#: src/exec_dat.cpp:1780 msgid "Get momentum along direction" msgstr "Obtener el momento en una dirección" -#: src/exec_dat.cpp:1694 +#: src/exec_dat.cpp:1756 #, fuzzy msgid "Get positions of local maximums and minimums" msgstr "Especificar posición de gráfica en matriz" -#: src/exec_dat.cpp:1725 +#: src/exec_dat.cpp:1790 msgid "Get pulse properties" msgstr "Obtener propiedades de pulso" -#: src/exec_dat.cpp:1756 +#: src/exec_dat.cpp:1822 msgid "Get trace of array" msgstr "Obtener la traza de un arreglo" -#: src/base_cf.cpp:85 +#: src/base_cf.cpp:86 #, c-format msgid "Global message - %s\n" msgstr "Mensaje global - %s\n" @@ -2489,7 +2548,7 @@ msgid "Go to the specified slice for 3D data." msgstr "Ir a la sección especificada de datos 3D." #: widgets/qt.cpp:1112 widgets/qt.cpp:1114 udav/plot_pnl.cpp:66 -#: mgllab/mgllab.cpp:334 +#: mgllab/mgllab.cpp:325 msgid "Graphics" msgstr "Gráfica" @@ -2497,157 +2556,148 @@ msgstr "Gráfica" msgid "Graphics setup" msgstr "Config. gráfica" -#: widgets/fltk.cpp:964 +#: widgets/fltk.cpp:970 msgid "Graphics/Adjust size" msgstr "Gráfica/Ajustar tamaño" -#. /< Parameter for handling animation -#. /< Callback function for next frame -#. /< Callback function for prev frame -#. /< Callback function for delay -#. /< Callback function for reloading -#. / Toggle transparency (alpha) button -#: widgets/fltk.cpp:958 include/mgl2/Fl_MathGL.h:164 +#. ----------------------------------------------------------------------------- +#: widgets/fltk.cpp:964 widgets/fltk.cpp:1094 msgid "Graphics/Alpha" msgstr "Gráfica/Alfa" -#: widgets/fltk.cpp:993 +#: widgets/fltk.cpp:999 msgid "Graphics/Animation/Next frame" msgstr "Gráfica/Animación/Sgte. cuadro" -#: widgets/fltk.cpp:994 +#: widgets/fltk.cpp:1000 msgid "Graphics/Animation/Prev frame" msgstr "Gráfica/Animación/Ant. cuadro" -#: mgllab/mgllab.cpp:386 +#: mgllab/mgllab.cpp:377 msgid "Graphics/Animation/Setup animation" msgstr "Gráfica/Animación/Animación" -#. / Toggle slideshow button -#: widgets/fltk.cpp:992 include/mgl2/Fl_MathGL.h:168 +#: widgets/fltk.cpp:998 widgets/fltk.cpp:1096 msgid "Graphics/Animation/Slideshow" msgstr "Gráfica/Animación/Presentacion" -#: widgets/fltk.cpp:968 +#: widgets/fltk.cpp:974 msgid "Graphics/Copy click coor." msgstr "Gráfica/Copiar coord. al clicar" -#: widgets/fltk.cpp:967 +#: widgets/fltk.cpp:973 msgid "Graphics/Copy graphics" msgstr "Gráfica/Copiar gráfica" -#: widgets/fltk.cpp:981 +#: widgets/fltk.cpp:987 msgid "Graphics/Export/as BMP" msgstr "Gráfica/Exportar/como BMP" -#: widgets/fltk.cpp:979 +#: widgets/fltk.cpp:985 msgid "Graphics/Export/as GIF" msgstr "Gráfica/Exportar/como GIF" -#: widgets/fltk.cpp:976 +#: widgets/fltk.cpp:982 msgid "Graphics/Export/as JPEG" msgstr "Gráfica/Exportar/como JPEG" -#: widgets/fltk.cpp:987 +#: widgets/fltk.cpp:993 msgid "Graphics/Export/as OBJ" msgstr "Gráfica/Exportar/como OBJ" -#: widgets/fltk.cpp:988 +#: widgets/fltk.cpp:994 msgid "Graphics/Export/as OFF" msgstr "Gráfica/Exportar/como OFF" -#: widgets/fltk.cpp:972 +#: widgets/fltk.cpp:978 msgid "Graphics/Export/as PNG" msgstr "Gráfica/Exportar/como PNG" -#: widgets/fltk.cpp:986 +#: widgets/fltk.cpp:992 msgid "Graphics/Export/as PRC" msgstr "Gráfica/Exportar/como PRC" -#: widgets/fltk.cpp:989 +#: widgets/fltk.cpp:995 msgid "Graphics/Export/as STL" msgstr "Gráfica/Exportar/como STL" -#: widgets/fltk.cpp:982 +#: widgets/fltk.cpp:988 msgid "Graphics/Export/as SVG" msgstr "Gráfica/Exportar/como SVG" -#: widgets/fltk.cpp:985 +#: widgets/fltk.cpp:991 msgid "Graphics/Export/as TeX" msgstr "Gráfica/Exportar/como TeX" -#: widgets/fltk.cpp:990 +#: widgets/fltk.cpp:996 msgid "Graphics/Export/as XYZ" msgstr "Gráfica/Exportar/como XYZ" -#: widgets/fltk.cpp:984 +#: widgets/fltk.cpp:990 msgid "Graphics/Export/as bitmap EPS" msgstr "Gráfica/Exportar/como mapa de bits EPS" -#: widgets/fltk.cpp:973 +#: widgets/fltk.cpp:979 msgid "Graphics/Export/as solid PNG" msgstr "Gráfica/Exportar/como PNG sólido" -#: widgets/fltk.cpp:983 +#: widgets/fltk.cpp:989 msgid "Graphics/Export/as vector EPS" msgstr "Gráfica/Exportar/como EPS vectorial" -#. / Toggle grid drawing button -#: widgets/fltk.cpp:960 include/mgl2/Fl_MathGL.h:170 +#: widgets/fltk.cpp:966 widgets/fltk.cpp:1097 msgid "Graphics/Grid" msgstr "Gráfica/Grilla" -#. / Toggle lighting button -#: widgets/fltk.cpp:959 include/mgl2/Fl_MathGL.h:166 +#: widgets/fltk.cpp:965 widgets/fltk.cpp:1095 msgid "Graphics/Light" msgstr "Gráfica/Luz" -#. / Toggle pause calculation button -#: widgets/fltk.cpp:969 include/mgl2/Fl_MathGL.h:182 mgllab/mgllab.cpp:387 +#: widgets/fltk.cpp:975 widgets/fltk.cpp:1098 mgllab/mgllab.cpp:378 msgid "Graphics/Pause calc" msgstr "Gráfica/Pausar calc." -#: mgllab/mgllab.cpp:385 +#: mgllab/mgllab.cpp:376 msgid "Graphics/Primitive" msgstr "Gráfica/Primitiva" -#: widgets/fltk.cpp:963 +#: widgets/fltk.cpp:969 msgid "Graphics/Redraw" msgstr "Gráfica/Redibujar" -#: widgets/fltk.cpp:965 +#: widgets/fltk.cpp:971 msgid "Graphics/Reload data" msgstr "Gráfica/Volver a cargar datos" -#: widgets/fltk.cpp:962 +#: widgets/fltk.cpp:968 msgid "Graphics/Restore" msgstr "Gráfica/Reestablecer" -#: widgets/fltk.cpp:966 +#: widgets/fltk.cpp:972 msgid "Graphics/Stop" msgstr "Gráfica/Detener" -#: widgets/fltk.cpp:1000 +#: widgets/fltk.cpp:1006 msgid "Graphics/Transform/Move down" msgstr "Gráfica/Transformar/Mover abajo" -#: widgets/fltk.cpp:996 +#: widgets/fltk.cpp:1002 msgid "Graphics/Transform/Move left" msgstr "Gráfica/Transformar/Mover izq." -#: widgets/fltk.cpp:1001 +#: widgets/fltk.cpp:1007 msgid "Graphics/Transform/Move right" msgstr "Gráfica/Transformar/Mover der." -#: widgets/fltk.cpp:997 +#: widgets/fltk.cpp:1003 msgid "Graphics/Transform/Move up" msgstr "Gráfica/Transformar/Mover arriba" -#: widgets/fltk.cpp:998 +#: widgets/fltk.cpp:1004 msgid "Graphics/Transform/Zoom in" msgstr "Gráfica/Transformar/Acercar" -#: widgets/fltk.cpp:999 +#: widgets/fltk.cpp:1005 msgid "Graphics/Transform/Zoom out" msgstr "Gráfica/Transformar/Alejar" @@ -2664,12 +2714,13 @@ msgstr "Grupos de comandos de MGL" msgid "H - darkgray" msgstr "H - gris oscuro" -#: src/data_io.cpp:1092 +#: src/data_io.cpp:1204 msgid "HDF4 support was disabled. Please, enable it and rebuild MathGL." msgstr "Formato HDF4 deshabilitado. Habilítelo y recompile MathGL." -#: src/complex_io.cpp:924 src/complex_io.cpp:926 src/data_io.cpp:1191 -#: src/data_io.cpp:1193 src/data_io.cpp:1195 src/data_io.cpp:1197 +#: src/complex_io.cpp:924 src/complex_io.cpp:926 src/data_io.cpp:1359 +#: src/data_io.cpp:1361 src/data_io.cpp:1363 src/data_io.cpp:1365 +#: src/data_io.cpp:1367 src/data_io.cpp:1369 src/data_io.cpp:1371 msgid "HDF5 support was disabled. Please, enable it and rebuild MathGL." msgstr "Formato HDF5 deshabilitado. Habilítelo y recompile MathGL." @@ -2681,7 +2732,7 @@ msgstr "Hankel" msgid "Hankel transform along direction(s)" msgstr "Transformada de Hankel en alguna(s) dirección(es)" -#: src/exec_dat.cpp:1701 +#: src/exec_dat.cpp:1764 msgid "Hankel transform at some direction" msgstr "Transformada de Hankel en alguna dirección" @@ -2690,8 +2741,8 @@ msgid "Height of selected cells" msgstr "Altura de celdas seleccionadas" #: widgets/qt.cpp:1293 udav/help_pnl.cpp:57 udav/udav_wnd.cpp:231 -#: udav/udav_wnd.cpp:323 mgllab/mgllab.cpp:344 mgllab/mgllab.cpp:345 -#: mgllab/mgllab.cpp:373 +#: udav/udav_wnd.cpp:323 mgllab/mgllab.cpp:335 mgllab/mgllab.cpp:336 +#: mgllab/mgllab.cpp:364 msgid "Help" msgstr "Ayuda" @@ -2703,7 +2754,7 @@ msgstr "" "Aquí puede especificar opciones de comando.\n" "Úselas para configuración adicional del gráfico." -#: udav/udav_wnd.cpp:186 mgllab/mgllab.cpp:313 +#: udav/udav_wnd.cpp:186 mgllab/mgllab.cpp:304 msgid "Hidden plots" msgstr "Gráficos ocultos" @@ -2715,11 +2766,11 @@ msgstr "Ocultar seleccionados" msgid "Hide selected plots." msgstr "Ocultar gráficos seleccionados." -#: udav/prop_dlg.cpp:173 mgllab/mgllab.cpp:490 +#: udav/prop_dlg.cpp:173 mgllab/mgllab.cpp:482 msgid "Highlight current object(s)" msgstr "Resaltar objeto(s) actuales" -#: udav/udav_wnd.cpp:328 mgllab/mgllab.cpp:346 +#: udav/udav_wnd.cpp:328 mgllab/mgllab.cpp:337 msgid "Hints" msgstr "Consejos" @@ -2739,7 +2790,7 @@ msgstr "Hiperbólicas" msgid "ID" msgstr "ID" -#: mgllab/mgllab.cpp:348 +#: mgllab/mgllab.cpp:339 msgid "Icon list" msgstr "Lista de íconos" @@ -2751,11 +2802,11 @@ msgstr "Id de sección en la tercera dimensión (z)" msgid "Image size" msgstr "Tamaño de imagen" -#: src/exec_dat.cpp:1724 +#: src/exec_dat.cpp:1789 msgid "Immediately display the progress of calculation" msgstr "Mostrar inmediatamente el progreso de cálculo" -#: src/exec_dat.cpp:1723 +#: src/exec_dat.cpp:1788 msgid "Immediately print the message" msgstr "Mostrar inmediatamente el mensaje" @@ -2763,7 +2814,7 @@ msgstr "Mostrar inmediatamente el mensaje" msgid "Import Data?" msgstr "¿Importar datos?" -#: src/exec_dat.cpp:1704 mgllab/table.cpp:842 +#: src/exec_dat.cpp:1767 mgllab/table.cpp:842 msgid "Import data from PNG file" msgstr "Importar datos de archivo PNG" @@ -2775,7 +2826,7 @@ msgstr "Importar de PNG" msgid "In range" msgstr "En rango" -#: src/exec_dat.cpp:1699 +#: src/exec_dat.cpp:1762 msgid "In-place Fourier transform" msgstr "Transformada de Gabor" @@ -2803,20 +2854,20 @@ msgstr "Aumentar tamaño de fuente" msgid "Info" msgstr "Info" -#: udav/info_dlg.cpp:55 mgllab/help.cpp:335 +#: udav/info_dlg.cpp:57 mgllab/help.cpp:335 msgid "Information" msgstr "Información" -#: mgllab/mgllab.cpp:321 +#: mgllab/mgllab.cpp:312 msgid "Inplot" msgstr "Gráfica interna" #. insert menu -#: udav/text_pnl.cpp:557 mgllab/mgllab.cpp:317 +#: udav/text_pnl.cpp:557 mgllab/mgllab.cpp:308 msgid "Insert" msgstr "Insertar" -#: mgllab/editor.cpp:519 +#: mgllab/editor.cpp:523 msgid "Insert MGL command" msgstr "Insertar comando de MGL" @@ -2824,19 +2875,11 @@ msgstr "Insertar comando de MGL" msgid "Insert as 'list'" msgstr "Insertar como \"list\"" -#: mgllab/editor.cpp:487 -msgid "Insert file content?" -msgstr "¿Insertar contenido de archivo?" - -#: mgllab/mgllab.cpp:158 -msgid "Insert file name?" -msgstr "¿Insertar nombre de archivo?" - -#: mgllab/editor.cpp:521 +#: mgllab/editor.cpp:525 msgid "Insert filename" msgstr "Insertar nombre de archivo" -#: mgllab/editor.cpp:523 +#: mgllab/editor.cpp:527 msgid "Insert inplot command" msgstr "Insertar comando de gráfica interna" @@ -2844,7 +2887,7 @@ msgstr "Insertar comando de gráfica interna" msgid "Insert last fitted formula with found coefficients." msgstr "Insertar última fórmula ajustada con coeficientes encontrados." -#: src/exec_dat.cpp:1706 +#: src/exec_dat.cpp:1769 msgid "Insert slice of data" msgstr "Insertar sección de datos" @@ -2856,7 +2899,7 @@ msgstr "Insertar al script como comando 'list'" msgid "Integrate" msgstr "Integrar" -#: src/exec_dat.cpp:1707 udav/dat_pnl.cpp:615 +#: src/exec_dat.cpp:1770 udav/dat_pnl.cpp:615 msgid "Integrate data along direction(s)" msgstr "Integrar datos en una(s) dirección(es)" @@ -2880,7 +2923,7 @@ msgstr "Formato JPEG deshabilitado. Habilítelo y recompile MathGL." msgid "Jacobi" msgstr "Jacobi" -#: src/exec_dat.cpp:1709 +#: src/exec_dat.cpp:1772 msgid "Join data arrays" msgstr "Juntar arreglos de datos" @@ -2892,6 +2935,10 @@ msgstr "Mantener vacío para poner al principio del script principal." msgid "Keep only each n-th element of the data array." msgstr "Mantener solo cada n-ésimo elemento del arreglo." +#: src/exec_dat.cpp:1774 +msgid "Keep phase/amplitude along line" +msgstr "" + #: mgllab/mathgl.cpp:200 msgid "Keep slides in memory (faster animation but require more memory)" msgstr "Mantener cuadros en memoria (animación rápida, ocupa mas memoria)" @@ -2918,7 +2965,7 @@ msgstr "" " * otros argumentos son números (ej.: zval);\n" " * argumentos en [] son opcionales." -#: udav/info_dlg.cpp:50 +#: udav/info_dlg.cpp:52 msgid "Kind of plots: lines for 1D, density for 2D." msgstr "Tipo de gráficos: líneas para 1D, densidad para 2D." @@ -2939,7 +2986,7 @@ msgstr "Etiqueta" msgid "Language for UDAV" msgstr "Lenguaje para UDAV" -#: mgllab/mgllab.cpp:493 +#: mgllab/mgllab.cpp:486 msgid "Language for mgllab" msgstr "Lenguaje para mgllab" @@ -2980,7 +3027,7 @@ msgstr "Posición de luz no indicada. Ignorar." msgid "Light settings" msgstr "Config. de luz" -#: src/exec_dat.cpp:1710 +#: src/exec_dat.cpp:1775 msgid "Limit data to be inside [-v,v]" msgstr "Limitar datos al rango [-v,v]" @@ -3008,7 +3055,7 @@ msgstr "Lista de datos disponibles." msgid "Load Data?" msgstr "¿Cargar datos?" -#: src/exec_set.cpp:821 +#: src/exec_set.cpp:829 msgid "Load commands from external DLL" msgstr "Cargar comandos de librería externa" @@ -3028,7 +3075,7 @@ msgstr "" "Cargar datos de archivo. Estos se borraran solo al\n" "cerrar UDAV, sin advertencia explicita (Ctrl+Shift+O)." -#: src/exec_set.cpp:822 +#: src/exec_set.cpp:830 msgid "Load fontfaces" msgstr "Cargar fuentes" @@ -3036,7 +3083,7 @@ msgstr "Cargar fuentes" msgid "Load from file" msgstr "Cargar de archivo" -#: src/exec_prm.cpp:626 +#: src/exec_prm.cpp:630 msgid "Load image for background" msgstr "Cargar imagen como fondo" @@ -3065,7 +3112,7 @@ msgstr "Borde inferior para determinar color o alfa" msgid "M - purple" msgstr "M - púrpura" -#: src/parser.cpp:1074 +#: src/parser.cpp:1083 msgid "MGL Parser" msgstr "Intérprete MGL" @@ -3073,11 +3120,11 @@ msgstr "Intérprete MGL" msgid "MGL commands for selected group" msgstr "Comandos de MGL para grupo seleccionado" -#: mgllab/mgllab.cpp:229 +#: mgllab/mgllab.cpp:220 msgid "MGL files \t*.mgl" msgstr "Archivos MGL \t*.mgl" -#: mgllab/mgllab.cpp:182 +#: mgllab/mgllab.cpp:173 msgid "" "MGL files \t*.mgl\n" "DAT files \t*.{dat,csv}" @@ -3145,7 +3192,7 @@ msgstr "Guiones peronalizados" msgid "Manual mask" msgstr "Máscaras personalozadas" -#: udav/text_pnl.cpp:591 mgllab/mgllab.cpp:323 +#: udav/text_pnl.cpp:591 mgllab/mgllab.cpp:314 msgid "Manual primitives" msgstr "Primitivas personalizadas" @@ -3173,7 +3220,7 @@ msgstr "Ángulo de rotacion de máscara" msgid "Mask size" msgstr "Tamaño de máscara" -#: udav/find_dlg.cpp:42 mgllab/editor.cpp:563 +#: udav/find_dlg.cpp:42 mgllab/editor.cpp:567 msgid "Match case" msgstr "Match case" @@ -3181,7 +3228,7 @@ msgstr "Match case" msgid "MathGL - about" msgstr "MathGL - acerca de" -#: src/base.cpp:265 +#: src/base.cpp:276 #, c-format msgid "MathGL message - %s\n" msgstr "Mensaje de MathGL - %s\n" @@ -3222,7 +3269,7 @@ msgstr "Valor maximal de Y para o para llenado de coord." msgid "Maximal value of Z for cutting or for coordinate filling" msgstr "Valor maximal de Z para corte o para llenado de coord." -#: src/data.cpp:1480 +#: src/data.cpp:1549 #, c-format msgid "Maximum is %g\t at x = %ld\ty = %ld\tz = %ld\n" msgstr "Maximo es %g\t en x = %ld\ty = %ld\tz = %ld\n" @@ -3231,7 +3278,7 @@ msgstr "Maximo es %g\t en x = %ld\ty = %ld\tz = %ld\n" msgid "Maximum of" msgstr "Maximo de" -#: udav/mem_pnl.cpp:68 udav/mem_pnl.cpp:73 mgllab/mgllab.cpp:375 +#: udav/mem_pnl.cpp:68 udav/mem_pnl.cpp:73 mgllab/mgllab.cpp:366 msgid "Memory" msgstr "Memoria" @@ -3243,7 +3290,7 @@ msgstr "Mesh num" msgid "MeshNum" msgstr "MeshNum" -#: mgllab/mgllab.cpp:342 +#: mgllab/mgllab.cpp:333 msgid "Messages" msgstr "Mensajes" @@ -3279,7 +3326,7 @@ msgstr "Valor minimal de Y para corte o para llenado de coord." msgid "Minimal value of Z for cutting or for coordinate filling" msgstr "Valor minimal de Z para corte o para llenado de coord." -#: src/data.cpp:1483 +#: src/data.cpp:1552 #, c-format msgid "Minimum is %g\t at x = %ld\ty = %ld\tz = %ld\n" msgstr "Minimo es %g\t en x = %ld\ty = %ld\tz = %ld\n" @@ -3297,11 +3344,11 @@ msgstr "Reflejar" msgid "Mirror data along direction(s)" msgstr "Reflejar datos en una(s) dirección(es)" -#: src/exec_dat.cpp:1713 +#: src/exec_dat.cpp:1778 msgid "Mirror data at some direction" msgstr "Reflejar datos en alguna(s) dirección(es)" -#: src/exec_dat.cpp:1714 +#: src/exec_dat.cpp:1779 msgid "Modify data values by formula" msgstr "Modificar datos por fórmula" @@ -3373,7 +3420,7 @@ msgstr "Mover arriba" msgid "Multiply by" msgstr "Multiplicar por" -#: src/exec_dat.cpp:1716 +#: src/exec_dat.cpp:1781 msgid "Multiply by data or number" msgstr "Multiplicar por datos o número" @@ -3424,7 +3471,7 @@ msgstr "Nuevo gráfico interno" msgid "New order of dimensions" msgstr "Nuevo orden de dimensiones" -#: udav/udav_wnd.cpp:282 mgllab/mgllab.cpp:293 +#: udav/udav_wnd.cpp:282 mgllab/mgllab.cpp:284 msgid "New script" msgstr "Nuevo script" @@ -3456,7 +3503,7 @@ msgstr "Siguiente sección" msgid "Next slide" msgstr "Siguiente cuadro" -#: mgllab/help.cpp:135 mgllab/mgllab.cpp:242 +#: mgllab/help.cpp:135 mgllab/mgllab.cpp:233 msgid "No" msgstr "No" @@ -3479,7 +3526,7 @@ msgstr "No se ingreso dirección/fórmula. No proceder." msgid "No filename." msgstr "No se ingreso nombre de archivo." -#: mgllab/editor.cpp:585 mgllab/editor.cpp:607 mgllab/editor.cpp:632 +#: mgllab/editor.cpp:589 mgllab/editor.cpp:611 mgllab/editor.cpp:636 #, c-format msgid "No occurrences of '%s' found!" msgstr "¡No se encontró ningun '%s'!" @@ -3496,7 +3543,7 @@ msgstr "No se encontró el texto" msgid "No text rotation" msgstr "No hay ángulo para texto" -#: widgets/fltk.cpp:838 +#: widgets/fltk.cpp:844 msgid "Normal view" msgstr "Vista normal" @@ -3504,11 +3551,11 @@ msgstr "Vista normal" msgid "Normalize" msgstr "Normalizar" -#: src/exec_dat.cpp:1718 +#: src/exec_dat.cpp:1783 msgid "Normalize data" msgstr "Normalizar datos" -#: src/exec_dat.cpp:1719 +#: src/exec_dat.cpp:1784 msgid "Normalize data slice by slice" msgstr "Normalizar datos sección por sección" @@ -3536,11 +3583,11 @@ msgstr "Parámetro numérico" msgid "Numeric value" msgstr "Valor numérico" -#: src/exec_dat.cpp:1683 +#: src/exec_dat.cpp:1745 msgid "Numerically differentiate data" msgstr "Diferenciar numéricamente datos" -#: src/exec_dat.cpp:1684 +#: src/exec_dat.cpp:1746 msgid "Numerically double differentiate data" msgstr "Diferenciar numéricamente dos veces datos" @@ -3567,7 +3614,7 @@ msgstr "OBJ" #: udav/data_dlg.cpp:92 udav/subplot_dlg.cpp:221 mgllab/mathgl.cpp:198 #: mgllab/dialogs.cpp:121 mgllab/dialogs.cpp:165 mgllab/dialogs.cpp:411 #: mgllab/dialogs.cpp:585 mgllab/dialogs.cpp:750 mgllab/dialogs.cpp:1072 -#: mgllab/dialogs.cpp:1319 mgllab/dialogs.cpp:1474 mgllab/mgllab.cpp:498 +#: mgllab/dialogs.cpp:1319 mgllab/dialogs.cpp:1474 mgllab/mgllab.cpp:491 #: mgllab/table.cpp:621 msgid "OK" msgstr "OK" @@ -3576,11 +3623,11 @@ msgstr "OK" msgid "Only current slice will be inserted" msgstr "Solo la sección actual sera insertada" -#: mgllab/mgllab.cpp:181 +#: mgllab/mgllab.cpp:172 msgid "Open File?" msgstr "¿Abrir archivo?" -#: src/exec_dat.cpp:1721 +#: src/exec_dat.cpp:1786 msgid "Open all data arrays from HDF file" msgstr "Cargar todos los arreglos del archivo HDF" @@ -3600,7 +3647,7 @@ msgstr "Abrir dialogo de creacion de datos nuevos." msgid "Open file" msgstr "Abrir archivo" -#: mgllab/mgllab.cpp:294 +#: mgllab/mgllab.cpp:285 msgid "Open file ..." msgstr "Abrir archivo ..." @@ -3608,7 +3655,7 @@ msgstr "Abrir archivo ..." msgid "Open printer dialog and print graphics (Ctrl+P)" msgstr "Abrir dialogo de impresion e imprimir gráfica (Ctrl+P)" -#: mgllab/editor.cpp:507 +#: mgllab/editor.cpp:511 msgid "Open script or data file" msgstr "Abrir script o archivo de datos" @@ -3629,7 +3676,7 @@ msgid "Operations" msgstr "Operaciones" #: udav/prop_dlg.cpp:91 udav/newcmd_dlg.cpp:72 mgllab/dialogs.cpp:746 -#: mgllab/mgllab.cpp:325 +#: mgllab/mgllab.cpp:316 msgid "Options" msgstr "Opciones" @@ -3671,7 +3718,7 @@ msgstr "PNG" msgid "PNG Files \t*.png" msgstr "Archivos PNG \t*.png" -#: src/canvas_cf.cpp:495 src/canvas_cf.cpp:497 src/data_png.cpp:118 +#: src/canvas_cf.cpp:546 src/canvas_cf.cpp:548 src/data_png.cpp:118 #: src/export.cpp:75 src/export.cpp:109 msgid "PNG support was disabled. Please, enable it and rebuild MathGL." msgstr "Formato PNG deshabilitado. Habilítelo y recompile MathGL." @@ -3696,11 +3743,11 @@ msgstr "Pegar datos" msgid "Paste range of numbers from clipboard (Ctrl+Shift+P)." msgstr "Pegar rango de números desde memoria (Ctrl+Shift+P)." -#: udav/text_pnl.cpp:538 mgllab/mgllab.cpp:311 +#: udav/text_pnl.cpp:538 mgllab/mgllab.cpp:302 msgid "Paste text" msgstr "Pegar texto" -#: mgllab/editor.cpp:514 +#: mgllab/editor.cpp:518 msgid "Paste text from clipboard" msgstr "Pegar texto desde memoria" @@ -3708,11 +3755,11 @@ msgstr "Pegar texto desde memoria" msgid "Paste text or data from clipboard (Ctrl+V)." msgstr "Pegar texto o datos desde memoria (Ctrl+V)." -#: mgllab/mgllab.cpp:484 +#: mgllab/mgllab.cpp:476 msgid "Path for MathGL font (without extension)" msgstr "Dirreccion de fuentes de MathGL (sin extension)" -#: udav/prop_dlg.cpp:110 mgllab/mgllab.cpp:481 +#: udav/prop_dlg.cpp:110 mgllab/mgllab.cpp:473 msgid "Path for help files" msgstr "Direccion de archivos de ayuda" @@ -3725,15 +3772,15 @@ msgid "Pause calculation" msgstr "Paudar calculos" #. Wnd->connect(a, SIGNAL(triggered()), QMGL, SLOT(setPause())); -#: widgets/fltk.cpp:921 widgets/qt.cpp:1287 +#: widgets/fltk.cpp:927 widgets/qt.cpp:1287 msgid "Pause on/off external calculations" msgstr "Pausar on/off calculos externos" -#: src/exec_dat.cpp:1738 +#: src/exec_dat.cpp:1804 msgid "Perform Runge-Kutta step" msgstr "Ejecutar un paso de Runge-Kutta" -#: widgets/fltk.cpp:890 +#: widgets/fltk.cpp:896 msgid "Phi angle (rotate in x*y plane)" msgstr "Ángulo phi (rotar en plano xy)" @@ -3745,7 +3792,7 @@ msgstr "Mover editor arriba" msgid "Plot ID" msgstr "ID del gráfico" -#: src/exec_prm.cpp:643 +#: src/exec_prm.cpp:647 msgid "Plot curve by formula" msgstr "Gráficar curva por fórmula" @@ -3766,15 +3813,15 @@ msgstr "" "Graficar datos en ventana nueva de script. Puede elejir\n" "el tipo de gráfica, estilo, etc." -#: mgllab/mgllab.cpp:340 +#: mgllab/mgllab.cpp:331 msgid "Plot setup" msgstr "Gráfica" -#: udav/text_pnl.cpp:571 mgllab/dialogs.cpp:312 mgllab/mgllab.cpp:324 +#: udav/text_pnl.cpp:571 mgllab/dialogs.cpp:312 mgllab/mgllab.cpp:315 msgid "Plot style" msgstr "Estilo de gráfica" -#: src/exec_prm.cpp:644 +#: src/exec_prm.cpp:648 msgid "Plot surface by formula" msgstr "Graficar superficie por fórmula" @@ -3794,11 +3841,11 @@ msgstr "Seccion prev." msgid "Prev slide" msgstr "Seccion prev." -#: udav/info_dlg.cpp:51 +#: udav/info_dlg.cpp:53 msgid "Preview" msgstr "Vista previa" -#: mgllab/mgllab.cpp:581 +#: mgllab/mgllab.cpp:576 msgid "Previous expressions" msgstr "Expresiones previas" @@ -3810,15 +3857,15 @@ msgstr "Primitivas" msgid "Primitives ..." msgstr "Primitivas ..." -#: src/exec_set.cpp:854 +#: src/exec_set.cpp:863 msgid "Print MathGL version or check if it is valid" msgstr "Imprimir version de MathGL o verificar su validez" -#: src/exec_dat.cpp:1688 +#: src/exec_dat.cpp:1750 msgid "Print content of the data" msgstr "Imprimir contenido de datos" -#: src/exec_dat.cpp:1727 +#: src/exec_dat.cpp:1792 msgid "Print fitted formula" msgstr "Imprimir fórmula ajustada" @@ -3826,15 +3873,15 @@ msgstr "Imprimir fórmula ajustada" msgid "Print graphics" msgstr "Imprimir gráfica" -#: src/exec_dat.cpp:1680 +#: src/exec_dat.cpp:1742 msgid "Print list of data names in HDF file" msgstr "Imprimir lista de nombres de datos de archivo HDF" -#: src/exec_dat.cpp:1705 +#: src/exec_dat.cpp:1768 msgid "Print message or information about the data" msgstr "Imprimir mensaje o información acerca de datos" -#: mgllab/mgllab.cpp:297 +#: mgllab/mgllab.cpp:288 msgid "Print plot" msgstr "Imprimir gráfica" @@ -3842,7 +3889,7 @@ msgstr "Imprimir gráfica" msgid "Print script" msgstr "Imprimir script" -#: src/exec_prm.cpp:641 +#: src/exec_prm.cpp:645 msgid "Print string from file" msgstr "Imprimir texto de archivo" @@ -3862,11 +3909,11 @@ msgstr "Imprimiendo..." msgid "Program flow" msgstr "Flujo de programa" -#: src/exec_dat.cpp:1669 +#: src/exec_dat.cpp:1731 msgid "Project periodical data in [v1,v2]" msgstr "Proyectar datos periódicos en [v1,v2]" -#: udav/udav_wnd.cpp:312 mgllab/mgllab.cpp:337 mgllab/mgllab.cpp:476 +#: udav/udav_wnd.cpp:312 mgllab/mgllab.cpp:328 mgllab/mgllab.cpp:468 msgid "Properties" msgstr "Propiedades" @@ -3878,7 +3925,7 @@ msgstr "Propiedades del arreglo seleccionado" msgid "Pulse prop." msgstr "Prop. de pulso" -#: udav/calc_dlg.cpp:127 mgllab/mgllab.cpp:615 +#: udav/calc_dlg.cpp:127 mgllab/mgllab.cpp:610 msgid "Put function" msgstr "Usar función" @@ -3894,7 +3941,7 @@ msgstr "Poner en el arreglo actual" msgid "Put to script" msgstr "Poner en script" -#: src/exec_dat.cpp:1726 +#: src/exec_dat.cpp:1791 msgid "Put value (numeric or array) to given data element" msgstr "Poner valor (numérico o arreglo) al elemento dado" @@ -3912,35 +3959,40 @@ msgstr "Salir" msgid "R - maroon" msgstr "R - carmesí" -#: src/exec_set.cpp:835 +#: src/exec_set.cpp:843 msgid "Rasterize plot and save to background" msgstr "Rasterizar gráfica y guardar de fondo" -#: src/exec_dat.cpp:1732 +#: src/exec_dat.cpp:1797 msgid "Read and join data from several files" msgstr "Leer y juntar datos de varios archivos" -#: src/exec_dat.cpp:1731 +#: src/exec_dat.cpp:1798 +#, fuzzy +msgid "Read data from binary file of specified type" +msgstr "Leer datos de archivo con tamaño indicado en la 1ra fila" + +#: src/exec_dat.cpp:1796 msgid "Read data from file" msgstr "Leer datos de archivo" -#: src/exec_dat.cpp:1734 +#: src/exec_dat.cpp:1800 msgid "Read data from file with sizes specified in first row" msgstr "Leer datos de archivo con tamaño indicado en la 1ra fila" -#: src/exec_dat.cpp:1733 +#: src/exec_dat.cpp:1799 msgid "Read data with name 'id' from HDF file" msgstr "Leer datos con nombre 'id' de archivo HDF" -#: udav/udav_wnd.cpp:268 mgllab/mgllab.cpp:382 +#: udav/udav_wnd.cpp:268 mgllab/mgllab.cpp:373 msgid "Ready" msgstr "Listo" -#: src/exec_dat.cpp:1735 +#: src/exec_dat.cpp:1801 msgid "Rearrange data dimensions" msgstr "Reordenar dimensiones de datos" -#: udav/udav_wnd.cpp:301 mgllab/mgllab.cpp:298 +#: udav/udav_wnd.cpp:301 mgllab/mgllab.cpp:289 msgid "Recent files" msgstr "Archivos recientes" @@ -3965,7 +4017,7 @@ msgstr "Volver a graficar" msgid "Redraw picture for $0 equal to" msgstr "Volver a graficar para $0 igual a" -#: widgets/fltk.cpp:839 +#: widgets/fltk.cpp:845 msgid "Redraw plot" msgstr "Volver a graficar" @@ -3973,7 +4025,7 @@ msgstr "Volver a graficar" msgid "Refresh" msgstr "Actualizar" -#: widgets/fltk.cpp:873 +#: widgets/fltk.cpp:879 msgid "Refresh the picture" msgstr "Actualizar la imagen" @@ -3985,31 +4037,31 @@ msgstr "Posición relativa al i-ésimo color" msgid "Reload" msgstr "Recargar" -#: widgets/fltk.cpp:841 +#: widgets/fltk.cpp:847 msgid "Reload data" msgstr "Recargar datos" -#: widgets/fltk.cpp:879 +#: widgets/fltk.cpp:885 msgid "Reload data and refresh the picture" msgstr "REcargar datos y actualizar imagen" -#: src/exec_dat.cpp:1668 +#: src/exec_dat.cpp:1730 msgid "Remove duplicate rows" msgstr "Borrar filas duplicadas" -#: src/exec_dat.cpp:1745 +#: src/exec_dat.cpp:1811 msgid "Remove jump into the data, like phase jumps" msgstr "Remover saltos en datos, como saltos de fase" -#: udav/find_dlg.cpp:50 mgllab/editor.cpp:562 +#: udav/find_dlg.cpp:50 mgllab/editor.cpp:566 msgid "Replace" msgstr "Reemplazar" -#: mgllab/editor.cpp:565 +#: mgllab/editor.cpp:569 msgid "Replace all" msgstr "Reemplazar todo" -#: udav/find_dlg.cpp:39 mgllab/editor.cpp:561 +#: udav/find_dlg.cpp:39 mgllab/editor.cpp:565 msgid "Replace by:" msgstr "Reemplazar con:" @@ -4017,7 +4069,7 @@ msgstr "Reemplazar con:" msgid "Replace expression by its numerical value." msgstr "Reemplazar expresiones con sus valore numericos." -#: mgllab/editor.cpp:631 +#: mgllab/editor.cpp:635 #, c-format msgid "Replaced %ld occurrences." msgstr "%ld ocurrencias reemplazadas." @@ -4051,7 +4103,7 @@ msgstr "Reservar espacio para etiquetas a la der. (estilo '>')" msgid "Reserve space for labels at top side (style '^')" msgstr "Reservar espacio para etiquetas arriba (estilo '^')" -#: src/exec_set.cpp:836 +#: src/exec_set.cpp:844 msgid "Reset settings and clear picture" msgstr "Reestablecer config. y limpiar imagen" @@ -4063,7 +4115,7 @@ msgstr "Reescalar" msgid "Resize (interpolate) the data to specified sizes (Ctrl+Shift+R)." msgstr "Reescalar (interpolar) datos a tamaño especificado (Ctrl+Shift+R)." -#: src/exec_dat.cpp:1737 +#: src/exec_dat.cpp:1803 msgid "Resize data array" msgstr "Reescalar datos" @@ -4075,7 +4127,7 @@ msgstr "Reescalar datos con suavizado" msgid "Restore" msgstr "Reestablecer" -#: widgets/fltk.cpp:870 +#: widgets/fltk.cpp:876 msgid "Restore default graphics rotation, zoom and perspective" msgstr "Reestablecer rotacion , zoom y perspectiva por defecto" @@ -4104,7 +4156,7 @@ msgstr "Resulto (tendra tamaño " msgid "Resulting string" msgstr "Texto resultante" -#: src/parser.cpp:1497 +#: src/parser.cpp:1506 msgid "Return from function" msgstr "Salida de la función" @@ -4120,7 +4172,7 @@ msgstr "Esquina superior der." msgid "Roll" msgstr "Roll" -#: src/exec_dat.cpp:1739 +#: src/exec_dat.cpp:1805 msgid "Roll data along direction(s)" msgstr "Roll data along direction(s)" @@ -4145,11 +4197,11 @@ msgstr "Rotar a la izq." msgid "Rotate on" msgstr "Rotate on" -#: widgets/fltk.cpp:866 +#: widgets/fltk.cpp:872 msgid "Rotate picture by holding left mouse button" msgstr "Rotar figura al presionando el botón izq. del mouse" -#: src/exec_set.cpp:837 +#: src/exec_set.cpp:845 msgid "Rotate plot" msgstr "Rotar gráfica" @@ -4177,7 +4229,7 @@ msgstr "" "Correr animación (Ctrl+F5). Si no se especifican\n" "parámetros, se mostrará el dialogo de animación." -#: widgets/fltk.cpp:912 +#: widgets/fltk.cpp:918 msgid "Run/Stop slideshow (graphics animation)" msgstr "Correr/detener animación" @@ -4197,7 +4249,7 @@ msgstr "SVG" msgid "Saturation" msgstr "Saturacion" -#: udav/setup_dlg.cpp:143 mgllab/editor.cpp:282 +#: udav/setup_dlg.cpp:143 mgllab/editor.cpp:286 msgid "Save" msgstr "Guardar" @@ -4205,7 +4257,7 @@ msgstr "Guardar" msgid "Save Data?" msgstr "¿Guardar datos?" -#: widgets/fltk.cpp:595 mgllab/mgllab.cpp:229 +#: widgets/fltk.cpp:601 mgllab/mgllab.cpp:220 msgid "Save File As?" msgstr "Guardar archivo como" @@ -4213,7 +4265,7 @@ msgstr "Guardar archivo como" msgid "Save JPEG frames" msgstr "Guardar cuadros JPEG" -#: udav/udav_wnd.cpp:290 mgllab/mgllab.cpp:296 +#: udav/udav_wnd.cpp:290 mgllab/mgllab.cpp:287 msgid "Save as ..." msgstr "Guardar como ..." @@ -4221,7 +4273,7 @@ msgstr "Guardar como ..." msgid "Save data" msgstr "Guardar datos" -#: src/exec_dat.cpp:1742 +#: src/exec_dat.cpp:1808 msgid "Save data to HDF5 file" msgstr "Guardar datos a archivo HDF5" @@ -4229,15 +4281,15 @@ msgstr "Guardar datos a archivo HDF5" msgid "Save data to a file (Ctrl+Shift+S)." msgstr "Guardar datos a archivo (Ctrl+Shift+S)." -#: src/exec_dat.cpp:1741 mgllab/table.cpp:844 +#: src/exec_dat.cpp:1807 mgllab/table.cpp:844 msgid "Save data to file" msgstr "Guardar datos a archivo" -#: mgllab/mgllab.cpp:295 +#: mgllab/mgllab.cpp:286 msgid "Save file" msgstr "Guardar archivo" -#: mgllab/mgllab.cpp:488 +#: mgllab/mgllab.cpp:480 msgid "Save file before redrawing" msgstr "Guardar archivo antes de volver a graficar" @@ -4249,7 +4301,7 @@ msgstr "Guardar script" msgid "Save script to a file (Ctrl+S)" msgstr "Guardar script a archivo (Ctrl+S)" -#: mgllab/editor.cpp:509 +#: mgllab/editor.cpp:513 msgid "Save script to file" msgstr "Guardar script a archivo" @@ -4273,11 +4325,11 @@ msgstr "Escalar y rotar" msgid "Script" msgstr "Script" -#: udav/find_dlg.cpp:43 mgllab/editor.cpp:564 +#: udav/find_dlg.cpp:43 mgllab/editor.cpp:568 msgid "Search backward" msgstr "Buscar atras" -#: udav/text_pnl.cpp:543 mgllab/mgllab.cpp:312 +#: udav/text_pnl.cpp:543 mgllab/mgllab.cpp:303 msgid "Select all" msgstr "Seleccionar todo" @@ -4297,7 +4349,7 @@ msgstr "Seleccionar argumento de datos" msgid "Select direction" msgstr "Seleccionar dirección" -#: mgllab/editor.cpp:654 +#: mgllab/editor.cpp:658 msgid "Select file name" msgstr "Seleccionar nombre de archivo" @@ -4305,7 +4357,7 @@ msgstr "Seleccionar nombre de archivo" msgid "Select first the proper kind of arguments" msgstr "Seleccione primero los tipos adecuados de argumentos" -#: mgllab/editor.cpp:667 +#: mgllab/editor.cpp:671 msgid "Select folder name" msgstr "Seleccionar nombre de directorio" @@ -4313,7 +4365,7 @@ msgstr "Seleccionar nombre de directorio" msgid "Select kind of plot" msgstr "Seleccionar tipo de gráfica" -#: src/exec_set.cpp:853 +#: src/exec_set.cpp:862 msgid "Select variant of plot style(s)" msgstr "Seleccionar variante de estilo(s) de gráfica" @@ -4321,55 +4373,55 @@ msgstr "Seleccionar variante de estilo(s) de gráfica" msgid "Set" msgstr "Especificar" -#: src/exec_set.cpp:849 +#: src/exec_set.cpp:858 msgid "Set additional tick and axis labels shift" msgstr "Desplazamiento adicional para etiquetas y escala del eje" -#: src/exec_set.cpp:797 +#: src/exec_set.cpp:805 msgid "Set ambient light brightness" msgstr "Especificar brillo de luz ambiental" -#: src/exec_set.cpp:818 +#: src/exec_set.cpp:826 msgid "Set arbitrary position of plot in picture" msgstr "Especificar posición arbitraria de gráfica en imagen" -#: udav/udav_wnd.cpp:315 mgllab/mgllab.cpp:338 +#: udav/udav_wnd.cpp:315 mgllab/mgllab.cpp:329 msgid "Set arguments" msgstr "Argumentos" -#: src/exec_set.cpp:799 +#: src/exec_set.cpp:807 msgid "Set aspect ration" msgstr "Especificar proporcion de apariencia" -#: src/exec_set.cpp:801 +#: src/exec_set.cpp:809 msgid "Set axis and tick style" msgstr "Especificar estilos de eje y escala" -#: src/exec_set.cpp:827 +#: src/exec_set.cpp:835 msgid "Set axis origin" msgstr "Especificar origen de ejes" -#: src/exec_set.cpp:834 +#: src/exec_set.cpp:842 msgid "Set axis ranges" msgstr "Especificar rango de ejes" -#: src/exec_set.cpp:842 +#: src/exec_set.cpp:850 msgid "Set bit-flags (for advanced users only)" msgstr "Especificar bit-flags (para usuarios avanzados)" -#: src/exec_set.cpp:803 +#: src/exec_set.cpp:811 msgid "Set bounding box for 2d export" msgstr "Especificar \"bounding box\" para exportar 2D" -#: src/exec_set.cpp:824 +#: src/exec_set.cpp:832 msgid "Set brush for given mask id" msgstr "Especificar brocha para máscara id dada" -#: src/exec_set.cpp:808 +#: src/exec_set.cpp:816 msgid "Set color range" msgstr "Especificar rango de colores" -#: src/exec_dat.cpp:1703 +#: src/exec_dat.cpp:1766 msgid "Set column id for data" msgstr "Especificar id de columna para datos" @@ -4381,23 +4433,23 @@ msgstr "Activar/desactivar cortado para gráfica particular" msgid "Set data sizes manually" msgstr "Especificar tamaño de datos manualmente" -#: src/exec_set.cpp:802 +#: src/exec_set.cpp:810 msgid "Set default bars width" msgstr "Especificar ancho de barras" -#: src/exec_set.cpp:832 +#: src/exec_set.cpp:840 msgid "Set default filename" msgstr "Especificar nombre de archivo" -#: src/exec_set.cpp:796 +#: src/exec_set.cpp:804 msgid "Set default transparency" msgstr "Especificar transparencia" -#: src/exec_set.cpp:811 +#: src/exec_set.cpp:819 msgid "Set diffusive light brightness" msgstr "Especificar brillo de luz difusa" -#: src/exec_set.cpp:812 +#: src/exec_set.cpp:820 msgid "Set draw region for quality&4" msgstr "Especificar region de dibujo para calida&4" @@ -4421,75 +4473,75 @@ msgstr "Especificar area de dibujo como celda de barra." msgid "Set lighting off/on for particular plot" msgstr "Activar/desactivar luz para gráfica particular" -#: src/exec_set.cpp:825 +#: src/exec_set.cpp:833 msgid "Set number of lines in mesh/fall/vect and so on" msgstr "Especificar número de líneas en grilla/cascada/etc." -#: src/exec_set.cpp:819 +#: src/exec_set.cpp:827 msgid "Set number of marks in the legend" msgstr "Especificar número de marcas en leyenda" -#: src/exec_set.cpp:813 +#: src/exec_set.cpp:821 msgid "Set number of visible faces" msgstr "Especificar número de facetas visibles" -#: src/exec_set.cpp:829 +#: src/exec_set.cpp:837 msgid "Set palette for 1D plots" msgstr "Especificar paleta para gráficas 1D" -#: src/exec_set.cpp:831 +#: src/exec_set.cpp:839 msgid "Set perspective" msgstr "Especificar perspectiva" -#: src/exec_set.cpp:840 +#: src/exec_set.cpp:848 msgid "Set picture size" msgstr "Especificar tamaño de imagen" -#: src/exec_set.cpp:833 +#: src/exec_set.cpp:841 msgid "Set plot quality" msgstr "Especificar calidad de gráfica" -#: src/exec_set.cpp:846 +#: src/exec_set.cpp:854 msgid "Set position of plot as cell of matrix" msgstr "Especificar posición de gráfica como celda de matriz" -#: src/exec_set.cpp:826 +#: src/exec_set.cpp:834 msgid "Set position of plot block in matrix" msgstr "Especificar posición de gráfica en matriz" -#: src/exec_set.cpp:807 +#: src/exec_set.cpp:815 msgid "Set position of plot inside cell of column" msgstr "Especificar posición de gráfica en celda de columna" -#: src/exec_set.cpp:817 +#: src/exec_set.cpp:825 msgid "Set position of plot inside cell of matrix" msgstr "Especificar posición de gráfica en celda de matriz" -#: src/exec_set.cpp:845 +#: src/exec_set.cpp:853 msgid "Set position of plot inside cell of rotated stick" msgstr "Especificar posición de gráfica en celda de barra rotada" -#: src/exec_set.cpp:844 +#: src/exec_set.cpp:852 msgid "Set position of plot inside cell of sheared stick" msgstr "Especificar posición de gráfica en celda de barra recortada" -#: src/exec_set.cpp:857 +#: src/exec_set.cpp:866 msgid "Set range for x-axis" msgstr "Especificar rango de eje x" -#: src/exec_set.cpp:859 +#: src/exec_set.cpp:868 msgid "Set range for y-axis" msgstr "Especificar rango de eje y" -#: src/exec_set.cpp:863 +#: src/exec_set.cpp:872 msgid "Set range for z-axis" msgstr "Especificar rango de eje z" -#: src/exec_set.cpp:839 +#: src/exec_set.cpp:847 msgid "Set scale text in relative subplots too" msgstr "Set scale text in relative subplots too" -#: src/exec_set.cpp:841 +#: src/exec_set.cpp:849 msgid "Set scaling factor for further setsize" msgstr "Especificar factor de escala para \"setsize\"" @@ -4501,51 +4553,51 @@ msgstr "Especificar argumentos de script" msgid "Set size for text, marks and others" msgstr "Especificar tamaño de texto, marcas y otros" -#: src/exec_set.cpp:798 +#: src/exec_set.cpp:806 msgid "Set size of arrows" msgstr "Especificar tamaño de flechas" -#: src/exec_set.cpp:823 +#: src/exec_set.cpp:831 msgid "Set size of markers" msgstr "Especificar tamaño de marcadores" -#: src/exec_set.cpp:830 +#: src/exec_set.cpp:838 msgid "Set size of semi-transparent area around line" msgstr "Especificar tamaño de area semitransparente alrededor de línea" -#: src/exec_set.cpp:828 +#: src/exec_set.cpp:836 msgid "Set tick labels drawing at origin" msgstr "Set tick labels drawing at origin" -#: src/exec_set.cpp:848 +#: src/exec_set.cpp:857 msgid "Set tick length" msgstr "Especificar longtud de marcas" -#: src/exec_set.cpp:809 +#: src/exec_set.cpp:817 msgid "Set ticks for colorbar" msgstr "Especificar escala para barra de colores" -#: src/exec_set.cpp:858 +#: src/exec_set.cpp:867 msgid "Set ticks for x-axis" msgstr "Especificar escala para el eje x" -#: src/exec_set.cpp:860 +#: src/exec_set.cpp:869 msgid "Set ticks for y-axis" msgstr "Especificar escala para el eje y" -#: src/exec_set.cpp:864 +#: src/exec_set.cpp:873 msgid "Set ticks for z-axis" msgstr "Especificar escala para el eje z" -#: src/exec_set.cpp:850 +#: src/exec_set.cpp:859 msgid "Set ticks in time format" msgstr "Especificar escala en formato de tiempo" -#: src/exec_set.cpp:852 +#: src/exec_set.cpp:861 msgid "Set ticks tuning" msgstr "Afinar escala" -#: src/exec_set.cpp:838 +#: src/exec_set.cpp:846 msgid "Set to auto rotate text or not" msgstr "Activar/desactivar rotacion de texto" @@ -4553,7 +4605,7 @@ msgstr "Activar/desactivar rotacion de texto" msgid "Set to use whole area (style '#')" msgstr "Usar toda el area (estilo '#')" -#: src/exec_set.cpp:851 +#: src/exec_set.cpp:860 msgid "Set type transparency" msgstr "Especificar tipo de transparencia" @@ -4585,11 +4637,11 @@ msgstr "" msgid "Settings" msgstr "Ajustes" -#: mgllab/mgllab.cpp:336 +#: mgllab/mgllab.cpp:327 msgid "Setup" msgstr "Configurar" -#: mgllab/mgllab.cpp:339 +#: mgllab/mgllab.cpp:330 msgid "Setup animation" msgstr "Animación" @@ -4597,19 +4649,19 @@ msgstr "Animación" msgid "Setup colors for:" msgstr "Config. colores para:" -#: src/exec_set.cpp:815 +#: src/exec_set.cpp:823 msgid "Setup font" msgstr "Config. fuente" -#: src/exec_set.cpp:820 +#: src/exec_set.cpp:828 msgid "Setup light" msgstr "Config. luz" -#: src/exec_prm.cpp:625 +#: src/exec_prm.cpp:629 msgid "Setup or draw axis" msgstr "Config. o graficar eje" -#: src/exec_set.cpp:810 +#: src/exec_set.cpp:818 msgid "Setup plot points cutting" msgstr "Config. cortado de gráfica" @@ -4633,23 +4685,23 @@ msgstr "Sew phase" msgid "Sharp colors" msgstr "Colores fuertes" -#: src/exec_set.cpp:843 +#: src/exec_set.cpp:851 msgid "Shear plot" msgstr "Recortar gráfica" -#: widgets/fltk.cpp:905 +#: widgets/fltk.cpp:911 msgid "Shift the picture down" msgstr "Mover la imagen abajo" -#: widgets/fltk.cpp:897 +#: widgets/fltk.cpp:903 msgid "Shift the picture left" msgstr "Mover la imagen a la izq." -#: widgets/fltk.cpp:903 +#: widgets/fltk.cpp:909 msgid "Shift the picture right" msgstr "Mover la imagen a la der." -#: widgets/fltk.cpp:895 +#: widgets/fltk.cpp:901 msgid "Shift the picture up" msgstr "Mover la imagen arriba" @@ -4657,7 +4709,7 @@ msgstr "Mover la imagen arriba" msgid "Short description of selected command" msgstr "Descripción corta del comando seleccionado" -#: udav/info_dlg.cpp:54 +#: udav/info_dlg.cpp:56 msgid "Short information about the data." msgstr "Info. resumida de los datos." @@ -4673,11 +4725,11 @@ msgstr "" "Mostrar calculadora que escribe y evalua formulas textuales.\n" "Las formulas textuales pueden contener variables también." -#: mgllab/editor.cpp:526 mgllab/editor.cpp:528 +#: mgllab/editor.cpp:530 msgid "Show calculator window" msgstr "Mostrar ventana de calculadora" -#: widgets/fltk.cpp:916 +#: widgets/fltk.cpp:922 msgid "Show custom dialog for plot setup" msgstr "Mostrar dialogo de config. de gráfica" @@ -4742,11 +4794,11 @@ msgstr "Mostrar sugerencias de uso de MGL." msgid "Show info" msgstr "Mostrar info." -#: mgllab/mgllab.cpp:314 +#: mgllab/mgllab.cpp:305 msgid "Show lines" msgstr "Mostrar líneas" -#: widgets/fltk.cpp:913 +#: widgets/fltk.cpp:919 msgid "Show next frame in slideshow" msgstr "Mostrar sgte. cuadro de la animación" @@ -4754,7 +4806,7 @@ msgstr "Mostrar sgte. cuadro de la animación" msgid "Show next slide (Ctrl+.)." msgstr "Mostrar sgte. cuadro (Ctrl+.)." -#: widgets/fltk.cpp:908 +#: widgets/fltk.cpp:914 msgid "Show previous frame in slideshow" msgstr "Mostrar cuadro previo de la animación" @@ -4762,6 +4814,15 @@ msgstr "Mostrar cuadro previo de la animación" msgid "Show previous slide (Ctrl+,)." msgstr "Mostrar cuadro previo (Ctrl+,)." +#: mgllab/editor.cpp:532 +#, fuzzy +msgid "Show window for primitives" +msgstr "Mostrar dialogo de propiedades de UDAV." + +#: src/random.cpp:354 +msgid "Shuffle data cells (for dir='a') or slices (for dir='xyz')" +msgstr "" + #: mgllab/table.cpp:779 msgid "Sin FFT" msgstr "Sin FFT" @@ -4770,7 +4831,7 @@ msgstr "Sin FFT" msgid "Sin-Fourier transform along direction(s)" msgstr "Transformada Sin-Fourier en dirección(es)" -#: src/exec_dat.cpp:1746 +#: src/exec_dat.cpp:1812 msgid "Sin-Fourier transform at some direction" msgstr "Transformada Sin-Fourier en alguna dirección" @@ -4796,7 +4857,7 @@ msgstr "Tamaño de barra" msgid "Sizes" msgstr "Tamaños" -#: src/parser.cpp:1482 +#: src/parser.cpp:1491 msgid "Skip commands and iterate for-loop again" msgstr "Saltar comandos e iterar bucle \"for\" nuevamente" @@ -4808,7 +4869,7 @@ msgstr "Animación" msgid "Smooth" msgstr "Suavizado" -#: src/exec_dat.cpp:1747 +#: src/exec_dat.cpp:1813 msgid "Smooth data" msgstr "Suavizar datos" @@ -4817,35 +4878,35 @@ msgid "Smooth data along direction(s)" msgstr "Suavizar datos en dirección(es)" # Mantener ODE y GO o llevar al español? -#: src/exec_dat.cpp:1730 +#: src/exec_dat.cpp:1795 msgid "Solve Hamiltonian ODE (find GO ray or trajectory)" msgstr "Resolver ODE (encontrar rayo GO o trayectoria)" -#: src/exec_dat.cpp:1720 +#: src/exec_dat.cpp:1785 msgid "Solve ODE" msgstr "Resolver ODE" -#: src/exec_dat.cpp:1722 +#: src/exec_dat.cpp:1787 msgid "Solve PDE" msgstr "Resolver PDE" -#: src/exec_dat.cpp:1728 +#: src/exec_dat.cpp:1793 msgid "Solve PDE in accompanied coordinates for 2d case" msgstr "Solve PDE in accompanied coordinates for 2d case" -#: src/exec_dat.cpp:1729 +#: src/exec_dat.cpp:1794 msgid "Solve PDE in accompanied coordinates for 3d case" msgstr "Solve PDE in accompanied coordinates for 3d case" -#: src/exec_dat.cpp:1667 +#: src/exec_dat.cpp:1729 msgid "Solve PDE using advanced method (X-Y only)" msgstr "Resolver PDE usando método avanzado (solo X-Y)" -#: src/exec_dat.cpp:1761 +#: src/exec_dat.cpp:1827 msgid "Solve tridiagonal matrix" msgstr "Resolver matriz tridiagonal" -#: src/exec_dat.cpp:1749 +#: src/exec_dat.cpp:1815 msgid "Sort data by values in column" msgstr "Ordenar datos por valores en columna" @@ -4885,7 +4946,7 @@ msgstr "" msgid "Squeeze" msgstr "Comprimir" -#: src/exec_dat.cpp:1750 +#: src/exec_dat.cpp:1816 msgid "Squeeze data" msgstr "Comprimir datos" @@ -4893,15 +4954,15 @@ msgstr "Comprimir datos" msgid "Start" msgstr "Inicio" -#: src/parser.cpp:1492 +#: src/parser.cpp:1501 msgid "Start function definition and stop execution of main script" msgstr "Definir función y detener ejecución de script principal" -#: src/parser.cpp:1495 +#: src/parser.cpp:1504 msgid "Start next for-loop iteration" msgstr "Iniciar sgte. iteración de bucle for" -#: src/parser.cpp:1496 +#: src/parser.cpp:1505 msgid "Start/close commands which should executed only once" msgstr "Iniciar/terminar bloque de comandos ejecutables una sola vez" @@ -4913,7 +4974,7 @@ msgstr "Índice de celda inicial" msgid "State" msgstr "Estado" -#: src/exec_dat.cpp:1685 +#: src/exec_dat.cpp:1747 msgid "Step for pulse diffraction" msgstr "Paso para pulso de difracción" @@ -4921,11 +4982,11 @@ msgstr "Paso para pulso de difracción" msgid "Stop" msgstr "Deterner" -#: widgets/fltk.cpp:875 +#: widgets/fltk.cpp:881 msgid "Stop drawing" msgstr "Detener graficación" -#: src/parser.cpp:1498 +#: src/parser.cpp:1507 msgid "Stop execution" msgstr "Detener ejecución" @@ -5025,7 +5086,7 @@ msgstr "Subescala" msgid "Subticks" msgstr "Subescala" -#: src/exec_dat.cpp:1753 +#: src/exec_dat.cpp:1819 msgid "Subtract data or number" msgstr "Restar datos o número" @@ -5051,7 +5112,7 @@ msgstr "Sumar datos en una(s) dirección(es)" msgid "Summation of" msgstr "Suma de" -#: src/exec_dat.cpp:1755 +#: src/exec_dat.cpp:1821 msgid "Swap data (useful after Fourier transform)" msgstr "Invertir orden de datos (útil luego de la Tranformada de Fourier)" @@ -5063,15 +5124,20 @@ msgstr "Invertir orden de datos en dirección(es)" msgid "Swap parts" msgstr "Intercambiar partes" -#: src/exec_set.cpp:814 +#: src/exec_set.cpp:856 +#, fuzzy +msgid "Switch on/off TeX parsing at text output" +msgstr "Activar/desactivar transparencia en la imagen" + +#: src/exec_set.cpp:822 msgid "Switch on/off fog" msgstr "Activar/desactivar niebla" -#: src/exec_set.cpp:816 +#: src/exec_set.cpp:824 msgid "Switch on/off gray-scale mode" msgstr "Activar/desactivar modo B/N" -#: widgets/fltk.cpp:862 +#: widgets/fltk.cpp:868 msgid "Switch on/off grid drawing" msgstr "Activar/desactivar dibujado de grilla" @@ -5088,7 +5154,7 @@ msgstr "Activar/desactivar luz para las gráficas (Alt+L)." msgid "Switch on/off lightning for the graphics (Ctrl+L)." msgstr "Activar/desactivar luz para las gráficas (Alt+L)." -#: widgets/fltk.cpp:859 +#: widgets/fltk.cpp:865 msgid "Switch on/off lightning in the picture" msgstr "Activar/desactivar luz en la imagen" @@ -5105,11 +5171,11 @@ msgid "Switch on/off mouse zoom of selected region." msgstr "Activar/desactivar zoom con el mouse de la región seleccionada." # Ternario or triple? -#: src/exec_set.cpp:847 +#: src/exec_set.cpp:855 msgid "Switch on/off to use ternary axis" msgstr "Activar/desactivar uso de ejes ternarios" -#: src/exec_set.cpp:795 +#: src/exec_set.cpp:803 msgid "Switch on/off transparency" msgstr "Activar/desactivar transparencia" @@ -5121,7 +5187,7 @@ msgstr "Activar/desactivar transparencia para gráfica (Alt+T)." msgid "Switch on/off transparency for the graphics (Ctrl+T)." msgstr "Activar/desactivar transparencia para gráfica (Alt+T)." -#: widgets/fltk.cpp:856 +#: widgets/fltk.cpp:862 msgid "Switch on/off transparency in the picture" msgstr "Activar/desactivar transparencia en la imagen" @@ -5133,7 +5199,7 @@ msgstr "Rango simétrico" msgid "Symmetrical?" msgstr "¿Simétrico?" -#: src/addon.cpp:121 src/base_cf.cpp:268 +#: src/addon.cpp:121 src/base_cf.cpp:281 #, c-format msgid "TEST: %s\n" msgstr "TEST: %s\n" @@ -5188,7 +5254,7 @@ msgstr "" "Solo escriba la expresión (que puede depender de las coordenadas x,y,z, " "etc.) y añádala al script." -#: mgllab/editor.cpp:280 +#: mgllab/editor.cpp:284 msgid "" "The current file has not been saved.\n" "Would you like to save it now?" @@ -5204,14 +5270,14 @@ msgstr "" "Los diálogos especiales (Editar|Insertar|Nuevo comando) ayudan a seleccionar " "un comando, llenar sus argumentos y añadirlo al script." -#: src/crust.cpp:591 +#: src/crust.cpp:590 msgid "" "There are duplicated or indistinguishably adjacent points for triangulation." msgstr "" "Hay puntos duplicados o indistinguiblemente juntos para la triangulación." #. mglScrStr -#: src/base.cpp:251 +#: src/base.cpp:262 msgid "There is changing temporary data in script" msgstr "Algunos datos temporales cambiaron en el script" @@ -5223,7 +5289,7 @@ msgstr "Hay primitivas del usuario." msgid "There is no 'fmt' argument for this command" msgstr "No hay argumento \"fmt\" para este comando" -#: udav/text_pnl.cpp:137 mgllab/editor.cpp:681 +#: udav/text_pnl.cpp:137 mgllab/editor.cpp:685 msgid "There is no fitted formula." msgstr "No hay fórmula ajustada." @@ -5247,30 +5313,30 @@ msgstr "" "existentes en las expresiones." #. mglScrCmd -#: src/base.cpp:249 +#: src/base.cpp:260 msgid "There is too long string(s) in script" msgstr "Texto muy largo en el script" #. mglScrLong -#: src/base.cpp:250 +#: src/base.cpp:261 msgid "There is unbalanced ' in script" msgstr "Desbalance de ' en el script" #. mglWarnSpc -#: src/base.cpp:247 +#: src/base.cpp:258 msgid "There is wrong argument(s) in script" msgstr "Argumento(s) incorrecto(s) en el script" #. mglScrArg -#: src/base.cpp:248 +#: src/base.cpp:259 msgid "There is wrong command(s) in script" msgstr "Comando(s) incorrecto(s) en el script" -#: widgets/fltk.cpp:888 +#: widgets/fltk.cpp:894 msgid "Theta angle (tilt z-axis)" msgstr "Ángulo theta (inclinación del eje z)" -#: widgets/fltk.cpp:1191 +#: widgets/fltk.cpp:1206 msgid "This is for parameter " msgstr "Esto es para parámetro " @@ -5331,7 +5397,7 @@ msgstr "Transponer" msgid "Transpose data" msgstr "Transponer datos" -#: src/exec_dat.cpp:1759 +#: src/exec_dat.cpp:1825 msgid "Transpose data array" msgstr "Transponer arreglo de datos" @@ -5502,7 +5568,7 @@ msgstr "UDAV - Comprimir datos" msgid "UDAV - about" msgstr "UDAV - Acerca de" -#: udav/anim_dlg.cpp:105 +#: udav/anim_dlg.cpp:104 msgid "UDAV - animation" msgstr "UDAV - Animación" @@ -5546,7 +5612,7 @@ msgid "Underline" msgstr "Subrayado" #. edit menu -#: udav/text_pnl.cpp:516 mgllab/mgllab.cpp:308 +#: udav/text_pnl.cpp:516 mgllab/mgllab.cpp:299 msgid "Undo" msgstr "Deshacer" @@ -5554,15 +5620,15 @@ msgstr "Deshacer" msgid "Undo editor change (Ctrl+Z)." msgstr "Deshacer cambios de editor (Ctrl+Z)." -#: mgllab/mgllab.cpp:137 +#: mgllab/mgllab.cpp:140 msgid "Untitled" msgstr "Sin nombre" -#: mgllab/mgllab.cpp:360 mgllab/mgllab.cpp:364 +#: mgllab/mgllab.cpp:351 mgllab/mgllab.cpp:355 msgid "Untitled - mgllab" msgstr "Sin nombre - mgllab" -#: widgets/fltk.cpp:1108 +#: widgets/fltk.cpp:1120 msgid "Update" msgstr "Actualizar" @@ -5579,7 +5645,7 @@ msgstr "Limite superior para determinar color o alfa" msgid "Usage:\tmglconv [parameter(s)] scriptfile\n" msgstr "Uso:\tmglconv [parámetro(s)] script\n" -#: mgllab/mgllab.cpp:432 +#: mgllab/mgllab.cpp:423 #, c-format msgid "Usage:\tmgllab [parameter(s)] scriptfile\n" msgstr "Uso:\tmgllab [parámetro(s)] script\n" @@ -5624,12 +5690,17 @@ msgstr "" msgid "Use color scheme" msgstr "Usar esquema de colores" +#: mgllab/mgllab.cpp:485 +#, fuzzy +msgid "Use dark color scheme" +msgstr "Usar esquema de colores" + #: udav/prop_dlg.cpp:175 msgid "Use dots plot for preview" msgstr "Usar gráfica de puntos para vista previa" # Thread=hilo? -#: mgllab/mgllab.cpp:492 +#: mgllab/mgllab.cpp:484 msgid "Use multi-threading for drawing" msgstr "Usar múltiples subprocesos para graficar" @@ -5676,7 +5747,7 @@ msgstr "Tamaño vertical" msgid "W - lightgray" msgstr "W - gris claro" -#: src/exec_dat.cpp:1763 +#: src/exec_dat.cpp:1829 msgid "Wavelet transform at some direction" msgstr "Transformada wavelet en alguna dirección" @@ -5684,7 +5755,7 @@ msgstr "Transformada wavelet en alguna dirección" msgid "Whole area" msgstr "Área completa" -#: mgllab/mgllab.cpp:495 +#: mgllab/mgllab.cpp:488 msgid "Widget scheme" msgstr "Esquema del widget" @@ -5696,7 +5767,7 @@ msgstr "Ancho" msgid "Width of selected cells" msgstr "Ancho de las celdas seleccionadas" -#: src/data.cpp:1490 +#: src/data.cpp:1559 #, c-format msgid "" "Widths are:\n" @@ -5717,7 +5788,7 @@ msgstr "Gráfica de cables o grilla" msgid "Wire style" msgstr "Estilo de alambre" -#: src/exec_set.cpp:856 +#: src/exec_set.cpp:865 msgid "Write current image to graphical file" msgstr "Guardar imagen actual a archivo gráfico" @@ -5961,7 +6032,7 @@ msgstr "Debe especificar dirección(es)" msgid "You should put text inside ' ' for argument " msgstr "Debe poner el texto entre ' para el argumento " -#: udav/anim_dlg.cpp:106 +#: udav/anim_dlg.cpp:105 msgid "You should select one of case" msgstr "Debe seleccionar uno de los casos" @@ -6001,7 +6072,7 @@ msgstr "Tamaño z" msgid "Z-slice from" msgstr "Sección z para" -#: src/exec_set.cpp:862 +#: src/exec_set.cpp:871 msgid "Zoom axis range" msgstr "Rango de zoom para eje" @@ -6022,7 +6093,7 @@ msgstr "Magnificar" msgid "Zoom in graphics." msgstr "Magnificar gráfica." -#: widgets/fltk.cpp:869 +#: widgets/fltk.cpp:875 msgid "Zoom in selected region of the picture" msgstr "Magnificar región seleccionada de la imagen" @@ -6031,7 +6102,7 @@ msgstr "Magnificar región seleccionada de la imagen" msgid "Zoom in text" msgstr "Magnificar texto" -#: widgets/fltk.cpp:899 +#: widgets/fltk.cpp:905 msgid "Zoom in the picture" msgstr "Magnificar la imagen" @@ -6047,11 +6118,11 @@ msgstr "Reducir gráfica." msgid "Zoom out text" msgstr "Reducir texto" -#: widgets/fltk.cpp:901 +#: widgets/fltk.cpp:907 msgid "Zoom out the picture" msgstr "Reducir la imagen" -#: src/exec_set.cpp:861 +#: src/exec_set.cpp:870 msgid "Zoom plot region" msgstr "Escalar región de gráfica" @@ -6122,7 +6193,7 @@ msgid "attach light" msgstr "vincular luz" #. mglWarnFmt -#: src/base.cpp:244 +#: src/base.cpp:255 msgid "axis ranges are incompatible" msgstr "rangos de ejes incompletos" @@ -6157,13 +6228,13 @@ msgstr "c - cian" msgid "center" msgstr "centro" -#: widgets/fltk.cpp:794 +#: widgets/fltk.cpp:800 #, c-format msgid "click at %g, %g, %g" msgstr "clic en %g, %g, %g" #. mglWarnCnt -#: src/base.cpp:240 +#: src/base.cpp:251 msgid "couldn't open file" msgstr "no se pudo abrir archivo" @@ -6176,17 +6247,17 @@ msgid "cutting" msgstr "cortado" #. ----------------------------------------------------------------------------- -#: src/base.cpp:231 +#: src/base.cpp:242 msgid "data dimension(s) is incompatible" msgstr "dimensión(es) de datos incompatible(s)" #. mglWarnDim -#: src/base.cpp:232 +#: src/base.cpp:243 msgid "data dimension(s) is too small" msgstr "dimensión(es) de datos muy pequeña(s)" #. mglWarnMem -#: src/base.cpp:236 +#: src/base.cpp:247 msgid "data values are zero" msgstr "valores nulos" @@ -6218,11 +6289,11 @@ msgid "factor" msgstr "factor" #. mglWarnSize -#: src/base.cpp:243 +#: src/base.cpp:254 msgid "format is not supported for that build" msgstr "formato no soportado" -#: src/canvas.cpp:33 +#: src/canvas.cpp:31 msgid "frame" msgstr "cuadro" @@ -6248,7 +6319,7 @@ msgstr "escala de grises" msgid "h - gray" msgstr "h - gris" -#: src/parser.cpp:1067 +#: src/parser.cpp:1076 #, c-format msgid "in line %ld" msgstr "en línea %ld" @@ -6284,7 +6355,7 @@ msgid "left" msgstr "izquierda" #. mglWarnOpen -#: src/base.cpp:241 +#: src/base.cpp:252 msgid "light: ID is out of range" msgstr "luz: ID fuera de rango" @@ -6342,7 +6413,7 @@ msgstr "" "mglconv convierte scripts MGL a archivos de imagen (PNG por defecto).\n" "La version actual es 2.%g\n" -#: mgllab/mgllab.cpp:431 +#: mgllab/mgllab.cpp:422 #, c-format msgid "" "mgllab draw mgl script interactively.\n" @@ -6376,7 +6447,7 @@ msgid "min" msgstr "min" #. mglWarnLow -#: src/base.cpp:233 +#: src/base.cpp:244 msgid "minimal data value is negative" msgstr "valor minimal de datos es negativo" @@ -6390,12 +6461,12 @@ msgid "name" msgstr "nombre" #. mglWarnNeg -#: src/base.cpp:234 +#: src/base.cpp:245 msgid "no file or wrong data dimensions" msgstr "archivo no existe o las dimensiones de datos son incorrectas" #. mglWarnZero -#: src/base.cpp:237 +#: src/base.cpp:248 msgid "no legend entries" msgstr "leyenda vacia" @@ -6417,12 +6488,12 @@ msgid "none or default" msgstr "ninguno o por defecto" #. mglWarnFile -#: src/base.cpp:235 +#: src/base.cpp:246 msgid "not enough memory" msgstr "no hay suficiente memoria" #. mglWarnNull -#: src/base.cpp:246 +#: src/base.cpp:257 msgid "not enough space for plot" msgstr "no hay suficiente espacio para gráfica" @@ -6431,7 +6502,7 @@ msgid "not used" msgstr "no usado" #. mglWarnSlc -#: src/base.cpp:239 +#: src/base.cpp:250 msgid "number of contours is zero or negative" msgstr "número de curvas de nivel es cero o negativo" @@ -6462,7 +6533,7 @@ msgid "plain" msgstr "plano" #. mglWarnTern -#: src/base.cpp:245 +#: src/base.cpp:256 msgid "pointer is NULL" msgstr "puntero es NULL" @@ -6517,12 +6588,12 @@ msgid "save slides" msgstr "guardar cuadros" #. mglWarnLId -#: src/base.cpp:242 +#: src/base.cpp:253 msgid "size(s) is zero or negative" msgstr "tamaño(s) nulo(s) o negativo(s)" #. mglWarnLeg -#: src/base.cpp:238 +#: src/base.cpp:249 msgid "slice value is out of range" msgstr "valor de sección fuera de rango" @@ -6568,7 +6639,7 @@ msgstr "escala" msgid "to" msgstr "hacia" -#: mgllab/mgllab.cpp:579 +#: mgllab/mgllab.cpp:574 msgid "to script" msgstr "al script" @@ -6631,6 +6702,12 @@ msgstr "con paso" msgid "y - yellow" msgstr "y - amarillo" +#~ msgid "Insert file content?" +#~ msgstr "¿Insertar contenido de archivo?" + +#~ msgid "Insert file name?" +#~ msgstr "¿Insertar nombre de archivo?" + #~ msgid "" #~ "You may quickly draw the data from file. Just use: udav 'filename.dat' in " #~ "command line." diff --git a/mathgl_ru.po b/mathgl_ru.po index 5b65448..87a4e73 100644 --- a/mathgl_ru.po +++ b/mathgl_ru.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: MathGL2 2.4.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-07-06 19:59+0300\n" +"POT-Creation-Date: 2021-12-03 16:47+0300\n" "PO-Revision-Date: 2017-04-19 01:17+0300\n" "Last-Translator: Alexey Balakin \n" "Language-Team: Russian\n" @@ -18,7 +18,7 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -#: mgllab/mgllab.cpp:433 +#: mgllab/mgllab.cpp:424 #, c-format msgid "" "\t-1 str set str as argument $1 for script\n" @@ -104,7 +104,7 @@ msgstr "" "(c) Алексей Балакин, 2007\n" "http://mathgl.sourceforge.net/" -#: src/parser.cpp:1066 +#: src/parser.cpp:1075 #, c-format msgid "" "\n" @@ -113,7 +113,7 @@ msgstr "" "\n" "Попытка изменить временные данные в строке %ld" -#: src/parser.cpp:1064 +#: src/parser.cpp:1073 #, c-format msgid "" "\n" @@ -122,7 +122,7 @@ msgstr "" "\n" "Строковый аргумент слишком длинный в строке %ld" -#: src/parser.cpp:1065 +#: src/parser.cpp:1074 #, c-format msgid "" "\n" @@ -131,7 +131,7 @@ msgstr "" "\n" "Лишняя кавычка ' в строке %ld" -#: src/parser.cpp:1062 +#: src/parser.cpp:1071 #, c-format msgid "" "\n" @@ -140,7 +140,7 @@ msgstr "" "\n" "Неправильные аргументы в строке %ld" -#: src/parser.cpp:1063 +#: src/parser.cpp:1072 #, c-format msgid "" "\n" @@ -184,7 +184,7 @@ msgstr " Новый" msgid " Save" msgstr " Сохранить" -#: mgllab/mgllab.cpp:242 +#: mgllab/mgllab.cpp:233 msgid " Yes " msgstr "Да" @@ -444,43 +444,43 @@ msgstr "'|' штрихи" msgid "'~' waves" msgstr "'~' волны" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "0 - special plot" msgstr "0 - специальные графики" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "1 - other plot" msgstr "1 - прочие графики" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "10 - dd plot" msgstr "10 - двойный графики" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "11 - vector plot" msgstr "11 - векторные графики" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "12 - axis" msgstr "12 - оси координат" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "13 - primitives" msgstr "13 - примитивы" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "14 - axis setup" msgstr "14 - настройка осей" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "15 - text/legend" msgstr "15 - текст/легенда" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "16 - data transform" msgstr "16 - преобразования данных" -#: udav/info_dlg.cpp:47 +#: udav/info_dlg.cpp:49 msgid "1D plot" msgstr "1D график" @@ -492,11 +492,11 @@ msgstr "1D графики" msgid "1D view" msgstr "1D вид" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "2 - setup" msgstr "2 - настройки" -#: udav/info_dlg.cpp:47 +#: udav/info_dlg.cpp:49 msgid "2D plot" msgstr "2D график" @@ -508,7 +508,7 @@ msgstr "2D графики" msgid "2D view" msgstr "2D вид" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "3 - data handle" msgstr "3 - изменение данных" @@ -524,27 +524,27 @@ msgstr "3D графики" msgid "3D view" msgstr "3D вид" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "4 - data create" msgstr "4 - создание данных" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "5 - subplot" msgstr "5 - картинка в картинке" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "6 - program flow" msgstr "6 - команды управления" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "7 - 1d plot" msgstr "7 - 1D графики" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "8 - 2d plot" msgstr "8 - 2D графики" -#: src/parser.cpp:51 +#: src/parser.cpp:53 msgid "9 - 3d plot" msgstr "9 - 3D графики" @@ -560,7 +560,7 @@ msgstr "" msgid "@<- Prev" msgstr "@<- Пред." -#: widgets/qt.cpp:1294 udav/udav_wnd.cpp:331 mgllab/mgllab.cpp:347 +#: widgets/qt.cpp:1294 udav/udav_wnd.cpp:331 mgllab/mgllab.cpp:338 msgid "About" msgstr "О программе" @@ -590,7 +590,7 @@ msgstr "Добавить кривую" msgid "Add curve which properties can be changed later by mouse." msgstr "Добавить кривую. Ее свойства можно изменить позже мышью." -#: src/exec_dat.cpp:1666 +#: src/exec_dat.cpp:1728 msgid "Add data or number" msgstr "Прибавить массив или число" @@ -606,7 +606,7 @@ msgstr "Добавить эллипс. Его свойства можно изм msgid "Add inplot" msgstr "Добавить под-график" -#: src/exec_set.cpp:792 +#: src/exec_set.cpp:800 msgid "Add legend entry" msgstr "Добавить запись легенды" @@ -666,7 +666,7 @@ msgstr "Добавить текст" msgid "Add text which properties can be changed later by mouse." msgstr "Добавить текст. Его свойства можно изменить позже мышью." -#: src/exec_prm.cpp:658 +#: src/exec_prm.cpp:662 msgid "Add title for current subplot/inplot" msgstr "Добавить заголовок к текущему под-графику" @@ -674,19 +674,19 @@ msgstr "Добавить заголовок к текущему под-граф msgid "Add to" msgstr "Добавить к" -#: src/exec_set.cpp:793 +#: src/exec_set.cpp:801 msgid "Add user-defined symbol" msgstr "Добавить пользовательский символ" -#: widgets/fltk.cpp:877 +#: widgets/fltk.cpp:883 msgid "Adjust picture size to fill drawing area" msgstr "Подогнать размер картинки под область окна" -#: widgets/fltk.cpp:840 widgets/qt.cpp:1156 udav/plot_pnl.cpp:337 +#: widgets/fltk.cpp:846 widgets/qt.cpp:1156 udav/plot_pnl.cpp:337 msgid "Adjust size" msgstr "Подогнать размер" -#: src/exec_set.cpp:794 +#: src/exec_set.cpp:802 msgid "Adjust ticks for best view" msgstr "Подобрать метки осей для лучшего вида" @@ -787,7 +787,7 @@ msgstr "Соотношение сторон по y и z" msgid "Aspect x/z" msgstr "Стороны x/z" -#: src/exec_set.cpp:800 +#: src/exec_set.cpp:808 msgid "Attach light settings to inplot" msgstr "Привязать настройки света к под-графику" @@ -811,7 +811,7 @@ msgstr "Выполнить скрипт после загрузки" msgid "Automatically save before redrawing (F5)" msgstr "Сохранять скрипт перед рисованием (F5)" -#: src/data.cpp:1488 +#: src/data.cpp:1557 #, c-format msgid "" "Averages are:\n" @@ -847,12 +847,12 @@ msgstr "B - темно-синий" msgid "Backward" msgstr "Назад" -#: src/font.cpp:1021 +#: src/font.cpp:1005 #, c-format msgid "Bad '%ls' at %zu\n" msgstr "Неправильный '%ls' при %zu\n" -#: src/parser.cpp:769 +#: src/parser.cpp:778 #, c-format msgid "Bad arguments for %ls: %ld instead of %d\n" msgstr "Неправильные аргументы для %ls: %ld вместо %d\n" @@ -869,7 +869,7 @@ msgstr "Базовые" msgid "Begin" msgstr "Начало" -#: src/parser.cpp:1483 +#: src/parser.cpp:1492 msgid "Begin of do-while loop" msgstr "Начало цикла do-while" @@ -897,7 +897,7 @@ msgstr "Оба поля в yrange должны быть заполнены" msgid "Both fields in zrange must be filled" msgstr "Оба поля в zrange должны быть заполнены" -#: src/parser.cpp:1480 +#: src/parser.cpp:1489 msgid "Break for-loop" msgstr "Прервать выполнение цикла for" @@ -932,8 +932,8 @@ msgstr "Вычисления" #. TODO #. connect(hidden,SIGNAL(cursorPositionChanged()),this,SLOT(hiddenClicked())); -#: udav/udav_wnd.cpp:194 udav/udav_wnd.cpp:206 mgllab/mgllab.cpp:341 -#: mgllab/mgllab.cpp:572 +#: udav/udav_wnd.cpp:194 udav/udav_wnd.cpp:206 mgllab/mgllab.cpp:332 +#: mgllab/mgllab.cpp:567 msgid "Calculator" msgstr "Калькулятор" @@ -942,20 +942,20 @@ msgstr "Калькулятор" #: udav/dat_pnl.cpp:510 udav/dat_pnl.cpp:552 udav/dat_pnl.cpp:629 #: udav/opt_dlg.cpp:78 udav/setup_dlg.cpp:145 udav/files_dlg.cpp:58 #: udav/style_dlg.cpp:206 udav/data_dlg.cpp:90 udav/subplot_dlg.cpp:219 -#: mgllab/editor.cpp:282 mgllab/mathgl.cpp:166 mgllab/mathgl.cpp:197 +#: mgllab/editor.cpp:286 mgllab/mathgl.cpp:166 mgllab/mathgl.cpp:197 #: mgllab/dialogs.cpp:120 mgllab/dialogs.cpp:164 mgllab/dialogs.cpp:410 #: mgllab/dialogs.cpp:584 mgllab/dialogs.cpp:749 mgllab/dialogs.cpp:1071 -#: mgllab/dialogs.cpp:1318 mgllab/dialogs.cpp:1473 mgllab/mgllab.cpp:497 +#: mgllab/dialogs.cpp:1318 mgllab/dialogs.cpp:1473 mgllab/mgllab.cpp:490 #: mgllab/table.cpp:101 mgllab/table.cpp:179 mgllab/table.cpp:353 #: mgllab/table.cpp:556 mgllab/table.cpp:619 mgllab/table.cpp:675 msgid "Cancel" msgstr "Отмена" -#: src/crust.cpp:589 +#: src/crust.cpp:588 msgid "Cannot triangulate this set!" msgstr "Не могу построить триангуляцию!" -#: udav/udav_wnd.cpp:226 mgllab/mgllab.cpp:370 mgllab/mgllab.cpp:371 +#: udav/udav_wnd.cpp:226 mgllab/mgllab.cpp:361 mgllab/mgllab.cpp:362 msgid "Canvas" msgstr "График" @@ -976,7 +976,7 @@ msgstr "Изменить размер данных" msgid "Change canvas size to fill whole region (F6)." msgstr "Подогнать размер рисунка под размер окна (F6)." -#: src/exec_set.cpp:804 +#: src/exec_set.cpp:812 msgid "Change current directory" msgstr "Сменить директорию" @@ -996,7 +996,7 @@ msgstr "Изменить данные и закрыть окно" msgid "Change font" msgstr "Изменить шрифт" -#: src/exec_set.cpp:855 +#: src/exec_set.cpp:864 msgid "Change view angles - use 'rotate' for plot rotation" msgstr "Изменяет углы обзора, а не поворот как 'rotate'" @@ -1008,17 +1008,17 @@ msgstr "Очистить" msgid "Clear all" msgstr "Удалить все" -#: src/exec_set.cpp:805 +#: src/exec_set.cpp:813 msgid "Clear legend entries" msgstr "Удалить записи легенды" -#: src/exec_set.cpp:806 +#: src/exec_set.cpp:814 msgid "Clear picture" msgstr "Очистить рисунок" #. o = new Fl_Button(180, 130, 25, 25);o->image(img_save); o->tooltip("img_save"); -#: widgets/fltk.cpp:1106 widgets/qt.cpp:1108 udav/find_dlg.cpp:52 -#: udav/hint_dlg.cpp:52 mgllab/editor.cpp:566 mgllab/help.cpp:289 +#: widgets/fltk.cpp:1118 widgets/qt.cpp:1108 udav/find_dlg.cpp:52 +#: udav/hint_dlg.cpp:52 mgllab/editor.cpp:570 mgllab/help.cpp:289 #: mgllab/help.cpp:349 mgllab/help.cpp:465 msgid "Close" msgstr "Закрыть" @@ -1066,7 +1066,7 @@ msgstr "" msgid "Column expr" msgstr "" -#: mgllab/dialogs.cpp:724 mgllab/mgllab.cpp:320 +#: mgllab/dialogs.cpp:724 mgllab/mgllab.cpp:311 msgid "Command" msgstr "Команда" @@ -1090,27 +1090,27 @@ msgstr "Опции команды" msgid "Comments" msgstr "Комментарий" -#: src/exec_prm.cpp:646 +#: src/exec_prm.cpp:650 msgid "Computes the attractor of an IFS" msgstr "Вычисляет точки фрактала IFS" -#: src/exec_prm.cpp:647 +#: src/exec_prm.cpp:651 msgid "Computes the attractor of an IFS for 3d case" msgstr "Вычисляет точки фрактала IFS в 3d случае" -#: src/exec_prm.cpp:648 +#: src/exec_prm.cpp:652 msgid "Computes the attractor of an IFS with parameters from *.ifs file" msgstr "Вычисляет точки фрактала IFS с параметрами из файла" -#: src/exec_prm.cpp:642 +#: src/exec_prm.cpp:646 msgid "Computes the flame fractal" msgstr "Вычисляет точки фрактала flame" -#: src/parser.cpp:1499 +#: src/parser.cpp:1508 msgid "Condition of do-while loop" msgstr "Условие do-while цикла" -#: src/parser.cpp:1489 src/parser.cpp:1493 +#: src/parser.cpp:1498 src/parser.cpp:1502 msgid "Conditional operator" msgstr "Условный оператор" @@ -1126,11 +1126,11 @@ msgstr "Копировать координаты последнего нажа msgid "Copy data" msgstr "Копировать данные" -#: src/exec_dat.cpp:1674 +#: src/exec_dat.cpp:1736 msgid "Copy data from another variable" msgstr "Копировать данные из другой переменной" -#: widgets/fltk.cpp:837 +#: widgets/fltk.cpp:843 msgid "Copy graphics" msgstr "Копировать рисунок" @@ -1138,7 +1138,7 @@ msgstr "Копировать рисунок" msgid "Copy graphics to clipboard (Ctrl+Shift+G)." msgstr "Копировать рисунок в буфер обмена (Ctrl+Shift+G)." -#: widgets/fltk.cpp:881 +#: widgets/fltk.cpp:887 msgid "Copy image to clipboard" msgstr "Копировать рисунок в буфер обмена" @@ -1154,11 +1154,11 @@ msgstr "Копировать диапазон чисел в буфер обме msgid "Copy selected text or data to clipboard (Ctrl+C)." msgstr "Копировать выделенный текст или данные в буфер обмена (Ctrl+C)." -#: mgllab/editor.cpp:512 +#: mgllab/editor.cpp:516 msgid "Copy selection to clipboard" msgstr "Копировать выделение в буфер обмена" -#: udav/text_pnl.cpp:533 mgllab/mgllab.cpp:310 +#: udav/text_pnl.cpp:533 mgllab/mgllab.cpp:301 msgid "Copy text" msgstr "Копировать текст" @@ -1170,7 +1170,7 @@ msgstr "Косинус-Фурье" msgid "Cos-Fourier transform along direction(s)" msgstr "Косинус-Фурье преобразование вдоль направления(й)" -#: src/exec_dat.cpp:1676 +#: src/exec_dat.cpp:1738 msgid "Cos-Fourier transform at some direction" msgstr "Косинус-Фурье преобразование вдоль направления" @@ -1207,7 +1207,7 @@ msgstr "Создание данных и I/O" msgid "Create data and IO" msgstr "Создание данных и ввод-вывод" -#: src/exec_dat.cpp:1702 +#: src/exec_dat.cpp:1765 msgid "Create histogram (distribution) of data values" msgstr "Создать гистограмму (распределение) значений данных" @@ -1215,11 +1215,11 @@ msgstr "Создать гистограмму (распределение) зн msgid "Create new" msgstr "Создать новый" -#: src/exec_dat.cpp:1762 +#: src/exec_dat.cpp:1828 msgid "Create new 1D data and fill it in range" msgstr "Создать новые 1d данные и заполнить их в диапазоне" -#: src/exec_dat.cpp:1717 +#: src/exec_dat.cpp:1782 msgid "Create new data" msgstr "Создать новый массив данных" @@ -1235,7 +1235,7 @@ msgstr "Создать новый массив данных, заполненн msgid "Create new empty script window (Ctrl+N)." msgstr "Создать новое окно скрипта (Ctrl+N)." -#: src/parser.cpp:1494 +#: src/parser.cpp:1503 msgid "Creates new variable from list of numbers or data" msgstr "Создать новый массив из списка значений или данных" @@ -1251,7 +1251,7 @@ msgstr "Обрезать края массива данных" msgid "Crop data" msgstr "Обрезать данные" -#: src/exec_dat.cpp:1677 +#: src/exec_dat.cpp:1739 msgid "Crop edge of data" msgstr "Обрезать края массива данных" @@ -1264,7 +1264,7 @@ msgstr "" msgid "CumSum" msgstr "" -#: src/exec_dat.cpp:1678 +#: src/exec_dat.cpp:1740 msgid "Cumulative summation along direction(s)" msgstr "Накопительное суммирование данных по направлению" @@ -1280,7 +1280,7 @@ msgstr "Текущий шрифт" msgid "Cut selected text to clipboard (Ctrl+X)." msgstr "Вырезать выбранный текст в буфер обмена (Ctrl+X)." -#: udav/text_pnl.cpp:528 mgllab/mgllab.cpp:309 +#: udav/text_pnl.cpp:528 mgllab/mgllab.cpp:300 msgid "Cut text" msgstr "Вырезать текст" @@ -1332,11 +1332,12 @@ msgstr "Информация и просмотр данных." msgid "Data name" msgstr "Имя данных" -#: udav/info_dlg.cpp:42 +#. mgl->autoResize = true; // TODO: something strange here !!! +#: udav/info_dlg.cpp:43 msgid "Data preview" msgstr "Просмотр данных" -#: udav/info_dlg.cpp:43 +#: udav/info_dlg.cpp:44 msgid "Data preview for current slice." msgstr "Просмотр текущего среза данных." @@ -1356,19 +1357,19 @@ msgstr "Уменьшить угол θ на 10 градусов." msgid "Decrease font size" msgstr "Уменьшить размер шрифта" -#: src/parser.cpp:1485 +#: src/parser.cpp:1494 msgid "Define constant or parameter" msgstr "Определит постоянную или параметр" -#: src/parser.cpp:1484 +#: src/parser.cpp:1493 msgid "Define parameter as character" msgstr "Определить параметр как символ" -#: src/parser.cpp:1486 +#: src/parser.cpp:1495 msgid "Define parameter as numerical value" msgstr "Определить параметр как значение выражения" -#: src/parser.cpp:1479 +#: src/parser.cpp:1488 msgid "Define parameter from user input" msgstr "Определить параметр по вводу пользователя" @@ -1388,7 +1389,7 @@ msgstr "Удалить @b все@. массивы данных." msgid "Delete ALL data arrays" msgstr "Удалить ВСЕ массивы данных" -#: src/exec_dat.cpp:1681 +#: src/exec_dat.cpp:1743 msgid "Delete data or slice of data" msgstr "Удалить данные или их срез" @@ -1412,7 +1413,7 @@ msgstr "Удалить выбранный график" msgid "Description" msgstr "Описание" -#: src/exec_dat.cpp:1682 +#: src/exec_dat.cpp:1744 msgid "Detect curves for maximums of data array" msgstr "Найти кривые по максимумам массива данных" @@ -1428,11 +1429,11 @@ msgstr "Дифференцировать данные по направлени msgid "Diffuse" msgstr "Расс.свет" -#: src/exec_dat.cpp:1686 +#: src/exec_dat.cpp:1748 msgid "Dilate data larger val" msgstr "Расширить данные большие val" -#: src/exec_dat.cpp:1671 +#: src/exec_dat.cpp:1733 msgid "Direct multiplication of arrays" msgstr "Прямое произведение массивов" @@ -1453,7 +1454,7 @@ msgstr "Расстояние между ячейками" msgid "Divide by" msgstr "Разделить на" -#: src/exec_dat.cpp:1687 +#: src/exec_dat.cpp:1749 msgid "Divide by data or number" msgstr "Разделить данные поэлементно на массив или число" @@ -1461,11 +1462,11 @@ msgstr "Разделить данные поэлементно на массив msgid "Do" msgstr "OK" -#: src/exec_dat.cpp:1751 +#: src/exec_dat.cpp:1817 msgid "Do STFA transform" msgstr "Выполнить преобразование STFA" -#: src/exec_dat.cpp:1757 src/exec_dat.cpp:1758 +#: src/exec_dat.cpp:1823 src/exec_dat.cpp:1824 msgid "Do integral transform of data" msgstr "Выполнить интегральное преобразование данных" @@ -1482,7 +1483,7 @@ msgstr "Вы хотите удалить все данные?" msgid "Do you want to save the changes to the document?" msgstr "Вы хотите сохранить изменения в документе?" -#: mgllab/editor.cpp:282 +#: mgllab/editor.cpp:286 msgid "Don't Save" msgstr "Не сохранять" @@ -1490,439 +1491,449 @@ msgstr "Не сохранять" msgid "Double diff." msgstr "Вторая производная" -#: src/exec_gr.cpp:1141 +#: src/exec_gr.cpp:1213 msgid "Draw Bifurcation diagram" msgstr "Нарисовать бифуркационную диаграмму" -#: src/exec_gr.cpp:1177 +#: src/exec_gr.cpp:1250 msgid "Draw Iris plots" msgstr "Нарисовать график Iris" -#: src/exec_gr.cpp:1179 +#: src/exec_gr.cpp:1252 msgid "Draw Lamerey diagram" msgstr "Нарисовать диаграмму Ламерея" -#: src/exec_gr.cpp:1183 +#: src/exec_gr.cpp:1257 msgid "Draw Open-High-Low-Close (OHLC) diagram" msgstr "Нарисовать диаграмму OHLC (Open-High-Low-Close)" -#: src/exec_gr.cpp:1186 +#: src/exec_gr.cpp:1260 msgid "Draw Poincare map" msgstr "Нарисовать диаграмму Пуанкаре" -#: src/exec_gr.cpp:1192 +#: src/exec_gr.cpp:1266 msgid "Draw STFA diagram" msgstr "Нарисовать диаграмму STFA" -#: src/exec_gr.cpp:1204 +#: src/exec_gr.cpp:1278 msgid "Draw TeX mark at point position" msgstr "Нарисовать ТеХ символы в положении точек" -#: src/exec_prm.cpp:624 +#: src/exec_prm.cpp:628 msgid "Draw angle arc" msgstr "Нарисовать дугу" -#: src/exec_gr.cpp:1134 +#: src/exec_gr.cpp:1206 msgid "Draw area plot for 1D data" msgstr "Закрасить область между кривой и осью" -#: src/exec_gr.cpp:1137 +#: src/exec_gr.cpp:1209 msgid "Draw bars for 1D data" msgstr "Нарисовать график из вертикальных полос" -#: src/exec_gr.cpp:1139 +#: src/exec_gr.cpp:1211 msgid "Draw belts" msgstr "Нарисовать поверхность ленточками" -#: src/exec_gr.cpp:1140 +#: src/exec_gr.cpp:1212 msgid "Draw belts colored by other data" msgstr "Нарисовать поверхность ленточками с заданным цветом" -#: src/exec_gr.cpp:1202 +#: src/exec_gr.cpp:1276 msgid "Draw binormales for 1D data" msgstr "Нарисовать нормаль и бинормаль для кривой" -#: src/exec_prm.cpp:651 +#: src/exec_prm.cpp:655 msgid "Draw bitmap (logo) along axis range" msgstr "Нарисовать растр (логотип) в области осей координат" -#: src/exec_prm.cpp:628 +#: src/exec_prm.cpp:632 msgid "Draw bounding box" msgstr "Нарисовать ограничивающий параллелепипед" -#: src/exec_gr.cpp:1143 +#: src/exec_gr.cpp:1215 msgid "Draw boxes" msgstr "Нарисовать поверхность ящиками" -#: src/exec_gr.cpp:1142 +#: src/exec_gr.cpp:1214 msgid "Draw boxplot for 2D data" msgstr "Нарисовать box-and-whisker диаграмму" -#: src/exec_gr.cpp:1144 +#: src/exec_gr.cpp:1216 msgid "Draw candlestick chart" msgstr "Нарисовать свечной график" -#: src/exec_gr.cpp:1145 +#: src/exec_gr.cpp:1217 msgid "Draw chart" msgstr "Нарисовать линейчатую (круговую) диаграмму" -#: src/exec_prm.cpp:629 +#: src/exec_prm.cpp:633 msgid "Draw circle" msgstr "Нарисовать окружность (круг)" -#: src/exec_gr.cpp:1146 +#: src/exec_gr.cpp:1218 msgid "Draw cloud" msgstr "Нарисовать облако для 3D данных" -#: src/exec_prm.cpp:631 +#: src/exec_prm.cpp:635 msgid "Draw colorbar" msgstr "Нарисовать цветовую шкалу" -#: src/exec_prm.cpp:632 +#: src/exec_prm.cpp:636 msgid "Draw cone" msgstr "Нарисовать конус" -#: src/exec_gr.cpp:1147 +#: src/exec_gr.cpp:1219 msgid "Draw cones for 1D data" msgstr "Нарисовать конусы для 1D данных" -#: src/exec_gr.cpp:1148 +#: src/exec_gr.cpp:1220 msgid "Draw contour lines" msgstr "Нарисовать линии уровня" -#: src/exec_gr.cpp:1158 +#: src/exec_gr.cpp:1230 msgid "Draw contour lines at x-slice (or x-plane)" msgstr "Нарисовать линии уровня на x-срезе" -#: src/exec_gr.cpp:1159 +#: src/exec_gr.cpp:1231 msgid "Draw contour lines at y-slice (or y-plane)" msgstr "Нарисовать линии уровня на y-срезе" -#: src/exec_gr.cpp:1160 +#: src/exec_gr.cpp:1232 msgid "Draw contour lines at z-slice (or z-plane)" msgstr "Нарисовать линии уровня на z-срезе" -#: src/exec_gr.cpp:1149 +#: src/exec_gr.cpp:1221 msgid "Draw contour lines for 3D data" msgstr "Нарисовать линии уровня на срезах 3D данных" -#: src/exec_gr.cpp:1209 +#: src/exec_gr.cpp:1283 msgid "Draw contour lines for surface of triangles" msgstr "Нарисовать линии уровня для поверхности из треугольников" -#: src/exec_gr.cpp:1156 +#: src/exec_gr.cpp:1228 msgid "Draw contour lines on parametric surface" msgstr "Нарисовать линии уровня на параметрической поверхности" -#: src/exec_gr.cpp:1157 +#: src/exec_gr.cpp:1229 msgid "Draw contour tubes" msgstr "Нарисовать цилиндры по линиям уровней" -#: src/exec_gr.cpp:1210 +#: src/exec_gr.cpp:1284 msgid "Draw contour tubes for surface of triangles" msgstr "Нарисовать цилиндры по линиям уровней для поверхности из треугольников" -#: src/exec_prm.cpp:633 +#: src/exec_prm.cpp:637 msgid "Draw curve" msgstr "Нарисовать кривую" -#: src/exec_gr.cpp:1212 +#: src/exec_gr.cpp:1286 msgid "Draw curve by tube" msgstr "Нарисовать трубу около кривой" -#: src/exec_gr.cpp:1162 +#: src/exec_gr.cpp:1234 +#, fuzzy +msgid "Draw curves of cross-section of isosurfaces a,b for 3D data" +msgstr "Нарисовать поверхность постоянного уровня" + +#: src/exec_gr.cpp:1235 msgid "Draw density plot" msgstr "Нарисовать график плотности" -#: src/exec_gr.cpp:1163 +#: src/exec_gr.cpp:1236 msgid "Draw density plot at slices of 3D data" msgstr "Нарисовать график плотности на срезе 3D данных" -#: src/exec_gr.cpp:1164 +#: src/exec_gr.cpp:1237 msgid "Draw density plot at x-slice (or x-plane)" msgstr "Нарисовать график плотности на x-срезе" -#: src/exec_gr.cpp:1165 +#: src/exec_gr.cpp:1238 msgid "Draw density plot at y-slice (or y-plane)" msgstr "Нарисовать график плотности на y-срезе" -#: src/exec_gr.cpp:1166 +#: src/exec_gr.cpp:1239 msgid "Draw density plot at z-slice (or z-plane)" msgstr "Нарисовать график плотности на z-срезе" -#: src/exec_gr.cpp:1167 +#: src/exec_gr.cpp:1240 msgid "Draw dew plot" msgstr "Нарисовать векторное поле каплями" -#: src/exec_gr.cpp:1168 +#: src/exec_gr.cpp:1241 msgid "Draw dots for arbitrary data points" msgstr "Нарисовать набор точек" -#: src/exec_prm.cpp:634 +#: src/exec_prm.cpp:638 msgid "Draw drop" msgstr "Нарисовать каплю" -#: src/exec_prm.cpp:635 +#: src/exec_prm.cpp:639 msgid "Draw ellipse" msgstr "Нарисовать эллипс" -#: src/exec_prm.cpp:636 +#: src/exec_prm.cpp:640 msgid "Draw error box" msgstr "Нарисовать размер ошибки" -#: src/exec_gr.cpp:1169 +#: src/exec_gr.cpp:1242 msgid "Draw error boxes" msgstr "Нарисовать размеры ошибок для 1D данных" -#: src/exec_prm.cpp:637 +#: src/exec_prm.cpp:641 msgid "Draw face (quadrangle)" msgstr "Нарисовать грань (четырехугольник)" -#: src/exec_prm.cpp:638 +#: src/exec_prm.cpp:642 msgid "Draw face perpendicular to x-axis" msgstr "Нарисовать грань поперек оси x" -#: src/exec_prm.cpp:639 +#: src/exec_prm.cpp:643 msgid "Draw face perpendicular to y-axis" msgstr "Нарисовать грань поперек оси y" -#: src/exec_prm.cpp:640 +#: src/exec_prm.cpp:644 msgid "Draw face perpendicular to z-axis" msgstr "Нарисовать грань поперек оси z" -#: src/exec_gr.cpp:1189 +#: src/exec_gr.cpp:1263 msgid "Draw filled region (ribbon) between 2 curves" msgstr "Закрасить область между двумя кривыми" -#: src/exec_gr.cpp:1184 +#: src/exec_gr.cpp:1258 msgid "Draw flow pipes for vector field" msgstr "Нарисовать трубки тока для векторного поля" -#: src/exec_gr.cpp:1171 +#: src/exec_gr.cpp:1244 msgid "Draw flow threads for vector field" msgstr "Нарисовать линии тока для векторного поля" -#: src/exec_gr.cpp:1173 +#: src/exec_gr.cpp:1246 msgid "Draw flow threads from plain for vector field" msgstr "Нарисовать линии тока для векторного поля, начинающиеся с плоскости" -#: src/exec_gr.cpp:1174 +#: src/exec_gr.cpp:1247 msgid "Draw gradient lines for scalar field" msgstr "Нарисовать линии градиента для скалярного поля" -#: src/exec_prm.cpp:645 +#: src/exec_prm.cpp:649 msgid "Draw grid" msgstr "Нарисовать сетку осей координат" -#: src/exec_gr.cpp:1176 +#: src/exec_gr.cpp:1249 msgid "Draw grid at slices of 3D data" msgstr "Нарисовать сетку на срезе 3D данных" -#: src/exec_gr.cpp:1175 +#: src/exec_gr.cpp:1248 msgid "Draw grid for data array(s)" msgstr "Нарисовать сетку для массива" -#: src/exec_gr.cpp:1136 +#: src/exec_gr.cpp:1208 msgid "Draw horizontal bars for 1D data" msgstr "Нарисовать график из горизонтальных полос" -#: src/exec_gr.cpp:1205 +#: src/exec_gr.cpp:1279 msgid "Draw horizontal tiles" msgstr "Нарисовать поверхность горизонтальными плитками" -#: src/exec_gr.cpp:1206 +#: src/exec_gr.cpp:1280 msgid "Draw horizontal tiles with variable size" msgstr "Нарисовать поверхность плитками переменного размера" -#: src/exec_gr.cpp:1194 +#: src/exec_gr.cpp:1268 msgid "Draw isosurface for 3D data" msgstr "Нарисовать поверхность постоянного уровня" -#: src/exec_gr.cpp:1197 +#: src/exec_gr.cpp:1271 msgid "Draw isosurface for 3D data colored and transpared by other data" msgstr "Нарисовать поверхность уровня с заданными цветом и прозрачностью" -#: src/exec_gr.cpp:1196 +#: src/exec_gr.cpp:1270 msgid "Draw isosurface for 3D data colored by other data" msgstr "Нарисовать поверхность уровня с заданным цветом" -#: src/exec_gr.cpp:1195 +#: src/exec_gr.cpp:1269 msgid "Draw isosurface for 3D data transpared by other data" msgstr "Нарисовать поверхность уровня с заданной прозрачностью" -#: src/exec_gr.cpp:1178 +#: src/exec_gr.cpp:1251 msgid "Draw label at arbitrary position" msgstr "Вывести надписи для 1D данных" -#: src/exec_prm.cpp:630 +#: src/exec_prm.cpp:634 msgid "Draw label for colorbar" msgstr "Вывести подпись colorbar" -#: src/exec_prm.cpp:659 +#: src/exec_prm.cpp:663 msgid "Draw label for t-axis" msgstr "Вывести подпись оси t" -#: src/exec_prm.cpp:660 +#: src/exec_prm.cpp:664 msgid "Draw label for x-axis" msgstr "Вывести подпись оси x" -#: src/exec_prm.cpp:661 +#: src/exec_prm.cpp:665 msgid "Draw label for y-axis" msgstr "Вывести подпись оси y" -#: src/exec_prm.cpp:662 +#: src/exec_prm.cpp:666 msgid "Draw label for z-axis" msgstr "Вывести подпись оси z" -#: src/exec_prm.cpp:649 +#: src/exec_prm.cpp:653 msgid "Draw legend" msgstr "Нарисовать легенду графика" -#: src/exec_prm.cpp:650 +#: src/exec_prm.cpp:654 msgid "Draw line" msgstr "Нарисовать прямую линию" -#: src/exec_gr.cpp:1180 +#: src/exec_gr.cpp:1253 +#, fuzzy +msgid "Draw lines with arrows for 1D data" +msgstr "Нарисовать график из вертикальных полос" + +#: src/exec_gr.cpp:1254 msgid "Draw mapping plot" msgstr "Нарисовать отображение матрицы" -#: src/exec_gr.cpp:1181 +#: src/exec_gr.cpp:1255 msgid "Draw mark plot for 1D data" msgstr "Нарисовать маркеры переменного размера" -#: src/exec_gr.cpp:1182 +#: src/exec_gr.cpp:1256 msgid "Draw mesh surface" msgstr "Нарисовать сетчатую поверхность" -#: src/exec_prm.cpp:627 +#: src/exec_prm.cpp:631 msgid "Draw point (ball)" msgstr "Нарисовать точку" -#: src/exec_prm.cpp:652 +#: src/exec_prm.cpp:656 msgid "Draw polygon" msgstr "Нарисовать полигон" -#: src/exec_gr.cpp:1138 +#: src/exec_gr.cpp:1210 msgid "Draw quasi-optical beam" msgstr "Нарисовать квазиоптический пучок" -#: src/exec_gr.cpp:1188 +#: src/exec_gr.cpp:1262 msgid "Draw radar chart" msgstr "Нарисовать круговой график" -#: src/exec_gr.cpp:1161 +#: src/exec_gr.cpp:1233 msgid "Draw reconstructed surface for arbitrary data points" msgstr "Нарисовать поверхность по произвольным точкам" -#: src/exec_prm.cpp:653 +#: src/exec_prm.cpp:657 msgid "Draw rectangle" msgstr "Нарисовать прямоугольник" -#: src/exec_prm.cpp:654 +#: src/exec_prm.cpp:658 msgid "Draw rhombus" msgstr "Нарисовать ромб" -#: src/exec_gr.cpp:1153 +#: src/exec_gr.cpp:1225 msgid "Draw solid contour lines at x-slice (or x-plane)" msgstr "Закрасить линии уровня на x-срезе" -#: src/exec_gr.cpp:1154 +#: src/exec_gr.cpp:1226 msgid "Draw solid contour lines at y-slice (or y-plane)" msgstr "Закрасить линии уровня на y-срезе" -#: src/exec_gr.cpp:1155 +#: src/exec_gr.cpp:1227 msgid "Draw solid contour lines at z-slice (or z-plane)" msgstr "Закрасить линии уровня на z-срезе" -#: src/exec_gr.cpp:1152 +#: src/exec_gr.cpp:1224 msgid "Draw solid contour lines for 3D data" msgstr "Закрасить линии уровня на 3D данных" -#: src/exec_gr.cpp:1151 +#: src/exec_gr.cpp:1223 msgid "Draw solid contours" msgstr "Закрасить линии уровня" -#: src/exec_gr.cpp:1150 +#: src/exec_gr.cpp:1222 msgid "Draw solid contours with manual colors" msgstr "Закрасить линии уровня заданными цветами" -#: src/exec_gr.cpp:1193 +#: src/exec_gr.cpp:1267 msgid "Draw solid surface" msgstr "Нарисовать поверхность" -#: src/exec_gr.cpp:1200 +#: src/exec_gr.cpp:1274 msgid "Draw solid surface colored and transpared by other data" msgstr "Нарисовать поверхность с заданными цветом и прозрачностью" -#: src/exec_gr.cpp:1199 +#: src/exec_gr.cpp:1273 msgid "Draw solid surface colored by other data" msgstr "Нарисовать поверхность с заданным цветом" -#: src/exec_gr.cpp:1198 +#: src/exec_gr.cpp:1272 msgid "Draw solid surface transpared by other data" msgstr "Нарисовать поверхность с заданной прозрачностью" -#: src/exec_prm.cpp:655 +#: src/exec_prm.cpp:659 msgid "Draw sphere" msgstr "Нарисовать сферу" -#: src/exec_gr.cpp:1190 +#: src/exec_gr.cpp:1264 msgid "Draw stem plot for 1D data" msgstr "Нарисовать линии от 1D данных до оси" -#: src/exec_gr.cpp:1191 +#: src/exec_gr.cpp:1265 msgid "Draw step plot for 1D data" msgstr "Нарисовать ступеньки" -#: src/exec_gr.cpp:1207 +#: src/exec_gr.cpp:1281 msgid "Draw surface of curve rotation" msgstr "Нарисовать поверхность вращения" -#: src/exec_gr.cpp:1187 +#: src/exec_gr.cpp:1261 msgid "Draw surface of quadrangles" msgstr "Нарисовать поверхность из четырехугольников" -#: src/exec_gr.cpp:1211 +#: src/exec_gr.cpp:1285 msgid "Draw surface of triangles" msgstr "Нарисовать поверхность из треугольников" -#: src/exec_gr.cpp:1135 +#: src/exec_gr.cpp:1207 msgid "Draw surfaces of contour lines rotation" msgstr "Нарисовать поверхность вращения линий уровня" -#: src/exec_gr.cpp:1201 +#: src/exec_gr.cpp:1275 msgid "Draw table with data values" msgstr "Нарисовать таблицу значений данных" -#: src/exec_gr.cpp:1203 +#: src/exec_gr.cpp:1277 msgid "Draw tension plot for 1D data" msgstr "Нарисовать кривую с заданным цветом" -#: src/exec_prm.cpp:657 +#: src/exec_prm.cpp:661 msgid "Draw text at some position or along curve" msgstr "Вывести текст в точке или вдоль кривой" -#: src/exec_prm.cpp:656 +#: src/exec_prm.cpp:660 msgid "Draw user-defined symbol at given position and direction" msgstr "Нарисовать символ в заданных точке и направлении" -#: src/exec_gr.cpp:1185 +#: src/exec_gr.cpp:1259 msgid "Draw usual plot for 1D data" msgstr "Нарисовать кривую для 1D данных" -#: src/exec_gr.cpp:1213 +#: src/exec_gr.cpp:1287 msgid "Draw vector field" msgstr "Нарисовать векторное поле" -#: src/exec_gr.cpp:1214 +#: src/exec_gr.cpp:1288 msgid "Draw vector field at slices of 3D data" msgstr "Нарисовать векторное поле на срезах 3D данных" -#: src/exec_gr.cpp:1208 +#: src/exec_gr.cpp:1282 msgid "Draw vectors along a curve" msgstr "Нарисовать вектора вдоль кривой" -#: src/exec_gr.cpp:1170 +#: src/exec_gr.cpp:1243 msgid "Draw waterfalls" msgstr "Нарисовать поверхность набором линий (водопад)" @@ -1943,7 +1954,7 @@ msgstr "E - темно-салатовый" msgid "Edges" msgstr "Края" -#: udav/text_pnl.cpp:84 mgllab/mgllab.cpp:307 +#: udav/text_pnl.cpp:84 mgllab/mgllab.cpp:298 msgid "Edit" msgstr "Правка" @@ -1955,13 +1966,13 @@ msgstr "Редактировать выбранный массив данных" msgid "Elliptic" msgstr "Эллиптические" -#: udav/prop_dlg.cpp:171 mgllab/mgllab.cpp:489 +#: udav/prop_dlg.cpp:171 mgllab/mgllab.cpp:481 msgid "Enable keywords completion" msgstr "Разрешить дополнение команд" #. pure = new QCheckBox(_("Disable face drawing (faster) for mouse rotation/shift/zoom."), this); #. pure->setChecked(mglAutoPure); v->addWidget(pure); pure->setEnabled(false); -#: udav/prop_dlg.cpp:169 mgllab/mgllab.cpp:491 +#: udav/prop_dlg.cpp:169 mgllab/mgllab.cpp:483 msgid "Enable mouse wheel for zooming" msgstr "Колесо мыши приближает график" @@ -2062,11 +2073,11 @@ msgstr "Введите значение аргумента %s" msgid "Envelop" msgstr "Огибающая" -#: src/exec_dat.cpp:1690 +#: src/exec_dat.cpp:1752 msgid "Erode data larger val" msgstr "Сузить данные большие val" -#: mgllab/editor.cpp:348 +#: mgllab/editor.cpp:352 #, c-format msgid "" "Error reading from file '%s':\n" @@ -2080,7 +2091,7 @@ msgstr "" msgid "Error to call external viewer\n" msgstr "Ошибка вызова внешнего просмотра\n" -#: mgllab/editor.cpp:359 +#: mgllab/editor.cpp:363 #, c-format msgid "" "Error writing to file '%s':\n" @@ -2089,17 +2100,17 @@ msgstr "" "Ошибка записи в файл '%s':\n" "%s." -#: src/exec_dat.cpp:1691 +#: src/exec_dat.cpp:1753 msgid "" "Evaluate (interpolate) values of array Dat at points i=idat,j=jdat,k=kdat" msgstr "Интерполирует значения в точках i=idat,j=jdat,k=kdat" #. {"defpal",_("Define parameter as palette color"),"defpal $N val", 0, 6}, -#: src/parser.cpp:1488 +#: src/parser.cpp:1497 msgid "Execute if condition is false" msgstr "Выполнить если условие ложно" -#: mgllab/mgllab.cpp:487 +#: mgllab/mgllab.cpp:479 msgid "Execute script after loading" msgstr "Выполнить скрипт после загрузки" @@ -2107,7 +2118,7 @@ msgstr "Выполнить скрипт после загрузки" msgid "Execute script and redraw graphics (F5)." msgstr "Выполнить скрипт и обновить рисунок (F5)." -#: src/parser.cpp:1481 +#: src/parser.cpp:1490 msgid "Execute script in external file" msgstr "Выполнить скрипт из внешнего файла" @@ -2115,7 +2126,7 @@ msgstr "Выполнить скрипт из внешнего файла" msgid "Existing data arrays" msgstr "Массивы данных" -#: mgllab/mgllab.cpp:305 +#: mgllab/mgllab.cpp:296 msgid "Exit" msgstr "Выход" @@ -2131,7 +2142,7 @@ msgstr "Exp-интегралы" msgid "Export Data?" msgstr "Экспорт данных?" -#: widgets/fltk.cpp:815 +#: widgets/fltk.cpp:821 msgid "Export as ..." msgstr "Экспорт как ..." @@ -2143,7 +2154,7 @@ msgstr "Экспорт как 2D ..." msgid "Export as 3D ..." msgstr "Экспорт как 3D ..." -#: src/exec_dat.cpp:1692 mgllab/table.cpp:846 +#: src/exec_dat.cpp:1754 mgllab/table.cpp:846 msgid "Export data to PNG file" msgstr "Экспорт данных в PNG файл" @@ -2156,7 +2167,7 @@ msgstr "Экспорт в GIF" msgid "Export to PNG" msgstr "Экспорт в PNG" -#: src/exec_dat.cpp:1693 +#: src/exec_dat.cpp:1755 msgid "Extend data array" msgstr "Расширить массив данных" @@ -2164,11 +2175,11 @@ msgstr "Расширить массив данных" msgid "Extract data" msgstr "Выделить данные" -#: src/exec_dat.cpp:1752 +#: src/exec_dat.cpp:1818 msgid "Extract sub-array" msgstr "Выделить под-массив" -#: src/exec_dat.cpp:1744 +#: src/exec_dat.cpp:1810 msgid "Extract sub-array between values" msgstr "Выделить под-массив в диапазоне между значениями" @@ -2178,7 +2189,7 @@ msgstr "Фактор" #. file menu #: widgets/qt.cpp:1083 udav/udav_wnd.cpp:281 udav/dat_pnl.cpp:681 -#: mgllab/mgllab.cpp:292 mgllab/table.cpp:750 +#: mgllab/mgllab.cpp:283 mgllab/table.cpp:750 msgid "File" msgstr "Файл" @@ -2186,7 +2197,7 @@ msgstr "Файл" msgid "File %1 saved" msgstr "Файл %1 сохранен." -#: mgllab/mgllab.cpp:242 +#: mgllab/mgllab.cpp:233 msgid "File exist. Overwrite it?" msgstr "Файл существует. Переписать?" @@ -2194,7 +2205,7 @@ msgstr "Файл существует. Переписать?" msgid "File name" msgstr "Имя файла" -#: mgllab/mgllab.cpp:318 +#: mgllab/mgllab.cpp:309 msgid "File path" msgstr "Путь к файлу" @@ -2202,7 +2213,7 @@ msgstr "Путь к файлу" msgid "File to export" msgstr "Экспорт в файл" -#: mgllab/editor.cpp:267 mgllab/mgllab.cpp:412 +#: mgllab/editor.cpp:271 mgllab/mgllab.cpp:403 msgid "File/Recent files" msgstr "Файл/Последние файлы" @@ -2214,19 +2225,19 @@ msgstr "Заполнить" msgid "Fill data by formula" msgstr "Заполнить по формуле" -#: src/exec_dat.cpp:1700 +#: src/exec_dat.cpp:1763 msgid "Fill data by global spline of Vdat" msgstr "Заполнить данные по глобальному сплайну Vdat" -#: src/exec_dat.cpp:1736 +#: src/exec_dat.cpp:1802 msgid "Fill data by interpolation of Vdat" msgstr "Заполнить данные интерполяцией Vdat" -#: src/exec_dat.cpp:1679 +#: src/exec_dat.cpp:1741 msgid "Fill data by triangulated values" msgstr "Заполнить данные триангуляцией" -#: src/exec_dat.cpp:1695 +#: src/exec_dat.cpp:1757 msgid "Fill data linearly in range [v1, v2]" msgstr "Заполнить данные линейно в диапазоне [v1, v2]" @@ -2234,19 +2245,57 @@ msgstr "Заполнить данные линейно в диапазоне [v1 msgid "Fill in range" msgstr "Заполнить в диапазоне" -#: src/exec_dat.cpp:1696 +#: src/exec_dat.cpp:1758 msgid "Fill x-,k-samples for transforms" msgstr "Заполнить как x-,k-координаты для трансформации" -#: udav/find_dlg.cpp:48 mgllab/editor.cpp:560 +#: src/random.cpp:350 +msgid "Fills by fractional brownian motion" +msgstr "Заполнить броуновским движением" + +#: src/random.cpp:356 +msgid "Fills by random integers uniformly chosen in [lo, hi)" +msgstr "Заполнить случайными целыми числами в интервале [lo, hi)" + +#: src/random.cpp:348 +msgid "" +"Fills by random numbers according to Bernoulli distribution with probability " +"p" +msgstr "Заполнить случайными числами с распределением Бернулли" + +#: src/random.cpp:353 +msgid "Fills by random numbers according to Gaussian distribution" +msgstr "Заполнить случайными числами с гауссовым распределением" + +#: src/random.cpp:349 +msgid "" +"Fills by random numbers according to binomial distribution in n coin flips " +"with probability p" +msgstr "Заполнить случайными числами с биномиальным распределением" + +#: src/random.cpp:351 +msgid "Fills by random numbers according to discrete distribution" +msgstr "Заполнить случайными числами с дискретным распределением" + +#: src/random.cpp:352 +msgid "" +"Fills by random numbers according to exponential distribution with " +"probability p" +msgstr "Заполнить случайными числами с экспоненциальным распределением" + +#: src/random.cpp:355 +msgid "Fills by random numbers uniformly chosen in [lo,hi)" +msgstr "Заполнить случайными числами в интервале [lo, hi)" + +#: udav/find_dlg.cpp:48 mgllab/editor.cpp:564 msgid "Find" msgstr "Найти" -#: src/exec_dat.cpp:1675 +#: src/exec_dat.cpp:1737 msgid "Find correlation between data arrays" msgstr "Найти корреляцию между данными" -#: src/exec_dat.cpp:1689 +#: src/exec_dat.cpp:1751 msgid "Find envelop for the data" msgstr "Найти огибающую данных" @@ -2254,55 +2303,65 @@ msgstr "Найти огибающую данных" msgid "Find envelope along direction(s)" msgstr "Найти огибающую в направлении" +#: src/exec_dat.cpp:1759 +#, fuzzy +msgid "Find first indexes of values larger val over direction" +msgstr "Найти минимум по направлению" + #: udav/dat_pnl.cpp:804 msgid "Find histogram of data." msgstr "Найти гистограмму данных" -#: src/exec_dat.cpp:1711 +#: src/exec_dat.cpp:1773 +#, fuzzy +msgid "Find last indexes of values larger val over direction" +msgstr "Найти максимум по направлению" + +#: src/exec_dat.cpp:1776 msgid "Find maximal value over direction" msgstr "Найти максимум по направлению" -#: src/exec_dat.cpp:1712 +#: src/exec_dat.cpp:1777 msgid "Find minimal value over direction" msgstr "Найти минимум по направлению" -#: udav/text_pnl.cpp:551 mgllab/mgllab.cpp:316 +#: udav/text_pnl.cpp:551 mgllab/mgllab.cpp:307 msgid "Find next" msgstr "Найти следующее" -#: mgllab/editor.cpp:516 +#: mgllab/editor.cpp:520 msgid "Find or replace text" msgstr "Найти или заменить" -#: src/exec_dat.cpp:1748 +#: src/exec_dat.cpp:1814 msgid "Find root Dat[i,j,k]=val (inverse evaluate)" msgstr "Найти корень Dat[i,j,k]=val (обратно evaluate)" -#: src/exec_dat.cpp:1740 +#: src/exec_dat.cpp:1806 msgid "Find roots using data as initial values" msgstr "Найти корни используя данные как начальные условия" -#: src/exec_dat.cpp:1754 +#: src/exec_dat.cpp:1820 msgid "Find summation over direction" msgstr "Найти сумму по направлению" -#: src/exec_dat.cpp:1760 +#: src/exec_dat.cpp:1826 msgid "Find triangles of randomly placed points" msgstr "Триангулировать произвольно расположенные точки" -#: udav/find_dlg.cpp:36 mgllab/editor.cpp:559 +#: udav/find_dlg.cpp:36 mgllab/editor.cpp:563 msgid "Find what:" msgstr "Найти что:" -#: udav/text_pnl.cpp:546 mgllab/editor.cpp:558 +#: udav/text_pnl.cpp:546 mgllab/editor.cpp:562 msgid "Find/Replace" msgstr "Найти/Заменить" -#: mgllab/mgllab.cpp:315 +#: mgllab/mgllab.cpp:306 msgid "Find|Replace" msgstr "Найти|Заменить" -#: src/parser.cpp:1490 +#: src/parser.cpp:1499 msgid "Finish if/else block" msgstr "Окончание блока if/else" @@ -2314,11 +2373,11 @@ msgstr "Первая ячейка" msgid "First slice" msgstr "Первый срез" -#: src/exec_dat.cpp:1697 src/exec_dat.cpp:1698 +#: src/exec_dat.cpp:1760 src/exec_dat.cpp:1761 msgid "Fit data to formula" msgstr "Подогнать данные по формуле" -#: udav/text_pnl.cpp:567 mgllab/mgllab.cpp:322 +#: udav/text_pnl.cpp:567 mgllab/mgllab.cpp:313 msgid "Fitted formula" msgstr "Подобранная формула" @@ -2334,11 +2393,11 @@ msgstr "Туман" msgid "Fog dist." msgstr "глубина" -#: mgllab/mgllab.cpp:548 +#: mgllab/mgllab.cpp:543 msgid "Folder for help files" msgstr "Папка для файлов справки" -#: udav/text_pnl.cpp:587 mgllab/mgllab.cpp:319 +#: udav/text_pnl.cpp:587 mgllab/mgllab.cpp:310 msgid "Folder path" msgstr "Путь к папке" @@ -2346,7 +2405,7 @@ msgstr "Путь к папке" msgid "Font" msgstr "Шрифт" -#: mgllab/mgllab.cpp:539 +#: mgllab/mgllab.cpp:534 msgid "Font file name" msgstr "Имя файла шрифта" @@ -2354,11 +2413,11 @@ msgstr "Имя файла шрифта" msgid "Font files (*.vfm)" msgstr "Файлы шрифтов (*.vfm)" -#: mgllab/mgllab.cpp:478 +#: mgllab/mgllab.cpp:470 msgid "Font kind" msgstr "Шрифт" -#: mgllab/mgllab.cpp:480 +#: mgllab/mgllab.cpp:472 msgid "Font size" msgstr "Размер" @@ -2370,7 +2429,7 @@ msgstr "Шрифт" msgid "FontSize" msgstr "Размер" -#: src/parser.cpp:1491 +#: src/parser.cpp:1500 msgid "For loop" msgstr "Цикл for" @@ -2387,7 +2446,7 @@ msgstr "Кадр %1 из %2" msgid "From" msgstr "от" -#: mgllab/mgllab.cpp:607 +#: mgllab/mgllab.cpp:602 msgid "Function" msgstr "Функция" @@ -2405,44 +2464,46 @@ msgstr "GIF поддержка отключена. Включите ее и пе msgid "General setup" msgstr "Общие настройки" -#: src/exec_dat.cpp:1708 +#: src/exec_dat.cpp:1771 msgid "Get Jacobian" msgstr "Вычислить якобиан" -#: src/exec_dat.cpp:1673 +#: src/exec_dat.cpp:1735 msgid "Get contour lines for dat[i,j]=val, separated by NAN" msgstr "Найти координаты линий уровня dat[i,j]=val, разделенных NAN" -#: src/exec_dat.cpp:1670 +#: src/exec_dat.cpp:1732 msgid "Get data column filled by formula on column ids" msgstr "Вычислить данные по формуле из имен колонок" -#: src/exec_dat.cpp:1743 +#: src/exec_dat.cpp:1809 msgid "Get formated data from file" msgstr "Загрузить форматированные данные из файла" -#: src/exec_dat.cpp:1672 +#: src/exec_dat.cpp:1734 msgid "" "Get indexes or resort data for found connected surfaces dependent on j,k" -msgstr "Найти индексы или пересортировать данные для поиска связанных поверхностей, зависящих от j,k" +msgstr "" +"Найти индексы или пересортировать данные для поиска связанных поверхностей, " +"зависящих от j,k" -#: src/exec_dat.cpp:1715 +#: src/exec_dat.cpp:1780 msgid "Get momentum along direction" msgstr "Вычислить момент по направлению" -#: src/exec_dat.cpp:1694 +#: src/exec_dat.cpp:1756 msgid "Get positions of local maximums and minimums" msgstr "Найти положение локальных максимумов и минимумов" -#: src/exec_dat.cpp:1725 +#: src/exec_dat.cpp:1790 msgid "Get pulse properties" msgstr "Найти параметры импульса" -#: src/exec_dat.cpp:1756 +#: src/exec_dat.cpp:1822 msgid "Get trace of array" msgstr "Найти след матрицы" -#: src/base_cf.cpp:85 +#: src/base_cf.cpp:86 #, c-format msgid "Global message - %s\n" msgstr "Общее сообщение - %s\n" @@ -2472,7 +2533,7 @@ msgid "Go to the specified slice for 3D data." msgstr "Перейти к указанному срезу 3D данных" #: widgets/qt.cpp:1112 widgets/qt.cpp:1114 udav/plot_pnl.cpp:66 -#: mgllab/mgllab.cpp:334 +#: mgllab/mgllab.cpp:325 msgid "Graphics" msgstr "Графика" @@ -2480,157 +2541,148 @@ msgstr "Графика" msgid "Graphics setup" msgstr "Настройка графика" -#: widgets/fltk.cpp:964 +#: widgets/fltk.cpp:970 msgid "Graphics/Adjust size" msgstr "Графика/Подогнать размер" -#. /< Parameter for handling animation -#. /< Callback function for next frame -#. /< Callback function for prev frame -#. /< Callback function for delay -#. /< Callback function for reloading -#. / Toggle transparency (alpha) button -#: widgets/fltk.cpp:958 include/mgl2/Fl_MathGL.h:164 +#. ----------------------------------------------------------------------------- +#: widgets/fltk.cpp:964 widgets/fltk.cpp:1094 msgid "Graphics/Alpha" msgstr "Графика/Прозрачность" -#: widgets/fltk.cpp:993 +#: widgets/fltk.cpp:999 msgid "Graphics/Animation/Next frame" msgstr "Графика/Анимация/Следующий" -#: widgets/fltk.cpp:994 +#: widgets/fltk.cpp:1000 msgid "Graphics/Animation/Prev frame" msgstr "Графика/Анимация/Предыдущий" -#: mgllab/mgllab.cpp:386 +#: mgllab/mgllab.cpp:377 msgid "Graphics/Animation/Setup animation" msgstr "Графика/Анимация/Настройка" -#. / Toggle slideshow button -#: widgets/fltk.cpp:992 include/mgl2/Fl_MathGL.h:168 +#: widgets/fltk.cpp:998 widgets/fltk.cpp:1096 msgid "Graphics/Animation/Slideshow" msgstr "Графика/Анимация/Запустить" -#: widgets/fltk.cpp:968 +#: widgets/fltk.cpp:974 msgid "Graphics/Copy click coor." msgstr "Графика/Копировать коор." -#: widgets/fltk.cpp:967 +#: widgets/fltk.cpp:973 msgid "Graphics/Copy graphics" msgstr "Графика/Копировать рисунок" -#: widgets/fltk.cpp:981 +#: widgets/fltk.cpp:987 msgid "Graphics/Export/as BMP" msgstr "Графика/Экспорт/как BMP" -#: widgets/fltk.cpp:979 +#: widgets/fltk.cpp:985 msgid "Graphics/Export/as GIF" msgstr "Графика/Экспорт/как GIF" -#: widgets/fltk.cpp:976 +#: widgets/fltk.cpp:982 msgid "Graphics/Export/as JPEG" msgstr "Графика/Экспорт/как JPEG" -#: widgets/fltk.cpp:987 +#: widgets/fltk.cpp:993 msgid "Graphics/Export/as OBJ" msgstr "Графика/Экспорт/как OBJ" -#: widgets/fltk.cpp:988 +#: widgets/fltk.cpp:994 msgid "Graphics/Export/as OFF" msgstr "Графика/Экспорт/как OFF" -#: widgets/fltk.cpp:972 +#: widgets/fltk.cpp:978 msgid "Graphics/Export/as PNG" msgstr "Графика/Экспорт/как PNG" -#: widgets/fltk.cpp:986 +#: widgets/fltk.cpp:992 msgid "Graphics/Export/as PRC" msgstr "Графика/Экспорт/как PRC" -#: widgets/fltk.cpp:989 +#: widgets/fltk.cpp:995 msgid "Graphics/Export/as STL" msgstr "Графика/Экспорт/как STL" -#: widgets/fltk.cpp:982 +#: widgets/fltk.cpp:988 msgid "Graphics/Export/as SVG" msgstr "Графика/Экспорт/как SVG" -#: widgets/fltk.cpp:985 +#: widgets/fltk.cpp:991 msgid "Graphics/Export/as TeX" msgstr "Графика/Экспорт/как TeX" -#: widgets/fltk.cpp:990 +#: widgets/fltk.cpp:996 msgid "Graphics/Export/as XYZ" msgstr "Графика/Экспорт/как XYZ" -#: widgets/fltk.cpp:984 +#: widgets/fltk.cpp:990 msgid "Graphics/Export/as bitmap EPS" msgstr "Графика/Экспорт/как растровый EPS" -#: widgets/fltk.cpp:973 +#: widgets/fltk.cpp:979 msgid "Graphics/Export/as solid PNG" msgstr "Графика/Экспорт/как PNG с заливкой" -#: widgets/fltk.cpp:983 +#: widgets/fltk.cpp:989 msgid "Graphics/Export/as vector EPS" msgstr "Графика/Экспорт/как EPS" -#. / Toggle grid drawing button -#: widgets/fltk.cpp:960 include/mgl2/Fl_MathGL.h:170 +#: widgets/fltk.cpp:966 widgets/fltk.cpp:1097 msgid "Graphics/Grid" msgstr "Графика/Сетка" -#. / Toggle lighting button -#: widgets/fltk.cpp:959 include/mgl2/Fl_MathGL.h:166 +#: widgets/fltk.cpp:965 widgets/fltk.cpp:1095 msgid "Graphics/Light" msgstr "Графика/Освещение" -#. / Toggle pause calculation button -#: widgets/fltk.cpp:969 include/mgl2/Fl_MathGL.h:182 mgllab/mgllab.cpp:387 +#: widgets/fltk.cpp:975 widgets/fltk.cpp:1098 mgllab/mgllab.cpp:378 msgid "Graphics/Pause calc" msgstr "Графика/Пауза расчета" -#: mgllab/mgllab.cpp:385 +#: mgllab/mgllab.cpp:376 msgid "Graphics/Primitive" msgstr "Графика/Примитивы" -#: widgets/fltk.cpp:963 +#: widgets/fltk.cpp:969 msgid "Graphics/Redraw" msgstr "Графика/Перерисовать" -#: widgets/fltk.cpp:965 +#: widgets/fltk.cpp:971 msgid "Graphics/Reload data" msgstr "Графика/Перезагрузить" -#: widgets/fltk.cpp:962 +#: widgets/fltk.cpp:968 msgid "Graphics/Restore" msgstr "Графика/Восстановить" -#: widgets/fltk.cpp:966 +#: widgets/fltk.cpp:972 msgid "Graphics/Stop" msgstr "Графика/Стоп" -#: widgets/fltk.cpp:1000 +#: widgets/fltk.cpp:1006 msgid "Graphics/Transform/Move down" msgstr "Графика/Сдвиг/Вниз" -#: widgets/fltk.cpp:996 +#: widgets/fltk.cpp:1002 msgid "Graphics/Transform/Move left" msgstr "Графика/Сдвиг/Влево" -#: widgets/fltk.cpp:1001 +#: widgets/fltk.cpp:1007 msgid "Graphics/Transform/Move right" msgstr "Графика/Сдвиг/Вправо" -#: widgets/fltk.cpp:997 +#: widgets/fltk.cpp:1003 msgid "Graphics/Transform/Move up" msgstr "Графика/Сдвиг/Вверх" -#: widgets/fltk.cpp:998 +#: widgets/fltk.cpp:1004 msgid "Graphics/Transform/Zoom in" msgstr "Графика/Сдвиг/Приблизить" -#: widgets/fltk.cpp:999 +#: widgets/fltk.cpp:1005 msgid "Graphics/Transform/Zoom out" msgstr "Графика/Сдвиг/Отдалить" @@ -2647,12 +2699,13 @@ msgstr "Группы команд MGL" msgid "H - darkgray" msgstr "H - темно-серый" -#: src/data_io.cpp:1092 +#: src/data_io.cpp:1204 msgid "HDF4 support was disabled. Please, enable it and rebuild MathGL." msgstr "HDF4 поддержка отключена. Включите ее и пересоберите MathGL." -#: src/complex_io.cpp:924 src/complex_io.cpp:926 src/data_io.cpp:1191 -#: src/data_io.cpp:1193 src/data_io.cpp:1195 src/data_io.cpp:1197 +#: src/complex_io.cpp:924 src/complex_io.cpp:926 src/data_io.cpp:1359 +#: src/data_io.cpp:1361 src/data_io.cpp:1363 src/data_io.cpp:1365 +#: src/data_io.cpp:1367 src/data_io.cpp:1369 src/data_io.cpp:1371 msgid "HDF5 support was disabled. Please, enable it and rebuild MathGL." msgstr "HDF5 поддержка отключена. Включите ее и пересоберите MathGL." @@ -2664,7 +2717,7 @@ msgstr "Ханкель" msgid "Hankel transform along direction(s)" msgstr "Преобразование Ханкеля по направлению(ям)" -#: src/exec_dat.cpp:1701 +#: src/exec_dat.cpp:1764 msgid "Hankel transform at some direction" msgstr "Преобразование Ханкеля по направлению" @@ -2673,8 +2726,8 @@ msgid "Height of selected cells" msgstr "Высота выбранных ячеек" #: widgets/qt.cpp:1293 udav/help_pnl.cpp:57 udav/udav_wnd.cpp:231 -#: udav/udav_wnd.cpp:323 mgllab/mgllab.cpp:344 mgllab/mgllab.cpp:345 -#: mgllab/mgllab.cpp:373 +#: udav/udav_wnd.cpp:323 mgllab/mgllab.cpp:335 mgllab/mgllab.cpp:336 +#: mgllab/mgllab.cpp:364 msgid "Help" msgstr "Справка" @@ -2686,7 +2739,7 @@ msgstr "" "Здесь можно задать опции команды, \n" "которые используются для доп.настройки графика." -#: udav/udav_wnd.cpp:186 mgllab/mgllab.cpp:313 +#: udav/udav_wnd.cpp:186 mgllab/mgllab.cpp:304 msgid "Hidden plots" msgstr "Скрытые графики" @@ -2698,11 +2751,11 @@ msgstr "Скрыть выделенное" msgid "Hide selected plots." msgstr "Скрыть выделенные графики" -#: udav/prop_dlg.cpp:173 mgllab/mgllab.cpp:490 +#: udav/prop_dlg.cpp:173 mgllab/mgllab.cpp:482 msgid "Highlight current object(s)" msgstr "Выделить текущие графики" -#: udav/udav_wnd.cpp:328 mgllab/mgllab.cpp:346 +#: udav/udav_wnd.cpp:328 mgllab/mgllab.cpp:337 msgid "Hints" msgstr "Подсказки" @@ -2722,7 +2775,7 @@ msgstr "Гиперболические" msgid "ID" msgstr "" -#: mgllab/mgllab.cpp:348 +#: mgllab/mgllab.cpp:339 msgid "Icon list" msgstr "Список иконок" @@ -2734,11 +2787,11 @@ msgstr "Номер среза в z-направлении" msgid "Image size" msgstr "Размер рисунка" -#: src/exec_dat.cpp:1724 +#: src/exec_dat.cpp:1789 msgid "Immediately display the progress of calculation" msgstr "Показать прогресс вычислений сразу" -#: src/exec_dat.cpp:1723 +#: src/exec_dat.cpp:1788 msgid "Immediately print the message" msgstr "Напечатать это сообщение сразу же" @@ -2746,7 +2799,7 @@ msgstr "Напечатать это сообщение сразу же" msgid "Import Data?" msgstr "Импортировать данные?" -#: src/exec_dat.cpp:1704 mgllab/table.cpp:842 +#: src/exec_dat.cpp:1767 mgllab/table.cpp:842 msgid "Import data from PNG file" msgstr "Импортировать данные из PNG файла" @@ -2758,7 +2811,7 @@ msgstr "Импортировать из PNG" msgid "In range" msgstr "В диапазоне" -#: src/exec_dat.cpp:1699 +#: src/exec_dat.cpp:1762 msgid "In-place Fourier transform" msgstr "Фурье преобразование по месту" @@ -2786,20 +2839,20 @@ msgstr "Увеличить размер шрифта" msgid "Info" msgstr "Инфо" -#: udav/info_dlg.cpp:55 mgllab/help.cpp:335 +#: udav/info_dlg.cpp:57 mgllab/help.cpp:335 msgid "Information" msgstr "Информация" -#: mgllab/mgllab.cpp:321 +#: mgllab/mgllab.cpp:312 msgid "Inplot" msgstr "Под-график" #. insert menu -#: udav/text_pnl.cpp:557 mgllab/mgllab.cpp:317 +#: udav/text_pnl.cpp:557 mgllab/mgllab.cpp:308 msgid "Insert" msgstr "Вставить" -#: mgllab/editor.cpp:519 +#: mgllab/editor.cpp:523 msgid "Insert MGL command" msgstr "Вставить команду MGL" @@ -2807,19 +2860,11 @@ msgstr "Вставить команду MGL" msgid "Insert as 'list'" msgstr "Вставить как 'list'" -#: mgllab/editor.cpp:487 -msgid "Insert file content?" -msgstr "Вставить содержимое файла?" - -#: mgllab/mgllab.cpp:158 -msgid "Insert file name?" -msgstr "Вставить имя файла?" - -#: mgllab/editor.cpp:521 +#: mgllab/editor.cpp:525 msgid "Insert filename" msgstr "Вставить имя файла" -#: mgllab/editor.cpp:523 +#: mgllab/editor.cpp:527 msgid "Insert inplot command" msgstr "Вставить под-график" @@ -2827,7 +2872,7 @@ msgstr "Вставить под-график" msgid "Insert last fitted formula with found coefficients." msgstr "Вставить последнюю подогнанную формулу с найденными коэффициентами" -#: src/exec_dat.cpp:1706 +#: src/exec_dat.cpp:1769 msgid "Insert slice of data" msgstr "Вставить срез данных" @@ -2839,7 +2884,7 @@ msgstr "Вставить в скрипт как команду 'list'" msgid "Integrate" msgstr "Интегрировать" -#: src/exec_dat.cpp:1707 udav/dat_pnl.cpp:615 +#: src/exec_dat.cpp:1770 udav/dat_pnl.cpp:615 msgid "Integrate data along direction(s)" msgstr "Интегрировать данные по направлению" @@ -2863,7 +2908,7 @@ msgstr "JPEG поддержка отключена. Включите ее и п msgid "Jacobi" msgstr "Якоби" -#: src/exec_dat.cpp:1709 +#: src/exec_dat.cpp:1772 msgid "Join data arrays" msgstr "Объединить массивы данных" @@ -2875,6 +2920,10 @@ msgstr "Оставьте пустым для добавления в начал msgid "Keep only each n-th element of the data array." msgstr "Сохранить каждый n-ый элемент массива данных" +#: src/exec_dat.cpp:1774 +msgid "Keep phase/amplitude along line" +msgstr "Сохраняет фазу/амплитуду вдоль линии" + #: mgllab/mathgl.cpp:200 msgid "Keep slides in memory (faster animation but require more memory)" msgstr "Хранить кадры в памяти (быстрее анимация, но требуется больше памяти)" @@ -2901,7 +2950,7 @@ msgstr "" " * Прочие -- числа (например, zval);\n" " * В скобках [] -- опциональные аргументы." -#: udav/info_dlg.cpp:50 +#: udav/info_dlg.cpp:52 msgid "Kind of plots: lines for 1D, density for 2D." msgstr "Тип графика: кривые для 1D, график плотности для 2D." @@ -2922,7 +2971,7 @@ msgstr "Надпись" msgid "Language for UDAV" msgstr "Язык для UDAV" -#: mgllab/mgllab.cpp:493 +#: mgllab/mgllab.cpp:486 msgid "Language for mgllab" msgstr "Язык для mgllab" @@ -2963,7 +3012,7 @@ msgstr "Положение источника света должно быть msgid "Light settings" msgstr "Настройки освещения" -#: src/exec_dat.cpp:1710 +#: src/exec_dat.cpp:1775 msgid "Limit data to be inside [-v,v]" msgstr "Ограничить данные диапазоном [-v,v]" @@ -2991,7 +3040,7 @@ msgstr "Список доступных данных." msgid "Load Data?" msgstr "Загрузить данные?" -#: src/exec_set.cpp:821 +#: src/exec_set.cpp:829 msgid "Load commands from external DLL" msgstr "Загрузить команды из внешней DLL" @@ -3011,7 +3060,7 @@ msgstr "" "Загрузить данные. Данные будут удалены только\n" "при выходе из программы без запроса на сохранение (Ctrl+Shift+O)." -#: src/exec_set.cpp:822 +#: src/exec_set.cpp:830 msgid "Load fontfaces" msgstr "Загрузить шрифт" @@ -3019,7 +3068,7 @@ msgstr "Загрузить шрифт" msgid "Load from file" msgstr "Загрузить из файла" -#: src/exec_prm.cpp:626 +#: src/exec_prm.cpp:630 msgid "Load image for background" msgstr "Загрузить фоновое изображение" @@ -3048,7 +3097,7 @@ msgstr "Нижняя граница для цвета или прозрачно msgid "M - purple" msgstr "M - пурпурный" -#: src/parser.cpp:1074 +#: src/parser.cpp:1083 msgid "MGL Parser" msgstr "MGL парсер" @@ -3056,11 +3105,11 @@ msgstr "MGL парсер" msgid "MGL commands for selected group" msgstr "Команда MGL для выбранной группы" -#: mgllab/mgllab.cpp:229 +#: mgllab/mgllab.cpp:220 msgid "MGL files \t*.mgl" msgstr "MGL файлы \t*.mgl" -#: mgllab/mgllab.cpp:182 +#: mgllab/mgllab.cpp:173 msgid "" "MGL files \t*.mgl\n" "DAT files \t*.{dat,csv}" @@ -3128,7 +3177,7 @@ msgstr "Штриховка вручную" msgid "Manual mask" msgstr "Маска вручную" -#: udav/text_pnl.cpp:591 mgllab/mgllab.cpp:323 +#: udav/text_pnl.cpp:591 mgllab/mgllab.cpp:314 msgid "Manual primitives" msgstr "Примитивы вручную" @@ -3156,7 +3205,7 @@ msgstr "Угол поворота маски" msgid "Mask size" msgstr "Размер маски" -#: udav/find_dlg.cpp:42 mgllab/editor.cpp:563 +#: udav/find_dlg.cpp:42 mgllab/editor.cpp:567 msgid "Match case" msgstr "Учитывать регистр" @@ -3164,7 +3213,7 @@ msgstr "Учитывать регистр" msgid "MathGL - about" msgstr "MathGL - о программе" -#: src/base.cpp:265 +#: src/base.cpp:276 #, c-format msgid "MathGL message - %s\n" msgstr "Сообщение MathGL - %s\n" @@ -3205,7 +3254,7 @@ msgstr "Максимум Y для обрезания или координат" msgid "Maximal value of Z for cutting or for coordinate filling" msgstr "Максимум Z для обрезания или координат" -#: src/data.cpp:1480 +#: src/data.cpp:1549 #, c-format msgid "Maximum is %g\t at x = %ld\ty = %ld\tz = %ld\n" msgstr "Максимум %g\t при x = %ld\ty = %ld\tz = %ld\n" @@ -3214,7 +3263,7 @@ msgstr "Максимум %g\t при x = %ld\ty = %ld\tz = %ld\n" msgid "Maximum of" msgstr "Максимум от" -#: udav/mem_pnl.cpp:68 udav/mem_pnl.cpp:73 mgllab/mgllab.cpp:375 +#: udav/mem_pnl.cpp:68 udav/mem_pnl.cpp:73 mgllab/mgllab.cpp:366 msgid "Memory" msgstr "Память" @@ -3226,7 +3275,7 @@ msgstr "Число линий" msgid "MeshNum" msgstr "Число линий" -#: mgllab/mgllab.cpp:342 +#: mgllab/mgllab.cpp:333 msgid "Messages" msgstr "Сообщения" @@ -3262,7 +3311,7 @@ msgstr "Минимум Y для обрезания или координат" msgid "Minimal value of Z for cutting or for coordinate filling" msgstr "Минимум Z для обрезания или координат" -#: src/data.cpp:1483 +#: src/data.cpp:1552 #, c-format msgid "Minimum is %g\t at x = %ld\ty = %ld\tz = %ld\n" msgstr "Минимум %g\t при x = %ld\ty = %ld\tz = %ld\n" @@ -3280,11 +3329,11 @@ msgstr "Отразить" msgid "Mirror data along direction(s)" msgstr "Отразить данные по направлению" -#: src/exec_dat.cpp:1713 +#: src/exec_dat.cpp:1778 msgid "Mirror data at some direction" msgstr "Отразить данные по направлению" -#: src/exec_dat.cpp:1714 +#: src/exec_dat.cpp:1779 msgid "Modify data values by formula" msgstr "Изменить данные по формуле" @@ -3356,7 +3405,7 @@ msgstr "Сдвиг вверх" msgid "Multiply by" msgstr "Умножить на" -#: src/exec_dat.cpp:1716 +#: src/exec_dat.cpp:1781 msgid "Multiply by data or number" msgstr "Умножить на массив данных или число" @@ -3407,7 +3456,7 @@ msgstr "Новый под-график" msgid "New order of dimensions" msgstr "Новый порядок размерностей" -#: udav/udav_wnd.cpp:282 mgllab/mgllab.cpp:293 +#: udav/udav_wnd.cpp:282 mgllab/mgllab.cpp:284 msgid "New script" msgstr "Новый скрипт" @@ -3439,7 +3488,7 @@ msgstr "Следующий срез" msgid "Next slide" msgstr "Следующий кадр" -#: mgllab/help.cpp:135 mgllab/mgllab.cpp:242 +#: mgllab/help.cpp:135 mgllab/mgllab.cpp:233 msgid "No" msgstr "Нет" @@ -3462,7 +3511,7 @@ msgstr "Не введено направление/формула" msgid "No filename." msgstr "Отсутствует имя файла." -#: mgllab/editor.cpp:585 mgllab/editor.cpp:607 mgllab/editor.cpp:632 +#: mgllab/editor.cpp:589 mgllab/editor.cpp:611 mgllab/editor.cpp:636 #, c-format msgid "No occurrences of '%s' found!" msgstr "Вхождения '%s' не найдены!" @@ -3479,7 +3528,7 @@ msgstr "Вхождения не найдены" msgid "No text rotation" msgstr "Не вращать текст" -#: widgets/fltk.cpp:838 +#: widgets/fltk.cpp:844 msgid "Normal view" msgstr "Обычный вид" @@ -3487,11 +3536,11 @@ msgstr "Обычный вид" msgid "Normalize" msgstr "Нормировать" -#: src/exec_dat.cpp:1718 +#: src/exec_dat.cpp:1783 msgid "Normalize data" msgstr "Нормировать данные" -#: src/exec_dat.cpp:1719 +#: src/exec_dat.cpp:1784 msgid "Normalize data slice by slice" msgstr "Нормировать данные по срезам" @@ -3519,11 +3568,11 @@ msgstr "Численный параметр" msgid "Numeric value" msgstr "Численное значение" -#: src/exec_dat.cpp:1683 +#: src/exec_dat.cpp:1745 msgid "Numerically differentiate data" msgstr "Численно дифференцировать данные" -#: src/exec_dat.cpp:1684 +#: src/exec_dat.cpp:1746 msgid "Numerically double differentiate data" msgstr "Численно дифференцировать данные дважды" @@ -3550,7 +3599,7 @@ msgstr "OBJ" #: udav/data_dlg.cpp:92 udav/subplot_dlg.cpp:221 mgllab/mathgl.cpp:198 #: mgllab/dialogs.cpp:121 mgllab/dialogs.cpp:165 mgllab/dialogs.cpp:411 #: mgllab/dialogs.cpp:585 mgllab/dialogs.cpp:750 mgllab/dialogs.cpp:1072 -#: mgllab/dialogs.cpp:1319 mgllab/dialogs.cpp:1474 mgllab/mgllab.cpp:498 +#: mgllab/dialogs.cpp:1319 mgllab/dialogs.cpp:1474 mgllab/mgllab.cpp:491 #: mgllab/table.cpp:621 msgid "OK" msgstr "OK" @@ -3559,11 +3608,11 @@ msgstr "OK" msgid "Only current slice will be inserted" msgstr "Только текущий срез будет вставлен" -#: mgllab/mgllab.cpp:181 +#: mgllab/mgllab.cpp:172 msgid "Open File?" msgstr "Открыть файл?" -#: src/exec_dat.cpp:1721 +#: src/exec_dat.cpp:1786 msgid "Open all data arrays from HDF file" msgstr "Загрузить все данные из HDF файла" @@ -3583,7 +3632,7 @@ msgstr "Открыть диалог создания новых данных." msgid "Open file" msgstr "Открыть файл" -#: mgllab/mgllab.cpp:294 +#: mgllab/mgllab.cpp:285 msgid "Open file ..." msgstr "Открыть файл ..." @@ -3591,7 +3640,7 @@ msgstr "Открыть файл ..." msgid "Open printer dialog and print graphics (Ctrl+P)" msgstr "Открыть диалог и напечатать график (CTRl+P)" -#: mgllab/editor.cpp:507 +#: mgllab/editor.cpp:511 msgid "Open script or data file" msgstr "Загрузить скрипт или файл данных" @@ -3612,7 +3661,7 @@ msgid "Operations" msgstr "Операции" #: udav/prop_dlg.cpp:91 udav/newcmd_dlg.cpp:72 mgllab/dialogs.cpp:746 -#: mgllab/mgllab.cpp:325 +#: mgllab/mgllab.cpp:316 msgid "Options" msgstr "Опции" @@ -3653,7 +3702,7 @@ msgstr "" msgid "PNG Files \t*.png" msgstr "PNG файлы \t*.png" -#: src/canvas_cf.cpp:495 src/canvas_cf.cpp:497 src/data_png.cpp:118 +#: src/canvas_cf.cpp:546 src/canvas_cf.cpp:548 src/data_png.cpp:118 #: src/export.cpp:75 src/export.cpp:109 msgid "PNG support was disabled. Please, enable it and rebuild MathGL." msgstr "PNG поддержка отключена. Включите ее и пересоберите MathGL." @@ -3678,11 +3727,11 @@ msgstr "Вставить данные" msgid "Paste range of numbers from clipboard (Ctrl+Shift+P)." msgstr "Вставить диапазон значений из буфера обмена (Ctrl+Shift+P)." -#: udav/text_pnl.cpp:538 mgllab/mgllab.cpp:311 +#: udav/text_pnl.cpp:538 mgllab/mgllab.cpp:302 msgid "Paste text" msgstr "Вставить текст" -#: mgllab/editor.cpp:514 +#: mgllab/editor.cpp:518 msgid "Paste text from clipboard" msgstr "Вставить текст из буфера обмена" @@ -3690,11 +3739,11 @@ msgstr "Вставить текст из буфера обмена" msgid "Paste text or data from clipboard (Ctrl+V)." msgstr "Вставить текст из буфера обмена (Ctrl+V)." -#: mgllab/mgllab.cpp:484 +#: mgllab/mgllab.cpp:476 msgid "Path for MathGL font (without extension)" msgstr "Путь к шрифтам MathGL (без расширения)" -#: udav/prop_dlg.cpp:110 mgllab/mgllab.cpp:481 +#: udav/prop_dlg.cpp:110 mgllab/mgllab.cpp:473 msgid "Path for help files" msgstr "Путь к файлам справки" @@ -3707,15 +3756,15 @@ msgid "Pause calculation" msgstr "Пауза вычислений" #. Wnd->connect(a, SIGNAL(triggered()), QMGL, SLOT(setPause())); -#: widgets/fltk.cpp:921 widgets/qt.cpp:1287 +#: widgets/fltk.cpp:927 widgets/qt.cpp:1287 msgid "Pause on/off external calculations" msgstr "Пауза вкл/выкл для внешних вычислений" -#: src/exec_dat.cpp:1738 +#: src/exec_dat.cpp:1804 msgid "Perform Runge-Kutta step" msgstr "Выполнить шаг Рунге-Кутта" -#: widgets/fltk.cpp:890 +#: widgets/fltk.cpp:896 msgid "Phi angle (rotate in x*y plane)" msgstr "Угол Phi (вращать в плоскости x*y)" @@ -3727,7 +3776,7 @@ msgstr "Поместить редактор сверху" msgid "Plot ID" msgstr "ID графика" -#: src/exec_prm.cpp:643 +#: src/exec_prm.cpp:647 msgid "Plot curve by formula" msgstr "Построить кривую по формуле" @@ -3748,15 +3797,15 @@ msgstr "" "Нарисовать данные в новом окне.\n" "Вы можете выбрать тип графика, его стиль и т.д." -#: mgllab/mgllab.cpp:340 +#: mgllab/mgllab.cpp:331 msgid "Plot setup" msgstr "Настройки графика" -#: udav/text_pnl.cpp:571 mgllab/dialogs.cpp:312 mgllab/mgllab.cpp:324 +#: udav/text_pnl.cpp:571 mgllab/dialogs.cpp:312 mgllab/mgllab.cpp:315 msgid "Plot style" msgstr "Стиль графика" -#: src/exec_prm.cpp:644 +#: src/exec_prm.cpp:648 msgid "Plot surface by formula" msgstr "Построить поверхность по формуле" @@ -3776,11 +3825,11 @@ msgstr "Предыдущий срез" msgid "Prev slide" msgstr "Предыдущий кадр" -#: udav/info_dlg.cpp:51 +#: udav/info_dlg.cpp:53 msgid "Preview" msgstr "Просмотр" -#: mgllab/mgllab.cpp:581 +#: mgllab/mgllab.cpp:576 msgid "Previous expressions" msgstr "Предыдущее выражение" @@ -3792,15 +3841,15 @@ msgstr "Примитивы" msgid "Primitives ..." msgstr "Примитивы ..." -#: src/exec_set.cpp:854 +#: src/exec_set.cpp:863 msgid "Print MathGL version or check if it is valid" msgstr "Вывести версию MathGL или проверить, что она подходит" -#: src/exec_dat.cpp:1688 +#: src/exec_dat.cpp:1750 msgid "Print content of the data" msgstr "Вывести содержимое массива данных" -#: src/exec_dat.cpp:1727 +#: src/exec_dat.cpp:1792 msgid "Print fitted formula" msgstr "Вывести подобранную формулу" @@ -3808,15 +3857,15 @@ msgstr "Вывести подобранную формулу" msgid "Print graphics" msgstr "Напечатать график" -#: src/exec_dat.cpp:1680 +#: src/exec_dat.cpp:1742 msgid "Print list of data names in HDF file" msgstr "Вывести список имен переменных в HDF файле" -#: src/exec_dat.cpp:1705 +#: src/exec_dat.cpp:1768 msgid "Print message or information about the data" msgstr "Вывести сообщение или информацию о данных" -#: mgllab/mgllab.cpp:297 +#: mgllab/mgllab.cpp:288 msgid "Print plot" msgstr "Напечатать график" @@ -3824,7 +3873,7 @@ msgstr "Напечатать график" msgid "Print script" msgstr "Напечатать скрипт" -#: src/exec_prm.cpp:641 +#: src/exec_prm.cpp:645 msgid "Print string from file" msgstr "Вывести строку в файл" @@ -3844,11 +3893,11 @@ msgstr "Печатаю ..." msgid "Program flow" msgstr "Команды управления" -#: src/exec_dat.cpp:1669 +#: src/exec_dat.cpp:1731 msgid "Project periodical data in [v1,v2]" msgstr "Проецирует периодические данные в [v1,v2]" -#: udav/udav_wnd.cpp:312 mgllab/mgllab.cpp:337 mgllab/mgllab.cpp:476 +#: udav/udav_wnd.cpp:312 mgllab/mgllab.cpp:328 mgllab/mgllab.cpp:468 msgid "Properties" msgstr "Свойства" @@ -3860,7 +3909,7 @@ msgstr "Свойства выбранного массива данных" msgid "Pulse prop." msgstr "Свойства импульса" -#: udav/calc_dlg.cpp:127 mgllab/mgllab.cpp:615 +#: udav/calc_dlg.cpp:127 mgllab/mgllab.cpp:610 msgid "Put function" msgstr "Поместить" @@ -3876,7 +3925,7 @@ msgstr "Поместить в этот массив данных" msgid "Put to script" msgstr "В скрипт" -#: src/exec_dat.cpp:1726 +#: src/exec_dat.cpp:1791 msgid "Put value (numeric or array) to given data element" msgstr "Поместить число или массив в заданный элемент данных" @@ -3894,35 +3943,40 @@ msgstr "Выход" msgid "R - maroon" msgstr "R - темно-красный" -#: src/exec_set.cpp:835 +#: src/exec_set.cpp:843 msgid "Rasterize plot and save to background" msgstr "Растеризовать график и установить вместо фона" -#: src/exec_dat.cpp:1732 +#: src/exec_dat.cpp:1797 msgid "Read and join data from several files" msgstr "Загрузить и объединить данные из нескольких файлов" -#: src/exec_dat.cpp:1731 +#: src/exec_dat.cpp:1798 +#, fuzzy +msgid "Read data from binary file of specified type" +msgstr "Загрузить данные из файла с размерами из первой строки" + +#: src/exec_dat.cpp:1796 msgid "Read data from file" msgstr "Загрузить данные из файла" -#: src/exec_dat.cpp:1734 +#: src/exec_dat.cpp:1800 msgid "Read data from file with sizes specified in first row" msgstr "Загрузить данные из файла с размерами из первой строки" -#: src/exec_dat.cpp:1733 +#: src/exec_dat.cpp:1799 msgid "Read data with name 'id' from HDF file" msgstr "Загрузить данные с именем 'id' из HDF файла" -#: udav/udav_wnd.cpp:268 mgllab/mgllab.cpp:382 +#: udav/udav_wnd.cpp:268 mgllab/mgllab.cpp:373 msgid "Ready" msgstr "Готов" -#: src/exec_dat.cpp:1735 +#: src/exec_dat.cpp:1801 msgid "Rearrange data dimensions" msgstr "Упорядочить размерности массива данных" -#: udav/udav_wnd.cpp:301 mgllab/mgllab.cpp:298 +#: udav/udav_wnd.cpp:301 mgllab/mgllab.cpp:289 msgid "Recent files" msgstr "Последние файлы" @@ -3946,7 +4000,7 @@ msgstr "Перерисовать" msgid "Redraw picture for $0 equal to" msgstr "Перерисовать для $0 равного" -#: widgets/fltk.cpp:839 +#: widgets/fltk.cpp:845 msgid "Redraw plot" msgstr "Перерисовать график" @@ -3954,7 +4008,7 @@ msgstr "Перерисовать график" msgid "Refresh" msgstr "Обновить" -#: widgets/fltk.cpp:873 +#: widgets/fltk.cpp:879 msgid "Refresh the picture" msgstr "Обновить рисунок" @@ -3966,31 +4020,31 @@ msgstr "Положение i-го цвета" msgid "Reload" msgstr "Перезагрузить" -#: widgets/fltk.cpp:841 +#: widgets/fltk.cpp:847 msgid "Reload data" msgstr "Перезагрузить" -#: widgets/fltk.cpp:879 +#: widgets/fltk.cpp:885 msgid "Reload data and refresh the picture" msgstr "Перезагрузить данные и обновить рисунок" -#: src/exec_dat.cpp:1668 +#: src/exec_dat.cpp:1730 msgid "Remove duplicate rows" msgstr "Удалить одинаковые строки" -#: src/exec_dat.cpp:1745 +#: src/exec_dat.cpp:1811 msgid "Remove jump into the data, like phase jumps" msgstr "Убрать скачки данных, например скачки фазы" -#: udav/find_dlg.cpp:50 mgllab/editor.cpp:562 +#: udav/find_dlg.cpp:50 mgllab/editor.cpp:566 msgid "Replace" msgstr "Заменить" -#: mgllab/editor.cpp:565 +#: mgllab/editor.cpp:569 msgid "Replace all" msgstr "Заменить все" -#: udav/find_dlg.cpp:39 mgllab/editor.cpp:561 +#: udav/find_dlg.cpp:39 mgllab/editor.cpp:565 msgid "Replace by:" msgstr "Заменить на:" @@ -3998,7 +4052,7 @@ msgstr "Заменить на:" msgid "Replace expression by its numerical value." msgstr "Заменить выражение на его числовое значение." -#: mgllab/editor.cpp:631 +#: mgllab/editor.cpp:635 #, c-format msgid "Replaced %ld occurrences." msgstr "Заменено %ld вхождений." @@ -4032,7 +4086,7 @@ msgstr "Оставить место для подписей справа (сти msgid "Reserve space for labels at top side (style '^')" msgstr "Оставить место для подписей сверху (стиль '^')" -#: src/exec_set.cpp:836 +#: src/exec_set.cpp:844 msgid "Reset settings and clear picture" msgstr "Сбросить настройки и обновить рисунок" @@ -4044,7 +4098,7 @@ msgstr "Изменить размер" msgid "Resize (interpolate) the data to specified sizes (Ctrl+Shift+R)." msgstr "Изменить размер (интерполоировать) данных (Ctrl+Shift+R)." -#: src/exec_dat.cpp:1737 +#: src/exec_dat.cpp:1803 msgid "Resize data array" msgstr "Изменить размер массива данных" @@ -4056,7 +4110,7 @@ msgstr "Изменить размер массива данных со сгла msgid "Restore" msgstr "Восстановить" -#: widgets/fltk.cpp:870 +#: widgets/fltk.cpp:876 msgid "Restore default graphics rotation, zoom and perspective" msgstr "Восстановить вращение, приближение и перспективу графика" @@ -4085,7 +4139,7 @@ msgstr "Результат (будет иметь размеры " msgid "Resulting string" msgstr "Итоговая строка" -#: src/parser.cpp:1497 +#: src/parser.cpp:1506 msgid "Return from function" msgstr "Возврат из функции" @@ -4101,7 +4155,7 @@ msgstr "Правый верхний угол" msgid "Roll" msgstr "Сдвинуть" -#: src/exec_dat.cpp:1739 +#: src/exec_dat.cpp:1805 msgid "Roll data along direction(s)" msgstr "Сдвинуть данные по направлению" @@ -4126,11 +4180,11 @@ msgstr "Вращать влево" msgid "Rotate on" msgstr "Поворот" -#: widgets/fltk.cpp:866 +#: widgets/fltk.cpp:872 msgid "Rotate picture by holding left mouse button" msgstr "Вращать рисунок при удержании кнопок мыши" -#: src/exec_set.cpp:837 +#: src/exec_set.cpp:845 msgid "Rotate plot" msgstr "Вращать график" @@ -4158,7 +4212,7 @@ msgstr "" "Запустить анимацию (CTRl+F5). Если ее параметры\n" "не заданы, то будет показан диалог настройки." -#: widgets/fltk.cpp:912 +#: widgets/fltk.cpp:918 msgid "Run/Stop slideshow (graphics animation)" msgstr "Запустить/остановить анимацию" @@ -4178,7 +4232,7 @@ msgstr "" msgid "Saturation" msgstr "Насыщенность" -#: udav/setup_dlg.cpp:143 mgllab/editor.cpp:282 +#: udav/setup_dlg.cpp:143 mgllab/editor.cpp:286 msgid "Save" msgstr "Сохранить" @@ -4186,7 +4240,7 @@ msgstr "Сохранить" msgid "Save Data?" msgstr "Сохранить данные?" -#: widgets/fltk.cpp:595 mgllab/mgllab.cpp:229 +#: widgets/fltk.cpp:601 mgllab/mgllab.cpp:220 msgid "Save File As?" msgstr "Сохранить файл?" @@ -4194,7 +4248,7 @@ msgstr "Сохранить файл?" msgid "Save JPEG frames" msgstr "Сохранить кадры в JPEG" -#: udav/udav_wnd.cpp:290 mgllab/mgllab.cpp:296 +#: udav/udav_wnd.cpp:290 mgllab/mgllab.cpp:287 msgid "Save as ..." msgstr "Сохранить как ..." @@ -4202,7 +4256,7 @@ msgstr "Сохранить как ..." msgid "Save data" msgstr "Сохранить данные" -#: src/exec_dat.cpp:1742 +#: src/exec_dat.cpp:1808 msgid "Save data to HDF5 file" msgstr "Сохранить данные в HDF5 файл" @@ -4210,15 +4264,15 @@ msgstr "Сохранить данные в HDF5 файл" msgid "Save data to a file (Ctrl+Shift+S)." msgstr "Сохранить данные в файл (Ctrl+Shift+S)." -#: src/exec_dat.cpp:1741 mgllab/table.cpp:844 +#: src/exec_dat.cpp:1807 mgllab/table.cpp:844 msgid "Save data to file" msgstr "Сохранить данные в файл" -#: mgllab/mgllab.cpp:295 +#: mgllab/mgllab.cpp:286 msgid "Save file" msgstr "Сохранить файл" -#: mgllab/mgllab.cpp:488 +#: mgllab/mgllab.cpp:480 msgid "Save file before redrawing" msgstr "Сохранить файл перед рисованием" @@ -4230,7 +4284,7 @@ msgstr "Сохранить скрипт" msgid "Save script to a file (Ctrl+S)" msgstr "Сохранить скрипт в файл (Ctrl+S)" -#: mgllab/editor.cpp:509 +#: mgllab/editor.cpp:513 msgid "Save script to file" msgstr "Сохранить скрипт в файл" @@ -4254,11 +4308,11 @@ msgstr "Масштаб и вращение" msgid "Script" msgstr "Скрипт" -#: udav/find_dlg.cpp:43 mgllab/editor.cpp:564 +#: udav/find_dlg.cpp:43 mgllab/editor.cpp:568 msgid "Search backward" msgstr "Искать назад" -#: udav/text_pnl.cpp:543 mgllab/mgllab.cpp:312 +#: udav/text_pnl.cpp:543 mgllab/mgllab.cpp:303 msgid "Select all" msgstr "Выделить все" @@ -4278,7 +4332,7 @@ msgstr "Выбрать данные" msgid "Select direction" msgstr "Выбрать направление" -#: mgllab/editor.cpp:654 +#: mgllab/editor.cpp:658 msgid "Select file name" msgstr "Выбрать имя файла" @@ -4286,7 +4340,7 @@ msgstr "Выбрать имя файла" msgid "Select first the proper kind of arguments" msgstr "Сначала выберите вариант аргументов" -#: mgllab/editor.cpp:667 +#: mgllab/editor.cpp:671 msgid "Select folder name" msgstr "Выбрать путь к папке" @@ -4294,7 +4348,7 @@ msgstr "Выбрать путь к папке" msgid "Select kind of plot" msgstr "Выбрать тип графика" -#: src/exec_set.cpp:853 +#: src/exec_set.cpp:862 msgid "Select variant of plot style(s)" msgstr "Выбрать вариант стиля графика" @@ -4302,55 +4356,55 @@ msgstr "Выбрать вариант стиля графика" msgid "Set" msgstr "Задать" -#: src/exec_set.cpp:849 +#: src/exec_set.cpp:858 msgid "Set additional tick and axis labels shift" msgstr "Задает дополнительный сдвиш меток осей" -#: src/exec_set.cpp:797 +#: src/exec_set.cpp:805 msgid "Set ambient light brightness" msgstr "Задает яркость фонового освещения" -#: src/exec_set.cpp:818 +#: src/exec_set.cpp:826 msgid "Set arbitrary position of plot in picture" msgstr "Задать произвольную область рисования внутри рисунка" -#: udav/udav_wnd.cpp:315 mgllab/mgllab.cpp:338 +#: udav/udav_wnd.cpp:315 mgllab/mgllab.cpp:329 msgid "Set arguments" msgstr "Задать аргументы" -#: src/exec_set.cpp:799 +#: src/exec_set.cpp:807 msgid "Set aspect ration" msgstr "Задать соотношение сторон" -#: src/exec_set.cpp:801 +#: src/exec_set.cpp:809 msgid "Set axis and tick style" msgstr "Задать стиль осей и меток" -#: src/exec_set.cpp:827 +#: src/exec_set.cpp:835 msgid "Set axis origin" msgstr "Задать начало координат" -#: src/exec_set.cpp:834 +#: src/exec_set.cpp:842 msgid "Set axis ranges" msgstr "Задать диапазон осей" -#: src/exec_set.cpp:842 +#: src/exec_set.cpp:850 msgid "Set bit-flags (for advanced users only)" msgstr "Задает битовый флаг (для опытных пользователей)" -#: src/exec_set.cpp:803 +#: src/exec_set.cpp:811 msgid "Set bounding box for 2d export" msgstr "Задать границы для 2d экспорта" -#: src/exec_set.cpp:824 +#: src/exec_set.cpp:832 msgid "Set brush for given mask id" msgstr "Задать кисть для маски с выбранным id" -#: src/exec_set.cpp:808 +#: src/exec_set.cpp:816 msgid "Set color range" msgstr "Задать диапазон цвета" -#: src/exec_dat.cpp:1703 +#: src/exec_dat.cpp:1766 msgid "Set column id for data" msgstr "Задать id колонок данных" @@ -4362,23 +4416,23 @@ msgstr "Вкл/выкл обрезание для конкретного гра msgid "Set data sizes manually" msgstr "Задать размеры данных вручную" -#: src/exec_set.cpp:802 +#: src/exec_set.cpp:810 msgid "Set default bars width" msgstr "Задать размер полос по умолчанию" -#: src/exec_set.cpp:832 +#: src/exec_set.cpp:840 msgid "Set default filename" msgstr "Задать имя файла по умолчанию" -#: src/exec_set.cpp:796 +#: src/exec_set.cpp:804 msgid "Set default transparency" msgstr "Задать прозрачность по умолчанию" -#: src/exec_set.cpp:811 +#: src/exec_set.cpp:819 msgid "Set diffusive light brightness" msgstr "Задать яркость рассеянного света" -#: src/exec_set.cpp:812 +#: src/exec_set.cpp:820 msgid "Set draw region for quality&4" msgstr "Задать область рисования при quality&4" @@ -4402,75 +4456,75 @@ msgstr "Задать область рисования как ячейку бр msgid "Set lighting off/on for particular plot" msgstr "Вкл/выкл освещение отдельного графика" -#: src/exec_set.cpp:825 +#: src/exec_set.cpp:833 msgid "Set number of lines in mesh/fall/vect and so on" msgstr "Задать примерное число линий в mesh/fall/vect ..." -#: src/exec_set.cpp:819 +#: src/exec_set.cpp:827 msgid "Set number of marks in the legend" msgstr "Задать число маркеров в легенде" -#: src/exec_set.cpp:813 +#: src/exec_set.cpp:821 msgid "Set number of visible faces" msgstr "Задать число видимых граней" -#: src/exec_set.cpp:829 +#: src/exec_set.cpp:837 msgid "Set palette for 1D plots" msgstr "Задать палитру для 1D графиков" -#: src/exec_set.cpp:831 +#: src/exec_set.cpp:839 msgid "Set perspective" msgstr "Задать перспективу" -#: src/exec_set.cpp:840 +#: src/exec_set.cpp:848 msgid "Set picture size" msgstr "Задать размер рисунка" -#: src/exec_set.cpp:833 +#: src/exec_set.cpp:841 msgid "Set plot quality" msgstr "Задать качество рисования картинки" -#: src/exec_set.cpp:846 +#: src/exec_set.cpp:854 msgid "Set position of plot as cell of matrix" msgstr "Задать область рисования как ячейку матрицы" -#: src/exec_set.cpp:826 +#: src/exec_set.cpp:834 msgid "Set position of plot block in matrix" msgstr "Задать область рисования как блок в матрице" -#: src/exec_set.cpp:807 +#: src/exec_set.cpp:815 msgid "Set position of plot inside cell of column" msgstr "Задать область рисования как ячейку колонки" -#: src/exec_set.cpp:817 +#: src/exec_set.cpp:825 msgid "Set position of plot inside cell of matrix" msgstr "Задать область рисования внутри ячейки колонки" -#: src/exec_set.cpp:845 +#: src/exec_set.cpp:853 msgid "Set position of plot inside cell of rotated stick" msgstr "Задать область рисования как ячейку повернутого бруска" -#: src/exec_set.cpp:844 +#: src/exec_set.cpp:852 msgid "Set position of plot inside cell of sheared stick" msgstr "Задать область рисования как ячейку наклоненной колонки" -#: src/exec_set.cpp:857 +#: src/exec_set.cpp:866 msgid "Set range for x-axis" msgstr "Задать диапазон по x" -#: src/exec_set.cpp:859 +#: src/exec_set.cpp:868 msgid "Set range for y-axis" msgstr "Задать диапазон по y" -#: src/exec_set.cpp:863 +#: src/exec_set.cpp:872 msgid "Set range for z-axis" msgstr "Задать диапазон по z" -#: src/exec_set.cpp:839 +#: src/exec_set.cpp:847 msgid "Set scale text in relative subplots too" msgstr "Задает масштабирование текста в отн.подграфиках" -#: src/exec_set.cpp:841 +#: src/exec_set.cpp:849 msgid "Set scaling factor for further setsize" msgstr "Задать множитель для всех 'setsize'" @@ -4482,51 +4536,51 @@ msgstr "Задать аргументы скрипта" msgid "Set size for text, marks and others" msgstr "Задать размер текста, маркеров и пр." -#: src/exec_set.cpp:798 +#: src/exec_set.cpp:806 msgid "Set size of arrows" msgstr "Задать размер стрелок" -#: src/exec_set.cpp:823 +#: src/exec_set.cpp:831 msgid "Set size of markers" msgstr "Задать размер маркеров" -#: src/exec_set.cpp:830 +#: src/exec_set.cpp:838 msgid "Set size of semi-transparent area around line" msgstr "Задать размер полупрозрачной области около линии" -#: src/exec_set.cpp:828 +#: src/exec_set.cpp:836 msgid "Set tick labels drawing at origin" msgstr "Разрешить вывод меток осей в начале координат" -#: src/exec_set.cpp:848 +#: src/exec_set.cpp:857 msgid "Set tick length" msgstr "Задать длину меток осей" -#: src/exec_set.cpp:809 +#: src/exec_set.cpp:817 msgid "Set ticks for colorbar" msgstr "Задать метки для цветовой шкалы" -#: src/exec_set.cpp:858 +#: src/exec_set.cpp:867 msgid "Set ticks for x-axis" msgstr "Задать метки для оси x" -#: src/exec_set.cpp:860 +#: src/exec_set.cpp:869 msgid "Set ticks for y-axis" msgstr "Задать метки для оси y" -#: src/exec_set.cpp:864 +#: src/exec_set.cpp:873 msgid "Set ticks for z-axis" msgstr "Задать метки для оси z" -#: src/exec_set.cpp:850 +#: src/exec_set.cpp:859 msgid "Set ticks in time format" msgstr "Задать метки в формате времени" -#: src/exec_set.cpp:852 +#: src/exec_set.cpp:861 msgid "Set ticks tuning" msgstr "Включить оптимизацию меток осей" -#: src/exec_set.cpp:838 +#: src/exec_set.cpp:846 msgid "Set to auto rotate text or not" msgstr "Разрешить поворот текста" @@ -4534,7 +4588,7 @@ msgstr "Разрешить поворот текста" msgid "Set to use whole area (style '#')" msgstr "Задать использование всей области (стиль '#')" -#: src/exec_set.cpp:851 +#: src/exec_set.cpp:860 msgid "Set type transparency" msgstr "Задать тип прозрачности" @@ -4566,11 +4620,11 @@ msgstr "" msgid "Settings" msgstr "Настройки" -#: mgllab/mgllab.cpp:336 +#: mgllab/mgllab.cpp:327 msgid "Setup" msgstr "Настройки" -#: mgllab/mgllab.cpp:339 +#: mgllab/mgllab.cpp:330 msgid "Setup animation" msgstr "Настроить анимацию" @@ -4578,19 +4632,19 @@ msgstr "Настроить анимацию" msgid "Setup colors for:" msgstr "Настроить цвета:" -#: src/exec_set.cpp:815 +#: src/exec_set.cpp:823 msgid "Setup font" msgstr "Настроить шрифт" -#: src/exec_set.cpp:820 +#: src/exec_set.cpp:828 msgid "Setup light" msgstr "Настроить освещение" -#: src/exec_prm.cpp:625 +#: src/exec_prm.cpp:629 msgid "Setup or draw axis" msgstr "Настроить или нарисовать оси" -#: src/exec_set.cpp:810 +#: src/exec_set.cpp:818 msgid "Setup plot points cutting" msgstr "Настроить обрезание точек графика" @@ -4614,23 +4668,23 @@ msgstr "Сшить фазу" msgid "Sharp colors" msgstr "Контрастные" -#: src/exec_set.cpp:843 +#: src/exec_set.cpp:851 msgid "Shear plot" msgstr "Наклон графика" -#: widgets/fltk.cpp:905 +#: widgets/fltk.cpp:911 msgid "Shift the picture down" msgstr "Сдвинуть рисунок вниз" -#: widgets/fltk.cpp:897 +#: widgets/fltk.cpp:903 msgid "Shift the picture left" msgstr "Сдвинуть рисунок слево" -#: widgets/fltk.cpp:903 +#: widgets/fltk.cpp:909 msgid "Shift the picture right" msgstr "Сдвинуть рисунок вправо" -#: widgets/fltk.cpp:895 +#: widgets/fltk.cpp:901 msgid "Shift the picture up" msgstr "Сдвинуть рисунок вверх" @@ -4638,7 +4692,7 @@ msgstr "Сдвинуть рисунок вверх" msgid "Short description of selected command" msgstr "Краткое описание выбранной команды" -#: udav/info_dlg.cpp:54 +#: udav/info_dlg.cpp:56 msgid "Short information about the data." msgstr "Краткая информация о данных" @@ -4654,11 +4708,11 @@ msgstr "" "Показать калькулятор, который вычисляет текстовые формулы,\n" "которые могут содержать и переменные из скрипта." -#: mgllab/editor.cpp:526 mgllab/editor.cpp:528 +#: mgllab/editor.cpp:530 msgid "Show calculator window" msgstr "Показать окно калькулятора" -#: widgets/fltk.cpp:916 +#: widgets/fltk.cpp:922 msgid "Show custom dialog for plot setup" msgstr "Показать диалог настроек графика" @@ -4720,11 +4774,11 @@ msgstr "Показать подсказки по использованию MGL. msgid "Show info" msgstr "Показать информацию" -#: mgllab/mgllab.cpp:314 +#: mgllab/mgllab.cpp:305 msgid "Show lines" msgstr "Показать строки" -#: widgets/fltk.cpp:913 +#: widgets/fltk.cpp:919 msgid "Show next frame in slideshow" msgstr "Показать следующий кадр" @@ -4732,7 +4786,7 @@ msgstr "Показать следующий кадр" msgid "Show next slide (Ctrl+.)." msgstr "Показать следующий кадр (Ctrl+.)." -#: widgets/fltk.cpp:908 +#: widgets/fltk.cpp:914 msgid "Show previous frame in slideshow" msgstr "Показать предыдущий кадр" @@ -4740,6 +4794,15 @@ msgstr "Показать предыдущий кадр" msgid "Show previous slide (Ctrl+,)." msgstr "Показать предыдущий кадр (Ctrl+,)." +#: mgllab/editor.cpp:532 +#, fuzzy +msgid "Show window for primitives" +msgstr "Показать диалог настроек UDAV" + +#: src/random.cpp:354 +msgid "Shuffle data cells (for dir='a') or slices (for dir='xyz')" +msgstr "Перемешать ячейки (для dir='a') или срезы (для dir='xyz') данных" + #: mgllab/table.cpp:779 msgid "Sin FFT" msgstr "Синус-Фурье" @@ -4748,7 +4811,7 @@ msgstr "Синус-Фурье" msgid "Sin-Fourier transform along direction(s)" msgstr "Синус-Фурье преобразование вдоль направления" -#: src/exec_dat.cpp:1746 +#: src/exec_dat.cpp:1812 msgid "Sin-Fourier transform at some direction" msgstr "Синус-Фурье преобразование вдоль направления" @@ -4774,7 +4837,7 @@ msgstr "Размер бруска" msgid "Sizes" msgstr "Размеры" -#: src/parser.cpp:1482 +#: src/parser.cpp:1491 msgid "Skip commands and iterate for-loop again" msgstr "Пропустить команды до конца цикла for" @@ -4786,7 +4849,7 @@ msgstr "Анимация" msgid "Smooth" msgstr "Сгладить" -#: src/exec_dat.cpp:1747 +#: src/exec_dat.cpp:1813 msgid "Smooth data" msgstr "Сгладить массив данных" @@ -4794,35 +4857,35 @@ msgstr "Сгладить массив данных" msgid "Smooth data along direction(s)" msgstr "Сгладить массив данных по направлению" -#: src/exec_dat.cpp:1730 +#: src/exec_dat.cpp:1795 msgid "Solve Hamiltonian ODE (find GO ray or trajectory)" msgstr "Решить гамильтонову ОДУ (найти ГО луч/траекторию)" -#: src/exec_dat.cpp:1720 +#: src/exec_dat.cpp:1785 msgid "Solve ODE" msgstr "Решить систему обыкновенных диф. уравнений" -#: src/exec_dat.cpp:1722 +#: src/exec_dat.cpp:1787 msgid "Solve PDE" msgstr "Решить уравнение в частных производных" -#: src/exec_dat.cpp:1728 +#: src/exec_dat.cpp:1793 msgid "Solve PDE in accompanied coordinates for 2d case" msgstr "Решить PDE в сопровождающей системе координат (2d)" -#: src/exec_dat.cpp:1729 +#: src/exec_dat.cpp:1794 msgid "Solve PDE in accompanied coordinates for 3d case" msgstr "Решить PDE в сопровождающей системе координат (3d)" -#: src/exec_dat.cpp:1667 +#: src/exec_dat.cpp:1729 msgid "Solve PDE using advanced method (X-Y only)" msgstr "Решить PDE (сложные уравнения, 2d случай)" -#: src/exec_dat.cpp:1761 +#: src/exec_dat.cpp:1827 msgid "Solve tridiagonal matrix" msgstr "Решить трехдиагональную систему" -#: src/exec_dat.cpp:1749 +#: src/exec_dat.cpp:1815 msgid "Sort data by values in column" msgstr "Сортировать данные по значениям в колонке" @@ -4862,7 +4925,7 @@ msgstr "" msgid "Squeeze" msgstr "Сжать" -#: src/exec_dat.cpp:1750 +#: src/exec_dat.cpp:1816 msgid "Squeeze data" msgstr "Сжать данные" @@ -4870,15 +4933,15 @@ msgstr "Сжать данные" msgid "Start" msgstr "Старт" -#: src/parser.cpp:1492 +#: src/parser.cpp:1501 msgid "Start function definition and stop execution of main script" msgstr "Начало определения функции и остановка выполнения основного скрипта" -#: src/parser.cpp:1495 +#: src/parser.cpp:1504 msgid "Start next for-loop iteration" msgstr "Начать новую итерацию цикла for" -#: src/parser.cpp:1496 +#: src/parser.cpp:1505 msgid "Start/close commands which should executed only once" msgstr "Начало/конец блока команд, которые будут выполняться единожды" @@ -4890,7 +4953,7 @@ msgstr "Индекс начальной ячейки" msgid "State" msgstr "Состояние" -#: src/exec_dat.cpp:1685 +#: src/exec_dat.cpp:1747 msgid "Step for pulse diffraction" msgstr "Шаг для расчета дифракции импульса" @@ -4898,11 +4961,11 @@ msgstr "Шаг для расчета дифракции импульса" msgid "Stop" msgstr "Стоп" -#: widgets/fltk.cpp:875 +#: widgets/fltk.cpp:881 msgid "Stop drawing" msgstr "Остановить рисование" -#: src/parser.cpp:1498 +#: src/parser.cpp:1507 msgid "Stop execution" msgstr "Остановить выполнение скрипта" @@ -5002,7 +5065,7 @@ msgstr "Подметки" msgid "Subticks" msgstr "Подметки" -#: src/exec_dat.cpp:1753 +#: src/exec_dat.cpp:1819 msgid "Subtract data or number" msgstr "Вычесть данные или число" @@ -5027,7 +5090,7 @@ msgstr "Суммировать вдоль направления" msgid "Summation of" msgstr "Сумма от" -#: src/exec_dat.cpp:1755 +#: src/exec_dat.cpp:1821 msgid "Swap data (useful after Fourier transform)" msgstr "Поменять местами левую и правую части данных" @@ -5039,15 +5102,20 @@ msgstr "Поменять местами данные по направлению msgid "Swap parts" msgstr "Поменять местами" -#: src/exec_set.cpp:814 +#: src/exec_set.cpp:856 +#, fuzzy +msgid "Switch on/off TeX parsing at text output" +msgstr "Вкл/выкл прозрачность рисунка" + +#: src/exec_set.cpp:822 msgid "Switch on/off fog" msgstr "Вкл/выкл туман" -#: src/exec_set.cpp:816 +#: src/exec_set.cpp:824 msgid "Switch on/off gray-scale mode" msgstr "Вкл/выкл режим оттенков серого" -#: widgets/fltk.cpp:862 +#: widgets/fltk.cpp:868 msgid "Switch on/off grid drawing" msgstr "Вкл/выкл рисование сетки" @@ -5063,7 +5131,7 @@ msgstr "Вкл/выкл освещение графика (Alt+L)." msgid "Switch on/off lightning for the graphics (Ctrl+L)." msgstr "Вкл/выкл освещение графика (Ctrl+L)." -#: widgets/fltk.cpp:859 +#: widgets/fltk.cpp:865 msgid "Switch on/off lightning in the picture" msgstr "Вкл/выкл освещение графика" @@ -5079,11 +5147,11 @@ msgstr "" msgid "Switch on/off mouse zoom of selected region." msgstr "Вкл/выкл приближение мышью выбранной области." -#: src/exec_set.cpp:847 +#: src/exec_set.cpp:855 msgid "Switch on/off to use ternary axis" msgstr "Указать тип тернарных координат или проекций" -#: src/exec_set.cpp:795 +#: src/exec_set.cpp:803 msgid "Switch on/off transparency" msgstr "Вкл/выкл прозрачность" @@ -5095,7 +5163,7 @@ msgstr "Вкл/выкл прозрачность рисунка (Alt+T)." msgid "Switch on/off transparency for the graphics (Ctrl+T)." msgstr "Вкл/выкл прозрачность рисунка (Ctrl+T)." -#: widgets/fltk.cpp:856 +#: widgets/fltk.cpp:862 msgid "Switch on/off transparency in the picture" msgstr "Вкл/выкл прозрачность рисунка" @@ -5107,7 +5175,7 @@ msgstr "Симметричный диапазон" msgid "Symmetrical?" msgstr "Симметрично?" -#: src/addon.cpp:121 src/base_cf.cpp:268 +#: src/addon.cpp:121 src/base_cf.cpp:281 #, c-format msgid "TEST: %s\n" msgstr "ТЕСТ: %s\n" @@ -5162,7 +5230,7 @@ msgstr "" "калькуляторе выражение (которое может зависеть от координат x,y,z и др.) и " "вставьте его в скрипт." -#: mgllab/editor.cpp:280 +#: mgllab/editor.cpp:284 msgid "" "The current file has not been saved.\n" "Would you like to save it now?" @@ -5176,13 +5244,13 @@ msgstr "" "Специальный диалог (Правка|Вставить|Новая команда) поможет Вам выбрать " "команду, заполнить ее аргументы и вставить в скрипт." -#: src/crust.cpp:591 +#: src/crust.cpp:590 msgid "" "There are duplicated or indistinguishably adjacent points for triangulation." msgstr "Повторяющиеся или близкие точки при триангуляции" #. mglScrStr -#: src/base.cpp:251 +#: src/base.cpp:262 msgid "There is changing temporary data in script" msgstr "Попытка изменить временные данные в скрипте" @@ -5194,7 +5262,7 @@ msgstr "Есть примитивы, заданные вручную" msgid "There is no 'fmt' argument for this command" msgstr "Отсутствует 'fmt' аргумент для этой команды" -#: udav/text_pnl.cpp:137 mgllab/editor.cpp:681 +#: udav/text_pnl.cpp:137 mgllab/editor.cpp:685 msgid "There is no fitted formula." msgstr "Нет подобранной формулы." @@ -5218,30 +5286,30 @@ msgstr "" "переменные из скрипта." #. mglScrCmd -#: src/base.cpp:249 +#: src/base.cpp:260 msgid "There is too long string(s) in script" msgstr "Слишком длинная строка в скрипте" #. mglScrLong -#: src/base.cpp:250 +#: src/base.cpp:261 msgid "There is unbalanced ' in script" msgstr "Лишняя кавычка ' в скрипте" #. mglWarnSpc -#: src/base.cpp:247 +#: src/base.cpp:258 msgid "There is wrong argument(s) in script" msgstr "Неправильные аргументы команды в скрипте" #. mglScrArg -#: src/base.cpp:248 +#: src/base.cpp:259 msgid "There is wrong command(s) in script" msgstr "В скрипте неправильная команд(ы)" -#: widgets/fltk.cpp:888 +#: widgets/fltk.cpp:894 msgid "Theta angle (tilt z-axis)" msgstr "Угол Theta (наклон оси z)" -#: widgets/fltk.cpp:1191 +#: widgets/fltk.cpp:1206 msgid "This is for parameter " msgstr "Это для параметра " @@ -5302,7 +5370,7 @@ msgstr "Транспонировать" msgid "Transpose data" msgstr "Транспонировать данные" -#: src/exec_dat.cpp:1759 +#: src/exec_dat.cpp:1825 msgid "Transpose data array" msgstr "Транспонировать данные" @@ -5473,7 +5541,7 @@ msgstr "UDAV - сжать данные" msgid "UDAV - about" msgstr "UDAV - о программе" -#: udav/anim_dlg.cpp:105 +#: udav/anim_dlg.cpp:104 msgid "UDAV - animation" msgstr "UDAV - анимация" @@ -5516,7 +5584,7 @@ msgid "Underline" msgstr "Подчеркивание" #. edit menu -#: udav/text_pnl.cpp:516 mgllab/mgllab.cpp:308 +#: udav/text_pnl.cpp:516 mgllab/mgllab.cpp:299 msgid "Undo" msgstr "Отмена" @@ -5524,15 +5592,15 @@ msgstr "Отмена" msgid "Undo editor change (Ctrl+Z)." msgstr "Отменить изменения в редакторе (Ctrl+Z)." -#: mgllab/mgllab.cpp:137 +#: mgllab/mgllab.cpp:140 msgid "Untitled" msgstr "без имени" -#: mgllab/mgllab.cpp:360 mgllab/mgllab.cpp:364 +#: mgllab/mgllab.cpp:351 mgllab/mgllab.cpp:355 msgid "Untitled - mgllab" msgstr "без имени - mgllab" -#: widgets/fltk.cpp:1108 +#: widgets/fltk.cpp:1120 msgid "Update" msgstr "Обновить" @@ -5549,7 +5617,7 @@ msgstr "Верхняя граница для цвета или прозрачн msgid "Usage:\tmglconv [parameter(s)] scriptfile\n" msgstr "Использование:\tmglconv [параметр(ы)] имя_скрипта\n" -#: mgllab/mgllab.cpp:432 +#: mgllab/mgllab.cpp:423 #, c-format msgid "Usage:\tmgllab [parameter(s)] scriptfile\n" msgstr "Использование:\tmgllab [параметр(ы)] имя_скрипта\n" @@ -5594,11 +5662,16 @@ msgstr "" msgid "Use color scheme" msgstr "Использовать цветовую схему" +#: mgllab/mgllab.cpp:485 +#, fuzzy +msgid "Use dark color scheme" +msgstr "Использовать цветовую схему" + #: udav/prop_dlg.cpp:175 msgid "Use dots plot for preview" msgstr "Использовать точки для просмотра" -#: mgllab/mgllab.cpp:492 +#: mgllab/mgllab.cpp:484 msgid "Use multi-threading for drawing" msgstr "Рисование в отдельном потоке" @@ -5645,7 +5718,7 @@ msgstr "Вертикальный размер" msgid "W - lightgray" msgstr "W - светло-серый" -#: src/exec_dat.cpp:1763 +#: src/exec_dat.cpp:1829 msgid "Wavelet transform at some direction" msgstr "Wavelet преобразование вдоль направления" @@ -5653,7 +5726,7 @@ msgstr "Wavelet преобразование вдоль направления" msgid "Whole area" msgstr "Вся область" -#: mgllab/mgllab.cpp:495 +#: mgllab/mgllab.cpp:488 msgid "Widget scheme" msgstr "Вид виджетов" @@ -5665,7 +5738,7 @@ msgstr "Ширина" msgid "Width of selected cells" msgstr "Ширины выбранных ячеек" -#: src/data.cpp:1490 +#: src/data.cpp:1559 #, c-format msgid "" "Widths are:\n" @@ -5684,7 +5757,7 @@ msgstr "Сетчатый график" msgid "Wire style" msgstr "Контур" -#: src/exec_set.cpp:856 +#: src/exec_set.cpp:865 msgid "Write current image to graphical file" msgstr "Сохранить текущий рисунок в файл" @@ -5774,6 +5847,11 @@ msgid "" "string using `+` (for example, `'abc'+3` will give 'abf'), or use it all " "together." msgstr "" +"Вы можете объединять строки и числа с помощью `,` без пробелов (например, " +"`'max (u) =',u.max,' a.u.' 'или`'u = ',!(1+i2)` для комплексных чисел). " +"Также вы можете получить n-й символ строки с помощью `[]` (например, " +"`'abc'[1]` даст 'b') или добавить значение к последнему символу строки с " +"помощью `+` (например, `'abc'+3` даст 'abf') или использовать все вместе." #: src/window.cpp:411 msgid "" @@ -5921,7 +5999,7 @@ msgstr "Необходимо указать направление" msgid "You should put text inside ' ' for argument " msgstr "Необходимо ввести текст в ' ' для аргумента" -#: udav/anim_dlg.cpp:106 +#: udav/anim_dlg.cpp:105 msgid "You should select one of case" msgstr "Необходимо выбрать один из вариантов" @@ -5961,7 +6039,7 @@ msgstr "Размер по Z" msgid "Z-slice from" msgstr "Z срез от" -#: src/exec_set.cpp:862 +#: src/exec_set.cpp:871 msgid "Zoom axis range" msgstr "Увеличить диапазон осей координат" @@ -5981,7 +6059,7 @@ msgstr "Приблизить" msgid "Zoom in graphics." msgstr "Приблизить рисунок" -#: widgets/fltk.cpp:869 +#: widgets/fltk.cpp:875 msgid "Zoom in selected region of the picture" msgstr "Приблизить выбранную область рисунка" @@ -5990,7 +6068,7 @@ msgstr "Приблизить выбранную область рисунка" msgid "Zoom in text" msgstr "Увеличить текст" -#: widgets/fltk.cpp:899 +#: widgets/fltk.cpp:905 msgid "Zoom in the picture" msgstr "Приблизить рисунок" @@ -6006,11 +6084,11 @@ msgstr "Отдалить рисунок" msgid "Zoom out text" msgstr "Уменьшить текст" -#: widgets/fltk.cpp:901 +#: widgets/fltk.cpp:907 msgid "Zoom out the picture" msgstr "Отдалить рисунок" -#: src/exec_set.cpp:861 +#: src/exec_set.cpp:870 msgid "Zoom plot region" msgstr "Приблизить область рисунка" @@ -6080,7 +6158,7 @@ msgid "attach light" msgstr "прикрепить свет" #. mglWarnFmt -#: src/base.cpp:244 +#: src/base.cpp:255 msgid "axis ranges are incompatible" msgstr "размеры осей неправильные" @@ -6115,13 +6193,13 @@ msgstr "c - голубой" msgid "center" msgstr "центр" -#: widgets/fltk.cpp:794 +#: widgets/fltk.cpp:800 #, c-format msgid "click at %g, %g, %g" msgstr "клик в %g, %g, %g" #. mglWarnCnt -#: src/base.cpp:240 +#: src/base.cpp:251 msgid "couldn't open file" msgstr "не могу открыть файл" @@ -6134,17 +6212,17 @@ msgid "cutting" msgstr "обрезание" #. ----------------------------------------------------------------------------- -#: src/base.cpp:231 +#: src/base.cpp:242 msgid "data dimension(s) is incompatible" msgstr "размеры данных несовместимы" #. mglWarnDim -#: src/base.cpp:232 +#: src/base.cpp:243 msgid "data dimension(s) is too small" msgstr "размеры данных слишком малы" #. mglWarnMem -#: src/base.cpp:236 +#: src/base.cpp:247 msgid "data values are zero" msgstr "значение данных равно нулю" @@ -6176,11 +6254,11 @@ msgid "factor" msgstr "множитель" #. mglWarnSize -#: src/base.cpp:243 +#: src/base.cpp:254 msgid "format is not supported for that build" msgstr "формат не поддерживается для этой сборки" -#: src/canvas.cpp:33 +#: src/canvas.cpp:31 msgid "frame" msgstr "кадр" @@ -6206,7 +6284,7 @@ msgstr "черно-белый" msgid "h - gray" msgstr "h - серый" -#: src/parser.cpp:1067 +#: src/parser.cpp:1076 #, c-format msgid "in line %ld" msgstr "в строке %ld" @@ -6242,7 +6320,7 @@ msgid "left" msgstr "слева" #. mglWarnOpen -#: src/base.cpp:241 +#: src/base.cpp:252 msgid "light: ID is out of range" msgstr "light: ID вне диапазона" @@ -6299,7 +6377,7 @@ msgstr "" "mglconv конвертирует mgl скрипт в рисунок (по умолчанию PNG).\n" "Текущая версия 2.%g\n" -#: mgllab/mgllab.cpp:431 +#: mgllab/mgllab.cpp:422 #, c-format msgid "" "mgllab draw mgl script interactively.\n" @@ -6333,7 +6411,7 @@ msgid "min" msgstr "min" #. mglWarnLow -#: src/base.cpp:233 +#: src/base.cpp:244 msgid "minimal data value is negative" msgstr "минимальное значение отрицательно" @@ -6347,12 +6425,12 @@ msgid "name" msgstr "имя" #. mglWarnNeg -#: src/base.cpp:234 +#: src/base.cpp:245 msgid "no file or wrong data dimensions" msgstr "нет файла или неверные размеры" #. mglWarnZero -#: src/base.cpp:237 +#: src/base.cpp:248 msgid "no legend entries" msgstr "нет записей легенды" @@ -6374,12 +6452,12 @@ msgid "none or default" msgstr "нет или по умолчанию" #. mglWarnFile -#: src/base.cpp:235 +#: src/base.cpp:246 msgid "not enough memory" msgstr "не хватает памяти" #. mglWarnNull -#: src/base.cpp:246 +#: src/base.cpp:257 msgid "not enough space for plot" msgstr "не достаточно места для графика" @@ -6388,7 +6466,7 @@ msgid "not used" msgstr "не используется" #. mglWarnSlc -#: src/base.cpp:239 +#: src/base.cpp:250 msgid "number of contours is zero or negative" msgstr "число контуров меньше или равно нуля" @@ -6418,7 +6496,7 @@ msgid "plain" msgstr "карта" #. mglWarnTern -#: src/base.cpp:245 +#: src/base.cpp:256 msgid "pointer is NULL" msgstr "указатель равен NULL" @@ -6471,12 +6549,12 @@ msgid "save slides" msgstr "сохранить кадры" #. mglWarnLId -#: src/base.cpp:242 +#: src/base.cpp:253 msgid "size(s) is zero or negative" msgstr "размер(ы) меньше или равны нулю" #. mglWarnLeg -#: src/base.cpp:238 +#: src/base.cpp:249 msgid "slice value is out of range" msgstr "срез вне диапазона" @@ -6521,7 +6599,7 @@ msgstr "метки" msgid "to" msgstr "до" -#: mgllab/mgllab.cpp:579 +#: mgllab/mgllab.cpp:574 msgid "to script" msgstr "в скрипт" @@ -6584,6 +6662,12 @@ msgstr "с шагом" msgid "y - yellow" msgstr "y - желтый" +#~ msgid "Insert file content?" +#~ msgstr "Вставить содержимое файла?" + +#~ msgid "Insert file name?" +#~ msgstr "Вставить имя файла?" + #~ msgid "" #~ "You may quickly draw the data from file. Just use: udav 'filename.dat' in " #~ "command line." diff --git a/mgllab/dialogs.cpp b/mgllab/dialogs.cpp index 8f39ee5..3170d53 100644 --- a/mgllab/dialogs.cpp +++ b/mgllab/dialogs.cpp @@ -2,7 +2,7 @@ * Copyright (C) 2007-2014 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 + * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, @@ -179,8 +179,8 @@ public: void dirsel_dlg_cb(Fl_Widget *, void *v) { dirsel_dlg.ext=NULL; dirsel_dlg.e=(ScriptWindow *)v; dirsel_dlg.show(); } //----------------------------------------------------------------------------- -void dirsel_in_cb(Fl_Widget *, void *v) -{ dirsel_dlg.ext=(Fl_Input*)v; dirsel_dlg.e=NULL; dirsel_dlg.show(); } +// void dirsel_in_cb(Fl_Widget *, void *v) +// { dirsel_dlg.ext=(Fl_Input*)v; dirsel_dlg.e=NULL; dirsel_dlg.show(); } //----------------------------------------------------------------------------- //const char *arr = "_AKVITSDOX"; Fl_Menu_Item arrows[] = { @@ -544,8 +544,8 @@ void cb_style_sch(Fl_Widget *, void *) { style_dlg.set_scheme(); } void style_dlg_cb(Fl_Widget *, void *v) { style_dlg.ext=NULL; style_dlg.e=(ScriptWindow *)v; style_dlg.show(); } //----------------------------------------------------------------------------- -void style_in_cb(Fl_Widget *, void *v) -{ style_dlg.ext=(Fl_Input*)v; style_dlg.e=NULL; style_dlg.show(); } +//void style_in_cb(Fl_Widget *, void *v) +//{ style_dlg.ext=(Fl_Input*)v; style_dlg.e=NULL; style_dlg.show(); } //----------------------------------------------------------------------------- void cb_datsel_upd(Fl_Widget *, void *); void cb_datsel_act(Fl_Widget *, void *); @@ -671,8 +671,8 @@ void cb_datsel_act(Fl_Widget *, void *) { datsel_dlg.activate(); } void datsel_dlg_cb(Fl_Widget *, void *v) { datsel_dlg.ext=NULL; datsel_dlg.e=(ScriptWindow *)v; datsel_dlg.show(); } //----------------------------------------------------------------------------- -void datsel_in_cb(Fl_Widget *, void *v) -{ datsel_dlg.ext=(Fl_Input*)v; datsel_dlg.e=NULL; datsel_dlg.show(); } +// void datsel_in_cb(Fl_Widget *, void *v) +// { datsel_dlg.ext=(Fl_Input*)v; datsel_dlg.e=NULL; datsel_dlg.show(); } //----------------------------------------------------------------------------- std::string with_arg(std::string ss, std::vector prev) { @@ -900,8 +900,8 @@ public: } hide(); } - void set_cmd(const char *line) // TODO - {} +// void set_cmd(const char *line) // TODO +// {} } newcmd_dlg; //----------------------------------------------------------------------------- void cb_cmd_type(Fl_Widget*, void*) { newcmd_dlg.type_sel(); } diff --git a/mgllab/editor.cpp b/mgllab/editor.cpp index 9e4a510..ec1cc97 100644 --- a/mgllab/editor.cpp +++ b/mgllab/editor.cpp @@ -2,7 +2,7 @@ * Copyright (C) 2007-2014 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 + * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, @@ -41,20 +41,24 @@ Fl_Text_Display::Style_Table_Entry styletable[10] = { // Style table { FL_DARK_CYAN, FL_COURIER, 14, 0 }, // F - Flow command { FL_DARK_MAGENTA, FL_COURIER, 14, 0 }, // G - New-data command { FL_DARK_RED, FL_COURIER, 14, 0 }, // H - Option - { FL_DARK_GREEN,FL_COURIER, 14, 0 }, // I - Inactive command + { FL_GRAY, FL_COURIER, 14, 0 }, // I - Inactive command { FL_MAGENTA, FL_COURIER, 14, 0 } // J - Error line ??? }; int font_kind; ///< Editor font kind int font_size; ///< Editor font size //----------------------------------------------------------------------------- -void set_style(int kind, int size) +void set_style(int kind, int size, int fdark) { + Fl_Color c1[10]={FL_BLACK,FL_DARK_GREEN,FL_BLUE,FL_RED,FL_DARK_BLUE,FL_DARK_CYAN,FL_DARK_MAGENTA,FL_DARK_RED,FL_GRAY,FL_MAGENTA}; + Fl_Color c2[10]={FL_WHITE,FL_GREEN,FL_CYAN,FL_YELLOW,FL_BLUE,FL_CYAN,FL_MAGENTA,FL_RED,FL_GRAY,FL_MAGENTA}; if(kind<0 || kind>2) kind = 1; if(size<1) size = 14; for(int i=0;i<10;i++) // set font for styles { styletable[i].size = size; styletable[i].font = 4*kind; } styletable[1].font = 4*kind+2; font_kind = kind; font_size = size; + if(fdark) for(int i=0;i<10;i++) styletable[i].color = c2[i]; + else for(int i=0;i<10;i++) styletable[i].color = c1[i]; } //----------------------------------------------------------------------------- bool MGL_FUNC_PURE is_sfx(const char *s) // suffix @@ -482,12 +486,12 @@ void changed_cb(int pos, int nInserted, int nDeleted, int nRestyled, const char if (loading) w->editor->show_insert_position(); } //----------------------------------------------------------------------------- -void insert_cb(Fl_Widget*, void *v) -{ - const char *newfile = mgl_file_chooser(_("Insert file content?")); - ScriptWindow *w = (ScriptWindow *)v; - if (newfile != NULL) load_file(newfile, w->editor->insert_position(),w); -} +// void insert_cb(Fl_Widget*, void *v) +// { +// const char *newfile = mgl_file_chooser(_("Insert file content?")); +// ScriptWindow *w = (ScriptWindow *)v; +// if (newfile != NULL) load_file(newfile, w->editor->insert_position(),w); +// } //----------------------------------------------------------------------------- void paste_cb(Fl_Widget*, void* v) { @@ -525,7 +529,7 @@ Fl_Widget *add_editor(ScriptWindow *w, int txtW, int wndH) o = new Fl_Button(210, 1, 25, 25); o->image(img_calc); o->callback(calc_dlg_cb,w); o->tooltip(_("Show calculator window")); o = new Fl_Button(240, 1, 25, 25); o->image(img_curve);o->callback(prim_dlg_cb,w); - o->tooltip(_("Show calculator window")); + o->tooltip(_("Show window for primitives")); g->end(); g->resizable(0); w->editor = new Fl_Text_Editor(0, 28, txtW, wndH-85); diff --git a/mgllab/grid.cpp b/mgllab/grid.cpp index cc82b24..a186210 100644 --- a/mgllab/grid.cpp +++ b/mgllab/grid.cpp @@ -2,7 +2,7 @@ * Copyright (C) 2007-2014 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 + * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, diff --git a/mgllab/help.cpp b/mgllab/help.cpp index 9661176..de5a9e0 100644 --- a/mgllab/help.cpp +++ b/mgllab/help.cpp @@ -2,7 +2,7 @@ * Copyright (C) 2007-2014 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 + * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, @@ -127,8 +127,8 @@ void mem_dlg_cb3(Fl_Widget *, void *v) void mem_dlg_cb4(Fl_Widget *, void *v) { ((ScriptWindow*)v)->mem_pressed(4); } //----------------------------------------------------------------------------- -void mem_update_cb(Fl_Widget *, void *v) -{ ((ScriptWindow*)v)->mem_init(); } +// void mem_update_cb(Fl_Widget *, void *v) +// { ((ScriptWindow*)v)->mem_init(); } //----------------------------------------------------------------------------- void delete_all_cb(Fl_Widget *, void *v) { diff --git a/mgllab/mathgl.cpp b/mgllab/mathgl.cpp index ef3e999..d6cc3b3 100644 --- a/mgllab/mathgl.cpp +++ b/mgllab/mathgl.cpp @@ -2,7 +2,7 @@ * Copyright (C) 2007-2014 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 + * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, @@ -115,13 +115,13 @@ void Fl_MGL::update() } } //----------------------------------------------------------------------------- -void add_suffix(char *fname, const char *ext) -{ - long n=strlen(fname); - if(n>4 && fname[n-4]=='.') - { fname[n-3]=ext[0]; fname[n-2]=ext[1]; fname[n-1]=ext[2]; } - else { strcat(fname,"."); strcat(fname,ext); } -} +// void add_suffix(char *fname, const char *ext) +// { +// long n=strlen(fname); +// if(n>4 && fname[n-4]=='.') +// { fname[n-3]=ext[0]; fname[n-2]=ext[1]; fname[n-1]=ext[2]; } +// else { strcat(fname,"."); strcat(fname,ext); } +// } //----------------------------------------------------------------------------- class ArgsDlg : public GeneralDlg { diff --git a/mgllab/mgllab.cpp b/mgllab/mgllab.cpp index 8323cd8..c8d5801 100644 --- a/mgllab/mgllab.cpp +++ b/mgllab/mgllab.cpp @@ -2,7 +2,7 @@ * Copyright (C) 2007-2014 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 + * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, @@ -46,6 +46,7 @@ std::string helpname; std::string fontname; int lang; int scheme; +int dark; std::string lastfiles[5]; Fl_Preferences pref(Fl_Preferences::USER,"abalakin","mgllab"); //----------------------------------------------------------------------------- @@ -91,6 +92,7 @@ void save_pref() pref.set("wnd_width", wndW); pref.set("wnd_height",wndH); pref.set("txt_width", txtW); + pref.set("dark",dark); } //----------------------------------------------------------------------------- void load_pref(ScriptWindow *w) @@ -108,7 +110,8 @@ void load_pref(ScriptWindow *w) pref.get("complete_word",complete_word,1); pref.get("font_kind",font_kind,1); pref.get("font_size",font_size,14); - set_style(font_kind, font_size); + pref.get("dark", dark,0); + set_style(font_kind, font_size,dark); pref.get("font_name",s,""); if(s) { fontname=s; free(s); } @@ -152,18 +155,6 @@ void set_title(Fl_Window* w) //----------------------------------------------------------------------------- void close_dlg_cb(Fl_Widget *, void *v) { ((Fl_Window *)v)->hide(); } //----------------------------------------------------------------------------- -void fname_cb(Fl_Widget*, void *v) -{ - ScriptWindow* e = (ScriptWindow*)v; - const char *file = mgl_file_chooser(_("Insert file name?")); - if(file) - { - char *str = new char[strlen(file)+4]; - snprintf(str,strlen(file)+4," '%s'",file); - e->editor->insert(str); - delete []str; - } -} //----------------------------------------------------------------------------- void new_cb(Fl_Widget*, void*) { @@ -249,10 +240,10 @@ void saveas_cb(Fl_Widget*, void *v) } //----------------------------------------------------------------------------- ScriptWindow *new_view(); -void view_cb(Fl_Widget*, void*) -{ Fl_Window* w = new_view(); w->show(); } +//void view_cb(Fl_Widget*, void*) +//{ Fl_Window* w = new_view(); w->show(); } //----------------------------------------------------------------------------- -void hint_cb(Fl_Widget*, void*) {} +// void hint_cb(Fl_Widget*, void*) {} void lastfile1_cb(Fl_Widget*, void *v) { if (!check_save()) return; load_file(lastfiles[0].c_str(),-1,(ScriptWindow*)v); } @@ -467,13 +458,14 @@ class PropDlg : public GeneralDlg Fl_Check_Button *highlight_w; Fl_Check_Button *mouse_zoom_w; Fl_Check_Button *use_thr_w; + Fl_Check_Button *dark_w; Fl_Choice *lang_w; Fl_Choice *scheme_w; public: PropDlg() : GeneralDlg() { Fl_Button *o; - w = new Fl_Double_Window(340, 390, _("Properties")); + w = new Fl_Double_Window(340, 415, _("Properties")); w->align(Fl_Align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE)); fkind = new Fl_Choice(75, 10, 90, 25, _("Font kind")); fkind->add("Helvetica"); fkind->add("Courier"); fkind->add("Times"); @@ -490,12 +482,13 @@ public: highlight_w = new Fl_Check_Button(5, 220, 330, 25, _("Highlight current object(s)")); mouse_zoom_w = new Fl_Check_Button(5, 245, 330, 25, _("Enable mouse wheel for zooming")); use_thr_w = new Fl_Check_Button(5, 270, 330, 25, _("Use multi-threading for drawing")); - lang_w = new Fl_Choice(160, 300, 175, 25, _("Language for mgllab")); + dark_w = new Fl_Check_Button(5, 295, 330, 25, _("Use dark color scheme")); + lang_w = new Fl_Choice(160, 325, 175, 25, _("Language for mgllab")); for(long i=0;iadd(loc[i]); - scheme_w = new Fl_Choice(160, 330, 175, 25, _("Widget scheme")); + scheme_w = new Fl_Choice(160, 355, 175, 25, _("Widget scheme")); scheme_w->add("base"); scheme_w->add("gtk+"); scheme_w->add("plastic"); scheme_w->add("gleam"); - o = new Fl_Button(85, 360, 75, 25, _("Cancel")); o->callback(cb_dlg_cancel,this); - o = new Fl_Return_Button(180, 360, 75, 25, _("OK")); o->callback(cb_dlg_ok,this); + o = new Fl_Button(85, 385, 75, 25, _("Cancel")); o->callback(cb_dlg_cancel,this); + o = new Fl_Return_Button(180, 385, 75, 25, _("OK")); o->callback(cb_dlg_ok,this); w->set_modal(); w->end(); } void init() @@ -512,10 +505,10 @@ public: use_thr_w->value(use_thr); lang_w->value(lang); scheme_w->value(scheme); + dark_w->value(dark); } void cb_ok() { - set_style(fkind->value(),fsize->value()); auto_exec = auto_exec_w->value(); exec_save = exec_save_w->value(); highlight = highlight_w->value(); @@ -524,6 +517,8 @@ public: use_thr = use_thr_w->value(); docdir = help_path->value(); fontname = font_path->value(); + dark = dark_w->value(); + set_style(fkind->value(),fsize->value(),dark); if(e->graph->get_graph()) mgl_load_font(e->graph->get_graph(),fontname.c_str(),NULL); set_scheme_lang(scheme_w->value(),lang_w->value()); // NOTE: must be after setting docdir diff --git a/mgllab/mgllab.h b/mgllab/mgllab.h index f6f2886..67cdf93 100644 --- a/mgllab/mgllab.h +++ b/mgllab/mgllab.h @@ -2,7 +2,7 @@ * Copyright (C) 2007-2014 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 + * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, @@ -68,9 +68,10 @@ extern int scheme; ///< FLTK scheme extern int font_kind; ///< Editor font kind extern int font_size; ///< Editor font size extern int complete_word; ///< enable word completion +extern int dark; ///< use dark color scheme //----------------------------------------------------------------------------- void set_scheme_lang(int s, int l); ///< Set FLTK scheme and locale -void set_style(int fkind, int fsize); ///< Change the style of highlight +void set_style(int fkind, int fsize, int fdark); ///< Change the style of highlight void style_init(); ///< Initialize the style buffer void save_pref(); ///< Apply and save preferences void load_pref(); ///< Load preferences diff --git a/mgllab/mgllab.rc b/mgllab/mgllab.rc index 56a99a9..1cdcb9d 100644 --- a/mgllab/mgllab.rc +++ b/mgllab/mgllab.rc @@ -2,7 +2,7 @@ * 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 + * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, diff --git a/mgllab/table.cpp b/mgllab/table.cpp index 65400c2..2ed7171 100644 --- a/mgllab/table.cpp +++ b/mgllab/table.cpp @@ -2,7 +2,7 @@ * Copyright (C) 2007-2014 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 + * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, @@ -382,7 +382,7 @@ public: case 0: *out = c->Sum(r); break; case 1: *out = c->Max(r); break; case 2: *out = c->Min(r); break; - case 3: out = mgl_data_pulse(c,*r); break; + case 3: *out = mglData(true,mgl_data_pulse(c,*r)); break; } hide(); } @@ -559,8 +559,8 @@ public: o->tooltip(_("Change data values and close this window")); w->set_modal(); w->end(); } - double min() { return wmin->value(); } - double max() { return wmax->value(); } + double vmin() { return wmin->value(); } + double vmax() { return wmax->value(); } int sym() { return wsym->value(); } bool ok() { return !result.empty(); } void cb_ok() @@ -581,8 +581,8 @@ void fill_cb(Fl_Widget*, void*v) HMDT d = dynamic_cast(e->var); HADT c = dynamic_cast(e->var); char ch = nrm_dlg.result[0]; - if(d) { d->Fill(nrm_dlg.min(),nrm_dlg.max(),ch); e->refresh(); } - if(c) { c->Fill(nrm_dlg.min(),nrm_dlg.max(),ch); e->refresh(); } + if(d) { d->Fill(nrm_dlg.vmin(),nrm_dlg.vmax(),ch); e->refresh(); } + if(c) { c->Fill(nrm_dlg.vmin(),nrm_dlg.vmax(),ch); e->refresh(); } } } //----------------------------------------------------------------------------- @@ -594,8 +594,8 @@ void normal_cb(Fl_Widget*, void*v) { HMDT d = dynamic_cast(e->var); HADT c = dynamic_cast(e->var); - if(d) { d->Norm(nrm_dlg.min(),nrm_dlg.max(),nrm_dlg.sym()); e->refresh(); } - if(c) { c->Fill(nrm_dlg.min(),nrm_dlg.max(),nrm_dlg.sym()); e->refresh(); } + if(d) { d->Norm(nrm_dlg.vmin(),nrm_dlg.vmax(),nrm_dlg.sym()); e->refresh(); } + if(c) { c->Fill(nrm_dlg.vmin(),nrm_dlg.vmax(),nrm_dlg.sym()); e->refresh(); } } } //----------------------------------------------------------------------------- diff --git a/mgllab/xpm/arc.xpm b/mgllab/xpm/arc.xpm index 28f80a1..3416cf1 100644 --- a/mgllab/xpm/arc.xpm +++ b/mgllab/xpm/arc.xpm @@ -2,7 +2,7 @@ static const char * arc_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ...... ", " .. .. ", " . . ", diff --git a/mgllab/xpm/arrow_a.xpm b/mgllab/xpm/arrow_a.xpm index 457c0aa..f841dd4 100644 --- a/mgllab/xpm/arrow_a.xpm +++ b/mgllab/xpm/arrow_a.xpm @@ -2,7 +2,7 @@ static const char * arrow_a_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/arrow_d.xpm b/mgllab/xpm/arrow_d.xpm index 834f703..fa5ae6e 100644 --- a/mgllab/xpm/arrow_d.xpm +++ b/mgllab/xpm/arrow_d.xpm @@ -2,7 +2,7 @@ static const char * arrow_d_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/arrow_i.xpm b/mgllab/xpm/arrow_i.xpm index a8c617e..3bc2959 100644 --- a/mgllab/xpm/arrow_i.xpm +++ b/mgllab/xpm/arrow_i.xpm @@ -2,7 +2,7 @@ static const char * arrow_i_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " .. ", diff --git a/mgllab/xpm/arrow_k.xpm b/mgllab/xpm/arrow_k.xpm index 840d325..339201b 100644 --- a/mgllab/xpm/arrow_k.xpm +++ b/mgllab/xpm/arrow_k.xpm @@ -2,7 +2,7 @@ static const char * arrow_k_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " .. ", diff --git a/mgllab/xpm/arrow_n.xpm b/mgllab/xpm/arrow_n.xpm index 305238b..52f3587 100644 --- a/mgllab/xpm/arrow_n.xpm +++ b/mgllab/xpm/arrow_n.xpm @@ -2,7 +2,7 @@ static const char * arrow_n_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/arrow_o.xpm b/mgllab/xpm/arrow_o.xpm index 6f4b583..807fb0c 100644 --- a/mgllab/xpm/arrow_o.xpm +++ b/mgllab/xpm/arrow_o.xpm @@ -2,7 +2,7 @@ static const char * arrow_o_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/arrow_s.xpm b/mgllab/xpm/arrow_s.xpm index ddeeb7f..7bc2813 100644 --- a/mgllab/xpm/arrow_s.xpm +++ b/mgllab/xpm/arrow_s.xpm @@ -2,7 +2,7 @@ static const char * arrow_s_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/arrow_t.xpm b/mgllab/xpm/arrow_t.xpm index 71ff9dc..f6c1f91 100644 --- a/mgllab/xpm/arrow_t.xpm +++ b/mgllab/xpm/arrow_t.xpm @@ -2,7 +2,7 @@ static const char * arrow_t_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/arrow_v.xpm b/mgllab/xpm/arrow_v.xpm index 038a3e5..c5eb9c4 100644 --- a/mgllab/xpm/arrow_v.xpm +++ b/mgllab/xpm/arrow_v.xpm @@ -2,7 +2,7 @@ static const char * arrow_v_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/axis.xpm b/mgllab/xpm/axis.xpm index 65014f1..9be05e5 100644 --- a/mgllab/xpm/axis.xpm +++ b/mgllab/xpm/axis.xpm @@ -2,7 +2,7 @@ static const char * axis_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " .. ", " . ", diff --git a/mgllab/xpm/axis_sh.xpm b/mgllab/xpm/axis_sh.xpm index d09869f..775288f 100644 --- a/mgllab/xpm/axis_sh.xpm +++ b/mgllab/xpm/axis_sh.xpm @@ -2,7 +2,7 @@ static const char * axis_sh_xpm[] = { "16 16 3 1", " c None", -". c #000000", +". c #007f7f", "+ c #FF0000", " ", " . ", diff --git a/mgllab/xpm/barrow_a.xpm b/mgllab/xpm/barrow_a.xpm index 8545b8f..5753905 100644 --- a/mgllab/xpm/barrow_a.xpm +++ b/mgllab/xpm/barrow_a.xpm @@ -2,7 +2,7 @@ const char * barrow_a_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/barrow_d.xpm b/mgllab/xpm/barrow_d.xpm index fe133de..00c4262 100644 --- a/mgllab/xpm/barrow_d.xpm +++ b/mgllab/xpm/barrow_d.xpm @@ -2,7 +2,7 @@ const char * barrow_d_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/barrow_i.xpm b/mgllab/xpm/barrow_i.xpm index 54e91ad..e4104b3 100644 --- a/mgllab/xpm/barrow_i.xpm +++ b/mgllab/xpm/barrow_i.xpm @@ -2,7 +2,7 @@ const char * barrow_i_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " .. ", diff --git a/mgllab/xpm/barrow_k.xpm b/mgllab/xpm/barrow_k.xpm index be962b1..820c9a8 100644 --- a/mgllab/xpm/barrow_k.xpm +++ b/mgllab/xpm/barrow_k.xpm @@ -2,7 +2,7 @@ const char * barrow_k_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " .. ", diff --git a/mgllab/xpm/barrow_n.xpm b/mgllab/xpm/barrow_n.xpm index 7d2b54c..c5c54d6 100644 --- a/mgllab/xpm/barrow_n.xpm +++ b/mgllab/xpm/barrow_n.xpm @@ -2,7 +2,7 @@ const char * barrow_n_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/barrow_o.xpm b/mgllab/xpm/barrow_o.xpm index a0ea264..86601ce 100644 --- a/mgllab/xpm/barrow_o.xpm +++ b/mgllab/xpm/barrow_o.xpm @@ -2,7 +2,7 @@ const char * barrow_o_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/barrow_s.xpm b/mgllab/xpm/barrow_s.xpm index f19c4d8..08af6b5 100644 --- a/mgllab/xpm/barrow_s.xpm +++ b/mgllab/xpm/barrow_s.xpm @@ -2,7 +2,7 @@ const char * barrow_s_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/barrow_t.xpm b/mgllab/xpm/barrow_t.xpm index 06e23d5..3045694 100644 --- a/mgllab/xpm/barrow_t.xpm +++ b/mgllab/xpm/barrow_t.xpm @@ -2,7 +2,7 @@ const char * barrow_t_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/barrow_v.xpm b/mgllab/xpm/barrow_v.xpm index b31d4d2..3b54b24 100644 --- a/mgllab/xpm/barrow_v.xpm +++ b/mgllab/xpm/barrow_v.xpm @@ -2,7 +2,7 @@ const char * barrow_v_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/box.xpm b/mgllab/xpm/box.xpm index 23260d1..a60f054 100644 --- a/mgllab/xpm/box.xpm +++ b/mgllab/xpm/box.xpm @@ -1,22 +1,23 @@ /* XPM */ static const char * box_xpm[] = { -"16 16 3 1", +"16 16 4 1", " c None", ". c #000000", "+ c #666666", +"= c #ffffff", " ", " ......... ", -" .+ .. ", -" . + . . ", -" . + . . ", -" . + . . ", -" ......... . ", -" . + . . ", -" . + . . ", -" . +++.++++. ", -" . + . . ", -" . + . . ", -" . + . . ", -" .+ .. ", +" .+======.. ", +" .=+=====.=. ", +" .==+====.==. ", +" .===+===.===. ", +" .........====. ", +" .====+==.====. ", +" .====+==.====. ", +" .====+++.++++. ", +" .===+===.===. ", +" .==+====.==. ", +" .=+=====.=. ", +" .+======.. ", " ......... ", " "}; diff --git a/mgllab/xpm/crop.xpm b/mgllab/xpm/crop.xpm index e18a730..474cf18 100644 --- a/mgllab/xpm/crop.xpm +++ b/mgllab/xpm/crop.xpm @@ -2,7 +2,7 @@ static const char * crop_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " . ", " ", diff --git a/mgllab/xpm/curve.xpm b/mgllab/xpm/curve.xpm index 88e37e3..eb613c8 100644 --- a/mgllab/xpm/curve.xpm +++ b/mgllab/xpm/curve.xpm @@ -2,7 +2,7 @@ static const char * curve_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .", " .", " . ", diff --git a/mgllab/xpm/dash_d.xpm b/mgllab/xpm/dash_d.xpm index 6892ce6..f2e4e72 100644 --- a/mgllab/xpm/dash_d.xpm +++ b/mgllab/xpm/dash_d.xpm @@ -2,7 +2,7 @@ static const char * dash_d_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/dash_e.xpm b/mgllab/xpm/dash_e.xpm index 13eaf63..97db0c5 100644 --- a/mgllab/xpm/dash_e.xpm +++ b/mgllab/xpm/dash_e.xpm @@ -2,7 +2,7 @@ static const char * dash_e_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/dash_i.xpm b/mgllab/xpm/dash_i.xpm index 2ad1f1c..f012469 100644 --- a/mgllab/xpm/dash_i.xpm +++ b/mgllab/xpm/dash_i.xpm @@ -2,7 +2,7 @@ static const char * dash_i_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/dash_j.xpm b/mgllab/xpm/dash_j.xpm index 70a9cc4..c5ffeb3 100644 --- a/mgllab/xpm/dash_j.xpm +++ b/mgllab/xpm/dash_j.xpm @@ -2,7 +2,7 @@ static const char * dash_j_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/dash_l.xpm b/mgllab/xpm/dash_l.xpm index 4346c08..f735a73 100644 --- a/mgllab/xpm/dash_l.xpm +++ b/mgllab/xpm/dash_l.xpm @@ -2,7 +2,7 @@ static const char * dash_l_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/dash_m.xpm b/mgllab/xpm/dash_m.xpm index 7cd2b39..83a3794 100644 --- a/mgllab/xpm/dash_m.xpm +++ b/mgllab/xpm/dash_m.xpm @@ -2,7 +2,7 @@ static const char * dash_m_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/dash_s.xpm b/mgllab/xpm/dash_s.xpm index 4edb6c5..92d9a11 100644 --- a/mgllab/xpm/dash_s.xpm +++ b/mgllab/xpm/dash_s.xpm @@ -2,7 +2,7 @@ static const char * dash_s_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/delete.xpm b/mgllab/xpm/delete.xpm index a191ea2..14158c6 100644 --- a/mgllab/xpm/delete.xpm +++ b/mgllab/xpm/delete.xpm @@ -1,21 +1,22 @@ /* XPM */ static const char * delete_xpm[] = { -"16 16 2 1", +"16 16 3 1", " c none", ". c #000000", +"= c #afafaf", " ", " ", " ", -" ... ... ", -" ... ... ", -" ... ... ", -" ...... ", -" .... ", -" .... ", -" ...... ", -" ... ... ", -" ... ... ", -" ... ... ", +" .. .. ", +" .=. .=. ", +" .=. .=. ", +" .=..=. ", +" .==. ", +" .==. ", +" .=..=. ", +" .=. .=. ", +" .=. .=. ", +" .. .. ", " ", " ", " "}; diff --git a/mgllab/xpm/diff.xpm b/mgllab/xpm/diff.xpm index b90448a..7083646 100644 --- a/mgllab/xpm/diff.xpm +++ b/mgllab/xpm/diff.xpm @@ -2,7 +2,7 @@ static const char * diff_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " ", " .. ", diff --git a/mgllab/xpm/diff2.xpm b/mgllab/xpm/diff2.xpm index 7a2d7eb..283abc7 100644 --- a/mgllab/xpm/diff2.xpm +++ b/mgllab/xpm/diff2.xpm @@ -2,8 +2,8 @@ static const char * diff2_xpm[] = { "16 16 3 1", " c None", -". c #000000", -"+ c #7F7F7F", +". c #007f7f", +"+ c #7FaFaF", " ", " ", " ", diff --git a/mgllab/xpm/edit-find.xpm b/mgllab/xpm/edit-find.xpm index 02cbeb6..b53a144 100644 --- a/mgllab/xpm/edit-find.xpm +++ b/mgllab/xpm/edit-find.xpm @@ -1,7 +1,7 @@ /* XPM */ static const char *edit_find_xpm[] = { /* columns rows colors chars-per-pixel */ -"16 16 64 1 ", +"16 16 65 1 ", " c black", ". c #010101", "X c #040404", @@ -66,21 +66,22 @@ static const char *edit_find_xpm[] = { "S c #817E7D", "D c #AB917A", "F c None", +"E c #afafaf", /* pixels */ "FFFFFFFFFFFFFFFF", -"FFFFFFFFFFFFFFFF", -"FFFFF FF FFFFF", -"FFFF2z4FF4z2FFFF", -"FFF 88&&&&68 FFF", -"FF;b8s&zh&d8b;FF", -"F tdzed# dezdt F", -"F&zSn46;;62nSz&F", +"FFFFFEEFFEEFFFFF", +"FFFFE EE EFFFF", +"FFFE2z4EE4z2EFFF", +"FFE 88&&&&68 EFF", +"FE;b8s&zh&d8b;EF", +"E tdzed# dezdt E", +"E&zSn46;;62nSz&E", " hqupv:64:vp10g ", "OwiCVk; &kBZiqX", -" ,yiNl+FF#lNmu, ", -" 3jADp FF aDAj3 ", -"F #rO FFFF Or# F", -"FFFFFFFFFFFFFFFF", +" ,yiNl+EE#lNmu, ", +" 3jADp EE aDAj3 ", +"E #rO EFFE Or# E", +"FEEEEEFFFFEEEEEF", "FFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFF" }; diff --git a/mgllab/xpm/func.xpm b/mgllab/xpm/func.xpm index e62cfe7..dd73369 100644 --- a/mgllab/xpm/func.xpm +++ b/mgllab/xpm/func.xpm @@ -2,7 +2,7 @@ static const char * func_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " ", " ", diff --git a/mgllab/xpm/integr.xpm b/mgllab/xpm/integr.xpm index ddccb22..4bd93d2 100644 --- a/mgllab/xpm/integr.xpm +++ b/mgllab/xpm/integr.xpm @@ -1,9 +1,8 @@ /* XPM */ static const char * integr_xpm[] = { -"16 16 3 1", +"16 16 2 1", " c None", -". c #000000", -"+ c #808080", +". c #007f7f", " ", " ", " ", @@ -16,7 +15,7 @@ static const char * integr_xpm[] = { " . . . . ", " . . . . ", " . ... . . ", -" . + ", +" . ", " ", " ", " "}; diff --git a/mgllab/xpm/line.xpm b/mgllab/xpm/line.xpm index aff1af3..fc5d2f9 100644 --- a/mgllab/xpm/line.xpm +++ b/mgllab/xpm/line.xpm @@ -2,7 +2,7 @@ static const char * line_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .", " . ", " . ", diff --git a/mgllab/xpm/mark_.xpm b/mgllab/xpm/mark_.xpm index b372f5a..002fcf6 100644 --- a/mgllab/xpm/mark_.xpm +++ b/mgllab/xpm/mark_.xpm @@ -2,7 +2,7 @@ static const char * mark__xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/mark_a.xpm b/mgllab/xpm/mark_a.xpm index 29f34cb..04c5ac6 100644 --- a/mgllab/xpm/mark_a.xpm +++ b/mgllab/xpm/mark_a.xpm @@ -2,7 +2,7 @@ static const char * mark_a_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " . . ", " . . ", diff --git a/mgllab/xpm/mark_cf.xpm b/mgllab/xpm/mark_cf.xpm index f743a31..e2b24cd 100644 --- a/mgllab/xpm/mark_cf.xpm +++ b/mgllab/xpm/mark_cf.xpm @@ -2,7 +2,7 @@ static const char * mark_cf_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ...... ", " .. .. ", " . . ", diff --git a/mgllab/xpm/mark_d.xpm b/mgllab/xpm/mark_d.xpm index 678d75e..e3be025 100644 --- a/mgllab/xpm/mark_d.xpm +++ b/mgllab/xpm/mark_d.xpm @@ -2,7 +2,7 @@ static const char * mark_d_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " . . ", " . . ", diff --git a/mgllab/xpm/mark_df.xpm b/mgllab/xpm/mark_df.xpm index 582d420..a6e73ed 100644 --- a/mgllab/xpm/mark_df.xpm +++ b/mgllab/xpm/mark_df.xpm @@ -2,7 +2,7 @@ static const char * mark_df_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " .... ", " ...... ", diff --git a/mgllab/xpm/mark_l.xpm b/mgllab/xpm/mark_l.xpm index 9edd3e0..f3aa869 100644 --- a/mgllab/xpm/mark_l.xpm +++ b/mgllab/xpm/mark_l.xpm @@ -2,7 +2,7 @@ static const char * mark_l_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " .. . ", " . . ", diff --git a/mgllab/xpm/mark_lf.xpm b/mgllab/xpm/mark_lf.xpm index 2585eb4..9c8b3fa 100644 --- a/mgllab/xpm/mark_lf.xpm +++ b/mgllab/xpm/mark_lf.xpm @@ -2,7 +2,7 @@ static const char * mark_lf_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " .... ", " ..... ", diff --git a/mgllab/xpm/mark_o.xpm b/mgllab/xpm/mark_o.xpm index 3154cdc..bc9874a 100644 --- a/mgllab/xpm/mark_o.xpm +++ b/mgllab/xpm/mark_o.xpm @@ -2,7 +2,7 @@ static const char * mark_o_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ...... ", " .. .. ", " . . ", diff --git a/mgllab/xpm/mark_of.xpm b/mgllab/xpm/mark_of.xpm index 3eeaf38..a3fa739 100644 --- a/mgllab/xpm/mark_of.xpm +++ b/mgllab/xpm/mark_of.xpm @@ -2,7 +2,7 @@ static const char * mark_of_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ...... ", " .......... ", " ............ ", diff --git a/mgllab/xpm/mark_p.xpm b/mgllab/xpm/mark_p.xpm index 3f40cfb..c48b2f1 100644 --- a/mgllab/xpm/mark_p.xpm +++ b/mgllab/xpm/mark_p.xpm @@ -2,7 +2,7 @@ static const char * mark_p_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " . ", " . ", " . ", diff --git a/mgllab/xpm/mark_pf.xpm b/mgllab/xpm/mark_pf.xpm index ea9cdac..1b85e50 100644 --- a/mgllab/xpm/mark_pf.xpm +++ b/mgllab/xpm/mark_pf.xpm @@ -2,7 +2,7 @@ static const char * mark_pf_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", "................", ". . .", ". . .", diff --git a/mgllab/xpm/mark_r.xpm b/mgllab/xpm/mark_r.xpm index 8459014..3c8c49b 100644 --- a/mgllab/xpm/mark_r.xpm +++ b/mgllab/xpm/mark_r.xpm @@ -2,7 +2,7 @@ static const char * mark_r_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " . .. ", " . . ", diff --git a/mgllab/xpm/mark_rf.xpm b/mgllab/xpm/mark_rf.xpm index cedcd01..844e2cd 100644 --- a/mgllab/xpm/mark_rf.xpm +++ b/mgllab/xpm/mark_rf.xpm @@ -2,7 +2,7 @@ static const char * mark_rf_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " .... ", " ..... ", diff --git a/mgllab/xpm/mark_s.xpm b/mgllab/xpm/mark_s.xpm index 1a4c012..c4fab4f 100644 --- a/mgllab/xpm/mark_s.xpm +++ b/mgllab/xpm/mark_s.xpm @@ -2,7 +2,7 @@ static const char * mark_s_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", "................", ". .", ". .", diff --git a/mgllab/xpm/mark_sf.xpm b/mgllab/xpm/mark_sf.xpm index 5a89f1d..b132874 100644 --- a/mgllab/xpm/mark_sf.xpm +++ b/mgllab/xpm/mark_sf.xpm @@ -2,7 +2,7 @@ static const char * mark_sf_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", "................", "................", "................", diff --git a/mgllab/xpm/mark_t.xpm b/mgllab/xpm/mark_t.xpm index 1e6b398..5148539 100644 --- a/mgllab/xpm/mark_t.xpm +++ b/mgllab/xpm/mark_t.xpm @@ -2,7 +2,7 @@ static const char * mark_t_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " . . ", " . . ", diff --git a/mgllab/xpm/mark_tf.xpm b/mgllab/xpm/mark_tf.xpm index 48f61c1..964c45a 100644 --- a/mgllab/xpm/mark_tf.xpm +++ b/mgllab/xpm/mark_tf.xpm @@ -2,7 +2,7 @@ static const char * mark_tf_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " .. ", " .... ", " ...... ", diff --git a/mgllab/xpm/mark_v.xpm b/mgllab/xpm/mark_v.xpm index 9f03771..9c09de0 100644 --- a/mgllab/xpm/mark_v.xpm +++ b/mgllab/xpm/mark_v.xpm @@ -2,7 +2,7 @@ static const char * mark_v_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/mark_vf.xpm b/mgllab/xpm/mark_vf.xpm index 39d7e99..e2f5235 100644 --- a/mgllab/xpm/mark_vf.xpm +++ b/mgllab/xpm/mark_vf.xpm @@ -2,7 +2,7 @@ static const char * mark_vf_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " ", diff --git a/mgllab/xpm/mark_x.xpm b/mgllab/xpm/mark_x.xpm index 8d7ee78..ad17eb9 100644 --- a/mgllab/xpm/mark_x.xpm +++ b/mgllab/xpm/mark_x.xpm @@ -2,7 +2,7 @@ static const char * mark_x_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", ". .", " . . ", " . . ", diff --git a/mgllab/xpm/mark_y.xpm b/mgllab/xpm/mark_y.xpm index b5135fd..958cb39 100644 --- a/mgllab/xpm/mark_y.xpm +++ b/mgllab/xpm/mark_y.xpm @@ -2,7 +2,7 @@ static const char * mark_y_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " . . ", diff --git a/mgllab/xpm/mask_a.xpm b/mgllab/xpm/mask_a.xpm index 6949dd9..4893723 100644 --- a/mgllab/xpm/mask_a.xpm +++ b/mgllab/xpm/mask_a.xpm @@ -2,7 +2,7 @@ static const char *mask_a_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "##............##", "##............##", "..##........##..", diff --git a/mgllab/xpm/mask_d.xpm b/mgllab/xpm/mask_d.xpm index dc7f66d..6c96ab9 100644 --- a/mgllab/xpm/mask_d.xpm +++ b/mgllab/xpm/mask_d.xpm @@ -2,7 +2,7 @@ static const char *mask_d_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "........##......", diff --git a/mgllab/xpm/mask_d_.xpm b/mgllab/xpm/mask_d_.xpm index d3eee46..99e8d03 100644 --- a/mgllab/xpm/mask_d_.xpm +++ b/mgllab/xpm/mask_d_.xpm @@ -2,7 +2,7 @@ static const char *mask_D_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "........##......", diff --git a/mgllab/xpm/mask_e.xpm b/mgllab/xpm/mask_e.xpm index 2e6b528..f729a1d 100644 --- a/mgllab/xpm/mask_e.xpm +++ b/mgllab/xpm/mask_e.xpm @@ -2,7 +2,7 @@ static const char *mask_e_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/mgllab/xpm/mask_i.xpm b/mgllab/xpm/mask_i.xpm index a24c1ca..ee9cff6 100644 --- a/mgllab/xpm/mask_i.xpm +++ b/mgllab/xpm/mask_i.xpm @@ -2,7 +2,7 @@ static const char *mask_i_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/mgllab/xpm/mask_j.xpm b/mgllab/xpm/mask_j.xpm index fcc072f..7e8eadc 100644 --- a/mgllab/xpm/mask_j.xpm +++ b/mgllab/xpm/mask_j.xpm @@ -2,7 +2,7 @@ static const char *mask_j_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/mgllab/xpm/mask_l.xpm b/mgllab/xpm/mask_l.xpm index a062db6..17335f4 100644 --- a/mgllab/xpm/mask_l.xpm +++ b/mgllab/xpm/mask_l.xpm @@ -2,7 +2,7 @@ static const char *mask_l_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "..........####..", diff --git a/mgllab/xpm/mask_m.xpm b/mgllab/xpm/mask_m.xpm index e717d96..de4f308 100644 --- a/mgllab/xpm/mask_m.xpm +++ b/mgllab/xpm/mask_m.xpm @@ -2,7 +2,7 @@ static const char *mask_m_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/mgllab/xpm/mask_o.xpm b/mgllab/xpm/mask_o.xpm index 3664bc4..f9b9fa3 100644 --- a/mgllab/xpm/mask_o.xpm +++ b/mgllab/xpm/mask_o.xpm @@ -2,7 +2,7 @@ static const char *mask_o_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/mgllab/xpm/mask_o_.xpm b/mgllab/xpm/mask_o_.xpm index fbecff8..211df44 100644 --- a/mgllab/xpm/mask_o_.xpm +++ b/mgllab/xpm/mask_o_.xpm @@ -2,7 +2,7 @@ static const char *mask_O_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/mgllab/xpm/mask_p.xpm b/mgllab/xpm/mask_p.xpm index d29f774..a49e027 100644 --- a/mgllab/xpm/mask_p.xpm +++ b/mgllab/xpm/mask_p.xpm @@ -2,7 +2,7 @@ static const char *mask_p_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "........##......", "........##......", "........##......", diff --git a/mgllab/xpm/mask_r.xpm b/mgllab/xpm/mask_r.xpm index 47f2aa5..2459137 100644 --- a/mgllab/xpm/mask_r.xpm +++ b/mgllab/xpm/mask_r.xpm @@ -2,7 +2,7 @@ static const char *mask_r_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "..####..........", diff --git a/mgllab/xpm/mask_s.xpm b/mgllab/xpm/mask_s.xpm index a5e1e82..b83be52 100644 --- a/mgllab/xpm/mask_s.xpm +++ b/mgllab/xpm/mask_s.xpm @@ -2,7 +2,7 @@ static const char *mask_s_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/mgllab/xpm/mask_s_.xpm b/mgllab/xpm/mask_s_.xpm index 652db36..2ff6574 100644 --- a/mgllab/xpm/mask_s_.xpm +++ b/mgllab/xpm/mask_s_.xpm @@ -2,7 +2,7 @@ static const char *mask_S_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/mgllab/xpm/mask_t.xpm b/mgllab/xpm/mask_t.xpm index d153fc8..5052969 100644 --- a/mgllab/xpm/mask_t.xpm +++ b/mgllab/xpm/mask_t.xpm @@ -2,7 +2,7 @@ static const char *mask_t_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/mgllab/xpm/mask_u.xpm b/mgllab/xpm/mask_u.xpm index 61996fc..6873046 100644 --- a/mgllab/xpm/mask_u.xpm +++ b/mgllab/xpm/mask_u.xpm @@ -2,7 +2,7 @@ static const char *mask_u_xpm[]={ "16 16 2 1", ". c None", -"# c #000000", +"# c #007f00", "................", "................", "................", diff --git a/mgllab/xpm/none.xpm b/mgllab/xpm/none.xpm index e81575f..3ca0ca5 100644 --- a/mgllab/xpm/none.xpm +++ b/mgllab/xpm/none.xpm @@ -2,7 +2,7 @@ static const char * none_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", "................", ".. ..", ". . . .", diff --git a/mgllab/xpm/oper.xpm b/mgllab/xpm/oper.xpm index ca6a51d..c4939d0 100644 --- a/mgllab/xpm/oper.xpm +++ b/mgllab/xpm/oper.xpm @@ -2,7 +2,7 @@ static const char * oper_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " . ", " . ", diff --git a/mgllab/xpm/oper_a.xpm b/mgllab/xpm/oper_a.xpm index afa1a80..ddf42bc 100644 --- a/mgllab/xpm/oper_a.xpm +++ b/mgllab/xpm/oper_a.xpm @@ -2,7 +2,7 @@ static const char * oper_a_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " ", " ", diff --git a/mgllab/xpm/oper_d.xpm b/mgllab/xpm/oper_d.xpm index 2b89d5e..ff8bd60 100644 --- a/mgllab/xpm/oper_d.xpm +++ b/mgllab/xpm/oper_d.xpm @@ -2,7 +2,7 @@ static const char * oper_d_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " ", " ", diff --git a/mgllab/xpm/oper_dir.xpm b/mgllab/xpm/oper_dir.xpm index f6f7b8a..0a3f03c 100644 --- a/mgllab/xpm/oper_dir.xpm +++ b/mgllab/xpm/oper_dir.xpm @@ -2,7 +2,7 @@ static const char * oper_dir_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " . ", " . . ", " . . ", diff --git a/mgllab/xpm/oper_m.xpm b/mgllab/xpm/oper_m.xpm index f2f8db1..5eb90f1 100644 --- a/mgllab/xpm/oper_m.xpm +++ b/mgllab/xpm/oper_m.xpm @@ -2,8 +2,8 @@ static const char * oper_m_xpm[] = { "16 16 3 1", " c None", -". c #000000", -"+ c #7F7F7F", +". c #007f7f", +"+ c #7FAFAF", " ", " ", " ", diff --git a/mgllab/xpm/oper_of.xpm b/mgllab/xpm/oper_of.xpm index c22a9ba..be3e169 100644 --- a/mgllab/xpm/oper_of.xpm +++ b/mgllab/xpm/oper_of.xpm @@ -2,7 +2,7 @@ static const char * oper_of_xpm[] = { "16 16 3 1", " c None", -". c #000000", +". c #007f7f", "+ c #FF0000", " . ++ ", " . . ++ ", diff --git a/mgllab/xpm/oper_s.xpm b/mgllab/xpm/oper_s.xpm index 6bda134..a83db2a 100644 --- a/mgllab/xpm/oper_s.xpm +++ b/mgllab/xpm/oper_s.xpm @@ -2,7 +2,7 @@ static const char * oper_s_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " ", " ", diff --git a/mgllab/xpm/option.xpm b/mgllab/xpm/option.xpm index d7dd6d6..3ef30d8 100644 --- a/mgllab/xpm/option.xpm +++ b/mgllab/xpm/option.xpm @@ -2,8 +2,8 @@ static const char * option_xpm[] = { "16 16 3 1", " c None", -". c #000000", -"+ c #7F0000", +". c #7f0000", +"+ c #FF0000", " ", " ", " ", diff --git a/mgllab/xpm/pause.xpm b/mgllab/xpm/pause.xpm index e09d88b..e2421eb 100644 --- a/mgllab/xpm/pause.xpm +++ b/mgllab/xpm/pause.xpm @@ -2,7 +2,7 @@ static const char * pause_xpm[] = { "16 16 3 1", " c None", -". c #777777", +". c #afafaf", "q c #000000", " ", " ", diff --git a/mgllab/xpm/plot.xpm b/mgllab/xpm/plot.xpm index acc1eea..70bb211 100644 --- a/mgllab/xpm/plot.xpm +++ b/mgllab/xpm/plot.xpm @@ -2,7 +2,7 @@ static const char * plot_xpm[] = { "16 16 4 1", " c None", -". c #000000", +". c #007f7f", "+ c #0000FF", "@ c #FF0000", " ", diff --git a/mgllab/xpm/polygon.xpm b/mgllab/xpm/polygon.xpm index ecbdb8f..6941429 100644 --- a/mgllab/xpm/polygon.xpm +++ b/mgllab/xpm/polygon.xpm @@ -2,7 +2,7 @@ static const char *polygon_xpm[]={ "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " .. ", " . . ", diff --git a/mgllab/xpm/size.xpm b/mgllab/xpm/size.xpm index 3a1d846..be90e12 100644 --- a/mgllab/xpm/size.xpm +++ b/mgllab/xpm/size.xpm @@ -2,7 +2,7 @@ static const char * size_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ", " .............. ", diff --git a/mgllab/xpm/squize.xpm b/mgllab/xpm/squize.xpm index fa68e6a..25aeb58 100644 --- a/mgllab/xpm/squize.xpm +++ b/mgllab/xpm/squize.xpm @@ -2,8 +2,8 @@ static const char * squize_xpm[] = { "16 16 3 1", " c None", -". c #000000", -"+ c #7F7F7F", +". c #007f00", +"+ c #7FFF7F", " ", " ", " ...... ", diff --git a/mgllab/xpm/text.xpm b/mgllab/xpm/text.xpm index 56317c0..137dcb2 100644 --- a/mgllab/xpm/text.xpm +++ b/mgllab/xpm/text.xpm @@ -2,7 +2,7 @@ static const char * text_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f00", " ", " ............ ", " ............ ", diff --git a/mgllab/xpm/update.xpm b/mgllab/xpm/update.xpm index 5ee1dd6..c7f53d2 100644 --- a/mgllab/xpm/update.xpm +++ b/mgllab/xpm/update.xpm @@ -2,7 +2,7 @@ static const char *update_xpm[] = { "16 16 2 1", " c None", -". c #00007F", +". c #007ffF", " ", " ", " .... ", diff --git a/mgllab/xpm/wire.xpm b/mgllab/xpm/wire.xpm index b67d50b..6996fa5 100644 --- a/mgllab/xpm/wire.xpm +++ b/mgllab/xpm/wire.xpm @@ -2,7 +2,7 @@ static const char * wire_xpm[] = { "16 16 2 1", " c None", -". c #000000", +". c #007f7f", " ", " ", " ", diff --git a/scripts/MathGLConfig.cmake.in b/scripts/MathGLConfig.cmake.in index 79ac30a..141a53d 100644 --- a/scripts/MathGLConfig.cmake.in +++ b/scripts/MathGLConfig.cmake.in @@ -8,6 +8,19 @@ set(MathGL2_HAVE_QT4 "@enable-qt4@") set(MathGL2_HAVE_WX "@enable-wx@") set(MathGL2_HAVE_FLTK "@enable-fltk@") set(MathGL2_HAVE_GLUT "@enable-glut@") +set(MathGL2_HAVE_PTHREAD "@CMAKE_USE_PTHREADS_INIT@") +set(MathGL2_HAVE_OPENMP "@OPENMP_FOUND@") + +include(CMakeFindDependencyMacro) +# Adding dependency for Threads imported target +if (MathGL2_HAVE_PTHREAD STRGREATER "") + find_dependency(Threads) +endif() + +# Adding dependency for OpenMP imported target +if (MathGL2_HAVE_OPENMP STRGREATER "") + find_dependency(OpenMP) +endif() # Compute paths get_filename_component(MathGL2_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ae6b0bd..d44125c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,7 +5,7 @@ set(mgl_src export_2d.cpp export_3d.cpp eval.cpp evalp.cpp export.cpp fit.cpp font.cpp obj.cpp other.cpp parser.cpp pde.cpp pixel.cpp pixel_gen.cpp plot.cpp prim.cpp surf.cpp vect.cpp volume.cpp evalc.cpp - s_hull/s_hull_pro.cpp window.cpp fractal.cpp + s_hull/s_hull_pro.cpp window.cpp fractal.cpp random.cpp exec_dat.cpp exec_gr.cpp exec_set.cpp exec_prm.cpp c2mdual.c ) diff --git a/src/addon.cpp b/src/addon.cpp index 8783dcd..04bcbf9 100644 --- a/src/addon.cpp +++ b/src/addon.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -135,11 +135,11 @@ void MGL_EXPORT mgl_info(const char *str, ...) fclose(fp); } //----------------------------------------------------------------------------- -MGL_EXPORT FILE *mgl_next_data(const char *fname,int p) +MGL_EXPORT FILE *mgl_next_data(const char *fname,long p) { char *s; - int len; - static int pos=0; + long len; + static long pos=0; static char path[256]; if(p>0) pos = p; @@ -184,24 +184,29 @@ void MGL_EXPORT mgl_difr_grid_old(dual *a,int n,int step,dual q,int Border,dual { default: case 0: // zero at border + case 'z': b[0] = 0; b[n-1] = 0; break; case 1: // constant at border b[0] = b[1]; b[n-1] = b[n-2]; break; case 2: // linear at border + case 'l': b[0] = mreal(2)*b[1]-b[2]; b[n-1] = mreal(2)*b[n-2]-b[n-3]; break; case 3: // square at border + case 's': b[0] = b[3]+mreal(3)*(b[1]-b[2]); b[n-1] = b[n-4]+mreal(3)*(b[n-2]-b[n-3]); break; case -1: // exponent at border case 4: + case 'e': b[0] = norm(b[2]) * * * * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -278,7 +278,7 @@ void mglCanvas::SetTickTime(char dir, mreal d, const char *t) } } //----------------------------------------------------------------------------- -void mglCanvas::AdjustTicks(const char *dir, bool force, std::string stl) +void mglCanvas::AdjustTicks(const char *dir, bool force, const std::string &stl) { if(force) SetTuneTicks(3); UpdateAxis(); @@ -483,7 +483,6 @@ void mglCanvas::Axis(const char *dir, const char *stl, const char *opt) mreal angl = SaveState(opt); AdjustTicks(dir,mglchr(stl,'a'),Tstl); - LoadState(); ax.pos = strchr(dir,'X') ? 'T':'t'; ay.pos = strchr(dir,'Y') ? 'T':'t'; @@ -505,6 +504,7 @@ void mglCanvas::Axis(const char *dir, const char *stl, const char *opt) else if(strchr(dir,'Y') || strchr(dir,'y')) { ay.inv = inv; DrawAxis(ay, text, arr, stl, angl); } set(ret, MGL_ENABLE_RTEXT); + LoadState(); } //----------------------------------------------------------------------------- void mglCanvas::DrawAxis(mglAxis &aa, int text, char arr,const char *stl,mreal angl) @@ -1056,6 +1056,7 @@ void mglCanvas::Colorbar(HCDT v, const char *sch, mreal x, mreal y, mreal w, mre void mglCanvas::colorbar(HCDT vv, const mreal *c, int where, mreal x, mreal y, mreal w, mreal h, bool text) { static int cgid=1; StartGroup("Colorbar",cgid++); + long n=vv->GetNx(); mreal s3=B.pf,ss=1/s3; // NOTE: colorbar was wider ss=0.9; mglPoint p1,p2; diff --git a/src/base.cpp b/src/base.cpp index 2c7c916..631a79f 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -20,6 +20,14 @@ #include "mgl2/font.h" #include "mgl2/base.h" #include "mgl2/eval.h" + +#if MGL_HAVE_FREETYPE +#include +#include FT_FREETYPE_H +#include FT_OUTLINE_H +#include FT_BBOX_H +#endif + #if MGL_HAVE_OMP #include #endif @@ -121,7 +129,9 @@ void MGL_EXPORT mgl_strlwr(char *str) //----------------------------------------------------------------------------- mglBase::mglBase() { + mgl_init(); Flag=0; saved=false; PrmInd=NULL; + limit_pm1 = false; #if MGL_HAVE_PTHREAD pthread_mutex_init(&mutexPnt,0); pthread_mutex_init(&mutexTxt,0); @@ -187,6 +197,7 @@ mglBase::~mglBase() #endif } //----------------------------------------------------------------------------- +void mglBase::SetFontHscale(mreal val) { fnt->HeightScale(val); } void mglBase::RestoreFont() { fnt->Restore(); } void mglBase::LoadFont(const char *name, const char *path) { if(name && *name) fnt->Load(name,path); else fnt->Restore(); } @@ -269,6 +280,117 @@ void mglBase::SetWarn(int code, const char *who) //----------------------------------------------------------------------------- // Add glyph to the buffer //----------------------------------------------------------------------------- +#if MGL_HAVE_FREETYPE +MGL_NO_EXPORT int mgl_glf_moveto(const FT_Vector *to, void *user) +{ + std::vector *a = (std::vector *)user; + if(a->size()>1) { a->push_back(NAN); a->push_back(NAN); } + a->push_back(to->x); a->push_back(to->y); + return 0; +} +MGL_NO_EXPORT int mgl_glf_lineto(const FT_Vector *to, void *user) +{ + std::vector *a = (std::vector *)user; + if(a->size()<2) { a->push_back(0); a->push_back(0); } + a->push_back(to->x); a->push_back(to->y); + return 0; +} +MGL_NO_EXPORT int mgl_glf_parabto(const FT_Vector *ctrl, const FT_Vector *to, void *user) +{ + std::vector *a = (std::vector *)user; + int x0=0,y0=0, x1=ctrl->x,y1=ctrl->y, x2=to->x,y2=to->y; + size_t n=a->size(); + if(n<2) { a->push_back(0); a->push_back(0); } + else { x0 = (*a)[n-2]; y0 = (*a)[n-1]; } + for(int i=1;i<=10;i++) + { + double t = 0.1*i; + a->push_back(x0*(1-t)*(1-t)+2*(1-t)*t*x1+t*t*x2); + a->push_back(y0*(1-t)*(1-t)+2*(1-t)*t*y1+t*t*y2); + } + return 0; +} +MGL_NO_EXPORT int mgl_glf_cubeto(const FT_Vector *ctrl1, const FT_Vector *ctrl2, const FT_Vector *to, void *user) +{ + std::vector *a = (std::vector *)user; + int x0=0,y0=0, x1=ctrl1->x,y1=ctrl1->y, x2=ctrl2->x,y2=ctrl2->y, x3=to->x,y3=to->y; + size_t n=a->size(); + if(n<2) { a->push_back(0); a->push_back(0); } + else { x0 = (*a)[n-2]; y0 = (*a)[n-1]; } + for(int i=1;i<=30;i++) + { + double t = 0.1*i; + a->push_back(x0*(1-t)*(1-t)*(1-t) + 3*(1-t)*t*(x1*(1-t)+t*x2) + t*t*t*x3); + a->push_back(y0*(1-t)*(1-t)*(1-t) + 3*(1-t)*t*(y1*(1-t)+t*y2) + t*t*t*y3); + } + return 0; +} +#endif +void mglGlyph::Load(wchar_t id, const char *fname) +{ +#if MGL_HAVE_FREETYPE + FT_Library m_ftLibrary; + if(FT_Init_FreeType(&m_ftLibrary)) + mgl_set_global_warn("Couldn't initialize the FreeType library."); + else + { + FT_Face m_face; + // For simplicity, always use the first face index. + if(FT_New_Face(m_ftLibrary, fname, 0, &m_face)) + mgl_set_global_warn("Couldn't load the font file."); + else + { + // For simplicity, use the charmap FreeType provides by default; + // in most cases this means Unicode. + FT_UInt index = FT_Get_Char_Index(m_face, id); + if(FT_Load_Glyph(m_face, index, FT_LOAD_NO_SCALE|FT_LOAD_NO_BITMAP)) + mgl_set_global_warn("Couldn't load the glyph."); + else + { + FT_GlyphSlot slot = m_face->glyph; + FT_Outline &outline = slot->outline; + + if(slot->format!=FT_GLYPH_FORMAT_OUTLINE || outline.n_contours <= 0 || outline.n_points <= 0 ||FT_Outline_Check(&outline)) + mgl_set_global_warn("Outline doesn't exist."); + else + { + const FT_Fixed multiplier = 32768L; + FT_Matrix matrix; + matrix.xx = matrix.yy = multiplier; + matrix.xy = matrix.yx = 0; + FT_Outline_Transform(&outline, &matrix); + + FT_Outline_Funcs callbacks; + callbacks.move_to = mgl_glf_moveto; + callbacks.line_to = mgl_glf_lineto; + callbacks.conic_to = mgl_glf_parabto; + callbacks.cubic_to = mgl_glf_cubeto; + callbacks.shift = 0; + callbacks.delta = 0; + std::vector xy_coor; + if(FT_Outline_Decompose(&outline, &callbacks, &xy_coor)) + mgl_set_global_warn("Couldn't extract the outline."); + nt = -id; // TODO optimize and copy points. Q: actual width? Q: cmp with known. + FT_BBox boundingBox; + FT_Outline_Get_BBox(&outline, &boundingBox); + FT_Pos xMin = boundingBox.xMin; + FT_Pos yMin = boundingBox.yMin; + FT_Pos xMax = boundingBox.xMax; + FT_Pos yMax = boundingBox.yMax; +/* m_xMin = xMin; + m_yMin = yMin; + m_width = xMax - xMin; + m_height = yMax - yMin;*/ + + } + } + FT_Done_Face(m_face); + } + } + FT_Done_FreeType(m_ftLibrary); +#endif +} +//----------------------------------------------------------------------------- void mglGlyph::Create(long Nt, long Nl) { // if(Nt<0 || Nl<0) return; @@ -374,7 +496,7 @@ static void mgl_coor_box(HMGL gr, mglPoint &p) mgl_put_inbox(gr->Min.y, gr->Max.y, p.y); mgl_put_inbox(gr->Min.z, gr->Max.z, p.z); } -long mglBase::AddPnt(const mglMatrix *mat, mglPoint p, mreal c, mglPoint n, mreal a, int scl) +long mglBase::AddPnt(const mglMatrix *mat, const mglPoint &p, mreal c, const mglPoint &n, mreal a, int scl) { mglPnt q; if(!AddPntQ(q,mat,p,c,n,a,scl)) return -1; @@ -455,7 +577,7 @@ bool mglBase::CopyNtoC(mglPnt &q, long from, mreal c) return mgl_isnum(q.x); } //----------------------------------------------------------------------------- -long mglBase::CopyProj(long from, mglPoint p, mglPoint n, short sub) +long mglBase::CopyProj(long from, const mglPoint &p, const mglPoint &n, short sub) { mglPnt q; if(!CopyProj(q,from,p,n,sub)) return -1; @@ -464,7 +586,7 @@ long mglBase::CopyProj(long from, mglPoint p, mglPoint n, short sub) {k=Pnt.size(); MGL_PUSH(Pnt,q,mutexPnt);} return k; } //----------------------------------------------------------------------------- -bool mglBase::CopyProj(mglPnt &q, long from, mglPoint p, mglPoint n, short sub) +bool mglBase::CopyProj(mglPnt &q, long from, const mglPoint &p, const mglPoint &n, short sub) { if(from<0) return false; q=Pnt[from]; q.sub = sub; @@ -659,6 +781,12 @@ bool mglBase::ScalePoint(const mglMatrix *, mglPoint &p, mglPoint &n, bool use_n if(fabs(x)>MGL_FEPSILON || fabs(y)>MGL_FEPSILON || fabs(z)>MGL_FEPSILON) res = false; if(!res && use_nan) x = NAN; // extra sign that point shouldn't be plotted + else if(limit_pm1) + { + x = x>1?1:(x<-1?-1:x); + y = y>1?1:(y<-1?-1:y); + z = z>1?1:(z<-1?-1:z); + } return res; } //----------------------------------------------------------------------------- @@ -693,7 +821,7 @@ void mglBase::SetOrigin(mreal x0, mreal y0, mreal z0, mreal c0) } } //----------------------------------------------------------------------------- -void mglBase::SetRanges(mglPoint m1, mglPoint m2) +void mglBase::SetRanges(const mglPoint &m1, const mglPoint &m2) { if(mgl_isrange(m1.x, m2.x)) { Min.x=m1.x; Max.x=m2.x; } if(mgl_isrange(m1.y, m2.y)) { Min.y=m1.y; Max.y=m2.y; } @@ -1431,7 +1559,7 @@ mreal mglBase::SaveState(const char *opt) s=q; q=strchr(s,';'); if(q) { *q=0; q++; } mgl_strtrim(s); char *a=s; - long n=mglFindArg(s); if(n>0) { s[n]=0; s=s+n+1; } + long n=mglFindArg(s); if(n>0) { s[n]=0; s=s+n+1; } mgl_strtrim(a); char *b=s; n=mglFindArg(s); if(n>0) { s[n]=0; s=s+n+1; } mgl_strtrim(b); @@ -1447,7 +1575,7 @@ mreal mglBase::SaveState(const char *opt) 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; } // Bad idea since there is formula for coloring +// NOTE! else if(a[0]=='c') { Min.c=ff; Max.c=ss; } // Bad idea since there is formula for coloring } else if(!strcmp(a,"cut")) SetCut(ff!=0); else if(!strcmp(a,"meshnum")) SetMeshNum(ff); diff --git a/src/base_cf.cpp b/src/base_cf.cpp index 2e69a02..0abb3ab 100644 --- a/src/base_cf.cpp +++ b/src/base_cf.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -77,17 +77,23 @@ int MGL_EXPORT_PURE mgl_get_warn(HMGL gr) { return gr->GetWarn(); } void MGL_EXPORT mgl_set_warn(HMGL gr, int code, const char *txt) { gr->SetWarn(code,txt); } extern bool mglPrintWarn; +extern MGL_EXPORT std::string *mglGlobalMess; ///< Buffer for receiving global messages void MGL_EXPORT mgl_set_global_warn(const char *txt) { if(txt && *txt) { - mglGlobalMess += txt; mglGlobalMess += '\n'; + *mglGlobalMess += txt; *mglGlobalMess += '\n'; if(mglPrintWarn) fprintf(stderr,_("Global message - %s\n"),txt); } } void MGL_EXPORT mgl_set_global_warn_(const char *txt, int l) { char *s=new char[l+1]; memcpy(s,txt,l); s[l]=0; mgl_set_global_warn(s); delete []s; } -MGL_EXPORT_PURE const char *mgl_get_global_warn() { return mglGlobalMess.c_str(); } +void MGL_EXPORT mgl_clear_global_warn() +{ *mglGlobalMess = ""; } +void MGL_EXPORT mgl_clear_global_warn_() +{ mgl_clear_global_warn(); } +MGL_EXPORT_PURE const char *mgl_get_global_warn() +{ return mglGlobalMess->empty()?"":mglGlobalMess->c_str(); } int MGL_EXPORT mgl_get_global_warn_(char *out, int len) { const char *res = mgl_get_global_warn(); @@ -206,6 +212,7 @@ void MGL_EXPORT mgl_set_scale_text(HMGL gr, int enable) { gr->set(!enable, MGL_ void MGL_EXPORT mgl_set_mark_size(HMGL gr, double size) { gr->SetMarkSize(size); } void MGL_EXPORT mgl_set_arrow_size(HMGL gr, double size) { gr->SetArrowSize(size); } void MGL_EXPORT mgl_set_font_size(HMGL gr, double size) { gr->SetFontSize(size); } +void MGL_EXPORT mgl_set_font_hscale(HMGL gr, double scale) { gr->SetFontHscale(scale); } void MGL_EXPORT mgl_set_font_def(HMGL gr, const char *fnt) { gr->SetFontDef(fnt); } void MGL_EXPORT mgl_load_font(HMGL gr, const char *name, const char *path) { gr->LoadFont(name,path); } @@ -219,6 +226,7 @@ void MGL_EXPORT mgl_set_scale_text_(uintptr_t *gr, int *enable) { mgl_set_scale_ void MGL_EXPORT mgl_set_mark_size_(uintptr_t *gr, mreal *size) { _GR_->SetMarkSize(*size); } void MGL_EXPORT mgl_set_arrow_size_(uintptr_t *gr, mreal *size) { _GR_->SetArrowSize(*size); } void MGL_EXPORT mgl_set_font_size_(uintptr_t *gr, mreal *size) { _GR_->SetFontSize(*size); } +void MGL_EXPORT mgl_set_font_hscale_(uintptr_t *gr, double *scale) { _GR_->SetFontHscale(*scale); } void MGL_EXPORT mgl_set_font_def_(uintptr_t *gr, const char *name, int l) { char *s=new char[l+1]; memcpy(s,name,l); s[l]=0; _GR_->SetFontDef(s); delete []s; } @@ -232,13 +240,13 @@ void MGL_EXPORT mgl_restore_font_(uintptr_t *gr) { _GR_->RestoreFont(); } void MGL_EXPORT mgl_define_symbol_(uintptr_t *gr, char *id, uintptr_t *x, uintptr_t *y, int) { _GR_->DefineGlyph(_DA_(x),_DA_(y),id?*id:0); } //----------------------------------------------------------------------------- -extern mglFont mglDefFont; +extern mglFont *mglDefFont; void MGL_EXPORT mgl_def_font(const char *name, const char *path) -{ mglDefFont.Load(name,path); } +{ mglDefFont->Load(name,path); } void MGL_EXPORT mgl_def_font_(const char *name, const 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; - mglDefFont.Load(name,path); delete []s; delete []d; } + mglDefFont->Load(name,path); delete []s; delete []d; } //----------------------------------------------------------------------------- int MGL_EXPORT mgl_check_version(const char *ver) { double v=0; int r = sscanf(ver,"2.%lg",&v); @@ -247,6 +255,11 @@ int MGL_EXPORT mgl_check_version_(const char *ver, int l) { char *s=new char[l+1]; memcpy(s,ver,l); s[l]=0; int r=mgl_check_version(s); delete []s; return r; } //----------------------------------------------------------------------------- +void MGL_EXPORT mgl_set_tex_parse(HMGL gr, int val) +{ gr->GetFont()->parse=val; } +void MGL_EXPORT mgl_set_tex_parse_(uintptr_t *gr, int *val) +{ _GR_->GetFont()->parse=*val; } +//----------------------------------------------------------------------------- void MGL_EXPORT mgl_start_group(HMGL gr, const char *s) { gr->StartAutoGroup(s); } void MGL_EXPORT mgl_end_group(HMGL gr) { gr->EndGroup(); } void MGL_EXPORT mgl_start_group_(uintptr_t *gr, const char *name,int l) diff --git a/src/canvas.cpp b/src/canvas.cpp index 3c5abbe..bc13bd0 100644 --- a/src/canvas.cpp +++ b/src/canvas.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -21,8 +21,6 @@ #include "mgl2/font.h" #include "mgl2/canvas.h" //----------------------------------------------------------------------------- -MGL_EXPORT std::string mglGlobalMess; ///< Buffer for receiving global messages -//----------------------------------------------------------------------------- mglCanvas::mglCanvas(int w, int h) : mglBase() { clr(MGL_DISABLE_SCALE); @@ -228,12 +226,12 @@ GifFileType *gif;*/ ax.Clear(); ay.Clear(); az.Clear(); ac.Clear(); mgl_clear_fft(); DefMaskAn=0; ResetMask(); SetTickRotate(true); SetTickSkip(true); - SetWarn(mglWarnNone,""); mglGlobalMess = ""; + SetWarn(mglWarnNone,""); mgl_clear_global_warn(); ObjId = -1; HighId = INT_MIN; SetFunc(0,0); CutOff(0); Ternary(0); Stop=false; event_cb = NULL; event_par=NULL; SetRanges(mglPoint(-1,-1,-1,-1), mglPoint(1,1,1,1)); - SetOrigin(NAN,NAN,NAN,NAN); + SetOrigin(NAN,NAN,NAN,NAN); set(0, MGL_NO_ORIGIN); SetBarWidth(0.7); SetMarkSize(1); SetArrowSize(1); SetAlphaDef(0.5); FontDef[0]=0; SetTranspType(0); SetMeshNum(0); // NOTE: default MeshNum=0 @@ -965,7 +963,7 @@ void mglCanvas::Legend(const std::vector &leg, mreal x, mreal y, const strcpy(ff,fmt?fmt:""); strcat(ff,":L"); Push(); if((pA=strchr(ff,'A'))) { *pA = ' '; InPlot(0,1,0,1,false); iw=B1.b[0]; ih=B1.b[4]; } - else if(mglchr(font,'A')) + else if(strchr(font,'A')) { InPlot(0,1,0,1,false); iw=B1.b[0]; ih=B1.b[4]; } else { iw=B1.b[0]/B1.pf; ih=B1.b[4]/B1.pf; } // find sizes @@ -986,7 +984,7 @@ void mglCanvas::Legend(const std::vector &leg, mreal x, mreal y, const nrow = 1+(n-1)/j; ncol = (n+nrow-1)/nrow; } - if(mglchr(font,'^')) // use "external" positioning + if(strchr(font,'^')) // use "external" positioning { x = x>=0.5 ? x*iw : x*iw-w*ncol-2*dx; y = y>=0.5 ? y*ih : y*ih-h*nrow-2*dy; @@ -1001,6 +999,7 @@ void mglCanvas::Legend(const std::vector &leg, mreal x, mreal y, const mglPoint p,q(NAN,NAN,NAN); mreal cc = AddTexture(font); + SetMask(""); mreal c1,c2; //=AddTexture(char(k1?k1:'w')), c2=AddTexture(char(k2?k2:'k')); if(cc<2 || Txt[long(cc+0.5)].n==0) { c1 = AddTexture('w'); cc = c2 = AddTexture('k'); } @@ -1189,7 +1188,7 @@ void mglCanvas::StartAutoGroup (const char *lbl) //----------------------------------------------------------------------------- void mglCanvas::EndGroup() { - LoadState(); + LoadState(); SetMask(""); if(Quality&MGL_DRAW_LMEM) { Pnt.clear(); Prm.clear(); Ptx.clear(); ClearPrmInd(); diff --git a/src/canvas_cf.cpp b/src/canvas_cf.cpp index ad29c55..e93f74b 100644 --- a/src/canvas_cf.cpp +++ b/src/canvas_cf.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -21,10 +21,44 @@ #include "mgl2/canvas_cf.h" #include "mgl2/eval.h" #include "mgl2/evalc.h" +#include "mgl2/font.h" //----------------------------------------------------------------------------- #undef _GR_ #define _GR_ ((mglCanvas *)(*gr)) //----------------------------------------------------------------------------- +MGL_EXPORT std::string *mglGlobalMess; ///< Buffer for receiving global messages +MGL_EXPORT mglCanvas *mglDefaultGr=NULL; ///< Default HMGL object +extern mglFont *mglDefFont; +#if MGL_HAVE_PTHREAD +pthread_mutex_t mutexRnd; +#endif +//----------------------------------------------------------------------------- +float MGL_EXPORT mgl_cos[360]; +void MGL_EXPORT MGL_FUNC_INIT mgl_init() // TODO try to add ld option: "-init mgl_init" +{ + static bool ini=true; + if(ini) + { + ini = false; + mglGlobalMess = new std::string; + mgl_textdomain(NULL,""); +#if MGL_HAVE_PTHREAD + pthread_mutex_init(&mutexRnd,0); +#endif +#ifndef WIN32 // win32 don't initialized threads before main() +#pragma omp parallel for +#endif + for(long i=0;i<360;i++) mgl_cos[i] = cos(i*M_PI/180.); + if(!mglDefFont) mglDefFont = new mglFont(MGL_DEF_FONT_NAME); + if(!mglDefaultGr) mglDefaultGr = new mglCanvas(600,400); + } +} +void MGL_EXPORT MGL_FUNC_FINI mgl_fini() // TODO try to add ld option: "-fini mgl_fini" +{ + if(mglDefaultGr) { delete mglDefaultGr;mglDefaultGr=NULL; } + if(mglDefFont) { delete mglDefFont; mglDefFont=NULL; } +} +//----------------------------------------------------------------------------- MGL_EXPORT const unsigned char *mgl_get_rgb(HMGL gr) { mglCanvas *g = dynamic_cast(gr); return g?g->GetBits():0; } MGL_EXPORT const unsigned char *mgl_get_rgba(HMGL gr) @@ -111,6 +145,10 @@ void MGL_EXPORT mgl_clf_str(HMGL gr, const char *col) { mglCanvas *g = dynamic_cast(gr); if(g) g->Clf(col); } void MGL_EXPORT mgl_load_background(HMGL gr, const char *fn, double alpha) { mglCanvas *g = dynamic_cast(gr); if(g) g->LoadBackground(fn,alpha); } +void MGL_EXPORT mgl_load_background_ext(HMGL gr, const char *fn, const char *how, double alpha) +{ mglCanvas *g = dynamic_cast(gr); if(g) g->LoadBackground(fn,how,alpha); } +void MGL_EXPORT mgl_fill_background(HMGL gr, double r, double g, double b) +{ mglCanvas *gg = dynamic_cast(gr); if(gg) gg->FillBackground(mglColor(r,g,b)); } //----------------------------------------------------------------------------- void MGL_EXPORT mgl_subplot_d(HMGL gr, int nx,int ny,int m,const char *style,double dx,double dy) { @@ -226,6 +264,12 @@ void MGL_EXPORT mgl_clf_str_(uintptr_t *gr, const char *col, int l) void MGL_EXPORT mgl_load_background_(uintptr_t *gr, const char *fn, mreal *a, int l) { char *s=new char[l+1]; memcpy(s,fn,l); s[l]=0; mgl_load_background(_GR_,s,*a); delete []s; } +void MGL_EXPORT mgl_load_background_ext_(uintptr_t *gr, const char *fn, const char *how, mreal *a, int l,int m) +{ char *s=new char[l+1]; memcpy(s,fn,l); s[l]=0; + char *h=new char[m+1]; memcpy(h,how,l); h[m]=0; + mgl_load_background_ext(_GR_,s,h,*a); delete []s; delete []h; } +void MGL_EXPORT mgl_fill_background_(uintptr_t *gr, double *r, double *g, double *b) +{ mgl_fill_background(_GR_,*r,*g,*b); } //----------------------------------------------------------------------------- void MGL_EXPORT mgl_subplot_d_(uintptr_t *gr, int *nx,int *ny,int *m,const char *st, mreal *dx, mreal *dy,int l) { char *s=new char[l+1]; memcpy(s,st,l); s[l]=0; @@ -290,6 +334,12 @@ double mgl_size_scl = 1; HMGL MGL_EXPORT mgl_create_graph(int width, int height) { return new mglCanvas(width,height); } void MGL_EXPORT mgl_delete_graph(HMGL gr) { if(gr) delete gr; } +HMGL MGL_EXPORT mgl_default_graph() +{ + if(!mglDefaultGr) + mglDefaultGr = new mglCanvas(600,400); + return mglDefaultGr; +} void MGL_EXPORT mgl_set_size_scl(double scl){ if(scl>0) mgl_size_scl = scl; } void MGL_EXPORT mgl_set_size(HMGL gr, int width, int height) { @@ -384,6 +434,7 @@ void MGL_EXPORT mgl_set_legend_marks(HMGL gr, int num) uintptr_t MGL_EXPORT mgl_create_graph_(int *width, int *height) { return uintptr_t(new mglCanvas(*width,*height)); } void MGL_EXPORT mgl_delete_graph_(uintptr_t *gr) { delete _GR_; } +uintptr_t MGL_EXPORT mgl_default_graph_() { return uintptr_t(&mglDefaultGr); } void MGL_EXPORT mgl_set_size_scl_(double *scl) { mgl_set_size_scl(*scl); } void MGL_EXPORT mgl_set_size_(uintptr_t *gr, int *width, int *height) { mgl_set_size(_GR_,*width,*height); } @@ -451,13 +502,13 @@ void MGL_EXPORT mgl_label_(uintptr_t *gr, const char *dir, const char *text, mre char *o=new char[m+1]; memcpy(o,opt,m); o[m]=0; _GR_->Label(*dir, s, *pos, o); delete []s; delete []o; } //----------------------------------------------------------------------------- -void MGL_EXPORT mgl_colorbar_(uintptr_t *gr, const char *sch,int l) +void MGL_EXPORT mgl_colorbar_(uintptr_t *gr, const char *sch, int l) { char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; _GR_->Colorbar(s); delete []s; } void MGL_EXPORT mgl_colorbar_ext_(uintptr_t *gr, const char *sch, 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,*x,*y,*w,*h); delete []s; } -void MGL_EXPORT mgl_colorbar_val_(uintptr_t *gr, uintptr_t *dat, const char *sch,int l) +void MGL_EXPORT mgl_colorbar_val_(uintptr_t *gr, uintptr_t *dat, const char *sch, int l) { char *s=new char[l+1]; memcpy(s,sch,l); s[l]=0; _GR_->Colorbar(_DA_(dat), s); delete []s; } void MGL_EXPORT mgl_colorbar_val_ext_(uintptr_t *gr, uintptr_t *dat, const char *sch, mreal *x, mreal *y, mreal *w, mreal *h, int l) diff --git a/src/complex.cpp b/src/complex.cpp index 4957a3f..f2684d2 100644 --- a/src/complex.cpp +++ b/src/complex.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -1114,20 +1114,20 @@ void MGL_EXPORT mgl_datac_diffr(HADT d, const char *how, mreal q) p[0]=nz; p[1]=nx*ny; p[2]=0; mglStartThreadC(mgl_difr,0,nx*ny,d->a,&qq,0,p); } - if(mglchr(how,'y') && ny>1 && !axial) + if(mglchr(how,'y') && ny>1) { p[0]=ny; p[1]=nx; p[2]=0; mglStartThreadC(mgl_difr,0,nx*nz,d->a,&qq,0,p); } - if(mglchr(how,'x') && nx>1 && !axial) + if(axial && nx>1) { - p[0]=nx; p[1]=1; p[2]=0; + p[0]=nx; p[1]=1; p[2]=1; mglStartThreadC(mgl_difr,0,ny*nz,d->a,&qq,0,p); } - if(axial && nx>1) + else if(mglchr(how,'x') && nx>1) { - p[0]=nx; p[1]=1; p[2]=1; - mglStartThreadC(mgl_difr,0,ny*nz,0,&qq,0,p); + p[0]=nx; p[1]=1; p[2]=0; + mglStartThreadC(mgl_difr,0,ny*nz,d->a,&qq,0,p); } } //----------------------------------------------------------------------------- diff --git a/src/complex_ex.cpp b/src/complex_ex.cpp index 718f7ee..084048f 100644 --- a/src/complex_ex.cpp +++ b/src/complex_ex.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -23,7 +23,6 @@ #include "mgl2/thread.h" #include "interp.hpp" void MGL_NO_EXPORT mgl_txt_funcC(const mreal *x, mreal *dx, void *par); -HADT MGL_NO_EXPORT mglFormulaCalcC(const char *str, const std::vector &head); //----------------------------------------------------------------------------- HADT MGL_EXPORT mgl_datac_trace(HCDT d) { @@ -123,14 +122,14 @@ HADT MGL_EXPORT mgl_datac_subdata_ext(HCDT d, HCDT xx, HCDT yy, HCDT zz) #pragma omp parallel for for(long i0=0;i0vthr(i0)), y=long(0.5+yy->vthr(i0)), z=long(0.5+zz->vthr(i0)); + long x=long(floor(0.5+xx->vthr(i0))), y=long(floor(0.5+yy->vthr(i0))), z=long(floor(0.5+zz->vthr(i0))); r->a[i0] = (x>=0 && x=0 && y=0 && za[x+nx*(y+ny*z)]:NAN; } else #pragma omp parallel for for(long i0=0;i0vthr(i0)), y=long(0.5+yy->vthr(i0)), z=long(0.5+zz->vthr(i0)); + long x=long(floor(0.5+xx->vthr(i0))), y=long(floor(0.5+yy->vthr(i0))), z=long(floor(0.5+zz->vthr(i0))); r->a[i0] = (x>=0 && x=0 && y=0 && zv(x,y,z):NAN; } } @@ -145,14 +144,14 @@ HADT MGL_EXPORT mgl_datac_subdata_ext(HCDT d, HCDT xx, HCDT yy, HCDT zz) #pragma omp parallel for collapse(3) for(long k=0;kv(i)), y=long(0.5+yy->v(j)), z=long(0.5+zz->v(k)); + long x=long(floor(0.5+xx->v(i))), y=long(floor(0.5+yy->v(j))), z=long(floor(0.5+zz->v(k))); r->a[i+n*(j+m*k)] = (x>=0 && x=0 && y=0 && za[x+nx*(y+ny*z)]:NAN; } else #pragma omp parallel for collapse(3) for(long k=0;kv(i)), y=long(0.5+yy->v(j)), z=long(0.5+zz->v(k)); + long x=long(floor(0.5+xx->v(i))), y=long(floor(0.5+yy->v(j))), z=long(floor(0.5+zz->v(k))); r->a[i+n*(j+m*k)] = (x>=0 && x=0 && y=0 && zv(x,y,z):NAN; } if(m==1) { r->ny=r->nz; r->nz=1; }// "squeeze" dimensions @@ -723,3 +722,54 @@ uintptr_t MGL_EXPORT mgl_find_roots_txt_c_(const char *func, const char *vars, u uintptr_t r = uintptr_t(mgl_find_roots_txt_c(s,v,_DA_(ini))); delete []s; delete []v; return r; } //----------------------------------------------------------------------------- +void MGL_EXPORT mgl_datac_keep(HADT dat, const char *how, long i, long j) +{ + const long nx = dat->GetNx(), ny = dat->GetNy(), nz = dat->GetNz(); + const bool phase = !mglchr(how, 'a'); + if(mglchr(how,'z')) + { + long ix = i, iy = j; + if(ix<0 || ix>=nx) ix = 0; + if(iy<0 || iy>=ny) iy = 0; + const long i0 = ix+nx*iy, nn = nx*ny; + const dual v0 = dat->a[i0]; + for(long k=0;ka[i0+nn*k], f = v0/v; + if(phase) f /= abs(f); + for(long ii=0;iia[ii+nn*k] *= f; + } + } + else if(mglchr(how,'x')) + { + long iy = i, iz = j; + if(iz<0 || iz>=nz) iz = 0; + if(iy<0 || iy>=ny) iy = 0; + const long i0 = nx*(iy+ny*iz), nn = ny*nz; + const dual v0 = dat->a[i0]; + for(long k=0;ka[i0+k], f = v0/v; + if(phase) f /= abs(f); + for(long ii=0;iia[k+nx*ii] *= f; + } + } + else // default is "y" + { + long ix = i, iz = j; + if(ix<0 || ix>=nx) ix = 0; + if(iz<0 || iz>=nz) iz = 0; + const long i0 = ix+nx*ny*iz; + const dual v0 = dat->a[i0]; + for(long k=0;ka[i0+nx*k], f = v0/v; + if(phase) f /= abs(f); + for(long ii=0;iia[jj+nx*(k+ny*ii)] *= f; + } + } +} +void MGL_EXPORT mgl_datac_keep_(uintptr_t *d, const char *how, long *i, long *j, int l) +{ char *s=new char[l+1]; memcpy(s,how,l); s[l]=0; + mgl_datac_keep(_DC_, s, *i, *j); delete []s; } +//----------------------------------------------------------------------------- diff --git a/src/complex_io.cpp b/src/complex_io.cpp index 8cdf0e1..4096eac 100644 --- a/src/complex_io.cpp +++ b/src/complex_io.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -34,7 +34,6 @@ inline bool isn(char ch) {return ch=='\n';} MGL_NO_EXPORT char *mgl_read_gz(gzFile fp); -HADT MGL_NO_EXPORT mglFormulaCalcC(const char *str, const std::vector &head); //----------------------------------------------------------------------------- HADT MGL_EXPORT mgl_create_datac() { return new mglDataC; } HADT MGL_EXPORT mgl_create_datac_size(long nx, long ny, long nz){ return new mglDataC(nx,ny,nz); } @@ -42,14 +41,14 @@ HADT MGL_EXPORT mgl_create_datac_file(const char *fname) { return new mglDataC( void MGL_EXPORT mgl_delete_datac(HADT d) { if(d) delete d; } //----------------------------------------------------------------------------- uintptr_t MGL_EXPORT mgl_create_datac_() -{ return uintptr_t(new mglDataC()); } +{ return uintptr_t(mgl_create_datac()); } uintptr_t MGL_EXPORT mgl_create_datac_size_(int *nx, int *ny, int *nz) -{ return uintptr_t(new mglDataC(*nx,*ny,*nz)); } +{ return uintptr_t(mgl_create_datac_size(*nx,*ny,*nz)); } uintptr_t MGL_EXPORT mgl_create_datac_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 mglDataC(s)); delete []s; return r; } + uintptr_t r = uintptr_t(mgl_create_datac_file(s)); delete []s; return r; } void MGL_EXPORT mgl_delete_datac_(uintptr_t *d) -{ if(_DC_) delete _DC_; } +{ mgl_delete_datac(_DC_); } //----------------------------------------------------------------------------- cmdual MGL_EXPORT mgl_atoc(const char *s, int adv) { @@ -882,8 +881,9 @@ int MGL_EXPORT mgl_datac_read_hdf(HADT d,const char *fname,const char *data) hf = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); if(hf<0) return 0; hd = H5Dopen(hf,data); - if(hd<0) return 0; + if(hd<0) { H5Fclose(hf); return 0; } hs = H5Dget_space(hd); + if(hs<0) { H5Dclose(hd); H5Fclose(hf); return 0; } rank = H5Sget_simple_extent_ndims(hs); if(rank>0 && rank<=4) { diff --git a/src/cont.cpp b/src/cont.cpp index 8afef5a..f35ef26 100644 --- a/src/cont.cpp +++ b/src/cont.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -33,6 +33,7 @@ #include "mgl2/eval.h" #include "mgl2/font.h" #include "mgl2/base.h" +#include "cont.hpp" //----------------------------------------------------------------------------- // // Text printing along a curve @@ -195,10 +196,176 @@ 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 +// DCont series // //----------------------------------------------------------------------------- -#include "cont.hpp" +bool mglSegment::set(mreal u1,mreal v1,mreal u2,mreal v2,long i,long j,long k,HCDT x, HCDT y, HCDT z) +{ + bool res=(v1>=0 && v1<=MGL_FEPSILON && u1>=0 && u1<=MGL_FEPSILON && v2>=0 && v2<=MGL_FEPSILON && u2>=0 && u2<=MGL_FEPSILON); + if(v1==v2 && u1==u2) res=false; // NOTE: shouldn't be here never + if(res) + { + p1.Set(mgl_data_linear(x,i+u1,j+v1,k), mgl_data_linear(y,i+u1,j+v1,k), mgl_data_linear(z,i+u1,j+v1,k)); + p2.Set(mgl_data_linear(x,i+u2,j+v2,k), mgl_data_linear(y,i+u2,j+v2,k), mgl_data_linear(z,i+u2,j+v2,k)); + } + return res; +} +//----------------------------------------------------------------------------- +void mglSegment::set(const mglPoint &q1, const mglPoint &q2,HCDT x, HCDT y, HCDT z, bool nboth) +{ + if(nboth) + { + p1.Set(mgl_data_linear(x,q1.x,0,0), mgl_data_linear(y,q1.y,0,0), mgl_data_linear(z,q1.z,0,0)); + p2.Set(mgl_data_linear(x,q2.x,0,0), mgl_data_linear(y,q2.y,0,0), mgl_data_linear(z,q2.z,0,0)); + } + else + { + p1.Set(mgl_data_linear(x,q1.x,q1.y,q1.z), mgl_data_linear(y,q1.x,q1.y,q1.z), mgl_data_linear(z,q1.x,q1.y,q1.z)); + p2.Set(mgl_data_linear(x,q2.x,q2.y,q2.z), mgl_data_linear(y,q2.x,q2.y,q2.z), mgl_data_linear(z,q2.x,q2.y,q2.z)); + } +} +//----------------------------------------------------------------------------- +void MGL_NO_EXPORT mgl_dcont_add_pnt(mglPoint p1, mglPoint p2, HCDT b, mreal val, std::vector &pp) +{ + mreal b1=b->Linear(p1.x,p1.y,p1.z), b2=b->Linear(p2.x,p2.y,p2.z); + mreal d = (val-b1)/(b2-b1); + if(d>=0 && d<=1) pp.push_back(p2*d+p1*(1-d)); +} +//----------------------------------------------------------------------------- +std::vector MGL_EXPORT mgl_get_dlines(mreal val, HCDT a, HCDT b, HCDT x, HCDT y, HCDT z) +{ + long nx=a->GetNx(), ny=a->GetNy(), nz=a->GetNz(), nn=nx*ny; + bool nboth = mgl_isnboth(x,y,z,a); + std::vector lines; + for(long k=0;k pp; + long i0 = i+nx*(j+ny*k); + mreal v1=a->vthr(i0), v2=a->vthr(i0+1), v3=a->vthr(i0+nx), v4=a->vthr(i0+1+nx); + mreal v5=a->vthr(i0+nn), v6=a->vthr(i0+1+nn), v7=a->vthr(i0+nx+nn), v8=a->vthr(i0+1+nx+nn); + // first find isosurface for a + mreal d1,d2,d3,d4,d5,d6,d7,d8,dA,dB,dC,dD; + d1=(val-v1)/(v2-v1); d1=(d1>=0&&d1<=1)?d1:NAN; + d2=(val-v2)/(v4-v2); d2=(d2>=0&&d2<=1)?d2:NAN; + d3=(val-v3)/(v4-v3); d3=(d3>=0&&d3<=1)?d3:NAN; + d4=(val-v1)/(v3-v1); d4=(d4>=0&&d4<=1)?d4:NAN; + mglPoint p1(i+d1,j,k), p2(i+1,j+d2,k), p3(i+d3,j+1,k), p4(i,j+d4,k); + d5=(val-v5)/(v6-v5); d5=(d5>=0&&d5<=1)?d5:NAN; + d6=(val-v6)/(v8-v6); d6=(d6>=0&&d6<=1)?d6:NAN; + d7=(val-v7)/(v8-v7); d7=(d7>=0&&d7<=1)?d7:NAN; + d8=(val-v5)/(v7-v5); d8=(d8>=0&&d8<=1)?d8:NAN; + mglPoint p5(i+d5,j,k+1), p6(i+1,j+d6,k+1), p7(i+d7,j+1,k+1), p8(i,j+d8,k+1); + dA=(val-v1)/(v5-v1); dA=(dA>=0&&dA<=1)?dA:NAN; + dB=(val-v2)/(v6-v2); dB=(dB>=0&&dB<=1)?dB:NAN; + dC=(val-v3)/(v7-v3); dC=(dC>=0&&dC<=1)?dC:NAN; + dD=(val-v4)/(v8-v4); dD=(dD>=0&&dD<=1)?dD:NAN; + mglPoint pA(i,j,k+dA), pB(i+1,j,k+dB), pC(i,j+1,k+dC), pD(i+1,j+1,k+dD); + // next find its cross-section with isosurface of b at faces + mgl_dcont_add_pnt(p1,p2,b,val,pp); mgl_dcont_add_pnt(p1,p4,b,val,pp); + mgl_dcont_add_pnt(p1,p3,b,val,pp); mgl_dcont_add_pnt(p1,p5,b,val,pp); + mgl_dcont_add_pnt(p1,pA,b,val,pp); mgl_dcont_add_pnt(p1,pB,b,val,pp); + mgl_dcont_add_pnt(p2,p4,b,val,pp); mgl_dcont_add_pnt(p2,p3,b,val,pp); + mgl_dcont_add_pnt(p2,p6,b,val,pp); mgl_dcont_add_pnt(p2,pD,b,val,pp); + mgl_dcont_add_pnt(p2,pB,b,val,pp); mgl_dcont_add_pnt(p4,p3,b,val,pp); + mgl_dcont_add_pnt(p4,p8,b,val,pp); mgl_dcont_add_pnt(p4,pA,b,val,pp); + mgl_dcont_add_pnt(p4,pC,b,val,pp); mgl_dcont_add_pnt(p5,p6,b,val,pp); + mgl_dcont_add_pnt(p5,p8,b,val,pp); mgl_dcont_add_pnt(p5,p7,b,val,pp); + mgl_dcont_add_pnt(p5,pA,b,val,pp); mgl_dcont_add_pnt(p5,pB,b,val,pp); + mgl_dcont_add_pnt(p6,p8,b,val,pp); mgl_dcont_add_pnt(p6,p7,b,val,pp); + mgl_dcont_add_pnt(p6,pD,b,val,pp); mgl_dcont_add_pnt(p6,pB,b,val,pp); + mgl_dcont_add_pnt(p3,p7,b,val,pp); mgl_dcont_add_pnt(p8,p7,b,val,pp); + mgl_dcont_add_pnt(p7,pD,b,val,pp); mgl_dcont_add_pnt(p7,pC,b,val,pp); + mgl_dcont_add_pnt(p8,pA,b,val,pp); mgl_dcont_add_pnt(pA,pB,b,val,pp); + mgl_dcont_add_pnt(pA,pC,b,val,pp); mgl_dcont_add_pnt(p3,pC,b,val,pp); + mgl_dcont_add_pnt(p8,pC,b,val,pp); mgl_dcont_add_pnt(pD,pC,b,val,pp); + mgl_dcont_add_pnt(pD,pB,b,val,pp); mgl_dcont_add_pnt(p3,pD,b,val,pp); + // now connect points + if(pp.size()<2) continue; + else if(pp.size()==2) + { mglSegment line; line.set(pp[0],pp[1],x,y,z,nboth); lines.push_back(line); } + else + { + mglSegment line; + size_t n = pp.size(); // TODO sort by closest in future + for(size_t ii=0;iiSaveState(opt); + static int cgid=1; gr->StartGroup("DContGen",cgid++); + + int text=0; + if(mglchr(sch,'t')) text=1; + if(mglchr(sch,'T')) text=2; + gr->SetPenPal(sch); + mgl_draw_curvs(gr,val,gr->CDef,text,mgl_get_curvs(gr,mgl_get_dlines(val,a,b,x,y,z))); + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_dcont_xyz(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *sch, const char *opt) +{ + if(mgl_check_dim3(gr,!mgl_isnboth(x,y,z,a),x,y,z,a,b,"DCont")) return; + + mreal r = gr->SaveState(opt); + static int cgid=1; gr->StartGroup("DCont",cgid++); + + int text=0; + if(mglchr(sch,'t')) text=1; + if(mglchr(sch,'T')) text=2; + long s=gr->AddTexture(sch); + gr->SetPenPal(sch); + + long Num = mgl_isnan(r)?7:long(r+0.5); + if(!v && Num<1) { gr->SetWarn(mglWarnCnt,"Cont"); return; } + mglData vv(Num); + for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*mreal(i+1)/(Num+1); + if(!v) v = &vv; + +#pragma omp parallel for + for(long i=0;iGetNx();i++) + { + mreal val = v->v(i); + mgl_draw_curvs(gr,val,gr->GetC(s,val),text, mgl_get_curvs(gr, mgl_get_dlines(val,a,b,x,y,z))); + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_dcont(HMGL gr, HCDT v, HCDT a, HCDT b, const char *sch, const char *opt) +{ + long n = a->GetNx(), m = a->GetNy(), l = a->GetNz(); + if(m<2 || n<2 || l<2 || n*m*l!=b->GetNN()) { gr->SetWarn(mglWarnLow,"DCont"); return; } + mreal r = gr->SaveState(opt); + mglDataV x(n,m,l), y(n,m,l), z(n,m,l); + x.Fill(gr->Min.x,gr->Max.x,'x'); + y.Fill(gr->Min.y,gr->Max.y,'y'); + z.Fill(gr->Min.z,gr->Max.z,'z'); + long Num = mgl_isnan(r)?7:long(r+0.5); + if(!v && Num<1) { gr->SetWarn(mglWarnCnt,"Cont"); return; } + mglData vv(Num); + for(long i=0;iMin.c + (gr->Max.c-gr->Min.c)*mreal(i+1)/(Num+1); + mgl_dcont_xyz(gr,v?v:&vv,&x,&y,&z,a,b,sch,0); +} +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_dcont_xyz_(uintptr_t *gr, uintptr_t *v, 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_dcont_xyz(_GR_, _DA_(v), _DA_(x), _DA_(y), _DA_(z), _DA_(a), _DA_(b), s, o); + delete []o; delete []s; } +void MGL_EXPORT mgl_dcont_(uintptr_t *gr, uintptr_t *v, 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_dcont(_GR_, _DA_(v), _DA_(a), _DA_(b), s, o); + delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Cont series +// //----------------------------------------------------------------------------- std::vector MGL_EXPORT mgl_get_lines(mreal val, HCDT a, HCDT x, HCDT y, HCDT z, long ak) { @@ -327,7 +494,7 @@ std::vector MGL_EXPORT mgl_get_curvs(const mglPoint &Min, const mglP delete []used; delete []xsl; delete []ysl; return curvs; } -std::vector MGL_EXPORT mgl_get_curvs(HMGL gr, std::vector lines) +std::vector MGL_EXPORT mgl_get_curvs(HMGL gr, const std::vector &lines) { return mgl_get_curvs(gr->Min, gr->Max, lines); } //----------------------------------------------------------------------------- void MGL_NO_EXPORT mgl_draw_curvs(HMGL gr, mreal val, mreal c, int text, const std::vector &curvs) @@ -365,7 +532,7 @@ void MGL_NO_EXPORT mgl_draw_curvs(HMGL gr, mreal val, mreal c, int text, const s mreal x0 = (del*ii1)/0xffff, y0 = (del*ii2)/0xffff; for(long k=0;kGetPntP(ff[k]); mreal tx = t.x+x0, ty = t.y+y0; // quasi-random shift long i = long(tx/del); tx -= i*del; @@ -384,7 +551,7 @@ void MGL_NO_EXPORT mgl_draw_curvs(HMGL gr, mreal val, mreal c, int text, const s delete []nn; delete []ff; } //----------------------------------------------------------------------------- -HMDT mgl_data_conts(mreal val, HCDT dat) +HMDT MGL_EXPORT mgl_data_conts(mreal val, HCDT dat) { mglPoint Min(0,0,0), Max(1,1,1); mglDataV x(dat->GetNx(),dat->GetNy(),dat->GetNz(),0,1,'x'); @@ -414,7 +581,7 @@ HMDT mgl_data_conts(mreal val, HCDT dat) } //----------------------------------------------------------------------------- // NOTE! All data MUST have the same size! Only first slice is used! -void MGL_EXPORT mgl_cont_gen(HMGL gr, mreal val, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, int text,long ak) +void MGL_EXPORT mgl_cont_genI(HMGL gr, mreal val, HCDT a, HCDT x, HCDT y, HCDT z, mreal 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) @@ -433,7 +600,7 @@ void MGL_EXPORT mgl_cont_gen(HMGL gr, double val, HCDT a, HCDT x, HCDT y, HCDT z if(mglchr(sch,'t')) text=1; if(mglchr(sch,'T')) text=2; gr->SetPenPal(sch); - mgl_cont_gen(gr,val,a,x,y,z,gr->CDef,text,0); + mgl_cont_genI(gr,val,a,x,y,z,gr->CDef,text,0); gr->EndGroup(); } //----------------------------------------------------------------------------- @@ -471,7 +638,7 @@ void MGL_EXPORT mgl_cont_xy_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, const c if(z->GetNz()>1) z0 = gr->Min.z+(gr->Max.z-gr->Min.z)*mreal(j)/(z->GetNz()-1); mglDataV zz(n, m); zz.Fill(z0,z0); - mgl_cont_gen(gr,v0,z,x,y,&zz,gr->GetC(s,v0),text,j); + mgl_cont_genI(gr,v0,z,x,y,&zz,gr->GetC(s,v0),text,j); } gr->EndGroup(); } @@ -640,7 +807,7 @@ void static mgl_add_edges(HMGL gr, HCDT a, HCDT x, HCDT y, HCDT z, long i1, long if(f2<=v2 && f2>=v1) u2 = mgl_add_pnt(gr,1,x,y,z,i1,j1,i2,j2,c,true); } //----------------------------------------------------------------------------- -void MGL_EXPORT mgl_contf_gen(HMGL gr, mreal v1, mreal v2, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, long ak) +void MGL_EXPORT mgl_contf_genI(HMGL gr, mreal v1, mreal v2, HCDT a, HCDT x, HCDT y, HCDT z, mreal 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) @@ -783,14 +950,14 @@ void MGL_EXPORT mgl_contf_gen(HMGL gr, mreal v1, mreal v2, HCDT a, HCDT x, HCDT delete []kk; } //----------------------------------------------------------------------------- -void MGL_EXPORT mgl_contf_gen(HMGL gr, double v1, mreal v2, HCDT a, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) +void MGL_EXPORT mgl_contf_gen(HMGL gr, double v1, double v2, HCDT a, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt) { if(mgl_check_dim2(gr,x,y,z,a,"ContFGen")) return; gr->SaveState(opt); static int cgid=1; gr->StartGroup("ContFGen",cgid++); gr->SetPenPal(sch); - mgl_contf_gen(gr,v1,v2,a,x,y,z,gr->CDef,0); + mgl_contf_genI(gr,v1,v2,a,x,y,z,gr->CDef,0); gr->EndGroup(); } //----------------------------------------------------------------------------- @@ -823,7 +990,7 @@ void MGL_EXPORT mgl_contf_xy_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, const if(z->GetNz()>1) z0 = gr->Min.z+(gr->Max.z-gr->Min.z)*mreal(j)/(z->GetNz()-1); mglDataV zz(n, m); zz.Fill(z0,z0); - mgl_contf_gen(gr,v0,v->v(i+1),z,x,y,&zz,gr->GetC(s,v0),j); + mgl_contf_genI(gr,v0,v->v(i+1),z,x,y,&zz,gr->GetC(s,v0),j); } gr->EndGroup(); } @@ -914,9 +1081,9 @@ void MGL_EXPORT mgl_contp_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, HCDT a, c { if(gr->NeedStop()) continue; if(fill) - mgl_contf_gen(gr,v->v(i),v->v(i+1),a,x,y,z,gr->GetC(s,v->v(i)),j); + mgl_contf_genI(gr,v->v(i),v->v(i+1),a,x,y,z,gr->GetC(s,v->v(i)),j); else - mgl_cont_gen(gr,v->v(i),a,x,y,z,gr->GetC(s,v->v(i)),text,j); + mgl_cont_genI(gr,v->v(i),a,x,y,z,gr->GetC(s,v->v(i)),text,j); } gr->EndGroup(); } @@ -988,7 +1155,7 @@ void MGL_EXPORT mgl_contd_xy_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, const if(z->GetNz()>1) z0 = gr->Min.z+(gr->Max.z-gr->Min.z)*mreal(j)/(z->GetNz()-1); mglDataV zz(n, m); zz.Fill(z0,z0); - mgl_contf_gen(gr,v0,v->v(i+1),z,x,y,&zz,s+(i%nc)*dc,j); + mgl_contf_genI(gr,v0,v->v(i+1),z,x,y,&zz,s+(i%nc)*dc,j); } gr->EndGroup(); } @@ -1046,7 +1213,7 @@ void MGL_EXPORT mgl_contd_(uintptr_t *gr, uintptr_t *a, const char *sch, const c // //----------------------------------------------------------------------------- // NOTE! All data MUST have the same size! Only first slice is used! -void MGL_EXPORT mgl_contv_gen(HMGL gr, mreal val, mreal dval, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, long ak) +void MGL_EXPORT mgl_contv_genI(HMGL gr, mreal val, mreal dval, HCDT a, HCDT x, HCDT y, HCDT z, mreal 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) @@ -1100,7 +1267,7 @@ void MGL_EXPORT mgl_contv_xy_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, const if(i>0) dv = v->v(i-1)-v->v(i); else if(iGetNx()-1) dv = v->v(i)-v->v(i+1); if(fixed) dv=-dv; - mgl_contv_gen(gr,v0,dv,z,x,y,&zz,gr->GetC(s,v0),j); + mgl_contv_genI(gr,v0,dv,z,x,y,&zz,gr->GetC(s,v0),j); } gr->EndGroup(); } @@ -1272,7 +1439,7 @@ void MGL_EXPORT mgl_cont3_xyz_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, HCDT for(long i=0;iGetNx();i++) { mreal v0 = v->v(i); - mgl_cont_gen(gr,v0,&s.a,&s.x,&s.y,&s.z,gr->GetC(ss,v0),text,0); + mgl_cont_genI(gr,v0,&s.a,&s.x,&s.y,&s.z,gr->GetC(ss,v0),text,0); } gr->EndGroup(); } @@ -1437,7 +1604,7 @@ void MGL_EXPORT mgl_contf3_xyz_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, HCDT for(long i=0;iGetNx()-1;i++) { mreal 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); + mgl_contf_genI(gr,v0,v->v(i+1),&s.a,&s.x,&s.y,&s.z,gr->GetC(ss,v0),0); } gr->EndGroup(); } @@ -1551,7 +1718,7 @@ void static mgl_axial_plot(mglBase *gr,long pc, mglPoint *ff, long *nn,char dir, } //----------------------------------------------------------------------------- // NOTE! All data MUST have the same size! Only first slice is used! -void MGL_EXPORT mgl_axial_gen(HMGL gr, mreal val, HCDT a, HCDT x, HCDT y, mreal c, char dir,long ak,int wire) +void MGL_EXPORT mgl_axial_genI(HMGL gr, mreal val, HCDT a, HCDT x, HCDT y, mreal c, char dir,long ak,int 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) @@ -1669,7 +1836,7 @@ void MGL_EXPORT mgl_axial_xy_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, const { if(gr->NeedStop()) continue; mreal v0 = v->v(i); - mgl_axial_gen(gr,v0,z,x,y,gr->GetC(s,v0),dir,j,wire); + mgl_axial_genI(gr,v0,z,x,y,gr->GetC(s,v0),dir,j,wire); } gr->EndGroup(); } diff --git a/src/cont.hpp b/src/cont.hpp index 6562988..2f05433 100644 --- a/src/cont.hpp +++ b/src/cont.hpp @@ -1,9 +1,9 @@ /*************************************************************************** - * cont.cpp is part of Math Graphic Library + * cont.hpp is part of Math Graphic Library * Copyright (C) 2007-2014 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -22,21 +22,12 @@ struct mglSegment { mglPoint p1,p2; // edges std::list pp; - bool set(mreal u1,mreal v1,mreal u2,mreal v2,long i,long j,long k,HCDT x, HCDT y, HCDT z) - { - bool res=(v1>=0 && v1<=MGL_FEPSILON && u1>=0 && u1<=MGL_FEPSILON && v2>=0 && v2<=MGL_FEPSILON && u2>=0 && u2<=MGL_FEPSILON); - if(v1==v2 && u1==u2) res=false; // NOTE: shouldn't be here never - if(res) - { - p1.Set(mgl_data_linear(x,i+u1,j+v1,k), mgl_data_linear(y,i+u1,j+v1,k), mgl_data_linear(z,i+u1,j+v1,k)); - p2.Set(mgl_data_linear(x,i+u2,j+v2,k), mgl_data_linear(y,i+u2,j+v2,k), mgl_data_linear(z,i+u2,j+v2,k)); - } - return res; - } + bool set(mreal u1,mreal v1,mreal u2,mreal v2,long i,long j,long k,HCDT x, HCDT y, HCDT z); + void set(const mglPoint &p1, const mglPoint &p2,HCDT x, HCDT y, HCDT z, bool nboth); void before(const mglPoint &p) { p1 = p; pp.push_front(p); } void after(const mglPoint &p) { p2 = p; pp.push_back(p); } }; //----------------------------------------------------------------------------- -std::vector MGL_EXPORT mgl_get_curvs(HMGL gr, std::vector lines); +std::vector MGL_EXPORT mgl_get_curvs(HMGL gr, const std::vector &lines); void MGL_NO_EXPORT mgl_draw_curvs(HMGL gr, mreal val, mreal c, int text, const std::vector &curvs); //----------------------------------------------------------------------------- diff --git a/src/crust.cpp b/src/crust.cpp index c3ba949..21c3888 100644 --- a/src/crust.cpp +++ b/src/crust.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,13 +12,12 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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 "mgl2/other.h" @@ -530,7 +529,6 @@ HMDT MGL_EXPORT mgl_triangulation_2d(HCDT x, HCDT y) if(y->GetNN()!=n) return nums; // use s-hull here std::vector pts; - Shx pt; double x1=mglInf, x2=-mglInf, y1=mglInf, y2=-mglInf; for(long i=0;ivthr(i)-x1)/dx; pt.c = (y->vthr(i)-y1)/dy; if(mgl_isbad(pt.r) || mgl_isbad(pt.c)) continue; pt.id = i; pts.push_back(pt); diff --git a/src/data.cpp b/src/data.cpp index 5a22869..afefa18 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -25,6 +25,8 @@ #include "interp.hpp" MGL_EXPORT int mglNumThr=0; +MGL_EXPORT std::vector mglDataList; + //----------------------------------------------------------------------------- #if MGL_HAVE_PTHREAD #ifdef WIN32 @@ -162,25 +164,37 @@ static void *mgl_smth_x(void *par) #pragma omp parallel for #endif for(long i=t->id;in;i+=mglNumThr) - if(mgl_isnum(a[i])) // bypass NAN values - { - long j = i%nx, nk = 2*kind+1; - for(long k=-kind;k<=kind;k++) - if(j+k>=0 && j+k=0 && j+kid;in;i+=mglNumThr) { long j = i%nx; - if(j>1 && j=0 && j+k0 && jid;in;i+=mglNumThr) - if(mgl_isnum(a[i])) // bypass NAN values - { - long j = (i/nx)%ny, nk = 2*kind+1; - for(long k=-kind;k<=kind;k++) - if(j+k>=0 && j+k=0 && j+kid;in;i+=mglNumThr) { long j = (i/nx)%ny; - if(j>1 && j=0 && j+k0 && jid;in;i+=mglNumThr) - if(mgl_isnum(a[i])) // bypass NAN values - { - long j = i/nn, nk = 2*kind+1; - for(long k=-kind;k<=kind;k++) - if(j+k>=0 && j+k=0 && j+kid;in;i+=mglNumThr) { long j = i/nn; - if(j>1 && j=0 && j+k0 && jnx,ny=d->ny,nz=d->nz; // if(Type == SMOOTH_NONE) return; long p[3]={nx,ny,Type}; @@ -1337,52 +1386,72 @@ int MGL_EXPORT mgl_data_find_any_(uintptr_t *d, const char *cond, int l) mreal MGL_EXPORT 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; + mreal i0=0,i1=0,i2=0,i3=0,i4=0,is; switch(dir) { case 'x': -#pragma omp parallel for reduction(+:i0,i1,i2,i3,i4) +#pragma omp parallel for reduction(+:i0,i1) for(long i=0;ivthr(i); - i0+= v; i1+= v*d; i2+= v*t; - i3+= v*d*t; i4+= v*t*t; + mreal d = mreal(i%nx), v = dd->vthr(i); + i0+= v; i1+= v*d; + } + is = i1/i0; +#pragma omp parallel for reduction(+:i2,i3,i4) + for(long i=0;ivthr(i); + i2+= v*t; i3+= v*d*t; i4+= v*t*t; } break; case 'y': -#pragma omp parallel for reduction(+:i0,i1,i2,i3,i4) +#pragma omp parallel for reduction(+:i0,i1) + for(long i=0;ivthr(i); + i0+= v; i1+= v*d; + } + is = i1/i0; +#pragma omp parallel for reduction(+:i2,i3,i4) for(long i=0;ivthr(i); - i0+= v; i1+= v*d; i2+= v*t; - i3+= v*d*t; i4+= v*t*t; + mreal d = mreal((i/nx)%ny)-is, t = d*d, v = dd->vthr(i); + i2+= v*t; i3+= v*d*t; i4+= v*t*t; } break; case 'z': -#pragma omp parallel for reduction(+:i0,i1,i2,i3,i4) +#pragma omp parallel for reduction(+:i0,i1) + for(long i=0;ivthr(i); + i0+= v; i1+= v*d; + } + is = i1/i0; +#pragma omp parallel for reduction(+:i2,i3,i4) for(long i=0;ivthr(i); - i0+= v; i1+= v*d; i2+= v*t; - i3+= v*d*t; i4+= v*t*t; + mreal d = mreal(i/(nx*ny))-is, t = d*d, v = dd->vthr(i); + i2+= v*t; i3+= v*d*t; i4+= v*t*t; } break; default: // "self-dispersion" i0 = nx*ny*nz; -#pragma omp parallel for reduction(+:i1,i2,i3,i4) +#pragma omp parallel for reduction(+:i1) + for(long i=0;ivthr(i); + is = i1/i0; +#pragma omp parallel for reduction(+:i2,i3,i4) for(long i=0;ivthr(i), t = v*v; - i1+= v; i2+= t; - i3+= v*t; i4+= t*t; + mreal v = dd->vthr(i)-is, t = v*v; + i2+= t; i3+= v*t; i4+= t*t; } } if(i0==0) return 0; - mreal 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); + mreal w2=i2/i0, ww = sqrt(w2); + if(x) *x=is; + if(w) *w=ww; + if(s) *s=i3/i0/ww/w2; + if(k) *k=i4/(i0*3)/w2/w2; return i0; } mreal MGL_EXPORT mgl_data_momentum_val_(uintptr_t *d, char *dir, mreal *m, mreal *w, mreal *s, mreal *k,int) diff --git a/src/data_ex.cpp b/src/data_ex.cpp index e2ecfb9..57165a2 100644 --- a/src/data_ex.cpp +++ b/src/data_ex.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -25,7 +25,6 @@ #include "mgl2/thread.h" #include "interp.hpp" void MGL_NO_EXPORT mgl_txt_func(const mreal *x, mreal *dx, void *par); -HMDT MGL_NO_EXPORT mglFormulaCalc(const char *str, const std::vector &head); //----------------------------------------------------------------------------- HMDT MGL_EXPORT mgl_data_trace(HCDT d) { @@ -110,7 +109,7 @@ HMDT MGL_EXPORT mgl_data_subdata_ext(HCDT d, HCDT xx, HCDT yy, HCDT zz) #pragma omp parallel for for(long i0=0;i0vthr(i0)), y=long(0.5+yy->vthr(i0)), z=long(0.5+zz->vthr(i0)); + long x=long(floor(0.5+xx->vthr(i0))), y=long(floor(0.5+yy->vthr(i0))), z=long(floor(0.5+zz->vthr(i0))); r->a[i0] = (x>=0 && x=0 && y=0 && zv(x,y,z):NAN; } } @@ -124,7 +123,7 @@ HMDT MGL_EXPORT mgl_data_subdata_ext(HCDT d, HCDT xx, HCDT yy, HCDT zz) #pragma omp parallel for collapse(3) for(long k=0;kv(i)), y=long(0.5+yy->v(j)), z=long(0.5+zz->v(k)); + long x=long(floor(0.5+xx->v(i))), y=long(floor(0.5+yy->v(j))), z=long(floor(0.5+zz->v(k))); r->a[i+n*(j+m*k)] = (x>=0 && x=0 && y=0 && zv(x,y,z):NAN; } if(m==1) { r->ny=r->nz; r->nz=1; }// "squeeze" dimensions @@ -388,6 +387,94 @@ uintptr_t MGL_EXPORT 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; } //----------------------------------------------------------------------------- +HMDT MGL_EXPORT mgl_data_first_dir(HCDT dat, const char *dir, double val) +{ + if(!dir || *dir==0) return 0; + const long nx=dat->GetNx(),ny=dat->GetNy(),nz=dat->GetNz(), nn=nx*ny; + mglData *r=NULL; + if(mglchr(dir,'z') && nz>1) + { + r = new mglData(nx,ny); +#pragma omp parallel for + for(long j=0;jvthr(j+nn*i)>val) break; + r->a[j] = i/mreal(nz-1); + } + } + else if(mglchr(dir,'y') && ny>1) + { + r = new mglData(nx,nz); +#pragma omp parallel for + for(long j=0;jvthr(i0+nx*i)>val) break; + r->a[j] = i/mreal(ny-1); + } + } + else if(mglchr(dir,'x') && nx>1) + { + r = new mglData(ny,nz); +#pragma omp parallel for + for(long j=0;jvthr(i0+i)>val) break; + r->a[j] = i/mreal(nx-1); + } + } + return r; +} +uintptr_t MGL_EXPORT mgl_data_first_dir_(uintptr_t *d, const char *dir, double *val,int l) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; + uintptr_t r=uintptr_t(mgl_data_first_dir(_DT_,s,*val)); delete []s; return r; } +//----------------------------------------------------------------------------- +HMDT MGL_EXPORT mgl_data_last_dir(HCDT dat, const char *dir, double val) +{ + if(!dir || *dir==0) return 0; + const long nx=dat->GetNx(),ny=dat->GetNy(),nz=dat->GetNz(), nn=nx*ny; + mglData *r=NULL; + if(mglchr(dir,'z') && nz>1) + { + r = new mglData(nx,ny); +#pragma omp parallel for + for(long j=0;j=0;i++) if(dat->vthr(j+nn*i)>val) break; + r->a[j] = i/mreal(nz-1); + } + } + else if(mglchr(dir,'y') && ny>1) + { + r = new mglData(nx,nz); +#pragma omp parallel for + for(long j=0;j=0;i++) if(dat->vthr(i0+nx*i)>val) break; + r->a[j] = i/mreal(ny-1); + } + } + else if(mglchr(dir,'x') && nx>1) + { + r = new mglData(ny,nz); +#pragma omp parallel for + for(long j=0;j=0;i++) if(dat->vthr(i0+i)>val) break; + r->a[j] = i/mreal(nx-1); + } + } + return r; +} +uintptr_t MGL_EXPORT mgl_data_last_dir_(uintptr_t *d, const char *dir, double *val,int l) +{ char *s=new char[l+1]; memcpy(s,dir,l); s[l]=0; + uintptr_t r=uintptr_t(mgl_data_last_dir(_DT_,s,*val)); delete []s; return r; } +//----------------------------------------------------------------------------- static void *mgl_min_z(void *par) { mglThreadD *t=(mglThreadD *)par; @@ -779,37 +866,100 @@ static void *mgl_hist_2(void *par) { mglThreadD *t=(mglThreadD *)par; long nn=t->n, n = t->p[0]; - long ns=t->p[1], nx=t->p[2], ny=t->p[3]; + long nsub=t->p[1], nx=t->p[2], ny=t->p[3], ns=labs(nsub)+1; mreal *b=new mreal[n], d=1./ns; memset(b,0,n*sizeof(mreal)); HCDT a = (HCDT)(t->b), c = (HCDT)(t->c); const mreal *v=(const mreal *)t->v; - bool sp = n>0; + const long nsx=ns*nx, nsy=ns*ny, nxy=nsx*nsy; + if(nsub<0) // spline + { + if(c) + { #if !MGL_HAVE_PTHREAD #pragma omp parallel for #endif - for(long i=t->id;iid;ivalue(x,y,z), w = c->value(x,y,z); + if(mgl_isnan(f) || mgl_isnan(w)) continue; + long k = long(n*(f-v[0])/(v[1]-v[0])); + if(k>=0 && kid;ivalue(x,y,z); + if(mgl_isnan(f)) continue; + long k = long(n*(f-v[0])/(v[1]-v[0])); + if(k>=0 && kvalue(x,y,z) : a->linear(x,y,z), w=1; - if(c) w = sp ? c->value(x,y,z) : c->linear(x,y,z); - if(mgl_isnan(f) || mgl_isnan(w)) continue; - long k = long(n*(f-v[0])/(v[1]-v[0])); - if(k>=0 && kid;ilinear(x,y,z), w = c->linear(x,y,z); + if(mgl_isnan(f) || mgl_isnan(w)) continue; + long k = long(n*(f-v[0])/(v[1]-v[0])); + if(k>=0 && kid;ilinear(x,y,z); + if(mgl_isnan(f)) continue; + long k = long(n*(f-v[0])/(v[1]-v[0])); + if(k>=0 && ka = b; return 0; } +//----------------------------------------------------------------------------- HMDT MGL_EXPORT mgl_data_hist(HCDT dat, long n, mreal v1, mreal v2, long nsub) { if(n<2 || v1==v2) return 0; mglData *b=new mglData(n); mreal v[2]={v1,v2}; long nx=dat->GetNx(), ny=dat->GetNy(), nz=dat->GetNz(); - long ns=labs(nsub)+1, p[5]={n,ns,nx,ny,nz}; + long ns=labs(nsub)+1, p[5]={n,nsub,nx,ny,nz}; if(nsub==0) mglStartThread(mgl_hist_1,mgl_hist_p, nx*ny*nz, b->a,(const mreal *)dat,0,p,v); else mglStartThread(mgl_hist_2,mgl_hist_p, nx*ny*nz*ns*ns*ns, b->a,(const mreal *)dat,0,p,v); return b; @@ -822,7 +972,7 @@ HMDT MGL_EXPORT mgl_data_hist_w(HCDT dat, HCDT weight, long n, mreal v1, mreal v mreal v[2]={v1,v2}; long nx=dat->GetNx(), ny=dat->GetNy(), nz=dat->GetNz(); - long ns=labs(nsub)+1, p[5]={n,ns,nx,ny,nz}; + long ns=labs(nsub)+1, p[5]={n,nsub,nx,ny,nz}; if(nsub==0) mglStartThread(mgl_hist_1,mgl_hist_p, nx*ny*nz, b->a,(const mreal *)dat,(const mreal *)weight,p,v); else mglStartThread(mgl_hist_2,mgl_hist_p, nx*ny*nz*ns*ns*ns, b->a,(const mreal *)dat,(const mreal *)weight,p,v); return b; @@ -878,7 +1028,7 @@ int static mgl_root(const gsl_vector *x, void *params, gsl_vector *f) if(mgl_isbad(p->f[i])) ok=false; } return ok?GSL_SUCCESS:GSL_FAILURE; } -bool MGL_EXPORT mgl_find_roots(size_t n, void (*func)(const mreal *x, mreal *f, void *par), mreal *x0, void *par) +int MGL_EXPORT mgl_find_roots(size_t n, void (*func)(const mreal *x, mreal *f, void *par), mreal *x0, void *par) { for(size_t i=0;iGetNx(), ny = dat->GetNy(), nz = dat->GetNz(); + const bool ampl = mglchr(how, 'a'); + if(mglchr(how,'z')) + { + long ix = i, iy = j; + if(ix<0 || ix>=nx) ix = 0; + if(iy<0 || iy>=ny) iy = 0; + const long i0 = ix+nx*iy, nn = nx*ny; + const mreal v0 = dat->a[i0]; + for(long k=0;ka[i0+nn*k]; + mreal f = ampl? v0/v : (v*v0>0?1:-1); + for(long ii=0;iia[ii+nn*k] *= f; + } + } + else if(mglchr(how,'x')) + { + long iy = i, iz = j; + if(iz<0 || iz>=nz) iz = 0; + if(iy<0 || iy>=ny) iy = 0; + const long i0 = nx*(iy+ny*iz), nn = ny*nz; + const mreal v0 = dat->a[i0]; + for(long k=0;ka[i0+k]; + mreal f = ampl? v0/v : (v*v0>0?1:-1); + for(long ii=0;iia[k+nx*ii] *= f; + } + } + else // default is "y" + { + long ix = i, iz = j; + if(ix<0 || ix>=nx) ix = 0; + if(iz<0 || iz>=nz) iz = 0; + const long i0 = ix+nx*ny*iz; + const mreal v0 = dat->a[i0]; + for(long k=0;ka[i0+nx*k]; + mreal f = ampl? v0/v : (v*v0>0?1:-1); + for(long ii=0;iia[jj+nx*(k+ny*ii)] *= f; + } + } +} +void MGL_EXPORT mgl_data_keep_(uintptr_t *d, const char *how, long *i, long *j, int l) +{ char *s=new char[l+1]; memcpy(s,how,l); s[l]=0; + mgl_data_keep(_DT_, s, *i, *j); delete []s; } +//----------------------------------------------------------------------------- diff --git a/src/data_gr.cpp b/src/data_gr.cpp index 066335f..310b735 100644 --- a/src/data_gr.cpp +++ b/src/data_gr.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -28,9 +28,6 @@ #include "mgl2/thread.h" #include "mgl2/base.h" //----------------------------------------------------------------------------- -HMDT MGL_NO_EXPORT mglFormulaCalc(const char *str, const std::vector &head); -HADT MGL_NO_EXPORT mglFormulaCalcC(const char *str, const std::vector &head); -//----------------------------------------------------------------------------- void MGL_EXPORT mgl_data_refill_gr(HMGL gr, HMDT dat, HCDT xdat, HCDT ydat, HCDT zdat, HCDT vdat, long sl, const char *opt) { if(!vdat) return; @@ -81,8 +78,6 @@ void MGL_EXPORT mgl_datac_refill_gr_(uintptr_t *gr, uintptr_t *d, uintptr_t *xda //----------------------------------------------------------------------------- void MGL_EXPORT mgl_data_fill_eq(HMGL gr, HMDT d, const char *eq, HCDT vdat, HCDT wdat, const char *opt) { - if(vdat && vdat->GetNN()!=d->GetNN()) return; // incompatible dimensions - if(wdat && wdat->GetNN()!=d->GetNN()) return; gr->SaveState(opt); std::wstring s = d->Name(); d->Name(L"u"); mglDataV x(d->nx,d->ny,d->nz, gr->Min.x,gr->Max.x,'x'); x.Name(L"x"); @@ -106,8 +101,6 @@ void MGL_EXPORT mgl_data_fill_eq_(uintptr_t *gr, uintptr_t *d, const char *eq, u //----------------------------------------------------------------------------- void MGL_EXPORT mgl_datac_fill_eq(HMGL gr, HADT d, const char *eq, HCDT vdat, HCDT wdat, const char *opt) { - if(vdat && vdat->GetNN()!=d->GetNN()) return; // incompatible dimensions - if(wdat && wdat->GetNN()!=d->GetNN()) return; gr->SaveState(opt); std::wstring s = d->Name(); d->Name(L"u"); mglDataV x(d->nx,d->ny,d->nz, gr->Min.x,gr->Max.x,'x'); x.Name(L"x"); diff --git a/src/data_io.cpp b/src/data_io.cpp index a4f7762..c2464f1 100644 --- a/src/data_io.cpp +++ b/src/data_io.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -40,7 +40,6 @@ #endif inline bool isn(char ch) {return ch=='\n';} -HMDT MGL_NO_EXPORT mglFormulaCalc(const char *str, const std::vector &head); //----------------------------------------------------------------------------- HMDT MGL_EXPORT mgl_create_data() { return new mglData; } HMDT MGL_EXPORT mgl_create_data_size(long nx, long ny, long nz){ return new mglData(nx,ny,nz); } @@ -48,14 +47,14 @@ HMDT MGL_EXPORT mgl_create_data_file(const char *fname) { return new mglData(fn void MGL_EXPORT mgl_delete_data(HMDT d) { if(d) delete d; } //----------------------------------------------------------------------------- uintptr_t MGL_EXPORT mgl_create_data_() -{ return uintptr_t(new mglData()); } +{ return uintptr_t(mgl_create_data()); } uintptr_t MGL_EXPORT mgl_create_data_size_(int *nx, int *ny, int *nz) -{ return uintptr_t(new mglData(*nx,*ny,*nz)); } +{ return uintptr_t(mgl_create_data_size(*nx,*ny,*nz)); } uintptr_t MGL_EXPORT 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; } + uintptr_t r = uintptr_t(mgl_create_data_file(s)); delete []s; return r; } void MGL_EXPORT mgl_delete_data_(uintptr_t *d) -{ if(_DT_) delete _DT_; } +{ mgl_delete_data(_DT_); } //----------------------------------------------------------------------------- void mglFromStr(HMDT d,char *buf,long NX,long NY,long NZ) { @@ -309,6 +308,33 @@ std::string MGL_EXPORT mgl_str_arg(const std::string &str, char ch, int n1, int return res; } //----------------------------------------------------------------------------- +/// Get section separated by symbol ch. This is analog of QString::section(). +std::vector MGL_EXPORT mgl_wcs_args(const std::wstring &str, wchar_t ch) +{ + std::vector pos; pos.push_back(0); + for(size_t p=0; p != std::string::npos;) + { p=str.find(ch,p+1); pos.push_back(p?p+1:0); } + std::vector res; + for(size_t i=0;i pos; pos.push_back(0); + for(size_t p=0; p != std::string::npos;) + { p=str.find(ch,p+1); pos.push_back(p?p+1:0); } + std::wstring res; + if(n2<0) n2=n1; + if(n1<0 || n1>=long(pos.size())-1 || n2=long(pos.size())) n2=pos.size()-1; + res = str.substr(pos[n1],pos[n2+1]-pos[n1]-1); + if(res.size()==1 && res[0]==ch) res.clear(); + return res; +} +//----------------------------------------------------------------------------- /// Get string from number. std::string MGL_EXPORT mgl_str_num(double val) { char buf[32]; snprintf(buf,32,"%g",val); return std::string(buf); } @@ -374,6 +400,92 @@ MGL_NO_EXPORT char *mgl_read_gz(gzFile fp) return buf; } //----------------------------------------------------------------------------- +int MGL_EXPORT mgl_data_read_bin(HMDT dat, const char *fname, int kind) +{ + FILE *fp = fopen(fname,"rb"); + if(!fp) return 0; + fseek(fp,0,SEEK_END); + long len=ftell(fp), n=0; // file length, and number of elements + fseek(fp,0,SEEK_SET); + switch(kind) + { + case 0: // double type + n = len/sizeof(double); + if(n>0) + { + double *a = new double[n]; + n = fread(a,sizeof(double),n,fp); + dat->Create(n); + for(long i=0;ia[i]=a[i]; + } + break; + case 1: // float type + n = len/sizeof(float); + if(n>0) + { + float *a = new float[n]; + n = fread(a,sizeof(float),n,fp); + dat->Create(n); + for(long i=0;ia[i]=a[i]; + } + break; + case 2: // long double type + n = len/sizeof(long double); + if(n>0) + { + long double *a = new long double[n]; + n = fread(a,sizeof(long double),n,fp); + dat->Create(n); + for(long i=0;ia[i]=a[i]; + } + break; + case 3: // long int type + n = len/sizeof(long); + if(n>0) + { + long *a = new long[n]; + n = fread(a,sizeof(long),n,fp); + dat->Create(n); + for(long i=0;ia[i]=a[i]; + } + break; + case 4: // int type + n = len/sizeof(int); + if(n>0) + { + int *a = new int[n]; + n = fread(a,sizeof(int),n,fp); + dat->Create(n); + for(long i=0;ia[i]=a[i]; + } + break; + case 5: // short int type + n = len/sizeof(short); + if(n>0) + { + short *a = new short[n]; + n = fread(a,sizeof(short),n,fp); + dat->Create(n); + for(long i=0;ia[i]=a[i]; + } + break; + case 6: // char type + n = len/sizeof(char); + if(n>0) + { + char *a = new char[n]; + n = fread(a,sizeof(char),n,fp); + dat->Create(n); + for(long i=0;ia[i]=a[i]; + } + break; + } + return 1; +} +int MGL_EXPORT mgl_data_read_bin_(uintptr_t *d, const char *fname,int *kind,int l) +{ char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; + int r = mgl_data_read_bin(_DT_, s, *kind); delete []s; return r; } +//----------------------------------------------------------------------------- int MGL_EXPORT mgl_data_read(HMDT d, const char *fname) { long l=1,m=1,k=1,i; @@ -1010,7 +1122,7 @@ static void *mgl_modify(void *par) void MGL_EXPORT 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}; - if(dim<=0) mgl_data_modify_vw(d,eq,0,0); // fastes variant for whole array + if(dim<=0) mgl_data_modify_vw(d,eq,0,0); // fastest variant for whole array else if(nz>1) // 3D array { mglFormula f(eq); @@ -1093,6 +1205,61 @@ int MGL_EXPORT mgl_data_read_hdf4(HMDT ,const char *,const char *) #endif //----------------------------------------------------------------------------- #if MGL_HAVE_HDF5 +void MGL_EXPORT mgl_dual_save_hdf(mdual val,const char *fname,const char *data,int rewrite) +{ + hid_t hf,hd,hs; + hsize_t dims[4]={1,2}; + long rank = 2, res; + H5Eset_auto(0,0); + 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; + hs = H5Screate_simple(rank, dims, 0); +#if MGL_USE_DOUBLE + hid_t mem_type_id = H5T_NATIVE_DOUBLE; +#else + hid_t mem_type_id = H5T_NATIVE_FLOAT; +#endif + hd = H5Dcreate(hf, data, mem_type_id, hs, H5P_DEFAULT); + H5Dwrite(hd, mem_type_id, hs, hs, H5P_DEFAULT, &val); + H5Dclose(hd); H5Sclose(hs); H5Fclose(hf); +} +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_real_save_hdf(double val,const char *fname,const char *data,int rewrite) +{ + hid_t hf,hd,hs; + hsize_t dims[3]={1,1,1}; + long rank = 1, res; + H5Eset_auto(0,0); + 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; + hs = H5Screate_simple(rank, dims, 0); + hid_t mem_type_id = H5T_NATIVE_DOUBLE; + hd = H5Dcreate(hf, data, mem_type_id, hs, H5P_DEFAULT); + H5Dwrite(hd, mem_type_id, hs, hs, H5P_DEFAULT, &val); + H5Dclose(hd); H5Sclose(hs); H5Fclose(hf); +} +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_int_save_hdf(long val,const char *fname,const char *data,int rewrite) +{ + hid_t hf,hd,hs; + hsize_t dims[3]={1,1,1}; + long rank = 1, res; + H5Eset_auto(0,0); + 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; + hs = H5Screate_simple(rank, dims, 0); + hid_t mem_type_id = H5T_NATIVE_LONG; + hd = H5Dcreate(hf, data, mem_type_id, hs, H5P_DEFAULT); + H5Dwrite(hd, mem_type_id, hs, hs, H5P_DEFAULT, &val); + H5Dclose(hd); H5Sclose(hs); H5Fclose(hf); +} +//----------------------------------------------------------------------------- void MGL_EXPORT mgl_data_save_hdf(HCDT dat,const char *fname,const char *data,int rewrite) { const mglData *d = dynamic_cast(dat); // NOTE: slow for non-mglData @@ -1127,8 +1294,9 @@ int MGL_EXPORT mgl_data_read_hdf(HMDT d,const char *fname,const char *data) hf = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); if(hf<0) return 0; hd = H5Dopen(hf,data); - if(hd<0) return 0; + if(hd<0) { H5Fclose(hf); return 0; } hs = H5Dget_space(hd); + if(hs<0) { H5Dclose(hd); H5Fclose(hf); return 0; } rank = H5Sget_simple_extent_ndims(hs); if(rank>0 && rank<=3) { @@ -1195,6 +1363,12 @@ long MGL_EXPORT mgl_datas_hdf(const char *, char *, long ) { mgl_set_global_warn(_("HDF5 support was disabled. Please, enable it and rebuild MathGL.")); return 0;} int MGL_EXPORT mgl_data_read_hdf(HMDT ,const char *,const char *) { mgl_set_global_warn(_("HDF5 support was disabled. Please, enable it and rebuild MathGL.")); return 0;} +void MGL_EXPORT mgl_dual_save_hdf(mdual val,const char *fname,const char *data,int rewrite) +{ mgl_set_global_warn(_("HDF5 support was disabled. Please, enable it and rebuild MathGL.")); } +void MGL_EXPORT mgl_real_save_hdf(double val,const char *fname,const char *data,int rewrite) +{ mgl_set_global_warn(_("HDF5 support was disabled. Please, enable it and rebuild MathGL.")); } +void MGL_EXPORT mgl_int_save_hdf(long val,const char *fname,const char *data,int rewrite) +{ mgl_set_global_warn(_("HDF5 support was disabled. Please, enable it and rebuild MathGL.")); } #endif //----------------------------------------------------------------------------- int MGL_EXPORT mgl_data_read_hdf_(uintptr_t *d, const char *fname, const char *data,int l,int n) @@ -1208,6 +1382,14 @@ void MGL_EXPORT mgl_data_save_hdf_(uintptr_t *d, const char *fname, const char * long MGL_EXPORT mgl_datas_hdf_(const char *fname, char *buf, int l, int size) { char *s=new char[l+1]; memcpy(s,fname,l); s[l]=0; int r = mgl_datas_hdf(s,buf,size); delete []s; return r; } +void MGL_EXPORT mgl_real_save_hdf_(double *val,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_real_save_hdf(*val,s,t,*rewrite); delete []s; delete []t; } +void MGL_EXPORT mgl_int_save_hdf_(long *val,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_int_save_hdf(*val,s,t,*rewrite); delete []s; delete []t; } //----------------------------------------------------------------------------- bool MGL_EXPORT mgl_add_file(long &kx,long &ky, long &kz, mreal *&b, mglData *d,bool as_slice) { diff --git a/src/data_png.cpp b/src/data_png.cpp index b72ada0..20d10c5 100644 --- a/src/data_png.cpp +++ b/src/data_png.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -217,24 +217,26 @@ printf("\n"); #else long num=0; unsigned char *c = mgl_create_scheme(scheme,num); - if(num<2) return; - d->Create(w,h,1); -#pragma omp parallel for collapse(2) - for(long i=0;i=2) { - unsigned pos=0,mval=256*256; - const unsigned char *c2=g+4*w*(d->ny-i-1)+4*j; - for(long k=0;kCreate(w,h,1); +#pragma omp parallel for collapse(2) + for(long i=0;iny-i-1)+4*j; + for(long k=0;ka[j+d->nx*i] = v1 + pos*(v2-v1)/(num-1); } - d->a[j+d->nx*i] = v1 + pos*(v2-v1)/(num-1); } delete []c; delete []g; #endif diff --git a/src/eval.cpp b/src/eval.cpp index 7f87793..157bed9 100644 --- a/src/eval.cpp +++ b/src/eval.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -132,7 +132,7 @@ EQ_CL // Clausen function //----------------------------------------------------------------------------- int mglFormula::Error=0; bool MGL_LOCAL_PURE mglCheck(char *str,int n); -int MGL_LOCAL_PURE mglFindInText(const char *str, const char *lst); +long MGL_LOCAL_PURE mglFindInText(const char *str, const char *lst); //----------------------------------------------------------------------------- #if MGL_HAVE_GSL MGL_NO_EXPORT gsl_rng *mgl_rng=0; // NOTE: should be deleted by gsl_rng_free() but I don't know where :( @@ -253,7 +253,7 @@ mglFormula::mglFormula(const char *string) delete []str; return; } n=mglFindInText(str,"+-"); // normal priority -- additions - if(n>=0 && (n<2 || str[n-1]!='e' || (str[n-2]!='.' && !isdigit(str[n-2])))) + if(n>=0 && (n<2 || !strchr("eE",str[n-1]) || (str[n-2]!='.' && !isdigit(str[n-2])))) { if(str[n]=='+') Kod=EQ_ADD; else Kod=EQ_SUB; str[n]=0; @@ -532,6 +532,7 @@ double MGL_LOCAL_CONST mgl_acosh(double x) { return x>1 ? log(x+sqrt(x*x-1.)) : double MGL_LOCAL_CONST mgl_atanh(double x) { return fabs(x)<1 ? log((1.+x)/(1.-x))/2 : NAN; } double MGL_LOCAL_CONST mgl_fmin(double a,double b) { return a > b ? b : a; } double MGL_LOCAL_CONST mgl_fmax(double a,double b) { return a > b ? a : b; } +double MGL_LOCAL_CONST mgl_fmod(double a, double m) { return (a>=0)?fmod(a,m):fmod(a,m)+m; } //----------------------------------------------------------------------------- typedef double (*func_1)(double); typedef double (*func_2)(double, double); @@ -543,7 +544,7 @@ static const mreal z2[EQ_SIN-EQ_LT] = {3,3,3,3,0,3,3,0,0,0,0,0,NAN,3,3,3,3 ,0,0,0,0,0,0,0,0,0 #endif }; -static const func_2 f2[EQ_SIN-EQ_LT] = {clt,cgt,ceq,cor,cand,add,sub,mul,del,ipw,pow,fmod,llg,arg,hypot,mgl_fmax,mgl_fmin +static const func_2 f2[EQ_SIN-EQ_LT] = {clt,cgt,ceq,cor,cand,add,sub,mul,del,ipw,pow,mgl_fmod,llg,arg,hypot,mgl_fmax,mgl_fmin #if MGL_HAVE_GSL ,gsl_sf_bessel_Jnu,gsl_sf_bessel_Ynu, gsl_sf_bessel_Inu,gsl_sf_bessel_Knu, @@ -760,7 +761,7 @@ bool MGL_LOCAL_PURE mglCheck(char *str,int n) } //----------------------------------------------------------------------------- // Try to find one of symbols lst in the string str -int MGL_LOCAL_PURE mglFindInText(const char *str, const char *lst) +long MGL_LOCAL_PURE mglFindInText(const char *str, const char *lst) { long l=0,r=0,len=strlen(str); for(long i=len-1;i>=0;i--) diff --git a/src/evalc.cpp b/src/evalc.cpp index bedf91f..9e527f1 100644 --- a/src/evalc.cpp +++ b/src/evalc.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -71,7 +71,7 @@ EQ_LAST // id of last entry //----------------------------------------------------------------------------- int mglFormulaC::Error=0; bool MGL_LOCAL_PURE mglCheck(char *str,int n); -int MGL_LOCAL_PURE mglFindInText(const char *str, const char *lst); +long MGL_LOCAL_PURE mglFindInText(const char *str, const char *lst); //----------------------------------------------------------------------------- mglFormulaC::~mglFormulaC() { @@ -81,13 +81,12 @@ mglFormulaC::~mglFormulaC() } //----------------------------------------------------------------------------- // Formula constructor (automatically parse and "compile" formula) -mglFormulaC::mglFormulaC(const char *string) +mglFormulaC::mglFormulaC(const char *string):Res(0) { dat = tmp = NULL; dx1=dy1=dz1=0; dx2=dy2=dz2=1; - Error=0; + Error=Kod=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); @@ -129,7 +128,7 @@ mglFormulaC::mglFormulaC(const char *string) delete []str; return; } n=mglFindInText(str,"+-"); // normal priority -- additions - if(n>=0 && (n<2 || str[n-1]!='e' || (str[n-2]!='.' && !isdigit(str[n-2])))) + if(n>=0 && (n<2 || !strchr("eE",str[n-1]) || (str[n-2]!='.' && !isdigit(str[n-2])))) { if(str[n]=='+') Kod=EQ_ADD; else Kod=EQ_SUB; str[n]=0; diff --git a/src/evalp.cpp b/src/evalp.cpp index 83ec390..8154d9c 100644 --- a/src/evalp.cpp +++ b/src/evalp.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -28,26 +28,50 @@ #endif //----------------------------------------------------------------------------- std::wstring mgl_trim_ws(const std::wstring &str); -HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring string, mglParser *arg, const std::vector &head); -HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring string, mglParser *arg, const std::vector &head); +HMDT MGL_NO_EXPORT mglFormulaCalc(const std::wstring &string, mglParser *arg, const std::vector &head); +HADT MGL_NO_EXPORT mglFormulaCalcC(const std::wstring &string, mglParser *arg, const std::vector &head); +HMDT MGL_NO_EXPORT mglFormulaCalcA(std::wstring string, mglParser *arg, const std::vector &head, const std::vector &fns); +HADT MGL_NO_EXPORT mglFormulaCalcAC(std::wstring string, mglParser *arg, const std::vector &head, const std::vector &fns); //----------------------------------------------------------------------------- -HMDT MGL_NO_EXPORT mglFormulaCalc(const char *str, const std::vector &head) +HMDT MGL_EXPORT mgl_formula_calc(const char *str, long n, ...) { + if(n<1) return NULL; + std::vector head; + va_list vl; va_start(vl,n); + for(long i=0;i head; + va_list vl; va_start(vl,n); + for(long i=0;i &head) +{ + if(!str || *str==0) return NULL; std::wstring s; for(long i=0;str[i];i++) s.push_back(str[i]); return mglFormulaCalc(s,0,head); } //----------------------------------------------------------------------------- -HADT MGL_NO_EXPORT mglFormulaCalcC(const char *str, const std::vector &head) +HADT MGL_EXPORT mglFormulaCalcC(const char *str, const std::vector &head) { + if(!str || *str==0) return NULL; std::wstring s; for(long i=0;str[i];i++) s.push_back(str[i]); return mglFormulaCalcC(s,0,head); } //----------------------------------------------------------------------------- -HMDT mglApplyFunc(std::wstring str, mglParser *arg, const std::vector &head, double (*func)(double)) +HMDT MGL_NO_EXPORT mglApplyFunc(const std::wstring &str, mglParser *arg, const std::vector &head, double (*func)(double), const std::vector &fns) { - HMDT d = mglFormulaCalc(str, arg, head); + HMDT d = mglFormulaCalcA(str, arg, head, fns); long n = d->GetNN(); mreal *dd=d->a; #pragma omp parallel for for(long i=0;i } //----------------------------------------------------------------------------- #if MGL_HAVE_GSL -HMDT mglApplyFuncGSL(std::wstring str, mglParser *arg, const std::vector &head, double (*func)(double, gsl_mode_t)) +HMDT MGL_NO_EXPORT mglApplyFuncGSL(const std::wstring &str, mglParser *arg, const std::vector &head, double (*func)(double, gsl_mode_t), const std::vector &fns) { - HMDT d = mglFormulaCalc(str, arg, head); + HMDT d = mglFormulaCalcA(str, arg, head, fns); long n = d->GetNN(); mreal *dd=d->a; #pragma omp parallel for for(long i=0;i &head, double (*func)(double,double)) +HMDT MGL_NO_EXPORT mglApplyOper(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector &head, double (*func)(double,double), const std::vector &fns) { - HMDT a = mglFormulaCalc(a1,arg,head), b = mglFormulaCalc(a2,arg,head), r,d; + HMDT a = mglFormulaCalcA(a1,arg,head, fns), b = mglFormulaCalcA(a2,arg,head,fns), r,d; long na = a->GetNN(), nb = b->GetNN(), nn; if(na!=1) { r=a; d=b; nn=na; } else { r=b; d=a; nn=nb; } @@ -84,9 +108,9 @@ HMDT mglApplyOper(std::wstring a1, std::wstring a2, mglParser *arg, const std::v mgl_delete_data(d); return r; } //----------------------------------------------------------------------------- -HMDT mglApplyOperAdd(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector &head) +HMDT MGL_NO_EXPORT mglApplyOperAdd(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector &head, const std::vector &fns) { - HMDT a = mglFormulaCalc(a1,arg,head), b = mglFormulaCalc(a2,arg,head), r,d; + HMDT a = mglFormulaCalcA(a1,arg,head,fns), b = mglFormulaCalcA(a2,arg,head,fns), r,d; long na = a->GetNN(), nb = b->GetNN(), nn; if(na!=1) { r=a; d=b; nn=na; } else { r=b; d=a; nn=nb; } @@ -100,9 +124,9 @@ HMDT mglApplyOperAdd(std::wstring a1, std::wstring a2, mglParser *arg, const std mgl_delete_data(d); return r; } //----------------------------------------------------------------------------- -HMDT mglApplyOperSub(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector &head) +HMDT MGL_NO_EXPORT mglApplyOperSub(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector &head, const std::vector &fns) { - HMDT a = mglFormulaCalc(a1,arg,head), b = mglFormulaCalc(a2,arg,head), r,d; + HMDT a = mglFormulaCalcA(a1,arg,head,fns), b = mglFormulaCalcA(a2,arg,head,fns), r,d; long na = a->GetNN(), nb = b->GetNN(), nn; if(na!=1) { r=a; d=b; nn=na; } else { r=b; d=a; nn=nb; } @@ -119,9 +143,9 @@ HMDT mglApplyOperSub(std::wstring a1, std::wstring a2, mglParser *arg, const std mgl_delete_data(d); return r; } //----------------------------------------------------------------------------- -HMDT mglApplyOperMul(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector &head) +HMDT MGL_NO_EXPORT mglApplyOperMul(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector &head, const std::vector &fns) { - HMDT a = mglFormulaCalc(a1,arg,head), b = mglFormulaCalc(a2,arg,head), r,d; + HMDT a = mglFormulaCalcA(a1,arg,head,fns), b = mglFormulaCalcA(a2,arg,head,fns), r,d; long na = a->GetNN(), nb = b->GetNN(), nn; if(na!=1) { r=a; d=b; nn=na; } else { r=b; d=a; nn=nb; } @@ -135,9 +159,9 @@ HMDT mglApplyOperMul(std::wstring a1, std::wstring a2, mglParser *arg, const std mgl_delete_data(d); return r; } //----------------------------------------------------------------------------- -HMDT mglApplyOperDiv(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector &head) +HMDT MGL_NO_EXPORT mglApplyOperDiv(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector &head, const std::vector &fns) { - HMDT a = mglFormulaCalc(a1,arg,head), b = mglFormulaCalc(a2,arg,head), r,d; + HMDT a = mglFormulaCalcA(a1,arg,head,fns), b = mglFormulaCalcA(a2,arg,head,fns), r,d; long na = a->GetNN(), nb = b->GetNN(), nn; if(na!=1) { r=a; d=b; nn=na; } else { r=b; d=a; nn=nb; } @@ -157,18 +181,18 @@ HMDT mglApplyOperDiv(std::wstring a1, std::wstring a2, mglParser *arg, const std mgl_delete_data(d); return r; } //----------------------------------------------------------------------------- -HADT mglApplyFuncC(std::wstring str, mglParser *arg, const std::vector &head, dual (*func)(dual)) +HADT MGL_NO_EXPORT mglApplyFuncC(const std::wstring &str, mglParser *arg, const std::vector &head, dual (*func)(dual), const std::vector &fns) { - HADT d = mglFormulaCalcC(str, arg, head); + HADT d = mglFormulaCalcAC(str, arg, head,fns); long n = d->GetNN(); dual *dd=d->a; #pragma omp parallel for for(long i=0;i &head, dual (*func)(dual,dual)) +HADT MGL_NO_EXPORT mglApplyOperC(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector &head, dual (*func)(dual,dual), const std::vector &fns) { - HADT a = mglFormulaCalcC(a1,arg,head), b = mglFormulaCalcC(a2,arg,head), r,d; + HADT a = mglFormulaCalcAC(a1,arg,head,fns), b = mglFormulaCalcAC(a2,arg,head,fns), r,d; long na = a->GetNN(), nb = b->GetNN(), nn; if(na!=1) { r=a; d=b; nn=na; } else { r=b; d=a; nn=nb; } @@ -185,9 +209,9 @@ HADT mglApplyOperC(std::wstring a1, std::wstring a2, mglParser *arg, const std:: mgl_delete_datac(d); return r; } //----------------------------------------------------------------------------- -HADT mglApplyOperAddC(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector &head) +HADT MGL_NO_EXPORT mglApplyOperAddC(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector &head, const std::vector &fns) { - HADT a = mglFormulaCalcC(a1,arg,head), b = mglFormulaCalcC(a2,arg,head), r,d; + HADT a = mglFormulaCalcAC(a1,arg,head,fns), b = mglFormulaCalcAC(a2,arg,head,fns), r,d; long na = a->GetNN(), nb = b->GetNN(), nn; if(na!=1) { r=a; d=b; nn=na; } else { r=b; d=a; nn=nb; } @@ -201,9 +225,9 @@ HADT mglApplyOperAddC(std::wstring a1, std::wstring a2, mglParser *arg, const st mgl_delete_datac(d); return r; } //----------------------------------------------------------------------------- -HADT mglApplyOperSubC(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector &head) +HADT MGL_NO_EXPORT mglApplyOperSubC(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector &head, const std::vector &fns) { - HADT a = mglFormulaCalcC(a1,arg,head), b = mglFormulaCalcC(a2,arg,head), r,d; + HADT a = mglFormulaCalcAC(a1,arg,head,fns), b = mglFormulaCalcAC(a2,arg,head,fns), r,d; long na = a->GetNN(), nb = b->GetNN(), nn; if(na!=1) { r=a; d=b; nn=na; } else { r=b; d=a; nn=nb; } @@ -220,9 +244,9 @@ HADT mglApplyOperSubC(std::wstring a1, std::wstring a2, mglParser *arg, const st mgl_delete_datac(d); return r; } //----------------------------------------------------------------------------- -HADT mglApplyOperMulC(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector &head) +HADT MGL_NO_EXPORT mglApplyOperMulC(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector &head, const std::vector &fns) { - HADT a = mglFormulaCalcC(a1,arg,head), b = mglFormulaCalcC(a2,arg,head), r,d; + HADT a = mglFormulaCalcAC(a1,arg,head,fns), b = mglFormulaCalcAC(a2,arg,head,fns), r,d; long na = a->GetNN(), nb = b->GetNN(), nn; if(na!=1) { r=a; d=b; nn=na; } else { r=b; d=a; nn=nb; } @@ -236,9 +260,9 @@ HADT mglApplyOperMulC(std::wstring a1, std::wstring a2, mglParser *arg, const st mgl_delete_datac(d); return r; } //----------------------------------------------------------------------------- -HADT mglApplyOperDivC(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector &head) +HADT MGL_NO_EXPORT mglApplyOperDivC(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector &head, const std::vector &fns) { - HADT a = mglFormulaCalcC(a1,arg,head), b = mglFormulaCalcC(a2,arg,head), r,d; + HADT a = mglFormulaCalcAC(a1,arg,head,fns), b = mglFormulaCalcAC(a2,arg,head,fns), r,d; long na = a->GetNN(), nb = b->GetNN(), nn; if(na!=1) { r=a; d=b; nn=na; } else { r=b; d=a; nn=nb; } @@ -270,14 +294,17 @@ bool MGL_LOCAL_PURE mglCheck(std::wstring str) return (s==0) ? true : false; } //----------------------------------------------------------------------------- -long MGL_LOCAL_PURE mglFindInText(const std::wstring &str,const char *lst) +long MGL_LOCAL_PURE mglFindInText(const std::wstring &str,const char *lst, int num=0) { - long l=0,r=0; + long l=0,r=0,ls=0,rs=0; for(long i=str.length()-1;i>=0;i--) { if(str[i]=='(') l++; if(str[i]==')') r++; - if(l==r && strchr(lst,str[i])) return i; + if(str[i]=='[') ls++; + if(str[i]==']') rs++; + if(l==r && ls==rs && strchr(lst,str[i])) + { num--; if(num<0) return i; } } return -1; } @@ -302,6 +329,7 @@ double MGL_LOCAL_CONST mgl_acosh(double x); double MGL_LOCAL_CONST mgl_atanh(double x); double MGL_LOCAL_CONST mgl_fmin(double a,double b); double MGL_LOCAL_CONST mgl_fmax(double a,double b); +double MGL_LOCAL_CONST mgl_fmod(double a, double m); //----------------------------------------------------------------------------- // It seems that standard wcstombs() have a bug. So, I replace by my own. void MGL_EXPORT mgl_wcstombs(char *dst, const wchar_t *src, int size) @@ -315,7 +343,8 @@ void MGL_EXPORT mgl_wcstombs(char *dst, const wchar_t *src, int size) MGL_LOCAL_PURE const mglDataA *FindVar(const std::vector &head, const std::wstring &name) { for(size_t i=0;iName()==name) return head[i]; + if(head[i] && !wcscmp(head[i]->Name(),name.c_str())) // bypass std::string comparison warning + return head[i]; return 0; } //----------------------------------------------------------------------------- @@ -326,7 +355,7 @@ void MGL_EXPORT mgl_wcslwr(wchar_t *str) str[k] = (str[k]>='A' && str[k]<='Z') ? str[k]+'a'-'A' : str[k]; } //----------------------------------------------------------------------------- -mreal mgl_gettime(const std::wstring &s) +mreal MGL_NO_EXPORT mgl_gettime(const std::wstring &s) { mreal t=NAN; tm a; memset(&a,0,sizeof(tm)); @@ -348,11 +377,117 @@ mreal mgl_gettime(const std::wstring &s) return t; } //----------------------------------------------------------------------------- +double MGL_NO_EXPORT mgl_jac_sn(double a, double m) +{ + double sn=0, cn=0, dn=0; +#if MGL_HAVE_GSL + gsl_sf_elljac_e(a,m, &sn, &cn, &dn); +#endif + return sn; +} +double MGL_NO_EXPORT mgl_jac_sc(double a, double m) +{ + double sn=0, cn=1, dn=0; +#if MGL_HAVE_GSL + gsl_sf_elljac_e(a,m, &sn, &cn, &dn); +#endif + return sn/cn; +} +double MGL_NO_EXPORT mgl_jac_sd(double a, double m) +{ + double sn=0, cn=0, dn=1; +#if MGL_HAVE_GSL + gsl_sf_elljac_e(a,m, &sn, &cn, &dn); +#endif + return sn/dn; +} + +double MGL_NO_EXPORT mgl_jac_cn(double a, double m) +{ + double sn=1, cn=0, dn=0; +#if MGL_HAVE_GSL + gsl_sf_elljac_e(a,m, &sn, &cn, &dn); +#endif + return cn; +} +double MGL_NO_EXPORT mgl_jac_cs(double a, double m) +{ + double sn=1, cn=0, dn=0; +#if MGL_HAVE_GSL + gsl_sf_elljac_e(a,m, &sn, &cn, &dn); +#endif + return cn/sn; +} +double MGL_NO_EXPORT mgl_jac_cd(double a, double m) +{ + double sn=0, cn=0, dn=1; +#if MGL_HAVE_GSL + gsl_sf_elljac_e(a,m, &sn, &cn, &dn); +#endif + return cn/dn; +} + +double MGL_NO_EXPORT mgl_jac_dn(double a, double m) +{ + double sn=0, cn=0, dn=0; +#if MGL_HAVE_GSL + gsl_sf_elljac_e(a,m, &sn, &cn, &dn); +#endif + return dn; +} +double MGL_NO_EXPORT mgl_jac_ds(double a, double m) +{ + double sn=1, cn=0, dn=0; +#if MGL_HAVE_GSL + gsl_sf_elljac_e(a,m, &sn, &cn, &dn); +#endif + return dn/sn; +} +double MGL_NO_EXPORT mgl_jac_dc(double a, double m) +{ + double sn=0, cn=1, dn=0; +#if MGL_HAVE_GSL + gsl_sf_elljac_e(a,m, &sn, &cn, &dn); +#endif + return dn/cn; +} + +double MGL_NO_EXPORT mgl_jac_nd(double a, double m) +{ + double sn=0, cn=0, dn=1; +#if MGL_HAVE_GSL + gsl_sf_elljac_e(a,m, &sn, &cn, &dn); +#endif + return 1./dn; +} +double MGL_NO_EXPORT mgl_jac_ns(double a, double m) +{ + double sn=1, cn=0, dn=0; +#if MGL_HAVE_GSL + gsl_sf_elljac_e(a,m, &sn, &cn, &dn); +#endif + return 1./sn; +} +double MGL_NO_EXPORT mgl_jac_nc(double a, double m) +{ + double sn=0, cn=1, dn=0; +#if MGL_HAVE_GSL + gsl_sf_elljac_e(a,m, &sn, &cn, &dn); +#endif + return 1./cn; +} +//----------------------------------------------------------------------------- /// Parse string and substitute the script argument // All numbers are presented as mglData(1). Do boundary checking. // NOTE: In any case where number is required the mglData::a[0] is used. // String flag is binary 0x1 -> 'x', 0x2 -> 'y', 0x4 -> 'z' -HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::vector &head) +HMDT MGL_NO_EXPORT mglFormulaCalc(const std::wstring &str, mglParser *arg, const std::vector &head) +{ + if(str.empty()) return NULL; + std::vector fns = mgl_wcs_args(str,'\\'); + return mglFormulaCalcA(fns[0],arg,head,fns); +} +HMDT MGL_NO_EXPORT mglFormulaCalcA(std::wstring str, mglParser *arg, const std::vector &head, const std::vector &fns) { #if MGL_HAVE_GSL gsl_set_error_handler_off(); @@ -419,18 +554,19 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v n=mglFindInText(str,"&|"); // lowest priority -- logical if(n>=0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, str[n]=='|'?cor:cand); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, str[n]=='|'?cor:cand,fns); n=mglFindInText(str,"<>="); // low priority -- conditions if(n>=0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, str[n]=='<'?clt:(str[n]=='>'?cgt:ceq)); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, str[n]=='<'?clt:(str[n]=='>'?cgt:ceq),fns); n=mglFindInText(str,"+-"); // normal priority -- additions - if(n>=0 && (n<2 || str[n-1]!='e' || (str[n-2]!='.' && !isdigit(str[n-2])) )) - return str[n]=='+'? mglApplyOperAdd(str.substr(0,n),str.substr(n+1),arg, head) : mglApplyOperSub(str.substr(0,n),str.substr(n+1),arg, head); + if(n>=0 && (n<2 || !strchr("eE",str[n-1]) || (str[n-2]!='.' && !isdigit(str[n-2])) )) + return str[n]=='+'? mglApplyOperAdd(str.substr(0,n),str.substr(n+1),arg, head,fns) : + mglApplyOperSub(str.substr(0,n),str.substr(n+1),arg, head,fns); n=mglFindInText(str,"*/%"); // high priority -- multiplications if(n>=0) - return str[n]=='*'? mglApplyOperMul(str.substr(0,n),str.substr(n+1),arg, head) : - (str[n]=='/'? mglApplyOperDiv(str.substr(0,n),str.substr(n+1),arg, head) : - mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, fmod)); + return str[n]=='*'? mglApplyOperMul(str.substr(0,n),str.substr(n+1),arg, head,fns) : + (str[n]=='/'? mglApplyOperDiv(str.substr(0,n),str.substr(n+1),arg, head,fns) : + mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_fmod,fns)); n=mglFindInText(str,"@"); // high priority -- combine if(n>=0) { @@ -441,7 +577,7 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v return res?res:new mglData; } n=mglFindInText(str,"^"); // highest priority -- power - if(n>=0) return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, ipw); + if(n>=0) return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, ipw,fns); n=mglFindInText(str,":"); // highest priority -- array if(n>=0 && str.compare(L":")) { @@ -454,7 +590,7 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v } n=mglFindInText(str,"."); // highest priority -- suffixes wchar_t c0 = str[n+1]; - if(n>=0 && c0>='a' && c0!='e') + if(n>=0 && c0>='a' && c0!='e' && c0!='E' && !isdigit(c0)) { mreal x,y,z,k,v=NAN; HMDT d = mglFormulaCalc(str.substr(0,n), arg, head); @@ -478,11 +614,7 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v else if(!p.compare(L"nmin")) { v=d->Minimal(); v = v<0?v:0; } } else if(c0=='k') - { - d->Momentum(ch,x,y,z,k); - if(ch=='a') v = k; - else if(ch>='x' && ch<='z') v = k/ns[ch-'x']; - } + { d->Momentum(ch,x,y,z,k); v=k; } else if(c0=='w') { d->Momentum(ch,x,y); @@ -506,10 +638,8 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v else if(c0=='s') { if(ch=='u' && p[2]=='m') v = d->Momentum('x',x,y); - else if(ch=='a') + else if(ch=='a' || (ch>='x' && ch<='z')) { d->Momentum(ch,x,y,z,k); v = z; } - else if(ch>='x' && ch<='z') - { d->Momentum(ch,x,y,z,k); v = z/ns[ch-'x']; } } else if(!p.compare(L"fst")) { long i=-1,j=-1,l=-1; v = d->Find(0,i,j,l); } else if(!p.compare(L"lst")) { long i=-1,j=-1,l=-1; v = d->Last(0,i,j,l); } @@ -559,7 +689,7 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v HMDT tmp = 0; // mglVar *v = arg->FindVar(nm.c_str()); if(!v && !nm.compare(0,7,L"jacobi_")) nm = nm.substr(7); - if(!v && nm.empty()) + if(!v && nm.empty()) { long m=mglFindInText(str,")"); if(m>1) @@ -606,15 +736,15 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v } else if(nm[0]=='a') // function { - if(!nm.compare(L"asin")) return mglApplyFunc(str, arg, head, asin); - else if(!nm.compare(L"acos")) return mglApplyFunc(str, arg, head, acos); - else if(!nm.compare(L"atan")) return mglApplyFunc(str, arg, head, atan); - else if(!nm.compare(L"asinh")) return mglApplyFunc(str, arg, head, mgl_asinh); - else if(!nm.compare(L"acosh")) return mglApplyFunc(str, arg, head, mgl_acosh); - else if(!nm.compare(L"atanh")) return mglApplyFunc(str, arg, head, mgl_atanh); + if(!nm.compare(L"asin")) return mglApplyFunc(str, arg, head, asin,fns); + else if(!nm.compare(L"acos")) return mglApplyFunc(str, arg, head, acos,fns); + else if(!nm.compare(L"atan")) return mglApplyFunc(str, arg, head, atan,fns); + else if(!nm.compare(L"asinh")) return mglApplyFunc(str, arg, head, mgl_asinh,fns); + else if(!nm.compare(L"acosh")) return mglApplyFunc(str, arg, head, mgl_acosh,fns); + else if(!nm.compare(L"atanh")) return mglApplyFunc(str, arg, head, mgl_atanh,fns); else if(!nm.compare(L"arg")) { - if(n>0) return mglApplyOper(str.substr(n+1),str.substr(0,n),arg, head, atan2); + if(n>0) return mglApplyOper(str.substr(n+1),str.substr(0,n),arg, head, atan2,fns); else { HADT a1 = mglFormulaCalcC(str, arg, head); @@ -624,7 +754,7 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v } else if(!nm.compare(L"abs")) { - if(n>0) return mglApplyOper(str.substr(n+1),str.substr(0,n),arg, head, hypot); + if(n>0) return mglApplyOper(str.substr(n+1),str.substr(0,n),arg, head, hypot,fns); else { HADT a1 = mglFormulaCalcC(str, arg, head); @@ -634,34 +764,34 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v } #if MGL_HAVE_GSL else if(!nm.compare(L"ai") || !nm.compare(L"airy_ai")) - return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Ai); + return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Ai,fns); else if(!nm.compare(L"airy_dai")) - return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Ai_deriv); + return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Ai_deriv,fns); else if(!nm.compare(L"airy_bi")) - return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Bi); + return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Bi,fns); else if(!nm.compare(L"airy_dbi")) - return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Bi_deriv); + return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Bi_deriv,fns); } else if(nm[0]=='b') { if(!nm.compare(L"beta") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_beta); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_beta,fns); else if(!nm.compare(L"bi")) - return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Bi); + return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Bi,fns); else if(!nm.compare(L"bessel_i") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Inu); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Inu,fns); else if(!nm.compare(L"bessel_j") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Jnu); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Jnu,fns); else if(!nm.compare(L"bessel_k") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Knu); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Knu,fns); else if(!nm.compare(L"bessel_y") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Ynu); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Ynu,fns); #endif } else if(nm[0]=='c') { - if(!nm.compare(L"cos")) return mglApplyFunc(str, arg, head, cos); - else if(!nm.compare(L"cosh") || !nm.compare(L"ch")) return mglApplyFunc(str, arg, head, cosh); + if(!nm.compare(L"cos")) return mglApplyFunc(str, arg, head, cos,fns); + else if(!nm.compare(L"cosh") || !nm.compare(L"ch")) return mglApplyFunc(str, arg, head, cosh,fns); else if(!nm.compare(L"conj")) { HADT a1 = mglFormulaCalcC(str, arg, head); @@ -669,73 +799,136 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v mgl_delete_datac(a1); return res; } #if MGL_HAVE_GSL - else if(!nm.compare(L"ci")) return mglApplyFunc(str, arg, head, gsl_sf_Ci); + else if(!nm.compare(L"ci")) return mglApplyFunc(str, arg, head, gsl_sf_Ci,fns); + else if(!nm.compare(L"cn") && n>0) + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_cn,fns); + else if(!nm.compare(L"cs") && n>0) + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_cs,fns); + else if(!nm.compare(L"cd") && n>0) + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_cd,fns); #endif } else if(nm[0]=='e') { - if(!nm.compare(L"exp")) return mglApplyFunc(str, arg, head, exp); + if(!nm.compare(L"exp")) return mglApplyFunc(str, arg, head, exp,fns); #if MGL_HAVE_GSL - else if(!nm.compare(L"erf")) return mglApplyFunc(str, arg, head, gsl_sf_erf); + else if(!nm.compare(L"erf")) return mglApplyFunc(str, arg, head, gsl_sf_erf,fns); else if(!nm.compare(L"ee") || !nm.compare(L"elliptic_ec")) - return mglApplyFuncGSL(str, arg, head, gsl_sf_ellint_Ecomp); + return mglApplyFuncGSL(str, arg, head, gsl_sf_ellint_Ecomp,fns); else if(!nm.compare(L"ek") || !nm.compare(L"elliptic_kc")) - return mglApplyFuncGSL(str, arg, head, gsl_sf_ellint_Kcomp); + return mglApplyFuncGSL(str, arg, head, gsl_sf_ellint_Kcomp,fns); else if((!nm.compare(L"e") || !nm.compare(L"elliptic_e")) && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslEllE); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslEllE,fns); else if(!nm.compare(L"elliptic_f")) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslEllF); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslEllF,fns); - else if(!nm.compare(L"ei")) return mglApplyFunc(str, arg, head, gsl_sf_expint_Ei); - else if(!nm.compare(L"e1")) return mglApplyFunc(str, arg, head, gsl_sf_expint_E1); - else if(!nm.compare(L"e2")) return mglApplyFunc(str, arg, head, gsl_sf_expint_E2); - else if(!nm.compare(L"eta")) return mglApplyFunc(str, arg, head, gsl_sf_eta); - else if(!nm.compare(L"ei3")) return mglApplyFunc(str, arg, head, gsl_sf_expint_3); + else if(!nm.compare(L"ei")) return mglApplyFunc(str, arg, head, gsl_sf_expint_Ei,fns); + else if(!nm.compare(L"e1")) return mglApplyFunc(str, arg, head, gsl_sf_expint_E1,fns); + else if(!nm.compare(L"e2")) return mglApplyFunc(str, arg, head, gsl_sf_expint_E2,fns); + else if(!nm.compare(L"eta")) return mglApplyFunc(str, arg, head, gsl_sf_eta,fns); + else if(!nm.compare(L"ei3")) return mglApplyFunc(str, arg, head, gsl_sf_expint_3,fns); #endif } else if(nm[0]=='l') { if(!nm.compare(L"log") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, llg); - else if(!nm.compare(L"lg")) return mglApplyFunc(str, arg, head, log10); - else if(!nm.compare(L"ln")) return mglApplyFunc(str, arg, head, log); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, llg,fns); + else if(!nm.compare(L"lg")) return mglApplyFunc(str, arg, head, log10,fns); + else if(!nm.compare(L"ln")) return mglApplyFunc(str, arg, head, log,fns); #if MGL_HAVE_GSL - else if(!nm.compare(L"li2")) return mglApplyFunc(str, arg, head, gsl_sf_dilog); + else if(!nm.compare(L"li2")) return mglApplyFunc(str, arg, head, gsl_sf_dilog,fns); else if(!nm.compare(L"legendre") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslLegP); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslLegP,fns); #endif } else if(nm[0]=='s') { - if(!nm.compare(L"sqrt")) return mglApplyFunc(str, arg, head, sqrt); - else if(!nm.compare(L"sin")) return mglApplyFunc(str, arg, head, sin); - else if(!nm.compare(L"step")) return mglApplyFunc(str, arg, head, stp); - else if(!nm.compare(L"sign")) return mglApplyFunc(str, arg, head, sgn); - else if(!nm.compare(L"sinh") || !nm.compare(L"sh")) return mglApplyFunc(str, arg, head, sinh); + if(!nm.compare(L"sqrt")) return mglApplyFunc(str, arg, head, sqrt,fns); + else if(!nm.compare(L"sin")) return mglApplyFunc(str, arg, head, sin,fns); + else if(!nm.compare(L"step")) return mglApplyFunc(str, arg, head, stp,fns); + else if(!nm.compare(L"sign")) return mglApplyFunc(str, arg, head, sgn,fns); + else if(!nm.compare(L"sinh") || !nm.compare(L"sh")) return mglApplyFunc(str, arg, head, sinh,fns); #if MGL_HAVE_GSL - else if(!nm.compare(L"si")) return mglApplyFunc(str, arg, head, gsl_sf_Si); - else if(!nm.compare(L"sinc")) return mglApplyFunc(str, arg, head, gsl_sf_sinc); + else if(!nm.compare(L"si")) return mglApplyFunc(str, arg, head, gsl_sf_Si,fns); + else if(!nm.compare(L"sinc")) return mglApplyFunc(str, arg, head, gsl_sf_sinc,fns); + else if(!nm.compare(L"sn") && n>0) + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_sn,fns); + else if(!nm.compare(L"sc") && n>0) + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_sc,fns); + else if(!nm.compare(L"sd") && n>0) + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_sd,fns); #endif + else if(!nm.compare(L"sum") && n>0) + { + HMDT a=NULL, b=mglFormulaCalcA(str.substr(n+1), arg, head, fns); + long m = long(b->a[0]+0.5); + const char *s = head.size()>0?head[head.size()-1]->s.s:""; + if(m>0) + { + std::vector hh(head); + int in=0; + if(s[0]=='_' && s[1]>='i' && s[1]<'z') in = s[1]-'i'+1; + char name[3] = {'_',char('i'+in),0}; + b->s = name; b->Create(1,1,1); hh.push_back(b); + a = mglFormulaCalcA(str.substr(0,n), arg, hh, fns); + long nn = a->GetNN(); + for(long i=1;ia[0] = i; + HMDT c = mglFormulaCalcA(str.substr(0,n), arg, hh, fns); + for(long j=0;ja[j] += c->a[j]; + mgl_delete_data(c); + } + mgl_delete_data(b); + } + else + { a = new mglData; a->a[0]=NAN; } + return a; + } + else if(!nm.compare(L"spline")) + { + HMDT a = mglFormulaCalcA(str.substr(0,n), arg, head, fns); + long n1 = mglFindInText(str,",",1), n2 = mglFindInText(str,",",2); + HMDT ix, iy=NULL, iz=NULL; + if(n1>0) + { + ix = mglFormulaCalcA(str.substr(n+1,n1), arg, head, fns); + if(n2>0) + { + iy = mglFormulaCalcA(str.substr(n1+1,n2), arg, head, fns); + iz = mglFormulaCalcA(str.substr(n2+1), arg, head, fns); + } + else iy = mglFormulaCalcA(str.substr(n1+1), arg, head, fns); + + } + else ix = mglFormulaCalcA(str.substr(n+1), arg, head, fns); + HMDT res = mgl_data_evaluate(a, ix,iy,iz, false); + if(a) mgl_delete_data(a); + if(ix) mgl_delete_data(ix); + if(iy) mgl_delete_data(iy); + if(iz) mgl_delete_data(iz); + return res; + } } else if(nm[0]=='t') { if(!nm.compare(L"tg") || !nm.compare(L"tan")) - return mglApplyFunc(str, arg, head, tan); + return mglApplyFunc(str, arg, head, tan,fns); else if(!nm.compare(L"tanh") || !nm.compare(L"th")) - return mglApplyFunc(str, arg, head, tanh); + return mglApplyFunc(str, arg, head, tanh,fns); } else if(!nm.compare(L"pow") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, pow); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, pow,fns); else if(nm[0]=='m') { if(!nm.compare(L"mod") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, fmod); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_fmod,fns); else if(!nm.compare(L"min") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_fmin); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_fmin,fns); else if(!nm.compare(L"max") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_fmax); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_fmax,fns); } - else if(!nm.compare(L"int")) return mglApplyFunc(str, arg, head, floor); + else if(!nm.compare(L"int")) return mglApplyFunc(str, arg, head, floor,fns); else if(!nm.compare(L"random")) { HMDT res=mglFormulaCalc(str, arg, head); mreal *a = res->a; for(long i=0;iGetNN();i++) a[i] = mgl_rnd(); @@ -759,27 +952,148 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v mgl_delete_datac(a1); return res; } #if MGL_HAVE_GSL + else if(!nm.compare(L"dn") && n>0) + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_dn,fns); + else if(!nm.compare(L"ds") && n>0) + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_ds,fns); + else if(!nm.compare(L"dc") && n>0) + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_dc,fns); + else if(!nm.compare(L"nc") && n>0) + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_nc,fns); + else if(!nm.compare(L"ns") && n>0) + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_ns,fns); + else if(!nm.compare(L"nd") && n>0) + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_nd,fns); else if(!nm.compare(L"i") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Inu); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Inu,fns); else if(!nm.compare(L"j") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Jnu); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Jnu,fns); else if(!nm.compare(L"k") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Knu); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Knu,fns); else if(!nm.compare(L"y") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Ynu); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Ynu,fns); else if(!nm.compare(L"f") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslEllF); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslEllF,fns); else if(!nm.compare(L"hypot") && n>0) - return mglApplyOper(str.substr(n+1),str.substr(0,n),arg, head, hypot); - else if(!nm.compare(L"gamma")) return mglApplyFunc(str, arg, head, gsl_sf_gamma); + return mglApplyOper(str.substr(n+1),str.substr(0,n),arg, head, hypot,fns); + else if(!nm.compare(L"gamma")) return mglApplyFunc(str, arg, head, gsl_sf_gamma,fns); else if(!nm.compare(L"gamma_inc") && n>0) - return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_gamma_inc); - else if(!nm.compare(L"w0")) return mglApplyFunc(str, arg, head, gsl_sf_lambert_W0); - else if(!nm.compare(L"w1")) return mglApplyFunc(str, arg, head, gsl_sf_lambert_Wm1); - else if(!nm.compare(L"psi")) return mglApplyFunc(str, arg, head, gsl_sf_psi); - else if(!nm.compare(L"zeta")) return mglApplyFunc(str, arg, head, gsl_sf_zeta); - else if(!nm.compare(L"z")) return mglApplyFunc(str, arg, head, gsl_sf_dawson); + return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_gamma_inc,fns); + else if(!nm.compare(L"w0")) return mglApplyFunc(str, arg, head, gsl_sf_lambert_W0,fns); + else if(!nm.compare(L"w1")) return mglApplyFunc(str, arg, head, gsl_sf_lambert_Wm1,fns); + else if(!nm.compare(L"psi")) return mglApplyFunc(str, arg, head, gsl_sf_psi,fns); + else if(!nm.compare(L"zeta")) return mglApplyFunc(str, arg, head, gsl_sf_zeta,fns); + else if(!nm.compare(L"z")) return mglApplyFunc(str, arg, head, gsl_sf_dawson,fns); #endif + else if(!nm.compare(L"value")) + { + HMDT a = mglFormulaCalcA(str.substr(0,n), arg, head, fns); + long n1 = mglFindInText(str,",",1), n2 = mglFindInText(str,",",2); + HMDT ix, iy=NULL, iz=NULL; + if(n1>0) + { + ix = mglFormulaCalcA(str.substr(n+1,n1), arg, head, fns); + if(n2>0) + { + iy = mglFormulaCalcA(str.substr(n1+1,n2), arg, head, fns); + iz = mglFormulaCalcA(str.substr(n2+1), arg, head, fns); + } + else iy = mglFormulaCalcA(str.substr(n1+1), arg, head, fns); + + } + else ix = mglFormulaCalcA(str.substr(n+1), arg, head, fns); + HMDT res = mgl_data_subdata_ext(a, ix,iy,iz); + if(a) mgl_delete_data(a); + if(ix) mgl_delete_data(ix); + if(iy) mgl_delete_data(iy); + if(iz) mgl_delete_data(iz); + return res; + } + else if(!nm.compare(L"dsum") && n>0) + { + HMDT a=NULL, b=mglFormulaCalcA(str.substr(n+1), arg, head, fns); + long m = long(b->a[0]+0.5); + const char *s = head.size()>0?head[head.size()-1]->s.s:""; + if(m>0) + { + std::vector hh(head); + int in=0, zn=1; + if(s[0]=='_' && s[1]>='i' && s[1]<'z') in = s[1]-'i'+1; + char name[3] = {'_',char('i'+in),0}; + b->s = name; b->Create(1,1,1); hh.push_back(b); + a = mglFormulaCalcA(str.substr(0,n), arg, hh, fns); + long nn = a->GetNN(); + for(long i=1;ia[0] = i; zn *= -1; + HMDT c = mglFormulaCalcA(str.substr(0,n), arg, hh, fns); + for(long j=0;ja[j] += zn*c->a[j]; + mgl_delete_data(c); + } + mgl_delete_data(b); + } + else + { a = new mglData; a->a[0]=NAN; } + return a; + } + else if(!nm.compare(L"prod") && n>0) + { + HMDT a=NULL, b=mglFormulaCalcA(str.substr(n+1), arg, head, fns); + long m = long(b->a[0]+0.5); + const char *s = head.size()>0?head[head.size()-1]->s.s:""; + if(m>0) + { + std::vector hh(head); + int in=0; + if(s[0]=='_' && s[1]>='i' && s[1]<'z') in = s[1]-'i'+1; + char name[3] = {'_',char('i'+in),0}; + b->s = name; b->Create(1,1,1); hh.push_back(b); + a = mglFormulaCalcA(str.substr(0,n), arg, hh, fns); + long nn = a->GetNN(); + for(long i=1;ia[0] = i; + HMDT c = mglFormulaCalcA(str.substr(0,n), arg, hh, fns); + for(long j=0;ja[j] *= c->a[j]; + mgl_delete_data(c); + } + mgl_delete_data(b); + } + else + { a = new mglData; a->a[0]=NAN; } + return a; + } + else if(nm[0]=='f' && nm[1]=='n' && fns.size()>1) + { + HMDT a=NULL, b=NULL, r=NULL; + std::vector hh(head); + std::vector tmp; // disable recursion + if(n>0) + { + a = mglFormulaCalcA(str.substr(0,n), arg, head, fns); + if(a) { a->s = "_1"; hh.push_back(a); } + b = mglFormulaCalcA(str.substr(n+1), arg, head, fns); + if(b) { b->s = "_2"; hh.push_back(b); } + } + else + { + a = mglFormulaCalcA(str, arg, head, fns); + if(a) { a->s = "_1"; hh.push_back(a); } + } + if(!nm.compare(L"fn1") && fns.size()>1) r = mglFormulaCalcA(fns[1], arg, hh, tmp); + if(!nm.compare(L"fn2") && fns.size()>2) r = mglFormulaCalcA(fns[2], arg, hh, tmp); + if(!nm.compare(L"fn3") && fns.size()>3) r = mglFormulaCalcA(fns[3], arg, hh, tmp); + if(!nm.compare(L"fn4") && fns.size()>4) r = mglFormulaCalcA(fns[4], arg, hh, tmp); + if(!nm.compare(L"fn5") && fns.size()>5) r = mglFormulaCalcA(fns[5], arg, hh, tmp); + if(!nm.compare(L"fn6") && fns.size()>6) r = mglFormulaCalcA(fns[6], arg, hh, tmp); + if(!nm.compare(L"fn7") && fns.size()>7) r = mglFormulaCalcA(fns[7], arg, hh, tmp); + if(!nm.compare(L"fn8") && fns.size()>8) r = mglFormulaCalcA(fns[8], arg, hh, tmp); + if(!nm.compare(L"fn9") && fns.size()>9) r = mglFormulaCalcA(fns[9], arg, hh, tmp); + if(a) mgl_delete_data(a); + if(b) mgl_delete_data(b); + if(!r) { r = new mglData; r->a[0]=NAN; } + return r; + } } HMDT res = new mglData; res->a[0]=NAN; return res; } @@ -822,7 +1136,13 @@ dual MGL_LOCAL_CONST normc(dual x); //{ return norm(x); } // All numbers are presented as mglData(1). Do boundary checking. // NOTE: In any case where number is required the mglData::a[0] is used. // String flag is binary 0x1 -> 'x', 0x2 -> 'y', 0x4 -> 'z' -HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring str, mglParser *arg, const std::vector &head) +HADT MGL_NO_EXPORT mglFormulaCalcC(const std::wstring &str, mglParser *arg, const std::vector &head) +{ + if(str.empty()) return NULL; + std::vector fns = mgl_wcs_args(str,'\\'); + return mglFormulaCalcAC(fns[0],arg,head,fns); +} +HADT MGL_NO_EXPORT mglFormulaCalcAC(std::wstring str, mglParser *arg, const std::vector &head, const std::vector &fns) { #if MGL_HAVE_GSL gsl_set_error_handler_off(); @@ -881,13 +1201,13 @@ HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring str, mglParser *arg, const std:: n=mglFindInText(str,"<>="); // low priority -- conditions if(n>=0) - return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, str[n]=='<'?cltc:(str[n]=='>'?cgtc:ceqc)); + return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, str[n]=='<'?cltc:(str[n]=='>'?cgtc:ceqc),fns); n=mglFindInText(str,"+-"); // normal priority -- additions - if(n>=0 && (n<2 || str[n-1]!='e' || (str[n-2]!='.' && !isdigit(str[n-2])))) - return str[n]=='+'? mglApplyOperAddC(str.substr(0,n),str.substr(n+1),arg, head) : mglApplyOperSubC(str.substr(0,n),str.substr(n+1),arg, head); + if(n>=0 && (n<2 || !strchr("eE",str[n-1]) || (str[n-2]!='.' && !isdigit(str[n-2])))) + return str[n]=='+'? mglApplyOperAddC(str.substr(0,n),str.substr(n+1),arg, head,fns) : mglApplyOperSubC(str.substr(0,n),str.substr(n+1),arg, head,fns); n=mglFindInText(str,"*/"); // high priority -- multiplications if(n>=0) - return str[n]=='*'? mglApplyOperMulC(str.substr(0,n),str.substr(n+1),arg, head) : mglApplyOperDivC(str.substr(0,n),str.substr(n+1),arg, head); + return str[n]=='*'? mglApplyOperMulC(str.substr(0,n),str.substr(n+1),arg, head,fns) : mglApplyOperDivC(str.substr(0,n),str.substr(n+1),arg, head,fns); n=mglFindInText(str,"@"); // high priority -- combine if(n>=0) { @@ -899,7 +1219,7 @@ HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring str, mglParser *arg, const std:: } n=mglFindInText(str,"^"); // highest priority -- power if(n>=0) - return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, ipwc); + return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, ipwc,fns); n=mglFindInText(str,":"); // highest priority -- array if(n>=0 && str.compare(L":")) { @@ -912,7 +1232,7 @@ HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring str, mglParser *arg, const std:: } n=mglFindInText(str,"."); // highest priority -- suffixes wchar_t c0 = str[n+1]; - if(n>=0 && c0>='a' && c0!='e') + if(n>=0 && c0>='a' && c0!='e' && c0!='E' && !isdigit(c0)) { dual v=NAN; HADT d = mglFormulaCalcC(str.substr(0,n), arg, head); @@ -1066,51 +1386,214 @@ HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring str, mglParser *arg, const std:: } else if(nm[0]=='a') // function { - if(!nm.compare(L"asin")) return mglApplyFuncC(str, arg, head, asinc); - else if(!nm.compare(L"acos")) return mglApplyFuncC(str, arg, head, acosc); - else if(!nm.compare(L"atan")) return mglApplyFuncC(str, arg, head, atanc); - else if(!nm.compare(L"asinh")) return mglApplyFuncC(str, arg, head, asinhc); - else if(!nm.compare(L"acosh")) return mglApplyFuncC(str, arg, head, acoshc); - else if(!nm.compare(L"atanh")) return mglApplyFuncC(str, arg, head, atanhc); - else if(!nm.compare(L"arg")) return mglApplyFuncC(str, arg, head, argc); - else if(!nm.compare(L"abs")) return mglApplyFuncC(str, arg, head, absc); + if(!nm.compare(L"asin")) return mglApplyFuncC(str, arg, head, asinc,fns); + else if(!nm.compare(L"acos")) return mglApplyFuncC(str, arg, head, acosc,fns); + else if(!nm.compare(L"atan")) return mglApplyFuncC(str, arg, head, atanc,fns); + else if(!nm.compare(L"asinh")) return mglApplyFuncC(str, arg, head, asinhc,fns); + else if(!nm.compare(L"acosh")) return mglApplyFuncC(str, arg, head, acoshc,fns); + else if(!nm.compare(L"atanh")) return mglApplyFuncC(str, arg, head, atanhc,fns); + else if(!nm.compare(L"arg")) return mglApplyFuncC(str, arg, head, argc,fns); + else if(!nm.compare(L"abs")) return mglApplyFuncC(str, arg, head, absc,fns); } else if(nm[0]=='c') { - if(!nm.compare(L"cos")) return mglApplyFuncC(str, arg, head, cosc); - else if(!nm.compare(L"cosh") || !nm.compare(L"ch")) return mglApplyFuncC(str, arg, head, coshc); - else if(!nm.compare(L"conj")) return mglApplyFuncC(str, arg, head, conjc); + if(!nm.compare(L"cos")) return mglApplyFuncC(str, arg, head, cosc,fns); + else if(!nm.compare(L"cosh") || !nm.compare(L"ch")) return mglApplyFuncC(str, arg, head, coshc,fns); + else if(!nm.compare(L"conj")) return mglApplyFuncC(str, arg, head, conjc,fns); else if(!nm.compare(L"cmplx") && n>0) - return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, cmplxc); + return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, cmplxc,fns); } - else if(!nm.compare(L"exp")) return mglApplyFuncC(str, arg, head, expc); + else if(!nm.compare(L"exp")) return mglApplyFuncC(str, arg, head, expc,fns); else if(nm[0]=='l') { - if(!nm.compare(L"log") || !nm.compare(L"ln")) return mglApplyFuncC(str, arg, head, logc); - else if(!nm.compare(L"lg")) return mglApplyFuncC(str, arg, head, lgc); + if(!nm.compare(L"log") || !nm.compare(L"ln")) return mglApplyFuncC(str, arg, head, logc,fns); + else if(!nm.compare(L"lg")) return mglApplyFuncC(str, arg, head, lgc,fns); } else if(nm[0]=='s') { - if(!nm.compare(L"sqrt")) return mglApplyFuncC(str, arg, head, sqrtc); - else if(!nm.compare(L"sin")) return mglApplyFuncC(str, arg, head, sinc); - else if(!nm.compare(L"sinh") || !nm.compare(L"sh")) return mglApplyFuncC(str, arg, head, sinhc); + if(!nm.compare(L"sqrt")) return mglApplyFuncC(str, arg, head, sqrtc,fns); + else if(!nm.compare(L"sin")) return mglApplyFuncC(str, arg, head, sinc,fns); + else if(!nm.compare(L"sinh") || !nm.compare(L"sh")) return mglApplyFuncC(str, arg, head, sinhc,fns); + else if(!nm.compare(L"sum") && n>0) + { + HADT a=NULL; + HMDT b=mglFormulaCalcA(str.substr(n+1), arg, head, fns); + long m = long(b->a[0]+0.5); + const char *s = head.size()>0?head[head.size()-1]->s.s:""; + if(m>0) + { + std::vector hh(head); + int in=0; + if(s[0]=='_' && s[1]>='i' && s[1]<'z') in = s[1]-'i'+1; + char name[3] = {'_',char('i'+in),0}; + b->s = name; b->Create(1,1,1); hh.push_back(b); + a = mglFormulaCalcAC(str.substr(0,n), arg, hh, fns); + long nn = a->GetNN(); + for(long i=1;ia[0] = i; + HADT c = mglFormulaCalcAC(str.substr(0,n), arg, hh, fns); + for(long j=0;ja[j] += c->a[j]; + mgl_delete_datac(c); + } + mgl_delete_data(b); + } + else + { a = new mglDataC; a->a[0]=NAN; } + return a; + } + else if(!nm.compare(L"spline")) + { + HADT a = mglFormulaCalcAC(str.substr(0,n), arg, head, fns); + long n1 = mglFindInText(str,",",1), n2 = mglFindInText(str,",",2); + HMDT ix, iy=NULL, iz=NULL; + if(n1>0) + { + ix = mglFormulaCalcA(str.substr(n+1,n1), arg, head, fns); + if(n2>0) + { + iy = mglFormulaCalcA(str.substr(n1+1,n2), arg, head, fns); + iz = mglFormulaCalcA(str.substr(n2+1), arg, head, fns); + } + else iy = mglFormulaCalcA(str.substr(n1+1), arg, head, fns); + + } + else ix = mglFormulaCalcA(str.substr(n+1), arg, head, fns); + HADT res = mgl_datac_evaluate(a, ix,iy,iz, false); + if(a) mgl_delete_datac(a); + if(ix) mgl_delete_data(ix); + if(iy) mgl_delete_data(iy); + if(iz) mgl_delete_data(iz); + return res; + } } else if(nm[0]=='t') { - if(!nm.compare(L"tg") || !nm.compare(L"tan")) return mglApplyFuncC(str, arg, head, tanc); - else if(!nm.compare(L"tanh") || !nm.compare(L"th")) return mglApplyFuncC(str, arg, head, tanhc); + if(!nm.compare(L"tg") || !nm.compare(L"tan")) return mglApplyFuncC(str, arg, head, tanc,fns); + else if(!nm.compare(L"tanh") || !nm.compare(L"th")) return mglApplyFuncC(str, arg, head, tanhc,fns); } else if(!nm.compare(L"pow") && n>0) - return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, powc); + return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, powc,fns); else if(!nm.compare(L"random")) { HADT res=mglFormulaCalcC(str, arg, head); dual *a = res->a; for(long i=0;iGetNN();i++) a[i] = dual(mgl_rnd(), mgl_rnd()); return res; } else if(!nm.compare(L"hypot")) - return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, hypotc); - else if(!nm.compare(L"real")) return mglApplyFuncC(str, arg, head, realc); - else if(!nm.compare(L"imag")) return mglApplyFuncC(str, arg, head, imagc); - else if(!nm.compare(L"norm")) return mglApplyFuncC(str, arg, head, normc); + return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, hypotc,fns); + else if(!nm.compare(L"real")) return mglApplyFuncC(str, arg, head, realc,fns); + else if(!nm.compare(L"imag")) return mglApplyFuncC(str, arg, head, imagc,fns); + else if(!nm.compare(L"norm")) return mglApplyFuncC(str, arg, head, normc,fns); + else if(!nm.compare(L"value")) + { + HADT a = mglFormulaCalcAC(str.substr(0,n), arg, head, fns); + long n1 = mglFindInText(str,",",1), n2 = mglFindInText(str,",",2); + HMDT ix, iy=NULL, iz=NULL; + if(n1>0) + { + ix = mglFormulaCalcA(str.substr(n+1,n1), arg, head, fns); + if(n2>0) + { + iy = mglFormulaCalcA(str.substr(n1+1,n2), arg, head, fns); + iz = mglFormulaCalcA(str.substr(n2+1), arg, head, fns); + } + else iy = mglFormulaCalcA(str.substr(n1+1), arg, head, fns); + + } + else ix = mglFormulaCalcA(str.substr(n+1), arg, head, fns); + HADT res = mgl_datac_subdata_ext(a, ix,iy,iz); + if(a) mgl_delete_datac(a); + if(ix) mgl_delete_data(ix); + if(iy) mgl_delete_data(iy); + if(iz) mgl_delete_data(iz); + return res; + } + else if(!nm.compare(L"dsum") && n>0) + { + HADT a=NULL; + HMDT b=mglFormulaCalcA(str.substr(n+1), arg, head, fns); + long m = long(b->a[0]+0.5); + const char *s = head.size()>0?head[head.size()-1]->s.s:""; + if(m>0) + { + std::vector hh(head); + int in=0, zn=1; + if(s[0]=='_' && s[1]>='i' && s[1]<'z') in = s[1]-'i'+1; + char name[3] = {'_',char('i'+in),0}; + b->s = name; b->Create(1,1,1); hh.push_back(b); + a = mglFormulaCalcAC(str.substr(0,n), arg, hh, fns); + long nn = a->GetNN(); + for(long i=1;ia[0] = i; zn *= -1; + HADT c = mglFormulaCalcAC(str.substr(0,n), arg, hh, fns); + for(long j=0;ja[j] += mreal(zn)*c->a[j]; + mgl_delete_datac(c); + } + mgl_delete_data(b); + } + else + { a = new mglDataC; a->a[0]=NAN; } + return a; + } + else if(!nm.compare(L"prod") && n>0) + { + HADT a=NULL; + HMDT b=mglFormulaCalcA(str.substr(n+1), arg, head, fns); + long m = long(b->a[0]+0.5); + const char *s = head.size()>0?head[head.size()-1]->s.s:""; + if(m>0) + { + std::vector hh(head); + int in=0; + if(s[0]=='_' && s[1]>='i' && s[1]<'z') in = s[1]-'i'+1; + char name[3] = {'_',char('i'+in),0}; + b->s = name; b->Create(1,1,1); hh.push_back(b); + a = mglFormulaCalcAC(str.substr(0,n), arg, hh, fns); + long nn = a->GetNN(); + for(long i=1;ia[0] = i; + HADT c = mglFormulaCalcAC(str.substr(0,n), arg, hh, fns); + for(long j=0;ja[j] *= c->a[j]; + mgl_delete_datac(c); + } + mgl_delete_data(b); + } + else + { a = new mglDataC; a->a[0]=NAN; } + return a; + } + else if(nm[0]=='f' && nm[1]=='n' && fns.size()>1) + { + HADT a=NULL, b=NULL, r=NULL; + std::vector hh(head); + std::vector tmp; // disable recursion + if(n>0) + { + a = mglFormulaCalcAC(str.substr(0,n), arg, head, fns); + if(a) { a->s = "_1"; hh.push_back(a); } + b = mglFormulaCalcAC(str.substr(n+1), arg, head, fns); + if(b) { b->s = "_2"; hh.push_back(b); } + } + else + { + a = mglFormulaCalcAC(str, arg, head, fns); + if(a) { a->s = "_1"; hh.push_back(a); } + } + if(!nm.compare(L"fn1") && fns.size()>1) r = mglFormulaCalcAC(fns[1], arg, hh, tmp); + if(!nm.compare(L"fn2") && fns.size()>3) r = mglFormulaCalcAC(fns[2], arg, hh, tmp); + if(!nm.compare(L"fn3") && fns.size()>3) r = mglFormulaCalcAC(fns[3], arg, hh, tmp); + if(!nm.compare(L"fn4") && fns.size()>4) r = mglFormulaCalcAC(fns[4], arg, hh, tmp); + if(!nm.compare(L"fn5") && fns.size()>5) r = mglFormulaCalcAC(fns[5], arg, hh, tmp); + if(!nm.compare(L"fn6") && fns.size()>6) r = mglFormulaCalcAC(fns[6], arg, hh, tmp); + if(!nm.compare(L"fn7") && fns.size()>7) r = mglFormulaCalcAC(fns[7], arg, hh, tmp); + if(!nm.compare(L"fn8") && fns.size()>8) r = mglFormulaCalcAC(fns[8], arg, hh, tmp); + if(!nm.compare(L"fn9") && fns.size()>9) r = mglFormulaCalcAC(fns[9], arg, hh, tmp); + if(a) mgl_delete_datac(a); + if(b) mgl_delete_datac(b); + if(!r) { r = new mglDataC; r->a[0]=NAN; } + return r; + } } HADT res = new mglDataC; res->a[0]=NAN; return res; } diff --git a/src/exec_dat.cpp b/src/exec_dat.cpp index a531fba..4070733 100644 --- a/src/exec_dat.cpp +++ b/src/exec_dat.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -707,6 +707,20 @@ int static mgls_join(mglGraph *, long , mglArg *a, const char *k, const char *) return res; } //----------------------------------------------------------------------------- +int static mgls_keep(mglGraph *, long , mglArg *a, const char *k, const char *) +{ + int res=0; + if(k[0]=='d' && a[0].d->temp) return 5; + mglData *d = dynamic_cast(a[0].d); + mglDataC *c = dynamic_cast(a[0].d); + if(d && !strcmp(k,"dsn")) d->Keep(a[1].s.s,a[2].v); + else if(c && !strcmp(k,"dsn")) c->Keep(a[1].s.s,a[2].v); + else if(d && !strcmp(k,"dsnn")) d->Keep(a[1].s.s,a[2].v,a[3].v); + else if(c && !strcmp(k,"dsnn")) c->Keep(a[1].s.s,a[2].v,a[3].v); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- int static mgls_limit(mglGraph *, long , mglArg *a, const char *k, const char *) { int res=0; @@ -719,6 +733,26 @@ int static mgls_limit(mglGraph *, long , mglArg *a, const char *k, const char *) return res; } //----------------------------------------------------------------------------- +int static mgls_first(mglGraph *, long , mglArg *a, const char *k, const char *) +{ + int res=0; + if(k[0]=='d' && a[0].d->temp) return 5; + mglData *d = dynamic_cast(a[0].d); + if(d && !strcmp(k,"ddsn")) *d = mglData(true,mgl_data_first_dir(a[1].d,a[2].s.s,a[3].v)); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- +int static mgls_last(mglGraph *, long , mglArg *a, const char *k, const char *) +{ + int res=0; + if(k[0]=='d' && a[0].d->temp) return 5; + mglData *d = dynamic_cast(a[0].d); + if(d && !strcmp(k,"ddsn")) *d = mglData(true,mgl_data_last_dir(a[1].d,a[2].s.s,a[3].v)); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- int static mgls_max(mglGraph *, long , mglArg *a, const char *k, const char *) { int res=0; @@ -864,6 +898,10 @@ int static mgls_ode(mglGraph *, long , mglArg *a, const char *k, const char *) *d = mglODE(a[1].s.s, a[2].s.s, *(a[3].d)); else if(!strcmp(k,"dssdnn")) *d = mglODE(a[1].s.s, a[2].s.s, *(a[3].d), a[4].v, a[5].v); + if(!strcmp(k,"dsssd")) + *d = mglODEs(a[1].s.s, a[2].s.s, a[3].s.s[0], *(a[4].d)); + else if(!strcmp(k,"dsssdnn")) + *d = mglODEs(a[1].s.s, a[2].s.s, a[3].s.s[0], *(a[4].d), a[5].v, a[6].v); } else if(c) { @@ -871,6 +909,10 @@ int static mgls_ode(mglGraph *, long , mglArg *a, const char *k, const char *) *c = mglODEc(a[1].s.s, a[2].s.s, *(a[3].d)); else if(!strcmp(k,"dssdnn")) *c = mglODEc(a[1].s.s, a[2].s.s, *(a[3].d), a[4].v, a[5].v); + if(!strcmp(k,"dsssd")) + *c = mglODEcs(a[1].s.s, a[2].s.s, a[3].s.s[0], *(a[4].d)); + else if(!strcmp(k,"dsssdnn")) + *c = mglODEcs(a[1].s.s, a[2].s.s, a[3].s.s[0], *(a[4].d), a[5].v, a[6].v); } else res = 1; return res; @@ -1211,6 +1253,18 @@ int static mgls_readmat(mglGraph *gr, long , mglArg *a, const char *k, const cha return res; } //----------------------------------------------------------------------------- +int static mgls_readbin(mglGraph *gr, long , mglArg *a, const char *k, const char *) +{ + int res=0; + bool rr=true; + if(k[0]=='d' && a[0].d->temp) return 5; + mglData *d = dynamic_cast(a[0].d); + if(d && !strcmp(k,"dsn")) rr=d->ReadBin(a[1].s.s, mgl_int(a[2].v)); + else res = 1; + if(!rr) gr->SetWarn(mglWarnFile,"ReadBin"); + return res; +} +//----------------------------------------------------------------------------- int static mgls_rearrange(mglGraph *, long , mglArg *a, const char *k, const char *) { int res=0; @@ -1317,6 +1371,12 @@ int static mgls_save(mglGraph *, long , mglArg *a, const char *k, const char *) { int res=0; if(!strcmp(k,"ds")) a[0].d->Save(a[1].s.s); + else if(!strcmp(k,"ns")) + { + FILE *fp = fopen(a[1].s.s,"w"); + fprintf(fp,"%g",double(a[0].v)); + fclose(fp); + } else if(!strcmp(k,"ss")) { FILE *fp = fopen(a[1].s.s,"a"); @@ -1344,6 +1404,8 @@ int static mgls_savehdf(mglGraph *, long , mglArg *a, const char *k, const char int res=0; if(!strcmp(k,"dss")) a[0].d->SaveHDF(a[1].s.s, a[2].s.s); else if(!strcmp(k,"dssn")) a[0].d->SaveHDF(a[1].s.s, a[2].s.s,mgl_int(a[3].v)); + else if(!strcmp(k,"nss")) mgl_real_save_hdf(a[0].v, a[1].s.s, a[2].s.s, 0); + else if(!strcmp(k,"nssn")) mgl_real_save_hdf(a[0].v, a[1].s.s, a[2].s.s, mgl_int(a[3].v)); else res = 1; return res; } @@ -1694,6 +1756,7 @@ mglCommand mgls_dat_cmd[] = { {"minmax",_("Get positions of local maximums and minimums"),"minmax Res Dat", mgls_minmax ,4}, {"fill",_("Fill data linearly in range [v1, v2]"),"fill Var v1 v2 ['dir']|Var 'eq' [Vdat Wdat]", mgls_fill ,3}, {"fillsample",_("Fill x-,k-samples for transforms"),"fillsample Var 'how'", mgls_fillsample ,3}, + {"first",_("Find first indexes of values larger val over direction"),"first Res Dat 'dir' val", mgls_first ,4}, {"fit",_("Fit data to formula"),"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 ,4}, {"fits",_("Fit data to formula"),"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 ,4}, {"fourier",_("In-place Fourier transform"),"fourier ReDat ImDat 'dir'|Cmplx 'dir'", mgls_fourier , 16}, @@ -1707,6 +1770,8 @@ mglCommand mgls_dat_cmd[] = { {"integrate",_("Integrate data along direction(s)"),"integrate Dat 'dir'", mgls_integrate ,16}, {"jacobian",_("Get Jacobian"),"jacobian Res Xdat Ydat [Zdat]", mgls_jacobian ,4}, {"join",_("Join data arrays"),"join Dat Add1 ...", mgls_join ,3}, + {"last",_("Find last indexes of values larger val over direction"),"last Res Dat 'dir' val", mgls_last ,4}, + {"keep",_("Keep phase/amplitude along line"),"keep Dat 'dir' i [j]", mgls_keep ,16}, {"limit",_("Limit data to be inside [-v,v]"),"limit Dat v", mgls_limit ,16}, {"max",_("Find maximal value over direction"),"max Res Dat 'dir'", mgls_max ,4}, {"min",_("Find minimal value over direction"),"min Res Dat 'dir'", mgls_min ,4}, @@ -1717,7 +1782,7 @@ mglCommand mgls_dat_cmd[] = { {"new",_("Create new data"),"new Dat nx ['eq']|Dat nx ny ['eq']|Dat nx ny nz ['eq']", mgls_new ,4}, {"norm",_("Normalize data"),"norm Dat v1 v2 [sym dim]", mgls_norm ,16}, {"normsl",_("Normalize data slice by slice"),"normsl Dat v1 v2 ['dir' keep sym] ", mgls_normsl ,16}, - {"ode",_("Solve ODE"),"ode Res 'df' 'var' Ini [dt tmax]", mgls_ode ,4}, + {"ode",_("Solve ODE"),"ode Res 'df' 'var' Ini [dt tmax]|Res 'df' 'var' 'brd' Ini [dt tmax]", mgls_ode ,4}, {"openhdf",_("Open all data arrays from HDF file"),"openhdf 'fname'", mgls_openhdf ,3}, {"pde",_("Solve PDE"),"pde Res 'ham' IniRe IniIm [dz k0]", mgls_pde ,4}, {"print",_("Immediately print the message"),"print 'message'|Dat|const", mgls_print ,3}, @@ -1730,6 +1795,7 @@ mglCommand mgls_dat_cmd[] = { {"ray",_("Solve Hamiltonian ODE (find GO ray or trajectory)"),"ray Res 'ham' x0 y0 z0 px0 py0 pz0 [dt=0.1 tmax=10]", mgls_ray ,4}, {"read",_("Read data from file"),"read Dat 'file' [nx ny nz]|ReDat ImDat 'file' [nx ny nz]", mgls_read ,4}, {"readall",_("Read and join data from several files"),"readall Dat 'templ' [slice]|Dat 'templ' from to [step slice]", mgls_readall ,4}, + {"readbin",_("Read data from binary file of specified type"),"readbin Dat 'file' type", mgls_readbin ,4}, {"readhdf",_("Read data with name 'id' from HDF file"),"readhdf Dat 'file' 'id'", mgls_readhdf ,4}, {"readmat",_("Read data from file with sizes specified in first row"),"readmat Dat 'file' [dim]", mgls_readmat ,4}, {"rearrange",_("Rearrange data dimensions"),"rearrange Dat mx [my mz]", mgls_rearrange ,3}, @@ -1738,8 +1804,8 @@ mglCommand mgls_dat_cmd[] = { {"rkstep",_("Perform Runge-Kutta step"),"rkstep 'Diff1;Diff2;...' 'Var1;Var2;...' [dt]", mgls_rkstep, 6}, {"roll",_("Roll data along direction(s)"),"roll Dat 'dir' num", mgls_roll ,16}, {"roots",_("Find roots using data as initial values"), "roots Res 'func' Ini ['var']|Res 'func' ini ['var']|Res 'func' 'vars' Ini", mgls_roots ,4}, - {"save",_("Save data to file"),"save Dat 'file'|'str' 'file' ['how']", mgls_save ,3}, - {"savehdf",_("Save data to HDF5 file"),"savehdf Dat 'file' 'id' [rewrite]", mgls_savehdf ,3}, + {"save",_("Save data to file"),"save Dat 'file'|val 'file'|'str' 'file' ['how']", mgls_save ,3}, + {"savehdf",_("Save data to HDF5 file"),"savehdf Dat 'file' 'id' [rewrite]|val 'file' 'id' [rewrite]", mgls_savehdf ,3}, {"scanfile",_("Get formated data from file"),"scanfile Dat 'fname 'templ'", mgls_scanfile ,4}, {"section",_("Extract sub-array between values"),"section Res Dat id ['dir' val]|Res Dat Ids ['dir' val]", mgls_section ,4}, {"sew",_("Remove jump into the data, like phase jumps"),"sew Dat ['dir' da]", mgls_sew ,16}, diff --git a/src/exec_gr.cpp b/src/exec_gr.cpp index c3edfd5..4f51c01 100644 --- a/src/exec_gr.cpp +++ b/src/exec_gr.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -187,6 +187,19 @@ int static mgls_lamerey(mglGraph *gr, long , mglArg *a, const char *k, const cha return res; } //----------------------------------------------------------------------------- +int static mgls_lines(mglGraph *gr, long , mglArg *a, const char *k, const char *opt) +{ + int res=0; + if(!strcmp(k,"dd")) gr->Lines(*(a[0].d),*(a[1].d),"",opt); + else if(!strcmp(k,"dds")) gr->Lines(*(a[0].d),*(a[1].d),a[2].s.s,opt); + else if(!strcmp(k,"dddd")) gr->Lines(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),"",opt); + else if(!strcmp(k,"dddds")) gr->Lines(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),a[4].s.s,opt); + else if(!strcmp(k,"dddddd")) gr->Lines(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),"",opt); + else if(!strcmp(k,"dddddds")) gr->Lines(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),a[6].s.s,opt); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- int static mgls_mark(mglGraph *gr, long , mglArg *a, const char *k, const char *opt) { int res=0; @@ -407,16 +420,21 @@ int static mgls_boxs(mglGraph *gr, long , mglArg *a, const char *k, const char * int static mgls_cont(mglGraph *gr, long , mglArg *a, const char *k, const char *opt) { int res=0; + mglData v; v.a[0]=a[0].v; if(!strcmp(k,"d")) gr->Cont(*(a[0].d),"",opt); else if(!strcmp(k,"ds")) gr->Cont(*(a[0].d),a[1].s.s,opt); else if(!strcmp(k,"dd")) gr->Cont(*(a[0].d), *(a[1].d), "",opt); else if(!strcmp(k,"dds")) gr->Cont(*(a[0].d), *(a[1].d), a[2].s.s,opt); + else if(!strcmp(k,"nd")) gr->Cont(v, *(a[1].d), "",opt); + else if(!strcmp(k,"nds")) gr->Cont(v, *(a[1].d), a[2].s.s,opt); else if(!strcmp(k,"ddd")) gr->Cont(*(a[0].d), *(a[1].d), *(a[2].d), "",opt); else if(!strcmp(k,"ddds")) gr->Cont(*(a[0].d), *(a[1].d), *(a[2].d), a[3].s.s,opt); else if(!strcmp(k,"dddd")) gr->Cont(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), "",opt); else if(!strcmp(k,"dddds")) gr->Cont(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,opt); + else if(!strcmp(k,"nddd")) gr->Cont(v, *(a[1].d), *(a[2].d), *(a[3].d), "",opt); + else if(!strcmp(k,"nddds")) gr->Cont(v, *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,opt); else if(!strcmp(k,"ndddd")) gr->ContGen(a[0].v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d),"",opt); - else if(!strcmp(k,"ndddds")) gr->ContGen(a[0].v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,opt); + else if(!strcmp(k,"ndddds"))gr->ContGen(a[0].v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,opt); else res = 1; return res; } @@ -424,14 +442,19 @@ int static mgls_cont(mglGraph *gr, long , mglArg *a, const char *k, const char * int static mgls_contd(mglGraph *gr, long , mglArg *a, const char *k, const char *opt) { int res=0; + mglData v; v.a[0]=a[0].v; if(!strcmp(k,"d")) gr->ContD(*(a[0].d),"",opt); else if(!strcmp(k,"ds")) gr->ContD(*(a[0].d),a[1].s.s,opt); else if(!strcmp(k,"dd")) gr->ContD(*(a[0].d), *(a[1].d), "",opt); else if(!strcmp(k,"dds")) gr->ContD(*(a[0].d), *(a[1].d), a[2].s.s,opt); + else if(!strcmp(k,"nd")) gr->ContD(v, *(a[1].d), "",opt); + else if(!strcmp(k,"nds")) gr->ContD(v, *(a[1].d), a[2].s.s,opt); else if(!strcmp(k,"ddd")) gr->ContD(*(a[0].d), *(a[1].d), *(a[2].d), "",opt); else if(!strcmp(k,"ddds")) gr->ContD(*(a[0].d), *(a[1].d), *(a[2].d), a[3].s.s,opt); else if(!strcmp(k,"dddd")) gr->ContD(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), "",opt); else if(!strcmp(k,"dddds")) gr->ContD(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,opt); + else if(!strcmp(k,"nddd")) gr->ContD(v, *(a[1].d), *(a[2].d), *(a[3].d), "",opt); + else if(!strcmp(k,"nddds")) gr->ContD(v, *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,opt); else res = 1; return res; } @@ -456,10 +479,13 @@ int static mgls_contf(mglGraph *gr, long , mglArg *a, const char *k, const char int static mgls_contp(mglGraph *gr, long , mglArg *a, const char *k, const char *opt) { int res=0; + mglData v; v.a[0]=a[0].v; if(!strcmp(k,"dddd")) gr->ContP(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), "",opt); else if(!strcmp(k,"dddds")) gr->ContP(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,opt); else if(!strcmp(k,"ddddd")) gr->ContP(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), "",opt); else if(!strcmp(k,"ddddds")) gr->ContP(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,opt); + else if(!strcmp(k,"ndddd")) gr->ContP(v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), "",opt); + else if(!strcmp(k,"ndddds")) gr->ContP(v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,opt); else res = 1; return res; } @@ -467,14 +493,19 @@ int static mgls_contp(mglGraph *gr, long , mglArg *a, const char *k, const char int static mgls_contv(mglGraph *gr, long , mglArg *a, const char *k, const char *opt) { int res=0; + mglData v; v.a[0]=a[0].v; if(!strcmp(k,"d")) gr->ContV(*(a[0].d),"",opt); else if(!strcmp(k,"ds")) gr->ContV(*(a[0].d),a[1].s.s,opt); else if(!strcmp(k,"dd")) gr->ContV(*(a[0].d), *(a[1].d), "",opt); else if(!strcmp(k,"dds")) gr->ContV(*(a[0].d), *(a[1].d), a[2].s.s,opt); + else if(!strcmp(k,"nd")) gr->ContV(v, *(a[1].d), "",opt); + else if(!strcmp(k,"nds")) gr->ContV(v, *(a[1].d), a[2].s.s,opt); else if(!strcmp(k,"ddd")) gr->ContV(*(a[0].d), *(a[1].d), *(a[2].d), "",opt); else if(!strcmp(k,"ddds")) gr->ContV(*(a[0].d), *(a[1].d), *(a[2].d), a[3].s.s,opt); else if(!strcmp(k,"dddd")) gr->ContV(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), "",opt); else if(!strcmp(k,"dddds")) gr->ContV(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,opt); + else if(!strcmp(k,"nddd")) gr->ContV(v, *(a[1].d), *(a[2].d), *(a[3].d), "",opt); + else if(!strcmp(k,"nddds")) gr->ContV(v, *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,opt); else res = 1; return res; } @@ -661,6 +692,7 @@ int static mgls_quadplot(mglGraph *gr, long , mglArg *a, const char *k, const ch int static mgls_tricont(mglGraph *gr, long , mglArg *a, const char *k, const char *opt) { int res=0; + mglData v; v.a[0]=a[0].v; if(!strcmp(k,"dddd")) gr->TriCont(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),"",opt); else if(!strcmp(k,"dddds")) @@ -673,6 +705,14 @@ int static mgls_tricont(mglGraph *gr, long , mglArg *a, const char *k, const cha gr->TriCont(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),"",opt); else if(!strcmp(k,"dddddds")) gr->TriCont(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),a[6].s.s,opt); + else if(!strcmp(k,"ndddd")) + gr->TriContV(v,*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),"",opt); + else if(!strcmp(k,"ndddds")) + gr->TriContV(v,*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),a[5].s.s,opt); + else if(!strcmp(k,"nddddd")) + gr->TriCont(v,*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),"",opt); + else if(!strcmp(k,"nddddds")) + gr->TriCont(v,*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),a[6].s.s,opt); else res = 1; return res; } @@ -680,6 +720,7 @@ int static mgls_tricont(mglGraph *gr, long , mglArg *a, const char *k, const cha int static mgls_tricontv(mglGraph *gr, long , mglArg *a, const char *k, const char *opt) { int res=0; + mglData v; v.a[0]=a[0].v; if(!strcmp(k,"dddd")) gr->TriContVt(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),"",opt); else if(!strcmp(k,"dddds")) @@ -692,6 +733,10 @@ int static mgls_tricontv(mglGraph *gr, long , mglArg *a, const char *k, const ch gr->TriContVt(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),"",opt); else if(!strcmp(k,"dddddds")) gr->TriContVt(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),a[6].s.s,opt); + else if(!strcmp(k,"nddddd")) + gr->TriContVt(v,*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),"",opt); + else if(!strcmp(k,"nddddds")) + gr->TriContVt(v,*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),a[6].s.s,opt); else res = 1; return res; } @@ -733,18 +778,25 @@ int static mgls_cloud(mglGraph *gr, long , mglArg *a, const char *k, const char int static mgls_cont3(mglGraph *gr, long , mglArg *a, const char *k, const char *opt) { int res=0; + mglData v; v.a[0]=a[0].v; if(!strcmp(k,"d")) gr->Cont3(*(a[0].d), "", -1,opt); else if(!strcmp(k,"ds")) gr->Cont3(*(a[0].d), a[1].s.s, -1,opt); else if(!strcmp(k,"dsn")) gr->Cont3(*(a[0].d), a[1].s.s, mgl_int(a[2].v),opt); else if(!strcmp(k,"dd")) gr->Cont3(*(a[0].d), *(a[1].d), "", -1,opt); else if(!strcmp(k,"dds")) gr->Cont3(*(a[0].d), *(a[1].d), a[2].s.s,-1,opt); else if(!strcmp(k,"ddsn")) gr->Cont3(*(a[0].d), *(a[1].d), a[2].s.s,mgl_int(a[3].v),opt); + else if(!strcmp(k,"nd")) gr->Cont3(v, *(a[1].d), "", -1,opt); + else if(!strcmp(k,"nds")) gr->Cont3(v, *(a[1].d), a[2].s.s,-1,opt); + else if(!strcmp(k,"ndsn")) gr->Cont3(v, *(a[1].d), a[2].s.s,mgl_int(a[3].v),opt); else if(!strcmp(k,"dddd")) gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), "", -1,opt); else if(!strcmp(k,"dddds")) gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,-1,opt); - else if(!strcmp(k,"ddddsn")) gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,mgl_int(a[5].v),opt); - else if(!strcmp(k,"ddddd")) gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), "", -1,opt); + else if(!strcmp(k,"ddddsn"))gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,mgl_int(a[5].v),opt); + else if(!strcmp(k,"ddddd")) gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), "", -1,opt); else if(!strcmp(k,"ddddds")) gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,-1,opt); - else if(!strcmp(k,"dddddsn"))gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,mgl_int(a[6].v),opt); + else if(!strcmp(k,"dddddsn")) gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,mgl_int(a[6].v),opt); + else if(!strcmp(k,"ndddd")) gr->Cont3(v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), "", -1,opt); + else if(!strcmp(k,"ndddds")) gr->Cont3(v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,-1,opt); + else if(!strcmp(k,"nddddsn")) gr->Cont3(v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,mgl_int(a[6].v),opt); else res = 1; return res; } @@ -837,6 +889,26 @@ int static mgls_crust(mglGraph *gr, long , mglArg *a, const char *k, const char return res; } //----------------------------------------------------------------------------- +int static mgls_dcont(mglGraph *gr, long , mglArg *a, const char *k, const char *opt) +{ + int res=0; + mglData v; v.a[0]=a[0].v; + if(!strcmp(k,"dd")) gr->DCont(*(a[0].d), *(a[1].d), "", opt); + else if(!strcmp(k,"dds")) gr->DCont(*(a[0].d), *(a[1].d), a[2].s.s, opt); + else if(!strcmp(k,"ddd")) gr->DCont(*(a[0].d), *(a[1].d), *(a[2].d), "", opt); + else if(!strcmp(k,"ddds")) gr->DCont(*(a[0].d), *(a[1].d), *(a[2].d), a[3].s.s, opt); + else if(!strcmp(k,"ndd")) gr->DCont(v, *(a[1].d), *(a[2].d), "", opt); + else if(!strcmp(k,"ndds")) gr->DCont(v, *(a[1].d), *(a[2].d), a[3].s.s, opt); + else if(!strcmp(k,"ddddd")) gr->DCont(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), "", opt); + else if(!strcmp(k,"ddddds")) gr->DCont(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s, opt); + else if(!strcmp(k,"dddddd")) gr->DCont(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), *(a[5].d), "", opt); + else if(!strcmp(k,"dddddds")) gr->DCont(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), *(a[5].d), a[6].s.s, opt); + else if(!strcmp(k,"nddddd")) gr->DCont(v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), *(a[5].d), "", opt); + else if(!strcmp(k,"nddddds")) gr->DCont(v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), *(a[5].d), a[6].s.s, opt); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- int static mgls_dens3(mglGraph *gr, long , mglArg *a, const char *k, const char *opt) { int res=0; @@ -1159,6 +1231,7 @@ mglCommand mgls_grf_cmd[] = { {"conty",_("Draw contour lines at y-slice (or y-plane)"),"conty Dat ['fmt' pos num]", mgls_conty ,0}, {"contz",_("Draw contour lines at z-slice (or z-plane)"),"contz Dat ['fmt' pos num]", mgls_contz ,0}, {"crust",_("Draw reconstructed surface for arbitrary data points"),"crust Xdat Ydat Zdat ['fmt']", mgls_crust ,0}, + {"dcont",_("Draw curves of cross-section of isosurfaces a,b for 3D data"),"dcont Adat Bdat ['fmt']|Vdat Adat Bdat ['fmt']|Xdat Ydat Zdat Adat Bdat ['fmt']|Vdat Xdat Ydat Zdar Adat Bdat ['fmt']", mgls_dcont ,9}, {"dens",_("Draw density plot"),"dens Zdat ['fmt' zpos]|Xdat Ydat Zdat ['fmt' zpos]", mgls_dens ,8}, {"dens3",_("Draw density plot at slices of 3D data"),"dens3 Adat 'dir' [pos 'fmt']|Xdat Ydat Zdat Adat 'dir' [pos 'fmt']", mgls_dens3 ,9}, {"densx",_("Draw density plot at x-slice (or x-plane)"),"densx Dat ['fmt' pos]", mgls_densx ,0}, @@ -1177,6 +1250,7 @@ mglCommand mgls_grf_cmd[] = { {"iris",_("Draw Iris plots"),"iris Dats 'ids' ['fmt']|Dats Ranges 'ids' ['fmt']", mgls_iris,13}, {"label",_("Draw label at arbitrary position"),"label Ydat 'txt' ['fmt'='']|Xdat Ydat 'txt' ['fmt'='']|Xdat Ydat Zdat 'txt' ['fmt'='']", mgls_label ,7}, {"lamerey",_("Draw Lamerey diagram"),"lamerey x0 Func ['fmt']|x0 'func' ['fmt']", mgls_lamerey ,13}, + {"lines",_("Draw lines with arrows for 1D data"),"lines Y1dat Y2dat ['fmt']|X1dat Y1dat X2dat Y2dat ['fmt']|X1dat Y1dat Z1dat X2dat Y2dat Z2dat ['fmt']", mgls_lines ,7}, {"map",_("Draw mapping plot"),"map Udat Vdat ['fmt']|Xdat Ydat Udat Vdat ['fmt']", mgls_map ,10}, {"mark",_("Draw mark plot for 1D data"),"mark Ydat Rdat ['fmt']|Xdat Ydat Rdat ['fmt']|Xdat Ydat Zdat Rdat ['fmt']", mgls_mark ,7}, {"mesh",_("Draw mesh surface"),"mesh Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_mesh ,8}, diff --git a/src/exec_prm.cpp b/src/exec_prm.cpp index 9e88964..94bc8cc 100644 --- a/src/exec_prm.cpp +++ b/src/exec_prm.cpp @@ -1,9 +1,9 @@ /*************************************************************************** - * exec_2d.cpp is part of Math Graphic Library + * exec_prm.cpp is part of Math Graphic Library * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -67,6 +67,9 @@ int static mgls_background(mglGraph *gr, long , mglArg *a, const char *k, const int res=0; if(!strcmp(k,"s")) gr->LoadBackground(a[0].s.s); else if(!strcmp(k,"sn")) gr->LoadBackground(a[0].s.s,a[1].v); + else if(!strcmp(k,"ss")) gr->LoadBackground(a[0].s.s,a[1].s.s); + else if(!strcmp(k,"ssn")) gr->LoadBackground(a[0].s.s,a[1].s.s,a[2].v); + else if(!strcmp(k,"nnn")) gr->FillBackground(mglColor(a[0].v,a[1].v,a[2].v)); else res = 1; return res; } @@ -106,19 +109,20 @@ int static mgls_circle(mglGraph *gr, long , mglArg *a, const char *k, const char int static mgls_colorbar(mglGraph *gr, long , mglArg *a, const char *k, const char *opt) { int res=0; gr->Self()->SaveState(opt); - if(k[0]==0) gr->Colorbar(); + if(k[0]==0) gr->Colorbar(""); else if(!strcmp(k,"s")) gr->Colorbar(a[0].s.s); else if(!strcmp(k,"d")) gr->Colorbar(*(a[0].d)); else if(!strcmp(k,"ds")) gr->Colorbar(*(a[0].d), a[1].s.s); - else if(!strcmp(k,"snn")) gr->Colorbar(a[0].s.s, a[1].v, a[2].v); + else if(!strcmp(k,"snn")) gr->Colorbar(a[0].s.s, a[1].v, a[2].v,1,1); else if(!strcmp(k,"snnn")) gr->Colorbar(a[0].s.s, a[1].v, a[2].v, a[3].v,1); else if(!strcmp(k,"snnnn")) gr->Colorbar(a[0].s.s, a[1].v, a[2].v, a[3].v,a[4].v); - else if(!strcmp(k,"dsnn")) gr->Colorbar(*(a[0].d), a[1].s.s, a[2].v, a[3].v); + else if(!strcmp(k,"dsnn")) gr->Colorbar(*(a[0].d), a[1].s.s, a[2].v, a[3].v,1,1); else if(!strcmp(k,"dsnnn")) gr->Colorbar(*(a[0].d), a[1].s.s, a[2].v, a[3].v, a[4].v,1); else if(!strcmp(k,"dsnnnn")) gr->Colorbar(*(a[0].d), a[1].s.s, a[2].v, a[3].v, a[4].v,a[5].v); else res = 1; - gr->Self()->LoadState(); return res; + gr->Self()->LoadState(); + return res; } //----------------------------------------------------------------------------- int static mgls_cone(mglGraph *gr, long , mglArg *a, const char *k, const char *opt) @@ -623,7 +627,7 @@ int static mgls_zlabel(mglGraph *gr, long , mglArg *a, const char *k, const char mglCommand mgls_prm_cmd[] = { {"arc",_("Draw angle arc"),"arc x0 y0 x1 y1 a ['fmt']|x0 y0 z0 x1 y1 a ['fmt']|x0 y0 z0 xr yr zr x1 y1 z1 a ['fmt']", mgls_arc ,13}, {"axis",_("Setup or draw axis"),"axis ['dir' 'fmt']|'fx' 'fy' 'fz' ['fc']|how", mgls_axis ,12}, - {"background",_("Load image for background"),"background 'fname' [alpha]", mgls_background ,12}, + {"background",_("Load image for background"),"background 'fname' [alpha]| 'fname' 'how' [alpha]", mgls_background ,12}, {"ball",_("Draw point (ball)"),"ball posx posy ['fmt']|posx posy posz ['fmt']", mgls_ball ,13}, {"box",_("Draw bounding box"),"box ['fmt' ticks]", mgls_box ,12}, {"circle",_("Draw circle"),"circle x y r ['fmt']|x y z r ['fmt']", mgls_circle ,13}, diff --git a/src/exec_set.cpp b/src/exec_set.cpp index bd37129..28ec455 100644 --- a/src/exec_set.cpp +++ b/src/exec_set.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -506,6 +506,14 @@ int static mgls_setsizescl(mglGraph *gr, long , mglArg *a, const char *k, const return res; } //----------------------------------------------------------------------------- +int static mgls_texparse(mglGraph *gr, long , mglArg *a, const char *k, const char *) +{ + int res=0; + if(!strcmp(k,"n")) gr->SetTeXparse(a[0].v); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- int static mgls_setup(mglGraph *gr, long , mglArg *a, const char *k, const char *) { int res=0; @@ -845,6 +853,7 @@ mglCommand mgls_set_cmd[] = { {"stickplot",_("Set position of plot inside cell of rotated stick"), "stickplot num ind tet phi", mgls_stickplot ,5}, {"subplot",_("Set position of plot as cell of matrix"),"subplot m n pos ['style' dx dy]", mgls_subplot ,5}, {"ternary",_("Switch on/off to use ternary axis"),"ternary val", mgls_ternary ,14}, + {"texparse",_("Switch on/off TeX parsing at text output"), "texparse val", mgls_texparse, 2}, {"ticklen",_("Set tick length"),"ticklen val [stt]", mgls_ticklen ,14}, {"tickshift",_("Set additional tick and axis labels shift"),"tickshift dx [dy dz dc]", mgls_tickshift ,14}, {"ticktime",_("Set ticks in time format"),"ticktime 'dir' [dv 'tmpl']", mgls_ticktime ,14}, diff --git a/src/export.cpp b/src/export.cpp index f26fb94..eb67257 100644 --- a/src/export.cpp +++ b/src/export.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -65,7 +65,7 @@ int MGL_NO_EXPORT mgl_pnga_save(const char *fname, int w, int h, unsigned char * PNG_FILTER_TYPE_DEFAULT); png_set_rows(png_ptr, info_ptr, p); png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, 0); - png_write_end(png_ptr, info_ptr); +// png_write_end(png_ptr, info_ptr); } png_destroy_write_struct(&png_ptr, &info_ptr); } @@ -99,7 +99,7 @@ int MGL_NO_EXPORT mgl_png_save(const char *fname, int w, int h, unsigned char ** PNG_FILTER_TYPE_DEFAULT); png_set_rows(png_ptr, info_ptr, p); png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, 0); - png_write_end(png_ptr, info_ptr); +// png_write_end(png_ptr, info_ptr); } png_destroy_write_struct(&png_ptr, &info_ptr); } diff --git a/src/export_2d.cpp b/src/export_2d.cpp index 9d71486..bd07404 100644 --- a/src/export_2d.cpp +++ b/src/export_2d.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -131,7 +131,7 @@ void static put_desc(HMGL gr, void *fp, bool gz, const char *pre, const char *ln int *s = new int[n]; n=0; for(long i=0;iGetPrmNum();i++) { - const mglPrim q = gr->GetPrm(i); + const mglPrim &q = gr->GetPrm(i); if(q.type!=4 || (q.n3&8)) continue; // not a glyph bool is=false; for(long j=0;jGetWidth(), h = _Gr_->GetHeight(); int x1=gr->BBoxX1, x2=gr->BBoxX2<0?w:gr->BBoxX2, y1=gr->BBoxY1, y2=gr->BBoxY2<0?h:gr->BBoxY2; - if(x1<0 || x1>=x2 || y1<0 || y1>=y2) { x1=y1=0; x2=w; y2=h; } + if(x2>w) x2=w; + if(y2>h) y2=h; + if(x1<0 || x1>=x2) { x1=0; x2=w; } + if(y1<0 || y1>=y2) { y1=0; y2=h; } if(gz) { @@ -250,7 +253,7 @@ void MGL_EXPORT mgl_write_eps(HMGL gr, const char *fname,const char *descr) // add mark definition if present for(long i=0;iGetPrmNum();i++) { - const mglPrim q = gr->GetPrm(i); + const mglPrim &q = gr->GetPrm(i); if(q.type>0) continue; if(q.n4=='+') m_p = true; if(q.n4=='x') m_x = true; @@ -329,7 +332,7 @@ void MGL_EXPORT mgl_write_eps(HMGL gr, const char *fname,const char *descr) const mglPrim &q = gr->GetPrm(i); if(q.type<0) continue; // q.n1>=0 always cp.c = _Gr_->GetPrmCol(i); - const mglPnt p1 = gr->GetPnt(q.n1); + const mglPnt &p1 = gr->GetPnt(q.n1); if(q.type>1) { snprintf(str,256,"%.2g %.2g %.2g rgb ", cp.r[0]/255.,cp.r[1]/255.,cp.r[2]/255.); str[255]=0; @@ -459,7 +462,10 @@ void MGL_EXPORT mgl_write_svg(HMGL gr, const char *fname,const char *descr) if(!fp) { gr->SetWarn(mglWarnOpen,fname); return; } int x1=gr->BBoxX1, x2=gr->BBoxX2<0?ww:gr->BBoxX2, y1=gr->BBoxY1, y2=gr->BBoxY2<0?hh:gr->BBoxY2; - if(x1<0 || x1>=x2 || y1<0 || y1>=y2) { x1=y1=0; x2=ww; y2=hh; } + if(x2>ww) x2=ww; + if(y2>hh) y2=hh; + if(x1<0 || x1>=x2) { x1=0; x2=ww; } + if(y1<0 || y1>=y2) { y1=0; y2=hh; } ww = x2-x1; hh = y2-y1; const std::string loc = setlocale(LC_NUMERIC, "C"); @@ -517,7 +523,7 @@ void MGL_EXPORT mgl_write_svg(HMGL gr, const char *fname,const char *descr) const mglPrim &q = gr->GetPrm(i); if(q.type<0) continue; // q.n1>=0 always cp.c = _Gr_->GetPrmCol(i); - const mglPnt p1=gr->GetPnt(q.n1); + const mglPnt &p1=gr->GetPnt(q.n1); if(q.type==0) { mreal x=p1.x-x1,y=hh-p1.y,s=q.s; @@ -692,7 +698,7 @@ void MGL_EXPORT mgl_write_tex(HMGL gr, const char *fname,const char *descr) cp.c = _Gr_->GetPrmCol(i); snprintf(cname,128,"color={rgb,255:red,%d;green,%d;blue,%d}",cp.r[0],cp.r[1],cp.r[2]); cname[127]=0; - const mglPnt p1=gr->GetPnt(q.n1); + const mglPnt &p1=gr->GetPnt(q.n1); mreal x=p1.x/100,y=p1.y/100,s=q.s/100; if(q.type==0) { @@ -729,7 +735,7 @@ void MGL_EXPORT mgl_write_tex(HMGL gr, const char *fname,const char *descr) } else if(q.type==2 && cp.r[3]) { - const mglPnt p2=gr->GetPnt(q.n2), p3=gr->GetPnt(q.n3); + const mglPnt &p2=gr->GetPnt(q.n2), &p3=gr->GetPnt(q.n3); if(cp.r[3]<255) fwprintf(fp, L"\\fill[%s, fill opacity=%.4g] (%.4g,%.4g) -- (%.4g,%.4g) -- (%.4g,%.4g) -- cycle;\n", cname,cp.r[3]/255., x,y, p2.x/100,p2.y/100, p3.x/100,p3.y/100); else @@ -737,7 +743,7 @@ void MGL_EXPORT mgl_write_tex(HMGL gr, const char *fname,const char *descr) } else if(q.type==3 && cp.r[3]) { - const mglPnt p2=gr->GetPnt(q.n2), p3=gr->GetPnt(q.n3), p4=gr->GetPnt(q.n4); + const mglPnt &p2=gr->GetPnt(q.n2), &p3=gr->GetPnt(q.n3), &p4=gr->GetPnt(q.n4); if(cp.r[3]<255) fwprintf(fp, L"\\fill[%s, fill opacity=%.4g] (%.4g,%.4g) -- (%.4g,%.4g) -- (%.4g,%.4g) -- (%.4g,%.4g) -- cycle;\n", cname,cp.r[3]/255., x,y, p2.x/100,p2.y/100, p4.x/100,p4.y/100, p3.x/100,p3.y/100); else diff --git a/src/export_3d.cpp b/src/export_3d.cpp index 58360e9..208c67d 100644 --- a/src/export_3d.cpp +++ b/src/export_3d.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/src/fft.cpp b/src/fft.cpp index 4ac3021..f63b511 100644 --- a/src/fft.cpp +++ b/src/fft.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/src/fit.cpp b/src/fit.cpp index e112af6..25c7d62 100644 --- a/src/fit.cpp +++ b/src/fit.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -28,7 +28,6 @@ #include #include #endif -HMDT MGL_NO_EXPORT mglFormulaCalc(const char *str, const std::vector &head); //----------------------------------------------------------------------------- int mglFitPnts=100; ///< Number of output points in fitting char mglFitRes[1024]; ///< Last fitted formula diff --git a/src/font.cpp b/src/font.cpp index 912f2e3..4d265cf 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -39,9 +39,10 @@ #include "tex_table.cc" //----------------------------------------------------------------------------- //mglFont mglDefFont("nofont"); -mglFont mglDefFont; #define MGL_USE_H12 {if(h1y2) y2=h2; h1=1e5; h2=-1e5;} //----------------------------------------------------------------------------- +mglFont *mglDefFont=NULL; +//----------------------------------------------------------------------------- size_t MGL_EXPORT_PURE mgl_wcslen(const wchar_t *str) { long i=0; @@ -228,7 +229,7 @@ float mglFont::Height(int font) const { if(GetNumGlyph()==0) return 0; int s = (font/MGL_FONT_BOLD)&3; - return 660/fact[s]; + return Hscale*660/fact[s]; } //----------------------------------------------------------------------------- float mglFont::Height(const char *how) const @@ -240,7 +241,7 @@ float mglFont::Height(const char *how) const if(strchr(how,'b')) s = s|1; if(strchr(how,'i')) s = s|2; } - return 660/fact[s]; + return Hscale*660/fact[s]; } //----------------------------------------------------------------------------- /// Table of acents and its UTF8 codes @@ -731,7 +732,7 @@ bool mglFont::read_main(const char *fname, std::vector &buf) //----------------------------------------------------------------------------- void mglFont::FillY12() { -#pragma omp parallel +//#pragma omp parallel // TODO problem at initialization of global object ... enable back after fixing global obj issue for(long i=0;i0) { - glyphs.reserve(ex_b.size()); // preallocate memory + glyphs.reserve(ex_b.size()); // pmgl_reallocate memory glyphs.insert(glyphs.end(), ex_b.begin(), ex_b.end()); std::sort(glyphs.begin(),glyphs.end()); } @@ -955,37 +956,20 @@ bool mglFont::Load(const char *base, const char *path) return true; } //----------------------------------------------------------------------------- -#if MGL_HAVE_PTHREAD -pthread_mutex_t mutexRnd; -#endif -//----------------------------------------------------------------------------- -float mgl_cos[360]; -void static mgl_init() -{ - mgl_textdomain(NULL,""); -#if MGL_HAVE_PTHREAD - pthread_mutex_init(&mutexRnd,0); -#endif -#ifndef WIN32 // win32 don't initialized threads before main() -#pragma omp parallel for -#endif - for(long i=0;i<360;i++) mgl_cos[i] = cos(i*M_PI/180.); -} -//----------------------------------------------------------------------------- mglFont::mglFont(const char *name, const char *path) { - parse = true; gr=0; Buf=0; -// if(this==&mglDefFont) Load(name, path); else Copy(&mglDefFont); + parse = true; gr=0; Buf=0; Hscale=1; if(name && *name) Load(name, path); - else if(this!=&mglDefFont) Copy(&mglDefFont); - else - { - mgl_init(); // NOTE: this call init function for the library. - Load(MGL_DEF_FONT_NAME,0); - } + else Load(MGL_DEF_FONT_NAME,0); +} +mglFont::mglFont() +{ + parse = true; gr=0; Buf=0; Hscale=1; + if(!mglDefFont) mgl_init(); + Copy(mglDefFont); } mglFont::~mglFont() { if(Buf) delete []Buf; } -void mglFont::Restore() { Copy(&mglDefFont); } +void mglFont::Restore() { Copy(mglDefFont); } //----------------------------------------------------------------------------- void mglFont::Clear() { diff --git a/src/fractal.cpp b/src/fractal.cpp index 7cc9431..f80fcc6 100644 --- a/src/fractal.cpp +++ b/src/fractal.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/src/interp.hpp b/src/interp.hpp index 211201c..960656d 100644 --- a/src/interp.hpp +++ b/src/interp.hpp @@ -1,263 +1,269 @@ -//----------------------------------------------------------------------------- -template Treal mglLineart(const Treal *a, long nx, long ny, long nz, mreal x, mreal y, mreal z) -{ - if(!a || nx<1 || ny<1 || nz<1) return 0; - Treal 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!=floor(z)) // 3d interpolation - { - long kx=long(x), ky=long(y), kz=long(z); - dx = x-mreal(kx); dy = y-mreal(ky); dz = z-mreal(kz); - - long i0 = kx+nx*(ky+ny*kz); - b0 = a[i0]*(mreal(1)-dx-dy+dx*dy) + dx*(mreal(1)-dy)*a[i0+1] + - dy*(mreal(1)-dx)*a[i0+nx] + dx*dy*a[i0+nx+1]; - i0 = kx+nx*(ky+ny*(kz+1)); - b1 = a[i0]*(mreal(1)-dx-dy+dx*dy) + dx*(mreal(1)-dy)*a[i0+1] + - dy*(mreal(1)-dx)*a[i0+nx] + dx*dy*a[i0+nx+1]; - b = b0 + dz*(b1-b0); - } - else if(ny>1 && y!=floor(y)) // 2d interpolation - { - long kx=long(x), ky=long(y); - dx = x-kx; dy=y-ky; - long i0 = kx+nx*ky; - b = a[i0]*(mreal(1)-dx-dy+dx*dy) + dx*(mreal(1)-dy)*a[i0+1] + - dy*(mreal(1)-dx)*a[i0+nx] + dx*dy*a[i0+nx+1]; - } - else if(nx>1 && x!=floor(x)) // 1d interpolation - { - long 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; -} -//----------------------------------------------------------------------------- -template Treal mgl_spline3t(const Treal y[4], long n, mreal dx, Treal &dy) -{ - Treal d[3]; - d[0] = -(y[2]-mreal(4)*y[1]+mreal(3)*y[0])/mreal(2); - d[1] = (y[2]-y[0])/mreal(2); - d[2] = (y[3]-y[1])/mreal(2); - - Treal t0 = (y[2]+y[0])/mreal(2)-y[1]; - Treal t1 = (y[3]+y[1])/mreal(2)-y[2]; - Treal f0 = y[n], d0 = d[n], res = 0; - if(n==1) - { - Treal df = y[2]-f0, d1 = d[2]; - Treal b3 = mreal(10)*df+t1-mreal(3)*t0-mreal(4)*d1-mreal(6)*d0; - Treal b4 = mreal(-15)*df-mreal(2)*t1+mreal(3)*t0+mreal(7)*d1+mreal(8)*d0; - Treal b5 = mreal(6)*df+t1-t0-mreal(3)*d1-mreal(3)*d0; - dy = d0 + dx*(mreal(2)*t0+dx*(mreal(3)*b3+dx*(mreal(4)*b4+dx*mreal(5)*b5))); -// d2y = mreal(2)*t0 + dx*(mreal(6)*b3+dx*(mreal(12)*b4+dx*mreal(20)*b5)); // 2nd derivative for future - res = f0 + dx*(d0+dx*(t0+dx*(b3+dx*(b4+dx*b5)))); - } - else if(n<1) - { res = f0 + dx*(d0+dx*t0); dy = d0+dx*t0*mreal(2); } - else - { res = f0 + dx*(d0+dx*t1); dy = d0+dx*t1*mreal(2); } - return res; -} -//----------------------------------------------------------------------------- -template Treal mgl_spline3st(const Treal y[4], long n, mreal dx) -{ - Treal d[3]; - d[0] = -(y[2]-mreal(4)*y[1]+mreal(3)*y[0])/mreal(2); - d[1] = (y[2]-y[0])/mreal(2); - d[2] = (y[3]-y[1])/mreal(2); - - Treal f0 = y[n], d0 = d[n], res; - Treal t0 = (y[2]+y[0])/mreal(2)-y[1]; - Treal t1 = (y[3]+y[1])/mreal(2)-y[2]; - if(n==1) - { - Treal df = y[2]-f0, d1 = d[2]; - Treal b3 = mreal(10)*df+t1-mreal(3)*t0-mreal(4)*d1-mreal(6)*d0; - Treal b4 = mreal(-15)*df-mreal(2)*t1+mreal(3)*t0+mreal(7)*d1+mreal(8)*d0; - Treal b5 = mreal(6)*df+t1-t0-mreal(3)*d1-mreal(3)*d0; - res = f0 + dx*(d0+dx*(t0+dx*(b3+dx*(b4+dx*b5)))); - } - else res = f0 + dx*(d0+dx*(n<1?t0:t1)); - return res; -} -//----------------------------------------------------------------------------- -template Treal mglSpline1t(const Treal *a, long nx, mreal x, Treal *dx=0) -{ - Treal r,d; - if(nx>3) - { - long k = long(x); - if(k>0 && k(a+k-1, 1, x-k, d); - else if(k<1) r = mgl_spline3t(a, 0, x, d); - else r = mgl_spline3t(a+nx-4, 2, x+2-nx, d); - } - else if(nx<2) { d=0; r = a[0]; } - else if(nx==2) { d=a[1]-a[0]; r = a[0]+(a[1]-a[0])*x; } - else // nx==3 - { - Treal b1=-(a[2]-mreal(4)*a[1]+mreal(3)*a[0])/mreal(2), b2=(a[2]-mreal(2)*a[1]+a[0])/mreal(2); - d = b1+mreal(2)*b2*x; r = a[0]+x*(b1+b2*x); - } - if(dx) *dx=d; - return r; -} -//----------------------------------------------------------------------------- -template Treal mglSpline1st(const Treal *a, long nx, mreal x) -{ - Treal r; - if(nx>3) - { - long k = long(x); - if(k>0 && k(a+k-1, 1, x-k); - else if(k<1) r = mgl_spline3st(a, 0, x); - else r = mgl_spline3st(a+nx-4, 2, x+2-nx); - } - else if(nx<2) r = a[0]; - else if(nx==2) r = a[0]+(a[1]-a[0])*x; - else // nx==3 - { - Treal b1=-(a[2]-mreal(4)*a[1]+mreal(3)*a[0])/mreal(2), b2=(a[2]-mreal(2)*a[1]+a[0])/mreal(2); - r = a[0]+x*(b1+b2*x); - } - return r; -} -//----------------------------------------------------------------------------- -template Treal mglSpline3t(const Treal *a, long nx, long ny, long nz, mreal x, mreal y, mreal z, Treal *dx=0, Treal *dy=0, Treal *dz=0) -{ -// if(!a || nx<1 || ny<1 || nz<1) return 0; // NOTE remove this line because this should already checked - Treal gx=0,gy=0,gz=0; - x = x>0 ?(x0 ?(y0 ?(z1) // 3d interpolation - { - Treal tz[4], yz[4], xz[4]; - long kz=long(z)-1, mz, k=long(y)-1, m; - if(nz>3) - { mz = 4; kz = kz>=0?kz:0; - if(kz>nz-4) kz = nz-4; } - else { mz = nz; kz=0; } - if(ny>3) - { m = 4; k = k>=0?k:0; - if(k>ny-4) k = ny-4; } - else { m = ny; k=0; } - for(long j=0;j(a+nx*(i+k+ny*(j+kz)),nx,x,d+i); - tz[j] = mglSpline1t(t,m,y-k,yz+j); - xz[j] = mglSpline1t(d,m,y-k,0); - } - b = mglSpline1t(tz,mz,z-kz,&gz); - gx = mglSpline1t(xz,mz,z-kz,0); - gy = mglSpline1t(yz,mz,z-kz,0); - } - else if(ny>1) // 2d interpolation - { - Treal t[4], d[4]; - long k = long(y)-1, m; - if(ny>3) - { m = 4; k = k>=0?k:0; if(k>ny-4) k = ny-4; } - else { m = ny; k=0; } - for(long i=0;i(a+nx*(i+k),nx,x,d+i); - b = mglSpline1t(t,m,y-k,&gy); - gx = mglSpline1t(d,m,y-k,0); - } - else // 1d interpolation - b = mglSpline1t(a,nx,x,&gx); - if(dx) *dx=gx; - if(dy) *dy=gy; - if(dz) *dz=gz; - return b; -} -//----------------------------------------------------------------------------- -template Treal mglSpline3st(const Treal *a, long nx, long ny, long nz, mreal x, mreal y, mreal z) -{ -// if(!a || nx<1 || ny<1 || nz<1) return 0; // NOTE remove this line because this should already checked - x = x>0 ?(x0 ?(y0 ?(z1) // 3d interpolation - { - Treal tz[4], t[4]; - long kz=long(z)-1, mz, k=long(y)-1, m; - if(nz>3) - { mz = 4; kz = kz>=0?kz:0; - if(kz>nz-4) kz = nz-4; } - else { mz = nz; kz=0; } - if(ny>3) - { m = 4; k = k>=0?k:0; - if(k>ny-4) k = ny-4; } - else { m = ny; k=0; } - for(long j=0;j(a+nx*(i+k+ny*(j+kz)),nx,x); - tz[j] = mglSpline1st(t,m,y-k); - } - b = mglSpline1st(tz,mz,z-kz); - } - else if(ny>1) // 2d interpolation - { - Treal t[4]; - long k = long(y)-1, m; - if(ny>3) - { m = 4; k = k>=0?k:0; - if(k>ny-4) k = ny-4; } - else { m = ny; k=0; } - for(long i=0;i(a+nx*(i+k),nx,x); - b = mglSpline1st(t,m,y-k); - } - else // 1d interpolation - b = mglSpline1st(a,nx,x); - return b; -} -//----------------------------------------------------------------------------- -template void mgl_gspline_init(long n, const mreal *x, const Treal *v, Treal *c) -{ // c must have size 5*(n-1) !!! -// if(n<2) return; // NOTE remove this line because this should already checked - Treal *a = new Treal[n], *b = new Treal[n]; - for(long i=0;i=0;i--) b[i] += a[i]*b[i+1]; - // no spline coefficients - for(long i=0;i Treal mglLineart(const Treal *a, long nx, long ny, long nz, mreal x, mreal y, mreal z) +{ + if(!a || nx<1 || ny<1 || nz<1) return 0; + Treal 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!=floor(z)) // 3d interpolation + { + long kx=long(x), ky=long(y), kz=long(z); + dx = x-mreal(kx); dy = y-mreal(ky); dz = z-mreal(kz); + + long i0 = kx+nx*(ky+ny*kz); + b0 = a[i0]*(mreal(1)-dx-dy+dx*dy) + dx*(mreal(1)-dy)*a[i0+1] + + dy*(mreal(1)-dx)*a[i0+nx] + dx*dy*a[i0+nx+1]; + i0 = kx+nx*(ky+ny*(kz+1)); + b1 = a[i0]*(mreal(1)-dx-dy+dx*dy) + dx*(mreal(1)-dy)*a[i0+1] + + dy*(mreal(1)-dx)*a[i0+nx] + dx*dy*a[i0+nx+1]; + b = b0 + dz*(b1-b0); + } + else if(ny>1 && y!=floor(y)) // 2d interpolation + { + long kx=long(x), ky=long(y); + dx = x-kx; dy=y-ky; + long i0 = kx+nx*ky; + b = a[i0]*(mreal(1)-dx-dy+dx*dy) + dx*(mreal(1)-dy)*a[i0+1] + + dy*(mreal(1)-dx)*a[i0+nx] + dx*dy*a[i0+nx+1]; + } + else if(nx>1 && x!=floor(x)) // 1d interpolation + { + long 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; +} +//----------------------------------------------------------------------------- +template Treal mgl_spline3t(const Treal y[4], long n, mreal dx, Treal &dy) +{ + Treal d[3]; + d[0] = -(y[2]-mreal(4)*y[1]+mreal(3)*y[0])/mreal(2); + d[1] = (y[2]-y[0])/mreal(2); + d[2] = (y[3]-y[1])/mreal(2); + + Treal t0 = (y[2]+y[0])/mreal(2)-y[1]; + Treal t1 = (y[3]+y[1])/mreal(2)-y[2]; + Treal f0 = y[n], d0 = d[n], res = 0; + if(n==1) + { + Treal df = y[2]-f0, d1 = d[2]; + Treal b3 = mreal(10)*df+t1-mreal(3)*t0-mreal(4)*d1-mreal(6)*d0; + Treal b4 = mreal(-15)*df-mreal(2)*t1+mreal(3)*t0+mreal(7)*d1+mreal(8)*d0; + Treal b5 = mreal(6)*df+t1-t0-mreal(3)*d1-mreal(3)*d0; + dy = d0 + dx*(mreal(2)*t0+dx*(mreal(3)*b3+dx*(mreal(4)*b4+dx*mreal(5)*b5))); +// d2y = mreal(2)*t0 + dx*(mreal(6)*b3+dx*(mreal(12)*b4+dx*mreal(20)*b5)); // 2nd derivative for future + res = f0 + dx*(d0+dx*(t0+dx*(b3+dx*(b4+dx*b5)))); + } + else if(n<1) + { res = f0 + dx*(d0+dx*t0); dy = d0+dx*t0*mreal(2); } + else + { res = f0 + dx*(d0+dx*t1); dy = d0+dx*t1*mreal(2); } + return res; +} +//----------------------------------------------------------------------------- +template Treal mgl_spline3st(const Treal y[4], long n, mreal dx) +{ + Treal d[3]; + d[0] = -(y[2]-mreal(4)*y[1]+mreal(3)*y[0])/mreal(2); + d[1] = (y[2]-y[0])/mreal(2); + d[2] = (y[3]-y[1])/mreal(2); + + Treal f0 = y[n], d0 = d[n], res; + Treal t0 = (y[2]+y[0])/mreal(2)-y[1]; + Treal t1 = (y[3]+y[1])/mreal(2)-y[2]; + if(n==1) + { + Treal df = y[2]-f0, d1 = d[2]; + Treal b3 = mreal(10)*df+t1-mreal(3)*t0-mreal(4)*d1-mreal(6)*d0; + Treal b4 = mreal(-15)*df-mreal(2)*t1+mreal(3)*t0+mreal(7)*d1+mreal(8)*d0; + Treal b5 = mreal(6)*df+t1-t0-mreal(3)*d1-mreal(3)*d0; + res = f0 + dx*(d0+dx*(t0+dx*(b3+dx*(b4+dx*b5)))); + } + else res = f0 + dx*(d0+dx*(n<1?t0:t1)); + return res; +} +//----------------------------------------------------------------------------- +template Treal mglSpline1t(const Treal *a, long nx, mreal x, Treal *dx=0) +{ + Treal r,d; + if(nx>3) + { + long k = long(x); + if(k>0 && k(a+k-1, 1, x-k, d); + else if(k<1) r = mgl_spline3t(a, 0, x, d); + else r = mgl_spline3t(a+nx-4, 2, x+2-nx, d); + } + else if(nx<2) { d=0; r = a[0]; } + else if(nx==2) { d=a[1]-a[0]; r = a[0]+(a[1]-a[0])*x; } + else // nx==3 + { + Treal b1=-(a[2]-mreal(4)*a[1]+mreal(3)*a[0])/mreal(2), b2=(a[2]-mreal(2)*a[1]+a[0])/mreal(2); + d = b1+mreal(2)*b2*x; r = a[0]+x*(b1+b2*x); + } + if(dx) *dx=d; + return r; +} +//----------------------------------------------------------------------------- +template Treal mglSpline1st(const Treal *a, long nx, mreal x) +{ + Treal r; + if(nx>3) + { + long k = long(x); + if(k>0 && k(a+k-1, 1, x-k); + else if(k<1) r = mgl_spline3st(a, 0, x); + else r = mgl_spline3st(a+nx-4, 2, x+2-nx); + } + else if(nx<2) r = a[0]; + else if(nx==2) r = a[0]+(a[1]-a[0])*x; + else // nx==3 + { + Treal b1=-(a[2]-mreal(4)*a[1]+mreal(3)*a[0])/mreal(2), b2=(a[2]-mreal(2)*a[1]+a[0])/mreal(2); + r = a[0]+x*(b1+b2*x); + } + return r; +} +//----------------------------------------------------------------------------- +template Treal mglSpline3t(const Treal *a, long nx, long ny, long nz, mreal x, mreal y, mreal z, Treal *dx=0, Treal *dy=0, Treal *dz=0) +{ +// if(!a || nx<1 || ny<1 || nz<1) return 0; // NOTE remove this line because this should already checked + Treal gx=0,gy=0,gz=0; + x = x>0 ?(x0 ?(y0 ?(z1) // 3d interpolation + { + Treal tz[4], yz[4], xz[4]; + long kz=long(z)-1, mz, k=long(y)-1, m; + if(nz>3) + { mz = 4; kz = kz>=0?kz:0; + if(kz>nz-4) kz = nz-4; } + else { mz = nz; kz=0; } + if(ny>3) + { m = 4; k = k>=0?k:0; + if(k>ny-4) k = ny-4; } + else { m = ny; k=0; } + for(long j=0;j(a+nx*(i+k+ny*(j+kz)),nx,x,d+i); + tz[j] = mglSpline1t(t,m,y-k,yz+j); + xz[j] = mglSpline1t(d,m,y-k,0); + } + b = mglSpline1t(tz,mz,z-kz,&gz); + gx = mglSpline1t(xz,mz,z-kz,0); + gy = mglSpline1t(yz,mz,z-kz,0); + } + else if(ny>1) // 2d interpolation + { + Treal t[4], d[4]; + long k = long(y)-1, m; + if(ny>3) + { m = 4; k = k>=0?k:0; if(k>ny-4) k = ny-4; } + else { m = ny; k=0; } + for(long i=0;i(a+nx*(i+k),nx,x,d+i); + b = mglSpline1t(t,m,y-k,&gy); + gx = mglSpline1t(d,m,y-k,0); + } + else // 1d interpolation + b = mglSpline1t(a,nx,x,&gx); + if(dx) *dx=gx; + if(dy) *dy=gy; + if(dz) *dz=gz; + return b; +} +//----------------------------------------------------------------------------- +template Treal mglSpline3st(const Treal *a, long nx, long ny, long nz, mreal x, mreal y, mreal z) +{ +// if(!a || nx<1 || ny<1 || nz<1) return 0; // NOTE remove this line because this should already checked + x = x>0 ?(x0 ?(y0 ?(z1) // 3d interpolation + { + Treal tz[4], t[4]; + long kz=long(z)-1, mz, k=long(y)-1, m; + if(nz>3) + { mz = 4; kz = kz>=0?kz:0; + if(kz>nz-4) kz = nz-4; } + else { mz = nz; kz=0; } + if(ny>3) + { m = 4; k = k>=0?k:0; + if(k>ny-4) k = ny-4; } + else { m = ny; k=0; } + for(long j=0;j(a+nx*(i+k+ny*(j+kz)),nx,x); + tz[j] = mglSpline1st(t,m,y-k); + } + b = mglSpline1st(tz,mz,z-kz); + } + else if(ny>1) // 2d interpolation + { + Treal t[4]; + long k = long(y)-1, m; + if(ny>3) + { m = 4; k = k>=0?k:0; + if(k>ny-4) k = ny-4; } + else { m = ny; k=0; } + for(long i=0;i(a+nx*(i+k),nx,x); + b = mglSpline1st(t,m,y-k); + } + else // 1d interpolation + b = mglSpline1st(a,nx,x); + return b; +} +//----------------------------------------------------------------------------- +template void mgl_gspline_init(long n, const mreal *x, const Treal *v, Treal *c) +{ // c must have size 5*(n-1) !!! +// if(n<2) return; // NOTE remove this line because this should already checked + Treal *a = new Treal[n], *b = new Treal[n]; + for(long i=0;i=0;i--) b[i] += a[i]*b[i+1]; + // now spline coefficients + for(long i=0;i str; HAEX *eqC; HMEX *eqR; const char *var; + char brd; + long m,n; + std::vector head; + HMDT t; - mglEqTxT(const char *vars=0):eqC(0),eqR(0),var(vars) {} + mglEqTxT(const char *vars=0):eqC(0),eqR(0),var(vars),brd(0) {} ~mglEqTxT() { if(eqR) { for(size_t 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -30,8 +30,6 @@ void MGL_NO_EXPORT mgl_printf(void *fp, bool gz, const char *str, ...); #include #include #include -#include - #include #include #include @@ -147,8 +145,8 @@ class ObjXYZ { x = fx; y = fy; z = fz; } mreal Dot(const ObjXYZ & sPt) const { return(x*sPt.x)+(y*sPt.y)+(z*sPt.z); } - mreal LengthSquared() - { return(x*x+y*y+z*z); } +// mreal LengthSquared() +// { return(x*x+y*y+z*z); } friend ObjXYZ operator + (const ObjXYZ& a, const ObjXYZ& b) { return ObjXYZ(a.x+b.x,a.y+b.y,a.z+b.z); } diff --git a/src/opengl.cpp b/src/opengl.cpp index 3f1b15c..e8ccd28 100644 --- a/src/opengl.cpp +++ b/src/opengl.cpp @@ -18,7 +18,7 @@ uintptr_t MGL_EXPORT mgl_create_graph_gl_() { return uintptr_t(new mglCanvasGL); } //----------------------------------------------------------------------------- mglCanvasGL::mglCanvasGL() : mglCanvas(1,1) -{ Clf(); Zoom(0,0,1,1); set(MGL_FULL_CURV); } +{ Clf(); Zoom(0,0,1,1); set(MGL_FULL_CURV); limit_pm1=true; } //----------------------------------------------------------------------------- mglCanvasGL::~mglCanvasGL(){} //----------------------------------------------------------------------------- @@ -131,7 +131,6 @@ void mglCanvasGL::AddLight(int n,mglPoint r,mglPoint d,char cc, mreal br,mreal a spc[0] = spc[1] = spc[2] = br; amb[0] = amb[1] = amb[2] = AmbBr; } - ap = 90-180*atan(fabs(ap))/M_PI; dif[0] = dif[1] = dif[2] = DifBr; dif[3] = amb[3] = spc[3] = 1.; if(inf) @@ -146,6 +145,7 @@ void mglCanvasGL::AddLight(int n,mglPoint r,mglPoint d,char cc, mreal br,mreal a glLightfv(GL_LIGHT0+n, GL_POSITION, pos); if(!inf) { +// ap = 90-180*atan(fabs(ap))/M_PI; // float dir[4]={d.x, d.y, d.z, 0}; // glLightfv(GL_LIGHT0+n, GL_SPOT_DIRECTION, dir); // glLightf(GL_LIGHT0+n, GL_SPOT_CUTOFF, ap); diff --git a/src/other.cpp b/src/other.cpp index e235c8f..530e829 100644 --- a/src/other.cpp +++ b/src/other.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -155,7 +155,7 @@ void MGL_EXPORT mgl_dens_z_(uintptr_t *gr, uintptr_t *a, const char *sch, mreal // ContX, ContY, ContZ series // //----------------------------------------------------------------------------- -void MGL_EXPORT mgl_cont_gen(HMGL gr, mreal val, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, int text,long ak); +void MGL_EXPORT mgl_cont_genI(HMGL gr, mreal val, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, int text,long ak); void MGL_EXPORT mgl_cont_x_val(HMGL gr, HCDT v, HCDT a, const char *sch, double sv, const char *opt) { long n=a->GetNx(),m=a->GetNy(); @@ -177,7 +177,7 @@ void MGL_EXPORT mgl_cont_x_val(HMGL gr, HCDT v, HCDT a, const char *sch, double for(long i=0;iGetNx();i++) { mreal v0 = v->v(i); - mgl_cont_gen(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0); + mgl_cont_genI(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0); } gr->EndGroup(); } @@ -203,7 +203,7 @@ void MGL_EXPORT mgl_cont_y_val(HMGL gr, HCDT v, HCDT a, const char *sch, double for(long i=0;iGetNx();i++) { mreal v0 = v->v(i); - mgl_cont_gen(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0); + mgl_cont_genI(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0); } gr->EndGroup(); } @@ -229,7 +229,7 @@ void MGL_EXPORT mgl_cont_z_val(HMGL gr, HCDT v, HCDT a, const char *sch, double for(long i=0;iGetNx();i++) { mreal v0 = v->v(i); - mgl_cont_gen(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0); + mgl_cont_genI(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0); } gr->EndGroup(); } @@ -295,7 +295,7 @@ void MGL_EXPORT mgl_cont_z_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const // ContFX, ContFY, ContFZ series // //----------------------------------------------------------------------------- -void MGL_EXPORT mgl_contf_gen(HMGL gr, mreal v1, mreal v2, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, long ak); +void MGL_EXPORT mgl_contf_genI(HMGL gr, mreal v1, mreal v2, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, long ak); void MGL_EXPORT mgl_contf_x_val(HMGL gr, HCDT v, HCDT a, const char *sch, double sv, const char *opt) { long n=a->GetNx(),m=a->GetNy(); @@ -312,7 +312,7 @@ void MGL_EXPORT mgl_contf_x_val(HMGL gr, HCDT v, HCDT a, const char *sch, double for(long i=0;iGetNx()-1;i++) { mreal v0 = v->v(i); - mgl_contf_gen(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0); + mgl_contf_genI(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0); } gr->EndGroup(); } @@ -333,7 +333,7 @@ void MGL_EXPORT mgl_contf_y_val(HMGL gr, HCDT v, HCDT a, const char *sch, double for(long i=0;iGetNx()-1;i++) { mreal v0 = v->v(i); - mgl_contf_gen(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0); + mgl_contf_genI(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0); } gr->EndGroup(); } @@ -354,7 +354,7 @@ void MGL_EXPORT mgl_contf_z_val(HMGL gr, HCDT v, HCDT a, const char *sch, double for(long i=0;iGetNx()-1;i++) { mreal v0 = v->v(i); - mgl_contf_gen(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0); + mgl_contf_genI(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0); } gr->EndGroup(); } diff --git a/src/parser.cpp b/src/parser.cpp index d4a9c92..8db774a 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -33,18 +33,20 @@ mglCommand *mglParser::BaseCmd=NULL; ///< Base table of MGL commands. It MUST be void mglParser::FillBaseCmd() { if(BaseCmd) return; - size_t na=0, nd=0, ng=0, np=0, ns=0, nsum=0; + size_t na=0, nd=0, ng=0, np=0, ns=0, nr=0, nsum=0; while(mgls_prg_cmd[na].name[0]) na++; while(mgls_dat_cmd[nd].name[0]) nd++; while(mgls_grf_cmd[ng].name[0]) ng++; while(mgls_prm_cmd[np].name[0]) np++; while(mgls_set_cmd[ns].name[0]) ns++; - BaseCmd = new mglCommand[na+nd+ng+np+ns+1]; + while(mgls_rnd_cmd[nr].name[0]) nr++; + BaseCmd = new mglCommand[na+nd+ng+np+ns+nr+1]; memcpy(BaseCmd, mgls_prg_cmd, na*sizeof(mglCommand)); nsum+=na; memcpy(BaseCmd+nsum,mgls_dat_cmd, nd*sizeof(mglCommand)); nsum+=nd; memcpy(BaseCmd+nsum,mgls_grf_cmd, ng*sizeof(mglCommand)); nsum+=ng; memcpy(BaseCmd+nsum,mgls_prm_cmd, np*sizeof(mglCommand)); nsum+=np; - memcpy(BaseCmd+nsum,mgls_set_cmd, (ns+1)*sizeof(mglCommand)); nsum+=ns; + memcpy(BaseCmd+nsum,mgls_rnd_cmd, nr*sizeof(mglCommand)); nsum+=nr; + memcpy(BaseCmd+nsum,mgls_set_cmd,(ns+1)*sizeof(mglCommand));nsum+=ns; qsort(BaseCmd, nsum, sizeof(mglCommand), mgl_cmd_cmp); #if DEBUG long stat[17]; memset(stat,0,17*sizeof(long)); @@ -55,8 +57,8 @@ void mglParser::FillBaseCmd() #endif } //----------------------------------------------------------------------------- -HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring string, mglParser *arg, const std::vector &head); -HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring string, mglParser *arg, const std::vector &head); +HMDT MGL_NO_EXPORT mglFormulaCalc(const std::wstring &string, mglParser *arg, const std::vector &head); +HADT MGL_NO_EXPORT mglFormulaCalcC(const std::wstring &string, mglParser *arg, const std::vector &head); //----------------------------------------------------------------------------- MGL_EXPORT void (*mgl_ask_func)(const wchar_t *, wchar_t *)=0; void MGL_EXPORT mgl_ask_gets(const wchar_t *quest, wchar_t *res) @@ -73,9 +75,9 @@ MGL_EXPORT void (*mgl_progress_func)(int value, int maximal, HMGL)=mgl_progress_ void MGL_EXPORT mgl_progress(int value, int maximal, HMGL gr) { mgl_progress_func(value, maximal, gr); } //----------------------------------------------------------------------------- -mglFunc::mglFunc(long p, const wchar_t *f) +mglFunc::mglFunc(long p, const wchar_t *f):func(f) { - pos = p; func = f; + pos = p; size_t i; for(i=0;(isalnum(f[i]) || f[i]=='_');i++); narg = wcstol(f+i+1,0,0); func.crop(0,i); @@ -182,10 +184,13 @@ int mglParser::Exec(mglGraph *gr, const wchar_t *com, long n, mglArg *a, const s if(s[k]>' ') alph=true; if(alph && s[k]<=' ') break; } - HMDT d1 = mglFormulaCalc(s.substr(j+1,k-j),this, DataList); - HMDT d2 = mglFormulaCalc(s.substr(k+1),this, DataList); - mglprintf(buf,64,L" %g %g",d1->a[0],d2->a[0]); - s = o+buf; delete d1; delete d2; + if(ka[0],d2->a[0]); + s = o+buf; delete d1; delete d2; + } } else if(o!=L"legend") // 1 argument { @@ -424,7 +429,11 @@ void mglParser::FillArg(mglGraph *gr, int k, std::wstring *arg, mglArg *a) id.push_back(4); s.push_back(str.substr(ii,i-ii)); op=0; ii=i+1; ns--; } - else if(na%2==0 && np==1 && str[i]==')' && ns==0) np--; + else if(na%2==0 && np>0 && ns==0) + { + if(str[i]==')') np--; + if(str[i]=='(') np++; + } } if(op && ll>ii) { id.push_back(op); s.push_back(str.substr(ii,ll-ii)); } @@ -853,7 +862,7 @@ int mglParser::Parse(mglGraph *gr, std::wstring str, long pos) if(n) st.state = MGL_ST_BREAK; stack.push_back(st); delete []a; return n; } - // alocate new arrays and execute the command itself + // allocate new arrays and execute the command itself n = PreExec(gr, k, &(arg[0]), a); if(n>0) n--; else if(!arg[0].compare(L"setsize") && !AllowSetSize) n = 2; @@ -1090,7 +1099,7 @@ void mglParser::Execute(mglGraph *gr, const wchar_t *text) if(text[i]=='\\') next = i; else if(text[i]>' ')next = 0; if(text[i]=='\n') - { // if string need to be continued then I but ' ' instead of 0x0 and + { // if string need to be continued then I put ' ' instead of 0x0 and // pointer next string to 0x0. Last one for keeping number of strings. if(next) { for(size_t ii=next;ii<=i;ii++) wcs[ii]='\b'; str[n] = wcs+s-1; next=0; } diff --git a/src/pde.cpp b/src/pde.cpp index 36219e1..a97f42a 100644 --- a/src/pde.cpp +++ b/src/pde.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -24,7 +24,6 @@ #include "mgl2/base.h" #include "interp.hpp" const double GAMMA=0.1; ///< value for damping -HADT MGL_NO_EXPORT mglFormulaCalcC(const char *str, const std::vector &head); //----------------------------------------------------------------------------- // // Advanced PDE series in 2D case @@ -252,7 +251,7 @@ uintptr_t MGL_EXPORT mgl_pde_adv_(uintptr_t* gr, const char *ham, uintptr_t* ini //----------------------------------------------------------------------------- struct mgl_pde_ham { - dual *a,*hxy,*hxv,*huv,*huy; + ddual *a,*hxy,*hxv,*huv,*huy; const char *eqs; long nx,ny; double xx,yy,xs,ys,dx,dy,dq,dp,zz; @@ -315,19 +314,19 @@ HADT MGL_EXPORT mgl_pde_solve_c(HMGL gr, const char *ham, HCDT ini_re, HCDT ini_ { gr->SetWarn(mglWarnDim,"PDE"); return 0; } mglDataC *res=new mglDataC(nz, nx, ny); - 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]; + ddual *a = new ddual[4*nx*ny], hh0; // Add "damping" area + ddual *hxy = new ddual[4*nx*ny], *hxv = new ddual[4*nx*ny]; + ddual *huy = new ddual[4*nx*ny], *huv = new ddual[4*nx*ny]; + ddual *hx = new ddual[2*nx], *hv = new ddual[2*ny]; + ddual *hy = new ddual[2*ny], *hu = new ddual[2*nx]; double *dmp = new double[4*nx*ny]; - memset(a,0,4*nx*ny*sizeof(dual)); + memset(a,0,4*nx*ny*sizeof(ddual)); memset(dmp,0,4*nx*ny*sizeof(double)); #pragma omp parallel for collapse(2) for(long j=0;jv(i,j), ini_im->v(i,j)); + a[i0] = ddual(ini_re->v(i,j), ini_im->v(i,j)); res->a[nz*(i+nx*j)] = a[i0]; } #pragma omp parallel for collapse(2) @@ -357,8 +356,8 @@ HADT MGL_EXPORT mgl_pde_solve_c(HMGL gr, const char *ham, HCDT ini_re, HCDT ini_ { if(gr->NeedStop()) break; tmp.zz = Min.z+dz*k; - memset(hxy,0,4*nx*ny*sizeof(dual)); memset(hxv,0,4*nx*ny*sizeof(dual)); - memset(huv,0,4*nx*ny*sizeof(dual)); memset(huy,0,4*nx*ny*sizeof(dual)); + memset(hxy,0,4*nx*ny*sizeof(ddual)); memset(hxv,0,4*nx*ny*sizeof(ddual)); + memset(huv,0,4*nx*ny*sizeof(ddual)); memset(huy,0,4*nx*ny*sizeof(ddual)); mgl_pde_hprep(&tmp); for(long i=0;i<2*nx;i++) { hx[i] = hxv[i]; hu[i] = huv[i]; } for(long j=0;j<2*ny;j++) { hy[j] = huy[2*nx*j]; hv[j] = huv[2*nx*j];} @@ -446,15 +445,190 @@ uintptr_t MGL_EXPORT mgl_pde_solve_(uintptr_t* gr, const char *ham, uintptr_t* i // ODE series // //----------------------------------------------------------------------------- +void MGL_NO_EXPORT mgl_set_func(const mreal *x, mreal *dx, void *par) +{ + mglEqTxT *p=(mglEqTxT *)par; + long n = p->n/p->m; + for(long i=0;im;i++) + { + HMDT d = static_cast(p->head[i]); + memcpy(d->a, x+i*n, n*sizeof(mreal)); + } + p->t->a[0] = x[p->n]; +//#pragma omp parallel for collapse(2) + for(long j=0;jm;j++) + { + HMDT d = mglFormulaCalc(p->str[j].c_str(),p->head); + mreal val = d->a[0]; + if(d->nxCreate(n); + for(long i=0;ia[i] = val; + } + else switch(p->brd) + { + default: // zero instead of NAN + case 0: + case 'z': + case '0': + for(long i=0;ia[i])) d->a[i] = 0; + break; + case 1: // constant at border + case 'c': + case '1': + d->a[0] = d->a[1]; d->a[n-1] = d->a[n-2]; break; + case 2: // linear at border + case 'l': + case '2': + d->a[0] = mreal(2)*d->a[1]-d->a[2]; + d->a[n-1] = mreal(2)*d->a[n-2]-d->a[n-3]; break; + case 3: // square at border + case 's': + case '3': + d->a[0] = d->a[3]+mreal(3)*(d->a[1]-d->a[2]); + d->a[n-1] = d->a[n-4]+mreal(3)*(d->a[n-2]-d->a[n-3]); break; + } + memcpy(dx+j*n, d->a, n*sizeof(mreal)); + delete d; + } +} +HMDT MGL_EXPORT mgl_ode_solve_set(const char *func, const char *var, char brd, HCDT x0, mreal dt, mreal tmax) +{ + if(!var || !(*var) || !func || !x0) return 0; + mglEqTxT par; + par.var=var; par.brd=brd; par.FillStr(func); + const long n = par.n = x0->GetNx(); + const long m = par.m = long(strlen(var)), nn = n/m; // number of variables + + HMDT dat = new mglData[m+3]; + for(long i=0;iCreate(nn); + d->s = var[i]; par.head.push_back(d); + } + HMDT d = dat+m+1; d->Create(nn); + for(long i=0;ia[i] = i; + d->s = 'j'; par.head.push_back(d); + (dat+m+2)->Create(nn); (dat+m+2)->s = "#$mgl"; + par.head.push_back(dat+m+2); + par.t = dat+m; par.t->s = 't'; par.head.push_back(par.t); + + mreal *xx = new mreal[n]; + for(long i=0;ivthr(i); + HMDT res = mgl_ode_solve_ex(mgl_set_func,n,xx,dt,tmax,&par,NULL); + delete []xx; delete []dat; return res; +} +//----------------------------------------------------------------------------- +void MGL_NO_EXPORT mgl_set_funcC(const mreal *x, mreal *dx, void *par) +{ + mglEqTxT *p=(mglEqTxT *)par; + long n = p->n/p->m; + for(long i=0;im;i++) + { + HADT d = static_cast(p->head[i]); + memcpy(d->a, x+2*i*n, 2*n*sizeof(mreal)); + } + p->t->a[0] = x[2*p->n]; +//#pragma omp parallel for collapse(2) + for(long j=0;jm;j++) + { + HADT d = mglFormulaCalcC(p->str[j].c_str(),p->head); + dual val = d->a[0]; + if(d->nxCreate(n); + for(long i=0;ia[i] = val; + } + else switch(p->brd) + { + default: + case 0: // zero instead of NAN + case 'z': + case '0': + for(long i=0;ia[i])) d->a[i] = 0; + break; + case 1: // constant at border + case 'c': + case '1': + d->a[0] = d->a[1]; d->a[n-1] = d->a[n-2]; break; + case 2: // linear at border + case 'l': + case '2': + d->a[0] = mreal(2)*d->a[1]-d->a[2]; + d->a[n-1] = mreal(2)*d->a[n-2]-d->a[n-3]; break; + case 3: // square at border + case 's': + case '3': + d->a[0] = d->a[3]+mreal(3)*(d->a[1]-d->a[2]); + d->a[n-1] = d->a[n-4]+mreal(3)*(d->a[n-2]-d->a[n-3]); break; + case -1: // exponent at border + case 4: + case 'e': + case '4': + d->a[0] = norm(d->a[2])a[1]) ? d->a[1] : d->a[1]*d->a[1]/d->a[2]; + d->a[n-1] = norm(d->a[n-3])a[n-2]) ? d->a[n-2] : d->a[n-2]*d->a[n-2]/d->a[n-3]; + break; + case -2: // gaussian at border + case 5: + case 'g': + case '5': + d->a[0] = norm(d->a[2])a[1]) ? d->a[3] : pow(d->a[1]/d->a[2],3)*d->a[3]; + d->a[n-1] = norm(d->a[n-3])a[n-2]) ? d->a[n-4] : pow(d->a[n-2]/d->a[n-3],3)*d->a[n-4]; + break; + } + memcpy(dx+2*j*n, d->a, 2*n*sizeof(mreal)); + delete d; + } +} +HADT MGL_EXPORT mgl_ode_solve_set_c(const char *func, const char *var, char brd, HCDT x0, mreal dt, mreal tmax) +{ + if(!var || !(*var) || !func || !x0) return 0; + mglEqTxT par; + par.var=var; par.brd=brd; par.FillStr(func); + const long n = par.n = x0->GetNx(); + const long m = par.m = long(strlen(var)), nn = n/m; // number of variables + + HADT dat = new mglDataC[m]; + for(long i=0;iCreate(nn); + d->s = var[i]; par.head.push_back(d); + } + HMDT d = new mglData[3]; + d->Create(nn); d->s = 'j'; + for(long i=0;ia[i] = i; + par.head.push_back(d); + (d+1)->Create(nn); (d+1)->s = "#$mgl"; + par.head.push_back(d+1); + par.t = d+2; par.t->s = 't'; + par.head.push_back(par.t); + + mreal *xx = new mreal[2*n]; + const mglDataC *c = dynamic_cast(x0); + if(c) for(long i=0;ia[i]); xx[2*i+1]=imag(c->a[i]); } + else if(x0) for(long i=0;ivthr(i); xx[2*i+1]=0; } + else for(long i=0;iny; + mglDataC *out = new mglDataC(n, nt); +#pragma omp parallel for + for(long i=0;ia[i] = dual(res->a[2*i],res->a[2*i+1]); + delete res; return out; +} +//----------------------------------------------------------------------------- void MGL_NO_EXPORT mgl_txt_func(const mreal *x, mreal *dx, void *par) { mglEqTxT *p=(mglEqTxT *)par; mreal vars[MGL_VS]; - size_t n = p->str.size(); - for(size_t i=0;in; + for(long i=0;ivar[i]; if(ch>='a' && ch<='z') vars[ch-'a']=x[i]; } -#pragma omp parallel for - for(long i=0;ieqR[i], vars); } HMDT MGL_EXPORT mgl_ode_solve_str(const char *func, const char *var, HCDT x0, mreal dt, mreal tmax) @@ -462,9 +636,9 @@ HMDT MGL_EXPORT mgl_ode_solve_str(const char *func, const char *var, HCDT x0, mr if(!var || !(*var) || !func) return 0; mglEqTxT par; par.var=var; par.FillReal(func); - size_t n = par.str.size(); + long n = par.n = long(par.str.size()); mreal *xx = new mreal[n]; - for(size_t i=0;ivthr(i):0; + for(long i=0;ivthr(i):0; HMDT res = mgl_ode_solve_ex(mgl_txt_func,n,xx,dt,tmax,&par,NULL); delete []xx; return res; } @@ -473,11 +647,11 @@ void MGL_NO_EXPORT mgl_txt_funcC(const mreal *x, mreal *dx, void *par) { mglEqTxT *p=(mglEqTxT *)par; mdual vars[MGL_VS]; - size_t n = p->str.size(); - for(size_t i=0;in; + for(long i=0;ivar[i]; if(ch>='a' && ch<='z') vars[ch-'a']=dual(x[2*i],x[2*i+1]); } -#pragma omp parallel for - for(long i=0;ieqC[i], vars); dx[2*i] = real(r); dx[2*i+1] = imag(r); @@ -488,20 +662,20 @@ HADT MGL_EXPORT mgl_ode_solve_str_c(const char *func, const char *var, HCDT x0, if(!var || !(*var) || !func) return 0; mglEqTxT par; par.var=var; par.var=var; par.FillCmplx(func); - size_t n = par.str.size(); + long n = par.n = long(par.str.size()); mreal *xx = new mreal[2*n]; const mglDataC *c = dynamic_cast(x0); - for(size_t i=0;ia[i]); xx[2*i+1]=imag(c->a[i]); } else { xx[2*i] = x0?x0->vthr(i):0; xx[2*i+1]=0; } } HMDT res = mgl_ode_solve_ex(mgl_txt_funcC,2*n,xx,dt,tmax,&par,NULL); delete []xx; - const long nn=n, nt=res->ny; - mglDataC *out = new mglDataC(nn, nt); + const long nt=res->ny; + mglDataC *out = new mglDataC(n, nt); #pragma omp parallel for - for(long i=0;ia[i] = dual(res->a[2*i],res->a[2*i+1]); + for(long i=0;ia[i] = dual(res->a[2*i],res->a[2*i+1]); delete res; return out; } //----------------------------------------------------------------------------- @@ -509,24 +683,60 @@ HMDT MGL_EXPORT mgl_ode_solve(void (*func)(const mreal *x, mreal *dx, void *par) { return mgl_ode_solve_ex(func,n,x0,dt,tmax,par,0); } HMDT MGL_EXPORT mgl_ode_solve_ex(void (*func)(const mreal *x, mreal *dx, void *par), int n, const mreal *x0, mreal dt, mreal tmax, void *par, void (*bord)(mreal *x, const mreal *xp, void *par)) { + bool scale=false; + if(dt*tmax<0) { scale = true; dt = fabs(dt); tmax = fabs(tmax); } if(tmaxa[i] = x0[i]; // Runge Kutta scheme of 4th order bool good=true; long k; + x[n] = 0; for(k=1;km0) m0 = kk; } + for(long i=0;im1) m1 = kk; } + for(long i=0;im2) m2 = kk; } + for(long i=0;im3) m3 = kk; } + for(long i=0;ia+n*(k-1),par); for(long i=0;ipt + ra->d1*x1)/hh - ra->pt; dual tmp = f->ham(abs(f->a[i]), r[0]+ra->x1*x1, r[1]+ra->y1*x1, r[3]+ra->x0*tt, r[4]+ra->y0*tt, f->par); - f->hx[i] = tmp - f->h0/2.; + f->hx[i] = tmp - f->h0/mreal(2); // u-y terms x1 = f->dk/2*(iham(0, r[0], r[1], r[3]+ra->x1*x1, r[4]+ra->y1*x1, f->par); - f->hu[i] = tmp - f->h0/2.; + f->hu[i] = tmp - f->h0/mreal(2); if(imag(f->hx[i])>0) f->hx[i] = f->hx[i].real(); if(imag(f->hu[i])>0) f->hu[i] = f->hu[i].real(); @@ -702,7 +912,7 @@ HADT MGL_EXPORT mgl_qo2d_func_c(mdual (*ham)(mreal u, mreal x, mreal y, mreal px for(long k=0;ka[i+k*nx]=a[i+nx/2]*sqrt(ra[0].ch/ra[k].ch); + res->a[i+k*nx]=a[i+nx/2]*mreal(sqrt(ra[0].ch/ra[k].ch)); if(xx && yy) for(long i=0;iid;iihxy[ii] -= (f->hx[i]+f->hy[j]-f->h0/2.)/2.; + f->hxy[ii] -= (f->hx[i]+f->hy[j]-f->h0/mreal(2))/mreal(2); if(imag(f->hxy[ii])>0) f->hxy[ii] = f->hxy[ii].real(); - f->hxv[ii] -= (f->hx[i]+f->hv[j]-f->h0/2.)/2.; + f->hxv[ii] -= (f->hx[i]+f->hv[j]-f->h0/mreal(2))/mreal(2); if(imag(f->hxv[ii])>0) f->hxv[ii] = f->hxv[ii].real(); - f->huy[ii] -= (f->hu[i]+f->hy[j]-f->h0/2.)/2.; + f->huy[ii] -= (f->hu[i]+f->hy[j]-f->h0/mreal(2))/mreal(2); if(imag(f->huy[ii])>0) f->huy[ii] = f->huy[ii].real(); - f->huv[ii] -= (f->hu[i]+f->hv[j]-f->h0/2.)/2.; + f->huv[ii] -= (f->hu[i]+f->hv[j]-f->h0/mreal(2))/mreal(2); if(imag(f->huv[ii])>0) f->huv[ii] = f->huv[ii].real(); // add boundary conditions for x-direction f->hxy[ii] -= dual(0,f->dmp[ii]); @@ -895,7 +1105,7 @@ HADT MGL_EXPORT mgl_qo3d_func_c(mdual (*ham)(mreal u, mreal x, mreal y, mreal z, { #pragma omp parallel for collapse(2) for(long i=0;ia[i+nx*(j+k*nx)]=a[i+nx/2+2*nx*(j+nx/2)]*sqrt(ra[0].ch/ra[k].ch); + res->a[i+nx*(j+k*nx)]=a[i+nx/2+2*nx*(j+nx/2)]*mreal(sqrt(ra[0].ch/ra[k].ch)); if(xx && yy && zz) #pragma omp parallel for collapse(2) for(long i=0;ia[i+i0] = uu[i]; } + delete []tt; } else if(mglchr(how,'y') && (na==nn || na==np || na==ny)) #pragma omp parallel { - mglData T(ny,4); mreal *uu=T.a+(per?3:2)*ny; + mreal *tt = new mreal[4*ny], *uu=tt+(per?3:2)*ny; +// / mglData T(ny,4); mreal *uu=T.a+(per?3:2)*ny; #pragma omp for collapse(2) for(long k=0;ka[j*nx+i0] = uu[j]; } + delete []tt; } else if(mglchr(how,'z') && (na==nn || na==nz)) #pragma omp parallel { - mglData T(nz,4); mreal *uu=T.a+(per?3:2)*nz; + mreal *tt = new mreal[4*nz], *uu=tt+(per?3:2)*nz; +// mglData T(nz,4); mreal *uu=T.a+(per?3:2)*nz; #pragma omp for collapse(2) for(long j=0;ja[k*np+i0] = uu[k]; } + delete []tt; } else if(mglchr(how,'h') && ny==nx && (na==nn || na==np) && nx>1) #pragma omp parallel { - mglData T(np,2); + mreal *tt = new mreal[2*np]; +// mglData T(np,2); #pragma omp for for(long k=0;ka+k*np, T.a+np, np*sizeof(mreal)); + mgl_progonka_hr(A,B,C,D,tt,nx,k*np,na==nn ? k*np:0,difr); + memcpy(r->a+k*np, tt+np, np*sizeof(mreal)); } + delete []tt; } else { delete r; r=0; } return r; @@ -1381,55 +1599,63 @@ HADT MGL_EXPORT mgl_datac_tridmat(HCDT A, HCDT B, HCDT C, HCDT D, const char *ho if(mglchr(how,'x') && (na==nn || na==np || na==nx)) #pragma omp parallel { - mglDataC T(nx,4); dual *uu=T.a+(per?3:2)*nx; + dual *tt = new dual[4*nx], *uu=tt+(per?3:2)*nx; +// mglDataC T(nx,4); dual *uu=T.a+(per?3:2)*nx; #pragma omp for collapse(2) for(long k=0;ka[i+i1] = uu[i]; } + delete []tt; } else if(mglchr(how,'y') && (na==nn || na==np || na==ny)) #pragma omp parallel { - mglDataC T(ny,4); dual *uu=T.a+(per?3:2)*ny; + dual *tt = new dual[4*ny], *uu=tt+(per?3:2)*ny; +// mglDataC T(ny,4); dual *uu=T.a+(per?3:2)*ny; #pragma omp for collapse(2) for(long k=0;ka[j*nx+i0] = uu[j]; } + delete []tt; } else if(mglchr(how,'z') && (na==nn || na==nz)) #pragma omp parallel { - mglDataC T(nz,4); dual *uu=T.a+(per?3:2)*nz; + dual *tt = new dual[4*nz], *uu=tt+(per?3:2)*ny; +// mglDataC T(nz,4); dual *uu=T.a+(per?3:2)*nz; #pragma omp for collapse(2) for(long j=0;ja[k*np+i1] = uu[k]; } + delete []tt; } else if(mglchr(how,'h') && ny==nx && (na==nn || na==np) && nx>1) #pragma omp parallel { - mglDataC T(np,2); + dual *tt = new dual[2*np]; +// mglDataC T(np,2); #pragma omp for for(long k=0;ka+k*np, T.a+np, np*sizeof(dual)); + mgl_progonka_hc(A,B,C,D,tt,nx,k*np, na==nn ? k*np:0,difr); + memcpy(r->a+k*np, tt+np, np*sizeof(dual)); } + delete []tt; } else { delete r; r=0; } return r; diff --git a/src/pixel.cpp b/src/pixel.cpp index c17aea3..f05417d 100644 --- a/src/pixel.cpp +++ b/src/pixel.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -55,7 +55,7 @@ void mglCanvas::pxl_backgr(long id, long n, const void *) #pragma omp parallel for #endif for(long i=id;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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -79,7 +79,7 @@ void mglCanvas::SetSize(int w,int h,bool clf) #pragma omp parallel for for(long i=0;iWidth) x2=Width; + if(y2>Height) y2=Height; if(BBoxX1>=0 && BBoxX1=0 && BBoxY10) +#pragma omp parallel for + for(long i=0;ih-1) { pj--; tj=1; } else tj -= pj; + for(int i=0;iWidth) x2=Width; + if(y2>Height) y2=Height; if(BBoxX1>=0 && BBoxX1=0 && BBoxY1 * * * * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/src/plot.cpp b/src/plot.cpp index ec445d2..3199c50 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -212,7 +212,7 @@ void MGL_EXPORT mgl_candle_xyv(HMGL gr, HCDT x, HCDT v1, HCDT v2, HCDT y1, HCDT { if(d1) delete y1; if(d2) delete y2; gr->SetWarn(mglWarnDim,"Candle"); return; } static int cgid=1; gr->StartGroup("Candle",cgid++); - gr->SaveState(opt); gr->SetPenPal(pen,&pal); + gr->SaveState(opt); gr->SetPenPal(pen,&pal); gr->SetMask(pen); long kq = gr->AllocPnts(8*n); bool sh = mglchr(pen,'!'); bool wire = mglchr(pen,'#'); @@ -505,7 +505,8 @@ void MGL_EXPORT mgl_area_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *pen, c bool sh = mglchr(pen,'!'), wire = mglchr(pen,'#'), orig = !mglchr(pen,'a'); double z0=gr->GetOrgZ('x'); - gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); + gr->SetPenPal(pen,&pal); gr->SetMask(pen); gr->Reserve(2*n*m); + for(long j=0;jNeedStop()) break; @@ -556,7 +557,7 @@ void MGL_EXPORT mgl_area_xy(HMGL gr, HCDT x, HCDT y, const char *pen, const char mglPoint nn(0,0,1); bool sh = mglchr(pen,'!'), wire = mglchr(pen,'#'), orig = !mglchr(pen,'a'); - gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); + gr->SetPenPal(pen,&pal); gr->SetMask(pen); gr->Reserve(2*n*m); for(long j=0;jNeedStop()) break; @@ -697,7 +698,7 @@ void MGL_EXPORT mgl_region_3d(HMGL gr, HCDT x1, HCDT y1, HCDT z1, HCDT x2, HCDT // bool inside = (mglchr(pen,'i')); // NOTE: check if 'i' is free (used here for inside flag) bool sh = mglchr(pen,'!'), wire = mglchr(pen,'#'), orig = !mglchr(pen,'a'); - gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); + gr->SetPenPal(pen,&pal); gr->SetMask(pen); gr->Reserve(2*n*m); for(long j=0;jNeedStop()) break; @@ -761,7 +762,7 @@ void MGL_EXPORT mgl_region_xy(HMGL gr, HCDT x, HCDT y1, HCDT y2, const char *pen bool inside = mglchr(pen,'i'); // NOTE: check if 'i' is free (used here for inside flag) bool sh = mglchr(pen,'!'), wire = mglchr(pen,'#'), orig = !mglchr(pen,'a'); - gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); + gr->SetPenPal(pen,&pal); gr->SetMask(pen); gr->Reserve(2*n*m); for(long j=0;jNeedStop()) break; @@ -969,6 +970,92 @@ void MGL_EXPORT mgl_step_(uintptr_t *gr, uintptr_t *y, const char *pen, const ch // Stem series // //----------------------------------------------------------------------------- +void MGL_EXPORT mgl_lines_xyz(HMGL gr, HCDT x1, HCDT y1, HCDT z1, HCDT x2, HCDT y2, HCDT z2, const char *pen, const char *opt) +{ + long m,n=y1->GetNx(), pal; + if(mgl_check_dim1(gr,x1,y1,z1,x2,"Lines")) return; + if(mgl_check_dim1(gr,x2,y2,z2,NULL,"Lines")) return; + if(x1->GetNy()!=x2->GetNy() || y1->GetNy()!=y2->GetNy() || z1->GetNy()!=z2->GetNy()) return; + + gr->SaveState(opt); + static int cgid=1; gr->StartGroup("Lines",cgid++); + m = x1->GetNy() > y1->GetNy() ? x1->GetNy() : y1->GetNy(); m = z1->GetNy() > m ? z1->GetNy() : m; + bool sh = mglchr(pen,'!'); + + gr->SetPenPal(pen,&pal); gr->Reserve(2*n*m); + for(long j=0;jNeedStop()) break; + long mx = jGetNy() ? j:0, my = jGetNy() ? j:0, mz = jGetNy() ? j:0; + double c1=gr->NextColor(pal), c2=c1; + if(gr->GetNumPal(pal)==2*m && !sh) c2=gr->NextColor(pal); + long kq = gr->AllocPnts(2*n); +#pragma omp parallel for + for(long i=0;iNextColor(pal,i); + gr->AddPntQ(kq+2*i,mglPoint(x1->v(i,mx), y1->v(i,my), z1->v(i,mz)),sh?cc:c1); + gr->AddPntQ(kq+2*i+1,mglPoint(x2->v(i,mx), y2->v(i,my), z2->v(i,mz)),sh?cc:c2); + } + for(long i=0;iline_plot(iq,iq+1); + gr->arrow_plot(iq,iq+1,gr->Arrow2); + gr->arrow_plot(iq+1,iq,gr->Arrow1); + } + } + gr->EndGroup(); +} +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_lines_xy(HMGL gr, HCDT x1, HCDT y1, HCDT x2, HCDT y2, const char *pen, const char *opt) +{ + gr->SaveState(opt); + mglDataV z(y1->GetNx()); z.Fill(gr->Min.z,gr->Min.z); + mgl_lines_xyz(gr,x1,y1,&z,x2,y2,&z,pen,0); +} +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_lines_x(HMGL gr, HCDT x1, HCDT x2, const char *pen, const char *opt) +{ + gr->SaveState(opt); + mglDataV y(x1->GetNx()), z(x1->GetNx()); + y.Fill(gr->Min.y,gr->Max.y); + z.Fill(gr->Min.z,gr->Min.z); + mgl_lines_xyz(gr,x1,&y,&z,x2,&y,&z,pen,0); +} +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_lines(HMGL gr, HCDT y1, HCDT y2, const char *pen, const char *opt) +{ + gr->SaveState(opt); + mglDataV x(y1->GetNx()), z(y1->GetNx()); + x.Fill(gr->Min.x,gr->Max.x); + z.Fill(gr->Min.z,gr->Min.z); + mgl_lines_xyz(gr,&x,y1,&z,&x,y2,&z,pen,0); +} +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_lines_xyz_(uintptr_t *gr, uintptr_t *x1, uintptr_t *y1, uintptr_t *z1, uintptr_t *x2, uintptr_t *y2, uintptr_t *z2, 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_lines_xyz(_GR_,_DA_(x1),_DA_(y1),_DA_(z1),_DA_(x2),_DA_(y2),_DA_(z2),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_lines_xy_(uintptr_t *gr, uintptr_t *x1, uintptr_t *y1, uintptr_t *x2, 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_lines_xy(_GR_,_DA_(x1),_DA_(y1),_DA_(x2),_DA_(y2),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_lines_x_(uintptr_t *gr, uintptr_t *x1, uintptr_t *x2, 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_lines_x(_GR_,_DA_(x1),_DA_(x2),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_lines_(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_lines(_GR_,_DA_(y1),_DA_(y2),s,o); delete []o; delete []s; } +//----------------------------------------------------------------------------- +// +// Stem series +// +//----------------------------------------------------------------------------- void MGL_EXPORT mgl_stem_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *pen, const char *opt) { long m,n=y->GetNx(), pal; @@ -1096,8 +1183,7 @@ void MGL_EXPORT mgl_bars_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *pen, c } if(dc==0) fixed=false; // NOTE: disable fixed width if it is zero - gr->SetPenPal(pen,&pal); - gr->Reserve(4*n*m); + gr->SetPenPal(pen,&pal); gr->SetMask(pen); gr->Reserve(4*n*m); for(long j=0;jNeedStop()) break; @@ -1181,8 +1267,7 @@ void MGL_EXPORT mgl_bars_xy(HMGL gr, HCDT x, HCDT y, const char *pen, const char } if(dx==0) fixed=false; // NOTE: disable fixed width if it is zero - gr->SetPenPal(pen,&pal); - gr->Reserve(4*n*m); + gr->SetPenPal(pen,&pal); gr->SetMask(pen); gr->Reserve(4*n*m); for(long j=0;jNeedStop()) break; @@ -1287,8 +1372,7 @@ void MGL_EXPORT mgl_barh_yx(HMGL gr, HCDT y, HCDT v, const char *pen, const char } if(dy==0) fixed=false; // NOTE: disable fixed width if it is zero - gr->SetPenPal(pen,&pal); - gr->Reserve(4*n*m); + gr->SetPenPal(pen,&pal); gr->SetMask(pen); gr->Reserve(4*n*m); for(long j=0;jNeedStop()) break; @@ -1765,7 +1849,7 @@ void MGL_EXPORT mgl_error_exy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintpt // Chart series // //----------------------------------------------------------------------------- -void face_plot(mglBase *gr, mglPoint o, mglPoint d1, mglPoint d2, double c, bool wire) +void face_plot(mglBase *gr, const mglPoint &o, mglPoint d1, mglPoint d2, double c, bool wire) { const int num=10; mglPoint nn=d1^d2; @@ -1818,6 +1902,7 @@ void MGL_EXPORT mgl_chart(HMGL gr, HCDT a, const char *cols, const char *opt) double dy = (gr->Max.y-gr->Min.y)/a->GetNy(), dx, ss, cs, x1, y1, dz=gr->Max.z-gr->Min.z, vv; mglPoint d1,d2,o; + gr->SetMask(cols); for(j=0;jGetNy();j++) { @@ -2064,7 +2149,7 @@ void MGL_EXPORT mgl_tape_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *pen, c double rr = gr->SaveState(opt); if(rr==0 || mgl_isnan(rr)) rr = mgl_norm(gr->Max-gr->Min)*gr->BarWidth/25; m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy(); m = z->GetNy() > m ? z->GetNy() : m; - gr->SetPenPal(pen,&pal); gr->Reserve(4*n*m); + gr->SetPenPal(pen,&pal); gr->SetMask(pen); gr->Reserve(4*n*m); mglPoint qn(NAN,NAN); bool sh = mglchr(pen,'!'), xo = mglchr(pen,'x'), zo = mglchr(pen,'z'), wire = mglchr(pen,'#'); if(!xo && !zo) xo = zo = true; diff --git a/src/prc.cpp b/src/prc.cpp index 49f742c..1525580 100644 --- a/src/prc.cpp +++ b/src/prc.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -313,7 +313,7 @@ void MGL_EXPORT mgl_write_prc(HMGL gr, const char *fname,const char* /*descr*/, PNG_FILTER_TYPE_DEFAULT); png_set_rows(png_ptr, info_ptr, pbuf); png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, 0); - png_write_end(png_ptr, info_ptr); +// png_write_end(png_ptr, info_ptr); png_destroy_write_struct(&png_ptr, &info_ptr); delete []pbuf; delete []buf; diff --git a/src/prc/PRCbitStream.cc b/src/prc/PRCbitStream.cc index 2781508..14dc208 100644 --- a/src/prc/PRCbitStream.cc +++ b/src/prc/PRCbitStream.cc @@ -4,16 +4,16 @@ * Copyright (C) 2008 Orest Shardt * * This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by +* it under the terms of the GNU Lesser 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 Lesser General Public License for more details. +* GNU Lesser General Public License for more details. * -* You should have received a copy of the GNU Lesser General Public License +* You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * *************/ @@ -59,7 +59,7 @@ void PRCbitStream::compress() ++chunks; // strm.avail_out should be 0 if we got Z_OK compressedDataSize = sizeAvailable - strm.avail_out; - compressedData = (uint8_t*) realloc(compressedData,CHUNK*chunks); + compressedData = (uint8_t*)realloc(compressedData,CHUNK*chunks); strm.next_out = (Bytef*)(compressedData + compressedDataSize); strm.avail_out += CHUNK; sizeAvailable += CHUNK; diff --git a/src/prc/PRCbitStream.h b/src/prc/PRCbitStream.h index f240baf..58a4f68 100644 --- a/src/prc/PRCbitStream.h +++ b/src/prc/PRCbitStream.h @@ -4,16 +4,16 @@ * Copyright (C) 2008 Orest Shardt * * This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by +* it under the terms of the GNU Lesser 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 Lesser General Public License for more details. +* GNU Lesser General Public License for more details. * -* You should have received a copy of the GNU Lesser General Public License +* You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * *************/ diff --git a/src/prc/oPRCFile.cc b/src/prc/oPRCFile.cc index d9f7589..70a0d20 100644 --- a/src/prc/oPRCFile.cc +++ b/src/prc/oPRCFile.cc @@ -5,16 +5,16 @@ * with enhancements contributed by Michail Vidiassov. * * This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by +* it under the terms of the GNU Lesser 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 Lesser General Public License for more details. +* GNU Lesser General Public License for more details. * -* You should have received a copy of the GNU Lesser General Public License +* You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * *************/ diff --git a/src/prc/oPRCFile.h b/src/prc/oPRCFile.h index 33f97db..053143f 100644 --- a/src/prc/oPRCFile.h +++ b/src/prc/oPRCFile.h @@ -4,16 +4,16 @@ * Copyright (C) 2008 Orest Shardt * * This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by +* it under the terms of the GNU Lesser 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 Lesser General Public License for more details. +* GNU Lesser General Public License for more details. * -* You should have received a copy of the GNU Lesser General Public License +* You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * *************/ diff --git a/src/prc/writePRC.cc b/src/prc/writePRC.cc index 098b4b7..a4c2719 100644 --- a/src/prc/writePRC.cc +++ b/src/prc/writePRC.cc @@ -5,16 +5,16 @@ * with enhancements contributed by Michail Vidiassov. * * This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by +* it under the terms of the GNU Lesser 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 Lesser General Public License for more details. +* GNU Lesser General Public License for more details. * -* You should have received a copy of the GNU Lesser General Public License +* You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * *************/ diff --git a/src/prc/writePRC.h b/src/prc/writePRC.h index f09b55e..d0b4e0e 100644 --- a/src/prc/writePRC.h +++ b/src/prc/writePRC.h @@ -4,16 +4,16 @@ * Copyright (C) 2008 Orest Shardt * * This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License as published by +* it under the terms of the GNU Lesser 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 Lesser General Public License for more details. +* GNU Lesser General Public License for more details. * -* You should have received a copy of the GNU Lesser General Public License +* You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * *************/ diff --git a/src/prim.cpp b/src/prim.cpp index a812afe..2e963ad 100644 --- a/src/prim.cpp +++ b/src/prim.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -139,7 +139,7 @@ void MGL_EXPORT mgl_face(HMGL gr, double x0, double y0, double z0, double x1, do { static int cgid=1; gr->StartGroup("Face",cgid++); long pal; - gr->SetPenPal(stl,&pal); + gr->SetPenPal(stl,&pal); gr->SetMask(stl); // mreal c1,c2,c3,c4,zz=(gr->Min.z+gr->Max.z)/2; mreal c1,c2,c3,c4,zz=2*gr->Max.z-gr->Min.z; c1=c2=c3=c4=gr->CDef; @@ -383,7 +383,7 @@ void MGL_EXPORT mgl_polygon(HMGL gr, double x1, double y1, double z1, double x2, if(n<3) return; long pal=0, n0; static int cgid=1; gr->StartGroup("Polygon",cgid++); - gr->SetPenPal(stl,&pal); + gr->SetPenPal(stl,&pal); gr->SetMask(stl); mreal c=gr->NextColor(pal); mreal k=(gr->GetNumPal(pal)>1)?gr->NextColor(pal):gr->AddTexture('k'); bool fill = !mglchr(stl,'#'), box = mglchr(stl,'@') || !fill; @@ -465,7 +465,7 @@ void MGL_EXPORT mgl_ellipse(HMGL gr, double x1, double y1, double z1, double x2, const int n = 41; long pal=0,n0; static int cgid=1; gr->StartGroup("Ellipse",cgid++); - gr->SetPenPal(stl,&pal); + gr->SetPenPal(stl,&pal); gr->SetMask(stl); mreal c=gr->NextColor(pal), d; mreal k=(gr->GetNumPal(pal)>1)?gr->NextColor(pal):gr->AddTexture('k'); bool fill = !mglchr(stl,'#'), box = mglchr(stl,'@') || !fill; @@ -513,7 +513,7 @@ void MGL_EXPORT mgl_rhomb(HMGL gr, double x1, double y1, double z1, double x2, d { long pal=0; static int cgid=1; gr->StartGroup("Rhomb",cgid++); - gr->SetPenPal(stl,&pal); + gr->SetPenPal(stl,&pal); gr->SetMask(stl); mreal c=gr->NextColor(pal); mreal k=(gr->GetNumPal(pal)>1)?gr->NextColor(pal):gr->AddTexture('k'); mreal b=(gr->GetNumPal(pal)>2)?gr->NextColor(pal):c; diff --git a/src/random.cpp b/src/random.cpp new file mode 100644 index 0000000..4cb7be1 --- /dev/null +++ b/src/random.cpp @@ -0,0 +1,358 @@ +/*************************************************************************** + * random.cpp is part of Math Graphic Library * + * Copyright (C) 2020-??? Diego Sejas Viscarra , * + * Alexey Balakin * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Lesser 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 Lesser 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 +//----------------------------------------------------------------------------- +// +// Basic random functions +// The following code is partially based on the book +// "Introduction to Programming in Python. An Interdisciplinary Approach," +// by Robert Sedgewick, Kevin Wayne, and Robert Dondero. +// A copy of the book can be obtained at https://introcs.cs.princeton.edu/python/home/ +// +//----------------------------------------------------------------------------- +mreal MGL_EXPORT mgl_rnd_integer(long lo, long hi) +{ return round((hi - lo)*mgl_rnd() + lo); } +double MGL_EXPORT mgl_rnd_integer_(int *lo, int *hi) +{ return mgl_rnd_integer(*lo, *hi); } +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_data_rnd_integer(HMDT d, long lo, long hi) +{ + const long n = d->GetNN(), da=hi-lo; + for (long i=0; ia[i] = round(da*mgl_rnd() + lo); +} +void MGL_EXPORT mgl_data_rnd_integer_(uintptr_t *d, int *lo, int *hi) +{ mgl_data_rnd_integer(_DT_,*lo,*hi); } +//----------------------------------------------------------------------------- +mreal MGL_EXPORT mgl_rnd_uniform(mreal lo, mreal hi) +{ return (hi - lo) * mgl_rnd() + lo; } +double MGL_EXPORT mgl_rnd_uniform_(double *lo, double *hi) +{ return mgl_rnd_uniform(*lo,*hi); } +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_data_rnd_uniform(HMDT d, mreal lo, mreal hi) +{ + const long n = d->GetNN(); + const mreal da = hi-lo; + for (long i=0; ia[i] = da*mgl_rnd() + lo; +} +void MGL_EXPORT mgl_data_rnd_uniform_(uintptr_t *d, double *lo, double *hi) +{ mgl_data_rnd_uniform(_DT_,*lo,*hi); } +//----------------------------------------------------------------------------- +mreal MGL_EXPORT mgl_rnd_bernoulli(mreal p) +{ return (mgl_rnd() < p)? 1:0; } +double MGL_EXPORT mgl_rnd_bernoulli_(double *p) +{ return mgl_rnd_bernoulli(*p); } +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_data_rnd_bernoulli(HMDT d, mreal p=0.5) +{ + const long n = d->GetNN(); + for (long i=0; ia[i] = (mgl_rnd() < p)? 1:0; +} +void MGL_EXPORT mgl_data_rnd_bernoulli_(uintptr_t *d, double *p) +{ mgl_data_rnd_bernoulli(_DT_,*p); } +//----------------------------------------------------------------------------- +long MGL_EXPORT mgl_rnd_binomial(long trials, mreal p) +{ + long heads=0; + for(long i=0; iGetNN(); + for (long i=0; ia[i] = mgl_rnd_binomial(trials, p); +} +void MGL_EXPORT mgl_data_rnd_binomial_(uintptr_t *d, double *p) +{ mgl_data_rnd_binomial(_DT_,*p); } +//----------------------------------------------------------------------------- +mreal MGL_EXPORT mgl_rnd_gaussian(mreal mu, mreal sigma) +{ + mreal x, y, r=0.0; + while (r >= 1 || r == 0) + { + x = 2.0 * mgl_rnd() - 1.0; + y = 2.0 * mgl_rnd() - 1.0; + r = x*x + y*y; + } + return mu + sigma * x * sqrt(-2.0 * log(r) / r); +} +double MGL_EXPORT mgl_rnd_gaussian_(double *mu, double *sigma) +{ return mgl_rnd_gaussian(*mu, *sigma); } +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_data_rnd_gaussian(HMDT d, mreal mu=0.0, mreal sigma=1.0) +{ + const long n = d->GetNN(); + for (long i=0; ia[i] = mgl_rnd_gaussian(mu, sigma); +} +void MGL_EXPORT mgl_data_rnd_gaussian_(uintptr_t *d, double *mu, double *s) +{ mgl_data_rnd_gaussian(_DT_,*mu,*s); } +//----------------------------------------------------------------------------- +mreal MGL_EXPORT mgl_rnd_exponential(mreal lambda) +{ return -log(1.0 - mgl_rnd()) / lambda; } +double MGL_EXPORT mgl_rnd_exponential_(double *lambda) +{ return mgl_rnd_exponential(*lambda); } +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_data_rnd_exponential(HMDT d, mreal lambda) +{ + const long n = d->GetNN(); + for (long i=0; ia[i] = -log(1.0 - mgl_rnd()) / lambda; +} +void MGL_EXPORT mgl_data_rnd_exponential_(uintptr_t *d, double *l) +{ mgl_data_rnd_exponential(_DT_,*l); } +//----------------------------------------------------------------------------- +long MGL_EXPORT mgl_rnd_discrete(HCDT A) // this assumes A to be 1d +{ + long n=A->GetNx(); + mreal amax=0.0, sum_prob=0.0; + + mreal *sum = new mreal[n]; + for(long i=0; iv(i); } + + mreal r=amax*mgl_rnd(); +// for(i=0; iv(i); +// if(sum_prob > r) break; +// } + long i1=0,i2=n-1,i=0; + while(i2>i1+1) + { + i = (i1+i2)/2; + if(sum[i]GetNN(), n=a->GetNx(); + mreal amax=0; + mreal *sum = new mreal[n]; + for(long i=0; iv(i); } +#pragma omp parallel for + for(long j=0;ji1+1) + { + i = (i1+i2)/2; + if(sum[i]a[j] = i+1; + } + delete []sum; +} +void MGL_EXPORT mgl_data_rnd_discrete_(uintptr_t *d, uintptr_t *a) +{ mgl_data_rnd_discrete(_DT_,_DM_(a)); } +//----------------------------------------------------------------------------- +void MGL_EXPORT mgl_shuffle(HMDT d, char dir) +{ + if(dir=='x') + { + long n = d->GetNx(), m = d->ny*d->nz; + for(long i=0;ia[ii]; d->a[ii] = d->a[jj]; d->a[jj] = temp; } + } + } + if(dir=='y') + { + long n = d->GetNy(), m = d->nx, l = d->nz; + for(long i=0;ia[ii]; d->a[ii] = d->a[jj]; d->a[jj] = temp; } + } + } + if(dir=='z') + { + long n = d->GetNz(), m = d->ny*d->nx; + for(long i=0;ia[ii]; d->a[ii] = d->a[jj]; d->a[jj] = temp; } + } + } + if(dir=='a') + { + long n = d->GetNN(); + for(long i=0;ia[i]; d->a[i] = d->a[j]; d->a[j] = temp; + } + } +} +void MGL_EXPORT mgl_shuffle_(uintptr_t *d, char *dir, int) +{ mgl_shuffle(_DT_,*dir); } +//----------------------------------------------------------------------------- +void MGL_NO_EXPORT mgl_fill_brownian(HMDT d, long n1, long n2, mreal sigma, mreal alpha) +{ + if (n1+1nx, nn = d->ny*d->nz, m = (n1+n2)/2; + for(long i=0;ia[m+n*i] = (d->a[n1+n*i]+d->a[n2+n*i])/2 + delta; + } + mgl_fill_brownian(d, n1, m, sigma/alpha, alpha); // NOTE: probably stack overflow for huge d->nx + mgl_fill_brownian(d, m, n2, sigma/alpha, alpha); + } +} +void MGL_EXPORT mgl_data_brownian(HMDT d, mreal y1, mreal y2, mreal sigma, mreal alpha) +{ + long n = d->nx, nn = d->ny*d->nz; + for(long i=0;ia[n*i] = y1; d->a[n*(i+1)-1] = y2; } + mgl_fill_brownian(d, 0, n-1, sigma, alpha); +} +void MGL_EXPORT mgl_data_brownian_(uintptr_t *d, double *y1, double *y2, double *sigma, double *alpha) +{ mgl_data_brownian(_DT_,*y1,*y2,*sigma,*alpha); } +//----------------------------------------------------------------------------- +// +// MGL commands +// +//----------------------------------------------------------------------------- +int MGL_NO_EXPORT mgls_data_rnd_integer(mglGraph *, long, mglArg *a, const char *k, const char *) +{ + int res=0; + if(k[0]=='d' && a[0].d->temp) return 5; + mglData *d = dynamic_cast(a[0].d); + if (d && !strcmp(k, "dnn")) d->RndInteger(mgl_int(a[1].v), mgl_int(a[2].v)); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- +int MGL_NO_EXPORT mgls_data_rnd_uniform(mglGraph *, long, mglArg *a, const char *k, const char *) +{ + int res=0; + if(k[0]=='d' && a[0].d->temp) return 5; + mglData *d = dynamic_cast(a[0].d); + if (d && !strcmp(k, "dnn")) d->RndUniform(a[1].v,a[2].v); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- +int MGL_NO_EXPORT mgls_data_rnd_bernoulli(mglGraph *, long, mglArg *a, const char *k, const char *) +{ + int res=0; + if(k[0]=='d' && a[0].d->temp) return 5; + mglData *d = dynamic_cast(a[0].d); + if (d && !strcmp(k, "dn")) d->RndBernoulli(a[1].v); + else if (d && !strcmp(k, "d")) d->RndBernoulli(); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- +int MGL_NO_EXPORT mgls_data_rnd_binomial(mglGraph *, long, mglArg *a, const char *k, const char *) +{ + int res=0; + if(k[0]=='d' && a[0].d->temp) return 5; + mglData *d = dynamic_cast(a[0].d); + if (d && !strcmp(k, "dnn")) d->RndBinomial(mgl_int(a[1].v),a[2].v); + else if (d && !strcmp(k, "dn")) d->RndBinomial(mgl_int(a[1].v)); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- +int MGL_NO_EXPORT mgls_data_rnd_gaussian(mglGraph *, long, mglArg *a, const char *k, const char *) +{ + int res=0; + if(k[0]=='d' && a[0].d->temp) return 5; + mglData *d = dynamic_cast(a[0].d); + if (d && !strcmp(k, "dnn")) d->RndGaussian(a[1].v,a[2].v); + else if (d && !strcmp(k, "d")) d->RndGaussian(); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- +int MGL_NO_EXPORT mgls_data_rnd_exponential(mglGraph *, long, mglArg *a, const char *k, const char *) +{ + int res=0; + if(k[0]=='d' && a[0].d->temp) return 5; + mglData *d = dynamic_cast(a[0].d); + if (d && !strcmp(k, "dn")) d->RndExponential(a[1].v); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- +int MGL_NO_EXPORT mgls_data_rnd_discrete(mglGraph *, long, mglArg *a, const char *k, const char *) +{ + int res=0; + if(k[0]=='d' && a[0].d->temp) return 5; + mglData *d = dynamic_cast(a[0].d); + if (d && !strcmp(k, "dd")) mgl_data_rnd_discrete(d, a[1].d); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- +int MGL_NO_EXPORT mgls_shuffle(mglGraph *, long, mglArg *a, const char *k, const char *) +{ + int res=0; + if(k[0]=='d' && a[0].d->temp) return 5; + mglData *d = dynamic_cast(a[0].d); + if (d && !strcmp(k, "ds")) d->RndShuffle(a[1].s[0]); + else if (d && !strcmp(k, "d")) d->RndShuffle(); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- +int MGL_NO_EXPORT mgls_brownian(mglGraph *, long, mglArg *a, const char *k, const char *) +{ + int res=0; + if(k[0]=='d' && a[0].d->temp) return 5; + mglData *d = dynamic_cast(a[0].d); + if (d && !strcmp(k, "dnnnn")) d->RndBrownian(a[1].v,a[2].v,a[3].v,a[4].v); + else res = 1; + return res; +} +//----------------------------------------------------------------------------- +mglCommand mgls_rnd_cmd[] = { + {"bernoulli", _("Fills by random numbers according to Bernoulli distribution with probability p"), "bernoulli A [p]", mgls_data_rnd_bernoulli, 3}, + {"binomial", _("Fills by random numbers according to binomial distribution in n coin flips with probability p"), "binomial A n [p]", mgls_data_rnd_binomial, 3}, + {"brownian", _("Fills by fractional brownian motion"), "brownian A y1 y2 sigma h", mgls_brownian, 3}, + {"discrete", _("Fills by random numbers according to discrete distribution"), "discrete A D", mgls_data_rnd_discrete, 3}, + {"exponential", _("Fills by random numbers according to exponential distribution with probability p"), "exponential A p", mgls_data_rnd_exponential, 3}, + {"gaussian", _("Fills by random numbers according to Gaussian distribution"), "gaussian A [mu sigma]", mgls_data_rnd_gaussian, 3}, + {"shuffle", _("Shuffle data cells (for dir='a') or slices (for dir='xyz')"), "shuffle A ['dir']", mgls_shuffle, 3}, + {"uniform", _("Fills by random numbers uniformly chosen in [lo,hi)"), "uniform A lo hi", mgls_data_rnd_uniform, 3}, + {"uniformint", _("Fills by random integers uniformly chosen in [lo, hi)"), "uniformint A lo hi", mgls_data_rnd_integer, 3}, +{"","","",NULL,0}}; +//----------------------------------------------------------------------------- diff --git a/src/surf.cpp b/src/surf.cpp index 8f1567e..7c82fb5 100644 --- a/src/surf.cpp +++ b/src/surf.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -40,7 +40,7 @@ void static mgl_mesh_plot(mglBase *gr, long kq, long n, long m, int how) long s=0; for(long j=0;jValidPnt(iq) && gr->ValidPnt(iq+n)) s++; } - d = gr->FaceNum>0 ? gr->FaceNum+1 : n; s = s>d?s/d:1; + d = gr->FaceNum>0 ? gr->FaceNum+1 : m; s = s>d?s/d:1; gr->curve_plot(1+(m-1)/s,kq+i,n*s); } } @@ -66,8 +66,6 @@ void static mgl_surf_plot(mglBase *gr, long kq, long n, long m) // Plot by formulas series // //----------------------------------------------------------------------------- -HMDT MGL_NO_EXPORT mglFormulaCalc(const char *str, const std::vector &head); -//----------------------------------------------------------------------------- void MGL_EXPORT mgl_fsurf(HMGL gr, const char *eqZ, const char *sch, const char *opt) { // NOTE Strong function variation analysis can be added here if(eqZ==0 || eqZ[0]==0) return; // nothing to plot diff --git a/src/tex_table.cc b/src/tex_table.cc index 86deba2..8177b87 100644 --- a/src/tex_table.cc +++ b/src/tex_table.cc @@ -3,7 +3,7 @@ * Copyright (C) 2007-2014 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -20,7 +20,7 @@ #include "mgl2/font.h" /// Table of LaTeX symbols and its UTF8 codes. This array MUST BE sorted!!! -const size_t mgl_tex_num=1924; +const size_t mgl_tex_num=1925; const mglTeXsymb mgl_tex_symb[] = { {0x23, L"#"}, {0x25, L"%"}, @@ -1201,7 +1201,7 @@ const mglTeXsymb mgl_tex_symb[] = { {0x2a35, L"otimesrhrim"}, {0x23de, L"overbrace"}, {0x23b4, L"overbracket"}, - {0x203e, L"overline"}, +// {0x203e, L"overline"}, {0x23dc, L"overparen"}, {0x220b, L"owns"}, {0x2225, L"parallel"}, diff --git a/src/vect.cpp b/src/vect.cpp index a70a0e0..0ba89a7 100644 --- a/src/vect.cpp +++ b/src/vect.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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. * @@ -122,13 +122,13 @@ void MGL_EXPORT mgl_vect_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const cha if(tx<1) tx=1; if(ty<1) ty=1; - double xm=0,cm=0,ca=0; + double xm=0,cm=0; double dm=(fabs(gr->Max.c)+fabs(gr->Min.c))*1e-5; // use whole array for determining maximal vectors length #pragma omp parallel { double xm1=0,cm1=0,xx,c1,c2; -#pragma omp for nowait collapse(3) reduction(+:ca) +#pragma omp for nowait collapse(3) for(long k=0;kGetArrowSize(); + double xm=0,cm=0, asize = gr->GetArrowSize(); double dm=(fabs(gr->Max.c)+fabs(gr->Min.c))*1e-5; // use whole array for determining maximal vectors length #pragma omp parallel { double c1,c2,c3, xm1=0,cm1=0,xx; -#pragma omp for nowait collapse(3) reduction(+:ca) +#pragma omp for nowait collapse(3) for(long k=0;kMeshNum>1) { tx=(n-1)/(gr->MeshNum-1); ty=(m-1)/(gr->MeshNum-1); } if(tx<1) tx=1; if(ty<1) ty=1; - double xm=0,cm=0,ca=0, asize = gr->GetArrowSize(); + double xm=0,cm=0, asize = gr->GetArrowSize(); double dm=(fabs(gr->Max.c)+fabs(gr->Min.c))*1e-5; // use whole array for determining maximal vectors length mglPoint d=(gr->Max-gr->Min)/mglPoint(1./ax->GetNx(),1./ax->GetNy(),1./ax->GetNz()); @@ -440,7 +438,7 @@ void MGL_EXPORT mgl_vect3_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay, { double xm1=0,cm1=0, xx,yy,zz, c1,c2; mglPoint p1, p2, v; -#pragma omp for nowait collapse(2) reduction(+:ca) +#pragma omp for nowait collapse(2) for(long i=0;iv(i)-p.x); if(dv(j)-p.y); if(dv(k)-p.z); if(d * * * * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Library General Public License as * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/src/window.cpp b/src/window.cpp index ad27995..b419503 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007-2016 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 * + * it under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation; either version 3 of the * * License, or (at your option) any later version. * * * @@ -12,7 +12,7 @@ * MERCHANTABILITY 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 * + * You should have received a copy of the GNU Lesser 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/texinfo/CMakeLists.txt b/texinfo/CMakeLists.txt index f3d7ffe..055ff5e 100644 --- a/texinfo/CMakeLists.txt +++ b/texinfo/CMakeLists.txt @@ -3,7 +3,7 @@ configure_file(${MathGL2_SOURCE_DIR}/texinfo/version.texi.in ${MathGL2_BINARY_DI #set(MGL_EXTRA light pendelta) set(MGL_EXTRA ) set(MGL_PNG_ONLY quality0 quality1 quality2 quality4 quality5 quality6 quality8 pendelta fexport) -set(MGL_PNG 3wave alpha apde area aspect axial axis barh bars belt bifurcation box boxplot boxs candle chart cloud colorbar combined cones cont cont_xyz cont3 contd contf contf_xyz contf3 conts contv correl curvcoor cut dat_diff dat_extra data1 data2 dens dens_xyz dens3 detect dew diffract dilate dots earth error error2 export fall fit flame2d flow flow3 fog fonts grad hist ifs2d ifs3d indirect inplot iris label lamerey legend light loglog map mark mask mesh minmax mirror molecule ode ohlc param1 param2 param3 paramv parser pde pipe plot pmap primitives projection projection5 pulse qo2d radar refill region scanfile schemes section several_light solve stem step stereo stfa style surf surf3 surf3a surf3c surf3ca surfa surfc surfca table tape tens ternary text text2 textmark ticks tile tiles torus traj triangulation triplot tube type0 type1 type2 vect vect3 venn ) +set(MGL_PNG 3wave alpha apde area aspect axial axis background barh bars belt beltc bifurcation box boxplot boxs candle chart cloud colorbar combined cones cont cont3 cont_xyz contd contf contf3 contf_xyz conts contv correl curvcoor cut daisy dat_diff dat_extra data1 data2 dcont dens dens3 dens_xyz detect dew diffract dilate dots earth error error2 export fall fit flame2d flow flow3 fog fonts grad hist icon ifs2d ifs3d indirect inplot iris keep label lamerey legend light lines loglog map mark mask mesh minmax mirror molecule ode ohlc param1 param2 param3 paramv parser pde pipe plot pmap primitives projection projection5 pulse qo2d radar refill region scanfile schemes section several_light solve stem step stereo stfa style surf surf3 surf3a surf3c surf3ca surfa surfc surfca table tape tens ternary text text2 textmark ticks tile tiles torus traj triangulation triplot tube type0 type1 type2 vect vect3 venn ) set(MGL_PNG_N ) set(MGL_PNG_S ) set(MGL_PNG_J ) @@ -22,6 +22,10 @@ file(COPY ${CMAKE_SOURCE_DIR}/examples/iris.dat DESTINATION ${MGL_OUT}/png) file(COPY ${CMAKE_SOURCE_DIR}/examples/iris.dat DESTINATION ${MGL_OUT}/small) file(COPY ${CMAKE_SOURCE_DIR}/examples/iris.dat DESTINATION ${MGL_OUT}/json) file(COPY ${CMAKE_SOURCE_DIR}/examples/iris.dat DESTINATION ${MGL_OUT}/pdf) +file(COPY ${CMAKE_SOURCE_DIR}/udav_new.png DESTINATION ${MGL_OUT}/png) +file(COPY ${CMAKE_SOURCE_DIR}/udav_new.png DESTINATION ${MGL_OUT}/small) +file(COPY ${CMAKE_SOURCE_DIR}/udav_new.png DESTINATION ${MGL_OUT}/json) +file(COPY ${CMAKE_SOURCE_DIR}/udav_new.png DESTINATION ${MGL_OUT}/pdf) file(COPY ${CMAKE_SOURCE_DIR}/examples/Equirectangular-projection.jpg DESTINATION ${MGL_OUT}/png) file(COPY ${CMAKE_SOURCE_DIR}/examples/Equirectangular-projection.jpg DESTINATION ${MGL_OUT}/small) file(COPY ${CMAKE_SOURCE_DIR}/examples/Equirectangular-projection.jpg DESTINATION ${MGL_OUT}/json) diff --git a/texinfo/concept_en.texi b/texinfo/concept_en.texi index 4b63d26..a71b9a4 100644 --- a/texinfo/concept_en.texi +++ b/texinfo/concept_en.texi @@ -91,13 +91,13 @@ The line style is defined by the string which may contain specifications for col @html 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’. -

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 (■■■□□■□□■■■□□■□□), ‘{dNNNN}’ – manual mask style (for v.2.3 and later, like ‘{df090}’ for (■■■■□□□□■□□■□□□□)).

+

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 (■■■□□■□□■■■□□■□□), ‘{dNNNN}’ – manual dash style (for v.2.3 and later, like ‘{df090}’ for (■■■■□□□□■□□■□□□□)).

@end html @end ifhtml @ifnothtml By default palette contain following 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}. -Dashing style has the following meaning: space -- no line (usable for plotting only marks), @samp{-} -- solid line (################), @samp{|} -- long dashed line (########________), @samp{;} -- dashed line (####____####____), @samp{=} -- small dashed line (##__##__##__##__), @samp{:} -- dotted line (#___#___#___#___), @samp{j} -- dash-dotted line (#######____#____), @samp{i} -- small dash-dotted line (###__#__###__#__), @samp{@{dNNNN@}} -- manual mask style (for v.2.3 and later, like @samp{@{df090@}} for (####____#__#____)). +Dashing style has the following meaning: space -- no line (usable for plotting only marks), @samp{-} -- solid line (################), @samp{|} -- long dashed line (########________), @samp{;} -- dashed line (####____####____), @samp{=} -- small dashed line (##__##__##__##__), @samp{:} -- dotted line (#___#___#___#___), @samp{j} -- dash-dotted line (#######____#____), @samp{i} -- small dash-dotted line (###__#__###__#__), @samp{@{dNNNN@}} -- manual dash style (for v.2.3 and later, like @samp{@{df090@}} for (####____#__#____)). @end ifnothtml Marker types are: @samp{o} -- circle, @samp{+} -- cross, @samp{x} -- skew cross, @samp{s} -- square, @samp{d} -- rhomb (or diamond), @samp{.} -- dot (point), @samp{^} -- triangle up, @samp{v} -- triangle down, @samp{<} -- triangle left, @samp{>} -- triangle right, @samp{#*} -- Y sign, @samp{#+} -- squared cross, @samp{#x} -- squared skew cross, @samp{#.} -- circled dot. If string contain symbol @samp{#} then the solid versions of markers are used. @@ -203,6 +203,8 @@ MathGL have the fast variant of textual formula evaluation @end ifclear . There are a lot of functions and operators available. The operators are: @samp{+} -- addition, @samp{-} -- subtraction, @samp{*} -- multiplication, @samp{/} -- division, @samp{%} -- modulo, @samp{^} -- integer power. Also there are logical ``operators'': @samp{<} -- true if x} -- true if x>y, @samp{=} -- true if x=y, @samp{&} -- true if x and y both nonzero, @samp{|} -- true if x or y nonzero. These logical operators have lowest priority and return 1 if true or 0 if false. + + The basic functions are: @samp{sqrt(x)} -- square root of @var{x}, @samp{pow(x,y)} -- power @var{x} in @var{y}, @samp{ln(x)} -- natural logarithm of @var{x}, @samp{lg(x)} -- decimal logarithm of @var{x}, @samp{log(a,x)} -- logarithm base @var{a} of @var{x}, @samp{abs(x)} -- absolute value of @var{x}, @samp{sign(x)} -- sign of @var{x}, @samp{mod(x,y)} -- @var{x} modulo @var{y}, @samp{step(x)} -- step function, @samp{int(x)} -- integer part of @var{x}, @samp{rnd} -- random number, @samp{random(x)} -- random data of size as in @var{x}, @samp{hypot(x,y)}=sqrt(x^2+y^2) -- hypotenuse, @samp{cmplx(x,y)}=x+i*y -- complex number, @samp{pi} -- number @ifhtml @html @@ -244,6 +246,8 @@ Note, some of these functions are unavailable if MathGL was compiled without GSL 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. +MathGL version 2.5 introduce user-defined functions @samp{fn1()...fn9()} at formula evaluation, which are defined after symbol @samp{\}. For example, "fn1(3)\x^_1" will produce "x^3". Also functions @samp{sum}, @samp{dsum}, @samp{prod} are added at formula evaluation for summation, summation with variable sign and product evaluation. For example, "sum(_i^2,5)" will produce "30"=0+1^2+2^2+3^2+4^2, "dsum(_i^2,5)" will produce "10"=0-1^2+2^2-3^2+4^2, and "prod(1+_i,5)" will produce 5!="120". You can nest them for variables _i,_j,...,_z, like "sum(sum(_j+_i^2,5),5)" will give "200". Also you can use user-defined functions, like "sum(fn1(_i)-fn2(_i),4)\_1^4\_1^3" is the same as "sum(_i^4-_i^3,4)" and will produce "62". + @c ------------------------------------------------------------------ @external{} @node Command options, Interfaces, Textual formulas, General concepts diff --git a/texinfo/concept_ru.texi b/texinfo/concept_ru.texi index ba72042..9c3a549 100644 --- a/texinfo/concept_ru.texi +++ b/texinfo/concept_ru.texi @@ -242,6 +242,8 @@ MathGL имеет быстрый парсер текстовых формул При разборе формул нет различия между верхним и нижним регистром. Если аргумент лежит вне области определения функции, то возвращается NaN. +MathGL версии 2.5 позволяет использовать пользовательские функции fn1()...fn9() при вычислении формул, определенные после символа(ов) '\'. Например, "fn1(3)\x^_1" даст "x^3". Кроме того, добавлены функции 'sum', 'dsum', 'prod' для вычисления сумм, сумм с переменным знаком и произведений в формулах. Например, "sum(_i^2,5)" даст "30"=0+1^2+2^2+3^2+4^2, "dsum(_i^2,5)" даст "10"=0-1^2+2^2-3^2+4^2, и "prod(1+_i,5)" даст 5!="120". Вызовы суммирования и произведения можно делать вложенными, используя переменные _i,_j,...,_z. Например, "sum(sum(_j+_i^2,5),5)" даст "200". Кроме того, в аргументах можно использовать и пользовательские функции. Например, "sum(fn1(_i)-fn2(_i),4)\_1^4\_1^3" эквивалентно "sum(_i^4-_i^3,4)" и даст "62". + @c ------------------------------------------------------------------ @external{} @node Command options, Interfaces, Textual formulas, General concepts @@ -258,14 +260,14 @@ MathGL имеет быстрый парсер текстовых формул @deffn {Опция MGL} alpha @code{val} Задает величину прозрачности поверхности. Значение должно быть в диапазоне [0, 1]. См. также @ref{alphadef} @end deffn -@c @cindex ambient -@c @deffn {Опция MGL} ambient @code{val} -@c Задает яркость фонового освещения. Значение должно быть в диапазоне [0, 1]. См. также @ref{ambient} -@c @end deffn -@c @cindex diffuse -@c @deffn {Опция MGL} diffuse @code{val} -@c Задает яркость диффузного освещения для поверхности. Значение должно быть в диапазоне [0, 1]. См. также @ref{diffuse}. -@c @end deffn +@cindex ambient +@deffn {Опция MGL} ambient @code{val} +Задает яркость фонового освещения. Значение должно быть в диапазоне [0, 1]. См. также @ref{ambient} +@end deffn +@cindex diffuse +@deffn {Опция MGL} diffuse @code{val} +Задает яркость диффузного освещения для поверхности. Значение должно быть в диапазоне [0, 1]. См. также @ref{diffuse}. +@end deffn @cindex xrange @deffn {Опция MGL} xrange @code{val1 val2} diff --git a/texinfo/core_en.texi b/texinfo/core_en.texi index 8be0332..f461f81 100644 --- a/texinfo/core_en.texi +++ b/texinfo/core_en.texi @@ -66,6 +66,10 @@ Deletes the instance of class mglGraph. @deftypefn {Method on @code{mglGraph}} @code{HMGL} Self () Returns the pointer to internal object of type @code{HMGL}. @end deftypefn + +@deftypefn {C function} @code{HMGL} mgl_default_graph () +Returns pointer to default instance of class mglGraph. This is default instance, used with new classes, which can be used to keep plot settings and to speed up initialization in small different plots. +@end deftypefn @end ifclear @ifset UDAV @@ -453,6 +457,15 @@ Sets to use or not text rotation. Sets to scale text in relative @ref{inplot} (including @ref{columnplot}, @ref{gridplot}, @ref{stickplot}, @ref{shearplot}) or not. @end deftypefn +@anchor{texparse} +@deftypefn {MGL command} {} texparse @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} SetTeXparse (@code{bool} val) +@deftypefnx {C function} @code{void} mgl_set_tex_parse (@code{HMGL} gr, @code{int} val) +@end ifclear +Enables/disables TeX-like command parsing at text output. +@end deftypefn + @anchor{loadfont} @deftypefn {MGL command} {} loadfont ['name'=''] @ifclear UDAV @@ -662,6 +675,11 @@ Set warning message @var{info} for global scope. Get warning message(s) for global scope. @end deftypefn +@deftypefn {Method on @code{mglGraph}} @code{void} ClearGlobalWarn () static +@deftypefnx {C function} @code{void} mgl_clear_global_warn () +Clears global warning messages. +@end deftypefn + @end ifclear @c ================================================================== @@ -1184,6 +1202,7 @@ font style (see, @ref{Font styles}); @samp{#} for box around the title. @end itemize Parameter @var{size} set font size. This function set off any aspects or rotations. So it should be used just after creating subplot. +Note, that each call of this command will reserve extra space. So, you need to manually call @ref{subplot} command after @ref{rasterize} if you want to combine bitmap and vector graphics. @end deftypefn @anchor{rotate} @@ -1613,7 +1632,7 @@ Set the numeric id for object or subplot/inplot. @deftypefn {Method on @code{mglGraph}} @code{int} GetObjId (@code{int} xs, @code{int} ys) @deftypefnx {C function} @code{int} mgl_get_obj_id (@code{HMGL} gr, @code{int} xs, @code{int} ys) -Get the numeric id for most upper object at pixel @{xs, ys@} of the picture. +Get the numeric id for most upper object at pixel @{xs, ys@} of the picture. Note, that all plots in the same line of MGL script have the same id. @end deftypefn @deftypefn {Method on @code{mglGraph}} @code{int} GetSplId (@code{int} xs, @code{int} ys) @@ -1708,18 +1727,28 @@ Clear the picture and fill background by specified color. @deftypefnx {Method on @code{mglGraph}} @code{void} Rasterize () @deftypefnx {C function} @code{void} mgl_rasterize (@code{HMGL} gr) @end ifclear -Force drawing the plot and use it as background. After it, function clear the list of primitives, like @ref{clf}. This function is useful if you want save part of plot as bitmap one (for example, large surfaces, isosurfaces or vector fields) and keep some parts as vector one (like annotation, curves, axis and so on). +Force drawing the plot and use it as background. After it, function clear the list of primitives, like @ref{clf}. This function is useful if you want save part of plot as bitmap one (for example, large surfaces, isosurfaces or vector fields) and keep some parts as vector one (like annotation, curves, axis and so on). Often, you need to manually call @ref{subplot} command after @ref{rasterize} to avoid extra space allocation or plot rotation. @end deftypefn @anchor{background} @deftypefn {MGL command} {} background 'fname' [@code{alpha=1}] +@deftypefnx {MGL command} {} background 'fname' 'how' [@code{alpha=1}] @ifclear UDAV @deftypefnx {Method on @code{mglGraph}} @code{void} LoadBackground (@code{const char *} fname, @code{double} alpha=@code{1}) @deftypefnx {C function} @code{void} mgl_load_background (@code{HMGL} gr, @code{const char *} fname, @code{double} alpha) +@deftypefnx {Method on @code{mglGraph}} @code{void} LoadBackground (@code{const char *} fname, @code{const char *} how, @code{double} alpha=@code{1}) +@deftypefnx {C function} @code{void} mgl_load_background_ext (@code{HMGL} gr, @code{const char *} fname, @code{const char *} how, @code{double} alpha) @end ifclear -Load PNG or JPEG file @var{fname} as background for the plot. Parameter @var{alpha} manually set transparency of the background. +Load PNG or JPEG file @var{fname} as background for the plot. Parameter @var{alpha} manually set transparency of the background. Parameter @var{how} can be: @samp{a} for filling current subplot only, @samp{s} for scaling (resizing) image to whole area, @samp{c} for centering image, @samp{m} for tessellate image as mosaic. @end deftypefn +@deftypefn {MGL command} {} background @code{r g b} +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} FillBackground (@code{const mglColor &}rgb) +@deftypefnx {C function} @code{void} mgl_fill_background (@code{HMGL} gr, @code{double} r, @code{double} g, @code{double} b) +@end ifclear +Fill background by the specified color. Values should be in range [0,1]. +@end deftypefn @c ################################################################## @@ -1794,13 +1823,13 @@ Draws Bezier-like curve from point @var{p1} to @var{p2} using line style @var{st @deftypefnx {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_face (@code{HMGL} gr, @code{mreal} x1, @code{mreal} y1, @code{mreal} z1, @code{mreal} x2, @code{mreal} y2, @code{mreal} z2, @code{mreal} x3, @code{mreal} y3, @code{mreal} z3, @code{mreal} x4, @code{mreal} y4, @code{mreal} z4, @code{const char *}stl) @end ifclear -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. +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. Argument @var{stl} can also contain mask specification (see @ref{Color scheme}). @end deftypefn @anchor{rect} @deftypefn {MGL command} {} rect @code{x1 y1 x2 y2} ['stl'=''] @deftypefnx {MGL command} {} rect @code{x1 y1 z1 x2 y2 z2} ['stl'=''] -Draws the solid rectangle (face) with vertexes @{@var{x1}, @var{y1}, @var{z1}@} and @{@var{x2}, @var{y2}, @var{z2}@} with color @var{stl}. At this colors can be the same for all vertexes or separately if all 4 colors are specified for each vertex. Face will be drawn even if it lies out of bounding box. +Draws the solid rectangle (face) with vertexes @{@var{x1}, @var{y1}, @var{z1}@} and @{@var{x2}, @var{y2}, @var{z2}@} with color @var{stl}. At this colors can be the same for all vertexes or separately if all 4 colors are specified for each vertex. Face will be drawn even if it lies out of bounding box. Argument @var{stl} can also contain mask specification (see @ref{Color scheme}). @end deftypefn @anchor{facex} @@ -1817,7 +1846,7 @@ Draws the solid rectangle (face) with vertexes @{@var{x1}, @var{y1}, @var{z1}@} @deftypefnx {C function} @code{void} mgl_facey (@code{HMGL} gr, @code{mreal} x0, @code{mreal} y0, @code{mreal} z0, @code{mreal} wx, @code{mreal} wz, @code{const char *}stl, @code{mreal} d1, @code{mreal} d2) @deftypefnx {C function} @code{void} mgl_facez (@code{HMGL} gr, @code{mreal} x0, @code{mreal} y0, @code{mreal} z0, @code{mreal} wx, @code{mreal} wy, @code{const char *}stl, @code{mreal} d1, @code{mreal} d2) @end ifclear -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). Face will be drawn even if it lies out of bounding box. +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. Argument @var{stl} can also contain mask specification (see @ref{Color scheme}). Parameters @var{d1}!=0, @var{d2}!=0 set additional shift of the last vertex (i.e. to draw quadrangle). Face will be drawn even if it lies out of bounding box. @end deftypefn @anchor{sphere} @@ -1872,7 +1901,9 @@ colors for filling and boundary (second one if style @samp{@@} is used, black co @item @samp{#} for wire figure (boundary only); @item -@samp{@@} for filling and boundary. +@samp{@@} for filling and boundary; +@item +mask specification (see @ref{Color scheme}). @end itemize @end deftypefn @@ -1890,7 +1921,9 @@ colors for filling and boundary (second one if style @samp{@@} is used, black co @item @samp{#} for wire figure (boundary only); @item -@samp{@@} for filling and boundary. +@samp{@@} for filling and boundary; +@item +mask specification (see @ref{Color scheme}). @end itemize @end deftypefn @@ -1908,7 +1941,9 @@ colors for filling and boundary (second one if style @samp{@@} is used, black co @item @samp{#} for wire figure (boundary only); @item -@samp{@@} for filling and boundary. +@samp{@@} for filling and boundary; +@item +mask specification (see @ref{Color scheme}). @end itemize @end deftypefn @@ -1939,7 +1974,9 @@ colors for filling and boundary (second one if style @samp{@@} is used, black co @item @samp{#} for wire figure (boundary only); @item -@samp{@@} for filling and boundary. +@samp{@@} for filling and boundary; +@item +mask specification (see @ref{Color scheme}). @end itemize @end deftypefn @@ -2354,7 +2391,7 @@ These functions draw continuous lines between points @{@var{x}[i], @var{y}[i], @ @deftypefnx {C function} @code{void} mgl_tape_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{const char *}pen, @code{const char *}opt) @deftypefnx {C function} @code{void} mgl_tape_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}pen, @code{const char *}opt) @end ifclear -These functions draw tapes of normals for curve between points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Initial tape(s) was selected in x-y plane (for @samp{x} in @var{pen}) and/or y-z plane (for @samp{x} in @var{pen}). The width of tape is proportional to @ref{barwidth} and can be changed by option @code{value}. See also @ref{plot}, @ref{flow}, @ref{barwidth}. @sref{tape sample} +These functions draw tapes of normals for curve between points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Initial tape(s) was selected in x-y plane (for @samp{x} in @var{pen}) and/or y-z plane (for @samp{x} in @var{pen}). Argument @var{pen} can also contain mask specification (see @ref{Color scheme}). The width of tape is proportional to @ref{barwidth} and can be changed by option @code{value}. See also @ref{plot}, @ref{flow}, @ref{barwidth}. @sref{tape sample} @end deftypefn @anchor{area} @@ -2369,7 +2406,7 @@ These functions draw tapes of normals for curve between points @{@var{x}[i], @va @deftypefnx {C function} @code{void} mgl_area_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{const char *}pen, @code{const char *}opt) @deftypefnx {C function} @code{void} mgl_area_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}pen, @code{const char *}opt) @end ifclear -These functions draw continuous lines between points and fills it to axis plane. Also you can use gradient filling if number of specified colors is equal to 2*number of curves. If @var{pen} contain @samp{#} then wired plot is drawn. If @var{pen} contain @samp{a} then segments between points outside of axis range are drawn too. See also @ref{plot}, @ref{bars}, @ref{stem}, @ref{region}. @sref{area sample} +These functions draw continuous lines between points and fills it to axis plane. Also you can use gradient filling if number of specified colors is equal to 2*number of curves. If @var{pen} contain @samp{#} then wired plot is drawn. If @var{pen} contain @samp{a} then segments between points outside of axis range are drawn too. Argument @var{pen} can also contain mask specification (see @ref{Color scheme}). See also @ref{plot}, @ref{bars}, @ref{stem}, @ref{region}. @sref{area sample} @end deftypefn @anchor{region} @@ -2386,7 +2423,7 @@ These functions draw continuous lines between points and fills it to axis plane. @deftypefnx {C function} @code{void} mgl_region_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y1, @code{HCDT} y2, @code{const char *}pen, @code{const char *}opt) @deftypefnx {C function} @code{void} mgl_region_3d (@code{HMGL} gr, @code{HCDT} x1, @code{HCDT} y1, @code{HCDT} z1, @code{HCDT} x2, @code{HCDT} y2, @code{HCDT} z2, @code{const char *}pen, @code{const char *}opt) @end ifclear -These functions fill area between 2 curves. Dimensions of arrays @var{y1} and @var{y2} must be equal. Also you can use gradient filling if number of specified colors is equal to 2*number of curves. If for 2D version @var{pen} contain symbol @samp{i} then only area with y1} for aligning boxes left, right or centering them at its x-coordinates. +@samp{<}, @samp{^} or @samp{>} for aligning boxes left, right or centering them at its x-coordinates; +@item +mask specification (see @ref{Color scheme}). @end itemize You can give different colors for positive and negative values if number of specified colors is equal to 2*number of curves. If @var{x}.nx>@var{y}.nx then @var{x} set the edges of bars, rather than its central positions. See also @ref{barh}, @ref{cones}, @ref{area}, @ref{stem}, @ref{chart}, @ref{barwidth}. @sref{bars sample} @end deftypefn @@ -2448,7 +2487,9 @@ These functions draw horizontal bars from points to axis plane. Parameter @var{p @item @samp{F} for using fixed (minimal) width for all bars; @item -@samp{<}, @samp{^} or @samp{>} for aligning boxes left, right or centering them at its x-coordinates. +@samp{<}, @samp{^} or @samp{>} for aligning boxes left, right or centering them at its x-coordinates; +@item +mask specification (see @ref{Color scheme}). @end itemize You can give different colors for positive and negative values if number of specified colors is equal to 2*number of curves. If @var{x}.nx>@var{y}.nx then @var{x} set the edges of bars, rather than its central positions. See also @ref{bars}, @ref{barwidth}. @sref{barh sample} @end deftypefn @@ -2489,7 +2530,7 @@ See also @ref{bars}, @ref{cone}, @ref{barwidth}. @sref{cones sample} @deftypefnx {Method on @code{mglGraph}} @code{void} Chart (@code{const mglDataA &}a, @code{const char *}col=@code{""}, @code{const char *}opt=@code{""}) @deftypefnx {C function} @code{void} mgl_chart (@code{HMGL} gr, @code{HCDT} a, @code{const char *}col, @code{const char *}opt) @end ifclear -The function draws colored stripes (boxes) for data in array @var{a}. The number of stripes is equal to the number of rows in @var{a} (equal to @var{a.ny}). The color of each next stripe is cyclically changed from colors specified in string @var{col} or in palette Pal (see @ref{Palette and colors}). Spaces in colors denote transparent ``color'' (i.e. corresponding stripe(s) are not drawn). The stripe width is proportional to value of element in @var{a}. Chart is plotted only for data with non-negative elements. If string @var{col} have symbol @samp{#} then black border lines are drawn. The most nice form the chart have in 3d (after rotation of coordinates) or in cylindrical coordinates (becomes so called Pie chart). @sref{chart sample} +The function draws colored stripes (boxes) for data in array @var{a}. The number of stripes is equal to the number of rows in @var{a} (equal to @var{a.ny}). The color of each next stripe is cyclically changed from colors specified in string @var{col} or in palette Pal (see @ref{Palette and colors}). Argument @var{col} can also contain mask specification (see @ref{Color scheme}). Spaces in colors denote transparent ``color'' (i.e. corresponding stripe(s) are not drawn). The stripe width is proportional to value of element in @var{a}. Chart is plotted only for data with non-negative elements. If string @var{col} have symbol @samp{#} then black border lines are drawn. The most nice form the chart have in 3d (after rotation of coordinates) or in cylindrical coordinates (becomes so called Pie chart). @sref{chart sample} @end deftypefn @anchor{boxplot} @@ -2520,7 +2561,7 @@ These functions draw boxplot (also known as a box-and-whisker diagram) at points @deftypefnx {C function} @code{void} mgl_candle_yv (@code{HMGL} gr, @code{HCDT} v1, @code{HCDT} v2, @code{HCDT} y1, @code{HCDT} y2, @code{const char *}pen, @code{const char *}opt) @deftypefnx {C function} @code{void} mgl_candle_xyv (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} v1, @code{HCDT} v2, @code{HCDT} y1, @code{HCDT} y2, @code{const char *}pen, @code{const char *}opt) @end ifclear -These functions draw candlestick chart at points @var{x}[i]. This is a combination of a line-chart and a bar-chart, in that each bar represents the range of price movement over a given time interval. Wire (or white) candle correspond to price growth @var{v1}[i]<@var{v2}[i], opposite case -- solid (or dark) candle. You can give different colors for growth and decrease values if number of specified colors is equal to 2. If @var{pen} contain @samp{#} then the wire candle will be used even for 2-color scheme. "Shadows" show the minimal @var{y1} and maximal @var{y2} prices. If @var{v2} is absent then it is determined as @var{v2}[i]=@var{v1}[i+1]. See also @ref{plot}, @ref{bars}, @ref{ohlc}, @ref{barwidth}. @sref{candle sample} +These functions draw candlestick chart at points @var{x}[i]. This is a combination of a line-chart and a bar-chart, in that each bar represents the range of price movement over a given time interval. Wire (or white) candle correspond to price growth @var{v1}[i]<@var{v2}[i], opposite case -- solid (or dark) candle. You can give different colors for growth and decrease values if number of specified colors is equal to 2. If @var{pen} contain @samp{#} then the wire candle will be used even for 2-color scheme. Argument @var{pen} can also contain mask specification (see @ref{Color scheme}). "Shadows" show the minimal @var{y1} and maximal @var{y2} prices. If @var{v2} is absent then it is determined as @var{v2}[i]=@var{v1}[i+1]. See also @ref{plot}, @ref{bars}, @ref{ohlc}, @ref{barwidth}. @sref{candle sample} @end deftypefn @anchor{ohlc} @@ -3086,7 +3127,7 @@ The function draws contour plot for 3d data specified parametrically @var{a}[i,j @deftypefn {MGL command} {} cont3 adat ['sch'='' @code{sval=-1}] @deftypefnx {MGL command} {} cont3 xdat ydat zdat adat ['sch'='' @code{sval=-1}] @ifclear UDAV -@deftypefnx {Method on @code{mglGraph}} @code{void} Cont3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Cont3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}) @deftypefnx {Method on @code{mglGraph}} @code{void} Cont3 (@code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}) @deftypefnx {C function} @code{void} mgl_cont3 (@code{HMGL} gr, @code{HCDT} a, @code{const char *}sch, @code{mreal} sVal, @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{const char *}sch, @code{mreal} sVal, @code{const char *}opt) @@ -3109,7 +3150,7 @@ The function draws solid (or filled) contour plot for 3d data specified parametr @deftypefn {MGL command} {} contf3 adat ['sch'='' @code{sval=-1}] @deftypefnx {MGL command} {} contf3 xdat ydat zdat adat ['sch'='' @code{sval=-1}] @ifclear UDAV -@deftypefnx {Method on @code{mglGraph}} @code{void} Contf3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Contf3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}) @deftypefnx {Method on @code{mglGraph}} @code{void} Contf3 (@code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}) @deftypefnx {C function} @code{void} mgl_contf3 (@code{HMGL} gr, @code{HCDT} a, @code{const char *}sch, @code{mreal} sVal, @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{const char *}sch, @code{mreal} sVal, @code{const char *}opt) @@ -3129,6 +3170,30 @@ The same as previous with vector @var{v} of @var{num}-th elements equidistantly 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 direction @{@samp{x}, @samp{y}, @samp{z}@} if @var{sch} contain corresponding symbol (by default, @samp{y} direction is used). See also @ref{cont3}, @ref{contf3}, @ref{dens3}, @ref{grid2}, @ref{meshnum}. @end deftypefn + +@anchor{dcont} +@deftypefn {MGL command} {} dcont vdat adat bdat ['sch'=''] +@deftypefnx {MGL command} {} dcont vdat xdat ydat zdat adat bdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}v, @code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}v, @code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_dcont_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_dcont_xyz_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws lines at intersections of isosurfaces for 3d data @var{a}, @var{b} specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Isosurfaces are taken for values specified in array @var{v}. See also @ref{cont}, @ref{cont3}. @sref{dcont sample} +@end deftypefn + +@deftypefn {MGL command} {} dcont adat bdat ['sch'='' @code{sval=-1}] +@deftypefnx {MGL command} {} dcont xdat ydat zdat adat bdat ['sch'='' @code{sval=-1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_dcont (@code{HMGL} gr, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_@code{HCDT} b, cont_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{HCDT} b, @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 @code{value} in options @var{opt} (default is 7). +@end deftypefn + @anchor{beam} @deftypefn {MGL command} {} beam tr g1 g2 adat @code{rval} ['sch'='' @code{flag=0 num=3}] @ifclear UDAV @@ -3178,7 +3243,7 @@ The function draws surface specified parametrically @{@var{x}[i,j], @var{y}[i,j] @deftypefnx {C function} @code{void} mgl_beltc (@code{HMGL} gr, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) @deftypefnx {C function} @code{void} mgl_beltc_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 belts for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} and color it by matrix @var{c}[i,j]. This plot can be used as 3d generalization of @ref{plot}). If @var{sch} contain @samp{x} then belts are drawn along x-direction else (by default) belts are drawn along y-direction. See also @ref{belt}, @ref{surfc}, @ref{meshnum}. @c TODO @sref{beltc sample} +The function draws belts for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} and color it by matrix @var{c}[i,j]. This plot can be used as 3d generalization of @ref{plot}). If @var{sch} contain @samp{x} then belts are drawn along x-direction else (by default) belts are drawn along y-direction. See also @ref{belt}, @ref{surfc}, @ref{meshnum}. @sref{beltc sample} @end deftypefn @@ -3324,6 +3389,7 @@ Draws spectrogram of complex array @var{re}+i*@var{im} for Fourier size of @var{ @node Vector fields, Other plotting, Dual plotting, MathGL core @section Vector fields @nav{} +@cindex Lines @cindex Traj @cindex Vect @cindex Dew @@ -3333,6 +3399,21 @@ Draws spectrogram of complex array @var{re}+i*@var{im} for Fourier size of @var{ 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 (see @ref{Color scheme}) for plot. String @var{opt} contain command options (see @ref{Command options}). +@anchor{lines} +@deftypefn {MGL command} {} lines y1dat y2dat ['sch'=''] +@deftypefnx {MGL command} {} lines x1dat y1dat x2dat y2dat ['sch'=''] +@deftypefnx {MGL command} {} lines x1dat y1dat z1dat x2dat y2dat z2dat ['sch'=''] +@ifclear UDAV +@deftypefnx {Method on @code{mglGraph}} @code{void} Lines (@code{const mglDataA &}y1, @code{const mglDataA &}y2, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Lines (@code{const mglDataA &}x1, @code{const mglDataA &}y1, @code{const mglDataA &}x2, @code{const mglDataA &}y2, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Method on @code{mglGraph}} @code{void} Lines (@code{const mglDataA &}x1, @code{const mglDataA &}y1, @code{const mglDataA &}z1, @code{const mglDataA &}x2, @code{const mglDataA &}y2, @code{const mglDataA &}z2, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {C function} @code{void} mgl_lines_xyz (@code{HMGL} gr, @code{HCDT}x1, @code{HCDT}y1, @code{HCDT}z1, @code{HCDT}x2, @code{HCDT}y2, @code{HCDT}z2, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_lines_xy (@code{HMGL} gr, @code{HCDT}x1, @code{HCDT}y1, @code{HCDT}x2, @code{HCDT}y2, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {C function} @code{void} mgl_lines (@code{HMGL} gr, @code{HCDT}y1, @code{HCDT}y2, @code{const char *}sch, @code{const char *}opt) +@end ifclear +The function draws lines between points @{@var{x1}, @var{y1}, @var{z1}@} and @{@var{x2}, @var{y2}, @var{z2}@}. String @var{pen} specifies the color (see @ref{Line styles}). By default (@code{pen=""}) color from palette is used (see @ref{Palette and colors}). The minor sizes of all arrays must be the same. The plots are drawn for each row if one of the data is the matrix. See also @ref{plot}, @ref{traj}. @sref{lines sample} +@end deftypefn + @anchor{traj} @deftypefn {MGL command} {} traj xdat ydat udat vdat ['sch'=''] @deftypefnx {MGL command} {} traj xdat ydat zdat udat vdat wdat ['sch'=''] @@ -3688,6 +3769,7 @@ The function draws the surface of triangles. Triangle vertexes are set by indexe The function draws contour lines for surface of triangles at @var{z}=@var{v}[k] (or at @var{z} equal to minimal z-axis value 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}. If @var{v} is absent then arrays of option @code{value} elements equidistantly distributed in color range is used. String @var{sch} sets the color scheme. 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}, @ref{triangulation}. @end deftypefn + @anchor{quadplot} @deftypefn {MGL command} {} quadplot idat xdat ydat ['sch'=''] @deftypefnx {MGL command} {} quadplot idat xdat ydat zdat ['sch'=''] diff --git a/texinfo/core_ru.texi b/texinfo/core_ru.texi index 6c92fbf..c465cb8 100644 --- a/texinfo/core_ru.texi +++ b/texinfo/core_ru.texi @@ -66,6 +66,10 @@ @deftypefn {Метод класса @code{mglGraph}} @code{HMGL} Self () Возвращает указатель на используемый объект типа @code{HMGL}. @end deftypefn + +@deftypefn {Функция С} @code{HMGL} mgl_default_graph () +Возвращает указатель на экземпляр класса mglGraph. Этот объект используется по умолчанию при создании нового класса с целью сохранения настроек и ускорения инициализации в различных графиках. +@end deftypefn @end ifclear @ifset UDAV @@ -452,6 +456,15 @@ MGL не требует создания данного типа объекто Включает/выключает масштабирование текста в относительных @ref{inplot}-ах (в том числе @ref{columnplot}, @ref{gridplot}, @ref{stickplot}, @ref{shearplot}). @end deftypefn +@anchor{texparse} +@deftypefn {Команда MGL} {} texparse @code{val} +@ifclear UDAV +@deftypefnx {Метод класса @code{mglGraph}} @code{void} SetTeXparse (@code{bool} val) +@deftypefnx {Функция С} @code{void} mgl_set_tex_parse (@code{HMGL} gr, @code{int} val) +@end ifclear +Включает/выключает распознавание TeX-подобных команд при печати текста. +@end deftypefn + @anchor{loadfont} @deftypefn {Команда MGL} {} loadfont ['name'=''] @ifclear UDAV @@ -661,6 +674,11 @@ Setsize: размер(ы) равны нулю или отрицательны Возвращает предупреждения, не привязанные к конкретному объекту рисования. @end deftypefn +@deftypefn {Метод класса @code{mglGraph}} @code{void} ClearGlobalWarn () static +@deftypefnx {Функция С} @code{void} mgl_clear_global_warn () +Удаляет общие предупреждения. +@end deftypefn + @end ifclear @@ -1177,6 +1195,7 @@ Ternary -- специальный тип графика для 3 зависим @deftypefnx {Функция С} @code{void} mgl_titlew (@code{HMGL} gr, @code{const wchar_t *}txt, @code{const char *}stl, @code{mreal} size) @end ifclear Выводит заголовок @var{title} для текущего "подграфика" шрифтом @var{stl} с размером @var{size}. Если строка @var{stl} содержит @samp{#}, то рисуется обрамляющий прямоугольник. Функция сбрасывает матрицу трансформации (повороты и сжатие графика) и должна вызываться сразу после создания "подграфика". +Следует отметить, что каждый последующий вызов команды резервирует дополнительное место. Поэтому следует вручную вызвать @ref{subplot} после @ref{rasterize} если требуется совместить растровые и векторные куски графика. @end deftypefn @anchor{rotate} @@ -1612,7 +1631,7 @@ gr.GetBGRN(bits, len(bits)); @deftypefn {Метод класса @code{mglGraph}} @code{int} GetObjId (@code{int} xs, @code{int} ys) @deftypefnx {Функция С} @code{int} mgl_get_obj_id (@code{HMGL} gr, @code{int} xs, @code{int} ys) -Возвращает числовой идентификатор верхнего объекта в точке @{xs, ys@} рисунка. +Возвращает числовой идентификатор верхнего объекта в точке @{xs, ys@} рисунка. Следует отметить, что все графики из одной строки MGL скрипта имеют одинаковый идентификатор. @end deftypefn @deftypefn {Метод класса @code{mglGraph}} @code{int} GetSplId (@code{int} xs, @code{int} ys) @@ -1706,18 +1725,28 @@ These functions change background image. @deftypefnx {Метод класса @code{mglGraph}} @code{void} Rasterize () @deftypefnx {Функция С} @code{void} mgl_rasterize (@code{HMGL} gr) @end ifclear -Завершает рисование графика и помещает результат в качестве фона. После этого, очищает список примитивов (как @ref{clf}). Функция полезна для сохранения части графика (например, поверхностей или векторных полей) в растровом виде, а другой части (кривых, осей и пр.) в векторном. +Завершает рисование графика и помещает результат в качестве фона. После этого, очищает список примитивов (как @ref{clf}). Функция полезна для сохранения части графика (например, поверхностей или векторных полей) в растровом виде, а другой части (кривых, осей и пр.) в векторном. Часто требуется вызвать команду @ref{subplot} после @ref{rasterize} во избежание выделения дополнительного места или вращения графика. @end deftypefn @anchor{background} @deftypefn {Команда MGL} {} background 'fname' [@code{alpha=1}] +@deftypefnx {Команда MGL} {} background 'fname' 'how' [@code{alpha=1}] @ifclear UDAV @deftypefnx {Метод класса @code{mglGraph}} @code{void} LoadBackground (@code{const char *} fname, @code{double} alpha=@code{1}) @deftypefnx {Функция С} @code{void} mgl_load_background (@code{HMGL} gr, @code{const char *} fname, @code{double} alpha) +@deftypefnx {Метод класса @code{mglGraph}} @code{void} LoadBackground (@code{const char *} fname, @code{const char *} how, @code{double} alpha=@code{1}) +@deftypefnx {Функция С} @code{void} mgl_load_background_ext (@code{HMGL} gr, @code{const char *} fname, @code{const char *} how, @code{double} alpha) @end ifclear -Загружает PNG или JPEG файл @var{fname} в качестве фона для графика. Параметр @var{alpha} задает прозрачность фона вручную. +Загружает PNG или JPEG файл @var{fname} в качестве фона для графика. Параметр @var{alpha} задает прозрачность фона вручную. Параметр @var{how} может содержать: @samp{a} для заполнения текущего @ref{subplot}, @samp{s} для растягивания на всю область, @samp{c} для центрирования, @samp{m} для заполнения мозаикой. @end deftypefn +@deftypefn {Команда MGL} {} background [@code{r g b}] +@ifclear UDAV +@deftypefnx {Метод класса @code{mglGraph}} @code{void} FillBackground (@code{const mglColor &}rgb) +@deftypefnx {Функция С} @code{void} mgl_fill_background (@code{HMGL} gr, @code{double} r, @code{double} g, @code{double} b) +@end ifclear +Заполняет фон указанным цветом. Значения должны быть в диапазоне от 0 до 1. +@end deftypefn @c ################################################################## @external{} @@ -1791,13 +1820,13 @@ These functions change background image. @deftypefnx {Метод класса @code{mglGraph}} @code{void} Face (@code{mglPoint} p1, @code{mglPoint} p2, @code{mglPoint} p3, @code{mglPoint} p4, @code{const char *}stl=@code{"w"}) @deftypefnx {Функция С} @code{void} mgl_face (@code{HMGL} gr, @code{mreal} x1, @code{mreal} y1, @code{mreal} z1, @code{mreal} x2, @code{mreal} y2, @code{mreal} z2, @code{mreal} x3, @code{mreal} y3, @code{mreal} z3, @code{mreal} x4, @code{mreal} y4, @code{mreal} z4, @code{const char *}stl) @end ifclear -Рисует заполненный четырехугольник (грань) с углами в точках @var{p1}, @var{p2}, @var{p3}, @var{p4} и цветом(-ами) @var{stl}. При этом цвет может быть один для всей грани, или различным если указаны все 4 цвета. Грань будет нарисована даже если часть ее лежит вне диапазона осей координат. +Рисует заполненный четырехугольник (грань) с углами в точках @var{p1}, @var{p2}, @var{p3}, @var{p4} и цветом(-ами) @var{stl}. При этом цвет может быть один для всей грани, или различным если указаны все 4 цвета. Грань будет нарисована даже если часть ее лежит вне диапазона осей координат. Параметр @var{stl} может также содержать параметры маски (см. @ref{Color scheme}). @end deftypefn @anchor{rect} @deftypefn {Команда MGL} {} rect @code{x1 y1 x2 y2} ['stl'=''] @deftypefnx {Команда MGL} {} rect @code{x1 y1 z1 x2 y2 z2} ['stl'=''] -Рисует закрашенный прямоугольник (грань) с вершинами @{@var{x1}, @var{y1}, @var{z1}@} и @{@var{x2}, @var{y2}, @var{z2}@} цветом @var{stl}. При этом цвет может быть один для всей грани, или различным для разных вершин если указаны все 4 цвета. Грань будет нарисована даже если часть ее лежит вне диапазона осей координат. +Рисует закрашенный прямоугольник (грань) с вершинами @{@var{x1}, @var{y1}, @var{z1}@} и @{@var{x2}, @var{y2}, @var{z2}@} цветом @var{stl}. При этом цвет может быть один для всей грани, или различным для разных вершин если указаны все 4 цвета. Грань будет нарисована даже если часть ее лежит вне диапазона осей координат. Параметр @var{stl} может также содержать параметры маски (см. @ref{Color scheme}). @end deftypefn @anchor{facex} @@ -1814,7 +1843,7 @@ These functions change background image. @deftypefnx {Функция С} @code{void} mgl_facey (@code{HMGL} gr, @code{mreal} x0, @code{mreal} y0, @code{mreal} z0, @code{mreal} wx, @code{mreal} wz, @code{const char *}stl, @code{mreal} d1, @code{mreal} d2) @deftypefnx {Функция С} @code{void} mgl_facez (@code{HMGL} gr, @code{mreal} x0, @code{mreal} y0, @code{mreal} z0, @code{mreal} wx, @code{mreal} wy, @code{const char *}stl, @code{mreal} d1, @code{mreal} d2) @end ifclear -Рисует закрашенный прямоугольник (грань) перпендикулярно оси [x,y,z] в точке @{@var{x0}, @var{y0}, @var{z0}@} цветом @var{stl} и шириной @var{wx}, @var{wy}, @var{wz} вдоль соответствующего направления. При этом цвет может быть один для всей грани, или различным для разных вершин если указаны все 4 цвета. Параметры @var{d1}!=0, @var{d2}!=0 задают дополнительный сдвиг последней точки (т.е. рисуют четырехугольник). Грань будет нарисована даже если часть ее лежит вне диапазона осей координат. +Рисует закрашенный прямоугольник (грань) перпендикулярно оси [x,y,z] в точке @{@var{x0}, @var{y0}, @var{z0}@} цветом @var{stl} и шириной @var{wx}, @var{wy}, @var{wz} вдоль соответствующего направления. При этом цвет может быть один для всей грани, или различным для разных вершин если указаны все 4 цвета. Параметр @var{stl} может также содержать параметры маски (см. @ref{Color scheme}). Параметры @var{d1}!=0, @var{d2}!=0 задают дополнительный сдвиг последней точки (т.е. рисуют четырехугольник). Грань будет нарисована даже если часть ее лежит вне диапазона осей координат. @end deftypefn @anchor{sphere} @@ -1863,7 +1892,7 @@ These functions change background image. @ifclear UDAV @deftypefnx {Метод класса @code{mglGraph}} @code{void} Circle (@code{mglPoint} p, @code{mreal} 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} или черными). +Рисует круг радиуса @var{r} с центром в точке @var{p}=@{@var{x0}, @var{y0}, @var{z0}@} цветом @var{stl}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). Параметр @var{col} может также содержать параметры маски (см. @ref{Color scheme}). @end deftypefn @anchor{ellipse} @@ -1873,7 +1902,7 @@ These functions change background image. @deftypefnx {Метод класса @code{mglGraph}} @code{void} Ellipse (@code{mglPoint} p1, @code{mglPoint} p2, @code{mreal} r, @code{const char *}col=@code{"r"}) @deftypefnx {Функция С} @code{void} mgl_ellipse (@code{HMGL} gr, @code{mreal} x1, @code{mreal} y1, @code{mreal} z1, @code{mreal} x2, @code{mreal} y2, @code{mreal} z2, @code{mreal} r, @code{const char *}col) @end ifclear -Рисует эллипс радиуса @var{r} с фокусами в точках @var{p1}, @var{p2} цветом @var{stl}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). +Рисует эллипс радиуса @var{r} с фокусами в точках @var{p1}, @var{p2} цветом @var{stl}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). Параметр @var{col} может также содержать параметры маски (см. @ref{Color scheme}). @end deftypefn @anchor{rhomb} @@ -1883,7 +1912,7 @@ These functions change background image. @deftypefnx {Метод класса @code{mglGraph}} @code{void} Rhomb (@code{mglPoint} p1, @code{mglPoint} p2, @code{mreal} r, @code{const char *}col=@code{"r"}) @deftypefnx {Функция С} @code{void} mgl_rhomb (@code{HMGL} gr, @code{mreal} x1, @code{mreal} y1, @code{mreal} z1, @code{mreal} x2, @code{mreal} y2, @code{mreal} z2, @code{mreal} r, @code{const char *}col) @end ifclear -Рисует ромб ширины @var{r} с вершинами в точках @var{p1}, @var{p2} цветом @var{stl}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). Если @var{col} содержит 3 цвета, то используется градиентная заливка. +Рисует ромб ширины @var{r} с вершинами в точках @var{p1}, @var{p2} цветом @var{stl}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). Если @var{col} содержит 3 цвета, то используется градиентная заливка. Параметр @var{col} может также содержать параметры маски (см. @ref{Color scheme}). @end deftypefn @anchor{arc} @@ -1906,7 +1935,7 @@ These functions change background image. @deftypefnx {Метод класса @code{mglGraph}} @code{void} Polygon (@code{mglPoint} p0, @code{mglPoint} p1, @code{int} num, @code{const char *}col=@code{"r"}) @deftypefnx {Функция С} @code{void} mgl_polygon (@code{HMGL} gr, @code{mreal} x0, @code{mreal} y0, @code{mreal} z0, @code{mreal} x1, @code{mreal} y1, @code{mreal} z1, @code{int} num, @code{const char *}col) @end ifclear -Рисует правильный @var{num}-угольник с центром в @var{p0} с первой вершиной в @var{p1} цветом @var{col}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). +Рисует правильный @var{num}-угольник с центром в @var{p0} с первой вершиной в @var{p1} цветом @var{col}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). Параметр @var{col} может также содержать параметры маски (см. @ref{Color scheme}). @c Если @var{col} содержит 3 цвета, то используется градиентная заливка. @end deftypefn @@ -1921,8 +1950,6 @@ These functions change background image. Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command options}. Bitmap can be loaded from file or specified as RGBA values for pixels. Parameter @var{smooth} set to draw bitmap without or with color interpolation. @end deftypefn - - @anchor{symbol} @deftypefn {Команда MGL} {} symbol @code{x y} 'id' ['fnt'='' @code{size=-1}] @deftypefnx {Команда MGL} {} symbol @code{x y z} 'id' ['fnt'='' @code{size=-1}] @@ -2319,7 +2346,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command @deftypefnx {Функция С} @code{void} mgl_tape_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{const char *}pen, @code{const char *}opt) @deftypefnx {Функция С} @code{void} mgl_tape_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}pen, @code{const char *}opt) @end ifclear -Функции рисуют ленты, которые вращаются вокруг кривой @{@var{x}[i], @var{y}[i], @var{z}[i]@} как её нормали. Начальная лента(ы) выбираются в плоскости x-y (для @samp{x} в @var{pen}) и/или y-z (для @samp{x} в @var{pen}). Ширина лент пропорциональна @ref{barwidth}, а также может быть изменена опцией @code{value}. См. также @ref{plot}, @ref{flow}, @ref{barwidth}. @sref{tape sample} +Функции рисуют ленты, которые вращаются вокруг кривой @{@var{x}[i], @var{y}[i], @var{z}[i]@} как её нормали. Начальная лента(ы) выбираются в плоскости x-y (для @samp{x} в @var{pen}) и/или y-z (для @samp{x} в @var{pen}). Параметр @var{pen} может также содержать параметры маски (см. @ref{Color scheme}). Ширина лент пропорциональна @ref{barwidth}, а также может быть изменена опцией @code{value}. См. также @ref{plot}, @ref{flow}, @ref{barwidth}. @sref{tape sample} @end deftypefn @anchor{area} @@ -2334,7 +2361,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command @deftypefnx {Функция С} @code{void} mgl_area_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{const char *}pen, @code{const char *}opt) @deftypefnx {Функция С} @code{void} mgl_area_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}pen, @code{const char *}opt) @end ifclear -Функции рисуют ломанную линию между точками и закрашивает её вниз до плоскости осей координат. Градиентная заливка используется если число цветов равно удвоенному число кривых. Если @var{pen} содержит @samp{#}, то рисуется только каркас. Если @var{pen} содержит @samp{a}, то рисуются и сегменты между точками вне диапазона осей координат. См. также @ref{plot}, @ref{bars}, @ref{stem}, @ref{region}. @sref{area sample} +Функции рисуют ломанную линию между точками и закрашивает её вниз до плоскости осей координат. Градиентная заливка используется если число цветов равно удвоенному число кривых. Если @var{pen} содержит @samp{#}, то рисуется только каркас. Если @var{pen} содержит @samp{a}, то рисуются и сегменты между точками вне диапазона осей координат. Параметр @var{pen} может также содержать параметры маски (см. @ref{Color scheme}). См. также @ref{plot}, @ref{bars}, @ref{stem}, @ref{region}. @sref{area sample} @end deftypefn @anchor{region} @@ -2351,7 +2378,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command @deftypefnx {Функция С} @code{void} mgl_region_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y1, @code{HCDT} y2, @code{const char *}pen, @code{const char *}opt) @deftypefnx {Функция С} @code{void} mgl_region_3d (@code{HMGL} gr, @code{HCDT} x1, @code{HCDT} y1, @code{HCDT} z1, @code{HCDT} x2, @code{HCDT} y2, @code{HCDT} z2, @code{const char *}pen, @code{const char *}opt) @end ifclear -Функции закрашивают область между 2 кривыми. Градиентная заливка используется если число цветов равно удвоенному число кривых. Если в 2d версии @var{pen} содержит @samp{i}, то закрашивается только область y1} для выравнивания полосок влево, вправо или центрирования относительно их координат. +@samp{<}, @samp{^} or @samp{>} для выравнивания полосок влево, вправо или центрирования относительно их координат; +@item +параметры маски (см. @ref{Color scheme}). @end itemize Можно использовать разные цвета для положительных и отрицательных значений если число указанных цветов равно удвоенному числу кривых для построения. Если @var{x}.nx>@var{y}.nx, то массив @var{x} задает границы полос, а не их центр. См. также @ref{barh}, @ref{cones}, @ref{area}, @ref{stem}, @ref{chart}, @ref{barwidth}. @sref{bars sample} @end deftypefn @@ -2413,7 +2442,9 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command @item @samp{F} для использования одинаковой (минимальной) ширины полосок; @item -@samp{<}, @samp{^} or @samp{>} для выравнивания полосок влево, вправо или центрирования относительно их координат. +@samp{<}, @samp{^} or @samp{>} для выравнивания полосок влево, вправо или центрирования относительно их координат; +@item +параметры маски (см. @ref{Color scheme}). @end itemize Можно использовать разные цвета для положительных и отрицательных значений если число указанных цветов равно удвоенному числу кривых для построения. Если @var{x}.nx>@var{y}.nx, то массив @var{x} задает границы полос, а не их центр. См. также @ref{bars}, @ref{barwidth}. @sref{barh sample} @end deftypefn @@ -2454,7 +2485,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command @deftypefnx {Метод класса @code{mglGraph}} @code{void} Chart (@code{const mglDataA &}a, @code{const char *}col=@code{""}, @code{const char *}opt=@code{""}) @deftypefnx {Функция С} @code{void} mgl_chart (@code{HMGL} gr, @code{HCDT} a, @code{const char *}col, @code{const char *}opt) @end ifclear -Рисует цветные полосы (пояса) для массива данных @var{a}. Число полос равно числу строк @var{a} (равно @var{a.ny}). Цвет полос поочерёдно меняется из цветов указанных в @var{col} или в палитре (см. @ref{Palette and colors}). Пробел в цветах соответствует прозрачному "цвету", т.е. если @var{col} содержит пробел(ы), то соответствующая полоса не рисуется. Ширина полосы пропорциональна значению элемента в @var{a}. График строится только для массивов не содержащих отрицательных значений. Если строка @var{col} содержит @samp{#}, то рисуется также чёрная граница полос. График выглядит лучше в (после вращения системы координат) и/или в полярной системе координат (становится Pie chart). @sref{chart sample} +Рисует цветные полосы (пояса) для массива данных @var{a}. Число полос равно числу строк @var{a} (равно @var{a.ny}). Цвет полос поочерёдно меняется из цветов указанных в @var{col} или в палитре (см. @ref{Palette and colors}). Пробел в цветах соответствует прозрачному "цвету", т.е. если @var{col} содержит пробел(ы), то соответствующая полоса не рисуется. Ширина полосы пропорциональна значению элемента в @var{a}. График строится только для массивов не содержащих отрицательных значений. Если строка @var{col} содержит @samp{#}, то рисуется также чёрная граница полос. Параметр @var{col} может также содержать параметры маски (см. @ref{Color scheme}). График выглядит лучше в (после вращения системы координат) и/или в полярной системе координат (становится Pie chart). @sref{chart sample} @end deftypefn @anchor{boxplot} @@ -2485,7 +2516,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command @deftypefnx {Функция С} @code{void} mgl_candle_yv (@code{HMGL} gr, @code{HCDT} v1, @code{HCDT} v2, @code{HCDT} y1, @code{HCDT} y2, @code{const char *}pen, @code{const char *}opt) @deftypefnx {Функция С} @code{void} mgl_candle_xyv (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} v1, @code{HCDT} v2, @code{HCDT} y1, @code{HCDT} y2, @code{const char *}pen, @code{const char *}opt) @end ifclear -Функции рисуют candlestick chart в точках @var{x}[i]. Этот график показывает прямоугольником ("свечой") диапазон изменения величины. Прозрачная (белая) свеча соответствует росту величины @var{v1}[i]<@var{v2}[i], чёрная -- уменьшению. "Тени" показывают минимальное @var{y1} и максимальное @var{y2} значения. Если @var{v2} отсутствует, то он определяется как @var{v2}[i]=@var{v1}[i+1]. Можно использовать разные цвета для растущих и падающих дней если число указанных цветов равно удвоенному числу кривых для построения. Если @var{pen} содержит @samp{#}, то прозрачная свеча будет использована и при 2-цветной схеме. См. также @ref{plot}, @ref{bars}, @ref{ohlc}, @ref{barwidth}. @sref{candle sample} +Функции рисуют candlestick chart в точках @var{x}[i]. Этот график показывает прямоугольником ("свечой") диапазон изменения величины. Прозрачная (белая) свеча соответствует росту величины @var{v1}[i]<@var{v2}[i], чёрная -- уменьшению. "Тени" показывают минимальное @var{y1} и максимальное @var{y2} значения. Если @var{v2} отсутствует, то он определяется как @var{v2}[i]=@var{v1}[i+1]. Можно использовать разные цвета для растущих и падающих дней если число указанных цветов равно удвоенному числу кривых для построения. Если @var{pen} содержит @samp{#}, то прозрачная свеча будет использована и при 2-цветной схеме. Параметр @var{pen} может также содержать параметры маски (см. @ref{Color scheme}). См. также @ref{plot}, @ref{bars}, @ref{ohlc}, @ref{barwidth}. @sref{candle sample} @end deftypefn @anchor{ohlc} @@ -3054,7 +3085,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command @deftypefn {Команда MGL} {} cont3 adat ['sch'='' @code{sval=-1}] @deftypefnx {Команда MGL} {} cont3 xdat ydat zdat adat ['sch'='' @code{sval=-1}] @ifclear UDAV -@deftypefnx {Метод класса @code{mglGraph}} @code{void} Cont3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Метод класса @code{mglGraph}} @code{void} Cont3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}) @deftypefnx {Метод класса @code{mglGraph}} @code{void} Cont3 (@code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}) @deftypefnx {Функция С} @code{void} mgl_cont3 (@code{HMGL} gr, @code{HCDT} a, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt) @deftypefnx {Функция С} @code{void} mgl_cont3_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt) @@ -3077,7 +3108,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command @deftypefn {Команда MGL} {} contf3 adat ['sch'='' @code{sval=-1}] @deftypefnx {Команда MGL} {} contf3 xdat ydat zdat adat ['sch'='' @code{sval=-1}] @ifclear UDAV -@deftypefnx {Метод класса @code{mglGraph}} @code{void} Contf3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Метод класса @code{mglGraph}} @code{void} Contf3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}) @deftypefnx {Метод класса @code{mglGraph}} @code{void} Contf3 (@code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}) @deftypefnx {Функция С} @code{void} mgl_contf3 (@code{HMGL} gr, @code{HCDT} a, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt) @deftypefnx {Функция С} @code{void} mgl_contf3_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt) @@ -3097,6 +3128,29 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command Рисует сетку для 3d массива, заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). График рисуется на срезе @var{sVal} в направлении @{@samp{x}, @samp{y}, @samp{z}@}, указанном в строке @var{sch} (по умолчанию, в напралении @samp{y}). См. также @ref{cont3}, @ref{contf3}, @ref{dens3}, @ref{grid2}, @ref{meshnum}. @end deftypefn +@anchor{dcont} +@deftypefn {Команда MGL} {} dcont vdat adat bdat ['sch'=''] +@deftypefnx {Команда MGL} {} dcont vdat xdat ydat zdat adat bdat ['sch'=''] +@ifclear UDAV +@deftypefnx {Метод класса @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}v, @code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Метод класса @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}v, @code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Функция С} @code{void} mgl_dcont_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {Функция С} @code{void} mgl_dcont_xyz_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{const char *}opt) +@end ifclear +Рисует линии пересечений поверхностей постоянного уровня для 3d данных @var{a}, @var{b} заданных параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Поверхности уровня берутся при значениях функции равных элементам массива @var{v}. См. также @ref{cont}, @ref{cont3}. @sref{dcont sample} +@end deftypefn + +@deftypefn {Команда MGL} {} dcont adat bdat ['sch'='' @code{sval=-1}] +@deftypefnx {Команда MGL} {} dcont xdat ydat zdat adat bdat ['sch'='' @code{sval=-1}] +@ifclear UDAV +@deftypefnx {Метод класса @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Метод класса @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Функция С} @code{void} mgl_dcont (@code{HMGL} gr, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt) +@deftypefnx {Функция С} @code{void} mgl_@code{HCDT} b, cont_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{const char *}opt) +@end ifclear +Аналогично предыдущему для @var{num} уровней равномерно распределённых в диапазоне изменения цвета. Величина @var{num} равна значению параметра @code{value} в опциях @var{opt} (по умолчанию 7). +@end deftypefn + @anchor{beam} @deftypefn {Команда MGL} {} beam tr g1 g2 adat @code{rval} ['sch'='' @code{flag=0 num=3}] @ifclear UDAV @@ -3147,7 +3201,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command @deftypefnx {Функция С} @code{void} mgl_beltc (@code{HMGL} gr, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) @deftypefnx {Функция С} @code{void} mgl_beltc_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt) @end ifclear -Рисует ленточки для параметрически заданной поверхности @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} с цветом, заданным массивом @var{c}[i,j]. График может использоваться как 3d обобщение графика @ref{plot}. Если @var{sch} содержит @samp{x}, то ленточки рисуются вдоль оси x, иначе (по умолчанию) вдоль оси y. См. также @ref{belt}, @ref{surfc}, @ref{meshnum}. @c TODO @sref{beltc sample} +Рисует ленточки для параметрически заданной поверхности @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} с цветом, заданным массивом @var{c}[i,j]. График может использоваться как 3d обобщение графика @ref{plot}. Если @var{sch} содержит @samp{x}, то ленточки рисуются вдоль оси x, иначе (по умолчанию) вдоль оси y. См. также @ref{belt}, @ref{surfc}, @ref{meshnum}. @sref{beltc sample} @end deftypefn @@ -3302,6 +3356,21 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command Эти функции рисуют графики для 2D и 3D векторных полей. Есть несколько типов графиков: просто векторное поле (Vect), вектора вдоль траектории (Traj), векторное поле каплями (Dew), нити тока (Flow, FlowP), трубки тока (Pipe). По умолчанию (если отсутствуют) значения @var{x}, @var{y} и @var{z} равно распределены в диапазоне осей координат. Младшие размерности массивов @var{x}, @var{y}, @var{z} и @var{ax} должны быть одинаковы. Размеры массивов @var{ax}, @var{ay} и @var{az} должны быть одинаковы. Массивы @var{x}, @var{y} и @var{z} могут быть векторами (не матрицами как @var{ax}). Строка @var{sch} задает цветовую схему (см. @ref{Color scheme}). Строка @var{opt} задает опции графика (см. @ref{Command options}). +@anchor{lines} +@deftypefn {Команда MGL} {} lines y1dat y2dat ['sch'=''] +@deftypefnx {Команда MGL} {} lines x1dat y1dat x2dat y2dat ['sch'=''] +@deftypefnx {Команда MGL} {} lines x1dat y1dat z1dat x2dat y2dat z2dat ['sch'=''] +@ifclear UDAV +@deftypefnx {Метод класса @code{mglGraph}} @code{void} Lines (@code{const mglDataA &}y1, @code{const mglDataA &}y2, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Метод класса @code{mglGraph}} @code{void} Lines (@code{const mglDataA &}x1, @code{const mglDataA &}y1, @code{const mglDataA &}x2, @code{const mglDataA &}y2, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Метод класса @code{mglGraph}} @code{void} Lines (@code{const mglDataA &}x1, @code{const mglDataA &}y1, @code{const mglDataA &}z1, @code{const mglDataA &}x2, @code{const mglDataA &}y2, @code{const mglDataA &}z2, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""}) +@deftypefnx {Функция С} @code{void} mgl_lines_xyz (@code{HMGL} gr, @code{HCDT}x1, @code{HCDT}y1, @code{HCDT}z1, @code{HCDT}x2, @code{HCDT}y2, @code{HCDT}z2, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {Функция С} @code{void} mgl_lines_xy (@code{HMGL} gr, @code{HCDT}x1, @code{HCDT}y1, @code{HCDT}x2, @code{HCDT}y2, @code{const char *}sch, @code{const char *}opt) +@deftypefnx {Функция С} @code{void} mgl_lines (@code{HMGL} gr, @code{HCDT}y1, @code{HCDT}y2, @code{const char *}sch, @code{const char *}opt) +@end ifclear +Функция рисует линии между точками @{@var{x1}, @var{y1}, @var{z1}@} и @{@var{x2}, @var{y2}, @var{z2}@}. Строка @var{pen} задает цвет (см. @ref{Line styles}). По умолчанию (@code{pen=""}) используется текущий цвет из палитры (см. @ref{Palette and colors}). Размер по 1-му индексу должен быть одинаков. График рисуется для каждой строки если один из массивов матрица. См. также @ref{plot}, @ref{traj}. @sref{lines sample} +@end deftypefn + @anchor{traj} @deftypefn {Команда MGL} {} traj xdat ydat udat vdat ['sch'=''] @deftypefnx {Команда MGL} {} traj xdat ydat zdat udat vdat wdat ['sch'=''] diff --git a/texinfo/data_en.texi b/texinfo/data_en.texi index 5e6814e..684afc1 100644 --- a/texinfo/data_en.texi +++ b/texinfo/data_en.texi @@ -453,11 +453,28 @@ Allocates memory and copies the data from the @code{std::vector} array. Allocates memory and scanf the data from the string. @end deftypefn - @deftypefn {Method on @code{mglData}} @code{void} SetList (@code{long} n, ...) Allocate memory and set data from variable argument list of @emph{double} values. Note, you need to specify decimal point @samp{.} for integer values! For example, the code @code{SetList(2,0.,1.);} is correct, but the code @code{SetList(2,0,1);} is incorrect. @end deftypefn +@deftypefn {Method on @code{mglData}} @code{void} Set (@code{const arma::vec &}d) +@deftypefnx {Method on @code{mglData}} @code{void} Set (@code{const arma::mat &}d) +@deftypefnx {Method on @code{mglData}} @code{void} Set (@code{const arma::cube &}d) +@deftypefnx {Method on @code{mglDataC}} @code{void} Set (@code{const arma::vec &}d) +@deftypefnx {Method on @code{mglDataC}} @code{void} Set (@code{const arma::cx_vec &}d) +@deftypefnx {Method on @code{mglDataC}} @code{void} Set (@code{const arma::mat &}d) +@deftypefnx {Method on @code{mglDataC}} @code{void} Set (@code{const arma::cx_mat &}d) +@deftypefnx {Method on @code{mglDataC}} @code{void} Set (@code{const arma::cube &}d) +@deftypefnx {Method on @code{mglDataC}} @code{void} Set (@code{const arma::cx_cube &}d) +Allocates memory and copies the data from the Armadillo structures. +@end deftypefn + +@deftypefn {Method on @code{mglData}} @code{arma::mat} arma_mat (@code{long} k=0) +@deftypefnx {Method on @code{mglData}} @code{arma::cube} arma_cube () +@deftypefnx {Method on @code{mglData}} @code{arma::cx_mat} arma_mat (@code{long} k=0) +@deftypefnx {Method on @code{mglData}} @code{arma::cx_cube} arma_cube () +Return data in Armadillo format. +@end deftypefn @deftypefn {Method on @code{mglData}} @code{void} Link (@code{mglData &}from) @@ -497,7 +514,7 @@ Equidistantly fills the data values to range [@var{v1}, @var{v2}] in direction @ @deftypefnx {C function} @code{void} mgl_data_fill_eq (@code{HMGL} gr, @code{HMDT} dat, @code{const char *}eq, @code{HCDT} vdat, @code{HCDT} wdat, @code{const char *}opt) @deftypefnx {C function} @code{void} mgl_datac_fill_eq (@code{HMGL} gr, @code{HADT} dat, @code{const char *}eq, @code{HCDT} vdat, @code{HCDT} 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). +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). Variables @samp{i}, @samp{j}, @samp{k} denote corresponding index. At this, zero value is used for variables if corresponding dimension is absent in the data. 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} @@ -515,7 +532,7 @@ Fills the value of array according to the formula in string @var{eq}. Formula is @deftypefnx {C function} @code{void} mgl_datac_modify (@code{HADT} dat, @code{const char *}eq, @code{int} dim) @deftypefnx {C function} @code{void} mgl_datac_modify_vw (@code{HADT} 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}. +The same as previous ones but coordinates @samp{x}, @samp{y}, @samp{z} are supposed to be normalized in range [0,1]. Variables @samp{i}, @samp{j}, @samp{k} denote corresponding index. At this, zero value is used for variables if corresponding dimension is absent in the data. If @var{dim}>0 is specified then modification will be fulfilled only for slices >=@var{dim}. @end deftypefn @anchor{fillsample} @@ -602,6 +619,99 @@ Sets the symbol @var{ids} for data columns. The string should contain one symbol @end deftypefn +@anchor{bernoulli} +@deftypefn {MGL command} {} bernoulli dat [@code{p=0.5}] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} RndBernoulli (@code{mreal} p=0.5) +@deftypefnx {C function} @code{void} mgl_data_rnd_bernoulli (@code{HMDT} dat, @code{mreal} p) +@deftypefnx {C function} @code{mreal} mgl_rnd_bernoulli (@code{mreal} p) +@end ifclear +Fills data by random numbers of Bernoulli distribution with probability @var{p}. +@end deftypefn + +@anchor{binomial} +@deftypefn {MGL command} {} binomial dat @code{n [p=0.5]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} RndBinomial (@code{long} n, @code{mreal} p=0.5) +@deftypefnx {C function} @code{void} mgl_data_rnd_binomial (@code{HMDT} dat, @code{long} n, @code{mreal} p) +@deftypefnx {C function} @code{mreal} mgl_rnd_binomial (@code{long} n, @code{mreal} p) +@end ifclear +Fills by random numbers according to binomial distribution in @var{n} coin flips with probability @var{p}. +@end deftypefn + +@anchor{brownian} +@deftypefn {MGL command} {} brownian dat @code{y1 y2 sigma h} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} RndBrownian (@code{mreal} y1, @code{mreal} y2, @code{mreal} sigma, @code{mreal} h) +@deftypefnx {C function} @code{void} mgl_data_rnd_brownian (@code{HMDT} dat, @code{mreal} y1, @code{mreal} y2, @code{mreal} sigma, @code{mreal} h) +@end ifclear +Fills by fractional brownian motion. +@end deftypefn + +@anchor{discrete} +@deftypefn {MGL command} {} discrete dat vdat +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} RndDiscrete (@code{const mglDataA &}vdat) +@deftypefnx {C function} @code{void} mgl_data_rnd_discrete (@code{HMDT} dat, @code{HCDT} vdat) +@deftypefnx {C function} @code{mreal} mgl_rnd_discrete (@code{HCDT} vdat) +@end ifclear +Fills by random numbers according to discrete distribution. +@end deftypefn + +@anchor{exponential} +@deftypefn {MGL command} {} exponential dat [@code{p}] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} RndExponential (@code{mreal} p) +@deftypefnx {C function} @code{void} mgl_data_rnd_exponential (@code{HMDT} dat, @code{mreal} p) +@deftypefnx {C function} @code{mreal} mgl_rnd_exponential (@code{mreal} p) +@end ifclear +Fills by random numbers according to exponential distribution with scale @var{p}. +@end deftypefn + +@anchor{gaussian} +@deftypefn {MGL command} {} gaussian dat [@code{mu=0 sigma=1}] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} RndGaussian (@code{mreal} mu=0, @code{mreal} sigma=1) +@deftypefnx {C function} @code{void} mgl_data_rnd_gaussian (@code{HMDT} dat, @code{mreal} mu, @code{mreal} sigma) +@deftypefnx {C function} @code{mreal} mgl_rnd_gaussian (@code{mreal} mu, @code{mreal} sigma) +@end ifclear +Fills by random numbers according to Gaussian distribution with average @var{mu} and scale @var{sigma}. +@end deftypefn + +@anchor{shuffle} +@deftypefn {MGL command} {} shuffle dat ['dir'='a'] +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} RndShuffle (@code{char} dir='a') +@deftypefnx {C function} @code{void} mgl_data_rnd_shuffle (@code{HMDT} dat, @code{char} dir) +@end ifclear +Shuffle data cells (for @var{dir}=@samp{a}) or slices (for @var{dir}=@samp{xyz}). +@end deftypefn + +@anchor{uniform} +@deftypefn {MGL command} {} uniform dat @code{lo hi} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} RndUniform (@code{mreal} lo, @code{mreal} hi) +@deftypefnx {C function} @code{void} mgl_data_rnd_uniform (@code{HMDT} dat, @code{mreal} lo, @code{mreal} hi) +@deftypefnx {C function} @code{mreal} mgl_rnd_uniform (@code{mreal} lo, @code{mreal} hi) +@end ifclear +Fills by random numbers uniformly chosen in (@var{lo},@var{hi}). +@end deftypefn + +@anchor{uniformint} +@deftypefn {MGL command} {} uniformint dat @code{lo hi} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} RndInteger (@code{long} lo, @code{long} hi) +@deftypefnx {C function} @code{void} mgl_data_rnd_integer (@code{HMDT} dat, @code{long} lo, @code{mreal} hi) +@deftypefnx {C function} @code{long} mgl_rnd_integer (@code{long} lo, @code{long} hi) +@end ifclear +Fills by random integers uniformly chosen in [@var{lo},@var{hi}). +@end deftypefn + + + + + + @c ------------------------------------------------------------------ @external{} @node File I/O, Make another data, Data filling, Data processing @@ -691,6 +801,10 @@ Read file @var{fname} line-by-line and scan each line for numbers according the Saves the whole data array (for @var{ns}=@code{-1}) or only @var{ns}-th slice to the text file @var{fname}. @end deftypefn +@deftypefn {MGL command} {} save @code{val} dat 'fname' +Saves the value @var{val} to the text file @var{fname}. +@end deftypefn + @deftypefn {MGL command} {} save 'str' 'fname' ['mode'='a'] Saves the string @var{str} to the text file @var{fname}. For parameter @var{mode}=@samp{a} will append string to the file (default); for @var{mode}=@samp{w} will overwrite the file. @sref{Saving and scanning file} @end deftypefn @@ -717,6 +831,15 @@ Reads data array named @var{dname} from HDF5 or HDF4 file. This function does no Saves data array named @var{dname} to HDF5 file. This function does nothing if HDF5 was disabled during library compilation. @end deftypefn +@deftypefn {MGL command} {} savehdf @code{val} 'fname' 'dname' [@code{rewrite}=@code{off}] +@ifclear UDAV +@deftypefnx {C function} @code{void} mgl_real_save_hdf (@code{real} val, @code{const char *}fname, @code{const char *}dname, @code{int} rewrite) +@deftypefnx {C function} @code{void} mgl_dual_save_hdf (@code{dual} val, @code{const char *}fname, @code{const char *}dname, @code{int} rewrite) +@deftypefnx {C function} @code{void} mgl_int_save_hdf (@code{long} val, @code{const char *}fname, @code{const char *}dname, @code{int} rewrite) +@end ifclear +Saves value @code{val} named @var{dname} to HDF5 file. This function does nothing if HDF5 was disabled during library compilation. +@end deftypefn + @anchor{datas} @deftypefn {MGL command} {} datas 'fname' @ifclear UDAV @@ -760,6 +883,17 @@ Reads data from bitmap file (now support only PNG format). The RGB values of bit 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 + +@anchor{readbin} +@deftypefn {MGL command} {} readbin dat 'fname' @code{type} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{bool} ReadBin (@code{const char *}fname, @code{int} type) +@deftypefnx {C function} @code{int} mgl_data_read_bin (@code{HMDT} dat, @code{const char *}fname, @code{int} type) +@end ifclear +Reads data from binary file. Parameter @var{type} determine the number format: 0 - double, 1 - float, 2 - long double, 3 - long int, 4 - int, 5 - short int, 6 - char. NOTE: this function may not correctly read binary files written in different CPU kind! It is better to use HDF files, see @ref{readhdf}. +@end deftypefn + + @c ------------------------------------------------------------------ @external{} @node Make another data, Data changing, File I/O, Data processing @@ -911,7 +1045,7 @@ Get curves @{x,y@}, separated by NAN values, for local maximal values of array @ @deftypefnx {C function} @code{HMDT} mgl_data_hist (@code{HCDT} dat, @code{int} n, @code{mreal} v1, @code{mreal} v2, @code{int} nsub) @deftypefnx {C function} @code{HMDT} mgl_data_hist_w (@code{HCDT} dat, @code{HCDT} w, @code{int} n, @code{mreal} v1, @code{mreal} 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). Function return NULL or create empty data if data cannot be created for given arguments. See also @ref{Data manipulation} +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). If @var{nsub}<0 then linear interpolation is used instead of spline one. Function return NULL or create empty data if data cannot be created for given arguments. See also @ref{Data manipulation} @end deftypefn @anchor{momentum} @@ -1040,6 +1174,33 @@ Gets array of arguments of the data. Find pulse properties along direction @var{dir}: pulse maximum (in column 0) and its position (in column 1), pulse width near maximum (in column 3) and by half height (in column 2), energy in first pulse (in column 4). NAN values are used for widths if maximum is located near the edges. Note, that there is uncertainty for complex data. Usually one should use square of absolute value (i.e. |dat[i]|^2) for them. So, MathGL don't provide this function for complex data arrays. However, C function will work even in this case but use absolute value (i.e. |dat[i]|). Function return NULL or create empty data if data cannot be created for given arguments. See also @ref{max}, @ref{min}, @ref{momentum}, @ref{sum}. @sref{Pulse properties} @end deftypefn +@anchor{first} +@deftypefn {MGL command} {} first @sc{res} dat 'dir' @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{mglData} First (@code{const char *}dir, @code{mreal} val) @code{const} +@deftypefnx {Method on @code{mglDataC}} @code{mglData} First (@code{const char *}dir, @code{mreal} val) @code{const} +@deftypefnx {C function} @code{HMDT} mgl_data_first_dir (@code{HCDT} dat, @code{const char *}dir, @code{mreal} val) +@end ifclear +Get array of positions of first value large @var{val}. For complex data the absolute value is used. See also @ref{last}. +@end deftypefn + +@anchor{last} +@deftypefn {MGL command} {} last @sc{res} dat 'dir' @code{val} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{mglData} Last (@code{const char *}dir, @code{mreal} val) @code{const} +@deftypefnx {Method on @code{mglDataC}} @code{mglData} Last (@code{const char *}dir, @code{mreal} val) @code{const} +@deftypefnx {C function} @code{HMDT} mgl_data_last_dir (@code{HCDT} dat, @code{const char *}dir, @code{mreal} val) +@end ifclear +Get array of positions of last value large @var{val}. For complex data the absolute value is used. See also @ref{first}. +@end deftypefn + +@ifclear UDAV +@deftypefn {C function} @code{HMDT} mgl_formula_calc (@code{const char *}str, @code{long} n, ...) +@deftypefnx {C function} @code{HADT} mgl_formula_calc_c (@code{const char *}str, @code{long} n, ...) +Evaluate formula @var {str} for the given list of @var{n} data arrays of type @code{HCDT}. Variable names correspond to data names. You need to delete returned data array after usage! See also @ref{fill}. +@end deftypefn +@end ifclear + @c ------------------------------------------------------------------ @external{} @@ -1231,6 +1392,8 @@ Smooths the data on specified direction or directions. String @var{dirs} specifi @item @samp{d1}...@samp{d9} for linear averaging over (2*N+1)-th points, @item +@samp{p1}...@samp{p9} for parabolic averaging over (2*N+1)-th points, +@item @samp{^} for finding upper bound, @item @samp{_} for finding lower bound. @@ -1297,6 +1460,17 @@ Normalizes data slice-by-slice along direction @var{dir} the data in slices to r @end ifnottex @end deftypefn +@anchor{keep} +@deftypefn {MGL command} {} keep dat 'dir' @code{i [j=0]} +@ifclear UDAV +@deftypefnx {Method on @code{mglData}} @code{void} Keep (@code{const char *}dir, @code{long} i, @code{long} j=0) +@deftypefnx {Method on @code{mglDataC}} @code{void} Keep (@code{const char *}dir, @code{long} i, @code{long} j=0) +@deftypefnx {C function} @code{void} mgl_data_keep (@code{HMDT} dat, @code{const char *}dir, @code{long} i, @code{long} j) +@deftypefnx {C function} @code{void} mgl_datac_keep (@code{HADT} dat, @code{const char *}dir, @code{long} i, @code{long} j=0) +@end ifclear +Conserves phase/sign or amplitude (if @var{dir} contain @samp{a}) of data along directions @var{dir} by fixing one at point @{@var{i},@var{j}@} of the initial slice. The function is useful for removing common phase change of a complex data. @sref{keep sample} +@end deftypefn + @anchor{limit} @deftypefn {MGL command} {} limit dat @code{val} @ifclear UDAV @@ -1819,9 +1993,26 @@ Solves GO ray equation like dr/dt = d @var{ham}/dp, dp/dt = -d @var{ham}/dr. Thi @deftypefnx {C function} @code{HMDT} mgl_ode_solve (@code{void (*}df@code{)(const mreal *x, mreal *dx, void *par)}, @code{int} n, @code{const mreal *}ini, @code{mreal} dt, @code{mreal} tmax) @deftypefnx {C function} @code{HMDT} mgl_ode_solve_ex (@code{void (*}df@code{)(const mreal *x, mreal *dx, void *par)}, @code{int} n, @code{const mreal *}ini, @code{mreal} dt, @code{mreal} tmax, @code{void (*}bord@code{)(mreal *x, const mreal *xprev, void *par)}) @end ifclear -Solves ODE equations dx/dt = df(x). The functions @var{df} can be specified as string of ';'-separated textual formulas (argument @var{var} set the character ids of variables x[i]) or as callback function, which fill @code{dx} array for give @code{x}'s. Parameters @var{ini}, @var{dt}, @var{tmax} set initial values, time step and maximal time of the calculation. Function stop execution if @code{NAN} or @code{INF} values appears. Result is data array with dimensions @{@var{n} * @var{Nt}@}, where @var{Nt} <= int(@var{tmax}/@var{dt}+1) +Solves ODE equations dx/dt = df(x). The functions @var{df} can be specified as string of ';'-separated textual formulas (argument @var{var} set the character ids of variables x[i]) or as callback function, which fill @code{dx} array for give @code{x}'s. Parameters @var{ini}, @var{dt}, @var{tmax} set initial values, time step and maximal time of the calculation. Function stop execution if @code{NAN} or @code{INF} values appears. Result is data array with dimensions @{@var{n} * @var{Nt}@}, where @var{Nt} <= int(@var{tmax}/@var{dt}+1). + +If @var{dt}*@var{tmax}<0 then regularization is switched on, which change equations to dx/ds = df(x)/max(|df(x)|) to allow accurately passes region of strong df variation or quickly bypass region of small df. Here s is the new "time". At this, real time is determined as dt/ds=max(|df(x)|). If you need real time, then add it into equations manually, like @samp{ode res 'y;-sin(x);1' 'xyt' [3,0] 0.3 -100}. This also preserve accuracy at stationary points (i.e. at small df in periodic case). +@end deftypefn + + + +@deftypefn {MGL command} {} ode @sc{res} 'df' 'var' 'brd' ini [@code{dt=0.1 tmax=10}] +@ifclear UDAV +@deftypefnx {Global function} @code{mglData} mglODEs (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{const mglDataA &}ini, @code{mreal} dt=@code{0.1}, @code{mreal} tmax=@code{10}) +@deftypefnx {Global function} @code{mglDataC} mglODEcs (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{const mglDataA &}ini, @code{mreal} dt=@code{0.1}, @code{mreal} tmax=@code{10}) +@deftypefnx {C function} @code{HMDT} mgl_ode_solve_set (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{HCDT} ini, @code{mreal} dt, @code{mreal} tmax) +@deftypefnx {C function} @code{HADT} mgl_ode_solve_set_c (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{HCDT} ini, @code{mreal} dt, @code{mreal} tmax) +@end ifclear +Solves difference approximation of PDE as a set of ODE dx/dt = df(x,j). Functions @var{df} can be specified as string of ';'-separated textual formulas, which can depend on index @var{j} and current time @samp{t}. Argument @var{var} set the character ids of variables x[i]. Parameter @var{brd} sets the kind of boundary conditions on @var{j}: @samp{0} or @samp{z} -- zero at border, @samp{1} or @samp{c} -- constant at border, @samp{2} or @samp{l} -- linear at border (laplacian is zero), @samp{3} or @samp{s} -- square at border, @samp{4} or @samp{e} -- exponential at border, @samp{5} or @samp{g} -- gaussian at border. The cases @samp{e} and @samp{g} are applicable for the complex variant only. Parameters @var{ini}, @var{dt}, @var{tmax} set initial values, time step and maximal time of the calculation. Function stop execution if @code{NAN} or @code{INF} values appears. Result is data array with dimensions @{@var{n} * @var{Nt}@}, where @var{Nt} <= int(@var{tmax}/@var{dt}+1). For example, difference aprroximation of diffusion equation with zero boundary conditions can be solved by call: @samp{ode res 'u(j+1)-2*u(j)+u(j-1)' 'u' '0' u0}, where @samp{u0} is an initial data array. + +If @var{dt}*@var{tmax}<0 then regularization is switched on, which change equations to dx/ds = df(x)/max(|df(x)|) to allow accurately passes region of strong df variation or quickly bypass region of small df. Here s is the new "time". At this, real time is determined as dt/ds=max(|df(x)|). If you need real time, then add it into equations manually, like @samp{ode res 'y;-sin(x);1' 'xyt' [3,0] 0.3 -100}. This also preserve accuracy at stationary points (i.e. at small df in periodic case). @end deftypefn + @anchor{qo2d} @deftypefn {MGL command} {} qo2d @sc{res} 'ham' ini_re ini_im ray [@code{r=1 k0=100} xx yy] @ifclear UDAV diff --git a/texinfo/data_ru.texi b/texinfo/data_ru.texi index c70f9f7..c15d3a3 100644 --- a/texinfo/data_ru.texi +++ b/texinfo/data_ru.texi @@ -456,6 +456,28 @@ Allocate memory and set data from variable argument list of @emph{double} values @end deftypefn + +@deftypefn {Метод класса @code{mglData}} @code{void} Set (@code{const arma::vec &}d) +@deftypefnx {Метод класса @code{mglData}} @code{void} Set (@code{const arma::mat &}d) +@deftypefnx {Метод класса @code{mglData}} @code{void} Set (@code{const arma::cube &}d) +@deftypefnx {Метод класса @code{mglDataC}} @code{void} Set (@code{const arma::vec &}d) +@deftypefnx {Метод класса @code{mglDataC}} @code{void} Set (@code{const arma::cx_vec &}d) +@deftypefnx {Метод класса @code{mglDataC}} @code{void} Set (@code{const arma::mat &}d) +@deftypefnx {Метод класса @code{mglDataC}} @code{void} Set (@code{const arma::cx_mat &}d) +@deftypefnx {Метод класса @code{mglDataC}} @code{void} Set (@code{const arma::cube &}d) +@deftypefnx {Метод класса @code{mglDataC}} @code{void} Set (@code{const arma::cx_cube &}d) +Выделяет память и копирует данные из Armadillo структур. +@end deftypefn + +@deftypefn {Метод класса @code{mglData}} @code{arma::mat} arma_mat (@code{long} k=0) +@deftypefnx {Метод класса @code{mglData}} @code{arma::cube} arma_cube () +@deftypefnx {Метод класса @code{mglData}} @code{arma::cx_mat} arma_mat (@code{long} k=0) +@deftypefnx {Метод класса @code{mglData}} @code{arma::cx_cube} arma_cube () +Возвращает данные в формате структур Armadillo. +@end deftypefn + + + @deftypefn {Метод класса @code{mglData}} @code{void} Link (@code{mglData &}from) @deftypefnx {Метод класса @code{mglData}} @code{void} Link (@code{mreal *}A, @code{int} NX, @code{int} NY=@code{1}, @code{int} NZ=@code{1}) @deftypefnx {Функция С} @code{void} mgl_data_link (@code{HMDT} dat, @code{const mreal *}A, @code{int} NX, @code{int} NY, @code{int} NZ) @@ -493,7 +515,7 @@ Allocate memory and set data from variable argument list of @emph{double} values @deftypefnx {Функция С} @code{void} mgl_data_fill_eq (@code{HMGL} gr, @code{HMDT} dat, @code{const char *}eq, @code{HCDT} vdat, @code{HCDT} wdat, @code{const char *}opt) @deftypefnx {Функция С} @code{void} mgl_datac_fill_eq (@code{HMGL} gr, @code{HADT} dat, @code{const char *}eq, @code{HCDT} vdat, @code{HCDT} wdat, @code{const char *}opt) @end ifclear -Заполняет значениями вычисленными по формуле @var{eq}. Формула представляет собой произвольное выражение, зависящее от переменных @samp{x}, @samp{y}, @samp{z}, @samp{u}, @samp{v}, @samp{w}. Координаты @samp{x}, @samp{y}, @samp{z} полагаются меняющимися в диапазоне @var{Min} x @var{Max} (в отличие от функции @code{Modify}). Переменная @samp{u} -- значения исходного массива, переменные @samp{v}, @samp{w} -- значения массивов @var{vdat}, @var{wdat}. Последние могут быть @code{NULL}, т.е. опущены. +Заполняет значениями вычисленными по формуле @var{eq}. Формула представляет собой произвольное выражение, зависящее от переменных @samp{x}, @samp{y}, @samp{z}, @samp{u}, @samp{v}, @samp{w}. Координаты @samp{x}, @samp{y}, @samp{z} полагаются меняющимися в диапазоне @var{Min} x @var{Max} (в отличие от функции @code{Modify}). Переменные @samp{i}, @samp{j}, @samp{k} равны значениям соответствующего индекса. При этом, используются нулевые значения для переменных, отвечающих отсутствующим размерностям. Переменная @samp{u} -- значения исходного массива, переменные @samp{v}, @samp{w} -- значения массивов @var{vdat}, @var{wdat}. Последние могут быть @code{NULL}, т.е. опущены. @end deftypefn @anchor{modify} @@ -511,7 +533,7 @@ Allocate memory and set data from variable argument list of @emph{double} values @deftypefnx {Функция С} @code{void} mgl_datac_modify (@code{HADT} dat, @code{const char *}eq, @code{int} dim) @deftypefnx {Функция С} @code{void} mgl_datac_modify_vw (@code{HADT} dat, @code{const char *}eq, @code{HCDT} v, @code{HCDT} w) @end ifclear -Аналогично предыдущему с координатами @samp{x}, @samp{y}, @samp{z}, меняющимися в диапазоне [0,1]. Если указан @var{dim}>0, то изменяются только слои >=@var{dim}. +Аналогично предыдущему с координатами @samp{x}, @samp{y}, @samp{z}, меняющимися в диапазоне [0,1]. Переменные @samp{i}, @samp{j}, @samp{k} равны значениям соответствующего индекса. При этом, используются нулевые значения для переменных, отвечающих отсутствующим размерностям. Если указан @var{dim}>0, то изменяются только слои >=@var{dim}. @end deftypefn @anchor{fillsample} @@ -598,6 +620,99 @@ Allocate memory and set data from variable argument list of @emph{double} values @end deftypefn + +@anchor{bernoulli} +@deftypefn {Команда MGL} {} bernoulli dat [@code{p=0.5}] +@ifclear UDAV +@deftypefnx {Метод класса @code{mglData}} @code{void} RndBernoulli (@code{mreal} p=0.5) +@deftypefnx {Функция С} @code{void} mgl_data_rnd_bernoulli (@code{HMDT} dat, @code{mreal} p) +@deftypefnx {Функция С} @code{mreal} mgl_rnd_bernoulli (@code{mreal} p) +@end ifclear +Заполняет массив случайными числами с распределением Бернулли вероятности @var{p}. +@end deftypefn + +@anchor{binomial} +@deftypefn {Команда MGL} {} binomial dat @code{n [p=0.5]} +@ifclear UDAV +@deftypefnx {Метод класса @code{mglData}} @code{void} RndBinomial (@code{long} n, @code{mreal} p=0.5) +@deftypefnx {Функция С} @code{void} mgl_data_rnd_binomial (@code{HMDT} dat, @code{long} n, @code{mreal} p) +@deftypefnx {Функция С} @code{mreal} mgl_rnd_binomial (@code{long} n, @code{mreal} p) +@end ifclear +Заполняет массив случайными числами с биномиальным распределением в @var{n} бросков с вероятностью @var{p}. +@end deftypefn + +@anchor{brownian} +@deftypefn {Команда MGL} {} brownian dat @code{y1 y2 sigma h} +@ifclear UDAV +@deftypefnx {Метод класса @code{mglData}} @code{void} RndBrownian (@code{mreal} y1, @code{mreal} y2, @code{mreal} sigma, @code{mreal} h) +@deftypefnx {Функция С} @code{void} mgl_data_rnd_brownian (@code{HMDT} dat, @code{mreal} y1, @code{mreal} y2, @code{mreal} sigma, @code{mreal} h) +@end ifclear +Заполняет массив случайным броуновским движением. +@end deftypefn + +@anchor{discrete} +@deftypefn {Команда MGL} {} discrete dat vdat +@ifclear UDAV +@deftypefnx {Метод класса @code{mglData}} @code{void} RndDiscrete (@code{const mglDataA &}vdat) +@deftypefnx {Функция С} @code{void} mgl_data_rnd_discrete (@code{HMDT} dat, @code{HCDT} vdat) +@deftypefnx {Функция С} @code{mreal} mgl_rnd_discrete (@code{HCDT} vdat) +@end ifclear +Заполняет массив случайными числами с дискретным распределением. +@end deftypefn + +@anchor{exponential} +@deftypefn {Команда MGL} {} exponential dat [@code{p}] +@ifclear UDAV +@deftypefnx {Метод класса @code{mglData}} @code{void} RndExponential (@code{mreal} p) +@deftypefnx {Функция С} @code{void} mgl_data_rnd_exponential (@code{HMDT} dat, @code{mreal} p) +@deftypefnx {Функция С} @code{mreal} mgl_rnd_exponential (@code{mreal} p) +@end ifclear +Заполняет массив случайными числами с экспоненциальным распределением масштаба @var{p}. +@end deftypefn + +@anchor{gaussian} +@deftypefn {Команда MGL} {} gaussian dat [@code{mu=0 sigma=1}] +@ifclear UDAV +@deftypefnx {Метод класса @code{mglData}} @code{void} RndGaussian (@code{mreal} mu=0, @code{mreal} sigma=1) +@deftypefnx {Функция С} @code{void} mgl_data_rnd_gaussian (@code{HMDT} dat, @code{mreal} mu, @code{mreal} sigma) +@deftypefnx {Функция С} @code{mreal} mgl_rnd_gaussian (@code{mreal} mu, @code{mreal} sigma) +@end ifclear +Заполняет массив случайными числами с гауссовым распределением со средним @var{mu} и масштабом @var{sigma}. +@end deftypefn + +@anchor{shuffle} +@deftypefn {Команда MGL} {} shuffle dat ['dir'='a'] +@ifclear UDAV +@deftypefnx {Метод класса @code{mglData}} @code{void} RndShuffle (@code{char} dir='a') +@deftypefnx {Функция С} @code{void} mgl_data_rnd_shuffle (@code{HMDT} dat, @code{char} dir) +@end ifclear +Перемешивает содержимое ячеек (для @var{dir}=@samp{a}) или срезов (для @var{dir}=@samp{xyz}). +@end deftypefn + +@anchor{uniform} +@deftypefn {Команда MGL} {} uniform dat @code{lo hi} +@ifclear UDAV +@deftypefnx {Метод класса @code{mglData}} @code{void} RndUniform (@code{mreal} lo, @code{mreal} hi) +@deftypefnx {Функция С} @code{void} mgl_data_rnd_uniform (@code{HMDT} dat, @code{mreal} lo, @code{mreal} hi) +@deftypefnx {Функция С} @code{mreal} mgl_rnd_uniform (@code{mreal} lo, @code{mreal} hi) +@end ifclear +Заполняет массив случайными числами с равномерным распределением в интервале (@var{lo},@var{hi}). +@end deftypefn + +@anchor{uniformint} +@deftypefn {Команда MGL} {} uniformint dat @code{lo hi} +@ifclear UDAV +@deftypefnx {Метод класса @code{mglData}} @code{void} RndInteger (@code{long} lo, @code{long} hi) +@deftypefnx {Функция С} @code{void} mgl_data_rnd_integer (@code{HMDT} dat, @code{long} lo, @code{mreal} hi) +@deftypefnx {Функция С} @code{long} mgl_rnd_integer (@code{long} lo, @code{long} hi) +@end ifclear +Заполняет массив случайными целыми числами с равномерным распределением в интервале [@var{lo},@var{hi}). +@end deftypefn + + + + + @c ------------------------------------------------------------------ @external{} @node File I/O, Make another data, Data filling, Data processing @@ -617,7 +732,7 @@ Allocate memory and set data from variable argument list of @emph{double} values @deftypefn {Команда MGL} {} read @sc{dat} 'fname' @deftypefnx {Команда MGL} {} read @sc{redat} @sc{imdat} 'fname' @ifclear UDAV -@deftypefnx {Метод класса @code{mglData}} @code{void} Read (@code{const char *}fname) +@deftypefnx {Метод класса @code{mglData}} @code{bool} Read (@code{const char *}fname) @deftypefnx {Метод класса @code{mglDataC}} @code{bool} Read (@code{const char *}fname) @deftypefnx {Функция С} @code{int} mgl_data_read (@code{HMDT} dat, @code{const char *}fname) @deftypefnx {Функция С} @code{int} mgl_datac_read (@code{HADT} dat, @code{const char *}fname) @@ -628,7 +743,7 @@ Allocate memory and set data from variable argument list of @emph{double} values @deftypefn {Команда MGL} {} read @sc{dat} 'fname' @code{mx [my=1 mz=1]} @deftypefnx {Команда MGL} {} read @sc{redat} @sc{imdat} 'fname' @code{mx [my=1 mz=1]} @ifclear UDAV -@deftypefnx {Метод класса @code{mglData}} @code{void} Read (@code{const char *}fname, @code{int} mx, @code{int} my=@code{1}, @code{int} mz=@code{1}) +@deftypefnx {Метод класса @code{mglData}} @code{bool} Read (@code{const char *}fname, @code{int} mx, @code{int} my=@code{1}, @code{int} mz=@code{1}) @deftypefnx {Метод класса @code{mglDataC}} @code{bool} Read (@code{const char *}fname, @code{int} mx, @code{int} my=@code{1}, @code{int} mz=@code{1}) @deftypefnx {Функция С} @code{int} mgl_data_read_dim (@code{HMDT} dat, @code{const char *}fname, @code{int} mx, @code{int} my, @code{int} mz) @deftypefnx {Функция С} @code{int} mgl_datac_read_dim (@code{HADT} dat, @code{const char *}fname, @code{int} mx, @code{int} my, @code{int} mz) @@ -639,7 +754,7 @@ Allocate memory and set data from variable argument list of @emph{double} values @anchor{readmat} @deftypefn {Команда MGL} {} readmat @sc{dat} 'fname' [@code{dim=2}] @ifclear UDAV -@deftypefnx {Метод класса @code{mglData}} @code{void} ReadMat (@code{const char *}fname, @code{int} dim=@code{2}) +@deftypefnx {Метод класса @code{mglData}} @code{bool} ReadMat (@code{const char *}fname, @code{int} dim=@code{2}) @deftypefnx {Метод класса @code{mglDataC}} @code{bool} ReadMat (@code{const char *}fname, @code{int} dim=@code{2}) @deftypefnx {Функция С} @code{int} mgl_data_read_mat (@code{HMDT} dat, @code{const char *}fname, @code{int} dim) @deftypefnx {Функция С} @code{int} mgl_datac_read_mat (@code{HADT} dat, @code{const char *}fname, @code{int} dim) @@ -650,8 +765,8 @@ Allocate memory and set data from variable argument list of @emph{double} values @anchor{readall} @deftypefn {Команда MGL} {} readall @sc{dat} 'templ' @code{v1 v2 [dv=1 slice=off]} @ifclear UDAV -@deftypefnx {Метод класса @code{mglData}} @code{void} ReadRange (@code{const char *}templ, @code{mreal} from, @code{mreal} to, @code{mreal} step=@code{1.f}, @code{bool} as_slice=@code{false}) -@deftypefnx {Метод класса @code{mglDataC}} @code{void} ReadRange (@code{const char *}templ, @code{mreal} from, @code{mreal} to, @code{mreal} step=@code{1}, @code{bool} as_slice=@code{false}) +@deftypefnx {Метод класса @code{mglData}} @code{bool} ReadRange (@code{const char *}templ, @code{mreal} from, @code{mreal} to, @code{mreal} step=@code{1.f}, @code{bool} as_slice=@code{false}) +@deftypefnx {Метод класса @code{mglDataC}} @code{bool} ReadRange (@code{const char *}templ, @code{mreal} from, @code{mreal} to, @code{mreal} step=@code{1}, @code{bool} as_slice=@code{false}) @deftypefnx {Функция С} @code{int} mgl_data_read_range (@code{HMDT} dat, @code{const char *}templ, @code{mreal} from, @code{mreal} to, @code{mreal} step, @code{int} as_slice) @deftypefnx {Функция С} @code{int} mgl_datac_read_range (@code{HADT} dat, @code{const char *}templ, @code{mreal} from, @code{mreal} to, @code{mreal} step, @code{int} as_slice) @end ifclear @@ -660,8 +775,8 @@ Allocate memory and set data from variable argument list of @emph{double} values @deftypefn {Команда MGL} {} readall @sc{dat} 'templ' @code{[slice=off]} @ifclear UDAV -@deftypefnx {Метод класса @code{mglData}} @code{void} ReadAll (@code{const char *}templ, @code{bool} as_slice=@code{false}) -@deftypefnx {Метод класса @code{mglDataC}} @code{void} ReadAll (@code{const char *}templ, @code{bool} as_slice=@code{false}) +@deftypefnx {Метод класса @code{mglData}} @code{bool} ReadAll (@code{const char *}templ, @code{bool} as_slice=@code{false}) +@deftypefnx {Метод класса @code{mglDataC}} @code{bool} ReadAll (@code{const char *}templ, @code{bool} as_slice=@code{false}) @deftypefnx {Функция С} @code{int} mgl_data_read_all (@code{HMDT} dat, @code{const char *}templ, @code{int} as_slice) @deftypefnx {Функция С} @code{int} mgl_datac_read_all (@code{HADT} dat, @code{const char *}templ, @code{int} as_slice) @end ifclear @@ -687,6 +802,10 @@ Allocate memory and set data from variable argument list of @emph{double} values Сохраняет весь массив данных при @var{ns}=@code{-1} или только @var{ns}-ый срез в текстовый файл. @end deftypefn +@deftypefn {Команда MGL} {} save @code{val} 'fname' +Сохраняет значение @var{val} в файл @var{fname}. +@end deftypefn + @deftypefn {Команда MGL} {} save 'str' 'fname' ['mode'='a'] Сохраняет строку @var{str} в файл @var{fname}. Для параметра @var{mode}=@samp{a} происходит добавление строки (по умолчанию): для @var{mode}=@samp{w} файл будет перезаписан. @sref{Saving and scanning file} @end deftypefn @@ -712,6 +831,15 @@ Allocate memory and set data from variable argument list of @emph{double} values Сохраняет массив под именем @var{dname} в HDF5 или HDF4 файл @var{fname}. Функция ничего не делает если библиотека была собрана без поддержки HDF5|HDF4. @end deftypefn +@deftypefn {Команда MGL} {} savehdf @code{val} 'fname' 'dname' [@code{rewrite}=@code{off}] +@ifclear UDAV +@deftypefnx {Функция С} @code{void} mgl_real_save_hdf (@code{real} val, @code{const char *}fname, @code{const char *}dname, @code{int} rewrite) +@deftypefnx {Функция С} @code{void} mgl_dual_save_hdf (@code{dual} val, @code{const char *}fname, @code{const char *}dname, @code{int} rewrite) +@deftypefnx {Функция С} @code{void} mgl_int_save_hdf (@code{long} val, @code{const char *}fname, @code{const char *}dname, @code{int} rewrite) +@end ifclear +Сохраняет значение @code{val} под именем @var{dname} в HDF5 файл @var{fname}. Функция ничего не делает если библиотека была собрана без поддержки HDF5. +@end deftypefn + @anchor{datas} @deftypefn {Команда MGL} {} datas 'fname' @ifclear UDAV @@ -754,6 +882,15 @@ Allocate memory and set data from variable argument list of @emph{double} values Сохраняет данные в растровый файл. Числовые значения, нормированные в диапазон [@var{v1}, @var{v2}], преобразуются в RGB значения пикселов, используя цветовую схему @var{sch} (@pxref{Color scheme}). Если @var{v1}>=@var{v2}, то значения @var{v1}, @var{v2} определяются автоматически как минимальное и максимальное значение данных. @end deftypefn +@anchor{readbin} +@deftypefn {Команда MGL} {} readbin dat 'fname' @code{type} +@ifclear UDAV +@deftypefnx {Метод класса @code{mglData}} @code{bool} ReadBin (@code{const char *}fname, @code{int} type) +@deftypefnx {Функция С} @code{int} mgl_data_read_bin (@code{HMDT} dat, @code{const char *}fname, @code{int} type) +@end ifclear +Читает данные из файла в бинарном формате. Параметр @var{type} задает тип данных в файле: 0 - double, 1 - float, 2 - long double, 3 - long int, 4 - int, 5 - short int, 6 - char. Внимание! Эту функцию не рекомендуется использовать с данными, сохраненными на других компьютерах из-за возможных проблем с бинарным представлением чисел. Предпочтительнее использовать HDF формат, см. @ref{readhdf}. +@end deftypefn + @c ------------------------------------------------------------------ @external{} @node Make another data, Data changing, File I/O, Data processing @@ -898,7 +1035,7 @@ Allocate memory and set data from variable argument list of @emph{double} values @deftypefnx {Функция С} @code{HMDT} mgl_data_hist (@code{HCDT} dat, @code{int} n, @code{mreal} v1, @code{mreal} v2, @code{int} nsub) @deftypefnx {Функция С} @code{HMDT} mgl_data_hist_w (@code{HCDT} dat, @code{HCDT} w, @code{int} n, @code{mreal} v1, @code{mreal} v2, @code{int} nsub) @end ifclear -Возвращает распределение (гистограмму) из @var{n} точек от значений массива в диапазоне [@var{v1}, @var{v2}]. Массив @var{w} задает веса элементов (по умолчанию все веса равны 1). Параметр @var{nsub} задает число дополнительных точек интерполяции (для сглаживания получившейся гистограммы). Функция возвращает NULL или пустой массив если данные не могут быть созданы при данных значениях аргументов. См. также @ref{Data manipulation} +Возвращает распределение (гистограмму) из @var{n} точек от значений массива в диапазоне [@var{v1}, @var{v2}]. Массив @var{w} задает веса элементов (по умолчанию все веса равны 1). Параметр @var{nsub} задает число дополнительных точек интерполяции (для сглаживания получившейся гистограммы). Если @var{nsub}<0, то используется линейная интерполяция вместо сплайнов. Функция возвращает NULL или пустой массив если данные не могут быть созданы при данных значениях аргументов. См. также @ref{Data manipulation} @end deftypefn @anchor{momentum} @@ -1027,6 +1164,33 @@ res_k = \sum_ij how(x_i,y_j,z_k) a_ij/ \sum_ij a_ij Находит параметры импульса вдоль направления @var{dir}: максимальное значение (в колонке 0), его положение (в колонке 1), ширина по параболлической аппроксимации (в колонке 3) и по полувысоте (в колонке 2), энергию около максимума (в колонке 4). NAN значения используются для ширин если максимум расположен вблизи границ массива. Отмечу, что для комплексных массивов есть неопределенность определения параметров. Обычно следует использовать квадрат абсолютного значения амплитуды (т.е. |dat[i]|^2). Поэтому MathGL не включает эту функцию в @code{mglDataC}, хотя формально C функция будет работать и для них, но будет использовать абсолютное значение амплитуды (т.е. |dat[i]|). Функция возвращает NULL или пустой массив если данные не могут быть созданы при данных значениях аргументов. См. также @ref{max}, @ref{min}, @ref{momentum}, @ref{sum}. @sref{Pulse properties} @end deftypefn +@anchor{first} +@deftypefn {Команда MGL} {} first @sc{res} dat 'dir' @code{val} +@ifclear UDAV +@deftypefnx {Метод класса @code{mglData}} @code{mglData} First (@code{const char *}dir, @code{mreal} val) @code{const} +@deftypefnx {Метод класса @code{mglDataC}} @code{mglData} First (@code{const char *}dir, @code{mreal} val) @code{const} +@deftypefnx {Функция С} @code{HMDT} mgl_data_first_dir (@code{HCDT} dat, @code{const char *}dir, @code{mreal} val) +@end ifclear +Возвращает массив положений ячеек со значениями впервые превысившими @var{val}. Для комплексных данных используется абсолютное значение. См. также @ref{last}. +@end deftypefn + +@anchor{last} +@deftypefn {Команда MGL} {} last @sc{res} dat 'dir' @code{val} +@ifclear UDAV +@deftypefnx {Метод класса @code{mglData}} @code{mglData} Last (@code{const char *}dir, @code{mreal} val) @code{const} +@deftypefnx {Метод класса @code{mglDataC}} @code{mglData} Last (@code{const char *}dir, @code{mreal} val) @code{const} +@deftypefnx {Функция С} @code{HMDT} mgl_data_last_dir (@code{HCDT} dat, @code{const char *}dir, @code{mreal} val) +@end ifclear +Возвращает массив положений ячеек со значениями последний раз превысившими @var{val}. Для комплексных данных используется абсолютное значение. См. также @ref{first}. +@end deftypefn + +@ifclear UDAV +@deftypefn {Функция С} @code{HMDT} mgl_formula_calc (@code{const char *}str, @code{long} n, ...) +@deftypefnx {Функция С} @code{HADT} mgl_formula_calc_c (@code{const char *}str, @code{long} n, ...) +Вычисляет формулу @var{str} для заданного списка из @var{n} массивов данных типа @code{HCDT}. Имена переменных соответствуют именам массивов. Возвращенный массив должен быть удален пользователем по окончании использования. См. также @ref{fill}. +@end deftypefn +@end ifclear + @c ------------------------------------------------------------------ @external{} @node Data changing, Interpolation, Make another data, Data processing @@ -1217,6 +1381,8 @@ These functions change the data in some direction like differentiations, integra @item @samp{d1}...@samp{d9} -- линейное усреднение по (2*N+1) точкам, @item +@samp{p1}...@samp{p9} -- параболличсеское усреднение по (2*N+1) точкам, +@item @samp{^} -- определение верхней границы, @item @samp{_} -- определение нижней границы. @@ -1283,6 +1449,18 @@ These functions change the data in some direction like differentiations, integra @end ifnottex @end deftypefn +@anchor{keep} +@deftypefn {Команда MGL} {} keep dat 'dir' @code{i [j=0]} +@ifclear UDAV +@deftypefnx {Метод класса @code{mglData}} @code{void} Keep (@code{const char *}dir, @code{long} i, @code{long} j=0) +@deftypefnx {Метод класса @code{mglDataC}} @code{void} Keep (@code{const char *}dir, @code{long} i, @code{long} j=0) +@deftypefnx {Функция С} @code{void} mgl_data_keep (@code{HMDT} dat, @code{const char *}dir, @code{long} i, @code{long} j) +@deftypefnx {Функция С} @code{void} mgl_datac_keep (@code{HADT} dat, @code{const char *}dir, @code{long} i, @code{long} j=0) +@end ifclear +Ограничивает изменение фазы/знака или амплитуды (если @var{dir} содержит @samp{a}) данных вдоль направления @var{dir} фиксируя значение в точке @{@var{i},@var{j}@} начального среза. Функция полезна для удаления общего набега фазы в комплексных данных. @sref{keep sample} +@end deftypefn + + @anchor{limit} @deftypefn {Команда MGL} {} limit dat @code{val} @ifclear UDAV @@ -1802,8 +1980,25 @@ These functions change the data in some direction like differentiations, integra @deftypefnx {Функция С} @code{HMDT} mgl_ode_solve_ex (@code{void (*}df@code{)(const mreal *x, mreal *dx, void *par)}, @code{int} n, @code{const mreal *}ini, @code{mreal} dt, @code{mreal} tmax, @code{void (*}bord@code{)(mreal *x, const mreal *xprev, void *par)}) @end ifclear Решает систему обыкновенных дифференциальных уравнений dx/dt = df(x). Функции @var{df} могут быть заданны строкой с разделенными ';' формулами (аргумент @var{var} задает символы для переменных x[i]) или указателем на функцию, которая заполняет @code{dx} по заданным значениям @code{x}. Параметры @var{ini}, @var{dt}, @var{tmax} задают начальные значения, шаг и максимальное время интегрирования. Функция обрывает расчет при появлении значений @code{NAN} или @code{INF}. Результат -- массив размером @{@var{n} * @var{Nt}@}, где @var{Nt} <= int(@var{tmax}/@var{dt}+1). + +Если @var{dt}*@var{tmax}<0, то включается регуляризация, при которой уравнение заменяется на dx/ds = df(x)/max(|df(x)|) для более аккуратного прохождения областей резкого изменения df и более быстрого расчета в области малых df. Здесь s -- новое "время". При этом реальное время определяется уравнением dt/ds=max(|df(x)|). Поэтому для вывода реального времени его следует явно добавить в уравнение, например @samp{ode res 'y;-sin(x);1' 'xyt' [3,0] 0.3 -100}. Оно также сохранит точность вблизи стационарных точек (т.е. при малых df в периодическом движении). +@end deftypefn + + +@deftypefn {Команда MGL} {} ode @sc{res} 'df' 'var' 'brd' ini [@code{dt=0.1 tmax=10}] +@ifclear UDAV +@deftypefnx {Общая функция} @code{mglData} mglODEs (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{const mglDataA &}ini, @code{mreal} dt=@code{0.1}, @code{mreal} tmax=@code{10}) +@deftypefnx {Общая функция} @code{mglDataC} mglODEcs (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{const mglDataA &}ini, @code{mreal} dt=@code{0.1}, @code{mreal} tmax=@code{10}) +@deftypefnx {Функция С} @code{HMDT} mgl_ode_solve_set (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{HCDT} ini, @code{mreal} dt, @code{mreal} tmax) +@deftypefnx {Функция С} @code{HADT} mgl_ode_solve_set_c (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{HCDT} ini, @code{mreal} dt, @code{mreal} tmax) +@end ifclear +Решает разностную аппроксимацию уравнений в частных производных как систему обыкновенных дифференциальных уравнений dx/dt = df(x,j). Функции @var{df} могут быть заданны строкой с разделенными ';' формулами, зависящими от индекса @var{j} и текущего времени @samp{t}. Аргумент @var{var} задает символы для переменных x[i]. Параметр @var{brd} задает тип граничных условий по @var{j}: @samp{0} или @samp{z} -- нулевые, @samp{1} или @samp{c} -- постоянные, @samp{2} или @samp{l} -- линейные (ноль лапласиана), @samp{3} или @samp{s} -- квадратичные, @samp{4} или @samp{e} -- экспоненциальные, @samp{5} или @samp{g} -- гауссовы. Последние два типа условий применимы только в случае комплексных переменных. Параметры @var{ini}, @var{dt}, @var{tmax} задают начальные значения, шаг и максимальное время интегрирования. Функция обрывает расчет при появлении значений @code{NAN} или @code{INF}. Результат -- массив размером @{@var{n} * @var{Nt}@}, где @var{Nt} <= int(@var{tmax}/@var{dt}+1). Например, разностная аппроксимация уравнения диффузии с нулевыми граничными условиями находится вызовом: @samp{ode res 'u(j+1)-2*u(j)+u(j-1)' 'u' '0' u0}, где @samp{u0} -- массив начальных значений. + +Если @var{dt}*@var{tmax}<0, то включается регуляризация, при которой уравнение заменяется на dx/ds = df(x)/max(|df(x)|) для более аккуратного прохождения областей резкого изменения df и более быстрого расчета в области малых df. Здесь s -- новое "время". При этом реальное время определяется уравнением dt/ds=max(|df(x)|). Поэтому для вывода реального времени его следует явно добавить в уравнение, например @samp{ode res 'y;-sin(x);1' 'xyt' [3,0] 0.3 -100}. Оно также сохранит точность вблизи стационарных точек (т.е. при малых df в периодическом движении). @end deftypefn + + @anchor{qo2d} @deftypefn {Команда MGL} {} qo2d @sc{res} 'ham' ini_re ini_im ray [@code{r=1 k0=100} xx yy] @ifclear UDAV diff --git a/texinfo/version.texi.in b/texinfo/version.texi.in index a97f477..5390441 100644 --- a/texinfo/version.texi.in +++ b/texinfo/version.texi.in @@ -1,4 +1,5 @@ -@set VERSION ${MathGL_VERSION_MAJOR}.${MathGL_VERSION_MINOR}.${MathGL_PATCH_VERSION} +@set VERSION ${MathGL_VERSION_MAJOR}.${MathGL_VERSION_MINOR} +@c @set VERSION ${MathGL_VERSION_MAJOR}.${MathGL_VERSION_MINOR}.${MathGL_PATCH_VERSION} @set MINVER @c @set MINVER .1 @set NIGHT ${MGL_NIGHT} diff --git a/texinfo/version_hist.txt b/texinfo/version_hist.txt index 9fecf1a..77540af 100644 --- a/texinfo/version_hist.txt +++ b/texinfo/version_hist.txt @@ -1,3 +1,6 @@ +2.5 Released 8 December 2021 +2.4.4 Released 8 July 2019 +2.4.3 Released 14 March 2019 2.4.2.1 Released 31 March 2018 2.4.2 Released 21 March 2018 2.4.1 Released 20 July 2017 diff --git a/texinfo/web_en.texi b/texinfo/web_en.texi index 20f336d..ed8cb60 100644 --- a/texinfo/web_en.texi +++ b/texinfo/web_en.texi @@ -53,6 +53,9 @@ Generally, MathGL is GPL library. However, you can use LGPL license for MathGL c @strong{Latest news} @itemize +@item @strong{8 December 2021.} +New version (v.2.5) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released. There are big improve in formula evaluation (user-defined function, summation and product, new functions for data interpolation), new plot kind @ref{dcont} and @ref{lines}, set of functions for random distributions, new data handling functions (like, @ref{keep}), extend @ref{ode} to solve PDE/cascade/etc, add mask for most of plotting functions and bugfixes, which denoted @ref{News, here}. + @item @strong{8 July 2019.} New version (v.2.4.4) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released. There are new @ref{minmax} for positions of local minimums and maximums, add @ref{conts} for coordinates of contour lines, extend formula evaluation to read and interpolate data files. @@ -77,6 +80,39 @@ Javascript interface was developed with support of @url{http://www.datadvance.ne @itemize +@item @strong{8 December 2021} +New version (v.2.5) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released. +@itemize @bullet + +@item Add functions @samp{sum}, @samp{prod} at formula evaluation, like @samp{sum(_i^2,5)} will produce @code{30=0+1^2+2^2+3^2+4^2}, and @samp{prod(1+_i,5)} will produce @code{120=5!}. You can nest them for variables @samp{_i},@samp{_j},...,@samp{_z}, like @samp{sum(sum(_j+_i^2,5),5)} will give @code{200}. +@item Add user-defined functions @samp{fn1()}...@samp{fn9()} at formula evaluation, like @samp{fn1(3)\x^_1} will produce @code{x^3}. +@item Add functions @samp{value}, @samp{spline} at formula evaluation, like @samp{value(a,5)} will give value of 6-th element of a, i.e. a[5]. +@item Add @ref{keep} for keeping the data phase/sign or value along line @var{i} and @var{j} in given direction +@item Add mglODEs() (i.e. extend @ref{ode}) for solving PDE, cascades and etc. +@item Add @ref{dcont} to draw a set of curves, which are intersection of two isosurfaces at given level. +@item Add @ref{lines} to draw a set of lines with arrows between points. +@item Add @ref{first}, @ref{last} to get array of first/last indexes of values larger specified one along given direction. +@item Add @ref{bernoulli}, @ref{binomial}, @ref{brownian}, @ref{discrete}, @ref{exponential}, @ref{gaussian}, @ref{shuffle}, @ref{uniform}, @ref{uniformint} for data filling by random numbers with different distributions. +@item Add @ref{readbin} to read data from binary files. +@item Add @ref{texparse} to enable/disable TeX-like command parsing at text output. +@item Update @ref{ode}: regularization is used if dt*tmax<0 (total time may differ, but number of steps still the same). +@item Add mgl_default_graph() -- the global (default) pointer to HMGL for keeping plot settings, simplifying external scripts and capture it in GUI. +@item Add style @samp{p} in command @ref{smooth} to use parabolic smoothing of arbitrary points. +@item Allow @ref{background} for scaling image, centering image and tessellate image as mosaic. +@item Allow filling @ref{background} by the specified color. +@item Allow masks for @ref{candle}, @ref{area}, @ref{region}, @ref{bars}, @ref{barh}, @ref{chart}, @ref{tape}, @ref{face}, @ref{polygon}, @ref{ellipse}, @ref{rhomb}. +@item Allow single value specification for contour level in @ref{cont}, @ref{contd}, @ref{contp}, @ref{contv}, @ref{cont3}, @ref{dcont}, @ref{tricont}. +@item Add mgl_dual_save_hdf(), mgl_real_save_hdf(), mgl_int_save_hdf() for saving single number in HDF5 file. Correspondingly, commands @ref{save} and @ref{savehdf} can save single value now. +@item Add mgl_formula_calc(), mgl_formula_calc_c() for evaluating textual formulas of arbitrary set of data arrays. +@item Add mglDataList -- global mglDataA* collection for viewing/changing in GUI data from external languages (like, Python, ...). +@item Add Armadillo interface for mglData and mglDataC. +@item If nsub parameter of command @ref{hist} is negative (nsub<0) then the linear interpolation is used instead of spline one. +@item Add dark text colors for mgllab. +@item Minor bugfixes. +@item OBSOLETE: Qt4 interface will be disabled in the next release. +@item OBSOLETE: Functions @ref{colorbar} will have extra argument @var{opt} for options, similarly to @ref{axis} and other plotting functions. In C++ and SWIG-based interfaces this change "masked" by providing the default value for the argument. +@end itemize + @item @strong{8 July 2019} New version (v.2.4.4) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released. @itemize @bullet @@ -308,12 +344,13 @@ You may download current version of MathGL for following configurations: @itemize @bullet @item @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.tar.gz, Source} file with cmake build system. -@item -@uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}-mingw.win32.7z,GPL} or @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.LGPL-mingw.win32.7z,LGPL} binaries for MinGW, 32-bit build for Pentium IV. +@c@item +@c @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}-mingw.win32.7z,GPL} or @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.LGPL-mingw.win32.7z,LGPL} binaries for MinGW, 32-bit build for Pentium IV. @item @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}-mingw.win64.7z,GPL} or @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.LGPL-mingw.win64.7z,LGPL} binaries for MinGW, 64-bit build. @item -MathGL utilities with all required DLL files for @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win32.7z,32-bit} and @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win64.7z,64-bit} versions of MS Windows. +@c MathGL utilities with all required DLL files for @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win32.7z,32-bit} and @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win64.7z,64-bit} versions of MS Windows. +MathGL utilities with all required DLL files for @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win64.7z,64-bit} versions of MS Windows. @item @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.eng.pdf,PDF} documentation in English. @item diff --git a/texinfo/web_ru.texi b/texinfo/web_ru.texi index 8accf24..30abbc3 100644 --- a/texinfo/web_ru.texi +++ b/texinfo/web_ru.texi @@ -53,6 +53,9 @@ Generally, MathGL is GPL library. However, you can use LGPL license for MathGL c @strong{Latest news} @itemize +@item @strong{8 December 2021.} +New version (v.2.5) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released. There are big improve in formula evaluation (user-defined function, summation and product, new functions for data interpolation), new plot kind @ref{dcont} and @ref{lines}, set of functions for random distributions, new data handling functions (like, @ref{keep}), extend @ref{ode} to solve PDE/cascade/etc, add mask for most of plotting functions and bugfixes, which denoted @ref{News, here}. + @item @strong{8 July 2019.} New version (v.2.4.4) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released. There are new @ref{minmax} for positions of local minimums and maximums, add @ref{conts} for coordinates of contour lines, extend formula evaluation to read and interpolate data files. @@ -77,6 +80,39 @@ Javascript interface was developed with support of @url{http://www.datadvance.ne @itemize +@item @strong{8 December 2021} +New version (v.2.5) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released. +@itemize @bullet + +@item Add functions @samp{sum}, @samp{prod} at formula evaluation, like @samp{sum(_i^2,5)} will produce @code{30=0+1^2+2^2+3^2+4^2}, and @samp{prod(1+_i,5)} will produce @code{120=5!}. You can nest them for variables @samp{_i},@samp{_j},...,@samp{_z}, like @samp{sum(sum(_j+_i^2,5),5)} will give @code{200}. +@item Add user-defined functions @samp{fn1()}...@samp{fn9()} at formula evaluation, like @samp{fn1(3)\x^_1} will produce @code{x^3}. +@item Add functions @samp{value}, @samp{spline} at formula evaluation, like @samp{value(a,5)} will give value of 6-th element of a, i.e. a[5]. +@item Add @ref{keep} for keeping the data phase/sign or value along line @var{i} and @var{j} in given direction +@item Add mglODEs() (i.e. extend @ref{ode}) for solving PDE, cascades and etc. +@item Add @ref{dcont} to draw a set of curves, which are intersection of two isosurfaces at given level. +@item Add @ref{lines} to draw a set of lines with arrows between points. +@item Add @ref{first}, @ref{last} to get array of first/last indexes of values larger specified one along given direction. +@item Add @ref{bernoulli}, @ref{binomial}, @ref{brownian}, @ref{discrete}, @ref{exponential}, @ref{gaussian}, @ref{shuffle}, @ref{uniform}, @ref{uniformint} for data filling by random numbers with different distributions. +@item Add @ref{readbin} to read data from binary files. +@item Add @ref{texparse} to enable/disable TeX-like command parsing at text output. +@item Update @ref{ode}: regularization is used if dt*tmax<0 (total time may differ, but number of steps still the same). +@item Add mgl_default_graph() -- the global (default) pointer to HMGL for keeping plot settings, simplifying external scripts and capture it in GUI. +@item Add style @samp{p} in command @ref{smooth} to use parabolic smoothing of arbitrary points. +@item Allow @ref{background} for scaling image, centering image and tessellate image as mosaic. +@item Allow filling @ref{background} by the specified color. +@item Allow masks for @ref{candle}, @ref{area}, @ref{region}, @ref{bars}, @ref{barh}, @ref{chart}, @ref{tape}, @ref{face}, @ref{polygon}, @ref{ellipse}, @ref{rhomb}. +@item Allow single value specification for contour level in @ref{cont}, @ref{contd}, @ref{contp}, @ref{contv}, @ref{cont3}, @ref{dcont}, @ref{tricont}. +@item Add mgl_dual_save_hdf(), mgl_real_save_hdf(), mgl_int_save_hdf() for saving single number in HDF5 file. Correspondingly, commands @ref{save} and @ref{savehdf} can save single value now. +@item Add mgl_formula_calc(), mgl_formula_calc_c() for evaluating textual formulas of arbitrary set of data arrays. +@item Add mglDataList -- global mglDataA* collection for viewing/changing in GUI data from external languages (like, Python, ...). +@item Add Armadillo interface for mglData and mglDataC. +@item If nsub parameter of command @ref{hist} is negative (nsub<0) then the linear interpolation is used instead of spline one. +@item Add dark text colors for mgllab. +@item Minor bugfixes. +@item OBSOLETE: Qt4 interface will be disabled in the next release. +@item OBSOLETE: Functions @ref{colorbar} will have extra argument @var{opt} for options, similarly to @ref{axis} and other plotting functions. In C++ and SWIG-based interfaces this change "masked" by providing the default value for the argument. +@end itemize + @item @strong{8 July 2019} New version (v.2.4.4) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released. @itemize @bullet @@ -308,12 +344,13 @@ You may download current version of MathGL for following configurations: @itemize @bullet @item @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.tar.gz, Source} file with cmake build system. -@item -@uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}-mingw.win32.7z,GPL} or @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.LGPL-mingw.win32.7z,LGPL} binaries for MinGW, 32-bit build for Pentium IV. +@c @item +@c @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}-mingw.win32.7z,GPL} or @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.LGPL-mingw.win32.7z,LGPL} binaries for MinGW, 32-bit build for Pentium IV. @item @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}-mingw.win64.7z,GPL} or @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.LGPL-mingw.win64.7z,LGPL} binaries for MinGW, 64-bit build. @item -MathGL utilities with all required DLL files for @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win32.7z,32-bit} and @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win64.7z,64-bit} versions of MS Windows. +@c MathGL utilities with all required DLL files for @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win32.7z,32-bit} and @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win64.7z,64-bit} versions of MS Windows. +MathGL utilities with all required DLL files for @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win64.7z,64-bit} versions of MS Windows. @item @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.eng.pdf,PDF} documentation in English. @item diff --git a/texinfo/widget_en.texi b/texinfo/widget_en.texi index 0414293..5de7340 100644 --- a/texinfo/widget_en.texi +++ b/texinfo/widget_en.texi @@ -58,6 +58,8 @@ Creates a FLTK-based window for plotting. Parameter @var{draw} sets a pointer to Creates a GLUT-based 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}. GLUT-based windows are fastest one but there is no toolbar, and plot have some issues due to OpenGL limitations. 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. + +Note, that you can terminate GLUT event loop by call @code{glutLeaveMainLoop()}. @end deftypefn @menu diff --git a/texinfo/widget_ru.texi b/texinfo/widget_ru.texi index ac1fe0a..8a8df80 100644 --- a/texinfo/widget_ru.texi +++ b/texinfo/widget_ru.texi @@ -59,6 +59,8 @@ public: Создает окно для вывода графика. Параметр @var{draw} -- указатель (имя) функции рисования. Есть возможность создания нескольких кадров вначале (требует больше памяти) и их быстрая анимации в дальнейшем. В этом случае функция @var{draw} должна возвращать число кадров или ноль для рисования по запросу. Замечу, что @var{draw} может быть равна @code{NULL} для отображения статической (текущей) картинки. Параметр @var{title} задает заголовок окна. Параметр @var{par} содержит указатель на данные, передаваемые функции рисования @var{draw}. Параметр @var{kind} может иметь следующие значения: @samp{0} -- использовать окно FLTK, @samp{1} -- использовать окно Qt. В окне просмотра можно использовать клавиши: 'a', 'd', 'w', 's' для вращения; ',', '.' для просмотра предыдущего и следующего кадров; 'r' для переключения прозрачности; 'f' для переключения оспещенности; 'x' для закрытия окна. + +Следует отметить, что цикл обработки сообщений GLUT можно остановить вызовом функции @code{glutLeaveMainLoop()}. @end deftypefn diff --git a/todo.txt b/todo.txt index c55f277..1c5bb7b 100644 --- a/todo.txt +++ b/todo.txt @@ -24,27 +24,40 @@ 12. \overline{\overline{a}} ??? 13. Use arrow_plot_3d ??? 14. Mask in SVG ??? +15. Add quadratic and cubic Bezier curves as primitives (update export to SVG/EPS + simplify some functions) ?!? +16. Bypass realloc() ??? +17. Add PGM|PPM export (see https://en.wikipedia.org/wiki/Netpbm_format) + +18. Chord diagram ??? +19. Dendrogram specified by string "{val, {lVal,{...},{...}}, {rVal,{...},{...}} }" with styles: 's' for hor/vert lines, or straight lines by default ??? +20. Voronoi diagram ??? -- triangulation + coloring by point + +18. Unicode/UTF8 in legend-option ? ============= NEW FEATURES ============= 1. Centered curved text (see text2) -2. Quality=3 for mirror+shadows? Couldn't be in bitmap only mode -4. "latex on" option ?!? -5. Add "text3d x y z lx ly lz nx ny nz 'txt' ['stl'='' depth=0.1 depth2=nan]" -6. Flag to determine discontinuous surfaces in 'fsurf' -7. Add PGM|PPM export (see https://en.wikipedia.org/wiki/Netpbm_format) -8. Check title & rasterize +2. Quality=3 for mirror+shadows + arrow_plot_3d? Could be in bitmap only mode +3. Add "text3d x y z lx ly lz nx ny nz 'txt' ['stl'='' depth=0.1 depth2=nan]" +4. Flag to determine discontinuous surfaces in 'fsurf' +5. mgl.cgi -- add log-file{IP,time,script}, add file-password (enable I/O if pass is the same as in a file) + +6. Recurrence plot u_{ij} = |a_i-a_j|