path_element.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 PAPYRUSPATH_ELEMENTS_H
00021 #define PAPYRUSPATH_ELEMENTS_H
00022
00023 #include <papyrus/enums.h>
00024 #include <papyrus/renderable.h>
00025
00026 namespace Papyrus
00027 {
00031 class PathElement : public Renderable
00032 {
00033 protected:
00034 PathElement ( const Glib::ustring& id, PathElementType type, double x, double y, double x1, double y1, double x2, double y2 );
00035
00036 public:
00037 PAPYRUS_RENDERABLE(PathElement);
00038
00039 static pointer create ( PathElementType type, double x=0.0, double y=0.0, double x1=0.0, double y1=0.0, double x2=0.0, double y2=0.0 );
00040
00041 static pointer create ( const Glib::ustring& id, PathElementType type, double x=0.0, double y=0.0, double x1=0.0, double y1=0.0, double x2=0.0, double y2=0.0 );
00042
00043 ~PathElement();
00044
00045 PathElementType type();
00046
00047 void set_type ( PathElementType type );
00048
00049 double x();
00050
00051 double y();
00052
00053 void set_x ( double x );
00054
00055 void set_y ( double y );
00056
00057 void set_xy ( double x, double y );
00058
00059 double x1();
00060
00061 double y1();
00062
00063 void set_x1 ( double x1 );
00064
00065 void set_y1 ( double y1 );
00066
00067 void set_x1y1 ( double x1, double y1 );
00068
00069 double x2();
00070
00071 double y2();
00072
00073 void set_x2 ( double x2 );
00074
00075 void set_y2 ( double y2 );
00076
00077 void set_x2y2 ( double x2, double y2 );
00078
00079 void set_xyx1y1x2y2 ( double x, double y, double x1, double y1, double x2, double y2 );
00080
00081 virtual void render ( Context& cairo ) const;
00082
00083 virtual void render ( Context& cairo, pointer previous ) const;
00084
00085 virtual Glib::ustring svg(unsigned depth=0);
00086
00087 protected:
00088 PathElementType m_type;
00089 weak_pointer m_self;
00090 double m_x, m_y;
00091 mutable double m_x1, m_y1, m_x2, m_y2;
00092
00093 };
00094
00095 }
00096
00097 #endif