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

This commit is contained in:
2019-09-02 14:08:38 +00:00
parent f862381b68
commit 3d06d2095e
929 changed files with 66799 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
qad_project(graphic "Gui;Widgets;OpenGL" "qad_widgets;qad_utils;${OPENGL_LIBRARIES}")
if (graphic_UTILS)
add_subdirectory(qpicalculator)
endif()

1843
test/qad/graphic/graphic.cpp Normal file
View File

@@ -0,0 +1,1843 @@
#include "graphic.h"
#include "qad_types.h"
#include "uglwidget.h"
#include "ui_graphic.h"
#include "ui_graphic_conf.h"
#if QT_VERSION < 0x050000
# include <QTapAndHoldGesture>
# include <QPanGesture>
# include <QPinchGesture>
#endif
#ifndef Q_OS_ANDROID
# define HAS_GL
#endif
#ifdef HAS_GL
# ifndef GL_MULTISAMPLE
# define GL_MULTISAMPLE 0x809D
# endif
#endif
__GraphicRegistrator__ __graphic_registrator__;
Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this), line_x_max(this), line_y_min(this), line_y_max(this) {
QTranslator * trans = new QTranslator();
trans->load(":/lang/qad_graphic_" + QLocale::system().name().left(2));
if (trans->isEmpty())
trans->load("lang/qad_graphic_" + QLocale::system().name().left(2));
#if QT_VERSION >= 0x050000
if (!qApp->installTranslator(trans))
delete trans;
#else
qApp->installTranslator(trans);
#endif
gesture_angle = 45.;
leg_update = true;
visible_update = fullscr = need_mouse_pan = false;
gestures =
#ifdef Q_OS_ANDROID
true;
#else
false;
#endif
ui = new Ui::Graphic();
ui->setupUi(this);
/*line_x_min.resize(70, 22);
line_x_max.resize(70, 22);
line_y_min.resize(70, 22);
line_y_max.resize(70, 22);*/
line_x_min.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
line_x_max.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
((QBoxLayout * )ui->widgetLY->layout())->insertWidget(0, &line_y_min);
((QBoxLayout * )ui->widgetLY->layout())->addWidget(&line_y_max);
((QBoxLayout * )ui->widgetLX->layout())->insertWidget(0, &line_x_min);
((QBoxLayout * )ui->widgetLX->layout())->addWidget(&line_x_max);
tm.restart();
grid_numbers_x = grid_numbers_y = 1;
LN2 = qLn(2.);
LN5 = qLn(5.);
LN10 = qLn(10.);
line_x_min.setClearButtonVisible(true);
line_x_max.setClearButtonVisible(true);
line_y_min.setClearButtonVisible(true);
line_y_max.setClearButtonVisible(true);
connect(&line_x_min, SIGNAL(valueChanged(double)), this, SLOT(lineXMinChanged(double)));
connect(&line_x_max, SIGNAL(valueChanged(double)), this, SLOT(lineXMaxChanged(double)));
connect(&line_y_min, SIGNAL(valueChanged(double)), this, SLOT(lineYMinChanged(double)));
connect(&line_y_max, SIGNAL(valueChanged(double)), this, SLOT(lineYMaxChanged(double)));
connect(ui->canvas_raster, SIGNAL(paintEvent(QPaintEvent * )), this, SLOT(canvasPaintEvent()));
prepareCanvas(ui->canvas_raster);
#ifdef HAS_GL
canvas_gl = new UGLWidget();
ui->layoutCanvas->addWidget(canvas_gl);
connect(canvas_gl, SIGNAL(paintSignal()), this, SLOT(canvasPaintEvent()));
prepareCanvas(canvas_gl);
#endif
icon_exp_x = QIcon(":/icons/expand_x.png");
icon_exp_y = QIcon(":/icons/expand_y.png");
icon_exp_sx = QIcon(":/icons/expand_s_x.png");
icon_exp_sy = QIcon(":/icons/expand_s_y.png");
icon_pause_b = QImage(":/icons/pause-back.png");
icon_pause_f = QImage(":/icons/pause-front.png");
aupdate = grid = isFit = isEmpty = navigation = true;
aalias = mupdate = bufferActive = isOGL = cancel = isPrinting = guides = hasLblX = hasLblY = isHover = false;
pause_ = only_expand_x = only_expand_y = false;
//qDebug() << -DBL_MAX/2. << DBL_MAX/2. << DBL_MIN;
limit_.setCoords(-DBL_MAX, -DBL_MAX, DBL_MAX, DBL_MAX);
eminx = eminy = DBL_MAX;
emaxx = emaxy = DBL_MIN;
grad_x = grad_y = Auto;
axis_type_x = Numeric;
min_repaint_int = 25;
inc_x = 1.;
legy = 0;
buffer = 0;
gridx = gridy = 1.;
history = 5.;
min_int = 1;
max_int = 200;
mdm = 10.;
visible_time = -1.;
thick = lineThickness();
pause_phase = 0.;
def_rect.setRect(0., 0., 1., 1.);
selrect = def_rect;
margins_.setRect(4, 4, 4, 4);
curaction = gaMove;
selbrush.setStyle(Qt::SolidPattern);
selbrush.setColor(QColor(60, 175, 255, 100));
text_color = palette().color(QPalette::WindowText);
grid_pen = QPen(palette().color(QPalette::Disabled, QPalette::WindowText), 0., Qt::DotLine);
//graph_pen = QPen(Qt::red);
//graph_pen.setCosmetic(true);
graphics.append(GraphicType());
curGraphic = 0;
selpen = palette().color(QPalette::WindowText);
selpen.setStyle(Qt::DashLine);
back_color = palette().color(QPalette::Base);
buttons_ = AllButtons;
setOpenGL(false);
setButtonsPosition(Graphic::Left);
setAntialiasing(false);
setCaption("");
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
ui->layoutButtons->update();
updateLegend();
setRectToLines();
conf = new GraphicConf(graphics, this);
}
Graphic::~Graphic() {
delete conf;
if (buffer != 0) delete buffer;
}
void Graphic::changeEvent(QEvent * e) {
if (e->type() == QEvent::LanguageChange) {
ui->retranslateUi(this);
return;
}
QFrame::changeEvent(e);
}
void Graphic::resizeEvent(QResizeEvent *) {
if (leg_update) updateLegend(false);
}
void Graphic::timerEvent(QTimerEvent * ) {
pause_phase += 0.02;
if (pause_phase > 1.)
pause_phase -= 1.;
update();
}
bool Graphic::eventFilter(QObject * o, QEvent * e) {
//qDebug() << "event" << o << e;
if (o == canvas) {
switch (e->type()) {
case QEvent::Gesture:
if (!navigation || !gestures) break;
foreach (QGesture * g, ((QGestureEvent*)e)->gestures())
procGesture(g);
break;
case QEvent::KeyPress:
if (((QKeyEvent*)e)->key() == Qt::Key_Back)
leaveFullscreen();
break;
case QEvent::TouchBegin:
if (!navigation || !gestures) break;
need_mouse_pan = true;
break;
case QEvent::TouchUpdate: {
if (!navigation || !gestures) break;
QList<QTouchEvent::TouchPoint> tpl = ((QTouchEvent*)e)->touchPoints();
if (tpl.size() == 2) {
need_mouse_pan = false;
QPointF dp = tpl[0].scenePos() - tpl[1].scenePos();
gesture_angle = rad2deg_qpie * qAtan2(qAbs(dp.y()), qAbs(dp.x()));
}
} break;
default: break;
}
}
return QFrame::eventFilter(o, e);
}
void Graphic::prepareCanvas(QWidget * w) {
connect(w, SIGNAL(mouseMoveEvent(QMouseEvent * )), this, SLOT(canvasMouseMoveEvent(QMouseEvent * )));
connect(w, SIGNAL(mousePressEvent(QMouseEvent * )), this, SLOT(canvasMousePressEvent(QMouseEvent * )));
connect(w, SIGNAL(mouseReleaseEvent(QMouseEvent * )), this, SLOT(canvasMouseReleaseEvent(QMouseEvent * )));
connect(w, SIGNAL(mouseDoubleClickEvent(QMouseEvent*)), this, SLOT(canvasMouseDoubleClickEvent(QMouseEvent * )));
connect(w, SIGNAL(wheelEvent(QWheelEvent * )), this, SLOT(canvasWheelEvent(QWheelEvent * )));
connect(w, SIGNAL(leaveEvent(QEvent * )), this, SLOT(canvasLeaveEvent(QEvent * )));
connect(w, SIGNAL(keyPressEvent(QKeyEvent * )), this, SLOT(canvasKeyPressEvent(QKeyEvent * )));
//w->grabGesture(Qt::TapGesture);
w->grabGesture(Qt::TapAndHoldGesture);
w->grabGesture(Qt::PanGesture);
w->grabGesture(Qt::PinchGesture);
w->setMouseTracking(true);
w->installEventFilter(this);
}
void Graphic::procGesture(QGesture * g) {
if (!g) return;
switch (g->gestureType()) {
case Qt::PanGesture: {
if (need_mouse_pan) break;
QPanGesture * pg = (QPanGesture*)g;
QPointF dp = -pg->delta();
dp.rx() /= getScaleX();
dp.ry() /= getScaleY();
selrect.translate(dp);
totalUpdate();
} break;
case Qt::PinchGesture: {
QPinchGesture * pg = (QPinchGesture*)g;
//qDebug() << pg->totalRotationAngle();
Qt::KeyboardModifiers km = Qt::NoModifier;
if (gesture_angle <= 20.) km = Qt::ControlModifier;
if (gesture_angle >= 70.) km = Qt::ShiftModifier;
QPoint cp = pg->centerPoint().toPoint();
if (!fullscr) cp = mapFromGlobal(cp);
procZoom(cp, (pg->scaleFactor() - 1.) * 500., km);
totalUpdate();
} break;
case Qt::TapAndHoldGesture: {
QTapAndHoldGesture * pg = (QTapAndHoldGesture*)g;
if (pg->state() == Qt::GestureStarted)
fullscreen();
} break;
default:
qDebug() << g;
break;
}
//qDebug() << g;
}
void Graphic::procZoom(QPointF view_center, double dzoom, Qt::KeyboardModifiers km) {
double scl, wid = canvas->width() - gridborder.x() - margins_.width() - margins_.left(), hei = canvas->height() - gridborder.y() - margins_.height() - margins_.top();
double px = view_center.x() - gridborder.x() - margins_.left(), py = hei - view_center.y() + margins_.height();
px = px / wid * selrect.width() + selrect.x();
py = py / hei * selrect.height() + selrect.y();
scl = 1. - dzoom / 500.;
if (km == Qt::NoModifier)
selrect.setRect(px - (px - selrect.x()) * scl, py - (py - selrect.y()) * scl, selrect.width() * scl, selrect.height() * scl);
else {
if (km == Qt::ControlModifier)
selrect.setRect(px - (px - selrect.x()) * scl, selrect.y(), selrect.width() * scl, selrect.height());
if (km == Qt::ShiftModifier)
selrect.setRect(selrect.x(), py - (py - selrect.y()) * scl, selrect.width(), selrect.height() * scl);
}
}
void Graphic::totalUpdate() {
isFit = false;
emit visualRectChanged();
update(true);
setRectToLines();
}
void Graphic::canvasPaintEvent() {
if (is_lines_update) return;
//QMutexLocker ml(&mutex_);
//static int pwid = 0, phei = 0;
int wid = canvas->width(), hei = canvas->height();
lastw = wid;
lasth = hei;
font_sz = fontMetrics().size(0, "0");
font_sz.setHeight(font_sz.height() * 1.);
font_sz.setWidth(font_sz.width() * 8);
thick = lineThickness();
if (buffer != 0) if (buffer->width() != wid || buffer->height() != hei) {delete buffer; buffer = 0;}
if (buffer == 0) buffer = new QImage(wid, hei, QImage::Format_RGB32);
if (bufferActive) {
QPainter p(canvas);
p.drawImage(0, 0, *buffer);
painter = &p;
fp_size.clear();
if (curpos != startpos) drawAction();
drawGuides();
return;
}
//if (!aupdate && !mupdate && pwid == wid && phei == hei) return;
/*if (pwid != wid || phei != hei) {
line_x_min.move(0, hei - 35);
line_x_max.move(0, 0);
line_y_min.move(70, hei - line_x_min.height());
line_y_max.move(wid - line_y_max.width(), hei - line_x_min.height());
}
line_x_min.setVisible(grid);
line_x_max.setVisible(grid);
line_y_min.setVisible(grid);
line_y_max.setVisible(grid);*/
//pwid = wid;
//phei = hei;
QPainter p;
#ifdef HAS_GL
if (isOGL) {
p.fillRect(canvas->rect(), Qt::black);
glClearColor(0.f, 0.f, 0.f, 0.f);
p.begin(canvas);
} else
#endif
p.begin(buffer);
p.fillRect(canvas->rect(), back_color);
painter = &p;
p.setFont(font());
gridborder = QPoint(5, 5);
if (grid) {
gridborder += QPoint(font_sz.width(), font_sz.height());
if (hasLblY) gridborder += QPoint(font_sz.height(), 0);
if (hasLblX) gridborder += QPoint(0, font_sz.height());
}
painter->setClipping(true);
painter->setClipRect(QRect(gridborder.x(), 0, wid - gridborder.x(), hei - gridborder.y()));
emit beforeGraphicPaintEvent(painter);
painter->setClipping(false);
if (grid)
drawGrid();
p.setRenderHint(QPainter::Antialiasing, aalias);
#ifndef ANDROID
if (isOGL) {
if (aalias) glEnable(GL_MULTISAMPLE);
else glDisable(GL_MULTISAMPLE);
}
#endif
//p.setRenderHint(QPainter::HighQualityAntialiasing, aalias);
fp_size.clear();
if (!aalias) p.translate(-0.5, -0.5);
drawGraphics();
drawGuides();
if (pause_) drawPause();
emit graphicPaintEvent(painter);
p.end();
if (isOGL) return;
p.begin(canvas);
p.drawImage(0, 0, *buffer);
p.end();
}
void Graphic::canvasMouseMoveEvent(QMouseEvent * e) {
isHover = true;
curpos = e->pos();
curpos_r = canvas2real(curpos);
QPointF dp;
QString cursorstr = tr("Cursor: ") + pointCoords(curpos_r);
emit graphicMouseMoveEvent(curpos_r, e->buttons());
if (e->buttons() == Qt::NoButton) {
ui->status->setText(cursorstr);
if (guides) update();
return;
}
if (!navigation) return;
if (gestures) {
if (!need_mouse_pan) return;
curaction = gaMove;
} else
if (curaction != gaMove && (e->buttons() & Qt::RightButton) == Qt::RightButton) return;
switch (curaction) {
case gaZoomInRect:
ui->status->setText(tr("Selection") + ": " + pointCoords(startpos_r) + " -> " +
pointCoords(curpos_r) + ", " + tr("Size") + ": " + pointCoords(absPoint(curpos_r - startpos_r)));
repaintCanvas(true);
break;
case gaZoomRangeX:
ui->status->setText(tr("Range") + ": " + QString::number(startpos_r.x(), 'f', 3) +
" -> " + QString::number(curpos_r.x(), 'f', 3) + ", " + tr("Length") + ": " +
QString::number(qAbs(curpos_r.x() - startpos_r.x()), 'f', 3));
repaintCanvas(true);
break;
case gaZoomRangeY:
ui->status->setText(tr("Range") + ": " + QString::number(startpos_r.y(), 'f', 3) +
" -> " + QString::number(curpos_r.y(), 'f', 3) + ", " + tr("Length") + ": " +
QString::number(qAbs(curpos_r.y() - startpos_r.y()), 'f', 3));
repaintCanvas(true);
break;
case gaMove:
dp = e->pos() - prevpos;
dp.rx() *= selrect.width() / double(gridborder.x() + 5 - lastw);
dp.ry() *= selrect.height() / double(lasth - legy - gridborder.y() - 5);
if (e->modifiers() == Qt::ControlModifier)
dp.setY(0.);
if (e->modifiers() == Qt::ShiftModifier)
dp.setX(0.);
selrect.translate(dp);
totalUpdate();
break;
default: break;
}
prevpos = e->pos();
}
void Graphic::canvasMousePressEvent(QMouseEvent * e) {
emit graphicMousePressEvent(canvas2real(QPointF(e->pos())), e->buttons());
if (!navigation) return;
if (gestures && !need_mouse_pan) return;
#ifdef HAS_GL
canvas_gl->setCursor(guides ? Qt::BlankCursor : Qt::ArrowCursor);
#endif
ui->canvas_raster->setCursor(guides ? Qt::BlankCursor : Qt::ArrowCursor);
prevpos = e->pos();
startpos = prevpos;
startpos_r = canvas2real(startpos);
if (cancel || gestures) return;
if (e->button() == Qt::MidButton) curaction = gaMove;
if (e->button() == Qt::RightButton) {
if (bufferActive) {
curpos = startpos;
curpos_r = canvas2real(curpos);
repaintCanvas(true);
swapToNormal();
cancel = true;
return;
} else {
prevaction = curaction;
curaction = gaMove;
return;
}
}
if (e->button() == Qt::LeftButton) {
if (e->modifiers() == Qt::ControlModifier) curaction = gaZoomRangeX;
else if (e->modifiers() == Qt::ShiftModifier) curaction = gaZoomRangeY;
else curaction = gaZoomInRect;
switch (curaction) {
case gaZoomInRect:
case gaZoomRangeX:
case gaZoomRangeY:
swapToBuffer();
break;
default: break;
}
}
setCurrentAction(curaction);
}
void Graphic::canvasMouseReleaseEvent(QMouseEvent * e) {
emit graphicMouseReleaseEvent(canvas2real(QPointF(e->pos())), e->buttons());
if (gestures) return;
need_mouse_pan = false;
if (!navigation) return;
#ifdef HAS_GL
canvas_gl->setCursor(guides ? Qt::BlankCursor : Qt::ArrowCursor);
#endif
ui->canvas_raster->setCursor(guides ? Qt::BlankCursor : Qt::ArrowCursor);
QPointF tlp, brp;
QRect sr;
sr = QRect(startpos, curpos).normalized();
if (cancel) {
if (e->buttons() == Qt::NoButton) cancel = false;
return;
}
if (e->button() == Qt::RightButton && curaction == gaMove) {
curaction = prevaction;
return;
}
if (e->button() == Qt::LeftButton && (e->buttons() & Qt::RightButton) != Qt::RightButton) {
if (curpos != startpos) {
tlp = canvas2real(sr.topLeft());
brp = canvas2real(sr.bottomRight());
isFit = false;
switch (curaction) {
case gaZoomInRect:
if (sr.width() <= 1 || sr.height() <= 1) break;
selrect.setCoords(tlp.x(), brp.y(), brp.x(), tlp.y());
setRectToLines();
break;
case gaZoomRangeX:
if (sr.width() <= 1) break;
findGraphicsRect(tlp.x(), brp.x());
break;
case gaZoomRangeY:
if (sr.height() <= 1) break;
findGraphicsRect(0., 0., brp.y(), tlp.y());
break;
default: return;
}
}
swapToNormal();
update(true);
}
QPointF rp = canvas2real(QPointF(e->pos()));
ui->status->setText(tr("Cursor") + ": " + pointCoords(rp));
emit visualRectChanged();
}
void Graphic::canvasMouseDoubleClickEvent(QMouseEvent * ) {
autofit();
}
void Graphic::canvasWheelEvent(QWheelEvent * e) {
//if (curaction != gaMove) return;
emit graphicWheelEvent(canvas2real(QPointF(e->pos())), e->delta());
if (gestures) return;
if (!navigation) return;
procZoom(e->pos(), e->delta(), e->modifiers());
totalUpdate();
}
void Graphic::zoom(float factor) {
double wid = canvas->width() - gridborder.x() - margins_.width() - margins_.left(), hei = canvas->height() - gridborder.y() - margins_.height() - margins_.top();
double px = wid / 2, py = hei / 2;
px = px / wid * selrect.width() + selrect.x();
py = py / hei * selrect.height() + selrect.y();
selrect.setRect(px - (px - selrect.x()) * factor, py - (py - selrect.y()) * factor, selrect.width() * factor, selrect.height() * factor);
isFit = false;
update(true);
setRectToLines();
}
void Graphic::fullscreen() {
if (fullscr) leaveFullscreen();
else enterFullscreen();
}
void Graphic::canvasLeaveEvent(QEvent * ) {
isHover = false;
if (guides) update(true);
ui->status->setText(tr("Cursor") + ": ( ; )");
leaveFullscreen();
}
void Graphic::canvasKeyPressEvent(QKeyEvent * e) {
switch (e->key()) {
case Qt::Key_Escape: leaveFullscreen();
default: break;
};
}
void Graphic::clear() {
//cout << "clear" << endl;
for (int i = 0; i < graphics.size(); ++i) {
graphics[i].polyline.clear();
graphics[i].polyline_pause.clear();
graphics[i].max_x = 0.;
graphics[i].cvrect = QRectF();
}
if (isFit) on_buttonAutofit_clicked();
}
void Graphic::setAntialiasing(bool enabled) {
if (aalias == enabled) return;
aalias = enabled;
/*QGLFormat f = canvas_gl->format();
f.setSampleBuffers(enabled);
canvas_gl->setFormat(f);*/
update();
}
void Graphic::setPaused(bool yes) {
pause_ = yes;
ui->checkPause->blockSignals(true);
ui->checkPause->setChecked(yes);
ui->checkPause->blockSignals(false);
for (int i = 0; i < graphics.size(); ++i)
graphics[i].cvrect = QRectF();
if (!pause_) {
killTimer(timer_pause);
timer_pause = 0;
update(true);
return;
}
for (int i = 0; i < graphics.size(); ++i) {
graphics[i].polyline_pause = graphics[i].polyline;
graphics[i].polyline_pause.detach();
graphics[i].max_x_pause = graphics[i].max_x;
}
timer_pause = startTimer(40);
}
void Graphic::setHistorySize(double val) {
history = val;
double x;
for (int i = 0; i < graphics.size(); ++i) {
QPolygonF & pol(graphics[i].polyline);
if (pol.isEmpty() || history <= 0.) continue;
graphics[i].cvrect = QRectF();
x = pol.back().x() - history;
for (int j = pol.size() - 2; j >= 0 ; --j)
if (pol[j].x() < x) {
//qDebug() << pol.size() << j;
pol.erase(pol.begin(), pol.begin() + j);
break;
}
}
}
void Graphic::setOnlyExpandY(bool yes) {
only_expand_y = yes;
ui->checkExpandY->blockSignals(true);
ui->checkExpandY->setCheckable(yes);
ui->checkExpandY->blockSignals(false);
}
void Graphic::setOnlyExpandX(bool yes) {
only_expand_x = yes;
ui->checkExpandX->blockSignals(true);
ui->checkExpandX->setCheckable(yes);
ui->checkExpandX->blockSignals(false);
}
void Graphic::setGesturesNavigation(bool yes) {
gestures = yes;
}
Graphic::GraphicsData Graphic::graphicsData() const {
GraphicsData ret;
ret.resize(graphics.size());
for (int i = 0; i < graphics.size(); ++i)
ret[i] = graphics[i].polyline;
return ret;
}
QByteArray Graphic::graphicsDataRaw() const {
QByteArray ret;
QDataStream s(&ret, QIODevice::WriteOnly);
s << graphicsData();
return ret;
}
void Graphic::setGraphicsData(const Graphic::GraphicsData & gd) {
setGraphicsCount(gd.size());
for (int i = 0; i < gd.size(); ++i)
setGraphicData(gd[i], i, false);
updateGraphics();
}
void Graphic::setGraphicsDataRaw(const QByteArray & ba) {
if (ba.isEmpty()) {
clear();
return;
}
Graphic::GraphicsData gd;
QDataStream s(ba);
s >> gd;
setGraphicsData(gd);
}
void Graphic::setButtons(Graphic::Buttons b) {
buttons_ = b;
ui->buttonAutofit->setVisible(b.testFlag(Autofit));
ui->checkGrid->setVisible(b.testFlag(Grid));
ui->checkGuides->setVisible(b.testFlag(CursorAxis));
ui->checkExpandY->setVisible(b.testFlag(OnlyExpandY));
ui->checkExpandX->setVisible(b.testFlag(OnlyExpandX));
ui->buttonFullscreen->setVisible(b.testFlag(Fullscreen));
ui->checkBorderInputs->setVisible(b.testFlag(BorderInputs));
ui->checkLegend->setVisible(b.testFlag(Legend));
ui->buttonClear->setVisible(b.testFlag(Clear));
ui->buttonConfigure->setVisible(b.testFlag(Configure));
ui->buttonSave->setVisible(b.testFlag(Save));
ui->buttonClose->setVisible(b.testFlag(Close));
ui->checkPause->setVisible(b.testFlag(Pause));
if (ui->buttonAutofit->isVisible() || ui->checkGrid->isVisible() || ui->checkGuides->isVisible() ||
ui->buttonConfigure->isVisible() || ui->buttonSave->isVisible() || ui->checkPause->isVisible())
ui->verticalSpacer->changeSize(0, 30, QSizePolicy::Preferred, QSizePolicy::Preferred);
else
ui->verticalSpacer->changeSize(0, 0, QSizePolicy::Preferred, QSizePolicy::Preferred);
ui->layoutButtons->update();
}
void Graphic::setButtonsPosition(Graphic::Alignment a) {
align = a;
ui->widgetLeft->hide();
ui->widgetRight->hide();
switch (a) {
case Graphic::Left:
ui->widgetLeft->setLayout(ui->layoutButtons);
ui->widgetLeft->show();
break;
case Graphic::Right:
ui->widgetRight->setLayout(ui->layoutButtons);
ui->widgetRight->show();
break;
}
}
void Graphic::addPoint(const QPointF & p, int graphic, bool update_) {
if (graphic >= graphics.size() || graphic < 0) return;
GraphicType & t(graphics[graphic]);
if (!t.cvrect.isNull() && !pause_) {
// if (graphics[graphic].cvrect.contains(p))
// graphics[graphic].cvrect = QRectF();
if (t.cvrect.top() < p.y()) t.cvrect.setTop(p.y());
if (t.cvrect.bottom() > p.y()) t.cvrect.setBottom(p.y());
if (t.cvrect.right() < p.x()) t.cvrect.setRight(p.x());
if (t.cvrect.left() > p.x()) t.cvrect.setLeft(p.x());
}
if (t.polyline.size() == 0) t.max_x = p.x();
t.polyline << p;
if (t.max_x < p.x()) t.max_x = p.x();
tick(graphic, true, update_);
}
void Graphic::setGraphicData(const QVector<QPointF> & g, int graphic, bool update_) {
if (graphic >= graphics.size() || graphic < 0) return;
GraphicType & t(graphics[graphic]);
t.cvrect = QRectF();
t.polyline.clear();
t.polyline = g;
if (t.polyline.size() == 0) {
t.max_x = 0.;
tick(graphic, false, update_);
return;
}
t.max_x = t.polyline[0].x();
for (int i = 1; i < t.polyline.size(); ++i)
if (t.max_x < t.polyline[i].x())
t.max_x = t.polyline[i].x();
tick(graphic, false, update_);
}
void Graphic::setGraphicProperties(int graphic, const QString & name, const QColor& color, Qt::PenStyle style, double width, bool visible) {
if (graphic < 0 || graphic >= graphics.size()) return;
graphics[graphic].name = name;
graphics[graphic].pen.setColor(color);
graphics[graphic].pen.setStyle(style);
graphics[graphic].pen.setWidth(width);
graphics[graphic].visible = visible;
updateLegend();
}
void Graphic::addGraphic(const QString & name, const QColor & color, Qt::PenStyle style, double width, bool visible) {
graphics << GraphicType(name, color, style, width, visible);
updateLegend();
}
void Graphic::setVisualRect(const QRectF & rect) {
selrect = rect;
isFit = false;
update();
}
void Graphic::setDefaultRect(const QRectF & rect) {
def_rect = rect;
if (isFit) autofit();
}
void Graphic::saveImage() {
QString str = QFileDialog::getSaveFileName(this, tr("Save Image"), ppath, "PNG(*.png);;JPEG(*.jpg *.jpeg);;BMP(*.bmp);;TIFF(*.tiff *.tif);;PPM(*.ppm)");
if (str == "") return;
ppath = str;
QPixmap im(canvas->size());
mupdate = true;
canvas->render(&im);
mupdate = false;
im.save(ppath);
update(true);
}
void Graphic::setOpenGL(bool on) {
#ifdef HAS_GL
isOGL = on;
if (on) {
ui->canvas_raster->hide();
canvas_gl->show();
canvas = canvas_gl;
} else {
canvas_gl->hide();
ui->canvas_raster->show();
canvas = ui->canvas_raster;
}
#else
isOGL = false;
ui->canvas_raster->show();
canvas = ui->canvas_raster;
#endif
/*line_x_min.setParent(canvas);
line_x_max.setParent(canvas);
line_y_min.setParent(canvas);
line_y_max.setParent(canvas);
line_x_min.show();
line_x_max.show();
line_y_min.show();
line_y_max.show();*/
update();
}
void Graphic::update(bool force) {
mupdate = true;
repaintCanvas(force);
mupdate = false;
}
void Graphic::setGraphicsCount(int arg, bool update) {
if (arg < 0) return;
while (graphics.size() < arg)
graphics.append(GraphicType(tr("y(x)"), QColor::fromHsv((graphics.size() * 55) % 360, 255, 255 - qrand() % 115)));
while (graphics.size() > arg) {
delete graphics.back().pb;
graphics.pop_back();
}
if (update) updateLegend();
}
void Graphic::removeGraphic(int arg, bool update) {
if (arg < 0 || arg >= graphics.size()) return;
delete graphics[arg].pb;
graphics.remove(arg);
if (update) updateLegend();
}
/*void Graphic::setHistogramData(const QVector<float> & g, int graphic) {
graphics[graphic].polyline.clear();
if (g.isEmpty()) {
return;
}
QVector<float> data = g;
QVector<int> hist;
int ic = max_int, ci;
double md, cd, min, max, range, cx;
qSort(data);
md = DBL_MAX;
min = max = data[0];
for (int i = 1; i < data.size(); ++i) {
if (min > data[i]) min = data[i];
if (max < data[i]) max = data[i];
cd = qAbs<float>(data[i] - data[i - 1]);
if (md > cd && cd != 0.) md = cd;
}
range = max - min;
md = mdm;
//qDebug() << md << range << ic;
if (md != 0.)
ic = qRound(qMax<double>(qMin<double>(double(ic), range / md), double(min_int)));
md = range / ic;
hist.resize(ic);
foreach (const float & i, data) {
ci = qRound((i - min) / range * double(ic - 1));
//if (ci < 0) ci = 0;
//if (ci >= ic) ci = ic - 1;
hist[ci]++;
}
QPolygonF & cpol(graphics[graphic].polyline);
if (hist.size() == 1 || range == 0.) {
cpol << QPointF(min - 0.5, 0.) << QPointF(min - 0.25, 0.);
cpol << QPointF(min - 0.25, hist[0]) << QPointF(min + 0.25, hist[0]);
cpol << QPointF(min + 0.25, 0.) << QPointF(min + 0.5, 0.);
} else {
cpol << QPointF(min, 0.);
for (int i = 0; i < hist.size(); ++i) {
cx = i * range / ic + min;
cpol << QPointF(cx, hist[i]) << QPointF(cx + md, hist[i]);
}
cpol << QPointF(range + min, 0.);
}
updateGraphics();
}*/
void Graphic::findGraphicsRect(double start_x, double end_x, double start_y, double end_y) {
double cx, cy, maxX, minX, maxY, minY, vx;
bool isRangeX = (start_x != end_x), isRangeY = (start_y != end_y);
// bool isEmpty = true;
//bool fast = true;
bool can_fast = (start_x == 0 && end_x == 0 && start_y == 0 && end_y == 0);
bool anyVisible = false, isTimeLimit = (visible_time > 0.) && !(isRangeX || isRangeY);
bool force_find = (visible_time > 0.) && (history > 0.) && (visible_time < history);
if (force_find) can_fast = false;
// foreach (const GraphicType & t, graphics) {
// const QPolygonF & pol(pause_ ? t.polyline_pause : t.polyline);
// if (!pol.isEmpty()) {
// isEmpty = false;
// break;
// }
// }
// if (isEmpty) {
// grect = def_rect;
// setRectToLines();
// return;
// }
// can_fast = false;
vx = -DBL_MAX;
minY = minX = DBL_MAX;
maxY = maxX = -DBL_MAX;
foreach (const GraphicType & t, graphics) {
if (!t.visible) continue;
if (vx < (pause_ ? t.max_x_pause : t.max_x)) vx = (pause_ ? t.max_x_pause : t.max_x);
}
vx -= visible_time;
//qDebug() << "[Graphic]" << "can_fast" << can_fast;
for (int g = 0; g < graphics.size(); g++) {
GraphicType & t(graphics[g]);
if (!t.visible) continue;
const QPolygonF & pol(pause_ ? t.polyline_pause : t.polyline);
if (pol.isEmpty()) continue;
bool f = true;
//qDebug() << "[Graphic]" << "cvrect:" << t.cvrect << t.cvrect.isNull();
if (t.cvrect.isNull() || !can_fast) {
for (int i = 0; i < pol.size(); i++) {
cx = pol[i].x();
cy = pol[i].y();
if ((start_x > cx || end_x < cx) && isRangeX) continue;
if ((start_y > cy || end_y < cy) && isRangeY) continue;
if ((cx < vx) && isTimeLimit) continue;
if (f) {
t.cvrect.setRect(cx, cy, 0, 0);
f = false;
} else {
if (t.cvrect.top() < cy) t.cvrect.setTop(cy);
if (t.cvrect.bottom() > cy) t.cvrect.setBottom(cy);
if (t.cvrect.right() < cx) t.cvrect.setRight(cx);
if (t.cvrect.left() > cx) t.cvrect.setLeft(cx);
}
//fast = false;
}
if (f) continue;
//qDebug() << "[Graphic]" << "2 cvrect:" << t.cvrect;
}
anyVisible = true;
if (maxY < t.cvrect.top()) maxY = t.cvrect.top();
if (minY > t.cvrect.bottom()) minY = t.cvrect.bottom();
if (maxX < t.cvrect.right()) maxX = t.cvrect.right();
if (minX > t.cvrect.left()) minX = t.cvrect.left();
if (!can_fast) t.cvrect = QRectF();
}
if (!anyVisible) {
//qDebug() << "[Graphic]" << "empty autofit";
grect = def_rect;
setRectToLines();
return;
}
// if (fast) qDebug() << "[Graphic]" << "FAST autofit";
// else qDebug() << "[Graphic]" << "autofit";
if (maxX > limit_.right()) maxX = limit_.right();
if (minX > limit_.right()) minX = limit_.right();
if (minX < limit_.left()) minX = limit_.left();
if (maxX < limit_.left()) maxX = limit_.left();
if (maxY > limit_.bottom()) maxY = limit_.bottom();
if (minY > limit_.bottom()) minY = limit_.bottom();
if (minY < limit_.top()) minY = limit_.top();
if (maxY < limit_.top()) maxY = limit_.top();
if (minX > maxX) qSwap<double>(minX, maxX);
if (minY > maxY) qSwap<double>(minY, maxY);
if (qAbs<double>(minX - maxX) < 1E-60) {minX -= defaultRect().width()/2; maxX += defaultRect().width()/2;}
if (qAbs<double>(minY - maxY) < 1E-60) {minY -= defaultRect().height()/2; maxY += defaultRect().height()/2;}
if (only_expand_x) {
if (minX > eminx) minX = eminx;
if (maxX < emaxx) maxX = emaxx;
}
if (only_expand_y) {
if (minY > eminy) minY = eminy;
if (maxY < emaxy) maxY = emaxy;
}
eminx = minX; emaxx = maxX;
eminy = minY; emaxy = maxY;
if (isRangeX) selrect.setRect(start_x, minY, end_x - start_x, maxY - minY);
else if (isRangeY) selrect.setRect(minX, start_y, maxX - minX, end_y - start_y);
else grect.setRect(minX, minY, maxX - minX, maxY - minY);
grect = grect.normalized();
if (isFit)/* || isRangeX || isRangeY)*/ selrect = grect;
setRectToLines();
}
void Graphic::drawAction() {
//qDebug() << "draw action";
int wid = canvas->width(), hei = canvas->height() - gridborder.y(), sx = startpos.x(), sy = startpos.y(), cx = curpos.x(), cy = curpos.y();
painter->setPen(selpen);
painter->setBrush(selbrush);
switch (curaction) {
case gaZoomInRect: {
QSizeF rsz = QRectF(startpos_r, curpos_r).normalized().size();
painter->drawRect(QRect(startpos, curpos));
fp_size = " x " + pointCoords(QPointF(rsz.width(), rsz.height()));
} break;
case gaZoomRangeX:
painter->drawLine(sx, hei, sx, 0);
painter->drawLine(cx, hei, cx, 0);
painter->fillRect(sx, 0, cx - sx, hei, selbrush);
fp_size = " x " + pointCoords(QPointF(qAbs(startpos_r.x() - curpos_r.x()), 0.), true, false);
break;
case gaZoomRangeY:
painter->drawLine(gridborder.x(), sy, wid, sy);
painter->drawLine(gridborder.x(), cy, wid, cy);
painter->fillRect(gridborder.x(), sy, wid - gridborder.x(), cy - sy, selbrush);
fp_size = " x " + pointCoords(QPointF(0., qAbs(startpos_r.y() - curpos_r.y())), false, true);
break;
default: break;
}
}
void Graphic::drawGrid() {
int gbx = gridborder.x(), gby = gridborder.y(), cwid = canvas->width(), chei = canvas->height() - legy;
double px, py, range, step, start;
int wid = cwid - gbx - 5, hei = chei - gby - 5, cx, cy, cnt;
QRect rect;
QPair<QString, QString> str;
range = selrect.bottom() - selrect.top();
if (grad_y == Graphic::Auto) step = splitRange(range, hei / gridy / font_sz.height() / 1.4);
else step = gridy;//range / hei * gridy;
start = roundTo(canvas2realY(-hei), step) - step;
py = start + step;
cy = 0;
cx = gbx - 5;
grid_pen.setWidth(qMax<int>(qMax<int>(qRound(thick / 1.4), 1), grid_pen.width()));
QFont sf = font();
QFont nf = sf;
sf.setPointSizeF(qMax<qreal>(sf.pointSizeF() / 1.6, 7.));
QFontMetrics fm(nf), sfm(sf);
if (step > 0.) {
cnt = 1000;
while (cnt-- > 0) {
py -= step;
if (fabs(py) < step * .5) py = 0.;
cy = real2canvasY(py);
if (cy < 0) continue;
if (cy > hei + 5) break;
painter->setPen(grid_pen);
painter->drawLine(gbx, cy, cwid, cy);
str = gridMark(py * grid_numbers_y);
painter->setPen(text_color);
cy += font_sz.height() / 4.;
int dx = font_sz.height() / 8.;
if (!str.second.isEmpty()) {
rect = sfm.boundingRect(str.second);
painter->setFont(sf);
painter->drawText(cx - rect.width() - dx, cy - font_sz.height() / 2.5, str.second);
dx += rect.width() + font_sz.height() / 6.;
}
rect = fm.boundingRect(str.first);
painter->setFont(nf);
painter->drawText(cx - rect.width() - dx, cy, str.first);
}
}
cy = real2canvasY(0.);
if (cy >= 0 && cy <= (hei + 5)) {
QPen _p(grid_pen);
_p.setStyle(Qt::SolidLine);
painter->setPen(_p);
painter->drawLine(gbx, cy, cwid, cy);
}
if (hasLblY) {
painter->setPen(text_color);
painter->save();
painter->translate(5, hei);
painter->rotate(-90.);
painter->drawText(0, 0, hei, font_sz.height(), Qt::AlignCenter, label_y);
painter->restore();
}
cy = chei - font_sz.height() / 4;
if (hasLblX) cy -= font_sz.height();
range = selrect.right() - selrect.left();
QString df;
if (axis_type_x == Graphic::Numeric) {
if (grad_x == Graphic::Auto) step = splitRange(range, wid / gridx / font_sz.width() * 1.4);
else step = gridx;//range / wid * gridx;
start = roundTo(canvas2realX(wid), step) + step;
px = start + step;
if (step > 0.) {
cnt = 1000;
while (cnt-- > 0) {
px -= step;
if (fabs(px) < step * .5) px = 0.;
cx = real2canvasX(px);
if (cx > cwid) continue;
if (cx < gbx) break;
painter->setPen(grid_pen);
painter->drawLine(cx, hei + 5, cx, 0);
painter->setPen(text_color);
int dx = -font_sz.height() / 4.;
painter->setFont(nf);
str = gridMark(px * grid_numbers_x);
rect = fm.boundingRect(str.first);
painter->drawText(cx + dx, cy, str.first);
dx += rect.width() + font_sz.height() / 6.;
if (!str.second.isEmpty()) {
rect = sfm.boundingRect(str.second);
painter->setFont(sf);
painter->drawText(cx + dx, cy - font_sz.height() / 4., str.second);
}
}
}
cx = real2canvasX(0.);
if (cx <= cwid && cx >= gbx) {
QPen _p(grid_pen);
_p.setStyle(Qt::SolidLine);
painter->setPen(_p);
painter->drawLine(cx, hei + 5, cx, 0);
}
} else {
int cur_scl[7] = {0,0,0,0,0,0,0};
step = splitRangeDate(range, wid / gridx / font_sz.width() * 1.4, &df, cur_scl);
start = roundTo(canvas2realX(wid), step) + step;
px = start + step;
QDateTime cd = QDateTime::fromMSecsSinceEpoch(px * grid_numbers_x);
//qDebug() << "*** start" << cd << step;
roundDateTime(cd, cur_scl);
//qDebug() << "*** round" << cd;
addDateTime(cd, cur_scl);
//qDebug() << "*** add" << cd;
//qDebug() << "*** cur" << cur_scl[0] << cur_scl[1] << cur_scl[2] << cur_scl[3] << cur_scl[4] << cur_scl[5] << cur_scl[6];
if (step > 0.) {
cnt = 1000;
while (cnt-- > 0) {
addDateTime(cd, cur_scl, -1);
//roundDateTime(cd, cur_scl);
//qDebug() << "next" << cd;
cx = real2canvasX(cd.toMSecsSinceEpoch() / grid_numbers_x);
if (cx > cwid) continue;
if (cx < gbx) {/*qDebug() << cx << "<" << gbx;*/ break;}
painter->setPen(grid_pen);
painter->drawLine(cx, hei + 5, cx, 0);
painter->setPen(text_color);
int dx = -font_sz.height() / 4.;
painter->setFont(nf);
str.first = cd.toString(df);
painter->drawText(cx + dx, cy, str.first);
}
}
}
painter->setPen(text_color);
painter->setFont(nf);
if (hasLblX) {
painter->setPen(text_color);
painter->drawText(gbx, chei - font_sz.height(), wid, font_sz.height(), Qt::AlignCenter, label_x);
}
painter->setPen(QPen(grid_pen.color(), qMax<int>(thick, grid_pen.width())));
painter->drawRect(gbx, -1, wid + 6, hei + 6);
}
QPair<QString, QString> Graphic::gridMark(double v) const {
QPair<QString, QString> ret;
if ((qAbs(v) >= 1E+4 || qAbs(v) <= 1E-4) && v != 0.) {
int p = qFloor(qLn(qAbs(v)) / LN10);
v /= qPow(10., p);
if (v == 10.) {
v = 1.;
p += 1;
}
ret.first = QString::fromUtf8("%1·10").arg(v);
ret.second = QString::number(p);
} else
ret.first = QString::number(v);
return ret;
}
void Graphic::drawGraphics() {
if (isHover)
ui->status->setText(tr("Cursor: ") + pointCoords(canvas2real(QPointF(curpos))));
QPointF srp = -selrect.topLeft();
double sclx, scly, wid = canvas->width(), hei = canvas->height() - legy;
sclx = (wid - gridborder.x() - margins_.left() - margins_.width()) / selrect.width();
scly = (hei - gridborder.y() - margins_.top() - margins_.height()) / selrect.height();
painter->setClipping(true);
painter->setClipRect(QRect(gridborder.x(), 0, wid - gridborder.x(), hei - gridborder.y()));
painter->translate(gridborder.x() + margins_.left(), hei - gridborder.y() - margins_.top());
//if (isOGL && aalias) pen.setWidthF(1.5f);
painter->scale(sclx, -scly);
painter->translate(srp);
QTransform mat = painter->transform();
painter->resetTransform();
painter->setWorldMatrixEnabled(false);
QPolygonF cpol;
QPen pen;
for (int i = 0; i < graphics.size(); ++i) {
GraphicType & t(graphics[i]);
QPolygonF & rpol(pause_ ? t.polyline_pause : t.polyline);
if (t.visible && !rpol.isEmpty()) {
pen = t.pen;
if (qRound(pen.widthF()) == pen.widthF()) pen.setWidth(pen.width()*thick);
else pen.setWidthF(pen.widthF()*thick);
pen.setCosmetic(true);
if (t.lines) {
painter->setPen(pen);
if (t.fill) {
cpol = rpol;
painter->setBrush(t.fill_color);
//cpol.push_front(QPointF(cpol.front().x(), 0.));
//cpol.push_back(QPointF(cpol.back().x(), 0.));
painter->drawPolygon(mat.map(cpol));
} else
painter->drawPolyline(mat.map(rpol));
}
if (t.points) {
if (qRound(t.pointWidth) == t.pointWidth) pen.setWidth(qRound(t.pointWidth*thick));
else pen.setWidthF(t.pointWidth*thick);
painter->setPen(pen);
painter->drawPoints(mat.map(rpol));
}
}
}
painter->setWorldMatrixEnabled(true);
}
QString Graphic::pointCoords(QPointF point, bool x, bool y) {
QString ret = "(";
if (x) {
if (axis_type_x == Numeric)
ret += QString::number(point.x(), 'f', 3);
else
ret += QDateTime::fromMSecsSinceEpoch(point.x()).toString();
}
if (y) {
if (ret.size() > 1) ret += " ; ";
ret += QString::number(point.y(), 'f', 3);
}
ret += ")";
return ret;
}
void Graphic::drawGuides() {
if (!guides || !isHover) return;
int wid = canvas->width(), hei = canvas->height();
painter->setRenderHint(QPainter::Antialiasing, false);
painter->setPen(QPen(grid_pen.color(), qMax<int>(qRound(thick / 1.4), 1)));
painter->resetTransform();
painter->setClipping(true);
painter->setClipRect(QRect(gridborder.x(), 0, wid - gridborder.x(), hei - gridborder.y()));
painter->drawLine(0, curpos.y(), wid, curpos.y());
painter->drawLine(curpos.x(), 0, curpos.x(), hei);
QString str = pointCoords(canvas2real(curpos)) + fp_size;
QFontMetrics fm(font());
QRect r = fm.boundingRect(str);
QPoint p = curpos + QPoint(font_sz.height() / 4., -font_sz.height() / 4.);
if (r.width() + curpos.x() > wid - font_sz.height() / 2.) p.setX(curpos.x() - r.width() - font_sz.height() / 4.);
if (curpos.y() - r.height() < font_sz.height() / 8.) p.setY(curpos.y() + r.height() - font_sz.height() / 8.);
painter->setPen(text_color);
painter->drawText(p, str);
}
void Graphic::drawPause() {
painter->setClipping(false);
painter->save();
painter->resetMatrix();
painter->translate(canvas->width() - icon_pause_b.width() - 6, 6);
double o = (0.5 - pause_phase) * 2;
painter->setOpacity(o*o);
painter->drawImage(0, 0, icon_pause_b);
painter->setOpacity(1.);
painter->drawImage(0, 0, icon_pause_f);
painter->restore();
painter->setClipping(true);
}
double Graphic::splitRange(double range, int count) {
double digits, step, tln;
range = qAbs<double>(range);
tln = qFloor(qLn(range) / LN10);
for (int i = 0; i <= 5; ++i) {
digits = qPow(10., tln - i);
step = qRound(range / count / digits);
if (step > 0.) {
digits = qPow(10., tln - i - 1);
step = qRound(range / count / digits);
break;
}
}
double step5 = qRound(step / 5.) * 5., step10 = qRound(step / 10.) * 10.;
double err5 = qAbs<double>(step - step5), err10 = qAbs<double>(step - step10);
step = (err5 < err10 ? step5 : step10) * digits;
return step;
}
double Graphic::splitRangeDate(double range, int count, QString * format, int step[7]) {
double ret = splitRange(range, count);
//qDebug() << "ret =" << ret << getScaleX();
if (ret < 1000. * 1) {*format = "ss.zzz"; step[0] = ret;}
else if (ret < 1000. * 60) {*format = "h:m:ss"; step[1] = qRound(ret / 1000);}
else if (ret < 1000. * 60 * 60) {*format = "h:mm"; step[2] = qRound(ret / 1000 / 60);}
else if (ret < 1000. * 60 * 60 * 24) {*format = "dd(ddd) hh"; step[3] = qRound(ret / 1000 / 60 / 60);}
else if (ret < 1000. * 60 * 60 * 24 * 30) {*format = "MMM dd"; step[4] = qRound(ret / 1000 / 60 / 60 / 24);}
else if (ret < 1000. * 60 * 60 * 24 * 30 * 12) {*format = "yyyy MMM"; step[5] = qRound(ret / 1000 / 60 / 60 / 24 / 30);}
else {*format = "yyyy"; step[6] = qRound(ret / 1000 / 60 / 60 / 24 / 30 / 12);}
return ret;
}
double Graphic::roundTo(double value, double round_to) {
if (round_to == 0.) return value;
return qRound(value / round_to) * round_to;
}
void Graphic::roundDateTime(QDateTime & dt, int c[7]) {
QDate d(dt.date()); QTime t(dt.time());
//if (c[0] != 0) t.setHMS(t.hour(), t.minute(), t.second(), 0);
if (c[1] != 0) t.setHMS(t.hour(), t.minute(), t.second());
if (c[2] != 0) t.setHMS(t.hour(), t.minute(), 0);
if (c[3] != 0) t.setHMS(t.hour(), 0, 0);
if (c[4] != 0) {t.setHMS(0, 0, 0); d.setDate(d.year(), d.month(), d.day());}
if (c[5] != 0) {t.setHMS(0, 0, 0); d.setDate(d.year(), d.month(), 1);}
if (c[6] != 0) {t.setHMS(0, 0, 0); d.setDate(d.year(), 1, 1);}
dt = QDateTime(d, t);
}
void Graphic::addDateTime(QDateTime & dt, int c[7], int mul) {
if (c[0] != 0) dt = dt.addMSecs(mul * c[0]);
if (c[1] != 0) dt = dt.addSecs(mul * c[1]);
if (c[2] != 0) dt = dt.addSecs(mul * c[2] * 60);
if (c[3] != 0) dt = dt.addSecs(mul * c[3] * 60 * 60);
if (c[4] != 0) dt = dt.addDays(mul * c[4]);
if (c[5] != 0) dt = dt.addMonths(mul * c[5]);
if (c[6] != 0) dt = dt.addYears(mul * c[6]);
}
double Graphic::canvas2realX(double px) const {
int gbx = gridborder.x() + margins_.left(), cwid = lastw, wid = cwid - gbx - margins_.width();
double cx = px - gbx, sclx = selrect.width() / (double)wid;
return cx * sclx + selrect.x();
}
double Graphic::canvas2realY(double py) const {
int gby = gridborder.y() + margins_.top(), chei = lasth - legy, hei = chei - gby - margins_.height();
double cy = chei - py - gby, scly = selrect.height() / (double)hei;
return cy * scly + selrect.y();
}
double Graphic::real2canvasX(double px) const {
int gbx = gridborder.x() + margins_.left(), cwid = lastw, wid = cwid - gbx - margins_.width();
double sclx = selrect.width() / (double)wid;
return (px - selrect.x()) / sclx + gbx;
}
double Graphic::real2canvasY(double py) const {
int gby = gridborder.y() + margins_.top(), chei = lasth - legy, hei = chei - gby - margins_.height();
double scly = selrect.height() / (double)hei;
return chei - gby - (py - selrect.y()) / scly;
}
QPolygonF Graphic::real2canvas(const QPolygonF & real_polygon) const {
QPolygonF ret;
for (int i=0; i<real_polygon.size(); ++i)
ret << real2canvas(real_polygon[i]);
return ret;
}
QPolygonF Graphic::canvas2real(const QPolygonF & canvas_polygon) const {
QPolygonF ret;
for (int i=0; i<canvas_polygon.size(); ++i)
ret << canvas2real(canvas_polygon[i]);
return ret;
}
void Graphic::setCurrentAction(GraphicAction action) {
curaction = action;
switch (action) {
case gaNone:
if (guides) setCanvasCursor(Qt::BlankCursor);
else setCanvasCursor(Qt::ArrowCursor);
break;
case gaZoomInRect:
setCanvasCursor(Qt::CrossCursor);
break;
case gaZoomRangeX:
setCanvasCursor(Qt::SplitHCursor);
break;
case gaZoomRangeY:
setCanvasCursor(Qt::SplitVCursor);
break;
case gaMove:
setCanvasCursor(Qt::SizeAllCursor);
break;
}
}
void Graphic::setCanvasCursor(QCursor cursor) {
ui->canvas_raster->setCursor(cursor);
#ifdef HAS_GL
canvas_gl->setCursor(cursor);
#endif
}
void Graphic::swapToBuffer() {
QImage timg;
//qDebug() << "render start";
#ifdef HAS_GL
if (isOGL) {
timg = canvas_gl->grabFrameBuffer();
QPainter p(buffer);
p.drawImage(0, 0, timg);
p.end();
}
#endif
//qDebug() << "render finish";
bufferActive = true;
}
void Graphic::setRectToLines() {
is_lines_update = true;
//line_x_min.is_auto = line_x_max.is_auto = line_y_min.is_auto = line_y_max.is_auto = true;
//qDebug() << "set to lines" << selrect;
//line_x_min.is_reset = line_x_max.is_reset = line_y_min.is_reset = line_y_max.is_reset = isFit;
if (line_x_min.isVisible() && line_x_max.isVisible() && line_y_min.isVisible() && line_y_max.isVisible()) {
line_x_min.blockSignals(true); line_x_max.blockSignals(true); line_y_min.blockSignals(true); line_y_max.blockSignals(true);
if (!line_x_min.hasFocus()) {
if (isFit) line_x_min.setValue(grect.left());
else line_x_min.setValue(selrect.left());
}
if (!line_x_max.hasFocus()) {
if(isFit) line_x_max.setValue(grect.right());
else line_x_max.setValue(selrect.right());
}
if (!line_y_min.hasFocus()) {
if(isFit) line_y_min.setValue(grect.bottom());
else line_y_min.setValue(selrect.bottom());
}
if (!line_y_max.hasFocus()) {
if(isFit) line_y_max.setValue(grect.top());
else line_y_max.setValue(selrect.top());
}
line_x_min.setDefaultText(QString::number(grect.left()).toUpper());
line_x_max.setDefaultText(QString::number(grect.right()).toUpper());
line_y_min.setDefaultText(QString::number(grect.bottom()).toUpper());
line_y_max.setDefaultText(QString::number(grect.top()).toUpper());
line_x_min.blockSignals(false); line_x_max.blockSignals(false); line_y_min.blockSignals(false); line_y_max.blockSignals(false);
// if(isFit) {
// line_y_min.setValue(grect.left());
// line_y_max.setValue(grect.left());
// }
}
//line_x_min.is_auto = line_x_max.is_auto = line_y_min.is_auto = line_y_max.is_auto = false;
is_lines_update = false;
}
void Graphic::checkLines() {
isFit = (line_x_min.isCleared() && line_x_max.isCleared() && line_y_min.isCleared() && line_y_max.isCleared());
update(true);
}
void Graphic::tick(int index, bool slide, bool update_) {
if (slide) {
///mutex.lock();
GraphicType & t(graphics[index]);
if (history > 0.)
while (t.polyline.size() > 1) {
if (fabs(t.polyline.back().x() - t.polyline.front().x()) <= history) break;
/// TODO: [Graphic] fast autofit while addPoint(double y, ...)
if (!t.cvrect.isNull()) {
QPointF fp(t.polyline.first());
if (qFuzzyCompare(t.cvrect.left(), fp.x()) ||
qFuzzyCompare(t.cvrect.right(), fp.x()) ||
qFuzzyCompare(t.cvrect.top(), fp.y()) ||
qFuzzyCompare(t.cvrect.bottom(), fp.y())) {
t.cvrect = QRectF();
}
}
t.polyline.pop_front();
}
}
if (!update_) {
if (isFit) findGraphicsRect();
///mutex.unlock();
return;
}
//polyline.push_back(QPointF(brick->time_, brick->output(port)));
//cout << polyline.size() << endl;
if (isFit) findGraphicsRect();
if (!slide) {
if (aupdate) update();
return;
}
///mutex.unlock();
if (aupdate) update();
}
void Graphic::on_buttonAutofit_clicked() {
isFit = true;
bool isEmpty = true;
foreach (const GraphicType & t, graphics) {
const QPolygonF & pol(pause_ ? t.polyline_pause : t.polyline);
if (!pol.isEmpty()) {
isEmpty = false;
break;
}
}
if (isEmpty) grect = def_rect;
selrect = grect;
findGraphicsRect();
update();
}
void Graphic::on_buttonConfigure_clicked() {
conf->graphicItems.clear();
for (int i = 0; i < graphics.size(); i++) {
GraphicConf::GraphicItem item;
item.icon = graphics[i].icon;
item.name = graphics[i].name;
conf->graphicItems.append(item);
}
conf->ui->colorGrid->setColor(grid_pen.color());
conf->ui->comboStyleGrid->setCurrentIndex((int)grid_pen.style());
conf->ui->spinWidthGrid->setValue(grid_pen.widthF());
conf->ui->checkOGL->setChecked(isOGL);
conf->ui->checkAAlias->setChecked(aalias);
conf->ui->checkInputs->setChecked(borderInputsVisible());
conf->ui->checkStatus->setChecked(statusVisible());
conf->ui->checkLegend->setChecked(legendVisible());
conf->ui->checkGridAutoX->setChecked(grad_x == Auto);
conf->ui->checkGridAutoY->setChecked(grad_y == Auto);
conf->ui->colorBackground->setColor(back_color);
conf->ui->colorText->setColor(text_color);
conf->ui->spinGridStepX->setValue(gridx);
conf->ui->spinGridStepY->setValue(gridy);
conf->ui->spinMarginL->setValue(margins_.left());
conf->ui->spinMarginT->setValue(margins_.height());
conf->ui->spinMarginR->setValue(margins_.width());
conf->ui->spinMarginB->setValue(margins_.top());
conf->readParams();
if (conf->exec() == QDialog::Rejected) return;
grid_pen = QPen(conf->ui->colorGrid->color(), conf->ui->spinWidthGrid->value(), (Qt::PenStyle)conf->ui->comboStyleGrid->currentIndex());
back_color = conf->ui->colorBackground->color();
text_color = conf->ui->colorText->color();
grad_x = conf->ui->checkGridAutoX->isChecked() ? Auto : Fixed;
grad_y = conf->ui->checkGridAutoY->isChecked() ? Auto : Fixed;
gridx = conf->ui->spinGridStepX->value();
gridy = conf->ui->spinGridStepY->value();
setOpenGL(conf->ui->checkOGL->isChecked());
setAntialiasing(conf->ui->checkAAlias->isChecked());
setBorderInputsVisible(conf->ui->checkInputs->isChecked());
setStatusVisible(conf->ui->checkStatus->isChecked());
setLegendVisible(conf->ui->checkLegend->isChecked());
setMargins(conf->ui->spinMarginL->value(), conf->ui->spinMarginR->value(), conf->ui->spinMarginT->value(), conf->ui->spinMarginB->value());
updateLegend();
update();
}
void Graphic::on_checkGuides_toggled(bool checked) {
guides = checked;
if (guides) setCanvasCursor(Qt::BlankCursor);
else setCanvasCursor(Qt::ArrowCursor);
update();
}
void Graphic::updateLegend(bool es) {
QPixmap pix(60, 22);
for (int i = 0; i < graphics.size(); i++) {
pix.fill(back_color);
QPainter p(&pix);
QPen pen = graphics[i].pen;
if (qRound(pen.widthF()) == pen.widthF()) pen.setWidth(pen.width()*thick);
else pen.setWidthF(pen.widthF()*thick);
p.setPen(pen);
p.drawLine(0, pix.height() / 2, pix.width(), pix.height() / 2);
p.end();
graphics[i].icon = QIcon(pix);
}
if (!ui->widgetLegend->isVisibleTo(this)) {
if (es) emit graphicSettingsChanged();
// qDebug() << "skip updateLegend";
return;
}
// qDebug() << "updateLegend" << graphics.size();
leg_update = false;
int ps = 100;
for (int r = 0; r < ui->layoutLegend->rowCount(); ++r)
for (int c = 0; c < ui->layoutLegend->columnCount(); ++c) {
QLayoutItem * li = ui->layoutLegend->itemAtPosition(r, c);
if (!li) continue;
if (!li->widget()) continue;
while (li->widget()->actions().isEmpty())
li->widget()->removeAction(li->widget()->actions()[0]);
delete li->widget();
}
ui->layoutLegend->invalidate();
for (int i = 0; i < graphics.size(); i++) {
graphics[i].pb = new QCheckBox(graphics[i].name);
graphics[i].pb->setIconSize(pix.size());
//graphics[i].pb->setFlat(true);
graphics[i].pb->setIcon(graphics[i].icon);
graphics[i].pb->setChecked(graphics[i].visible);
graphics[i].pb->setProperty("graphic_num", i);
graphics[i].pb->setContextMenuPolicy(Qt::ActionsContextMenu);
//qDebug() << graphics[i].pb->actions();
QAction * act = new QAction(trUtf8("Check all"), 0);
act->setCheckable(true);
act->setChecked(true);
graphics[i].pb->addAction(act);
connect(act, SIGNAL(triggered(bool)), this, SLOT(graphicAllVisibleChange(bool)));
connect(graphics[i].pb, SIGNAL(toggled(bool)), this, SLOT(graphicVisibleChange(bool)));
int cps = graphics[i].pb->sizeHint().width() + 4;
if (cps > ps) ps = cps;
}
int maxcol = qMax<int>(ui->widgetLegend->width() / ps - 1, 1);
int row = 0, col = 0;
bool lv = ui->widgetLegend->isVisibleTo(this);
ui->widgetLegend->hide();
for (int i = 0; i < graphics.size(); i++) {
ui->layoutLegend->addWidget(graphics[i].pb,row,col);
graphics[i].pb->show();
col++;
if (col > maxcol) {col = 0; row++;}
}
ui->widgetLegend->setVisible(lv);
leg_update = true;
if (es) emit graphicSettingsChanged();
}
void Graphic::updateLegendChecks() {
for (int i = 0; i < graphics.size(); i++) {
if (!graphics[i].pb) continue;
bool pbs = graphics[i].pb->blockSignals(true);
graphics[i].pb->setChecked(graphics[i].visible);
graphics[i].pb->blockSignals(pbs);
}
emit graphicSettingsChanged();
}
void Graphic::graphicVisibleChange(bool checked) {
if (visible_update) return;
QCheckBox * cb = qobject_cast<QCheckBox*>(sender());
int i = cb->property("graphic_num").toInt();
graphics[i].visible = checked;
if (isFit) on_buttonAutofit_clicked();
else update();
emit graphicSettingsChanged();
// update();
}
void Graphic::graphicAllVisibleChange(bool checked) {
visible_update = true;
for (int i=0; i<graphics.size(); i++) {
graphics[i].visible = checked;
graphics[i].pb->setChecked(checked);
}
visible_update = false;
if (isFit) on_buttonAutofit_clicked();
else update();
emit graphicSettingsChanged();
}
void Graphic::enterFullscreen() {
if (fullscr) return;
ui->layoutCanvas->removeWidget(canvas);
canvas->setParent(0);
canvas->showFullScreen();
canvas->setFocus();
canvas->raise();
fullscr = true;
}
void Graphic::leaveFullscreen() {
if (!fullscr) return;
canvas->setWindowFlags(canvas->windowFlags() & ~Qt::WindowFullScreen);
ui->layoutCanvas->addWidget(canvas);
canvas->show();
fullscr = false;
}
QString Graphic::caption() const {
return ui->labelCaption->text();
}
bool Graphic::borderInputsVisible() const {
return ui->widgetLX->isVisible();
}
bool Graphic::statusVisible() const {
return ui->status->isVisible();
}
bool Graphic::legendVisible() const {
return ui->widgetLegend->isVisible();
}
QByteArray Graphic::save() {
// QByteArray ba;
// QDataStream s(&ba, QIODevice::ReadWrite);
// s << openGL() << antialiasing() << borderInputsVisible() << statusVisible() << legendVisible();
// s << graphics;
// return ba;
// version '2':
ChunkStream cs;
cs.add(1, antialiasing()).add(2, openGL()).add(3, borderInputsVisible()).add(4, statusVisible()).add(5, legendVisible());
cs.add(6, backgroundColor()).add(7, textColor()).add(8, margins());
cs.add(9, gridPen()).add(10, graduationX()).add(11, graduationY()).add(12, graduationStepX()).add(13, graduationStepY());
cs.add(14, graphics);
cs.add(15, isFit).add(16, visualRect());
return cs.data().prepend('2');
}
void Graphic::load(QByteArray ba) {
if (ba.isEmpty()) return;
char ver = ba[0];
//qDebug() << "load" << (int)ver;
switch(ver) {
case '2': {// version '2':
ba.remove(0, 1);
QRectF vrect;
ChunkStream cs(ba);
while (!cs.atEnd()) {
switch (cs.read()) {
case 1: setAntialiasing(cs.getData<bool>()); break;
case 2: setOpenGL(cs.getData<bool>()); break;
case 3: setBorderInputsVisible(cs.getData<bool>()); break;
case 4: setStatusVisible(cs.getData<bool>()); break;
case 5: setLegendVisible(cs.getData<bool>()); break;
case 6: setBackgroundColor(cs.getData<QColor>()); break;
case 7: setTextColor(cs.getData<QColor>()); break;
case 8: setMargins(cs.getData<QRect>()); break;
case 9: setGridPen(cs.getData<QPen>()); break;
case 10: setGraduationX(cs.getData<Graduation>()); break;
case 11: setGraduationY(cs.getData<Graduation>()); break;
case 12: setGraduationStepX(cs.getData<double>()); break;
case 13: setGraduationStepY(cs.getData<double>()); break;
case 14: graphics = cs.getData<QVector<GraphicType> >(); break;
case 15: isFit = cs.getData<bool>(); break;
case 16: vrect = cs.getData<QRectF>(); break;
default: break;
}
}
if (!isFit) setVisualRect(vrect);
} break;
default: {// old version 0:
QDataStream s(ba);
bool a;
s >> a; setOpenGL(a);
s >> a; setAntialiasing(a);
s >> a; setBorderInputsVisible(a);
s >> a; setStatusVisible(a);
s >> a;
s >> graphics;
setLegendVisible(a);
} break;
}
}
void Graphic::setCaption(const QString & str) {
ui->labelCaption->setText(str);
ui->labelCaption->setVisible(str.length() > 0);
if (aupdate) update();
}
void Graphic::setGridEnabled(bool enabled) {
ui->checkGrid->setChecked(enabled);
}
void Graphic::setBorderInputsVisible(bool visible) {
ui->widgetLX->setVisible(visible);
ui->widgetLY->setVisible(visible);
ui->checkBorderInputs->setChecked(visible);
if (visible) setRectToLines();
}
void Graphic::setStatusVisible(bool visible) {
ui->status->setVisible(visible);
}
void Graphic::setLegendVisible(bool visible) {
ui->widgetLegend->setVisible(visible);
ui->checkLegend->setChecked(visible);
updateLegend();
}
void Graphic::on_checkExpandY_toggled(bool checked) {
only_expand_y = checked;
ui->checkExpandY->setIcon(checked ? icon_exp_y : icon_exp_sy);
}
void Graphic::on_checkExpandX_toggled(bool checked) {
only_expand_x = checked;
ui->checkExpandX->setIcon(checked ? icon_exp_x : icon_exp_sx);
}

