Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * drawing_manipulator.h - Manipulates things like point size, line 00004 * width, etc. 00005 * 00006 * Created: Fri Oct 10 18:09:38 2008 00007 * Copyright 2008 Daniel Beck 00008 * 00009 ****************************************************************************/ 00010 00011 /* This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. A runtime exception applies to 00015 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU Library General Public License for more details. 00021 * 00022 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00023 */ 00024 00025 #ifndef __GEOMETRY_DRAWING_MANIPULATOR_H_ 00026 #define __GEOMETRY_DRAWING_MANIPULATOR_H_ 00027 00028 #include <geometry/gtk/geom_drawer.h> 00029 00030 namespace fawkes { 00031 00032 class DrawingManipulator : public GeomDrawer 00033 { 00034 public: 00035 DrawingManipulator(); 00036 virtual ~DrawingManipulator(); 00037 00038 enum Color 00039 { 00040 BLACK, /**< black */ 00041 WHITE, /**< white */ 00042 RED, /**< red */ 00043 GREEN, /**< green */ 00044 BLUE /**< blue */ 00045 }; 00046 00047 void integrate(const DrawingManipulator* m); 00048 00049 void set_line_width(float w); 00050 float get_line_width() const; 00051 00052 void set_point_size(float s); 00053 float get_point_size() const; 00054 00055 void set_color(Color c); 00056 void set_color(float r, float g, float b); 00057 void get_color(float& r, float& g, float& b) const; 00058 00059 virtual void draw(Cairo::RefPtr<Cairo::Context>& context); 00060 00061 private: 00062 float m_line_width; 00063 float m_point_size; 00064 float m_color_r; 00065 float m_color_g; 00066 float m_color_b; 00067 00068 bool m_line_width_set; 00069 bool m_point_size_set; 00070 bool m_color_set; 00071 }; 00072 00073 DrawingManipulator* set_line_width(float w); 00074 DrawingManipulator* set_point_size(float s); 00075 DrawingManipulator* set_color(float r, float g, float b); 00076 DrawingManipulator* set_color(DrawingManipulator::Color c); 00077 00078 } // end namespace fawkes 00079 00080 #endif /* __GEOMETRY_DRAWING_MANIPULATOR_H_ */