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

Method GenerateTableButtonWidget

src/colmap/ui/dense_reconstruction_widget.cc:634–703  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632}
633
634QWidget* DenseReconstructionWidget::GenerateTableButtonWidget(
635 const std::string& image_name, const std::string& type) {
636 THROW_CHECK(type == "photometric" || type == "geometric");
637 const bool photometric = type == "photometric";
638
639 if (photometric) {
640 photometric_done_ = true;
641 } else {
642 geometric_done_ = true;
643 }
644
645 const auto depth_map_path =
646 depth_maps_path_ /
647 StringPrintf("%s.%s.bin", image_name.c_str(), type.c_str());
648 const auto normal_map_path =
649 normal_maps_path_ /
650 StringPrintf("%s.%s.bin", image_name.c_str(), type.c_str());
651
652 QWidget* button_widget = new QWidget();
653 QGridLayout* button_layout = new QGridLayout(button_widget);
654 button_layout->setContentsMargins(0, 0, 0, 0);
655
656 QPushButton* depth_map_button = new QPushButton("Depth map", button_widget);
657 if (ExistsFile(depth_map_path)) {
658 connect(depth_map_button,
659 &QPushButton::released,
660 [this, image_name, depth_map_path]() {
661#if defined(COLMAP_MVS_ENABLED)
662 mvs::DepthMap depth_map;
663 depth_map.Read(depth_map_path);
664 image_viewer_widget_->setWindowTitle(
665 QString("Depth map for %1").arg(image_name.c_str()));
666 image_viewer_widget_->ShowBitmap(depth_map.ToBitmap(2, 98));
667#endif
668 });
669 } else {
670 depth_map_button->setEnabled(false);
671 if (photometric) {
672 photometric_done_ = false;
673 } else {
674 geometric_done_ = false;
675 }
676 }
677 button_layout->addWidget(depth_map_button, 0, 1, Qt::AlignLeft);
678
679 QPushButton* normal_map_button = new QPushButton("Normal map", button_widget);
680 if (ExistsFile(normal_map_path)) {
681 connect(normal_map_button,
682 &QPushButton::released,
683 [this, image_name, normal_map_path]() {
684#if defined(COLMAP_MVS_ENABLED)
685 mvs::NormalMap normal_map;
686 normal_map.Read(normal_map_path);
687 image_viewer_widget_->setWindowTitle(
688 QString("Normal map for %1").arg(image_name.c_str()));
689 image_viewer_widget_->ShowBitmap(normal_map.ToBitmap());
690#endif
691 });

Callers

nothing calls this directly

Calls 5

StringPrintfFunction · 0.85
ExistsFileFunction · 0.85
ShowBitmapMethod · 0.80
ReadMethod · 0.45
ToBitmapMethod · 0.45

Tested by

no test coverage detected