X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Fsrc%2Fsynfig%2Fvaluenode_composite.cpp;h=da061851b0cccfe72026c0d85d33f3c42e4cc8d4;hb=d4cb326591ea23f82d341eb368b3d183b46f56c7;hp=7e18ea026d6f301f221b77afa1a9a50ef325b456;hpb=a095981e18cc37a8ecc7cd237cc22b9c10329264;p=synfig.git diff --git a/synfig-core/src/synfig/valuenode_composite.cpp b/synfig-core/src/synfig/valuenode_composite.cpp index 7e18ea0..da06185 100644 --- a/synfig-core/src/synfig/valuenode_composite.cpp +++ b/synfig-core/src/synfig/valuenode_composite.cpp @@ -7,6 +7,7 @@ ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** Copyright (c) 2008 Chris Moore +** Copyright (c) 2009 Nikita Kitaev ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -80,12 +81,12 @@ synfig::ValueNode_Composite::ValueNode_Composite(const ValueBase &value): case ValueBase::TYPE_BLINEPOINT: { BLinePoint bline_point(value); - set_link(0,ValueNode_Const::create(bline_point.get_vertex())); - set_link(1,ValueNode_Const::create(bline_point.get_width())); - set_link(2,ValueNode_Const::create(bline_point.get_origin())); - set_link(3,ValueNode_Const::create(bline_point.get_split_tangent_flag())); - set_link(4,ValueNode_RadialComposite::create(bline_point.get_tangent1())); - set_link(5,ValueNode_RadialComposite::create(bline_point.get_tangent2())); + set_link("point",ValueNode_Const::create(bline_point.get_vertex())); + set_link("width",ValueNode_Const::create(bline_point.get_width())); + set_link("origin",ValueNode_Const::create(bline_point.get_origin())); + set_link("split",ValueNode_Const::create(bline_point.get_split_tangent_flag())); + set_link("t1",ValueNode_RadialComposite::create(bline_point.get_tangent1())); + set_link("t2",ValueNode_RadialComposite::create(bline_point.get_tangent2())); break; } default: @@ -443,3 +444,89 @@ ValueNode_Composite::check_type(ValueBase::Type type) type==ValueBase::TYPE_COLOR || type==ValueBase::TYPE_BLINEPOINT; } + +LinkableValueNode::Vocab +ValueNode_Composite::get_children_vocab_vfunc()const +{ + LinkableValueNode::Vocab ret; + + switch(get_type()) + { + case ValueBase::TYPE_COLOR: + ret.push_back(ParamDesc(ValueBase(),"red") + .set_local_name(_("Red")) + .set_description(_("The red component of the color")) + ); + ret.push_back(ParamDesc(ValueBase(),"green") + .set_local_name(_("Green")) + .set_description(_("The green component of the color")) + ); + ret.push_back(ParamDesc(ValueBase(),"blue") + .set_local_name(_("Blue")) + .set_description(_("The blue component of the color")) + ); + ret.push_back(ParamDesc(ValueBase(),"alpha") + .set_local_name(_("Alpha")) + .set_description(_("The alpha of the color")) + ); + return ret; + case ValueBase::TYPE_SEGMENT: + ret.push_back(ParamDesc(ValueBase(),"p1") + .set_local_name(_("Vertex 1")) + .set_description(_("The first vertex of the segment")) + ); + ret.push_back(ParamDesc(ValueBase(),"t1") + .set_local_name(_("Tangent 1")) + .set_description(_("The first tangent of the segment")) + ); + ret.push_back(ParamDesc(ValueBase(),"p2") + .set_local_name(_("Vertex 2")) + .set_description(_("The second vertex of the segment")) + ); + ret.push_back(ParamDesc(ValueBase(),"t2") + .set_local_name(_("Tangent 2")) + .set_description(_("The second tangent of the segment")) + ); + return ret; + case ValueBase::TYPE_VECTOR: + ret.push_back(ParamDesc(ValueBase(),"x") + .set_local_name(_("X-Axis")) + .set_description(_("The X-Axis component of the vector")) + ); + ret.push_back(ParamDesc(ValueBase(),"y") + .set_local_name(_("Y-Axis")) + .set_description(_("The Y-Axis component of the vector")) + ); + return ret; + case ValueBase::TYPE_BLINEPOINT: + ret.push_back(ParamDesc(ValueBase(),"point") + .set_local_name(_("Vertex")) + .set_description(_("The vertex of the BLine Point")) + ); + ret.push_back(ParamDesc(ValueBase(),"width") + .set_local_name(_("Width")) + .set_description(_("The width of the BLine Point")) + ); + ret.push_back(ParamDesc(ValueBase(),"origin") + .set_local_name(_("Origin")) + .set_description(_("Defines the Off and On position relative to neighbours")) + ); + ret.push_back(ParamDesc(ValueBase(),"split") + .set_local_name(_("Split")) + .set_description(_("When checked, tangents are independent")) + ); + ret.push_back(ParamDesc(ValueBase(),"t1") + .set_local_name(_("Tangent 1")) + .set_description(_("The first tangent of the BLine Point")) + ); + ret.push_back(ParamDesc(ValueBase(),"t2") + .set_local_name(_("Tangent 2")) + .set_description(_("The second tangent of the BLine Point")) + ); + return ret; + default: + break; + } + + return ret; +}