| 60 | } |
| 61 | |
| 62 | void capPatch(const cmd::ArgumentList& args) |
| 63 | { |
| 64 | if (GlobalSelectionSystem().getSelectionInfo().patchCount == 0) |
| 65 | { |
| 66 | throw cmd::ExecutionNotPossible(_("Cannot create caps, no patches selected.")); |
| 67 | } |
| 68 | |
| 69 | if (args.empty()) |
| 70 | { |
| 71 | rWarning() << "Usage: CapSelectedPatches <bevel|invertedbevel|endcap|invertedendcap|cylinder>" << std::endl; |
| 72 | return; |
| 73 | } |
| 74 | |
| 75 | try |
| 76 | { |
| 77 | // Parse the type |
| 78 | auto capType = getPatchCapTypeForString(args[0].getString()); |
| 79 | |
| 80 | UndoableCommand undo("patchCreateCaps"); |
| 81 | |
| 82 | auto patchNodes = getSelectedPatches(); |
| 83 | |
| 84 | for (const auto& patchNode : patchNodes) |
| 85 | { |
| 86 | patch::algorithm::createCaps(patchNode->getPatch(), patchNode->getParent(), |
| 87 | capType, GlobalShaderClipboard().getShaderName()); |
| 88 | } |
| 89 | } |
| 90 | catch (const std::logic_error& ex) |
| 91 | { |
| 92 | rError() << ex.what() << std::endl; |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | void insertPatchColumnsAtEnd() |
| 97 | { |
nothing calls this directly
no test coverage detected