DGtal 2.0.0
Loading...
Searching...
No Matches
DGtal::Quantity< T > Struct Template Reference

Wrapper for array of quantities. More...

#include <DGtal/io/Display3D.h>

Inheritance diagram for DGtal::Quantity< T >:
[legend]

Public Types

using QType = std::map<std::string, std::vector<T>>

Public Member Functions

QTypeoperator[] (int idx)
const QTypeoperator[] (int idx) const
QTypeoperator[] (const QuantityScale &scale)
const QTypeoperator[] (const QuantityScale &scale) const

Data Fields

std::array< QType, static_cast< size_t >(QuantityScale::UNKNOWN)> data

Detailed Description

template<typename T>
struct DGtal::Quantity< T >

Wrapper for array of quantities.

Post C++23, enums are not convertible to int anymore. To avoid casts everytime, we wrap the operators inside this class.

Definition at line 223 of file Display3D.h.

Member Typedef Documentation

◆ QType

template<typename T>
using DGtal::Quantity< T >::QType = std::map<std::string, std::vector<T>>

Definition at line 224 of file Display3D.h.

Member Function Documentation

◆ operator[]() [1/4]

template<typename T>
QType & DGtal::Quantity< T >::operator[] ( const QuantityScale & scale)
inline

Definition at line 230 of file Display3D.h.

230 {
231 return data[static_cast<size_t>(scale)];
232 };
Wrapper for array of quantities.
Definition Display3D.h:223
std::array< QType, static_cast< size_t >(QuantityScale::UNKNOWN)> data
Definition Display3D.h:238

References data, and scale.

◆ operator[]() [2/4]

template<typename T>
const QType & DGtal::Quantity< T >::operator[] ( const QuantityScale & scale) const
inline

Definition at line 234 of file Display3D.h.

234 {
235 return data[static_cast<size_t>(scale)];
236 };

References data, and scale.

◆ operator[]() [3/4]

template<typename T>
QType & DGtal::Quantity< T >::operator[] ( int idx)
inline

Definition at line 226 of file Display3D.h.

226{ return data[idx]; }

References data.

◆ operator[]() [4/4]

template<typename T>
const QType & DGtal::Quantity< T >::operator[] ( int idx) const
inline

Definition at line 228 of file Display3D.h.

228{ return data[idx]; }

References data.

Field Documentation

◆ data

template<typename T>
std::array<QType, static_cast<size_t>(QuantityScale::UNKNOWN)> DGtal::Quantity< T >::data

Definition at line 238 of file Display3D.h.

Referenced by operator[](), operator[](), operator[](), and operator[]().


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