| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This class is derived from mglGraph class (see MathGL core). It is defined in #include <mgl2/window.h>. It provide methods for handling window with MathGL graphics. Similar classes are exist for each widget library: mglQT in #include <mgl2/qt.h>, mglFLTK in #include <mgl2/fltk.h>, mglWX in #include <mgl2/wx.h>.
mglWindow: mglWindow (const char *title="MathGL")mglWindow: mglWindow (int (*draw)(HMGL gr, void *p), const char *title="MathGL", void *par=NULL, int kind=0, void (*reload)(HMGL gr, void *p)=0)mglWindow: mglWindow (int (*draw)(mglGraph *gr), const char *title="MathGL", int kind=0)mglWindow: mglWindow (mglDraw *draw, const char *title="MathGL", int kind=0)HMGL mgl_create_graph_qt (int (*draw)(HMGL gr, void *p), const char *title, void *par, void (*reload)(HMGL gr, void *p))HMGL mgl_create_graph_fltk (int (*draw)(HMGL gr, void *p), const char *title, void *par, void (*reload)(HMGL gr, void *p))HMGL mgl_create_graph_glut (int (*draw)(HMGL gr, void *p), const char *title, void *par, void (*reload)(HMGL gr, void *p))Creates a window for plotting. Parameter draw sets a pointer to drawing function (this is the name of function) or instance of 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 draw can be NULL for displaying static bitmaps only (no animation or slides). Parameter title sets the title of the window. Parameter par contains pointer to data for the plotting function draw. Parameter kind may have following values: ‘0’ – use FLTK window, ‘1’ – use Qt window.
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.
mglWindow: int RunThr ()int mgl_fltk_thr ()Run main loop for event handling in separate thread. Note, right now it work for FLTK windows only.
mglWindow: int Run ()int mgl_qt_run ()int mgl_fltk_run ()Run main loop for event handling. Usually it should be called in a separate thread or as last function call in main().
mglWindow: void SetClickFunc (void (*func)(HMGL gr, void *p))void mgl_set_click_func (void (*func)(HMGL gr, void *p))Set callback function func which will be called on mouse click.
mglWindow: void ToggleAlpha ()void mgl_wnd_toggle_alpha (HMGL gr)Switch on/off transparency but do not overwrite switches in user drawing function.
mglWindow: void ToggleLight ()void mgl_wnd_toggle_light (HMGL gr)Switch on/off lighting but do not overwrite switches in user drawing function.
mglWindow: void ToggleRotate ()void mgl_wnd_toggle_rotate (HMGL gr)Switch on/off rotation by mouse. Usually, left button is used for rotation, middle button for shift, right button for zoom/perspective.
mglWindow: void ToggleZoom ()void mgl_wnd_toggle_zoom (HMGL gr)Switch on/off zooming by mouse. Just select rectangular region by mouse and it will be zoomed in.
mglWindow: void ToggleNo ()void mgl_wnd_toggle_no (HMGL gr)Switch off all zooming and rotation and restore initial state.
mglWindow: void Update ()void mgl_wnd_update (HMGL gr)Update window contents. This is very useful function for manual updating the plot while long calculation was running in parallel thread.
mglWindow: void ReLoad ()void mgl_wnd_reload (HMGL gr)Reload user data and update picture. This function also update number of frames which drawing function can create.
mglWindow: void Adjust ()void mgl_wnd_adjust (HMGL gr)Adjust size of bitmap to window size.
mglWindow: void NextFrame ()void mgl_wnd_next_frame (HMGL gr)Show next frame if one.
mglWindow: void PrevFrame ()void mgl_wnd_prev_frame (HMGL gr)Show previous frame if one.
mglWindow: void Animation ()void mgl_wnd_animation (HMGL gr)Run/stop slideshow (animation) of frames.
mglWindow: void SetDelay (double dt)void mgl_wnd_set_delay (HMGL gr, double dt)Sets delay for animation in seconds. Default value is 1 sec.
mglWindow: double GetDelay ()double mgl_wnd_get_delay (HMGL gr)Gets delay for animation in seconds.
mglWindow: void Setup (bool clfupd=true, bool showpos=false)void mgl_setup_window (HMGL gr, bool clfupd, bool showpos)Enable/disable flags for:
mglWindow: mglPoint LastMousePos ()void mgl_get_last_mouse_pos (HMGL gr, mreal *x, mreal *y, mreal *z)Gets last position of mouse click.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by Build Daemon user on December 22, 2013 using texi2html 1.82.