Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::TemplateColumn< T > Class Template Reference

Data column used for plotting which represents a named buffer of type T. The name is used as column header. More...

#include <column.h>

+ Inheritance diagram for inviwo::TemplateColumn< T >:

Public Types

using type = T
 

Public Member Functions

 TemplateColumn (std::string_view header, std::shared_ptr< Buffer< T > > buffer=std::make_shared< Buffer< T > >(), Unit unit=Unit{}, std::optional< dvec2 > range=std::nullopt)
 
 TemplateColumn (std::string_view header, std::vector< T > data, Unit unit=Unit{}, std::optional< dvec2 > range=std::nullopt)
 
 TemplateColumn (std::string_view header, size_t size, Unit unit=Unit{}, std::optional< dvec2 > range=std::nullopt)
 
 TemplateColumn (const TemplateColumn< T > &rhs)
 
 TemplateColumn (const TemplateColumn< T > &rhs, const std::vector< std::uint32_t > &rowSelection)
 
 TemplateColumn (TemplateColumn< T > &&rhs)
 
TemplateColumn< T > & operator= (const TemplateColumn< T > &rhs)
 
TemplateColumn< T > & operator= (TemplateColumn< T > &&rhs)
 
virtual TemplateColumnclone () const override
 
virtual TemplateColumnclone (const std::vector< std::uint32_t > &rowSelection) const override
 
virtual ColumnType getColumnType () const override
 
virtual const std::string & getHeader () const override
 
void setHeader (std::string_view header) override
 
virtual Unit getUnit () const override
 
virtual void setUnit (Unit unit) override
 
virtual void setCustomRange (std::optional< dvec2 > range) override
 
virtual std::optional< dvec2 > getCustomRange () const override
 
virtual dvec2 getDataRange () const override
 
virtual dvec2 getRange () const override
 
virtual void add (const T &value)
 
virtual void add (std::string_view value) override
 Converts given value to type T, which is added to the column.
 
virtual void append (const Column &col) override
 
virtual void set (size_t idx, const T &value)
 
get (size_t idx) const
 
operator[] (size_t idx) const
 
virtual double getAsDouble (size_t idx) const override
 
void setBuffer (std::shared_ptr< Buffer< T > > buffer)
 
virtual std::string getAsString (size_t idx) const override
 
virtual std::shared_ptr< BufferBasegetBuffer () override
 
virtual std::shared_ptr< const BufferBasegetBuffer () const override
 
std::shared_ptr< Buffer< T > > getTypedBuffer ()
 
std::shared_ptr< const Buffer< T > > getTypedBuffer () const
 
virtual size_t getSize () const override
 
auto begin ()
 
auto end ()
 
auto begin () const
 
auto end () const
 
- Public Member Functions inherited from inviwo::Column
- Public Member Functions inherited from inviwo::MetaDataOwner
 MetaDataOwner (const MetaDataOwner &rhs)=default
 
 MetaDataOwner (MetaDataOwner &rhs)=default
 
MetaDataOwneroperator= (const MetaDataOwner &rhs)=default
 
MetaDataOwneroperator= (MetaDataOwner &)=default
 
void copyMetaDataFrom (const MetaDataOwner &src)
 
void copyMetaDataTo (MetaDataOwner &dst)
 
template<typename T >
requires std::derived_from<T, MetaData>
T * createMetaData (std::string_view key)
 
template<typename T , typename U >
requires std::derived_from<T, MetaData> && Settable<T, U>
void setMetaData (std::string_view key, U value)
 
template<typename T >
requires std::derived_from<T, MetaData>
bool unsetMetaData (std::string_view key)
 unset, i.e. remove the metadata entry matching the given key and type
 
template<typename T , typename U >
requires std::derived_from<T, MetaData> && Gettable<T, U>
getMetaData (std::string_view key, U val) const
 
template<typename T >
requires std::derived_from<T, MetaData>
T * getMetaData (std::string_view key)
 
template<typename T >
requires std::derived_from<T, MetaData>
const T * getMetaData (std::string_view key) const
 
MetaDataMapgetMetaDataMap ()
 
const MetaDataMapgetMetaDataMap () const
 
bool hasMetaData (std::string_view key) const
 
template<typename T >
requires std::derived_from<T, MetaData>
bool hasMetaData (std::string_view key) const
 