455
test/qad/graphic/graphic.h Normal file
View File

@@ -0,0 +1,455 @@
#ifndef GRAPHIC_H
#define GRAPHIC_H
#include <QWidget>
#include <QPainter>
#include <QPixmap>
#include <QMouseEvent>
#include <QComboBox>
///#include <QMutex>
#include <QDebug>
#include <QGridLayout>
#include <QFileDialog>
#include <QTime>
#include <QTranslator>
#include <QGestureEvent>
#include <qmath.h>
#include <float.h>
#include "graphic_conf.h"
#include "evalspinbox.h"
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
namespace Ui {
class Graphic;
}
class UGLWidget;
class Graphic: public QFrame
{
Q_OBJECT
Q_FLAGS(Buttons)
Q_ENUMS(Alignment Graduation AxisType)
Q_PROPERTY(QString caption READ caption WRITE setCaption)
Q_PROPERTY(QString labelX READ labelX WRITE setLabelX)
Q_PROPERTY(QString labelY READ labelY WRITE setLabelY)
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
Q_PROPERTY(int currentGraphic READ currentGraphic WRITE setCurrentGraphic)
Q_PROPERTY(int graphicsCount READ graphicsCount WRITE setGraphicsCount)
Q_PROPERTY(QString graphicName READ graphicName WRITE setGraphicName)
Q_PROPERTY(QPen graphicPen READ graphicPen WRITE setGraphicPen)
Q_PROPERTY(QColor graphicColor READ graphicColor WRITE setGraphicColor)
Q_PROPERTY(Qt::PenStyle graphicStyle READ graphicStyle WRITE setGraphicStyle)
Q_PROPERTY(double graphicLineWidth READ graphicLineWidth WRITE setGraphicLineWidth)
Q_PROPERTY(double graphicPointWidth READ graphicPointWidth WRITE setGraphicPointWidth)
Q_PROPERTY(QColor graphicFillColor READ graphicFillColor WRITE setGraphicFillColor)
Q_PROPERTY(bool graphicLinesEnabled READ graphicLinesEnabled WRITE setGraphicLinesEnabled)
Q_PROPERTY(bool graphicPointsEnabled READ graphicPointsEnabled WRITE setGraphicPointsEnabled)
Q_PROPERTY(bool graphicFillEnabled READ graphicFillEnabled WRITE setGraphicFillEnabled)
Q_PROPERTY(bool gridEnabled READ gridEnabled WRITE setGridEnabled)
Q_PROPERTY(QPen gridPen READ gridPen WRITE setGridPen)
Q_PROPERTY(QColor gridColor READ gridColor WRITE setGridColor)
Q_PROPERTY(Qt::PenStyle gridStyle READ gridStyle WRITE setGridStyle)
Q_PROPERTY(QPen selectionPen READ selectionPen WRITE setSelectionPen)
Q_PROPERTY(QColor selectionColor READ selectionColor WRITE setSelectionColor)
Q_PROPERTY(Qt::PenStyle selectionStyle READ selectionStyle WRITE setSelectionStyle)
Q_PROPERTY(QBrush selectionBrush READ selectionBrush WRITE setSelectionBrush)
Q_PROPERTY(Alignment buttonsPosition READ buttonsPosition WRITE setButtonsPosition)
Q_PROPERTY(Buttons buttons READ buttons WRITE setButtons)
Q_PROPERTY(bool navigationEnabled READ navigationEnabled WRITE setNavigationEnabled)
Q_PROPERTY(bool openGL READ openGL WRITE setOpenGL)
Q_PROPERTY(bool antialiasing READ antialiasing WRITE setAntialiasing)
Q_PROPERTY(bool autoUpdate READ autoUpdate WRITE setAutoUpdate)
Q_PROPERTY(bool borderInputsVisible READ borderInputsVisible WRITE setBorderInputsVisible)
Q_PROPERTY(bool statusVisible READ statusVisible WRITE setStatusVisible)
Q_PROPERTY(bool legendVisible READ legendVisible WRITE setLegendVisible)
Q_PROPERTY(bool paused READ paused WRITE setPaused)
Q_PROPERTY(bool onlyExpandY READ onlyExpandY WRITE setOnlyExpandY)
Q_PROPERTY(bool onlyExpandX READ onlyExpandX WRITE setOnlyExpandX)
Q_PROPERTY(bool gesturesNavigation READ gesturesNavigation WRITE setGesturesNavigation)
Q_PROPERTY(double historySize READ historySize WRITE setHistorySize)
Q_PROPERTY(double maxVisibleTime READ maxVisibleTime WRITE setMaxVisibleTime)
Q_PROPERTY(double autoXIncrement READ autoXIncrement WRITE setAutoXIncrement)
Q_PROPERTY(QRectF limit READ limit WRITE setLimit)
Q_PROPERTY(QRect margins READ margins WRITE setMargins)
Q_PROPERTY(QRectF visualRect READ visualRect WRITE setVisualRect)
Q_PROPERTY(QRectF defaultRect READ defaultRect WRITE setDefaultRect)
Q_PROPERTY(int minimumRepaintInterval READ minimumRepaintInterval WRITE setMinimumRepaintInterval)
Q_PROPERTY(double gridNumbersMultiplierX READ gridNumbersMultiplierX WRITE setGridNumbersMultiplierX)
Q_PROPERTY(double gridNumbersMultiplierY READ gridNumbersMultiplierY WRITE setGridNumbersMultiplierY)
Q_PROPERTY(Graduation graduationX READ graduationX WRITE setGraduationX)
Q_PROPERTY(Graduation graduationY READ graduationY WRITE setGraduationY)
Q_PROPERTY(double graduationStepX READ graduationStepX WRITE setGraduationStepX)
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();
typedef QVector<QVector<QPointF> > GraphicsData;
enum GraphicAction {gaNone, gaZoomInRect, gaZoomRangeX, gaZoomRangeY, gaMove};
enum Button {NoButtons = 0x0,
AllButtons = 0xFFFFFFFF,
Autofit = 0x01,
Grid = 0x02,
CursorAxis = 0x04,
OnlyExpandY = 0x08,
OnlyExpandX = 0x10,
Fullscreen = 0x20,
BorderInputs = 0x40,
Legend = 0x80,
Configure = 0x100,
Save = 0x200,
Clear = 0x800,
Close = 0x1000,
Pause = 0x2000,
StandartButtons = 0x2FFF
};
enum Alignment {Left, Right};
enum Graduation {Auto, Fixed};
enum AxisType {Numeric, DateTime};
Q_DECLARE_FLAGS(Buttons, Button)
QString caption() const;
QString labelX() const {return label_x;}
QString labelY() const {return label_y;}
QString graphicName() const {return graphics[curGraphic].name;}
QColor backgroundColor() const {return back_color;}
QColor textColor() const {return text_color;}
QColor graphicColor() const {return graphics[curGraphic].pen.color();}
QColor gridColor() const {return grid_pen.color();}
QColor selectionColor() const {return selpen.color();}
Qt::PenStyle graphicStyle() const {return graphics[curGraphic].pen.style();}
Qt::PenStyle gridStyle() const {return grid_pen.style();}
Qt::PenStyle selectionStyle() const {return selpen.style();}
double graphicLineWidth() const {return graphics[curGraphic].pen.widthF();}
double graphicPointWidth() const {return graphics[curGraphic].pointWidth;}
QColor graphicFillColor() const {return graphics[curGraphic].fill_color;}
bool graphicVisible() const {return graphics[curGraphic].visible;}
bool graphicLinesEnabled() const {return graphics[curGraphic].lines;}
bool graphicPointsEnabled() const {return graphics[curGraphic].points;}
bool graphicFillEnabled() const {return graphics[curGraphic].fill;}
QPen graphicPen() const {return graphics[curGraphic].pen;}
QPen gridPen() const {return grid_pen;}
QPen selectionPen() const {return selpen;}
QBrush selectionBrush() const {return selbrush;}
bool navigationEnabled() const {return navigation;}
bool openGL() const {return isOGL;}
bool antialiasing() const {return aalias;}
bool autoUpdate() const {return aupdate;}
bool gridEnabled() const {return grid;}
bool borderInputsVisible() const;
bool statusVisible() const;
bool legendVisible() const;
bool paused() const {return pause_;}
bool onlyExpandY() const {return only_expand_y;}
bool onlyExpandX() const {return only_expand_x;}
bool gesturesNavigation() const {return gestures;}
bool isAutofitted() const {return isFit;}
int currentGraphic() const {return curGraphic;}
int graphicsCount() const {return graphics.size();}
Graphic::Buttons buttons() const {return buttons_;}
Graphic::Alignment buttonsPosition() const {return align;}
double historySize() const {return history;}
double maxVisibleTime() const {return visible_time;}
double autoXIncrement() const {return inc_x;}
QRectF visualRect() const {return selrect;}
QRectF defaultRect() const {return def_rect;}
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;}
Graduation graduationY() const {return grad_y;}
double graduationStepX() const {return gridx;}
double graduationStepY() const {return gridy;}
AxisType axisType() const {return axis_type_x;}
QVector<QPointF> graphicData(const int index = 0) const {return graphics[index].polyline;}
GraphicsData graphicsData() const;
QByteArray graphicsDataRaw() const;
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;
double real2canvasX(double px) const;
double real2canvasY(double py) const;
QPointF canvas2real(QPointF canvas_point) const {return QPointF(canvas2realX(canvas_point.x()), canvas2realY(canvas_point.y()));}
QPointF real2canvas(QPointF real_point) const {return QPointF(real2canvasX(real_point.x()), real2canvasY(real_point.y()));}
QPolygonF real2canvas(const QPolygonF & real_polygon) const;
QPolygonF canvas2real(const QPolygonF & canvas_polygon) const;
double getScaleX() const {return real2canvasX(1.) - real2canvasX(0.);}
double getScaleY() const {return real2canvasY(1.) - real2canvasY(0.);}
QPointF getScale() const {return QPointF(getScaleX(), getScaleY());}
public slots:
void setCaption(const QString & str);
void setLabelX(const QString & str) {label_x = str; hasLblX = (str.length() > 0); if (aupdate) update();}
void setLabelY(const QString & str) {label_y = str; hasLblY = (str.length() > 0); if (aupdate) update();}
void setGraphicName(const QString & str, int index) {graphics[index].name = str; updateLegend(); if (aupdate) update();}
void setGraphicName(const QString & str) {graphics[curGraphic].name = str; updateLegend(); if (aupdate) update();}
void setBackgroundColor(const QColor & color) {back_color = color; if (aupdate) update(); updateLegend();}
void setTextColor(const QColor & color) {text_color = color; if (aupdate) update();}
void setGraphicColor(const QColor & color, int index) {graphics[index].pen.setColor(color); updateLegend(); if (aupdate) update();}
void setGraphicColor(const QColor & color) {setGraphicColor(color, curGraphic);}
void setGridColor(const QColor & color) {grid_pen.setColor(color); if (aupdate) update();}
void setSelectionColor(const QColor & color) {selpen.setColor(color);}
void setGraphicStyle(const Qt::PenStyle & style) {graphics[curGraphic].pen.setStyle(style); updateLegend(); if (aupdate) update();}
void setGridStyle(const Qt::PenStyle & style) {grid_pen.setStyle(style); if (aupdate) update();}
void setSelectionStyle(const Qt::PenStyle & style) {selpen.setStyle(style);}
void setGraphicVisible(bool visible, int index) {graphics[index].visible = visible; updateLegendChecks(); if (aupdate) update();}
void setGraphicVisible(bool visible) {setGraphicVisible(visible, curGraphic);}
void setGraphicLineWidth(double w, int index) {if (qRound(w) == w) graphics[index].pen.setWidth(qRound(w)); else graphics[index].pen.setWidthF(w); updateLegend(); if (aupdate) update();}
void setGraphicLineWidth(double w) {setGraphicLineWidth(w, curGraphic);}
void setGraphicPointWidth(double w, int index) {graphics[index].pointWidth = w; updateLegend(); if (aupdate) update();}
void setGraphicPointWidth(double w) {setGraphicPointWidth(w, curGraphic);}
void setGraphicFillColor(const QColor & w, int index) {graphics[index].fill_color = w; updateLegend(); if (aupdate) update();}
void setGraphicFillColor(const QColor & w) {setGraphicFillColor(w, curGraphic);}
void setGraphicLinesEnabled(bool w, int index) {graphics[index].lines = w; updateLegend(); if (aupdate) update();}
void setGraphicLinesEnabled(bool w) {setGraphicLinesEnabled(w, curGraphic);}
void setGraphicPointsEnabled(bool w, int index) {graphics[index].points = w; updateLegend(); if (aupdate) update();}
void setGraphicPointsEnabled(bool w) {setGraphicPointsEnabled(w, curGraphic);}
void setGraphicFillEnabled(bool w, int index) {graphics[index].fill = w; updateLegend(); if (aupdate) update();}
void setGraphicFillEnabled(bool w) {setGraphicFillEnabled(w, curGraphic);}
void setGraphicPen(const QPen & pen, int index) {graphics[index].pen = pen; updateLegend(); if (aupdate) update();}
void setGraphicPen(const QPen & pen) {setGraphicPen(pen, curGraphic);}
void setGridPen(const QPen & pen) {grid_pen = pen; if (aupdate) update();}
void setSelectionPen(const QPen & pen) {selpen = pen;}
void setSelectionBrush(const QBrush & brush) {selbrush = brush;}
void setNavigationEnabled(bool on) {navigation = on;}
void setOpenGL(bool on);
void setAntialiasing(bool enabled);
void setAutoUpdate(bool enabled) {aupdate = enabled;}
void setGridEnabled(bool enabled);
void setBorderInputsVisible(bool visible);
void setStatusVisible(bool visible);
void setLegendVisible(bool visible);
void setPaused(bool yes);
void setButtons(Graphic::Buttons b);
void setButtonsPosition(Graphic::Alignment a);
void setHistorySize(double val);
void setMaxVisibleTime(double val) {visible_time = val;}
void setAutoXIncrement(double val) {inc_x = val;}
void setLimit(const QRectF & val) {limit_ = val;}
void setMargins(const QRect & val) {margins_ = val; update();}
void setMargins(int left_, int right_, int top_, int bottom_) {setMargins(QRect(left_, bottom_, right_, top_));}
void setLeftMargin(int value) {margins_.moveLeft(value); setMargins(margins_);}
void setRightMargin(int value) {margins_.setWidth(value); setMargins(margins_);}
void setTopMargin(int value) {margins_.setHeight(value); setMargins(margins_);}
void setBottomMargin(int value) {margins_.moveTop(value); setMargins(margins_);}
void setMinimumRepaintInterval(const int & val) {min_repaint_int = val;}
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);
void setGridNumbersMultiplierX(double value) {grid_numbers_x = value; updateGraphics();}
void setGridNumbersMultiplierY(double value) {grid_numbers_y = value; updateGraphics();}
void setGraduationX(Graduation value) {grad_x = value; if (aupdate) update();;}
void setGraduationY(Graduation value) {grad_y = value; if (aupdate) update();;}
void setGraduationStepX(double sx) {gridx = sx; if (aupdate) update();}
void setGraduationStepY(double sy) {gridy = sy; if (aupdate) update();}
void setGraduationSteps(double sx, double sy) {gridx = sx; gridy = sy; if (aupdate) update();}
void setAxisType(AxisType t) {axis_type_x = t; if (aupdate) update();}
void addPoint(const QPointF & p, int graphic, bool update_ = true);
void addPoint(const QPointF & p, bool update = true) {addPoint(p, curGraphic, update);}
void addPoint(double x, double y, int graphic, bool update = true) {addPoint(QPointF(x, y), graphic, update);}
void addPoint(double x, double y, bool update = true) {addPoint(QPointF(x, y), update);}
void addPoint(double y, int graphic, bool update = true) {if (graphics[graphic].polyline.isEmpty()) addPoint(QPointF(0.0, y), graphic, update); else addPoint(QPointF(graphics[graphic].max_x + inc_x, y), graphic, update);}
void addPoint(double y, bool update = true) {if (graphics[curGraphic].polyline.isEmpty()) addPoint(QPointF(0.0, y), update); else addPoint(QPointF(graphics[curGraphic].max_x + inc_x, y), update);}
void setGraphicData(const QVector<QPointF> & g, int graphic, bool update_ = true);
void setGraphicData(const QVector<QPointF> & g) {setGraphicData(g, curGraphic);}
void setGraphicProperties(const QString & name, const QColor & color = Qt::darkRed, Qt::PenStyle style = Qt::SolidLine, double width = 0., bool visible = true) {setGraphicProperties(curGraphic, name, color, style, width, visible);}
void setGraphicProperties(int graphic, const QString & name, const QColor & color = Qt::darkRed, Qt::PenStyle style = Qt::SolidLine, double width = 0., bool visible = true);
void addGraphic(const QString & name, const QColor & color = Qt::darkRed, Qt::PenStyle style = Qt::SolidLine, double width = 0., bool visible = true);
void addGraphic(const GraphicType & gd, bool update = true) {graphics << gd; if (update) updateLegend();}
void setVisualRect(const QRectF & rect);
void setDefaultRect(const QRectF & rect);
void autofit() {on_buttonAutofit_clicked();}
void saveImage();
void clear();
void update(bool force = false);
void updateGraphics() {findGraphicsRect(); update();}
void setCurrentGraphic(int arg) {if (arg < 0 || arg >= graphics.size()) return; curGraphic = arg;}
void setGraphicsCount(int arg, bool update = true);
void removeGraphic(int arg, bool update = true);
void zoom(float factor);
void zoomIn() {zoom(1. / 1.2);}
void zoomOut() {zoom(1.2);}
void fullscreen();
protected:
virtual void changeEvent(QEvent * e);
virtual void resizeEvent(QResizeEvent * );
virtual QSize sizeHint() const {return QSize(400, 300);}
virtual void timerEvent(QTimerEvent * );
virtual bool eventFilter(QObject * o, QEvent * e);
void prepareCanvas(QWidget * w);
void procGesture(QGesture * g);
void procZoom(QPointF view_center, double dzoom, Qt::KeyboardModifiers km = Qt::NoModifier);
void totalUpdate();
void setCurrentAction(GraphicAction action);
void findGraphicsRect(double start_x = 0., double end_x = 0., double start_y = 0., double end_y = 0.);
void tick(int index, bool slide = true, bool update = true);
void repaintCanvas(bool force = false) {if (tm.elapsed() < min_repaint_int && !force) return; tm.restart(); canvas->update();}
void drawGraphics();
void drawGrid();
void drawGuides();
void drawPause();
void drawAction();
void updateLegend(bool es = true);
void updateLegendChecks();
void setCanvasCursor(QCursor cursor);
void swapToBuffer();
void swapToNormal() {bufferActive = false;}
void setRectToLines();
void checkLines();
double splitRange(double range, int count = 1);
double splitRangeDate(double range, int count = 1, QString * format = 0, int step[7] = 0);
double roundTo(double value, double round_to);
void roundDateTime(QDateTime & dt, int c[7]);
void addDateTime(QDateTime & dt, int c[7], int mul = 1);
QPointF absPoint(QPointF point) {return QPointF(qAbs(point.x()), qAbs(point.y()));}
QString pointCoords(QPointF point, bool x = true, bool y = true);
QPair<QString, QString> gridMark(double v) const;
Ui::Graphic * ui;
UGLWidget * canvas_gl;
///QMutex mutex, mutex_;
QWidget * canvas;
QImage * buffer;
QPainter * painter;
QBrush selbrush;
QPen grid_pen, selpen;
QColor back_color, text_color;
QVector<GraphicType> graphics;
int curGraphic;
GraphicAction curaction, prevaction;
QRectF grect, rrect, selrect, limit_, def_rect;
QRect margins_;
QSize font_sz;
QPoint startpos, curpos, prevpos, gridborder;
QPointF startpos_r, curpos_r;
QString label_x, label_y, ppath, fp_size;
Graphic::Buttons buttons_;
Graphic::Alignment align;
GraphicConf * conf;
EvalSpinBox line_x_min, line_x_max, line_y_min, line_y_max;
QTime 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 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;
bool hasLblX, hasLblY, navigation, only_expand_y, only_expand_x, is_lines_update, leg_update, visible_update, fullscr, need_mouse_pan;
protected slots:
void canvasPaintEvent();
void canvasMouseMoveEvent(QMouseEvent * );
void canvasMousePressEvent(QMouseEvent * );
void canvasMouseReleaseEvent(QMouseEvent * );
void canvasMouseDoubleClickEvent(QMouseEvent * );
void canvasWheelEvent(QWheelEvent * );
void canvasLeaveEvent(QEvent * );
void canvasKeyPressEvent(QKeyEvent * );
void graphicVisibleChange(bool checked);
void graphicAllVisibleChange(bool checked);
void lineXMinChanged(double value) {selrect.setLeft(value); checkLines();}
void lineXMaxChanged(double value) {selrect.setRight(value); checkLines();}
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_buttonAutofit_clicked();
void on_buttonConfigure_clicked();
void on_buttonFullscreen_clicked() {fullscreen();}
void on_buttonSave_clicked() {saveImage();}
void on_checkGrid_toggled(bool checked) {grid = checked; update();}
void on_checkGuides_toggled(bool checked);
void on_checkExpandY_toggled(bool checked);
void on_checkExpandX_toggled(bool checked);
void on_checkBorderInputs_toggled(bool checked) {setBorderInputsVisible(checked);}
void on_checkLegend_toggled(bool checked) {setLegendVisible(checked);}
void on_checkPause_toggled(bool checked) {setPaused(checked);}
void enterFullscreen();
void leaveFullscreen();
signals:
void beforeGraphicPaintEvent(QPainter * );
void graphicPaintEvent(QPainter * );
void graphicMouseMoveEvent(QPointF point, int buttons);
void graphicMousePressEvent(QPointF point, int buttons);
void graphicMouseReleaseEvent(QPointF point, int buttons);
void graphicWheelEvent(QPointF point, int delta);
void closeRequest(QWidget * );
void cleared();
void visualRectChanged();
void graphicSettingsChanged();
};
Q_DECLARE_METATYPE(Graphic::GraphicsData)
Q_DECLARE_OPERATORS_FOR_FLAGS(Graphic::Buttons)
inline QDataStream & operator <<(QDataStream & s, const Graphic::Graduation & v) {s << (int)v; return s;}
inline QDataStream & operator >>(QDataStream & s, Graphic::Graduation & v) {s >> *((int*)(&v)); return s;}
class __GraphicRegistrator__ {
public:
__GraphicRegistrator__() {
qRegisterMetaType<Graphic::GraphicsData>("Graphic::GraphicsData");
qRegisterMetaTypeStreamOperators<Graphic::GraphicsData>("Graphic::GraphicsData");
}
};
QT_END_NAMESPACE
QT_END_HEADER
#endif // GRAPHIC_H

