Grid2.h
Go to the documentation of this file.
87 void SetSizeParameters(const Size2& resolution, const Vector2D& gridSpacing, const Vector2D& origin);
DataPositionFunc CellCenterPosition() const
Returns the function that maps grid index to the cell-center position.
Abstract base class for any serializable class.
Definition: Serialization.h:20
void SetGrid(const Grid2 &other)
Sets the size parameters with given grid other.
bool HasSameShape(const Grid2 &other) const
Returns true if resolution, grid-spacing and origin are same.
virtual void SetData(const std::vector< double > &data)=0
Sets the data from a continuous linear array.
virtual void GetData(std::vector< double > *data) const =0
Fetches the data into a continuous linear array.
void ForEachCellIndex(const std::function< void(size_t, size_t)> &func) const
Invokes the given function func for each grid cell.
const BoundingBox2D & BoundingBox() const
Returns the bounding box of the grid.
BoundingBox2< double > BoundingBox2D
Double-type 2-D BoundingBox.
Definition: BoundingBox2.h:126
Definition: pybind11Utils.h:24
void ParallelForEachCellIndex(const std::function< void(size_t, size_t)> &func) const
Invokes the given function func for each grid cell in parallel.
void SwapGrid(Grid2 *other)
Swaps the size parameters with given grid other.
void SetSizeParameters(const Size2 &resolution, const Vector2D &gridSpacing, const Vector2D &origin)
Sets the size parameters including the resolution, grid spacing, and origin.
virtual std::string TypeName() const =0
Returns the type name of derived grid.
std::function< Vector2D(size_t, size_t)> DataPositionFunc
Function type for mapping data index to actual position.
Definition: Grid2.h:34