diff --git a/src/common/common.pro b/src/common/common.pro index 9e3d9a46c..056734db7 100644 --- a/src/common/common.pro +++ b/src/common/common.pro @@ -78,6 +78,7 @@ INCLUDEPATH += . $$EXIF_DIR DEFINES += GLEW_STATIC win32-msvc2005:DEFINES += _CRT_SECURE_NO_WARNINGS win32-msvc2008:DEFINES += _CRT_SECURE_NO_WARNINGS +win32-msvc2010:DEFINES += _CRT_SECURE_NO_WARNINGS # Input @@ -120,6 +121,7 @@ macx64:LIBS += -L../external/lib/macx64 -ljhead win32-msvc.net:LIBS += ../external/lib/win32-msvc.net/jhead.lib win32-msvc2005:LIBS += ../external/lib/win32-msvc2005/jhead.lib win32-msvc2008:LIBS += ../external/lib/win32-msvc2008/jhead.lib +win32-msvc2010:LIBS += ../external/lib/win32-msvc2008/jhead.lib win32-g++:LIBS += -L../external/lib/win32-gcc -ljhead linux-g++:LIBS += -L../external/lib/linux-g++ -ljhead linux-g++-32:LIBS += -L../external/lib/linux-g++-32 -ljhead diff --git a/src/common/interfaces.h b/src/common/interfaces.h index 9a03b9ff9..d87766212 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -653,7 +653,7 @@ protected: #define MESH_RENDER_INTERFACE_IID "vcg.meshlab.MeshRenderInterface/1.0" #define MESH_DECORATE_INTERFACE_IID "vcg.meshlab.MeshDecorateInterface/1.0" #define MESH_EDIT_INTERFACE_IID "vcg.meshlab.MeshEditInterface/1.0" -#define MESH_IO_INTERFACE_FACTORY_IID "vcg.meshlab.MeshEditInterfaceFactory/1.0" +#define MESH_EDIT_INTERFACE_FACTORY_IID "vcg.meshlab.MeshEditInterfaceFactory/1.0" Q_DECLARE_INTERFACE(MeshIOInterface, MESH_IO_INTERFACE_IID) Q_DECLARE_INTERFACE(MeshFilterInterface, MESH_FILTER_INTERFACE_IID) @@ -661,6 +661,6 @@ Q_DECLARE_INTERFACE(MeshLabFilterInterface, MESHLAB_FILTER_INTERFACE_IID) Q_DECLARE_INTERFACE(MeshRenderInterface, MESH_RENDER_INTERFACE_IID) Q_DECLARE_INTERFACE(MeshDecorateInterface, MESH_DECORATE_INTERFACE_IID) Q_DECLARE_INTERFACE(MeshEditInterface, MESH_EDIT_INTERFACE_IID) -Q_DECLARE_INTERFACE(MeshEditInterfaceFactory, MESH_IO_INTERFACE_FACTORY_IID) +Q_DECLARE_INTERFACE(MeshEditInterfaceFactory, MESH_EDIT_INTERFACE_FACTORY_IID) #endif diff --git a/src/common/meshmodel.h b/src/common/meshmodel.h index 54c3276c8..b5eff6281 100644 --- a/src/common/meshmodel.h +++ b/src/common/meshmodel.h @@ -50,10 +50,8 @@ #include #include #include -#include #include "GLLogStream.h" #include "filterscript.h" -#include // Forward declarations needed for creating the used types class CVertexO; @@ -428,9 +426,9 @@ public: }; // end class RenderMode -class MeshLabRenderState : public QObject +class MeshLabRenderState //: public QObject { - Q_OBJECT + //Q_OBJECT public: MeshLabRenderState(); ~MeshLabRenderState(); diff --git a/src/common/scriptinterface.h b/src/common/scriptinterface.h index 4c1e4b9ae..39e6ac042 100644 --- a/src/common/scriptinterface.h +++ b/src/common/scriptinterface.h @@ -30,6 +30,7 @@ #include "meshmodel.h" #include "vcg/space/point3.h" + class ScriptAdapterGenerator { private: diff --git a/src/external/CoMISo/how_to_compile_with_vs.txt b/src/external/CoMISo/how_to_compile_with_vs.txt index 0c3a10c37..30a3ec8e5 100644 --- a/src/external/CoMISo/how_to_compile_with_vs.txt +++ b/src/external/CoMISo/how_to_compile_with_vs.txt @@ -1,11 +1,16 @@ + - if the GMM_INCLUDE_DIR tag is not presented in CMAKE set the gmm path by hand in cmake/FindGMM.cmake (for instance find_path( GMM_INCLUDE_DIR NAMES gmm/gmm.h PATHS $ENV{GMM_DIR}"d:\\code\\gmm-4.2\\include") ) - if EIGEN3 tag is not presented in CMAKE set the gmm path by hand in cmake/FindEIGEN3.cmake (for instance find_path( EIGEN3_INCLUDE_DIR NAMES Eigen/Dense PATHS $ENV{EIGEN_DIR}) ) +- change from dll to static lib. remove the COMISODLL preprocessor directive. remove properties->build events->post building event + - add to the linking path of the CoMISo project properties the static lib generated by GotoBLAS2 +- for test quadratic_solver remove COMISODLL preprocessor directive also from quadratic_solver project. + - to test the example included with CoMISo go to the example properties and change from Linker->System->SubSystem->Console - some tests will not compile \ No newline at end of file diff --git a/src/external/external.pro b/src/external/external.pro index 7a0e692dc..f60491e93 100644 --- a/src/external/external.pro +++ b/src/external/external.pro @@ -6,7 +6,7 @@ SUBDIRS = lib3ds-1.3.0/lib3ds \ bzip2-1.0.5/bzip2-1.0.5.pro \ muparser_v132/src \ levmar-2.3/levmar-2.3.pro \ -# structuresynth/structuresynth.pro \ + structuresynth/structuresynth.pro \ OpenCTM-1.0.3/openctm.pro \ jhead-2.95/jhead-2.95.pro # openkinect/openkinect.pro diff --git a/src/external/jhead-2.95/makefile b/src/external/jhead-2.95/makefile index 1a023ee7a..78b747019 100644 --- a/src/external/jhead-2.95/makefile +++ b/src/external/jhead-2.95/makefile @@ -1,23 +1,153 @@ -#-------------------------------- -# jhead makefile for Unix -#-------------------------------- -OBJ=. -SRC=. -CFLAGS= -O3 -Wall +############################################################################# +# Makefile for building: libjhead +# Generated by qmake (2.01a) (Qt 4.8.4) on: Sun 24. Mar 19:33:40 2013 +# Project: jhead-2.95.pro +# Template: lib +# Command: c:\Qt\4.8.4\bin\qmake.exe -spec c:\Qt\4.8.4\mkspecs\win32-g++ CONFIG+=declarative_debug -o Makefile jhead-2.95.pro +############################################################################# -all: jhead +first: debug +install: debug-install +uninstall: debug-uninstall +MAKEFILE = Makefile +QMAKE = c:\Qt\4.8.4\bin\qmake.exe +DEL_FILE = del +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir +COPY = copy /y +COPY_FILE = $(COPY) +COPY_DIR = xcopy /s /q /y /i +INSTALL_FILE = $(COPY_FILE) +INSTALL_PROGRAM = $(COPY_FILE) +INSTALL_DIR = $(COPY_DIR) +DEL_FILE = del +SYMLINK = +DEL_DIR = rmdir +MOVE = move +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir +SUBTARGETS = \ + debug \ + release -objs = $(OBJ)/jhead.o $(OBJ)/jpgfile.o $(OBJ)/paths.o \ - $(OBJ)/exif.o $(OBJ)/iptc.o $(OBJ)/gpsinfo.o $(OBJ)/makernote.o +debug: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug +debug-make_default: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug +debug-make_first: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug first +debug-all: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug all +debug-clean: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug clean +debug-distclean: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug distclean +debug-install: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug install +debug-uninstall: $(MAKEFILE).Debug FORCE + $(MAKE) -f $(MAKEFILE).Debug uninstall +release: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release +release-make_default: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release +release-make_first: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release first +release-all: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release all +release-clean: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release clean +release-distclean: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release distclean +release-install: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release install +release-uninstall: $(MAKEFILE).Release FORCE + $(MAKE) -f $(MAKEFILE).Release uninstall -$(OBJ)/%.o:$(SRC)/%.c - ${CC} $(CFLAGS) -c $< -o $@ +Makefile: jhead-2.95.pro c:/Qt/4.8.4/mkspecs/win32-g++/qmake.conf c:/Qt/4.8.4/mkspecs/features/device_config.prf \ + c:/Qt/4.8.4/mkspecs/qconfig.pri \ + c:/Qt/4.8.4/mkspecs/modules/qt_webkit_version.pri \ + c:/Qt/4.8.4/mkspecs/features/qt_functions.prf \ + c:/Qt/4.8.4/mkspecs/features/qt_config.prf \ + c:/Qt/4.8.4/mkspecs/features/exclusive_builds.prf \ + c:/Qt/4.8.4/mkspecs/features/default_pre.prf \ + c:/Qt/4.8.4/mkspecs/features/win32/default_pre.prf \ + ../ext_common.pri \ + c:/Qt/4.8.4/mkspecs/features/debug.prf \ + c:/Qt/4.8.4/mkspecs/features/debug_and_release.prf \ + c:/Qt/4.8.4/mkspecs/features/default_post.prf \ + c:/Qt/4.8.4/mkspecs/features/win32/default_post.prf \ + c:/Qt/4.8.4/mkspecs/features/staticlib.prf \ + c:/Qt/4.8.4/mkspecs/features/static.prf \ + c:/Qt/4.8.4/mkspecs/features/declarative_debug.prf \ + c:/Qt/4.8.4/mkspecs/features/win32/rtti.prf \ + c:/Qt/4.8.4/mkspecs/features/win32/exceptions.prf \ + c:/Qt/4.8.4/mkspecs/features/win32/stl.prf \ + c:/Qt/4.8.4/mkspecs/features/warn_on.prf \ + c:/Qt/4.8.4/mkspecs/features/qt.prf \ + c:/Qt/4.8.4/mkspecs/features/win32/thread.prf \ + c:/Qt/4.8.4/mkspecs/features/moc.prf \ + c:/Qt/4.8.4/mkspecs/features/win32/windows.prf \ + c:/Qt/4.8.4/mkspecs/features/resources.prf \ + c:/Qt/4.8.4/mkspecs/features/uic.prf \ + c:/Qt/4.8.4/mkspecs/features/yacc.prf \ + c:/Qt/4.8.4/mkspecs/features/lex.prf \ + c:/Qt/4.8.4/mkspecs/features/include_source_dir.prf + $(QMAKE) -spec c:\Qt\4.8.4\mkspecs\win32-g++ CONFIG+=declarative_debug -o Makefile jhead-2.95.pro +c:\Qt\4.8.4\mkspecs\features\device_config.prf: +c:\Qt\4.8.4\mkspecs\qconfig.pri: +c:\Qt\4.8.4\mkspecs\modules\qt_webkit_version.pri: +c:\Qt\4.8.4\mkspecs\features\qt_functions.prf: +c:\Qt\4.8.4\mkspecs\features\qt_config.prf: +c:\Qt\4.8.4\mkspecs\features\exclusive_builds.prf: +c:\Qt\4.8.4\mkspecs\features\default_pre.prf: +c:\Qt\4.8.4\mkspecs\features\win32\default_pre.prf: +..\ext_common.pri: +c:\Qt\4.8.4\mkspecs\features\debug.prf: +c:\Qt\4.8.4\mkspecs\features\debug_and_release.prf: +c:\Qt\4.8.4\mkspecs\features\default_post.prf: +c:\Qt\4.8.4\mkspecs\features\win32\default_post.prf: +c:\Qt\4.8.4\mkspecs\features\staticlib.prf: +c:\Qt\4.8.4\mkspecs\features\static.prf: +c:\Qt\4.8.4\mkspecs\features\declarative_debug.prf: +c:\Qt\4.8.4\mkspecs\features\win32\rtti.prf: +c:\Qt\4.8.4\mkspecs\features\win32\exceptions.prf: +c:\Qt\4.8.4\mkspecs\features\win32\stl.prf: +c:\Qt\4.8.4\mkspecs\features\warn_on.prf: +c:\Qt\4.8.4\mkspecs\features\qt.prf: +c:\Qt\4.8.4\mkspecs\features\win32\thread.prf: +c:\Qt\4.8.4\mkspecs\features\moc.prf: +c:\Qt\4.8.4\mkspecs\features\win32\windows.prf: +c:\Qt\4.8.4\mkspecs\features\resources.prf: +c:\Qt\4.8.4\mkspecs\features\uic.prf: +c:\Qt\4.8.4\mkspecs\features\yacc.prf: +c:\Qt\4.8.4\mkspecs\features\lex.prf: +c:\Qt\4.8.4\mkspecs\features\include_source_dir.prf: +qmake: qmake_all FORCE + @$(QMAKE) -spec c:\Qt\4.8.4\mkspecs\win32-g++ CONFIG+=declarative_debug -o Makefile jhead-2.95.pro -jhead: $(objs) jhead.h - ${CC} -o jhead $(objs) -lm +qmake_all: FORCE -clean: - rm -f $(objs) jhead +make_default: debug-make_default release-make_default FORCE +make_first: debug-make_first release-make_first FORCE +all: debug-all release-all FORCE +clean: debug-clean release-clean FORCE +distclean: debug-distclean release-distclean FORCE + -$(DEL_FILE) Makefile -install: - cp jhead ${DESTDIR}/usr/local/bin/ +check: first + +debug-mocclean: $(MAKEFILE).Debug + $(MAKE) -f $(MAKEFILE).Debug mocclean +release-mocclean: $(MAKEFILE).Release + $(MAKE) -f $(MAKEFILE).Release mocclean +mocclean: debug-mocclean release-mocclean + +debug-mocables: $(MAKEFILE).Debug + $(MAKE) -f $(MAKEFILE).Debug mocables +release-mocables: $(MAKEFILE).Release + $(MAKE) -f $(MAKEFILE).Release mocables +mocables: debug-mocables release-mocables +FORCE: + +$(MAKEFILE).Debug: Makefile +$(MAKEFILE).Release: Makefile diff --git a/src/external/qtsoap-2.7_1/src/qtsoap.cpp b/src/external/qtsoap-2.7_1/src/qtsoap.cpp index f3269d7a2..de978e000 100644 --- a/src/external/qtsoap-2.7_1/src/qtsoap.cpp +++ b/src/external/qtsoap-2.7_1/src/qtsoap.cpp @@ -3157,7 +3157,7 @@ void QtSoapHttpTransport::submitRequest(QtSoapMessage &request, const QString &p { QNetworkRequest networkReq; networkReq.setHeader(QNetworkRequest::ContentTypeHeader, QLatin1String("text/xml;charset=utf-8")); - networkReq.setRawHeader("SOAPAction", soapAction.toAscii()); + networkReq.setRawHeader("SOAPAction", soapAction.toUtf8().data()); url.setPath(path); networkReq.setUrl(url); diff --git a/src/external/structuresynth/structuresynth.pro b/src/external/structuresynth/structuresynth.pro index 8579b03a3..04284eaa8 100644 --- a/src/external/structuresynth/structuresynth.pro +++ b/src/external/structuresynth/structuresynth.pro @@ -117,6 +117,7 @@ macx:DESTDIR = ../lib/macx win32-g++:DESTDIR = ../lib/win32-gcc win32-msvc2005:DESTDIR = ../lib/win32-msvc2005 win32-msvc2008:DESTDIR = ../lib/win32-msvc2008 +win32-msvc2010:DESTDIR = ../lib/win32-msvc2010 linux-g++-32:DESTDIR = ../lib/linux-g++-32 linux-g++-64:DESTDIR = ../lib/linux-g++-64 linux-g++:DESTDIR = ../lib/linux-g++ diff --git a/src/meshlab/glarea.h b/src/meshlab/glarea.h index 52be13fef..b3208d830 100644 --- a/src/meshlab/glarea.h +++ b/src/meshlab/glarea.h @@ -36,42 +36,17 @@ #include #include -#include #include "../common/interfaces.h" #include "glarea_setting.h" #include "multiViewer_Container.h" +#include "snapshotsetting.h" #define SSHOT_BYTES_PER_PIXEL 4 enum LightingModel{LDOUBLE,LFANCY}; -class SnapshotSetting -{ -public: - QString outdir; - QString basename; - int counter; - int resolution; - bool transparentBackground; - bool snapAllLayers; - bool tiledSave; // if true all the tiles are saved as separated files and not joined. - bool addToRasters; - - SnapshotSetting() - { - outdir="."; - basename="snapshot"; - counter=0; - resolution=1; - transparentBackground=true; - snapAllLayers=false; - tiledSave=false; - addToRasters=false; - }; -}; - class MeshModel; class MainWindow; class GLArea : public QGLWidget diff --git a/src/meshlab/main.cpp b/src/meshlab/main.cpp index fdcebbd1a..c5ec45236 100644 --- a/src/meshlab/main.cpp +++ b/src/meshlab/main.cpp @@ -20,7 +20,6 @@ * for more details. * * * ****************************************************************************/ - #include #include #include "mainwindow.h" @@ -28,6 +27,7 @@ int main(int argc, char *argv[]) { + MeshLabApplication app(argc, argv); QLocale::setDefault(QLocale::C); QCoreApplication::setOrganizationName(MeshLabApplication::organization()); diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index d04efe880..46e8ffab5 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -2211,6 +2211,7 @@ bool MainWindow::importMesh(QString fileName) if(!prePar.isEmpty()) { GenericParamDialog preOpenDialog(this, &prePar, tr("Pre-Open Options")); + preOpenDialog.setFocus(); preOpenDialog.exec(); } int mask = 0; diff --git a/src/meshlab/meshlab.pro b/src/meshlab/meshlab.pro index 7cfc9d1a8..e5ad15cb5 100644 --- a/src/meshlab/meshlab.pro +++ b/src/meshlab/meshlab.pro @@ -30,6 +30,7 @@ HEADERS = ../common/interfaces.h \ xmlstdpardialog.h \ additionalgui.h \ xmlgeneratorgui.h \ + snapshotsetting.h \ $$VCGDIR/wrap/gui/trackball.h \ $$VCGDIR/wrap/gui/trackmode.h \ $$VCGDIR/wrap/gl/trimesh.h \ diff --git a/src/meshlab/saveSnapshotDialog.h b/src/meshlab/saveSnapshotDialog.h index 33bb70324..0ac229339 100644 --- a/src/meshlab/saveSnapshotDialog.h +++ b/src/meshlab/saveSnapshotDialog.h @@ -21,9 +21,9 @@ * * ****************************************************************************/ -#include "glarea.h" #include #include +#include "snapshotsetting.h" namespace Ui { diff --git a/src/meshlab_mini.pro b/src/meshlab_mini.pro index e8ef28ffe..37039d408 100644 --- a/src/meshlab_mini.pro +++ b/src/meshlab_mini.pro @@ -8,24 +8,39 @@ TEMPLATE = subdirs CONFIG += ordered -SUBDIRS = common \ # the common framework, used by all the plugins, - meshlab \ # the GUI framework - meshlabplugins/io_base\ # a few basic file formats (ply, obj, off), without this you cannot open anything + + # the common framework, used by all the plugins, +SUBDIRS = common \ + meshlab \ # the GUI framework + meshlabplugins/io_base\ # a few basic file formats (ply, obj, off), without this you cannot open anything + meshlabplugins/filter_meshing \ meshlabplugins/filter_mls \ # a few basic filtering operations, including the well know simplification + meshlabplugins/decorate_background \ + meshlabplugins/edit_align \ + meshlabplugins/edit_arc3D \ + meshlabplugins/edit_hole \ +# meshlabplugins/io_expe \ +# meshlabplugins/io_collada \ +#meshlabplugins/io_3ds \ +#meshlabplugins/io_u3d \ +#meshlabplugins/filter_poisson \ # # Next some other useful, but still easy to be compiled, plugins # Uncomment them if you succeed in compiling the above ones. # meshlabplugins/edit_select \ -# meshlabplugins/filter_create\ +# meshlabplugins/filter_create\ +# meshlabplugins/filter_mutualinfoxml \ +# meshlabplugins/decorate_background \ # meshlabplugins/filter_select \ # meshlabplugins/decorate_base \ # meshlabplugins/filter_colorize\ # meshlabplugins/filter_measure\ # meshlabplugins/filter_sampling\ # meshlabplugins/filter_layer\ +# meshlabplugins/filter_bnpts \ +# meshlabplugins/edit_manipulators \ # meshlabserver \ - # diff --git a/src/meshlabplugins/decorate_background/cubemap.cpp b/src/meshlabplugins/decorate_background/cubemap.cpp index aaca32234..2043ec8ad 100755 --- a/src/meshlabplugins/decorate_background/cubemap.cpp +++ b/src/meshlabplugins/decorate_background/cubemap.cpp @@ -78,7 +78,7 @@ void CICubeMap::DrawEnvCube(Matrix44f &tr) void CICubeMap::DrawEnvCubeOld(Matrix44f &tr) { - checkGLError::qDebug("DrawEnvCubeOld: start"); + checkGLError::debugInfo("DrawEnvCubeOld: start"); glMatrixMode(GL_MODELVIEW); glPushAttrib(GL_ENABLE_BIT|GL_CURRENT_BIT | GL_TEXTURE_BIT); @@ -112,7 +112,7 @@ void CICubeMap::DrawEnvCubeOld(Matrix44f &tr) glDepthMask(true); glPopMatrix(); glPopAttrib(); - checkGLError::qDebug("DrawEnvCubeOld: end"); + checkGLError::debugInfo("DrawEnvCubeOld: end"); } diff --git a/src/meshlabplugins/decorate_background/decorate_background.cpp b/src/meshlabplugins/decorate_background/decorate_background.cpp index ae1e569bf..dfa577c70 100644 --- a/src/meshlabplugins/decorate_background/decorate_background.cpp +++ b/src/meshlabplugins/decorate_background/decorate_background.cpp @@ -21,13 +21,10 @@ * * ****************************************************************************/ -#include - #include #include #include #include "decorate_background.h" -#include #include #include @@ -341,4 +338,4 @@ void DecorateBackgroundPlugin::DrawGriddedCube(MeshModel &m, const Box3f &bb, fl void DecorateBackgroundPlugin::setValue(QString name, vcg::Shotf val) {curShot=val;} -Q_EXPORT_PLUGIN(DecorateBackgroundPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(DecorateBackgroundPlugin) diff --git a/src/meshlabplugins/decorate_background/decorate_background.h b/src/meshlabplugins/decorate_background/decorate_background.h index 5415ea08c..7ff2a3fc7 100644 --- a/src/meshlabplugins/decorate_background/decorate_background.h +++ b/src/meshlabplugins/decorate_background/decorate_background.h @@ -40,6 +40,7 @@ New small samples class DecorateBackgroundPlugin : public QObject, public MeshDecorateInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_DECORATE_INTERFACE_IID) Q_INTERFACES(MeshDecorateInterface) QString decorationName(FilterIDType id) const; QString decorationInfo(FilterIDType id) const; diff --git a/src/meshlabplugins/decorate_background/decorate_background.pro b/src/meshlabplugins/decorate_background/decorate_background.pro index 7924b957d..eaca4e10d 100644 --- a/src/meshlabplugins/decorate_background/decorate_background.pro +++ b/src/meshlabplugins/decorate_background/decorate_background.pro @@ -1,7 +1,5 @@ include (../../shared.pri) -QT += opengl - HEADERS += decorate_background.h cubemap.h SOURCES += decorate_background.cpp\ diff --git a/src/meshlabplugins/decorate_base/decorate_base.cpp b/src/meshlabplugins/decorate_base/decorate_base.cpp index 7bedb1bf5..ee243b315 100644 --- a/src/meshlabplugins/decorate_base/decorate_base.cpp +++ b/src/meshlabplugins/decorate_base/decorate_base.cpp @@ -1364,7 +1364,7 @@ void ExtraMeshDecoratePlugin::DrawTexParam(MeshModel &m, GLArea *gla, QPainter * textureName = qPrintable(QString(m.cm.textures[0].c_str()))+QString(" "); //, QPainter *qDebug(qPrintable(textureName)); glLabel::render(painter,Point3f(0.0,-0.10,0.0),textureName); - checkGLError::qDebug("DrawTexParam"); + checkGLError::debugInfo("DrawTexParam"); drawQuotedLine(Point3d(0,0,0),Point3d(0,1,0),0,1,0.1,painter,qf,0,true); drawQuotedLine(Point3d(0,0,0),Point3d(1,0,0),0,1,0.1,painter,qf,90.0f); @@ -1477,4 +1477,4 @@ void ExtraMeshDecoratePlugin::initGlobalParameterSet(QAction *action, RichParame } -Q_EXPORT_PLUGIN(ExtraMeshDecoratePlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(ExtraMeshDecoratePlugin) diff --git a/src/meshlabplugins/decorate_base/decorate_base.h b/src/meshlabplugins/decorate_base/decorate_base.h index 16855099a..2f5bc95f0 100644 --- a/src/meshlabplugins/decorate_base/decorate_base.h +++ b/src/meshlabplugins/decorate_base/decorate_base.h @@ -34,6 +34,7 @@ typedef std::pair PointPC; // this type is used to ha class ExtraMeshDecoratePlugin : public QObject, public MeshDecorateInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_DECORATE_INTERFACE_IID) Q_INTERFACES(MeshDecorateInterface) QString decorationName(FilterIDType filter) const; QString decorationInfo(FilterIDType filter) const; diff --git a/src/meshlabplugins/decorate_base/decorate_base.pro b/src/meshlabplugins/decorate_base/decorate_base.pro index 13ed75e93..9ae38ab46 100644 --- a/src/meshlabplugins/decorate_base/decorate_base.pro +++ b/src/meshlabplugins/decorate_base/decorate_base.pro @@ -1,5 +1,5 @@ include (../../shared.pri) -QT += opengl + HEADERS += decorate_base.h \ colorhistogram.h \ $$VCGDIR/wrap/qt/gl_label.h diff --git a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp index ef738a8bd..ab24338ed 100644 --- a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp +++ b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp @@ -696,4 +696,4 @@ void DecorateRasterProjPlugin::decorateDoc( QAction *act, -Q_EXPORT_PLUGIN(DecorateRasterProjPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(DecorateRasterProjPlugin) diff --git a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h index 7ce7a101b..dc9afa34e 100644 --- a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h +++ b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h @@ -36,6 +36,7 @@ class DecorateRasterProjPlugin : public QObject, public MeshDecorateInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_DECORATE_INTERFACE_IID) Q_INTERFACES( MeshDecorateInterface ) diff --git a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.pro b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.pro index 16821a184..b16f31d47 100644 --- a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.pro +++ b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.pro @@ -1,6 +1,5 @@ include (../../shared.pri) -QT += opengl HEADERS += decorate_raster_proj.h \ $$VCGDIR/wrap/gui/trackball.h \ diff --git a/src/meshlabplugins/decorate_shadow/decorate_shader.h b/src/meshlabplugins/decorate_shadow/decorate_shader.h index 6a70195ae..d4064e29c 100644 --- a/src/meshlabplugins/decorate_shadow/decorate_shader.h +++ b/src/meshlabplugins/decorate_shadow/decorate_shader.h @@ -22,9 +22,17 @@ ****************************************************************************/ #ifndef DECORATE_SHADER_H #define DECORATE_SHADER_H -#include +#include +#include +#include +#include + +//#include #include -#include +//#include + + +class GLArea; #define BLUR_COEF 0.4 @@ -92,17 +100,10 @@ protected: * and returns false, otherwise returns true; * @return true if no errors happened during the setup, false otherwise. */ - bool initGlew(){ + bool initGlew() + { GLenum err = glewInit(); - if (!GLEW_OK == err){ - QMessageBox msgBox; - msgBox.setIcon(QMessageBox::Warning); - msgBox.setWindowTitle("GLEW init failure"); - msgBox.setText(QString("Init GLEW failed.")); - msgBox.exec(); - return false; - } - return true; + return (err == GLEW_OK); } /** @@ -110,16 +111,9 @@ protected: * it shows an allert message an returns false, otherwise returns true; * @return true if no errors happened during the setup, false otherwise. */ - bool initSetup(){ - if(!this->setup()){ - QMessageBox msgBox; - msgBox.setIcon(QMessageBox::Warning); - msgBox.setWindowTitle("FBO Setup failure"); - msgBox.setText(QString("Failed in creating a Frame Buffer Object.")); - msgBox.exec(); - return false; - } - return true; + bool initSetup() + { + return setup(); } /** diff --git a/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp b/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp index e5d997d72..e7c41c99a 100644 --- a/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp +++ b/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp @@ -119,4 +119,4 @@ void DecorateShadowPlugin::decorateDoc(QAction *action, MeshDocument &md, RichPa } } -Q_EXPORT_PLUGIN(DecorateShadowPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(DecorateShadowPlugin) diff --git a/src/meshlabplugins/decorate_shadow/decorate_shadow.h b/src/meshlabplugins/decorate_shadow/decorate_shadow.h index 28185881e..102c7c29c 100644 --- a/src/meshlabplugins/decorate_shadow/decorate_shadow.h +++ b/src/meshlabplugins/decorate_shadow/decorate_shadow.h @@ -35,6 +35,7 @@ class DecorateShadowPlugin : public QObject, public MeshDecorateInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_DECORATE_INTERFACE_IID) Q_INTERFACES(MeshDecorateInterface) enum { diff --git a/src/meshlabplugins/decorate_shadow/decorate_shadow.pro b/src/meshlabplugins/decorate_shadow/decorate_shadow.pro index 623eb7c1b..f89af543b 100644 --- a/src/meshlabplugins/decorate_shadow/decorate_shadow.pro +++ b/src/meshlabplugins/decorate_shadow/decorate_shadow.pro @@ -1,6 +1,5 @@ include (../../shared.pri) -QT += opengl HEADERS += decorate_shadow.h \ shadow_mapping.h \ diff --git a/src/meshlabplugins/decorate_shadow/shadow_mapping.cpp b/src/meshlabplugins/decorate_shadow/shadow_mapping.cpp index 5179b03dd..824d30702 100644 --- a/src/meshlabplugins/decorate_shadow/shadow_mapping.cpp +++ b/src/meshlabplugins/decorate_shadow/shadow_mapping.cpp @@ -21,10 +21,12 @@ * * ****************************************************************************/ +#include #include "decorate_shader.h" #include "shadow_mapping.h" #include + ShadowMapping::ShadowMapping(float intensity):DecorateShader() { this->_intensity=intensity; diff --git a/src/meshlabplugins/decorate_shadow/ssao.cpp b/src/meshlabplugins/decorate_shadow/ssao.cpp index 8163b0711..83b21ffa6 100644 --- a/src/meshlabplugins/decorate_shadow/ssao.cpp +++ b/src/meshlabplugins/decorate_shadow/ssao.cpp @@ -21,8 +21,11 @@ * * ****************************************************************************/ +#include #include "ssao.h" + #include + SSAO::SSAO(float radius):DecorateShader() { this->_radius = radius; diff --git a/src/meshlabplugins/decorate_shadow/variance_shadow_mapping.cpp b/src/meshlabplugins/decorate_shadow/variance_shadow_mapping.cpp index 0dcf2d808..c2b004f47 100644 --- a/src/meshlabplugins/decorate_shadow/variance_shadow_mapping.cpp +++ b/src/meshlabplugins/decorate_shadow/variance_shadow_mapping.cpp @@ -24,6 +24,8 @@ #include "decorate_shader.h" #include "variance_shadow_mapping.h" #include +#include + VarianceShadowMapping::VarianceShadowMapping(float intensity):ShadowMapping(intensity) { diff --git a/src/meshlabplugins/decorate_shadow/variance_shadow_mapping_blur.cpp b/src/meshlabplugins/decorate_shadow/variance_shadow_mapping_blur.cpp index cab73528c..e9f893ef3 100644 --- a/src/meshlabplugins/decorate_shadow/variance_shadow_mapping_blur.cpp +++ b/src/meshlabplugins/decorate_shadow/variance_shadow_mapping_blur.cpp @@ -21,6 +21,7 @@ * * ****************************************************************************/ +#include #include "decorate_shader.h" #include "variance_shadow_mapping_blur.h" #include diff --git a/src/meshlabplugins/edit_align/AlignPairDialog.h b/src/meshlabplugins/edit_align/AlignPairDialog.h index 4b1677e1e..ba55bf714 100644 --- a/src/meshlabplugins/edit_align/AlignPairDialog.h +++ b/src/meshlabplugins/edit_align/AlignPairDialog.h @@ -22,10 +22,12 @@ ****************************************************************************/ #include -#include -#include +#include +#include #include +#include #include +#include #include #include #include "AlignPairWidget.h" diff --git a/src/meshlabplugins/edit_align/align/AlignPair.h b/src/meshlabplugins/edit_align/align/AlignPair.h index c340a6194..eac44aa47 100644 --- a/src/meshlabplugins/edit_align/align/AlignPair.h +++ b/src/meshlabplugins/edit_align/align/AlignPair.h @@ -110,7 +110,7 @@ public: int FixFaceNum; int TotTime() { return I.back().Time-StartTime; } int IterTime(unsigned int i) const - { const int clock_per_ms = std::max(CLOCKS_PER_SEC / 1000,1); + { const int clock_per_ms = std::max(CLOCKS_PER_SEC / 1000,1); assert(i -#include - +#include #include "edit_align.h" #include "alignDialog.h" diff --git a/src/meshlabplugins/edit_align/alignDialog.h b/src/meshlabplugins/edit_align/alignDialog.h index 5e3514c1b..954d5c2bf 100644 --- a/src/meshlabplugins/edit_align/alignDialog.h +++ b/src/meshlabplugins/edit_align/alignDialog.h @@ -27,7 +27,8 @@ $Log: stdpardialog.cpp,v $ ****************************************************************************/ #ifndef ALIGN_DIALOG_H #define ALIGN_DIALOG_H -#include +#include +#include #include "meshtree.h" class GLArea; diff --git a/src/meshlabplugins/edit_align/edit_align.cpp b/src/meshlabplugins/edit_align/edit_align.cpp index 27aed96bd..52fcac926 100644 --- a/src/meshlabplugins/edit_align/edit_align.cpp +++ b/src/meshlabplugins/edit_align/edit_align.cpp @@ -24,7 +24,6 @@ History $Log: meshedit.cpp,v $ ****************************************************************************/ -#include #include #include "edit_align.h" diff --git a/src/meshlabplugins/edit_align/edit_align.h b/src/meshlabplugins/edit_align/edit_align.h index ce9f4d87e..fd1c7990d 100644 --- a/src/meshlabplugins/edit_align/edit_align.h +++ b/src/meshlabplugins/edit_align/edit_align.h @@ -24,7 +24,6 @@ #ifndef EditAlignPLUGIN_H #define EditAlignPLUGIN_H -#include #include #include "align/AlignPair.h" #include "align/OccupancyGrid.h" diff --git a/src/meshlabplugins/edit_align/edit_align.pro b/src/meshlabplugins/edit_align/edit_align.pro index 67f83c6eb..f5d81afc8 100644 --- a/src/meshlabplugins/edit_align/edit_align.pro +++ b/src/meshlabplugins/edit_align/edit_align.pro @@ -35,7 +35,7 @@ INCLUDEPATH += ../../external FORMS += alignDialog.ui TARGET = edit_align -QT += opengl + RESOURCES = edit_align.qrc release {DEFINES += NDEBUG} macx:QMAKE_CXX=g++ diff --git a/src/meshlabplugins/edit_align/edit_align_factory.cpp b/src/meshlabplugins/edit_align/edit_align_factory.cpp index 7e03580ab..48512271c 100644 --- a/src/meshlabplugins/edit_align/edit_align_factory.cpp +++ b/src/meshlabplugins/edit_align/edit_align_factory.cpp @@ -52,4 +52,4 @@ QString EditAlignFactory::getEditToolDescription(QAction *) return EditAlignPlugin::Info(); } -Q_EXPORT_PLUGIN(EditAlignFactory) +MESHLAB_PLUGIN_NAME_EXPORTER(EditAlignFactory) diff --git a/src/meshlabplugins/edit_align/edit_align_factory.h b/src/meshlabplugins/edit_align/edit_align_factory.h index e621b6198..2a4570d59 100644 --- a/src/meshlabplugins/edit_align/edit_align_factory.h +++ b/src/meshlabplugins/edit_align/edit_align_factory.h @@ -31,6 +31,7 @@ class EditAlignFactory : public QObject, public MeshEditInterfaceFactory { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) Q_INTERFACES(MeshEditInterfaceFactory) public: diff --git a/src/meshlabplugins/edit_arc3D/edit_arc3D.cpp b/src/meshlabplugins/edit_arc3D/edit_arc3D.cpp index 8a2cd1aa7..2e0012d13 100644 --- a/src/meshlabplugins/edit_arc3D/edit_arc3D.cpp +++ b/src/meshlabplugins/edit_arc3D/edit_arc3D.cpp @@ -25,7 +25,6 @@ $Log: meshedit.cpp,v $ ****************************************************************************/ #include -#include #include #include #include @@ -194,7 +193,6 @@ void EditArc3DPlugin::ExportPly() int tt2=clock(); this->Log(GLLogStream::SYSTEM,"** Mesh %i : Append in %i\n",selectedCount,tt2-tt1); - } } @@ -289,7 +287,7 @@ void EditArc3DPlugin::exportShotsToRasters() { if ((saveSelected==v3dImportDialog::EXPORT_ALL) || (qtw->isItemSelected(qtw->item(i,0)))) { - er.modelList[i].cam.Open(er.modelList[i].cameraName.toAscii()); + er.modelList[i].cam.Open(er.modelList[i].cameraName.toUtf8().data()); mm.Clear(); Point3f corr=er.modelList[i].TraCorrection(mm,subSampleVal*2,minCountVal,0); er.modelList[i].shot.Extrinsics.SetTra(er.modelList[i].shot.Extrinsics.Tra()-corr); @@ -613,8 +611,8 @@ bool Arc3DModel::BuildMesh(CMeshO &m, int subsampleFactor, int minCount, float m FloatImage depthImgf; CharImage countImgc; int ttt0=clock(); - depthImgf.Open(depthName.toAscii()); - countImgc.Open(countName.toAscii()); + depthImgf.Open(depthName.toUtf8().data()); + countImgc.Open(countName.toUtf8().data()); QImage TextureImg; TextureImg.load(textureName); @@ -661,7 +659,7 @@ bool Arc3DModel::BuildMesh(CMeshO &m, int subsampleFactor, int minCount, float m m.vn--; } - cam.Open(cameraName.toAscii()); + cam.Open(cameraName.toUtf8().data()); CMeshO::VertexIterator vi; Matrix33d Rinv= Inverse(cam.R); @@ -725,8 +723,8 @@ Point3f Arc3DModel::TraCorrection(CMeshO &m, int subsampleFactor, int minCount, { FloatImage depthImgf; CharImage countImgc; - depthImgf.Open(depthName.toAscii()); - countImgc.Open(countName.toAscii()); + depthImgf.Open(depthName.toUtf8().data()); + countImgc.Open(countName.toUtf8().data()); QImage TextureImg; TextureImg.load(textureName); @@ -762,7 +760,7 @@ Point3f Arc3DModel::TraCorrection(CMeshO &m, int subsampleFactor, int minCount, m.vn--; } - cam.Open(cameraName.toAscii()); + cam.Open(cameraName.toUtf8().data()); CMeshO::VertexIterator vi; Matrix33d Rinv= Inverse(cam.R); @@ -826,7 +824,7 @@ bool Arc3DModel::Init(QDomNode &node) FILE* lvcam; - lvcam = fopen(cameraName.toAscii(),"rb"); + lvcam = fopen(cameraName.toUtf8().data(),"rb"); // focus + image centers fscanf(lvcam,"%lf %lf %lf",&(cam[0]),&(cam[1]),&(cam[2])); diff --git a/src/meshlabplugins/edit_arc3D/edit_arc3D.h b/src/meshlabplugins/edit_arc3D/edit_arc3D.h index 0fdf906ea..3acdf9614 100644 --- a/src/meshlabplugins/edit_arc3D/edit_arc3D.h +++ b/src/meshlabplugins/edit_arc3D/edit_arc3D.h @@ -41,7 +41,7 @@ class EditArc3DPlugin : public QObject, public MeshEditInterface { Q_OBJECT - Q_INTERFACES(MeshEditInterface) + Q_INTERFACES(MeshEditInterface) public: EditArc3DPlugin(); diff --git a/src/meshlabplugins/edit_arc3D/edit_arc3D.pro b/src/meshlabplugins/edit_arc3D/edit_arc3D.pro index e317b9986..7c4377c47 100644 --- a/src/meshlabplugins/edit_arc3D/edit_arc3D.pro +++ b/src/meshlabplugins/edit_arc3D/edit_arc3D.pro @@ -26,11 +26,11 @@ SOURCES += edit_arc3D.cpp \ $$VCGDIR/wrap/ply/plylib.cpp TARGET = edit_arc3D -QT += xml RESOURCES = edit_arc3D.qrc win32-msvc2005:LIBS += ../../external/lib/win32-msvc2005/bz2.lib win32-msvc2008:LIBS += ../../external/lib/win32-msvc2008/bz2.lib +win32-msvc2010:LIBS += ../../external/lib/win32-msvc2010/bz2.lib win32-g++:LIBS += ../../external/lib/win32-gcc/libbz2.a linux-g++:LIBS += ../../external/lib/linux-g++/libbz2.a linux-g++-32:LIBS += ../../external/lib/linux-g++-32/libbz2.a @@ -38,6 +38,7 @@ linux-g++-64:LIBS += ../../external/lib/linux-g++-64/libbz2.a win32-msvc2005:INCLUDEPATH += ../../external/bzip2-1.0.5 win32-msvc2008:INCLUDEPATH += ../../external/bzip2-1.0.5 +win32-msvc2010:INCLUDEPATH += ../../external/bzip2-1.0.5 win32-g++:INCLUDEPATH += ../../external/bzip2-1.0.5 linux-g++:INCLUDEPATH += ../../external/bzip2-1.0.5 linux-g++-32:INCLUDEPATH += ../../external/bzip2-1.0.5 diff --git a/src/meshlabplugins/edit_arc3D/edit_arc3D_factory.cpp b/src/meshlabplugins/edit_arc3D/edit_arc3D_factory.cpp index 552c8a4f4..4c0ed086c 100644 --- a/src/meshlabplugins/edit_arc3D/edit_arc3D_factory.cpp +++ b/src/meshlabplugins/edit_arc3D/edit_arc3D_factory.cpp @@ -54,4 +54,4 @@ QString EditArc3DFactory::getEditToolDescription(QAction *) return EditArc3DPlugin::Info(); } -Q_EXPORT_PLUGIN(EditArc3DFactory) +MESHLAB_PLUGIN_NAME_EXPORTER(EditArc3DFactory) diff --git a/src/meshlabplugins/edit_arc3D/edit_arc3D_factory.h b/src/meshlabplugins/edit_arc3D/edit_arc3D_factory.h index 062005430..9234067bd 100644 --- a/src/meshlabplugins/edit_arc3D/edit_arc3D_factory.h +++ b/src/meshlabplugins/edit_arc3D/edit_arc3D_factory.h @@ -31,6 +31,7 @@ class EditArc3DFactory : public QObject, public MeshEditInterfaceFactory { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) Q_INTERFACES(MeshEditInterfaceFactory) public: diff --git a/src/meshlabplugins/edit_arc3D/maskImageWidget.cpp b/src/meshlabplugins/edit_arc3D/maskImageWidget.cpp index 6c615cefa..a735d310f 100644 --- a/src/meshlabplugins/edit_arc3D/maskImageWidget.cpp +++ b/src/meshlabplugins/edit_arc3D/maskImageWidget.cpp @@ -24,23 +24,23 @@ #include "maskImageWidget.h" #include "maskRenderWidget.h" #include "fillImage.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/meshlabplugins/edit_arc3D/maskImageWidget.h b/src/meshlabplugins/edit_arc3D/maskImageWidget.h index 71783cb25..b8c8ec126 100644 --- a/src/meshlabplugins/edit_arc3D/maskImageWidget.h +++ b/src/meshlabplugins/edit_arc3D/maskImageWidget.h @@ -25,7 +25,7 @@ #define __IO_MASK_IMAGE_WIDGET_INC__ -#include +#include namespace ui diff --git a/src/meshlabplugins/edit_arc3D/maskRenderWidget.cpp b/src/meshlabplugins/edit_arc3D/maskRenderWidget.cpp index 0d6960572..f15561311 100644 --- a/src/meshlabplugins/edit_arc3D/maskRenderWidget.cpp +++ b/src/meshlabplugins/edit_arc3D/maskRenderWidget.cpp @@ -22,17 +22,17 @@ ****************************************************************************/ #include "maskRenderWidget.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/src/meshlabplugins/edit_arc3D/maskRenderWidget.h b/src/meshlabplugins/edit_arc3D/maskRenderWidget.h index 1ebcd62cb..5c6aa6571 100644 --- a/src/meshlabplugins/edit_arc3D/maskRenderWidget.h +++ b/src/meshlabplugins/edit_arc3D/maskRenderWidget.h @@ -25,7 +25,7 @@ #define __IO_MASK_RENDER_WIDGET_INC__ -#include +#include namespace ui diff --git a/src/meshlabplugins/edit_arc3D/v3dImportDialog.cpp b/src/meshlabplugins/edit_arc3D/v3dImportDialog.cpp index 7cda36e51..516490633 100644 --- a/src/meshlabplugins/edit_arc3D/v3dImportDialog.cpp +++ b/src/meshlabplugins/edit_arc3D/v3dImportDialog.cpp @@ -21,7 +21,7 @@ * * ****************************************************************************/ #include -#include +#include #include #include "v3dImportDialog.h" @@ -167,7 +167,7 @@ void v3dImportDialog::setArc3DReconstruction(Arc3DReconstruction *_er) if(!QFile::exists(ThumbCntName)) { CharImage chi; - bool ret=chi.Open(er->modelList[i].countName.toAscii()); + bool ret=chi.Open(er->modelList[i].countName.toUtf8().data()); if(!ret) QMessageBox::warning(this,"Error in Thumb creation",QString("Unable to create '%1' from '%2'").arg(ThumbCntName,er->modelList[i].textureName)); CharImage::colorizedScaledToHeight(64,chi).save(ThumbCntName,"jpg"); diff --git a/src/meshlabplugins/edit_hole/edit_hole.cpp b/src/meshlabplugins/edit_hole/edit_hole.cpp index f74edff8c..a66de2dbc 100644 --- a/src/meshlabplugins/edit_hole/edit_hole.cpp +++ b/src/meshlabplugins/edit_hole/edit_hole.cpp @@ -21,7 +21,8 @@ * * ****************************************************************************/ -#include +#include +#include #include #include #include diff --git a/src/meshlabplugins/edit_hole/edit_hole.pro b/src/meshlabplugins/edit_hole/edit_hole.pro index 7dc3331a3..90aaed437 100644 --- a/src/meshlabplugins/edit_hole/edit_hole.pro +++ b/src/meshlabplugins/edit_hole/edit_hole.pro @@ -14,11 +14,7 @@ SOURCES = edit_hole_factory.cpp \ holeListModel.cpp TARGET = edit_hole - -QT += opengl RESOURCES = edit_hole.qrc FORMS = edit_hole.ui -QT += opengl - diff --git a/src/meshlabplugins/edit_hole/edit_hole_factory.cpp b/src/meshlabplugins/edit_hole/edit_hole_factory.cpp index 5b7aaad8a..57c407517 100644 --- a/src/meshlabplugins/edit_hole/edit_hole_factory.cpp +++ b/src/meshlabplugins/edit_hole/edit_hole_factory.cpp @@ -54,4 +54,4 @@ QString EditHoleFactory::getEditToolDescription(QAction *) return EditHolePlugin::Info(); } -Q_EXPORT_PLUGIN(EditHoleFactory) +MESHLAB_PLUGIN_NAME_EXPORTER(EditHoleFactory) diff --git a/src/meshlabplugins/edit_hole/edit_hole_factory.h b/src/meshlabplugins/edit_hole/edit_hole_factory.h index cd3e918c9..bc0ebb29b 100644 --- a/src/meshlabplugins/edit_hole/edit_hole_factory.h +++ b/src/meshlabplugins/edit_hole/edit_hole_factory.h @@ -25,12 +25,13 @@ #ifndef EditHoleFactoryPLUGIN_H #define EditHoleFactoryPLUGIN_H -#include + #include class EditHoleFactory : public QObject, public MeshEditInterfaceFactory { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) Q_INTERFACES(MeshEditInterfaceFactory) public: diff --git a/src/meshlabplugins/edit_hole/fillerDialog.h b/src/meshlabplugins/edit_hole/fillerDialog.h index c14e20dfd..9d0b993b1 100644 --- a/src/meshlabplugins/edit_hole/fillerDialog.h +++ b/src/meshlabplugins/edit_hole/fillerDialog.h @@ -24,9 +24,9 @@ #define FILLERDIALOG_H #include -#include -#include -#include +#include +#include +#include #include "ui_edit_hole.h" class FillerDialog : public QDockWidget diff --git a/src/meshlabplugins/edit_hole/holeListModel.cpp b/src/meshlabplugins/edit_hole/holeListModel.cpp index e46c151fa..934450e21 100644 --- a/src/meshlabplugins/edit_hole/holeListModel.cpp +++ b/src/meshlabplugins/edit_hole/holeListModel.cpp @@ -22,6 +22,7 @@ ****************************************************************************/ #include "holeListModel.h" +#include using namespace vcg; @@ -373,7 +374,7 @@ QModelIndex HoleListModel::index(int row, int column, const QModelIndex &/*paren { if(row >= (int)holesManager.holes.size()) return QModelIndex(); - return createIndex(row,column, 0); + return createIndex(row,column/*,0*/); } diff --git a/src/meshlabplugins/edit_hole/holeListModel.h b/src/meshlabplugins/edit_hole/holeListModel.h index ac9f2de8e..d00b7333d 100644 --- a/src/meshlabplugins/edit_hole/holeListModel.h +++ b/src/meshlabplugins/edit_hole/holeListModel.h @@ -25,7 +25,9 @@ #include #include -#include +#include +#include +#include #include #include "fgtHole.h" #include "fgtBridge.h" diff --git a/src/meshlabplugins/edit_manipulators/edit_manipulators.cpp b/src/meshlabplugins/edit_manipulators/edit_manipulators.cpp index 05cb6af2c..8a3b5013a 100644 --- a/src/meshlabplugins/edit_manipulators/edit_manipulators.cpp +++ b/src/meshlabplugins/edit_manipulators/edit_manipulators.cpp @@ -20,13 +20,13 @@ * for more details. * * * ****************************************************************************/ -#include #include #include "edit_manipulators.h" #include #include + using namespace vcg; EditManipulatorsPlugin::EditManipulatorsPlugin() diff --git a/src/meshlabplugins/edit_manipulators/edit_manipulators.pro b/src/meshlabplugins/edit_manipulators/edit_manipulators.pro index 481a53bda..2071b89f3 100644 --- a/src/meshlabplugins/edit_manipulators/edit_manipulators.pro +++ b/src/meshlabplugins/edit_manipulators/edit_manipulators.pro @@ -10,6 +10,4 @@ SOURCES = edit_manipulators_factory.cpp \ TARGET = edit_manipulators -QT += opengl - RESOURCES = edit_manipulators.qrc diff --git a/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.cpp b/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.cpp index 8f3313903..53b28ab9b 100644 --- a/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.cpp +++ b/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.cpp @@ -54,4 +54,4 @@ QString EditManipulatorsFactory::getEditToolDescription(QAction *) return EditManipulatorsPlugin::Info(); } -Q_EXPORT_PLUGIN(EditManipulatorsFactory) +MESHLAB_PLUGIN_NAME_EXPORTER(EditManipulatorsFactory) diff --git a/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.h b/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.h index 01ca11b2c..0af8668f2 100644 --- a/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.h +++ b/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.h @@ -31,6 +31,7 @@ class EditManipulatorsFactory : public QObject, public MeshEditInterfaceFactory { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) Q_INTERFACES(MeshEditInterfaceFactory) public: diff --git a/src/meshlabplugins/edit_measure/edit_measure.cpp b/src/meshlabplugins/edit_measure/edit_measure.cpp index 4dca7cb34..b4ee3a9c8 100644 --- a/src/meshlabplugins/edit_measure/edit_measure.cpp +++ b/src/meshlabplugins/edit_measure/edit_measure.cpp @@ -24,7 +24,6 @@ History $Log: editmeasure.cpp,v $ ****************************************************************************/ -#include #include #include "edit_measure.h" diff --git a/src/meshlabplugins/edit_measure/edit_measure.pro b/src/meshlabplugins/edit_measure/edit_measure.pro index 0565676fe..dd90e19d1 100644 --- a/src/meshlabplugins/edit_measure/edit_measure.pro +++ b/src/meshlabplugins/edit_measure/edit_measure.pro @@ -9,6 +9,4 @@ SOURCES = edit_measure_factory.cpp \ TARGET = edit_measure -QT += opengl - RESOURCES = edit_measure.qrc diff --git a/src/meshlabplugins/edit_measure/edit_measure_factory.cpp b/src/meshlabplugins/edit_measure/edit_measure_factory.cpp index 7109be2e1..f40b74944 100644 --- a/src/meshlabplugins/edit_measure/edit_measure_factory.cpp +++ b/src/meshlabplugins/edit_measure/edit_measure_factory.cpp @@ -54,4 +54,4 @@ QString EditMeasureFactory::getEditToolDescription(QAction *) return EditMeasurePlugin::Info(); } -Q_EXPORT_PLUGIN(EditMeasureFactory) +MESHLAB_PLUGIN_NAME_EXPORTER(EditMeasureFactory) diff --git a/src/meshlabplugins/edit_measure/edit_measure_factory.h b/src/meshlabplugins/edit_measure/edit_measure_factory.h index e5603ddc1..86e66317a 100644 --- a/src/meshlabplugins/edit_measure/edit_measure_factory.h +++ b/src/meshlabplugins/edit_measure/edit_measure_factory.h @@ -31,6 +31,7 @@ class EditMeasureFactory : public QObject, public MeshEditInterfaceFactory { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) Q_INTERFACES(MeshEditInterfaceFactory) public: diff --git a/src/meshlabplugins/edit_paint/cloneview.h b/src/meshlabplugins/edit_paint/cloneview.h index 0a819807b..f46710b40 100644 --- a/src/meshlabplugins/edit_paint/cloneview.h +++ b/src/meshlabplugins/edit_paint/cloneview.h @@ -19,85 +19,87 @@ * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * for more details. * * * -****************************************************************************/ - -#ifndef CLONEVIEW_H_ -#define CLONEVIEW_H_ - -#include - -class CloneView : public QGraphicsView -{ - Q_OBJECT - -private : - QPointF last_pos; - QPointF start_pos; - - QGraphicsItem * crosshair; - -public : - QGraphicsItem * scenegroup; - - CloneView(QWidget * parent) : QGraphicsView(parent) - { - setDragMode(QGraphicsView::NoDrag); setMouseTracking(false); - } - - virtual void mousePressEvent(QMouseEvent * event) { - start_pos = QPointF(event->pos()); - last_pos.setX(event->pos().x()); last_pos.setY(event->pos().y()); - - if (event->buttons() == Qt::RightButton) - emit positionReset(); - } - - virtual void mouseMoveEvent ( QMouseEvent * event) - { - if (!(event->buttons() & Qt::LeftButton)) return; - QGraphicsItem * item = itemAt(event->pos()); - if (item != NULL) - if (!crosshair->isAncestorOf(item)) item->moveBy(event->pos().x() - last_pos.x(), event->pos().y() - last_pos.y()); - last_pos.setX(event->pos().x()); last_pos.setY(event->pos().y()); - // emit positionChanged(last_pos.x() - start_pos.x(), last_pos.y() - start_pos.y()); - } - - virtual void mouseReleaseEvent ( QMouseEvent *) - { - emit positionChanged(last_pos.x() - start_pos.x(), last_pos.y() - start_pos.y()); - } - - virtual void wheelEvent(QWheelEvent *) - { - //ignore or move.. - } - - virtual void setScene(QGraphicsScene * scene) - { - QGraphicsView::setScene(scene); - - scenegroup = new QGraphicsItemGroup(NULL, scene); - crosshair = new QGraphicsItemGroup(scenegroup); - crosshair->setZValue(2); - QPen pen; - pen.setWidth(3); - pen.setColor(QColor(qRgb(255, 255, 255))); - QGraphicsItem * p = scene->addLine(0, 8, 0, -8, pen); - p->setParentItem(crosshair); - QGraphicsItem * c = scene->addLine(8, 0, -8, 0, pen); - c->setParentItem(p); p = c; - pen.setWidth(1); - pen.setColor(QColor(qRgb(0, 0, 0))); - c = scene->addLine(0, 8, 0, -8, pen); - c->setParentItem(p); p = c; - c = scene->addLine(8, 0, -8, 0, pen); - c->setParentItem(p); p = c; - } - -signals: - void positionChanged(double x, double y); - void positionReset(); - -}; - -#endif /*CLONEVIEW_H_*/ +****************************************************************************/ + +#ifndef CLONEVIEW_H_ +#define CLONEVIEW_H_ + +#include +#include +#include + +class CloneView : public QGraphicsView +{ + Q_OBJECT + +private : + QPointF last_pos; + QPointF start_pos; + + QGraphicsItem * crosshair; + +public : + QGraphicsItem * scenegroup; + + CloneView(QWidget * parent) : QGraphicsView(parent) + { + setDragMode(QGraphicsView::NoDrag); setMouseTracking(false); + } + + virtual void mousePressEvent(QMouseEvent * event) { + start_pos = QPointF(event->pos()); + last_pos.setX(event->pos().x()); last_pos.setY(event->pos().y()); + + if (event->buttons() == Qt::RightButton) + emit positionReset(); + } + + virtual void mouseMoveEvent ( QMouseEvent * event) + { + if (!(event->buttons() & Qt::LeftButton)) return; + QGraphicsItem * item = itemAt(event->pos()); + if (item != NULL) + if (!crosshair->isAncestorOf(item)) item->moveBy(event->pos().x() - last_pos.x(), event->pos().y() - last_pos.y()); + last_pos.setX(event->pos().x()); last_pos.setY(event->pos().y()); + // emit positionChanged(last_pos.x() - start_pos.x(), last_pos.y() - start_pos.y()); + } + + virtual void mouseReleaseEvent ( QMouseEvent *) + { + emit positionChanged(last_pos.x() - start_pos.x(), last_pos.y() - start_pos.y()); + } + + virtual void wheelEvent(QWheelEvent *) + { + //ignore or move.. + } + + virtual void setScene(QGraphicsScene * scene) + { + QGraphicsView::setScene(scene); + + scenegroup = new QGraphicsItemGroup(NULL/*, scene*/); + crosshair = new QGraphicsItemGroup(scenegroup); + crosshair->setZValue(2); + QPen pen; + pen.setWidth(3); + pen.setColor(QColor(qRgb(255, 255, 255))); + QGraphicsItem * p = scene->addLine(0, 8, 0, -8, pen); + p->setParentItem(crosshair); + QGraphicsItem * c = scene->addLine(8, 0, -8, 0, pen); + c->setParentItem(p); p = c; + pen.setWidth(1); + pen.setColor(QColor(qRgb(0, 0, 0))); + c = scene->addLine(0, 8, 0, -8, pen); + c->setParentItem(p); p = c; + c = scene->addLine(8, 0, -8, 0, pen); + c->setParentItem(p); p = c; + } + +signals: + void positionChanged(double x, double y); + void positionReset(); + +}; + +#endif /*CLONEVIEW_H_*/ diff --git a/src/meshlabplugins/edit_paint/colorframe.h b/src/meshlabplugins/edit_paint/colorframe.h index 02d2aa0b7..13544a764 100644 --- a/src/meshlabplugins/edit_paint/colorframe.h +++ b/src/meshlabplugins/edit_paint/colorframe.h @@ -1,7 +1,8 @@ #ifndef COLORFRAME_H_ #define COLORFRAME_H_ -#include +#include +#include /* *A simple widget that displays a color and allows the diff --git a/src/meshlabplugins/edit_paint/edit_paint.pro b/src/meshlabplugins/edit_paint/edit_paint.pro index 4a23cffd9..823426bb8 100644 --- a/src/meshlabplugins/edit_paint/edit_paint.pro +++ b/src/meshlabplugins/edit_paint/edit_paint.pro @@ -1,7 +1,5 @@ include (../../shared.pri) -QT += opengl - HEADERS = edit_paint_factory.h \ cloneview.h \ colorframe.h \ diff --git a/src/meshlabplugins/edit_paint/edit_paint_factory.cpp b/src/meshlabplugins/edit_paint/edit_paint_factory.cpp index 9a92b2ddb..0d101cceb 100644 --- a/src/meshlabplugins/edit_paint/edit_paint_factory.cpp +++ b/src/meshlabplugins/edit_paint/edit_paint_factory.cpp @@ -54,4 +54,4 @@ QString EditPaintFactory::getEditToolDescription(QAction *) return EditPaintPlugin::Info(); } -Q_EXPORT_PLUGIN(EditPaintFactory) +MESHLAB_PLUGIN_NAME_EXPORTER(EditPaintFactory) diff --git a/src/meshlabplugins/edit_paint/edit_paint_factory.h b/src/meshlabplugins/edit_paint/edit_paint_factory.h index 9a4443b07..b0cfa6034 100644 --- a/src/meshlabplugins/edit_paint/edit_paint_factory.h +++ b/src/meshlabplugins/edit_paint/edit_paint_factory.h @@ -31,6 +31,7 @@ class EditPaintFactory : public QObject, public MeshEditInterfaceFactory { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) Q_INTERFACES(MeshEditInterfaceFactory) public: diff --git a/src/meshlabplugins/edit_paint/paintbox.cpp b/src/meshlabplugins/edit_paint/paintbox.cpp index 2c41cc9b2..729cdf9f4 100644 --- a/src/meshlabplugins/edit_paint/paintbox.cpp +++ b/src/meshlabplugins/edit_paint/paintbox.cpp @@ -22,6 +22,7 @@ ****************************************************************************/ #include "paintbox.h" +#include Paintbox::Paintbox(QWidget * parent, Qt::WindowFlags flags) : QWidget(parent, flags) { diff --git a/src/meshlabplugins/edit_paint/paintbox.h b/src/meshlabplugins/edit_paint/paintbox.h index 96ed16601..acbbe22a0 100644 --- a/src/meshlabplugins/edit_paint/paintbox.h +++ b/src/meshlabplugins/edit_paint/paintbox.h @@ -28,6 +28,9 @@ #include #include +#include +#include +#include #include "ui_paintbox.h" /** diff --git a/src/meshlabplugins/edit_pickpoints/edit_pickpoints.pro b/src/meshlabplugins/edit_pickpoints/edit_pickpoints.pro index a55e899a8..6765b3321 100755 --- a/src/meshlabplugins/edit_pickpoints/edit_pickpoints.pro +++ b/src/meshlabplugins/edit_pickpoints/edit_pickpoints.pro @@ -20,5 +20,3 @@ FORMS += pickpointsDialog.ui TARGET = edit_pickpoints -QT += opengl -QT += xml diff --git a/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.cpp b/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.cpp index 3b5941f97..9fca5c26d 100644 --- a/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.cpp +++ b/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.cpp @@ -54,4 +54,4 @@ QString EditPickPointsFactory::getEditToolDescription(QAction *) return EditPickPointsPlugin::Info(); } -Q_EXPORT_PLUGIN(EditPickPointsFactory) +MESHLAB_PLUGIN_NAME_EXPORTER(EditPickPointsFactory) diff --git a/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.h b/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.h index d53e8d97c..eeb9f7747 100644 --- a/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.h +++ b/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.h @@ -31,6 +31,7 @@ class EditPickPointsFactory : public QObject, public MeshEditInterfaceFactory { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) Q_INTERFACES(MeshEditInterfaceFactory) public: diff --git a/src/meshlabplugins/edit_pickpoints/editpickpoints.cpp b/src/meshlabplugins/edit_pickpoints/editpickpoints.cpp index ecd250bfe..56be7064f 100644 --- a/src/meshlabplugins/edit_pickpoints/editpickpoints.cpp +++ b/src/meshlabplugins/edit_pickpoints/editpickpoints.cpp @@ -27,8 +27,6 @@ * @author Oscar Barney */ -#include - #include #include "editpickpoints.h" diff --git a/src/meshlabplugins/edit_pickpoints/pickpointsDialog.cpp b/src/meshlabplugins/edit_pickpoints/pickpointsDialog.cpp index aaf6feb04..27aece007 100644 --- a/src/meshlabplugins/edit_pickpoints/pickpointsDialog.cpp +++ b/src/meshlabplugins/edit_pickpoints/pickpointsDialog.cpp @@ -26,8 +26,7 @@ * @author Oscar Barney */ -#include - +#include #include #include diff --git a/src/meshlabplugins/edit_pickpoints/pickpointsDialog.h b/src/meshlabplugins/edit_pickpoints/pickpointsDialog.h index dc2a4b216..d157069b0 100644 --- a/src/meshlabplugins/edit_pickpoints/pickpointsDialog.h +++ b/src/meshlabplugins/edit_pickpoints/pickpointsDialog.h @@ -29,7 +29,7 @@ #ifndef PICKPOINTS_DIALOG_H #define PICKPOINTS_DIALOG_H -#include +#include #include #include diff --git a/src/meshlabplugins/edit_point/edit_point.cpp b/src/meshlabplugins/edit_point/edit_point.cpp index 24d5a94a2..13932f5cc 100644 --- a/src/meshlabplugins/edit_point/edit_point.cpp +++ b/src/meshlabplugins/edit_point/edit_point.cpp @@ -21,8 +21,6 @@ * * ****************************************************************************/ -#include - #include #include #include diff --git a/src/meshlabplugins/edit_point/edit_point.pro b/src/meshlabplugins/edit_point/edit_point.pro index 125e90e02..ef1874e18 100644 --- a/src/meshlabplugins/edit_point/edit_point.pro +++ b/src/meshlabplugins/edit_point/edit_point.pro @@ -13,7 +13,6 @@ SOURCES = \ TARGET = edit_point -QT += opengl RESOURCES = edit_point.qrc diff --git a/src/meshlabplugins/edit_point/edit_point_factory.cpp b/src/meshlabplugins/edit_point/edit_point_factory.cpp index e113b48eb..f9a678539 100644 --- a/src/meshlabplugins/edit_point/edit_point_factory.cpp +++ b/src/meshlabplugins/edit_point/edit_point_factory.cpp @@ -58,4 +58,4 @@ QString PointEditFactory::getEditToolDescription(QAction *) return EditPointPlugin::Info(); } -Q_EXPORT_PLUGIN(PointEditFactory) +MESHLAB_PLUGIN_NAME_EXPORTER(PointEditFactory) diff --git a/src/meshlabplugins/edit_point/edit_point_factory.h b/src/meshlabplugins/edit_point/edit_point_factory.h index 5644c8c57..6aa44d2c0 100644 --- a/src/meshlabplugins/edit_point/edit_point_factory.h +++ b/src/meshlabplugins/edit_point/edit_point_factory.h @@ -31,6 +31,7 @@ class PointEditFactory : public QObject, public MeshEditInterfaceFactory { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) Q_INTERFACES(MeshEditInterfaceFactory) public: diff --git a/src/meshlabplugins/edit_quality/edit_quality.pro b/src/meshlabplugins/edit_quality/edit_quality.pro index 5cf30568d..038abcb52 100644 --- a/src/meshlabplugins/edit_quality/edit_quality.pro +++ b/src/meshlabplugins/edit_quality/edit_quality.pro @@ -27,4 +27,3 @@ RESOURCES = qualitymapper.qrc FORMS = qualitymapperdialog.ui -QT += opengl diff --git a/src/meshlabplugins/edit_quality/edit_quality_factory.cpp b/src/meshlabplugins/edit_quality/edit_quality_factory.cpp index cef996964..4a29661e0 100644 --- a/src/meshlabplugins/edit_quality/edit_quality_factory.cpp +++ b/src/meshlabplugins/edit_quality/edit_quality_factory.cpp @@ -55,4 +55,4 @@ QString QualityMapperFactory::getEditToolDescription(QAction *) return QualityMapperPlugin::Info(); } -Q_EXPORT_PLUGIN(QualityMapperFactory) +MESHLAB_PLUGIN_NAME_EXPORTER(QualityMapperFactory) diff --git a/src/meshlabplugins/edit_quality/edit_quality_factory.h b/src/meshlabplugins/edit_quality/edit_quality_factory.h index 3f60cfea5..cae2391fc 100644 --- a/src/meshlabplugins/edit_quality/edit_quality_factory.h +++ b/src/meshlabplugins/edit_quality/edit_quality_factory.h @@ -31,6 +31,7 @@ class QualityMapperFactory : public QObject, public MeshEditInterfaceFactory { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) Q_INTERFACES(MeshEditInterfaceFactory) public: diff --git a/src/meshlabplugins/edit_quality/eqhandle.cpp b/src/meshlabplugins/edit_quality/eqhandle.cpp index 3943e123e..364d53bfc 100644 --- a/src/meshlabplugins/edit_quality/eqhandle.cpp +++ b/src/meshlabplugins/edit_quality/eqhandle.cpp @@ -28,6 +28,8 @@ FIRST RELEASE ****************************************************************************/ #include "eqhandle.h" +#include +#include EqHandle::EqHandle(CHART_INFO *environment_info, QColor color, QPointF position, EQUALIZER_HANDLE_TYPE type, EqHandle** handles, qreal* midHandlePercentilePosition, QDoubleSpinBox* spinbox, diff --git a/src/meshlabplugins/edit_quality/eqhandle.h b/src/meshlabplugins/edit_quality/eqhandle.h index e54c889ad..ba5bb3c87 100644 --- a/src/meshlabplugins/edit_quality/eqhandle.h +++ b/src/meshlabplugins/edit_quality/eqhandle.h @@ -31,6 +31,7 @@ FIRST RELEASE #define _EQHANDLE_H_ #include "handle.h" +#include enum EQUALIZER_HANDLE_TYPE { diff --git a/src/meshlabplugins/edit_quality/handle.cpp b/src/meshlabplugins/edit_quality/handle.cpp index e71a419b5..0f6097b5a 100644 --- a/src/meshlabplugins/edit_quality/handle.cpp +++ b/src/meshlabplugins/edit_quality/handle.cpp @@ -28,7 +28,7 @@ FIRST RELEASE ****************************************************************************/ #include "handle.h" - +#include Handle::Handle(CHART_INFO *environment_info, QColor color, QPointF position, int zOrder, int size ) : _chartInfo(environment_info) { diff --git a/src/meshlabplugins/edit_quality/qualitymapper.cpp b/src/meshlabplugins/edit_quality/qualitymapper.cpp index 511a0bb84..861241339 100644 --- a/src/meshlabplugins/edit_quality/qualitymapper.cpp +++ b/src/meshlabplugins/edit_quality/qualitymapper.cpp @@ -27,7 +27,6 @@ FIRST RELEASE ****************************************************************************/ -#include #include #include #include "qualitymapper.h" diff --git a/src/meshlabplugins/edit_quality/qualitymapperdialog.cpp b/src/meshlabplugins/edit_quality/qualitymapperdialog.cpp index f85501af1..4dfb667af 100644 --- a/src/meshlabplugins/edit_quality/qualitymapperdialog.cpp +++ b/src/meshlabplugins/edit_quality/qualitymapperdialog.cpp @@ -25,6 +25,8 @@ #include #include #include +#include +#include using namespace vcg; diff --git a/src/meshlabplugins/edit_quality/tfhandle.cpp b/src/meshlabplugins/edit_quality/tfhandle.cpp index 8a1a5a6f4..b0a579bb9 100644 --- a/src/meshlabplugins/edit_quality/tfhandle.cpp +++ b/src/meshlabplugins/edit_quality/tfhandle.cpp @@ -28,6 +28,7 @@ FIRST RELEASE ****************************************************************************/ #include "tfhandle.h" +#include //declaration of static member of TFHandle class TransferFunction* TFHandle::_tf = 0; diff --git a/src/meshlabplugins/edit_select/edit_select.pro b/src/meshlabplugins/edit_select/edit_select.pro index 2f336e649..05300b19b 100644 --- a/src/meshlabplugins/edit_select/edit_select.pro +++ b/src/meshlabplugins/edit_select/edit_select.pro @@ -8,7 +8,6 @@ SOURCES = edit_select_factory.cpp \ TARGET = edit_select -QT += opengl RESOURCES = edit_select.qrc diff --git a/src/meshlabplugins/edit_select/edit_select_factory.cpp b/src/meshlabplugins/edit_select/edit_select_factory.cpp index 137f072c8..3c9b699aa 100644 --- a/src/meshlabplugins/edit_select/edit_select_factory.cpp +++ b/src/meshlabplugins/edit_select/edit_select_factory.cpp @@ -62,4 +62,4 @@ QString EditSelectFactory::getEditToolDescription(QAction */*a*/) return EditSelectPlugin::Info(); } -Q_EXPORT_PLUGIN(EditSelectFactory) +MESHLAB_PLUGIN_NAME_EXPORTER(EditSelectFactory) diff --git a/src/meshlabplugins/edit_select/edit_select_factory.h b/src/meshlabplugins/edit_select/edit_select_factory.h index 51b87e3ba..f53084090 100644 --- a/src/meshlabplugins/edit_select/edit_select_factory.h +++ b/src/meshlabplugins/edit_select/edit_select_factory.h @@ -30,6 +30,7 @@ class EditSelectFactory : public QObject, public MeshEditInterfaceFactory { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) Q_INTERFACES(MeshEditInterfaceFactory) public: diff --git a/src/meshlabplugins/edit_slice/edit_slice_factory.cpp b/src/meshlabplugins/edit_slice/edit_slice_factory.cpp index a18fc83a0..de5cf301e 100644 --- a/src/meshlabplugins/edit_slice/edit_slice_factory.cpp +++ b/src/meshlabplugins/edit_slice/edit_slice_factory.cpp @@ -54,4 +54,4 @@ QString EditSliceFactory::getEditToolDescription(QAction *) return ExtraMeshSlidePlugin::Info(); } -Q_EXPORT_PLUGIN(EditSliceFactory) + MESHLAB_PLUGIN_NAME_EXPORTER(EditSliceFactory) diff --git a/src/meshlabplugins/edit_slice/edit_slice_factory.h b/src/meshlabplugins/edit_slice/edit_slice_factory.h index eabdc5207..ff8c26d41 100644 --- a/src/meshlabplugins/edit_slice/edit_slice_factory.h +++ b/src/meshlabplugins/edit_slice/edit_slice_factory.h @@ -30,6 +30,7 @@ class EditSliceFactory : public QObject, public MeshEditInterfaceFactory { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) Q_INTERFACES(MeshEditInterfaceFactory) public: diff --git a/src/meshlabplugins/edit_slice/editslice.h b/src/meshlabplugins/edit_slice/editslice.h index 9761be201..a13dbb3d5 100644 --- a/src/meshlabplugins/edit_slice/editslice.h +++ b/src/meshlabplugins/edit_slice/editslice.h @@ -60,6 +60,7 @@ typedef vcg::edg::io::SVGProperties SVGProperties; class ExtraMeshSlidePlugin : public QObject, public MeshEditInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_IID) Q_INTERFACES(MeshEditInterface) public: diff --git a/src/meshlabplugins/edit_slice/editslice.pro b/src/meshlabplugins/edit_slice/editslice.pro index 500e7be32..539333af0 100644 --- a/src/meshlabplugins/edit_slice/editslice.pro +++ b/src/meshlabplugins/edit_slice/editslice.pro @@ -14,6 +14,5 @@ SOURCES = edit_slice_factory.cpp \ TARGET = editslice -QT += opengl RESOURCES = meshlab.qrc FORMS = slicedialog.ui svgpro.ui diff --git a/src/meshlabplugins/edit_texture/edit_texture.pro b/src/meshlabplugins/edit_texture/edit_texture.pro index b91b2e242..de0f183c1 100644 --- a/src/meshlabplugins/edit_texture/edit_texture.pro +++ b/src/meshlabplugins/edit_texture/edit_texture.pro @@ -15,7 +15,6 @@ SOURCES = edit_texture_factory.cpp \ TARGET = edit_texture -QT += opengl RESOURCES = meshlab.qrc FORMS = textureeditor.ui diff --git a/src/meshlabplugins/edit_texture/edit_texture_factory.cpp b/src/meshlabplugins/edit_texture/edit_texture_factory.cpp index 042802eaa..c62bd5183 100644 --- a/src/meshlabplugins/edit_texture/edit_texture_factory.cpp +++ b/src/meshlabplugins/edit_texture/edit_texture_factory.cpp @@ -54,4 +54,4 @@ QString EditTextureFactory::getEditToolDescription(QAction *) return EditTexturePlugin::Info(); } -Q_EXPORT_PLUGIN(EditTextureFactory) +MESHLAB_PLUGIN_NAME_EXPORTER(EditTextureFactory) diff --git a/src/meshlabplugins/edit_texture/edit_texture_factory.h b/src/meshlabplugins/edit_texture/edit_texture_factory.h index 6f3ce6c55..ffde752e7 100644 --- a/src/meshlabplugins/edit_texture/edit_texture_factory.h +++ b/src/meshlabplugins/edit_texture/edit_texture_factory.h @@ -31,6 +31,7 @@ class EditTextureFactory : public QObject, public MeshEditInterfaceFactory { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) Q_INTERFACES(MeshEditInterfaceFactory) public: diff --git a/src/meshlabplugins/edit_texture/edittexture.cpp b/src/meshlabplugins/edit_texture/edittexture.cpp index 6f729aa7d..90a59ae3a 100644 --- a/src/meshlabplugins/edit_texture/edittexture.cpp +++ b/src/meshlabplugins/edit_texture/edittexture.cpp @@ -29,6 +29,7 @@ #include #include +#include using namespace vcg; diff --git a/src/meshlabplugins/edit_texture/edittexture.h b/src/meshlabplugins/edit_texture/edittexture.h index 74c024077..ef0c9f992 100644 --- a/src/meshlabplugins/edit_texture/edittexture.h +++ b/src/meshlabplugins/edit_texture/edittexture.h @@ -28,6 +28,8 @@ #include "textureeditor.h" #include "ui_textureeditor.h" +class QDockWidget; + class EditTexturePlugin : public QObject, public MeshEditInterface { Q_OBJECT diff --git a/src/meshlabplugins/edit_texture/renderarea.cpp b/src/meshlabplugins/edit_texture/renderarea.cpp index a2a422ada..20a4ea0b7 100644 --- a/src/meshlabplugins/edit_texture/renderarea.cpp +++ b/src/meshlabplugins/edit_texture/renderarea.cpp @@ -21,8 +21,6 @@ * * ****************************************************************************/ - -#include #include "renderarea.h" #include "textureeditor.h" #include diff --git a/src/meshlabplugins/filter_aging/filter_aging.cpp b/src/meshlabplugins/filter_aging/filter_aging.cpp index 96ceb1b68..d0127e8c3 100644 --- a/src/meshlabplugins/filter_aging/filter_aging.cpp +++ b/src/meshlabplugins/filter_aging/filter_aging.cpp @@ -403,4 +403,4 @@ void GeometryAgingPlugin::computeMeanCurvature(CMeshO &m) } -Q_EXPORT_PLUGIN(GeometryAgingPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(GeometryAgingPlugin) diff --git a/src/meshlabplugins/filter_aging/filter_aging.h b/src/meshlabplugins/filter_aging/filter_aging.h index 32913d2e2..2262a1b4c 100644 --- a/src/meshlabplugins/filter_aging/filter_aging.h +++ b/src/meshlabplugins/filter_aging/filter_aging.h @@ -35,6 +35,7 @@ class GeometryAgingPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_ao/filter_ao.cpp b/src/meshlabplugins/filter_ao/filter_ao.cpp index 29a7d0e3f..a9dfbc716 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.cpp +++ b/src/meshlabplugins/filter_ao/filter_ao.cpp @@ -182,7 +182,7 @@ bool AmbientOcclusionPlugin::processGL(MeshModel &m, vector &posVect) if (errInit) return false; - checkGLError::qDebug("start"); + checkGLError::debugInfo("start"); int tInitElapsed = 0; QTime tInit, tAll; tInit.start(); @@ -268,7 +268,7 @@ bool AmbientOcclusionPlugin::processGL(MeshModel &m, vector &posVect) if(perFace) generateFaceOcclusionSW(m,faceCenterVec); else generateOcclusionSW(m); } - checkGLError::qDebug("Debug"); + checkGLError::debugInfo("Debug"); } if (useGPU) @@ -886,4 +886,4 @@ void AmbientOcclusionPlugin::dumpFloatTexture(QString filename, float *texdata, delete [] cdata; } -Q_EXPORT_PLUGIN(AmbientOcclusionPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(AmbientOcclusionPlugin) diff --git a/src/meshlabplugins/filter_ao/filter_ao.pro b/src/meshlabplugins/filter_ao/filter_ao.pro index 32945dc78..19504fe2a 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.pro +++ b/src/meshlabplugins/filter_ao/filter_ao.pro @@ -1,7 +1,6 @@ include (../../shared.pri) TARGET = filter_ao -QT += opengl HEADERS += ./filter_ao.h SOURCES += ./filter_ao.cpp diff --git a/src/meshlabplugins/filter_autoalign/filter_autoalign.cpp b/src/meshlabplugins/filter_autoalign/filter_autoalign.cpp index 97cf1f125..ed836a6e6 100644 --- a/src/meshlabplugins/filter_autoalign/filter_autoalign.cpp +++ b/src/meshlabplugins/filter_autoalign/filter_autoalign.cpp @@ -165,4 +165,4 @@ FilterAutoalign::FilterClass FilterAutoalign::getClass(QAction *a) } } -Q_EXPORT_PLUGIN(FilterAutoalign) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterAutoalign) diff --git a/src/meshlabplugins/filter_autoalign/filter_autoalign.h b/src/meshlabplugins/filter_autoalign/filter_autoalign.h index bf07fff71..3e3c75a9e 100644 --- a/src/meshlabplugins/filter_autoalign/filter_autoalign.h +++ b/src/meshlabplugins/filter_autoalign/filter_autoalign.h @@ -31,6 +31,7 @@ class FilterAutoalign : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_bnpts/filter_bnpts.cpp b/src/meshlabplugins/filter_bnpts/filter_bnpts.cpp index 33abefaf8..9aa645079 100644 --- a/src/meshlabplugins/filter_bnpts/filter_bnpts.cpp +++ b/src/meshlabplugins/filter_bnpts/filter_bnpts.cpp @@ -156,4 +156,4 @@ FilterBnptsPlugin::FilterClass FilterBnptsPlugin::getClass(QAction *a) } } -Q_EXPORT_PLUGIN(FilterBnptsPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterBnptsPlugin) diff --git a/src/meshlabplugins/filter_bnpts/filter_bnpts.h b/src/meshlabplugins/filter_bnpts/filter_bnpts.h index 3406d26df..320c5f848 100644 --- a/src/meshlabplugins/filter_bnpts/filter_bnpts.h +++ b/src/meshlabplugins/filter_bnpts/filter_bnpts.h @@ -31,6 +31,7 @@ class FilterBnptsPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_camera/filter_camera.cpp b/src/meshlabplugins/filter_camera/filter_camera.cpp index 0a70493c5..93b781c06 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.cpp +++ b/src/meshlabplugins/filter_camera/filter_camera.cpp @@ -541,4 +541,4 @@ int FilterCameraPlugin::postCondition(QAction * filter) const assert(0); } -Q_EXPORT_PLUGIN(FilterCameraPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterCameraPlugin) diff --git a/src/meshlabplugins/filter_camera/filter_camera.h b/src/meshlabplugins/filter_camera/filter_camera.h index 82a42c58f..168394e26 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.h +++ b/src/meshlabplugins/filter_camera/filter_camera.h @@ -31,6 +31,7 @@ class FilterCameraPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_clean/cleanfilter.cpp b/src/meshlabplugins/filter_clean/cleanfilter.cpp index 4b5989b21..7db6e40f4 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.cpp +++ b/src/meshlabplugins/filter_clean/cleanfilter.cpp @@ -22,10 +22,9 @@ ****************************************************************************/ #include -#include -#include -#include -#include +#include +#include +#include #include "cleanfilter.h" #include "align_tools.h" @@ -536,4 +535,4 @@ int SnapVertexBorder(CMeshO &m, float threshold, vcg::CallBackPos * cb) return total; } -Q_EXPORT_PLUGIN(CleanFilter) +MESHLAB_PLUGIN_NAME_EXPORTER(CleanFilter) diff --git a/src/meshlabplugins/filter_clean/cleanfilter.h b/src/meshlabplugins/filter_clean/cleanfilter.h index a9143dd42..77d38b35a 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.h +++ b/src/meshlabplugins/filter_clean/cleanfilter.h @@ -30,6 +30,7 @@ class CleanFilter : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_clean/filter_clean.pro b/src/meshlabplugins/filter_clean/filter_clean.pro index 33d053a45..21c129e96 100644 --- a/src/meshlabplugins/filter_clean/filter_clean.pro +++ b/src/meshlabplugins/filter_clean/filter_clean.pro @@ -6,4 +6,3 @@ SOURCES += cleanfilter.cpp TARGET = filter_clean -QT += xml diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp index fa0e13abc..487e8a98c 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp @@ -21,7 +21,6 @@ * * ****************************************************************************/ -#include #include #include @@ -1044,4 +1043,4 @@ int FilterColorProjectionPlugin::calculateNearFarAccurate(MeshDocument &md, std: -Q_EXPORT_PLUGIN(FilterColorProjectionPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterColorProjectionPlugin) diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.h b/src/meshlabplugins/filter_color_projection/filter_color_projection.h index f535ec58d..9b02c9db8 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.h +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.h @@ -30,6 +30,7 @@ class FilterColorProjectionPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_color_projection/floatbuffer.cpp b/src/meshlabplugins/filter_color_projection/floatbuffer.cpp index edcbe0ddd..21a79c2a6 100644 --- a/src/meshlabplugins/filter_color_projection/floatbuffer.cpp +++ b/src/meshlabplugins/filter_color_projection/floatbuffer.cpp @@ -323,7 +323,7 @@ int floatbuffer::dumppfm(QString filename) { FILE* miofile; - miofile = fopen(filename.toAscii(), "wb"); + miofile = fopen(filename.toUtf8().data(), "wb"); int res; diff --git a/src/meshlabplugins/filter_color_projection/render_helper.cpp b/src/meshlabplugins/filter_color_projection/render_helper.cpp index 602584748..1d766db8c 100644 --- a/src/meshlabplugins/filter_color_projection/render_helper.cpp +++ b/src/meshlabplugins/filter_color_projection/render_helper.cpp @@ -351,13 +351,13 @@ GLuint RenderHelper::createShaderFromFiles(QString name) QString vert = "shaders/" + name + ".vert"; QString frag = "shaders/" + name + ".frag"; - const char *vs_src = ShaderUtils::importShaders(vert.toAscii().data()); + const char *vs_src = ShaderUtils::importShaders(vert.toUtf8().data()); if(!vs_src) { cerr << "Could not load shader: " << qPrintable(vert) << endl; return 0; } - const char *fs_src = ShaderUtils::importShaders(frag.toAscii().data()); + const char *fs_src = ShaderUtils::importShaders(frag.toUtf8().data()); if(!fs_src) { cerr << "Could not load shader: " << qPrintable(frag) << endl; return 0; diff --git a/src/meshlabplugins/filter_colorize/meshcolorize.cpp b/src/meshlabplugins/filter_colorize/meshcolorize.cpp index 9ad032348..182be744a 100644 --- a/src/meshlabplugins/filter_colorize/meshcolorize.cpp +++ b/src/meshlabplugins/filter_colorize/meshcolorize.cpp @@ -504,5 +504,5 @@ int ExtraMeshColorizePlugin::postCondition( QAction* a ) const{ } } -Q_EXPORT_PLUGIN(ExtraMeshColorizePlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(ExtraMeshColorizePlugin) diff --git a/src/meshlabplugins/filter_colorize/meshcolorize.h b/src/meshlabplugins/filter_colorize/meshcolorize.h index eb93d43f6..23184e5fa 100644 --- a/src/meshlabplugins/filter_colorize/meshcolorize.h +++ b/src/meshlabplugins/filter_colorize/meshcolorize.h @@ -30,6 +30,7 @@ class ExtraMeshColorizePlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp index 9a12446d6..aeb5b2af6 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp @@ -480,4 +480,4 @@ int FilterColorProc::getPreConditions( QAction * filter ) const } } -Q_EXPORT_PLUGIN(FilterColorProc) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterColorProc) diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.h b/src/meshlabplugins/filter_colorproc/filter_colorproc.h index 4d0bfb4f5..a4aa60024 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.h +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.h @@ -31,6 +31,7 @@ class FilterColorProc : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.pro b/src/meshlabplugins/filter_colorproc/filter_colorproc.pro index d1cbad433..790b605c7 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.pro +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.pro @@ -1,7 +1,5 @@ include (../../shared.pri) -QT += opengl - HEADERS += filter_colorproc.h SOURCES += filter_colorproc.cpp diff --git a/src/meshlabplugins/filter_create/filter_create.cpp b/src/meshlabplugins/filter_create/filter_create.cpp index 1f8cb8a49..938068ac8 100644 --- a/src/meshlabplugins/filter_create/filter_create.cpp +++ b/src/meshlabplugins/filter_create/filter_create.cpp @@ -243,4 +243,4 @@ QString FilterCreate::filterScriptFunctionName( FilterIDType filterID ) } -Q_EXPORT_PLUGIN(FilterCreate) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterCreate) diff --git a/src/meshlabplugins/filter_create/filter_create.h b/src/meshlabplugins/filter_create/filter_create.h index 8ef878af5..9871f9be1 100644 --- a/src/meshlabplugins/filter_create/filter_create.h +++ b/src/meshlabplugins/filter_create/filter_create.h @@ -28,6 +28,7 @@ class FilterCreate : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_csg/filter_csg.cpp b/src/meshlabplugins/filter_csg/filter_csg.cpp index de85a5962..1c6fbed82 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.cpp +++ b/src/meshlabplugins/filter_csg/filter_csg.cpp @@ -190,4 +190,4 @@ bool FilterCSG::applyFilter(QAction *filter, MeshDocument &md, RichParameterSet } -Q_EXPORT_PLUGIN(FilterCSG) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterCSG) diff --git a/src/meshlabplugins/filter_csg/filter_csg.h b/src/meshlabplugins/filter_csg/filter_csg.h index 26a3f4b04..f24622091 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.h +++ b/src/meshlabplugins/filter_csg/filter_csg.h @@ -35,6 +35,7 @@ class FilterCSG : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) enum { diff --git a/src/meshlabplugins/filter_csg/filter_csg.pro b/src/meshlabplugins/filter_csg/filter_csg.pro index e1e1f0650..a6be446e8 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.pro +++ b/src/meshlabplugins/filter_csg/filter_csg.pro @@ -10,8 +10,10 @@ TARGET = filter_csg macx:INCLUDEPATH += ../../external/inc/macx64/mpir-2.4.0 win32-g++:INCLUDEPATH += ../../external/inc/win32-gcc/mpir-2.2.1 win32-msvc2008:INCLUDEPATH += ../../external/inc/win32-msvc2008/mpir-2.2.1_x64 +win32-msvc2010:INCLUDEPATH += ../../external/inc/win32-msvc2008/mpir-2.2.1_x64 #macx:LIBS += ../../external/lib/macx/libmpirxx.a ../../external/lib/macx/libgmp.a macx:LIBS += $$MACLIBDIR/libmpirxx.a $$MACLIBDIR/libmpir.a win32-g++:LIBS += ../../external/lib/win32-gcc/libmpirxx.a ../../external/lib/win32-gcc/libmpir.a win32-msvc2008:LIBS += ../../external/lib/win32-msvc2008/mpirxx.lib ../../external/lib/win32-msvc2008/mpir.lib +win32-msvc2010:LIBS += ../../external/lib/win32-msvc2008/mpirxx.lib ../../external/lib/win32-msvc2008/mpir.lib diff --git a/src/meshlabplugins/filter_csg/intercept.h b/src/meshlabplugins/filter_csg/intercept.h index e42dfc413..e724d0b37 100644 --- a/src/meshlabplugins/filter_csg/intercept.h +++ b/src/meshlabplugins/filter_csg/intercept.h @@ -1,984 +1,998 @@ -#ifndef INTERCEPT_H -#define INTERCEPT_H - -#include -#include -#ifdef _MSC_VER - #include - #include -#else - #include - #include -#endif - -#include -#include -#include -#include - -#define p2print(point) ((point).X()) << ", " << ((point).Y()) -#define p3print(point) p2print(point) << ", " << ((point).Z()) - -namespace std { - namespace tr1 { - template <> - struct hash : public std::unary_function - { - std::size_t operator()(const vcg::Point3i &x) const - { - std::tr1::hash h; - return ((x[0]) * 131 + h(x[1])) * 131 + h(x[2]); - } - }; - - } -} - -/* - This header contains an implementation of "Marching Intersections" - For more details on this technique, see: - C. Rocchini, P. Cignoni, F. Ganovelli, C. Montani, P. Pingi and R.Scopigno, - 'Marching Intersections: an Efficient Resampling Algorithm for Surface Management' - In Proceedings of Shape Modeling International (SMI) 2001 - - This technique is used to create a volume representation where CSG operations are simple. - - Given a mesh, InterceptSet3 "rasterizes" it by computing all the intersections between - the mesh and 3 orthogonal families of lines (and storing them in the InterceptSet* containers). - After sorting them, they are organized in an InterceptVolume, which contains 3 InterceptBeam - objects, each containing the intersections with one family of lines. - - This makes it vary easy to perform boolean operations, since along each line we have - a sequence of intervals that determine what is inside and what is outside of the volume. - To compute the intersection of two volumes, just get their "interval" representation and - for each line intersect the intervals (and similarly for union and difference). - - Two notable problems are mesh consistency and performance: - - to guarantee that the interval representation is meaningful, the mesh needs to be watertight - and the rasterization step must not introduce any inaccuracies; this can be accomplished by - using arbitrary precision arithmetic (currently through libgmp) - - when reconstructing the result mesh, visiting the whole volume is not efficient; it is - possible (and usually much faster) to only visit the surface - */ - -namespace vcg { - /** Class Intercept - Minimal data structure to collect the information about the intersection - between a line and a meshThis is class for definition of a mesh. - @param _dist_type (Template Parameter) Specifies the type of the distance value - @param _scalar (Template Parameter) Specifies the type of the scalar elements - */ - namespace intercept { - template - class Intercept - { - public: - typedef _dist_type DistType; - typedef _scalar Scalar; - typedef vcg::Point3 Point3x; - - private: - DistType _dist; /* distance of the intersection from the reference point */ - Point3x _norm; /* normal of the mesh in the intersection point */ - Scalar _sort_norm; /* component of the normal used for sorting (needed to discriminate intercepts having the same distance) */ - Scalar _quality; /* quality of the mesh in the intersection point */ - - public: - inline Intercept() { } - - inline Intercept(const DistType &dist, const Point3x &norm, const Scalar &sort_norm, const Scalar &quality) : - _dist(dist), _norm(norm), _sort_norm(sort_norm), _quality(quality) { } - - inline Intercept operator -() const { return Intercept(_dist, -_norm, -_sort_norm, _quality); } - - inline bool operator <(const Intercept &other) const { return _dist < other._dist || (_dist == other.dist() && _sort_norm < other._sort_norm); } - - inline bool operator <(const DistType &other) const { return _dist < other; } - - inline const DistType& dist() const { return _dist; } - - inline const Scalar& sort_norm() const { return _sort_norm; } - - inline const Scalar& quality() const { return _quality; } - - inline const Point3x& norm() const { return _norm; } - - friend std::ostream& operator<<(std::ostream &out, const Intercept &x) { - return out << "Intercept[" << x._dist << "[" << x._sort_norm << "], (" << p3print(x._norm) << "), " << x._quality << "]"; - } - }; - - /** Class InterceptRay - Class to collect all the intersections between a mesh and a line, - keeping them sorted to have efficient operations - @param InterceptType (Template Parameter) Specifies the type of the intercepts of the ray - */ - template - class InterceptRay - { - public: - typedef std::vector ContainerType; - - private: - typedef typename InterceptType::DistType DistType; - - inline void cleanup() { - std::sort(v.begin(), v.end()); - v.resize(v.size()); - } - - inline bool isValid() const { - if (v.empty()) - return true; - - if (v.size() % 2 != 0) { - std::cerr << "Not a solid! (size: " << v.size() << ")" << std::endl; - return false; - } - - typename ContainerType::const_iterator curr = v.begin(); - typename ContainerType::const_iterator next = curr+1; - while (next != v.end()) { - if (*next < *curr) { - std::cerr << "Not sorted! (" << *curr << " > " << *next << ")" << std::endl; - return false; - } - curr = next; - next++; - } - - return true; - } - - public: - inline InterceptRay() { } - - inline InterceptRay(const ContainerType &set) : v(set) { - cleanup(); - assert (isValid()); - } - - inline const ContainerType& container() const { return v; } - - inline const InterceptType& GetIntercept(const DistType &s) const { - assert (IsIn(s) != IsIn(s+1) || IsIn(s) == 0); - typename ContainerType::const_iterator p = std::lower_bound(v.begin(), v.end(), s); - assert (p != v.end()); - assert (s <= p->dist() && p->dist() <= s+1); - return *p; - } - - /* Returns -1 if the point at the given distance along the ray is outside, - 0 if it is on the boundary, 1 if it is inside. */ - inline int IsIn(const DistType &s) const { - typename ContainerType::const_iterator p = std::lower_bound(v.begin(), v.end(), s); - if (p == v.end()) - return -1; - else if (p->dist() == s) - return 0; - else - return ((p - v.begin()) & 1) ? 1 : -1; - } - - inline InterceptRay operator &(const InterceptRay &other) const { - typename ContainerType::const_iterator i = v.begin(), j = other.v.begin(), endi = v.end(), endj = other.v.end(); - ContainerType newv; - - newv.reserve(v.size() + other.v.size()); - while (i != endi && j != endj) { - if (*j < *i) { - std::swap(i, j); - std::swap(endi, endj); - } - // i <= j < J - if (*j < *(i+1)) { // i <= j < I & i <= j < J - while (j != endj && *(j+1) < *(i+1)) { // i <= j < J < I - newv.push_back(*j); - newv.push_back(*(j+1)); - j += 2; - } - // i < I <= J & i <= j < J - if (j != endj && *j < *(i+1)) { // i <= j < I <= J - newv.push_back(*j); - newv.push_back(*(i+1)); - } - } - i += 2; - } - return InterceptRay(newv); - } - - inline InterceptRay operator |(const InterceptRay &other) const { - typename ContainerType::const_iterator i = v.begin(), j = other.v.begin(), endi = v.end(), endj = other.v.end(); - ContainerType newv; - - newv.reserve(v.size() + other.v.size()); - while (i != endi && j != endj) { - if (*j < *i) { - std::swap(i, j); - std::swap(endi, endj); - } - // i <= j < J - newv.push_back(*i); - while (j != endj && !(*(i+1) < *j)) { - // i <= j <= I & i <= j < J - while (j != endj && *(j+1) < *(i+1)) // i <= j < J < I - j += 2; - // i < I <= J & i <= j < J - if (j != endj && !(*(i+1) < *j)) { // i < j <= I < J - std::swap(i, j); - std::swap(endi, endj); - // j < i <= J < I - } - } - // i < I < j < J - newv.push_back(*(i+1)); - i += 2; - } - newv.insert(newv.end(), i, endi); - newv.insert(newv.end(), j, endj); - return InterceptRay(newv); - } - - inline InterceptRay operator -(const InterceptRay &other) const { - typename ContainerType::const_iterator i = v.begin(), j = other.v.begin(), endi = v.end(), endj = other.v.end(); - ContainerType newv; - - newv.reserve(v.size() + other.v.size()); - while (i != endi && j != endj) { - while (j != endj && !(*i < *(j+1))) // j < J <= i - j += 2; - if (j == endj) - break; - else if (*i < *j) // i < j < J - newv.push_back(*i); - else { // j <= i < J - while (i != endi && !(*(j+1) < *(i+1))) // j <= i < I <= J - i += 2; - if (i != endi && *i < *(j+1)) { // j <= i < J < I - newv.push_back(-*(j+1)); - j += 2; - } else // j <= J <= i < I - continue; - } - // i < j < J - while (j != endj && *(j+1) < *(i+1)) { // i < j < J < I - newv.push_back(-*j); - newv.push_back(-*(j+1)); - j += 2; - } - - if (j != endj && *j < *(i+1)) // i < j < I <= J - newv.push_back(-*j); - else // i < I <= j < J - newv.push_back(*(i+1)); - i += 2; - } - newv.insert(newv.end(), i, endi); - return InterceptRay(newv); - } - - friend std::ostream& operator<<(std::ostream &out, const InterceptRay &x) { - typename ContainerType::const_iterator i, end = x.v.end(); - out << "InterceptRay["; - for (i = x.v.begin(); i != end; ++i) - out << *i; - assert (x.isValid()); - return out << "]"; - } - - private: - ContainerType v; - }; - - /** Class InterceptBeam - Class to collect all the intersections between a mesh and a family of - parallel lines, with efficient intersection, union and difference - operations. - @param InterceptType (Template Parameter) Specifies the type of the intercepts of the ray - */ - template - class InterceptBeam - { - typedef typename InterceptType::DistType DistType; - typedef InterceptRay IRayType; - - public: - typedef std::vector > ContainerType; - - inline InterceptBeam(const vcg::Box2i &box, const ContainerType &rays) : bbox(box), ray(rays) { } - - inline const IRayType& GetInterceptRay(const vcg::Point2i &p) const { - assert (bbox.IsIn(p)); - vcg::Point2i c = p - bbox.min; - assert (c.X() >= 0 && c.Y() >= 0); - assert (size_t(c.X()) < ray.size() && size_t(c.Y()) < ray[c.X()].size()); - return ray[c.X()][c.Y()]; - } - - /* Returns -1 if the point at the given point is outside, - 0 if it is on the boundary, 1 if it is inside. */ - inline int IsIn(const vcg::Point2i &p, const DistType &s) const { - return bbox.IsIn(p) ? GetInterceptRay(p).IsIn(s) : -1; - } - - inline InterceptBeam& operator &=(const InterceptBeam &other) { - vcg::Box2i newbbox(bbox); - newbbox.Intersect(other.bbox); - - for(int i = 0; i <= newbbox.DimX(); ++i) { - for(int j = 0; j <= newbbox.DimY(); ++j) { - vcg::Point2i p = newbbox.min + vcg::Point2i(i,j); - ray[i][j] = GetInterceptRay(p) & other.GetInterceptRay(p); - } - ray[i].resize(newbbox.DimY() + 1); - } - ray.resize(newbbox.DimX() + 1); - bbox = newbbox; - return *this; - } - - inline InterceptBeam& operator |=(const InterceptBeam &other) { - vcg::Box2i newbbox(bbox); - newbbox.Add(other.bbox); - - ray.resize(newbbox.DimX() + 1); - for(int i = newbbox.DimX(); i >= 0; --i) { - ray[i].resize(newbbox.DimY() + 1); - for(int j = newbbox.DimY(); j >= 0; --j) { - vcg::Point2i p = newbbox.min + vcg::Point2i(i,j); - ray[i][j] = (bbox.IsIn(p) ? GetInterceptRay(p) : IRayType()) | - (other.bbox.IsIn(p) ? other.GetInterceptRay(p) : IRayType()); - } - } - bbox = newbbox; - return *this; - } - - inline InterceptBeam& operator -=(const InterceptBeam &other) { - vcg::Box2i damage(bbox); - damage.Intersect(other.bbox); - - for(int i = 0; i < damage.DimX(); ++i) { - for(int j = 0; j < damage.DimY(); ++j) { - vcg::Point2i p = damage.min + vcg::Point2i(i,j); - vcg::Point2i p2 = p - bbox.min; - ray[p2.X()][p2.Y()] = GetInterceptRay(p) - other.GetInterceptRay(p); - } - } - return *this; - } - - friend std::ostream& operator<<(std::ostream &out, const InterceptBeam &x) { - out << "InterceptBeam[" << p2print(x.bbox.min) << " - " << p2print(x.bbox.max) << "][" << std::endl; - for(int i = x.bbox.min.X(); i <= x.bbox.max.X(); ++i) { - for(int j = x.bbox.min.Y(); j <= x.bbox.max.Y(); ++j) { - vcg::Point2i p(i,j); - out << p2print(p) << ": " << x.GetInterceptRay(p) << std::endl; - } - } - return out << "]"; - } - - private: - vcg::Box2i bbox; - ContainerType ray; - }; - - /** Class InterceptBeam - Three orthogonal InterceptBeam instances, defining a volume - @param InterceptType (Template Parameter) Specifies the type of the intercepts of the ray - */ - template - class InterceptVolume - { - typedef typename InterceptType::DistType DistType; - typedef typename InterceptType::Scalar Scalar; - typedef vcg::Point3 Point3x; - - /* To perform intersection/union/difference on different volumes, their - rays need to match exactly */ - inline bool checkConsistency(const InterceptVolume &other) const { - return delta == other.delta; - } - - public: - typedef typename std::vector > ContainerType; - - inline InterceptVolume(const Box3i &b, const Point3x &d, const ContainerType &beams) : delta(d), bbox(b), beam(beams) { assert (beams.size() == 3); }; - - inline InterceptVolume& operator &=(const InterceptVolume &other) { - assert (checkConsistency(other)); - for (int i = 0; i < 3; ++i) - beam[i] &= other.beam[i]; - bbox.Intersect(other.bbox); - return *this; - } - - inline InterceptVolume& operator |=(const InterceptVolume &other) { - assert (checkConsistency(other)); - for (int i = 0; i < 3; ++i) - beam[i] |= other.beam[i]; - bbox.Add(other.bbox); - return *this; - } - - inline InterceptVolume& operator -=(const InterceptVolume &other) { - assert (checkConsistency(other)); - for (int i = 0; i < 3; ++i) - beam[i] -= other.beam[i]; - return *this; - } - - inline const InterceptRay& GetInterceptRay(int coord, const vcg::Point2i &p) const { - assert (0 <= coord && coord < 3); - return beam[coord].GetInterceptRay(p); - } - - template - inline const InterceptType& GetIntercept(const vcg::Point3i &p1) const { - assert (0 <= coord && coord < 3); - assert (IsIn(p1) != IsIn(p1 + vcg::Point3i(coord == 0, coord == 1, coord == 2))); - - const int c1 = (coord + 1) % 3; - const int c2 = (coord + 2) % 3; - return GetInterceptRay(coord, vcg::Point2i(p1.V(c1), p1.V(c2))).GetIntercept(p1.V(coord)); - } - - /* Return 1 if the given point is in the volume, -1 if it is outside */ - inline int IsIn(const vcg::Point3i &p) const { - int r[3]; - for (int i = 0; i < 3; ++i) - r[i] = beam[i].IsIn(vcg::Point2i(p.V((i+1)%3), p.V((i+2)%3)), p.V(i)); - - /* If some beams are unable to tell whether a point is inside or outside - (i.e. they return 0), try to make them consistent with other beams */ - if (r[0] == 0) - r[0] += r[1] + r[2]; - if (r[1] == 0) - r[1] += r[0] + r[1]; - if (r[2] == 0) - r[2] += r[2] + r[0]; - - if (r[0]>0 && r[1]>0 && r[2]>0) /* consistent: inside -> inside */ - return 1; - else if ((r[0]<0 && r[1]<0 && r[2]<0) || /* consistent: outside -> outside */ - (r[0]==0 && r[1]==0 && r[2] == 0)) /* "consistent": unknown -> outside */ - return -1; - - /* If the rasterization algorithm generates consistent volumes, this should never happen */ - std::cerr << "Inconsistency: " << p3print(p) << p3print(delta) << std::endl; - for (int i = 0; i < 3; ++i) { - std::cerr << beam[i].IsIn(vcg::Point2i(p.V((i+1)%3), p.V((i+2)%3)), p.V(i)); - std::cerr << ": " << beam[i].GetInterceptRay(vcg::Point2i(p.V((i+1)%3), p.V((i+2)%3))) << std::endl; - } - - return 0; - } - - friend std::ostream& operator<<(std::ostream &out, const InterceptVolume &x) { - out << "InterceptVolume[" << p3print(x.delta) << "][" << std::endl; - int coord = 0; - for(typename ContainerType::const_iterator iter = x.beam.begin(); iter != x.beam.end(); ++iter) { - out << *iter << std::endl; - out << "Beam " << coord << std::endl; - - for (int i=x.bbox.min[coord]; i<=x.bbox.max[coord]; i+=1) { - out << i << std::endl; - - for (int k=x.bbox.min[(coord+2)%3]; k<=x.bbox.max[(coord+2)%3]+2; k+=1) - out << '+'; - out << std::endl; - - for (int j=x.bbox.min[(coord+1)%3]; j<=x.bbox.max[(coord+1)%3]; j+=1) { - out << '+'; - for (int k=x.bbox.min[(coord+2)%3]; k<=x.bbox.max[(coord+2)%3]; k+=1) { - vcg::Point3i p(i,j,k); - int in = iter->IsInExt(vcg::Point2i(j, k), i); - char c = '?'; - if (in < 0) - c = ' '; - else if (in > 0) - c = '#'; - out << c; - } - out << '+' << std::endl; - } - - for (int k=x.bbox.min[(coord+2)%3]; k - class InterceptSet - { - typedef std::vector ContainerType; - typedef InterceptRay SortedType; - - public: - inline InterceptSet() { } - - inline operator SortedType() const { return SortedType(v); } - - inline void AddIntercept(const InterceptType &x) { v.push_back(x); } - - friend std::ostream& operator<<(std::ostream &out, const InterceptSet &x) { - typename ContainerType::const_iterator i, end = x.v.end(); - out << "InterceptSet["; - for (i = x.v.begin(); i != end; ++i) - out << *i << std::endl; - return out << "]"; - } - - private: - ContainerType v; - }; - - template - class InterceptSet1 - { - typedef std::vector > ContainerType; - typedef std::vector > SortedType; - - public: - inline InterceptSet1() { } - - inline operator SortedType() const { return SortedType(set.begin(), set.end()); } - - inline void resize(size_t size) { set.resize(size); } - - inline void AddIntercept(const int i, const InterceptType &x) { - assert (i >= 0); - assert (size_t(i) < set.size()); - set[i].AddIntercept(x); - } - - friend std::ostream& operator<<(std::ostream &out, const InterceptSet1 &x) { - typename ContainerType::const_iterator i, end = x.set.end(); - out << "InterceptSet1["; - for (i = x.set.begin(); i != end; ++i) - out << *i << std::endl; - return out << "]InterceptSet1"; - } - - private: - ContainerType set; - }; - - /* Unsorted version of InterceptBeam. - Used to temporarily accumulate the intersections along a family of - parallel lines before sorting them */ - template - class InterceptSet2 - { - typedef std::vector > ContainerType; - typedef std::vector > > NewContainerType; - typedef InterceptBeam SortedType; - - public: - inline InterceptSet2(const vcg::Box2i &box) : bbox(box), set(box.DimX() + 1) { - typename ContainerType::iterator i, end = set.end(); - for (i = set.begin(); i != end; ++i) - i->resize(box.DimY() + 1); - } - - inline operator SortedType() const { return SortedType(bbox, typename SortedType::ContainerType(set.begin(), set.end())); } - - inline void AddIntercept (const vcg::Point2i &p, const InterceptType &x) { - assert (bbox.IsIn(p)); - vcg::Point2i c = p - bbox.min; - assert (c.X() >= 0); - assert (size_t(c.X()) < set.size()); - set[c.X()].AddIntercept(c.Y(), x); - } - - friend std::ostream& operator<<(std::ostream &out, const InterceptSet2 &x) { - typename ContainerType::const_iterator i, end = x.set.end(); - out << "InterceptSet2["; - for (i = x.set.begin(); i != end; ++i) - out << *i << std::endl; - return out << "]InterceptSet2"; - } - - private: - Box2i bbox; - ContainerType set; - }; - - /* Unsorted version of InterceptVolume. - Used to temporarily accumulate the intersections in a volume before sorting them. - Rasterization is performed on faces after casting them to an integral type, so that no - numerical instability can cause the volume to be inconsistent */ - template - class InterceptSet3 - { - typedef typename InterceptType::Scalar Scalar; - typedef typename InterceptType::DistType DistType; - typedef vcg::Point3 Point3dt; - typedef vcg::Point3 Point3x; - typedef InterceptSet2 ISet2Type; - typedef InterceptVolume SortedType; - typedef std::vector ContainerType; - - template - void RasterFace(const Point3dt &v0, const Point3dt &v1, const Point3dt &v2, - const vcg::Box3i &ibox, const Point3x &norm, const Scalar &quality) - { - const int crd0 = (CoordZ+0)%3; - const int crd1 = (CoordZ+1)%3; - const int crd2 = (CoordZ+2)%3; - const Point3dt d10 = v1 - v0; - const Point3dt d21 = v2 - v1; - const Point3dt d02 = v0 - v2; - - const DistType det0 = d21[crd2] * d02[crd1] - d21[crd1] * d02[crd2]; - const DistType det1 = d21[crd0] * d02[crd2] - d21[crd2] * d02[crd0]; - const DistType det2 = d21[crd1] * d02[crd0] - d21[crd0] * d02[crd1]; - - DistType n0xy = (v1[crd1]-ibox.min[crd1])*d21[crd2] - (v1[crd2]-ibox.min[crd2])*d21[crd1]; - DistType n1xy = (v2[crd1]-ibox.min[crd1])*d02[crd2] - (v2[crd2]-ibox.min[crd2])*d02[crd1]; - DistType n2xy = (v0[crd1]-ibox.min[crd1])*d10[crd2] - (v0[crd2]-ibox.min[crd2])*d10[crd1]; - const DistType n0dx = d21[crd2] + (ibox.Dim()[crd2] + 1) * d21[crd1]; - const DistType n1dx = d02[crd2] + (ibox.Dim()[crd2] + 1) * d02[crd1]; - const DistType n2dx = d10[crd2] + (ibox.Dim()[crd2] + 1) * d10[crd1]; - for(int x = ibox.min[crd1]; x <= ibox.max[crd1]; ++x) { - for(int y = ibox.min[crd2]; y <= ibox.max[crd2]; ++y) { - DistType n0 = n0xy, n1 = n1xy, n2 = n2xy; - - /* Solve the inside/outside problem for on-edge points. - The point (x,y,z) is actually considered to be - (x+eps, y+eps^2, z+eps^2) with eps->0. */ - if (crd1 > crd2) { - if (n0 == 0) - n0 = d21[crd1]; - if (n0 == 0) - n0 -= d21[crd2]; - - if (n1 == 0) - n1 = d02[crd1]; - if (n1 == 0) - n1 -= d02[crd2]; - - if (n2 == 0) - n2 = d10[crd1]; - if (n2 == 0) - n2 -= d10[crd2]; - } else { - if (n0 == 0) - n0 -= d21[crd2]; - if (n0 == 0) - n0 = d21[crd1]; - - if (n1 == 0) - n1 -= d02[crd2]; - if (n1 == 0) - n1 = d02[crd1]; - - if (n2 == 0) - n2 -= d10[crd2]; - if (n2 == 0) - n2 = d10[crd1]; - } - - if((n0>0 && n1>0 && n2>0) || (n0<0 && n1<0 && n2<0)) { - DistType d = (v0[crd2] - y) * det2 + (v0[crd1] - x) * det1; - d /= det0; - d += v0[crd0]; - assert (d >= ibox.min[crd0] && d <= ibox.max[crd0]); - set[crd0].AddIntercept(vcg::Point2i(x, y), InterceptType(d, norm, norm[crd0], quality)); - } - n0xy += d21[crd1]; - n1xy += d02[crd1]; - n2xy += d10[crd1]; - } - n0xy -= n0dx; - n1xy -= n1dx; - n2xy -= n2dx; - } - } - - void ScanFace(const Point3dt &v0, const Point3dt &v1, const Point3dt &v2, - const Point3x &norm, const Scalar &quality) { - vcg::Box3 fbox; - fbox.Add(v0); - fbox.Add(v1); - fbox.Add(v2); - for (int i=0; i<3; ++i) { - assert (v0[i] >= bbox.min[i] && v0[i] <= bbox.max[i]); - assert (v1[i] >= bbox.min[i] && v1[i] <= bbox.max[i]); - assert (v2[i] >= bbox.min[i] && v2[i] <= bbox.max[i]); - } - vcg::Box3i ibox(vcg::Point3i(floor(fbox.min.X()), floor(fbox.min.Y()), floor(fbox.min.Z())), - vcg::Point3i(ceil(fbox.max.X()), ceil(fbox.max.Y()), ceil(fbox.max.Z()))); - - RasterFace<0>(v0, v1, v2, ibox, norm, quality); - RasterFace<1>(v0, v1, v2, ibox, norm, quality); - RasterFace<2>(v0, v1, v2, ibox, norm, quality); - } - - public: - template - inline InterceptSet3(const MeshType &m, const Point3x &d, int subCellPrecision=32, vcg::CallBackPos *cb=vcg::DummyCallBackPos) : delta(d), - bbox(Point3i(floor(m.bbox.min.X() / d.X()) - 1, - floor(m.bbox.min.Y() / d.Y()) - 1, - floor(m.bbox.min.Z() / d.Z()) - 1), - Point3i(ceil(m.bbox.max.X() / d.X()) + 1, - ceil(m.bbox.max.Y() / d.Y()) + 1, - ceil(m.bbox.max.Z() / d.Z()) + 1)) - { - const Point3x invDelta(Scalar(1) / delta.X(), - Scalar(1) / delta.Y(), - Scalar(1) / delta.Z()); - - vcg::Box2i xy, yz, zx; - yz.Set(bbox.min.Y(), bbox.min.Z(), bbox.max.Y(), bbox.max.Z()); - zx.Set(bbox.min.Z(), bbox.min.X(), bbox.max.Z(), bbox.max.X()); - xy.Set(bbox.min.X(), bbox.min.Y(), bbox.max.X(), bbox.max.Y()); - - set.push_back(ISet2Type(yz)); - set.push_back(ISet2Type(zx)); - set.push_back(ISet2Type(xy)); - - typename MeshType::ConstFaceIterator i, end = m.face.end(); - const size_t nFaces = m.face.size(); - size_t f = 0; - for (i = m.face.begin(); i != end; ++i, ++f) { - if (!cb (100.0 * f / nFaces, "Rasterizing mesh...")) { - set.clear(); - set.push_back(ISet2Type(yz)); - set.push_back(ISet2Type(zx)); - set.push_back(ISet2Type(xy)); - return; - } - Point3x v0(i->cV(0)->P()), v1(i->cV(1)->P()), v2(i->cV(2)->P()); - v0.Scale(invDelta); - v1.Scale(invDelta); - v2.Scale(invDelta); - for (int j=0; j<3; ++j) { - assert (v0[j] >= bbox.min[j] && v0[j] <= bbox.max[j]); - assert (v1[j] >= bbox.min[j] && v1[j] <= bbox.max[j]); - assert (v2[j] >= bbox.min[j] && v2[j] <= bbox.max[j]); - } - ScanFace (Point3dt(makeFraction(v0.X()*subCellPrecision, subCellPrecision), - makeFraction(v0.Y()*subCellPrecision, subCellPrecision), - makeFraction(v0.Z()*subCellPrecision, subCellPrecision)), - Point3dt(makeFraction(v1.X()*subCellPrecision, subCellPrecision), - makeFraction(v1.Y()*subCellPrecision, subCellPrecision), - makeFraction(v1.Z()*subCellPrecision, subCellPrecision)), - Point3dt(makeFraction(v2.X()*subCellPrecision, subCellPrecision), - makeFraction(v2.Y()*subCellPrecision, subCellPrecision), - makeFraction(v2.Z()*subCellPrecision, subCellPrecision)), - i->cN().Normalize(), - i->cQ()); - } - } - - inline operator SortedType() const { return SortedType(bbox, delta, typename SortedType::ContainerType(set.begin(), set.end())); } - - friend std::ostream& operator<<(std::ostream &out, const InterceptSet3 &x) { - typename ContainerType::const_iterator i, end = x.set.end(); - out << "InterceptSet3["; - for (i = x.set.begin(); i != end; ++i) - out << *i << std::endl; - return out << "]InterceptSet3"; - } - - const Point3x delta; - const Box3i bbox; - private: - ContainerType set; - }; - - template - class Walker - { - typedef typename MeshType::VertexPointer VertexPointer; - typedef typename MeshType::CoordType CoordType; - typedef typename std::tr1::unordered_map VertexTable; - typedef typename std::tr1::unordered_map SamplesTable; - typedef typename std::tr1::unordered_set CellsSet; - - void clear() { - _vertices.clear(); - _samples.clear(); - _volume = NULL; - _mesh = NULL; - } - - public: - template - void BuildMesh(MeshType &mesh, InterceptVolume &volume, EXTRACTOR_TYPE &extractor, vcg::CallBackPos *cb=vcg::DummyCallBackPos) - { - CellsSet cset; /* cells to be visited */ - vcg::Point3i p; - - _volume = &volume; - _mesh = &mesh; - _mesh->Clear(); - - /* To improve performance, instead of visiting the whole volume, mark the cells - intersecting the surface so that they can be visited. - This usually lowers the complexity from n^3 to about n^2 (where n is the - number of samples along each direction */ - for (int c0=0; c0 < 3; ++c0) { - const int c1 = (c0 + 1) % 3, c2 = (c0 + 2) % 3; - for (p[c1]=_volume->bbox.min.V(c1); p[c1]<=_volume->bbox.max.V(c1); ++p[c1]) - for (p[c2]=_volume->bbox.min.V(c2); p[c2]<=_volume->bbox.max.V(c2); ++p[c2]) { - const InterceptRay& r = - _volume->GetInterceptRay(c0, vcg::Point2i(p[c1],p[c2])); - typename InterceptRay::ContainerType::const_iterator curr, end = r.container().end(); - for (curr = r.container().begin(); curr != end; ++curr) { - p[c0] = floor(curr->dist()); - if (curr->dist() == p[c0]) { - p[c0]--; - p[c1]--; - p[c2]--; - cset.insert(p); - p[c2]++; - cset.insert(p); - p[c1]++; - p[c2]--; - cset.insert(p); - p[c2]++; - cset.insert(p); - p[c0]++; - } - p[c1]--; - p[c2]--; - cset.insert(p); - p[c2]++; - cset.insert(p); - p[c1]++; - p[c2]--; - cset.insert(p); - p[c2]++; - cset.insert(p); - } - } - } - - /* Evaluating IsIn is "slow" (it requires binary search, so it's slower than an hashtable - access) and vertices of the cells are often shared, so precomputing them in the - _samples hashmap causes a performance improvement */ - const size_t n = cset.size(); - size_t i = 0; - for (CellsSet::const_iterator cell = cset.begin(); cell != cset.end(); ++cell, ++i) { - if (!cb(100.0 * i / n, "Precomputing in/out table...")) { - clear(); - return; - } - for (int i = 0; i < 2; ++i) - for (int j = 0; j < 2; ++j) - for (int k = 0; k < 2; ++k) { - vcg::Point3i p(*cell + vcg::Point3i(i, j, k)); - if (_samples.find(p) == _samples.end()) - _samples[p] = _volume->IsIn(p); - } - } - - const vcg::Point3i diag(1, 1, 1); - extractor.Initialize(); - i = 0; - /* Only visit marked cells */ - for (CellsSet::const_iterator cell = cset.begin(); cell != cset.end(); ++cell, ++i) { - if (!cb(100.0 * i / n, "Reconstructing surface...")) - break; - extractor.ProcessCell(*cell, *cell + diag); - } - extractor.Finalize(); - - clear(); - } - - inline float V(int i, int j, int k) const { return V(vcg::Point3i(i, j, k)); } - - inline float V(const vcg::Point3i &p) const { - /* use precomputed in/out result */ - typename SamplesTable::const_iterator s = _samples.find(p); - return s->second; - } - - template - void GetIntercept(const vcg::Point3i &p1, const vcg::Point3i &p2, VertexPointer& p) { - assert (p2 == p1 + vcg::Point3i(coord == 0, coord == 1, coord == 2)); - assert (_volume->IsIn(p1) != _volume->IsIn(p2)); - - const InterceptType& i = _volume->template GetIntercept(p1); - typename VertexTable::const_iterator v = _vertices.find(&i); - if (v == _vertices.end()) { - p = &*vcg::tri::Allocator::AddVertices(*_mesh, 1); - p->P().V(coord) = toFloat(i.dist()); - p->P().V((coord+1)%3) = p1[(coord+1)%3]; - p->P().V((coord+2)%3) = p1[(coord+2)%3]; - p->P().Scale(_volume->delta); - p->N() = i.norm(); - p->Q() = i.quality(); - _vertices[&i] = p - &_mesh->vert[0]; - } else /* a vertex is already associated with the intercept. reuse it */ - p = &_mesh->vert[v->second]; - } - - inline void GetXIntercept(const vcg::Point3i &p1, const vcg::Point3i &p2, VertexPointer& p) { GetIntercept<0>(p1, p2, p); } - - inline void GetYIntercept(const vcg::Point3i &p1, const vcg::Point3i &p2, VertexPointer& p) { GetIntercept<1>(p1, p2, p); } - - inline void GetZIntercept(const vcg::Point3i &p1, const vcg::Point3i &p2, VertexPointer& p) { GetIntercept<2>(p1, p2, p); } - - bool Exist(const vcg::Point3i &p1, const vcg::Point3i &p2, VertexPointer& p) { - if (V(p1) == V(p2)) - return false; - - vcg::Point3i d = p2 - p1; - if (d.X()) - GetXIntercept(p1, p2, p); - else if (d.Y()) - GetYIntercept(p1, p2, p); - else if (d.Z()) - GetZIntercept(p1, p2, p); - - return true; - } - - private: - VertexTable _vertices; /* maps intercept -> vertex of the reconstructed mesh */ - SamplesTable _samples; /* maps point -> in/out */ - InterceptVolume *_volume; - MeshType *_mesh; - }; - }; - - template - bool isValid(MeshType &mesh, StringType &errorMessage) { - if (vcg::tri::Clean::CountNonManifoldEdgeFF(mesh) > 0) - errorMessage = "non manifold edges"; - else if (vcg::tri::Clean::CountNonManifoldVertexFF(mesh) > 0) - errorMessage = "non manifold vertices"; - else if (!vcg::tri::Clean::IsSizeConsistent(mesh)) - errorMessage = "non size-consistent mesh"; - else { - int boundaryEdgeNum, internalEdgeNum; - vcg::tri::Clean::CountEdges(mesh, internalEdgeNum, boundaryEdgeNum); - if (boundaryEdgeNum > 0) - errorMessage = "non watertight mesh"; - else - return true; - } - return false; - } -}; -#endif // INTERCEPT_H +#ifndef INTERCEPT_H +#define INTERCEPT_H + +#include +#include +#ifdef _MSC_VER + #include + #include +#else + #include + #include +#endif + +#include +#include +#include +#include + +#define p2print(point) ((point).X()) << ", " << ((point).Y()) +#define p3print(point) p2print(point) << ", " << ((point).Z()) + +namespace std +{ +//MSVC++ 11.0 _MSC_VER = 1700 (Visual Studio 2012) +//MSVC++ 10.0 _MSC_VER = 1600 (Visual Studio 2010) +//MSVC++ 9.0 _MSC_VER = 1500 (Visual Studio 2008) +//MSVC++ 8.0 _MSC_VER = 1400 (Visual Studio 2005) +//MSVC++ 7.1 _MSC_VER = 1310 (Visual Studio 2003) +//MSVC++ 7.0 _MSC_VER = 1300 +//MSVC++ 6.0 _MSC_VER = 1200 +//MSVC++ 5.0 _MSC_VER = 1100 +#if defined(_MSC_VER) && (_MSC_VER > 1500) +#else + namespace tr1 { +#endif + template <> + struct hash : public std::unary_function + { + std::size_t operator()(const vcg::Point3i &x) const + { + std::tr1::hash h; + return ((x[0]) * 131 + h(x[1])) * 131 + h(x[2]); + } + }; +#if defined(_MSC_VER) && (_MSC_VER > 1500) +#else + } +#endif +} + +/* + This header contains an implementation of "Marching Intersections" + For more details on this technique, see: + C. Rocchini, P. Cignoni, F. Ganovelli, C. Montani, P. Pingi and R.Scopigno, + 'Marching Intersections: an Efficient Resampling Algorithm for Surface Management' + In Proceedings of Shape Modeling International (SMI) 2001 + + This technique is used to create a volume representation where CSG operations are simple. + + Given a mesh, InterceptSet3 "rasterizes" it by computing all the intersections between + the mesh and 3 orthogonal families of lines (and storing them in the InterceptSet* containers). + After sorting them, they are organized in an InterceptVolume, which contains 3 InterceptBeam + objects, each containing the intersections with one family of lines. + + This makes it vary easy to perform boolean operations, since along each line we have + a sequence of intervals that determine what is inside and what is outside of the volume. + To compute the intersection of two volumes, just get their "interval" representation and + for each line intersect the intervals (and similarly for union and difference). + + Two notable problems are mesh consistency and performance: + - to guarantee that the interval representation is meaningful, the mesh needs to be watertight + and the rasterization step must not introduce any inaccuracies; this can be accomplished by + using arbitrary precision arithmetic (currently through libgmp) + - when reconstructing the result mesh, visiting the whole volume is not efficient; it is + possible (and usually much faster) to only visit the surface + */ + +namespace vcg { + /** Class Intercept + Minimal data structure to collect the information about the intersection + between a line and a meshThis is class for definition of a mesh. + @param _dist_type (Template Parameter) Specifies the type of the distance value + @param _scalar (Template Parameter) Specifies the type of the scalar elements + */ + namespace intercept { + template + class Intercept + { + public: + typedef _dist_type DistType; + typedef _scalar Scalar; + typedef vcg::Point3 Point3x; + + private: + DistType _dist; /* distance of the intersection from the reference point */ + Point3x _norm; /* normal of the mesh in the intersection point */ + Scalar _sort_norm; /* component of the normal used for sorting (needed to discriminate intercepts having the same distance) */ + Scalar _quality; /* quality of the mesh in the intersection point */ + + public: + inline Intercept() { } + + inline Intercept(const DistType &dist, const Point3x &norm, const Scalar &sort_norm, const Scalar &quality) : + _dist(dist), _norm(norm), _sort_norm(sort_norm), _quality(quality) { } + + inline Intercept operator -() const { return Intercept(_dist, -_norm, -_sort_norm, _quality); } + + inline bool operator <(const Intercept &other) const { return _dist < other._dist || (_dist == other.dist() && _sort_norm < other._sort_norm); } + + inline bool operator <(const DistType &other) const { return _dist < other; } + + inline const DistType& dist() const { return _dist; } + + inline const Scalar& sort_norm() const { return _sort_norm; } + + inline const Scalar& quality() const { return _quality; } + + inline const Point3x& norm() const { return _norm; } + + friend std::ostream& operator<<(std::ostream &out, const Intercept &x) { + return out << "Intercept[" << x._dist << "[" << x._sort_norm << "], (" << p3print(x._norm) << "), " << x._quality << "]"; + } + }; + + /** Class InterceptRay + Class to collect all the intersections between a mesh and a line, + keeping them sorted to have efficient operations + @param InterceptType (Template Parameter) Specifies the type of the intercepts of the ray + */ + template + class InterceptRay + { + public: + typedef std::vector ContainerType; + + private: + typedef typename InterceptType::DistType DistType; + + inline void cleanup() { + std::sort(v.begin(), v.end()); + v.resize(v.size()); + } + + inline bool isValid() const { + if (v.empty()) + return true; + + if (v.size() % 2 != 0) { + std::cerr << "Not a solid! (size: " << v.size() << ")" << std::endl; + return false; + } + + typename ContainerType::const_iterator curr = v.begin(); + typename ContainerType::const_iterator next = curr+1; + while (next != v.end()) { + if (*next < *curr) { + std::cerr << "Not sorted! (" << *curr << " > " << *next << ")" << std::endl; + return false; + } + curr = next; + next++; + } + + return true; + } + + public: + inline InterceptRay() { } + + inline InterceptRay(const ContainerType &set) : v(set) { + cleanup(); + assert (isValid()); + } + + inline const ContainerType& container() const { return v; } + + inline const InterceptType& GetIntercept(const DistType &s) const { + assert (IsIn(s) != IsIn(s+1) || IsIn(s) == 0); + typename ContainerType::const_iterator p = std::lower_bound(v.begin(), v.end(), s); + assert (p != v.end()); + assert (s <= p->dist() && p->dist() <= s+1); + return *p; + } + + /* Returns -1 if the point at the given distance along the ray is outside, + 0 if it is on the boundary, 1 if it is inside. */ + inline int IsIn(const DistType &s) const { + typename ContainerType::const_iterator p = std::lower_bound(v.begin(), v.end(), s); + if (p == v.end()) + return -1; + else if (p->dist() == s) + return 0; + else + return ((p - v.begin()) & 1) ? 1 : -1; + } + + inline InterceptRay operator &(const InterceptRay &other) const { + typename ContainerType::const_iterator i = v.begin(), j = other.v.begin(), endi = v.end(), endj = other.v.end(); + ContainerType newv; + + newv.reserve(v.size() + other.v.size()); + while (i != endi && j != endj) { + if (*j < *i) { + std::swap(i, j); + std::swap(endi, endj); + } + // i <= j < J + if (*j < *(i+1)) { // i <= j < I & i <= j < J + while (j != endj && *(j+1) < *(i+1)) { // i <= j < J < I + newv.push_back(*j); + newv.push_back(*(j+1)); + j += 2; + } + // i < I <= J & i <= j < J + if (j != endj && *j < *(i+1)) { // i <= j < I <= J + newv.push_back(*j); + newv.push_back(*(i+1)); + } + } + i += 2; + } + return InterceptRay(newv); + } + + inline InterceptRay operator |(const InterceptRay &other) const { + typename ContainerType::const_iterator i = v.begin(), j = other.v.begin(), endi = v.end(), endj = other.v.end(); + ContainerType newv; + + newv.reserve(v.size() + other.v.size()); + while (i != endi && j != endj) { + if (*j < *i) { + std::swap(i, j); + std::swap(endi, endj); + } + // i <= j < J + newv.push_back(*i); + while (j != endj && !(*(i+1) < *j)) { + // i <= j <= I & i <= j < J + while (j != endj && *(j+1) < *(i+1)) // i <= j < J < I + j += 2; + // i < I <= J & i <= j < J + if (j != endj && !(*(i+1) < *j)) { // i < j <= I < J + std::swap(i, j); + std::swap(endi, endj); + // j < i <= J < I + } + } + // i < I < j < J + newv.push_back(*(i+1)); + i += 2; + } + newv.insert(newv.end(), i, endi); + newv.insert(newv.end(), j, endj); + return InterceptRay(newv); + } + + inline InterceptRay operator -(const InterceptRay &other) const { + typename ContainerType::const_iterator i = v.begin(), j = other.v.begin(), endi = v.end(), endj = other.v.end(); + ContainerType newv; + + newv.reserve(v.size() + other.v.size()); + while (i != endi && j != endj) { + while (j != endj && !(*i < *(j+1))) // j < J <= i + j += 2; + if (j == endj) + break; + else if (*i < *j) // i < j < J + newv.push_back(*i); + else { // j <= i < J + while (i != endi && !(*(j+1) < *(i+1))) // j <= i < I <= J + i += 2; + if (i != endi && *i < *(j+1)) { // j <= i < J < I + newv.push_back(-*(j+1)); + j += 2; + } else // j <= J <= i < I + continue; + } + // i < j < J + while (j != endj && *(j+1) < *(i+1)) { // i < j < J < I + newv.push_back(-*j); + newv.push_back(-*(j+1)); + j += 2; + } + + if (j != endj && *j < *(i+1)) // i < j < I <= J + newv.push_back(-*j); + else // i < I <= j < J + newv.push_back(*(i+1)); + i += 2; + } + newv.insert(newv.end(), i, endi); + return InterceptRay(newv); + } + + friend std::ostream& operator<<(std::ostream &out, const InterceptRay &x) { + typename ContainerType::const_iterator i, end = x.v.end(); + out << "InterceptRay["; + for (i = x.v.begin(); i != end; ++i) + out << *i; + assert (x.isValid()); + return out << "]"; + } + + private: + ContainerType v; + }; + + /** Class InterceptBeam + Class to collect all the intersections between a mesh and a family of + parallel lines, with efficient intersection, union and difference + operations. + @param InterceptType (Template Parameter) Specifies the type of the intercepts of the ray + */ + template + class InterceptBeam + { + typedef typename InterceptType::DistType DistType; + typedef InterceptRay IRayType; + + public: + typedef std::vector > ContainerType; + + inline InterceptBeam(const vcg::Box2i &box, const ContainerType &rays) : bbox(box), ray(rays) { } + + inline const IRayType& GetInterceptRay(const vcg::Point2i &p) const { + assert (bbox.IsIn(p)); + vcg::Point2i c = p - bbox.min; + assert (c.X() >= 0 && c.Y() >= 0); + assert (size_t(c.X()) < ray.size() && size_t(c.Y()) < ray[c.X()].size()); + return ray[c.X()][c.Y()]; + } + + /* Returns -1 if the point at the given point is outside, + 0 if it is on the boundary, 1 if it is inside. */ + inline int IsIn(const vcg::Point2i &p, const DistType &s) const { + return bbox.IsIn(p) ? GetInterceptRay(p).IsIn(s) : -1; + } + + inline InterceptBeam& operator &=(const InterceptBeam &other) { + vcg::Box2i newbbox(bbox); + newbbox.Intersect(other.bbox); + + for(int i = 0; i <= newbbox.DimX(); ++i) { + for(int j = 0; j <= newbbox.DimY(); ++j) { + vcg::Point2i p = newbbox.min + vcg::Point2i(i,j); + ray[i][j] = GetInterceptRay(p) & other.GetInterceptRay(p); + } + ray[i].resize(newbbox.DimY() + 1); + } + ray.resize(newbbox.DimX() + 1); + bbox = newbbox; + return *this; + } + + inline InterceptBeam& operator |=(const InterceptBeam &other) { + vcg::Box2i newbbox(bbox); + newbbox.Add(other.bbox); + + ray.resize(newbbox.DimX() + 1); + for(int i = newbbox.DimX(); i >= 0; --i) { + ray[i].resize(newbbox.DimY() + 1); + for(int j = newbbox.DimY(); j >= 0; --j) { + vcg::Point2i p = newbbox.min + vcg::Point2i(i,j); + ray[i][j] = (bbox.IsIn(p) ? GetInterceptRay(p) : IRayType()) | + (other.bbox.IsIn(p) ? other.GetInterceptRay(p) : IRayType()); + } + } + bbox = newbbox; + return *this; + } + + inline InterceptBeam& operator -=(const InterceptBeam &other) { + vcg::Box2i damage(bbox); + damage.Intersect(other.bbox); + + for(int i = 0; i < damage.DimX(); ++i) { + for(int j = 0; j < damage.DimY(); ++j) { + vcg::Point2i p = damage.min + vcg::Point2i(i,j); + vcg::Point2i p2 = p - bbox.min; + ray[p2.X()][p2.Y()] = GetInterceptRay(p) - other.GetInterceptRay(p); + } + } + return *this; + } + + friend std::ostream& operator<<(std::ostream &out, const InterceptBeam &x) { + out << "InterceptBeam[" << p2print(x.bbox.min) << " - " << p2print(x.bbox.max) << "][" << std::endl; + for(int i = x.bbox.min.X(); i <= x.bbox.max.X(); ++i) { + for(int j = x.bbox.min.Y(); j <= x.bbox.max.Y(); ++j) { + vcg::Point2i p(i,j); + out << p2print(p) << ": " << x.GetInterceptRay(p) << std::endl; + } + } + return out << "]"; + } + + private: + vcg::Box2i bbox; + ContainerType ray; + }; + + /** Class InterceptBeam + Three orthogonal InterceptBeam instances, defining a volume + @param InterceptType (Template Parameter) Specifies the type of the intercepts of the ray + */ + template + class InterceptVolume + { + typedef typename InterceptType::DistType DistType; + typedef typename InterceptType::Scalar Scalar; + typedef vcg::Point3 Point3x; + + /* To perform intersection/union/difference on different volumes, their + rays need to match exactly */ + inline bool checkConsistency(const InterceptVolume &other) const { + return delta == other.delta; + } + + public: + typedef typename std::vector > ContainerType; + + inline InterceptVolume(const Box3i &b, const Point3x &d, const ContainerType &beams) : delta(d), bbox(b), beam(beams) { assert (beams.size() == 3); }; + + inline InterceptVolume& operator &=(const InterceptVolume &other) { + assert (checkConsistency(other)); + for (int i = 0; i < 3; ++i) + beam[i] &= other.beam[i]; + bbox.Intersect(other.bbox); + return *this; + } + + inline InterceptVolume& operator |=(const InterceptVolume &other) { + assert (checkConsistency(other)); + for (int i = 0; i < 3; ++i) + beam[i] |= other.beam[i]; + bbox.Add(other.bbox); + return *this; + } + + inline InterceptVolume& operator -=(const InterceptVolume &other) { + assert (checkConsistency(other)); + for (int i = 0; i < 3; ++i) + beam[i] -= other.beam[i]; + return *this; + } + + inline const InterceptRay& GetInterceptRay(int coord, const vcg::Point2i &p) const { + assert (0 <= coord && coord < 3); + return beam[coord].GetInterceptRay(p); + } + + template + inline const InterceptType& GetIntercept(const vcg::Point3i &p1) const { + assert (0 <= coord && coord < 3); + assert (IsIn(p1) != IsIn(p1 + vcg::Point3i(coord == 0, coord == 1, coord == 2))); + + const int c1 = (coord + 1) % 3; + const int c2 = (coord + 2) % 3; + return GetInterceptRay(coord, vcg::Point2i(p1.V(c1), p1.V(c2))).GetIntercept(p1.V(coord)); + } + + /* Return 1 if the given point is in the volume, -1 if it is outside */ + inline int IsIn(const vcg::Point3i &p) const { + int r[3]; + for (int i = 0; i < 3; ++i) + r[i] = beam[i].IsIn(vcg::Point2i(p.V((i+1)%3), p.V((i+2)%3)), p.V(i)); + + /* If some beams are unable to tell whether a point is inside or outside + (i.e. they return 0), try to make them consistent with other beams */ + if (r[0] == 0) + r[0] += r[1] + r[2]; + if (r[1] == 0) + r[1] += r[0] + r[1]; + if (r[2] == 0) + r[2] += r[2] + r[0]; + + if (r[0]>0 && r[1]>0 && r[2]>0) /* consistent: inside -> inside */ + return 1; + else if ((r[0]<0 && r[1]<0 && r[2]<0) || /* consistent: outside -> outside */ + (r[0]==0 && r[1]==0 && r[2] == 0)) /* "consistent": unknown -> outside */ + return -1; + + /* If the rasterization algorithm generates consistent volumes, this should never happen */ + std::cerr << "Inconsistency: " << p3print(p) << p3print(delta) << std::endl; + for (int i = 0; i < 3; ++i) { + std::cerr << beam[i].IsIn(vcg::Point2i(p.V((i+1)%3), p.V((i+2)%3)), p.V(i)); + std::cerr << ": " << beam[i].GetInterceptRay(vcg::Point2i(p.V((i+1)%3), p.V((i+2)%3))) << std::endl; + } + + return 0; + } + + friend std::ostream& operator<<(std::ostream &out, const InterceptVolume &x) { + out << "InterceptVolume[" << p3print(x.delta) << "][" << std::endl; + int coord = 0; + for(typename ContainerType::const_iterator iter = x.beam.begin(); iter != x.beam.end(); ++iter) { + out << *iter << std::endl; + out << "Beam " << coord << std::endl; + + for (int i=x.bbox.min[coord]; i<=x.bbox.max[coord]; i+=1) { + out << i << std::endl; + + for (int k=x.bbox.min[(coord+2)%3]; k<=x.bbox.max[(coord+2)%3]+2; k+=1) + out << '+'; + out << std::endl; + + for (int j=x.bbox.min[(coord+1)%3]; j<=x.bbox.max[(coord+1)%3]; j+=1) { + out << '+'; + for (int k=x.bbox.min[(coord+2)%3]; k<=x.bbox.max[(coord+2)%3]; k+=1) { + vcg::Point3i p(i,j,k); + int in = iter->IsInExt(vcg::Point2i(j, k), i); + char c = '?'; + if (in < 0) + c = ' '; + else if (in > 0) + c = '#'; + out << c; + } + out << '+' << std::endl; + } + + for (int k=x.bbox.min[(coord+2)%3]; k + class InterceptSet + { + typedef std::vector ContainerType; + typedef InterceptRay SortedType; + + public: + inline InterceptSet() { } + + inline operator SortedType() const { return SortedType(v); } + + inline void AddIntercept(const InterceptType &x) { v.push_back(x); } + + friend std::ostream& operator<<(std::ostream &out, const InterceptSet &x) { + typename ContainerType::const_iterator i, end = x.v.end(); + out << "InterceptSet["; + for (i = x.v.begin(); i != end; ++i) + out << *i << std::endl; + return out << "]"; + } + + private: + ContainerType v; + }; + + template + class InterceptSet1 + { + typedef std::vector > ContainerType; + typedef std::vector > SortedType; + + public: + inline InterceptSet1() { } + + inline operator SortedType() const { return SortedType(set.begin(), set.end()); } + + inline void resize(size_t size) { set.resize(size); } + + inline void AddIntercept(const int i, const InterceptType &x) { + assert (i >= 0); + assert (size_t(i) < set.size()); + set[i].AddIntercept(x); + } + + friend std::ostream& operator<<(std::ostream &out, const InterceptSet1 &x) { + typename ContainerType::const_iterator i, end = x.set.end(); + out << "InterceptSet1["; + for (i = x.set.begin(); i != end; ++i) + out << *i << std::endl; + return out << "]InterceptSet1"; + } + + private: + ContainerType set; + }; + + /* Unsorted version of InterceptBeam. + Used to temporarily accumulate the intersections along a family of + parallel lines before sorting them */ + template + class InterceptSet2 + { + typedef std::vector > ContainerType; + typedef std::vector > > NewContainerType; + typedef InterceptBeam SortedType; + + public: + inline InterceptSet2(const vcg::Box2i &box) : bbox(box), set(box.DimX() + 1) { + typename ContainerType::iterator i, end = set.end(); + for (i = set.begin(); i != end; ++i) + i->resize(box.DimY() + 1); + } + + inline operator SortedType() const { return SortedType(bbox, typename SortedType::ContainerType(set.begin(), set.end())); } + + inline void AddIntercept (const vcg::Point2i &p, const InterceptType &x) { + assert (bbox.IsIn(p)); + vcg::Point2i c = p - bbox.min; + assert (c.X() >= 0); + assert (size_t(c.X()) < set.size()); + set[c.X()].AddIntercept(c.Y(), x); + } + + friend std::ostream& operator<<(std::ostream &out, const InterceptSet2 &x) { + typename ContainerType::const_iterator i, end = x.set.end(); + out << "InterceptSet2["; + for (i = x.set.begin(); i != end; ++i) + out << *i << std::endl; + return out << "]InterceptSet2"; + } + + private: + Box2i bbox; + ContainerType set; + }; + + /* Unsorted version of InterceptVolume. + Used to temporarily accumulate the intersections in a volume before sorting them. + Rasterization is performed on faces after casting them to an integral type, so that no + numerical instability can cause the volume to be inconsistent */ + template + class InterceptSet3 + { + typedef typename InterceptType::Scalar Scalar; + typedef typename InterceptType::DistType DistType; + typedef vcg::Point3 Point3dt; + typedef vcg::Point3 Point3x; + typedef InterceptSet2 ISet2Type; + typedef InterceptVolume SortedType; + typedef std::vector ContainerType; + + template + void RasterFace(const Point3dt &v0, const Point3dt &v1, const Point3dt &v2, + const vcg::Box3i &ibox, const Point3x &norm, const Scalar &quality) + { + const int crd0 = (CoordZ+0)%3; + const int crd1 = (CoordZ+1)%3; + const int crd2 = (CoordZ+2)%3; + const Point3dt d10 = v1 - v0; + const Point3dt d21 = v2 - v1; + const Point3dt d02 = v0 - v2; + + const DistType det0 = d21[crd2] * d02[crd1] - d21[crd1] * d02[crd2]; + const DistType det1 = d21[crd0] * d02[crd2] - d21[crd2] * d02[crd0]; + const DistType det2 = d21[crd1] * d02[crd0] - d21[crd0] * d02[crd1]; + + DistType n0xy = (v1[crd1]-ibox.min[crd1])*d21[crd2] - (v1[crd2]-ibox.min[crd2])*d21[crd1]; + DistType n1xy = (v2[crd1]-ibox.min[crd1])*d02[crd2] - (v2[crd2]-ibox.min[crd2])*d02[crd1]; + DistType n2xy = (v0[crd1]-ibox.min[crd1])*d10[crd2] - (v0[crd2]-ibox.min[crd2])*d10[crd1]; + const DistType n0dx = d21[crd2] + (ibox.Dim()[crd2] + 1) * d21[crd1]; + const DistType n1dx = d02[crd2] + (ibox.Dim()[crd2] + 1) * d02[crd1]; + const DistType n2dx = d10[crd2] + (ibox.Dim()[crd2] + 1) * d10[crd1]; + for(int x = ibox.min[crd1]; x <= ibox.max[crd1]; ++x) { + for(int y = ibox.min[crd2]; y <= ibox.max[crd2]; ++y) { + DistType n0 = n0xy, n1 = n1xy, n2 = n2xy; + + /* Solve the inside/outside problem for on-edge points. + The point (x,y,z) is actually considered to be + (x+eps, y+eps^2, z+eps^2) with eps->0. */ + if (crd1 > crd2) { + if (n0 == 0) + n0 = d21[crd1]; + if (n0 == 0) + n0 -= d21[crd2]; + + if (n1 == 0) + n1 = d02[crd1]; + if (n1 == 0) + n1 -= d02[crd2]; + + if (n2 == 0) + n2 = d10[crd1]; + if (n2 == 0) + n2 -= d10[crd2]; + } else { + if (n0 == 0) + n0 -= d21[crd2]; + if (n0 == 0) + n0 = d21[crd1]; + + if (n1 == 0) + n1 -= d02[crd2]; + if (n1 == 0) + n1 = d02[crd1]; + + if (n2 == 0) + n2 -= d10[crd2]; + if (n2 == 0) + n2 = d10[crd1]; + } + + if((n0>0 && n1>0 && n2>0) || (n0<0 && n1<0 && n2<0)) { + DistType d = (v0[crd2] - y) * det2 + (v0[crd1] - x) * det1; + d /= det0; + d += v0[crd0]; + assert (d >= ibox.min[crd0] && d <= ibox.max[crd0]); + set[crd0].AddIntercept(vcg::Point2i(x, y), InterceptType(d, norm, norm[crd0], quality)); + } + n0xy += d21[crd1]; + n1xy += d02[crd1]; + n2xy += d10[crd1]; + } + n0xy -= n0dx; + n1xy -= n1dx; + n2xy -= n2dx; + } + } + + void ScanFace(const Point3dt &v0, const Point3dt &v1, const Point3dt &v2, + const Point3x &norm, const Scalar &quality) { + vcg::Box3 fbox; + fbox.Add(v0); + fbox.Add(v1); + fbox.Add(v2); + for (int i=0; i<3; ++i) { + assert (v0[i] >= bbox.min[i] && v0[i] <= bbox.max[i]); + assert (v1[i] >= bbox.min[i] && v1[i] <= bbox.max[i]); + assert (v2[i] >= bbox.min[i] && v2[i] <= bbox.max[i]); + } + vcg::Box3i ibox(vcg::Point3i(floor(fbox.min.X()), floor(fbox.min.Y()), floor(fbox.min.Z())), + vcg::Point3i(ceil(fbox.max.X()), ceil(fbox.max.Y()), ceil(fbox.max.Z()))); + + RasterFace<0>(v0, v1, v2, ibox, norm, quality); + RasterFace<1>(v0, v1, v2, ibox, norm, quality); + RasterFace<2>(v0, v1, v2, ibox, norm, quality); + } + + public: + template + inline InterceptSet3(const MeshType &m, const Point3x &d, int subCellPrecision=32, vcg::CallBackPos *cb=vcg::DummyCallBackPos) : delta(d), + bbox(Point3i(floor(m.bbox.min.X() / d.X()) - 1, + floor(m.bbox.min.Y() / d.Y()) - 1, + floor(m.bbox.min.Z() / d.Z()) - 1), + Point3i(ceil(m.bbox.max.X() / d.X()) + 1, + ceil(m.bbox.max.Y() / d.Y()) + 1, + ceil(m.bbox.max.Z() / d.Z()) + 1)) + { + const Point3x invDelta(Scalar(1) / delta.X(), + Scalar(1) / delta.Y(), + Scalar(1) / delta.Z()); + + vcg::Box2i xy, yz, zx; + yz.Set(bbox.min.Y(), bbox.min.Z(), bbox.max.Y(), bbox.max.Z()); + zx.Set(bbox.min.Z(), bbox.min.X(), bbox.max.Z(), bbox.max.X()); + xy.Set(bbox.min.X(), bbox.min.Y(), bbox.max.X(), bbox.max.Y()); + + set.push_back(ISet2Type(yz)); + set.push_back(ISet2Type(zx)); + set.push_back(ISet2Type(xy)); + + typename MeshType::ConstFaceIterator i, end = m.face.end(); + const size_t nFaces = m.face.size(); + size_t f = 0; + for (i = m.face.begin(); i != end; ++i, ++f) { + if (!cb (100.0 * f / nFaces, "Rasterizing mesh...")) { + set.clear(); + set.push_back(ISet2Type(yz)); + set.push_back(ISet2Type(zx)); + set.push_back(ISet2Type(xy)); + return; + } + Point3x v0(i->cV(0)->P()), v1(i->cV(1)->P()), v2(i->cV(2)->P()); + v0.Scale(invDelta); + v1.Scale(invDelta); + v2.Scale(invDelta); + for (int j=0; j<3; ++j) { + assert (v0[j] >= bbox.min[j] && v0[j] <= bbox.max[j]); + assert (v1[j] >= bbox.min[j] && v1[j] <= bbox.max[j]); + assert (v2[j] >= bbox.min[j] && v2[j] <= bbox.max[j]); + } + ScanFace (Point3dt(makeFraction(v0.X()*subCellPrecision, subCellPrecision), + makeFraction(v0.Y()*subCellPrecision, subCellPrecision), + makeFraction(v0.Z()*subCellPrecision, subCellPrecision)), + Point3dt(makeFraction(v1.X()*subCellPrecision, subCellPrecision), + makeFraction(v1.Y()*subCellPrecision, subCellPrecision), + makeFraction(v1.Z()*subCellPrecision, subCellPrecision)), + Point3dt(makeFraction(v2.X()*subCellPrecision, subCellPrecision), + makeFraction(v2.Y()*subCellPrecision, subCellPrecision), + makeFraction(v2.Z()*subCellPrecision, subCellPrecision)), + i->cN().Normalize(), + i->cQ()); + } + } + + inline operator SortedType() const { return SortedType(bbox, delta, typename SortedType::ContainerType(set.begin(), set.end())); } + + friend std::ostream& operator<<(std::ostream &out, const InterceptSet3 &x) { + typename ContainerType::const_iterator i, end = x.set.end(); + out << "InterceptSet3["; + for (i = x.set.begin(); i != end; ++i) + out << *i << std::endl; + return out << "]InterceptSet3"; + } + + const Point3x delta; + const Box3i bbox; + private: + ContainerType set; + }; + + template + class Walker + { + typedef typename MeshType::VertexPointer VertexPointer; + typedef typename MeshType::CoordType CoordType; + typedef typename std::tr1::unordered_map VertexTable; + typedef typename std::tr1::unordered_map SamplesTable; + typedef typename std::tr1::unordered_set CellsSet; + + void clear() { + _vertices.clear(); + _samples.clear(); + _volume = NULL; + _mesh = NULL; + } + + public: + template + void BuildMesh(MeshType &mesh, InterceptVolume &volume, EXTRACTOR_TYPE &extractor, vcg::CallBackPos *cb=vcg::DummyCallBackPos) + { + CellsSet cset; /* cells to be visited */ + vcg::Point3i p; + + _volume = &volume; + _mesh = &mesh; + _mesh->Clear(); + + /* To improve performance, instead of visiting the whole volume, mark the cells + intersecting the surface so that they can be visited. + This usually lowers the complexity from n^3 to about n^2 (where n is the + number of samples along each direction */ + for (int c0=0; c0 < 3; ++c0) { + const int c1 = (c0 + 1) % 3, c2 = (c0 + 2) % 3; + for (p[c1]=_volume->bbox.min.V(c1); p[c1]<=_volume->bbox.max.V(c1); ++p[c1]) + for (p[c2]=_volume->bbox.min.V(c2); p[c2]<=_volume->bbox.max.V(c2); ++p[c2]) { + const InterceptRay& r = + _volume->GetInterceptRay(c0, vcg::Point2i(p[c1],p[c2])); + typename InterceptRay::ContainerType::const_iterator curr, end = r.container().end(); + for (curr = r.container().begin(); curr != end; ++curr) { + p[c0] = floor(curr->dist()); + if (curr->dist() == p[c0]) { + p[c0]--; + p[c1]--; + p[c2]--; + cset.insert(p); + p[c2]++; + cset.insert(p); + p[c1]++; + p[c2]--; + cset.insert(p); + p[c2]++; + cset.insert(p); + p[c0]++; + } + p[c1]--; + p[c2]--; + cset.insert(p); + p[c2]++; + cset.insert(p); + p[c1]++; + p[c2]--; + cset.insert(p); + p[c2]++; + cset.insert(p); + } + } + } + + /* Evaluating IsIn is "slow" (it requires binary search, so it's slower than an hashtable + access) and vertices of the cells are often shared, so precomputing them in the + _samples hashmap causes a performance improvement */ + const size_t n = cset.size(); + size_t i = 0; + for (CellsSet::const_iterator cell = cset.begin(); cell != cset.end(); ++cell, ++i) { + if (!cb(100.0 * i / n, "Precomputing in/out table...")) { + clear(); + return; + } + for (int i = 0; i < 2; ++i) + for (int j = 0; j < 2; ++j) + for (int k = 0; k < 2; ++k) { + vcg::Point3i p(*cell + vcg::Point3i(i, j, k)); + if (_samples.find(p) == _samples.end()) + _samples[p] = _volume->IsIn(p); + } + } + + const vcg::Point3i diag(1, 1, 1); + extractor.Initialize(); + i = 0; + /* Only visit marked cells */ + for (CellsSet::const_iterator cell = cset.begin(); cell != cset.end(); ++cell, ++i) { + if (!cb(100.0 * i / n, "Reconstructing surface...")) + break; + extractor.ProcessCell(*cell, *cell + diag); + } + extractor.Finalize(); + + clear(); + } + + inline float V(int i, int j, int k) const { return V(vcg::Point3i(i, j, k)); } + + inline float V(const vcg::Point3i &p) const { + /* use precomputed in/out result */ + typename SamplesTable::const_iterator s = _samples.find(p); + return s->second; + } + + template + void GetIntercept(const vcg::Point3i &p1, const vcg::Point3i &p2, VertexPointer& p) { + assert (p2 == p1 + vcg::Point3i(coord == 0, coord == 1, coord == 2)); + assert (_volume->IsIn(p1) != _volume->IsIn(p2)); + + const InterceptType& i = _volume->template GetIntercept(p1); + typename VertexTable::const_iterator v = _vertices.find(&i); + if (v == _vertices.end()) { + p = &*vcg::tri::Allocator::AddVertices(*_mesh, 1); + p->P().V(coord) = toFloat(i.dist()); + p->P().V((coord+1)%3) = p1[(coord+1)%3]; + p->P().V((coord+2)%3) = p1[(coord+2)%3]; + p->P().Scale(_volume->delta); + p->N() = i.norm(); + p->Q() = i.quality(); + _vertices[&i] = p - &_mesh->vert[0]; + } else /* a vertex is already associated with the intercept. reuse it */ + p = &_mesh->vert[v->second]; + } + + inline void GetXIntercept(const vcg::Point3i &p1, const vcg::Point3i &p2, VertexPointer& p) { GetIntercept<0>(p1, p2, p); } + + inline void GetYIntercept(const vcg::Point3i &p1, const vcg::Point3i &p2, VertexPointer& p) { GetIntercept<1>(p1, p2, p); } + + inline void GetZIntercept(const vcg::Point3i &p1, const vcg::Point3i &p2, VertexPointer& p) { GetIntercept<2>(p1, p2, p); } + + bool Exist(const vcg::Point3i &p1, const vcg::Point3i &p2, VertexPointer& p) { + if (V(p1) == V(p2)) + return false; + + vcg::Point3i d = p2 - p1; + if (d.X()) + GetXIntercept(p1, p2, p); + else if (d.Y()) + GetYIntercept(p1, p2, p); + else if (d.Z()) + GetZIntercept(p1, p2, p); + + return true; + } + + private: + VertexTable _vertices; /* maps intercept -> vertex of the reconstructed mesh */ + SamplesTable _samples; /* maps point -> in/out */ + InterceptVolume *_volume; + MeshType *_mesh; + }; + }; + + template + bool isValid(MeshType &mesh, StringType &errorMessage) { + if (vcg::tri::Clean::CountNonManifoldEdgeFF(mesh) > 0) + errorMessage = "non manifold edges"; + else if (vcg::tri::Clean::CountNonManifoldVertexFF(mesh) > 0) + errorMessage = "non manifold vertices"; + else if (!vcg::tri::Clean::IsSizeConsistent(mesh)) + errorMessage = "non size-consistent mesh"; + else { + int boundaryEdgeNum, internalEdgeNum; + vcg::tri::Clean::CountEdges(mesh, internalEdgeNum, boundaryEdgeNum); + if (boundaryEdgeNum > 0) + errorMessage = "non watertight mesh"; + else + return true; + } + return false; + } +}; +#endif // INTERCEPT_H diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.cpp b/src/meshlabplugins/filter_dirt/filter_dirt.cpp index 1b0613669..0dd190947 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.cpp +++ b/src/meshlabplugins/filter_dirt/filter_dirt.cpp @@ -22,7 +22,6 @@ ****************************************************************************/ #include -#include #include "filter_dirt.h" #include "particle.h" #include "dirt_utils.h" @@ -269,4 +268,4 @@ MeshFilterInterface::FilterClass FilterDirt::getClass(QAction *filter) } } -Q_EXPORT_PLUGIN(FilterDirt) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterDirt) diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.h b/src/meshlabplugins/filter_dirt/filter_dirt.h index 37aaaa493..c42283708 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.h +++ b/src/meshlabplugins/filter_dirt/filter_dirt.h @@ -42,6 +42,7 @@ using namespace vcg; class FilterDirt : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) protected: double x,y,z,nx,ny,nz,r,g,b,q,rad; diff --git a/src/meshlabplugins/filter_feature_alignment/filter_feature_alignment.cpp b/src/meshlabplugins/filter_feature_alignment/filter_feature_alignment.cpp index 4ad3d4c06..ee706f0c8 100644 --- a/src/meshlabplugins/filter_feature_alignment/filter_feature_alignment.cpp +++ b/src/meshlabplugins/filter_feature_alignment/filter_feature_alignment.cpp @@ -749,4 +749,4 @@ typename ALIGNER_TYPE::Result FilterFeatureAlignment::RansacDiagramOperation(Mes return res; //all right } -Q_EXPORT_PLUGIN(FilterFeatureAlignment) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterFeatureAlignment) diff --git a/src/meshlabplugins/filter_feature_alignment/filter_feature_alignment.h b/src/meshlabplugins/filter_feature_alignment/filter_feature_alignment.h index 3dba69395..7fb2b0c7b 100644 --- a/src/meshlabplugins/filter_feature_alignment/filter_feature_alignment.h +++ b/src/meshlabplugins/filter_feature_alignment/filter_feature_alignment.h @@ -37,6 +37,7 @@ using namespace vcg; class FilterFeatureAlignment : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.cpp b/src/meshlabplugins/filter_fractal/filter_fractal.cpp index 94d73fee0..989e34ac6 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.cpp +++ b/src/meshlabplugins/filter_fractal/filter_fractal.cpp @@ -22,7 +22,6 @@ ****************************************************************************/ #include -#include #include "filter_fractal.h" @@ -306,5 +305,5 @@ int FilterFractal::postCondition(QAction *filter) const } } // ---------------------------------------------------------------------- -Q_EXPORT_PLUGIN(FilterFractal) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterFractal) diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.h b/src/meshlabplugins/filter_fractal/filter_fractal.h index f6dba99ce..a92f9178d 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.h +++ b/src/meshlabplugins/filter_fractal/filter_fractal.h @@ -34,6 +34,7 @@ class FilterFractal : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_func/filter_func.cpp b/src/meshlabplugins/filter_func/filter_func.cpp index ef1baa757..880e64261 100644 --- a/src/meshlabplugins/filter_func/filter_func.cpp +++ b/src/meshlabplugins/filter_func/filter_func.cpp @@ -1285,4 +1285,4 @@ void FilterFunctionPlugin::setPerFaceVariables(Parser &p, CMeshO &m) } -Q_EXPORT_PLUGIN(FilterFunctionPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterFunctionPlugin) diff --git a/src/meshlabplugins/filter_func/filter_func.h b/src/meshlabplugins/filter_func/filter_func.h index 0d1ccd3fd..d2bf0d252 100644 --- a/src/meshlabplugins/filter_func/filter_func.h +++ b/src/meshlabplugins/filter_func/filter_func.h @@ -34,6 +34,7 @@ class FilterFunctionPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) protected: diff --git a/src/meshlabplugins/filter_func/filter_func.pro b/src/meshlabplugins/filter_func/filter_func.pro index 3bcce2a66..8f54ba3ea 100644 --- a/src/meshlabplugins/filter_func/filter_func.pro +++ b/src/meshlabplugins/filter_func/filter_func.pro @@ -13,6 +13,7 @@ INCLUDEPATH += ../../external/muparser_v132/include win32-msvc2005:LIBS += ../../external/lib/win32-msvc2005/muparser.lib win32-msvc2008:LIBS += ../../external/lib/win32-msvc2008/muparser.lib +win32-msvc2010:LIBS += ../../external/lib/win32-msvc2010/muparser.lib macx:LIBS += $$MACLIBDIR/libmuparser.a linux-g++:LIBS += ../../external/lib/linux-g++/libmuparser.a linux-g++-32:LIBS += ../../external/lib/linux-g++-32/libmuparser.a diff --git a/src/meshlabplugins/filter_img_patch_param/filter_img_patch_param.cpp b/src/meshlabplugins/filter_img_patch_param/filter_img_patch_param.cpp index 56c3ddb9b..8188f5dc2 100644 --- a/src/meshlabplugins/filter_img_patch_param/filter_img_patch_param.cpp +++ b/src/meshlabplugins/filter_img_patch_param/filter_img_patch_param.cpp @@ -981,4 +981,4 @@ int FilterImgPatchParamPlugin::computePatchCount( RasterPatchMap &patches ) -Q_EXPORT_PLUGIN(FilterImgPatchParamPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterImgPatchParamPlugin) diff --git a/src/meshlabplugins/filter_img_patch_param/filter_img_patch_param.h b/src/meshlabplugins/filter_img_patch_param/filter_img_patch_param.h index f33fbafa1..dfa0aebf5 100644 --- a/src/meshlabplugins/filter_img_patch_param/filter_img_patch_param.h +++ b/src/meshlabplugins/filter_img_patch_param/filter_img_patch_param.h @@ -38,6 +38,7 @@ class VisibleSet; class FilterImgPatchParamPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES( MeshFilterInterface ) enum diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp index 36aeae81c..df82aef89 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp @@ -22,7 +22,6 @@ ****************************************************************************/ #include -#include #include "defines.h" #include "../../common/meshmodel.h" @@ -529,4 +528,4 @@ int FilterIsoParametrization::postCondition( QAction* /*filter*/ ) const return MeshModel::MM_UNKNOWN; } -Q_EXPORT_PLUGIN(FilterIsoParametrization) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterIsoParametrization) diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h index 1f0581067..bcfa10a26 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h @@ -36,6 +36,7 @@ class FilterIsoParametrization : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.pro b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.pro index b4b21bbee..1760f77fa 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.pro +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.pro @@ -46,6 +46,7 @@ macx:QMAKE_LFLAGS += -fopenmp win32-msvc.net:LIBS += ../../external/lib/win32-msvc.net/levmar.lib win32-msvc2005:LIBS += ../../external/lib/win32-msvc2005/levmar.lib win32-msvc2008:LIBS += ../../external/lib/win32-msvc2008/levmar.lib +win32-msvc2010:LIBS += ../../external/lib/win32-msvc2010/levmar.lib win32-g++:LIBS += -L../../external/lib/win32-gcc -llevmar linux-g++:LIBS += -L../../external/lib/linux-g++ -llevmar linux-g++-32:LIBS += -L../../external/lib/linux-g++-32 -llevmar diff --git a/src/meshlabplugins/filter_layer/filter_layer.cpp b/src/meshlabplugins/filter_layer/filter_layer.cpp index aa03e3b47..686b61a85 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.cpp +++ b/src/meshlabplugins/filter_layer/filter_layer.cpp @@ -21,8 +21,6 @@ * * ****************************************************************************/ -#include - #include #include #include @@ -313,4 +311,4 @@ FilterLayerPlugin::FilterClass FilterLayerPlugin::getClass(QAction *a) } } -Q_EXPORT_PLUGIN(FilterLayerPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterLayerPlugin) diff --git a/src/meshlabplugins/filter_layer/filter_layer.h b/src/meshlabplugins/filter_layer/filter_layer.h index 439526b26..3e07ea1e3 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.h +++ b/src/meshlabplugins/filter_layer/filter_layer.h @@ -31,6 +31,7 @@ class FilterLayerPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_measure/filter_measure.cpp b/src/meshlabplugins/filter_measure/filter_measure.cpp index 813a76861..b9a346190 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.cpp +++ b/src/meshlabplugins/filter_measure/filter_measure.cpp @@ -20,9 +20,6 @@ * for more details. * * * ****************************************************************************/ - -#include - #include #include #include @@ -271,7 +268,7 @@ bool FilterMeasurePlugin::applyFilter( const QString& filterName,MeshDocument& m } -Q_EXPORT_PLUGIN(FilterMeasurePlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterMeasurePlugin) //case FP_MEASURE_GAUSSCURV : // { diff --git a/src/meshlabplugins/filter_measure/filter_measure.h b/src/meshlabplugins/filter_measure/filter_measure.h index edb3b6c7a..f804dc657 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.h +++ b/src/meshlabplugins/filter_measure/filter_measure.h @@ -31,6 +31,7 @@ class FilterMeasurePlugin : public MeshLabFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESHLAB_FILTER_INTERFACE_IID) Q_INTERFACES(MeshLabFilterInterface) public: diff --git a/src/meshlabplugins/filter_meshing/filter_meshing.pro b/src/meshlabplugins/filter_meshing/filter_meshing.pro index a54393877..c7ee4d5e5 100644 --- a/src/meshlabplugins/filter_meshing/filter_meshing.pro +++ b/src/meshlabplugins/filter_meshing/filter_meshing.pro @@ -11,4 +11,3 @@ SOURCES += meshfilter.cpp \ TARGET = filter_meshing -QT += opengl diff --git a/src/meshlabplugins/filter_mutualinfoxml/alignset.cpp b/src/meshlabplugins/filter_mutualinfoxml/alignset.cpp index 82e06561b..315c25faf 100644 --- a/src/meshlabplugins/filter_mutualinfoxml/alignset.cpp +++ b/src/meshlabplugins/filter_mutualinfoxml/alignset.cpp @@ -323,13 +323,13 @@ GLuint AlignSet::createShaderFromFiles(QString name) { QString vert = "shaders/" + name + ".vert"; QString frag = "shaders/" + name + ".frag"; - const char *vs_src = ShaderUtils::importShaders(vert.toAscii().data()); + const char *vs_src = ShaderUtils::importShaders(vert.toLocal8Bit().data()); if(!vs_src) { cerr << "Could not load shader: " << qPrintable(vert) << endl; return 0; } - const char *fs_src = ShaderUtils::importShaders(frag.toAscii().data()); + const char *fs_src = ShaderUtils::importShaders(frag.toLocal8Bit().data()); if(!fs_src) { cerr << "Could not load shader: " << qPrintable(frag) << endl; return 0; diff --git a/src/meshlabplugins/filter_mutualinfoxml/filter_mutualinfo.cpp b/src/meshlabplugins/filter_mutualinfoxml/filter_mutualinfo.cpp index ed996afd3..111b87306 100644 --- a/src/meshlabplugins/filter_mutualinfoxml/filter_mutualinfo.cpp +++ b/src/meshlabplugins/filter_mutualinfoxml/filter_mutualinfo.cpp @@ -207,4 +207,4 @@ bool MutualInfoPlugin::initGL() Log(0, "GL Initialization done"); return true; } -Q_EXPORT_PLUGIN(MutualInfoPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(MutualInfoPlugin) diff --git a/src/meshlabplugins/filter_mutualinfoxml/filter_mutualinfo.h b/src/meshlabplugins/filter_mutualinfoxml/filter_mutualinfo.h index 7ac97a370..bed6272b6 100644 --- a/src/meshlabplugins/filter_mutualinfoxml/filter_mutualinfo.h +++ b/src/meshlabplugins/filter_mutualinfoxml/filter_mutualinfo.h @@ -30,6 +30,7 @@ class MutualInfoPlugin : public MeshLabFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESHLAB_FILTER_INTERFACE_IID) Q_INTERFACES(MeshLabFilterInterface) public: MutualInfoPlugin(): MeshLabFilterInterface() {} diff --git a/src/meshlabplugins/filter_photosynth/filter_photosynth.cpp b/src/meshlabplugins/filter_photosynth/filter_photosynth.cpp index 4cb53f344..97590e215 100644 --- a/src/meshlabplugins/filter_photosynth/filter_photosynth.cpp +++ b/src/meshlabplugins/filter_photosynth/filter_photosynth.cpp @@ -261,4 +261,4 @@ void FilterPhotosynthPlugin::outputToFile(QTextStream &out, Shotf &s, Image &img out << "\n\n\n\n"; } -Q_EXPORT_PLUGIN(FilterPhotosynthPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterPhotosynthPlugin) diff --git a/src/meshlabplugins/filter_photosynth/filter_photosynth.h b/src/meshlabplugins/filter_photosynth/filter_photosynth.h index 7ecc0430f..2b5fd6b04 100644 --- a/src/meshlabplugins/filter_photosynth/filter_photosynth.h +++ b/src/meshlabplugins/filter_photosynth/filter_photosynth.h @@ -21,6 +21,7 @@ class FilterPhotosynthPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.cpp b/src/meshlabplugins/filter_plymc/filter_plymc.cpp index 433f9f946..ccce6c265 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.cpp +++ b/src/meshlabplugins/filter_plymc/filter_plymc.cpp @@ -195,4 +195,4 @@ bool PlyMCPlugin::applyFilter(QAction *filter, MeshDocument &md, RichParameterSe return true; } -Q_EXPORT_PLUGIN(PlyMCPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(PlyMCPlugin) diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.h b/src/meshlabplugins/filter_plymc/filter_plymc.h index 6356f7761..821ee1c9c 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.h +++ b/src/meshlabplugins/filter_plymc/filter_plymc.h @@ -29,6 +29,7 @@ class PlyMCPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.pro b/src/meshlabplugins/filter_plymc/filter_plymc.pro index 9b8a8469d..96036a660 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.pro +++ b/src/meshlabplugins/filter_plymc/filter_plymc.pro @@ -12,5 +12,4 @@ HEADERS += filter_plymc.h \ SOURCES += filter_plymc.cpp \ $$VCGDIR/wrap/ply/plylib.cpp -TARGET = filter_plymc -QT += opengl +TARGET = filter_plymc \ No newline at end of file diff --git a/src/meshlabplugins/filter_poisson/filter_poisson.cpp b/src/meshlabplugins/filter_poisson/filter_poisson.cpp index dbdfd83a9..8fdb1792f 100644 --- a/src/meshlabplugins/filter_poisson/filter_poisson.cpp +++ b/src/meshlabplugins/filter_poisson/filter_poisson.cpp @@ -34,8 +34,6 @@ add samplefilter ****************************************************************************/ -#include - #include #include #include @@ -246,4 +244,4 @@ for (i=0; i < nr_faces; i++){ } -Q_EXPORT_PLUGIN(PoissonPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(PoissonPlugin) diff --git a/src/meshlabplugins/filter_poisson/filter_poisson.h b/src/meshlabplugins/filter_poisson/filter_poisson.h index 54037db05..293ce4f17 100644 --- a/src/meshlabplugins/filter_poisson/filter_poisson.h +++ b/src/meshlabplugins/filter_poisson/filter_poisson.h @@ -41,6 +41,7 @@ add sampleplugins class PoissonPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.cpp b/src/meshlabplugins/filter_qhull/filter_qhull.cpp index bbbf2b330..8ef5ee75d 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.cpp +++ b/src/meshlabplugins/filter_qhull/filter_qhull.cpp @@ -544,4 +544,4 @@ bool QhullPlugin::applyFilter(QAction *filter, MeshDocument &md, RichParameterSe assert(0); return false; } -Q_EXPORT_PLUGIN(QhullPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(QhullPlugin) diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.h b/src/meshlabplugins/filter_qhull/filter_qhull.h index ba6478013..5abd10a62 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.h +++ b/src/meshlabplugins/filter_qhull/filter_qhull.h @@ -34,6 +34,7 @@ class QhullPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.pro b/src/meshlabplugins/filter_qhull/filter_qhull.pro index 864ea7df6..06dccb02f 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.pro +++ b/src/meshlabplugins/filter_qhull/filter_qhull.pro @@ -1,7 +1,5 @@ include (../../shared.pri) -QT += opengl - HEADERS += filter_qhull.h \ qhull_tools.h diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp index f2dd09124..13f6c82e3 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp @@ -26,8 +26,6 @@ Revision 1.0 2008/02/20 Alessandro Maione, Federico Bellucci FIRST RELEASE ****************************************************************************/ - -#include #include #include #include "filterqualitymapper.h" @@ -198,4 +196,4 @@ int QualityMapperFilter::postCondition( QAction* a) const return MeshModel::MM_UNKNOWN; } } -Q_EXPORT_PLUGIN(QualityMapperFilter) +MESHLAB_PLUGIN_NAME_EXPORTER(QualityMapperFilter) diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.h b/src/meshlabplugins/filter_quality/filterqualitymapper.h index aff082002..c7e8062a5 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.h +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.h @@ -58,6 +58,7 @@ using namespace std; class QualityMapperFilter : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) private: diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.cpp b/src/meshlabplugins/filter_sampling/filter_sampling.cpp index 108b667b5..6befe6a34 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.cpp +++ b/src/meshlabplugins/filter_sampling/filter_sampling.cpp @@ -25,8 +25,6 @@ $Log: samplefilter.cpp,v $ ****************************************************************************/ -#include - #include #include #include @@ -1185,4 +1183,4 @@ int FilterDocSampling::postCondition( QAction* a ) const return MeshModel::MM_UNKNOWN; } -Q_EXPORT_PLUGIN(FilterDocSampling) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterDocSampling) diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.h b/src/meshlabplugins/filter_sampling/filter_sampling.h index 16aaa295e..7f01d6f96 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.h +++ b/src/meshlabplugins/filter_sampling/filter_sampling.h @@ -40,6 +40,7 @@ add sampleplugins class FilterDocSampling : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_sdf/filter_sdf.cpp b/src/meshlabplugins/filter_sdf/filter_sdf.cpp index f90d92245..f564f138d 100644 --- a/src/meshlabplugins/filter_sdf/filter_sdf.cpp +++ b/src/meshlabplugins/filter_sdf/filter_sdf.cpp @@ -149,4 +149,4 @@ bool SdfPlugin::applyFilter(MeshDocument& md, RichParameterSet& pars, vcg::CallB } return true; } -Q_EXPORT_PLUGIN(SdfPlugin) + MESHLAB_PLUGIN_NAME_EXPORTER(SdfPlugin) diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp index 17d64bbc1..541b8c44a 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp @@ -429,7 +429,7 @@ bool SdfGpuPlugin::initGL(MeshModel& mm) glGenQueriesARB( 1, &mOcclusionQuery ); - checkGLError::qDebug("GL Init failed"); + checkGLError::debugInfo("GL Init failed"); return true; } @@ -538,7 +538,7 @@ void SdfGpuPlugin::releaseGL(MeshModel &m) glDeleteQueriesARB( 1, &mOcclusionQuery ); - checkGLError::qDebug("GL release failed"); + checkGLError::debugInfo("GL release failed"); this->glContext->doneCurrent(); } @@ -1095,8 +1095,8 @@ void SdfGpuPlugin::TraceRay(int peelingIteration,const Point3f& dir, MeshModel* assert(mFboArray[1]->isValid()); assert(mFboArray[2]->isValid()); - checkGLError::qDebug("Error during depth peeling"); + checkGLError::debugInfo("Error during depth peeling"); } -Q_EXPORT_PLUGIN(SdfGpuPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(SdfGpuPlugin) diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h index af742e91a..809bab9af 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h @@ -14,6 +14,7 @@ enum ONPRIMITIVE{ON_VERTICES=0, ON_FACES=1}; class SdfGpuPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.pro b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.pro index 7626466c7..43c8418d5 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.pro +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.pro @@ -20,7 +20,7 @@ SOURCES += filter_sdfgpu.cpp \ ../../meshlabplugins/render_radiance_scaling/textureFormat.cpp TARGET = filter_sdfgpu TEMPLATE = lib -QT += opengl + CONFIG += plugin DEPENDPATH += ./shaders diff --git a/src/meshlabplugins/filter_select/meshselect.cpp b/src/meshlabplugins/filter_select/meshselect.cpp index 3555d7c19..b9d7f4687 100644 --- a/src/meshlabplugins/filter_select/meshselect.cpp +++ b/src/meshlabplugins/filter_select/meshselect.cpp @@ -20,7 +20,6 @@ * for more details. * * * ****************************************************************************/ -#include #include #include @@ -477,4 +476,4 @@ int SelectionFilterPlugin::getPreConditions( QAction * action) const } return 0; } -Q_EXPORT_PLUGIN(SelectionFilterPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(SelectionFilterPlugin) diff --git a/src/meshlabplugins/filter_select/meshselect.h b/src/meshlabplugins/filter_select/meshselect.h index debbf76e4..cf982a883 100644 --- a/src/meshlabplugins/filter_select/meshselect.h +++ b/src/meshlabplugins/filter_select/meshselect.h @@ -31,6 +31,7 @@ class SelectionFilterPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp index d6b49dbc2..f0c5a66b4 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp @@ -1,5 +1,4 @@ #include -#include #include "filter_ssynth.h" #include #include @@ -247,7 +246,7 @@ QList FilterSSynth::importFormats() const grammar->insert(0,tosub); } } - Q_EXPORT_PLUGIN(FilterSSynth) + MESHLAB_PLUGIN_NAME_EXPORTER(FilterSSynth) diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.h b/src/meshlabplugins/filter_ssynth/filter_ssynth.h index 18760d979..d63ccd265 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.h +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.h @@ -33,6 +33,7 @@ class FilterSSynth : public QObject,public MeshIOInterface, public MeshFilterInterface{ Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: enum {CR_SSYNTH} ; diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.pro b/src/meshlabplugins/filter_ssynth/filter_ssynth.pro index bf323157f..c2665c186 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.pro +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.pro @@ -19,7 +19,7 @@ linux-g++:LIBS += ../../external/lib/linux-g++/libssynth.a macx:LIBS += ../../external/lib/macx64/libssynth.a TARGET = filter_ssynth TEMPLATE = lib -QT += opengl + CONFIG += plugin OTHER_FILES += x3d.rendertemplate \ x3d2.rendertemplate \ diff --git a/src/meshlabplugins/filter_texture/filter_texture.cpp b/src/meshlabplugins/filter_texture/filter_texture.cpp index d2d37dc7b..eda49a58c 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.cpp +++ b/src/meshlabplugins/filter_texture/filter_texture.cpp @@ -21,7 +21,7 @@ * * ****************************************************************************/ #include -#include + #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET #include #include @@ -914,4 +914,4 @@ bool FilterTexturePlugin::applyFilter(QAction *filter, MeshDocument &md, RichPar return true; } -Q_EXPORT_PLUGIN(FilterTexturePlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterTexturePlugin) diff --git a/src/meshlabplugins/filter_texture/filter_texture.h b/src/meshlabplugins/filter_texture/filter_texture.h index e3071ed1b..1895add70 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.h +++ b/src/meshlabplugins/filter_texture/filter_texture.h @@ -37,6 +37,7 @@ class FilterTexturePlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp index e5bc500f9..7e274e4ac 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp @@ -21,8 +21,6 @@ * * ****************************************************************************/ -#include - #include #include #include @@ -395,4 +393,4 @@ bool TriOptimizePlugin::applyFilter(QAction *filter, MeshDocument &md, RichParam } -Q_EXPORT_PLUGIN(TriOptimizePlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(TriOptimizePlugin) diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h index 573b645b5..8443e5673 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h @@ -30,6 +30,7 @@ class TriOptimizePlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.pro b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.pro index fa6209872..c6d91a164 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.pro +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.pro @@ -1,6 +1,5 @@ include (../../shared.pri) -QT += opengl HEADERS += filter_trioptimize.h \ curvedgeflip.h \ diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp index e226e5b9c..eafc13fe5 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp @@ -21,7 +21,6 @@ * * ****************************************************************************/ #include -#include #include "filter_unsharp.h" #include @@ -672,4 +671,4 @@ bool FilterUnsharp::applyFilter(QAction *filter, MeshDocument &md, RichParameter } -Q_EXPORT_PLUGIN(FilterUnsharp) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterUnsharp) diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.h b/src/meshlabplugins/filter_unsharp/filter_unsharp.h index da9998c58..e54a6af0b 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.h +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.h @@ -30,6 +30,7 @@ class FilterUnsharp : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/meshlabplugins/filter_zippering/filter_zippering.cpp b/src/meshlabplugins/filter_zippering/filter_zippering.cpp index 009f91ec0..59ebdb8ac 100644 --- a/src/meshlabplugins/filter_zippering/filter_zippering.cpp +++ b/src/meshlabplugins/filter_zippering/filter_zippering.cpp @@ -26,7 +26,6 @@ ****************************************************************************/ -#include #include "filter_zippering.h" #include @@ -1695,4 +1694,4 @@ bool FilterZippering::applyFilter(QAction *filter, MeshDocument &md, RichParamet return true; } -Q_EXPORT_PLUGIN(FilterZippering) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterZippering) diff --git a/src/meshlabplugins/filter_zippering/filter_zippering.h b/src/meshlabplugins/filter_zippering/filter_zippering.h index 23bb6354c..31c64ce11 100644 --- a/src/meshlabplugins/filter_zippering/filter_zippering.h +++ b/src/meshlabplugins/filter_zippering/filter_zippering.h @@ -280,6 +280,7 @@ class compareFaceQuality { class FilterZippering : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) typedef vcg::GridStaticPtr MeshFaceGrid; diff --git a/src/meshlabplugins/filter_zippering/filter_zippering.pro b/src/meshlabplugins/filter_zippering/filter_zippering.pro index d66cb7d33..812b680a0 100644 --- a/src/meshlabplugins/filter_zippering/filter_zippering.pro +++ b/src/meshlabplugins/filter_zippering/filter_zippering.pro @@ -3,4 +3,3 @@ HEADERS += filter_zippering.h SOURCES += filter_zippering.cpp TARGET = filter_zippering -QT += opengl diff --git a/src/meshlabplugins/io_3ds/meshio.cpp b/src/meshlabplugins/io_3ds/meshio.cpp index ba16533c6..0016fde9f 100644 --- a/src/meshlabplugins/io_3ds/meshio.cpp +++ b/src/meshlabplugins/io_3ds/meshio.cpp @@ -22,7 +22,6 @@ ****************************************************************************/ #include -#include #include "meshio.h" @@ -165,4 +164,4 @@ void ExtraMeshIOPlugin::GetExportMaskCapability(QString &format, int &capability return; } -Q_EXPORT_PLUGIN(ExtraMeshIOPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(ExtraMeshIOPlugin) diff --git a/src/meshlabplugins/io_3ds/meshio.h b/src/meshlabplugins/io_3ds/meshio.h index 45e1345ca..c2e323773 100644 --- a/src/meshlabplugins/io_3ds/meshio.h +++ b/src/meshlabplugins/io_3ds/meshio.h @@ -32,6 +32,7 @@ class ExtraMeshIOPlugin : public QObject, public MeshIOInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) Q_INTERFACES(MeshIOInterface) diff --git a/src/meshlabplugins/io_bre/io_bre.cpp b/src/meshlabplugins/io_bre/io_bre.cpp index d55ba552e..5be9f85a5 100644 --- a/src/meshlabplugins/io_bre/io_bre.cpp +++ b/src/meshlabplugins/io_bre/io_bre.cpp @@ -22,7 +22,6 @@ ****************************************************************************/ #include -#include #include #include "io_bre.h" @@ -241,7 +240,7 @@ bool vcg::tri::io::BreHeader::Read(QFile &file) bool success = ( 1 == file.read(m_data.data(), 256)); const QString testBR = "BR"; - QString testStr = QString::fromAscii(m_data.data()+6, 2); + QString testStr = QString::fromUtf8(m_data.data()+6, 2); success = (QString::compare(testBR, testStr) == 0); if ( success && Size() > 256 ) @@ -750,4 +749,4 @@ bool BGrid::TriangleContainZ( const OpenObjects::TCoord& a, const OpenObje -Q_EXPORT_PLUGIN(BreMeshIOPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(BreMeshIOPlugin) diff --git a/src/meshlabplugins/io_bre/io_bre.h b/src/meshlabplugins/io_bre/io_bre.h index 4b6d56154..3205e03cb 100644 --- a/src/meshlabplugins/io_bre/io_bre.h +++ b/src/meshlabplugins/io_bre/io_bre.h @@ -152,6 +152,7 @@ namespace io { class BreMeshIOPlugin : public QObject, public MeshIOInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) Q_INTERFACES(MeshIOInterface) public: diff --git a/src/meshlabplugins/io_collada/io_collada.cpp b/src/meshlabplugins/io_collada/io_collada.cpp index cd7e7a6d3..129e2c5ee 100644 --- a/src/meshlabplugins/io_collada/io_collada.cpp +++ b/src/meshlabplugins/io_collada/io_collada.cpp @@ -88,7 +88,6 @@ #include #include -#include #include "io_collada.h" @@ -243,4 +242,4 @@ void ColladaIOPlugin::GetExportMaskCapability(QString &format, int &capability, assert(0); } -Q_EXPORT_PLUGIN(ColladaIOPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(ColladaIOPlugin) diff --git a/src/meshlabplugins/io_collada/io_collada.h b/src/meshlabplugins/io_collada/io_collada.h index 64d2f71e4..7b52d494d 100644 --- a/src/meshlabplugins/io_collada/io_collada.h +++ b/src/meshlabplugins/io_collada/io_collada.h @@ -49,6 +49,7 @@ class ColladaIOPlugin : public QObject, public MeshIOInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) Q_INTERFACES(MeshIOInterface) public: diff --git a/src/meshlabplugins/io_collada/io_collada.pro b/src/meshlabplugins/io_collada/io_collada.pro index ccc8b11cc..e68becfe4 100644 --- a/src/meshlabplugins/io_collada/io_collada.pro +++ b/src/meshlabplugins/io_collada/io_collada.pro @@ -13,5 +13,3 @@ SOURCES += io_collada.cpp \ TARGET = io_collada -QT += xml opengl - diff --git a/src/meshlabplugins/io_ctm/io_ctm.cpp b/src/meshlabplugins/io_ctm/io_ctm.cpp index c217b15c6..2b9f19379 100644 --- a/src/meshlabplugins/io_ctm/io_ctm.cpp +++ b/src/meshlabplugins/io_ctm/io_ctm.cpp @@ -25,7 +25,6 @@ $Log: meshio.cpp,v $ *****************************************************************************/ #include -#include #include "io_ctm.h" @@ -101,4 +100,4 @@ void IOMPlugin::initSaveParameter(const QString &/*format*/, MeshModel &/*m*/, R "When using a lossy compression this number control the introduced error and hence the compression factor." "It is a number relative to the average edge lenght. (e.g. the default means that the error should be roughly 1/10000 of the average edge lenght)")); } -Q_EXPORT_PLUGIN(IOMPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(IOMPlugin) diff --git a/src/meshlabplugins/io_ctm/io_ctm.h b/src/meshlabplugins/io_ctm/io_ctm.h index 63499c455..ad583da9c 100644 --- a/src/meshlabplugins/io_ctm/io_ctm.h +++ b/src/meshlabplugins/io_ctm/io_ctm.h @@ -36,6 +36,7 @@ class IOMPlugin : public QObject, public MeshIOInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) Q_INTERFACES(MeshIOInterface) diff --git a/src/meshlabplugins/io_ctm/io_ctm.pro b/src/meshlabplugins/io_ctm/io_ctm.pro index 1084902c4..f5bacd9d4 100644 --- a/src/meshlabplugins/io_ctm/io_ctm.pro +++ b/src/meshlabplugins/io_ctm/io_ctm.pro @@ -9,11 +9,13 @@ TARGET = io_ctm win32-msvc.net:QMAKE_CXXFLAGS += /DOPENCTM_STATIC win32-msvc2005:QMAKE_CXXFLAGS += /DOPENCTM_STATIC win32-msvc2008:QMAKE_CXXFLAGS += /DOPENCTM_STATIC +win32-msvc2010:QMAKE_CXXFLAGS += /DOPENCTM_STATIC win32-g++:DEFINES += OPENCTM_STATIC win32-msvc.net:LIBS += ../../external/lib/win32-msvc.net/openctm.lib win32-msvc2005:LIBS += ../../external/lib/win32-msvc2005/openctm.lib win32-msvc2008:LIBS += ../../external/lib/win32-msvc2008/openctm.lib +win32-msvc2010:LIBS += ../../external/lib/win32-msvc2010/openctm.lib win32-g++:LIBS += ../../external/lib/win32-gcc/libopenctm.a linux-g++:LIBS += ../../external/lib/linux-g++/libopenctm.a linux-g++-32:LIBS += ../../external/lib/linux-g++-32/libopenctm.a diff --git a/src/meshlabplugins/io_expe/import_xyz.h b/src/meshlabplugins/io_expe/import_xyz.h index 12a2a1f10..ba4c6bfee 100644 --- a/src/meshlabplugins/io_expe/import_xyz.h +++ b/src/meshlabplugins/io_expe/import_xyz.h @@ -204,9 +204,9 @@ class ImporterXYZ } else { - std::cerr << "error: skip line " << buf.toAscii().data() << "\n"; + std::cerr << "error: skip line " << buf.toUtf8().data() << "\n"; for (int i=0; i -#include #include "io_expe.h" @@ -167,4 +166,4 @@ void ExpeIOPlugin::GetExportMaskCapability(QString &format, int &capability, int return; } -Q_EXPORT_PLUGIN(ExpeIOPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(ExpeIOPlugin) diff --git a/src/meshlabplugins/io_expe/io_expe.h b/src/meshlabplugins/io_expe/io_expe.h index 9f9ee9940..8b0dd5377 100644 --- a/src/meshlabplugins/io_expe/io_expe.h +++ b/src/meshlabplugins/io_expe/io_expe.h @@ -31,6 +31,7 @@ class ExpeIOPlugin : public QObject, public MeshIOInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) Q_INTERFACES(MeshIOInterface) diff --git a/src/meshlabplugins/io_expe/io_expe.pro b/src/meshlabplugins/io_expe/io_expe.pro index 7d5431732..91264e31f 100644 --- a/src/meshlabplugins/io_expe/io_expe.pro +++ b/src/meshlabplugins/io_expe/io_expe.pro @@ -7,6 +7,4 @@ HEADERS += io_expe.h \ SOURCES += io_expe.cpp -TARGET = io_expe - -CONFIG += opengl \ No newline at end of file +TARGET = io_expe \ No newline at end of file diff --git a/src/meshlabplugins/io_gts/io_gts.cpp b/src/meshlabplugins/io_gts/io_gts.cpp index 0ba174605..1a742fffb 100644 --- a/src/meshlabplugins/io_gts/io_gts.cpp +++ b/src/meshlabplugins/io_gts/io_gts.cpp @@ -22,7 +22,6 @@ ****************************************************************************/ #include -#include #include "io_gts.h" @@ -144,4 +143,4 @@ void GtsIOPlugin::GetExportMaskCapability(QString &format, int &capability, int return; } -Q_EXPORT_PLUGIN(GtsIOPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(GtsIOPlugin) diff --git a/src/meshlabplugins/io_gts/io_gts.h b/src/meshlabplugins/io_gts/io_gts.h index 73120a3a8..bebc546af 100644 --- a/src/meshlabplugins/io_gts/io_gts.h +++ b/src/meshlabplugins/io_gts/io_gts.h @@ -31,6 +31,7 @@ class GtsIOPlugin : public QObject, public MeshIOInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) Q_INTERFACES(MeshIOInterface) diff --git a/src/meshlabplugins/io_json/io_json.cpp b/src/meshlabplugins/io_json/io_json.cpp index f7ad7c1c3..9a5670a2a 100644 --- a/src/meshlabplugins/io_json/io_json.cpp +++ b/src/meshlabplugins/io_json/io_json.cpp @@ -466,4 +466,4 @@ void JSONIOPlugin::GetExportMaskCapability(QString & format, int & capability, i } } -Q_EXPORT_PLUGIN(JSONIOPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(JSONIOPlugin) diff --git a/src/meshlabplugins/io_json/io_json.h b/src/meshlabplugins/io_json/io_json.h index 846e9f206..8239f0ee3 100644 --- a/src/meshlabplugins/io_json/io_json.h +++ b/src/meshlabplugins/io_json/io_json.h @@ -28,6 +28,7 @@ class JSONIOPlugin : public QObject, public MeshIOInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) Q_INTERFACES(MeshIOInterface) public: diff --git a/src/meshlabplugins/io_pdb/io_pdb.cpp b/src/meshlabplugins/io_pdb/io_pdb.cpp index 87fef4c1b..d33d9f9f4 100644 --- a/src/meshlabplugins/io_pdb/io_pdb.cpp +++ b/src/meshlabplugins/io_pdb/io_pdb.cpp @@ -22,7 +22,6 @@ ****************************************************************************/ #include -#include #include "io_pdb.h" @@ -198,7 +197,7 @@ void PDBIOPlugin::applyOpenParameter(const QString &format, MeshModel &m, const */ } -Q_EXPORT_PLUGIN(PDBIOPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(PDBIOPlugin) //---------- PDB READER -----------// diff --git a/src/meshlabplugins/io_pdb/io_pdb.h b/src/meshlabplugins/io_pdb/io_pdb.h index cdcc2a4bb..1054c4719 100644 --- a/src/meshlabplugins/io_pdb/io_pdb.h +++ b/src/meshlabplugins/io_pdb/io_pdb.h @@ -30,6 +30,7 @@ class PDBIOPlugin : public QObject, public MeshIOInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) Q_INTERFACES(MeshIOInterface) diff --git a/src/meshlabplugins/io_tri/io_tri.cpp b/src/meshlabplugins/io_tri/io_tri.cpp index 71a824217..8bf424084 100755 --- a/src/meshlabplugins/io_tri/io_tri.cpp +++ b/src/meshlabplugins/io_tri/io_tri.cpp @@ -25,7 +25,6 @@ $Log: meshio.cpp,v $ *****************************************************************************/ #include -#include #include "io_tri.h" @@ -333,4 +332,4 @@ bool parseTRI(const std::string &filename, CMeshO &m) { -Q_EXPORT_PLUGIN(TriIOPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(TriIOPlugin) diff --git a/src/meshlabplugins/io_tri/io_tri.h b/src/meshlabplugins/io_tri/io_tri.h index 307dbbfa7..4dd7bc9e8 100755 --- a/src/meshlabplugins/io_tri/io_tri.h +++ b/src/meshlabplugins/io_tri/io_tri.h @@ -36,6 +36,7 @@ class TriIOPlugin : public QObject, public MeshIOInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) Q_INTERFACES(MeshIOInterface) diff --git a/src/meshlabplugins/io_u3d/io_u3d.cpp b/src/meshlabplugins/io_u3d/io_u3d.cpp index d385216c7..cc55bca92 100644 --- a/src/meshlabplugins/io_u3d/io_u3d.cpp +++ b/src/meshlabplugins/io_u3d/io_u3d.cpp @@ -25,7 +25,6 @@ #include -#include #include "io_u3d.h" #include @@ -220,4 +219,4 @@ void U3DIOPlugin::saveParameters(const RichParameterSet &par) delete sw; } -Q_EXPORT_PLUGIN(U3DIOPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(U3DIOPlugin) diff --git a/src/meshlabplugins/io_u3d/io_u3d.h b/src/meshlabplugins/io_u3d/io_u3d.h index d940c8d3e..f76d8bb7d 100644 --- a/src/meshlabplugins/io_u3d/io_u3d.h +++ b/src/meshlabplugins/io_u3d/io_u3d.h @@ -35,6 +35,7 @@ class U3DIOPlugin : public QObject, public MeshIOInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) Q_INTERFACES(MeshIOInterface) public: diff --git a/src/meshlabplugins/io_x3d/io_x3d.cpp b/src/meshlabplugins/io_x3d/io_x3d.cpp index 0d68d7c0e..779503b85 100644 --- a/src/meshlabplugins/io_x3d/io_x3d.cpp +++ b/src/meshlabplugins/io_x3d/io_x3d.cpp @@ -22,7 +22,6 @@ ****************************************************************************/ #include -#include #include @@ -185,4 +184,4 @@ void IoX3DPlugin::GetExportMaskCapability(QString &format, int &capability, int assert(0); } -Q_EXPORT_PLUGIN(IoX3DPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(IoX3DPlugin) diff --git a/src/meshlabplugins/io_x3d/io_x3d.h b/src/meshlabplugins/io_x3d/io_x3d.h index 743fb22df..af441f508 100644 --- a/src/meshlabplugins/io_x3d/io_x3d.h +++ b/src/meshlabplugins/io_x3d/io_x3d.h @@ -38,10 +38,11 @@ class IoX3DPlugin : public QObject, public MeshIOInterface { - Q_OBJECT - Q_INTERFACES(MeshIOInterface) + Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) + Q_INTERFACES(MeshIOInterface) + - public: QList importFormats() const; QList exportFormats() const; diff --git a/src/meshlabplugins/io_x3d/io_x3d.pro b/src/meshlabplugins/io_x3d/io_x3d.pro index f53174873..d0555d753 100644 --- a/src/meshlabplugins/io_x3d/io_x3d.pro +++ b/src/meshlabplugins/io_x3d/io_x3d.pro @@ -6,7 +6,6 @@ HEADERS += io_x3d.h import_x3d.h\ ./vrml/Scanner.h SOURCES += io_x3d.cpp ./vrml/Parser.cpp ./vrml/Scanner.cpp -QT += opengl xml TARGET = io_x3d diff --git a/src/meshlabplugins/io_x3d/vrml/Parser.cpp b/src/meshlabplugins/io_x3d/vrml/Parser.cpp index 6fe253db0..4fa45faba 100644 --- a/src/meshlabplugins/io_x3d/vrml/Parser.cpp +++ b/src/meshlabplugins/io_x3d/vrml/Parser.cpp @@ -322,9 +322,9 @@ void Parser::Proto(QDomElement& parent) { node.setAttribute("name", name); proto.insert(name); Expect(22); - QDomElement interface = doc->createElement("ProtoInterface"); - InterfaceDeclarations(interface); - node.appendChild(interface); + QDomElement interf = doc->createElement("ProtoInterface"); + InterfaceDeclarations(interf); + node.appendChild(interf); Expect(23); Expect(24); QDomElement body = doc->createElement("ProtoBody"); diff --git a/src/meshlabplugins/render_gdp/meshrender.cpp b/src/meshlabplugins/render_gdp/meshrender.cpp index 64dbcc36d..7003d607b 100644 --- a/src/meshlabplugins/render_gdp/meshrender.cpp +++ b/src/meshlabplugins/render_gdp/meshrender.cpp @@ -21,8 +21,6 @@ * * ****************************************************************************/ -#include - #include #include @@ -474,4 +472,4 @@ void MeshShaderRenderPlugin::Finalize( QAction*, MeshDocument*, GLArea* ) sDialog = 0; } -Q_EXPORT_PLUGIN(MeshShaderRenderPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(MeshShaderRenderPlugin) diff --git a/src/meshlabplugins/render_gdp/meshrender.h b/src/meshlabplugins/render_gdp/meshrender.h index c0c4b4a95..c5bbca277 100644 --- a/src/meshlabplugins/render_gdp/meshrender.h +++ b/src/meshlabplugins/render_gdp/meshrender.h @@ -34,6 +34,7 @@ class MeshShaderRenderPlugin : public QObject, public MeshRenderInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_RENDER_INTERFACE_IID) Q_INTERFACES(MeshRenderInterface) GLhandleARB v; diff --git a/src/meshlabplugins/render_gdp/render_gdp.pro b/src/meshlabplugins/render_gdp/render_gdp.pro index f6ba69c2a..26259d9e8 100644 --- a/src/meshlabplugins/render_gdp/render_gdp.pro +++ b/src/meshlabplugins/render_gdp/render_gdp.pro @@ -13,4 +13,3 @@ TARGET = render_gdp FORMS = shaderDialog.ui -QT += opengl xml diff --git a/src/meshlabplugins/render_gdp/shaderDialog.cpp b/src/meshlabplugins/render_gdp/shaderDialog.cpp index 9c4598123..0a98d6812 100644 --- a/src/meshlabplugins/render_gdp/shaderDialog.cpp +++ b/src/meshlabplugins/render_gdp/shaderDialog.cpp @@ -25,6 +25,12 @@ #include #include #include +#include +#include +#include +#include +#include + #define DECFACTOR 100000.0f using namespace vcg; diff --git a/src/meshlabplugins/render_gdp/shaderDialog.h b/src/meshlabplugins/render_gdp/shaderDialog.h index f8a63d6ba..83b5c9268 100644 --- a/src/meshlabplugins/render_gdp/shaderDialog.h +++ b/src/meshlabplugins/render_gdp/shaderDialog.h @@ -27,11 +27,13 @@ #include #include #include -#include -#include +#include +#include #include "shaderStructs.h" #include "ui_shaderDialog.h" +class QGLWidget; + class ShaderDialog : public QDockWidget { Q_OBJECT diff --git a/src/meshlabplugins/render_radiance_scaling/gpuShader.cpp b/src/meshlabplugins/render_radiance_scaling/gpuShader.cpp index ae78fbb6a..a77476ea1 100644 --- a/src/meshlabplugins/render_radiance_scaling/gpuShader.cpp +++ b/src/meshlabplugins/render_radiance_scaling/gpuShader.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include diff --git a/src/meshlabplugins/render_radiance_scaling/radianceScalingRenderer.cpp b/src/meshlabplugins/render_radiance_scaling/radianceScalingRenderer.cpp index 86180eeb7..9bf5f9227 100644 --- a/src/meshlabplugins/render_radiance_scaling/radianceScalingRenderer.cpp +++ b/src/meshlabplugins/render_radiance_scaling/radianceScalingRenderer.cpp @@ -21,7 +21,6 @@ * * ****************************************************************************/ #include "radianceScalingRenderer.h" -#include #include #include #include @@ -280,4 +279,4 @@ void RadianceScalingRendererPlugin::cleanFBOs() { } } -Q_EXPORT_PLUGIN(RadianceScalingRendererPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(RadianceScalingRendererPlugin) diff --git a/src/meshlabplugins/render_radiance_scaling/radianceScalingRenderer.h b/src/meshlabplugins/render_radiance_scaling/radianceScalingRenderer.h index 282961aa3..40be1098e 100644 --- a/src/meshlabplugins/render_radiance_scaling/radianceScalingRenderer.h +++ b/src/meshlabplugins/render_radiance_scaling/radianceScalingRenderer.h @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -38,6 +37,7 @@ class RadianceScalingRendererPlugin : public QObject, public MeshRenderInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_RENDER_INTERFACE_IID) Q_INTERFACES(MeshRenderInterface) bool _supported; diff --git a/src/meshlabplugins/render_radiance_scaling/render_radiance_scaling.pro b/src/meshlabplugins/render_radiance_scaling/render_radiance_scaling.pro index cd8887963..ed7b1fb42 100644 --- a/src/meshlabplugins/render_radiance_scaling/render_radiance_scaling.pro +++ b/src/meshlabplugins/render_radiance_scaling/render_radiance_scaling.pro @@ -8,6 +8,4 @@ FORMS = shaderDialog.ui RESOURCES = radianceScalingRenderer.qrc -QT += opengl - # CONFIG += debug diff --git a/src/meshlabplugins/render_radiance_scaling/shaderDialog.cpp b/src/meshlabplugins/render_radiance_scaling/shaderDialog.cpp index 6aa2ebd89..5357ab919 100644 --- a/src/meshlabplugins/render_radiance_scaling/shaderDialog.cpp +++ b/src/meshlabplugins/render_radiance_scaling/shaderDialog.cpp @@ -23,6 +23,8 @@ #include "shaderDialog.h" #include "radianceScalingRenderer.h" +#include + using namespace std; ShaderDialog::ShaderDialog(RadianceScalingRendererPlugin* wrp,QGLWidget* gla,QWidget *parent) diff --git a/src/meshlabplugins/render_radiance_scaling/shaderDialog.h b/src/meshlabplugins/render_radiance_scaling/shaderDialog.h index d2bfc179b..680d9008a 100644 --- a/src/meshlabplugins/render_radiance_scaling/shaderDialog.h +++ b/src/meshlabplugins/render_radiance_scaling/shaderDialog.h @@ -24,9 +24,8 @@ #define SHADERDIALOG_H #include -#include #include -#include +#include #include "ui_shaderDialog.h" class RadianceScalingRendererPlugin; diff --git a/src/meshlabplugins/render_rfx/render_rfx.cpp b/src/meshlabplugins/render_rfx/render_rfx.cpp index e327ceaff..48d9d6ce6 100755 --- a/src/meshlabplugins/render_rfx/render_rfx.cpp +++ b/src/meshlabplugins/render_rfx/render_rfx.cpp @@ -214,4 +214,4 @@ void RenderRFX::Finalize(QAction * /*act*/, MeshDocument */*md*/, GLArea */*gla* } } -Q_EXPORT_PLUGIN(RenderRFX) +MESHLAB_PLUGIN_NAME_EXPORTER(RenderRFX) diff --git a/src/meshlabplugins/render_rfx/render_rfx.h b/src/meshlabplugins/render_rfx/render_rfx.h index 0912f914f..92c68082f 100755 --- a/src/meshlabplugins/render_rfx/render_rfx.h +++ b/src/meshlabplugins/render_rfx/render_rfx.h @@ -36,6 +36,7 @@ class RenderRFX : public QObject, public MeshRenderInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_RENDER_INTERFACE_IID) Q_INTERFACES(MeshRenderInterface) public: diff --git a/src/meshlabplugins/render_rfx/render_rfx.pro b/src/meshlabplugins/render_rfx/render_rfx.pro index 28ea293e7..ff13febc3 100755 --- a/src/meshlabplugins/render_rfx/render_rfx.pro +++ b/src/meshlabplugins/render_rfx/render_rfx.pro @@ -1,6 +1,5 @@ include (../../shared.pri) -QT += opengl xml HEADERS = render_rfx.h \ rfx_colorbox.h \ diff --git a/src/meshlabplugins/render_rfx/rfx_dialog.h b/src/meshlabplugins/render_rfx/rfx_dialog.h index 2c490e547..8ef1894ad 100644 --- a/src/meshlabplugins/render_rfx/rfx_dialog.h +++ b/src/meshlabplugins/render_rfx/rfx_dialog.h @@ -69,7 +69,7 @@ private: #include #include #include -#include +#include #include "ui_rfx_dialog.h" #include "rfx_shader.h" #include "rfx_specialuniform.h" diff --git a/src/meshlabplugins/render_splatting/render_splatting.pro b/src/meshlabplugins/render_splatting/render_splatting.pro index f37b706a8..c928c9533 100644 --- a/src/meshlabplugins/render_splatting/render_splatting.pro +++ b/src/meshlabplugins/render_splatting/render_splatting.pro @@ -4,7 +4,6 @@ HEADERS = splatrenderer_plugin.h SOURCES = splatrenderer_plugin.cpp TARGET = render_splatting -QT += opengl RESOURCES = ../../../../vcglib/wrap/gl/splatting_apss/splatrenderer.qrc # CONFIG += debug diff --git a/src/meshlabplugins/render_splatting/splatrenderer_plugin.cpp b/src/meshlabplugins/render_splatting/splatrenderer_plugin.cpp index fa9a45bac..b587d6f9b 100644 --- a/src/meshlabplugins/render_splatting/splatrenderer_plugin.cpp +++ b/src/meshlabplugins/render_splatting/splatrenderer_plugin.cpp @@ -21,8 +21,6 @@ * * ****************************************************************************/ -#include - #include #include #include @@ -93,4 +91,4 @@ void SplatRendererPlugin::Draw(QAction *a, MeshModel &m, RenderMode &rm, QGLWidg #endif -Q_EXPORT_PLUGIN(SplatRendererPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(SplatRendererPlugin) diff --git a/src/meshlabplugins/render_splatting/splatrenderer_plugin.h b/src/meshlabplugins/render_splatting/splatrenderer_plugin.h index 72166d789..dc355f33e 100644 --- a/src/meshlabplugins/render_splatting/splatrenderer_plugin.h +++ b/src/meshlabplugins/render_splatting/splatrenderer_plugin.h @@ -33,6 +33,7 @@ class QGLFramebufferObject; class SplatRendererPlugin : public QObject, public MeshRenderInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_RENDER_INTERFACE_IID) Q_INTERFACES(MeshRenderInterface) SplatRenderer splat_renderer; diff --git a/src/sampleplugins/filtercreateiso/filtercreateiso.cpp b/src/sampleplugins/filtercreateiso/filtercreateiso.cpp index c396efbdc..f3e87f582 100644 --- a/src/sampleplugins/filtercreateiso/filtercreateiso.cpp +++ b/src/sampleplugins/filtercreateiso/filtercreateiso.cpp @@ -30,7 +30,6 @@ Added the new sample filter plugin that removes border faces *****************************************************************************/ #include -#include #include "filtercreateiso.h" #include @@ -140,4 +139,4 @@ void FilterCreateIso::initParameterSet(QAction *action,MeshModel &m, RichParamet } -Q_EXPORT_PLUGIN(FilterCreateIso) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterCreateIso) diff --git a/src/sampleplugins/filtercreateiso/filtercreateiso.h b/src/sampleplugins/filtercreateiso/filtercreateiso.h index 1f5368667..11bacec62 100644 --- a/src/sampleplugins/filtercreateiso/filtercreateiso.h +++ b/src/sampleplugins/filtercreateiso/filtercreateiso.h @@ -39,6 +39,7 @@ class FilterCreateIso : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/sampleplugins/filtergeodesic/filtergeodesic.cpp b/src/sampleplugins/filtergeodesic/filtergeodesic.cpp index 1dd4c4ea4..ed46fc396 100644 --- a/src/sampleplugins/filtergeodesic/filtergeodesic.cpp +++ b/src/sampleplugins/filtergeodesic/filtergeodesic.cpp @@ -33,7 +33,6 @@ *****************************************************************************/ #include -#include #include "filtergeodesic.h" @@ -204,4 +203,4 @@ int FilterGeodesic::postCondition(QAction * filter) const default : return MeshModel::MM_UNKNOWN; } } -Q_EXPORT_PLUGIN(FilterGeodesic) +MESHLAB_PLUGIN_NAME_EXPORTER(FilterGeodesic) diff --git a/src/sampleplugins/filtergeodesic/filtergeodesic.h b/src/sampleplugins/filtergeodesic/filtergeodesic.h index 996906f6e..8d7b66ceb 100644 --- a/src/sampleplugins/filtergeodesic/filtergeodesic.h +++ b/src/sampleplugins/filtergeodesic/filtergeodesic.h @@ -31,6 +31,7 @@ class FilterGeodesic : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/sampleplugins/io_m/io_m.cpp b/src/sampleplugins/io_m/io_m.cpp index 8a07500c7..d2cbb7f27 100644 --- a/src/sampleplugins/io_m/io_m.cpp +++ b/src/sampleplugins/io_m/io_m.cpp @@ -25,7 +25,6 @@ $Log: meshio.cpp,v $ *****************************************************************************/ #include -#include #include "io_m.h" @@ -93,4 +92,4 @@ void IOMPlugin::initSaveParameter(const QString &/*format*/, MeshModel &/*m*/, R par.addParam(new RichBool("HtmlSnippet",true, "HTML Snippet", "If true save an HTML snippet ready to be included in a web page")); } -Q_EXPORT_PLUGIN(IOMPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(IOMPlugin) diff --git a/src/sampleplugins/io_m/io_m.h b/src/sampleplugins/io_m/io_m.h index 63499c455..ad583da9c 100644 --- a/src/sampleplugins/io_m/io_m.h +++ b/src/sampleplugins/io_m/io_m.h @@ -36,6 +36,7 @@ class IOMPlugin : public QObject, public MeshIOInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) Q_INTERFACES(MeshIOInterface) diff --git a/src/sampleplugins/sample_filtergpu/sample_filtergpu.cpp b/src/sampleplugins/sample_filtergpu/sample_filtergpu.cpp index 7d16b3091..464b5bfb1 100644 --- a/src/sampleplugins/sample_filtergpu/sample_filtergpu.cpp +++ b/src/sampleplugins/sample_filtergpu/sample_filtergpu.cpp @@ -260,4 +260,4 @@ bool ExtraSampleGPUPlugin::applyFilter(QAction * a, MeshDocument & md , RichPara return true; } -Q_EXPORT_PLUGIN(ExtraSampleGPUPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(ExtraSampleGPUPlugin) diff --git a/src/sampleplugins/sample_filtergpu/sample_filtergpu.h b/src/sampleplugins/sample_filtergpu/sample_filtergpu.h index b8e068a9b..7e413505c 100644 --- a/src/sampleplugins/sample_filtergpu/sample_filtergpu.h +++ b/src/sampleplugins/sample_filtergpu/sample_filtergpu.h @@ -41,6 +41,7 @@ add sampleplugins class ExtraSampleGPUPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/sampleplugins/sample_pclfilter/sample_pclfilter.cpp b/src/sampleplugins/sample_pclfilter/sample_pclfilter.cpp index 1a9049d0a..6be4cd9a5 100644 --- a/src/sampleplugins/sample_pclfilter/sample_pclfilter.cpp +++ b/src/sampleplugins/sample_pclfilter/sample_pclfilter.cpp @@ -128,4 +128,4 @@ bool SamplePCLFilterPlugin::applyFilter(QAction * a, MeshDocument & md , RichPar return true; } -Q_EXPORT_PLUGIN(SamplePCLFilterPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(SamplePCLFilterPlugin) diff --git a/src/sampleplugins/sample_pclfilter/sample_pclfilter.h b/src/sampleplugins/sample_pclfilter/sample_pclfilter.h index 777ca2e93..3a7097e1d 100644 --- a/src/sampleplugins/sample_pclfilter/sample_pclfilter.h +++ b/src/sampleplugins/sample_pclfilter/sample_pclfilter.h @@ -25,13 +25,12 @@ #ifndef SAMPLEPCLFILTERPLUGIN_H #define SAMPLEPCLFILTERPLUGIN_H -#include - #include class SamplePCLFilterPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/sampleplugins/sample_xmlfilter/sample_xmlfilter.cpp b/src/sampleplugins/sample_xmlfilter/sample_xmlfilter.cpp index 80a0690d0..982f1a536 100644 --- a/src/sampleplugins/sample_xmlfilter/sample_xmlfilter.cpp +++ b/src/sampleplugins/sample_xmlfilter/sample_xmlfilter.cpp @@ -72,4 +72,4 @@ bool SampleXMLFilterPlugin::applyFilter( const QString& filterName,MeshDocument& return false; } -Q_EXPORT_PLUGIN(SampleXMLFilterPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(SampleXMLFilterPlugin) diff --git a/src/sampleplugins/sample_xmlfilter/sample_xmlfilter.h b/src/sampleplugins/sample_xmlfilter/sample_xmlfilter.h index 5e271a411..da072dc7d 100644 --- a/src/sampleplugins/sample_xmlfilter/sample_xmlfilter.h +++ b/src/sampleplugins/sample_xmlfilter/sample_xmlfilter.h @@ -40,6 +40,7 @@ add sampleplugins class SampleXMLFilterPlugin : public MeshLabFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESHLAB_FILTER_INTERFACE_IID) Q_INTERFACES(MeshLabFilterInterface) public: diff --git a/src/sampleplugins/sampleedit/edit_sample_factory.cpp b/src/sampleplugins/sampleedit/edit_sample_factory.cpp index f10f6938d..96481e0c9 100644 --- a/src/sampleplugins/sampleedit/edit_sample_factory.cpp +++ b/src/sampleplugins/sampleedit/edit_sample_factory.cpp @@ -54,4 +54,4 @@ QString SampleEditFactory::getEditToolDescription(QAction *) return SampleEditPlugin::Info(); } -Q_EXPORT_PLUGIN(SampleEditFactory) +MESHLAB_PLUGIN_NAME_EXPORTER(SampleEditFactory) diff --git a/src/sampleplugins/sampleedit/edit_sample_factory.h b/src/sampleplugins/sampleedit/edit_sample_factory.h index b8019c0df..5c9faf6c1 100644 --- a/src/sampleplugins/sampleedit/edit_sample_factory.h +++ b/src/sampleplugins/sampleedit/edit_sample_factory.h @@ -31,6 +31,7 @@ class SampleEditFactory : public QObject, public MeshEditInterfaceFactory { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) Q_INTERFACES(MeshEditInterfaceFactory) public: diff --git a/src/sampleplugins/sampleedit/sampleedit.cpp b/src/sampleplugins/sampleedit/sampleedit.cpp index f3b0c2629..c8e4c2ba4 100644 --- a/src/sampleplugins/sampleedit/sampleedit.cpp +++ b/src/sampleplugins/sampleedit/sampleedit.cpp @@ -24,7 +24,6 @@ History $Log: meshedit.cpp,v $ ****************************************************************************/ -#include #include #include diff --git a/src/sampleplugins/sampleedit/sampleedit.pro b/src/sampleplugins/sampleedit/sampleedit.pro index 983e5c5af..d6e4bab8d 100644 --- a/src/sampleplugins/sampleedit/sampleedit.pro +++ b/src/sampleplugins/sampleedit/sampleedit.pro @@ -9,5 +9,4 @@ SOURCES = edit_sample_factory.cpp \ TARGET = sampleedit -QT += opengl RESOURCES = sampleedit.qrc diff --git a/src/sampleplugins/samplefilter/samplefilter.cpp b/src/sampleplugins/samplefilter/samplefilter.cpp index 6729b2f69..f733e159b 100644 --- a/src/sampleplugins/samplefilter/samplefilter.cpp +++ b/src/sampleplugins/samplefilter/samplefilter.cpp @@ -137,4 +137,4 @@ QString ExtraSamplePlugin::filterScriptFunctionName( FilterIDType filterID ) return QString(); } -Q_EXPORT_PLUGIN(ExtraSamplePlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(ExtraSamplePlugin) diff --git a/src/sampleplugins/samplefilter/samplefilter.h b/src/sampleplugins/samplefilter/samplefilter.h index 546519046..d5ae751f5 100644 --- a/src/sampleplugins/samplefilter/samplefilter.h +++ b/src/sampleplugins/samplefilter/samplefilter.h @@ -42,6 +42,7 @@ class QScriptEngine; class ExtraSamplePlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/sampleplugins/samplefilterdyn/samplefilterdyn.cpp b/src/sampleplugins/samplefilterdyn/samplefilterdyn.cpp index a22d4d614..150a0d538 100644 --- a/src/sampleplugins/samplefilterdyn/samplefilterdyn.cpp +++ b/src/sampleplugins/samplefilterdyn/samplefilterdyn.cpp @@ -21,7 +21,6 @@ * * ****************************************************************************/ -#include #include #include #include @@ -136,4 +135,4 @@ bool ExtraSampleDynPlugin::applyFilter(QAction *, MeshDocument &md, RichParamete return true; } -Q_EXPORT_PLUGIN(ExtraSampleDynPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(ExtraSampleDynPlugin) diff --git a/src/sampleplugins/samplefilterdyn/samplefilterdyn.h b/src/sampleplugins/samplefilterdyn/samplefilterdyn.h index f8bfe5c0f..6a3fb0acb 100644 --- a/src/sampleplugins/samplefilterdyn/samplefilterdyn.h +++ b/src/sampleplugins/samplefilterdyn/samplefilterdyn.h @@ -31,6 +31,7 @@ class ExtraSampleDynPlugin : public QObject, public MeshFilterInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) Q_INTERFACES(MeshFilterInterface) public: diff --git a/src/sampleplugins/sampleio/sampleio.cpp b/src/sampleplugins/sampleio/sampleio.cpp index 08d053d97..a9bb3b478 100644 --- a/src/sampleplugins/sampleio/sampleio.cpp +++ b/src/sampleplugins/sampleio/sampleio.cpp @@ -25,7 +25,6 @@ $Log: meshio.cpp,v $ *****************************************************************************/ #include -#include #include "sampleio.h" @@ -91,4 +90,4 @@ void SampleIOPlugin::GetExportMaskCapability(QString &format, int &capability, i return; } -Q_EXPORT_PLUGIN(SampleIOPlugin) +MESHLAB_PLUGIN_NAME_EXPORTER(SampleIOPlugin) diff --git a/src/sampleplugins/sampleio/sampleio.h b/src/sampleplugins/sampleio/sampleio.h index 7bcf4934c..ea64af493 100644 --- a/src/sampleplugins/sampleio/sampleio.h +++ b/src/sampleplugins/sampleio/sampleio.h @@ -29,14 +29,13 @@ #ifndef SAMPLEIOPLUGIN_H #define SAMPLEIOPLUGIN_H -#include - #include #include class SampleIOPlugin : public QObject, public MeshIOInterface { Q_OBJECT + MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) Q_INTERFACES(MeshIOInterface) diff --git a/src/shared.pri b/src/shared.pri index 1b9291eaf..3f1629405 100644 --- a/src/shared.pri +++ b/src/shared.pri @@ -71,4 +71,4 @@ contains(TEMPLATE,lib) { win32-msvc2005: RCC_DIR = $(ConfigurationName) win32-msvc2008: RCC_DIR = $(ConfigurationName) - win32-msvc2010: RCC_DIR = $(ConfigurationName) +# win32-msvc2010: RCC_DIR = $(ConfigurationName)