1 /* === S Y N F I G ========================================================= */
2 /*!	\file outline.h
3 **	\brief Header file for implementation of the "Outline" layer
4 **
5 **	$Id$
6 **
7 **	\legal
8 **	Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **	Copyright (c) 2012-2013 Carlos López
10 **
11 **	This package is free software; you can redistribute it and/or
12 **	modify it under the terms of the GNU General Public License as
13 **	published by the Free Software Foundation; either version 2 of
14 **	the License, or (at your option) any later version.
15 **
16 **	This package is distributed in the hope that it will be useful,
17 **	but WITHOUT ANY WARRANTY; without even the implied warranty of
18 **	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 **	General Public License for more details.
20 **	\endlegal
21 */
22 /* ========================================================================= */
23 
24 /* === S T A R T =========================================================== */
25 
26 #ifndef __SYNFIG_OUTLINE_H
27 #define __SYNFIG_OUTLINE_H
28 
29 /* === H E A D E R S ======================================================= */
30 
31 #include <list>
32 #include <vector>
33 #include <synfig/layers/layer_polygon.h>
34 #include <synfig/segment.h>
35 #include <synfig/value.h>
36 
37 /* === M A C R O S ========================================================= */
38 
39 /* === T Y P E D E F S ===================================================== */
40 
41 /* === C L A S S E S & S T R U C T S ======================================= */
42 
43 using namespace synfig;
44 using namespace std;
45 using namespace etl;
46 
47 class Outline : public synfig::Layer_Polygon
48 {
49 	SYNFIG_LAYER_MODULE_EXT
50 private:
51 	//! Parameter: type list of BLinePoints
52 	ValueBase param_bline;
53 	//! Parameter: (bool)
54 	ValueBase param_round_tip[2];
55 	//! Parameter: (bool)
56 	ValueBase param_sharp_cusps;
57 	//! Parameter: (bool)
58 	ValueBase param_loop;
59 	//! Parameter: (Real)
60 	ValueBase param_width;
61 	//! Parameter: (Real)
62 	ValueBase param_expand;
63 	//! Parameter: (Real)
64 	ValueBase param_loopyness;
65 	//! Parameter: (bool)
66 	ValueBase param_homogeneous_width;
67 
68 	bool old_version;
69 
70 	bool needs_sync;
71 
72 	std::vector<synfig::Segment> segment_list;
73 	std::vector<synfig::Real> width_list;
74 
75 public:
76 	Outline();
77 
78 	virtual bool set_shape_param(const String & param, const synfig::ValueBase &value);
79 	virtual bool set_param(const String & param, const synfig::ValueBase &value);
80 	virtual ValueBase get_param(const String & param)const;
81 	virtual Vocab get_param_vocab()const;
set_version(const String & ver)82 	virtual bool set_version(const String &ver){if(ver=="0.1")old_version=true; return true;}
reset_version()83 	virtual void reset_version(){old_version=false;}
84 
85 protected:
86 	virtual void sync_vfunc();
87 };
88 
89 /* === E N D =============================================================== */
90 
91 #endif
92