moreupdates
[synfig.git] / synfig-core / trunk / src / modules / mod_geometry / outline.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file bline.h
3 **      \brief Template Header
4 **
5 **      $Id: outline.h,v 1.1.1.1 2005/01/04 01:23:10 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_OUTLINE_H
25 #define __SYNFIG_OUTLINE_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include <list>
30 #include <vector>
31 #include <synfig/layer_polygon.h>
32 #include <synfig/segment.h>
33 #include <synfig/value.h>
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 using namespace synfig;
42 using namespace std;
43 using namespace etl;
44
45 class Outline : public synfig::Layer_Polygon
46 {
47         SYNFIG_LAYER_MODULE_EXT
48 private:
49
50         synfig::ValueBase bline;
51
52         std::vector<synfig::Segment> segment_list;
53         std::vector<synfig::Real> width_list;
54         
55         bool round_tip[2];
56         
57         bool sharp_cusps;
58         
59         bool loop_;
60
61         synfig::Real width;
62
63         synfig::Real expand;
64
65         Real loopyness;
66         bool old_version;
67
68         bool needs_sync;
69
70         bool homogeneous_width;
71
72 public:
73
74         Outline();
75
76         //! Updates the polygon data to match the parameters.
77         void sync();
78         
79         virtual bool set_param(const String & param, const synfig::ValueBase &value);
80
81         virtual ValueBase get_param(const String & param)const;
82
83         virtual Vocab get_param_vocab()const;
84         virtual void set_time(Context context, Time time)const;
85         virtual void set_time(Context context, Time time, Vector pos)const;
86         virtual bool set_version(const String &ver){if(ver=="0.1")old_version=true; return true;}
87         virtual void reset_version(){old_version=false;}
88         
89 };
90
91 /* === E N D =============================================================== */
92
93 #endif