From 3e7fa9962ef1a733d357b8559bbca7fa5e3769da Mon Sep 17 00:00:00 2001 From: Guido Ranzuglia granzuglia Date: Tue, 29 Jul 2014 15:15:38 +0000 Subject: [PATCH] - removed compiling errors. Warnings are still there. --- .../edit_align/AlignPairWidget.cpp | 7 +++++-- .../edit_align/align/OccupancyGrid.h | 2 +- src/meshlabplugins/edit_align/edit_align.cpp | 11 +++++----- src/meshlabplugins/edit_align/edit_align.h | 2 +- src/meshlabplugins/edit_align/meshtree.h | 20 +++++++++---------- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/meshlabplugins/edit_align/AlignPairWidget.cpp b/src/meshlabplugins/edit_align/AlignPairWidget.cpp index fa48044b3..673471396 100644 --- a/src/meshlabplugins/edit_align/AlignPairWidget.cpp +++ b/src/meshlabplugins/edit_align/AlignPairWidget.cpp @@ -99,6 +99,7 @@ void AlignPairWidget::paintEvent(QPaintEvent *) glViewport (0, 0, (GLsizei) QTLogicalToDevice(this,width()/2), (GLsizei) QTLogicalToDevice(this,height())); else glViewport (QTLogicalToDevice(this,width()/2), 0, (GLsizei) QTLogicalToDevice(this,width()/2), (GLsizei) QTLogicalToDevice(this,height())); + glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -111,8 +112,10 @@ void AlignPairWidget::paintEvent(QPaintEvent *) tt[i]->GetView(); tt[i]->Apply(); vcg::Box3f bb; - if(i==0) bb=freeMesh->bbox(); - else bb=gluedTree->gluedBBox(); + if(i==0) + bb.Import(freeMesh->bbox()); + else + bb.Import(gluedTree->gluedBBox()); vcg::GLW::DrawMode localDM=vcg::GLW::DMFlat; vcg::GLW::ColorMode localCM = vcg::GLW::CMPerMesh; if((freeMesh->m->hasDataMask(MeshModel::MM_VERTCOLOR))&&(isUsingVertexColor)) localCM = vcg::GLW::CMPerVert; diff --git a/src/meshlabplugins/edit_align/align/OccupancyGrid.h b/src/meshlabplugins/edit_align/align/OccupancyGrid.h index 7e984de3b..b8ad00d06 100644 --- a/src/meshlabplugins/edit_align/align/OccupancyGrid.h +++ b/src/meshlabplugins/edit_align/align/OccupancyGrid.h @@ -116,7 +116,7 @@ public: bool IsSet(int i) const {return cnt.test(i);} void Set(int i) {cnt.set(i);} void UnSet(int i) {cnt.reset(i);} - int Count() const { return cnt.count();} + size_t Count() const { return cnt.count();} // Return a vector with all the id of the meshes void Pack(std::vector &v) const diff --git a/src/meshlabplugins/edit_align/edit_align.cpp b/src/meshlabplugins/edit_align/edit_align.cpp index eb32977f9..4d9afca89 100644 --- a/src/meshlabplugins/edit_align/edit_align.cpp +++ b/src/meshlabplugins/edit_align/edit_align.cpp @@ -185,7 +185,7 @@ void EditAlignPlugin::glueByPicking() return; } - Matrix44f oldTr = md->mm()->cm.Tr; + //Matrix44f oldTr = md->mm()->cm.Tr; md->mm()->cm.Tr.SetIdentity(); AlignPairDialog *dd=new AlignPairDialog(this->alignDialog); dd->aa->initMesh(currentNode(), &meshTree); @@ -212,7 +212,7 @@ void EditAlignPlugin::glueByPicking() ComputeRigidMatchMatrix(gluedPnt,freePnt,res); //md->mm()->cm.Tr=res; - currentNode()->tr()=res; + currentNode()->tr().Import(res); QString buf; // for(size_t i=0;iglued==false); MeshModel *mm=md->mm(); static QString oldLabelButton; - Matrix44f tran,mtran; + Matrix44f tran,mtran, tmp; switch(mode) { @@ -239,7 +239,7 @@ void EditAlignPlugin::glueManual() mode = ALIGN_MOVE; md->mm()->visible=false; trackball.Reset(); - trackball.center= mm->cm.trBB().Center(); + trackball.center.Import(mm->cm.trBB().Center()); trackball.radius= mm->cm.trBB().Diag()/2.0; toggleButtons(); oldLabelButton= alignDialog->ui.manualAlignButton->text(); @@ -251,7 +251,8 @@ void EditAlignPlugin::glueManual() toggleButtons(); tran.SetTranslate(trackball.center); mtran.SetTranslate(-trackball.center); - mm->cm.Tr= (tran) * trackball.track.Matrix()*(mtran) * mm->cm.Tr; + tmp.Import(mm->cm.Tr); + mm->cm.Tr.Import((tran) * trackball.track.Matrix()*(mtran) * tmp); mm->visible=true; currentNode()->glued=true; alignDialog->ui.manualAlignButton->setText(oldLabelButton); diff --git a/src/meshlabplugins/edit_align/edit_align.h b/src/meshlabplugins/edit_align/edit_align.h index fd1c7990d..154b75b8a 100644 --- a/src/meshlabplugins/edit_align/edit_align.h +++ b/src/meshlabplugins/edit_align/edit_align.h @@ -79,7 +79,7 @@ public: MeshTree::Param defaultMTP; // default MeshTree parameters // this callback MUST be redefined because we are able to manage internally the layer change. - virtual void LayerChanged(MeshDocument &/*md*/, MeshModel &/*oldMeshModel*/, GLArea */*parent*/) + virtual void LayerChanged(MeshDocument & /*md*/, MeshModel & /*oldMeshModel*/, GLArea * /*parent*/) { // add code here to manage the external layer switching } diff --git a/src/meshlabplugins/edit_align/meshtree.h b/src/meshlabplugins/edit_align/meshtree.h index 86dd9a6b6..a532fd905 100644 --- a/src/meshlabplugins/edit_align/meshtree.h +++ b/src/meshlabplugins/edit_align/meshtree.h @@ -43,8 +43,8 @@ public: // MeshNode() { m=0;id=-1;} bool glued; MeshModel *m; - vcg::Matrix44f &tr() {return m->cm.Tr;} - const vcg::Box3f &bbox() const {return m->cm.bbox;} + Matrix44m &tr() {return m->cm.Tr;} + const Box3m &bbox() const {return m->cm.bbox;} int Id() {return m->id();} }; @@ -62,8 +62,8 @@ public: Param() { OGSize = 50000; - arcThreshold = 0.3; - recalcThreshold = 0.1; + arcThreshold = 0.3f; + recalcThreshold = 0.1f; } }; @@ -130,18 +130,18 @@ public: void ProcessArc(int fixId, int movId, vcg::AlignPair::Result &result, vcg::AlignPair::Param ap); void ProcessArc(int fixId, int movId, vcg::Matrix44d &MovToFix, vcg::AlignPair::Result &result, vcg::AlignPair::Param ap); - inline vcg::Box3f bbox() { - vcg::Box3f FullBBox; + inline Box3m bbox() { + Box3m FullBBox; foreach(MeshNode *mp, nodeList) - FullBBox.Add(vcg::Matrix44f::Construct(mp->tr()),mp->bbox()); + FullBBox.Add(Matrix44m::Construct(mp->tr()),mp->bbox()); return FullBBox; } - inline vcg::Box3f gluedBBox() { - vcg::Box3f FullBBox; + inline Box3m gluedBBox() { + Box3m FullBBox; foreach(MeshNode *mp, nodeList) if(mp->glued) - FullBBox.Add(vcg::Matrix44f::Construct(mp->tr()),mp->bbox()); + FullBBox.Add(Matrix44m::Construct(mp->tr()),mp->bbox()); return FullBBox; } };