projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use LinkableValueNode members functions when possible in the derived valuenodes.
[synfig.git]
/
synfig-core
/
src
/
synfig
/
valuenode_dotproduct.cpp
diff --git
a/synfig-core/src/synfig/valuenode_dotproduct.cpp
b/synfig-core/src/synfig/valuenode_dotproduct.cpp
index
4748cc2
..
cc81dbd
100644
(file)
--- a/
synfig-core/src/synfig/valuenode_dotproduct.cpp
+++ b/
synfig-core/src/synfig/valuenode_dotproduct.cpp
@@
-53,6
+53,8
@@
using namespace synfig;
ValueNode_DotProduct::ValueNode_DotProduct(const ValueBase &value):
LinkableValueNode(value.get_type())
{
ValueNode_DotProduct::ValueNode_DotProduct(const ValueBase &value):
LinkableValueNode(value.get_type())
{
+ Vocab ret(get_children_vocab());
+ set_children_vocab(ret);
switch(value.get_type())
{
case ValueBase::TYPE_REAL:
switch(value.get_type())
{
case ValueBase::TYPE_REAL:
@@
-147,51
+149,31
@@
ValueNode_DotProduct::get_link_vfunc(int i)const
return 0;
}
return 0;
}
-int
-ValueNode_DotProduct::link_count()const
-{
- return 2;
-}
-
-String
-ValueNode_DotProduct::link_name(int i)const
+bool
+ValueNode_DotProduct::check_type(ValueBase::Type type)
{
{
- assert(i>=0 && i<link_count());
-
- switch(i)
- {
- case 0: return "lhs";
- case 1: return "rhs";
- }
- return String();
+ return
+ type==ValueBase::TYPE_ANGLE ||
+ type==ValueBase::TYPE_REAL;
}
}
-String
-ValueNode_DotProduct::
link_local_name(int i
)const
+LinkableValueNode::Vocab
+ValueNode_DotProduct::
get_children_vocab_vfunc(
)const
{
{
- assert(i>=0 && i<link_count());
+ if(children_vocab.size())
+ return children_vocab;
- switch(i)
- {
- case 0: return _("LHS");
- case 1: return _("RHS");
- }
- return String();
-}
+ LinkableValueNode::Vocab ret;
-int
-ValueNode_DotProduct::get_link_index_from_name(const String &name)const
-{
- if (name=="lhs") return 0;
- if (name=="rhs") return 1;
+ ret.push_back(ParamDesc(ValueBase(),"lhs")
+ .set_local_name(_("LHS"))
+ .set_description(_("The left side of the dot product"))
+ );
- throw Exception::BadLinkName(name);
-}
+ ret.push_back(ParamDesc(ValueBase(),"rhs")
+ .set_local_name(_("RHS"))
+ .set_description(_("The right side of the dot product"))
+ );
-bool
-ValueNode_DotProduct::check_type(ValueBase::Type type)
-{
- return
- type==ValueBase::TYPE_ANGLE ||
- type==ValueBase::TYPE_REAL;
+ return ret;
}
}