443
test/qad/graphic/graphic.ui Normal file
View File

@@ -0,0 +1,443 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Graphic</class>
<widget class="QFrame" name="Graphic">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>564</width>
<height>433</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>150</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>2</number>
</property>
<item row="0" column="0" rowspan="2">
<widget class="QWidget" name="widgetLeft" native="true">
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>-10</x>
<y>0</y>
<width>33</width>
<height>420</height>
</rect>
</property>
<layout class="QVBoxLayout" name="layoutButtons">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QToolButton" name="buttonAutofit">
<property name="toolTip">
<string>Autofit</string>
</property>
<property name="icon">
<iconset resource="qad_graphic.qrc">
<normaloff>:/icons/view-autofit.png</normaloff>:/icons/view-autofit.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="checkGrid">
<property name="toolTip">
<string>Grid</string>
</property>
<property name="icon">
<iconset resource="../widgets/qad_widgets.qrc">
<normaloff>:/icons/view-grid.png</normaloff>:/icons/view-grid.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="checkGuides">
<property name="toolTip">
<string>Cursor axis</string>
</property>
<property name="icon">
<iconset resource="../widgets/qad_widgets.qrc">
<normaloff>:/icons/edit-guides.png</normaloff>:/icons/edit-guides.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="checkExpandY">
<property name="toolTip">
<string>Only expand Y</string>
</property>
<property name="icon">
<iconset resource="../widgets/qad_widgets.qrc">
<normaloff>:/icons/expand_s_y.png</normaloff>:/icons/expand_s_y.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="checkExpandX">
<property name="toolTip">
<string>Only expand X</string>
</property>
<property name="icon">
<iconset resource="../widgets/qad_widgets.qrc">
<normaloff>:/icons/expand_s_x.png</normaloff>:/icons/expand_s_x.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonFullscreen">
<property name="toolTip">
<string>Fullscreen</string>
</property>
<property name="icon">
<iconset resource="../blockview/qad_blockview.qrc">
<normaloff>:/icons/view-fullscreen.png</normaloff>:/icons/view-fullscreen.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="checkBorderInputs">
<property name="toolTip">
<string>Border inputs</string>
</property>
<property name="icon">
<iconset resource="../widgets/qad_widgets.qrc">
<normaloff>:/icons/border-line.png</normaloff>:/icons/border-line.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="checkLegend">
<property name="toolTip">
<string>Legend</string>
</property>
<property name="icon">
<iconset resource="../widgets/qad_widgets.qrc">
<normaloff>:/icons/legend.png</normaloff>:/icons/legend.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="checkPause">
<property name="toolTip">
<string>Pause</string>
</property>
<property name="icon">
<iconset resource="qad_graphic.qrc">
<normaloff>:/icons/media-playback-pause.png</normaloff>:/icons/media-playback-pause.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonConfigure">
<property name="toolTip">
<string>Configure ...</string>
</property>
<property name="icon">
<iconset resource="../widgets/qad_widgets.qrc">
<normaloff>:/icons/configure.png</normaloff>:/icons/configure.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonSave">
<property name="toolTip">
<string>Save image ...</string>
</property>
<property name="icon">
<iconset resource="../utils/qad_utils.qrc">
<normaloff>:/icons/document-save.png</normaloff>:/icons/document-save.png</iconset>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="buttonClear">
<property name="toolTip">
<string>Clear</string>
</property>
<property name="icon">
<iconset resource="../utils/qad_utils.qrc">
<normaloff>:/icons/edit-clear.png</normaloff>:/icons/edit-clear.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonClose">
<property name="toolTip">
<string>Close</string>
</property>
<property name="icon">
<iconset resource="../widgets/qad_widgets.qrc">
<normaloff>:/icons/dialog-close.png</normaloff>:/icons/dialog-close.png</iconset>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>79</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="labelCaption">
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="2" rowspan="2">
<widget class="QWidget" name="widgetRight" native="true"/>
</item>
<item row="1" column="1">
<widget class="QFrame" name="frame">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="2" column="1" colspan="2">
<widget class="QWidget" name="widgetLX" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="0" column="1" rowspan="2" colspan="2">
<layout class="QVBoxLayout" name="layoutCanvas">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="UWidget" name="canvas_raster" native="true">
<property name="mouseTracking">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0" rowspan="2">
<widget class="QWidget" name="widgetLY" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="status">
<property name="text">
<string>Cursor: ( ; )</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QWidget" name="widgetLegend" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<layout class="QGridLayout" name="layoutLegend">
<property name="leftMargin">
<number>1</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>1</number>
</property>
<property name="bottomMargin">
<number>1</number>
</property>
<property name="horizontalSpacing">
<number>4</number>
</property>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>UWidget</class>
<extends>QWidget</extends>
<header>uwidget.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../utils/qad_utils.qrc"/>
<include location="../widgets/qad_widgets.qrc"/>
<include location="../blockview/qad_blockview.qrc"/>
<include location="qad_graphic.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -0,0 +1,107 @@
#include "graphic_conf.h"
#include "qad_types.h"
#include "ui_graphic_conf.h"
GraphicConf::GraphicConf(QVector<GraphicType> & graphics_, QWidget * parent): QDialog(parent), graphics(graphics_) {
ui = new Ui::GraphicConf();
ui->setupUi(this);
QStringList styles;
int fh = qMax<int>(fontMetrics().size(0, "0").height(), 22);
int thick = lineThickness();
QSize sz(fh * 2.5, fh);
styles << tr("NoPen") << tr("Solid") << tr("Dash")
<< tr("Dot") << tr("Dash-Dot") << tr("Dash-Dot-Dot");
ui->comboStyleGrid->setIconSize(sz);
ui->comboStyleGraphic->setIconSize(sz);
ui->cbGraphicNames->setIconSize(sz);
for (int i = 0; i < 6; i++) {
QPixmap pix(sz);
pix.fill();
QPainter p(&pix);
p.setPen(QPen(Qt::black, thick, (Qt::PenStyle)i));
p.drawLine(0, pix.height() / 2, pix.width(), pix.height() / 2);
p.end();
ui->comboStyleGraphic->addItem(QIcon(pix), styles[i]);
ui->comboStyleGrid->addItem(QIcon(pix), styles[i]);
}
}
void GraphicConf::changeEvent(QEvent * e) {
if (e->type() == QEvent::LanguageChange) {
ui->retranslateUi(this);
return;
}
QDialog::changeEvent(e);
}
void GraphicConf::readParams() {
ui->cbGraphicNames->clear();
for (int i = 0; i < graphicItems.size(); i++)
ui->cbGraphicNames->addItem(graphicItems[i].icon, graphicItems[i].name);
}
void GraphicConf::on_cbGraphicNames_currentIndexChanged(int i) {
if (i < 0) return;
if (graphicItems.isEmpty()) return;
ui->comboStyleGraphic->setCurrentIndex((int)graphics[i].pen.style());
ui->colorGraphic->setColor(graphics[i].pen.color());
ui->colorFill->setColor(graphics[i].fill_color);
ui->spinLineWidthGraphic->setValue(graphics[i].pen.widthF());
ui->spinPointWidthGraphic->setValue(graphics[i].pointWidth);
ui->checkLines->setChecked(graphics[i].lines);
ui->checkPoints->setChecked(graphics[i].points);
ui->checkFill->setChecked(graphics[i].fill);
}
void GraphicConf::on_colorGraphic_colorChanged(const QColor & c) {
if (graphicItems.isEmpty()) return;
graphics[ui->cbGraphicNames->currentIndex()].pen.setColor(c);
}
void GraphicConf::on_comboStyleGraphic_currentIndexChanged(int index) {
if (graphicItems.isEmpty()) return;
graphics[ui->cbGraphicNames->currentIndex()].pen.setStyle((Qt::PenStyle)index);
}
void GraphicConf::on_spinLineWidthGraphic_valueChanged(double value) {
if (graphicItems.isEmpty()) return;
if (qRound(value) == value) graphics[ui->cbGraphicNames->currentIndex()].pen.setWidth(qRound(value));
else graphics[ui->cbGraphicNames->currentIndex()].pen.setWidthF(value);
}
void GraphicConf::on_spinPointWidthGraphic_valueChanged(double value) {
if (graphicItems.isEmpty()) return;
graphics[ui->cbGraphicNames->currentIndex()].pointWidth = value;
}
void GraphicConf::on_checkLines_toggled(bool on) {
if (graphicItems.isEmpty()) return;
graphics[ui->cbGraphicNames->currentIndex()].lines = on;
}
void GraphicConf::on_checkPoints_toggled(bool on) {
if (graphicItems.isEmpty()) return;
graphics[ui->cbGraphicNames->currentIndex()].points = on;
}
void GraphicConf::on_checkFill_toggled(bool on) {
if (graphicItems.isEmpty()) return;
graphics[ui->cbGraphicNames->currentIndex()].fill = on;
}
void GraphicConf::on_colorFill_colorChanged(const QColor & color) {
if (graphicItems.isEmpty()) return;
graphics[ui->cbGraphicNames->currentIndex()].fill_color = color;
}

