#include <graphpainter.h>

Classes | |
| struct | Text |
Public Types | |
| enum | SelectionMode { SelNone, SelPoint, SelAxis, SelPlane, TiltTracking } |
| Selections. | |
| enum | SelectionState { SelStart, SelFinish, Selecting } |
Public Member Functions | |
| XQGraphPainter (const shared_ptr< XGraph > &graph, XQGraph *item) | |
| void | selectObjs (int x, int y, SelectionState state, SelectionMode mode=SelNone) |
| void | wheel (int x, int y, double deg) |
| void | zoom (double zoomscale, int x, int y) |
| void | showHelp () |
| void | repaintGraph (int x1, int y1, int x2, int y2) |
| Repaint Off-screen obj, Paint On-screen obj. | |
| void | viewRotate (double angle, double x, double y, double z, bool init=false) |
| void | setColor (float r, float g, float b, float a=1.0f) |
| drawings | |
| void | setColor (unsigned int rgb, float a=1.0f) |
| void | setVertex (const XGraph::ScrPoint &p) |
| void | beginLine (double size=1.0) |
| void | endLine () |
| void | beginPoint (double size=1.0) |
| void | endPoint () |
| void | beginQuad (bool fill=false) |
| void | endQuad () |
| void | drawText (const XGraph::ScrPoint &p, const XString &str) |
| void | posOffAxis (const XGraph::ScrPoint &dir, XGraph::ScrPoint *src, XGraph::SFloat offset) |
| void | defaultFont () |
| int | selectFont (const XString &str, const XGraph::ScrPoint &start, const XGraph::ScrPoint &dir, const XGraph::ScrPoint &width, int sizehint=0) |
| float | resScreen () |
| minimum resolution of screen coordinate. | |
| void | initializeGL () |
| openGL stuff | |
| void | resizeGL (int width, int height) |
| void | paintGL () |
Private Member Functions | |
| int | windowToScreen (int x, int y, double z, XGraph::ScrPoint *scr) |
| int | screenToWindow (const XGraph::ScrPoint &scr, double *x, double *y, double *z) |
| double | selectPlane (int x, int y, int dx, int dy, XGraph::ScrPoint *scr, XGraph::ScrPoint *dsdx, XGraph::ScrPoint *dsdy) |
| double | selectAxis (int x, int y, int dx, int dy, XGraph::ScrPoint *scr, XGraph::ScrPoint *dsdx, XGraph::ScrPoint *dsdy) |
| double | selectPoint (int x, int y, int dx, int dy, XGraph::ScrPoint *scr, XGraph::ScrPoint *dsdx, XGraph::ScrPoint *dsdy) |
| void | onRedraw (const Snapshot &shot, XGraph *graph) |
| void | repaintBuffer (int x1, int y1, int x2, int y2) |
| void | redrawOffScreen () |
| Snapshot | startDrawing () |
| Draws plots, axes. | |
| void | drawOffScreenGrids (const Snapshot &shot) |
| void | drawOffScreenPlaneMarkers (const Snapshot &shot) |
| for selectGL() | |
| void | drawOffScreenPoints (const Snapshot &shot) |
| void | drawOffScreenAxes (const Snapshot &shot) |
| void | drawOffScreenAxisMarkers (const Snapshot &shot) |
| void | drawOnScreenObj (const Snapshot &shot) |
| depends on viewpoint | |
| void | drawOnScreenViewObj (const Snapshot &shot) |
| independent of viewpoint. For coordinate, legend, hints. title,... | |
| void | drawOnScreenHelp (const Snapshot &shot, QPainter *qpainter) |
| shared_ptr< XAxis > | findAxis (const Snapshot &shot, const XGraph::ScrPoint &s1) |
| shared_ptr< XPlot > | findPlane (const Snapshot &shot, const XGraph::ScrPoint &s1, shared_ptr< XAxis > *axis1, shared_ptr< XAxis > *axis2) |
| double | selectGL (int x, int y, int dx, int dy, GLint list, XGraph::ScrPoint *scr, XGraph::ScrPoint *dsdx, XGraph::ScrPoint *dsdy) |
| void | setInitView () |
| void | drawTextOverpaint (QPainter &qpainter) |
Private Attributes | |
| double | m_pixel_ratio |
| shared_ptr< XListener > | m_lsnRedraw |
| const shared_ptr< XGraph > | m_graph |
| XQGraph *const | m_pItem |
| shared_ptr< XPlot > | m_foundPlane |
| shared_ptr< XAxis > | m_foundPlaneAxis1 |
| shared_ptr< XAxis > | m_foundPlaneAxis2 |
| shared_ptr< XAxis > | m_foundAxis |
| SelectionState | m_selectionStateNow |
| SelectionMode | m_selectionModeNow |
| XGraph::ScrPoint | m_startScrPos |
| XGraph::ScrPoint | m_startScrDX |
| XGraph::ScrPoint | m_startScrDY |
| XGraph::ScrPoint | m_finishScrPos |
| XGraph::ScrPoint | m_finishScrDX |
| XGraph::ScrPoint | m_finishScrDY |
| XString | m_onScreenMsg |
| int | m_selStartPos [2] |
| int | m_tiltLastPos [2] |
| int | m_pointerLastPos [2] |
| GLint | m_listpoints |
| GLint | m_listaxes |
| GLint | m_listaxismarkers |
| GLint | m_listgrids |
| GLint | m_listplanemarkers |
| bool | m_bIsRedrawNeeded |
| bool | m_bIsAxisRedrawNeeded |
| bool | m_bTilted |
| bool | m_bReqHelp |
| GLdouble | m_proj_rot [16] |
| GLdouble | m_proj [16] |
| GLdouble | m_model [16] |
| GLint | m_viewport [4] |
| std::vector< GLubyte > | m_lastFrame |
| ghost stuff | |
| XTime | m_modifiedTime |
| XTime | m_updatedTime |
| int | m_curFontSize |
| int | m_curAlign |
| std::vector< Text > | m_textOverpaint |
| QRgb | m_curTextColor |
A painter which holds off-screen pixmap and provides a way to draw not thread-safe
Definition at line 26 of file graphpainter.h.
|
private |
for selectGL()
Definition at line 634 of file graphpainter.cpp.
References posOffAxis(), and setColor().
Referenced by paintGL().
| void XQGraphPainter::paintGL | ( | ) |
Definition at line 402 of file graphpaintergl.cpp.
References drawOffScreenAxisMarkers(), drawOffScreenPlaneMarkers(), drawOnScreenObj(), drawOnScreenViewObj(), m_lastFrame, and startDrawing().
| void XQGraphPainter::posOffAxis | ( | const XGraph::ScrPoint & | dir, |
| XGraph::ScrPoint * | src, | ||
| XGraph::SFloat | offset | ||
| ) |
make point outer perpendicular to dir by offset
| offset | > 0 for outer, < 0 for inner. unit is of screen coord. |
Definition at line 38 of file graphpainter.cpp.
References windowToScreen().
Referenced by drawOffScreenAxisMarkers(), and drawOnScreenObj().
|
private |
do as possible as you can without screen. e.g. compile primitives, or make pixmap.
Definition at line 120 of file graphpaintergl.cpp.
| int XQGraphPainter::selectFont | ( | const XString & | str, |
| const XGraph::ScrPoint & | start, | ||
| const XGraph::ScrPoint & | dir, | ||
| const XGraph::ScrPoint & | width, | ||
| int | sizehint = 0 |
||
| ) |
| start | where text be aligned |
| dir | a direction where text be aligned |
| width | perp. to dir, restricting font size |
Definition at line 165 of file graphpaintergl.cpp.
Referenced by drawOnScreenViewObj().
|
private |
Selections
| x,y | center of clipping area |
| dx,dy | clipping width,height |
| dz | window of depth |
| scr | hits |
| dsdx,dsdy | diff. of 1 pixel |
Definition at line 358 of file graphpaintergl.cpp.
| void XQGraphPainter::viewRotate | ( | double | angle, |
| double | x, | ||
| double | y, | ||
| double | z, | ||
| bool | init = false |
||
| ) |
view
| angle | CCW |
| x,y,z | rotate axis |
| init | initialize view matrix or not |
Definition at line 271 of file graphpaintergl.cpp.
Referenced by initializeGL().
|
private |
coordinate conversions zero for success
Definition at line 94 of file graphpaintergl.cpp.
Referenced by posOffAxis().
1.8.3