X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvaluenode.cpp;h=2611392d1eb77fecbe727058ab8a13f8b55ff9c1;hb=c548bdf3c6b899415810f9f9438fcfd6769b78ce;hp=77b948907550b01f52f41cfb0a3a20f6fea6f661;hpb=09b58ee2465d302977a2dcb4c4e16737fe5d8a2a;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/valuenode.cpp b/synfig-core/trunk/src/synfig/valuenode.cpp index 77b9489..2611392 100644 --- a/synfig-core/trunk/src/synfig/valuenode.cpp +++ b/synfig-core/trunk/src/synfig/valuenode.cpp @@ -1,11 +1,12 @@ /* === S Y N F I G ========================================================= */ /*! \file valuenode.cpp -** \brief Template File +** \brief Implementation of the "Placeholder" valuenode conversion. ** ** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -42,9 +43,15 @@ #include "valuenode_composite.h" #include "valuenode_reference.h" #include "valuenode_scale.h" +#include "valuenode_blinecalctangent.h" +#include "valuenode_blinecalcvertex.h" +#include "valuenode_blinereversetangent.h" #include "valuenode_segcalctangent.h" #include "valuenode_segcalcvertex.h" +#include "valuenode_repeat_gradient.h" #include "valuenode_stripes.h" +#include "valuenode_range.h" +#include "valuenode_add.h" #include "valuenode_subtract.h" #include "valuenode_timedswap.h" #include "valuenode_twotone.h" @@ -53,6 +60,14 @@ #include "valuenode_radialcomposite.h" #include "valuenode_gradientrotate.h" #include "valuenode_sine.h" +#include "valuenode_cos.h" +#include "valuenode_atan2.h" +#include "valuenode_exp.h" +#include "valuenode_switch.h" +#include "valuenode_timeloop.h" +#include "valuenode_reciprocal.h" +#include "valuenode_duplicate.h" +#include "valuenode_integer.h" #include "layer.h" @@ -102,17 +117,31 @@ ValueNode::subsys_init() ADD_VALUENODE(ValueNode_Composite, "composite", _("Composite") ); ADD_VALUENODE(ValueNode_RadialComposite,"radial_composite", _("Radial Composite") ); ADD_VALUENODE(ValueNode_Reference, "reference", _("Reference") ); + ADD_VALUENODE(ValueNode_Repeat_Gradient,"repeat_gradient", _("Repeat Gradient") ); ADD_VALUENODE(ValueNode_Scale, "scale", _("Scale") ); + ADD_VALUENODE(ValueNode_BLineCalcTangent,"blinecalctangent",_("BLine Tangent") ); + ADD_VALUENODE(ValueNode_BLineCalcVertex,"blinecalcvertex", _("BLine Vertex") ); + ADD_VALUENODE(ValueNode_BLineRevTangent,"blinerevtangent", _("Reverse Tangent") ); ADD_VALUENODE(ValueNode_SegCalcTangent, "segcalctangent", _("Segment Tangent") ); ADD_VALUENODE(ValueNode_SegCalcVertex, "segcalcvertex", _("Segment Vertex") ); ADD_VALUENODE(ValueNode_Stripes, "stripes", _("Stripes") ); + ADD_VALUENODE(ValueNode_Range, "range", _("Range") ); + ADD_VALUENODE(ValueNode_Add, "add", _("Add") ); ADD_VALUENODE(ValueNode_Subtract, "subtract", _("Subtract") ); - //ADD_VALUENODE(ValueNode_TimedSwap, "timed_swap", _("Timed Swap") ); + ADD_VALUENODE(ValueNode_TimedSwap, "timed_swap", _("Timed Swap") ); ADD_VALUENODE(ValueNode_TwoTone, "twotone", _("Two-Tone") ); ADD_VALUENODE(ValueNode_BLine, "bline", _("BLine") ); ADD_VALUENODE2(ValueNode_DynamicList, "dynamic_list", _("Dynamic List") ); ADD_VALUENODE(ValueNode_GradientRotate, "gradient_rotate", _("Gradient Rotate") ); ADD_VALUENODE(ValueNode_Sine, "sine", _("Sine") ); + ADD_VALUENODE(ValueNode_Cos, "cos", _("Cos") ); + ADD_VALUENODE(ValueNode_Atan2, "atan2", _("aTan2") ); + ADD_VALUENODE(ValueNode_Exp, "exp", _("Exponential") ); + ADD_VALUENODE(ValueNode_Switch, "switch", _("Switch") ); + ADD_VALUENODE(ValueNode_TimeLoop, "timeloop", _("Time Loop") ); + ADD_VALUENODE(ValueNode_Reciprocal, "reciprocal", _("Reciprocal") ); + ADD_VALUENODE(ValueNode_Duplicate, "duplicate", _("Duplicate") ); + ADD_VALUENODE(ValueNode_Integer, "fromint", _("From Integer") ); #undef ADD_VALUENODE #undef ADD_VALUENODE2 @@ -233,9 +262,12 @@ ValueNode::~ValueNode() void ValueNode::on_changed() { - if(get_parent_canvas()) - get_parent_canvas()->signal_value_node_changed()(this); - else if(get_root_canvas() && get_parent_canvas()) + etl::loose_handle parent_canvas = get_parent_canvas(); + if(parent_canvas) + do // signal to all the ancestor canvases + parent_canvas->signal_value_node_changed()(this); + while (parent_canvas = parent_canvas->parent()); + else if(get_root_canvas()) get_root_canvas()->signal_value_node_changed()(this); Node::on_changed(); @@ -430,7 +462,7 @@ PlaceholderValueNode::create(ValueBase::Type type) } ValueBase -PlaceholderValueNode::operator()(Time t)const +PlaceholderValueNode::operator()(Time /*t*/)const { assert(0); return ValueBase(); @@ -444,7 +476,12 @@ PlaceholderValueNode::PlaceholderValueNode(ValueBase::Type type): ValueNode* LinkableValueNode::clone(const GUID& deriv_guid)const { - { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; } + // printf("%s:%d clone()\n", __FILE__, __LINE__); + { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x) + { + printf("VALUENODE FOUND VALUENODE\n"); + return x; + }} int i; LinkableValueNode *ret=create_new();