Logo ROOT  
Reference Guide
RAttrLine.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9#ifndef ROOT7_RAttrLine
10#define ROOT7_RAttrLine
11
12#include <ROOT/RAttrBase.hxx>
13#include <ROOT/RColor.hxx>
14
15namespace ROOT {
16namespace Experimental {
17
18/** \class RAttrLine
19\ingroup GpadROOT7
20\author Axel Naumann <axel@cern.ch>
21\date 2018-10-12
22\brief Drawing line attributes for different objects.
23\warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
24*/
25
26class RAttrLine : public RAttrBase {
27
28 RColor fColor{this, "color_"}; ///<! line color, will access container from line attributes
29
30 R__ATTR_CLASS(RAttrLine, "line_", AddDouble("width", 1.).AddInt("style", 1).AddDefaults(fColor));
31
32 // keep it here, it is minimal set of methods which should be reimplemented
33 // using RAttrBase::RAttrBase;
34 // RAttrLine(const RAttrLine &src) : RAttrLine() { src.CopyTo(*this); }
35 // RAttrLine &operator=(const RAttrLine &src) { Clear(); src.CopyTo(*this); return *this; }
36
37 ///The width of the line.
38 RAttrLine &SetWidth(double width) { SetValue("width", width); return *this; }
39 double GetWidth() const { return GetValue<double>("width"); }
40
41 ///The style of the line.
42 RAttrLine &SetStyle(int style) { SetValue("style", style); return *this; }
43 int GetStyle() const { return GetValue<int>("style"); }
44
45 ///The color of the line.
46 RAttrLine &SetColor(const RColor &color) { fColor = color; return *this; }
47 const RColor &GetColor() const { return fColor; }
48 RColor &Color() { return fColor; }
49
50};
51
52} // namespace Experimental
53} // namespace ROOT
54
55#endif
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
Base class for all attributes, used with RDrawable.
Definition: RAttrBase.hxx:27
void SetValue(const std::string &name, bool value)
Definition: RAttrBase.cxx:101
Drawing line attributes for different objects.
Definition: RAttrLine.hxx:26
RAttrLine & SetColor(const RColor &color)
The color of the line.
Definition: RAttrLine.hxx:46
const RColor & GetColor() const
Definition: RAttrLine.hxx:47
RAttrLine & SetWidth(double width)
The width of the line.
Definition: RAttrLine.hxx:38
RAttrLine & SetStyle(int style)
The style of the line.
Definition: RAttrLine.hxx:42
RColor fColor
! line color, will access container from line attributes
Definition: RAttrLine.hxx:28
R__ATTR_CLASS(RAttrLine, "line_", AddDouble("width", 1.).AddInt("style", 1).AddDefaults(fColor))
The color class.
Definition: RColor.hxx:32
VSD Structures.
Definition: StringConv.hxx:21
TCanvas * style()
Definition: style.C:1