// echo object at mouse position and show a graphics line void draw_circle() { TObject *select = paddy->GetSelected(); if(!select) return; if (!select->InheritsFrom("TH2")) {paddy->SetUniqueID(0); return;} // paddy->GetCanvas()->FeedbackMode(kTRUE); // paddy->cd(); int pyold = paddy->GetUniqueID(); int px = paddy->GetEventX(); int py = paddy->GetEventY(); int event = paddy->GetEvent(); float uxmin = paddy->GetUxmin(); float uxmax = paddy->GetUxmax(); int pxmin = paddy->XtoAbsPixel(uxmin); int pxmax = paddy->XtoAbsPixel(uxmax); float xx = paddy->AbsPixeltoX(px); float yy = paddy->AbsPixeltoY(py); // cout << event << " " << px << " " << py << endl; if (event==1) //click { TEllipse* te = new TEllipse(); te->SetFillStyle(0); te->SetLineWidth(2); te->SetLineWidth(5); te->SetX1(xx); te->SetY1(yy); te->SetR1(10); te->SetR2(5); te->Draw(); cones->Add(te); te->Draw(); } paddy->Update(); // buttoncanvas->cd(); // else if (event==11) //dragging // { // TEllipse* te = (TEllipse*)cones->GetLast(); // te->SetR1(TMath::Abs(xx - te->GetX1())); // te->SetR2(TMath::Abs(yy - te->GetY1())); // te->Draw(); // } }