* greebo: Note: I chose to populate a list first, because otherwise the visitor * class would get stuck in a loop (as the newly created patches get selected, * and they are thickened as well, and again and again). */
| 183 | * and they are thickened as well, and again and again). |
| 184 | */ |
| 185 | void thickenPatches(const cmd::ArgumentList& args) |
| 186 | { |
| 187 | if (GlobalSelectionSystem().getSelectionInfo().patchCount == 0) |
| 188 | { |
| 189 | throw cmd::ExecutionNotPossible(_("Cannot thicken patch. Nothing selected.")); |
| 190 | } |
| 191 | |
| 192 | // Check arguments |
| 193 | if (args.size() != 3) |
| 194 | { |
| 195 | rWarning() << "Usage: ThickenSelectedPatches <thickness> <create_seams:1|0> <axis:0|1|2>" << std::endl; |
| 196 | return; |
| 197 | } |
| 198 | |
| 199 | float thickness = static_cast<float>(args[0].getDouble()); |
| 200 | bool createSeams = args[1].getInt() != 0; |
| 201 | int axis = args[2].getInt(); |
| 202 | |
| 203 | UndoableCommand undo("patchThicken"); |
| 204 | |
| 205 | auto patches = getSelectedPatches(); |
| 206 | |
| 207 | for (const PatchNodePtr& patch : patches) |
| 208 | { |
| 209 | patch::algorithm::thicken(patch, thickness, createSeams, axis); |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | } // namespace |
| 214 |
nothing calls this directly
no test coverage detected