The Gnome Chemistry Utils  0.14.0
poly-line.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  * Gnome Chemistry Utils
5  * gccv/poly-line.h
6  *
7  * Copyright (C) 2008-2010 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_POLY_LINE_H
26 #define GCCV_POLY_LINE_H
27 
28 #include "line-item.h"
29 #include "structs.h"
30 #include <list>
31 
34 namespace gccv {
35 
41 class PolyLine: public LineItem
42 {
43 public:
50  PolyLine (Canvas *canvas, std::list <Point> &points);
59  PolyLine (Group *parent, std::list <Point> &points, ItemClient *client = NULL);
63  virtual ~PolyLine ();
64 
70  void SetPoints (std::list <Point> &points);
71 
72  // virtual methods
80  double Distance (double x, double y, Item **item) const;
87  void Draw (cairo_t *cr, bool is_vector) const;
94  void Move (double x, double y);
95 
96 protected:
100  void UpdateBounds ();
101 
102 protected:
106  std::list <Point> m_Points;
107 };
108 
109 }
110 
111 #endif // GCCV_POLY_LINE_H