bezier-arrow.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 /* 
00004  * Gnome Chemistry Utils
00005  * gccv/bezier-arrow.h 
00006  *
00007  * Copyright (C) 2009-2010 Jean Bréfort <jean.brefort@normalesup.org>
00008  *
00009  * This program is free software; you can redistribute it and/or 
00010  * modify it under the terms of the GNU General Public License as 
00011  * published by the Free Software Foundation; either version 2 of the
00012  * License, or (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00022  * USA
00023  */
00024 
00025 #ifndef GCCV_BEZIER_ARROW_H
00026 #define GCCV_BEZIER_ARROW_H
00027 
00028 #include "line-item.h"
00029 #include "structs.h"
00030 
00033 namespace gccv {
00034 
00040 class BezierArrow: public LineItem {
00041 public:
00048         BezierArrow (Canvas *canvas);
00056         BezierArrow (Group *parent, ItemClient *client = NULL);
00060         virtual ~BezierArrow ();
00061 
00062         // virtual methods
00070         double Distance (double x, double y, Item **item) const;
00077         void Draw (cairo_t *cr, bool is_vector) const;
00084         void Move (double x, double y);
00085 
00086 protected:
00090         void UpdateBounds ();
00091 
00092 public:
00106         void GetControlPoints (double &x0, double &y0, double &x1, double &y1, double &x2, double &y2, double &x3, double &y3);
00120         void SetControlPoints (double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3);
00121 
00130 GCCV_ITEM_POS_PROP (ArrowHeads, Head)
00139 GCCV_ITEM_POS_PROP (double, A)
00149 GCCV_ITEM_POS_PROP (double, B)
00158 GCCV_ITEM_POS_PROP (double, C)
00169 GCCV_ITEM_POS_PROP (bool, ShowControls)
00170 
00171 private:
00172         Point m_Controls[4];
00173 };
00174 
00175 }
00176 
00177 
00178 #endif  //  GCCV_BEZIER_ARROW_H

Generated on Fri Sep 24 15:58:41 2010 for The Gnome Chemistry Utils by  doxygen 1.5.9