10#include <RtypesCore.h>
16 const unsigned short int LineStyle::kColor = 0;
17 const unsigned short int LineStyle::kWidth = 1;
18 const unsigned short int LineStyle::kStyle = 2;
20 void LineStyle::SetColor(Int_t val) { SetI(kColor, val); }
22 void LineStyle::SetWidth(Int_t val) { SetI(kWidth, val); }
24 void LineStyle::SetStyle(Int_t val) { SetI(kStyle, val); }
26 Int_t LineStyle::GetColor()
const {
return GetI(kColor); }
28 Int_t LineStyle::GetWidth()
const {
return GetI(kWidth); }
30 Int_t LineStyle::GetStyle()
const {
return GetI(kStyle); }
32 void LineStyle::ExportToXML(XMLNode* node)
const {
34 if (
Find(kColor)) node->AddAttrib(
new Hal::XMLAttrib(
"Color", Form(
"%i", GetI(kColor))));
35 if (
Find(kWidth)) node->AddAttrib(
new Hal::XMLAttrib(
"Width", Form(
"%i", GetI(kWidth))));
36 if (
Find(kStyle)) node->AddAttrib(
new Hal::XMLAttrib(
"Style", Form(
"%i", GetI(kStyle))));
39 void LineStyle::ImportFromXML(XMLNode* node) {
41 if (
auto atr = node->GetAttrib(
"Color")) {
42 int x = atr->GetValue().Atoi();
45 if (
auto atr = node->GetAttrib(
"Width")) {
46 int x = atr->GetValue().Atoi();
49 if (
auto atr = node->GetAttrib(
"Style")) {
50 int x = atr->GetValue().Atoi();
Bool_t Find(Int_t bit) const