20 #include <cairo/cairo.h> 22 #define _USE_MATH_DEFINES 26 #define CAIROARC_DEFAULT_RADIUS 20. 27 #define CAIROARC_DEFAULT_FILLED false 28 #define CAIROARC_DEFAULT_THETASTART 0. 29 #define CAIROARC_DEFAULT_THETAEND M_PI/2. 59 CairoArc(cairo_t *cr,
double x,
double y,
double radiusIn,
double angleStart,
double angleEnd,
bool fillIn){
60 draw(cr, x, y, radiusIn, angleStart, angleEnd, fillIn);
71 void settings(
double radiusIn,
double angleStart,
double angleEnd,
bool fillIn){
73 thetaStart=angleStart; thetaEnd=angleEnd;
82 void draw(cairo_t *cr,
double x,
double y,
bool fillIn){
83 settings(radius, thetaStart, thetaEnd, fillIn);
92 void draw(cairo_t *cr,
double x,
double y,
double radiusIn){
93 settings(radiusIn, thetaStart, thetaEnd, filled);
103 void draw(cairo_t *cr,
double x,
double y,
double radiusIn,
bool fillIn){
104 settings(radiusIn, thetaStart, thetaEnd, fillIn);
115 void draw(cairo_t *cr,
double x,
double y,
double angleStart,
double angleEnd,
bool fillIn){
116 settings(radius, angleStart, angleEnd, fillIn);
127 void draw(cairo_t *cr,
double x,
double y,
double radiusIn,
double angleStart,
double angleEnd){
128 settings(radiusIn, angleStart, angleEnd, filled);
140 void draw(cairo_t *cr,
double x,
double y,
double radiusIn,
double angleStart,
double angleEnd,
bool fillIn){
141 settings(radiusIn, angleStart, angleEnd, fillIn);
150 void draw(cairo_t *cr,
double x,
double y) {
151 cairo_move_to(cr, x, y);
153 cairo_move_to(cr, x+cos(thetaStart)*radius, y+sin(thetaStart)*radius);
154 cairo_arc(cr, x, y, radius, thetaStart, thetaEnd);
183 #endif // CAIROARC_H_ void draw(cairo_t *cr, double x, double y, double radiusIn)
CairoArc()
Empty constructor.
double thetaEnd
The angles from start to end.
void draw(cairo_t *cr, double x, double y, double radiusIn, bool fillIn)
#define CAIROARC_DEFAULT_THETASTART
The default start angle.
bool filled
Whether to fill the box.
void draw(cairo_t *cr, double x, double y)
CairoArc(cairo_t *cr, double x, double y, double radiusIn, double angleStart, double angleEnd, bool fillIn)
#define CAIROARC_DEFAULT_FILLED
The default fill value.
void draw(cairo_t *cr, double x, double y, double angleStart, double angleEnd, bool fillIn)
void settings(double radiusIn, double angleStart, double angleEnd, bool fillIn)
#define CAIROARC_DEFAULT_THETAEND
The default ending angle (half circle)
void draw(cairo_t *cr, double x, double y, bool fillIn)
void draw(cairo_t *cr, double x, double y, double radiusIn, double angleStart, double angleEnd, bool fillIn)
#define CAIROARC_DEFAULT_RADIUS
The default radius.
void draw(cairo_t *cr, double x, double y, double radiusIn, double angleStart, double angleEnd)
double radius
The radius of the circle.