Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
granzuglia committed Jan 29, 2019
2 parents 446ca00 + 25f3d17 commit f6c6675
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 21 deletions.
1 change: 1 addition & 0 deletions src/common/interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ class MeshLabFilterInterface : public QObject, public MeshLabInterface
bool intteruptreq;
signals:
void renderingDataRequested(int);
void updateDecorators(int);
};

#if (QT_VERSION >= 0x050000)
Expand Down
11 changes: 9 additions & 2 deletions src/common/meshmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ void MeshDocument::setCurrentRaster( int i)
return;
}

void MeshDocument::requestUpdatingPerMeshDecorators(int meshid)
{
emit updateDecorators(meshid);
}

template <class LayerElement>
QString NameDisambiguator(QList<LayerElement*> &elemList, QString meshLabel )
{
Expand Down Expand Up @@ -606,11 +611,13 @@ bool MeshModelState::apply(MeshModel *_m)

if(changeMask & MeshModel::MM_VERTCOORD)
{
if(vertCoord.size() != m->cm.vert.size()) return false;
if(vertCoord.size() != m->cm.vert.size())
return false;
std::vector<Point3m>::iterator ci;
CMeshO::VertexIterator vi;
for(vi = m->cm.vert.begin(), ci = vertCoord.begin(); vi != m->cm.vert.end(); ++vi, ++ci)
if(!(*vi).IsD()) (*vi).P()=(*ci);
if(!(*vi).IsD())
(*vi).P()=(*ci);
}

if(changeMask & MeshModel::MM_VERTNORMAL)
Expand Down
3 changes: 2 additions & 1 deletion src/common/meshmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ class MeshDocument : public QObject
void updateRenderStateMeshes(const QList<int>& mm,const int meshupdatemask);
void updateRenderStateRasters(const QList<int>& rm,const int rasterupdatemask);*/

void requestUpdatingPerMeshDecorators(int mesh_id);

private:
int meshIdCounter;
Expand Down Expand Up @@ -667,6 +667,7 @@ class MeshDocument : public QObject

//this signal is emitted when a filter request to update the mesh in the renderingState
void documentUpdated();
void updateDecorators(int mesh_id);

};// end class MeshDocument

Expand Down
3 changes: 3 additions & 0 deletions src/common/ml_mesh_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ public :
int sfn; //The number of selected faces.
int svn; //The number of selected vertices.

int pvn; //the number of the polygonal vertices
int pfn; //the number of the polygonal faces

Matrix44m Tr; // Usually it is the identity. It is applied in rendering and filters can or cannot use it. (most of the filter will ignore this)

const Box3m &trBB()
Expand Down
8 changes: 7 additions & 1 deletion src/common/mlapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define ML_APPLICATION_H

#include <QApplication>
#include <QDate>
#include <QString>
#include <wrap/gl/gl_mesh_attributes_info.h>
#include "ml_mesh_type.h"
Expand All @@ -16,7 +17,12 @@ class MeshLabApplication : public QApplication
static const QString appName(){return tr("MeshLab"); }
static const QString architecturalSuffix(const HW_ARCHITECTURE hw) {return "_" + QString::number(int(hw)) + "bit";}
static const QString appArchitecturalName(const HW_ARCHITECTURE hw) {return appName() + architecturalSuffix(hw) + "_" + MeshLabScalarTest<MESHLAB_SCALAR>::floatingPointPrecision();}
static const QString appVer() {return tr("2018.04"); }
static const QString appVer()
{
const QDate dt = QDate::currentDate();
return QString::number(dt.year()) + "." + QString::number(dt.month());
}

