ROOT 6.14/05 Reference Guide |
A window's topmost TPad
.
Definition at line 33 of file TCanvas.hxx.
Public Member Functions | |
TCanvas ()=default | |
Create a temporary TCanvas; for long-lived ones please use Create(). More... | |
~TCanvas ()=default | |
template<class PANEL > | |
bool | AddPanel (std::shared_ptr< PANEL > &panel) |
Insert panel into the canvas, canvas should be shown at this moment. More... | |
const TCanvas * | GetCanvas () const override |
Access to the top-most canvas, if any (const version). More... | |
TCanvas * | GetCanvas () override |
Access to the top-most canvas, if any (non-const version). More... | |
const std::array< TPadLength::Pixel, 2 > & | GetSize () const |
Return canvas pixel size as array with two elements - width and height. More... | |
const std::string & | GetTitle () const |
Get the canvas's title. More... | |
void | Hide () |
Close all canvas displays. More... | |
bool | IsModified () const |
Returns true is canvas was modified since last painting. More... | |
void | Modified () |
std::array< TPadLength::Normal, 2 > | PixelsToNormal (const std::array< TPadLength::Pixel, 2 > &pos) const final |
Convert a Pixel position to Canvas-normalized positions. More... | |
void | SaveAs (const std::string &filename, bool async=false, CanvasCallback_t callback=nullptr) |
Save canvas in image file. More... | |
void | SetSize (const std::array< TPadLength::Pixel, 2 > &sz) |
Set canvas pixel size as array with two elements - width and height. More... | |
void | SetSize (const TPadLength::Pixel &width, const TPadLength::Pixel &height) |
Set canvas pixel size - width and height. More... | |
void | SetTitle (const std::string &title) |
Set the canvas's title. More... | |
void | Show (const std::string &where="") |
Display the canvas. More... | |
void | Update (bool async=false, CanvasCallback_t callback=nullptr) |
update drawing More... | |
Public Member Functions inherited from ROOT::Experimental::TPadBase | |
virtual | ~TPadBase () |
void | CreateFrameIfNeeded () |
std::vector< std::vector< TPad * > > | Divide (int nHoriz, int nVert, const TPadExtent &padding={}) |
Divide this pad into a grid of subpads with padding in between. More... | |
template<class T , class... ARGS> | |
auto | Draw (const std::shared_ptr< T > &what, ARGS... args) |
Add something to be painted. More... | |
template<class T , class... ARGS> | |
auto | Draw (std::unique_ptr< T > &&what, ARGS... args) |
Add something to be painted. More... | |
template<class T , class... ARGS, class = typename std::enable_if<!ROOT::TypeTraits::IsSmartOrDumbPtr<T>::value>::type> | |
auto | Draw (const T &what, ARGS... args) |
Add a copy of something to be painted. More... | |
std::shared_ptr< TDrawable > | FindDrawable (const std::string &id) const |
TPadUserAxisBase * | GetAxis (size_t dimension) const |
Get a pad axis from the TFrame. More... | |
const TFrame * | GetFrame () const |
TPadUserAxisBase * | GetOrCreateAxis (size_t dimension) |
Get a pad axis from the TFrame. More... | |
TFrame * | GetOrCreateFrame () |
const Primitives_t & | GetPrimitives () const |
Get the elements contained in the canvas. More... | |
bool | Remove (TDrawingOptsBase &opts) |
Remove an object from the list of primitives. More... | |
void | SetAllAxisAutoBounds () |
Set the range of an axis as bound kind and bound (up or down). More... | |
void | SetAllAxisBound (const std::vector< BoundKindAndValue > &vecBoundAndKind) |
Set the range of an axis as bound kind and bound (up or down). More... | |
void | SetAllAxisBounds (const std::vector< std::array< double, 2 >> &vecBeginAndEnd) |
Set the range of an axis as bound kind and bound (up or down). More... | |
void | SetAxisAutoBounds (int dimension) |
Set the range of an axis as bound kind and bound (up or down). More... | |
void | SetAxisBound (int dimension, TPadUserAxisBase::EAxisBoundsKind boundsKind, double bound) |
Set the range of an axis as bound kind and bound (up or down). More... | |
void | SetAxisBounds (int dimension, double begin, double end) |
Set the range of an axis as begin, end. More... | |
std::array< TPadLength::Normal, 2 > | UserToNormal (const std::array< TPadLength::User, 2 > &pos) const |
Convert user coordinates to normal coordinates. More... | |
void | Wipe () |
Wipe the pad by clearing the list of primitives. More... | |
Static Public Member Functions | |
static std::shared_ptr< TCanvas > | Create (const std::string &title) |
static const std::vector< std::shared_ptr< TCanvas > > & | GetCanvases () |
Private Member Functions | |
TCanvas (const TCanvas &)=delete | |
Disable copy construction for now. More... | |
std::string | GenerateUniqueId () |
Generates unique ID inside the canvas. More... | |
TCanvas & | operator= (const TCanvas &)=delete |
Disable assignment for now. More... | |
Private Attributes | |
uint64_t | fIdCounter {2} |
counter for objects, id==1 is canvas itself More... | |
uint64_t | fModified |
Modify counter, incremented every time canvas is changed. More... | |
std::unique_ptr< Internal::TVirtualCanvasPainter > | fPainter |
The painter of this canvas, bootstrapping the graphics connection. More... | |
std::array< TPadLength::Pixel, 2 > | fSize |
Size of the canvas in pixels,. More... | |
std::string | fTitle |
use for ID generation More... | |
Friends | |
class | TPadBase |
Additional Inherited Members | |
Public Types inherited from ROOT::Experimental::TPadBase | |
using | Primitives_t = std::vector< std::shared_ptr< TDrawable > > |
Protected Member Functions inherited from ROOT::Experimental::TPadBase | |
TPadBase ()=default | |
Allow derived classes to default construct a TPadBase. More... | |
#include <ROOT/TCanvas.hxx>
|
privatedelete |
Disable copy construction for now.
|
default |
|
default |
|
inline |
Insert panel into the canvas, canvas should be shown at this moment.
Definition at line 94 of file TCanvas.hxx.
|
static |
Definition at line 74 of file TCanvas.cxx.
|
private |
Generates unique ID inside the canvas.
Definition at line 49 of file TCanvas.cxx.
|
inlineoverridevirtual |
Access to the top-most canvas, if any (const version).
Implements ROOT::Experimental::TPadBase.
Definition at line 68 of file TCanvas.hxx.
|
inlineoverridevirtual |
Access to the top-most canvas, if any (non-const version).
Implements ROOT::Experimental::TPadBase.
Definition at line 71 of file TCanvas.hxx.
|
static |
Definition at line 35 of file TCanvas.cxx.
|
inline |
Return canvas pixel size as array with two elements - width and height.
Definition at line 74 of file TCanvas.hxx.
|
inline |
Get the canvas's title.
Definition at line 112 of file TCanvas.hxx.
void TCanvas::Hide | ( | ) |
Close all canvas displays.
Definition at line 122 of file TCanvas.cxx.
bool TCanvas::IsModified | ( | ) | const |
Returns true is canvas was modified since last painting.
Definition at line 57 of file TCanvas.cxx.
|
inline |
Definition at line 100 of file TCanvas.hxx.
Disable assignment for now.
|
inlinefinalvirtual |
Convert a Pixel
position to Canvas-normalized positions.
Implements ROOT::Experimental::TPadBase.
Definition at line 118 of file TCanvas.hxx.
void TCanvas::SaveAs | ( | const std::string & | filename, |
bool | async = false , |
||
CanvasCallback_t | callback = nullptr |
||
) |
Save canvas in image file.
Create image file for the canvas Supported SVG (extension .svg), JPEG (extension .jpg or .jpeg) and PNG (extension .png)
async | specifies if file can be created asynchronous to the caller thread When operation completed, callback function is called |
Definition at line 134 of file TCanvas.cxx.
|
inline |
Set canvas pixel size as array with two elements - width and height.
Definition at line 77 of file TCanvas.hxx.
|
inline |
Set canvas pixel size - width and height.
Definition at line 80 of file TCanvas.hxx.
|
inline |
Set the canvas's title.
Definition at line 115 of file TCanvas.hxx.
void TCanvas::Show | ( | const std::string & | where = "" | ) |
Display the canvas.
Create new display for the canvas Parameter.
cef - Chromium Embeded Framework, local display, local communication qt5 - Qt5 WebEngine (when running via rootqt5), local display, local communicationbrowser - default system web-browser, communication via random http port from range 8800 - 9800 <prog> - any program name which will be started instead of default browser, like firefox or /usr/bin/opera one could also specify $url in program name, which will be replaced with canvas URL native - either any available local display or default browser
Canvas can be displayed in several different places
Definition at line 96 of file TCanvas.cxx.
void TCanvas::Update | ( | bool | async = false , |
CanvasCallback_t | callback = nullptr |
||
) |
update drawing
Definition at line 62 of file TCanvas.cxx.
|
friend |
Definition at line 34 of file TCanvas.hxx.
|
private |
counter for objects, id==1 is canvas itself
Definition at line 45 of file TCanvas.hxx.
|
private |
Modify counter, incremented every time canvas is changed.
!
Definition at line 43 of file TCanvas.hxx.
|
private |
The painter of this canvas, bootstrapping the graphics connection.
Unmapped canvases (those that never had Draw()
invoked) might not have a painter. !
Definition at line 50 of file TCanvas.hxx.
|
private |
Size of the canvas in pixels,.
Definition at line 40 of file TCanvas.hxx.
|
private |