This Class handles the mapping from the colormapping-method name given as a string to the actual color mapping for RecoTrack.
More...
#include <Styling.h>
|
| std::unique_ptr< ObjectMapping > | createMapping (const std::string &mappingName) override |
| | Method defining the available mapping names.
|
| |
| AttributeMap | map (int index, const RecoTrack &object) override |
| | Create a map of attributes from the stored attribute maps.
|
| |
| AttributeMap | map (int index, const RecoTrack &object) override |
| | Create a map of attributes from the stored attribute maps.
|
| |
| virtual AttributeMap | map (int index, AObject &object) |
| | Maps the object at the given index to attribute values.
|
| |
| std::string | info () override |
| | Returns informal string about the currently set mappings.
|
| |
| std::string | info () override |
| | Returns informal string about the currently set mappings.
|
| |
| void | set (const std::string &key, std::unique_ptr< ObjectMapping > mapping) |
| | Sets the given attribute to the attribute mapping.
|
| |
| void | set (const std::string &key, const std::string &mappingName) |
| | Sets the given attribute to the fixed value.
|
| |
| void | set (const std::string &key, std::unique_ptr< ObjectMapping > mapping) |
| | Sets the given attribute to the attribute mapping.
|
| |
| void | set (const std::string &key, const std::string &mappingName) |
| | Sets the given attribute to the fixed value.
|
| |
| void | setStroke (const std::string &mappingName) |
| | Legacy method to set the mapping on how to match a object to the stroke color.
|
| |
| void | setStroke (const std::string &mappingName) |
| | Legacy method to set the mapping on how to match a object to the stroke color.
|
| |
| void | setStrokeWidth (const std::string &mappingName) |
| | Legacy method to set the mapping on how to match a object to the stroke width.
|
| |
| void | setStrokeWidth (const std::string &mappingName) |
| | Legacy method to set the mapping on how to match a object to the stroke width.
|
| |
This Class handles the mapping from the colormapping-method name given as a string to the actual color mapping for RecoTrack.
Definition at line 200 of file Styling.h.
◆ ObjectMapping
◆ Super
Type of the base class.
Definition at line 204 of file Styling.h.
◆ createMapping()
Method defining the available mapping names.
Reimplemented from ChooseableStyling< const RecoTrack >.
Definition at line 17 of file Styling.cc.
18{
19 if (mappingName == "ListColors") {
20 return std::make_unique<RecoTrackListColorsColorMap>();
21 } else if (mappingName == "MatchingStatus") {
22 return std::make_unique<RecoTrackMatchingStatusColorMap>();
23 } else if (mappingName == "MCMatchingStatus") {
24 return std::make_unique<MCRecoTrackMatchingStatusColorMap>();
25 } else {
27 }
28}
virtual std::unique_ptr< ObjectMapping > createMapping(const std::string &mappingName)
◆ info() [1/2]
|
|
inlineoverridevirtualinherited |
Returns informal string about the currently set mappings.
Reimplemented from Styling< AObject >.
Definition at line 121 of file Styling.h.
122 {
123 std::ostringstream oss;
124 for (const auto& keyMapping : m_mappingsByKey) {
125 const std::string& key = keyMapping.first;
126 const std::unique_ptr<ObjectMapping>& mapping = keyMapping.second;
127 oss << key << ": " << mapping->info();
128 }
129 return oss.str();
130 }
◆ info() [2/2]
|
|
inlineoverridevirtualinherited |
Returns informal string about the currently set mappings.
Reimplemented from Styling< AObject >.
Definition at line 121 of file Styling.h.
122 {
123 std::ostringstream oss;
124 for (const auto& keyMapping : m_mappingsByKey) {
125 const std::string& key = keyMapping.first;
126 const std::unique_ptr<ObjectMapping>& mapping = keyMapping.second;
127 oss << key << ": " << mapping->info();
128 }
129 return oss.str();
130 }
◆ map() [1/3]
Create a map of attributes from the stored attribute maps.
Definition at line 109 of file Styling.h.
110 {
111 AttributeMap attributeMap;
112 for (const auto& keyMapping : m_mappingsByKey) {
113 const std::string& key = keyMapping.first;
114 const std::unique_ptr<ObjectMapping>& mapping = keyMapping.second;
115 attributeMap[key] = mapping->map(index, object);
116 }
117 return attributeMap;
118 }
◆ map() [2/3]
Create a map of attributes from the stored attribute maps.
Definition at line 109 of file Styling.h.
110 {
111 AttributeMap attributeMap;
112 for (const auto& keyMapping : m_mappingsByKey) {
113 const std::string& key = keyMapping.first;
114 const std::unique_ptr<ObjectMapping>& mapping = keyMapping.second;
115 attributeMap[key] = mapping->map(index, object);
116 }
117 return attributeMap;
118 }
◆ map() [3/3]
template<class AObject>
| virtual AttributeMap map |
( |
int | index, |
|
|
AObject & | object ) |
|
inlinevirtualinherited |
◆ set() [1/4]
| void set |
( |
const std::string & | key, |
|
|
const std::string & | mappingName ) |
|
inlineinherited |
Sets the given attribute to the fixed value.
Definition at line 152 of file Styling.h.
153 {
154 std::unique_ptr<ObjectMapping> objectMapping = this->createMapping(mappingName);
155 if (objectMapping) {
156 set(key, std::move(objectMapping));
157 }
158 }
◆ set() [2/4]
| void set |
( |
const std::string & | key, |
|
|
const std::string & | mappingName ) |
|
inlineinherited |
Sets the given attribute to the fixed value.
Definition at line 152 of file Styling.h.
153 {
154 std::unique_ptr<ObjectMapping> objectMapping = this->createMapping(mappingName);
155 if (objectMapping) {
156 set(key, std::move(objectMapping));
157 }
158 }
◆ set() [3/4]
| void set |
( |
const std::string & | key, |
|
|
std::unique_ptr< ObjectMapping > | mapping ) |
|
inlineinherited |
Sets the given attribute to the attribute mapping.
Definition at line 144 of file Styling.h.
145 {
146 if (mapping) {
147 m_mappingsByKey[key] = std::move(mapping);
148 }
149 }
◆ set() [4/4]
| void set |
( |
const std::string & | key, |
|
|
std::unique_ptr< ObjectMapping > | mapping ) |
|
inlineinherited |
Sets the given attribute to the attribute mapping.
Definition at line 144 of file Styling.h.
145 {
146 if (mapping) {
147 m_mappingsByKey[key] = std::move(mapping);
148 }
149 }
◆ setStroke() [1/2]
| void setStroke |
( |
const std::string & | mappingName | ) |
|
|
inlineinherited |
Legacy method to set the mapping on how to match a object to the stroke color.
- Parameters
-
| mappingName | The Name of the Mapping to be used. The translation from name to Mapping class must be defined in createMapping. |
Definition at line 165 of file Styling.h.
166 {
167 set("stroke", mappingName);
168 }
◆ setStroke() [2/2]
| void setStroke |
( |
const std::string & | mappingName | ) |
|
|
inlineinherited |
Legacy method to set the mapping on how to match a object to the stroke color.
- Parameters
-
| mappingName | The Name of the Mapping to be used. The translation from name to Mapping class must be defined in createMapping. |
Definition at line 165 of file Styling.h.
166 {
167 set("stroke", mappingName);
168 }
◆ setStrokeWidth() [1/2]
| void setStrokeWidth |
( |
const std::string & | mappingName | ) |
|
|
inlineinherited |
Legacy method to set the mapping on how to match a object to the stroke width.
- Parameters
-
| mappingName | The Name of the Mapping to be used. The translation from name to Mapping class must be defined in createMapping. |
Definition at line 175 of file Styling.h.
176 {
177 set("stroke-width", mappingName);
178 }
◆ setStrokeWidth() [2/2]
| void setStrokeWidth |
( |
const std::string & | mappingName | ) |
|
|
inlineinherited |
Legacy method to set the mapping on how to match a object to the stroke width.
- Parameters
-
| mappingName | The Name of the Mapping to be used. The translation from name to Mapping class must be defined in createMapping. |
Definition at line 175 of file Styling.h.
176 {
177 set("stroke-width", mappingName);
178 }
◆ m_mappingsByKey [1/2]
| std::map<std::string, std::unique_ptr<ObjectMapping> > m_mappingsByKey |
|
protectedinherited |
Map of attribute keys to mappings to be used.
Definition at line 182 of file Styling.h.
◆ m_mappingsByKey [2/2]
| std::map<std::string, std::unique_ptr<ObjectMapping> > m_mappingsByKey |
|
protectedinherited |
Map of attribute keys to mappings to be used.
Definition at line 182 of file Styling.h.
The documentation for this class was generated from the following files:
- tracking/trackFindingCDC/display/include/Styling.h
- tracking/trackFindingCDC/display/src/Styling.cc