5.2 QMathGL class
Class is Qt widget which display MathGL graphics (defined in #include <mgl/mgl_qt.h>
).
- Method on QMathGL:
void
setDraw (mglDraw *
dr)
Sets drawing functions from a class inherited from mglDraw
.
- Method on QMathGL:
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.
- Method on QMathGL:
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.
- Method on QMathGL:
void
setPopup (QMenu *
p)
Set popup menu pointer.
- Method on QMathGL:
void
setSize (int
w, int
h)
Set widget/picture sizes
- Method on QMathGL:
double
getRatio ()
Return aspect ratio of the picture.
- Method on QMathGL:
int
getPer ()
Get perspective value in percents.
- Method on QMathGL:
int
getPhi ()
Get Phi-angle value in degrees.
- Method on QMathGL:
int
getTet ()
Get Theta-angle value in degrees.
- Method on QMathGL:
bool
getAlpha ()
Get transparency state.
- Method on QMathGL:
bool
getLight ()
Get lightning state.
- Method on QMathGL:
bool
getZoom ()
Get mouse zooming state.
- Method on QMathGL:
bool
getRotate ()
Get mouse rotation state.
- Slot on QMathGL:
void
refresh ()
Redraw saved bitmap without executing drawing function.
- Slot on QMathGL:
void
update (mglGraph *
gr=NULL
)
Update picture by executing drawing function.
- Slot on QMathGL:
void
copy ()
Copy graphics to clipboard.
- Slot on QMathGL:
void
setPer (int
val)
Set perspective value.
- Slot on QMathGL:
void
setPhi (int
val)
Set Phi-angle value.
- Slot on QMathGL:
void
setTet (int
val)
Set Theta-angle value.
- Slot on QMathGL:
void
setAlpha (bool
val)
Switch on/off transparency.
- Slot on QMathGL:
void
setLight (bool
val)
Switch on/off lightning.
- Slot on QMathGL:
void
setZoom (bool
val)
Switch on/off mouse zooming.
- Slot on QMathGL:
void
setRotate (bool
val)
Switch on/off mouse rotation.
- Slot on QMathGL:
void
zoomIn ()
Zoom in graphics.
- Slot on QMathGL:
void
zoomOut ()
Zoom out graphics.
- Slot on QMathGL:
void
restore ()
Restore zoom and rotation to default values.
- Slot on QMathGL:
void
reload ()
Reload data and redraw graphics.
- Slot on QMathGL:
void
shiftLeft ()
Shift graphics to left direction.
- Slot on QMathGL:
void
shiftRight ()
Shift graphics to right direction.
- Slot on QMathGL:
void
shiftUp ()
Shift graphics to up direction.
- Slot on QMathGL:
void
shiftDown ()
Shift graphics to down direction.
- Slot on QMathGL:
void
exportPNG (QString
fname=""
)
Export current picture to PNG file.
- Slot on QMathGL:
void
exportPNGs (QString
fname=""
)
Export current picture to PNG file (no transparency).
- Slot on QMathGL:
void
exportJPG (QString
fname=""
)
Export current picture to JPEG file.
- Slot on QMathGL:
void
exportBPS (QString
fname=""
)
Export current picture to bitmap EPS file.
- Slot on QMathGL:
void
exportEPS (QString
fname=""
)
Export current picture to vector EPS file.
- Slot on QMathGL:
void
exportSVG (QString
fname=""
)
Export current picture to SVG file.
- Slot on QMathGL:
void
exportIDTF (QString
fname=""
)
Export current picture to IDTF file.
- Slot on QMathGL:
void
setMGLFont (QString
path)
Restore (path=""
) or load font for graphics.
- Slot on QMathGL:
void
print ()
Print current picture
- Slot on QMathGL:
void
adjust ()
Adjust plot size to fill entire window. This function is executed only if graph is mglGraphQT instance.
- Slot on QMathGL:
void
nextSlide ()
Show next slide. This function is executed only if graph is mglGraphQT instance.
- Slot on QMathGL:
void
prevSlide ()
Show previous slide. This function is executed only if graph is mglGraphQT instance.
- Slot on QMathGL:
void
animation (bool
st=true
)
Start animation. This function is executed only if graph is mglGraphQT instance.
- Slot on QMathGL:
void
about ()
Show about information.
- Slot on QMathGL:
void
aboutQt ()
Show information about Qt version.
- Signal on QMathGL:
void
phiChanged (int
val)
Phi angle changed (by mouse or by toolbar).
- Signal on QMathGL:
void
tetChanged (int
val)
Tet angle changed (by mouse or by toolbar).
- Signal on QMathGL:
void
perChanged (int
val)
Perspective changed (by mouse or by toolbar).
- Signal on QMathGL:
void
alphaChanged (bool
val)
Transparency changed (by toolbar).
- Signal on QMathGL:
void
lightChanged (bool
val)
Lighting changed (by toolbar).
- Signal on QMathGL:
void
zoomChanged (bool
val)
Zooming changed (by toolbar).
- Signal on QMathGL:
void
rotateChanged (bool
val)
Rotation changed (by toolbar).
- Widget option of QMathGL:
QString
appName
Application name for message boxes.
- Widget option of QMathGL:
bool
autoResize
Allow auto resizing (default is false).
- Widget option of QMathGL:
int
animDelay
Animation delay in ms.