![]() |
SatAndLight
2.2.2-hubble
Simulation toolkit for space telescopes
|
Draw and print ROOT graphical objects. More...
#include <SatPlot.h>
Public Member Functions | |
| int | AddPad (const double aX0, const double aY0, const double aRx, const double aRy) |
| Adds a new pad (up to SPL_NPADMAX). | |
| void | Clear (const int aPadIndex=0) |
| Clears pad. | |
| void | Draw (TObject *aObj, const string aOptions="", const int aPadIndex=0) |
| Draws a ROOT object. | |
| double | GetPadXmax (const int aPadIndex=0) |
| Returns the maximum x-coordinate value visible on the pad. | |
| double | GetPadXmin (const int aPadIndex=0) |
| Returns the minimum x-coordinate value visible on the pad. | |
| double | GetPadYmax (const int aPadIndex=0) |
| Returns the maximum y-coordinate value visible on the pad. | |
| double | GetPadYmin (const int aPadIndex=0) |
| Returns the minimum y-coordinate value visible on the pad. | |
| void | Print (const string aFileName, const double aScaleFactor=1.0) |
| Prints current canvas in a file. | |
| void | ResizePad (const double aX0, const double aY0, const double aX1, const double aY1, const int aPadIndex=0) |
| Resizes a pad. | |
| void | SetGridx (const int aValue=1, const int aPadIndex=0) |
| Sets/Unsets grid for X. | |
| void | SetGridy (const int aValue=1, const int aPadIndex=0) |
| Sets/Unsets grid for Y. | |
| void | SetLogx (const int aValue, const int aPadIndex=0) |
| Sets Linear/Log scale for the X axis. | |
| void | SetLogy (const int aValue, const int aPadIndex=0) |
| Sets Linear/Log scale for Y. | |
| void | SetLogz (const int aValue, const int aPadIndex=0) |
| Sets Linear/Log scale for Z. | |
| void | UseCurrentStyle (const int aPadIndex=0) |
| Force a copy of current style for all objects in canvas. | |
Constructors and destructors | |
| SatPlot (const string aName, const int aNx=800, const int aNy=494) | |
| Constructor of the SatPlot class. | |
| virtual | ~SatPlot (void) |
| Destructor of the SatPlot class. | |
Private Member Functions | |
| void | SetStyle (void) |
| Sets the plotting style. | |
Private Attributes | |
| int | npads |
| number of working pads. | |
| int | randid |
| random integer id. | |
| string | srandid |
| random string id. | |
| TCanvas * | Wcan |
| working canvas. | |
| TPad * | Wpad [SPL_NPADMAX] |
| working pads. | |
| TStyle * | Wstyle |
| working style. | |
Draw and print ROOT graphical objects.
The SatPlot class provides a single interface to draw and print ROOT objects like histograms, graphs and so on. It also adopts a specific "hot" plotting style: black background, yellow lines and shades from red to yellow. This class mainly includes wrappers for ROOT drawing functions.
| SatPlot::SatPlot | ( | const string | aName, |
| const int | aNx = 800, |
||
| const int | aNy = 494 |
||
| ) |
Constructor of the SatPlot class.
The constructor is used to initiate the canvas to host the plots. It must be given a name and a size. By default, a single pad is drawn (pad index = 0).
| [in] | aName | Canvas name. |
| [in] | aNx | Horizontal size: number of pixels in the X direction. |
| [in] | aNy | Vertical size: number of pixels in the Y direction. |
|
virtual |
Destructor of the SatPlot class.
| int SatPlot::AddPad | ( | const double | aX0, |
| const double | aY0, | ||
| const double | aRx, | ||
| const double | aRy | ||
| ) |
Adds a new pad (up to SPL_NPADMAX).
| [in] | aX0 | Upper-left corner X position (relative to canvas). |
| [in] | aY0 | Upper-left corner Y position (relative to canvas). |
| [in] | aRx | Size in the X direction (relative to canvas). |
| [in] | aRy | Size in the Y direction (relative to canvas). |
|
inline |
Clears pad.
| [in] | aPadIndex | Pad index. |
|
inline |
Draws a ROOT object.
| [in] | aObj | Pointer to the ROOT object to draw. |
| [in] | aOptions | Drawing options (ROOT options). |
| [in] | aPadIndex | Pad index. |
|
inline |
Returns the maximum x-coordinate value visible on the pad.
If log axis the returned value is in decades.
| [in] | aPadIndex | Pad index. |
|
inline |
Returns the minimum x-coordinate value visible on the pad.
If log axis the returned value is in decades.
| [in] | aPadIndex | Pad index. |
|
inline |
Returns the maximum y-coordinate value visible on the pad.
If log axis the returned value is in decades.
| [in] | aPadIndex | Pad index. |
|
inline |
Returns the minimum y-coordinate value visible on the pad.
If log axis the returned value is in decades.
| [in] | aPadIndex | Pad index. |
| void SatPlot::Print | ( | const string | aFileName, |
| const double | aScaleFactor = 1.0 |
||
| ) |
Prints current canvas in a file.
| [in] | aFileName | File name to save the current canvas. |
| [in] | aScaleFactor | Scaling factor: the width and height are rescaled by some given factor. |
|
inline |
Resizes a pad.
| [in] | aX0 | New X0 position (relative to canvas). |
| [in] | aY0 | New Y0 position (relative to canvas). |
| [in] | aX1 | New X1 position (relative to canvas). |
| [in] | aY1 | New Y1 position (relative to canvas). |
| [in] | aPadIndex | Pad index. |
|
inline |
Sets/Unsets grid for X.
| [in] | aValue | =1: the grid is drawn. |
| [in] | aPadIndex | Pad index. |
|
inline |
Sets/Unsets grid for Y.
| [in] | aValue | =1: the grid is drawn. |
| [in] | aPadIndex | Pad index. |
|
inline |
Sets Linear/Log scale for the X axis.
| [in] | aValue | New value. |
| [in] | aPadIndex | Pad index. |
|
inline |
Sets Linear/Log scale for Y.
| [in] | aValue | New value. |
| [in] | aPadIndex | Pad index. |
|
inline |
Sets Linear/Log scale for Z.
| [in] | aValue | New value. |
| [in] | aPadIndex | Pad index. |
|
private |
Sets the plotting style.
|
inline |
Force a copy of current style for all objects in canvas.
| [in] | aPadIndex | Pad index. |
|
private |
number of working pads.
|
private |
random integer id.
|
private |
random string id.
|
private |
working canvas.
|
private |
working pads.
|
private |
working style.