Go to the documentation of this file. 1 #ifndef HDF5_MAP_IO__H_
2 #define HDF5_MAP_IO__H_
7 #include <unordered_map>
72 const std::vector<float>& vertices,
73 const std::vector<uint32_t>& face_ids
110 std::unordered_map<MapVertex, std::vector<float>>
getFeatures();
141 std::vector<uint32_t>
getFaceIdsOfLabel(std::string groupName, std::string labelName);
181 void addTexture(
int index, uint32_t width, uint32_t height, uint8_t* data);
186 void addMaterials(std::vector<MapMaterial>& materials, std::vector<uint32_t>& matFaceIndices);
197 void addLabel(std::string groupName, std::string labelName, std::vector<uint32_t>& faceIds);
203 void addOrUpdateLabel(std::string groupName, std::string labelName, std::vector<uint32_t>& faceIds);
226 const uint32_t width,
227 const uint32_t height,
228 const uint8_t* pixelBuffer
282 _hid = H5Tcopy(materialHid);
294 size_t h1 = std::hash<double>()(k.
x);
295 size_t h2 = std::hash<double>()(k.
y);
296 size_t h3 = std::hash<double>()(k.
z);
297 return (h1 ^ (h2 << 1)) ^ h3;
305 return (lhs.
x == rhs.
x) && (lhs.
y == rhs.
y) && (lhs.
z == rhs.
z);
311 #endif // HDF5_MAP_IO__H_
std::vector< MapMaterial > getMaterials()
Returns materials as MapMaterial.
std::vector< std::string > getLabelGroups()
Returns all available label groups.
std::vector< uint32_t > getMaterialFaceIndices()
Returns material <-> face indices.
std::vector< float > getHeightDifference()
Returns the height difference as float vector.
MapImage getImage(hf::Group group, std::string name)
Returns the image in the group, if it exists. If not an empty struct is returned.
HDF5MapIO(std::string filename)
Opens a map file for reading and writing.
~HDF5MapIO()
Closes main groups and makes sure all buffers are flushed to the file on disc.
std::vector< uint32_t > getFaceIds()
Returns face ids vector.
std::vector< std::string > getAllLabelsOfGroup(std::string groupName)
Returns all labels inside the given group.
void addHeightDifference(std::vector< float > &diff)
Adds the height difference to the attributes group.
void addRoughness(std::vector< float > &roughness)
Adds the roughness to the attributes group.
std::vector< uint32_t > getFaceIdsOfLabel(std::string groupName, std::string labelName)
Returns face ids for the given label inside the group. E.g: label=tree_1 -> groupName=tree; labelName...
std::unordered_map< MapVertex, std::vector< float > > getFeatures()
Returns an map which keys are representing the features point in space and the values are an vector o...
std::vector< std::string > getCostLayers()
returns the names of all available costlayers
std::vector< float > getRoughness()
Returns the roughness as float vector.
void addTexture(int index, uint32_t width, uint32_t height, uint8_t *data)
std::vector< float > getVertexCosts(std::string costlayer)
Returns one costlayer as float vector.
void addVertexTextureCoords(std::vector< float > &coords)
Add vertex texture coordinates to the textures group.
static constexpr const char * CHANNELS_GROUP
std::vector< float > getVertexNormals()
Returns vertex normals vector.
std::vector< float > getVertexTextureCoords()
Returns vertex texture coordinates.
void addTextureKeypointsMap(std::unordered_map< MapVertex, std::vector< float >> &keypoints_map)
Adds the keypoints with their corresponding positions to the attributes_group. The position is saved ...
static constexpr const char * LABELS_GROUP
std::vector< MapImage > getTextures()
Returns textures vector.
static constexpr const char * TEXTURES_GROUP
hf::DataSet addVertexNormals(std::vector< float > &normals)
Add normals to the attributes group.
void addImage(hf::Group group, std::string name, const uint32_t width, const uint32_t height, const uint8_t *pixelBuffer)
Adds an image with given data set name to the given group.
void addMaterials(std::vector< MapMaterial > &materials, std::vector< uint32_t > &matFaceIndices)
Add materials as MapMaterial and the corresponding material <-> face indices.
hf::Group m_channelsGroup
bool operator()(const hdf5_map_io::MapVertex &lhs, const hdf5_map_io::MapVertex &rhs) const
std::vector< uint8_t > getVertexColors()
Returns vertex colors vector.
static constexpr const char * CLUSTERSETS_GROUP
void flush()
Flushes the file. All opened buffers are saved to disc.
std::vector< float > getVertices()
Returns vertices vector.
void addLabel(std::string groupName, std::string labelName, std::vector< uint32_t > &faceIds)
Adds the label (labelName) to the label group with the given faces. E.g.: tree_1 -> groupName=tree; l...
hf::Group m_texturesGroup
size_t getSize(hf::DataSet &data_set)
hf::Group m_clusterSetsGroup
void addOrUpdateLabel(std::string groupName, std::string labelName, std::vector< uint32_t > &faceIds)
Adds or updates the label (labelName) to the label group with the given faces. E.g....
size_t operator()(const hdf5_map_io::MapVertex &k) const
std::vector< uint8_t > data
hf::DataSet addVertexColors(std::vector< uint8_t > &colors)
Add vertex colors to the attributes group.
hdf5_map_io
Author(s): Sebastian Pütz
autogenerated on Sun Jan 21 2024 04:06:12