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 #ifndef FLOWCANVAS_ELLIPSE_HPP
00019 #define FLOWCANVAS_ELLIPSE_HPP
00020
00021 #include <string>
00022 #include <map>
00023 #include <algorithm>
00024 #include <boost/shared_ptr.hpp>
00025 #include <libgnomecanvasmm.h>
00026 #include "flowcanvas/Connectable.hpp"
00027 #include "flowcanvas/Item.hpp"
00028
00029 namespace FlowCanvas {
00030
00031 class Canvas;
00032
00033
00041 class Ellipse : public Item, public Connectable
00042 {
00043 public:
00044 Ellipse(boost::shared_ptr<Canvas> canvas,
00045 const std::string& name,
00046 double x,
00047 double y,
00048 double x_radius,
00049 double y_radius,
00050 bool show_title = true);
00051
00052 virtual ~Ellipse();
00053
00054 Gnome::Art::Point src_connection_point() {
00055 return Gnome::Art::Point(property_x(), property_y());
00056 }
00057
00058 virtual Gnome::Art::Point dst_connection_point(const Gnome::Art::Point& src);
00059 virtual Gnome::Art::Point connection_point_vector(double dx, double dy);
00060
00061 void add_connection(boost::shared_ptr<Connection> c);
00062
00063 bool point_is_within(double x, double y);
00064
00065 void zoom(double z);
00066 void resize();
00067
00068 virtual void move(double dx, double dy);
00069 virtual void move_to(double x, double y);
00070
00071 virtual void load_location() {}
00072 virtual void store_location() {}
00073
00074 virtual void set_name(const std::string& n);
00075
00076 void set_width(double w);
00077
00078 void set_height(double h);
00079
00080 double border_width() const { return _border_width; }
00081 void set_border_width(double w);
00082
00083 void select_tick();
00084 void set_selected(bool b);
00085
00086 void set_highlighted(bool b);
00087 void set_border_color(uint32_t c);
00088 void set_base_color(uint32_t c);
00089 void set_default_base_color();
00090
00091 protected:
00092 bool is_within(const Gnome::Canvas::Rect& rect);
00093
00094 double _border_width;
00095 bool _title_visible;
00096
00097 Gnome::Canvas::Ellipse _ellipse;
00098 Gnome::Canvas::Text* _label;
00099 };
00100
00101
00102 }
00103
00104 #endif // FLOWCANVAS_ELLIPSE_HPP