Changeset 7789


Ignore:
Timestamp:
07/14/06 01:46:24 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/stargleds.txt

    r7614 r7789  
    1 125    148.9  0 0
    2 217.37 284.03 0 0
    3 141.9  429.3  0 0
    4 192    201    0 0
    5168     127    0 0
     2127    142    0 0
     3189    199    0 0
     4217    279    0 0
     5144    423    0 0
  • trunk/MagicSoft/Mars/Changelog

    r7786 r7789  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2006/07/13 Thomas Bretz
     21
     22   * mastro/MAstroCatalog.h:
     23     - implemented new member function GetNumStars
     24
     25   * mbase/MGMap.[h,cc]:
     26     - implemented new member function DrawHexagon
     27
     28
    2029
    2130 2006/07/11 Thomas Bretz
  • trunk/MagicSoft/Mars/mastro/MAstroCatalog.h

    r7491 r7789  
    151151    // Interface to get stars
    152152    TList *GetList() { return &fList; } // Return list of stars
     153    UInt_t GetNumStars() const { return fList.GetEntries(); }
    153154
    154155    // TObject
  • trunk/MagicSoft/Mars/mbase/MGMap.cc

    r4748 r7789  
    274274// --------------------------------------------------------------------------
    275275//
     276// Draw a hexagon into the buffer (size w*h) around (x, y) with radius r and
     277// the color col.
     278//
     279void MGMap::DrawHexagon(UChar_t *buf, int w, int h, Float_t px, Float_t py, Float_t d, UChar_t col, Int_t style)
     280{
     281    const Int_t np = 6;
     282
     283    const Double_t dy[np+1] = { .5   , 0.    , -.5   , -.5   , 0.    ,  .5   , .5    };
     284    const Double_t dx[np+1] = { .2886,  .5772,  .2886, -.2886, -.5772, -.2886, .2886 };
     285
     286    //
     287    //  calculate the positions of the pixel corners
     288    //
     289    Double_t x[np+1], y[np+1];
     290    for (Int_t i=0; i<np+1; i++)
     291    {
     292        x[i] = px + dx[i]*d;
     293        y[i] = py + dy[i]*d;
     294    }
     295
     296    for (int i=0; i<6; i++)
     297        DrawLine(buf, w, h, x[i], y[i], x[i+1], y[i+1], col, style);
     298}
     299
     300// --------------------------------------------------------------------------
     301//
    276302// Draw a circle into the buffer (size w*h) around (x, y) with radius r and
    277303// the color col.
  • trunk/MagicSoft/Mars/mbase/MGMap.h

    r5143 r7789  
    5252    static UChar_t Color(int col);
    5353    static void    DrawCircle(UChar_t *buf, int w, int h, Float_t x, Float_t y, Float_t r, UChar_t col);
     54    static void    DrawHexagon(UChar_t *buf, int w, int h, Float_t x, Float_t y, Float_t r, UChar_t col, Int_t style=1);
    5455    static void    DrawLine(UChar_t *buf, int w, int h, Float_t x1, Float_t y1, Float_t x2, Float_t y2, UChar_t col, Int_t style=1);
    5556    static void    DrawBox(UChar_t *buf, int w, int h, Float_t x1, Float_t y1, Float_t x2, Float_t y2, UChar_t col, Int_t style=1);
Note: See TracChangeset for help on using the changeset viewer.