View File

@@ -0,0 +1,91 @@
#ifndef GRAPHIC_CONF_H
#define GRAPHIC_CONF_H
#include <QDialog>
#include <QCheckBox>
#include <QPen>
#include <QPainter>
namespace Ui {
class GraphicConf;
};
struct GraphicType {
GraphicType(QString name_ = "y(x)", QColor color = Qt::red, Qt::PenStyle style = Qt::SolidLine, double width = 0., bool visible_ = true) {
pen.setColor(color);
pen.setStyle(style);
lines = true;
points = false;
fill = false;
fill_color = Qt::yellow;
if (qRound(width) == width) pen.setWidth(qRound(width));
else pen.setWidthF(width);
pen.setWidth(1);
pen.setCosmetic(true);
max_x = 0.;
name = name_;
visible = visible_;
pointWidth = 2.;
pb = new QCheckBox(name);
}
//~GraphicType() {delete pb;}
QString name;
QPolygonF polyline;
QPolygonF polyline_pause;
QPen pen;
QColor fill_color;
bool lines;
bool points;
bool fill;
double pointWidth;
double max_x;
double max_x_pause;
QCheckBox * pb;
QIcon icon;
bool visible;
QRectF cvrect;
};
inline QDataStream & operator <<(QDataStream & s, const GraphicType & v) {s << v.name << v.pen << v.fill_color << v.lines << v.points << v.fill << v.pointWidth << v.visible; return s;}
inline QDataStream & operator >>(QDataStream & s, GraphicType & v) {s >> v.name >> v.pen >> v.fill_color >> v.lines >> v.points >> v.fill >> v.pointWidth >> v.visible; return s;}
class GraphicConf: public QDialog
{
Q_OBJECT
friend class Graphic;
public:
explicit GraphicConf(QVector<GraphicType> & graphics_, QWidget * parent = 0);
struct GraphicItem {
QString name;
QIcon icon;
};
void readParams();
QVector<GraphicType> & graphics;
QVector<GraphicItem> graphicItems;
protected:
void changeEvent(QEvent * e);
Ui::GraphicConf * ui;
private slots:
void on_cbGraphicNames_currentIndexChanged(int index);
void on_colorGraphic_colorChanged(const QColor &);
void on_colorFill_colorChanged(const QColor &);
void on_comboStyleGraphic_currentIndexChanged(int index);
void on_spinLineWidthGraphic_valueChanged(double value);
void on_spinPointWidthGraphic_valueChanged(double value);
void on_checkLines_toggled(bool on);
void on_checkPoints_toggled(bool on);
void on_checkFill_toggled(bool on);
};
#endif // GRAPHIC_CONF_H

View File

@@ -0,0 +1,644 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>GraphicConf</class>
<widget class="QDialog" name="GraphicConf">
<property name="windowModality">
<enum>Qt::WindowModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>583</height>
</rect>
</property>
<property name="windowTitle">
<string>Graphic parameters</string>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Appearance</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="1" column="0">
<widget class="QCheckBox" name="checkInputs">
<property name="text">
<string>Border inputs</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="checkAAlias">
<property name="text">
<string>Antialiasing</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="checkStatus">
<property name="text">
<string>Status bar</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="checkOGL">
<property name="text">
<string>OpenGL</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="checkLegend">
<property name="text">
<string>Legend</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QFormLayout" name="formLayout_3">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Background color:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="ColorButton" name="colorBackground">
<property name="useAlphaChannel">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Text color:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="ColorButton" name="colorText">
<property name="useAlphaChannel">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="2" column="1">
<widget class="QGroupBox" name="groupBox_1">
<property name="title">
<string>Graphics</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0" colspan="2">
<widget class="QComboBox" name="cbGraphicNames">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Color:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="ColorButton" name="colorGraphic">
<property name="useAlphaChannel">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Style:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="comboStyleGraphic"/>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="checkLines">
<property name="text">
<string>Lines width:</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="spinLineWidthGraphic">
<property name="decimals">
<number>2</number>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="checkPoints">
<property name="text">
<string>Points width:</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="spinPointWidthGraphic">
<property name="decimals">
<number>2</number>
</property>
<property name="maximum">
<double>999.990000000000009</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="checkFill">
<property name="text">
<string>Fill:</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="ColorButton" name="colorFill">
<property name="useAlphaChannel">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Grid</string>
</property>
<layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Color:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="ColorButton" name="colorGrid">
<property name="useAlphaChannel">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Style:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboStyleGrid"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Width:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="spinWidthGrid">
<property name="decimals">
<number>2</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Step X:</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Step Y:</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="checkGridAutoX">
<property name="text">
<string>Auto X</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="checkGridAutoY">
<property name="text">
<string>Auto Y</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="EvalSpinBox" name="spinGridStepY">
<property name="expression">
<string>30</string>
</property>
<property name="defaultText">
<string>30</string>
</property>
<property name="clearButtonVisible">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="EvalSpinBox" name="spinGridStepX">
<property name="expression">
<string>50</string>
</property>
<property name="defaultText">
<string>50</string>
</property>
<property name="clearButtonVisible">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Margins</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="5">
<widget class="QSpinBox" name="spinMarginR">
<property name="suffix">
<string> px</string>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QSpinBox" name="spinMarginB">
<property name="suffix">
<string> px</string>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="labelAll">
<property name="text">
<string>All:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinMarginL">
<property name="suffix">
<string> px</string>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Right:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Left:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Bottom:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QSpinBox" name="spinMarginT">
<property name="suffix">
<string> px</string>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Top:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QSpinBox" name="spinMarginT_2">
<property name="suffix">
<string> px</string>
</property>
<property name="maximum">
<number>100</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ColorButton</class>
<extends>QPushButton</extends>
<header>colorbutton.h</header>
<slots>
<signal>colorChanged(QColor)</signal>
</slots>
</customwidget>
<customwidget>
<class>EvalSpinBox</class>
<extends>QWidget</extends>
<header>evalspinbox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>checkAAlias</tabstop>
<tabstop>checkOGL</tabstop>
<tabstop>colorBackground</tabstop>
<tabstop>colorText</tabstop>
<tabstop>colorGrid</tabstop>
<tabstop>comboStyleGrid</tabstop>
<tabstop>spinWidthGrid</tabstop>
<tabstop>cbGraphicNames</tabstop>
<tabstop>colorGraphic</tabstop>
<tabstop>comboStyleGraphic</tabstop>
<tabstop>checkLines</tabstop>
<tabstop>spinLineWidthGraphic</tabstop>
<tabstop>checkPoints</tabstop>
<tabstop>spinPointWidthGraphic</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>GraphicConf</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>255</x>
<y>641</y>
</hint>
<hint type="destinationlabel">
<x>245</x>
<y>207</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkLines</sender>
<signal>toggled(bool)</signal>
<receiver>spinLineWidthGraphic</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>322</x>
<y>410</y>
</hint>
<hint type="destinationlabel">
<x>415</x>
<y>411</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkPoints</sender>
<signal>toggled(bool)</signal>
<receiver>spinPointWidthGraphic</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>322</x>
<y>434</y>
</hint>
<hint type="destinationlabel">
<x>415</x>
<y>435</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>GraphicConf</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>294</x>
<y>641</y>
</hint>
<hint type="destinationlabel">
<x>288</x>
<y>268</y>
</hint>
</hints>
</connection>
<connection>
<sender>checkFill</sender>
<signal>toggled(bool)</signal>
<receiver>colorFill</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>322</x>
<y>458</y>
</hint>
<hint type="destinationlabel">
<x>415</x>
<y>460</y>
</hint>
</hints>
</connection>
<connection>
<sender>spinMarginT_2</sender>
<signal>valueChanged(int)</signal>
<receiver>spinMarginT</receiver>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
<x>259</x>
<y>221</y>
</hint>
<hint type="destinationlabel">
<x>249</x>
<y>191</y>
</hint>
</hints>
</connection>
<connection>
<sender>spinMarginT_2</sender>
<signal>valueChanged(int)</signal>
<receiver>spinMarginR</receiver>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
<x>268</x>
<y>220</y>
</hint>
<hint type="destinationlabel">
<x>371</x>
<y>220</y>
</hint>
</hints>
</connection>
<connection>
<sender>spinMarginT_2</sender>
<signal>valueChanged(int)</signal>
<receiver>spinMarginB</receiver>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
<x>233</x>
<y>230</y>
</hint>
<hint type="destinationlabel">
<x>234</x>
<y>252</y>
</hint>
</hints>
</connection>
<connection>
<sender>spinMarginT_2</sender>
<signal>valueChanged(int)</signal>
<receiver>spinMarginL</receiver>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
<x>213</x>
<y>230</y>
</hint>
<hint type="destinationlabel">
<x>133</x>
<y>229</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -0,0 +1,351 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ru_RU">
<context>
<name>Graphic</name>
<message>
<location filename="../graphic.ui" line="44"/>
<location filename="../ui_graphic.h" line="320"/>
<source>Autofit</source>
<translation>Автомасштаб</translation>
</message>
<message>
<location filename="../graphic.ui" line="61"/>
<location filename="../ui_graphic.h" line="323"/>
<source>Grid</source>
<translation>Сетка</translation>
</message>
<message>
<location filename="../graphic.ui" line="84"/>
<location filename="../ui_graphic.h" line="326"/>
<source>Cursor axis</source>
<translation>Плавающие оси</translation>
</message>
<message>
<location filename="../graphic.ui" line="104"/>
<location filename="../ui_graphic.h" line="329"/>
<source>Only expand Y</source>
<translation>Только расширять Y</translation>
</message>
<message>
<location filename="../graphic.ui" line="124"/>
<location filename="../ui_graphic.h" line="332"/>
<source>Only expand X</source>
<translation>Только расширять X</translation>
</message>
<message>
<location filename="../graphic.ui" line="144"/>
<location filename="../ui_graphic.h" line="335"/>
<source>Fullscreen</source>
<translation>Во весь экран</translation>
</message>
<message>
<location filename="../graphic.ui" line="161"/>
<location filename="../ui_graphic.h" line="338"/>
<source>Border inputs</source>
<translation>Граничные поля ввода</translation>
</message>
<message>
<location filename="../graphic.ui" line="184"/>
<location filename="../ui_graphic.h" line="341"/>
<source>Legend</source>
<translation>Легенда</translation>
</message>
<message>
<location filename="../graphic.ui" line="207"/>
<location filename="../ui_graphic.h" line="344"/>
<source>Configure ...</source>
<translation>Настроить ...</translation>
</message>
<message>
<location filename="../graphic.ui" line="224"/>
<location filename="../ui_graphic.h" line="347"/>
<source>Save image ...</source>
<translation>Сохранить изображение ...</translation>
</message>
<message>
<location filename="../graphic.ui" line="257"/>
<location filename="../ui_graphic.h" line="350"/>
<source>Clear</source>
<translation>Очистить</translation>
</message>
<message>
<location filename="../graphic.ui" line="274"/>
<location filename="../ui_graphic.h" line="353"/>
<source>Close</source>
<translation>Закрыть</translation>
</message>
<message>
<location filename="../graphic.ui" line="425"/>
<location filename="../ui_graphic.h" line="355"/>
<source>Cursor: ( ; )</source>
<translation>Курсор: ( ; )</translation>
</message>
<message>
<location filename="../graphic.cpp" line="205"/>
<location filename="../graphic.cpp" line="809"/>
<source>Cursor: </source>
<translation>Курсор: </translation>
</message>
<message>
<location filename="../graphic.cpp" line="216"/>
<source>Selection</source>
<translation>Выделение</translation>
</message>
<message>
<location filename="../graphic.cpp" line="217"/>
<source>Size</source>
<translation>Размер</translation>
</message>
<message>
<location filename="../graphic.cpp" line="221"/>
<location filename="../graphic.cpp" line="227"/>
<source>Range</source>
<translation>Диапазон</translation>
</message>
<message>
<location filename="../graphic.cpp" line="222"/>
<location filename="../graphic.cpp" line="228"/>
<source>Length</source>
<translation>Длина</translation>
</message>
<message>
<location filename="../graphic.cpp" line="329"/>
<location filename="../graphic.cpp" line="380"/>
<source>Cursor</source>
<translation>Курсор</translation>
</message>
<message>
<location filename="../graphic.cpp" line="531"/>
<source>Save Image</source>
<translation>Сохранить изображение</translation>
</message>
<message>
<location filename="../graphic.cpp" line="576"/>
<source>y(x)</source>
<translation></translation>
</message>
<message>
<location filename="../graphic.cpp" line="1124"/>
<source>Check all</source>
<translation>Выбрать все</translation>
</message>
</context>
<context>
<name>GraphicConf</name>
<message>
<location filename="../graphic_conf.ui" line="17"/>
<location filename="../ui_graphic_conf.h" line="450"/>
<source>Graphic parameters</source>
<translation>Параметры графика</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="32"/>
<location filename="../ui_graphic_conf.h" line="451"/>
<source>Appearance</source>
<translation>Внешний вид</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="46"/>
<location filename="../ui_graphic_conf.h" line="452"/>
<source>Border inputs</source>
<translation>Граничные поля ввода</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="53"/>
<location filename="../ui_graphic_conf.h" line="453"/>
<source>Antialiasing</source>
<translation>Сглаживание</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="60"/>
<location filename="../ui_graphic_conf.h" line="454"/>
<source>Status bar</source>
<translation>Панель статуса</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="67"/>
<location filename="../ui_graphic_conf.h" line="455"/>
<source>OpenGL</source>
<translation></translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="74"/>
<location filename="../ui_graphic_conf.h" line="456"/>
<source>Legend</source>
<translation>Легенда</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="94"/>
<location filename="../ui_graphic_conf.h" line="457"/>
<source>Background color:</source>
<translation>Цвет фона:</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="114"/>
<location filename="../ui_graphic_conf.h" line="458"/>
<source>Text color:</source>
<translation>Цвет текста:</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="133"/>
<location filename="../ui_graphic_conf.h" line="459"/>
<source>Graphics</source>
<translation>Графики</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="161"/>
<location filename="../graphic_conf.ui" line="263"/>
<location filename="../ui_graphic_conf.h" line="460"/>
<location filename="../ui_graphic_conf.h" line="466"/>
<source>Color:</source>
<translation>Цвет:</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="175"/>
<location filename="../graphic_conf.ui" line="277"/>
<location filename="../ui_graphic_conf.h" line="461"/>
<location filename="../ui_graphic_conf.h" line="467"/>
<source>Style:</source>
<translation>Стиль:</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="185"/>
<location filename="../ui_graphic_conf.h" line="462"/>
<source>Lines width:</source>
<translation>Толщина линий:</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="205"/>
<location filename="../ui_graphic_conf.h" line="463"/>
<source>Points width:</source>
<translation>Толщина точек:</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="225"/>
<location filename="../ui_graphic_conf.h" line="464"/>
<source>Fill:</source>
<translation>Заливка:</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="245"/>
<location filename="../ui_graphic_conf.h" line="465"/>
<source>Grid</source>
<translation>Сетка</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="287"/>
<location filename="../ui_graphic_conf.h" line="468"/>
<source>Width:</source>
<translation>Толщина:</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="317"/>
<location filename="../ui_graphic_conf.h" line="469"/>
<source>Step X:</source>
<translation>Шаг X:</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="324"/>
<location filename="../ui_graphic_conf.h" line="470"/>
<source>Step Y:</source>
<translation>Шаг Y:</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="347"/>
<location filename="../ui_graphic_conf.h" line="471"/>
<source>Auto X</source>
<translation>Авто X</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="357"/>
<location filename="../ui_graphic_conf.h" line="472"/>
<source>Auto Y</source>
<translation>Авто Y</translation>
</message>
<message>
<source>Auto step</source>
<translation type="obsolete">Автоматический шаг</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="390"/>
<location filename="../ui_graphic_conf.h" line="473"/>
<source>Margins</source>
<translation>Поля</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="402"/>
<location filename="../graphic_conf.ui" line="412"/>
<location filename="../graphic_conf.ui" line="432"/>
<location filename="../graphic_conf.ui" line="472"/>
<location filename="../graphic_conf.ui" line="492"/>
<location filename="../ui_graphic_conf.h" line="474"/>
<location filename="../ui_graphic_conf.h" line="475"/>
<location filename="../ui_graphic_conf.h" line="477"/>
<location filename="../ui_graphic_conf.h" line="481"/>
<location filename="../ui_graphic_conf.h" line="483"/>
<source> px</source>
<translation> пикс</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="422"/>
<location filename="../ui_graphic_conf.h" line="476"/>
<source>All:</source>
<translation>Все:</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="442"/>
<location filename="../ui_graphic_conf.h" line="478"/>
<source>Right:</source>
<translation>Правое:</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="452"/>
<location filename="../ui_graphic_conf.h" line="479"/>
<source>Left:</source>
<translation>Левое:</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="462"/>
<location filename="../ui_graphic_conf.h" line="480"/>
<source>Bottom:</source>
<translation>Нижнее:</translation>
</message>
<message>
<location filename="../graphic_conf.ui" line="482"/>
<location filename="../ui_graphic_conf.h" line="482"/>
<source>Top:</source>
<translation>Верхнее:</translation>
</message>
<message>
<location filename="../graphic_conf.cpp" line="7"/>
<source>NoPen</source>
<translation>НетЛинии</translation>
</message>
<message>
<location filename="../graphic_conf.cpp" line="7"/>
<source>Solid</source>
<translation>Сплошная</translation>
</message>
<message>
<location filename="../graphic_conf.cpp" line="7"/>
<source>Dash</source>
<translation>Штриховая</translation>
</message>
<message>
<location filename="../graphic_conf.cpp" line="8"/>
<source>Dot</source>
<translation>Пунктирная</translation>
</message>
<message>
<location filename="../graphic_conf.cpp" line="8"/>
<source>Dash-Dot</source>
<translation>ШтрихПунктирная</translation>
</message>
<message>
<location filename="../graphic_conf.cpp" line="8"/>
<source>Dash-Dot-Dot</source>
<translation>ШтрихПунктирПунктирная</translation>
</message>
</context>
</TS>

