moreupdates
[synfig.git] / synfig-core / trunk / src / synfig / layer_polygon.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file layer_polygon.h
3 **      \brief Template Header
4 **
5 **      $Id: layer_polygon.h,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
6 **
7 **      \legal
8 **      Copyright (c) 2002 Robert B. Quattlebaum Jr.
9 **
10 **      This software and associated documentation
11 **      are CONFIDENTIAL and PROPRIETARY property of
12 **      the above-mentioned copyright holder.
13 **
14 **      You may not copy, print, publish, or in any
15 **      other way distribute this software without
16 **      a prior written agreement with
17 **      the copyright holder.
18 **      \endlegal
19 */
20 /* ========================================================================= */
21
22 /* === S T A R T =========================================================== */
23
24 #ifndef __SYNFIG_LAYER_POLYGON_H
25 #define __SYNFIG_LAYER_POLYGON_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include "layer_shape.h"
30 #include "color.h"
31 #include "vector.h"
32 #include <list>
33 #include <vector>
34
35 /* === M A C R O S ========================================================= */
36
37 /* === T Y P E D E F S ===================================================== */
38
39 /* === C L A S S E S & S T R U C T S ======================================= */
40
41 namespace synfig {
42         
43 /*!     \class Layer_Polygon
44 **      \beief writeme
45 **      \todo This layer needs to support multiple polygons */
46 class Layer_Polygon : public Layer_Shape
47 {
48         SYNFIG_LAYER_MODULE_EXT
49         
50 private:
51                 
52         //exported data
53         std::vector< Point >    vector_list;
54
55 protected:
56
57         Layer_Polygon();
58
59 public:
60
61         ~Layer_Polygon();
62
63         //! Adds a polygon to the layer
64         /*!     The edge data is automaticly added to the
65         **      EdgeTable, so there is no need to call sync()
66         **      after adding a polygon using this function.
67         **      \param point_list A list containing the
68         **              points that define the polygon's parameter.
69         */
70         void add_polygon(const std::vector<Point> &point_list);
71
72         //! Clears out any polygon data
73         /*!     Also clears out the EdgeTable, so there is no
74         **      need to call sync() after using this function.
75         */
76         void clear();
77
78         //! Updates EdgeTable so it will reflect the parameter data
79         void sync();
80         
81         virtual bool set_param(const String & param, const synfig::ValueBase &value);
82
83         virtual ValueBase get_param(const String & param)const;
84         
85         virtual Vocab get_param_vocab()const;
86
87 private:
88         class           PolySpan;
89         bool render_polyspan(Surface *surface,PolySpan &polyspan)const;
90 }; // END of Layer_Polygon
91
92 }; // END of namespace synfig
93 /* === E N D =============================================================== */
94
95 #endif