Public Member Functions | Static Public Member Functions | Private Member Functions
bwi_mapper::CircleProvider Class Reference

Singleton class which provides the mid-point circle algorithm implementation. More...

#include <circle_provider.h>

List of all members.

Public Member Functions

void getCircle (int radius, std::vector< bool > &points, bool connect4=true)
 Returns the circle in the form of a boolean array. The array represents a box with the locations of the circle set to true.
void printCircle (const std::vector< bool > &points, int radius)
 Prints a given circle to the screen, useful for debugging.

Static Public Member Functions

static CircleProvidergetInstance ()
 Returns the singleton instance.

Private Member Functions

 CircleProvider ()
 Private constructor for singleton instance.
 CircleProvider (CircleProvider const &)
 Unimplemented copy constructor.
void operator= (CircleProvider const &)
 Unimplemented assignment operator.
void plot4Points (int x, int y, std::vector< bool > &points, int radius)
 given an (x,y) in the first octant, plots this value in all quadrants. See getCircle for description of the parameters
void plot8Points (int x, int y, std::vector< bool > &points, int radius)
 given an (x,y) in the first octant, plots mirrored values along all 8 octants. See getCircle for description of the parameters

Detailed Description

Singleton class which provides the mid-point circle algorithm implementation.

Definition at line 54 of file circle_provider.h.


Constructor & Destructor Documentation

Private constructor for singleton instance.

Definition at line 91 of file circle_provider.h.

Unimplemented copy constructor.


Member Function Documentation

void bwi_mapper::CircleProvider::getCircle ( int  radius,
std::vector< bool > &  points,
bool  connect4 = true 
)

Returns the circle in the form of a boolean array. The array represents a box with the locations of the circle set to true.

Parameters:
radiusradius of the desired circle (pixels)
pointsreference returning which points in a box of size (2*radius + 1)^2 are part of the circle. The vector represents the box in row major form, with the 0th element starting at (-radius, -radius)
connect4boolean value when true returns a 4 connected circle. If false, a 8-connected circle is returned.

Definition at line 56 of file circle_provider.cpp.

Returns the singleton instance.

Returns:
A reference to the instance

Definition at line 47 of file circle_provider.cpp.

void bwi_mapper::CircleProvider::operator= ( CircleProvider const &  ) [private]

Unimplemented assignment operator.

void bwi_mapper::CircleProvider::plot4Points ( int  x,
int  y,
std::vector< bool > &  points,
int  radius 
) [private]

given an (x,y) in the first octant, plots this value in all quadrants. See getCircle for description of the parameters

Definition at line 115 of file circle_provider.cpp.

void bwi_mapper::CircleProvider::plot8Points ( int  x,
int  y,
std::vector< bool > &  points,
int  radius 
) [private]

given an (x,y) in the first octant, plots mirrored values along all 8 octants. See getCircle for description of the parameters

Definition at line 103 of file circle_provider.cpp.

void bwi_mapper::CircleProvider::printCircle ( const std::vector< bool > &  points,
int  radius 
)

Prints a given circle to the screen, useful for debugging.

Parameters:
pointscircle returned by getCircle
radiusradius of the circle. should be same as that supplied to getCircle to construct points

Definition at line 82 of file circle_provider.cpp.


The documentation for this class was generated from the following files:


bwi_mapper
Author(s): Piyush Khandelwal
autogenerated on Fri Aug 28 2015 10:14:35