git-svn-id: svn://db.shs.com.ru/libs@35 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2015-10-01 08:36:47 +00:00
parent fd7aad5149
commit 995ff5ab3b
4 changed files with 9 additions and 7 deletions

View File

@@ -461,7 +461,7 @@ void Graphic::setHistorySize(double val) {
double x; double x;
for (int i = 0; i < graphics.size(); ++i) { for (int i = 0; i < graphics.size(); ++i) {
QPolygonF & pol(graphics[i].polyline); QPolygonF & pol(graphics[i].polyline);
if (pol.isEmpty()) continue; if (pol.isEmpty() || history <= 0.) continue;
x = pol.back().x() - history; x = pol.back().x() - history;
for (int j = pol.size() - 2; j >= 0 ; --j) for (int j = pol.size() - 2; j >= 0 ; --j)
if (pol[j].x() < x) { if (pol[j].x() < x) {
@@ -1088,6 +1088,7 @@ void Graphic::tick(int index, bool slide, bool update_) {
if (slide) { if (slide) {
mutex.lock(); mutex.lock();
GraphicType & t(graphics[index]); GraphicType & t(graphics[index]);
if (history > 0.)
while (t.polyline.size() > 1) { while (t.polyline.size() > 1) {
if (fabs(t.polyline.back().x() - t.polyline.front().x()) <= history) break; if (fabs(t.polyline.back().x() - t.polyline.front().x()) <= history) break;
t.polyline.pop_front(); t.polyline.pop_front();

View File

@@ -198,6 +198,7 @@ public:
Graduation graduationY() const {return grad_y;} Graduation graduationY() const {return grad_y;}
double graduationStepX() const {return gridx;} double graduationStepX() const {return gridx;}
double graduationStepY() const {return gridy;} double graduationStepY() const {return gridy;}
QVector<QPointF> graphicData(const int index = 0) const {return graphics[index].polyline;}
GraphicsData graphicsData() const; GraphicsData graphicsData() const;
QWidget * viewport() const {return canvas;} QWidget * viewport() const {return canvas;}
QByteArray save(); QByteArray save();

View File

@@ -1,7 +1,7 @@
#ifndef UGLWIDGET_H #ifndef UGLWIDGET_H
#define UGLWIDGET_H #define UGLWIDGET_H
#include <QtOpenGL/QGLWidget> #include <QGLWidget>
#ifndef GL_MULTISAMPLE #ifndef GL_MULTISAMPLE
#define GL_MULTISAMPLE 0x809D #define GL_MULTISAMPLE 0x809D
#endif #endif

View File

@@ -1,7 +1,7 @@
#ifndef UWIDGET_H #ifndef UWIDGET_H
#define UWIDGET_H #define UWIDGET_H
#include <QtGui/QWidget> #include <QWidget>
#include <QPainter> #include <QPainter>
#include <QStyle> #include <QStyle>
#include <QStyleOption> #include <QStyleOption>