arc.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PAPYRUSARC_H
00021 #define PAPYRUSARC_H
00022
00023 #include <cmath>
00024
00025 #include <papyrus/shape.h>
00026
00044 namespace Papyrus
00045 {
00046
00055 class Arc : public Shape
00056 {
00057 protected:
00058
00059 Arc ( const Glib::ustring& id,
00060 double radius,
00061 double angle_start,
00062 double angle_end,
00063 Fill::pointer fill = Fill::pointer(),
00064 Stroke::pointer stroke = Stroke::pointer()
00065 );
00066
00067 public:
00068 PAPYRUS_DRAWABLE(Arc);
00069
00071 static pointer create ( double radius = 1.0,
00072 double angle_start = 0.0,
00073 double angle_end = M_PI / 2.0,
00074 Fill::pointer fill = Fill::pointer(),
00075 Stroke::pointer stroke = Stroke::pointer()
00076 );
00077
00079 static pointer create ( const Glib::ustring& id,
00080 double radius = 1.0,
00081 double angle_start = 0.0,
00082 double angle_end = M_PI / 2.0,
00083 Fill::pointer fill = Fill::pointer(),
00084 Stroke::pointer stroke = Stroke::pointer()
00085 );
00086
00088 virtual ~Arc();
00089
00091 double radius() const;
00092
00094 void set_radius ( double r );
00095
00097 double start_angle() const;
00098
00100 double end_angle() const;
00101
00103 void set_angles ( double start, double end );
00104
00106 virtual void draw_shape ( Context& cairo ) const;
00107
00109 sigc::signal<void> signal_radius();
00110
00112 sigc::signal<void> signal_angle();
00113
00114 protected:
00115
00117 double m_radius;
00118
00119 double m_angle_start;
00120
00121 double m_angle_end;
00122
00124 sigc::signal<void> m_signal_radius;
00125
00127 sigc::signal<void> m_signal_angle;
00128
00129 };
00130
00131 }
00132
00133 #endif