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

Function alignTexture

radiantcore/selection/algorithm/Shader.cpp:683–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

681}
682
683void alignTexture(EAlignType align)
684{
685 std::string command("alignTexture: ");
686 command += "edge=";
687
688 IFace::AlignEdge faceAlignEdge = IFace::AlignEdge::Top;
689 IPatch::AlignEdge patchAlignEdge = IPatch::AlignEdge::Top;
690
691 switch (align)
692 {
693 case ALIGN_TOP:
694 command += "top";
695 patchAlignEdge = IPatch::AlignEdge::Top;
696 faceAlignEdge = IFace::AlignEdge::Top;
697 break;
698 case ALIGN_BOTTOM:
699 command += "bottom";
700 patchAlignEdge = IPatch::AlignEdge::Bottom;
701 faceAlignEdge = IFace::AlignEdge::Bottom;
702 break;
703 case ALIGN_LEFT:
704 command += "left";
705 patchAlignEdge = IPatch::AlignEdge::Left;
706 faceAlignEdge = IFace::AlignEdge::Left;
707 break;
708 case ALIGN_RIGHT:
709 command += "right";
710 patchAlignEdge = IPatch::AlignEdge::Right;
711 faceAlignEdge = IFace::AlignEdge::Right;
712 break;
713 };
714
715 UndoableCommand undo(command);
716
717 GlobalSelectionSystem().foreachFace([&] (IFace& face) { face.alignTexture(faceAlignEdge); });
718 GlobalSelectionSystem().foreachPatch([&] (IPatch& patch) { patch.alignTexture(patchAlignEdge); });
719
720 SceneChangeNotify();
721 // Update the Texture Tools
722 radiant::TextureChangedMessage::Send();
723}
724
725void alignTextureCmd(const cmd::ArgumentList& args)
726{

Callers 1

alignTextureCmdFunction · 0.85

Calls 4

SceneChangeNotifyFunction · 0.85
foreachFaceMethod · 0.80
foreachPatchMethod · 0.80
alignTextureMethod · 0.45

Tested by

no test coverage detected