1 /* === S Y N F I G ========================================================= */
2 /*! \file valuenode_bline.h
3 ** \brief Header file for implementation of the "BLine" valuenode conversion.
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 ** Copyright (c) 2008 Chris Moore
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.
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.
22 /* ========================================================================= */
24 /* === S T A R T =========================================================== */
26 #ifndef __SYNFIG_VALUENODE_BLINE_H
27 #define __SYNFIG_VALUENODE_BLINE_H
29 /* === H E A D E R S ======================================================= */
34 #include "valuenode.h"
37 #include "blinepoint.h"
38 #include "valuenode_dynamiclist.h"
40 /* === M A C R O S ========================================================= */
42 /* === C L A S S E S & S T R U C T S ======================================= */
47 //! Converts a list of bline points into a list of segments
48 ValueBase convert_bline_to_segment_list(const ValueBase &bline);
50 //! Converts a list of bline points into a list of widths
51 ValueBase convert_bline_to_width_list(const ValueBase &bline);
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);
56 /*! \class ValueNode_BLine
59 class ValueNode_BLine : public ValueNode_DynamicList
63 typedef etl::handle<ValueNode_BLine> Handle;
64 typedef etl::handle<const ValueNode_BLine> ConstHandle;
73 virtual ValueBase operator()(Time t)const;
75 virtual ~ValueNode_BLine();
77 virtual String link_local_name(int i)const;
79 virtual String get_name()const;
80 virtual String get_local_name()const;
82 virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;
84 virtual ListEntry create_list_entry(int index, Time time=0, Real origin=0.5);
88 LinkableValueNode* create_new()const;
91 //using synfig::LinkableValueNode::set_link_vfunc;
92 static bool check_type(ValueBase::Type type);
93 static ValueNode_BLine* create(const ValueBase &x=ValueBase::TYPE_LIST);
94 }; // END of class ValueNode_BLine
96 typedef ValueNode_BLine::ListEntry::ActivepointList ActivepointList;
98 }; // END of namespace synfig
100 /* === E N D =============================================================== */