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

Function thickenPatches

radiantcore/selection/algorithm/Patch.cpp:185–211  ·  view source on GitHub ↗

* 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). */

Source from the content-addressed store, hash-verified

183 * and they are thickened as well, and again and again).
184 */
185void 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

Callers

nothing calls this directly

Calls 8

rWarningFunction · 0.85
getSelectedPatchesFunction · 0.85
thickenFunction · 0.85
getIntMethod · 0.80
_Function · 0.50
sizeMethod · 0.45
getDoubleMethod · 0.45

Tested by

no test coverage detected