papyrus logo

arc.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This file is part of the papyrus library.                             *
00006  *                                                                         *
00007  *   papyrus is free software; you can redistribute it and/or modify       *
00008  *   it under the terms of the GNU Lesser General Public License           *
00009  *   version 3.0 as published by the Free Software Foundation.             *
00010  *                                                                         *
00011  *   papyrus is distributed in the hope that it will be useful,            *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Lesser General Public License version 3.0 for more details.       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with the papyrus library. If not, see                   *
00018  *   <http://www.gnu.org/licenses/>.                                       *
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

Generated on Fri Apr 16 12:40:10 2010 for papyrus by doxygen 1.6.1