Revert the state of this patch to the one that has been saved in the UndoMemento
| 388 | |
| 389 | // Revert the state of this patch to the one that has been saved in the UndoMemento |
| 390 | void Patch::importState(const IUndoMementoPtr& state) |
| 391 | { |
| 392 | undoSave(); |
| 393 | |
| 394 | const SavedState& other = *(std::static_pointer_cast<SavedState>(state)); |
| 395 | |
| 396 | // begin duplicate of SavedState copy constructor, needs refactoring |
| 397 | |
| 398 | // copy construct |
| 399 | { |
| 400 | _width = other.m_width; |
| 401 | _height = other.m_height; |
| 402 | _ctrl = other.m_ctrl; |
| 403 | _ctrlTransformed = _ctrl; |
| 404 | _node.updateSelectableControls(); |
| 405 | _patchDef3 = other.m_patchDef3; |
| 406 | _subDivisions = Subdivisions(other.m_subdivisions_x, other.m_subdivisions_y); |
| 407 | _shader.setMaterialName(other._materialName); |
| 408 | } |
| 409 | |
| 410 | // end duplicate code |
| 411 | |
| 412 | // Notify that this patch has changed |
| 413 | textureChanged(); |
| 414 | controlPointsChanged(); |
| 415 | } |
| 416 | |
| 417 | void Patch::check_shader() |
| 418 | { |
nothing calls this directly
no test coverage detected