/************************************************************************
  			micro.cpp - Copyright Michael Bunk 2004
*************************************************************************/

#include "micro.h"

namespace seemicro
{

std::ostream& operator<<(std::ostream& s, const Micro& m)
{
  return s << "Mitte: (" << m.mitte.p.x <<
    " " << m.mitte.p.y << ") Radius: " << m.radius << " Alpha: " << m.alpha;
}

void Micro::draw(IplImage* where,
  const bool filled, const double useColor, const bool setzero, const bool arm_auch)
{
  if(setzero) cvSetZero(where);

  // Kreis einzeichnen
  double color;
  if(useColor==0) color = CV_RGB(30,30,30);
  else color = useColor;

  int thickness = int(radius*0.21);
  if(filled)
  {
    cvCircle(where, mitte, int(radius), color, thickness);
  }
  else
  {
    cvCircle(where, mitte, int(radius+thickness/2), color);
    cvCircle(where, mitte, int(radius-thickness/2), color);
  }

}

} // namespace seemicro
