namespace Bonxai

namespace Bonxai {

// namespaces

namespace Bonxai::details;

// structs

struct CoordT;
struct HeaderInfo;
struct Point3D;

template <class T, class = void>
struct type_has_member_x;

template <class T>
struct type_has_member_x<T, std::void_t<decltype(T::x)>>;

template <class T, class = void>
struct type_has_method_x;

template <class T>
struct type_has_method_x<T, std::void_t<decltype(T().x())>>;

template <typename T>
struct type_is_vector<std::array<T, 3>>;

template <typename>
struct type_is_vector;

// classes

template <typename DataT>
class Grid;

class Mask;

template <typename DataT>
class VoxelGrid;

// global functions

template <typename PointOut, typename PointIn>
PointOut ConvertPoint(const PointIn& v);

CoordT PosToCoord(
    const Point3D& point,
    double inv_resolution
    );

Point3D CoordToPos(
    const CoordT& coord,
    double resolution
    );

template <typename DataT>
void Serialize(std::ostream& out, const VoxelGrid<DataT>& grid);

HeaderInfo GetHeaderInfo(std::string header);

template <typename DataT>
VoxelGrid<DataT> Deserialize(std::istream& input, HeaderInfo info);

template <typename T>
void Write(
    std::ostream& out,
    const T& val
    );

template <typename T>
T Read(std::istream& input);

} // namespace Bonxai

Global Functions

template <typename DataT>
void Serialize(
    std::ostream& out,
    const VoxelGrid<DataT>& grid
    )

Serialize a grid to ostream.

Easy :)

HeaderInfo GetHeaderInfo(std::string header)

GetHeaderInfo is used to recover informations from the header of a file/stream.

Parameters:

header

first line of the file

template <typename DataT>
VoxelGrid<DataT> Deserialize(std::istream& input, HeaderInfo info)

Deserialize create a grid.

Note that template arguments need to be consistent with HeaderInfo