From 75d0c96fb5751101c7e7fd672a7bee5f27b2c013 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Tue, 1 Sep 2020 01:17:44 +0000 Subject: [PATCH 01/49] Apply automatic ML_VERSION, snapcraft.yaml and Info.plist change --- ML_VERSION | 2 +- snapcraft.yaml | 2 +- src/meshlab/Info.plist | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ML_VERSION b/ML_VERSION index 0f08edd91..fc8b5bc45 100644 --- a/ML_VERSION +++ b/ML_VERSION @@ -1 +1 @@ -2020.08 \ No newline at end of file +2020.09 \ No newline at end of file diff --git a/snapcraft.yaml b/snapcraft.yaml index b76f88fdb..5dbf2676d 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -1,7 +1,7 @@ # Known to build in Ubuntu 18.04 name: meshlab base: core18 -version: '2020.08' +version: '2020.09' summary: MeshLab description: | The open source system for processing and editing 3D triangular meshes. diff --git a/src/meshlab/Info.plist b/src/meshlab/Info.plist index 5ade0ce15..916d6b0f3 100644 --- a/src/meshlab/Info.plist +++ b/src/meshlab/Info.plist @@ -68,11 +68,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2020.08 + 2020.09 CFBundleSignature ???? CFBundleVersion - 2020.08 + 2020.09 LSMinimumSystemVersion 10.12 NOTE From f339fe6cb83839e06add7b7d1335b4e1d4b7e9a1 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Sat, 29 Aug 2020 11:46:36 +0200 Subject: [PATCH 02/49] filter sketchfab allows to save API code in MeshLab settings --- .../filter_sketchfab/filter_sketchfab.cpp | 27 ++++++++++++++++--- .../filter_sketchfab/filter_sketchfab.h | 5 ++-- vcglib | 2 +- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp index a757569dd..c74a2a639 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp @@ -97,15 +97,25 @@ int FilterSketchFabPlugin::postCondition(QAction*) const void FilterSketchFabPlugin::initParameterSet(QAction* action, MeshModel&, RichParameterList& parlst) { + QSettings settings; + QVariant v = settings.value("SketchFab Code"); + QString sketchFabAPIValue; + if (v == QVariant()) { + sketchFabAPIValue = DEFAULT_API; + } + else { + sketchFabAPIValue = v.toString(); + } switch(ID(action)) { case FP_SKETCHFAB : - parlst.addParam(RichString("sketchFabKeyCode", "00000000", "Sketch Fab Code", "Mandatory.")); + parlst.addParam(RichString("sketchFabKeyCode", sketchFabAPIValue, "Sketch Fab Code", "Mandatory.")); parlst.addParam(RichString("title", "MeshLabModel", "Title", "Mandatory.")); parlst.addParam(RichString("description", "A model generated with meshlab", "Description", "Mandatory. A short description of the model that is uploaded.")); parlst.addParam(RichString("tags", "meshlab", "Tags", "Mandatory. Tags must be separated by a space. Typical tags usually used by MeshLab users: scan, photogrammetry.")); parlst.addParam(RichBool("isPrivate", false, "Private", "This parameter can be true only for PRO account.")); parlst.addParam(RichBool("isPublished", false, "Publish", "If true the model will be published immediately.")); parlst.addParam(RichBool("autoRotate", true, "Auto Rotate", "If true the model rotated by 90 degree on the X axis to maintain similar default orientation.")); + parlst.addParam(RichBool("saveApiSetting", sketchFabAPIValue != DEFAULT_API, "Save SketchFab Code", "Saves the API SketchFab code into the MeshLab settings, allowing to load it as default value every time you run this filter.")); break; default : assert(0); @@ -120,7 +130,7 @@ bool FilterSketchFabPlugin::applyFilter(QAction * action, MeshDocument& md, cons par.getString("sketchFabKeyCode"), par.getString("title"), par.getString("description"), par.getString("tags"), par.getBool("isPrivate"), par.getBool("isPublished"), - par.getBool("autoRotate")); + par.getBool("autoRotate"), par.getBool("saveApiSetting")); default: assert(0); return false; @@ -136,7 +146,8 @@ bool FilterSketchFabPlugin::sketchfab( const QString& tags, bool isPrivate, bool isPublished, - bool /*autoRotate*/) + bool /*autoRotate*/, + bool saveApiSetting) { qDebug("Export to SketchFab start "); this->fcb=cb; @@ -145,11 +156,19 @@ bool FilterSketchFabPlugin::sketchfab( Matrix44m rot; rot.SetRotateDeg(-90,Point3m(1,0,0)); Matrix44m rotI; rot.SetRotateDeg(90,Point3m(1,0,0)); - if(apiToken.isEmpty() || apiToken=="0000000") { + if(apiToken.isEmpty() || apiToken == DEFAULT_API) { this->errorMessage = QString("Please set in the MeshLab preferences your private API Token string that you can find on theSketchfab Password Settings."); return false; } + QSettings settings; + if (saveApiSetting) { + settings.setValue("SketchFab Code", apiToken); + } + else { + settings.remove("SketchFab Code"); + } + QString tmpObjFileName = QDir::tempPath() + "/xxxx.ply"; QString tmpZipFileName = QDir::tempPath() + "/xxxx.zip"; diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h index bb3280675..93e01e1e5 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h @@ -53,8 +53,7 @@ public slots: void uploadProgress(qint64 bytesSent, qint64 bytesTotal); private: - bool sketchfab( - MeshDocument &md, + bool sketchfab(MeshDocument &md, vcg::CallBackPos* cb, const QString& apiToken, const QString&, @@ -62,6 +61,7 @@ private: const QString&, bool, bool, + bool, bool); bool upload( @@ -83,6 +83,7 @@ private: bool uploadCompleteFlag; vcg::CallBackPos * fcb; + const QString DEFAULT_API = "00000000"; }; diff --git a/vcglib b/vcglib index 3932ce448..feea7d6b8 160000 --- a/vcglib +++ b/vcglib @@ -1 +1 @@ -Subproject commit 3932ce448b174b23b363e3308deb427228c847de +Subproject commit feea7d6b8205febbdd35e4a8e0ba811f4e829b40 From 4b875b6dd9729954ed176864e963f35530bd12d0 Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Tue, 1 Sep 2020 09:38:43 +0200 Subject: [PATCH 03/49] Update BuildAndRelease.yml --- .github/workflows/BuildAndRelease.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index 8938d4250..589d0660c 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -121,10 +121,10 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 2 - submodules: true + - name: git clone + run: | + cd .. + git clone --recursive https://github.com/cnr-isti-vclab/meshlab - name: Install dependencies run: | brew install libomp From b750baa0ed300edc69691535ad9e83978d945a60 Mon Sep 17 00:00:00 2001 From: Alessandro Muntoni Date: Tue, 1 Sep 2020 09:42:24 +0200 Subject: [PATCH 04/49] Update BuildAndRelease.yml --- .github/workflows/BuildAndRelease.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index 589d0660c..85ee380c2 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -2,8 +2,10 @@ name: BuildAndRelease on: #[push, pull_request] #just for test release scripts - schedule: - - cron: '0 1 1 * *' #every first day of the month at 1am + workflow_dispatch #just for test release scripts + #schedule: + # - cron: '0 1 1 * *' #every first day of the month at 1am + jobs: update_ml_version: From 11dcc45d433708accf2ee74ec32065550ec204d1 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Tue, 1 Sep 2020 10:20:50 +0200 Subject: [PATCH 05/49] Build and Release actions runs only on workflow dispatch --- .github/workflows/BuildAndRelease.yml | 53 +++++++++++++++------------ 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index 85ee380c2..e7922c0f9 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -2,7 +2,12 @@ name: BuildAndRelease on: #[push, pull_request] #just for test release scripts - workflow_dispatch #just for test release scripts + workflow_dispatch: #manual run + inputs: + version: + description: 'New MeshLab Version' + required: true + default: 'YYYY.MM' #schedule: # - cron: '0 1 1 * *' #every first day of the month at 1am @@ -16,17 +21,17 @@ jobs: with: fetch-depth: 2 submodules: true - - name: Setup env variables - id: envs - run: | - echo ::set-output name=date::"$(date +%Y.%m)" + #- name: Setup env variables + # id: envs + # run: | + # echo ::set-output name=date::"$(date +%Y.%m)" - name: Update MeshLab version run : | - echo ${{steps.envs.outputs.date}} | tr -d '\n'> ML_VERSION + echo ${{ github.event.inputs.version }} | tr -d '\n'> ML_VERSION - name: Update Info.plist run: | - /usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString ${{steps.envs.outputs.date}}" src/meshlab/Info.plist - /usr/libexec/PlistBuddy -c "Set CFBundleVersion ${{steps.envs.outputs.date}}" src/meshlab/Info.plist + /usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString ${{ github.event.inputs.version }}" src/meshlab/Info.plist + /usr/libexec/PlistBuddy -c "Set CFBundleVersion ${{ github.event.inputs.version }}" src/meshlab/Info.plist - name: Update Snap file run: | sed "s%MESHLAB_VERSION%$(cat ML_VERSION)%g" install/linux/resources/snap/snap_noversion.yaml > snapcraft.yaml @@ -41,10 +46,10 @@ jobs: runs-on: ubuntu-16.04 #in order to deploy, need to use oldest supported version steps: - - name: git clone - run: | - cd .. - git clone --recursive https://github.com/cnr-isti-vclab/meshlab + - uses: actions/checkout@v2 + with: + ref: master + submodules: true - name: Install Qt uses: jurplel/install-qt-action@v2 with: @@ -91,10 +96,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: git clone - run: | - cd .. - git clone --recursive https://github.com/cnr-isti-vclab/meshlab + - uses: actions/checkout@v2 + with: + ref: master + submodules: true - name: Install dependencies run: | #needed for some reason... @@ -123,10 +128,10 @@ jobs: runs-on: macos-latest steps: - - name: git clone - run: | - cd .. - git clone --recursive https://github.com/cnr-isti-vclab/meshlab + - uses: actions/checkout@v2 + with: + ref: master + submodules: true - name: Install dependencies run: | brew install libomp @@ -168,10 +173,10 @@ jobs: runs-on: windows-latest steps: - - name: git clone - run: | - cd .. - git clone --recursive https://github.com/cnr-isti-vclab/meshlab + - uses: actions/checkout@v2 + with: + ref: master + submodules: true - name: Download Jom run: | Invoke-WebRequest -Uri "http://download.qt.io/official_releases/jom/jom_1_1_3.zip" -OutFile "jom_1_1_3.zip" From 1c1e334ad7e653927acaf8f645bff74b8ed27079 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Tue, 1 Sep 2020 11:02:13 +0200 Subject: [PATCH 06/49] fix version build and release with workflow dispatch --- .github/workflows/BuildAndRelease.yml | 48 +++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index e7922c0f9..802f422e6 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -231,10 +231,10 @@ jobs: needs: [ubuntu_build_appimage, ubuntu_build_snap, macos_build, windows_build] runs-on: ubuntu-latest steps: - - name: Setup env variables - id: envs - run: | - echo ::set-output name=date::"$(date +%Y.%m)" + #- name: Setup env variables + # id: envs + # run: | + # echo ::set-output name=date::"$(date +%Y.%m)" #Linux Release - name: Download Linux ZIP @@ -258,11 +258,11 @@ jobs: chmod +x meshlab_linux_portable/usr/bin/meshlab chmod +x meshlab_linux_portable/usr/bin/meshlabserver chmod +x meshlab_linux_portable/AppRun - chmod +x meshlab_linux_appimage/MeshLab${{steps.envs.outputs.date}}-linux.AppImage - chmod +x meshlabserver_linux_appimage/MeshLabServer${{steps.envs.outputs.date}}-linux.AppImage + chmod +x meshlab_linux_appimage/MeshLab${{ github.event.inputs.version }}-linux.AppImage + chmod +x meshlabserver_linux_appimage/MeshLabServer${{ github.event.inputs.version }}-linux.AppImage - name: Create MeshLab Portable Linux Archive run: | - tar -cvzf MeshLab${{steps.envs.outputs.date}}-linux.tar.gz meshlab_linux_portable/ + tar -cvzf MeshLab${{ github.event.inputs.version }}-linux.tar.gz meshlab_linux_portable/ #MacOS Release @@ -283,7 +283,7 @@ jobs: name: meshlab_windows_installer - name: Create MeshLab Portable Windows Archive run: | - zip -r MeshLab${{steps.envs.outputs.date}}-windows.zip meshlab_windows_portable/ + zip -r MeshLab${{ github.event.inputs.version }}-windows.zip meshlab_windows_portable/ #Create release and upload @@ -293,8 +293,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: Meshlab-${{steps.envs.outputs.date}} - release_name: MeshLab-${{steps.envs.outputs.date}} + tag_name: Meshlab-${{ github.event.inputs.version }} + release_name: MeshLab-${{ github.event.inputs.version }} draft: false prerelease: false #Linux @@ -305,8 +305,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: MeshLab${{steps.envs.outputs.date}}-linux.tar.gz - asset_name: MeshLab${{steps.envs.outputs.date}}-linux.tar.gz + asset_path: MeshLab${{ github.event.inputs.version }}-linux.tar.gz + asset_name: MeshLab${{ github.event.inputs.version }}-linux.tar.gz asset_content_type: MeshLab Portable for Linux - name: Upload ReleaseLinuxAppImage id: upload-release-linux-appimage @@ -315,8 +315,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: meshlab_linux_appimage/MeshLab${{steps.envs.outputs.date}}-linux.AppImage - asset_name: MeshLab${{steps.envs.outputs.date}}-linux.AppImage + asset_path: meshlab_linux_appimage/MeshLab${{ github.event.inputs.version }}-linux.AppImage + asset_name: MeshLab${{ github.event.inputs.version }}-linux.AppImage asset_content_type: MeshLab AppImage for Linux - name: Upload ReleaseLinuxMeshLabServerAppImage id: upload-release-linux-meshlabserver-appimage @@ -325,8 +325,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: meshlabserver_linux_appimage/MeshLabServer${{steps.envs.outputs.date}}-linux.AppImage - asset_name: MeshLabServer${{steps.envs.outputs.date}}-linux.AppImage + asset_path: meshlabserver_linux_appimage/MeshLabServer${{ github.event.inputs.version }}-linux.AppImage + asset_name: MeshLabServer${{ github.event.inputs.version }}-linux.AppImage asset_content_type: MeshLabServer AppImage for Linux - name: Upload ReleaseLinuxSnap id: upload-release-linux-snap @@ -335,8 +335,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: meshlab_linux_snap/MeshLab${{steps.envs.outputs.date}}-linux.snap - asset_name: MeshLab${{steps.envs.outputs.date}}-linux.snap + asset_path: meshlab_linux_snap/MeshLab${{ github.event.inputs.version }}-linux.snap + asset_name: MeshLab${{ github.event.inputs.version }}-linux.snap asset_content_type: MeshLab Snap for Linux #MacOS - name: Upload ReleaseMacOSDMG @@ -346,8 +346,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: meshlab_macos_dmg/MeshLab${{steps.envs.outputs.date}}-macos.dmg - asset_name: MeshLab${{steps.envs.outputs.date}}-macos.dmg + asset_path: meshlab_macos_dmg/MeshLab${{ github.event.inputs.version }}-macos.dmg + asset_name: MeshLab${{ github.event.inputs.version }}-macos.dmg asset_content_type: MeshLab for MacOS #Windows - name: Upload ReleaseWindowsPortable @@ -357,8 +357,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: MeshLab${{steps.envs.outputs.date}}-windows.zip - asset_name: MeshLab${{steps.envs.outputs.date}}-windows.zip + asset_path: MeshLab${{ github.event.inputs.version }}-windows.zip + asset_name: MeshLab${{ github.event.inputs.version }}-windows.zip asset_content_type: MeshLab Portable for Windows - name: Upload ReleaseWindowsInstaller id: upload-release-windows-installer @@ -367,6 +367,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: meshlab_windows_installer/MeshLab${{steps.envs.outputs.date}}-windows.exe - asset_name: MeshLab${{steps.envs.outputs.date}}-windows.exe + asset_path: meshlab_windows_installer/MeshLab${{ github.event.inputs.version }}-windows.exe + asset_name: MeshLab${{ github.event.inputs.version }}-windows.exe asset_content_type: MeshLab Portable for Windows From a9b83a0e4df243f544d338e70cccaae754dc6a77 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 3 Sep 2020 10:28:08 +0200 Subject: [PATCH 07/49] update vcglib --- vcglib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcglib b/vcglib index feea7d6b8..5c0a0f729 160000 --- a/vcglib +++ b/vcglib @@ -1 +1 @@ -Subproject commit feea7d6b8205febbdd35e4a8e0ba811f4e829b40 +Subproject commit 5c0a0f729b49f52dd3bc4b23f3cb2aa4a9f3666e From d4a5b276b67f8240b4a3779623f9807977d5871b Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 3 Sep 2020 18:38:28 +0200 Subject: [PATCH 08/49] small indentation fix --- src/meshlab/savemaskexporter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/meshlab/savemaskexporter.cpp b/src/meshlab/savemaskexporter.cpp index f4c048c71..396e42eb1 100644 --- a/src/meshlab/savemaskexporter.cpp +++ b/src/meshlab/savemaskexporter.cpp @@ -45,12 +45,12 @@ void SaveMaskExporterDialog::InitDialog() connect(ui->NoneButton,SIGNAL(clicked()),this,SLOT(SlotSelectionNoneButton())); ui->renametextureButton->setDisabled(true); - stdParFrame = new RichParameterListFrame(*parSet, this,glar); - QVBoxLayout *vbox = new QVBoxLayout(this); + stdParFrame = new RichParameterListFrame(*parSet, this,glar); + QVBoxLayout *vbox = new QVBoxLayout(this); vbox->addWidget(stdParFrame); ui->saveParBox->setLayout(vbox); QFileInfo fi(m->fullName()); - this->setWindowTitle("Choose Saving Options for: '"+ fi.baseName() +"'"); + this->setWindowTitle("Choose Saving Options for: '"+ fi.baseName() +"'"); // Show the additional parameters only for formats that have some. if(parSet->isEmpty()) ui->saveParBox->hide(); else ui->saveParBox->show(); From 205205e21f4d61a5171e1ba60f3243871b42e349 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 4 Sep 2020 11:31:59 +0200 Subject: [PATCH 09/49] const correctness IO plugins --- src/common/interfaces.h | 2 +- src/meshlabplugins/io_3ds/meshio.cpp | 2 +- src/meshlabplugins/io_3ds/meshio.h | 2 +- src/meshlabplugins/io_base/baseio.cpp | 2 +- src/meshlabplugins/io_base/baseio.h | 2 +- src/meshlabplugins/io_bre/io_bre.cpp | 2 +- src/meshlabplugins/io_bre/io_bre.h | 2 +- src/meshlabplugins/io_collada/io_collada.cpp | 2 +- src/meshlabplugins/io_collada/io_collada.h | 2 +- src/meshlabplugins/io_ctm/io_ctm.cpp | 2 +- src/meshlabplugins/io_ctm/io_ctm.h | 2 +- src/meshlabplugins/io_expe/io_expe.cpp | 2 +- src/meshlabplugins/io_expe/io_expe.h | 2 +- src/meshlabplugins/io_json/io_json.cpp | 2 +- src/meshlabplugins/io_json/io_json.h | 2 +- src/meshlabplugins/io_pdb/io_pdb.cpp | 2 +- src/meshlabplugins/io_pdb/io_pdb.h | 2 +- src/meshlabplugins/io_tri/io_tri.cpp | 2 +- src/meshlabplugins/io_tri/io_tri.h | 2 +- src/meshlabplugins/io_txt/io_txt.cpp | 2 +- src/meshlabplugins/io_txt/io_txt.h | 2 +- src/meshlabplugins/io_u3d/io_u3d.cpp | 2 +- src/meshlabplugins/io_u3d/io_u3d.h | 2 +- src/meshlabplugins/io_x3d/io_x3d.cpp | 2 +- src/meshlabplugins/io_x3d/io_x3d.h | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/common/interfaces.h b/src/common/interfaces.h index 827c61eb7..e95efdb34 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -240,7 +240,7 @@ public: virtual void initSaveParameter(const QString &/*format*/, MeshModel &/*m*/, RichParameterList & /*par*/) {} - virtual void GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const = 0; + virtual void GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const = 0; /// callback used to actually load a mesh from a file virtual bool open( diff --git a/src/meshlabplugins/io_3ds/meshio.cpp b/src/meshlabplugins/io_3ds/meshio.cpp index 3dc67a80d..beb01eef9 100644 --- a/src/meshlabplugins/io_3ds/meshio.cpp +++ b/src/meshlabplugins/io_3ds/meshio.cpp @@ -259,7 +259,7 @@ QString ExtraMeshIOPlugin::pluginName() const returns the mask on the basis of the file's type. otherwise it returns 0 if the file format is unknown */ -void ExtraMeshIOPlugin::GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const +void ExtraMeshIOPlugin::GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const { if(format.toUpper() == tr("3DS")){capability=defaultBits= vcg::tri::io::Exporter3DS::GetExportMaskCapability();} return; diff --git a/src/meshlabplugins/io_3ds/meshio.h b/src/meshlabplugins/io_3ds/meshio.h index fb3bd68f2..8ef42e690 100644 --- a/src/meshlabplugins/io_3ds/meshio.h +++ b/src/meshlabplugins/io_3ds/meshio.h @@ -43,7 +43,7 @@ public: QList exportFormats() const; QString pluginName() const; - void GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const; + void GetExportMaskCapability(const QString& format, int &capability, int &defaultBits) const; bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList &, vcg::CallBackPos *cb=0, QWidget *parent=0); bool save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterList &, vcg::CallBackPos *cb=0, QWidget *parent= 0); }; diff --git a/src/meshlabplugins/io_base/baseio.cpp b/src/meshlabplugins/io_base/baseio.cpp index 293f47137..e46ff0bea 100644 --- a/src/meshlabplugins/io_base/baseio.cpp +++ b/src/meshlabplugins/io_base/baseio.cpp @@ -463,7 +463,7 @@ QList BaseMeshIOPlugin::exportFormats() const returns the mask on the basis of the file's type. otherwise it returns 0 if the file format is unknown */ -void BaseMeshIOPlugin::GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const +void BaseMeshIOPlugin::GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const { if (format.toUpper() == tr("PLY")) { capability = tri::io::ExporterPLY::GetExportMaskCapability(); diff --git a/src/meshlabplugins/io_base/baseio.h b/src/meshlabplugins/io_base/baseio.h index 4906dee76..4c93de49d 100644 --- a/src/meshlabplugins/io_base/baseio.h +++ b/src/meshlabplugins/io_base/baseio.h @@ -40,7 +40,7 @@ public: QList importFormats() const; QList exportFormats() const; - void GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const; + void GetExportMaskCapability(const QString& format, int &capability, int &defaultBits) const; bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList & par, vcg::CallBackPos *cb = 0, QWidget *parent = 0); bool save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterList & par, vcg::CallBackPos *cb = 0, QWidget *parent = 0); diff --git a/src/meshlabplugins/io_bre/io_bre.cpp b/src/meshlabplugins/io_bre/io_bre.cpp index 52522f84a..a27a25746 100644 --- a/src/meshlabplugins/io_bre/io_bre.cpp +++ b/src/meshlabplugins/io_bre/io_bre.cpp @@ -182,7 +182,7 @@ QList BreMeshIOPlugin::exportFormats() const returns the mask on the basis of the file's type. otherwise it returns 0 if the file format is unknown */ -void BreMeshIOPlugin::GetExportMaskCapability(QString &/*format*/, int &/*capability*/, int &/*defaultBits*/) const +void BreMeshIOPlugin::GetExportMaskCapability(const QString &/*format*/, int &/*capability*/, int &/*defaultBits*/) const { /*if(format.toUpper() == tr("BRE")) { diff --git a/src/meshlabplugins/io_bre/io_bre.h b/src/meshlabplugins/io_bre/io_bre.h index 50a5301c2..fc0b572b8 100644 --- a/src/meshlabplugins/io_bre/io_bre.h +++ b/src/meshlabplugins/io_bre/io_bre.h @@ -163,7 +163,7 @@ public: QList importFormats() const; QList exportFormats() const; - void GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const; + void GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const; bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask,const RichParameterList & par, vcg::CallBackPos *cb=0, QWidget *parent=0); bool save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterList & par, vcg::CallBackPos *cb=0, QWidget *parent= 0); diff --git a/src/meshlabplugins/io_collada/io_collada.cpp b/src/meshlabplugins/io_collada/io_collada.cpp index f1ea47330..bcd1edec2 100644 --- a/src/meshlabplugins/io_collada/io_collada.cpp +++ b/src/meshlabplugins/io_collada/io_collada.cpp @@ -238,7 +238,7 @@ QList ColladaIOPlugin::exportFormats() const returns the mask on the basis of the file's type. otherwise it returns 0 if the file format is unknown */ -void ColladaIOPlugin::GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const +void ColladaIOPlugin::GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const { if(format.toUpper() == tr("DAE")){ capability = defaultBits = vcg::tri::io::ExporterDAE::GetExportMaskCapability(); diff --git a/src/meshlabplugins/io_collada/io_collada.h b/src/meshlabplugins/io_collada/io_collada.h index ba55dd5fb..e2f0170a1 100644 --- a/src/meshlabplugins/io_collada/io_collada.h +++ b/src/meshlabplugins/io_collada/io_collada.h @@ -60,7 +60,7 @@ class ColladaIOPlugin : public QObject, public MeshIOInterface QList importFormats() const; QList exportFormats() const; - void GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const; + void GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const; void initPreOpenParameter(const QString &/*format*/, const QString &/*fileName*/, RichParameterList & /*par*/); bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList &par, vcg::CallBackPos *cb=0, QWidget *parent=0); bool save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterList &, vcg::CallBackPos *cb=0, QWidget *parent= 0); diff --git a/src/meshlabplugins/io_ctm/io_ctm.cpp b/src/meshlabplugins/io_ctm/io_ctm.cpp index 86ba8ed18..6c07d1154 100644 --- a/src/meshlabplugins/io_ctm/io_ctm.cpp +++ b/src/meshlabplugins/io_ctm/io_ctm.cpp @@ -92,7 +92,7 @@ QList IOMPlugin::exportFormats() const returns the mask on the basis of the file's type. otherwise it returns 0 if the file format is unknown */ -void IOMPlugin::GetExportMaskCapability(QString &/*format*/, int &capability, int &defaultBits) const +void IOMPlugin::GetExportMaskCapability(const QString &/*format*/, int &capability, int &defaultBits) const { capability=defaultBits=vcg::tri::io::ExporterCTM::GetExportMaskCapability(); return; diff --git a/src/meshlabplugins/io_ctm/io_ctm.h b/src/meshlabplugins/io_ctm/io_ctm.h index d21339baf..c720bb3e9 100644 --- a/src/meshlabplugins/io_ctm/io_ctm.h +++ b/src/meshlabplugins/io_ctm/io_ctm.h @@ -46,7 +46,7 @@ public: QList importFormats() const; QList exportFormats() const; - virtual void GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const; + virtual void GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const; void initSaveParameter(const QString &/*format*/, MeshModel &/*m*/, RichParameterList & /*par*/); bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask,const RichParameterList & par, vcg::CallBackPos *cb=0, QWidget *parent=0); bool save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask,const RichParameterList & par, vcg::CallBackPos *cb, QWidget *parent); diff --git a/src/meshlabplugins/io_expe/io_expe.cpp b/src/meshlabplugins/io_expe/io_expe.cpp index 1af2ce8f1..207bba10f 100644 --- a/src/meshlabplugins/io_expe/io_expe.cpp +++ b/src/meshlabplugins/io_expe/io_expe.cpp @@ -175,7 +175,7 @@ QList ExpeIOPlugin::exportFormats() const returns the mask on the basis of the file's type. otherwise it returns 0 if the file format is unknown */ -void ExpeIOPlugin::GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const +void ExpeIOPlugin::GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const { // if(format.toLower() == tr("apts")){capability=defaultBits= vcg::tri::io::ExporterExpeAPTS::GetExportMaskCapability();} // if(format.toLower() == tr("pts")){capability=defaultBits= vcg::tri::io::ExporterExpePTS::GetExportMaskCapability();} diff --git a/src/meshlabplugins/io_expe/io_expe.h b/src/meshlabplugins/io_expe/io_expe.h index dbf60fcc4..1ddc91222 100644 --- a/src/meshlabplugins/io_expe/io_expe.h +++ b/src/meshlabplugins/io_expe/io_expe.h @@ -41,7 +41,7 @@ public: QList importFormats() const; QList exportFormats() const; - virtual void GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const; + virtual void GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const; // void initPreOpenParameter(const QString &/*format*/, const QString &/*fileName*/, RichParameterSet & /*par*/); bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList &, vcg::CallBackPos *cb=0, QWidget *parent=0); bool save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterList &, vcg::CallBackPos *cb, QWidget *parent); diff --git a/src/meshlabplugins/io_json/io_json.cpp b/src/meshlabplugins/io_json/io_json.cpp index 1ca47f6dd..0f6d6fff9 100644 --- a/src/meshlabplugins/io_json/io_json.cpp +++ b/src/meshlabplugins/io_json/io_json.cpp @@ -447,7 +447,7 @@ QList JSONIOPlugin::exportFormats(void) const returns the mask on the basis of the file's type. otherwise it returns 0 if the file format is unknown */ -void JSONIOPlugin::GetExportMaskCapability(QString & format, int & capability, int & defaultBits) const +void JSONIOPlugin::GetExportMaskCapability(const QString & format, int & capability, int & defaultBits) const { capability = 0; diff --git a/src/meshlabplugins/io_json/io_json.h b/src/meshlabplugins/io_json/io_json.h index aaa79eb70..afee1f9a7 100644 --- a/src/meshlabplugins/io_json/io_json.h +++ b/src/meshlabplugins/io_json/io_json.h @@ -41,7 +41,7 @@ public: QList importFormats(void) const; QList exportFormats(void) const; - void GetExportMaskCapability(QString & format, int & capability, int & defaultBits) const; + void GetExportMaskCapability(const QString & format, int & capability, int & defaultBits) const; bool open(const QString & formatName, const QString & fileName, MeshModel & m, int & mask, const RichParameterList & par, vcg::CallBackPos * cb = 0, QWidget * parent = 0); bool save(const QString & formatName, const QString & fileName, MeshModel & m, const int mask, const RichParameterList & par, vcg::CallBackPos * cb = 0, QWidget * parent = 0); diff --git a/src/meshlabplugins/io_pdb/io_pdb.cpp b/src/meshlabplugins/io_pdb/io_pdb.cpp index 3a07fc52a..610ac6f04 100644 --- a/src/meshlabplugins/io_pdb/io_pdb.cpp +++ b/src/meshlabplugins/io_pdb/io_pdb.cpp @@ -171,7 +171,7 @@ QList PDBIOPlugin::exportFormats() const returns the mask on the basis of the file's type. otherwise it returns 0 if the file format is unknown */ -void PDBIOPlugin::GetExportMaskCapability(QString & /*format*/, int &capability, int &defaultBits) const +void PDBIOPlugin::GetExportMaskCapability(const QString & /*format*/, int &capability, int &defaultBits) const { capability=defaultBits=0; return; diff --git a/src/meshlabplugins/io_pdb/io_pdb.h b/src/meshlabplugins/io_pdb/io_pdb.h index 336dd6f0f..562a10085 100644 --- a/src/meshlabplugins/io_pdb/io_pdb.h +++ b/src/meshlabplugins/io_pdb/io_pdb.h @@ -40,7 +40,7 @@ public: QList importFormats() const; QList exportFormats() const; - void GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const; + void GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const; bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask,const RichParameterList & par, vcg::CallBackPos *cb=0, QWidget *parent=0); bool save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterList & par, vcg::CallBackPos *cb=0, QWidget *parent= 0); diff --git a/src/meshlabplugins/io_tri/io_tri.cpp b/src/meshlabplugins/io_tri/io_tri.cpp index 4cef2e269..2f1f113a7 100755 --- a/src/meshlabplugins/io_tri/io_tri.cpp +++ b/src/meshlabplugins/io_tri/io_tri.cpp @@ -109,7 +109,7 @@ QList TriIOPlugin::exportFormats() const returns the mask on the basis of the file's type. otherwise it returns 0 if the file format is unknown */ -void TriIOPlugin::GetExportMaskCapability(QString &, int &capability, int &defaultBits) const +void TriIOPlugin::GetExportMaskCapability(const QString &, int &capability, int &defaultBits) const { capability=defaultBits=0; return; diff --git a/src/meshlabplugins/io_tri/io_tri.h b/src/meshlabplugins/io_tri/io_tri.h index 26f0356e4..6047d439e 100755 --- a/src/meshlabplugins/io_tri/io_tri.h +++ b/src/meshlabplugins/io_tri/io_tri.h @@ -44,7 +44,7 @@ public: QString pluginName() const; QList importFormats() const; QList exportFormats() const; - virtual void GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const; + virtual void GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const; virtual void initPreOpenParameter(const QString &/*format*/, const QString &/*fileName*/, RichParameterList & /*par*/); bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList &, vcg::CallBackPos *cb=0, QWidget *parent=0); diff --git a/src/meshlabplugins/io_txt/io_txt.cpp b/src/meshlabplugins/io_txt/io_txt.cpp index 89d5dbc01..04259e540 100755 --- a/src/meshlabplugins/io_txt/io_txt.cpp +++ b/src/meshlabplugins/io_txt/io_txt.cpp @@ -124,7 +124,7 @@ QList TxtIOPlugin::exportFormats() const returns the mask on the basis of the file's type. otherwise it returns 0 if the file format is unknown */ -void TxtIOPlugin::GetExportMaskCapability(QString & /*format*/, int &capability, int &defaultBits) const +void TxtIOPlugin::GetExportMaskCapability(const QString & /*format*/, int &capability, int &defaultBits) const { capability=defaultBits=0; return; diff --git a/src/meshlabplugins/io_txt/io_txt.h b/src/meshlabplugins/io_txt/io_txt.h index ed57f0d19..026da498f 100755 --- a/src/meshlabplugins/io_txt/io_txt.h +++ b/src/meshlabplugins/io_txt/io_txt.h @@ -38,7 +38,7 @@ public: QString pluginName() const; QList importFormats() const; QList exportFormats() const; - virtual void GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const; + virtual void GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const; virtual void initPreOpenParameter(const QString &/*format*/, const QString &/*fileName*/, RichParameterList & /*par*/); bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList &, vcg::CallBackPos *cb=0, QWidget *parent=0); diff --git a/src/meshlabplugins/io_u3d/io_u3d.cpp b/src/meshlabplugins/io_u3d/io_u3d.cpp index 7c1043143..0410f4a0c 100644 --- a/src/meshlabplugins/io_u3d/io_u3d.cpp +++ b/src/meshlabplugins/io_u3d/io_u3d.cpp @@ -146,7 +146,7 @@ QList U3DIOPlugin::exportFormats() const returns the mask on the basis of the file's type. otherwise it returns 0 if the file format is unknown */ -void U3DIOPlugin::GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const +void U3DIOPlugin::GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const { if(format.toUpper() == tr("U3D")) { capability = defaultBits = vcg::tri::io::ExporterU3D::GetExportMaskCapability(); diff --git a/src/meshlabplugins/io_u3d/io_u3d.h b/src/meshlabplugins/io_u3d/io_u3d.h index d253f5697..6ab1ba8c9 100644 --- a/src/meshlabplugins/io_u3d/io_u3d.h +++ b/src/meshlabplugins/io_u3d/io_u3d.h @@ -45,7 +45,7 @@ public: U3DIOPlugin(); - virtual void GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const; + virtual void GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const; bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList &, vcg::CallBackPos *cb=0, QWidget *parent=0); bool save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterList &, vcg::CallBackPos *cb=0, QWidget *parent= 0); diff --git a/src/meshlabplugins/io_x3d/io_x3d.cpp b/src/meshlabplugins/io_x3d/io_x3d.cpp index 7724362f6..2222a9567 100644 --- a/src/meshlabplugins/io_x3d/io_x3d.cpp +++ b/src/meshlabplugins/io_x3d/io_x3d.cpp @@ -178,7 +178,7 @@ QList IoX3DPlugin::exportFormats() const returns the mask on the basis of the file's type. otherwise it returns 0 if the file format is unknown */ -void IoX3DPlugin::GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const +void IoX3DPlugin::GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const { if(format.toUpper() == tr("X3D")){ capability = defaultBits = vcg::tri::io::ExporterX3D::GetExportMaskCapability(); diff --git a/src/meshlabplugins/io_x3d/io_x3d.h b/src/meshlabplugins/io_x3d/io_x3d.h index c8ef46217..afd9ed202 100644 --- a/src/meshlabplugins/io_x3d/io_x3d.h +++ b/src/meshlabplugins/io_x3d/io_x3d.h @@ -48,7 +48,7 @@ public: QList importFormats() const; QList exportFormats() const; - virtual void GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const; + virtual void GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const; bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList &, vcg::CallBackPos *cb=0, QWidget *parent=0); bool save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterList &, vcg::CallBackPos *cb, QWidget *parent); From 77539af9c6a2c3eb72dcbbec7350504a88fb0b51 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 4 Sep 2020 11:37:26 +0200 Subject: [PATCH 10/49] const correctness IO filter ssynth --- src/meshlabplugins/filter_ssynth/filter_ssynth.cpp | 2 +- src/meshlabplugins/filter_ssynth/filter_ssynth.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp index b94cfa2c3..81f212a88 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp @@ -205,7 +205,7 @@ bool FilterSSynth::save(const QString &/*formatName*/, const QString &/*fileName return true; } -void FilterSSynth::GetExportMaskCapability(QString &/*format*/, int &/*capability*/, int &/*defaultBits*/) const {} +void FilterSSynth::GetExportMaskCapability(const QString &/*format*/, int &/*capability*/, int &/*defaultBits*/) const {} void FilterSSynth::initPreOpenParameter(const QString &/*formatName*/, const QString &/*filename*/, RichParameterList &parlst){ parlst.addParam(RichInt(tr("seed"),1,tr("Seed for random mesh generation"),tr("write a seed for the random generation of the mesh"))); diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.h b/src/meshlabplugins/filter_ssynth/filter_ssynth.h index b1eed3e45..821680f58 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.h +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.h @@ -54,7 +54,7 @@ public: QList importFormats() const; QList exportFormats() const; - virtual void GetExportMaskCapability(QString &format, int &capability, int &defaultBits) const; + virtual void GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const; void initPreOpenParameter(const QString &formatName, const QString &filename, RichParameterList &parlst); bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList & par, vcg::CallBackPos *cb=0, QWidget *parent=0); bool save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterList &, vcg::CallBackPos *cb, QWidget *parent); From 7f67a3b13a343d0b280e2cececffb3801c3348bc Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Mon, 7 Sep 2020 16:20:35 +0200 Subject: [PATCH 11/49] small filter description fixes --- .../filter_colorproc/filter_colorproc.cpp | 8 +++--- .../filter_fractal/filter_fractal.cpp | 27 +++++++++++++------ .../filter_plymc/filter_plymc.cpp | 2 +- .../filter_sample_gpu/filter_sample_gpu.cpp | 4 +-- .../filter_texture/filter_texture.cpp | 2 +- .../filter_unsharp/filter_unsharp.cpp | 8 +++--- 6 files changed, 31 insertions(+), 20 deletions(-) diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp index 160f2345b..9e83bb98c 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp @@ -155,7 +155,7 @@ QString FilterColorProc::pluginName() const "
  • Texture Angle Distortion. Difference between angle in 3D space and texture space" "
  • Texture Area Distortion. Difference between area in 3D space and texture space" "
  • Polygonal Planarity (max distance to support plane)" - "
  • Polygonal Planarity (relative distance to support plane)"); + "
  • Polygonal Planarity (relative distance to support plane)"); case CP_VERTEX_SMOOTH: return QString("Laplacian Smooth Vertex Color"); case CP_FACE_SMOOTH: return QString("Laplacian Smooth Face Color"); case CP_VERTEX_TO_FACE: return QString("Vertex to Face color transfer"); @@ -339,7 +339,7 @@ void FilterColorProc::initParameterSet(QAction *a, MeshDocument& md, RichParamet minmax = tri::Stat::ComputePerVertexQualityMinMax(md.mm()->cm); par.addParam(RichFloat("minVal", minmax.first, "Min", "The value that will be mapped with the lower end of the scale (blue)")); par.addParam(RichFloat("maxVal", minmax.second, "Max", "The value that will be mapped with the upper end of the scale (red)")); - par.addParam(RichDynamicFloat("perc", 0, 0, 100, "Percentile Crop [0..100]", "If not zero this value will be used for a percentile cropping of the quality values.
    If this parameter is set to a value P then the two values V_min,V_max for which P% of the vertices have a quality lower or greater than V_min,V_max are used as min/max values for clamping.

    The automated percentile cropping is very useful for automatically discarding outliers.")); + par.addParam(RichDynamicFloat("perc", 0, 0, 100, "Percentile Crop [0..100]", "If not zero this value will be used for a percentile cropping of the quality values.
    If this parameter is set to a value P then the two values V_min,V_max for which P% of the vertices have a quality lower or greater than V_min,V_max are used as min/max values for clamping.

    The automated percentile cropping is very useful for automatically discarding outliers.")); par.addParam(RichBool("zeroSym", false, "Zero Symmetric", "If true the min max range will be enlarged to be symmetric (so that green is always Zero)")); break; } @@ -349,7 +349,7 @@ void FilterColorProc::initParameterSet(QAction *a, MeshDocument& md, RichParamet minmax = tri::Stat::ComputePerVertexQualityMinMax(md.mm()->cm); par.addParam(RichFloat("minVal", minmax.first, "Min", "The value that will be mapped with the lower end of the scale (blue)")); par.addParam(RichFloat("maxVal", minmax.second, "Max", "The value that will be mapped with the upper end of the scale (red)")); - par.addParam(RichDynamicFloat("perc", 0, 0, 100, "Percentile Crop [0..100]", "If not zero this value will be used for a percentile cropping of the quality values.
    If this parameter is set to a value P then the two values V_min,V_max for which P% of the vertices have a quality lower or greater than V_min,V_max are used as min/max values for clamping.

    The automated percentile cropping is very useful for automatically discarding outliers.")); + par.addParam(RichDynamicFloat("perc", 0, 0, 100, "Percentile Crop [0..100]", "If not zero this value will be used for a percentile cropping of the quality values.
    If this parameter is set to a value P then the two values V_min,V_max for which P% of the vertices have a quality lower or greater than V_min,V_max are used as min/max values for clamping.

    The automated percentile cropping is very useful for automatically discarding outliers.")); par.addParam(RichBool("zeroSym", false, "Zero Symmetric", "If true the min max range will be enlarged to be symmetric (so that green is always Zero)")); break; } @@ -359,7 +359,7 @@ void FilterColorProc::initParameterSet(QAction *a, MeshDocument& md, RichParamet minmax = tri::Stat::ComputePerFaceQualityMinMax(md.mm()->cm); par.addParam(RichFloat("minVal", minmax.first, "Min", "The value that will be mapped with the lower end of the scale (blue)")); par.addParam(RichFloat("maxVal", minmax.second, "Max", "The value that will be mapped with the upper end of the scale (red)")); - par.addParam(RichDynamicFloat("perc", 0, 0, 100, "Percentile Crop [0..100]", "If not zero this value will be used for a percentile cropping of the quality values.
    If this parameter is set to a value P then the two values V_min,V_max for which P% of the faces have a quality lower or greater than V_min,V_max are used as min/max values for clamping.

    The automated percentile cropping is very useful for automatically discarding outliers.")); + par.addParam(RichDynamicFloat("perc", 0, 0, 100, "Percentile Crop [0..100]", "If not zero this value will be used for a percentile cropping of the quality values.
    If this parameter is set to a value P then the two values V_min,V_max for which P% of the faces have a quality lower or greater than V_min,V_max are used as min/max values for clamping.

    The automated percentile cropping is very useful for automatically discarding outliers.")); par.addParam(RichBool("zeroSym", false, "Zero Symmetric", "If true the min max range will be enlarged to be symmetric (so that green is always Zero)")); break; } diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.cpp b/src/meshlabplugins/filter_fractal/filter_fractal.cpp index d757fdb5e..e1461435e 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.cpp +++ b/src/meshlabplugins/filter_fractal/filter_fractal.cpp @@ -68,20 +68,31 @@ QString FilterFractal::filterInfo(FilterIDType filterId) const filename = ":/ff_fractal_description.txt"; break; case FP_CRATERS: - filename = ":/ff_craters_description.txt"; + description = + "Generates craters onto a mesh using radial functions.
    " + "There must be at least two layers to apply this filter:
    " + "
      " + "
    • the layer that contains the target mesh; we assume that this mesh is sufficiently refined;
    • " + "
    • the layer that contains the samples which represent the central points of craters.
    • " + "
    " + "There are three radial functions available to generate craters, two of which are Gaussian and Multiquadric, " + "and the third is a variant of multiquadric. Blending functions are also provided to blend " + "the crater elevation towards the mesh surface. " + "If you want the preview to work, be sure to select the target mesh layer before launching the " + "filter. You can select this layer by clicking on it in the layer dialog."; break; default: assert(0); return QString("error"); break; } - QFile f(filename); - if(f.open(QFile::ReadOnly)) - { - QTextStream stream(&f); - description = stream.readAll(); - f.close(); - } +// QFile f(filename); +// if(f.open(QFile::ReadOnly)) +// { +// QTextStream stream(&f); +// description = stream.readAll(); +// f.close(); +// } if(filterId == FP_FRACTAL_MESH) { diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.cpp b/src/meshlabplugins/filter_plymc/filter_plymc.cpp index 84f96429a..38a4215b5 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.cpp +++ b/src/meshlabplugins/filter_plymc/filter_plymc.cpp @@ -71,7 +71,7 @@ QString PlyMCPlugin::pluginName() const case FP_PLYMC : return QString( "The surface reconstrction algorithm that have been used for a long time inside the ISTI-Visual Computer Lab." "It is mostly a variant of the Curless et al. e.g. a volumetric approach with some original weighting schemes," "a different expansion rule, and another approach to hole filling through volume dilation/relaxations.
    " - "The filter is applied to ALL the visible layers. In practice, all the meshes/point clouds that are currently visible are used to build the volumetric distance field."); + "The filter is applied to ALL the visible layers. In practice, all the meshes/point clouds that are currently visible are used to build the volumetric distance field."); case FP_MC_SIMPLIFY : return QString( "A simplification/cleaning algorithm that works ONLY on meshes generated by Marching Cubes algorithm." ); default : assert(0); diff --git a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp index f94a9353b..e65ae1ec1 100644 --- a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp +++ b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp @@ -98,8 +98,8 @@ void ExtraSampleGPUPlugin::initParameterSet(QAction * action, MeshModel & m, Ric parlst.addParam(RichColor ("ImageBackgroundColor", QColor(50, 50, 50), "Image Background Color", "The color used as image background." )); parlst.addParam(RichInt ("ImageWidth", 512, "Image Width", "The width in pixels of the produced image." )); parlst.addParam(RichInt ("ImageHeight", 512, "Image Height", "The height in pixels of the produced image.")); - QString curr = QDir::currentPath(); - parlst.addParam(RichSaveFile ("ImageFileName", curr + "/gpu_generated_image.png", "*.png", "Base Image File Name", "The file name used to save the image." )); + //QString curr = QDir::currentPath(); + parlst.addParam(RichSaveFile ("ImageFileName", /*curr + "/" */+"gpu_generated_image.png", "*.png", "Base Image File Name", "The file name used to save the image." )); break; } default : assert(0); diff --git a/src/meshlabplugins/filter_texture/filter_texture.cpp b/src/meshlabplugins/filter_texture/filter_texture.cpp index c958df4a1..f0a6de780 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.cpp +++ b/src/meshlabplugins/filter_texture/filter_texture.cpp @@ -231,7 +231,7 @@ void FilterTexturePlugin::initParameterSet(QAction *action, MeshDocument &md, Ri parlst.addParam(RichMesh ("targetMesh",md.mm(),&md, "Target Mesh", "The mesh whose texture will be filled according to source mesh data")); parlst.addParam(RichEnum("AttributeEnum", 0, QStringList("Vertex Color") << "Vertex Normal" << "Vertex Quality"<< "Texture Color", "Color Data Source", - "Choose what attribute has to be transferred onto the target texture. You can choose bettween Per vertex attributes (clor,normal,quality) or to transfer color information from source mesh texture")); + "Choose what attribute has to be transferred onto the target texture. You can choose bettween Per vertex attributes (color,normal,quality) or to transfer color information from source mesh texture")); parlst.addParam(RichAbsPerc("upperBound", md.mm()->cm.bbox.Diag()/50.0, 0.0f, md.mm()->cm.bbox.Diag(), tr("Max Dist Search"), tr("Sample points for which we do not find anything within this distance are rejected and not considered for recovering data"))); parlst.addParam(RichString("textName", fileName, "Texture file", "The texture file to be created")); diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp index b4ad61fc8..2812e2493 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp @@ -324,22 +324,22 @@ void FilterUnsharp::initParameterSet(QAction *action, MeshDocument &md, RichPara break; case FP_UNSHARP_NORMAL: parlst.addParam(RichBool("recalc", false, tr("Recompute Normals"), tr("Recompute normals from scratch before the unsharp masking"))); - parlst.addParam(RichFloat("weight", 0.3f, tr("Unsharp Weight"), tr("the unsharp weight wu in the unsharp mask equation:
    woorig + wu (orig - lowpass)
    "))); + parlst.addParam(RichFloat("weight", 0.3f, tr("Unsharp Weight"), tr("the unsharp weight wu in the unsharp mask equation:
    woorig + wu (orig - lowpass)
    "))); parlst.addParam(RichFloat("weightOrig", 1.f, tr("Original Weight"), tr("How much the original signal is used, e.g. the weight wo in the above unsharp mask equation.
    Usually you should not need to change the default 1.0 value."))); parlst.addParam(RichInt("iterations", 5, "Smooth Iterations", tr("number of laplacian face smooth iterations in every run"))); break; case FP_UNSHARP_GEOMETRY: - parlst.addParam(RichFloat("weight", 0.3f, tr("Unsharp Weight"), tr("the unsharp weight wu in the unsharp mask equation:
    woorig + wu (orig - lowpass)
    "))); + parlst.addParam(RichFloat("weight", 0.3f, tr("Unsharp Weight"), tr("the unsharp weight wu in the unsharp mask equation:
    woorig + wu (orig - lowpass)
    "))); parlst.addParam(RichFloat("weightOrig", 1.f, tr("Original Weight"), tr("How much the original signal is used, e.g. the weight wo in the above unsharp mask equation
    Usually you should not need to change the default 1.0 value."))); parlst.addParam(RichInt("iterations", 5, "Smooth Iterations", tr("number of iterations of laplacian smooth in every run"))); break; case FP_UNSHARP_VERTEX_COLOR: - parlst.addParam(RichFloat("weight", 0.3f, tr("Unsharp Weight"), tr("the unsharp weight wu in the unsharp mask equation:
    woorig + wu (orig - lowpass)
    "))); + parlst.addParam(RichFloat("weight", 0.3f, tr("Unsharp Weight"), tr("the unsharp weight wu in the unsharp mask equation:
    woorig + wu (orig - lowpass)
    "))); parlst.addParam(RichFloat("weightOrig", 1.f, tr("Original Color Weight"), tr("How much the original signal is used, e.g. the weight wo in the above unsharp mask equation
    Usually you should not need to change the default 1.0 value."))); parlst.addParam(RichInt("iterations", 5, "Smooth Iterations", tr("number of iterations of laplacian smooth in every run"))); break; case FP_UNSHARP_QUALITY: - parlst.addParam(RichFloat("weight", 0.3f, tr("Unsharp Weight"), tr("the unsharp weight wu in the unsharp mask equation:
    woorig + wu (orig - lowpass)
    "))); + parlst.addParam(RichFloat("weight", 0.3f, tr("Unsharp Weight"), tr("the unsharp weight wu in the unsharp mask equation:
    woorig + wu (orig - lowpass)
    "))); parlst.addParam(RichFloat("weightOrig", 1.f, tr("Original Weight"), tr("How much the original signal is used, e.g. the weight wo in the above unsharp mask equation
    Usually you should not need to change the default 1.0 value."))); parlst.addParam(RichInt("iterations", 5, "Smooth Iterations", tr("number of iterations of laplacian smooth in every run"))); break; From 5c7d8bd4cad009285c52a39c8a480723e25ace85 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Mon, 7 Sep 2020 16:50:23 +0200 Subject: [PATCH 12/49] filter fractal description fix --- .../filter_fractal/CMakeLists.txt | 4 +- .../filter_fractal/ff_craters_description.txt | 12 ---- .../filter_fractal/ff_fractal_description.txt | 65 ------------------- src/meshlabplugins/filter_fractal/ff_res.qrc | 6 -- .../filter_fractal/filter_fractal.cpp | 65 ++++++++++++++++++- .../filter_fractal/filter_fractal.pro | 7 -- 6 files changed, 65 insertions(+), 94 deletions(-) delete mode 100644 src/meshlabplugins/filter_fractal/ff_craters_description.txt delete mode 100644 src/meshlabplugins/filter_fractal/ff_fractal_description.txt delete mode 100644 src/meshlabplugins/filter_fractal/ff_res.qrc diff --git a/src/meshlabplugins/filter_fractal/CMakeLists.txt b/src/meshlabplugins/filter_fractal/CMakeLists.txt index ab5aab228..305c67ed3 100644 --- a/src/meshlabplugins/filter_fractal/CMakeLists.txt +++ b/src/meshlabplugins/filter_fractal/CMakeLists.txt @@ -10,9 +10,7 @@ set(SOURCES filter_fractal.cpp) set(HEADERS craters_utils.h filter_fractal.h filter_functors.h fractal_utils.h) -set(RESOURCES ff_res.qrc) - -add_library(filter_fractal MODULE ${SOURCES} ${HEADERS} ${RESOURCES}) +add_library(filter_fractal MODULE ${SOURCES} ${HEADERS}) target_include_directories(filter_fractal PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(filter_fractal PUBLIC common) diff --git a/src/meshlabplugins/filter_fractal/ff_craters_description.txt b/src/meshlabplugins/filter_fractal/ff_craters_description.txt deleted file mode 100644 index bc708040a..000000000 --- a/src/meshlabplugins/filter_fractal/ff_craters_description.txt +++ /dev/null @@ -1,12 +0,0 @@ -Generates craters onto a mesh using radial functions.
    -There must be at least two layers to apply this filter:
    -
      -
    • the layer that contains the target mesh; we assume that this mesh is sufficiently refined;
    • -
    • the layer that contains the samples which represent the central points of craters.
    • -
    - -There are three radial functions available to generate craters, two of which are Gaussian and Multiquadric, -and the third is a variant of multiquadric. Blending functions are also provided to blend -the crater elevation towards the mesh surface. -If you want the preview to work, be sure to select the target mesh layer before launching the -filter. You can select this layer by clicking on it in the layer dialog. diff --git a/src/meshlabplugins/filter_fractal/ff_fractal_description.txt b/src/meshlabplugins/filter_fractal/ff_fractal_description.txt deleted file mode 100644 index b2640fe9e..000000000 --- a/src/meshlabplugins/filter_fractal/ff_fractal_description.txt +++ /dev/null @@ -1,65 +0,0 @@ -Generates a fractal terrain perturbation with five different algorithms.
    -Some good parameter values to start with are:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Seed Octaves Lacunarity Fractal increment Offset Gain
    fBM11021.2--
    Standard multifractal1820.90.9-
    Heterogeneous multifractal1830.90.4-
    Hybrid multifractal1840.10.3-
    Ridged multifractal2840.50.92
    -

    -Detailed algorithms descriptions can be found in:
    -Ebert, D.S., Musgrave, F.K., Peachey, D., Perlin, K., and Worley, S.
    -Texturing and Modeling: A Procedural Approach
    -Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 2002.
    - - diff --git a/src/meshlabplugins/filter_fractal/ff_res.qrc b/src/meshlabplugins/filter_fractal/ff_res.qrc deleted file mode 100644 index 34491ff84..000000000 --- a/src/meshlabplugins/filter_fractal/ff_res.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - ff_fractal_description.txt - ff_craters_description.txt - - diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.cpp b/src/meshlabplugins/filter_fractal/filter_fractal.cpp index e1461435e..d7c6d8c58 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.cpp +++ b/src/meshlabplugins/filter_fractal/filter_fractal.cpp @@ -65,7 +65,70 @@ QString FilterFractal::filterInfo(FilterIDType filterId) const switch (filterId) { case CR_FRACTAL_TERRAIN: case FP_FRACTAL_MESH: - filename = ":/ff_fractal_description.txt"; + description = + "Generates a fractal terrain perturbation with five different algorithms.
    " + "Some good parameter values to start with are:
    " + "" + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + "
    - Seed Octaves Lacunarity Fractal increment Offset Gain
    fBM11021.2--
    Standard multifractal1820.90.9-
    Heterogeneous multifractal1830.90.4-
    Hybrid multifractal1840.10.3-
    Ridged multifractal2840.50.92
    " + "

    " + "Detailed algorithms descriptions can be found in:
    " + "Ebert, D.S., Musgrave, F.K., Peachey, D., Perlin, K., and Worley, S.
    " + "Texturing and Modeling: A Procedural Approach
    " + "Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 2002.
    "; break; case FP_CRATERS: description = diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.pro b/src/meshlabplugins/filter_fractal/filter_fractal.pro index 2c489a8bb..28707f51e 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.pro +++ b/src/meshlabplugins/filter_fractal/filter_fractal.pro @@ -9,11 +9,4 @@ HEADERS += \ SOURCES += \ filter_fractal.cpp -RESOURCES += \ - ff_res.qrc - -OTHER_FILES += \ - ff_fractal_description.txt \ - ff_craters_description.txt - TARGET = filter_fractal From 266d53a7fd4d2c80176d6b67ad950a03bb9bf7e9 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Mon, 7 Sep 2020 17:59:12 +0200 Subject: [PATCH 13/49] clean unused FloatList value --- src/common/filter_parameter/rich_parameter_list.cpp | 9 --------- src/common/filter_parameter/rich_parameter_list.h | 1 - src/common/filter_parameter/value.h | 2 -- 3 files changed, 12 deletions(-) diff --git a/src/common/filter_parameter/rich_parameter_list.cpp b/src/common/filter_parameter/rich_parameter_list.cpp index 7a057d6c9..a5cc5e419 100644 --- a/src/common/filter_parameter/rich_parameter_list.cpp +++ b/src/common/filter_parameter/rich_parameter_list.cpp @@ -194,15 +194,6 @@ int RichParameterList::getEnum(const QString& name) const return getParameterByName(name).value().getEnum(); } -/** - * @return the float list of the RichParameter having the given name. - * @throws an MLException if the name is not found in the list - */ -QList RichParameterList::getFloatList(const QString& name) const -{ - return getParameterByName(name).value().getFloatList(); -} - /** * @return the mesh of the RichParameter having the given name. * @throws an MLException if the name is not found in the list diff --git a/src/common/filter_parameter/rich_parameter_list.h b/src/common/filter_parameter/rich_parameter_list.h index 58f8b291b..c22c3ea9f 100644 --- a/src/common/filter_parameter/rich_parameter_list.h +++ b/src/common/filter_parameter/rich_parameter_list.h @@ -112,7 +112,6 @@ public: float getAbsPerc(const QString& name) const; int getEnum(const QString& name) const; MeshModel* getMesh(const QString& name) const; - QList getFloatList(const QString& name) const; float getDynamicFloat(const QString& name) const; QString getOpenFileName(const QString& name) const; QString getSaveFileName(const QString& name) const; diff --git a/src/common/filter_parameter/value.h b/src/common/filter_parameter/value.h index b76d5302f..b3f2bbb63 100644 --- a/src/common/filter_parameter/value.h +++ b/src/common/filter_parameter/value.h @@ -56,7 +56,6 @@ public: virtual float getAbsPerc() const { assert(0); return float(); } virtual int getEnum() const { assert(0); return int(); } virtual MeshModel* getMesh() const { assert(0); return NULL; } - virtual QList getFloatList() const { assert(0); return QList(); } virtual float getDynamicFloat() const { assert(0); return float(); } virtual QString getFileName() const { assert(0); return QString(); } @@ -71,7 +70,6 @@ public: virtual bool isAbsPerc() const { return false; } virtual bool isEnum() const { return false; } virtual bool isMesh() const { return false; } - virtual bool isFloatList() const { return false; } virtual bool isDynamicFloat() const { return false; } virtual bool isFileName() const { return false; } From 0df72c611ef6c433a1a6973b2eafffbf1b267e57 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 9 Sep 2020 16:57:14 +0200 Subject: [PATCH 14/49] copy constructor and copy assignment of CMeshO --- src/common/ml_mesh_type.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/common/ml_mesh_type.h b/src/common/ml_mesh_type.h index 9c1b39610..6b139ccaa 100644 --- a/src/common/ml_mesh_type.h +++ b/src/common/ml_mesh_type.h @@ -150,6 +150,30 @@ public : bb.Add(Tr,bbox); return bb; } + + CMeshO() : + vcg::tri::TriMesh< vcg::vertex::vector_ocf, vcg::face::vector_ocf >(), + sfn(0), svn(0), pvn(0), pfn(0) + { + } + + CMeshO(CMeshO& oth) : CMeshO() { + vcg::tri::Append::Mesh(*this, oth); + } + + //TODO need to change this + CMeshO(CMeshO&& oth) : CMeshO() { + //I could take everything from oth and place it in + //this mesh + vcg::tri::Append::Mesh(*this, oth); + } + + //TODO should change also this and use the copy&swap idiom + CMeshO& operator=(CMeshO& oth) { + Clear(); + vcg::tri::Append::Mesh(*this, oth); + return *this; + } }; #endif From f87b8a875ff5ce19905ba590fbf04b39f3181407 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Mon, 14 Sep 2020 12:08:43 +0200 Subject: [PATCH 15/49] update vcglib --- vcglib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcglib b/vcglib index 5c0a0f729..d33a25db2 160000 --- a/vcglib +++ b/vcglib @@ -1 +1 @@ -Subproject commit 5c0a0f729b49f52dd3bc4b23f3cb2aa4a9f3666e +Subproject commit d33a25db2dfc63d74d9c40a7f0bd40633c4b8142 From afca6845149ffa76f8a0f8de620aac050de3102f Mon Sep 17 00:00:00 2001 From: Paolo Cignoni Date: Mon, 14 Sep 2020 22:33:29 +0200 Subject: [PATCH 16/49] Removed useless check for writing. Probably due to an old version of CSG that required temporary files --- src/meshlabplugins/filter_csg/filter_csg.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/meshlabplugins/filter_csg/filter_csg.cpp b/src/meshlabplugins/filter_csg/filter_csg.cpp index dc686cfaf..974c676e9 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.cpp +++ b/src/meshlabplugins/filter_csg/filter_csg.cpp @@ -143,15 +143,6 @@ bool FilterCSG::applyFilter(QAction *filter, MeshDocument &md, const RichParamet return false; // can't continue, mesh can't be processed } - //check if folder is writable - QTemporaryFile file("./_tmp_XXXXXX.tmp"); - if (!file.open()) - { - Log("ERROR - current folder is not writable. CSG needs to save intermediate files in the current working folder. Project and meshes must be in a write-enabled folder. Please save your data in a suitable folder before applying."); - errorMessage = "current folder is not writable.
    CSG needs to save intermediate files in the current working folder.
    Project and meshes must be in a write-enabled folder.
    Please save your data in a suitable folder before applying."; - return false; - } - firstMesh->updateDataMask(MeshModel::MM_FACEFACETOPO | MeshModel::MM_FACENORMAL | MeshModel::MM_FACEQUALITY); secondMesh->updateDataMask(MeshModel::MM_FACEFACETOPO | MeshModel::MM_FACENORMAL | MeshModel::MM_FACEQUALITY); if (!isValid (firstMesh->cm, this->errorMessage) || !isValid (secondMesh->cm, this->errorMessage)) From 1c0a1fa0184763d53e86c163815182315de5d2a0 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Tue, 15 Sep 2020 11:21:00 +0200 Subject: [PATCH 17/49] fix filter_sampling post condition --- src/meshlabplugins/filter_sampling/filter_sampling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.cpp b/src/meshlabplugins/filter_sampling/filter_sampling.cpp index 1993dc46a..ed120f436 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.cpp +++ b/src/meshlabplugins/filter_sampling/filter_sampling.cpp @@ -1382,7 +1382,7 @@ int FilterDocSampling::postCondition( QAction* a ) const { switch(ID(a)){ case FP_VORONOI_COLORING : - case FP_DISK_COLORING : return MeshModel::MM_VERTCOLOR; + case FP_DISK_COLORING : return MeshModel::MM_VERTCOLOR | MeshModel::MM_VERTQUALITY; case FP_ELEMENT_SUBSAMPLING : case FP_MONTECARLO_SAMPLING : From 56289467661ac326def0a4d0f824bf2708edfb35 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 16 Sep 2020 19:51:45 +0200 Subject: [PATCH 18/49] external.pro and meshlab_mini.pro config files inside src dir --- .github/workflows/BuildAndRelease.yml | 4 +- src/external.pro | 9 +++++ src/meshlab_mini.pro | 55 +++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 src/external.pro create mode 100644 src/meshlab_mini.pro diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index 802f422e6..12331a0e4 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -198,9 +198,7 @@ jobs: #mirror: 'http://mirrors.ocf.berkeley.edu/qt/' - name: Build MeshLab run: | - cd src\ - qmake - jom -j4 #Qt nmake for parallel build + .\install\windows\windows_build.ps1 - name: Deploy MeshLab run: | .\install\windows\windows_deploy.ps1 diff --git a/src/external.pro b/src/external.pro new file mode 100644 index 000000000..c8c453b31 --- /dev/null +++ b/src/external.pro @@ -0,0 +1,9 @@ +#this project file builds just the external libraries + +TEMPLATE = subdirs + +message("MeshLab External") +message("DISTRIB_DIRECTORY: "$$MESHLAB_DISTRIB_DIRECTORY) + +SUBDIRS = \ + external diff --git a/src/meshlab_mini.pro b/src/meshlab_mini.pro new file mode 100644 index 000000000..b83daf984 --- /dev/null +++ b/src/meshlab_mini.pro @@ -0,0 +1,55 @@ +# File for compiling just meshlab mini (without the external libraries!) +# +# MeshLab qmake config uses the following variables: +# +# MESHLAB_SOURCE_DIRECTORY: the directory where is placed the main meshlab.pro +# MESHLAB_BUILD_DIRECTORY: the directory where the meshlab build files are placed +# MESHLAB_DISTRIB_DIRECTORY: the directory that will contain all the files necessary +# for a portable version (after build and deploy) +# (if shadow build, will be MESHLAB_BUILD_DIRECTORY/distrib) +# MESHLAB_EXTERNAL_DIRECTORY: the directory where external libraries are placed +# + +TEMPLATE = subdirs + +message("MeshLab Mini") +message("DISTRIB_DIRECTORY: "$$MESHLAB_DISTRIB_DIRECTORY) + +#the following sub projects are compiled ALSO with MeshLab Mini +SUBDIRS = \ #sub projects names + common \ + meshlab \ + meshlabserver \ + io_base \ # a few basic file formats (ply, obj, off), without this you cannot open anything + decorate_base \ + filter_measure \ + filter_meshing + +common.subdir = common +meshlab.subdir = meshlab +meshlabserver.subdir = meshlabserver +io_base.subdir = meshlabplugins/io_base +decorate_base.subdir = meshlabplugins/decorate_base +filter_measure.subdir = meshlabplugins/filter_measure +filter_meshing.subdir = meshlabplugins/filter_meshing + +meshlab.depends = common +meshlabserver.depends = common +io_base.depends = common +decorate_base.depends = common +filter_measure.depends = common +filter_meshing.depends = common + +# if distrib folder is not in $$PWD/../distrib (shadow build case), +# we need to copy all the files inside $$PWD/../distrib in the actual +# distrib folder ($$OUT_PWD/distrib or $$MESHLAB_DISTRIB_DIRECTORY) +!equals(PWD, $$OUT_PWD) : !equals(PWD, $$OUT_PWD/src) { + #copying the "lib" folder inside the $$OUT_PWD/distrib + win32:copydir.commands = $(COPY_DIR) \"$$shell_path($$PWD/../distrib)\" \"$$shell_path($$OUT_PWD/distrib)\" + !win32:copydir.commands = $(COPY_DIR) \"$$shell_path($$PWD/../distrib)\" \"$$shell_path($$OUT_PWD)\" + first.depends += $(first) copydir + export(first.depends) + export(copydir.commands) + + QMAKE_EXTRA_TARGETS += first copydir +} From 8f3f889922a32d0e6687b3a36cb45df154b4ad1c Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 17 Sep 2020 13:38:22 +0200 Subject: [PATCH 19/49] postCondition and getClass const correctness --- src/common/interfaces.cpp | 2 +- src/common/interfaces.h | 16 ++++++++-------- src/meshlabplugins/filter_ao/filter_ao.cpp | 2 +- src/meshlabplugins/filter_ao/filter_ao.h | 2 +- .../filter_camera/filter_camera.cpp | 4 ++-- src/meshlabplugins/filter_camera/filter_camera.h | 4 ++-- src/meshlabplugins/filter_clean/cleanfilter.cpp | 4 ++-- src/meshlabplugins/filter_clean/cleanfilter.h | 4 ++-- .../filter_color_projection.cpp | 4 ++-- .../filter_color_projection.h | 4 ++-- .../filter_colorproc/filter_colorproc.cpp | 4 ++-- .../filter_colorproc/filter_colorproc.h | 4 ++-- .../filter_create/filter_create.cpp | 2 +- src/meshlabplugins/filter_create/filter_create.h | 2 +- .../filter_createiso/filter_createiso.cpp | 2 +- .../filter_createiso/filter_createiso.h | 2 +- src/meshlabplugins/filter_csg/filter_csg.h | 2 +- src/meshlabplugins/filter_dirt/filter_dirt.cpp | 4 ++-- src/meshlabplugins/filter_dirt/filter_dirt.h | 4 ++-- .../filter_fractal/filter_fractal.cpp | 4 ++-- .../filter_fractal/filter_fractal.h | 4 ++-- src/meshlabplugins/filter_func/filter_func.cpp | 4 ++-- src/meshlabplugins/filter_func/filter_func.h | 4 ++-- .../filter_geodesic/filter_geodesic.cpp | 4 ++-- .../filter_geodesic/filter_geodesic.h | 4 ++-- .../globalregistration.cpp | 2 +- .../globalregistration.h | 4 ++-- .../filter_img_patch_param.cpp | 2 +- .../filter_img_patch_param.h | 2 +- .../filter_isoparametrization.cpp | 4 ++-- .../filter_isoparametrization.h | 4 ++-- src/meshlabplugins/filter_layer/filter_layer.cpp | 4 ++-- src/meshlabplugins/filter_layer/filter_layer.h | 4 ++-- .../filter_measure/filter_measure.cpp | 4 ++-- .../filter_measure/filter_measure.h | 4 ++-- src/meshlabplugins/filter_meshing/meshfilter.cpp | 4 ++-- src/meshlabplugins/filter_meshing/meshfilter.h | 4 ++-- src/meshlabplugins/filter_mls/mlsplugin.cpp | 2 +- src/meshlabplugins/filter_mls/mlsplugin.h | 2 +- .../filter_mutualglobal/filter_mutualglobal.cpp | 2 +- .../filter_mutualglobal/filter_mutualglobal.h | 4 ++-- .../filter_mutualinfo/filter_mutualinfo.cpp | 4 ++-- .../filter_mutualinfo/filter_mutualinfo.h | 4 ++-- src/meshlabplugins/filter_plymc/filter_plymc.cpp | 4 ++-- src/meshlabplugins/filter_plymc/filter_plymc.h | 4 ++-- src/meshlabplugins/filter_qhull/filter_qhull.cpp | 2 +- src/meshlabplugins/filter_qhull/filter_qhull.h | 2 +- .../filter_quality/filterqualitymapper.cpp | 6 +++--- .../filter_quality/filterqualitymapper.h | 4 ++-- .../filter_sample/filter_sample.cpp | 4 ++-- src/meshlabplugins/filter_sample/filter_sample.h | 4 ++-- .../filter_sample_dyn/filter_sample_dyn.cpp | 2 +- .../filter_sample_dyn/filter_sample_dyn.h | 4 ++-- .../filter_sample_gpu/filter_sample_gpu.cpp | 2 +- .../filter_sample_gpu/filter_sample_gpu.h | 2 +- .../filter_sampling/filter_sampling.cpp | 4 ++-- .../filter_sampling/filter_sampling.h | 4 ++-- .../filter_screened_poisson.cpp | 4 ++-- .../filter_screened_poisson.h | 4 ++-- src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h | 2 +- .../filter_sdfgpu/filterinterface.h | 6 +++--- src/meshlabplugins/filter_select/meshselect.cpp | 4 ++-- src/meshlabplugins/filter_select/meshselect.h | 4 ++-- .../filter_sketchfab/filter_sketchfab.cpp | 4 ++-- .../filter_sketchfab/filter_sketchfab.h | 4 ++-- .../filter_ssynth/filter_ssynth.cpp | 4 ++-- src/meshlabplugins/filter_ssynth/filter_ssynth.h | 4 ++-- .../filter_texture/filter_texture.cpp | 4 ++-- .../filter_texture/filter_texture.h | 4 ++-- .../filter_trioptimize/filter_trioptimize.cpp | 2 +- .../filter_trioptimize/filter_trioptimize.h | 2 +- .../filter_unsharp/filter_unsharp.cpp | 4 ++-- .../filter_unsharp/filter_unsharp.h | 4 ++-- .../filter_voronoi/filter_voronoi.cpp | 2 +- .../filter_voronoi/filter_voronoi.h | 2 +- 75 files changed, 134 insertions(+), 134 deletions(-) diff --git a/src/common/interfaces.cpp b/src/common/interfaces.cpp index 49282f9ef..b0ed5e11d 100644 --- a/src/common/interfaces.cpp +++ b/src/common/interfaces.cpp @@ -39,7 +39,7 @@ bool MeshFilterInterface::isFilterApplicable(QAction *act, const MeshModel& m, Q return MissingItems.isEmpty(); } -int MeshFilterInterface::previewOnCreatedAttributes(QAction* act,const MeshModel& mm ) +int MeshFilterInterface::previewOnCreatedAttributes(const QAction* act, const MeshModel& mm ) const { int changedIfCalled = postCondition(act); int createdIfCalled = MeshModel::MM_NONE; diff --git a/src/common/interfaces.h b/src/common/interfaces.h index e95efdb34..ba18a5178 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -340,7 +340,7 @@ public: // This choice affect the submenu in which each filter will be placed // For example filters that perform an action only on the selection will be placed in the Selection Class */ - virtual FilterClass getClass(QAction *) { return MeshFilterInterface::Generic; } + virtual FilterClass getClass(const QAction *) const { return MeshFilterInterface::Generic; } /** The filters can have some additional requirements on the mesh capabiliteis. @@ -368,7 +368,7 @@ public: // It is widely used by the meshlab's preview system. //TO BE REPLACED WITH = 0 */ - virtual int postCondition(QAction*) const { return MeshModel::MM_ALL; } + virtual int postCondition(const QAction*) const { return MeshModel::MM_ALL; } /** \brief applies the selected filter with the already stabilished parameters * This function is called by the framework after getting values for the parameters specified in the \ref InitParameterSet @@ -419,7 +419,7 @@ public: virtual QString filterName(QAction *a) const { return this->filterName(ID(a)); } virtual QString filterScriptFunctionName(FilterIDType /*filterID*/) { return ""; } - virtual FilterIDType ID(QAction *a) const + virtual FilterIDType ID(const QAction *a) const { QString aa=a->text(); foreach(FilterIDType tt, types()) @@ -439,13 +439,13 @@ public: return AC(idName); } - virtual QAction *AC(QString idName) + virtual QAction *AC(const QString& idName) { - QString i=idName; - foreach(QAction *tt, actionList) + QString i=idName; + for(QAction *tt : actionList) if (idName == tt->text()) return tt; i.replace("&",""); - foreach(QAction *tt, actionList) + for(QAction *tt : actionList) if (i == tt->text()) return tt; qDebug("unable to find the action corresponding to action '%s'", qUtf8Printable(idName)); @@ -458,7 +458,7 @@ public: /** Generate the mask of attributes would be created IF the MeshFilterInterface filt would has been called on MeshModel mm BE CAREFUL! this function does NOT change in anyway the state of the MeshModel!!!! **/ - int previewOnCreatedAttributes(QAction* act, const MeshModel& mm); + int previewOnCreatedAttributes(const QAction* act, const MeshModel& mm) const; QString generatedScriptCode; MLPluginGLContext* glContext; diff --git a/src/meshlabplugins/filter_ao/filter_ao.cpp b/src/meshlabplugins/filter_ao/filter_ao.cpp index 3b9dcb83a..1253b34b5 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.cpp +++ b/src/meshlabplugins/filter_ao/filter_ao.cpp @@ -104,7 +104,7 @@ MeshFilterInterface::FILTER_ARITY AmbientOcclusionPlugin::filterArity(QAction*) int getRequirements(QAction *action); -MeshFilterInterface::FilterClass AmbientOcclusionPlugin::getClass(QAction * /*filter*/) +MeshFilterInterface::FilterClass AmbientOcclusionPlugin::getClass(const QAction * /*filter*/) const { return MeshFilterInterface::VertexColoring; //return MeshFilterInterface::FilterClass(MeshFilterInterface::FaceColoring | MeshFilterInterface::VertexColoring); diff --git a/src/meshlabplugins/filter_ao/filter_ao.h b/src/meshlabplugins/filter_ao/filter_ao.h index 9bfb05d17..808d5f447 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.h +++ b/src/meshlabplugins/filter_ao/filter_ao.h @@ -73,7 +73,7 @@ public: QString filterInfo(FilterIDType filterId) const; FILTER_ARITY filterArity(QAction*) const; int getRequirements (QAction *action); - FilterClass getClass(QAction *filter); + FilterClass getClass(const QAction* filter) const; void initParameterSet(QAction *,MeshModel &/*m*/,RichParameterList & /*parent*/); bool applyFilter(QAction *filter,MeshDocument &md,const RichParameterList & /*parent*/,vcg::CallBackPos * cb) ; diff --git a/src/meshlabplugins/filter_camera/filter_camera.cpp b/src/meshlabplugins/filter_camera/filter_camera.cpp index 0eb7117e8..f17c5250f 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.cpp +++ b/src/meshlabplugins/filter_camera/filter_camera.cpp @@ -690,7 +690,7 @@ bool FilterCameraPlugin::applyFilter(QAction *filter, MeshDocument &md, const Ri return true; } -int FilterCameraPlugin::postCondition(QAction * filter) const +int FilterCameraPlugin::postCondition(const QAction * filter) const { switch (ID(filter)) { @@ -707,7 +707,7 @@ int FilterCameraPlugin::postCondition(QAction * filter) const } } -FilterCameraPlugin::FilterClass FilterCameraPlugin::getClass(QAction *a) +FilterCameraPlugin::FilterClass FilterCameraPlugin::getClass(const QAction *a) const { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_camera/filter_camera.h b/src/meshlabplugins/filter_camera/filter_camera.h index e21cb8dde..1f5b4fa3c 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.h +++ b/src/meshlabplugins/filter_camera/filter_camera.h @@ -47,10 +47,10 @@ public: FilterCameraPlugin(); QString pluginName() const; int getPreConditions(QAction *) const; - int postCondition(QAction * filter) const; + int postCondition(const QAction* filter) const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual FilterClass getClass(QAction *); + virtual FilterClass getClass(const QAction*) const; virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(QAction* act) const; diff --git a/src/meshlabplugins/filter_clean/cleanfilter.cpp b/src/meshlabplugins/filter_clean/cleanfilter.cpp index b79d18c2d..787021411 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.cpp +++ b/src/meshlabplugins/filter_clean/cleanfilter.cpp @@ -139,7 +139,7 @@ QString CleanFilter::filterName(FilterIDType filter) const return QString("error!"); } - CleanFilter::FilterClass CleanFilter::getClass(QAction *a) + CleanFilter::FilterClass CleanFilter::getClass(const QAction *a) const { switch(ID(a)) { @@ -195,7 +195,7 @@ int CleanFilter::getRequirements(QAction *action) return 0; } -int CleanFilter::postCondition(QAction* action) const +int CleanFilter::postCondition(const QAction* action) const { switch (ID(action)) { diff --git a/src/meshlabplugins/filter_clean/cleanfilter.h b/src/meshlabplugins/filter_clean/cleanfilter.h index c89bc8df0..fff19b728 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.h +++ b/src/meshlabplugins/filter_clean/cleanfilter.h @@ -67,9 +67,9 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual FilterClass getClass(QAction *); + virtual FilterClass getClass(const QAction*) const; virtual int getRequirements(QAction *); - int postCondition(QAction* ) const; + int postCondition(const QAction* ) const; int getPreConditions(QAction *) const { return MeshModel::MM_NONE; } virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp index ad0603b8e..d0a48afde 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp @@ -919,7 +919,7 @@ bool FilterColorProjectionPlugin::applyFilter(QAction *filter, MeshDocument &md, return true; } -FilterColorProjectionPlugin::FilterClass FilterColorProjectionPlugin::getClass(QAction *a) +FilterColorProjectionPlugin::FilterClass FilterColorProjectionPlugin::getClass(const QAction *a) const { switch(ID(a)) { case FP_SINGLEIMAGEPROJ: @@ -936,7 +936,7 @@ FilterColorProjectionPlugin::FilterClass FilterColorProjectionPlugin::getClass(Q } } -int FilterColorProjectionPlugin::postCondition( QAction* a ) const{ +int FilterColorProjectionPlugin::postCondition( const QAction* a ) const{ switch(ID(a)) { case FP_SINGLEIMAGEPROJ: return MeshModel::MM_VERTCOLOR; diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.h b/src/meshlabplugins/filter_color_projection/filter_color_projection.h index dcf5e8831..ce45a658b 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.h +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.h @@ -41,9 +41,9 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - int postCondition( QAction* ) const; + int postCondition( const QAction* ) const; - virtual FilterClass getClass(QAction *); + virtual FilterClass getClass(const QAction*) const; virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual int getRequirements(QAction *); virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp index 9e83bb98c..cbcce9742 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp @@ -915,7 +915,7 @@ bool FilterColorProc::applyFilter(QAction *filter, MeshDocument &md, const RichP return false; } - MeshFilterInterface::FilterClass FilterColorProc::getClass(QAction *a) + MeshFilterInterface::FilterClass FilterColorProc::getClass(const QAction *a) const { switch(ID(a)) { @@ -950,7 +950,7 @@ bool FilterColorProc::applyFilter(QAction *filter, MeshDocument &md, const RichP return MeshFilterInterface::Generic; } -int FilterColorProc::postCondition( QAction* filter ) const +int FilterColorProc::postCondition( const QAction* filter ) const { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.h b/src/meshlabplugins/filter_colorproc/filter_colorproc.h index ea19bc85d..779be78f6 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.h +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.h @@ -68,7 +68,7 @@ public: ~FilterColorProc(); QString pluginName() const; - virtual FilterClass getClass(QAction *); + virtual FilterClass getClass(const QAction*) const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; @@ -76,7 +76,7 @@ public: virtual void initParameterSet(QAction *,MeshDocument&, RichParameterList & /*parent*/); virtual bool applyFilter(QAction *filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); - int postCondition(QAction* filter) const; + int postCondition(const QAction* filter) const; int getPreConditions(QAction *) const; FILTER_ARITY filterArity(QAction *act) const; }; diff --git a/src/meshlabplugins/filter_create/filter_create.cpp b/src/meshlabplugins/filter_create/filter_create.cpp index 9aeb6acb4..af6c6b575 100644 --- a/src/meshlabplugins/filter_create/filter_create.cpp +++ b/src/meshlabplugins/filter_create/filter_create.cpp @@ -527,7 +527,7 @@ bool FilterCreate::applyFilter(QAction *filter, MeshDocument &md, const RichPara return true; } - MeshFilterInterface::FilterClass FilterCreate::getClass(QAction *a) + MeshFilterInterface::FilterClass FilterCreate::getClass(const QAction *a) const { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_create/filter_create.h b/src/meshlabplugins/filter_create/filter_create.h index f120351b9..3c3d8d8c4 100644 --- a/src/meshlabplugins/filter_create/filter_create.h +++ b/src/meshlabplugins/filter_create/filter_create.h @@ -52,7 +52,7 @@ class FilterCreate : public QObject, public MeshFilterInterface QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - FilterClass getClass(QAction *); + FilterClass getClass(const QAction*) const; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; QString filterScriptFunctionName(FilterIDType filterID); diff --git a/src/meshlabplugins/filter_createiso/filter_createiso.cpp b/src/meshlabplugins/filter_createiso/filter_createiso.cpp index 8367c58f8..4c965e393 100644 --- a/src/meshlabplugins/filter_createiso/filter_createiso.cpp +++ b/src/meshlabplugins/filter_createiso/filter_createiso.cpp @@ -79,7 +79,7 @@ QString FilterCreateIso::pluginName() const return QString("error!"); } - FilterCreateIso::FilterClass FilterCreateIso::getClass(QAction *a) + FilterCreateIso::FilterClass FilterCreateIso::getClass(const QAction *a) const { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_createiso/filter_createiso.h b/src/meshlabplugins/filter_createiso/filter_createiso.h index 9aeafe072..eb82900d7 100644 --- a/src/meshlabplugins/filter_createiso/filter_createiso.h +++ b/src/meshlabplugins/filter_createiso/filter_createiso.h @@ -59,7 +59,7 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual FilterClass getClass(QAction *); + virtual FilterClass getClass(const QAction*) const; virtual int getRequirements(QAction *); virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); diff --git a/src/meshlabplugins/filter_csg/filter_csg.h b/src/meshlabplugins/filter_csg/filter_csg.h index 403d63d53..29139655f 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.h +++ b/src/meshlabplugins/filter_csg/filter_csg.h @@ -65,7 +65,7 @@ public: virtual bool applyFilter(QAction *, MeshDocument &, const RichParameterList &, vcg::CallBackPos *); virtual bool applyFilter(QAction *, MeshModel &, const RichParameterList &, vcg::CallBackPos *) { assert(0); return false; } - virtual FilterClass getClass(QAction *) { return MeshFilterInterface::FilterClass( MeshFilterInterface::Layer + MeshFilterInterface::Remeshing ); } + virtual FilterClass getClass(const QAction *) const { return MeshFilterInterface::FilterClass( MeshFilterInterface::Layer + MeshFilterInterface::Remeshing ); } FILTER_ARITY filterArity(QAction*) const {return FIXED;} }; diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.cpp b/src/meshlabplugins/filter_dirt/filter_dirt.cpp index 83d2fcef3..6b32021e2 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.cpp +++ b/src/meshlabplugins/filter_dirt/filter_dirt.cpp @@ -243,7 +243,7 @@ bool FilterDirt::applyFilter(QAction *filter, MeshDocument &md, const RichParame return true; }//End applyFilter -int FilterDirt::postCondition( QAction *a) const +int FilterDirt::postCondition(const QAction *a) const { switch (ID(a)){ case FP_DIRT: return MeshModel::MM_ALL; @@ -253,7 +253,7 @@ int FilterDirt::postCondition( QAction *a) const return MeshModel::MM_ALL; } -MeshFilterInterface::FilterClass FilterDirt::getClass(QAction *filter) +MeshFilterInterface::FilterClass FilterDirt::getClass(const QAction *filter) const { switch (ID(filter)) { case FP_DIRT:return MeshFilterInterface::Sampling; diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.h b/src/meshlabplugins/filter_dirt/filter_dirt.h index 4b5093b40..4c8ecc388 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.h +++ b/src/meshlabplugins/filter_dirt/filter_dirt.h @@ -68,8 +68,8 @@ public: virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); virtual bool applyFilter(QAction * /*filter */, MeshModel &, const RichParameterList & /*parent*/, vcg::CallBackPos *) { assert(0); return false;} ; - virtual int postCondition(QAction*) const; - virtual FilterClass getClass(QAction *); + virtual int postCondition(const QAction*) const; + virtual FilterClass getClass (const QAction *) const; FILTER_ARITY filterArity(QAction*) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.cpp b/src/meshlabplugins/filter_fractal/filter_fractal.cpp index d7c6d8c58..d8f924616 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.cpp +++ b/src/meshlabplugins/filter_fractal/filter_fractal.cpp @@ -338,7 +338,7 @@ bool FilterFractal::applyFilter(QAction* filter, MeshDocument &md, const RichPar return false; } -MeshFilterInterface::FilterClass FilterFractal::getClass(QAction* filter) +MeshFilterInterface::FilterClass FilterFractal::getClass(const QAction* filter) const { switch(ID(filter)) { case CR_FRACTAL_TERRAIN: @@ -368,7 +368,7 @@ int FilterFractal::getRequirements(QAction *filter) return MeshModel::MM_NONE; } -int FilterFractal::postCondition(QAction *filter) const +int FilterFractal::postCondition(const QAction *filter) const { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.h b/src/meshlabplugins/filter_fractal/filter_fractal.h index ea082a418..a47431597 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.h +++ b/src/meshlabplugins/filter_fractal/filter_fractal.h @@ -51,8 +51,8 @@ public: bool applyFilter (QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); - int postCondition(QAction *action) const; - FilterClass getClass(QAction *); + int postCondition(const QAction *action) const; + FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(QAction* act) const; private: void initParameterSetForFractalDisplacement (QAction *, MeshDocument &, RichParameterList &); diff --git a/src/meshlabplugins/filter_func/filter_func.cpp b/src/meshlabplugins/filter_func/filter_func.cpp index 31e2c39be..072da1c1f 100644 --- a/src/meshlabplugins/filter_func/filter_func.cpp +++ b/src/meshlabplugins/filter_func/filter_func.cpp @@ -161,7 +161,7 @@ QString FilterFunctionPlugin::filterInfo(FilterIDType filterId) const return QString("filter not found!"); } -FilterFunctionPlugin::FilterClass FilterFunctionPlugin::getClass(QAction *a) +FilterFunctionPlugin::FilterClass FilterFunctionPlugin::getClass(const QAction *a) const { switch(ID(a)) { @@ -185,7 +185,7 @@ FilterFunctionPlugin::FilterClass FilterFunctionPlugin::getClass(QAction *a) } } -int FilterFunctionPlugin::postCondition(QAction *action) const +int FilterFunctionPlugin::postCondition(const QAction *action) const { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_func/filter_func.h b/src/meshlabplugins/filter_func/filter_func.h index cf84dd702..a57f87af4 100644 --- a/src/meshlabplugins/filter_func/filter_func.h +++ b/src/meshlabplugins/filter_func/filter_func.h @@ -77,8 +77,8 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual FilterClass getClass(QAction *); - virtual int postCondition(QAction *action) const; + virtual FilterClass getClass(const QAction*) const; + virtual int postCondition(const QAction *action) const; virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); virtual int getRequirements(QAction *); virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp index 82a6cae34..3a87ceabb 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp @@ -84,7 +84,7 @@ QString FilterGeodesic::filterInfo(FilterIDType filterId) const return QString("error!"); } -FilterGeodesic::FilterClass FilterGeodesic::getClass(QAction *a) +FilterGeodesic::FilterClass FilterGeodesic::getClass(const QAction *a) const { switch(ID(a)) { @@ -249,7 +249,7 @@ void FilterGeodesic::initParameterSet(QAction *action,MeshModel &m, RichParamete return; } -int FilterGeodesic::postCondition(QAction * filter) const +int FilterGeodesic::postCondition(const QAction * filter) const { switch (ID(filter)) { diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.h b/src/meshlabplugins/filter_geodesic/filter_geodesic.h index 09e1c720a..42a84e27b 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.h +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.h @@ -54,11 +54,11 @@ class FilterGeodesic : public QObject, public MeshFilterInterface QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - FilterClass getClass(QAction *); + FilterClass getClass(const QAction*) const; int getRequirements(QAction *); bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); - int postCondition(QAction * filter) const; + int postCondition(const QAction * filter) const; FILTER_ARITY filterArity(QAction*) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_globalregistration/globalregistration.cpp b/src/meshlabplugins/filter_globalregistration/globalregistration.cpp index 9bfec27f2..41229d2f8 100644 --- a/src/meshlabplugins/filter_globalregistration/globalregistration.cpp +++ b/src/meshlabplugins/filter_globalregistration/globalregistration.cpp @@ -61,7 +61,7 @@ QString GlobalRegistrationPlugin::filterName(FilterIDType filterId) const return QString("Unknown Filter"); } -GlobalRegistrationPlugin::FilterClass GlobalRegistrationPlugin::getClass(QAction *a) +GlobalRegistrationPlugin::FilterClass GlobalRegistrationPlugin::getClass(const QAction *a) const { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_globalregistration/globalregistration.h b/src/meshlabplugins/filter_globalregistration/globalregistration.h index eee8ceb16..b31ffb2df 100644 --- a/src/meshlabplugins/filter_globalregistration/globalregistration.h +++ b/src/meshlabplugins/filter_globalregistration/globalregistration.h @@ -43,8 +43,8 @@ public: QString filterInfo(FilterIDType filter) const; void initParameterSet(QAction *, MeshDocument &/*m*/, RichParameterList & /*parent*/); bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - int postCondition( QAction* ) const {return MeshModel::MM_VERTCOORD; } - FilterClass getClass(QAction *a); + int postCondition(const QAction* ) const {return MeshModel::MM_VERTCOORD; } + FilterClass getClass(const QAction* a) const; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} }; 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 bf74be607..4810cd60f 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 @@ -97,7 +97,7 @@ int FilterImgPatchParamPlugin::getRequirements( QAction *act ) } -MeshFilterInterface::FilterClass FilterImgPatchParamPlugin::getClass( QAction *act ) +MeshFilterInterface::FilterClass FilterImgPatchParamPlugin::getClass(const QAction *act ) const { switch( ID(act) ) { 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 3042dce75..1907f9ffe 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 @@ -103,7 +103,7 @@ public: virtual QString filterName( FilterIDType id ) const; virtual QString filterInfo( FilterIDType id ) const; - virtual FilterClass getClass( QAction *act ); + virtual FilterClass getClass(const QAction* act ) const; virtual void initParameterSet( QAction *act, MeshDocument &md, diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp index 0084abaf6..1235c2ca7 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp @@ -453,12 +453,12 @@ bool FilterIsoParametrization::applyFilter(QAction *filter, MeshDocument& md, co return false; } -MeshFilterInterface::FilterClass FilterIsoParametrization::getClass(QAction *) +MeshFilterInterface::FilterClass FilterIsoParametrization::getClass(const QAction *) const { return MeshFilterInterface::Remeshing; } -int FilterIsoParametrization::postCondition( QAction* /*filter*/ ) const +int FilterIsoParametrization::postCondition(const QAction* /*filter*/ ) const { return MeshModel::MM_WEDGTEXCOORD | MeshModel::MM_VERTTEXCOORD; } diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h index 29696fb34..6416004e4 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h @@ -48,7 +48,7 @@ class FilterIsoParametrization : public QObject, public MeshFilterInterface ~FilterIsoParametrization(); QString pluginName() const; - virtual FilterClass getClass(QAction *); + virtual FilterClass getClass(const QAction*) const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; @@ -56,7 +56,7 @@ class FilterIsoParametrization : public QObject, public MeshFilterInterface virtual void initParameterSet(QAction *,MeshDocument&, RichParameterList & /*parent*/); virtual bool applyFilter(QAction *filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); - int postCondition(QAction* filter) const; + int postCondition(const QAction* filter) const; void PrintStats(CMeshO *mesh); FILTER_ARITY filterArity(QAction*) const; diff --git a/src/meshlabplugins/filter_layer/filter_layer.cpp b/src/meshlabplugins/filter_layer/filter_layer.cpp index 1fa09ee9d..1fd63dd75 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.cpp +++ b/src/meshlabplugins/filter_layer/filter_layer.cpp @@ -836,7 +836,7 @@ bool FilterLayerPlugin::applyFilter(QAction *filter, MeshDocument &md, const Ric return true; } -FilterLayerPlugin::FilterClass FilterLayerPlugin::getClass(QAction *a) +FilterLayerPlugin::FilterClass FilterLayerPlugin::getClass(const QAction *a) const { switch(ID(a)) { @@ -886,7 +886,7 @@ MeshFilterInterface::FILTER_ARITY FilterLayerPlugin::filterArity( QAction* filte return MeshFilterInterface::NONE; } -int FilterLayerPlugin::postCondition(QAction* filter) const +int FilterLayerPlugin::postCondition(const QAction* filter) const { switch (ID(filter)) { diff --git a/src/meshlabplugins/filter_layer/filter_layer.h b/src/meshlabplugins/filter_layer/filter_layer.h index b482ce5a8..1264b2a56 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.h +++ b/src/meshlabplugins/filter_layer/filter_layer.h @@ -58,10 +58,10 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual FilterClass getClass(QAction *); + virtual FilterClass getClass(const QAction*) const; virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - int postCondition(QAction *filter) const; + int postCondition(const QAction *filter) const; FILTER_ARITY filterArity(QAction*) const; }; diff --git a/src/meshlabplugins/filter_measure/filter_measure.cpp b/src/meshlabplugins/filter_measure/filter_measure.cpp index 7e79d6e16..35ff3c131 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.cpp +++ b/src/meshlabplugins/filter_measure/filter_measure.cpp @@ -125,7 +125,7 @@ QString FilterMeasurePlugin::filterName(FilterIDType filterId) const } } -FilterMeasurePlugin::FilterClass FilterMeasurePlugin::getClass(QAction *) +FilterMeasurePlugin::FilterClass FilterMeasurePlugin::getClass(const QAction *) const { return MeshFilterInterface::Measure; } @@ -204,7 +204,7 @@ bool FilterMeasurePlugin::applyFilter(QAction* filter, MeshDocument& md, const R } } -int FilterMeasurePlugin::postCondition(QAction*) const +int FilterMeasurePlugin::postCondition(const QAction*) const { return MeshModel::MM_NONE; } diff --git a/src/meshlabplugins/filter_measure/filter_measure.h b/src/meshlabplugins/filter_measure/filter_measure.h index 78b803f45..493962db7 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.h +++ b/src/meshlabplugins/filter_measure/filter_measure.h @@ -50,12 +50,12 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - FilterClass getClass(QAction*); + FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(QAction*) const; int getPreConditions(QAction *action) const; void initParameterSet(QAction* , MeshModel& m, RichParameterList& parlst); bool applyFilter(QAction* filter, MeshDocument& md, const RichParameterList& parlst, vcg::CallBackPos*) ; - int postCondition( QAction* ) const; + int postCondition(const QAction* ) const; private: bool computeTopologicalMeasures(MeshDocument& md); diff --git a/src/meshlabplugins/filter_meshing/meshfilter.cpp b/src/meshlabplugins/filter_meshing/meshfilter.cpp index 5121e4bc2..a500e4150 100644 --- a/src/meshlabplugins/filter_meshing/meshfilter.cpp +++ b/src/meshlabplugins/filter_meshing/meshfilter.cpp @@ -118,7 +118,7 @@ QString ExtraMeshFilterPlugin::pluginName() const return "FilterMeshing"; } -ExtraMeshFilterPlugin::FilterClass ExtraMeshFilterPlugin::getClass(QAction * a) +ExtraMeshFilterPlugin::FilterClass ExtraMeshFilterPlugin::getClass(const QAction * a) const { switch (ID(a)) { @@ -1762,7 +1762,7 @@ switch(ID(filter)) return true; } -int ExtraMeshFilterPlugin::postCondition(QAction * filter) const +int ExtraMeshFilterPlugin::postCondition(const QAction * filter) const { switch (ID(filter)) { diff --git a/src/meshlabplugins/filter_meshing/meshfilter.h b/src/meshlabplugins/filter_meshing/meshfilter.h index f625f182a..8a6ea95aa 100644 --- a/src/meshlabplugins/filter_meshing/meshfilter.h +++ b/src/meshlabplugins/filter_meshing/meshfilter.h @@ -87,10 +87,10 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - FilterClass getClass(QAction *); + FilterClass getClass(const QAction*) const; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - int postCondition(QAction *filter) const; + int postCondition(const QAction *filter) const; int getPreCondition(QAction *filter) const; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_mls/mlsplugin.cpp b/src/meshlabplugins/filter_mls/mlsplugin.cpp index 5c941e81e..6b0c8e32f 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.cpp +++ b/src/meshlabplugins/filter_mls/mlsplugin.cpp @@ -99,7 +99,7 @@ QString MlsPlugin::pluginName() const return QString("Filter Unknown"); } - MeshFilterInterface::FilterClass MlsPlugin::getClass(QAction *a) + MeshFilterInterface::FilterClass MlsPlugin::getClass(const QAction *a) const { int filterId = ID(a); diff --git a/src/meshlabplugins/filter_mls/mlsplugin.h b/src/meshlabplugins/filter_mls/mlsplugin.h index 819e7830a..2bd0f9f99 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.h +++ b/src/meshlabplugins/filter_mls/mlsplugin.h @@ -65,7 +65,7 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - FilterClass getClass(QAction *a); + FilterClass getClass(const QAction *a) const; virtual void initParameterSet(QAction *,MeshDocument &md, RichParameterList &parent); virtual int getRequirements(QAction *action); virtual bool applyFilter(QAction *filter, MeshDocument &m, const RichParameterList &parent, vcg::CallBackPos *cb) ; diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp index 63f7ec000..d138c3313 100644 --- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp +++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp @@ -84,7 +84,7 @@ QString FilterMutualGlobal::filterName(FilterIDType filterId) const // The FilterClass describes in which generic class of filters it fits. // This choice affect the submenu in which each filter will be placed // More than a single class can be chosen. -FilterMutualGlobal::FilterClass FilterMutualGlobal::getClass(QAction *a) +FilterMutualGlobal::FilterClass FilterMutualGlobal::getClass(const QAction *a) const { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h index 1e1dd863e..664e5506f 100644 --- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h +++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h @@ -56,8 +56,8 @@ public: QString filterInfo(FilterIDType filter) const; void initParameterSet(QAction *,MeshDocument & md, RichParameterList & /*parent*/); bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - int postCondition(QAction*) const { return MeshModel::MM_NONE; }; - FilterClass getClass(QAction *a); + int postCondition(const QAction*) const { return MeshModel::MM_NONE; }; + FilterClass getClass(const QAction* a) const; QString filterScriptFunctionName(FilterIDType filterID); bool preAlignment(MeshDocument &md, const RichParameterList& par, vcg::CallBackPos *cb); std::vector buildGraph(MeshDocument &md, bool globalign=true); diff --git a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp index b91cf543b..03a2c7c2f 100644 --- a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp +++ b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp @@ -69,7 +69,7 @@ QString FilterMutualInfoPlugin::filterInfo(FilterIDType filterId) const } } -FilterMutualInfoPlugin::FilterClass FilterMutualInfoPlugin::getClass(QAction *a) +FilterMutualInfoPlugin::FilterClass FilterMutualInfoPlugin::getClass(const QAction *a) const { switch(ID(a)) { case FP_IMAGE_MUTUALINFO: @@ -127,7 +127,7 @@ bool FilterMutualInfoPlugin::applyFilter(QAction *action, MeshDocument &md, cons } } -int FilterMutualInfoPlugin::postCondition(QAction*) const +int FilterMutualInfoPlugin::postCondition(const QAction*) const { return MeshModel::MM_NONE; } diff --git a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h index d0c28dd14..82f04cbd7 100644 --- a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h +++ b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h @@ -45,11 +45,11 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - FilterClass getClass(QAction *a); + FilterClass getClass(const QAction* a) const; FILTER_ARITY filterArity(QAction *) const; void initParameterSet(QAction *, MeshDocument &, RichParameterList & /*parent*/); bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - int postCondition(QAction*) const; + int postCondition(const QAction*) const; private: AlignSet align; diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.cpp b/src/meshlabplugins/filter_plymc/filter_plymc.cpp index 38a4215b5..1eefbcea5 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.cpp +++ b/src/meshlabplugins/filter_plymc/filter_plymc.cpp @@ -82,7 +82,7 @@ QString PlyMCPlugin::pluginName() const // The FilterClass describes in which generic class of filters it fits. // This choice affect the submenu in which each filter will be placed // More than a single class can be chosen. - PlyMCPlugin::FilterClass PlyMCPlugin::getClass(QAction *a) + PlyMCPlugin::FilterClass PlyMCPlugin::getClass(const QAction *a) const { switch(ID(a)) { @@ -256,7 +256,7 @@ MeshFilterInterface::FILTER_ARITY PlyMCPlugin::filterArity( QAction * filter ) c } } -int PlyMCPlugin::postCondition(QAction * filter) const +int PlyMCPlugin::postCondition(const QAction * filter) const { switch (ID(filter)) { diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.h b/src/meshlabplugins/filter_plymc/filter_plymc.h index c64f94f94..3e56ae694 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.h +++ b/src/meshlabplugins/filter_plymc/filter_plymc.h @@ -45,9 +45,9 @@ public: virtual QString filterInfo(FilterIDType filter) const; virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - FilterClass getClass(QAction *a); + FilterClass getClass(const QAction* a) const; MeshFilterInterface::FILTER_ARITY filterArity(QAction * filter) const; - int postCondition(QAction *filter) const; + int postCondition(const QAction *filter) const; }; #endif diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.cpp b/src/meshlabplugins/filter_qhull/filter_qhull.cpp index b5e51fb74..0ac07de47 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.cpp +++ b/src/meshlabplugins/filter_qhull/filter_qhull.cpp @@ -112,7 +112,7 @@ QString QhullPlugin::pluginName() const // The FilterClass describes in which generic class of filters it fits. // This choice affect the submenu in which each filter will be placed // More than a single class can be chosen. - QhullPlugin::FilterClass QhullPlugin::getClass(QAction *a) + QhullPlugin::FilterClass QhullPlugin::getClass(const QAction *a) const { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.h b/src/meshlabplugins/filter_qhull/filter_qhull.h index 4735cefb2..3dc1c0c7d 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.h +++ b/src/meshlabplugins/filter_qhull/filter_qhull.h @@ -60,7 +60,7 @@ public: virtual QString filterInfo(FilterIDType filter) const; virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(QAction *filter, MeshDocument &m, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - virtual FilterClass getClass(QAction *); + virtual FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp index 1dddc456d..4f31a3a23 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp @@ -69,7 +69,7 @@ QString QualityMapperFilter::pluginName() const return QString(""); } - MeshFilterInterface::FilterClass QualityMapperFilter::getClass(QAction *a) + MeshFilterInterface::FilterClass QualityMapperFilter::getClass(const QAction *a) const { switch(ID(a)) { @@ -191,11 +191,11 @@ int QualityMapperFilter::getPreConditions( QAction * a) const } } -int QualityMapperFilter::postCondition( QAction* a) const +int QualityMapperFilter::postCondition(const QAction* a) const { switch(ID(a)) { - case FP_QUALITY_MAPPER : + case FP_QUALITY_MAPPER : return MeshModel::MM_VERTCOLOR; default : assert(0); diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.h b/src/meshlabplugins/filter_quality/filterqualitymapper.h index 3a05c4a1d..f969179c1 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.h +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.h @@ -73,10 +73,10 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; int getPreConditions(QAction *) const; - int postCondition( QAction* ) const; + int postCondition(const QAction* ) const; virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - virtual FilterClass getClass(QAction *); + virtual FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_sample/filter_sample.cpp b/src/meshlabplugins/filter_sample/filter_sample.cpp index a15f31d5f..0ba71708f 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.cpp +++ b/src/meshlabplugins/filter_sample/filter_sample.cpp @@ -83,7 +83,7 @@ QString FilterSamplePlugin::filterName(FilterIDType filterId) const * @param a: the action of the filter * @return the class od the filter */ -FilterSamplePlugin::FilterClass FilterSamplePlugin::getClass(QAction *a) +FilterSamplePlugin::FilterClass FilterSamplePlugin::getClass(const QAction *a) const { switch(ID(a)) { case FP_MOVE_VERTEX : @@ -116,7 +116,7 @@ int FilterSamplePlugin::getPreConditions(QAction*) const * @brief FilterSamplePlugin::postCondition * @return */ -int FilterSamplePlugin::postCondition(QAction*) const +int FilterSamplePlugin::postCondition(const QAction*) const { return MeshModel::MM_VERTCOORD | MeshModel::MM_FACENORMAL | MeshModel::MM_VERTNORMAL; } diff --git a/src/meshlabplugins/filter_sample/filter_sample.h b/src/meshlabplugins/filter_sample/filter_sample.h index 930c4390b..91bc4bc8e 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.h +++ b/src/meshlabplugins/filter_sample/filter_sample.h @@ -56,10 +56,10 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - FilterClass getClass(QAction *a); + FilterClass getClass(const QAction* a) const; FILTER_ARITY filterArity(QAction *) const; int getPreConditions(QAction *) const; - int postCondition( QAction* ) const; + int postCondition(const QAction* ) const; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(QAction *action, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); diff --git a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp index 0ee8157f0..dfb49506c 100644 --- a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp +++ b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp @@ -72,7 +72,7 @@ QString ExtraSampleDynPlugin::filterName(FilterIDType filterId) const // The FilterClass describes in which generic class of filters it fits. // This choice affect the submenu in which each filter will be placed // In this case this sample belong to the class of filters that change the vertex colors - MeshFilterInterface::FilterClass ExtraSampleDynPlugin::getClass(QAction *) { return MeshFilterInterface::VertexColoring; } + MeshFilterInterface::FilterClass ExtraSampleDynPlugin::getClass(const QAction *) const { return MeshFilterInterface::VertexColoring; } // This function define the needed parameters for each filter. Return true if the filter has some parameters // it is called every time, so you can set the default value of parameters according to the mesh diff --git a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h index 10d68d98e..4a881fda4 100644 --- a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h +++ b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h @@ -43,9 +43,9 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); - virtual int postCondition( QAction* ) const {return MeshModel::MM_VERTCOLOR;}; + virtual int postCondition(const QAction* ) const {return MeshModel::MM_VERTCOLOR;}; virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - virtual FilterClass getClass(QAction *); + virtual FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp index e65ae1ec1..0d0df867c 100644 --- a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp +++ b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp @@ -70,7 +70,7 @@ QString ExtraSampleGPUPlugin::filterName(FilterIDType filterId) const // The FilterClass describes in which generic class of filters it fits. // This choice affect the submenu in which each filter will be placed // More than a single class can be chosen. -ExtraSampleGPUPlugin::FilterClass ExtraSampleGPUPlugin::getClass(QAction *a) +ExtraSampleGPUPlugin::FilterClass ExtraSampleGPUPlugin::getClass(const QAction *a) const { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h index d162d4cde..86cb6095d 100644 --- a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h +++ b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h @@ -56,7 +56,7 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - FilterClass getClass(QAction *a); + FilterClass getClass(const QAction* a) const; }; diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.cpp b/src/meshlabplugins/filter_sampling/filter_sampling.cpp index ed120f436..b447fce2c 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.cpp +++ b/src/meshlabplugins/filter_sampling/filter_sampling.cpp @@ -1356,7 +1356,7 @@ switch(ID(action)) return true; } -MeshFilterInterface::FilterClass FilterDocSampling::getClass(QAction *action) +MeshFilterInterface::FilterClass FilterDocSampling::getClass(const QAction *action) const { switch(ID(action)) { @@ -1378,7 +1378,7 @@ MeshFilterInterface::FilterClass FilterDocSampling::getClass(QAction *action) } return FilterClass(0); } -int FilterDocSampling::postCondition( QAction* a ) const +int FilterDocSampling::postCondition(const QAction* a ) const { switch(ID(a)){ case FP_VORONOI_COLORING : diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.h b/src/meshlabplugins/filter_sampling/filter_sampling.h index 399194808..b196e2a98 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.h +++ b/src/meshlabplugins/filter_sampling/filter_sampling.h @@ -57,8 +57,8 @@ class FilterDocSampling : public QObject, public MeshFilterInterface void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); bool applyFilter(QAction *filter, MeshDocument &m, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int getRequirements(QAction *action); - int postCondition( QAction* ) const; - FilterClass getClass(QAction *); + int postCondition(const QAction* ) const; + FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(QAction * filter) const; }; diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp index 0063ea1cc..54807e5d0 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp @@ -77,7 +77,7 @@ QString FilterScreenedPoissonPlugin::filterInfo(FilterIDType filter) const } } -MeshFilterInterface::FilterClass FilterScreenedPoissonPlugin::getClass(QAction* a) +MeshFilterInterface::FilterClass FilterScreenedPoissonPlugin::getClass(const QAction* a) const { if (ID(a) == FP_SCREENED_POISSON){ return FilterScreenedPoissonPlugin::FilterClass(MeshFilterInterface::Remeshing); @@ -212,7 +212,7 @@ void FilterScreenedPoissonPlugin::initParameterSet( } } -int FilterScreenedPoissonPlugin::postCondition(QAction* filter) const +int FilterScreenedPoissonPlugin::postCondition(const QAction* filter) const { if (ID(filter) == FP_SCREENED_POISSON){ return MeshModel::MM_VERTNUMBER + MeshModel::MM_FACENUMBER; diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h index 374a23aaf..6c9520d1e 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h @@ -44,7 +44,7 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - FilterClass getClass(QAction* a); + FilterClass getClass(const QAction* a) const; int getRequirements(QAction* a); bool applyFilter( @@ -54,7 +54,7 @@ public: vcg::CallBackPos* cb) ; void initParameterSet(QAction* a, MeshModel&, RichParameterList& parlist); - int postCondition(QAction* filter) const; + int postCondition(const QAction* filter) const; FILTER_ARITY filterArity(QAction*) const; }; diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h index 17be5e04c..32d402f0c 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h @@ -29,7 +29,7 @@ public: QString filterInfo(FilterIDType filterId) const; - FilterClass getClass(QAction *) + FilterClass getClass(const QAction *) const { return MeshFilterInterface::VertexColoring; } diff --git a/src/meshlabplugins/filter_sdfgpu/filterinterface.h b/src/meshlabplugins/filter_sdfgpu/filterinterface.h index 4b1e2eeb0..46a5c20e6 100644 --- a/src/meshlabplugins/filter_sdfgpu/filterinterface.h +++ b/src/meshlabplugins/filter_sdfgpu/filterinterface.h @@ -79,7 +79,7 @@ public: * by meshlab to determine in which filter sub-menu-entry insert this filter. The default value adds the * plugin to the bottom of the list. */ - virtual FilterClass getClass(){ + virtual FilterClass getClass() const{ return MeshFilterInterface::Generic; } @@ -139,7 +139,7 @@ private: QString filterInfo(FilterIDType ) const{ return filterInfo(); } - FilterClass getClass(QAction *){ + FilterClass getClass(const QAction *) const{ return getClass(); } // NOTE: Paolo informed that this will be killed sooner or later. @@ -150,7 +150,7 @@ private: int getPreConditions(QAction* ) const{ return getPreConditions(); } - int postCondition() const{ + int postCondition(const QAction*) const{ return MeshModel::MM_NONE; } bool applyFilter(QAction *, MeshDocument &md, const RichParameterList& par, vcg::CallBackPos * cb){ diff --git a/src/meshlabplugins/filter_select/meshselect.cpp b/src/meshlabplugins/filter_select/meshselect.cpp index 03419da69..c1190d11a 100644 --- a/src/meshlabplugins/filter_select/meshselect.cpp +++ b/src/meshlabplugins/filter_select/meshselect.cpp @@ -649,7 +649,7 @@ bool SelectionFilterPlugin::applyFilter(QAction *action, MeshDocument &md, const return true; } -MeshFilterInterface::FilterClass SelectionFilterPlugin::getClass(QAction *action) +MeshFilterInterface::FilterClass SelectionFilterPlugin::getClass(const QAction *action) const { switch(ID(action)) { @@ -703,7 +703,7 @@ MeshFilterInterface::FilterClass SelectionFilterPlugin::getClass(QAction *action } } -int SelectionFilterPlugin::postCondition(QAction *action) const +int SelectionFilterPlugin::postCondition(const QAction *action) const { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_select/meshselect.h b/src/meshlabplugins/filter_select/meshselect.h index db6c78157..ada4af3d5 100644 --- a/src/meshlabplugins/filter_select/meshselect.h +++ b/src/meshlabplugins/filter_select/meshselect.h @@ -73,10 +73,10 @@ class SelectionFilterPlugin : public QObject, public MeshFilterInterface virtual QString filterInfo(FilterIDType filter) const; virtual QString filterName(FilterIDType filter) const; - virtual FilterClass getClass(QAction *); + virtual FilterClass getClass(const QAction*) const; void initParameterSet(QAction *action, MeshModel &m, RichParameterList &parlst); int getPreConditions(QAction *) const; - int postCondition( QAction* ) const; + int postCondition(const QAction* ) const; int getRequirements(QAction *); bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp index c74a2a639..c4e31dc85 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp @@ -64,7 +64,7 @@ QString FilterSketchFabPlugin::filterInfo(FilterIDType filterId) const } } -FilterSketchFabPlugin::FilterClass FilterSketchFabPlugin::getClass(QAction *a) +FilterSketchFabPlugin::FilterClass FilterSketchFabPlugin::getClass(const QAction *a) const { switch(ID(a)) { case FP_SKETCHFAB : @@ -90,7 +90,7 @@ int FilterSketchFabPlugin::getPreConditions(QAction*) const return MeshModel::MM_NONE; } -int FilterSketchFabPlugin::postCondition(QAction*) const +int FilterSketchFabPlugin::postCondition(const QAction*) const { return MeshModel::MM_NONE; } diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h index 93e01e1e5..36737ae2c 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h @@ -41,10 +41,10 @@ public: QString pluginName() const; QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - FilterClass getClass(QAction *a); + FilterClass getClass(const QAction* a) const; FILTER_ARITY filterArity(QAction *a) const; int getPreConditions(QAction *) const; - int postCondition( QAction* ) const; + int postCondition(const QAction* ) const; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp index 81f212a88..345c783e1 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp @@ -148,12 +148,12 @@ QString FilterSSynth::ssynth(QString grammar,int maxdepth,int seed,CallBackPos * return path; } -int FilterSSynth::postCondition(QAction* /*filter*/) const +int FilterSSynth::postCondition(const QAction* /*filter*/) const { return MeshModel::MM_NONE; } -MeshFilterInterface::FilterClass FilterSSynth::getClass(QAction */*filter*/) +MeshFilterInterface::FilterClass FilterSSynth::getClass(const QAction */*filter*/) const { return MeshFilterInterface::MeshCreation; } diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.h b/src/meshlabplugins/filter_ssynth/filter_ssynth.h index 821680f58..d9cf2e947 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.h +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.h @@ -47,10 +47,10 @@ public: virtual void initParameterSet(QAction* /*filter*/,MeshModel &,RichParameterList &){}; virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); - virtual FilterClass getClass(QAction* filter); + virtual FilterClass getClass(const QAction* filter) const; void setAttributes(CMeshO::VertexIterator &vi, CMeshO &m); static void openX3D(const QString &fileName, MeshModel &m, int& mask, vcg::CallBackPos *cb, QWidget *parent=0); - virtual int postCondition(QAction* filter) const; + virtual int postCondition(const QAction* filter) const; QList importFormats() const; QList exportFormats() const; diff --git a/src/meshlabplugins/filter_texture/filter_texture.cpp b/src/meshlabplugins/filter_texture/filter_texture.cpp index f0a6de780..360add8a4 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.cpp +++ b/src/meshlabplugins/filter_texture/filter_texture.cpp @@ -133,7 +133,7 @@ int FilterTexturePlugin::getRequirements(QAction *a) return MeshModel::MM_NONE; } -int FilterTexturePlugin::postCondition( QAction *a) const +int FilterTexturePlugin::postCondition(const QAction *a) const { switch (ID(a)) { @@ -154,7 +154,7 @@ int FilterTexturePlugin::postCondition( QAction *a) const // The FilterClass describes in which generic class of filters it fits. // This choice affect the submenu in which each filter will be placed // More than a single class can be chosen. -FilterTexturePlugin::FilterClass FilterTexturePlugin::getClass(QAction *a) +FilterTexturePlugin::FilterClass FilterTexturePlugin::getClass(const QAction *a) const { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_texture/filter_texture.h b/src/meshlabplugins/filter_texture/filter_texture.h index 87a236878..bd9056c45 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.h +++ b/src/meshlabplugins/filter_texture/filter_texture.h @@ -62,8 +62,8 @@ public: virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); virtual int getRequirements(QAction *); virtual int getPreConditions(QAction *) const; - virtual int postCondition( QAction* ) const; - FilterClass getClass(QAction *a); + virtual int postCondition(const QAction* ) const; + FilterClass getClass(const QAction *a) const; FILTER_ARITY filterArity(QAction * filter) const; }; diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp index 13d723cae..b32906e97 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp @@ -181,7 +181,7 @@ QString TriOptimizePlugin::pluginName() const return MeshFilterInterface::Generic; } -int TriOptimizePlugin::postCondition(QAction *a) const +int TriOptimizePlugin::postCondition(const QAction *a) const { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h index 64c4abbed..6cff6c141 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h @@ -51,7 +51,7 @@ public: bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList &/*parent*/, vcg::CallBackPos * cb) ; int getRequirements(QAction *); FilterClass getClass(QAction *); - int postCondition( QAction* ) const; + int postCondition(const QAction* ) const; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp index 2812e2493..f562ef174 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp @@ -181,7 +181,7 @@ QString FilterUnsharp::filterInfo(FilterIDType filterId) const return QString("Error on FilterUnsharp::filterInfo()!"); } - FilterUnsharp::FilterClass FilterUnsharp::getClass(QAction *a) + FilterUnsharp::FilterClass FilterUnsharp::getClass(const QAction *a) const { switch(ID(a)) { @@ -251,7 +251,7 @@ int FilterUnsharp::getPreConditions(QAction *a) const } -int FilterUnsharp::postCondition(QAction *a) const +int FilterUnsharp::postCondition(const QAction *a) const { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.h b/src/meshlabplugins/filter_unsharp/filter_unsharp.h index bcd11c853..f0a0e90fb 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.h +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.h @@ -70,11 +70,11 @@ class FilterUnsharp : public QObject, public MeshFilterInterface QString pluginName() const; QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - FilterClass getClass(QAction *); + FilterClass getClass(const QAction*) const; int getRequirements(QAction *); bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; void initParameterSet(QAction *action, MeshDocument &/*m*/, RichParameterList & parlst); - int postCondition( QAction* ) const; + int postCondition(const QAction* ) const; int getPreConditions(QAction *) const; FILTER_ARITY filterArity(QAction * filter) const; diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp index 2587580fc..14e172603 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp @@ -253,7 +253,7 @@ bool FilterVoronoiPlugin::applyFilter(QAction * action, MeshDocument &md, const } } -int FilterVoronoiPlugin::postCondition(QAction* action) const +int FilterVoronoiPlugin::postCondition(const QAction* action) const { switch(ID(action)) { case VORONOI_SAMPLING : diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.h b/src/meshlabplugins/filter_voronoi/filter_voronoi.h index 844f64502..be21e78f4 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.h +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.h @@ -52,7 +52,7 @@ public: void initParameterSet(QAction* action, MeshModel& m, RichParameterList& par); int getPreConditions(QAction* action) const; bool applyFilter(QAction* action, MeshDocument& md, const RichParameterList& par, vcg::CallBackPos* cb) ; - int postCondition(QAction* ) const; + int postCondition(const QAction* ) const; private: bool voronoiSampling( From 445eb19cf8eb2f043e32e650df12fe9b95cd07fe Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 17 Sep 2020 14:08:51 +0200 Subject: [PATCH 20/49] applyFilter const correctness --- src/common/interfaces.h | 2 +- src/meshlabplugins/filter_ao/filter_ao.cpp | 2 +- src/meshlabplugins/filter_ao/filter_ao.h | 2 +- src/meshlabplugins/filter_camera/filter_camera.cpp | 2 +- src/meshlabplugins/filter_camera/filter_camera.h | 2 +- src/meshlabplugins/filter_clean/cleanfilter.cpp | 2 +- src/meshlabplugins/filter_clean/cleanfilter.h | 2 +- .../filter_color_projection/filter_color_projection.cpp | 2 +- .../filter_color_projection/filter_color_projection.h | 2 +- src/meshlabplugins/filter_colorproc/filter_colorproc.cpp | 2 +- src/meshlabplugins/filter_colorproc/filter_colorproc.h | 2 +- src/meshlabplugins/filter_create/filter_create.cpp | 2 +- src/meshlabplugins/filter_create/filter_create.h | 2 +- src/meshlabplugins/filter_createiso/filter_createiso.cpp | 2 +- src/meshlabplugins/filter_createiso/filter_createiso.h | 2 +- src/meshlabplugins/filter_csg/filter_csg.cpp | 2 +- src/meshlabplugins/filter_csg/filter_csg.h | 4 ++-- src/meshlabplugins/filter_dirt/filter_dirt.cpp | 2 +- src/meshlabplugins/filter_dirt/filter_dirt.h | 4 ++-- src/meshlabplugins/filter_fractal/filter_fractal.cpp | 2 +- src/meshlabplugins/filter_fractal/filter_fractal.h | 2 +- src/meshlabplugins/filter_func/filter_func.cpp | 2 +- src/meshlabplugins/filter_func/filter_func.h | 2 +- src/meshlabplugins/filter_geodesic/filter_geodesic.cpp | 2 +- src/meshlabplugins/filter_geodesic/filter_geodesic.h | 2 +- .../filter_globalregistration/globalregistration.cpp | 2 +- .../filter_globalregistration/globalregistration.h | 2 +- .../filter_img_patch_param/filter_img_patch_param.cpp | 2 +- .../filter_img_patch_param/filter_img_patch_param.h | 2 +- .../filter_isoparametrization/filter_isoparametrization.cpp | 2 +- .../filter_isoparametrization/filter_isoparametrization.h | 2 +- src/meshlabplugins/filter_layer/filter_layer.cpp | 2 +- src/meshlabplugins/filter_layer/filter_layer.h | 2 +- src/meshlabplugins/filter_measure/filter_measure.cpp | 2 +- src/meshlabplugins/filter_measure/filter_measure.h | 2 +- src/meshlabplugins/filter_meshing/meshfilter.cpp | 2 +- src/meshlabplugins/filter_meshing/meshfilter.h | 2 +- src/meshlabplugins/filter_mls/mlsplugin.cpp | 2 +- src/meshlabplugins/filter_mls/mlsplugin.h | 2 +- .../filter_mutualglobal/filter_mutualglobal.cpp | 2 +- src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h | 2 +- src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp | 2 +- src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h | 2 +- src/meshlabplugins/filter_plymc/filter_plymc.cpp | 2 +- src/meshlabplugins/filter_plymc/filter_plymc.h | 2 +- src/meshlabplugins/filter_qhull/filter_qhull.cpp | 2 +- src/meshlabplugins/filter_qhull/filter_qhull.h | 2 +- src/meshlabplugins/filter_quality/filterqualitymapper.cpp | 2 +- src/meshlabplugins/filter_quality/filterqualitymapper.h | 2 +- src/meshlabplugins/filter_sample/filter_sample.cpp | 2 +- src/meshlabplugins/filter_sample/filter_sample.h | 2 +- src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp | 2 +- src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h | 2 +- src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp | 2 +- src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h | 2 +- src/meshlabplugins/filter_sampling/filter_sampling.cpp | 2 +- src/meshlabplugins/filter_sampling/filter_sampling.h | 2 +- .../filter_screened_poisson/filter_screened_poisson.cpp | 2 +- .../filter_screened_poisson/filter_screened_poisson.h | 3 +-- src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp | 2 +- src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h | 2 +- src/meshlabplugins/filter_sdfgpu/filterinterface.h | 2 +- src/meshlabplugins/filter_select/meshselect.cpp | 2 +- src/meshlabplugins/filter_select/meshselect.h | 2 +- src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp | 2 +- src/meshlabplugins/filter_sketchfab/filter_sketchfab.h | 2 +- src/meshlabplugins/filter_ssynth/filter_ssynth.cpp | 2 +- src/meshlabplugins/filter_ssynth/filter_ssynth.h | 2 +- src/meshlabplugins/filter_texture/filter_texture.cpp | 2 +- src/meshlabplugins/filter_texture/filter_texture.h | 2 +- src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp | 4 ++-- src/meshlabplugins/filter_trioptimize/filter_trioptimize.h | 4 ++-- src/meshlabplugins/filter_unsharp/filter_unsharp.cpp | 2 +- src/meshlabplugins/filter_unsharp/filter_unsharp.h | 2 +- src/meshlabplugins/filter_voronoi/filter_voronoi.cpp | 4 ++-- src/meshlabplugins/filter_voronoi/filter_voronoi.h | 4 ++-- 76 files changed, 82 insertions(+), 83 deletions(-) diff --git a/src/common/interfaces.h b/src/common/interfaces.h index ba18a5178..c843510ca 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -381,7 +381,7 @@ public: * \sa errorMsg * \sa initParameterSet */ - virtual bool applyFilter(QAction * filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) = 0; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) = 0; /** \brief tests if a filter is applicable to a mesh. This function is a handy wrapper used by the framework for the \a getPreConditions callback; diff --git a/src/meshlabplugins/filter_ao/filter_ao.cpp b/src/meshlabplugins/filter_ao/filter_ao.cpp index 1253b34b5..c359a21d4 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.cpp +++ b/src/meshlabplugins/filter_ao/filter_ao.cpp @@ -130,7 +130,7 @@ void AmbientOcclusionPlugin::initParameterSet(QAction *action, MeshModel & /*m*/ default: break; // do not add any parameter for the other filters } } -bool AmbientOcclusionPlugin::applyFilter(QAction * /*filter*/, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool AmbientOcclusionPlugin::applyFilter(const QAction * /*filter*/, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) { MeshModel &m=*(md.mm()); diff --git a/src/meshlabplugins/filter_ao/filter_ao.h b/src/meshlabplugins/filter_ao/filter_ao.h index 808d5f447..e3e7bbae2 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.h +++ b/src/meshlabplugins/filter_ao/filter_ao.h @@ -76,7 +76,7 @@ public: FilterClass getClass(const QAction* filter) const; void initParameterSet(QAction *,MeshModel &/*m*/,RichParameterList & /*parent*/); - bool applyFilter(QAction *filter,MeshDocument &md,const RichParameterList & /*parent*/,vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; void initTextures(void); void initGL(vcg::CallBackPos *cb,unsigned int numVertices); bool processGL(MeshModel &m, std::vector &posVect); diff --git a/src/meshlabplugins/filter_camera/filter_camera.cpp b/src/meshlabplugins/filter_camera/filter_camera.cpp index f17c5250f..073999287 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.cpp +++ b/src/meshlabplugins/filter_camera/filter_camera.cpp @@ -184,7 +184,7 @@ void FilterCameraPlugin::initParameterSet(QAction *action, MeshDocument &/*m*/, } // Core Function doing the actual mesh processing. -bool FilterCameraPlugin::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * /*cb*/) +bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * /*cb*/) { MeshModel* mesh = md.mm(); CMeshO* cm = NULL; diff --git a/src/meshlabplugins/filter_camera/filter_camera.h b/src/meshlabplugins/filter_camera/filter_camera.h index 1f5b4fa3c..d6e91d836 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.h +++ b/src/meshlabplugins/filter_camera/filter_camera.h @@ -52,7 +52,7 @@ public: virtual QString filterInfo(FilterIDType filter) const; virtual FilterClass getClass(const QAction*) const; virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(QAction* act) const; }; diff --git a/src/meshlabplugins/filter_clean/cleanfilter.cpp b/src/meshlabplugins/filter_clean/cleanfilter.cpp index 787021411..f15c557d4 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.cpp +++ b/src/meshlabplugins/filter_clean/cleanfilter.cpp @@ -269,7 +269,7 @@ void CleanFilter::initParameterSet(QAction *action,MeshDocument &md, RichParamet } } -bool CleanFilter::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * cb) +bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * cb) { MeshModel &m=*(md.mm()); switch(ID(filter)) diff --git a/src/meshlabplugins/filter_clean/cleanfilter.h b/src/meshlabplugins/filter_clean/cleanfilter.h index fff19b728..f58511617 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.h +++ b/src/meshlabplugins/filter_clean/cleanfilter.h @@ -72,7 +72,7 @@ public: int postCondition(const QAction* ) const; int getPreConditions(QAction *) const { return MeshModel::MM_NONE; } virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp index d0a48afde..fa4296586 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp @@ -218,7 +218,7 @@ void FilterColorProjectionPlugin::initParameterSet(QAction *action, MeshDocument } // Core Function doing the actual mesh processing. -bool FilterColorProjectionPlugin::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterColorProjectionPlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) { //CMeshO::FaceIterator fi; CMeshO::VertexIterator vi; diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.h b/src/meshlabplugins/filter_color_projection/filter_color_projection.h index ce45a658b..3b9e310eb 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.h +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.h @@ -46,7 +46,7 @@ public: virtual FilterClass getClass(const QAction*) const; virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual int getRequirements(QAction *); - virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); + virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp index cbcce9742..c1d004c49 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp @@ -368,7 +368,7 @@ void FilterColorProc::initParameterSet(QAction *a, MeshDocument& md, RichParamet } } -bool FilterColorProc::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList &par, vcg::CallBackPos *cb) +bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList &par, vcg::CallBackPos *cb) { MeshModel *m = md.mm(); //get current mesh from document diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.h b/src/meshlabplugins/filter_colorproc/filter_colorproc.h index 779be78f6..5f55f9bbb 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.h +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.h @@ -75,7 +75,7 @@ public: virtual int getRequirements(QAction *); virtual void initParameterSet(QAction *,MeshDocument&, RichParameterList & /*parent*/); - virtual bool applyFilter(QAction *filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); + virtual bool applyFilter(const QAction* filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); int postCondition(const QAction* filter) const; int getPreConditions(QAction *) const; FILTER_ARITY filterArity(QAction *act) const; diff --git a/src/meshlabplugins/filter_create/filter_create.cpp b/src/meshlabplugins/filter_create/filter_create.cpp index af6c6b575..f78584406 100644 --- a/src/meshlabplugins/filter_create/filter_create.cpp +++ b/src/meshlabplugins/filter_create/filter_create.cpp @@ -167,7 +167,7 @@ void FilterCreate::initParameterSet(QAction *action, MeshModel & /*m*/, RichPara } // The Real Core Function doing the actual mesh processing. -bool FilterCreate::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, CallBackPos * /*cb*/) +bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, CallBackPos * /*cb*/) { MeshModel *currM = md.mm(); MeshModel *m = nullptr; diff --git a/src/meshlabplugins/filter_create/filter_create.h b/src/meshlabplugins/filter_create/filter_create.h index 3c3d8d8c4..4e0d78f76 100644 --- a/src/meshlabplugins/filter_create/filter_create.h +++ b/src/meshlabplugins/filter_create/filter_create.h @@ -54,7 +54,7 @@ class FilterCreate : public QObject, public MeshFilterInterface QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction*) const; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; QString filterScriptFunctionName(FilterIDType filterID); FILTER_ARITY filterArity(QAction *) const {return NONE;} }; diff --git a/src/meshlabplugins/filter_createiso/filter_createiso.cpp b/src/meshlabplugins/filter_createiso/filter_createiso.cpp index 4c965e393..4c58bcd31 100644 --- a/src/meshlabplugins/filter_createiso/filter_createiso.cpp +++ b/src/meshlabplugins/filter_createiso/filter_createiso.cpp @@ -98,7 +98,7 @@ QString FilterCreateIso::pluginName() const return 0; } - bool FilterCreateIso::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * cb) + bool FilterCreateIso::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * cb) { md.addNewMesh("",this->filterName(ID(filter))); MeshModel &m=*(md.mm()); diff --git a/src/meshlabplugins/filter_createiso/filter_createiso.h b/src/meshlabplugins/filter_createiso/filter_createiso.h index eb82900d7..32d0cd71f 100644 --- a/src/meshlabplugins/filter_createiso/filter_createiso.h +++ b/src/meshlabplugins/filter_createiso/filter_createiso.h @@ -63,7 +63,7 @@ public: virtual int getRequirements(QAction *); virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(QAction*) const {return NONE;} }; diff --git a/src/meshlabplugins/filter_csg/filter_csg.cpp b/src/meshlabplugins/filter_csg/filter_csg.cpp index 974c676e9..2654800c2 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.cpp +++ b/src/meshlabplugins/filter_csg/filter_csg.cpp @@ -116,7 +116,7 @@ void FilterCSG::initParameterSet(QAction *action, MeshDocument & md, RichParamet } } -bool FilterCSG::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterCSG::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) { switch(ID(filter)) { case FP_CSG: diff --git a/src/meshlabplugins/filter_csg/filter_csg.h b/src/meshlabplugins/filter_csg/filter_csg.h index 29139655f..a926e3cff 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.h +++ b/src/meshlabplugins/filter_csg/filter_csg.h @@ -62,8 +62,8 @@ public: virtual void initParameterSet(QAction *, MeshDocument &, RichParameterList &); virtual void initParameterSet(QAction *, MeshModel &, RichParameterList &) { assert(0); } - virtual bool applyFilter(QAction *, MeshDocument &, const RichParameterList &, vcg::CallBackPos *); - virtual bool applyFilter(QAction *, MeshModel &, const RichParameterList &, vcg::CallBackPos *) { assert(0); return false; } + virtual bool applyFilter(const QAction*, MeshDocument &, const RichParameterList &, vcg::CallBackPos *); + virtual bool applyFilter(const QAction *, MeshModel &, const RichParameterList &, vcg::CallBackPos *) { assert(0); return false; } virtual FilterClass getClass(const QAction *) const { return MeshFilterInterface::FilterClass( MeshFilterInterface::Layer + MeshFilterInterface::Remeshing ); } FILTER_ARITY filterArity(QAction*) const {return FIXED;} diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.cpp b/src/meshlabplugins/filter_dirt/filter_dirt.cpp index 6b32021e2..f76d797d8 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.cpp +++ b/src/meshlabplugins/filter_dirt/filter_dirt.cpp @@ -133,7 +133,7 @@ int FilterDirt::getRequirements(QAction * /*action*/) return MeshModel::MM_FACEFACETOPO | MeshModel::MM_VERTCOLOR |MeshModel::MM_FACECOLOR; } -bool FilterDirt::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList &par, vcg::CallBackPos *cb){ +bool FilterDirt::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList &par, vcg::CallBackPos *cb){ switch(ID(filter)){ diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.h b/src/meshlabplugins/filter_dirt/filter_dirt.h index 4c8ecc388..68fd46d38 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.h +++ b/src/meshlabplugins/filter_dirt/filter_dirt.h @@ -66,8 +66,8 @@ public: virtual bool autoDialog(QAction *) {return true;} // virtual void initParameterSet(QAction* filter,MeshModel &,RichParameterSet &){}; virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); - virtual bool applyFilter(QAction * /*filter */, MeshModel &, const RichParameterList & /*parent*/, vcg::CallBackPos *) { assert(0); return false;} ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); + virtual bool applyFilter(const QAction * /*filter */, MeshModel &, const RichParameterList & /*parent*/, vcg::CallBackPos *) { assert(0); return false;} ; virtual int postCondition(const QAction*) const; virtual FilterClass getClass (const QAction *) const; FILTER_ARITY filterArity(QAction*) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.cpp b/src/meshlabplugins/filter_fractal/filter_fractal.cpp index d8f924616..0042b42d2 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.cpp +++ b/src/meshlabplugins/filter_fractal/filter_fractal.cpp @@ -255,7 +255,7 @@ void FilterFractal::initParameterSetForCratersGeneration(MeshDocument &md, RichP return; } -bool FilterFractal::applyFilter(QAction* filter, MeshDocument &md, const RichParameterList &par, vcg::CallBackPos* cb) +bool FilterFractal::applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList &par, vcg::CallBackPos* cb) { if(this->getClass(filter) == MeshFilterInterface::MeshCreation) md.addNewMesh("",this->filterName(ID(filter))); diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.h b/src/meshlabplugins/filter_fractal/filter_fractal.h index a47431597..bca8fcd6d 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.h +++ b/src/meshlabplugins/filter_fractal/filter_fractal.h @@ -49,7 +49,7 @@ public: void initParameterSet(QAction*, MeshModel&, RichParameterList &){assert(0);} void initParameterSet(QAction *, MeshDocument &, RichParameterList &); - bool applyFilter (QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); + bool applyFilter (const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); int postCondition(const QAction *action) const; FilterClass getClass(const QAction*) const; diff --git a/src/meshlabplugins/filter_func/filter_func.cpp b/src/meshlabplugins/filter_func/filter_func.cpp index 072da1c1f..868b8662d 100644 --- a/src/meshlabplugins/filter_func/filter_func.cpp +++ b/src/meshlabplugins/filter_func/filter_func.cpp @@ -373,7 +373,7 @@ void FilterFunctionPlugin::initParameterSet(QAction *action,MeshModel &m, RichPa } // The Real Core Function doing the actual mesh processing. -bool FilterFunctionPlugin::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) { if(this->getClass(filter) == MeshFilterInterface::MeshCreation) md.addNewMesh("",this->filterName(ID(filter))); diff --git a/src/meshlabplugins/filter_func/filter_func.h b/src/meshlabplugins/filter_func/filter_func.h index a57f87af4..97eb31fbf 100644 --- a/src/meshlabplugins/filter_func/filter_func.h +++ b/src/meshlabplugins/filter_func/filter_func.h @@ -81,7 +81,7 @@ public: virtual int postCondition(const QAction *action) const; virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); virtual int getRequirements(QAction *); - virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(QAction* filter) const; diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp index 3a87ceabb..6c21ee211 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp @@ -108,7 +108,7 @@ int FilterGeodesic::getRequirements(QAction *action) return 0; } -bool FilterGeodesic::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * /*cb*/) +bool FilterGeodesic::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * /*cb*/) { MeshModel &m=*(md.mm()); CMeshO::FaceIterator fi; diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.h b/src/meshlabplugins/filter_geodesic/filter_geodesic.h index 42a84e27b..182d64710 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.h +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.h @@ -56,7 +56,7 @@ class FilterGeodesic : public QObject, public MeshFilterInterface FilterClass getClass(const QAction*) const; int getRequirements(QAction *); - bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); int postCondition(const QAction * filter) const; FILTER_ARITY filterArity(QAction*) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_globalregistration/globalregistration.cpp b/src/meshlabplugins/filter_globalregistration/globalregistration.cpp index 41229d2f8..eadee470e 100644 --- a/src/meshlabplugins/filter_globalregistration/globalregistration.cpp +++ b/src/meshlabplugins/filter_globalregistration/globalregistration.cpp @@ -166,7 +166,7 @@ float align ( CMeshO* refMesh, CMeshO* trgMesh, // The Real Core Function doing the actual mesh processing. // Move Vertex of a random quantity -bool GlobalRegistrationPlugin::applyFilter(QAction */*filter*/, +bool GlobalRegistrationPlugin::applyFilter(const QAction */*filter*/, MeshDocument &/*md*/, const RichParameterList & par, vcg::CallBackPos */*cb*/) diff --git a/src/meshlabplugins/filter_globalregistration/globalregistration.h b/src/meshlabplugins/filter_globalregistration/globalregistration.h index b31ffb2df..e476b9f8d 100644 --- a/src/meshlabplugins/filter_globalregistration/globalregistration.h +++ b/src/meshlabplugins/filter_globalregistration/globalregistration.h @@ -42,7 +42,7 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; void initParameterSet(QAction *, MeshDocument &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction* ) const {return MeshModel::MM_VERTCOORD; } FilterClass getClass(const QAction* a) const; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} 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 4810cd60f..460522b20 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 @@ -191,7 +191,7 @@ void FilterImgPatchParamPlugin::initParameterSet( QAction *act, } -bool FilterImgPatchParamPlugin::applyFilter( QAction *act, +bool FilterImgPatchParamPlugin::applyFilter(const QAction *act, MeshDocument &md, const RichParameterList &par, vcg::CallBackPos * /*cb*/ ) 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 1907f9ffe..3c620248d 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 @@ -112,7 +112,7 @@ public: virtual int getRequirements( QAction *act ); //virtual int postCondition( QAction *act ) const; - virtual bool applyFilter( QAction *act, + virtual bool applyFilter(const QAction* act, MeshDocument &md, const RichParameterList &par, vcg::CallBackPos *cb ); diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp index 1235c2ca7..1f1c7bbf7 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp @@ -179,7 +179,7 @@ void FilterIsoParametrization::PrintStats(CMeshO *mesh) Log("stdDev Edge: %5.2f",stdE/avE); } -bool FilterIsoParametrization::applyFilter(QAction *filter, MeshDocument& md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterIsoParametrization::applyFilter(const QAction *filter, MeshDocument& md, const RichParameterList & par, vcg::CallBackPos *cb) { MeshModel* m = md.mm(); //get current mesh from document CMeshO *mesh=&m->cm; diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h index 6416004e4..90cd5e637 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h @@ -55,7 +55,7 @@ class FilterIsoParametrization : public QObject, public MeshFilterInterface virtual int getRequirements(QAction *); virtual void initParameterSet(QAction *,MeshDocument&, RichParameterList & /*parent*/); - virtual bool applyFilter(QAction *filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); + virtual bool applyFilter(const QAction* filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); int postCondition(const QAction* filter) const; void PrintStats(CMeshO *mesh); FILTER_ARITY filterArity(QAction*) const; diff --git a/src/meshlabplugins/filter_layer/filter_layer.cpp b/src/meshlabplugins/filter_layer/filter_layer.cpp index 1fd63dd75..c6e7af8f5 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.cpp +++ b/src/meshlabplugins/filter_layer/filter_layer.cpp @@ -178,7 +178,7 @@ void FilterLayerPlugin::initParameterSet(QAction *action, MeshDocument &md, Rich } // Core Function doing the actual mesh processing. -bool FilterLayerPlugin::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterLayerPlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) { CMeshO::FaceIterator fi; int numFacesSel,numVertSel; diff --git a/src/meshlabplugins/filter_layer/filter_layer.h b/src/meshlabplugins/filter_layer/filter_layer.h index 1264b2a56..11a8013ae 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.h +++ b/src/meshlabplugins/filter_layer/filter_layer.h @@ -60,7 +60,7 @@ public: virtual QString filterInfo(FilterIDType filter) const; virtual FilterClass getClass(const QAction*) const; virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction *filter) const; FILTER_ARITY filterArity(QAction*) const; }; diff --git a/src/meshlabplugins/filter_measure/filter_measure.cpp b/src/meshlabplugins/filter_measure/filter_measure.cpp index 35ff3c131..a29510409 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.cpp +++ b/src/meshlabplugins/filter_measure/filter_measure.cpp @@ -171,7 +171,7 @@ void FilterMeasurePlugin::initParameterSet(QAction *action, MeshModel &m, RichPa } } -bool FilterMeasurePlugin::applyFilter(QAction* filter, MeshDocument& md, const RichParameterList& parlst, vcg::CallBackPos*) +bool FilterMeasurePlugin::applyFilter(const QAction* filter, MeshDocument& md, const RichParameterList& parlst, vcg::CallBackPos*) { switch (ID(filter)) { case COMPUTE_TOPOLOGICAL_MEASURES: diff --git a/src/meshlabplugins/filter_measure/filter_measure.h b/src/meshlabplugins/filter_measure/filter_measure.h index 493962db7..50ff6e421 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.h +++ b/src/meshlabplugins/filter_measure/filter_measure.h @@ -54,7 +54,7 @@ public: FILTER_ARITY filterArity(QAction*) const; int getPreConditions(QAction *action) const; void initParameterSet(QAction* , MeshModel& m, RichParameterList& parlst); - bool applyFilter(QAction* filter, MeshDocument& md, const RichParameterList& parlst, vcg::CallBackPos*) ; + bool applyFilter(const QAction* filter, MeshDocument& md, const RichParameterList& parlst, vcg::CallBackPos*) ; int postCondition(const QAction* ) const; private: diff --git a/src/meshlabplugins/filter_meshing/meshfilter.cpp b/src/meshlabplugins/filter_meshing/meshfilter.cpp index a500e4150..987a33ef5 100644 --- a/src/meshlabplugins/filter_meshing/meshfilter.cpp +++ b/src/meshlabplugins/filter_meshing/meshfilter.cpp @@ -674,7 +674,7 @@ void ApplyTransform(MeshDocument &md, const Matrix44m &tr, bool toAllFlag, bool } -bool ExtraMeshFilterPlugin::applyFilter(QAction * filter, MeshDocument & md, const RichParameterList & par, vcg::CallBackPos * cb) +bool ExtraMeshFilterPlugin::applyFilter(const QAction * filter, MeshDocument & md, const RichParameterList & par, vcg::CallBackPos * cb) { MeshModel & m = *md.mm(); diff --git a/src/meshlabplugins/filter_meshing/meshfilter.h b/src/meshlabplugins/filter_meshing/meshfilter.h index 8a6ea95aa..3384a9224 100644 --- a/src/meshlabplugins/filter_meshing/meshfilter.h +++ b/src/meshlabplugins/filter_meshing/meshfilter.h @@ -89,7 +89,7 @@ public: FilterClass getClass(const QAction*) const; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction *filter) const; int getPreCondition(QAction *filter) const; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_mls/mlsplugin.cpp b/src/meshlabplugins/filter_mls/mlsplugin.cpp index 6b0c8e32f..93f8ba307 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.cpp +++ b/src/meshlabplugins/filter_mls/mlsplugin.cpp @@ -357,7 +357,7 @@ void UpdateFaceNormalFromVertex(MeshType& m) } } -bool MlsPlugin::applyFilter(QAction* filter, MeshDocument& md, const RichParameterList& par, vcg::CallBackPos* cb) +bool MlsPlugin::applyFilter(const QAction* filter, MeshDocument& md, const RichParameterList& par, vcg::CallBackPos* cb) { int id = ID(filter); diff --git a/src/meshlabplugins/filter_mls/mlsplugin.h b/src/meshlabplugins/filter_mls/mlsplugin.h index 2bd0f9f99..ab0ea8873 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.h +++ b/src/meshlabplugins/filter_mls/mlsplugin.h @@ -68,7 +68,7 @@ public: FilterClass getClass(const QAction *a) const; virtual void initParameterSet(QAction *,MeshDocument &md, RichParameterList &parent); virtual int getRequirements(QAction *action); - virtual bool applyFilter(QAction *filter, MeshDocument &m, const RichParameterList &parent, vcg::CallBackPos *cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &m, const RichParameterList &parent, vcg::CallBackPos *cb) ; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp index d138c3313..e6b336483 100644 --- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp +++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp @@ -158,7 +158,7 @@ void FilterMutualGlobal::initParameterSet(QAction *action,MeshDocument & md, Ric // The Real Core Function doing the actual mesh processing. // Move Vertex of a random quantity -bool FilterMutualGlobal::applyFilter(QAction *action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterMutualGlobal::applyFilter(const QAction *action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) { QElapsedTimer filterTime; filterTime.start(); diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h index 664e5506f..352921e1e 100644 --- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h +++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h @@ -55,7 +55,7 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; void initParameterSet(QAction *,MeshDocument & md, RichParameterList & /*parent*/); - bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction*) const { return MeshModel::MM_NONE; }; FilterClass getClass(const QAction* a) const; QString filterScriptFunctionName(FilterIDType filterID); diff --git a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp index 03a2c7c2f..2317d7fa5 100644 --- a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp +++ b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp @@ -110,7 +110,7 @@ void FilterMutualInfoPlugin::initParameterSet(QAction *action,MeshDocument & /*m } } -bool FilterMutualInfoPlugin::applyFilter(QAction *action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos* ) +bool FilterMutualInfoPlugin::applyFilter(const QAction *action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos* ) { switch(ID(action)) { case FP_IMAGE_MUTUALINFO : diff --git a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h index 82f04cbd7..80a59040f 100644 --- a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h +++ b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h @@ -48,7 +48,7 @@ public: FilterClass getClass(const QAction* a) const; FILTER_ARITY filterArity(QAction *) const; void initParameterSet(QAction *, MeshDocument &, RichParameterList & /*parent*/); - bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction*) const; private: diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.cpp b/src/meshlabplugins/filter_plymc/filter_plymc.cpp index 1eefbcea5..ec45d0880 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.cpp +++ b/src/meshlabplugins/filter_plymc/filter_plymc.cpp @@ -122,7 +122,7 @@ void PlyMCPlugin::initParameterSet(QAction *action,MeshModel &m, RichParameterLi } // The Real Core Function doing the actual mesh processing. -bool PlyMCPlugin::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * cb) +bool PlyMCPlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * cb) { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.h b/src/meshlabplugins/filter_plymc/filter_plymc.h index 3e56ae694..199639ad6 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.h +++ b/src/meshlabplugins/filter_plymc/filter_plymc.h @@ -44,7 +44,7 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FilterClass getClass(const QAction* a) const; MeshFilterInterface::FILTER_ARITY filterArity(QAction * filter) const; int postCondition(const QAction *filter) const; diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.cpp b/src/meshlabplugins/filter_qhull/filter_qhull.cpp index 0ac07de47..baff4f9e3 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.cpp +++ b/src/meshlabplugins/filter_qhull/filter_qhull.cpp @@ -198,7 +198,7 @@ void QhullPlugin::initParameterSet(QAction *action,MeshModel &m, RichParameterLi } // The Real Core Function doing the actual mesh processing. -bool QhullPlugin::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos */* cb*/) +bool QhullPlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos */* cb*/) { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.h b/src/meshlabplugins/filter_qhull/filter_qhull.h index 3dc1c0c7d..f0fe15075 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.h +++ b/src/meshlabplugins/filter_qhull/filter_qhull.h @@ -59,7 +59,7 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(QAction *filter, MeshDocument &m, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &m, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; virtual FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp index 4f31a3a23..990345231 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp @@ -125,7 +125,7 @@ void QualityMapperFilter::initParameterSet(QAction *action,MeshModel &m, RichPar // The Real Core Function doing the actual mesh processing. // Apply color to mesh vertices -bool QualityMapperFilter::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool QualityMapperFilter::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) { MeshModel &m=*(md.mm()); m.updateDataMask(MeshModel::MM_VERTCOLOR); diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.h b/src/meshlabplugins/filter_quality/filterqualitymapper.h index f969179c1..cf076b900 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.h +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.h @@ -75,7 +75,7 @@ public: int getPreConditions(QAction *) const; int postCondition(const QAction* ) const; virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; virtual FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_sample/filter_sample.cpp b/src/meshlabplugins/filter_sample/filter_sample.cpp index 0ba71708f..221feac21 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.cpp +++ b/src/meshlabplugins/filter_sample/filter_sample.cpp @@ -153,7 +153,7 @@ void FilterSamplePlugin::initParameterSet(QAction *action,MeshModel &m, RichPara * @param cb: callback object to tell MeshLab the percentage of execution of the filter * @return true if the filter has been applied correctly, false otherwise */ -bool FilterSamplePlugin::applyFilter(QAction * action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterSamplePlugin::applyFilter(const QAction * action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) { switch(ID(action)) { case FP_MOVE_VERTEX : diff --git a/src/meshlabplugins/filter_sample/filter_sample.h b/src/meshlabplugins/filter_sample/filter_sample.h index 91bc4bc8e..e0ca73335 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.h +++ b/src/meshlabplugins/filter_sample/filter_sample.h @@ -61,7 +61,7 @@ public: int getPreConditions(QAction *) const; int postCondition(const QAction* ) const; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(QAction *action, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); + bool applyFilter(const QAction* action, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); private: bool vertexDisplacement( diff --git a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp index dfb49506c..d87d83d23 100644 --- a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp +++ b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp @@ -119,7 +119,7 @@ void ExtraSampleDynPlugin::initParameterSet(QAction *action,MeshModel &/*m*/, Ri // The Real Core Function doing the actual mesh processing. // It changes the color of the mesh according to a perlin noise function -bool ExtraSampleDynPlugin::applyFilter(QAction *, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *) +bool ExtraSampleDynPlugin::applyFilter(const QAction *, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *) { MeshModel &m=*(md.mm()); const Color4b baseColor = par.getColor4b("baseColor"); diff --git a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h index 4a881fda4..24dc477a3 100644 --- a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h +++ b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h @@ -44,7 +44,7 @@ public: virtual QString filterInfo(FilterIDType filter) const; virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); virtual int postCondition(const QAction* ) const {return MeshModel::MM_VERTCOLOR;}; - virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; virtual FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp index 0d0df867c..60af09113 100644 --- a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp +++ b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp @@ -108,7 +108,7 @@ void ExtraSampleGPUPlugin::initParameterSet(QAction * action, MeshModel & m, Ric // The Real Core Function doing the actual mesh processing. // Move Vertex of a random quantity -bool ExtraSampleGPUPlugin::applyFilter(QAction * a, MeshDocument & md , const RichParameterList & par, vcg::CallBackPos * /*cb*/) +bool ExtraSampleGPUPlugin::applyFilter(const QAction * a, MeshDocument & md , const RichParameterList & par, vcg::CallBackPos * /*cb*/) { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h index 86cb6095d..7eea9b47b 100644 --- a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h +++ b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h @@ -55,7 +55,7 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FilterClass getClass(const QAction* a) const; }; diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.cpp b/src/meshlabplugins/filter_sampling/filter_sampling.cpp index b447fce2c..fced06b0b 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.cpp +++ b/src/meshlabplugins/filter_sampling/filter_sampling.cpp @@ -696,7 +696,7 @@ void FilterDocSampling::initParameterSet(QAction *action, MeshDocument & md, Ric } } -bool FilterDocSampling::applyFilter(QAction *action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterDocSampling::applyFilter(const QAction *action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.h b/src/meshlabplugins/filter_sampling/filter_sampling.h index b196e2a98..608ed1882 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.h +++ b/src/meshlabplugins/filter_sampling/filter_sampling.h @@ -55,7 +55,7 @@ class FilterDocSampling : public QObject, public MeshFilterInterface QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(QAction *filter, MeshDocument &m, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &m, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int getRequirements(QAction *action); int postCondition(const QAction* ) const; FilterClass getClass(const QAction*) const; diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp index 54807e5d0..73ea66015 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp @@ -99,7 +99,7 @@ int FilterScreenedPoissonPlugin::getRequirements(QAction* a) } } -bool FilterScreenedPoissonPlugin::applyFilter(QAction* filter, MeshDocument& md, const RichParameterList& params, vcg::CallBackPos* cb) +bool FilterScreenedPoissonPlugin::applyFilter(const QAction* filter, MeshDocument& md, const RichParameterList& params, vcg::CallBackPos* cb) { bool currDirChanged=false; QDir currDir = QDir::current(); diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h index 6c9520d1e..eea152123 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h @@ -47,8 +47,7 @@ public: FilterClass getClass(const QAction* a) const; int getRequirements(QAction* a); - bool applyFilter( - QAction* filter, + bool applyFilter(const QAction* filter, MeshDocument& md, const RichParameterList& params, vcg::CallBackPos* cb) ; diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp index faaa1480f..91dd3d48d 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp @@ -143,7 +143,7 @@ QString SdfGpuPlugin::filterInfo(FilterIDType filterId) const return QString(""); } -bool SdfGpuPlugin::applyFilter(QAction */*filter*/, MeshDocument &md, const RichParameterList & pars, vcg::CallBackPos *cb) +bool SdfGpuPlugin::applyFilter(const QAction */*filter*/, MeshDocument &md, const RichParameterList & pars, vcg::CallBackPos *cb) { MeshModel* mm = md.mm(); diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h index 32d402f0c..e586c212f 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h @@ -37,7 +37,7 @@ public: FILTER_ARITY filterArity(QAction *act) const; //Main plugin function - bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); + bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); //Parameters init for user interface virtual void initParameterSet(QAction *action, MeshModel &m, RichParameterList &parlst); diff --git a/src/meshlabplugins/filter_sdfgpu/filterinterface.h b/src/meshlabplugins/filter_sdfgpu/filterinterface.h index 46a5c20e6..e1f450d27 100644 --- a/src/meshlabplugins/filter_sdfgpu/filterinterface.h +++ b/src/meshlabplugins/filter_sdfgpu/filterinterface.h @@ -153,7 +153,7 @@ private: int postCondition(const QAction*) const{ return MeshModel::MM_NONE; } - bool applyFilter(QAction *, MeshDocument &md, const RichParameterList& par, vcg::CallBackPos * cb){ + bool applyFilter(const QAction *, MeshDocument &md, const RichParameterList& par, vcg::CallBackPos * cb){ return applyFilter(md, par, cb); } virtual void initParameterSet(QAction *, MeshDocument &md, RichParameterList &par){ diff --git a/src/meshlabplugins/filter_select/meshselect.cpp b/src/meshlabplugins/filter_select/meshselect.cpp index c1190d11a..b48fcbe77 100644 --- a/src/meshlabplugins/filter_select/meshselect.cpp +++ b/src/meshlabplugins/filter_select/meshselect.cpp @@ -301,7 +301,7 @@ void SelectionFilterPlugin::initParameterSet(QAction *action, MeshModel &m, Rich } } -bool SelectionFilterPlugin::applyFilter(QAction *action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * /*cb*/) +bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * /*cb*/) { if (md.mm() == NULL) return false; diff --git a/src/meshlabplugins/filter_select/meshselect.h b/src/meshlabplugins/filter_select/meshselect.h index ada4af3d5..33cea7870 100644 --- a/src/meshlabplugins/filter_select/meshselect.h +++ b/src/meshlabplugins/filter_select/meshselect.h @@ -78,7 +78,7 @@ class SelectionFilterPlugin : public QObject, public MeshFilterInterface int getPreConditions(QAction *) const; int postCondition(const QAction* ) const; int getRequirements(QAction *); - bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp index c4e31dc85..6566d09f2 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp @@ -122,7 +122,7 @@ void FilterSketchFabPlugin::initParameterSet(QAction* action, MeshModel&, RichPa } } -bool FilterSketchFabPlugin::applyFilter(QAction * action, MeshDocument& md, const RichParameterList& par, vcg::CallBackPos* cb) +bool FilterSketchFabPlugin::applyFilter(const QAction * action, MeshDocument& md, const RichParameterList& par, vcg::CallBackPos* cb) { switch (ID(action)) { case FP_SKETCHFAB: diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h index 36737ae2c..8e7a0e51b 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h @@ -46,7 +46,7 @@ public: int getPreConditions(QAction *) const; int postCondition(const QAction* ) const; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; public slots: void finished(); diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp index 345c783e1..ede27bfd3 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp @@ -78,7 +78,7 @@ void FilterSSynth::openX3D(const QString &fileName, MeshModel &m, int& mask, vcg delete(info); } -bool FilterSSynth::applyFilter(QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterSSynth::applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) { md.addNewMesh("",this->filterName(ID(filter))); QWidget * parent=(QWidget*)this->parent(); diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.h b/src/meshlabplugins/filter_ssynth/filter_ssynth.h index d9cf2e947..48f3bbbbf 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.h +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.h @@ -46,7 +46,7 @@ public: virtual int getRequirements(QAction *); virtual void initParameterSet(QAction* /*filter*/,MeshModel &,RichParameterList &){}; virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); + virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); virtual FilterClass getClass(const QAction* filter) const; void setAttributes(CMeshO::VertexIterator &vi, CMeshO &m); static void openX3D(const QString &fileName, MeshModel &m, int& mask, vcg::CallBackPos *cb, QWidget *parent=0); diff --git a/src/meshlabplugins/filter_texture/filter_texture.cpp b/src/meshlabplugins/filter_texture/filter_texture.cpp index 360add8a4..130f36dda 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.cpp +++ b/src/meshlabplugins/filter_texture/filter_texture.cpp @@ -342,7 +342,7 @@ T log_2(const T num) } // The Real Core Function doing the actual mesh processing. -bool FilterTexturePlugin::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList &par, CallBackPos *cb) +bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList &par, CallBackPos *cb) { MeshModel &m=*(md.mm()); switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_texture/filter_texture.h b/src/meshlabplugins/filter_texture/filter_texture.h index bd9056c45..025c78919 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.h +++ b/src/meshlabplugins/filter_texture/filter_texture.h @@ -59,7 +59,7 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); + virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); virtual int getRequirements(QAction *); virtual int getPreConditions(QAction *) const; virtual int postCondition(const QAction* ) const; diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp index b32906e97..7683f2d57 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp @@ -171,7 +171,7 @@ QString TriOptimizePlugin::pluginName() const return {}; } - TriOptimizePlugin::FilterClass TriOptimizePlugin::getClass(QAction *action) + TriOptimizePlugin::FilterClass TriOptimizePlugin::getClass(const QAction *action) { switch(ID(action)) { case FP_PLANAR_EDGE_FLIP: return MeshFilterInterface::Remeshing; @@ -262,7 +262,7 @@ void TriOptimizePlugin::initParameterSet(QAction *action, MeshModel &m, RichPara // The Real Core Function doing the actual mesh processing. // Run mesh optimization -bool TriOptimizePlugin::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool TriOptimizePlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) { MeshModel &m=*(md.mm()); float limit = -std::numeric_limits::epsilon(); diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h index 6cff6c141..7b5a24e89 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h @@ -48,9 +48,9 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList &/*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList &/*parent*/, vcg::CallBackPos * cb) ; int getRequirements(QAction *); - FilterClass getClass(QAction *); + FilterClass getClass(const QAction *); int postCondition(const QAction* ) const; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp index f562ef174..48be62328 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp @@ -405,7 +405,7 @@ void FilterUnsharp::initParameterSet(QAction *action, MeshDocument &md, RichPara } } -bool FilterUnsharp::applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * cb) +bool FilterUnsharp::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * cb) { MeshModel &m=*(md.mm()); switch(ID(filter)) diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.h b/src/meshlabplugins/filter_unsharp/filter_unsharp.h index f0a0e90fb..0f8c9fa98 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.h +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.h @@ -72,7 +72,7 @@ class FilterUnsharp : public QObject, public MeshFilterInterface QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction*) const; int getRequirements(QAction *); - bool applyFilter(QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; void initParameterSet(QAction *action, MeshDocument &/*m*/, RichParameterList & parlst); int postCondition(const QAction* ) const; int getPreConditions(QAction *) const; diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp index 14e172603..a671e98ce 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp @@ -95,7 +95,7 @@ QString FilterVoronoiPlugin::filterInfo(FilterIDType filterId) const } } -FilterVoronoiPlugin::FilterClass FilterVoronoiPlugin::getClass(QAction* a) +FilterVoronoiPlugin::FilterClass FilterVoronoiPlugin::getClass(const QAction* a) const { switch(ID(a)) { case VORONOI_SAMPLING : @@ -211,7 +211,7 @@ int FilterVoronoiPlugin::getPreConditions(QAction* action) const } } -bool FilterVoronoiPlugin::applyFilter(QAction * action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterVoronoiPlugin::applyFilter(const QAction * action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) { switch(ID(action)) { case VORONOI_SAMPLING : diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.h b/src/meshlabplugins/filter_voronoi/filter_voronoi.h index be21e78f4..9507d47e8 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.h +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.h @@ -47,11 +47,11 @@ public: QString pluginName() const; QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - FilterClass getClass(QAction* a); + FilterClass getClass(const QAction* a) const; FILTER_ARITY filterArity(QAction* a) const; void initParameterSet(QAction* action, MeshModel& m, RichParameterList& par); int getPreConditions(QAction* action) const; - bool applyFilter(QAction* action, MeshDocument& md, const RichParameterList& par, vcg::CallBackPos* cb) ; + bool applyFilter(const QAction* action, MeshDocument& md, const RichParameterList& par, vcg::CallBackPos* cb) ; int postCondition(const QAction* ) const; private: From dd072f3fd89fbaa1ca8f6dd30da2b785c3ec9074 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 17 Sep 2020 14:12:37 +0200 Subject: [PATCH 21/49] move unused filters to unsupported --- src/meshlab.pro | 5 ----- .../edit_hole/CMakeLists.txt | 0 .../edit_hole/edit_hole.cpp | 0 .../edit_hole/edit_hole.h | 0 .../edit_hole/edit_hole.pro | 0 .../edit_hole/edit_hole.qrc | 0 .../edit_hole/edit_hole.ui | 0 .../edit_hole/edit_hole_factory.cpp | 0 .../edit_hole/edit_hole_factory.h | 0 .../edit_hole/fgtBridge.h | 0 .../edit_hole/fgtHole.h | 0 .../edit_hole/fillerDialog.cpp | 0 .../edit_hole/fillerDialog.h | 0 .../edit_hole/holeListModel.cpp | 0 .../edit_hole/holeListModel.h | 0 .../edit_hole/holeSetManager.h | 0 .../edit_hole/images/bridgeCursor.png | Bin .../edit_hole/images/bridgeCursor1.png | Bin .../edit_hole/images/hole_filler.png | Bin .../edit_slice/CMakeLists.txt | 0 .../edit_slice/edit_slice_factory.cpp | 0 .../edit_slice/edit_slice_factory.h | 0 .../edit_slice/editslice.cpp | 0 .../edit_slice/editslice.h | 0 .../edit_slice/editslice.pro | 0 .../edit_slice/images/iconslice.png | Bin .../edit_slice/meshlab.qrc | 0 .../edit_slice/slicedialog.cpp | 0 .../edit_slice/slicedialog.h | 0 .../edit_slice/slicedialog.ui | 0 .../edit_slice/svgpro.cpp | 0 .../edit_slice/svgpro.h | 0 .../edit_slice/svgpro.ui | 0 .../edit_texture/CMakeLists.txt | 0 .../edit_texture/edit_texture.pro | 0 .../edit_texture/edit_texture_factory.cpp | 0 .../edit_texture/edit_texture_factory.h | 0 .../edit_texture/edittexture.cpp | 0 .../edit_texture/edittexture.h | 0 .../edit_texture/images/collapse.png | Bin .../edit_texture/images/edit_texture.png | Bin .../edit_texture/images/flipH.png | Bin .../edit_texture/images/flipV.png | Bin .../edit_texture/images/invertsel.png | Bin .../edit_texture/images/rotate.png | Bin .../edit_texture/images/scale.png | Bin .../edit_texture/images/sel_rect.png | Bin .../edit_texture/images/sel_rect_minus.png | Bin .../edit_texture/images/sel_rect_plus.png | Bin .../edit_texture/images/selarea.png | Bin .../edit_texture/images/selcanc.png | Bin .../edit_texture/images/selcon.png | Bin .../edit_texture/images/selpan.png | Bin .../edit_texture/images/selver.png | Bin .../edit_texture/images/unify.png | Bin .../edit_texture/meshlab.qrc | 0 .../edit_texture/renderarea.cpp | 0 .../edit_texture/renderarea.h | 0 .../edit_texture/textureeditor.cpp | 0 .../edit_texture/textureeditor.h | 0 .../edit_texture/textureeditor.ui | 0 .../filter_aging/CMakeLists.txt | 0 .../filter_aging/edgepred.h | 0 .../filter_aging/filter_aging.cpp | 0 .../filter_aging/filter_aging.h | 0 .../filter_aging/filter_aging.pro | 0 .../filter_bnpts/CMakeLists.txt | 0 .../filter_bnpts/filter_bnpts.cpp | 0 .../filter_bnpts/filter_bnpts.h | 0 .../filter_bnpts/filter_bnpts.pro | 0 70 files changed, 5 deletions(-) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/CMakeLists.txt (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/edit_hole.cpp (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/edit_hole.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/edit_hole.pro (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/edit_hole.qrc (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/edit_hole.ui (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/edit_hole_factory.cpp (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/edit_hole_factory.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/fgtBridge.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/fgtHole.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/fillerDialog.cpp (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/fillerDialog.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/holeListModel.cpp (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/holeListModel.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/holeSetManager.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/images/bridgeCursor.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/images/bridgeCursor1.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_hole/images/hole_filler.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_slice/CMakeLists.txt (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_slice/edit_slice_factory.cpp (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_slice/edit_slice_factory.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_slice/editslice.cpp (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_slice/editslice.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_slice/editslice.pro (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_slice/images/iconslice.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_slice/meshlab.qrc (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_slice/slicedialog.cpp (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_slice/slicedialog.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_slice/slicedialog.ui (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_slice/svgpro.cpp (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_slice/svgpro.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_slice/svgpro.ui (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/CMakeLists.txt (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/edit_texture.pro (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/edit_texture_factory.cpp (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/edit_texture_factory.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/edittexture.cpp (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/edittexture.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/collapse.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/edit_texture.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/flipH.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/flipV.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/invertsel.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/rotate.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/scale.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/sel_rect.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/sel_rect_minus.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/sel_rect_plus.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/selarea.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/selcanc.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/selcon.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/selpan.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/selver.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/images/unify.png (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/meshlab.qrc (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/renderarea.cpp (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/renderarea.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/textureeditor.cpp (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/textureeditor.h (100%) rename src/{meshlabplugins => plugins_unsupported}/edit_texture/textureeditor.ui (100%) rename src/{meshlabplugins => plugins_unsupported}/filter_aging/CMakeLists.txt (100%) rename src/{meshlabplugins => plugins_unsupported}/filter_aging/edgepred.h (100%) rename src/{meshlabplugins => plugins_unsupported}/filter_aging/filter_aging.cpp (100%) rename src/{meshlabplugins => plugins_unsupported}/filter_aging/filter_aging.h (100%) rename src/{meshlabplugins => plugins_unsupported}/filter_aging/filter_aging.pro (100%) rename src/{meshlabplugins => plugins_unsupported}/filter_bnpts/CMakeLists.txt (100%) rename src/{meshlabplugins => plugins_unsupported}/filter_bnpts/filter_bnpts.cpp (100%) rename src/{meshlabplugins => plugins_unsupported}/filter_bnpts/filter_bnpts.h (100%) rename src/{meshlabplugins => plugins_unsupported}/filter_bnpts/filter_bnpts.pro (100%) diff --git a/src/meshlab.pro b/src/meshlab.pro index f0423e57a..465390d40 100644 --- a/src/meshlab.pro +++ b/src/meshlab.pro @@ -271,11 +271,6 @@ edit_quality.depends = common edit_select.depends = common edit_pickpoints.depends = common -#no longer needed# meshlabplugins/filter_aging \ -#no longer needed# meshlabplugins/filter_bnpts \ -#no longer needed# meshlabplugins/filter_colorize \ - - # if distrib folder is not in $$PWD/../distrib (shadow build case), # we need to copy all the files inside $$PWD/../distrib in the actual # distrib folder ($$OUT_PWD/distrib or $$MESHLAB_DISTRIB_DIRECTORY) diff --git a/src/meshlabplugins/edit_hole/CMakeLists.txt b/src/plugins_unsupported/edit_hole/CMakeLists.txt similarity index 100% rename from src/meshlabplugins/edit_hole/CMakeLists.txt rename to src/plugins_unsupported/edit_hole/CMakeLists.txt diff --git a/src/meshlabplugins/edit_hole/edit_hole.cpp b/src/plugins_unsupported/edit_hole/edit_hole.cpp similarity index 100% rename from src/meshlabplugins/edit_hole/edit_hole.cpp rename to src/plugins_unsupported/edit_hole/edit_hole.cpp diff --git a/src/meshlabplugins/edit_hole/edit_hole.h b/src/plugins_unsupported/edit_hole/edit_hole.h similarity index 100% rename from src/meshlabplugins/edit_hole/edit_hole.h rename to src/plugins_unsupported/edit_hole/edit_hole.h diff --git a/src/meshlabplugins/edit_hole/edit_hole.pro b/src/plugins_unsupported/edit_hole/edit_hole.pro similarity index 100% rename from src/meshlabplugins/edit_hole/edit_hole.pro rename to src/plugins_unsupported/edit_hole/edit_hole.pro diff --git a/src/meshlabplugins/edit_hole/edit_hole.qrc b/src/plugins_unsupported/edit_hole/edit_hole.qrc similarity index 100% rename from src/meshlabplugins/edit_hole/edit_hole.qrc rename to src/plugins_unsupported/edit_hole/edit_hole.qrc diff --git a/src/meshlabplugins/edit_hole/edit_hole.ui b/src/plugins_unsupported/edit_hole/edit_hole.ui similarity index 100% rename from src/meshlabplugins/edit_hole/edit_hole.ui rename to src/plugins_unsupported/edit_hole/edit_hole.ui diff --git a/src/meshlabplugins/edit_hole/edit_hole_factory.cpp b/src/plugins_unsupported/edit_hole/edit_hole_factory.cpp similarity index 100% rename from src/meshlabplugins/edit_hole/edit_hole_factory.cpp rename to src/plugins_unsupported/edit_hole/edit_hole_factory.cpp diff --git a/src/meshlabplugins/edit_hole/edit_hole_factory.h b/src/plugins_unsupported/edit_hole/edit_hole_factory.h similarity index 100% rename from src/meshlabplugins/edit_hole/edit_hole_factory.h rename to src/plugins_unsupported/edit_hole/edit_hole_factory.h diff --git a/src/meshlabplugins/edit_hole/fgtBridge.h b/src/plugins_unsupported/edit_hole/fgtBridge.h similarity index 100% rename from src/meshlabplugins/edit_hole/fgtBridge.h rename to src/plugins_unsupported/edit_hole/fgtBridge.h diff --git a/src/meshlabplugins/edit_hole/fgtHole.h b/src/plugins_unsupported/edit_hole/fgtHole.h similarity index 100% rename from src/meshlabplugins/edit_hole/fgtHole.h rename to src/plugins_unsupported/edit_hole/fgtHole.h diff --git a/src/meshlabplugins/edit_hole/fillerDialog.cpp b/src/plugins_unsupported/edit_hole/fillerDialog.cpp similarity index 100% rename from src/meshlabplugins/edit_hole/fillerDialog.cpp rename to src/plugins_unsupported/edit_hole/fillerDialog.cpp diff --git a/src/meshlabplugins/edit_hole/fillerDialog.h b/src/plugins_unsupported/edit_hole/fillerDialog.h similarity index 100% rename from src/meshlabplugins/edit_hole/fillerDialog.h rename to src/plugins_unsupported/edit_hole/fillerDialog.h diff --git a/src/meshlabplugins/edit_hole/holeListModel.cpp b/src/plugins_unsupported/edit_hole/holeListModel.cpp similarity index 100% rename from src/meshlabplugins/edit_hole/holeListModel.cpp rename to src/plugins_unsupported/edit_hole/holeListModel.cpp diff --git a/src/meshlabplugins/edit_hole/holeListModel.h b/src/plugins_unsupported/edit_hole/holeListModel.h similarity index 100% rename from src/meshlabplugins/edit_hole/holeListModel.h rename to src/plugins_unsupported/edit_hole/holeListModel.h diff --git a/src/meshlabplugins/edit_hole/holeSetManager.h b/src/plugins_unsupported/edit_hole/holeSetManager.h similarity index 100% rename from src/meshlabplugins/edit_hole/holeSetManager.h rename to src/plugins_unsupported/edit_hole/holeSetManager.h diff --git a/src/meshlabplugins/edit_hole/images/bridgeCursor.png b/src/plugins_unsupported/edit_hole/images/bridgeCursor.png similarity index 100% rename from src/meshlabplugins/edit_hole/images/bridgeCursor.png rename to src/plugins_unsupported/edit_hole/images/bridgeCursor.png diff --git a/src/meshlabplugins/edit_hole/images/bridgeCursor1.png b/src/plugins_unsupported/edit_hole/images/bridgeCursor1.png similarity index 100% rename from src/meshlabplugins/edit_hole/images/bridgeCursor1.png rename to src/plugins_unsupported/edit_hole/images/bridgeCursor1.png diff --git a/src/meshlabplugins/edit_hole/images/hole_filler.png b/src/plugins_unsupported/edit_hole/images/hole_filler.png similarity index 100% rename from src/meshlabplugins/edit_hole/images/hole_filler.png rename to src/plugins_unsupported/edit_hole/images/hole_filler.png diff --git a/src/meshlabplugins/edit_slice/CMakeLists.txt b/src/plugins_unsupported/edit_slice/CMakeLists.txt similarity index 100% rename from src/meshlabplugins/edit_slice/CMakeLists.txt rename to src/plugins_unsupported/edit_slice/CMakeLists.txt diff --git a/src/meshlabplugins/edit_slice/edit_slice_factory.cpp b/src/plugins_unsupported/edit_slice/edit_slice_factory.cpp similarity index 100% rename from src/meshlabplugins/edit_slice/edit_slice_factory.cpp rename to src/plugins_unsupported/edit_slice/edit_slice_factory.cpp diff --git a/src/meshlabplugins/edit_slice/edit_slice_factory.h b/src/plugins_unsupported/edit_slice/edit_slice_factory.h similarity index 100% rename from src/meshlabplugins/edit_slice/edit_slice_factory.h rename to src/plugins_unsupported/edit_slice/edit_slice_factory.h diff --git a/src/meshlabplugins/edit_slice/editslice.cpp b/src/plugins_unsupported/edit_slice/editslice.cpp similarity index 100% rename from src/meshlabplugins/edit_slice/editslice.cpp rename to src/plugins_unsupported/edit_slice/editslice.cpp diff --git a/src/meshlabplugins/edit_slice/editslice.h b/src/plugins_unsupported/edit_slice/editslice.h similarity index 100% rename from src/meshlabplugins/edit_slice/editslice.h rename to src/plugins_unsupported/edit_slice/editslice.h diff --git a/src/meshlabplugins/edit_slice/editslice.pro b/src/plugins_unsupported/edit_slice/editslice.pro similarity index 100% rename from src/meshlabplugins/edit_slice/editslice.pro rename to src/plugins_unsupported/edit_slice/editslice.pro diff --git a/src/meshlabplugins/edit_slice/images/iconslice.png b/src/plugins_unsupported/edit_slice/images/iconslice.png similarity index 100% rename from src/meshlabplugins/edit_slice/images/iconslice.png rename to src/plugins_unsupported/edit_slice/images/iconslice.png diff --git a/src/meshlabplugins/edit_slice/meshlab.qrc b/src/plugins_unsupported/edit_slice/meshlab.qrc similarity index 100% rename from src/meshlabplugins/edit_slice/meshlab.qrc rename to src/plugins_unsupported/edit_slice/meshlab.qrc diff --git a/src/meshlabplugins/edit_slice/slicedialog.cpp b/src/plugins_unsupported/edit_slice/slicedialog.cpp similarity index 100% rename from src/meshlabplugins/edit_slice/slicedialog.cpp rename to src/plugins_unsupported/edit_slice/slicedialog.cpp diff --git a/src/meshlabplugins/edit_slice/slicedialog.h b/src/plugins_unsupported/edit_slice/slicedialog.h similarity index 100% rename from src/meshlabplugins/edit_slice/slicedialog.h rename to src/plugins_unsupported/edit_slice/slicedialog.h diff --git a/src/meshlabplugins/edit_slice/slicedialog.ui b/src/plugins_unsupported/edit_slice/slicedialog.ui similarity index 100% rename from src/meshlabplugins/edit_slice/slicedialog.ui rename to src/plugins_unsupported/edit_slice/slicedialog.ui diff --git a/src/meshlabplugins/edit_slice/svgpro.cpp b/src/plugins_unsupported/edit_slice/svgpro.cpp similarity index 100% rename from src/meshlabplugins/edit_slice/svgpro.cpp rename to src/plugins_unsupported/edit_slice/svgpro.cpp diff --git a/src/meshlabplugins/edit_slice/svgpro.h b/src/plugins_unsupported/edit_slice/svgpro.h similarity index 100% rename from src/meshlabplugins/edit_slice/svgpro.h rename to src/plugins_unsupported/edit_slice/svgpro.h diff --git a/src/meshlabplugins/edit_slice/svgpro.ui b/src/plugins_unsupported/edit_slice/svgpro.ui similarity index 100% rename from src/meshlabplugins/edit_slice/svgpro.ui rename to src/plugins_unsupported/edit_slice/svgpro.ui diff --git a/src/meshlabplugins/edit_texture/CMakeLists.txt b/src/plugins_unsupported/edit_texture/CMakeLists.txt similarity index 100% rename from src/meshlabplugins/edit_texture/CMakeLists.txt rename to src/plugins_unsupported/edit_texture/CMakeLists.txt diff --git a/src/meshlabplugins/edit_texture/edit_texture.pro b/src/plugins_unsupported/edit_texture/edit_texture.pro similarity index 100% rename from src/meshlabplugins/edit_texture/edit_texture.pro rename to src/plugins_unsupported/edit_texture/edit_texture.pro diff --git a/src/meshlabplugins/edit_texture/edit_texture_factory.cpp b/src/plugins_unsupported/edit_texture/edit_texture_factory.cpp similarity index 100% rename from src/meshlabplugins/edit_texture/edit_texture_factory.cpp rename to src/plugins_unsupported/edit_texture/edit_texture_factory.cpp diff --git a/src/meshlabplugins/edit_texture/edit_texture_factory.h b/src/plugins_unsupported/edit_texture/edit_texture_factory.h similarity index 100% rename from src/meshlabplugins/edit_texture/edit_texture_factory.h rename to src/plugins_unsupported/edit_texture/edit_texture_factory.h diff --git a/src/meshlabplugins/edit_texture/edittexture.cpp b/src/plugins_unsupported/edit_texture/edittexture.cpp similarity index 100% rename from src/meshlabplugins/edit_texture/edittexture.cpp rename to src/plugins_unsupported/edit_texture/edittexture.cpp diff --git a/src/meshlabplugins/edit_texture/edittexture.h b/src/plugins_unsupported/edit_texture/edittexture.h similarity index 100% rename from src/meshlabplugins/edit_texture/edittexture.h rename to src/plugins_unsupported/edit_texture/edittexture.h diff --git a/src/meshlabplugins/edit_texture/images/collapse.png b/src/plugins_unsupported/edit_texture/images/collapse.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/collapse.png rename to src/plugins_unsupported/edit_texture/images/collapse.png diff --git a/src/meshlabplugins/edit_texture/images/edit_texture.png b/src/plugins_unsupported/edit_texture/images/edit_texture.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/edit_texture.png rename to src/plugins_unsupported/edit_texture/images/edit_texture.png diff --git a/src/meshlabplugins/edit_texture/images/flipH.png b/src/plugins_unsupported/edit_texture/images/flipH.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/flipH.png rename to src/plugins_unsupported/edit_texture/images/flipH.png diff --git a/src/meshlabplugins/edit_texture/images/flipV.png b/src/plugins_unsupported/edit_texture/images/flipV.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/flipV.png rename to src/plugins_unsupported/edit_texture/images/flipV.png diff --git a/src/meshlabplugins/edit_texture/images/invertsel.png b/src/plugins_unsupported/edit_texture/images/invertsel.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/invertsel.png rename to src/plugins_unsupported/edit_texture/images/invertsel.png diff --git a/src/meshlabplugins/edit_texture/images/rotate.png b/src/plugins_unsupported/edit_texture/images/rotate.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/rotate.png rename to src/plugins_unsupported/edit_texture/images/rotate.png diff --git a/src/meshlabplugins/edit_texture/images/scale.png b/src/plugins_unsupported/edit_texture/images/scale.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/scale.png rename to src/plugins_unsupported/edit_texture/images/scale.png diff --git a/src/meshlabplugins/edit_texture/images/sel_rect.png b/src/plugins_unsupported/edit_texture/images/sel_rect.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/sel_rect.png rename to src/plugins_unsupported/edit_texture/images/sel_rect.png diff --git a/src/meshlabplugins/edit_texture/images/sel_rect_minus.png b/src/plugins_unsupported/edit_texture/images/sel_rect_minus.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/sel_rect_minus.png rename to src/plugins_unsupported/edit_texture/images/sel_rect_minus.png diff --git a/src/meshlabplugins/edit_texture/images/sel_rect_plus.png b/src/plugins_unsupported/edit_texture/images/sel_rect_plus.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/sel_rect_plus.png rename to src/plugins_unsupported/edit_texture/images/sel_rect_plus.png diff --git a/src/meshlabplugins/edit_texture/images/selarea.png b/src/plugins_unsupported/edit_texture/images/selarea.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/selarea.png rename to src/plugins_unsupported/edit_texture/images/selarea.png diff --git a/src/meshlabplugins/edit_texture/images/selcanc.png b/src/plugins_unsupported/edit_texture/images/selcanc.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/selcanc.png rename to src/plugins_unsupported/edit_texture/images/selcanc.png diff --git a/src/meshlabplugins/edit_texture/images/selcon.png b/src/plugins_unsupported/edit_texture/images/selcon.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/selcon.png rename to src/plugins_unsupported/edit_texture/images/selcon.png diff --git a/src/meshlabplugins/edit_texture/images/selpan.png b/src/plugins_unsupported/edit_texture/images/selpan.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/selpan.png rename to src/plugins_unsupported/edit_texture/images/selpan.png diff --git a/src/meshlabplugins/edit_texture/images/selver.png b/src/plugins_unsupported/edit_texture/images/selver.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/selver.png rename to src/plugins_unsupported/edit_texture/images/selver.png diff --git a/src/meshlabplugins/edit_texture/images/unify.png b/src/plugins_unsupported/edit_texture/images/unify.png similarity index 100% rename from src/meshlabplugins/edit_texture/images/unify.png rename to src/plugins_unsupported/edit_texture/images/unify.png diff --git a/src/meshlabplugins/edit_texture/meshlab.qrc b/src/plugins_unsupported/edit_texture/meshlab.qrc similarity index 100% rename from src/meshlabplugins/edit_texture/meshlab.qrc rename to src/plugins_unsupported/edit_texture/meshlab.qrc diff --git a/src/meshlabplugins/edit_texture/renderarea.cpp b/src/plugins_unsupported/edit_texture/renderarea.cpp similarity index 100% rename from src/meshlabplugins/edit_texture/renderarea.cpp rename to src/plugins_unsupported/edit_texture/renderarea.cpp diff --git a/src/meshlabplugins/edit_texture/renderarea.h b/src/plugins_unsupported/edit_texture/renderarea.h similarity index 100% rename from src/meshlabplugins/edit_texture/renderarea.h rename to src/plugins_unsupported/edit_texture/renderarea.h diff --git a/src/meshlabplugins/edit_texture/textureeditor.cpp b/src/plugins_unsupported/edit_texture/textureeditor.cpp similarity index 100% rename from src/meshlabplugins/edit_texture/textureeditor.cpp rename to src/plugins_unsupported/edit_texture/textureeditor.cpp diff --git a/src/meshlabplugins/edit_texture/textureeditor.h b/src/plugins_unsupported/edit_texture/textureeditor.h similarity index 100% rename from src/meshlabplugins/edit_texture/textureeditor.h rename to src/plugins_unsupported/edit_texture/textureeditor.h diff --git a/src/meshlabplugins/edit_texture/textureeditor.ui b/src/plugins_unsupported/edit_texture/textureeditor.ui similarity index 100% rename from src/meshlabplugins/edit_texture/textureeditor.ui rename to src/plugins_unsupported/edit_texture/textureeditor.ui diff --git a/src/meshlabplugins/filter_aging/CMakeLists.txt b/src/plugins_unsupported/filter_aging/CMakeLists.txt similarity index 100% rename from src/meshlabplugins/filter_aging/CMakeLists.txt rename to src/plugins_unsupported/filter_aging/CMakeLists.txt diff --git a/src/meshlabplugins/filter_aging/edgepred.h b/src/plugins_unsupported/filter_aging/edgepred.h similarity index 100% rename from src/meshlabplugins/filter_aging/edgepred.h rename to src/plugins_unsupported/filter_aging/edgepred.h diff --git a/src/meshlabplugins/filter_aging/filter_aging.cpp b/src/plugins_unsupported/filter_aging/filter_aging.cpp similarity index 100% rename from src/meshlabplugins/filter_aging/filter_aging.cpp rename to src/plugins_unsupported/filter_aging/filter_aging.cpp diff --git a/src/meshlabplugins/filter_aging/filter_aging.h b/src/plugins_unsupported/filter_aging/filter_aging.h similarity index 100% rename from src/meshlabplugins/filter_aging/filter_aging.h rename to src/plugins_unsupported/filter_aging/filter_aging.h diff --git a/src/meshlabplugins/filter_aging/filter_aging.pro b/src/plugins_unsupported/filter_aging/filter_aging.pro similarity index 100% rename from src/meshlabplugins/filter_aging/filter_aging.pro rename to src/plugins_unsupported/filter_aging/filter_aging.pro diff --git a/src/meshlabplugins/filter_bnpts/CMakeLists.txt b/src/plugins_unsupported/filter_bnpts/CMakeLists.txt similarity index 100% rename from src/meshlabplugins/filter_bnpts/CMakeLists.txt rename to src/plugins_unsupported/filter_bnpts/CMakeLists.txt diff --git a/src/meshlabplugins/filter_bnpts/filter_bnpts.cpp b/src/plugins_unsupported/filter_bnpts/filter_bnpts.cpp similarity index 100% rename from src/meshlabplugins/filter_bnpts/filter_bnpts.cpp rename to src/plugins_unsupported/filter_bnpts/filter_bnpts.cpp diff --git a/src/meshlabplugins/filter_bnpts/filter_bnpts.h b/src/plugins_unsupported/filter_bnpts/filter_bnpts.h similarity index 100% rename from src/meshlabplugins/filter_bnpts/filter_bnpts.h rename to src/plugins_unsupported/filter_bnpts/filter_bnpts.h diff --git a/src/meshlabplugins/filter_bnpts/filter_bnpts.pro b/src/plugins_unsupported/filter_bnpts/filter_bnpts.pro similarity index 100% rename from src/meshlabplugins/filter_bnpts/filter_bnpts.pro rename to src/plugins_unsupported/filter_bnpts/filter_bnpts.pro From 46ee099cf805516e4d5b63d313199a281454e41f Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 17 Sep 2020 14:27:07 +0200 Subject: [PATCH 22/49] getRequirements const correctness --- src/common/interfaces.h | 2 +- src/meshlabplugins/filter_ao/filter_ao.cpp | 2 +- src/meshlabplugins/filter_ao/filter_ao.h | 2 +- src/meshlabplugins/filter_clean/cleanfilter.cpp | 2 +- src/meshlabplugins/filter_clean/cleanfilter.h | 2 +- .../filter_color_projection/filter_color_projection.cpp | 2 +- .../filter_color_projection/filter_color_projection.h | 2 +- src/meshlabplugins/filter_colorproc/filter_colorproc.cpp | 2 +- src/meshlabplugins/filter_colorproc/filter_colorproc.h | 2 +- src/meshlabplugins/filter_createiso/filter_createiso.cpp | 2 +- src/meshlabplugins/filter_createiso/filter_createiso.h | 2 +- src/meshlabplugins/filter_csg/filter_csg.h | 1 - src/meshlabplugins/filter_dirt/filter_dirt.cpp | 2 +- src/meshlabplugins/filter_dirt/filter_dirt.h | 3 +-- src/meshlabplugins/filter_fractal/filter_fractal.cpp | 2 +- src/meshlabplugins/filter_fractal/filter_fractal.h | 2 +- src/meshlabplugins/filter_func/filter_func.cpp | 2 +- src/meshlabplugins/filter_func/filter_func.h | 2 +- src/meshlabplugins/filter_geodesic/filter_geodesic.cpp | 2 +- src/meshlabplugins/filter_geodesic/filter_geodesic.h | 2 +- .../filter_img_patch_param/filter_img_patch_param.cpp | 2 +- .../filter_img_patch_param/filter_img_patch_param.h | 2 +- .../filter_isoparametrization/filter_isoparametrization.cpp | 2 +- .../filter_isoparametrization/filter_isoparametrization.h | 2 +- src/meshlabplugins/filter_mls/mlsplugin.cpp | 2 +- src/meshlabplugins/filter_mls/mlsplugin.h | 2 +- src/meshlabplugins/filter_sampling/filter_sampling.cpp | 2 +- src/meshlabplugins/filter_sampling/filter_sampling.h | 2 +- .../filter_screened_poisson/filter_screened_poisson.cpp | 2 +- .../filter_screened_poisson/filter_screened_poisson.h | 2 +- src/meshlabplugins/filter_sdfgpu/filterinterface.h | 2 +- src/meshlabplugins/filter_select/meshselect.cpp | 2 +- src/meshlabplugins/filter_select/meshselect.h | 2 +- src/meshlabplugins/filter_ssynth/filter_ssynth.cpp | 2 +- src/meshlabplugins/filter_ssynth/filter_ssynth.h | 2 +- src/meshlabplugins/filter_texture/filter_texture.cpp | 2 +- src/meshlabplugins/filter_texture/filter_texture.h | 2 +- src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp | 2 +- src/meshlabplugins/filter_trioptimize/filter_trioptimize.h | 2 +- src/meshlabplugins/filter_unsharp/filter_unsharp.cpp | 2 +- src/meshlabplugins/filter_unsharp/filter_unsharp.h | 2 +- 41 files changed, 40 insertions(+), 42 deletions(-) diff --git a/src/common/interfaces.h b/src/common/interfaces.h index c843510ca..f69aa73ae 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -352,7 +352,7 @@ public: // outputs a never used before mesh property (e.g. face colors), it will be allocated by a call // to MeshModel::updateDataMask(...) */ - virtual int getRequirements(QAction *) { return MeshModel::MM_NONE; } + virtual int getRequirements(const QAction *) { return MeshModel::MM_NONE; } /** The FilterPrecondition mask is used to explicitate what kind of data a filter really needs to be applied. // For example algorithms that compute per face quality have as precondition the existence of faces diff --git a/src/meshlabplugins/filter_ao/filter_ao.cpp b/src/meshlabplugins/filter_ao/filter_ao.cpp index c359a21d4..76c504244 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.cpp +++ b/src/meshlabplugins/filter_ao/filter_ao.cpp @@ -91,7 +91,7 @@ QString AmbientOcclusionPlugin::filterInfo(FilterIDType filterId) const return QString(""); } -int AmbientOcclusionPlugin::getRequirements(QAction * /*action*/) +int AmbientOcclusionPlugin::getRequirements(const QAction * /*action*/) { //no requirements needed return 0; diff --git a/src/meshlabplugins/filter_ao/filter_ao.h b/src/meshlabplugins/filter_ao/filter_ao.h index e3e7bbae2..fbed311ea 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.h +++ b/src/meshlabplugins/filter_ao/filter_ao.h @@ -72,7 +72,7 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filterId) const; FILTER_ARITY filterArity(QAction*) const; - int getRequirements (QAction *action); + int getRequirements (const QAction* action); FilterClass getClass(const QAction* filter) const; void initParameterSet(QAction *,MeshModel &/*m*/,RichParameterList & /*parent*/); diff --git a/src/meshlabplugins/filter_clean/cleanfilter.cpp b/src/meshlabplugins/filter_clean/cleanfilter.cpp index f15c557d4..68862645a 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.cpp +++ b/src/meshlabplugins/filter_clean/cleanfilter.cpp @@ -167,7 +167,7 @@ QString CleanFilter::filterName(FilterIDType filter) const return MeshFilterInterface::Generic; } -int CleanFilter::getRequirements(QAction *action) +int CleanFilter::getRequirements(const QAction *action) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_clean/cleanfilter.h b/src/meshlabplugins/filter_clean/cleanfilter.h index f58511617..a688c214c 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.h +++ b/src/meshlabplugins/filter_clean/cleanfilter.h @@ -68,7 +68,7 @@ public: virtual QString filterInfo(FilterIDType filter) const; virtual FilterClass getClass(const QAction*) const; - virtual int getRequirements(QAction *); + virtual int getRequirements(const QAction*); int postCondition(const QAction* ) const; int getPreConditions(QAction *) const { return MeshModel::MM_NONE; } virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp index fa4296586..d5408a919 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp @@ -96,7 +96,7 @@ QString FilterColorProjectionPlugin::filterInfo(FilterIDType filterId) const } // What "new" properties the plugin requires -int FilterColorProjectionPlugin::getRequirements(QAction *action){ +int FilterColorProjectionPlugin::getRequirements(const QAction *action){ switch(ID(action)){ case FP_SINGLEIMAGEPROJ: return MeshModel::MM_VERTCOLOR; case FP_MULTIIMAGETRIVIALPROJ: return MeshModel::MM_VERTCOLOR; diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.h b/src/meshlabplugins/filter_color_projection/filter_color_projection.h index 3b9e310eb..47b9c78dd 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.h +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.h @@ -45,7 +45,7 @@ public: virtual FilterClass getClass(const QAction*) const; virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); - virtual int getRequirements(QAction *); + virtual int getRequirements(const QAction*); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp index c1d004c49..b5d759db4 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp @@ -170,7 +170,7 @@ QString FilterColorProc::pluginName() const return QString("error!"); } - int FilterColorProc::getRequirements(QAction *action) + int FilterColorProc::getRequirements(const QAction *action) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.h b/src/meshlabplugins/filter_colorproc/filter_colorproc.h index 5f55f9bbb..6e3606960 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.h +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.h @@ -72,7 +72,7 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual int getRequirements(QAction *); + virtual int getRequirements(const QAction*); virtual void initParameterSet(QAction *,MeshDocument&, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); diff --git a/src/meshlabplugins/filter_createiso/filter_createiso.cpp b/src/meshlabplugins/filter_createiso/filter_createiso.cpp index 4c58bcd31..44adf215b 100644 --- a/src/meshlabplugins/filter_createiso/filter_createiso.cpp +++ b/src/meshlabplugins/filter_createiso/filter_createiso.cpp @@ -88,7 +88,7 @@ QString FilterCreateIso::pluginName() const } } - int FilterCreateIso::getRequirements(QAction *action) + int FilterCreateIso::getRequirements(const QAction *action) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_createiso/filter_createiso.h b/src/meshlabplugins/filter_createiso/filter_createiso.h index 32d0cd71f..399780541 100644 --- a/src/meshlabplugins/filter_createiso/filter_createiso.h +++ b/src/meshlabplugins/filter_createiso/filter_createiso.h @@ -60,7 +60,7 @@ public: virtual QString filterInfo(FilterIDType filter) const; virtual FilterClass getClass(const QAction*) const; - virtual int getRequirements(QAction *); + virtual int getRequirements(const QAction*); virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; diff --git a/src/meshlabplugins/filter_csg/filter_csg.h b/src/meshlabplugins/filter_csg/filter_csg.h index a926e3cff..52fe3adca 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.h +++ b/src/meshlabplugins/filter_csg/filter_csg.h @@ -63,7 +63,6 @@ public: virtual void initParameterSet(QAction *, MeshModel &, RichParameterList &) { assert(0); } virtual bool applyFilter(const QAction*, MeshDocument &, const RichParameterList &, vcg::CallBackPos *); - virtual bool applyFilter(const QAction *, MeshModel &, const RichParameterList &, vcg::CallBackPos *) { assert(0); return false; } virtual FilterClass getClass(const QAction *) const { return MeshFilterInterface::FilterClass( MeshFilterInterface::Layer + MeshFilterInterface::Remeshing ); } FILTER_ARITY filterArity(QAction*) const {return FIXED;} diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.cpp b/src/meshlabplugins/filter_dirt/filter_dirt.cpp index f76d797d8..ad28e7745 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.cpp +++ b/src/meshlabplugins/filter_dirt/filter_dirt.cpp @@ -128,7 +128,7 @@ void FilterDirt::initParameterSet(QAction* filter,MeshDocument & /*md*/, RichPar } } -int FilterDirt::getRequirements(QAction * /*action*/) +int FilterDirt::getRequirements(const QAction * /*action*/) { return MeshModel::MM_FACEFACETOPO | MeshModel::MM_VERTCOLOR |MeshModel::MM_FACECOLOR; } diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.h b/src/meshlabplugins/filter_dirt/filter_dirt.h index 68fd46d38..e91133bbe 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.h +++ b/src/meshlabplugins/filter_dirt/filter_dirt.h @@ -62,12 +62,11 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual int getRequirements(QAction *); + virtual int getRequirements(const QAction*); virtual bool autoDialog(QAction *) {return true;} // virtual void initParameterSet(QAction* filter,MeshModel &,RichParameterSet &){}; virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); - virtual bool applyFilter(const QAction * /*filter */, MeshModel &, const RichParameterList & /*parent*/, vcg::CallBackPos *) { assert(0); return false;} ; virtual int postCondition(const QAction*) const; virtual FilterClass getClass (const QAction *) const; FILTER_ARITY filterArity(QAction*) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.cpp b/src/meshlabplugins/filter_fractal/filter_fractal.cpp index 0042b42d2..d9479855a 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.cpp +++ b/src/meshlabplugins/filter_fractal/filter_fractal.cpp @@ -353,7 +353,7 @@ MeshFilterInterface::FilterClass FilterFractal::getClass(const QAction* filter) } } -int FilterFractal::getRequirements(QAction *filter) +int FilterFractal::getRequirements(const QAction *filter) { switch(ID(filter)) { case CR_FRACTAL_TERRAIN: diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.h b/src/meshlabplugins/filter_fractal/filter_fractal.h index bca8fcd6d..b895ac7e6 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.h +++ b/src/meshlabplugins/filter_fractal/filter_fractal.h @@ -45,7 +45,7 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - int getRequirements(QAction *); + int getRequirements(const QAction*); void initParameterSet(QAction*, MeshModel&, RichParameterList &){assert(0);} void initParameterSet(QAction *, MeshDocument &, RichParameterList &); diff --git a/src/meshlabplugins/filter_func/filter_func.cpp b/src/meshlabplugins/filter_func/filter_func.cpp index 868b8662d..d857c32b0 100644 --- a/src/meshlabplugins/filter_func/filter_func.cpp +++ b/src/meshlabplugins/filter_func/filter_func.cpp @@ -224,7 +224,7 @@ int FilterFunctionPlugin::postCondition(const QAction *action) const return MeshModel::MM_NONE; } -int FilterFunctionPlugin::getRequirements(QAction *action) +int FilterFunctionPlugin::getRequirements(const QAction *action) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_func/filter_func.h b/src/meshlabplugins/filter_func/filter_func.h index 97eb31fbf..e1d245199 100644 --- a/src/meshlabplugins/filter_func/filter_func.h +++ b/src/meshlabplugins/filter_func/filter_func.h @@ -80,7 +80,7 @@ public: virtual FilterClass getClass(const QAction*) const; virtual int postCondition(const QAction *action) const; virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); - virtual int getRequirements(QAction *); + virtual int getRequirements(const QAction*); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(QAction* filter) const; diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp index 6c21ee211..f40477814 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp @@ -96,7 +96,7 @@ FilterGeodesic::FilterClass FilterGeodesic::getClass(const QAction *a) const return MeshFilterInterface::Generic; } -int FilterGeodesic::getRequirements(QAction *action) +int FilterGeodesic::getRequirements(const QAction *action) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.h b/src/meshlabplugins/filter_geodesic/filter_geodesic.h index 182d64710..c463d44cb 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.h +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.h @@ -55,7 +55,7 @@ class FilterGeodesic : public QObject, public MeshFilterInterface QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction*) const; - int getRequirements(QAction *); + int getRequirements(const QAction*); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); int postCondition(const QAction * filter) const; 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 460522b20..3b0bb5259 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 @@ -84,7 +84,7 @@ QString FilterImgPatchParamPlugin::filterInfo( FilterIDType id ) const } -int FilterImgPatchParamPlugin::getRequirements( QAction *act ) +int FilterImgPatchParamPlugin::getRequirements(const QAction *act ) { switch( ID(act) ) { 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 3c620248d..f8bb497ae 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 @@ -109,7 +109,7 @@ public: MeshDocument &md, RichParameterList &par ); - virtual int getRequirements( QAction *act ); + virtual int getRequirements(const QAction* act ); //virtual int postCondition( QAction *act ) const; virtual bool applyFilter(const QAction* act, diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp index 1f1c7bbf7..8c26ea628 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp @@ -95,7 +95,7 @@ QString FilterIsoParametrization::filterInfo(FilterIDType filterId) const return QString("error!"); } -int FilterIsoParametrization::getRequirements(QAction *) +int FilterIsoParametrization::getRequirements(const QAction *) { return MeshModel::MM_NONE; } diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h index 90cd5e637..8d63b176b 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h @@ -52,7 +52,7 @@ class FilterIsoParametrization : public QObject, public MeshFilterInterface virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual int getRequirements(QAction *); + virtual int getRequirements(const QAction*); virtual void initParameterSet(QAction *,MeshDocument&, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); diff --git a/src/meshlabplugins/filter_mls/mlsplugin.cpp b/src/meshlabplugins/filter_mls/mlsplugin.cpp index 93f8ba307..9783b6106 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.cpp +++ b/src/meshlabplugins/filter_mls/mlsplugin.cpp @@ -311,7 +311,7 @@ void MlsPlugin::initParameterSet(QAction* action, MeshDocument& md, RichParamete } } - int MlsPlugin::getRequirements(QAction *) + int MlsPlugin::getRequirements(const QAction *) { return 0; } diff --git a/src/meshlabplugins/filter_mls/mlsplugin.h b/src/meshlabplugins/filter_mls/mlsplugin.h index ab0ea8873..9c1df377a 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.h +++ b/src/meshlabplugins/filter_mls/mlsplugin.h @@ -67,7 +67,7 @@ public: virtual QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction *a) const; virtual void initParameterSet(QAction *,MeshDocument &md, RichParameterList &parent); - virtual int getRequirements(QAction *action); + virtual int getRequirements(const QAction* action); virtual bool applyFilter(const QAction* filter, MeshDocument &m, const RichParameterList &parent, vcg::CallBackPos *cb) ; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.cpp b/src/meshlabplugins/filter_sampling/filter_sampling.cpp index fced06b0b..fc67f240a 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.cpp +++ b/src/meshlabplugins/filter_sampling/filter_sampling.cpp @@ -427,7 +427,7 @@ QString FilterDocSampling::filterInfo(FilterIDType filterId) const default : assert(0); return QString("unknown filter!!!!"); } } -int FilterDocSampling::getRequirements(QAction *action) +int FilterDocSampling::getRequirements(const QAction *action) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.h b/src/meshlabplugins/filter_sampling/filter_sampling.h index 608ed1882..937a91a7d 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.h +++ b/src/meshlabplugins/filter_sampling/filter_sampling.h @@ -56,7 +56,7 @@ class FilterDocSampling : public QObject, public MeshFilterInterface QString filterInfo(FilterIDType filter) const; void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &m, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - int getRequirements(QAction *action); + int getRequirements(const QAction* action); int postCondition(const QAction* ) const; FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(QAction * filter) const; diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp index 73ea66015..edfd7e15f 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp @@ -88,7 +88,7 @@ MeshFilterInterface::FilterClass FilterScreenedPoissonPlugin::getClass(const QAc } } -int FilterScreenedPoissonPlugin::getRequirements(QAction* a) +int FilterScreenedPoissonPlugin::getRequirements(const QAction* a) { if (ID(a) == FP_SCREENED_POISSON) { return MeshModel::MM_NONE; diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h index eea152123..5c5f20e54 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h @@ -45,7 +45,7 @@ public: QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction* a) const; - int getRequirements(QAction* a); + int getRequirements(const QAction* a); bool applyFilter(const QAction* filter, MeshDocument& md, diff --git a/src/meshlabplugins/filter_sdfgpu/filterinterface.h b/src/meshlabplugins/filter_sdfgpu/filterinterface.h index e1f450d27..b1be4fb13 100644 --- a/src/meshlabplugins/filter_sdfgpu/filterinterface.h +++ b/src/meshlabplugins/filter_sdfgpu/filterinterface.h @@ -144,7 +144,7 @@ private: } // NOTE: Paolo informed that this will be killed sooner or later. // any behavior defined therein should be moved to getPostConditions() - int getRequirements(QAction* ){ + int getRequirements(const QAction* ){ return postConditions(); } int getPreConditions(QAction* ) const{ diff --git a/src/meshlabplugins/filter_select/meshselect.cpp b/src/meshlabplugins/filter_select/meshselect.cpp index b48fcbe77..a6ee06de0 100644 --- a/src/meshlabplugins/filter_select/meshselect.cpp +++ b/src/meshlabplugins/filter_select/meshselect.cpp @@ -686,7 +686,7 @@ MeshFilterInterface::FilterClass SelectionFilterPlugin::getClass(const QAction * return MeshFilterInterface::Selection; } - int SelectionFilterPlugin::getRequirements(QAction *action) + int SelectionFilterPlugin::getRequirements(const QAction *action) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_select/meshselect.h b/src/meshlabplugins/filter_select/meshselect.h index 33cea7870..f33dcb329 100644 --- a/src/meshlabplugins/filter_select/meshselect.h +++ b/src/meshlabplugins/filter_select/meshselect.h @@ -77,7 +77,7 @@ class SelectionFilterPlugin : public QObject, public MeshFilterInterface void initParameterSet(QAction *action, MeshModel &m, RichParameterList &parlst); int getPreConditions(QAction *) const; int postCondition(const QAction* ) const; - int getRequirements(QAction *); + int getRequirements(const QAction*); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp index ede27bfd3..0ad3556d6 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp @@ -107,7 +107,7 @@ bool FilterSSynth::applyFilter(const QAction* filter, MeshDocument &md, const R } } -int FilterSSynth::getRequirements(QAction *) +int FilterSSynth::getRequirements(const QAction *) { return MeshModel::MM_NONE; } diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.h b/src/meshlabplugins/filter_ssynth/filter_ssynth.h index 48f3bbbbf..b537888ca 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.h +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.h @@ -43,7 +43,7 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual int getRequirements(QAction *); + virtual int getRequirements(const QAction*); virtual void initParameterSet(QAction* /*filter*/,MeshModel &,RichParameterList &){}; virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); diff --git a/src/meshlabplugins/filter_texture/filter_texture.cpp b/src/meshlabplugins/filter_texture/filter_texture.cpp index 130f36dda..eaef69c72 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.cpp +++ b/src/meshlabplugins/filter_texture/filter_texture.cpp @@ -115,7 +115,7 @@ int FilterTexturePlugin::getPreConditions(QAction *a) const return MeshModel::MM_NONE; } -int FilterTexturePlugin::getRequirements(QAction *a) +int FilterTexturePlugin::getRequirements(const QAction *a) { switch (ID(a)) { diff --git a/src/meshlabplugins/filter_texture/filter_texture.h b/src/meshlabplugins/filter_texture/filter_texture.h index 025c78919..de1fcc97e 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.h +++ b/src/meshlabplugins/filter_texture/filter_texture.h @@ -60,7 +60,7 @@ public: virtual QString filterInfo(FilterIDType filter) const; virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); - virtual int getRequirements(QAction *); + virtual int getRequirements(const QAction*); virtual int getPreConditions(QAction *) const; virtual int postCondition(const QAction* ) const; FilterClass getClass(const QAction *a) const; diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp index 7683f2d57..9d9861854 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp @@ -138,7 +138,7 @@ QString TriOptimizePlugin::pluginName() const return {}; } - int TriOptimizePlugin::getRequirements(QAction *action) + int TriOptimizePlugin::getRequirements(const QAction *action) { switch (ID(action)) { case FP_PLANAR_EDGE_FLIP: diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h index 7b5a24e89..c54d129ba 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h @@ -49,7 +49,7 @@ public: QString filterInfo(FilterIDType filter) const; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList &/*parent*/, vcg::CallBackPos * cb) ; - int getRequirements(QAction *); + int getRequirements(const QAction*); FilterClass getClass(const QAction *); int postCondition(const QAction* ) const; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp index 48be62328..4e43bf965 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp @@ -280,7 +280,7 @@ int FilterUnsharp::postCondition(const QAction *a) const } } - int FilterUnsharp::getRequirements(QAction *action) + int FilterUnsharp::getRequirements(const QAction *action) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.h b/src/meshlabplugins/filter_unsharp/filter_unsharp.h index 0f8c9fa98..fd8a7b163 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.h +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.h @@ -71,7 +71,7 @@ class FilterUnsharp : public QObject, public MeshFilterInterface QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction*) const; - int getRequirements(QAction *); + int getRequirements(const QAction*); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; void initParameterSet(QAction *action, MeshDocument &/*m*/, RichParameterList & parlst); int postCondition(const QAction* ) const; From 30759b80fce12ebc35ae476383a23faa43d2d801 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 17 Sep 2020 14:56:04 +0200 Subject: [PATCH 23/49] getPreConditions const correctness --- src/common/interfaces.h | 2 +- src/meshlabplugins/filter_camera/filter_camera.cpp | 2 +- src/meshlabplugins/filter_camera/filter_camera.h | 2 +- src/meshlabplugins/filter_clean/cleanfilter.h | 2 +- src/meshlabplugins/filter_colorproc/filter_colorproc.cpp | 2 +- src/meshlabplugins/filter_colorproc/filter_colorproc.h | 2 +- src/meshlabplugins/filter_measure/filter_measure.cpp | 2 +- src/meshlabplugins/filter_measure/filter_measure.h | 2 +- src/meshlabplugins/filter_quality/filterqualitymapper.cpp | 2 +- src/meshlabplugins/filter_quality/filterqualitymapper.h | 2 +- src/meshlabplugins/filter_sample/filter_sample.cpp | 2 +- src/meshlabplugins/filter_sample/filter_sample.h | 2 +- src/meshlabplugins/filter_select/meshselect.cpp | 2 +- src/meshlabplugins/filter_select/meshselect.h | 2 +- src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp | 2 +- src/meshlabplugins/filter_sketchfab/filter_sketchfab.h | 2 +- src/meshlabplugins/filter_texture/filter_texture.cpp | 2 +- src/meshlabplugins/filter_texture/filter_texture.h | 2 +- src/meshlabplugins/filter_unsharp/filter_unsharp.cpp | 2 +- src/meshlabplugins/filter_unsharp/filter_unsharp.h | 2 +- src/meshlabplugins/filter_voronoi/filter_voronoi.cpp | 2 +- src/meshlabplugins/filter_voronoi/filter_voronoi.h | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/common/interfaces.h b/src/common/interfaces.h index f69aa73ae..cadf502da 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -362,7 +362,7 @@ public: // These conditions do NOT include computed properties like borderFlags, manifoldness or watertightness. // They are also used to grayout menus un-appliable entries. */ - virtual int getPreConditions(QAction *) const { return MeshModel::MM_NONE; } + virtual int getPreConditions(const QAction *) const { return MeshModel::MM_NONE; } /** Function used by the framework to get info about the mesh properties changed by the filter. // It is widely used by the meshlab's preview system. diff --git a/src/meshlabplugins/filter_camera/filter_camera.cpp b/src/meshlabplugins/filter_camera/filter_camera.cpp index 073999287..cab0fb04e 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.cpp +++ b/src/meshlabplugins/filter_camera/filter_camera.cpp @@ -728,7 +728,7 @@ FilterCameraPlugin::FilterClass FilterCameraPlugin::getClass(const QAction *a) c return MeshFilterInterface::Camera; } -int FilterCameraPlugin::getPreConditions( QAction * a) const +int FilterCameraPlugin::getPreConditions(const QAction * a) const { switch (ID(a)) { diff --git a/src/meshlabplugins/filter_camera/filter_camera.h b/src/meshlabplugins/filter_camera/filter_camera.h index d6e91d836..9142e0364 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.h +++ b/src/meshlabplugins/filter_camera/filter_camera.h @@ -46,7 +46,7 @@ public: FilterCameraPlugin(); QString pluginName() const; - int getPreConditions(QAction *) const; + int getPreConditions(const QAction*) const; int postCondition(const QAction* filter) const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; diff --git a/src/meshlabplugins/filter_clean/cleanfilter.h b/src/meshlabplugins/filter_clean/cleanfilter.h index a688c214c..00a48181f 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.h +++ b/src/meshlabplugins/filter_clean/cleanfilter.h @@ -70,7 +70,7 @@ public: virtual FilterClass getClass(const QAction*) const; virtual int getRequirements(const QAction*); int postCondition(const QAction* ) const; - int getPreConditions(QAction *) const { return MeshModel::MM_NONE; } + int getPreConditions(const QAction *) const { return MeshModel::MM_NONE; } virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp index b5d759db4..f7f9db918 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp @@ -986,7 +986,7 @@ int FilterColorProc::postCondition( const QAction* filter ) const return MeshModel::MM_NONE; } -int FilterColorProc::getPreConditions( QAction * filter ) const +int FilterColorProc::getPreConditions(const QAction* filter ) const { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.h b/src/meshlabplugins/filter_colorproc/filter_colorproc.h index 6e3606960..29fd88c8d 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.h +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.h @@ -77,7 +77,7 @@ public: virtual void initParameterSet(QAction *,MeshDocument&, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); int postCondition(const QAction* filter) const; - int getPreConditions(QAction *) const; + int getPreConditions(const QAction *) const; FILTER_ARITY filterArity(QAction *act) const; }; #endif diff --git a/src/meshlabplugins/filter_measure/filter_measure.cpp b/src/meshlabplugins/filter_measure/filter_measure.cpp index a29510409..7a06ffc45 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.cpp +++ b/src/meshlabplugins/filter_measure/filter_measure.cpp @@ -135,7 +135,7 @@ MeshFilterInterface::FILTER_ARITY FilterMeasurePlugin::filterArity(QAction*) con return SINGLE_MESH; } -int FilterMeasurePlugin::getPreConditions(QAction* action) const +int FilterMeasurePlugin::getPreConditions(const QAction* action) const { switch (ID(action)) { case PER_VERTEX_QUALITY_STAT: diff --git a/src/meshlabplugins/filter_measure/filter_measure.h b/src/meshlabplugins/filter_measure/filter_measure.h index 50ff6e421..878fb8270 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.h +++ b/src/meshlabplugins/filter_measure/filter_measure.h @@ -52,7 +52,7 @@ public: QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(QAction*) const; - int getPreConditions(QAction *action) const; + int getPreConditions(const QAction *action) const; void initParameterSet(QAction* , MeshModel& m, RichParameterList& parlst); bool applyFilter(const QAction* filter, MeshDocument& md, const RichParameterList& parlst, vcg::CallBackPos*) ; int postCondition(const QAction* ) const; diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp index 990345231..21abe0dae 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp @@ -179,7 +179,7 @@ bool QualityMapperFilter::applyFilter(const QAction *filter, MeshDocument &md, c return true; } -int QualityMapperFilter::getPreConditions( QAction * a) const +int QualityMapperFilter::getPreConditions(const QAction* a) const { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.h b/src/meshlabplugins/filter_quality/filterqualitymapper.h index cf076b900..0f4708e40 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.h +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.h @@ -72,7 +72,7 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - int getPreConditions(QAction *) const; + int getPreConditions(const QAction *) const; int postCondition(const QAction* ) const; virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; diff --git a/src/meshlabplugins/filter_sample/filter_sample.cpp b/src/meshlabplugins/filter_sample/filter_sample.cpp index 221feac21..06943f945 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.cpp +++ b/src/meshlabplugins/filter_sample/filter_sample.cpp @@ -107,7 +107,7 @@ MeshFilterInterface::FILTER_ARITY FilterSamplePlugin::filterArity(QAction*) cons * @brief FilterSamplePlugin::getPreConditions * @return */ -int FilterSamplePlugin::getPreConditions(QAction*) const +int FilterSamplePlugin::getPreConditions(const QAction*) const { return MeshModel::MM_NONE; } diff --git a/src/meshlabplugins/filter_sample/filter_sample.h b/src/meshlabplugins/filter_sample/filter_sample.h index e0ca73335..5f58ce033 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.h +++ b/src/meshlabplugins/filter_sample/filter_sample.h @@ -58,7 +58,7 @@ public: QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction* a) const; FILTER_ARITY filterArity(QAction *) const; - int getPreConditions(QAction *) const; + int getPreConditions(const QAction *) const; int postCondition(const QAction* ) const; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* action, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); diff --git a/src/meshlabplugins/filter_select/meshselect.cpp b/src/meshlabplugins/filter_select/meshselect.cpp index a6ee06de0..3d3a8c50d 100644 --- a/src/meshlabplugins/filter_select/meshselect.cpp +++ b/src/meshlabplugins/filter_select/meshselect.cpp @@ -735,7 +735,7 @@ int SelectionFilterPlugin::postCondition(const QAction *action) const return MeshModel::MM_ALL; } -int SelectionFilterPlugin::getPreConditions( QAction * action) const +int SelectionFilterPlugin::getPreConditions(const QAction * action) const { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_select/meshselect.h b/src/meshlabplugins/filter_select/meshselect.h index f33dcb329..4808a7f21 100644 --- a/src/meshlabplugins/filter_select/meshselect.h +++ b/src/meshlabplugins/filter_select/meshselect.h @@ -75,7 +75,7 @@ class SelectionFilterPlugin : public QObject, public MeshFilterInterface virtual FilterClass getClass(const QAction*) const; void initParameterSet(QAction *action, MeshModel &m, RichParameterList &parlst); - int getPreConditions(QAction *) const; + int getPreConditions(const QAction*) const; int postCondition(const QAction* ) const; int getRequirements(const QAction*); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp index 6566d09f2..67def5358 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp @@ -85,7 +85,7 @@ MeshFilterInterface::FILTER_ARITY FilterSketchFabPlugin::filterArity(QAction* a) } } -int FilterSketchFabPlugin::getPreConditions(QAction*) const +int FilterSketchFabPlugin::getPreConditions(const QAction*) const { return MeshModel::MM_NONE; } diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h index 8e7a0e51b..8b265e0f1 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h @@ -43,7 +43,7 @@ public: QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction* a) const; FILTER_ARITY filterArity(QAction *a) const; - int getPreConditions(QAction *) const; + int getPreConditions(const QAction*) const; int postCondition(const QAction* ) const; void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; diff --git a/src/meshlabplugins/filter_texture/filter_texture.cpp b/src/meshlabplugins/filter_texture/filter_texture.cpp index eaef69c72..8b3f0ebfe 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.cpp +++ b/src/meshlabplugins/filter_texture/filter_texture.cpp @@ -97,7 +97,7 @@ QString FilterTexturePlugin::filterInfo(FilterIDType filterId) const return QString("Unknown Filter"); } -int FilterTexturePlugin::getPreConditions(QAction *a) const +int FilterTexturePlugin::getPreConditions(const QAction *a) const { switch (ID(a)) { diff --git a/src/meshlabplugins/filter_texture/filter_texture.h b/src/meshlabplugins/filter_texture/filter_texture.h index de1fcc97e..b48731b78 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.h +++ b/src/meshlabplugins/filter_texture/filter_texture.h @@ -61,7 +61,7 @@ public: virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); virtual int getRequirements(const QAction*); - virtual int getPreConditions(QAction *) const; + virtual int getPreConditions(const QAction*) const; virtual int postCondition(const QAction* ) const; FilterClass getClass(const QAction *a) const; FILTER_ARITY filterArity(QAction * filter) const; diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp index 4e43bf965..ee9374c27 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp @@ -216,7 +216,7 @@ QString FilterUnsharp::filterInfo(FilterIDType filterId) const default : return MeshFilterInterface::Generic; } } -int FilterUnsharp::getPreConditions(QAction *a) const +int FilterUnsharp::getPreConditions(const QAction *a) const { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.h b/src/meshlabplugins/filter_unsharp/filter_unsharp.h index fd8a7b163..291355b43 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.h +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.h @@ -75,7 +75,7 @@ class FilterUnsharp : public QObject, public MeshFilterInterface bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; void initParameterSet(QAction *action, MeshDocument &/*m*/, RichParameterList & parlst); int postCondition(const QAction* ) const; - int getPreConditions(QAction *) const; + int getPreConditions(const QAction*) const; FILTER_ARITY filterArity(QAction * filter) const; }; diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp index a671e98ce..3ab99d350 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp @@ -194,7 +194,7 @@ void FilterVoronoiPlugin::initParameterSet(QAction* action, MeshModel& m, RichPa } } -int FilterVoronoiPlugin::getPreConditions(QAction* action) const +int FilterVoronoiPlugin::getPreConditions(const QAction* action) const { switch(ID(action)) { case VORONOI_SAMPLING : diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.h b/src/meshlabplugins/filter_voronoi/filter_voronoi.h index 9507d47e8..db2ba3cc4 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.h +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.h @@ -50,7 +50,7 @@ public: FilterClass getClass(const QAction* a) const; FILTER_ARITY filterArity(QAction* a) const; void initParameterSet(QAction* action, MeshModel& m, RichParameterList& par); - int getPreConditions(QAction* action) const; + int getPreConditions(const QAction* action) const; bool applyFilter(const QAction* action, MeshDocument& md, const RichParameterList& par, vcg::CallBackPos* cb) ; int postCondition(const QAction* ) const; From 21377899e8e628122660d280e94995b23aa22dc9 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 17 Sep 2020 15:09:53 +0200 Subject: [PATCH 24/49] renaming initParameterList and filterArity const correctness --- src/common/interfaces.cpp | 2 +- src/common/interfaces.h | 10 +++++----- src/common/pluginmanager.cpp | 2 +- src/meshlab/filterScriptDialog.cpp | 2 +- src/meshlab/ml_std_par_dialog.cpp | 4 ++-- src/meshlabplugins/filter_ao/filter_ao.cpp | 4 ++-- src/meshlabplugins/filter_ao/filter_ao.h | 4 ++-- src/meshlabplugins/filter_camera/filter_camera.cpp | 4 ++-- src/meshlabplugins/filter_camera/filter_camera.h | 4 ++-- src/meshlabplugins/filter_clean/cleanfilter.cpp | 2 +- src/meshlabplugins/filter_clean/cleanfilter.h | 4 ++-- .../filter_color_projection.cpp | 2 +- .../filter_color_projection/filter_color_projection.h | 4 ++-- .../filter_colorproc/filter_colorproc.cpp | 4 ++-- src/meshlabplugins/filter_colorproc/filter_colorproc.h | 4 ++-- src/meshlabplugins/filter_create/filter_create.cpp | 2 +- src/meshlabplugins/filter_create/filter_create.h | 4 ++-- .../filter_createiso/filter_createiso.cpp | 2 +- src/meshlabplugins/filter_createiso/filter_createiso.h | 4 ++-- src/meshlabplugins/filter_csg/filter_csg.cpp | 2 +- src/meshlabplugins/filter_csg/filter_csg.h | 6 +++--- src/meshlabplugins/filter_dirt/filter_dirt.cpp | 2 +- src/meshlabplugins/filter_dirt/filter_dirt.h | 4 ++-- src/meshlabplugins/filter_fractal/filter_fractal.cpp | 4 ++-- src/meshlabplugins/filter_fractal/filter_fractal.h | 6 +++--- src/meshlabplugins/filter_func/filter_func.cpp | 4 ++-- src/meshlabplugins/filter_func/filter_func.h | 4 ++-- src/meshlabplugins/filter_geodesic/filter_geodesic.cpp | 2 +- src/meshlabplugins/filter_geodesic/filter_geodesic.h | 4 ++-- .../filter_globalregistration/globalregistration.cpp | 2 +- .../filter_globalregistration/globalregistration.h | 4 ++-- .../filter_img_patch_param/filter_img_patch_param.cpp | 2 +- .../filter_img_patch_param/filter_img_patch_param.h | 4 ++-- .../filter_isoparametrization.cpp | 4 ++-- .../filter_isoparametrization.h | 4 ++-- src/meshlabplugins/filter_layer/filter_layer.cpp | 4 ++-- src/meshlabplugins/filter_layer/filter_layer.h | 4 ++-- src/meshlabplugins/filter_measure/filter_measure.cpp | 4 ++-- src/meshlabplugins/filter_measure/filter_measure.h | 4 ++-- src/meshlabplugins/filter_meshing/meshfilter.cpp | 2 +- src/meshlabplugins/filter_meshing/meshfilter.h | 4 ++-- src/meshlabplugins/filter_mls/mlsplugin.cpp | 2 +- src/meshlabplugins/filter_mls/mlsplugin.h | 4 ++-- .../filter_mutualglobal/filter_mutualglobal.cpp | 2 +- .../filter_mutualglobal/filter_mutualglobal.h | 4 ++-- .../filter_mutualinfo/filter_mutualinfo.cpp | 4 ++-- .../filter_mutualinfo/filter_mutualinfo.h | 4 ++-- src/meshlabplugins/filter_plymc/filter_plymc.cpp | 4 ++-- src/meshlabplugins/filter_plymc/filter_plymc.h | 4 ++-- src/meshlabplugins/filter_qhull/filter_qhull.cpp | 2 +- src/meshlabplugins/filter_qhull/filter_qhull.h | 4 ++-- .../filter_quality/filterqualitymapper.cpp | 2 +- .../filter_quality/filterqualitymapper.h | 4 ++-- src/meshlabplugins/filter_sample/filter_sample.cpp | 4 ++-- src/meshlabplugins/filter_sample/filter_sample.h | 4 ++-- .../filter_sample_dyn/filter_sample_dyn.cpp | 2 +- .../filter_sample_dyn/filter_sample_dyn.h | 4 ++-- .../filter_sample_gpu/filter_sample_gpu.cpp | 2 +- .../filter_sample_gpu/filter_sample_gpu.h | 4 ++-- src/meshlabplugins/filter_sampling/filter_sampling.cpp | 4 ++-- src/meshlabplugins/filter_sampling/filter_sampling.h | 4 ++-- .../filter_screened_poisson.cpp | 4 ++-- .../filter_screened_poisson/filter_screened_poisson.h | 4 ++-- src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp | 4 ++-- src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h | 4 ++-- src/meshlabplugins/filter_sdfgpu/filterinterface.h | 6 +++--- src/meshlabplugins/filter_select/meshselect.cpp | 2 +- src/meshlabplugins/filter_select/meshselect.h | 4 ++-- .../filter_sketchfab/filter_sketchfab.cpp | 4 ++-- src/meshlabplugins/filter_sketchfab/filter_sketchfab.h | 4 ++-- src/meshlabplugins/filter_ssynth/filter_ssynth.cpp | 2 +- src/meshlabplugins/filter_ssynth/filter_ssynth.h | 6 +++--- src/meshlabplugins/filter_texture/filter_texture.cpp | 4 ++-- src/meshlabplugins/filter_texture/filter_texture.h | 4 ++-- .../filter_trioptimize/filter_trioptimize.cpp | 2 +- .../filter_trioptimize/filter_trioptimize.h | 4 ++-- src/meshlabplugins/filter_unsharp/filter_unsharp.cpp | 4 ++-- src/meshlabplugins/filter_unsharp/filter_unsharp.h | 4 ++-- src/meshlabplugins/filter_voronoi/filter_voronoi.cpp | 4 ++-- src/meshlabplugins/filter_voronoi/filter_voronoi.h | 4 ++-- src/meshlabserver/mainserver.cpp | 2 +- 81 files changed, 146 insertions(+), 146 deletions(-) diff --git a/src/common/interfaces.cpp b/src/common/interfaces.cpp index b0ed5e11d..c73952de5 100644 --- a/src/common/interfaces.cpp +++ b/src/common/interfaces.cpp @@ -1,6 +1,6 @@ #include "interfaces.h" -bool MeshFilterInterface::isFilterApplicable(QAction *act, const MeshModel& m, QStringList &MissingItems) const +bool MeshFilterInterface::isFilterApplicable(const QAction* act, const MeshModel& m, QStringList &MissingItems) const { int preMask = getPreConditions(act); MissingItems.clear(); diff --git a/src/common/interfaces.h b/src/common/interfaces.h index cadf502da..5ef864066 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -388,7 +388,7 @@ public: For instance a colorize by quality filter cannot be applied to a mesh without per-vertex-quality. On failure (returning false) the function fills the MissingItems list with strings describing the missing items. */ - bool isFilterApplicable(QAction *act, const MeshModel& m, QStringList &MissingItems) const; + bool isFilterApplicable(const QAction *act, const MeshModel& m, QStringList &MissingItems) const; enum FILTER_ARITY { NONE = 0, SINGLE_MESH = 1, FIXED = 2, VARIABLE = 3, UNKNOWN_ARITY = 4 }; @@ -399,15 +399,15 @@ public: - FIXED: the number (and the names) of the meshes involved in the filter computation is determined by the parameters selected in the filter's parameters form - VARIABLE: the filter works on a not predetermined number of meshes. The meshes involved are typically selected by the user checking on the correspondent layer on the layer dialog */ - virtual FILTER_ARITY filterArity(QAction *act) const = 0; + virtual FILTER_ARITY filterArity(const QAction *act) const = 0; // This function is called to initialized the list of parameters. // it is always called. If a filter does not need parameter it leave it empty and the framework // will not create a dialog (unless for previewing) - virtual void initParameterSet(QAction *, MeshModel &/*m*/, RichParameterList & /*par*/) {} - virtual void initParameterSet(QAction *filter, MeshDocument &md, RichParameterList &par) + virtual void initParameterList(QAction *, MeshModel &/*m*/, RichParameterList & /*par*/) {} + virtual void initParameterList(QAction *filter, MeshDocument &md, RichParameterList &par) { - initParameterSet(filter, *(md.mm()), par); + initParameterList(filter, *(md.mm()), par); } /** \brief is invoked by the framework when the applyFilter fails to give some info to the user about the filter failure diff --git a/src/common/pluginmanager.cpp b/src/common/pluginmanager.cpp index 95a50c4a4..f4f37f448 100644 --- a/src/common/pluginmanager.cpp +++ b/src/common/pluginmanager.cpp @@ -188,7 +188,7 @@ QMap PluginManager::generateFilterParameterMap() QString filterName = ai.key();// ->filterName(); //QAction act(filterName,NULL); RichParameterList rp; - stringFilterMap[filterName]->initParameterSet(ai.value(), md, rp); + stringFilterMap[filterName]->initParameterList(ai.value(), md, rp); FPM[filterName] = rp; } return FPM; diff --git a/src/meshlab/filterScriptDialog.cpp b/src/meshlab/filterScriptDialog.cpp index fd4b3fbfd..0bf4fc5c9 100644 --- a/src/meshlab/filterScriptDialog.cpp +++ b/src/meshlab/filterScriptDialog.cpp @@ -220,7 +220,7 @@ void FilterScriptDialog::editOldParameters( const int row ) //fill the parameter set with all the names and descriptions which are lost in the //filter script RichParameterList newParameterSet; - iFilter->initParameterSet(action, *(mainWindow->meshDoc()), newParameterSet); + iFilter->initParameterList(action, *(mainWindow->meshDoc()), newParameterSet); if(newParameterSet.size() == oldParameterSet.size()) { RichParameterList::iterator i = newParameterSet.begin(); diff --git a/src/meshlab/ml_std_par_dialog.cpp b/src/meshlab/ml_std_par_dialog.cpp index 1eb5ec2aa..1a9d452e0 100644 --- a/src/meshlab/ml_std_par_dialog.cpp +++ b/src/meshlab/ml_std_par_dialog.cpp @@ -39,7 +39,7 @@ bool MeshlabStdDialog::showAutoDialog(MeshFilterInterface *mfi, MeshModel *mm, M curMeshDoc = mdp; curgla = gla; - mfi->initParameterSet(action, *mdp, curParSet); + mfi->initParameterList(action, *mdp, curParSet); curmask = mfi->postCondition(action); if (curParSet.isEmpty() && !isPreviewable()) return false; @@ -105,7 +105,7 @@ void MeshlabStdDialog::createFrame() void MeshlabStdDialog::resetValues() { curParSet.clear(); - curmfi->initParameterSet(curAction, *curMeshDoc, curParSet); + curmfi->initParameterList(curAction, *curMeshDoc, curParSet); assert(qf); assert(qf->isVisible()); diff --git a/src/meshlabplugins/filter_ao/filter_ao.cpp b/src/meshlabplugins/filter_ao/filter_ao.cpp index 76c504244..050d44e35 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.cpp +++ b/src/meshlabplugins/filter_ao/filter_ao.cpp @@ -97,7 +97,7 @@ int AmbientOcclusionPlugin::getRequirements(const QAction * /*action*/) return 0; } -MeshFilterInterface::FILTER_ARITY AmbientOcclusionPlugin::filterArity(QAction*) const +MeshFilterInterface::FILTER_ARITY AmbientOcclusionPlugin::filterArity(const QAction*) const { return SINGLE_MESH; } @@ -110,7 +110,7 @@ MeshFilterInterface::FilterClass AmbientOcclusionPlugin::getClass(const QAction //return MeshFilterInterface::FilterClass(MeshFilterInterface::FaceColoring | MeshFilterInterface::VertexColoring); }; -void AmbientOcclusionPlugin::initParameterSet(QAction *action, MeshModel & /*m*/, RichParameterList &parlst) +void AmbientOcclusionPlugin::initParameterList(QAction *action, MeshModel & /*m*/, RichParameterList &parlst) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_ao/filter_ao.h b/src/meshlabplugins/filter_ao/filter_ao.h index fbed311ea..520babfed 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.h +++ b/src/meshlabplugins/filter_ao/filter_ao.h @@ -71,11 +71,11 @@ public: QString pluginName() const; QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filterId) const; - FILTER_ARITY filterArity(QAction*) const; + FILTER_ARITY filterArity(const QAction*) const; int getRequirements (const QAction* action); FilterClass getClass(const QAction* filter) const; - void initParameterSet(QAction *,MeshModel &/*m*/,RichParameterList & /*parent*/); + void initParameterList(QAction *,MeshModel &/*m*/,RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; void initTextures(void); void initGL(vcg::CallBackPos *cb,unsigned int numVertices); diff --git a/src/meshlabplugins/filter_camera/filter_camera.cpp b/src/meshlabplugins/filter_camera/filter_camera.cpp index cab0fb04e..9e06899c4 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.cpp +++ b/src/meshlabplugins/filter_camera/filter_camera.cpp @@ -87,7 +87,7 @@ QString FilterCameraPlugin::filterInfo(FilterIDType filterId) const } // This function define the needed parameters for each filter. -void FilterCameraPlugin::initParameterSet(QAction *action, MeshDocument &/*m*/, RichParameterList & parlst) +void FilterCameraPlugin::initParameterList(QAction *action, MeshDocument &/*m*/, RichParameterList & parlst) { Shotf defShot; switch(ID(action)) @@ -747,7 +747,7 @@ int FilterCameraPlugin::getPreConditions(const QAction * a) const return 0; } -MeshFilterInterface::FILTER_ARITY FilterCameraPlugin::filterArity( QAction* act ) const +MeshFilterInterface::FILTER_ARITY FilterCameraPlugin::filterArity(const QAction* act ) const { switch (ID(act)) { diff --git a/src/meshlabplugins/filter_camera/filter_camera.h b/src/meshlabplugins/filter_camera/filter_camera.h index 9142e0364..00302f813 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.h +++ b/src/meshlabplugins/filter_camera/filter_camera.h @@ -51,9 +51,9 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; virtual FilterClass getClass(const QAction*) const; - virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - FILTER_ARITY filterArity(QAction* act) const; + FILTER_ARITY filterArity(const QAction* act) const; }; #endif diff --git a/src/meshlabplugins/filter_clean/cleanfilter.cpp b/src/meshlabplugins/filter_clean/cleanfilter.cpp index 68862645a..ce7ec13b2 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.cpp +++ b/src/meshlabplugins/filter_clean/cleanfilter.cpp @@ -222,7 +222,7 @@ int CleanFilter::postCondition(const QAction* action) const return MeshModel::MM_ALL; } -void CleanFilter::initParameterSet(QAction *action,MeshDocument &md, RichParameterList & parlst) +void CleanFilter::initParameterList(QAction *action,MeshDocument &md, RichParameterList & parlst) { pair qualityRange; switch(ID(action)) diff --git a/src/meshlabplugins/filter_clean/cleanfilter.h b/src/meshlabplugins/filter_clean/cleanfilter.h index 00a48181f..bb51ca925 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.h +++ b/src/meshlabplugins/filter_clean/cleanfilter.h @@ -71,9 +71,9 @@ public: virtual int getRequirements(const QAction*); int postCondition(const QAction* ) const; int getPreConditions(const QAction *) const { return MeshModel::MM_NONE; } - virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} + FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp index d5408a919..ed3818792 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp @@ -108,7 +108,7 @@ int FilterColorProjectionPlugin::getRequirements(const QAction *action){ // This function define the needed parameters for each filter. -void FilterColorProjectionPlugin::initParameterSet(QAction *action, MeshDocument &md, RichParameterList & parlst) +void FilterColorProjectionPlugin::initParameterList(QAction *action, MeshDocument &md, RichParameterList & parlst) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.h b/src/meshlabplugins/filter_color_projection/filter_color_projection.h index 47b9c78dd..29ce40457 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.h +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.h @@ -44,11 +44,11 @@ public: int postCondition( const QAction* ) const; virtual FilterClass getClass(const QAction*) const; - virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual int getRequirements(const QAction*); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); - FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} + FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} private: diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp index f7f9db918..d30e3f6f6 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp @@ -180,7 +180,7 @@ QString FilterColorProc::pluginName() const assert(0); } -void FilterColorProc::initParameterSet(QAction *a, MeshDocument& md, RichParameterList & par) +void FilterColorProc::initParameterList(QAction *a, MeshDocument& md, RichParameterList & par) { switch(ID(a)) { @@ -1022,7 +1022,7 @@ int FilterColorProc::getPreConditions(const QAction* filter ) const return MeshModel::MM_NONE; } -MeshFilterInterface::FILTER_ARITY FilterColorProc::filterArity( QAction *act ) const +MeshFilterInterface::FILTER_ARITY FilterColorProc::filterArity(const QAction* act ) const { switch(ID(act)) { diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.h b/src/meshlabplugins/filter_colorproc/filter_colorproc.h index 29fd88c8d..72ae03204 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.h +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.h @@ -74,10 +74,10 @@ public: virtual int getRequirements(const QAction*); - virtual void initParameterSet(QAction *,MeshDocument&, RichParameterList & /*parent*/); + virtual void initParameterList(QAction *,MeshDocument&, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); int postCondition(const QAction* filter) const; int getPreConditions(const QAction *) const; - FILTER_ARITY filterArity(QAction *act) const; + FILTER_ARITY filterArity(const QAction *act) const; }; #endif diff --git a/src/meshlabplugins/filter_create/filter_create.cpp b/src/meshlabplugins/filter_create/filter_create.cpp index f78584406..25559d13d 100644 --- a/src/meshlabplugins/filter_create/filter_create.cpp +++ b/src/meshlabplugins/filter_create/filter_create.cpp @@ -98,7 +98,7 @@ QString FilterCreate::filterInfo(FilterIDType filterId) const // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void FilterCreate::initParameterSet(QAction *action, MeshModel & /*m*/, RichParameterList & parlst) +void FilterCreate::initParameterList(QAction *action, MeshModel & /*m*/, RichParameterList & parlst) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_create/filter_create.h b/src/meshlabplugins/filter_create/filter_create.h index 4e0d78f76..55d249674 100644 --- a/src/meshlabplugins/filter_create/filter_create.h +++ b/src/meshlabplugins/filter_create/filter_create.h @@ -53,10 +53,10 @@ class FilterCreate : public QObject, public MeshFilterInterface QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction*) const; - void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; QString filterScriptFunctionName(FilterIDType filterID); - FILTER_ARITY filterArity(QAction *) const {return NONE;} + FILTER_ARITY filterArity(const QAction *) const {return NONE;} }; #endif diff --git a/src/meshlabplugins/filter_createiso/filter_createiso.cpp b/src/meshlabplugins/filter_createiso/filter_createiso.cpp index 44adf215b..e7c322ecb 100644 --- a/src/meshlabplugins/filter_createiso/filter_createiso.cpp +++ b/src/meshlabplugins/filter_createiso/filter_createiso.cpp @@ -126,7 +126,7 @@ QString FilterCreateIso::pluginName() const } return true; } - void FilterCreateIso::initParameterSet(QAction *action,MeshModel & /*m*/, RichParameterList & parlst) + void FilterCreateIso::initParameterList(QAction *action,MeshModel & /*m*/, RichParameterList & parlst) { pair qualityRange; switch(ID(action)) diff --git a/src/meshlabplugins/filter_createiso/filter_createiso.h b/src/meshlabplugins/filter_createiso/filter_createiso.h index 399780541..9129e0497 100644 --- a/src/meshlabplugins/filter_createiso/filter_createiso.h +++ b/src/meshlabplugins/filter_createiso/filter_createiso.h @@ -61,10 +61,10 @@ public: virtual FilterClass getClass(const QAction*) const; virtual int getRequirements(const QAction*); - virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - FILTER_ARITY filterArity(QAction*) const {return NONE;} + FILTER_ARITY filterArity(const QAction*) const {return NONE;} }; diff --git a/src/meshlabplugins/filter_csg/filter_csg.cpp b/src/meshlabplugins/filter_csg/filter_csg.cpp index 2654800c2..cd472d8c9 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.cpp +++ b/src/meshlabplugins/filter_csg/filter_csg.cpp @@ -74,7 +74,7 @@ QString FilterCSG::filterInfo(FilterIDType filterId) const } } -void FilterCSG::initParameterSet(QAction *action, MeshDocument & md, RichParameterList & parlst) +void FilterCSG::initParameterList(QAction *action, MeshDocument & md, RichParameterList & parlst) { switch (ID(action)) { case FP_CSG: diff --git a/src/meshlabplugins/filter_csg/filter_csg.h b/src/meshlabplugins/filter_csg/filter_csg.h index 52fe3adca..9e9a9e6a9 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.h +++ b/src/meshlabplugins/filter_csg/filter_csg.h @@ -59,13 +59,13 @@ public: virtual bool autoDialog(QAction *) { return true; } - virtual void initParameterSet(QAction *, MeshDocument &, RichParameterList &); - virtual void initParameterSet(QAction *, MeshModel &, RichParameterList &) { assert(0); } + virtual void initParameterList(QAction *, MeshDocument &, RichParameterList &); + virtual void initParameterList(QAction *, MeshModel &, RichParameterList &) { assert(0); } virtual bool applyFilter(const QAction*, MeshDocument &, const RichParameterList &, vcg::CallBackPos *); virtual FilterClass getClass(const QAction *) const { return MeshFilterInterface::FilterClass( MeshFilterInterface::Layer + MeshFilterInterface::Remeshing ); } - FILTER_ARITY filterArity(QAction*) const {return FIXED;} + FILTER_ARITY filterArity(const QAction*) const {return FIXED;} }; diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.cpp b/src/meshlabplugins/filter_dirt/filter_dirt.cpp index ad28e7745..c8d6bfc08 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.cpp +++ b/src/meshlabplugins/filter_dirt/filter_dirt.cpp @@ -99,7 +99,7 @@ QString FilterDirt::filterInfo(FilterIDType filterId) const } } -void FilterDirt::initParameterSet(QAction* filter,MeshDocument & /*md*/, RichParameterList &par){ +void FilterDirt::initParameterList(QAction* filter,MeshDocument & /*md*/, RichParameterList &par){ switch(ID(filter)){ diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.h b/src/meshlabplugins/filter_dirt/filter_dirt.h index e91133bbe..bb4f6843e 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.h +++ b/src/meshlabplugins/filter_dirt/filter_dirt.h @@ -65,11 +65,11 @@ public: virtual int getRequirements(const QAction*); virtual bool autoDialog(QAction *) {return true;} // virtual void initParameterSet(QAction* filter,MeshModel &,RichParameterSet &){}; - virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); virtual int postCondition(const QAction*) const; virtual FilterClass getClass (const QAction *) const; - FILTER_ARITY filterArity(QAction*) const {return SINGLE_MESH;} + FILTER_ARITY filterArity(const QAction*) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.cpp b/src/meshlabplugins/filter_fractal/filter_fractal.cpp index d9479855a..711643030 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.cpp +++ b/src/meshlabplugins/filter_fractal/filter_fractal.cpp @@ -165,7 +165,7 @@ QString FilterFractal::filterInfo(FilterIDType filterId) const return description; } -void FilterFractal::initParameterSet(QAction* filter,MeshDocument &md, RichParameterList &par) +void FilterFractal::initParameterList(QAction* filter,MeshDocument &md, RichParameterList &par) { switch(ID(filter)) { @@ -382,7 +382,7 @@ int FilterFractal::postCondition(const QAction *filter) const return MeshModel::MM_ALL; } -MeshFilterInterface::FILTER_ARITY FilterFractal::filterArity( QAction* act ) const +MeshFilterInterface::FILTER_ARITY FilterFractal::filterArity(const QAction* act ) const { switch(ID(act)) { diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.h b/src/meshlabplugins/filter_fractal/filter_fractal.h index b895ac7e6..e16b6cd5b 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.h +++ b/src/meshlabplugins/filter_fractal/filter_fractal.h @@ -46,14 +46,14 @@ public: QString filterInfo(FilterIDType filter) const; int getRequirements(const QAction*); - void initParameterSet(QAction*, MeshModel&, RichParameterList &){assert(0);} - void initParameterSet(QAction *, MeshDocument &, RichParameterList &); + void initParameterList(QAction*, MeshModel&, RichParameterList &){assert(0);} + void initParameterList(QAction *, MeshDocument &, RichParameterList &); bool applyFilter (const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); int postCondition(const QAction *action) const; FilterClass getClass(const QAction*) const; - FILTER_ARITY filterArity(QAction* act) const; + FILTER_ARITY filterArity(const QAction* act) const; private: void initParameterSetForFractalDisplacement (QAction *, MeshDocument &, RichParameterList &); void initParameterSetForCratersGeneration (MeshDocument &md, RichParameterList &par); diff --git a/src/meshlabplugins/filter_func/filter_func.cpp b/src/meshlabplugins/filter_func/filter_func.cpp index d857c32b0..deaa3fa2d 100644 --- a/src/meshlabplugins/filter_func/filter_func.cpp +++ b/src/meshlabplugins/filter_func/filter_func.cpp @@ -255,7 +255,7 @@ int FilterFunctionPlugin::getRequirements(const QAction *action) // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void FilterFunctionPlugin::initParameterSet(QAction *action,MeshModel &m, RichParameterList & parlst) +void FilterFunctionPlugin::initParameterList(QAction *action,MeshModel &m, RichParameterList & parlst) { Q_UNUSED(m); switch(ID(action)) { @@ -1433,7 +1433,7 @@ void FilterFunctionPlugin::setPerFaceVariables(Parser &p, CMeshO &m) } -MeshFilterInterface::FILTER_ARITY FilterFunctionPlugin::filterArity( QAction* filter ) const +MeshFilterInterface::FILTER_ARITY FilterFunctionPlugin::filterArity(const QAction* filter ) const { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_func/filter_func.h b/src/meshlabplugins/filter_func/filter_func.h index e1d245199..f4b0ebf7e 100644 --- a/src/meshlabplugins/filter_func/filter_func.h +++ b/src/meshlabplugins/filter_func/filter_func.h @@ -79,10 +79,10 @@ public: virtual QString filterInfo(FilterIDType filter) const; virtual FilterClass getClass(const QAction*) const; virtual int postCondition(const QAction *action) const; - virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); virtual int getRequirements(const QAction*); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - FILTER_ARITY filterArity(QAction* filter) const; + FILTER_ARITY filterArity(const QAction* filter) const; void showParserError(const QString &s, mu::Parser::exception_type &e); diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp index f40477814..dd077585f 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp @@ -233,7 +233,7 @@ bool FilterGeodesic::applyFilter(const QAction *filter, MeshDocument &md, const return true; } -void FilterGeodesic::initParameterSet(QAction *action,MeshModel &m, RichParameterList & parlst) +void FilterGeodesic::initParameterList(QAction *action,MeshModel &m, RichParameterList & parlst) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.h b/src/meshlabplugins/filter_geodesic/filter_geodesic.h index c463d44cb..287a2f43d 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.h +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.h @@ -57,9 +57,9 @@ class FilterGeodesic : public QObject, public MeshFilterInterface FilterClass getClass(const QAction*) const; int getRequirements(const QAction*); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); int postCondition(const QAction * filter) const; - FILTER_ARITY filterArity(QAction*) const {return SINGLE_MESH;} + FILTER_ARITY filterArity(const QAction*) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_globalregistration/globalregistration.cpp b/src/meshlabplugins/filter_globalregistration/globalregistration.cpp index eadee470e..dd4db09da 100644 --- a/src/meshlabplugins/filter_globalregistration/globalregistration.cpp +++ b/src/meshlabplugins/filter_globalregistration/globalregistration.cpp @@ -71,7 +71,7 @@ GlobalRegistrationPlugin::FilterClass GlobalRegistrationPlugin::getClass(const Q return MeshFilterInterface::Generic; } -void GlobalRegistrationPlugin::initParameterSet(QAction *action,MeshDocument &md, RichParameterList & parlst) +void GlobalRegistrationPlugin::initParameterList(QAction *action,MeshDocument &md, RichParameterList & parlst) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_globalregistration/globalregistration.h b/src/meshlabplugins/filter_globalregistration/globalregistration.h index e476b9f8d..0fe1ddcf3 100644 --- a/src/meshlabplugins/filter_globalregistration/globalregistration.h +++ b/src/meshlabplugins/filter_globalregistration/globalregistration.h @@ -41,11 +41,11 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - void initParameterSet(QAction *, MeshDocument &/*m*/, RichParameterList & /*parent*/); + void initParameterList(QAction *, MeshDocument &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction* ) const {return MeshModel::MM_VERTCOORD; } FilterClass getClass(const QAction* a) const; - FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} + FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; 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 3b0bb5259..26cd7f6c7 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 @@ -125,7 +125,7 @@ MeshFilterInterface::FilterClass FilterImgPatchParamPlugin::getClass(const QActi //} -void FilterImgPatchParamPlugin::initParameterSet( QAction *act, +void FilterImgPatchParamPlugin::initParameterList( QAction *act, MeshDocument &/*md*/, RichParameterList &par ) { 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 f8bb497ae..19196a225 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 @@ -105,7 +105,7 @@ public: virtual FilterClass getClass(const QAction* act ) const; - virtual void initParameterSet( QAction *act, + virtual void initParameterList( QAction *act, MeshDocument &md, RichParameterList &par ); @@ -117,7 +117,7 @@ public: const RichParameterList &par, vcg::CallBackPos *cb ); - FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} + FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp index 8c26ea628..c209fced2 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp @@ -100,7 +100,7 @@ int FilterIsoParametrization::getRequirements(const QAction *) return MeshModel::MM_NONE; } -void FilterIsoParametrization::initParameterSet(QAction *a, MeshDocument& md, RichParameterList & par) +void FilterIsoParametrization::initParameterList(QAction *a, MeshDocument& md, RichParameterList & par) { switch(ID(a)) @@ -463,7 +463,7 @@ int FilterIsoParametrization::postCondition(const QAction* /*filter*/ ) const return MeshModel::MM_WEDGTEXCOORD | MeshModel::MM_VERTTEXCOORD; } -MeshFilterInterface::FILTER_ARITY FilterIsoParametrization::filterArity( QAction* filter) const +MeshFilterInterface::FILTER_ARITY FilterIsoParametrization::filterArity(const QAction* filter) const { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h index 8d63b176b..76f6c0f1a 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h @@ -54,11 +54,11 @@ class FilterIsoParametrization : public QObject, public MeshFilterInterface virtual int getRequirements(const QAction*); - virtual void initParameterSet(QAction *,MeshDocument&, RichParameterList & /*parent*/); + virtual void initParameterList(QAction *,MeshDocument&, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); int postCondition(const QAction* filter) const; void PrintStats(CMeshO *mesh); - FILTER_ARITY filterArity(QAction*) const; + FILTER_ARITY filterArity(const QAction*) const; }; #endif diff --git a/src/meshlabplugins/filter_layer/filter_layer.cpp b/src/meshlabplugins/filter_layer/filter_layer.cpp index c6e7af8f5..76d748c21 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.cpp +++ b/src/meshlabplugins/filter_layer/filter_layer.cpp @@ -113,7 +113,7 @@ QString FilterLayerPlugin::filterInfo(FilterIDType filterId) const } // This function define the needed parameters for each filter. -void FilterLayerPlugin::initParameterSet(QAction *action, MeshDocument &md, RichParameterList & parlst) +void FilterLayerPlugin::initParameterList(QAction *action, MeshDocument &md, RichParameterList & parlst) { MeshModel *mm=md.mm(); RasterModel *rm=md.rm(); @@ -860,7 +860,7 @@ FilterLayerPlugin::FilterClass FilterLayerPlugin::getClass(const QAction *a) con return MeshFilterInterface::Generic; } -MeshFilterInterface::FILTER_ARITY FilterLayerPlugin::filterArity( QAction* filter) const +MeshFilterInterface::FILTER_ARITY FilterLayerPlugin::filterArity(const QAction* filter) const { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_layer/filter_layer.h b/src/meshlabplugins/filter_layer/filter_layer.h index 11a8013ae..17434de90 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.h +++ b/src/meshlabplugins/filter_layer/filter_layer.h @@ -59,10 +59,10 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; virtual FilterClass getClass(const QAction*) const; - virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction *filter) const; - FILTER_ARITY filterArity(QAction*) const; + FILTER_ARITY filterArity(const QAction*) const; }; #endif diff --git a/src/meshlabplugins/filter_measure/filter_measure.cpp b/src/meshlabplugins/filter_measure/filter_measure.cpp index 7a06ffc45..f1d09adbf 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.cpp +++ b/src/meshlabplugins/filter_measure/filter_measure.cpp @@ -130,7 +130,7 @@ FilterMeasurePlugin::FilterClass FilterMeasurePlugin::getClass(const QAction *) return MeshFilterInterface::Measure; } -MeshFilterInterface::FILTER_ARITY FilterMeasurePlugin::filterArity(QAction*) const +MeshFilterInterface::FILTER_ARITY FilterMeasurePlugin::filterArity(const QAction*) const { return SINGLE_MESH; } @@ -151,7 +151,7 @@ int FilterMeasurePlugin::getPreConditions(const QAction* action) const } } -void FilterMeasurePlugin::initParameterSet(QAction *action, MeshModel &m, RichParameterList & parlst) +void FilterMeasurePlugin::initParameterList(QAction *action, MeshModel &m, RichParameterList & parlst) { switch (ID(action)) { case PER_VERTEX_QUALITY_HISTOGRAM: diff --git a/src/meshlabplugins/filter_measure/filter_measure.h b/src/meshlabplugins/filter_measure/filter_measure.h index 878fb8270..0cd41750d 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.h +++ b/src/meshlabplugins/filter_measure/filter_measure.h @@ -51,9 +51,9 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction*) const; - FILTER_ARITY filterArity(QAction*) const; + FILTER_ARITY filterArity(const QAction*) const; int getPreConditions(const QAction *action) const; - void initParameterSet(QAction* , MeshModel& m, RichParameterList& parlst); + void initParameterList(QAction* , MeshModel& m, RichParameterList& parlst); bool applyFilter(const QAction* filter, MeshDocument& md, const RichParameterList& parlst, vcg::CallBackPos*) ; int postCondition(const QAction* ) const; diff --git a/src/meshlabplugins/filter_meshing/meshfilter.cpp b/src/meshlabplugins/filter_meshing/meshfilter.cpp index 987a33ef5..7670dab52 100644 --- a/src/meshlabplugins/filter_meshing/meshfilter.cpp +++ b/src/meshlabplugins/filter_meshing/meshfilter.cpp @@ -342,7 +342,7 @@ QString ExtraMeshFilterPlugin::filterInfo(FilterIDType filterID) const // return // true if has some parameters // false is has no params -void ExtraMeshFilterPlugin::initParameterSet(QAction * action, MeshModel & m, RichParameterList & parlst) +void ExtraMeshFilterPlugin::initParameterList(QAction * action, MeshModel & m, RichParameterList & parlst) { float maxVal; QStringList curvCalcMethods; diff --git a/src/meshlabplugins/filter_meshing/meshfilter.h b/src/meshlabplugins/filter_meshing/meshfilter.h index 3384a9224..eacd34eeb 100644 --- a/src/meshlabplugins/filter_meshing/meshfilter.h +++ b/src/meshlabplugins/filter_meshing/meshfilter.h @@ -88,11 +88,11 @@ public: QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction*) const; - void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction *filter) const; int getPreCondition(QAction *filter) const; - FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} + FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} protected: diff --git a/src/meshlabplugins/filter_mls/mlsplugin.cpp b/src/meshlabplugins/filter_mls/mlsplugin.cpp index 9783b6106..59ccf2cc3 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.cpp +++ b/src/meshlabplugins/filter_mls/mlsplugin.cpp @@ -175,7 +175,7 @@ return QString("Filter Unknown"); // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void MlsPlugin::initParameterSet(QAction* action, MeshDocument& md, RichParameterList& parlst) +void MlsPlugin::initParameterList(QAction* action, MeshDocument& md, RichParameterList& parlst) { int id = ID(action); MeshModel *target = md.mm(); diff --git a/src/meshlabplugins/filter_mls/mlsplugin.h b/src/meshlabplugins/filter_mls/mlsplugin.h index 9c1df377a..99e688ad6 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.h +++ b/src/meshlabplugins/filter_mls/mlsplugin.h @@ -66,10 +66,10 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction *a) const; - virtual void initParameterSet(QAction *,MeshDocument &md, RichParameterList &parent); + virtual void initParameterList(QAction *,MeshDocument &md, RichParameterList &parent); virtual int getRequirements(const QAction* action); virtual bool applyFilter(const QAction* filter, MeshDocument &m, const RichParameterList &parent, vcg::CallBackPos *cb) ; - FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} + FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; #endif diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp index e6b336483..2bbaa9590 100644 --- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp +++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp @@ -101,7 +101,7 @@ FilterMutualGlobal::FilterClass FilterMutualGlobal::getClass(const QAction *a) c // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void FilterMutualGlobal::initParameterSet(QAction *action,MeshDocument & md, RichParameterList & parlst) +void FilterMutualGlobal::initParameterList(QAction *action,MeshDocument & md, RichParameterList & parlst) { QStringList rendList; switch(ID(action)) { diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h index 352921e1e..316d39c8c 100644 --- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h +++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h @@ -54,7 +54,7 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - void initParameterSet(QAction *,MeshDocument & md, RichParameterList & /*parent*/); + void initParameterList(QAction *,MeshDocument & md, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction*) const { return MeshModel::MM_NONE; }; FilterClass getClass(const QAction* a) const; @@ -69,7 +69,7 @@ public: bool allActive(SubGraph graph); bool UpdateGraph(MeshDocument &md, SubGraph graph, int n); float calcShotsDifference(MeshDocument &md, std::vector oldShots, std::vector points); - FILTER_ARITY filterArity(QAction *) const { return SINGLE_MESH; } + FILTER_ARITY filterArity(const QAction *) const { return SINGLE_MESH; } diff --git a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp index 2317d7fa5..306061ff4 100644 --- a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp +++ b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp @@ -80,12 +80,12 @@ FilterMutualInfoPlugin::FilterClass FilterMutualInfoPlugin::getClass(const QActi } } -MeshFilterInterface::FILTER_ARITY FilterMutualInfoPlugin::filterArity(QAction*) const +MeshFilterInterface::FILTER_ARITY FilterMutualInfoPlugin::filterArity(const QAction*) const { return SINGLE_MESH; } -void FilterMutualInfoPlugin::initParameterSet(QAction *action,MeshDocument & /*md*/, RichParameterList & parlst) +void FilterMutualInfoPlugin::initParameterList(QAction *action,MeshDocument & /*md*/, RichParameterList & parlst) { QStringList rendList; rendList.push_back("Combined"); diff --git a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h index 80a59040f..011e59579 100644 --- a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h +++ b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h @@ -46,8 +46,8 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction* a) const; - FILTER_ARITY filterArity(QAction *) const; - void initParameterSet(QAction *, MeshDocument &, RichParameterList & /*parent*/); + FILTER_ARITY filterArity(const QAction*) const; + void initParameterList(QAction *, MeshDocument &, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction*) const; diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.cpp b/src/meshlabplugins/filter_plymc/filter_plymc.cpp index ec45d0880..ae4751cb5 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.cpp +++ b/src/meshlabplugins/filter_plymc/filter_plymc.cpp @@ -100,7 +100,7 @@ QString PlyMCPlugin::pluginName() const // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void PlyMCPlugin::initParameterSet(QAction *action,MeshModel &m, RichParameterList & parlst) +void PlyMCPlugin::initParameterList(QAction *action,MeshModel &m, RichParameterList & parlst) { switch(ID(action)) { @@ -246,7 +246,7 @@ bool PlyMCPlugin::applyFilter(const QAction *filter, MeshDocument &md, const Ric return true; } -MeshFilterInterface::FILTER_ARITY PlyMCPlugin::filterArity( QAction * filter ) const +MeshFilterInterface::FILTER_ARITY PlyMCPlugin::filterArity(const QAction * filter ) const { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.h b/src/meshlabplugins/filter_plymc/filter_plymc.h index 199639ad6..5af1e7b1d 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.h +++ b/src/meshlabplugins/filter_plymc/filter_plymc.h @@ -43,10 +43,10 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FilterClass getClass(const QAction* a) const; - MeshFilterInterface::FILTER_ARITY filterArity(QAction * filter) const; + MeshFilterInterface::FILTER_ARITY filterArity(const QAction* filter) const; int postCondition(const QAction *filter) const; }; diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.cpp b/src/meshlabplugins/filter_qhull/filter_qhull.cpp index baff4f9e3..c360d2b1d 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.cpp +++ b/src/meshlabplugins/filter_qhull/filter_qhull.cpp @@ -135,7 +135,7 @@ QString QhullPlugin::pluginName() const // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void QhullPlugin::initParameterSet(QAction *action,MeshModel &m, RichParameterList & parlst) +void QhullPlugin::initParameterList(QAction *action,MeshModel &m, RichParameterList & parlst) { switch(ID(action)) { case FP_QHULL_CONVEX_HULL : diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.h b/src/meshlabplugins/filter_qhull/filter_qhull.h index f0fe15075..c09e579f0 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.h +++ b/src/meshlabplugins/filter_qhull/filter_qhull.h @@ -58,10 +58,10 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &m, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; virtual FilterClass getClass(const QAction*) const; - FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} + FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; #endif diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp index 21abe0dae..8c944901f 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp @@ -86,7 +86,7 @@ QString QualityMapperFilter::pluginName() const // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void QualityMapperFilter::initParameterSet(QAction *action,MeshModel &m, RichParameterList & parlst) +void QualityMapperFilter::initParameterList(QAction *action,MeshModel &m, RichParameterList & parlst) { switch(ID(action)) { case FP_QUALITY_MAPPER : diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.h b/src/meshlabplugins/filter_quality/filterqualitymapper.h index 0f4708e40..b9e4ca872 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.h +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.h @@ -74,10 +74,10 @@ public: virtual QString filterInfo(FilterIDType filter) const; int getPreConditions(const QAction *) const; int postCondition(const QAction* ) const; - virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; virtual FilterClass getClass(const QAction*) const; - FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} + FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; #endif diff --git a/src/meshlabplugins/filter_sample/filter_sample.cpp b/src/meshlabplugins/filter_sample/filter_sample.cpp index 06943f945..f8b620d6f 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.cpp +++ b/src/meshlabplugins/filter_sample/filter_sample.cpp @@ -98,7 +98,7 @@ FilterSamplePlugin::FilterClass FilterSamplePlugin::getClass(const QAction *a) c * @brief FilterSamplePlugin::filterArity * @return */ -MeshFilterInterface::FILTER_ARITY FilterSamplePlugin::filterArity(QAction*) const +MeshFilterInterface::FILTER_ARITY FilterSamplePlugin::filterArity(const QAction*) const { return SINGLE_MESH; } @@ -133,7 +133,7 @@ int FilterSamplePlugin::postCondition(const QAction*) const * @param m * @param parlst */ -void FilterSamplePlugin::initParameterSet(QAction *action,MeshModel &m, RichParameterList & parlst) +void FilterSamplePlugin::initParameterList(QAction *action,MeshModel &m, RichParameterList & parlst) { switch(ID(action)) { case FP_MOVE_VERTEX : diff --git a/src/meshlabplugins/filter_sample/filter_sample.h b/src/meshlabplugins/filter_sample/filter_sample.h index 5f58ce033..a388fecf8 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.h +++ b/src/meshlabplugins/filter_sample/filter_sample.h @@ -57,10 +57,10 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction* a) const; - FILTER_ARITY filterArity(QAction *) const; + FILTER_ARITY filterArity(const QAction*) const; int getPreConditions(const QAction *) const; int postCondition(const QAction* ) const; - void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* action, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); private: diff --git a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp index d87d83d23..68e8ad84f 100644 --- a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp +++ b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp @@ -93,7 +93,7 @@ QString ExtraSampleDynPlugin::filterName(FilterIDType filterId) const // when the user press apply the current stored state is updated. // when the user press close the mesh state is restored to the one before the startup of the filter. -void ExtraSampleDynPlugin::initParameterSet(QAction *action,MeshModel &/*m*/, RichParameterList & parlst) +void ExtraSampleDynPlugin::initParameterList(QAction *action,MeshModel &/*m*/, RichParameterList & parlst) { switch(ID(action)) { case FP_VERTEX_COLOR_NOISE : diff --git a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h index 24dc477a3..9ee634d08 100644 --- a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h +++ b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h @@ -42,11 +42,11 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); virtual int postCondition(const QAction* ) const {return MeshModel::MM_VERTCOLOR;}; virtual bool applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; virtual FilterClass getClass(const QAction*) const; - FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} + FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; #endif diff --git a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp index 60af09113..1a55714b0 100644 --- a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp +++ b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp @@ -87,7 +87,7 @@ ExtraSampleGPUPlugin::FilterClass ExtraSampleGPUPlugin::getClass(const QAction * // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void ExtraSampleGPUPlugin::initParameterSet(QAction * action, MeshModel & m, RichParameterList & parlst) +void ExtraSampleGPUPlugin::initParameterList(QAction * action, MeshModel & m, RichParameterList & parlst) { (void)m; diff --git a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h index 7eea9b47b..91a8a0b05 100644 --- a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h +++ b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h @@ -50,8 +50,8 @@ public: ExtraSampleGPUPlugin(); QString pluginName() const; - FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} - void initParameterSet(QAction *action,MeshModel &m, RichParameterList & parlst); + FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} + void initParameterList(QAction *action,MeshModel &m, RichParameterList & parlst); QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.cpp b/src/meshlabplugins/filter_sampling/filter_sampling.cpp index fc67f240a..33585889f 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.cpp +++ b/src/meshlabplugins/filter_sampling/filter_sampling.cpp @@ -460,7 +460,7 @@ int FilterDocSampling::getRequirements(const QAction *action) // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void FilterDocSampling::initParameterSet(QAction *action, MeshDocument & md, RichParameterList & parlst) +void FilterDocSampling::initParameterList(QAction *action, MeshDocument & md, RichParameterList & parlst) { switch(ID(action)) { case FP_MONTECARLO_SAMPLING : @@ -1396,7 +1396,7 @@ int FilterDocSampling::postCondition(const QAction* a ) const return MeshModel::MM_ALL; } -MeshFilterInterface::FILTER_ARITY FilterDocSampling::filterArity( QAction * filter ) const +MeshFilterInterface::FILTER_ARITY FilterDocSampling::filterArity(const QAction * filter ) const { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.h b/src/meshlabplugins/filter_sampling/filter_sampling.h index 937a91a7d..358737dc7 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.h +++ b/src/meshlabplugins/filter_sampling/filter_sampling.h @@ -54,12 +54,12 @@ class FilterDocSampling : public QObject, public MeshFilterInterface QString pluginName() const; QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &m, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int getRequirements(const QAction* action); int postCondition(const QAction* ) const; FilterClass getClass(const QAction*) const; - FILTER_ARITY filterArity(QAction * filter) const; + FILTER_ARITY filterArity(const QAction* filter) const; }; #endif diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp index edfd7e15f..cf1129fcd 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp @@ -193,7 +193,7 @@ bool FilterScreenedPoissonPlugin::applyFilter(const QAction* filter, MeshDocumen return false; } -void FilterScreenedPoissonPlugin::initParameterSet( +void FilterScreenedPoissonPlugin::initParameterList( QAction* filter, MeshModel&, RichParameterList& parlist) @@ -223,7 +223,7 @@ int FilterScreenedPoissonPlugin::postCondition(const QAction* filter) const } -MeshFilterInterface::FILTER_ARITY FilterScreenedPoissonPlugin::filterArity(QAction*) const +MeshFilterInterface::FILTER_ARITY FilterScreenedPoissonPlugin::filterArity(const QAction*) const { return VARIABLE; } diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h index 5c5f20e54..fa2bcfb0d 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h @@ -52,9 +52,9 @@ public: const RichParameterList& params, vcg::CallBackPos* cb) ; - void initParameterSet(QAction* a, MeshModel&, RichParameterList& parlist); + void initParameterList(QAction* a, MeshModel&, RichParameterList& parlist); int postCondition(const QAction* filter) const; - FILTER_ARITY filterArity(QAction*) const; + FILTER_ARITY filterArity(const QAction*) const; }; diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp index 91dd3d48d..fb7076c0a 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp @@ -39,7 +39,7 @@ QString SdfGpuPlugin::pluginName() const return "FilterSDFGPU"; } -void SdfGpuPlugin::initParameterSet(QAction *action, MeshModel &/*m*/, RichParameterList &par) +void SdfGpuPlugin::initParameterList(QAction *action, MeshModel &/*m*/, RichParameterList &par) { mAction = ID(action); QStringList onPrimitive; onPrimitive.push_back("On vertices"); onPrimitive.push_back("On Faces"); @@ -1095,7 +1095,7 @@ void SdfGpuPlugin::TraceRay(int peelingIteration,const Point3f& dir, MeshModel* checkGLError::debugInfo("Error during depth peeling"); } -MeshFilterInterface::FILTER_ARITY SdfGpuPlugin::filterArity( QAction *) const +MeshFilterInterface::FILTER_ARITY SdfGpuPlugin::filterArity(const QAction *) const { return MeshFilterInterface::SINGLE_MESH; } diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h index e586c212f..053f032f1 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h @@ -34,13 +34,13 @@ public: return MeshFilterInterface::VertexColoring; } - FILTER_ARITY filterArity(QAction *act) const; + FILTER_ARITY filterArity(const QAction* act) const; //Main plugin function bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); //Parameters init for user interface - virtual void initParameterSet(QAction *action, MeshModel &m, RichParameterList &parlst); + virtual void initParameterList(QAction *action, MeshModel &m, RichParameterList &parlst); //Draw the mesh void fillFrameBuffer(bool front, MeshModel* mm); diff --git a/src/meshlabplugins/filter_sdfgpu/filterinterface.h b/src/meshlabplugins/filter_sdfgpu/filterinterface.h index b1be4fb13..c14c20d25 100644 --- a/src/meshlabplugins/filter_sdfgpu/filterinterface.h +++ b/src/meshlabplugins/filter_sdfgpu/filterinterface.h @@ -91,7 +91,7 @@ public: * parameter set according to your mesh document (data dependent parameters). A GUI will be * automatically designed according to this parameters. */ - virtual void initParameterSet(MeshDocument &, RichParameterList &){ qDebug() << "HERE2!"; } + virtual void initParameterList(MeshDocument &, RichParameterList &){ qDebug() << "HERE2!"; } /** * @brief The implementation of the filter algorithm @@ -156,8 +156,8 @@ private: bool applyFilter(const QAction *, MeshDocument &md, const RichParameterList& par, vcg::CallBackPos * cb){ return applyFilter(md, par, cb); } - virtual void initParameterSet(QAction *, MeshDocument &md, RichParameterList &par){ - initParameterSet(md,par); + virtual void initParameterList(QAction *, MeshDocument &md, RichParameterList &par){ + initParameterList(md,par); } }; diff --git a/src/meshlabplugins/filter_select/meshselect.cpp b/src/meshlabplugins/filter_select/meshselect.cpp index 3d3a8c50d..5d92e4273 100644 --- a/src/meshlabplugins/filter_select/meshselect.cpp +++ b/src/meshlabplugins/filter_select/meshselect.cpp @@ -189,7 +189,7 @@ QString SelectionFilterPlugin::filterInfo(FilterIDType filterId) const return QString("Unknown filter"); } -void SelectionFilterPlugin::initParameterSet(QAction *action, MeshModel &m, RichParameterList &parlst) +void SelectionFilterPlugin::initParameterList(QAction *action, MeshModel &m, RichParameterList &parlst) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_select/meshselect.h b/src/meshlabplugins/filter_select/meshselect.h index 4808a7f21..967847dd4 100644 --- a/src/meshlabplugins/filter_select/meshselect.h +++ b/src/meshlabplugins/filter_select/meshselect.h @@ -74,12 +74,12 @@ class SelectionFilterPlugin : public QObject, public MeshFilterInterface virtual QString filterName(FilterIDType filter) const; virtual FilterClass getClass(const QAction*) const; - void initParameterSet(QAction *action, MeshModel &m, RichParameterList &parlst); + void initParameterList(QAction *action, MeshModel &m, RichParameterList &parlst); int getPreConditions(const QAction*) const; int postCondition(const QAction* ) const; int getRequirements(const QAction*); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} + FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; #endif diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp index 67def5358..281fe4a24 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp @@ -75,7 +75,7 @@ FilterSketchFabPlugin::FilterClass FilterSketchFabPlugin::getClass(const QAction } } -MeshFilterInterface::FILTER_ARITY FilterSketchFabPlugin::filterArity(QAction* a) const +MeshFilterInterface::FILTER_ARITY FilterSketchFabPlugin::filterArity(const QAction* a) const { switch(ID(a)) { case FP_SKETCHFAB : @@ -95,7 +95,7 @@ int FilterSketchFabPlugin::postCondition(const QAction*) const return MeshModel::MM_NONE; } -void FilterSketchFabPlugin::initParameterSet(QAction* action, MeshModel&, RichParameterList& parlst) +void FilterSketchFabPlugin::initParameterList(QAction* action, MeshModel&, RichParameterList& parlst) { QSettings settings; QVariant v = settings.value("SketchFab Code"); diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h index 8b265e0f1..90d4536ee 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h @@ -42,10 +42,10 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction* a) const; - FILTER_ARITY filterArity(QAction *a) const; + FILTER_ARITY filterArity(const QAction* a) const; int getPreConditions(const QAction*) const; int postCondition(const QAction* ) const; - void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; public slots: diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp index 0ad3556d6..9035e8ffa 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp @@ -57,7 +57,7 @@ QString FilterSSynth::filterInfo(FilterIDType filterId) const } } -void FilterSSynth::initParameterSet(QAction* /*filter*/,MeshDocument &/*md*/, RichParameterList &par) +void FilterSSynth::initParameterList(QAction* /*filter*/,MeshDocument &/*md*/, RichParameterList &par) { par.addParam(RichString("grammar","set maxdepth 40 R1 R2 rule R1 { { x 1 rz 6 ry 6 s 0.99 } R1 { s 2 } sphere } rule R2 {{ x -1 rz 6 ry 6 s 0.99 } R2 { s 2 } sphere} ","Eisen Script grammar","Write a grammar according to Eisen Script specification and using the primitives box, sphere, mesh, dot and triangle ")); par.addParam(RichInt("seed",1,"seed for random construction","Seed needed to build the mesh")); diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.h b/src/meshlabplugins/filter_ssynth/filter_ssynth.h index b537888ca..30a0a4de6 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.h +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.h @@ -44,8 +44,8 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; virtual int getRequirements(const QAction*); - virtual void initParameterSet(QAction* /*filter*/,MeshModel &,RichParameterList &){}; - virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(QAction* /*filter*/,MeshModel &,RichParameterList &){}; + virtual void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); virtual FilterClass getClass(const QAction* filter) const; void setAttributes(CMeshO::VertexIterator &vi, CMeshO &m); @@ -58,7 +58,7 @@ public: void initPreOpenParameter(const QString &formatName, const QString &filename, RichParameterList &parlst); bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList & par, vcg::CallBackPos *cb=0, QWidget *parent=0); bool save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterList &, vcg::CallBackPos *cb, QWidget *parent); - MeshFilterInterface::FILTER_ARITY filterArity(QAction *) const {return NONE;} + MeshFilterInterface::FILTER_ARITY filterArity(const QAction *) const {return NONE;} private: QString ssynth(QString grammar,int maxdepth,int seed,vcg::CallBackPos *cb); QString GetTemplate(int sphereres); diff --git a/src/meshlabplugins/filter_texture/filter_texture.cpp b/src/meshlabplugins/filter_texture/filter_texture.cpp index 8b3f0ebfe..54ddbdfb1 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.cpp +++ b/src/meshlabplugins/filter_texture/filter_texture.cpp @@ -185,7 +185,7 @@ static QString extractFilenameWOExt(MeshModel* mm) // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void FilterTexturePlugin::initParameterSet(QAction *action, MeshDocument &md, RichParameterList & parlst) +void FilterTexturePlugin::initParameterList(QAction *action, MeshDocument &md, RichParameterList & parlst) { switch(ID(action)) { case FP_VORONOI_ATLAS : @@ -1109,7 +1109,7 @@ bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, c return true; } -MeshFilterInterface::FILTER_ARITY FilterTexturePlugin::filterArity( QAction * filter ) const +MeshFilterInterface::FILTER_ARITY FilterTexturePlugin::filterArity(const QAction * filter ) const { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_texture/filter_texture.h b/src/meshlabplugins/filter_texture/filter_texture.h index b48731b78..c589f5806 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.h +++ b/src/meshlabplugins/filter_texture/filter_texture.h @@ -58,13 +58,13 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); virtual int getRequirements(const QAction*); virtual int getPreConditions(const QAction*) const; virtual int postCondition(const QAction* ) const; FilterClass getClass(const QAction *a) const; - FILTER_ARITY filterArity(QAction * filter) const; + FILTER_ARITY filterArity(const QAction* filter) const; }; #endif diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp index 9d9861854..2db08b73a 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp @@ -201,7 +201,7 @@ int TriOptimizePlugin::postCondition(const QAction *a) const // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void TriOptimizePlugin::initParameterSet(QAction *action, MeshModel &m, RichParameterList & parlst) +void TriOptimizePlugin::initParameterList(QAction *action, MeshModel &m, RichParameterList & parlst) { if (ID(action) == FP_CURVATURE_EDGE_FLIP) { parlst.addParam(RichBool("selection", m.cm.sfn > 0, tr("Update selection"), tr("Apply edge flip optimization on selected faces only"))); diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h index c54d129ba..98b180213 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h @@ -47,12 +47,12 @@ public: QString pluginName() const; QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - void initParameterSet(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList &/*parent*/, vcg::CallBackPos * cb) ; int getRequirements(const QAction*); FilterClass getClass(const QAction *); int postCondition(const QAction* ) const; - FILTER_ARITY filterArity(QAction *) const {return SINGLE_MESH;} + FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp index ee9374c27..9fca4ba2c 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp @@ -312,7 +312,7 @@ int FilterUnsharp::postCondition(const QAction *a) const return MeshModel::MM_NONE; } -void FilterUnsharp::initParameterSet(QAction *action, MeshDocument &md, RichParameterList & parlst) +void FilterUnsharp::initParameterList(QAction *action, MeshDocument &md, RichParameterList & parlst) { switch(ID(action)) { @@ -785,7 +785,7 @@ bool FilterUnsharp::applyFilter(const QAction *filter, MeshDocument &md, const R return true; } -MeshFilterInterface::FILTER_ARITY FilterUnsharp::filterArity( QAction * filter ) const +MeshFilterInterface::FILTER_ARITY FilterUnsharp::filterArity(const QAction * filter ) const { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.h b/src/meshlabplugins/filter_unsharp/filter_unsharp.h index 291355b43..e06ff1028 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.h +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.h @@ -73,10 +73,10 @@ class FilterUnsharp : public QObject, public MeshFilterInterface FilterClass getClass(const QAction*) const; int getRequirements(const QAction*); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - void initParameterSet(QAction *action, MeshDocument &/*m*/, RichParameterList & parlst); + void initParameterList(QAction *action, MeshDocument &/*m*/, RichParameterList & parlst); int postCondition(const QAction* ) const; int getPreConditions(const QAction*) const; - FILTER_ARITY filterArity(QAction * filter) const; + FILTER_ARITY filterArity(const QAction* filter) const; }; diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp index 3ab99d350..842b2496f 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp @@ -114,7 +114,7 @@ FilterVoronoiPlugin::FilterClass FilterVoronoiPlugin::getClass(const QAction* a) } } -MeshFilterInterface::FILTER_ARITY FilterVoronoiPlugin::filterArity(QAction* a) const +MeshFilterInterface::FILTER_ARITY FilterVoronoiPlugin::filterArity(const QAction* a) const { switch(ID(a)) { case VORONOI_SAMPLING : @@ -131,7 +131,7 @@ MeshFilterInterface::FILTER_ARITY FilterVoronoiPlugin::filterArity(QAction* a) c } } -void FilterVoronoiPlugin::initParameterSet(QAction* action, MeshModel& m, RichParameterList& par) +void FilterVoronoiPlugin::initParameterList(QAction* action, MeshModel& m, RichParameterList& par) { switch(ID(action)) { case VORONOI_SAMPLING : diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.h b/src/meshlabplugins/filter_voronoi/filter_voronoi.h index db2ba3cc4..807bbc89d 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.h +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.h @@ -48,8 +48,8 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction* a) const; - FILTER_ARITY filterArity(QAction* a) const; - void initParameterSet(QAction* action, MeshModel& m, RichParameterList& par); + FILTER_ARITY filterArity(const QAction* a) const; + void initParameterList(QAction* action, MeshModel& m, RichParameterList& par); int getPreConditions(const QAction* action) const; bool applyFilter(const QAction* action, MeshDocument& md, const RichParameterList& par, vcg::CallBackPos* cb) ; int postCondition(const QAction* ) const; diff --git a/src/meshlabserver/mainserver.cpp b/src/meshlabserver/mainserver.cpp index 90e70d98e..a4078493c 100644 --- a/src/meshlabserver/mainserver.cpp +++ b/src/meshlabserver/mainserver.cpp @@ -596,7 +596,7 @@ public: //So we have to ask to the filter the default values for all the parameters and integrate them with the parameters' values //defined in the script file. RichParameterList required; - iFilter->initParameterSet(action,meshDocument,required); + iFilter->initParameterList(action,meshDocument,required); RichParameterList ¶meterSet = pair.second; //The parameters in the script file are more than the required parameters of the filter. The script file is not correct. From 80a9647d050b41006f87324387de15fc44e6da9e Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 17 Sep 2020 15:30:28 +0200 Subject: [PATCH 25/49] initParameterList const correctness --- src/common/interfaces.h | 4 ++-- src/meshlabplugins/filter_ao/filter_ao.cpp | 2 +- src/meshlabplugins/filter_ao/filter_ao.h | 2 +- src/meshlabplugins/filter_camera/filter_camera.cpp | 2 +- src/meshlabplugins/filter_camera/filter_camera.h | 2 +- src/meshlabplugins/filter_clean/cleanfilter.cpp | 2 +- src/meshlabplugins/filter_clean/cleanfilter.h | 2 +- .../filter_color_projection/filter_color_projection.cpp | 2 +- .../filter_color_projection/filter_color_projection.h | 2 +- src/meshlabplugins/filter_colorproc/filter_colorproc.cpp | 2 +- src/meshlabplugins/filter_colorproc/filter_colorproc.h | 2 +- src/meshlabplugins/filter_create/filter_create.cpp | 2 +- src/meshlabplugins/filter_create/filter_create.h | 2 +- src/meshlabplugins/filter_createiso/filter_createiso.cpp | 2 +- src/meshlabplugins/filter_createiso/filter_createiso.h | 2 +- src/meshlabplugins/filter_csg/filter_csg.cpp | 2 +- src/meshlabplugins/filter_csg/filter_csg.h | 3 +-- src/meshlabplugins/filter_dirt/filter_dirt.cpp | 2 +- src/meshlabplugins/filter_dirt/filter_dirt.h | 2 +- src/meshlabplugins/filter_fractal/filter_fractal.cpp | 2 +- src/meshlabplugins/filter_fractal/filter_fractal.h | 3 +-- src/meshlabplugins/filter_func/filter_func.cpp | 2 +- src/meshlabplugins/filter_func/filter_func.h | 2 +- src/meshlabplugins/filter_geodesic/filter_geodesic.cpp | 2 +- src/meshlabplugins/filter_geodesic/filter_geodesic.h | 2 +- .../filter_globalregistration/globalregistration.cpp | 2 +- .../filter_globalregistration/globalregistration.h | 2 +- .../filter_img_patch_param/filter_img_patch_param.cpp | 2 +- .../filter_img_patch_param/filter_img_patch_param.h | 2 +- .../filter_isoparametrization/filter_isoparametrization.cpp | 2 +- .../filter_isoparametrization/filter_isoparametrization.h | 2 +- src/meshlabplugins/filter_layer/filter_layer.cpp | 2 +- src/meshlabplugins/filter_layer/filter_layer.h | 2 +- src/meshlabplugins/filter_measure/filter_measure.cpp | 2 +- src/meshlabplugins/filter_measure/filter_measure.h | 2 +- src/meshlabplugins/filter_meshing/meshfilter.cpp | 2 +- src/meshlabplugins/filter_meshing/meshfilter.h | 2 +- src/meshlabplugins/filter_mls/mlsplugin.cpp | 2 +- src/meshlabplugins/filter_mls/mlsplugin.h | 2 +- .../filter_mutualglobal/filter_mutualglobal.cpp | 2 +- src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h | 2 +- src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp | 2 +- src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h | 2 +- src/meshlabplugins/filter_plymc/filter_plymc.cpp | 2 +- src/meshlabplugins/filter_plymc/filter_plymc.h | 2 +- src/meshlabplugins/filter_qhull/filter_qhull.cpp | 2 +- src/meshlabplugins/filter_qhull/filter_qhull.h | 2 +- src/meshlabplugins/filter_quality/filterqualitymapper.cpp | 2 +- src/meshlabplugins/filter_quality/filterqualitymapper.h | 2 +- src/meshlabplugins/filter_sample/filter_sample.cpp | 2 +- src/meshlabplugins/filter_sample/filter_sample.h | 2 +- src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp | 2 +- src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h | 2 +- src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp | 2 +- src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h | 2 +- src/meshlabplugins/filter_sampling/filter_sampling.cpp | 2 +- src/meshlabplugins/filter_sampling/filter_sampling.h | 2 +- .../filter_screened_poisson/filter_screened_poisson.cpp | 2 +- .../filter_screened_poisson/filter_screened_poisson.h | 2 +- src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp | 2 +- src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h | 2 +- src/meshlabplugins/filter_sdfgpu/filterinterface.h | 4 ++-- src/meshlabplugins/filter_select/meshselect.cpp | 2 +- src/meshlabplugins/filter_select/meshselect.h | 2 +- src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp | 2 +- src/meshlabplugins/filter_sketchfab/filter_sketchfab.h | 2 +- src/meshlabplugins/filter_ssynth/filter_ssynth.cpp | 2 +- src/meshlabplugins/filter_ssynth/filter_ssynth.h | 4 ++-- src/meshlabplugins/filter_texture/filter_texture.cpp | 2 +- src/meshlabplugins/filter_texture/filter_texture.h | 2 +- src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp | 2 +- src/meshlabplugins/filter_trioptimize/filter_trioptimize.h | 2 +- src/meshlabplugins/filter_unsharp/filter_unsharp.cpp | 2 +- src/meshlabplugins/filter_unsharp/filter_unsharp.h | 2 +- src/meshlabplugins/filter_voronoi/filter_voronoi.cpp | 2 +- src/meshlabplugins/filter_voronoi/filter_voronoi.h | 2 +- 76 files changed, 79 insertions(+), 81 deletions(-) diff --git a/src/common/interfaces.h b/src/common/interfaces.h index 5ef864066..c6a95c87f 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -404,8 +404,8 @@ public: // This function is called to initialized the list of parameters. // it is always called. If a filter does not need parameter it leave it empty and the framework // will not create a dialog (unless for previewing) - virtual void initParameterList(QAction *, MeshModel &/*m*/, RichParameterList & /*par*/) {} - virtual void initParameterList(QAction *filter, MeshDocument &md, RichParameterList &par) + virtual void initParameterList(const QAction *, MeshModel &/*m*/, RichParameterList & /*par*/) {} + virtual void initParameterList(const QAction *filter, MeshDocument &md, RichParameterList &par) { initParameterList(filter, *(md.mm()), par); } diff --git a/src/meshlabplugins/filter_ao/filter_ao.cpp b/src/meshlabplugins/filter_ao/filter_ao.cpp index 050d44e35..8607fd328 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.cpp +++ b/src/meshlabplugins/filter_ao/filter_ao.cpp @@ -110,7 +110,7 @@ MeshFilterInterface::FilterClass AmbientOcclusionPlugin::getClass(const QAction //return MeshFilterInterface::FilterClass(MeshFilterInterface::FaceColoring | MeshFilterInterface::VertexColoring); }; -void AmbientOcclusionPlugin::initParameterList(QAction *action, MeshModel & /*m*/, RichParameterList &parlst) +void AmbientOcclusionPlugin::initParameterList(const QAction *action, MeshModel & /*m*/, RichParameterList &parlst) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_ao/filter_ao.h b/src/meshlabplugins/filter_ao/filter_ao.h index 520babfed..c1554946f 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.h +++ b/src/meshlabplugins/filter_ao/filter_ao.h @@ -75,7 +75,7 @@ public: int getRequirements (const QAction* action); FilterClass getClass(const QAction* filter) const; - void initParameterList(QAction *,MeshModel &/*m*/,RichParameterList & /*parent*/); + void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; void initTextures(void); void initGL(vcg::CallBackPos *cb,unsigned int numVertices); diff --git a/src/meshlabplugins/filter_camera/filter_camera.cpp b/src/meshlabplugins/filter_camera/filter_camera.cpp index 9e06899c4..a2d2c65a8 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.cpp +++ b/src/meshlabplugins/filter_camera/filter_camera.cpp @@ -87,7 +87,7 @@ QString FilterCameraPlugin::filterInfo(FilterIDType filterId) const } // This function define the needed parameters for each filter. -void FilterCameraPlugin::initParameterList(QAction *action, MeshDocument &/*m*/, RichParameterList & parlst) +void FilterCameraPlugin::initParameterList(const QAction *action, MeshDocument &/*m*/, RichParameterList & parlst) { Shotf defShot; switch(ID(action)) diff --git a/src/meshlabplugins/filter_camera/filter_camera.h b/src/meshlabplugins/filter_camera/filter_camera.h index 00302f813..2fd89f42b 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.h +++ b/src/meshlabplugins/filter_camera/filter_camera.h @@ -51,7 +51,7 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; virtual FilterClass getClass(const QAction*) const; - virtual void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(const QAction* act) const; }; diff --git a/src/meshlabplugins/filter_clean/cleanfilter.cpp b/src/meshlabplugins/filter_clean/cleanfilter.cpp index ce7ec13b2..f2f5d75a9 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.cpp +++ b/src/meshlabplugins/filter_clean/cleanfilter.cpp @@ -222,7 +222,7 @@ int CleanFilter::postCondition(const QAction* action) const return MeshModel::MM_ALL; } -void CleanFilter::initParameterList(QAction *action,MeshDocument &md, RichParameterList & parlst) +void CleanFilter::initParameterList(const QAction *action,MeshDocument &md, RichParameterList & parlst) { pair qualityRange; switch(ID(action)) diff --git a/src/meshlabplugins/filter_clean/cleanfilter.h b/src/meshlabplugins/filter_clean/cleanfilter.h index bb51ca925..84aea1b2c 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.h +++ b/src/meshlabplugins/filter_clean/cleanfilter.h @@ -71,7 +71,7 @@ public: virtual int getRequirements(const QAction*); int postCondition(const QAction* ) const; int getPreConditions(const QAction *) const { return MeshModel::MM_NONE; } - virtual void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp index ed3818792..12513d3e0 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp @@ -108,7 +108,7 @@ int FilterColorProjectionPlugin::getRequirements(const QAction *action){ // This function define the needed parameters for each filter. -void FilterColorProjectionPlugin::initParameterList(QAction *action, MeshDocument &md, RichParameterList & parlst) +void FilterColorProjectionPlugin::initParameterList(const QAction *action, MeshDocument &md, RichParameterList & parlst) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.h b/src/meshlabplugins/filter_color_projection/filter_color_projection.h index 29ce40457..7cf9d8166 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.h +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.h @@ -44,7 +44,7 @@ public: int postCondition( const QAction* ) const; virtual FilterClass getClass(const QAction*) const; - virtual void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual int getRequirements(const QAction*); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp index d30e3f6f6..ca41d5650 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp @@ -180,7 +180,7 @@ QString FilterColorProc::pluginName() const assert(0); } -void FilterColorProc::initParameterList(QAction *a, MeshDocument& md, RichParameterList & par) +void FilterColorProc::initParameterList(const QAction *a, MeshDocument& md, RichParameterList & par) { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.h b/src/meshlabplugins/filter_colorproc/filter_colorproc.h index 72ae03204..9c5239b1e 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.h +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.h @@ -74,7 +74,7 @@ public: virtual int getRequirements(const QAction*); - virtual void initParameterList(QAction *,MeshDocument&, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction*, MeshDocument&, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); int postCondition(const QAction* filter) const; int getPreConditions(const QAction *) const; diff --git a/src/meshlabplugins/filter_create/filter_create.cpp b/src/meshlabplugins/filter_create/filter_create.cpp index 25559d13d..f12a65dd0 100644 --- a/src/meshlabplugins/filter_create/filter_create.cpp +++ b/src/meshlabplugins/filter_create/filter_create.cpp @@ -98,7 +98,7 @@ QString FilterCreate::filterInfo(FilterIDType filterId) const // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void FilterCreate::initParameterList(QAction *action, MeshModel & /*m*/, RichParameterList & parlst) +void FilterCreate::initParameterList(const QAction *action, MeshModel & /*m*/, RichParameterList & parlst) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_create/filter_create.h b/src/meshlabplugins/filter_create/filter_create.h index 55d249674..515b2ef14 100644 --- a/src/meshlabplugins/filter_create/filter_create.h +++ b/src/meshlabplugins/filter_create/filter_create.h @@ -53,7 +53,7 @@ class FilterCreate : public QObject, public MeshFilterInterface QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction*) const; - void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; QString filterScriptFunctionName(FilterIDType filterID); FILTER_ARITY filterArity(const QAction *) const {return NONE;} diff --git a/src/meshlabplugins/filter_createiso/filter_createiso.cpp b/src/meshlabplugins/filter_createiso/filter_createiso.cpp index e7c322ecb..54b69e1fc 100644 --- a/src/meshlabplugins/filter_createiso/filter_createiso.cpp +++ b/src/meshlabplugins/filter_createiso/filter_createiso.cpp @@ -126,7 +126,7 @@ QString FilterCreateIso::pluginName() const } return true; } - void FilterCreateIso::initParameterList(QAction *action,MeshModel & /*m*/, RichParameterList & parlst) + void FilterCreateIso::initParameterList(const QAction *action,MeshModel & /*m*/, RichParameterList & parlst) { pair qualityRange; switch(ID(action)) diff --git a/src/meshlabplugins/filter_createiso/filter_createiso.h b/src/meshlabplugins/filter_createiso/filter_createiso.h index 9129e0497..7a31ce26f 100644 --- a/src/meshlabplugins/filter_createiso/filter_createiso.h +++ b/src/meshlabplugins/filter_createiso/filter_createiso.h @@ -61,7 +61,7 @@ public: virtual FilterClass getClass(const QAction*) const; virtual int getRequirements(const QAction*); - virtual void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(const QAction*) const {return NONE;} diff --git a/src/meshlabplugins/filter_csg/filter_csg.cpp b/src/meshlabplugins/filter_csg/filter_csg.cpp index cd472d8c9..d14c1b4f2 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.cpp +++ b/src/meshlabplugins/filter_csg/filter_csg.cpp @@ -74,7 +74,7 @@ QString FilterCSG::filterInfo(FilterIDType filterId) const } } -void FilterCSG::initParameterList(QAction *action, MeshDocument & md, RichParameterList & parlst) +void FilterCSG::initParameterList(const QAction *action, MeshDocument & md, RichParameterList & parlst) { switch (ID(action)) { case FP_CSG: diff --git a/src/meshlabplugins/filter_csg/filter_csg.h b/src/meshlabplugins/filter_csg/filter_csg.h index 9e9a9e6a9..9f1a12b2b 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.h +++ b/src/meshlabplugins/filter_csg/filter_csg.h @@ -59,8 +59,7 @@ public: virtual bool autoDialog(QAction *) { return true; } - virtual void initParameterList(QAction *, MeshDocument &, RichParameterList &); - virtual void initParameterList(QAction *, MeshModel &, RichParameterList &) { assert(0); } + virtual void initParameterList(const QAction*, MeshDocument &, RichParameterList &); virtual bool applyFilter(const QAction*, MeshDocument &, const RichParameterList &, vcg::CallBackPos *); diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.cpp b/src/meshlabplugins/filter_dirt/filter_dirt.cpp index c8d6bfc08..f1b648343 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.cpp +++ b/src/meshlabplugins/filter_dirt/filter_dirt.cpp @@ -99,7 +99,7 @@ QString FilterDirt::filterInfo(FilterIDType filterId) const } } -void FilterDirt::initParameterList(QAction* filter,MeshDocument & /*md*/, RichParameterList &par){ +void FilterDirt::initParameterList(const QAction* filter,MeshDocument & /*md*/, RichParameterList &par){ switch(ID(filter)){ diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.h b/src/meshlabplugins/filter_dirt/filter_dirt.h index bb4f6843e..984fed86c 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.h +++ b/src/meshlabplugins/filter_dirt/filter_dirt.h @@ -65,7 +65,7 @@ public: virtual int getRequirements(const QAction*); virtual bool autoDialog(QAction *) {return true;} // virtual void initParameterSet(QAction* filter,MeshModel &,RichParameterSet &){}; - virtual void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); virtual int postCondition(const QAction*) const; virtual FilterClass getClass (const QAction *) const; diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.cpp b/src/meshlabplugins/filter_fractal/filter_fractal.cpp index 711643030..4edd267ae 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.cpp +++ b/src/meshlabplugins/filter_fractal/filter_fractal.cpp @@ -165,7 +165,7 @@ QString FilterFractal::filterInfo(FilterIDType filterId) const return description; } -void FilterFractal::initParameterList(QAction* filter,MeshDocument &md, RichParameterList &par) +void FilterFractal::initParameterList(const QAction* filter,MeshDocument &md, RichParameterList &par) { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.h b/src/meshlabplugins/filter_fractal/filter_fractal.h index e16b6cd5b..e24ec928d 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.h +++ b/src/meshlabplugins/filter_fractal/filter_fractal.h @@ -46,8 +46,7 @@ public: QString filterInfo(FilterIDType filter) const; int getRequirements(const QAction*); - void initParameterList(QAction*, MeshModel&, RichParameterList &){assert(0);} - void initParameterList(QAction *, MeshDocument &, RichParameterList &); + void initParameterList(const QAction*, MeshDocument &, RichParameterList &); bool applyFilter (const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); diff --git a/src/meshlabplugins/filter_func/filter_func.cpp b/src/meshlabplugins/filter_func/filter_func.cpp index deaa3fa2d..f7885987f 100644 --- a/src/meshlabplugins/filter_func/filter_func.cpp +++ b/src/meshlabplugins/filter_func/filter_func.cpp @@ -255,7 +255,7 @@ int FilterFunctionPlugin::getRequirements(const QAction *action) // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void FilterFunctionPlugin::initParameterList(QAction *action,MeshModel &m, RichParameterList & parlst) +void FilterFunctionPlugin::initParameterList(const QAction *action,MeshModel &m, RichParameterList & parlst) { Q_UNUSED(m); switch(ID(action)) { diff --git a/src/meshlabplugins/filter_func/filter_func.h b/src/meshlabplugins/filter_func/filter_func.h index f4b0ebf7e..de37f49b4 100644 --- a/src/meshlabplugins/filter_func/filter_func.h +++ b/src/meshlabplugins/filter_func/filter_func.h @@ -79,7 +79,7 @@ public: virtual QString filterInfo(FilterIDType filter) const; virtual FilterClass getClass(const QAction*) const; virtual int postCondition(const QAction *action) const; - virtual void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); virtual int getRequirements(const QAction*); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(const QAction* filter) const; diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp index dd077585f..eb7d2c604 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp @@ -233,7 +233,7 @@ bool FilterGeodesic::applyFilter(const QAction *filter, MeshDocument &md, const return true; } -void FilterGeodesic::initParameterList(QAction *action,MeshModel &m, RichParameterList & parlst) +void FilterGeodesic::initParameterList(const QAction *action,MeshModel &m, RichParameterList & parlst) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.h b/src/meshlabplugins/filter_geodesic/filter_geodesic.h index 287a2f43d..78aadfbe4 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.h +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.h @@ -57,7 +57,7 @@ class FilterGeodesic : public QObject, public MeshFilterInterface FilterClass getClass(const QAction*) const; int getRequirements(const QAction*); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); int postCondition(const QAction * filter) const; FILTER_ARITY filterArity(const QAction*) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_globalregistration/globalregistration.cpp b/src/meshlabplugins/filter_globalregistration/globalregistration.cpp index dd4db09da..97d6118c6 100644 --- a/src/meshlabplugins/filter_globalregistration/globalregistration.cpp +++ b/src/meshlabplugins/filter_globalregistration/globalregistration.cpp @@ -71,7 +71,7 @@ GlobalRegistrationPlugin::FilterClass GlobalRegistrationPlugin::getClass(const Q return MeshFilterInterface::Generic; } -void GlobalRegistrationPlugin::initParameterList(QAction *action,MeshDocument &md, RichParameterList & parlst) +void GlobalRegistrationPlugin::initParameterList(const QAction *action,MeshDocument &md, RichParameterList & parlst) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_globalregistration/globalregistration.h b/src/meshlabplugins/filter_globalregistration/globalregistration.h index 0fe1ddcf3..7370571f6 100644 --- a/src/meshlabplugins/filter_globalregistration/globalregistration.h +++ b/src/meshlabplugins/filter_globalregistration/globalregistration.h @@ -41,7 +41,7 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - void initParameterList(QAction *, MeshDocument &/*m*/, RichParameterList & /*parent*/); + void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction* ) const {return MeshModel::MM_VERTCOORD; } FilterClass getClass(const QAction* a) const; 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 26cd7f6c7..cb7986ca8 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 @@ -125,7 +125,7 @@ MeshFilterInterface::FilterClass FilterImgPatchParamPlugin::getClass(const QActi //} -void FilterImgPatchParamPlugin::initParameterList( QAction *act, +void FilterImgPatchParamPlugin::initParameterList(const QAction *act, MeshDocument &/*md*/, RichParameterList &par ) { 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 19196a225..7b1e7c01a 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 @@ -105,7 +105,7 @@ public: virtual FilterClass getClass(const QAction* act ) const; - virtual void initParameterList( QAction *act, + virtual void initParameterList(const QAction* act, MeshDocument &md, RichParameterList &par ); diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp index c209fced2..bffdc82a5 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp @@ -100,7 +100,7 @@ int FilterIsoParametrization::getRequirements(const QAction *) return MeshModel::MM_NONE; } -void FilterIsoParametrization::initParameterList(QAction *a, MeshDocument& md, RichParameterList & par) +void FilterIsoParametrization::initParameterList(const QAction *a, MeshDocument& md, RichParameterList & par) { switch(ID(a)) diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h index 76f6c0f1a..40db6affa 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h @@ -54,7 +54,7 @@ class FilterIsoParametrization : public QObject, public MeshFilterInterface virtual int getRequirements(const QAction*); - virtual void initParameterList(QAction *,MeshDocument&, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction*, MeshDocument&, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); int postCondition(const QAction* filter) const; void PrintStats(CMeshO *mesh); diff --git a/src/meshlabplugins/filter_layer/filter_layer.cpp b/src/meshlabplugins/filter_layer/filter_layer.cpp index 76d748c21..cf89174a2 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.cpp +++ b/src/meshlabplugins/filter_layer/filter_layer.cpp @@ -113,7 +113,7 @@ QString FilterLayerPlugin::filterInfo(FilterIDType filterId) const } // This function define the needed parameters for each filter. -void FilterLayerPlugin::initParameterList(QAction *action, MeshDocument &md, RichParameterList & parlst) +void FilterLayerPlugin::initParameterList(const QAction *action, MeshDocument &md, RichParameterList & parlst) { MeshModel *mm=md.mm(); RasterModel *rm=md.rm(); diff --git a/src/meshlabplugins/filter_layer/filter_layer.h b/src/meshlabplugins/filter_layer/filter_layer.h index 17434de90..baa038207 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.h +++ b/src/meshlabplugins/filter_layer/filter_layer.h @@ -59,7 +59,7 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; virtual FilterClass getClass(const QAction*) const; - virtual void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction *filter) const; FILTER_ARITY filterArity(const QAction*) const; diff --git a/src/meshlabplugins/filter_measure/filter_measure.cpp b/src/meshlabplugins/filter_measure/filter_measure.cpp index f1d09adbf..6ae1a4d4b 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.cpp +++ b/src/meshlabplugins/filter_measure/filter_measure.cpp @@ -151,7 +151,7 @@ int FilterMeasurePlugin::getPreConditions(const QAction* action) const } } -void FilterMeasurePlugin::initParameterList(QAction *action, MeshModel &m, RichParameterList & parlst) +void FilterMeasurePlugin::initParameterList(const QAction *action, MeshModel &m, RichParameterList & parlst) { switch (ID(action)) { case PER_VERTEX_QUALITY_HISTOGRAM: diff --git a/src/meshlabplugins/filter_measure/filter_measure.h b/src/meshlabplugins/filter_measure/filter_measure.h index 0cd41750d..bd79c6e76 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.h +++ b/src/meshlabplugins/filter_measure/filter_measure.h @@ -53,7 +53,7 @@ public: FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(const QAction*) const; int getPreConditions(const QAction *action) const; - void initParameterList(QAction* , MeshModel& m, RichParameterList& parlst); + void initParameterList(const QAction* , MeshModel& m, RichParameterList& parlst); bool applyFilter(const QAction* filter, MeshDocument& md, const RichParameterList& parlst, vcg::CallBackPos*) ; int postCondition(const QAction* ) const; diff --git a/src/meshlabplugins/filter_meshing/meshfilter.cpp b/src/meshlabplugins/filter_meshing/meshfilter.cpp index 7670dab52..84ffbf6b3 100644 --- a/src/meshlabplugins/filter_meshing/meshfilter.cpp +++ b/src/meshlabplugins/filter_meshing/meshfilter.cpp @@ -342,7 +342,7 @@ QString ExtraMeshFilterPlugin::filterInfo(FilterIDType filterID) const // return // true if has some parameters // false is has no params -void ExtraMeshFilterPlugin::initParameterList(QAction * action, MeshModel & m, RichParameterList & parlst) +void ExtraMeshFilterPlugin::initParameterList(const QAction * action, MeshModel & m, RichParameterList & parlst) { float maxVal; QStringList curvCalcMethods; diff --git a/src/meshlabplugins/filter_meshing/meshfilter.h b/src/meshlabplugins/filter_meshing/meshfilter.h index eacd34eeb..3e2bc792b 100644 --- a/src/meshlabplugins/filter_meshing/meshfilter.h +++ b/src/meshlabplugins/filter_meshing/meshfilter.h @@ -88,7 +88,7 @@ public: QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction*) const; - void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction *filter) const; int getPreCondition(QAction *filter) const; diff --git a/src/meshlabplugins/filter_mls/mlsplugin.cpp b/src/meshlabplugins/filter_mls/mlsplugin.cpp index 59ccf2cc3..75b0979ac 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.cpp +++ b/src/meshlabplugins/filter_mls/mlsplugin.cpp @@ -175,7 +175,7 @@ return QString("Filter Unknown"); // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void MlsPlugin::initParameterList(QAction* action, MeshDocument& md, RichParameterList& parlst) +void MlsPlugin::initParameterList(const QAction* action, MeshDocument& md, RichParameterList& parlst) { int id = ID(action); MeshModel *target = md.mm(); diff --git a/src/meshlabplugins/filter_mls/mlsplugin.h b/src/meshlabplugins/filter_mls/mlsplugin.h index 99e688ad6..1fc27fc88 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.h +++ b/src/meshlabplugins/filter_mls/mlsplugin.h @@ -66,7 +66,7 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction *a) const; - virtual void initParameterList(QAction *,MeshDocument &md, RichParameterList &parent); + virtual void initParameterList(const QAction*, MeshDocument &md, RichParameterList &parent); virtual int getRequirements(const QAction* action); virtual bool applyFilter(const QAction* filter, MeshDocument &m, const RichParameterList &parent, vcg::CallBackPos *cb) ; FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp index 2bbaa9590..23f0bffa9 100644 --- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp +++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp @@ -101,7 +101,7 @@ FilterMutualGlobal::FilterClass FilterMutualGlobal::getClass(const QAction *a) c // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void FilterMutualGlobal::initParameterList(QAction *action,MeshDocument & md, RichParameterList & parlst) +void FilterMutualGlobal::initParameterList(const QAction *action,MeshDocument & md, RichParameterList & parlst) { QStringList rendList; switch(ID(action)) { diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h index 316d39c8c..c29bff6d8 100644 --- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h +++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h @@ -54,7 +54,7 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - void initParameterList(QAction *,MeshDocument & md, RichParameterList & /*parent*/); + void initParameterList(const QAction*, MeshDocument & md, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction*) const { return MeshModel::MM_NONE; }; FilterClass getClass(const QAction* a) const; diff --git a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp index 306061ff4..40f257fb4 100644 --- a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp +++ b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp @@ -85,7 +85,7 @@ MeshFilterInterface::FILTER_ARITY FilterMutualInfoPlugin::filterArity(const QAct return SINGLE_MESH; } -void FilterMutualInfoPlugin::initParameterList(QAction *action,MeshDocument & /*md*/, RichParameterList & parlst) +void FilterMutualInfoPlugin::initParameterList(const QAction *action,MeshDocument & /*md*/, RichParameterList & parlst) { QStringList rendList; rendList.push_back("Combined"); diff --git a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h index 011e59579..f4f0d807c 100644 --- a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h +++ b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h @@ -47,7 +47,7 @@ public: QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction* a) const; FILTER_ARITY filterArity(const QAction*) const; - void initParameterList(QAction *, MeshDocument &, RichParameterList & /*parent*/); + void initParameterList(const QAction*, MeshDocument &, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction*) const; diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.cpp b/src/meshlabplugins/filter_plymc/filter_plymc.cpp index ae4751cb5..b4b08ef3e 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.cpp +++ b/src/meshlabplugins/filter_plymc/filter_plymc.cpp @@ -100,7 +100,7 @@ QString PlyMCPlugin::pluginName() const // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void PlyMCPlugin::initParameterList(QAction *action,MeshModel &m, RichParameterList & parlst) +void PlyMCPlugin::initParameterList(const QAction *action,MeshModel &m, RichParameterList & parlst) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.h b/src/meshlabplugins/filter_plymc/filter_plymc.h index 5af1e7b1d..300ab9ea3 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.h +++ b/src/meshlabplugins/filter_plymc/filter_plymc.h @@ -43,7 +43,7 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FilterClass getClass(const QAction* a) const; MeshFilterInterface::FILTER_ARITY filterArity(const QAction* filter) const; diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.cpp b/src/meshlabplugins/filter_qhull/filter_qhull.cpp index c360d2b1d..feb28e27b 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.cpp +++ b/src/meshlabplugins/filter_qhull/filter_qhull.cpp @@ -135,7 +135,7 @@ QString QhullPlugin::pluginName() const // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void QhullPlugin::initParameterList(QAction *action,MeshModel &m, RichParameterList & parlst) +void QhullPlugin::initParameterList(const QAction *action,MeshModel &m, RichParameterList & parlst) { switch(ID(action)) { case FP_QHULL_CONVEX_HULL : diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.h b/src/meshlabplugins/filter_qhull/filter_qhull.h index c09e579f0..0f5cc92d0 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.h +++ b/src/meshlabplugins/filter_qhull/filter_qhull.h @@ -58,7 +58,7 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &m, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; virtual FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp index 8c944901f..2b8038489 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp @@ -86,7 +86,7 @@ QString QualityMapperFilter::pluginName() const // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void QualityMapperFilter::initParameterList(QAction *action,MeshModel &m, RichParameterList & parlst) +void QualityMapperFilter::initParameterList(const QAction *action,MeshModel &m, RichParameterList & parlst) { switch(ID(action)) { case FP_QUALITY_MAPPER : diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.h b/src/meshlabplugins/filter_quality/filterqualitymapper.h index b9e4ca872..65161fab9 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.h +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.h @@ -74,7 +74,7 @@ public: virtual QString filterInfo(FilterIDType filter) const; int getPreConditions(const QAction *) const; int postCondition(const QAction* ) const; - virtual void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; virtual FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_sample/filter_sample.cpp b/src/meshlabplugins/filter_sample/filter_sample.cpp index f8b620d6f..70e7097f6 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.cpp +++ b/src/meshlabplugins/filter_sample/filter_sample.cpp @@ -133,7 +133,7 @@ int FilterSamplePlugin::postCondition(const QAction*) const * @param m * @param parlst */ -void FilterSamplePlugin::initParameterList(QAction *action,MeshModel &m, RichParameterList & parlst) +void FilterSamplePlugin::initParameterList(const QAction *action,MeshModel &m, RichParameterList & parlst) { switch(ID(action)) { case FP_MOVE_VERTEX : diff --git a/src/meshlabplugins/filter_sample/filter_sample.h b/src/meshlabplugins/filter_sample/filter_sample.h index a388fecf8..dddf78ad0 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.h +++ b/src/meshlabplugins/filter_sample/filter_sample.h @@ -60,7 +60,7 @@ public: FILTER_ARITY filterArity(const QAction*) const; int getPreConditions(const QAction *) const; int postCondition(const QAction* ) const; - void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* action, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); private: diff --git a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp index 68e8ad84f..ee1b0b749 100644 --- a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp +++ b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp @@ -93,7 +93,7 @@ QString ExtraSampleDynPlugin::filterName(FilterIDType filterId) const // when the user press apply the current stored state is updated. // when the user press close the mesh state is restored to the one before the startup of the filter. -void ExtraSampleDynPlugin::initParameterList(QAction *action,MeshModel &/*m*/, RichParameterList & parlst) +void ExtraSampleDynPlugin::initParameterList(const QAction *action,MeshModel &/*m*/, RichParameterList & parlst) { switch(ID(action)) { case FP_VERTEX_COLOR_NOISE : diff --git a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h index 9ee634d08..2db3df4e6 100644 --- a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h +++ b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h @@ -42,7 +42,7 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); virtual int postCondition(const QAction* ) const {return MeshModel::MM_VERTCOLOR;}; virtual bool applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; virtual FilterClass getClass(const QAction*) const; diff --git a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp index 1a55714b0..53e991e3e 100644 --- a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp +++ b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp @@ -87,7 +87,7 @@ ExtraSampleGPUPlugin::FilterClass ExtraSampleGPUPlugin::getClass(const QAction * // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void ExtraSampleGPUPlugin::initParameterList(QAction * action, MeshModel & m, RichParameterList & parlst) +void ExtraSampleGPUPlugin::initParameterList(const QAction * action, MeshModel & m, RichParameterList & parlst) { (void)m; diff --git a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h index 91a8a0b05..b35f42850 100644 --- a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h +++ b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h @@ -51,7 +51,7 @@ public: QString pluginName() const; FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} - void initParameterList(QAction *action,MeshModel &m, RichParameterList & parlst); + void initParameterList(const QAction* action, MeshModel &m, RichParameterList & parlst); QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.cpp b/src/meshlabplugins/filter_sampling/filter_sampling.cpp index 33585889f..848b8d09f 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.cpp +++ b/src/meshlabplugins/filter_sampling/filter_sampling.cpp @@ -460,7 +460,7 @@ int FilterDocSampling::getRequirements(const QAction *action) // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void FilterDocSampling::initParameterList(QAction *action, MeshDocument & md, RichParameterList & parlst) +void FilterDocSampling::initParameterList(const QAction *action, MeshDocument & md, RichParameterList & parlst) { switch(ID(action)) { case FP_MONTECARLO_SAMPLING : diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.h b/src/meshlabplugins/filter_sampling/filter_sampling.h index 358737dc7..003c710cd 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.h +++ b/src/meshlabplugins/filter_sampling/filter_sampling.h @@ -54,7 +54,7 @@ class FilterDocSampling : public QObject, public MeshFilterInterface QString pluginName() const; QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &m, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int getRequirements(const QAction* action); int postCondition(const QAction* ) const; diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp index cf1129fcd..ae13c0666 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp @@ -194,7 +194,7 @@ bool FilterScreenedPoissonPlugin::applyFilter(const QAction* filter, MeshDocumen } void FilterScreenedPoissonPlugin::initParameterList( - QAction* filter, + const QAction* filter, MeshModel&, RichParameterList& parlist) { diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h index fa2bcfb0d..23157029d 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h @@ -52,7 +52,7 @@ public: const RichParameterList& params, vcg::CallBackPos* cb) ; - void initParameterList(QAction* a, MeshModel&, RichParameterList& parlist); + void initParameterList(const QAction* a, MeshModel&, RichParameterList& parlist); int postCondition(const QAction* filter) const; FILTER_ARITY filterArity(const QAction*) const; }; diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp index fb7076c0a..e73058c08 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp @@ -39,7 +39,7 @@ QString SdfGpuPlugin::pluginName() const return "FilterSDFGPU"; } -void SdfGpuPlugin::initParameterList(QAction *action, MeshModel &/*m*/, RichParameterList &par) +void SdfGpuPlugin::initParameterList(const QAction *action, MeshModel &/*m*/, RichParameterList &par) { mAction = ID(action); QStringList onPrimitive; onPrimitive.push_back("On vertices"); onPrimitive.push_back("On Faces"); diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h index 053f032f1..3d209406e 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h @@ -40,7 +40,7 @@ public: bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); //Parameters init for user interface - virtual void initParameterList(QAction *action, MeshModel &m, RichParameterList &parlst); + virtual void initParameterList(const QAction* action, MeshModel &m, RichParameterList &parlst); //Draw the mesh void fillFrameBuffer(bool front, MeshModel* mm); diff --git a/src/meshlabplugins/filter_sdfgpu/filterinterface.h b/src/meshlabplugins/filter_sdfgpu/filterinterface.h index c14c20d25..1bcbe8d8c 100644 --- a/src/meshlabplugins/filter_sdfgpu/filterinterface.h +++ b/src/meshlabplugins/filter_sdfgpu/filterinterface.h @@ -147,7 +147,7 @@ private: int getRequirements(const QAction* ){ return postConditions(); } - int getPreConditions(QAction* ) const{ + int getPreConditions(const QAction* ) const{ return getPreConditions(); } int postCondition(const QAction*) const{ @@ -156,7 +156,7 @@ private: bool applyFilter(const QAction *, MeshDocument &md, const RichParameterList& par, vcg::CallBackPos * cb){ return applyFilter(md, par, cb); } - virtual void initParameterList(QAction *, MeshDocument &md, RichParameterList &par){ + virtual void initParameterList(const QAction *, MeshDocument &md, RichParameterList &par){ initParameterList(md,par); } }; diff --git a/src/meshlabplugins/filter_select/meshselect.cpp b/src/meshlabplugins/filter_select/meshselect.cpp index 5d92e4273..cd1ef4ee3 100644 --- a/src/meshlabplugins/filter_select/meshselect.cpp +++ b/src/meshlabplugins/filter_select/meshselect.cpp @@ -189,7 +189,7 @@ QString SelectionFilterPlugin::filterInfo(FilterIDType filterId) const return QString("Unknown filter"); } -void SelectionFilterPlugin::initParameterList(QAction *action, MeshModel &m, RichParameterList &parlst) +void SelectionFilterPlugin::initParameterList(const QAction *action, MeshModel &m, RichParameterList &parlst) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_select/meshselect.h b/src/meshlabplugins/filter_select/meshselect.h index 967847dd4..a199ee96c 100644 --- a/src/meshlabplugins/filter_select/meshselect.h +++ b/src/meshlabplugins/filter_select/meshselect.h @@ -74,7 +74,7 @@ class SelectionFilterPlugin : public QObject, public MeshFilterInterface virtual QString filterName(FilterIDType filter) const; virtual FilterClass getClass(const QAction*) const; - void initParameterList(QAction *action, MeshModel &m, RichParameterList &parlst); + void initParameterList(const QAction* action, MeshModel &m, RichParameterList &parlst); int getPreConditions(const QAction*) const; int postCondition(const QAction* ) const; int getRequirements(const QAction*); diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp index 281fe4a24..0f2757c03 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp @@ -95,7 +95,7 @@ int FilterSketchFabPlugin::postCondition(const QAction*) const return MeshModel::MM_NONE; } -void FilterSketchFabPlugin::initParameterList(QAction* action, MeshModel&, RichParameterList& parlst) +void FilterSketchFabPlugin::initParameterList(const QAction* action, MeshModel&, RichParameterList& parlst) { QSettings settings; QVariant v = settings.value("SketchFab Code"); diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h index 90d4536ee..75b74bef1 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h @@ -45,7 +45,7 @@ public: FILTER_ARITY filterArity(const QAction* a) const; int getPreConditions(const QAction*) const; int postCondition(const QAction* ) const; - void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; public slots: diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp index 9035e8ffa..9d6b5eed4 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp @@ -57,7 +57,7 @@ QString FilterSSynth::filterInfo(FilterIDType filterId) const } } -void FilterSSynth::initParameterList(QAction* /*filter*/,MeshDocument &/*md*/, RichParameterList &par) +void FilterSSynth::initParameterList(const QAction* /*filter*/,MeshDocument &/*md*/, RichParameterList &par) { par.addParam(RichString("grammar","set maxdepth 40 R1 R2 rule R1 { { x 1 rz 6 ry 6 s 0.99 } R1 { s 2 } sphere } rule R2 {{ x -1 rz 6 ry 6 s 0.99 } R2 { s 2 } sphere} ","Eisen Script grammar","Write a grammar according to Eisen Script specification and using the primitives box, sphere, mesh, dot and triangle ")); par.addParam(RichInt("seed",1,"seed for random construction","Seed needed to build the mesh")); diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.h b/src/meshlabplugins/filter_ssynth/filter_ssynth.h index 30a0a4de6..40bfabbf0 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.h +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.h @@ -44,8 +44,8 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; virtual int getRequirements(const QAction*); - virtual void initParameterList(QAction* /*filter*/,MeshModel &,RichParameterList &){}; - virtual void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction* /*filter*/,MeshModel &,RichParameterList &){}; + virtual void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); virtual FilterClass getClass(const QAction* filter) const; void setAttributes(CMeshO::VertexIterator &vi, CMeshO &m); diff --git a/src/meshlabplugins/filter_texture/filter_texture.cpp b/src/meshlabplugins/filter_texture/filter_texture.cpp index 54ddbdfb1..749b9b0e3 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.cpp +++ b/src/meshlabplugins/filter_texture/filter_texture.cpp @@ -185,7 +185,7 @@ static QString extractFilenameWOExt(MeshModel* mm) // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void FilterTexturePlugin::initParameterList(QAction *action, MeshDocument &md, RichParameterList & parlst) +void FilterTexturePlugin::initParameterList(const QAction *action, MeshDocument &md, RichParameterList & parlst) { switch(ID(action)) { case FP_VORONOI_ATLAS : diff --git a/src/meshlabplugins/filter_texture/filter_texture.h b/src/meshlabplugins/filter_texture/filter_texture.h index c589f5806..2ba11707a 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.h +++ b/src/meshlabplugins/filter_texture/filter_texture.h @@ -58,7 +58,7 @@ public: QString pluginName() const; virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; - virtual void initParameterList(QAction *,MeshDocument &/*m*/, RichParameterList & /*parent*/); + virtual void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); virtual int getRequirements(const QAction*); virtual int getPreConditions(const QAction*) const; diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp index 2db08b73a..857bb4e18 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp @@ -201,7 +201,7 @@ int TriOptimizePlugin::postCondition(const QAction *a) const // - the string shown in the dialog // - the default value // - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog) -void TriOptimizePlugin::initParameterList(QAction *action, MeshModel &m, RichParameterList & parlst) +void TriOptimizePlugin::initParameterList(const QAction *action, MeshModel &m, RichParameterList & parlst) { if (ID(action) == FP_CURVATURE_EDGE_FLIP) { parlst.addParam(RichBool("selection", m.cm.sfn > 0, tr("Update selection"), tr("Apply edge flip optimization on selected faces only"))); diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h index 98b180213..b42fc80b9 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h @@ -47,7 +47,7 @@ public: QString pluginName() const; QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - void initParameterList(QAction *,MeshModel &/*m*/, RichParameterList & /*parent*/); + void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList &/*parent*/, vcg::CallBackPos * cb) ; int getRequirements(const QAction*); FilterClass getClass(const QAction *); diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp index 9fca4ba2c..257ce2ac8 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp @@ -312,7 +312,7 @@ int FilterUnsharp::postCondition(const QAction *a) const return MeshModel::MM_NONE; } -void FilterUnsharp::initParameterList(QAction *action, MeshDocument &md, RichParameterList & parlst) +void FilterUnsharp::initParameterList(const QAction *action, MeshDocument &md, RichParameterList & parlst) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.h b/src/meshlabplugins/filter_unsharp/filter_unsharp.h index e06ff1028..2f42176cc 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.h +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.h @@ -73,7 +73,7 @@ class FilterUnsharp : public QObject, public MeshFilterInterface FilterClass getClass(const QAction*) const; int getRequirements(const QAction*); bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; - void initParameterList(QAction *action, MeshDocument &/*m*/, RichParameterList & parlst); + void initParameterList(const QAction* action, MeshDocument &/*m*/, RichParameterList & parlst); int postCondition(const QAction* ) const; int getPreConditions(const QAction*) const; FILTER_ARITY filterArity(const QAction* filter) const; diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp index 842b2496f..57cdecc15 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp @@ -131,7 +131,7 @@ MeshFilterInterface::FILTER_ARITY FilterVoronoiPlugin::filterArity(const QAction } } -void FilterVoronoiPlugin::initParameterList(QAction* action, MeshModel& m, RichParameterList& par) +void FilterVoronoiPlugin::initParameterList(const QAction* action, MeshModel& m, RichParameterList& par) { switch(ID(action)) { case VORONOI_SAMPLING : diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.h b/src/meshlabplugins/filter_voronoi/filter_voronoi.h index 807bbc89d..6edee9ebc 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.h +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.h @@ -49,7 +49,7 @@ public: QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction* a) const; FILTER_ARITY filterArity(const QAction* a) const; - void initParameterList(QAction* action, MeshModel& m, RichParameterList& par); + void initParameterList(const QAction* action, MeshModel& m, RichParameterList& par); int getPreConditions(const QAction* action) const; bool applyFilter(const QAction* action, MeshDocument& md, const RichParameterList& par, vcg::CallBackPos* cb) ; int postCondition(const QAction* ) const; From 5f56eb1bdee7b1860a35522fcd01f06422917e5f Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 17 Sep 2020 15:53:54 +0200 Subject: [PATCH 26/49] other RichParameterList const correctness --- src/common/interfaces.h | 6 +++--- src/meshlabplugins/filter_fractal/filter_fractal.cpp | 2 +- src/meshlabplugins/filter_fractal/filter_fractal.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/interfaces.h b/src/common/interfaces.h index c6a95c87f..fd330fe2f 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -414,9 +414,9 @@ public: * Filters \b must never use QMessageBox for reporting errors. * Failing filters should put some meaningful information inside the errorMessage string and return false with the \ref applyFilter */ - const QString &errorMsg() { return this->errorMessage; } - virtual QString filterInfo(QAction *a) const { return this->filterInfo(ID(a)); } - virtual QString filterName(QAction *a) const { return this->filterName(ID(a)); } + const QString &errorMsg() const { return this->errorMessage; } + virtual QString filterInfo(const QAction *a) const { return this->filterInfo(ID(a)); } + virtual QString filterName(const QAction *a) const { return this->filterName(ID(a)); } virtual QString filterScriptFunctionName(FilterIDType /*filterID*/) { return ""; } virtual FilterIDType ID(const QAction *a) const diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.cpp b/src/meshlabplugins/filter_fractal/filter_fractal.cpp index 4edd267ae..c4eb0df75 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.cpp +++ b/src/meshlabplugins/filter_fractal/filter_fractal.cpp @@ -179,7 +179,7 @@ void FilterFractal::initParameterList(const QAction* filter,MeshDocument &md, Ri } } -void FilterFractal::initParameterSetForFractalDisplacement(QAction *filter, MeshDocument &md, RichParameterList &par) +void FilterFractal::initParameterSetForFractalDisplacement(const QAction *filter, MeshDocument &md, RichParameterList &par) { bool terrain_filter = (ID(filter) == CR_FRACTAL_TERRAIN); diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.h b/src/meshlabplugins/filter_fractal/filter_fractal.h index e24ec928d..3a2bad26d 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.h +++ b/src/meshlabplugins/filter_fractal/filter_fractal.h @@ -54,7 +54,7 @@ public: FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(const QAction* act) const; private: - void initParameterSetForFractalDisplacement (QAction *, MeshDocument &, RichParameterList &); + void initParameterSetForFractalDisplacement (const QAction*, MeshDocument &, RichParameterList &); void initParameterSetForCratersGeneration (MeshDocument &md, RichParameterList &par); enum {CR_FRACTAL_TERRAIN, FP_FRACTAL_MESH, FP_CRATERS}; From 6e08a9c9b95054472ab345fec243a8902371ba9d Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 18 Sep 2020 11:27:13 +0200 Subject: [PATCH 27/49] moving some common interfaces inside interfaces directory --- src/common/common.pro | 3 + src/common/interfaces.h | 133 ++----------------- src/common/interfaces/mainwindow_interface.h | 42 ++++++ src/common/interfaces/plugin_interface.cpp | 46 +++++++ src/common/interfaces/plugin_interface.h | 105 +++++++++++++++ src/common/pluginmanager.cpp | 4 +- src/common/pluginmanager.h | 2 +- src/meshlab/mainwindow.h | 1 + 8 files changed, 214 insertions(+), 122 deletions(-) create mode 100644 src/common/interfaces/mainwindow_interface.h create mode 100644 src/common/interfaces/plugin_interface.cpp create mode 100644 src/common/interfaces/plugin_interface.h diff --git a/src/common/common.pro b/src/common/common.pro index 93c9fcc3f..9896ed7f7 100644 --- a/src/common/common.pro +++ b/src/common/common.pro @@ -48,6 +48,8 @@ HEADERS += \ filterscript.h \ GLLogStream.h \ interfaces.h \ + interfaces/mainwindow_interface.h \ + interfaces/plugin_interface.h \ ml_mesh_type.h \ meshmodel.h \ pluginmanager.h \ @@ -66,6 +68,7 @@ SOURCES += \ interfaces.cpp \ filterscript.cpp \ GLLogStream.cpp \ + interfaces/plugin_interface.cpp \ meshmodel.cpp \ pluginmanager.cpp \ mlapplication.cpp \ diff --git a/src/common/interfaces.h b/src/common/interfaces.h index fd330fe2f..092d9fa7e 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -26,6 +26,7 @@ //#include #include "filter_parameter/rich_parameter_list.h" +#include "interfaces/plugin_interface.h" #include "GLLogStream.h" #include "meshmodel.h" @@ -52,122 +53,16 @@ class GLAreaReg; class MeshModel; -/** The MainWindowInterface class defines just the executeFilter() callback function -that is invoked by the standard parameter input dialog. -It is used as base class of the MainWindow. -*/ -class MainWindowInterface -{ -public: - virtual void executeFilter(QAction *, RichParameterList &, bool = false) {} - //parexpval is a string map containing the parameter expression values set in the filter's dialog. - //These parameter expression values will be evaluated when the filter will start. -}; -/** \brief The MeshLabInterface class is the base of all the plugin interfaces. -The main idea common to all the framework is that each plugin export a set of actions, -internally each action is associated to a FilterIDType, and for each action a name and a formatted INFO is defined. -For coding easyness ID are more practical (you can use them in switches). -Using action on the other hand is practical because it simplify their management in menus/toolbars and it allows to define icons and other things in a automatic way. -Moreover ID are UNSAFE (different plugin can have same id) so they should be used only INTERNALLY -\todo There is inconsistency in the usage of ID and actions for retrieving particular filters. Remove. - -*/ -class MeshLabInterface -{ -public: - /** the type used to identify plugin actions; there is a one-to-one relation between an ID and an Action. - \todo To be renamed as ActionIDType - */ - - MeshLabInterface() :log(0) {} - virtual ~MeshLabInterface() {} -private: - GLLogStream *log; -public: - - /// Standard stuff that usually should not be redefined. - void setLog(GLLogStream *log) { this->log = log; } - - // This function must be used to communicate useful information collected in the parsing/saving of the files. - // NEVER EVER use a msgbox to say something to the user. - template - void Log(const char * f, Ts&&... ts ) - { - if(log != nullptr) - { - log->Logf(GLLogStream::FILTER, f, std::forward(ts)...); - } - } - - void Log(const char * s) - { - if(log != nullptr) - { - log->Log(GLLogStream::FILTER, s); - } - } - - void Log(const std::string& s) - { - if(log != nullptr) - { - log->Log(GLLogStream::FILTER, s); - } - } - - template - void Log(GLLogStream::Levels Level, const char * f, Ts&&... ts ) - { - if(log != nullptr) - { - log->Logf(Level, f, std::forward(ts)...); - } - } - - void Log(GLLogStream::Levels level, const char * s) - { - if(log != nullptr) - { - log->Log(level, s); - } - } - - void Log(GLLogStream::Levels level, const std::string& s) - { - if(log != nullptr) - { - log->Log(level, s); - } - } - - void RealTimeLog(QString Id, const QString &meshName, const char * f) - { - if(log != nullptr) - { - log->RealTimeLog(Id, meshName, f); - } - } - - template - void RealTimeLog(QString Id, const QString &meshName, const char * f, Ts&&... ts ) - { - if(log != nullptr) - { - log->RealTimeLogf(Id, meshName, f, std::forward(ts)...); - } - } -}; - -class MeshCommonInterface : public MeshLabInterface +class PluginInterface : public MeshLabInterface { public: typedef int FilterIDType; - MeshCommonInterface() {} - virtual ~MeshCommonInterface() {} + PluginInterface() {} + virtual ~PluginInterface() {} virtual QString pluginName(void) const { return ""; } @@ -200,7 +95,7 @@ public: }; /** \brief The MeshIOInterface is the base class for all the single mesh loading plugins. */ -class MeshIOInterface : public MeshCommonInterface +class MeshIOInterface : public PluginInterface { public: class Format @@ -211,7 +106,7 @@ public: QStringList extensions; }; - MeshIOInterface() : MeshCommonInterface() { } + MeshIOInterface() : PluginInterface() { } virtual ~MeshIOInterface() {} virtual QList importFormats() const = 0; @@ -277,7 +172,7 @@ public: \brief The MeshFilterInterface class provide the interface of the filter plugins. */ -class MeshFilterInterface : public MeshCommonInterface +class MeshFilterInterface : public PluginInterface { public: /** The FilterClass enum represents the set of keywords that must be used to categorize a filter. @@ -309,7 +204,7 @@ public: - MeshFilterInterface() : MeshCommonInterface(), glContext(NULL) + MeshFilterInterface() : PluginInterface(), glContext(NULL) { } virtual ~MeshFilterInterface() {} @@ -496,10 +391,10 @@ if(mp->visible) mp->Render(rm.drawMode,rm.colorMode,rm.textureMode); */ -class MeshRenderInterface : public MeshCommonInterface +class MeshRenderInterface : public PluginInterface { public: - MeshRenderInterface() :MeshCommonInterface() {} + MeshRenderInterface() :PluginInterface() {} virtual ~MeshRenderInterface() {} virtual void Init(QAction *, MeshDocument &, MLSceneGLSharedDataContext::PerMeshRenderingDataMap& /*mp*/, GLArea *) {} @@ -533,7 +428,7 @@ Some example of PerMesh Decorations - display of specific tagging */ -class MeshDecorateInterface : public MeshCommonInterface +class MeshDecorateInterface : public PluginInterface { public: @@ -549,7 +444,7 @@ public: PostRendering = 0x00008 /*!< Decoration that are applied after the rendering of the document/mesh */ }; - MeshDecorateInterface() : MeshCommonInterface() {} + MeshDecorateInterface() : PluginInterface() {} virtual ~MeshDecorateInterface() {} /** The very short string (a few words) describing each filtering action // This string is used also to define the menu entry @@ -631,10 +526,10 @@ Used to provide tools that needs some kind of interaction with the mesh. Editing tools are exclusive (only one at a time) and can grab the mouse events and customize the rendering process. */ -class MeshEditInterface : public MeshCommonInterface +class MeshEditInterface : public PluginInterface { public: - MeshEditInterface() : MeshCommonInterface() {} + MeshEditInterface() : PluginInterface() {} virtual ~MeshEditInterface() {} //should return a sentence describing what the editing tool does diff --git a/src/common/interfaces/mainwindow_interface.h b/src/common/interfaces/mainwindow_interface.h new file mode 100644 index 000000000..7de967f0f --- /dev/null +++ b/src/common/interfaces/mainwindow_interface.h @@ -0,0 +1,42 @@ +/**************************************************************************** +* MeshLab o o * +* A versatile mesh processing toolbox o o * +* _ O _ * +* Copyright(C) 2005-2020 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ + +#ifndef MESHLAB_MAINWINDOW_INTERFACE_H +#define MESHLAB_MAINWINDOW_INTERFACE_H + +#include +#include "../filter_parameter/rich_parameter_list.h" + +/** The MainWindowInterface class defines just the executeFilter() callback function +that is invoked by the standard parameter input dialog. +It is used as base class of the MainWindow. +*/ +class MainWindowInterface +{ +public: + virtual void executeFilter(QAction *, RichParameterList &, bool = false) {} + //parexpval is a string map containing the parameter expression values set in the filter's dialog. + //These parameter expression values will be evaluated when the filter will start. +}; + +#endif // MESHLAB_MAINWINDOW_INTERFACE_H diff --git a/src/common/interfaces/plugin_interface.cpp b/src/common/interfaces/plugin_interface.cpp new file mode 100644 index 000000000..8844e2ab6 --- /dev/null +++ b/src/common/interfaces/plugin_interface.cpp @@ -0,0 +1,46 @@ +#include "plugin_interface.h" + +MeshLabInterface::MeshLabInterface() : + log(nullptr) +{ +} + +void MeshLabInterface::setLog(GLLogStream* log) +{ + this->log = log; +} + +void MeshLabInterface::Log(const char* s) +{ + if(log != nullptr) { + log->Log(GLLogStream::FILTER, s); + } +} + +void MeshLabInterface::Log(const std::string& s) +{ + if(log != nullptr) { + log->Log(GLLogStream::FILTER, s); + } +} + +void MeshLabInterface::Log(GLLogStream::Levels level, const char* s) +{ + if(log != nullptr) { + log->Log(level, s); + } +} + +void MeshLabInterface::Log(GLLogStream::Levels level, const std::string& s) +{ + if(log != nullptr) { + log->Log(level, s); + } +} + +void MeshLabInterface::RealTimeLog(QString Id, const QString& meshName, const char* f) +{ + if(log != nullptr) { + log->RealTimeLog(Id, meshName, f); + } +} diff --git a/src/common/interfaces/plugin_interface.h b/src/common/interfaces/plugin_interface.h new file mode 100644 index 000000000..8d85669e4 --- /dev/null +++ b/src/common/interfaces/plugin_interface.h @@ -0,0 +1,105 @@ +/**************************************************************************** +* MeshLab o o * +* A versatile mesh processing toolbox o o * +* _ O _ * +* Copyright(C) 2005-2020 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ + +#ifndef MESHLAB_PLUGIN_INTERFACE_H +#define MESHLAB_PLUGIN_INTERFACE_H + +#include "../GLLogStream.h" + +/** + * \brief The MeshLabInterface class is the base of all the plugin interfaces. + * + * The main idea common to all the framework is that each plugin export a set of actions, + * internally each action is associated to a FilterIDType, and for each action a name and a formatted INFO is defined. + * + * For coding easyness ID are more practical (you can use them in switches). + * Using action on the other hand is practical because it simplify their management in menus/toolbars and it allows to define icons and other things in a automatic way. + * Moreover ID are UNSAFE (different plugin can have same id) so they should be used only INTERNALLY + * + * \todo There is inconsistency in the usage of ID and actions for retrieving particular filters. Remove. + */ +class MeshLabInterface +{ +public: + /** the type used to identify plugin actions; there is a one-to-one relation between an ID and an Action. + \todo To be renamed as ActionIDType + */ + MeshLabInterface(); + virtual ~MeshLabInterface() {} + + /// Standard stuff that usually should not be redefined. + void setLog(GLLogStream *log); + + // This function must be used to communicate useful information collected in the parsing/saving of the files. + // NEVER EVER use a msgbox to say something to the user. + template + void Log(const char * f, Ts&&... ts ); + + void Log(const char * s); + void Log(const std::string& s); + + template + void Log(GLLogStream::Levels Level, const char * f, Ts&&... ts ); + + void Log(GLLogStream::Levels level, const char * s); + + void Log(GLLogStream::Levels level, const std::string& s); + + void RealTimeLog(QString Id, const QString &meshName, const char * f); + + template + void RealTimeLog(QString Id, const QString &meshName, const char * f, Ts&&... ts ); + +private: + GLLogStream *log; +}; + +/************************ + * Template definitions * + ************************/ + +template +void MeshLabInterface::Log(const char* f, Ts&&... ts) +{ + if(log != nullptr) { + log->Logf(GLLogStream::FILTER, f, std::forward(ts)...); + } +} + +template +void MeshLabInterface::Log(GLLogStream::Levels Level, const char * f, Ts&&... ts ) +{ + if(log != nullptr) { + log->Logf(Level, f, std::forward(ts)...); + } +} + +template +void MeshLabInterface::RealTimeLog(QString Id, const QString &meshName, const char * f, Ts&&... ts ) +{ + if(log != nullptr) { + log->RealTimeLogf(Id, meshName, f, std::forward(ts)...); + } +} + +#endif // MESHLAB_PLUGIN_INTERFACE_H diff --git a/src/common/pluginmanager.cpp b/src/common/pluginmanager.cpp index f4f37f448..80710a11b 100644 --- a/src/common/pluginmanager.cpp +++ b/src/common/pluginmanager.cpp @@ -43,7 +43,7 @@ PluginManager::~PluginManager() meshFilterPlug.clear(); meshRenderPlug.clear(); meshDecoratePlug.clear(); - for (MeshCommonInterface* plugin : ownerPlug) + for (PluginInterface* plugin : ownerPlug) delete plugin; ownerPlug.clear(); @@ -83,7 +83,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl if (plugin) { pluginsLoaded.push_back(fileName); - MeshCommonInterface *iCommon = nullptr; + PluginInterface *iCommon = nullptr; MeshFilterInterface *iFilter = qobject_cast(plugin); if (iFilter) { diff --git a/src/common/pluginmanager.h b/src/common/pluginmanager.h index 9b922c5b4..00658c659 100644 --- a/src/common/pluginmanager.h +++ b/src/common/pluginmanager.h @@ -72,7 +72,7 @@ public: QVector editActionList; QVector decoratorActionList; // Used for unique destruction - this "owns" all IO, Filter, Render, and Decorate plugins - QVector ownerPlug; + QVector ownerPlug; QStringList pluginsLoaded; diff --git a/src/meshlab/mainwindow.h b/src/meshlab/mainwindow.h index cc2f0e8bf..564b8054a 100644 --- a/src/meshlab/mainwindow.h +++ b/src/meshlab/mainwindow.h @@ -29,6 +29,7 @@ #include +#include "../common/interfaces/mainwindow_interface.h" #include "../common/pluginmanager.h" #include From 2fff353d5d2ab5b1d097e8e0d8e171a5ef0e4ab6 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 18 Sep 2020 11:52:41 +0200 Subject: [PATCH 28/49] fix cmake, renamings and better style --- src/common/CMakeLists.txt | 3 + src/common/interfaces.h | 41 ---- src/common/interfaces/plugin_interface.cpp | 67 +++++-- src/common/interfaces/plugin_interface.h | 60 +++--- .../decorate_base/decorate_base.cpp | 18 +- .../edit_manipulators/edit_manipulators.cpp | 2 +- .../edit_measure/edit_measure.cpp | 16 +- .../edit_mutualcorrs/edit_mutualcorrs.cpp | 20 +- src/meshlabplugins/edit_point/edit_point.cpp | 2 +- .../edit_referencing/edit_referencing.cpp | 26 +-- .../edit_sample/edit_sample.cpp | 40 ++-- .../edit_select/edit_select.cpp | 4 +- src/meshlabplugins/filter_ao/filter_ao.cpp | 34 ++-- .../filter_camera/filter_camera.cpp | 38 ++-- .../filter_clean/cleanfilter.cpp | 38 ++-- .../filter_color_projection.cpp | 10 +- .../filter_colorproc/filter_colorproc.cpp | 26 +-- .../filter_create/filter_create.cpp | 16 +- src/meshlabplugins/filter_csg/filter_csg.cpp | 20 +- .../filter_func/filter_func.cpp | 36 ++-- .../filter_geodesic/filter_geodesic.cpp | 12 +- .../globalregistration.cpp | 2 +- .../filter_img_patch_param.cpp | 26 +-- .../filter_isoparametrization.cpp | 22 +-- .../filter_layer/filter_layer.cpp | 20 +- .../filter_measure/filter_measure.cpp | 178 +++++++++--------- .../filter_meshing/meshfilter.cpp | 38 ++-- src/meshlabplugins/filter_mls/mlsplugin.cpp | 8 +- .../filter_mutualglobal.cpp | 58 +++--- .../filter_mutualinfo/filter_mutualinfo.cpp | 22 +-- .../filter_plymc/filter_plymc.cpp | 10 +- .../filter_qhull/filter_qhull.cpp | 10 +- .../filter_sample/filter_sample.cpp | 2 +- .../filter_sampling/filter_sampling.cpp | 104 +++++----- .../filter_screened_poisson.cpp | 4 +- .../filter_sdfgpu/filter_sdfgpu.cpp | 36 ++-- .../filter_select/meshselect.cpp | 20 +- .../filter_sketchfab/filter_sketchfab.cpp | 4 +- .../filter_texture/filter_texture.cpp | 28 +-- .../filter_trioptimize/filter_trioptimize.cpp | 6 +- .../filter_unsharp/filter_unsharp.cpp | 12 +- .../filter_voronoi/filter_voronoi.cpp | 6 +- src/meshlabplugins/io_base/baseio.cpp | 2 +- 43 files changed, 577 insertions(+), 570 deletions(-) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 598cc42a9..a653a9e14 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -14,6 +14,7 @@ set(SOURCES filter_parameter/rich_parameter.cpp filter_parameter/rich_parameter_list.cpp filter_parameter/value.cpp + interfaces/plugin_interface.cpp GLExtensionsManager.cpp GLLogStream.cpp filterscript.cpp @@ -32,6 +33,8 @@ set(HEADERS filter_parameter/rich_parameter.h filter_parameter/rich_parameter_list.h filter_parameter/value.h + interfaces/mainwindow_interface.h + interfaces/plugin_interface.h GLExtensionsManager.h GLLogStream.h filterscript.h diff --git a/src/common/interfaces.h b/src/common/interfaces.h index 092d9fa7e..b980f6461 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -25,7 +25,6 @@ #define MESHLAB_INTERFACES_H //#include -#include "filter_parameter/rich_parameter_list.h" #include "interfaces/plugin_interface.h" #include "GLLogStream.h" #include "meshmodel.h" @@ -53,46 +52,6 @@ class GLAreaReg; class MeshModel; - - - - -class PluginInterface : public MeshLabInterface -{ -public: - typedef int FilterIDType; - PluginInterface() {} - virtual ~PluginInterface() {} - - virtual QString pluginName(void) const { return ""; } - - /** \brief This function is called by the framework, for each plugin that has global parameters (e.g. \ref MeshDecorateInterface) at the start of the application. - The rationale is to allow to each plugin to have a list of global persistent parameters that can be changed from the meshlab itself and whose value is persistent between different meshlab invocations. - A typical example is the background color. - - For the global parameters the following rules apply: - - \li there is a hardwired default value: a safe consistent value that is directly coded into the plugin and to which the user can always revert if needed. - \li there is a saved value: a value that is stored into a persistent location into the user space (registry/home/library) and it is presented as default value of the parameter at each MeshLab invocation. - \li there is a current value: a value that is currently used, different for each document instance and that is not stored permanently. - - The plugin use the current value to draw its decoration. - at startup the current value is always silently initialized to the saved value. - User can revert current value to the saved values and to the hardwired values. - In the dialog for each parameter some buttons should be present: - - \li apply: use the currently edited parameter value without saving it anywhere. After the closure of the document these values will be lost. - \li load: load from the saved values - \li save: save to a permanent location the current value (to the registry), - \li reset: revert to the hardwired values - - If your plugins/action has no GlobalParameter, do nothing. - The RichParameterSet comes to the StartDecorate already initialized with the values stored on the permanent storage. - At the start up the initGlobalParameterSet function is called with an empty RichParameterSet (to collect the default values) - If a filter wants to save some permanent stuff should set the permanent default values. - */ - virtual void initGlobalParameterSet(QAction * /*format*/, RichParameterList & /*globalparam*/) {} -}; /** \brief The MeshIOInterface is the base class for all the single mesh loading plugins. */ class MeshIOInterface : public PluginInterface diff --git a/src/common/interfaces/plugin_interface.cpp b/src/common/interfaces/plugin_interface.cpp index 8844e2ab6..3e5213197 100644 --- a/src/common/interfaces/plugin_interface.cpp +++ b/src/common/interfaces/plugin_interface.cpp @@ -1,46 +1,75 @@ #include "plugin_interface.h" -MeshLabInterface::MeshLabInterface() : - log(nullptr) +PluginInterface::PluginInterface() : + logstream(nullptr) { } -void MeshLabInterface::setLog(GLLogStream* log) +/** \brief This function is called by the framework, for each plugin that has global parameters (e.g. \ref MeshDecorateInterface) at the start of the application. + *The rationale is to allow to each plugin to have a list of global persistent parameters that can be changed from the meshlab itself and whose value is persistent between different meshlab invocations. + * A typical example is the background color. + * + * For the global parameters the following rules apply: + * + * \li there is a hardwired default value: a safe consistent value that is directly coded into the plugin and to which the user can always revert if needed. + * \li there is a saved value: a value that is stored into a persistent location into the user space (registry/home/library) and it is presented as default value of the parameter at each MeshLab invocation. + * \li there is a current value: a value that is currently used, different for each document instance and that is not stored permanently. + * + * The plugin use the current value to draw its decoration. + * at startup the current value is always silently initialized to the saved value. + * User can revert current value to the saved values and to the hardwired values. + * In the dialog for each parameter some buttons should be present: + + * \li apply: use the currently edited parameter value without saving it anywhere. After the closure of the document these values will be lost. + * \li load: load from the saved values + * \li save: save to a permanent location the current value (to the registry), + * \li reset: revert to the hardwired values + + * If your plugins/action has no GlobalParameter, do nothing. + * The RichParameterSet comes to the StartDecorate already initialized with the values stored on the permanent storage. + * At the start up the initGlobalParameterSet function is called with an empty RichParameterSet (to collect the default values) + * If a filter wants to save some permanent stuff should set the permanent default values. + */ +void PluginInterface::initGlobalParameterSet(QAction* /*format*/, RichParameterList& /*globalparam*/) { - this->log = log; } -void MeshLabInterface::Log(const char* s) +void PluginInterface::setLog(GLLogStream* log) { - if(log != nullptr) { - log->Log(GLLogStream::FILTER, s); + this->logstream = log; +} + +void PluginInterface::log(const char* s) +{ + if(logstream != nullptr) { + logstream->Log(GLLogStream::FILTER, s); } } -void MeshLabInterface::Log(const std::string& s) +void PluginInterface::log(const std::string& s) { - if(log != nullptr) { - log->Log(GLLogStream::FILTER, s); + if(logstream != nullptr) { + logstream->Log(GLLogStream::FILTER, s); } } -void MeshLabInterface::Log(GLLogStream::Levels level, const char* s) +void PluginInterface::log(GLLogStream::Levels level, const char* s) { - if(log != nullptr) { - log->Log(level, s); + if(logstream != nullptr) { + logstream->Log(level, s); } } -void MeshLabInterface::Log(GLLogStream::Levels level, const std::string& s) +void PluginInterface::log(GLLogStream::Levels level, const std::string& s) { - if(log != nullptr) { - log->Log(level, s); + if(logstream != nullptr) { + logstream->Log(level, s); } } -void MeshLabInterface::RealTimeLog(QString Id, const QString& meshName, const char* f) +void PluginInterface::realTimeLog(QString Id, const QString& meshName, const char* f) { - if(log != nullptr) { - log->RealTimeLog(Id, meshName, f); + if(logstream != nullptr) { + logstream->RealTimeLog(Id, meshName, f); } } diff --git a/src/common/interfaces/plugin_interface.h b/src/common/interfaces/plugin_interface.h index 8d85669e4..f7e52cb66 100644 --- a/src/common/interfaces/plugin_interface.h +++ b/src/common/interfaces/plugin_interface.h @@ -24,7 +24,11 @@ #ifndef MESHLAB_PLUGIN_INTERFACE_H #define MESHLAB_PLUGIN_INTERFACE_H +#include + + #include "../GLLogStream.h" +#include "../filter_parameter/rich_parameter_list.h" /** * \brief The MeshLabInterface class is the base of all the plugin interfaces. @@ -38,40 +42,52 @@ * * \todo There is inconsistency in the usage of ID and actions for retrieving particular filters. Remove. */ -class MeshLabInterface +class PluginInterface { public: + typedef int FilterIDType; + /** the type used to identify plugin actions; there is a one-to-one relation between an ID and an Action. \todo To be renamed as ActionIDType */ - MeshLabInterface(); - virtual ~MeshLabInterface() {} + PluginInterface(); + virtual ~PluginInterface() {} + + /** + * @brief This functions returns the name of the current plugin. + * Must be implemented in every plugin. + * @return + */ + virtual QString pluginName() const = 0; + + // See source file for documentation + virtual void initGlobalParameterSet(QAction* /*format*/, RichParameterList& /*globalparam*/); /// Standard stuff that usually should not be redefined. - void setLog(GLLogStream *log); + void setLog(GLLogStream* log); // This function must be used to communicate useful information collected in the parsing/saving of the files. // NEVER EVER use a msgbox to say something to the user. template - void Log(const char * f, Ts&&... ts ); + void log(const char* f, Ts&&... ts); - void Log(const char * s); - void Log(const std::string& s); + void log(const char* s); + void log(const std::string& s); template - void Log(GLLogStream::Levels Level, const char * f, Ts&&... ts ); + void log(GLLogStream::Levels Level, const char* f, Ts&&... ts); - void Log(GLLogStream::Levels level, const char * s); + void log(GLLogStream::Levels level, const char* s); - void Log(GLLogStream::Levels level, const std::string& s); + void log(GLLogStream::Levels level, const std::string& s); - void RealTimeLog(QString Id, const QString &meshName, const char * f); + void realTimeLog(QString Id, const QString& meshName, const char* f); template - void RealTimeLog(QString Id, const QString &meshName, const char * f, Ts&&... ts ); + void realTimeLog(QString Id, const QString &meshName, const char * f, Ts&&... ts ); private: - GLLogStream *log; + GLLogStream *logstream; }; /************************ @@ -79,26 +95,26 @@ private: ************************/ template -void MeshLabInterface::Log(const char* f, Ts&&... ts) +void PluginInterface::log(const char* f, Ts&&... ts) { - if(log != nullptr) { - log->Logf(GLLogStream::FILTER, f, std::forward(ts)...); + if(logstream != nullptr) { + logstream->Logf(GLLogStream::FILTER, f, std::forward(ts)...); } } template -void MeshLabInterface::Log(GLLogStream::Levels Level, const char * f, Ts&&... ts ) +void PluginInterface::log(GLLogStream::Levels Level, const char* f, Ts&&... ts) { - if(log != nullptr) { - log->Logf(Level, f, std::forward(ts)...); + if(logstream != nullptr) { + logstream->Logf(Level, f, std::forward(ts)...); } } template -void MeshLabInterface::RealTimeLog(QString Id, const QString &meshName, const char * f, Ts&&... ts ) +void PluginInterface::realTimeLog(QString Id, const QString& meshName, const char* f, Ts&&... ts) { - if(log != nullptr) { - log->RealTimeLogf(Id, meshName, f, std::forward(ts)...); + if(logstream != nullptr) { + logstream->RealTimeLogf(Id, meshName, f, std::forward(ts)...); } } diff --git a/src/meshlabplugins/decorate_base/decorate_base.cpp b/src/meshlabplugins/decorate_base/decorate_base.cpp index 2d8de66ce..6f23f7f7b 100644 --- a/src/meshlabplugins/decorate_base/decorate_base.cpp +++ b/src/meshlabplugins/decorate_base/decorate_base.cpp @@ -107,7 +107,7 @@ void DecorateBasePlugin::decorateDoc(QAction *a, MeshDocument &md, const RichPar } if (md.meshList.size() == 0) - this->RealTimeLog("Show Mesh Camera", md.mm()->label(), "There are no Mesh Layers"); + this->realTimeLog("Show Mesh Camera", md.mm()->label(), "There are no Mesh Layers"); } // draw all visible raster cameras @@ -127,7 +127,7 @@ void DecorateBasePlugin::decorateDoc(QAction *a, MeshDocument &md, const RichPar } if (md.rasterList.size() == 0) - this->RealTimeLog("Show Raster Camera", md.mm()->label(), "There are no Rasters"); + this->realTimeLog("Show Raster Camera", md.mm()->label(), "There are no Rasters"); } } break; @@ -251,7 +251,7 @@ void DecorateBasePlugin::decorateMesh(QAction *a, MeshModel &m, const RichParame bmin = m.cm.bbox.min; bmax = m.cm.bbox.max; - this->RealTimeLog("Bounding Box", m.label(), "" + this->realTimeLog("Bounding Box", m.label(), "
    " "" "" "" @@ -290,7 +290,7 @@ void DecorateBasePlugin::decorateMesh(QAction *a, MeshModel &m, const RichParame QGLShaderProgram *glp=this->contourShaderProgramMap[&m]; CMeshO::PerMeshAttributeHandle< pair > mmqH = vcg::tri::Allocator::GetPerMeshAttribute >(m.cm,"minmaxQ"); - this->RealTimeLog("Quality Contour", m.label(), + this->realTimeLog("Quality Contour", m.label(), "min Q %f -- max Q %f",mmqH().first,mmqH().second); float stripe_num = rm->getFloat(this->ShowContourFreq()); @@ -775,11 +775,11 @@ void DecorateBasePlugin::DisplayCamera(QString who, Shotm &ls, int cameraSourceI if(!ls.IsValid()) { if(cameraSourceId == 1 ) - this->RealTimeLog("Show Mesh Camera", who, "Current Mesh Has an invalid Camera"); + this->realTimeLog("Show Mesh Camera", who, "Current Mesh Has an invalid Camera"); else if(cameraSourceId == 2 ) - this->RealTimeLog("Show Raster Camera", who, "Current Raster Has an invalid Camera"); + this->realTimeLog("Show Raster Camera", who, "Current Raster Has an invalid Camera"); else - this->RealTimeLog("Show Camera", who, "Current TrackBall Has an invalid Camera"); + this->realTimeLog("Show Camera", who, "Current TrackBall Has an invalid Camera"); return; } @@ -801,7 +801,7 @@ void DecorateBasePlugin::DisplayCamera(QString who, Shotm &ls, int cameraSourceI // glLabel::render2D(painter,glLabel::TOP_LEFT,ln++, QString("Focal Length %1 (pxsize %2 x %3) ").arg(focal).arg(ls.Intrinsics.PixelSizeMm[0]).arg(ls.Intrinsics.PixelSizeMm[1])); - this->RealTimeLog("Camera Info", who, + this->realTimeLog("Camera Info", who, "
    Min: %7.4f %7.4f %7.4f
    Max: %7.4f %7.4f %7.4f
    Size: %7.4f %7.4f %7.4f
    " "" "" @@ -1037,7 +1037,7 @@ void DecorateBasePlugin::DrawTexParam(MeshModel &m, GLArea *gla, QPainter *paint bool faceColor = rm->getBool(this->TextureFaceColorParam()); if (faceColor && !m.hasDataMask(MeshModel::MM_FACECOLOR)) { - this->RealTimeLog("Show UV Tex Param", "The model has no face color", "The model has no Face Color"); + this->realTimeLog("Show UV Tex Param", "The model has no face color", "The model has no Face Color"); faceColor = false; } diff --git a/src/meshlabplugins/edit_manipulators/edit_manipulators.cpp b/src/meshlabplugins/edit_manipulators/edit_manipulators.cpp index 365af1fa0..f80715068 100644 --- a/src/meshlabplugins/edit_manipulators/edit_manipulators.cpp +++ b/src/meshlabplugins/edit_manipulators/edit_manipulators.cpp @@ -1101,7 +1101,7 @@ void EditManipulatorsPlugin::Decorate(MeshModel &model, GLArea *gla, QPainter* / HelpString3 = "
    press RETURN to apply, BACKSPACE to cancel"; } - this->RealTimeLog("Manipulator","",qUtf8Printable(""+StatusString1+""+StatusString2+HelpString1+HelpString2+HelpString3)); + this->realTimeLog("Manipulator","",qUtf8Printable(""+StatusString1+""+StatusString2+HelpString1+HelpString2+HelpString3)); // render original mesh BBox DrawMeshBox(model); diff --git a/src/meshlabplugins/edit_measure/edit_measure.cpp b/src/meshlabplugins/edit_measure/edit_measure.cpp index 73f169f4d..0fa03af63 100644 --- a/src/meshlabplugins/edit_measure/edit_measure.cpp +++ b/src/meshlabplugins/edit_measure/edit_measure.cpp @@ -91,7 +91,7 @@ void EditMeasurePlugin::Decorate(MeshModel & m, GLArea * gla,QPainter* p) newM.length = measuredDistance; measures.push_back(newM); - this->Log(GLLogStream::FILTER, "Distance %s: %f", newM.ID.toStdString().c_str(), measuredDistance); + this->log(GLLogStream::FILTER, "Distance %s: %f", newM.ID.toStdString().c_str(), measuredDistance); } for (size_t mind = 0; mindRealTimeLog("Point to Point Measure", m.shortName(), + this->realTimeLog("Point to Point Measure", m.shortName(), " -- " ); else - this->RealTimeLog("Point to Point Measure", m.shortName(), + this->realTimeLog("Point to Point Measure", m.shortName(), (instructions + savedmeasure).toStdString().c_str() ); @@ -132,14 +132,14 @@ void EditMeasurePlugin::keyReleaseEvent(QKeyEvent *e, MeshModel &mod, GLArea *gl if (e->key() == Qt::Key_P) // print { - this->Log(GLLogStream::FILTER, "------- Distances -------"); - this->Log(GLLogStream::FILTER, "ID: Dist [pointA][pointB]"); + this->log(GLLogStream::FILTER, "------- Distances -------"); + this->log(GLLogStream::FILTER, "ID: Dist [pointA][pointB]"); for (size_t mind = 0; mindLog(GLLogStream::FILTER, "%s: %f [%f,%f,%f][%f,%f,%f]", measures[mind].ID.toStdString().c_str(), measures[mind].length, + this->log(GLLogStream::FILTER, "%s: %f [%f,%f,%f][%f,%f,%f]", measures[mind].ID.toStdString().c_str(), measures[mind].length, measures[mind].startP[0], measures[mind].startP[1], measures[mind].startP[2], measures[mind].endP[0], measures[mind].endP[1], measures[mind].endP[2]); } - this->Log(GLLogStream::FILTER, "-------------------------"); + this->log(GLLogStream::FILTER, "-------------------------"); } if (e->key() == Qt::Key_S) // save @@ -170,7 +170,7 @@ void EditMeasurePlugin::keyReleaseEvent(QKeyEvent *e, MeshModel &mod, GLArea *gl } else { - this->Log(GLLogStream::WARNING, "- cannot save measures to file -"); + this->log(GLLogStream::WARNING, "- cannot save measures to file -"); } } } diff --git a/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs.cpp b/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs.cpp index 914982e57..e6bfb2f03 100644 --- a/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs.cpp +++ b/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs.cpp @@ -89,7 +89,7 @@ void EditMutualCorrsPlugin::Decorate(MeshModel &m, GLArea *gla, QPainter *p) else status_line1.sprintf("Check the Info Tab if you need more details
    Active Point: %s",pointID[cindex].toStdString().c_str()); - this->RealTimeLog("Raster Alignment", m.shortName(), + this->realTimeLog("Raster Alignment", m.shortName(), "%s
    " "%s
    " "%s
    " @@ -570,12 +570,12 @@ void EditMutualCorrsPlugin::applyMutual() ///// Initialize GLContext - Log("Initialize GL"); + log("Initialize GL"); //glContext->makeCurrent(); if (this->initGL() == false) return; - Log("Done"); + log("Done"); for (int i = 0; i < align.mesh->fn; i++) for (int k = 0; k < 3; k++) @@ -634,7 +634,7 @@ void EditMutualCorrsPlugin::applyMutual() int rounds = (int)(solver.maxiter / 30); for (int i = 0; iRealTimeLog("Point Selection",m.shortName(), + this->realTimeLog("Point Selection",m.shortName(), "
    Viewpoint: %7.4f %7.4f %7.4f
    axis 0: %7.4f %7.4f %7.4f
    " "" "" diff --git a/src/meshlabplugins/edit_referencing/edit_referencing.cpp b/src/meshlabplugins/edit_referencing/edit_referencing.cpp index c442133ab..0b081200b 100644 --- a/src/meshlabplugins/edit_referencing/edit_referencing.cpp +++ b/src/meshlabplugins/edit_referencing/edit_referencing.cpp @@ -107,7 +107,7 @@ void EditReferencingPlugin::DecorateAbsolute(MeshModel &m, GLArea * /*gla*/, QPa else status_line1.sprintf("Active Point: %s",pointID[cindex].toStdString().c_str()); - this->RealTimeLog("Edit Referencing", m.shortName(), + this->realTimeLog("Edit Referencing", m.shortName(), "Absolute Referencing
    " "%s
    " "%s
    " @@ -229,7 +229,7 @@ void EditReferencingPlugin::DecorateScale(MeshModel &m, GLArea * /*gla*/, QPaint else status_line3.sprintf("NO VALID SCENE SCALE"); - this->RealTimeLog("Edit Referencing", m.shortName(), + this->realTimeLog("Edit Referencing", m.shortName(), "Scale Referencing
    " "%s
    " "%s

    " @@ -741,7 +741,7 @@ void EditReferencingPlugin::calculateMatrix() if(referencingDialog->ui->cbAllowScaling->checkState() == Qt::Checked) { - this->Log(GLLogStream::FILTER, "calculating NON RIGID transformation using %d reference points:", FixP.size()); + this->log(GLLogStream::FILTER, "calculating NON RIGID transformation using %d reference points:", FixP.size()); referencingResults.append(QString("NON RIGID transformation from %1 reference points:\n").arg(QString::number(FixP.size()))); ComputeSimilarityMatchMatrix(FixP, MovP, transfMatrix); validMatrix=true; @@ -749,7 +749,7 @@ void EditReferencingPlugin::calculateMatrix() } else { - this->Log(GLLogStream::FILTER, "calculating RIGID transformation using %d reference points:", FixP.size()); + this->log(GLLogStream::FILTER, "calculating RIGID transformation using %d reference points:", FixP.size()); referencingResults.append(QString("RIGID transformation from %1 reference points:\n").arg(QString::number(FixP.size()))); ComputeRigidMatchMatrix(FixP, MovP, transfMatrix); validMatrix=true; @@ -774,16 +774,16 @@ void EditReferencingPlugin::calculateMatrix() if(isMatrixRigid) - this->Log(GLLogStream::FILTER, "RIGID MATRIX:"); + this->log(GLLogStream::FILTER, "RIGID MATRIX:"); else - this->Log(GLLogStream::FILTER, "NON-RIGID MATRIX:"); - this->Log(GLLogStream::FILTER, "%f %f %f %f",transfMatrix[0][0],transfMatrix[0][1],transfMatrix[0][2],transfMatrix[0][3]); - this->Log(GLLogStream::FILTER, "%f %f %f %f",transfMatrix[1][0],transfMatrix[1][1],transfMatrix[1][2],transfMatrix[1][3]); - this->Log(GLLogStream::FILTER, "%f %f %f %f",transfMatrix[2][0],transfMatrix[2][1],transfMatrix[2][2],transfMatrix[2][3]); - this->Log(GLLogStream::FILTER, "%f %f %f %f",transfMatrix[3][0],transfMatrix[3][1],transfMatrix[3][2],transfMatrix[3][3]); + this->log(GLLogStream::FILTER, "NON-RIGID MATRIX:"); + this->log(GLLogStream::FILTER, "%f %f %f %f",transfMatrix[0][0],transfMatrix[0][1],transfMatrix[0][2],transfMatrix[0][3]); + this->log(GLLogStream::FILTER, "%f %f %f %f",transfMatrix[1][0],transfMatrix[1][1],transfMatrix[1][2],transfMatrix[1][3]); + this->log(GLLogStream::FILTER, "%f %f %f %f",transfMatrix[2][0],transfMatrix[2][1],transfMatrix[2][2],transfMatrix[2][3]); + this->log(GLLogStream::FILTER, "%f %f %f %f",transfMatrix[3][0],transfMatrix[3][1],transfMatrix[3][2],transfMatrix[3][3]); - this->Log(GLLogStream::FILTER, " "); - this->Log(GLLogStream::FILTER, "Residual Errors:"); + this->log(GLLogStream::FILTER, " "); + this->log(GLLogStream::FILTER, "Residual Errors:"); referencingResults.append("\n\nResidual Errors:\n\n"); @@ -792,7 +792,7 @@ void EditReferencingPlugin::calculateMatrix() if (usePoint[pindex]) { pointError[pindex] = (refPoints[pindex] - (transfMatrix * pickedPoints[pindex])).Norm(); - this->Log(GLLogStream::FILTER, "%s: %f", pointID[pindex].toStdString().c_str(), pointError[pindex]); + this->log(GLLogStream::FILTER, "%s: %f", pointID[pindex].toStdString().c_str(), pointError[pindex]); referencingResults.append(QString("Point %1: %2\n").arg(pointID[pindex]).arg(QString::number(pointError[pindex]))); } else diff --git a/src/meshlabplugins/edit_sample/edit_sample.cpp b/src/meshlabplugins/edit_sample/edit_sample.cpp index 4d1f64703..220b3f8af 100644 --- a/src/meshlabplugins/edit_sample/edit_sample.cpp +++ b/src/meshlabplugins/edit_sample/edit_sample.cpp @@ -129,7 +129,7 @@ void SampleEditPlugin::Decorate(MeshModel &m, GLArea * gla, QPainter *p) } } - this->RealTimeLog("Geometry Info", m.shortName(), + this->realTimeLog("Geometry Info", m.shortName(), "%s %s %s", line1.toStdString().c_str(), line2.toStdString().c_str(), line3.toStdString().c_str()); // finally, the actual decoration @@ -267,39 +267,39 @@ void SampleEditPlugin::keyReleaseEvent(QKeyEvent *e, MeshModel &m, GLArea *gla) // print on log if (pickmode == 0) { - this->Log(GLLogStream::FILTER, "------"); - this->Log(GLLogStream::FILTER, "face# %i : vert# (%i %i %i)", tri::Index(m.cm, curFacePtr), tri::Index(m.cm, curFacePtr->V(0)), tri::Index(m.cm, curFacePtr->V(1)), tri::Index(m.cm, curFacePtr->V(2))); + this->log(GLLogStream::FILTER, "------"); + this->log(GLLogStream::FILTER, "face# %i : vert# (%i %i %i)", tri::Index(m.cm, curFacePtr), tri::Index(m.cm, curFacePtr->V(0)), tri::Index(m.cm, curFacePtr->V(1)), tri::Index(m.cm, curFacePtr->V(2))); if (m.hasDataMask(MeshModel::MM_FACECOLOR)) - this->Log(GLLogStream::FILTER, "face color (%i %i %i %i)", curFacePtr->C()[0], curFacePtr->C()[1], curFacePtr->C()[2], curFacePtr->C()[3]); + this->log(GLLogStream::FILTER, "face color (%i %i %i %i)", curFacePtr->C()[0], curFacePtr->C()[1], curFacePtr->C()[2], curFacePtr->C()[3]); for (int i = 0; i < 3; ++i) { - this->Log(GLLogStream::FILTER, "face vert %i : vert# %i", i, tri::Index(m.cm, curFacePtr->V(i))); - this->Log(GLLogStream::FILTER, "position [%f %f %f]", curFacePtr->V(i)->P()[0], curFacePtr->V(i)->P()[1], curFacePtr->V(i)->P()[2]); - this->Log(GLLogStream::FILTER, "normal [%f %f %f]", curFacePtr->V(i)->N()[0], curFacePtr->V(i)->N()[1], curFacePtr->V(i)->N()[2]); + this->log(GLLogStream::FILTER, "face vert %i : vert# %i", i, tri::Index(m.cm, curFacePtr->V(i))); + this->log(GLLogStream::FILTER, "position [%f %f %f]", curFacePtr->V(i)->P()[0], curFacePtr->V(i)->P()[1], curFacePtr->V(i)->P()[2]); + this->log(GLLogStream::FILTER, "normal [%f %f %f]", curFacePtr->V(i)->N()[0], curFacePtr->V(i)->N()[1], curFacePtr->V(i)->N()[2]); if (m.hasDataMask(MeshModel::MM_VERTQUALITY)) - this->Log(GLLogStream::FILTER, "quality %f", curFacePtr->V(i)->Q()); + this->log(GLLogStream::FILTER, "quality %f", curFacePtr->V(i)->Q()); if (m.hasDataMask(MeshModel::MM_VERTCOLOR)) - this->Log(GLLogStream::FILTER, "color (%f %f %f %f)", curFacePtr->V(i)->C()[0], curFacePtr->V(i)->C()[1], curFacePtr->V(i)->C()[2], curFacePtr->V(i)->C()[3]); + this->log(GLLogStream::FILTER, "color (%f %f %f %f)", curFacePtr->V(i)->C()[0], curFacePtr->V(i)->C()[1], curFacePtr->V(i)->C()[2], curFacePtr->V(i)->C()[3]); if (m.hasDataMask(MeshModel::MM_WEDGTEXCOORD)) - this->Log(GLLogStream::FILTER, "wedge UV (%f %f) texID %i)", curFacePtr->WT(i).U(), curFacePtr->WT(i).V(), curFacePtr->WT(i).N()); + this->log(GLLogStream::FILTER, "wedge UV (%f %f) texID %i)", curFacePtr->WT(i).U(), curFacePtr->WT(i).V(), curFacePtr->WT(i).N()); if (m.hasDataMask(MeshModel::MM_VERTTEXCOORD)) - this->Log(GLLogStream::FILTER, "vertex UV (%f %f) texID %i)", curFacePtr->V(i)->T().U(), curFacePtr->V(i)->T().U(), curFacePtr->V(i)->T().N()); + this->log(GLLogStream::FILTER, "vertex UV (%f %f) texID %i)", curFacePtr->V(i)->T().U(), curFacePtr->V(i)->T().U(), curFacePtr->V(i)->T().N()); } - this->Log(GLLogStream::FILTER, "------"); + this->log(GLLogStream::FILTER, "------"); } else if (pickmode == 1) { - this->Log(GLLogStream::FILTER, "------"); - this->Log(GLLogStream::FILTER, "vertex# %i", tri::Index(m.cm, curVertPtr)); - this->Log(GLLogStream::FILTER, "position [%f %f %f]", curVertPtr->P()[0], curVertPtr->P()[1], curVertPtr->P()[2]); - this->Log(GLLogStream::FILTER, "normal [%f %f %f]", curVertPtr->N()[0], curVertPtr->N()[1], curVertPtr->N()[2]); + this->log(GLLogStream::FILTER, "------"); + this->log(GLLogStream::FILTER, "vertex# %i", tri::Index(m.cm, curVertPtr)); + this->log(GLLogStream::FILTER, "position [%f %f %f]", curVertPtr->P()[0], curVertPtr->P()[1], curVertPtr->P()[2]); + this->log(GLLogStream::FILTER, "normal [%f %f %f]", curVertPtr->N()[0], curVertPtr->N()[1], curVertPtr->N()[2]); if (m.hasDataMask(MeshModel::MM_VERTQUALITY)) - this->Log(GLLogStream::FILTER, "quality %f", curVertPtr->Q()); + this->log(GLLogStream::FILTER, "quality %f", curVertPtr->Q()); if (m.hasDataMask(MeshModel::MM_VERTCOLOR)) - this->Log(GLLogStream::FILTER, "color (%f %f %f %f)", curVertPtr->C()[0], curVertPtr->C()[1], curVertPtr->C()[2], curVertPtr->C()[3]); + this->log(GLLogStream::FILTER, "color (%f %f %f %f)", curVertPtr->C()[0], curVertPtr->C()[1], curVertPtr->C()[2], curVertPtr->C()[3]); if (m.hasDataMask(MeshModel::MM_VERTTEXCOORD)) - this->Log(GLLogStream::FILTER, "vertex UV (%f %f) texID %i)", curVertPtr->T().U(), curVertPtr->T().U(), curVertPtr->T().N()); - this->Log(GLLogStream::FILTER, "------"); + this->log(GLLogStream::FILTER, "vertex UV (%f %f) texID %i)", curVertPtr->T().U(), curVertPtr->T().U(), curVertPtr->T().N()); + this->log(GLLogStream::FILTER, "------"); } gla->update(); } diff --git a/src/meshlabplugins/edit_select/edit_select.cpp b/src/meshlabplugins/edit_select/edit_select.cpp index 600449b31..d2ce5cc05 100644 --- a/src/meshlabplugins/edit_select/edit_select.cpp +++ b/src/meshlabplugins/edit_select/edit_select.cpp @@ -519,7 +519,7 @@ void EditSelectPlugin::Decorate(MeshModel &m, GLArea * gla) line4 = "
    A select all, D de-select all, I invert all"; - this->RealTimeLog("Selection from Area", m.shortName(), + this->realTimeLog("Selection from Area", m.shortName(), "%s
    %s
    %s
    %s", line1.toStdString().c_str(), line2.toStdString().c_str(), line3.toStdString().c_str(), line4.toStdString().c_str()); return; @@ -535,7 +535,7 @@ void EditSelectPlugin::Decorate(MeshModel &m, GLArea * gla) line2 = "you may hold:
    - CTRL to add
    - SHIFT to subtract"; line3 = "
    A select all, D de-select all, I invert all"; - this->RealTimeLog("Interactive Selection", m.shortName(), "%s
    %s
    %s", line1.toStdString().c_str(), line2.toStdString().c_str(), line3.toStdString().c_str()); + this->realTimeLog("Interactive Selection", m.shortName(), "%s
    %s
    %s", line1.toStdString().c_str(), line2.toStdString().c_str(), line3.toStdString().c_str()); } if (isDragging) diff --git a/src/meshlabplugins/filter_ao/filter_ao.cpp b/src/meshlabplugins/filter_ao/filter_ao.cpp index 8607fd328..c089932ba 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.cpp +++ b/src/meshlabplugins/filter_ao/filter_ao.cpp @@ -344,7 +344,7 @@ bool AmbientOcclusionPlugin::processGL(MeshModel &m, vector &posVect) } } - Log(GLLogStream::SYSTEM,"Successfully calculated A.O. after %3.2f sec, %3.2f of which is due to initialization", ((float)tAll.elapsed()/1000.0f), ((float)tInitElapsed/1000.0f) ); + log(GLLogStream::SYSTEM,"Successfully calculated A.O. after %3.2f sec, %3.2f of which is due to initialization", ((float)tAll.elapsed()/1000.0f), ((float)tInitElapsed/1000.0f) ); /********** Clean up the mess ************/ @@ -385,7 +385,7 @@ void AmbientOcclusionPlugin::initGL(vcg::CallBackPos *cb, unsigned int numVertic cb(0, "Initializing: Glew and Hardware Capabilities"); if (!GLExtensionsManager::initializeGLextensions_notThrowing()) { - Log(GLLogStream::SYSTEM, "Error initializing OpenGL extensions"); + log(GLLogStream::SYSTEM, "Error initializing OpenGL extensions"); errInit = true; return; } @@ -396,13 +396,13 @@ void AmbientOcclusionPlugin::initGL(vcg::CallBackPos *cb, unsigned int numVertic if (depthTexSize < 16) { - Log(GLLogStream::SYSTEM, "Texture size is too small, 16x16 used instead"); + log(GLLogStream::SYSTEM, "Texture size is too small, 16x16 used instead"); depthTexSize = 16; depthTexArea = depthTexSize*depthTexSize; } if (depthTexSize > maxTexSize) { - Log(GLLogStream::SYSTEM, "Texture size is too large, %dx%d used instead",maxTexSize,maxTexSize); + log(GLLogStream::SYSTEM, "Texture size is too large, %dx%d used instead",maxTexSize,maxTexSize); depthTexSize = maxTexSize; depthTexArea = depthTexSize*depthTexSize; } @@ -419,14 +419,14 @@ void AmbientOcclusionPlugin::initGL(vcg::CallBackPos *cb, unsigned int numVertic { if (!glewIsSupported("GL_EXT_vertex_shader GL_EXT_fragment_shader")) { - Log(GLLogStream::SYSTEM, "Your hardware doesn't support Shaders, which are required for hw occlusion"); + log(GLLogStream::SYSTEM, "Your hardware doesn't support Shaders, which are required for hw occlusion"); errInit = true; return; } } if ( !glewIsSupported("GL_EXT_framebuffer_object") ) { - Log(GLLogStream::SYSTEM, "Your hardware doesn't support FBOs, which are required for hw occlusion"); + log(GLLogStream::SYSTEM, "Your hardware doesn't support FBOs, which are required for hw occlusion"); errInit = true; return; } @@ -438,7 +438,7 @@ void AmbientOcclusionPlugin::initGL(vcg::CallBackPos *cb, unsigned int numVertic //colorFormat = GL_RGB16F_ARB; //dataTypeFP = GL_HALF_FLOAT_ARB; - Log(GLLogStream::SYSTEM,"Your hardware can't do FP32 blending, and currently the FP16 version is not yet implemented."); + log(GLLogStream::SYSTEM,"Your hardware can't do FP32 blending, and currently the FP16 version is not yet implemented."); errInit = true; return; } @@ -448,7 +448,7 @@ void AmbientOcclusionPlugin::initGL(vcg::CallBackPos *cb, unsigned int numVertic } else { - Log(GLLogStream::SYSTEM,"Your hardware doesn't support floating point textures, which are required for hw occlusion"); + log(GLLogStream::SYSTEM,"Your hardware doesn't support floating point textures, which are required for hw occlusion"); errInit = true; return; } @@ -459,7 +459,7 @@ void AmbientOcclusionPlugin::initGL(vcg::CallBackPos *cb, unsigned int numVertic //******* CHECK MODEL SIZE ***********/ if ((maxTexSize*maxTexSize*maxTexPages) < numVertices && useGPU) { - Log(GLLogStream::SYSTEM, "That's a really huge model, I can't handle it in hardware, sorry.."); + log(GLLogStream::SYSTEM, "That's a really huge model, I can't handle it in hardware, sorry.."); errInit = true; return; } @@ -471,7 +471,7 @@ void AmbientOcclusionPlugin::initGL(vcg::CallBackPos *cb, unsigned int numVertic if (smartTexSize > maxTexSize) { //should ever enter this point, just exit with error - Log(GLLogStream::SYSTEM,"There was an error while determining best texture size, unable to continue"); + log(GLLogStream::SYSTEM,"There was an error while determining best texture size, unable to continue"); errInit = true; return; } @@ -621,25 +621,25 @@ bool AmbientOcclusionPlugin::checkFramebuffer() switch (fboStatus) { case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT: - Log(GLLogStream::SYSTEM, "FBO Incomplete: Attachment"); + log(GLLogStream::SYSTEM, "FBO Incomplete: Attachment"); break; case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT: - Log(GLLogStream::SYSTEM, "FBO Incomplete: Missing Attachment"); + log(GLLogStream::SYSTEM, "FBO Incomplete: Missing Attachment"); break; case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT: - Log(GLLogStream::SYSTEM, "FBO Incomplete: Dimensions"); + log(GLLogStream::SYSTEM, "FBO Incomplete: Dimensions"); break; case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT: - Log(GLLogStream::SYSTEM, "FBO Incomplete: Formats"); + log(GLLogStream::SYSTEM, "FBO Incomplete: Formats"); break; case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT: - Log(GLLogStream::SYSTEM, "FBO Incomplete: Draw Buffer"); + log(GLLogStream::SYSTEM, "FBO Incomplete: Draw Buffer"); break; case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT: - Log(GLLogStream::SYSTEM, "FBO Incomplete: Read Buffer"); + log(GLLogStream::SYSTEM, "FBO Incomplete: Read Buffer"); break; default: - Log(GLLogStream::SYSTEM, "Undefined FBO error"); + log(GLLogStream::SYSTEM, "Undefined FBO error"); assert(0); } diff --git a/src/meshlabplugins/filter_camera/filter_camera.cpp b/src/meshlabplugins/filter_camera/filter_camera.cpp index a2d2c65a8..85f432f41 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.cpp +++ b/src/meshlabplugins/filter_camera/filter_camera.cpp @@ -226,7 +226,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co case 0: if (rm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); return false; } tranVec=rm->shot.Extrinsics.Tra(); @@ -234,7 +234,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co case 1: if (cm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); return false; } tranVec=cm->shot.Extrinsics.Tra(); @@ -290,7 +290,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co { if (rm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); return false; } rm->shot.ApplyRigidTransformation(transf); @@ -300,7 +300,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co { if (cm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); return false; } cm->shot.ApplyRigidTransformation(transf); @@ -331,7 +331,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co case 0: if (rm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); return false; } tranVec=rm->shot.Extrinsics.Tra(); @@ -339,7 +339,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co case 1: if (cm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); return false; } tranVec=cm->shot.Extrinsics.Tra(); @@ -400,7 +400,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co { if (rm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); return false; } rm->shot.ApplyRigidTransformation(trTran); @@ -412,7 +412,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co { if (cm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); return false; } cm->shot.ApplyRigidTransformation(trTran); @@ -440,7 +440,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co case 0: if (rm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); return false; } trTran.SetTranslate(-rm->shot.Extrinsics.Tra()); @@ -448,7 +448,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co case 1: if (cm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); return false; } trTran.SetTranslate(-cm->shot.Extrinsics.Tra()); @@ -491,7 +491,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co { if (rm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); return false; } rm->shot.ApplyRigidTransformation(trTran); @@ -501,7 +501,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co { if (cm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); return false; } cm->shot.ApplyRigidTransformation(trTran); @@ -521,7 +521,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co { if (rm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); return false; } inv = rm->shot.Extrinsics.Rot(); @@ -568,7 +568,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co { if (rm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); return false; } rm->shot.ApplyRigidTransformation(mat); @@ -578,7 +578,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co { if (cm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); return false; } cm->shot.ApplyRigidTransformation(mat); @@ -593,7 +593,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co { if (rm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Raster Model to apply this filter!"); return false; } Shotm shotGot=par.getShotm("Shot"); @@ -610,7 +610,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co case FP_SET_MESH_CAMERA : if (cm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); return false; } cm->shot = par.getShotm("Shot"); @@ -619,7 +619,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co { if (cm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); return false; } if(!cm->shot.IsValid()) @@ -661,7 +661,7 @@ bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, co { if (cm == NULL) { - Log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); + log(GLLogStream::SYSTEM, "You need a Mesh Model to apply this filter!"); return false; } struct Correspondence{unsigned int id_img;float padding[3];}; diff --git a/src/meshlabplugins/filter_clean/cleanfilter.cpp b/src/meshlabplugins/filter_clean/cleanfilter.cpp index f2f5d75a9..4c183745f 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.cpp +++ b/src/meshlabplugins/filter_clean/cleanfilter.cpp @@ -291,18 +291,18 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, const Ric // the main processing pivot.BuildMesh(cb); m.clearDataMask(MeshModel::MM_FACEFACETOPO); - Log("Reconstructed surface. Added %i faces",m.cm.fn-startingFn); + log("Reconstructed surface. Added %i faces",m.cm.fn-startingFn); } break; case FP_REMOVE_ISOLATED_DIAMETER: { float minCC= par.getAbsPerc("MinComponentDiag"); std::pair delInfo= tri::Clean::RemoveSmallConnectedComponentsDiameter(m.cm,minCC); - Log("Removed %i connected components out of %i", delInfo.second, delInfo.first); + log("Removed %i connected components out of %i", delInfo.second, delInfo.first); if (par.getBool("removeUnref")) { int delvert = tri::Clean::RemoveUnreferencedVertex(m.cm); - Log("Removed %d unreferenced vertices", delvert); + log("Removed %d unreferenced vertices", delvert); } m.UpdateBoxAndNormals(); }break; @@ -310,11 +310,11 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, const Ric { float minCC= par.getInt("MinComponentSize"); std::pair delInfo=tri::Clean::RemoveSmallConnectedComponentsSize(m.cm,minCC); - Log("Removed %i connected components out of %i", delInfo.second, delInfo.first); + log("Removed %i connected components out of %i", delInfo.second, delInfo.first); if (par.getBool("removeUnref")) { int delvert = tri::Clean::RemoveUnreferencedVertex(m.cm); - Log("Removed %d unreferenced vertices", delvert); + log("Removed %d unreferenced vertices", delvert); } m.UpdateBoxAndNormals(); } break; @@ -341,7 +341,7 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, const Ric } m.clearDataMask(MeshModel::MM_FACEFACETOPO); - Log("Deleted %i vertices and %i faces with a quality lower than %f", deletedVN,deletedFN,val); + log("Deleted %i vertices and %i faces with a quality lower than %f", deletedVN,deletedFN,val); m.UpdateBoxAndNormals(); } break; @@ -350,7 +350,7 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, const Ric float threshold = par.getFloat("Threshold"); bool repeat = par.getBool("Repeat"); int total = tri::Clean::RemoveTVertexByCollapse(m.cm, threshold, repeat); - Log("Successfully removed %d t-vertices", total); + log("Successfully removed %d t-vertices", total); } break; case FP_REMOVE_TVERTEX_FLIP : @@ -358,7 +358,7 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, const Ric float threshold = par.getFloat("Threshold"); bool repeat = par.getBool("Repeat"); int total = tri::Clean::RemoveTVertexByFlip(m.cm, threshold, repeat); - Log("Successfully removed %d t-vertices", total); + log("Successfully removed %d t-vertices", total); } break; case FP_MERGE_WEDGE_TEX : @@ -366,41 +366,41 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, const Ric float threshold = par.getFloat("MergeThr"); tri::UpdateTopology::VertexFace(m.cm); int total = tri::UpdateTexture::WedgeTexMergeClose(m.cm, threshold); - Log("Successfully merged %d wedge tex coord distant less than %f", total,threshold); + log("Successfully merged %d wedge tex coord distant less than %f", total,threshold); } break; case FP_MERGE_CLOSE_VERTEX : { float threshold = par.getAbsPerc("Threshold"); int total = tri::Clean::MergeCloseVertex(m.cm, threshold); - Log("Successfully merged %d vertices", total); + log("Successfully merged %d vertices", total); } break; case FP_REMOVE_DUPLICATE_FACE : { int total = tri::Clean::RemoveDuplicateFace(m.cm); - Log("Successfully deleted %d duplicated faces", total); + log("Successfully deleted %d duplicated faces", total); } break; case FP_REMOVE_FOLD_FACE: { m.updateDataMask(MeshModel::MM_FACECOLOR); int total = tri::Clean::RemoveFaceFoldByFlip(m.cm); - Log("Successfully flipped %d folded faces", total); + log("Successfully flipped %d folded faces", total); m.UpdateBoxAndNormals(); } break; case FP_REMOVE_NON_MANIF_EDGE : { int total = tri::Clean::RemoveNonManifoldFace(m.cm); - Log("Successfully removed %d non-manifold faces", total); + log("Successfully removed %d non-manifold faces", total); m.UpdateBoxAndNormals(); } break; case FP_REMOVE_NON_MANIF_EDGE_SPLIT : { int total = tri::Clean::SplitManifoldComponents(m.cm); - Log("Successfully split the mesh into %d edge manifold components", total); + log("Successfully split the mesh into %d edge manifold components", total); m.UpdateBoxAndNormals(); } break; @@ -408,28 +408,28 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, const Ric { float threshold = par.getFloat("VertDispRatio"); int total = tri::Clean::SplitNonManifoldVertex(m.cm,threshold); - Log("Successfully split %d non manifold vertices faces", total); + log("Successfully split %d non manifold vertices faces", total); m.UpdateBoxAndNormals(); } break; case FP_REMOVE_FACE_ZERO_AREA: { int nullFaces = tri::Clean::RemoveFaceOutOfRangeArea(m.cm, 0); - Log("Removed %d null faces", nullFaces); + log("Removed %d null faces", nullFaces); m.clearDataMask(MeshModel::MM_FACEFACETOPO); } break; case FP_REMOVE_UNREFERENCED_VERTEX: { int delvert = tri::Clean::RemoveUnreferencedVertex(m.cm); - Log("Removed %d unreferenced vertices", delvert); + log("Removed %d unreferenced vertices", delvert); if (delvert != 0) m.UpdateBoxAndNormals(); } break; case FP_REMOVE_DUPLICATED_VERTEX: { int delvert = tri::Clean::RemoveDuplicateVertex(m.cm); - Log("Removed %d duplicated vertices", delvert); + log("Removed %d duplicated vertices", delvert); if (delvert != 0) m.UpdateBoxAndNormals(); m.clearDataMask(MeshModel::MM_FACEFACETOPO); m.clearDataMask(MeshModel::MM_VERTFACETOPO); @@ -439,7 +439,7 @@ bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, const Ric { float threshold = par.getFloat("EdgeDistRatio"); int total = SnapVertexBorder(m.cm, threshold,cb); - Log("Successfully Split %d faces to snap", total); + log("Successfully Split %d faces to snap", total); m.clearDataMask(MeshModel::MM_FACEFACETOPO); m.clearDataMask(MeshModel::MM_VERTFACETOPO); } break; diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp index 12513d3e0..0db938b05 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp @@ -265,7 +265,7 @@ bool FilterColorProjectionPlugin::applyFilter(const QAction *filter, MeshDocumen delete rendermanager; return false; } - Log("init GL"); + log("init GL"); //if( rendermanager->initializeMeshBuffers(model, cb) != 0 ) // return false; //Log("init Buffers"); @@ -364,7 +364,7 @@ bool FilterColorProjectionPlugin::applyFilter(const QAction *filter, MeshDocumen tri::UpdateBounding::Box(model->cm); // init accumulation buffers for colors and weights - Log("init color accumulation buffers"); + log("init color accumulation buffers"); weights = new double[model->cm.vn]; acc_red = new double[model->cm.vn]; acc_grn = new double[model->cm.vn]; @@ -423,7 +423,7 @@ bool FilterColorProjectionPlugin::applyFilter(const QAction *filter, MeshDocumen rendermanager = new RenderHelper(); if( rendermanager->initializeGL(cb) != 0 ) return false; - Log("init GL"); + log("init GL"); /*if( rendermanager->initializeMeshBuffers(model, cb) != 0 ) return false; Log("init Buffers");*/ @@ -738,7 +738,7 @@ bool FilterColorProjectionPlugin::applyFilter(const QAction *filter, MeshDocumen rendermanager = new RenderHelper(); if( rendermanager->initializeGL(cb) != 0 ) return false; - Log("init GL"); + log("init GL"); /*if( rendermanager->initializeMeshBuffers(model, cb) != 0 ) return false; Log("init Buffers");*/ @@ -899,7 +899,7 @@ bool FilterColorProjectionPlugin::applyFilter(const QAction *filter, MeshDocumen // Save texture cb(90, "Saving texture ..."); CheckError(!img.save(filePath), "Texture file cannot be saved"); - Log( "Texture \"%s\" Created", filePath.toStdString().c_str()); + log( "Texture \"%s\" Created", filePath.toStdString().c_str()); assert(QFile(filePath).exists()); // Assign texture diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp index ca41d5650..18bee1a62 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp @@ -550,7 +550,7 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, const m->updateDataMask(MeshModel::MM_VERTCOLOR); tri::UpdateColor::PerVertexQualityRamp(m->cm, H.Percentile(0.1f), H.Percentile(0.9f)); } - Log("Saturated Vertex Quality"); + log("Saturated Vertex Quality"); return true; } @@ -579,11 +579,11 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, const if (usePerc) { tri::UpdateColor::PerVertexQualityRamp(m->cm, PercLo, PercHi); - Log("Quality Range: %f %f; Used (%f %f) percentile (%f %f) ", H.MinV(), H.MaxV(), PercLo, PercHi, par.getDynamicFloat("perc"), 100 - par.getDynamicFloat("perc")); + log("Quality Range: %f %f; Used (%f %f) percentile (%f %f) ", H.MinV(), H.MaxV(), PercLo, PercHi, par.getDynamicFloat("perc"), 100 - par.getDynamicFloat("perc")); } else { tri::UpdateColor::PerVertexQualityRamp(m->cm, RangeMin, RangeMax); - Log("Quality Range: %f %f; Used (%f %f)", H.MinV(), H.MaxV(), RangeMin, RangeMax); + log("Quality Range: %f %f; Used (%f %f)", H.MinV(), H.MaxV(), RangeMin, RangeMax); } return true; } @@ -611,11 +611,11 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, const if (usePerc) { tri::UpdateQuality::VertexClamp(m->cm, PercLo, PercHi); - Log("Quality Range: %f %f; Used (%f %f) percentile (%f %f) ", H.MinV(), H.MaxV(), PercLo, PercHi, par.getDynamicFloat("perc"), 100 - par.getDynamicFloat("perc")); + log("Quality Range: %f %f; Used (%f %f) percentile (%f %f) ", H.MinV(), H.MaxV(), PercLo, PercHi, par.getDynamicFloat("perc"), 100 - par.getDynamicFloat("perc")); } else { tri::UpdateQuality::VertexClamp(m->cm, RangeMin, RangeMax); - Log("Quality Range: %f %f; Used (%f %f)", H.MinV(), H.MaxV(), RangeMin, RangeMax); + log("Quality Range: %f %f; Used (%f %f)", H.MinV(), H.MaxV(), RangeMin, RangeMax); } return true; } @@ -644,12 +644,12 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, const if (usePerc){ tri::UpdateColor::PerFaceQualityRamp(m->cm, PercLo, PercHi); - Log("Quality Range: %f %f; Used (%f %f) percentile (%f %f) ", + log("Quality Range: %f %f; Used (%f %f) percentile (%f %f) ", H.MinV(), H.MaxV(), PercLo, PercHi, perc, 100 - perc); } else { tri::UpdateColor::PerFaceQualityRamp(m->cm, RangeMin, RangeMax); - Log("Quality Range: %f %f; Used (%f %f)", H.MinV(), H.MaxV(), RangeMin, RangeMax); + log("Quality Range: %f %f; Used (%f %f)", H.MinV(), H.MaxV(), RangeMin, RangeMax); } return true; } @@ -666,24 +666,24 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, const } int delvert = tri::Clean::RemoveUnreferencedVertex(m->cm); - if (delvert) Log("Pre-Curvature Cleaning: Removed %d unreferenced vertices", delvert); + if (delvert) log("Pre-Curvature Cleaning: Removed %d unreferenced vertices", delvert); tri::Allocator::CompactVertexVector(m->cm); tri::UpdateCurvature::MeanAndGaussian(m->cm); int curvType = par.getEnum("CurvatureType"); switch (curvType) { - case 0: tri::UpdateQuality::VertexFromMeanCurvatureHG(m->cm); Log("Computed Mean Curvature"); break; - case 1: tri::UpdateQuality::VertexFromGaussianCurvatureHG(m->cm); Log("Computed Gaussian Curvature"); break; - case 2: tri::UpdateQuality::VertexFromRMSCurvature(m->cm); Log("Computed RMS Curvature"); break; - case 3: tri::UpdateQuality::VertexFromAbsoluteCurvature(m->cm); Log("Computed ABS Curvature"); break; + case 0: tri::UpdateQuality::VertexFromMeanCurvatureHG(m->cm); log("Computed Mean Curvature"); break; + case 1: tri::UpdateQuality::VertexFromGaussianCurvatureHG(m->cm); log("Computed Gaussian Curvature"); break; + case 2: tri::UpdateQuality::VertexFromRMSCurvature(m->cm); log("Computed RMS Curvature"); break; + case 3: tri::UpdateQuality::VertexFromAbsoluteCurvature(m->cm); log("Computed ABS Curvature"); break; default: assert(0); } Histogramf H; tri::Stat::ComputePerVertexQualityHistogram(m->cm, H); tri::UpdateColor::PerVertexQualityRamp(m->cm, H.Percentile(0.1f), H.Percentile(0.9f)); - Log("Curvature Range: %f %f (Used 90 percentile %f %f) ", H.MinV(), H.MaxV(), H.Percentile(0.1f), H.Percentile(0.9f)); + log("Curvature Range: %f %f (Used 90 percentile %f %f) ", H.MinV(), H.MaxV(), H.Percentile(0.1f), H.Percentile(0.9f)); return true; } diff --git a/src/meshlabplugins/filter_create/filter_create.cpp b/src/meshlabplugins/filter_create/filter_create.cpp index f12a65dd0..ee117ffbd 100644 --- a/src/meshlabplugins/filter_create/filter_create.cpp +++ b/src/meshlabplugins/filter_create/filter_create.cpp @@ -240,7 +240,7 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, const Ri selected_pts.push_back(p); Naccum = Naccum + (*vi).N(); } - Log("Using %i vertices to build a fitting plane", int(selected_pts.size())); + log("Using %i vertices to build a fitting plane", int(selected_pts.size())); Plane3m plane; FitPlaneToPointSet(selected_pts, plane); plane.Normalize(); @@ -253,9 +253,9 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, const Ri float errorSum = 0; for (size_t i = 0; i < selected_pts.size(); ++i) errorSum += fabs(SignedDistancePlanePoint(plane, selected_pts[i])); - Log("Fitting Plane avg error is %f", errorSum / float(selected_pts.size())); - Log("Fitting Plane normal is [%f, %f, %f]", plane.Direction().X(), plane.Direction().Y(), plane.Direction().Z()); - Log("Fitting Plane offset is %f", plane.Offset()); + log("Fitting Plane avg error is %f", errorSum / float(selected_pts.size())); + log("Fitting Plane normal is [%f, %f, %f]", plane.Direction().X(), plane.Direction().Y(), plane.Direction().Z()); + log("Fitting Plane offset is %f", plane.Offset()); // find center of selection on plane Point3m centerP; @@ -264,7 +264,7 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, const Ri centerP += plane.Projection(selected_pts[i]); } centerP /= selected_pts.size(); - Log("center [%f, %f, %f]", centerP.X(), centerP.Y(), centerP.Z()); + log("center [%f, %f, %f]", centerP.X(), centerP.Y(), centerP.Z()); // find horizontal and vertical axis Point3m dirH, dirV; @@ -360,8 +360,8 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, const Ri } } - Log("H [%f, %f, %f]", dirH.X(), dirH.Y(), dirH.Z()); - Log("V [%f, %f, %f]", dirV.X(), dirV.Y(), dirV.Z()); + log("H [%f, %f, %f]", dirH.X(), dirH.Y(), dirH.Z()); + log("V [%f, %f, %f]", dirV.X(), dirV.Y(), dirV.Z()); // find extent @@ -381,7 +381,7 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, const Ri float exScale = par.getFloat("extent"); dimV = dimV * exScale; dimH = dimH * exScale; - Log("extent on plane [%f, %f]", dimV, dimH); + log("extent on plane [%f, %f]", dimV, dimH); int vertNum = par.getInt("subdiv") + 1; if (vertNum <= 1) vertNum = 2; diff --git a/src/meshlabplugins/filter_csg/filter_csg.cpp b/src/meshlabplugins/filter_csg/filter_csg.cpp index d14c1b4f2..d95d65471 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.cpp +++ b/src/meshlabplugins/filter_csg/filter_csg.cpp @@ -125,20 +125,20 @@ bool FilterCSG::applyFilter(const QAction *filter, MeshDocument &md, const RichP MeshModel *secondMesh = par.getMesh("SecondMesh"); if ((firstMesh == NULL) || (secondMesh == NULL)) { - Log("CSG filter: cannot compute, mesh does not exist"); + log("CSG filter: cannot compute, mesh does not exist"); errorMessage = "cannot compute, mesh does not exist"; return false; } if ((firstMesh->cm.fn == 0) || (secondMesh->cm.fn == 0)) { - Log("CSG filter: cannot compute, mesh has no faces"); + log("CSG filter: cannot compute, mesh has no faces"); errorMessage = "cannot compute, mesh has no faces"; return false; } if (firstMesh == secondMesh){ - Log("CSG filter: cannot compute, it is the same mesh"); + log("CSG filter: cannot compute, it is the same mesh"); errorMessage = "Cannot compute, it is the same mesh"; return false; // can't continue, mesh can't be processed } @@ -168,27 +168,27 @@ bool FilterCSG::applyFilter(const QAction *filter, MeshDocument &md, const RichP const Scalarm d = par.getFloat("Delta"); const Point3m delta(d, d, d); const int subFreq = par.getInt("SubDelta"); - Log(GLLogStream::SYSTEM, "Rasterizing first volume..."); + log(GLLogStream::SYSTEM, "Rasterizing first volume..."); InterceptVolume v = InterceptSet3(tmpfirstmesh.cm, delta, subFreq, cb); - Log(GLLogStream::SYSTEM, "Rasterizing second volume..."); + log(GLLogStream::SYSTEM, "Rasterizing second volume..."); InterceptVolume tmp = InterceptSet3(tmpsecondmesh.cm, delta, subFreq, cb); MeshModel *mesh; switch(par.getEnum("Operator")){ case CSG_OPERATION_INTERSECTION: - Log(GLLogStream::SYSTEM, "Intersection..."); + log(GLLogStream::SYSTEM, "Intersection..."); v &= tmp; mesh = md.addNewMesh("","intersection"); break; case CSG_OPERATION_UNION: - Log(GLLogStream::SYSTEM, "Union..."); + log(GLLogStream::SYSTEM, "Union..."); v |= tmp; mesh = md.addNewMesh("","union"); break; case CSG_OPERATION_DIFFERENCE: - Log(GLLogStream::SYSTEM, "Difference..."); + log(GLLogStream::SYSTEM, "Difference..."); v -= tmp; mesh = md.addNewMesh("","difference"); break; @@ -198,13 +198,13 @@ bool FilterCSG::applyFilter(const QAction *filter, MeshDocument &md, const RichP return true; } - Log(GLLogStream::SYSTEM, "Building mesh..."); + log(GLLogStream::SYSTEM, "Building mesh..."); typedef vcg::intercept::Walker MyWalker; typedef vcg::tri::MarchingCubes MyMarchingCubes; MyWalker walker; MyMarchingCubes mc(mesh->cm, walker); walker.BuildMesh(mesh->cm, v, mc, cb); - Log(GLLogStream::SYSTEM, "Done"); + log(GLLogStream::SYSTEM, "Done"); vcg::tri::UpdateBounding::Box(mesh->cm); vcg::tri::UpdateNormal::PerFaceFromCurrentVertexNormal(mesh->cm); diff --git a/src/meshlabplugins/filter_func/filter_func.cpp b/src/meshlabplugins/filter_func/filter_func.cpp index f7885987f..d5dd344c0 100644 --- a/src/meshlabplugins/filter_func/filter_func.cpp +++ b/src/meshlabplugins/filter_func/filter_func.cpp @@ -420,7 +420,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, } // if succeeded log stream contains number of vertices and time elapsed - Log( "selected %d vertices in %.2f sec.", numvert, (clock() - start) / (float) CLOCKS_PER_SEC); + log( "selected %d vertices in %.2f sec.", numvert, (clock() - start) / (float) CLOCKS_PER_SEC); return true; } @@ -465,7 +465,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, } // if succeeded log stream contains number of vertices and time elapsed - Log( "selected %d faces in %.2f sec.", numface, (clock() - start) / (float) CLOCKS_PER_SEC); + log( "selected %d faces in %.2f sec.", numface, (clock() - start) / (float) CLOCKS_PER_SEC); return true; } @@ -487,7 +487,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, if (onSelected && m.cm.svn == 0 && m.cm.sfn == 0) // if no selection at all, fail { - Log("Cannot apply only on selection: there is no selection"); + log("Cannot apply only on selection: there is no selection"); errorMessage = "Cannot apply only on selection: there is no selection"; return false; } @@ -555,7 +555,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, } // if succeeded log stream contains number of vertices processed and time elapsed - Log( "%d vertices processed in %.2f sec.", m.cm.vn, (clock() - start) / (float) CLOCKS_PER_SEC); + log( "%d vertices processed in %.2f sec.", m.cm.vn, (clock() - start) / (float) CLOCKS_PER_SEC); return true; } @@ -568,7 +568,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, if (onSelected && m.cm.svn == 0 && m.cm.sfn == 0) // if no selection at all, fail { - Log("Cannot apply only on selection: there is no selection"); + log("Cannot apply only on selection: there is no selection"); errorMessage = "Cannot apply only on selection: there is no selection"; return false; } @@ -616,7 +616,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, m.updateDataMask(MeshModel::MM_VERTCOLOR); } // if succeeded log stream contains number of vertices and time elapsed - Log( "%d vertices processed in %.2f sec.", m.cm.vn, (clock() - start) / (float) CLOCKS_PER_SEC); + log( "%d vertices processed in %.2f sec.", m.cm.vn, (clock() - start) / (float) CLOCKS_PER_SEC); return true; } @@ -629,7 +629,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, if (onSelected && m.cm.svn == 0 && m.cm.sfn == 0) // if no selection at all, fail { - Log("Cannot apply only on selection: there is no selection"); + log("Cannot apply only on selection: there is no selection"); errorMessage = "Cannot apply only on selection: there is no selection"; return false; } @@ -675,7 +675,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, } } - Log( "%d vertices processed in %.2f sec.", m.cm.vn, (clock() - start) / (float) CLOCKS_PER_SEC); + log( "%d vertices processed in %.2f sec.", m.cm.vn, (clock() - start) / (float) CLOCKS_PER_SEC); return true; } break; @@ -691,7 +691,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, if (onSelected && m.cm.sfn == 0) // if no selection, fail { - Log("Cannot apply only on selection: there is no selection"); + log("Cannot apply only on selection: there is no selection"); errorMessage = "Cannot apply only on selection: there is no selection"; return false; } @@ -730,7 +730,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, } } - Log( "%d faces processed in %.2f sec.", m.cm.fn, (clock() - start) / (float) CLOCKS_PER_SEC); + log( "%d faces processed in %.2f sec.", m.cm.fn, (clock() - start) / (float) CLOCKS_PER_SEC); return true; } break; @@ -744,7 +744,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, if (onSelected && m.cm.sfn == 0) // if no selection, fail { - Log("Cannot apply only on selection: there is no selection"); + log("Cannot apply only on selection: there is no selection"); errorMessage = "Cannot apply only on selection: there is no selection"; return false; } @@ -793,7 +793,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, } // if succeeded log stream contains number of vertices processed and time elapsed - Log( "%d faces processed in %.2f sec.", m.cm.fn, (clock() - start) / (float) CLOCKS_PER_SEC); + log( "%d faces processed in %.2f sec.", m.cm.fn, (clock() - start) / (float) CLOCKS_PER_SEC); return true; @@ -807,7 +807,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, if (onSelected && m.cm.sfn == 0) // if no selection, fail { - Log("Cannot apply only on selection: there is no selection"); + log("Cannot apply only on selection: there is no selection"); errorMessage = "Cannot apply only on selection: there is no selection"; return false; } @@ -852,7 +852,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, } // if succeeded log stream contains number of faces processed and time elapsed - Log( "%d faces processed in %.2f sec.", m.cm.fn, (clock() - start) / (float) CLOCKS_PER_SEC); + log( "%d faces processed in %.2f sec.", m.cm.fn, (clock() - start) / (float) CLOCKS_PER_SEC); return true; } @@ -909,7 +909,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, v_handlers.push_back(h); // if succeeded log stream contains number of vertices processed and time elapsed - Log( "%d vertices processed in %.2f sec.", m.cm.vn, (clock() - start) / (float) CLOCKS_PER_SEC); + log( "%d vertices processed in %.2f sec.", m.cm.vn, (clock() - start) / (float) CLOCKS_PER_SEC); return true; } @@ -963,7 +963,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, // fhandlers.push_back(h); // if succeeded log stream contains number of vertices processed and time elapsed - Log( "%d faces processed in %.2f sec.", m.cm.fn, (clock() - start) / (float) CLOCKS_PER_SEC); + log( "%d faces processed in %.2f sec.", m.cm.fn, (clock() - start) / (float) CLOCKS_PER_SEC); return true; } @@ -1033,7 +1033,7 @@ bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, p.DefineVar(conversion::fromStringToWString("z"), &z); std::string expr = par.getString("expr").toStdString(); p.SetExpr(conversion::fromStringToWString(expr)); - Log("Filling a Volume of %i %i %i",siz[0],siz[1],siz[2]); + log("Filling a Volume of %i %i %i",siz[0],siz[1],siz[2]); volume.Init(siz,RangeBBox); for(double i=0;i(m.cm, volume, mc, 0); // Matrix44m tr; tr.SetIdentity(); tr.SetTranslate(rbb.min[0],rbb.min[1],rbb.min[2]); diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp index eb7d2c604..f5ad6e15d 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp @@ -134,7 +134,7 @@ bool FilterGeodesic::applyFilter(const QAction *filter, MeshDocument &md, const } - Log("Input point is %f %f %f Closest on surf is %f %f %f",startPoint[0],startPoint[1],startPoint[2],startVertex->P()[0],startVertex->P()[1],startVertex->P()[2]); + log("Input point is %f %f %f Closest on surf is %f %f %f",startPoint[0],startPoint[1],startPoint[2],startVertex->P()[0],startVertex->P()[1],startVertex->P()[2]); // Now actually compute the geodesic distance from the closest point float dist_thr = par.getAbsPerc("maxDistance"); @@ -151,7 +151,7 @@ bool FilterGeodesic::applyFilter(const QAction *filter, MeshDocument &md, const (*vi).Q()=0; } if(unreachedCnt >0 ) - Log("Warning: %i vertices were unreachable from the borders, probably your mesh has unreferenced vertices",unreachedCnt); + log("Warning: %i vertices were unreachable from the borders, probably your mesh has unreferenced vertices",unreachedCnt); tri::UpdateColor::PerVertexQualityRamp(m.cm); @@ -178,9 +178,9 @@ bool FilterGeodesic::applyFilter(const QAction *filter, MeshDocument &md, const (*vi).Q()=0; } if(unreachedCnt >0 ) - Log("Warning: %i vertices were unreachable from the borders, probably your mesh has unreferenced vertices",unreachedCnt); + log("Warning: %i vertices were unreachable from the borders, probably your mesh has unreferenced vertices",unreachedCnt); - if(!ret) Log("Mesh Has no borders. No geodesic distance computed"); + if(!ret) log("Mesh Has no borders. No geodesic distance computed"); else tri::UpdateColor::PerVertexQualityRamp(m.cm); } @@ -219,12 +219,12 @@ bool FilterGeodesic::applyFilter(const QAction *filter, MeshDocument &md, const }); if(unreachedCnt >0 ) - Log("Warning: %i vertices were unreachable from the seeds, probably your mesh has unreferenced vertices",unreachedCnt); + log("Warning: %i vertices were unreachable from the seeds, probably your mesh has unreferenced vertices",unreachedCnt); tri::UpdateColor::PerVertexQualityRamp(m.cm); } else - Log("Warning: no vertices are selected! aborting geodesic computation."); + log("Warning: no vertices are selected! aborting geodesic computation."); } break; default: assert(0); diff --git a/src/meshlabplugins/filter_globalregistration/globalregistration.cpp b/src/meshlabplugins/filter_globalregistration/globalregistration.cpp index 97d6118c6..2cfe4bebf 100644 --- a/src/meshlabplugins/filter_globalregistration/globalregistration.cpp +++ b/src/meshlabplugins/filter_globalregistration/globalregistration.cpp @@ -195,7 +195,7 @@ bool GlobalRegistrationPlugin::applyFilter(const QAction */*filter*/, } // run - Log("Final LCP = %f", score); + log("Final LCP = %f", score); v.mesh->Tr.FromEigenMatrix(mat); return true; 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 cb7986ca8..c06426e93 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 @@ -303,7 +303,7 @@ bool FilterImgPatchParamPlugin::applyFilter(const QAction *act, painter.paint( patches ); if( par.getBool("colorCorrection") ) painter.rectifyColor( patches, par.getInt("colorCorrectionFilterSize") ); - Log( "TEXTURE PAINTING: %.3f sec.", 0.001f*t.elapsed() ); + log( "TEXTURE PAINTING: %.3f sec.", 0.001f*t.elapsed() ); QImage tex = painter.getTexture(); if( tex.save(texName) ) @@ -916,14 +916,14 @@ void FilterImgPatchParamPlugin::patchBasedTextureParameterization( RasterPatchMa if( par.getBool("useAlphaWeight") ) weightMask |= VisibleSet::W_IMG_ALPHA; VisibleSet faceVis( *m_Context,glContext,meshid, mesh, rasterList, weightMask ); - Log( "VISIBILITY CHECK: %.3f sec.", 0.001f*t.elapsed() ); + log( "VISIBILITY CHECK: %.3f sec.", 0.001f*t.elapsed() ); // Boundary optimization: the goal is to produce more regular boundaries between surface regions // associated to different reference images. t.start(); boundaryOptimization( mesh, faceVis, true ); - Log( "BOUNDARY OPTIMIZATION: %.3f sec.", 0.001f*t.elapsed() ); + log( "BOUNDARY OPTIMIZATION: %.3f sec.", 0.001f*t.elapsed() ); // Incorporates patches compounds of only one triangles to one of their neighbours. @@ -931,8 +931,8 @@ void FilterImgPatchParamPlugin::patchBasedTextureParameterization( RasterPatchMa { t.start(); int triCleaned = cleanIsolatedTriangles( mesh, faceVis ); - Log( "CLEANING ISOLATED TRIANGLES: %.3f sec.", 0.001f*t.elapsed() ); - Log( " * %i triangles cleaned.", triCleaned ); + log( "CLEANING ISOLATED TRIANGLES: %.3f sec.", 0.001f*t.elapsed() ); + log( " * %i triangles cleaned.", triCleaned ); } @@ -940,8 +940,8 @@ void FilterImgPatchParamPlugin::patchBasedTextureParameterization( RasterPatchMa t.start(); float oldArea = computeTotalPatchArea( patches ); int nbPatches = extractPatches( patches, nullPatches, mesh, faceVis, rasterList ); - Log( "PATCH EXTRACTION: %.3f sec.", 0.001f*t.elapsed() ); - Log( " * %i patches extracted, %i null patches.", nbPatches, nullPatches.size() ); + log( "PATCH EXTRACTION: %.3f sec.", 0.001f*t.elapsed() ); + log( " * %i patches extracted, %i null patches.", nbPatches, nullPatches.size() ); // Extends each patch so as to include faces that belong to the other side of its boundary. @@ -950,7 +950,7 @@ void FilterImgPatchParamPlugin::patchBasedTextureParameterization( RasterPatchMa for( RasterPatchMap::iterator rp=patches.begin(); rp!=patches.end(); ++rp ) for( PatchVec::iterator p=rp->begin(); p!=rp->end(); ++p ) constructPatchBoundary( *p, faceVis ); - Log( "PATCH EXTENSION: %.3f sec.", 0.001f*t.elapsed() ); + log( "PATCH EXTENSION: %.3f sec.", 0.001f*t.elapsed() ); // Compute the UV coordinates of all patches by projecting them onto their reference images. @@ -959,7 +959,7 @@ void FilterImgPatchParamPlugin::patchBasedTextureParameterization( RasterPatchMa oldArea = computeTotalPatchArea( patches ); for( RasterPatchMap::iterator rp=patches.begin(); rp!=patches.end(); ++rp ) computePatchUV( mesh, rp.key(), rp.value() ); - Log( "PATCHES UV COMPUTATION: %.3f sec.", 0.001f*t.elapsed() ); + log( "PATCHES UV COMPUTATION: %.3f sec.", 0.001f*t.elapsed() ); // Merge patches so as to reduce the occupied texture area when their bounding boxes overlap. @@ -967,9 +967,9 @@ void FilterImgPatchParamPlugin::patchBasedTextureParameterization( RasterPatchMa oldArea = computeTotalPatchArea( patches ); for( RasterPatchMap::iterator rp=patches.begin(); rp!=patches.end(); ++rp ) mergeOverlappingPatches( *rp ); - Log( "PATCH MERGING: %.3f sec.", 0.001f*t.elapsed() ); - Log( " * Area reduction: %.1f%%.", 100.0f*computeTotalPatchArea(patches)/oldArea ); - Log( " * Patches number reduced from %i to %i.", nbPatches, computePatchCount(patches) ); + log( "PATCH MERGING: %.3f sec.", 0.001f*t.elapsed() ); + log( " * Area reduction: %.1f%%.", 100.0f*computeTotalPatchArea(patches)/oldArea ); + log( " * Patches number reduced from %i to %i.", nbPatches, computePatchCount(patches) ); // Patches' bounding boxes are packed in texture space. After this operation, boxes are still defined @@ -977,7 +977,7 @@ void FilterImgPatchParamPlugin::patchBasedTextureParameterization( RasterPatchMa // space, ranging from [0,0] to [1,1]. t.start(); patchPacking( patches, par.getInt("textureGutter"), par.getBool("stretchingAllowed") ); - Log( "PATCH TEXTURE PACKING: %.3f sec.", 0.001f*t.elapsed() ); + log( "PATCH TEXTURE PACKING: %.3f sec.", 0.001f*t.elapsed() ); // Clear the UV coordinates for patches that are not visible in any image. diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp index bffdc82a5..76c2ce44c 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp @@ -172,11 +172,11 @@ void FilterIsoParametrization::PrintStats(CMeshO *mesh) StatEdge(*mesh,minE,maxE,avE,stdE); StatArea(*mesh,minAr,maxAr,avAr,stdAr); StatAngle(*mesh,minAn,maxAn,avAn,stdAn); - Log(" REMESHED "); - Log("Irregular Vertices:%d ",non_reg); - Log("stdDev Area: %5.2f",stdAr/avAr); - Log("stdDev Angle: %5.2f",stdAn/avAn); - Log("stdDev Edge: %5.2f",stdE/avE); + log(" REMESHED "); + log("Irregular Vertices:%d ",non_reg); + log("stdDev Area: %5.2f",stdAr/avAr); + log("stdDev Angle: %5.2f",stdAn/avAn); + log("stdDev Edge: %5.2f",stdE/avE); } bool FilterIsoParametrization::applyFilter(const QAction *filter, MeshDocument& md, const RichParameterList & par, vcg::CallBackPos *cb) @@ -234,7 +234,7 @@ bool FilterIsoParametrization::applyFilter(const QAction *filter, MeshDocument& float aggregate,L2; int n_faces; Parametrizator.getValues(aggregate,L2,n_faces); - Log("Num Faces of Abstract Domain: %d, One way stretch efficiency: %.4f, Area+Angle Distorsion %.4f ",n_faces,L2,aggregate*100.f); + log("Num Faces of Abstract Domain: %d, One way stretch efficiency: %.4f, Area+Angle Distorsion %.4f ",n_faces,L2,aggregate*100.f); } else { @@ -325,11 +325,11 @@ bool FilterIsoParametrization::applyFilter(const QAction *filter, MeshDocument& int n_diamonds,inFace,inEdge,inStar,n_merged; DiamSampl.getResData(n_diamonds,inFace,inEdge,inStar,n_merged); - Log("INTERPOLATION DOMAINS"); - Log("In Face: %d \n",inFace); - Log("In Diamond: %d \n",inEdge); - Log("In Star: %d \n",inStar); - Log("Merged %d vertices\n",n_merged); + log("INTERPOLATION DOMAINS"); + log("In Face: %d \n",inFace); + log("In Diamond: %d \n",inEdge); + log("In Star: %d \n",inStar); + log("Merged %d vertices\n",n_merged); mm->updateDataMask(MeshModel::MM_FACEFACETOPO); mm->updateDataMask(MeshModel::MM_VERTFACETOPO); PrintStats(rem); diff --git a/src/meshlabplugins/filter_layer/filter_layer.cpp b/src/meshlabplugins/filter_layer/filter_layer.cpp index cf89174a2..23c72f337 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.cpp +++ b/src/meshlabplugins/filter_layer/filter_layer.cpp @@ -274,11 +274,11 @@ bool FilterLayerPlugin::applyFilter(const QAction *filter, MeshDocument &md, con tri::UpdateSelection::VertexClear(currentModel->cm); currentModel->clearDataMask(MeshModel::MM_FACEFACETOPO); - Log("Moved %i vertices to layer %i, deleted %i faces", numVertSel, delfaces, md.meshList.size()); + log("Moved %i vertices to layer %i, deleted %i faces", numVertSel, delfaces, md.meshList.size()); } else // keep original faces { - Log("Copied %i vertices to layer %i", numVertSel, md.meshList.size()); + log("Copied %i vertices to layer %i", numVertSel, md.meshList.size()); } vcg::tri::UpdateFlags::VertexClear(destModel->cm, CMeshO::VertexType::SELECTED); @@ -319,11 +319,11 @@ bool FilterLayerPlugin::applyFilter(const QAction *filter, MeshDocument &md, con tri::UpdateSelection::FaceClear(currentModel->cm); currentModel->clearDataMask(MeshModel::MM_FACEFACETOPO); - Log("Moved %i faces and %i vertices to layer %i", numFacesSel, numVertSel, md.meshList.size()); + log("Moved %i faces and %i vertices to layer %i", numFacesSel, numVertSel, md.meshList.size()); } else // keep original faces { - Log("Copied %i faces and %i vertices to layer %i", numFacesSel, numVertSel, md.meshList.size()); + log("Copied %i faces and %i vertices to layer %i", numFacesSel, numVertSel, md.meshList.size()); } vcg::tri::UpdateFlags::VertexClear(destModel->cm, CMeshO::VertexType::SELECTED); vcg::tri::UpdateFlags::FaceClear(destModel->cm, CMeshO::FaceType::SELECTED); @@ -342,7 +342,7 @@ bool FilterLayerPlugin::applyFilter(const QAction *filter, MeshDocument &md, con destModel->updateDataMask(currentModel); tri::Append::Mesh(destModel->cm, currentModel->cm); - Log("Duplicated current model to layer %i", md.meshList.size()); + log("Duplicated current model to layer %i", md.meshList.size()); // init new layer destModel->UpdateBoxAndNormals(); @@ -385,7 +385,7 @@ bool FilterLayerPlugin::applyFilter(const QAction *filter, MeshDocument &md, con if( deleteLayer ) { - Log( "Deleted %d merged layers", toBeDeletedList.size()); + log( "Deleted %d merged layers", toBeDeletedList.size()); foreach(MeshModel *mmp,toBeDeletedList) md.delMesh(mmp); md.setCurrent(destModel); // setting again newly created model as current @@ -394,11 +394,11 @@ bool FilterLayerPlugin::applyFilter(const QAction *filter, MeshDocument &md, con if( mergeVertices ) { int delvert = tri::Clean::RemoveDuplicateVertex(destModel->cm); - Log( "Removed %d duplicated vertices", delvert); + log( "Removed %d duplicated vertices", delvert); } destModel->UpdateBoxAndNormals(); - Log("Merged all the layers to single mesh of %i vertices",md.mm()->cm.vn); + log("Merged all the layers to single mesh of %i vertices",md.mm()->cm.vn); } break; case FP_SPLITCONNECTED : @@ -408,7 +408,7 @@ bool FilterLayerPlugin::applyFilter(const QAction *filter, MeshDocument &md, con md.mm()->updateDataMask(MeshModel::MM_FACEFACETOPO); std::vector< std::pair > connectedCompVec; int numCC = tri::Clean::ConnectedComponents(cm, connectedCompVec); - Log("Found %i Connected Components",numCC); + log("Found %i Connected Components",numCC); for(size_t i=0; ierrorMessage = "Distortion is not supported"; - Log("Warning! Distortion parameters won't be imported! Please undistort the images in Photoscan before!"); // text + log("Warning! Distortion parameters won't be imported! Please undistort the images in Photoscan before!"); // text } diff --git a/src/meshlabplugins/filter_measure/filter_measure.cpp b/src/meshlabplugins/filter_measure/filter_measure.cpp index 6ae1a4d4b..fa54f610e 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.cpp +++ b/src/meshlabplugins/filter_measure/filter_measure.cpp @@ -229,32 +229,32 @@ bool FilterMeasurePlugin::computeTopologicalMeasures(MeshDocument& md) tri::Clean::CountEdgeNum(m, edgeNum, edgeBorderNum, edgeNonManifNum); assert(edgeNonManifFFNum == edgeNonManifNum); int holeNum; - Log("V: %6i E: %6i F:%6i", m.vn, edgeNum, m.fn); + log("V: %6i E: %6i F:%6i", m.vn, edgeNum, m.fn); int unrefVertNum = tri::Clean::CountUnreferencedVertex(m); - Log("Unreferenced Vertices %i", unrefVertNum); - Log("Boundary Edges %i", edgeBorderNum); + log("Unreferenced Vertices %i", unrefVertNum); + log("Boundary Edges %i", edgeBorderNum); int connectedComponentsNum = tri::Clean::CountConnectedComponents(m); - Log("Mesh is composed by %i connected component(s)\n", connectedComponentsNum); + log("Mesh is composed by %i connected component(s)\n", connectedComponentsNum); if (edgeNonManifFFNum == 0 && vertManifNum == 0){ - Log("Mesh is two-manifold "); + log("Mesh is two-manifold "); } - if (edgeNonManifFFNum != 0) Log("Mesh has %i non two manifold edges and %i faces are incident on these edges\n", edgeNonManifFFNum, faceEdgeManif); - if (vertManifNum != 0) Log("Mesh has %i non two manifold vertices and %i faces are incident on these vertices\n", vertManifNum, faceVertManif); + if (edgeNonManifFFNum != 0) log("Mesh has %i non two manifold edges and %i faces are incident on these edges\n", edgeNonManifFFNum, faceEdgeManif); + if (vertManifNum != 0) log("Mesh has %i non two manifold vertices and %i faces are incident on these vertices\n", vertManifNum, faceVertManif); // For Manifold meshes compute some other stuff if (vertManifNum == 0 && edgeNonManifFFNum == 0) { holeNum = tri::Clean::CountHoles(m); - Log("Mesh has %i holes", holeNum); + log("Mesh has %i holes", holeNum); int genus = tri::Clean::MeshGenus(m.vn - unrefVertNum, edgeNum, m.fn, holeNum, connectedComponentsNum); - Log("Genus is %i", genus); + log("Genus is %i", genus); } else { - Log("Mesh has a undefined number of holes (non 2-manifold mesh)"); - Log("Genus is undefined (non 2-manifold mesh)"); + log("Mesh has a undefined number of holes (non 2-manifold mesh)"); + log("Genus is undefined (non 2-manifold mesh)"); } return true; @@ -281,10 +281,10 @@ bool FilterMeasurePlugin::computeTopologicalMeasuresForQuadMeshes(MeshDocument& int nLargePolys = tri::Clean::CountBitLargePolygons(m); if (nLargePolys>0) nQuads = 0; - Log("Mesh has %8i triangles \n", nTris); - Log(" %8i quads \n", nQuads); - Log(" %8i polygons \n", nPolys); - Log(" %8i large polygons (with internal faux vertices)", nLargePolys); + log("Mesh has %8i triangles \n", nTris); + log(" %8i quads \n", nQuads); + log(" %8i polygons \n", nPolys); + log(" %8i large polygons (with internal faux vertices)", nLargePolys); if (!tri::Clean::IsBitTriQuadOnly(m)) { this->errorMessage = "QuadMesh problem: the mesh is not TriQuadOnly"; @@ -331,10 +331,10 @@ bool FilterMeasurePlugin::computeTopologicalMeasuresForQuadMeshes(MeshDocument& RatioD.Add(edgeLen[0] / edgeLen[3]); } - Log("Right Angle Discrepancy Avg %4.3f Min %4.3f Max %4.3f StdDev %4.3f Percentile 0.05 %4.3f percentile 95 %4.3f", + log("Right Angle Discrepancy Avg %4.3f Min %4.3f Max %4.3f StdDev %4.3f Percentile 0.05 %4.3f percentile 95 %4.3f", AngleD.Avg(), AngleD.Min(), AngleD.Max(), AngleD.StandardDeviation(), AngleD.Percentile(0.05f), AngleD.Percentile(0.95f)); - Log("Quad Ratio Avg %4.3f Min %4.3f Max %4.3f", RatioD.Avg(), RatioD.Min(), RatioD.Max()); + log("Quad Ratio Avg %4.3f Min %4.3f Max %4.3f", RatioD.Avg(), RatioD.Min(), RatioD.Max()); return true; } @@ -346,15 +346,15 @@ bool FilterMeasurePlugin::computeGeometricMeasures(MeshDocument& md) // the mesh has to be correctly transformed if (m.Tr != Matrix44m::Identity()) { - Log("BEWARE: Measures are calculated considering the current transformation matrix"); + log("BEWARE: Measures are calculated considering the current transformation matrix"); tri::UpdatePosition::Matrix(m, m.Tr, true); } // bounding box - Log("Mesh Bounding Box Size %f %f %f", m.bbox.DimX(), m.bbox.DimY(), m.bbox.DimZ()); - Log("Mesh Bounding Box Diag %f ", m.bbox.Diag()); - Log("Mesh Bounding Box min %f %f %f", m.bbox.min[0], m.bbox.min[1], m.bbox.min[2]); - Log("Mesh Bounding Box max %f %f %f", m.bbox.max[0], m.bbox.max[1], m.bbox.max[2]); + log("Mesh Bounding Box Size %f %f %f", m.bbox.DimX(), m.bbox.DimY(), m.bbox.DimZ()); + log("Mesh Bounding Box Diag %f ", m.bbox.Diag()); + log("Mesh Bounding Box min %f %f %f", m.bbox.min[0], m.bbox.min[1], m.bbox.min[2]); + log("Mesh Bounding Box max %f %f %f", m.bbox.max[0], m.bbox.max[1], m.bbox.max[2]); // is pointcloud? if ((m.fn == 0) && (m.vn != 0)) @@ -363,43 +363,43 @@ bool FilterMeasurePlugin::computeGeometricMeasures(MeshDocument& md) if (pointcloud) { // cloud barycenter Point3m bc = tri::Stat::ComputeCloudBarycenter(m, false); - Log("Pointcloud (vertex) barycenter %9.6f %9.6f %9.6f", bc[0], bc[1], bc[2]); + log("Pointcloud (vertex) barycenter %9.6f %9.6f %9.6f", bc[0], bc[1], bc[2]); // if there is vertex quality, also provide weighted barycenter if (tri::HasPerVertexQuality(m)) { bc = tri::Stat::ComputeCloudBarycenter(m, true); - Log("Pointcloud (vertex) barycenter, weighted by verytex quality:"); - Log(" %9.6f %9.6f %9.6f", bc[0], bc[1], bc[2]); + log("Pointcloud (vertex) barycenter, weighted by verytex quality:"); + log(" %9.6f %9.6f %9.6f", bc[0], bc[1], bc[2]); } // principal axis Matrix33m PCA; PCA = computePrincipalAxisCloud(m); - Log("Principal Axes are :"); - Log(" | %9.6f %9.6f %9.6f |", PCA[0][0], PCA[0][1], PCA[0][2]); - Log(" | %9.6f %9.6f %9.6f |", PCA[1][0], PCA[1][1], PCA[1][2]); - Log(" | %9.6f %9.6f %9.6f |", PCA[2][0], PCA[2][1], PCA[2][2]); + log("Principal Axes are :"); + log(" | %9.6f %9.6f %9.6f |", PCA[0][0], PCA[0][1], PCA[0][2]); + log(" | %9.6f %9.6f %9.6f |", PCA[1][0], PCA[1][1], PCA[1][2]); + log(" | %9.6f %9.6f %9.6f |", PCA[2][0], PCA[2][1], PCA[2][2]); } else { // area float Area = tri::Stat::ComputeMeshArea(m); - Log("Mesh Surface Area is %f", Area); + log("Mesh Surface Area is %f", Area); // edges Distribution eDist; tri::Stat::ComputeFaceEdgeLengthDistribution(m, eDist, false); - Log("Mesh Total Len of %i Edges is %f Avg Len %f", int(eDist.Cnt()), eDist.Sum(), eDist.Avg()); + log("Mesh Total Len of %i Edges is %f Avg Len %f", int(eDist.Cnt()), eDist.Sum(), eDist.Avg()); tri::Stat::ComputeFaceEdgeLengthDistribution(m, eDist, true); - Log("Mesh Total Len of %i Edges is %f Avg Len %f (including faux edges))", int(eDist.Cnt()), eDist.Sum(), eDist.Avg()); + log("Mesh Total Len of %i Edges is %f Avg Len %f (including faux edges))", int(eDist.Cnt()), eDist.Sum(), eDist.Avg()); // Thin shell barycenter Point3m bc = tri::Stat::ComputeShellBarycenter(m); - Log("Thin shell (faces) barycenter: %9.6f %9.6f %9.6f", bc[0], bc[1], bc[2]); + log("Thin shell (faces) barycenter: %9.6f %9.6f %9.6f", bc[0], bc[1], bc[2]); // cloud barycenter bc = tri::Stat::ComputeCloudBarycenter(m, false); - Log("Vertices barycenter %9.6f %9.6f %9.6f", bc[0], bc[1], bc[2]); + log("Vertices barycenter %9.6f %9.6f %9.6f", bc[0], bc[1], bc[2]); // is watertight? int edgeNum = 0, edgeBorderNum = 0, edgeNonManifNum = 0; @@ -410,42 +410,42 @@ bool FilterMeasurePlugin::computeGeometricMeasures(MeshDocument& md) // volume float Volume = I.Mass(); - Log("Mesh Volume is %f", Volume); + log("Mesh Volume is %f", Volume); // center of mass - Log("Center of Mass is %f %f %f", I.CenterOfMass()[0], I.CenterOfMass()[1], I.CenterOfMass()[2]); + log("Center of Mass is %f %f %f", I.CenterOfMass()[0], I.CenterOfMass()[1], I.CenterOfMass()[2]); // inertia tensor Matrix33m IT; I.InertiaTensor(IT); - Log("Inertia Tensor is :"); - Log(" | %9.6f %9.6f %9.6f |", IT[0][0], IT[0][1], IT[0][2]); - Log(" | %9.6f %9.6f %9.6f |", IT[1][0], IT[1][1], IT[1][2]); - Log(" | %9.6f %9.6f %9.6f |", IT[2][0], IT[2][1], IT[2][2]); + log("Inertia Tensor is :"); + log(" | %9.6f %9.6f %9.6f |", IT[0][0], IT[0][1], IT[0][2]); + log(" | %9.6f %9.6f %9.6f |", IT[1][0], IT[1][1], IT[1][2]); + log(" | %9.6f %9.6f %9.6f |", IT[2][0], IT[2][1], IT[2][2]); // principal axis Matrix33m PCA; Point3m pcav; I.InertiaTensorEigen(PCA, pcav); - Log("Principal axes are :"); - Log(" | %9.6f %9.6f %9.6f |", PCA[0][0], PCA[0][1], PCA[0][2]); - Log(" | %9.6f %9.6f %9.6f |", PCA[1][0], PCA[1][1], PCA[1][2]); - Log(" | %9.6f %9.6f %9.6f |", PCA[2][0], PCA[2][1], PCA[2][2]); + log("Principal axes are :"); + log(" | %9.6f %9.6f %9.6f |", PCA[0][0], PCA[0][1], PCA[0][2]); + log(" | %9.6f %9.6f %9.6f |", PCA[1][0], PCA[1][1], PCA[1][2]); + log(" | %9.6f %9.6f %9.6f |", PCA[2][0], PCA[2][1], PCA[2][2]); - Log("axis momenta are :"); - Log(" | %9.6f %9.6f %9.6f |", pcav[0], pcav[1], pcav[2]); + log("axis momenta are :"); + log(" | %9.6f %9.6f %9.6f |", pcav[0], pcav[1], pcav[2]); } else { - Log("Mesh is not 'watertight', no information on volume, barycenter and inertia tensor."); + log("Mesh is not 'watertight', no information on volume, barycenter and inertia tensor."); // principal axis Matrix33m PCA; PCA = computePrincipalAxisCloud(m); - Log("Principal axes are :"); - Log(" | %9.6f %9.6f %9.6f |", PCA[0][0], PCA[0][1], PCA[0][2]); - Log(" | %9.6f %9.6f %9.6f |", PCA[1][0], PCA[1][1], PCA[1][2]); - Log(" | %9.6f %9.6f %9.6f |", PCA[2][0], PCA[2][1], PCA[2][2]); + log("Principal axes are :"); + log(" | %9.6f %9.6f %9.6f |", PCA[0][0], PCA[0][1], PCA[0][2]); + log(" | %9.6f %9.6f %9.6f |", PCA[1][0], PCA[1][1], PCA[1][2]); + log(" | %9.6f %9.6f %9.6f |", PCA[2][0], PCA[2][1], PCA[2][2]); } } @@ -462,13 +462,13 @@ bool FilterMeasurePlugin::computeAreaPerimeterOfSelection(MeshDocument& md) CMeshO &m = md.mm()->cm; if (m.sfn == 0) {// no face selected, fail errorMessage = "Cannot apply: there is no face selection"; - Log("Cannot apply: there is no face selection"); + log("Cannot apply: there is no face selection"); return false; } - Log("Selection is %i triangles", m.sfn); + log("Selection is %i triangles", m.sfn); if (m.Tr != Matrix44m::Identity()) - Log("BEWARE: Area and Perimeter are calculated considering the current transformation matrix"); + log("BEWARE: Area and Perimeter are calculated considering the current transformation matrix"); double fArea = 0.0; double sArea=0; @@ -479,7 +479,7 @@ bool FilterMeasurePlugin::computeAreaPerimeterOfSelection(MeshDocument& md) fArea = (((m.Tr * (*fi).cP(1)) - (m.Tr * (*fi).cP(0))) ^ ((m.Tr * (*fi).cP(2)) - (m.Tr * (*fi).cP(0)))).Norm(); sArea += fArea / 2.0; } - Log("Selection Surface Area is %f", sArea); + log("Selection Surface Area is %f", sArea); int ePerimeter = 0; double sPerimeter = 0.0; @@ -497,8 +497,8 @@ bool FilterMeasurePlugin::computeAreaPerimeterOfSelection(MeshDocument& md) } } - Log("Selection border is %i edges", ePerimeter); - Log("Perimeter is %f", sPerimeter); + log("Selection border is %i edges", ePerimeter); + log("Perimeter is %f", sPerimeter); return true; } @@ -509,10 +509,10 @@ bool FilterMeasurePlugin::perVertexQualityStat(MeshDocument& md) Distribution DD; tri::Stat::ComputePerVertexQualityDistribution(m, DD, false); - Log(" Min %f Max %f", DD.Min(), DD.Max()); - Log(" Avg %f Med %f", DD.Avg(), DD.Percentile(0.5f)); - Log(" StdDev %f", DD.StandardDeviation()); - Log(" Variance %f", DD.Variance()); + log(" Min %f Max %f", DD.Min(), DD.Max()); + log(" Avg %f Med %f", DD.Avg(), DD.Percentile(0.5f)); + log(" StdDev %f", DD.StandardDeviation()); + log(" Variance %f", DD.Variance()); return true; } @@ -522,10 +522,10 @@ bool FilterMeasurePlugin::perFaceQualityStat(MeshDocument& md) Distribution DD; tri::Stat::ComputePerFaceQualityDistribution(m, DD, false); - Log(" Min %f Max %f", DD.Min(), DD.Max()); - Log(" Avg %f Med %f", DD.Avg(), DD.Percentile(0.5f)); - Log(" StdDev %f", DD.StandardDeviation()); - Log(" Variance %f", DD.Variance()); + log(" Min %f Max %f", DD.Min(), DD.Max()); + log(" Avg %f Med %f", DD.Avg(), DD.Percentile(0.5f)); + log(" StdDev %f", DD.StandardDeviation()); + log(" Variance %f", DD.Variance()); return true; } @@ -544,16 +544,16 @@ bool FilterMeasurePlugin::perVertexQualityHistogram(MeshDocument& md, float Rang H.Add(m.vert[i].Q(), aVec[i]); if (areaFlag) { - Log("( -inf..%15.7f) : %15.7f", RangeMin, H.BinCountInd(0)); + log("( -inf..%15.7f) : %15.7f", RangeMin, H.BinCountInd(0)); for (int i = 1; i <= binNum; ++i) - Log("[%15.7f..%15.7f) : %15.7f", H.BinLowerBound(i), H.BinUpperBound(i), H.BinCountInd(i)); - Log("[%15.7f.. +inf) : %15.7f", RangeMax, H.BinCountInd(binNum + 1)); + log("[%15.7f..%15.7f) : %15.7f", H.BinLowerBound(i), H.BinUpperBound(i), H.BinCountInd(i)); + log("[%15.7f.. +inf) : %15.7f", RangeMax, H.BinCountInd(binNum + 1)); } else { - Log("( -inf..%15.7f) : %4.0f", RangeMin, H.BinCountInd(0)); + log("( -inf..%15.7f) : %4.0f", RangeMin, H.BinCountInd(0)); for (int i = 1; i <= binNum; ++i) - Log("[%15.7f..%15.7f) : %4.0f", H.BinLowerBound(i), H.BinUpperBound(i), H.BinCountInd(i)); - Log("[%15.7f.. +inf) : %4.0f", RangeMax, H.BinCountInd(binNum + 1)); + log("[%15.7f..%15.7f) : %4.0f", H.BinLowerBound(i), H.BinUpperBound(i), H.BinCountInd(i)); + log("[%15.7f.. +inf) : %4.0f", RangeMax, H.BinCountInd(binNum + 1)); } aVec = vector(m.vn, 1.0); @@ -563,16 +563,16 @@ bool FilterMeasurePlugin::perVertexQualityHistogram(MeshDocument& md, float Rang for (int i = 0; i(m.fn, 1.0); @@ -611,16 +611,16 @@ bool FilterMeasurePlugin::perFaceQualityHostogram(MeshDocument& md, float RangeM for (int i = 0; i::RemoveFaceOutOfRangeArea(m.cm,0); - if(nullFaces) Log( "PostSimplification Cleaning: Removed %d null faces", nullFaces); + if(nullFaces) log( "PostSimplification Cleaning: Removed %d null faces", nullFaces); int deldupvert=tri::Clean::RemoveDuplicateVertex(m.cm); - if(deldupvert) Log( "PostSimplification Cleaning: Removed %d duplicated vertices", deldupvert); + if(deldupvert) log( "PostSimplification Cleaning: Removed %d duplicated vertices", deldupvert); int delvert=tri::Clean::RemoveUnreferencedVertex(m.cm); - if(delvert) Log( "PostSimplification Cleaning: Removed %d unreferenced vertices",delvert); + if(delvert) log( "PostSimplification Cleaning: Removed %d unreferenced vertices",delvert); m.clearDataMask(MeshModel::MM_FACEFACETOPO ); tri::Allocator::CompactVertexVector(m.cm); tri::Allocator::CompactFaceVector(m.cm); @@ -988,7 +988,7 @@ switch(ID(filter)) } catch(vcg::MissingPreconditionException& excp) { - Log(excp.what()); + log(excp.what()); errorMessage = excp.what(); return false; } @@ -1005,7 +1005,7 @@ switch(ID(filter)) if (m.cm.svn == 0 && m.cm.sfn == 0) // if no selection, fail { - Log("Cannot compute rotation: there is no selection"); + log("Cannot compute rotation: there is no selection"); errorMessage = "Cannot compute rotation: there is no selection"; return false; } @@ -1022,14 +1022,14 @@ switch(ID(filter)) selBox.Add(p); selected_pts.push_back(p); } - Log("Using %i vertices to build a fitting plane", int(selected_pts.size())); + log("Using %i vertices to build a fitting plane", int(selected_pts.size())); Plane3m plane; FitPlaneToPointSet(selected_pts, plane); float errorSum = 0; for (size_t i = 0; i < selected_pts.size(); ++i) errorSum += fabs(SignedDistancePlanePoint(plane, selected_pts[i])); - Log("Fitting Plane avg error is %f", errorSum / float(selected_pts.size())); - Log("Fitting Plane normal is [%f, %f, %f]", plane.Direction().X(), plane.Direction().Y(), plane.Direction().Z()); + log("Fitting Plane avg error is %f", errorSum / float(selected_pts.size())); + log("Fitting Plane normal is [%f, %f, %f]", plane.Direction().X(), plane.Direction().Y(), plane.Direction().Z()); Matrix44m tr1; // translation matrix the centroid of selected points tr1.SetTranslate(-selBox.Center()); @@ -1082,8 +1082,8 @@ switch(ID(filter)) Matrix44m rt; rt.SetRotateRad(-angleRad, rotAxis); - Log("Rotation axis is [%f, %f, %f]", rotAxis.X(), rotAxis.Y(), rotAxis.Z()); - Log("Rotation angle is %f", -angleRad); + log("Rotation axis is [%f, %f, %f]", rotAxis.X(), rotAxis.Y(), rotAxis.Z()); + log("Rotation angle is %f", -angleRad); Matrix44m transfM; if (par.getBool("ToOrigin")) @@ -1316,7 +1316,7 @@ switch(ID(filter)) if(par.getBool("Autoclean")){ int delvert=tri::Clean::RemoveUnreferencedVertex(m.cm); tri::Allocator::CompactVertexVector(m.cm); - Log( "Removed %d unreferenced vertices",delvert); + log( "Removed %d unreferenced vertices",delvert); } switch(par.getEnum("Method")) { @@ -1341,7 +1341,7 @@ switch(ID(filter)) tri::Stat::ComputePerVertexQualityHistogram(m.cm,H); tri::UpdateColor::PerVertexQualityRamp(m.cm,H.Percentile(0.1f),H.Percentile(0.9f)); - Log( "Curvature Range: %f %f (Used 90 percentile %f %f) ",H.MinV(),H.MaxV(),H.Percentile(0.1f),H.Percentile(0.9f)); + log( "Curvature Range: %f %f (Used 90 percentile %f %f) ",H.MinV(),H.MaxV(),H.Percentile(0.1f),H.Percentile(0.9f)); } break; case FP_CLOSE_HOLES: @@ -1362,7 +1362,7 @@ switch(ID(filter)) holeCnt = tri::Hole::EarCuttingIntersectionFill >(m.cm,MaxHoleSize,SelectedFlag,cb); else holeCnt = tri::Hole::EarCuttingFill >(m.cm,MaxHoleSize,SelectedFlag,cb); - Log("Closed %i holes and added %i new faces",holeCnt,m.cm.fn-OriginalSize); + log("Closed %i holes and added %i new faces",holeCnt,m.cm.fn-OriginalSize); assert(tri::Clean::IsFFAdjacencyConsistent(m.cm)); m.UpdateBoxAndNormals(); @@ -1388,7 +1388,7 @@ switch(ID(filter)) for(int i=0;iupdateDataMask(&m); @@ -1512,7 +1512,7 @@ switch(ID(filter)) } tri::BitQuadCreation::MakeTriEvenBySplit(m.cm); bool ret = tri::BitQuadCreation::MakePureByFlip(m.cm,100); - if(!ret) Log("Warning BitQuadCreation::MakePureByFlip failed."); + if(!ret) log("Warning BitQuadCreation::MakePureByFlip failed."); tri::UpdateNormal::PerBitQuadFaceNormalized(m.cm); m.updateDataMask(MeshModel::MM_POLYGONAL); } break; @@ -1604,11 +1604,11 @@ switch(ID(filter)) { if (m.cm.sfn == 0) // no face selected, fail { - Log("ERROR: There is no face selection!"); + log("ERROR: There is no face selection!"); return false; } - Log("Selection is %i triangles", m.cm.sfn); + log("Selection is %i triangles", m.cm.sfn); md.mm()->updateDataMask(MeshModel::MM_FACEFACETOPO); @@ -1671,7 +1671,7 @@ switch(ID(filter)) //actual cut of the mesh if (tri::Clean::CountNonManifoldEdgeFF(base->cm)>0 || (tri::Clean::CountNonManifoldVertexFF(base->cm,false) != 0)) { - Log("Mesh is not two manifold, cannot apply filter"); + log("Mesh is not two manifold, cannot apply filter"); return false; } @@ -1729,7 +1729,7 @@ switch(ID(filter)) tri::UpdateTopology::FaceFace(underM->cm); if ( tri::Clean::CountNonManifoldEdgeFF(underM->cm) > 0) { - Log("Mesh has some not 2 manifoldfaces, splitting surfaces requires manifoldness"); + log("Mesh has some not 2 manifoldfaces, splitting surfaces requires manifoldness"); md.delMesh(underM); } else diff --git a/src/meshlabplugins/filter_mls/mlsplugin.cpp b/src/meshlabplugins/filter_mls/mlsplugin.cpp index 75b0979ac..ff9735efa 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.cpp +++ b/src/meshlabplugins/filter_mls/mlsplugin.cpp @@ -384,7 +384,7 @@ bool MlsPlugin::applyFilter(const QAction* filter, MeshDocument& md, const RichP { // if we start from a mesh, and it has unreferenced vertices // normals are undefined on that vertices. int delvert=tri::Clean::RemoveUnreferencedVertex(md.mm()->cm); - if(delvert) Log( "Pre-MLS Cleaning: Removed %d unreferenced vertices",delvert); + if(delvert) log( "Pre-MLS Cleaning: Removed %d unreferenced vertices",delvert); } tri::Allocator::CompactVertexVector(md.mm()->cm); @@ -394,7 +394,7 @@ bool MlsPlugin::applyFilter(const QAction* filter, MeshDocument& md, const RichP md.mm()->updateDataMask(MeshModel::MM_VERTRADIUS); APSS mls(md.mm()->cm); mls.computeVertexRaddi(); - Log( "Mesh has no per vertex radius. Computed and added using default neighbourhood"); + log( "Mesh has no per vertex radius. Computed and added using default neighbourhood"); } MeshModel* pPoints = 0; @@ -486,7 +486,7 @@ bool MlsPlugin::applyFilter(const QAction* filter, MeshDocument& md, const RichP } } - Log( "Successfully projected %i vertices", mesh->cm.vn); + log( "Successfully projected %i vertices", mesh->cm.vn); } else if (id & _COLORIZE_) { @@ -600,7 +600,7 @@ bool MlsPlugin::applyFilter(const QAction* filter, MeshDocument& md, const RichP mesh->clearDataMask(MeshModel::MM_FACEFACETOPO); } - Log( "Marching cubes MLS meshing done."); + log( "Marching cubes MLS meshing done."); } delete mls; diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp index 23f0bffa9..f4b613e18 100644 --- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp +++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp @@ -178,7 +178,7 @@ bool FilterMutualGlobal::applyFilter(const QAction *action, MeshDocument &md, co oldShots.push_back(md.rasterList[r]->shot); } - Log(0,"Sampled has %i vertices",myVec.size()); + log(0,"Sampled has %i vertices",myVec.size()); std::vector Graphs; /// Preliminary singular alignment using classic MI @@ -187,7 +187,7 @@ bool FilterMutualGlobal::applyFilter(const QAction *action, MeshDocument &md, co /// Building of the graph of images if (md.rasterList.size()==0) { - Log(0, "You need a Raster Model to apply this filter!"); + log(0, "You need a Raster Model to apply this filter!"); return false; } @@ -205,12 +205,12 @@ bool FilterMutualGlobal::applyFilter(const QAction *action, MeshDocument &md, co { Graphs=buildGraph(md); - Log(0, "BuildGraph completed"); + log(0, "BuildGraph completed"); for (int i=0; iglContext->doneCurrent(); - Log(0, "Done!"); + log(0, "Done!"); break; default : assert(0); } - Log(0,"Filter completed in %i sec",(int)((float)filterTime.elapsed()/1000.0f)); + log(0,"Filter completed in %i sec",(int)((float)filterTime.elapsed()/1000.0f)); return true; @@ -264,14 +264,14 @@ float FilterMutualGlobal::calcShotsDifference(MeshDocument &md, std::vectorshot=alignset.shot; @@ -445,11 +445,11 @@ bool FilterMutualGlobal::preAlignment(MeshDocument &md, const RichParameterList md.rasterList[r]->shot.Intrinsics.CenterPx[0]=(int)((float)md.rasterList[r]->shot.Intrinsics.ViewportPx[0]/2.0); md.rasterList[r]->shot.Intrinsics.CenterPx[1]=(int)((float)md.rasterList[r]->shot.Intrinsics.ViewportPx[1]/2.0); - Log(0, "Image %d completed",r); + log(0, "Image %d completed",r); } else - Log(0, "Image %d skipped",r); + log(0, "Image %d skipped",r); } } @@ -462,7 +462,7 @@ std::vector FilterMutualGlobal::buildGraph(MeshDocument &md, bool glob std::vector allArcs; allArcs=CalcPairs(md, globalign); - Log(0, "Calcpairs completed"); + log(0, "Calcpairs completed"); return CreateGraphs(md, allArcs); } @@ -585,12 +585,12 @@ std::vector FilterMutualGlobal::CalcPairs(MeshDocument &md, bool glob } } - Log(0, "Image %d completed",r); + log(0, "Image %d completed",r); if (!globalign) { for (int i=0; i FilterMutualGlobal::CalcPairs(MeshDocument &md, bool glob pair.projId=p; pair.weight=weightList[i].weight; list.push_back(pair); - Log(0, "Area %3.2f, Mutual %3.2f",pair.area,pair.mutual); + log(0, "Area %3.2f, Mutual %3.2f",pair.area,pair.mutual); } } @@ -659,7 +659,7 @@ std::vector FilterMutualGlobal::CalcPairs(MeshDocument &md, bool glob - Log(0, "Tot arcs %d, Valid arcs %d",(md.rasterList.size())*(md.rasterList.size()-1),list.size()); + log(0, "Tot arcs %d, Valid arcs %d",(md.rasterList.size())*(md.rasterList.size()-1),list.size()); //emit md.rasterSetChanged(); @@ -673,7 +673,7 @@ std::vector FilterMutualGlobal::CreateGraphs(MeshDocument &md, std::ve std::vector Gr; SubGraph allNodes; int numNodes=md.rasterList.size(); - Log(0, "Tuttok1"); + log(0, "Tuttok1"); for (int s=0; s FilterMutualGlobal::CreateGraphs(MeshDocument &md, std::ve } int involvedNodes=nod.size(); int totNodes=0; - Log(0, "Tuttok2"); + log(0, "Tuttok2"); while (!done) { for (int i=0; i FilterMutualGlobal::CreateGraphs(MeshDocument &md, std::ve done=true; else totGr++; } - Log(0, "Tuttok3"); + log(0, "Tuttok3"); for (int i=1; i FilterMutualGlobal::CreateGraphs(MeshDocument &md, std::ve graph.id=i; for (int j=0; j FilterMutualGlobal::CreateGraphs(MeshDocument &md, std::ve } std::sort(n.arcs.begin(), n.arcs.end(), ordering()); graph.nodes.push_back(n); - Log(0, "Node %d of %d: avMut %3.2f, arch %d",j,numNodes, n.avMut, n.arcs.size()); + log(0, "Node %d of %d: avMut %3.2f, arch %d",j,numNodes, n.avMut, n.arcs.size()); } else { @@ -784,13 +784,13 @@ std::vector FilterMutualGlobal::CreateGraphs(MeshDocument &md, std::ve n.id=j; n.avMut=0.0; graph.nodes.push_back(n); - Log(0, "Node %d of %d: not used",j,numNodes); + log(0, "Node %d of %d: not used",j,numNodes); } } Gr.push_back(graph); } - Log(0, "Tuttok5"); - Log(0, "Tot nodes %d, SubGraphs %d",numNodes,totGr); + log(0, "Tuttok5"); + log(0, "Tot nodes %d, SubGraphs %d",numNodes,totGr); return Gr; } diff --git a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp index 40f257fb4..ea7367b30 100644 --- a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp +++ b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp @@ -146,12 +146,12 @@ bool FilterMutualInfoPlugin::imageMutualInfoAlign( Solver solver; MutualInfo mutual; if (!shot.IsValid()){ - Log(GLLogStream::FILTER, "Error: shot not valid. Press 'Get Shot' button before applying!"); + log(GLLogStream::FILTER, "Error: shot not valid. Press 'Get Shot' button before applying!"); return false; } if (md.rasterList.size()==0) { - Log(GLLogStream::FILTER, "You need a Raster Model to apply this filter!"); + log(GLLogStream::FILTER, "You need a Raster Model to apply this filter!"); return false; } else { @@ -200,19 +200,19 @@ bool FilterMutualInfoPlugin::imageMutualInfoAlign( ///// Initialize GLContext - Log( "Initialize GL"); + log( "Initialize GL"); align.setGLContext(glContext); glContext->makeCurrent(); if (initGLMutualInfo() == false) return false; - Log( "Done"); + log( "Done"); ///// Mutual info calculation: every 30 iterations, the mail glarea is updated int rounds=(int)(solver.maxiter/30); for (int i=0; ishortName())); + log("Preprocessing mesh %s",qUtf8Printable(mm->shortName())); } } @@ -220,7 +220,7 @@ bool PlyMCPlugin::applyFilter(const QAction *filter, MeshDocument &md, const Ric MeshModel &mm=*md.mm(); if (mm.cm.fn == 0) { - Log("Cannot simplify: no faces."); + log("Cannot simplify: no faces."); errorMessage = "Cannot simplify: no faces."; return false; } @@ -228,7 +228,7 @@ bool PlyMCPlugin::applyFilter(const QAction *filter, MeshDocument &md, const Ric int res = tri::MCSimplify(mm.cm,0.0f,false); if (res !=1) { - Log("Cannot simplify: this is not a Marching Cube -generated mesh. Mesh should have some of its edges 'straight' along axes."); + log("Cannot simplify: this is not a Marching Cube -generated mesh. Mesh should have some of its edges 'straight' along axes."); errorMessage = "Cannot simplify: this is not a Marching Cube -generated mesh."; mm.clearDataMask(MeshModel::MM_VERTFACETOPO); mm.clearDataMask(MeshModel::MM_FACEFACETOPO); diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.cpp b/src/meshlabplugins/filter_qhull/filter_qhull.cpp index feb28e27b..b35505381 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.cpp +++ b/src/meshlabplugins/filter_qhull/filter_qhull.cpp @@ -272,7 +272,7 @@ bool QhullPlugin::applyFilter(const QAction *filter, MeshDocument &md, const Ric } assert(pm.cm.fn == ridgeCount); - Log("Successfully created a mesh of %i vert and %i faces",pm.cm.vn,pm.cm.fn); + log("Successfully created a mesh of %i vert and %i faces",pm.cm.vn,pm.cm.fn); //m.cm.Clear(); //vcg::tri::UpdateBounding::Box(pm.cm); @@ -309,7 +309,7 @@ bool QhullPlugin::applyFilter(const QAction *filter, MeshDocument &md, const Ric //vcg::tri::UpdateBounding::Box(pm.cm); //vcg::tri::UpdateNormal::PerVertexNormalizedPerFace(pm.cm); pm.UpdateBoxAndNormals(); - Log("Successfully created a mesh of %i vert and %i faces",pm.cm.vn,pm.cm.fn); + log("Successfully created a mesh of %i vert and %i faces",pm.cm.vn,pm.cm.fn); return true; } @@ -359,8 +359,8 @@ bool QhullPlugin::applyFilter(const QAction *filter, MeshDocument &md, const Ric //vcg::tri::UpdateBounding::Box(pm.cm); //vcg::tri::UpdateNormal::PerVertexNormalizedPerFace(pm.cm); pm.UpdateBoxAndNormals(); - Log("Successfully created a mesh of %i vert and %i faces",pm.cm.vn,pm.cm.fn); - Log("Alpha = %f ",alpha); + log("Successfully created a mesh of %i vert and %i faces",pm.cm.vn,pm.cm.fn); + log("Alpha = %f ",alpha); //m.cm.Clear(); return true; @@ -411,7 +411,7 @@ bool QhullPlugin::applyFilter(const QAction *filter, MeshDocument &md, const Ric if(!triangVP) md.delMesh(&pm2); if(result>=0){ - Log("Selected %i visible points", result); + log("Selected %i visible points", result); return true; } else return false; diff --git a/src/meshlabplugins/filter_sample/filter_sample.cpp b/src/meshlabplugins/filter_sample/filter_sample.cpp index 70e7097f6..c43a2ebaa 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.cpp +++ b/src/meshlabplugins/filter_sample/filter_sample.cpp @@ -185,7 +185,7 @@ bool FilterSamplePlugin::vertexDisplacement( } // Log function dump textual info in the lower part of the MeshLab screen. - Log("Successfully displaced %i vertices",m.vn); + log("Successfully displaced %i vertices",m.vn); // to access to the parameters of the filter dialog simply use the getXXXX function of the FilterParameter Class if(updateNormals){ diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.cpp b/src/meshlabplugins/filter_sampling/filter_sampling.cpp index 848b8d09f..c63433aa2 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.cpp +++ b/src/meshlabplugins/filter_sampling/filter_sampling.cpp @@ -704,12 +704,12 @@ switch(ID(action)) { MeshModel *curMM = md.mm(); if (par.getInt("SampleNum") == 0) { - Log("Mesh Element Sampling: Number of Samples is 0, cannot do anything"); + log("Mesh Element Sampling: Number of Samples is 0, cannot do anything"); errorMessage = "Number of Samples is 0, cannot do anything"; return false; // can't continue, mesh can't be processed } if ((par.getEnum("Sampling")>0) && (curMM->cm.fn == 0)) { - Log("Mesh Element Sampling: cannot sample on faces/edges, mesh has no faces"); + log("Mesh Element Sampling: cannot sample on faces/edges, mesh has no faces"); errorMessage = "Mesh Element Sampling: cannot sample on faces/edges, mesh has no faces"; return false; // can't continue, mesh can't be processed } @@ -726,14 +726,14 @@ switch(ID(action)) case 2 : tri::SurfaceSampling::AllFace(curMM->cm,mps); break; } vcg::tri::UpdateBounding::Box(mm->cm); - Log("Mesh Element Sampling created a new mesh of %i points",mm->cm.vn); + log("Mesh Element Sampling created a new mesh of %i points",mm->cm.vn); } break; case FP_TEXEL_SAMPLING : { MeshModel *curMM= md.mm(); if (!tri::HasPerWedgeTexCoord(curMM->cm)) { - Log("Texel Sampling requires a mesh with Per Wedge UV parametrization"); + log("Texel Sampling requires a mesh with Per Wedge UV parametrization"); errorMessage = "Texel Sampling requires a mesh with Per Wedge UV parametrization"; return false; // can't continue, mesh can't be processed } @@ -755,24 +755,24 @@ switch(ID(action)) tri::SurfaceSampling::Texture(curMM->cm,mps,mps.texSamplingWidth,mps.texSamplingHeight); vcg::tri::UpdateBounding::Box(mm->cm); mm->updateDataMask(MeshModel::MM_VERTNORMAL | MeshModel::MM_VERTCOLOR); - Log("Texel Sampling created a new mesh of %i points", mm->cm.vn); + log("Texel Sampling created a new mesh of %i points", mm->cm.vn); } break; case FP_MONTECARLO_SAMPLING : { MeshModel *curMM = md.mm(); if (curMM->cm.fn == 0) { - Log("Montecarlo Sampling requires a mesh with faces, it does not work on Point Clouds"); + log("Montecarlo Sampling requires a mesh with faces, it does not work on Point Clouds"); errorMessage = "Montecarlo Sampling requires a mesh with faces,
    it does not work on Point Clouds"; return false; // can't continue, mesh can't be processed } if (par.getInt("SampleNum") == 0) { - Log("Montecarlo Sampling: Number of Samples is 0, cannot do anything"); + log("Montecarlo Sampling: Number of Samples is 0, cannot do anything"); errorMessage = "Number of Samples is 0, cannot do anything"; return false; // can't continue, mesh can't be processed } if (par.getBool("Weighted") && !curMM->hasDataMask(MeshModel::MM_VERTQUALITY)) { - Log("Montecarlo Sampling: cannot do weighted samplimg, layer has no Vertex Quality value"); + log("Montecarlo Sampling: cannot do weighted samplimg, layer has no Vertex Quality value"); errorMessage = "Cannot do weighted samplimg, layer has no Vertex Quality value"; return false; // can't continue, mesh can't be processed } @@ -798,19 +798,19 @@ switch(ID(action)) } vcg::tri::UpdateBounding::Box(mm->cm); - Log("Sampling created a new mesh of %i points", mm->cm.vn); + log("Sampling created a new mesh of %i points", mm->cm.vn); } break; case FP_STRATIFIED_SAMPLING : { MeshModel *curMM = md.mm(); if (curMM->cm.fn == 0) { - Log("Stratified Sampling requires a mesh with faces, it does not work on Point Clouds"); + log("Stratified Sampling requires a mesh with faces, it does not work on Point Clouds"); errorMessage = "Stratified Sampling requires a mesh with faces,
    it does not work on Point Clouds"; return false; // can't continue, mesh can't be processed } if (par.getInt("SampleNum") == 0) { - Log("Stratified Sampling: Number of Samples is 0, cannot do anything"); + log("Stratified Sampling: Number of Samples is 0, cannot do anything"); errorMessage = "Number of Samples is 0, cannot do anything"; return false; // can't continue, mesh can't be processed } @@ -823,23 +823,23 @@ switch(ID(action)) { case 0: tri::SurfaceSampling::FaceSimilar(curMM->cm,mps,par.getInt("SampleNum"), false ,par.getBool("Random")); - Log("Similar Sampling created a new mesh of %i points", mm->cm.vn); + log("Similar Sampling created a new mesh of %i points", mm->cm.vn); break; case 1: tri::SurfaceSampling::FaceSimilar(curMM->cm,mps,par.getInt("SampleNum"), true ,par.getBool("Random")); - Log("Dual Similar Sampling created a new mesh of %i points", mm->cm.vn); + log("Dual Similar Sampling created a new mesh of %i points", mm->cm.vn); break; case 2: tri::SurfaceSampling::FaceSubdivision(curMM->cm,mps,par.getInt("SampleNum"), par.getBool("Random")); - Log("Subdivision Sampling created a new mesh of %i points", mm->cm.vn); + log("Subdivision Sampling created a new mesh of %i points", mm->cm.vn); break; case 3: tri::SurfaceSampling::EdgeUniform(curMM->cm,mps,par.getInt("SampleNum"), true); - Log("Edge Sampling created a new mesh of %i points", mm->cm.vn); + log("Edge Sampling created a new mesh of %i points", mm->cm.vn); break; case 4: tri::SurfaceSampling::EdgeUniform(curMM->cm,mps,par.getInt("SampleNum"), false); - Log("Non Faux Edge Sampling created a new mesh of %i points", mm->cm.vn); + log("Non Faux Edge Sampling created a new mesh of %i points", mm->cm.vn); break; } vcg::tri::UpdateBounding::Box(mm->cm); @@ -854,7 +854,7 @@ switch(ID(action)) if (selected && curMM->cm.svn == 0 && curMM->cm.sfn == 0) // if no selection at all, fail { - Log("Clustered Sampling: Cannot apply only on selection: there is no selection"); + log("Clustered Sampling: Cannot apply only on selection: there is no selection"); errorMessage = "Cannot apply only on selection: there is no selection"; return false; } @@ -863,7 +863,7 @@ switch(ID(action)) tri::UpdateSelection::VertexClear(curMM->cm); tri::UpdateSelection::VertexFromFaceStrict(curMM->cm); } - Log("Using only %i selected vertices", curMM->cm.svn); + log("Using only %i selected vertices", curMM->cm.svn); MeshModel *mm= md.addNewMesh("", "Cluster samples", true); // The new mesh is the current one @@ -877,7 +877,7 @@ switch(ID(action)) ClusteringGrid.ExtractPointSet(mm->cm); ClusteringGrid.SelectPointSet(curMM->cm); tri::UpdateSelection::FaceFromVertexLoose(curMM->cm); - Log("Similar Sampling created a new mesh of %i points", mm->cm.vn); + log("Similar Sampling created a new mesh of %i points", mm->cm.vn); } break; case 1 : @@ -888,7 +888,7 @@ switch(ID(action)) ClusteringGrid.SelectPointSet(curMM->cm); tri::UpdateSelection::FaceFromVertexLoose(curMM->cm); ClusteringGrid.ExtractPointSet(mm->cm); - Log("Similar Sampling created a new mesh of %i points", mm->cm.vn); + log("Similar Sampling created a new mesh of %i points", mm->cm.vn); } break; } vcg::tri::UpdateBounding::Box(mm->cm); @@ -901,7 +901,7 @@ switch(ID(action)) int sampleNum = par.getInt("SampleNum"); if ((radius == 0.0) && (sampleNum == 0)){ - Log("Point Cloud Simplification: Number of Samples AND Radius are both 0, cannot do anything"); + log("Point Cloud Simplification: Number of Samples AND Radius are both 0, cannot do anything"); errorMessage = "Number of Samples AND Radius are both 0, cannot do anything"; return false; // can't continue, mesh can't be processed } @@ -921,7 +921,7 @@ switch(ID(action)) else tri::SurfaceSampling::PoissonDiskPruning(mps, curMM->cm, radius,pp); - Log("Point Cloud Simplification created a new mesh of %i points", mm->cm.vn); + log("Point Cloud Simplification created a new mesh of %i points", mm->cm.vn); UpdateBounding::Box(mm->cm); } break; @@ -935,7 +935,7 @@ switch(ID(action)) bool subsampleFlag = par.getBool("Subsample"); if ((radius == 0.0) && (sampleNum == 0)){ - Log("Poisson disk Sampling: Number of Samples AND Radius are both 0, cannot do anything"); + log("Poisson disk Sampling: Number of Samples AND Radius are both 0, cannot do anything"); errorMessage = "Number of Samples AND Radius are both 0, cannot do anything"; return false; // can't continue, mesh can't be processed } @@ -948,17 +948,17 @@ switch(ID(action)) if (pp.radiusVariance != 1.0) { if (!curMM->hasDataMask(MeshModel::MM_VERTQUALITY)) { - Log("Poisson disk Sampling: Variable radius requires per-Vertex quality for biasing the distribution"); + log("Poisson disk Sampling: Variable radius requires per-Vertex quality for biasing the distribution"); errorMessage = "Variable radius requires per-Vertex Quality for biasing the distribution"; return false; // cannot continue } pp.adaptiveRadiusFlag = true; - Log("Variable Density variance is %f, radius can vary from %f to %f", pp.radiusVariance, radius / pp.radiusVariance, radius*pp.radiusVariance); + log("Variable Density variance is %f, radius can vary from %f to %f", pp.radiusVariance, radius / pp.radiusVariance, radius*pp.radiusVariance); } if (curMM->cm.fn == 0 && subsampleFlag == false) { - Log("Poisson disk Sampling: Current mesh has no triangles. We cannot create a montecarlo sampling of the surface. Please select the Subsample flag"); + log("Poisson disk Sampling: Current mesh has no triangles. We cannot create a montecarlo sampling of the surface. Please select the Subsample flag"); errorMessage = "Current mesh has no triangles. We cannot create a montecarlo sampling of the surface.
    Please select the Subsample flag"; return false; // cannot continue } @@ -966,7 +966,7 @@ switch(ID(action)) MeshModel *mm= md.addNewMesh("","Poisson-disk Samples", true); // The new mesh is the current one mm->updateDataMask(curMM); - Log("Computing %i Poisson Samples for an expected radius of %f",sampleNum,radius); + log("Computing %i Poisson Samples for an expected radius of %f",sampleNum,radius); // first of all generate montecarlo samples for fast lookup CMeshO *presampledMesh=0; @@ -993,7 +993,7 @@ switch(ID(action)) else tri::SurfaceSampling::Montecarlo(curMM->cm, sampler, sampleNum*par.getInt("MontecarloRate")); presampledMesh->bbox = curMM->cm.bbox; // we want the same bounding box - Log("Generated %i Montecarlo Samples (%i msec)",presampledMesh->vn,tt.elapsed()); + log("Generated %i Montecarlo Samples (%i msec)",presampledMesh->vn,tt.elapsed()); } BaseSampler mps(&(mm->cm)); @@ -1013,8 +1013,8 @@ switch(ID(action)) //tri::SurfaceSampling::PoissonDisk(curMM->cm, mps, *presampledMesh, radius,pp); vcg::tri::UpdateBounding::Box(mm->cm); Point3i &g=pp.pds.gridSize; - Log("Grid size was %i %i %i (%i allocated on %i)",g[0],g[1],g[2], pp.pds.gridCellNum, g[0]*g[1]*g[2]); - Log("Poisson Disk Sampling created a new mesh of %i points", mm->cm.vn); + log("Grid size was %i %i %i (%i allocated on %i)",g[0],g[1],g[2], pp.pds.gridCellNum, g[0]*g[1]*g[2]); + log("Poisson Disk Sampling created a new mesh of %i points", mm->cm.vn); } break; case FP_HAUSDORFF_DISTANCE : @@ -1029,17 +1029,17 @@ switch(ID(action)) float distUpperBound = par.getAbsPerc("MaxDist"); if (mm0 == mm1){ - Log("Hausdorff Distance: cannot compute, it is the same mesh"); + log("Hausdorff Distance: cannot compute, it is the same mesh"); errorMessage = "Cannot compute, it is the same mesh"; return false; // can't continue, mesh can't be processed } if(sampleEdge && mm0->cm.fn==0) { - Log("Disabled edge sampling. Meaningless when sampling point clouds"); + log("Disabled edge sampling. Meaningless when sampling point clouds"); sampleEdge=false; } if(sampleFace && mm0->cm.fn==0) { - Log("Disabled face sampling. Meaningless when sampling point clouds"); + log("Disabled face sampling. Meaningless when sampling point clouds"); sampleFace=false; } @@ -1085,12 +1085,12 @@ switch(ID(action)) if (mm1->cm.Tr != Matrix44m::Identity()) tri::UpdatePosition::Matrix(mm1->cm, Inverse(mm1->cm.Tr), true); - Log("Hausdorff Distance computed"); - Log(" Sampled %i pts (rng: 0) on %s searched closest on %s",hs.n_total_samples,qUtf8Printable(mm0->label()),qUtf8Printable(mm1->label())); - Log(" min : %f max %f mean : %f RMS : %f",hs.getMinDist(),hs.getMaxDist(),hs.getMeanDist(),hs.getRMSDist()); + log("Hausdorff Distance computed"); + log(" Sampled %i pts (rng: 0) on %s searched closest on %s",hs.n_total_samples,qUtf8Printable(mm0->label()),qUtf8Printable(mm1->label())); + log(" min : %f max %f mean : %f RMS : %f",hs.getMinDist(),hs.getMaxDist(),hs.getMeanDist(),hs.getRMSDist()); float d = mm0->cm.bbox.Diag(); - Log("Values w.r.t. BBox Diag (%f)",d); - Log(" min : %f max %f mean : %f RMS : %f\n",hs.getMinDist()/d,hs.getMaxDist()/d,hs.getMeanDist()/d,hs.getRMSDist()/d); + log("Values w.r.t. BBox Diag (%f)",d); + log(" min : %f max %f mean : %f RMS : %f\n",hs.getMinDist()/d,hs.getMaxDist()/d,hs.getMeanDist()/d,hs.getRMSDist()/d); if(saveSampleFlag) @@ -1111,7 +1111,7 @@ switch(ID(action)) float maxDistABS = par.getAbsPerc("MaxDist"); if (mm0 == mm1){ - Log("Distance from Reference: cannot compute, it is the same mesh"); + log("Distance from Reference: cannot compute, it is the same mesh"); errorMessage = "Cannot compute, it is the same mesh"; return false; // can't continue, mesh can't be processed } @@ -1142,9 +1142,9 @@ switch(ID(action)) if (mm1->cm.Tr != Matrix44m::Identity()) tri::UpdatePosition::Matrix(mm1->cm, Inverse(mm1->cm.Tr), true); - Log("Distance from Reference Mesh computed"); - Log(" Sampled %i vertices on %s searched closest on %s", mm0->cm.vn, qUtf8Printable(mm0->label()), qUtf8Printable(mm1->label())); - Log(" min : %f max %f mean : %f RMS : %f", ds.getMaxDist(), ds.getMaxDist(), ds.getMeanDist(), ds.getRMSDist()); + log("Distance from Reference Mesh computed"); + log(" Sampled %i vertices on %s searched closest on %s", mm0->cm.vn, qUtf8Printable(mm0->label()), qUtf8Printable(mm1->label())); + log(" min : %f max %f mean : %f RMS : %f", ds.getMaxDist(), ds.getMaxDist(), ds.getMeanDist(), ds.getRMSDist()); } break; @@ -1162,20 +1162,20 @@ switch(ID(action)) bool distquality = par.getBool("QualityDistance"); if (srcMesh == trgMesh){ - Log("Vertex Attribute Transfer: cannot compute, it is the same mesh"); + log("Vertex Attribute Transfer: cannot compute, it is the same mesh"); errorMessage = "Cannot compute, it is the same mesh"; return false; // can't continue, mesh can't be processed } if (!colorT && !geomT && !qualityT && !normalT && !selectionT) { - Log("Vertex Attribute Transfer: you have to choose at least one attribute to be sampled"); + log("Vertex Attribute Transfer: you have to choose at least one attribute to be sampled"); errorMessage = QString("You have to choose at least one attribute to be sampled"); return false; } if (onlySelected && trgMesh->cm.svn == 0 && trgMesh->cm.sfn == 0) // if no selection at all, fail { - Log("Vertex Attribute Transfer: Cannot apply only on selection: there is no selection"); + log("Vertex Attribute Transfer: Cannot apply only on selection: there is no selection"); errorMessage = "Cannot apply only on selection: there is no selection"; return false; } @@ -1226,7 +1226,7 @@ switch(ID(action)) case FP_UNIFORM_MESH_RESAMPLING : { if (md.mm()->cm.fn==0) { - Log("Uniform Mesh Resampling: requires a mesh with faces, it does not work on Point Clouds"); + log("Uniform Mesh Resampling: requires a mesh with faces, it does not work on Point Clouds"); errorMessage = "Uniform Mesh Resampling requires a mesh with faces,
    it does not work on Point Clouds"; return false; // can't continue, mesh can't be processed } @@ -1247,9 +1247,9 @@ switch(ID(action)) volumeBox.Offset(volumeBox.Diag()/10.0f+abs(offsetThr)); BestDim(volumeBox , voxelSize, volumeDim ); - Log("Resampling mesh using a volume of %i x %i x %i",volumeDim[0],volumeDim[1],volumeDim[2]); - Log(" VoxelSize is %f, offset is %f ", voxelSize,offsetThr); - Log(" Mesh Box is %f %f %f",baseMesh->cm.bbox.DimX(),baseMesh->cm.bbox.DimY(),baseMesh->cm.bbox.DimZ() ); + log("Resampling mesh using a volume of %i x %i x %i",volumeDim[0],volumeDim[1],volumeDim[2]); + log(" VoxelSize is %f, offset is %f ", voxelSize,offsetThr); + log(" Mesh Box is %f %f %f",baseMesh->cm.bbox.DimX(),baseMesh->cm.bbox.DimY(),baseMesh->cm.bbox.DimZ() ); tri::Resampler::Resample(baseMesh->cm, offsetMesh->cm, volumeBox, volumeDim, voxelSize*3.5, offsetThr,discretizeFlag,multiSampleFlag,absDistFlag, cb); tri::UpdateBounding::Box(offsetMesh->cm); @@ -1257,7 +1257,7 @@ switch(ID(action)) { float mergeThr =offsetMesh->cm.bbox.Diag()/10000.0f; int total = tri::Clean::MergeCloseVertex(offsetMesh->cm,mergeThr); - Log("Successfully merged %d vertices with a distance lower than %f", total,mergeThr); + log("Successfully merged %d vertices with a distance lower than %f", total,mergeThr); } tri::UpdateNormal::PerVertexPerFace(offsetMesh->cm); } break; @@ -1279,7 +1279,7 @@ switch(ID(action)) vector vecV; // points to vertices of ColoredMesh; tri::VoronoiProcessing::SeedToVertexConversion (mmM->cm, vecP, vecV); - Log("Converted %ui points into %ui vertex ",vecP.size(),vecV.size()); + log("Converted %ui points into %ui vertex ",vecP.size(),vecV.size()); tri::EuclideanDistance edFunc; tri::VoronoiProcessing::ComputePerVertexSources(mmM->cm,vecV,edFunc); @@ -1330,7 +1330,7 @@ switch(ID(action)) case FP_REGULAR_RECURSIVE_SAMPLING : { if (md.mm()->cm.fn==0) { - Log("Regular Recursive Sampling: requires a mesh with faces, it does not work on Point Clouds"); + log("Regular Recursive Sampling: requires a mesh with faces, it does not work on Point Clouds"); errorMessage = "Regular Recursive Sampling requires a mesh with faces,
    it does not work on Point Clouds"; return false; // can't continue, mesh can't be processed } diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp index ae13c0666..c9c33d300 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp @@ -109,11 +109,11 @@ bool FilterScreenedPoissonPlugin::applyFilter(const QAction* filter, MeshDocumen QTemporaryDir tmpdir; QTemporaryFile file(tmpdir.path()); if (!file.open()) { //if a file cannot be created in the tmp folder - Log("Warning - tmp folder is not writable."); + log("Warning - tmp folder is not writable."); QTemporaryFile file2("./_tmp_XXXXXX.tmp"); //try to create a file in the meshlab folder if (!file2.open()){ //if a file cannot be created in the tmp and in the meshlab folder, we cannot run the filter - Log("Warning - current folder is not writable. Screened Poisson Merging needs to save intermediate files in the tmp working folder. Project and meshes must be in a write-enabled folder. Please save your data in a suitable folder before applying."); + log("Warning - current folder is not writable. Screened Poisson Merging needs to save intermediate files in the tmp working folder. Project and meshes must be in a write-enabled folder. Please save your data in a suitable folder before applying."); errorMessage = "current and tmp folder are not writable.
    Screened Poisson Merging needs to save intermediate files in the current working folder.
    Project and meshes must be in a write-enabled folder.
    Please save your data in a suitable folder before applying."; return false; } diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp index e73058c08..b18343723 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp @@ -184,8 +184,8 @@ bool SdfGpuPlugin::applyFilter(const QAction */*filter*/, MeshDocument &md, cons std::vector unifDirVec; GenNormal::Fibonacci(numViews,unifDirVec); - Log(GLLogStream::SYSTEM, "Number of rays: %i ", unifDirVec.size() ); - Log(GLLogStream::SYSTEM, "Number of rays for GPU outliers removal: %i ", coneDirVec.size() ); + log(GLLogStream::SYSTEM, "Number of rays: %i ", unifDirVec.size() ); + log(GLLogStream::SYSTEM, "Number of rays for GPU outliers removal: %i ", coneDirVec.size() ); coneDirVec.clear(); @@ -226,14 +226,14 @@ bool SdfGpuPlugin::applyFilter(const QAction */*filter*/, MeshDocument &md, cons - Log(GLLogStream::SYSTEM, "Mesh depth complexity %i (The accuracy of the result depends on the value you provided for the max number of peeling iterations, \n if you get warnings try increasing" + log(GLLogStream::SYSTEM, "Mesh depth complexity %i (The accuracy of the result depends on the value you provided for the max number of peeling iterations, \n if you get warnings try increasing" " the peeling iteration parameter)\n", mDepthComplexity ); //Depth complexity distribution log. Useful to know which is the probability to find a number of layers looking at the mesh or scene. - Log(GLLogStream::SYSTEM, "Depth complexity NumberOfViews\n", mDepthComplexity ); + log(GLLogStream::SYSTEM, "Depth complexity NumberOfViews\n", mDepthComplexity ); for(int j = 0; j < peel; j++) { - Log(GLLogStream::SYSTEM, " %i %i\n", j, mDepthDistrib[j] ); + log(GLLogStream::SYSTEM, " %i %i\n", j, mDepthDistrib[j] ); } //Clean & Exit @@ -270,7 +270,7 @@ bool SdfGpuPlugin::initGL(MeshModel& mm) if (!GLExtensionsManager::initializeGLextensions_notThrowing()) { - Log(GLLogStream::SYSTEM, "Error initializing OpenGL extensions."); + log(GLLogStream::SYSTEM, "Error initializing OpenGL extensions."); return false; } @@ -279,13 +279,13 @@ bool SdfGpuPlugin::initGL(MeshModel& mm) { if (!glewIsSupported("GL_EXT_vertex_shader GL_EXT_fragment_shader")) { - Log(GLLogStream::SYSTEM, "Your hardware doesn't support Shaders, which are required for hw occlusion"); + log(GLLogStream::SYSTEM, "Your hardware doesn't support Shaders, which are required for hw occlusion"); return false; } } if ( !glewIsSupported("GL_EXT_framebuffer_object") ) { - Log(GLLogStream::SYSTEM, "Your hardware doesn't support FBOs, which are required for hw occlusion"); + log(GLLogStream::SYSTEM, "Your hardware doesn't support FBOs, which are required for hw occlusion"); return false; } @@ -293,13 +293,13 @@ bool SdfGpuPlugin::initGL(MeshModel& mm) { if ( !glewIsSupported("GL_EXT_gpu_shader4") ) //Only DX10-grade cards support FP32 blending { - Log(GLLogStream::SYSTEM,"Your hardware can't do FP32 blending, and currently the FP16 version is not yet implemented."); + log(GLLogStream::SYSTEM,"Your hardware can't do FP32 blending, and currently the FP16 version is not yet implemented."); return false; } } else { - Log(GLLogStream::SYSTEM,"Your hardware doesn't support floating point textures, which are required for hw occlusion"); + log(GLLogStream::SYSTEM,"Your hardware doesn't support floating point textures, which are required for hw occlusion"); return false; } @@ -318,12 +318,12 @@ bool SdfGpuPlugin::initGL(MeshModel& mm) unsigned int maxTexSize; glGetIntegerv(GL_MAX_TEXTURE_SIZE, reinterpret_cast(&maxTexSize) ); - Log(GLLogStream::SYSTEM, "QUERY HARDWARE FOR: MAX TEX SIZE: %i ", maxTexSize ); + log(GLLogStream::SYSTEM, "QUERY HARDWARE FOR: MAX TEX SIZE: %i ", maxTexSize ); //CHECK MODEL SIZE if ((maxTexSize*maxTexSize) < numElems) { - Log(GLLogStream::SYSTEM, "That's a really huge model, I can't handle it in hardware, sorry.."); + log(GLLogStream::SYSTEM, "That's a really huge model, I can't handle it in hardware, sorry.."); return false; } @@ -331,10 +331,10 @@ bool SdfGpuPlugin::initGL(MeshModel& mm) mNumberOfTexRows = ceil( ((float)numElems) / ((float)mResTextureDim)); - Log(GLLogStream::SYSTEM, "Mesh has %i vertices\n", numVertices ); - Log(GLLogStream::SYSTEM, "Mesh has %i faces\n", numFaces); - Log(GLLogStream::SYSTEM, "Number of tex rows used %i",mNumberOfTexRows); - Log(GLLogStream::SYSTEM, "Result texture is %i X %i = %i", mResTextureDim, mResTextureDim, mResTextureDim*mResTextureDim); + log(GLLogStream::SYSTEM, "Mesh has %i vertices\n", numVertices ); + log(GLLogStream::SYSTEM, "Mesh has %i faces\n", numFaces); + log(GLLogStream::SYSTEM, "Number of tex rows used %i",mNumberOfTexRows); + log(GLLogStream::SYSTEM, "Result texture is %i X %i = %i", mResTextureDim, mResTextureDim, mResTextureDim*mResTextureDim); mVertexCoordsTexture = new FloatTexture2D( TextureFormat( GL_TEXTURE_2D, mResTextureDim, mResTextureDim, GL_RGBA32F_ARB, GL_RGBA, GL_FLOAT ), TextureParams( GL_NEAREST, GL_NEAREST ) ); mVertexNormalsTexture = new FloatTexture2D( TextureFormat( GL_TEXTURE_2D, mResTextureDim, mResTextureDim, GL_RGBA32F_ARB, GL_RGBA, GL_FLOAT ), TextureParams( GL_NEAREST, GL_NEAREST ) ); @@ -564,7 +564,7 @@ void SdfGpuPlugin::setupMesh(MeshDocument& md, ONPRIMITIVE onPrimitive ) { int dup = tri::Clean::RemoveDuplicateVertex(m); int unref = tri::Clean::RemoveUnreferencedVertex(m); - if (dup > 0 || unref > 0) Log("Removed %i duplicate and %i unreferenced vertices\n",dup,unref); + if (dup > 0 || unref > 0) log("Removed %i duplicate and %i unreferenced vertices\n",dup,unref); } //Updating mesh metadata @@ -1041,7 +1041,7 @@ void SdfGpuPlugin::TraceRay(int peelingIteration,const Point3f& dir, MeshModel* return; else if(i==(peelingIteration-1)) - Log(GLLogStream::SYSTEM,"WARNING: You may have underestimated the depth complexity of the mesh. Run the filter with a higher number of peeling iteration."); + log(GLLogStream::SYSTEM,"WARNING: You may have underestimated the depth complexity of the mesh. Run the filter with a higher number of peeling iteration."); mFboArray[j]->unbind(); //we use 3 FBOs to avoid z-fighting (Inspired from Woo's shadow mapping method) diff --git a/src/meshlabplugins/filter_select/meshselect.cpp b/src/meshlabplugins/filter_select/meshselect.cpp index cd1ef4ee3..6e1ab80ca 100644 --- a/src/meshlabplugins/filter_select/meshselect.cpp +++ b/src/meshlabplugins/filter_select/meshselect.cpp @@ -314,7 +314,7 @@ bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md, { case FP_SELECT_DELETE_VERT: { - if (m.cm.svn == 0) { Log("Nothing done: no vertex selected"); break; } + if (m.cm.svn == 0) { log("Nothing done: no vertex selected"); break; } tri::UpdateSelection::FaceClear(m.cm); tri::UpdateSelection::FaceFromVertexLoose(m.cm); int vvn = m.cm.vn; @@ -328,7 +328,7 @@ bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md, m.clearDataMask(MeshModel::MM_FACEFACETOPO); m.clearDataMask(MeshModel::MM_VERTFACETOPO); m.UpdateBoxAndNormals(); - Log("Deleted %i vertices, %i faces.", vvn - m.cm.vn, ffn - m.cm.fn); + log("Deleted %i vertices, %i faces.", vvn - m.cm.vn, ffn - m.cm.fn); } break; case FP_SELECT_DELETE_ALL_FACE: @@ -345,7 +345,7 @@ bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md, ml->clearDataMask(MeshModel::MM_FACEFACETOPO); ml->clearDataMask(MeshModel::MM_VERTFACETOPO); ml->UpdateBoxAndNormals(); - Log("Layer %i: deleted all %i faces.", ml->id(), ffn - ml->cm.fn); + log("Layer %i: deleted all %i faces.", ml->id(), ffn - ml->cm.fn); } } else @@ -357,13 +357,13 @@ bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md, m.clearDataMask(MeshModel::MM_FACEFACETOPO); m.clearDataMask(MeshModel::MM_VERTFACETOPO); m.UpdateBoxAndNormals(); - Log("Deleted all %i faces.", ffn - m.cm.fn); + log("Deleted all %i faces.", ffn - m.cm.fn); } } break; case FP_SELECT_DELETE_FACE: { - if (m.cm.sfn == 0) { Log("Nothing done: no faces selected"); break; } + if (m.cm.sfn == 0) { log("Nothing done: no faces selected"); break; } int ffn = m.cm.fn; for (fi = m.cm.face.begin(); fi != m.cm.face.end(); ++fi) if (!(*fi).IsD() && (*fi).IsS()) @@ -371,12 +371,12 @@ bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md, m.clearDataMask(MeshModel::MM_FACEFACETOPO); m.clearDataMask(MeshModel::MM_VERTFACETOPO); m.UpdateBoxAndNormals(); - Log("Deleted %i faces.", ffn - m.cm.fn); + log("Deleted %i faces.", ffn - m.cm.fn); } break; case FP_SELECT_DELETE_FACEVERT: { - if (m.cm.sfn == 0) { Log("Nothing done: no faces selected"); break; } + if (m.cm.sfn == 0) { log("Nothing done: no faces selected"); break; } tri::UpdateSelection::VertexClear(m.cm); tri::UpdateSelection::VertexFromFaceStrict(m.cm); int vvn = m.cm.vn; @@ -390,7 +390,7 @@ bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md, m.clearDataMask(MeshModel::MM_FACEFACETOPO); m.clearDataMask(MeshModel::MM_VERTFACETOPO); m.UpdateBoxAndNormals(); - Log("Deleted %i faces, %i vertices.", ffn - m.cm.fn, vvn - m.cm.vn); + log("Deleted %i faces, %i vertices.", ffn - m.cm.fn, vvn - m.cm.vn); } break; case FP_SELECT_CONNECTED: @@ -623,7 +623,7 @@ bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md, { float threshold = par.getDynamicFloat("Threshold"); int selFaceNum = tri::UpdateSelection::FaceOutOfRangeEdge(m.cm,0,threshold ); - Log( "Selected %d faces with and edge longer than %f",selFaceNum,threshold); + log( "Selected %d faces with and edge longer than %f",selFaceNum,threshold); } break; case FP_SELECT_FOLD_FACE: @@ -641,7 +641,7 @@ bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md, VertexConstDataWrapper wrapper(m.cm); KdTree kdTree(wrapper); int selVertexNum = tri::OutlierRemoval::SelectLoOPOutliers(m.cm, kdTree, kNearest, threshold); - Log("Selected %d outlier vertices", selVertexNum); + log("Selected %d outlier vertices", selVertexNum); } break; default: assert(0); diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp index 0f2757c03..54e05cbec 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp @@ -191,8 +191,8 @@ bool FilterSketchFabPlugin::sketchfab( return false; } - this->Log("Upload Completed; you can access the uploaded model at the following URL:\n"); - this->Log("%s\n",qUtf8Printable(QString::fromStdString(urlModel)),qUtf8Printable(QString::fromStdString(urlModel))); + this->log("Upload Completed; you can access the uploaded model at the following URL:\n"); + this->log("%s\n",qUtf8Printable(QString::fromStdString(urlModel)),qUtf8Printable(QString::fromStdString(urlModel))); return true; } diff --git a/src/meshlabplugins/filter_texture/filter_texture.cpp b/src/meshlabplugins/filter_texture/filter_texture.cpp index 749b9b0e3..ca97ea3ee 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.cpp +++ b/src/meshlabplugins/filter_texture/filter_texture.cpp @@ -355,7 +355,7 @@ bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, c if(nonManifVertNum>0 || nonManifEdgeNum>0) { - Log("Mesh is not manifold\n:%i non manifold Vertices\n%i nonmanifold Edges\n",nonManifVertNum,nonManifEdgeNum); + log("Mesh is not manifold\n:%i non manifold Vertices\n%i nonmanifold Edges\n",nonManifVertNum,nonManifEdgeNum); this->errorMessage = "Mesh is not manifold. See Log for details"; return false; } @@ -378,11 +378,11 @@ bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, c paraModel->UpdateBoxAndNormals(); baseModel->clearDataMask(bitToBeCleared); - Log("Voronoi Atlas: Completed Processing in %i iterations",pp.vas.iterNum); - Log("Asked %i generated %i regions",pp.sampleNum,pp.vas.regionNum); - Log("Unwrap Time %6.3f s", float(pp.vas.unwrapTime) / CLOCKS_PER_SEC); - Log("Voronoi Time %6.3f s", float(pp.vas.voronoiTime) / CLOCKS_PER_SEC); - Log("Sampling Time %6.3f s", float(pp.vas.samplingTime) / CLOCKS_PER_SEC); + log("Voronoi Atlas: Completed Processing in %i iterations",pp.vas.iterNum); + log("Asked %i generated %i regions",pp.sampleNum,pp.vas.regionNum); + log("Unwrap Time %6.3f s", float(pp.vas.unwrapTime) / CLOCKS_PER_SEC); + log("Voronoi Time %6.3f s", float(pp.vas.voronoiTime) / CLOCKS_PER_SEC); + log("Sampling Time %6.3f s", float(pp.vas.samplingTime) / CLOCKS_PER_SEC); } break; @@ -571,8 +571,8 @@ bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, c } assert(face == faceNo); assert(it == buckets[buckSize-1].end()); - Log( "Biggest triangle's catheti are %.2f px long", (cache[0].P(0)-cache[0].P(2)).Norm() * textDim); - Log( "Smallest triangle's catheti are %.2f px long", (cache[cache.size()-1].P(0)-cache[cache.size()-1].P(2)).Norm() * textDim); + log( "Biggest triangle's catheti are %.2f px long", (cache[0].P(0)-cache[0].P(2)).Norm() * textDim); + log( "Smallest triangle's catheti are %.2f px long", (cache[cache.size()-1].P(0)-cache[cache.size()-1].P(2)).Norm() * textDim); } else //BASIC @@ -637,7 +637,7 @@ bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, c } } } - Log( "Triangles' catheti are %.2f px long", (1.0/sideDim-border-bordersq2)*textDim); + log( "Triangles' catheti are %.2f px long", (1.0/sideDim-border-bordersq2)*textDim); } } break; @@ -685,7 +685,7 @@ bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, c // Save texture CheckError(!img.save(fileName, NULL), "Specified file cannot be saved"); - Log( "Dummy Texture \"%s\" Created ", fileName.toStdString().c_str()); + log( "Dummy Texture \"%s\" Created ", fileName.toStdString().c_str()); assert(textFile.exists()); } @@ -732,7 +732,7 @@ bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, c // Save texture CheckError(!img.save(fileName, "PNG"), "Specified file cannot be saved"); - Log("Dummy Texture \"%s\" Created ", fileName.toStdString().c_str()); + log("Dummy Texture \"%s\" Created ", fileName.toStdString().c_str()); assert(textFile.exists()); } @@ -813,7 +813,7 @@ bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, c // Save texture cb(90, "Saving texture ..."); CheckError(!trgImgs[texInd].save(texFileNames[texInd]), "Texture file cannot be saved"); - Log("Texture \"%s\" Created", texFileNames[texInd].toStdString().c_str()); + log("Texture \"%s\" Created", texFileNames[texInd].toStdString().c_str()); assert(QFile(texFileNames[texInd]).exists()); } @@ -896,7 +896,7 @@ bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, c // Save texture CheckError(!img.save(fileName, "PNG"), "Specified file cannot be saved"); - Log("Dummy Texture \"%s\" Created ", fileName.toStdString().c_str()); + log("Dummy Texture \"%s\" Created ", fileName.toStdString().c_str()); assert(textFile.exists()); } @@ -1028,7 +1028,7 @@ bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, c // Save texture cb(90, "Saving texture ..."); CheckError(!trgImgs[trgTexInd].save(trgTextureFileNames[trgTexInd]), "Texture file cannot be saved"); - Log("Texture \"%s\" Created", trgTextureFileNames[trgTexInd].toStdString().c_str()); + log("Texture \"%s\" Created", trgTextureFileNames[trgTexInd].toStdString().c_str()); assert(QFile(trgTextureFileNames[trgTexInd]).exists()); } diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp index 857bb4e18..c3c70afd5 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp @@ -270,7 +270,7 @@ bool TriOptimizePlugin::applyFilter(const QAction *filter, MeshDocument &md, con if (ID(filter) == FP_CURVATURE_EDGE_FLIP) { int delvert = tri::Clean::RemoveUnreferencedVertex(m.cm); if (delvert) - Log( + log( "Pre-Curvature Cleaning: Removed %d unreferenced vertices", delvert); @@ -324,7 +324,7 @@ bool TriOptimizePlugin::applyFilter(const QAction *filter, MeshDocument &md, con optimiz.DoOptimization(); optimiz.h.clear(); - Log( "%d curvature edge flips performed in %.2f sec.", optimiz.nPerformedOps, (clock() - start) / (float) CLOCKS_PER_SEC); + log( "%d curvature edge flips performed in %.2f sec.", optimiz.nPerformedOps, (clock() - start) / (float) CLOCKS_PER_SEC); } if (ID(filter) == FP_PLANAR_EDGE_FLIP) { if ( tri::Clean::CountNonManifoldEdgeFF(m.cm) >0) { @@ -359,7 +359,7 @@ bool TriOptimizePlugin::applyFilter(const QAction *filter, MeshDocument &md, con optimiz.DoOptimization(); optimiz.h.clear(); - Log( "%d planar edge flips performed in %.2f sec.", optimiz.nPerformedOps, (clock() - start) / (float) CLOCKS_PER_SEC); + log( "%d planar edge flips performed in %.2f sec.", optimiz.nPerformedOps, (clock() - start) / (float) CLOCKS_PER_SEC); int iternum = par.getInt("iterations"); tri::Smooth::VertexCoordPlanarLaplacian(m.cm, iternum, math::ToRad(planarThrDeg), selection,cb); diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp index 257ce2ac8..f36ebc3c9 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp @@ -445,7 +445,7 @@ bool FilterUnsharp::applyFilter(const QAction *filter, MeshDocument &md, const R if(!boundarySmooth) tri::UpdateFlags::FaceClearB(m.cm); tri::Smooth::VertexCoordLaplacian(m.cm,stepSmoothNum,Selected,cotangentWeight,cb); - Log( "Smoothed %d vertices", Selected ? m.cm.svn : m.cm.vn); + log( "Smoothed %d vertices", Selected ? m.cm.svn : m.cm.vn); m.UpdateBoxAndNormals(); } break; @@ -458,7 +458,7 @@ bool FilterUnsharp::applyFilter(const QAction *filter, MeshDocument &md, const R float delta = par.getAbsPerc("delta"); Point3m viewpoint = par.getPoint3m("viewPoint"); tri::Smooth::VertexCoordViewDepth(m.cm, viewpoint, delta, stepSmoothNum, Selected,true); - Log("depth Smoothed %d vertices", Selected ? m.cm.svn : m.cm.vn); + log("depth Smoothed %d vertices", Selected ? m.cm.svn : m.cm.vn); m.UpdateBoxAndNormals(); } break; @@ -481,7 +481,7 @@ bool FilterUnsharp::applyFilter(const QAction *filter, MeshDocument &md, const R for(vi =m.cm.vert.begin();vi!= m.cm.vert.end();++vi) h[vi] = vi->cP(); - Log( "Stored Position %d vertices", m.cm.vn); + log( "Stored Position %d vertices", m.cm.vn); break; } case 1: // ***** Recovering and Projection Vertex Data ***** @@ -500,7 +500,7 @@ bool FilterUnsharp::applyFilter(const QAction *filter, MeshDocument &md, const R (*vi).P() = h[vi] + d * (s*alpha); } m.UpdateBoxAndNormals(); - Log( "Projected smoothed Position %d vertices", m.cm.vn); + log( "Projected smoothed Position %d vertices", m.cm.vn); } break; } @@ -515,7 +515,7 @@ bool FilterUnsharp::applyFilter(const QAction *filter, MeshDocument &md, const R tri::UpdateFlags::FaceClearB(m.cm); float delta = par.getAbsPerc("delta"); tri::Smooth::VertexCoordScaleDependentLaplacian_Fujiwara(m.cm,stepSmoothNum,delta); - Log( "Smoothed %d vertices", cnt>0 ? cnt : m.cm.vn); + log( "Smoothed %d vertices", cnt>0 ? cnt : m.cm.vn); m.UpdateBoxAndNormals(); } break; @@ -557,7 +557,7 @@ bool FilterUnsharp::applyFilter(const QAction *filter, MeshDocument &md, const R size_t cnt=tri::UpdateSelection::VertexFromFaceStrict(m.cm); tri::Smooth::VertexCoordTaubin(m.cm,stepSmoothNum,lambda,mu,cnt>0,cb); - Log( "Smoothed %d vertices", cnt>0 ? cnt : m.cm.vn); + log( "Smoothed %d vertices", cnt>0 ? cnt : m.cm.vn); m.UpdateBoxAndNormals(); } break; diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp index 57cdecc15..9ff3050e3 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp @@ -403,7 +403,7 @@ bool FilterVoronoiPlugin::volumeSampling( mcVm->updateDataMask(MeshModel::MM_VERTCOLOR | MeshModel::MM_VERTQUALITY); pSm->updateDataMask(MeshModel::MM_VERTCOLOR | MeshModel::MM_VERTQUALITY); VoronoiVolumeSampling vvs(m->cm); - Log("Sampling Surface at a radius %f ",sampleSurfRadius); + log("Sampling Surface at a radius %f ",sampleSurfRadius); cb(1, "Init"); vvs.Init(sampleSurfRadius); cb(30, "Sampling Volume..."); @@ -442,12 +442,12 @@ bool FilterVoronoiPlugin::voronoiScaffolding( VoronoiVolumeSampling vvs(m->cm); VoronoiVolumeSampling::Param par; - Log("Sampling Surface at a radius %f ",sampleSurfRadius); + log("Sampling Surface at a radius %f ",sampleSurfRadius); vvs.Init(sampleSurfRadius); cb(30, "Sampling Volume..."); CMeshO::ScalarType poissonVolumeRadius=0; vvs.BuildVolumeSampling(sampleVolNum,poissonVolumeRadius,0); - Log("Base Poisson volume sampling at a radius %f ",poissonVolumeRadius); + log("Base Poisson volume sampling at a radius %f ",poissonVolumeRadius); cb(40, "Relaxing Volume..."); vvs.BarycentricRelaxVoronoiSamples(relaxStep); diff --git a/src/meshlabplugins/io_base/baseio.cpp b/src/meshlabplugins/io_base/baseio.cpp index e46ff0bea..fa71b99ee 100644 --- a/src/meshlabplugins/io_base/baseio.cpp +++ b/src/meshlabplugins/io_base/baseio.cpp @@ -287,7 +287,7 @@ bool BaseMeshIOPlugin::open(const QString &formatName, const QString &fileName, } } if (someTextureNotFound) - Log("Missing texture files: %s", qUtf8Printable(missingTextureFilesMsg)); + log("Missing texture files: %s", qUtf8Printable(missingTextureFilesMsg)); if (cb != NULL) (*cb)(99, "Done"); From 7ca8d10a77e7da12ef3de6e2161647cb80deb32e Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 18 Sep 2020 12:54:49 +0200 Subject: [PATCH 29/49] io_plugin_interface.h, fix filter_trioptimize --- src/common/CMakeLists.txt | 1 + src/common/common.pro | 1 + src/common/interfaces.h | 76 ------------ src/common/interfaces/io_plugin_interface.h | 112 ++++++++++++++++++ src/common/pluginmanager.cpp | 14 +-- src/common/pluginmanager.h | 7 +- src/meshlab/mainwindow.h | 2 +- src/meshlab/mainwindow_RunTime.cpp | 8 +- src/meshlab/plugindialog.cpp | 13 +- .../filter_ssynth/filter_ssynth.cpp | 10 +- .../filter_ssynth/filter_ssynth.h | 4 +- .../filter_trioptimize/filter_trioptimize.cpp | 2 +- .../filter_trioptimize/filter_trioptimize.h | 2 +- src/meshlabplugins/io_3ds/import_3ds.h | 6 +- src/meshlabplugins/io_3ds/meshio.cpp | 6 +- src/meshlabplugins/io_3ds/meshio.h | 6 +- src/meshlabplugins/io_base/baseio.cpp | 5 +- src/meshlabplugins/io_base/baseio.h | 9 +- src/meshlabplugins/io_bre/io_bre.cpp | 4 +- src/meshlabplugins/io_bre/io_bre.h | 9 +- src/meshlabplugins/io_collada/io_collada.cpp | 6 +- src/meshlabplugins/io_collada/io_collada.h | 7 +- src/meshlabplugins/io_ctm/io_ctm.cpp | 4 +- src/meshlabplugins/io_ctm/io_ctm.h | 7 +- src/meshlabplugins/io_expe/io_expe.cpp | 4 +- src/meshlabplugins/io_expe/io_expe.h | 7 +- src/meshlabplugins/io_json/io_json.cpp | 6 +- src/meshlabplugins/io_json/io_json.h | 7 +- src/meshlabplugins/io_pdb/io_pdb.cpp | 4 +- src/meshlabplugins/io_pdb/io_pdb.h | 8 +- src/meshlabplugins/io_tri/io_tri.cpp | 4 +- src/meshlabplugins/io_tri/io_tri.h | 7 +- src/meshlabplugins/io_txt/io_txt.cpp | 4 +- src/meshlabplugins/io_txt/io_txt.h | 7 +- src/meshlabplugins/io_u3d/io_u3d.cpp | 6 +- src/meshlabplugins/io_u3d/io_u3d.h | 7 +- src/meshlabplugins/io_x3d/io_x3d.cpp | 4 +- src/meshlabplugins/io_x3d/io_x3d.h | 7 +- src/meshlabserver/mainserver.cpp | 10 +- vcglib | 2 +- 40 files changed, 236 insertions(+), 179 deletions(-) create mode 100644 src/common/interfaces/io_plugin_interface.h diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index a653a9e14..b896aa6b5 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -35,6 +35,7 @@ set(HEADERS filter_parameter/value.h interfaces/mainwindow_interface.h interfaces/plugin_interface.h + interfaces/io_plugin_interface.h GLExtensionsManager.h GLLogStream.h filterscript.h diff --git a/src/common/common.pro b/src/common/common.pro index 9896ed7f7..3e5ed260e 100644 --- a/src/common/common.pro +++ b/src/common/common.pro @@ -48,6 +48,7 @@ HEADERS += \ filterscript.h \ GLLogStream.h \ interfaces.h \ + interfaces/io_plugin_interface.h \ interfaces/mainwindow_interface.h \ interfaces/plugin_interface.h \ ml_mesh_type.h \ diff --git a/src/common/interfaces.h b/src/common/interfaces.h index b980f6461..3ff978cca 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -52,80 +52,6 @@ class GLAreaReg; class MeshModel; -/** \brief The MeshIOInterface is the base class for all the single mesh loading plugins. -*/ -class MeshIOInterface : public PluginInterface -{ -public: - class Format - { - public: - Format(QString description, QString ex) : description(description) { extensions << ex; } - QString description; - QStringList extensions; - }; - - MeshIOInterface() : PluginInterface() { } - virtual ~MeshIOInterface() {} - - virtual QList importFormats() const = 0; - virtual QList exportFormats() const = 0; - - // This function is called to initialize the list of additional parameters that a OPENING filter could require - // it is called by the framework BEFORE the actual mesh loading to perform to determine how parse the input file - // The instanced parameters are then passed to the open at the loading time. - // Typical example of use to decide what subportion of a mesh you have to load. - // If you do not need any additional processing simply do not override this and ignore the parameterSet in the open - virtual void initPreOpenParameter(const QString &/*format*/, const QString &/*fileName*/, RichParameterList & /*par*/) {} - - // This function is called to initialize the list of additional parameters that a OPENING filter could require - // it is called by the framework AFTER the mesh is already loaded to perform more or less standard processing on the mesh. - // typical example: unifying vertices in stl models. - // If you do not need any additional processing do nothing. - virtual void initOpenParameter(const QString &/*format*/, MeshModel &/*m*/, RichParameterList & /*par*/) {} - - // This is the corresponding function that is called after the mesh is loaded with the initialized parameters - virtual void applyOpenParameter(const QString &/*format*/, MeshModel &/*m*/, const RichParameterList &/*par*/) {} - - // This function is called to initialize the list of additional parameters that a SAVING filter could require - // it is called by the framework after the mesh is loaded to perform more or less standard processing on the mesh. - // typical example: ascii or binary format for ply or stl - // If you do not need any additional parameter simply do nothing. - virtual void initSaveParameter(const QString &/*format*/, MeshModel &/*m*/, RichParameterList & /*par*/) {} - - - virtual void GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const = 0; - - /// callback used to actually load a mesh from a file - virtual bool open( - const QString &format, /// the extension of the format e.g. "PLY" - const QString &fileName, /// The name of the file to be opened - MeshModel &m, /// The mesh that is filled with the file content - int &mask, /// a bit mask that will be filled reporting what kind of data we have found in the file (per vertex color, texture coords etc) - const RichParameterList & par, /// The parameters that have been set up in the initPreOpenParameter() - vcg::CallBackPos *cb = 0, /// standard callback for reporting progress in the loading - QWidget *parent = 0) = 0; /// you should not use this... - - virtual bool save( - const QString &format, // the extension of the format e.g. "PLY" - const QString &fileName, - MeshModel &m, - const int mask, // a bit mask indicating what kind of the data present in the mesh should be saved (e.g. you could not want to save normals in ply files) - const RichParameterList & par, - vcg::CallBackPos *cb = 0, - QWidget *parent = 0) = 0; - - /// This function is invoked by the framework when the import/export plugin fails to give some info to the user about the failure - /// io plugins should avoid using QMessageBox for reporting errors. - /// Failure should put some meaningful information inside the errorMessage string. - virtual QString &errorMsg() { return this->errorMessage; } - void clearErrorString() { errorMessage.clear(); } - - // this string is used to pass back to the framework error messages in case of failure of a filter apply. - // NEVER EVER use a msgbox to say something to the user. - QString errorMessage; - -}; /** \brief The MeshFilterInterface class provide the interface of the filter plugins. @@ -564,7 +490,6 @@ public: #define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x) #define MESHLAB_PLUGIN_NAME_EXPORTER(x) -#define MESH_IO_INTERFACE_IID "vcg.meshlab.MeshIOInterface/1.0" #define MESH_FILTER_INTERFACE_IID "vcg.meshlab.MeshFilterInterface/1.0" #define MESHLAB_FILTER_INTERFACE_IID "vcg.meshlab.MeshLabFilterInterface/1.0" #define MESH_RENDER_INTERFACE_IID "vcg.meshlab.MeshRenderInterface/1.0" @@ -572,7 +497,6 @@ public: #define MESH_EDIT_INTERFACE_IID "vcg.meshlab.MeshEditInterface/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) Q_DECLARE_INTERFACE(MeshRenderInterface, MESH_RENDER_INTERFACE_IID) Q_DECLARE_INTERFACE(MeshDecorateInterface, MESH_DECORATE_INTERFACE_IID) diff --git a/src/common/interfaces/io_plugin_interface.h b/src/common/interfaces/io_plugin_interface.h new file mode 100644 index 000000000..770415f6a --- /dev/null +++ b/src/common/interfaces/io_plugin_interface.h @@ -0,0 +1,112 @@ +/**************************************************************************** +* MeshLab o o * +* A versatile mesh processing toolbox o o * +* _ O _ * +* Copyright(C) 2005-2020 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ + +#ifndef MESHLAB_IO_PLUGIN_INTERFACE_H +#define MESHLAB_IO_PLUGIN_INTERFACE_H + +#include + +#include "plugin_interface.h" + +/** \brief The MeshIOInterface is the base class for all the single mesh loading plugins. +*/ +class IOPluginInterface : public PluginInterface +{ +public: + class Format + { + public: + Format(QString description, QString ex) : description(description) { extensions << ex; } + QString description; + QStringList extensions; + }; + + IOPluginInterface() : PluginInterface() { } + virtual ~IOPluginInterface() {} + + virtual QList importFormats() const = 0; + virtual QList exportFormats() const = 0; + + // This function is called to initialize the list of additional parameters that a OPENING filter could require + // it is called by the framework BEFORE the actual mesh loading to perform to determine how parse the input file + // The instanced parameters are then passed to the open at the loading time. + // Typical example of use to decide what subportion of a mesh you have to load. + // If you do not need any additional processing simply do not override this and ignore the parameterSet in the open + virtual void initPreOpenParameter(const QString &/*format*/, const QString &/*fileName*/, RichParameterList & /*par*/) {} + + // This function is called to initialize the list of additional parameters that a OPENING filter could require + // it is called by the framework AFTER the mesh is already loaded to perform more or less standard processing on the mesh. + // typical example: unifying vertices in stl models. + // If you do not need any additional processing do nothing. + virtual void initOpenParameter(const QString &/*format*/, MeshModel &/*m*/, RichParameterList & /*par*/) {} + + // This is the corresponding function that is called after the mesh is loaded with the initialized parameters + virtual void applyOpenParameter(const QString &/*format*/, MeshModel &/*m*/, const RichParameterList &/*par*/) {} + + // This function is called to initialize the list of additional parameters that a SAVING filter could require + // it is called by the framework after the mesh is loaded to perform more or less standard processing on the mesh. + // typical example: ascii or binary format for ply or stl + // If you do not need any additional parameter simply do nothing. + virtual void initSaveParameter(const QString &/*format*/, MeshModel &/*m*/, RichParameterList & /*par*/) {} + + + virtual void GetExportMaskCapability(const QString &format, int &capability, int &defaultBits) const = 0; + + /// callback used to actually load a mesh from a file + virtual bool open( + const QString &format, /// the extension of the format e.g. "PLY" + const QString &fileName, /// The name of the file to be opened + MeshModel &m, /// The mesh that is filled with the file content + int &mask, /// a bit mask that will be filled reporting what kind of data we have found in the file (per vertex color, texture coords etc) + const RichParameterList & par, /// The parameters that have been set up in the initPreOpenParameter() + vcg::CallBackPos *cb = 0, /// standard callback for reporting progress in the loading + QWidget *parent = 0) = 0; /// you should not use this... + + virtual bool save( + const QString &format, // the extension of the format e.g. "PLY" + const QString &fileName, + MeshModel &m, + const int mask,// a bit mask indicating what kind of the data present in the mesh should be saved (e.g. you could not want to save normals in ply files) + const RichParameterList & par, + vcg::CallBackPos *cb = 0, + QWidget *parent = 0) = 0; + + /// This function is invoked by the framework when the import/export plugin fails to give some info to the user about the failure + /// io plugins should avoid using QMessageBox for reporting errors. + /// Failure should put some meaningful information inside the errorMessage string. + virtual QString &errorMsg() { return this->errorMessage; } + void clearErrorString() { errorMessage.clear(); } + + // this string is used to pass back to the framework error messages in case of failure of a filter apply. + // NEVER EVER use a msgbox to say something to the user. + QString errorMessage; + +}; + +#define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x) +#define MESHLAB_PLUGIN_NAME_EXPORTER(x) + +#define MESH_IO_INTERFACE_IID "vcg.meshlab.IOPluginInterface/1.0" +Q_DECLARE_INTERFACE(IOPluginInterface, MESH_IO_INTERFACE_IID) + +#endif // MESHLAB_IO_PLUGIN_INTERFACE_H diff --git a/src/common/pluginmanager.cpp b/src/common/pluginmanager.cpp index 80710a11b..441f71d83 100644 --- a/src/common/pluginmanager.cpp +++ b/src/common/pluginmanager.cpp @@ -107,7 +107,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl throw MLException("Missing Arity for " +fileName+filterAction->text()); } } - MeshIOInterface *iIO = qobject_cast(plugin); + IOPluginInterface *iIO = qobject_cast(plugin); if (iIO) { iCommon = iIO; @@ -271,11 +271,11 @@ void PluginManager::knownIOFormats() { QStringList* formatFilters = NULL; QString allKnownFormatsFilter = QObject::tr("All known formats ("); - for (QVector::iterator itIOPlugin = meshIOPlug.begin(); itIOPlugin != meshIOPlug.end(); ++itIOPlugin) + for (QVector::iterator itIOPlugin = meshIOPlug.begin(); itIOPlugin != meshIOPlug.end(); ++itIOPlugin) { - MeshIOInterface* pMeshIOPlugin = *itIOPlugin; - QList format; - QMap* map = NULL; + IOPluginInterface* pMeshIOPlugin = *itIOPlugin; + QList format; + QMap* map = NULL; if (inpOut == int(IMPORT)) { map = &allKnowInputFormats; @@ -288,9 +288,9 @@ void PluginManager::knownIOFormats() formatFilters = &outFilters; format = pMeshIOPlugin->exportFormats(); } - for (QList::iterator itf = format.begin(); itf != format.end(); ++itf) + for (QList::iterator itf = format.begin(); itf != format.end(); ++itf) { - MeshIOInterface::Format currentFormat = *itf; + IOPluginInterface::Format currentFormat = *itf; QString currentFilterEntry = currentFormat.description + " ("; diff --git a/src/common/pluginmanager.h b/src/common/pluginmanager.h index 00658c659..6f54774c9 100644 --- a/src/common/pluginmanager.h +++ b/src/common/pluginmanager.h @@ -25,6 +25,7 @@ #define PLUGINMANAGER_H #include "interfaces.h" +#include "interfaces/io_plugin_interface.h" //#include "scriptsyntax.h" #include @@ -59,12 +60,12 @@ public: QMap actionFilterMap; QMap stringFilterMap; - QMap allKnowInputFormats; - QMap allKnowOutputFormats; + QMap allKnowInputFormats; + QMap allKnowOutputFormats; QStringList inpFilters; QStringList outFilters; - QVector meshIOPlug; + QVector meshIOPlug; QVector meshFilterPlug; QVector meshRenderPlug; QVector meshDecoratePlug; diff --git a/src/meshlab/mainwindow.h b/src/meshlab/mainwindow.h index 564b8054a..9992d31e7 100644 --- a/src/meshlab/mainwindow.h +++ b/src/meshlab/mainwindow.h @@ -147,7 +147,7 @@ private slots: public: bool exportMesh(QString fileName,MeshModel* mod,const bool saveAllPossibleAttributes); - bool loadMesh(const QString& fileName,MeshIOInterface *pCurrentIOPlugin,MeshModel* mm,int& mask,RichParameterList* prePar,const Matrix44m &mtr=Matrix44m::Identity(), bool isareload = false, MLRenderingData* rendOpt = NULL); + bool loadMesh(const QString& fileName,IOPluginInterface *pCurrentIOPlugin,MeshModel* mm,int& mask,RichParameterList* prePar,const Matrix44m &mtr=Matrix44m::Identity(), bool isareload = false, MLRenderingData* rendOpt = NULL); void computeRenderingDataOnLoading(MeshModel* mm,bool isareload, MLRenderingData* rendOpt = NULL); diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index 784bcbf6c..33a8bc3ba 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -2073,7 +2073,7 @@ bool MainWindow::importRaster(const QString& fileImg) return true; } -bool MainWindow::loadMesh(const QString& fileName, MeshIOInterface *pCurrentIOPlugin, MeshModel* mm, int& mask,RichParameterList* prePar, const Matrix44m &mtr, bool isareload, MLRenderingData* rendOpt) +bool MainWindow::loadMesh(const QString& fileName, IOPluginInterface *pCurrentIOPlugin, MeshModel* mm, int& mask,RichParameterList* prePar, const Matrix44m &mtr, bool isareload, MLRenderingData* rendOpt) { if ((GLA() == NULL) || (mm == NULL)) return false; @@ -2286,7 +2286,7 @@ bool MainWindow::importMesh(QString fileName,bool isareload) { QFileInfo fi(fileName); QString extension = fi.suffix(); - MeshIOInterface *pCurrentIOPlugin = PM.allKnowInputFormats[extension.toLower()]; + IOPluginInterface *pCurrentIOPlugin = PM.allKnowInputFormats[extension.toLower()]; //pCurrentIOPlugin->setLog(gla->log); if (pCurrentIOPlugin == NULL) { @@ -2382,7 +2382,7 @@ bool MainWindow::loadMeshWithStandardParams(QString& fullPath, MeshModel* mm, co mm->Clear(); QFileInfo fi(fullPath); QString extension = fi.suffix(); - MeshIOInterface *pCurrentIOPlugin = PM.allKnowInputFormats[extension.toLower()]; + IOPluginInterface *pCurrentIOPlugin = PM.allKnowInputFormats[extension.toLower()]; if(pCurrentIOPlugin != NULL) { @@ -2521,7 +2521,7 @@ bool MainWindow::exportMesh(QString fileName,MeshModel* mod,const bool saveAllPo QStringListIterator itFilter(suffixList); - MeshIOInterface *pCurrentIOPlugin = PM.allKnowOutputFormats[extension.toLower()]; + IOPluginInterface *pCurrentIOPlugin = PM.allKnowOutputFormats[extension.toLower()]; if (pCurrentIOPlugin == 0) { QMessageBox::warning(this, "Unknown type", "File extension not supported!"); diff --git a/src/meshlab/plugindialog.cpp b/src/meshlab/plugindialog.cpp index bd3d5f0df..26c9ec8f0 100644 --- a/src/meshlab/plugindialog.cpp +++ b/src/meshlab/plugindialog.cpp @@ -23,6 +23,7 @@ #include "plugindialog.h" #include +#include #include #include @@ -116,15 +117,15 @@ void PluginDialog::populateTreeWidget(const QString &path,const QStringList &fil pluginItem->setFont(0, boldFont); if (plugin) { - MeshIOInterface *iMeshIO = qobject_cast(plugin); + IOPluginInterface *iMeshIO = qobject_cast(plugin); if (iMeshIO){ QStringList Templist; - foreach(const MeshIOInterface::Format f,iMeshIO->importFormats()){ + foreach(const IOPluginInterface::Format f,iMeshIO->importFormats()){ QString formats; foreach(const QString s,f.extensions) formats+="Importer_"+s+" "; Templist.push_back(formats); } - foreach(const MeshIOInterface::Format f,iMeshIO->exportFormats()){ + foreach(const IOPluginInterface::Format f,iMeshIO->exportFormats()){ QString formats; foreach(const QString s,f.extensions) formats+="Exporter_"+s+" "; Templist.push_back(formats); @@ -184,14 +185,14 @@ void PluginDialog::displayInfo(QTreeWidgetItem* item,int /* ncolumn*/) qDebug("Trying to load the plugin '%s'", qUtf8Printable(fileName)); QObject *plugin = loader.instance(); if (plugin) { - MeshIOInterface *iMeshIO = qobject_cast(plugin); + IOPluginInterface *iMeshIO = qobject_cast(plugin); if (iMeshIO){ - foreach(const MeshIOInterface::Format f,iMeshIO->importFormats()){ + foreach(const IOPluginInterface::Format f,iMeshIO->importFormats()){ QString formats; foreach(const QString s,f.extensions) formats+="Importer_"+s+" "; if (actionName==formats) labelInfo->setText(f.description); } - foreach(const MeshIOInterface::Format f,iMeshIO->exportFormats()){ + foreach(const IOPluginInterface::Format f,iMeshIO->exportFormats()){ QString formats; foreach(const QString s,f.extensions) formats+="Exporter_"+s+" "; if (actionName==formats) labelInfo->setText(f.description); diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp index 9d6b5eed4..6b612cbe5 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp @@ -158,16 +158,16 @@ MeshFilterInterface::FilterClass FilterSSynth::getClass(const QAction */*filter* return MeshFilterInterface::MeshCreation; } -QList FilterSSynth::importFormats() const +QList FilterSSynth::importFormats() const { - QList formats; - formats<< MeshIOInterface::Format("Eisen Script File", tr("ES")); + QList formats; + formats<< IOPluginInterface::Format("Eisen Script File", tr("ES")); return formats; } -QList FilterSSynth::exportFormats() const +QList FilterSSynth::exportFormats() const { - QList formats; + QList formats; return formats ; } diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.h b/src/meshlabplugins/filter_ssynth/filter_ssynth.h index 40bfabbf0..6d2ba3991 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.h +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.h @@ -31,10 +31,10 @@ #include #include -class FilterSSynth : public QObject,public MeshIOInterface, public MeshFilterInterface{ +class FilterSSynth : public QObject,public IOPluginInterface, public MeshFilterInterface{ Q_OBJECT MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface MeshIOInterface) + Q_INTERFACES(MeshFilterInterface IOPluginInterface) public: enum {CR_SSYNTH} ; diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp index c3c70afd5..9531001d4 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp @@ -171,7 +171,7 @@ QString TriOptimizePlugin::pluginName() const return {}; } - TriOptimizePlugin::FilterClass TriOptimizePlugin::getClass(const QAction *action) + TriOptimizePlugin::FilterClass TriOptimizePlugin::getClass(const QAction *action) const { switch(ID(action)) { case FP_PLANAR_EDGE_FLIP: return MeshFilterInterface::Remeshing; diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h index b42fc80b9..26da938d9 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h @@ -50,7 +50,7 @@ public: void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); bool applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList &/*parent*/, vcg::CallBackPos * cb) ; int getRequirements(const QAction*); - FilterClass getClass(const QAction *); + FilterClass getClass(const QAction *) const; int postCondition(const QAction* ) const; FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/io_3ds/import_3ds.h b/src/meshlabplugins/io_3ds/import_3ds.h index 13b36d83e..5a97791e9 100644 --- a/src/meshlabplugins/io_3ds/import_3ds.h +++ b/src/meshlabplugins/io_3ds/import_3ds.h @@ -41,12 +41,14 @@ #ifndef __VCGLIB_IMPORT_3DS #define __VCGLIB_IMPORT_3DS -#include #include "io_3ds.h" + +#include #include +#include // lib3ds headers -#include +#include #include #include #include diff --git a/src/meshlabplugins/io_3ds/meshio.cpp b/src/meshlabplugins/io_3ds/meshio.cpp index beb01eef9..a28986820 100644 --- a/src/meshlabplugins/io_3ds/meshio.cpp +++ b/src/meshlabplugins/io_3ds/meshio.cpp @@ -41,6 +41,8 @@ #include #include +#include +#include using namespace std; using namespace vcg; @@ -233,7 +235,7 @@ bool ExtraMeshIOPlugin::save(const QString &formatName, const QString &fileName, /* returns the list of the file's type which can be imported */ -QList ExtraMeshIOPlugin::importFormats() const +QList ExtraMeshIOPlugin::importFormats() const { QList formatList; formatList << Format("3D-Studio File Format" ,tr("3DS")); @@ -243,7 +245,7 @@ QList ExtraMeshIOPlugin::importFormats() const /* returns the list of the file's type which can be exported */ -QList ExtraMeshIOPlugin::exportFormats() const +QList ExtraMeshIOPlugin::exportFormats() const { QList formatList; formatList << Format("3D-Studio File Format" ,tr("3DS")); diff --git a/src/meshlabplugins/io_3ds/meshio.h b/src/meshlabplugins/io_3ds/meshio.h index 8ef42e690..cb63aa055 100644 --- a/src/meshlabplugins/io_3ds/meshio.h +++ b/src/meshlabplugins/io_3ds/meshio.h @@ -27,13 +27,13 @@ #include #include -#include +#include -class ExtraMeshIOPlugin : public QObject, public MeshIOInterface +class ExtraMeshIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) - Q_INTERFACES(MeshIOInterface) + Q_INTERFACES(IOPluginInterface) public: diff --git a/src/meshlabplugins/io_base/baseio.cpp b/src/meshlabplugins/io_base/baseio.cpp index fa71b99ee..72878d5d5 100644 --- a/src/meshlabplugins/io_base/baseio.cpp +++ b/src/meshlabplugins/io_base/baseio.cpp @@ -22,6 +22,7 @@ ****************************************************************************/ #include "baseio.h" +#include #include #include @@ -429,7 +430,7 @@ QString BaseMeshIOPlugin::pluginName() const /* returns the list of the file's type which can be imported */ -QList BaseMeshIOPlugin::importFormats() const +QList BaseMeshIOPlugin::importFormats() const { QList formatList; formatList << Format("Stanford Polygon File Format", tr("PLY")); @@ -447,7 +448,7 @@ QList BaseMeshIOPlugin::importFormats() const /* returns the list of the file's type which can be exported */ -QList BaseMeshIOPlugin::exportFormats() const +QList BaseMeshIOPlugin::exportFormats() const { QList formatList; formatList << Format("Stanford Polygon File Format", tr("PLY")); diff --git a/src/meshlabplugins/io_base/baseio.h b/src/meshlabplugins/io_base/baseio.h index 4c93de49d..b92762168 100644 --- a/src/meshlabplugins/io_base/baseio.h +++ b/src/meshlabplugins/io_base/baseio.h @@ -23,18 +23,19 @@ #ifndef BASEIOPLUGIN_H #define BASEIOPLUGIN_H -#include +#include +#include -class BaseMeshIOPlugin : public QObject, public MeshIOInterface +class BaseMeshIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) - Q_INTERFACES(MeshIOInterface) + Q_INTERFACES(IOPluginInterface) public: - BaseMeshIOPlugin() : MeshIOInterface() {} + BaseMeshIOPlugin() : IOPluginInterface() {} QString pluginName() const; QList importFormats() const; diff --git a/src/meshlabplugins/io_bre/io_bre.cpp b/src/meshlabplugins/io_bre/io_bre.cpp index a27a25746..68f25067d 100644 --- a/src/meshlabplugins/io_bre/io_bre.cpp +++ b/src/meshlabplugins/io_bre/io_bre.cpp @@ -160,7 +160,7 @@ QString BreMeshIOPlugin::pluginName() const return "IOBRE"; } -QList BreMeshIOPlugin::importFormats() const +QList BreMeshIOPlugin::importFormats() const { QList formatList; formatList << Format("Breuckmann File Format" , tr("BRE")); @@ -171,7 +171,7 @@ QList BreMeshIOPlugin::importFormats() const /* returns the list of the file's type which can be exported */ -QList BreMeshIOPlugin::exportFormats() const +QList BreMeshIOPlugin::exportFormats() const { QList formatList; //formatList << Format("Breuckmann File Format" , tr("BRE")); diff --git a/src/meshlabplugins/io_bre/io_bre.h b/src/meshlabplugins/io_bre/io_bre.h index fc0b572b8..90a90bc05 100644 --- a/src/meshlabplugins/io_bre/io_bre.h +++ b/src/meshlabplugins/io_bre/io_bre.h @@ -23,7 +23,8 @@ #ifndef IOBREPLUGIN_H #define IOBREPLUGIN_H -#include +#include +#include namespace vcg { namespace tri { @@ -149,15 +150,15 @@ namespace io { }//namespace tri }//namespace vcg -class BreMeshIOPlugin : public QObject, public MeshIOInterface +class BreMeshIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) - Q_INTERFACES(MeshIOInterface) + Q_INTERFACES(IOPluginInterface) public: - BreMeshIOPlugin() : MeshIOInterface() {} + BreMeshIOPlugin() : IOPluginInterface() {} QString pluginName() const; QList importFormats() const; diff --git a/src/meshlabplugins/io_collada/io_collada.cpp b/src/meshlabplugins/io_collada/io_collada.cpp index bcd1edec2..601c2d9cf 100644 --- a/src/meshlabplugins/io_collada/io_collada.cpp +++ b/src/meshlabplugins/io_collada/io_collada.cpp @@ -88,6 +88,8 @@ #include #include +#include +#include #include "io_collada.h" @@ -217,7 +219,7 @@ QString ColladaIOPlugin::pluginName() const return "IOCollada"; } -QList ColladaIOPlugin::importFormats() const +QList ColladaIOPlugin::importFormats() const { QList formatList; formatList << Format("Collada File Format" ,tr("DAE")); @@ -227,7 +229,7 @@ QList ColladaIOPlugin::importFormats() const /* returns the list of the file's type which can be exported */ -QList ColladaIOPlugin::exportFormats() const +QList ColladaIOPlugin::exportFormats() const { QList formatList; formatList << Format("Collada File Format" ,tr("DAE")); diff --git a/src/meshlabplugins/io_collada/io_collada.h b/src/meshlabplugins/io_collada/io_collada.h index e2f0170a1..fffccf15a 100644 --- a/src/meshlabplugins/io_collada/io_collada.h +++ b/src/meshlabplugins/io_collada/io_collada.h @@ -44,13 +44,14 @@ #define COLLADAIOPLUGIN_H #include -#include +#include +#include -class ColladaIOPlugin : public QObject, public MeshIOInterface +class ColladaIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) - Q_INTERFACES(MeshIOInterface) + Q_INTERFACES(IOPluginInterface) public: //std::map _mp; diff --git a/src/meshlabplugins/io_ctm/io_ctm.cpp b/src/meshlabplugins/io_ctm/io_ctm.cpp index 6c07d1154..8ed221c3e 100644 --- a/src/meshlabplugins/io_ctm/io_ctm.cpp +++ b/src/meshlabplugins/io_ctm/io_ctm.cpp @@ -71,7 +71,7 @@ QString IOMPlugin::pluginName() const return "IOCTM"; } -QList IOMPlugin::importFormats() const +QList IOMPlugin::importFormats() const { QList formatList; formatList << Format("OpenCTM compressed format" ,tr("CTM")); @@ -81,7 +81,7 @@ QList IOMPlugin::importFormats() const /* returns the list of the file's type which can be exported */ -QList IOMPlugin::exportFormats() const +QList IOMPlugin::exportFormats() const { QList formatList; formatList << Format("OpenCTM compressed format" ,tr("CTM")); diff --git a/src/meshlabplugins/io_ctm/io_ctm.h b/src/meshlabplugins/io_ctm/io_ctm.h index c720bb3e9..eeeb0a23d 100644 --- a/src/meshlabplugins/io_ctm/io_ctm.h +++ b/src/meshlabplugins/io_ctm/io_ctm.h @@ -31,13 +31,14 @@ #include -#include +#include +#include -class IOMPlugin : public QObject, public MeshIOInterface +class IOMPlugin : public QObject, public IOPluginInterface { Q_OBJECT MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) - Q_INTERFACES(MeshIOInterface) + Q_INTERFACES(IOPluginInterface) public: diff --git a/src/meshlabplugins/io_expe/io_expe.cpp b/src/meshlabplugins/io_expe/io_expe.cpp index 207bba10f..5caa4e561 100644 --- a/src/meshlabplugins/io_expe/io_expe.cpp +++ b/src/meshlabplugins/io_expe/io_expe.cpp @@ -150,7 +150,7 @@ QString ExpeIOPlugin::pluginName() const return "IOExpe"; } -QList ExpeIOPlugin::importFormats() const +QList ExpeIOPlugin::importFormats() const { QList formatList; formatList << Format("Expe's point set (binary)" ,tr("pts")); @@ -162,7 +162,7 @@ QList ExpeIOPlugin::importFormats() const /* returns the list of the file's type which can be exported */ -QList ExpeIOPlugin::exportFormats() const +QList ExpeIOPlugin::exportFormats() const { QList formatList; // formatList << Format("Expe's point set (binary)" ,tr("pts")); diff --git a/src/meshlabplugins/io_expe/io_expe.h b/src/meshlabplugins/io_expe/io_expe.h index 1ddc91222..679cb8960 100644 --- a/src/meshlabplugins/io_expe/io_expe.h +++ b/src/meshlabplugins/io_expe/io_expe.h @@ -26,13 +26,14 @@ #include -#include +#include +#include -class ExpeIOPlugin : public QObject, public MeshIOInterface +class ExpeIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) - Q_INTERFACES(MeshIOInterface) + Q_INTERFACES(IOPluginInterface) public: diff --git a/src/meshlabplugins/io_json/io_json.cpp b/src/meshlabplugins/io_json/io_json.cpp index 0f6d6fff9..c17aaf458 100644 --- a/src/meshlabplugins/io_json/io_json.cpp +++ b/src/meshlabplugins/io_json/io_json.cpp @@ -30,7 +30,7 @@ #include #include -JSONIOPlugin::JSONIOPlugin(void) : MeshIOInterface() +JSONIOPlugin::JSONIOPlugin(void) : IOPluginInterface() { ; } @@ -426,7 +426,7 @@ bool JSONIOPlugin::save(const QString & formatName,const QString & fileName, Mes /* returns the list of the file's type which can be imported */ -QList JSONIOPlugin::importFormats(void) const +QList JSONIOPlugin::importFormats(void) const { QList formatList; //formatList << Format("JavaScript JSON", tr("JSON")); @@ -436,7 +436,7 @@ QList JSONIOPlugin::importFormats(void) const /* returns the list of the file's type which can be exported */ -QList JSONIOPlugin::exportFormats(void) const +QList JSONIOPlugin::exportFormats(void) const { QList formatList; formatList << Format("JavaScript JSON", tr("JSON")); diff --git a/src/meshlabplugins/io_json/io_json.h b/src/meshlabplugins/io_json/io_json.h index afee1f9a7..80032ad1c 100644 --- a/src/meshlabplugins/io_json/io_json.h +++ b/src/meshlabplugins/io_json/io_json.h @@ -23,13 +23,14 @@ #ifndef JSONIOPLUGIN_H #define JSONIOPLUGIN_H -#include +#include +#include -class JSONIOPlugin : public QObject, public MeshIOInterface +class JSONIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) - Q_INTERFACES(MeshIOInterface) + Q_INTERFACES(IOPluginInterface) public: diff --git a/src/meshlabplugins/io_pdb/io_pdb.cpp b/src/meshlabplugins/io_pdb/io_pdb.cpp index 610ac6f04..4383a493b 100644 --- a/src/meshlabplugins/io_pdb/io_pdb.cpp +++ b/src/meshlabplugins/io_pdb/io_pdb.cpp @@ -148,7 +148,7 @@ QString PDBIOPlugin::pluginName() const return "IOPDB"; } -QList PDBIOPlugin::importFormats() const +QList PDBIOPlugin::importFormats() const { QList formatList; formatList << Format("Protein Data Bank" , tr("PDB")); @@ -159,7 +159,7 @@ QList PDBIOPlugin::importFormats() const /* returns the list of the file's type which can be exported */ -QList PDBIOPlugin::exportFormats() const +QList PDBIOPlugin::exportFormats() const { QList formatList; // formatList << Format("Stanford Polygon File Format" , tr("PLY")); diff --git a/src/meshlabplugins/io_pdb/io_pdb.h b/src/meshlabplugins/io_pdb/io_pdb.h index 562a10085..11e9fff15 100644 --- a/src/meshlabplugins/io_pdb/io_pdb.h +++ b/src/meshlabplugins/io_pdb/io_pdb.h @@ -24,14 +24,14 @@ #ifndef PDBIOPLUGIN_H #define PDBIOPLUGIN_H +#include +#include -#include - -class PDBIOPlugin : public QObject, public MeshIOInterface +class PDBIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) - Q_INTERFACES(MeshIOInterface) + Q_INTERFACES(IOPluginInterface) public: diff --git a/src/meshlabplugins/io_tri/io_tri.cpp b/src/meshlabplugins/io_tri/io_tri.cpp index 2f1f113a7..0eff96a30 100755 --- a/src/meshlabplugins/io_tri/io_tri.cpp +++ b/src/meshlabplugins/io_tri/io_tri.cpp @@ -87,7 +87,7 @@ QString TriIOPlugin::pluginName() const return "IOTRI"; } -QList TriIOPlugin::importFormats() const +QList TriIOPlugin::importFormats() const { QList formatList; formatList @@ -99,7 +99,7 @@ QList TriIOPlugin::importFormats() const /* returns the list of the file's type which can be exported */ -QList TriIOPlugin::exportFormats() const +QList TriIOPlugin::exportFormats() const { QList formatList; return formatList; diff --git a/src/meshlabplugins/io_tri/io_tri.h b/src/meshlabplugins/io_tri/io_tri.h index 6047d439e..5f919fc79 100755 --- a/src/meshlabplugins/io_tri/io_tri.h +++ b/src/meshlabplugins/io_tri/io_tri.h @@ -31,13 +31,14 @@ #include -#include +#include +#include -class TriIOPlugin : public QObject, public MeshIOInterface +class TriIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) - Q_INTERFACES(MeshIOInterface) + Q_INTERFACES(IOPluginInterface) public: diff --git a/src/meshlabplugins/io_txt/io_txt.cpp b/src/meshlabplugins/io_txt/io_txt.cpp index 04259e540..4b42d0b21 100755 --- a/src/meshlabplugins/io_txt/io_txt.cpp +++ b/src/meshlabplugins/io_txt/io_txt.cpp @@ -103,7 +103,7 @@ QString TxtIOPlugin::pluginName() const return "IOTXT"; } -QList TxtIOPlugin::importFormats() const +QList TxtIOPlugin::importFormats() const { QList formatList; formatList << Format("TXT (Generic ASCII point list)", tr("TXT")); @@ -114,7 +114,7 @@ QList TxtIOPlugin::importFormats() const /* returns the list of the file's type which can be exported */ -QList TxtIOPlugin::exportFormats() const +QList TxtIOPlugin::exportFormats() const { QList formatList; return formatList; diff --git a/src/meshlabplugins/io_txt/io_txt.h b/src/meshlabplugins/io_txt/io_txt.h index 026da498f..bf0e0638b 100755 --- a/src/meshlabplugins/io_txt/io_txt.h +++ b/src/meshlabplugins/io_txt/io_txt.h @@ -25,13 +25,14 @@ #include -#include +#include +#include -class TxtIOPlugin : public QObject, public MeshIOInterface +class TxtIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) - Q_INTERFACES(MeshIOInterface) + Q_INTERFACES(IOPluginInterface) public: diff --git a/src/meshlabplugins/io_u3d/io_u3d.cpp b/src/meshlabplugins/io_u3d/io_u3d.cpp index 0410f4a0c..71fb5ddc3 100644 --- a/src/meshlabplugins/io_u3d/io_u3d.cpp +++ b/src/meshlabplugins/io_u3d/io_u3d.cpp @@ -41,7 +41,7 @@ using namespace vcg; U3DIOPlugin::U3DIOPlugin() -:QObject(),MeshIOInterface(),_param() +:QObject(),IOPluginInterface(),_param() { } @@ -125,7 +125,7 @@ QString U3DIOPlugin::pluginName() const return "IOU3D"; } -QList U3DIOPlugin::importFormats() const +QList U3DIOPlugin::importFormats() const { QList formatList; return formatList; @@ -134,7 +134,7 @@ QList U3DIOPlugin::importFormats() const /* returns the list of the file's type which can be exported */ -QList U3DIOPlugin::exportFormats() const +QList U3DIOPlugin::exportFormats() const { QList formatList; formatList << Format("U3D File Format" ,tr("U3D")); diff --git a/src/meshlabplugins/io_u3d/io_u3d.h b/src/meshlabplugins/io_u3d/io_u3d.h index 6ab1ba8c9..17238a2c5 100644 --- a/src/meshlabplugins/io_u3d/io_u3d.h +++ b/src/meshlabplugins/io_u3d/io_u3d.h @@ -28,15 +28,16 @@ #include #include -#include +#include +#include #include #include -class U3DIOPlugin : public QObject, public MeshIOInterface +class U3DIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) - Q_INTERFACES(MeshIOInterface) + Q_INTERFACES(IOPluginInterface) public: QString pluginName() const; diff --git a/src/meshlabplugins/io_x3d/io_x3d.cpp b/src/meshlabplugins/io_x3d/io_x3d.cpp index 2222a9567..66f605d4f 100644 --- a/src/meshlabplugins/io_x3d/io_x3d.cpp +++ b/src/meshlabplugins/io_x3d/io_x3d.cpp @@ -155,7 +155,7 @@ QString IoX3DPlugin::pluginName() const return "IOX3D"; } -QList IoX3DPlugin::importFormats() const +QList IoX3DPlugin::importFormats() const { QList formatList; formatList << Format("X3D File Format - XML encoding", tr("X3D")); @@ -167,7 +167,7 @@ QList IoX3DPlugin::importFormats() const /* returns the list of the file's type which can be exported */ -QList IoX3DPlugin::exportFormats() const +QList IoX3DPlugin::exportFormats() const { QList formatList; formatList << Format("X3D File Format", tr("X3D")); diff --git a/src/meshlabplugins/io_x3d/io_x3d.h b/src/meshlabplugins/io_x3d/io_x3d.h index afd9ed202..c1c7b2247 100644 --- a/src/meshlabplugins/io_x3d/io_x3d.h +++ b/src/meshlabplugins/io_x3d/io_x3d.h @@ -34,13 +34,14 @@ #include -#include +#include +#include -class IoX3DPlugin : public QObject, public MeshIOInterface +class IoX3DPlugin : public QObject, public IOPluginInterface { Q_OBJECT MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) - Q_INTERFACES(MeshIOInterface) + Q_INTERFACES(IOPluginInterface) public: diff --git a/src/meshlabserver/mainserver.cpp b/src/meshlabserver/mainserver.cpp index a4078493c..0a53753b8 100644 --- a/src/meshlabserver/mainserver.cpp +++ b/src/meshlabserver/mainserver.cpp @@ -138,7 +138,7 @@ public: // HashTable storing all supported formats together with // the (1-based) index of first plugin which is able to open it - QHash allKnownFormats; + QHash allKnownFormats; //PM.LoadFormats(filters, allKnownFormats,PluginManager::IMPORT); @@ -150,7 +150,7 @@ public: QString extension = fi.suffix(); qDebug("Opening a file with extension %s", qUtf8Printable(extension)); // retrieving corresponding IO plugin - MeshIOInterface* pCurrentIOPlugin = PM.allKnowInputFormats[extension.toLower()]; + IOPluginInterface* pCurrentIOPlugin = PM.allKnowInputFormats[extension.toLower()]; if (pCurrentIOPlugin == 0) { fprintf(fp,"Error encountered while opening file: "); @@ -215,7 +215,7 @@ public: QString extension = fi.suffix(); // retrieving corresponding IO plugin - MeshIOInterface* pCurrentIOPlugin = PM.allKnowOutputFormats[extension.toLower()]; + IOPluginInterface* pCurrentIOPlugin = PM.allKnowOutputFormats[extension.toLower()]; if (pCurrentIOPlugin == 0) { fprintf(fp,"Error encountered while opening file: "); @@ -245,7 +245,7 @@ public: return true; } - bool loadMesh(const QString& fileName, MeshIOInterface *pCurrentIOPlugin, MeshModel* mm, int& mask,RichParameterList* prePar, const Matrix44m &mtr, MeshDocument* md, FILE* fp = stdout) + bool loadMesh(const QString& fileName, IOPluginInterface *pCurrentIOPlugin, MeshModel* mm, int& mask,RichParameterList* prePar, const Matrix44m &mtr, MeshDocument* md, FILE* fp = stdout) { if (mm == NULL) return false; @@ -380,7 +380,7 @@ public: mm->Clear(); QFileInfo fi(fullPath); QString extension = fi.suffix(); - MeshIOInterface *pCurrentIOPlugin = PM.allKnowInputFormats[extension.toLower()]; + IOPluginInterface *pCurrentIOPlugin = PM.allKnowInputFormats[extension.toLower()]; if(pCurrentIOPlugin != NULL) { diff --git a/vcglib b/vcglib index d33a25db2..94cc728dd 160000 --- a/vcglib +++ b/vcglib @@ -1 +1 @@ -Subproject commit d33a25db2dfc63d74d9c40a7f0bd40633c4b8142 +Subproject commit 94cc728ddb9774eee62b84bcb1fe1cf252e03841 From 233b3e9f54dcc219ff80ffa809077ff2dad25cd0 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 18 Sep 2020 13:27:59 +0200 Subject: [PATCH 30/49] filter_plugin_interface.h --- src/common/CMakeLists.txt | 2 + src/common/common.pro | 2 + src/common/interfaces.cpp | 68 ----- src/common/interfaces.h | 208 --------------- .../interfaces/filter_plugin_interface.cpp | 71 ++++++ .../interfaces/filter_plugin_interface.h | 239 ++++++++++++++++++ src/common/interfaces/io_plugin_interface.h | 4 +- src/common/pluginmanager.cpp | 6 +- src/common/pluginmanager.h | 7 +- src/meshlab/filterScriptDialog.cpp | 2 +- src/meshlab/mainwindow_Init.cpp | 44 ++-- src/meshlab/mainwindow_RunTime.cpp | 48 ++-- src/meshlab/ml_std_par_dialog.cpp | 4 +- src/meshlab/ml_std_par_dialog.h | 5 +- src/meshlab/plugindialog.cpp | 5 +- .../richparameterlistframe.h | 2 - src/meshlabplugins/filter_ao/filter_ao.cpp | 8 +- src/meshlabplugins/filter_ao/filter_ao.h | 8 +- .../filter_camera/filter_camera.cpp | 12 +- .../filter_camera/filter_camera.h | 8 +- .../filter_clean/cleanfilter.cpp | 8 +- src/meshlabplugins/filter_clean/cleanfilter.h | 8 +- .../filter_color_projection.cpp | 2 +- .../filter_color_projection.h | 8 +- .../filter_colorproc/filter_colorproc.cpp | 20 +- .../filter_colorproc/filter_colorproc.h | 8 +- .../filter_create/filter_create.cpp | 6 +- .../filter_create/filter_create.h | 8 +- .../filter_createiso/filter_createiso.cpp | 4 +- .../filter_createiso/filter_createiso.h | 8 +- src/meshlabplugins/filter_csg/filter_csg.h | 11 +- .../filter_dirt/filter_dirt.cpp | 8 +- src/meshlabplugins/filter_dirt/filter_dirt.h | 9 +- .../filter_fractal/filter_fractal.cpp | 20 +- .../filter_fractal/filter_fractal.h | 8 +- .../filter_func/filter_func.cpp | 36 +-- src/meshlabplugins/filter_func/filter_func.h | 8 +- .../filter_geodesic/filter_geodesic.cpp | 4 +- .../filter_geodesic/filter_geodesic.h | 8 +- .../globalregistration.cpp | 4 +- .../globalregistration.h | 8 +- .../filter_img_patch_param.cpp | 4 +- .../filter_img_patch_param.h | 8 +- .../filter_isoparametrization.cpp | 12 +- .../filter_isoparametrization.h | 8 +- .../filter_layer/filter_layer.cpp | 22 +- .../filter_layer/filter_layer.h | 8 +- .../filter_measure/filter_measure.cpp | 4 +- .../filter_measure/filter_measure.h | 8 +- .../filter_meshing/meshfilter.cpp | 10 +- .../filter_meshing/meshfilter.h | 8 +- src/meshlabplugins/filter_mls/mlsplugin.cpp | 14 +- src/meshlabplugins/filter_mls/mlsplugin.h | 8 +- .../filter_mutualglobal.cpp | 4 +- .../filter_mutualglobal/filter_mutualglobal.h | 8 +- .../filter_mutualinfo/filter_mutualinfo.cpp | 6 +- .../filter_mutualinfo/filter_mutualinfo.h | 8 +- .../filter_plymc/filter_plymc.cpp | 15 +- .../filter_plymc/filter_plymc.h | 10 +- .../filter_qhull/filter_qhull.cpp | 4 +- .../filter_qhull/filter_qhull.h | 8 +- .../filter_quality/filterqualitymapper.cpp | 6 +- .../filter_quality/filterqualitymapper.h | 8 +- .../filter_sample/filter_sample.cpp | 6 +- .../filter_sample/filter_sample.h | 8 +- .../filter_sample_dyn/filter_sample_dyn.cpp | 2 +- .../filter_sample_dyn/filter_sample_dyn.h | 8 +- .../filter_sample_gpu/filter_sample_gpu.cpp | 4 +- .../filter_sample_gpu/filter_sample_gpu.h | 8 +- .../filter_sampling/filter_sampling.cpp | 16 +- .../filter_sampling/filter_sampling.h | 8 +- .../filter_screened_poisson.cpp | 12 +- .../filter_screened_poisson.h | 8 +- .../filter_sdfgpu/filter_sdfgpu.cpp | 4 +- .../filter_sdfgpu/filter_sdfgpu.h | 10 +- .../filter_sdfgpu/filterinterface.h | 4 +- .../filter_select/meshselect.cpp | 16 +- src/meshlabplugins/filter_select/meshselect.h | 8 +- .../filter_sketchfab/filter_sketchfab.cpp | 9 +- .../filter_sketchfab/filter_sketchfab.h | 8 +- .../filter_ssynth/filter_ssynth.cpp | 4 +- .../filter_ssynth/filter_ssynth.h | 11 +- .../filter_texture/filter_texture.cpp | 14 +- .../filter_texture/filter_texture.h | 8 +- .../filter_trioptimize/filter_trioptimize.cpp | 8 +- .../filter_trioptimize/filter_trioptimize.h | 8 +- .../filter_unsharp/filter_unsharp.cpp | 20 +- .../filter_unsharp/filter_unsharp.h | 8 +- .../filter_voronoi/filter_voronoi.cpp | 10 +- .../filter_voronoi/filter_voronoi.h | 8 +- src/meshlabplugins/io_3ds/meshio.h | 2 +- src/meshlabplugins/io_base/baseio.h | 2 +- src/meshlabplugins/io_bre/io_bre.h | 2 +- src/meshlabplugins/io_collada/io_collada.h | 2 +- src/meshlabplugins/io_ctm/io_ctm.h | 2 +- src/meshlabplugins/io_expe/io_expe.h | 2 +- src/meshlabplugins/io_json/io_json.h | 2 +- src/meshlabplugins/io_pdb/io_pdb.h | 2 +- src/meshlabplugins/io_tri/io_tri.h | 2 +- src/meshlabplugins/io_txt/io_txt.h | 2 +- src/meshlabplugins/io_u3d/io_u3d.h | 2 +- src/meshlabplugins/io_x3d/io_x3d.h | 2 +- src/meshlabserver/mainserver.cpp | 8 +- 103 files changed, 735 insertions(+), 683 deletions(-) create mode 100644 src/common/interfaces/filter_plugin_interface.cpp create mode 100644 src/common/interfaces/filter_plugin_interface.h diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index b896aa6b5..a45dfd98f 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -15,6 +15,7 @@ set(SOURCES filter_parameter/rich_parameter_list.cpp filter_parameter/value.cpp interfaces/plugin_interface.cpp + interfaces/filter_plugin_interface.cpp GLExtensionsManager.cpp GLLogStream.cpp filterscript.cpp @@ -35,6 +36,7 @@ set(HEADERS filter_parameter/value.h interfaces/mainwindow_interface.h interfaces/plugin_interface.h + interfaces/filter_plugin_interface.h interfaces/io_plugin_interface.h GLExtensionsManager.h GLLogStream.h diff --git a/src/common/common.pro b/src/common/common.pro index 3e5ed260e..7835dddb2 100644 --- a/src/common/common.pro +++ b/src/common/common.pro @@ -48,6 +48,7 @@ HEADERS += \ filterscript.h \ GLLogStream.h \ interfaces.h \ + interfaces/filter_plugin_interface.h \ interfaces/io_plugin_interface.h \ interfaces/mainwindow_interface.h \ interfaces/plugin_interface.h \ @@ -69,6 +70,7 @@ SOURCES += \ interfaces.cpp \ filterscript.cpp \ GLLogStream.cpp \ + interfaces/filter_plugin_interface.cpp \ interfaces/plugin_interface.cpp \ meshmodel.cpp \ pluginmanager.cpp \ diff --git a/src/common/interfaces.cpp b/src/common/interfaces.cpp index c73952de5..faf9d662c 100644 --- a/src/common/interfaces.cpp +++ b/src/common/interfaces.cpp @@ -1,71 +1,3 @@ #include "interfaces.h" -bool MeshFilterInterface::isFilterApplicable(const QAction* act, const MeshModel& m, QStringList &MissingItems) const -{ - int preMask = getPreConditions(act); - MissingItems.clear(); - if (preMask == MeshModel::MM_NONE) // no precondition specified. - return true; - - if (preMask & MeshModel::MM_VERTCOLOR && !m.hasDataMask(MeshModel::MM_VERTCOLOR)) - MissingItems.push_back("Vertex Color"); - - if (preMask & MeshModel::MM_FACECOLOR && !m.hasDataMask(MeshModel::MM_FACECOLOR)) - MissingItems.push_back("Face Color"); - - if (preMask & MeshModel::MM_VERTQUALITY && !m.hasDataMask(MeshModel::MM_VERTQUALITY)) - MissingItems.push_back("Vertex Quality"); - - if (preMask & MeshModel::MM_FACEQUALITY && !m.hasDataMask(MeshModel::MM_FACEQUALITY)) - MissingItems.push_back("Face Quality"); - - if (preMask & MeshModel::MM_WEDGTEXCOORD && !m.hasDataMask(MeshModel::MM_WEDGTEXCOORD)) - MissingItems.push_back("Per Wedge Texture Coords"); - - if (preMask & MeshModel::MM_VERTTEXCOORD && !m.hasDataMask(MeshModel::MM_VERTTEXCOORD)) - MissingItems.push_back("Per Vertex Texture Coords"); - - if (preMask & MeshModel::MM_VERTRADIUS && !m.hasDataMask(MeshModel::MM_VERTRADIUS)) - MissingItems.push_back("Vertex Radius"); - - if (preMask & MeshModel::MM_CAMERA && !m.hasDataMask(MeshModel::MM_CAMERA)) - MissingItems.push_back("Camera"); - - if (preMask & MeshModel::MM_FACENUMBER && (m.cm.fn==0)) - MissingItems.push_back("Any Faces"); - - - return MissingItems.isEmpty(); -} - -int MeshFilterInterface::previewOnCreatedAttributes(const QAction* act, const MeshModel& mm ) const -{ - int changedIfCalled = postCondition(act); - int createdIfCalled = MeshModel::MM_NONE; - if ((changedIfCalled & MeshModel::MM_VERTCOLOR) && !mm.hasDataMask(MeshModel::MM_VERTCOLOR)) - createdIfCalled = createdIfCalled | MeshModel::MM_VERTCOLOR; - - if ((changedIfCalled & MeshModel::MM_FACECOLOR) && !mm.hasDataMask(MeshModel::MM_FACECOLOR)) - createdIfCalled = createdIfCalled | MeshModel::MM_FACECOLOR; - - if ((changedIfCalled & MeshModel::MM_VERTQUALITY) && !mm.hasDataMask(MeshModel::MM_VERTQUALITY)) - createdIfCalled = createdIfCalled | MeshModel::MM_VERTQUALITY; - - if ((changedIfCalled & MeshModel::MM_FACEQUALITY) && !mm.hasDataMask(MeshModel::MM_FACEQUALITY)) - createdIfCalled = createdIfCalled | MeshModel::MM_FACEQUALITY; - - if ((changedIfCalled & MeshModel::MM_WEDGTEXCOORD) && !mm.hasDataMask(MeshModel::MM_WEDGTEXCOORD)) - createdIfCalled = createdIfCalled | MeshModel::MM_WEDGTEXCOORD; - - if ((changedIfCalled & MeshModel::MM_VERTTEXCOORD) && !mm.hasDataMask(MeshModel::MM_VERTTEXCOORD)) - createdIfCalled = createdIfCalled | MeshModel::MM_VERTTEXCOORD; - - if ((changedIfCalled & MeshModel::MM_VERTRADIUS) && !mm.hasDataMask(MeshModel::MM_VERTRADIUS)) - createdIfCalled = createdIfCalled | MeshModel::MM_VERTRADIUS; - - if ((getClass(act) == MeshFilterInterface::MeshCreation) && (mm.cm.vn == 0)) - createdIfCalled = createdIfCalled | MeshModel::MM_VERTCOORD; - - return createdIfCalled; -} diff --git a/src/common/interfaces.h b/src/common/interfaces.h index 3ff978cca..be5251036 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -52,211 +52,6 @@ class GLAreaReg; class MeshModel; - -/** -\brief The MeshFilterInterface class provide the interface of the filter plugins. - -*/ -class MeshFilterInterface : public PluginInterface -{ -public: - /** The FilterClass enum represents the set of keywords that must be used to categorize a filter. - Each filter can belong to one or more filtering class, or-ed together. - */ - enum FilterClass - { - Generic = 0x00000, /*!< Should be avoided if possible. */ // - Selection = 0x00001, /*!< select or de-select something, basic operation on selections (like deleting)*/ - Cleaning = 0x00002, /*!< Filters that can be used to clean meshes (duplicated vertices etc)*/ - Remeshing = 0x00004, /*!< Simplification, Refinement, Reconstruction and mesh optimization*/ - FaceColoring = 0x00008, - VertexColoring = 0x00010, - MeshColoring = 0x00020, - MeshCreation = 0x00040, - Smoothing = 0x00080, /*!< Stuff that does not change the topology, but just the vertex positions*/ - Quality = 0x00100, - Layer = 0x00200, /*!< Layers, attributes */ - RasterLayer = 0x00400, /*!< Raster Layers, attributes */ - Normal = 0x00800, /*!< Normal, Curvature, orientation (rotations and transformations fall here)*/ - Sampling = 0x01000, - Texture = 0x02000, - RangeMap = 0x04000, /*!< filters specific for range map processing*/ - PointSet = 0x08000, - Measure = 0x10000, /*!< Filters that compute measures and information on meshes.*/ - Polygonal = 0x20000, /*!< Filters that works on polygonal and quad meshes.*/ - Camera = 0x40000 /*!< Filters that works on shot of mesh and raster.*/ - }; - - - - MeshFilterInterface() : PluginInterface(), glContext(NULL) - { - } - virtual ~MeshFilterInterface() {} - - - /** The very short string (a few words) describing each filtering action - // This string is used also to define the menu entry - */ - virtual QString filterName(FilterIDType) const = 0; - - /** The long, formatted string describing each filtering action. - // This string is printed in the top of the parameter window - // so it should be at least one or two paragraphs long. The more the better. - // you can use simple html formatting tags (like "
    " "" and "") to improve readability. - // This string is used in the 'About plugin' dialog and by meshlabserver to create the filter list wiki page and the doxygen documentation of the filters. - // Here is the place where you should put you bibliographic references in a form like this: -
    - See:
    - Luiz Velho, Denis Zorin
    - "4-8 Subdivision"
    - CAGD, volume 18, Issue 5, Pages 397-427.
    -
    - e.g. italic for authors, bold for title (quoted) and plain for bib ref. - */ - virtual QString filterInfo(FilterIDType filter) const = 0; - - /** The FilterClass describes in which generic class of filters it fits. - // This choice affect the submenu in which each filter will be placed - // For example filters that perform an action only on the selection will be placed in the Selection Class - */ - virtual FilterClass getClass(const QAction *) const { return MeshFilterInterface::Generic; } - - /** - The filters can have some additional requirements on the mesh capabiliteis. - // For example if a filters requires Face-Face Adjacency you should re-implement - // this function making it returns MeshModel::MM_FACEFACETOPO. - // The framework will ensure that the mesh has the requirements satisfied before invoking the applyFilter function - // - // Furthermore, requirements are checked just before the invocation of a filter. If your filter - // outputs a never used before mesh property (e.g. face colors), it will be allocated by a call - // to MeshModel::updateDataMask(...) - */ - virtual int getRequirements(const QAction *) { return MeshModel::MM_NONE; } - - /** The FilterPrecondition mask is used to explicitate what kind of data a filter really needs to be applied. - // For example algorithms that compute per face quality have as precondition the existence of faces - // (but quality per face is not a precondition, because quality per face is created by these algorithms) - // on the other hand an algorithm that deletes faces according to the stored quality has both FaceQuality - // and Face as precondition. - // These conditions do NOT include computed properties like borderFlags, manifoldness or watertightness. - // They are also used to grayout menus un-appliable entries. - */ - virtual int getPreConditions(const QAction *) const { return MeshModel::MM_NONE; } - - /** Function used by the framework to get info about the mesh properties changed by the filter. - // It is widely used by the meshlab's preview system. - //TO BE REPLACED WITH = 0 - */ - virtual int postCondition(const QAction*) const { return MeshModel::MM_ALL; } - - /** \brief applies the selected filter with the already stabilished parameters - * This function is called by the framework after getting values for the parameters specified in the \ref InitParameterSet - * NO GUI interaction should be done here. No dialog asking, no messagebox errors. - * Think that his function will also be called by the commandline framework. - * If you want report errors, use the \ref errorMsg() string. It will displayed in case of filters returning false. - * When implementing your applyFilter, you should use the cb function to report to the framework the current state of the processing. - * During your (long) processing you should call from time to time cb(perc,descriptiveString), where perc is an int (0..100) - * saying what you are doing and at what point of the computation you currently are. - * \sa errorMsg - * \sa initParameterSet - */ - virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) = 0; - - /** \brief tests if a filter is applicable to a mesh. - This function is a handy wrapper used by the framework for the \a getPreConditions callback; - For instance a colorize by quality filter cannot be applied to a mesh without per-vertex-quality. - On failure (returning false) the function fills the MissingItems list with strings describing the missing items. - */ - bool isFilterApplicable(const QAction *act, const MeshModel& m, QStringList &MissingItems) const; - - - enum FILTER_ARITY { NONE = 0, SINGLE_MESH = 1, FIXED = 2, VARIABLE = 3, UNKNOWN_ARITY = 4 }; - - /** \brief this function informs the MeshLab core on how many meshes the filter will work on. - Valid value: - - SINGLE_MESH: the filter works just on the current mesh - - FIXED: the number (and the names) of the meshes involved in the filter computation is determined by the parameters selected in the filter's parameters form - - VARIABLE: the filter works on a not predetermined number of meshes. The meshes involved are typically selected by the user checking on the correspondent layer on the layer dialog - */ - virtual FILTER_ARITY filterArity(const QAction *act) const = 0; - - // This function is called to initialized the list of parameters. - // it is always called. If a filter does not need parameter it leave it empty and the framework - // will not create a dialog (unless for previewing) - virtual void initParameterList(const QAction *, MeshModel &/*m*/, RichParameterList & /*par*/) {} - virtual void initParameterList(const QAction *filter, MeshDocument &md, RichParameterList &par) - { - initParameterList(filter, *(md.mm()), par); - } - - /** \brief is invoked by the framework when the applyFilter fails to give some info to the user about the filter failure - * Filters \b must never use QMessageBox for reporting errors. - * Failing filters should put some meaningful information inside the errorMessage string and return false with the \ref applyFilter - */ - const QString &errorMsg() const { return this->errorMessage; } - virtual QString filterInfo(const QAction *a) const { return this->filterInfo(ID(a)); } - virtual QString filterName(const QAction *a) const { return this->filterName(ID(a)); } - virtual QString filterScriptFunctionName(FilterIDType /*filterID*/) { return ""; } - - virtual FilterIDType ID(const QAction *a) const - { - QString aa=a->text(); - foreach(FilterIDType tt, types()) - if (a->text() == this->filterName(tt)) return tt; - aa.replace("&",""); - foreach(FilterIDType tt, types()) - if (aa == this->filterName(tt)) return tt; - - qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(a->text())); - assert(0); - return -1; - } - - virtual QAction *AC(FilterIDType filterID) - { - QString idName = this->filterName(filterID); - return AC(idName); - } - - virtual QAction *AC(const QString& idName) - { - QString i=idName; - for(QAction *tt : actionList) - if (idName == tt->text()) return tt; - i.replace("&",""); - for(QAction *tt : actionList) - if (i == tt->text()) return tt; - - qDebug("unable to find the action corresponding to action '%s'", qUtf8Printable(idName)); - assert(0); - return 0; - } - - virtual QList actions() const { return actionList; } - virtual QList types() const { return typeList; } - - /** Generate the mask of attributes would be created IF the MeshFilterInterface filt would has been called on MeshModel mm - BE CAREFUL! this function does NOT change in anyway the state of the MeshModel!!!! **/ - int previewOnCreatedAttributes(const QAction* act, const MeshModel& mm) const; - QString generatedScriptCode; - - MLPluginGLContext* glContext; -protected: - // Each plugins exposes a set of filtering possibilities. - // Each filtering procedure corresponds to a single QAction with a corresponding FilterIDType id. - // - - // The list of actions exported by the plugin. Each actions strictly corresponds to - QList actionList; - - QList typeList; - - // this string is used to pass back to the framework error messages in case of failure of a filter apply. - QString errorMessage; -}; - - /** Used to customized the rendering process. Rendering plugins are now responsible of the rendering of the whole MeshDocument and not only of a single MeshModel. @@ -490,14 +285,11 @@ public: #define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x) #define MESHLAB_PLUGIN_NAME_EXPORTER(x) -#define MESH_FILTER_INTERFACE_IID "vcg.meshlab.MeshFilterInterface/1.0" -#define MESHLAB_FILTER_INTERFACE_IID "vcg.meshlab.MeshLabFilterInterface/1.0" #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_EDIT_INTERFACE_FACTORY_IID "vcg.meshlab.MeshEditInterfaceFactory/1.0" -Q_DECLARE_INTERFACE(MeshFilterInterface, MESH_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) diff --git a/src/common/interfaces/filter_plugin_interface.cpp b/src/common/interfaces/filter_plugin_interface.cpp new file mode 100644 index 000000000..581dcdf18 --- /dev/null +++ b/src/common/interfaces/filter_plugin_interface.cpp @@ -0,0 +1,71 @@ +#include "filter_plugin_interface.h" + +bool FilterPluginInterface::isFilterApplicable(const QAction* act, const MeshModel& m, QStringList &MissingItems) const +{ + int preMask = getPreConditions(act); + MissingItems.clear(); + + if (preMask == MeshModel::MM_NONE) // no precondition specified. + return true; + + if (preMask & MeshModel::MM_VERTCOLOR && !m.hasDataMask(MeshModel::MM_VERTCOLOR)) + MissingItems.push_back("Vertex Color"); + + if (preMask & MeshModel::MM_FACECOLOR && !m.hasDataMask(MeshModel::MM_FACECOLOR)) + MissingItems.push_back("Face Color"); + + if (preMask & MeshModel::MM_VERTQUALITY && !m.hasDataMask(MeshModel::MM_VERTQUALITY)) + MissingItems.push_back("Vertex Quality"); + + if (preMask & MeshModel::MM_FACEQUALITY && !m.hasDataMask(MeshModel::MM_FACEQUALITY)) + MissingItems.push_back("Face Quality"); + + if (preMask & MeshModel::MM_WEDGTEXCOORD && !m.hasDataMask(MeshModel::MM_WEDGTEXCOORD)) + MissingItems.push_back("Per Wedge Texture Coords"); + + if (preMask & MeshModel::MM_VERTTEXCOORD && !m.hasDataMask(MeshModel::MM_VERTTEXCOORD)) + MissingItems.push_back("Per Vertex Texture Coords"); + + if (preMask & MeshModel::MM_VERTRADIUS && !m.hasDataMask(MeshModel::MM_VERTRADIUS)) + MissingItems.push_back("Vertex Radius"); + + if (preMask & MeshModel::MM_CAMERA && !m.hasDataMask(MeshModel::MM_CAMERA)) + MissingItems.push_back("Camera"); + + if (preMask & MeshModel::MM_FACENUMBER && (m.cm.fn==0)) + MissingItems.push_back("Any Faces"); + + + return MissingItems.isEmpty(); +} + +int FilterPluginInterface::previewOnCreatedAttributes(const QAction* act, const MeshModel& mm ) const +{ + int changedIfCalled = postCondition(act); + int createdIfCalled = MeshModel::MM_NONE; + if ((changedIfCalled & MeshModel::MM_VERTCOLOR) && !mm.hasDataMask(MeshModel::MM_VERTCOLOR)) + createdIfCalled = createdIfCalled | MeshModel::MM_VERTCOLOR; + + if ((changedIfCalled & MeshModel::MM_FACECOLOR) && !mm.hasDataMask(MeshModel::MM_FACECOLOR)) + createdIfCalled = createdIfCalled | MeshModel::MM_FACECOLOR; + + if ((changedIfCalled & MeshModel::MM_VERTQUALITY) && !mm.hasDataMask(MeshModel::MM_VERTQUALITY)) + createdIfCalled = createdIfCalled | MeshModel::MM_VERTQUALITY; + + if ((changedIfCalled & MeshModel::MM_FACEQUALITY) && !mm.hasDataMask(MeshModel::MM_FACEQUALITY)) + createdIfCalled = createdIfCalled | MeshModel::MM_FACEQUALITY; + + if ((changedIfCalled & MeshModel::MM_WEDGTEXCOORD) && !mm.hasDataMask(MeshModel::MM_WEDGTEXCOORD)) + createdIfCalled = createdIfCalled | MeshModel::MM_WEDGTEXCOORD; + + if ((changedIfCalled & MeshModel::MM_VERTTEXCOORD) && !mm.hasDataMask(MeshModel::MM_VERTTEXCOORD)) + createdIfCalled = createdIfCalled | MeshModel::MM_VERTTEXCOORD; + + if ((changedIfCalled & MeshModel::MM_VERTRADIUS) && !mm.hasDataMask(MeshModel::MM_VERTRADIUS)) + createdIfCalled = createdIfCalled | MeshModel::MM_VERTRADIUS; + + if ((getClass(act) == FilterPluginInterface::MeshCreation) && (mm.cm.vn == 0)) + createdIfCalled = createdIfCalled | MeshModel::MM_VERTCOORD; + + return createdIfCalled; +} diff --git a/src/common/interfaces/filter_plugin_interface.h b/src/common/interfaces/filter_plugin_interface.h new file mode 100644 index 000000000..d022bb78a --- /dev/null +++ b/src/common/interfaces/filter_plugin_interface.h @@ -0,0 +1,239 @@ +/**************************************************************************** +* MeshLab o o * +* A versatile mesh processing toolbox o o * +* _ O _ * +* Copyright(C) 2005-2020 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ + +#ifndef MESHLAB_FILTER_PLUGIN_INTERFACE_H +#define MESHLAB_FILTER_PLUGIN_INTERFACE_H + +#include "plugin_interface.h" +#include "../meshmodel.h" + +/** +\brief The MeshFilterInterface class provide the interface of the filter plugins. + +*/ +class FilterPluginInterface : public PluginInterface +{ +public: + /** The FilterClass enum represents the set of keywords that must be used to categorize a filter. + Each filter can belong to one or more filtering class, or-ed together. + */ + enum FilterClass + { + Generic = 0x00000, /*!< Should be avoided if possible. */ // + Selection = 0x00001, /*!< select or de-select something, basic operation on selections (like deleting)*/ + Cleaning = 0x00002, /*!< Filters that can be used to clean meshes (duplicated vertices etc)*/ + Remeshing = 0x00004, /*!< Simplification, Refinement, Reconstruction and mesh optimization*/ + FaceColoring = 0x00008, + VertexColoring = 0x00010, + MeshColoring = 0x00020, + MeshCreation = 0x00040, + Smoothing = 0x00080, /*!< Stuff that does not change the topology, but just the vertex positions*/ + Quality = 0x00100, + Layer = 0x00200, /*!< Layers, attributes */ + RasterLayer = 0x00400, /*!< Raster Layers, attributes */ + Normal = 0x00800, /*!< Normal, Curvature, orientation (rotations and transformations fall here)*/ + Sampling = 0x01000, + Texture = 0x02000, + RangeMap = 0x04000, /*!< filters specific for range map processing*/ + PointSet = 0x08000, + Measure = 0x10000, /*!< Filters that compute measures and information on meshes.*/ + Polygonal = 0x20000, /*!< Filters that works on polygonal and quad meshes.*/ + Camera = 0x40000 /*!< Filters that works on shot of mesh and raster.*/ + }; + + + + FilterPluginInterface() : PluginInterface(), glContext(NULL) + { + } + virtual ~FilterPluginInterface() {} + + + /** The very short string (a few words) describing each filtering action + // This string is used also to define the menu entry + */ + virtual QString filterName(FilterIDType) const = 0; + + /** The long, formatted string describing each filtering action. + // This string is printed in the top of the parameter window + // so it should be at least one or two paragraphs long. The more the better. + // you can use simple html formatting tags (like "
    " "" and "") to improve readability. + // This string is used in the 'About plugin' dialog and by meshlabserver to create the filter list wiki page and the doxygen documentation of the filters. + // Here is the place where you should put you bibliographic references in a form like this: +
    + See:
    + Luiz Velho, Denis Zorin
    + "4-8 Subdivision"
    + CAGD, volume 18, Issue 5, Pages 397-427.
    +
    + e.g. italic for authors, bold for title (quoted) and plain for bib ref. + */ + virtual QString filterInfo(FilterIDType filter) const = 0; + + /** The FilterClass describes in which generic class of filters it fits. + // This choice affect the submenu in which each filter will be placed + // For example filters that perform an action only on the selection will be placed in the Selection Class + */ + virtual FilterClass getClass(const QAction *) const { return FilterPluginInterface::Generic; } + + /** + The filters can have some additional requirements on the mesh capabiliteis. + // For example if a filters requires Face-Face Adjacency you should re-implement + // this function making it returns MeshModel::MM_FACEFACETOPO. + // The framework will ensure that the mesh has the requirements satisfied before invoking the applyFilter function + // + // Furthermore, requirements are checked just before the invocation of a filter. If your filter + // outputs a never used before mesh property (e.g. face colors), it will be allocated by a call + // to MeshModel::updateDataMask(...) + */ + virtual int getRequirements(const QAction *) { return MeshModel::MM_NONE; } + + /** The FilterPrecondition mask is used to explicitate what kind of data a filter really needs to be applied. + // For example algorithms that compute per face quality have as precondition the existence of faces + // (but quality per face is not a precondition, because quality per face is created by these algorithms) + // on the other hand an algorithm that deletes faces according to the stored quality has both FaceQuality + // and Face as precondition. + // These conditions do NOT include computed properties like borderFlags, manifoldness or watertightness. + // They are also used to grayout menus un-appliable entries. + */ + virtual int getPreConditions(const QAction *) const { return MeshModel::MM_NONE; } + + /** Function used by the framework to get info about the mesh properties changed by the filter. + // It is widely used by the meshlab's preview system. + //TO BE REPLACED WITH = 0 + */ + virtual int postCondition(const QAction*) const { return MeshModel::MM_ALL; } + + /** \brief applies the selected filter with the already stabilished parameters + * This function is called by the framework after getting values for the parameters specified in the \ref InitParameterSet + * NO GUI interaction should be done here. No dialog asking, no messagebox errors. + * Think that his function will also be called by the commandline framework. + * If you want report errors, use the \ref errorMsg() string. It will displayed in case of filters returning false. + * When implementing your applyFilter, you should use the cb function to report to the framework the current state of the processing. + * During your (long) processing you should call from time to time cb(perc,descriptiveString), where perc is an int (0..100) + * saying what you are doing and at what point of the computation you currently are. + * \sa errorMsg + * \sa initParameterSet + */ + virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) = 0; + + /** \brief tests if a filter is applicable to a mesh. + This function is a handy wrapper used by the framework for the \a getPreConditions callback; + For instance a colorize by quality filter cannot be applied to a mesh without per-vertex-quality. + On failure (returning false) the function fills the MissingItems list with strings describing the missing items. + */ + bool isFilterApplicable(const QAction *act, const MeshModel& m, QStringList &MissingItems) const; + + + enum FILTER_ARITY { NONE = 0, SINGLE_MESH = 1, FIXED = 2, VARIABLE = 3, UNKNOWN_ARITY = 4 }; + + /** \brief this function informs the MeshLab core on how many meshes the filter will work on. + Valid value: + - SINGLE_MESH: the filter works just on the current mesh + - FIXED: the number (and the names) of the meshes involved in the filter computation is determined by the parameters selected in the filter's parameters form + - VARIABLE: the filter works on a not predetermined number of meshes. The meshes involved are typically selected by the user checking on the correspondent layer on the layer dialog + */ + virtual FILTER_ARITY filterArity(const QAction *act) const = 0; + + // This function is called to initialized the list of parameters. + // it is always called. If a filter does not need parameter it leave it empty and the framework + // will not create a dialog (unless for previewing) + virtual void initParameterList(const QAction *, MeshModel &/*m*/, RichParameterList & /*par*/) {} + virtual void initParameterList(const QAction *filter, MeshDocument &md, RichParameterList &par) + { + initParameterList(filter, *(md.mm()), par); + } + + /** \brief is invoked by the framework when the applyFilter fails to give some info to the user about the filter failure + * Filters \b must never use QMessageBox for reporting errors. + * Failing filters should put some meaningful information inside the errorMessage string and return false with the \ref applyFilter + */ + const QString &errorMsg() const { return this->errorMessage; } + virtual QString filterInfo(const QAction *a) const { return this->filterInfo(ID(a)); } + virtual QString filterName(const QAction *a) const { return this->filterName(ID(a)); } + virtual QString filterScriptFunctionName(FilterIDType /*filterID*/) { return ""; } + + virtual FilterIDType ID(const QAction *a) const + { + QString aa=a->text(); + foreach(FilterIDType tt, types()) + if (a->text() == this->filterName(tt)) return tt; + aa.replace("&",""); + foreach(FilterIDType tt, types()) + if (aa == this->filterName(tt)) return tt; + + qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(a->text())); + assert(0); + return -1; + } + + virtual QAction *AC(FilterIDType filterID) + { + QString idName = this->filterName(filterID); + return AC(idName); + } + + virtual QAction *AC(const QString& idName) + { + QString i=idName; + for(QAction *tt : actionList) + if (idName == tt->text()) return tt; + i.replace("&",""); + for(QAction *tt : actionList) + if (i == tt->text()) return tt; + + qDebug("unable to find the action corresponding to action '%s'", qUtf8Printable(idName)); + assert(0); + return 0; + } + + virtual QList actions() const { return actionList; } + virtual QList types() const { return typeList; } + + /** Generate the mask of attributes would be created IF the MeshFilterInterface filt would has been called on MeshModel mm + BE CAREFUL! this function does NOT change in anyway the state of the MeshModel!!!! **/ + int previewOnCreatedAttributes(const QAction* act, const MeshModel& mm) const; + QString generatedScriptCode; + + MLPluginGLContext* glContext; +protected: + // Each plugins exposes a set of filtering possibilities. + // Each filtering procedure corresponds to a single QAction with a corresponding FilterIDType id. + // + + // The list of actions exported by the plugin. Each actions strictly corresponds to + QList actionList; + + QList typeList; + + // this string is used to pass back to the framework error messages in case of failure of a filter apply. + QString errorMessage; +}; + +#define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x) +#define MESHLAB_PLUGIN_NAME_EXPORTER(x) + +#define FILTER_PLUGIN_INTERFACE_IID "vcg.meshlab.FilterPluginInterface/1.0" +Q_DECLARE_INTERFACE(FilterPluginInterface, FILTER_PLUGIN_INTERFACE_IID) + +#endif // MESHLAB_FILTER_PLUGIN_INTERFACE_H diff --git a/src/common/interfaces/io_plugin_interface.h b/src/common/interfaces/io_plugin_interface.h index 770415f6a..c64fb966b 100644 --- a/src/common/interfaces/io_plugin_interface.h +++ b/src/common/interfaces/io_plugin_interface.h @@ -106,7 +106,7 @@ public: #define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x) #define MESHLAB_PLUGIN_NAME_EXPORTER(x) -#define MESH_IO_INTERFACE_IID "vcg.meshlab.IOPluginInterface/1.0" -Q_DECLARE_INTERFACE(IOPluginInterface, MESH_IO_INTERFACE_IID) +#define IO_PLUGIN_INTERFACE_IID "vcg.meshlab.IOPluginInterface/1.0" +Q_DECLARE_INTERFACE(IOPluginInterface, IO_PLUGIN_INTERFACE_IID) #endif // MESHLAB_IO_PLUGIN_INTERFACE_H diff --git a/src/common/pluginmanager.cpp b/src/common/pluginmanager.cpp index 441f71d83..1384a5d38 100644 --- a/src/common/pluginmanager.cpp +++ b/src/common/pluginmanager.cpp @@ -84,7 +84,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl { pluginsLoaded.push_back(fileName); PluginInterface *iCommon = nullptr; - MeshFilterInterface *iFilter = qobject_cast(plugin); + FilterPluginInterface *iFilter = qobject_cast(plugin); if (iFilter) { iCommon = iFilter; @@ -95,7 +95,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl actionFilterMap.insert(filterAction->text(), filterAction); stringFilterMap.insert(filterAction->text(), iFilter); iFilter->initGlobalParameterSet(filterAction, defaultGlobal); - if(iFilter->getClass(filterAction)==MeshFilterInterface::Generic) + if(iFilter->getClass(filterAction)==FilterPluginInterface::Generic) throw MLException("Missing class for " +fileName+filterAction->text()); if(iFilter->getRequirements(filterAction) == int(MeshModel::MM_UNKNOWN)) throw MLException("Missing requirements for " +fileName+filterAction->text()); @@ -103,7 +103,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl throw MLException("Missing preconditions for "+fileName+filterAction->text()); if(iFilter->postCondition(filterAction) == int(MeshModel::MM_UNKNOWN )) throw MLException("Missing postcondition for "+fileName+filterAction->text()); - if(iFilter->filterArity(filterAction) == MeshFilterInterface::UNKNOWN_ARITY ) + if(iFilter->filterArity(filterAction) == FilterPluginInterface::UNKNOWN_ARITY ) throw MLException("Missing Arity for " +fileName+filterAction->text()); } } diff --git a/src/common/pluginmanager.h b/src/common/pluginmanager.h index 6f54774c9..ae70da109 100644 --- a/src/common/pluginmanager.h +++ b/src/common/pluginmanager.h @@ -25,6 +25,7 @@ #define PLUGINMANAGER_H #include "interfaces.h" +#include "interfaces/filter_plugin_interface.h" #include "interfaces/io_plugin_interface.h" //#include "scriptsyntax.h" @@ -45,7 +46,7 @@ public: QString pluginsCode() const; int numberIOPlugins() const; - inline QVector& meshFilterPlugins() {return meshFilterPlug;} + inline QVector& meshFilterPlugins() {return meshFilterPlug;} inline QVector& meshRenderPlugins() {return meshRenderPlug;} inline QVector& meshDecoratePlugins() {return meshDecoratePlug;} inline QVector& meshEditFactoryPlugins() {return meshEditInterfacePlug;} @@ -59,14 +60,14 @@ public: QMap actionFilterMap; - QMap stringFilterMap; + QMap stringFilterMap; QMap allKnowInputFormats; QMap allKnowOutputFormats; QStringList inpFilters; QStringList outFilters; QVector meshIOPlug; - QVector meshFilterPlug; + QVector meshFilterPlug; QVector meshRenderPlug; QVector meshDecoratePlug; QVector meshEditInterfacePlug; diff --git a/src/meshlab/filterScriptDialog.cpp b/src/meshlab/filterScriptDialog.cpp index 0bf4fc5c9..5c177692f 100644 --- a/src/meshlab/filterScriptDialog.cpp +++ b/src/meshlab/filterScriptDialog.cpp @@ -210,7 +210,7 @@ void FilterScriptDialog::editOldParameters( const int row ) //get a pointer to this action and filter from the main window so we can get the //description of the parameters from the filter QAction *action = mainWindow->pluginManager().actionFilterMap[actionName]; - MeshFilterInterface *iFilter = qobject_cast(action->parent()); + FilterPluginInterface *iFilter = qobject_cast(action->parent()); if(NULL == iFilter){ qDebug() << "null filter"; diff --git a/src/meshlab/mainwindow_Init.cpp b/src/meshlab/mainwindow_Init.cpp index 3e6063c3c..27b323686 100644 --- a/src/meshlab/mainwindow_Init.cpp +++ b/src/meshlab/mainwindow_Init.cpp @@ -500,7 +500,7 @@ void MainWindow::createToolBars() filterToolBar = addToolBar(tr("Filter")); filterToolBar->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); - foreach(MeshFilterInterface *iFilter, PM.meshFilterPlugins()) + foreach(FilterPluginInterface *iFilter, PM.meshFilterPlugins()) { foreach(QAction* filterAction, iFilter->actions()) { @@ -717,10 +717,10 @@ void MainWindow::fillFilterMenu() filterMenu->addMenu(filterMenuCamera); - QMap::iterator msi; + QMap::iterator msi; for (msi = PM.stringFilterMap.begin(); msi != PM.stringFilterMap.end(); ++msi) { - MeshFilterInterface * iFilter = msi.value(); + FilterPluginInterface * iFilter = msi.value(); QAction *filterAction = iFilter->AC((msi.key())); QString tooltip = iFilter->filterInfo(filterAction) + "
    " + getDecoratedFileName(filterAction->data().toString()); filterAction->setToolTip(tooltip); @@ -728,79 +728,79 @@ void MainWindow::fillFilterMenu() connect(filterAction, SIGNAL(triggered()), this, SLOT(startFilter())); int filterClass = iFilter->getClass(filterAction); - if (filterClass & MeshFilterInterface::FaceColoring) + if (filterClass & FilterPluginInterface::FaceColoring) { filterMenuColorize->addAction(filterAction); } - if (filterClass & MeshFilterInterface::VertexColoring) + if (filterClass & FilterPluginInterface::VertexColoring) { filterMenuColorize->addAction(filterAction); } - if (filterClass & MeshFilterInterface::MeshColoring) + if (filterClass & FilterPluginInterface::MeshColoring) { filterMenuColorize->addAction(filterAction); } - if (filterClass & MeshFilterInterface::Selection) + if (filterClass & FilterPluginInterface::Selection) { filterMenuSelect->addAction(filterAction); } - if (filterClass & MeshFilterInterface::Cleaning) + if (filterClass & FilterPluginInterface::Cleaning) { filterMenuClean->addAction(filterAction); } - if (filterClass & MeshFilterInterface::Remeshing) + if (filterClass & FilterPluginInterface::Remeshing) { filterMenuRemeshing->addAction(filterAction); } - if (filterClass & MeshFilterInterface::Smoothing) + if (filterClass & FilterPluginInterface::Smoothing) { filterMenuSmoothing->addAction(filterAction); } - if (filterClass & MeshFilterInterface::Normal) + if (filterClass & FilterPluginInterface::Normal) { filterMenuNormal->addAction(filterAction); } - if (filterClass & MeshFilterInterface::Quality) + if (filterClass & FilterPluginInterface::Quality) { filterMenuQuality->addAction(filterAction); } - if (filterClass & MeshFilterInterface::Measure) + if (filterClass & FilterPluginInterface::Measure) { filterMenuQuality->addAction(filterAction); } - if (filterClass & MeshFilterInterface::Layer) + if (filterClass & FilterPluginInterface::Layer) { filterMenuMeshLayer->addAction(filterAction); } - if (filterClass & MeshFilterInterface::RasterLayer) + if (filterClass & FilterPluginInterface::RasterLayer) { filterMenuRasterLayer->addAction(filterAction); } - if (filterClass & MeshFilterInterface::MeshCreation) + if (filterClass & FilterPluginInterface::MeshCreation) { filterMenuCreate->addAction(filterAction); } - if (filterClass & MeshFilterInterface::RangeMap) + if (filterClass & FilterPluginInterface::RangeMap) { filterMenuRangeMap->addAction(filterAction); } - if (filterClass & MeshFilterInterface::PointSet) + if (filterClass & FilterPluginInterface::PointSet) { filterMenuPointSet->addAction(filterAction); } - if (filterClass & MeshFilterInterface::Sampling) + if (filterClass & FilterPluginInterface::Sampling) { filterMenuSampling->addAction(filterAction); } - if (filterClass & MeshFilterInterface::Texture) + if (filterClass & FilterPluginInterface::Texture) { filterMenuTexture->addAction(filterAction); } - if (filterClass & MeshFilterInterface::Polygonal) + if (filterClass & FilterPluginInterface::Polygonal) { filterMenuPolygonal->addAction(filterAction); } - if (filterClass & MeshFilterInterface::Camera) + if (filterClass & FilterPluginInterface::Camera) { filterMenuCamera->addAction(filterAction); } diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index 33a8bc3ba..78e018030 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -783,7 +783,7 @@ void MainWindow::runFilterScript() int classes = 0; int postCondMask = 0; QAction *action = PM.actionFilterMap[ filtnm]; - MeshFilterInterface *iFilter = qobject_cast(action->parent()); + FilterPluginInterface *iFilter = qobject_cast(action->parent()); int req=iFilter->getRequirements(action); if (meshDoc()->mm() != NULL) @@ -824,7 +824,7 @@ void MainWindow::runFilterScript() atts[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL] = true; - if (iFilter->filterArity(action) == MeshFilterInterface::SINGLE_MESH) + if (iFilter->filterArity(action) == FilterPluginInterface::SINGLE_MESH) { MLRenderingData::PRIMITIVE_MODALITY pm = MLPoliciesStandAloneFunctions::bestPrimitiveModalityAccordingToMesh(meshDoc()->mm()); if ((pm != MLRenderingData::PR_ARITY) && (meshDoc()->mm() != NULL)) @@ -864,11 +864,11 @@ void MainWindow::runFilterScript() postCondMask = iFilter->postCondition(action); if (meshDoc()->mm() != NULL) { - if(classes & MeshFilterInterface::FaceColoring ) + if(classes & FilterPluginInterface::FaceColoring ) { meshDoc()->mm()->updateDataMask(MeshModel::MM_FACECOLOR); } - if(classes & MeshFilterInterface::VertexColoring ) + if(classes & FilterPluginInterface::VertexColoring ) { meshDoc()->mm()->updateDataMask(MeshModel::MM_VERTCOLOR); } @@ -881,12 +881,12 @@ void MainWindow::runFilterScript() } bool newmeshcreated = false; - if (classes & MeshFilterInterface::MeshCreation) + if (classes & FilterPluginInterface::MeshCreation) newmeshcreated = true; updateSharedContextDataAfterFilterExecution(postCondMask, classes, newmeshcreated); meshDoc()->meshDocStateData().clear(); - if(classes & MeshFilterInterface::MeshCreation) + if(classes & FilterPluginInterface::MeshCreation) GLA()->resetTrackBall(); /* to be changed */ @@ -931,7 +931,7 @@ void MainWindow::startFilter() QAction *action = qobject_cast(sender()); if (action == NULL) throw MLException("Invalid filter action value."); - MeshFilterInterface *iFilter = qobject_cast(action->parent()); + FilterPluginInterface *iFilter = qobject_cast(action->parent()); if (meshDoc() == NULL) return; //OLD FILTER PHILOSOPHY @@ -992,19 +992,19 @@ void MainWindow::updateSharedContextDataAfterFilterExecution(int postcondmask,in if (mm == NULL) continue; //Just to be sure that the filter author didn't forget to add changing tags to the postCondition field - if ((mm->hasDataMask(MeshModel::MM_FACECOLOR)) && (fclasses & MeshFilterInterface::FaceColoring )) + if ((mm->hasDataMask(MeshModel::MM_FACECOLOR)) && (fclasses & FilterPluginInterface::FaceColoring )) postcondmask = postcondmask | MeshModel::MM_FACECOLOR; - if ((mm->hasDataMask(MeshModel::MM_VERTCOLOR)) && (fclasses & MeshFilterInterface::VertexColoring )) + if ((mm->hasDataMask(MeshModel::MM_VERTCOLOR)) && (fclasses & FilterPluginInterface::VertexColoring )) postcondmask = postcondmask | MeshModel::MM_VERTCOLOR; - if ((mm->hasDataMask(MeshModel::MM_COLOR)) && (fclasses & MeshFilterInterface::MeshColoring )) + if ((mm->hasDataMask(MeshModel::MM_COLOR)) && (fclasses & FilterPluginInterface::MeshColoring )) postcondmask = postcondmask | MeshModel::MM_COLOR; - if ((mm->hasDataMask(MeshModel::MM_FACEQUALITY)) && (fclasses & MeshFilterInterface::Quality )) + if ((mm->hasDataMask(MeshModel::MM_FACEQUALITY)) && (fclasses & FilterPluginInterface::Quality )) postcondmask = postcondmask | MeshModel::MM_FACEQUALITY; - if ((mm->hasDataMask(MeshModel::MM_VERTQUALITY)) && (fclasses & MeshFilterInterface::Quality )) + if ((mm->hasDataMask(MeshModel::MM_VERTQUALITY)) && (fclasses & FilterPluginInterface::Quality )) postcondmask = postcondmask | MeshModel::MM_VERTQUALITY; MLRenderingData dttoberendered; @@ -1066,7 +1066,7 @@ void MainWindow::updateSharedContextDataAfterFilterExecution(int postcondmask,in } MLPerViewGLOptions opts; curr.get(opts); - if (fclasses & MeshFilterInterface::MeshColoring) + if (fclasses & FilterPluginInterface::MeshColoring) { bool hasmeshcolor = mm->hasDataMask(MeshModel::MM_COLOR); opts._perpoint_mesh_color_enabled = hasmeshcolor; @@ -1137,7 +1137,7 @@ from the user defined dialog void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool isPreview) { - MeshFilterInterface *iFilter = qobject_cast(action->parent()); + FilterPluginInterface *iFilter = qobject_cast(action->parent()); qb->show(); iFilter->setLog(&meshDoc()->Log); @@ -1179,7 +1179,7 @@ void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool atts[MLRenderingData::ATT_NAMES::ATT_VERTPOSITION] = true; atts[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL] = true; - if (iFilter->filterArity(action) == MeshFilterInterface::SINGLE_MESH) + if (iFilter->filterArity(action) == FilterPluginInterface::SINGLE_MESH) { MLRenderingData::PRIMITIVE_MODALITY pm = MLPoliciesStandAloneFunctions::bestPrimitiveModalityAccordingToMesh(meshDoc()->mm()); if ((pm != MLRenderingData::PR_ARITY) && (meshDoc()->mm() != NULL)) @@ -1244,16 +1244,16 @@ void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool } - MeshFilterInterface::FILTER_ARITY arity = iFilter->filterArity(action); + FilterPluginInterface::FILTER_ARITY arity = iFilter->filterArity(action); QList tmp; switch(arity) { - case (MeshFilterInterface::SINGLE_MESH): + case (FilterPluginInterface::SINGLE_MESH): { tmp.push_back(meshDoc()->mm()); break; } - case (MeshFilterInterface::FIXED): + case (FilterPluginInterface::FIXED): { for(const RichParameter& p : mergedenvironment) { @@ -1266,7 +1266,7 @@ void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool } break; } - case (MeshFilterInterface::VARIABLE): + case (FilterPluginInterface::VARIABLE): { for(MeshModel* mm = meshDoc()->nextMesh();mm != NULL;mm=meshDoc()->nextMesh(mm)) { @@ -1279,7 +1279,7 @@ void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool break; } - if(iFilter->getClass(action) & MeshFilterInterface::MeshCreation ) + if(iFilter->getClass(action) & FilterPluginInterface::MeshCreation ) GLA()->resetTrackBall(); for(int jj = 0;jj < tmp.size();++jj) @@ -1288,19 +1288,19 @@ void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool if (mm != NULL) { // at the end for filters that change the color, or selection set the appropriate rendering mode - if(iFilter->getClass(action) & MeshFilterInterface::FaceColoring ) + if(iFilter->getClass(action) & FilterPluginInterface::FaceColoring ) mm->updateDataMask(MeshModel::MM_FACECOLOR); - if(iFilter->getClass(action) & MeshFilterInterface::VertexColoring ) + if(iFilter->getClass(action) & FilterPluginInterface::VertexColoring ) mm->updateDataMask(MeshModel::MM_VERTCOLOR); - if(iFilter->getClass(action) & MeshFilterInterface::MeshColoring ) + if(iFilter->getClass(action) & FilterPluginInterface::MeshColoring ) mm->updateDataMask(MeshModel::MM_COLOR); if(iFilter->postCondition(action) & MeshModel::MM_CAMERA) mm->updateDataMask(MeshModel::MM_CAMERA); - if(iFilter->getClass(action) & MeshFilterInterface::Texture ) + if(iFilter->getClass(action) & FilterPluginInterface::Texture ) updateTexture(mm->id()); } } diff --git a/src/meshlab/ml_std_par_dialog.cpp b/src/meshlab/ml_std_par_dialog.cpp index 1a9d452e0..710829cea 100644 --- a/src/meshlab/ml_std_par_dialog.cpp +++ b/src/meshlab/ml_std_par_dialog.cpp @@ -27,7 +27,7 @@ MeshlabStdDialog::MeshlabStdDialog(QWidget *p) } /* manages the setup of the standard parameter window, when the execution of a plugin filter is requested */ -bool MeshlabStdDialog::showAutoDialog(MeshFilterInterface *mfi, MeshModel *mm, MeshDocument * mdp, QAction *action, MainWindow *mwi, QWidget *gla) +bool MeshlabStdDialog::showAutoDialog(FilterPluginInterface *mfi, MeshModel *mm, MeshDocument * mdp, QAction *action, MainWindow *mwi, QWidget *gla) { validcache = false; curAction = action; @@ -69,7 +69,7 @@ void MeshlabStdDialog::changeCurrentMesh(int meshInd) bool MeshlabStdDialog::isPreviewable() { - if ((curAction == NULL) || (curmfi == NULL) || (curmfi->filterArity(curAction) != MeshFilterInterface::SINGLE_MESH)) + if ((curAction == NULL) || (curmfi == NULL) || (curmfi->filterArity(curAction) != FilterPluginInterface::SINGLE_MESH)) return false; if ((curmask == MeshModel::MM_UNKNOWN) || (curmask == MeshModel::MM_NONE)) diff --git a/src/meshlab/ml_std_par_dialog.h b/src/meshlab/ml_std_par_dialog.h index b36e9cd0e..a9bf467ab 100644 --- a/src/meshlab/ml_std_par_dialog.h +++ b/src/meshlab/ml_std_par_dialog.h @@ -26,6 +26,7 @@ #include #include "rich_parameter_gui/richparameterlistframe.h" +#include "../common/interfaces/filter_plugin_interface.h" class MainWindow; class MeshlabStdDialog : public QDockWidget @@ -40,7 +41,7 @@ public: void createFrame(); void loadFrameContent(MeshDocument *mdPt=0); - bool showAutoDialog(MeshFilterInterface *mfi, MeshModel *mm, MeshDocument * md, QAction *q, MainWindow *mwi, QWidget *gla=0); + bool showAutoDialog(FilterPluginInterface *mfi, MeshModel *mm, MeshDocument * md, QAction *q, MainWindow *mwi, QWidget *gla=0); bool isPreviewable(); public slots: @@ -67,7 +68,7 @@ public: uint curmask; MeshModel *curModel; MeshDocument * curMeshDoc; - MeshFilterInterface *curmfi; + FilterPluginInterface *curmfi; MainWindow *curmwi; QWidget * curgla; RichParameterList curParSet; diff --git a/src/meshlab/plugindialog.cpp b/src/meshlab/plugindialog.cpp index 26c9ec8f0..b7124250a 100644 --- a/src/meshlab/plugindialog.cpp +++ b/src/meshlab/plugindialog.cpp @@ -23,6 +23,7 @@ #include "plugindialog.h" #include +#include #include #include @@ -138,7 +139,7 @@ void PluginDialog::populateTreeWidget(const QString &path,const QStringList &fil foreach(QAction *a,iDecorate->actions()){Templist.push_back(a->text());} addItems(pluginItem,Templist); } - MeshFilterInterface *iFilter = qobject_cast(plugin); + FilterPluginInterface *iFilter = qobject_cast(plugin); if (iFilter){ QStringList Templist; foreach(QAction *a,iFilter->actions()){Templist.push_back(a->text());} @@ -205,7 +206,7 @@ void PluginDialog::displayInfo(QTreeWidgetItem* item,int /* ncolumn*/) if (actionName==a->text()) labelInfo->setText(iDecorate->decorationInfo(a)); } - MeshFilterInterface *iFilter = qobject_cast(plugin); + FilterPluginInterface *iFilter = qobject_cast(plugin); if (iFilter) { foreach(QAction *a,iFilter->actions()) diff --git a/src/meshlab/rich_parameter_gui/richparameterlistframe.h b/src/meshlab/rich_parameter_gui/richparameterlistframe.h index 50cfeacbe..089e649d5 100644 --- a/src/meshlab/rich_parameter_gui/richparameterlistframe.h +++ b/src/meshlab/rich_parameter_gui/richparameterlistframe.h @@ -24,8 +24,6 @@ #ifndef RICHPARAMETERLISTFRAME_H #define RICHPARAMETERLISTFRAME_H -#include "../../common/interfaces.h" - #include "richparameterwidgets.h" #include diff --git a/src/meshlabplugins/filter_ao/filter_ao.cpp b/src/meshlabplugins/filter_ao/filter_ao.cpp index c089932ba..df6ae74bd 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.cpp +++ b/src/meshlabplugins/filter_ao/filter_ao.cpp @@ -24,6 +24,8 @@ #include #include "filter_ao.h" #include +#include +#include #include #include @@ -97,16 +99,16 @@ int AmbientOcclusionPlugin::getRequirements(const QAction * /*action*/) return 0; } -MeshFilterInterface::FILTER_ARITY AmbientOcclusionPlugin::filterArity(const QAction*) const +FilterPluginInterface::FILTER_ARITY AmbientOcclusionPlugin::filterArity(const QAction*) const { return SINGLE_MESH; } int getRequirements(QAction *action); -MeshFilterInterface::FilterClass AmbientOcclusionPlugin::getClass(const QAction * /*filter*/) const +FilterPluginInterface::FilterClass AmbientOcclusionPlugin::getClass(const QAction * /*filter*/) const { - return MeshFilterInterface::VertexColoring; + return FilterPluginInterface::VertexColoring; //return MeshFilterInterface::FilterClass(MeshFilterInterface::FaceColoring | MeshFilterInterface::VertexColoring); }; diff --git a/src/meshlabplugins/filter_ao/filter_ao.h b/src/meshlabplugins/filter_ao/filter_ao.h index c1554946f..ce7b592f7 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.h +++ b/src/meshlabplugins/filter_ao/filter_ao.h @@ -26,14 +26,14 @@ #include -#include +#include #include class AOGLWidget; -class AmbientOcclusionPlugin : public QObject, public MeshFilterInterface +class AmbientOcclusionPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) // Attributes protected: diff --git a/src/meshlabplugins/filter_camera/filter_camera.cpp b/src/meshlabplugins/filter_camera/filter_camera.cpp index 85f432f41..e2330d137 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.cpp +++ b/src/meshlabplugins/filter_camera/filter_camera.cpp @@ -716,16 +716,16 @@ FilterCameraPlugin::FilterClass FilterCameraPlugin::getClass(const QAction *a) c case FP_CAMERA_TRANSLATE : case FP_CAMERA_TRANSFORM: case FP_SET_RASTER_CAMERA : - return FilterClass (MeshFilterInterface::Camera + MeshFilterInterface::RasterLayer) ; + return FilterClass (FilterPluginInterface::Camera + FilterPluginInterface::RasterLayer) ; case FP_QUALITY_FROM_CAMERA: - return FilterClass(MeshFilterInterface::Camera + MeshFilterInterface::RasterLayer + MeshFilterInterface::Quality); + return FilterClass(FilterPluginInterface::Camera + FilterPluginInterface::RasterLayer + FilterPluginInterface::Quality); case FP_ORIENT_NORMALS_WITH_CAMERAS: - return FilterClass(MeshFilterInterface::Camera + MeshFilterInterface::Normal); + return FilterClass(FilterPluginInterface::Camera + FilterPluginInterface::Normal); case FP_SET_MESH_CAMERA: - return FilterClass(MeshFilterInterface::Camera + MeshFilterInterface::Layer); + return FilterClass(FilterPluginInterface::Camera + FilterPluginInterface::Layer); } assert(0); - return MeshFilterInterface::Camera; + return FilterPluginInterface::Camera; } int FilterCameraPlugin::getPreConditions(const QAction * a) const @@ -747,7 +747,7 @@ int FilterCameraPlugin::getPreConditions(const QAction * a) const return 0; } -MeshFilterInterface::FILTER_ARITY FilterCameraPlugin::filterArity(const QAction* act ) const +FilterPluginInterface::FILTER_ARITY FilterCameraPlugin::filterArity(const QAction* act ) const { switch (ID(act)) { diff --git a/src/meshlabplugins/filter_camera/filter_camera.h b/src/meshlabplugins/filter_camera/filter_camera.h index 2fd89f42b..4755f019f 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.h +++ b/src/meshlabplugins/filter_camera/filter_camera.h @@ -26,13 +26,13 @@ #include -#include +#include -class FilterCameraPlugin : public QObject, public MeshFilterInterface +class FilterCameraPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { FP_SET_MESH_CAMERA, diff --git a/src/meshlabplugins/filter_clean/cleanfilter.cpp b/src/meshlabplugins/filter_clean/cleanfilter.cpp index 4c183745f..947d88676 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.cpp +++ b/src/meshlabplugins/filter_clean/cleanfilter.cpp @@ -159,12 +159,12 @@ QString CleanFilter::filterName(FilterIDType filter) const case FP_REMOVE_UNREFERENCED_VERTEX: case FP_REMOVE_DUPLICATED_VERTEX: case FP_COMPACT_VERT: - case FP_COMPACT_FACE: return MeshFilterInterface::Cleaning; - case FP_BALL_PIVOTING: return MeshFilterInterface::Remeshing; - case FP_MERGE_WEDGE_TEX: return MeshFilterInterface::FilterClass(MeshFilterInterface::Cleaning + MeshFilterInterface::Texture); + case FP_COMPACT_FACE: return FilterPluginInterface::Cleaning; + case FP_BALL_PIVOTING: return FilterPluginInterface::Remeshing; + case FP_MERGE_WEDGE_TEX: return FilterPluginInterface::FilterClass(FilterPluginInterface::Cleaning + FilterPluginInterface::Texture); default : assert(0); } - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } int CleanFilter::getRequirements(const QAction *action) diff --git a/src/meshlabplugins/filter_clean/cleanfilter.h b/src/meshlabplugins/filter_clean/cleanfilter.h index 84aea1b2c..49da2bf0d 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.h +++ b/src/meshlabplugins/filter_clean/cleanfilter.h @@ -25,13 +25,13 @@ #define __CLEAN_FILTER_H__ #include -#include +#include -class CleanFilter : public QObject, public MeshFilterInterface +class CleanFilter : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: /* naming convention : diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp index 0db938b05..03f410f39 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp @@ -932,7 +932,7 @@ FilterColorProjectionPlugin::FilterClass FilterColorProjectionPlugin::getClass(c return FilterClass(Camera + Texture); break; default : assert(0); - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } } diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.h b/src/meshlabplugins/filter_color_projection/filter_color_projection.h index 7cf9d8166..0ad1e20eb 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.h +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.h @@ -25,13 +25,13 @@ #define FILTER_COLORPROJ_H #include -#include +#include -class FilterColorProjectionPlugin : public QObject, public MeshFilterInterface +class FilterColorProjectionPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { FP_SINGLEIMAGEPROJ, FP_MULTIIMAGETRIVIALPROJ, FP_MULTIIMAGETRIVIALPROJTEXTURE }; diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp index 18bee1a62..11aaa16af 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp @@ -915,7 +915,7 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, const return false; } - MeshFilterInterface::FilterClass FilterColorProc::getClass(const QAction *a) const + FilterPluginInterface::FilterClass FilterColorProc::getClass(const QAction *a) const { switch(ID(a)) { @@ -933,10 +933,10 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, const case CP_MAP_VQUALITY_INTO_COLOR: case CP_VERTEX_SMOOTH: case CP_FACE_TO_VERTEX: - case CP_TEXTURE_TO_VERTEX: return MeshFilterInterface::VertexColoring; - case CP_SCATTER_PER_MESH: return MeshFilterInterface::MeshColoring; + case CP_TEXTURE_TO_VERTEX: return FilterPluginInterface::VertexColoring; + case CP_SCATTER_PER_MESH: return FilterPluginInterface::MeshColoring; case CP_SATURATE_QUALITY: - case CP_CLAMP_QUALITY: return MeshFilterInterface::Quality; + case CP_CLAMP_QUALITY: return FilterPluginInterface::Quality; case CP_DISCRETE_CURVATURE: return FilterClass(Normal + VertexColoring); case CP_TRIANGLE_QUALITY: return FilterClass(Quality + FaceColoring); case CP_RANDOM_FACE: @@ -944,10 +944,10 @@ bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, const case CP_FACE_SMOOTH: case CP_VERTEX_TO_FACE: case CP_MESH_TO_FACE: - case CP_MAP_FQUALITY_INTO_COLOR: return MeshFilterInterface::FaceColoring; + case CP_MAP_FQUALITY_INTO_COLOR: return FilterPluginInterface::FaceColoring; default: assert(0); } - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } int FilterColorProc::postCondition( const QAction* filter ) const @@ -1022,7 +1022,7 @@ int FilterColorProc::getPreConditions(const QAction* filter ) const return MeshModel::MM_NONE; } -MeshFilterInterface::FILTER_ARITY FilterColorProc::filterArity(const QAction* act ) const +FilterPluginInterface::FILTER_ARITY FilterColorProc::filterArity(const QAction* act ) const { switch(ID(act)) { @@ -1050,12 +1050,12 @@ MeshFilterInterface::FILTER_ARITY FilterColorProc::filterArity(const QAction* ac case CP_MAP_FQUALITY_INTO_COLOR: case CP_FACE_TO_VERTEX: case CP_FACE_SMOOTH: - case CP_TEXTURE_TO_VERTEX: return MeshFilterInterface::SINGLE_MESH; - case CP_SCATTER_PER_MESH: return MeshFilterInterface::VARIABLE; + case CP_TEXTURE_TO_VERTEX: return FilterPluginInterface::SINGLE_MESH; + case CP_SCATTER_PER_MESH: return FilterPluginInterface::VARIABLE; default: assert(0); } - return MeshFilterInterface::SINGLE_MESH; + return FilterPluginInterface::SINGLE_MESH; } diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.h b/src/meshlabplugins/filter_colorproc/filter_colorproc.h index 9c5239b1e..0e00c8966 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.h +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.h @@ -25,14 +25,14 @@ #define FILTERCOLORPROCPLUGIN_H #include -#include +#include -class FilterColorProc : public QObject, public MeshFilterInterface +class FilterColorProc : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { CP_FILLING, diff --git a/src/meshlabplugins/filter_create/filter_create.cpp b/src/meshlabplugins/filter_create/filter_create.cpp index ee117ffbd..167b4e302 100644 --- a/src/meshlabplugins/filter_create/filter_create.cpp +++ b/src/meshlabplugins/filter_create/filter_create.cpp @@ -527,7 +527,7 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, const Ri return true; } - MeshFilterInterface::FilterClass FilterCreate::getClass(const QAction *a) const + FilterPluginInterface::FilterClass FilterCreate::getClass(const QAction *a) const { switch(ID(a)) { @@ -543,11 +543,11 @@ bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, const Ri case CR_CONE: case CR_TORUS: case CR_FITPLANE: - return MeshFilterInterface::MeshCreation; + return FilterPluginInterface::MeshCreation; break; default: assert(0); - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } } diff --git a/src/meshlabplugins/filter_create/filter_create.h b/src/meshlabplugins/filter_create/filter_create.h index 515b2ef14..84441eed1 100644 --- a/src/meshlabplugins/filter_create/filter_create.h +++ b/src/meshlabplugins/filter_create/filter_create.h @@ -23,13 +23,13 @@ #ifndef FILTER_CREATE_H #define FILTER_CREATE_H -#include +#include -class FilterCreate : public QObject, public MeshFilterInterface +class FilterCreate : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { diff --git a/src/meshlabplugins/filter_createiso/filter_createiso.cpp b/src/meshlabplugins/filter_createiso/filter_createiso.cpp index 54b69e1fc..6cefd11ad 100644 --- a/src/meshlabplugins/filter_createiso/filter_createiso.cpp +++ b/src/meshlabplugins/filter_createiso/filter_createiso.cpp @@ -83,8 +83,8 @@ QString FilterCreateIso::pluginName() const { switch(ID(a)) { - case FP_CREATEISO : return MeshFilterInterface::MeshCreation; - default : return MeshFilterInterface::Generic; + case FP_CREATEISO : return FilterPluginInterface::MeshCreation; + default : return FilterPluginInterface::Generic; } } diff --git a/src/meshlabplugins/filter_createiso/filter_createiso.h b/src/meshlabplugins/filter_createiso/filter_createiso.h index 7a31ce26f..429ef86f7 100644 --- a/src/meshlabplugins/filter_createiso/filter_createiso.h +++ b/src/meshlabplugins/filter_createiso/filter_createiso.h @@ -33,14 +33,14 @@ Added the new sample filter plugin that removes border faces #define FILTERCREATEISO_PLUGIN_H #include -#include +#include -class FilterCreateIso : public QObject, public MeshFilterInterface +class FilterCreateIso : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: /* naming convention : diff --git a/src/meshlabplugins/filter_csg/filter_csg.h b/src/meshlabplugins/filter_csg/filter_csg.h index 9f1a12b2b..a70c5e77c 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.h +++ b/src/meshlabplugins/filter_csg/filter_csg.h @@ -28,18 +28,17 @@ #include #include -#include -#include +#include //FILE _iob[] = { *stdin, *stdout, *stderr }; //extern "C" FILE * __cdecl __iob_func(void) { return _iob; } -class FilterCSG : public QObject, public MeshFilterInterface +class FilterCSG : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) enum { CSG_OPERATION_INTERSECTION = 0, @@ -63,7 +62,7 @@ public: virtual bool applyFilter(const QAction*, MeshDocument &, const RichParameterList &, vcg::CallBackPos *); - virtual FilterClass getClass(const QAction *) const { return MeshFilterInterface::FilterClass( MeshFilterInterface::Layer + MeshFilterInterface::Remeshing ); } + virtual FilterClass getClass(const QAction *) const { return FilterPluginInterface::FilterClass( FilterPluginInterface::Layer + FilterPluginInterface::Remeshing ); } FILTER_ARITY filterArity(const QAction*) const {return FIXED;} }; diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.cpp b/src/meshlabplugins/filter_dirt/filter_dirt.cpp index f1b648343..ea321162f 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.cpp +++ b/src/meshlabplugins/filter_dirt/filter_dirt.cpp @@ -253,14 +253,14 @@ int FilterDirt::postCondition(const QAction *a) const return MeshModel::MM_ALL; } -MeshFilterInterface::FilterClass FilterDirt::getClass(const QAction *filter) const +FilterPluginInterface::FilterClass FilterDirt::getClass(const QAction *filter) const { switch (ID(filter)) { - case FP_DIRT:return MeshFilterInterface::Sampling; - case FP_CLOUD_MOVEMENT:return MeshFilterInterface::Remeshing; + case FP_DIRT:return FilterPluginInterface::Sampling; + case FP_CLOUD_MOVEMENT:return FilterPluginInterface::Remeshing; default:assert(0); } - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } MESHLAB_PLUGIN_NAME_EXPORTER(FilterDirt) diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.h b/src/meshlabplugins/filter_dirt/filter_dirt.h index 984fed86c..275ffda51 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.h +++ b/src/meshlabplugins/filter_dirt/filter_dirt.h @@ -27,8 +27,7 @@ #include #include #include -#include -#include +#include #include #include //#include "muParser.h" @@ -37,11 +36,11 @@ using namespace vcg; //using namespace mu; -class FilterDirt : public QObject, public MeshFilterInterface +class FilterDirt : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) protected: double x,y,z,nx,ny,nz,r,g,b,q,rad; //double x0,y0,z0,x1,y1,z1,x2,y2,z2,nx0,ny0,nz0,nx1,ny1,nz1,nx2,ny2,nz2,r0,g0,b0,r1,g1,b1,r2,g2,b2,q0,q1,q2; diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.cpp b/src/meshlabplugins/filter_fractal/filter_fractal.cpp index c4eb0df75..c4e0b23cc 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.cpp +++ b/src/meshlabplugins/filter_fractal/filter_fractal.cpp @@ -257,7 +257,7 @@ void FilterFractal::initParameterSetForCratersGeneration(MeshDocument &md, RichP bool FilterFractal::applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList &par, vcg::CallBackPos* cb) { - if(this->getClass(filter) == MeshFilterInterface::MeshCreation) + if(this->getClass(filter) == FilterPluginInterface::MeshCreation) md.addNewMesh("",this->filterName(ID(filter))); switch(ID(filter)) { @@ -338,18 +338,18 @@ bool FilterFractal::applyFilter(const QAction* filter, MeshDocument &md, const R return false; } -MeshFilterInterface::FilterClass FilterFractal::getClass(const QAction* filter) const +FilterPluginInterface::FilterClass FilterFractal::getClass(const QAction* filter) const { switch(ID(filter)) { case CR_FRACTAL_TERRAIN: - return MeshFilterInterface::MeshCreation; + return FilterPluginInterface::MeshCreation; break; case FP_FRACTAL_MESH: case FP_CRATERS: - return MeshFilterInterface::Smoothing; + return FilterPluginInterface::Smoothing; break; default: assert(0); - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } } @@ -382,18 +382,18 @@ int FilterFractal::postCondition(const QAction *filter) const return MeshModel::MM_ALL; } -MeshFilterInterface::FILTER_ARITY FilterFractal::filterArity(const QAction* act ) const +FilterPluginInterface::FILTER_ARITY FilterFractal::filterArity(const QAction* act ) const { switch(ID(act)) { case FP_FRACTAL_MESH: - return MeshFilterInterface::SINGLE_MESH; + return FilterPluginInterface::SINGLE_MESH; case CR_FRACTAL_TERRAIN: - return MeshFilterInterface::NONE; + return FilterPluginInterface::NONE; case FP_CRATERS: - return MeshFilterInterface::VARIABLE; + return FilterPluginInterface::VARIABLE; } - return MeshFilterInterface::NONE; + return FilterPluginInterface::NONE; } // ---------------------------------------------------------------------- diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.h b/src/meshlabplugins/filter_fractal/filter_fractal.h index 3a2bad26d..c5c26c518 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.h +++ b/src/meshlabplugins/filter_fractal/filter_fractal.h @@ -28,14 +28,14 @@ #include #include -#include +#include #include "craters_utils.h" -class FilterFractal : public QObject, public MeshFilterInterface +class FilterFractal : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: FilterFractal(); diff --git a/src/meshlabplugins/filter_func/filter_func.cpp b/src/meshlabplugins/filter_func/filter_func.cpp index d5dd344c0..3368d7efa 100644 --- a/src/meshlabplugins/filter_func/filter_func.cpp +++ b/src/meshlabplugins/filter_func/filter_func.cpp @@ -166,22 +166,22 @@ FilterFunctionPlugin::FilterClass FilterFunctionPlugin::getClass(const QAction * switch(ID(a)) { case FF_FACE_SELECTION: - case FF_VERT_SELECTION: return MeshFilterInterface::Selection; + case FF_VERT_SELECTION: return FilterPluginInterface::Selection; case FF_FACE_QUALITY: return FilterClass(Quality + FaceColoring); case FF_VERT_QUALITY: return FilterClass(Quality + VertexColoring); - case FF_VERT_TEXTURE_FUNC: return MeshFilterInterface::Texture; - case FF_VERT_COLOR: return MeshFilterInterface::VertexColoring; - case FF_VERT_NORMAL: return MeshFilterInterface::Normal; - case FF_FACE_COLOR: return MeshFilterInterface::FaceColoring; - case FF_WEDGE_TEXTURE_FUNC: return MeshFilterInterface::Texture; - case FF_ISOSURFACE: return MeshFilterInterface::MeshCreation; - case FF_GRID: return MeshFilterInterface::MeshCreation; - case FF_REFINE: return MeshFilterInterface::Remeshing; - case FF_GEOM_FUNC: return MeshFilterInterface::Smoothing; - case FF_DEF_VERT_ATTRIB: return MeshFilterInterface::Layer; - case FF_DEF_FACE_ATTRIB: return MeshFilterInterface::Layer; + case FF_VERT_TEXTURE_FUNC: return FilterPluginInterface::Texture; + case FF_VERT_COLOR: return FilterPluginInterface::VertexColoring; + case FF_VERT_NORMAL: return FilterPluginInterface::Normal; + case FF_FACE_COLOR: return FilterPluginInterface::FaceColoring; + case FF_WEDGE_TEXTURE_FUNC: return FilterPluginInterface::Texture; + case FF_ISOSURFACE: return FilterPluginInterface::MeshCreation; + case FF_GRID: return FilterPluginInterface::MeshCreation; + case FF_REFINE: return FilterPluginInterface::Remeshing; + case FF_GEOM_FUNC: return FilterPluginInterface::Smoothing; + case FF_DEF_VERT_ATTRIB: return FilterPluginInterface::Layer; + case FF_DEF_FACE_ATTRIB: return FilterPluginInterface::Layer; - default: return MeshFilterInterface::Generic; + default: return FilterPluginInterface::Generic; } } @@ -375,7 +375,7 @@ void FilterFunctionPlugin::initParameterList(const QAction *action,MeshModel &m, // The Real Core Function doing the actual mesh processing. bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) { - if(this->getClass(filter) == MeshFilterInterface::MeshCreation) + if(this->getClass(filter) == FilterPluginInterface::MeshCreation) md.addNewMesh("",this->filterName(ID(filter))); MeshModel &m=*(md.mm()); Q_UNUSED(cb); @@ -1433,7 +1433,7 @@ void FilterFunctionPlugin::setPerFaceVariables(Parser &p, CMeshO &m) } -MeshFilterInterface::FILTER_ARITY FilterFunctionPlugin::filterArity(const QAction* filter ) const +FilterPluginInterface::FILTER_ARITY FilterFunctionPlugin::filterArity(const QAction* filter ) const { switch(ID(filter)) { @@ -1450,12 +1450,12 @@ MeshFilterInterface::FILTER_ARITY FilterFunctionPlugin::filterArity(const QActio case FF_DEF_VERT_ATTRIB: case FF_DEF_FACE_ATTRIB: case FF_REFINE: - return MeshFilterInterface::SINGLE_MESH; + return FilterPluginInterface::SINGLE_MESH; case FF_GRID: case FF_ISOSURFACE: - return MeshFilterInterface::NONE; + return FilterPluginInterface::NONE; } - return MeshFilterInterface::NONE; + return FilterPluginInterface::NONE; } diff --git a/src/meshlabplugins/filter_func/filter_func.h b/src/meshlabplugins/filter_func/filter_func.h index de37f49b4..61b873cec 100644 --- a/src/meshlabplugins/filter_func/filter_func.h +++ b/src/meshlabplugins/filter_func/filter_func.h @@ -26,16 +26,16 @@ #include -#include +#include #include "muParser.h" #include "filter_refine.h" -class FilterFunctionPlugin : public QObject, public MeshFilterInterface +class FilterFunctionPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) protected: double x,y,z,nx,ny,nz,r,g,b,a,q,rad,vtu,vtv,vsel; diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp index f5ad6e15d..553aa4f28 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp @@ -90,10 +90,10 @@ FilterGeodesic::FilterClass FilterGeodesic::getClass(const QAction *a) const { case FP_QUALITY_BORDER_GEODESIC : case FP_QUALITY_SELECTED_GEODESIC : - case FP_QUALITY_POINT_GEODESIC : return FilterGeodesic::FilterClass(MeshFilterInterface::VertexColoring + MeshFilterInterface::Quality); + case FP_QUALITY_POINT_GEODESIC : return FilterGeodesic::FilterClass(FilterPluginInterface::VertexColoring + FilterPluginInterface::Quality); default : assert(0); } - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } int FilterGeodesic::getRequirements(const QAction *action) diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.h b/src/meshlabplugins/filter_geodesic/filter_geodesic.h index 78aadfbe4..ceb56f47c 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.h +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.h @@ -24,15 +24,15 @@ #define FILTERGEODESIC_PLUGIN_H #include -#include +#include #include -class FilterGeodesic : public QObject, public MeshFilterInterface +class FilterGeodesic : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: /* naming convention : diff --git a/src/meshlabplugins/filter_globalregistration/globalregistration.cpp b/src/meshlabplugins/filter_globalregistration/globalregistration.cpp index 2cfe4bebf..d8d86dd09 100644 --- a/src/meshlabplugins/filter_globalregistration/globalregistration.cpp +++ b/src/meshlabplugins/filter_globalregistration/globalregistration.cpp @@ -65,10 +65,10 @@ GlobalRegistrationPlugin::FilterClass GlobalRegistrationPlugin::getClass(const Q { switch(ID(a)) { - case FP_GLOBAL_REGISTRATION : return MeshFilterInterface::PointSet; + case FP_GLOBAL_REGISTRATION : return FilterPluginInterface::PointSet; default : assert(0); } - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } void GlobalRegistrationPlugin::initParameterList(const QAction *action,MeshDocument &md, RichParameterList & parlst) diff --git a/src/meshlabplugins/filter_globalregistration/globalregistration.h b/src/meshlabplugins/filter_globalregistration/globalregistration.h index 7370571f6..37152dc11 100644 --- a/src/meshlabplugins/filter_globalregistration/globalregistration.h +++ b/src/meshlabplugins/filter_globalregistration/globalregistration.h @@ -24,13 +24,13 @@ #ifndef SAMPLEFILTERSPLUGIN_H #define SAMPLEFILTERSPLUGIN_H -#include +#include -class GlobalRegistrationPlugin : public QObject, public MeshFilterInterface +class GlobalRegistrationPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { FP_GLOBAL_REGISTRATION } ; 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 c06426e93..33dede14a 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 @@ -97,7 +97,7 @@ int FilterImgPatchParamPlugin::getRequirements(const QAction *act ) } -MeshFilterInterface::FilterClass FilterImgPatchParamPlugin::getClass(const QAction *act ) const +FilterPluginInterface::FilterClass FilterImgPatchParamPlugin::getClass(const QAction *act ) const { switch( ID(act) ) { @@ -105,7 +105,7 @@ MeshFilterInterface::FilterClass FilterImgPatchParamPlugin::getClass(const QActi case FP_PATCH_PARAM_AND_TEXTURING: return Texture; case FP_RASTER_VERT_COVERAGE: case FP_RASTER_FACE_COVERAGE: return FilterClass(Quality + Camera + Texture); - default: assert(0); return MeshFilterInterface::Generic; + default: assert(0); return FilterPluginInterface::Generic; } } 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 7b1e7c01a..f81f8dca8 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 @@ -28,18 +28,18 @@ #include -#include +#include #include #include "Patch.h" #include class VisibleSet; -class FilterImgPatchParamPlugin : public QObject, public MeshFilterInterface +class FilterImgPatchParamPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES( MeshFilterInterface ) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES( FilterPluginInterface ) enum { diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp index 76c2ce44c..82dcd1691 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp @@ -453,9 +453,9 @@ bool FilterIsoParametrization::applyFilter(const QAction *filter, MeshDocument& return false; } -MeshFilterInterface::FilterClass FilterIsoParametrization::getClass(const QAction *) const +FilterPluginInterface::FilterClass FilterIsoParametrization::getClass(const QAction *) const { - return MeshFilterInterface::Remeshing; + return FilterPluginInterface::Remeshing; } int FilterIsoParametrization::postCondition(const QAction* /*filter*/ ) const @@ -463,18 +463,18 @@ int FilterIsoParametrization::postCondition(const QAction* /*filter*/ ) const return MeshModel::MM_WEDGTEXCOORD | MeshModel::MM_VERTTEXCOORD; } -MeshFilterInterface::FILTER_ARITY FilterIsoParametrization::filterArity(const QAction* filter) const +FilterPluginInterface::FILTER_ARITY FilterIsoParametrization::filterArity(const QAction* filter) const { switch(ID(filter)) { case ISOP_PARAM : case ISOP_REMESHING : case ISOP_DIAMPARAM : - return MeshFilterInterface::SINGLE_MESH; + return FilterPluginInterface::SINGLE_MESH; case ISOP_TRANSFER: - return MeshFilterInterface::FIXED; + return FilterPluginInterface::FIXED; } - return MeshFilterInterface::NONE; + return FilterPluginInterface::NONE; } diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h index 40db6affa..4ca831dd8 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h @@ -29,13 +29,13 @@ #include #include #include -#include +#include -class FilterIsoParametrization : public QObject, public MeshFilterInterface +class FilterIsoParametrization : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum {ISOP_PARAM, diff --git a/src/meshlabplugins/filter_layer/filter_layer.cpp b/src/meshlabplugins/filter_layer/filter_layer.cpp index 23c72f337..1a9fd8286 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.cpp +++ b/src/meshlabplugins/filter_layer/filter_layer.cpp @@ -29,6 +29,8 @@ #include #include +#include +#include @@ -849,18 +851,18 @@ FilterLayerPlugin::FilterClass FilterLayerPlugin::getClass(const QAction *a) con case FP_MESH_VISIBILITY : case FP_SPLITCONNECTED : case FP_DELETE_MESH : - case FP_DELETE_NON_VISIBLE_MESH : return MeshFilterInterface::Layer; + case FP_DELETE_NON_VISIBLE_MESH : return FilterPluginInterface::Layer; case FP_RENAME_RASTER : case FP_DELETE_RASTER : case FP_DELETE_NON_SELECTED_RASTER : - case FP_EXPORT_CAMERAS: return MeshFilterInterface::RasterLayer; - case FP_IMPORT_CAMERAS: return FilterClass(MeshFilterInterface::Camera + MeshFilterInterface::RasterLayer); + case FP_EXPORT_CAMERAS: return FilterPluginInterface::RasterLayer; + case FP_IMPORT_CAMERAS: return FilterClass(FilterPluginInterface::Camera + FilterPluginInterface::RasterLayer); default : assert(0); } - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } -MeshFilterInterface::FILTER_ARITY FilterLayerPlugin::filterArity(const QAction* filter) const +FilterPluginInterface::FILTER_ARITY FilterLayerPlugin::filterArity(const QAction* filter) const { switch(ID(filter)) { @@ -872,18 +874,18 @@ MeshFilterInterface::FILTER_ARITY FilterLayerPlugin::filterArity(const QAction* case FP_SELECTCURRENT : case FP_SPLITCONNECTED : case FP_DELETE_MESH : - return MeshFilterInterface::SINGLE_MESH; + return FilterPluginInterface::SINGLE_MESH; case FP_RENAME_RASTER : case FP_DELETE_RASTER : case FP_DELETE_NON_SELECTED_RASTER : case FP_EXPORT_CAMERAS: case FP_IMPORT_CAMERAS: - return MeshFilterInterface::NONE; + return FilterPluginInterface::NONE; case FP_FLATTEN : case FP_DELETE_NON_VISIBLE_MESH : - return MeshFilterInterface::VARIABLE; + return FilterPluginInterface::VARIABLE; } - return MeshFilterInterface::NONE; + return FilterPluginInterface::NONE; } int FilterLayerPlugin::postCondition(const QAction* filter) const @@ -909,7 +911,7 @@ int FilterLayerPlugin::postCondition(const QAction* filter) const default: assert(0); } - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } MESHLAB_PLUGIN_NAME_EXPORTER(FilterLayerPlugin) diff --git a/src/meshlabplugins/filter_layer/filter_layer.h b/src/meshlabplugins/filter_layer/filter_layer.h index baa038207..17eb080fb 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.h +++ b/src/meshlabplugins/filter_layer/filter_layer.h @@ -26,13 +26,13 @@ #include -#include +#include -class FilterLayerPlugin : public QObject, public MeshFilterInterface +class FilterLayerPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { diff --git a/src/meshlabplugins/filter_measure/filter_measure.cpp b/src/meshlabplugins/filter_measure/filter_measure.cpp index fa54f610e..50f1a87e0 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.cpp +++ b/src/meshlabplugins/filter_measure/filter_measure.cpp @@ -127,10 +127,10 @@ QString FilterMeasurePlugin::filterName(FilterIDType filterId) const FilterMeasurePlugin::FilterClass FilterMeasurePlugin::getClass(const QAction *) const { - return MeshFilterInterface::Measure; + return FilterPluginInterface::Measure; } -MeshFilterInterface::FILTER_ARITY FilterMeasurePlugin::filterArity(const QAction*) const +FilterPluginInterface::FILTER_ARITY FilterMeasurePlugin::filterArity(const QAction*) const { return SINGLE_MESH; } diff --git a/src/meshlabplugins/filter_measure/filter_measure.h b/src/meshlabplugins/filter_measure/filter_measure.h index bd79c6e76..317e5f4bc 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.h +++ b/src/meshlabplugins/filter_measure/filter_measure.h @@ -24,13 +24,13 @@ #ifndef FILTER_MEASURE_H #define FILTER_MEASURE_H -#include +#include -class FilterMeasurePlugin : public QObject, public MeshFilterInterface +class FilterMeasurePlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { diff --git a/src/meshlabplugins/filter_meshing/meshfilter.cpp b/src/meshlabplugins/filter_meshing/meshfilter.cpp index 857f2f347..5d840cd31 100644 --- a/src/meshlabplugins/filter_meshing/meshfilter.cpp +++ b/src/meshlabplugins/filter_meshing/meshfilter.cpp @@ -133,7 +133,7 @@ ExtraMeshFilterPlugin::FilterClass ExtraMeshFilterPlugin::getClass(const QAction case FP_FAUX_CREASE : case FP_FAUX_EXTRACT : case FP_VATTR_SEAM : - case FP_REFINE_LS3_LOOP : return MeshFilterInterface::Remeshing; + case FP_REFINE_LS3_LOOP : return FilterPluginInterface::Remeshing; case FP_REFINE_CATMULL : case FP_REFINE_HALF_CATMULL : case FP_QUAD_DOMINANT : @@ -150,7 +150,7 @@ ExtraMeshFilterPlugin::FilterClass ExtraMeshFilterPlugin::getClass(const QAction case FP_CENTER : case FP_SCALE : case FP_PRINCIPAL_AXIS : - case FP_FLIP_AND_SWAP : return MeshFilterInterface::Normal; + case FP_FLIP_AND_SWAP : return FilterPluginInterface::Normal; case FP_COMPUTE_PRINC_CURV_DIR : return FilterClass( Normal + VertexColoring ); @@ -162,12 +162,12 @@ ExtraMeshFilterPlugin::FilterClass ExtraMeshFilterPlugin::getClass(const QAction case FP_PERIMETER_POLYLINE : case FP_SLICE_WITH_A_PLANE : - case FP_CYLINDER_UNWRAP : return MeshFilterInterface::Measure; + case FP_CYLINDER_UNWRAP : return FilterPluginInterface::Measure; - default : assert(0); return MeshFilterInterface::Generic; + default : assert(0); return FilterPluginInterface::Generic; } - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } int ExtraMeshFilterPlugin::getPreCondition(QAction *filter) const diff --git a/src/meshlabplugins/filter_meshing/meshfilter.h b/src/meshlabplugins/filter_meshing/meshfilter.h index 3e2bc792b..0255b7344 100644 --- a/src/meshlabplugins/filter_meshing/meshfilter.h +++ b/src/meshlabplugins/filter_meshing/meshfilter.h @@ -24,13 +24,13 @@ #ifndef EXTRAFILTERSPLUGIN_H #define EXTRAFILTERSPLUGIN_H -#include +#include -class ExtraMeshFilterPlugin : public QObject, public MeshFilterInterface +class ExtraMeshFilterPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) enum RefPlane { REF_CENTER,REF_MIN,REF_ORIG}; diff --git a/src/meshlabplugins/filter_mls/mlsplugin.cpp b/src/meshlabplugins/filter_mls/mlsplugin.cpp index ff9735efa..58c75d44d 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.cpp +++ b/src/meshlabplugins/filter_mls/mlsplugin.cpp @@ -99,24 +99,24 @@ QString MlsPlugin::pluginName() const return QString("Filter Unknown"); } - MeshFilterInterface::FilterClass MlsPlugin::getClass(const QAction *a) const + FilterPluginInterface::FilterClass MlsPlugin::getClass(const QAction *a) const { int filterId = ID(a); switch(filterId) { case FP_APSS_PROJECTION : - case FP_RIMLS_PROJECTION : return FilterClass(MeshFilterInterface::PointSet + MeshFilterInterface::Smoothing); + case FP_RIMLS_PROJECTION : return FilterClass(FilterPluginInterface::PointSet + FilterPluginInterface::Smoothing); case FP_APSS_AFRONT : case FP_RIMLS_AFRONT : case FP_APSS_MCUBE : - case FP_RIMLS_MCUBE : return FilterClass(MeshFilterInterface::PointSet | MeshFilterInterface::Remeshing); + case FP_RIMLS_MCUBE : return FilterClass(FilterPluginInterface::PointSet | FilterPluginInterface::Remeshing); case FP_APSS_COLORIZE : - case FP_RIMLS_COLORIZE : return FilterClass(MeshFilterInterface::PointSet | MeshFilterInterface::VertexColoring); - case FP_RADIUS_FROM_DENSITY : return MeshFilterInterface::PointSet; - case FP_SELECT_SMALL_COMPONENTS : return MeshFilterInterface::Selection; + case FP_RIMLS_COLORIZE : return FilterClass(FilterPluginInterface::PointSet | FilterPluginInterface::VertexColoring); + case FP_RADIUS_FROM_DENSITY : return FilterPluginInterface::PointSet; + case FP_SELECT_SMALL_COMPONENTS : return FilterPluginInterface::Selection; } assert(0); - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } // Info() must return the longer string describing each filtering action diff --git a/src/meshlabplugins/filter_mls/mlsplugin.h b/src/meshlabplugins/filter_mls/mlsplugin.h index 1fc27fc88..80a41a297 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.h +++ b/src/meshlabplugins/filter_mls/mlsplugin.h @@ -26,13 +26,13 @@ #include -#include +#include -class MlsPlugin : public QObject, public MeshFilterInterface +class MlsPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp index f4b613e18..4f5425a3f 100644 --- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp +++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp @@ -88,10 +88,10 @@ FilterMutualGlobal::FilterClass FilterMutualGlobal::getClass(const QAction *a) c { switch(ID(a)) { - case FP_IMAGE_GLOBALIGN : return MeshFilterInterface::Camera; + case FP_IMAGE_GLOBALIGN : return FilterPluginInterface::Camera; default : assert(0); } - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } // This function define the needed parameters for each filter. Return true if the filter has some parameters diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h index c29bff6d8..d7747665e 100644 --- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h +++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h @@ -36,14 +36,14 @@ add sampleplugins #include -#include +#include #include "alignset.h" -class FilterMutualGlobal : public QObject, public MeshFilterInterface +class FilterMutualGlobal : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { FP_IMAGE_GLOBALIGN} ; diff --git a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp index ea7367b30..2944d9f59 100644 --- a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp +++ b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp @@ -73,14 +73,14 @@ FilterMutualInfoPlugin::FilterClass FilterMutualInfoPlugin::getClass(const QActi { switch(ID(a)) { case FP_IMAGE_MUTUALINFO: - return MeshFilterInterface::Camera; + return FilterPluginInterface::Camera; default : assert(0); - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } } -MeshFilterInterface::FILTER_ARITY FilterMutualInfoPlugin::filterArity(const QAction*) const +FilterPluginInterface::FILTER_ARITY FilterMutualInfoPlugin::filterArity(const QAction*) const { return SINGLE_MESH; } diff --git a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h index f4f0d807c..a060c8df7 100644 --- a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h +++ b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h @@ -26,14 +26,14 @@ #include -#include +#include #include "alignset.h" -class FilterMutualInfoPlugin : public QObject, public MeshFilterInterface +class FilterMutualInfoPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.cpp b/src/meshlabplugins/filter_plymc/filter_plymc.cpp index 7e9c52314..00cbc391f 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.cpp +++ b/src/meshlabplugins/filter_plymc/filter_plymc.cpp @@ -26,6 +26,7 @@ #include #include #include +#include using namespace vcg; @@ -86,11 +87,11 @@ QString PlyMCPlugin::pluginName() const { switch(ID(a)) { - case FP_PLYMC : return MeshFilterInterface::Remeshing; - case FP_MC_SIMPLIFY : return MeshFilterInterface::Remeshing; + case FP_PLYMC : return FilterPluginInterface::Remeshing; + case FP_MC_SIMPLIFY : return FilterPluginInterface::Remeshing; default : assert(0); } - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } // This function define the needed parameters for each filter. Return true if the filter has some parameters @@ -246,13 +247,13 @@ bool PlyMCPlugin::applyFilter(const QAction *filter, MeshDocument &md, const Ric return true; } -MeshFilterInterface::FILTER_ARITY PlyMCPlugin::filterArity(const QAction * filter ) const +FilterPluginInterface::FILTER_ARITY PlyMCPlugin::filterArity(const QAction * filter ) const { switch(ID(filter)) { - case FP_PLYMC : return MeshFilterInterface::VARIABLE; - case FP_MC_SIMPLIFY : return MeshFilterInterface::SINGLE_MESH; - default: return MeshFilterInterface::NONE; + case FP_PLYMC : return FilterPluginInterface::VARIABLE; + case FP_MC_SIMPLIFY : return FilterPluginInterface::SINGLE_MESH; + default: return FilterPluginInterface::NONE; } } diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.h b/src/meshlabplugins/filter_plymc/filter_plymc.h index 300ab9ea3..6f406e2c1 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.h +++ b/src/meshlabplugins/filter_plymc/filter_plymc.h @@ -24,13 +24,13 @@ #ifndef _FILTER_PLYMC_H_ #define _FILTER_PLYMC_H_ -#include +#include -class PlyMCPlugin : public QObject, public MeshFilterInterface +class PlyMCPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { @@ -46,7 +46,7 @@ public: virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FilterClass getClass(const QAction* a) const; - MeshFilterInterface::FILTER_ARITY filterArity(const QAction* filter) const; + FilterPluginInterface::FILTER_ARITY filterArity(const QAction* filter) const; int postCondition(const QAction *filter) const; }; diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.cpp b/src/meshlabplugins/filter_qhull/filter_qhull.cpp index b35505381..f06f4e794 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.cpp +++ b/src/meshlabplugins/filter_qhull/filter_qhull.cpp @@ -120,9 +120,9 @@ QString QhullPlugin::pluginName() const case FP_QHULL_DELAUNAY_TRIANGULATION : case FP_QHULL_VORONOI_FILTERING : case FP_QHULL_ALPHA_COMPLEX_AND_SHAPE: - return FilterClass (MeshFilterInterface::Remeshing) ; + return FilterClass (FilterPluginInterface::Remeshing) ; case FP_QHULL_VISIBLE_POINTS: - return FilterClass (MeshFilterInterface::Selection + MeshFilterInterface::PointSet); + return FilterClass (FilterPluginInterface::Selection + FilterPluginInterface::PointSet); default : assert(0); } return FilterClass(0); diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.h b/src/meshlabplugins/filter_qhull/filter_qhull.h index 0f5cc92d0..35bea5802 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.h +++ b/src/meshlabplugins/filter_qhull/filter_qhull.h @@ -29,13 +29,13 @@ History #define QHULLFILTERSPLUGIN_H #include -#include +#include -class QhullPlugin : public QObject, public MeshFilterInterface +class QhullPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp index 2b8038489..911f82538 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp @@ -69,12 +69,12 @@ QString QualityMapperFilter::pluginName() const return QString(""); } - MeshFilterInterface::FilterClass QualityMapperFilter::getClass(const QAction *a) const + FilterPluginInterface::FilterClass QualityMapperFilter::getClass(const QAction *a) const { switch(ID(a)) { - case FP_QUALITY_MAPPER : return MeshFilterInterface::Quality; - default : assert(0); return MeshFilterInterface::Generic; + case FP_QUALITY_MAPPER : return FilterPluginInterface::Quality; + default : assert(0); return FilterPluginInterface::Generic; } } diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.h b/src/meshlabplugins/filter_quality/filterqualitymapper.h index 65161fab9..71ea0ab5d 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.h +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.h @@ -32,7 +32,7 @@ FIRST RELEASE #include -#include +#include #include "../edit_quality/common/transferfunction.h" #include // for ComputePerVertexQualityMinMax @@ -55,11 +55,11 @@ public: }; -class QualityMapperFilter : public QObject, public MeshFilterInterface +class QualityMapperFilter : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) private: Frange _meshMinMaxQuality; diff --git a/src/meshlabplugins/filter_sample/filter_sample.cpp b/src/meshlabplugins/filter_sample/filter_sample.cpp index c43a2ebaa..7a0003ae6 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.cpp +++ b/src/meshlabplugins/filter_sample/filter_sample.cpp @@ -87,10 +87,10 @@ FilterSamplePlugin::FilterClass FilterSamplePlugin::getClass(const QAction *a) c { switch(ID(a)) { case FP_MOVE_VERTEX : - return MeshFilterInterface::Smoothing; + return FilterPluginInterface::Smoothing; default : assert(0); - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } } @@ -98,7 +98,7 @@ FilterSamplePlugin::FilterClass FilterSamplePlugin::getClass(const QAction *a) c * @brief FilterSamplePlugin::filterArity * @return */ -MeshFilterInterface::FILTER_ARITY FilterSamplePlugin::filterArity(const QAction*) const +FilterPluginInterface::FILTER_ARITY FilterSamplePlugin::filterArity(const QAction*) const { return SINGLE_MESH; } diff --git a/src/meshlabplugins/filter_sample/filter_sample.h b/src/meshlabplugins/filter_sample/filter_sample.h index dddf78ad0..1b55b1ecf 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.h +++ b/src/meshlabplugins/filter_sample/filter_sample.h @@ -39,13 +39,13 @@ add sampleplugins #ifndef FILTERSAMPLE_PLUGIN_H #define FILTERSAMPLE_PLUGIN_H -#include +#include -class FilterSamplePlugin : public QObject, public MeshFilterInterface +class FilterSamplePlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { FP_MOVE_VERTEX } ; diff --git a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp index ee1b0b749..93c1688e7 100644 --- a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp +++ b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp @@ -72,7 +72,7 @@ QString ExtraSampleDynPlugin::filterName(FilterIDType filterId) const // The FilterClass describes in which generic class of filters it fits. // This choice affect the submenu in which each filter will be placed // In this case this sample belong to the class of filters that change the vertex colors - MeshFilterInterface::FilterClass ExtraSampleDynPlugin::getClass(const QAction *) const { return MeshFilterInterface::VertexColoring; } + FilterPluginInterface::FilterClass ExtraSampleDynPlugin::getClass(const QAction *) const { return FilterPluginInterface::VertexColoring; } // This function define the needed parameters for each filter. Return true if the filter has some parameters // it is called every time, so you can set the default value of parameters according to the mesh diff --git a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h index 2db3df4e6..f67c0c806 100644 --- a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h +++ b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h @@ -26,13 +26,13 @@ #include -#include +#include -class ExtraSampleDynPlugin : public QObject, public MeshFilterInterface +class ExtraSampleDynPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { FP_VERTEX_COLOR_NOISE } ; diff --git a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp index 53e991e3e..fb1b12ab9 100644 --- a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp +++ b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp @@ -74,10 +74,10 @@ ExtraSampleGPUPlugin::FilterClass ExtraSampleGPUPlugin::getClass(const QAction * { switch(ID(a)) { - case FP_GPU_EXAMPLE: return MeshFilterInterface::RasterLayer; //should be generic, but better avoid it + case FP_GPU_EXAMPLE: return FilterPluginInterface::RasterLayer; //should be generic, but better avoid it default : assert(0); } - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } // This function define the needed parameters for each filter. Return true if the filter has some parameters diff --git a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h index b35f42850..ce5a768b4 100644 --- a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h +++ b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h @@ -36,13 +36,13 @@ add sampleplugins #include -#include +#include -class ExtraSampleGPUPlugin : public QObject, public MeshFilterInterface +class ExtraSampleGPUPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { FP_GPU_EXAMPLE } ; diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.cpp b/src/meshlabplugins/filter_sampling/filter_sampling.cpp index c63433aa2..8427cd2b7 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.cpp +++ b/src/meshlabplugins/filter_sampling/filter_sampling.cpp @@ -40,6 +40,8 @@ $Log: samplefilter.cpp,v $ #include #include +#include + using namespace vcg; using namespace std; @@ -1356,7 +1358,7 @@ switch(ID(action)) return true; } -MeshFilterInterface::FilterClass FilterDocSampling::getClass(const QAction *action) const +FilterPluginInterface::FilterClass FilterDocSampling::getClass(const QAction *action) const { switch(ID(action)) { @@ -1372,8 +1374,8 @@ MeshFilterInterface::FilterClass FilterDocSampling::getClass(const QAction *acti case FP_TEXEL_SAMPLING : return FilterDocSampling::Sampling; case FP_UNIFORM_MESH_RESAMPLING: return FilterDocSampling::Remeshing; case FP_DISK_COLORING: - case FP_VORONOI_COLORING: return MeshFilterInterface::FilterClass(FilterDocSampling::Sampling | FilterDocSampling::VertexColoring); - case FP_POINTCLOUD_SIMPLIFICATION : return MeshFilterInterface::FilterClass(FilterDocSampling::Sampling | FilterDocSampling::PointSet); + case FP_VORONOI_COLORING: return FilterPluginInterface::FilterClass(FilterDocSampling::Sampling | FilterDocSampling::VertexColoring); + case FP_POINTCLOUD_SIMPLIFICATION : return FilterPluginInterface::FilterClass(FilterDocSampling::Sampling | FilterDocSampling::PointSet); default: assert(0); } return FilterClass(0); @@ -1396,7 +1398,7 @@ int FilterDocSampling::postCondition(const QAction* a ) const return MeshModel::MM_ALL; } -MeshFilterInterface::FILTER_ARITY FilterDocSampling::filterArity(const QAction * filter ) const +FilterPluginInterface::FILTER_ARITY FilterDocSampling::filterArity(const QAction * filter ) const { switch(ID(filter)) { @@ -1408,15 +1410,15 @@ MeshFilterInterface::FILTER_ARITY FilterDocSampling::filterArity(const QAction * case FP_REGULAR_RECURSIVE_SAMPLING : case FP_UNIFORM_MESH_RESAMPLING: case FP_POINTCLOUD_SIMPLIFICATION : - return MeshFilterInterface::SINGLE_MESH; + return FilterPluginInterface::SINGLE_MESH; case FP_DISTANCE_REFERENCE : case FP_HAUSDORFF_DISTANCE : case FP_POISSONDISK_SAMPLING : case FP_DISK_COLORING : case FP_VORONOI_COLORING : - return MeshFilterInterface::FIXED; + return FilterPluginInterface::FIXED; } - return MeshFilterInterface::NONE; + return FilterPluginInterface::NONE; } MESHLAB_PLUGIN_NAME_EXPORTER(FilterDocSampling) diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.h b/src/meshlabplugins/filter_sampling/filter_sampling.h index 003c710cd..d8c264e67 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.h +++ b/src/meshlabplugins/filter_sampling/filter_sampling.h @@ -23,13 +23,13 @@ #ifndef FILTERDOCSAMPLINGPLUGIN_H #define FILTERDOCSAMPLINGPLUGIN_H -#include +#include -class FilterDocSampling : public QObject, public MeshFilterInterface +class FilterDocSampling : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp index c9c33d300..ec1a334a5 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp @@ -26,6 +26,10 @@ #include #endif +#include +#include +#include + #include "filter_screened_poisson.h" #include "poisson_utils.h" @@ -77,14 +81,14 @@ QString FilterScreenedPoissonPlugin::filterInfo(FilterIDType filter) const } } -MeshFilterInterface::FilterClass FilterScreenedPoissonPlugin::getClass(const QAction* a) const +FilterPluginInterface::FilterClass FilterScreenedPoissonPlugin::getClass(const QAction* a) const { if (ID(a) == FP_SCREENED_POISSON){ - return FilterScreenedPoissonPlugin::FilterClass(MeshFilterInterface::Remeshing); + return FilterScreenedPoissonPlugin::FilterClass(FilterPluginInterface::Remeshing); } else { assert(0); - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } } @@ -223,7 +227,7 @@ int FilterScreenedPoissonPlugin::postCondition(const QAction* filter) const } -MeshFilterInterface::FILTER_ARITY FilterScreenedPoissonPlugin::filterArity(const QAction*) const +FilterPluginInterface::FILTER_ARITY FilterScreenedPoissonPlugin::filterArity(const QAction*) const { return VARIABLE; } diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h index 23157029d..0f68d14c6 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h @@ -24,13 +24,13 @@ #ifndef SAMPLEFILTERSPLUGIN_H #define SAMPLEFILTERSPLUGIN_H -#include +#include -class FilterScreenedPoissonPlugin : public QObject, public MeshFilterInterface +class FilterScreenedPoissonPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp index b18343723..9ad25d5a7 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp @@ -1095,9 +1095,9 @@ void SdfGpuPlugin::TraceRay(int peelingIteration,const Point3f& dir, MeshModel* checkGLError::debugInfo("Error during depth peeling"); } -MeshFilterInterface::FILTER_ARITY SdfGpuPlugin::filterArity(const QAction *) const +FilterPluginInterface::FILTER_ARITY SdfGpuPlugin::filterArity(const QAction *) const { - return MeshFilterInterface::SINGLE_MESH; + return FilterPluginInterface::SINGLE_MESH; } MESHLAB_PLUGIN_NAME_EXPORTER(SdfGpuPlugin) diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h index 3d209406e..97e9a29e7 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h @@ -3,7 +3,7 @@ #include -#include +#include #include #include @@ -11,11 +11,11 @@ enum ONPRIMITIVE{ON_VERTICES=0, ON_FACES=1}; -class SdfGpuPlugin : public QObject, public MeshFilterInterface +class SdfGpuPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: @@ -31,7 +31,7 @@ public: FilterClass getClass(const QAction *) const { - return MeshFilterInterface::VertexColoring; + return FilterPluginInterface::VertexColoring; } FILTER_ARITY filterArity(const QAction* act) const; diff --git a/src/meshlabplugins/filter_sdfgpu/filterinterface.h b/src/meshlabplugins/filter_sdfgpu/filterinterface.h index 1bcbe8d8c..93bfc311d 100644 --- a/src/meshlabplugins/filter_sdfgpu/filterinterface.h +++ b/src/meshlabplugins/filter_sdfgpu/filterinterface.h @@ -36,7 +36,7 @@ * Q_EXPORT_PLUGIN(SdfPlugin) * \endcode */ -class SingleMeshFilterInterface : public QObject, public MeshFilterInterface{ +class SingleMeshFilterInterface : public QObject, public FilterPluginInterface{ public: /** @@ -80,7 +80,7 @@ public: * plugin to the bottom of the list. */ virtual FilterClass getClass() const{ - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } /** diff --git a/src/meshlabplugins/filter_select/meshselect.cpp b/src/meshlabplugins/filter_select/meshselect.cpp index 6e1ab80ca..93b885002 100644 --- a/src/meshlabplugins/filter_select/meshselect.cpp +++ b/src/meshlabplugins/filter_select/meshselect.cpp @@ -29,6 +29,8 @@ #include #include +#include + using namespace vcg; // ERROR CHECKING UTILITY @@ -649,18 +651,18 @@ bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md, return true; } -MeshFilterInterface::FilterClass SelectionFilterPlugin::getClass(const QAction *action) const +FilterPluginInterface::FilterClass SelectionFilterPlugin::getClass(const QAction *action) const { switch(ID(action)) { - case CP_SELFINTERSECT_SELECT: return FilterClass(MeshFilterInterface::Selection + MeshFilterInterface::Cleaning); + case CP_SELFINTERSECT_SELECT: return FilterClass(FilterPluginInterface::Selection + FilterPluginInterface::Cleaning); - case CP_SELECT_TEXBORDER : return FilterClass(MeshFilterInterface::Selection + MeshFilterInterface::Texture); + case CP_SELECT_TEXBORDER : return FilterClass(FilterPluginInterface::Selection + FilterPluginInterface::Texture); case FP_SELECT_BY_FACE_QUALITY : - case FP_SELECT_BY_VERT_QUALITY : return FilterClass(MeshFilterInterface::Selection + MeshFilterInterface::Quality); + case FP_SELECT_BY_VERT_QUALITY : return FilterClass(FilterPluginInterface::Selection + FilterPluginInterface::Quality); - case FP_SELECTBYANGLE : return MeshFilterInterface::FilterClass(MeshFilterInterface::RangeMap + MeshFilterInterface::Selection); + case FP_SELECTBYANGLE : return FilterPluginInterface::FilterClass(FilterPluginInterface::RangeMap + FilterPluginInterface::Selection); case FP_SELECT_ALL : case FP_SELECT_NONE : @@ -681,9 +683,9 @@ MeshFilterInterface::FilterClass SelectionFilterPlugin::getClass(const QAction * case FP_SELECT_OUTLIER: case FP_SELECT_BY_COLOR: case CP_SELECT_NON_MANIFOLD_VERTEX: - case CP_SELECT_NON_MANIFOLD_FACE: return FilterClass(MeshFilterInterface::Selection); + case CP_SELECT_NON_MANIFOLD_FACE: return FilterClass(FilterPluginInterface::Selection); } - return MeshFilterInterface::Selection; + return FilterPluginInterface::Selection; } int SelectionFilterPlugin::getRequirements(const QAction *action) diff --git a/src/meshlabplugins/filter_select/meshselect.h b/src/meshlabplugins/filter_select/meshselect.h index a199ee96c..0727895fd 100644 --- a/src/meshlabplugins/filter_select/meshselect.h +++ b/src/meshlabplugins/filter_select/meshselect.h @@ -25,14 +25,14 @@ #define FILTER_SELECT_H #include -#include +#include -class SelectionFilterPlugin : public QObject, public MeshFilterInterface +class SelectionFilterPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: /* naming convention : diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp index 54e05cbec..2725af957 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp @@ -26,6 +26,9 @@ #include #include #include +#include +#include +#include #include #include "miniz.h" @@ -68,14 +71,14 @@ FilterSketchFabPlugin::FilterClass FilterSketchFabPlugin::getClass(const QAction { switch(ID(a)) { case FP_SKETCHFAB : - return MeshFilterInterface::Smoothing; + return FilterPluginInterface::Smoothing; default : assert(0); - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } } -MeshFilterInterface::FILTER_ARITY FilterSketchFabPlugin::filterArity(const QAction* a) const +FilterPluginInterface::FILTER_ARITY FilterSketchFabPlugin::filterArity(const QAction* a) const { switch(ID(a)) { case FP_SKETCHFAB : diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h index 75b74bef1..59d84bb00 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h @@ -24,14 +24,14 @@ #ifndef FILTERSKETCHFAB_H #define FILTERSKETCHFAB_H -#include +#include #include -class FilterSketchFabPlugin : public QObject, public MeshFilterInterface +class FilterSketchFabPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { FP_SKETCHFAB } ; diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp index 6b612cbe5..b3579e1ef 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp @@ -153,9 +153,9 @@ int FilterSSynth::postCondition(const QAction* /*filter*/) const return MeshModel::MM_NONE; } -MeshFilterInterface::FilterClass FilterSSynth::getClass(const QAction */*filter*/) const +FilterPluginInterface::FilterClass FilterSSynth::getClass(const QAction */*filter*/) const { - return MeshFilterInterface::MeshCreation; + return FilterPluginInterface::MeshCreation; } QList FilterSSynth::importFormats() const diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.h b/src/meshlabplugins/filter_ssynth/filter_ssynth.h index 6d2ba3991..061304a9a 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.h +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.h @@ -27,14 +27,13 @@ #include -#include -#include +#include #include -class FilterSSynth : public QObject,public IOPluginInterface, public MeshFilterInterface{ +class FilterSSynth : public QObject,public IOPluginInterface, public FilterPluginInterface{ Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface IOPluginInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface IOPluginInterface) public: enum {CR_SSYNTH} ; @@ -58,7 +57,7 @@ public: void initPreOpenParameter(const QString &formatName, const QString &filename, RichParameterList &parlst); bool open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList & par, vcg::CallBackPos *cb=0, QWidget *parent=0); bool save(const QString &formatName, const QString &fileName, MeshModel &m, const int mask, const RichParameterList &, vcg::CallBackPos *cb, QWidget *parent); - MeshFilterInterface::FILTER_ARITY filterArity(const QAction *) const {return NONE;} + FilterPluginInterface::FILTER_ARITY filterArity(const QAction *) const {return NONE;} private: QString ssynth(QString grammar,int maxdepth,int seed,vcg::CallBackPos *cb); QString GetTemplate(int sphereres); diff --git a/src/meshlabplugins/filter_texture/filter_texture.cpp b/src/meshlabplugins/filter_texture/filter_texture.cpp index ca97ea3ee..3de6cae90 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.cpp +++ b/src/meshlabplugins/filter_texture/filter_texture.cpp @@ -165,11 +165,11 @@ FilterTexturePlugin::FilterClass FilterTexturePlugin::getClass(const QAction *a) case FP_PLANAR_MAPPING : case FP_SET_TEXTURE : case FP_COLOR_TO_TEXTURE : - case FP_TRANSFER_TO_TEXTURE : return MeshFilterInterface::Texture; - case FP_TEX_TO_VCOLOR_TRANSFER : return FilterClass(MeshFilterInterface::VertexColoring + MeshFilterInterface::Texture); + case FP_TRANSFER_TO_TEXTURE : return FilterPluginInterface::Texture; + case FP_TEX_TO_VCOLOR_TRANSFER : return FilterClass(FilterPluginInterface::VertexColoring + FilterPluginInterface::Texture); default : assert(0); } - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } static QString extractFilenameWOExt(MeshModel* mm) @@ -1109,7 +1109,7 @@ bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, c return true; } -MeshFilterInterface::FILTER_ARITY FilterTexturePlugin::filterArity(const QAction * filter ) const +FilterPluginInterface::FILTER_ARITY FilterTexturePlugin::filterArity(const QAction * filter ) const { switch(ID(filter)) { @@ -1120,12 +1120,12 @@ MeshFilterInterface::FILTER_ARITY FilterTexturePlugin::filterArity(const QAction case FP_PLANAR_MAPPING : case FP_SET_TEXTURE : case FP_COLOR_TO_TEXTURE : - return MeshFilterInterface::SINGLE_MESH; + return FilterPluginInterface::SINGLE_MESH; case FP_TRANSFER_TO_TEXTURE : case FP_TEX_TO_VCOLOR_TRANSFER : - return MeshFilterInterface::FIXED; + return FilterPluginInterface::FIXED; } - return MeshFilterInterface::NONE; + return FilterPluginInterface::NONE; } diff --git a/src/meshlabplugins/filter_texture/filter_texture.h b/src/meshlabplugins/filter_texture/filter_texture.h index 2ba11707a..f1ed10b7a 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.h +++ b/src/meshlabplugins/filter_texture/filter_texture.h @@ -28,17 +28,17 @@ #include #include -#include +#include #include #include #include #include -class FilterTexturePlugin : public QObject, public MeshFilterInterface +class FilterTexturePlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp index 9531001d4..d1ebc5c7e 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp @@ -174,11 +174,11 @@ QString TriOptimizePlugin::pluginName() const TriOptimizePlugin::FilterClass TriOptimizePlugin::getClass(const QAction *action) const { switch(ID(action)) { - case FP_PLANAR_EDGE_FLIP: return MeshFilterInterface::Remeshing; - case FP_CURVATURE_EDGE_FLIP: return MeshFilterInterface::Remeshing; - case FP_NEAR_LAPLACIAN_SMOOTH: return MeshFilterInterface::Smoothing; + case FP_PLANAR_EDGE_FLIP: return FilterPluginInterface::Remeshing; + case FP_CURVATURE_EDGE_FLIP: return FilterPluginInterface::Remeshing; + case FP_NEAR_LAPLACIAN_SMOOTH: return FilterPluginInterface::Smoothing; } - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } int TriOptimizePlugin::postCondition(const QAction *a) const diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h index 26da938d9..a9ea5e7d6 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h @@ -25,13 +25,13 @@ #define TRIOPTIMIZEFILTERSPLUGIN_H #include -#include +#include -class TriOptimizePlugin : public QObject, public MeshFilterInterface +class TriOptimizePlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp index f36ebc3c9..d1a8a4cbf 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp @@ -186,7 +186,7 @@ QString FilterUnsharp::filterInfo(FilterIDType filterId) const switch(ID(a)) { case FP_CREASE_CUT : - return MeshFilterInterface::FilterClass( MeshFilterInterface::Normal | MeshFilterInterface::Remeshing); + return FilterPluginInterface::FilterClass( FilterPluginInterface::Normal | FilterPluginInterface::Remeshing); case FP_SD_LAPLACIAN_SMOOTH: case FP_HC_LAPLACIAN_SMOOTH: case FP_LAPLACIAN_SMOOTH: @@ -200,20 +200,20 @@ QString FilterUnsharp::filterInfo(FilterIDType filterId) const case FP_UNSHARP_GEOMETRY: case FP_UNSHARP_QUALITY: case FP_LINEAR_MORPH : - return MeshFilterInterface::Smoothing; + return FilterPluginInterface::Smoothing; case FP_UNSHARP_VERTEX_COLOR: - return MeshFilterInterface::FilterClass( MeshFilterInterface::Smoothing | MeshFilterInterface::VertexColoring); + return FilterPluginInterface::FilterClass( FilterPluginInterface::Smoothing | FilterPluginInterface::VertexColoring); case FP_RECOMPUTE_FACE_NORMAL : case FP_RECOMPUTE_QUADFACE_NORMAL : case FP_RECOMPUTE_VERTEX_NORMAL : case FP_FACE_NORMAL_NORMALIZE: case FP_VERTEX_NORMAL_NORMALIZE: - return MeshFilterInterface::Normal; - case FP_SCALAR_HARMONIC_FIELD: return MeshFilterInterface::Remeshing; + return FilterPluginInterface::Normal; + case FP_SCALAR_HARMONIC_FIELD: return FilterPluginInterface::Remeshing; - default : return MeshFilterInterface::Generic; + default : return FilterPluginInterface::Generic; } } int FilterUnsharp::getPreConditions(const QAction *a) const @@ -785,7 +785,7 @@ bool FilterUnsharp::applyFilter(const QAction *filter, MeshDocument &md, const R return true; } -MeshFilterInterface::FILTER_ARITY FilterUnsharp::filterArity(const QAction * filter ) const +FilterPluginInterface::FILTER_ARITY FilterUnsharp::filterArity(const QAction * filter ) const { switch(ID(filter)) { @@ -809,11 +809,11 @@ MeshFilterInterface::FILTER_ARITY FilterUnsharp::filterArity(const QAction * fil case FP_RECOMPUTE_FACE_NORMAL: case FP_RECOMPUTE_QUADFACE_NORMAL: case FP_SCALAR_HARMONIC_FIELD: - return MeshFilterInterface::SINGLE_MESH; + return FilterPluginInterface::SINGLE_MESH; case FP_LINEAR_MORPH : - return MeshFilterInterface::FIXED; + return FilterPluginInterface::FIXED; } - return MeshFilterInterface::NONE; + return FilterPluginInterface::NONE; } diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.h b/src/meshlabplugins/filter_unsharp/filter_unsharp.h index 2f42176cc..ee03de328 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.h +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.h @@ -24,14 +24,14 @@ #define FilterUnsharp_PLUGIN_H #include -#include +#include -class FilterUnsharp : public QObject, public MeshFilterInterface +class FilterUnsharp : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: /* naming convention : diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp index 9ff3050e3..4bacd9540 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp @@ -101,20 +101,20 @@ FilterVoronoiPlugin::FilterClass FilterVoronoiPlugin::getClass(const QAction* a) case VORONOI_SAMPLING : case VOLUME_SAMPLING: case VORONOI_SCAFFOLDING: - return MeshFilterInterface::Sampling; + return FilterPluginInterface::Sampling; case BUILD_SHELL: - return MeshFilterInterface::Remeshing; + return FilterPluginInterface::Remeshing; case CROSS_FIELD_CREATION: - return MeshFilterInterface::Normal; + return FilterPluginInterface::Normal; // case CROSS_FIELD_SMOOTHING: // return MeshFilterInterface::Smoothing; default : assert(0); - return MeshFilterInterface::Generic; + return FilterPluginInterface::Generic; } } -MeshFilterInterface::FILTER_ARITY FilterVoronoiPlugin::filterArity(const QAction* a) const +FilterPluginInterface::FILTER_ARITY FilterVoronoiPlugin::filterArity(const QAction* a) const { switch(ID(a)) { case VORONOI_SAMPLING : diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.h b/src/meshlabplugins/filter_voronoi/filter_voronoi.h index 6edee9ebc..6db844051 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.h +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.h @@ -24,13 +24,13 @@ #ifndef FILTER_VORONOI_H #define FILTER_VORONOI_H -#include +#include -class FilterVoronoiPlugin : public QObject, public MeshFilterInterface +class FilterVoronoiPlugin : public QObject, public FilterPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) - Q_INTERFACES(MeshFilterInterface) + MESHLAB_PLUGIN_IID_EXPORTER(FILTER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(FilterPluginInterface) public: enum { diff --git a/src/meshlabplugins/io_3ds/meshio.h b/src/meshlabplugins/io_3ds/meshio.h index cb63aa055..110b161c9 100644 --- a/src/meshlabplugins/io_3ds/meshio.h +++ b/src/meshlabplugins/io_3ds/meshio.h @@ -32,7 +32,7 @@ class ExtraMeshIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) + MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID) Q_INTERFACES(IOPluginInterface) diff --git a/src/meshlabplugins/io_base/baseio.h b/src/meshlabplugins/io_base/baseio.h index b92762168..ed284a0a6 100644 --- a/src/meshlabplugins/io_base/baseio.h +++ b/src/meshlabplugins/io_base/baseio.h @@ -29,7 +29,7 @@ class BaseMeshIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) + MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID) Q_INTERFACES(IOPluginInterface) diff --git a/src/meshlabplugins/io_bre/io_bre.h b/src/meshlabplugins/io_bre/io_bre.h index 90a90bc05..f9cb3b373 100644 --- a/src/meshlabplugins/io_bre/io_bre.h +++ b/src/meshlabplugins/io_bre/io_bre.h @@ -153,7 +153,7 @@ namespace io { class BreMeshIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) + MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID) Q_INTERFACES(IOPluginInterface) public: diff --git a/src/meshlabplugins/io_collada/io_collada.h b/src/meshlabplugins/io_collada/io_collada.h index fffccf15a..82bb7aceb 100644 --- a/src/meshlabplugins/io_collada/io_collada.h +++ b/src/meshlabplugins/io_collada/io_collada.h @@ -50,7 +50,7 @@ class ColladaIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) + MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID) Q_INTERFACES(IOPluginInterface) public: diff --git a/src/meshlabplugins/io_ctm/io_ctm.h b/src/meshlabplugins/io_ctm/io_ctm.h index eeeb0a23d..dc0e1b013 100644 --- a/src/meshlabplugins/io_ctm/io_ctm.h +++ b/src/meshlabplugins/io_ctm/io_ctm.h @@ -37,7 +37,7 @@ class IOMPlugin : public QObject, public IOPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) + MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID) Q_INTERFACES(IOPluginInterface) diff --git a/src/meshlabplugins/io_expe/io_expe.h b/src/meshlabplugins/io_expe/io_expe.h index 679cb8960..17cbd9cb2 100644 --- a/src/meshlabplugins/io_expe/io_expe.h +++ b/src/meshlabplugins/io_expe/io_expe.h @@ -32,7 +32,7 @@ class ExpeIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) + MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID) Q_INTERFACES(IOPluginInterface) diff --git a/src/meshlabplugins/io_json/io_json.h b/src/meshlabplugins/io_json/io_json.h index 80032ad1c..333286cca 100644 --- a/src/meshlabplugins/io_json/io_json.h +++ b/src/meshlabplugins/io_json/io_json.h @@ -29,7 +29,7 @@ class JSONIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) + MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID) Q_INTERFACES(IOPluginInterface) public: diff --git a/src/meshlabplugins/io_pdb/io_pdb.h b/src/meshlabplugins/io_pdb/io_pdb.h index 11e9fff15..d211d9867 100644 --- a/src/meshlabplugins/io_pdb/io_pdb.h +++ b/src/meshlabplugins/io_pdb/io_pdb.h @@ -30,7 +30,7 @@ class PDBIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) + MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID) Q_INTERFACES(IOPluginInterface) diff --git a/src/meshlabplugins/io_tri/io_tri.h b/src/meshlabplugins/io_tri/io_tri.h index 5f919fc79..6b3615a05 100755 --- a/src/meshlabplugins/io_tri/io_tri.h +++ b/src/meshlabplugins/io_tri/io_tri.h @@ -37,7 +37,7 @@ class TriIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) + MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID) Q_INTERFACES(IOPluginInterface) diff --git a/src/meshlabplugins/io_txt/io_txt.h b/src/meshlabplugins/io_txt/io_txt.h index bf0e0638b..5bcd8b725 100755 --- a/src/meshlabplugins/io_txt/io_txt.h +++ b/src/meshlabplugins/io_txt/io_txt.h @@ -31,7 +31,7 @@ class TxtIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) + MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID) Q_INTERFACES(IOPluginInterface) diff --git a/src/meshlabplugins/io_u3d/io_u3d.h b/src/meshlabplugins/io_u3d/io_u3d.h index 17238a2c5..33b175fad 100644 --- a/src/meshlabplugins/io_u3d/io_u3d.h +++ b/src/meshlabplugins/io_u3d/io_u3d.h @@ -36,7 +36,7 @@ class U3DIOPlugin : public QObject, public IOPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) + MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID) Q_INTERFACES(IOPluginInterface) public: diff --git a/src/meshlabplugins/io_x3d/io_x3d.h b/src/meshlabplugins/io_x3d/io_x3d.h index c1c7b2247..03ccb6682 100644 --- a/src/meshlabplugins/io_x3d/io_x3d.h +++ b/src/meshlabplugins/io_x3d/io_x3d.h @@ -40,7 +40,7 @@ class IoX3DPlugin : public QObject, public IOPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_IO_INTERFACE_IID) + MESHLAB_PLUGIN_IID_EXPORTER(IO_PLUGIN_INTERFACE_IID) Q_INTERFACES(IOPluginInterface) diff --git a/src/meshlabserver/mainserver.cpp b/src/meshlabserver/mainserver.cpp index 0a53753b8..592523489 100644 --- a/src/meshlabserver/mainserver.cpp +++ b/src/meshlabserver/mainserver.cpp @@ -89,7 +89,7 @@ public: void dumpPluginInfoWiki(FILE *fp) { if(!fp) return; - foreach(MeshFilterInterface *iFilter, PM.meshFilterPlugins()) + foreach(FilterPluginInterface *iFilter, PM.meshFilterPlugins()) foreach(QAction *filterAction, iFilter->actions()) fprintf(fp, "*%s
    %s
    \n", qUtf8Printable(filterAction->text()), qUtf8Printable(iFilter->filterInfo(filterAction))); } @@ -102,7 +102,7 @@ public: fprintf(fp,"/*! \\mainpage MeshLab Filter Documentation\n"); //fprintf(fp,"\\AtBeginDocument{\\setcounter{tocdepth}{1}}"); - foreach(MeshFilterInterface *iFilter, PM.meshFilterPlugins()) + foreach(FilterPluginInterface *iFilter, PM.meshFilterPlugins()) { foreach(QAction *filterAction, iFilter->actions()) { @@ -585,7 +585,7 @@ public: return false; } - MeshFilterInterface *iFilter = qobject_cast(action->parent()); + FilterPluginInterface *iFilter = qobject_cast(action->parent()); iFilter->setLog(&log); int req = iFilter->getRequirements(action); if (mm != NULL) @@ -644,7 +644,7 @@ public: atts[MLRenderingData::ATT_NAMES::ATT_VERTPOSITION] = true; atts[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL] = true; - if (iFilter->filterArity(action) == MeshFilterInterface::SINGLE_MESH) + if (iFilter->filterArity(action) == FilterPluginInterface::SINGLE_MESH) { MLRenderingData::PRIMITIVE_MODALITY pm = MLPoliciesStandAloneFunctions::bestPrimitiveModalityAccordingToMesh(meshDocument.mm()); if ((pm != MLRenderingData::PR_ARITY) && (meshDocument.mm() != NULL)) From d7d97469364eec6ae38c011cba940b4a1e124284 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 18 Sep 2020 14:49:25 +0200 Subject: [PATCH 31/49] render_plugin_interface.h --- src/common/CMakeLists.txt | 1 + src/common/common.pro | 1 + src/common/interfaces.h | 33 --------- .../interfaces/render_plugin_interface.h | 70 +++++++++++++++++++ src/common/pluginmanager.cpp | 2 +- src/common/pluginmanager.h | 5 +- src/meshlab/glarea.h | 6 +- src/meshlab/mainwindow_Init.cpp | 2 +- src/meshlab/mainwindow_RunTime.cpp | 2 +- src/meshlab/plugindialog.cpp | 4 +- src/meshlabplugins/render_gdp/meshrender.h | 8 +-- .../radianceScalingRenderer.h | 8 +-- 12 files changed, 91 insertions(+), 51 deletions(-) create mode 100644 src/common/interfaces/render_plugin_interface.h diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index a45dfd98f..3438e61fe 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -38,6 +38,7 @@ set(HEADERS interfaces/plugin_interface.h interfaces/filter_plugin_interface.h interfaces/io_plugin_interface.h + interfaces/render_plugin_interface.h GLExtensionsManager.h GLLogStream.h filterscript.h diff --git a/src/common/common.pro b/src/common/common.pro index 7835dddb2..df95dd3fb 100644 --- a/src/common/common.pro +++ b/src/common/common.pro @@ -52,6 +52,7 @@ HEADERS += \ interfaces/io_plugin_interface.h \ interfaces/mainwindow_interface.h \ interfaces/plugin_interface.h \ + interfaces/render_plugin_interface.h \ ml_mesh_type.h \ meshmodel.h \ pluginmanager.h \ diff --git a/src/common/interfaces.h b/src/common/interfaces.h index be5251036..c0d966f00 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -52,37 +52,6 @@ class GLAreaReg; class MeshModel; -/** -Used to customized the rendering process. -Rendering plugins are now responsible of the rendering of the whole MeshDocument and not only of a single MeshModel. - -The Render function is called in with the ModelView and Projection Matrices already set up, screen cleared and background drawn. -After the Render call the MeshLab frawework draw on the opengl context other decorations and the trackball, so it there is the -requirement for a rendering plugin is that it should leave the z-buffer in a coherent state. - -The typical rendering loop of a Render plugin is something like, : - - - -foreach(MeshModel * mp, meshDoc.meshList) -{ -if(mp->visible) mp->Render(rm.drawMode,rm.colorMode,rm.textureMode); -} - -*/ - -class MeshRenderInterface : public PluginInterface -{ -public: - MeshRenderInterface() :PluginInterface() {} - virtual ~MeshRenderInterface() {} - - virtual void Init(QAction *, MeshDocument &, MLSceneGLSharedDataContext::PerMeshRenderingDataMap& /*mp*/, GLArea *) {} - virtual void Render(QAction *, MeshDocument &, MLSceneGLSharedDataContext::PerMeshRenderingDataMap& mp, GLArea *) = 0; - virtual void Finalize(QAction *, MeshDocument *, GLArea *) {} - virtual bool isSupported() = 0; - virtual QList actions() = 0; -}; /** MeshDecorateInterface is the base class of all decorators Decorators are 'read-only' visualization aids that helps to show some data about a document. @@ -285,12 +254,10 @@ public: #define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x) #define MESHLAB_PLUGIN_NAME_EXPORTER(x) -#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_EDIT_INTERFACE_FACTORY_IID "vcg.meshlab.MeshEditInterfaceFactory/1.0" -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_EDIT_INTERFACE_FACTORY_IID) diff --git a/src/common/interfaces/render_plugin_interface.h b/src/common/interfaces/render_plugin_interface.h new file mode 100644 index 000000000..e4b0ba30c --- /dev/null +++ b/src/common/interfaces/render_plugin_interface.h @@ -0,0 +1,70 @@ +/**************************************************************************** +* MeshLab o o * +* A versatile mesh processing toolbox o o * +* _ O _ * +* Copyright(C) 2005-2020 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ + +#ifndef MESHLAB_RENDER_PLUGIN_INTERFACE_H +#define MESHLAB_RENDER_PLUGIN_INTERFACE_H + +#include "plugin_interface.h" +#include "../ml_shared_data_context.h" + +/** +Used to customized the rendering process. +Rendering plugins are now responsible of the rendering of the whole MeshDocument and not only of a single MeshModel. + +The Render function is called in with the ModelView and Projection Matrices already set up, screen cleared and background drawn. +After the Render call the MeshLab frawework draw on the opengl context other decorations and the trackball, so it there is the +requirement for a rendering plugin is that it should leave the z-buffer in a coherent state. + +The typical rendering loop of a Render plugin is something like, : + + + +foreach(MeshModel * mp, meshDoc.meshList) +{ +if(mp->visible) mp->Render(rm.drawMode,rm.colorMode,rm.textureMode); +} + +*/ + +class GLArea; + +class RenderPluginInterface : public PluginInterface +{ +public: + RenderPluginInterface() :PluginInterface() {} + virtual ~RenderPluginInterface() {} + + virtual void Init(QAction *, MeshDocument &, MLSceneGLSharedDataContext::PerMeshRenderingDataMap& /*mp*/, GLArea *) {} + virtual void Render(QAction *, MeshDocument &, MLSceneGLSharedDataContext::PerMeshRenderingDataMap& mp, GLArea *) = 0; + virtual void Finalize(QAction *, MeshDocument *, GLArea *) {} + virtual bool isSupported() = 0; + virtual QList actions() = 0; +}; + +#define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x) +#define MESHLAB_PLUGIN_NAME_EXPORTER(x) + +#define RENDER_PLUGIN_INTERFACE_IID "vcg.meshlab.RenderPluginInterface/1.0" +Q_DECLARE_INTERFACE(RenderPluginInterface, RENDER_PLUGIN_INTERFACE_IID) + +#endif // MESHLAB_RENDER_PLUGIN_INTERFACE_H diff --git a/src/common/pluginmanager.cpp b/src/common/pluginmanager.cpp index 1384a5d38..b86ee7aa1 100644 --- a/src/common/pluginmanager.cpp +++ b/src/common/pluginmanager.cpp @@ -127,7 +127,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl } } - MeshRenderInterface *iRender = qobject_cast(plugin); + RenderPluginInterface *iRender = qobject_cast(plugin); if (iRender) { iCommon = iRender; diff --git a/src/common/pluginmanager.h b/src/common/pluginmanager.h index ae70da109..c8bf2b986 100644 --- a/src/common/pluginmanager.h +++ b/src/common/pluginmanager.h @@ -27,6 +27,7 @@ #include "interfaces.h" #include "interfaces/filter_plugin_interface.h" #include "interfaces/io_plugin_interface.h" +#include "interfaces/render_plugin_interface.h" //#include "scriptsyntax.h" #include @@ -47,7 +48,7 @@ public: int numberIOPlugins() const; inline QVector& meshFilterPlugins() {return meshFilterPlug;} - inline QVector& meshRenderPlugins() {return meshRenderPlug;} + inline QVector& meshRenderPlugins() {return meshRenderPlug;} inline QVector& meshDecoratePlugins() {return meshDecoratePlug;} inline QVector& meshEditFactoryPlugins() {return meshEditInterfacePlug;} @@ -68,7 +69,7 @@ public: QVector meshIOPlug; QVector meshFilterPlug; - QVector meshRenderPlug; + QVector meshRenderPlug; QVector meshDecoratePlug; QVector meshEditInterfacePlug; QVector editActionList; diff --git a/src/meshlab/glarea.h b/src/meshlab/glarea.h index b124bc401..9fe65b34e 100644 --- a/src/meshlab/glarea.h +++ b/src/meshlab/glarea.h @@ -192,8 +192,8 @@ public: QList iPerDocDecoratorlist; QList &iCurPerMeshDecoratorList() { assert(this->md()->mm()) ; return iPerMeshDecoratorsListMap[this->md()->mm()->id()]; } - void setRenderer(MeshRenderInterface *rend, QAction *shader){ iRenderer = rend; currentShader = shader;} - MeshRenderInterface * getRenderer() { return iRenderer; } + void setRenderer(RenderPluginInterface *rend, QAction *shader){ iRenderer = rend; currentShader = shader;} + RenderPluginInterface * getRenderer() { return iRenderer; } QAction* getCurrentShaderAction() {return currentShader;} @@ -445,7 +445,7 @@ private: vcg::Point2i pointToPick; //shader support - MeshRenderInterface *iRenderer; + RenderPluginInterface *iRenderer; QAction *currentShader; QAction *lastFilterRef; // reference to last filter applied QFont qFont; //font settings diff --git a/src/meshlab/mainwindow_Init.cpp b/src/meshlab/mainwindow_Init.cpp index 27b323686..ec1db42be 100644 --- a/src/meshlab/mainwindow_Init.cpp +++ b/src/meshlab/mainwindow_Init.cpp @@ -836,7 +836,7 @@ void MainWindow::fillRenderMenu() qaNone->setCheckable(false); shadersMenu->addAction(qaNone); connect(qaNone, SIGNAL(triggered()), this, SLOT(applyRenderMode())); - foreach(MeshRenderInterface *iRender, PM.meshRenderPlugins()) + foreach(RenderPluginInterface *iRender, PM.meshRenderPlugins()) { addToMenu(iRender->actions(), shadersMenu, SLOT(applyRenderMode())); } diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index 78e018030..0eaf98250 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -1401,7 +1401,7 @@ void MainWindow::applyRenderMode() GLA()->setRenderer(NULL,NULL); } // Make the call to the plugin core - MeshRenderInterface *iRenderTemp = qobject_cast(action->parent()); + RenderPluginInterface *iRenderTemp = qobject_cast(action->parent()); bool initsupport = false; if (currentViewContainer() == NULL) diff --git a/src/meshlab/plugindialog.cpp b/src/meshlab/plugindialog.cpp index b7124250a..02c608a94 100644 --- a/src/meshlab/plugindialog.cpp +++ b/src/meshlab/plugindialog.cpp @@ -145,7 +145,7 @@ void PluginDialog::populateTreeWidget(const QString &path,const QStringList &fil foreach(QAction *a,iFilter->actions()){Templist.push_back(a->text());} addItems(pluginItem,Templist); } - MeshRenderInterface *iRender = qobject_cast(plugin); + RenderPluginInterface *iRender = qobject_cast(plugin); if (iRender){ QStringList Templist; foreach(QAction *a,iRender->actions()){Templist.push_back(a->text());} @@ -212,7 +212,7 @@ void PluginDialog::displayInfo(QTreeWidgetItem* item,int /* ncolumn*/) foreach(QAction *a,iFilter->actions()) if (actionName==a->text()) labelInfo->setText(iFilter->filterInfo(iFilter->ID(a))); } - MeshRenderInterface *iRender = qobject_cast(plugin); + RenderPluginInterface *iRender = qobject_cast(plugin); if (iRender){ } MeshEditInterfaceFactory *iEditFactory = qobject_cast(plugin); diff --git a/src/meshlabplugins/render_gdp/meshrender.h b/src/meshlabplugins/render_gdp/meshrender.h index b0cbb8228..aeb9ad289 100644 --- a/src/meshlabplugins/render_gdp/meshrender.h +++ b/src/meshlabplugins/render_gdp/meshrender.h @@ -25,17 +25,17 @@ #define SHADERRENDERPLUGIN_H #include -#include +#include #include "textfile.h" #include "shaderStructs.h" #include "shaderDialog.h" -class MeshShaderRenderPlugin : public QObject, public MeshRenderInterface +class MeshShaderRenderPlugin : public QObject, public RenderPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_RENDER_INTERFACE_IID) - Q_INTERFACES(MeshRenderInterface) + MESHLAB_PLUGIN_IID_EXPORTER(RENDER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(RenderPluginInterface) GLhandleARB v; GLhandleARB f; diff --git a/src/meshlabplugins/render_radiance_scaling/radianceScalingRenderer.h b/src/meshlabplugins/render_radiance_scaling/radianceScalingRenderer.h index 424a963b3..d245319a9 100644 --- a/src/meshlabplugins/render_radiance_scaling/radianceScalingRenderer.h +++ b/src/meshlabplugins/render_radiance_scaling/radianceScalingRenderer.h @@ -24,7 +24,7 @@ #define RADIANCESCALINGRENDERER_H #include -#include +#include #include #include @@ -35,10 +35,10 @@ #include "framebufferObject.h" #include "texture2D.h" -class RadianceScalingRendererPlugin : public QObject, public MeshRenderInterface { +class RadianceScalingRendererPlugin : public QObject, public RenderPluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_RENDER_INTERFACE_IID) - Q_INTERFACES(MeshRenderInterface) + MESHLAB_PLUGIN_IID_EXPORTER(RENDER_PLUGIN_INTERFACE_IID) + Q_INTERFACES(RenderPluginInterface) bool _supported; QList _actionList; From 3f172b9f410bdcaa58d69df7d6f5ff7741536688 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 18 Sep 2020 15:17:15 +0200 Subject: [PATCH 32/49] decorate_plugin_interface.h and fix last commit --- src/common/common.pro | 1 + src/common/interfaces.h | 117 -------------- .../interfaces/decorate_plugin_interface.h | 153 ++++++++++++++++++ src/common/pluginmanager.cpp | 6 +- src/common/pluginmanager.h | 7 +- src/meshlab/glarea.cpp | 18 +-- src/meshlab/glarea.h | 4 +- src/meshlab/layerDialog.cpp | 4 +- src/meshlab/layerDialog.h | 2 +- src/meshlab/mainwindow_Init.cpp | 4 +- src/meshlab/mainwindow_RunTime.cpp | 2 +- src/meshlab/plugindialog.cpp | 7 +- .../decorate_background/decorate_background.h | 13 +- .../decorate_base/decorate_base.h | 10 +- .../decorate_raster_proj.h | 9 +- .../decorate_shadow/decorate_shader.h | 2 +- .../decorate_shadow/decorate_shadow.h | 10 +- 17 files changed, 208 insertions(+), 161 deletions(-) create mode 100644 src/common/interfaces/decorate_plugin_interface.h diff --git a/src/common/common.pro b/src/common/common.pro index df95dd3fb..c57132938 100644 --- a/src/common/common.pro +++ b/src/common/common.pro @@ -48,6 +48,7 @@ HEADERS += \ filterscript.h \ GLLogStream.h \ interfaces.h \ + interfaces/decorate_plugin_interface.h \ interfaces/filter_plugin_interface.h \ interfaces/io_plugin_interface.h \ interfaces/mainwindow_interface.h \ diff --git a/src/common/interfaces.h b/src/common/interfaces.h index c0d966f00..45a141674 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -52,121 +52,6 @@ class GLAreaReg; class MeshModel; -/** -MeshDecorateInterface is the base class of all decorators -Decorators are 'read-only' visualization aids that helps to show some data about a document. -Decorators can make some permesh precomputation but the rendering has to be efficient. -Decorators should save the additional data into per-mesh attribute. - - -There are two classes of Decorations -- PerMesh -- PerDocument - -PerMesh Decorators are associated to each mesh/view -Some example of PerDocument Decorations -- backgrounds -- trackball icon -- axis -- shadows -- screen space Ambient occlusion (think it as a generic 'darkner') - -Some example of PerMesh Decorations -- coloring of selected vertex/face -- displaying of normals/curvature directions -- display of specific tagging -*/ - -class MeshDecorateInterface : public PluginInterface -{ -public: - - /** The DecorationClass enum represents the set of keywords that must be used to categorize a filter. - Each filter can belong to one or more filtering class, or-ed together. - */ - enum DecorationClass - { - Generic = 0x00000, /*!< Should be avoided if possible. */ // - PerMesh = 0x00001, /*!< Decoration that are applied on a single mesh */ - PerDocument = 0x00002, /*!< Decoration that are applied on a single mesh */ - PreRendering = 0x00004, /*!< Decoration that are applied before the rendering of the document/mesh */ - PostRendering = 0x00008 /*!< Decoration that are applied after the rendering of the document/mesh */ - }; - - MeshDecorateInterface() : PluginInterface() {} - virtual ~MeshDecorateInterface() {} - /** The very short string (a few words) describing each filtering action - // This string is used also to define the menu entry - */ - virtual QString decorationName(FilterIDType) const = 0; - virtual QString decorationInfo(FilterIDType) const = 0; - - virtual QString decorationName(QAction *a) const { return decorationName(ID(a)); } - virtual QString decorationInfo(QAction *a) const { return decorationInfo(ID(a)); } - - - virtual bool startDecorate(QAction *, MeshDocument &, const RichParameterList *, GLArea *) { return false; } - virtual bool startDecorate(QAction *, MeshModel &, const RichParameterList *, GLArea *) { return false; } - virtual void decorateMesh(QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &) = 0; - virtual void decorateDoc(QAction *, MeshDocument &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &) = 0; - virtual void endDecorate(QAction *, MeshModel &, const RichParameterList *, GLArea *) {} - virtual void endDecorate(QAction *, MeshDocument &, const RichParameterList *, GLArea *) {} - - /** \brief tests if a decoration is applicable to a mesh. - * used only for PerMesh Decorators. - For instance curvature cannot be shown on a mesh without curvature. - On failure (returning false) the function fills the MissingItems list with strings describing the missing items. - It is invoked only for decoration of \i PerMesh class; - */ - virtual bool isDecorationApplicable(QAction *, const MeshModel&, QString&) const { return true; } - - virtual int getDecorationClass(QAction *) const = 0; - - virtual QList actions() const { return actionList; } - virtual QList types() const { return typeList; } -protected: - QList actionList; - QList typeList; - virtual FilterIDType ID(QAction *a) const - { - QString aa=a->text(); - foreach(FilterIDType tt, types()) - if (a->text() == this->decorationName(tt)) return tt; - aa.replace("&",""); - foreach(FilterIDType tt, types()) - if (aa == this->decorationName(tt)) return tt; - - qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(a->text())); - assert(0); - return -1; - } - virtual FilterIDType ID(QString name) const - { - QString n = name; - foreach(FilterIDType tt, types()) - if (name == this->decorationName(tt)) return tt; - n.replace("&",""); - foreach(FilterIDType tt, types()) - if (n == this->decorationName(tt)) return tt; - - qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name)); - assert(0); - return -1; - } -public: - virtual QAction *action(QString name) const - { - QString n = name; - foreach(QAction *tt, actions()) - if (name == this->decorationName(ID(tt))) return tt; - n.replace("&",""); - foreach(QAction *tt, actions()) - if (n == this->decorationName(ID(tt))) return tt; - - qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name)); - return 0; - } -}; /* @@ -254,11 +139,9 @@ public: #define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x) #define MESHLAB_PLUGIN_NAME_EXPORTER(x) -#define MESH_DECORATE_INTERFACE_IID "vcg.meshlab.MeshDecorateInterface/1.0" #define MESH_EDIT_INTERFACE_IID "vcg.meshlab.MeshEditInterface/1.0" #define MESH_EDIT_INTERFACE_FACTORY_IID "vcg.meshlab.MeshEditInterfaceFactory/1.0" -Q_DECLARE_INTERFACE(MeshDecorateInterface, MESH_DECORATE_INTERFACE_IID) Q_DECLARE_INTERFACE(MeshEditInterface, MESH_EDIT_INTERFACE_IID) Q_DECLARE_INTERFACE(MeshEditInterfaceFactory, MESH_EDIT_INTERFACE_FACTORY_IID) diff --git a/src/common/interfaces/decorate_plugin_interface.h b/src/common/interfaces/decorate_plugin_interface.h new file mode 100644 index 000000000..2fdce7237 --- /dev/null +++ b/src/common/interfaces/decorate_plugin_interface.h @@ -0,0 +1,153 @@ +/**************************************************************************** +* MeshLab o o * +* A versatile mesh processing toolbox o o * +* _ O _ * +* Copyright(C) 2005-2020 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ + +#ifndef MESHLAB_DECORATE_PLUGIN_INTERFACE_H +#define MESHLAB_DECORATE_PLUGIN_INTERFACE_H + +#include "plugin_interface.h" + +class GLArea; + +/** +MeshDecorateInterface is the base class of all decorators +Decorators are 'read-only' visualization aids that helps to show some data about a document. +Decorators can make some permesh precomputation but the rendering has to be efficient. +Decorators should save the additional data into per-mesh attribute. + + +There are two classes of Decorations +- PerMesh +- PerDocument + +PerMesh Decorators are associated to each mesh/view +Some example of PerDocument Decorations +- backgrounds +- trackball icon +- axis +- shadows +- screen space Ambient occlusion (think it as a generic 'darkner') + +Some example of PerMesh Decorations +- coloring of selected vertex/face +- displaying of normals/curvature directions +- display of specific tagging +*/ + +class DecoratePluginInterface : public PluginInterface +{ +public: + + /** The DecorationClass enum represents the set of keywords that must be used to categorize a filter. + Each filter can belong to one or more filtering class, or-ed together. + */ + enum DecorationClass + { + Generic = 0x00000, /*!< Should be avoided if possible. */ // + PerMesh = 0x00001, /*!< Decoration that are applied on a single mesh */ + PerDocument = 0x00002, /*!< Decoration that are applied on a single mesh */ + PreRendering = 0x00004, /*!< Decoration that are applied before the rendering of the document/mesh */ + PostRendering = 0x00008 /*!< Decoration that are applied after the rendering of the document/mesh */ + }; + + DecoratePluginInterface() : PluginInterface() {} + virtual ~DecoratePluginInterface() {} + /** The very short string (a few words) describing each filtering action + // This string is used also to define the menu entry + */ + virtual QString decorationName(FilterIDType) const = 0; + virtual QString decorationInfo(FilterIDType) const = 0; + + virtual QString decorationName(QAction *a) const { return decorationName(ID(a)); } + virtual QString decorationInfo(QAction *a) const { return decorationInfo(ID(a)); } + + + virtual bool startDecorate(QAction *, MeshDocument &, const RichParameterList *, GLArea *) { return false; } + virtual bool startDecorate(QAction *, MeshModel &, const RichParameterList *, GLArea *) { return false; } + virtual void decorateMesh(QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &) = 0; + virtual void decorateDoc(QAction *, MeshDocument &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &) = 0; + virtual void endDecorate(QAction *, MeshModel &, const RichParameterList *, GLArea *) {} + virtual void endDecorate(QAction *, MeshDocument &, const RichParameterList *, GLArea *) {} + + /** \brief tests if a decoration is applicable to a mesh. + * used only for PerMesh Decorators. + For instance curvature cannot be shown on a mesh without curvature. + On failure (returning false) the function fills the MissingItems list with strings describing the missing items. + It is invoked only for decoration of \i PerMesh class; + */ + virtual bool isDecorationApplicable(QAction *, const MeshModel&, QString&) const { return true; } + + virtual int getDecorationClass(QAction *) const = 0; + + virtual QList actions() const { return actionList; } + virtual QList types() const { return typeList; } +protected: + QList actionList; + QList typeList; + virtual FilterIDType ID(QAction *a) const + { + QString aa=a->text(); + foreach(FilterIDType tt, types()) + if (a->text() == this->decorationName(tt)) return tt; + aa.replace("&",""); + foreach(FilterIDType tt, types()) + if (aa == this->decorationName(tt)) return tt; + + qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(a->text())); + assert(0); + return -1; + } + virtual FilterIDType ID(QString name) const + { + QString n = name; + foreach(FilterIDType tt, types()) + if (name == this->decorationName(tt)) return tt; + n.replace("&",""); + foreach(FilterIDType tt, types()) + if (n == this->decorationName(tt)) return tt; + + qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name)); + assert(0); + return -1; + } +public: + virtual QAction *action(QString name) const + { + QString n = name; + foreach(QAction *tt, actions()) + if (name == this->decorationName(ID(tt))) return tt; + n.replace("&",""); + foreach(QAction *tt, actions()) + if (n == this->decorationName(ID(tt))) return tt; + + qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name)); + return 0; + } +}; + +#define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x) +#define MESHLAB_PLUGIN_NAME_EXPORTER(x) + +#define DECORATE_PLUGIN_INTERFACE_IID "vcg.meshlab.MeshDecorateInterface/1.0" +Q_DECLARE_INTERFACE(DecoratePluginInterface, DECORATE_PLUGIN_INTERFACE_IID) + +#endif // MESHLAB_DECORATE_PLUGIN_INTERFACE_H diff --git a/src/common/pluginmanager.cpp b/src/common/pluginmanager.cpp index b86ee7aa1..6542fd026 100644 --- a/src/common/pluginmanager.cpp +++ b/src/common/pluginmanager.cpp @@ -115,7 +115,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl iIO->initGlobalParameterSet(NULL, defaultGlobal); } - MeshDecorateInterface *iDecorator = qobject_cast(plugin); + DecoratePluginInterface *iDecorator = qobject_cast(plugin); if (iDecorator) { iCommon = iDecorator; @@ -160,9 +160,9 @@ int PluginManager::numberIOPlugins() const } // Search among all the decorator plugins the one that contains a decoration with the given name -MeshDecorateInterface *PluginManager::getDecoratorInterfaceByName(const QString& name) +DecoratePluginInterface *PluginManager::getDecoratorInterfaceByName(const QString& name) { - foreach(MeshDecorateInterface *tt, this->meshDecoratePlugins()) + foreach(DecoratePluginInterface *tt, this->meshDecoratePlugins()) { foreach( QAction *ac, tt->actions()) if( name == tt->decorationName(ac) ) return tt; diff --git a/src/common/pluginmanager.h b/src/common/pluginmanager.h index c8bf2b986..be6ede877 100644 --- a/src/common/pluginmanager.h +++ b/src/common/pluginmanager.h @@ -28,6 +28,7 @@ #include "interfaces/filter_plugin_interface.h" #include "interfaces/io_plugin_interface.h" #include "interfaces/render_plugin_interface.h" +#include "interfaces/decorate_plugin_interface.h" //#include "scriptsyntax.h" #include @@ -49,7 +50,7 @@ public: int numberIOPlugins() const; inline QVector& meshFilterPlugins() {return meshFilterPlug;} inline QVector& meshRenderPlugins() {return meshRenderPlug;} - inline QVector& meshDecoratePlugins() {return meshDecoratePlug;} + inline QVector& meshDecoratePlugins() {return meshDecoratePlug;} inline QVector& meshEditFactoryPlugins() {return meshEditInterfacePlug;} static QString getDefaultPluginDirPath(); @@ -57,7 +58,7 @@ public: QMap generateFilterParameterMap(); - MeshDecorateInterface* getDecoratorInterfaceByName(const QString& name); + DecoratePluginInterface* getDecoratorInterfaceByName(const QString& name); QMap actionFilterMap; @@ -70,7 +71,7 @@ public: QVector meshIOPlug; QVector meshFilterPlug; QVector meshRenderPlug; - QVector meshDecoratePlug; + QVector meshDecoratePlug; QVector meshEditInterfacePlug; QVector editActionList; QVector decoratorActionList; diff --git a/src/meshlab/glarea.cpp b/src/meshlab/glarea.cpp index 2d3e3f480..7da4c7a85 100644 --- a/src/meshlab/glarea.cpp +++ b/src/meshlab/glarea.cpp @@ -484,7 +484,7 @@ void GLArea::paintEvent(QPaintEvent* /*event*/) QList& tmpset = iPerMeshDecoratorsListMap[mp->id()]; for( QList::iterator it = tmpset.begin(); it != tmpset.end();++it) { - MeshDecorateInterface * decorInterface = qobject_cast((*it)->parent()); + DecoratePluginInterface * decorInterface = qobject_cast((*it)->parent()); decorInterface->decorateMesh(*it,*mp,this->glas.currentGlobalParamSet,this,&painter,md()->Log); } MLRenderingData meshdt; @@ -546,7 +546,7 @@ void GLArea::paintEvent(QPaintEvent* /*event*/) QList& tmpset = iPerMeshDecoratorsListMap[mp->id()]; for (QList::iterator it = tmpset.begin(); it != tmpset.end(); ++it) { - MeshDecorateInterface * decorInterface = qobject_cast((*it)->parent()); + DecoratePluginInterface * decorInterface = qobject_cast((*it)->parent()); decorInterface->decorateMesh(*it, *mp, this->glas.currentGlobalParamSet, this, &painter, md()->Log); } } @@ -567,7 +567,7 @@ void GLArea::paintEvent(QPaintEvent* /*event*/) foreach(QAction * p, iPerDocDecoratorlist) { - MeshDecorateInterface * decorInterface = qobject_cast(p->parent()); + DecoratePluginInterface * decorInterface = qobject_cast(p->parent()); decorInterface->decorateDoc(p, *this->md(), this->glas.currentGlobalParamSet, this, &painter, md()->Log); } @@ -1065,7 +1065,7 @@ void GLArea::updateAllDecorators() return; foreach(QAction * p, iPerDocDecoratorlist) { - MeshDecorateInterface * decorInterface = qobject_cast(p->parent()); + DecoratePluginInterface * decorInterface = qobject_cast(p->parent()); decorInterface->endDecorate(p, *md(), this->glas.currentGlobalParamSet, this); decorInterface->setLog(&md()->Log); decorInterface->startDecorate(p, *md(), this->glas.currentGlobalParamSet, this); @@ -1151,7 +1151,7 @@ bool GLArea::readyToClose() // Now manage the closing of the decorator set; foreach(QAction* act, iPerDocDecoratorlist) { - MeshDecorateInterface* mdec = qobject_cast(act->parent()); + DecoratePluginInterface* mdec = qobject_cast(act->parent()); mdec->endDecorate(act,*md(),glas.currentGlobalParamSet,this); mdec->setLog(NULL); } @@ -1165,7 +1165,7 @@ bool GLArea::readyToClose() for(QSet::iterator it = dectobeclose.begin();it != dectobeclose.end();++it) { - MeshDecorateInterface* mdec = qobject_cast((*it)->parent()); + DecoratePluginInterface* mdec = qobject_cast((*it)->parent()); if (mdec != NULL) { mdec->endDecorate(*it,*md(),glas.currentGlobalParamSet,this); @@ -1402,7 +1402,7 @@ void GLArea::toggleDecorator(QString name) void GLArea::updateDecorator(QString name, bool toggle, bool stateToSet) { makeCurrent(); - MeshDecorateInterface *iDecorateTemp = this->mw()->PM.getDecoratorInterfaceByName(name); + DecoratePluginInterface *iDecorateTemp = this->mw()->PM.getDecoratorInterfaceByName(name); if (!iDecorateTemp) { this->Logf(GLLogStream::SYSTEM,"Could not get Decorate interface %s", qUtf8Printable(name)); this->Log(GLLogStream::SYSTEM,"Known decorate interfaces:"); @@ -1415,7 +1415,7 @@ void GLArea::updateDecorator(QString name, bool toggle, bool stateToSet) } QAction *action = iDecorateTemp->action(name); - if(iDecorateTemp->getDecorationClass(action)== MeshDecorateInterface::PerDocument) + if(iDecorateTemp->getDecorationClass(action)== DecoratePluginInterface::PerDocument) { bool found=this->iPerDocDecoratorlist.removeOne(action); if(found) @@ -1441,7 +1441,7 @@ void GLArea::updateDecorator(QString name, bool toggle, bool stateToSet) } } - if(iDecorateTemp->getDecorationClass(action)== MeshDecorateInterface::PerMesh) + if(iDecorateTemp->getDecorationClass(action)== DecoratePluginInterface::PerMesh) { MeshModel ¤tMeshModel = *mm(); bool found=this->iCurPerMeshDecoratorList().removeOne(action); diff --git a/src/meshlab/glarea.h b/src/meshlab/glarea.h index 9fe65b34e..ff89fa454 100644 --- a/src/meshlab/glarea.h +++ b/src/meshlab/glarea.h @@ -37,6 +37,8 @@ #include #include +#include +#include #include #include "glarea_setting.h" #include "snapshotsetting.h" @@ -308,7 +310,7 @@ public slots: MeshModel *m = md()->getMesh(i.key()); foreach(QAction *p, i.value()) { - MeshDecorateInterface * decorInterface = qobject_cast(p->parent()); + DecoratePluginInterface * decorInterface = qobject_cast(p->parent()); decorInterface->endDecorate(p, *m, this->glas.currentGlobalParamSet, this); decorInterface->setLog(&md()->Log); decorInterface->startDecorate(p, *m, this->glas.currentGlobalParamSet, this); diff --git a/src/meshlab/layerDialog.cpp b/src/meshlab/layerDialog.cpp index 601b6e341..b58914d2d 100644 --- a/src/meshlab/layerDialog.cpp +++ b/src/meshlab/layerDialog.cpp @@ -893,7 +893,7 @@ void LayerDialog::updateDecoratorParsView() ui->decParsTree->clear(); for(int ii = 0; ii < decList.size();++ii) { - MeshDecorateInterface* decPlug = qobject_cast(decList[ii]->parent()); + DecoratePluginInterface* decPlug = qobject_cast(decList[ii]->parent()); if (!decPlug) { mw->GLA()->Log(GLLogStream::SYSTEM,"MeshLab System Error: A Decorator Plugin has been expected."); @@ -1219,7 +1219,7 @@ void RasterTreeWidgetItem::updateVisibilityIcon( bool isvisible ) DecoratorParamsTreeWidget::DecoratorParamsTreeWidget(QAction* act,MainWindow *mw,QWidget* parent) : QFrame(parent),mainWin(mw),frame(NULL),savebut(NULL),resetbut(NULL),loadbut(NULL),dialoglayout(NULL) { - MeshDecorateInterface* decPlug = qobject_cast(act->parent()); + DecoratePluginInterface* decPlug = qobject_cast(act->parent()); if (!decPlug) { mw->GLA()->Log(GLLogStream::SYSTEM, "MeshLab System Error: A Decorator Plugin has been expected."); } diff --git a/src/meshlab/layerDialog.h b/src/meshlab/layerDialog.h index 113fef919..9ac248504 100644 --- a/src/meshlab/layerDialog.h +++ b/src/meshlab/layerDialog.h @@ -42,7 +42,7 @@ class GLLogStream; class MeshModel; class RasterModel; class MeshDocument; -class MeshDecorateInterface; +class DecoratePluginInterface; class RichParameterListFrame; class QGridLayout; class QToolBar; diff --git a/src/meshlab/mainwindow_Init.cpp b/src/meshlab/mainwindow_Init.cpp index ec1db42be..33c5e50bf 100644 --- a/src/meshlab/mainwindow_Init.cpp +++ b/src/meshlab/mainwindow_Init.cpp @@ -473,7 +473,7 @@ void MainWindow::createToolBars() decoratorToolBar = addToolBar("Decorator"); - foreach(MeshDecorateInterface *iDecorate, PM.meshDecoratePlugins()) + foreach(DecoratePluginInterface *iDecorate, PM.meshDecoratePlugins()) { foreach(QAction *decorateAction, iDecorate->actions()) { @@ -818,7 +818,7 @@ void MainWindow::fillFilterMenu() void MainWindow::fillDecorateMenu() { - foreach(MeshDecorateInterface *iDecorate, PM.meshDecoratePlugins()) + foreach(DecoratePluginInterface *iDecorate, PM.meshDecoratePlugins()) { foreach(QAction *decorateAction, iDecorate->actions()) { diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index 0eaf98250..c0f22c02d 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -1444,7 +1444,7 @@ void MainWindow::applyDecorateMode() if(GLA()->mm() == 0) return; QAction *action = qobject_cast(sender()); // find the action which has sent the signal - MeshDecorateInterface *iDecorateTemp = qobject_cast(action->parent()); + DecoratePluginInterface *iDecorateTemp = qobject_cast(action->parent()); GLA()->toggleDecorator(iDecorateTemp->decorationName(action)); diff --git a/src/meshlab/plugindialog.cpp b/src/meshlab/plugindialog.cpp index 02c608a94..68c15e9f4 100644 --- a/src/meshlab/plugindialog.cpp +++ b/src/meshlab/plugindialog.cpp @@ -25,6 +25,9 @@ #include #include #include +#include +#include + #include #include @@ -133,7 +136,7 @@ void PluginDialog::populateTreeWidget(const QString &path,const QStringList &fil } addItems(pluginItem,Templist); } - MeshDecorateInterface *iDecorate = qobject_cast(plugin); + DecoratePluginInterface *iDecorate = qobject_cast(plugin); if (iDecorate){ QStringList Templist; foreach(QAction *a,iDecorate->actions()){Templist.push_back(a->text());} @@ -199,7 +202,7 @@ void PluginDialog::displayInfo(QTreeWidgetItem* item,int /* ncolumn*/) if (actionName==formats) labelInfo->setText(f.description); } } - MeshDecorateInterface *iDecorate = qobject_cast(plugin); + DecoratePluginInterface *iDecorate = qobject_cast(plugin); if (iDecorate) { foreach(QAction *a,iDecorate->actions()) diff --git a/src/meshlabplugins/decorate_background/decorate_background.h b/src/meshlabplugins/decorate_background/decorate_background.h index b5b3efe9b..8d1e6cd63 100644 --- a/src/meshlabplugins/decorate_background/decorate_background.h +++ b/src/meshlabplugins/decorate_background/decorate_background.h @@ -34,14 +34,15 @@ New small samples #include #include -#include +#include +#include #include "cubemap.h" -class DecorateBackgroundPlugin : public QObject, public MeshDecorateInterface +class DecorateBackgroundPlugin : public QObject, public DecoratePluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_DECORATE_INTERFACE_IID) - Q_INTERFACES(MeshDecorateInterface) + MESHLAB_PLUGIN_IID_EXPORTER(DECORATE_PLUGIN_INTERFACE_IID) + Q_INTERFACES(DecoratePluginInterface) QString decorationName(FilterIDType id) const; QString decorationInfo(FilterIDType id) const; QString pluginName() const; @@ -72,7 +73,7 @@ DecorateBackgroundPlugin() /*<< DP_SHOW_CUBEMAPPED_ENV*/ << DP_SHOW_GRID; - foreach(FilterIDType tt , types()){ + for(FilterIDType tt : types()){ actionList << new QAction(decorationName(tt), this); if(tt==DP_SHOW_GRID) actionList.last()->setIcon(QIcon(":/images/show_background_grid.png")); @@ -88,7 +89,7 @@ DecorateBackgroundPlugin() void decorateDoc(QAction *a, MeshDocument &md, const RichParameterList *, GLArea *gla, QPainter *, GLLogStream &_log); void decorateMesh(QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &){} void initGlobalParameterSet(QAction *, RichParameterList &/*globalparam*/); - int getDecorationClass(QAction * /*action*/) const { return MeshDecorateInterface::PerDocument; } + int getDecorationClass(QAction * /*action*/) const { return DecoratePluginInterface::PerDocument; } private: diff --git a/src/meshlabplugins/decorate_base/decorate_base.h b/src/meshlabplugins/decorate_base/decorate_base.h index 767c34852..8f554d1a2 100644 --- a/src/meshlabplugins/decorate_base/decorate_base.h +++ b/src/meshlabplugins/decorate_base/decorate_base.h @@ -24,7 +24,9 @@ #ifndef EXTRADECORATEPLUGIN_H #define EXTRADECORATEPLUGIN_H -#include +#include +#include + #include #include "colorhistogram.h" @@ -33,11 +35,11 @@ typedef vcg::ColorHistogram CHist; typedef std::pair PointPC; // this type is used to have a simple coord+color pair to rapidly draw non manifold faces -class DecorateBasePlugin : public QObject, public MeshDecorateInterface +class DecorateBasePlugin : public QObject, public DecoratePluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_DECORATE_INTERFACE_IID) - Q_INTERFACES(MeshDecorateInterface) + MESHLAB_PLUGIN_IID_EXPORTER(DECORATE_PLUGIN_INTERFACE_IID) + Q_INTERFACES(DecoratePluginInterface) QString decorationName(FilterIDType filter) const; QString decorationInfo(FilterIDType filter) const; QString pluginName() const; diff --git a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h index fea51fd2a..3f13a9c46 100644 --- a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h +++ b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h @@ -27,18 +27,19 @@ #include -#include +#include #include +#include #include -class DecorateRasterProjPlugin : public QObject, public MeshDecorateInterface +class DecorateRasterProjPlugin : public QObject, public DecoratePluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_DECORATE_INTERFACE_IID) - Q_INTERFACES( MeshDecorateInterface ) + MESHLAB_PLUGIN_IID_EXPORTER(DECORATE_PLUGIN_INTERFACE_IID) + Q_INTERFACES( DecoratePluginInterface ) // Types. diff --git a/src/meshlabplugins/decorate_shadow/decorate_shader.h b/src/meshlabplugins/decorate_shadow/decorate_shader.h index e6e123f60..0332f3bbc 100644 --- a/src/meshlabplugins/decorate_shadow/decorate_shader.h +++ b/src/meshlabplugins/decorate_shadow/decorate_shader.h @@ -28,7 +28,7 @@ #include //#include -#include +#include //#include diff --git a/src/meshlabplugins/decorate_shadow/decorate_shadow.h b/src/meshlabplugins/decorate_shadow/decorate_shadow.h index a531bd7c2..2505f5d12 100644 --- a/src/meshlabplugins/decorate_shadow/decorate_shadow.h +++ b/src/meshlabplugins/decorate_shadow/decorate_shadow.h @@ -24,7 +24,7 @@ #define SAMPLE_DECORATE_PLUGIN_H #include -#include +#include #include "decorate_shader.h" #include "shadow_mapping.h" @@ -32,11 +32,11 @@ #include "variance_shadow_mapping_blur.h" #include "ssao.h" -class DecorateShadowPlugin : public QObject, public MeshDecorateInterface +class DecorateShadowPlugin : public QObject, public DecoratePluginInterface { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_DECORATE_INTERFACE_IID) - Q_INTERFACES(MeshDecorateInterface) + MESHLAB_PLUGIN_IID_EXPORTER(DECORATE_PLUGIN_INTERFACE_IID) + Q_INTERFACES(DecoratePluginInterface) enum { DP_SHOW_SHADOW, @@ -93,7 +93,7 @@ public: void decorateDoc(QAction *a, MeshDocument &m, const RichParameterList*, GLArea *gla, QPainter *p, GLLogStream &); void endDecorate(QAction *, MeshDocument &, const RichParameterList *, GLArea *); void initGlobalParameterSet(QAction *, RichParameterList & globalparam); - int getDecorationClass(QAction * /*action*/) const { return MeshDecorateInterface::PerDocument; } + int getDecorationClass(QAction * /*action*/) const { return DecoratePluginInterface::PerDocument; } private: DecorateShader* smShader, *vsmShader, *vsmbShader; From 2121557c197f869cae03bdc651c3b18faf61badb Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 18 Sep 2020 15:47:25 +0200 Subject: [PATCH 33/49] edit_plugin_interface.h --- src/common/CMakeLists.txt | 1 + src/common/common.pro | 1 + src/common/interfaces.h | 90 ------------- src/common/interfaces/edit_plugin_interface.h | 125 ++++++++++++++++++ src/common/pluginmanager.cpp | 2 +- src/common/pluginmanager.h | 6 +- src/meshlab/glarea.h | 9 +- src/meshlab/mainwindow_Init.cpp | 4 +- src/meshlab/mainwindow_RunTime.cpp | 4 +- src/meshlab/plugindialog.cpp | 6 +- src/meshlabplugins/edit_align/edit_align.h | 6 +- .../edit_align/edit_align_factory.cpp | 2 +- .../edit_align/edit_align_factory.h | 10 +- .../edit_manipulators/edit_manipulators.h | 6 +- .../edit_manipulators_factory.cpp | 2 +- .../edit_manipulators_factory.h | 10 +- .../edit_measure/edit_measure.h | 6 +- .../edit_measure/edit_measure_factory.cpp | 2 +- .../edit_measure/edit_measure_factory.h | 10 +- .../edit_mutualcorrs/edit_mutualcorrs.h | 6 +- .../edit_mutualcorrs_factory.cpp | 2 +- .../edit_mutualcorrs_factory.h | 10 +- src/meshlabplugins/edit_paint/edit_paint.h | 6 +- .../edit_paint/edit_paint_factory.cpp | 2 +- .../edit_paint/edit_paint_factory.h | 10 +- .../edit_pickpoints_factory.cpp | 2 +- .../edit_pickpoints/edit_pickpoints_factory.h | 10 +- .../edit_pickpoints/editpickpoints.h | 6 +- src/meshlabplugins/edit_point/edit_point.h | 6 +- .../edit_point/edit_point_factory.cpp | 2 +- .../edit_point/edit_point_factory.h | 10 +- .../edit_quality/edit_quality_factory.cpp | 2 +- .../edit_quality/edit_quality_factory.h | 10 +- .../edit_quality/qualitymapper.h | 6 +- .../edit_referencing/edit_referencing.h | 6 +- .../edit_referencing_factory.cpp | 2 +- .../edit_referencing_factory.h | 10 +- src/meshlabplugins/edit_sample/edit_sample.h | 6 +- .../edit_sample/edit_sample_factory.cpp | 2 +- .../edit_sample/edit_sample_factory.h | 10 +- src/meshlabplugins/edit_select/edit_select.h | 6 +- .../edit_select/edit_select_factory.cpp | 2 +- .../edit_select/edit_select_factory.h | 10 +- 43 files changed, 244 insertions(+), 202 deletions(-) create mode 100644 src/common/interfaces/edit_plugin_interface.h diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 3438e61fe..0b6ebcd51 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -39,6 +39,7 @@ set(HEADERS interfaces/filter_plugin_interface.h interfaces/io_plugin_interface.h interfaces/render_plugin_interface.h + interfaces/edit_plugin_interface.h GLExtensionsManager.h GLLogStream.h filterscript.h diff --git a/src/common/common.pro b/src/common/common.pro index c57132938..8f49d2df6 100644 --- a/src/common/common.pro +++ b/src/common/common.pro @@ -49,6 +49,7 @@ HEADERS += \ GLLogStream.h \ interfaces.h \ interfaces/decorate_plugin_interface.h \ + interfaces/edit_plugin_interface.h \ interfaces/filter_plugin_interface.h \ interfaces/io_plugin_interface.h \ interfaces/mainwindow_interface.h \ diff --git a/src/common/interfaces.h b/src/common/interfaces.h index 45a141674..be3397a02 100644 --- a/src/common/interfaces.h +++ b/src/common/interfaces.h @@ -54,95 +54,5 @@ class MeshModel; -/* -Editing Interface -Used to provide tools that needs some kind of interaction with the mesh. -Editing tools are exclusive (only one at a time) and can grab the mouse events and customize the rendering process. -*/ - -class MeshEditInterface : public PluginInterface -{ -public: - MeshEditInterface() : PluginInterface() {} - virtual ~MeshEditInterface() {} - - //should return a sentence describing what the editing tool does - static const QString Info(); - - virtual void suggestedRenderingData(MeshModel &/*m*/, MLRenderingData& /*dt*/) {} - - // Called when the user press the first time the button - virtual bool StartEdit(MeshModel &/*m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/) { return true; } - virtual bool StartEdit(MeshDocument &md, GLArea *parent, MLSceneGLSharedDataContext* cont) - { - //assert(NULL != md.mm()); - if (md.mm() != NULL) - return (StartEdit(*(md.mm()), parent, cont)); - else return false; - } - // Called when the user press the second time the button - virtual void EndEdit(MeshModel &/*m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/) {} - virtual void EndEdit(MeshDocument &/*m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/) {} - - // There are two classes of editing tools, the one that works on a single layer at a time - // and the ones that works on all layers and have to manage in a correct way the action of changing the current layer. - // For the edit tools that works ona single layer changing the layer means the restart of the edit tool. - virtual bool isSingleMeshEdit() const { return true; } - - // Called when the user changes the selected layer - //by default it calls end edit with the layer that was selected and start with the new layer that is - //selected. This ensures that plugins who don't support layers do not get sent pointers to meshes - //they are not expecting. - // If your editing plugins is not singleMesh you MUST reimplement this to correctly handle the change of layer. - virtual void LayerChanged(MeshDocument &md, MeshModel &oldMeshModel, GLArea *parent, MLSceneGLSharedDataContext* cont) - { - assert(this->isSingleMeshEdit()); - EndEdit(oldMeshModel, parent, cont); - StartEdit(md, parent, cont); - } - - virtual void Decorate(MeshModel &m, GLArea *parent, QPainter * /*p*/) { Decorate(m, parent); } - virtual void Decorate(MeshModel &/*m*/, GLArea * /*parent*/) {} - - virtual void mousePressEvent(QMouseEvent *event, MeshModel &/*m*/, GLArea *) = 0; - virtual void mouseMoveEvent(QMouseEvent *event, MeshModel &/*m*/, GLArea *) = 0; - virtual void mouseReleaseEvent(QMouseEvent *event, MeshModel &/*m*/, GLArea *) = 0; - virtual void keyReleaseEvent(QKeyEvent *, MeshModel &/*m*/, GLArea *) {} - virtual void keyPressEvent(QKeyEvent *, MeshModel &/*m*/, GLArea *) {} - virtual void wheelEvent(QWheelEvent*, MeshModel &/*m*/, GLArea *) {} - virtual void tabletEvent(QTabletEvent * e, MeshModel &/*m*/, GLArea *) { e->ignore(); } -}; - - -/** MeshEditInterfaceFactory -\short The MeshEditInterfaceFactory class is a factory is used to generate a object for each starting of an editing filter. - -This is needed because editing filters have a internal state, so if you want to have an editing tool for two different documents you have to instance two objects. -This class is used by the framework to generate an independent MeshEditInterface for each document. -*/ -class MeshEditInterfaceFactory -{ -public: - virtual ~MeshEditInterfaceFactory() {} - - //gets a list of actions available from this plugin - virtual QList actions() const = 0; - - //get the edit tool for the given action - virtual MeshEditInterface* getMeshEditInterface(QAction *) = 0; - - //get the description for the given action - virtual QString getEditToolDescription(QAction *) = 0; - -}; - -#define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x) -#define MESHLAB_PLUGIN_NAME_EXPORTER(x) - -#define MESH_EDIT_INTERFACE_IID "vcg.meshlab.MeshEditInterface/1.0" -#define MESH_EDIT_INTERFACE_FACTORY_IID "vcg.meshlab.MeshEditInterfaceFactory/1.0" - -Q_DECLARE_INTERFACE(MeshEditInterface, MESH_EDIT_INTERFACE_IID) -Q_DECLARE_INTERFACE(MeshEditInterfaceFactory, MESH_EDIT_INTERFACE_FACTORY_IID) #endif diff --git a/src/common/interfaces/edit_plugin_interface.h b/src/common/interfaces/edit_plugin_interface.h new file mode 100644 index 000000000..3640d5a1a --- /dev/null +++ b/src/common/interfaces/edit_plugin_interface.h @@ -0,0 +1,125 @@ +/**************************************************************************** +* MeshLab o o * +* A versatile mesh processing toolbox o o * +* _ O _ * +* Copyright(C) 2005-2020 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ + +#ifndef MESHLAB_EDIT_PLUGIN_INTERFACE_H +#define MESHLAB_EDIT_PLUGIN_INTERFACE_H + +#include "plugin_interface.h" +#include "../meshmodel.h" + + +class GLArea; + +/* +Editing Interface +Used to provide tools that needs some kind of interaction with the mesh. +Editing tools are exclusive (only one at a time) and can grab the mouse events and customize the rendering process. +*/ + +class EditPluginInterface : public PluginInterface +{ +public: + EditPluginInterface() : PluginInterface() {} + virtual ~EditPluginInterface() {} + + //should return a sentence describing what the editing tool does + static const QString Info(); + + virtual void suggestedRenderingData(MeshModel &/*m*/, MLRenderingData& /*dt*/) {} + + // Called when the user press the first time the button + virtual bool StartEdit(MeshModel &/*m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/) { return true; } + virtual bool StartEdit(MeshDocument &md, GLArea *parent, MLSceneGLSharedDataContext* cont) + { + //assert(NULL != md.mm()); + if (md.mm() != NULL) + return (StartEdit(*(md.mm()), parent, cont)); + else return false; + } + // Called when the user press the second time the button + virtual void EndEdit(MeshModel &/*m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/) {} + virtual void EndEdit(MeshDocument &/*m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/) {} + + // There are two classes of editing tools, the one that works on a single layer at a time + // and the ones that works on all layers and have to manage in a correct way the action of changing the current layer. + // For the edit tools that works ona single layer changing the layer means the restart of the edit tool. + virtual bool isSingleMeshEdit() const { return true; } + + // Called when the user changes the selected layer + //by default it calls end edit with the layer that was selected and start with the new layer that is + //selected. This ensures that plugins who don't support layers do not get sent pointers to meshes + //they are not expecting. + // If your editing plugins is not singleMesh you MUST reimplement this to correctly handle the change of layer. + virtual void LayerChanged(MeshDocument &md, MeshModel &oldMeshModel, GLArea *parent, MLSceneGLSharedDataContext* cont) + { + assert(this->isSingleMeshEdit()); + EndEdit(oldMeshModel, parent, cont); + StartEdit(md, parent, cont); + } + + virtual void Decorate(MeshModel &m, GLArea *parent, QPainter * /*p*/) { Decorate(m, parent); } + virtual void Decorate(MeshModel &/*m*/, GLArea * /*parent*/) {} + + virtual void mousePressEvent(QMouseEvent *event, MeshModel &/*m*/, GLArea *) = 0; + virtual void mouseMoveEvent(QMouseEvent *event, MeshModel &/*m*/, GLArea *) = 0; + virtual void mouseReleaseEvent(QMouseEvent *event, MeshModel &/*m*/, GLArea *) = 0; + virtual void keyReleaseEvent(QKeyEvent *, MeshModel &/*m*/, GLArea *) {} + virtual void keyPressEvent(QKeyEvent *, MeshModel &/*m*/, GLArea *) {} + virtual void wheelEvent(QWheelEvent*, MeshModel &/*m*/, GLArea *) {} + virtual void tabletEvent(QTabletEvent * e, MeshModel &/*m*/, GLArea *) { e->ignore(); } +}; + + +/** MeshEditInterfaceFactory +\short The MeshEditInterfaceFactory class is a factory is used to generate a object for each starting of an editing filter. + +This is needed because editing filters have a internal state, so if you want to have an editing tool for two different documents you have to instance two objects. +This class is used by the framework to generate an independent MeshEditInterface for each document. +*/ +class EditPluginInterfaceFactory +{ +public: + virtual ~EditPluginInterfaceFactory() {} + + //gets a list of actions available from this plugin + virtual QList actions() const = 0; + + //get the edit tool for the given action + virtual EditPluginInterface* getMeshEditInterface(QAction *) = 0; + + //get the description for the given action + virtual QString getEditToolDescription(QAction *) = 0; + +}; + +#define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x) +#define MESHLAB_PLUGIN_NAME_EXPORTER(x) + +#define EDIT_PLUGIN_INTERFACE_IID "vcg.meshlab.EditPluginInterface/1.0" +#define EDIT_PLUGIN_INTERFACE_FACTORY_IID "vcg.meshlab.EditPluginInterfaceFactory/1.0" + +Q_DECLARE_INTERFACE(EditPluginInterface, EDIT_PLUGIN_INTERFACE_IID) +Q_DECLARE_INTERFACE(EditPluginInterfaceFactory, EDIT_PLUGIN_INTERFACE_FACTORY_IID) + + +#endif // MESHLAB_EDIT_PLUGIN_INTERFACE_H diff --git a/src/common/pluginmanager.cpp b/src/common/pluginmanager.cpp index 6542fd026..ee588be5a 100644 --- a/src/common/pluginmanager.cpp +++ b/src/common/pluginmanager.cpp @@ -134,7 +134,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl meshRenderPlug.push_back(iRender); } - MeshEditInterfaceFactory *iEditFactory = qobject_cast(plugin); + EditPluginInterfaceFactory *iEditFactory = qobject_cast(plugin); if (iEditFactory) { meshEditInterfacePlug.push_back(iEditFactory); diff --git a/src/common/pluginmanager.h b/src/common/pluginmanager.h index be6ede877..8e7781d51 100644 --- a/src/common/pluginmanager.h +++ b/src/common/pluginmanager.h @@ -29,6 +29,8 @@ #include "interfaces/io_plugin_interface.h" #include "interfaces/render_plugin_interface.h" #include "interfaces/decorate_plugin_interface.h" +#include "interfaces/edit_plugin_interface.h" + //#include "scriptsyntax.h" #include @@ -51,7 +53,7 @@ public: inline QVector& meshFilterPlugins() {return meshFilterPlug;} inline QVector& meshRenderPlugins() {return meshRenderPlug;} inline QVector& meshDecoratePlugins() {return meshDecoratePlug;} - inline QVector& meshEditFactoryPlugins() {return meshEditInterfacePlug;} + inline QVector& meshEditFactoryPlugins() {return meshEditInterfacePlug;} static QString getDefaultPluginDirPath(); static QString getBaseDirPath(); @@ -72,7 +74,7 @@ public: QVector meshFilterPlug; QVector meshRenderPlug; QVector meshDecoratePlug; - QVector meshEditInterfacePlug; + QVector meshEditInterfacePlug; QVector editActionList; QVector decoratorActionList; // Used for unique destruction - this "owns" all IO, Filter, Render, and Decorate plugins diff --git a/src/meshlab/glarea.h b/src/meshlab/glarea.h index ff89fa454..a362fb950 100644 --- a/src/meshlab/glarea.h +++ b/src/meshlab/glarea.h @@ -39,6 +39,7 @@ #include #include #include +#include #include #include "glarea_setting.h" #include "snapshotsetting.h" @@ -352,13 +353,13 @@ public: QAction * getCurrentEditAction() { return currentEditor; } //get the currently active mesh editor - MeshEditInterface * getCurrentMeshEditor() { return iEdit; } + EditPluginInterface * getCurrentMeshEditor() { return iEdit; } //see if this glAarea has a MESHEditInterface for this action bool editorExistsForAction(QAction *editAction){ return actionToMeshEditMap.contains(editAction); } //add a MeshEditInterface for the given action - void addMeshEditor(QAction *editAction, MeshEditInterface *editor){ actionToMeshEditMap.insert(editAction, editor); } + void addMeshEditor(QAction *editAction, EditPluginInterface *editor){ actionToMeshEditMap.insert(editAction, editor); } bool readyToClose(); float lastRenderingTime() { return lastTime;} void drawGradient(); @@ -453,10 +454,10 @@ private: QFont qFont; //font settings // Editing support - MeshEditInterface *iEdit; + EditPluginInterface *iEdit; QAction *currentEditor; QAction *suspendedEditRef; // reference to last Editing Mode Used - QMap actionToMeshEditMap; + QMap actionToMeshEditMap; //the last model that start edit was called with MeshModel *lastModelEdited; diff --git a/src/meshlab/mainwindow_Init.cpp b/src/meshlab/mainwindow_Init.cpp index 33c5e50bf..00ded8b2f 100644 --- a/src/meshlab/mainwindow_Init.cpp +++ b/src/meshlab/mainwindow_Init.cpp @@ -484,7 +484,7 @@ void MainWindow::createToolBars() editToolBar = addToolBar(tr("Edit")); editToolBar->addAction(suspendEditModeAct); - foreach(MeshEditInterfaceFactory *iEditFactory, PM.meshEditFactoryPlugins()) + foreach(EditPluginInterfaceFactory *iEditFactory, PM.meshEditFactoryPlugins()) { foreach(QAction* editAction, iEditFactory->actions()) { @@ -844,7 +844,7 @@ void MainWindow::fillRenderMenu() void MainWindow::fillEditMenu() { - foreach(MeshEditInterfaceFactory *iEditFactory, PM.meshEditFactoryPlugins()) + foreach(EditPluginInterfaceFactory *iEditFactory, PM.meshEditFactoryPlugins()) { foreach(QAction* editAction, iEditFactory->actions()) { diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index c0f22c02d..15b5b864a 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -1382,8 +1382,8 @@ void MainWindow::applyEditMode() //if this GLArea does not have an instance of this action's MeshEdit tool then give it one if(!GLA()->editorExistsForAction(action)) { - MeshEditInterfaceFactory *iEditFactory = qobject_cast(action->parent()); - MeshEditInterface *iEdit = iEditFactory->getMeshEditInterface(action); + EditPluginInterfaceFactory *iEditFactory = qobject_cast(action->parent()); + EditPluginInterface *iEdit = iEditFactory->getMeshEditInterface(action); GLA()->addMeshEditor(action, iEdit); } meshDoc()->meshDocStateData().create(*meshDoc()); diff --git a/src/meshlab/plugindialog.cpp b/src/meshlab/plugindialog.cpp index 68c15e9f4..eb7367ac8 100644 --- a/src/meshlab/plugindialog.cpp +++ b/src/meshlab/plugindialog.cpp @@ -27,6 +27,8 @@ #include #include #include +#include + #include @@ -154,7 +156,7 @@ void PluginDialog::populateTreeWidget(const QString &path,const QStringList &fil foreach(QAction *a,iRender->actions()){Templist.push_back(a->text());} addItems(pluginItem,Templist); } - MeshEditInterfaceFactory *iEdit = qobject_cast(plugin); + EditPluginInterfaceFactory *iEdit = qobject_cast(plugin); if (iEdit){ QStringList Templist; foreach(QAction *a,iEdit->actions()){Templist.push_back(a->text());} @@ -218,7 +220,7 @@ void PluginDialog::displayInfo(QTreeWidgetItem* item,int /* ncolumn*/) RenderPluginInterface *iRender = qobject_cast(plugin); if (iRender){ } - MeshEditInterfaceFactory *iEditFactory = qobject_cast(plugin); + EditPluginInterfaceFactory *iEditFactory = qobject_cast(plugin); if (iEditFactory) { foreach(QAction *a, iEditFactory->actions()) diff --git a/src/meshlabplugins/edit_align/edit_align.h b/src/meshlabplugins/edit_align/edit_align.h index db943b9f3..e4721cdd4 100644 --- a/src/meshlabplugins/edit_align/edit_align.h +++ b/src/meshlabplugins/edit_align/edit_align.h @@ -24,17 +24,17 @@ #ifndef EditAlignPLUGIN_H #define EditAlignPLUGIN_H -#include +#include #include #include "align/OccupancyGrid.h" #include "meshtree.h" #include #include "alignDialog.h" -class EditAlignPlugin : public QObject, public MeshEditInterface +class EditAlignPlugin : public QObject, public EditPluginInterface { Q_OBJECT - Q_INTERFACES(MeshEditInterface) + Q_INTERFACES(EditPluginInterface) enum { diff --git a/src/meshlabplugins/edit_align/edit_align_factory.cpp b/src/meshlabplugins/edit_align/edit_align_factory.cpp index 7aa2d72d2..cf55d86a2 100644 --- a/src/meshlabplugins/edit_align/edit_align_factory.cpp +++ b/src/meshlabplugins/edit_align/edit_align_factory.cpp @@ -41,7 +41,7 @@ QList EditAlignFactory::actions() const } //get the edit tool for the given action -MeshEditInterface* EditAlignFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditAlignFactory::getMeshEditInterface(QAction *action) { assert(action == editAlign); (void) action; return new EditAlignPlugin(); diff --git a/src/meshlabplugins/edit_align/edit_align_factory.h b/src/meshlabplugins/edit_align/edit_align_factory.h index 2a4570d59..184966f49 100644 --- a/src/meshlabplugins/edit_align/edit_align_factory.h +++ b/src/meshlabplugins/edit_align/edit_align_factory.h @@ -26,13 +26,13 @@ #define EditAlignFactoryPLUGIN_H #include -#include +#include -class EditAlignFactory : public QObject, public MeshEditInterfaceFactory +class EditAlignFactory : public QObject, public EditPluginInterfaceFactory { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) - Q_INTERFACES(MeshEditInterfaceFactory) + MESHLAB_PLUGIN_IID_EXPORTER(EDIT_PLUGIN_INTERFACE_FACTORY_IID) + Q_INTERFACES(EditPluginInterfaceFactory) public: EditAlignFactory(); @@ -42,7 +42,7 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual MeshEditInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(QAction *); //get the description for the given action virtual QString getEditToolDescription(QAction *); diff --git a/src/meshlabplugins/edit_manipulators/edit_manipulators.h b/src/meshlabplugins/edit_manipulators/edit_manipulators.h index 044ca9f5e..61e2c8f2f 100644 --- a/src/meshlabplugins/edit_manipulators/edit_manipulators.h +++ b/src/meshlabplugins/edit_manipulators/edit_manipulators.h @@ -27,12 +27,12 @@ #include #include -#include +#include -class EditManipulatorsPlugin : public QObject, public MeshEditInterface +class EditManipulatorsPlugin : public QObject, public EditPluginInterface { Q_OBJECT - Q_INTERFACES(MeshEditInterface) + Q_INTERFACES(EditPluginInterface) public: diff --git a/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.cpp b/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.cpp index 079e8813c..14cdf23cb 100644 --- a/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.cpp +++ b/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.cpp @@ -41,7 +41,7 @@ QList EditManipulatorsFactory::actions() const } //get the edit tool for the given action -MeshEditInterface* EditManipulatorsFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditManipulatorsFactory::getMeshEditInterface(QAction *action) { if(action == editManipulators) { diff --git a/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.h b/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.h index 0af8668f2..a97a61d4b 100644 --- a/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.h +++ b/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.h @@ -26,13 +26,13 @@ #define EditManipulatorsFactoryPLUGIN_H #include -#include +#include -class EditManipulatorsFactory : public QObject, public MeshEditInterfaceFactory +class EditManipulatorsFactory : public QObject, public EditPluginInterfaceFactory { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) - Q_INTERFACES(MeshEditInterfaceFactory) + MESHLAB_PLUGIN_IID_EXPORTER(EDIT_PLUGIN_INTERFACE_FACTORY_IID) + Q_INTERFACES(EditPluginInterfaceFactory) public: EditManipulatorsFactory(); @@ -42,7 +42,7 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual MeshEditInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(QAction *); //get the description for the given action virtual QString getEditToolDescription(QAction *); diff --git a/src/meshlabplugins/edit_measure/edit_measure.h b/src/meshlabplugins/edit_measure/edit_measure.h index af113697b..48a3fa357 100644 --- a/src/meshlabplugins/edit_measure/edit_measure.h +++ b/src/meshlabplugins/edit_measure/edit_measure.h @@ -32,7 +32,7 @@ $Log: editmeasure.h,v $ #include #include -#include +#include #include //-------------------------------------- @@ -47,10 +47,10 @@ public: //-------------------------------------- -class EditMeasurePlugin : public QObject, public MeshEditInterface +class EditMeasurePlugin : public QObject, public EditPluginInterface { Q_OBJECT - Q_INTERFACES(MeshEditInterface) + Q_INTERFACES(EditPluginInterface) public: EditMeasurePlugin(); diff --git a/src/meshlabplugins/edit_measure/edit_measure_factory.cpp b/src/meshlabplugins/edit_measure/edit_measure_factory.cpp index 31fc2d897..25fb1e097 100644 --- a/src/meshlabplugins/edit_measure/edit_measure_factory.cpp +++ b/src/meshlabplugins/edit_measure/edit_measure_factory.cpp @@ -41,7 +41,7 @@ QList EditMeasureFactory::actions() const } //get the edit tool for the given action -MeshEditInterface* EditMeasureFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditMeasureFactory::getMeshEditInterface(QAction *action) { if(action == editMeasure) { diff --git a/src/meshlabplugins/edit_measure/edit_measure_factory.h b/src/meshlabplugins/edit_measure/edit_measure_factory.h index 86e66317a..364bd67d7 100644 --- a/src/meshlabplugins/edit_measure/edit_measure_factory.h +++ b/src/meshlabplugins/edit_measure/edit_measure_factory.h @@ -26,13 +26,13 @@ #define EditMeasureFactoryPLUGIN_H #include -#include +#include -class EditMeasureFactory : public QObject, public MeshEditInterfaceFactory +class EditMeasureFactory : public QObject, public EditPluginInterfaceFactory { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) - Q_INTERFACES(MeshEditInterfaceFactory) + MESHLAB_PLUGIN_IID_EXPORTER(EDIT_PLUGIN_INTERFACE_FACTORY_IID) + Q_INTERFACES(EditPluginInterfaceFactory) public: EditMeasureFactory(); @@ -42,7 +42,7 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual MeshEditInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(QAction *); //get the description for the given action virtual QString getEditToolDescription(QAction *); diff --git a/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs.h b/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs.h index bfa7523bd..8aa377dc2 100644 --- a/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs.h +++ b/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs.h @@ -25,7 +25,7 @@ #define EditMutualCorrsPlugin_H #include -#include +#include #include "edit_mutualcorrsDialog.h" #include "alignset.h" @@ -33,10 +33,10 @@ #include -class EditMutualCorrsPlugin : public QObject, public MeshEditInterface +class EditMutualCorrsPlugin : public QObject, public EditPluginInterface { Q_OBJECT - Q_INTERFACES(MeshEditInterface) + Q_INTERFACES(EditPluginInterface) public: EditMutualCorrsPlugin(); diff --git a/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.cpp b/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.cpp index 6b9b5e1d2..f32f4426f 100644 --- a/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.cpp +++ b/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.cpp @@ -41,7 +41,7 @@ QList EditMutualCorrsFactory::actions() const } //get the edit tool for the given action -MeshEditInterface* EditMutualCorrsFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditMutualCorrsFactory::getMeshEditInterface(QAction *action) { if(action == editMutualCorrs) { diff --git a/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.h b/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.h index a7d4b4827..74918e7f5 100644 --- a/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.h +++ b/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.h @@ -25,13 +25,13 @@ #define EditMutualCorrsPLUGIN_H #include -#include +#include -class EditMutualCorrsFactory : public QObject, public MeshEditInterfaceFactory +class EditMutualCorrsFactory : public QObject, public EditPluginInterfaceFactory { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) - Q_INTERFACES(MeshEditInterfaceFactory) + MESHLAB_PLUGIN_IID_EXPORTER(EDIT_PLUGIN_INTERFACE_FACTORY_IID) + Q_INTERFACES(EditPluginInterfaceFactory) public: EditMutualCorrsFactory(); @@ -41,7 +41,7 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual MeshEditInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(QAction *); //get the description for the given action virtual QString getEditToolDescription(QAction *); diff --git a/src/meshlabplugins/edit_paint/edit_paint.h b/src/meshlabplugins/edit_paint/edit_paint.h index 60bad9041..5c54efaa8 100644 --- a/src/meshlabplugins/edit_paint/edit_paint.h +++ b/src/meshlabplugins/edit_paint/edit_paint.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include "paintbox.h" @@ -49,9 +49,9 @@ enum PaintOptions { /** * EditPaint plugin main class (MeshEditing plugin) */ -class EditPaintPlugin : public QObject, public MeshEditInterface { +class EditPaintPlugin : public QObject, public EditPluginInterface { Q_OBJECT - Q_INTERFACES(MeshEditInterface) + Q_INTERFACES(EditPluginInterface) public: EditPaintPlugin(); diff --git a/src/meshlabplugins/edit_paint/edit_paint_factory.cpp b/src/meshlabplugins/edit_paint/edit_paint_factory.cpp index 75599b35c..0774105fb 100644 --- a/src/meshlabplugins/edit_paint/edit_paint_factory.cpp +++ b/src/meshlabplugins/edit_paint/edit_paint_factory.cpp @@ -41,7 +41,7 @@ QList EditPaintFactory::actions() const } //get the edit tool for the given action -MeshEditInterface* EditPaintFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditPaintFactory::getMeshEditInterface(QAction *action) { if(action == editPaint) { diff --git a/src/meshlabplugins/edit_paint/edit_paint_factory.h b/src/meshlabplugins/edit_paint/edit_paint_factory.h index b0cfa6034..8d0a53d90 100644 --- a/src/meshlabplugins/edit_paint/edit_paint_factory.h +++ b/src/meshlabplugins/edit_paint/edit_paint_factory.h @@ -26,13 +26,13 @@ #define EditPaintFactoryPLUGIN_H #include -#include +#include -class EditPaintFactory : public QObject, public MeshEditInterfaceFactory +class EditPaintFactory : public QObject, public EditPluginInterfaceFactory { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) - Q_INTERFACES(MeshEditInterfaceFactory) + MESHLAB_PLUGIN_IID_EXPORTER(EDIT_PLUGIN_INTERFACE_FACTORY_IID) + Q_INTERFACES(EditPluginInterfaceFactory) public: EditPaintFactory(); @@ -42,7 +42,7 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual MeshEditInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(QAction *); //get the description for the given action virtual QString getEditToolDescription(QAction *); diff --git a/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.cpp b/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.cpp index dd9be7b87..cac26e0f9 100644 --- a/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.cpp +++ b/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.cpp @@ -41,7 +41,7 @@ QList EditPickPointsFactory::actions() const } //get the edit tool for the given action -MeshEditInterface* EditPickPointsFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditPickPointsFactory::getMeshEditInterface(QAction *action) { if(action == editPickPoints) { return new EditPickPointsPlugin(); diff --git a/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.h b/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.h index eeb9f7747..ca79241d5 100644 --- a/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.h +++ b/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.h @@ -26,13 +26,13 @@ #define EditPickPointsFactoryPLUGIN_H #include -#include +#include -class EditPickPointsFactory : public QObject, public MeshEditInterfaceFactory +class EditPickPointsFactory : public QObject, public EditPluginInterfaceFactory { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) - Q_INTERFACES(MeshEditInterfaceFactory) + MESHLAB_PLUGIN_IID_EXPORTER(EDIT_PLUGIN_INTERFACE_FACTORY_IID) + Q_INTERFACES(EditPluginInterfaceFactory) public: EditPickPointsFactory(); @@ -42,7 +42,7 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual MeshEditInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(QAction *); //get the description for the given action QString getEditToolDescription(QAction *); diff --git a/src/meshlabplugins/edit_pickpoints/editpickpoints.h b/src/meshlabplugins/edit_pickpoints/editpickpoints.h index 2afe76c62..e6d2168f8 100644 --- a/src/meshlabplugins/edit_pickpoints/editpickpoints.h +++ b/src/meshlabplugins/edit_pickpoints/editpickpoints.h @@ -30,13 +30,13 @@ #ifndef EDIT_PickPoints_PLUGIN_H #define EDIT_PickPoints_PLUGIN_H -#include +#include #include "pickpointsDialog.h" -class EditPickPointsPlugin : public QObject, public MeshEditInterface +class EditPickPointsPlugin : public QObject, public EditPluginInterface { Q_OBJECT - Q_INTERFACES(MeshEditInterface) + Q_INTERFACES(EditPluginInterface) public: //constructor diff --git a/src/meshlabplugins/edit_point/edit_point.h b/src/meshlabplugins/edit_point/edit_point.h index 175252bac..003a66dcf 100644 --- a/src/meshlabplugins/edit_point/edit_point.h +++ b/src/meshlabplugins/edit_point/edit_point.h @@ -25,12 +25,12 @@ #define EDITPOINTPLUGIN_H #include -#include +#include -class EditPointPlugin : public QObject, public MeshEditInterface +class EditPointPlugin : public QObject, public EditPluginInterface { Q_OBJECT - Q_INTERFACES(MeshEditInterface) + Q_INTERFACES(EditPluginInterface) public: enum {SELECT_DEFAULT_MODE, SELECT_FITTING_PLANE_MODE}; diff --git a/src/meshlabplugins/edit_point/edit_point_factory.cpp b/src/meshlabplugins/edit_point/edit_point_factory.cpp index c318ea87a..71e3a7160 100644 --- a/src/meshlabplugins/edit_point/edit_point_factory.cpp +++ b/src/meshlabplugins/edit_point/edit_point_factory.cpp @@ -43,7 +43,7 @@ QList PointEditFactory::actions() const } //get the edit tool for the given action -MeshEditInterface* PointEditFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* PointEditFactory::getMeshEditInterface(QAction *action) { if(action == editPoint) return new EditPointPlugin(EditPointPlugin::SELECT_DEFAULT_MODE); diff --git a/src/meshlabplugins/edit_point/edit_point_factory.h b/src/meshlabplugins/edit_point/edit_point_factory.h index 6aa44d2c0..03ce9048c 100644 --- a/src/meshlabplugins/edit_point/edit_point_factory.h +++ b/src/meshlabplugins/edit_point/edit_point_factory.h @@ -26,13 +26,13 @@ #define EditPointFactoryPLUGIN_H #include -#include +#include -class PointEditFactory : public QObject, public MeshEditInterfaceFactory +class PointEditFactory : public QObject, public EditPluginInterfaceFactory { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) - Q_INTERFACES(MeshEditInterfaceFactory) + MESHLAB_PLUGIN_IID_EXPORTER(EDIT_PLUGIN_INTERFACE_FACTORY_IID) + Q_INTERFACES(EditPluginInterfaceFactory) public: PointEditFactory(); @@ -42,7 +42,7 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual MeshEditInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(QAction *); //get the description for the given action virtual QString getEditToolDescription(QAction *); diff --git a/src/meshlabplugins/edit_quality/edit_quality_factory.cpp b/src/meshlabplugins/edit_quality/edit_quality_factory.cpp index 0fca870ca..13ea8d616 100644 --- a/src/meshlabplugins/edit_quality/edit_quality_factory.cpp +++ b/src/meshlabplugins/edit_quality/edit_quality_factory.cpp @@ -42,7 +42,7 @@ QList QualityMapperFactory::actions() const } //get the edit tool for the given action -MeshEditInterface* QualityMapperFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* QualityMapperFactory::getMeshEditInterface(QAction *action) { if(action == editQuality) { diff --git a/src/meshlabplugins/edit_quality/edit_quality_factory.h b/src/meshlabplugins/edit_quality/edit_quality_factory.h index cae2391fc..f2b3ab31a 100644 --- a/src/meshlabplugins/edit_quality/edit_quality_factory.h +++ b/src/meshlabplugins/edit_quality/edit_quality_factory.h @@ -26,13 +26,13 @@ #define QualityMapperFactoryPLUGIN_H #include -#include +#include -class QualityMapperFactory : public QObject, public MeshEditInterfaceFactory +class QualityMapperFactory : public QObject, public EditPluginInterfaceFactory { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) - Q_INTERFACES(MeshEditInterfaceFactory) + MESHLAB_PLUGIN_IID_EXPORTER(EDIT_PLUGIN_INTERFACE_FACTORY_IID) + Q_INTERFACES(EditPluginInterfaceFactory) public: QualityMapperFactory(); @@ -42,7 +42,7 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual MeshEditInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(QAction *); //get the description for the given action virtual QString getEditToolDescription(QAction *); diff --git a/src/meshlabplugins/edit_quality/qualitymapper.h b/src/meshlabplugins/edit_quality/qualitymapper.h index df4d1108a..d31e61eb1 100644 --- a/src/meshlabplugins/edit_quality/qualitymapper.h +++ b/src/meshlabplugins/edit_quality/qualitymapper.h @@ -34,14 +34,14 @@ FIRST RELEASE #include #include -#include +#include #include "qualitymapperdialog.h" //This class defines the plugin interface -class QualityMapperPlugin : public QObject, public MeshEditInterface +class QualityMapperPlugin : public QObject, public EditPluginInterface { Q_OBJECT - Q_INTERFACES(MeshEditInterface) + Q_INTERFACES(EditPluginInterface) private: QualityMapperDialog *_qualityMapperDialog; diff --git a/src/meshlabplugins/edit_referencing/edit_referencing.h b/src/meshlabplugins/edit_referencing/edit_referencing.h index f92844e5d..24efc090c 100644 --- a/src/meshlabplugins/edit_referencing/edit_referencing.h +++ b/src/meshlabplugins/edit_referencing/edit_referencing.h @@ -25,17 +25,17 @@ #define EDITREFERENCINGPLUGIN_H #include -#include +#include #include "edit_referencingDialog.h" // function to calculate rototranslaton and rototranslaton+scale matrices from series of points #include -class EditReferencingPlugin : public QObject, public MeshEditInterface +class EditReferencingPlugin : public QObject, public EditPluginInterface { Q_OBJECT - Q_INTERFACES(MeshEditInterface) + Q_INTERFACES(EditPluginInterface) public: diff --git a/src/meshlabplugins/edit_referencing/edit_referencing_factory.cpp b/src/meshlabplugins/edit_referencing/edit_referencing_factory.cpp index c75414d8b..d9d48af09 100644 --- a/src/meshlabplugins/edit_referencing/edit_referencing_factory.cpp +++ b/src/meshlabplugins/edit_referencing/edit_referencing_factory.cpp @@ -41,7 +41,7 @@ QList EditReferencingFactory::actions() const } //get the edit tool for the given action -MeshEditInterface* EditReferencingFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditReferencingFactory::getMeshEditInterface(QAction *action) { if(action == editReferencing) { diff --git a/src/meshlabplugins/edit_referencing/edit_referencing_factory.h b/src/meshlabplugins/edit_referencing/edit_referencing_factory.h index 5fe2f93bf..bef05b70d 100644 --- a/src/meshlabplugins/edit_referencing/edit_referencing_factory.h +++ b/src/meshlabplugins/edit_referencing/edit_referencing_factory.h @@ -25,13 +25,13 @@ #define EditReferencingFactoryPLUGIN_H #include -#include +#include -class EditReferencingFactory : public QObject, public MeshEditInterfaceFactory +class EditReferencingFactory : public QObject, public EditPluginInterfaceFactory { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) - Q_INTERFACES(MeshEditInterfaceFactory) + MESHLAB_PLUGIN_IID_EXPORTER(EDIT_PLUGIN_INTERFACE_FACTORY_IID) + Q_INTERFACES(EditPluginInterfaceFactory) public: EditReferencingFactory(); @@ -41,7 +41,7 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual MeshEditInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(QAction *); //get the description for the given action virtual QString getEditToolDescription(QAction *); diff --git a/src/meshlabplugins/edit_sample/edit_sample.h b/src/meshlabplugins/edit_sample/edit_sample.h index 1e3a3600a..4f43f247e 100644 --- a/src/meshlabplugins/edit_sample/edit_sample.h +++ b/src/meshlabplugins/edit_sample/edit_sample.h @@ -25,12 +25,12 @@ #define SAMPLEEDITPLUGIN_H #include -#include +#include -class SampleEditPlugin : public QObject, public MeshEditInterface +class SampleEditPlugin : public QObject, public EditPluginInterface { Q_OBJECT - Q_INTERFACES(MeshEditInterface) + Q_INTERFACES(EditPluginInterface) public: SampleEditPlugin(); diff --git a/src/meshlabplugins/edit_sample/edit_sample_factory.cpp b/src/meshlabplugins/edit_sample/edit_sample_factory.cpp index c108229a5..101011e18 100644 --- a/src/meshlabplugins/edit_sample/edit_sample_factory.cpp +++ b/src/meshlabplugins/edit_sample/edit_sample_factory.cpp @@ -41,7 +41,7 @@ QList SampleEditFactory::actions() const } //get the edit tool for the given action -MeshEditInterface* SampleEditFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* SampleEditFactory::getMeshEditInterface(QAction *action) { if(action == editSample) { diff --git a/src/meshlabplugins/edit_sample/edit_sample_factory.h b/src/meshlabplugins/edit_sample/edit_sample_factory.h index 5c9faf6c1..dfd48b976 100644 --- a/src/meshlabplugins/edit_sample/edit_sample_factory.h +++ b/src/meshlabplugins/edit_sample/edit_sample_factory.h @@ -26,13 +26,13 @@ #define SampleEditFactoryPLUGIN_H #include -#include +#include -class SampleEditFactory : public QObject, public MeshEditInterfaceFactory +class SampleEditFactory : public QObject, public EditPluginInterfaceFactory { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) - Q_INTERFACES(MeshEditInterfaceFactory) + MESHLAB_PLUGIN_IID_EXPORTER(EDIT_PLUGIN_INTERFACE_FACTORY_IID) + Q_INTERFACES(EditPluginInterfaceFactory) public: SampleEditFactory(); @@ -42,7 +42,7 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual MeshEditInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(QAction *); //get the description for the given action virtual QString getEditToolDescription(QAction *); diff --git a/src/meshlabplugins/edit_select/edit_select.h b/src/meshlabplugins/edit_select/edit_select.h index 1b71edb82..a5a95d619 100644 --- a/src/meshlabplugins/edit_select/edit_select.h +++ b/src/meshlabplugins/edit_select/edit_select.h @@ -23,12 +23,12 @@ #ifndef EDITPLUGIN_H #define EDITPLUGIN_H -#include +#include -class EditSelectPlugin : public QObject, public MeshEditInterface +class EditSelectPlugin : public QObject, public EditPluginInterface { Q_OBJECT - Q_INTERFACES(MeshEditInterface) + Q_INTERFACES(EditPluginInterface) public: diff --git a/src/meshlabplugins/edit_select/edit_select_factory.cpp b/src/meshlabplugins/edit_select/edit_select_factory.cpp index 306fa337d..fb1b90165 100644 --- a/src/meshlabplugins/edit_select/edit_select_factory.cpp +++ b/src/meshlabplugins/edit_select/edit_select_factory.cpp @@ -47,7 +47,7 @@ QList EditSelectFactory::actions() const } //get the edit tool for the given action -MeshEditInterface* EditSelectFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditSelectFactory::getMeshEditInterface(QAction *action) { if(action == editSelect) return new EditSelectPlugin(EditSelectPlugin::SELECT_FACE_MODE); diff --git a/src/meshlabplugins/edit_select/edit_select_factory.h b/src/meshlabplugins/edit_select/edit_select_factory.h index 6ed1ecc2e..66749a3d9 100644 --- a/src/meshlabplugins/edit_select/edit_select_factory.h +++ b/src/meshlabplugins/edit_select/edit_select_factory.h @@ -25,13 +25,13 @@ #ifndef EditSelectFactoryPLUGIN_H #define EditSelectFactoryPLUGIN_H -#include +#include -class EditSelectFactory : public QObject, public MeshEditInterfaceFactory +class EditSelectFactory : public QObject, public EditPluginInterfaceFactory { Q_OBJECT - MESHLAB_PLUGIN_IID_EXPORTER(MESH_EDIT_INTERFACE_FACTORY_IID) - Q_INTERFACES(MeshEditInterfaceFactory) + MESHLAB_PLUGIN_IID_EXPORTER(EDIT_PLUGIN_INTERFACE_FACTORY_IID) + Q_INTERFACES(EditPluginInterfaceFactory) public: EditSelectFactory(); @@ -41,7 +41,7 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual MeshEditInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(QAction *); //get the description for the given action virtual QString getEditToolDescription(QAction *); From 2a7b5fa81e94f11aac2d7548878157850b16b754 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 18 Sep 2020 16:43:19 +0200 Subject: [PATCH 34/49] removed interfaces.h and interfaces.cpp --- src/common/CMakeLists.txt | 2 - src/common/common.pro | 2 - src/common/interfaces.cpp | 3 - src/common/interfaces.h | 58 ------------------- src/common/pluginmanager.cpp | 4 ++ src/common/pluginmanager.h | 2 +- src/meshlab/glarea.cpp | 3 +- src/meshlab/glarea.h | 1 - src/meshlab/layerDialog.cpp | 1 + src/meshlab/mainwindow_Init.cpp | 2 +- src/meshlab/mainwindow_RunTime.cpp | 5 ++ src/meshlab/meshlab.pro | 1 - .../meshlab_settings/settingdialog.cpp | 2 + src/meshlab/multiViewer_Container.cpp | 1 + src/meshlab/plugindialog.cpp | 3 +- .../richparameterwidgets.cpp | 2 + .../rich_parameter_gui/richparameterwidgets.h | 2 +- src/meshlab/savemaskexporter.h | 2 + .../edit_align/AlignPairDialog.h | 1 - src/meshlabplugins/edit_align/edit_align.cpp | 2 + src/meshlabplugins/edit_align/meshtree.h | 2 +- .../edit_measure/edit_measure.cpp | 2 + .../edit_pickpoints/pickpointsDialog.cpp | 2 + .../edit_quality/qualitymapper.cpp | 1 + .../edit_quality/qualitymapperdialog.cpp | 1 + .../edit_referencing/edit_referencing.cpp | 1 + .../edit_select/edit_select.cpp | 1 + .../filter_color_projection/rastering.h | 4 +- .../filter_color_projection/render_helper.cpp | 2 +- src/meshlabplugins/filter_dirt/dirt_utils.h | 1 - src/meshlabplugins/filter_dirt/dustparticle.h | 1 - src/meshlabplugins/filter_dirt/particle.h | 1 - .../filter_mls/mlsmarchingcube.h | 1 + src/meshlabplugins/filter_mls/mlsplugin.cpp | 2 - .../filter_mutualglobal/alignGlobal.h | 3 +- .../filter_mutualglobal.cpp | 2 + .../filter_sample_dyn/filter_sample_dyn.cpp | 1 - .../filter_sdfgpu/filterinterface.h | 4 +- .../filter_ssynth/filter_ssynth.cpp | 1 - src/meshlabplugins/filter_texture/rastering.h | 5 +- src/meshlabplugins/io_u3d/io_u3d.cpp | 2 + src/meshlabplugins/render_gdp/meshrender.cpp | 2 + src/meshlabserver/mainserver.cpp | 3 +- vcglib | 2 +- 44 files changed, 54 insertions(+), 92 deletions(-) delete mode 100644 src/common/interfaces.cpp delete mode 100644 src/common/interfaces.h diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 0b6ebcd51..e62cd1ba7 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -19,7 +19,6 @@ set(SOURCES GLExtensionsManager.cpp GLLogStream.cpp filterscript.cpp - interfaces.cpp meshlabdocumentbundler.cpp meshlabdocumentxml.cpp meshmodel.cpp @@ -43,7 +42,6 @@ set(HEADERS GLExtensionsManager.h GLLogStream.h filterscript.h - interfaces.h meshlabdocumentbundler.h meshlabdocumentxml.h meshmodel.h diff --git a/src/common/common.pro b/src/common/common.pro index 8f49d2df6..ad6c66f47 100644 --- a/src/common/common.pro +++ b/src/common/common.pro @@ -47,7 +47,6 @@ HEADERS += \ filter_parameter/rich_parameter.h \ filterscript.h \ GLLogStream.h \ - interfaces.h \ interfaces/decorate_plugin_interface.h \ interfaces/edit_plugin_interface.h \ interfaces/filter_plugin_interface.h \ @@ -70,7 +69,6 @@ SOURCES += \ filter_parameter/rich_parameter.cpp \ filter_parameter/rich_parameter_list.cpp \ filter_parameter/value.cpp \ - interfaces.cpp \ filterscript.cpp \ GLLogStream.cpp \ interfaces/filter_plugin_interface.cpp \ diff --git a/src/common/interfaces.cpp b/src/common/interfaces.cpp deleted file mode 100644 index faf9d662c..000000000 --- a/src/common/interfaces.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "interfaces.h" - - diff --git a/src/common/interfaces.h b/src/common/interfaces.h deleted file mode 100644 index be3397a02..000000000 --- a/src/common/interfaces.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -* MeshLab o o * -* A versatile mesh processing toolbox o o * -* _ O _ * -* Copyright(C) 2005-2008 \/)\/ * -* Visual Computing Lab /\/| * -* ISTI - Italian National Research Council | * -* \ * -* All rights reserved. * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * -* for more details. * -* * -****************************************************************************/ - -#ifndef MESHLAB_INTERFACES_H -#define MESHLAB_INTERFACES_H -//#include - -#include "interfaces/plugin_interface.h" -#include "GLLogStream.h" -#include "meshmodel.h" - -#include -#include -#include -#include -#include -#include -#include -#include - - -class QWidget; -class QGLWidget; -class QString; -class QVariant; -class QMouseEvent; -class QTreeWidgetItem; -class MeshModel; -class RenderMode; -class GLArea; -class GLAreaReg; - -class MeshModel; - - - - -#endif diff --git a/src/common/pluginmanager.cpp b/src/common/pluginmanager.cpp index ee588be5a..5a1ccfaa8 100644 --- a/src/common/pluginmanager.cpp +++ b/src/common/pluginmanager.cpp @@ -1,10 +1,14 @@ #include "pluginmanager.h" #include +#include +#include +#include #include #include "mlexception.h" + static QString DLLExtension() { #if defined(Q_OS_WIN) return QString("dll"); diff --git a/src/common/pluginmanager.h b/src/common/pluginmanager.h index 8e7781d51..f10982470 100644 --- a/src/common/pluginmanager.h +++ b/src/common/pluginmanager.h @@ -24,7 +24,6 @@ #ifndef PLUGINMANAGER_H #define PLUGINMANAGER_H -#include "interfaces.h" #include "interfaces/filter_plugin_interface.h" #include "interfaces/io_plugin_interface.h" #include "interfaces/render_plugin_interface.h" @@ -35,6 +34,7 @@ #include #include +#include /** \brief This class provides the basic tools for managing all the plugins. It is used by both meshlab and meshlab server. diff --git a/src/meshlab/glarea.cpp b/src/meshlab/glarea.cpp index 7da4c7a85..99c389d64 100644 --- a/src/meshlab/glarea.cpp +++ b/src/meshlab/glarea.cpp @@ -23,7 +23,6 @@ -#include #include #include "glarea.h" @@ -35,6 +34,8 @@ #include #include #include +#include +#include #include #include diff --git a/src/meshlab/glarea.h b/src/meshlab/glarea.h index a362fb950..1e91b714f 100644 --- a/src/meshlab/glarea.h +++ b/src/meshlab/glarea.h @@ -36,7 +36,6 @@ #include #include -#include #include #include #include diff --git a/src/meshlab/layerDialog.cpp b/src/meshlab/layerDialog.cpp index b58914d2d..c668e6d72 100644 --- a/src/meshlab/layerDialog.cpp +++ b/src/meshlab/layerDialog.cpp @@ -32,6 +32,7 @@ $Log: stdpardialog.cpp,v $ #include #include #include +#include #include "mainwindow.h" #include "ui_layerDialog.h" diff --git a/src/meshlab/mainwindow_Init.cpp b/src/meshlab/mainwindow_Init.cpp index 00ded8b2f..6a1c9b092 100644 --- a/src/meshlab/mainwindow_Init.cpp +++ b/src/meshlab/mainwindow_Init.cpp @@ -22,7 +22,6 @@ ****************************************************************************/ -#include "../common/interfaces.h" #include "../common/searcher.h" #include "../common/mlapplication.h" #include "../common/mlexception.h" @@ -39,6 +38,7 @@ #include #include #include +#include #include "mainwindow.h" #include "plugindialog.h" #include "meshlab_settings/meshlabsettingsdialog.h" diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index 15b5b864a..d60b40009 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -39,6 +39,11 @@ #include #include #include +#include +#include +#include +#include +#include #include "../common/meshlabdocumentxml.h" #include "../common/meshlabdocumentbundler.h" diff --git a/src/meshlab/meshlab.pro b/src/meshlab/meshlab.pro index 4e492a184..e8267c6d0 100644 --- a/src/meshlab/meshlab.pro +++ b/src/meshlab/meshlab.pro @@ -28,7 +28,6 @@ DEPENDPATH += \ $$VCGDIR/wrap HEADERS += \ - ../common/interfaces.h \ mainwindow.h \ glarea.h \ meshlab_settings/meshlabsettingsdialog.h \ diff --git a/src/meshlab/meshlab_settings/settingdialog.cpp b/src/meshlab/meshlab_settings/settingdialog.cpp index e69a4fb52..19cd0601f 100644 --- a/src/meshlab/meshlab_settings/settingdialog.cpp +++ b/src/meshlab/meshlab_settings/settingdialog.cpp @@ -23,6 +23,8 @@ #include "settingdialog.h" +#include + SettingDialog::SettingDialog( const RichParameter& currentParam, const RichParameter& defaultParam, diff --git a/src/meshlab/multiViewer_Container.cpp b/src/meshlab/multiViewer_Container.cpp index 051fd6793..524224fcc 100644 --- a/src/meshlab/multiViewer_Container.cpp +++ b/src/meshlab/multiViewer_Container.cpp @@ -23,6 +23,7 @@ #include "multiViewer_Container.h" #include "glarea.h" #include +#include #include "mainwindow.h" #include diff --git a/src/meshlab/plugindialog.cpp b/src/meshlab/plugindialog.cpp index eb7367ac8..9c88db368 100644 --- a/src/meshlab/plugindialog.cpp +++ b/src/meshlab/plugindialog.cpp @@ -22,7 +22,6 @@ ****************************************************************************/ #include "plugindialog.h" -#include #include #include #include @@ -32,6 +31,8 @@ #include +#include +#include #include #include #include diff --git a/src/meshlab/rich_parameter_gui/richparameterwidgets.cpp b/src/meshlab/rich_parameter_gui/richparameterwidgets.cpp index dcfe5c365..4215ae78a 100644 --- a/src/meshlab/rich_parameter_gui/richparameterwidgets.cpp +++ b/src/meshlab/rich_parameter_gui/richparameterwidgets.cpp @@ -26,6 +26,8 @@ #include #include #include +#include +#include /******************************************/ // MeshLabWidget Implementation diff --git a/src/meshlab/rich_parameter_gui/richparameterwidgets.h b/src/meshlab/rich_parameter_gui/richparameterwidgets.h index 710ff890e..a82898a0c 100644 --- a/src/meshlab/rich_parameter_gui/richparameterwidgets.h +++ b/src/meshlab/rich_parameter_gui/richparameterwidgets.h @@ -34,8 +34,8 @@ #include #include -#include "common/interfaces.h" #include "common/filter_parameter/rich_parameter_list.h" +#include "common/ml_mesh_type.h" class RichParameterWidget : public QWidget { diff --git a/src/meshlab/savemaskexporter.h b/src/meshlab/savemaskexporter.h index b8b1e358e..ab8c3e570 100644 --- a/src/meshlab/savemaskexporter.h +++ b/src/meshlab/savemaskexporter.h @@ -24,6 +24,8 @@ #ifndef __VCGLIB_SAVEMASK_EXPORT #define __VCGLIB_SAVEMASK_EXPORT +#include + #include #include "rich_parameter_gui/richparameterlistframe.h" diff --git a/src/meshlabplugins/edit_align/AlignPairDialog.h b/src/meshlabplugins/edit_align/AlignPairDialog.h index a4a468240..79a41475f 100644 --- a/src/meshlabplugins/edit_align/AlignPairDialog.h +++ b/src/meshlabplugins/edit_align/AlignPairDialog.h @@ -25,7 +25,6 @@ class QCheckBox; -#include #include "AlignPairWidget.h" #include diff --git a/src/meshlabplugins/edit_align/edit_align.cpp b/src/meshlabplugins/edit_align/edit_align.cpp index 6b66581e5..042afe479 100644 --- a/src/meshlabplugins/edit_align/edit_align.cpp +++ b/src/meshlabplugins/edit_align/edit_align.cpp @@ -37,6 +37,8 @@ $Log: meshedit.cpp,v $ #include #include +#include + using namespace vcg; //todo: remove these orrible defs from here diff --git a/src/meshlabplugins/edit_align/meshtree.h b/src/meshlabplugins/edit_align/meshtree.h index 856123b90..31e8d854a 100644 --- a/src/meshlabplugins/edit_align/meshtree.h +++ b/src/meshlabplugins/edit_align/meshtree.h @@ -26,7 +26,7 @@ #include -#include +#include #include #include "align/AlignGlobal.h" #include "align/OccupancyGrid.h" diff --git a/src/meshlabplugins/edit_measure/edit_measure.cpp b/src/meshlabplugins/edit_measure/edit_measure.cpp index 0fa03af63..aee30fe67 100644 --- a/src/meshlabplugins/edit_measure/edit_measure.cpp +++ b/src/meshlabplugins/edit_measure/edit_measure.cpp @@ -29,6 +29,8 @@ $Log: editmeasure.cpp,v $ #include "edit_measure.h" #include +#include + using namespace vcg; EditMeasurePlugin::EditMeasurePlugin() diff --git a/src/meshlabplugins/edit_pickpoints/pickpointsDialog.cpp b/src/meshlabplugins/edit_pickpoints/pickpointsDialog.cpp index bcafa572d..96529e862 100644 --- a/src/meshlabplugins/edit_pickpoints/pickpointsDialog.cpp +++ b/src/meshlabplugins/edit_pickpoints/pickpointsDialog.cpp @@ -40,6 +40,8 @@ #include #include +#include +#include using namespace vcg; diff --git a/src/meshlabplugins/edit_quality/qualitymapper.cpp b/src/meshlabplugins/edit_quality/qualitymapper.cpp index 0937766f8..6c2f2773d 100644 --- a/src/meshlabplugins/edit_quality/qualitymapper.cpp +++ b/src/meshlabplugins/edit_quality/qualitymapper.cpp @@ -32,6 +32,7 @@ FIRST RELEASE #include #include "qualitymapper.h" #include //for quality +#include using namespace vcg; diff --git a/src/meshlabplugins/edit_quality/qualitymapperdialog.cpp b/src/meshlabplugins/edit_quality/qualitymapperdialog.cpp index 59428d945..4cab4aed4 100644 --- a/src/meshlabplugins/edit_quality/qualitymapperdialog.cpp +++ b/src/meshlabplugins/edit_quality/qualitymapperdialog.cpp @@ -27,6 +27,7 @@ #include #include #include +#include using namespace vcg; diff --git a/src/meshlabplugins/edit_referencing/edit_referencing.cpp b/src/meshlabplugins/edit_referencing/edit_referencing.cpp index 0b081200b..3e09e2d43 100644 --- a/src/meshlabplugins/edit_referencing/edit_referencing.cpp +++ b/src/meshlabplugins/edit_referencing/edit_referencing.cpp @@ -30,6 +30,7 @@ #include "edit_referencingDialog.h" #include +#include #define MAX_REFPOINTS 128 diff --git a/src/meshlabplugins/edit_select/edit_select.cpp b/src/meshlabplugins/edit_select/edit_select.cpp index d2ce5cc05..e4805dc33 100644 --- a/src/meshlabplugins/edit_select/edit_select.cpp +++ b/src/meshlabplugins/edit_select/edit_select.cpp @@ -27,6 +27,7 @@ #include #include #include +#include using namespace std; diff --git a/src/meshlabplugins/filter_color_projection/rastering.h b/src/meshlabplugins/filter_color_projection/rastering.h index a470eec19..5ee63315b 100644 --- a/src/meshlabplugins/filter_color_projection/rastering.h +++ b/src/meshlabplugins/filter_color_projection/rastering.h @@ -25,16 +25,16 @@ #define _RASTERING_H #include -#include #include #include +#include // texel descriptor--------------------------------- typedef struct{ - Point2i texcoord; + vcg::Point2i texcoord; Point3m meshpoint; Point3m meshnormal; diff --git a/src/meshlabplugins/filter_color_projection/render_helper.cpp b/src/meshlabplugins/filter_color_projection/render_helper.cpp index dd143405f..ad9861414 100644 --- a/src/meshlabplugins/filter_color_projection/render_helper.cpp +++ b/src/meshlabplugins/filter_color_projection/render_helper.cpp @@ -22,11 +22,11 @@ ****************************************************************************/ #include +#include #include #include #include -#include #include "render_helper.h" diff --git a/src/meshlabplugins/filter_dirt/dirt_utils.h b/src/meshlabplugins/filter_dirt/dirt_utils.h index d6308b580..b0860697f 100644 --- a/src/meshlabplugins/filter_dirt/dirt_utils.h +++ b/src/meshlabplugins/filter_dirt/dirt_utils.h @@ -32,7 +32,6 @@ #include #include #include -#include #include "particle.h" using namespace vcg; diff --git a/src/meshlabplugins/filter_dirt/dustparticle.h b/src/meshlabplugins/filter_dirt/dustparticle.h index c69abecb7..16321f176 100644 --- a/src/meshlabplugins/filter_dirt/dustparticle.h +++ b/src/meshlabplugins/filter_dirt/dustparticle.h @@ -24,7 +24,6 @@ #define DUSTPARTICLE_H #include #include -#include #include #include #include diff --git a/src/meshlabplugins/filter_dirt/particle.h b/src/meshlabplugins/filter_dirt/particle.h index 21445155d..2822ceb31 100644 --- a/src/meshlabplugins/filter_dirt/particle.h +++ b/src/meshlabplugins/filter_dirt/particle.h @@ -25,7 +25,6 @@ #include #include -#include #include template diff --git a/src/meshlabplugins/filter_mls/mlsmarchingcube.h b/src/meshlabplugins/filter_mls/mlsmarchingcube.h index dcbe76d88..db1c77c4e 100644 --- a/src/meshlabplugins/filter_mls/mlsmarchingcube.h +++ b/src/meshlabplugins/filter_mls/mlsmarchingcube.h @@ -26,6 +26,7 @@ #include #include +#include #include #include "mlssurface.h" diff --git a/src/meshlabplugins/filter_mls/mlsplugin.cpp b/src/meshlabplugins/filter_mls/mlsplugin.cpp index 58c75d44d..eda00dae0 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.cpp +++ b/src/meshlabplugins/filter_mls/mlsplugin.cpp @@ -26,8 +26,6 @@ #include #include -#include - #include #include #include diff --git a/src/meshlabplugins/filter_mutualglobal/alignGlobal.h b/src/meshlabplugins/filter_mutualglobal/alignGlobal.h index 64afe174b..9d8664f54 100644 --- a/src/meshlabplugins/filter_mutualglobal/alignGlobal.h +++ b/src/meshlabplugins/filter_mutualglobal/alignGlobal.h @@ -33,8 +33,7 @@ add sampleplugins #ifndef ALIGNGLOBAL_H #define ALIGNGLOBAL_H -#include - +#include class AlignPair { diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp index 4f5425a3f..2b1183171 100644 --- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp +++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp @@ -38,6 +38,8 @@ #include +#include + // Constructor usually performs only two simple tasks of filling the two lists // - typeList: with all the possible id of the filtering actions // - actionList with the corresponding actions. If you want to add icons to your filtering actions you can do here by construction the QActions accordingly diff --git a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp index 93c1688e7..f5ae908b3 100644 --- a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp +++ b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp @@ -21,7 +21,6 @@ * * ****************************************************************************/ -#include #include #include diff --git a/src/meshlabplugins/filter_sdfgpu/filterinterface.h b/src/meshlabplugins/filter_sdfgpu/filterinterface.h index 93bfc311d..5ddef5188 100644 --- a/src/meshlabplugins/filter_sdfgpu/filterinterface.h +++ b/src/meshlabplugins/filter_sdfgpu/filterinterface.h @@ -1,6 +1,8 @@ #ifndef SINGLEMESHFILTERINTERFACE_H #define SINGLEMESHFILTERINTERFACE_H -#include "common/interfaces.h" +#include "common/interfaces/filter_plugin_interface.h" + +#include /** * @brief The interface for a filter plugin which defines a *single* action diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp index b3579e1ef..04441920f 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp @@ -2,7 +2,6 @@ #include "filter_ssynth.h" #include #include -#include #include #include #undef __GLEW_H__ //terrible workaround to avoid problem with #warning in visual studio diff --git a/src/meshlabplugins/filter_texture/rastering.h b/src/meshlabplugins/filter_texture/rastering.h index 30f4b1102..e736d9a28 100644 --- a/src/meshlabplugins/filter_texture/rastering.h +++ b/src/meshlabplugins/filter_texture/rastering.h @@ -24,7 +24,7 @@ #ifndef _RASTERING_H #define _RASTERING_H -#include +#include #include #include @@ -33,7 +33,6 @@ class VertexSampler typedef vcg::GridStaticPtr MetroMeshGrid; typedef vcg::tri::FaceTmark MarkerFace; - CMeshO &srcMesh; vector &srcImgs; float dist_upper_bound; @@ -47,7 +46,7 @@ class VertexSampler public: VertexSampler(CMeshO &_srcMesh, vector &_srcImg, float upperBound) : - srcMesh(_srcMesh), srcImgs(_srcImg), dist_upper_bound(upperBound) + srcImgs(_srcImg), dist_upper_bound(upperBound) { unifGridFace.Set(_srcMesh.face.begin(),_srcMesh.face.end()); markerFunctor.SetMesh(&_srcMesh); diff --git a/src/meshlabplugins/io_u3d/io_u3d.cpp b/src/meshlabplugins/io_u3d/io_u3d.cpp index 71fb5ddc3..fa8286edc 100644 --- a/src/meshlabplugins/io_u3d/io_u3d.cpp +++ b/src/meshlabplugins/io_u3d/io_u3d.cpp @@ -34,6 +34,8 @@ #include #include +#include +#include #include "Converter.h" using namespace std; diff --git a/src/meshlabplugins/render_gdp/meshrender.cpp b/src/meshlabplugins/render_gdp/meshrender.cpp index 6a63d4cdf..86055ae1c 100644 --- a/src/meshlabplugins/render_gdp/meshrender.cpp +++ b/src/meshlabplugins/render_gdp/meshrender.cpp @@ -28,6 +28,8 @@ #include "meshrender.h" #include #include +#include +#include #include "../../meshlab/glarea.h" using namespace std; diff --git a/src/meshlabserver/mainserver.cpp b/src/meshlabserver/mainserver.cpp index 592523489..864d513fc 100644 --- a/src/meshlabserver/mainserver.cpp +++ b/src/meshlabserver/mainserver.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -38,6 +37,8 @@ #include #include +#include +#include class FilterData diff --git a/vcglib b/vcglib index 94cc728dd..62f16491e 160000 --- a/vcglib +++ b/vcglib @@ -1 +1 @@ -Subproject commit 94cc728ddb9774eee62b84bcb1fe1cf252e03841 +Subproject commit 62f16491ea1835dced9da876bff9cb3f56f8b7f6 From 29c493db263fe2ee8eac5a4dac22f05de59d09a0 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 18 Sep 2020 16:48:01 +0200 Subject: [PATCH 35/49] fix cmake build --- src/common/interfaces/edit_plugin_interface.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/interfaces/edit_plugin_interface.h b/src/common/interfaces/edit_plugin_interface.h index 3640d5a1a..27f180952 100644 --- a/src/common/interfaces/edit_plugin_interface.h +++ b/src/common/interfaces/edit_plugin_interface.h @@ -24,6 +24,8 @@ #ifndef MESHLAB_EDIT_PLUGIN_INTERFACE_H #define MESHLAB_EDIT_PLUGIN_INTERFACE_H +#include + #include "plugin_interface.h" #include "../meshmodel.h" From 215fbffde28398b77ed1b45da6b4023074626b2b Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 18 Sep 2020 17:01:21 +0200 Subject: [PATCH 36/49] fix mutualglobal cmake --- src/meshlabplugins/filter_mutualglobal/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/meshlabplugins/filter_mutualglobal/CMakeLists.txt b/src/meshlabplugins/filter_mutualglobal/CMakeLists.txt index 18c1818af..fa096a29e 100644 --- a/src/meshlabplugins/filter_mutualglobal/CMakeLists.txt +++ b/src/meshlabplugins/filter_mutualglobal/CMakeLists.txt @@ -9,7 +9,6 @@ if(TARGET external-newuoa AND TARGET external-levmar) set(SOURCES - alignGlobal.cpp alignset.cpp filter_mutualglobal.cpp levmarmethods.cpp @@ -19,7 +18,6 @@ if(TARGET external-newuoa AND TARGET external-levmar) solver.cpp) set(HEADERS - alignGlobal.h alignset.h filter_mutualglobal.h levmarmethods.h From 3e5f6d36ea92cfd9fa2b3a11f1c40c80465e1c28 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 18 Sep 2020 17:41:42 +0200 Subject: [PATCH 37/49] const correctness decorate plugins --- src/common/CMakeLists.txt | 10 +-- src/common/common.pro | 1 + .../interfaces/decorate_plugin_interface.cpp | 42 ++++++++++++ .../interfaces/decorate_plugin_interface.h | 64 +++++-------------- .../decorate_background.cpp | 4 +- .../decorate_background/decorate_background.h | 8 +-- .../decorate_base/decorate_base.cpp | 14 ++-- .../decorate_base/decorate_base.h | 14 ++-- .../decorate_raster_proj.cpp | 33 +++++----- .../decorate_raster_proj.h | 10 +-- 10 files changed, 107 insertions(+), 93 deletions(-) create mode 100644 src/common/interfaces/decorate_plugin_interface.cpp diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index e62cd1ba7..e55628e25 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -14,8 +14,9 @@ set(SOURCES filter_parameter/rich_parameter.cpp filter_parameter/rich_parameter_list.cpp filter_parameter/value.cpp - interfaces/plugin_interface.cpp + interfaces/decorate_plugin_interface.cpp interfaces/filter_plugin_interface.cpp + interfaces/plugin_interface.cpp GLExtensionsManager.cpp GLLogStream.cpp filterscript.cpp @@ -33,12 +34,13 @@ set(HEADERS filter_parameter/rich_parameter.h filter_parameter/rich_parameter_list.h filter_parameter/value.h - interfaces/mainwindow_interface.h - interfaces/plugin_interface.h + interfaces/decorate_plugin_interface.h + interfaces/edit_plugin_interface.h interfaces/filter_plugin_interface.h interfaces/io_plugin_interface.h + interfaces/mainwindow_interface.h + interfaces/plugin_interface.h interfaces/render_plugin_interface.h - interfaces/edit_plugin_interface.h GLExtensionsManager.h GLLogStream.h filterscript.h diff --git a/src/common/common.pro b/src/common/common.pro index ad6c66f47..ee57d0e48 100644 --- a/src/common/common.pro +++ b/src/common/common.pro @@ -71,6 +71,7 @@ SOURCES += \ filter_parameter/value.cpp \ filterscript.cpp \ GLLogStream.cpp \ + interfaces/decorate_plugin_interface.cpp \ interfaces/filter_plugin_interface.cpp \ interfaces/plugin_interface.cpp \ meshmodel.cpp \ diff --git a/src/common/interfaces/decorate_plugin_interface.cpp b/src/common/interfaces/decorate_plugin_interface.cpp new file mode 100644 index 000000000..51d503814 --- /dev/null +++ b/src/common/interfaces/decorate_plugin_interface.cpp @@ -0,0 +1,42 @@ +#include "decorate_plugin_interface.h" + +QAction* DecoratePluginInterface::action(QString name) const +{ + QString n = name; + foreach(QAction *tt, actions()) + if (name == this->decorationName(ID(tt))) return tt; + n.replace("&",""); + foreach(QAction *tt, actions()) + if (n == this->decorationName(ID(tt))) return tt; + + qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name)); + return 0; +} + +PluginInterface::FilterIDType DecoratePluginInterface::ID(const QAction* a) const +{ + QString aa=a->text(); + foreach(FilterIDType tt, types()) + if (a->text() == this->decorationName(tt)) return tt; + aa.replace("&",""); + foreach(FilterIDType tt, types()) + if (aa == this->decorationName(tt)) return tt; + + qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(a->text())); + assert(0); + return -1; +} + +PluginInterface::FilterIDType DecoratePluginInterface::ID(QString name) const +{ + QString n = name; + foreach(FilterIDType tt, types()) + if (name == this->decorationName(tt)) return tt; + n.replace("&",""); + foreach(FilterIDType tt, types()) + if (n == this->decorationName(tt)) return tt; + + qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name)); + assert(0); + return -1; +} diff --git a/src/common/interfaces/decorate_plugin_interface.h b/src/common/interfaces/decorate_plugin_interface.h index 2fdce7237..8993c2e59 100644 --- a/src/common/interfaces/decorate_plugin_interface.h +++ b/src/common/interfaces/decorate_plugin_interface.h @@ -77,16 +77,16 @@ public: virtual QString decorationName(FilterIDType) const = 0; virtual QString decorationInfo(FilterIDType) const = 0; - virtual QString decorationName(QAction *a) const { return decorationName(ID(a)); } - virtual QString decorationInfo(QAction *a) const { return decorationInfo(ID(a)); } + virtual QString decorationName(const QAction *a) const { return decorationName(ID(a)); } + virtual QString decorationInfo(const QAction *a) const { return decorationInfo(ID(a)); } - virtual bool startDecorate(QAction *, MeshDocument &, const RichParameterList *, GLArea *) { return false; } - virtual bool startDecorate(QAction *, MeshModel &, const RichParameterList *, GLArea *) { return false; } - virtual void decorateMesh(QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &) = 0; - virtual void decorateDoc(QAction *, MeshDocument &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &) = 0; - virtual void endDecorate(QAction *, MeshModel &, const RichParameterList *, GLArea *) {} - virtual void endDecorate(QAction *, MeshDocument &, const RichParameterList *, GLArea *) {} + virtual bool startDecorate(const QAction *, MeshDocument &, const RichParameterList *, GLArea *) { return false; } + virtual bool startDecorate(const QAction *, MeshModel &, const RichParameterList *, GLArea *) { return false; } + virtual void decorateMesh(const QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &) = 0; + virtual void decorateDoc(const QAction *, MeshDocument &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &) = 0; + virtual void endDecorate(const QAction *, MeshModel &, const RichParameterList *, GLArea *) {} + virtual void endDecorate(const QAction *, MeshDocument &, const RichParameterList *, GLArea *) {} /** \brief tests if a decoration is applicable to a mesh. * used only for PerMesh Decorators. @@ -94,54 +94,20 @@ public: On failure (returning false) the function fills the MissingItems list with strings describing the missing items. It is invoked only for decoration of \i PerMesh class; */ - virtual bool isDecorationApplicable(QAction *, const MeshModel&, QString&) const { return true; } + virtual bool isDecorationApplicable(const QAction *, const MeshModel&, QString&) const { return true; } - virtual int getDecorationClass(QAction *) const = 0; + virtual int getDecorationClass(const QAction *) const = 0; virtual QList actions() const { return actionList; } virtual QList types() const { return typeList; } + + virtual QAction *action(QString name) const; + protected: QList actionList; QList typeList; - virtual FilterIDType ID(QAction *a) const - { - QString aa=a->text(); - foreach(FilterIDType tt, types()) - if (a->text() == this->decorationName(tt)) return tt; - aa.replace("&",""); - foreach(FilterIDType tt, types()) - if (aa == this->decorationName(tt)) return tt; - - qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(a->text())); - assert(0); - return -1; - } - virtual FilterIDType ID(QString name) const - { - QString n = name; - foreach(FilterIDType tt, types()) - if (name == this->decorationName(tt)) return tt; - n.replace("&",""); - foreach(FilterIDType tt, types()) - if (n == this->decorationName(tt)) return tt; - - qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name)); - assert(0); - return -1; - } -public: - virtual QAction *action(QString name) const - { - QString n = name; - foreach(QAction *tt, actions()) - if (name == this->decorationName(ID(tt))) return tt; - n.replace("&",""); - foreach(QAction *tt, actions()) - if (n == this->decorationName(ID(tt))) return tt; - - qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(name)); - return 0; - } + virtual FilterIDType ID(const QAction *a) const; + virtual FilterIDType ID(QString name) const; }; #define MESHLAB_PLUGIN_IID_EXPORTER(x) Q_PLUGIN_METADATA(IID x) diff --git a/src/meshlabplugins/decorate_background/decorate_background.cpp b/src/meshlabplugins/decorate_background/decorate_background.cpp index 0ff45489c..2fff6852a 100644 --- a/src/meshlabplugins/decorate_background/decorate_background.cpp +++ b/src/meshlabplugins/decorate_background/decorate_background.cpp @@ -85,7 +85,7 @@ void DecorateBackgroundPlugin::initGlobalParameterSet(QAction *action, RichParam } } -bool DecorateBackgroundPlugin::startDecorate( QAction * action, MeshDocument &/*m*/, const RichParameterList * parset, GLArea * gla) +bool DecorateBackgroundPlugin::startDecorate(const QAction * action, MeshDocument &/*m*/, const RichParameterList * parset, GLArea * gla) { if (!GLExtensionsManager::initializeGLextensions_notThrowing()) { return false; @@ -105,7 +105,7 @@ bool DecorateBackgroundPlugin::startDecorate( QAction * action, MeshDocument &/* return true; } -void DecorateBackgroundPlugin::decorateDoc(QAction *a, MeshDocument &m, const RichParameterList * parset,GLArea * gla, QPainter *, GLLogStream &) +void DecorateBackgroundPlugin::decorateDoc(const QAction* a, MeshDocument &m, const RichParameterList * parset, GLArea * gla, QPainter *, GLLogStream &) { static QString lastname("uninitialized"); switch(ID(a)) diff --git a/src/meshlabplugins/decorate_background/decorate_background.h b/src/meshlabplugins/decorate_background/decorate_background.h index 8d1e6cd63..510ec6764 100644 --- a/src/meshlabplugins/decorate_background/decorate_background.h +++ b/src/meshlabplugins/decorate_background/decorate_background.h @@ -85,11 +85,11 @@ DecorateBackgroundPlugin() QString cubemapFileName; - bool startDecorate(QAction * /*mode*/, MeshDocument &/*m*/, const RichParameterList * /*parent*/ par, GLArea * /*parent*/); - void decorateDoc(QAction *a, MeshDocument &md, const RichParameterList *, GLArea *gla, QPainter *, GLLogStream &_log); - void decorateMesh(QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &){} + bool startDecorate(const QAction* /*mode*/, MeshDocument &/*m*/, const RichParameterList * /*parent*/ par, GLArea * /*parent*/); + void decorateDoc(const QAction *a, MeshDocument &md, const RichParameterList *, GLArea *gla, QPainter *, GLLogStream &_log); + void decorateMesh(const QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &){} void initGlobalParameterSet(QAction *, RichParameterList &/*globalparam*/); - int getDecorationClass(QAction * /*action*/) const { return DecoratePluginInterface::PerDocument; } + int getDecorationClass(const QAction * /*action*/) const { return DecoratePluginInterface::PerDocument; } private: diff --git a/src/meshlabplugins/decorate_base/decorate_base.cpp b/src/meshlabplugins/decorate_base/decorate_base.cpp index 6f23f7f7b..a89a1b263 100644 --- a/src/meshlabplugins/decorate_base/decorate_base.cpp +++ b/src/meshlabplugins/decorate_base/decorate_base.cpp @@ -79,7 +79,7 @@ QString DecorateBasePlugin::decorationName(FilterIDType filter) const return QString("error!"); } -void DecorateBasePlugin::decorateDoc(QAction *a, MeshDocument &md, const RichParameterList *rm, GLArea *gla, QPainter *painter,GLLogStream &/*_log*/) +void DecorateBasePlugin::decorateDoc(const QAction* a, MeshDocument &md, const RichParameterList *rm, GLArea *gla, QPainter *painter, GLLogStream &/*_log*/) { QFont qf; @@ -162,7 +162,7 @@ void DecorateBasePlugin::decorateDoc(QAction *a, MeshDocument &md, const RichPar } // end switch } -void DecorateBasePlugin::decorateMesh(QAction *a, MeshModel &m, const RichParameterList *rm, GLArea *gla, QPainter *painter,GLLogStream &_log) +void DecorateBasePlugin::decorateMesh(const QAction* a, MeshModel &m, const RichParameterList *rm, GLArea *gla, QPainter *painter, GLLogStream &_log) { this->setLog(&_log); QFont qf; @@ -510,7 +510,7 @@ void DecorateBasePlugin::DrawBBoxCorner(MeshModel &m, bool absBBoxFlag) glPopAttrib(); } -int DecorateBasePlugin::getDecorationClass(QAction *action) const +int DecorateBasePlugin::getDecorationClass(const QAction *action) const { switch(ID(action)) { @@ -529,7 +529,7 @@ int DecorateBasePlugin::getDecorationClass(QAction *action) const return 0; } -bool DecorateBasePlugin::isDecorationApplicable(QAction *action, const MeshModel& m, QString &ErrorMessage) const +bool DecorateBasePlugin::isDecorationApplicable(const QAction* action, const MeshModel& m, QString &ErrorMessage) const { if( ID(action) == DP_SHOW_LABEL ) { @@ -566,7 +566,7 @@ bool DecorateBasePlugin::isDecorationApplicable(QAction *action, const MeshModel return true; } -bool DecorateBasePlugin::startDecorate(QAction * action, MeshDocument &, const RichParameterList *, GLArea *) +bool DecorateBasePlugin::startDecorate(const QAction * action, MeshDocument &, const RichParameterList *, GLArea *) { switch(ID(action)) { @@ -583,7 +583,7 @@ bool DecorateBasePlugin::startDecorate(QAction * action, MeshDocument &, const R } -void DecorateBasePlugin::endDecorate(QAction * action, MeshModel &m, const RichParameterList *, GLArea *) +void DecorateBasePlugin::endDecorate(const QAction * action, MeshModel &m, const RichParameterList *, GLArea *) { switch(ID(action)) { @@ -598,7 +598,7 @@ void DecorateBasePlugin::endDecorate(QAction * action, MeshModel &m, const RichP } } -bool DecorateBasePlugin::startDecorate(QAction * action, MeshModel &m, const RichParameterList *rm, GLArea *gla) +bool DecorateBasePlugin::startDecorate(const QAction * action, MeshModel &m, const RichParameterList *rm, GLArea *gla) { switch(ID(action)) { diff --git a/src/meshlabplugins/decorate_base/decorate_base.h b/src/meshlabplugins/decorate_base/decorate_base.h index 8f554d1a2..072e39339 100644 --- a/src/meshlabplugins/decorate_base/decorate_base.h +++ b/src/meshlabplugins/decorate_base/decorate_base.h @@ -113,13 +113,13 @@ public: - void decorateDoc(QAction *a, MeshDocument &md, const RichParameterList *, GLArea *gla, QPainter *painter, GLLogStream &_log); - void decorateMesh(QAction *a, MeshModel &md, const RichParameterList *, GLArea *gla, QPainter *painter, GLLogStream &_log); - bool startDecorate(QAction * /*mode*/, MeshModel &/*m*/, const RichParameterList *, GLArea * /*parent*/); - void endDecorate(QAction * /*mode*/, MeshModel &/*m*/, const RichParameterList *, GLArea * /*parent*/); - bool startDecorate(QAction * /*mode*/, MeshDocument &/*m*/, const RichParameterList *, GLArea * /*parent*/); - bool isDecorationApplicable(QAction *action, const MeshModel& m, QString &ErrorMessage) const; - int getDecorationClass(QAction * /*action*/) const; + void decorateDoc(const QAction *a, MeshDocument &md, const RichParameterList *, GLArea *gla, QPainter *painter, GLLogStream &_log); + void decorateMesh(const QAction *a, MeshModel &md, const RichParameterList *, GLArea *gla, QPainter *painter, GLLogStream &_log); + bool startDecorate(const QAction* /*mode*/, MeshModel &/*m*/, const RichParameterList *, GLArea * /*parent*/); + void endDecorate(const QAction* /*mode*/, MeshModel &/*m*/, const RichParameterList *, GLArea * /*parent*/); + bool startDecorate(const QAction * /*mode*/, MeshDocument &/*m*/, const RichParameterList *, GLArea * /*parent*/); + bool isDecorationApplicable(const QAction *action, const MeshModel& m, QString &ErrorMessage) const; + int getDecorationClass(const QAction* /*action*/) const; void initGlobalParameterSet(QAction *, RichParameterList &/*globalparam*/); inline QString CameraScaleParam() const { return "MeshLab::Decoration::CameraRenderScaleType" ; } diff --git a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp index 85d1dd3da..35eee671a 100644 --- a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp +++ b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp @@ -189,7 +189,7 @@ QString DecorateRasterProjPlugin::decorationName( FilterIDType id ) const } -int DecorateRasterProjPlugin::getDecorationClass( QAction *act ) const +int DecorateRasterProjPlugin::getDecorationClass(const QAction *act ) const { switch( ID(act) ) { @@ -525,10 +525,11 @@ bool DecorateRasterProjPlugin::initShaders(std::string &logs) } -bool DecorateRasterProjPlugin::startDecorate( QAction *act, - MeshDocument & m, - const RichParameterList * /*par*/, - GLArea * /*gla*/ ) +bool DecorateRasterProjPlugin::startDecorate( + const QAction* act, + MeshDocument & m, + const RichParameterList * /*par*/, + GLArea * /*gla*/ ) { switch( ID(act) ) { @@ -572,10 +573,11 @@ bool DecorateRasterProjPlugin::startDecorate( QAction *act, } -void DecorateRasterProjPlugin::endDecorate( QAction *act, - MeshDocument & /*m*/, - const RichParameterList * /*par*/, - GLArea * /*gla*/ ) +void DecorateRasterProjPlugin::endDecorate( + const QAction *act, + MeshDocument & /*m*/, + const RichParameterList * /*par*/, + GLArea * /*gla*/ ) { switch( ID(act) ) { @@ -632,12 +634,13 @@ void DecorateRasterProjPlugin::setPointParameters( MeshDrawer &md, } -void DecorateRasterProjPlugin::decorateDoc( QAction *act, - MeshDocument &m , - const RichParameterList *par, - GLArea *gla, - QPainter *, - GLLogStream &) +void DecorateRasterProjPlugin::decorateDoc( + const QAction* act, + MeshDocument &m , + const RichParameterList *par, + GLArea *gla, + QPainter *, + GLLogStream &) { switch( ID(act) ) { diff --git a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h index 3f13a9c46..236da8fb8 100644 --- a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h +++ b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h @@ -114,12 +114,12 @@ private: public: inline QList actions() const { return actionList; } - bool startDecorate(QAction *act, MeshDocument &m, const RichParameterList *par, GLArea *gla ); - void decorateMesh( QAction * , MeshModel & , const RichParameterList * , GLArea * , QPainter * , GLLogStream & ) {} - void decorateDoc(QAction *act, MeshDocument &m, const RichParameterList* par, GLArea *gla, QPainter *p, GLLogStream & ); - void endDecorate( QAction *act, MeshDocument &m, const RichParameterList *par, GLArea *gla ); + bool startDecorate(const QAction *act, MeshDocument &m, const RichParameterList *par, GLArea *gla ); + void decorateMesh(const QAction * , MeshModel & , const RichParameterList * , GLArea * , QPainter * , GLLogStream & ) {} + void decorateDoc(const QAction *act, MeshDocument &m, const RichParameterList* par, GLArea *gla, QPainter *p, GLLogStream & ); + void endDecorate(const QAction* act, MeshDocument &m, const RichParameterList *par, GLArea *gla ); void initGlobalParameterSet( QAction *act, RichParameterList &par ); - int getDecorationClass( QAction *act ) const; + int getDecorationClass(const QAction* act ) const; }; From 8302e71f099d9dd451e593629e018d0a08b14ac6 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 18 Sep 2020 17:47:50 +0200 Subject: [PATCH 38/49] missing constness decorate_shadow --- src/meshlabplugins/decorate_shadow/decorate_shadow.cpp | 6 +++--- src/meshlabplugins/decorate_shadow/decorate_shadow.h | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp b/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp index 2ccf2c756..d091001fa 100644 --- a/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp +++ b/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp @@ -79,7 +79,7 @@ void DecorateShadowPlugin::initGlobalParameterSet(QAction *action, RichParameter } } -bool DecorateShadowPlugin::startDecorate(QAction* action, MeshDocument& /*m*/, const RichParameterList* parset, GLArea* /*gla*/) +bool DecorateShadowPlugin::startDecorate(const QAction* action, MeshDocument& /*m*/, const RichParameterList* parset, GLArea* /*gla*/) { bool result; @@ -123,7 +123,7 @@ bool DecorateShadowPlugin::startDecorate(QAction* action, MeshDocument& /*m*/, c return false; } -void DecorateShadowPlugin::endDecorate(QAction * action, MeshDocument & /*md*/, const RichParameterList * parset, GLArea * /*gla*/) +void DecorateShadowPlugin::endDecorate(const QAction* action, MeshDocument & /*md*/, const RichParameterList * parset, GLArea * /*gla*/) { switch (ID(action)) { @@ -170,7 +170,7 @@ void DecorateShadowPlugin::endDecorate(QAction * action, MeshDocument & /*md*/, } -void DecorateShadowPlugin::decorateDoc(QAction *action, MeshDocument &md, const RichParameterList *, GLArea *gla, QPainter *, GLLogStream &) +void DecorateShadowPlugin::decorateDoc(const QAction* action, MeshDocument &md, const RichParameterList *, GLArea *gla, QPainter *, GLLogStream &) { switch (ID(action)) { case DP_SHOW_SHADOW: diff --git a/src/meshlabplugins/decorate_shadow/decorate_shadow.h b/src/meshlabplugins/decorate_shadow/decorate_shadow.h index 2505f5d12..0aa596858 100644 --- a/src/meshlabplugins/decorate_shadow/decorate_shadow.h +++ b/src/meshlabplugins/decorate_shadow/decorate_shadow.h @@ -88,12 +88,12 @@ public: QString pluginName() const; QList actions () const {return actionList;} - bool startDecorate(QAction * /*mode*/, MeshDocument & /*m*/, const RichParameterList * /*parent*/ par, GLArea * /*parent*/); - void decorateMesh(QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &){} - void decorateDoc(QAction *a, MeshDocument &m, const RichParameterList*, GLArea *gla, QPainter *p, GLLogStream &); - void endDecorate(QAction *, MeshDocument &, const RichParameterList *, GLArea *); + bool startDecorate(const QAction * /*mode*/, MeshDocument & /*m*/, const RichParameterList * /*parent*/ par, GLArea * /*parent*/); + void decorateMesh(const QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &){} + void decorateDoc(const QAction *a, MeshDocument &m, const RichParameterList*, GLArea *gla, QPainter *p, GLLogStream &); + void endDecorate(const QAction *, MeshDocument &, const RichParameterList *, GLArea *); void initGlobalParameterSet(QAction *, RichParameterList & globalparam); - int getDecorationClass(QAction * /*action*/) const { return DecoratePluginInterface::PerDocument; } + int getDecorationClass(const QAction * /*action*/) const { return DecoratePluginInterface::PerDocument; } private: DecorateShader* smShader, *vsmShader, *vsmbShader; From 780f96740f13e554f37a721d1fe79e41b5b4a3d3 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 18 Sep 2020 18:38:47 +0200 Subject: [PATCH 39/49] style --- .../interfaces/filter_plugin_interface.cpp | 34 ++++++++++++++++++ .../interfaces/filter_plugin_interface.h | 35 ++----------------- .../filter_clean/cleanfilter.cpp | 2 +- 3 files changed, 38 insertions(+), 33 deletions(-) diff --git a/src/common/interfaces/filter_plugin_interface.cpp b/src/common/interfaces/filter_plugin_interface.cpp index 581dcdf18..18fd66e3e 100644 --- a/src/common/interfaces/filter_plugin_interface.cpp +++ b/src/common/interfaces/filter_plugin_interface.cpp @@ -39,6 +39,40 @@ bool FilterPluginInterface::isFilterApplicable(const QAction* act, const MeshMod return MissingItems.isEmpty(); } +PluginInterface::FilterIDType FilterPluginInterface::ID(const QAction* a) const +{ + QString aa=a->text(); + for(FilterIDType tt : types()) + if (a->text() == this->filterName(tt)) return tt; + aa.replace("&",""); + for(FilterIDType tt : types()) + if (aa == this->filterName(tt)) return tt; + + qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(a->text())); + assert(0); + return -1; +} + +QAction* FilterPluginInterface::getFilterAction(PluginInterface::FilterIDType filterID) +{ + QString idName = this->filterName(filterID); + return getFilterAction(idName); +} + +QAction* FilterPluginInterface::getFilterAction(const QString& idName) +{ + QString i=idName; + for(QAction *tt : actionList) + if (idName == tt->text()) return tt; + i.replace("&",""); + for(QAction *tt : actionList) + if (i == tt->text()) return tt; + + qDebug("unable to find the action corresponding to action '%s'", qUtf8Printable(idName)); + assert(0); + return 0; +} + int FilterPluginInterface::previewOnCreatedAttributes(const QAction* act, const MeshModel& mm ) const { int changedIfCalled = postCondition(act); diff --git a/src/common/interfaces/filter_plugin_interface.h b/src/common/interfaces/filter_plugin_interface.h index d022bb78a..a17bf1756 100644 --- a/src/common/interfaces/filter_plugin_interface.h +++ b/src/common/interfaces/filter_plugin_interface.h @@ -173,39 +173,10 @@ public: virtual QString filterName(const QAction *a) const { return this->filterName(ID(a)); } virtual QString filterScriptFunctionName(FilterIDType /*filterID*/) { return ""; } - virtual FilterIDType ID(const QAction *a) const - { - QString aa=a->text(); - foreach(FilterIDType tt, types()) - if (a->text() == this->filterName(tt)) return tt; - aa.replace("&",""); - foreach(FilterIDType tt, types()) - if (aa == this->filterName(tt)) return tt; + virtual FilterIDType ID(const QAction *a) const; - qDebug("unable to find the id corresponding to action '%s'", qUtf8Printable(a->text())); - assert(0); - return -1; - } - - virtual QAction *AC(FilterIDType filterID) - { - QString idName = this->filterName(filterID); - return AC(idName); - } - - virtual QAction *AC(const QString& idName) - { - QString i=idName; - for(QAction *tt : actionList) - if (idName == tt->text()) return tt; - i.replace("&",""); - for(QAction *tt : actionList) - if (i == tt->text()) return tt; - - qDebug("unable to find the action corresponding to action '%s'", qUtf8Printable(idName)); - assert(0); - return 0; - } + virtual QAction* getFilterAction(FilterIDType filterID); + virtual QAction* getFilterAction(const QString& idName); virtual QList actions() const { return actionList; } virtual QList types() const { return typeList; } diff --git a/src/meshlabplugins/filter_clean/cleanfilter.cpp b/src/meshlabplugins/filter_clean/cleanfilter.cpp index 947d88676..cf7a82797 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.cpp +++ b/src/meshlabplugins/filter_clean/cleanfilter.cpp @@ -61,7 +61,7 @@ CleanFilter::CleanFilter() FilterIDType tt; foreach(tt , types()) actionList << new QAction(filterName(tt), this); - AC(FP_SNAP_MISMATCHED_BORDER)->setShortcut(QKeySequence("ALT+`")); + getFilterAction(FP_SNAP_MISMATCHED_BORDER)->setShortcut(QKeySequence("ALT+`")); } CleanFilter::~CleanFilter() { From 64acea3e89460f8083985586a0146b639c62e078 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 18 Sep 2020 18:50:10 +0200 Subject: [PATCH 40/49] fix style commit --- src/meshlab/mainwindow_Init.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meshlab/mainwindow_Init.cpp b/src/meshlab/mainwindow_Init.cpp index 6a1c9b092..2932641ea 100644 --- a/src/meshlab/mainwindow_Init.cpp +++ b/src/meshlab/mainwindow_Init.cpp @@ -721,7 +721,7 @@ void MainWindow::fillFilterMenu() for (msi = PM.stringFilterMap.begin(); msi != PM.stringFilterMap.end(); ++msi) { FilterPluginInterface * iFilter = msi.value(); - QAction *filterAction = iFilter->AC((msi.key())); + QAction *filterAction = iFilter->getFilterAction((msi.key())); QString tooltip = iFilter->filterInfo(filterAction) + "
    " + getDecoratedFileName(filterAction->data().toString()); filterAction->setToolTip(tooltip); //connect(filterAction, SIGNAL(hovered()), this, SLOT(showActionMenuTooltip()) ); From 72c3de8697765ad0c97e219e3d5cfd0b7e6df052 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Sat, 19 Sep 2020 12:58:49 +0200 Subject: [PATCH 41/49] postConditionMask is an output of applyFilter --- .../interfaces/filter_plugin_interface.h | 24 ++++++------ src/meshlab/mainwindow_RunTime.cpp | 37 +++++++++++-------- src/meshlabplugins/filter_ao/filter_ao.cpp | 2 +- src/meshlabplugins/filter_ao/filter_ao.h | 2 +- .../filter_camera/filter_camera.cpp | 2 +- .../filter_camera/filter_camera.h | 2 +- .../filter_clean/cleanfilter.cpp | 2 +- src/meshlabplugins/filter_clean/cleanfilter.h | 2 +- .../filter_color_projection.cpp | 2 +- .../filter_color_projection.h | 2 +- .../filter_colorproc/filter_colorproc.cpp | 2 +- .../filter_colorproc/filter_colorproc.h | 2 +- .../filter_create/filter_create.cpp | 2 +- .../filter_create/filter_create.h | 2 +- .../filter_createiso/filter_createiso.cpp | 2 +- .../filter_createiso/filter_createiso.h | 2 +- src/meshlabplugins/filter_csg/filter_csg.cpp | 2 +- src/meshlabplugins/filter_csg/filter_csg.h | 2 +- .../filter_dirt/filter_dirt.cpp | 2 +- src/meshlabplugins/filter_dirt/filter_dirt.h | 2 +- .../filter_fractal/filter_fractal.cpp | 2 +- .../filter_fractal/filter_fractal.h | 2 +- .../filter_func/filter_func.cpp | 2 +- src/meshlabplugins/filter_func/filter_func.h | 2 +- .../filter_geodesic/filter_geodesic.cpp | 2 +- .../filter_geodesic/filter_geodesic.h | 2 +- .../globalregistration.cpp | 9 +++-- .../globalregistration.h | 2 +- .../filter_img_patch_param.cpp | 10 +++-- .../filter_img_patch_param.h | 3 +- .../filter_isoparametrization.cpp | 2 +- .../filter_isoparametrization.h | 2 +- .../filter_layer/filter_layer.cpp | 2 +- .../filter_layer/filter_layer.h | 2 +- .../filter_measure/filter_measure.cpp | 2 +- .../filter_measure/filter_measure.h | 2 +- .../filter_meshing/meshfilter.cpp | 4 +- .../filter_meshing/meshfilter.h | 4 +- src/meshlabplugins/filter_mls/mlsplugin.cpp | 2 +- src/meshlabplugins/filter_mls/mlsplugin.h | 2 +- .../filter_mutualglobal.cpp | 2 +- .../filter_mutualglobal/filter_mutualglobal.h | 2 +- .../filter_mutualinfo/filter_mutualinfo.cpp | 2 +- .../filter_mutualinfo/filter_mutualinfo.h | 2 +- .../filter_plymc/filter_plymc.cpp | 2 +- .../filter_plymc/filter_plymc.h | 2 +- .../filter_qhull/filter_qhull.cpp | 2 +- .../filter_qhull/filter_qhull.h | 2 +- .../filter_quality/filterqualitymapper.cpp | 2 +- .../filter_quality/filterqualitymapper.h | 2 +- .../filter_sample/filter_sample.cpp | 2 +- .../filter_sample/filter_sample.h | 2 +- .../filter_sample_dyn/filter_sample_dyn.cpp | 2 +- .../filter_sample_dyn/filter_sample_dyn.h | 2 +- .../filter_sample_gpu/filter_sample_gpu.cpp | 2 +- .../filter_sample_gpu/filter_sample_gpu.h | 2 +- .../filter_sampling/filter_sampling.cpp | 2 +- .../filter_sampling/filter_sampling.h | 2 +- .../filter_screened_poisson.cpp | 7 +++- .../filter_screened_poisson.h | 4 +- .../filter_sdfgpu/filter_sdfgpu.cpp | 2 +- .../filter_sdfgpu/filter_sdfgpu.h | 2 +- .../filter_sdfgpu/filterinterface.h | 2 +- .../filter_select/meshselect.cpp | 2 +- src/meshlabplugins/filter_select/meshselect.h | 2 +- .../filter_sketchfab/filter_sketchfab.cpp | 2 +- .../filter_sketchfab/filter_sketchfab.h | 2 +- .../filter_ssynth/filter_ssynth.cpp | 2 +- .../filter_ssynth/filter_ssynth.h | 2 +- .../filter_texture/filter_texture.cpp | 2 +- .../filter_texture/filter_texture.h | 2 +- .../filter_trioptimize/filter_trioptimize.cpp | 2 +- .../filter_trioptimize/filter_trioptimize.h | 2 +- .../filter_unsharp/filter_unsharp.cpp | 2 +- .../filter_unsharp/filter_unsharp.h | 2 +- .../filter_voronoi/filter_voronoi.cpp | 2 +- .../filter_voronoi/filter_voronoi.h | 2 +- src/meshlabserver/mainserver.cpp | 3 +- 78 files changed, 129 insertions(+), 112 deletions(-) diff --git a/src/common/interfaces/filter_plugin_interface.h b/src/common/interfaces/filter_plugin_interface.h index a17bf1756..e4f14a959 100644 --- a/src/common/interfaces/filter_plugin_interface.h +++ b/src/common/interfaces/filter_plugin_interface.h @@ -94,7 +94,7 @@ public: // This choice affect the submenu in which each filter will be placed // For example filters that perform an action only on the selection will be placed in the Selection Class */ - virtual FilterClass getClass(const QAction *) const { return FilterPluginInterface::Generic; } + virtual FilterClass getClass(const QAction*) const { return FilterPluginInterface::Generic; } /** The filters can have some additional requirements on the mesh capabiliteis. @@ -106,7 +106,7 @@ public: // outputs a never used before mesh property (e.g. face colors), it will be allocated by a call // to MeshModel::updateDataMask(...) */ - virtual int getRequirements(const QAction *) { return MeshModel::MM_NONE; } + virtual int getRequirements(const QAction*) { return MeshModel::MM_NONE; } /** The FilterPrecondition mask is used to explicitate what kind of data a filter really needs to be applied. // For example algorithms that compute per face quality have as precondition the existence of faces @@ -116,7 +116,7 @@ public: // These conditions do NOT include computed properties like borderFlags, manifoldness or watertightness. // They are also used to grayout menus un-appliable entries. */ - virtual int getPreConditions(const QAction *) const { return MeshModel::MM_NONE; } + virtual int getPreConditions(const QAction*) const { return MeshModel::MM_NONE; } /** Function used by the framework to get info about the mesh properties changed by the filter. // It is widely used by the meshlab's preview system. @@ -135,14 +135,14 @@ public: * \sa errorMsg * \sa initParameterSet */ - virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) = 0; + virtual bool applyFilter(const QAction* filter, MeshDocument& md, unsigned int& postConditionMask, const RichParameterList& par, vcg::CallBackPos* cb) = 0; /** \brief tests if a filter is applicable to a mesh. This function is a handy wrapper used by the framework for the \a getPreConditions callback; For instance a colorize by quality filter cannot be applied to a mesh without per-vertex-quality. On failure (returning false) the function fills the MissingItems list with strings describing the missing items. */ - bool isFilterApplicable(const QAction *act, const MeshModel& m, QStringList &MissingItems) const; + bool isFilterApplicable(const QAction* act, const MeshModel& m, QStringList &MissingItems) const; enum FILTER_ARITY { NONE = 0, SINGLE_MESH = 1, FIXED = 2, VARIABLE = 3, UNKNOWN_ARITY = 4 }; @@ -158,8 +158,8 @@ public: // This function is called to initialized the list of parameters. // it is always called. If a filter does not need parameter it leave it empty and the framework // will not create a dialog (unless for previewing) - virtual void initParameterList(const QAction *, MeshModel &/*m*/, RichParameterList & /*par*/) {} - virtual void initParameterList(const QAction *filter, MeshDocument &md, RichParameterList &par) + virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*par*/) {} + virtual void initParameterList(const QAction* filter, MeshDocument &md, RichParameterList &par) { initParameterList(filter, *(md.mm()), par); } @@ -168,9 +168,9 @@ public: * Filters \b must never use QMessageBox for reporting errors. * Failing filters should put some meaningful information inside the errorMessage string and return false with the \ref applyFilter */ - const QString &errorMsg() const { return this->errorMessage; } - virtual QString filterInfo(const QAction *a) const { return this->filterInfo(ID(a)); } - virtual QString filterName(const QAction *a) const { return this->filterName(ID(a)); } + const QString& errorMsg() const { return this->errorMessage; } + virtual QString filterInfo(const QAction* a) const { return this->filterInfo(ID(a)); } + virtual QString filterName(const QAction* a) const { return this->filterName(ID(a)); } virtual QString filterScriptFunctionName(FilterIDType /*filterID*/) { return ""; } virtual FilterIDType ID(const QAction *a) const; @@ -178,7 +178,7 @@ public: virtual QAction* getFilterAction(FilterIDType filterID); virtual QAction* getFilterAction(const QString& idName); - virtual QList actions() const { return actionList; } + virtual QList actions() const { return actionList; } virtual QList types() const { return typeList; } /** Generate the mask of attributes would be created IF the MeshFilterInterface filt would has been called on MeshModel mm @@ -193,7 +193,7 @@ protected: // // The list of actions exported by the plugin. Each actions strictly corresponds to - QList actionList; + QList actionList; QList typeList; diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index d60b40009..f13c13acf 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -786,7 +786,7 @@ void MainWindow::runFilterScript() { QString filtnm = pair.filterName(); int classes = 0; - int postCondMask = 0; + unsigned int postCondMask = MeshModel::MM_UNKNOWN; QAction *action = PM.actionFilterMap[ filtnm]; FilterPluginInterface *iFilter = qobject_cast(action->parent()); @@ -858,7 +858,9 @@ void MainWindow::runFilterScript() meshDoc()->setBusy(true); //WARNING!!!!!!!!!!!! /* to be changed */ - iFilter->applyFilter( action, *meshDoc(), pair.second, QCallBack ); + iFilter->applyFilter( action, *meshDoc(), postCondMask, pair.second, QCallBack); + if (postCondMask == MeshModel::MM_UNKNOWN) + postCondMask = iFilter->postCondition(action); for (MeshModel* mm = meshDoc()->nextMesh(); mm != NULL; mm = meshDoc()->nextMesh(mm)) vcg::tri::Allocator::CompactEveryVector(mm->cm); meshDoc()->setBusy(false); @@ -866,7 +868,7 @@ void MainWindow::runFilterScript() shar->removeView(iFilter->glContext); delete iFilter->glContext; classes = int(iFilter->getClass(action)); - postCondMask = iFilter->postCondition(action); + if (meshDoc()->mm() != NULL) { if(classes & FilterPluginInterface::FaceColoring ) @@ -1212,7 +1214,10 @@ void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool { meshDoc()->meshDocStateData().clear(); meshDoc()->meshDocStateData().create(*meshDoc()); - ret=iFilter->applyFilter(action, *(meshDoc()), mergedenvironment, QCallBack); + unsigned int postCondMask = MeshModel::MM_UNKNOWN; + ret=iFilter->applyFilter(action, *(meshDoc()), postCondMask, mergedenvironment, QCallBack); + if (postCondMask == MeshModel::MM_UNKNOWN) + postCondMask = iFilter->postCondition(action); for (MeshModel* mm = meshDoc()->nextMesh(); mm != NULL; mm = meshDoc()->nextMesh(mm)) vcg::tri::Allocator::CompactEveryVector(mm->cm); @@ -1302,7 +1307,7 @@ void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool if(iFilter->getClass(action) & FilterPluginInterface::MeshColoring ) mm->updateDataMask(MeshModel::MM_COLOR); - if(iFilter->postCondition(action) & MeshModel::MM_CAMERA) + if(postCondMask & MeshModel::MM_CAMERA) mm->updateDataMask(MeshModel::MM_CAMERA); if(iFilter->getClass(action) & FilterPluginInterface::Texture ) @@ -1312,7 +1317,7 @@ void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool int fclasses = iFilter->getClass(action); //MLSceneGLSharedDataContext* sharedcont = GLA()->getSceneGLSharedContext(); - int postCondMask = iFilter->postCondition(action); + updateSharedContextDataAfterFilterExecution(postCondMask,fclasses,newmeshcreated); meshDoc()->meshDocStateData().clear(); } @@ -2460,17 +2465,17 @@ void MainWindow::reload() bool MainWindow::exportMesh(QString fileName,MeshModel* mod,const bool saveAllPossibleAttributes) { - QStringList& suffixList = PM.outFilters; + QStringList& suffixList = PM.outFilters; - //QHash allKnownFormats; - QFileInfo fi(fileName); - //PM.LoadFormats( suffixList, allKnownFormats,PluginManager::EXPORT); - //QString defaultExt = "*." + mod->suffixName().toLower(); - QString defaultExt = "*." + fi.suffix().toLower(); - if(defaultExt == "*.") - defaultExt = "*.ply"; - if (mod == NULL) - return false; + //QHash allKnownFormats; + QFileInfo fi(fileName); + //PM.LoadFormats( suffixList, allKnownFormats,PluginManager::EXPORT); + //QString defaultExt = "*." + mod->suffixName().toLower(); + QString defaultExt = "*." + fi.suffix().toLower(); + if(defaultExt == "*.") + defaultExt = "*.ply"; + if (mod == NULL) + return false; mod->setMeshModified(false); QString laylabel = "Save \"" + mod->label() + "\" Layer"; QString ss = fi.absoluteFilePath(); diff --git a/src/meshlabplugins/filter_ao/filter_ao.cpp b/src/meshlabplugins/filter_ao/filter_ao.cpp index df6ae74bd..ef2bf4544 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.cpp +++ b/src/meshlabplugins/filter_ao/filter_ao.cpp @@ -132,7 +132,7 @@ void AmbientOcclusionPlugin::initParameterList(const QAction *action, MeshModel default: break; // do not add any parameter for the other filters } } -bool AmbientOcclusionPlugin::applyFilter(const QAction * /*filter*/, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool AmbientOcclusionPlugin::applyFilter(const QAction * /*filter*/, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos *cb) { MeshModel &m=*(md.mm()); diff --git a/src/meshlabplugins/filter_ao/filter_ao.h b/src/meshlabplugins/filter_ao/filter_ao.h index ce7b592f7..6320f7170 100644 --- a/src/meshlabplugins/filter_ao/filter_ao.h +++ b/src/meshlabplugins/filter_ao/filter_ao.h @@ -76,7 +76,7 @@ public: FilterClass getClass(const QAction* filter) const; void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; void initTextures(void); void initGL(vcg::CallBackPos *cb,unsigned int numVertices); bool processGL(MeshModel &m, std::vector &posVect); diff --git a/src/meshlabplugins/filter_camera/filter_camera.cpp b/src/meshlabplugins/filter_camera/filter_camera.cpp index e2330d137..428ac9eb7 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.cpp +++ b/src/meshlabplugins/filter_camera/filter_camera.cpp @@ -184,7 +184,7 @@ void FilterCameraPlugin::initParameterList(const QAction *action, MeshDocument & } // Core Function doing the actual mesh processing. -bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * /*cb*/) +bool FilterCameraPlugin::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos * /*cb*/) { MeshModel* mesh = md.mm(); CMeshO* cm = NULL; diff --git a/src/meshlabplugins/filter_camera/filter_camera.h b/src/meshlabplugins/filter_camera/filter_camera.h index 4755f019f..76d9fb6ce 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.h +++ b/src/meshlabplugins/filter_camera/filter_camera.h @@ -52,7 +52,7 @@ public: virtual QString filterInfo(FilterIDType filter) const; virtual FilterClass getClass(const QAction*) const; virtual void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(const QAction* act) const; }; diff --git a/src/meshlabplugins/filter_clean/cleanfilter.cpp b/src/meshlabplugins/filter_clean/cleanfilter.cpp index cf7a82797..447c7d6bc 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.cpp +++ b/src/meshlabplugins/filter_clean/cleanfilter.cpp @@ -269,7 +269,7 @@ void CleanFilter::initParameterList(const QAction *action,MeshDocument &md, Rich } } -bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * cb) +bool CleanFilter::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos * cb) { MeshModel &m=*(md.mm()); switch(ID(filter)) diff --git a/src/meshlabplugins/filter_clean/cleanfilter.h b/src/meshlabplugins/filter_clean/cleanfilter.h index 49da2bf0d..d182676fb 100644 --- a/src/meshlabplugins/filter_clean/cleanfilter.h +++ b/src/meshlabplugins/filter_clean/cleanfilter.h @@ -72,7 +72,7 @@ public: int postCondition(const QAction* ) const; int getPreConditions(const QAction *) const { return MeshModel::MM_NONE; } virtual void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp index 03f410f39..a2e01ba31 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.cpp @@ -218,7 +218,7 @@ void FilterColorProjectionPlugin::initParameterList(const QAction *action, MeshD } // Core Function doing the actual mesh processing. -bool FilterColorProjectionPlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterColorProjectionPlugin::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos *cb) { //CMeshO::FaceIterator fi; CMeshO::VertexIterator vi; diff --git a/src/meshlabplugins/filter_color_projection/filter_color_projection.h b/src/meshlabplugins/filter_color_projection/filter_color_projection.h index 0ad1e20eb..d20e29c29 100644 --- a/src/meshlabplugins/filter_color_projection/filter_color_projection.h +++ b/src/meshlabplugins/filter_color_projection/filter_color_projection.h @@ -46,7 +46,7 @@ public: virtual FilterClass getClass(const QAction*) const; virtual void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); virtual int getRequirements(const QAction*); - virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); + virtual bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp index 11aaa16af..a8bd6509c 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.cpp @@ -368,7 +368,7 @@ void FilterColorProc::initParameterList(const QAction *a, MeshDocument& md, Rich } } -bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList &par, vcg::CallBackPos *cb) +bool FilterColorProc::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList &par, vcg::CallBackPos *cb) { MeshModel *m = md.mm(); //get current mesh from document diff --git a/src/meshlabplugins/filter_colorproc/filter_colorproc.h b/src/meshlabplugins/filter_colorproc/filter_colorproc.h index 0e00c8966..9238117a1 100644 --- a/src/meshlabplugins/filter_colorproc/filter_colorproc.h +++ b/src/meshlabplugins/filter_colorproc/filter_colorproc.h @@ -75,7 +75,7 @@ public: virtual int getRequirements(const QAction*); virtual void initParameterList(const QAction*, MeshDocument&, RichParameterList & /*parent*/); - virtual bool applyFilter(const QAction* filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); + virtual bool applyFilter(const QAction* filter, MeshDocument&, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); int postCondition(const QAction* filter) const; int getPreConditions(const QAction *) const; FILTER_ARITY filterArity(const QAction *act) const; diff --git a/src/meshlabplugins/filter_create/filter_create.cpp b/src/meshlabplugins/filter_create/filter_create.cpp index 167b4e302..4c1988462 100644 --- a/src/meshlabplugins/filter_create/filter_create.cpp +++ b/src/meshlabplugins/filter_create/filter_create.cpp @@ -167,7 +167,7 @@ void FilterCreate::initParameterList(const QAction *action, MeshModel & /*m*/, R } // The Real Core Function doing the actual mesh processing. -bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, CallBackPos * /*cb*/) +bool FilterCreate::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, CallBackPos * /*cb*/) { MeshModel *currM = md.mm(); MeshModel *m = nullptr; diff --git a/src/meshlabplugins/filter_create/filter_create.h b/src/meshlabplugins/filter_create/filter_create.h index 84441eed1..fc643a7c7 100644 --- a/src/meshlabplugins/filter_create/filter_create.h +++ b/src/meshlabplugins/filter_create/filter_create.h @@ -54,7 +54,7 @@ class FilterCreate : public QObject, public FilterPluginInterface QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction*) const; void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; QString filterScriptFunctionName(FilterIDType filterID); FILTER_ARITY filterArity(const QAction *) const {return NONE;} }; diff --git a/src/meshlabplugins/filter_createiso/filter_createiso.cpp b/src/meshlabplugins/filter_createiso/filter_createiso.cpp index 6cefd11ad..0857cd7c9 100644 --- a/src/meshlabplugins/filter_createiso/filter_createiso.cpp +++ b/src/meshlabplugins/filter_createiso/filter_createiso.cpp @@ -98,7 +98,7 @@ QString FilterCreateIso::pluginName() const return 0; } - bool FilterCreateIso::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * cb) + bool FilterCreateIso::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos * cb) { md.addNewMesh("",this->filterName(ID(filter))); MeshModel &m=*(md.mm()); diff --git a/src/meshlabplugins/filter_createiso/filter_createiso.h b/src/meshlabplugins/filter_createiso/filter_createiso.h index 429ef86f7..efe3f57d4 100644 --- a/src/meshlabplugins/filter_createiso/filter_createiso.h +++ b/src/meshlabplugins/filter_createiso/filter_createiso.h @@ -63,7 +63,7 @@ public: virtual int getRequirements(const QAction*); virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(const QAction*) const {return NONE;} }; diff --git a/src/meshlabplugins/filter_csg/filter_csg.cpp b/src/meshlabplugins/filter_csg/filter_csg.cpp index d95d65471..278a20a5e 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.cpp +++ b/src/meshlabplugins/filter_csg/filter_csg.cpp @@ -116,7 +116,7 @@ void FilterCSG::initParameterList(const QAction *action, MeshDocument & md, Rich } } -bool FilterCSG::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterCSG::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos *cb) { switch(ID(filter)) { case FP_CSG: diff --git a/src/meshlabplugins/filter_csg/filter_csg.h b/src/meshlabplugins/filter_csg/filter_csg.h index a70c5e77c..9a74e20e4 100644 --- a/src/meshlabplugins/filter_csg/filter_csg.h +++ b/src/meshlabplugins/filter_csg/filter_csg.h @@ -60,7 +60,7 @@ public: virtual void initParameterList(const QAction*, MeshDocument &, RichParameterList &); - virtual bool applyFilter(const QAction*, MeshDocument &, const RichParameterList &, vcg::CallBackPos *); + virtual bool applyFilter(const QAction*, MeshDocument &, unsigned int& postConditionMask, const RichParameterList &, vcg::CallBackPos *); virtual FilterClass getClass(const QAction *) const { return FilterPluginInterface::FilterClass( FilterPluginInterface::Layer + FilterPluginInterface::Remeshing ); } FILTER_ARITY filterArity(const QAction*) const {return FIXED;} diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.cpp b/src/meshlabplugins/filter_dirt/filter_dirt.cpp index ea321162f..61cef6020 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.cpp +++ b/src/meshlabplugins/filter_dirt/filter_dirt.cpp @@ -133,7 +133,7 @@ int FilterDirt::getRequirements(const QAction * /*action*/) return MeshModel::MM_FACEFACETOPO | MeshModel::MM_VERTCOLOR |MeshModel::MM_FACECOLOR; } -bool FilterDirt::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList &par, vcg::CallBackPos *cb){ +bool FilterDirt::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList &par, vcg::CallBackPos *cb){ switch(ID(filter)){ diff --git a/src/meshlabplugins/filter_dirt/filter_dirt.h b/src/meshlabplugins/filter_dirt/filter_dirt.h index 275ffda51..0da1b087a 100644 --- a/src/meshlabplugins/filter_dirt/filter_dirt.h +++ b/src/meshlabplugins/filter_dirt/filter_dirt.h @@ -65,7 +65,7 @@ public: virtual bool autoDialog(QAction *) {return true;} // virtual void initParameterSet(QAction* filter,MeshModel &,RichParameterSet &){}; virtual void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); + virtual bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & par, vcg::CallBackPos *cb); virtual int postCondition(const QAction*) const; virtual FilterClass getClass (const QAction *) const; FILTER_ARITY filterArity(const QAction*) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.cpp b/src/meshlabplugins/filter_fractal/filter_fractal.cpp index c4e0b23cc..c0031a810 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.cpp +++ b/src/meshlabplugins/filter_fractal/filter_fractal.cpp @@ -255,7 +255,7 @@ void FilterFractal::initParameterSetForCratersGeneration(MeshDocument &md, RichP return; } -bool FilterFractal::applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList &par, vcg::CallBackPos* cb) +bool FilterFractal::applyFilter(const QAction* filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList &par, vcg::CallBackPos* cb) { if(this->getClass(filter) == FilterPluginInterface::MeshCreation) md.addNewMesh("",this->filterName(ID(filter))); diff --git a/src/meshlabplugins/filter_fractal/filter_fractal.h b/src/meshlabplugins/filter_fractal/filter_fractal.h index c5c26c518..1362d4499 100644 --- a/src/meshlabplugins/filter_fractal/filter_fractal.h +++ b/src/meshlabplugins/filter_fractal/filter_fractal.h @@ -48,7 +48,7 @@ public: int getRequirements(const QAction*); void initParameterList(const QAction*, MeshDocument &, RichParameterList &); - bool applyFilter (const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); + bool applyFilter (const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & par, vcg::CallBackPos *cb); int postCondition(const QAction *action) const; FilterClass getClass(const QAction*) const; diff --git a/src/meshlabplugins/filter_func/filter_func.cpp b/src/meshlabplugins/filter_func/filter_func.cpp index 3368d7efa..187743ce9 100644 --- a/src/meshlabplugins/filter_func/filter_func.cpp +++ b/src/meshlabplugins/filter_func/filter_func.cpp @@ -373,7 +373,7 @@ void FilterFunctionPlugin::initParameterList(const QAction *action,MeshModel &m, } // The Real Core Function doing the actual mesh processing. -bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterFunctionPlugin::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos *cb) { if(this->getClass(filter) == FilterPluginInterface::MeshCreation) md.addNewMesh("",this->filterName(ID(filter))); diff --git a/src/meshlabplugins/filter_func/filter_func.h b/src/meshlabplugins/filter_func/filter_func.h index 61b873cec..ef8f372de 100644 --- a/src/meshlabplugins/filter_func/filter_func.h +++ b/src/meshlabplugins/filter_func/filter_func.h @@ -81,7 +81,7 @@ public: virtual int postCondition(const QAction *action) const; virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); virtual int getRequirements(const QAction*); - virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(const QAction* filter) const; diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp index 553aa4f28..1c56b28fa 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.cpp @@ -108,7 +108,7 @@ int FilterGeodesic::getRequirements(const QAction *action) return 0; } -bool FilterGeodesic::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * /*cb*/) +bool FilterGeodesic::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos * /*cb*/) { MeshModel &m=*(md.mm()); CMeshO::FaceIterator fi; diff --git a/src/meshlabplugins/filter_geodesic/filter_geodesic.h b/src/meshlabplugins/filter_geodesic/filter_geodesic.h index ceb56f47c..99442d5a1 100644 --- a/src/meshlabplugins/filter_geodesic/filter_geodesic.h +++ b/src/meshlabplugins/filter_geodesic/filter_geodesic.h @@ -56,7 +56,7 @@ class FilterGeodesic : public QObject, public FilterPluginInterface FilterClass getClass(const QAction*) const; int getRequirements(const QAction*); - bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); int postCondition(const QAction * filter) const; FILTER_ARITY filterArity(const QAction*) const {return SINGLE_MESH;} diff --git a/src/meshlabplugins/filter_globalregistration/globalregistration.cpp b/src/meshlabplugins/filter_globalregistration/globalregistration.cpp index d8d86dd09..48e0ebe15 100644 --- a/src/meshlabplugins/filter_globalregistration/globalregistration.cpp +++ b/src/meshlabplugins/filter_globalregistration/globalregistration.cpp @@ -166,10 +166,11 @@ float align ( CMeshO* refMesh, CMeshO* trgMesh, // The Real Core Function doing the actual mesh processing. // Move Vertex of a random quantity -bool GlobalRegistrationPlugin::applyFilter(const QAction */*filter*/, - MeshDocument &/*md*/, - const RichParameterList & par, - vcg::CallBackPos */*cb*/) +bool GlobalRegistrationPlugin::applyFilter(const QAction* /*filter*/, + MeshDocument& /*md*/, + unsigned int& /*postConditionMask*/, + const RichParameterList& par, + vcg::CallBackPos* /*cb*/) { MeshModel *mmref = par.getMesh("refMesh"); diff --git a/src/meshlabplugins/filter_globalregistration/globalregistration.h b/src/meshlabplugins/filter_globalregistration/globalregistration.h index 37152dc11..b0a072d00 100644 --- a/src/meshlabplugins/filter_globalregistration/globalregistration.h +++ b/src/meshlabplugins/filter_globalregistration/globalregistration.h @@ -42,7 +42,7 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction* ) const {return MeshModel::MM_VERTCOORD; } FilterClass getClass(const QAction* a) const; FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} 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 33dede14a..ae2809f54 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 @@ -191,10 +191,12 @@ void FilterImgPatchParamPlugin::initParameterList(const QAction *act, } -bool FilterImgPatchParamPlugin::applyFilter(const QAction *act, - MeshDocument &md, - const RichParameterList &par, - vcg::CallBackPos * /*cb*/ ) +bool FilterImgPatchParamPlugin::applyFilter( + const QAction *act, + MeshDocument &md, + unsigned int& /*postConditionMask*/, + const RichParameterList &par, + vcg::CallBackPos * /*cb*/ ) { 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 f81f8dca8..f9675fce0 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 @@ -112,8 +112,9 @@ public: virtual int getRequirements(const QAction* act ); //virtual int postCondition( QAction *act ) const; - virtual bool applyFilter(const QAction* act, + virtual bool applyFilter(const QAction* act, MeshDocument &md, + unsigned int& postConditionMask, const RichParameterList &par, vcg::CallBackPos *cb ); diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp index 82dcd1691..b4b2b7bcc 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.cpp @@ -179,7 +179,7 @@ void FilterIsoParametrization::PrintStats(CMeshO *mesh) log("stdDev Edge: %5.2f",stdE/avE); } -bool FilterIsoParametrization::applyFilter(const QAction *filter, MeshDocument& md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterIsoParametrization::applyFilter(const QAction *filter, MeshDocument& md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos *cb) { MeshModel* m = md.mm(); //get current mesh from document CMeshO *mesh=&m->cm; diff --git a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h index 4ca831dd8..c8617d394 100644 --- a/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h +++ b/src/meshlabplugins/filter_isoparametrization/filter_isoparametrization.h @@ -55,7 +55,7 @@ class FilterIsoParametrization : public QObject, public FilterPluginInterface virtual int getRequirements(const QAction*); virtual void initParameterList(const QAction*, MeshDocument&, RichParameterList & /*parent*/); - virtual bool applyFilter(const QAction* filter, MeshDocument&, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); + virtual bool applyFilter(const QAction* filter, MeshDocument&, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); int postCondition(const QAction* filter) const; void PrintStats(CMeshO *mesh); FILTER_ARITY filterArity(const QAction*) const; diff --git a/src/meshlabplugins/filter_layer/filter_layer.cpp b/src/meshlabplugins/filter_layer/filter_layer.cpp index 1a9fd8286..9bb07fb9f 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.cpp +++ b/src/meshlabplugins/filter_layer/filter_layer.cpp @@ -180,7 +180,7 @@ void FilterLayerPlugin::initParameterList(const QAction *action, MeshDocument &m } // Core Function doing the actual mesh processing. -bool FilterLayerPlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterLayerPlugin::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos *cb) { CMeshO::FaceIterator fi; int numFacesSel,numVertSel; diff --git a/src/meshlabplugins/filter_layer/filter_layer.h b/src/meshlabplugins/filter_layer/filter_layer.h index 17eb080fb..bc94c1bb4 100644 --- a/src/meshlabplugins/filter_layer/filter_layer.h +++ b/src/meshlabplugins/filter_layer/filter_layer.h @@ -60,7 +60,7 @@ public: virtual QString filterInfo(FilterIDType filter) const; virtual FilterClass getClass(const QAction*) const; virtual void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction *filter) const; FILTER_ARITY filterArity(const QAction*) const; }; diff --git a/src/meshlabplugins/filter_measure/filter_measure.cpp b/src/meshlabplugins/filter_measure/filter_measure.cpp index 50f1a87e0..189aed1f5 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.cpp +++ b/src/meshlabplugins/filter_measure/filter_measure.cpp @@ -171,7 +171,7 @@ void FilterMeasurePlugin::initParameterList(const QAction *action, MeshModel &m, } } -bool FilterMeasurePlugin::applyFilter(const QAction* filter, MeshDocument& md, const RichParameterList& parlst, vcg::CallBackPos*) +bool FilterMeasurePlugin::applyFilter(const QAction* filter, MeshDocument& md, unsigned int& /*postConditionMask*/, const RichParameterList& parlst, vcg::CallBackPos*) { switch (ID(filter)) { case COMPUTE_TOPOLOGICAL_MEASURES: diff --git a/src/meshlabplugins/filter_measure/filter_measure.h b/src/meshlabplugins/filter_measure/filter_measure.h index 317e5f4bc..fbe6b9eda 100644 --- a/src/meshlabplugins/filter_measure/filter_measure.h +++ b/src/meshlabplugins/filter_measure/filter_measure.h @@ -54,7 +54,7 @@ public: FILTER_ARITY filterArity(const QAction*) const; int getPreConditions(const QAction *action) const; void initParameterList(const QAction* , MeshModel& m, RichParameterList& parlst); - bool applyFilter(const QAction* filter, MeshDocument& md, const RichParameterList& parlst, vcg::CallBackPos*) ; + bool applyFilter(const QAction* filter, MeshDocument& md, unsigned int& postConditionMask, const RichParameterList& parlst, vcg::CallBackPos*) ; int postCondition(const QAction* ) const; private: diff --git a/src/meshlabplugins/filter_meshing/meshfilter.cpp b/src/meshlabplugins/filter_meshing/meshfilter.cpp index 5d840cd31..f910122b5 100644 --- a/src/meshlabplugins/filter_meshing/meshfilter.cpp +++ b/src/meshlabplugins/filter_meshing/meshfilter.cpp @@ -170,7 +170,7 @@ ExtraMeshFilterPlugin::FilterClass ExtraMeshFilterPlugin::getClass(const QAction return FilterPluginInterface::Generic; } -int ExtraMeshFilterPlugin::getPreCondition(QAction *filter) const +int ExtraMeshFilterPlugin::getPreConditions(const QAction *filter) const { switch (ID(filter)) { @@ -674,7 +674,7 @@ void ApplyTransform(MeshDocument &md, const Matrix44m &tr, bool toAllFlag, bool } -bool ExtraMeshFilterPlugin::applyFilter(const QAction * filter, MeshDocument & md, const RichParameterList & par, vcg::CallBackPos * cb) +bool ExtraMeshFilterPlugin::applyFilter(const QAction * filter, MeshDocument & md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos * cb) { MeshModel & m = *md.mm(); diff --git a/src/meshlabplugins/filter_meshing/meshfilter.h b/src/meshlabplugins/filter_meshing/meshfilter.h index 0255b7344..013965c59 100644 --- a/src/meshlabplugins/filter_meshing/meshfilter.h +++ b/src/meshlabplugins/filter_meshing/meshfilter.h @@ -89,9 +89,9 @@ public: FilterClass getClass(const QAction*) const; void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction *filter) const; - int getPreCondition(QAction *filter) const; + int getPreConditions(const QAction *filter) const; FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} protected: diff --git a/src/meshlabplugins/filter_mls/mlsplugin.cpp b/src/meshlabplugins/filter_mls/mlsplugin.cpp index eda00dae0..26d08f775 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.cpp +++ b/src/meshlabplugins/filter_mls/mlsplugin.cpp @@ -355,7 +355,7 @@ void UpdateFaceNormalFromVertex(MeshType& m) } } -bool MlsPlugin::applyFilter(const QAction* filter, MeshDocument& md, const RichParameterList& par, vcg::CallBackPos* cb) +bool MlsPlugin::applyFilter(const QAction* filter, MeshDocument& md, unsigned int& /*postConditionMask*/, const RichParameterList& par, vcg::CallBackPos* cb) { int id = ID(filter); diff --git a/src/meshlabplugins/filter_mls/mlsplugin.h b/src/meshlabplugins/filter_mls/mlsplugin.h index 80a41a297..a382dedc0 100644 --- a/src/meshlabplugins/filter_mls/mlsplugin.h +++ b/src/meshlabplugins/filter_mls/mlsplugin.h @@ -68,7 +68,7 @@ public: FilterClass getClass(const QAction *a) const; virtual void initParameterList(const QAction*, MeshDocument &md, RichParameterList &parent); virtual int getRequirements(const QAction* action); - virtual bool applyFilter(const QAction* filter, MeshDocument &m, const RichParameterList &parent, vcg::CallBackPos *cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &m, unsigned int& postConditionMask, const RichParameterList &parent, vcg::CallBackPos *cb) ; FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp index 2b1183171..e0deeaefe 100644 --- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp +++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.cpp @@ -160,7 +160,7 @@ void FilterMutualGlobal::initParameterList(const QAction *action,MeshDocument & // The Real Core Function doing the actual mesh processing. // Move Vertex of a random quantity -bool FilterMutualGlobal::applyFilter(const QAction *action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterMutualGlobal::applyFilter(const QAction *action, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos *cb) { QElapsedTimer filterTime; filterTime.start(); diff --git a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h index d7747665e..4291ee97c 100644 --- a/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h +++ b/src/meshlabplugins/filter_mutualglobal/filter_mutualglobal.h @@ -55,7 +55,7 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; void initParameterList(const QAction*, MeshDocument & md, RichParameterList & /*parent*/); - bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction*) const { return MeshModel::MM_NONE; }; FilterClass getClass(const QAction* a) const; QString filterScriptFunctionName(FilterIDType filterID); diff --git a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp index 2944d9f59..b59412f0c 100644 --- a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp +++ b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.cpp @@ -110,7 +110,7 @@ void FilterMutualInfoPlugin::initParameterList(const QAction *action,MeshDocumen } } -bool FilterMutualInfoPlugin::applyFilter(const QAction *action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos* ) +bool FilterMutualInfoPlugin::applyFilter(const QAction *action, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos* ) { switch(ID(action)) { case FP_IMAGE_MUTUALINFO : diff --git a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h index a060c8df7..8bedc4c03 100644 --- a/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h +++ b/src/meshlabplugins/filter_mutualinfo/filter_mutualinfo.h @@ -48,7 +48,7 @@ public: FilterClass getClass(const QAction* a) const; FILTER_ARITY filterArity(const QAction*) const; void initParameterList(const QAction*, MeshDocument &, RichParameterList & /*parent*/); - bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int postCondition(const QAction*) const; private: diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.cpp b/src/meshlabplugins/filter_plymc/filter_plymc.cpp index 00cbc391f..f8880a01f 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.cpp +++ b/src/meshlabplugins/filter_plymc/filter_plymc.cpp @@ -123,7 +123,7 @@ void PlyMCPlugin::initParameterList(const QAction *action,MeshModel &m, RichPara } // The Real Core Function doing the actual mesh processing. -bool PlyMCPlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * cb) +bool PlyMCPlugin::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos * cb) { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_plymc/filter_plymc.h b/src/meshlabplugins/filter_plymc/filter_plymc.h index 6f406e2c1..bf096a19b 100644 --- a/src/meshlabplugins/filter_plymc/filter_plymc.h +++ b/src/meshlabplugins/filter_plymc/filter_plymc.h @@ -44,7 +44,7 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FilterClass getClass(const QAction* a) const; FilterPluginInterface::FILTER_ARITY filterArity(const QAction* filter) const; int postCondition(const QAction *filter) const; diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.cpp b/src/meshlabplugins/filter_qhull/filter_qhull.cpp index f06f4e794..570bcaa57 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.cpp +++ b/src/meshlabplugins/filter_qhull/filter_qhull.cpp @@ -198,7 +198,7 @@ void QhullPlugin::initParameterList(const QAction *action,MeshModel &m, RichPara } // The Real Core Function doing the actual mesh processing. -bool QhullPlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos */* cb*/) +bool QhullPlugin::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos */* cb*/) { switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_qhull/filter_qhull.h b/src/meshlabplugins/filter_qhull/filter_qhull.h index 35bea5802..54c108418 100644 --- a/src/meshlabplugins/filter_qhull/filter_qhull.h +++ b/src/meshlabplugins/filter_qhull/filter_qhull.h @@ -59,7 +59,7 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(const QAction* filter, MeshDocument &m, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &m, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; virtual FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp index 911f82538..4ff1bf471 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.cpp +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.cpp @@ -125,7 +125,7 @@ void QualityMapperFilter::initParameterList(const QAction *action,MeshModel &m, // The Real Core Function doing the actual mesh processing. // Apply color to mesh vertices -bool QualityMapperFilter::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool QualityMapperFilter::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos *cb) { MeshModel &m=*(md.mm()); m.updateDataMask(MeshModel::MM_VERTCOLOR); diff --git a/src/meshlabplugins/filter_quality/filterqualitymapper.h b/src/meshlabplugins/filter_quality/filterqualitymapper.h index 71ea0ab5d..a1b4c6d69 100644 --- a/src/meshlabplugins/filter_quality/filterqualitymapper.h +++ b/src/meshlabplugins/filter_quality/filterqualitymapper.h @@ -75,7 +75,7 @@ public: int getPreConditions(const QAction *) const; int postCondition(const QAction* ) const; virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; virtual FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_sample/filter_sample.cpp b/src/meshlabplugins/filter_sample/filter_sample.cpp index 7a0003ae6..b2a3fc9f1 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.cpp +++ b/src/meshlabplugins/filter_sample/filter_sample.cpp @@ -153,7 +153,7 @@ void FilterSamplePlugin::initParameterList(const QAction *action,MeshModel &m, R * @param cb: callback object to tell MeshLab the percentage of execution of the filter * @return true if the filter has been applied correctly, false otherwise */ -bool FilterSamplePlugin::applyFilter(const QAction * action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterSamplePlugin::applyFilter(const QAction * action, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos *cb) { switch(ID(action)) { case FP_MOVE_VERTEX : diff --git a/src/meshlabplugins/filter_sample/filter_sample.h b/src/meshlabplugins/filter_sample/filter_sample.h index 1b55b1ecf..a05fce3e6 100644 --- a/src/meshlabplugins/filter_sample/filter_sample.h +++ b/src/meshlabplugins/filter_sample/filter_sample.h @@ -61,7 +61,7 @@ public: int getPreConditions(const QAction *) const; int postCondition(const QAction* ) const; void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(const QAction* action, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); + bool applyFilter(const QAction* action, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); private: bool vertexDisplacement( diff --git a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp index f5ae908b3..58bfb73cc 100644 --- a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp +++ b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.cpp @@ -118,7 +118,7 @@ void ExtraSampleDynPlugin::initParameterList(const QAction *action,MeshModel &/* // The Real Core Function doing the actual mesh processing. // It changes the color of the mesh according to a perlin noise function -bool ExtraSampleDynPlugin::applyFilter(const QAction *, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *) +bool ExtraSampleDynPlugin::applyFilter(const QAction *, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos *) { MeshModel &m=*(md.mm()); const Color4b baseColor = par.getColor4b("baseColor"); diff --git a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h index f67c0c806..50cbf3349 100644 --- a/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h +++ b/src/meshlabplugins/filter_sample_dyn/filter_sample_dyn.h @@ -44,7 +44,7 @@ public: virtual QString filterInfo(FilterIDType filter) const; virtual void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); virtual int postCondition(const QAction* ) const {return MeshModel::MM_VERTCOLOR;}; - virtual bool applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + virtual bool applyFilter(const QAction *filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; virtual FilterClass getClass(const QAction*) const; FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp index fb1b12ab9..53b373852 100644 --- a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp +++ b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.cpp @@ -108,7 +108,7 @@ void ExtraSampleGPUPlugin::initParameterList(const QAction * action, MeshModel & // The Real Core Function doing the actual mesh processing. // Move Vertex of a random quantity -bool ExtraSampleGPUPlugin::applyFilter(const QAction * a, MeshDocument & md , const RichParameterList & par, vcg::CallBackPos * /*cb*/) +bool ExtraSampleGPUPlugin::applyFilter(const QAction * a, MeshDocument & md , unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos * /*cb*/) { switch(ID(a)) { diff --git a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h index ce5a768b4..5921358d9 100644 --- a/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h +++ b/src/meshlabplugins/filter_sample_gpu/filter_sample_gpu.h @@ -55,7 +55,7 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; - bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FilterClass getClass(const QAction* a) const; }; diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.cpp b/src/meshlabplugins/filter_sampling/filter_sampling.cpp index 8427cd2b7..b0cc8a438 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.cpp +++ b/src/meshlabplugins/filter_sampling/filter_sampling.cpp @@ -698,7 +698,7 @@ void FilterDocSampling::initParameterList(const QAction *action, MeshDocument & } } -bool FilterDocSampling::applyFilter(const QAction *action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterDocSampling::applyFilter(const QAction *action, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos *cb) { switch(ID(action)) { diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.h b/src/meshlabplugins/filter_sampling/filter_sampling.h index d8c264e67..524eddee7 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.h +++ b/src/meshlabplugins/filter_sampling/filter_sampling.h @@ -55,7 +55,7 @@ class FilterDocSampling : public QObject, public FilterPluginInterface QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(const QAction* filter, MeshDocument &m, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &m, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; int getRequirements(const QAction* action); int postCondition(const QAction* ) const; FilterClass getClass(const QAction*) const; diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp index ec1a334a5..f2b68a06e 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.cpp @@ -103,7 +103,12 @@ int FilterScreenedPoissonPlugin::getRequirements(const QAction* a) } } -bool FilterScreenedPoissonPlugin::applyFilter(const QAction* filter, MeshDocument& md, const RichParameterList& params, vcg::CallBackPos* cb) +bool FilterScreenedPoissonPlugin::applyFilter( + const QAction* filter, + MeshDocument& md, + unsigned int& /*postConditionMask*/, + const RichParameterList& params, + vcg::CallBackPos* cb) { bool currDirChanged=false; QDir currDir = QDir::current(); diff --git a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h index 0f68d14c6..ba5abd401 100644 --- a/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h +++ b/src/meshlabplugins/filter_screened_poisson/filter_screened_poisson.h @@ -47,8 +47,10 @@ public: FilterClass getClass(const QAction* a) const; int getRequirements(const QAction* a); - bool applyFilter(const QAction* filter, + bool applyFilter( + const QAction* filter, MeshDocument& md, + unsigned int& postConditionMask, const RichParameterList& params, vcg::CallBackPos* cb) ; diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp index 9ad25d5a7..85c3eaa42 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.cpp @@ -143,7 +143,7 @@ QString SdfGpuPlugin::filterInfo(FilterIDType filterId) const return QString(""); } -bool SdfGpuPlugin::applyFilter(const QAction */*filter*/, MeshDocument &md, const RichParameterList & pars, vcg::CallBackPos *cb) +bool SdfGpuPlugin::applyFilter(const QAction */*filter*/, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & pars, vcg::CallBackPos *cb) { MeshModel* mm = md.mm(); diff --git a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h index 97e9a29e7..bf67c8afe 100644 --- a/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h +++ b/src/meshlabplugins/filter_sdfgpu/filter_sdfgpu.h @@ -37,7 +37,7 @@ public: FILTER_ARITY filterArity(const QAction* act) const; //Main plugin function - bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); + bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & par, vcg::CallBackPos *cb); //Parameters init for user interface virtual void initParameterList(const QAction* action, MeshModel &m, RichParameterList &parlst); diff --git a/src/meshlabplugins/filter_sdfgpu/filterinterface.h b/src/meshlabplugins/filter_sdfgpu/filterinterface.h index 5ddef5188..8b449e671 100644 --- a/src/meshlabplugins/filter_sdfgpu/filterinterface.h +++ b/src/meshlabplugins/filter_sdfgpu/filterinterface.h @@ -155,7 +155,7 @@ private: int postCondition(const QAction*) const{ return MeshModel::MM_NONE; } - bool applyFilter(const QAction *, MeshDocument &md, const RichParameterList& par, vcg::CallBackPos * cb){ + bool applyFilter(const QAction *, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList& par, vcg::CallBackPos * cb){ return applyFilter(md, par, cb); } virtual void initParameterList(const QAction *, MeshDocument &md, RichParameterList &par){ diff --git a/src/meshlabplugins/filter_select/meshselect.cpp b/src/meshlabplugins/filter_select/meshselect.cpp index 93b885002..fd754291d 100644 --- a/src/meshlabplugins/filter_select/meshselect.cpp +++ b/src/meshlabplugins/filter_select/meshselect.cpp @@ -303,7 +303,7 @@ void SelectionFilterPlugin::initParameterList(const QAction *action, MeshModel & } } -bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * /*cb*/) +bool SelectionFilterPlugin::applyFilter(const QAction *action, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos * /*cb*/) { if (md.mm() == NULL) return false; diff --git a/src/meshlabplugins/filter_select/meshselect.h b/src/meshlabplugins/filter_select/meshselect.h index 0727895fd..b8b157961 100644 --- a/src/meshlabplugins/filter_select/meshselect.h +++ b/src/meshlabplugins/filter_select/meshselect.h @@ -78,7 +78,7 @@ class SelectionFilterPlugin : public QObject, public FilterPluginInterface int getPreConditions(const QAction*) const; int postCondition(const QAction* ) const; int getRequirements(const QAction*); - bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; FILTER_ARITY filterArity(const QAction *) const {return SINGLE_MESH;} }; diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp index 2725af957..9aad1e867 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.cpp @@ -125,7 +125,7 @@ void FilterSketchFabPlugin::initParameterList(const QAction* action, MeshModel&, } } -bool FilterSketchFabPlugin::applyFilter(const QAction * action, MeshDocument& md, const RichParameterList& par, vcg::CallBackPos* cb) +bool FilterSketchFabPlugin::applyFilter(const QAction * action, MeshDocument& md, unsigned int& /*postConditionMask*/, const RichParameterList& par, vcg::CallBackPos* cb) { switch (ID(action)) { case FP_SKETCHFAB: diff --git a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h index 59d84bb00..559224d45 100644 --- a/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h +++ b/src/meshlabplugins/filter_sketchfab/filter_sketchfab.h @@ -46,7 +46,7 @@ public: int getPreConditions(const QAction*) const; int postCondition(const QAction* ) const; void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; public slots: void finished(); diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp index 04441920f..fa50a5862 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.cpp @@ -77,7 +77,7 @@ void FilterSSynth::openX3D(const QString &fileName, MeshModel &m, int& mask, vcg delete(info); } -bool FilterSSynth::applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterSSynth::applyFilter(const QAction* filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos *cb) { md.addNewMesh("",this->filterName(ID(filter))); QWidget * parent=(QWidget*)this->parent(); diff --git a/src/meshlabplugins/filter_ssynth/filter_ssynth.h b/src/meshlabplugins/filter_ssynth/filter_ssynth.h index 061304a9a..d18bb5ea3 100644 --- a/src/meshlabplugins/filter_ssynth/filter_ssynth.h +++ b/src/meshlabplugins/filter_ssynth/filter_ssynth.h @@ -45,7 +45,7 @@ public: virtual int getRequirements(const QAction*); virtual void initParameterList(const QAction* /*filter*/,MeshModel &,RichParameterList &){}; virtual void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb); + virtual bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & par, vcg::CallBackPos *cb); virtual FilterClass getClass(const QAction* filter) const; void setAttributes(CMeshO::VertexIterator &vi, CMeshO &m); static void openX3D(const QString &fileName, MeshModel &m, int& mask, vcg::CallBackPos *cb, QWidget *parent=0); diff --git a/src/meshlabplugins/filter_texture/filter_texture.cpp b/src/meshlabplugins/filter_texture/filter_texture.cpp index 3de6cae90..b79445044 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.cpp +++ b/src/meshlabplugins/filter_texture/filter_texture.cpp @@ -342,7 +342,7 @@ T log_2(const T num) } // The Real Core Function doing the actual mesh processing. -bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList &par, CallBackPos *cb) +bool FilterTexturePlugin::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList &par, CallBackPos *cb) { MeshModel &m=*(md.mm()); switch(ID(filter)) { diff --git a/src/meshlabplugins/filter_texture/filter_texture.h b/src/meshlabplugins/filter_texture/filter_texture.h index f1ed10b7a..a91e3a114 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.h +++ b/src/meshlabplugins/filter_texture/filter_texture.h @@ -59,7 +59,7 @@ public: virtual QString filterName(FilterIDType filter) const; virtual QString filterInfo(FilterIDType filter) const; virtual void initParameterList(const QAction*, MeshDocument &/*m*/, RichParameterList & /*parent*/); - virtual bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); + virtual bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb); virtual int getRequirements(const QAction*); virtual int getPreConditions(const QAction*) const; virtual int postCondition(const QAction* ) const; diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp index d1ebc5c7e..e92d2289e 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.cpp @@ -262,7 +262,7 @@ void TriOptimizePlugin::initParameterList(const QAction *action, MeshModel &m, R // The Real Core Function doing the actual mesh processing. // Run mesh optimization -bool TriOptimizePlugin::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool TriOptimizePlugin::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos *cb) { MeshModel &m=*(md.mm()); float limit = -std::numeric_limits::epsilon(); diff --git a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h index a9ea5e7d6..36bbf97b6 100644 --- a/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h +++ b/src/meshlabplugins/filter_trioptimize/filter_trioptimize.h @@ -48,7 +48,7 @@ public: QString filterName(FilterIDType filter) const; QString filterInfo(FilterIDType filter) const; void initParameterList(const QAction*, MeshModel &/*m*/, RichParameterList & /*parent*/); - bool applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList &/*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction *filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList &/*parent*/, vcg::CallBackPos * cb) ; int getRequirements(const QAction*); FilterClass getClass(const QAction *) const; int postCondition(const QAction* ) const; diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp index d1a8a4cbf..6764cdb26 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.cpp @@ -405,7 +405,7 @@ void FilterUnsharp::initParameterList(const QAction *action, MeshDocument &md, R } } -bool FilterUnsharp::applyFilter(const QAction *filter, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos * cb) +bool FilterUnsharp::applyFilter(const QAction *filter, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos * cb) { MeshModel &m=*(md.mm()); switch(ID(filter)) diff --git a/src/meshlabplugins/filter_unsharp/filter_unsharp.h b/src/meshlabplugins/filter_unsharp/filter_unsharp.h index ee03de328..63558873e 100644 --- a/src/meshlabplugins/filter_unsharp/filter_unsharp.h +++ b/src/meshlabplugins/filter_unsharp/filter_unsharp.h @@ -72,7 +72,7 @@ class FilterUnsharp : public QObject, public FilterPluginInterface QString filterInfo(FilterIDType filter) const; FilterClass getClass(const QAction*) const; int getRequirements(const QAction*); - bool applyFilter(const QAction* filter, MeshDocument &md, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; + bool applyFilter(const QAction* filter, MeshDocument &md, unsigned int& postConditionMask, const RichParameterList & /*parent*/, vcg::CallBackPos * cb) ; void initParameterList(const QAction* action, MeshDocument &/*m*/, RichParameterList & parlst); int postCondition(const QAction* ) const; int getPreConditions(const QAction*) const; diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp index 4bacd9540..3cdefe7e7 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.cpp @@ -211,7 +211,7 @@ int FilterVoronoiPlugin::getPreConditions(const QAction* action) const } } -bool FilterVoronoiPlugin::applyFilter(const QAction * action, MeshDocument &md, const RichParameterList & par, vcg::CallBackPos *cb) +bool FilterVoronoiPlugin::applyFilter(const QAction * action, MeshDocument &md, unsigned int& /*postConditionMask*/, const RichParameterList & par, vcg::CallBackPos *cb) { switch(ID(action)) { case VORONOI_SAMPLING : diff --git a/src/meshlabplugins/filter_voronoi/filter_voronoi.h b/src/meshlabplugins/filter_voronoi/filter_voronoi.h index 6db844051..f6e3b23ff 100644 --- a/src/meshlabplugins/filter_voronoi/filter_voronoi.h +++ b/src/meshlabplugins/filter_voronoi/filter_voronoi.h @@ -51,7 +51,7 @@ public: FILTER_ARITY filterArity(const QAction* a) const; void initParameterList(const QAction* action, MeshModel& m, RichParameterList& par); int getPreConditions(const QAction* action) const; - bool applyFilter(const QAction* action, MeshDocument& md, const RichParameterList& par, vcg::CallBackPos* cb) ; + bool applyFilter(const QAction* action, MeshDocument& md, unsigned int& postConditionMask, const RichParameterList& par, vcg::CallBackPos* cb) ; int postCondition(const QAction* ) const; private: diff --git a/src/meshlabserver/mainserver.cpp b/src/meshlabserver/mainserver.cpp index 864d513fc..aa0bc8cff 100644 --- a/src/meshlabserver/mainserver.cpp +++ b/src/meshlabserver/mainserver.cpp @@ -682,7 +682,8 @@ public: } } meshDocument.setBusy(true); - ret = iFilter->applyFilter( action, meshDocument, pair.second, filterCallBack); + unsigned int postConditionMask = MeshModel::MM_UNKNOWN; + ret = iFilter->applyFilter( action, meshDocument, postConditionMask, pair.second, filterCallBack); meshDocument.setBusy(false); if (shared != NULL) delete iFilter->glContext; From 52f58e9de24a778c01e6cb9f7e2ea9e8e480d300 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Sat, 19 Sep 2020 14:51:59 +0200 Subject: [PATCH 42/49] check for betas on github, const correctness edit plugins --- src/common/interfaces/edit_plugin_interface.h | 4 ++-- src/meshlab/mainwindow_Init.cpp | 22 ++++++++++++++++++- .../edit_align/edit_align_factory.cpp | 4 ++-- .../edit_align/edit_align_factory.h | 4 ++-- .../edit_manipulators_factory.cpp | 4 ++-- .../edit_manipulators_factory.h | 4 ++-- .../edit_measure/edit_measure_factory.cpp | 4 ++-- .../edit_measure/edit_measure_factory.h | 4 ++-- .../edit_mutualcorrs_factory.cpp | 4 ++-- .../edit_mutualcorrs_factory.h | 4 ++-- .../edit_paint/edit_paint_factory.cpp | 4 ++-- .../edit_paint/edit_paint_factory.h | 4 ++-- .../edit_pickpoints_factory.cpp | 4 ++-- .../edit_pickpoints/edit_pickpoints_factory.h | 4 ++-- .../edit_point/edit_point_factory.cpp | 4 ++-- .../edit_point/edit_point_factory.h | 4 ++-- .../edit_quality/edit_quality_factory.cpp | 4 ++-- .../edit_quality/edit_quality_factory.h | 4 ++-- .../edit_referencing_factory.cpp | 4 ++-- .../edit_referencing_factory.h | 4 ++-- .../edit_sample/edit_sample_factory.cpp | 4 ++-- .../edit_sample/edit_sample_factory.h | 4 ++-- .../edit_select/edit_select_factory.cpp | 4 ++-- .../edit_select/edit_select_factory.h | 4 ++-- 24 files changed, 67 insertions(+), 47 deletions(-) diff --git a/src/common/interfaces/edit_plugin_interface.h b/src/common/interfaces/edit_plugin_interface.h index 27f180952..37a076da7 100644 --- a/src/common/interfaces/edit_plugin_interface.h +++ b/src/common/interfaces/edit_plugin_interface.h @@ -107,10 +107,10 @@ public: virtual QList actions() const = 0; //get the edit tool for the given action - virtual EditPluginInterface* getMeshEditInterface(QAction *) = 0; + virtual EditPluginInterface* getMeshEditInterface(const QAction *) = 0; //get the description for the given action - virtual QString getEditToolDescription(QAction *) = 0; + virtual QString getEditToolDescription(const QAction *) = 0; }; diff --git a/src/meshlab/mainwindow_Init.cpp b/src/meshlab/mainwindow_Init.cpp index 2932641ea..e720e626a 100644 --- a/src/meshlab/mainwindow_Init.cpp +++ b/src/meshlab/mainwindow_Init.cpp @@ -1002,7 +1002,16 @@ void MainWindow::checkForUpdates(bool verboseFlag) { verboseCheckingFlag = verboseFlag; + bool checkForMonthlyAndBetasVal = false; + const QString checkForMonthlyAndBetasVar("checkForMonthlyAndBetas"); + + QString urlCheck = "https://www.meshlab.net/ML_VERSION"; QSettings settings; + if (settings.contains(checkForMonthlyAndBetasVar)) + checkForMonthlyAndBetasVal = settings.value(checkForMonthlyAndBetasVar).toBool(); + if (checkForMonthlyAndBetasVal){ + urlCheck = "https://github.com/cnr-isti-vclab/meshlab/blob/master/ML_VERSION"; + } int totalKV = settings.value("totalKV", 0).toInt(); int loadedMeshCounter = settings.value("loadedMeshCounter", 0).toInt(); int savedMeshCounter = settings.value("savedMeshCounter", 0).toInt(); @@ -1026,7 +1035,7 @@ void MainWindow::checkForUpdates(bool verboseFlag) QNetworkRequest statreq(MeshLabApplication::organizationHost() + message); stats.get(statreq); - QNetworkRequest request(QString("http://www.meshlab.net/ML_VERSION")); + QNetworkRequest request(urlCheck); httpReq.get(request); } @@ -1038,6 +1047,8 @@ void MainWindow::connectionDone(QNetworkReply *reply) bool dontRemindMeAboutUpgradeVal = false; const QString dontRemindMeAboutUpgradeVar("dontRemindMeAboutUpgrade"); + const QString checkForMonthlyAndBetasVar("checkForMonthlyAndBetas"); + // Check if the user specified not to be reminded to upgrade if (!verboseCheckingFlag) { if (settings.contains(dontRemindMeAboutUpgradeVar)) @@ -1071,6 +1082,9 @@ void MainWindow::connectionDone(QNetworkReply *reply) QCheckBox dontShowCheckBox("Don't show this message again."); dontShowCheckBox.blockSignals(true); msgBox.addButton(&dontShowCheckBox, QMessageBox::ResetRole); + QCheckBox checkMonthlysCheckBox("Check for Monthly and Beta versions."); + checkMonthlysCheckBox.blockSignals(true); + msgBox.addButton(&checkMonthlysCheckBox, QMessageBox::ResetRole); if (newVersionAvailable){ msgBox.setText( @@ -1088,6 +1102,12 @@ void MainWindow::connectionDone(QNetworkReply *reply) int userReply = msgBox.exec(); if (userReply == QMessageBox::Ok && dontShowCheckBox.checkState() == Qt::Checked) settings.setValue(dontRemindMeAboutUpgradeVar, true); + else if (userReply == QMessageBox::Ok && dontShowCheckBox.checkState() == Qt::Unchecked) + settings.setValue(dontRemindMeAboutUpgradeVar, false); + if (userReply == QMessageBox::Ok && checkMonthlysCheckBox.checkState() == Qt::Checked) + settings.setValue(checkForMonthlyAndBetasVar, true); + else if (userReply == QMessageBox::Ok && checkMonthlysCheckBox.checkState() == Qt::Unchecked) + settings.setValue(checkForMonthlyAndBetasVar, false); } } diff --git a/src/meshlabplugins/edit_align/edit_align_factory.cpp b/src/meshlabplugins/edit_align/edit_align_factory.cpp index cf55d86a2..c601e6d29 100644 --- a/src/meshlabplugins/edit_align/edit_align_factory.cpp +++ b/src/meshlabplugins/edit_align/edit_align_factory.cpp @@ -41,13 +41,13 @@ QList EditAlignFactory::actions() const } //get the edit tool for the given action -EditPluginInterface* EditAlignFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditAlignFactory::getMeshEditInterface(const QAction *action) { assert(action == editAlign); (void) action; return new EditAlignPlugin(); } -QString EditAlignFactory::getEditToolDescription(QAction *) +QString EditAlignFactory::getEditToolDescription(const QAction *) { return EditAlignPlugin::Info(); } diff --git a/src/meshlabplugins/edit_align/edit_align_factory.h b/src/meshlabplugins/edit_align/edit_align_factory.h index 184966f49..eb60e6b79 100644 --- a/src/meshlabplugins/edit_align/edit_align_factory.h +++ b/src/meshlabplugins/edit_align/edit_align_factory.h @@ -42,10 +42,10 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual EditPluginInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(const QAction*); //get the description for the given action - virtual QString getEditToolDescription(QAction *); + virtual QString getEditToolDescription(const QAction*); private: QList actionList; diff --git a/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.cpp b/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.cpp index 14cdf23cb..b219828f8 100644 --- a/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.cpp +++ b/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.cpp @@ -41,7 +41,7 @@ QList EditManipulatorsFactory::actions() const } //get the edit tool for the given action -EditPluginInterface* EditManipulatorsFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditManipulatorsFactory::getMeshEditInterface(const QAction *action) { if(action == editManipulators) { @@ -50,7 +50,7 @@ EditPluginInterface* EditManipulatorsFactory::getMeshEditInterface(QAction *acti return NULL; } -QString EditManipulatorsFactory::getEditToolDescription(QAction *) +QString EditManipulatorsFactory::getEditToolDescription(const QAction *) { return EditManipulatorsPlugin::Info(); } diff --git a/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.h b/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.h index a97a61d4b..8f56e6c11 100644 --- a/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.h +++ b/src/meshlabplugins/edit_manipulators/edit_manipulators_factory.h @@ -42,10 +42,10 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual EditPluginInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(const QAction*); //get the description for the given action - virtual QString getEditToolDescription(QAction *); + virtual QString getEditToolDescription(const QAction*); private: QList actionList; diff --git a/src/meshlabplugins/edit_measure/edit_measure_factory.cpp b/src/meshlabplugins/edit_measure/edit_measure_factory.cpp index 25fb1e097..0f023c4c4 100644 --- a/src/meshlabplugins/edit_measure/edit_measure_factory.cpp +++ b/src/meshlabplugins/edit_measure/edit_measure_factory.cpp @@ -41,7 +41,7 @@ QList EditMeasureFactory::actions() const } //get the edit tool for the given action -EditPluginInterface* EditMeasureFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditMeasureFactory::getMeshEditInterface(const QAction *action) { if(action == editMeasure) { @@ -50,7 +50,7 @@ EditPluginInterface* EditMeasureFactory::getMeshEditInterface(QAction *action) return NULL; } -QString EditMeasureFactory::getEditToolDescription(QAction *) +QString EditMeasureFactory::getEditToolDescription(const QAction *) { return EditMeasurePlugin::Info(); } diff --git a/src/meshlabplugins/edit_measure/edit_measure_factory.h b/src/meshlabplugins/edit_measure/edit_measure_factory.h index 364bd67d7..f92a11c3a 100644 --- a/src/meshlabplugins/edit_measure/edit_measure_factory.h +++ b/src/meshlabplugins/edit_measure/edit_measure_factory.h @@ -42,10 +42,10 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual EditPluginInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(const QAction*); //get the description for the given action - virtual QString getEditToolDescription(QAction *); + virtual QString getEditToolDescription(const QAction*); private: QList actionList; diff --git a/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.cpp b/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.cpp index f32f4426f..0e73b3cbb 100644 --- a/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.cpp +++ b/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.cpp @@ -41,7 +41,7 @@ QList EditMutualCorrsFactory::actions() const } //get the edit tool for the given action -EditPluginInterface* EditMutualCorrsFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditMutualCorrsFactory::getMeshEditInterface(const QAction *action) { if(action == editMutualCorrs) { @@ -50,7 +50,7 @@ EditPluginInterface* EditMutualCorrsFactory::getMeshEditInterface(QAction *actio return NULL; } -QString EditMutualCorrsFactory::getEditToolDescription(QAction *) +QString EditMutualCorrsFactory::getEditToolDescription(const QAction *) { return EditMutualCorrsPlugin::Info(); } diff --git a/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.h b/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.h index 74918e7f5..44bef4b90 100644 --- a/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.h +++ b/src/meshlabplugins/edit_mutualcorrs/edit_mutualcorrs_factory.h @@ -41,10 +41,10 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual EditPluginInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(const QAction*); //get the description for the given action - virtual QString getEditToolDescription(QAction *); + virtual QString getEditToolDescription(const QAction*); private: QList actionList; diff --git a/src/meshlabplugins/edit_paint/edit_paint_factory.cpp b/src/meshlabplugins/edit_paint/edit_paint_factory.cpp index 0774105fb..b56eb10c4 100644 --- a/src/meshlabplugins/edit_paint/edit_paint_factory.cpp +++ b/src/meshlabplugins/edit_paint/edit_paint_factory.cpp @@ -41,7 +41,7 @@ QList EditPaintFactory::actions() const } //get the edit tool for the given action -EditPluginInterface* EditPaintFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditPaintFactory::getMeshEditInterface(const QAction *action) { if(action == editPaint) { @@ -50,7 +50,7 @@ EditPluginInterface* EditPaintFactory::getMeshEditInterface(QAction *action) return NULL; } -QString EditPaintFactory::getEditToolDescription(QAction *) +QString EditPaintFactory::getEditToolDescription(const QAction *) { return EditPaintPlugin::Info(); } diff --git a/src/meshlabplugins/edit_paint/edit_paint_factory.h b/src/meshlabplugins/edit_paint/edit_paint_factory.h index 8d0a53d90..2ad2056bf 100644 --- a/src/meshlabplugins/edit_paint/edit_paint_factory.h +++ b/src/meshlabplugins/edit_paint/edit_paint_factory.h @@ -42,10 +42,10 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual EditPluginInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(const QAction*); //get the description for the given action - virtual QString getEditToolDescription(QAction *); + virtual QString getEditToolDescription(const QAction*); private: QList actionList; diff --git a/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.cpp b/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.cpp index cac26e0f9..1fbe5caea 100644 --- a/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.cpp +++ b/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.cpp @@ -41,7 +41,7 @@ QList EditPickPointsFactory::actions() const } //get the edit tool for the given action -EditPluginInterface* EditPickPointsFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditPickPointsFactory::getMeshEditInterface(const QAction *action) { if(action == editPickPoints) { return new EditPickPointsPlugin(); @@ -51,7 +51,7 @@ EditPluginInterface* EditPickPointsFactory::getMeshEditInterface(QAction *action } } -QString EditPickPointsFactory::getEditToolDescription(QAction *) +QString EditPickPointsFactory::getEditToolDescription(const QAction *) { return EditPickPointsPlugin::Info(); } diff --git a/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.h b/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.h index ca79241d5..3d8bb3404 100644 --- a/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.h +++ b/src/meshlabplugins/edit_pickpoints/edit_pickpoints_factory.h @@ -42,10 +42,10 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual EditPluginInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(const QAction*); //get the description for the given action - QString getEditToolDescription(QAction *); + QString getEditToolDescription(const QAction*); private: QList actionList; diff --git a/src/meshlabplugins/edit_point/edit_point_factory.cpp b/src/meshlabplugins/edit_point/edit_point_factory.cpp index 71e3a7160..4fff642e9 100644 --- a/src/meshlabplugins/edit_point/edit_point_factory.cpp +++ b/src/meshlabplugins/edit_point/edit_point_factory.cpp @@ -43,7 +43,7 @@ QList PointEditFactory::actions() const } //get the edit tool for the given action -EditPluginInterface* PointEditFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* PointEditFactory::getMeshEditInterface(const QAction *action) { if(action == editPoint) return new EditPointPlugin(EditPointPlugin::SELECT_DEFAULT_MODE); @@ -54,7 +54,7 @@ EditPluginInterface* PointEditFactory::getMeshEditInterface(QAction *action) return nullptr; } -QString PointEditFactory::getEditToolDescription(QAction *) +QString PointEditFactory::getEditToolDescription(const QAction *) { return EditPointPlugin::Info(); } diff --git a/src/meshlabplugins/edit_point/edit_point_factory.h b/src/meshlabplugins/edit_point/edit_point_factory.h index 03ce9048c..a35ebe9ae 100644 --- a/src/meshlabplugins/edit_point/edit_point_factory.h +++ b/src/meshlabplugins/edit_point/edit_point_factory.h @@ -42,10 +42,10 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual EditPluginInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(const QAction*); //get the description for the given action - virtual QString getEditToolDescription(QAction *); + virtual QString getEditToolDescription(const QAction*); private: QList actionList; diff --git a/src/meshlabplugins/edit_quality/edit_quality_factory.cpp b/src/meshlabplugins/edit_quality/edit_quality_factory.cpp index 13ea8d616..669290f4a 100644 --- a/src/meshlabplugins/edit_quality/edit_quality_factory.cpp +++ b/src/meshlabplugins/edit_quality/edit_quality_factory.cpp @@ -42,7 +42,7 @@ QList QualityMapperFactory::actions() const } //get the edit tool for the given action -EditPluginInterface* QualityMapperFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* QualityMapperFactory::getMeshEditInterface(const QAction *action) { if(action == editQuality) { @@ -51,7 +51,7 @@ EditPluginInterface* QualityMapperFactory::getMeshEditInterface(QAction *action) return nullptr; } -QString QualityMapperFactory::getEditToolDescription(QAction *) +QString QualityMapperFactory::getEditToolDescription(const QAction *) { return QualityMapperPlugin::Info(); } diff --git a/src/meshlabplugins/edit_quality/edit_quality_factory.h b/src/meshlabplugins/edit_quality/edit_quality_factory.h index f2b3ab31a..810daeed1 100644 --- a/src/meshlabplugins/edit_quality/edit_quality_factory.h +++ b/src/meshlabplugins/edit_quality/edit_quality_factory.h @@ -42,10 +42,10 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual EditPluginInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(const QAction*); //get the description for the given action - virtual QString getEditToolDescription(QAction *); + virtual QString getEditToolDescription(const QAction*); private: QList actionList; diff --git a/src/meshlabplugins/edit_referencing/edit_referencing_factory.cpp b/src/meshlabplugins/edit_referencing/edit_referencing_factory.cpp index d9d48af09..fbe41c788 100644 --- a/src/meshlabplugins/edit_referencing/edit_referencing_factory.cpp +++ b/src/meshlabplugins/edit_referencing/edit_referencing_factory.cpp @@ -41,7 +41,7 @@ QList EditReferencingFactory::actions() const } //get the edit tool for the given action -EditPluginInterface* EditReferencingFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditReferencingFactory::getMeshEditInterface(const QAction *action) { if(action == editReferencing) { @@ -50,7 +50,7 @@ EditPluginInterface* EditReferencingFactory::getMeshEditInterface(QAction *actio return nullptr; } -QString EditReferencingFactory::getEditToolDescription(QAction *) +QString EditReferencingFactory::getEditToolDescription(const QAction *) { return EditReferencingPlugin::Info(); } diff --git a/src/meshlabplugins/edit_referencing/edit_referencing_factory.h b/src/meshlabplugins/edit_referencing/edit_referencing_factory.h index bef05b70d..503d4c97e 100644 --- a/src/meshlabplugins/edit_referencing/edit_referencing_factory.h +++ b/src/meshlabplugins/edit_referencing/edit_referencing_factory.h @@ -41,10 +41,10 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual EditPluginInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(const QAction*); //get the description for the given action - virtual QString getEditToolDescription(QAction *); + virtual QString getEditToolDescription(const QAction*); private: QList actionList; diff --git a/src/meshlabplugins/edit_sample/edit_sample_factory.cpp b/src/meshlabplugins/edit_sample/edit_sample_factory.cpp index 101011e18..3077e730a 100644 --- a/src/meshlabplugins/edit_sample/edit_sample_factory.cpp +++ b/src/meshlabplugins/edit_sample/edit_sample_factory.cpp @@ -41,7 +41,7 @@ QList SampleEditFactory::actions() const } //get the edit tool for the given action -EditPluginInterface* SampleEditFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* SampleEditFactory::getMeshEditInterface(const QAction *action) { if(action == editSample) { @@ -50,7 +50,7 @@ EditPluginInterface* SampleEditFactory::getMeshEditInterface(QAction *action) return nullptr; } -QString SampleEditFactory::getEditToolDescription(QAction *) +QString SampleEditFactory::getEditToolDescription(const QAction *) { return SampleEditPlugin::Info(); } diff --git a/src/meshlabplugins/edit_sample/edit_sample_factory.h b/src/meshlabplugins/edit_sample/edit_sample_factory.h index dfd48b976..e597f9d21 100644 --- a/src/meshlabplugins/edit_sample/edit_sample_factory.h +++ b/src/meshlabplugins/edit_sample/edit_sample_factory.h @@ -42,10 +42,10 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual EditPluginInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(const QAction*); //get the description for the given action - virtual QString getEditToolDescription(QAction *); + virtual QString getEditToolDescription(const QAction*); private: QList actionList; diff --git a/src/meshlabplugins/edit_select/edit_select_factory.cpp b/src/meshlabplugins/edit_select/edit_select_factory.cpp index fb1b90165..f3b46d18a 100644 --- a/src/meshlabplugins/edit_select/edit_select_factory.cpp +++ b/src/meshlabplugins/edit_select/edit_select_factory.cpp @@ -47,7 +47,7 @@ QList EditSelectFactory::actions() const } //get the edit tool for the given action -EditPluginInterface* EditSelectFactory::getMeshEditInterface(QAction *action) +EditPluginInterface* EditSelectFactory::getMeshEditInterface(const QAction *action) { if(action == editSelect) return new EditSelectPlugin(EditSelectPlugin::SELECT_FACE_MODE); @@ -62,7 +62,7 @@ EditPluginInterface* EditSelectFactory::getMeshEditInterface(QAction *action) return nullptr; } -QString EditSelectFactory::getEditToolDescription(QAction * /*a*/) +QString EditSelectFactory::getEditToolDescription(const QAction * /*a*/) { return EditSelectPlugin::Info(); } diff --git a/src/meshlabplugins/edit_select/edit_select_factory.h b/src/meshlabplugins/edit_select/edit_select_factory.h index 66749a3d9..825a0380f 100644 --- a/src/meshlabplugins/edit_select/edit_select_factory.h +++ b/src/meshlabplugins/edit_select/edit_select_factory.h @@ -41,10 +41,10 @@ public: virtual QList actions() const; //get the edit tool for the given action - virtual EditPluginInterface* getMeshEditInterface(QAction *); + virtual EditPluginInterface* getMeshEditInterface(const QAction*); //get the description for the given action - virtual QString getEditToolDescription(QAction *); + virtual QString getEditToolDescription(const QAction*); private: QList actionList; From cf66402dfe43e1f4219a64e89018a63d565286b5 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Mon, 21 Sep 2020 15:14:32 +0200 Subject: [PATCH 43/49] const correctness MainWindowInterface --- src/common/interfaces/mainwindow_interface.h | 2 +- src/meshlab/glarea.h | 6 +++--- src/meshlab/mainwindow.h | 3 +-- src/meshlab/mainwindow_RunTime.cpp | 8 +------- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/common/interfaces/mainwindow_interface.h b/src/common/interfaces/mainwindow_interface.h index 7de967f0f..f4989799a 100644 --- a/src/common/interfaces/mainwindow_interface.h +++ b/src/common/interfaces/mainwindow_interface.h @@ -34,7 +34,7 @@ It is used as base class of the MainWindow. class MainWindowInterface { public: - virtual void executeFilter(QAction *, RichParameterList &, bool = false) {} + virtual void executeFilter(const QAction *, RichParameterList &, bool = false) {} //parexpval is a string map containing the parameter expression values set in the filter's dialog. //These parameter expression values will be evaluated when the filter will start. }; diff --git a/src/meshlab/glarea.h b/src/meshlab/glarea.h index 1e91b714f..7b8c58a58 100644 --- a/src/meshlab/glarea.h +++ b/src/meshlab/glarea.h @@ -154,8 +154,8 @@ public: QSize minimumSizeHint() const; QSize sizeHint() const; - QAction *getLastAppliedFilter() {return lastFilterRef;} - void setLastAppliedFilter(QAction *qa) {lastFilterRef = qa;} + const QAction *getLastAppliedFilter() {return lastFilterRef;} + void setLastAppliedFilter(const QAction *qa) {lastFilterRef = qa;} ////RenderMode* getCurrentRenderMode(); //RenderMode* getCurrentRenderMode() @@ -449,7 +449,7 @@ private: //shader support RenderPluginInterface *iRenderer; QAction *currentShader; - QAction *lastFilterRef; // reference to last filter applied + const QAction *lastFilterRef; // reference to last filter applied QFont qFont; //font settings // Editing support diff --git a/src/meshlab/mainwindow.h b/src/meshlab/mainwindow.h index 9992d31e7..da884959e 100644 --- a/src/meshlab/mainwindow.h +++ b/src/meshlab/mainwindow.h @@ -93,7 +93,7 @@ class MainWindow : public QMainWindow, public MainWindowInterface public: // callback function to execute a filter - void executeFilter(QAction *action, RichParameterList &srcpar, bool isPreview = false); + void executeFilter(const QAction *action, RichParameterList &srcpar, bool isPreview = false); MainWindow(); ~MainWindow(); @@ -178,7 +178,6 @@ private slots: void suspendEditMode(); ///////////Slot Menu Filter //////////////////////// void startFilter(); - void applyLastFilter(); void runFilterScript(); void showFilterScript(); void showTooltip(QAction*); diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index f13c13acf..45479f4c7 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -757,12 +757,6 @@ void MainWindow::endEdit() updateLayerDialog(); } -void MainWindow::applyLastFilter() -{ - if(GLA()==nullptr) return; - GLA()->getLastAppliedFilter()->activate(QAction::Trigger); -} - void MainWindow::showFilterScript() { if (meshDoc()->filterHistory != nullptr) @@ -1142,7 +1136,7 @@ from the user defined dialog */ -void MainWindow::executeFilter(QAction *action, RichParameterList ¶ms, bool isPreview) +void MainWindow::executeFilter(const QAction* action, RichParameterList ¶ms, bool isPreview) { FilterPluginInterface *iFilter = qobject_cast(action->parent()); qb->show(); From 3f24714657705144a7844c37648e17bc71bb46db Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Mon, 21 Sep 2020 18:34:29 +0200 Subject: [PATCH 44/49] initGlobalParameterList is a member of decoratePluginInterface. Moved unify stl vertices parameter to initPreOpenParameter --- .../interfaces/decorate_plugin_interface.cpp | 30 +++++++++++++++++++ .../interfaces/decorate_plugin_interface.h | 2 ++ src/common/interfaces/plugin_interface.cpp | 29 ------------------ src/common/interfaces/plugin_interface.h | 3 -- src/common/pluginmanager.cpp | 4 +-- src/meshlab/glarea.cpp | 4 +-- src/meshlab/glarea.h | 2 +- src/meshlab/glarea_setting.cpp | 2 +- src/meshlab/glarea_setting.h | 2 +- src/meshlab/layerDialog.cpp | 2 +- src/meshlab/mainwindow.h | 8 ++--- src/meshlab/mainwindow_Init.cpp | 30 +++++++++---------- src/meshlab/mainwindow_RunTime.cpp | 4 +-- .../decorate_background.cpp | 2 +- .../decorate_background/decorate_background.h | 2 +- .../decorate_base/decorate_base.cpp | 2 +- .../decorate_base/decorate_base.h | 2 +- .../decorate_raster_proj.cpp | 2 +- .../decorate_raster_proj.h | 2 +- .../decorate_shadow/decorate_shadow.cpp | 2 +- .../decorate_shadow/decorate_shadow.h | 2 +- src/meshlabplugins/io_base/baseio.cpp | 11 +++---- src/meshlabplugins/io_base/baseio.h | 1 - 23 files changed, 72 insertions(+), 78 deletions(-) diff --git a/src/common/interfaces/decorate_plugin_interface.cpp b/src/common/interfaces/decorate_plugin_interface.cpp index 51d503814..e1ee43488 100644 --- a/src/common/interfaces/decorate_plugin_interface.cpp +++ b/src/common/interfaces/decorate_plugin_interface.cpp @@ -1,5 +1,35 @@ #include "decorate_plugin_interface.h" +/** \brief + * This function is called by the framework, for each plugin that has global parameters (e.g. \ref MeshDecorateInterface) at the start of the application. + * The rationale is to allow to each plugin to have a list of global persistent parameters that can be changed from the meshlab itself and whose value is persistent between different meshlab invocations. + * A typical example is the background color. + * + * For the global parameters the following rules apply: + * + * \li there is a hardwired default value: a safe consistent value that is directly coded into the plugin and to which the user can always revert if needed. + * \li there is a saved value: a value that is stored into a persistent location into the user space (registry/home/library) and it is presented as default value of the parameter at each MeshLab invocation. + * \li there is a current value: a value that is currently used, different for each document instance and that is not stored permanently. + * + * The plugin use the current value to draw its decoration. + * at startup the current value is always silently initialized to the saved value. + * User can revert current value to the saved values and to the hardwired values. + * In the dialog for each parameter some buttons should be present: + + * \li apply: use the currently edited parameter value without saving it anywhere. After the closure of the document these values will be lost. + * \li load: load from the saved values + * \li save: save to a permanent location the current value (to the registry), + * \li reset: revert to the hardwired values + + * If your plugins/action has no GlobalParameter, do nothing. + * The RichParameterList comes to the StartDecorate already initialized with the values stored on the permanent storage. + * At the start up the initGlobalParameterList function is called with an empty RichParameterList (to collect the default values) + * If a filter wants to save some permanent stuff should set the permanent default values. + */ +void DecoratePluginInterface::initGlobalParameterList(QAction* /*format*/, RichParameterList& /*globalparam*/) +{ +} + QAction* DecoratePluginInterface::action(QString name) const { QString n = name; diff --git a/src/common/interfaces/decorate_plugin_interface.h b/src/common/interfaces/decorate_plugin_interface.h index 8993c2e59..901e49102 100644 --- a/src/common/interfaces/decorate_plugin_interface.h +++ b/src/common/interfaces/decorate_plugin_interface.h @@ -80,6 +80,8 @@ public: virtual QString decorationName(const QAction *a) const { return decorationName(ID(a)); } virtual QString decorationInfo(const QAction *a) const { return decorationInfo(ID(a)); } + // See source file for documentation + virtual void initGlobalParameterList(QAction* format, RichParameterList& globalparam); virtual bool startDecorate(const QAction *, MeshDocument &, const RichParameterList *, GLArea *) { return false; } virtual bool startDecorate(const QAction *, MeshModel &, const RichParameterList *, GLArea *) { return false; } diff --git a/src/common/interfaces/plugin_interface.cpp b/src/common/interfaces/plugin_interface.cpp index 3e5213197..7161c8049 100644 --- a/src/common/interfaces/plugin_interface.cpp +++ b/src/common/interfaces/plugin_interface.cpp @@ -5,35 +5,6 @@ PluginInterface::PluginInterface() : { } -/** \brief This function is called by the framework, for each plugin that has global parameters (e.g. \ref MeshDecorateInterface) at the start of the application. - *The rationale is to allow to each plugin to have a list of global persistent parameters that can be changed from the meshlab itself and whose value is persistent between different meshlab invocations. - * A typical example is the background color. - * - * For the global parameters the following rules apply: - * - * \li there is a hardwired default value: a safe consistent value that is directly coded into the plugin and to which the user can always revert if needed. - * \li there is a saved value: a value that is stored into a persistent location into the user space (registry/home/library) and it is presented as default value of the parameter at each MeshLab invocation. - * \li there is a current value: a value that is currently used, different for each document instance and that is not stored permanently. - * - * The plugin use the current value to draw its decoration. - * at startup the current value is always silently initialized to the saved value. - * User can revert current value to the saved values and to the hardwired values. - * In the dialog for each parameter some buttons should be present: - - * \li apply: use the currently edited parameter value without saving it anywhere. After the closure of the document these values will be lost. - * \li load: load from the saved values - * \li save: save to a permanent location the current value (to the registry), - * \li reset: revert to the hardwired values - - * If your plugins/action has no GlobalParameter, do nothing. - * The RichParameterSet comes to the StartDecorate already initialized with the values stored on the permanent storage. - * At the start up the initGlobalParameterSet function is called with an empty RichParameterSet (to collect the default values) - * If a filter wants to save some permanent stuff should set the permanent default values. - */ -void PluginInterface::initGlobalParameterSet(QAction* /*format*/, RichParameterList& /*globalparam*/) -{ -} - void PluginInterface::setLog(GLLogStream* log) { this->logstream = log; diff --git a/src/common/interfaces/plugin_interface.h b/src/common/interfaces/plugin_interface.h index f7e52cb66..4759d5722 100644 --- a/src/common/interfaces/plugin_interface.h +++ b/src/common/interfaces/plugin_interface.h @@ -60,9 +60,6 @@ public: */ virtual QString pluginName() const = 0; - // See source file for documentation - virtual void initGlobalParameterSet(QAction* /*format*/, RichParameterList& /*globalparam*/); - /// Standard stuff that usually should not be redefined. void setLog(GLLogStream* log); diff --git a/src/common/pluginmanager.cpp b/src/common/pluginmanager.cpp index 5a1ccfaa8..477e47256 100644 --- a/src/common/pluginmanager.cpp +++ b/src/common/pluginmanager.cpp @@ -98,7 +98,6 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl filterAction->setData(QVariant(fileName)); actionFilterMap.insert(filterAction->text(), filterAction); stringFilterMap.insert(filterAction->text(), iFilter); - iFilter->initGlobalParameterSet(filterAction, defaultGlobal); if(iFilter->getClass(filterAction)==FilterPluginInterface::Generic) throw MLException("Missing class for " +fileName+filterAction->text()); if(iFilter->getRequirements(filterAction) == int(MeshModel::MM_UNKNOWN)) @@ -116,7 +115,6 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl { iCommon = iIO; meshIOPlug.push_back(iIO); - iIO->initGlobalParameterSet(NULL, defaultGlobal); } DecoratePluginInterface *iDecorator = qobject_cast(plugin); @@ -127,7 +125,7 @@ void PluginManager::loadPlugins(RichParameterList& defaultGlobal, const QDir& pl foreach(QAction *decoratorAction, iDecorator->actions()) { decoratorActionList.push_back(decoratorAction); - iDecorator->initGlobalParameterSet(decoratorAction, defaultGlobal); + iDecorator->initGlobalParameterList(decoratorAction, defaultGlobal); } } diff --git a/src/meshlab/glarea.cpp b/src/meshlab/glarea.cpp index 99c389d64..ac92637a7 100644 --- a/src/meshlab/glarea.cpp +++ b/src/meshlab/glarea.cpp @@ -1761,9 +1761,9 @@ void GLArea::updateCustomSettingValues( const RichParameterList& rps ) this->update(); } -void GLArea::initGlobalParameterSet( RichParameterList * defaultGlobalParamSet) +void GLArea::initGlobalParameterList( RichParameterList * defaultGlobalParamList) { - GLAreaSetting::initGlobalParameterSet(defaultGlobalParamSet); + GLAreaSetting::initGlobalParameterList(defaultGlobalParamList); } //Don't alter the state of the other elements in the visibility map diff --git a/src/meshlab/glarea.h b/src/meshlab/glarea.h index 7b8c58a58..3da1ddca5 100644 --- a/src/meshlab/glarea.h +++ b/src/meshlab/glarea.h @@ -62,7 +62,7 @@ class GLArea : public QGLWidget public: GLArea(QWidget *parent,MultiViewer_Container *mvcont, RichParameterList *current); ~GLArea(); - static void initGlobalParameterSet( RichParameterList * /*globalparam*/); + static void initGlobalParameterList( RichParameterList * /*globalparam*/); private: int id; //the very important unique id of each subwindow. diff --git a/src/meshlab/glarea_setting.cpp b/src/meshlab/glarea_setting.cpp index b10589df7..bf318d008 100644 --- a/src/meshlab/glarea_setting.cpp +++ b/src/meshlab/glarea_setting.cpp @@ -1,6 +1,6 @@ #include "glarea_setting.h" -void GLAreaSetting::initGlobalParameterSet( RichParameterList * defaultGlobalParamSet) +void GLAreaSetting::initGlobalParameterList( RichParameterList * defaultGlobalParamSet) { defaultGlobalParamSet->addParam(RichColor(backgroundBotColorParam(),QColor(128,128,255),"MeshLab Bottom BackGround Color","MeshLab GLarea's BackGround Color(bottom corner)")); defaultGlobalParamSet->addParam(RichColor(backgroundTopColorParam(),QColor( 0, 0, 0),"MeshLab Top BackGround Color","MeshLab GLarea's BackGround Color(top corner)")); diff --git a/src/meshlab/glarea_setting.h b/src/meshlab/glarea_setting.h index b7fb508b6..e2436a2a2 100644 --- a/src/meshlab/glarea_setting.h +++ b/src/meshlab/glarea_setting.h @@ -71,7 +71,7 @@ public: void updateGlobalParameterSet(const RichParameterList& rps ); - static void initGlobalParameterSet( RichParameterList * defaultGlobalParamSet); + static void initGlobalParameterList( RichParameterList * defaultGlobalParamSet); const RichParameterList *currentGlobalParamSet; }; diff --git a/src/meshlab/layerDialog.cpp b/src/meshlab/layerDialog.cpp index c668e6d72..196fd6051 100644 --- a/src/meshlab/layerDialog.cpp +++ b/src/meshlab/layerDialog.cpp @@ -1225,7 +1225,7 @@ DecoratorParamsTreeWidget::DecoratorParamsTreeWidget(QAction* act,MainWindow *mw mw->GLA()->Log(GLLogStream::SYSTEM, "MeshLab System Error: A Decorator Plugin has been expected."); } else { - decPlug->initGlobalParameterSet(act,tmpSet); + decPlug->initGlobalParameterList(act,tmpSet); if (tmpSet.size() != 0) { const RichParameterList& currSet = mw->currentGlobalPars(); RichParameterList defSet = tmpSet; diff --git a/src/meshlab/mainwindow.h b/src/meshlab/mainwindow.h index da884959e..7456e4e88 100644 --- a/src/meshlab/mainwindow.h +++ b/src/meshlab/mainwindow.h @@ -65,8 +65,8 @@ class QToolBar; class MainWindowSetting { public: - static void initGlobalParameterSet(RichParameterList* gblset); - void updateGlobalParameterSet(const RichParameterList& rps ); + static void initGlobalParameterList(RichParameterList* gbllist); + void updateGlobalParameterList(const RichParameterList& rpl ); std::ptrdiff_t maxgpumem; inline static QString maximumDedicatedGPUMem() {return "MeshLab::System::maxGPUMemDedicatedToGeometry";} @@ -284,14 +284,14 @@ private: Note this part should be detached from MainWindow just like the loading plugin part. For each running instance of meshlab, for the global params we have default (hardwired) values and current(saved,modified) values. - At the start up the initGlobalParameterSet function (of decorations and of glarea and of ... ) is called with the empty RichParameterSet defaultGlobalParams (to collect the default values) + At the start up the initGlobalParameterList function (of decorations and of glarea and of ... ) is called with the empty RichParameterSet defaultGlobalParams (to collect the default values) At the start up the currentGlobalParams is filled with the values saved in the registry. */ RichParameterList currentGlobalParams; RichParameterList defaultGlobalParams; - QByteArray toolbarState; //stato delle toolbar e dockwidgets + QByteArray toolbarState; //toolbar and dockwidgets state QDir lastUsedDirectory; //This will hold the last directory that was used to load/save a file/project in diff --git a/src/meshlab/mainwindow_Init.cpp b/src/meshlab/mainwindow_Init.cpp index e720e626a..ed0326e0b 100644 --- a/src/meshlab/mainwindow_Init.cpp +++ b/src/meshlab/mainwindow_Init.cpp @@ -91,7 +91,7 @@ MainWindow::MainWindow() } // Now load from the registry the settings and merge the hardwired values got from the PM.loadPlugins with the ones found in the registry. loadMeshLabSettings(); - mwsettings.updateGlobalParameterSet(currentGlobalParams); + mwsettings.updateGlobalParameterList(currentGlobalParams); createActions(); createToolBars(); createMenus(); @@ -860,8 +860,8 @@ void MainWindow::loadMeshLabSettings() // I have already loaded the plugins so the default parameters for the settings // of the plugins are already in the . // we just miss the globals default of meshlab itself - MainWindowSetting::initGlobalParameterSet(&defaultGlobalParams); - GLArea::initGlobalParameterSet(&defaultGlobalParams); + MainWindowSetting::initGlobalParameterList(&defaultGlobalParams); + GLArea::initGlobalParameterList(&defaultGlobalParams); QSettings settings; QStringList klist = settings.allKeys(); @@ -1179,28 +1179,28 @@ int MainWindow::longestActionWidthInAllMenus() return longest; } -void MainWindowSetting::initGlobalParameterSet(RichParameterList* glbset) +void MainWindowSetting::initGlobalParameterList(RichParameterList* gbllist) { - glbset->addParam(RichInt(maximumDedicatedGPUMem(), 350, "Maximum GPU Memory Dedicated to MeshLab (Mb)", "Maximum GPU Memory Dedicated to MeshLab (megabyte) for the storing of the geometry attributes. The dedicated memory must NOT be all the GPU memory presents on the videocard.")); - glbset->addParam(RichInt(perBatchPrimitives(), 100000, "Per batch primitives loaded in GPU", "Per batch primitives (vertices and faces) loaded in the GPU memory. It's used in order to do not overwhelm the system memory with an entire temporary copy of a mesh.")); - glbset->addParam(RichInt(minPolygonNumberPerSmoothRendering(), 50000, "Default Face number per smooth rendering", "Minimum number of faces in order to automatically render a newly created mesh layer with the per vertex normal attribute activated.")); + gbllist->addParam(RichInt(maximumDedicatedGPUMem(), 350, "Maximum GPU Memory Dedicated to MeshLab (Mb)", "Maximum GPU Memory Dedicated to MeshLab (megabyte) for the storing of the geometry attributes. The dedicated memory must NOT be all the GPU memory presents on the videocard.")); + gbllist->addParam(RichInt(perBatchPrimitives(), 100000, "Per batch primitives loaded in GPU", "Per batch primitives (vertices and faces) loaded in the GPU memory. It's used in order to do not overwhelm the system memory with an entire temporary copy of a mesh.")); + gbllist->addParam(RichInt(minPolygonNumberPerSmoothRendering(), 50000, "Default Face number per smooth rendering", "Minimum number of faces in order to automatically render a newly created mesh layer with the per vertex normal attribute activated.")); // glbset->addParam(RichBool(perMeshRenderingToolBar(), true, "Show Per-Mesh Rendering Side ToolBar", "If true the per-mesh rendering side toolbar will be redendered inside the layerdialog.")); if (MeshLabScalarTest::doublePrecision()) - glbset->addParam(RichBool(highPrecisionRendering(), false, "High Precision Rendering", "If true all the models in the scene will be rendered at the center of the world")); - glbset->addParam(RichInt(maxTextureMemoryParam(), 256, "Max Texture Memory (in MB)", "The maximum quantity of texture memory allowed to load mesh textures")); + gbllist->addParam(RichBool(highPrecisionRendering(), false, "High Precision Rendering", "If true all the models in the scene will be rendered at the center of the world")); + gbllist->addParam(RichInt(maxTextureMemoryParam(), 256, "Max Texture Memory (in MB)", "The maximum quantity of texture memory allowed to load mesh textures")); } -void MainWindowSetting::updateGlobalParameterSet(const RichParameterList& rps) +void MainWindowSetting::updateGlobalParameterList(const RichParameterList& rpl) { - maxgpumem = (std::ptrdiff_t)rps.getInt(maximumDedicatedGPUMem()) * (float)(1024 * 1024); - perbatchprimitives = (size_t)rps.getInt(perBatchPrimitives()); - minpolygonpersmoothrendering = (size_t)rps.getInt(minPolygonNumberPerSmoothRendering()); + maxgpumem = (std::ptrdiff_t)rpl.getInt(maximumDedicatedGPUMem()) * (float)(1024 * 1024); + perbatchprimitives = (size_t)rpl.getInt(perBatchPrimitives()); + minpolygonpersmoothrendering = (size_t)rpl.getInt(minPolygonNumberPerSmoothRendering()); highprecision = false; if (MeshLabScalarTest::doublePrecision()) - highprecision = rps.getBool(highPrecisionRendering()); - maxTextureMemory = (std::ptrdiff_t) rps.getInt(this->maxTextureMemoryParam()) * (float)(1024 * 1024); + highprecision = rpl.getBool(highPrecisionRendering()); + maxTextureMemory = (std::ptrdiff_t) rpl.getInt(this->maxTextureMemoryParam()) * (float)(1024 * 1024); } void MainWindow::defaultPerViewRenderingData(MLRenderingData& dt) const diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index 45479f4c7..2cd1c065e 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -140,7 +140,7 @@ void MainWindow::updateStdDialog() void MainWindow::updateCustomSettings() { - mwsettings.updateGlobalParameterSet(currentGlobalParams); + mwsettings.updateGlobalParameterList(currentGlobalParams); emit dispatchCustomSettings(currentGlobalParams); } @@ -753,7 +753,7 @@ void MainWindow::endEdit() } meshDoc()->meshDocStateData().clear(); - GLA()->endEdit(); + GLA()->endEdit(); updateLayerDialog(); } diff --git a/src/meshlabplugins/decorate_background/decorate_background.cpp b/src/meshlabplugins/decorate_background/decorate_background.cpp index 2fff6852a..f8125af94 100644 --- a/src/meshlabplugins/decorate_background/decorate_background.cpp +++ b/src/meshlabplugins/decorate_background/decorate_background.cpp @@ -61,7 +61,7 @@ QString DecorateBackgroundPlugin::pluginName() const return "DecorateBackGround"; } -void DecorateBackgroundPlugin::initGlobalParameterSet(QAction *action, RichParameterList &parset) +void DecorateBackgroundPlugin::initGlobalParameterList(QAction *action, RichParameterList &parset) { switch(ID(action)) { diff --git a/src/meshlabplugins/decorate_background/decorate_background.h b/src/meshlabplugins/decorate_background/decorate_background.h index 510ec6764..e31cb46e4 100644 --- a/src/meshlabplugins/decorate_background/decorate_background.h +++ b/src/meshlabplugins/decorate_background/decorate_background.h @@ -88,7 +88,7 @@ DecorateBackgroundPlugin() bool startDecorate(const QAction* /*mode*/, MeshDocument &/*m*/, const RichParameterList * /*parent*/ par, GLArea * /*parent*/); void decorateDoc(const QAction *a, MeshDocument &md, const RichParameterList *, GLArea *gla, QPainter *, GLLogStream &_log); void decorateMesh(const QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &){} - void initGlobalParameterSet(QAction *, RichParameterList &/*globalparam*/); + void initGlobalParameterList(QAction *, RichParameterList &/*globalparam*/); int getDecorationClass(const QAction * /*action*/) const { return DecoratePluginInterface::PerDocument; } diff --git a/src/meshlabplugins/decorate_base/decorate_base.cpp b/src/meshlabplugins/decorate_base/decorate_base.cpp index a89a1b263..375c91267 100644 --- a/src/meshlabplugins/decorate_base/decorate_base.cpp +++ b/src/meshlabplugins/decorate_base/decorate_base.cpp @@ -1076,7 +1076,7 @@ void DecorateBasePlugin::DrawTexParam(MeshModel &m, GLArea *gla, QPainter *paint glMatrixMode(GL_MODELVIEW); } -void DecorateBasePlugin::initGlobalParameterSet(QAction *action, RichParameterList &parset) +void DecorateBasePlugin::initGlobalParameterList(QAction *action, RichParameterList &parset) { switch(ID(action)) diff --git a/src/meshlabplugins/decorate_base/decorate_base.h b/src/meshlabplugins/decorate_base/decorate_base.h index 072e39339..0ee20caf1 100644 --- a/src/meshlabplugins/decorate_base/decorate_base.h +++ b/src/meshlabplugins/decorate_base/decorate_base.h @@ -120,7 +120,7 @@ public: bool startDecorate(const QAction * /*mode*/, MeshDocument &/*m*/, const RichParameterList *, GLArea * /*parent*/); bool isDecorationApplicable(const QAction *action, const MeshModel& m, QString &ErrorMessage) const; int getDecorationClass(const QAction* /*action*/) const; - void initGlobalParameterSet(QAction *, RichParameterList &/*globalparam*/); + void initGlobalParameterList(QAction *, RichParameterList &/*globalparam*/); inline QString CameraScaleParam() const { return "MeshLab::Decoration::CameraRenderScaleType" ; } inline QString FixedScaleParam() const { return "MeshLab::Decoration::CameraFixedScaleParam" ; } diff --git a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp index 35eee671a..d06b9503d 100644 --- a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp +++ b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp @@ -199,7 +199,7 @@ int DecorateRasterProjPlugin::getDecorationClass(const QAction *act ) const } -void DecorateRasterProjPlugin::initGlobalParameterSet( QAction *act, RichParameterList &par ) +void DecorateRasterProjPlugin::initGlobalParameterList( QAction *act, RichParameterList &par ) { switch( ID(act) ) { diff --git a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h index 236da8fb8..b93c28cae 100644 --- a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h +++ b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h @@ -118,7 +118,7 @@ public: void decorateMesh(const QAction * , MeshModel & , const RichParameterList * , GLArea * , QPainter * , GLLogStream & ) {} void decorateDoc(const QAction *act, MeshDocument &m, const RichParameterList* par, GLArea *gla, QPainter *p, GLLogStream & ); void endDecorate(const QAction* act, MeshDocument &m, const RichParameterList *par, GLArea *gla ); - void initGlobalParameterSet( QAction *act, RichParameterList &par ); + void initGlobalParameterList( QAction *act, RichParameterList &par ); int getDecorationClass(const QAction* act ) const; }; diff --git a/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp b/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp index d091001fa..a87ed4ace 100644 --- a/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp +++ b/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp @@ -48,7 +48,7 @@ QString DecorateShadowPlugin::pluginName() const return "DecorateShadow"; } -void DecorateShadowPlugin::initGlobalParameterSet(QAction *action, RichParameterList &parset) +void DecorateShadowPlugin::initGlobalParameterList(QAction *action, RichParameterList &parset) { switch (ID(action)) { case DP_SHOW_SHADOW: { diff --git a/src/meshlabplugins/decorate_shadow/decorate_shadow.h b/src/meshlabplugins/decorate_shadow/decorate_shadow.h index 0aa596858..a27563793 100644 --- a/src/meshlabplugins/decorate_shadow/decorate_shadow.h +++ b/src/meshlabplugins/decorate_shadow/decorate_shadow.h @@ -92,7 +92,7 @@ public: void decorateMesh(const QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &){} void decorateDoc(const QAction *a, MeshDocument &m, const RichParameterList*, GLArea *gla, QPainter *p, GLLogStream &); void endDecorate(const QAction *, MeshDocument &, const RichParameterList *, GLArea *); - void initGlobalParameterSet(QAction *, RichParameterList & globalparam); + void initGlobalParameterList(QAction *, RichParameterList & globalparam); int getDecorationClass(const QAction * /*action*/) const { return DecoratePluginInterface::PerDocument; } private: diff --git a/src/meshlabplugins/io_base/baseio.cpp b/src/meshlabplugins/io_base/baseio.cpp index 72878d5d5..c70a011cd 100644 --- a/src/meshlabplugins/io_base/baseio.cpp +++ b/src/meshlabplugins/io_base/baseio.cpp @@ -70,8 +70,7 @@ class PMesh : public tri::TriMesh< vector, vector, vector // initialize importing parameters void BaseMeshIOPlugin::initPreOpenParameter(const QString &formatName, const QString &/*filename*/, RichParameterList &parlst) { - if (formatName.toUpper() == tr("PTX")) - { + if (formatName.toUpper() == tr("PTX")) { parlst.addParam(RichInt("meshindex", 0, "Index of Range Map to be Imported", "PTX files may contain more than one range map. 0 is the first range map. If the number if higher than the actual mesh number, the import will fail")); parlst.addParam(RichBool("pointsonly", true, "Keep only points", "Import points a point cloud only, with radius and normals, no triangulation involved, isolated points and points with normals with steep angles are removed.")); @@ -81,6 +80,9 @@ void BaseMeshIOPlugin::initPreOpenParameter(const QString &formatName, const QSt parlst.addParam(RichBool("anglecull", true, "Cull faces by angle", "short")); parlst.addParam(RichFloat("angle", 85.0, "Angle limit for face culling", "short")); } + if (formatName.toUpper() == tr("STL")) { + parlst.addParam(RichBool(stlUnifyParName(), true, "Unify Duplicated Vertices in STL files", "The STL format is not an vertex-indexed format. Each triangle is composed by independent vertices, so, usually, duplicated vertices should be unified")); + } } bool BaseMeshIOPlugin::open(const QString &formatName, const QString &fileName, MeshModel &m, int& mask, const RichParameterList &parlst, CallBackPos *cb, QWidget * /*parent*/) @@ -536,11 +538,6 @@ void BaseMeshIOPlugin::initSaveParameter(const QString &format, MeshModel &m, Ri } } -void BaseMeshIOPlugin::initGlobalParameterSet(QAction * /*format*/, RichParameterList & globalparam) -{ - globalparam.addParam(RichBool(stlUnifyParName(), true, "Unify Duplicated Vertices in STL files", "The STL format is not an vertex-indexed format. Each triangle is composed by independent vertices, so, usually, duplicated vertices should be unified")); -} - //void BaseMeshIOPlugin::applyOpenParameter(const QString &format, MeshModel &m, const RichParameterSet &par) //{ // if(format.toUpper() == tr("STL")) diff --git a/src/meshlabplugins/io_base/baseio.h b/src/meshlabplugins/io_base/baseio.h index ed284a0a6..1238e624b 100644 --- a/src/meshlabplugins/io_base/baseio.h +++ b/src/meshlabplugins/io_base/baseio.h @@ -50,7 +50,6 @@ public: void initPreOpenParameter(const QString &formatName, const QString &filename, RichParameterList &parlst); void initSaveParameter(const QString &format, MeshModel &/*m*/, RichParameterList & par); - void initGlobalParameterSet(QAction * /*format*/, RichParameterList & /*globalparam*/); private: static QString stlUnifyParName() { return QString("MeshLab::IO::STL::UnifyVertices"); } }; From 7d1337e9a74250b6c2b8afb8821c98a5304de83a Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Mon, 21 Sep 2020 18:38:23 +0200 Subject: [PATCH 45/49] const correctness initGlobalParameterList on decorator plugins --- src/common/interfaces/decorate_plugin_interface.cpp | 2 +- src/common/interfaces/decorate_plugin_interface.h | 2 +- src/meshlabplugins/decorate_background/decorate_background.cpp | 2 +- src/meshlabplugins/decorate_background/decorate_background.h | 2 +- src/meshlabplugins/decorate_base/decorate_base.cpp | 2 +- src/meshlabplugins/decorate_base/decorate_base.h | 2 +- .../decorate_raster_proj/decorate_raster_proj.cpp | 2 +- src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h | 2 +- src/meshlabplugins/decorate_shadow/decorate_shadow.cpp | 2 +- src/meshlabplugins/decorate_shadow/decorate_shadow.h | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/interfaces/decorate_plugin_interface.cpp b/src/common/interfaces/decorate_plugin_interface.cpp index e1ee43488..69b07a0a4 100644 --- a/src/common/interfaces/decorate_plugin_interface.cpp +++ b/src/common/interfaces/decorate_plugin_interface.cpp @@ -26,7 +26,7 @@ * At the start up the initGlobalParameterList function is called with an empty RichParameterList (to collect the default values) * If a filter wants to save some permanent stuff should set the permanent default values. */ -void DecoratePluginInterface::initGlobalParameterList(QAction* /*format*/, RichParameterList& /*globalparam*/) +void DecoratePluginInterface::initGlobalParameterList(const QAction* /*format*/, RichParameterList& /*globalparam*/) { } diff --git a/src/common/interfaces/decorate_plugin_interface.h b/src/common/interfaces/decorate_plugin_interface.h index 901e49102..bc99ac34a 100644 --- a/src/common/interfaces/decorate_plugin_interface.h +++ b/src/common/interfaces/decorate_plugin_interface.h @@ -81,7 +81,7 @@ public: virtual QString decorationInfo(const QAction *a) const { return decorationInfo(ID(a)); } // See source file for documentation - virtual void initGlobalParameterList(QAction* format, RichParameterList& globalparam); + virtual void initGlobalParameterList(const QAction* format, RichParameterList& globalparam); virtual bool startDecorate(const QAction *, MeshDocument &, const RichParameterList *, GLArea *) { return false; } virtual bool startDecorate(const QAction *, MeshModel &, const RichParameterList *, GLArea *) { return false; } diff --git a/src/meshlabplugins/decorate_background/decorate_background.cpp b/src/meshlabplugins/decorate_background/decorate_background.cpp index f8125af94..57c4bef65 100644 --- a/src/meshlabplugins/decorate_background/decorate_background.cpp +++ b/src/meshlabplugins/decorate_background/decorate_background.cpp @@ -61,7 +61,7 @@ QString DecorateBackgroundPlugin::pluginName() const return "DecorateBackGround"; } -void DecorateBackgroundPlugin::initGlobalParameterList(QAction *action, RichParameterList &parset) +void DecorateBackgroundPlugin::initGlobalParameterList(const QAction* action, RichParameterList &parset) { switch(ID(action)) { diff --git a/src/meshlabplugins/decorate_background/decorate_background.h b/src/meshlabplugins/decorate_background/decorate_background.h index e31cb46e4..182624ebf 100644 --- a/src/meshlabplugins/decorate_background/decorate_background.h +++ b/src/meshlabplugins/decorate_background/decorate_background.h @@ -88,7 +88,7 @@ DecorateBackgroundPlugin() bool startDecorate(const QAction* /*mode*/, MeshDocument &/*m*/, const RichParameterList * /*parent*/ par, GLArea * /*parent*/); void decorateDoc(const QAction *a, MeshDocument &md, const RichParameterList *, GLArea *gla, QPainter *, GLLogStream &_log); void decorateMesh(const QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &){} - void initGlobalParameterList(QAction *, RichParameterList &/*globalparam*/); + void initGlobalParameterList(const QAction *, RichParameterList &/*globalparam*/); int getDecorationClass(const QAction * /*action*/) const { return DecoratePluginInterface::PerDocument; } diff --git a/src/meshlabplugins/decorate_base/decorate_base.cpp b/src/meshlabplugins/decorate_base/decorate_base.cpp index 375c91267..7f4fe9da2 100644 --- a/src/meshlabplugins/decorate_base/decorate_base.cpp +++ b/src/meshlabplugins/decorate_base/decorate_base.cpp @@ -1076,7 +1076,7 @@ void DecorateBasePlugin::DrawTexParam(MeshModel &m, GLArea *gla, QPainter *paint glMatrixMode(GL_MODELVIEW); } -void DecorateBasePlugin::initGlobalParameterList(QAction *action, RichParameterList &parset) +void DecorateBasePlugin::initGlobalParameterList(const QAction* action, RichParameterList &parset) { switch(ID(action)) diff --git a/src/meshlabplugins/decorate_base/decorate_base.h b/src/meshlabplugins/decorate_base/decorate_base.h index 0ee20caf1..f307d7dba 100644 --- a/src/meshlabplugins/decorate_base/decorate_base.h +++ b/src/meshlabplugins/decorate_base/decorate_base.h @@ -120,7 +120,7 @@ public: bool startDecorate(const QAction * /*mode*/, MeshDocument &/*m*/, const RichParameterList *, GLArea * /*parent*/); bool isDecorationApplicable(const QAction *action, const MeshModel& m, QString &ErrorMessage) const; int getDecorationClass(const QAction* /*action*/) const; - void initGlobalParameterList(QAction *, RichParameterList &/*globalparam*/); + void initGlobalParameterList(const QAction *, RichParameterList &/*globalparam*/); inline QString CameraScaleParam() const { return "MeshLab::Decoration::CameraRenderScaleType" ; } inline QString FixedScaleParam() const { return "MeshLab::Decoration::CameraFixedScaleParam" ; } diff --git a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp index d06b9503d..9b7806fcf 100644 --- a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp +++ b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.cpp @@ -199,7 +199,7 @@ int DecorateRasterProjPlugin::getDecorationClass(const QAction *act ) const } -void DecorateRasterProjPlugin::initGlobalParameterList( QAction *act, RichParameterList &par ) +void DecorateRasterProjPlugin::initGlobalParameterList(const QAction* act, RichParameterList &par ) { switch( ID(act) ) { diff --git a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h index b93c28cae..2bd49c975 100644 --- a/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h +++ b/src/meshlabplugins/decorate_raster_proj/decorate_raster_proj.h @@ -118,7 +118,7 @@ public: void decorateMesh(const QAction * , MeshModel & , const RichParameterList * , GLArea * , QPainter * , GLLogStream & ) {} void decorateDoc(const QAction *act, MeshDocument &m, const RichParameterList* par, GLArea *gla, QPainter *p, GLLogStream & ); void endDecorate(const QAction* act, MeshDocument &m, const RichParameterList *par, GLArea *gla ); - void initGlobalParameterList( QAction *act, RichParameterList &par ); + void initGlobalParameterList(const QAction *act, RichParameterList &par ); int getDecorationClass(const QAction* act ) const; }; diff --git a/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp b/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp index a87ed4ace..70d40f97d 100644 --- a/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp +++ b/src/meshlabplugins/decorate_shadow/decorate_shadow.cpp @@ -48,7 +48,7 @@ QString DecorateShadowPlugin::pluginName() const return "DecorateShadow"; } -void DecorateShadowPlugin::initGlobalParameterList(QAction *action, RichParameterList &parset) +void DecorateShadowPlugin::initGlobalParameterList(const QAction* action, RichParameterList &parset) { switch (ID(action)) { case DP_SHOW_SHADOW: { diff --git a/src/meshlabplugins/decorate_shadow/decorate_shadow.h b/src/meshlabplugins/decorate_shadow/decorate_shadow.h index a27563793..3dcd4430d 100644 --- a/src/meshlabplugins/decorate_shadow/decorate_shadow.h +++ b/src/meshlabplugins/decorate_shadow/decorate_shadow.h @@ -92,7 +92,7 @@ public: void decorateMesh(const QAction *, MeshModel &, const RichParameterList *, GLArea *, QPainter *, GLLogStream &){} void decorateDoc(const QAction *a, MeshDocument &m, const RichParameterList*, GLArea *gla, QPainter *p, GLLogStream &); void endDecorate(const QAction *, MeshDocument &, const RichParameterList *, GLArea *); - void initGlobalParameterList(QAction *, RichParameterList & globalparam); + void initGlobalParameterList(const QAction *, RichParameterList & globalparam); int getDecorationClass(const QAction * /*action*/) const { return DecoratePluginInterface::PerDocument; } private: From 2f52fe2a100cd7c32044ec1998e440e02e65116d Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Tue, 22 Sep 2020 10:17:19 +0200 Subject: [PATCH 46/49] new version check allows to check also beta versions released on github --- src/meshlab/mainwindow_Init.cpp | 42 +- src/meshlab/mainwindow_RunTime.cpp | 4250 ++++++++++++++-------------- 2 files changed, 2161 insertions(+), 2131 deletions(-) diff --git a/src/meshlab/mainwindow_Init.cpp b/src/meshlab/mainwindow_Init.cpp index ed0326e0b..0296df1e0 100644 --- a/src/meshlab/mainwindow_Init.cpp +++ b/src/meshlab/mainwindow_Init.cpp @@ -1020,7 +1020,7 @@ void MainWindow::checkForUpdates(bool verboseFlag) UID = QUuid::createUuid().toString(); settings.setValue("UID", UID); } - QString BaseCommand("/~cignoni/meshlab_latest.php"); + QString baseCommand("/~cignoni/meshlab_latest.php"); #ifdef Q_OS_WIN QString OS = "Win"; @@ -1029,7 +1029,7 @@ void MainWindow::checkForUpdates(bool verboseFlag) #else QString OS = "Lin"; #endif - QString message = BaseCommand + QString("?code=%1&count=%2&scount=%3&totkv=%4&ver=%5&os=%6").arg(UID).arg(loadedMeshCounter).arg(savedMeshCounter).arg(totalKV).arg(MeshLabApplication::appVer()).arg(OS); + QString message = baseCommand + QString("?code=%1&count=%2&scount=%3&totkv=%4&ver=%5&os=%6").arg(UID).arg(loadedMeshCounter).arg(savedMeshCounter).arg(totalKV).arg(MeshLabApplication::appVer()).arg(OS); QNetworkAccessManager stats; QNetworkRequest statreq(MeshLabApplication::organizationHost() + message); @@ -1045,17 +1045,21 @@ void MainWindow::connectionDone(QNetworkReply *reply) QSettings::setDefaultFormat(QSettings::NativeFormat); bool dontRemindMeAboutUpgradeVal = false; + bool checkForMonthlyAndBetasVal = false; const QString dontRemindMeAboutUpgradeVar("dontRemindMeAboutUpgrade"); - const QString checkForMonthlyAndBetasVar("checkForMonthlyAndBetas"); // Check if the user specified not to be reminded to upgrade + if (settings.contains(dontRemindMeAboutUpgradeVar)) + dontRemindMeAboutUpgradeVal = settings.value(dontRemindMeAboutUpgradeVar).toBool(); if (!verboseCheckingFlag) { - if (settings.contains(dontRemindMeAboutUpgradeVar)) - dontRemindMeAboutUpgradeVal = settings.value(dontRemindMeAboutUpgradeVar).toBool(); if (dontRemindMeAboutUpgradeVal) return; } + + if (settings.contains(checkForMonthlyAndBetasVar)){ + checkForMonthlyAndBetasVal = settings.value(checkForMonthlyAndBetasVar).toBool();; + } QByteArray ddata = reply->readAll(); QString onlineVersion = QString::fromStdString(ddata.toStdString()); @@ -1073,6 +1077,12 @@ void MainWindow::connectionDone(QNetworkReply *reply) if (splitOnlineVersion[1].toInt() > splitThisVersion[1].toInt()) { newVersionAvailable = true; } + else if (splitOnlineVersion[1].toInt() == splitThisVersion[1].toInt() && splitOnlineVersion.size() > 2) { + //case of beta version or very important fixes + if (splitThisVersion.size() == 2 || (splitThisVersion.size() > 2 && splitOnlineVersion[2] > splitThisVersion[2])){ + newVersionAvailable = true; + } + } } // Set up a message box for the user @@ -1082,11 +1092,25 @@ void MainWindow::connectionDone(QNetworkReply *reply) QCheckBox dontShowCheckBox("Don't show this message again."); dontShowCheckBox.blockSignals(true); msgBox.addButton(&dontShowCheckBox, QMessageBox::ResetRole); + dontShowCheckBox.setChecked(dontRemindMeAboutUpgradeVal); QCheckBox checkMonthlysCheckBox("Check for Monthly and Beta versions."); checkMonthlysCheckBox.blockSignals(true); msgBox.addButton(&checkMonthlysCheckBox, QMessageBox::ResetRole); + checkMonthlysCheckBox.setChecked(checkForMonthlyAndBetasVal); if (newVersionAvailable){ + QString message = + "
    You are using an old version of MeshLab.

    " + "Please, upgrade to the new version!

    "; + if (checkForMonthlyAndBetasVal){ + message += + " Download
    "; + } + else { + message += + " Download"; + } + msgBox.setText( "
    You are using an old version of MeshLab.

    " "Please, upgrade to the new version!

    " @@ -1104,8 +1128,14 @@ void MainWindow::connectionDone(QNetworkReply *reply) settings.setValue(dontRemindMeAboutUpgradeVar, true); else if (userReply == QMessageBox::Ok && dontShowCheckBox.checkState() == Qt::Unchecked) settings.setValue(dontRemindMeAboutUpgradeVar, false); - if (userReply == QMessageBox::Ok && checkMonthlysCheckBox.checkState() == Qt::Checked) + if (userReply == QMessageBox::Ok && checkMonthlysCheckBox.checkState() == Qt::Checked) { settings.setValue(checkForMonthlyAndBetasVar, true); + if (!checkForMonthlyAndBetasVal) { + //the user changed the states: he now wants to check for betas + //need to check again with properly set + checkForUpdates(false); + } + } else if (userReply == QMessageBox::Ok && checkMonthlysCheckBox.checkState() == Qt::Unchecked) settings.setValue(checkForMonthlyAndBetasVar, false); } diff --git a/src/meshlab/mainwindow_RunTime.cpp b/src/meshlab/mainwindow_RunTime.cpp index 2cd1c065e..4df183ba2 100644 --- a/src/meshlab/mainwindow_RunTime.cpp +++ b/src/meshlab/mainwindow_RunTime.cpp @@ -66,61 +66,61 @@ using namespace vcg; void MainWindow::updateRecentFileActions() { - bool activeDoc = (bool) !mdiarea->subWindowList().empty() && mdiarea->currentSubWindow(); - - QSettings settings; - QStringList files = settings.value("recentFileList").toStringList(); - - int numRecentFiles = qMin(files.size(), (int)MAXRECENTFILES); - - for (int i = 0; i < numRecentFiles; ++i) - { - QString text = tr("&%1 %2").arg(i + 1).arg(QFileInfo(files[i]).fileName()); - recentFileActs[i]->setText(text); - recentFileActs[i]->setData(files[i]); - recentFileActs[i]->setEnabled(activeDoc); - } - for (int j = numRecentFiles; j < MAXRECENTFILES; ++j) - recentFileActs[j]->setVisible(false); + bool activeDoc = (bool) !mdiarea->subWindowList().empty() && mdiarea->currentSubWindow(); + + QSettings settings; + QStringList files = settings.value("recentFileList").toStringList(); + + int numRecentFiles = qMin(files.size(), (int)MAXRECENTFILES); + + for (int i = 0; i < numRecentFiles; ++i) + { + QString text = tr("&%1 %2").arg(i + 1).arg(QFileInfo(files[i]).fileName()); + recentFileActs[i]->setText(text); + recentFileActs[i]->setData(files[i]); + recentFileActs[i]->setEnabled(activeDoc); + } + for (int j = numRecentFiles; j < MAXRECENTFILES; ++j) + recentFileActs[j]->setVisible(false); } void MainWindow::updateRecentProjActions() { - //bool activeDoc = (bool) !mdiarea->subWindowList().empty() && mdiarea->currentSubWindow(); - - QSettings settings; - QStringList projs = settings.value("recentProjList").toStringList(); - - int numRecentProjs = qMin(projs.size(), (int)MAXRECENTFILES); - for (int i = 0; i < numRecentProjs; ++i) - { - QString text = tr("&%1 %2").arg(i + 1).arg(QFileInfo(projs[i]).fileName()); - recentProjActs[i]->setText(text); - recentProjActs[i]->setData(projs[i]); - recentProjActs[i]->setEnabled(true); - } - for (int j = numRecentProjs; j < MAXRECENTFILES; ++j) - recentProjActs[j]->setVisible(false); + //bool activeDoc = (bool) !mdiarea->subWindowList().empty() && mdiarea->currentSubWindow(); + + QSettings settings; + QStringList projs = settings.value("recentProjList").toStringList(); + + int numRecentProjs = qMin(projs.size(), (int)MAXRECENTFILES); + for (int i = 0; i < numRecentProjs; ++i) + { + QString text = tr("&%1 %2").arg(i + 1).arg(QFileInfo(projs[i]).fileName()); + recentProjActs[i]->setText(text); + recentProjActs[i]->setData(projs[i]); + recentProjActs[i]->setEnabled(true); + } + for (int j = numRecentProjs; j < MAXRECENTFILES; ++j) + recentProjActs[j]->setVisible(false); } // creates the standard plugin window void MainWindow::createStdPluginWnd() { - //checks if a MeshlabStdDialog is already open and closes it - if (stddialog!=0) - { - stddialog->close(); - delete stddialog; - } - stddialog = new MeshlabStdDialog(this); - stddialog->setAllowedAreas ( Qt::NoDockWidgetArea); - //addDockWidget(Qt::RightDockWidgetArea,stddialog); - - //stddialog->setAttribute(Qt::WA_DeleteOnClose,true); - stddialog->setFloating(true); - stddialog->hide(); - connect(GLA(),SIGNAL(glareaClosed()),this,SLOT(updateStdDialog())); - connect(GLA(),SIGNAL(glareaClosed()),stddialog,SLOT(closeClick())); + //checks if a MeshlabStdDialog is already open and closes it + if (stddialog!=0) + { + stddialog->close(); + delete stddialog; + } + stddialog = new MeshlabStdDialog(this); + stddialog->setAllowedAreas ( Qt::NoDockWidgetArea); + //addDockWidget(Qt::RightDockWidgetArea,stddialog); + + //stddialog->setAttribute(Qt::WA_DeleteOnClose,true); + stddialog->setFloating(true); + stddialog->hide(); + connect(GLA(),SIGNAL(glareaClosed()),this,SLOT(updateStdDialog())); + connect(GLA(),SIGNAL(glareaClosed()),stddialog,SLOT(closeClick())); } // When we switch the current model (and we change the active window) @@ -128,125 +128,125 @@ void MainWindow::createStdPluginWnd() // this one is called when user switch current window. void MainWindow::updateStdDialog() { - if(stddialog!=0){ - if(GLA()!=0){ - if(stddialog->curModel != meshDoc()->mm()){ - stddialog->curgla=0; // invalidate the curgla member that is no more valid. - stddialog->close(); - } - } - } + if(stddialog!=0){ + if(GLA()!=0){ + if(stddialog->curModel != meshDoc()->mm()){ + stddialog->curgla=0; // invalidate the curgla member that is no more valid. + stddialog->close(); + } + } + } } void MainWindow::updateCustomSettings() { - mwsettings.updateGlobalParameterList(currentGlobalParams); - emit dispatchCustomSettings(currentGlobalParams); + mwsettings.updateGlobalParameterList(currentGlobalParams); + emit dispatchCustomSettings(currentGlobalParams); } void MainWindow::updateWindowMenu() { - windowsMenu->clear(); - windowsMenu->addAction(closeAllAct); - windowsMenu->addSeparator(); - windowsMenu->addAction(windowsTileAct); - windowsMenu->addAction(windowsCascadeAct); - windowsMenu->addAction(windowsNextAct); - windowsNextAct->setEnabled(mdiarea-> subWindowList().size()>1); - - windowsMenu->addSeparator(); - - - if((mdiarea-> subWindowList().size()>0)){ - // Split/Unsplit SUBmenu - splitModeMenu = windowsMenu->addMenu(tr("&Split current view")); - - splitModeMenu->addAction(setSplitHAct); - splitModeMenu->addAction(setSplitVAct); - - windowsMenu->addAction(setUnsplitAct); - - // Link act - windowsMenu->addAction(linkViewersAct); - - // View From SUBmenu - viewFromMenu = windowsMenu->addMenu(tr("&View from")); - foreach(QAction *ac, viewFromGroupAct->actions()) - viewFromMenu->addAction(ac); - + windowsMenu->clear(); + windowsMenu->addAction(closeAllAct); + windowsMenu->addSeparator(); + windowsMenu->addAction(windowsTileAct); + windowsMenu->addAction(windowsCascadeAct); + windowsMenu->addAction(windowsNextAct); + windowsNextAct->setEnabled(mdiarea-> subWindowList().size()>1); + + windowsMenu->addSeparator(); + + + if((mdiarea-> subWindowList().size()>0)){ + // Split/Unsplit SUBmenu + splitModeMenu = windowsMenu->addMenu(tr("&Split current view")); + + splitModeMenu->addAction(setSplitHAct); + splitModeMenu->addAction(setSplitVAct); + + windowsMenu->addAction(setUnsplitAct); + + // Link act + windowsMenu->addAction(linkViewersAct); + + // View From SUBmenu + viewFromMenu = windowsMenu->addMenu(tr("&View from")); + foreach(QAction *ac, viewFromGroupAct->actions()) + viewFromMenu->addAction(ac); + // Trackball Step SUBmenu trackballStepMenu = windowsMenu->addMenu(tr("Trackball step")); foreach(QAction *ac, trackballStepGroupAct->actions()) trackballStepMenu->addAction(ac); - - // View From File act - windowsMenu->addAction(readViewFromFileAct); - windowsMenu->addAction(saveViewToFileAct); - windowsMenu->addAction(viewFromMeshAct); - windowsMenu->addAction(viewFromRasterAct); - - // Copy and paste shot acts - windowsMenu->addAction(copyShotToClipboardAct); - windowsMenu->addAction(pasteShotFromClipboardAct); - - //Enabling the actions - MultiViewer_Container *mvc = currentViewContainer(); - if(mvc) - { - setUnsplitAct->setEnabled(mvc->viewerCounter()>1); - GLArea* current = mvc->currentView(); - if(current) - { - setSplitHAct->setEnabled(current->size().height()/2 > current->minimumSizeHint().height()); - setSplitVAct->setEnabled(current->size().width()/2 > current->minimumSizeHint().width()); - - linkViewersAct->setEnabled(currentViewContainer()->viewerCounter()>1); - if(currentViewContainer()->viewerCounter()==1) - linkViewersAct->setChecked(false); - - windowsMenu->addSeparator(); - } - } - } - - QList windows = mdiarea->subWindowList(); - - if(windows.size() > 0) - windowsMenu->addSeparator(); - - int i=0; - foreach(QWidget *w,windows) - { - QString text = tr("&%1. %2").arg(i+1).arg(QFileInfo(w->windowTitle()).fileName()); - QAction *action = windowsMenu->addAction(text); - action->setCheckable(true); - action->setChecked(w == mdiarea->currentSubWindow()); - // Connect the signal to activate the selected window - connect(action, SIGNAL(triggered()), windowMapper, SLOT(map())); - windowMapper->setMapping(action, w); - ++i; - } + + // View From File act + windowsMenu->addAction(readViewFromFileAct); + windowsMenu->addAction(saveViewToFileAct); + windowsMenu->addAction(viewFromMeshAct); + windowsMenu->addAction(viewFromRasterAct); + + // Copy and paste shot acts + windowsMenu->addAction(copyShotToClipboardAct); + windowsMenu->addAction(pasteShotFromClipboardAct); + + //Enabling the actions + MultiViewer_Container *mvc = currentViewContainer(); + if(mvc) + { + setUnsplitAct->setEnabled(mvc->viewerCounter()>1); + GLArea* current = mvc->currentView(); + if(current) + { + setSplitHAct->setEnabled(current->size().height()/2 > current->minimumSizeHint().height()); + setSplitVAct->setEnabled(current->size().width()/2 > current->minimumSizeHint().width()); + + linkViewersAct->setEnabled(currentViewContainer()->viewerCounter()>1); + if(currentViewContainer()->viewerCounter()==1) + linkViewersAct->setChecked(false); + + windowsMenu->addSeparator(); + } + } + } + + QList windows = mdiarea->subWindowList(); + + if(windows.size() > 0) + windowsMenu->addSeparator(); + + int i=0; + foreach(QWidget *w,windows) + { + QString text = tr("&%1. %2").arg(i+1).arg(QFileInfo(w->windowTitle()).fileName()); + QAction *action = windowsMenu->addAction(text); + action->setCheckable(true); + action->setChecked(w == mdiarea->currentSubWindow()); + // Connect the signal to activate the selected window + connect(action, SIGNAL(triggered()), windowMapper, SLOT(map())); + windowMapper->setMapping(action, w); + ++i; + } } void MainWindow::enableDocumentSensibleActionsContainer(const bool allowed) { - QAction* fileact = fileMenu->menuAction(); - if (fileact != NULL) - fileact->setEnabled(allowed); - if (mainToolBar != NULL) - mainToolBar->setEnabled(allowed); - if (searchToolBar != NULL) - searchToolBar->setEnabled(allowed); - QAction* filtact = filterMenu->menuAction(); - if (filtact != NULL) - filtact->setEnabled(allowed); - if (filterToolBar != NULL) - filterToolBar->setEnabled(allowed); - QAction* editact = editMenu->menuAction(); - if (editact != NULL) - editact->setEnabled(allowed); - if (editToolBar) - editToolBar->setEnabled(allowed); + QAction* fileact = fileMenu->menuAction(); + if (fileact != NULL) + fileact->setEnabled(allowed); + if (mainToolBar != NULL) + mainToolBar->setEnabled(allowed); + if (searchToolBar != NULL) + searchToolBar->setEnabled(allowed); + QAction* filtact = filterMenu->menuAction(); + if (filtact != NULL) + filtact->setEnabled(allowed); + if (filterToolBar != NULL) + filterToolBar->setEnabled(allowed); + QAction* editact = editMenu->menuAction(); + if (editact != NULL) + editact->setEnabled(allowed); + if (editToolBar) + editToolBar->setEnabled(allowed); } @@ -254,401 +254,401 @@ void MainWindow::enableDocumentSensibleActionsContainer(const bool allowed) //menu create is not enabled only in case of not valid/existing meshdocument void MainWindow::updateSubFiltersMenu( const bool createmenuenabled,const bool validmeshdoc ) { - showFilterScriptAct->setEnabled(validmeshdoc); - filterMenuSelect->setEnabled(validmeshdoc); - updateMenuItems(filterMenuSelect,validmeshdoc); - filterMenuClean->setEnabled(validmeshdoc); - updateMenuItems(filterMenuClean,validmeshdoc); - filterMenuCreate->setEnabled(createmenuenabled || validmeshdoc); - updateMenuItems(filterMenuCreate,createmenuenabled || validmeshdoc); - filterMenuRemeshing->setEnabled(validmeshdoc); - updateMenuItems(filterMenuRemeshing,validmeshdoc); - filterMenuPolygonal->setEnabled(validmeshdoc); - updateMenuItems(filterMenuPolygonal,validmeshdoc); - filterMenuColorize->setEnabled(validmeshdoc); - updateMenuItems(filterMenuColorize,validmeshdoc); - filterMenuSmoothing->setEnabled(validmeshdoc); - updateMenuItems(filterMenuSmoothing,validmeshdoc); - filterMenuQuality->setEnabled(validmeshdoc); - updateMenuItems(filterMenuQuality,validmeshdoc); - filterMenuNormal->setEnabled(validmeshdoc); - updateMenuItems(filterMenuNormal,validmeshdoc); - filterMenuMeshLayer->setEnabled(validmeshdoc); - updateMenuItems(filterMenuMeshLayer,validmeshdoc); - filterMenuRasterLayer->setEnabled(validmeshdoc); - updateMenuItems(filterMenuRasterLayer,validmeshdoc); - filterMenuRangeMap->setEnabled(validmeshdoc); - updateMenuItems(filterMenuRangeMap,validmeshdoc); - filterMenuPointSet->setEnabled(validmeshdoc); - updateMenuItems(filterMenuPointSet,validmeshdoc); - filterMenuSampling->setEnabled(validmeshdoc); - updateMenuItems(filterMenuSampling,validmeshdoc); - filterMenuTexture->setEnabled(validmeshdoc); - updateMenuItems(filterMenuTexture,validmeshdoc); - filterMenuCamera->setEnabled(validmeshdoc); - updateMenuItems(filterMenuCamera,validmeshdoc); - + showFilterScriptAct->setEnabled(validmeshdoc); + filterMenuSelect->setEnabled(validmeshdoc); + updateMenuItems(filterMenuSelect,validmeshdoc); + filterMenuClean->setEnabled(validmeshdoc); + updateMenuItems(filterMenuClean,validmeshdoc); + filterMenuCreate->setEnabled(createmenuenabled || validmeshdoc); + updateMenuItems(filterMenuCreate,createmenuenabled || validmeshdoc); + filterMenuRemeshing->setEnabled(validmeshdoc); + updateMenuItems(filterMenuRemeshing,validmeshdoc); + filterMenuPolygonal->setEnabled(validmeshdoc); + updateMenuItems(filterMenuPolygonal,validmeshdoc); + filterMenuColorize->setEnabled(validmeshdoc); + updateMenuItems(filterMenuColorize,validmeshdoc); + filterMenuSmoothing->setEnabled(validmeshdoc); + updateMenuItems(filterMenuSmoothing,validmeshdoc); + filterMenuQuality->setEnabled(validmeshdoc); + updateMenuItems(filterMenuQuality,validmeshdoc); + filterMenuNormal->setEnabled(validmeshdoc); + updateMenuItems(filterMenuNormal,validmeshdoc); + filterMenuMeshLayer->setEnabled(validmeshdoc); + updateMenuItems(filterMenuMeshLayer,validmeshdoc); + filterMenuRasterLayer->setEnabled(validmeshdoc); + updateMenuItems(filterMenuRasterLayer,validmeshdoc); + filterMenuRangeMap->setEnabled(validmeshdoc); + updateMenuItems(filterMenuRangeMap,validmeshdoc); + filterMenuPointSet->setEnabled(validmeshdoc); + updateMenuItems(filterMenuPointSet,validmeshdoc); + filterMenuSampling->setEnabled(validmeshdoc); + updateMenuItems(filterMenuSampling,validmeshdoc); + filterMenuTexture->setEnabled(validmeshdoc); + updateMenuItems(filterMenuTexture,validmeshdoc); + filterMenuCamera->setEnabled(validmeshdoc); + updateMenuItems(filterMenuCamera,validmeshdoc); + } void MainWindow::updateMenuItems(QMenu* menu,const bool enabled) { - foreach(QAction* act,menu->actions()) - act->setEnabled(enabled); + foreach(QAction* act,menu->actions()) + act->setEnabled(enabled); } void MainWindow::switchOffDecorator(QAction* decorator) { - if (GLA() != NULL) - { - int res = GLA()->iCurPerMeshDecoratorList().removeAll(decorator); - if (res == 0) - GLA()->iPerDocDecoratorlist.removeAll(decorator); - updateMenus(); + if (GLA() != NULL) + { + int res = GLA()->iCurPerMeshDecoratorList().removeAll(decorator); + if (res == 0) + GLA()->iPerDocDecoratorlist.removeAll(decorator); + updateMenus(); layerDialog->updateDecoratorParsView(); - GLA()->update(); - } + GLA()->update(); + } } void MainWindow::updateLayerDialog() { if ((meshDoc() == NULL) || ((layerDialog != NULL) && !(layerDialog->isVisible()))) return; - MultiViewer_Container* mvc = currentViewContainer(); - if (mvc == NULL) - return; - MLSceneGLSharedDataContext* shared = mvc->sharedDataContext(); - if (shared == NULL) - return; - if(GLA()) - { - MLSceneGLSharedDataContext::PerMeshRenderingDataMap dtf; - shared->getRenderInfoPerMeshView(GLA()->context(),dtf); + MultiViewer_Container* mvc = currentViewContainer(); + if (mvc == NULL) + return; + MLSceneGLSharedDataContext* shared = mvc->sharedDataContext(); + if (shared == NULL) + return; + if(GLA()) + { + MLSceneGLSharedDataContext::PerMeshRenderingDataMap dtf; + shared->getRenderInfoPerMeshView(GLA()->context(),dtf); /*Add to the table the info for the per view global rendering of the Project*/ MLRenderingData projdt; //GLA()->getPerDocGlobalRenderingData(projdt); dtf[-1] = projdt; - layerDialog->updateTable(dtf); - layerDialog->updateLog(meshDoc()->Log); - layerDialog->updateDecoratorParsView(); - MLRenderingData dt; - if (meshDoc()->mm() != NULL) + layerDialog->updateTable(dtf); + layerDialog->updateLog(meshDoc()->Log); + layerDialog->updateDecoratorParsView(); + MLRenderingData dt; + if (meshDoc()->mm() != NULL) { MLSceneGLSharedDataContext::PerMeshRenderingDataMap::iterator it = dtf.find(meshDoc()->mm()->id()); if (it != dtf.end()) layerDialog->updateRenderingParametersTab(meshDoc()->mm()->id(),*it); - } + } if (globrendtoolbar != NULL) { shared->getRenderInfoPerMeshView(GLA()->context(), dtf); globrendtoolbar->statusConsistencyCheck(dtf); } - } + } } void MainWindow::updateMenus() { - - bool activeDoc = !(mdiarea->subWindowList().empty()) && (mdiarea->currentSubWindow() != NULL); - bool notEmptyActiveDoc = activeDoc && (meshDoc() != NULL) && !(meshDoc()->meshList.empty()); - + + bool activeDoc = !(mdiarea->subWindowList().empty()) && (mdiarea->currentSubWindow() != NULL); + bool notEmptyActiveDoc = activeDoc && (meshDoc() != NULL) && !(meshDoc()->meshList.empty()); + //std::cout << "SubWindowsList empty: " << mdiarea->subWindowList().empty() << " Valid Current Sub Windows: " << (mdiarea->currentSubWindow() != NULL) << " MeshList empty: " << meshDoc()->meshList.empty() << "\n"; - - importMeshAct->setEnabled(activeDoc); - - exportMeshAct->setEnabled(notEmptyActiveDoc); - exportMeshAsAct->setEnabled(notEmptyActiveDoc); - reloadMeshAct->setEnabled(notEmptyActiveDoc); - reloadAllMeshAct->setEnabled(notEmptyActiveDoc); - importRasterAct->setEnabled(activeDoc); - - saveProjectAct->setEnabled(activeDoc); - closeProjectAct->setEnabled(activeDoc); - - saveSnapshotAct->setEnabled(activeDoc); - - updateRecentFileActions(); - updateRecentProjActions(); - filterMenu->setEnabled(!filterMenu->actions().isEmpty()); - if (!filterMenu->actions().isEmpty()) - updateSubFiltersMenu(GLA() != NULL,notEmptyActiveDoc); - lastFilterAct->setEnabled(false); - lastFilterAct->setText(QString("Apply filter")); - editMenu->setEnabled(!editMenu->actions().isEmpty()); - updateMenuItems(editMenu,activeDoc); - renderMenu->setEnabled(!renderMenu->actions().isEmpty()); - updateMenuItems(renderMenu,activeDoc); - fullScreenAct->setEnabled(activeDoc); - showLayerDlgAct->setEnabled(activeDoc); - showTrackBallAct->setEnabled(activeDoc); - resetTrackBallAct->setEnabled(activeDoc); - showInfoPaneAct->setEnabled(activeDoc); - windowsMenu->setEnabled(activeDoc); - preferencesMenu->setEnabled(activeDoc); - - showToolbarStandardAct->setChecked(mainToolBar->isVisible()); - if(activeDoc && GLA()) - { - if(GLA()->getLastAppliedFilter() != NULL) - { - lastFilterAct->setText(QString("Apply filter ") + GLA()->getLastAppliedFilter()->text()); - lastFilterAct->setEnabled(true); - } - - // Management of the editing toolbar - // when you enter in a editing mode you can toggle between editing - // and camera moving by esc; - // you exit from editing mode by pressing again the editing button - // When you are in a editing mode all the other editing are disabled. - - foreach (QAction *a,PM.editActionList) - { - a->setChecked(false); - a->setEnabled( GLA()->getCurrentEditAction() == NULL ); - } - - suspendEditModeAct->setChecked(GLA()->suspendedEditor); - suspendEditModeAct->setDisabled(GLA()->getCurrentEditAction() == NULL); - - if(GLA()->getCurrentEditAction()) - { - GLA()->getCurrentEditAction()->setChecked(! GLA()->suspendedEditor); - GLA()->getCurrentEditAction()->setEnabled(true); - } - - showInfoPaneAct->setChecked(GLA()->infoAreaVisible); - showTrackBallAct->setChecked(GLA()->isTrackBallVisible()); - - // Decorator Menu Checking and unChecking - // First uncheck and disable all the decorators - foreach (QAction *a, PM.decoratorActionList) - { - a->setChecked(false); - a->setEnabled(true); - } - // Check the decorator per Document of the current glarea - foreach (QAction *a, GLA()->iPerDocDecoratorlist) - { a ->setChecked(true); } - - // Then check the decorator enabled for the current mesh. - if(GLA()->mm()) - foreach (QAction *a, GLA()->iCurPerMeshDecoratorList()) - a ->setChecked(true); - } // if active - else - { - foreach (QAction *a,PM.editActionList) - { - a->setEnabled(false); - } - foreach (QAction *a,PM.decoratorActionList) - a->setEnabled(false); - - } + + importMeshAct->setEnabled(activeDoc); + + exportMeshAct->setEnabled(notEmptyActiveDoc); + exportMeshAsAct->setEnabled(notEmptyActiveDoc); + reloadMeshAct->setEnabled(notEmptyActiveDoc); + reloadAllMeshAct->setEnabled(notEmptyActiveDoc); + importRasterAct->setEnabled(activeDoc); + + saveProjectAct->setEnabled(activeDoc); + closeProjectAct->setEnabled(activeDoc); + + saveSnapshotAct->setEnabled(activeDoc); + + updateRecentFileActions(); + updateRecentProjActions(); + filterMenu->setEnabled(!filterMenu->actions().isEmpty()); + if (!filterMenu->actions().isEmpty()) + updateSubFiltersMenu(GLA() != NULL,notEmptyActiveDoc); + lastFilterAct->setEnabled(false); + lastFilterAct->setText(QString("Apply filter")); + editMenu->setEnabled(!editMenu->actions().isEmpty()); + updateMenuItems(editMenu,activeDoc); + renderMenu->setEnabled(!renderMenu->actions().isEmpty()); + updateMenuItems(renderMenu,activeDoc); + fullScreenAct->setEnabled(activeDoc); + showLayerDlgAct->setEnabled(activeDoc); + showTrackBallAct->setEnabled(activeDoc); + resetTrackBallAct->setEnabled(activeDoc); + showInfoPaneAct->setEnabled(activeDoc); + windowsMenu->setEnabled(activeDoc); + preferencesMenu->setEnabled(activeDoc); + + showToolbarStandardAct->setChecked(mainToolBar->isVisible()); + if(activeDoc && GLA()) + { + if(GLA()->getLastAppliedFilter() != NULL) + { + lastFilterAct->setText(QString("Apply filter ") + GLA()->getLastAppliedFilter()->text()); + lastFilterAct->setEnabled(true); + } + + // Management of the editing toolbar + // when you enter in a editing mode you can toggle between editing + // and camera moving by esc; + // you exit from editing mode by pressing again the editing button + // When you are in a editing mode all the other editing are disabled. + + foreach (QAction *a,PM.editActionList) + { + a->setChecked(false); + a->setEnabled( GLA()->getCurrentEditAction() == NULL ); + } + + suspendEditModeAct->setChecked(GLA()->suspendedEditor); + suspendEditModeAct->setDisabled(GLA()->getCurrentEditAction() == NULL); + + if(GLA()->getCurrentEditAction()) + { + GLA()->getCurrentEditAction()->setChecked(! GLA()->suspendedEditor); + GLA()->getCurrentEditAction()->setEnabled(true); + } + + showInfoPaneAct->setChecked(GLA()->infoAreaVisible); + showTrackBallAct->setChecked(GLA()->isTrackBallVisible()); + + // Decorator Menu Checking and unChecking + // First uncheck and disable all the decorators + foreach (QAction *a, PM.decoratorActionList) + { + a->setChecked(false); + a->setEnabled(true); + } + // Check the decorator per Document of the current glarea + foreach (QAction *a, GLA()->iPerDocDecoratorlist) + { a ->setChecked(true); } + + // Then check the decorator enabled for the current mesh. + if(GLA()->mm()) + foreach (QAction *a, GLA()->iCurPerMeshDecoratorList()) + a ->setChecked(true); + } // if active + else + { + foreach (QAction *a,PM.editActionList) + { + a->setEnabled(false); + } + foreach (QAction *a,PM.decoratorActionList) + a->setEnabled(false); + + } GLArea* tmp = GLA(); - if(tmp != NULL) - { - showLayerDlgAct->setChecked(layerDialog->isVisible()); - showRasterAct->setEnabled((meshDoc() != NULL) && (meshDoc()->rm() != 0)); - showRasterAct->setChecked(tmp->isRaster()); - } - else - { - foreach (QAction *a,PM.decoratorActionList) - { - a->setChecked(false); - a->setEnabled(false); - } - - - layerDialog->setVisible(false); - } - if (searchMenu != NULL) - searchMenu->searchLineWidth() = longestActionWidthInAllMenus(); - updateWindowMenu(); + if(tmp != NULL) + { + showLayerDlgAct->setChecked(layerDialog->isVisible()); + showRasterAct->setEnabled((meshDoc() != NULL) && (meshDoc()->rm() != 0)); + showRasterAct->setChecked(tmp->isRaster()); + } + else + { + foreach (QAction *a,PM.decoratorActionList) + { + a->setChecked(false); + a->setEnabled(false); + } + + + layerDialog->setVisible(false); + } + if (searchMenu != NULL) + searchMenu->searchLineWidth() = longestActionWidthInAllMenus(); + updateWindowMenu(); } void MainWindow::setSplit(QAction *qa) { - MultiViewer_Container *mvc = currentViewContainer(); - if(mvc) - { - GLArea *glwClone=new GLArea(this, mvc, ¤tGlobalParams); + MultiViewer_Container *mvc = currentViewContainer(); + if(mvc) + { + GLArea *glwClone=new GLArea(this, mvc, ¤tGlobalParams); //connect(glwClone, SIGNAL(insertRenderingDataForNewlyGeneratedMesh(int)), this, SLOT(addRenderingDataIfNewlyGeneratedMesh(int))); - if(qa->text() == tr("&Horizontally")) - mvc->addView(glwClone,Qt::Vertical); - else if(qa->text() == tr("&Vertically")) - mvc->addView(glwClone,Qt::Horizontal); - - //The loading of the raster must be here - if(GLA()->isRaster()) - { - glwClone->setIsRaster(true); - if(this->meshDoc()->rm()->id()>=0) - glwClone->loadRaster(this->meshDoc()->rm()->id()); - } - - updateMenus(); - - glwClone->resetTrackBall(); - glwClone->update(); - } - + if(qa->text() == tr("&Horizontally")) + mvc->addView(glwClone,Qt::Vertical); + else if(qa->text() == tr("&Vertically")) + mvc->addView(glwClone,Qt::Horizontal); + + //The loading of the raster must be here + if(GLA()->isRaster()) + { + glwClone->setIsRaster(true); + if(this->meshDoc()->rm()->id()>=0) + glwClone->loadRaster(this->meshDoc()->rm()->id()); + } + + updateMenus(); + + glwClone->resetTrackBall(); + glwClone->update(); + } + } void MainWindow::setUnsplit() { - MultiViewer_Container *mvc = currentViewContainer(); - if(mvc) - { - assert(mvc->viewerCounter() >1); - - mvc->removeView(mvc->currentView()->getId()); - - updateMenus(); - } + MultiViewer_Container *mvc = currentViewContainer(); + if(mvc) + { + assert(mvc->viewerCounter() >1); + + mvc->removeView(mvc->currentView()->getId()); + + updateMenus(); + } } //set the split/unsplit menu that appears right clicking on a splitter's handle void MainWindow::setHandleMenu(QPoint point, Qt::Orientation orientation, QSplitter *origin) { - MultiViewer_Container *mvc = currentViewContainer(); - int epsilon =10; - splitMenu->clear(); - unSplitMenu->clear(); - //the viewer to split/unsplit is chosen through picking - - //Vertical handle allows to split horizontally - if(orientation == Qt::Vertical) - { - splitUpAct->setData(point); - splitDownAct->setData(point); - - //check if the viewer on the top is splittable according to its size - int pickingId = mvc->getViewerByPicking(QPoint(point.x(), point.y()-epsilon)); - if(pickingId>=0) - splitUpAct->setEnabled(mvc->getViewer(pickingId)->size().width()/2 > mvc->getViewer(pickingId)->minimumSizeHint().width()); - - //the viewer on top can be closed only if the splitter over the handle that originated the event has one child - bool unSplittabilityUp = true; - Splitter * upSplitter = qobject_cast(origin->widget(0)); - if(upSplitter) - unSplittabilityUp = !(upSplitter->count()>1); - unsplitUpAct->setEnabled(unSplittabilityUp); - - //check if the viewer below is splittable according to its size - pickingId = mvc->getViewerByPicking(QPoint(point.x(), point.y()+epsilon)); - if(pickingId>=0) - splitDownAct->setEnabled(mvc->getViewer(pickingId)->size().width()/2 > mvc->getViewer(pickingId)->minimumSizeHint().width()); - - //the viewer below can be closed only if the splitter ounder the handle that originated the event has one child - bool unSplittabilityDown = true; - Splitter * downSplitter = qobject_cast(origin->widget(1)); - if(downSplitter) - unSplittabilityDown = !(downSplitter->count()>1); - unsplitDownAct->setEnabled(unSplittabilityDown); - - splitMenu->addAction(splitUpAct); - splitMenu->addAction(splitDownAct); - - unsplitUpAct->setData(point); - unsplitDownAct->setData(point); - - unSplitMenu->addAction(unsplitUpAct); - unSplitMenu->addAction(unsplitDownAct); - } - //Horizontal handle allows to split vertically - else if (orientation == Qt::Horizontal) - { - splitRightAct->setData(point); - splitLeftAct->setData(point); - - //check if the viewer on the right is splittable according to its size - int pickingId =mvc->getViewerByPicking(QPoint(point.x()+epsilon, point.y())); - if(pickingId>=0) - splitRightAct->setEnabled(mvc->getViewer(pickingId)->size().height()/2 > mvc->getViewer(pickingId)->minimumSizeHint().height()); - - //the viewer on the right can be closed only if the splitter on the right the handle that originated the event has one child - bool unSplittabilityRight = true; - Splitter * rightSplitter = qobject_cast(origin->widget(1)); - if(rightSplitter) - unSplittabilityRight = !(rightSplitter->count()>1); - unsplitRightAct->setEnabled(unSplittabilityRight); - - //check if the viewer on the left is splittable according to its size - pickingId =mvc->getViewerByPicking(QPoint(point.x()-epsilon, point.y())); - if(pickingId>=0) - splitLeftAct->setEnabled(mvc->getViewer(pickingId)->size().height()/2 > mvc->getViewer(pickingId)->minimumSizeHint().height()); - - //the viewer on the left can be closed only if the splitter on the left of the handle that originated the event has one child - bool unSplittabilityLeft = true; - Splitter * leftSplitter = qobject_cast(origin->widget(0)); - if(leftSplitter) - unSplittabilityLeft = !(leftSplitter->count()>1); - unsplitLeftAct->setEnabled(unSplittabilityLeft); - - splitMenu->addAction(splitRightAct); - splitMenu->addAction(splitLeftAct); - - unsplitRightAct->setData(point); - unsplitLeftAct->setData(point); - - unSplitMenu->addAction(unsplitRightAct); - unSplitMenu->addAction(unsplitLeftAct); - } - handleMenu->popup(point); + MultiViewer_Container *mvc = currentViewContainer(); + int epsilon =10; + splitMenu->clear(); + unSplitMenu->clear(); + //the viewer to split/unsplit is chosen through picking + + //Vertical handle allows to split horizontally + if(orientation == Qt::Vertical) + { + splitUpAct->setData(point); + splitDownAct->setData(point); + + //check if the viewer on the top is splittable according to its size + int pickingId = mvc->getViewerByPicking(QPoint(point.x(), point.y()-epsilon)); + if(pickingId>=0) + splitUpAct->setEnabled(mvc->getViewer(pickingId)->size().width()/2 > mvc->getViewer(pickingId)->minimumSizeHint().width()); + + //the viewer on top can be closed only if the splitter over the handle that originated the event has one child + bool unSplittabilityUp = true; + Splitter * upSplitter = qobject_cast(origin->widget(0)); + if(upSplitter) + unSplittabilityUp = !(upSplitter->count()>1); + unsplitUpAct->setEnabled(unSplittabilityUp); + + //check if the viewer below is splittable according to its size + pickingId = mvc->getViewerByPicking(QPoint(point.x(), point.y()+epsilon)); + if(pickingId>=0) + splitDownAct->setEnabled(mvc->getViewer(pickingId)->size().width()/2 > mvc->getViewer(pickingId)->minimumSizeHint().width()); + + //the viewer below can be closed only if the splitter ounder the handle that originated the event has one child + bool unSplittabilityDown = true; + Splitter * downSplitter = qobject_cast(origin->widget(1)); + if(downSplitter) + unSplittabilityDown = !(downSplitter->count()>1); + unsplitDownAct->setEnabled(unSplittabilityDown); + + splitMenu->addAction(splitUpAct); + splitMenu->addAction(splitDownAct); + + unsplitUpAct->setData(point); + unsplitDownAct->setData(point); + + unSplitMenu->addAction(unsplitUpAct); + unSplitMenu->addAction(unsplitDownAct); + } + //Horizontal handle allows to split vertically + else if (orientation == Qt::Horizontal) + { + splitRightAct->setData(point); + splitLeftAct->setData(point); + + //check if the viewer on the right is splittable according to its size + int pickingId =mvc->getViewerByPicking(QPoint(point.x()+epsilon, point.y())); + if(pickingId>=0) + splitRightAct->setEnabled(mvc->getViewer(pickingId)->size().height()/2 > mvc->getViewer(pickingId)->minimumSizeHint().height()); + + //the viewer on the right can be closed only if the splitter on the right the handle that originated the event has one child + bool unSplittabilityRight = true; + Splitter * rightSplitter = qobject_cast(origin->widget(1)); + if(rightSplitter) + unSplittabilityRight = !(rightSplitter->count()>1); + unsplitRightAct->setEnabled(unSplittabilityRight); + + //check if the viewer on the left is splittable according to its size + pickingId =mvc->getViewerByPicking(QPoint(point.x()-epsilon, point.y())); + if(pickingId>=0) + splitLeftAct->setEnabled(mvc->getViewer(pickingId)->size().height()/2 > mvc->getViewer(pickingId)->minimumSizeHint().height()); + + //the viewer on the left can be closed only if the splitter on the left of the handle that originated the event has one child + bool unSplittabilityLeft = true; + Splitter * leftSplitter = qobject_cast(origin->widget(0)); + if(leftSplitter) + unSplittabilityLeft = !(leftSplitter->count()>1); + unsplitLeftAct->setEnabled(unSplittabilityLeft); + + splitMenu->addAction(splitRightAct); + splitMenu->addAction(splitLeftAct); + + unsplitRightAct->setData(point); + unsplitLeftAct->setData(point); + + unSplitMenu->addAction(unsplitRightAct); + unSplitMenu->addAction(unsplitLeftAct); + } + handleMenu->popup(point); } void MainWindow::splitFromHandle(QAction *qa ) { - MultiViewer_Container *mvc = currentViewContainer(); - QPoint point = qa->data().toPoint(); - int epsilon =10; - - if(qa->text() == tr("&Right")) - point.setX(point.x()+ epsilon); - else if(qa->text() == tr("&Left")) - point.setX(point.x()- epsilon); - else if(qa->text() == tr("&Up")) - point.setY(point.y()- epsilon); - else if(qa->text() == tr("&Down")) - point.setY(point.y()+ epsilon); - - int newCurrent = mvc->getViewerByPicking(point); - mvc->updateCurrent(newCurrent); - - if(qa->text() == tr("&Right") || qa->text() == tr("&Left")) - setSplit(new QAction(tr("&Horizontally"), this)); - else - setSplit( new QAction(tr("&Vertically"), this)); + MultiViewer_Container *mvc = currentViewContainer(); + QPoint point = qa->data().toPoint(); + int epsilon =10; + + if(qa->text() == tr("&Right")) + point.setX(point.x()+ epsilon); + else if(qa->text() == tr("&Left")) + point.setX(point.x()- epsilon); + else if(qa->text() == tr("&Up")) + point.setY(point.y()- epsilon); + else if(qa->text() == tr("&Down")) + point.setY(point.y()+ epsilon); + + int newCurrent = mvc->getViewerByPicking(point); + mvc->updateCurrent(newCurrent); + + if(qa->text() == tr("&Right") || qa->text() == tr("&Left")) + setSplit(new QAction(tr("&Horizontally"), this)); + else + setSplit( new QAction(tr("&Vertically"), this)); } void MainWindow::unsplitFromHandle(QAction * qa) { - MultiViewer_Container *mvc = currentViewContainer(); - - QPoint point = qa->data().toPoint(); - int epsilon =10; - - if(qa->text() == tr("&Right")) - point.setX(point.x()+ epsilon); - else if(qa->text() == tr("&Left")) - point.setX(point.x()- epsilon); - else if(qa->text() == tr("&Up")) - point.setY(point.y()- epsilon); - else if(qa->text() == tr("&Down")) - point.setY(point.y()+ epsilon); - - int newCurrent = mvc->getViewerByPicking(point); - mvc->updateCurrent(newCurrent); - - setUnsplit(); + MultiViewer_Container *mvc = currentViewContainer(); + + QPoint point = qa->data().toPoint(); + int epsilon =10; + + if(qa->text() == tr("&Right")) + point.setX(point.x()+ epsilon); + else if(qa->text() == tr("&Left")) + point.setX(point.x()- epsilon); + else if(qa->text() == tr("&Up")) + point.setY(point.y()- epsilon); + else if(qa->text() == tr("&Down")) + point.setY(point.y()+ epsilon); + + int newCurrent = mvc->getViewerByPicking(point); + mvc->updateCurrent(newCurrent); + + setUnsplit(); } void MainWindow::linkViewers() { - MultiViewer_Container *mvc = currentViewContainer(); - mvc->updateTrackballInViewers(); + MultiViewer_Container *mvc = currentViewContainer(); + mvc->updateTrackballInViewers(); } void MainWindow::toggleOrtho() @@ -658,7 +658,7 @@ void MainWindow::toggleOrtho() void MainWindow::viewFrom(QAction *qa) { - if(GLA()) GLA()->createOrthoView(qa->text()); + if(GLA()) GLA()->createOrthoView(qa->text()); } void MainWindow::trackballStep(QAction *qa) @@ -668,74 +668,74 @@ void MainWindow::trackballStep(QAction *qa) void MainWindow::readViewFromFile() { - if(GLA()) GLA()->readViewFromFile(); - updateMenus(); + if(GLA()) GLA()->readViewFromFile(); + updateMenus(); } void MainWindow::saveViewToFile() { - if(GLA()) GLA()->saveViewToFile(); + if(GLA()) GLA()->saveViewToFile(); } void MainWindow::viewFromCurrentMeshShot() { - if(GLA()) GLA()->viewFromCurrentShot("Mesh"); - updateMenus(); + if(GLA()) GLA()->viewFromCurrentShot("Mesh"); + updateMenus(); } void MainWindow::viewFromCurrentRasterShot() { - if(GLA()) GLA()->viewFromCurrentShot("Raster"); - updateMenus(); + if(GLA()) GLA()->viewFromCurrentShot("Raster"); + updateMenus(); } void MainWindow::copyViewToClipBoard() { - if(GLA()) GLA()->viewToClipboard(); + if(GLA()) GLA()->viewToClipboard(); } void MainWindow::pasteViewFromClipboard() { - if(GLA()) GLA()->viewFromClipboard(); - updateMenus(); + if(GLA()) GLA()->viewFromClipboard(); + updateMenus(); } void MainWindow::dragEnterEvent(QDragEnterEvent *event) { - //qDebug("dragEnterEvent: %s",event->format()); - event->accept(); + //qDebug("dragEnterEvent: %s",event->format()); + event->accept(); } void MainWindow::dropEvent ( QDropEvent * event ) { - //qDebug("dropEvent: %s",event->format()); - const QMimeData * data = event->mimeData(); - if (data->hasUrls()) - { - QList< QUrl > url_list = data->urls(); - bool layervis = false; - if (layerDialog != NULL) - { - layervis = layerDialog->isVisible(); - showLayerDlg(false); - } - for (int i=0, size=url_list.size(); ikeyboardModifiers () == Qt::ControlModifier ) || ( QApplication::keyboardModifiers () == Qt::ControlModifier )) - { - this->newProject(); - } - - if(path.endsWith("mlp",Qt::CaseInsensitive) || path.endsWith("mlb", Qt::CaseInsensitive) || path.endsWith("aln",Qt::CaseInsensitive) || path.endsWith("out",Qt::CaseInsensitive) || path.endsWith("nvm",Qt::CaseInsensitive) ) - openProject(path); - else - { - importMesh(path); - } - } - showLayerDlg(layervis || meshDoc()->meshList.size() > 0); - } + //qDebug("dropEvent: %s",event->format()); + const QMimeData * data = event->mimeData(); + if (data->hasUrls()) + { + QList< QUrl > url_list = data->urls(); + bool layervis = false; + if (layerDialog != NULL) + { + layervis = layerDialog->isVisible(); + showLayerDlg(false); + } + for (int i=0, size=url_list.size(); ikeyboardModifiers () == Qt::ControlModifier ) || ( QApplication::keyboardModifiers () == Qt::ControlModifier )) + { + this->newProject(); + } + + if(path.endsWith("mlp",Qt::CaseInsensitive) || path.endsWith("mlb", Qt::CaseInsensitive) || path.endsWith("aln",Qt::CaseInsensitive) || path.endsWith("out",Qt::CaseInsensitive) || path.endsWith("nvm",Qt::CaseInsensitive) ) + openProject(path); + else + { + importMesh(path); + } + } + showLayerDlg(layervis || meshDoc()->meshList.size() > 0); + } } void MainWindow::endEdit() @@ -743,8 +743,8 @@ void MainWindow::endEdit() MultiViewer_Container* mvc = currentViewContainer(); if ((meshDoc() == NULL) || (GLA() == NULL) || (mvc == NULL)) return; - - + + for (int ii = 0; ii < meshDoc()->meshList.size(); ++ii) { MeshModel* mm = meshDoc()->meshList[ii]; @@ -752,44 +752,44 @@ void MainWindow::endEdit() addRenderingDataIfNewlyGeneratedMesh(mm->id()); } meshDoc()->meshDocStateData().clear(); - + GLA()->endEdit(); updateLayerDialog(); } void MainWindow::showFilterScript() { - if (meshDoc()->filterHistory != nullptr) - { - FilterScriptDialog dialog(this); - - dialog.setScript(meshDoc()->filterHistory); - if (dialog.exec()==QDialog::Accepted) - { - runFilterScript(); - return ; - } - } + if (meshDoc()->filterHistory != nullptr) + { + FilterScriptDialog dialog(this); + + dialog.setScript(meshDoc()->filterHistory); + if (dialog.exec()==QDialog::Accepted) + { + runFilterScript(); + return ; + } + } } void MainWindow::runFilterScript() { - if ((meshDoc() == nullptr) || (meshDoc()->filterHistory == nullptr)) - return; - for (FilterNameParameterValuesPair& pair : *meshDoc()->filterHistory) - { - QString filtnm = pair.filterName(); - int classes = 0; - unsigned int postCondMask = MeshModel::MM_UNKNOWN; - QAction *action = PM.actionFilterMap[ filtnm]; - FilterPluginInterface *iFilter = qobject_cast(action->parent()); - - int req=iFilter->getRequirements(action); - if (meshDoc()->mm() != NULL) - meshDoc()->mm()->updateDataMask(req); - iFilter->setLog(&meshDoc()->Log); - RichParameterList ¶meterSet = pair.second; - + if ((meshDoc() == nullptr) || (meshDoc()->filterHistory == nullptr)) + return; + for (FilterNameParameterValuesPair& pair : *meshDoc()->filterHistory) + { + QString filtnm = pair.filterName(); + int classes = 0; + unsigned int postCondMask = MeshModel::MM_UNKNOWN; + QAction *action = PM.actionFilterMap[ filtnm]; + FilterPluginInterface *iFilter = qobject_cast(action->parent()); + + int req=iFilter->getRequirements(action); + if (meshDoc()->mm() != NULL) + meshDoc()->mm()->updateDataMask(req); + iFilter->setLog(&meshDoc()->Log); + RichParameterList ¶meterSet = pair.second; + for(RichParameter& parameter : parameterSet) { //if this is a mesh parameter and the index is valid if(parameter.value().isMesh()) { @@ -804,99 +804,99 @@ void MainWindow::runFilterScript() } } } - //iFilter->applyFilter( action, *(meshDoc()->mm()), (*ii).second, QCallBack ); - - bool created = false; - MLSceneGLSharedDataContext* shar = NULL; - if (currentViewContainer() != NULL) - { - shar = currentViewContainer()->sharedDataContext(); - //GLA() is only the parent - QGLWidget* filterWidget = new QGLWidget(GLA(),shar); - QGLFormat defForm = QGLFormat::defaultFormat(); - iFilter->glContext = new MLPluginGLContext(defForm,filterWidget->context()->device(),*shar); - created = iFilter->glContext->create(filterWidget->context()); - shar->addView(iFilter->glContext); - MLRenderingData dt; - MLRenderingData::RendAtts atts; - atts[MLRenderingData::ATT_NAMES::ATT_VERTPOSITION] = true; - atts[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL] = true; - - - if (iFilter->filterArity(action) == FilterPluginInterface::SINGLE_MESH) - { - MLRenderingData::PRIMITIVE_MODALITY pm = MLPoliciesStandAloneFunctions::bestPrimitiveModalityAccordingToMesh(meshDoc()->mm()); - if ((pm != MLRenderingData::PR_ARITY) && (meshDoc()->mm() != NULL)) - { - dt.set(pm,atts); - shar->setRenderingDataPerMeshView(meshDoc()->mm()->id(),iFilter->glContext,dt); - } - } - else - { - for(int ii = 0;ii < meshDoc()->meshList.size();++ii) - { - MeshModel* mm = meshDoc()->meshList[ii]; - MLRenderingData::PRIMITIVE_MODALITY pm = MLPoliciesStandAloneFunctions::bestPrimitiveModalityAccordingToMesh(mm); - if ((pm != MLRenderingData::PR_ARITY) && (mm != NULL)) - { - dt.set(pm,atts); - shar->setRenderingDataPerMeshView(mm->id(),iFilter->glContext,dt); - } - } - } - - } - if ((!created) || (!iFilter->glContext->isValid())) - throw MLException("A valid GLContext is required by the filter to work.\n"); - meshDoc()->setBusy(true); - //WARNING!!!!!!!!!!!! - /* to be changed */ - iFilter->applyFilter( action, *meshDoc(), postCondMask, pair.second, QCallBack); - if (postCondMask == MeshModel::MM_UNKNOWN) - postCondMask = iFilter->postCondition(action); - for (MeshModel* mm = meshDoc()->nextMesh(); mm != NULL; mm = meshDoc()->nextMesh(mm)) - vcg::tri::Allocator::CompactEveryVector(mm->cm); - meshDoc()->setBusy(false); - if (shar != NULL) - shar->removeView(iFilter->glContext); - delete iFilter->glContext; - classes = int(iFilter->getClass(action)); - - if (meshDoc()->mm() != NULL) - { - if(classes & FilterPluginInterface::FaceColoring ) - { - meshDoc()->mm()->updateDataMask(MeshModel::MM_FACECOLOR); - } - if(classes & FilterPluginInterface::VertexColoring ) - { - meshDoc()->mm()->updateDataMask(MeshModel::MM_VERTCOLOR); - } - if(classes & MeshModel::MM_COLOR) - { - meshDoc()->mm()->updateDataMask(MeshModel::MM_COLOR); - } - if(classes & MeshModel::MM_CAMERA) - meshDoc()->mm()->updateDataMask(MeshModel::MM_CAMERA); - } - - bool newmeshcreated = false; - if (classes & FilterPluginInterface::MeshCreation) - newmeshcreated = true; - updateSharedContextDataAfterFilterExecution(postCondMask, classes, newmeshcreated); - meshDoc()->meshDocStateData().clear(); - - if(classes & FilterPluginInterface::MeshCreation) - GLA()->resetTrackBall(); - /* to be changed */ - - qb->reset(); - GLA()->update(); - GLA()->Logf(GLLogStream::SYSTEM,"Re-Applied filter %s",qUtf8Printable(pair.filterName())); - if (_currviewcontainer != NULL) - _currviewcontainer->updateAllDecoratorsForAllViewers(); - } + //iFilter->applyFilter( action, *(meshDoc()->mm()), (*ii).second, QCallBack ); + + bool created = false; + MLSceneGLSharedDataContext* shar = NULL; + if (currentViewContainer() != NULL) + { + shar = currentViewContainer()->sharedDataContext(); + //GLA() is only the parent + QGLWidget* filterWidget = new QGLWidget(GLA(),shar); + QGLFormat defForm = QGLFormat::defaultFormat(); + iFilter->glContext = new MLPluginGLContext(defForm,filterWidget->context()->device(),*shar); + created = iFilter->glContext->create(filterWidget->context()); + shar->addView(iFilter->glContext); + MLRenderingData dt; + MLRenderingData::RendAtts atts; + atts[MLRenderingData::ATT_NAMES::ATT_VERTPOSITION] = true; + atts[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL] = true; + + + if (iFilter->filterArity(action) == FilterPluginInterface::SINGLE_MESH) + { + MLRenderingData::PRIMITIVE_MODALITY pm = MLPoliciesStandAloneFunctions::bestPrimitiveModalityAccordingToMesh(meshDoc()->mm()); + if ((pm != MLRenderingData::PR_ARITY) && (meshDoc()->mm() != NULL)) + { + dt.set(pm,atts); + shar->setRenderingDataPerMeshView(meshDoc()->mm()->id(),iFilter->glContext,dt); + } + } + else + { + for(int ii = 0;ii < meshDoc()->meshList.size();++ii) + { + MeshModel* mm = meshDoc()->meshList[ii]; + MLRenderingData::PRIMITIVE_MODALITY pm = MLPoliciesStandAloneFunctions::bestPrimitiveModalityAccordingToMesh(mm); + if ((pm != MLRenderingData::PR_ARITY) && (mm != NULL)) + { + dt.set(pm,atts); + shar->setRenderingDataPerMeshView(mm->id(),iFilter->glContext,dt); + } + } + } + + } + if ((!created) || (!iFilter->glContext->isValid())) + throw MLException("A valid GLContext is required by the filter to work.\n"); + meshDoc()->setBusy(true); + //WARNING!!!!!!!!!!!! + /* to be changed */ + iFilter->applyFilter( action, *meshDoc(), postCondMask, pair.second, QCallBack); + if (postCondMask == MeshModel::MM_UNKNOWN) + postCondMask = iFilter->postCondition(action); + for (MeshModel* mm = meshDoc()->nextMesh(); mm != NULL; mm = meshDoc()->nextMesh(mm)) + vcg::tri::Allocator::CompactEveryVector(mm->cm); + meshDoc()->setBusy(false); + if (shar != NULL) + shar->removeView(iFilter->glContext); + delete iFilter->glContext; + classes = int(iFilter->getClass(action)); + + if (meshDoc()->mm() != NULL) + { + if(classes & FilterPluginInterface::FaceColoring ) + { + meshDoc()->mm()->updateDataMask(MeshModel::MM_FACECOLOR); + } + if(classes & FilterPluginInterface::VertexColoring ) + { + meshDoc()->mm()->updateDataMask(MeshModel::MM_VERTCOLOR); + } + if(classes & MeshModel::MM_COLOR) + { + meshDoc()->mm()->updateDataMask(MeshModel::MM_COLOR); + } + if(classes & MeshModel::MM_CAMERA) + meshDoc()->mm()->updateDataMask(MeshModel::MM_CAMERA); + } + + bool newmeshcreated = false; + if (classes & FilterPluginInterface::MeshCreation) + newmeshcreated = true; + updateSharedContextDataAfterFilterExecution(postCondMask, classes, newmeshcreated); + meshDoc()->meshDocStateData().clear(); + + if(classes & FilterPluginInterface::MeshCreation) + GLA()->resetTrackBall(); + /* to be changed */ + + qb->reset(); + GLA()->update(); + GLA()->Logf(GLLogStream::SYSTEM,"Re-Applied filter %s",qUtf8Printable(pair.filterName())); + if (_currviewcontainer != NULL) + _currviewcontainer->updateAllDecoratorsForAllViewers(); + } } // Receives the action that wants to show a tooltip and display it @@ -905,8 +905,8 @@ void MainWindow::runFilterScript() // hand side of the menu entry (not invasive) void MainWindow::showTooltip(QAction* q) { - QString tip = q->toolTip(); - QToolTip::showText(QCursor::pos(), tip); + QString tip = q->toolTip(); + QToolTip::showText(QCursor::pos(), tip); } // ///////////////////////////////////////////////// @@ -919,152 +919,152 @@ void MainWindow::showTooltip(QAction* q) void MainWindow::startFilter() { - if(currentViewContainer() == NULL) return; - if(GLA() == NULL) return; - - // In order to avoid that a filter changes something assumed by the current editing tool, - // before actually starting the filter we close the current editing tool (if any). - if (GLA()->getCurrentEditAction() != NULL) - endEdit(); - updateMenus(); - - QStringList missingPreconditions; - QAction *action = qobject_cast(sender()); - if (action == NULL) - throw MLException("Invalid filter action value."); - FilterPluginInterface *iFilter = qobject_cast(action->parent()); - if (meshDoc() == NULL) - return; - //OLD FILTER PHILOSOPHY - if (iFilter != NULL) - { - //if(iFilter->getClass(action) == MeshFilterInterface::MeshCreation) - //{ - // qDebug("MeshCreation"); - // GLA()->meshDoc->addNewMesh("",iFilter->filterName(action) ); - //} - //else - if (!iFilter->isFilterApplicable(action,(*meshDoc()->mm()),missingPreconditions)) - { - QString enstr = missingPreconditions.join(","); - QMessageBox::warning(this, tr("PreConditions' Failure"), QString("Warning the filter '" + iFilter->filterName(action) + "' has not been applied.
    " - "Current mesh does not have " + enstr + ".")); - return; - } - - if(currentViewContainer()) - { - iFilter->setLog(currentViewContainer()->LogPtr()); - currentViewContainer()->LogPtr()->SetBookmark(); - } - // just to be sure... - createStdPluginWnd(); - - // (2) Ask for filter parameters and eventually directly invoke the filter - // showAutoDialog return true if a dialog have been created (and therefore the execution is demanded to the apply event) - // if no dialog is created the filter must be executed immediately - if(! stddialog->showAutoDialog(iFilter, meshDoc()->mm(), (meshDoc()), action, this, GLA()) ) - { - RichParameterList dummyParSet; - executeFilter(action, dummyParSet, false); - - //Insert the filter to filterHistory - FilterNameParameterValuesPair tmp; - tmp.first = action->text(); tmp.second = dummyParSet; - meshDoc()->filterHistory->append(tmp); - } - } - + if(currentViewContainer() == NULL) return; + if(GLA() == NULL) return; + + // In order to avoid that a filter changes something assumed by the current editing tool, + // before actually starting the filter we close the current editing tool (if any). + if (GLA()->getCurrentEditAction() != NULL) + endEdit(); + updateMenus(); + + QStringList missingPreconditions; + QAction *action = qobject_cast(sender()); + if (action == NULL) + throw MLException("Invalid filter action value."); + FilterPluginInterface *iFilter = qobject_cast(action->parent()); + if (meshDoc() == NULL) + return; + //OLD FILTER PHILOSOPHY + if (iFilter != NULL) + { + //if(iFilter->getClass(action) == MeshFilterInterface::MeshCreation) + //{ + // qDebug("MeshCreation"); + // GLA()->meshDoc->addNewMesh("",iFilter->filterName(action) ); + //} + //else + if (!iFilter->isFilterApplicable(action,(*meshDoc()->mm()),missingPreconditions)) + { + QString enstr = missingPreconditions.join(","); + QMessageBox::warning(this, tr("PreConditions' Failure"), QString("Warning the filter '" + iFilter->filterName(action) + "' has not been applied.
    " + "Current mesh does not have " + enstr + ".")); + return; + } + + if(currentViewContainer()) + { + iFilter->setLog(currentViewContainer()->LogPtr()); + currentViewContainer()->LogPtr()->SetBookmark(); + } + // just to be sure... + createStdPluginWnd(); + + // (2) Ask for filter parameters and eventually directly invoke the filter + // showAutoDialog return true if a dialog have been created (and therefore the execution is demanded to the apply event) + // if no dialog is created the filter must be executed immediately + if(! stddialog->showAutoDialog(iFilter, meshDoc()->mm(), (meshDoc()), action, this, GLA()) ) + { + RichParameterList dummyParSet; + executeFilter(action, dummyParSet, false); + + //Insert the filter to filterHistory + FilterNameParameterValuesPair tmp; + tmp.first = action->text(); tmp.second = dummyParSet; + meshDoc()->filterHistory->append(tmp); + } + } + }//void MainWindow::startFilter() void MainWindow::updateSharedContextDataAfterFilterExecution(int postcondmask,int fclasses,bool& newmeshcreated) { - MultiViewer_Container* mvc = currentViewContainer(); - if ((meshDoc() != NULL) && (mvc != NULL)) - { - if (GLA() == NULL) - return; - MLSceneGLSharedDataContext* shared = mvc->sharedDataContext(); - if (shared != NULL) - { - for(MeshModel* mm = meshDoc()->nextMesh();mm != NULL;mm = meshDoc()->nextMesh(mm)) - { - if (mm == NULL) - continue; - //Just to be sure that the filter author didn't forget to add changing tags to the postCondition field - if ((mm->hasDataMask(MeshModel::MM_FACECOLOR)) && (fclasses & FilterPluginInterface::FaceColoring )) - postcondmask = postcondmask | MeshModel::MM_FACECOLOR; - - if ((mm->hasDataMask(MeshModel::MM_VERTCOLOR)) && (fclasses & FilterPluginInterface::VertexColoring )) - postcondmask = postcondmask | MeshModel::MM_VERTCOLOR; - - if ((mm->hasDataMask(MeshModel::MM_COLOR)) && (fclasses & FilterPluginInterface::MeshColoring )) - postcondmask = postcondmask | MeshModel::MM_COLOR; - - if ((mm->hasDataMask(MeshModel::MM_FACEQUALITY)) && (fclasses & FilterPluginInterface::Quality )) - postcondmask = postcondmask | MeshModel::MM_FACEQUALITY; - - if ((mm->hasDataMask(MeshModel::MM_VERTQUALITY)) && (fclasses & FilterPluginInterface::Quality )) - postcondmask = postcondmask | MeshModel::MM_VERTQUALITY; - - MLRenderingData dttoberendered; - QMap::Iterator existit = meshDoc()->meshDocStateData().find(mm->id()); + MultiViewer_Container* mvc = currentViewContainer(); + if ((meshDoc() != NULL) && (mvc != NULL)) + { + if (GLA() == NULL) + return; + MLSceneGLSharedDataContext* shared = mvc->sharedDataContext(); + if (shared != NULL) + { + for(MeshModel* mm = meshDoc()->nextMesh();mm != NULL;mm = meshDoc()->nextMesh(mm)) + { + if (mm == NULL) + continue; + //Just to be sure that the filter author didn't forget to add changing tags to the postCondition field + if ((mm->hasDataMask(MeshModel::MM_FACECOLOR)) && (fclasses & FilterPluginInterface::FaceColoring )) + postcondmask = postcondmask | MeshModel::MM_FACECOLOR; + + if ((mm->hasDataMask(MeshModel::MM_VERTCOLOR)) && (fclasses & FilterPluginInterface::VertexColoring )) + postcondmask = postcondmask | MeshModel::MM_VERTCOLOR; + + if ((mm->hasDataMask(MeshModel::MM_COLOR)) && (fclasses & FilterPluginInterface::MeshColoring )) + postcondmask = postcondmask | MeshModel::MM_COLOR; + + if ((mm->hasDataMask(MeshModel::MM_FACEQUALITY)) && (fclasses & FilterPluginInterface::Quality )) + postcondmask = postcondmask | MeshModel::MM_FACEQUALITY; + + if ((mm->hasDataMask(MeshModel::MM_VERTQUALITY)) && (fclasses & FilterPluginInterface::Quality )) + postcondmask = postcondmask | MeshModel::MM_VERTQUALITY; + + MLRenderingData dttoberendered; + QMap::Iterator existit = meshDoc()->meshDocStateData().find(mm->id()); if (existit != meshDoc()->meshDocStateData().end()) - { - - shared->getRenderInfoPerMeshView(mm->id(),GLA()->context(),dttoberendered); - int updatemask = MeshModel::MM_NONE; + { + + shared->getRenderInfoPerMeshView(mm->id(),GLA()->context(),dttoberendered); + int updatemask = MeshModel::MM_NONE; bool connectivitychanged = false; - if (((unsigned int)mm->cm.VN() != existit->_nvert) || ((unsigned int)mm->cm.FN() != existit->_nface) || - bool(postcondmask & MeshModel::MM_UNKNOWN) || bool(postcondmask & MeshModel::MM_VERTNUMBER) || - bool(postcondmask & MeshModel::MM_FACENUMBER) || bool(postcondmask & MeshModel::MM_FACEVERT) || - bool(postcondmask & MeshModel::MM_VERTFACETOPO) || bool(postcondmask & MeshModel::MM_FACEFACETOPO)) - { + if (((unsigned int)mm->cm.VN() != existit->_nvert) || ((unsigned int)mm->cm.FN() != existit->_nface) || + bool(postcondmask & MeshModel::MM_UNKNOWN) || bool(postcondmask & MeshModel::MM_VERTNUMBER) || + bool(postcondmask & MeshModel::MM_FACENUMBER) || bool(postcondmask & MeshModel::MM_FACEVERT) || + bool(postcondmask & MeshModel::MM_VERTFACETOPO) || bool(postcondmask & MeshModel::MM_FACEFACETOPO)) + { updatemask = MeshModel::MM_ALL; - connectivitychanged = true; - } - else - { - //masks differences bitwise operator (^) -> remove the attributes that didn't apparently change + the ones that for sure changed according to the postCondition function - //this operation has been introduced in order to minimize problems with filters that didn't declared properly the postCondition mask - updatemask = (existit->_mask ^ mm->dataMask()) | postcondmask; - connectivitychanged = false; - } - - MLRenderingData::RendAtts dttoupdate; - //1) we convert the meshmodel updating mask to a RendAtts structure - MLPoliciesStandAloneFunctions::fromMeshModelMaskToMLRenderingAtts(updatemask,dttoupdate); - //2) The correspondent bos to the updated rendering attributes are set to invalid - shared->meshAttributesUpdated(mm->id(),connectivitychanged,dttoupdate); - - //3) we took the current rendering modality for the mesh in the active gla - MLRenderingData curr; - shared->getRenderInfoPerMeshView(mm->id(),GLA()->context(),curr); - - //4) we add to the current rendering modality in the current GLArea just the minimum attributes having been updated - // WARNING!!!! There are priority policies - // ex1) suppose that the current rendering modality is PR_POINTS and ATT_VERTPOSITION, ATT_VERTNORMAL,ATT_VERTCOLOR - // if i updated, for instance, just the ATT_FACECOLOR, we switch off in the active GLArea the per ATT_VERTCOLOR attribute - // and turn on the ATT_FACECOLOR - // ex2) suppose that the current rendering modality is PR_POINTS and ATT_VERTPOSITION, ATT_VERTNORMAL,ATT_VERTCOLOR - // if i updated, for instance, both the ATT_FACECOLOR and the ATT_VERTCOLOR, we continue to render the updated value of the ATT_VERTCOLOR - // ex3) suppose that in all the GLAreas the current rendering modality is PR_POINTS and we run a surface reconstruction filter - // in the current GLA() we switch from the PR_POINTS to PR_SOLID primitive rendering modality. In the other GLArea we maintain the per points visualization - for(MLRenderingData::PRIMITIVE_MODALITY pm = MLRenderingData::PRIMITIVE_MODALITY(0);pm < MLRenderingData::PR_ARITY;pm = MLRenderingData::next(pm)) - { - bool wasprimitivemodalitymeaningful = MLPoliciesStandAloneFunctions::isPrimitiveModalityCompatibleWithMeshInfo((existit->_nvert > 0),(existit->_nface > 0),(existit->_nedge > 0),existit->_mask,pm); - bool isprimitivemodalitymeaningful = MLPoliciesStandAloneFunctions::isPrimitiveModalityCompatibleWithMesh(mm,pm); - bool isworthtobevisualized = MLPoliciesStandAloneFunctions::isPrimitiveModalityWorthToBeActivated(pm,curr.isPrimitiveActive(pm),wasprimitivemodalitymeaningful,isprimitivemodalitymeaningful); - - - MLRenderingData::RendAtts rd; + connectivitychanged = true; + } + else + { + //masks differences bitwise operator (^) -> remove the attributes that didn't apparently change + the ones that for sure changed according to the postCondition function + //this operation has been introduced in order to minimize problems with filters that didn't declared properly the postCondition mask + updatemask = (existit->_mask ^ mm->dataMask()) | postcondmask; + connectivitychanged = false; + } + + MLRenderingData::RendAtts dttoupdate; + //1) we convert the meshmodel updating mask to a RendAtts structure + MLPoliciesStandAloneFunctions::fromMeshModelMaskToMLRenderingAtts(updatemask,dttoupdate); + //2) The correspondent bos to the updated rendering attributes are set to invalid + shared->meshAttributesUpdated(mm->id(),connectivitychanged,dttoupdate); + + //3) we took the current rendering modality for the mesh in the active gla + MLRenderingData curr; + shared->getRenderInfoPerMeshView(mm->id(),GLA()->context(),curr); + + //4) we add to the current rendering modality in the current GLArea just the minimum attributes having been updated + // WARNING!!!! There are priority policies + // ex1) suppose that the current rendering modality is PR_POINTS and ATT_VERTPOSITION, ATT_VERTNORMAL,ATT_VERTCOLOR + // if i updated, for instance, just the ATT_FACECOLOR, we switch off in the active GLArea the per ATT_VERTCOLOR attribute + // and turn on the ATT_FACECOLOR + // ex2) suppose that the current rendering modality is PR_POINTS and ATT_VERTPOSITION, ATT_VERTNORMAL,ATT_VERTCOLOR + // if i updated, for instance, both the ATT_FACECOLOR and the ATT_VERTCOLOR, we continue to render the updated value of the ATT_VERTCOLOR + // ex3) suppose that in all the GLAreas the current rendering modality is PR_POINTS and we run a surface reconstruction filter + // in the current GLA() we switch from the PR_POINTS to PR_SOLID primitive rendering modality. In the other GLArea we maintain the per points visualization + for(MLRenderingData::PRIMITIVE_MODALITY pm = MLRenderingData::PRIMITIVE_MODALITY(0);pm < MLRenderingData::PR_ARITY;pm = MLRenderingData::next(pm)) + { + bool wasprimitivemodalitymeaningful = MLPoliciesStandAloneFunctions::isPrimitiveModalityCompatibleWithMeshInfo((existit->_nvert > 0),(existit->_nface > 0),(existit->_nedge > 0),existit->_mask,pm); + bool isprimitivemodalitymeaningful = MLPoliciesStandAloneFunctions::isPrimitiveModalityCompatibleWithMesh(mm,pm); + bool isworthtobevisualized = MLPoliciesStandAloneFunctions::isPrimitiveModalityWorthToBeActivated(pm,curr.isPrimitiveActive(pm),wasprimitivemodalitymeaningful,isprimitivemodalitymeaningful); + + + MLRenderingData::RendAtts rd; curr.get(pm, rd); MLPoliciesStandAloneFunctions::updatedRendAttsAccordingToPriorities(pm, dttoupdate, rd, rd); rd[MLRenderingData::ATT_NAMES::ATT_VERTPOSITION] = isworthtobevisualized; - MLPoliciesStandAloneFunctions::filterUselessUdpateAccordingToMeshMask(mm,rd); - curr.set(pm,rd); - } + MLPoliciesStandAloneFunctions::filterUselessUdpateAccordingToMeshMask(mm,rd); + curr.set(pm,rd); + } MLPerViewGLOptions opts; curr.get(opts); if (fclasses & FilterPluginInterface::MeshColoring) @@ -1073,7 +1073,7 @@ void MainWindow::updateSharedContextDataAfterFilterExecution(int postcondmask,in opts._perpoint_mesh_color_enabled = hasmeshcolor; opts._perwire_mesh_color_enabled = hasmeshcolor; opts._persolid_mesh_color_enabled = hasmeshcolor; - + for (MLRenderingData::PRIMITIVE_MODALITY pm = MLRenderingData::PRIMITIVE_MODALITY(0); pm < MLRenderingData::PR_ARITY; pm = MLRenderingData::next(pm)) { MLRenderingData::RendAtts atts; @@ -1085,8 +1085,8 @@ void MainWindow::updateSharedContextDataAfterFilterExecution(int postcondmask,in curr.set(opts); } MLPoliciesStandAloneFunctions::setPerViewGLOptionsAccordindToWireModality(mm, curr); - MLPoliciesStandAloneFunctions::setPerViewGLOptionsPriorities(curr); - + MLPoliciesStandAloneFunctions::setPerViewGLOptionsPriorities(curr); + if (mm == meshDoc()->mm()) { /*HORRIBLE TRICK IN ORDER TO HAVE VALID ACTIONS ASSOCIATED WITH THE CURRENT WIRE RENDERING MODALITY*/ @@ -1096,15 +1096,15 @@ void MainWindow::updateSharedContextDataAfterFilterExecution(int postcondmask,in delete fauxaction; /****************************************************************************************************/ } - - - shared->setRenderingDataPerMeshView(mm->id(),GLA()->context(),curr); - } - else - { - //A new mesh has been created by the filter. I have to add it in the shared context data structure - newmeshcreated = true; - MLPoliciesStandAloneFunctions::suggestedDefaultPerViewRenderingData(mm,dttoberendered,mwsettings.minpolygonpersmoothrendering); + + + shared->setRenderingDataPerMeshView(mm->id(),GLA()->context(),curr); + } + else + { + //A new mesh has been created by the filter. I have to add it in the shared context data structure + newmeshcreated = true; + MLPoliciesStandAloneFunctions::suggestedDefaultPerViewRenderingData(mm,dttoberendered,mwsettings.minpolygonpersmoothrendering); if (mm == meshDoc()->mm()) { /*HORRIBLE TRICK IN ORDER TO HAVE VALID ACTIONS ASSOCIATED WITH THE CURRENT WIRE RENDERING MODALITY*/ @@ -1115,16 +1115,16 @@ void MainWindow::updateSharedContextDataAfterFilterExecution(int postcondmask,in /****************************************************************************************************/ } foreach(GLArea* gla,mvc->viewerList) - { - if (gla != NULL) - shared->setRenderingDataPerMeshView(mm->id(),gla->context(),dttoberendered); - } + { + if (gla != NULL) + shared->setRenderingDataPerMeshView(mm->id(),gla->context(),dttoberendered); + } } shared->manageBuffers(mm->id()); - } + } updateLayerDialog(); - } - } + } + } } /* @@ -1138,75 +1138,75 @@ from the user defined dialog void MainWindow::executeFilter(const QAction* action, RichParameterList ¶ms, bool isPreview) { - FilterPluginInterface *iFilter = qobject_cast(action->parent()); - qb->show(); - iFilter->setLog(&meshDoc()->Log); - - // Ask for filter requirements (eg a filter can need topology, border flags etc) - // and satisfy them - qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); - MainWindow::globalStatusBar()->showMessage("Starting Filter...",5000); - int req=iFilter->getRequirements(action); - if (!meshDoc()->meshList.isEmpty()) - meshDoc()->mm()->updateDataMask(req); - qApp->restoreOverrideCursor(); - - // (3) save the current filter and its parameters in the history - if(!isPreview) - meshDoc()->Log.ClearBookmark(); - else - meshDoc()->Log.BackToBookmark(); - // (4) Apply the Filter - bool ret; - qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); - QElapsedTimer tt; tt.start(); - meshDoc()->setBusy(true); - RichParameterList mergedenvironment(params); - mergedenvironment.join(currentGlobalParams); - - MLSceneGLSharedDataContext* shar = NULL; - QGLWidget* filterWidget = NULL; - if (currentViewContainer() != NULL) - { - shar = currentViewContainer()->sharedDataContext(); - //GLA() is only the parent - filterWidget = new QGLWidget(NULL,shar); - QGLFormat defForm = QGLFormat::defaultFormat(); - iFilter->glContext = new MLPluginGLContext(defForm,filterWidget->context()->device(),*shar); - iFilter->glContext->create(filterWidget->context()); - - MLRenderingData dt; - MLRenderingData::RendAtts atts; - atts[MLRenderingData::ATT_NAMES::ATT_VERTPOSITION] = true; - atts[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL] = true; - - if (iFilter->filterArity(action) == FilterPluginInterface::SINGLE_MESH) - { - MLRenderingData::PRIMITIVE_MODALITY pm = MLPoliciesStandAloneFunctions::bestPrimitiveModalityAccordingToMesh(meshDoc()->mm()); - if ((pm != MLRenderingData::PR_ARITY) && (meshDoc()->mm() != NULL)) - { - dt.set(pm,atts); - iFilter->glContext->initPerViewRenderingData(meshDoc()->mm()->id(),dt); - } - } - else - { - for(int ii = 0;ii < meshDoc()->meshList.size();++ii) - { - MeshModel* mm = meshDoc()->meshList[ii]; - MLRenderingData::PRIMITIVE_MODALITY pm = MLPoliciesStandAloneFunctions::bestPrimitiveModalityAccordingToMesh(mm); - if ((pm != MLRenderingData::PR_ARITY) && (mm != NULL)) - { - dt.set(pm,atts); - iFilter->glContext->initPerViewRenderingData(mm->id(),dt); - } - } - } - } - bool newmeshcreated = false; - try - { - meshDoc()->meshDocStateData().clear(); + FilterPluginInterface *iFilter = qobject_cast(action->parent()); + qb->show(); + iFilter->setLog(&meshDoc()->Log); + + // Ask for filter requirements (eg a filter can need topology, border flags etc) + // and satisfy them + qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); + MainWindow::globalStatusBar()->showMessage("Starting Filter...",5000); + int req=iFilter->getRequirements(action); + if (!meshDoc()->meshList.isEmpty()) + meshDoc()->mm()->updateDataMask(req); + qApp->restoreOverrideCursor(); + + // (3) save the current filter and its parameters in the history + if(!isPreview) + meshDoc()->Log.ClearBookmark(); + else + meshDoc()->Log.BackToBookmark(); + // (4) Apply the Filter + bool ret; + qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); + QElapsedTimer tt; tt.start(); + meshDoc()->setBusy(true); + RichParameterList mergedenvironment(params); + mergedenvironment.join(currentGlobalParams); + + MLSceneGLSharedDataContext* shar = NULL; + QGLWidget* filterWidget = NULL; + if (currentViewContainer() != NULL) + { + shar = currentViewContainer()->sharedDataContext(); + //GLA() is only the parent + filterWidget = new QGLWidget(NULL,shar); + QGLFormat defForm = QGLFormat::defaultFormat(); + iFilter->glContext = new MLPluginGLContext(defForm,filterWidget->context()->device(),*shar); + iFilter->glContext->create(filterWidget->context()); + + MLRenderingData dt; + MLRenderingData::RendAtts atts; + atts[MLRenderingData::ATT_NAMES::ATT_VERTPOSITION] = true; + atts[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL] = true; + + if (iFilter->filterArity(action) == FilterPluginInterface::SINGLE_MESH) + { + MLRenderingData::PRIMITIVE_MODALITY pm = MLPoliciesStandAloneFunctions::bestPrimitiveModalityAccordingToMesh(meshDoc()->mm()); + if ((pm != MLRenderingData::PR_ARITY) && (meshDoc()->mm() != NULL)) + { + dt.set(pm,atts); + iFilter->glContext->initPerViewRenderingData(meshDoc()->mm()->id(),dt); + } + } + else + { + for(int ii = 0;ii < meshDoc()->meshList.size();++ii) + { + MeshModel* mm = meshDoc()->meshList[ii]; + MLRenderingData::PRIMITIVE_MODALITY pm = MLPoliciesStandAloneFunctions::bestPrimitiveModalityAccordingToMesh(mm); + if ((pm != MLRenderingData::PR_ARITY) && (mm != NULL)) + { + dt.set(pm,atts); + iFilter->glContext->initPerViewRenderingData(mm->id(),dt); + } + } + } + } + bool newmeshcreated = false; + try + { + meshDoc()->meshDocStateData().clear(); meshDoc()->meshDocStateData().create(*meshDoc()); unsigned int postCondMask = MeshModel::MM_UNKNOWN; ret=iFilter->applyFilter(action, *(meshDoc()), postCondMask, mergedenvironment, QCallBack); @@ -1214,121 +1214,121 @@ void MainWindow::executeFilter(const QAction* action, RichParameterList ¶ms, postCondMask = iFilter->postCondition(action); for (MeshModel* mm = meshDoc()->nextMesh(); mm != NULL; mm = meshDoc()->nextMesh(mm)) vcg::tri::Allocator::CompactEveryVector(mm->cm); - + if (shar != NULL) { shar->removeView(iFilter->glContext); delete filterWidget; } - - meshDoc()->setBusy(false); - - qApp->restoreOverrideCursor(); - - // (5) Apply post filter actions (e.g. recompute non updated stuff if needed) - - if(ret) - { - meshDoc()->Log.Logf(GLLogStream::SYSTEM,"Applied filter %s in %i msec",qUtf8Printable(action->text()),tt.elapsed()); - if (meshDoc()->mm() != NULL) + + meshDoc()->setBusy(false); + + qApp->restoreOverrideCursor(); + + // (5) Apply post filter actions (e.g. recompute non updated stuff if needed) + + if(ret) + { + meshDoc()->Log.Logf(GLLogStream::SYSTEM,"Applied filter %s in %i msec",qUtf8Printable(action->text()),tt.elapsed()); + if (meshDoc()->mm() != NULL) meshDoc()->mm()->setMeshModified(); - MainWindow::globalStatusBar()->showMessage("Filter successfully completed...",2000); - if(GLA()) - { - GLA()->setLastAppliedFilter(action); - } - lastFilterAct->setText(QString("Apply filter ") + action->text()); - lastFilterAct->setEnabled(true); - } - else // filter has failed. show the message error. - { - QMessageBox::warning(this, tr("Filter Failure"), QString("Failure of filter : '%1'

    ").arg(action->text())+iFilter->errorMsg()); // text - meshDoc()->Log.Logf(GLLogStream::SYSTEM,"Filter failed: %s",qUtf8Printable(iFilter->errorMsg())); - MainWindow::globalStatusBar()->showMessage("Filter failed...",2000); - } - - - FilterPluginInterface::FILTER_ARITY arity = iFilter->filterArity(action); - QList tmp; - switch(arity) - { - case (FilterPluginInterface::SINGLE_MESH): - { - tmp.push_back(meshDoc()->mm()); - break; - } - case (FilterPluginInterface::FIXED): - { - for(const RichParameter& p : mergedenvironment) - { - if (p.value().isMesh()) - { - MeshModel* mm = p.value().getMesh(); - if (mm != NULL) - tmp.push_back(mm); - } - } - break; - } - case (FilterPluginInterface::VARIABLE): - { - for(MeshModel* mm = meshDoc()->nextMesh();mm != NULL;mm=meshDoc()->nextMesh(mm)) - { - if (mm->isVisible()) - tmp.push_back(mm); - } - break; - } - default: - break; - } - - if(iFilter->getClass(action) & FilterPluginInterface::MeshCreation ) - GLA()->resetTrackBall(); - - for(int jj = 0;jj < tmp.size();++jj) - { - MeshModel* mm = tmp[jj]; - if (mm != NULL) - { - // at the end for filters that change the color, or selection set the appropriate rendering mode - if(iFilter->getClass(action) & FilterPluginInterface::FaceColoring ) - mm->updateDataMask(MeshModel::MM_FACECOLOR); - - if(iFilter->getClass(action) & FilterPluginInterface::VertexColoring ) - mm->updateDataMask(MeshModel::MM_VERTCOLOR); - - if(iFilter->getClass(action) & FilterPluginInterface::MeshColoring ) - mm->updateDataMask(MeshModel::MM_COLOR); - - if(postCondMask & MeshModel::MM_CAMERA) - mm->updateDataMask(MeshModel::MM_CAMERA); - - if(iFilter->getClass(action) & FilterPluginInterface::Texture ) - updateTexture(mm->id()); - } - } - - int fclasses = iFilter->getClass(action); - //MLSceneGLSharedDataContext* sharedcont = GLA()->getSceneGLSharedContext(); - - updateSharedContextDataAfterFilterExecution(postCondMask,fclasses,newmeshcreated); - meshDoc()->meshDocStateData().clear(); - } - catch (const std::bad_alloc& bdall) - { - meshDoc()->setBusy(false); - qApp->restoreOverrideCursor(); - QMessageBox::warning(this, tr("Filter Failure"), - QString("Operating system was not able to allocate the requested memory.
    " - "Failure of filter : '%1'
    ").arg(action->text())+bdall.what()); // text - MainWindow::globalStatusBar()->showMessage("Filter failed...",2000); - } - qb->reset(); - layerDialog->setVisible(layerDialog->isVisible() || ((newmeshcreated) && (meshDoc()->size() > 0))); - updateLayerDialog(); - updateMenus(); - MultiViewer_Container* mvc = currentViewContainer(); + MainWindow::globalStatusBar()->showMessage("Filter successfully completed...",2000); + if(GLA()) + { + GLA()->setLastAppliedFilter(action); + } + lastFilterAct->setText(QString("Apply filter ") + action->text()); + lastFilterAct->setEnabled(true); + } + else // filter has failed. show the message error. + { + QMessageBox::warning(this, tr("Filter Failure"), QString("Failure of filter : '%1'

    ").arg(action->text())+iFilter->errorMsg()); // text + meshDoc()->Log.Logf(GLLogStream::SYSTEM,"Filter failed: %s",qUtf8Printable(iFilter->errorMsg())); + MainWindow::globalStatusBar()->showMessage("Filter failed...",2000); + } + + + FilterPluginInterface::FILTER_ARITY arity = iFilter->filterArity(action); + QList tmp; + switch(arity) + { + case (FilterPluginInterface::SINGLE_MESH): + { + tmp.push_back(meshDoc()->mm()); + break; + } + case (FilterPluginInterface::FIXED): + { + for(const RichParameter& p : mergedenvironment) + { + if (p.value().isMesh()) + { + MeshModel* mm = p.value().getMesh(); + if (mm != NULL) + tmp.push_back(mm); + } + } + break; + } + case (FilterPluginInterface::VARIABLE): + { + for(MeshModel* mm = meshDoc()->nextMesh();mm != NULL;mm=meshDoc()->nextMesh(mm)) + { + if (mm->isVisible()) + tmp.push_back(mm); + } + break; + } + default: + break; + } + + if(iFilter->getClass(action) & FilterPluginInterface::MeshCreation ) + GLA()->resetTrackBall(); + + for(int jj = 0;jj < tmp.size();++jj) + { + MeshModel* mm = tmp[jj]; + if (mm != NULL) + { + // at the end for filters that change the color, or selection set the appropriate rendering mode + if(iFilter->getClass(action) & FilterPluginInterface::FaceColoring ) + mm->updateDataMask(MeshModel::MM_FACECOLOR); + + if(iFilter->getClass(action) & FilterPluginInterface::VertexColoring ) + mm->updateDataMask(MeshModel::MM_VERTCOLOR); + + if(iFilter->getClass(action) & FilterPluginInterface::MeshColoring ) + mm->updateDataMask(MeshModel::MM_COLOR); + + if(postCondMask & MeshModel::MM_CAMERA) + mm->updateDataMask(MeshModel::MM_CAMERA); + + if(iFilter->getClass(action) & FilterPluginInterface::Texture ) + updateTexture(mm->id()); + } + } + + int fclasses = iFilter->getClass(action); + //MLSceneGLSharedDataContext* sharedcont = GLA()->getSceneGLSharedContext(); + + updateSharedContextDataAfterFilterExecution(postCondMask,fclasses,newmeshcreated); + meshDoc()->meshDocStateData().clear(); + } + catch (const std::bad_alloc& bdall) + { + meshDoc()->setBusy(false); + qApp->restoreOverrideCursor(); + QMessageBox::warning(this, tr("Filter Failure"), + QString("Operating system was not able to allocate the requested memory.
    " + "Failure of filter : '%1'
    ").arg(action->text())+bdall.what()); // text + MainWindow::globalStatusBar()->showMessage("Filter failed...",2000); + } + qb->reset(); + layerDialog->setVisible(layerDialog->isVisible() || ((newmeshcreated) && (meshDoc()->size() > 0))); + updateLayerDialog(); + updateMenus(); + MultiViewer_Container* mvc = currentViewContainer(); if (mvc) { mvc->updateAllDecoratorsForAllViewers(); @@ -1346,117 +1346,117 @@ void MainWindow::executeFilter(const QAction* action, RichParameterList ¶ms, void MainWindow::suspendEditMode() { - // return if no window is open - if(!GLA()) return; - - // return if no editing action is currently ongoing - if(!GLA()->getCurrentEditAction()) return; - - GLA()->suspendEditToggle(); - updateMenus(); - GLA()->update(); + // return if no window is open + if(!GLA()) return; + + // return if no editing action is currently ongoing + if(!GLA()->getCurrentEditAction()) return; + + GLA()->suspendEditToggle(); + updateMenus(); + GLA()->update(); } void MainWindow::applyEditMode() { - if(!GLA()) { //prevents crash without mesh - QAction *action = qobject_cast(sender()); - action->setChecked(false); - return; - } - - QAction *action = qobject_cast(sender()); - - if(GLA()->getCurrentEditAction()) //prevents multiple buttons pushed - { - if(action==GLA()->getCurrentEditAction()) // We have double pressed the same action and that means disable that actioon - { - if(GLA()->suspendedEditor) - { - suspendEditMode(); - return; - } + if(!GLA()) { //prevents crash without mesh + QAction *action = qobject_cast(sender()); + action->setChecked(false); + return; + } + + QAction *action = qobject_cast(sender()); + + if(GLA()->getCurrentEditAction()) //prevents multiple buttons pushed + { + if(action==GLA()->getCurrentEditAction()) // We have double pressed the same action and that means disable that actioon + { + if(GLA()->suspendedEditor) + { + suspendEditMode(); + return; + } endEdit(); - updateMenus(); - return; - } - assert(0); // it should be impossible to start an action without having ended the previous one. - return; - } - - //if this GLArea does not have an instance of this action's MeshEdit tool then give it one - if(!GLA()->editorExistsForAction(action)) - { - EditPluginInterfaceFactory *iEditFactory = qobject_cast(action->parent()); - EditPluginInterface *iEdit = iEditFactory->getMeshEditInterface(action); - GLA()->addMeshEditor(action, iEdit); - } + updateMenus(); + return; + } + assert(0); // it should be impossible to start an action without having ended the previous one. + return; + } + + //if this GLArea does not have an instance of this action's MeshEdit tool then give it one + if(!GLA()->editorExistsForAction(action)) + { + EditPluginInterfaceFactory *iEditFactory = qobject_cast(action->parent()); + EditPluginInterface *iEdit = iEditFactory->getMeshEditInterface(action); + GLA()->addMeshEditor(action, iEdit); + } meshDoc()->meshDocStateData().create(*meshDoc()); - GLA()->setCurrentEditAction(action); - updateMenus(); - GLA()->update(); + GLA()->setCurrentEditAction(action); + updateMenus(); + GLA()->update(); } void MainWindow::applyRenderMode() { - QAction *action = qobject_cast(sender()); // find the action which has sent the signal - if ((GLA()!= NULL) && (GLA()->getRenderer() != NULL)) - { - GLA()->getRenderer()->Finalize(GLA()->getCurrentShaderAction(),meshDoc(),GLA()); - GLA()->setRenderer(NULL,NULL); - } - // Make the call to the plugin core - RenderPluginInterface *iRenderTemp = qobject_cast(action->parent()); - bool initsupport = false; - + QAction *action = qobject_cast(sender()); // find the action which has sent the signal + if ((GLA()!= NULL) && (GLA()->getRenderer() != NULL)) + { + GLA()->getRenderer()->Finalize(GLA()->getCurrentShaderAction(),meshDoc(),GLA()); + GLA()->setRenderer(NULL,NULL); + } + // Make the call to the plugin core + RenderPluginInterface *iRenderTemp = qobject_cast(action->parent()); + bool initsupport = false; + if (currentViewContainer() == NULL) return; - + MLSceneGLSharedDataContext* shared = currentViewContainer()->sharedDataContext(); - - if ((shared != NULL) && (iRenderTemp != NULL)) - { + + if ((shared != NULL) && (iRenderTemp != NULL)) + { MLSceneGLSharedDataContext::PerMeshRenderingDataMap rdmap; shared->getRenderInfoPerMeshView(GLA()->context(), rdmap); - iRenderTemp->Init(action,*(meshDoc()),rdmap, GLA()); - initsupport = iRenderTemp->isSupported(); - if (initsupport) - GLA()->setRenderer(iRenderTemp,action); - else - { - if (!initsupport) - { - QString msg = "The selected shader is not supported by your graphic hardware!"; - GLA()->Log(GLLogStream::SYSTEM,qUtf8Printable(msg)); - } - iRenderTemp->Finalize(action,meshDoc(),GLA()); - } - } - - /*I clicked None in renderMenu */ - if ((action->parent() == this) || (!initsupport)) - { - QString msg("No Shader."); - GLA()->Log(GLLogStream::SYSTEM,qUtf8Printable(msg)); - GLA()->setRenderer(0,0); //default opengl pipeline or vertex and fragment programs not supported - } - GLA()->update(); + iRenderTemp->Init(action,*(meshDoc()),rdmap, GLA()); + initsupport = iRenderTemp->isSupported(); + if (initsupport) + GLA()->setRenderer(iRenderTemp,action); + else + { + if (!initsupport) + { + QString msg = "The selected shader is not supported by your graphic hardware!"; + GLA()->Log(GLLogStream::SYSTEM,qUtf8Printable(msg)); + } + iRenderTemp->Finalize(action,meshDoc(),GLA()); + } + } + + /*I clicked None in renderMenu */ + if ((action->parent() == this) || (!initsupport)) + { + QString msg("No Shader."); + GLA()->Log(GLLogStream::SYSTEM,qUtf8Printable(msg)); + GLA()->setRenderer(0,0); //default opengl pipeline or vertex and fragment programs not supported + } + GLA()->update(); } void MainWindow::applyDecorateMode() { - if(GLA()->mm() == 0) return; - QAction *action = qobject_cast(sender()); // find the action which has sent the signal - - DecoratePluginInterface *iDecorateTemp = qobject_cast(action->parent()); - - GLA()->toggleDecorator(iDecorateTemp->decorationName(action)); - + if(GLA()->mm() == 0) return; + QAction *action = qobject_cast(sender()); // find the action which has sent the signal + + DecoratePluginInterface *iDecorateTemp = qobject_cast(action->parent()); + + GLA()->toggleDecorator(iDecorateTemp->decorationName(action)); + updateMenus(); - layerDialog->updateDecoratorParsView(); - layerDialog->updateLog(meshDoc()->Log); - layerDialog->update(); - GLA()->update(); + layerDialog->updateDecoratorParsView(); + layerDialog->updateLog(meshDoc()->Log); + layerDialog->update(); + GLA()->update(); } @@ -1465,394 +1465,394 @@ Save project. It saves the info of all the layers and the layer themselves. So */ void MainWindow::saveProject() { - if (meshDoc() == NULL) - return; - //if a mesh has been created by a create filter we must before to save it. Otherwise the project will refer to a mesh without file name path. - foreach(MeshModel * mp, meshDoc()->meshList) - { - if ((mp != NULL) && (mp->fullName().isEmpty())) - { - bool saved = exportMesh(tr(""),mp,false); - if (!saved) - { - QString msg = "Mesh layer " + mp->label() + " cannot be saved on a file.\nProject \"" + meshDoc()->docLabel() + "\" saving has been aborted."; - QMessageBox::warning(this,tr("Project Saving Aborted"),msg); - return; - } - } - } - QFileDialog* saveDiag = new QFileDialog(this,tr("Save Project File"),lastUsedDirectory.path().append(""), tr("MeshLab Project (*.mlp);;MeshLab Binary Project (*.mlb);;Align Project (*.aln)")); + if (meshDoc() == NULL) + return; + //if a mesh has been created by a create filter we must before to save it. Otherwise the project will refer to a mesh without file name path. + foreach(MeshModel * mp, meshDoc()->meshList) + { + if ((mp != NULL) && (mp->fullName().isEmpty())) + { + bool saved = exportMesh(tr(""),mp,false); + if (!saved) + { + QString msg = "Mesh layer " + mp->label() + " cannot be saved on a file.\nProject \"" + meshDoc()->docLabel() + "\" saving has been aborted."; + QMessageBox::warning(this,tr("Project Saving Aborted"),msg); + return; + } + } + } + QFileDialog* saveDiag = new QFileDialog(this,tr("Save Project File"),lastUsedDirectory.path().append(""), tr("MeshLab Project (*.mlp);;MeshLab Binary Project (*.mlb);;Align Project (*.aln)")); #if defined(Q_OS_WIN) - saveDiag->setOption(QFileDialog::DontUseNativeDialog); + saveDiag->setOption(QFileDialog::DontUseNativeDialog); #endif - QCheckBox* saveAllFile = new QCheckBox(QString("Save All Files"),saveDiag); - saveAllFile->setCheckState(Qt::Unchecked); - QCheckBox* onlyVisibleLayers = new QCheckBox(QString("Only Visible Layers"),saveDiag); - onlyVisibleLayers->setCheckState(Qt::Unchecked); + QCheckBox* saveAllFile = new QCheckBox(QString("Save All Files"),saveDiag); + saveAllFile->setCheckState(Qt::Unchecked); + QCheckBox* onlyVisibleLayers = new QCheckBox(QString("Only Visible Layers"),saveDiag); + onlyVisibleLayers->setCheckState(Qt::Unchecked); QCheckBox* saveViewState = new QCheckBox(QString("Save View State"), saveDiag); saveViewState->setCheckState(Qt::Checked); - QGridLayout* layout = qobject_cast(saveDiag->layout()); - if (layout != NULL) - { + QGridLayout* layout = qobject_cast(saveDiag->layout()); + if (layout != NULL) + { layout->addWidget(onlyVisibleLayers, 4, 0); layout->addWidget(saveViewState, 4, 1); layout->addWidget(saveAllFile, 4, 2); - } - saveDiag->setAcceptMode(QFileDialog::AcceptSave); - saveDiag->exec(); - QStringList files = saveDiag->selectedFiles(); - if (files.size() != 1) - return; - QString fileName = files[0]; - // this change of dir is needed for subsequent textures/materials loading - QFileInfo fi(fileName); - if (fi.isDir()) - return; - if (fi.suffix().isEmpty()) - { - QRegExp reg("\\.\\w+"); - saveDiag->selectedNameFilter().indexOf(reg); - QString ext = reg.cap(); - fileName.append(ext); - fi.setFile(fileName); - } - QDir::setCurrent(fi.absoluteDir().absolutePath()); - - /*********WARNING!!!!!! CHANGE IT!!! ALSO IN THE OPENPROJECT FUNCTION********/ - meshDoc()->setDocLabel(fileName); - QMdiSubWindow* sub = mdiarea->currentSubWindow(); - if (sub != NULL) - { - sub->setWindowTitle(meshDoc()->docLabel()); - layerDialog->setWindowTitle(meshDoc()->docLabel()); - } - /****************************************************************************/ - - - bool ret; + } + saveDiag->setAcceptMode(QFileDialog::AcceptSave); + saveDiag->exec(); + QStringList files = saveDiag->selectedFiles(); + if (files.size() != 1) + return; + QString fileName = files[0]; + // this change of dir is needed for subsequent textures/materials loading + QFileInfo fi(fileName); + if (fi.isDir()) + return; + if (fi.suffix().isEmpty()) + { + QRegExp reg("\\.\\w+"); + saveDiag->selectedNameFilter().indexOf(reg); + QString ext = reg.cap(); + fileName.append(ext); + fi.setFile(fileName); + } + QDir::setCurrent(fi.absoluteDir().absolutePath()); + + /*********WARNING!!!!!! CHANGE IT!!! ALSO IN THE OPENPROJECT FUNCTION********/ + meshDoc()->setDocLabel(fileName); + QMdiSubWindow* sub = mdiarea->currentSubWindow(); + if (sub != NULL) + { + sub->setWindowTitle(meshDoc()->docLabel()); + layerDialog->setWindowTitle(meshDoc()->docLabel()); + } + /****************************************************************************/ + + + bool ret; qDebug("Saving aln file %s\n", qUtf8Printable(fileName)); - if (fileName.isEmpty()) return; - else - { - //save path away so we can use it again - QString path = fileName; - path.truncate(path.lastIndexOf("/")); - lastUsedDirectory.setPath(path); - } - if (QString(fi.suffix()).toLower() == "aln") - { - vector meshNameVector; - vector transfVector; - - foreach(MeshModel * mp, meshDoc()->meshList) - { - if((!onlyVisibleLayers->isChecked()) || (mp->visible)) - { + if (fileName.isEmpty()) return; + else + { + //save path away so we can use it again + QString path = fileName; + path.truncate(path.lastIndexOf("/")); + lastUsedDirectory.setPath(path); + } + if (QString(fi.suffix()).toLower() == "aln") + { + vector meshNameVector; + vector transfVector; + + foreach(MeshModel * mp, meshDoc()->meshList) + { + if((!onlyVisibleLayers->isChecked()) || (mp->visible)) + { meshNameVector.push_back(qUtf8Printable(mp->relativePathName())); - transfVector.push_back(mp->cm.Tr); - } - } + transfVector.push_back(mp->cm.Tr); + } + } ret = ALNParser::SaveALN(qUtf8Printable(fileName), meshNameVector, transfVector); - } - else - { - std::map rendOpt; - foreach(MeshModel * mp, meshDoc()->meshList) - { - MLRenderingData ml; - getRenderingData(mp->id(), ml); - rendOpt.insert(std::pair(mp->id(), ml)); - } - ret = MeshDocumentToXMLFile(*meshDoc(), fileName, onlyVisibleLayers->isChecked(), saveViewState->isChecked(), QString(fi.suffix()).toLower() == "mlb", rendOpt); - } - - if (saveAllFile->isChecked()) - { - for(int ii = 0; ii < meshDoc()->meshList.size();++ii) - { - MeshModel* mp = meshDoc()->meshList[ii]; - if((!onlyVisibleLayers->isChecked()) || (mp->visible)) - { - ret |= exportMesh(mp->fullName(),mp,true); - } - } - } - if(!ret) - QMessageBox::critical(this, tr("Meshlab Saving Error"), QString("Unable to save project file %1\n").arg(fileName)); + } + else + { + std::map rendOpt; + foreach(MeshModel * mp, meshDoc()->meshList) + { + MLRenderingData ml; + getRenderingData(mp->id(), ml); + rendOpt.insert(std::pair(mp->id(), ml)); + } + ret = MeshDocumentToXMLFile(*meshDoc(), fileName, onlyVisibleLayers->isChecked(), saveViewState->isChecked(), QString(fi.suffix()).toLower() == "mlb", rendOpt); + } + + if (saveAllFile->isChecked()) + { + for(int ii = 0; ii < meshDoc()->meshList.size();++ii) + { + MeshModel* mp = meshDoc()->meshList[ii]; + if((!onlyVisibleLayers->isChecked()) || (mp->visible)) + { + ret |= exportMesh(mp->fullName(),mp,true); + } + } + } + if(!ret) + QMessageBox::critical(this, tr("Meshlab Saving Error"), QString("Unable to save project file %1\n").arg(fileName)); } bool MainWindow::openProject(QString fileName) { - bool visiblelayer = layerDialog->isVisible(); - //showLayerDlg(false); + bool visiblelayer = layerDialog->isVisible(); + //showLayerDlg(false); globrendtoolbar->setEnabled(false); - if (fileName.isEmpty()) - fileName = QFileDialog::getOpenFileName(this,tr("Open Project File"), lastUsedDirectory.path(), tr("All Project Files (*.mlp *.mlb *.aln *.out *.nvm);;MeshLab Project (*.mlp);;MeshLab Binary Project (*.mlb);;Align Project (*.aln);;Bundler Output (*.out);;VisualSFM Output (*.nvm)")); - - if (fileName.isEmpty()) return false; - - QFileInfo fi(fileName); - lastUsedDirectory = fi.absoluteDir(); - if((fi.suffix().toLower()!="aln") && (fi.suffix().toLower()!="mlp") && (fi.suffix().toLower() != "mlb") && (fi.suffix().toLower()!="out") && (fi.suffix().toLower()!="nvm")) - { - QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unknown project file extension"); - return false; - } - - // Common Part: init a Doc if necessary, and - bool activeDoc = (bool) !mdiarea->subWindowList().empty() && mdiarea->currentSubWindow(); - bool activeEmpty = activeDoc && meshDoc()->meshList.empty(); - - if (!activeEmpty) newProject(fileName); - - meshDoc()->setFileName(fileName); - mdiarea->currentSubWindow()->setWindowTitle(fileName); - meshDoc()->setDocLabel(fileName); - - meshDoc()->setBusy(true); - - // this change of dir is needed for subsequent textures/materials loading - QDir::setCurrent(fi.absoluteDir().absolutePath()); - qb->show(); - - if (QString(fi.suffix()).toLower() == "aln") - { - vector rmv; + if (fileName.isEmpty()) + fileName = QFileDialog::getOpenFileName(this,tr("Open Project File"), lastUsedDirectory.path(), tr("All Project Files (*.mlp *.mlb *.aln *.out *.nvm);;MeshLab Project (*.mlp);;MeshLab Binary Project (*.mlb);;Align Project (*.aln);;Bundler Output (*.out);;VisualSFM Output (*.nvm)")); + + if (fileName.isEmpty()) return false; + + QFileInfo fi(fileName); + lastUsedDirectory = fi.absoluteDir(); + if((fi.suffix().toLower()!="aln") && (fi.suffix().toLower()!="mlp") && (fi.suffix().toLower() != "mlb") && (fi.suffix().toLower()!="out") && (fi.suffix().toLower()!="nvm")) + { + QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unknown project file extension"); + return false; + } + + // Common Part: init a Doc if necessary, and + bool activeDoc = (bool) !mdiarea->subWindowList().empty() && mdiarea->currentSubWindow(); + bool activeEmpty = activeDoc && meshDoc()->meshList.empty(); + + if (!activeEmpty) newProject(fileName); + + meshDoc()->setFileName(fileName); + mdiarea->currentSubWindow()->setWindowTitle(fileName); + meshDoc()->setDocLabel(fileName); + + meshDoc()->setBusy(true); + + // this change of dir is needed for subsequent textures/materials loading + QDir::setCurrent(fi.absoluteDir().absolutePath()); + qb->show(); + + if (QString(fi.suffix()).toLower() == "aln") + { + vector rmv; int retVal = ALNParser::ParseALN(rmv, qUtf8Printable(fileName)); - if(retVal != ALNParser::NoError) - { - QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open ALN file"); - return false; - } - - bool openRes=true; - vector::iterator ir; - for(ir=rmv.begin();ir!=rmv.end() && openRes;++ir) - { - QString relativeToProj = fi.absoluteDir().absolutePath() + "/" + (*ir).filename.c_str(); - meshDoc()->addNewMesh(relativeToProj,relativeToProj); - openRes = loadMeshWithStandardParams(relativeToProj,this->meshDoc()->mm(),ir->trasformation); - if(!openRes) - meshDoc()->delMesh(meshDoc()->mm()); - } - } - - if (QString(fi.suffix()).toLower() == "mlp" || QString(fi.suffix()).toLower() == "mlb") - { - std::map rendOpt; - if (!MeshDocumentFromXML(*meshDoc(), fileName, (QString(fi.suffix()).toLower() == "mlb"), rendOpt)) - { - QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open MeshLab Project file"); - return false; - } + if(retVal != ALNParser::NoError) + { + QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open ALN file"); + return false; + } + + bool openRes=true; + vector::iterator ir; + for(ir=rmv.begin();ir!=rmv.end() && openRes;++ir) + { + QString relativeToProj = fi.absoluteDir().absolutePath() + "/" + (*ir).filename.c_str(); + meshDoc()->addNewMesh(relativeToProj,relativeToProj); + openRes = loadMeshWithStandardParams(relativeToProj,this->meshDoc()->mm(),ir->trasformation); + if(!openRes) + meshDoc()->delMesh(meshDoc()->mm()); + } + } + + if (QString(fi.suffix()).toLower() == "mlp" || QString(fi.suffix()).toLower() == "mlb") + { + std::map rendOpt; + if (!MeshDocumentFromXML(*meshDoc(), fileName, (QString(fi.suffix()).toLower() == "mlb"), rendOpt)) + { + QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open MeshLab Project file"); + return false; + } GLA()->updateMeshSetVisibilities(); - for (int i=0; imeshList.size(); i++) - { - QString fullPath = meshDoc()->meshList[i]->fullName(); - //meshDoc()->setBusy(true); - Matrix44m trm = this->meshDoc()->meshList[i]->cm.Tr; // save the matrix, because loadMeshClear it... - MLRenderingData* ptr = NULL; - if (rendOpt.find(meshDoc()->meshList[i]->id()) != rendOpt.end()) - ptr = &rendOpt[meshDoc()->meshList[i]->id()]; - if (!loadMeshWithStandardParams(fullPath, this->meshDoc()->meshList[i], trm, false, ptr)) - meshDoc()->delMesh(meshDoc()->meshList[i]); - } - } - - ////// BUNDLER - if (QString(fi.suffix()).toLower() == "out"){ - - QString cameras_filename = fileName; - QString image_list_filename; - QString model_filename; - - image_list_filename = QFileDialog::getOpenFileName( - this , tr("Open image list file"), - QFileInfo(fileName).absolutePath(), - tr("Bundler images list file (*.txt)") - ); - if(image_list_filename.isEmpty()) - return false; - - if(!MeshDocumentFromBundler(*meshDoc(),cameras_filename,image_list_filename,model_filename)){ - QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open OUTs file"); - return false; - } - - -//WARNING!!!!! i suppose it's not useful anymore but....... -/*GLA()->setColorMode(GLW::CMPerVert); + for (int i=0; imeshList.size(); i++) + { + QString fullPath = meshDoc()->meshList[i]->fullName(); + //meshDoc()->setBusy(true); + Matrix44m trm = this->meshDoc()->meshList[i]->cm.Tr; // save the matrix, because loadMeshClear it... + MLRenderingData* ptr = NULL; + if (rendOpt.find(meshDoc()->meshList[i]->id()) != rendOpt.end()) + ptr = &rendOpt[meshDoc()->meshList[i]->id()]; + if (!loadMeshWithStandardParams(fullPath, this->meshDoc()->meshList[i], trm, false, ptr)) + meshDoc()->delMesh(meshDoc()->meshList[i]); + } + } + + ////// BUNDLER + if (QString(fi.suffix()).toLower() == "out"){ + + QString cameras_filename = fileName; + QString image_list_filename; + QString model_filename; + + image_list_filename = QFileDialog::getOpenFileName( + this , tr("Open image list file"), + QFileInfo(fileName).absolutePath(), + tr("Bundler images list file (*.txt)") + ); + if(image_list_filename.isEmpty()) + return false; + + if(!MeshDocumentFromBundler(*meshDoc(),cameras_filename,image_list_filename,model_filename)){ + QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open OUTs file"); + return false; + } + + + //WARNING!!!!! i suppose it's not useful anymore but....... + /*GLA()->setColorMode(GLW::CMPerVert); GLA()->setDrawMode(GLW::DMPoints);*/ -///////////////////////////////////////////////////////// - } - - //////NVM - if (QString(fi.suffix()).toLower() == "nvm"){ - - QString cameras_filename = fileName; - QString model_filename; - - if(!MeshDocumentFromNvm(*meshDoc(),cameras_filename,model_filename)){ - QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open NVMs file"); - return false; - } -//WARNING!!!!! i suppose it's not useful anymore but....... -/*GLA()->setColorMode(GLW::CMPerVert); + ///////////////////////////////////////////////////////// + } + + //////NVM + if (QString(fi.suffix()).toLower() == "nvm"){ + + QString cameras_filename = fileName; + QString model_filename; + + if(!MeshDocumentFromNvm(*meshDoc(),cameras_filename,model_filename)){ + QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open NVMs file"); + return false; + } + //WARNING!!!!! i suppose it's not useful anymore but....... + /*GLA()->setColorMode(GLW::CMPerVert); GLA()->setDrawMode(GLW::DMPoints);*/ -///////////////////////////////////////////////////////// - } - - meshDoc()->setBusy(false); - if(this->GLA() == 0) return false; - - MultiViewer_Container* mvc = currentViewContainer(); + ///////////////////////////////////////////////////////// + } + + meshDoc()->setBusy(false); + if(this->GLA() == 0) return false; + + MultiViewer_Container* mvc = currentViewContainer(); if (mvc != NULL) { mvc->resetAllTrackBall(); mvc->updateAllDecoratorsForAllViewers(); } - + setCurrentMeshBestTab(); - qb->reset(); - saveRecentProjectList(fileName); + qb->reset(); + saveRecentProjectList(fileName); globrendtoolbar->setEnabled(true); - showLayerDlg(visiblelayer || (meshDoc()->meshList.size() > 0)); - - return true; + showLayerDlg(visiblelayer || (meshDoc()->meshList.size() > 0)); + + return true; } bool MainWindow::appendProject(QString fileName) { - QStringList fileNameList; + QStringList fileNameList; globrendtoolbar->setEnabled(false); - if (fileName.isEmpty()) - fileNameList = QFileDialog::getOpenFileNames(this, tr("Append Project File"), lastUsedDirectory.path(), "All Project Files (*.mlp *.mlb *.aln *.out *.nvm);;MeshLab Project (*.mlp);;MeshLab Binary Project (*.mlb);;Align Project (*.aln);;Bundler Output (*.out);;VisualSFM Output (*.nvm)"); - else - fileNameList.append(fileName); - - if (fileNameList.isEmpty()) return false; - - // Ccheck if we have a doc and if it is empty - bool activeDoc = (bool) !mdiarea->subWindowList().empty() && mdiarea->currentSubWindow(); + if (fileName.isEmpty()) + fileNameList = QFileDialog::getOpenFileNames(this, tr("Append Project File"), lastUsedDirectory.path(), "All Project Files (*.mlp *.mlb *.aln *.out *.nvm);;MeshLab Project (*.mlp);;MeshLab Binary Project (*.mlb);;Align Project (*.aln);;Bundler Output (*.out);;VisualSFM Output (*.nvm)"); + else + fileNameList.append(fileName); + + if (fileNameList.isEmpty()) return false; + + // Ccheck if we have a doc and if it is empty + bool activeDoc = (bool) !mdiarea->subWindowList().empty() && mdiarea->currentSubWindow(); if (!activeDoc || meshDoc()->meshList.empty()) // it is wrong to try appending to an empty project, even if it is possible - { - QMessageBox::critical(this, tr("Meshlab Opening Error"), "Current project is empty, cannot append"); - return false; - } - - meshDoc()->setBusy(true); - - // load all projects - foreach(fileName,fileNameList) - { - QFileInfo fi(fileName); - lastUsedDirectory = fi.absoluteDir(); - - if((fi.suffix().toLower()!="aln") && (fi.suffix().toLower()!="mlp") && (fi.suffix().toLower() != "mlb") && (fi.suffix().toLower() != "out") && (fi.suffix().toLower() != "nvm")) - { - QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unknown project file extension"); - return false; - } - - // this change of dir is needed for subsequent textures/materials loading - QDir::setCurrent(fi.absoluteDir().absolutePath()); - qb->show(); - - if (QString(fi.suffix()).toLower() == "aln") - { - vector rmv; + { + QMessageBox::critical(this, tr("Meshlab Opening Error"), "Current project is empty, cannot append"); + return false; + } + + meshDoc()->setBusy(true); + + // load all projects + foreach(fileName,fileNameList) + { + QFileInfo fi(fileName); + lastUsedDirectory = fi.absoluteDir(); + + if((fi.suffix().toLower()!="aln") && (fi.suffix().toLower()!="mlp") && (fi.suffix().toLower() != "mlb") && (fi.suffix().toLower() != "out") && (fi.suffix().toLower() != "nvm")) + { + QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unknown project file extension"); + return false; + } + + // this change of dir is needed for subsequent textures/materials loading + QDir::setCurrent(fi.absoluteDir().absolutePath()); + qb->show(); + + if (QString(fi.suffix()).toLower() == "aln") + { + vector rmv; int retVal = ALNParser::ParseALN(rmv, qUtf8Printable(fileName)); - if(retVal != ALNParser::NoError) - { - QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open ALN file"); - return false; - } - - for(vector::iterator ir=rmv.begin();ir!=rmv.end();++ir) - { - QString relativeToProj = fi.absoluteDir().absolutePath() + "/" + (*ir).filename.c_str(); - meshDoc()->addNewMesh(relativeToProj,relativeToProj); - if(!loadMeshWithStandardParams(relativeToProj,this->meshDoc()->mm(),(*ir).trasformation)) - meshDoc()->delMesh(meshDoc()->mm()); - } - } - - if (QString(fi.suffix()).toLower() == "mlp" || QString(fi.suffix()).toLower() == "mlb") - { + if(retVal != ALNParser::NoError) + { + QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open ALN file"); + return false; + } + + for(vector::iterator ir=rmv.begin();ir!=rmv.end();++ir) + { + QString relativeToProj = fi.absoluteDir().absolutePath() + "/" + (*ir).filename.c_str(); + meshDoc()->addNewMesh(relativeToProj,relativeToProj); + if(!loadMeshWithStandardParams(relativeToProj,this->meshDoc()->mm(),(*ir).trasformation)) + meshDoc()->delMesh(meshDoc()->mm()); + } + } + + if (QString(fi.suffix()).toLower() == "mlp" || QString(fi.suffix()).toLower() == "mlb") + { int alreadyLoadedNum = meshDoc()->meshList.size(); - std::map rendOpt; - if (!MeshDocumentFromXML(*meshDoc(),fileName, QString(fi.suffix()).toLower() == "mlb", rendOpt)) - { - QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open MeshLab Project file"); - return false; - } + std::map rendOpt; + if (!MeshDocumentFromXML(*meshDoc(),fileName, QString(fi.suffix()).toLower() == "mlb", rendOpt)) + { + QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open MeshLab Project file"); + return false; + } GLA()->updateMeshSetVisibilities(); for (int i = alreadyLoadedNum; imeshList.size(); i++) - { - QString fullPath = meshDoc()->meshList[i]->fullName(); - meshDoc()->setBusy(true); - Matrix44m trm = this->meshDoc()->meshList[i]->cm.Tr; // save the matrix, because loadMeshClear it... - MLRenderingData* ptr = NULL; - if (rendOpt.find(meshDoc()->meshList[i]->id()) != rendOpt.end()) - ptr = &rendOpt[meshDoc()->meshList[i]->id()]; - if(!loadMeshWithStandardParams(fullPath,this->meshDoc()->meshList[i],trm, false, ptr)) - meshDoc()->delMesh(meshDoc()->meshList[i]); - } - } - - if (QString(fi.suffix()).toLower() == "out") { - - QString cameras_filename = fileName; - QString image_list_filename; - QString model_filename; - - image_list_filename = QFileDialog::getOpenFileName( - this, tr("Open image list file"), - QFileInfo(fileName).absolutePath(), - tr("Bundler images list file (*.txt)") - ); - if (image_list_filename.isEmpty()) - return false; - - if (!MeshDocumentFromBundler(*meshDoc(), cameras_filename, image_list_filename, model_filename)) { - QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open OUTs file"); - return false; - } - } - - if (QString(fi.suffix()).toLower() == "nvm") { - - QString cameras_filename = fileName; - QString model_filename; - - if (!MeshDocumentFromNvm(*meshDoc(), cameras_filename, model_filename)) { - QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open NVMs file"); - return false; - } - } - } - + { + QString fullPath = meshDoc()->meshList[i]->fullName(); + meshDoc()->setBusy(true); + Matrix44m trm = this->meshDoc()->meshList[i]->cm.Tr; // save the matrix, because loadMeshClear it... + MLRenderingData* ptr = NULL; + if (rendOpt.find(meshDoc()->meshList[i]->id()) != rendOpt.end()) + ptr = &rendOpt[meshDoc()->meshList[i]->id()]; + if(!loadMeshWithStandardParams(fullPath,this->meshDoc()->meshList[i],trm, false, ptr)) + meshDoc()->delMesh(meshDoc()->meshList[i]); + } + } + + if (QString(fi.suffix()).toLower() == "out") { + + QString cameras_filename = fileName; + QString image_list_filename; + QString model_filename; + + image_list_filename = QFileDialog::getOpenFileName( + this, tr("Open image list file"), + QFileInfo(fileName).absolutePath(), + tr("Bundler images list file (*.txt)") + ); + if (image_list_filename.isEmpty()) + return false; + + if (!MeshDocumentFromBundler(*meshDoc(), cameras_filename, image_list_filename, model_filename)) { + QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open OUTs file"); + return false; + } + } + + if (QString(fi.suffix()).toLower() == "nvm") { + + QString cameras_filename = fileName; + QString model_filename; + + if (!MeshDocumentFromNvm(*meshDoc(), cameras_filename, model_filename)) { + QMessageBox::critical(this, tr("Meshlab Opening Error"), "Unable to open NVMs file"); + return false; + } + } + } + globrendtoolbar->setEnabled(true); - meshDoc()->setBusy(false); - if(this->GLA() == 0) return false; + meshDoc()->setBusy(false); + if(this->GLA() == 0) return false; MultiViewer_Container* mvc = currentViewContainer(); if (mvc != NULL) { mvc->updateAllDecoratorsForAllViewers(); mvc->resetAllTrackBall(); } - + setCurrentMeshBestTab(); - qb->reset(); - saveRecentProjectList(fileName); - return true; + qb->reset(); + saveRecentProjectList(fileName); + return true; } void MainWindow::setCurrentMeshBestTab() { if (layerDialog == NULL) return; - + MultiViewer_Container* mvc = currentViewContainer(); if (mvc != NULL) { @@ -1868,39 +1868,39 @@ void MainWindow::setCurrentMeshBestTab() void MainWindow::newProject(const QString& projName) { - if (gpumeminfo == NULL) - return; - MultiViewer_Container *mvcont = new MultiViewer_Container(*gpumeminfo,mwsettings.highprecision,mwsettings.perbatchprimitives,mwsettings.minpolygonpersmoothrendering,mdiarea); - connect(&mvcont->meshDoc,SIGNAL(meshAdded(int)),this,SLOT(meshAdded(int))); - connect(&mvcont->meshDoc,SIGNAL(meshRemoved(int)),this,SLOT(meshRemoved(int))); + if (gpumeminfo == NULL) + return; + MultiViewer_Container *mvcont = new MultiViewer_Container(*gpumeminfo,mwsettings.highprecision,mwsettings.perbatchprimitives,mwsettings.minpolygonpersmoothrendering,mdiarea); + connect(&mvcont->meshDoc,SIGNAL(meshAdded(int)),this,SLOT(meshAdded(int))); + connect(&mvcont->meshDoc,SIGNAL(meshRemoved(int)),this,SLOT(meshRemoved(int))); connect(&mvcont->meshDoc, SIGNAL(documentUpdated()), this, SLOT(documentUpdateRequested())); connect(mvcont, SIGNAL(closingMultiViewerContainer()), this, SLOT(closeCurrentDocument())); - mdiarea->addSubWindow(mvcont); - connect(mvcont,SIGNAL(updateMainWindowMenus()),this,SLOT(updateMenus())); - connect(mvcont,SIGNAL(updateDocumentViewer()),this,SLOT(updateLayerDialog())); + mdiarea->addSubWindow(mvcont); + connect(mvcont,SIGNAL(updateMainWindowMenus()),this,SLOT(updateMenus())); + connect(mvcont,SIGNAL(updateDocumentViewer()),this,SLOT(updateLayerDialog())); connect(&mvcont->meshDoc.Log, SIGNAL(logUpdated()), this, SLOT(updateLog())); - filterMenu->setEnabled(!filterMenu->actions().isEmpty()); - if (!filterMenu->actions().isEmpty()) - updateSubFiltersMenu(true,false); - GLArea *gla=new GLArea(this, mvcont, ¤tGlobalParams); + filterMenu->setEnabled(!filterMenu->actions().isEmpty()); + if (!filterMenu->actions().isEmpty()) + updateSubFiltersMenu(true,false); + GLArea *gla=new GLArea(this, mvcont, ¤tGlobalParams); //connect(gla, SIGNAL(insertRenderingDataForNewlyGeneratedMesh(int)), this, SLOT(addRenderingDataIfNewlyGeneratedMesh(int))); - mvcont->addView(gla, Qt::Horizontal); - - if (projName.isEmpty()) - { - static int docCounter = 1; - mvcont->meshDoc.setDocLabel(QString("Project_") + QString::number(docCounter)); - ++docCounter; - } - else - mvcont->meshDoc.setDocLabel(projName); - mvcont->setWindowTitle(mvcont->meshDoc.docLabel()); + mvcont->addView(gla, Qt::Horizontal); + + if (projName.isEmpty()) + { + static int docCounter = 1; + mvcont->meshDoc.setDocLabel(QString("Project_") + QString::number(docCounter)); + ++docCounter; + } + else + mvcont->meshDoc.setDocLabel(projName); + mvcont->setWindowTitle(mvcont->meshDoc.docLabel()); if (layerDialog != NULL) layerDialog->reset(); //if(mdiarea->isVisible()) - updateLayerDialog(); - mvcont->showMaximized(); - connect(mvcont->sharedDataContext(),SIGNAL(currentAllocatedGPUMem(int,int,int,int)),this,SLOT(updateGPUMemBar(int,int,int,int))); + updateLayerDialog(); + mvcont->showMaximized(); + connect(mvcont->sharedDataContext(),SIGNAL(currentAllocatedGPUMem(int,int,int,int)),this,SLOT(updateGPUMemBar(int,int,int,int))); } void MainWindow::documentUpdateRequested() @@ -1926,8 +1926,8 @@ void MainWindow::documentUpdateRequested() void MainWindow::updateGPUMemBar(int nv_allmem, int nv_currentallocated, int ati_free_tex, int ati_free_vbo) { #ifdef Q_OS_WIN - if (nvgpumeminfo != NULL) - { + if (nvgpumeminfo != NULL) + { if (nv_allmem + nv_currentallocated > 0) { nvgpumeminfo->setFormat("Mem %p% %v/%m MB"); @@ -1953,14 +1953,14 @@ void MainWindow::updateGPUMemBar(int nv_allmem, int nv_currentallocated, int ati nvgpumeminfo->setValue(0); nvgpumeminfo->setFixedWidth(300); } - } + } #else - //avoid unused parameter warning - (void) nv_allmem; - (void) nv_currentallocated; - (void) ati_free_tex; - (void) ati_free_vbo; - nvgpumeminfo->hide(); + //avoid unused parameter warning + (void) nv_allmem; + (void) nv_currentallocated; + (void) ati_free_tex; + (void) ati_free_vbo; + nvgpumeminfo->hide(); #endif } //WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -1977,225 +1977,225 @@ bool MainWindow::importRaster(const QString& fileImg) if (!GLA()) return false; } - - QStringList filters; - filters.push_back("Images (*.jpg *.png *.xpm)"); - filters.push_back("*.jpg"); - filters.push_back("*.png"); - filters.push_back("*.xpm"); - - QStringList fileNameList; - if (fileImg.isEmpty()) - fileNameList = QFileDialog::getOpenFileNames(this,tr("Open File"), lastUsedDirectory.path(), filters.join(";;")); - else - fileNameList.push_back(fileImg); - - foreach(QString fileName,fileNameList) - { - QFileInfo fi(fileName); - if( fi.suffix().toLower()=="png" || fi.suffix().toLower()=="xpm" || fi.suffix().toLower()=="jpg") - { - qb->show(); - - if(!fi.exists()) { - QString errorMsgFormat = "Unable to open file:\n\"%1\"\n\nError details: file %1 does not exist."; - QMessageBox::critical(this, tr("Meshlab Opening Error"), errorMsgFormat.arg(fileName)); - return false; - } - if(!fi.isReadable()) { - QString errorMsgFormat = "Unable to open file:\n\"%1\"\n\nError details: file %1 is not readable."; - QMessageBox::critical(this, tr("Meshlab Opening Error"), errorMsgFormat.arg(fileName)); - return false; - } - - this->meshDoc()->setBusy(true); - RasterModel *rm= meshDoc()->addNewRaster(); - rm->setLabel(fileImg); - rm->addPlane(new Plane(fileName,Plane::RGBA)); - meshDoc()->setBusy(false); - showLayerDlg(true); - - /// Intrinsics extraction from EXIF - /// If no CCD Width value is provided, the intrinsics are extracted using the Equivalent 35mm focal - /// If no or invalid EXIF info is found, the Intrinsics are initialized as a "plausible" 35mm sensor, with 50mm focal + + QStringList filters; + filters.push_back("Images (*.jpg *.png *.xpm)"); + filters.push_back("*.jpg"); + filters.push_back("*.png"); + filters.push_back("*.xpm"); + + QStringList fileNameList; + if (fileImg.isEmpty()) + fileNameList = QFileDialog::getOpenFileNames(this,tr("Open File"), lastUsedDirectory.path(), filters.join(";;")); + else + fileNameList.push_back(fileImg); + + foreach(QString fileName,fileNameList) + { + QFileInfo fi(fileName); + if( fi.suffix().toLower()=="png" || fi.suffix().toLower()=="xpm" || fi.suffix().toLower()=="jpg") + { + qb->show(); - ::ResetJpgfile(); + if(!fi.exists()) { + QString errorMsgFormat = "Unable to open file:\n\"%1\"\n\nError details: file %1 does not exist."; + QMessageBox::critical(this, tr("Meshlab Opening Error"), errorMsgFormat.arg(fileName)); + return false; + } + if(!fi.isReadable()) { + QString errorMsgFormat = "Unable to open file:\n\"%1\"\n\nError details: file %1 is not readable."; + QMessageBox::critical(this, tr("Meshlab Opening Error"), errorMsgFormat.arg(fileName)); + return false; + } + + this->meshDoc()->setBusy(true); + RasterModel *rm= meshDoc()->addNewRaster(); + rm->setLabel(fileImg); + rm->addPlane(new Plane(fileName,Plane::RGBA)); + meshDoc()->setBusy(false); + showLayerDlg(true); + + /// Intrinsics extraction from EXIF + /// If no CCD Width value is provided, the intrinsics are extracted using the Equivalent 35mm focal + /// If no or invalid EXIF info is found, the Intrinsics are initialized as a "plausible" 35mm sensor, with 50mm focal + + ::ResetJpgfile(); FILE * pFile = fopen(qUtf8Printable(fileName), "rb"); - - int ret = ::ReadJpegSections (pFile, READ_METADATA); - fclose(pFile); - if (!ret || (ImageInfo.CCDWidth==0.0f && ImageInfo.FocalLength35mmEquiv==0.0f)) - { - rm->shot.Intrinsics.ViewportPx = vcg::Point2i(rm->currentPlane->image.width(), rm->currentPlane->image.height()); - rm->shot.Intrinsics.CenterPx = Point2m(float(rm->currentPlane->image.width()/2.0), float(rm->currentPlane->image.width()/2.0)); - rm->shot.Intrinsics.PixelSizeMm[0]=36.0f/(float)rm->currentPlane->image.width(); - rm->shot.Intrinsics.PixelSizeMm[1]=rm->shot.Intrinsics.PixelSizeMm[0]; - rm->shot.Intrinsics.FocalMm = 50.0f; - } - else if (ImageInfo.CCDWidth!=0) - { - rm->shot.Intrinsics.ViewportPx = vcg::Point2i(ImageInfo.Width, ImageInfo.Height); - rm->shot.Intrinsics.CenterPx = Point2m(float(ImageInfo.Width/2.0), float(ImageInfo.Height/2.0)); - float ratio; - if (ImageInfo.Width>ImageInfo.Height) - ratio=(float)ImageInfo.Width/(float)ImageInfo.Height; - else - ratio=(float)ImageInfo.Height/(float)ImageInfo.Width; - rm->shot.Intrinsics.PixelSizeMm[0]=ImageInfo.CCDWidth/(float)ImageInfo.Width; - rm->shot.Intrinsics.PixelSizeMm[1]=ImageInfo.CCDWidth/((float)ImageInfo.Height*ratio); - rm->shot.Intrinsics.FocalMm = ImageInfo.FocalLength; - } - else - { - rm->shot.Intrinsics.ViewportPx = vcg::Point2i(ImageInfo.Width, ImageInfo.Height); - rm->shot.Intrinsics.CenterPx = Point2m(float(ImageInfo.Width/2.0), float(ImageInfo.Height/2.0)); - float ratioFocal=ImageInfo.FocalLength/ImageInfo.FocalLength35mmEquiv; - rm->shot.Intrinsics.PixelSizeMm[0]=(36.0f*ratioFocal)/(float)ImageInfo.Width; - rm->shot.Intrinsics.PixelSizeMm[1]=(24.0f*ratioFocal)/(float)ImageInfo.Height; - rm->shot.Intrinsics.FocalMm = ImageInfo.FocalLength; - } - + + int ret = ::ReadJpegSections (pFile, READ_METADATA); + fclose(pFile); + if (!ret || (ImageInfo.CCDWidth==0.0f && ImageInfo.FocalLength35mmEquiv==0.0f)) + { + rm->shot.Intrinsics.ViewportPx = vcg::Point2i(rm->currentPlane->image.width(), rm->currentPlane->image.height()); + rm->shot.Intrinsics.CenterPx = Point2m(float(rm->currentPlane->image.width()/2.0), float(rm->currentPlane->image.width()/2.0)); + rm->shot.Intrinsics.PixelSizeMm[0]=36.0f/(float)rm->currentPlane->image.width(); + rm->shot.Intrinsics.PixelSizeMm[1]=rm->shot.Intrinsics.PixelSizeMm[0]; + rm->shot.Intrinsics.FocalMm = 50.0f; + } + else if (ImageInfo.CCDWidth!=0) + { + rm->shot.Intrinsics.ViewportPx = vcg::Point2i(ImageInfo.Width, ImageInfo.Height); + rm->shot.Intrinsics.CenterPx = Point2m(float(ImageInfo.Width/2.0), float(ImageInfo.Height/2.0)); + float ratio; + if (ImageInfo.Width>ImageInfo.Height) + ratio=(float)ImageInfo.Width/(float)ImageInfo.Height; + else + ratio=(float)ImageInfo.Height/(float)ImageInfo.Width; + rm->shot.Intrinsics.PixelSizeMm[0]=ImageInfo.CCDWidth/(float)ImageInfo.Width; + rm->shot.Intrinsics.PixelSizeMm[1]=ImageInfo.CCDWidth/((float)ImageInfo.Height*ratio); + rm->shot.Intrinsics.FocalMm = ImageInfo.FocalLength; + } + else + { + rm->shot.Intrinsics.ViewportPx = vcg::Point2i(ImageInfo.Width, ImageInfo.Height); + rm->shot.Intrinsics.CenterPx = Point2m(float(ImageInfo.Width/2.0), float(ImageInfo.Height/2.0)); + float ratioFocal=ImageInfo.FocalLength/ImageInfo.FocalLength35mmEquiv; + rm->shot.Intrinsics.PixelSizeMm[0]=(36.0f*ratioFocal)/(float)ImageInfo.Width; + rm->shot.Intrinsics.PixelSizeMm[1]=(24.0f*ratioFocal)/(float)ImageInfo.Height; + rm->shot.Intrinsics.FocalMm = ImageInfo.FocalLength; + } + // End of EXIF reading - + //// Since no extrinsic are available, the current trackball is reset (except for the FOV) and assigned to the raster GLA()->resetTrackBall(); GLA()->fov = rm->shot.GetFovFromFocal(); rm->shot = GLA()->shotFromTrackball().first; GLA()->resetTrackBall(); // and then we reset the trackball again, to have the standard view - + if (_currviewcontainer != NULL) _currviewcontainer->updateAllDecoratorsForAllViewers(); - - // if(mdiarea->isVisible()) GLA()->mvc->showMaximized(); - updateMenus(); - updateLayerDialog(); - - } - else - return false; - } - return true; + + // if(mdiarea->isVisible()) GLA()->mvc->showMaximized(); + updateMenus(); + updateLayerDialog(); + + } + else + return false; + } + return true; } bool MainWindow::loadMesh(const QString& fileName, IOPluginInterface *pCurrentIOPlugin, MeshModel* mm, int& mask,RichParameterList* prePar, const Matrix44m &mtr, bool isareload, MLRenderingData* rendOpt) { - if ((GLA() == NULL) || (mm == NULL)) - return false; - - QFileInfo fi(fileName); - QString extension = fi.suffix(); - if(!fi.exists()) - { - QString errorMsgFormat = "Unable to open file:\n\"%1\"\n\nError details: file %1 does not exist."; - QMessageBox::critical(this, tr("Meshlab Opening Error"), errorMsgFormat.arg(fileName)); - return false; - } - if(!fi.isReadable()) - { - QString errorMsgFormat = "Unable to open file:\n\"%1\"\n\nError details: file %1 is not readable."; - QMessageBox::critical(this, tr("Meshlab Opening Error"), errorMsgFormat.arg(fileName)); - return false; - } - - // the original directory path before we switch it - QString origDir = QDir::current().path(); - - // this change of dir is needed for subsequent textures/materials loading - QDir::setCurrent(fi.absoluteDir().absolutePath()); - - // Adjust the file name after changing the directory - QString fileNameSansDir = fi.fileName(); - - // retrieving corresponding IO plugin - if (pCurrentIOPlugin == 0) - { - QString errorMsgFormat = "Error encountered while opening file:\n\"%1\"\n\nError details: The \"%2\" file extension does not correspond to any supported format."; - QMessageBox::critical(this, tr("Opening Error"), errorMsgFormat.arg(fileName, extension)); - QDir::setCurrent(origDir); // undo the change of directory before leaving - return false; - } - meshDoc()->setBusy(true); - pCurrentIOPlugin->setLog(&meshDoc()->Log); - - if (!pCurrentIOPlugin->open(extension, fileNameSansDir, *mm ,mask,*prePar,QCallBack,this /*gla*/)) - { - QMessageBox::warning(this, tr("Opening Failure"), QString("While opening: '%1'\n\n").arg(fileName)+pCurrentIOPlugin->errorMsg()); // text+ - pCurrentIOPlugin->clearErrorString(); - meshDoc()->setBusy(false); - QDir::setCurrent(origDir); // undo the change of directory before leaving - return false; - } - - + if ((GLA() == NULL) || (mm == NULL)) + return false; + + QFileInfo fi(fileName); + QString extension = fi.suffix(); + if(!fi.exists()) + { + QString errorMsgFormat = "Unable to open file:\n\"%1\"\n\nError details: file %1 does not exist."; + QMessageBox::critical(this, tr("Meshlab Opening Error"), errorMsgFormat.arg(fileName)); + return false; + } + if(!fi.isReadable()) + { + QString errorMsgFormat = "Unable to open file:\n\"%1\"\n\nError details: file %1 is not readable."; + QMessageBox::critical(this, tr("Meshlab Opening Error"), errorMsgFormat.arg(fileName)); + return false; + } + + // the original directory path before we switch it + QString origDir = QDir::current().path(); + + // this change of dir is needed for subsequent textures/materials loading + QDir::setCurrent(fi.absoluteDir().absolutePath()); + + // Adjust the file name after changing the directory + QString fileNameSansDir = fi.fileName(); + + // retrieving corresponding IO plugin + if (pCurrentIOPlugin == 0) + { + QString errorMsgFormat = "Error encountered while opening file:\n\"%1\"\n\nError details: The \"%2\" file extension does not correspond to any supported format."; + QMessageBox::critical(this, tr("Opening Error"), errorMsgFormat.arg(fileName, extension)); + QDir::setCurrent(origDir); // undo the change of directory before leaving + return false; + } + meshDoc()->setBusy(true); + pCurrentIOPlugin->setLog(&meshDoc()->Log); + + if (!pCurrentIOPlugin->open(extension, fileNameSansDir, *mm ,mask,*prePar,QCallBack,this /*gla*/)) + { + QMessageBox::warning(this, tr("Opening Failure"), QString("While opening: '%1'\n\n").arg(fileName)+pCurrentIOPlugin->errorMsg()); // text+ + pCurrentIOPlugin->clearErrorString(); + meshDoc()->setBusy(false); + QDir::setCurrent(origDir); // undo the change of directory before leaving + return false; + } + + //std::cout << "Opened mesh: in " << tm.elapsed() << " secs\n"; // After opening the mesh lets ask to the io plugin if this format - // requires some optional, or userdriven post-opening processing. - // and in that case ask for the required parameters and then - // ask to the plugin to perform that processing - //RichParameterSet par; - //pCurrentIOPlugin->initOpenParameter(extension, *mm, par); - //pCurrentIOPlugin->applyOpenParameter(extension, *mm, par); - - QString err = pCurrentIOPlugin->errorMsg(); - if (!err.isEmpty()) - { - QMessageBox::warning(this, tr("Opening Problems"), QString("While opening: '%1'\n\n").arg(fileName)+pCurrentIOPlugin->errorMsg()); - pCurrentIOPlugin->clearErrorString(); - } - - saveRecentFileList(fileName); - - if (!(mm->cm.textures.empty())) - updateTexture(mm->id()); - - // In case of polygonal meshes the normal should be updated accordingly - if( mask & vcg::tri::io::Mask::IOM_BITPOLYGONAL) - { - mm->updateDataMask(MeshModel::MM_POLYGONAL); // just to be sure. Hopefully it should be done in the plugin... - int degNum = tri::Clean::RemoveDegenerateFace(mm->cm); - if(degNum) - GLA()->Logf(0,"Warning model contains %i degenerate faces. Removed them.",degNum); - mm->updateDataMask(MeshModel::MM_FACEFACETOPO); - vcg::tri::UpdateNormal::PerBitQuadFaceNormalized(mm->cm); - vcg::tri::UpdateNormal::PerVertexFromCurrentFaceNormal(mm->cm); - } // standard case - else - { - vcg::tri::UpdateNormal::PerFaceNormalized(mm->cm); - if(!( mask & vcg::tri::io::Mask::IOM_VERTNORMAL) ) - vcg::tri::UpdateNormal::PerVertexAngleWeighted(mm->cm); - } - - vcg::tri::UpdateBounding::Box(mm->cm); // updates bounding box - if(mm->cm.fn==0 && mm->cm.en==0) - { - if(mask & vcg::tri::io::Mask::IOM_VERTNORMAL) - mm->updateDataMask(MeshModel::MM_VERTNORMAL); - } - - if(mm->cm.fn==0 && mm->cm.en>0) - { - if (mask & vcg::tri::io::Mask::IOM_VERTNORMAL) - mm->updateDataMask(MeshModel::MM_VERTNORMAL); - } - - updateMenus(); - int delVertNum = vcg::tri::Clean::RemoveDegenerateVertex(mm->cm); - int delFaceNum = vcg::tri::Clean::RemoveDegenerateFace(mm->cm); - tri::Allocator::CompactEveryVector(mm->cm); - if(delVertNum>0 || delFaceNum>0 ) - QMessageBox::warning(this, "MeshLab Warning", QString("Warning mesh contains %1 vertices with NAN coords and %2 degenerated faces.\nCorrected.").arg(delVertNum).arg(delFaceNum) ); - mm->cm.Tr = mtr; - + // requires some optional, or userdriven post-opening processing. + // and in that case ask for the required parameters and then + // ask to the plugin to perform that processing + //RichParameterSet par; + //pCurrentIOPlugin->initOpenParameter(extension, *mm, par); + //pCurrentIOPlugin->applyOpenParameter(extension, *mm, par); + + QString err = pCurrentIOPlugin->errorMsg(); + if (!err.isEmpty()) + { + QMessageBox::warning(this, tr("Opening Problems"), QString("While opening: '%1'\n\n").arg(fileName)+pCurrentIOPlugin->errorMsg()); + pCurrentIOPlugin->clearErrorString(); + } + + saveRecentFileList(fileName); + + if (!(mm->cm.textures.empty())) + updateTexture(mm->id()); + + // In case of polygonal meshes the normal should be updated accordingly + if( mask & vcg::tri::io::Mask::IOM_BITPOLYGONAL) + { + mm->updateDataMask(MeshModel::MM_POLYGONAL); // just to be sure. Hopefully it should be done in the plugin... + int degNum = tri::Clean::RemoveDegenerateFace(mm->cm); + if(degNum) + GLA()->Logf(0,"Warning model contains %i degenerate faces. Removed them.",degNum); + mm->updateDataMask(MeshModel::MM_FACEFACETOPO); + vcg::tri::UpdateNormal::PerBitQuadFaceNormalized(mm->cm); + vcg::tri::UpdateNormal::PerVertexFromCurrentFaceNormal(mm->cm); + } // standard case + else + { + vcg::tri::UpdateNormal::PerFaceNormalized(mm->cm); + if(!( mask & vcg::tri::io::Mask::IOM_VERTNORMAL) ) + vcg::tri::UpdateNormal::PerVertexAngleWeighted(mm->cm); + } + + vcg::tri::UpdateBounding::Box(mm->cm); // updates bounding box + if(mm->cm.fn==0 && mm->cm.en==0) + { + if(mask & vcg::tri::io::Mask::IOM_VERTNORMAL) + mm->updateDataMask(MeshModel::MM_VERTNORMAL); + } + + if(mm->cm.fn==0 && mm->cm.en>0) + { + if (mask & vcg::tri::io::Mask::IOM_VERTNORMAL) + mm->updateDataMask(MeshModel::MM_VERTNORMAL); + } + + updateMenus(); + int delVertNum = vcg::tri::Clean::RemoveDegenerateVertex(mm->cm); + int delFaceNum = vcg::tri::Clean::RemoveDegenerateFace(mm->cm); + tri::Allocator::CompactEveryVector(mm->cm); + if(delVertNum>0 || delFaceNum>0 ) + QMessageBox::warning(this, "MeshLab Warning", QString("Warning mesh contains %1 vertices with NAN coords and %2 degenerated faces.\nCorrected.").arg(delVertNum).arg(delFaceNum) ); + mm->cm.Tr = mtr; + computeRenderingDataOnLoading(mm,isareload, rendOpt); updateLayerDialog(); - - - meshDoc()->setBusy(false); - - QDir::setCurrent(origDir); // undo the change of directory before leaving - - return true; + + + meshDoc()->setBusy(false); + + QDir::setCurrent(origDir); // undo the change of directory before leaving + + return true; } void MainWindow::computeRenderingDataOnLoading(MeshModel* mm,bool isareload, MLRenderingData* rendOpt) @@ -2207,9 +2207,9 @@ void MainWindow::computeRenderingDataOnLoading(MeshModel* mm,bool isareload, MLR if ((shared != NULL) && (mm != NULL)) { MLRenderingData defdt; - MLPoliciesStandAloneFunctions::suggestedDefaultPerViewRenderingData(mm, defdt,mwsettings.minpolygonpersmoothrendering); - if (rendOpt != NULL) - defdt = *rendOpt; + MLPoliciesStandAloneFunctions::suggestedDefaultPerViewRenderingData(mm, defdt,mwsettings.minpolygonpersmoothrendering); + if (rendOpt != NULL) + defdt = *rendOpt; for (int glarid = 0; glarid < mv->viewerCounter(); ++glarid) { GLArea* ar = mv->getViewer(glarid); @@ -2238,194 +2238,194 @@ void MainWindow::computeRenderingDataOnLoading(MeshModel* mm,bool isareload, MLR bool MainWindow::importMeshWithLayerManagement(QString fileName) { - bool layervisible = false; - if (layerDialog != NULL) - { - layervisible = layerDialog->isVisible(); - //showLayerDlg(false); - } + bool layervisible = false; + if (layerDialog != NULL) + { + layervisible = layerDialog->isVisible(); + //showLayerDlg(false); + } globrendtoolbar->setEnabled(false); - bool res = importMesh(fileName,false); + bool res = importMesh(fileName,false); globrendtoolbar->setEnabled(true); if (layerDialog != NULL) showLayerDlg(layervisible || meshDoc()->meshList.size()); setCurrentMeshBestTab(); - return res; + return res; } // Opening files in a transparent form (IO plugins contribution is hidden to user) bool MainWindow::importMesh(QString fileName,bool isareload) { - if (!GLA()) - { - this->newProject(); - if(!GLA()) - return false; - } - - - //QStringList suffixList; - // HashTable storing all supported formats together with - // the (1-based) index of first plugin which is able to open it - //QHash allKnownFormats; - //PM.LoadFormats(suffixList, allKnownFormats,PluginManager::IMPORT); - QStringList fileNameList; - if (fileName.isEmpty()) - fileNameList = QFileDialog::getOpenFileNames(this,tr("Import Mesh"), lastUsedDirectory.path(), PM.inpFilters.join(";;")); - else - fileNameList.push_back(fileName); - - if (fileNameList.isEmpty()) return false; - else - { - //save path away so we can use it again - QString path = fileNameList.first(); - path.truncate(path.lastIndexOf("/")); - lastUsedDirectory.setPath(path); - } - - QElapsedTimer allFileTime; - allFileTime.start(); - foreach(fileName,fileNameList) - { - QFileInfo fi(fileName); - QString extension = fi.suffix(); - IOPluginInterface *pCurrentIOPlugin = PM.allKnowInputFormats[extension.toLower()]; - //pCurrentIOPlugin->setLog(gla->log); - if (pCurrentIOPlugin == NULL) - { - QString errorMsgFormat("Unable to open file:\n\"%1\"\n\nError details: file format " + extension + " not supported."); - QMessageBox::critical(this, tr("Meshlab Opening Error"), errorMsgFormat.arg(fileName)); - return false; - } - - RichParameterList prePar; - pCurrentIOPlugin->initPreOpenParameter(extension, fileName,prePar); - if(!prePar.isEmpty()) - { + if (!GLA()) + { + this->newProject(); + if(!GLA()) + return false; + } + + + //QStringList suffixList; + // HashTable storing all supported formats together with + // the (1-based) index of first plugin which is able to open it + //QHash allKnownFormats; + //PM.LoadFormats(suffixList, allKnownFormats,PluginManager::IMPORT); + QStringList fileNameList; + if (fileName.isEmpty()) + fileNameList = QFileDialog::getOpenFileNames(this,tr("Import Mesh"), lastUsedDirectory.path(), PM.inpFilters.join(";;")); + else + fileNameList.push_back(fileName); + + if (fileNameList.isEmpty()) return false; + else + { + //save path away so we can use it again + QString path = fileNameList.first(); + path.truncate(path.lastIndexOf("/")); + lastUsedDirectory.setPath(path); + } + + QElapsedTimer allFileTime; + allFileTime.start(); + foreach(fileName,fileNameList) + { + QFileInfo fi(fileName); + QString extension = fi.suffix(); + IOPluginInterface *pCurrentIOPlugin = PM.allKnowInputFormats[extension.toLower()]; + //pCurrentIOPlugin->setLog(gla->log); + if (pCurrentIOPlugin == NULL) + { + QString errorMsgFormat("Unable to open file:\n\"%1\"\n\nError details: file format " + extension + " not supported."); + QMessageBox::critical(this, tr("Meshlab Opening Error"), errorMsgFormat.arg(fileName)); + return false; + } + + RichParameterList prePar; + pCurrentIOPlugin->initPreOpenParameter(extension, fileName,prePar); + if(!prePar.isEmpty()) + { RichParameterListDialog preOpenDialog(this, prePar, tr("Pre-Open Options")); - preOpenDialog.setFocus(); - preOpenDialog.exec(); - } + preOpenDialog.setFocus(); + preOpenDialog.exec(); + } prePar.join(currentGlobalParams); - int mask = 0; - //MeshModel *mm= new MeshModel(gla->meshDoc); - QFileInfo info(fileName); + int mask = 0; + //MeshModel *mm= new MeshModel(gla->meshDoc); + QFileInfo info(fileName); MeshModel *mm = meshDoc()->addNewMesh(fileName, info.fileName()); - qb->show(); - QElapsedTimer t; + qb->show(); + QElapsedTimer t; t.start(); Matrix44m mtr; mtr.SetIdentity(); - bool open = loadMesh(fileName,pCurrentIOPlugin,mm,mask,&prePar,mtr,isareload); - if(open) - { + bool open = loadMesh(fileName,pCurrentIOPlugin,mm,mask,&prePar,mtr,isareload); + if(open) + { GLA()->Logf(0, "Opened mesh %s in %i msec", qUtf8Printable(fileName), t.elapsed()); - RichParameterList par; - pCurrentIOPlugin->initOpenParameter(extension, *mm, par); - if(!par.isEmpty()) - { + RichParameterList par; + pCurrentIOPlugin->initOpenParameter(extension, *mm, par); + if(!par.isEmpty()) + { RichParameterListDialog postOpenDialog(this, par, tr("Post-Open Processing")); - postOpenDialog.setFocus(); - postOpenDialog.exec(); - pCurrentIOPlugin->applyOpenParameter(extension, *mm, par); - } - /*MultiViewer_Container* mv = GLA()->mvc(); - if (mv != NULL) - { - for(int glarid = 0;glarid < mv->viewerCounter();++glarid) - { - GLArea* ar = mv->getViewer(glarid); - if (ar != NULL) - MLSceneRenderModeAdapter::setupRequestedAttributesAccordingToRenderMode(mm->id(),*ar); - } - }*/ - } - else - { - meshDoc()->delMesh(mm); + postOpenDialog.setFocus(); + postOpenDialog.exec(); + pCurrentIOPlugin->applyOpenParameter(extension, *mm, par); + } + /*MultiViewer_Container* mv = GLA()->mvc(); + if (mv != NULL) + { + for(int glarid = 0;glarid < mv->viewerCounter();++glarid) + { + GLArea* ar = mv->getViewer(glarid); + if (ar != NULL) + MLSceneRenderModeAdapter::setupRequestedAttributesAccordingToRenderMode(mm->id(),*ar); + } + }*/ + } + else + { + meshDoc()->delMesh(mm); GLA()->Logf(0, "Warning: Mesh %s has not been opened", qUtf8Printable(fileName)); - } - }// end foreach file of the input list - GLA()->Logf(0,"All files opened in %i msec",allFileTime.elapsed()); - + } + }// end foreach file of the input list + GLA()->Logf(0,"All files opened in %i msec",allFileTime.elapsed()); + if (_currviewcontainer != NULL) { _currviewcontainer->resetAllTrackBall(); _currviewcontainer->updateAllDecoratorsForAllViewers(); } qb->reset(); - return true; + return true; } void MainWindow::openRecentMesh() { - if(!GLA()) return; - if(meshDoc()->isBusy()) return; - QAction *action = qobject_cast(sender()); - if (action) importMeshWithLayerManagement(action->data().toString()); + if(!GLA()) return; + if(meshDoc()->isBusy()) return; + QAction *action = qobject_cast(sender()); + if (action) importMeshWithLayerManagement(action->data().toString()); } void MainWindow::openRecentProj() { - QAction *action = qobject_cast(sender()); - if (action) openProject(action->data().toString()); + QAction *action = qobject_cast(sender()); + if (action) openProject(action->data().toString()); } bool MainWindow::loadMeshWithStandardParams(QString& fullPath, MeshModel* mm, const Matrix44m &mtr, bool isreload, MLRenderingData* rendOpt) { - if ((meshDoc() == NULL) || (mm == NULL)) - return false; - bool ret = false; - if (!mm->isVisible()) - { - mm->Clear(); - mm->visible = false; - } - else - mm->Clear(); - QFileInfo fi(fullPath); - QString extension = fi.suffix(); - IOPluginInterface *pCurrentIOPlugin = PM.allKnowInputFormats[extension.toLower()]; - - if(pCurrentIOPlugin != NULL) - { - RichParameterList prePar; - pCurrentIOPlugin->initPreOpenParameter(extension, fullPath,prePar); + if ((meshDoc() == NULL) || (mm == NULL)) + return false; + bool ret = false; + if (!mm->isVisible()) + { + mm->Clear(); + mm->visible = false; + } + else + mm->Clear(); + QFileInfo fi(fullPath); + QString extension = fi.suffix(); + IOPluginInterface *pCurrentIOPlugin = PM.allKnowInputFormats[extension.toLower()]; + + if(pCurrentIOPlugin != NULL) + { + RichParameterList prePar; + pCurrentIOPlugin->initPreOpenParameter(extension, fullPath,prePar); prePar.join(currentGlobalParams); - int mask = 0; - QElapsedTimer t;t.start(); - bool open = loadMesh(fullPath,pCurrentIOPlugin,mm,mask,&prePar,mtr,isreload, rendOpt); - if(open) - { + int mask = 0; + QElapsedTimer t;t.start(); + bool open = loadMesh(fullPath,pCurrentIOPlugin,mm,mask,&prePar,mtr,isreload, rendOpt); + if(open) + { GLA()->Logf(0, "Opened mesh %s in %i msec", qUtf8Printable(fullPath), t.elapsed()); - RichParameterList par; - pCurrentIOPlugin->initOpenParameter(extension, *mm, par); - pCurrentIOPlugin->applyOpenParameter(extension,*mm,par); - ret = true; - } - else + RichParameterList par; + pCurrentIOPlugin->initOpenParameter(extension, *mm, par); + pCurrentIOPlugin->applyOpenParameter(extension,*mm,par); + ret = true; + } + else GLA()->Logf(0, "Warning: Mesh %s has not been opened", qUtf8Printable(fullPath)); - } - else + } + else GLA()->Logf(0, "Warning: Mesh %s cannot be opened. Your MeshLab version has not plugin to read %s file format", qUtf8Printable(fullPath), qUtf8Printable(extension)); - return ret; + return ret; } void MainWindow::reloadAllMesh() { - // Discards changes and reloads current file - // save current file name - qb->show(); - foreach(MeshModel *mmm,meshDoc()->meshList) - { - QString fileName = mmm->fullName(); + // Discards changes and reloads current file + // save current file name + qb->show(); + foreach(MeshModel *mmm,meshDoc()->meshList) + { + QString fileName = mmm->fullName(); Matrix44m mat; mat.SetIdentity(); - loadMeshWithStandardParams(fileName,mmm,mat,true); - } - qb->reset(); - + loadMeshWithStandardParams(fileName,mmm,mat,true); + } + qb->reset(); + if (_currviewcontainer != NULL) { _currviewcontainer->updateAllDecoratorsForAllViewers(); @@ -2435,12 +2435,12 @@ void MainWindow::reloadAllMesh() void MainWindow::reload() { - if ((meshDoc() == NULL) || (meshDoc()->mm() == NULL)) - return; - // Discards changes and reloads current file - // save current file name - qb->show(); - QString fileName = meshDoc()->mm()->fullName(); + if ((meshDoc() == NULL) || (meshDoc()->mm() == NULL)) + return; + // Discards changes and reloads current file + // save current file name + qb->show(); + QString fileName = meshDoc()->mm()->fullName(); if (fileName.isEmpty()) { QMessageBox::critical(this, "Reload Error", "Impossible to reload an unsaved mesh model!!"); @@ -2448,8 +2448,8 @@ void MainWindow::reload() } Matrix44m mat; mat.SetIdentity(); - loadMeshWithStandardParams(fileName,meshDoc()->mm(),mat,true); - qb->reset(); + loadMeshWithStandardParams(fileName,meshDoc()->mm(),mat,true); + qb->reset(); if (_currviewcontainer != NULL) { _currviewcontainer->updateAllDecoratorsForAllViewers(); @@ -2460,7 +2460,7 @@ void MainWindow::reload() bool MainWindow::exportMesh(QString fileName,MeshModel* mod,const bool saveAllPossibleAttributes) { QStringList& suffixList = PM.outFilters; - + //QHash allKnownFormats; QFileInfo fi(fileName); //PM.LoadFormats( suffixList, allKnownFormats,PluginManager::EXPORT); @@ -2471,100 +2471,100 @@ bool MainWindow::exportMesh(QString fileName,MeshModel* mod,const bool saveAllPo if (mod == NULL) return false; mod->setMeshModified(false); - QString laylabel = "Save \"" + mod->label() + "\" Layer"; - QString ss = fi.absoluteFilePath(); - QFileDialog* saveDialog = new QFileDialog(this,laylabel, fi.absolutePath()); + QString laylabel = "Save \"" + mod->label() + "\" Layer"; + QString ss = fi.absoluteFilePath(); + QFileDialog* saveDialog = new QFileDialog(this,laylabel, fi.absolutePath()); #if defined(Q_OS_WIN) - saveDialog->setOption(QFileDialog::DontUseNativeDialog); + saveDialog->setOption(QFileDialog::DontUseNativeDialog); #endif - saveDialog->setNameFilters(suffixList); - saveDialog->setAcceptMode(QFileDialog::AcceptSave); - saveDialog->setFileMode(QFileDialog::AnyFile); - saveDialog->selectFile(fileName); - QStringList matchingExtensions=suffixList.filter(defaultExt); - if(!matchingExtensions.isEmpty()) - saveDialog->selectNameFilter(matchingExtensions.last()); - connect(saveDialog,SIGNAL(filterSelected(const QString&)),this,SLOT(changeFileExtension(const QString&))); - - if (fileName.isEmpty()){ - saveDialog->selectFile(meshDoc()->mm()->fullName()); - int dialogRet = saveDialog->exec(); - if(dialogRet==QDialog::Rejected ) - return false; - fileName=saveDialog->selectedFiles ().first(); - QFileInfo fni(fileName); - if(fni.suffix().isEmpty()) - { - QString ext = saveDialog->selectedNameFilter(); - ext.chop(1); ext = ext.right(4); - fileName = fileName + ext; + saveDialog->setNameFilters(suffixList); + saveDialog->setAcceptMode(QFileDialog::AcceptSave); + saveDialog->setFileMode(QFileDialog::AnyFile); + saveDialog->selectFile(fileName); + QStringList matchingExtensions=suffixList.filter(defaultExt); + if(!matchingExtensions.isEmpty()) + saveDialog->selectNameFilter(matchingExtensions.last()); + connect(saveDialog,SIGNAL(filterSelected(const QString&)),this,SLOT(changeFileExtension(const QString&))); + + if (fileName.isEmpty()){ + saveDialog->selectFile(meshDoc()->mm()->fullName()); + int dialogRet = saveDialog->exec(); + if(dialogRet==QDialog::Rejected ) + return false; + fileName=saveDialog->selectedFiles ().first(); + QFileInfo fni(fileName); + if(fni.suffix().isEmpty()) + { + QString ext = saveDialog->selectedNameFilter(); + ext.chop(1); ext = ext.right(4); + fileName = fileName + ext; qDebug("File without extension adding it by hand '%s'", qUtf8Printable(fileName)); - } - } - - - bool ret = false; - - QStringList fs = fileName.split("."); - - if(!fileName.isEmpty() && fs.size() < 2) - { - QMessageBox::warning(this,"Save Error","You must specify file extension!!"); - return ret; - } - - if (!fileName.isEmpty()) - { - //save path away so we can use it again - QString path = fileName; - path.truncate(path.lastIndexOf("/")); - lastUsedDirectory.setPath(path); - - QString extension = fileName; - extension.remove(0, fileName.lastIndexOf('.')+1); - - QStringListIterator itFilter(suffixList); - - IOPluginInterface *pCurrentIOPlugin = PM.allKnowOutputFormats[extension.toLower()]; - if (pCurrentIOPlugin == 0) - { - QMessageBox::warning(this, "Unknown type", "File extension not supported!"); - return false; - } - //MeshIOInterface* pCurrentIOPlugin = meshIOPlugins[idx-1]; - pCurrentIOPlugin->setLog(&meshDoc()->Log); - - int capability=0,defaultBits=0; - pCurrentIOPlugin->GetExportMaskCapability(extension,capability,defaultBits); - - // optional saving parameters (like ascii/binary encoding) - RichParameterList savePar; - - pCurrentIOPlugin->initSaveParameter(extension,*(mod),savePar); - - SaveMaskExporterDialog maskDialog(new QWidget(),mod,capability,defaultBits,&savePar,this->GLA()); - if (!saveAllPossibleAttributes) - maskDialog.exec(); - else - { - maskDialog.SlotSelectionAllButton(); - maskDialog.updateMask(); - } - int mask = maskDialog.GetNewMask(); - if (!saveAllPossibleAttributes) - { - maskDialog.close(); - if(maskDialog.result() == QDialog::Rejected) - return false; - } - if(mask == -1) - return false; - - qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); - qb->show(); - QElapsedTimer tt; tt.start(); - ret = pCurrentIOPlugin->save(extension, fileName, *mod ,mask,savePar,QCallBack,this); - qb->reset(); + } + } + + + bool ret = false; + + QStringList fs = fileName.split("."); + + if(!fileName.isEmpty() && fs.size() < 2) + { + QMessageBox::warning(this,"Save Error","You must specify file extension!!"); + return ret; + } + + if (!fileName.isEmpty()) + { + //save path away so we can use it again + QString path = fileName; + path.truncate(path.lastIndexOf("/")); + lastUsedDirectory.setPath(path); + + QString extension = fileName; + extension.remove(0, fileName.lastIndexOf('.')+1); + + QStringListIterator itFilter(suffixList); + + IOPluginInterface *pCurrentIOPlugin = PM.allKnowOutputFormats[extension.toLower()]; + if (pCurrentIOPlugin == 0) + { + QMessageBox::warning(this, "Unknown type", "File extension not supported!"); + return false; + } + //MeshIOInterface* pCurrentIOPlugin = meshIOPlugins[idx-1]; + pCurrentIOPlugin->setLog(&meshDoc()->Log); + + int capability=0,defaultBits=0; + pCurrentIOPlugin->GetExportMaskCapability(extension,capability,defaultBits); + + // optional saving parameters (like ascii/binary encoding) + RichParameterList savePar; + + pCurrentIOPlugin->initSaveParameter(extension,*(mod),savePar); + + SaveMaskExporterDialog maskDialog(new QWidget(),mod,capability,defaultBits,&savePar,this->GLA()); + if (!saveAllPossibleAttributes) + maskDialog.exec(); + else + { + maskDialog.SlotSelectionAllButton(); + maskDialog.updateMask(); + } + int mask = maskDialog.GetNewMask(); + if (!saveAllPossibleAttributes) + { + maskDialog.close(); + if(maskDialog.result() == QDialog::Rejected) + return false; + } + if(mask == -1) + return false; + + qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); + qb->show(); + QElapsedTimer tt; tt.start(); + ret = pCurrentIOPlugin->save(extension, fileName, *mod ,mask,savePar,QCallBack,this); + qb->reset(); if (ret) { GLA()->Logf(GLLogStream::SYSTEM, "Saved Mesh %s in %i msec", qUtf8Printable(fileName), tt.elapsed()); @@ -2578,94 +2578,94 @@ bool MainWindow::exportMesh(QString fileName,MeshModel* mod,const bool saveAllPo GLA()->Logf(GLLogStream::SYSTEM, "Error Saving Mesh %s", qUtf8Printable(fileName)); QMessageBox::critical(this, tr("Meshlab Saving Error"), pCurrentIOPlugin->errorMessage); } - qApp->restoreOverrideCursor(); + qApp->restoreOverrideCursor(); updateLayerDialog(); - + if (ret) QDir::setCurrent(fi.absoluteDir().absolutePath()); //set current dir - } - return ret; + } + return ret; } void MainWindow::changeFileExtension(const QString& st) { - QFileDialog* fd = qobject_cast(sender()); - if (fd == NULL) - return; - QRegExp extlist("\\*.\\w+"); - int start = st.indexOf(extlist); - (void)start; - QString ext = extlist.cap().remove("*"); - QStringList stlst = fd->selectedFiles(); - if (!stlst.isEmpty()) - { - QFileInfo fi(stlst[0]); - fd->selectFile(fi.baseName() + ext); - } + QFileDialog* fd = qobject_cast(sender()); + if (fd == NULL) + return; + QRegExp extlist("\\*.\\w+"); + int start = st.indexOf(extlist); + (void)start; + QString ext = extlist.cap().remove("*"); + QStringList stlst = fd->selectedFiles(); + if (!stlst.isEmpty()) + { + QFileInfo fi(stlst[0]); + fd->selectFile(fi.baseName() + ext); + } } bool MainWindow::save(const bool saveAllPossibleAttributes) { - return exportMesh(meshDoc()->mm()->fullName(),meshDoc()->mm(),saveAllPossibleAttributes); + return exportMesh(meshDoc()->mm()->fullName(),meshDoc()->mm(),saveAllPossibleAttributes); } bool MainWindow::saveAs(QString fileName,const bool saveAllPossibleAttributes) { - return exportMesh(fileName,meshDoc()->mm(),saveAllPossibleAttributes); + return exportMesh(fileName,meshDoc()->mm(),saveAllPossibleAttributes); } void MainWindow::readViewFromFile(QString const& filename){ - if(GLA() != 0) - GLA()->readViewFromFile(filename); + if(GLA() != 0) + GLA()->readViewFromFile(filename); } bool MainWindow::saveSnapshot() { if (!GLA()) return false; if (meshDoc()->isBusy()) return false; - - SaveSnapshotDialog dialog(this); - dialog.setValues(GLA()->ss); - - if (dialog.exec()==QDialog::Accepted) - { - GLA()->ss=dialog.getValues(); - GLA()->saveSnapshot(); - return true; - } - - return false; + + SaveSnapshotDialog dialog(this); + dialog.setValues(GLA()->ss); + + if (dialog.exec()==QDialog::Accepted) + { + GLA()->ss=dialog.getValues(); + GLA()->saveSnapshot(); + return true; + } + + return false; } void MainWindow::about() { - QDialog *about_dialog = new QDialog(); - Ui::aboutDialog temp; - temp.setupUi(about_dialog); - temp.labelMLName->setText(MeshLabApplication::completeName(MeshLabApplication::HW_ARCHITECTURE(QSysInfo::WordSize))+" (built on "+__DATE__+")"); - //about_dialog->setFixedSize(566,580); - about_dialog->show(); + QDialog *about_dialog = new QDialog(); + Ui::aboutDialog temp; + temp.setupUi(about_dialog); + temp.labelMLName->setText(MeshLabApplication::completeName(MeshLabApplication::HW_ARCHITECTURE(QSysInfo::WordSize))+" (built on "+__DATE__+")"); + //about_dialog->setFixedSize(566,580); + about_dialog->show(); } void MainWindow::aboutPlugins() { - qDebug( "aboutPlugins(): Current Plugins Dir: %s ",qUtf8Printable(pluginManager().getDefaultPluginDirPath())); - PluginDialog dialog(pluginManager().getDefaultPluginDirPath(), pluginManager().pluginsLoaded, this); - dialog.exec(); + qDebug( "aboutPlugins(): Current Plugins Dir: %s ",qUtf8Printable(pluginManager().getDefaultPluginDirPath())); + PluginDialog dialog(pluginManager().getDefaultPluginDirPath(), pluginManager().pluginsLoaded, this); + dialog.exec(); } void MainWindow::helpOnscreen() { - if(GLA()) GLA()->toggleHelpVisible(); + if(GLA()) GLA()->toggleHelpVisible(); } void MainWindow::helpOnline() { - checkForUpdates(false); - QDesktopServices::openUrl(QUrl("http://www.meshlab.net/#support")); + checkForUpdates(false); + QDesktopServices::openUrl(QUrl("http://www.meshlab.net/#support")); } void MainWindow::showToolbarFile(){ - mainToolBar->setVisible(!mainToolBar->isVisible()); + mainToolBar->setVisible(!mainToolBar->isVisible()); } void MainWindow::showInfoPane() {if(GLA() != 0) GLA()->infoAreaVisible =!GLA()->infoAreaVisible;} @@ -2674,60 +2674,60 @@ void MainWindow::resetTrackBall(){if(GLA() != 0) GLA()->resetTrackBall();} void MainWindow::showRaster() {if(GLA() != 0) GLA()->showRaster((QApplication::keyboardModifiers () & Qt::ShiftModifier));} void MainWindow::showLayerDlg(bool visible) { - if ((GLA() != 0) && (layerDialog != NULL)) - { - layerDialog->setVisible( visible); - showLayerDlgAct->setChecked(visible); - } + if ((GLA() != 0) && (layerDialog != NULL)) + { + layerDialog->setVisible( visible); + showLayerDlgAct->setChecked(visible); + } } void MainWindow::setCustomize() { - MeshLabSettingsDialog dialog(currentGlobalParams,defaultGlobalParams, this); + MeshLabSettingsDialog dialog(currentGlobalParams,defaultGlobalParams, this); connect(&dialog, SIGNAL(applyCustomSetting()), this, SLOT(updateCustomSettings())); - dialog.exec(); + dialog.exec(); } void MainWindow::fullScreen(){ - if(!isFullScreen()) - { - toolbarState = saveState(); - menuBar()->hide(); - mainToolBar->hide(); - globalStatusBar()->hide(); - setWindowState(windowState()^Qt::WindowFullScreen); - bool found=true; - //Caso di piu' finestre aperte in tile: - if((mdiarea->subWindowList()).size()>1){ - foreach(QWidget *w,mdiarea->subWindowList()){if(w->isMaximized()) found=false;} - if (found)mdiarea->tileSubWindows(); - } - } - else - { - menuBar()->show(); - restoreState(toolbarState); - globalStatusBar()->show(); - - setWindowState(windowState()^ Qt::WindowFullScreen); - bool found=true; - //Caso di piu' finestre aperte in tile: - if((mdiarea->subWindowList()).size()>1){ - foreach(QWidget *w,mdiarea->subWindowList()){if(w->isMaximized()) found=false;} - if (found){mdiarea->tileSubWindows();} - } - fullScreenAct->setChecked(false); - } + if(!isFullScreen()) + { + toolbarState = saveState(); + menuBar()->hide(); + mainToolBar->hide(); + globalStatusBar()->hide(); + setWindowState(windowState()^Qt::WindowFullScreen); + bool found=true; + //Caso di piu' finestre aperte in tile: + if((mdiarea->subWindowList()).size()>1){ + foreach(QWidget *w,mdiarea->subWindowList()){if(w->isMaximized()) found=false;} + if (found)mdiarea->tileSubWindows(); + } + } + else + { + menuBar()->show(); + restoreState(toolbarState); + globalStatusBar()->show(); + + setWindowState(windowState()^ Qt::WindowFullScreen); + bool found=true; + //Caso di piu' finestre aperte in tile: + if((mdiarea->subWindowList()).size()>1){ + foreach(QWidget *w,mdiarea->subWindowList()){if(w->isMaximized()) found=false;} + if (found){mdiarea->tileSubWindows();} + } + fullScreenAct->setChecked(false); + } } void MainWindow::keyPressEvent(QKeyEvent *e) { - if(e->key()==Qt::Key_Return && e->modifiers()==Qt::AltModifier) - { - fullScreen(); - e->accept(); - } - else e->ignore(); + if(e->key()==Qt::Key_Return && e->modifiers()==Qt::AltModifier) + { + fullScreen(); + e->accept(); + } + else e->ignore(); } /** @@ -2741,7 +2741,7 @@ bool MainWindow::QCallBack(const int pos, const char * str) int static lastPos = -1; if (pos == lastPos) return true; lastPos = pos; - + static QElapsedTimer currTime; if (currTime.isValid() && currTime.elapsed() < 100) return true; @@ -2752,82 +2752,82 @@ bool MainWindow::QCallBack(const int pos, const char * str) qb->setValue(pos); MainWindow::globalStatusBar()->update(); qApp->processEvents(); - return true; + return true; } void MainWindow::updateTexture(int meshid) { - MultiViewer_Container* mvc = currentViewContainer(); - if ((mvc == NULL) || (meshDoc() == NULL)) - return; - - MLSceneGLSharedDataContext* shared = mvc->sharedDataContext(); - if (shared == NULL) - return; - - MeshModel* mymesh = meshDoc()->getMesh(meshid); - if (mymesh == NULL) - return; - - shared->deAllocateTexturesPerMesh(mymesh->id()); - - int textmemMB = int(mwsettings.maxTextureMemory / ((float) 1024 * 1024)); - - size_t totalTextureNum = 0; - foreach (MeshModel *mp, meshDoc()->meshList) - totalTextureNum+=mp->cm.textures.size(); - - int singleMaxTextureSizeMpx = int(textmemMB/((totalTextureNum != 0)? totalTextureNum : 1)); - bool sometextfailed = false; - QString unexistingtext = "In mesh file " + mymesh->fullName() + " : Failure loading textures:
    "; - for(size_t i =0; i< mymesh->cm.textures.size();++i) - { - QImage img; - QFileInfo fi(mymesh->cm.textures[i].c_str()); - QString filename = fi.absoluteFilePath(); - bool res = img.load(filename); - sometextfailed = sometextfailed || !res; - if(!res) - { - res = img.load(filename); - if(!res) - { - QString errmsg = QString("Failure of loading texture %1").arg(fi.fileName()); - meshDoc()->Log.Log(GLLogStream::WARNING,qUtf8Printable(errmsg)); - unexistingtext += "" + filename + "
    "; - } - } - -/*PLEASE EXPLAIN ME!*********************************************************************************************************************************************************************************/ - //if(!res && filename.endsWith("dds",Qt::CaseInsensitive)) - //{ - // qDebug("DDS binding!"); - // int newTexId = shared->bindTexture(filename); - // shared->txtcont.push_back(newTexId); - //} -/*PLEASE EXPLAIN ME!*********************************************************************************************************************************************************************************/ - - if (!res) - res = img.load(":/images/dummy.png"); - GLuint textid = shared->allocateTexturePerMesh(meshid,img,singleMaxTextureSizeMpx); - - if (sometextfailed) - QMessageBox::warning(this,"Texture file has not been correctly loaded",unexistingtext); - - for(int tt = 0;tt < mvc->viewerCounter();++tt) - { - GLArea* ar = mvc->getViewer(tt); - if (ar != NULL) - ar->setupTextureEnv(textid); - } - } - if (sometextfailed) - QMessageBox::warning(this,"Texture file has not been correctly loaded",unexistingtext); + MultiViewer_Container* mvc = currentViewContainer(); + if ((mvc == NULL) || (meshDoc() == NULL)) + return; + + MLSceneGLSharedDataContext* shared = mvc->sharedDataContext(); + if (shared == NULL) + return; + + MeshModel* mymesh = meshDoc()->getMesh(meshid); + if (mymesh == NULL) + return; + + shared->deAllocateTexturesPerMesh(mymesh->id()); + + int textmemMB = int(mwsettings.maxTextureMemory / ((float) 1024 * 1024)); + + size_t totalTextureNum = 0; + foreach (MeshModel *mp, meshDoc()->meshList) + totalTextureNum+=mp->cm.textures.size(); + + int singleMaxTextureSizeMpx = int(textmemMB/((totalTextureNum != 0)? totalTextureNum : 1)); + bool sometextfailed = false; + QString unexistingtext = "In mesh file " + mymesh->fullName() + " : Failure loading textures:
    "; + for(size_t i =0; i< mymesh->cm.textures.size();++i) + { + QImage img; + QFileInfo fi(mymesh->cm.textures[i].c_str()); + QString filename = fi.absoluteFilePath(); + bool res = img.load(filename); + sometextfailed = sometextfailed || !res; + if(!res) + { + res = img.load(filename); + if(!res) + { + QString errmsg = QString("Failure of loading texture %1").arg(fi.fileName()); + meshDoc()->Log.Log(GLLogStream::WARNING,qUtf8Printable(errmsg)); + unexistingtext += "" + filename + "
    "; + } + } + + /*PLEASE EXPLAIN ME!*********************************************************************************************************************************************************************************/ + //if(!res && filename.endsWith("dds",Qt::CaseInsensitive)) + //{ + // qDebug("DDS binding!"); + // int newTexId = shared->bindTexture(filename); + // shared->txtcont.push_back(newTexId); + //} + /*PLEASE EXPLAIN ME!*********************************************************************************************************************************************************************************/ + + if (!res) + res = img.load(":/images/dummy.png"); + GLuint textid = shared->allocateTexturePerMesh(meshid,img,singleMaxTextureSizeMpx); + + if (sometextfailed) + QMessageBox::warning(this,"Texture file has not been correctly loaded",unexistingtext); + + for(int tt = 0;tt < mvc->viewerCounter();++tt) + { + GLArea* ar = mvc->getViewer(tt); + if (ar != NULL) + ar->setupTextureEnv(textid); + } + } + if (sometextfailed) + QMessageBox::warning(this,"Texture file has not been correctly loaded",unexistingtext); } void MainWindow::updateProgressBar( const int pos,const QString& text ) { - this->QCallBack(pos,qUtf8Printable(text)); + this->QCallBack(pos,qUtf8Printable(text)); } //WARNING!!!! Probably it's useless @@ -2920,10 +2920,10 @@ void MainWindow::showEvent(QShowEvent * event) { QWidget::showEvent(event); QSettings settings; - QSettings::setDefaultFormat(QSettings::NativeFormat); + QSettings::setDefaultFormat(QSettings::NativeFormat); const QString versioncheckeddatestring("lastTimeMeshLabVersionCheckedOnStart"); QDate today = QDate::currentDate(); - QString todayStr = today.toString(); + QString todayStr = today.toString(); if (settings.contains(versioncheckeddatestring)) { QDate lasttimechecked = QDate::fromString(settings.value(versioncheckeddatestring).toString()); @@ -2943,52 +2943,52 @@ void MainWindow::showEvent(QShowEvent * event) void MainWindow::meshAdded(int mid) { - MultiViewer_Container* mvc = currentViewContainer(); - if (mvc != NULL) - { - MLSceneGLSharedDataContext* shared = mvc->sharedDataContext(); - if (shared != NULL) - { - shared->meshInserted(mid); - QList contlist; - for(int glarid = 0;glarid < mvc->viewerCounter();++glarid) - { - GLArea* ar = mvc->getViewer(glarid); - if (ar != NULL) - contlist.push_back(ar->context()); - } - MLRenderingData defdt; - if (meshDoc() != NULL) - { - MeshModel* mm = meshDoc()->getMesh(mid); - if (mm != NULL) - { - for(int glarid = 0;glarid < mvc->viewerCounter();++glarid) - { - GLArea* ar = mvc->getViewer(glarid); - if (ar != NULL) - shared->setRenderingDataPerMeshView(mid,ar->context(),defdt); - } - shared->manageBuffers(mid); - } + MultiViewer_Container* mvc = currentViewContainer(); + if (mvc != NULL) + { + MLSceneGLSharedDataContext* shared = mvc->sharedDataContext(); + if (shared != NULL) + { + shared->meshInserted(mid); + QList contlist; + for(int glarid = 0;glarid < mvc->viewerCounter();++glarid) + { + GLArea* ar = mvc->getViewer(glarid); + if (ar != NULL) + contlist.push_back(ar->context()); + } + MLRenderingData defdt; + if (meshDoc() != NULL) + { + MeshModel* mm = meshDoc()->getMesh(mid); + if (mm != NULL) + { + for(int glarid = 0;glarid < mvc->viewerCounter();++glarid) + { + GLArea* ar = mvc->getViewer(glarid); + if (ar != NULL) + shared->setRenderingDataPerMeshView(mid,ar->context(),defdt); + } + shared->manageBuffers(mid); + } //layerDialog->setVisible(meshDoc()->meshList.size() > 0); updateLayerDialog(); - } - } - - } + } + } + + } } void MainWindow::meshRemoved(int mid) { - MultiViewer_Container* mvc = currentViewContainer(); - if (mvc != NULL) - { - MLSceneGLSharedDataContext* shared = mvc->sharedDataContext(); - if (shared != NULL) - shared->meshRemoved(mid); - } - updateLayerDialog(); + MultiViewer_Container* mvc = currentViewContainer(); + if (mvc != NULL) + { + MLSceneGLSharedDataContext* shared = mvc->sharedDataContext(); + if (shared != NULL) + shared->meshRemoved(mid); + } + updateLayerDialog(); } void MainWindow::getRenderingData( int mid,MLRenderingData& dt) const @@ -2996,7 +2996,7 @@ void MainWindow::getRenderingData( int mid,MLRenderingData& dt) const if (mid == -1) { //if (GLA() != NULL) - //GLA()->getPerDocGlobalRenderingData(dt); + //GLA()->getPerDocGlobalRenderingData(dt); } else { @@ -3042,31 +3042,31 @@ void MainWindow::setRenderingData(int mid,const MLRenderingData& dt) void MainWindow::addRenderingSystemLogInfo(unsigned mmid) { - MultiViewer_Container* cont = currentViewContainer(); - if (cont != NULL) - { - MLRenderingData::DebugInfo deb; - MLSceneGLSharedDataContext* share = cont->sharedDataContext(); - if ((share != NULL) && (GLA() != NULL)) - { - share->getLog(mmid,deb); - MeshModel* mm = meshDoc()->getMesh(mmid); - if (mm != NULL) - { - QString data = QString(deb._currentlyallocated.c_str()) + "\n" + QString(deb._tobedeallocated.c_str()) + "\n" + QString(deb._tobeallocated.c_str()) + "\n" + QString(deb._tobeupdated.c_str()) + "\n"; - for(std::vector::iterator it = deb._perviewdata.begin();it != deb._perviewdata.end();++it) - data += QString((*it).c_str()) + "
    "; - meshDoc()->Log.Log(GLLogStream::SYSTEM, data); - } - } - } + MultiViewer_Container* cont = currentViewContainer(); + if (cont != NULL) + { + MLRenderingData::DebugInfo deb; + MLSceneGLSharedDataContext* share = cont->sharedDataContext(); + if ((share != NULL) && (GLA() != NULL)) + { + share->getLog(mmid,deb); + MeshModel* mm = meshDoc()->getMesh(mmid); + if (mm != NULL) + { + QString data = QString(deb._currentlyallocated.c_str()) + "\n" + QString(deb._tobedeallocated.c_str()) + "\n" + QString(deb._tobeallocated.c_str()) + "\n" + QString(deb._tobeupdated.c_str()) + "\n"; + for(std::vector::iterator it = deb._perviewdata.begin();it != deb._perviewdata.end();++it) + data += QString((*it).c_str()) + "
    "; + meshDoc()->Log.Log(GLLogStream::SYSTEM, data); + } + } + } } void MainWindow::updateRenderingDataAccordingToActionsCommonCode(int meshid, const QList& acts) { if (meshDoc() == NULL) return; - + MLRenderingData olddt; getRenderingData(meshid, olddt); MLRenderingData dt(olddt); @@ -3082,7 +3082,7 @@ void MainWindow::updateRenderingDataAccordingToActionsCommonCode(int meshid, con MLPoliciesStandAloneFunctions::computeRequestedRenderingDataCompatibleWithMeshSameGLOpts(mm, dt, dt); } setRenderingData(meshid, dt); - + /*if (meshid == -1) { foreach(MeshModel* mm, meshDoc()->meshList) @@ -3096,13 +3096,13 @@ void MainWindow::updateRenderingDataAccordingToActionsCommonCode(int meshid, con } else {*/ - if (mm != NULL) - { - MLDefaultMeshDecorators dec(this); - dec.updateMeshDecorationData(*mm, olddt, dt); - } + if (mm != NULL) + { + MLDefaultMeshDecorators dec(this); + dec.updateMeshDecorationData(*mm, olddt, dt); + } /*}*/ - + } @@ -3134,7 +3134,7 @@ void MainWindow::updateRenderingDataAccordingToActions(int /*meshid*/, MLRenderi { if ((meshDoc() == NULL) || (act == NULL)) return; - + QList tmpacts; for (int ii = 0; ii < acts.size(); ++ii) { @@ -3146,20 +3146,20 @@ void MainWindow::updateRenderingDataAccordingToActions(int /*meshid*/, MLRenderi tmpacts.push_back(sisteract); } } - + for (int hh = 0; hh < meshDoc()->meshList.size(); ++hh) { if (meshDoc()->meshList[hh] != NULL) updateRenderingDataAccordingToActionsCommonCode(meshDoc()->meshList[hh]->id(), tmpacts); } - + for (int ii = 0; ii < tmpacts.size(); ++ii) delete tmpacts[ii]; tmpacts.clear(); - + if (GLA() != NULL) GLA()->update(); - + updateLayerDialog(); } @@ -3168,7 +3168,7 @@ void MainWindow::updateRenderingDataAccordingToActionCommonCode(int meshid, MLRe { if ((meshDoc() == NULL) || (act == NULL)) return; - + if (meshid != -1) { MLRenderingData olddt; @@ -3201,7 +3201,7 @@ void MainWindow::updateRenderingDataAccordingToActionToAllVisibleLayers(MLRender { if (meshDoc() == NULL) return; - + for (int ii = 0; ii < meshDoc()->meshList.size(); ++ii) { MeshModel* mm = meshDoc()->meshList[ii]; @@ -3219,7 +3219,7 @@ void MainWindow::updateRenderingDataAccordingToActions(QListmeshList.size(); ++ii) { MeshModel* mm = meshDoc()->meshList[ii]; @@ -3229,7 +3229,7 @@ void MainWindow::updateRenderingDataAccordingToActions(QListmainActions()) updateRenderingDataAccordingToActionCommonCode(mm->id(), ract); - + foreach(MLRenderingAction* ract, act->relatedActions()) updateRenderingDataAccordingToActionCommonCode(mm->id(), ract); } From 527989d78a09e678c0bce0cbc97d74ebf656178c Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Tue, 22 Sep 2020 10:51:56 +0200 Subject: [PATCH 47/49] try using qt 5.15 --- .github/workflows/BuildMacOS.yml | 1 + .github/workflows/BuildUbuntu.yml | 1 + .github/workflows/BuildWindows.yml | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BuildMacOS.yml b/.github/workflows/BuildMacOS.yml index 6ad59ed4e..776d62348 100644 --- a/.github/workflows/BuildMacOS.yml +++ b/.github/workflows/BuildMacOS.yml @@ -20,6 +20,7 @@ jobs: uses: jurplel/install-qt-action@v2 with: modules: xmlpatterns + version: '5.15.0' - name: Setup env variables id: envs shell: bash diff --git a/.github/workflows/BuildUbuntu.yml b/.github/workflows/BuildUbuntu.yml index 0143c97ea..9fdd04926 100644 --- a/.github/workflows/BuildUbuntu.yml +++ b/.github/workflows/BuildUbuntu.yml @@ -16,6 +16,7 @@ jobs: uses: jurplel/install-qt-action@v2 with: modules: xmlpatterns + version: '5.15.0' - name: Install dependencies run: | sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libglew-dev libeigen3-dev libgmp-dev diff --git a/.github/workflows/BuildWindows.yml b/.github/workflows/BuildWindows.yml index 0e4b0ee04..d224c69c8 100644 --- a/.github/workflows/BuildWindows.yml +++ b/.github/workflows/BuildWindows.yml @@ -28,7 +28,7 @@ jobs: uses: jurplel/install-qt-action@v2 with: modules: xmlpatterns - version: '5.14.2' + version: '5.15.0' #mirror: 'http://mirrors.ocf.berkeley.edu/qt/' - name: Build MeshLab run: | @@ -71,7 +71,7 @@ jobs: uses: jurplel/install-qt-action@v2 with: modules: xmlpatterns - version: '5.14.2' + version: '5.15.0' #mirror: 'http://mirrors.ocf.berkeley.edu/qt/' - name: Setup env variables id: envs From 7be5cbf1f80e829a40e644937adf07680c82adbb Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 23 Sep 2020 10:44:44 +0200 Subject: [PATCH 48/49] separated snap workflow build --- .github/workflows/BuildSnap.yml | 35 +++++++++++++++++++++++++++++++ .github/workflows/BuildUbuntu.yml | 30 -------------------------- 2 files changed, 35 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/BuildSnap.yml diff --git a/.github/workflows/BuildSnap.yml b/.github/workflows/BuildSnap.yml new file mode 100644 index 000000000..70bed4efc --- /dev/null +++ b/.github/workflows/BuildSnap.yml @@ -0,0 +1,35 @@ +name: BuildSnap + +on: + workflow_dispatch + +jobs: + ubuntu_build_snap: + name: Build MeshLab (Ubuntu - Snap) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Install dependencies + run: | + #needed for some reason... + curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - + sudo apt update + sudo apt-get install -y snapcraft + - name: Setup env variables + id: envs + run: | + echo ::set-output name=date::"$(cat ML_VERSION)" + - name: Build MeshLab Snap + run: | + snapcraft + - name: Rename Snap + run: | + mv ./meshlab*.snap ./MeshLab${{steps.envs.outputs.date}}-linux.snap + - name: Upload Meshlab Snap + uses: actions/upload-artifact@v1 + with: + name: meshlab_linux_snap + path: MeshLab${{steps.envs.outputs.date}}-linux.snap diff --git a/.github/workflows/BuildUbuntu.yml b/.github/workflows/BuildUbuntu.yml index 9fdd04926..f5afa4162 100644 --- a/.github/workflows/BuildUbuntu.yml +++ b/.github/workflows/BuildUbuntu.yml @@ -53,36 +53,6 @@ jobs: name: meshlab_linux_appimage path: MeshLab${{steps.envs.outputs.date}}-linux.AppImage - ubuntu_build_snap: - name: Build MeshLab (Ubuntu - Snap) - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - name: Install dependencies - run: | - #needed for some reason... - curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - - sudo apt update - sudo apt-get install -y snapcraft - - name: Setup env variables - id: envs - run: | - echo ::set-output name=date::"$(cat ML_VERSION)" - - name: Build MeshLab Snap - run: | - snapcraft - - name: Rename Snap - run: | - mv ./meshlab*.snap ./MeshLab${{steps.envs.outputs.date}}-linux.snap - - name: Upload Meshlab Snap - uses: actions/upload-artifact@v1 - with: - name: meshlab_linux_snap - path: MeshLab${{steps.envs.outputs.date}}-linux.snap - ubuntu_build_cmake: name: Build MeshLab (Ubuntu - CMake) runs-on: ubuntu-latest From 870116339227d3023595e4cc5e20ff742dc04814 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 23 Sep 2020 10:53:46 +0200 Subject: [PATCH 49/49] using qt 5.15 in build and release --- .github/workflows/BuildAndRelease.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index 12331a0e4..b2b367d79 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -54,6 +54,7 @@ jobs: uses: jurplel/install-qt-action@v2 with: modules: xmlpatterns + version: '5.15.0' - name: Install dependencies run: | sudo apt-get install -y mesa-common-dev libglu1-mesa-dev libglew-dev libeigen3-dev libgmp-dev @@ -140,6 +141,7 @@ jobs: uses: jurplel/install-qt-action@v2 with: modules: xmlpatterns + version: '5.15.0' - name: Setup env variables id: envs shell: bash @@ -194,8 +196,7 @@ jobs: uses: jurplel/install-qt-action@v2 with: modules: xmlpatterns - version: '5.14.2' - #mirror: 'http://mirrors.ocf.berkeley.edu/qt/' + version: '5.15.0' - name: Build MeshLab run: | .\install\windows\windows_build.ps1
    Hop Thr:%8.3f (Wheel to change it)
    Radius: %8.3f (Drag or Alt+Wheel to change it)