/*! \file activepointremove.cpp
** \brief Template File
**
-** $Id: activepointremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+** $Id$
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
ACTION_SET_CATEGORY(Action::ActivepointRemove,Action::CATEGORY_ACTIVEPOINT);
ACTION_SET_PRIORITY(Action::ActivepointRemove,0);
ACTION_SET_VERSION(Action::ActivepointRemove,"0.0");
-ACTION_SET_CVS_ID(Action::ActivepointRemove,"$Id: activepointremove.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $");
+ACTION_SET_CVS_ID(Action::ActivepointRemove,"$Id$");
/* === G L O B A L S ======================================================= */
Action::ActivepointRemove::get_param_vocab()
{
ParamVocab ret(Action::CanvasSpecific::get_param_vocab());
-
+
ret.push_back(ParamDesc("value_desc",Param::TYPE_VALUEDESC)
.set_local_name(_("ValueDesc"))
);
if(name=="value_desc" && param.get_type()==Param::TYPE_VALUEDESC)
{
ValueDesc value_desc(param.get_value_desc());
-
+
if(!value_desc.parent_is_value_node())
return false;
-
+
value_node=ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node());
-
+
if(!value_node)
return false;
-
+
index=value_desc.get_index();
-
+
return true;
}
if(name=="activepoint" && param.get_type()==Param::TYPE_ACTIVEPOINT)
{
activepoint=param.get_activepoint();
-
+
return true;
}
void
Action::ActivepointRemove::perform()
-{
+{
ValueNode_DynamicList::ListEntry::ActivepointList::iterator iter;
-
+
try { iter=value_node->list[index].find(activepoint); }
catch(synfig::Exception::NotFound)
{
throw Error(_("Unable to find activepoint"));
- }
+ }
value_node->list[index].erase(activepoint);
value_node->changed();
-
+
/*
// Signal that a layer has been inserted
if(get_canvas_interface())
Action::ActivepointRemove::undo()
{
try { value_node->list[index].find(activepoint.get_time()); throw Error(_("A Activepoint already exists at this point in time"));}
- catch(synfig::Exception::NotFound) { }
+ catch(synfig::Exception::NotFound) { }
try { if(value_node->list[index].find(activepoint)!=value_node->list[index].timing_info.end()) throw Error(_("This activepoint is already in the ValueNode"));}
- catch(synfig::Exception::NotFound) { }
-
+ catch(synfig::Exception::NotFound) { }
+
value_node->list[index].add(activepoint);
value_node->changed();
/*