void serialize (Serializer &s) const
 
void deserialize (Deserializer &d)
 

Protected Attributes

std::string header_
 
Unit unit_
 
std::optional< dvec2 > range_
 
std::shared_ptr< Buffer< T > > buffer_
 
- Protected Attributes inherited from inviwo::MetaDataOwner
MetaDataMap metaData_
 

Detailed Description

template<typename T>
class inviwo::TemplateColumn< T >

Data column used for plotting which represents a named buffer of type T. The name is used as column header.

Member Function Documentation

◆ add()

template<typename T >
virtual void inviwo::TemplateColumn< T >::add ( std::string_view value)
overridevirtual

Converts given value to type T, which is added to the column.

Parameters
value
Exceptions
InvalidConversionif the value cannot be converted to T

Implements inviwo::Column.

◆ append()

template<typename T >
virtual void inviwo::TemplateColumn< T >::append ( const Column & col)
overridevirtual

Appends all rows from column col

Parameters
col
Exceptions
Exceptionif data format does not match

Implements inviwo::Column.

◆ clone() [1/2]

template<typename T >
virtual TemplateColumn * inviwo::TemplateColumn< T >::clone ( ) const
overridevirtual

Implements inviwo::Column.

◆ clone() [2/2]

template<typename T >
virtual TemplateColumn * inviwo::TemplateColumn< T >::clone ( const std::vector< std::uint32_t > & rowSelection) const
overridevirtual

Implements inviwo::Column.

◆ getAsDouble()

template<typename T >
virtual double inviwo::TemplateColumn< T >::getAsDouble ( size_t idx) const
overridevirtual

Implements inviwo::Column.

◆ getAsString()

template<typename T >
virtual std::string inviwo::TemplateColumn< T >::getAsString ( size_t idx) const
overridevirtual

Implements inviwo::Column.

◆ getBuffer() [1/2]

template<typename T >
virtual std::shared_ptr< const BufferBase > inviwo::TemplateColumn< T >::getBuffer ( ) const
overridevirtual

Implements inviwo::Column.

◆ getBuffer() [2/2]

template<typename T >
virtual std::shared_ptr< BufferBase > inviwo::TemplateColumn< T >::getBuffer ( )
overridevirtual

Implements inviwo::Column.

◆ getColumnType()

template<typename T >
virtual ColumnType inviwo::TemplateColumn< T >::getColumnType ( ) const
overridevirtual

Implements inviwo::Column.

◆ getCustomRange()

template<typename T >
virtual std::optional< dvec2 > inviwo::TemplateColumn< T >::getCustomRange ( ) const
overridevirtual

Returns the custom column range. If no range has been set previously, the return value will be std::nullopt.

Implements inviwo::Column.

◆ getDataRange()

template<typename T >
virtual dvec2 inviwo::TemplateColumn< T >::getDataRange ( ) const
overridevirtual

Returns the range (i.e. the min/max) of the data, ignoring any custom range

Implements inviwo::Column.

◆ getHeader()

template<typename T >
virtual const std::string & inviwo::TemplateColumn< T >::getHeader ( ) const
overridevirtual

Implements inviwo::Column.

◆ getRange()

template<typename T >
virtual dvec2 inviwo::TemplateColumn< T >::getRange ( ) const
overridevirtual

Returns the custom range if set or else the range (i.e. the min/max) of the data

Implements inviwo::Column.

◆ getSize()

template<typename T >
virtual size_t inviwo::TemplateColumn< T >::getSize ( ) const
overridevirtual

Implements inviwo::Column.

◆ getUnit()

template<typename T >
virtual Unit inviwo::TemplateColumn< T >::getUnit ( ) const
overridevirtual

Implements inviwo::Column.

◆ setCustomRange()

template<typename T >
virtual void inviwo::TemplateColumn< T >::setCustomRange ( std::optional< dvec2 > )
overridevirtual

Set a custom range for the column which can be used for normalization, plotting, color mapping, etc.

Implements inviwo::Column.

◆ setHeader()

template<typename T >
void inviwo::TemplateColumn< T >::setHeader ( std::string_view header)
overridevirtual

Implements inviwo::Column.

◆ setUnit()

template<typename T >
virtual void inviwo::TemplateColumn< T >::setUnit ( Unit unit)
overridevirtual

Implements inviwo::Column.


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