Fixed a bug where camera facing polygons were not textured

This commit is contained in:
matlabbe
2017-03-03 15:22:20 -05:00
parent fd55828c42
commit 3cf8ea63d8
5 changed files with 19 additions and 17 deletions

View File

@@ -63,7 +63,7 @@ protected:
public slots:
void appendText(const QString & text ,const QColor & color = Qt::black);
void incrementStep();
void incrementStep(int steps = 1);
void clear();
void resetProgress();

View File

@@ -889,7 +889,6 @@ bool ExportCloudsDialog::getExportedClouds(
{
mul+=1;
}
mul+=1; // normals
if(_ui->checkBox_textureMapping->isChecked())
{
mul+=1;
@@ -1720,7 +1719,7 @@ bool ExportCloudsDialog::getExportedClouds(
meshes.insert(std::make_pair(iter->first, mesh));
_progressDialog->incrementStep();
_progressDialog->incrementStep(_ui->checkBox_assemble->isChecked()?poses.size():1);
QApplication::processEvents();
if(_canceled)
{
@@ -1877,6 +1876,7 @@ bool ExportCloudsDialog::getExportedClouds(
}
TexturingState texturingState(_progressDialog);
_progressDialog->setMaximumSteps(_progressDialog->maximumSteps()+iter->second->polygons.size()/10000+1);
textureMesh = util3d::createTextureMesh(
iter->second,
cameraPoses,

View File

@@ -133,14 +133,14 @@ void ProgressDialog::setMaximumSteps(int steps)
_progressBar->setMaximum(steps);
}
void ProgressDialog::incrementStep()
void ProgressDialog::incrementStep(int steps)
{
//incremental progress bar (if we don't know how many items will be added)
if(_progressBar->value() == _progressBar->maximum()-1)
if(_progressBar->value() >= _progressBar->maximum()-steps)
{
_progressBar->setMaximum(_progressBar->maximum()+1);
_progressBar->setMaximum(_progressBar->maximum()+steps+1);
}
_progressBar->setValue(_progressBar->value()+1);
_progressBar->setValue(_progressBar->value()+steps);
}
void ProgressDialog::clear()

View File

@@ -50,6 +50,7 @@ public:
if(!msg.empty())
{
dialog_->appendText(msg.c_str());
dialog_->incrementStep();
}
QApplication::processEvents();
return !canceled_;