static const QString shortName() { return appName() + " " + appVer(); }
static const QString completeName(const HW_ARCHITECTURE hw){return appArchitecturalName(hw) + " v" + appVer(); }
static const QString organization(){return tr("VCG");}
Expand Down
16 changes: 10 additions & 6 deletions src/meshlab/glarea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ GLArea::GLArea(QWidget *parent, MultiViewer_Container *mvcont, RichParameterSet
//connect(this->md(), SIGNAL(meshDocumentModified()), this, SLOT(updateAllPerMeshDecorators()),Qt::QueuedConnection);
connect(this->md(), SIGNAL(meshSetChanged()), this, SLOT(updateMeshSetVisibilities()));
connect(this->md(), SIGNAL(rasterSetChanged()), this, SLOT(updateRasterSetVisibilities()));
connect(this->md(),SIGNAL(documentUpdated()),this,SLOT(completeUpdateRequested()));
connect(this->md(), SIGNAL(documentUpdated()),this,SLOT(completeUpdateRequested()));
connect(this->md(), SIGNAL(updateDecorators(int)),this,SLOT(updatePerMeshDecorators(int)));
connect(this, SIGNAL(updateLayerTable()), this->mw(), SIGNAL(updateLayerTable()));
connect(md(),SIGNAL(meshRemoved(int)),this,SLOT(meshRemoved(int)));

Expand Down Expand Up @@ -579,6 +580,13 @@ void GLArea::paintEvent(QPaintEvent* /*event*/)

if(trackBallVisible && !takeSnapTile && !(iEdit && !suspendedEditor))
trackball.DrawPostApply();

foreach(QAction * p, iPerDocDecoratorlist)
{
MeshDecorateInterface * decorInterface = qobject_cast<MeshDecorateInterface *>(p->parent());
decorInterface->decorateDoc(p, *this->md(), this->glas.currentGlobalParamSet, this, &painter, md()->Log);
}

// The picking of the surface position has to be done in object space,
// so after trackball transformation (and before the matrix associated to each mesh);
if(hasToPick && hasToGetPickPos)
Expand All @@ -600,11 +608,7 @@ void GLArea::paintEvent(QPaintEvent* /*event*/)
hasToGetPickCoords = false;
}

foreach(QAction * p , iPerDocDecoratorlist)
{
MeshDecorateInterface * decorInterface = qobject_cast<MeshDecorateInterface *>(p->parent());
decorInterface->decorateDoc(p,*this->md(),this->glas.currentGlobalParamSet, this,&painter,md()->Log);
}


// we want to write scene-space the point picked with double-click in the log
// we have to do it now, before leaving this transformation space
Expand Down
6 changes: 6 additions & 0 deletions src/meshlab/glarea.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,12 @@ public slots:
defdec.initMeshDecorationData(*mm, dt);
}
}

void updatePerMeshDecorators(int mesh_id)
{
update();
}

void updateAllDecorators();

public:
Expand Down
10 changes: 1 addition & 9 deletions src/meshlab/mainwindow_RunTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@ from the user defined dialog

