diff --git a/src/meshlab/dialogs/save_snapshot_dialog.cpp b/src/meshlab/dialogs/save_snapshot_dialog.cpp index 4968136c9..58fdab572 100644 --- a/src/meshlab/dialogs/save_snapshot_dialog.cpp +++ b/src/meshlab/dialogs/save_snapshot_dialog.cpp @@ -44,6 +44,7 @@ void SaveSnapshotDialog::setValues(const SnapshotSetting& ss) ui->counterSpinBox->setValue(settings.counter); ui->backgroundComboBox->setCurrentIndex(settings.background); ui->alllayersCheckBox->setChecked(settings.snapAllLayers); + ui->useLayerNameCheckBox->setChecked(settings.useLayerName); ui->tiledSaveCheckBox->setChecked(settings.tiledSave); ui->addToRastersCheckBox->setChecked(settings.addToRasters); } @@ -56,6 +57,7 @@ SnapshotSetting SaveSnapshotDialog::getValues() settings.resolution=ui->resolutionSpinBox->value(); settings.background = ui->backgroundComboBox->currentIndex(); settings.snapAllLayers=ui->alllayersCheckBox->isChecked(); + settings.useLayerName=ui->useLayerNameCheckBox->isChecked(); settings.tiledSave=ui->tiledSaveCheckBox->isChecked(); settings.addToRasters=ui->addToRastersCheckBox->isChecked(); return settings; @@ -80,3 +82,23 @@ void SaveSnapshotDialog::on_browseDir_clicked() ui->outDirLineEdit->setText(selection.at(0)); } } + +void SaveSnapshotDialog::on_alllayersCheckBox_stateChanged(int arg1) +{ + if (arg1 == Qt::Checked) + ui->useLayerNameCheckBox->setEnabled(true); + else { + ui->useLayerNameCheckBox->setEnabled(false); + ui->useLayerNameCheckBox->setChecked(false); + } +} + + +void SaveSnapshotDialog::on_useLayerNameCheckBox_stateChanged(int arg1) +{ + if (arg1 == Qt::Checked) + ui->baseNameLineEdit->setEnabled(false); + else + ui->baseNameLineEdit->setEnabled(true); +} + diff --git a/src/meshlab/dialogs/save_snapshot_dialog.h b/src/meshlab/dialogs/save_snapshot_dialog.h index 70cb374f1..684cfac46 100644 --- a/src/meshlab/dialogs/save_snapshot_dialog.h +++ b/src/meshlab/dialogs/save_snapshot_dialog.h @@ -45,6 +45,10 @@ Q_OBJECT private slots: void on_browseDir_clicked(); + void on_alllayersCheckBox_stateChanged(int arg1); + + void on_useLayerNameCheckBox_stateChanged(int arg1); + private: Ui::SaveSnapShotDialog* ui; SnapshotSetting settings; diff --git a/src/meshlab/dialogs/save_snapshot_dialog.ui b/src/meshlab/dialogs/save_snapshot_dialog.ui index 8db45652f..7195d68cf 100644 --- a/src/meshlab/dialogs/save_snapshot_dialog.ui +++ b/src/meshlab/dialogs/save_snapshot_dialog.ui @@ -120,10 +120,38 @@ - - - Snap All Layers + + + + 10 + 0 + + + QFrame::NoFrame + + + QFrame::Plain + + + + + + Snap All Layers + + + + + + + false + + + Use Layer Name + + + + diff --git a/src/meshlab/glarea.cpp b/src/meshlab/glarea.cpp index 41c8fbdde..d10ce079c 100644 --- a/src/meshlab/glarea.cpp +++ b/src/meshlab/glarea.cpp @@ -219,11 +219,14 @@ void GLArea::pasteTile() if (tileRow >= totalRows) { if (ss.snapAllLayers) { - outfile = QString("%1/%2%3_L%4.png") + QString lname = ss.basename; + if (ss.useLayerName) { + lname = md()->getMesh(snapshotCounter)->label(); + } + outfile = QString("%1/%2%3.png") .arg(ss.outdir) - .arg(ss.basename) - .arg(ss.counter, 2, 10, QChar('0')) - .arg(snapshotCounter, 2, 10, QChar('0')); + .arg(lname) + .arg(ss.counter, 2, 10, QChar('0')); } else { outfile = QString("%1/%2%3.png") diff --git a/src/meshlab/snapshotsetting.h b/src/meshlab/snapshotsetting.h index 9638ba896..a9ad8eb4f 100644 --- a/src/meshlab/snapshotsetting.h +++ b/src/meshlab/snapshotsetting.h @@ -33,6 +33,7 @@ class SnapshotSetting int resolution; int background; bool snapAllLayers; + bool useLayerName; bool tiledSave; // if true all the tiles are saved as separated files and not joined. bool addToRasters; @@ -44,9 +45,10 @@ class SnapshotSetting resolution=1; background=0; snapAllLayers=false; + useLayerName=false; tiledSave=false; addToRasters=false; }; }; -#endif \ No newline at end of file +#endif