clean qad/graphic/graphic.cpp and qad/graphic/graphic.h
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
#include <QDebug>
|
||||
#include <QGridLayout>
|
||||
#include <QFileDialog>
|
||||
#include <QTime>
|
||||
#include <QElapsedTimer>
|
||||
#include <QTranslator>
|
||||
#include <QGestureEvent>
|
||||
#include <qmath.h>
|
||||
@@ -113,16 +113,12 @@ class QAD_EXPORT Graphic: public QFrame
|
||||
Q_PROPERTY(double graduationStepY READ graduationStepY WRITE setGraduationStepY)
|
||||
Q_PROPERTY(AxisType axisType READ axisType WRITE setAxisType)
|
||||
|
||||
Q_PROPERTY(int histogramMinIntervals READ histogramMinIntervals WRITE setHistogramMinIntervals)
|
||||
Q_PROPERTY(int histogramMaxIntervals READ histogramMaxIntervals WRITE setHistogramMaxIntervals)
|
||||
Q_PROPERTY(double histogramMinDeltaMultiplier READ histogramMinDeltaMultiplier WRITE setHistogramMinDeltaMultiplier)
|
||||
|
||||
Q_PROPERTY(Graphic::GraphicsData graphicsData READ graphicsData WRITE setGraphicsData)
|
||||
Q_PROPERTY(QByteArray graphicsDataRaw READ graphicsDataRaw WRITE setGraphicsDataRaw)
|
||||
|
||||
public:
|
||||
Graphic(QWidget * parent = 0);
|
||||
~Graphic();
|
||||
virtual ~Graphic();
|
||||
|
||||
typedef QVector<QVector<QPointF> > GraphicsData;
|
||||
enum GraphicAction {gaNone, gaZoomInRect, gaZoomRangeX, gaZoomRangeY, gaMove};
|
||||
@@ -196,9 +192,6 @@ public:
|
||||
QRectF limit() const {return limit_;}
|
||||
QRect margins() const {return margins_;}
|
||||
int minimumRepaintInterval() const {return min_repaint_int;}
|
||||
int histogramMinIntervals() const {return min_int;}
|
||||
int histogramMaxIntervals() const {return max_int;}
|
||||
double histogramMinDeltaMultiplier() const {return mdm;}
|
||||
double gridNumbersMultiplierX() const {return grid_numbers_x;}
|
||||
double gridNumbersMultiplierY() const {return grid_numbers_y;}
|
||||
Graduation graduationX() const {return grad_x;}
|
||||
@@ -212,17 +205,11 @@ public:
|
||||
QWidget * viewport() const {return canvas;}
|
||||
QByteArray save();
|
||||
void load(QByteArray ba);
|
||||
///void lock() {mutex_.lock();}
|
||||
///void unlock() {mutex_.unlock();}
|
||||
|
||||
///void reset() {mutex.lock(); clear(); mutex.unlock();}
|
||||
void reset() {clear();}
|
||||
|
||||
GraphicType graphic(int arg) {if (arg < 0 || arg >= graphics.size()) return GraphicType(); return graphics[arg];}
|
||||
const QVector<GraphicType> & allGraphics() const {return graphics;}
|
||||
void setAllGraphics(const QVector<GraphicType> & g, bool update = true) {graphics = g; if (update) updateLegend();}
|
||||
// void setHistogramData(const QVector<float> & g, int graphic);
|
||||
// void setHistogramData(const QVector<float> & g) {setHistogramData(g, curGraphic);}
|
||||
|
||||
double canvas2realX(double px) const;
|
||||
double canvas2realY(double py) const;
|
||||
@@ -295,9 +282,6 @@ public slots:
|
||||
void setOnlyExpandY(bool yes);
|
||||
void setOnlyExpandX(bool yes);
|
||||
void setGesturesNavigation(bool yes);
|
||||
void setHistogramMinIntervals(int value) {min_int = value; updateGraphics();}
|
||||
void setHistogramMaxIntervals(int value) {max_int = value; updateGraphics();}
|
||||
void setHistogramMinDeltaMultiplier(double value) {mdm = value; updateGraphics();}
|
||||
void setGraphicsData(const GraphicsData & gd);
|
||||
void setGraphicsDataRaw(const QByteArray & ba);
|
||||
|
||||
@@ -376,8 +360,6 @@ protected:
|
||||
|
||||
Ui::Graphic * ui;
|
||||
UGLWidget * canvas_gl;
|
||||
///QMutex mutex, mutex_;
|
||||
QDialog * fullscr_dialog;
|
||||
QWidget * canvas;
|
||||
QImage * buffer;
|
||||
QPainter * painter;
|
||||
@@ -387,7 +369,7 @@ protected:
|
||||
QVector<GraphicType> graphics;
|
||||
int curGraphic;
|
||||
GraphicAction curaction, prevaction;
|
||||
QRectF grect, rrect, selrect, limit_, def_rect;
|
||||
QRectF grect, selrect, limit_, def_rect;
|
||||
QRect margins_;
|
||||
QSize font_sz;
|
||||
QPoint startpos, curpos, prevpos, gridborder;
|
||||
@@ -397,15 +379,15 @@ protected:
|
||||
Graphic::Alignment align;
|
||||
GraphicConf * conf;
|
||||
EvalSpinBox line_x_min, line_x_max, line_y_min, line_y_max;
|
||||
QTime tm, tm_fscr;
|
||||
QElapsedTimer tm;
|
||||
QIcon icon_exp_x, icon_exp_y, icon_exp_sx, icon_exp_sy;
|
||||
QImage icon_pause_b, icon_pause_f;
|
||||
Graduation grad_x, grad_y;
|
||||
AxisType axis_type_x;
|
||||
double gridx, gridy, history, visible_time, inc_x, mdm, grid_numbers_x, grid_numbers_y, LN2, LN5, LN10;
|
||||
double gridx, gridy, history, visible_time, inc_x, grid_numbers_x, grid_numbers_y, LN10;
|
||||
double eminx, eminy, emaxx, emaxy, pause_phase, gesture_angle;
|
||||
int legy, lastw, lasth, min_repaint_int, min_int, max_int, timer_pause, thick;
|
||||
bool aalias, aupdate, mupdate, grid, guides, isFit, isEmpty, isOGL, isHover, bufferActive, cancel, pause_, isPrinting, gestures;
|
||||
int legy/*What is it?*/, lastw, lasth, min_repaint_int, timer_pause, thick;
|
||||
bool aalias, aupdate, grid, guides, isFit, isOGL, isHover, bufferActive, cancel, pause_, gestures;
|
||||
bool hasLblX, hasLblY, navigation, only_expand_y, only_expand_x, is_lines_update, leg_update, visible_update, fullscr, need_mouse_pan;
|
||||
|
||||
protected slots:
|
||||
@@ -424,7 +406,7 @@ protected slots:
|
||||
void lineYMinChanged(double value) {selrect.setBottom(value); checkLines();}
|
||||
void lineYMaxChanged(double value) {selrect.setTop(value); checkLines();}
|
||||
void on_buttonClose_clicked() {emit closeRequest(this);}
|
||||
void on_buttonClear_clicked() {reset(); emit cleared();}
|
||||
void on_buttonClear_clicked() {clear(); emit cleared();}
|
||||
void on_buttonAutofit_clicked();
|
||||
void on_buttonConfigure_clicked();
|
||||
void on_buttonFullscreen_clicked() {fullscreen();}
|
||||
|
||||
Reference in New Issue
Block a user