FireSTARR
Loading...
Searching...
No Matches
PointSpread.h
1/* SPDX-License-Identifier: AGPL-3.0-or-later */
2#include "stdafx.h"
3#include "CellPoints.h"
4#include "FireSpread.h"
5namespace fs
6{
7static void spread_points(
8 CellPointsMap& result,
9 const CellPoints& cell_pts,
10 const OffsetSet& offsets_after_duration,
11 const DurationSize arrival_time
12) noexcept
13{
14 // done with list so don't need mutex
15 auto pt_dirs = cell_pts.point_directions();
16 std::sort(pt_dirs.begin(), pt_dirs.end());
17 const auto it_pt_dirs_last = std::unique(pt_dirs.begin(), pt_dirs.end());
18 auto it_pt_dirs = pt_dirs.cbegin();
19 while (it_pt_dirs != it_pt_dirs_last)
20 {
21 const auto& [pt, dir] = *it_pt_dirs;
22 for (const ROSOffset& r : offsets_after_duration)
23 {
24 const auto& x_o = r.offset.x;
25 const auto& y_o = r.offset.y;
26 const XYPos pt_new{XPos{x_o + pt.x.value}, YPos{y_o + pt.y.value}};
27 std::ignore = insert(
28 result,
29 pt,
30 SpreadData{arrival_time, r.intensity, r.ros, r.raz, Direction{Degrees{dir}}},
31 pt_new
32 );
33 }
34 ++it_pt_dirs;
35 }
36}
37}