diff --git a/src/meshlab/glarea.cpp b/src/meshlab/glarea.cpp index 8ed553fc6..df649f249 100644 --- a/src/meshlab/glarea.cpp +++ b/src/meshlab/glarea.cpp @@ -90,8 +90,8 @@ GLArea::GLArea(MultiViewer_Container *mvcont, RichParameterSet *current) connect(this->md(), SIGNAL(rasterSetChanged()), this, SLOT(updateRasterSetVisibilities())); connect(this->md(),SIGNAL(documentUpdated()),this,SLOT(completeUpdateRequested())); connect(this, SIGNAL(updateLayerTable()), this->mw(), SIGNAL(updateLayerTable())); - connect(md(),SIGNAL(meshAdded(int)),this,SLOT(addNewEntryInRenderModeMap(int))); - connect(md(),SIGNAL(meshRemoved(int)),this,SLOT(removeEntryFromRenderModeMap(int))); + connect(md(),SIGNAL(meshAdded(int)),this,SLOT(meshAdded(int))); + connect(md(),SIGNAL(meshRemoved(int)),this,SLOT(meshRemoved(int))); foreach(MeshModel* mesh,md()->meshList) rendermodemap[mesh->id()] = RenderMode(); @@ -1214,7 +1214,8 @@ void GLArea::initTexture(bool reloadAllTexture) for(unsigned int i =0; i< mp->cm.textures.size();++i) { QImage img, imgScaled, imgGL; - bool res = img.load(mp->cm.textures[i].c_str()); + QFileInfo fi(mp->cm.textures[i].c_str()); + bool res = img.load(fi.absoluteFilePath()); sometextfailed = sometextfailed || !res; if(!res) { @@ -2082,12 +2083,14 @@ void GLArea::completeUpdateRequested() // return NULL; //} -void GLArea::addNewEntryInRenderModeMap( int index ) +void GLArea::meshAdded( int index ) { rendermodemap[index] = RenderMode(); + emit updateLayerTable(); } -void GLArea::removeEntryFromRenderModeMap( int index ) +void GLArea::meshRemoved( int index ) { - rendermodemap.remove(index); + rendermodemap.remove(index); + emit updateLayerTable(); } diff --git a/src/meshlab/glarea.h b/src/meshlab/glarea.h index d5e44610b..65e532c88 100644 --- a/src/meshlab/glarea.h +++ b/src/meshlab/glarea.h @@ -337,8 +337,8 @@ public slots: void updateRasterSetVisibilities(); private slots: - void addNewEntryInRenderModeMap(int index); - void removeEntryFromRenderModeMap(int index); + void meshAdded(int index); + void meshRemoved(int index); private: float cfps; diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index 6a67f1677..50f57f84e 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -2379,7 +2379,10 @@ bool MainWindow::importMesh(QString fileName) showLayerDlg(true); } else + { + meshDoc()->delMesh(mm); GLA()->Logf(0,"Warning: Mesh %s has not been opened",qPrintable(fileName)); + } }// end foreach file of the input list GLA()->Logf(0,"All files opened in %i msec",allFileTime.elapsed()); @@ -2444,6 +2447,7 @@ void MainWindow::reloadAllMesh() loadMeshWithStandardParams(fileName,mmm); } qb->reset(); + update(); } void MainWindow::reload() @@ -2454,6 +2458,7 @@ void MainWindow::reload() QString fileName = meshDoc()->mm()->fullName(); loadMeshWithStandardParams(fileName,meshDoc()->mm()); qb->reset(); + update(); } bool MainWindow::exportMesh(QString fileName,MeshModel* mod,const bool saveAllPossibleAttributes)