diff --git a/src/fgt/edit_hole/edit_hole.cpp b/src/fgt/edit_hole/edit_hole.cpp index c8170558b..4cacd89bc 100644 --- a/src/fgt/edit_hole/edit_hole.cpp +++ b/src/fgt/edit_hole/edit_hole.cpp @@ -80,10 +80,12 @@ void EditHolePlugin::mouseMoveEvent(QMouseEvent * /*e*/, MeshModel &/*m*/, GLAre { } -bool EditHolePlugin::StartEdit(MeshModel &m, GLArea *gla ) +bool EditHolePlugin::StartEdit(MeshDocument &_md, GLArea *gla ) { - m.updateDataMask(MeshModel::MM_FACEFACETOPO); - if ( tri::Clean::CountNonManifoldEdgeFF(m.cm) >0) + this->md = &_md; + + md->mm()->updateDataMask(MeshModel::MM_FACEFACETOPO); + if ( tri::Clean::CountNonManifoldEdgeFF(md->mm()->cm) >0) { QMessageBox::critical(0, tr("Manifoldness Failure"), QString("Hole's managing requires manifoldness.")); return false; // can't continue, mesh can't be processed @@ -96,9 +98,9 @@ bool EditHolePlugin::StartEdit(MeshModel &m, GLArea *gla ) return false; // if plugin restart with another mesh, recomputing of hole is forced - if(mesh != &m) + if(mesh != this->md->mm()) { - this->mesh = &m; + this->mesh = this->md->mm(); this->gla = gla; mesh->clearDataMask(MeshModel::MM_FACEMARK); @@ -130,7 +132,7 @@ bool EditHolePlugin::StartEdit(MeshModel &m, GLArea *gla ) delete holeSorter; delete holesModel; } - holesModel = new HoleListModel(&m); + holesModel = new HoleListModel(mesh); holesModel->holesManager.autoBridgeCB = new EditHoleAutoBridgingCB(dialogFiller->ui.infoLbl, 800); @@ -150,8 +152,7 @@ bool EditHolePlugin::StartEdit(MeshModel &m, GLArea *gla ) } else { - Decorate(m, gla); - //Decorate(m, gla); + Decorate(*mesh, gla); upGlA(); } return true; @@ -190,9 +191,9 @@ void EditHolePlugin::Decorate(MeshModel &m, GLArea * gla) break; case HoleListModel::ManualBridging: oldAbutmentPresence = holesModel->PickedAbutment(); - gla->meshDoc->setBusy(true); + md->setBusy(true); holesModel->addBridgeFace(pickedFace, cur.x(), inverseY); - gla->meshDoc->setBusy(false); + md->setBusy(false); if(holesModel->PickedAbutment() != oldAbutmentPresence) { if(oldAbutmentPresence == true) @@ -265,7 +266,7 @@ void EditHolePlugin::updateDWeight(int val) void EditHolePlugin::fill() { - gla->meshDoc->setBusy(true); + md->setBusy(true); if(holesModel->getState() == HoleListModel::Filled) holesModel->acceptFilling(false); @@ -275,7 +276,7 @@ void EditHolePlugin::fill() holesModel->fill( FgtHole::MinimumWeight); else holesModel->fill( FgtHole::SelfIntersection); - gla->meshDoc->setBusy(false); + md->setBusy(false); upGlA(); } @@ -283,19 +284,19 @@ void EditHolePlugin::acceptFill() { if(holesModel->getState() == HoleListModel::Filled) { - gla->meshDoc->setBusy(true); + md->setBusy(true); holesModel->acceptFilling(true); - gla->meshDoc->setBusy(false); + md->setBusy(false); gla->setWindowModified(true); } } void EditHolePlugin::cancelFill() { - gla->meshDoc->setBusy(true); + md->setBusy(true); if(holesModel->getState() == HoleListModel::Filled) holesModel->acceptFilling(false); - gla->meshDoc->setBusy(false); + md->setBusy(false); } void EditHolePlugin::updateBridgeSldValue(int val) @@ -322,18 +323,18 @@ void EditHolePlugin::manualBridge() void EditHolePlugin::autoBridge() { - gla->meshDoc->setBusy(true); + md->setBusy(true); bool singleHole = dialogFiller->ui.selfHoleChkB->isChecked(); holesModel->autoBridge(singleHole, bridgeOptSldVal*0.0017); - gla->meshDoc->setBusy(false); + md->setBusy(false); upGlA(); } void EditHolePlugin::closeNMHoles() { - gla->meshDoc->setBusy(true); + md->setBusy(true); holesModel->closeNonManifolds(); - gla->meshDoc->setBusy(false); + md->setBusy(false); upGlA(); } @@ -351,9 +352,9 @@ void EditHolePlugin::acceptBridges() void EditHolePlugin::clearBridge() { - gla->meshDoc->setBusy(true); + md->setBusy(true); holesModel->removeBridges(); - gla->meshDoc->setBusy(false); + md->setBusy(false); upGlA(); } diff --git a/src/fgt/edit_hole/edit_hole.h b/src/fgt/edit_hole/edit_hole.h index d4b89e135..bc92a0534 100644 --- a/src/fgt/edit_hole/edit_hole.h +++ b/src/fgt/edit_hole/edit_hole.h @@ -59,7 +59,7 @@ public: EditHolePlugin(); virtual ~EditHolePlugin(); static const QString Info(); - virtual bool StartEdit(MeshModel &/*m*/, GLArea * /*parent*/); + virtual bool StartEdit(MeshDocument &/*m*/, GLArea * /*parent*/); virtual void EndEdit(MeshModel &/*m*/, GLArea * /*parent*/); virtual void Decorate(MeshModel &/*m*/, GLArea * /*parent*/); virtual void mousePressEvent(QMouseEvent *event, MeshModel &/*m*/, GLArea * ); @@ -74,6 +74,7 @@ private: HoleSorterFilter *holeSorter; GLArea *gla; MeshModel *mesh; + MeshDocument *md; FillerDialog *dialogFiller; bool toDraw; diff --git a/src/fgt/edit_hole/edit_hole.pro b/src/fgt/edit_hole/edit_hole.pro index bd323f967..7dc3331a3 100644 --- a/src/fgt/edit_hole/edit_hole.pro +++ b/src/fgt/edit_hole/edit_hole.pro @@ -5,13 +5,13 @@ HEADERS = edit_hole_factory.h \ fillerDialog.h \ holeListModel.h \ fgtHole.h \ - fgtBridge.h \ + fgtBridge.h \ holeSetManager.h SOURCES = edit_hole_factory.cpp \ - edit_hole.cpp \ + edit_hole.cpp \ fillerDialog.cpp\ - holeListModel.cpp + holeListModel.cpp TARGET = edit_hole diff --git a/src/meshlabplugins/editalign/alignDialog.cpp b/src/meshlabplugins/editalign/alignDialog.cpp index e09670a5b..cd7c854fa 100644 --- a/src/meshlabplugins/editalign/alignDialog.cpp +++ b/src/meshlabplugins/editalign/alignDialog.cpp @@ -265,7 +265,7 @@ void AlignDialog::onClickItem(QTreeWidgetItem * item, int column ) else mItem->setIcon(1,QIcon(":/layer_eye_close.png")); } else { - gla->meshDoc->setCurrentMesh(nn->id); + this->edit->md->setCurrentMesh(nn->id); updateCurrentNodeBackground(); } } else { diff --git a/src/meshlabplugins/editalign/editalign.cpp b/src/meshlabplugins/editalign/editalign.cpp index 4d6785a64..fe3d3b9af 100644 --- a/src/meshlabplugins/editalign/editalign.cpp +++ b/src/meshlabplugins/editalign/editalign.cpp @@ -87,9 +87,9 @@ void EditAlignPlugin::Decorate(MeshModel &m, GLArea * gla) } } -bool EditAlignPlugin::StartEdit(MeshModel &/*_mm*/, GLArea *_gla ) +bool EditAlignPlugin::StartEdit(MeshDocument &_md, GLArea *_gla ) { - md=_gla->meshDoc; + this->md=&_md; gla=_gla; int id=0; diff --git a/src/meshlabplugins/editalign/editalign.h b/src/meshlabplugins/editalign/editalign.h index 5e7d9d514..9547acdae 100644 --- a/src/meshlabplugins/editalign/editalign.h +++ b/src/meshlabplugins/editalign/editalign.h @@ -54,7 +54,7 @@ public: static const QString Info(); - virtual bool StartEdit(MeshModel &/*m*/, GLArea * /*parent*/); + virtual bool StartEdit(MeshDocument &/*m*/, GLArea * /*parent*/); virtual void EndEdit(MeshModel &/*m*/, GLArea * /*parent*/); virtual void Decorate(MeshModel &/*m*/, GLArea * /*parent*/); virtual void mousePressEvent(QMouseEvent *, MeshModel &, GLArea * ) ; @@ -72,7 +72,7 @@ public: MeshDocument *md; MeshNode *currentNode() {return meshTree.find(md->mm());} - vcg::AlignPair::Result *currentArc() {return alignDialog->currentArc;}; + vcg::AlignPair::Result *currentArc() {return alignDialog->currentArc;} MeshTree meshTree; GLArea * gla;