papyrus logo

sierpinski.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 PAPYRUSSIERPINSKI_H
00021 #define PAPYRUSSIERPINSKI_H
00022 
00023 #include <papyrus/polyline.h>
00024 
00025 namespace Papyrus
00026 {
00027 
00031   class Sierpinski : public Polyline
00032   {
00033     protected:
00034 
00035       Sierpinski ( const Glib::ustring& id, unsigned level, double size, Fill::pointer fill, Stroke::pointer stroke );
00036 
00037     public:
00038       PAPYRUS_DRAWABLE(Sierpinski);
00039 
00040       static Sierpinski::pointer create ( unsigned level=0,
00041                                           double size=0.0,
00042                                           Fill::pointer fill=Fill::pointer(),
00043                                           Stroke::pointer stroke=Stroke::pointer() );
00044 
00045       static Sierpinski::pointer create ( const Glib::ustring& id,
00046                                           unsigned level=0,
00047                                           double size=0.0,
00048                                           Fill::pointer fill=Fill::pointer(),
00049                                           Stroke::pointer stroke=Stroke::pointer() );
00050 
00051       virtual ~Sierpinski();
00052 
00053       unsigned level();
00054 
00055       void set_level ( unsigned level );
00056 
00057       double size();
00058 
00059       void set_size ( double size );
00060 
00061     protected:
00062       unsigned m_level;
00063       double m_size;
00064       double m_lsize;
00065 
00066       void create_vertices();
00067 
00068       void sierpinski_a ( unsigned level );
00069 
00070       void sierpinski_b ( unsigned level );
00071 
00072       void sierpinski_c ( unsigned level );
00073 
00074       void sierpinski_d ( unsigned level );
00075 
00076   };
00077 
00078 }
00079 
00080 #endif

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