Index: trunk/MagicSoft/Mars/mbase/MGMap.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MGMap.cc	(revision 7786)
+++ trunk/MagicSoft/Mars/mbase/MGMap.cc	(revision 7789)
@@ -274,4 +274,30 @@
 // --------------------------------------------------------------------------
 //
+// Draw a hexagon into the buffer (size w*h) around (x, y) with radius r and
+// the color col.
+//
+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)
+{
+    const Int_t np = 6;
+
+    const Double_t dy[np+1] = { .5   , 0.    , -.5   , -.5   , 0.    ,  .5   , .5    };
+    const Double_t dx[np+1] = { .2886,  .5772,  .2886, -.2886, -.5772, -.2886, .2886 };
+
+    //
+    //  calculate the positions of the pixel corners
+    //
+    Double_t x[np+1], y[np+1];
+    for (Int_t i=0; i<np+1; i++)
+    {
+        x[i] = px + dx[i]*d;
+        y[i] = py + dy[i]*d;
+    }
+
+    for (int i=0; i<6; i++)
+        DrawLine(buf, w, h, x[i], y[i], x[i+1], y[i+1], col, style);
+}
+
+// --------------------------------------------------------------------------
+//
 // Draw a circle into the buffer (size w*h) around (x, y) with radius r and
 // the color col.
Index: trunk/MagicSoft/Mars/mbase/MGMap.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MGMap.h	(revision 7786)
+++ trunk/MagicSoft/Mars/mbase/MGMap.h	(revision 7789)
@@ -52,4 +52,5 @@
     static UChar_t Color(int col);
     static void    DrawCircle(UChar_t *buf, int w, int h, Float_t x, Float_t y, Float_t r, UChar_t col);
+    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);
     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);
     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);
