Go to the documentation of this file.
   30 #ifndef LVR2_TYPES_BASEBUFFER 
   31 #define LVR2_TYPES_BASEBUFFER 
   79         return channelWidth<unsigned char>(name);
 
   89         return channelWidth<float>(name);
 
   99         return channelWidth<unsigned int>(name);
 
  112     bool hasChannel(
const std::string& name) 
const;
 
  120         return hasChannel<unsigned char>(name);
 
  129         return hasChannel<float>(name);
 
  138         return hasChannel<unsigned int>(name);
 
  161         addChannel<float>(data, name);
 
  171         addChannel<unsigned char>(data, name);
 
  181         addChannel<unsigned int>(data, name);
 
  191     void addChannel(boost::shared_array<T> array, std::string name, 
size_t n, 
size_t width);
 
  200         addChannel<unsigned int>(array, name, n, width);
 
  210         addChannel<float>(array, name, n, width);
 
  222         addChannel<unsigned char>(array, name, n, width);
 
  234     void addEmptyChannel( 
const std::string& name, 
size_t n, 
size_t width);
 
  244         addEmptyChannel<float>(name, n, width);
 
  255         addEmptyChannel<unsigned char>(name, n, width);
 
  266         addEmptyChannel<unsigned int>(name, n, width);
 
  295         return removeChannel<unsigned int>(name);
 
  308         return removeChannel<float>(name);
 
  321         return removeChannel<unsigned char>(name);
 
  337     template <
typename T>
 
  340         for(
auto it = this->typedBegin<T>(); it != this->end(); ++it)
 
  342             channels.insert(*it);
 
  355     template <
typename T>
 
  358         for(
auto it = this->typedBegin<T>(); it != this->end(); ++it)
 
  360             channels.push_back({it->first, it->second});
 
  395         return getChannel<float>(name);
 
  406         return getChannel<unsigned char>(name);
 
  417         return getChannel<unsigned int>(name);
 
  477         return getHandle<float>(idx, name);
 
  489         return getHandle<unsigned char>(idx, name);
 
  501         return getHandle<unsigned int>(idx, name);
 
  518     boost::shared_array<T> 
getArray(
const std::string& name, 
size_t& n, 
size_t& w);
 
  530         return getArray<float>(name, n, w);
 
  543         return getArray<unsigned char>(name, n, w);
 
  556         return getArray<unsigned int>(name, n, w);
 
  573     void addAtomic(T data, 
const std::string& name);
 
  626     boost::optional<T> 
getAtomic(
const std::string& name);
 
  638         return getAtomic<float>(name);
 
  651         return getAtomic<unsigned char>(name);
 
  664         return getAtomic<int>(name);
 
  671         for(
auto vchannel: *
this)
 
  673             cm.insert({vchannel.first, boost::apply_visitor(visitor, vchannel.second)});
 
  681         for(
auto elem : *
this)
 
  683             ret.insert({elem.first, elem.second.clone()});
 
  692 #include "BaseBuffer.tcc" 
  694 #endif // LVR2_TYPES_BASEBUFFER 
  
