re-parents the selected brushes/patches
| 170 | |
| 171 | // re-parents the selected brushes/patches |
| 172 | void parentSelection(const cmd::ArgumentList& args) |
| 173 | { |
| 174 | // Retrieve the selection information structure |
| 175 | if (!curSelectionIsSuitableForReparent()) |
| 176 | { |
| 177 | throw cmd::ExecutionNotPossible(_("Cannot reparent primitives to entity. " |
| 178 | "Please select at least one brush/patch and exactly one func_* entity. " |
| 179 | "(The entity has to be selected last.)")); |
| 180 | } |
| 181 | |
| 182 | UndoableCommand undo("parentSelectedPrimitives"); |
| 183 | |
| 184 | // Take the last selected item (this is an entity) |
| 185 | ParentPrimitivesToEntityWalker visitor( |
| 186 | GlobalSelectionSystem().ultimateSelected() |
| 187 | ); |
| 188 | |
| 189 | GlobalSelectionSystem().foreachSelected(visitor); |
| 190 | visitor.reparent(); |
| 191 | } |
| 192 | |
| 193 | void parentSelectionToWorldspawn(const cmd::ArgumentList& args) { |
| 194 | UndoableCommand undo("parentSelectedPrimitives"); |
nothing calls this directly
no test coverage detected