marker.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation version 2.1.                *
00008  *                                                                         *
00009  *   This program is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU General Public License for more details.                          *
00013  *                                                                         *
00014  *   You should have received a copy of the GNU Lesser General Public      *
00015  *   License along with this library; if not, write to the                 *
00016  *   Free Software Foundation, Inc.,                                       *
00017  *   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA              *
00018  ***************************************************************************/
00019 #ifndef PAPYRUSMARKER_H
00020 #define PAPYRUSMARKER_H
00021 
00022 #include <papyrus/shape.h>
00023 
00024 namespace Papyrus {
00025 
00032   class Marker : public Shape {
00033     public:
00034       typedef enum STYLE {
00035         NONE,
00036         LINES,
00037         TRIANGLE,
00038         DIAMOND,
00039         HALF_DIAMOND,
00040         HALF_HEAD_UPPER,
00041         HALF_HEAD_LOWER,
00042         SLASHED_CROSS,
00043         ELLIPSE,
00044         DOT,
00045         DOUBLE_TRIANGLE,
00046         DOT_AND_TRIANGLE,
00047         BOX,
00048         CROW_FOOT,
00049         CROSS,
00050         ONE_OR_MANY,
00051         ZERO_OR_MANY,
00052         ONE_OR_ZERO,
00053         ONE_EXACTLY,
00054         CONCAVE,
00055         ROUND,
00056         OPEN_ROUND,
00057         BACKSLASH,
00058     };
00059 
00060       typedef enum FACING {
00061         LEFT,
00062         RIGHT
00063     };
00064 
00065       typedef PapyrusSmartPointer<Marker> pointer;
00066 
00068       Marker( STYLE style, double width = 20.0, double height = 20.0, FACING facing = RIGHT );
00069 
00071       static Marker::pointer create( STYLE style=NONE, double width = 20.0, double height = 20.0, FACING facing = RIGHT );
00072 
00074       ~Marker();
00075 
00077       STYLE style() const;
00078 
00080       void set_style( STYLE style );
00081 
00083       double width() const;
00084 
00086       void set_width( double width );
00087 
00089       double height() const;
00090 
00092       void set_height( double height );
00093 
00095       void width_height( double& width, double& height ) const;
00096 
00098       void set_width_height( double width, double height );
00099 
00101       LineStyle& line_style();
00102 
00108       FACING facing() const;
00109 
00111       void set_facing( FACING facing );
00112 
00114       virtual void draw_shape( Cairo::RefPtr<Cairo::Context> cairo );
00115 
00117       sigc::signal<void> signal_style();
00118 
00120       sigc::signal<void> signal_size();
00121 
00123       sigc::signal<void> signal_facing();
00124 
00125       PAPYRUS_CLASS_NAME("Marker");
00126 
00127       PAPYRUS_CLONE_METHOD( Marker );
00128 
00129                 protected:
00130       STYLE m_style;
00131 
00132       double m_width;
00133 
00134       double m_height;
00135 
00136       FACING m_facing;
00137 
00138       virtual void need_redraw();
00139 
00141       sigc::signal<void> m_signal_style;
00142 
00144       sigc::signal<void> m_signal_size;
00145 
00147       sigc::signal<void> m_signal_facing;
00148   };
00149 
00150 }
00151 
00152 #endif

Generated on Sun Mar 11 10:01:28 2007 by  doxygen 1.5.1