| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
There are set of “window” classes for making a window with MathGL graphics: mglGraphFLTK, mglGraphQT, mglGraphGLUT. All these classes allow user to show, rotate, export, and change view of the plot using keyboard. Most of them (except mglGraphGLUT) also have toolbar and menu for simplifying plot manipulation. Usually these classes (except mglGraphGLUT) are derived from mglGraphZB class and have a “connected” class for widget in corresponding window library. All window classes have the same set of functions (see section mglGraphAB class). Below the full list of classes with short comments.
Class mglGraphFLTK adds the possibility to create plotting window with the help of FLTK library. It allows one to show, rotate, export, and change view of the plot by keyboard, menu and toolbar. “Corresponding” widget class is Fl_MathGL. Class is defined in #include <mgl/mgl_fltk.h>.
Class is FLTK widget for displaying the MathGL output. Class is defined in #include <mgl/mgl_fltk.h>.
Example of FLTK window with MathGL plot.
Class mglGraphQT adds the possibility to create plotting window with the help of QT library. It allows one to show, rotate, export, and change view of the plot by keyboard, menu and toolbar. “Corresponding” widget class is QMathGL. Class is defined in #include <mgl/mgl_qt.h>.
Class is Qt widget for dysplaying the MathGL output. Class is defined in #include <mgl/mgl_qt.h>.
Example of Qt window with MathGL plot.
Class mglGraphGLUT adds the possibility to create plotting window with the help of GLUT library. It allows one to show, rotate, export, and change view of the plot only by keyboard. Class is defined in #include <mgl/mgl_glut.h>.
Example of GLUT window with MathGL plot.
| 5.1 Fl_MathGL class | ||
| 5.2 QMathGL class |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Class is FLTK widget which display MathGL graphics (defined in #include <mgl/mgl_fltk.h>).
void set_draw (mglDraw *dr)Sets drawing function from a class inherited from mglDraw.
void update (mglGraph *gr=NULL)Update (redraw) plot using grapher gr (built-in by default).
void set_angle (float t, float p)Set angles for additional plot rotation
void set_state (int f)Set bitwise flags for general state (1-Alpha, 2-Light)
void set_state (bool z, bool r)Set flags for handling mouse: z=true allow zooming, r=true allow rotation/shifting/perspective and so on.
void set_zoom (float X1, float Y1, float X2, float Y2)Set zoom in/out region
void get_zoom (float *X1, float *Y1, float *X2, float *Y2)Get zoom in/out region
void set_popup (const Fl_Menu_Item *pmenu, Fl_Widget *w, void *v)Set popup menu pointer
mglGraph * get_graph ()Get pointer to grapher
Fl_Valuator * tet_valPointer to external tet-angle validator.
Fl_Valuator * phi_valPointer to external phi-angle validator.
mglGraphAB * graphPointer to grapher
void * draw_parParameters for drawing function mglGraph::DrawFunc.
int (* draw_func )(mglGraph *gr, void *par)Drawing function for window procedure. It should return the number of frames.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Class is Qt widget which display MathGL graphics (defined in #include <mgl/mgl_qt.h>).
void setDraw (mglDraw *dr)Sets drawing functions from a class inherited from mglDraw.
void setDraw (int (*draw)(mglGraph *gr, void *p), void *par=NULL)Sets the drawing function draw. There is support of a list of plots (frames). So as one can prepare a set of frames at first and redraw it fast later (but it requires more memory). Function should return positive number of frames for the list or zero if it will plot directly. Parameter par contains pointer to data for the plotting function draw.
void setGraph (mglGraphAB *gr)Set pointer to external grapher (instead of built-in mglGraphZB). Note that QMathGL will automatically delete this object at destruction or at new setGraph() call.
void setPopup (QMenu *p)Set popup menu pointer.
void setSize (int w, int h)Set widget/picture sizes
double getRatio ()Return aspect ratio of the picture.
int getPer ()Get perspective value in percents.
int getPhi ()Get Phi-angle value in degrees.
int getTet ()Get Theta-angle value in degrees.
bool getAlpha ()Get transparency state.
bool getLight ()Get lightning state.
bool getZoom ()Get mouse zooming state.
bool getRotate ()Get mouse rotation state.
void refresh ()Redraw saved bitmap without executing drawing function.
void update (mglGraph *gr=NULL)Update picture by executing drawing function.
void copy ()Copy graphics to clipboard.
void setPer (int val)Set perspective value.
void setPhi (int val)Set Phi-angle value.
void setTet (int val)Set Theta-angle value.
void setAlpha (bool val)Switch on/off transparency.
void setLight (bool val)Switch on/off lightning.
void setZoom (bool val)Switch on/off mouse zooming.
void setRotate (bool val)Switch on/off mouse rotation.
void zoomIn ()Zoom in graphics.
void zoomOut ()Zoom out graphics.
void restore ()Restore zoom and rotation to default values.
void reload ()Reload data and redraw graphics.
void shiftLeft ()Shift graphics to left direction.
void shiftRight ()Shift graphics to right direction.
voidshiftUp ()Shift graphics to up direction.
void shiftDown ()Shift graphics to down direction.
void exportPNG (QString fname="")Export current picture to PNG file.
void exportPNGs (QString fname="")Export current picture to PNG file (no transparency).
void exportJPG (QString fname="")Export current picture to JPEG file.
void exportBPS (QString fname="")Export current picture to bitmap EPS file.
void exportEPS (QString fname="")Export current picture to vector EPS file.
void exportSVG (QString fname="")Export current picture to SVG file.
void exportIDTF (QString fname="")Export current picture to IDTF file.
void setMGLFont (QString path)Restore (path="") or load font for graphics.
void print ()Print current picture
void adjust ()Adjust plot size to fill entire window. This function is executed only if graph is mglGraphQT instance.
void nextSlide ()Show next slide. This function is executed only if graph is mglGraphQT instance.
void prevSlide ()Show previous slide. This function is executed only if graph is mglGraphQT instance.
void animation (bool st=true)Start animation. This function is executed only if graph is mglGraphQT instance.
void about ()Show about information.
void aboutQt ()Show information about Qt version.
void phiChanged (int val)Phi angle changed (by mouse or by toolbar).
void tetChanged (int val)Tet angle changed (by mouse or by toolbar).
void perChanged (int val)Perspective changed (by mouse or by toolbar).
void alphaChanged (bool val)Transparency changed (by toolbar).
void lightChanged (bool val)Lighting changed (by toolbar).
void zoomChanged (bool val)Zooming changed (by toolbar).
void rotateChanged (bool val)Rotation changed (by toolbar).
QString appNameApplication name for message boxes.
bool autoResizeAllow auto resizing (default is false).
int animDelayAnimation delay in ms.
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by Alexey Balakin on May 2, 2013 using texi2html 1.82.