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"
|
2020-06-27 22:46:26 +02:00
|
|
|
#include "nodfile.h"
|
|
|
|
|
2021-04-10 15:27:40 +02:00
|
|
|
namespace IMG {
|
|
|
|
|
2020-06-27 22:46:26 +02:00
|
|
|
class LBLFile;
|
2020-11-10 00:58:19 +01:00
|
|
|
class RGNFile;
|
2020-06-27 22:46:26 +02:00
|
|
|
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) {}
|
2020-11-10 00:58:19 +01:00
|
|
|
~NETFile();
|
|
|
|
|
|
|
|
bool load(Handle &hdl, const RGNFile *rgn, Handle &rgnHdl);
|
|
|
|
void clear();
|
2019-05-10 18:56:19 +02:00
|
|
|
|
2020-11-10 00:58:19 +01:00
|
|
|
bool lblOffset(Handle &hdl, quint32 netOffset, quint32 &lblOffset) const;
|
|
|
|
bool link(const SubDiv *subdiv, quint32 shift, Handle &hdl,
|
2021-07-21 02:06:35 +02:00
|
|
|
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
|
|
|
|
2020-11-10 00:58:19 +01: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
|