71 const char *defcanvas =
gROOT->GetDefCanvasName();
75 Int_t n = lc->GetSize() + 1;
77 while(lc->FindObject(cdef.
Data()))
78 cdef.
Form(
"%s_n%d", defcanvas,
n++);
195 if ((*
gThreadXAR)(
"CANV", 2, arr,
nullptr))
return;
290 static Int_t ww = 500;
291 static Int_t wh = 500;
292 arr[1] =
this; arr[2] = (
void*)
name; arr[3] = (
void*)title; arr[4] =&ww; arr[5] = &wh;
293 if ((*
gThreadXAR)(
"CANV", 6, arr,
nullptr))
return;
308 Warning(
"Constructor",
"Deleting canvas with same name: %s",
name);
311 if (
gROOT->IsBatch()) {
327 if (form < 1 || form > 20) form = 1;
329 Int_t ux, uy, cw, ch;
331 cw =
gStyle->GetCanvasDefW();
332 ch =
gStyle->GetCanvasDefH();
333 ux =
gStyle->GetCanvasDefX();
334 uy =
gStyle->GetCanvasDefY();
392 arr[1] =
this; arr[2] = (
void*)
name; arr[3] = (
void*)title; arr[4] =&ww; arr[5] = &wh;
393 if ((*
gThreadXAR)(
"CANV", 6, arr,
nullptr))
return;
403 Error(
"Constructor",
"Invalid canvas height: %d",wh);
411 Warning(
"Constructor",
"Deleting canvas with same name: %s",
name);
414 if (
gROOT->IsBatch()) {
482 arr[1] =
this; arr[2] = (
void*)
name; arr[3] = (
void*)title;
483 arr[4] = &wtopx; arr[5] = &wtopy; arr[6] = &ww; arr[7] = &wh;
484 if ((*
gThreadXAR)(
"CANV", 8, arr,
nullptr))
return;
498 Warning(
"Constructor",
"Deleting canvas with same name: %s",
name);
501 if (
gROOT->IsBatch()) {
607 }
else if (
IsWeb()) {
634 gROOT->GetListOfCanvases()->Add(
this);
697 if ((*
gThreadXAR)(
"CDEL", 2, arr,
nullptr))
return;
749 while ((obj=next())) {
788 TCanvas *cansave = padsave ? padsave->GetCanvas() :
nullptr;
817 gROOT->GetListOfCanvases()->Remove(
this);
823 if (cansave ==
this) {
873 if (old) {
gROOT->GetListOfCanvases()->Remove(old);
delete old;}
883 if (
gROOT->IsBatch()) {
911 newCanvas->
Draw(option);
926 auto selpad =
gROOT->GetSelectedPad();
928 if (pad ==
this) pad = selpad;
929 if (!padsav || !pad || pad ==
this) {
960 while (
auto obj = next()) {
967 if (padsav) padsav->cd();
979 const Int_t kTMAX=256;
980 static char atext[kTMAX];
988 fCanvasImp->SetStatusText(selected->GetTitle(),0);
989 fCanvasImp->SetStatusText(selected->GetName(),1);
991 snprintf(atext, kTMAX,
"%c", (
char) px);
993 snprintf(atext, kTMAX,
"%d,%d", px, py);
997 TAxis *xaxis =
nullptr;
998 if ( selected->InheritsFrom(
"TH1") )
999 xaxis = ((
TH1*)selected)->GetXaxis();
1000 else if ( selected->InheritsFrom(
"TGraph") )
1001 xaxis = ((
TGraph*)selected)->GetXaxis();
1002 else if ( selected->InheritsFrom(
"TAxis") )
1003 xaxis = (
TAxis*)selected;
1005 TString objinfo = selected->GetObjectInfo(px,py);
1016 if (lnF - idF == 21) {
1017 time_format = time_format(idF+2, lnF);
1032 fCanvasImp->SetStatusText(selected->GetObjectInfo(px,py),3);
1111 if (
gROOT->GetEditorMode()) {
1190 if (
gStyle->IsReading()) {
1245 pad =
Pick(px, py, prevSelObj);
1287 pad =
Pick(px, py, prevSelObj);
1354 pad =
Pick(px, py, prevSelObj);
1371 while ((tc = (
TCanvas *)next()))
1398 pad =
Pick(px, py, prevSelObj);
1431 pad =
Pick(px, py, prevSelObj);
1448 pad =
Pick(px, py, prevSelObj);
1500 std::cout <<
"Canvas Name=" <<
GetName()<<
" Title="<<
GetTitle()<<
" Option="<<option<<std::endl;
1513 auto c =
new TCanvas(cdef.Data(), cdef.Data(), 1);
1515 ::Info(
"TCanvas::MakeDefCanvas",
" created default TCanvas with name %s", cdef.Data());
1555 if (!pad)
return nullptr;
1594 Emit(
"Picked(TPad*,TObject*,Int_t)", args);
1614 Emit(
"Highlighted(TVirtualPad*,TObject*,Int_t,Int_t)", args);
1626 Connect(
"Highlighted(TVirtualPad*,TObject*,Int_t,Int_t)",
nullptr,
nullptr, slot);
1640 Emit(
"Selected(TVirtualPad*,TObject*,Int_t)", args);
1655 Emit(
"ProcessedEvent(Int_t,Int_t,Int_t,TObject*)", args);
1700 nww =
fCw; nwh = twh;
1712 nww =
fCw; nwh = twh;
1776 out <<
" gStyle->SetOptFit(" <<
gStyle->GetOptFit() <<
");\n";
1777 out <<
" gStyle->SetOptStat(" <<
gStyle->GetOptStat() <<
");\n";
1778 out <<
" gStyle->SetOptTitle(" <<
gStyle->GetOptTitle() <<
");\n";
1780 if (
gROOT->GetEditHistograms())
1781 out <<
" gROOT->SetEditHistograms();\n";
1784 out <<
" " <<
GetName() <<
"->ToggleEventStatus();\n";
1787 out <<
" " <<
GetName() <<
"->ToggleToolTips();\n";
1790 out <<
" " <<
GetName() <<
"->ToggleToolBar();\n";
1810 gROOT->ResetClassSaved();
1824 if (filename && *filename) {
1827 fname = cname +
".C";
1831 out.open(fname.
Data(), std::ios::out);
1833 Error(
"SaveSource",
"Cannot open file: %s", fname.
Data());
1838 Int_t precision =
gEnv->GetValue(
"Canvas.SavePrecision",7);
1839 out.precision(precision);
1847 Error(
"SaveSource",
"Cannot open TCanvas");
1862 out << R
"CODE(#ifdef __CLING__
1863#pragma cling optimize(0)
1872 if (!first.
IsDigit()) out <<
"void " << mname(s,p-s) <<
"()" << std::endl;
1874 out <<
"{"<<std::endl;
1875 out <<
"//=========Macro generated from canvas: "<<
GetName()<<
"/"<<
GetTitle()<<std::endl;
1876 out <<
"//========= ("<<t.
AsString()<<
") by ROOT version "<<
gROOT->GetVersion()<<std::endl;
1878 if (
gStyle->GetCanvasPreferGL())
1879 out <<std::endl<<
" gStyle->SetCanvasPreferGL(kTRUE);"<<std::endl<<std::endl;
1887 out <<
" TCanvas *" << cname <<
" = new TCanvas(\"" <<
GetName() <<
"\", \""
1889 <<
", " << w <<
", " <<
h <<
");\n";
1892 out <<
" gStyle->SetOptFit(" <<
gStyle->GetOptFit() <<
");\n";
1893 out <<
" gStyle->SetOptStat(" <<
gStyle->GetOptStat() <<
");\n";
1894 out <<
" gStyle->SetOptTitle(" <<
gStyle->GetOptTitle() <<
");\n";
1895 if (
gROOT->GetEditHistograms())
1896 out <<
" gROOT->SetEditHistograms();\n";
1898 out <<
" " <<
GetName() <<
"->ToggleEventStatus();\n";
1900 out <<
" " <<
GetName() <<
"->ToggleToolTips();\n";
1908 if (invalid)
fName = cname;
1912 out <<
" " <<
GetName() <<
"->SetSelected(" <<
GetName() <<
");\n";
1914 out <<
" " <<
GetName() <<
"->ToggleToolBar();\n";
1920 Info(
"SaveSource",
"C++ Macro file: %s has been generated", fname.
Data());
1923 gROOT->ResetClassSaved();
1997 Error(
"SetAspectRatio",
"cannot fix aspect ratio, height of canvas is 0");
2070 Double_t ratio2 = xlength2/ylength2;
2079 }
else if (axis==2) {
2083 Error(
"SetRealAspectRatio",
"axis value %d is neither 1 (resize along x-axis) nor 2 (resize along y-axis).",axis);
2105 ratio2 = xlength2/ylength2;
2111 Error(
"SetRealAspectRatio",
"Resizing failed.");
2165 if (!was_web &&
IsWeb()) {
2171 }
else if (was_web && !imp) {
2222 if (
b.IsReading()) {
2227 if (
v>7)
b.ClassMember(
"TPad");
2233 auto root_colors =
dynamic_cast<TObjArray *
>(
gROOT->GetListOfColors());
2236 while (
auto colold =
static_cast<TColor *
>(next())) {
2237 Int_t cn = colold->GetNumber();
2240 colcur->
SetName(colold->GetName());
2241 colcur->
SetRGB(colold->GetRed(), colold->GetGreen(), colold->GetBlue());
2242 colcur->
SetAlpha(colold->GetAlpha());
2245 if (root_colors) root_colors->Remove(colcur);
2251 root_colors->AddAtAndExpand(colold, cn);
2256 [[maybe_unused]]
TColor*
const colnew =
new TColor(cn, colold->GetRed(), colold->GetGreen(), colold->GetBlue(), colold->GetName(), colold->GetAlpha());
2259 assert(root_colors->At(cn) == colnew);
2267 TIter nextcol(palette);
2268 Int_t number = palette->GetEntries();
2271 while (
auto col =
static_cast<TColor *
>(nextcol()))
2272 palcolors[i++] = col->GetNumber();
2282 if (
v>7)
b.ClassMember(
"fDISPLAY",
"TString");
2284 if (
v>7)
b.ClassMember(
"fDoubleBuffer",
"Int_t");
2286 if (
v>7)
b.ClassMember(
"fRetained",
"Bool_t");
2288 if (
v>7)
b.ClassMember(
"fXsizeUser",
"Size_t");
2290 if (
v>7)
b.ClassMember(
"fYsizeUser",
"Size_t");
2292 if (
v>7)
b.ClassMember(
"fXsizeReal",
"Size_t");
2294 if (
v>7)
b.ClassMember(
"fYsizeReal",
"Size_t");
2297 if (
v>7)
b.ClassMember(
"fWindowTopX",
"Int_t");
2299 if (
v>7)
b.ClassMember(
"fWindowTopY",
"Int_t");
2302 if (
v>7)
b.ClassMember(
"fWindowWidth",
"UInt_t");
2304 if (
v>7)
b.ClassMember(
"fWindowHeight",
"UInt_t");
2307 if (
v>7)
b.ClassMember(
"fCw",
"UInt_t");
2309 if (
v>7)
b.ClassMember(
"fCh",
"UInt_t");
2315 if (
v>7)
b.ClassMember(
"fCatt",
"TAttCanvas");
2318 if (
v>7)
b.ClassMember(
"kMoveOpaque",
"Bool_t");
2320 if (
v>7)
b.ClassMember(
"kResizeOpaque",
"Bool_t");
2322 if (
v>7)
b.ClassMember(
"fHighLightColor",
"Color_t");
2324 if (
v>7)
b.ClassMember(
"fBatch",
"Bool_t");
2327 if (
v>7)
b.ClassMember(
"kShowEventStatus",
"Bool_t");
2331 if (
v>7)
b.ClassMember(
"kAutoExec",
"Bool_t");
2334 if (
v>7)
b.ClassMember(
"kMenuBar",
"Bool_t");
2345 TObjArray *CurrentColorPalette =
nullptr;
2355 CurrentColorPalette->
SetName(
"CurrentColorPalette");
2356 for (
Int_t i=0; i<palsize; i++) CurrentColorPalette->
Add(
gROOT->GetColor(pal[i]));
2362 b.ClassMember(
"TPad");
2365 if (CurrentColorPalette) {
fPrimitives->Remove(CurrentColorPalette);
delete CurrentColorPalette; }
2366 b.ClassMember(
"fDISPLAY",
"TString");
2368 b.ClassMember(
"fDoubleBuffer",
"Int_t");
2370 b.ClassMember(
"fRetained",
"Bool_t");
2372 b.ClassMember(
"fXsizeUser",
"Size_t");
2374 b.ClassMember(
"fYsizeUser",
"Size_t");
2376 b.ClassMember(
"fXsizeReal",
"Size_t");
2378 b.ClassMember(
"fYsizeReal",
"Size_t");
2384 b.ClassMember(
"fWindowTopX",
"Int_t");
2386 b.ClassMember(
"fWindowTopY",
"Int_t");
2388 b.ClassMember(
"fWindowWidth",
"UInt_t");
2390 b.ClassMember(
"fWindowHeight",
"UInt_t");
2392 b.ClassMember(
"fCw",
"UInt_t");
2394 b.ClassMember(
"fCh",
"UInt_t");
2396 b.ClassMember(
"fCatt",
"TAttCanvas");
2398 b.ClassMember(
"kMoveOpaque",
"Bool_t");
2400 b.ClassMember(
"kResizeOpaque",
"Bool_t");
2402 b.ClassMember(
"fHighLightColor",
"Color_t");
2404 b.ClassMember(
"fBatch",
"Bool_t");
2406 b.ClassMember(
"kShowEventStatus",
"Bool_t");
2408 b.ClassMember(
"kAutoExec",
"Bool_t");
2410 b.ClassMember(
"kMenuBar",
"Bool_t");
2413 b.SetByteCount(R__c,
kTRUE);
2477 if (
auto pp =
gPad->GetPainter())
2478 return pp->IsSupportAlpha();
2483 static_cast<TCanvas*
>(TheCanvas)->Update();
2497 static const union CastFromFuncToVoidPtr_t {
2499 void (*fFuncPtr)(
void*);
2501 } castFromFuncToVoidPtr;
2506 arr[2] = castFromFuncToVoidPtr.fVoidPtr;
2507 if ((*
gThreadXAR)(
"CUPD", 3, arr,
nullptr))
return;
2606 Error(
"CreatePainter",
"GL Painter creation failed! Will use default!");
2680 std::vector<TPad *> canvases;
2682 while (
auto c =
dynamic_cast<TCanvas *
>(iter()))
2683 canvases.emplace_back(
c);
2685 if (canvases.empty()) {
2686 ::Warning(
"TCanvas::SaveAll",
"No pads are provided");
2690 return TCanvas::SaveAll(canvases, filename && *filename ? filename :
"allcanvases.pdf", option);
2693 TString fname = filename, ext;
2697 if ((pads.size() == 1) && !hasArg) {
2698 pads[0]->SaveAs(filename);
2702 auto p = fname.
Last(
'.');
2704 ext = fname(p+1, fname.
Length() - p - 1);
2708 ::Warning(
"TCanvas::SaveAll",
"Extension is not provided in file name %s, append .png", filename);
2713 if (ext !=
"pdf" && ext !=
"ps" && ext !=
"root" && ext !=
"xml" && !hasArg) {
2718 static std::vector<TString> webExtensions = {
"png",
"json",
"svg",
"pdf",
"jpg",
"jpeg",
"webp" };
2720 if (
gROOT->IsWebDisplay()) {
2722 for (
auto &wext : webExtensions) {
2723 if ((isSupported = (wext == ext)))
2728 auto cmd =
TString::Format(
"TWebCanvas::ProduceImages( *((std::vector<TPad *> *) 0x%zx), \"%s\")", (
size_t) &pads, fname.
Data());
2733 if ((ext !=
"root") && (ext !=
"xml"))
2734 ::Warning(
"TCanvas::SaveAll",
"TWebCanvas does not support image format %s - using normal ROOT functionality", fname.
Data());
2738 if (ext ==
"pdf" || ext ==
"ps") {
2739 for (
unsigned n = 0;
n < pads.size(); ++
n) {
2745 else if (
n == pads.size() - 1)
2748 pads[
n]->Print(fn.
Data(), option && *option ? option : ext.Data());
2755 if ((ext ==
"root" || ext ==
"xml") && !hasArg) {
2760 ::Warning(
"TCanvas::SaveAll",
"Filename %s cannot be used - use pad name %s as pattern", fname.
Data(), fn.
Data());
2768 for (
unsigned n = 0;
n < pads.size(); ++
n) {
2770 if (!sz) { isError =
kTRUE;
break; }
2775 ::Error(
"TCanvas::SaveAll",
"Failure to store pads in %s", filename);
2777 ::Info(
"TCanvas::SaveAll",
"ROOT file %s has been created", filename);
2782 for (
unsigned n = 0;
n < pads.size(); ++
n) {
2786 fn.
Form(
"%s%d.%s", pads[
n]->
GetName(), (
int)
n, ext.Data());
2787 ::Warning(
"TCanvas::SaveAll",
"Filename %s cannot be used - use pad name %s as pattern", fname.
Data(), fn.
Data());
2790 pads[
n]->SaveAs(fn.
Data());
int Int_t
Signed integer 4 bytes (int).
float Size_t
Attribute size (float).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
short Version_t
Class version identifier (short).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
externTApplication * gApplication
void ROOT_TCanvas_Update(void *TheCanvas)
class TCanvasInit gCanvasInit
TString GetNewCanvasName(const char *arg=nullptr)
const Size_t kDefaultCanvasSize
externTGuiFactory * gGuiFactory
externTGuiFactory * gBatchGuiFactory
externTVirtualMutex * gROOTMutex
#define R__LOCKGUARD(mutex)
externTVirtualPS * gVirtualPS
externInt_t(* gThreadXAR)(const char *xact, Int_t nb, void **ar, Int_t *iret)
static void CreateApplication()
Static function used to create a default application environment.
static void NeedGraphicsLibs()
Static method.
Array of integers (32 bits per element).
const Int_t * GetArray() const
virtual Color_t GetFillColor() const
Return the fill area color.
void Copy(TAttFill &attfill) const
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
void Copy(TAttLine &attline) const
virtual void SetBottomMargin(Float_t bottommargin)
Set Pad bottom margin in fraction of the pad height.
virtual void SetLeftMargin(Float_t leftmargin)
Set Pad left margin in fraction of the pad width.
virtual void Copy(TAttPad &attpad) const
copy function
virtual void SetRightMargin(Float_t rightmargin)
Set Pad right margin in fraction of the pad width.
virtual void SetTopMargin(Float_t topmargin)
Set Pad top margin in fraction of the pad height.
Class to manage histogram axis.
virtual Bool_t GetTimeDisplay() const
virtual const char * GetTimeFormat() const
Using a TBrowser one can browse all ROOT objects.
Buffer base class used for serializing objects.
void Init()
Initialize the TCanvas members. Called by all constructors.
UInt_t fCw
Width of the canvas along X (pixels).
~TCanvas() override
Canvas destructor.
void EmbedInto(Int_t winid, Int_t ww, Int_t wh)
Embedded a canvas into a TRootEmbeddedCanvas.
void SetWindowSize(UInt_t ww, UInt_t wh)
Set canvas window size.
static void SetFolder(Bool_t isfolder=kTRUE)
If isfolder=kTRUE, the canvas can be browsed like a folder by default a canvas is not browsable.
void Browse(TBrowser *b) override
Browse.
UInt_t GetWindowHeight() const
virtual void EditorBar()
Get editor bar.
static TCanvas * MakeDefCanvas()
Static function to build a default canvas.
void EnterLeave(TPad *prevSelPad, TObject *prevSelObj)
Generate kMouseEnter and kMouseLeave events depending on the previously selected object and the curre...
Size_t fYsizeReal
Current size of canvas along Y in CM.
void Constructor()
Canvas default constructor.
virtual void ToggleAutoExec()
Toggle pad auto execution of list of TExecs.
TCanvas(const TCanvas &canvas)=delete
Int_t fWindowTopX
Top X position of window (in pixels).
void Draw(Option_t *option="") override
Draw a canvas.
void SetDoubleBuffer(Int_t mode=1) override
Set Double Buffer On/Off.
virtual void ToggleToolTips()
Toggle tooltip display.
void Clear(Option_t *option="") override
Remove all primitives from the canvas.
void UseCurrentStyle() override
Force a copy of current style for all objects in canvas.
void Iconify()
Iconify canvas.
Int_t GetWindowTopX()
Returns current top x position of window on screen.
virtual void ToggleEventStatus()
Toggle event statusbar.
void Destructor()
Actual canvas destructor.
Bool_t fUpdated
! Set to True when Update method was called
void DeleteCanvasPainter()
assert on IsBatch() == false?
TPad * fPadSave
! Pointer to saved pad in HandleInput
static Bool_t SupportAlpha()
Static function returning "true" if transparency is supported.
Bool_t fBatch
! True when in batchmode
Bool_t fUseGL
! True when rendering is with GL
Int_t fEventX
! Last X mouse position in canvas
Bool_t IsBatch() const override
TObject * DrawClone(Option_t *option="") const override
Draw a clone of this canvas A new canvas is created that is a clone of this canvas.
Size_t fXsizeReal
Current size of canvas along X in CM.
Bool_t HasMenuBar() const
TVirtualPadPainter * GetCanvasPainter()
Access and (probably) creation of pad painter.
virtual void HighlightConnect(const char *slot)
This is "simplification" for function TCanvas::Connect with Highlighted signal for specific slot.
TPad * Pick(Int_t px, Int_t py, TObjLink *&pickobj) override
Search for an object at pixel position px,py.
void Close(Option_t *option="") override
Close canvas.
void SetFixedAspectRatio(Bool_t fixed=kTRUE) override
Fix canvas aspect ratio to current value if fixed is true.
virtual void Resize(Option_t *option="")
Recompute canvas parameters following a X11 Resize.
Color_t GetHighLightColor() const override
Bool_t GetShowToolBar() const
void DrawEventStatus(Int_t event, Int_t x, Int_t y, TObject *selected)
Report name and title of primitive below the cursor.
Bool_t IsFolder() const override
Is folder ?
Bool_t EnsurePSPainter(Bool_t create, TVirtualPadPainter *&oldp)
Replace canvas painter For intenral use only - when creating PS images.
UInt_t fWindowWidth
Width of window (including borders, etc.).
TVirtualPadPainter * fPainter
! Canvas (pad) painter.
void CopyPixmaps() override
Copy the canvas pixmap of the pad to the canvas.
Bool_t IsGrayscale()
Check whether this canvas is to be drawn in grayscale mode.
TPad * fClickSelectedPad
! Pad containing currently click-selected object
Bool_t fUpdating
! True when Updating the canvas
void SaveSource(const char *filename="", Option_t *option="")
Save primitives in this canvas as a C++ macro file.
void SetCanvasImp(TCanvasImp *i)
Set canvas implementation If web-based implementation provided, some internal fields also initialized...
Color_t fHighLightColor
Highlight color of active pad.
virtual void Size(Float_t xsizeuser=0, Float_t ysizeuser=0)
Set the canvas scale in centimeters.
virtual void ProcessedEvent(Int_t event, Int_t x, Int_t y, TObject *selected)
Emit ProcessedEvent() signal.
virtual void HandleInput(EEventType button, Int_t x, Int_t y)
Handle Input Events.
void UpdateAsync() override
Asynchronous pad update.
Size_t fXsizeUser
User specified size of canvas along X in CM.
Int_t fEventY
! Last Y mouse position in canvas
TVirtualPad * cd(Int_t subpadnumber=0) override
Set current canvas & pad.
UInt_t fWindowHeight
Height of window (including menubar, borders, etc.).
Int_t GetWindowTopY()
Returns current top y position of window on screen.
TObject * fClickSelected
! Currently click-selected object
void SetCanvasSize(UInt_t ww, UInt_t wh) override
Set Width and Height of canvas to ww and wh respectively.
TPad * fSelectedPad
! Pad containing currently selected object
virtual void Selected(TVirtualPad *pad, TObject *obj, Int_t event)
Emit Selected() signal.
Int_t fSelectedX
! X of selected object
virtual void ToggleEditor()
Toggle editor.
TVirtualPad * GetSelectedPad() const override
virtual void Picked(TPad *selpad, TObject *selected, Int_t event)
Emit Picked() signal.
TObject * fSelected
! Currently selected object
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitives in this canvas in C++ macro file with GUI.
void SetCursor(ECursor cursor) override
Set cursor.
void Streamer(TBuffer &) override
Stream a class object.
Bool_t GetShowToolTips() const
Int_t fCanvasID
! Canvas identifier
void SetGrayscale(Bool_t set=kTRUE)
Set whether this canvas should be painted in grayscale, and re-paint it if necessary.
void SetTitle(const char *title="") override
Set canvas title.
UInt_t fCh
Height of the canvas along Y (pixels).
TContextMenu * fContextMenu
! Context menu pointer
TAttCanvas fCatt
Canvas attributes.
void SetName(const char *name="") override
Set canvas name.
UInt_t GetWindowWidth() const
Bool_t fRetained
Retain structure flag.
void DisconnectWidget()
Used by friend class TCanvasImp.
void FeedbackMode(Bool_t set)
Turn rubberband feedback mode on or off.
void ls(Option_t *option="") const override
List all pads.
void RaiseWindow()
Raise canvas window.
void Build()
Build a canvas. Called by all constructors.
static Bool_t SaveAll(const std::vector< TPad * > &={}, const char *filename="", Option_t *option="")
Save provided pads/canvases into the image file(s) Filename can include printf argument for image num...
Int_t fWindowTopY
Top Y position of window (in pixels).
void Paint(Option_t *option="") override
Paint canvas.
TClass * IsA() const override
void Update() override
Update canvas pad buffers.
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
void RunAutoExec()
Execute the list of TExecs in the current pad.
virtual void Cleared(TVirtualPad *pad)
Emit pad Cleared signal.
UInt_t GetWw() const override
TCanvasImp * fCanvasImp
! Window system specific canvas implementation
UInt_t GetWh() const override
virtual void Highlighted(TVirtualPad *pad, TObject *obj, Int_t x, Int_t y)
Emit Highlighted() signal.
void Flush()
Flush canvas buffers.
Size_t fYsizeUser
User specified size of canvas along Y in CM.
Int_t fDoubleBuffer
Double buffer flag (0=off, 1=on).
void ForceUpdate()
Force canvas update.
void CreatePainter()
Probably, TPadPainter must be placed in a separate ROOT module - "padpainter" (the same as "histpaint...
void SetSelected(TObject *obj) override
Set selected canvas.
void MoveOpaque(Int_t set=1)
Set option to move objects/pads in a canvas.
static Bool_t fgIsFolder
Indicates if canvas can be browsed as a folder.
void Closed() override
Emit Closed signal.
Bool_t IsWeb() const override
Is web canvas.
void SetWindowPosition(Int_t x, Int_t y)
Set canvas window position.
TString fDISPLAY
Name of destination screen.
bool SetRealAspectRatio(const Int_t axis=1)
Function to resize a canvas so that the plot inside is shown in real aspect ratio.
Int_t fEvent
! Type of current or last handled event
Bool_t GetShowEventStatus() const
TString fSelectedOpt
! Drawing option of selected object
Int_t fSelectedY
! Y of selected object
Bool_t fDrawn
! Set to True when the Draw method is called
void SetBatch(Bool_t batch=kTRUE) override
Toggle batch mode.
void ResizeOpaque(Int_t set=1)
Set option to resize objects/pads in a canvas.
virtual void ToggleToolBar()
Toggle toolbar.
TVirtualPad * fHilightPadBorder
! pad which border will be hilghlighrt when paint canvas
virtual TObject * DrawClonePad()
Draw a clone of this canvas into the current pad In an interactive session, select the destination/cu...
static ENewType IsCallingNew()
Static method returning the defConstructor flag passed to TClass::New().
void SetName(const char *name)
TClass * IsA() const override
static Bool_t DefinedColors(Int_t set_always_on=0)
static void SaveColorsPalette(std::ostream &out)
void SetName(const char *name) override
Set the name of the TNamed.
static const TArrayI & GetPalette()
static TString SavePrimitiveColor(Int_t ci)
virtual void SetAlpha(Float_t a)
virtual void SetRGB(Float_t r, Float_t g, Float_t b)
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
const char * AsSQLString() const
Return the date & time in SQL compatible string format, like: 1997-01-15 20:16:28.
UInt_t Convert(Bool_t toGMT=kFALSE) const
Convert fDatime from TDatime format to the standard time_t format.
const char * AsString() const
Return the date & time as a string (ctime() format).
TH1 is the base class of all histogram classes in ROOT.
Option_t * GetOption() const
void Add(TObject *obj) override
Wrapper around a TObject so it can be stored in a TList.
TObject * GetObject() const
virtual Option_t * GetOption() const
virtual void Clear(Option_t *="")
Bool_t TestBit(UInt_t f) const
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to an event at (px,py).
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TObject()
TObject constructor.
@ kNoContextMenu
if object does not want context menu
@ kMustCleanup
if object destructor must call RecursiveRemove()
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Implement TVirtualPadPainter which abstracts painting operations.
Short_t GetBorderMode() const override
void SetBorderSize(Short_t bordersize) override
Int_t GetTicky() const override
void PaintBorder(Color_t color, Bool_t tops)
Paint the pad border.
Bool_t IsEditable() const override
void ResizePad(Option_t *option="") override
Compute pad conversion coefficients.
void SetGrid(Int_t valuex=1, Int_t valuey=1) override
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save primitives in this pad on the C++ source file out.
Bool_t GetGridx() const override
Double_t fX2
X of upper X coordinate.
void SetLogz(Int_t value=1) override
Set Lin/Log scale for Z.
Double_t GetY2() const override
void Close(Option_t *option="") override
Delete all primitives in pad and pad itself.
void PaintModified() override
Traverse pad hierarchy and (re)paint only modified pads.
const char * GetTitle() const override
Returns title of object.
Double_t fX1
X of lower X coordinate.
TList * GetListOfPrimitives() const override
void SetFillStyle(Style_t fstyle) override
Override TAttFill::FillStyle for TPad because we want to handle style=0 as style 4000.
void SetPad(const char *name, const char *title, Double_t xlow, Double_t ylow, Double_t xup, Double_t yup, Color_t color=35, Short_t bordersize=5, Short_t bordermode=-1) override
Set all pad parameters.
void UseCurrentStyle() override
Force a copy of current style for all objects in pad.
void Range(Double_t x1, Double_t y1, Double_t x2, Double_t y2) override
Set world coordinate system for the pad.
Double_t fY1
Y of lower Y coordinate.
Int_t fGLDevice
! OpenGL off-screen pixmap identifier
void Clear(Option_t *option="") override
Delete all pad primitives.
Int_t GetTickx() const override
Double_t fAspectRatio
ratio of w/h in case of fixed ratio
void SetLogy(Int_t value=1) override
Set Lin/Log scale for Y.
TCanvas * fCanvas
! Pointer to mother canvas
Bool_t fFixedAspectRatio
True if fixed aspect ratio.
void Modified(Bool_t flag=true) override
Mark pad modified Will be repainted when TCanvas::Update() will be called next time.
void ls(Option_t *option="") const override
List all primitives in pad.
void Streamer(TBuffer &) override
Stream a class object.
void CopyPixmaps() override
Copy the sub-pixmaps of the pad to the canvas.
void CopyPixmap() override
Copy the pixmap of the pad to the canvas.
Double_t GetY1() const override
Bool_t GetGridy() const override
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to one event.
Int_t GetLogz() const override
Short_t GetBorderSize() const override
TList * fPrimitives
->List of primitives (subpads)
Short_t fBorderSize
pad bordersize in pixels
void Paint(Option_t *option="") override
Paint all primitives in pad.
Int_t fPixmapID
! Off-screen pixmap identifier
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
Int_t GetLogy() const override
void SetBorderMode(Short_t bordermode) override
void SetTicks(Int_t valuex=1, Int_t valuey=1) override
Double_t fY2
Y of upper Y coordinate.
Short_t fBorderMode
Bordermode (-1=down, 0 = no border, 1=up).
void SetLogx(Int_t value=1) override
Set Lin/Log scale for X.
Int_t GetLogx() const override
Double_t GetX2() const override
Double_t GetX1() const override
TPad * fMother
! pointer to mother of the list
const char * GetName() const override
Returns name of object.
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
void ToLower()
Change string to lower-case.
TString & Insert(Ssiz_t pos, const char *s)
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...
const char * Data() const
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
TVirtualPS is an abstract interface to Postscript, PDF, SVG.
static TVirtualPadEditor * GetPadEditor(Bool_t load=kTRUE)
Returns the pad editor dialog. Static method.
To make it possible to use GL for 2D graphic in a TPad/TCanvas.
static TVirtualPadPainter * PadPainter(Option_t *opt="")
Create a pad painter of specified type.
virtual void SelectDrawable(Int_t device)=0
small helper class to store/restore gPad context in TPad methods
TVirtualPad()
VirtualPad default constructor.
bool HasBeenDeleted(const TObject *obj)
Check if the TObject's memory has been deleted.
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.