diff --git a/.travis.yml b/.travis.yml index 2ba1d2b22..d28811e4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,9 @@ install: #sudo apt-get -y install qtscript5-dev #sudo apt-get -y install libqt5xmlpatterns5-dev qmake --version + echo $QMAKESPEC + export QMAKESPEC="linux-clang" + fi - cd .. - git clone --depth=1 --branch=devel https://github.com/cnr-isti-vclab/vcglib.git diff --git a/README.md b/README.md index d555a876f..132b0b2bc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # ![MeshLab Logo](src/meshlab/images/eye64.png) MeshLab [![Build Status](https://travis-ci.org/cnr-isti-vclab/meshlab.svg?branch=master)](https://travis-ci.org/cnr-isti-vclab/meshlab) +[![Build status](https://ci.appveyor.com/api/projects/status/bdxm2m4n5ud7vm47?svg=true)](https://ci.appveyor.com/project/cignoni/meshlab) This is the official repository for the sources and the binaries of MeshLab. @@ -9,5 +10,5 @@ The system is aimed to help the processing of the typical not-so-small unstructu MeshLab is mostly based on the open source c++ mesh processing library [VCGlib](http://www.vcglib.net) developed at the [Visual Computing Lab](http://vcg.isti.cnr.it) of [ISTI - CNR](http://www.isti.cnr.it), for all the core mesh processing tasks and it is available for Windows, MacOSX, and Linux. -Compiling instruction can be found in the [src](https://github.com/cnr-isti-vclab/meshlab/tree/master/src) folder. +Compiling instruction can be found in the [src](https://github.com/cnr-isti-vclab/meshlab/tree/master/src) folder or simply looking at the continous integration setup on [travis](https://travis-ci.org/cnr-isti-vclab/meshlab/builds) and [appveyor](https://ci.appveyor.com/project/cignoni/meshlab/history). diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 000000000..fb6b3a0cc --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,65 @@ +# Known to build in Ubuntu 17.04 +name: meshlab +version: '2017.03-1' +summary: MeshLab +description: | + The open source system for processing and editing 3D triangular meshes. + It provides a set of tools for editing, cleaning, healing, inspecting, + rendering, texturing and converting meshes. It offers features for processing + raw data produced by 3D digitization tools/devices and for preparing models + for 3D printing. +icon: snap/gui/meshlab.png + +grade: stable +confinement: devmode + +#apps: +# meshlab: +# command: desktop-launch meshlab +# plugs: [home, x11, mir, opengl, unity7] +# meshlabserver: +# command: desktop-launch meshlabserver +# plugs: [home, x11, opengl] + +parts: + meshlab: + after: [desktop-qt5,vcglib] + plugin: qmake + qt-version: qt5 + source: https://github.com/cnr-isti-vclab/meshlab.git + build-packages: + - libqt5opengl5-dev + - libqt5xmlpatterns5-dev + - qt5-default + - qtscript5-dev + prepare: | + ln -sf ../vcglib/install ../vcglib + sed -i '/filter_csg/d' src/meshlab_full.pro + sed -i -e '2ilinux:QMAKE_LFLAGS += -fopenmp -lgomp\' src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.pro + sed -i 's|PR_XXXXXX|/tmp/PR_XXXXXX|' src/meshlabplugins/filter_screened_poisson/Src/Geometry.cpp + build: | + cd src/external + qmake external.pro + make -j4 + cd .. + qmake meshlab_full.pro + make -j4 + install: | + cp src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.xml \ + src/meshlabplugins/filter_mutualinfoxml/filter_mutualinfo.xml \ + src/meshlabplugins/filter_measure/filter_measure.xml \ + src/distrib/plugins/ + cd src/distrib + mkdir -p $SNAPCRAFT_PART_INSTALL/bin + cp -a meshlab* plugins shaders textures $SNAPCRAFT_PART_INSTALL/bin + mkdir -p $SNAPCRAFT_PART_INSTALL/lib + cp -a lib* $SNAPCRAFT_PART_INSTALL/lib + vcglib: + plugin: dump +# source: https://github.com/cnr-isti-vclab/vcglib.git +# source-tag: v1.0.2 + source: https://github.com/cnr-isti-vclab/vcglib.git + source-branch: devel + - -vcglib/apps + prime: [ -* ] + diff --git a/src/common/common.pro b/src/common/common.pro index dc89adeb4..b8a497fdb 100644 --- a/src/common/common.pro +++ b/src/common/common.pro @@ -59,12 +59,9 @@ INCLUDEPATH *= ../.. \ $$EIGENDIR \ $$GLEWDIR/include TEMPLATE = lib -linux-g++:CONFIG += dll -linux-g++:DESTDIR = ../distrib -linux-g++-32:CONFIG += dll -linux-g++-32:DESTDIR = ../distrib -linux-g++-64:CONFIG += dll -linux-g++-64:DESTDIR = ../distrib + +linux:CONFIG += dll +linux:DESTDIR = ../distrib linux-g++:QMAKE_CXXFLAGS+=-Wno-unknown-pragmas diff --git a/src/common/interfaces.h b/src/common/interfaces.h index fbb70a445..33cc1562d 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -311,7 +311,7 @@ public: // It is widely used by the meshlab's preview system. //TO BE REPLACED WITH = 0 */ - virtual int postCondition(QAction*) const { return MeshModel::MM_UNKNOWN; } + virtual int postCondition(QAction*) const { return MeshModel::MM_ALL; } /** \brief applies the selected filter with the already stabilished parameters * This function is called by the framework after getting values for the parameters specified in the \ref InitParameterSet @@ -334,7 +334,7 @@ public: bool isFilterApplicable(QAction *act, const MeshModel& m, QStringList &MissingItems) const; - enum FILTER_ARITY { NONE = 0, SINGLE_MESH = 1, FIXED = 2, VARIABLE = 3 }; + enum FILTER_ARITY { NONE = 0, SINGLE_MESH = 1, FIXED = 2, VARIABLE = 3, UNKNOWN_ARITY = 4 }; /** \brief this function informs the MeshLab core on how many meshes the filter will work on. Valid value: diff --git a/src/common/ml_shared_data_context.cpp b/src/common/ml_shared_data_context.cpp index bc3efaccd..21a02147b 100644 --- a/src/common/ml_shared_data_context.cpp +++ b/src/common/ml_shared_data_context.cpp @@ -522,7 +522,7 @@ void MLPoliciesStandAloneFunctions::computeRequestedRenderingDataCompatibleWithM } bool validfaces = (mesh.FN() > 0); - MLRenderingData::PRIMITIVE_MODALITY_MASK tmpoutputpm = inputdt.getPrimitiveModalityMask(); +// MLRenderingData::PRIMITIVE_MODALITY_MASK tmpoutputpm = inputdt.getPrimitiveModalityMask(); for (size_t pmind = 0; pmind < size_t(MLRenderingData::PR_ARITY); ++pmind) { MLRenderingData::PRIMITIVE_MODALITY pmc = MLRenderingData::PRIMITIVE_MODALITY(pmind); diff --git a/src/common/pluginmanager.cpp b/src/common/pluginmanager.cpp index ff9e3ce21..4fbe1e1a8 100644 --- a/src/common/pluginmanager.cpp +++ b/src/common/pluginmanager.cpp @@ -140,6 +140,16 @@ void PluginManager::loadPlugins(RichParameterSet& defaultGlobal) actionFilterMap.insert(filterAction->text(), filterAction); stringFilterMap.insert(filterAction->text(), iFilter); iFilter->initGlobalParameterSet(filterAction, defaultGlobal); + if(iFilter->getClass(filterAction)==MeshFilterInterface::Generic) + throw MLException("Missing class for " +fileName+filterAction->text()); + if(iFilter->getRequirements(filterAction) == MeshModel::MM_UNKNOWN) + throw MLException("Missing requirements for " +fileName+filterAction->text()); + if(iFilter->getPreConditions(filterAction) == MeshModel::MM_UNKNOWN) + throw MLException("Missing preconditions for "+fileName+filterAction->text()); + if(iFilter->postCondition(filterAction) == MeshModel::MM_UNKNOWN ) + throw MLException("Missing postcondition for "+fileName+filterAction->text()); + if(iFilter->filterArity(filterAction) == MeshFilterInterface::UNKNOWN_ARITY ) + throw MLException("Missing Arity for " +fileName+filterAction->text()); } } MeshIOInterface *iIO = qobject_cast(plugin); diff --git a/src/external/ext_common.pri b/src/external/ext_common.pri index 132b9f6cf..878e9cdc6 100644 --- a/src/external/ext_common.pri +++ b/src/external/ext_common.pri @@ -11,9 +11,8 @@ win32-msvc:DESTDIR = $$EXTERNAL_BASE_PATH/lib/win32-msvc win32-msvc2015:DEFINES += _CRT_SECURE_NO_WARNINGS win32-msvc2017:DEFINES += _CRT_SECURE_NO_WARNINGS win32-msvc:DEFINES += _CRT_SECURE_NO_WARNINGS -linux-g++:DESTDIR = $$EXTERNAL_BASE_PATH/lib/linux-g++ -linux-g++-32:DESTDIR = $$EXTERNAL_BASE_PATH/lib/linux-g++-32 -linux-g++-64:DESTDIR = $$EXTERNAL_BASE_PATH/lib/linux-g++-64 + +linux:DESTDIR = $$EXTERNAL_BASE_PATH/lib/linux unix:CONFIG(release, debug|release) { DEFINES *= NDEBUG diff --git a/src/meshlab/meshlab.pro b/src/meshlab/meshlab.pro index 2661143f2..cae4cb4ff 100644 --- a/src/meshlab/meshlab.pro +++ b/src/meshlab/meshlab.pro @@ -154,12 +154,8 @@ win32-g++:LIBS += -L../external/lib/win32-gcc -ljhead -L../distrib -lcom # win32-g++:release:LIBS += -L../common/release -lcommon #} -linux-g++:LIBS += -L$$PWD/../external/lib/linux-g++ -ljhead -L../distrib -lcommon -lGLU -linux-g++:QMAKE_RPATHDIR += ../distrib -linux-g++-32:LIBS += -L../external/lib/linux-g++-32 -ljhead -L../distrib -lcommon -lGLU -linux-g++-32:QMAKE_RPATHDIR += ../distrib -linux-g++-64:LIBS += -L../external/lib/linux-g++-64 -ljhead -L../distrib -lcommon -lGLU -linux-g++-64:QMAKE_RPATHDIR += ../distrib +linux:LIBS += -L$$PWD/../external/lib/linux -ljhead -L../distrib -lcommon -lGLU +linux:QMAKE_RPATHDIR += ../distrib # uncomment in your local copy only in emergency cases. # We should never be too permissive diff --git a/src/meshlab/xmlstdpardialog.cpp b/src/meshlab/xmlstdpardialog.cpp index ace0fa026..760c944b5 100644 --- a/src/meshlab/xmlstdpardialog.cpp +++ b/src/meshlab/xmlstdpardialog.cpp @@ -733,7 +733,7 @@ XMLEditWidget::XMLEditWidget(const MLXMLPluginInfo::XMLMap& xmlWidgetTag,EnvWrap lineEdit = new QLineEdit(this); lineEdit->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); //int row = gridLay->rowCount() -1; - QHBoxLayout* hlay = new QHBoxLayout(); + hlay = new QHBoxLayout(); hlay->addWidget(lineEdit); hlay->addWidget(perstb); diff --git a/src/meshlabplugins/filter_camera/filter_camera.cpp b/src/meshlabplugins/filter_camera/filter_camera.cpp index 588e34cd7..e5fab345b 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.cpp +++ b/src/meshlabplugins/filter_camera/filter_camera.cpp @@ -695,7 +695,7 @@ int FilterCameraPlugin::postCondition(QAction * filter) const return MeshModel::MM_ALL + RasterModel::RM_ALL; case FP_QUALITY_FROM_CAMERA : return MeshModel::MM_VERTQUALITY + MeshModel::MM_VERTCOLOR; - default : return MeshModel::MM_UNKNOWN; + default : return MeshModel::MM_ALL; } } diff --git a/src/meshlabplugins/filter_clean/cleanfilter.cpp b/src/meshlabplugins/filter_clean/cleanfilter.cpp index 6e0c7bee9..fa73e666d 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.cpp +++ b/src/meshlabplugins/filter_clean/cleanfilter.cpp @@ -183,6 +183,10 @@ QString CleanFilter::filterName(FilterIDType filter) const } return 0; } + int CleanFilter::postCondition( QAction* /*filter*/ ) const + { + return MeshModel::MM_ALL; + } void CleanFilter::initParameterSet(QAction *action,MeshDocument &md, RichParameterSet & parlst) { diff --git a/src/meshlabplugins/filter_clean/cleanfilter.h b/src/meshlabplugins/filter_clean/cleanfilter.h index de4f0c956..c3c594d7e 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.h +++ b/src/meshlabplugins/filter_clean/cleanfilter.h @@ -71,11 +71,11 @@ public: virtual FilterClass getClass(QAction *); virtual int getRequirements(QAction *); - + int postCondition(QAction* ) const; + int getPreConditions(QAction *) const { return MeshModel::MM_NONE; } virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterSet & /*parent*/); virtual bool applyFilter(QAction *filter, MeshDocument &md, RichParameterSet & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} - }; diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp index 6f25c00e8..2c50ed929 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp @@ -935,10 +935,10 @@ int FilterColorProjectionPlugin::postCondition( QAction* a ) const{ return MeshModel::MM_VERTCOLOR; break; case FP_MULTIIMAGETRIVIALPROJTEXTURE: - return MeshModel::MM_UNKNOWN; + return MeshModel::MM_ALL; break; - default: assert(0); - return MeshModel::MM_NONE; + default: + return MeshModel::MM_ALL; } } diff --git a/src/meshlabplugins/filter_csg/filter_csg.pro b/src/meshlabplugins/filter_csg/filter_csg.pro index ef3540fc4..928d7b548 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.pro +++ b/src/meshlabplugins/filter_csg/filter_csg.pro @@ -25,7 +25,4 @@ win32-msvc2010:LIBS += ../../external/lib/win32-msvc2008/mpirxx.lib ../../exte win32-msvc2012:LIBS += ../../external/lib/win32-msvc2008/mpirxx.lib ../../external/lib/win32-msvc2008/mpir.lib win32-msvc2013:LIBS += ../../external/lib/win32-msvc2008/mpirxx.lib ../../external/lib/win32-msvc2008/mpir.lib win32-msvc2015:LIBS += ../../external/lib/win32-msvc2015/mpirxx.lib ../../external/lib/win32-msvc2015/mpir.lib -linux-g++:INCLUDEPATH += ../../external/inc/linux-g++/mpir-2.4.0 -#linux-g++:LIBS += $$PWD/../../external/lib/linux-g++/libmpirxx.a $$PWD/../../external/lib/linux-g++/libmpir.a -#linux-g++-64:INCLUDEPATH += $$PWD/../../external/inc/linux-g++/mpir-2.4.0 -#linux-g++-64:LIBS += $$PWD/../../external/lib/linux-g++-64/libmpirxx.a $$PWD/../../external/lib/linux-g++-64/libmpir.a +linux:INCLUDEPATH += ../../external/inc/linux-g++/mpir-2.4.0 diff --git a/src/meshlabplugins/filter_dirt/dirt_utils.cpp b/src/meshlabplugins/filter_dirt/dirt_utils.cpp index cf3e3ff9f..30365ee6e 100644 --- a/src/meshlabplugins/filter_dirt/dirt_utils.cpp +++ b/src/meshlabplugins/filter_dirt/dirt_utils.cpp @@ -44,7 +44,7 @@ return true if a particle of that face fall out bool CheckFallPosition(CMeshO::FacePointer f,Point3m g,Scalarm a){ Point3m n=f->N(); if(a>1) return false; - if(acos(n.dot(g)/(n.Norm()*g.Norm()))<((PI/2)*(1-a))) return true; + if(acos(n.dot(g)/(n.Norm()*g.Norm()))<((M_PI/2)*(1-a))) return true; return false; } @@ -112,22 +112,6 @@ CMeshO::CoordType fromBarCoords(Point3m bc,CMeshO::FacePointer f){ return p; } -/** -@def Given a face return the coordinates of its baricenter - -@param FacePointer f - - -@return The Baricenter of the face -*/ -CMeshO::CoordType getBaricenter(CMeshO::FacePointer f){ - Point3m bc; - bc[0]=0.33f; - bc[1]=0.33f; - bc[2]=1-bc[0]-bc[1]; - CMeshO::CoordType pc=fromBarCoords(bc,f); - return pc; -} - CMeshO::CoordType GetNewVelocity(CMeshO::CoordType i_v,CMeshO::FacePointer face,CMeshO::FacePointer new_face,CMeshO::CoordType force,CMeshO::CoordType g,Scalarm m,Scalarm t){ CMeshO::CoordType n_v; diff --git a/src/meshlabplugins/filter_dirt/dirt_utils.h b/src/meshlabplugins/filter_dirt/dirt_utils.h index 6269c2ae0..d6308b580 100644 --- a/src/meshlabplugins/filter_dirt/dirt_utils.h +++ b/src/meshlabplugins/filter_dirt/dirt_utils.h @@ -33,23 +33,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "particle.h" using namespace vcg; @@ -59,15 +42,10 @@ typedef GridStaticPtr MetroMeshFaceGrid; typedef GridStaticPtr MetroMeshVertexGrid; typedef FaceTmark MarkerFace; -#define PI 3.14159265 #define EPSILON 0.0001 - - - CMeshO::CoordType RandomBaricentric(); CMeshO::CoordType fromBarCoords(Point3m bc,CMeshO::FacePointer f); -CMeshO::CoordType getBaricenter(CMeshO::FacePointer f); CMeshO::CoordType GetSafePosition(CMeshO::CoordType p,CMeshO::FacePointer f); CMeshO::CoordType StepForward(CMeshO::CoordType p,CMeshO::CoordType v,Scalarm m,CMeshO::FacePointer &face,CMeshO::CoordType force,Scalarm l,Scalarm t=1); CMeshO::CoordType getRandomDirection(); diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.cpp b/src/meshlabplugins/filter_dirt/filter_dirt.cpp index 4460ffbb3..4bcacaf6c 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.cpp +++ b/src/meshlabplugins/filter_dirt/filter_dirt.cpp @@ -244,8 +244,8 @@ bool FilterDirt::applyFilter(QAction *filter, MeshDocument &md, RichParameterSet int FilterDirt::postCondition( QAction *a) const { switch (ID(a)){ - case FP_DIRT : return MeshModel::MM_UNKNOWN; - case FP_CLOUD_MOVEMENT : return MeshModel::MM_UNKNOWN; + case FP_DIRT : return MeshModel::MM_ALL; + case FP_CLOUD_MOVEMENT : return MeshModel::MM_ALL; default: assert(0); } diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.cpp b/src/meshlabplugins/filter_fractal/filter_fractal.cpp index 9a2493fa2..e70ce539e 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.cpp +++ b/src/meshlabplugins/filter_fractal/filter_fractal.cpp @@ -295,11 +295,11 @@ int FilterFractal::postCondition(QAction *filter) const switch(ID(filter)) { case CR_FRACTAL_TERRAIN: - return MeshModel::MM_UNKNOWN; + return MeshModel::MM_ALL; break; case FP_FRACTAL_MESH: case FP_CRATERS: - return MeshModel::MM_VERTCOORD | MeshModel::MM_VERTNORMAL | MeshModel::MM_FACENORMAL | MeshModel::MM_VERTQUALITY | MeshModel::MM_FACEFLAG; + return MeshModel::MM_ALL; break; default: assert(0); } diff --git a/src/meshlabplugins/filter_func/filter_func.cpp b/src/meshlabplugins/filter_func/filter_func.cpp index 3031baeb5..a779729de 100644 --- a/src/meshlabplugins/filter_func/filter_func.cpp +++ b/src/meshlabplugins/filter_func/filter_func.cpp @@ -209,8 +209,9 @@ int FilterFunctionPlugin::postCondition(QAction *action) const case FF_ISOSURFACE: case FF_DEF_FACE_ATTRIB: case FF_REFINE: - return MeshModel::MM_UNKNOWN; + return MeshModel::MM_ALL; } + return MeshModel::MM_UNKNOWN; } diff --git a/src/meshlabplugins/filter_measure/filter_measure.cpp b/src/meshlabplugins/filter_measure/filter_measure.cpp index 81e642065..e9389afd8 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.cpp +++ b/src/meshlabplugins/filter_measure/filter_measure.cpp @@ -157,7 +157,13 @@ bool FilterMeasurePlugin::applyFilter( const QString& filterName,MeshDocument& m quadFound = true; } } - assert(quadFound); + + if (!quadFound) + { + errorMessage = "QuadMesh problem: current mesh doesn't contain quads."; + return false; + } + for (int i = 0; i<4; ++i) AngleD.Add(fabs(90 - math::ToDeg(Angle(qv[(i + 0) % 4] - qv[(i + 1) % 4], qv[(i + 2) % 4] - qv[(i + 1) % 4])))); float edgeLen[4]; diff --git a/src/meshlabplugins/filter_measure/filter_measure.pro b/src/meshlabplugins/filter_measure/filter_measure.pro index 8b69666b6..c20c96ede 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.pro +++ b/src/meshlabplugins/filter_measure/filter_measure.pro @@ -3,6 +3,5 @@ include (../../shared.pri) HEADERS += filter_measure.h SOURCES += filter_measure.cpp TARGET = filter_measure -#PRE_TARGETDEPS += filter_measure.xml -QMAKE_POST_LINK += $$QMAKE_COPY_FILE \"$${_PRO_FILE_PWD_}/$${TARGET}.xml\" \"../../distrib/plugins/$${TARGET}.xml\"; +include (../../shared_post.pri) diff --git a/src/meshlabplugins/filter_measure/filter_measure.xml b/src/meshlabplugins/filter_measure/filter_measure.xml index b6a2ce7e5..c3de2b046 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.xml +++ b/src/meshlabplugins/filter_measure/filter_measure.xml @@ -43,12 +43,10 @@ - + - + + @@ -64,13 +62,11 @@ - + - - - + + + diff --git a/src/meshlabplugins/filter_meshing/meshfilter.cpp b/src/meshlabplugins/filter_meshing/meshfilter.cpp index bc44a48db..902ccec7e 100644 --- a/src/meshlabplugins/filter_meshing/meshfilter.cpp +++ b/src/meshlabplugins/filter_meshing/meshfilter.cpp @@ -1705,7 +1705,7 @@ int ExtraMeshFilterPlugin::postCondition(QAction * filter) const case FP_INVERT_TRANSFORM : return MeshModel::MM_TRANSFMATRIX; case FP_NORMAL_EXTRAPOLATION : case FP_NORMAL_SMOOTH_POINTCLOUD : return MeshModel::MM_VERTNORMAL; - default : return MeshModel::MM_UNKNOWN; + default : return MeshModel::MM_ALL; } } diff --git a/src/meshlabplugins/filter_mutualinfoxml/filter_mutualinfoxml.pro b/src/meshlabplugins/filter_mutualinfoxml/filter_mutualinfoxml.pro index 81516d14f..0d0fe87ba 100644 --- a/src/meshlabplugins/filter_mutualinfoxml/filter_mutualinfoxml.pro +++ b/src/meshlabplugins/filter_mutualinfoxml/filter_mutualinfoxml.pro @@ -20,5 +20,4 @@ SOURCES += filter_mutualinfo.cpp \ TARGET = filter_mutualinfo -macx:QMAKE_POST_LINK = "cp "$$_PRO_FILE_PWD_/$$TARGET".xml ../../distrib/plugins/"$$TARGET".xml" -linux:QMAKE_POST_LINK = "cp "$$_PRO_FILE_PWD_/$$TARGET".xml ../../distrib/plugins/"$$TARGET".xml; cd ../../distrib/plugins/ ; ln -s "$$TARGET".xml lib"$$TARGET".xml" +include (../../shared_post.pri) \ No newline at end of file diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.pro b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.pro index 75674cf27..9da922b3c 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.pro +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.pro @@ -3,6 +3,5 @@ include (../../shared.pri) HEADERS += filter_sketchfab.h SOURCES += filter_sketchfab.cpp $$VCGDIR//wrap/ply/plylib.cpp TARGET = filter_sketchfab -#PRE_TARGETDEPS += filter_sketchfab.xml -macx:QMAKE_POST_LINK = "cp "$$_PRO_FILE_PWD_/$$TARGET".xml ../../distrib/plugins/"$$TARGET".xml" +include (../../shared_post.pri) \ No newline at end of file diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp index abc51096f..c2e3d92c1 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp @@ -181,7 +181,11 @@ bool FilterVoronoiPlugin::applyFilter( const QString& filterName,MeshDocument& m // md.updateRenderStateMeshes(meshlist,int(MeshModel::MM_VERTCOLOR)); if (intteruptreq) return true; - + + tri::UpdateSelection::VertexClear(m.cm); + for(auto vi =seedVec.begin();vi!=seedVec.end();++vi) + (*vi)->SetS(); + om->UpdateBoxAndNormals(); return true; } diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.pro b/src/meshlabplugins/filter_voronoi/filter_voronoi.pro index 423f15737..f2ef9455d 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.pro +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.pro @@ -1,10 +1,7 @@ include (../../shared.pri) HEADERS += filter_voronoi.h - SOURCES += filter_voronoi.cpp - TARGET = filter_voronoi -#PRE_TARGETDEPS += filter_voronoi.xml -macx:QMAKE_POST_LINK = "rsync -u "$$TARGET".xml ../../distrib/plugins/"$$TARGET".xml; rsync -u ../../distrib/plugins/"$$TARGET".xml "$$TARGET".xml" +include (../../shared_post.pri) \ No newline at end of file diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.xml b/src/meshlabplugins/filter_voronoi/filter_voronoi.xml index 29e37319e..f2f9edd8a 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.xml +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.xml @@ -3,47 +3,47 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -80,35 +80,35 @@ - + - + - + - + - + - + - + - + @@ -116,47 +116,47 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -165,7 +165,7 @@ - + @@ -173,7 +173,7 @@ - + diff --git a/src/meshlabplugins/io_base/baseio.cpp b/src/meshlabplugins/io_base/baseio.cpp index 498758ec5..d460c5930 100644 --- a/src/meshlabplugins/io_base/baseio.cpp +++ b/src/meshlabplugins/io_base/baseio.cpp @@ -85,15 +85,20 @@ void BaseMeshIOPlugin::initPreOpenParameter(const QString &formatName, const QSt bool BaseMeshIOPlugin::open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterSet &parlst, CallBackPos *cb, QWidget * /*parent*/) { bool normalsUpdated = false; + QString errorMsgFormat = "Error encountered while loading file:\n\"%1\"\n\nError details: %2"; + if(!QFile::exists(fileName)) + { + errorMessage = errorMsgFormat.arg(fileName, "File does not exist"); + return false; + } // initializing mask mask = 0; // initializing progress bar status if (cb != NULL) (*cb)(0, "Loading..."); - QString errorMsgFormat = "Error encountered while loading file:\n\"%1\"\n\nError details: %2"; - + //string filename = fileName.toUtf8().data(); string filename = QFile::encodeName(fileName).constData(); @@ -119,7 +124,7 @@ bool BaseMeshIOPlugin::open(const QString &formatName, const QString &fileName, { if (!tri::io::ImporterSTL::LoadMask(filename.c_str(), mask)) { - errorMessage = errorMsgFormat.arg(fileName, tri::io::ImporterSTL::ErrorMsg(tri::io::ImporterSTL::E_CANTOPEN)); + errorMessage = errorMsgFormat.arg(fileName, tri::io::ImporterSTL::ErrorMsg(tri::io::ImporterSTL::E_MALFORMED)); return false; } m.Enable(mask); @@ -444,6 +449,7 @@ void BaseMeshIOPlugin::GetExportMaskCapability(QString &format, int &capability, defaultBits = capability; defaultBits &= (~tri::io::Mask::IOM_FLAGS); defaultBits &= (~tri::io::Mask::IOM_VERTNORMAL); + defaultBits &= (~tri::io::Mask::IOM_FACENORMAL); } if (format.toUpper() == tr("STL")) { capability = tri::io::ExporterSTL::GetExportMaskCapability(); diff --git a/src/meshlabserver/meshlabserver.pro b/src/meshlabserver/meshlabserver.pro index 4df0a6f0a..e97962a18 100644 --- a/src/meshlabserver/meshlabserver.pro +++ b/src/meshlabserver/meshlabserver.pro @@ -12,7 +12,7 @@ RESOURCES = ../meshlab/meshlab.qrc \ # to add windows icon RC_FILE = ../meshlab/meshlab.rc -QT += xml opengl +QT += xml opengl QT += xmlpatterns QT += script #QT -= gui # Only the core module is used. @@ -29,12 +29,8 @@ win32-msvc2010: LIBS += -L../distrib -lcommon -lopengl32 -lGLU32 win32-msvc2012: LIBS += -L../distrib -lcommon -lopengl32 -lGLU32 win32-msvc2015: LIBS += -L../distrib -lcommon -lopengl32 -lGLU32 win32-g++: LIBS += -L../distrib -lcommon -linux-g++: LIBS += -L../distrib -lcommon -linux-g++:QMAKE_RPATHDIR += ../distrib -linux-g++-32: LIBS += -L../distrib -lcommon -linux-g++-32:QMAKE_RPATHDIR += ../distrib -linux-g++-64: LIBS += -L../distrib -lcommon -linux-g++-64:QMAKE_RPATHDIR += ../distrib +linux: LIBS += -L../distrib -lcommon +linux:QMAKE_RPATHDIR += ../distrib #CONFIG (release,debug | release) { # win32-msvc2005:release: LIBS += -L../common/release -lcommon # win32-msvc2008:release: LIBS += -L../common/release -lcommon diff --git a/src/shared_post.pri b/src/shared_post.pri new file mode 100644 index 000000000..3d3f526c8 --- /dev/null +++ b/src/shared_post.pri @@ -0,0 +1,8 @@ +# This is + +exists( $${_PRO_FILE_PWD_}/$${TARGET}.xml ) { + +QMAKE_POST_LINK += $$QMAKE_COPY_FILE \"$${_PRO_FILE_PWD_}/$${TARGET}.xml\" \"../../distrib/plugins/$${TARGET}.xml\"; + +} +