| 116 | } |
| 117 | |
| 118 | void |
| 119 | MoveControlPointsUndoCommand::undo() |
| 120 | { |
| 121 | SelectedCpList::iterator cpIt = _originalPoints.begin(); |
| 122 | std::set<Bezier*> beziers; |
| 123 | |
| 124 | for (SelectedCpList::iterator it = _pointsToDrag.begin(); it != _pointsToDrag.end(); ++it) { |
| 125 | beziers.insert( it->first->getBezier().get() ); |
| 126 | } |
| 127 | |
| 128 | for (SelectedCpList::iterator it = _pointsToDrag.begin(); it != _pointsToDrag.end(); ++it, ++cpIt) { |
| 129 | it->first->clone(*cpIt->first); |
| 130 | if (it->second) { |
| 131 | it->second->clone(*cpIt->second); |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | for (std::set<Bezier*>::iterator it = beziers.begin(); it != beziers.end(); ++it) { |
| 136 | (*it)->incrementNodesAge(); |
| 137 | } |
| 138 | |
| 139 | RotoPaintInteractPtr roto = _roto.lock(); |
| 140 | roto->evaluate(true); |
| 141 | roto->setCurrentTool( _selectedTool.lock() ); |
| 142 | roto->setSelection(_selectedCurves, _selectedPoints); |
| 143 | } |
| 144 | |
| 145 | void |
| 146 | MoveControlPointsUndoCommand::redo() |
nothing calls this directly
no test coverage detected