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< Typevalues
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
)
WithQuantity(const T &_object, const std::string &_name, const Type &value, QuantityScale s=QuantityScale::UNKNOWN)
Definition Display3D.h:332
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 :
334 {
335 values.push_back(value);
336 }
Attach a property to an element.
Definition Display3D.h:331
std::string name
Definition Display3D.h:352
std::vector< Type > values
Definition Display3D.h:350
QuantityScale scale
Definition Display3D.h:345

References name, object, scale, DGtal::UNKNOWN, and 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 :
340 {
341 this->values = _values;
342 }

References name, object, scale, DGtal::UNKNOWN, and values.

Field Documentation

◆ name

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

Definition at line 352 of file Display3D.h.

Referenced by WithQuantity(), and WithQuantity().

◆ object

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

Definition at line 348 of file Display3D.h.

Referenced by WithQuantity(), and WithQuantity().

◆ scale

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

Definition at line 345 of file Display3D.h.

Referenced by WithQuantity(), and WithQuantity().

◆ values

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

Definition at line 350 of file Display3D.h.

Referenced by WithQuantity(), and WithQuantity().


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