Compare commits
2 Commits
4c7b9444b6
...
12f0603413
| Author | SHA1 | Date | |
|---|---|---|---|
| 12f0603413 | |||
| 18526cdf29 |
@@ -1189,13 +1189,13 @@ void Graphic::exportGraphics(QString filename, QChar decimal_point, bool view_on
|
||||
if (func_gridMarkX) {
|
||||
line += func_gridMarkX(g.polyline[ind].x()).replace('.', decimal_point);
|
||||
} else {
|
||||
line += QString::number(g.polyline[ind].x(), 'g', 9).replace('.', decimal_point);
|
||||
line += QString::number(g.polyline[ind].x(), 'g', 15).replace('.', decimal_point);
|
||||
}
|
||||
line += ";";
|
||||
if (func_gridMarkY) {
|
||||
line += func_gridMarkY(g.polyline[ind].y()).replace('.', decimal_point);
|
||||
} else {
|
||||
line += QString::number(g.polyline[ind].y(), 'g', 9).replace('.', decimal_point);
|
||||
line += QString::number(g.polyline[ind].y(), 'g', 12).replace('.', decimal_point);
|
||||
}
|
||||
}
|
||||
++ind;
|
||||
|
||||
@@ -343,7 +343,7 @@
|
||||
<item>
|
||||
<widget class="QToolButton" name="graphic_buttonSaveMenu">
|
||||
<property name="toolTip">
|
||||
<string>Save image ...</string>
|
||||
<string>Save ...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../blockview/qad_blockview.qrc">
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
<source>Cursor axis</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.ui" line="346"/>
|
||||
<source>Save ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.ui" line="435"/>
|
||||
<source>Free</source>
|
||||
@@ -54,11 +59,6 @@
|
||||
<source>Configure ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.ui" line="346"/>
|
||||
<source>Save image ...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.ui" line="477"/>
|
||||
<source>Save to Image ...</source>
|
||||
@@ -116,97 +116,97 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="479"/>
|
||||
<location filename="../graphic.cpp" line="1708"/>
|
||||
<location filename="../graphic.cpp" line="481"/>
|
||||
<location filename="../graphic.cpp" line="1722"/>
|
||||
<source>Cursor: </source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="492"/>
|
||||
<location filename="../graphic.cpp" line="494"/>
|
||||
<source>Selection</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="492"/>
|
||||
<location filename="../graphic.cpp" line="494"/>
|
||||
<source>Size</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="499"/>
|
||||
<location filename="../graphic.cpp" line="507"/>
|
||||
<location filename="../graphic.cpp" line="501"/>
|
||||
<location filename="../graphic.cpp" line="509"/>
|
||||
<source>Range</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="500"/>
|
||||
<location filename="../graphic.cpp" line="508"/>
|
||||
<location filename="../graphic.cpp" line="502"/>
|
||||
<location filename="../graphic.cpp" line="510"/>
|
||||
<source>Length</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="613"/>
|
||||
<location filename="../graphic.cpp" line="669"/>
|
||||
<location filename="../graphic.cpp" line="615"/>
|
||||
<location filename="../graphic.cpp" line="671"/>
|
||||
<source>Cursor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1141"/>
|
||||
<location filename="../graphic.cpp" line="1695"/>
|
||||
<location filename="../graphic.cpp" line="1146"/>
|
||||
<location filename="../graphic.cpp" line="1703"/>
|
||||
<source>Export graphics</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1141"/>
|
||||
<location filename="../graphic.cpp" line="1146"/>
|
||||
<source>Can`t open file "%1"!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1676"/>
|
||||
<location filename="../graphic.cpp" line="1684"/>
|
||||
<source>ms</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1676"/>
|
||||
<location filename="../graphic.cpp" line="1684"/>
|
||||
<source>s</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1676"/>
|
||||
<location filename="../graphic.cpp" line="1684"/>
|
||||
<source>m</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1676"/>
|
||||
<location filename="../graphic.cpp" line="1684"/>
|
||||
<source>h</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="2333"/>
|
||||
<location filename="../graphic.cpp" line="2347"/>
|
||||
<source>Save Image</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1264"/>
|
||||
<location filename="../graphic.cpp" line="1270"/>
|
||||
<source>y(x)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1701"/>
|
||||
<location filename="../graphic.cpp" line="1709"/>
|
||||
<source>Select decimal point</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1701"/>
|
||||
<location filename="../graphic.cpp" line="1709"/>
|
||||
<source>Decimal point:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="2359"/>
|
||||
<location filename="../graphic.cpp" line="2373"/>
|
||||
<source>Save GIF</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="2433"/>
|
||||
<location filename="../graphic.cpp" line="2440"/>
|
||||
<source>Check all</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@@ -384,32 +384,32 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic_conf.cpp" line="46"/>
|
||||
<location filename="../graphic_conf.cpp" line="59"/>
|
||||
<source>NoPen</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic_conf.cpp" line="46"/>
|
||||
<location filename="../graphic_conf.cpp" line="59"/>
|
||||
<source>Solid</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic_conf.cpp" line="46"/>
|
||||
<location filename="../graphic_conf.cpp" line="59"/>
|
||||
<source>Dash</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic_conf.cpp" line="46"/>
|
||||
<location filename="../graphic_conf.cpp" line="59"/>
|
||||
<source>Dot</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic_conf.cpp" line="46"/>
|
||||
<location filename="../graphic_conf.cpp" line="59"/>
|
||||
<source>Dash-Dot</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic_conf.cpp" line="46"/>
|
||||
<location filename="../graphic_conf.cpp" line="59"/>
|
||||
<source>Dash-Dot-Dot</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
||||
@@ -17,6 +17,11 @@
|
||||
<source>Cursor axis</source>
|
||||
<translation>Плавающие оси</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.ui" line="346"/>
|
||||
<source>Save ...</source>
|
||||
<translation>Сохранить ...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.ui" line="435"/>
|
||||
<source>Free</source>
|
||||
@@ -67,9 +72,8 @@
|
||||
<translation>Настроить ...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.ui" line="346"/>
|
||||
<source>Save image ...</source>
|
||||
<translation>Сохранить изображение ...</translation>
|
||||
<translation type="vanished">Сохранить изображение ...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.ui" line="477"/>
|
||||
@@ -144,97 +148,97 @@
|
||||
<translation type="vanished">Свободная трассировка</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="479"/>
|
||||
<location filename="../graphic.cpp" line="1708"/>
|
||||
<location filename="../graphic.cpp" line="481"/>
|
||||
<location filename="../graphic.cpp" line="1722"/>
|
||||
<source>Cursor: </source>
|
||||
<translation>Курсор: </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="492"/>
|
||||
<location filename="../graphic.cpp" line="494"/>
|
||||
<source>Selection</source>
|
||||
<translation>Выделение</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="492"/>
|
||||
<location filename="../graphic.cpp" line="494"/>
|
||||
<source>Size</source>
|
||||
<translation>Размер</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="499"/>
|
||||
<location filename="../graphic.cpp" line="507"/>
|
||||
<location filename="../graphic.cpp" line="501"/>
|
||||
<location filename="../graphic.cpp" line="509"/>
|
||||
<source>Range</source>
|
||||
<translation>Диапазон</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="500"/>
|
||||
<location filename="../graphic.cpp" line="508"/>
|
||||
<location filename="../graphic.cpp" line="502"/>
|
||||
<location filename="../graphic.cpp" line="510"/>
|
||||
<source>Length</source>
|
||||
<translation>Длина</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="613"/>
|
||||
<location filename="../graphic.cpp" line="669"/>
|
||||
<location filename="../graphic.cpp" line="615"/>
|
||||
<location filename="../graphic.cpp" line="671"/>
|
||||
<source>Cursor</source>
|
||||
<translation>Курсор</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1141"/>
|
||||
<location filename="../graphic.cpp" line="1695"/>
|
||||
<location filename="../graphic.cpp" line="1146"/>
|
||||
<location filename="../graphic.cpp" line="1703"/>
|
||||
<source>Export graphics</source>
|
||||
<translation>Экспорт графиков</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1141"/>
|
||||
<location filename="../graphic.cpp" line="1146"/>
|
||||
<source>Can`t open file "%1"!</source>
|
||||
<translation>Невозможно открыть файл "%1"!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1676"/>
|
||||
<location filename="../graphic.cpp" line="1684"/>
|
||||
<source>ms</source>
|
||||
<translation>мс</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1676"/>
|
||||
<location filename="../graphic.cpp" line="1684"/>
|
||||
<source>s</source>
|
||||
<translation>сек</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1676"/>
|
||||
<location filename="../graphic.cpp" line="1684"/>
|
||||
<source>m</source>
|
||||
<translation>мин</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1676"/>
|
||||
<location filename="../graphic.cpp" line="1684"/>
|
||||
<source>h</source>
|
||||
<translation>ч</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="2333"/>
|
||||
<location filename="../graphic.cpp" line="2347"/>
|
||||
<source>Save Image</source>
|
||||
<translation>Сохранить изображение</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1264"/>
|
||||
<location filename="../graphic.cpp" line="1270"/>
|
||||
<source>y(x)</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1701"/>
|
||||
<location filename="../graphic.cpp" line="1709"/>
|
||||
<source>Select decimal point</source>
|
||||
<translation>Выберите десятичный разделитель</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="1701"/>
|
||||
<location filename="../graphic.cpp" line="1709"/>
|
||||
<source>Decimal point:</source>
|
||||
<translation>Десятичный разделитель:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="2359"/>
|
||||
<location filename="../graphic.cpp" line="2373"/>
|
||||
<source>Save GIF</source>
|
||||
<translation>Сохранить GIF</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic.cpp" line="2433"/>
|
||||
<location filename="../graphic.cpp" line="2440"/>
|
||||
<source>Check all</source>
|
||||
<translation>Выбрать все</translation>
|
||||
</message>
|
||||
@@ -416,32 +420,32 @@
|
||||
<translation>Верхнее:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic_conf.cpp" line="46"/>
|
||||
<location filename="../graphic_conf.cpp" line="59"/>
|
||||
<source>NoPen</source>
|
||||
<translation>НетЛинии</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic_conf.cpp" line="46"/>
|
||||
<location filename="../graphic_conf.cpp" line="59"/>
|
||||
<source>Solid</source>
|
||||
<translation>Сплошная</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic_conf.cpp" line="46"/>
|
||||
<location filename="../graphic_conf.cpp" line="59"/>
|
||||
<source>Dash</source>
|
||||
<translation>Штриховая</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic_conf.cpp" line="46"/>
|
||||
<location filename="../graphic_conf.cpp" line="59"/>
|
||||
<source>Dot</source>
|
||||
<translation>Пунктирная</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic_conf.cpp" line="46"/>
|
||||
<location filename="../graphic_conf.cpp" line="59"/>
|
||||
<source>Dash-Dot</source>
|
||||
<translation>ШтрихПунктирная</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../graphic_conf.cpp" line="46"/>
|
||||
<location filename="../graphic_conf.cpp" line="59"/>
|
||||
<source>Dash-Dot-Dot</source>
|
||||
<translation>ШтрихПунктирПунктирная</translation>
|
||||
</message>
|
||||
|
||||
@@ -92,21 +92,25 @@ void MapView::setCachePath(const QString & p) {
|
||||
}
|
||||
|
||||
|
||||
void collectDownloadIndeces(QQueue<OSM::TileIndex> & indeces, OSM::TileIndex index, int target_zoom_level) {
|
||||
indeces << index;
|
||||
void collectDownloadIndeces(OSMTileCache * cache, QQueue<OSM::TileIndex> & indeces, OSM::TileIndex index, int target_zoom_level, bool only_new) {
|
||||
if (only_new) {
|
||||
if (!cache->isTileFileExists(index))
|
||||
indeces << index;
|
||||
} else
|
||||
indeces << index;
|
||||
if (index.z >= target_zoom_level) return;
|
||||
int z = index.z + 1;
|
||||
int x = index.x * 2;
|
||||
int y = index.y * 2;
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
for (int j = 0; j < 2; ++j) {
|
||||
collectDownloadIndeces(indeces, (OSM::TileIndex){z, x + i, y + j}, target_zoom_level);
|
||||
collectDownloadIndeces(cache, indeces, (OSM::TileIndex){z, x + i, y + j}, target_zoom_level, only_new);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MapView::downloadCurrentView(int target_zoom_level) {
|
||||
void MapView::downloadCurrentView(int target_zoom_level, bool only_new) {
|
||||
int sx = qMax(0, (int)floor(view_rect.left() * tiles_side));
|
||||
int sy = qMax(0, (int)floor(view_rect.top() * tiles_side));
|
||||
int ex = qMin(tiles_side, (int)ceil(view_rect.right() * tiles_side));
|
||||
@@ -115,7 +119,7 @@ void MapView::downloadCurrentView(int target_zoom_level) {
|
||||
QQueue<OSM::TileIndex> indeces;
|
||||
for (int ix = sx; ix < ex; ++ix) {
|
||||
for (int iy = sy; iy < ey; ++iy) {
|
||||
collectDownloadIndeces(indeces, (OSM::TileIndex){zoom_level, ix, iy}, target_zoom_level);
|
||||
collectDownloadIndeces(cache, indeces, (OSM::TileIndex){zoom_level, ix, iy}, target_zoom_level, only_new);
|
||||
}
|
||||
}
|
||||
if (indeces.size() < 4) return;
|
||||
@@ -166,6 +170,7 @@ void MapView::downloadCurrentView(int target_zoom_level) {
|
||||
void MapView::mousePressEvent(QMouseEvent * e) {
|
||||
is_pan = false;
|
||||
press_point = e->pos();
|
||||
zoom_anchor = press_point;
|
||||
last_click_coord = OSM::xy2geo(mapToNorm(press_point));
|
||||
}
|
||||
|
||||
@@ -199,6 +204,11 @@ void MapView::mouseMoveEvent(QMouseEvent * e) {
|
||||
if ((e->pos() - press_point).manhattanLength() >= QApplication::startDragDistance()) is_pan = true;
|
||||
}
|
||||
}
|
||||
if (e->buttons() == Qt::RightButton) {
|
||||
auto dp = e->pos() - press_point;
|
||||
press_point = e->pos();
|
||||
zoom(1. - dp.y() / 50., zoom_anchor);
|
||||
}
|
||||
updateMouse(e->pos());
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
QString cachePath() const;
|
||||
void setCachePath(const QString & p);
|
||||
|
||||
void downloadCurrentView(int target_zoom_level = 17);
|
||||
void downloadCurrentView(int target_zoom_level = 17, bool only_new = true);
|
||||
|
||||
protected:
|
||||
QSize sizeHint() const override { return QSize(200, 200); }
|
||||
@@ -92,7 +92,7 @@ private:
|
||||
MapItemBase * hover = nullptr;
|
||||
QPointF center_ = QPointF(0.5, 0.5);
|
||||
QPointF last_click_coord = center_;
|
||||
QPoint press_point;
|
||||
QPoint press_point, zoom_anchor;
|
||||
QPixmap background;
|
||||
QRectF view_rect;
|
||||
QVector<MapItemBase *> items_;
|
||||
|
||||
@@ -54,6 +54,14 @@ OSM::TilePixmap OSMTileCache::getTile(OSM::TileIndex index, QRectF & rect_src) {
|
||||
}
|
||||
|
||||
|
||||
bool OSMTileCache::isTileFileExists(OSM::TileIndex index) const {
|
||||
QString hashdir = index.cacheDir();
|
||||
if (!cache_dir.exists(hashdir)) return false;
|
||||
QString hashname = hashdir + "/" + index.hashName();
|
||||
return cache_dir.exists(hashname);
|
||||
}
|
||||
|
||||
|
||||
void OSMTileCache::setCacheRoot(const QString & p) {
|
||||
cache_root = p;
|
||||
cache_dir.setPath(cache_root);
|
||||
|
||||
@@ -50,6 +50,8 @@ public:
|
||||
void tileDownloaded(OSM::TileIndex index, const QPixmap & pixmap);
|
||||
OSM::TilePixmap getTile(OSM::TileIndex index, QRectF & rect_src);
|
||||
|
||||
bool isTileFileExists(OSM::TileIndex index) const;
|
||||
|
||||
QString cacheRoot() const { return cache_root; }
|
||||
void setCacheRoot(const QString & p);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user