papyrus logo

circle.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 PAPYRUSCIRCLE_H
00021 #define PAPYRUSCIRCLE_H
00022 
00023 #include <papyrus/shape.h>
00024 
00041 namespace Papyrus
00042 {
00043 
00054   class Circle : public Shape
00055   {
00056     protected:
00057 
00058       Circle ( const Glib::ustring& id, double radius, Fill::pointer fill, Stroke::pointer stroke );
00059 
00060       Circle( const AttributeValueMap& avmap );
00061 
00062     public:
00063       PAPYRUS_DRAWABLE(Circle);
00064 
00066       static Circle::pointer create ( double radius = 1.0,
00067                                       Fill::pointer fill = Fill::pointer(),
00068                                       Stroke::pointer stroke = Stroke::pointer()
00069                                     );
00070 
00072       static Circle::pointer create ( const Glib::ustring& id,
00073                                       double radius = 1.0,
00074                                       Fill::pointer fill = Fill::pointer(),
00075                                       Stroke::pointer stroke = Stroke::pointer()
00076                                     );
00077 
00078       static Circle::pointer create( const AttributeValueMap& avmap );
00079 
00080       virtual ~Circle();
00081 
00082       virtual void set( const AttributeValueMap& avmap );
00083 
00085       double radius() const;
00086 
00088       void set_radius ( double r );
00089 
00091       sigc::signal<void> signal_radius();
00092 
00094       virtual void draw_shape( Context& cairo ) const;
00095 
00096       virtual Glib::ustring svg ( unsigned depth=0 );
00097 
00098     protected:
00099       
00101       double m_radius;
00102 
00104       sigc::signal<void> m_signal_radius;
00105 
00107       virtual Region calculate_extents(const Matrix& m = Matrix::Identity, ExtentsPerformance ep = EXTENTS_QUICK) const;
00108 
00109   };
00110 
00111 }
00112 
00113 #endif

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