View File

@@ -0,0 +1 @@
qad_plugin(graphic "Gui;Widgets;OpenGL" "")

View File

@@ -0,0 +1,69 @@
#include "graphic.h"
#include "graphicplugin.h"
#include <QtCore/QtPlugin>
GraphicPlugin::GraphicPlugin(QObject * parent): QObject(parent) {
m_initialized = false;
}
void GraphicPlugin::initialize(QDesignerFormEditorInterface * /* core */) {
if (m_initialized)
return;
// Add extension registrations, etc. here
m_initialized = true;
}
bool GraphicPlugin::isInitialized() const {
return m_initialized;
}
QWidget * GraphicPlugin::createWidget(QWidget * parent) {
return new Graphic(parent);
}
QString GraphicPlugin::name() const {
return QLatin1String("Graphic");
}
QString GraphicPlugin::group() const {
return QLatin1String("Display Widgets");
}
QIcon GraphicPlugin::icon() const {
return QIcon(":/icons/graphic.png");
}
QString GraphicPlugin::toolTip() const {
return QLatin1String("");//QLatin1String("Widget for display any math graphics with grid and navigation");
}
QString GraphicPlugin::whatsThis() const {
return QLatin1String("");
}
bool GraphicPlugin::isContainer() const {
return false;
}
QString GraphicPlugin::domXml() const {
return QLatin1String("<widget class=\"Graphic\" name=\"graphic\">\n</widget>\n");
}
QString GraphicPlugin::includeFile() const {
return QLatin1String("graphic.h");
}

