Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
lvr2::hdf5features::MeshIO< Derived > Class Template Reference

Hdf5IO Feature for handling MeshBuffer related IO. More...

#include <MeshIO.hpp>

Inheritance diagram for lvr2::hdf5features::MeshIO< Derived >:
Inheritance graph
[legend]

Public Member Functions

MeshBufferPtr load (HighFive::Group &group)
 
MeshBufferPtr load (std::string name)
 
MeshBufferPtr loadMesh (std::string name)
 
void save (HighFive::Group &group, const MeshBufferPtr &buffer)
 
void save (std::string name, const MeshBufferPtr &buffer)
 
void setMeshName (std::string meshName)
 
- Public Member Functions inherited from lvr2::AttributeMeshIOBase
template<typename MapT >
bool addAttributeMap (const MapT &map, const std::string &name)
 addAttributeMap Stores a general attribute map to the persistence layer where the attribute group is defined by the given map type. Note, that the map keys are also stored, if you want to store a dense attribute map, please see addDenseAttributeMap. More...
 
template<typename MapT , typename BaseVecT >
bool addDenseAttributeMap (const BaseMesh< BaseVecT > &mesh, const MapT &map, const std::string &name)
 addDenseAttributeMap Stores a dense attribute map to the persistence layer where the attribute group is defined by the given map type. More...
 
template<typename MapT >
bool addDenseAttributeMap (const MapT &map, const std::string &name)
 addDenseAttributeMap Stores a dense attribute map to the persistence layer where the attribute group is defined by the given map type. More...
 
bool addMesh (const HalfEdgeMesh< BaseVec > &hem)
 Adds a HalfEdgeMesh to the persistence layer. More...
 
template<typename MapT >
boost::optional< MapT > getAttributeMap (const std::string &name)
 getAttributeMap Reads a general attribute map from the persistence layer where the attribute group is defined by the given map type. Note, that the map keys have to be available in the persistence layer. If you want to load a DenseAttributeMap, please use getDenseAttributeMap. More...
 
template<typename MapT >
boost::optional< MapT > getDenseAttributeMap (const std::string &name)
 getDenseAttributeMap Reads a dense attribute map from the persistence layer where the attribute group is defined by the given map type. More...
 
boost::optional< HalfEdgeMesh< BaseVec > > getMesh ()
 Reads a HalfEdgeMesh from the persistence layer. More...
 

Protected Member Functions

template<typename T >
bool addChannel (const std::string group, const std::string name, const AttributeChannel< T > &channel)
 
virtual bool addChannel (const std::string group, const std::string name, const FloatChannel &channel)
 addChannel Writes a float attribute channel from the given group with the given name More...
 
virtual bool addChannel (const std::string group, const std::string name, const IndexChannel &channel)
 addChannel Writes an index attribute channel from the given group with the given name More...
 
virtual bool addChannel (const std::string group, const std::string name, const UCharChannel &channel)
 addChannel Writes an unsigned char attribute channel from the given group with the given name More...
 
bool addIndices (const IndexChannel &channel_ptr)
 Persistence layer interface, Writes the face indices of the mesh to the persistence layer. More...
 
bool addVertices (const FloatChannel &channel_ptr)
 Persistence layer interface, Writes the vertices of the mesh to the persistence layer. More...
 
template<typename T >
bool getChannel (const std::string group, const std::string name, boost::optional< AttributeChannel< T >> &channel)
 
virtual bool getChannel (const std::string group, const std::string name, FloatChannelOptional &channel)
 getChannel Reads a float attribute channel in the given group with the given name More...
 
virtual bool getChannel (const std::string group, const std::string name, IndexChannelOptional &channel)
 getChannel Reads an index attribute channel in the given group with the given name More...
 
virtual bool getChannel (const std::string group, const std::string name, UCharChannelOptional &channel)
 getChannel Reads an unsigned char attribute channel in the given group with the given name More...
 
IndexChannelOptional getIndices ()
 Persistence layer interface, Accesses the face indices of the mesh in the persistence layer. More...
 
FloatChannelOptional getVertices ()
 Persistence layer interface, Accesses the vertices of the mesh in the persistence layer. More...
 
bool isMesh (HighFive::Group &group)
 

Protected Attributes

ArrayIO< Derived > * m_array_io = static_cast<ArrayIO<Derived>*>(m_file_access)
 
Derived * m_file_access = static_cast<Derived*>(this)
 
