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.
#include "ROOT/RBox.hxx"
void rbox()
{
auto box1 = canvas->Draw<RBox>(
RPadPos(0.1_normal, 0.3_normal),
RPadPos(0.3_normal, 0.6_normal));
box1->border.width = 5;
box1->fill.color =
RColor(0, 255, 0, 127);
auto box2 = canvas->Draw<RBox>(
RPadPos(0.4_normal, 0.2_normal),
RPadPos(0.6_normal, 0.7_normal));
box2->border.width = 10.f;
box2->fill.color =
RColor(0, 0, 255, 179);
auto box3 = canvas->Draw<RBox>(
RPadPos(0.7_normal, 0.4_normal),
RPadPos(0.9_normal, 0.6_normal));
box3->border.width = 3;
auto box4 = canvas->Draw<RBox>(
RPadPos(0.7_normal, 0.7_normal),
RPadPos(0.9_normal, 0.9_normal));
box4->border.width = 4;
auto box5 = canvas->Draw<RBox>(
RPadPos(0.7_normal, 0.1_normal),
RPadPos(0.9_normal, 0.3_normal));
box5->border.rx = 10;
box5->border.ry = 10;
box5->border.width = 2;
canvas->Show();
}
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
static R__DLLEXPORT constexpr RGB_t kRed
static R__DLLEXPORT constexpr RGB_t kBlue
A position (horizontal and vertical) in a RPad.
Namespace for ROOT features in testing.
- 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 rbox.cxx.