20 this->
resize(-1.0, 1.0, -1.0, 1.0, 0.5);
23 double xmin,
double xmax,
double ymin,
double ymax,
24 double resolution) noexcept
26 this->resize(xmin, xmax, ymin, ymax, resolution);
30 double xmin,
double xmax,
double ymin,
double ymax,
31 double resolution) noexcept
33 const double def = .0;
34 if (m_grid.getResolution() == resolution)
35 m_grid.resize(xmin, xmax, ymin, ymax, def, .0);
37 m_grid.setSize(xmin, xmax, ymin, ymax, resolution, &def);
39 const size_t nx = m_grid.getSizeX(),
ny = m_grid.getSizeY();
41 std::vector<double> idx2x(
nx), idx2y(
ny);
43 for (
size_t ix = 0; ix <
nx; ix++) idx2x[ix] = m_grid.idx2x(ix);
44 for (
size_t iy = 0; iy <
ny; iy++) idx2y[iy] = m_grid.idx2y(iy);
46 for (
size_t ix = 0; ix <
nx; ix++)
48 const double x = idx2x[ix];
49 for (
size_t iy = 0; iy <
ny; iy++)
51 const double y = idx2y[iy];
52 double* cp = m_grid.cellByIndex(ix, iy);
53 if (cp) *cp = ::atan2(
y,
x);
61 const double* cp = m_grid.cellByPos(
x,
y);
62 if (!cp)
return false;
69 const std::map<double, double>& lst_resolutions2extensions) noexcept
71 resize(lst_resolutions2extensions);
74 const std::map<double, double>& lst_resolutions2extensions) noexcept
78 for (
const auto& it : lst_resolutions2extensions)
80 const double res = it.first;
81 const double exten = it.second;
85 -exten, exten, -exten, exten,
res);
88 std::vector<double> idx2x(
nx), idx2y(
ny);
90 for (
size_t ix = 0; ix <
nx; ix++) idx2x[ix] = dg.
idx2x(ix);
91 for (
size_t iy = 0; iy <
ny; iy++) idx2y[iy] = dg.
idx2y(iy);
93 for (
size_t ix = 0; ix <
nx; ix++)
95 const double x = idx2x[ix];
96 for (
size_t iy = 0; iy <
ny; iy++)
98 const double y = idx2y[iy];
100 if (cp) *cp = ::atan2(
y,
x);
107 double y,
double x,
double& out_atan2)
const noexcept
109 for (
const auto& it : m_grids)
111 const double exten = it.first;
114 if (std::abs(
x) > exten || std::abs(
y) > exten)
continue;