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