mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-12-25 18:11:38 +08:00
03031e3762
- NEW: improved plotting speed for line-graphs by a compression algorithm (see JKQTPGraphLinesCompressionMixin) that removes overlaying lines (e.g. in JKQTPXYLineGraph) - NEW: improved plotting speed for line-graphs by a clipping algorithm (applies to JKQTPXYLineGraph, JKQTPGraphErrorStyleMixin, JKQTPSpecialLineHorizontalGraph, JKQTPSpecialLineVerticalGraph and others) - NEW: improved plotting speed for scatter-graphs by not calling draw functions for symbols outside the plot window (e.g. in JKQTPXYLineGraph)
45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
#pragma once
|
|
#include <array>
|
|
#include <random>
|
|
#include <chrono>
|
|
#include <QList>
|
|
#include <QMenu>
|
|
#include <QActionGroup>
|
|
#include "jkqtplotter/jkqtplotter.h"
|
|
|
|
|
|
class JKQTPXYLineGraph; // forward
|
|
|
|
class SpeedTestPlot: public JKQTPlotter {
|
|
Q_OBJECT
|
|
protected:
|
|
std::array<double, 10000> X, Y, Y2;
|
|
double dx;
|
|
double x0;
|
|
size_t NDATA;
|
|
std::chrono::system_clock::time_point t_lastplot;
|
|
QAction* actAntiAliase;
|
|
QAction* actTwoGraphs;
|
|
QAction* actFixedXAxis;
|
|
QAction* actLines;
|
|
QAction* actSymbols;
|
|
QAction* actUseNonvisibleLineCompression;
|
|
QMenu* menuUseNonvisibleLineCompressionAgressiveness;
|
|
QAction* actUseClipping;
|
|
QAction* actAnimation;
|
|
QAction* actStepAnimation;
|
|
QMenu* menuSizes;
|
|
JKQTPXYLineGraph* graph;
|
|
JKQTPXYLineGraph* graph2;
|
|
QList<double> calctimes;
|
|
public:
|
|
SpeedTestPlot();
|
|
|
|
virtual ~SpeedTestPlot();
|
|
protected slots:
|
|
void plotNewData();
|
|
void updateDataSize(size_t newSize, bool updatePlots=true);
|
|
static double addOutlier(double prob, double height);
|
|
|
|
};
|