Changeset 1405 for trunk/MagicSoft
- Timestamp:
- 07/16/02 09:21:24 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Makefile
r1403 r1405 38 38 mmc \ 39 39 mgui \ 40 mfileio \ 40 41 manalysis \ 41 42 mfileio \ -
trunk/MagicSoft/Mars/mgui/MCamDisplay.cc
r1403 r1405 316 316 } 317 317 318 // 319 // Setup the correct environment 320 // 318 321 fDrawingPad->SetBorderMode(0); 319 322 fDrawingPad->SetFillColor(22); 320 323 321 324 // 322 // Append this object, so that the aspect ratio is maintained 323 // (Paint-function is called) 324 // 325 AppendPad(option); 325 // Set the initial coordinate range 326 // 327 Paint(); 326 328 327 329 // … … 384 386 } 385 387 388 // 389 // Append this object, so that the aspect ratio is maintained 390 // (Paint-function is called) 391 // Add it here so that root will have it first in the internal list: 392 // This means, that root 'sees' the whole camera instead of all the 393 // single hexagons. 394 // 395 AppendPad(option); 396 386 397 //fDrawingPad->SetEditable(kFALSE); 387 398 } … … 403 414 num += i; 404 415 405 const MHexagon &h = ( MHexagon&)*(*fPixels)[i];416 const MHexagon &h = (*this)[i]; 406 417 TText *nt = txt.DrawText(h.GetX(), h.GetY(), num); 407 418 nt->SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()); … … 545 556 out << fDrawingPad->GetWw() << "," << fDrawingPad->GetWh() << ");" << endl; 546 557 } 558 559 // ------------------------------------------------------------------------ 560 // 561 // compute the distance of a point (px,py) to the Camera 562 // this functions needed for graphical primitives, that 563 // means without this function you are not able to interact 564 // with the graphical primitive with the mouse!!! 565 // 566 // All calcutations are running in pixel coordinates 567 // 568 Int_t MCamDisplay::DistancetoPrimitive(Int_t px, Int_t py) 569 { 570 Int_t dist = 999999; 571 572 for (UInt_t i=0; i<fNumPixels; i++) 573 { 574 Int_t d = (*fPixels)[i]->DistancetoPrimitive(px, py); 575 576 if (d<dist) 577 dist=d; 578 } 579 return dist==0?0:999999; 580 } 581 582 // ------------------------------------------------------------------------ 583 // 584 // Execute a mouse event on the camera 585 // 586 void MCamDisplay::ExecuteEvent(Int_t event, Int_t px, Int_t py) 587 { 588 cout << "Execute Event Camera " << event << " @ " << px << " " << py << endl; 589 } -
trunk/MagicSoft/Mars/mgui/MHexagon.cc
r1330 r1405 123 123 const Double_t disthex = TMath::Sqrt((Double_t)((pxhex-px)*(pxhex-px) + (pyhex-py)*(pyhex-py))); 124 124 125 if (disthex==0) 126 return 0; 127 125 128 const Double_t cosa = TMath::Abs(px-pxhex) / disthex; 126 129 const Double_t sina = TMath::Abs(py-pyhex) / disthex; … … 280 283 out << " hexagon->Draw();" << endl; 281 284 } 285
Note:
See TracChangeset
for help on using the changeset viewer.