Line Attributes class.
This class is used (in general by secondary inheritance) by many other classes (graphics, histograms). It holds all the line attributes.
Line attributes are:
The line color is a color index (integer) pointing in the ROOT color table. The line color of any class inheriting from TAttLine
can be changed using the method SetLineColor
and retrieved using the method GetLineColor
. The following table shows the first 50 default colors.
SetLineColorAlpha()
, allows to set a transparent color. In the following example the line color of the histogram histo
is set to blue with a transparency of 35%. The color kBlue
itself remains fully opaque.
The transparency is available on all platforms when the flag OpenGL.CanvasPreferGL
is set to 1
in $ROOTSYS/etc/system.rootrc
, or on Mac with the Cocoa backend. On the file output it is visible with PDF, PNG, Gif, JPEG, SVG, TeX ... but not PostScript.
The line width is expressed in pixel units. The line width of any class inheriting from TAttLine
can be changed using the method SetLineWidth
and retrieved using the method GetLineWidth
. The following picture shows the line widths from 1 to 10 pixels.
Line styles are identified via integer numbers. The line style of any class inheriting from TAttLine
can be changed using the method SetLineStyle
and retrieved using the method GetLineStyle
.
The first 10 line styles are predefined as shown on the following picture:
Some line styles can be accessed via the following enum:
Additional line styles can be defined using TStyle::SetLineStyleString
. For example the line style number 11 can be defined as follow:
Existing line styles (1 to 10) can be redefined using the same method.
Definition at line 18 of file TAttLine.h.
Public Member Functions | |
TAttLine () | |
AttLine default constructor. | |
TAttLine (Color_t lcolor, Style_t lstyle, Width_t lwidth) | |
AttLine normal constructor. | |
virtual | ~TAttLine () |
AttLine destructor. | |
void | Copy (TAttLine &attline) const |
Copy this line attributes to a new TAttLine. | |
Int_t | DistancetoLine (Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2) |
Compute distance from point px,py to a line. | |
virtual Color_t | GetLineColor () const |
Return the line color. | |
virtual Style_t | GetLineStyle () const |
Return the line style. | |
virtual Width_t | GetLineWidth () const |
Return the line width. | |
virtual TClass * | IsA () const |
virtual void | Modify () |
Change current line attributes if necessary. | |
virtual void | ResetAttLine (Option_t *option="") |
Reset this line attributes to default values. | |
virtual void | SaveLineAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1) |
Save line attributes as C++ statement(s) on output stream out. | |
virtual void | SetLineAttributes () |
Invoke the DialogCanvas Line attributes. | |
virtual void | SetLineColor (Color_t lcolor) |
Set the line color. | |
virtual void | SetLineColorAlpha (Color_t lcolor, Float_t lalpha) |
Set a transparent line color. | |
virtual void | SetLineStyle (Style_t lstyle) |
Set the line style. | |
virtual void | SetLineWidth (Width_t lwidth) |
Set the line width. | |
virtual void | Streamer (TBuffer &) |
void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
Static Public Member Functions | |
static TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
Protected Attributes | |
Color_t | fLineColor |
Line color. | |
Style_t | fLineStyle |
Line style. | |
Width_t | fLineWidth |
Line width. | |
#include <TAttLine.h>
TAttLine::TAttLine | ( | ) |
AttLine default constructor.
Definition at line 141 of file TAttLine.cxx.
AttLine normal constructor.
Line attributes are taking from the argument list
Definition at line 158 of file TAttLine.cxx.
|
virtual |
AttLine destructor.
Definition at line 168 of file TAttLine.cxx.
|
static |
|
inlinestaticconstexpr |
Definition at line 45 of file TAttLine.h.
void TAttLine::Copy | ( | TAttLine & | attline | ) | const |
Copy this line attributes to a new TAttLine.
Definition at line 175 of file TAttLine.cxx.
|
inlinestatic |
Definition at line 45 of file TAttLine.h.
Int_t TAttLine::DistancetoLine | ( | Int_t | px, |
Int_t | py, | ||
Double_t | xp1, | ||
Double_t | yp1, | ||
Double_t | xp2, | ||
Double_t | yp2 | ||
) |
Compute distance from point px,py to a line.
Compute the closest distance of approach from point px,py to this line. The distance is computed in pixels units.
Algorithm:
Definition at line 209 of file TAttLine.cxx.
|
inlinevirtual |
Return the line color.
Reimplemented in TGWin32VirtualXProxy, TGraphMultiErrors, and TWebPadPainter.
Definition at line 33 of file TAttLine.h.
|
inlinevirtual |
Return the line style.
Reimplemented in TGWin32VirtualXProxy, TGraphMultiErrors, and TWebPadPainter.
Definition at line 34 of file TAttLine.h.
|
inlinevirtual |
Return the line width.
Reimplemented in TGWin32VirtualXProxy, TGraphMultiErrors, and TWebPadPainter.
Definition at line 35 of file TAttLine.h.
|
inlinevirtual |
Reimplemented in TGeoBatemanSol, TGeoPhysicalNode, TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly, TVirtualGeoTrack, TGeoOverlap, TGCocoa, TGQuartz, TGraphEdge, TGraphNode, TGWin32, TEveLine, TEveLineProjected, TEveScalableStraightLineSet, TEveStraightLineSet, TEveStraightLineSetProjected, TEveTrack, TEveTrackList, TEveTrackProjected, TEveTrackListProjected, TEveMCTrack, TBRIK, TCONE, TCONS, TCTUB, TELTU, TGTRA, THelix, THYPE, TMarker3DBox, TNode, TNodeDiv, TPARA, TPCON, TPGON, TShape, TSPHE, TTRAP, TTRD1, TTRD2, TTUBE, TTUBS, TXTRU, TGLAxis, TGLTH3Composition, TParticle, TPrimary, TMCParticle, TProofChain, RooFit::Detail::XRooFit::xRooHypoSpace, TMVA::TSpline1, TMVA::TSpline2, TChain, TParallelCoordRange, TParallelCoordSelect, TParallelCoordVar, TSpider, Jet, TStyle, TVirtualPad, TVirtualPS, TVirtualX, TButton, TCanvas, TDialogCanvas, TGroupButton, TInspectCanvas, TPad, TPaveClass, TSlider, TSliderBox, TView, TArc, TArrow, TBox, TCandle, TCrown, TCurlyArc, TCurlyLine, TCutG, TDiamond, TEllipse, TFrame, TGaxis, TGraphPolar, TGraphPolargram, TGraphQQ, TLatex, TLegend, TLegendEntry, TLine, TPave, TPaveLabel, TPaveStats, TPavesText, TPaveText, TPieSlice, TPolyLine, TWbox, TImageDump, TPDF, TPostScript, TSVG, TTeXDump, TGX11, TGX11TTF, TPolyLine3D, TWebPadPainter, TWebPS, THbookTree, TEfficiency, TF1, TF12, TF2, TF3, TGraph, TGraph2D, TGraph2DAsymmErrors, TGraph2DErrors, TGraphAsymmErrors, TGraphBentErrors, TGraphErrors, TGraphMultiErrors, TH1, TH1C, TH1S, TH1I, TH1F, TH1D, TH1K, TH2, TH2C, TH2S, TH2I, TH2F, TH2D, TH2Poly, TH3, TH3C, TH3S, TH3I, TH3F, TH3D, TProfile, TProfile2D, TProfile2Poly, TProfile3D, TSpline, TSpline3, TSpline5, ROOT::v5::TF1Data, TPaletteAxis, RooCurve, RooEllipse, RooHist, TNtuple, TNtupleD, TTree, and TTreeSQL.
Definition at line 45 of file TAttLine.h.
|
virtual |
Change current line attributes if necessary.
Definition at line 245 of file TAttLine.cxx.
|
virtual |
Reset this line attributes to default values.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 263 of file TAttLine.cxx.
|
virtual |
Save line attributes as C++ statement(s) on output stream out.
Definition at line 273 of file TAttLine.cxx.
|
virtual |
Invoke the DialogCanvas Line attributes.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 292 of file TAttLine.cxx.
|
inlinevirtual |
Set the line color.
Reimplemented in TEveTrackList, ROOT::Experimental::REveTrackList, TGQuartz, TGWin32, TGWin32VirtualXProxy, TVirtualX, TGX11, TPDF, TPostScript, TSVG, TTeXDump, TEveLine, TEveStraightLineSet, TParallelCoordRange, TSpider, ROOT::Experimental::REveLine, ROOT::Experimental::REveStraightLineSet, TGeoVolume, TGeoVolumeMulti, TGraphMultiErrors, and TWebPadPainter.
Definition at line 40 of file TAttLine.h.
Set a transparent line color.
lalpha defines the percentage of the color opacity from 0. (fully transparent) to 1. (fully opaque).
Reimplemented in TGraphMultiErrors.
Definition at line 301 of file TAttLine.cxx.
|
inlinevirtual |
Set the line style.
Reimplemented in TGQuartz, TGWin32, TGWin32VirtualXProxy, TVirtualX, TGX11, TPDF, TPostScript, TSVG, TTeXDump, TGeoVolume, TGeoVolumeMulti, TEveLine, TGraphMultiErrors, ROOT::Experimental::REveLine, TWebPadPainter, TEveTrackList, ROOT::Experimental::REveTrackList, and TSpider.
Definition at line 42 of file TAttLine.h.
|
inlinevirtual |
Set the line width.
Reimplemented in TPDF, TPostScript, TSVG, TTeXDump, TGeoVolume, TGeoVolumeMulti, TEveLine, TGraphMultiErrors, ROOT::Experimental::REveLine, TWebPadPainter, TEveTrackList, ROOT::Experimental::REveTrackList, TParallelCoordRange, TSpider, TGQuartz, TGWin32, TGWin32VirtualXProxy, TVirtualX, TGX11, and TPaletteAxis.
Definition at line 43 of file TAttLine.h.
|
virtual |
Reimplemented in TGeoBatemanSol, TGeoPhysicalNode, TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly, TVirtualGeoTrack, TGeoOverlap, TGCocoa, TGQuartz, TGraphEdge, TGraphNode, TGWin32, TEveLine, TEveLineProjected, TEveScalableStraightLineSet, TEveStraightLineSet, TEveStraightLineSetProjected, TEveTrack, TEveTrackList, TEveTrackProjected, TEveTrackListProjected, TEveMCTrack, TBRIK, TCONE, TCONS, TCTUB, TELTU, TGTRA, THelix, THYPE, TMarker3DBox, TNode, TNodeDiv, TPARA, TPCON, TPGON, TShape, TSPHE, TTRAP, TTRD1, TTRD2, TTUBE, TTUBS, TXTRU, TGLAxis, TGLTH3Composition, TParticle, TPrimary, TMCParticle, TProofChain, RooFit::Detail::XRooFit::xRooHypoSpace, TMVA::TSpline1, TMVA::TSpline2, TChain, TParallelCoordRange, TParallelCoordSelect, TParallelCoordVar, TSpider, Jet, TStyle, TVirtualPad, TVirtualPS, TVirtualX, TButton, TCanvas, TDialogCanvas, TGroupButton, TInspectCanvas, TPad, TPaveClass, TSlider, TSliderBox, TView, TArc, TArrow, TBox, TCandle, TCrown, TCurlyArc, TCurlyLine, TCutG, TDiamond, TEllipse, TFrame, TGaxis, TGraphPolar, TGraphPolargram, TGraphQQ, TLatex, TLegend, TLegendEntry, TLine, TPave, TPaveLabel, TPaveStats, TPavesText, TPaveText, TPieSlice, TPolyLine, TWbox, TImageDump, TPDF, TPostScript, TSVG, TTeXDump, TGX11, TGX11TTF, TPolyLine3D, TWebPadPainter, TWebPS, THbookTree, TEfficiency, TF1, TF12, TF2, TF3, TGraph, TGraph2D, TGraph2DAsymmErrors, TGraph2DErrors, TGraphAsymmErrors, TGraphBentErrors, TGraphErrors, TGraphMultiErrors, TH1, TH1C, TH1S, TH1I, TH1F, TH1D, TH1K, TH2, TH2C, TH2S, TH2I, TH2F, TH2D, TH2Poly, TH3, TH3C, TH3S, TH3I, TH3F, TH3D, TProfile, TProfile2D, TProfile2Poly, TProfile3D, TSpline, TSpline3, TSpline5, ROOT::v5::TF1Data, TPaletteAxis, RooCurve, RooEllipse, RooHist, TNtuple, TNtupleD, TTree, and TTreeSQL.
|
inline |
Definition at line 45 of file TAttLine.h.
|
protected |
Line color.
Definition at line 21 of file TAttLine.h.
|
protected |
Line style.
Definition at line 22 of file TAttLine.h.
|
protected |
Line width.
Definition at line 23 of file TAttLine.h.