Logo ROOT   6.18/05
Reference Guide
RHistDrawingOpts.hxx
Go to the documentation of this file.
1/// \file ROOT/RHistDrawingOpts.h
2/// \ingroup HistDraw ROOT7
3/// \author Axel Naumann <axel@cern.ch>
4/// \date 2015-09-04
5/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6/// is welcome!
7
8/*************************************************************************
9 * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers. *
10 * All rights reserved. *
11 * *
12 * For the licensing terms see $ROOTSYS/LICENSE. *
13 * For the list of contributors see $ROOTSYS/README/CREDITS. *
14 *************************************************************************/
15
16#ifndef ROOT7_RHistDrawingOpts
17#define ROOT7_RHistDrawingOpts
18
19#include <ROOT/RAttrLine.hxx>
20#include <ROOT/RDrawingAttr.hxx>
22
23namespace ROOT {
24namespace Experimental {
25
26template <int DIMENSION>
28 static_assert(DIMENSION != 0, "Cannot draw 0-dimensional histograms!");
29 static_assert(DIMENSION > 3, "Cannot draw histograms with more than 3 dimensions!");
30 static_assert(DIMENSION < 3, "This should have been handled by the specializations below?!");
31};
32
33
34/** \class RHistDrawingOpts<1>
35 Drawing options for a 1D histogram.
36 */
37template <>
39public:
40 enum class EStyle { kHist, kBar, kText };
41
43 RDrawingAttrBase(FromOption, "hist1D", *this)
44 {}
45
46 /// The drawing style.
47 void SetStyle(EStyle style) { Set("style", style); }
48 EStyle GetStyle() const { return Get<EStyle>("style"); }
49
50 RAttrLine Line() { return {FromOption, "contentLine", *this}; }
51 RAttrLine BarLine() { return {FromOption, "barLine", *this}; }
52 RAttrLine UncertaintyLine() { return {FromOption, "uncertaintyLine", *this}; }
53};
54
55/** \class RHistDrawingOpts<2>
56 Drawing options for a 2D histogram.
57 */
58template <>
60public:
61 enum class EStyle { kBox, kSurf, kText };
62
64 RDrawingAttrBase(FromOption, "hist2D", *this)
65 {}
66
67 /// The drawing style.
68 void SetStyle(EStyle style) { Set("style", style); }
69 EStyle GetStyle() const { return Get<EStyle>("style"); }
70
71 RAttrLine BoxLine() { return {FromOption, "boxLine", *this}; }
72};
73
74/** \class RHistDrawingOpts<3>
75 Drawing options for a 3D histogram.
76 */
77template <>
79public:
80 enum class EStyle { kBox, kIso };
81
82public:
84 RDrawingAttrBase(FromOption, "hist3D", *this)
85 {}
86
87 /// The drawing style.
88 void SetStyle(EStyle style) { Set("style", style); }
89 EStyle GetStyle() const { return Get<EStyle>("style"); }
90
91 RAttrLine BoxLine() { return {FromOption, "boxLine", *this}; }
92 RAttrLine IsoLine() { return {FromOption, "isoLine", *this}; }
93};
94
95} // namespace Experimental
96} // namespace ROOT
97
98#endif
@ kBox
Definition: Buttons.h:29
@ kText
Definition: Buttons.h:30
class ROOT::Experimental::RAttrLine Drawing attributes for RLine.
Definition: RAttrLine.hxx:28
A collection of graphics attributes, for instance everything describing a line: color,...
void SetStyle(EStyle style)
The drawing style.
void SetStyle(EStyle style)
The drawing style.
void SetStyle(EStyle style)
The drawing style.
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
TCanvas * style()
Definition: style.C:1