12 #include <CTraitsTest.h> 14 #include <gtest/gtest.h> 16 template class mrpt::CTraitsTest<mrpt::containers::CDynamicGrid<double>>;
25 *grid.cellByPos(-2.0, -7.0) = 9.0;
27 EXPECT_NEAR(*grid.cellByPos(3.0, 4.0), 8.0, 1e-10);
28 EXPECT_NEAR(*grid.cellByPos(-2.0, -7.0), 9.0, 1e-10);
30 grid.resize(-20.0, 20.0, -20.0, 20.0, 0.0, 0.0);
31 EXPECT_NEAR(*grid.cellByPos(3.0, 4.0), 8.0, 1e-10);
32 EXPECT_NEAR(*grid.cellByPos(-2.0, -7.0), 9.0, 1e-10);
TEST(CDynamicGrid, GetSetAndResize)
A 2D grid of dynamic size which stores any kind of data at each cell.
T * cellByPos(double x, double y)
Returns a pointer to the contents of a cell given by its coordinates, or nullptr if it is out of the ...