MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / capPatch

Function capPatch

radiantcore/selection/algorithm/Patch.cpp:62–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void 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
96void insertPatchColumnsAtEnd()
97{

Callers

nothing calls this directly

Calls 13

rWarningFunction · 0.85
getPatchCapTypeForStringFunction · 0.85
getSelectedPatchesFunction · 0.85
createCapsFunction · 0.85
rErrorFunction · 0.85
getPatchMethod · 0.80
getShaderNameMethod · 0.80
whatMethod · 0.80
_Function · 0.50
emptyMethod · 0.45
getStringMethod · 0.45

Tested by

no test coverage detected