| 54 | = default; |
| 55 | |
| 56 | void |
| 57 | CutCommand::execute () |
| 58 | { |
| 59 | if (!cloud_ptr_) |
| 60 | return; |
| 61 | if (selection_ptr_->empty()) |
| 62 | return; |
| 63 | |
| 64 | // do the copy |
| 65 | copy_buffer_ptr_ -> set(cloud_ptr_, *selection_ptr_); |
| 66 | |
| 67 | // back up copied points for undo |
| 68 | cut_cloud_buffer_ = *copy_buffer_ptr_; |
| 69 | cut_selection_ = *selection_ptr_; |
| 70 | |
| 71 | // remove the copied points from the cloud. |
| 72 | cloud_ptr_ -> remove(cut_selection_); |
| 73 | |
| 74 | // The selection points to the incorrect points or may have indices out of |
| 75 | // bounds, so we must clear it. |
| 76 | selection_ptr_ -> clear(); |
| 77 | |
| 78 | // notify the cloud that the selection has changed |
| 79 | cloud_ptr_ -> setSelection(selection_ptr_); |
| 80 | } |
| 81 | |
| 82 | void |
| 83 | CutCommand::undo() |