Inviwo  0.9.10.1
Inviwo documentation
inviwo::discretedata::DataChannel< T, N > Class Template Reference

A single vector component of a data set. More...

#include <datachannel.h>

+ Inheritance diagram for inviwo::discretedata::DataChannel< T, N >:

Classes

struct  ChannelRange
 
struct  ConstChannelRange
 

Public Types

using value_type = T
 
template<typename VecNT >
using iterator = ChannelIterator< VecNT, T, N >
 
template<typename VecNT = T>
using const_iterator = ConstChannelIterator< DataChannel< T, N >, VecNT >
 
using DefaultVec = typename std::conditional<(N<=4), typename inviwo::util::glmtype< T, N >::type, std::array< T, N > >::type
 

Public Member Functions

 DataChannel (const std::string &name, GridPrimitive definedOn=GridPrimitive::Vertex)
 Direct construction. More...
 
template<typename VecNT >
void fill (VecNT &dest, ind index) const
 Indexed point access, copy data Thread safe. More...
 
template<typename VecNT >
void operator() (VecNT &dest, ind index) const
 
template<typename VecNT = DefaultVec>
iterator< VecNT > begin ()
 
template<typename VecNT = DefaultVec>
iterator< VecNT > end ()
 
template<typename VecNT = DefaultVec>
const_iterator< VecNT > begin () const
 
template<typename VecNT = DefaultVec>
const_iterator< VecNT > end () const
 
template<typename VecNT = DefaultVec>
ChannelRange< VecNT > all ()
 Get iterator range Templated iterator return type, only specified once. More...
 
template<typename VecNT = DefaultVec>
ConstChannelRange< VecNT > all () const
 Get const iterator range Templated iterator return type, only specified once. More...
 
template<typename VecNT >
void getMin (VecNT &dest) const
 
template<typename VecNT >
void getMax (VecNT &dest) const
 
template<typename VecNT >
void getMinMax (VecNT &min, VecNT &max) const
 
- Public Member Functions inherited from inviwo::discretedata::BaseChannel< T, N >
 BaseChannel (const std::string &name, DataFormatId dataFormat, GridPrimitive definedOn=GridPrimitive::Vertex)
 
- Public Member Functions inherited from inviwo::discretedata::Channel
 Channel (ind numComponents, const std::string &name, DataFormatId dataFormat, GridPrimitive definedOn=GridPrimitive::Vertex)
 Direct construction. More...
 
const std::string getName () const
 
void setName (const std::string &)
 
GridPrimitive getGridPrimitiveType () const
 
DataFormatId getDataFormatId () const
 
ind getNumComponents () const
 
virtual ind size () const =0
 
- Public Member Functions inherited from inviwo::MetaDataOwner
 MetaDataOwner (const MetaDataOwner &rhs)=default
 
MetaDataOwneroperator= (const MetaDataOwner &rhs)=default
 
void copyMetaDataFrom (const MetaDataOwner &src)
 
void copyMetaDataTo (MetaDataOwner &dst)
 
template<typename T >
T * createMetaData (const std::string &key)
 
template<typename T , typename U >
void setMetaData (const std::string &key, U value)
 
template<typename T >
bool unsetMetaData (const std::string &key)
 unset, i.e. remove the metadata entry matching the given key and type More...
 
template<typename T , typename U >
getMetaData (const std::string &key, U val) const
 
template<typename T >
T * getMetaData (const std::string &key)
 
template<typename T >
const T * getMetaData (const std::string &key) const
 
MetaDataMapgetMetaDataMap ()
 
const MetaDataMapgetMetaDataMap () const
 
template<typename T >
bool hasMetaData (const std::string &key) const
 
virtual void serialize (Serializer &s) const
 
virtual void deserialize (Deserializer &d)
 

Static Public Attributes

static constexpr ind num_comp = N
 

Protected Member Functions

void computeMinMax () const
 
- Protected Member Functions inherited from inviwo::discretedata::BaseChannel< T, N >
virtual void fillRaw (T *dest, ind index) const =0
 
virtual ChannelGetter< T, N > * newIterator ()=0
 
- Protected Member Functions inherited from inviwo::discretedata::Channel
void setGridPrimitiveType (GridPrimitive)
 
void setDataFormatId (DataFormatId)
 
void setNumComponents (ind)
 

Friends

class DataSet
 
struct ChannelGetter< T, N >
 

Additional Inherited Members

- Protected Attributes inherited from inviwo::MetaDataOwner
MetaDataMap metaData_
 

Detailed Description

template<typename T, ind N>
class inviwo::discretedata::DataChannel< T, N >

A single vector component of a data set.

The type is arbitrary but is expected to support the basic arithmetic operations. It is specified via type, base type and number of components.

Several realizations extend this pure virtual class that differ in data storage/generation. Direct indexing is virtual, avoid where possible.

Author
Anke Friederici and Tino Weinkauf

Constructor & Destructor Documentation

◆ DataChannel()

template<typename T , ind N>
inviwo::discretedata::DataChannel< T, N >::DataChannel ( const std::string &  name,
GridPrimitive  definedOn = GridPrimitive::Vertex 
)

Direct construction.

Parameters
nameName associated with the channel
definedOnGridPrimitive the data is defined on, default: 0D vertices

Member Function Documentation

◆ all() [1/2]

template<typename T , ind N>
template<typename VecNT = DefaultVec>
ChannelRange<VecNT> inviwo::discretedata::DataChannel< T, N >::all ( )
inline

Get iterator range Templated iterator return type, only specified once.

Template Parameters
VecNTReturn type of resulting iterators

◆ all() [2/2]

template<typename T , ind N>
template<typename VecNT = DefaultVec>
ConstChannelRange<VecNT> inviwo::discretedata::DataChannel< T, N >::all ( ) const
inline

Get const iterator range Templated iterator return type, only specified once.

Template Parameters
VecNTReturn type of resulting iterators

◆ fill()

template<typename T , ind N>
template<typename VecNT >
void inviwo::discretedata::DataChannel< T, N >::fill ( VecNT &  dest,
ind  index 
) const
inline

Indexed point access, copy data Thread safe.

Parameters
destPosition to write to, expect T[NumComponents]
indexLinear point index

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