Browse files

Fixed bug where file name didn't appear in the persistence diagram wh…

…en the file was a precomputed one. Also added the file name to the window title for all file types.
  • Loading branch information...
xoltar committed May 4, 2017
1 parent 4d353b2 commit 5605a656da143698fa4e6643372738f761885bdd
Showing with 12 additions and 1 deletion.
  1. +6 −0 computationthread.cpp
  2. +2 −0 dataselectdialog.cpp
  3. +4 −1 visualizationwindow.cpp
@@ -95,10 +95,16 @@ void ComputationThread::load_from_file()
arrangement.reset(new ArrangementMessage());
message.reset(new TemplatePointsMessage());
std::string oldFileName = params.fileName;
std::string oldShortName = params.shortName;
archive >> params;
//We're not interested in the output file from the original invocation, and if it is non-empty,
//the viewer will try to save the output also, which will most likely fail.
params.outputFile = "";
//Copy the input names from the original params, since we care what the user selected, not what previous input
//files were called
params.fileName = oldFileName;
params.shortName = oldShortName;
archive >> *message;
emit templatePointsReady(message);
archive >> *arrangement;
@@ -119,6 +119,8 @@ void DataSelectDialog::detect_file_type()
ui->fileTypeLabel->setText("This file appears to contain pre-computed RIVET data");
QFileInfo fileInfo(QString::fromStdString(params.fileName));
ui->fileLabel->setText("Selected file: " + fileInfo.fileName());
//TODO: this updating of the params will need to happen in console also, need to refactor
params.shortName = fileInfo.fileName().toUtf8().constData();
} else {
QStringList args;
@@ -169,9 +169,12 @@ void VisualizationWindow::augmented_arrangement_ready(std::shared_ptr<Arrangemen
//TESTING: print arrangement info and verify consistency
// arrangement->print_stats();
// arrangement->test_consistency();
auto shortName = QString::fromStdString(input_params.shortName);
this->setWindowTitle("RIVET - " + shortName);
//inialize persistence diagram
p_diagram.create_diagram(QString::fromStdString(input_params.shortName), input_params.dim);
p_diagram.create_diagram(shortName, input_params.dim);
//get the barcode
BarcodeTemplate dbc = arrangement->get_barcode_template(angle_precise, offset_precise);

0 comments on commit 5605a65

Please sign in to comment.