ROOT 6.14/05 Reference Guide |
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 flagOpenGL.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 ... 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:
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. More... | |
TAttLine (Color_t lcolor, Style_t lstyle, Width_t lwidth) | |
AttLine normal constructor. More... | |
virtual | ~TAttLine () |
AttLine destructor. More... | |
void | Copy (TAttLine &attline) const |
Copy this line attributes to a new TAttLine. More... | |
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. More... | |
virtual Color_t | GetLineColor () const |
Return the line color. More... | |
virtual Style_t | GetLineStyle () const |
Return the line style. More... | |
virtual Width_t | GetLineWidth () const |
Return the line width. More... | |
virtual void | Modify () |
Change current line attributes if necessary. More... | |
virtual void | ResetAttLine (Option_t *option="") |
Reset this line attributes to default values. More... | |
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. More... | |
virtual void | SetLineAttributes () |
Invoke the DialogCanvas Line attributes. More... | |
virtual void | SetLineColor (Color_t lcolor) |
Set the line color. More... | |
virtual void | SetLineColorAlpha (Color_t lcolor, Float_t lalpha) |
Set a transparent line color. More... | |
virtual void | SetLineStyle (Style_t lstyle) |
Set the line style. More... | |
virtual void | SetLineWidth (Width_t lwidth) |
Set the line width. More... | |
Protected Attributes | |
Color_t | fLineColor |
Line color. More... | |
Style_t | fLineStyle |
Line style. More... | |
Width_t | fLineWidth |
Line width. More... | |
#include <TAttLine.h>
TAttLine::TAttLine | ( | ) |
AttLine default constructor.
Definition at line 130 of file TAttLine.cxx.
AttLine normal constructor.
Line attributes are taking from the argument list
Definition at line 147 of file TAttLine.cxx.
|
virtual |
AttLine destructor.
Definition at line 157 of file TAttLine.cxx.
Copy this line attributes to a new TAttLine.
Definition at line 164 of file TAttLine.cxx.
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 198 of file TAttLine.cxx.
|
inlinevirtual |
Return the line color.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 33 of file TAttLine.h.
|
inlinevirtual |
Return the line style.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 34 of file TAttLine.h.
|
inlinevirtual |
Return the line width.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 35 of file TAttLine.h.
|
virtual |
Change current line attributes if necessary.
Definition at line 234 of file TAttLine.cxx.
Reset this line attributes to default values.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 252 of file TAttLine.cxx.
|
virtual |
Save line attributes as C++ statement(s) on output stream out.
Definition at line 262 of file TAttLine.cxx.
|
virtual |
Invoke the DialogCanvas Line attributes.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 282 of file TAttLine.cxx.
Set the line color.
Reimplemented in TGeoVolumeMulti, TGeoVolume, TGX11, TGWin32, TEveTrackList, TVirtualX, TPostScript, TSpider, TGWin32VirtualXProxy, TPDF, TEveStraightLineSet, TPaletteAxis, TTeXDump, TParallelCoordRange, TGQuartz, TSVG, and TEveLine.
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).
Definition at line 291 of file TAttLine.cxx.
Set the line style.
Reimplemented in TGeoVolumeMulti, TGeoVolume, TGX11, TGWin32, TEveTrackList, TVirtualX, TPostScript, TSpider, TGWin32VirtualXProxy, TPDF, TTeXDump, TGQuartz, TSVG, and TEveLine.
Definition at line 42 of file TAttLine.h.
Set the line width.
Reimplemented in TGeoVolumeMulti, TGeoVolume, TGX11, TGWin32, TEveTrackList, TVirtualX, TPostScript, TSpider, TGWin32VirtualXProxy, TPDF, TPaletteAxis, TTeXDump, TGQuartz, TParallelCoordRange, TSVG, and TEveLine.
Definition at line 43 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.