MCPcopy Create free account
hub / github.com/colmap/colmap / SetModel

Method SetModel

src/colmap/ui/database_management_widget.cc:426–463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424}
425
426void CameraTab::SetModel() {
427 QItemSelectionModel* select = table_widget_->selectionModel();
428
429 if (!select->hasSelection()) {
430 QMessageBox::critical(this, "", tr("No camera selected."));
431 return;
432 }
433
434 QStringList camera_models;
435#define CAMERA_MODEL_CASE(CameraModel) \
436 << QString::fromStdString(CameraModelIdToName(CameraModel::model_id))
437 camera_models CAMERA_MODEL_CASES;
438#undef CAMERA_MODEL_CASE
439
440 bool ok;
441 const QString camera_model = QInputDialog::getItem(
442 this, "", tr("Model:"), camera_models, 0, false, &ok);
443 if (!ok) {
444 return;
445 }
446
447 // Make sure, itemChanged is not invoked, while updating up the table
448 table_widget_->blockSignals(true);
449
450 for (QModelIndex& index : select->selectedRows()) {
451 auto& camera = cameras_.at(index.row());
452 camera = Camera::CreateFromModelName(camera.camera_id,
453 camera_model.toUtf8().constData(),
454 camera.MeanFocalLength(),
455 camera.width,
456 camera.height);
457 database_->UpdateCamera(camera);
458 }
459
460 table_widget_->blockSignals(false);
461
462 Reload(database_);
463}
464
465ImageTab::ImageTab(QWidget* parent,
466 CameraTab* camera_tab,

Callers

nothing calls this directly

Calls 2

MeanFocalLengthMethod · 0.80
UpdateCameraMethod · 0.45

Tested by

no test coverage detected