1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-03-16 11:37:46 +01:00
GPXSee/src/map/IMG/netfile.h

56 lines
1.6 KiB
C
Raw Normal View History

2021-04-10 15:27:40 +02:00
#ifndef IMG_NETFILE_H
#define IMG_NETFILE_H
2019-05-10 18:56:19 +02:00
2022-03-25 19:28:32 +01:00
#include "section.h"
2019-05-10 18:56:19 +02:00
#include "subfile.h"
#include "nodfile.h"
2021-04-10 15:27:40 +02:00
namespace IMG {
class LBLFile;
class RGNFile;
class SubDiv;
class HuffmanTable;
2022-03-19 13:25:47 +01:00
class BitStream4R;
2019-05-10 18:56:19 +02:00
class NETFile : public SubFile
{
public:
2022-03-25 19:28:32 +01:00
NETFile(const IMGData *img)
: SubFile(img), _huffmanTable(0), _tp(0), _netShift(0), _linksShift(0) {}
NETFile(const QString *path)
: SubFile(path), _huffmanTable(0), _tp(0), _netShift(0), _linksShift(0) {}
NETFile(const SubFile *gmp, quint32 offset)
: SubFile(gmp, offset), _huffmanTable(0), _tp(0), _netShift(0),
2021-04-10 15:27:40 +02:00
_linksShift(0) {}
~NETFile();
bool load(Handle &hdl, const RGNFile *rgn, Handle &rgnHdl);
void clear();
2019-05-10 18:56:19 +02:00
bool lblOffset(Handle &hdl, quint32 netOffset, quint32 &lblOffset) const;
bool link(const SubDiv *subdiv, quint32 shift, Handle &hdl,
const NODFile *nod, Handle &nodHdl2, Handle &nodHdl, const LBLFile *lbl,
Handle &lblHdl, const NODFile::BlockInfo &blockInfo, quint8 linkId,
quint8 lineId, QList<MapData::Poly> *lines) const;
2022-03-25 19:28:32 +01:00
bool hasLinks() const {return (_links.size > 0);}
2019-05-10 18:56:19 +02:00
private:
2022-03-19 13:25:47 +01:00
bool linkLabel(Handle &hdl, quint32 offset, const LBLFile *lbl,
Handle &lblHdl, Label &label) const;
bool readShape(const NODFile *nod, SubFile::Handle &nodHdl,
NODFile::AdjacencyInfo &adj, BitStream4R &bs, const SubDiv *subdiv,
quint32 shift, quint16 cnt, bool check, MapData::Poly &poly) const;
bool readLine(BitStream4R &bs, const SubDiv *subdiv,
MapData::Poly &poly) const;
2019-05-10 18:56:19 +02:00
HuffmanTable *_huffmanTable;
const HuffmanTable *_tp;
2022-03-25 19:28:32 +01:00
Section _base, _links;
quint8 _netShift, _linksShift;
2019-05-10 18:56:19 +02:00
};
2021-04-10 15:27:40 +02:00
}
#endif // IMG_NETFILE_H