Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
MarkerStyle.cxx
1/*
2 * MarkerStyle.cxx
3 *
4 * Created on: 30 lip 2024
5 * Author: daniel
6 */
7
8#include "MarkerStyle.h"
9
10#include <RtypesCore.h>
11#include <TString.h>
12
13#include "XMLNode.h"
14
15namespace Hal {
16 const unsigned short int MarkerStyle::kColor = 0;
17 const unsigned short int MarkerStyle::kStyle = 1;
18 const unsigned short int MarkerStyle::kLineWidth = 2;
19 const unsigned short int MarkerStyle::kSize = 3;
20 void MarkerStyle::SetColor(Int_t val) { SetI(kColor, val); }
21
22 void MarkerStyle::SetStyle(Int_t val) { SetI(kStyle, val); }
23
24 // void MarkerStyle::SetLineWidth(Int_t val) { SetI(kLineWidth, val); }
25
26 void MarkerStyle::SetSize(Int_t val) { SetI(kSize, val); }
27
28 Int_t MarkerStyle::GetColor() const { return GetI(kColor); }
29
30 Int_t MarkerStyle::GetStyle() const { return GetI(kStyle); }
31
32 // Int_t MarkerStyle::GetLineWidth() const { return GetI(kLineWidth); }
33
34 Int_t MarkerStyle::GetSize() const { return GetI(kSize); }
35
36 void MarkerStyle::ExportToXML(XMLNode* node) const {
37
38 if (Find(kColor)) node->AddAttrib(new Hal::XMLAttrib("Color", Form("%i", GetI(kColor))));
39 if (Find(kStyle)) node->AddAttrib(new Hal::XMLAttrib("Style", Form("%i", GetI(kStyle))));
40 // if (Find(kLineWidth)) node->AddAttrib(new Hal::XMLAttrib("LineWidth", Form("%i", GetI(kLineWidth))));
41 if (Find(kSize)) node->AddAttrib(new Hal::XMLAttrib("Size", Form("%i", GetI(kSize))));
42 }
43
44 void MarkerStyle::ImportFromXML(XMLNode* node) {
45
46 if (auto atr = node->GetAttrib("Color")) {
47 int x = atr->GetValue().Atoi();
48 SetColor(x);
49 }
50 if (auto atr = node->GetAttrib("Style")) {
51 int x = atr->GetValue().Atoi();
52 SetStyle(x);
53 }
54 /* if (auto atr = node->GetAttrib("LineWidth")) {
55 int x = atr->GetValue().Atoi();
56 SetLineWidth(x);
57 }*/
58 if (auto atr = node->GetAttrib("Size")) {
59 int x = atr->GetValue().Atoi();
60 SetSize(x);
61 }
62 }
63} /* namespace Hal */
Bool_t Find(Int_t bit) const
Definition Style.h:55