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       typedef PapyrusPointer<Annulus> pointer;
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 ( Cairo::RefPtr<Cairo::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       PAPYRUS_CLASS_NAME ( "Annulus" );
00110 
00111       PAPYRUS_CLONE_METHOD ( Annulus );
00112 
00113     protected:
00114 
00116       double m_outer_radius;
00117 
00119       double m_inner_radius;
00120 
00121       double m_angle_start;
00122 
00123       double m_angle_end;
00124 
00126       sigc::signal<void> m_signal_outer_radius;
00127 
00129       sigc::signal<void> m_signal_inner_radius;
00130 
00132       sigc::signal<void> m_signal_angle;
00133 
00134   };
00135 
00136 }
00137 
00138 #endif

Generated on Wed Mar 18 12:34:03 2009 for papyrus by doxygen 1.5.7.1