Rename get_param_vocab to get_children_vocab and use a wrapper for the pure virtual...
[synfig.git] / synfig-core / src / synfig / valuenode_bline.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file valuenode_bline.h
3 **      \brief Header file for implementation of the "BLine" valuenode conversion.
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **      Copyright (c) 2008 Chris Moore
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_VALUENODE_BLINE_H
27 #define __SYNFIG_VALUENODE_BLINE_H
28
29 /* === H E A D E R S ======================================================= */
30
31 #include <vector>
32 #include <list>
33
34 #include "valuenode.h"
35 #include "time.h"
36 #include "uniqueid.h"
37 #include "blinepoint.h"
38 #include "valuenode_dynamiclist.h"
39
40 /* === M A C R O S ========================================================= */
41
42 /* === C L A S S E S & S T R U C T S ======================================= */
43
44 namespace synfig {
45
46
47 //! Converts a list of bline points into a list of segments
48 ValueBase convert_bline_to_segment_list(const ValueBase &bline);
49
50 //! Converts a list of bline points into a list of widths
51 ValueBase convert_bline_to_width_list(const ValueBase &bline);
52
53 //! Finds the closest point to pos in bline
54 Real find_closest_point(const ValueBase &bline, const Point &pos, Real &radius, bool loop, Point *out_point = 0);
55
56 /*! \class ValueNode_BLine
57 **      \brief \writeme
58 */
59 class ValueNode_BLine : public ValueNode_DynamicList
60 {
61 public:
62
63         typedef etl::handle<ValueNode_BLine> Handle;
64         typedef etl::handle<const ValueNode_BLine> ConstHandle;
65
66
67         ValueNode_BLine();
68
69 public:
70
71
72
73         virtual ValueBase operator()(Time t)const;
74
75         virtual ~ValueNode_BLine();
76
77         virtual String link_local_name(int i)const;
78
79         virtual String get_name()const;
80         virtual String get_local_name()const;
81
82         virtual ListEntry create_list_entry(int index, Time time=0, Real origin=0.5);
83
84 protected:
85
86         LinkableValueNode* create_new()const;
87
88 public:
89         //using synfig::LinkableValueNode::set_link_vfunc;
90         static bool check_type(ValueBase::Type type);
91         static ValueNode_BLine* create(const ValueBase &x=ValueBase::TYPE_LIST);
92         virtual Vocab get_children_vocab_vfunc()const;
93 }; // END of class ValueNode_BLine
94
95 typedef ValueNode_BLine::ListEntry::ActivepointList ActivepointList;
96
97 }; // END of namespace synfig
98
99 /* === E N D =============================================================== */
100
101 #endif