papyrus logo

tiling.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004,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 PAPYRUSTILING_H
00021 #define PAPYRUSTILING_H
00022 
00023 #include <papyrus/enums.h>
00024 #include <papyrus/drawable.h>
00025 #include <papyrus/fill.h>
00026 #include <papyrus/rgba.h>
00027 #include <papyrus/stroke.h>
00028 
00029 namespace Papyrus
00030 {
00031 
00035   class Tiling : public Drawable
00036   {
00037     protected:
00038 
00039       Tiling ( const Glib::ustring& id, unsigned rows, unsigned columns, double side_length );
00040 
00041     public:
00042       typedef PapyrusPointer<Tiling> pointer;
00043 
00044       virtual ~Tiling();
00045 
00046       unsigned rows() const;
00047       
00048       void set_rows( unsigned r );
00049       
00050       unsigned columns() const;
00051       
00052       void set_columns( unsigned c );
00053       
00059       void set_columns_rows( unsigned c, unsigned r );
00060       
00061       double side_length() const;
00062       
00063       void set_side_length( double l );
00064       
00070       Fill::pointer fill(unsigned column, unsigned row);
00071 
00073       void set_fill ( Fill::pointer fill, unsigned column, unsigned row );
00074 
00079       void set_fill ( Paint paint, unsigned column, unsigned row );
00080 
00085       void set_fill ( Cairo::RefPtr<Cairo::Pattern> pattern, unsigned column, unsigned row );
00086 
00091       void set_fill( const RGBA& color, unsigned column, unsigned row );
00092 
00097       void set_fill( const Glib::ustring& fill, unsigned column, unsigned row );
00098 
00106       void set_fill_paint( const Glib::ustring& paint_name, unsigned column, unsigned row );
00107 
00109       Fill::pointer fill();
00110 
00112       void set_fill ( Fill::pointer fill );
00113 
00118       void set_fill ( Paint paint );
00119 
00124       void set_fill ( Cairo::RefPtr<Cairo::Pattern> pattern );
00125 
00130       void set_fill( const RGBA& color );
00131 
00136       void set_fill( const Glib::ustring& fill );
00137 
00145       void set_fill_paint( const Glib::ustring& paint_name );
00146 
00148       Stroke::pointer stroke();
00149 
00153       void set_stroke ( Stroke::pointer stroke );
00154 
00159       void set_stroke ( Paint paint );
00160 
00165       void set_stroke ( Cairo::RefPtr<Cairo::Pattern> pattern );
00166 
00171       void set_stroke ( const RGBA& color );
00172 
00177       void set_stroke ( const Glib::ustring& stroke );
00178 
00186       void set_stroke_paint( const Glib::ustring& paint_name );
00187 
00188 
00189       PAPYRUS_CLASS_NAME ( "Tiling" );
00190 
00191     protected:
00192       unsigned m_rows;
00193       unsigned m_columns;
00194       double m_side_length;
00195       
00196       Fill::pointer** m_fill;
00197       
00198       sigc::connection** m_fill_changed_connection;
00199 
00200       Fill::pointer m_default_fill;
00201       Stroke::pointer m_stroke;
00202 //       mutable Cairo::Path* m_path;
00203 
00204       sigc::connection m_default_fill_changed_connection;
00205       sigc::connection m_stroke_changed_connection;
00206 
00207       virtual void on_default_fill_changed();
00208       
00209       virtual void on_fill_changed(unsigned column, unsigned row);
00210 
00211       virtual void on_stroke_changed();
00212 
00213       virtual void shape_changed ( );
00214       
00215       virtual void update_centroid_x() = 0;
00216       
00217       virtual void update_centroid_y() = 0;
00218       
00219       virtual void update_centroid() = 0;
00220 
00221   };
00222 
00223 }
00224 
00225 #endif

Generated on Tue Sep 1 14:41:06 2009 for papyrus by doxygen 1.5.8