gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
CairoCircle.H
Go to the documentation of this file.
1 /* Copyright 2000-2018 Matt Flax <flatmax@flatmax.org>
2  This file is part of GTK+ IOStream class set
3 
4  GTK+ IOStream is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  GTK+ IOStream is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You have received a copy of the GNU General Public License
15  along with GTK+ IOStream
16  */
17 #ifndef CAIROCIRCLE_H_
18 #define CAIROCIRCLE_H_
19 
20 #include "CairoArc.H"
21 
22 #define CAIROCIRCLE_DEFAULT_THETASTART 0.
23 #define CAIROCIRCLE_DEFAULT_THETAEND 2.*M_PI
24 
25 
30 class CairoCircle : public CairoArc {
32  void init(){
34  thetaEnd=CAIROCIRCLE_DEFAULT_THETAEND; // the constant circle angles
35  }
36 public:
39  init();
40  }
41 
49  CairoCircle(cairo_t *cr, double x, double y, double radiusIn, bool fillIn) : CairoArc(cr, x, y, radiusIn, CAIROCIRCLE_DEFAULT_THETASTART, CAIROCIRCLE_DEFAULT_THETAEND, fillIn) {
50  init();
51  }
52 
53  virtual ~CairoCircle() {}
54 
59  void settings(double radiusIn, bool fillIn) {
60  radius=radiusIn;
61  filled=fillIn;
62  }
63 
69  void draw(cairo_t *cr, double x, double y, bool fillIn) {
70  CairoArc::draw(cr, x, y, radius, thetaStart, thetaEnd, fillIn);
71  }
72 
78  void draw(cairo_t *cr, double x, double y, double radiusIn) {
79  CairoArc::draw(cr, x, y, radiusIn, thetaStart, thetaEnd, filled);
80  }
81 
88  void draw(cairo_t *cr, double x, double y, double radiusIn, bool fillIn) {
89  CairoArc::draw(cr, x, y, radiusIn, thetaStart, thetaEnd, fillIn);
90  }
91 
96  void draw(cairo_t *cr, double x, double y) {
98  }
99 };
100 
101 #endif // CAIROCIRCLE_H_
float * x
double thetaEnd
The angles from start to end.
Definition: CairoArc.H:39
CairoCircle()
empty constructor
Definition: CairoCircle.H:38
#define CAIROCIRCLE_DEFAULT_THETASTART
The default start angle.
Definition: CairoCircle.H:22
bool filled
Whether to fill the box.
Definition: CairoArc.H:40
double thetaStart
Definition: CairoArc.H:39
CairoCircle(cairo_t *cr, double x, double y, double radiusIn, bool fillIn)
Definition: CairoCircle.H:49
void draw(cairo_t *cr, double x, double y)
Definition: CairoCircle.H:96
#define CAIROCIRCLE_DEFAULT_THETAEND
The default start angle.
Definition: CairoCircle.H:23
void settings(double radiusIn, bool fillIn)
Definition: CairoCircle.H:59
void draw(cairo_t *cr, double x, double y, bool fillIn)
Definition: CairoArc.H:82
void draw(cairo_t *cr, double x, double y, double radiusIn)
Definition: CairoCircle.H:78
void draw(cairo_t *cr, double x, double y, bool fillIn)
Definition: CairoCircle.H:69
float * y
void draw(cairo_t *cr, double x, double y, double radiusIn, bool fillIn)
Definition: CairoCircle.H:88
virtual ~CairoCircle()
Definition: CairoCircle.H:53
double radius
The radius of the circle.
Definition: CairoArc.H:38
void init()
Initialiser for the constructors which sets the default constant angles for an arc which forms a circ...
Definition: CairoCircle.H:32
gtkIOStream: /tmp/gtkiostream/include/CairoCircle.H Source File
GTK+ IOStream  Beta