View File

@@ -0,0 +1,36 @@
#ifndef GRAPHICPLUGIN_H
#define GRAPHICPLUGIN_H
#include <QObject>
#if QT_VERSION >= 0x050000
# include <QtUiPlugin/QDesignerCustomWidgetInterface>
#else
# include <QDesignerCustomWidgetInterface>
#endif
class GraphicPlugin: public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
GraphicPlugin(QObject * parent = 0);
bool isContainer() const;
bool isInitialized() const;
QIcon icon() const;
QString domXml() const;
QString group() const;
QString includeFile() const;
QString name() const;
QString toolTip() const;
QString whatsThis() const;
QWidget * createWidget(QWidget * parent);
void initialize(QDesignerFormEditorInterface * core);
private:
bool m_initialized;
};
#endif

View File

@@ -0,0 +1,17 @@
#include "qad_graphic.h"
#include "graphicplugin.h"
QADGraphic::QADGraphic(QObject * parent): QObject(parent)
{
m_widgets.append(new GraphicPlugin(this));
}
QList<QDesignerCustomWidgetInterface * > QADGraphic::customWidgets() const {
return m_widgets;
}
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2(qad_graphic_plugin, QADGraphic)
#endif

View File

@@ -0,0 +1,23 @@
#ifndef QAD_GRAPHIC_H
#define QAD_GRAPHIC_H
#include <QtDesigner/QtDesigner>
#include <QtCore/qplugin.h>
class QADGraphic: public QObject, public QDesignerCustomWidgetCollectionInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA(IID "qad.graphic")
#endif
public:
explicit QADGraphic(QObject * parent = 0);
virtual QList<QDesignerCustomWidgetInterface * > customWidgets() const;
private:
QList<QDesignerCustomWidgetInterface * > m_widgets;
};
#endif // QAD_GRAPHIC_H

