mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-16 17:44:36 +00:00
- removed compiling errors. Warnings are still there.
This commit is contained in:
parent
5832a8b441
commit
3e7fa9962e
@ -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;
|
||||
|
||||
@ -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<int> &v) const
|
||||
|
||||
@ -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;i<freePnt.size();++i)
|
||||
// meshTree.cb(0,qPrintable(buf.sprintf("%f %f %f -- %f %f %f \n",freePnt[i][0],freePnt[i][1],freePnt[i][2],gluedPnt[i][0],gluedPnt[i][1],gluedPnt[i][2])));
|
||||
@ -230,7 +230,7 @@ void EditAlignPlugin::glueManual()
|
||||
assert(currentNode()->glued==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);
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user