19 void triangles(
Int_t ntriangles=50) {
27 for (
Int_t i=0;i<ntriangles;i++) {
29 x[1] = x[0] + dx*r.
Rndm(); y[1] = y[0] + dy*r.
Rndm();
30 x[2] = x[1] - dx*r.
Rndm(); y[2] = y[1] - dy*r.
Rndm();
31 x[3] = x[0]; y[3] = y[0];
34 ci = ncolors*r.
Rndm();
40 c1->
AddExec(
"ex",
"TriangleClicked()");
43 void TriangleClicked() {
47 int event =
gPad->GetEvent();
48 if (event != 11)
return;
53 printf(
"You have clicked triangle %d, color=%d\n",
virtual UInt_t GetUniqueID() const
Return the unique object id.
virtual void SetAlpha(Float_t a)
R__EXTERN TStyle * gStyle
static Int_t GetColorPalette(Int_t i)
Static function returning the color number i in current palette.
This is the base class for the ROOT Random number generators.
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
virtual Double_t Rndm()
Machine independent random number generator.
virtual void AddExec(const char *name, const char *command)
Add a new TExec object to the list of Execs.
virtual void Draw(Option_t *option="")
Draw this polyline with its current attributes.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Int_t GetNumberOfColors() const
Return number of colors in the color palette.
virtual Color_t GetFillColor() const
Return the fill area color.
The color creation and management class.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
Mother of all ROOT objects.
Defined by an array on N points in a 2-D space.