std::string m_mesh_name = ""
 
VariantChannelIO< Derived > * m_vchannel_io = static_cast<VariantChannelIO<Derived>*>(m_file_access)
 

Static Protected Attributes

static constexpr const char * ID = "MeshIO"
 
static constexpr const char * OBJID = "MeshBuffer"
 

Detailed Description

template<typename Derived>
class lvr2::hdf5features::MeshIO< Derived >

Hdf5IO Feature for handling MeshBuffer related IO.

This Feature of the Hdf5IO handles the IO of a MeshBuffer object.

Example:

MyHdf5IO io;
// writing
io.open("test.h5");
io.save("ames#include "lvr2/io/hdf5/HDF5FeatureBase.hpp"h", mesh);
// reading
mesh_in = io.loadMesh("amesh");

Generates attributes at hdf5 group:

Dependencies:

Definition at line 52 of file MeshIO.hpp.

Member Function Documentation

◆ addChannel() [1/4]

template<typename Derived >
template<typename T >
bool lvr2::hdf5features::MeshIO< Derived >::addChannel ( const std::string  group,
const std::string  name,
const AttributeChannel< T > &  channel 
)
protected

◆ addChannel() [2/4]

template<typename Derived >
virtual bool lvr2::hdf5features::MeshIO< Derived >::addChannel ( const std::string  group,
const std::string  name,
const FloatChannel channel 
)
protectedvirtual

addChannel Writes a float attribute channel from the given group with the given name

Parameters
groupThe associated attribute group
nameThe associated attribute name
channelThe pointer to the float channel which should be written
Returns
true if the channel has been written successfully, false otherwise

Implements lvr2::GroupedChannelIO.

◆ addChannel() [3/4]

template<typename Derived >
virtual bool lvr2::hdf5features::MeshIO< Derived >::addChannel ( const std::string  group,
const std::string  name,
const IndexChannel channel 
)
protectedvirtual

addChannel Writes an index attribute channel from the given group with the given name

Parameters
groupThe associated attribute group
nameThe associated attribute name
channelThe pointer to the index channel which should be written
Returns
true if the channel has been written successfully, false otherwise

Implements lvr2::GroupedChannelIO.

◆ addChannel() [4/4]

template<typename Derived >
virtual bool lvr2::hdf5features::MeshIO< Derived >::addChannel ( const std::string  group,
const std::string  name,
const UCharChannel channel 
)
protectedvirtual

addChannel Writes an unsigned char attribute channel from the given group with the given name

Parameters
groupThe associated attribute group
nameThe associated attribute name
channelThe pointer to the unsigned char channel which should be written
Returns
true if the channel has been written successfully, false otherwise

Implements lvr2::GroupedChannelIO.

◆ addIndices()

template<typename Derived >
bool lvr2::hdf5features::MeshIO< Derived >::addIndices ( const IndexChannel channel_ptr)
protectedvirtual

Persistence layer interface, Writes the face indices of the mesh to the persistence layer.

Returns
true if the channel has been written successfully

Implements lvr2::MeshGeometryIO.

◆ addVertices()

template<typename Derived >
bool lvr2::hdf5features::MeshIO< Derived >::addVertices ( const FloatChannel channel_ptr)
protectedvirtual

Persistence layer interface, Writes the vertices of the mesh to the persistence layer.

Returns
true if the channel has been written successfully

Implements lvr2::MeshGeometryIO.

◆ getChannel() [1/4]

template<typename Derived >
template<typename T >
bool lvr2::hdf5features::MeshIO< Derived >::getChannel ( const std::string  group,
const std::string  name,
boost::optional< AttributeChannel< T >> &  channel 
)
protected

◆ getChannel() [2/4]

template<typename Derived >
virtual bool lvr2::hdf5features::MeshIO< Derived >::getChannel ( const std::string  group,
const std::string  name,
FloatChannelOptional channel 
)
protectedvirtual

getChannel Reads a float attribute channel in the given group with the given name

Parameters
groupThe associated attribute group
nameThe associated attribute name
channelThe pointer to the float channel
Returns
true if the channel has been loaded successfully, false otherwise

Implements lvr2::GroupedChannelIO.

◆ getChannel() [3/4]

template<typename Derived >
virtual bool lvr2::hdf5features::MeshIO< Derived >::getChannel ( const std::string  group,
const std::string  name,
IndexChannelOptional channel 
)
protectedvirtual

getChannel Reads an index attribute channel in the given group with the given name