void MainWindow::executeFilter(QAction *action, RichParameterSet &params, bool isPreview)
{
MeshFilterInterface *iFilter = qobject_cast<MeshFilterInterface *>(action->parent());
MeshFilterInterface *iFilter = qobject_cast<MeshFilterInterface *>(action->parent());
qb->show();
iFilter->setLog(&meshDoc()->Log);

Expand All @@ -1441,15 +1441,7 @@ void MainWindow::executeFilter(QAction *action, RichParameterSet &params, bool i

// (3) save the current filter and its parameters in the history
if(!isPreview)
{
if (meshDoc()->filterHistory != NULL)
{
OldFilterNameParameterValuesPair* oldpair = new OldFilterNameParameterValuesPair();
oldpair->pair = qMakePair(action->text(),params);
meshDoc()->filterHistory->filtparlist.append(oldpair);
}
meshDoc()->Log.ClearBookmark();
}
else
meshDoc()->Log.BackToBookmark();
// (4) Apply the Filter
Expand Down
7 changes: 7 additions & 0 deletions src/meshlab/ml_std_par_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ void MeshlabStdDialog::applyClick()

//PreView Caching: if the apply parameters are the same to those used in the preview mode
//we don't need to reapply the filter to the mesh
if ((q != nullptr) && (curMeshDoc != nullptr) && (curMeshDoc->filterHistory != nullptr))
{
OldFilterNameParameterValuesPair* oldpair = new OldFilterNameParameterValuesPair();
oldpair->pair = qMakePair(q->text(), curParSet);
curMeshDoc->filterHistory->filtparlist.append(oldpair);
}

bool isEqual = (curParSet == prevParSet);
if (curModel && (isEqual) && (validcache))
{
Expand Down
2 changes: 1 addition & 1 deletion src/meshlab/stdpardialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void AbsPercWidget::on_percSB_valueChanged(double newv)
void AbsPercWidget::setValue(float val, float minV, float maxV)
{
assert(absSB);
absSB->setValue (val);
absSB->setValue(val);
m_min=minV;
m_max=maxV;
}
Expand Down
15 changes: 15 additions & 0 deletions src/meshlab/xmlstdpardialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
#include <QDialogButtonBox>
#include "mainwindow.h"

static void updateRenderingData(GLArea* glarea, MeshModel* curmodel)
{
MLSceneGLSharedDataContext* shar = glarea->getSceneGLSharedContext();
if (shar != NULL)
{
shar->meshAttributesUpdated(curmodel->id(), true, MLRenderingData::RendAtts(true));
shar->manageBuffers(curmodel->id());
}
}

MeshLabXMLStdDialog::MeshLabXMLStdDialog(QWidget *p)
:QDockWidget(QString("Plugin"), p),isfilterexecuting(false),env(),showHelp(false),previewCB(NULL)
{
Expand Down Expand Up @@ -286,6 +296,7 @@ void MeshLabXMLStdDialog::togglePreview()
else
{
meshState.apply(curModel);
updateRenderingData(glarea, curModel);
if (glarea != NULL)
glarea->updateAllDecorators();
}
Expand Down Expand Up @@ -945,13 +956,17 @@ QString XMLAbsWidget::getWidgetExpression()

void XMLAbsWidget::on_absSB_valueChanged(double newv)
{
disconnect(percSB, SIGNAL(valueChanged(double)), this, SLOT(on_percSB_valueChanged(double)));
percSB->setValue((100*(newv - m_min))/(m_max - m_min));
connect(percSB, SIGNAL(valueChanged(double)), this, SLOT(on_percSB_valueChanged(double)));
emit dialogParamChanged();
}

void XMLAbsWidget::on_percSB_valueChanged(double newv)
{
disconnect(absSB, SIGNAL(valueChanged(double)), this, SLOT(on_absSB_valueChanged(double)));
absSB->setValue((m_max - m_min)*0.01*newv + m_min);
connect(absSB, SIGNAL(valueChanged(double)), this, SLOT(on_absSB_valueChanged(double)));
emit dialogParamChanged();
}

Expand Down
2 changes: 1 addition & 1 deletion src/meshlabplugins/edit_align/align/OccupancyGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class OccupancyGrid{



void Clear();
void Clear() {};
bool Init(int _mn, Box3d bb, int size);

void Add(const char *MeshName, Matrix44d &Tr, int id);
Expand Down
5 changes: 5 additions & 0 deletions src/meshlabplugins/filter_meshing/filter_meshing.pro
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ SOURCES += meshfilter.cpp \

TARGET = filter_meshing

win32-msvc2010:QMAKE_CXXFLAGS = /bigobj
win32-msvc2005:QMAKE_CXXFLAGS = /bigobj
win32-msvc2008:QMAKE_CXXFLAGS = /bigobj
win32-msvc2012:QMAKE_CXXFLAGS = /bigobj
win32-msvc2015:QMAKE_CXXFLAGS = /bigobj

1 comment on commit f6c6675

@makc
Copy link

@makc makc commented on f6c6675 Jun 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is https://github.com/cnr-isti-vclab/meshlab/releases/tag/f6c6675 the last release supporting OS X 10.11 ?

Please sign in to comment.