Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
mesh_client::MeshClient Class Reference

#include <mesh_client.h>

Inheritance diagram for mesh_client::MeshClient:
Inheritance graph
[legend]

Public Types

enum  Type : char { UINT = 0, FLOAT = 1, UCHAR = 2 }
 Defines the data type of the transferred channel to decode the byte buffer. More...
 

Public Member Functions

bool addChannel (const std::string group, const std::string name, const lvr2::FloatChannel &channel)
 addChannel Writes a float attribute channel from the given group with the given name More...
 
bool addChannel (const std::string group, const std::string name, const lvr2::IndexChannel &channel)
 addChannel Writes an index attribute channel from the given group with the given name More...
 
bool addChannel (const std::string group, const std::string name, const lvr2::UCharChannel &channel)
 addChannel Writes an unsigned char attribute channel from the given group with the given name More...
 
void addFilter (std::string channel, float min_value, float max_value)
 
bool addIndices (const lvr2::IndexChannel &channel_ptr)
 Persistence layer interface, Writes the face indices of the mesh to the persistence layer. More...
 
bool addVertices (const lvr2::FloatChannel &channel_ptr)
 Persistence layer interface, Writes the vertices of the mesh to the persistence layer. More...
 
std::string buildJson (const std::string &attribute_name)
 Builds a JSON string containing the set bounding box and the attribute name and the attribute group. More...
 
bool getChannel (const std::string group, const std::string name, lvr2::FloatChannelOptional &channel)
 getChannel Reads a float attribute channel in the given group with the given name More...
 
bool getChannel (const std::string group, const std::string name, lvr2::IndexChannelOptional &channel)
 getChannel Reads an index attribute channel in the given group with the given name More...
 
bool getChannel (const std::string group, const std::string name, lvr2::UCharChannelOptional &channel)
 getChannel Reads an unsigned char attribute channel in the given group with the given name More...
 
lvr2::IndexChannelOptional getIndices ()
 Persistence layer interface, Accesses the face indices of the mesh in the persistence layer. More...
 
lvr2::FloatChannelOptional getVertices ()
 Persistence layer interface, Accesses the vertices of the mesh in the persistence layer. More...
 
 MeshClient (const std::string &srv_url, const std::string &server_username, const std::string &server_password, const std::string &mesh_layer)
 Constructs a mesh client which receaves. More...
 
void setBoundingBox (float min_x, float min_y, float min_z, const float max_x, const float max_y, const float max_z)
 sets the Bounding box for the query which is send to the server More...
 
- Public Member Functions inherited from lvr2::AttributeMeshIOBase
bool addAttributeMap (const MapT &map, const std::string &name)
 
bool addDenseAttributeMap (const BaseMesh< BaseVecT > &mesh, const MapT &map, const std::string &name)
 
bool addDenseAttributeMap (const MapT &map, const std::string &name)
 
bool addMesh (const HalfEdgeMesh< BaseVec > &hem)
 
boost::optional< MapT > getAttributeMap (const std::string &name)
 
boost::optional< MapT > getDenseAttributeMap (const std::string &name)
 
boost::optional< HalfEdgeMesh< BaseVec > > getMesh ()
 
- Public Member Functions inherited from lvr2::MeshGeometryIO
virtual bool addIndices (const IndexChannel &channel_ptr)=0
 
- Public Member Functions inherited from lvr2::GroupedChannelIO
virtual bool addChannel (const std::string group, const std::string name, const IndexChannel &channel)=0
 
virtual bool addChannel (const std::string group, const std::string name, const IndexChannel &channel)=0
 
virtual bool getChannel (const std::string group, const std::string name, IndexChannelOptional &channel)=0
 
virtual bool getChannel (const std::string group, const std::string name, IndexChannelOptional &channel)=0
 
virtual bool getChannel (const std::string group, const std::string name, UCharChannelOptional &channel)=0
 
virtual bool getChannel (const std::string group, const std::string name, UCharChannelOptional &channel)=0
 

Private Member Functions

std::unique_ptr< std::string > requestChannel (std::string channel)
 

Private Attributes

std::array< float, 6 > bounding_box_
 
std::map< std::string, lvr2::FloatChannelfloat_channels
 
std::map< std::string, lvr2::IndexChannelindex_channels
 
std::map< std::string, std::pair< float, float > > mesh_filters_
 
std::string mesh_layer_
 
std::string server_password_
 
std::string server_url_
 
std::string server_username_
 
std::map< std::string, lvr2::UCharChanneluchar_channels
 

Detailed Description

Definition at line 52 of file mesh_client.h.

Member Enumeration Documentation

◆ Type

Defines the data type of the transferred channel to decode the byte buffer.

Enumerator
UINT 
FLOAT 
UCHAR 

Definition at line 80 of file mesh_client.h.

Constructor & Destructor Documentation

◆ MeshClient()

mesh_client::MeshClient::MeshClient ( const std::string &  srv_url,
const std::string &  server_username,
const std::string &  server_password,
const std::string &  mesh_layer 
)

