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

Data channel by function evaluated at each (linear) index. More...

#include <analyticchannel.h>

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

Public Types

using Function = typename std::function< void(Vec &, ind)>
 
- Public Types inherited from inviwo::discretedata::DataChannel< T, N >
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

 AnalyticChannel (Function dataFunction, ind numElements, const std::string &name, GridPrimitive definedOn=GridPrimitive::Vertex)
 Direct construction. More...
 
ind size () const override
 
void fillRaw (T *dest, ind index) const override
 Indexed point access, constant Will write to the memory of dest via reinterpret_cast. More...
 
- Public Member Functions inherited from inviwo::discretedata::DataChannel< T, N >
 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
 
- 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)
 

Public Attributes

ind numElements_
 
Function dataFunction_
 

Protected Member Functions

virtual CachedGetter< AnalyticChannel > * newIterator () override
 
- Protected Member Functions inherited from inviwo::discretedata::DataChannel< T, N >
void computeMinMax () const
 
- Protected Member Functions inherited from inviwo::discretedata::Channel
void setGridPrimitiveType (GridPrimitive)
 
void setDataFormatId (DataFormatId)
 
void setNumComponents (ind)
 

Additional Inherited Members

- Static Public Attributes inherited from inviwo::discretedata::DataChannel< T, N >
static constexpr ind num_comp = N
 
- Protected Attributes inherited from inviwo::MetaDataOwner
MetaDataMap metaData_
 

Detailed Description

template<typename T, ind N, typename Vec = std::array<T, N>>
class inviwo::discretedata::AnalyticChannel< T, N, Vec >

Data channel by function evaluated at each (linear) index.

Realization of DataChannel.

Data is stored implicitly by a function f:index -> vec<T, N>, where the destination memory is pre-allocated. Indices are linear.

Author
Anke Friederici and Tino Weinkauf

Constructor & Destructor Documentation

◆ AnalyticChannel()

template<typename T , ind N, typename Vec = std::array<T, N>>
inviwo::discretedata::AnalyticChannel< T, N, Vec >::AnalyticChannel ( Function  dataFunction,
ind  numElements,
const std::string &  name,
GridPrimitive  definedOn = GridPrimitive::Vertex 
)
inline

Direct construction.

Parameters
dataFunctionData generator, mapping of linear index to T*
numElementsTotal number of indexed positions
nameName associated with the channel
definedOnGridPrimitive the data is defined on, default: 0D vertices

Member Function Documentation

◆ fillRaw()

template<typename T , ind N, typename Vec = std::array<T, N>>
void inviwo::discretedata::AnalyticChannel< T, N, Vec >::fillRaw ( T *  dest,
ind  index 
) const
inlineoverridevirtual

Indexed point access, constant Will write to the memory of dest via reinterpret_cast.

Parameters
destPosition to write to, expect write of NumComponents many T
indexLinear point index

Implements inviwo::discretedata::BaseChannel< T, N >.


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