View File

@@ -0,0 +1,28 @@
<RCC>
<qresource prefix="/">
<file>../icons/media-playback-pause.png</file>
<file>../icons/dialog-close.png</file>
<file>../icons/edit-clear.png</file>
<file>../icons/edit-guides.png</file>
<file>../icons/view-grid.png</file>
<file>../icons/view-autofit.png</file>
<file>../icons/configure.png</file>
<file>../icons/document-save.png</file>
<file>../icons/edit-clear-locationbar-rtl.png</file>
<file>../icons/edit-find.png</file>
<file>../icons/list-add.png</file>
<file>../icons/edit-delete.png</file>
<file>../icons/edit-copy.png</file>
<file>../icons/edit-paste.png</file>
<file>../icons/expand_s_x.png</file>
<file>../icons/expand_s_y.png</file>
<file>../icons/expand_x.png</file>
<file>../icons/expand_y.png</file>
<file>../icons/border-line.png</file>
<file>../icons/legend.png</file>
<file>../icons/graphic.png</file>
<file>../icons/view-fullscreen.png</file>
<file>../icons/pause-back.png</file>
<file>../icons/pause-front.png</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,27 @@
project(qpicalc)
find_qt(${QtVersions} Core Gui Widgets)
qt_sources(SRC)
qt_wrap(${SRC} CPPS out_CPP QMS out_QM)
qt_add_executable(${PROJECT_NAME} WIN32 out_CPP)
qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets qad_graphic)
message(STATUS "Building ${PROJECT_NAME}")
if(LIB)
if(WIN32)
qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${MINGW_BIN})
else()
if(APPLE)
qt_install(TARGETS ${PROJECT_NAME} DESTINATION /usr/local/bin)
else()
if (DEFINED ANDROID_PLATFORM)
qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${ANDROID_SYSTEM_LIBRARY_PATH}/usr/bin)
else()
qt_install(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin)
endif()
endif()
endif()
#message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"")
else()
qt_install(TARGETS ${PROJECT_NAME} DESTINATION bin)
#message(STATUS "Install ${PROJECT_NAME} to local \"bin\"")
endif()

View File

@@ -0,0 +1,188 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.2.1, 2016-03-25T15:17:49. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{948faa78-0b50-402e-a285-1bca3b08de64}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">false</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">DesktopBuild</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">DesktopBuild</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{3c749452-9483-442d-b011-933a1b5dac10}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="bool" key="CMakeProjectManager.CMakeBuildConfiguration.UseNinja">false</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/work/qpicalculator-build</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="CMakeProjectManager.MakeStep.Clean">false</value>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments">clean</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="CMakeProjectManager.MakeStep.Clean">true</value>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">all</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Установка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Локальная установка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">3</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguation.Title">qpicalculator</value>
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.Arguments"></value>
<value type="bool" key="CMakeProjectManager.CMakeRunConfiguration.UseTerminal">false</value>
<value type="QString" key="CMakeProjectManager.CMakeRunConfiguration.UserWorkingDirectory"></value>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qpicalculator</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeRunConfiguration.qpicalculator</value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">16</value>
</data>
<data>
<variable>Version</variable>
<value type="int">16</value>
</data>
</qtcreator>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 798 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 802 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 866 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 985 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 935 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 684 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

View File

@@ -0,0 +1,351 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="256"
height="256"
id="svg2"
version="1.1"
inkscape:version="0.47 r22583"
sodipodi:docname="mbricks.svg"
inkscape:export-filename="/home/peri4/pprojects/mbricks/icons/mbricks_256.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs4">
<marker
inkscape:stockid="TriangleOutM"
orient="auto"
refY="0.0"
refX="0.0"
id="TriangleOutM"
style="overflow:visible">
<path
id="path4080"
d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
transform="scale(0.4)" />
</marker>
<linearGradient
id="linearGradient7185">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop7187" />
<stop
style="stop-color:#9f5321;stop-opacity:1;"
offset="1"
id="stop7189" />
</linearGradient>
<marker
inkscape:stockid="Scissors"
orient="auto"
refY="0.0"
refX="0.0"
id="Scissors"
style="overflow:visible">
<path
id="schere"
style="marker-start:none"
d="M 9.0898857,-3.6061018 C 8.1198849,-4.7769976 6.3697607,-4.7358294 5.0623558,-4.2327734 L -3.1500488,-1.1548705 C -5.5383421,-2.4615840 -7.8983361,-2.0874077 -7.8983361,-2.7236578 C -7.8983361,-3.2209742 -7.4416699,-3.1119800 -7.5100293,-4.4068519 C -7.5756648,-5.6501286 -8.8736064,-6.5699315 -10.100428,-6.4884954 C -11.327699,-6.4958500 -12.599867,-5.5553341 -12.610769,-4.2584343 C -12.702194,-2.9520479 -11.603560,-1.7387447 -10.304005,-1.6532027 C -8.7816644,-1.4265411 -6.0857470,-2.3487593 -4.8210600,-0.082342643 C -5.7633447,1.6559151 -7.4350844,1.6607341 -8.9465707,1.5737277 C -10.201445,1.5014928 -11.708664,1.8611256 -12.307219,3.0945882 C -12.885586,4.2766744 -12.318421,5.9591904 -10.990470,6.3210002 C -9.6502788,6.8128279 -7.8098011,6.1912892 -7.4910978,4.6502760 C -7.2454393,3.4624530 -8.0864637,2.9043186 -7.7636052,2.4731223 C -7.5199917,2.1477623 -5.9728246,2.3362771 -3.2164999,1.0982979 L 5.6763468,4.2330688 C 6.8000164,4.5467672 8.1730685,4.5362646 9.1684433,3.4313614 L -0.051640930,-0.053722219 L 9.0898857,-3.6061018 z M -9.2179159,-5.5066058 C -7.9233569,-4.7838060 -8.0290767,-2.8230356 -9.3743431,-2.4433169 C -10.590861,-2.0196559 -12.145370,-3.2022863 -11.757521,-4.5207817 C -11.530373,-5.6026336 -10.104134,-6.0014137 -9.2179159,-5.5066058 z M -9.1616516,2.5107591 C -7.8108215,3.0096239 -8.0402087,5.2951947 -9.4138723,5.6023681 C -10.324932,5.9187072 -11.627422,5.4635705 -11.719569,4.3902287 C -11.897178,3.0851737 -10.363484,1.9060805 -9.1616516,2.5107591 z " />
</marker>
<marker
inkscape:stockid="TriangleOutL"
orient="auto"
refY="0.0"
refX="0.0"
id="TriangleOutL"
style="overflow:visible">
<path
id="path4077"
d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none"
transform="scale(0.8)" />
</marker>
<marker
inkscape:stockid="Arrow2Lstart"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow2Lstart"
style="overflow:visible">
<path
id="path3952"
style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
transform="scale(1.1) translate(1,0)" />
</marker>
<marker
inkscape:stockid="Arrow2Lend"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow2Lend"
style="overflow:visible;">
<path
id="path3955"
style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
transform="scale(1.1) rotate(180) translate(1,0)" />
</marker>
<marker
inkscape:stockid="Arrow1Lend"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow1Lend"
style="overflow:visible;">
<path
id="path3937"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
transform="scale(0.8) rotate(180) translate(12.5,0)" />
</marker>
<linearGradient
id="linearGradient2880">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop2882" />
<stop
style="stop-color:#a1a0ec;stop-opacity:1;"
offset="1"
id="stop2884" />
</linearGradient>
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="-27.752184 : 226.04049 : 1"
inkscape:vp_y="0 : 532.84338 : 0"
inkscape:vp_z="668.44676 : 231.8798 : 1"
inkscape:persp3d-origin="729.03793 : 212.46096 : 1"
id="perspective10" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2880"
id="radialGradient3660"
cx="44.799999"
cy="841.16217"
fx="44.799999"
fy="841.16217"
r="83.199997"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(-1.9999999,1.9999998,-2.0000003,-2.0000003,1816.7246,2433.8867)" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient7185"
id="radialGradient7191"
cx="79.29837"
cy="78.79641"
fx="79.29837"
fy="78.79641"
r="49.693359"
gradientTransform="matrix(3.7537835e-8,1.9999999,-1.9999999,6.9316032e-8,236.4014,-58.319081)"
gradientUnits="userSpaceOnUse" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient7185"
id="radialGradient7193"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(3.7537835e-8,1.9999999,-1.9999999,6.9316032e-8,236.4014,-58.319081)"
cx="79.29837"
cy="78.79641"
fx="79.29837"
fy="78.79641"
r="49.693359" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient7185"
id="radialGradient7195"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(3.7537835e-8,1.9999999,-1.9999999,6.9316032e-8,236.4014,-58.319081)"
cx="79.29837"
cy="78.79641"
fx="79.29837"
fy="78.79641"
r="49.693359" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient7185"
id="radialGradient7197"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(3.7537835e-8,1.9999999,-1.9999999,6.9316032e-8,236.4014,-58.319081)"
cx="79.29837"
cy="78.79641"
fx="79.29837"
fy="78.79641"
r="49.693359" />
<filter
inkscape:collect="always"
id="filter7823">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="1.1939744"
id="feGaussianBlur7825" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.9694029"
inkscape:cx="174.88154"
inkscape:cy="103.79424"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
borderlayer="false"
showborder="true"
inkscape:showpageshadow="true"
inkscape:snap-global="true"
inkscape:snap-page="true"
inkscape:snap-grids="false"
inkscape:snap-object-midpoints="true"
inkscape:snap-bbox="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:bbox-nodes="true"
inkscape:bbox-paths="true"
inkscape:snap-bbox-midpoints="true"
inkscape:snap-center="true"
inkscape:window-width="1680"
inkscape:window-height="957"
inkscape:window-x="-2"
inkscape:window-y="-3"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid2878"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-796.36218)">
<rect
style="fill:url(#radialGradient3660);fill-opacity:1;stroke:#000000;stroke-opacity:1;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-linecap:round;stroke-linejoin:round"
id="rect2873"
width="166.39999"
height="166.39999"
x="44.799999"
y="841.16217"
ry="19.968" />
<path
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="m 240,0 0,81 -20.47574,0"
id="path3745"
transform="translate(0,796.36218)"
sodipodi:nodetypes="ccc" />
<path
sodipodi:type="arc"
style="fill:#0000ff;stroke:#0000ff;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;fill-opacity:1;fill-rule:nonzero"
id="path3666"
sodipodi:cx="212.14285"
sodipodi:cy="102.42857"
sodipodi:rx="13.571428"
sodipodi:ry="13.571428"
d="m 225.71428,102.42857 c 0,7.4953 -6.07613,13.57143 -13.57143,13.57143 -7.49529,0 -13.57143,-6.07613 -13.57143,-13.57143 0,-7.495289 6.07614,-13.571425 13.57143,-13.571425 7.4953,0 13.57143,6.076136 13.57143,13.571425 z"
transform="matrix(0.5,0,0,0.5,106.12857,826.1479)" />
<path
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;marker-start:none;marker-end:url(#Arrow2Lend)"
d="m 0,81 40,0"
id="path3747"
transform="translate(0,796.36218)"
sodipodi:nodetypes="cc" />
<path
transform="matrix(0.5,0,0,0.5,-62.271427,826.1479)"
d="m 225.71428,102.42857 c 0,7.4953 -6.07613,13.57143 -13.57143,13.57143 -7.49529,0 -13.57143,-6.07613 -13.57143,-13.57143 0,-7.495289 6.07614,-13.571425 13.57143,-13.571425 7.4953,0 13.57143,6.076136 13.57143,13.571425 z"
sodipodi:ry="13.571428"
sodipodi:rx="13.571428"
sodipodi:cy="102.42857"
sodipodi:cx="212.14285"
id="path3743"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
sodipodi:type="arc" />
<path
sodipodi:nodetypes="ccc"
id="path5719"
d="m 5,1052.3622 0,-85.00002 35,0"
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:none;marker-end:url(#Arrow2Lend);opacity:1" />
<path
sodipodi:type="arc"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="path5721"
sodipodi:cx="212.14285"
sodipodi:cy="102.42857"
sodipodi:rx="13.571428"
sodipodi:ry="13.571428"
d="m 225.71428,102.42857 c 0,7.4953 -6.07613,13.57143 -13.57143,13.57143 -7.49529,0 -13.57143,-6.07613 -13.57143,-13.57143 0,-7.495289 6.07614,-13.571425 13.57143,-13.571425 7.4953,0 13.57143,6.076136 13.57143,13.571425 z"
transform="matrix(0.5,0,0,0.5,-62.271427,916.14789)" />
<path
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:none;marker-end:url(#Arrow2Lend)"
d="m 0,922.36217 40,0"
id="path5723"
sodipodi:nodetypes="cc" />
<path
transform="matrix(0.5,0,0,0.5,-62.271427,871.14789)"
d="m 225.71428,102.42857 c 0,7.4953 -6.07613,13.57143 -13.57143,13.57143 -7.49529,0 -13.57143,-6.07613 -13.57143,-13.57143 0,-7.495289 6.07614,-13.571425 13.57143,-13.571425 7.4953,0 13.57143,6.076136 13.57143,13.571425 z"
sodipodi:ry="13.571428"
sodipodi:rx="13.571428"
sodipodi:cy="102.42857"
sodipodi:cx="212.14285"
id="path5725"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
sodipodi:type="arc" />
<path
sodipodi:nodetypes="cccc"
id="path5727"
d="m 256,967.36218 -16,0 0,-45 -20,0"
style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
transform="matrix(0.5,0,0,0.5,106.12857,871.14789)"
d="m 225.71428,102.42857 c 0,7.4953 -6.07613,13.57143 -13.57143,13.57143 -7.49529,0 -13.57143,-6.07613 -13.57143,-13.57143 0,-7.495289 6.07614,-13.571425 13.57143,-13.571425 7.4953,0 13.57143,6.076136 13.57143,13.571425 z"
sodipodi:ry="13.571428"
sodipodi:rx="13.571428"
sodipodi:cy="102.42857"
sodipodi:cx="212.14285"
id="path5729"
style="fill:#0000ff;fill-opacity:1;fill-rule:nonzero;stroke:#0000ff;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
sodipodi:type="arc" />
<flowRoot
xml:space="preserve"
id="flowRoot5731"
style="font-size:72px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:url(#radialGradient7191);fill-opacity:1;stroke:none;font-family:DejaVu Sans;-inkscape-font-specification:Bitstream Vera Sans Bold;stroke-width:0.70352161999999996;stroke-miterlimit:4;stroke-dasharray:none;filter:url(#filter7823)"
transform="matrix(1.2,0,0,1.6836967,-25.658203,708.84411)"><flowRegion
id="flowRegion5733"
style="fill:url(#radialGradient7195);fill-opacity:1"><rect
id="rect5735"
width="145"
height="120"
x="55"
y="81"
style="font-size:72px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:url(#radialGradient7193);fill-opacity:1;font-family:DejaVu Sans;-inkscape-font-specification:Bitstream Vera Sans Bold;stroke-width:0.70352162;stroke-miterlimit:4;stroke-dasharray:none"
ry="0" /></flowRegion><flowPara
id="flowPara5737"
style="font-weight:bold;fill:url(#radialGradient7197);fill-opacity:1;-inkscape-font-specification:Bitstream Vera Sans Bold;stroke-width:0.70352162;stroke-miterlimit:4;stroke-dasharray:none">MB</flowPara></flowRoot> </g>
</svg>

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 880 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 B

Some files were not shown because too many files have changed in this diff Show More