MCPcopy Create free account
hub / github.com/city-super/Octree-GS / onGUI

Method onGUI

SIBR_viewers/src/core/view/InteractiveCameraHandler.cpp:521–726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519 }
520
521 void InteractiveCameraHandler::onGUI(const std::string& suffix) {
522
523 const std::string fullName = (suffix);
524
525
526 // Saving camera.
527 if (ImGui::Begin(fullName.c_str())) {
528
529 ImGui::PushScaledItemWidth(130);
530 ImGui::Combo("Mode", (int*)&_currentMode, "FPS\0Orbit\0Interp.\0Trackball\0None\0\0");
531 switchMode(_currentMode);
532 ImGui::SameLine();
533 if (ImGui::Button("Load camera")) {
534 std::string selectedFile;
535 if (sibr::showFilePicker(selectedFile, Default)) {
536 if (!selectedFile.empty()) {
537 sibr::InputCamera savedCam;
538 savedCam.loadFromBinary(selectedFile);
539 SIBR_LOG << "Loaded saved camera (" << selectedFile << ")." << std::endl;
540 fromCamera(savedCam, false);
541 }
542 }
543 }
544
545 ImGui::SameLine();
546 if (ImGui::Button("Save camera (bin)")) {
547 std::string selectedFile;
548 if (sibr::showFilePicker(selectedFile, Save)) {
549 if (!selectedFile.empty()) {
550 if (selectedFile[selectedFile.size() - 1] == '/' || selectedFile[selectedFile.size() - 1] == '\\') {
551 selectedFile.append("default_camera.bin");
552 }
553 _currentCamera.saveToBinary(selectedFile);
554 SIBR_LOG << "Saved camera (" << selectedFile << ")." << std::endl;
555 }
556 }
557 }
558
559
560 ImGui::Separator();
561 if (ImGui::Button("Snap to closest")) {
562 _currentCamId = findNearestCamera(_interpPath);
563 snapToCamera(_currentCamId);
564 }
565 ImGui::SameLine();
566 if (ImGui::InputInt("Snap to", &_currentCamId, 1, 10)) {
567 _currentCamId = sibr::clamp(_currentCamId, 0, int(_interpPath.size()) - 1);
568 snapToCamera(_currentCamId);
569 }
570
571 if (_currentMode == TRACKBALL) {
572 ImGui::SameLine();
573 ImGui::Checkbox("Show trackball", &_trackball.drawThis);
574 }
575
576 if (ImGui::InputFloat("Fov Y", &_cameraFovDeg, 1.0f, 5.0f)) {
577 _cameraFovDeg = sibr::clamp(_cameraFovDeg, 1.0f, 180.0f);
578 _currentCamera.fovy(_cameraFovDeg * float(M_PI) / 180.0f);

Callers

nothing calls this directly

Calls 15

PushScaledItemWidthFunction · 0.85
showFilePickerFunction · 0.85
loadFromBinaryMethod · 0.80
saveToBinaryMethod · 0.80
fovyMethod · 0.80
znearMethod · 0.80
zfarMethod · 0.80
pop_backMethod · 0.80
playbackMethod · 0.80
recordMethod · 0.80
stopMethod · 0.80
saveAsColmapMethod · 0.80

Tested by

no test coverage detected