DGtal 2.0.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:327
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 327 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 328 of file Display3D.h.

328 :
329 scale(s), object(object), name(name)
330 {
331 values.push_back(value);
332 }
std::string name
Definition Display3D.h:348
std::vector< Type > values
Definition Display3D.h:346
QuantityScale scale
Definition Display3D.h:341

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 334 of file Display3D.h.

334 :
335 scale(s), object(object), name(name)
336 {
337 this->values = values;
338 }

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

Field Documentation

◆ name

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

Definition at line 348 of file Display3D.h.

◆ object

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

Definition at line 344 of file Display3D.h.

◆ scale

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

Definition at line 341 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: