|
| template<class VoxelT > |
| static void | fromJson (const nlohmann::json &j, VoxelGrid< VoxelT > &grid, const std::string &voxelArrayName="voxels") |
| | Deserialize a voxel grid from JSON with plain voxel array (with name voxelArrayName). More...
|
| |
| template<class VoxelT > |
| static void | fromJson (const nlohmann::json &j, VoxelGrid< VoxelT > &grid, const VoxelAttributeSetterMap< VoxelT > &attributeMap) |
| | Deserialize a voxel grid from JSON. More...
|
| |
| template<class VoxelT > |
| static VoxelGrid< VoxelT > | read (const std::string &filename, const VoxelAttributeGetterMap< VoxelT > &attributeMap) |
| | Read a voxel grid from file. More...
|
| |
| template<class VoxelT > |
| static void | read (const std::string &filename, VoxelGrid< VoxelT > &grid, const VoxelAttributeGetterMap< VoxelT > &attributeMap) |
| | Read a voxel grid from file. More...
|
| |
| template<class VoxelT > |
| static VoxelGrid< VoxelT > | read (std::istream &is, const VoxelAttributeGetterMap< VoxelT > &attributeMap) |
| | Read a voxel grid from is. More...
|
| |
| template<class VoxelT > |
| static void | read (std::istream &is, VoxelGrid< VoxelT > &grid, const VoxelAttributeGetterMap< VoxelT > &attributeMap) |
| | Read a voxel grid from is. More...
|
| |
| static nlohmann::json | readJson (const std::string &filename) |
| | Read JSON from file. More...
|
| |
| static nlohmann::json | readJson (std::istream &is) |
| | Read JSON json is. More...
|
| |
| template<class VoxelT > |
| static nlohmann::json | toJson (const VoxelGrid< VoxelT > &grid, const std::string &voxelArrayName="voxels") |
| | Serialize a voxel grid to JSON with plain voxel array (with name voxelArrayName). More...
|
| |
| template<class VoxelT > |
| static nlohmann::json | toJson (const VoxelGrid< VoxelT > &grid, const VoxelAttributeGetterMap< VoxelT > &attributeMap) |
| | Serialize a voxel grid to JSON. More...
|
| |
| template<class VoxelT > |
| static void | toJson (nlohmann::json &j, const VoxelGrid< VoxelT > &grid, const std::string &voxelArrayName="voxels") |
| | Serialize a voxel grid to JSON with plain voxel array (with name voxelArrayName). More...
|
| |
| template<class VoxelT > |
| static void | toJson (nlohmann::json &j, const VoxelGrid< VoxelT > &grid, const VoxelAttributeGetterMap< VoxelT > &attributeMap) |
| | Serialize a voxel grid to JSON. More...
|
| |
| template<class VoxelT > |
| static void | write (const std::string &filename, const VoxelGrid< VoxelT > &grid, const VoxelAttributeGetterMap< VoxelT > &attributeMap, int indent=-1, char indentChar=' ') |
| | Write a voxel grid to file. More...
|
| |
| template<class VoxelT > |
| static void | write (std::ostream &os, const VoxelGrid< VoxelT > &grid, const VoxelAttributeGetterMap< VoxelT > &attributeMap, int indent=-1, char indentChar=' ') |
| | Write a voxel grid to os. More...
|
| |
| static void | writeJson (const std::string &filename, const nlohmann::json &j, int indent=-1, char indentChar=' ') |
| | Write JSON json to file. More...
|
| |
| static void | writeJson (std::ostream &os, const nlohmann::json &j, int indent=-1, char indentChar=' ') |
| | Write JSON json to os. More...
|
| |
Class to store voxel grids in a vectorized JSON format.
The methods in class can be used to store voxel grids in JSON format. A voxel grid essentially consists of its structure (grid and voxel size, pose) and its voxel data.
In the format produced by this class, there is one top-level JSON element for each voxel attribute to store. Each of this elements is an array storing the attribute value of each voxel.
For example, if a voxel has two attributes, int foo and float bar, the produces JSON object would look like this:
{
"structure: { ... },
"foo": [0 1 1 2 ... -1 0],
"bar": [0.0, 1.0, 1.1, ... , 0.0, -1.0]
}
This is done to reduce the redundancy of JSON for a large number of voxels.
Definition at line 93 of file JsonIO.h.