12#ifndef Q_HEX_WALKER_H3WORKER_H
13#define Q_HEX_WALKER_H3WORKER_H
63 explicit H3Worker(QObject *parent =
nullptr);
96 void requestCell(
const std::vector<H3Index> &index);
103 void setWalls(
const std::unordered_set<H3Index> &mazeWalls);
129 void cellComputed(quint8 res, H3Index
id,
const QVariantList &polygon,
bool isSearching);
153 void searchStats(
int exploredCells,
double timeMs,
int pathLength);
160 void pathCellsBatch(
const std::vector<std::tuple<quint8, H3Index, QVariantList>> &cells);
176 std::condition_variable
cv_;
Bidirectional A* pathfinding algorithm for H3 hexagonal grids.
Bidirectional A* pathfinding algorithm for H3 hexagonal cells.
Worker thread for asynchronous H3 operations.
std::condition_variable cv_
Condition variable for efficient waiting.
void cellsComputed(const QVariantList &polygon)
Emitted when batch cell computation completes.
void mazePolygonsComputed(const std::vector< QVariantList > &polygons)
Emitted with merged maze wall polygons for rendering.
void requestCell(const std::vector< H3Index > &index)
Requests computation for a set of H3 cells.
std::atomic< int > exploredCellsCount_
Counter for explored cells during current search.
void onAStarNewCell(H3Index cell)
Handles cell exploration events from A* algorithm.
H3AStar * astar_
A* pathfinding algorithm instance.
void searchStats(int exploredCells, double timeMs, int pathLength)
Emitted with pathfinding statistics after search completes.
void cellComputed(quint8 res, H3Index id, const QVariantList &polygon, bool isSearching)
Emitted when a single cell computation completes.
std::atomic_bool isRequested
Flag indicating a request is pending.
void setWalls(const std::unordered_set< H3Index > &mazeWalls)
Sets maze walls for pathfinding obstacle avoidance.
~H3Worker() override
Destructor.
bool has
Flag indicating pending request.
void doWork()
Main work loop executed in the worker thread.
std::unordered_set< H3Index > walls
Maze wall cells for obstacle avoidance.
PendingRequest pending_
Currently pending request.
std::mutex mutex_
Mutex for thread synchronization.
std::vector< H3Index > indexes
Cell indices to process.
void pathCellsBatch(const std::vector< std::tuple< quint8, H3Index, QVariantList > > &cells)
Emitted with batch of path cells for efficient rendering.
Structure holding queued cell computation requests.
Namespace containing H3 visualization components.