SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
meshrenderchunkindex.h
Go to the documentation of this file.
1
32#ifndef OPENSWMM_RENDER_MESHRENDERCHUNKINDEX_H
33#define OPENSWMM_RENDER_MESHRENDERCHUNKINDEX_H
34
35#include <QRectF>
36#include <QVector>
37#include <QtGlobal>
38
39namespace OpenSWMM::Render
40{
41
43{
44public:
45 struct Chunk
46 {
47 int id = -1;
48 QRectF bbox;
49 QVector<int> cellIds;
50 QVector<int> edgeIds;
54 double aggregate = 0.0;
55
56 [[nodiscard]] int cellCount() const { return int(cellIds.size()); }
57 };
58
60 {
61 QVector<int> fullyInside;
62 QVector<int> boundary;
63 };
64
65 void clear();
66 [[nodiscard]] bool isEmpty() const { return m_chunks.isEmpty(); }
67
77 void build(const QVector<QRectF> &cellBBoxes,
78 const QVector<QRectF> &edgeBBoxes,
79 int targetCellsPerChunk = 4096);
80
83 [[nodiscard]] QueryResult query(const QRectF &rect) const;
84
85 [[nodiscard]] const QVector<Chunk> &chunks() const { return m_chunks; }
86 [[nodiscard]] QVector<Chunk> &chunksMutable() { return m_chunks; }
87 [[nodiscard]] int chunkCount() const { return int(m_chunks.size()); }
88
89private:
90 QVector<Chunk> m_chunks;
91};
92
93} // namespace OpenSWMM::Render
94
95#endif // OPENSWMM_RENDER_MESHRENDERCHUNKINDEX_H
Definition meshrenderchunkindex.h:43
QueryResult query(const QRectF &rect) const
Definition meshrenderchunkindex.cpp:108
const QVector< Chunk > & chunks() const
Definition meshrenderchunkindex.h:85
QVector< Chunk > & chunksMutable()
Definition meshrenderchunkindex.h:86
void clear()
Definition meshrenderchunkindex.cpp:36
bool isEmpty() const
Definition meshrenderchunkindex.h:66
void build(const QVector< QRectF > &cellBBoxes, const QVector< QRectF > &edgeBBoxes, int targetCellsPerChunk=4096)
Definition meshrenderchunkindex.cpp:41
int chunkCount() const
Definition meshrenderchunkindex.h:87
Definition gisrasterlayer.h:40
Definition meshrenderchunkindex.h:46
double aggregate
Definition meshrenderchunkindex.h:54
QRectF bbox
union of member bboxes (superset)
Definition meshrenderchunkindex.h:48
int cellCount() const
Definition meshrenderchunkindex.h:56
QVector< int > edgeIds
member edge indices (input order)
Definition meshrenderchunkindex.h:50
QVector< int > cellIds
member cell indices (input order)
Definition meshrenderchunkindex.h:49
Definition meshrenderchunkindex.h:60
QVector< int > boundary
chunk ids intersecting the rect edge
Definition meshrenderchunkindex.h:62
QVector< int > fullyInside
chunk ids fully contained in the rect
Definition meshrenderchunkindex.h:61