papyrus logo

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

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