Constructs a mesh client which receaves.

Parameters
srv_urlThe url of the server, use http://localhost/my/path/to/mesh if the server is used locally.

Definition at line 44 of file mesh_client.cpp.

Member Function Documentation

◆ addChannel() [1/3]

bool mesh_client::MeshClient::addChannel ( const std::string  group,
const std::string  name,
const lvr2::FloatChannel channel 
)
virtual

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.

Definition at line 286 of file mesh_client.cpp.

◆ addChannel() [2/3]

bool mesh_client::MeshClient::addChannel ( const std::string  group,
const std::string  name,
const lvr2::IndexChannel channel 
)
virtual

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() [3/3]

bool mesh_client::MeshClient::addChannel ( const std::string  group,
const std::string  name,
const lvr2::UCharChannel channel 
)
virtual

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.

◆ addFilter()

void mesh_client::MeshClient::addFilter ( std::string  channel,
float  min_value,
float  max_value 
)

Definition at line 64 of file mesh_client.cpp.

◆ addIndices()

bool mesh_client::MeshClient::addIndices ( const lvr2::IndexChannel channel_ptr)

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

Returns
true if the channel has been written successfully

Definition at line 189 of file mesh_client.cpp.

◆ addVertices()

bool mesh_client::MeshClient::addVertices ( const lvr2::FloatChannel channel_ptr)
virtual

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.

Definition at line 183 of file mesh_client.cpp.

◆ buildJson()

std::string mesh_client::MeshClient::buildJson ( const std::string &  attribute_name)

Builds a JSON string containing the set bounding box and the attribute name and the attribute group.

Parameters
attribute_nameThe name of the corresponding attribute to be requested from the server
Returns
the compsoed JSON string following the server's specification

Definition at line 69 of file mesh_client.cpp.

◆ getChannel() [1/3]

bool mesh_client::MeshClient::getChannel ( const std::string  group,
const std::string  name,
lvr2::FloatChannelOptional channel 
)
virtual

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.

Definition at line 195 of file mesh_client.cpp.

◆ getChannel() [2/3]

bool mesh_client::MeshClient::getChannel ( const std::string  group,
const std::string  name,
lvr2::IndexChannelOptional channel 
)

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

Definition at line 226 of file mesh_client.cpp.

◆ getChannel() [3/3]

bool mesh_client::MeshClient::getChannel ( const std::string  group,
const std::string  name,
lvr2::UCharChannelOptional channel 
)

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

Definition at line 256 of file mesh_client.cpp.

◆ getIndices()

lvr2::IndexChannelOptional mesh_client::MeshClient::getIndices ( )
virtual

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.

Definition at line 153 of file mesh_client.cpp.

◆ getVertices()

lvr2::FloatChannelOptional mesh_client::MeshClient::getVertices ( )
virtual

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.

Definition at line 123 of file mesh_client.cpp.

◆ requestChannel()

std::unique_ptr< std::string > mesh_client::MeshClient::requestChannel ( std::string  channel)
private

Definition at line 304 of file mesh_client.cpp.

◆ setBoundingBox()

void mesh_client::MeshClient::setBoundingBox ( float  min_x,
float  min_y,
float  min_z,
const float  max_x,
const float  max_y,
const float  max_z 
)

sets the Bounding box for the query which is send to the server

Definition at line 53 of file mesh_client.cpp.

Member Data Documentation

◆ bounding_box_

std::array<float, 6> mesh_client::MeshClient::bounding_box_
private

Definition at line 177 of file mesh_client.h.

◆ float_channels

std::map<std::string, lvr2::FloatChannel> mesh_client::MeshClient::float_channels
private

Definition at line 170 of file mesh_client.h.

◆ index_channels

std::map<std::string, lvr2::IndexChannel> mesh_client::MeshClient::index_channels
private

Definition at line 169 of file mesh_client.h.

◆ mesh_filters_

std::map<std::string, std::pair<float, float> > mesh_client::MeshClient::mesh_filters_
private

Definition at line 178 of file mesh_client.h.

◆ mesh_layer_

std::string mesh_client::MeshClient::mesh_layer_
private

Definition at line 176 of file mesh_client.h.

◆ server_password_

std::string mesh_client::MeshClient::server_password_
private

Definition at line 174 of file mesh_client.h.

◆ server_url_

std::string mesh_client::MeshClient::server_url_
private

Definition at line 172 of file mesh_client.h.

◆ server_username_

std::string mesh_client::MeshClient::server_username_
private

Definition at line 173 of file mesh_client.h.

◆ uchar_channels

std::map<std::string, lvr2::UCharChannel> mesh_client::MeshClient::uchar_channels
private

Definition at line 168 of file mesh_client.h.


The documentation for this class was generated from the following files:


mesh_client
Author(s): Sebastian Pütz , Malte kl. Piening
autogenerated on Thu Jan 25 2024 03:42:42