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