X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=synfig-core%2Ftags%2Fsynfig_0_61_06%2Fsrc%2Fsynfig%2Fvaluenode_const.cpp;fp=synfig-core%2Ftags%2Fsynfig_0_61_06%2Fsrc%2Fsynfig%2Fvaluenode_const.cpp;h=a9958d81fb371013f1fb58a4c26f43cd53c2f05b;hb=9f067badc4463e2ad6363dfe9b8c4fc28b0ec503;hp=0000000000000000000000000000000000000000;hpb=34168bb24164074ff22eb5bc47a612a738901e0a;p=synfig.git diff --git a/synfig-core/tags/synfig_0_61_06/src/synfig/valuenode_const.cpp b/synfig-core/tags/synfig_0_61_06/src/synfig/valuenode_const.cpp new file mode 100644 index 0000000..a9958d8 --- /dev/null +++ b/synfig-core/tags/synfig_0_61_06/src/synfig/valuenode_const.cpp @@ -0,0 +1,131 @@ +/* === S Y N F I G ========================================================= */ +/*! \file valuenode_const.cpp +** \brief Template File +** +** $Id$ +** +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. +** +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. +** \endlegal +*/ +/* ========================================================================= */ + +/* === H E A D E R S ======================================================= */ + +#ifdef USING_PCH +# include "pch.h" +#else +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "valuenode_const.h" +#include "general.h" + +#endif + +/* === U S I N G =========================================================== */ + +using namespace std; +using namespace etl; +using namespace synfig; + +/* === M A C R O S ========================================================= */ + +/* === G L O B A L S ======================================================= */ + +/* === P R O C E D U R E S ================================================= */ + +/* === M E T H O D S ======================================================= */ + +ValueNode_Const::ValueNode_Const() +{ + DCAST_HACK_ENABLE(); +} + + +ValueNode_Const::ValueNode_Const(const ValueBase &x): + ValueNode (x.get_type()), + value (x) +{ + DCAST_HACK_ENABLE(); +} + + +ValueNode_Const* +ValueNode_Const::create(const ValueBase &x) +{ + return new ValueNode_Const(x); +} + + +ValueNode* +ValueNode_Const::clone(const GUID& deriv_guid)const +{ + { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; } + ValueNode* ret(new ValueNode_Const(value)); + ret->set_guid(get_guid()^deriv_guid); + return ret; +} + + +ValueNode_Const::~ValueNode_Const() +{ +} + + +ValueBase +ValueNode_Const::operator()(Time t)const +{ + return value; +} + + +const ValueBase & +ValueNode_Const::get_value()const +{ + return value; +} + +ValueBase & +ValueNode_Const::get_value() +{ + return value; +} + +void +ValueNode_Const::set_value(const ValueBase &data) +{ + if(data!=value) + { + value=data; + changed(); + } +} + + +String +ValueNode_Const::get_name()const +{ + return "constant"; +} + +String +ValueNode_Const::get_local_name()const +{ + return _("Constant"); +} + +void ValueNode_Const::get_times_vfunc(Node::time_set &set) const +{ +}