Belle II Software development
DefaultColorCycleMapping< AObject > Class Template Reference

Class template for coloring objects in different Colors. More...

#include <ColorMapping.h>

Inheritance diagram for DefaultColorCycleMapping< AObject >:
CycleMapping< AObject > Mapping< T >

Public Member Functions

 DefaultColorCycleMapping ()
 Constructor.
 
std::string map (int index, AObject &t) override
 Return a value from the cycle value according to the given index.
 
virtual std::string map (int index, T &t)
 Main function returning an attribute value for an object at the given index.
 
std::string info () override
 Informal string summarizing the translation from the object to the attribute value.
 

Private Types

using Super = CycleMapping< AObject >
 Type of the base class.
 

Private Attributes

std::vector< std::string > m_values
 Memory for the attribute values to be cycled.
 

Detailed Description

template<class AObject>
class Belle2::TrackFindingCDC::DefaultColorCycleMapping< AObject >

Class template for coloring objects in different Colors.

This Class uses the color list defined in the Colors class.

Definition at line 26 of file ColorMapping.h.

Member Typedef Documentation

◆ Super

using Super = CycleMapping<AObject>
private

Type of the base class.

Definition at line 30 of file ColorMapping.h.

Constructor & Destructor Documentation

◆ DefaultColorCycleMapping()

Constructor.

Definition at line 34 of file ColorMapping.h.

36 {
37 }
static std::vector< std::string > getList()
Get a list of useful colors.
Definition: Colors.cc:15
CycleMapping< AObject > Super
Type of the base class.
Definition: ColorMapping.h:30

Member Function Documentation

◆ info()

std::string info ( )
inlineoverridevirtualinherited

Informal string summarizing the translation from the object to the attribute value.

Reimplemented from Mapping< T >.

Definition at line 90 of file Mapping.h.

91 {
92 return "Cycle through " + bracketed(join(", ", m_values)) + "\n";
93 }

◆ map() [1/2]

std::string map ( int  index,
AObject &  t 
)
inlineoverrideinherited

Return a value from the cycle value according to the given index.

Definition at line 83 of file Mapping.h.

84 {
85 assert(index >= 0);
86 return m_values[index % m_values.size()];
87 }
std::vector< std::string > m_values
Memory for the attribute values to be cycled.
Definition: Mapping.h:97

◆ map() [2/2]

virtual std::string map ( int  index,
T &  t 
)
inlinevirtualinherited

Member Data Documentation

◆ m_values

std::vector<std::string> m_values
privateinherited

Memory for the attribute values to be cycled.

Definition at line 97 of file Mapping.h.


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