MCPcopy Create free account
hub / github.com/cdcseacave/openMVS / ShowSelectionControls

Method ShowSelectionControls

apps/Viewer/UI.cpp:619–768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

617}
618
619void UI::ShowSelectionControls(Window& window) {
620 // Auto-open selection controls when in selection mode
621 if (window.GetControlMode() != Window::CONTROL_SELECTION)
622 showSelectionControls = false;
623 if (!showSelectionControls)
624 return;
625
626 ImGui::SetNextWindowPos(ImVec2(990, 210), ImGuiCond_FirstUseEver);
627 ImGui::SetNextWindowSize(ImVec2(280, 320), ImGuiCond_FirstUseEver);
628 if (ImGui::Begin("Selection Controls", &showSelectionControls)) {
629 // Only show controls if we have a selection controller
630 if (window.GetControlMode() != Window::CONTROL_SELECTION) {
631 ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.f), "Selection mode not active");
632 ImGui::Text("Switch to Selection mode in Camera Controls");
633 ImGui::Text("or press G to enable selection.");
634 ImGui::End();
635 return;
636 }
637
638 SelectionController& selectionController = window.GetSelectionController();
639
640 // Selection tool selection
641 ImGui::Text("Selection Tools");
642 ImGui::Separator();
643 const char* selectionModes[] = { "Box", "Lasso", "Circle" };
644 int selMode = (int)selectionController.getSelectionMode();
645 if (ImGui::Combo("Tool", &selMode, selectionModes, IM_ARRAYSIZE(selectionModes)))
646 selectionController.setSelectionMode((SelectionController::SelectionMode)selMode);
647
648 // Quick tool shortcuts
649 ImGui::Text("Shortcuts: B = Box, L = Lasso, C = Circle");
650
651 // Selection statistics
652 ImGui::Separator();
653 ImGui::Text("Selection Statistics");
654 if (selectionController.hasSelection()) {
655 ImGui::Text("Selected: %zu points, %zu faces",
656 selectionController.getSelectedPointCount(),
657 selectionController.getSelectedFaceCount());
658 } else {
659 ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.f), "No selection");
660 }
661
662 // Selection operations
663 ImGui::Separator();
664 ImGui::Text("Selection Operations");
665 if (ImGui::Button("Clear Selection", ImVec2(-1, 0)))
666 selectionController.clearSelection();
667
668 if (selectionController.hasSelection()) {
669 if (ImGui::Button("Invert Selection", ImVec2(-1, 0)))
670 selectionController.invertSelection();
671
672 // Geometry operations
673 ImGui::Separator();
674 ImGui::Text("Geometry Operations");
675 if (ImGui::Button("Remove Selected", ImVec2(-1, 0)))
676 ImGui::OpenPopup("Confirm Remove Selected");

Callers 1

RenderMethod · 0.80

Calls 15

getFileExtFunction · 0.85
GetControlModeMethod · 0.80
getSelectionModeMethod · 0.80
setSelectionModeMethod · 0.80
hasSelectionMethod · 0.80
getSelectedPointCountMethod · 0.80
getSelectedFaceCountMethod · 0.80
clearSelectionMethod · 0.80
invertSelectionMethod · 0.80
runROICallbackMethod · 0.80

Tested by

no test coverage detected