boost::shared_array< float > floatArr
void addIntAtomic(int data, const std::string &name)
Adds an atomic int value. Exists only for compatibility reasons. Dont use atomics,...
boost::optional< T > getAtomic(const std::string &name)
Gets an atomic value.
IndexChannel::Optional IndexChannelOptional
FloatChannel::Ptr FloatChannelPtr
UCharChannel::Optional UCharChannelOptional
bool hasUCharChannel(const std::string &name) const
Checks if an uchar channel is available.
size_t floatChannelWidth(const std::string &name) const
Gets a float channels width.
IndexProxy getIndexHandle(unsigned int idx, const std::string &name)
Get a Handle object (ElementProxy) of an index channel.
void getChannel(const std::string &name, FloatChannelOptional &channelOptional)
Gets a float channel and returns it as optional.
boost::optional< Channel< T > > Optional
UCharChannel::Ptr UCharChannelPtr
boost::shared_array< unsigned int > indexArray
UCharProxy getUCharHandle(unsigned int idx, const std::string &name)
Get a Handle object (ElementProxy) of an uchar channel.
boost::shared_array< T > getArray(const std::string &name, size_t &n, size_t &w)
Gets a channel as array.
void getChannel(const std::string &name, IndexChannelOptional &channelOptional)
Gets an index channel and returns it as optional.
size_t channelWidth(const std::string &name) const
Gets a channels width.
void addEmptyIndexChannel(const std::string &name, size_t n, size_t width)
Adds an empty index channel to the map.
int getAllChannelsOfType(std::vector< std::pair< std::string, Channel< T > >> &channels)
Returns all channels of type T.
boost::optional< unsigned char > ucharOptional
bool hasIndexChannel(const std::string &name) const
Checks if an index channel is available.
void addFloatChannel(floatArr array, std::string name, size_t n, size_t width)
Constructs a float channel from an boost::shared_array and saves it to the map.
void addAtomic(T data, const std::string &name)
Adds an atomic value. Exists only for compatibility reasons. Dont use atomics, they are implemented a...
Channel< T >::Optional getChannel(const std::string &name)
Gets a channel and returns it as optional.
BaseBuffer manipulate(V visitor)
FloatChannel::Optional FloatChannelOptional
floatOptional getFloatAtomic(const std::string &name)
Gets an atomic float value.
size_t indexChannelWidth(const std::string &name) const
Gets an index channels width.
boost::optional< float > floatOptional
IndexChannel::Ptr IndexChannelPtr
size_t ucharChannelWidth(const std::string &name) const
Gets an uchar channels width.
OutMapT< typename InMapT::HandleType, std::result_of_t< MapF(typename InMapT::ValueType)> > map(const InMapT &mapIn, MapF func)
Calls func for each value of the given map and save the result in the output map.
int getAllChannelsOfType(std::map< std::string, Channel< T > > &channels)
Returns all channels of type T.
indexArray getIndexArray(const std::string &name, size_t &n, size_t &w)
Gets an index channel as array.
void addIndexChannel(indexArray array, std::string name, size_t n, size_t width)
Constructs an index channel from an boost::shared_array and saves it to the map.
bool removeFloatChannel(const std::string &name)
Removes a float channel. @detail If the type is not required use: erase.
Channel< unsigned int >::Optional getIndexChannel(const std::string &name)
Gets an index channel and returns it as optional.
void addUCharChannel(ucharArr array, std::string name, size_t n, size_t width)
Constructs an uchar channel from an boost::shared_array and saves it to the map.
intOptional getIntAtomic(const std::string &name)
Gets an atomic int value.
void getChannel(const std::string &name, UCharChannelOptional &channelOptional)
Gets an uchar channel and returns it as optional.
std::shared_ptr< Channel< T > > Ptr
ChannelManager class Store and access AttributeChannels. It expands the MultiChannelMap with downwoar...
VariantChannelMap< char, unsigned char, short, unsigned short, int, unsigned int, float, double > MultiChannelMap
Datastructures for holding loaded data.
void addUCharChannel(UCharChannelPtr data, const std::string &name)
Adds an uchar channel pointer to the map.
void addChannel(typename Channel< T >::Ptr data, const std::string &name)
Adds a channel pointer to the map.
bool hasFloatChannel(const std::string &name) const
Checks if a float channel is available.
bool removeIndexChannel(const std::string &name)
Removes an index channel. @detail If the type is not required use: erase.
Channel< float >::Optional getFloatChannel(const std::string &name)
Gets a float channel and returns it as optional.
ucharArr getUCharArray(const std::string &name, size_t &n, size_t &w)
Gets an uchar channel as array.
void addUCharAtomic(unsigned char data, const std::string &name)
Adds an atomic uchar value. Exists only for compatibility reasons. Dont use atomics,...
void addFloatAtomic(float data, const std::string &name)
Adds an atomic float value. Exists only for compatibility reasons. Dont use atomics,...
bool removeUCharChannel(const std::string &name)
Removes an uchar channel. @detail If the type is not required use: erase.
FloatProxy getFloatHandle(unsigned int idx, const std::string &name)
Get a Handle object (ElementProxy) of a float channel.
void addEmptyUCharChannel(const std::string &name, size_t n, size_t width)
Adds an empty uchar channel to the map.
boost::shared_array< unsigned char > ucharArr
void addEmptyFloatChannel(const std::string &name, size_t n, size_t width)
Adds an empty float channel to the map.
void addIndexChannel(IndexChannelPtr data, const std::string &name)
Adds an index channel pointer to the map. cointer to add. cannel.
ucharOptional getUCharAtomic(const std::string &name)
Gets an atomic uchar value.
bool hasChannel(const std::string &name) const
Checks if a channel is available.
void addFloatChannel(FloatChannelPtr data, const std::string &name)
Adds a float channel pointer to the map.
Channel< unsigned char >::Optional getUCharChannel(const std::string &name)
Gets an uchar channel and returns it as optional.
bool removeChannel(const std::string &name)
Removes a channel with a specific type. @detail If the type is not required use: erase.
ElementProxy< T > getHandle(unsigned int idx, const std::string &name)
Get a Handle object (ElementProxy) of a specific typed channel.
void addEmptyChannel(const std::string &name, size_t n, size_t width)
Adds an empty channel to the map.
std::unordered_map< std::string, VariantChannel< T... > > base
boost::optional< int > intOptional
Access type index by type.
floatArr getFloatArray(const std::string &name, size_t &n, size_t &w)
Gets a float channel as array.
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:22