DGtal 2.1.0
Loading...
Searching...
No Matches
DGtal::WithQuantity< T, Type > Struct Template Reference

Attach a property to an element. More...

#include <DGtal/io/Display3D.h>

Public Member Functions

 WithQuantity (const T &_object, const std::string &_name, const Type &value, QuantityScale s=QuantityScale::UNKNOWN)
 
 WithQuantity (const T &_object, const std::string &_name, const std::vector< Type > &_values, QuantityScale s=QuantityScale::UNKNOWN)
 

Data Fields

QuantityScale scale
 
object
 
std::vector< Type > values
 
std::string name
 

Detailed Description

template<typename T, typename Type>
struct DGtal::WithQuantity< T, Type >

Attach a property to an element.

This class can be used with singletons and composite elements; as long as the correct number of values are provided.

This class can be nested to add multiple properties:

obj, "value", scalar
),
"normal", normal
)
Attach a property to an element.
Definition Display3D.h:331
Template Parameters
TThe type of element
Typethe type of property
Examples
geometry/volumes/distance/exampleFMM3D.cpp, topology/volBreadthFirstTraversal.cpp, and tutorial-examples/volDTGranulo.cpp.

Definition at line 331 of file Display3D.h.

Constructor & Destructor Documentation

◆ WithQuantity() [1/2]

template<typename T , typename Type >
DGtal::WithQuantity< T, Type >::WithQuantity ( const T &  _object,
const std::string &  _name,
const Type &  value,
QuantityScale  s = QuantityScale::UNKNOWN 
)
inline

Definition at line 332 of file Display3D.h.

332 :
333 scale(s), object(_object), name(_name)
334 {
335 values.push_back(value);
336 }
std::string name
Definition Display3D.h:352
std::vector< Type > values
Definition Display3D.h:350
QuantityScale scale
Definition Display3D.h:345

References DGtal::WithQuantity< T, Type >::values.

◆ WithQuantity() [2/2]

template<typename T , typename Type >
DGtal::WithQuantity< T, Type >::WithQuantity ( const T &  _object,
const std::string &  _name,
const std::vector< Type > &  _values,
QuantityScale  s = QuantityScale::UNKNOWN 
)
inline

Definition at line 338 of file Display3D.h.

338 :
339 scale(s), object(_object), name(_name)
340 {
341 this->values = _values;
342 }

References DGtal::WithQuantity< T, Type >::values.

Field Documentation

◆ name

template<typename T , typename Type >
std::string DGtal::WithQuantity< T, Type >::name

Definition at line 352 of file Display3D.h.

◆ object

template<typename T , typename Type >
T DGtal::WithQuantity< T, Type >::object

Definition at line 348 of file Display3D.h.

◆ scale

template<typename T , typename Type >
QuantityScale DGtal::WithQuantity< T, Type >::scale

Definition at line 345 of file Display3D.h.

◆ values

template<typename T , typename Type >
std::vector<Type> DGtal::WithQuantity< T, Type >::values

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