Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-core / tags / stable / src / synfig / layer_polygon.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file layer_polygon.h
3 **      \brief Header file for implementation of the "Polygon" layer
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **
10 **      This package is free software; you can redistribute it and/or
11 **      modify it under the terms of the GNU General Public License as
12 **      published by the Free Software Foundation; either version 2 of
13 **      the License, or (at your option) any later version.
14 **
15 **      This package is distributed in the hope that it will be useful,
16 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
17 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 **      General Public License for more details.
19 **      \endlegal
20 */
21 /* ========================================================================= */
22
23 /* === S T A R T =========================================================== */
24
25 #ifndef __SYNFIG_LAYER_POLYGON_H
26 #define __SYNFIG_LAYER_POLYGON_H
27
28 /* === H E A D E R S ======================================================= */
29
30 #include "layer_shape.h"
31 #include "color.h"
32 #include "vector.h"
33 #include <list>
34 #include <vector>
35
36 /* === M A C R O S ========================================================= */
37
38 /* === T Y P E D E F S ===================================================== */
39
40 /* === C L A S S E S & S T R U C T S ======================================= */
41
42 namespace synfig {
43
44 /*!     \class Layer_Polygon
45 **      \brief writeme
46 **      \todo This layer needs to support multiple polygons */
47 class Layer_Polygon : public Layer_Shape
48 {
49         SYNFIG_LAYER_MODULE_EXT
50
51 private:
52
53         //exported data
54         std::vector< Point >    vector_list;
55
56 protected:
57
58         Layer_Polygon();
59
60 public:
61
62         ~Layer_Polygon();
63
64         //! Adds a polygon to the layer
65         /*!     The edge data is automatically added to the
66         **      EdgeTable, so there is no need to call sync()
67         **      after adding a polygon using this function.
68         **      \param point_list A list containing the
69         **              points that define the polygon's parameter.
70         */
71         void add_polygon(const std::vector<Point> &point_list);
72
73         //! Clears out any polygon data
74         /*!     Also clears out the EdgeTable, so there is no
75         **      need to call sync() after using this function.
76         */
77         void clear();
78
79         //! Updates EdgeTable so it will reflect the parameter data
80         void sync();
81
82         virtual bool set_param(const String & param, const synfig::ValueBase &value);
83
84         virtual ValueBase get_param(const String & param)const;
85
86         virtual Vocab get_param_vocab()const;
87
88 private:
89         class           PolySpan;
90         bool render_polyspan(Surface *surface,PolySpan &polyspan)const;
91 }; // END of Layer_Polygon
92
93 }; // END of namespace synfig
94 /* === E N D =============================================================== */
95
96 #endif