Changeset 1405


Ignore:
Timestamp:
07/16/02 09:21:24 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Makefile

    r1403 r1405  
    3838          mmc         \
    3939          mgui        \
     40          mfileio     \
    4041          manalysis   \
    4142          mfileio     \
  • trunk/MagicSoft/Mars/mgui/MCamDisplay.cc

    r1403 r1405  
    316316    }
    317317
     318    //
     319    // Setup the correct environment
     320    //
    318321    fDrawingPad->SetBorderMode(0);
    319322    fDrawingPad->SetFillColor(22);
    320323
    321324    //
    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();
    326328
    327329    //
     
    384386    }
    385387
     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
    386397    //fDrawingPad->SetEditable(kFALSE);
    387398}
     
    403414        num += i;
    404415
    405         const MHexagon &h = (MHexagon&)*(*fPixels)[i];
     416        const MHexagon &h = (*this)[i];
    406417        TText *nt = txt.DrawText(h.GetX(), h.GetY(), num);
    407418        nt->SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius());
     
    545556    out << fDrawingPad->GetWw() << "," << fDrawingPad->GetWh() << ");" << endl;
    546557}
     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//
     568Int_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//
     586void 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  
    123123    const Double_t disthex = TMath::Sqrt((Double_t)((pxhex-px)*(pxhex-px) + (pyhex-py)*(pyhex-py)));
    124124
     125    if (disthex==0)
     126        return 0;
     127
    125128    const Double_t cosa = TMath::Abs(px-pxhex) / disthex;
    126129    const Double_t sina = TMath::Abs(py-pyhex) / disthex;
     
    280283    out << "   hexagon->Draw();" << endl;
    281284}
     285
Note: See TracChangeset for help on using the changeset viewer.