Specialized data column representing categorical values, i.e. strings. Categorical values are internally mapped to a number representation.
More...
|
| CategoricalColumn (std::string_view header, const std::vector< std::string > &values={}, Unit unit=Unit{}, std::optional< dvec2 > range=std::nullopt) |
|
| CategoricalColumn (std::string_view header, std::vector< type > data, std::vector< std::string > lookup, Unit unit=Unit{}, std::optional< dvec2 > range=std::nullopt) |
|
| CategoricalColumn (const CategoricalColumn &rhs) |
|
| CategoricalColumn (const CategoricalColumn &rhs, const std::vector< std::uint32_t > &rowSelection) |
|
| CategoricalColumn (CategoricalColumn &&rhs)=default |
|
CategoricalColumn & | operator= (const CategoricalColumn &rhs) |
|
CategoricalColumn & | operator= (CategoricalColumn &&rhs) |
|
virtual CategoricalColumn * | clone () const override |
|
virtual CategoricalColumn * | clone (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 size_t | getSize () const override |
|
void | set (size_t idx, std::string_view str) |
|
void | set (size_t idx, std::uint32_t id) |
|
virtual void | add (std::string_view value) override |
|
AddMany | addMany () |
|
virtual void | append (const Column &col) override |
| and builds a union of all categorical values
|
|
void | append (const std::vector< std::string > &data) |
| Append the categorical values given in data .
|
|
const std::vector< std::string > & | getCategories () const |
|
std::vector< std::string > | getValues () const |
| Returns column contents as list of categorical values.
|
|
util::iter_range< ConstIterator > | values () const |
|
std::uint32_t | addCategory (std::string_view cat) |
| Add a category cat . It will not be added if the category already exists.
|
|
Public Member Functions inherited from inviwo::Column |
| MetaDataOwner (const MetaDataOwner &rhs)=default |
|
| MetaDataOwner (MetaDataOwner &rhs)=default |
|
MetaDataOwner & | operator= (const MetaDataOwner &rhs)=default |
|
MetaDataOwner & | operator= (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> |
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 |
|
MetaDataMap * | getMetaDataMap () |
|
const MetaDataMap * | getMetaDataMap () 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) |
|
const std::string & | get (size_t idx) const |
|
virtual std::string | getAsString (size_t idx) const override |
|
std::uint32_t | getId (size_t idx) const |
|
virtual double | getAsDouble (size_t idx) const override |
|
ConstIterator | begin () const |
|
ConstIterator | end () const |
|
virtual std::shared_ptr< BufferBase > | getBuffer () override |
|
virtual std::shared_ptr< const BufferBase > | getBuffer () const override |
|
std::shared_ptr< Buffer< std::uint32_t > > | getTypedBuffer () |
|
std::shared_ptr< const Buffer< std::uint32_t > > | getTypedBuffer () const |
|
Specialized data column representing categorical values, i.e. strings. Categorical values are internally mapped to a number representation.
For example: The data column "blue", "blue", "red", "yellow" might internally be represented by 0, 0, 1, 2. The original string values can be accessed using CategoricalColumn::get(index, true)
- See also
- CategoricalColumn::get()