kochsnowflake.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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 typedef PapyrusPointer<KochSnowflake> pointer;
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 PAPYRUS_CLASS_NAME ( "Koch Snowflake" );
00066
00067 PAPYRUS_CLONE_METHOD ( KochSnowflake );
00068
00069 protected:
00070 unsigned m_level;
00071 double m_size;
00072 double m_lsize;
00073 double m_angle;
00074
00075 void create_vertices();
00076
00077 void kochsnowflake ( unsigned level );
00078
00079 };
00080
00081 }
00082
00083 #endif