Parameters
groupThe associated attribute group
nameThe associated attribute name
channelThe pointer to the index channel
Returns
true if the channel has been loaded successfully, false otherwise

Implements lvr2::GroupedChannelIO.

◆ getChannel() [4/4]

template<typename Derived >
virtual bool lvr2::hdf5features::MeshIO< Derived >::getChannel ( const std::string  group,
const std::string  name,
UCharChannelOptional channel 
)
protectedvirtual

getChannel Reads an unsigned char attribute channel in the given group with the given name

Parameters
groupThe associated attribute group
nameThe associated attribute name
channelThe pointer to the unsigned char channel
Returns
true if the channel has been loaded successfully, false otherwise

Implements lvr2::GroupedChannelIO.

◆ getIndices()

template<typename Derived >
IndexChannelOptional lvr2::hdf5features::MeshIO< Derived >::getIndices ( )
protectedvirtual

Persistence layer interface, Accesses the face indices of the mesh in the persistence layer.

Returns
An optional index channel, the channel is valid if the mesh indices have been read successfully

Implements lvr2::MeshGeometryIO.

◆ getVertices()

template<typename Derived >
FloatChannelOptional lvr2::hdf5features::MeshIO< Derived >::getVertices ( )
protectedvirtual

Persistence layer interface, Accesses the vertices of the mesh in the persistence layer.

Returns
An optional float channel, the channel is valid if the mesh vertices have been read successfully

Implements lvr2::MeshGeometryIO.

◆ isMesh()

template<typename Derived >
bool lvr2::hdf5features::MeshIO< Derived >::isMesh ( HighFive::Group group)
protected

◆ load() [1/2]

template<typename Derived >
MeshBufferPtr lvr2::hdf5features::MeshIO< Derived >::load ( HighFive::Group group)

◆ load() [2/2]

template<typename Derived >
MeshBufferPtr lvr2::hdf5features::MeshIO< Derived >::load ( std::string  name)

◆ loadMesh()

template<typename Derived >
MeshBufferPtr lvr2::hdf5features::MeshIO< Derived >::loadMesh ( std::string  name)

◆ save() [1/2]

template<typename Derived >
void lvr2::hdf5features::MeshIO< Derived >::save ( HighFive::Group group,
const MeshBufferPtr buffer 
)

◆ save() [2/2]

template<typename Derived >
void lvr2::hdf5features::MeshIO< Derived >::save ( std::string  name,
const MeshBufferPtr buffer 
)

◆ setMeshName()

template<typename Derived >
void lvr2::hdf5features::MeshIO< Derived >::setMeshName ( std::string  meshName)

Member Data Documentation

◆ ID

template<typename Derived >
constexpr const char* lvr2::hdf5features::MeshIO< Derived >::ID = "MeshIO"
staticconstexprprotected

Definition at line 74 of file MeshIO.hpp.

◆ m_array_io

template<typename Derived >
ArrayIO<Derived>* lvr2::hdf5features::MeshIO< Derived >::m_array_io = static_cast<ArrayIO<Derived>*>(m_file_access)
protected

Definition at line 77 of file MeshIO.hpp.

◆ m_file_access

template<typename Derived >
Derived* lvr2::hdf5features::MeshIO< Derived >::m_file_access = static_cast<Derived*>(this)
protected

Definition at line 67 of file MeshIO.hpp.

◆ m_mesh_name

template<typename Derived >
std::string lvr2::hdf5features::MeshIO< Derived >::m_mesh_name = ""
protected

Definition at line 69 of file MeshIO.hpp.

◆ m_vchannel_io

template<typename Derived >
VariantChannelIO<Derived>* lvr2::hdf5features::MeshIO< Derived >::m_vchannel_io = static_cast<VariantChannelIO<Derived>*>(m_file_access)
protected

Definition at line 72 of file MeshIO.hpp.

◆ OBJID

template<typename Derived >
constexpr const char* lvr2::hdf5features::MeshIO< Derived >::OBJID = "MeshBuffer"
staticconstexprprotected

Definition at line 75 of file MeshIO.hpp.


The documentation for this class was generated from the following file:
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::MeshBufferPtr
std::shared_ptr< MeshBuffer > MeshBufferPtr
Definition: MeshBuffer.hpp:217
mesh
HalfEdgeMesh< Vec > mesh
Definition: src/tools/lvr2_gs_reconstruction/Main.cpp:26


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:28