papyrus logo

annulus.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2009 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 PAPYRUSANNULUS_H
00021 #define PAPYRUSANNULUS_H
00022 
00023 #include <papyrus/shape.h>
00024 
00025 namespace Papyrus
00026 {
00027 
00035   class Annulus : public Shape
00036   {
00037     protected:
00038 
00039       Annulus ( const Glib::ustring& id,
00040             double outer_radius,
00041             double inner_radius,
00042             double angle_start,
00043             double angle_end,
00044             Fill::pointer fill = Fill::pointer(),
00045                 Stroke::pointer stroke = Stroke::pointer()
00046           );
00047 
00048     public:
00049       PAPYRUS_DRAWABLE(Annulus);
00050 
00052       static pointer create ( double outer_radius = 1.0,
00053                               double inner_radius = 1.0,
00054                               double angle_start = 0.0,
00055                               double angle_end = 2.0 * M_PI,
00056                               Fill::pointer fill = Fill::pointer(),
00057                                   Stroke::pointer stroke = Stroke::pointer()
00058                             );
00059 
00061       static pointer create ( const Glib::ustring& id,
00062                               double outer_radius = 1.0,
00063                               double inner_radius = 0.5,
00064                               double angle_start = 0.0,
00065                               double angle_end = 2.0 * M_PI,
00066                               Fill::pointer fill = Fill::pointer(),
00067                                   Stroke::pointer stroke = Stroke::pointer()
00068                             );
00069 
00071       virtual ~Annulus();
00072 
00074       double outer_radius() const;
00075 
00077       void set_outer_radius ( double r );
00078 
00080       double inner_radius() const;
00081 
00083       void set_inner_radius ( double r );
00084 
00086       void set_radii( double outer, double inner );
00087 
00089       double start_angle() const;
00090 
00092       double end_angle() const;
00093 
00095       void set_angles ( double start, double end );
00096 
00098       virtual void draw_shape ( Context& cairo ) const;
00099 
00101       sigc::signal<void> signal_outer_radius();
00102 
00104       sigc::signal<void> signal_inner_radius();
00105 
00107       sigc::signal<void> signal_angle();
00108 
00109     protected:
00110 
00112       double m_outer_radius;
00113 
00115       double m_inner_radius;
00116 
00117       double m_angle_start;
00118 
00119       double m_angle_end;
00120 
00122       sigc::signal<void> m_signal_outer_radius;
00123 
00125       sigc::signal<void> m_signal_inner_radius;
00126 
00128       sigc::signal<void> m_signal_angle;
00129 
00130   };
00131 
00132 }
00133 
00134 #endif

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