rectangle.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 PAPYRUSRECTANGLE_H
00021 #define PAPYRUSRECTANGLE_H
00022
00023 #include <papyrus/shape.h>
00024
00045 namespace Papyrus
00046 {
00047
00055 class Rectangle : public Shape
00056 {
00057 protected:
00058
00059 Rectangle ( const Glib::ustring& id,
00060 double x,
00061 double y,
00062 double w,
00063 double h,
00064 Fill::pointer fill,
00065 Stroke::pointer stroke
00066 );
00067
00068 Rectangle( const AttributeValueMap& avmap );
00069
00070 public:
00071 typedef PapyrusPointer<Rectangle> pointer;
00072
00073 static Rectangle::pointer create ( double x,
00074 double y,
00075 double w,
00076 double h,
00077 Fill::pointer fill = Fill::pointer(),
00078 Stroke::pointer stroke=Stroke::pointer() );
00079
00081 static Rectangle::pointer create ( double w=0.0,
00082 double h=0.0,
00083 Fill::pointer fill = Fill::pointer(),
00084 Stroke::pointer stroke=Stroke::pointer() );
00085
00086 static Rectangle::pointer create ( const Glib::ustring& id,
00087 double x,
00088 double y,
00089 double w,
00090 double h,
00091 Fill::pointer fill = Fill::pointer(),
00092 Stroke::pointer stroke=Stroke::pointer() );
00093
00094 static Rectangle::pointer create ( const Glib::ustring& id,
00095 double w,
00096 double h,
00097 Fill::pointer fill = Fill::pointer(),
00098 Stroke::pointer stroke=Stroke::pointer() );
00099
00100 static Rectangle::pointer create( const AttributeValueMap& avmap );
00101
00102 virtual ~Rectangle();
00103
00104 virtual void set( const AttributeValueMap& avmap );
00105
00107 double width();
00108
00110 double height();
00111
00113 void xywh ( double& x, double& y, double& w, double& h );
00114
00116 void set_width ( double w );
00117
00119 void set_height ( double h );
00120
00125 void set_xywh ( double x, double y, double w, double h );
00126
00127 void set_xywh ( const Region& r );
00128
00130 virtual void draw_shape ( Cairo::RefPtr<Cairo::Context> cairo ) const;
00131
00132 virtual Glib::ustring svg(unsigned depth=0);
00133
00135 sigc::signal<void> signal_size();
00136
00137 PAPYRUS_CLASS_NAME ( "Rectangle" );
00138
00139 PAPYRUS_CLONE_METHOD ( Rectangle );
00140
00141 protected:
00142
00143 double m_width, m_height;
00144
00145 sigc::signal<void> m_signal_size;
00146
00148 virtual Region calculate_extents(const Matrix& m = Matrix::Identity, ExtentsPerformance ep = EXTENTS_QUICK) const;
00149
00150 };
00151
00152 }
00153
00154 #endif