Ardour  9.0-pre0-582-g084a23a80d
arc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013-2015 Paul Davis <paul@linuxaudiosystems.com>
3  *
4  * This program 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  * This program 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 should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef __CANVAS_ARC_H__
20 #define __CANVAS_ARC_H__
21 
22 #include "canvas/fill.h"
23 #include "canvas/item.h"
24 #include "canvas/outline.h"
25 #include "canvas/visibility.h"
26 
27 namespace ArdourCanvas {
28 
29 class Canvas;
30 
31 class LIBCANVAS_API Arc : public Item
32 {
33 public:
34  Arc (Canvas*);
35  Arc (Item*);
36 
37  void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const;
38  void compute_bounding_box () const;
39 
40  void _size_allocate (Rect const & r);
41 
42  void set_center (Duple const &);
43  void set_radius (Coord);
44  void set_arc (double degrees);
45  void set_start (double degrees);
46 
47  Duple center() const {
48  return _center;
49  }
50  Coord radius () const {
51  return _radius;
52  }
53  double arc_degrees () const {
54  return _arc_degrees;
55  }
56  double start_degrees () const {
57  return _start_degrees;
58  }
59 
60  bool covers (Duple const &) const;
61 
62 private:
65  double _arc_degrees;
67 };
68 
69 }
70 
71 #endif
#define LIBCANVAS_API
Coord _radius
Definition: arc.h:64
bool covers(Duple const &) const
Coord radius() const
Definition: arc.h:50
void render(Rect const &area, Cairo::RefPtr< Cairo::Context >) const
void compute_bounding_box() const
Duple _center
Definition: arc.h:63
double _arc_degrees
Definition: arc.h:65
void set_radius(Coord)
Duple center() const
Definition: arc.h:47
double arc_degrees() const
Definition: arc.h:53
void set_arc(double degrees)
double start_degrees() const
Definition: arc.h:56
void set_center(Duple const &)
void set_start(double degrees)
void _size_allocate(Rect const &r)
double _start_degrees
Definition: arc.h:66