This ROOT 7 example demonstrates how to create a ROOT 7 canvas (RCanvas) and draw ROOT 7 boxes in it (RBox).
It generates a set of boxes using the "normal" coordinates' system.
`BGuzU
#include "ROOT/RBox.hxx"
{
auto canvas = RCanvas::Create("Canvas Title");
auto Box1 = canvas->Draw<RBox>(RPadPos(0.1_normal, 0.3_normal), RPadPos(0.3_normal,0.6_normal));
RColor Color1(255, 0, 0, 0.5);
RColor Color2(0, 0, 255, 0.3);
Box1->AttrBox().AttrBorder().SetColor(Color1).SetWidth(5);
auto Box2 = canvas->Draw<RBox>(RPadPos(0.4_normal, 0.2_normal), RPadPos(0.6_normal,0.7_normal));
Box2->AttrBox().AttrBorder().SetColor(Color2).SetStyle(2).SetWidth(3);
auto Box3 = canvas->Draw<RBox>(RPadPos(0.7_normal, 0.4_normal), RPadPos(0.9_normal,0.6_normal));
Box3->AttrBox().AttrBorder().SetWidth(3);
auto Box4 = canvas->Draw<RBox>(RPadPos(0.7_normal, 0.7_normal), RPadPos(0.9_normal,0.9_normal));
Box4->AttrBox().AttrBorder().SetWidth(3);
auto Box5 = canvas->Draw<RBox>(RPadPos(0.7_normal, 0.1_normal), RPadPos(0.9_normal,0.3_normal));
Box5->AttrBox().AttrBorder().SetWidth(3);
canvas->Show();
}
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
- Date
- 2018-10-10
- Warning
- This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
- Author
- Olivier Couet
Definition in file box.cxx.