2019-05-10 18:56:19 +02:00
|
|
|
#ifndef VECTORTILE_H
|
|
|
|
#define VECTORTILE_H
|
|
|
|
|
|
|
|
#include "trefile.h"
|
|
|
|
#include "trefile.h"
|
|
|
|
#include "rgnfile.h"
|
|
|
|
#include "lblfile.h"
|
|
|
|
#include "netfile.h"
|
2020-06-27 22:46:26 +02:00
|
|
|
#include "nodfile.h"
|
2019-05-10 18:56:19 +02:00
|
|
|
|
|
|
|
class VectorTile {
|
|
|
|
public:
|
2020-06-27 22:46:26 +02:00
|
|
|
VectorTile() : _tre(0), _rgn(0), _lbl(0), _net(0), _nod(0), _gmp(0) {}
|
2019-09-05 22:31:13 +02:00
|
|
|
~VectorTile()
|
2020-01-21 21:50:13 +01:00
|
|
|
{
|
2020-06-27 22:46:26 +02:00
|
|
|
delete _tre; delete _rgn; delete _lbl; delete _net; delete _nod;
|
|
|
|
delete _gmp;
|
2020-01-21 21:50:13 +01:00
|
|
|
}
|
2019-05-10 18:56:19 +02:00
|
|
|
|
2020-02-17 09:19:15 +01:00
|
|
|
bool init();
|
|
|
|
void markAsBasemap() {_tre->markAsBasemap();}
|
2019-07-04 18:18:03 +02:00
|
|
|
void clear() {_tre->clear();}
|
2019-05-10 18:56:19 +02:00
|
|
|
|
|
|
|
const RectC &bounds() const {return _tre->bounds();}
|
2020-02-15 21:49:00 +01:00
|
|
|
Range zooms() const {return _tre->zooms();}
|
2019-05-10 18:56:19 +02:00
|
|
|
|
|
|
|
SubFile *file(SubFile::Type type);
|
2019-09-05 22:31:13 +02:00
|
|
|
SubFile *addFile(IMG *img, SubFile::Type type);
|
2020-02-09 23:24:48 +01:00
|
|
|
SubFile *addFile(const QString &path, SubFile::Type type);
|
2019-05-10 18:56:19 +02:00
|
|
|
|
2020-02-11 21:03:55 +01:00
|
|
|
void polys(const RectC &rect, int bits, bool baseMap,
|
|
|
|
QList<IMG::Poly> *polygons, QList<IMG::Poly> *lines,
|
|
|
|
QCache<const SubDiv *, IMG::Polys> *polyCache) const;
|
|
|
|
void points(const RectC &rect, int bits, bool baseMap,
|
|
|
|
QList<IMG::Point> *points, QCache<const SubDiv*,
|
|
|
|
QList<IMG::Point> > *pointCache) const;
|
2019-05-10 18:56:19 +02:00
|
|
|
|
2020-01-19 13:23:20 +01:00
|
|
|
static bool isTileFile(SubFile::Type type)
|
|
|
|
{
|
|
|
|
return (type == SubFile::TRE || type == SubFile::LBL
|
|
|
|
|| type == SubFile::RGN || type == SubFile::NET
|
2020-06-27 22:46:26 +02:00
|
|
|
|| type == SubFile::NOD || type == SubFile::GMP);
|
2020-01-19 13:23:20 +01:00
|
|
|
}
|
|
|
|
|
2019-05-10 18:56:19 +02:00
|
|
|
private:
|
2019-09-05 22:31:13 +02:00
|
|
|
bool initGMP();
|
|
|
|
|
2019-05-10 18:56:19 +02:00
|
|
|
TREFile *_tre;
|
|
|
|
RGNFile *_rgn;
|
|
|
|
LBLFile *_lbl;
|
|
|
|
NETFile *_net;
|
2020-06-27 22:46:26 +02:00
|
|
|
NODFile *_nod;
|
2019-09-05 22:31:13 +02:00
|
|
|
SubFile *_gmp;
|
2019-05-10 18:56:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef QT_NO_DEBUG
|
|
|
|
QDebug operator<<(QDebug dbg, const VectorTile &tile);
|
|
|
|
#endif // QT_NO_DEBUG
|
|
|
|
|
|
|
|
#endif // VECTORTILE_H
|