Changeset 7789 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 07/14/06 01:46:24 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MGMap.cc
r4748 r7789 274 274 // -------------------------------------------------------------------------- 275 275 // 276 // Draw a hexagon into the buffer (size w*h) around (x, y) with radius r and 277 // the color col. 278 // 279 void 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 // 276 302 // Draw a circle into the buffer (size w*h) around (x, y) with radius r and 277 303 // the color col. -
trunk/MagicSoft/Mars/mbase/MGMap.h
r5143 r7789 52 52 static UChar_t Color(int col); 53 53 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); 54 55 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); 55 56 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.