Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
rbox.py
Go to the documentation of this file.
1## \file
2## \ingroup tutorial_rcanvas
3##
4## This ROOT 7 example demonstrates how to create a ROOT 7 canvas (RCanvas) and
5## draw ROOT 7 boxes in it (RBox). It generates a set of boxes using the
6## "normal" coordinates' system.
7## Run macro with python3 -i box.py command to get interactive canvas
8##
9## \macro_image (rcanvas_js)
10## \macro_code
11##
12## \date 2021-06-15
13## \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
14## is welcome!
15## \author Sergey Linev
16
17import ROOT
18from ROOT.Experimental import RCanvas, RBox, RPadPos, RColor, RAttrFill, RAttrLine
19
20# Create a canvas to be displayed.
21canvas = RCanvas.Create("RBox drawing")
22
23box1 = canvas.Draw[RBox](RPadPos(0.1, 0.1), RPadPos(0.3, 0.6))
26box1.fill.color = RColor(0, 255, 0, 127) # 50% opaque
28
29box2 = canvas.Draw[RBox](RPadPos(0.4, 0.2), RPadPos(0.6, 0.7))
33box2.fill.color = RColor(0, 0, 255, 179) # 70% opaque
35
36box3 = canvas.Draw[RBox](RPadPos(0.7, 0.4), RPadPos(0.9, 0.6))
40
41box4 = canvas.Draw[RBox](RPadPos(0.7, 0.7), RPadPos(0.9, 0.9))
43
44box5 = canvas.Draw[RBox](RPadPos(0.7, 0.1), RPadPos(0.9, 0.3))
48
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.