Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Modules/ImageProcessor/ImageProcessorTools/CircleCalculation.h

Go to the documentation of this file.

    00001 /**
    00002 * @file CircleCalculation.h
    00003 * Declaration of class CircleCalculation.
    00004 *
    00005 * @author <A href=mailto:juengel@informatik.hu-berlin.de>Matthias Jüngel</A>
    00006 */
    00007
    00008 #include "Tools/RingBufferWithSum.h"
    00009
    00010 #ifndef _CircleCalculation_h_
    00011 #define _CircleCalculation_h_
    00012
    00013 #include "Tools/Math/Geometry.h"
    00014 #include "Tools/Boundary.h"
    00015 #include "Tools/Debugging/DebugDrawings.h"
    00016
    00017 /**
    00018 * @class CircleCalculation
    00019 *
    00020 *
    00021 * @author <A href=mailto:juengel@informatik.hu-berlin.de>Matthias Jüngel</A>
    00022 */
    00023
    00024 #include "Tools/Math/Vector2.h"
    00025
    00026 class CircleCalculation
    00027 {
    00028 public:
    00029 /**
    00030 * The struct represents a ball point.
    00031   */
    00032   struct BallPoint : Vector2<int>
    00033   {
    00034     bool isBottom; /**< Is the point at the lower side of the ball? */
    00035   };
    00036
    00037   void init();
    00038
    00039   bool createCircle(int set, Geometry::Circle& circle);
    00040   void addBallPoint(int set, int x, int y, bool isBottom);
    00041   int getNumberOfBallPoints(int set);
    00042   bool getBoundary(Boundary<int>& ballBoundary, int set);
    00043   int paintBallPoints(
    00044     int set,
    00045     int minIndex,
    00046     int drawingID,
    00047     Drawings::Color color,
    00048     int size);
    00049 private:
    00050   bool select3Points(int& point1, int& point2, int& point3, int set);
    00051
    00052   Vector2<int> cutMiddlePerpendiculars(
    00053     Vector2<int>& v1,
    00054     Vector2<int>& v2,
    00055     Vector2<int>& v3) const;
    00056
    00057   enum {maxNumberOfBallPoints = 400}; /**< The maximum number of ball points. */
    00058
    00059   enum {numberOfBallPointSets = 2}; /**< The number of ball point sets */
    00060
    00061   BallPoint ballPoints[maxNumberOfBallPoints][numberOfBallPointSets]; /**< All sets of ball points. */
    00062   int numberOfBallPoints[numberOfBallPointSets]; /**< The number of ball points in each set. */
    00063 };
    00064
    00065 #endif   //  _CircleCalculation_h_