The Gnome Chemistry Utils  0.14.0
wedge.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  * Gnome Chemistry Utils
5  * gccv/wedge.h
6  *
7  * Copyright (C) 2008-2012 Jean Bréfort <jean.brefort@normalesup.org>
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 3 of the
12  * License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
22  * USA
23  */
24 
25 #ifndef GCCV_WEDGE_H
26 #define GCCV_WEDGE_H
27 
30 #include "fill-item.h"
31 
32 namespace gccv {
33 
39 class Wedge: public Item
40 {
41 public:
52  Wedge (Canvas *canvas, double x0, double y0, double x1, double y1, double width);
65  Wedge (Group *parent, double x0, double y0, double x1, double y1, double width, ItemClient *client = NULL);
69  virtual ~Wedge ();
70 
79  void SetPosition (double x0, double y0, double x1, double y1);
80 
81  // virtual methods
89  double Distance (double x, double y, Item **item) const;
96  void Draw (cairo_t *cr, bool is_vector) const;
103  void Move (double x, double y);
104 
105 protected:
109  void UpdateBounds ();
110 
111 protected:
115  double m_xstart;
119  double m_ystart;
123  double m_xend;
127  double m_yend;
132  double m_xe1;
137  double m_ye1;
142  double m_xe2;
147  double m_ye2;
148 
153 GCCV_ITEM_POS_PROP (double, Width)
158 GCCV_ITEM_PROP (GOColor, FillColor)
159 };
160 
161 }
162 
163 #endif // GCCV_WEDGE_H